@navios/core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/lib/{index-BFwNx9WQ.d.cts → index-BDNl7j1G.d.cts} +666 -292
- package/lib/index-BDNl7j1G.d.cts.map +1 -0
- package/lib/{index-D657ijFO.d.mts → index-BoP0cWT6.d.mts} +666 -292
- package/lib/index-BoP0cWT6.d.mts.map +1 -0
- package/lib/index.cjs +15 -6
- package/lib/index.d.cts +2 -2
- package/lib/index.d.mts +2 -2
- package/lib/index.mjs +3 -3
- package/lib/legacy-compat/index.cjs +1 -1
- package/lib/legacy-compat/index.cjs.map +1 -1
- package/lib/legacy-compat/index.d.cts +1 -1
- package/lib/legacy-compat/index.d.cts.map +1 -1
- package/lib/legacy-compat/index.d.mts +1 -1
- package/lib/legacy-compat/index.d.mts.map +1 -1
- package/lib/legacy-compat/index.mjs +1 -1
- package/lib/legacy-compat/index.mjs.map +1 -1
- package/lib/{src-Cb1aTjl0.cjs → src-B6eISODM.cjs} +622 -114
- package/lib/src-B6eISODM.cjs.map +1 -0
- package/lib/{src-DzPY5s6d.mjs → src-gBAChVRL.mjs} +563 -73
- package/lib/src-gBAChVRL.mjs.map +1 -0
- package/lib/testing/index.cjs +6 -6
- package/lib/testing/index.cjs.map +1 -1
- package/lib/testing/index.d.cts +1 -1
- package/lib/testing/index.d.mts +1 -1
- package/lib/testing/index.mjs +2 -2
- package/lib/{use-guards.decorator-DdvUhB03.cjs → use-guards.decorator-COR-9mZY.cjs} +34 -108
- package/lib/use-guards.decorator-COR-9mZY.cjs.map +1 -0
- package/lib/{use-guards.decorator-kZ3lNK8v.mjs → use-guards.decorator-CUww54Nt.mjs} +14 -94
- package/lib/use-guards.decorator-CUww54Nt.mjs.map +1 -0
- package/package.json +12 -12
- package/src/__tests__/controller-resolver.spec.mts +223 -0
- package/src/__tests__/controller.spec.mts +1 -1
- package/src/decorators/controller.decorator.mts +11 -6
- package/src/decorators/endpoint.decorator.mts +60 -12
- package/src/decorators/multipart.decorator.mts +67 -24
- package/src/decorators/stream.decorator.mts +65 -24
- package/src/interfaces/abstract-http-adapter.interface.mts +52 -0
- package/src/interfaces/abstract-http-handler-adapter.interface.mts +31 -1
- package/src/interfaces/index.mts +1 -0
- package/src/interfaces/plugin.interface.mts +105 -0
- package/src/legacy-compat/decorators/endpoint.decorator.mts +1 -1
- package/src/legacy-compat/decorators/multipart.decorator.mts +1 -1
- package/src/legacy-compat/decorators/stream.decorator.mts +1 -1
- package/src/logger/logger.service.mts +3 -3
- package/src/navios.application.mts +91 -27
- package/src/navios.factory.mts +29 -9
- package/src/services/guard-runner.service.mts +46 -9
- package/src/services/index.mts +1 -0
- package/src/services/instance-resolver.service.mts +186 -0
- package/src/services/module-loader.service.mts +102 -1
- package/src/stores/request-id.store.mts +45 -3
- package/src/tokens/index.mts +1 -0
- package/src/tokens/navios-options.token.mts +6 -0
- package/lib/index-BFwNx9WQ.d.cts.map +0 -1
- package/lib/index-D657ijFO.d.mts.map +0 -1
- package/lib/src-Cb1aTjl0.cjs.map +0 -1
- package/lib/src-DzPY5s6d.mjs.map +0 -1
- package/lib/use-guards.decorator-DdvUhB03.cjs.map +0 -1
- package/lib/use-guards.decorator-kZ3lNK8v.mjs.map +0 -1
- package/src/attribute.factory.d.mts +0 -175
- package/src/attribute.factory.d.mts.map +0 -1
- package/src/config/config-service.interface.d.mts +0 -39
- package/src/config/config-service.interface.d.mts.map +0 -1
- package/src/config/config.provider.d.mts +0 -46
- package/src/config/config.provider.d.mts.map +0 -1
- package/src/config/config.service.d.mts +0 -108
- package/src/config/config.service.d.mts.map +0 -1
- package/src/config/index.d.mts +0 -6
- package/src/config/index.d.mts.map +0 -1
- package/src/config/types.d.mts +0 -13
- package/src/config/types.d.mts.map +0 -1
- package/src/config/utils/helpers.d.mts +0 -3
- package/src/config/utils/helpers.d.mts.map +0 -1
- package/src/config/utils/index.d.mts +0 -2
- package/src/config/utils/index.d.mts.map +0 -1
- package/src/decorators/controller.decorator.d.mts +0 -33
- package/src/decorators/controller.decorator.d.mts.map +0 -1
- package/src/decorators/endpoint.decorator.d.mts +0 -89
- package/src/decorators/endpoint.decorator.d.mts.map +0 -1
- package/src/decorators/header.decorator.d.mts +0 -22
- package/src/decorators/header.decorator.d.mts.map +0 -1
- package/src/decorators/http-code.decorator.d.mts +0 -22
- package/src/decorators/http-code.decorator.d.mts.map +0 -1
- package/src/decorators/index.d.mts +0 -9
- package/src/decorators/index.d.mts.map +0 -1
- package/src/decorators/module.decorator.d.mts +0 -42
- package/src/decorators/module.decorator.d.mts.map +0 -1
- package/src/decorators/multipart.decorator.d.mts +0 -54
- package/src/decorators/multipart.decorator.d.mts.map +0 -1
- package/src/decorators/stream.decorator.d.mts +0 -42
- package/src/decorators/stream.decorator.d.mts.map +0 -1
- package/src/decorators/use-guards.decorator.d.mts +0 -33
- package/src/decorators/use-guards.decorator.d.mts.map +0 -1
- package/src/exceptions/bad-request.exception.d.mts +0 -26
- package/src/exceptions/bad-request.exception.d.mts.map +0 -1
- package/src/exceptions/conflict.exception.d.mts +0 -29
- package/src/exceptions/conflict.exception.d.mts.map +0 -1
- package/src/exceptions/forbidden.exception.d.mts +0 -28
- package/src/exceptions/forbidden.exception.d.mts.map +0 -1
- package/src/exceptions/http.exception.d.mts +0 -33
- package/src/exceptions/http.exception.d.mts.map +0 -1
- package/src/exceptions/index.d.mts +0 -8
- package/src/exceptions/index.d.mts.map +0 -1
- package/src/exceptions/internal-server-error.exception.d.mts +0 -31
- package/src/exceptions/internal-server-error.exception.d.mts.map +0 -1
- package/src/exceptions/not-found.exception.d.mts +0 -30
- package/src/exceptions/not-found.exception.d.mts.map +0 -1
- package/src/exceptions/unauthorized.exception.d.mts +0 -28
- package/src/exceptions/unauthorized.exception.d.mts.map +0 -1
- package/src/factories/endpoint-adapter.factory.d.mts +0 -6
- package/src/factories/endpoint-adapter.factory.d.mts.map +0 -1
- package/src/factories/http-adapter.factory.d.mts +0 -6
- package/src/factories/http-adapter.factory.d.mts.map +0 -1
- package/src/factories/index.d.mts +0 -8
- package/src/factories/index.d.mts.map +0 -1
- package/src/factories/multipart-adapter.factory.d.mts +0 -6
- package/src/factories/multipart-adapter.factory.d.mts.map +0 -1
- package/src/factories/reply.factory.d.mts +0 -6
- package/src/factories/reply.factory.d.mts.map +0 -1
- package/src/factories/request.factory.d.mts +0 -6
- package/src/factories/request.factory.d.mts.map +0 -1
- package/src/factories/stream-adapter.factory.d.mts +0 -6
- package/src/factories/stream-adapter.factory.d.mts.map +0 -1
- package/src/factories/xml-stream-adapter.factory.d.mts +0 -6
- package/src/factories/xml-stream-adapter.factory.d.mts.map +0 -1
- package/src/index.d.mts +0 -15
- package/src/index.d.mts.map +0 -1
- package/src/interfaces/abstract-execution-context.inteface.d.mts +0 -44
- package/src/interfaces/abstract-execution-context.inteface.d.mts.map +0 -1
- package/src/interfaces/abstract-http-adapter.interface.d.mts +0 -15
- package/src/interfaces/abstract-http-adapter.interface.d.mts.map +0 -1
- package/src/interfaces/abstract-http-cors-options.interface.d.mts +0 -58
- package/src/interfaces/abstract-http-cors-options.interface.d.mts.map +0 -1
- package/src/interfaces/abstract-http-handler-adapter.interface.d.mts +0 -7
- package/src/interfaces/abstract-http-handler-adapter.interface.d.mts.map +0 -1
- package/src/interfaces/abstract-http-listen-options.interface.d.mts +0 -5
- package/src/interfaces/abstract-http-listen-options.interface.d.mts.map +0 -1
- package/src/interfaces/can-activate.d.mts +0 -36
- package/src/interfaces/can-activate.d.mts.map +0 -1
- package/src/interfaces/http-header.d.mts +0 -10
- package/src/interfaces/http-header.d.mts.map +0 -1
- package/src/interfaces/index.d.mts +0 -9
- package/src/interfaces/index.d.mts.map +0 -1
- package/src/interfaces/navios-module.d.mts +0 -29
- package/src/interfaces/navios-module.d.mts.map +0 -1
- package/src/legacy-compat/context-compat.d.mts +0 -19
- package/src/legacy-compat/context-compat.d.mts.map +0 -1
- package/src/legacy-compat/decorators/controller.decorator.d.mts +0 -21
- package/src/legacy-compat/decorators/controller.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/endpoint.decorator.d.mts +0 -33
- package/src/legacy-compat/decorators/endpoint.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/header.decorator.d.mts +0 -24
- package/src/legacy-compat/decorators/header.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/http-code.decorator.d.mts +0 -22
- package/src/legacy-compat/decorators/http-code.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/index.d.mts +0 -9
- package/src/legacy-compat/decorators/index.d.mts.map +0 -1
- package/src/legacy-compat/decorators/module.decorator.d.mts +0 -22
- package/src/legacy-compat/decorators/module.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/multipart.decorator.d.mts +0 -34
- package/src/legacy-compat/decorators/multipart.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/stream.decorator.d.mts +0 -34
- package/src/legacy-compat/decorators/stream.decorator.d.mts.map +0 -1
- package/src/legacy-compat/decorators/use-guards.decorator.d.mts +0 -29
- package/src/legacy-compat/decorators/use-guards.decorator.d.mts.map +0 -1
- package/src/legacy-compat/index.d.mts +0 -19
- package/src/legacy-compat/index.d.mts.map +0 -1
- package/src/logger/console-logger.service.d.mts +0 -196
- package/src/logger/console-logger.service.d.mts.map +0 -1
- package/src/logger/index.d.mts +0 -7
- package/src/logger/index.d.mts.map +0 -1
- package/src/logger/log-levels.d.mts +0 -14
- package/src/logger/log-levels.d.mts.map +0 -1
- package/src/logger/logger-service.interface.d.mts +0 -36
- package/src/logger/logger-service.interface.d.mts.map +0 -1
- package/src/logger/logger.service.d.mts +0 -57
- package/src/logger/logger.service.d.mts.map +0 -1
- package/src/logger/logger.tokens.d.mts +0 -36
- package/src/logger/logger.tokens.d.mts.map +0 -1
- package/src/logger/utils/cli-colors.util.d.mts +0 -10
- package/src/logger/utils/cli-colors.util.d.mts.map +0 -1
- package/src/logger/utils/filter-log-levelts.util.d.mts +0 -6
- package/src/logger/utils/filter-log-levelts.util.d.mts.map +0 -1
- package/src/logger/utils/index.d.mts +0 -6
- package/src/logger/utils/index.d.mts.map +0 -1
- package/src/logger/utils/is-log-level-enabled.d.mts +0 -8
- package/src/logger/utils/is-log-level-enabled.d.mts.map +0 -1
- package/src/logger/utils/is-log-level.util.d.mts +0 -6
- package/src/logger/utils/is-log-level.util.d.mts.map +0 -1
- package/src/logger/utils/shared.utils.d.mts +0 -14
- package/src/logger/utils/shared.utils.d.mts.map +0 -1
- package/src/metadata/controller.metadata.d.mts +0 -13
- package/src/metadata/controller.metadata.d.mts.map +0 -1
- package/src/metadata/handler.metadata.d.mts +0 -18
- package/src/metadata/handler.metadata.d.mts.map +0 -1
- package/src/metadata/index.d.mts +0 -4
- package/src/metadata/index.d.mts.map +0 -1
- package/src/metadata/module.metadata.d.mts +0 -13
- package/src/metadata/module.metadata.d.mts.map +0 -1
- package/src/navios.application.d.mts +0 -210
- package/src/navios.application.d.mts.map +0 -1
- package/src/navios.environment.d.mts +0 -11
- package/src/navios.environment.d.mts.map +0 -1
- package/src/navios.factory.d.mts +0 -68
- package/src/navios.factory.d.mts.map +0 -1
- package/src/services/guard-runner.service.d.mts +0 -10
- package/src/services/guard-runner.service.d.mts.map +0 -1
- package/src/services/index.d.mts +0 -3
- package/src/services/index.d.mts.map +0 -1
- package/src/services/module-loader.service.d.mts +0 -17
- package/src/services/module-loader.service.d.mts.map +0 -1
- package/src/stores/index.d.mts +0 -2
- package/src/stores/index.d.mts.map +0 -1
- package/src/stores/request-id.store.d.mts +0 -37
- package/src/stores/request-id.store.d.mts.map +0 -1
- package/src/tokens/endpoint-adapter.token.d.mts +0 -4
- package/src/tokens/endpoint-adapter.token.d.mts.map +0 -1
- package/src/tokens/execution-context.token.d.mts +0 -5
- package/src/tokens/execution-context.token.d.mts.map +0 -1
- package/src/tokens/http-adapter.token.d.mts +0 -4
- package/src/tokens/http-adapter.token.d.mts.map +0 -1
- package/src/tokens/index.d.mts +0 -9
- package/src/tokens/index.d.mts.map +0 -1
- package/src/tokens/multipart-adapter.token.d.mts +0 -4
- package/src/tokens/multipart-adapter.token.d.mts.map +0 -1
- package/src/tokens/reply.token.d.mts +0 -3
- package/src/tokens/reply.token.d.mts.map +0 -1
- package/src/tokens/request.token.d.mts +0 -3
- package/src/tokens/request.token.d.mts.map +0 -1
- package/src/tokens/stream-adapter.token.d.mts +0 -4
- package/src/tokens/stream-adapter.token.d.mts.map +0 -1
- package/src/tokens/xml-stream-adapter.token.d.mts +0 -4
- package/src/tokens/xml-stream-adapter.token.d.mts.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ClassType, ClassTypeWithInstance, InjectionToken } from '@navios/di';
|
|
2
|
-
import type { CanActivate } from '../interfaces/index.mjs';
|
|
3
|
-
import type { HandlerMetadata } from './handler.metadata.mjs';
|
|
4
|
-
export declare const ControllerMetadataKey: unique symbol;
|
|
5
|
-
export interface ControllerMetadata {
|
|
6
|
-
endpoints: Set<HandlerMetadata>;
|
|
7
|
-
guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
8
|
-
customAttributes: Map<string | symbol, any>;
|
|
9
|
-
}
|
|
10
|
-
export declare function getControllerMetadata(target: ClassType, context: ClassDecoratorContext): ControllerMetadata;
|
|
11
|
-
export declare function extractControllerMetadata(target: ClassType): ControllerMetadata;
|
|
12
|
-
export declare function hasControllerMetadata(target: ClassType): boolean;
|
|
13
|
-
//# sourceMappingURL=controller.metadata.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.metadata.d.mts","sourceRoot":"","sources":["controller.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI7D,eAAO,MAAM,qBAAqB,eAAkC,CAAA;AAEpE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,CACT,qBAAqB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAC5E,CAAA;IACD,gBAAgB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5C;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,qBAAqB,GAC7B,kBAAkB,CAwBpB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,GAChB,kBAAkB,CAWpB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAMhE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { HttpMethod } from '@navios/builder';
|
|
2
|
-
import type { ClassTypeWithInstance, InjectionToken } from '@navios/di';
|
|
3
|
-
import type { AbstractHttpHandlerAdapterInterface, CanActivate, HttpHeader } from '../interfaces/index.mjs';
|
|
4
|
-
export declare const EndpointMetadataKey: unique symbol;
|
|
5
|
-
export interface HandlerMetadata<Config = null> {
|
|
6
|
-
classMethod: string;
|
|
7
|
-
url: string;
|
|
8
|
-
successStatusCode: number;
|
|
9
|
-
adapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined> | ClassTypeWithInstance<AbstractHttpHandlerAdapterInterface> | null;
|
|
10
|
-
headers: Partial<Record<HttpHeader, number | string | string[] | undefined>>;
|
|
11
|
-
httpMethod: HttpMethod;
|
|
12
|
-
config: Config;
|
|
13
|
-
guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
14
|
-
customAttributes: Map<string | symbol, any>;
|
|
15
|
-
}
|
|
16
|
-
export declare function getAllEndpointMetadata(context: ClassMethodDecoratorContext | ClassDecoratorContext): Set<HandlerMetadata<any>>;
|
|
17
|
-
export declare function getEndpointMetadata<Config = any>(target: Function, context: ClassMethodDecoratorContext): HandlerMetadata<Config>;
|
|
18
|
-
//# sourceMappingURL=handler.metadata.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handler.metadata.d.mts","sourceRoot":"","sources":["handler.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEvE,OAAO,KAAK,EACV,mCAAmC,EACnC,WAAW,EACX,UAAU,EACX,MAAM,yBAAyB,CAAA;AAEhC,eAAO,MAAM,mBAAmB,eAAgC,CAAA;AAEhE,MAAM,WAAW,eAAe,CAAC,MAAM,GAAG,IAAI;IAC5C,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EACR,cAAc,CAAC,mCAAmC,EAAE,SAAS,CAAC,GAC9D,qBAAqB,CAAC,mCAAmC,CAAC,GAC1D,IAAI,CAAA;IACR,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAA;IAC5E,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,GAAG,CACT,qBAAqB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAC5E,CAAA;IACD,gBAAgB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5C;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,2BAA2B,GAAG,qBAAqB,GAC3D,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAa3B;AAED,wBAAgB,mBAAmB,CAAC,MAAM,GAAG,GAAG,EAC9C,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,2BAA2B,GACnC,eAAe,CAAC,MAAM,CAAC,CA+BzB"}
|
package/src/metadata/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ClassType, ClassTypeWithInstance, InjectionToken } from '@navios/di';
|
|
2
|
-
import type { CanActivate } from '../index.mjs';
|
|
3
|
-
export declare const ModuleMetadataKey: unique symbol;
|
|
4
|
-
export interface ModuleMetadata {
|
|
5
|
-
controllers: Set<ClassType>;
|
|
6
|
-
imports: Set<ClassType>;
|
|
7
|
-
guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
8
|
-
customAttributes: Map<string | symbol, any>;
|
|
9
|
-
}
|
|
10
|
-
export declare function getModuleMetadata(target: ClassType, context: ClassDecoratorContext): ModuleMetadata;
|
|
11
|
-
export declare function extractModuleMetadata(target: ClassType): ModuleMetadata;
|
|
12
|
-
export declare function hasModuleMetadata(target: ClassType): boolean;
|
|
13
|
-
//# sourceMappingURL=module.metadata.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.metadata.d.mts","sourceRoot":"","sources":["module.metadata.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,eAAO,MAAM,iBAAiB,eAAkC,CAAA;AAEhE,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IAC3B,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACvB,MAAM,EAAE,GAAG,CACT,qBAAqB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAC5E,CAAA;IACD,gBAAgB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5C;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,qBAAqB,GAC7B,cAAc,CAwBhB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,CASvE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAG5D"}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance } from '@navios/di';
|
|
2
|
-
import { Container } from '@navios/di';
|
|
3
|
-
import type { AbstractHttpListenOptions, NaviosModule } from './interfaces/index.mjs';
|
|
4
|
-
import type { LoggerService, LogLevel } from './logger/index.mjs';
|
|
5
|
-
import type { NaviosEnvironmentOptions } from './navios.environment.mjs';
|
|
6
|
-
/**
|
|
7
|
-
* Options for configuring the Navios application context.
|
|
8
|
-
* These options control dependency injection and logging behavior.
|
|
9
|
-
*/
|
|
10
|
-
export interface NaviosApplicationContextOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Specifies the logger to use. Pass `false` to turn off logging.
|
|
13
|
-
*
|
|
14
|
-
* - `LoggerService` instance: Use a custom logger implementation
|
|
15
|
-
* - `LogLevel[]`: Enable specific log levels (e.g., ['error', 'warn', 'log'])
|
|
16
|
-
* - `false`: Disable logging completely
|
|
17
|
-
*/
|
|
18
|
-
logger?: LoggerService | LogLevel[] | false;
|
|
19
|
-
/**
|
|
20
|
-
* Specifies a custom container to use. Useful for testing.
|
|
21
|
-
* If not provided, a new Container will be created.
|
|
22
|
-
*/
|
|
23
|
-
container?: Container;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Complete options for creating a Navios application.
|
|
27
|
-
* Extends NaviosApplicationContextOptions with adapter configuration.
|
|
28
|
-
*/
|
|
29
|
-
export interface NaviosApplicationOptions extends NaviosApplicationContextOptions {
|
|
30
|
-
/**
|
|
31
|
-
* HTTP adapter environment(s) to use for the application.
|
|
32
|
-
* Can be a single adapter or an array of adapters.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* adapter: defineFastifyEnvironment()
|
|
37
|
-
* // or
|
|
38
|
-
* adapter: [defineFastifyEnvironment(), defineBunEnvironment()]
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
adapter: NaviosEnvironmentOptions | NaviosEnvironmentOptions[];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Main application class for Navios.
|
|
45
|
-
*
|
|
46
|
-
* This class represents a Navios application instance and provides methods
|
|
47
|
-
* for initializing, configuring, and managing the HTTP server.
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
52
|
-
* adapter: defineFastifyEnvironment(),
|
|
53
|
-
* })
|
|
54
|
-
*
|
|
55
|
-
* app.setGlobalPrefix('/api')
|
|
56
|
-
* app.enableCors({ origin: ['http://localhost:3000'] })
|
|
57
|
-
* await app.init()
|
|
58
|
-
* await app.listen({ port: 3000, host: '0.0.0.0' })
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
export declare class NaviosApplication {
|
|
62
|
-
private environment;
|
|
63
|
-
private moduleLoader;
|
|
64
|
-
private httpApplication;
|
|
65
|
-
private logger;
|
|
66
|
-
protected container: Container;
|
|
67
|
-
private appModule;
|
|
68
|
-
private options;
|
|
69
|
-
/**
|
|
70
|
-
* Indicates whether the application has been initialized.
|
|
71
|
-
* Set to `true` after `init()` completes successfully.
|
|
72
|
-
*/
|
|
73
|
-
isInitialized: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Sets up the application with the provided module and options.
|
|
76
|
-
* This is called automatically by NaviosFactory.create().
|
|
77
|
-
*
|
|
78
|
-
* @param appModule - The root application module
|
|
79
|
-
* @param options - Application configuration options
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Gets the dependency injection container used by this application.
|
|
85
|
-
*
|
|
86
|
-
* @returns The Container instance
|
|
87
|
-
*/
|
|
88
|
-
getContainer(): Container;
|
|
89
|
-
/**
|
|
90
|
-
* Initializes the application.
|
|
91
|
-
*
|
|
92
|
-
* This method:
|
|
93
|
-
* - Loads all modules and their dependencies
|
|
94
|
-
* - Sets up the HTTP server if an adapter is configured
|
|
95
|
-
* - Calls onModuleInit hooks on all modules
|
|
96
|
-
* - Marks the application as initialized
|
|
97
|
-
*
|
|
98
|
-
* Must be called before `listen()`.
|
|
99
|
-
*
|
|
100
|
-
* @throws Error if app module is not set
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
105
|
-
* adapter: defineFastifyEnvironment(),
|
|
106
|
-
* })
|
|
107
|
-
* await app.init()
|
|
108
|
-
* await app.listen({ port: 3000 })
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
init(): Promise<void>;
|
|
112
|
-
private initModules;
|
|
113
|
-
/**
|
|
114
|
-
* Enables CORS (Cross-Origin Resource Sharing) for the application.
|
|
115
|
-
*
|
|
116
|
-
* @param options - CORS configuration options (adapter-specific)
|
|
117
|
-
* @throws Error if HTTP application is not set
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```typescript
|
|
121
|
-
* app.enableCors({
|
|
122
|
-
* origin: ['http://localhost:3000', 'https://example.com'],
|
|
123
|
-
* methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
124
|
-
* credentials: true,
|
|
125
|
-
* })
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
enableCors(options: any): void;
|
|
129
|
-
/**
|
|
130
|
-
* Enables multipart/form-data support for file uploads.
|
|
131
|
-
*
|
|
132
|
-
* @param options - Multipart configuration options (adapter-specific)
|
|
133
|
-
* @throws Error if HTTP application is not set
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```typescript
|
|
137
|
-
* app.enableMultipart({
|
|
138
|
-
* limits: {
|
|
139
|
-
* fileSize: 1024 * 1024 * 10, // 10MB
|
|
140
|
-
* },
|
|
141
|
-
* })
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
|
-
enableMultipart(options: any): void;
|
|
145
|
-
/**
|
|
146
|
-
* Sets a global prefix for all routes.
|
|
147
|
-
*
|
|
148
|
-
* @param prefix - The prefix to prepend to all route URLs (e.g., '/api')
|
|
149
|
-
* @throws Error if HTTP application is not set
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* app.setGlobalPrefix('/api/v1')
|
|
154
|
-
* // All routes will be prefixed with /api/v1
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
setGlobalPrefix(prefix: string): void;
|
|
158
|
-
/**
|
|
159
|
-
* Gets the underlying HTTP server instance.
|
|
160
|
-
*
|
|
161
|
-
* The type of the returned server depends on the adapter used:
|
|
162
|
-
* - Fastify adapter: Returns FastifyInstance
|
|
163
|
-
* - Bun adapter: Returns Bun.Server
|
|
164
|
-
*
|
|
165
|
-
* @returns The HTTP server instance
|
|
166
|
-
* @throws Error if HTTP application is not set
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* const server = app.getServer()
|
|
171
|
-
* // Use adapter-specific server methods
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
getServer(): any;
|
|
175
|
-
/**
|
|
176
|
-
* Starts the HTTP server and begins listening for requests.
|
|
177
|
-
*
|
|
178
|
-
* @param options - Listen options (port, host, etc.)
|
|
179
|
-
* @throws Error if HTTP application is not set
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* ```typescript
|
|
183
|
-
* await app.listen({ port: 3000, host: '0.0.0.0' })
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
listen(options: AbstractHttpListenOptions): Promise<void>;
|
|
187
|
-
/**
|
|
188
|
-
* Disposes of application resources.
|
|
189
|
-
*
|
|
190
|
-
* Cleans up the HTTP server and module loader.
|
|
191
|
-
* This method is called automatically by `close()`.
|
|
192
|
-
*/
|
|
193
|
-
dispose(): Promise<void>;
|
|
194
|
-
/**
|
|
195
|
-
* Closes the application and cleans up all resources.
|
|
196
|
-
*
|
|
197
|
-
* This is an alias for `dispose()`.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```typescript
|
|
201
|
-
* // Graceful shutdown
|
|
202
|
-
* process.on('SIGTERM', async () => {
|
|
203
|
-
* await app.close()
|
|
204
|
-
* process.exit(0)
|
|
205
|
-
* })
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
close(): Promise<void>;
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=navios.application.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navios.application.d.mts","sourceRoot":"","sources":["navios.application.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAA;AAE1D,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAOxE;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,aAAa,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAA;IAE3C;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,wBACf,SAAQ,+BAA+B;IACvC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,wBAAwB,GAAG,wBAAwB,EAAE,CAAA;CAC/D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,iBAAiB;IAC5B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,eAAe,CAAiD;IACxE,OAAO,CAAC,MAAM,CAEZ;IACF,SAAS,CAAC,SAAS,YAAoB;IAEvC,OAAO,CAAC,SAAS,CAAmD;IACpE,OAAO,CAAC,OAAO,CAEd;IAED;;;OAGG;IACH,aAAa,UAAQ;IAErB;;;;;;;OAOG;IACG,KAAK,CACT,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC,EAC9C,OAAO,GAAE,wBAER;IASH;;;;OAIG;IACH,YAAY;IAIZ;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,IAAI;YAiBI,WAAW;IAKzB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,OAAO,EAAE,GAAG;IAOvB;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,OAAO,EAAE,GAAG;IAO5B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM;IAO9B;;;;;;;;;;;;;;;OAeG;IACH,SAAS;IAOT;;;;;;;;;;OAUG;IACG,MAAM,CAAC,OAAO,EAAE,yBAAyB;IAO/C;;;;;OAKG;IACG,OAAO;IASb;;;;;;;;;;;;;OAaG;IACG,KAAK;CAGZ"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnyInjectableType, InjectionToken } from '@navios/di';
|
|
2
|
-
export interface NaviosEnvironmentOptions {
|
|
3
|
-
httpTokens?: Map<InjectionToken<any, undefined>, AnyInjectableType>;
|
|
4
|
-
}
|
|
5
|
-
export declare class NaviosEnvironment {
|
|
6
|
-
private httpTokens;
|
|
7
|
-
setupHttpEnvironment(tokens: Map<InjectionToken<any, undefined>, AnyInjectableType>): void;
|
|
8
|
-
getHttpToken(token: InjectionToken<any, undefined>): AnyInjectableType | undefined;
|
|
9
|
-
hasHttpSetup(): boolean;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=navios.environment.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navios.environment.d.mts","sourceRoot":"","sources":["navios.environment.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAInE,MAAM,WAAW,wBAAwB;IAEvC,UAAU,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAA;CACpE;AAED,qBACa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAGf;IAEH,oBAAoB,CAClB,MAAM,EAAE,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAKhE,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC;IAIlD,YAAY;CAGb"}
|
package/src/navios.factory.d.mts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance } from '@navios/di';
|
|
2
|
-
import type { NaviosModule } from './interfaces/index.mjs';
|
|
3
|
-
import type { NaviosApplicationOptions } from './navios.application.mjs';
|
|
4
|
-
import { NaviosApplication } from './navios.application.mjs';
|
|
5
|
-
/**
|
|
6
|
-
* Factory class for creating and configuring Navios applications.
|
|
7
|
-
*
|
|
8
|
-
* This is the main entry point for bootstrapping a Navios application.
|
|
9
|
-
* It handles dependency injection container setup, adapter registration,
|
|
10
|
-
* and logger configuration.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { NaviosFactory } from '@navios/core'
|
|
15
|
-
* import { defineFastifyEnvironment } from '@navios/adapter-fastify'
|
|
16
|
-
*
|
|
17
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
18
|
-
* adapter: defineFastifyEnvironment(),
|
|
19
|
-
* logger: ['log', 'error', 'warn'],
|
|
20
|
-
* })
|
|
21
|
-
*
|
|
22
|
-
* await app.init()
|
|
23
|
-
* await app.listen({ port: 3000 })
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare class NaviosFactory {
|
|
27
|
-
/**
|
|
28
|
-
* Creates a new Navios application instance.
|
|
29
|
-
*
|
|
30
|
-
* This method sets up the dependency injection container, registers the HTTP adapter,
|
|
31
|
-
* configures logging, and initializes the application with the provided module.
|
|
32
|
-
*
|
|
33
|
-
* @param appModule - The root application module class decorated with @Module()
|
|
34
|
-
* @param options - Configuration options for the application
|
|
35
|
-
* @param options.adapter - HTTP adapter environment (required for HTTP server functionality)
|
|
36
|
-
* @param options.logger - Logger configuration. Can be:
|
|
37
|
-
* - A LoggerService instance for custom logging
|
|
38
|
-
* - An array of LogLevel strings to enable specific log levels
|
|
39
|
-
* - `false` to disable logging
|
|
40
|
-
* @param options.container - Optional custom dependency injection container (useful for testing)
|
|
41
|
-
* @returns A configured NaviosApplication instance ready to be initialized
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* // Basic setup with Fastify adapter
|
|
46
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
47
|
-
* adapter: defineFastifyEnvironment(),
|
|
48
|
-
* })
|
|
49
|
-
*
|
|
50
|
-
* // With custom logger configuration
|
|
51
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
52
|
-
* adapter: defineFastifyEnvironment(),
|
|
53
|
-
* logger: ['error', 'warn', 'log'],
|
|
54
|
-
* })
|
|
55
|
-
*
|
|
56
|
-
* // With custom container for testing
|
|
57
|
-
* const container = new Container()
|
|
58
|
-
* const app = await NaviosFactory.create(AppModule, {
|
|
59
|
-
* adapter: defineFastifyEnvironment(),
|
|
60
|
-
* container,
|
|
61
|
-
* })
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
static create(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<NaviosApplication>;
|
|
65
|
-
private static registerEnvironment;
|
|
66
|
-
private static registerLoggerConfiguration;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=navios.factory.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navios.factory.d.mts","sourceRoot":"","sources":["navios.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,YAAY,CAAA;AAInB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;WACU,MAAM,CACjB,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC,EAC9C,OAAO,GAAE,wBAER;mBAekB,mBAAmB;mBAanB,2BAA2B;CAyBjD"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance, ScopedContainer } from '@navios/di';
|
|
2
|
-
import { InjectionToken } from '@navios/di';
|
|
3
|
-
import type { AbstractExecutionContext, CanActivate } from '../interfaces/index.mjs';
|
|
4
|
-
import type { ControllerMetadata, HandlerMetadata, ModuleMetadata } from '../metadata/index.mjs';
|
|
5
|
-
export declare class GuardRunnerService {
|
|
6
|
-
private readonly logger;
|
|
7
|
-
runGuards(allGuards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>, executionContext: AbstractExecutionContext, context: ScopedContainer): Promise<boolean>;
|
|
8
|
-
makeContext(moduleMetadata: ModuleMetadata, controllerMetadata: ControllerMetadata, endpoint: HandlerMetadata): Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=guard-runner.service.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guard-runner.service.d.mts","sourceRoot":"","sources":["guard-runner.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAExE,OAAO,EAAsB,cAAc,EAAE,MAAM,YAAY,CAAA;AAE/D,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAA;AAK9B,qBACa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAErB;IACI,SAAS,CACb,SAAS,EAAE,GAAG,CACV,qBAAqB,CAAC,WAAW,CAAC,GAClC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CACzC,EACD,gBAAgB,EAAE,wBAAwB,EAC1C,OAAO,EAAE,eAAe;IA0C1B,WAAW,CACT,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,eAAe,GACxB,GAAG,CACJ,qBAAqB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAC5E;CAyBF"}
|
package/src/services/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance } from '@navios/di';
|
|
2
|
-
import { Container } from '@navios/di';
|
|
3
|
-
import type { NaviosModule } from '../interfaces/index.mjs';
|
|
4
|
-
import type { ModuleMetadata } from '../metadata/index.mjs';
|
|
5
|
-
export declare class ModuleLoaderService {
|
|
6
|
-
private logger;
|
|
7
|
-
protected container: Container;
|
|
8
|
-
private modulesMetadata;
|
|
9
|
-
private loadedModules;
|
|
10
|
-
private initialized;
|
|
11
|
-
loadModules(appModule: ClassTypeWithInstance<NaviosModule>): Promise<void>;
|
|
12
|
-
private traverseModules;
|
|
13
|
-
private mergeMetadata;
|
|
14
|
-
getAllModules(): Map<string, ModuleMetadata>;
|
|
15
|
-
dispose(): void;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=module-loader.service.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-loader.service.d.mts","sourceRoot":"","sources":["module-loader.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAK3D,qBACa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAEZ;IACF,SAAS,CAAC,SAAS,YAAoB;IACvC,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,WAAW,CAAQ;IAErB,WAAW,CAAC,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC;YAQlD,eAAe;IA+B7B,OAAO,CAAC,aAAa;IAkBrB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAG5C,OAAO;CAKR"}
|
package/src/stores/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
-
/**
|
|
3
|
-
* AsyncLocalStorage store for the current request ID.
|
|
4
|
-
*
|
|
5
|
-
* This allows logging and other services to access the current request ID
|
|
6
|
-
* without explicitly passing it through the call stack.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { requestIdStore, runWithRequestId, getRequestId } from '@navios/core'
|
|
11
|
-
*
|
|
12
|
-
* // Run code with a request ID in context
|
|
13
|
-
* runWithRequestId('req-123', () => {
|
|
14
|
-
* // Inside this callback, getRequestId() returns 'req-123'
|
|
15
|
-
* logger.log('Processing request') // Will include request ID if logger is configured
|
|
16
|
-
* })
|
|
17
|
-
*
|
|
18
|
-
* // Get current request ID (returns undefined if not in a request context)
|
|
19
|
-
* const currentId = getRequestId()
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare const requestIdStore: AsyncLocalStorage<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Runs a function with a request ID in the async local storage context.
|
|
25
|
-
*
|
|
26
|
-
* @param requestId - The request ID to set for this context
|
|
27
|
-
* @param fn - The function to run within this context
|
|
28
|
-
* @returns The return value of the function
|
|
29
|
-
*/
|
|
30
|
-
export declare function runWithRequestId<R>(requestId: string, fn: () => R): R;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the current request ID from the async local storage context.
|
|
33
|
-
*
|
|
34
|
-
* @returns The current request ID, or undefined if not in a request context
|
|
35
|
-
*/
|
|
36
|
-
export declare function getRequestId(): string | undefined;
|
|
37
|
-
//# sourceMappingURL=request-id.store.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-id.store.d.mts","sourceRoot":"","sources":["request-id.store.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAE7D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAEjD"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const EndpointAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
4
|
-
//# sourceMappingURL=endpoint-adapter.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-adapter.token.d.mts","sourceRoot":"","sources":["endpoint-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,oBAAoB,uEAG9B,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractExecutionContext } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const ExecutionContextInjectionToken = "ExecutionContextInjectionToken";
|
|
4
|
-
export declare const ExecutionContext: InjectionToken<AbstractExecutionContext, undefined, false>;
|
|
5
|
-
//# sourceMappingURL=execution-context.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context.token.d.mts","sourceRoot":"","sources":["execution-context.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,eAAO,MAAM,8BAA8B,mCAAmC,CAAA;AAE9E,eAAO,MAAM,gBAAgB,4DAE5B,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractHttpAdapterInterface } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const HttpAdapterToken: InjectionToken<AbstractHttpAdapterInterface<any, any, any, any>, undefined, false>;
|
|
4
|
-
//# sourceMappingURL=http-adapter.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-adapter.token.d.mts","sourceRoot":"","sources":["http-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAE3E,eAAO,MAAM,gBAAgB,oFAG1B,CAAA"}
|
package/src/tokens/index.d.mts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './endpoint-adapter.token.mjs';
|
|
2
|
-
export * from './execution-context.token.mjs';
|
|
3
|
-
export * from './http-adapter.token.mjs';
|
|
4
|
-
export * from './multipart-adapter.token.mjs';
|
|
5
|
-
export * from './reply.token.mjs';
|
|
6
|
-
export * from './request.token.mjs';
|
|
7
|
-
export * from './stream-adapter.token.mjs';
|
|
8
|
-
export * from './xml-stream-adapter.token.mjs';
|
|
9
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const MultipartAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
4
|
-
//# sourceMappingURL=multipart-adapter.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipart-adapter.token.d.mts","sourceRoot":"","sources":["multipart-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,qBAAqB,uEAG/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reply.token.d.mts","sourceRoot":"","sources":["reply.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,KAAK,uCAA2C,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.token.d.mts","sourceRoot":"","sources":["request.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,OAAO,uCAA6C,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const StreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
4
|
-
//# sourceMappingURL=stream-adapter.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream-adapter.token.d.mts","sourceRoot":"","sources":["stream-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,kBAAkB,uEAG5B,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@navios/di';
|
|
2
|
-
import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
|
|
3
|
-
export declare const XmlStreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
4
|
-
//# sourceMappingURL=xml-stream-adapter.token.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xml-stream-adapter.token.d.mts","sourceRoot":"","sources":["xml-stream-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,qBAAqB,uEAG/B,CAAA"}
|