@navios/core 0.4.0 → 0.5.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/README.md +95 -2
- package/docs/README.md +310 -3
- package/docs/adapters.md +308 -0
- package/docs/application-setup.md +524 -0
- package/docs/attributes.md +689 -0
- package/docs/controllers.md +373 -0
- package/docs/endpoints.md +444 -0
- package/docs/exceptions.md +316 -0
- package/docs/guards.md +550 -0
- package/docs/modules.md +377 -0
- package/docs/quick-start.md +295 -0
- package/docs/services.md +427 -0
- package/docs/testing.md +704 -0
- package/lib/_tsup-dts-rollup.d.mts +310 -239
- package/lib/_tsup-dts-rollup.d.ts +310 -239
- package/lib/index.d.mts +51 -28
- package/lib/index.d.ts +51 -28
- package/lib/index.js +633 -1072
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +631 -1064
- package/lib/index.mjs.map +1 -1
- package/package.json +5 -9
- package/project.json +9 -1
- package/src/__tests__/config.service.spec.mts +11 -9
- package/src/__tests__/controller.spec.mts +0 -1
- package/src/config/config.service.mts +2 -2
- package/src/decorators/controller.decorator.mts +1 -1
- package/src/decorators/endpoint.decorator.mts +2 -2
- package/src/decorators/header.decorator.mts +1 -1
- package/src/decorators/multipart.decorator.mts +1 -2
- package/src/decorators/stream.decorator.mts +2 -3
- package/src/factories/endpoint-adapter.factory.mts +21 -0
- package/src/factories/http-adapter.factory.mts +20 -0
- package/src/factories/index.mts +6 -0
- package/src/factories/multipart-adapter.factory.mts +21 -0
- package/src/factories/reply.factory.mts +21 -0
- package/src/factories/request.factory.mts +21 -0
- package/src/factories/stream-adapter.factory.mts +20 -0
- package/src/index.mts +1 -1
- package/src/interfaces/abstract-execution-context.inteface.mts +13 -0
- package/src/interfaces/abstract-http-adapter.interface.mts +20 -0
- package/src/interfaces/abstract-http-cors-options.interface.mts +59 -0
- package/src/interfaces/abstract-http-handler-adapter.interface.mts +13 -0
- package/src/interfaces/abstract-http-listen-options.interface.mts +4 -0
- package/src/interfaces/can-activate.mts +4 -2
- package/src/interfaces/http-header.mts +18 -0
- package/src/interfaces/index.mts +6 -0
- package/src/logger/console-logger.service.mts +28 -44
- package/src/logger/index.mts +1 -2
- package/src/logger/logger.service.mts +9 -128
- package/src/logger/logger.tokens.mts +21 -0
- package/src/metadata/handler.metadata.mts +7 -5
- package/src/navios.application.mts +65 -172
- package/src/navios.environment.mts +30 -0
- package/src/navios.factory.mts +53 -12
- package/src/services/guard-runner.service.mts +19 -9
- package/src/services/index.mts +0 -2
- package/src/services/module-loader.service.mts +4 -3
- package/src/tokens/endpoint-adapter.token.mts +8 -0
- package/src/tokens/execution-context.token.mts +2 -2
- package/src/tokens/http-adapter.token.mts +8 -0
- package/src/tokens/index.mts +4 -1
- package/src/tokens/multipart-adapter.token.mts +8 -0
- package/src/tokens/reply.token.mts +1 -5
- package/src/tokens/request.token.mts +1 -7
- package/src/tokens/stream-adapter.token.mts +8 -0
- package/docs/recipes/prisma.md +0 -60
- package/e2e/endpoints/get.spec.mts +0 -97
- package/e2e/endpoints/post.spec.mts +0 -113
- package/examples/simple-test/api/index.mts +0 -64
- package/examples/simple-test/config/config.service.mts +0 -14
- package/examples/simple-test/config/configuration.mts +0 -7
- package/examples/simple-test/index.mts +0 -16
- package/examples/simple-test/src/acl/acl-modern.guard.mts +0 -15
- package/examples/simple-test/src/acl/acl.guard.mts +0 -14
- package/examples/simple-test/src/acl/app.guard.mts +0 -27
- package/examples/simple-test/src/acl/one-more.guard.mts +0 -15
- package/examples/simple-test/src/acl/public.attribute.mts +0 -21
- package/examples/simple-test/src/app.module.mts +0 -9
- package/examples/simple-test/src/user/user.controller.mts +0 -72
- package/examples/simple-test/src/user/user.module.mts +0 -14
- package/examples/simple-test/src/user/user.service.mts +0 -14
- package/src/adapters/endpoint-adapter.service.mts +0 -72
- package/src/adapters/handler-adapter.interface.mts +0 -21
- package/src/adapters/index.mts +0 -4
- package/src/adapters/multipart-adapter.service.mts +0 -135
- package/src/adapters/stream-adapter.service.mts +0 -91
- package/src/logger/logger.factory.mts +0 -36
- package/src/logger/pino-wrapper.mts +0 -64
- package/src/services/controller-adapter.service.mts +0 -124
- package/src/services/execution-context.mts +0 -54
- package/src/tokens/application.token.mts +0 -9
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { AnyInjectableType } from '@navios/di';
|
|
2
|
+
import { asyncInject } from '@navios/di';
|
|
1
3
|
import type { BaseEndpointConfig } from '@navios/builder';
|
|
2
4
|
import { BaseInjectionTokenSchemaType } from '@navios/di';
|
|
5
|
+
import { BaseInstanceHolderManager } from '@navios/di';
|
|
3
6
|
import type { BaseStreamConfig } from '@navios/builder';
|
|
4
7
|
import { BoundInjectionToken } from '@navios/di';
|
|
5
8
|
import { ChannelEmitter } from '@navios/di';
|
|
@@ -9,7 +12,13 @@ import { ClassTypeWithInstance } from '@navios/di';
|
|
|
9
12
|
import { ClassTypeWithInstanceAndArgument } from '@navios/di';
|
|
10
13
|
import { ClassTypeWithInstanceAndOptionalArgument } from '@navios/di';
|
|
11
14
|
import { ClassTypeWithOptionalArgument } from '@navios/di';
|
|
12
|
-
import {
|
|
15
|
+
import { ClassTypeWithoutArguments } from '@navios/di';
|
|
16
|
+
import { Container } from '@navios/di';
|
|
17
|
+
import { createRequestContextHolder } from '@navios/di';
|
|
18
|
+
import { defaultInjectors } from '@navios/di';
|
|
19
|
+
import { DefaultRequestContextHolder } from '@navios/di';
|
|
20
|
+
import { DIError } from '@navios/di';
|
|
21
|
+
import { DIErrorCode } from '@navios/di';
|
|
13
22
|
import type { EndpointFunctionArgs } from '@navios/builder';
|
|
14
23
|
import { ErrorsEnum } from '@navios/di';
|
|
15
24
|
import { EventEmitter } from '@navios/di';
|
|
@@ -17,55 +26,46 @@ import { EventEmitterInterface } from '@navios/di';
|
|
|
17
26
|
import { EventsArgs } from '@navios/di';
|
|
18
27
|
import { EventsConfig } from '@navios/di';
|
|
19
28
|
import { EventsNames } from '@navios/di';
|
|
29
|
+
import { Factorable } from '@navios/di';
|
|
30
|
+
import { FactorableWithArgs } from '@navios/di';
|
|
20
31
|
import { Factory } from '@navios/di';
|
|
21
32
|
import { FactoryContext } from '@navios/di';
|
|
22
33
|
import { FactoryInjectionToken } from '@navios/di';
|
|
23
34
|
import { FactoryNotFound } from '@navios/di';
|
|
35
|
+
import { FactoryOptions } from '@navios/di';
|
|
24
36
|
import { FactoryRecord } from '@navios/di';
|
|
25
37
|
import { FactoryTokenNotResolved } from '@navios/di';
|
|
26
|
-
import { FactoryWithArgs } from '@navios/di';
|
|
27
|
-
import { FastifyBaseLogger } from 'fastify';
|
|
28
|
-
import type { FastifyCorsOptions } from '@fastify/cors';
|
|
29
|
-
import type { FastifyInstance } from 'fastify';
|
|
30
|
-
import type { FastifyListenOptions } from 'fastify';
|
|
31
|
-
import type { FastifyMultipartOptions } from '@fastify/multipart';
|
|
32
|
-
import type { FastifyReply } from 'fastify';
|
|
33
|
-
import type { FastifyRequest } from 'fastify';
|
|
34
|
-
import { FastifySchema } from 'fastify';
|
|
35
|
-
import type { FastifyServerOptions } from 'fastify';
|
|
36
|
-
import { FastifyTypeProviderDefault } from 'fastify';
|
|
37
|
-
import { getGlobalServiceLocator } from '@navios/di';
|
|
38
38
|
import { getInjectableToken } from '@navios/di';
|
|
39
39
|
import { getInjectors } from '@navios/di';
|
|
40
40
|
import { globalRegistry } from '@navios/di';
|
|
41
|
-
import type { HttpHeader } from 'fastify/types/utils.js';
|
|
42
41
|
import type { HttpMethod } from '@navios/builder';
|
|
43
|
-
import { IncomingMessage } from 'http';
|
|
44
42
|
import { inject } from '@navios/di';
|
|
45
43
|
import { Injectable } from '@navios/di';
|
|
46
44
|
import { InjectableOptions } from '@navios/di';
|
|
47
45
|
import { InjectableScope } from '@navios/di';
|
|
48
46
|
import { InjectableTokenMeta } from '@navios/di';
|
|
49
47
|
import { InjectableType } from '@navios/di';
|
|
50
|
-
import { InjectionFactory } from '@navios/di';
|
|
51
48
|
import { InjectionToken } from '@navios/di';
|
|
52
49
|
import { InjectionTokenSchemaType } from '@navios/di';
|
|
50
|
+
import { InjectionTokenType } from '@navios/di';
|
|
53
51
|
import { Injectors } from '@navios/di';
|
|
54
|
-
import {
|
|
52
|
+
import { InjectRequest } from '@navios/di';
|
|
53
|
+
import { InjectState } from '@navios/di';
|
|
55
54
|
import type { InspectOptions } from 'util';
|
|
56
55
|
import { InstanceDestroying } from '@navios/di';
|
|
57
|
-
import { InstanceExpired } from '@navios/di';
|
|
58
56
|
import { InstanceNotFound } from '@navios/di';
|
|
59
|
-
import {
|
|
57
|
+
import { IsUnion } from '@navios/di';
|
|
58
|
+
import { Join } from '@navios/di';
|
|
59
|
+
import { OnServiceDestroy } from '@navios/di';
|
|
60
|
+
import { OnServiceInit } from '@navios/di';
|
|
61
|
+
import { optional } from '@navios/di';
|
|
60
62
|
import { OptionalInjectionTokenSchemaType } from '@navios/di';
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
63
|
+
import type { OutgoingHttpHeaders } from 'http';
|
|
64
|
+
import { PopUnion } from '@navios/di';
|
|
65
|
+
import { provideFactoryContext } from '@navios/di';
|
|
64
66
|
import { Registry } from '@navios/di';
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import { RouteGenericInterface } from 'fastify';
|
|
68
|
-
import { ServerResponse } from 'http';
|
|
67
|
+
import { RequestContextHolder } from '@navios/di';
|
|
68
|
+
import { ServiceInstantiator } from '@navios/di';
|
|
69
69
|
import { ServiceLocator } from '@navios/di';
|
|
70
70
|
import { ServiceLocatorEventBus } from '@navios/di';
|
|
71
71
|
import { ServiceLocatorInstanceDestroyListener } from '@navios/di';
|
|
@@ -74,10 +74,12 @@ import { ServiceLocatorInstanceHolder } from '@navios/di';
|
|
|
74
74
|
import { ServiceLocatorInstanceHolderCreated } from '@navios/di';
|
|
75
75
|
import { ServiceLocatorInstanceHolderCreating } from '@navios/di';
|
|
76
76
|
import { ServiceLocatorInstanceHolderDestroying } from '@navios/di';
|
|
77
|
-
import {
|
|
77
|
+
import { ServiceLocatorInstanceHolderError } from '@navios/di';
|
|
78
78
|
import { ServiceLocatorInstanceHolderStatus } from '@navios/di';
|
|
79
79
|
import { ServiceLocatorManager } from '@navios/di';
|
|
80
|
-
import {
|
|
80
|
+
import { UnionToArray } from '@navios/di';
|
|
81
|
+
import { UnionToIntersection } from '@navios/di';
|
|
82
|
+
import { UnionToOvlds } from '@navios/di';
|
|
81
83
|
import { UnknownError } from '@navios/di';
|
|
82
84
|
import type { Util_FlatObject } from '@navios/builder';
|
|
83
85
|
import { wrapSyncInit } from '@navios/di';
|
|
@@ -86,16 +88,115 @@ import { ZodDiscriminatedUnion } from 'zod/v4';
|
|
|
86
88
|
import type { ZodObject } from 'zod/v4';
|
|
87
89
|
import type { ZodType } from 'zod/v4';
|
|
88
90
|
|
|
91
|
+
declare interface AbstractExecutionContext {
|
|
92
|
+
getModule(): ModuleMetadata;
|
|
93
|
+
getController(): ControllerMetadata;
|
|
94
|
+
getHandler(): HandlerMetadata;
|
|
95
|
+
getRequest(): any;
|
|
96
|
+
getReply(): any;
|
|
97
|
+
}
|
|
98
|
+
export { AbstractExecutionContext }
|
|
99
|
+
export { AbstractExecutionContext as AbstractExecutionContext_alias_1 }
|
|
100
|
+
export { AbstractExecutionContext as AbstractExecutionContext_alias_2 }
|
|
101
|
+
|
|
102
|
+
declare interface AbstractHttpAdapterInterface<ServerInstance, CorsOptions = AbstractHttpCorsOptions, Options = {}, MultipartOptions = {}> {
|
|
103
|
+
setupHttpServer(options: Options): Promise<void>;
|
|
104
|
+
onModulesInit(modules: Map<string, ModuleMetadata>): Promise<void>;
|
|
105
|
+
ready(): Promise<void>;
|
|
106
|
+
getServer(): ServerInstance;
|
|
107
|
+
setGlobalPrefix(prefix: string): void;
|
|
108
|
+
enableCors(options: CorsOptions): void;
|
|
109
|
+
enableMultipart(options: MultipartOptions): void;
|
|
110
|
+
listen(options: AbstractHttpListenOptions): Promise<string>;
|
|
111
|
+
dispose(): Promise<void>;
|
|
112
|
+
}
|
|
113
|
+
export { AbstractHttpAdapterInterface }
|
|
114
|
+
export { AbstractHttpAdapterInterface as AbstractHttpAdapterInterface_alias_1 }
|
|
115
|
+
export { AbstractHttpAdapterInterface as AbstractHttpAdapterInterface_alias_2 }
|
|
116
|
+
|
|
117
|
+
declare interface AbstractHttpCorsOptions {
|
|
118
|
+
/**
|
|
119
|
+
* Configures the Access-Control-Allow-Origin CORS header.
|
|
120
|
+
*/
|
|
121
|
+
origin?: ValueOrArray<OriginType>;
|
|
122
|
+
/**
|
|
123
|
+
* Configures the Access-Control-Allow-Credentials CORS header.
|
|
124
|
+
* Set to true to pass the header, otherwise it is omitted.
|
|
125
|
+
*/
|
|
126
|
+
credentials?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Configures the Access-Control-Expose-Headers CORS header.
|
|
129
|
+
* Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range')
|
|
130
|
+
* or an array (ex: ['Content-Range', 'X-Content-Range']).
|
|
131
|
+
* If not specified, no custom headers are exposed.
|
|
132
|
+
*/
|
|
133
|
+
exposedHeaders?: string | string[];
|
|
134
|
+
/**
|
|
135
|
+
* Configures the Access-Control-Allow-Headers CORS header.
|
|
136
|
+
* Expects a comma-delimited string (ex: 'Content-Type,Authorization')
|
|
137
|
+
* or an array (ex: ['Content-Type', 'Authorization']). If not
|
|
138
|
+
* specified, defaults to reflecting the headers specified in the
|
|
139
|
+
* request's Access-Control-Request-Headers header.
|
|
140
|
+
*/
|
|
141
|
+
allowedHeaders?: string | string[];
|
|
142
|
+
/**
|
|
143
|
+
* Configures the Access-Control-Allow-Methods CORS header.
|
|
144
|
+
* Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: ['GET', 'PUT', 'POST']).
|
|
145
|
+
*/
|
|
146
|
+
methods?: string | string[];
|
|
147
|
+
/**
|
|
148
|
+
* Configures the Access-Control-Max-Age CORS header.
|
|
149
|
+
* Set to an integer to pass the header, otherwise it is omitted.
|
|
150
|
+
*/
|
|
151
|
+
maxAge?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Configures the Cache-Control header for CORS preflight responses.
|
|
154
|
+
* Set to an integer to pass the header as `Cache-Control: max-age=${cacheControl}`,
|
|
155
|
+
* or set to a string to pass the header as `Cache-Control: ${cacheControl}` (fully define
|
|
156
|
+
* the header value), otherwise the header is omitted.
|
|
157
|
+
*/
|
|
158
|
+
cacheControl?: number | string;
|
|
159
|
+
/**
|
|
160
|
+
* Sets the Fastify log level specifically for the internal OPTIONS route
|
|
161
|
+
* used to handle CORS preflight requests. For example, setting this to `'silent'`
|
|
162
|
+
* will prevent these requests from being logged.
|
|
163
|
+
* Useful for reducing noise in application logs.
|
|
164
|
+
* Default: inherits Fastify's global log level.
|
|
165
|
+
*/
|
|
166
|
+
logLevel?: LogLevel;
|
|
167
|
+
}
|
|
168
|
+
export { AbstractHttpCorsOptions }
|
|
169
|
+
export { AbstractHttpCorsOptions as AbstractHttpCorsOptions_alias_1 }
|
|
170
|
+
export { AbstractHttpCorsOptions as AbstractHttpCorsOptions_alias_2 }
|
|
171
|
+
|
|
172
|
+
declare interface AbstractHttpHandlerAdapterInterface {
|
|
173
|
+
prepareArguments?: (handlerMetadata: HandlerMetadata<any>) => ((target: Record<string, any>, request: any) => Promise<void> | void)[];
|
|
174
|
+
provideHandler: (controller: ClassType, handlerMetadata: HandlerMetadata<any>) => (context: RequestContextHolder, request: any, reply: any) => Promise<any>;
|
|
175
|
+
}
|
|
176
|
+
export { AbstractHttpHandlerAdapterInterface }
|
|
177
|
+
export { AbstractHttpHandlerAdapterInterface as AbstractHttpHandlerAdapterInterface_alias_1 }
|
|
178
|
+
export { AbstractHttpHandlerAdapterInterface as AbstractHttpHandlerAdapterInterface_alias_2 }
|
|
179
|
+
|
|
180
|
+
declare interface AbstractHttpListenOptions {
|
|
181
|
+
port: number;
|
|
182
|
+
host?: string;
|
|
183
|
+
}
|
|
184
|
+
export { AbstractHttpListenOptions }
|
|
185
|
+
export { AbstractHttpListenOptions as AbstractHttpListenOptions_alias_1 }
|
|
186
|
+
export { AbstractHttpListenOptions as AbstractHttpListenOptions_alias_2 }
|
|
187
|
+
|
|
89
188
|
declare const addLeadingSlash: (path?: string) => string;
|
|
90
189
|
export { addLeadingSlash }
|
|
91
190
|
export { addLeadingSlash as addLeadingSlash_alias_1 }
|
|
92
191
|
export { addLeadingSlash as addLeadingSlash_alias_2 }
|
|
93
192
|
export { addLeadingSlash as addLeadingSlash_alias_3 }
|
|
94
193
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
194
|
+
export { AnyInjectableType }
|
|
195
|
+
|
|
196
|
+
declare interface ArrayOfValueOrArray<T> extends Array<ValueOrArray<T>> {
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { asyncInject }
|
|
99
200
|
|
|
100
201
|
declare class AttributeFactory {
|
|
101
202
|
static createAttribute(token: symbol): ClassAttribute;
|
|
@@ -121,10 +222,12 @@ export { BadRequestException as BadRequestException_alias_2 }
|
|
|
121
222
|
|
|
122
223
|
export { BaseInjectionTokenSchemaType }
|
|
123
224
|
|
|
225
|
+
export { BaseInstanceHolderManager }
|
|
226
|
+
|
|
124
227
|
export { BoundInjectionToken }
|
|
125
228
|
|
|
126
229
|
declare interface CanActivate {
|
|
127
|
-
canActivate(executionContext:
|
|
230
|
+
canActivate(executionContext: AbstractExecutionContext): Promise<boolean> | boolean;
|
|
128
231
|
}
|
|
129
232
|
export { CanActivate }
|
|
130
233
|
export { CanActivate as CanActivate_alias_1 }
|
|
@@ -157,6 +260,8 @@ export { ClassTypeWithInstanceAndOptionalArgument }
|
|
|
157
260
|
|
|
158
261
|
export { ClassTypeWithOptionalArgument }
|
|
159
262
|
|
|
263
|
+
export { ClassTypeWithoutArguments }
|
|
264
|
+
|
|
160
265
|
declare const clc: {
|
|
161
266
|
bold: (text: string) => string;
|
|
162
267
|
green: (text: string) => string;
|
|
@@ -234,10 +339,6 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
234
339
|
* The context of the logger (can be set manually or automatically inferred).
|
|
235
340
|
*/
|
|
236
341
|
protected context?: string;
|
|
237
|
-
/**
|
|
238
|
-
* Request ID (if enabled).
|
|
239
|
-
*/
|
|
240
|
-
protected requestId: string | null;
|
|
241
342
|
/**
|
|
242
343
|
* The original context of the logger (set in the constructor).
|
|
243
344
|
*/
|
|
@@ -249,11 +350,11 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
249
350
|
/**
|
|
250
351
|
* The last timestamp at which the log message was printed.
|
|
251
352
|
*/
|
|
252
|
-
protected
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
353
|
+
protected lastTimestampAt?: number;
|
|
354
|
+
setup(): void;
|
|
355
|
+
setup(context: string): void;
|
|
356
|
+
setup(options: ConsoleLoggerOptions): void;
|
|
357
|
+
setup(context: string, options: ConsoleLoggerOptions): void;
|
|
257
358
|
/**
|
|
258
359
|
* Write a 'log' level log, if the configured level allows for it.
|
|
259
360
|
* Prints to `stdout` with newline.
|
|
@@ -307,17 +408,18 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
307
408
|
resetContext(): void;
|
|
308
409
|
isLevelEnabled(level: LogLevel): boolean;
|
|
309
410
|
protected getTimestamp(): string;
|
|
310
|
-
protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, writeStreamType?: 'stdout' | 'stderr', errorStack?: unknown): void;
|
|
411
|
+
protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, requestId?: string, writeStreamType?: 'stdout' | 'stderr', errorStack?: unknown): void;
|
|
311
412
|
protected printAsJson(message: unknown, options: {
|
|
312
413
|
context: string;
|
|
313
414
|
logLevel: LogLevel;
|
|
314
415
|
writeStreamType?: 'stdout' | 'stderr';
|
|
315
416
|
errorStack?: unknown;
|
|
417
|
+
requestId?: string;
|
|
316
418
|
}): void;
|
|
317
419
|
protected formatPid(pid: number): string;
|
|
318
420
|
protected formatContext(context: string): string;
|
|
319
|
-
protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string): string;
|
|
320
|
-
protected getRequestId(): string;
|
|
421
|
+
protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string, requestId?: string): string;
|
|
422
|
+
protected getRequestId(requestId?: string): string;
|
|
321
423
|
protected stringifyMessage(message: unknown, logLevel: LogLevel): string;
|
|
322
424
|
protected colorize(message: string, logLevel: LogLevel): string;
|
|
323
425
|
protected printStackTrace(stack: string): void;
|
|
@@ -420,22 +522,13 @@ export { ConsoleLoggerOptions }
|
|
|
420
522
|
export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_1 }
|
|
421
523
|
export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_2 }
|
|
422
524
|
|
|
525
|
+
export { Container }
|
|
526
|
+
|
|
423
527
|
declare function Controller({ guards }?: ControllerOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
|
|
424
528
|
export { Controller }
|
|
425
529
|
export { Controller as Controller_alias_1 }
|
|
426
530
|
export { Controller as Controller_alias_2 }
|
|
427
531
|
|
|
428
|
-
declare class ControllerAdapterService {
|
|
429
|
-
guardRunner: GuardRunnerService;
|
|
430
|
-
private logger;
|
|
431
|
-
setupController(controller: ClassType, instance: FastifyInstance, moduleMetadata: ModuleMetadata): Promise<void>;
|
|
432
|
-
providePreHandler(executionContext: ExecutionContext): ((request: FastifyRequest, reply: FastifyReply) => Promise<void>) | undefined;
|
|
433
|
-
private wrapHandler;
|
|
434
|
-
}
|
|
435
|
-
export { ControllerAdapterService }
|
|
436
|
-
export { ControllerAdapterService as ControllerAdapterService_alias_1 }
|
|
437
|
-
export { ControllerAdapterService as ControllerAdapterService_alias_2 }
|
|
438
|
-
|
|
439
532
|
declare interface ControllerMetadata {
|
|
440
533
|
endpoints: Set<HandlerMetadata>;
|
|
441
534
|
guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
@@ -457,7 +550,15 @@ export { ControllerOptions }
|
|
|
457
550
|
export { ControllerOptions as ControllerOptions_alias_1 }
|
|
458
551
|
export { ControllerOptions as ControllerOptions_alias_2 }
|
|
459
552
|
|
|
460
|
-
export {
|
|
553
|
+
export { createRequestContextHolder }
|
|
554
|
+
|
|
555
|
+
export { defaultInjectors }
|
|
556
|
+
|
|
557
|
+
export { DefaultRequestContextHolder }
|
|
558
|
+
|
|
559
|
+
export { DIError }
|
|
560
|
+
|
|
561
|
+
export { DIErrorCode }
|
|
461
562
|
|
|
462
563
|
declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
463
564
|
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
@@ -466,16 +567,15 @@ export { Endpoint }
|
|
|
466
567
|
export { Endpoint as Endpoint_alias_1 }
|
|
467
568
|
export { Endpoint as Endpoint_alias_2 }
|
|
468
569
|
|
|
469
|
-
declare class
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
provideHandler(controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<BaseEndpointConfig>): (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
|
|
570
|
+
declare class EndpointAdapterFactory {
|
|
571
|
+
private readonly environment;
|
|
572
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
473
573
|
}
|
|
474
|
-
export {
|
|
475
|
-
export {
|
|
476
|
-
export {
|
|
574
|
+
export { EndpointAdapterFactory }
|
|
575
|
+
export { EndpointAdapterFactory as EndpointAdapterFactory_alias_1 }
|
|
576
|
+
export { EndpointAdapterFactory as EndpointAdapterFactory_alias_2 }
|
|
477
577
|
|
|
478
|
-
declare const EndpointAdapterToken: InjectionToken<
|
|
578
|
+
declare const EndpointAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
479
579
|
export { EndpointAdapterToken }
|
|
480
580
|
export { EndpointAdapterToken as EndpointAdapterToken_alias_1 }
|
|
481
581
|
export { EndpointAdapterToken as EndpointAdapterToken_alias_2 }
|
|
@@ -532,21 +632,7 @@ declare type ExcludedKeys = 'computedTimeRates' | 'aiModelsRates' | 'aiModel';
|
|
|
532
632
|
|
|
533
633
|
declare type ExcludedParts = 'services' | 'mailer' | 'aws' | 'computedTimeRates' | 'aiModelsRates';
|
|
534
634
|
|
|
535
|
-
declare
|
|
536
|
-
private readonly module;
|
|
537
|
-
private readonly controller;
|
|
538
|
-
private readonly handler;
|
|
539
|
-
private request;
|
|
540
|
-
private reply;
|
|
541
|
-
constructor(module: ModuleMetadata, controller: ControllerMetadata, handler: HandlerMetadata);
|
|
542
|
-
getModule(): ModuleMetadata;
|
|
543
|
-
getController(): ControllerMetadata;
|
|
544
|
-
getHandler(): HandlerMetadata;
|
|
545
|
-
getRequest(): FastifyRequest;
|
|
546
|
-
getReply(): FastifyReply;
|
|
547
|
-
provideRequest(request: FastifyRequest): void;
|
|
548
|
-
provideReply(reply: FastifyReply): void;
|
|
549
|
-
}
|
|
635
|
+
declare const ExecutionContext: InjectionToken<AbstractExecutionContext, undefined, false>;
|
|
550
636
|
export { ExecutionContext }
|
|
551
637
|
export { ExecutionContext as ExecutionContext_alias_1 }
|
|
552
638
|
export { ExecutionContext as ExecutionContext_alias_2 }
|
|
@@ -556,11 +642,6 @@ export { ExecutionContextInjectionToken }
|
|
|
556
642
|
export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_1 }
|
|
557
643
|
export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_2 }
|
|
558
644
|
|
|
559
|
-
declare const ExecutionContextToken: InjectionToken<ExecutionContext, undefined, false>;
|
|
560
|
-
export { ExecutionContextToken }
|
|
561
|
-
export { ExecutionContextToken as ExecutionContextToken_alias_1 }
|
|
562
|
-
export { ExecutionContextToken as ExecutionContextToken_alias_2 }
|
|
563
|
-
|
|
564
645
|
declare function extractControllerMetadata(target: ClassType): ControllerMetadata;
|
|
565
646
|
export { extractControllerMetadata }
|
|
566
647
|
export { extractControllerMetadata as extractControllerMetadata_alias_1 }
|
|
@@ -571,6 +652,10 @@ export { extractModuleMetadata }
|
|
|
571
652
|
export { extractModuleMetadata as extractModuleMetadata_alias_1 }
|
|
572
653
|
export { extractModuleMetadata as extractModuleMetadata_alias_2 }
|
|
573
654
|
|
|
655
|
+
export { Factorable }
|
|
656
|
+
|
|
657
|
+
export { FactorableWithArgs }
|
|
658
|
+
|
|
574
659
|
export { Factory }
|
|
575
660
|
|
|
576
661
|
export { FactoryContext }
|
|
@@ -579,12 +664,12 @@ export { FactoryInjectionToken }
|
|
|
579
664
|
|
|
580
665
|
export { FactoryNotFound }
|
|
581
666
|
|
|
667
|
+
export { FactoryOptions }
|
|
668
|
+
|
|
582
669
|
export { FactoryRecord }
|
|
583
670
|
|
|
584
671
|
export { FactoryTokenNotResolved }
|
|
585
672
|
|
|
586
|
-
export { FactoryWithArgs }
|
|
587
|
-
|
|
588
673
|
/**
|
|
589
674
|
* @publicApi
|
|
590
675
|
*/
|
|
@@ -616,8 +701,6 @@ export { getEndpointMetadata }
|
|
|
616
701
|
export { getEndpointMetadata as getEndpointMetadata_alias_1 }
|
|
617
702
|
export { getEndpointMetadata as getEndpointMetadata_alias_2 }
|
|
618
703
|
|
|
619
|
-
export { getGlobalServiceLocator }
|
|
620
|
-
|
|
621
704
|
export { getInjectableToken }
|
|
622
705
|
|
|
623
706
|
export { getInjectors }
|
|
@@ -630,28 +713,19 @@ export { getModuleMetadata as getModuleMetadata_alias_2 }
|
|
|
630
713
|
export { globalRegistry }
|
|
631
714
|
|
|
632
715
|
declare class GuardRunnerService {
|
|
633
|
-
|
|
634
|
-
|
|
716
|
+
protected container: Container;
|
|
717
|
+
runGuards(allGuards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>, executionContext: AbstractExecutionContext): Promise<boolean>;
|
|
718
|
+
makeContext(moduleMetadata: ModuleMetadata, controllerMetadata: ControllerMetadata, endpoint: HandlerMetadata): Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
635
719
|
}
|
|
636
720
|
export { GuardRunnerService }
|
|
637
721
|
export { GuardRunnerService as GuardRunnerService_alias_1 }
|
|
638
722
|
export { GuardRunnerService as GuardRunnerService_alias_2 }
|
|
639
723
|
|
|
640
|
-
declare interface HandlerAdapterInterface {
|
|
641
|
-
provideSchema?: (handlerMetadata: HandlerMetadata<any>) => Record<string, any>;
|
|
642
|
-
hasSchema?: (handlerMetadata: HandlerMetadata<any>) => boolean;
|
|
643
|
-
prepareArguments?: (handlerMetadata: HandlerMetadata<any>) => ((target: Record<string, any>, request: FastifyRequest) => Promise<void> | void)[];
|
|
644
|
-
provideHandler: (controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<any>) => (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
|
|
645
|
-
}
|
|
646
|
-
export { HandlerAdapterInterface }
|
|
647
|
-
export { HandlerAdapterInterface as HandlerAdapterInterface_alias_1 }
|
|
648
|
-
export { HandlerAdapterInterface as HandlerAdapterInterface_alias_2 }
|
|
649
|
-
|
|
650
724
|
declare interface HandlerMetadata<Config = null> {
|
|
651
725
|
classMethod: string;
|
|
652
726
|
url: string;
|
|
653
727
|
successStatusCode: number;
|
|
654
|
-
adapterToken: InjectionToken<
|
|
728
|
+
adapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined> | ClassTypeWithInstance<AbstractHttpHandlerAdapterInterface> | null;
|
|
655
729
|
headers: Partial<Record<HttpHeader, number | string | string[] | undefined>>;
|
|
656
730
|
httpMethod: HttpMethod;
|
|
657
731
|
config: Config;
|
|
@@ -677,6 +751,19 @@ export { Header }
|
|
|
677
751
|
export { Header as Header_alias_1 }
|
|
678
752
|
export { Header as Header_alias_2 }
|
|
679
753
|
|
|
754
|
+
declare class HttpAdapterFactory {
|
|
755
|
+
private readonly environment;
|
|
756
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
757
|
+
}
|
|
758
|
+
export { HttpAdapterFactory }
|
|
759
|
+
export { HttpAdapterFactory as HttpAdapterFactory_alias_1 }
|
|
760
|
+
export { HttpAdapterFactory as HttpAdapterFactory_alias_2 }
|
|
761
|
+
|
|
762
|
+
declare const HttpAdapterToken: InjectionToken<AbstractHttpAdapterInterface<any, any, any, any>, undefined, false>;
|
|
763
|
+
export { HttpAdapterToken }
|
|
764
|
+
export { HttpAdapterToken as HttpAdapterToken_alias_1 }
|
|
765
|
+
export { HttpAdapterToken as HttpAdapterToken_alias_2 }
|
|
766
|
+
|
|
680
767
|
declare function HttpCode(code: number): <T extends Function>(target: T, context: ClassMethodDecoratorContext) => T;
|
|
681
768
|
export { HttpCode }
|
|
682
769
|
export { HttpCode as HttpCode_alias_1 }
|
|
@@ -692,6 +779,15 @@ export { HttpException }
|
|
|
692
779
|
export { HttpException as HttpException_alias_1 }
|
|
693
780
|
export { HttpException as HttpException_alias_2 }
|
|
694
781
|
|
|
782
|
+
/**
|
|
783
|
+
* HTTP header strings
|
|
784
|
+
* Use this type only for input values, not for output values.
|
|
785
|
+
*/
|
|
786
|
+
declare type HttpHeader = keyof OmitIndexSignature<OutgoingHttpHeaders> | (string & Record<never, never>);
|
|
787
|
+
export { HttpHeader }
|
|
788
|
+
export { HttpHeader as HttpHeader_alias_1 }
|
|
789
|
+
export { HttpHeader as HttpHeader_alias_2 }
|
|
790
|
+
|
|
695
791
|
export { inject }
|
|
696
792
|
|
|
697
793
|
export { Injectable }
|
|
@@ -704,19 +800,19 @@ export { InjectableTokenMeta }
|
|
|
704
800
|
|
|
705
801
|
export { InjectableType }
|
|
706
802
|
|
|
707
|
-
export { InjectionFactory }
|
|
708
|
-
|
|
709
803
|
export { InjectionToken }
|
|
710
804
|
|
|
711
805
|
export { InjectionTokenSchemaType }
|
|
712
806
|
|
|
807
|
+
export { InjectionTokenType }
|
|
808
|
+
|
|
713
809
|
export { Injectors }
|
|
714
810
|
|
|
715
|
-
export {
|
|
811
|
+
export { InjectRequest }
|
|
716
812
|
|
|
717
|
-
export {
|
|
813
|
+
export { InjectState }
|
|
718
814
|
|
|
719
|
-
export {
|
|
815
|
+
export { InstanceDestroying }
|
|
720
816
|
|
|
721
817
|
export { InstanceNotFound }
|
|
722
818
|
|
|
@@ -813,6 +909,10 @@ export { isUndefined as isUndefined_alias_1 }
|
|
|
813
909
|
export { isUndefined as isUndefined_alias_2 }
|
|
814
910
|
export { isUndefined as isUndefined_alias_3 }
|
|
815
911
|
|
|
912
|
+
export { IsUnion }
|
|
913
|
+
|
|
914
|
+
export { Join }
|
|
915
|
+
|
|
816
916
|
declare const LOG_LEVELS: ["verbose", "debug", "log", "warn", "error", "fatal"];
|
|
817
917
|
export { LOG_LEVELS }
|
|
818
918
|
export { LOG_LEVELS as LOG_LEVELS_alias_1 }
|
|
@@ -820,40 +920,15 @@ export { LOG_LEVELS as LOG_LEVELS_alias_2 }
|
|
|
820
920
|
|
|
821
921
|
declare const Logger: InjectionToken<LoggerInstance, z.ZodOptional<z.ZodObject<{
|
|
822
922
|
context: z.ZodOptional<z.ZodString>;
|
|
823
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
824
|
-
timestamp: z.ZodOptional<z.ZodBoolean>;
|
|
825
|
-
}, z.core.$strip>>;
|
|
826
923
|
}, z.core.$strip>>, false>;
|
|
827
924
|
export { Logger }
|
|
828
925
|
export { Logger as Logger_alias_1 }
|
|
829
926
|
export { Logger as Logger_alias_2 }
|
|
830
927
|
|
|
831
|
-
declare class LoggerFactory {
|
|
832
|
-
create(ctx: any, args: z.infer<typeof LoggerOptions>): LoggerInstance;
|
|
833
|
-
}
|
|
834
|
-
export { LoggerFactory }
|
|
835
|
-
export { LoggerFactory as LoggerFactory_alias_1 }
|
|
836
|
-
export { LoggerFactory as LoggerFactory_alias_2 }
|
|
837
|
-
|
|
838
|
-
declare const LoggerInjectionToken = "LoggerInjectionToken";
|
|
839
|
-
export { LoggerInjectionToken }
|
|
840
|
-
export { LoggerInjectionToken as LoggerInjectionToken_alias_1 }
|
|
841
|
-
export { LoggerInjectionToken as LoggerInjectionToken_alias_2 }
|
|
842
|
-
|
|
843
928
|
declare class LoggerInstance implements LoggerService {
|
|
844
|
-
protected
|
|
845
|
-
protected
|
|
846
|
-
|
|
847
|
-
};
|
|
848
|
-
protected static staticInstanceRef?: LoggerService;
|
|
849
|
-
protected static logLevels?: LogLevel[];
|
|
850
|
-
protected localInstanceRef?: LoggerService;
|
|
851
|
-
constructor();
|
|
852
|
-
constructor(context: string);
|
|
853
|
-
constructor(context: string, options?: {
|
|
854
|
-
timestamp?: boolean;
|
|
855
|
-
});
|
|
856
|
-
get localInstance(): LoggerService;
|
|
929
|
+
protected localInstance: LoggerService;
|
|
930
|
+
protected context?: string;
|
|
931
|
+
constructor(config?: LoggerOptions);
|
|
857
932
|
/**
|
|
858
933
|
* Write an 'error' level log.
|
|
859
934
|
*/
|
|
@@ -884,58 +959,28 @@ declare class LoggerInstance implements LoggerService {
|
|
|
884
959
|
*/
|
|
885
960
|
fatal(message: any, context?: string): void;
|
|
886
961
|
fatal(message: any, ...optionalParams: [...any, string?]): void;
|
|
887
|
-
/**
|
|
888
|
-
* Write an 'error' level log.
|
|
889
|
-
*/
|
|
890
|
-
static error(message: any, stackOrContext?: string): void;
|
|
891
|
-
static error(message: any, context?: string): void;
|
|
892
|
-
static error(message: any, stack?: string, context?: string): void;
|
|
893
|
-
static error(message: any, ...optionalParams: [...any, string?, string?]): void;
|
|
894
|
-
/**
|
|
895
|
-
* Write a 'log' level log.
|
|
896
|
-
*/
|
|
897
|
-
static log(message: any, context?: string): void;
|
|
898
|
-
static log(message: any, ...optionalParams: [...any, string?]): void;
|
|
899
|
-
/**
|
|
900
|
-
* Write a 'warn' level log.
|
|
901
|
-
*/
|
|
902
|
-
static warn(message: any, context?: string): void;
|
|
903
|
-
static warn(message: any, ...optionalParams: [...any, string?]): void;
|
|
904
|
-
/**
|
|
905
|
-
* Write a 'debug' level log, if the configured level allows for it.
|
|
906
|
-
* Prints to `stdout` with newline.
|
|
907
|
-
*/
|
|
908
|
-
static debug(message: any, context?: string): void;
|
|
909
|
-
static debug(message: any, ...optionalParams: [...any, string?]): void;
|
|
910
|
-
/**
|
|
911
|
-
* Write a 'verbose' level log.
|
|
912
|
-
*/
|
|
913
|
-
static verbose(message: any, context?: string): void;
|
|
914
|
-
static verbose(message: any, ...optionalParams: [...any, string?]): void;
|
|
915
|
-
/**
|
|
916
|
-
* Write a 'fatal' level log.
|
|
917
|
-
*/
|
|
918
|
-
static fatal(message: any, context?: string): void;
|
|
919
|
-
static fatal(message: any, ...optionalParams: [...any, string?]): void;
|
|
920
|
-
static getTimestamp(): string;
|
|
921
|
-
static overrideLogger(logger: LoggerService | LogLevel[] | boolean): any;
|
|
922
|
-
static isLevelEnabled(level: LogLevel): boolean;
|
|
923
|
-
private registerLocalInstanceRef;
|
|
924
962
|
}
|
|
925
963
|
export { LoggerInstance }
|
|
926
964
|
export { LoggerInstance as LoggerInstance_alias_1 }
|
|
927
965
|
export { LoggerInstance as LoggerInstance_alias_2 }
|
|
928
966
|
|
|
929
|
-
declare
|
|
930
|
-
context: z.ZodOptional<z.ZodString>;
|
|
931
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
932
|
-
timestamp: z.ZodOptional<z.ZodBoolean>;
|
|
933
|
-
}, z.core.$strip>>;
|
|
934
|
-
}, z.core.$strip>>;
|
|
967
|
+
declare type LoggerOptions = z.infer<typeof loggerOptionsSchema>;
|
|
935
968
|
export { LoggerOptions }
|
|
936
969
|
export { LoggerOptions as LoggerOptions_alias_1 }
|
|
937
970
|
export { LoggerOptions as LoggerOptions_alias_2 }
|
|
938
971
|
|
|
972
|
+
declare const loggerOptionsSchema: z.ZodOptional<z.ZodObject<{
|
|
973
|
+
context: z.ZodOptional<z.ZodString>;
|
|
974
|
+
}, z.core.$strip>>;
|
|
975
|
+
export { loggerOptionsSchema }
|
|
976
|
+
export { loggerOptionsSchema as loggerOptionsSchema_alias_1 }
|
|
977
|
+
export { loggerOptionsSchema as loggerOptionsSchema_alias_2 }
|
|
978
|
+
|
|
979
|
+
declare const LoggerOutput: InjectionToken<LoggerService, undefined, false>;
|
|
980
|
+
export { LoggerOutput }
|
|
981
|
+
export { LoggerOutput as LoggerOutput_alias_1 }
|
|
982
|
+
export { LoggerOutput as LoggerOutput_alias_2 }
|
|
983
|
+
|
|
939
984
|
/**
|
|
940
985
|
* @publicApi
|
|
941
986
|
*/
|
|
@@ -982,8 +1027,6 @@ export { LogLevel }
|
|
|
982
1027
|
export { LogLevel as LogLevel_alias_1 }
|
|
983
1028
|
export { LogLevel as LogLevel_alias_2 }
|
|
984
1029
|
|
|
985
|
-
export { makeProxyServiceLocator }
|
|
986
|
-
|
|
987
1030
|
declare function Module({ controllers, imports, guards }?: ModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
|
|
988
1031
|
export { Module }
|
|
989
1032
|
export { Module as Module_alias_1 }
|
|
@@ -991,6 +1034,7 @@ export { Module as Module_alias_2 }
|
|
|
991
1034
|
|
|
992
1035
|
declare class ModuleLoaderService {
|
|
993
1036
|
private logger;
|
|
1037
|
+
protected container: Container;
|
|
994
1038
|
private modulesMetadata;
|
|
995
1039
|
private loadedModules;
|
|
996
1040
|
private initialized;
|
|
@@ -1035,17 +1079,15 @@ export { Multipart }
|
|
|
1035
1079
|
export { Multipart as Multipart_alias_1 }
|
|
1036
1080
|
export { Multipart as Multipart_alias_2 }
|
|
1037
1081
|
|
|
1038
|
-
declare class
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
private analyzeSchema;
|
|
1042
|
-
provideSchema(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): Record<string, any>;
|
|
1082
|
+
declare class MultipartAdapterFactory {
|
|
1083
|
+
private readonly environment;
|
|
1084
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1043
1085
|
}
|
|
1044
|
-
export {
|
|
1045
|
-
export {
|
|
1046
|
-
export {
|
|
1086
|
+
export { MultipartAdapterFactory }
|
|
1087
|
+
export { MultipartAdapterFactory as MultipartAdapterFactory_alias_1 }
|
|
1088
|
+
export { MultipartAdapterFactory as MultipartAdapterFactory_alias_2 }
|
|
1047
1089
|
|
|
1048
|
-
declare const MultipartAdapterToken: InjectionToken<
|
|
1090
|
+
declare const MultipartAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
1049
1091
|
export { MultipartAdapterToken }
|
|
1050
1092
|
export { MultipartAdapterToken as MultipartAdapterToken_alias_1 }
|
|
1051
1093
|
export { MultipartAdapterToken as MultipartAdapterToken_alias_2 }
|
|
@@ -1059,33 +1101,29 @@ export { MultipartParams as MultipartParams_alias_2 }
|
|
|
1059
1101
|
|
|
1060
1102
|
declare type MultipartResult<EndpointDeclaration extends {
|
|
1061
1103
|
config: BaseEndpointConfig<any, any, any, any, any>;
|
|
1062
|
-
}> = EndpointDeclaration['config']['responseSchema'] extends ZodDiscriminatedUnion<
|
|
1104
|
+
}> = EndpointDeclaration['config']['responseSchema'] extends ZodDiscriminatedUnion<infer Options> ? Promise<z.input<Options[number]>> : Promise<z.input<EndpointDeclaration['config']['responseSchema']>>;
|
|
1063
1105
|
export { MultipartResult }
|
|
1064
1106
|
export { MultipartResult as MultipartResult_alias_1 }
|
|
1065
1107
|
export { MultipartResult as MultipartResult_alias_2 }
|
|
1066
1108
|
|
|
1067
1109
|
declare class NaviosApplication {
|
|
1110
|
+
private environment;
|
|
1068
1111
|
private moduleLoader;
|
|
1069
|
-
private
|
|
1112
|
+
private httpApplication;
|
|
1070
1113
|
private logger;
|
|
1071
|
-
|
|
1072
|
-
private corsOptions;
|
|
1073
|
-
private multipartOptions;
|
|
1074
|
-
private globalPrefix;
|
|
1114
|
+
protected container: Container;
|
|
1075
1115
|
private appModule;
|
|
1076
1116
|
private options;
|
|
1077
1117
|
isInitialized: boolean;
|
|
1078
|
-
setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): void
|
|
1118
|
+
setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<void>;
|
|
1119
|
+
getContainer(): Container;
|
|
1079
1120
|
init(): Promise<void>;
|
|
1080
|
-
private getFastifyInstance;
|
|
1081
|
-
private configureFastifyInstance;
|
|
1082
|
-
configureMultipart(server: FastifyInstance, options: FastifyMultipartOptions | true): Promise<void>;
|
|
1083
1121
|
private initModules;
|
|
1084
|
-
enableCors(options:
|
|
1085
|
-
enableMultipart(options:
|
|
1122
|
+
enableCors(options: any): void;
|
|
1123
|
+
enableMultipart(options: any): void;
|
|
1086
1124
|
setGlobalPrefix(prefix: string): void;
|
|
1087
|
-
getServer():
|
|
1088
|
-
listen(options:
|
|
1125
|
+
getServer(): any;
|
|
1126
|
+
listen(options: AbstractHttpListenOptions): Promise<void>;
|
|
1089
1127
|
dispose(): Promise<void>;
|
|
1090
1128
|
close(): Promise<void>;
|
|
1091
1129
|
}
|
|
@@ -1101,13 +1139,26 @@ declare interface NaviosApplicationContextOptions {
|
|
|
1101
1139
|
export { NaviosApplicationContextOptions }
|
|
1102
1140
|
export { NaviosApplicationContextOptions as NaviosApplicationContextOptions_alias_1 }
|
|
1103
1141
|
|
|
1104
|
-
declare interface NaviosApplicationOptions extends
|
|
1142
|
+
declare interface NaviosApplicationOptions extends NaviosApplicationContextOptions {
|
|
1143
|
+
adapter: NaviosEnvironmentOptions | NaviosEnvironmentOptions[];
|
|
1105
1144
|
}
|
|
1106
1145
|
export { NaviosApplicationOptions }
|
|
1107
1146
|
export { NaviosApplicationOptions as NaviosApplicationOptions_alias_1 }
|
|
1108
1147
|
|
|
1148
|
+
export declare class NaviosEnvironment {
|
|
1149
|
+
private httpTokens;
|
|
1150
|
+
setupHttpEnvironment(tokens: Map<InjectionToken<any, undefined>, AnyInjectableType>): void;
|
|
1151
|
+
getHttpToken(token: InjectionToken<any, undefined>): AnyInjectableType | undefined;
|
|
1152
|
+
hasHttpSetup(): boolean;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
export declare interface NaviosEnvironmentOptions {
|
|
1156
|
+
httpTokens?: Map<InjectionToken<any, undefined>, AnyInjectableType>;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1109
1159
|
declare class NaviosFactory {
|
|
1110
1160
|
static create(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<NaviosApplication>;
|
|
1161
|
+
private static registerEnvironment;
|
|
1111
1162
|
private static registerLoggerConfiguration;
|
|
1112
1163
|
}
|
|
1113
1164
|
export { NaviosFactory }
|
|
@@ -1135,8 +1186,23 @@ export { NotFoundException }
|
|
|
1135
1186
|
export { NotFoundException as NotFoundException_alias_1 }
|
|
1136
1187
|
export { NotFoundException as NotFoundException_alias_2 }
|
|
1137
1188
|
|
|
1189
|
+
declare type OmitIndexSignature<T> = {
|
|
1190
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
1191
|
+
};
|
|
1192
|
+
export { OmitIndexSignature }
|
|
1193
|
+
export { OmitIndexSignature as OmitIndexSignature_alias_1 }
|
|
1194
|
+
export { OmitIndexSignature as OmitIndexSignature_alias_2 }
|
|
1195
|
+
|
|
1196
|
+
export { OnServiceDestroy }
|
|
1197
|
+
|
|
1198
|
+
export { OnServiceInit }
|
|
1199
|
+
|
|
1200
|
+
export { optional }
|
|
1201
|
+
|
|
1138
1202
|
export { OptionalInjectionTokenSchemaType }
|
|
1139
1203
|
|
|
1204
|
+
declare type OriginType = string | boolean | RegExp;
|
|
1205
|
+
|
|
1140
1206
|
declare type Path<T> = keyof T extends string ? PathImpl2<T> extends infer P ? P extends string | keyof T ? P : keyof T : keyof T : never;
|
|
1141
1207
|
export { Path }
|
|
1142
1208
|
export { Path as Path_alias_1 }
|
|
@@ -1157,45 +1223,46 @@ export { PathValue }
|
|
|
1157
1223
|
export { PathValue as PathValue_alias_1 }
|
|
1158
1224
|
export { PathValue as PathValue_alias_2 }
|
|
1159
1225
|
|
|
1160
|
-
|
|
1161
|
-
protected readonly logger: LoggerService;
|
|
1162
|
-
constructor(logger: LoggerService);
|
|
1163
|
-
fatal(message: any, ...optionalParams: any[]): void;
|
|
1164
|
-
error(message: any, ...optionalParams: any[]): void;
|
|
1165
|
-
warn(message: any, ...optionalParams: any[]): void;
|
|
1166
|
-
info(): void;
|
|
1167
|
-
debug(message: any, ...optionalParams: any[]): void;
|
|
1168
|
-
trace(message: any, ...optionalParams: any[]): void;
|
|
1169
|
-
silent(): void;
|
|
1170
|
-
child(options: any): PinoWrapper;
|
|
1171
|
-
get level(): any;
|
|
1172
|
-
}
|
|
1173
|
-
export { PinoWrapper }
|
|
1174
|
-
export { PinoWrapper as PinoWrapper_alias_1 }
|
|
1175
|
-
export { PinoWrapper as PinoWrapper_alias_2 }
|
|
1226
|
+
export { PopUnion }
|
|
1176
1227
|
|
|
1177
1228
|
declare function provideConfig<ConfigMap extends ConfigServiceOptions>(options: z.input<typeof ConfigProviderOptions>): FactoryInjectionToken<ConfigService<ConfigMap>, typeof ConfigServiceOptionsSchema>;
|
|
1178
1229
|
export { provideConfig }
|
|
1179
1230
|
export { provideConfig as provideConfig_alias_1 }
|
|
1180
1231
|
export { provideConfig as provideConfig_alias_2 }
|
|
1181
1232
|
|
|
1182
|
-
export {
|
|
1183
|
-
|
|
1184
|
-
export { ProxyServiceLocator }
|
|
1233
|
+
export { provideFactoryContext }
|
|
1185
1234
|
|
|
1186
1235
|
export { Registry }
|
|
1187
1236
|
|
|
1188
|
-
declare const Reply: InjectionToken<
|
|
1237
|
+
declare const Reply: InjectionToken<any, undefined, false>;
|
|
1189
1238
|
export { Reply }
|
|
1190
1239
|
export { Reply as Reply_alias_1 }
|
|
1191
1240
|
export { Reply as Reply_alias_2 }
|
|
1192
1241
|
|
|
1193
|
-
declare
|
|
1242
|
+
declare class ReplyFactory {
|
|
1243
|
+
private readonly environment;
|
|
1244
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1245
|
+
}
|
|
1246
|
+
export { ReplyFactory }
|
|
1247
|
+
export { ReplyFactory as ReplyFactory_alias_1 }
|
|
1248
|
+
export { ReplyFactory as ReplyFactory_alias_2 }
|
|
1249
|
+
|
|
1250
|
+
declare const Request_2: InjectionToken<any, undefined, false>;
|
|
1194
1251
|
export { Request_2 as Request }
|
|
1195
1252
|
export { Request_2 as Request_alias_1 }
|
|
1196
1253
|
export { Request_2 as Request_alias_2 }
|
|
1197
1254
|
|
|
1198
|
-
export {
|
|
1255
|
+
export { RequestContextHolder }
|
|
1256
|
+
|
|
1257
|
+
declare class RequestFactory {
|
|
1258
|
+
private readonly environment;
|
|
1259
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1260
|
+
}
|
|
1261
|
+
export { RequestFactory }
|
|
1262
|
+
export { RequestFactory as RequestFactory_alias_1 }
|
|
1263
|
+
export { RequestFactory as RequestFactory_alias_2 }
|
|
1264
|
+
|
|
1265
|
+
export { ServiceInstantiator }
|
|
1199
1266
|
|
|
1200
1267
|
export { ServiceLocator }
|
|
1201
1268
|
|
|
@@ -1213,7 +1280,7 @@ export { ServiceLocatorInstanceHolderCreating }
|
|
|
1213
1280
|
|
|
1214
1281
|
export { ServiceLocatorInstanceHolderDestroying }
|
|
1215
1282
|
|
|
1216
|
-
export {
|
|
1283
|
+
export { ServiceLocatorInstanceHolderError }
|
|
1217
1284
|
|
|
1218
1285
|
export { ServiceLocatorInstanceHolderStatus }
|
|
1219
1286
|
|
|
@@ -1221,22 +1288,20 @@ export { ServiceLocatorManager }
|
|
|
1221
1288
|
|
|
1222
1289
|
declare function Stream<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, RequestSchema = ZodType>(endpoint: {
|
|
1223
1290
|
config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
|
|
1224
|
-
}): (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:
|
|
1291
|
+
}): (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>;
|
|
1225
1292
|
export { Stream }
|
|
1226
1293
|
export { Stream as Stream_alias_1 }
|
|
1227
1294
|
export { Stream as Stream_alias_2 }
|
|
1228
1295
|
|
|
1229
|
-
declare class
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
provideHandler(controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<BaseStreamConfig>): (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
|
|
1233
|
-
provideSchema(handlerMetadata: HandlerMetadata<BaseStreamConfig>): Record<string, any>;
|
|
1296
|
+
declare class StreamAdapterFactory {
|
|
1297
|
+
private readonly environment;
|
|
1298
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1234
1299
|
}
|
|
1235
|
-
export {
|
|
1236
|
-
export {
|
|
1237
|
-
export {
|
|
1300
|
+
export { StreamAdapterFactory }
|
|
1301
|
+
export { StreamAdapterFactory as StreamAdapterFactory_alias_1 }
|
|
1302
|
+
export { StreamAdapterFactory as StreamAdapterFactory_alias_2 }
|
|
1238
1303
|
|
|
1239
|
-
declare const StreamAdapterToken: InjectionToken<
|
|
1304
|
+
declare const StreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
1240
1305
|
export { StreamAdapterToken }
|
|
1241
1306
|
export { StreamAdapterToken as StreamAdapterToken_alias_1 }
|
|
1242
1307
|
export { StreamAdapterToken as StreamAdapterToken_alias_2 }
|
|
@@ -1254,8 +1319,6 @@ export { stripEndSlash as stripEndSlash_alias_1 }
|
|
|
1254
1319
|
export { stripEndSlash as stripEndSlash_alias_2 }
|
|
1255
1320
|
export { stripEndSlash as stripEndSlash_alias_3 }
|
|
1256
1321
|
|
|
1257
|
-
export { syncInject }
|
|
1258
|
-
|
|
1259
1322
|
declare class UnauthorizedException extends HttpException {
|
|
1260
1323
|
constructor(message: string | object, error?: Error);
|
|
1261
1324
|
}
|
|
@@ -1263,6 +1326,12 @@ export { UnauthorizedException }
|
|
|
1263
1326
|
export { UnauthorizedException as UnauthorizedException_alias_1 }
|
|
1264
1327
|
export { UnauthorizedException as UnauthorizedException_alias_2 }
|
|
1265
1328
|
|
|
1329
|
+
export { UnionToArray }
|
|
1330
|
+
|
|
1331
|
+
export { UnionToIntersection }
|
|
1332
|
+
|
|
1333
|
+
export { UnionToOvlds }
|
|
1334
|
+
|
|
1266
1335
|
export { UnknownError }
|
|
1267
1336
|
|
|
1268
1337
|
declare function UseGuards(...guards: (ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>)[]): <T extends Function>(target: T, context: ClassMethodDecoratorContext | ClassDecoratorContext) => T;
|
|
@@ -1270,6 +1339,8 @@ export { UseGuards }
|
|
|
1270
1339
|
export { UseGuards as UseGuards_alias_1 }
|
|
1271
1340
|
export { UseGuards as UseGuards_alias_2 }
|
|
1272
1341
|
|
|
1342
|
+
declare type ValueOrArray<T> = T | ArrayOfValueOrArray<T>;
|
|
1343
|
+
|
|
1273
1344
|
export { wrapSyncInit }
|
|
1274
1345
|
|
|
1275
1346
|
declare const yellow: (text: string) => string;
|