@navios/core 0.7.0 → 0.7.1
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 +22 -0
- package/lib/{index-BFwNx9WQ.d.cts → index-DW9EPAE6.d.mts} +222 -17
- package/lib/index-DW9EPAE6.d.mts.map +1 -0
- package/lib/{index-D657ijFO.d.mts → index-pHp-dIGt.d.cts} +222 -17
- package/lib/index-pHp-dIGt.d.cts.map +1 -0
- package/lib/index.cjs +5 -5
- package/lib/index.d.cts +2 -2
- package/lib/index.d.mts +2 -2
- package/lib/index.mjs +1 -1
- package/lib/legacy-compat/index.cjs +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/{src-DzPY5s6d.mjs → src-DyvCDuKO.mjs} +121 -31
- package/lib/src-DyvCDuKO.mjs.map +1 -0
- package/lib/{src-Cb1aTjl0.cjs → src-QnxR5b7c.cjs} +164 -74
- package/lib/src-QnxR5b7c.cjs.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 +1 -1
- package/lib/{use-guards.decorator-DdvUhB03.cjs → use-guards.decorator-B6q_N0sf.cjs} +17 -17
- package/lib/{use-guards.decorator-DdvUhB03.cjs.map → use-guards.decorator-B6q_N0sf.cjs.map} +1 -1
- package/package.json +12 -12
- package/src/interfaces/abstract-http-adapter.interface.mts +52 -0
- package/src/interfaces/index.mts +1 -0
- package/src/interfaces/plugin.interface.mts +105 -0
- package/src/logger/logger.service.mts +5 -3
- package/src/navios.application.mts +77 -27
- package/src/navios.factory.mts +10 -9
- package/src/services/module-loader.service.mts +102 -1
- 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/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 +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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ClassType } from '@navios/di';
|
|
2
|
-
import { type ModuleOptions } from '../../decorators/module.decorator.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* Legacy-compatible Module decorator.
|
|
5
|
-
*
|
|
6
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
7
|
-
*
|
|
8
|
-
* @param options - Module configuration options
|
|
9
|
-
* @returns A class decorator compatible with legacy decorator API
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* @Module({
|
|
14
|
-
* controllers: [UserController, AuthController],
|
|
15
|
-
* imports: [DatabaseModule],
|
|
16
|
-
* guards: [AuthGuard],
|
|
17
|
-
* })
|
|
18
|
-
* export class AppModule {}
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare function Module(options?: ModuleOptions): (target: ClassType) => ClassType;
|
|
22
|
-
//# sourceMappingURL=module.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.decorator.d.mts","sourceRoot":"","sources":["module.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAGpG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CACpB,OAAO,GAAE,aAIR,IAEgB,QAAQ,SAAS,eAKnC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { BaseEndpointConfig, EndpointFunctionArgs, HttpMethod } from '@navios/builder';
|
|
2
|
-
import type { z, ZodObject, ZodType } from 'zod/v4';
|
|
3
|
-
/**
|
|
4
|
-
* Type helper to constrain a PropertyDescriptor's value to match a multipart 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 MultipartMethodDescriptor<Url extends string, QuerySchema, RequestSchema, ResponseSchema extends ZodType> = TypedPropertyDescriptor<(params: QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>>;
|
|
9
|
-
/**
|
|
10
|
-
* Legacy-compatible Multipart 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 multipart 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 FileController {
|
|
22
|
-
* @Multipart(uploadFileEndpoint)
|
|
23
|
-
* async uploadFile(request: MultipartParams<typeof uploadFileEndpoint>): MultipartResult<typeof uploadFileEndpoint> {
|
|
24
|
-
* const { file } = request.data
|
|
25
|
-
* return { url: 'https://example.com/file.jpg' }
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function Multipart<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
31
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
32
|
-
}): <T extends object>(target: T, propertyKey: string | symbol, descriptor: MultipartMethodDescriptor<Url, QuerySchema, RequestSchema, ResponseSchema>) => PropertyDescriptor | void;
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=multipart.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.decorator.d.mts","sourceRoot":"","sources":["multipart.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACX,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAKnD;;;;GAIG;AACH,KAAK,yBAAyB,CAC5B,GAAG,SAAS,MAAM,EAClB,WAAW,EACX,aAAa,EACb,cAAc,SAAS,OAAO,IAC5B,uBAAuB,CACzB,CACE,MAAM,EAAE,WAAW,SAAS,SAAS,GACjC,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,GACrD,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,GACnD,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,GACnD,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC,KAClD,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CACtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,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,IACkB,CAAC,SAAS,MAAM,EAC/B,QAAQ,CAAC,EACT,aAAa,MAAM,GAAG,MAAM,EAC5B,YAAY,yBAAyB,CACnC,GAAG,EACH,WAAW,EACX,aAAa,EACb,cAAc,CACf,KACA,kBAAkB,GAAG,IAAI,CAe7B"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { BaseStreamConfig, EndpointFunctionArgs, HttpMethod } from '@navios/builder';
|
|
2
|
-
import type { ZodObject, ZodType } from 'zod/v4';
|
|
3
|
-
/**
|
|
4
|
-
* Type helper to constrain a PropertyDescriptor's value to match a stream 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 StreamMethodDescriptor<Url extends string, QuerySchema, RequestSchema> = TypedPropertyDescriptor<(params: QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>, reply: any) => Promise<void>>;
|
|
9
|
-
/**
|
|
10
|
-
* Legacy-compatible Stream 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 stream 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 FileController {
|
|
22
|
-
* @Stream(downloadFileEndpoint)
|
|
23
|
-
* async downloadFile(request: StreamParams<typeof downloadFileEndpoint>, reply: any) {
|
|
24
|
-
* const { fileId } = request.urlParams
|
|
25
|
-
* // Stream file data to reply
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare function Stream<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, RequestSchema = ZodType>(endpoint: {
|
|
31
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
32
|
-
}): <T extends object>(target: T, propertyKey: string | symbol, descriptor: StreamMethodDescriptor<Url, QuerySchema, RequestSchema>) => StreamMethodDescriptor<Url, QuerySchema, RequestSchema>;
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=stream.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.decorator.d.mts","sourceRoot":"","sources":["stream.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACX,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAKhD;;;;GAIG;AACH,KAAK,sBAAsB,CACzB,GAAG,SAAS,MAAM,EAClB,WAAW,EACX,aAAa,IACX,uBAAuB,CACzB,CACE,MAAM,EAAE,WAAW,SAAS,SAAS,GACjC,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,GACrD,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,CAAC,GACnD,aAAa,SAAS,OAAO,GAC3B,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,GACnD,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC,EACrD,KAAK,EAAE,GAAG,KACP,OAAO,CAAC,IAAI,CAAC,CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CACpB,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,GAAG,SAAS,MAAM,GAAG,MAAM,EAC3B,WAAW,GAAG,SAAS,EACvB,aAAa,GAAG,OAAO,EACvB,QAAQ,EAAE;IACV,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAA;CAClE,IACkB,CAAC,SAAS,MAAM,EAC/B,QAAQ,CAAC,EACT,aAAa,MAAM,GAAG,MAAM,EAC5B,YAAY,sBAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,6DAWtE"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance, InjectionToken } from '@navios/di';
|
|
2
|
-
import type { CanActivate } from '../../interfaces/index.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* Legacy-compatible UseGuards decorator.
|
|
5
|
-
*
|
|
6
|
-
* Works with TypeScript experimental decorators (legacy API).
|
|
7
|
-
* Can be applied to classes or methods.
|
|
8
|
-
*
|
|
9
|
-
* @param guards - Guard classes or injection tokens to apply
|
|
10
|
-
* @returns A class or method decorator compatible with legacy decorator API
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* // Apply to a controller
|
|
15
|
-
* @Controller()
|
|
16
|
-
* @UseGuards(AuthGuard, RoleGuard)
|
|
17
|
-
* export class UserController { }
|
|
18
|
-
*
|
|
19
|
-
* // Apply to a specific endpoint
|
|
20
|
-
* @Controller()
|
|
21
|
-
* export class UserController {
|
|
22
|
-
* @Endpoint(getUserEndpoint)
|
|
23
|
-
* @UseGuards(AuthGuard)
|
|
24
|
-
* async getUser() { }
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare function UseGuards(...guards: (ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>)[]): any;
|
|
29
|
-
//# sourceMappingURL=use-guards.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-guards.decorator.d.mts","sourceRoot":"","sources":["use-guards.decorator.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EACrB,cAAc,EACf,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAK7D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CACvB,GAAG,MAAM,EAAE,CACP,qBAAqB,CAAC,WAAW,CAAC,GAClC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CACzC,EAAE,GAsCqB,GAAG,CAC5B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy-compatible decorators for projects that cannot use Stage 3 decorators.
|
|
3
|
-
*
|
|
4
|
-
* These decorators use the TypeScript experimental decorator API and convert
|
|
5
|
-
* the arguments to Stage 3 format internally.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { Module, Controller, Endpoint } from '@navios/core/legacy-compat'
|
|
10
|
-
*
|
|
11
|
-
* @Module({
|
|
12
|
-
* controllers: [UserController],
|
|
13
|
-
* })
|
|
14
|
-
* export class AppModule {}
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export type { ModuleOptions, ControllerOptions, EndpointParams, EndpointResult, MultipartParams, MultipartResult, StreamParams, } from '../decorators/index.mjs';
|
|
18
|
-
export { Module, Controller, Endpoint, UseGuards, Header, HttpCode, Multipart, Stream, } from './decorators/index.mjs';
|
|
19
|
-
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,EACT,MAAM,GACP,MAAM,wBAAwB,CAAA"}
|