@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,42 +0,0 @@
|
|
|
1
|
-
import type { ClassType } from '@navios/di';
|
|
2
|
-
/**
|
|
3
|
-
* Options for configuring a Navios module.
|
|
4
|
-
*/
|
|
5
|
-
export interface ModuleOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Controllers to register in this module.
|
|
8
|
-
* Controllers handle HTTP requests and define endpoints.
|
|
9
|
-
*/
|
|
10
|
-
controllers?: ClassType[] | Set<ClassType>;
|
|
11
|
-
/**
|
|
12
|
-
* Other modules to import into this module.
|
|
13
|
-
* Imported modules' controllers and services become available.
|
|
14
|
-
*/
|
|
15
|
-
imports?: ClassType[] | Set<ClassType>;
|
|
16
|
-
/**
|
|
17
|
-
* Guards to apply to all controllers in this module.
|
|
18
|
-
* Guards are executed in reverse order (last guard first).
|
|
19
|
-
*/
|
|
20
|
-
guards?: ClassType[] | Set<ClassType>;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Decorator that marks a class as a Navios module.
|
|
24
|
-
*
|
|
25
|
-
* Modules are the basic building blocks of a Navios application.
|
|
26
|
-
* They organize controllers, services, and other modules into logical units.
|
|
27
|
-
*
|
|
28
|
-
* @param options - Module configuration options
|
|
29
|
-
* @returns A class decorator
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* @Module({
|
|
34
|
-
* controllers: [UserController, AuthController],
|
|
35
|
-
* imports: [DatabaseModule],
|
|
36
|
-
* guards: [AuthGuard],
|
|
37
|
-
* })
|
|
38
|
-
* export class AppModule {}
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function Module({ controllers, imports, guards }?: ModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
|
|
42
|
-
//# 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;AAM3C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;CACtC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,MAAM,CACpB,EAAE,WAAgB,EAAE,OAAY,EAAE,MAAW,EAAE,GAAE,aAIhD,IAEO,QAAQ,SAAS,EAAE,SAAS,qBAAqB,eAsB1D"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { BaseEndpointConfig, EndpointFunctionArgs, HttpMethod, Util_FlatObject } from '@navios/builder';
|
|
2
|
-
import type { z, ZodObject, ZodType } from 'zod/v4';
|
|
3
|
-
import { ZodDiscriminatedUnion } from 'zod/v4';
|
|
4
|
-
/**
|
|
5
|
-
* Extracts the typed parameters for a multipart endpoint handler function.
|
|
6
|
-
*
|
|
7
|
-
* Similar to `EndpointParams`, but specifically for multipart/form-data endpoints.
|
|
8
|
-
*
|
|
9
|
-
* @typeParam EndpointDeclaration - The endpoint declaration from @navios/builder
|
|
10
|
-
*/
|
|
11
|
-
export type MultipartParams<EndpointDeclaration extends {
|
|
12
|
-
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
13
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends ZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
14
|
-
/**
|
|
15
|
-
* Extracts the typed return value for a multipart endpoint handler function.
|
|
16
|
-
*
|
|
17
|
-
* @typeParam EndpointDeclaration - The endpoint declaration from @navios/builder
|
|
18
|
-
*/
|
|
19
|
-
export type MultipartResult<EndpointDeclaration extends {
|
|
20
|
-
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
21
|
-
}> = EndpointDeclaration['config']['responseSchema'] extends ZodDiscriminatedUnion<infer Options> ? Promise<z.input<Options[number]>> : Promise<z.input<EndpointDeclaration['config']['responseSchema']>>;
|
|
22
|
-
/**
|
|
23
|
-
* Decorator that marks a method as a multipart/form-data endpoint.
|
|
24
|
-
*
|
|
25
|
-
* Use this decorator for endpoints that handle file uploads or form data.
|
|
26
|
-
* The endpoint must be defined using @navios/builder's `declareMultipart` method.
|
|
27
|
-
*
|
|
28
|
-
* @param endpoint - The multipart endpoint declaration from @navios/builder
|
|
29
|
-
* @returns A method decorator
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* const uploadFileEndpoint = api.declareMultipart({
|
|
34
|
-
* method: 'post',
|
|
35
|
-
* url: '/upload',
|
|
36
|
-
* requestSchema: z.object({ file: z.instanceof(File) }),
|
|
37
|
-
* responseSchema: z.object({ url: z.string() }),
|
|
38
|
-
* })
|
|
39
|
-
*
|
|
40
|
-
* @Controller()
|
|
41
|
-
* export class FileController {
|
|
42
|
-
* @Multipart(uploadFileEndpoint)
|
|
43
|
-
* async uploadFile(request: MultipartParams<typeof uploadFileEndpoint>) {
|
|
44
|
-
* const { file } = request.data
|
|
45
|
-
* // Handle file upload
|
|
46
|
-
* return { url: 'https://example.com/file.jpg' }
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare function Multipart<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
52
|
-
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
53
|
-
}): (target: (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>>, context: ClassMethodDecoratorContext) => (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>>;
|
|
54
|
-
//# sourceMappingURL=multipart.decorator.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.decorator.d.mts","sourceRoot":"","sources":["multipart.decorator.mts"],"names":[],"mappings":"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"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { BaseStreamConfig, EndpointFunctionArgs, HttpMethod, Util_FlatObject } from '@navios/builder';
|
|
2
|
-
import type { ZodObject, ZodType } from 'zod/v4';
|
|
3
|
-
/**
|
|
4
|
-
* Extracts the typed parameters for a stream endpoint handler function.
|
|
5
|
-
*
|
|
6
|
-
* Similar to `EndpointParams`, but specifically for streaming endpoints.
|
|
7
|
-
*
|
|
8
|
-
* @typeParam EndpointDeclaration - The stream endpoint declaration from @navios/builder
|
|
9
|
-
*/
|
|
10
|
-
export type StreamParams<EndpointDeclaration extends {
|
|
11
|
-
config: BaseStreamConfig<any, any, any, any>;
|
|
12
|
-
}, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends ZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
|
|
13
|
-
/**
|
|
14
|
-
* Decorator that marks a method as a streaming endpoint.
|
|
15
|
-
*
|
|
16
|
-
* Use this decorator for endpoints that stream data (e.g., file downloads, SSE).
|
|
17
|
-
* The endpoint must be defined using @navios/builder's `declareStream` method.
|
|
18
|
-
*
|
|
19
|
-
* @param endpoint - The stream endpoint declaration from @navios/builder
|
|
20
|
-
* @returns A method decorator
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* const downloadFileEndpoint = api.declareStream({
|
|
25
|
-
* method: 'get',
|
|
26
|
-
* url: '/files/$fileId',
|
|
27
|
-
* })
|
|
28
|
-
*
|
|
29
|
-
* @Controller()
|
|
30
|
-
* export class FileController {
|
|
31
|
-
* @Stream(downloadFileEndpoint)
|
|
32
|
-
* async downloadFile(request: StreamParams<typeof downloadFileEndpoint>, reply: any) {
|
|
33
|
-
* const { fileId } = request.urlParams
|
|
34
|
-
* // Stream file data to reply
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function Stream<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, RequestSchema = ZodType>(endpoint: {
|
|
40
|
-
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
41
|
-
}): (target: (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>, context: ClassMethodDecoratorContext) => (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>;
|
|
42
|
-
//# 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,EACV,eAAe,EAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAKhD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CACtB,mBAAmB,SAAS;IAC1B,MAAM,EAAE,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CAC7C,EACD,GAAG,SAAS,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EACzD,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,IACxD,WAAW,SAAS,SAAS,GAC7B,mBAAmB,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,SAAS,OAAO,GAC5D,eAAe,CACb,oBAAoB,CAClB,GAAG,EACH,WAAW,EACX,mBAAmB,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,EAC9C,IAAI,CACL,CACF,GACD,eAAe,CAAC,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,GAC1E,mBAAmB,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,SAAS,OAAO,GAC5D,eAAe,CACb,oBAAoB,CAClB,GAAG,EACH,SAAS,EACT,mBAAmB,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,EAC9C,IAAI,CACL,CACF,GACD,eAAe,CAAC,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;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,IAEG,QAAQ,CACN,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,EAClB,SAAS,2BAA2B,cAT1B,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,SAC9C,GAAG,KACP,OAAO,CAAC,IAAI,CAAC,CAiCrB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ClassTypeWithInstance, InjectionToken } from '@navios/di';
|
|
2
|
-
import type { CanActivate } from '../interfaces/index.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* Decorator that applies guards to a controller or endpoint.
|
|
5
|
-
*
|
|
6
|
-
* Guards are used for authentication, authorization, and request validation.
|
|
7
|
-
* They implement the `CanActivate` interface and are executed before the endpoint handler.
|
|
8
|
-
* Guards can be applied at the module, controller, or endpoint level.
|
|
9
|
-
*
|
|
10
|
-
* @param guards - Guard classes or injection tokens to apply
|
|
11
|
-
* @returns A class or method decorator
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* // Apply to a controller
|
|
16
|
-
* @Controller()
|
|
17
|
-
* @UseGuards(AuthGuard, RoleGuard)
|
|
18
|
-
* export class UserController {
|
|
19
|
-
* @Endpoint(getUserEndpoint)
|
|
20
|
-
* async getUser() { }
|
|
21
|
-
* }
|
|
22
|
-
*
|
|
23
|
-
* // Apply to a specific endpoint
|
|
24
|
-
* @Controller()
|
|
25
|
-
* export class UserController {
|
|
26
|
-
* @Endpoint(getUserEndpoint)
|
|
27
|
-
* @UseGuards(AuthGuard)
|
|
28
|
-
* async getUser() { }
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function UseGuards(...guards: (ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>)[]): <T extends Function>(target: T, context: ClassMethodDecoratorContext | ClassDecoratorContext) => T;
|
|
33
|
-
//# 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,yBAAyB,CAAA;AAO1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,CACvB,GAAG,MAAM,EAAE,CACP,qBAAqB,CAAC,WAAW,CAAC,GAClC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CACzC,EAAE,IAEc,CAAC,SAAS,QAAQ,EACjC,QAAQ,CAAC,EACT,SAAS,2BAA2B,GAAG,qBAAqB,KAC3D,CAAC,CAqBL"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 400 Bad Request HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when the client's request is malformed or invalid.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* @Endpoint(createUserEndpoint)
|
|
10
|
-
* async createUser(request: EndpointParams<typeof createUserEndpoint>) {
|
|
11
|
-
* if (!request.data.email) {
|
|
12
|
-
* throw new BadRequestException('Email is required')
|
|
13
|
-
* }
|
|
14
|
-
* // ...
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare class BadRequestException extends HttpException {
|
|
19
|
-
/**
|
|
20
|
-
* Creates a new BadRequestException.
|
|
21
|
-
*
|
|
22
|
-
* @param message - Error message or response object
|
|
23
|
-
*/
|
|
24
|
-
constructor(message: string | object);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=bad-request.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bad-request.exception.d.mts","sourceRoot":"","sources":["bad-request.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;IACpD;;;;OAIG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM;CAGrC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 409 Conflict HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when the request conflicts with the current state of the resource
|
|
6
|
-
* (e.g., trying to create a resource that already exists).
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* @Endpoint(createUserEndpoint)
|
|
11
|
-
* async createUser(request: EndpointParams<typeof createUserEndpoint>) {
|
|
12
|
-
* const existing = await this.userService.findByEmail(request.data.email)
|
|
13
|
-
* if (existing) {
|
|
14
|
-
* throw new ConflictException('User with this email already exists')
|
|
15
|
-
* }
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class ConflictException extends HttpException {
|
|
21
|
-
/**
|
|
22
|
-
* Creates a new ConflictException.
|
|
23
|
-
*
|
|
24
|
-
* @param message - Error message or response object
|
|
25
|
-
* @param error - Optional underlying error for logging
|
|
26
|
-
*/
|
|
27
|
-
constructor(message: string | object, error?: Error);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=conflict.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conflict.exception.d.mts","sourceRoot":"","sources":["conflict.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAClD;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGpD"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 403 Forbidden HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when the client is authenticated but does not have
|
|
6
|
-
* permission to access the requested resource.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* @Endpoint(deleteUserEndpoint)
|
|
11
|
-
* @UseGuards(AuthGuard, RoleGuard)
|
|
12
|
-
* async deleteUser(request: EndpointParams<typeof deleteUserEndpoint>) {
|
|
13
|
-
* if (!this.userService.hasPermission(request.user, 'delete')) {
|
|
14
|
-
* throw new ForbiddenException('Insufficient permissions')
|
|
15
|
-
* }
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class ForbiddenException extends HttpException {
|
|
21
|
-
/**
|
|
22
|
-
* Creates a new ForbiddenException.
|
|
23
|
-
*
|
|
24
|
-
* @param message - Error message
|
|
25
|
-
*/
|
|
26
|
-
constructor(message: string);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=forbidden.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"forbidden.exception.d.mts","sourceRoot":"","sources":["forbidden.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACnD;;;;OAIG;gBACS,OAAO,EAAE,MAAM;CAG5B"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base exception class for all HTTP exceptions in Navios.
|
|
3
|
-
*
|
|
4
|
-
* All HTTP exception classes extend this base class. When thrown from an endpoint handler,
|
|
5
|
-
* Navios will automatically convert it to an appropriate HTTP response with the specified
|
|
6
|
-
* status code and response body.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* @Endpoint(getUserEndpoint)
|
|
11
|
-
* async getUser(request: EndpointParams<typeof getUserEndpoint>) {
|
|
12
|
-
* const user = await this.userService.findById(request.urlParams.userId)
|
|
13
|
-
* if (!user) {
|
|
14
|
-
* throw new HttpException(404, 'User not found')
|
|
15
|
-
* }
|
|
16
|
-
* return user
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class HttpException {
|
|
21
|
-
readonly statusCode: number;
|
|
22
|
-
readonly response: string | object;
|
|
23
|
-
readonly error?: Error | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new HttpException instance.
|
|
26
|
-
*
|
|
27
|
-
* @param statusCode - HTTP status code (e.g., 400, 404, 500)
|
|
28
|
-
* @param response - Response body (string or object)
|
|
29
|
-
* @param error - Optional underlying error for logging/debugging
|
|
30
|
-
*/
|
|
31
|
-
constructor(statusCode: number, response: string | object, error?: Error | undefined);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=http.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http.exception.d.mts","sourceRoot":"","sources":["http.exception.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,aAAa;aASN,UAAU,EAAE,MAAM;aAClB,QAAQ,EAAE,MAAM,GAAG,MAAM;aACzB,KAAK,CAAC,EAAE,KAAK;IAV/B;;;;;;OAMG;gBAEe,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,KAAK,CAAC,EAAE,KAAK,YAAA;CAEhC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './http.exception.mjs';
|
|
2
|
-
export * from './bad-request.exception.mjs';
|
|
3
|
-
export * from './forbidden.exception.mjs';
|
|
4
|
-
export * from './internal-server-error.exception.mjs';
|
|
5
|
-
export * from './not-found.exception.mjs';
|
|
6
|
-
export * from './unauthorized.exception.mjs';
|
|
7
|
-
export * from './conflict.exception.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,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,uCAAuC,CAAA;AACrD,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { HttpException } from './http.exception.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Exception that represents a 500 Internal Server Error HTTP error.
|
|
4
|
-
*
|
|
5
|
-
* Use this exception when an unexpected error occurs on the server.
|
|
6
|
-
* Generally, you should let unhandled errors bubble up rather than catching
|
|
7
|
-
* and rethrowing as InternalServerErrorException, as Navios will handle them appropriately.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @Endpoint(processPaymentEndpoint)
|
|
12
|
-
* async processPayment(request: EndpointParams<typeof processPaymentEndpoint>) {
|
|
13
|
-
* try {
|
|
14
|
-
* return await this.paymentService.process(request.data)
|
|
15
|
-
* } catch (error) {
|
|
16
|
-
* this.logger.error('Payment processing failed', error)
|
|
17
|
-
* throw new InternalServerErrorException('Payment processing failed', error)
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare class InternalServerErrorException extends HttpException {
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new InternalServerErrorException.
|
|
25
|
-
*
|
|
26
|
-
* @param message - Error message or response object
|
|
27
|
-
* @param error - Optional underlying error for logging
|
|
28
|
-
*/
|
|
29
|
-
constructor(message: string | object, error?: Error);
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=internal-server-error.exception.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-server-error.exception.d.mts","sourceRoot":"","sources":["internal-server-error.exception.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,4BAA6B,SAAQ,aAAa;IAC7D;;;;;OAKG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGpD"}
|
|
@@ -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
|