diff --git a/packages/user-access-policy/src/api/apiEndpoint.ts b/packages/user-access-policy/src/api/apiEndpoint.ts index 50e7b84497..277428b7fe 100644 --- a/packages/user-access-policy/src/api/apiEndpoint.ts +++ b/packages/user-access-policy/src/api/apiEndpoint.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { ZodType, z } from "zod"; -import type ApiResponse from "./response/apiResponse.js"; +import type { ApiResponse } from "./response/apiResponse.js"; interface ApiEndpoint { processRequest: T extends ZodType @@ -22,4 +22,4 @@ interface ApiEndpoint { getRequestArgsSchema(): T; } -export default ApiEndpoint; +export type { ApiEndpoint }; diff --git a/packages/user-access-policy/src/api/express/expressEndpointAdapter.ts b/packages/user-access-policy/src/api/express/expressEndpointAdapter.ts index fee076a3a5..d3862483c5 100644 --- a/packages/user-access-policy/src/api/express/expressEndpointAdapter.ts +++ b/packages/user-access-policy/src/api/express/expressEndpointAdapter.ts @@ -14,7 +14,7 @@ import type { Logger } from "@prosopo/common"; import type { Request, Response } from "express"; import type { ZodType } from "zod"; -import type ApiEndpoint from "../apiEndpoint.js"; +import type {ApiEndpoint} from "../apiEndpoint.js"; class ExpressEndpointAdapter { public constructor(private readonly logger: Logger | null) {} @@ -38,4 +38,4 @@ class ExpressEndpointAdapter { } } -export default ExpressEndpointAdapter; +export { ExpressEndpointAdapter }; diff --git a/packages/user-access-policy/src/api/express/expressRouterFactory.ts b/packages/user-access-policy/src/api/express/expressRouterFactory.ts index e4f2839d39..7f4837e9e9 100644 --- a/packages/user-access-policy/src/api/express/expressRouterFactory.ts +++ b/packages/user-access-policy/src/api/express/expressRouterFactory.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Router } from "express"; -import type RulesStorage from "../../rule/storage/rulesStorage.js"; -import type ApiRoutesProvider from "../route/apiRoutesProvider.js"; -import type ExpressRoutesRegistrar from "./expressRoutesRegistrar.js"; +import type {RulesStorage} from "../../rule/storage/rulesStorage.js"; +import type {ApiRoutesProvider} from "../route/apiRoutesProvider.js"; +import type { ExpressRoutesRegistrar } from "./expressRoutesRegistrar.js"; class ExpressRouterFactory { public createRouter( @@ -32,4 +32,4 @@ class ExpressRouterFactory { } } -export default ExpressRouterFactory; +export { ExpressRouterFactory }; diff --git a/packages/user-access-policy/src/api/express/expressRoutesRegistrar.ts b/packages/user-access-policy/src/api/express/expressRoutesRegistrar.ts index b58b2e955d..1cce268ecf 100644 --- a/packages/user-access-policy/src/api/express/expressRoutesRegistrar.ts +++ b/packages/user-access-policy/src/api/express/expressRoutesRegistrar.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { Request, Response, Router } from "express"; -import type ApiRoute from "../route/apiRoute.js"; -import type ExpressEndpointAdapter from "./expressEndpointAdapter.js"; +import type {ApiRoute} from "../route/apiRoute.js"; +import type { ExpressEndpointAdapter } from "./expressEndpointAdapter.js"; class ExpressRoutesRegistrar { public constructor( @@ -36,4 +36,4 @@ class ExpressRoutesRegistrar { } } -export default ExpressRoutesRegistrar; +export { ExpressRoutesRegistrar }; diff --git a/packages/user-access-policy/src/api/response/apiResponse.ts b/packages/user-access-policy/src/api/response/apiResponse.ts index b7256aca9e..8ac69cb33b 100644 --- a/packages/user-access-policy/src/api/response/apiResponse.ts +++ b/packages/user-access-policy/src/api/response/apiResponse.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type ApiResponseStatus from "./apiResponseStatus.js"; +import type {ApiResponseStatus} from "./apiResponseStatus.js"; interface ApiResponse { status: ApiResponseStatus; @@ -19,4 +19,4 @@ interface ApiResponse { data?: object; } -export default ApiResponse; +export type { ApiResponse }; diff --git a/packages/user-access-policy/src/api/response/apiResponseStatus.ts b/packages/user-access-policy/src/api/response/apiResponseStatus.ts index eaba2cb0c8..89c4da744c 100644 --- a/packages/user-access-policy/src/api/response/apiResponseStatus.ts +++ b/packages/user-access-policy/src/api/response/apiResponseStatus.ts @@ -16,4 +16,4 @@ enum ApiResponseStatus { FAIL = "FAIL", } -export default ApiResponseStatus; +export { ApiResponseStatus }; diff --git a/packages/user-access-policy/src/api/route/apiRoute.ts b/packages/user-access-policy/src/api/route/apiRoute.ts index c748f6de25..2e4d7072cc 100644 --- a/packages/user-access-policy/src/api/route/apiRoute.ts +++ b/packages/user-access-policy/src/api/route/apiRoute.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { ZodType } from "zod"; -import type ApiEndpoint from "../apiEndpoint.js"; +import type {ApiEndpoint} from "../apiEndpoint.js"; interface ApiRoute { path: string; endpoint: ApiEndpoint; } -export default ApiRoute; +export type { ApiRoute }; diff --git a/packages/user-access-policy/src/api/route/apiRoutesProvider.ts b/packages/user-access-policy/src/api/route/apiRoutesProvider.ts index 70b6608060..8cff787b00 100644 --- a/packages/user-access-policy/src/api/route/apiRoutesProvider.ts +++ b/packages/user-access-policy/src/api/route/apiRoutesProvider.ts @@ -1,4 +1,3 @@ -import type RulesStorage from "../../rule/storage/rulesStorage.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,10 +11,11 @@ import type RulesStorage from "../../rule/storage/rulesStorage.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type ApiRoute from "./apiRoute.js"; +import type { ApiRoute } from "./apiRoute.js"; +import type {RulesStorage} from "../../rule/storage/rulesStorage.js"; interface ApiRoutesProvider { getRoutes(rulesStorage: RulesStorage): ApiRoute[]; } -export default ApiRoutesProvider; +export type { ApiRoutesProvider }; diff --git a/packages/user-access-policy/src/config/config.ts b/packages/user-access-policy/src/config/config.ts index 22442bdf68..05a411b656 100644 --- a/packages/user-access-policy/src/config/config.ts +++ b/packages/user-access-policy/src/config/config.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodConfig from "./zodConfig.js"; +import type {zodConfig} from "./zodConfig.js"; type Config = z.infer; -export default Config; +export type { Config }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/imageCaptchaConfig.ts b/packages/user-access-policy/src/config/imageCaptcha/imageCaptchaConfig.ts index f28337b4a3..03cbb74fb9 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/imageCaptchaConfig.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/imageCaptchaConfig.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodImageCaptchaConfig from "./zodImageCaptchaConfig.js"; +import type {zodImageCaptchaConfig} from "./zodImageCaptchaConfig.js"; type ImageCaptchaConfig = z.infer; -export default ImageCaptchaConfig; +export type { ImageCaptchaConfig }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/mongooseImageCaptchaConfig.ts b/packages/user-access-policy/src/config/imageCaptcha/mongooseImageCaptchaConfig.ts index f263b563cb..4987adac77 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/mongooseImageCaptchaConfig.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/mongooseImageCaptchaConfig.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type ImageCaptchaConfig from "./imageCaptchaConfig.js"; +import type { ImageCaptchaConfig } from "./imageCaptchaConfig.js"; const mongooseImageCaptchaConfig = new Schema( { @@ -28,4 +28,4 @@ const mongooseImageCaptchaConfig = new Schema( { _id: false }, ); -export default mongooseImageCaptchaConfig; +export { mongooseImageCaptchaConfig }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/resolver/captchaConfigResolver.ts b/packages/user-access-policy/src/config/imageCaptcha/resolver/captchaConfigResolver.ts index 85e69286d3..e5fc5dad8d 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/resolver/captchaConfigResolver.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/resolver/captchaConfigResolver.ts @@ -1,7 +1,3 @@ -import type { - IPAddress, - ProsopoCaptchaCountConfigSchemaOutput, -} from "@prosopo/types"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +11,11 @@ import type { // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type RulesStorage from "../../../rule/storage/rulesStorage.js"; +import type {RulesStorage} from "../../../rule/storage/rulesStorage.js"; +import type { + IPAddress, + ProsopoCaptchaCountConfigSchemaOutput, +} from "@prosopo/types"; interface CaptchaConfigResolver { resolveConfig( @@ -27,4 +27,4 @@ interface CaptchaConfigResolver { ): Promise; } -export default CaptchaConfigResolver; +export type { CaptchaConfigResolver }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/resolver/createImageCaptchaConfigResolver.ts b/packages/user-access-policy/src/config/imageCaptcha/resolver/createImageCaptchaConfigResolver.ts index 384bb3e853..0d982bcb45 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/resolver/createImageCaptchaConfigResolver.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/resolver/createImageCaptchaConfigResolver.ts @@ -11,9 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type CaptchaConfigResolver from "./captchaConfigResolver.js"; -import ImageCaptchaConfigResolver from "./imageCaptchaConfigResolver.js"; +import type { CaptchaConfigResolver } from "./captchaConfigResolver.js"; +import { ImageCaptchaConfigResolver } from "./imageCaptchaConfigResolver.js"; -export default function (): CaptchaConfigResolver { +const createImageCaptchaConfigResolver = (): CaptchaConfigResolver => { return new ImageCaptchaConfigResolver(); -} +}; + +export { createImageCaptchaConfigResolver }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/resolver/imageCaptchaConfigResolver.ts b/packages/user-access-policy/src/config/imageCaptcha/resolver/imageCaptchaConfigResolver.ts index 6dc18d2b4e..fe872ff8ac 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/resolver/imageCaptchaConfigResolver.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/resolver/imageCaptchaConfigResolver.ts @@ -15,10 +15,10 @@ import type { IPAddress, ProsopoCaptchaCountConfigSchemaOutput, } from "@prosopo/types"; -import type Rule from "../../../rule/rule.js"; -import type RulesStorage from "../../../rule/storage/rulesStorage.js"; -import type ImageCaptchaConfig from "../imageCaptchaConfig.js"; -import type CaptchaConfigResolver from "./captchaConfigResolver.js"; +import type {Rule} from "../../../rule/rule.js"; +import type {RulesStorage} from "../../../rule/storage/rulesStorage.js"; +import type {ImageCaptchaConfig} from "../imageCaptchaConfig.js"; +import type { CaptchaConfigResolver } from "./captchaConfigResolver.js"; class ImageCaptchaConfigResolver implements CaptchaConfigResolver { public async resolveConfig( @@ -108,4 +108,4 @@ class ImageCaptchaConfigResolver implements CaptchaConfigResolver { } } -export default ImageCaptchaConfigResolver; +export { ImageCaptchaConfigResolver }; diff --git a/packages/user-access-policy/src/config/imageCaptcha/resolver/testImageCaptchaConfigResolver.spec.ts b/packages/user-access-policy/src/config/imageCaptcha/resolver/testImageCaptchaConfigResolver.spec.ts index 7a9b9b83c5..36c602e4b8 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/resolver/testImageCaptchaConfigResolver.spec.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/resolver/testImageCaptchaConfigResolver.spec.ts @@ -14,14 +14,14 @@ import type { ProsopoCaptchaCountConfigSchemaOutput } from "@prosopo/types"; import { Address4 } from "ip-address"; import { describe, expect, it } from "vitest"; -import type Rule from "../../../rule/rule.js"; -import type DeleteRuleFilters from "../../../rule/storage/delete/deleteRuleFilters.js"; -import type RuleRecord from "../../../rule/storage/record/ruleRecord.js"; -import type RulesStorage from "../../../rule/storage/rulesStorage.js"; -import type SearchRuleFilterSettings from "../../../rule/storage/search/searchRuleFilterSettings.js"; -import type SearchRuleFilters from "../../../rule/storage/search/searchRuleFilters.js"; +import type {Rule} from "../../../rule/rule.js"; +import type {DeleteRuleFilters} from "../../../rule/storage/delete/deleteRuleFilters.js"; +import type {RuleRecord} from "../../../rule/storage/record/ruleRecord.js"; +import type {RulesStorage} from "../../../rule/storage/rulesStorage.js"; +import type {SearchRuleFilterSettings} from "../../../rule/storage/search/searchRuleFilterSettings.js"; +import type {SearchRuleFilters} from "../../../rule/storage/search/searchRuleFilters.js"; import { TestsBase } from "../../../testsBase.js"; -import ImageCaptchaConfigResolver from "./imageCaptchaConfigResolver.js"; +import { ImageCaptchaConfigResolver } from "./imageCaptchaConfigResolver.js"; class TestImageCaptchaConfigResolver extends TestsBase { constructor(private readonly resolver: ImageCaptchaConfigResolver) { diff --git a/packages/user-access-policy/src/config/imageCaptcha/zodImageCaptchaConfig.ts b/packages/user-access-policy/src/config/imageCaptcha/zodImageCaptchaConfig.ts index bb40ca5b32..858b4fa903 100644 --- a/packages/user-access-policy/src/config/imageCaptcha/zodImageCaptchaConfig.ts +++ b/packages/user-access-policy/src/config/imageCaptcha/zodImageCaptchaConfig.ts @@ -18,4 +18,4 @@ const zodImageCaptchaConfig = object({ unsolvedCount: number().optional(), }); -export default zodImageCaptchaConfig; +export { zodImageCaptchaConfig }; diff --git a/packages/user-access-policy/src/config/mongooseConfig.ts b/packages/user-access-policy/src/config/mongooseConfig.ts index 794bb6a269..b03a7e91ac 100644 --- a/packages/user-access-policy/src/config/mongooseConfig.ts +++ b/packages/user-access-policy/src/config/mongooseConfig.ts @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type Config from "./config.js"; -import MongooseImageCaptchaConfig from "./imageCaptcha/mongooseImageCaptchaConfig.js"; +import type { Config } from "./config.js"; +import { mongooseImageCaptchaConfig } from "./imageCaptcha/mongooseImageCaptchaConfig.js"; const mongooseConfig = new Schema( { imageCaptcha: { - type: MongooseImageCaptchaConfig, + type: mongooseImageCaptchaConfig, required: false, }, }, { _id: false }, ); -export default mongooseConfig; +export { mongooseConfig }; diff --git a/packages/user-access-policy/src/config/zodConfig.ts b/packages/user-access-policy/src/config/zodConfig.ts index fbede3e943..4abac3456f 100644 --- a/packages/user-access-policy/src/config/zodConfig.ts +++ b/packages/user-access-policy/src/config/zodConfig.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. import { object } from "zod"; -import zodImageCaptchaConfig from "./imageCaptcha/zodImageCaptchaConfig.js"; +import { zodImageCaptchaConfig } from "./imageCaptcha/zodImageCaptchaConfig.js"; const zodConfig = object({ imageCaptcha: zodImageCaptchaConfig.optional(), }); -export default zodConfig; +export { zodConfig }; diff --git a/packages/user-access-policy/src/index.ts b/packages/user-access-policy/src/index.ts index 8d1c270d95..be4b4dfd7f 100644 --- a/packages/user-access-policy/src/index.ts +++ b/packages/user-access-policy/src/index.ts @@ -1,8 +1,3 @@ -import createImageCaptchaConfigResolver from "./config/imageCaptcha/resolver/createImageCaptchaConfigResolver.js"; -import createRequestInspector from "./requestInspector/createRequestInspector.js"; -import type RequestInspector from "./requestInspector/requestInspector.js"; -import createExpressRuleRouter from "./rule/api/createExpressRuleRouter.js"; -import getExpressApiRuleRateLimits from "./rule/api/getExpressApiRuleRateLimits.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,10 +11,15 @@ import getExpressApiRuleRateLimits from "./rule/api/getExpressApiRuleRateLimits. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Rule from "./rule/rule.js"; -import createMongooseRulesStorage from "./rule/storage/createMongooseRulesStorage.js"; -import getMongooseRuleRecordSchema from "./rule/storage/record/getMongooseRuleRecordSchema.js"; -import type RulesStorage from "./rule/storage/rulesStorage.js"; +import type { Rule } from "./rule/rule.js"; +import { createMongooseRulesStorage } from "./rule/storage/createMongooseRulesStorage.js"; +import { getMongooseRuleRecordSchema } from "./rule/storage/record/getMongooseRuleRecordSchema.js"; +import type { RulesStorage } from "./rule/storage/rulesStorage.js"; +import { createImageCaptchaConfigResolver } from "./config/imageCaptcha/resolver/createImageCaptchaConfigResolver.js"; +import { createRequestInspector } from "./requestInspector/createRequestInspector.js"; +import type { RequestInspector } from "./requestInspector/requestInspector.js"; +import { createExpressRuleRouter } from "./rule/api/createExpressRuleRouter.js"; +import { getExpressApiRuleRateLimits } from "./rule/api/getExpressApiRuleRateLimits.js"; export { type Rule, diff --git a/packages/user-access-policy/src/ip/ip.ts b/packages/user-access-policy/src/ip/ip.ts index e0f2b67f2d..0d27187bf9 100644 --- a/packages/user-access-policy/src/ip/ip.ts +++ b/packages/user-access-policy/src/ip/ip.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodIp from "./zodIp.js"; +import type {zodIp} from "./zodIp.js"; type Ip = z.infer; -export default Ip; +export type { Ip }; diff --git a/packages/user-access-policy/src/ip/ipVersion.ts b/packages/user-access-policy/src/ip/ipVersion.ts index 66a9cdbb20..ebb99851a3 100644 --- a/packages/user-access-policy/src/ip/ipVersion.ts +++ b/packages/user-access-policy/src/ip/ipVersion.ts @@ -16,4 +16,4 @@ enum IpVersion { v6 = "v6", } -export default IpVersion; +export { IpVersion }; diff --git a/packages/user-access-policy/src/ip/mongooseIp.ts b/packages/user-access-policy/src/ip/mongooseIp.ts index 056a5eb734..8d650f23c6 100644 --- a/packages/user-access-policy/src/ip/mongooseIp.ts +++ b/packages/user-access-policy/src/ip/mongooseIp.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type Ip from "./ip.js"; -import mongooseIpV4 from "./v4/mongooseIpV4.js"; -import mongooseIpV6 from "./v6/mongooseIpV6.js"; +import type { Ip } from "./ip.js"; +import { mongooseIpV4 } from "./v4/mongooseIpV4.js"; +import { mongooseIpV6 } from "./v6/mongooseIpV6.js"; const mongooseIp = new Schema( { @@ -44,4 +44,4 @@ const mongooseIp = new Schema( { _id: false }, ); -export default mongooseIp; +export { mongooseIp }; diff --git a/packages/user-access-policy/src/ip/v4/ipV4.ts b/packages/user-access-policy/src/ip/v4/ipV4.ts index b6ea00e8f1..5c5d760dea 100644 --- a/packages/user-access-policy/src/ip/v4/ipV4.ts +++ b/packages/user-access-policy/src/ip/v4/ipV4.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodIpV4 from "./zodIpV4.js"; +import type {zodIpV4} from "./zodIpV4.js"; type IpV4 = z.infer; -export default IpV4; +export type { IpV4}; diff --git a/packages/user-access-policy/src/ip/v4/mask/ipV4Mask.ts b/packages/user-access-policy/src/ip/v4/mask/ipV4Mask.ts index 15d59e6a80..c8fbd3effd 100644 --- a/packages/user-access-policy/src/ip/v4/mask/ipV4Mask.ts +++ b/packages/user-access-policy/src/ip/v4/mask/ipV4Mask.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodIpV4Mask from "./zodIpV4Mask.js"; +import type {zodIpV4Mask} from "./zodIpV4Mask.js"; type IpV4Mask = z.infer; -export default IpV4Mask; +export type { IpV4Mask}; diff --git a/packages/user-access-policy/src/ip/v4/mask/mongooseIpV4Mask.ts b/packages/user-access-policy/src/ip/v4/mask/mongooseIpV4Mask.ts index 06c6e33fac..11a440fd75 100644 --- a/packages/user-access-policy/src/ip/v4/mask/mongooseIpV4Mask.ts +++ b/packages/user-access-policy/src/ip/v4/mask/mongooseIpV4Mask.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type IpV4Mask from "./ipV4Mask.js"; +import type {IpV4Mask} from "./ipV4Mask.js"; const mongooseIpV4Mask = new Schema( { @@ -25,4 +25,4 @@ const mongooseIpV4Mask = new Schema( { _id: false }, ); -export default mongooseIpV4Mask; +export { mongooseIpV4Mask}; diff --git a/packages/user-access-policy/src/ip/v4/mask/zodIpV4Mask.ts b/packages/user-access-policy/src/ip/v4/mask/zodIpV4Mask.ts index f16fde9b2c..5719cc6288 100644 --- a/packages/user-access-policy/src/ip/v4/mask/zodIpV4Mask.ts +++ b/packages/user-access-policy/src/ip/v4/mask/zodIpV4Mask.ts @@ -19,4 +19,4 @@ const zodIpV4Mask = object({ asNumeric: number(), }); -export default zodIpV4Mask; +export { zodIpV4Mask}; diff --git a/packages/user-access-policy/src/ip/v4/mongooseIpV4.ts b/packages/user-access-policy/src/ip/v4/mongooseIpV4.ts index d01ebcb69f..66b05287c5 100644 --- a/packages/user-access-policy/src/ip/v4/mongooseIpV4.ts +++ b/packages/user-access-policy/src/ip/v4/mongooseIpV4.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type IpV4 from "./ipV4.js"; -import mongooseIpV4Mask from "./mask/mongooseIpV4Mask.js"; +import type {IpV4} from "./ipV4.js"; +import {mongooseIpV4Mask} from "./mask/mongooseIpV4Mask.js"; const mongooseIpV4 = new Schema( { @@ -29,4 +29,4 @@ const mongooseIpV4 = new Schema( { _id: false }, ); -export default mongooseIpV4; +export { mongooseIpV4}; diff --git a/packages/user-access-policy/src/ip/v4/zodIpV4.ts b/packages/user-access-policy/src/ip/v4/zodIpV4.ts index f241ac7470..1f0e9802b3 100644 --- a/packages/user-access-policy/src/ip/v4/zodIpV4.ts +++ b/packages/user-access-policy/src/ip/v4/zodIpV4.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { bigint, object, string } from "zod"; -import zodIpV4Mask from "./mask/zodIpV4Mask.js"; +import {zodIpV4Mask} from "./mask/zodIpV4Mask.js"; const zodIpV4 = object({ asNumeric: bigint(), @@ -20,4 +20,4 @@ const zodIpV4 = object({ mask: zodIpV4Mask.optional(), }); -export default zodIpV4; +export { zodIpV4}; diff --git a/packages/user-access-policy/src/ip/v6/ipV6.ts b/packages/user-access-policy/src/ip/v6/ipV6.ts index cc2d3c87c3..cac5227b71 100644 --- a/packages/user-access-policy/src/ip/v6/ipV6.ts +++ b/packages/user-access-policy/src/ip/v6/ipV6.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodIpV6 from "./zodIpV6.js"; +import type {zodIpV6} from "./zodIpV6.js"; type IpV6 = z.infer; -export default IpV6; +export type { IpV6}; diff --git a/packages/user-access-policy/src/ip/v6/ipV6NumericMaxLength.ts b/packages/user-access-policy/src/ip/v6/ipV6NumericMaxLength.ts index 3be35a9244..7be865da99 100644 --- a/packages/user-access-policy/src/ip/v6/ipV6NumericMaxLength.ts +++ b/packages/user-access-policy/src/ip/v6/ipV6NumericMaxLength.ts @@ -13,4 +13,4 @@ // limitations under the License. const IPV6_NUMERIC_MAX_LENGTH = 38; -export default IPV6_NUMERIC_MAX_LENGTH; +export { IPV6_NUMERIC_MAX_LENGTH }; diff --git a/packages/user-access-policy/src/ip/v6/mask/ipV6Mask.ts b/packages/user-access-policy/src/ip/v6/mask/ipV6Mask.ts index 150340207c..e5a551175d 100644 --- a/packages/user-access-policy/src/ip/v6/mask/ipV6Mask.ts +++ b/packages/user-access-policy/src/ip/v6/mask/ipV6Mask.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type zodIpV6Mask from "./zodIpV6Mask.js"; +import type {zodIpV6Mask} from "./zodIpV6Mask.js"; type IpV6Mask = z.infer; -export default IpV6Mask; +export type{ IpV6Mask}; diff --git a/packages/user-access-policy/src/ip/v6/mask/mongooseIpV6Mask.ts b/packages/user-access-policy/src/ip/v6/mask/mongooseIpV6Mask.ts index af086da43f..ff51e55b56 100644 --- a/packages/user-access-policy/src/ip/v6/mask/mongooseIpV6Mask.ts +++ b/packages/user-access-policy/src/ip/v6/mask/mongooseIpV6Mask.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import IPV6_NUMERIC_MAX_LENGTH from "../ipV6NumericMaxLength.js"; -import type IpV6Mask from "./ipV6Mask.js"; +import {IPV6_NUMERIC_MAX_LENGTH} from "../ipV6NumericMaxLength.js"; +import type { IpV6Mask} from "./ipV6Mask.js"; const mongooseIpV6Mask = new Schema( { @@ -47,4 +47,4 @@ const mongooseIpV6Mask = new Schema( { _id: false }, ); -export default mongooseIpV6Mask; +export { mongooseIpV6Mask}; diff --git a/packages/user-access-policy/src/ip/v6/mask/zodIpV6Mask.ts b/packages/user-access-policy/src/ip/v6/mask/zodIpV6Mask.ts index 5953e8bbc5..601c64e2ee 100644 --- a/packages/user-access-policy/src/ip/v6/mask/zodIpV6Mask.ts +++ b/packages/user-access-policy/src/ip/v6/mask/zodIpV6Mask.ts @@ -19,4 +19,4 @@ const zodIpV6Mask = object({ asNumeric: number(), }); -export default zodIpV6Mask; +export { zodIpV6Mask}; diff --git a/packages/user-access-policy/src/ip/v6/mongooseIpV6.ts b/packages/user-access-policy/src/ip/v6/mongooseIpV6.ts index 2702cce91b..296f2e5b8f 100644 --- a/packages/user-access-policy/src/ip/v6/mongooseIpV6.ts +++ b/packages/user-access-policy/src/ip/v6/mongooseIpV6.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import type IpV6 from "./ipV6.js"; -import IPV6_NUMERIC_MAX_LENGTH from "./ipV6NumericMaxLength.js"; -import MongooseIpV6Mask from "./mask/mongooseIpV6Mask.js"; +import type { IpV6 } from "./ipV6.js"; +import { IPV6_NUMERIC_MAX_LENGTH } from "./ipV6NumericMaxLength.js"; +import { mongooseIpV6Mask } from "./mask/mongooseIpV6Mask.js"; const mongooseIpV6 = new Schema( { @@ -38,11 +38,11 @@ const mongooseIpV6 = new Schema( }, asString: { type: String, required: true }, mask: { - type: MongooseIpV6Mask, + type: mongooseIpV6Mask, required: false, }, }, { _id: false }, ); -export default mongooseIpV6; +export { mongooseIpV6 }; diff --git a/packages/user-access-policy/src/ip/v6/zodIpV6.ts b/packages/user-access-policy/src/ip/v6/zodIpV6.ts index 73e65e96ae..f6eb67f320 100644 --- a/packages/user-access-policy/src/ip/v6/zodIpV6.ts +++ b/packages/user-access-policy/src/ip/v6/zodIpV6.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { object, string } from "zod"; -import zodIpV6Mask from "./mask/zodIpV6Mask.js"; +import { zodIpV6Mask } from "./mask/zodIpV6Mask.js"; const zodIpV6 = object({ asNumericString: string(), @@ -20,4 +20,4 @@ const zodIpV6 = object({ mask: zodIpV6Mask.optional(), }); -export default zodIpV6; +export { zodIpV6 }; diff --git a/packages/user-access-policy/src/ip/zodIp.ts b/packages/user-access-policy/src/ip/zodIp.ts index 81764fee06..d0e5fbdabf 100644 --- a/packages/user-access-policy/src/ip/zodIp.ts +++ b/packages/user-access-policy/src/ip/zodIp.ts @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. import { object } from "zod"; -import zodIpV4 from "./v4/zodIpV4.js"; -import zodIpV6 from "./v6/zodIpV6.js"; +import { zodIpV4 } from "./v4/zodIpV4.js"; +import { zodIpV6 } from "./v6/zodIpV6.js"; const zodIp = object({ v4: zodIpV4.optional(), v6: zodIpV6.optional(), }); -export default zodIp; +export { zodIp }; diff --git a/packages/user-access-policy/src/requestInspector/createRequestInspector.ts b/packages/user-access-policy/src/requestInspector/createRequestInspector.ts index 6843c97a58..fda0483e2f 100644 --- a/packages/user-access-policy/src/requestInspector/createRequestInspector.ts +++ b/packages/user-access-policy/src/requestInspector/createRequestInspector.ts @@ -1,4 +1,3 @@ -import type RulesStorage from "../rule/storage/rulesStorage.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,9 +11,14 @@ import type RulesStorage from "../rule/storage/rulesStorage.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type RequestInspector from "./requestInspector.js"; -import RequestRulesInspector from "./requestRulesInspector.js"; +import type {RequestInspector} from "./requestInspector.js"; +import {RequestRulesInspector} from "./requestRulesInspector.js"; +import type {RulesStorage} from "../rule/storage/rulesStorage.js"; -export default function (rulesStorage: RulesStorage): RequestInspector { +const createRequestInspector = ( + rulesStorage: RulesStorage, +): RequestInspector => { return new RequestRulesInspector(rulesStorage); -} +}; + +export { createRequestInspector }; diff --git a/packages/user-access-policy/src/requestInspector/requestInspector.ts b/packages/user-access-policy/src/requestInspector/requestInspector.ts index fd912a31a9..7741b9b323 100644 --- a/packages/user-access-policy/src/requestInspector/requestInspector.ts +++ b/packages/user-access-policy/src/requestInspector/requestInspector.ts @@ -21,4 +21,4 @@ interface RequestInspector { ): Promise; } -export default RequestInspector; +export type { RequestInspector }; diff --git a/packages/user-access-policy/src/requestInspector/requestRulesInspector.ts b/packages/user-access-policy/src/requestInspector/requestRulesInspector.ts index b042a8ae39..69127aa17c 100644 --- a/packages/user-access-policy/src/requestInspector/requestRulesInspector.ts +++ b/packages/user-access-policy/src/requestInspector/requestRulesInspector.ts @@ -1,4 +1,3 @@ -import type { IPAddress } from "@prosopo/types"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +11,9 @@ import type { IPAddress } from "@prosopo/types"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type RulesStorage from "../rule/storage/rulesStorage.js"; -import type RequestInspector from "./requestInspector.js"; +import type {RulesStorage} from "../rule/storage/rulesStorage.js"; +import type { RequestInspector } from "./requestInspector.js"; +import type { IPAddress } from "@prosopo/types"; class RequestRulesInspector implements RequestInspector { public constructor(private readonly rulesStorage: RulesStorage) {} @@ -97,4 +97,4 @@ class RequestRulesInspector implements RequestInspector { } } -export default RequestRulesInspector; +export { RequestRulesInspector }; diff --git a/packages/user-access-policy/src/requestInspector/testRequestRulesInspector.spec.ts b/packages/user-access-policy/src/requestInspector/testRequestRulesInspector.spec.ts index 169b79532f..2f8186dc44 100644 --- a/packages/user-access-policy/src/requestInspector/testRequestRulesInspector.spec.ts +++ b/packages/user-access-policy/src/requestInspector/testRequestRulesInspector.spec.ts @@ -1,4 +1,3 @@ -import { Address4 } from "ip-address"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,14 +12,15 @@ import { Address4 } from "ip-address"; // See the License for the specific language governing permissions and // limitations under the License. import { describe, expect } from "vitest"; -import type Rule from "../rule/rule.js"; -import type DeleteRuleFilters from "../rule/storage/delete/deleteRuleFilters.js"; -import type RuleRecord from "../rule/storage/record/ruleRecord.js"; -import type RulesStorage from "../rule/storage/rulesStorage.js"; -import type SearchRuleFilterSettings from "../rule/storage/search/searchRuleFilterSettings.js"; -import type SearchRuleFilters from "../rule/storage/search/searchRuleFilters.js"; +import type {Rule} from "../rule/rule.js"; +import type {DeleteRuleFilters} from "../rule/storage/delete/deleteRuleFilters.js"; +import type {RuleRecord} from "../rule/storage/record/ruleRecord.js"; +import type {RulesStorage} from "../rule/storage/rulesStorage.js"; +import type {SearchRuleFilterSettings} from "../rule/storage/search/searchRuleFilterSettings.js"; +import type {SearchRuleFilters} from "../rule/storage/search/searchRuleFilters.js"; import { TestsBase } from "../testsBase.js"; -import RequestRulesInspector from "./requestRulesInspector.js"; +import { RequestRulesInspector } from "./requestRulesInspector.js"; +import { Address4 } from "ip-address"; class TestRequestRulesInspector extends TestsBase { protected getTests(): { diff --git a/packages/user-access-policy/src/rule/api/apiRulePaths.ts b/packages/user-access-policy/src/rule/api/apiRulePaths.ts index 2b002e59d6..93c4b723d0 100644 --- a/packages/user-access-policy/src/rule/api/apiRulePaths.ts +++ b/packages/user-access-policy/src/rule/api/apiRulePaths.ts @@ -11,7 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -export default { +const apiRulePaths = { INSERT_MANY: "/v1/prosopo/user-access-policy/rule/insert-many", DELETE_MANY: "/v1/prosopo/user-access-policy/rule/delete-many", }; + +export { apiRulePaths }; diff --git a/packages/user-access-policy/src/rule/api/apiRuleRoutesProvider.ts b/packages/user-access-policy/src/rule/api/apiRuleRoutesProvider.ts index 7a190586c2..be81fed5ad 100644 --- a/packages/user-access-policy/src/rule/api/apiRuleRoutesProvider.ts +++ b/packages/user-access-policy/src/rule/api/apiRuleRoutesProvider.ts @@ -1,4 +1,3 @@ -import type ApiRoute from "../../api/route/apiRoute.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,11 +11,12 @@ import type ApiRoute from "../../api/route/apiRoute.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type ApiRoutesProvider from "../../api/route/apiRoutesProvider.js"; -import type RulesStorage from "../storage/rulesStorage.js"; -import apiRulePaths from "./apiRulePaths.js"; -import ApiDeleteManyRulesEndpoint from "./deleteMany/apiDeleteManyRulesEndpoint.js"; -import InsertManyRulesEndpoint from "./insertMany/insertManyRulesEndpoint.js"; +import type { ApiRoutesProvider } from "../../api/route/apiRoutesProvider.js"; +import type {RulesStorage} from "../storage/rulesStorage.js"; +import { apiRulePaths } from "./apiRulePaths.js"; +import { ApiDeleteManyRulesEndpoint } from "./deleteMany/apiDeleteManyRulesEndpoint.js"; +import { InsertManyRulesEndpoint } from "./insertMany/insertManyRulesEndpoint.js"; +import type { ApiRoute } from "../../api/route/apiRoute.js"; class ApiRuleRoutesProvider implements ApiRoutesProvider { public getRoutes(rulesStorage: RulesStorage): ApiRoute[] { @@ -33,4 +33,4 @@ class ApiRuleRoutesProvider implements ApiRoutesProvider { } } -export default ApiRuleRoutesProvider; +export { ApiRuleRoutesProvider }; diff --git a/packages/user-access-policy/src/rule/api/createExpressRuleRouter.ts b/packages/user-access-policy/src/rule/api/createExpressRuleRouter.ts index ab91d5a939..2bd7dc8628 100644 --- a/packages/user-access-policy/src/rule/api/createExpressRuleRouter.ts +++ b/packages/user-access-policy/src/rule/api/createExpressRuleRouter.ts @@ -1,6 +1,3 @@ -import type { Logger } from "@prosopo/common"; -import type { Router } from "express"; -import ExpressEndpointAdapter from "../../api/express/expressEndpointAdapter.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,12 +11,18 @@ import ExpressEndpointAdapter from "../../api/express/expressEndpointAdapter.js" // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import ExpressRouterFactory from "../../api/express/expressRouterFactory.js"; -import ExpressRoutesRegistrar from "../../api/express/expressRoutesRegistrar.js"; -import type RulesStorage from "../storage/rulesStorage.js"; -import ApiRuleRoutesProvider from "./apiRuleRoutesProvider.js"; +import { ExpressRouterFactory } from "../../api/express/expressRouterFactory.js"; +import { ExpressRoutesRegistrar } from "../../api/express/expressRoutesRegistrar.js"; +import type { RulesStorage } from "../storage/rulesStorage.js"; +import { ApiRuleRoutesProvider } from "./apiRuleRoutesProvider.js"; +import type { Logger } from "@prosopo/common"; +import type { Router } from "express"; +import { ExpressEndpointAdapter } from "../../api/express/expressEndpointAdapter.js"; -export default function (rulesStorage: RulesStorage, logger: Logger): Router { +const createExpressRuleRouter = ( + rulesStorage: RulesStorage, + logger: Logger, +): Router => { const expressEndpointAdapter = new ExpressEndpointAdapter(logger); const expressRouterFactory = new ExpressRouterFactory(); @@ -28,4 +31,6 @@ export default function (rulesStorage: RulesStorage, logger: Logger): Router { new ApiRuleRoutesProvider(), new ExpressRoutesRegistrar(expressEndpointAdapter), ); -} +}; + +export { createExpressRuleRouter }; diff --git a/packages/user-access-policy/src/rule/api/deleteMany/apiDeleteManyRulesEndpoint.ts b/packages/user-access-policy/src/rule/api/deleteMany/apiDeleteManyRulesEndpoint.ts index bbd15c91b5..2fff99103e 100644 --- a/packages/user-access-policy/src/rule/api/deleteMany/apiDeleteManyRulesEndpoint.ts +++ b/packages/user-access-policy/src/rule/api/deleteMany/apiDeleteManyRulesEndpoint.ts @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type ApiEndpoint from "../../../api/apiEndpoint.js"; -import type ApiResponse from "../../../api/response/apiResponse.js"; -import ApiResponseStatus from "../../../api/response/apiResponseStatus.js"; -import type RulesStorage from "../../storage/rulesStorage.js"; -import DeleteManyRulesApiSchema from "./zodDeleteManyRulesSchema.js"; +import type { ApiEndpoint } from "../../../api/apiEndpoint.js"; +import type { ApiResponse } from "../../../api/response/apiResponse.js"; +import { ApiResponseStatus } from "../../../api/response/apiResponseStatus.js"; +import type { RulesStorage } from "../../storage/rulesStorage.js"; +import { zodDeleteManyRulesSchema } from "./zodDeleteManyRulesSchema.js"; class ApiDeleteManyRulesEndpoint - implements ApiEndpoint + implements ApiEndpoint { public constructor(private readonly rulesStorage: RulesStorage) {} async processRequest( - args: z.infer, + args: z.infer, ): Promise { await this.rulesStorage.deleteMany(args); @@ -33,9 +33,9 @@ class ApiDeleteManyRulesEndpoint }; } - public getRequestArgsSchema(): typeof DeleteManyRulesApiSchema { - return DeleteManyRulesApiSchema; + public getRequestArgsSchema(): typeof zodDeleteManyRulesSchema { + return zodDeleteManyRulesSchema; } } -export default ApiDeleteManyRulesEndpoint; +export { ApiDeleteManyRulesEndpoint }; diff --git a/packages/user-access-policy/src/rule/api/deleteMany/zodDeleteManyRulesSchema.ts b/packages/user-access-policy/src/rule/api/deleteMany/zodDeleteManyRulesSchema.ts index 87dd5b82be..2f51fb3af5 100644 --- a/packages/user-access-policy/src/rule/api/deleteMany/zodDeleteManyRulesSchema.ts +++ b/packages/user-access-policy/src/rule/api/deleteMany/zodDeleteManyRulesSchema.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { array, object, string } from "zod"; -import zodIp from "../../../ip/zodIp.js"; +import { zodIp } from "../../../ip/zodIp.js"; const zodDeleteManyRulesSchema = array( object({ @@ -22,4 +22,4 @@ const zodDeleteManyRulesSchema = array( }), ); -export default zodDeleteManyRulesSchema; +export { zodDeleteManyRulesSchema }; diff --git a/packages/user-access-policy/src/rule/api/getExpressApiRuleRateLimits.ts b/packages/user-access-policy/src/rule/api/getExpressApiRuleRateLimits.ts index 21fdb5210b..dc168a3c57 100644 --- a/packages/user-access-policy/src/rule/api/getExpressApiRuleRateLimits.ts +++ b/packages/user-access-policy/src/rule/api/getExpressApiRuleRateLimits.ts @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import apiRulePaths from "./apiRulePaths.js"; +import { apiRulePaths } from "./apiRulePaths.js"; -export default function () { +const getExpressApiRuleRateLimits = () => { const defaultWindowsMs = 60000; const defaultLimit = 5; @@ -35,4 +35,6 @@ export default function () { defaultLimit, }, }; -} +}; + +export { getExpressApiRuleRateLimits }; diff --git a/packages/user-access-policy/src/rule/api/insertMany/insertManyRulesEndpoint.ts b/packages/user-access-policy/src/rule/api/insertMany/insertManyRulesEndpoint.ts index b638b0d29d..2e7b447aa9 100644 --- a/packages/user-access-policy/src/rule/api/insertMany/insertManyRulesEndpoint.ts +++ b/packages/user-access-policy/src/rule/api/insertMany/insertManyRulesEndpoint.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { z } from "zod"; -import type ApiEndpoint from "../../../api/apiEndpoint.js"; -import type ApiResponse from "../../../api/response/apiResponse.js"; -import ApiResponseStatus from "../../../api/response/apiResponseStatus.js"; -import type RulesStorage from "../../storage/rulesStorage.js"; -import zodInsertManyRulesSchema from "./zodInsertManyRulesSchema.js"; +import type { ApiEndpoint } from "../../../api/apiEndpoint.js"; +import type { ApiResponse } from "../../../api/response/apiResponse.js"; +import { ApiResponseStatus } from "../../../api/response/apiResponseStatus.js"; +import type {RulesStorage} from "../../storage/rulesStorage.js"; +import {zodInsertManyRulesSchema} from "./zodInsertManyRulesSchema.js"; class InsertManyRulesEndpoint implements ApiEndpoint @@ -38,4 +38,4 @@ class InsertManyRulesEndpoint } } -export default InsertManyRulesEndpoint; +export { InsertManyRulesEndpoint }; diff --git a/packages/user-access-policy/src/rule/api/insertMany/zodInsertManyRulesSchema.ts b/packages/user-access-policy/src/rule/api/insertMany/zodInsertManyRulesSchema.ts index 0cbfa69291..5615b26710 100644 --- a/packages/user-access-policy/src/rule/api/insertMany/zodInsertManyRulesSchema.ts +++ b/packages/user-access-policy/src/rule/api/insertMany/zodInsertManyRulesSchema.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { array, boolean, object, string } from "zod"; -import zodConfig from "../../../config/zodConfig.js"; -import zodIp from "../../../ip/zodIp.js"; +import { zodConfig } from "../../../config/zodConfig.js"; +import { zodIp } from "../../../ip/zodIp.js"; const zodInsertManyRulesSchema = array( object({ @@ -26,4 +26,4 @@ const zodInsertManyRulesSchema = array( }), ); -export default zodInsertManyRulesSchema; +export { zodInsertManyRulesSchema }; diff --git a/packages/user-access-policy/src/rule/mongooseRule.ts b/packages/user-access-policy/src/rule/mongooseRule.ts index fe30b71e6c..3994ae4526 100644 --- a/packages/user-access-policy/src/rule/mongooseRule.ts +++ b/packages/user-access-policy/src/rule/mongooseRule.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Schema } from "mongoose"; -import mongooseConfig from "../config/mongooseConfig.js"; -import mongooseIp from "../ip/mongooseIp.js"; -import type Rule from "./rule.js"; +import { mongooseConfig } from "../config/mongooseConfig.js"; +import { mongooseIp } from "../ip/mongooseIp.js"; +import type { Rule } from "./rule.js"; const mongooseRule = new Schema({ isUserBlocked: { type: Boolean, required: true }, @@ -49,4 +49,4 @@ const mongooseRule = new Schema({ }, }); -export default mongooseRule; +export { mongooseRule }; diff --git a/packages/user-access-policy/src/rule/rule.ts b/packages/user-access-policy/src/rule/rule.ts index 6ee910ab2e..fc14e49e7b 100644 --- a/packages/user-access-policy/src/rule/rule.ts +++ b/packages/user-access-policy/src/rule/rule.ts @@ -1,4 +1,3 @@ -import type Config from "../config/config.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +11,8 @@ import type Config from "../config/config.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Ip from "../ip/ip.js"; +import type {Ip} from "../ip/ip.js"; +import type {Config} from "../config/config.js"; interface Rule { isUserBlocked: boolean; @@ -23,4 +23,4 @@ interface Rule { config?: Config; } -export default Rule; +export type {Rule}; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/commands/commandBase.ts b/packages/user-access-policy/src/rule/storage/benchmark/commands/commandBase.ts index 57f71079e0..d0df7b8de6 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/commands/commandBase.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/commands/commandBase.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. import type { ArgumentsCamelCase, Argv, CommandModule } from "yargs"; -import type RulesStorage from "../../rulesStorage.js"; -import type rulesStorageFactory from "../storageFactory/rulesStorageFactory.js"; +import type { RulesStorage } from "../../rulesStorage.js"; +import type { RulesStorageFactory } from "../storageFactory/rulesStorageFactory.js"; abstract class CommandBase implements CommandModule { abstract command: string; abstract describe: string; - public constructor(private readonly storageFactory: rulesStorageFactory) {} + public constructor(private readonly storageFactory: RulesStorageFactory) {} public builder(yargs: Argv): Argv { return yargs.option("dbUrl", { @@ -44,4 +44,4 @@ abstract class CommandBase implements CommandModule { } } -export default CommandBase; +export { CommandBase }; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/commands/measureFindCommand.ts b/packages/user-access-policy/src/rule/storage/benchmark/commands/measureFindCommand.ts index cf457aeb1a..bfe7af3acd 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/commands/measureFindCommand.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/commands/measureFindCommand.ts @@ -1,8 +1,3 @@ -import * as util from "node:util"; -import type { IPAddress } from "@prosopo/types"; -import { Address4, Address6 } from "ip-address"; -import type { ArgumentsCamelCase, Argv } from "yargs"; -import type RulesStorage from "../../rulesStorage.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +11,12 @@ import type RulesStorage from "../../rulesStorage.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import CommandBase from "./commandBase.js"; +import { CommandBase } from "./commandBase.js"; +import * as util from "node:util"; +import type { IPAddress } from "@prosopo/types"; +import { Address4, Address6 } from "ip-address"; +import type { ArgumentsCamelCase, Argv } from "yargs"; +import type { RulesStorage } from "../../rulesStorage.js"; class MeasureFindCommand extends CommandBase { public command = "measure-find"; @@ -104,4 +104,4 @@ class MeasureFindCommand extends CommandBase { } } -export default MeasureFindCommand; +export { MeasureFindCommand }; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/commands/populateCommand.ts b/packages/user-access-policy/src/rule/storage/benchmark/commands/populateCommand.ts index 7d4525160f..f1f0ccfe31 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/commands/populateCommand.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/commands/populateCommand.ts @@ -13,8 +13,8 @@ // limitations under the License. import { Address4, Address6 } from "ip-address"; import type { ArgumentsCamelCase, Argv } from "yargs"; -import type RulesStorage from "../../rulesStorage.js"; -import CommandBase from "./commandBase.js"; +import type {RulesStorage} from "../../rulesStorage.js"; +import {CommandBase} from "./commandBase.js"; class PopulateCommand extends CommandBase { public command = "populate"; @@ -140,4 +140,4 @@ class PopulateCommand extends CommandBase { } } -export default PopulateCommand; +export { PopulateCommand}; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/connectionCleaner.ts b/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/connectionCleaner.ts index 8c289beb70..e7358e17a6 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/connectionCleaner.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/connectionCleaner.ts @@ -16,4 +16,4 @@ interface ConnectionCleaner { cleanConnection(): Promise; } -export default ConnectionCleaner; +export type{ ConnectionCleaner}; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/mongooseConnectionCleaner.ts b/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/mongooseConnectionCleaner.ts index 997c1be0a5..15396b9e37 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/mongooseConnectionCleaner.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/connectionCleaner/mongooseConnectionCleaner.ts @@ -1,4 +1,3 @@ -import mongoose from "mongoose"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +11,8 @@ import mongoose from "mongoose"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type ConnectionCleaner from "./connectionCleaner.js"; +import type {ConnectionCleaner} from "./connectionCleaner.js"; +import mongoose from "mongoose"; class MongooseConnectionCleaner implements ConnectionCleaner { public async cleanConnection(): Promise { @@ -20,4 +20,4 @@ class MongooseConnectionCleaner implements ConnectionCleaner { } } -export default MongooseConnectionCleaner; +export { MongooseConnectionCleaner}; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/mongooseRulesStorageBenchmark.ts b/packages/user-access-policy/src/rule/storage/benchmark/mongooseRulesStorageBenchmark.ts index c53d6ea79c..ab56931a48 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/mongooseRulesStorageBenchmark.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/mongooseRulesStorageBenchmark.ts @@ -1,4 +1,3 @@ -import MongooseConnectionCleaner from "./connectionCleaner/mongooseConnectionCleaner.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,8 +11,9 @@ import MongooseConnectionCleaner from "./connectionCleaner/mongooseConnectionCle // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import RulesStorageBenchmark from "./rulesStorageBenchmark.js"; -import MongooseRulesStorageFactory from "./storageFactory/mongooseRulesStorageFactory.js"; +import {RulesStorageBenchmark} from "./rulesStorageBenchmark.js"; +import {MongooseRulesStorageFactory} from "./storageFactory/mongooseRulesStorageFactory.js"; +import {MongooseConnectionCleaner} from "./connectionCleaner/mongooseConnectionCleaner.js"; const rulesStorageFactory = new MongooseRulesStorageFactory(); const connectionCleaner = new MongooseConnectionCleaner(); diff --git a/packages/user-access-policy/src/rule/storage/benchmark/rulesStorageBenchmark.ts b/packages/user-access-policy/src/rule/storage/benchmark/rulesStorageBenchmark.ts index f5a2b9132c..6c1eceac3b 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/rulesStorageBenchmark.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/rulesStorageBenchmark.ts @@ -1,5 +1,3 @@ -import yargs, { type CommandModule } from "yargs"; -import { hideBin } from "yargs/helpers"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,10 +11,12 @@ import { hideBin } from "yargs/helpers"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import MeasureFindCommand from "./commands/measureFindCommand.js"; -import PopulateCommand from "./commands/populateCommand.js"; -import type ConnectionCleaner from "./connectionCleaner/connectionCleaner.js"; -import type RulesStorageFactory from "./storageFactory/rulesStorageFactory.js"; +import { MeasureFindCommand } from "./commands/measureFindCommand.js"; +import { PopulateCommand } from "./commands/populateCommand.js"; +import type { ConnectionCleaner } from "./connectionCleaner/connectionCleaner.js"; +import type { RulesStorageFactory } from "./storageFactory/rulesStorageFactory.js"; +import yargs, { type CommandModule } from "yargs"; +import { hideBin } from "yargs/helpers"; class RulesStorageBenchmark { constructor( @@ -54,4 +54,4 @@ class RulesStorageBenchmark { } } -export default RulesStorageBenchmark; +export { RulesStorageBenchmark }; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/mongooseRulesStorageFactory.ts b/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/mongooseRulesStorageFactory.ts index 89a84ed0ca..aaaf8955d3 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/mongooseRulesStorageFactory.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/mongooseRulesStorageFactory.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. import mongoose, { type Model } from "mongoose"; -import type Rule from "../../../rule.js"; -import MongooseRulesStorage from "../../mongooseRulesStorage.js"; -import getMongooseRuleRecordSchema from "../../record/getMongooseRuleRecordSchema.js"; -import type RulesStorage from "../../rulesStorage.js"; -import type RulesStorageFactory from "./rulesStorageFactory.js"; +import type {Rule} from "../../../rule.js"; +import {MongooseRulesStorage} from "../../mongooseRulesStorage.js"; +import {getMongooseRuleRecordSchema} from "../../record/getMongooseRuleRecordSchema.js"; +import type { RulesStorage } from "../../rulesStorage.js"; +import type {RulesStorageFactory} from "./rulesStorageFactory.js"; class MongooseRulesStorageFactory implements RulesStorageFactory { async createRulesStorage(dbUrl: string): Promise { @@ -35,4 +35,4 @@ class MongooseRulesStorageFactory implements RulesStorageFactory { } } -export default MongooseRulesStorageFactory; +export { MongooseRulesStorageFactory }; diff --git a/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/rulesStorageFactory.ts b/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/rulesStorageFactory.ts index 63df89847c..ce4acb7eec 100644 --- a/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/rulesStorageFactory.ts +++ b/packages/user-access-policy/src/rule/storage/benchmark/storageFactory/rulesStorageFactory.ts @@ -11,10 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type RulesStorage from "../../rulesStorage.js"; +import type {RulesStorage} from "../../rulesStorage.js"; interface RulesStorageFactory { createRulesStorage(dbUrl: string): Promise; } -export default RulesStorageFactory; +export type { RulesStorageFactory }; diff --git a/packages/user-access-policy/src/rule/storage/createMongooseRulesStorage.ts b/packages/user-access-policy/src/rule/storage/createMongooseRulesStorage.ts index 187369d575..8abe734fe3 100644 --- a/packages/user-access-policy/src/rule/storage/createMongooseRulesStorage.ts +++ b/packages/user-access-policy/src/rule/storage/createMongooseRulesStorage.ts @@ -1,6 +1,3 @@ -import type { Model } from "mongoose"; -import type Rule from "../rule.js"; -import MongooseRulesStorage from "./mongooseRulesStorage.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,11 +11,16 @@ import MongooseRulesStorage from "./mongooseRulesStorage.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type RulesStorage from "./rulesStorage.js"; +import type { RulesStorage } from "./rulesStorage.js"; +import type { Model } from "mongoose"; +import type {Rule} from "../rule.js"; +import {MongooseRulesStorage} from "./mongooseRulesStorage.js"; -export default function ( +const createMongooseRulesStorage = ( readingModel: Model | null, writingModel: Model | null = null, -): RulesStorage { +): RulesStorage => { return new MongooseRulesStorage(readingModel, writingModel); -} +}; + +export { createMongooseRulesStorage }; diff --git a/packages/user-access-policy/src/rule/storage/delete/deleteRuleFilters.ts b/packages/user-access-policy/src/rule/storage/delete/deleteRuleFilters.ts index 47db5429c0..1e924efdb3 100644 --- a/packages/user-access-policy/src/rule/storage/delete/deleteRuleFilters.ts +++ b/packages/user-access-policy/src/rule/storage/delete/deleteRuleFilters.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Ip from "../../../ip/ip.js"; +import type { Ip } from "../../../ip/ip.js"; interface DeleteRuleFilters { clientId?: string; @@ -19,4 +19,4 @@ interface DeleteRuleFilters { userId?: string; } -export default DeleteRuleFilters; +export type { DeleteRuleFilters }; diff --git a/packages/user-access-policy/src/rule/storage/indexes/mongooseIndex.ts b/packages/user-access-policy/src/rule/storage/indexes/mongooseIndex.ts index 4e059b99fc..a7574b3261 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/mongooseIndex.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/mongooseIndex.ts @@ -18,4 +18,4 @@ interface MongooseIndex { options: IndexOptions; } -export default MongooseIndex; +export type { MongooseIndex }; diff --git a/packages/user-access-policy/src/rule/storage/indexes/performance/mongoosePerformanceRuleIndexes.ts b/packages/user-access-policy/src/rule/storage/indexes/performance/mongoosePerformanceRuleIndexes.ts index 9a41744631..9c89eec55d 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/performance/mongoosePerformanceRuleIndexes.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/performance/mongoosePerformanceRuleIndexes.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type MongooseIndex from "../mongooseIndex.js"; +import type {MongooseIndex} from "../mongooseIndex.js"; const userIpIndexes: MongooseIndex[] = [ { @@ -61,4 +61,6 @@ const userIpMaskIndexes: MongooseIndex[] = [ }, ]; -export default [...userIpIndexes, ...userIpMaskIndexes]; +const mongoosePerformanceRuleIndexes = [...userIpIndexes, ...userIpMaskIndexes]; + +export { mongoosePerformanceRuleIndexes }; diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testIpV4MaskUniqueIndex.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testIpV4MaskUniqueIndex.ts index 1799459c15..c64be44052 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testIpV4MaskUniqueIndex.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testIpV4MaskUniqueIndex.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address4 } from "ip-address"; -import type Ip from "../../../../../../../ip/ip.js"; -import TestUniqueIndexBase from "../../../testUniqueIndexBase.js"; +import type {Ip} from "../../../../../../../ip/ip.js"; +import {TestUniqueIndexBase} from "../../../testUniqueIndexBase.js"; class TestIpV4MaskUniqueIndex extends TestUniqueIndexBase { private readonly ipAsNumeric: bigint = new Address4("192.168.1.1").bigInt(); @@ -49,4 +49,4 @@ class TestIpV4MaskUniqueIndex extends TestUniqueIndexBase { } } -export default TestIpV4MaskUniqueIndex; +export { TestIpV4MaskUniqueIndex}; diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testMongooseIpV4MaskUniqueIndex.spec.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testMongooseIpV4MaskUniqueIndex.spec.ts index f1d3d0a044..10fd3d55b2 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testMongooseIpV4MaskUniqueIndex.spec.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/mask/testMongooseIpV4MaskUniqueIndex.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../test/testMongooseRuleModel.js"; -import TestIpV4MaskUniqueIndex from "./testIpV4MaskUniqueIndex.js"; +import {MongooseRulesStorage} from "../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../test/testMongooseRuleModel.js"; +import {TestIpV4MaskUniqueIndex} from "./testIpV4MaskUniqueIndex.js"; describe("MongooseIpV4MaskUniqueIndex", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testIpV4UniqueIndex.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testIpV4UniqueIndex.ts index 47472ecb7f..03300ef794 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testIpV4UniqueIndex.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testIpV4UniqueIndex.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address4 } from "ip-address"; -import type Ip from "../../../../../../ip/ip.js"; -import TestUniqueIndexBase from "../../testUniqueIndexBase.js"; +import type {Ip} from "../../../../../../ip/ip.js"; +import {TestUniqueIndexBase} from "../../testUniqueIndexBase.js"; class TestIpV4UniqueIndex extends TestUniqueIndexBase { private readonly firstIpAsNumeric: bigint = new Address4( @@ -42,4 +42,4 @@ class TestIpV4UniqueIndex extends TestUniqueIndexBase { } } -export default TestIpV4UniqueIndex; +export { TestIpV4UniqueIndex}; diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testMongooseIpV4UniqueIndex.spec.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testMongooseIpV4UniqueIndex.spec.ts index 74c9a8b547..e4f4bbc2d2 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testMongooseIpV4UniqueIndex.spec.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v4/testMongooseIpV4UniqueIndex.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestIpV4UniqueIndex from "./testIpV4UniqueIndex.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestIpV4UniqueIndex} from "./testIpV4UniqueIndex.js"; describe("MongooseIpV4UniqueIndex", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testIpV6MaskUniqueIndex.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testIpV6MaskUniqueIndex.ts index a872d3deaa..b63dad809c 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testIpV6MaskUniqueIndex.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testIpV6MaskUniqueIndex.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address6 } from "ip-address"; -import type Ip from "../../../../../../../ip/ip.js"; -import TestUniqueIndexBase from "../../../testUniqueIndexBase.js"; +import type {Ip} from "../../../../../../../ip/ip.js"; +import {TestUniqueIndexBase} from "../../../testUniqueIndexBase.js"; class TestIpV6MaskUniqueIndex extends TestUniqueIndexBase { private readonly ipAsNumericString: string = new Address6( diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testMongooseIpV6MaskUniqueIndex.spec.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testMongooseIpV6MaskUniqueIndex.spec.ts index bfeca5fbb9..7af9e4a4a8 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testMongooseIpV6MaskUniqueIndex.spec.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/mask/testMongooseIpV6MaskUniqueIndex.spec.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../test/testMongooseRuleModel.js"; +import {MongooseRulesStorage} from "../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../test/testMongooseRuleModel.js"; import { TestIpV6MaskUniqueIndex } from "./testIpV6MaskUniqueIndex.js"; describe("MongooseIpV6MaskUniqueIndex", async () => { diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testIpV6UniqueIndex.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testIpV6UniqueIndex.ts index a8eca5fc44..6fe15a0299 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testIpV6UniqueIndex.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testIpV6UniqueIndex.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address6 } from "ip-address"; -import type Ip from "../../../../../../ip/ip.js"; -import TestUniqueIndexBase from "../../testUniqueIndexBase.js"; +import type {Ip} from "../../../../../../ip/ip.js"; +import {TestUniqueIndexBase} from "../../testUniqueIndexBase.js"; class TestIpV6UniqueIndex extends TestUniqueIndexBase { private readonly firstIpAsNumericString: string = new Address6( @@ -46,4 +46,4 @@ class TestIpV6UniqueIndex extends TestUniqueIndexBase { } } -export default TestIpV6UniqueIndex; +export { TestIpV6UniqueIndex}; diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testMongooseIpV6UniqueIndex.spec.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testMongooseIpV6UniqueIndex.spec.ts index b7221b013d..a893c65a66 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testMongooseIpV6UniqueIndex.spec.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/ip/v6/testMongooseIpV6UniqueIndex.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestIpV6UniqueIndex from "./testIpV6UniqueIndex.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestIpV6UniqueIndex} from "./testIpV6UniqueIndex.js"; describe("MongooseIpV6UniqueIndex", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/mongooseUniqueRuleIndexes.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/mongooseUniqueRuleIndexes.ts index b7a77d9867..194a69cfcd 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/mongooseUniqueRuleIndexes.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/mongooseUniqueRuleIndexes.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type MongooseIndex from "../mongooseIndex.js"; +import type {MongooseIndex} from "../mongooseIndex.js"; const globalIpIndexes: MongooseIndex[] = [ { @@ -145,9 +145,11 @@ const ipMaskPerClientIndexes: MongooseIndex[] = [ }, ]; -export default [ +const mongooseUniqueRuleIndexes = [ ...globalIpIndexes, ...globalIpMaskIndexes, ...ipMaskPerClientIndexes, ...ipPerClientIndexes, ]; + +export { mongooseUniqueRuleIndexes }; diff --git a/packages/user-access-policy/src/rule/storage/indexes/unique/testUniqueIndexBase.ts b/packages/user-access-policy/src/rule/storage/indexes/unique/testUniqueIndexBase.ts index dc4f60806c..a5e52b2e6c 100644 --- a/packages/user-access-policy/src/rule/storage/indexes/unique/testUniqueIndexBase.ts +++ b/packages/user-access-policy/src/rule/storage/indexes/unique/testUniqueIndexBase.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import type Ip from "../../../../ip/ip.js"; -import TestRulesStorageBase from "../../test/testRulesStorageBase.js"; +import type {Ip} from "../../../../ip/ip.js"; +import {TestRulesStorageBase} from "../../test/testRulesStorageBase.js"; abstract class TestUniqueIndexBase extends TestRulesStorageBase { protected abstract getFirstUserIpObject(): Ip; @@ -142,4 +142,4 @@ abstract class TestUniqueIndexBase extends TestRulesStorageBase { } } -export default TestUniqueIndexBase; +export { TestUniqueIndexBase}; diff --git a/packages/user-access-policy/src/rule/storage/mongooseRulesStorage.ts b/packages/user-access-policy/src/rule/storage/mongooseRulesStorage.ts index 0e75e4a7d7..73b518cdc3 100644 --- a/packages/user-access-policy/src/rule/storage/mongooseRulesStorage.ts +++ b/packages/user-access-policy/src/rule/storage/mongooseRulesStorage.ts @@ -1,4 +1,3 @@ -import type { IPAddress } from "@prosopo/types"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,15 +11,16 @@ import type { IPAddress } from "@prosopo/types"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { Address4, type Address6 } from "ip-address"; +import { Address4 } from "ip-address"; import type { Model } from "mongoose"; -import IpVersion from "../../ip/ipVersion.js"; -import type Rule from "../rule.js"; -import type MongooseRuleRecord from "./record/mongooseRuleRecord.js"; -import type RuleRecord from "./record/ruleRecord.js"; -import type RulesStorage from "./rulesStorage.js"; -import type SearchRuleFilterSettings from "./search/searchRuleFilterSettings.js"; -import type SearchRuleFilters from "./search/searchRuleFilters.js"; +import { IpVersion } from "../../ip/ipVersion.js"; +import type { Rule } from "../rule.js"; +import type { MongooseRuleRecord } from "./record/mongooseRuleRecord.js"; +import type { RuleRecord } from "./record/ruleRecord.js"; +import type { RulesStorage } from "./rulesStorage.js"; +import type { SearchRuleFilterSettings } from "./search/searchRuleFilterSettings.js"; +import type { SearchRuleFilters } from "./search/searchRuleFilters.js"; +import type { IPAddress } from "@prosopo/types"; class MongooseRulesStorage implements RulesStorage { constructor( @@ -68,7 +68,7 @@ class MongooseRulesStorage implements RulesStorage { throw new Error("Model is not set"); } - const query = this.createQuery(filters, filterSettings); + const query = this.createSearchQuery(filters, filterSettings); const mongooseRecords = await this.readingModel.find(query).lean().exec(); @@ -98,7 +98,7 @@ class MongooseRulesStorage implements RulesStorage { return count; } - protected createQuery( + protected createSearchQuery( filters: SearchRuleFilters, filterSettings?: SearchRuleFilterSettings, ): object { @@ -111,7 +111,7 @@ class MongooseRulesStorage implements RulesStorage { this.getFilterByClientId(includeRecordsWithoutClientId, filters.clientId), ]; - const queryFilters = this.getQueryFilters( + const queryFilters = this.getSearchQueryFilters( filters, includeRecordsWithPartialFilterMatches, ); @@ -123,7 +123,7 @@ class MongooseRulesStorage implements RulesStorage { }; } - protected getQueryFilters( + protected getSearchQueryFilters( filters: SearchRuleFilters, includeRecordsWithPartialFilterMatches: boolean, ): object[] { @@ -225,4 +225,4 @@ class MongooseRulesStorage implements RulesStorage { } } -export default MongooseRulesStorage; +export { MongooseRulesStorage }; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testIpV6MaskFormatting.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testIpV6MaskFormatting.ts index a704d371c5..4bfa26ce00 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testIpV6MaskFormatting.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testIpV6MaskFormatting.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import IPV6_NUMERIC_MAX_LENGTH from "../../../../../../ip/v6/ipV6NumericMaxLength.js"; -import TestRulesStorageBase from "../../../../test/testRulesStorageBase.js"; +import {IPV6_NUMERIC_MAX_LENGTH} from "../../../../../../ip/v6/ipV6NumericMaxLength.js"; +import {TestRulesStorageBase} from "../../../../test/testRulesStorageBase.js"; class TestIpV6MaskFormatting extends TestRulesStorageBase { protected override getTests(): { @@ -153,4 +153,4 @@ class TestIpV6MaskFormatting extends TestRulesStorageBase { } } -export default TestIpV6MaskFormatting; +export { TestIpV6MaskFormatting}; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testMongooseIpV6MaskFormatting.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testMongooseIpV6MaskFormatting.spec.ts index 415d2d4411..f0ac43573c 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testMongooseIpV6MaskFormatting.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/mask/testMongooseIpV6MaskFormatting.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestIpV6MaskFormatting from "./testIpV6MaskFormatting.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestIpV6MaskFormatting} from "./testIpV6MaskFormatting.js"; describe("MongooseIpV6MaskFormatting", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testIpV6Formatting.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testIpV6Formatting.ts index 7b17126aa0..3f7a66146e 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testIpV6Formatting.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testIpV6Formatting.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import IPV6_NUMERIC_MAX_LENGTH from "../../../../../ip/v6/ipV6NumericMaxLength.js"; -import TestRulesStorageBase from "../../../test/testRulesStorageBase.js"; +import {IPV6_NUMERIC_MAX_LENGTH} from "../../../../../ip/v6/ipV6NumericMaxLength.js"; +import {TestRulesStorageBase} from "../../../test/testRulesStorageBase.js"; class TestIpV6Formatting extends TestRulesStorageBase { protected override getTests(): { @@ -79,4 +79,4 @@ class TestIpV6Formatting extends TestRulesStorageBase { } } -export default TestIpV6Formatting; +export {TestIpV6Formatting}; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testMongooseIpV6Formatting.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testMongooseIpV6Formatting.spec.ts index 8a541dbdfc..6c75bff5ce 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testMongooseIpV6Formatting.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/ipV6Formatting/testMongooseIpV6Formatting.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../test/testMongooseRuleModel.js"; -import TestIpV6Formatting from "./testIpV6Formatting.js"; +import {MongooseRulesStorage} from "../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../test/testMongooseRuleModel.js"; +import {TestIpV6Formatting} from "./testIpV6Formatting.js"; describe("MongooseIpV6Formatting", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testMongooseOptionalFieldsValidation.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testMongooseOptionalFieldsValidation.spec.ts index 89d6cf4bce..a8b0dd8368 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testMongooseOptionalFieldsValidation.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testMongooseOptionalFieldsValidation.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestOptionalFieldsValidation from "./testOptionalFieldsValidation.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestOptionalFieldsValidation} from "./testOptionalFieldsValidation.js"; describe("MongooseOptionalFieldsValidation", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testOptionalFieldsValidation.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testOptionalFieldsValidation.ts index 3b1dff6f47..856b6911bf 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testOptionalFieldsValidation.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/optional/testOptionalFieldsValidation.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import TestRulesStorageBase from "../../../../test/testRulesStorageBase.js"; +import {TestRulesStorageBase} from "../../../../test/testRulesStorageBase.js"; class TestOptionalFieldsValidation extends TestRulesStorageBase { protected getTests(): { name: string; method: () => Promise }[] { @@ -39,4 +39,4 @@ class TestOptionalFieldsValidation extends TestRulesStorageBase { } } -export default TestOptionalFieldsValidation; +export { TestOptionalFieldsValidation}; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testMongooseUserIdValidation.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testMongooseUserIdValidation.spec.ts index 6cd19a7475..5a20f32915 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testMongooseUserIdValidation.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testMongooseUserIdValidation.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestUserIdValidation from "./testUserIdValidation.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestUserIdValidation} from "./testUserIdValidation.js"; describe("MongooseUserIdValidation", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testUserIdValidation.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testUserIdValidation.ts index 3fcfbf5b1b..f2f5b64bbe 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testUserIdValidation.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userId/testUserIdValidation.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import TestRulesStorageBase from "../../../../test/testRulesStorageBase.js"; +import {TestRulesStorageBase} from "../../../../test/testRulesStorageBase.js"; class TestUserIdValidation extends TestRulesStorageBase { protected getTests(): { name: string; method: () => Promise }[] { @@ -60,4 +60,4 @@ class TestUserIdValidation extends TestRulesStorageBase { } } -export default TestUserIdValidation; +export {TestUserIdValidation}; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testMongooseUserIdValidation.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testMongooseUserIdValidation.spec.ts index abae5a1ffe..b53e9c75b5 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testMongooseUserIdValidation.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testMongooseUserIdValidation.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestUserIpValidation from "./testUserIpValidation.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestUserIpValidation} from "./testUserIpValidation.js"; describe("MongooseUserIPValidation", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testUserIpValidation.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testUserIpValidation.ts index f72429fde0..1921f8e9de 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testUserIpValidation.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIp/testUserIpValidation.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import TestRulesStorageBase from "../../../../test/testRulesStorageBase.js"; +import {TestRulesStorageBase} from "../../../../test/testRulesStorageBase.js"; class TestUserIpValidation extends TestRulesStorageBase { protected getTests(): { name: string; method: () => Promise }[] { @@ -55,4 +55,4 @@ class TestUserIpValidation extends TestRulesStorageBase { } } -export default TestUserIpValidation; +export { TestUserIpValidation}; diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testMongooseUserIpVersionValidation.spec.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testMongooseUserIpVersionValidation.spec.ts index aead7fa884..ca2d623fae 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testMongooseUserIpVersionValidation.spec.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testMongooseUserIpVersionValidation.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestUserIpVersionValidation from "./testUserIpVersionValidation.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestUserIpVersionValidation} from "./testUserIpVersionValidation.js"; describe("MongooseUserIpVersionValidation", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testUserIpVersionValidation.ts b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testUserIpVersionValidation.ts index c14652f94f..79aac0efa2 100644 --- a/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testUserIpVersionValidation.ts +++ b/packages/user-access-policy/src/rule/storage/record/fieldTests/validation/userIpVersion/testUserIpVersionValidation.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import TestRulesStorageBase from "../../../../test/testRulesStorageBase.js"; +import {TestRulesStorageBase} from "../../../../test/testRulesStorageBase.js"; class TestUserIpVersionValidation extends TestRulesStorageBase { protected getTests(): { name: string; method: () => Promise }[] { @@ -85,4 +85,4 @@ class TestUserIpVersionValidation extends TestRulesStorageBase { } } -export default TestUserIpVersionValidation; +export {TestUserIpVersionValidation}; diff --git a/packages/user-access-policy/src/rule/storage/record/getMongooseRuleRecordSchema.ts b/packages/user-access-policy/src/rule/storage/record/getMongooseRuleRecordSchema.ts index b62cfbb91b..2a6c4bf1aa 100644 --- a/packages/user-access-policy/src/rule/storage/record/getMongooseRuleRecordSchema.ts +++ b/packages/user-access-policy/src/rule/storage/record/getMongooseRuleRecordSchema.ts @@ -1,4 +1,3 @@ -import type { Schema } from "mongoose"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,15 +11,16 @@ import type { Schema } from "mongoose"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import mongooseRule from "../../mongooseRule.js"; -import type Rule from "../../rule.js"; -import MongoosePerformanceRuleIndexes from "../indexes/performance/mongoosePerformanceRuleIndexes.js"; -import MongooseUniqueRuleIndexes from "../indexes/unique/mongooseUniqueRuleIndexes.js"; +import {mongooseRule} from "../../mongooseRule.js"; +import type { Rule } from "../../rule.js"; +import { mongoosePerformanceRuleIndexes } from "../indexes/performance/mongoosePerformanceRuleIndexes.js"; +import { mongooseUniqueRuleIndexes } from "../indexes/unique/mongooseUniqueRuleIndexes.js"; +import type { Schema } from "mongoose"; -export default function (): Schema { +const getMongooseRuleRecordSchema = (): Schema => { const mongooseRuleIndexes = [ - ...MongooseUniqueRuleIndexes, - ...MongoosePerformanceRuleIndexes, + ...mongoosePerformanceRuleIndexes, + ...mongooseUniqueRuleIndexes, ]; for (const mongooseRuleIndex of mongooseRuleIndexes) { @@ -28,4 +28,6 @@ export default function (): Schema { } return mongooseRule; -} +}; + +export { getMongooseRuleRecordSchema }; diff --git a/packages/user-access-policy/src/rule/storage/record/mongooseRuleRecord.ts b/packages/user-access-policy/src/rule/storage/record/mongooseRuleRecord.ts index 71e8a26348..71bcdc637f 100644 --- a/packages/user-access-policy/src/rule/storage/record/mongooseRuleRecord.ts +++ b/packages/user-access-policy/src/rule/storage/record/mongooseRuleRecord.ts @@ -1,4 +1,3 @@ -import type { Types } from "mongoose"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,10 +11,11 @@ import type { Types } from "mongoose"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Rule from "../../rule.js"; +import type {Rule} from "../../rule.js"; +import type { Types } from "mongoose"; interface MongooseRuleRecord extends Rule { _id: Types.ObjectId; } -export default MongooseRuleRecord; +export type { MongooseRuleRecord }; diff --git a/packages/user-access-policy/src/rule/storage/record/ruleRecord.ts b/packages/user-access-policy/src/rule/storage/record/ruleRecord.ts index 63e65529be..904ca935bb 100644 --- a/packages/user-access-policy/src/rule/storage/record/ruleRecord.ts +++ b/packages/user-access-policy/src/rule/storage/record/ruleRecord.ts @@ -11,10 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Rule from "../../rule.js"; +import type {Rule} from "../../rule.js"; interface RuleRecord extends Rule { _id: string; } -export default RuleRecord; +export type { RuleRecord }; diff --git a/packages/user-access-policy/src/rule/storage/rulesStorage.ts b/packages/user-access-policy/src/rule/storage/rulesStorage.ts index 008bdf7060..37036102c6 100644 --- a/packages/user-access-policy/src/rule/storage/rulesStorage.ts +++ b/packages/user-access-policy/src/rule/storage/rulesStorage.ts @@ -11,11 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import type Rule from "../rule.js"; -import type DeleteRuleFilters from "./delete/deleteRuleFilters.js"; -import type RuleRecord from "./record/ruleRecord.js"; -import type SearchRuleFilterSettings from "./search/searchRuleFilterSettings.js"; -import type SearchRuleFilters from "./search/searchRuleFilters.js"; +import type { Rule } from "../rule.js"; +import type { DeleteRuleFilters } from "./delete/deleteRuleFilters.js"; +import type { RuleRecord } from "./record/ruleRecord.js"; +import type { SearchRuleFilterSettings } from "./search/searchRuleFilterSettings.js"; +import type { SearchRuleFilters } from "./search/searchRuleFilters.js"; interface RulesStorage { insert(record: Rule): Promise; @@ -32,4 +32,4 @@ interface RulesStorage { countRecords(): Promise; } -export default RulesStorage; +export type { RulesStorage }; diff --git a/packages/user-access-policy/src/rule/storage/search/searchRuleFilterSettings.ts b/packages/user-access-policy/src/rule/storage/search/searchRuleFilterSettings.ts index b538feefd5..a0464f5837 100644 --- a/packages/user-access-policy/src/rule/storage/search/searchRuleFilterSettings.ts +++ b/packages/user-access-policy/src/rule/storage/search/searchRuleFilterSettings.ts @@ -16,4 +16,4 @@ interface SearchRuleFilterSettings { includeRecordsWithPartialFilterMatches?: boolean; } -export default SearchRuleFilterSettings; +export type{ SearchRuleFilterSettings}; diff --git a/packages/user-access-policy/src/rule/storage/search/searchRuleFilters.ts b/packages/user-access-policy/src/rule/storage/search/searchRuleFilters.ts index 1c186fe81f..5a3ab6450b 100644 --- a/packages/user-access-policy/src/rule/storage/search/searchRuleFilters.ts +++ b/packages/user-access-policy/src/rule/storage/search/searchRuleFilters.ts @@ -19,4 +19,4 @@ interface SearchRuleFilters { clientId?: string; } -export default SearchRuleFilters; +export type { SearchRuleFilters}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRule.ts b/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRule.ts index d416c08c85..bc26dd7cda 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRule.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRule.ts @@ -13,9 +13,9 @@ // limitations under the License. import { Address4 } from "ip-address"; import { expect } from "vitest"; -import type Rule from "../../../../rule.js"; -import type SearchRuleFilters from "../../searchRuleFilters.js"; -import TestFindRuleBase from "../testFindRuleBase.js"; +import type {Rule} from "../../../../rule.js"; +import type {SearchRuleFilters} from "../../searchRuleFilters.js"; +import {TestFindRuleBase} from "../testFindRuleBase.js"; class TestFindRule extends TestFindRuleBase { private readonly userIp: Address4 = new Address4("192.168.1.1"); @@ -172,4 +172,4 @@ class TestFindRule extends TestFindRuleBase { } } -export default TestFindRule; +export { TestFindRule }; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRuleByUserId.ts b/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRuleByUserId.ts index b0b89b6af6..b7d90a3b8a 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRuleByUserId.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/generic/testFindRuleByUserId.ts @@ -1,5 +1,3 @@ -import type Rule from "../../../../rule.js"; -import type SearchRuleFilters from "../../searchRuleFilters.js"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +11,9 @@ import type SearchRuleFilters from "../../searchRuleFilters.js"; // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindRuleBase from "../testFindRuleBase.js"; +import {TestFindRuleBase} from "../testFindRuleBase.js"; +import type {Rule} from "../../../../rule.js"; +import type {SearchRuleFilters} from "../../searchRuleFilters.js"; class TestFindRuleByUserId extends TestFindRuleBase { private readonly userId: string = "userId"; @@ -58,4 +58,4 @@ class TestFindRuleByUserId extends TestFindRuleBase { } } -export default TestFindRuleByUserId; +export { TestFindRuleByUserId }; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRule.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRule.spec.ts index d1e24abb16..5b62d9649b 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRule.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRule.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../test/testMongooseRuleModel.js"; -import TestFindRule from "./testFindRule.js"; +import {MongooseRulesStorage} from "../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../test/testMongooseRuleModel.js"; +import {TestFindRule} from "./testFindRule.js"; describe("MongooseFindRule", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRuleByUserId.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRuleByUserId.spec.ts index dcea11eb73..88c157fe4b 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRuleByUserId.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/generic/testMongooseFindRuleByUserId.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../test/testMongooseRuleModel.js"; -import TestFindRuleByUserId from "./testFindRuleByUserId.js"; +import {MongooseRulesStorage} from "../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../test/testMongooseRuleModel.js"; +import {TestFindRuleByUserId} from "./testFindRuleByUserId.js"; describe("MongooseFindRuleByUserId", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/testFindByIpBase.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/testFindByIpBase.ts index 3833b6bf86..dc4c9e4381 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/testFindByIpBase.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/testFindByIpBase.ts @@ -1,4 +1,3 @@ -import type { IPAddress } from "@prosopo/types"; // Copyright 2021-2024 Prosopo (UK) Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,10 +12,11 @@ import type { IPAddress } from "@prosopo/types"; // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import type Ip from "../../../../../ip/ip.js"; -import type Rule from "../../../../rule.js"; -import type SearchRuleFilters from "../../searchRuleFilters.js"; -import TestFindRuleBase from "../testFindRuleBase.js"; +import type {Ip} from "../../../../../ip/ip.js"; +import type {Rule} from "../../../../rule.js"; +import type {SearchRuleFilters} from "../../searchRuleFilters.js"; +import {TestFindRuleBase} from "../testFindRuleBase.js"; +import type { IPAddress } from "@prosopo/types"; abstract class TestFindByIpBase extends TestFindRuleBase { protected abstract getUserIpObject(): Ip; @@ -92,4 +92,4 @@ abstract class TestFindByIpBase extends TestFindRuleBase { } } -export default TestFindByIpBase; +export { TestFindByIpBase}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testFindByMaskV4RangeMax.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testFindByMaskV4RangeMax.ts index 3a31c93b57..a18c38363a 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testFindByMaskV4RangeMax.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testFindByMaskV4RangeMax.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByMaskV4 from "../../testFindByMaskV4.js"; +import {TestFindByMaskV4} from "../../testFindByMaskV4.js"; class TestFindByMaskV4RangeMax extends TestFindByMaskV4 { protected override baseIpAsString = "192.168.0.0"; @@ -22,4 +22,4 @@ class TestFindByMaskV4RangeMax extends TestFindByMaskV4 { protected override readonly anotherUserIp: string = "127.0.1.0"; } -export default TestFindByMaskV4RangeMax; +export { TestFindByMaskV4RangeMax}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testMongooseFindByMaskV4RangeMax.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testMongooseFindByMaskV4RangeMax.spec.ts index ab78131617..6926756675 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testMongooseFindByMaskV4RangeMax.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/max/testMongooseFindByMaskV4RangeMax.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../test/testMongooseRuleModel.js"; -import TestFindByMaskV4RangeMax from "./testFindByMaskV4RangeMax.js"; +import {MongooseRulesStorage} from "../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByMaskV4RangeMax} from "./testFindByMaskV4RangeMax.js"; describe("MongooseFindByMaskV4RangeMax", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testFindByMaskV4RangeMin.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testFindByMaskV4RangeMin.ts index 3d56f43628..44feddb3c9 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testFindByMaskV4RangeMin.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testFindByMaskV4RangeMin.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByMaskV4 from "../../testFindByMaskV4.js"; +import {TestFindByMaskV4} from "../../testFindByMaskV4.js"; class TestFindByMaskV4RangeMin extends TestFindByMaskV4 { protected override baseIpAsString = "192.168.1.0"; @@ -22,4 +22,4 @@ class TestFindByMaskV4RangeMin extends TestFindByMaskV4 { protected override readonly anotherUserIp: string = "127.0.0.255"; } -export default TestFindByMaskV4RangeMin; +export { TestFindByMaskV4RangeMin}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testMongooseFindByMaskV4RangeMin.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testMongooseFindByMaskV4RangeMin.spec.ts index cafcecb435..7d2f0e1905 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testMongooseFindByMaskV4RangeMin.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/maskRange/min/testMongooseFindByMaskV4RangeMin.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../test/testMongooseRuleModel.js"; -import TestFindByMaskV4RangeMin from "./testFindByMaskV4RangeMin.js"; +import {MongooseRulesStorage} from "../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByMaskV4RangeMin} from "./testFindByMaskV4RangeMin.js"; describe("MongooseFindByMaskV4RangeMin", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testFindByMaskV4.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testFindByMaskV4.ts index 6dfc7d12ab..21b94c283e 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testFindByMaskV4.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testFindByMaskV4.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address4 } from "ip-address"; -import type Ip from "../../../../../../../ip/ip.js"; -import TestFindByIpV4 from "../testFindByIpV4.js"; +import type {Ip} from "../../../../../../../ip/ip.js"; +import {TestFindByIpV4} from "../testFindByIpV4.js"; class TestFindByMaskV4 extends TestFindByIpV4 { protected baseIpAsString = "192.168.0.0"; @@ -56,4 +56,4 @@ class TestFindByMaskV4 extends TestFindByIpV4 { } } -export default TestFindByMaskV4; +export { TestFindByMaskV4}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testMongooseFindByMaskV4.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testMongooseFindByMaskV4.spec.ts index 54afda31bb..d1ef164d16 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testMongooseFindByMaskV4.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/mask/testMongooseFindByMaskV4.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../test/testMongooseRuleModel.js"; -import TestFindByMaskV4 from "./testFindByMaskV4.js"; +import {MongooseRulesStorage} from "../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../test/testMongooseRuleModel.js"; +import {TestFindByMaskV4} from "./testFindByMaskV4.js"; describe("MongooseFindByMaskV4", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testFindByIpV4.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testFindByIpV4.ts index 4f3742fbf2..3449dab2ef 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testFindByIpV4.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testFindByIpV4.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address4 } from "ip-address"; -import type Ip from "../../../../../../ip/ip.js"; -import TestFindByIpBase from "../testFindByIpBase.js"; +import type {Ip} from "../../../../../../ip/ip.js"; +import {TestFindByIpBase} from "../testFindByIpBase.js"; class TestFindByIpV4 extends TestFindByIpBase { protected readonly userIp: string = "192.168.1.1"; @@ -46,4 +46,4 @@ class TestFindByIpV4 extends TestFindByIpBase { } } -export default TestFindByIpV4; +export { TestFindByIpV4}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testMongooseFindByIpV4.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testMongooseFindByIpV4.spec.ts index ae657e1a02..fe7dd3cbb8 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testMongooseFindByIpV4.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v4/testMongooseFindByIpV4.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestFindByIpV4 from "./testFindByIpV4.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpV4} from "./testFindByIpV4.js"; describe("MongooseFindByIpV4", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testFindByIpMaskV6RangeMax.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testFindByIpMaskV6RangeMax.ts index 23d5b14559..d992c2b7b7 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testFindByIpMaskV6RangeMax.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testFindByIpMaskV6RangeMax.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpMaskV6 from "../../testFindByIpMaskV6.js"; +import {TestFindByIpMaskV6} from "../../testFindByIpMaskV6.js"; class TestFindByIpMaskV6RangeMax extends TestFindByIpMaskV6 { protected override baseIpAsString = "2001:db8:3333:4444:5555:6666:7777:8888"; @@ -26,4 +26,4 @@ class TestFindByIpMaskV6RangeMax extends TestFindByIpMaskV6 { "2001:db8:3333:4444:5555:6666:8888:1111"; } -export default TestFindByIpMaskV6RangeMax; +export { TestFindByIpMaskV6RangeMax}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testMongooseFindByIpMaskV6RangeMax.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testMongooseFindByIpMaskV6RangeMax.spec.ts index 08c463a3fa..d7738bdd22 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testMongooseFindByIpMaskV6RangeMax.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/max/testMongooseFindByIpMaskV6RangeMax.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpMaskV6RangeMax from "./testFindByIpMaskV6RangeMax.js"; +import {MongooseRulesStorage} from "../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpMaskV6RangeMax} from "./testFindByIpMaskV6RangeMax.js"; describe("MongooseFindByIpMaskV6RangeMax", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testFindByIpMaskV6RangeMin.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testFindByIpMaskV6RangeMin.ts index 0223c47461..19f2ac3a36 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testFindByIpMaskV6RangeMin.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testFindByIpMaskV6RangeMin.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpMaskV6 from "../../testFindByIpMaskV6.js"; +import {TestFindByIpMaskV6} from "../../testFindByIpMaskV6.js"; class TestFindByIpMaskV6RangeMin extends TestFindByIpMaskV6 { protected override baseIpAsString = "2001:db8:3333:4444:5555:6666:7777:8888"; @@ -26,4 +26,4 @@ class TestFindByIpMaskV6RangeMin extends TestFindByIpMaskV6 { "2001:db8:3333:4444:5555:6666:7777:7777"; } -export default TestFindByIpMaskV6RangeMin; +export { TestFindByIpMaskV6RangeMin}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testMongooseFindByIpMaskV6RangeMin.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testMongooseFindByIpMaskV6RangeMin.spec.ts index dbadbe3e68..d1f4c539f9 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testMongooseFindByIpMaskV6RangeMin.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/maskRange/min/testMongooseFindByIpMaskV6RangeMin.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpMaskV6RangeMin from "./testFindByIpMaskV6RangeMin.js"; +import {MongooseRulesStorage} from "../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpMaskV6RangeMin} from "./testFindByIpMaskV6RangeMin.js"; describe("MongooseFindByIpMaskV6RangeMin", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testFindByIpMaskV6.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testFindByIpMaskV6.ts index fd4c319a75..514acec76c 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testFindByIpMaskV6.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testFindByIpMaskV6.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address6 } from "ip-address"; -import type Ip from "../../../../../../../ip/ip.js"; -import TestFindByIpV6 from "../testFindByIpV6.js"; +import type {Ip} from "../../../../../../../ip/ip.js"; +import {TestFindByIpV6} from "../testFindByIpV6.js"; class TestFindByIpMaskV6 extends TestFindByIpV6 { protected baseIpAsString = "2001:db8:3333:4444:5555:6666:7777:8888"; @@ -58,4 +58,4 @@ class TestFindByIpMaskV6 extends TestFindByIpV6 { } } -export default TestFindByIpMaskV6; +export { TestFindByIpMaskV6}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testMongooseFindByIpMaskV6.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testMongooseFindByIpMaskV6.spec.ts index fbb52ceaef..1e3a562481 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testMongooseFindByIpMaskV6.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/mask/testMongooseFindByIpMaskV6.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpMaskV6 from "./testFindByIpMaskV6.js"; +import {MongooseRulesStorage} from "../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpMaskV6} from "./testFindByIpMaskV6.js"; describe("MongooseFindByIpMaskV6", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testFindByIpMaskV6ShortRangeMax.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testFindByIpMaskV6ShortRangeMax.ts index 52eb3a739c..5efa582baa 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testFindByIpMaskV6ShortRangeMax.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testFindByIpMaskV6ShortRangeMax.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpMaskV6 from "../../../../mask/testFindByIpMaskV6.js"; +import {TestFindByIpMaskV6} from "../../../../mask/testFindByIpMaskV6.js"; class TestFindByIpMaskV6ShortRangeMax extends TestFindByIpMaskV6 { protected override baseIpAsString = "::1"; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testMongooseFindByIpMaskV6ShortRangeMax.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testMongooseFindByIpMaskV6ShortRangeMax.spec.ts index 5d4097055b..ca42f43181 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testMongooseFindByIpMaskV6ShortRangeMax.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/max/testMongooseFindByIpMaskV6ShortRangeMax.spec.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../../test/testMongooseRuleModel.js"; +import {MongooseRulesStorage} from "../../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../../test/testMongooseRuleModel.js"; import { TestFindByIpMaskV6ShortRangeMax } from "./testFindByIpMaskV6ShortRangeMax.js"; describe("MongooseFindByIpV6MaskV6ShortRangeMax", async () => { diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testFindByIpMaskV6ShortRangeMin.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testFindByIpMaskV6ShortRangeMin.ts index 7da1d8f66f..033ab2ab86 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testFindByIpMaskV6ShortRangeMin.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testFindByIpMaskV6ShortRangeMin.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpMaskV6 from "../../../../mask/testFindByIpMaskV6.js"; +import {TestFindByIpMaskV6} from "../../../../mask/testFindByIpMaskV6.js"; class TestFindByIpMaskV6ShortRangeMin extends TestFindByIpMaskV6 { protected override baseIpAsString = "::2"; @@ -22,4 +22,4 @@ class TestFindByIpMaskV6ShortRangeMin extends TestFindByIpMaskV6 { protected override readonly anotherUserIp: string = "::1"; } -export default TestFindByIpMaskV6ShortRangeMin; +export { TestFindByIpMaskV6ShortRangeMin}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testMongooseFindByIpMaskV6ShortRangeMix.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testMongooseFindByIpMaskV6ShortRangeMix.spec.ts index d308f73232..938c514fc9 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testMongooseFindByIpMaskV6ShortRangeMix.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/maskRange/min/testMongooseFindByIpMaskV6ShortRangeMix.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpMaskV6ShortRangeMin from "./testFindByIpMaskV6ShortRangeMin.js"; +import {MongooseRulesStorage} from "../../../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpMaskV6ShortRangeMin} from "./testFindByIpMaskV6ShortRangeMin.js"; describe("MongooseFindByIpMaskV6ShortRangeMin", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testFindByIpMaskV6Short.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testFindByIpMaskV6Short.ts index 7a86baf7b1..44dc74fa22 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testFindByIpMaskV6Short.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testFindByIpMaskV6Short.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpMaskV6 from "../../mask/testFindByIpMaskV6.js"; +import {TestFindByIpMaskV6} from "../../mask/testFindByIpMaskV6.js"; class TestFindByIpMaskV6Short extends TestFindByIpMaskV6 { protected override baseIpAsString = "::1"; @@ -22,4 +22,4 @@ class TestFindByIpMaskV6Short extends TestFindByIpMaskV6 { protected override readonly anotherUserIp: string = "::4"; } -export default TestFindByIpMaskV6Short; +export { TestFindByIpMaskV6Short}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testMongooseFindByIpMaskV6Short.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testMongooseFindByIpMaskV6Short.spec.ts index 3e7c8ccb95..2d49596421 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testMongooseFindByIpMaskV6Short.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/mask/testMongooseFindByIpMaskV6Short.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpMaskV6Short from "./testFindByIpMaskV6Short.js"; +import {MongooseRulesStorage} from "../../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpMaskV6Short} from "./testFindByIpMaskV6Short.js"; describe("MongooseFindByIpMaskV6Short", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testFindByIpV6Short.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testFindByIpV6Short.ts index 72f1c55450..528de6ba1a 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testFindByIpV6Short.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testFindByIpV6Short.ts @@ -11,11 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import TestFindByIpV6 from "../testFindByIpV6.js"; +import {TestFindByIpV6 } from "../testFindByIpV6.js"; class TestFindByIpV6Short extends TestFindByIpV6 { protected override readonly userIp: string = "::1"; protected override readonly anotherUserIp: string = "::2"; } -export default TestFindByIpV6Short; +export { TestFindByIpV6Short}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testMongooseFindByIpV6Short.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testMongooseFindByIpV6Short.spec.ts index ce77660d0a..0f10fd06f9 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testMongooseFindByIpV6Short.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/short/testMongooseFindByIpV6Short.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../../test/testMongooseRuleModel.js"; -import TestFindByIpV6Short from "./testFindByIpV6Short.js"; +import {MongooseRulesStorage} from "../../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpV6Short } from "./testFindByIpV6Short.js"; describe("MongooseFindByIpV6Short", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testFindByIpV6.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testFindByIpV6.ts index 5788a50932..29cfd8c790 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testFindByIpV6.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testFindByIpV6.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. import { Address6 } from "ip-address"; -import type Ip from "../../../../../../ip/ip.js"; -import TestFindByIpBase from "../testFindByIpBase.js"; +import type {Ip} from "../../../../../../ip/ip.js"; +import {TestFindByIpBase} from "../testFindByIpBase.js"; class TestFindByIpV6 extends TestFindByIpBase { protected readonly userIp: string = "2001:db8:3333:4444:5555:6666:7777:8888"; @@ -47,4 +47,4 @@ class TestFindByIpV6 extends TestFindByIpBase { } } -export default TestFindByIpV6; +export { TestFindByIpV6}; diff --git a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testMongooseFindByIpV6.spec.ts b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testMongooseFindByIpV6.spec.ts index be20fbd1ac..19368a7666 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testMongooseFindByIpV6.spec.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/ip/v6/testMongooseFindByIpV6.spec.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { describe } from "vitest"; -import MongooseRulesStorage from "../../../../mongooseRulesStorage.js"; -import testMongooseRuleModel from "../../../../test/testMongooseRuleModel.js"; -import TestFindByIpV6 from "./testFindByIpV6.js"; +import {MongooseRulesStorage} from "../../../../mongooseRulesStorage.js"; +import {testMongooseRuleModel} from "../../../../test/testMongooseRuleModel.js"; +import {TestFindByIpV6} from "./testFindByIpV6.js"; describe("MongooseFindByIpV6", async () => { const testModel = await testMongooseRuleModel(); diff --git a/packages/user-access-policy/src/rule/storage/search/tests/testFindRuleBase.ts b/packages/user-access-policy/src/rule/storage/search/tests/testFindRuleBase.ts index 50b47bcaec..b6036ad2ae 100644 --- a/packages/user-access-policy/src/rule/storage/search/tests/testFindRuleBase.ts +++ b/packages/user-access-policy/src/rule/storage/search/tests/testFindRuleBase.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. import { expect } from "vitest"; -import type Rule from "../../../rule.js"; -import TestRulesStorageBase from "../../test/testRulesStorageBase.js"; -import type SearchRuleFilters from "../searchRuleFilters.js"; +import type {Rule} from "../../../rule.js"; +import {TestRulesStorageBase} from "../../test/testRulesStorageBase.js"; +import type {SearchRuleFilters} from "../searchRuleFilters.js"; abstract class TestFindRuleBase extends TestRulesStorageBase { protected abstract getClientId(): string | undefined; @@ -105,4 +105,4 @@ abstract class TestFindRuleBase extends TestRulesStorageBase { } } -export default TestFindRuleBase; +export { TestFindRuleBase}; diff --git a/packages/user-access-policy/src/rule/storage/test/testMongooseRuleModel.ts b/packages/user-access-policy/src/rule/storage/test/testMongooseRuleModel.ts index 1b1bf8a6bd..49945b42a7 100644 --- a/packages/user-access-policy/src/rule/storage/test/testMongooseRuleModel.ts +++ b/packages/user-access-policy/src/rule/storage/test/testMongooseRuleModel.ts @@ -14,10 +14,10 @@ import { MongoMemoryServer } from "mongodb-memory-server"; import mongoose, { type Model } from "mongoose"; import { afterAll, beforeEach } from "vitest"; -import type Rule from "../../rule.js"; -import getMongooseRuleRecordSchema from "../record/getMongooseRuleRecordSchema.js"; +import type { Rule } from "../../rule.js"; +import { getMongooseRuleRecordSchema } from "../record/getMongooseRuleRecordSchema.js"; -export default async function (): Promise> { +const testMongooseRuleModel = async (): Promise> => { const mongoServer = await MongoMemoryServer.create(); const mongoConnection = await mongoose.connect(mongoServer.getUri()); @@ -38,4 +38,6 @@ export default async function (): Promise> { }); return model; -} +}; + +export { testMongooseRuleModel }; diff --git a/packages/user-access-policy/src/rule/storage/test/testRulesStorageBase.ts b/packages/user-access-policy/src/rule/storage/test/testRulesStorageBase.ts index bbb0428b6f..c631c98413 100644 --- a/packages/user-access-policy/src/rule/storage/test/testRulesStorageBase.ts +++ b/packages/user-access-policy/src/rule/storage/test/testRulesStorageBase.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { TestsBase } from "../../../testsBase.js"; -import type RulesStorage from "../rulesStorage.js"; +import type { RulesStorage} from "../rulesStorage.js"; abstract class TestRulesStorageBase extends TestsBase { public constructor(protected rulesStorage: RulesStorage) { @@ -20,4 +20,4 @@ abstract class TestRulesStorageBase extends TestsBase { } } -export default TestRulesStorageBase; +export { TestRulesStorageBase};