@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,30 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 404 Not Found HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when the requested resource does not exist.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* @Endpoint(getUserEndpoint)
|
|
10
|
-
* async getUser(request: EndpointParams<typeof getUserEndpoint>) {
|
|
11
|
-
* const user = await this.userService.findById(request.urlParams.userId)
|
|
12
|
-
* if (!user) {
|
|
13
|
-
* throw new NotFoundException('User not found')
|
|
14
|
-
* }
|
|
15
|
-
* return user
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare class NotFoundException extends HttpException {
|
|
20
|
-
readonly response: string | object;
|
|
21
|
-
readonly error?: Error | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new NotFoundException.
|
|
24
|
-
*
|
|
25
|
-
* @param response - Error message or response object
|
|
26
|
-
* @param error - Optional underlying error for logging
|
|
27
|
-
*/
|
|
28
|
-
constructor(response: string | object, error?: Error | undefined);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=not-found.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-found.exception.d.mts","sourceRoot":"","sources":["not-found.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;aAQhC,QAAQ,EAAE,MAAM,GAAG,MAAM;aACzB,KAAK,CAAC,EAAE,KAAK;IAR/B;;;;;OAKG;gBAEe,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,KAAK,CAAC,EAAE,KAAK,YAAA;CAIhC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 401 Unauthorized HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when the client is not authenticated or authentication failed.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* @Endpoint(getUserEndpoint)
|
|
10
|
-
* @UseGuards(AuthGuard)
|
|
11
|
-
* async getUser(request: EndpointParams<typeof getUserEndpoint>) {
|
|
12
|
-
* if (!request.headers.authorization) {
|
|
13
|
-
* throw new UnauthorizedException('Authentication required')
|
|
14
|
-
* }
|
|
15
|
-
* // ...
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare class UnauthorizedException extends HttpException {
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new UnauthorizedException.
|
|
22
|
-
*
|
|
23
|
-
* @param message - Error message or response object
|
|
24
|
-
* @param error - Optional underlying error for logging
|
|
25
|
-
*/
|
|
26
|
-
constructor(message: string | object, error?: Error);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=unauthorized.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unauthorized.exception.d.mts","sourceRoot":"","sources":["unauthorized.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-adapter.factory.d.mts","sourceRoot":"","sources":["endpoint-adapter.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAGa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IAExD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-adapter.factory.d.mts","sourceRoot":"","sources":["http-adapter.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAOhD,qBAGa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './endpoint-adapter.factory.mjs';
|
|
2
|
-
export * from './http-adapter.factory.mjs';
|
|
3
|
-
export * from './multipart-adapter.factory.mjs';
|
|
4
|
-
export * from './request.factory.mjs';
|
|
5
|
-
export * from './reply.factory.mjs';
|
|
6
|
-
export * from './stream-adapter.factory.mjs';
|
|
7
|
-
export * from './xml-stream-adapter.factory.mjs';
|
|
8
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kCAAkC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipart-adapter.factory.d.mts","sourceRoot":"","sources":["multipart-adapter.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAGa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IAExD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reply.factory.d.mts","sourceRoot":"","sources":["reply.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAIa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.factory.d.mts","sourceRoot":"","sources":["request.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAIa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream-adapter.factory.d.mts","sourceRoot":"","sources":["stream-adapter.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAGa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xml-stream-adapter.factory.d.mts","sourceRoot":"","sources":["xml-stream-adapter.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,YAAY,CAAA;AAOhE,qBAGa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4B;IACxD,MAAM,CAAC,GAAG,EAAE,cAAc;CAO3B"}
|
package/src/index.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from '@navios/di';
|
|
2
|
-
export * from './config/index.mjs';
|
|
3
|
-
export * from './decorators/index.mjs';
|
|
4
|
-
export * from './exceptions/index.mjs';
|
|
5
|
-
export * from './interfaces/index.mjs';
|
|
6
|
-
export * from './logger/index.mjs';
|
|
7
|
-
export * from './metadata/index.mjs';
|
|
8
|
-
export * from './services/index.mjs';
|
|
9
|
-
export * from './stores/index.mjs';
|
|
10
|
-
export * from './tokens/index.mjs';
|
|
11
|
-
export * from './attribute.factory.mjs';
|
|
12
|
-
export * from './factories/index.mjs';
|
|
13
|
-
export * from './navios.application.mjs';
|
|
14
|
-
export * from './navios.factory.mjs';
|
|
15
|
-
//# sourceMappingURL=index.d.mts.map
|
package/src/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ControllerMetadata, HandlerMetadata, ModuleMetadata } from '../metadata/index.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Interface providing access to the execution context during request handling.
|
|
4
|
-
*
|
|
5
|
-
* The execution context provides access to metadata and request/reply objects
|
|
6
|
-
* for the current request. It is available in guards and can be injected into
|
|
7
|
-
* services if needed.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @Injectable()
|
|
12
|
-
* export class AuthGuard implements CanActivate {
|
|
13
|
-
* async canActivate(context: AbstractExecutionContext): Promise<boolean> {
|
|
14
|
-
* const request = context.getRequest()
|
|
15
|
-
* const handler = context.getHandler()
|
|
16
|
-
* // Access request and handler metadata
|
|
17
|
-
* return true
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export interface AbstractExecutionContext {
|
|
23
|
-
/**
|
|
24
|
-
* Gets the metadata for the module containing the current endpoint.
|
|
25
|
-
*/
|
|
26
|
-
getModule(): ModuleMetadata;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the metadata for the controller containing the current endpoint.
|
|
29
|
-
*/
|
|
30
|
-
getController(): ControllerMetadata;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the metadata for the current endpoint handler.
|
|
33
|
-
*/
|
|
34
|
-
getHandler(): HandlerMetadata;
|
|
35
|
-
/**
|
|
36
|
-
* Gets the HTTP request object (adapter-specific).
|
|
37
|
-
*/
|
|
38
|
-
getRequest(): any;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the HTTP reply object (adapter-specific).
|
|
41
|
-
*/
|
|
42
|
-
getReply(): any;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=abstract-execution-context.inteface.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-execution-context.inteface.d.mts","sourceRoot":"","sources":["abstract-execution-context.inteface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,IAAI,cAAc,CAAA;IAC3B;;OAEG;IACH,aAAa,IAAI,kBAAkB,CAAA;IACnC;;OAEG;IACH,UAAU,IAAI,eAAe,CAAA;IAC7B;;OAEG;IACH,UAAU,IAAI,GAAG,CAAA;IACjB;;OAEG;IACH,QAAQ,IAAI,GAAG,CAAA;CAChB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ModuleMetadata } from '../metadata/index.mjs';
|
|
2
|
-
import type { AbstractHttpCorsOptions } from './abstract-http-cors-options.interface.mjs';
|
|
3
|
-
import type { AbstractHttpListenOptions } from './abstract-http-listen-options.interface.mjs';
|
|
4
|
-
export interface AbstractHttpAdapterInterface<ServerInstance, CorsOptions = AbstractHttpCorsOptions, Options = {}, MultipartOptions = {}> {
|
|
5
|
-
setupHttpServer(options: Options): Promise<void>;
|
|
6
|
-
onModulesInit(modules: Map<string, ModuleMetadata>): Promise<void>;
|
|
7
|
-
ready(): Promise<void>;
|
|
8
|
-
getServer(): ServerInstance;
|
|
9
|
-
setGlobalPrefix(prefix: string): void;
|
|
10
|
-
enableCors(options: CorsOptions): void;
|
|
11
|
-
enableMultipart(options: MultipartOptions): void;
|
|
12
|
-
listen(options: AbstractHttpListenOptions): Promise<string>;
|
|
13
|
-
dispose(): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=abstract-http-adapter.interface.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-http-adapter.interface.d.mts","sourceRoot":"","sources":["abstract-http-adapter.interface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAA;AAE7F,MAAM,WAAW,4BAA4B,CAC3C,cAAc,EACd,WAAW,GAAG,uBAAuB,EACrC,OAAO,GAAG,EAAE,EACZ,gBAAgB,GAAG,EAAE;IAErB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAChD,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,SAAS,IAAI,cAAc,CAAA;IAC3B,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IACtC,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAChD,MAAM,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { LogLevel } from '../logger/index.mjs';
|
|
2
|
-
interface ArrayOfValueOrArray<T> extends Array<ValueOrArray<T>> {
|
|
3
|
-
}
|
|
4
|
-
type OriginType = string | boolean | RegExp;
|
|
5
|
-
type ValueOrArray<T> = T | ArrayOfValueOrArray<T>;
|
|
6
|
-
export interface AbstractHttpCorsOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Configures the Access-Control-Allow-Origin CORS header.
|
|
9
|
-
*/
|
|
10
|
-
origin?: ValueOrArray<OriginType>;
|
|
11
|
-
/**
|
|
12
|
-
* Configures the Access-Control-Allow-Credentials CORS header.
|
|
13
|
-
* Set to true to pass the header, otherwise it is omitted.
|
|
14
|
-
*/
|
|
15
|
-
credentials?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Configures the Access-Control-Expose-Headers CORS header.
|
|
18
|
-
* Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range')
|
|
19
|
-
* or an array (ex: ['Content-Range', 'X-Content-Range']).
|
|
20
|
-
* If not specified, no custom headers are exposed.
|
|
21
|
-
*/
|
|
22
|
-
exposedHeaders?: string | string[];
|
|
23
|
-
/**
|
|
24
|
-
* Configures the Access-Control-Allow-Headers CORS header.
|
|
25
|
-
* Expects a comma-delimited string (ex: 'Content-Type,Authorization')
|
|
26
|
-
* or an array (ex: ['Content-Type', 'Authorization']). If not
|
|
27
|
-
* specified, defaults to reflecting the headers specified in the
|
|
28
|
-
* request's Access-Control-Request-Headers header.
|
|
29
|
-
*/
|
|
30
|
-
allowedHeaders?: string | string[];
|
|
31
|
-
/**
|
|
32
|
-
* Configures the Access-Control-Allow-Methods CORS header.
|
|
33
|
-
* Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: ['GET', 'PUT', 'POST']).
|
|
34
|
-
*/
|
|
35
|
-
methods?: string | string[];
|
|
36
|
-
/**
|
|
37
|
-
* Configures the Access-Control-Max-Age CORS header.
|
|
38
|
-
* Set to an integer to pass the header, otherwise it is omitted.
|
|
39
|
-
*/
|
|
40
|
-
maxAge?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Configures the Cache-Control header for CORS preflight responses.
|
|
43
|
-
* Set to an integer to pass the header as `Cache-Control: max-age=${cacheControl}`,
|
|
44
|
-
* or set to a string to pass the header as `Cache-Control: ${cacheControl}` (fully define
|
|
45
|
-
* the header value), otherwise the header is omitted.
|
|
46
|
-
*/
|
|
47
|
-
cacheControl?: number | string;
|
|
48
|
-
/**
|
|
49
|
-
* Sets the Fastify log level specifically for the internal OPTIONS route
|
|
50
|
-
* used to handle CORS preflight requests. For example, setting this to `'silent'`
|
|
51
|
-
* will prevent these requests from being logged.
|
|
52
|
-
* Useful for reducing noise in application logs.
|
|
53
|
-
* Default: inherits Fastify's global log level.
|
|
54
|
-
*/
|
|
55
|
-
logLevel?: LogLevel;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=abstract-http-cors-options.interface.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-http-cors-options.interface.d.mts","sourceRoot":"","sources":["abstract-http-cors-options.interface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,UAAU,mBAAmB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAAG;AAElE,KAAK,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAC3C,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;AAEjD,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAClC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAE9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ClassType, ScopedContainer } from '@navios/di';
|
|
2
|
-
import type { HandlerMetadata } from '../metadata/index.mjs';
|
|
3
|
-
export interface AbstractHttpHandlerAdapterInterface {
|
|
4
|
-
prepareArguments?: (handlerMetadata: HandlerMetadata<any>) => ((target: Record<string, any>, request: any) => Promise<void> | void)[];
|
|
5
|
-
provideHandler: (controller: ClassType, handlerMetadata: HandlerMetadata<any>) => (context: ScopedContainer, request: any, reply: any) => Promise<any>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=abstract-http-handler-adapter.interface.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-http-handler-adapter.interface.d.mts","sourceRoot":"","sources":["abstract-http-handler-adapter.interface.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,MAAM,WAAW,mCAAmC;IAClD,gBAAgB,CAAC,EAAE,CACjB,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,KAClC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;IAC5E,cAAc,EAAE,CACd,UAAU,EAAE,SAAS,EACrB,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,KAClC,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAC1E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-http-listen-options.interface.d.mts","sourceRoot":"","sources":["abstract-http-listen-options.interface.mts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { AbstractExecutionContext } from '../interfaces/index.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Interface that guards must implement to control access to endpoints.
|
|
4
|
-
*
|
|
5
|
-
* Guards are used for authentication, authorization, and request validation.
|
|
6
|
-
* They are executed before the endpoint handler and can prevent the request
|
|
7
|
-
* from proceeding by returning `false` or throwing an exception.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @Injectable()
|
|
12
|
-
* export class AuthGuard implements CanActivate {
|
|
13
|
-
* async canActivate(context: AbstractExecutionContext): Promise<boolean> {
|
|
14
|
-
* const request = context.getRequest()
|
|
15
|
-
* const token = request.headers.authorization
|
|
16
|
-
*
|
|
17
|
-
* if (!token) {
|
|
18
|
-
* throw new UnauthorizedException('Authentication required')
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* // Validate token
|
|
22
|
-
* return true
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export interface CanActivate {
|
|
28
|
-
/**
|
|
29
|
-
* Determines if the current request can proceed to the endpoint handler.
|
|
30
|
-
*
|
|
31
|
-
* @param executionContext - The execution context containing request, reply, and metadata
|
|
32
|
-
* @returns `true` if the request can proceed, `false` otherwise. Can also throw an exception.
|
|
33
|
-
*/
|
|
34
|
-
canActivate(executionContext: AbstractExecutionContext): Promise<boolean> | boolean;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=can-activate.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"can-activate.d.mts","sourceRoot":"","sources":["can-activate.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,WAAW,CACT,gBAAgB,EAAE,wBAAwB,GACzC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;CAC9B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OutgoingHttpHeaders } from 'http';
|
|
2
|
-
export type OmitIndexSignature<T> = {
|
|
3
|
-
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* HTTP header strings
|
|
7
|
-
* Use this type only for input values, not for output values.
|
|
8
|
-
*/
|
|
9
|
-
export type HttpHeader = keyof OmitIndexSignature<OutgoingHttpHeaders> | (string & Record<never, never>);
|
|
10
|
-
//# sourceMappingURL=http-header.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-header.d.mts","sourceRoot":"","sources":["http-header.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAE/C,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI;KACjC,CAAC,IAAI,MAAM,CAAC,IAAI,MAAM,SAAS,CAAC,GAC7B,KAAK,GACL,MAAM,SAAS,CAAC,GACd,KAAK,GACL,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACf,CAAA;AAED;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAClB,MAAM,kBAAkB,CAAC,mBAAmB,CAAC,GAC7C,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './abstract-execution-context.inteface.mjs';
|
|
2
|
-
export * from './abstract-http-adapter.interface.mjs';
|
|
3
|
-
export * from './abstract-http-cors-options.interface.mjs';
|
|
4
|
-
export * from './abstract-http-handler-adapter.interface.mjs';
|
|
5
|
-
export * from './abstract-http-listen-options.interface.mjs';
|
|
6
|
-
export * from './can-activate.mjs';
|
|
7
|
-
export * from './http-header.mjs';
|
|
8
|
-
export * from './navios-module.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,2CAA2C,CAAA;AACzD,cAAc,uCAAuC,CAAA;AACrD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,8CAA8C,CAAA;AAC5D,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface that all Navios modules must implement.
|
|
3
|
-
*
|
|
4
|
-
* Modules decorated with @Module() should implement this interface to receive
|
|
5
|
-
* lifecycle hooks.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* @Module({
|
|
10
|
-
* controllers: [UserController],
|
|
11
|
-
* })
|
|
12
|
-
* export class AppModule implements NaviosModule {
|
|
13
|
-
* async onModuleInit() {
|
|
14
|
-
* console.log('AppModule initialized')
|
|
15
|
-
* // Perform initialization logic
|
|
16
|
-
* }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export interface NaviosModule {
|
|
21
|
-
/**
|
|
22
|
-
* Optional lifecycle hook called after the module is initialized.
|
|
23
|
-
*
|
|
24
|
-
* This is called after all modules are loaded and the HTTP server is set up
|
|
25
|
-
* (if an adapter is configured), but before the server starts listening.
|
|
26
|
-
*/
|
|
27
|
-
onModuleInit?: () => Promise<void> | void;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=navios-module.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navios-module.d.mts","sourceRoot":"","sources":["navios-module.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC1C"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility layer for converting legacy decorator signatures to Stage 3 format.
|
|
3
|
-
*
|
|
4
|
-
* This module provides utilities to create mock Stage 3 decorator contexts
|
|
5
|
-
* from legacy decorator arguments, and manages metadata storage using WeakMap.
|
|
6
|
-
*/
|
|
7
|
-
import type { ClassType } from '@navios/di';
|
|
8
|
-
/**
|
|
9
|
-
* Creates a mock ClassDecoratorContext for legacy class decorators.
|
|
10
|
-
*/
|
|
11
|
-
export declare function createClassContext(target: ClassType): ClassDecoratorContext;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a mock ClassMethodDecoratorContext for legacy method decorators.
|
|
14
|
-
*
|
|
15
|
-
* Note: Method decorators need to share metadata with the class context
|
|
16
|
-
* because endpoint metadata is stored at the class level.
|
|
17
|
-
*/
|
|
18
|
-
export declare function createMethodContext(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): ClassMethodDecoratorContext;
|
|
19
|
-
//# sourceMappingURL=context-compat.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-compat.d.mts","sourceRoot":"","sources":["context-compat.mts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAuB3C;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,qBAAqB,CAe3E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,GAAG,EACX,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,UAAU,EAAE,kBAAkB,GAC7B,2BAA2B,CAgC7B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ClassType } from '@navios/di';
|
|
2
|
-
import type { ControllerOptions } from '../../decorators/controller.decorator.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* Legacy-compatible Controller decorator.
|
|
5
|
-
*
|
|
6
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
7
|
-
*
|
|
8
|
-
* @param options - Controller configuration options
|
|
9
|
-
* @returns A class decorator compatible with legacy decorator API
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Controller({ guards: [AuthGuard] })
|
|
14
|
-
* export class UserController {
|
|
15
|
-
* @Endpoint(getUserEndpoint)
|
|
16
|
-
* async getUser() { }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare function Controller(options?: ControllerOptions): (target: ClassType) => ClassType;
|
|
21
|
-
//# sourceMappingURL=controller.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.decorator.d.mts","sourceRoot":"","sources":["controller.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAKlF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,IACvC,QAAQ,SAAS,eAKnC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { BaseEndpointConfig, EndpointFunctionArgs, HttpMethod } from '@navios/builder';
|
|
2
|
-
import type { z, ZodType } from 'zod/v4';
|
|
3
|
-
/**
|
|
4
|
-
* Type helper to constrain a PropertyDescriptor's value to match an endpoint signature.
|
|
5
|
-
* Note: In legacy decorators, type constraints are checked when the decorator is applied,
|
|
6
|
-
* but may not be preserved perfectly when decorators are stacked.
|
|
7
|
-
*/
|
|
8
|
-
type EndpointMethodDescriptor<Url extends string, QuerySchema, RequestSchema, ResponseSchema extends ZodType> = TypedPropertyDescriptor<(params: QuerySchema extends ZodType ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true> : EndpointFunctionArgs<Url, QuerySchema, undefined, true> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema, true> : EndpointFunctionArgs<Url, undefined, undefined, true>) => Promise<z.input<ResponseSchema>>>;
|
|
9
|
-
/**
|
|
10
|
-
* Legacy-compatible Endpoint decorator.
|
|
11
|
-
*
|
|
12
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
13
|
-
* Provides type safety by ensuring method signatures match the endpoint configuration.
|
|
14
|
-
*
|
|
15
|
-
* @param endpoint - The endpoint declaration from @navios/builder
|
|
16
|
-
* @returns A method decorator compatible with legacy decorator API
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* @Controller()
|
|
21
|
-
* export class UserController {
|
|
22
|
-
* @Endpoint(getUserEndpoint)
|
|
23
|
-
* async getUser(request: EndpointParams<typeof getUserEndpoint>): EndpointResult<typeof getUserEndpoint> {
|
|
24
|
-
* return { id: '1', name: 'John' }
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
30
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
31
|
-
}): (target: any, propertyKey: string | symbol, descriptor: EndpointMethodDescriptor<Url, QuerySchema, RequestSchema, ResponseSchema>) => PropertyDescriptor | void;
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=endpoint.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.decorator.d.mts","sourceRoot":"","sources":["endpoint.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACX,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAKxC;;;;GAIG;AACH,KAAK,wBAAwB,CAC3B,GAAG,SAAS,MAAM,EAClB,WAAW,EACX,aAAa,EACb,cAAc,SAAS,OAAO,IAC5B,uBAAuB,CACzB,CACE,MAAM,EAAE,WAAW,SAAS,OAAO,GAC/B,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,CAAC,GAC3D,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,GACzD,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,GACzD,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,KACxD,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CACtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CACtB,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,GAAG,SAAS,MAAM,GAAG,MAAM,EAC3B,WAAW,GAAG,SAAS,EACvB,cAAc,SAAS,OAAO,GAAG,OAAO,EACxC,aAAa,GAAG,OAAO,EACvB,QAAQ,EAAE;IACV,MAAM,EAAE,kBAAkB,CACxB,MAAM,EACN,GAAG,EACH,WAAW,EACX,cAAc,EACd,aAAa,CACd,CAAA;CACF,IAEG,QAAQ,GAAG,EACX,aAAa,MAAM,GAAG,MAAM,EAC5B,YAAY,wBAAwB,CAClC,GAAG,EACH,WAAW,EACX,aAAa,EACb,cAAc,CACf,KACA,kBAAkB,GAAG,IAAI,CAsB7B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { HttpHeader } from '../../interfaces/index.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Legacy-compatible Header decorator.
|
|
4
|
-
*
|
|
5
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
6
|
-
*
|
|
7
|
-
* @param name - The header name (e.g., 'Content-Type', 'Cache-Control')
|
|
8
|
-
* @param value - The header value (string, number, or array of strings)
|
|
9
|
-
* @returns A method decorator compatible with legacy decorator API
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Controller()
|
|
14
|
-
* export class UserController {
|
|
15
|
-
* @Endpoint(getUserEndpoint)
|
|
16
|
-
* @Header('Cache-Control', 'max-age=3600')
|
|
17
|
-
* async getUser() {
|
|
18
|
-
* return { id: '1', name: 'John' }
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function Header(name: HttpHeader, value: string | number | string[]): <T extends object>(target: T, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
24
|
-
//# sourceMappingURL=header.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header.decorator.d.mts","sourceRoot":"","sources":["header.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAK5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,IACvD,CAAC,SAAS,MAAM,EAC/B,QAAQ,CAAC,EACT,aAAa,MAAM,GAAG,MAAM,EAC5B,YAAY,kBAAkB,wBAUjC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy-compatible HttpCode decorator.
|
|
3
|
-
*
|
|
4
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
5
|
-
*
|
|
6
|
-
* @param code - The HTTP status code to return (e.g., 201, 204, 202)
|
|
7
|
-
* @returns A method decorator compatible with legacy decorator API
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @Controller()
|
|
12
|
-
* export class UserController {
|
|
13
|
-
* @Endpoint(createUserEndpoint)
|
|
14
|
-
* @HttpCode(201)
|
|
15
|
-
* async createUser() {
|
|
16
|
-
* return { id: '1', name: 'John' }
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function HttpCode(code: number): <T extends object>(target: T, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
22
|
-
//# sourceMappingURL=http-code.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-code.decorator.d.mts","sourceRoot":"","sources":["http-code.decorator.mts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,IAClB,CAAC,SAAS,MAAM,EAC/B,QAAQ,CAAC,EACT,aAAa,MAAM,GAAG,MAAM,EAC5B,YAAY,kBAAkB,wBAUjC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './module.decorator.mjs';
|
|
2
|
-
export * from './controller.decorator.mjs';
|
|
3
|
-
export * from './endpoint.decorator.mjs';
|
|
4
|
-
export * from './use-guards.decorator.mjs';
|
|
5
|
-
export * from './header.decorator.mjs';
|
|
6
|
-
export * from './http-code.decorator.mjs';
|
|
7
|
-
export * from './multipart.decorator.mjs';
|
|
8
|
-
export * from './stream.decorator.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,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA"}
|