@navios/core 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +251 -0
- package/docs/quick-start.md +295 -0
- package/docs/services.md +428 -0
- package/docs/testing.md +704 -0
- package/lib/_tsup-dts-rollup.d.mts +300 -235
- package/lib/_tsup-dts-rollup.d.ts +300 -235
- package/lib/index.d.mts +47 -26
- package/lib/index.d.ts +47 -26
- 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 +4 -7
- 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 -1
- 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,12 @@ 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 { Container } from '@navios/di';
|
|
16
|
+
import { createDeferred } from '@navios/di';
|
|
17
|
+
import { createRequestContextHolder } from '@navios/di';
|
|
18
|
+
import { defaultInjectors } from '@navios/di';
|
|
19
|
+
import { DefaultRequestContextHolder } from '@navios/di';
|
|
20
|
+
import { Deferred } from '@navios/di';
|
|
13
21
|
import type { EndpointFunctionArgs } from '@navios/builder';
|
|
14
22
|
import { ErrorsEnum } from '@navios/di';
|
|
15
23
|
import { EventEmitter } from '@navios/di';
|
|
@@ -17,55 +25,45 @@ import { EventEmitterInterface } from '@navios/di';
|
|
|
17
25
|
import { EventsArgs } from '@navios/di';
|
|
18
26
|
import { EventsConfig } from '@navios/di';
|
|
19
27
|
import { EventsNames } from '@navios/di';
|
|
28
|
+
import { Factorable } from '@navios/di';
|
|
29
|
+
import { FactorableWithArgs } from '@navios/di';
|
|
20
30
|
import { Factory } from '@navios/di';
|
|
21
31
|
import { FactoryContext } from '@navios/di';
|
|
22
32
|
import { FactoryInjectionToken } from '@navios/di';
|
|
23
33
|
import { FactoryNotFound } from '@navios/di';
|
|
34
|
+
import { FactoryOptions } from '@navios/di';
|
|
24
35
|
import { FactoryRecord } from '@navios/di';
|
|
25
36
|
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
37
|
import { getInjectableToken } from '@navios/di';
|
|
39
38
|
import { getInjectors } from '@navios/di';
|
|
40
39
|
import { globalRegistry } from '@navios/di';
|
|
41
|
-
import type { HttpHeader } from 'fastify/types/utils.js';
|
|
42
40
|
import type { HttpMethod } from '@navios/builder';
|
|
43
|
-
import { IncomingMessage } from 'http';
|
|
44
41
|
import { inject } from '@navios/di';
|
|
45
42
|
import { Injectable } from '@navios/di';
|
|
46
43
|
import { InjectableOptions } from '@navios/di';
|
|
47
44
|
import { InjectableScope } from '@navios/di';
|
|
48
45
|
import { InjectableTokenMeta } from '@navios/di';
|
|
49
46
|
import { InjectableType } from '@navios/di';
|
|
50
|
-
import { InjectionFactory } from '@navios/di';
|
|
51
47
|
import { InjectionToken } from '@navios/di';
|
|
52
48
|
import { InjectionTokenSchemaType } from '@navios/di';
|
|
49
|
+
import { InjectionTokenType } from '@navios/di';
|
|
53
50
|
import { Injectors } from '@navios/di';
|
|
54
|
-
import {
|
|
51
|
+
import { InjectState } from '@navios/di';
|
|
55
52
|
import type { InspectOptions } from 'util';
|
|
56
53
|
import { InstanceDestroying } from '@navios/di';
|
|
57
54
|
import { InstanceExpired } from '@navios/di';
|
|
58
55
|
import { InstanceNotFound } from '@navios/di';
|
|
59
|
-
import {
|
|
56
|
+
import { IsUnion } from '@navios/di';
|
|
57
|
+
import { Join } from '@navios/di';
|
|
58
|
+
import { OnServiceDestroy } from '@navios/di';
|
|
59
|
+
import { OnServiceInit } from '@navios/di';
|
|
60
60
|
import { OptionalInjectionTokenSchemaType } from '@navios/di';
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
61
|
+
import type { OutgoingHttpHeaders } from 'http';
|
|
62
|
+
import { PopUnion } from '@navios/di';
|
|
63
|
+
import { provideFactoryContext } from '@navios/di';
|
|
64
64
|
import { Registry } from '@navios/di';
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import { RouteGenericInterface } from 'fastify';
|
|
68
|
-
import { ServerResponse } from 'http';
|
|
65
|
+
import { RequestContextHolder } from '@navios/di';
|
|
66
|
+
import { ServiceInstantiator } from '@navios/di';
|
|
69
67
|
import { ServiceLocator } from '@navios/di';
|
|
70
68
|
import { ServiceLocatorEventBus } from '@navios/di';
|
|
71
69
|
import { ServiceLocatorInstanceDestroyListener } from '@navios/di';
|
|
@@ -74,10 +72,12 @@ import { ServiceLocatorInstanceHolder } from '@navios/di';
|
|
|
74
72
|
import { ServiceLocatorInstanceHolderCreated } from '@navios/di';
|
|
75
73
|
import { ServiceLocatorInstanceHolderCreating } from '@navios/di';
|
|
76
74
|
import { ServiceLocatorInstanceHolderDestroying } from '@navios/di';
|
|
77
|
-
import {
|
|
75
|
+
import { ServiceLocatorInstanceHolderError } from '@navios/di';
|
|
78
76
|
import { ServiceLocatorInstanceHolderStatus } from '@navios/di';
|
|
79
77
|
import { ServiceLocatorManager } from '@navios/di';
|
|
80
|
-
import {
|
|
78
|
+
import { UnionToArray } from '@navios/di';
|
|
79
|
+
import { UnionToIntersection } from '@navios/di';
|
|
80
|
+
import { UnionToOvlds } from '@navios/di';
|
|
81
81
|
import { UnknownError } from '@navios/di';
|
|
82
82
|
import type { Util_FlatObject } from '@navios/builder';
|
|
83
83
|
import { wrapSyncInit } from '@navios/di';
|
|
@@ -86,16 +86,115 @@ import { ZodDiscriminatedUnion } from 'zod/v4';
|
|
|
86
86
|
import type { ZodObject } from 'zod/v4';
|
|
87
87
|
import type { ZodType } from 'zod/v4';
|
|
88
88
|
|
|
89
|
+
declare interface AbstractExecutionContext {
|
|
90
|
+
getModule(): ModuleMetadata;
|
|
91
|
+
getController(): ControllerMetadata;
|
|
92
|
+
getHandler(): HandlerMetadata;
|
|
93
|
+
getRequest(): any;
|
|
94
|
+
getReply(): any;
|
|
95
|
+
}
|
|
96
|
+
export { AbstractExecutionContext }
|
|
97
|
+
export { AbstractExecutionContext as AbstractExecutionContext_alias_1 }
|
|
98
|
+
export { AbstractExecutionContext as AbstractExecutionContext_alias_2 }
|
|
99
|
+
|
|
100
|
+
declare interface AbstractHttpAdapterInterface<ServerInstance, CorsOptions = AbstractHttpCorsOptions, Options = {}, MultipartOptions = {}> {
|
|
101
|
+
setupHttpServer(options: Options): Promise<void>;
|
|
102
|
+
onModulesInit(modules: Map<string, ModuleMetadata>): Promise<void>;
|
|
103
|
+
ready(): Promise<void>;
|
|
104
|
+
getServer(): ServerInstance;
|
|
105
|
+
setGlobalPrefix(prefix: string): void;
|
|
106
|
+
enableCors(options: CorsOptions): void;
|
|
107
|
+
enableMultipart(options: MultipartOptions): void;
|
|
108
|
+
listen(options: AbstractHttpListenOptions): Promise<string>;
|
|
109
|
+
dispose(): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
export { AbstractHttpAdapterInterface }
|
|
112
|
+
export { AbstractHttpAdapterInterface as AbstractHttpAdapterInterface_alias_1 }
|
|
113
|
+
export { AbstractHttpAdapterInterface as AbstractHttpAdapterInterface_alias_2 }
|
|
114
|
+
|
|
115
|
+
declare interface AbstractHttpCorsOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Configures the Access-Control-Allow-Origin CORS header.
|
|
118
|
+
*/
|
|
119
|
+
origin?: ValueOrArray<OriginType>;
|
|
120
|
+
/**
|
|
121
|
+
* Configures the Access-Control-Allow-Credentials CORS header.
|
|
122
|
+
* Set to true to pass the header, otherwise it is omitted.
|
|
123
|
+
*/
|
|
124
|
+
credentials?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Configures the Access-Control-Expose-Headers CORS header.
|
|
127
|
+
* Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range')
|
|
128
|
+
* or an array (ex: ['Content-Range', 'X-Content-Range']).
|
|
129
|
+
* If not specified, no custom headers are exposed.
|
|
130
|
+
*/
|
|
131
|
+
exposedHeaders?: string | string[];
|
|
132
|
+
/**
|
|
133
|
+
* Configures the Access-Control-Allow-Headers CORS header.
|
|
134
|
+
* Expects a comma-delimited string (ex: 'Content-Type,Authorization')
|
|
135
|
+
* or an array (ex: ['Content-Type', 'Authorization']). If not
|
|
136
|
+
* specified, defaults to reflecting the headers specified in the
|
|
137
|
+
* request's Access-Control-Request-Headers header.
|
|
138
|
+
*/
|
|
139
|
+
allowedHeaders?: string | string[];
|
|
140
|
+
/**
|
|
141
|
+
* Configures the Access-Control-Allow-Methods CORS header.
|
|
142
|
+
* Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: ['GET', 'PUT', 'POST']).
|
|
143
|
+
*/
|
|
144
|
+
methods?: string | string[];
|
|
145
|
+
/**
|
|
146
|
+
* Configures the Access-Control-Max-Age CORS header.
|
|
147
|
+
* Set to an integer to pass the header, otherwise it is omitted.
|
|
148
|
+
*/
|
|
149
|
+
maxAge?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Configures the Cache-Control header for CORS preflight responses.
|
|
152
|
+
* Set to an integer to pass the header as `Cache-Control: max-age=${cacheControl}`,
|
|
153
|
+
* or set to a string to pass the header as `Cache-Control: ${cacheControl}` (fully define
|
|
154
|
+
* the header value), otherwise the header is omitted.
|
|
155
|
+
*/
|
|
156
|
+
cacheControl?: number | string;
|
|
157
|
+
/**
|
|
158
|
+
* Sets the Fastify log level specifically for the internal OPTIONS route
|
|
159
|
+
* used to handle CORS preflight requests. For example, setting this to `'silent'`
|
|
160
|
+
* will prevent these requests from being logged.
|
|
161
|
+
* Useful for reducing noise in application logs.
|
|
162
|
+
* Default: inherits Fastify's global log level.
|
|
163
|
+
*/
|
|
164
|
+
logLevel?: LogLevel;
|
|
165
|
+
}
|
|
166
|
+
export { AbstractHttpCorsOptions }
|
|
167
|
+
export { AbstractHttpCorsOptions as AbstractHttpCorsOptions_alias_1 }
|
|
168
|
+
export { AbstractHttpCorsOptions as AbstractHttpCorsOptions_alias_2 }
|
|
169
|
+
|
|
170
|
+
declare interface AbstractHttpHandlerAdapterInterface {
|
|
171
|
+
prepareArguments?: (handlerMetadata: HandlerMetadata<any>) => ((target: Record<string, any>, request: any) => Promise<void> | void)[];
|
|
172
|
+
provideHandler: (controller: ClassType, handlerMetadata: HandlerMetadata<any>) => (context: RequestContextHolder, request: any, reply: any) => Promise<any>;
|
|
173
|
+
}
|
|
174
|
+
export { AbstractHttpHandlerAdapterInterface }
|
|
175
|
+
export { AbstractHttpHandlerAdapterInterface as AbstractHttpHandlerAdapterInterface_alias_1 }
|
|
176
|
+
export { AbstractHttpHandlerAdapterInterface as AbstractHttpHandlerAdapterInterface_alias_2 }
|
|
177
|
+
|
|
178
|
+
declare interface AbstractHttpListenOptions {
|
|
179
|
+
port: number;
|
|
180
|
+
host?: string;
|
|
181
|
+
}
|
|
182
|
+
export { AbstractHttpListenOptions }
|
|
183
|
+
export { AbstractHttpListenOptions as AbstractHttpListenOptions_alias_1 }
|
|
184
|
+
export { AbstractHttpListenOptions as AbstractHttpListenOptions_alias_2 }
|
|
185
|
+
|
|
89
186
|
declare const addLeadingSlash: (path?: string) => string;
|
|
90
187
|
export { addLeadingSlash }
|
|
91
188
|
export { addLeadingSlash as addLeadingSlash_alias_1 }
|
|
92
189
|
export { addLeadingSlash as addLeadingSlash_alias_2 }
|
|
93
190
|
export { addLeadingSlash as addLeadingSlash_alias_3 }
|
|
94
191
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
192
|
+
export { AnyInjectableType }
|
|
193
|
+
|
|
194
|
+
declare interface ArrayOfValueOrArray<T> extends Array<ValueOrArray<T>> {
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export { asyncInject }
|
|
99
198
|
|
|
100
199
|
declare class AttributeFactory {
|
|
101
200
|
static createAttribute(token: symbol): ClassAttribute;
|
|
@@ -121,10 +220,12 @@ export { BadRequestException as BadRequestException_alias_2 }
|
|
|
121
220
|
|
|
122
221
|
export { BaseInjectionTokenSchemaType }
|
|
123
222
|
|
|
223
|
+
export { BaseInstanceHolderManager }
|
|
224
|
+
|
|
124
225
|
export { BoundInjectionToken }
|
|
125
226
|
|
|
126
227
|
declare interface CanActivate {
|
|
127
|
-
canActivate(executionContext:
|
|
228
|
+
canActivate(executionContext: AbstractExecutionContext): Promise<boolean> | boolean;
|
|
128
229
|
}
|
|
129
230
|
export { CanActivate }
|
|
130
231
|
export { CanActivate as CanActivate_alias_1 }
|
|
@@ -234,10 +335,6 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
234
335
|
* The context of the logger (can be set manually or automatically inferred).
|
|
235
336
|
*/
|
|
236
337
|
protected context?: string;
|
|
237
|
-
/**
|
|
238
|
-
* Request ID (if enabled).
|
|
239
|
-
*/
|
|
240
|
-
protected requestId: string | null;
|
|
241
338
|
/**
|
|
242
339
|
* The original context of the logger (set in the constructor).
|
|
243
340
|
*/
|
|
@@ -249,11 +346,11 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
249
346
|
/**
|
|
250
347
|
* The last timestamp at which the log message was printed.
|
|
251
348
|
*/
|
|
252
|
-
protected
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
349
|
+
protected lastTimestampAt?: number;
|
|
350
|
+
setup(): void;
|
|
351
|
+
setup(context: string): void;
|
|
352
|
+
setup(options: ConsoleLoggerOptions): void;
|
|
353
|
+
setup(context: string, options: ConsoleLoggerOptions): void;
|
|
257
354
|
/**
|
|
258
355
|
* Write a 'log' level log, if the configured level allows for it.
|
|
259
356
|
* Prints to `stdout` with newline.
|
|
@@ -307,17 +404,18 @@ declare class ConsoleLogger implements LoggerService {
|
|
|
307
404
|
resetContext(): void;
|
|
308
405
|
isLevelEnabled(level: LogLevel): boolean;
|
|
309
406
|
protected getTimestamp(): string;
|
|
310
|
-
protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, writeStreamType?: 'stdout' | 'stderr', errorStack?: unknown): void;
|
|
407
|
+
protected printMessages(messages: unknown[], context?: string, logLevel?: LogLevel, requestId?: string, writeStreamType?: 'stdout' | 'stderr', errorStack?: unknown): void;
|
|
311
408
|
protected printAsJson(message: unknown, options: {
|
|
312
409
|
context: string;
|
|
313
410
|
logLevel: LogLevel;
|
|
314
411
|
writeStreamType?: 'stdout' | 'stderr';
|
|
315
412
|
errorStack?: unknown;
|
|
413
|
+
requestId?: string;
|
|
316
414
|
}): void;
|
|
317
415
|
protected formatPid(pid: number): string;
|
|
318
416
|
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;
|
|
417
|
+
protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string, requestId?: string): string;
|
|
418
|
+
protected getRequestId(requestId?: string): string;
|
|
321
419
|
protected stringifyMessage(message: unknown, logLevel: LogLevel): string;
|
|
322
420
|
protected colorize(message: string, logLevel: LogLevel): string;
|
|
323
421
|
protected printStackTrace(stack: string): void;
|
|
@@ -420,22 +518,13 @@ export { ConsoleLoggerOptions }
|
|
|
420
518
|
export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_1 }
|
|
421
519
|
export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_2 }
|
|
422
520
|
|
|
521
|
+
export { Container }
|
|
522
|
+
|
|
423
523
|
declare function Controller({ guards }?: ControllerOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
|
|
424
524
|
export { Controller }
|
|
425
525
|
export { Controller as Controller_alias_1 }
|
|
426
526
|
export { Controller as Controller_alias_2 }
|
|
427
527
|
|
|
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
528
|
declare interface ControllerMetadata {
|
|
440
529
|
endpoints: Set<HandlerMetadata>;
|
|
441
530
|
guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
@@ -457,7 +546,15 @@ export { ControllerOptions }
|
|
|
457
546
|
export { ControllerOptions as ControllerOptions_alias_1 }
|
|
458
547
|
export { ControllerOptions as ControllerOptions_alias_2 }
|
|
459
548
|
|
|
460
|
-
export {
|
|
549
|
+
export { createDeferred }
|
|
550
|
+
|
|
551
|
+
export { createRequestContextHolder }
|
|
552
|
+
|
|
553
|
+
export { defaultInjectors }
|
|
554
|
+
|
|
555
|
+
export { DefaultRequestContextHolder }
|
|
556
|
+
|
|
557
|
+
export { Deferred }
|
|
461
558
|
|
|
462
559
|
declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
463
560
|
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
@@ -466,16 +563,15 @@ export { Endpoint }
|
|
|
466
563
|
export { Endpoint as Endpoint_alias_1 }
|
|
467
564
|
export { Endpoint as Endpoint_alias_2 }
|
|
468
565
|
|
|
469
|
-
declare class
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
provideHandler(controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<BaseEndpointConfig>): (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
|
|
566
|
+
declare class EndpointAdapterFactory {
|
|
567
|
+
private readonly environment;
|
|
568
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
473
569
|
}
|
|
474
|
-
export {
|
|
475
|
-
export {
|
|
476
|
-
export {
|
|
570
|
+
export { EndpointAdapterFactory }
|
|
571
|
+
export { EndpointAdapterFactory as EndpointAdapterFactory_alias_1 }
|
|
572
|
+
export { EndpointAdapterFactory as EndpointAdapterFactory_alias_2 }
|
|
477
573
|
|
|
478
|
-
declare const EndpointAdapterToken: InjectionToken<
|
|
574
|
+
declare const EndpointAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
479
575
|
export { EndpointAdapterToken }
|
|
480
576
|
export { EndpointAdapterToken as EndpointAdapterToken_alias_1 }
|
|
481
577
|
export { EndpointAdapterToken as EndpointAdapterToken_alias_2 }
|
|
@@ -532,21 +628,7 @@ declare type ExcludedKeys = 'computedTimeRates' | 'aiModelsRates' | 'aiModel';
|
|
|
532
628
|
|
|
533
629
|
declare type ExcludedParts = 'services' | 'mailer' | 'aws' | 'computedTimeRates' | 'aiModelsRates';
|
|
534
630
|
|
|
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
|
-
}
|
|
631
|
+
declare const ExecutionContext: InjectionToken<AbstractExecutionContext, undefined, false>;
|
|
550
632
|
export { ExecutionContext }
|
|
551
633
|
export { ExecutionContext as ExecutionContext_alias_1 }
|
|
552
634
|
export { ExecutionContext as ExecutionContext_alias_2 }
|
|
@@ -556,11 +638,6 @@ export { ExecutionContextInjectionToken }
|
|
|
556
638
|
export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_1 }
|
|
557
639
|
export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_2 }
|
|
558
640
|
|
|
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
641
|
declare function extractControllerMetadata(target: ClassType): ControllerMetadata;
|
|
565
642
|
export { extractControllerMetadata }
|
|
566
643
|
export { extractControllerMetadata as extractControllerMetadata_alias_1 }
|
|
@@ -571,6 +648,10 @@ export { extractModuleMetadata }
|
|
|
571
648
|
export { extractModuleMetadata as extractModuleMetadata_alias_1 }
|
|
572
649
|
export { extractModuleMetadata as extractModuleMetadata_alias_2 }
|
|
573
650
|
|
|
651
|
+
export { Factorable }
|
|
652
|
+
|
|
653
|
+
export { FactorableWithArgs }
|
|
654
|
+
|
|
574
655
|
export { Factory }
|
|
575
656
|
|
|
576
657
|
export { FactoryContext }
|
|
@@ -579,12 +660,12 @@ export { FactoryInjectionToken }
|
|
|
579
660
|
|
|
580
661
|
export { FactoryNotFound }
|
|
581
662
|
|
|
663
|
+
export { FactoryOptions }
|
|
664
|
+
|
|
582
665
|
export { FactoryRecord }
|
|
583
666
|
|
|
584
667
|
export { FactoryTokenNotResolved }
|
|
585
668
|
|
|
586
|
-
export { FactoryWithArgs }
|
|
587
|
-
|
|
588
669
|
/**
|
|
589
670
|
* @publicApi
|
|
590
671
|
*/
|
|
@@ -616,8 +697,6 @@ export { getEndpointMetadata }
|
|
|
616
697
|
export { getEndpointMetadata as getEndpointMetadata_alias_1 }
|
|
617
698
|
export { getEndpointMetadata as getEndpointMetadata_alias_2 }
|
|
618
699
|
|
|
619
|
-
export { getGlobalServiceLocator }
|
|
620
|
-
|
|
621
700
|
export { getInjectableToken }
|
|
622
701
|
|
|
623
702
|
export { getInjectors }
|
|
@@ -630,28 +709,19 @@ export { getModuleMetadata as getModuleMetadata_alias_2 }
|
|
|
630
709
|
export { globalRegistry }
|
|
631
710
|
|
|
632
711
|
declare class GuardRunnerService {
|
|
633
|
-
|
|
634
|
-
|
|
712
|
+
protected container: Container;
|
|
713
|
+
runGuards(allGuards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>, executionContext: AbstractExecutionContext): Promise<boolean>;
|
|
714
|
+
makeContext(moduleMetadata: ModuleMetadata, controllerMetadata: ControllerMetadata, endpoint: HandlerMetadata): Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
|
|
635
715
|
}
|
|
636
716
|
export { GuardRunnerService }
|
|
637
717
|
export { GuardRunnerService as GuardRunnerService_alias_1 }
|
|
638
718
|
export { GuardRunnerService as GuardRunnerService_alias_2 }
|
|
639
719
|
|
|
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
720
|
declare interface HandlerMetadata<Config = null> {
|
|
651
721
|
classMethod: string;
|
|
652
722
|
url: string;
|
|
653
723
|
successStatusCode: number;
|
|
654
|
-
adapterToken: InjectionToken<
|
|
724
|
+
adapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined> | ClassTypeWithInstance<AbstractHttpHandlerAdapterInterface> | null;
|
|
655
725
|
headers: Partial<Record<HttpHeader, number | string | string[] | undefined>>;
|
|
656
726
|
httpMethod: HttpMethod;
|
|
657
727
|
config: Config;
|
|
@@ -677,6 +747,19 @@ export { Header }
|
|
|
677
747
|
export { Header as Header_alias_1 }
|
|
678
748
|
export { Header as Header_alias_2 }
|
|
679
749
|
|
|
750
|
+
declare class HttpAdapterFactory {
|
|
751
|
+
private readonly environment;
|
|
752
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
753
|
+
}
|
|
754
|
+
export { HttpAdapterFactory }
|
|
755
|
+
export { HttpAdapterFactory as HttpAdapterFactory_alias_1 }
|
|
756
|
+
export { HttpAdapterFactory as HttpAdapterFactory_alias_2 }
|
|
757
|
+
|
|
758
|
+
declare const HttpAdapterToken: InjectionToken<AbstractHttpAdapterInterface<any, any, any, any>, undefined, false>;
|
|
759
|
+
export { HttpAdapterToken }
|
|
760
|
+
export { HttpAdapterToken as HttpAdapterToken_alias_1 }
|
|
761
|
+
export { HttpAdapterToken as HttpAdapterToken_alias_2 }
|
|
762
|
+
|
|
680
763
|
declare function HttpCode(code: number): <T extends Function>(target: T, context: ClassMethodDecoratorContext) => T;
|
|
681
764
|
export { HttpCode }
|
|
682
765
|
export { HttpCode as HttpCode_alias_1 }
|
|
@@ -692,6 +775,15 @@ export { HttpException }
|
|
|
692
775
|
export { HttpException as HttpException_alias_1 }
|
|
693
776
|
export { HttpException as HttpException_alias_2 }
|
|
694
777
|
|
|
778
|
+
/**
|
|
779
|
+
* HTTP header strings
|
|
780
|
+
* Use this type only for input values, not for output values.
|
|
781
|
+
*/
|
|
782
|
+
declare type HttpHeader = keyof OmitIndexSignature<OutgoingHttpHeaders> | (string & Record<never, never>);
|
|
783
|
+
export { HttpHeader }
|
|
784
|
+
export { HttpHeader as HttpHeader_alias_1 }
|
|
785
|
+
export { HttpHeader as HttpHeader_alias_2 }
|
|
786
|
+
|
|
695
787
|
export { inject }
|
|
696
788
|
|
|
697
789
|
export { Injectable }
|
|
@@ -704,15 +796,15 @@ export { InjectableTokenMeta }
|
|
|
704
796
|
|
|
705
797
|
export { InjectableType }
|
|
706
798
|
|
|
707
|
-
export { InjectionFactory }
|
|
708
|
-
|
|
709
799
|
export { InjectionToken }
|
|
710
800
|
|
|
711
801
|
export { InjectionTokenSchemaType }
|
|
712
802
|
|
|
803
|
+
export { InjectionTokenType }
|
|
804
|
+
|
|
713
805
|
export { Injectors }
|
|
714
806
|
|
|
715
|
-
export {
|
|
807
|
+
export { InjectState }
|
|
716
808
|
|
|
717
809
|
export { InstanceDestroying }
|
|
718
810
|
|
|
@@ -813,6 +905,10 @@ export { isUndefined as isUndefined_alias_1 }
|
|
|
813
905
|
export { isUndefined as isUndefined_alias_2 }
|
|
814
906
|
export { isUndefined as isUndefined_alias_3 }
|
|
815
907
|
|
|
908
|
+
export { IsUnion }
|
|
909
|
+
|
|
910
|
+
export { Join }
|
|
911
|
+
|
|
816
912
|
declare const LOG_LEVELS: ["verbose", "debug", "log", "warn", "error", "fatal"];
|
|
817
913
|
export { LOG_LEVELS }
|
|
818
914
|
export { LOG_LEVELS as LOG_LEVELS_alias_1 }
|
|
@@ -820,40 +916,15 @@ export { LOG_LEVELS as LOG_LEVELS_alias_2 }
|
|
|
820
916
|
|
|
821
917
|
declare const Logger: InjectionToken<LoggerInstance, z.ZodOptional<z.ZodObject<{
|
|
822
918
|
context: z.ZodOptional<z.ZodString>;
|
|
823
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
824
|
-
timestamp: z.ZodOptional<z.ZodBoolean>;
|
|
825
|
-
}, z.core.$strip>>;
|
|
826
919
|
}, z.core.$strip>>, false>;
|
|
827
920
|
export { Logger }
|
|
828
921
|
export { Logger as Logger_alias_1 }
|
|
829
922
|
export { Logger as Logger_alias_2 }
|
|
830
923
|
|
|
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
924
|
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;
|
|
925
|
+
protected localInstance: LoggerService;
|
|
926
|
+
protected context?: string;
|
|
927
|
+
constructor(config?: LoggerOptions);
|
|
857
928
|
/**
|
|
858
929
|
* Write an 'error' level log.
|
|
859
930
|
*/
|
|
@@ -884,58 +955,28 @@ declare class LoggerInstance implements LoggerService {
|
|
|
884
955
|
*/
|
|
885
956
|
fatal(message: any, context?: string): void;
|
|
886
957
|
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
958
|
}
|
|
925
959
|
export { LoggerInstance }
|
|
926
960
|
export { LoggerInstance as LoggerInstance_alias_1 }
|
|
927
961
|
export { LoggerInstance as LoggerInstance_alias_2 }
|
|
928
962
|
|
|
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>>;
|
|
963
|
+
declare type LoggerOptions = z.infer<typeof loggerOptionsSchema>;
|
|
935
964
|
export { LoggerOptions }
|
|
936
965
|
export { LoggerOptions as LoggerOptions_alias_1 }
|
|
937
966
|
export { LoggerOptions as LoggerOptions_alias_2 }
|
|
938
967
|
|
|
968
|
+
declare const loggerOptionsSchema: z.ZodOptional<z.ZodObject<{
|
|
969
|
+
context: z.ZodOptional<z.ZodString>;
|
|
970
|
+
}, z.core.$strip>>;
|
|
971
|
+
export { loggerOptionsSchema }
|
|
972
|
+
export { loggerOptionsSchema as loggerOptionsSchema_alias_1 }
|
|
973
|
+
export { loggerOptionsSchema as loggerOptionsSchema_alias_2 }
|
|
974
|
+
|
|
975
|
+
declare const LoggerOutput: InjectionToken<LoggerService, undefined, false>;
|
|
976
|
+
export { LoggerOutput }
|
|
977
|
+
export { LoggerOutput as LoggerOutput_alias_1 }
|
|
978
|
+
export { LoggerOutput as LoggerOutput_alias_2 }
|
|
979
|
+
|
|
939
980
|
/**
|
|
940
981
|
* @publicApi
|
|
941
982
|
*/
|
|
@@ -982,8 +1023,6 @@ export { LogLevel }
|
|
|
982
1023
|
export { LogLevel as LogLevel_alias_1 }
|
|
983
1024
|
export { LogLevel as LogLevel_alias_2 }
|
|
984
1025
|
|
|
985
|
-
export { makeProxyServiceLocator }
|
|
986
|
-
|
|
987
1026
|
declare function Module({ controllers, imports, guards }?: ModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
|
|
988
1027
|
export { Module }
|
|
989
1028
|
export { Module as Module_alias_1 }
|
|
@@ -991,6 +1030,7 @@ export { Module as Module_alias_2 }
|
|
|
991
1030
|
|
|
992
1031
|
declare class ModuleLoaderService {
|
|
993
1032
|
private logger;
|
|
1033
|
+
protected container: Container;
|
|
994
1034
|
private modulesMetadata;
|
|
995
1035
|
private loadedModules;
|
|
996
1036
|
private initialized;
|
|
@@ -1035,17 +1075,15 @@ export { Multipart }
|
|
|
1035
1075
|
export { Multipart as Multipart_alias_1 }
|
|
1036
1076
|
export { Multipart as Multipart_alias_2 }
|
|
1037
1077
|
|
|
1038
|
-
declare class
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
private analyzeSchema;
|
|
1042
|
-
provideSchema(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): Record<string, any>;
|
|
1078
|
+
declare class MultipartAdapterFactory {
|
|
1079
|
+
private readonly environment;
|
|
1080
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1043
1081
|
}
|
|
1044
|
-
export {
|
|
1045
|
-
export {
|
|
1046
|
-
export {
|
|
1082
|
+
export { MultipartAdapterFactory }
|
|
1083
|
+
export { MultipartAdapterFactory as MultipartAdapterFactory_alias_1 }
|
|
1084
|
+
export { MultipartAdapterFactory as MultipartAdapterFactory_alias_2 }
|
|
1047
1085
|
|
|
1048
|
-
declare const MultipartAdapterToken: InjectionToken<
|
|
1086
|
+
declare const MultipartAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
1049
1087
|
export { MultipartAdapterToken }
|
|
1050
1088
|
export { MultipartAdapterToken as MultipartAdapterToken_alias_1 }
|
|
1051
1089
|
export { MultipartAdapterToken as MultipartAdapterToken_alias_2 }
|
|
@@ -1065,27 +1103,23 @@ export { MultipartResult as MultipartResult_alias_1 }
|
|
|
1065
1103
|
export { MultipartResult as MultipartResult_alias_2 }
|
|
1066
1104
|
|
|
1067
1105
|
declare class NaviosApplication {
|
|
1106
|
+
private environment;
|
|
1068
1107
|
private moduleLoader;
|
|
1069
|
-
private
|
|
1108
|
+
private httpApplication;
|
|
1070
1109
|
private logger;
|
|
1071
|
-
|
|
1072
|
-
private corsOptions;
|
|
1073
|
-
private multipartOptions;
|
|
1074
|
-
private globalPrefix;
|
|
1110
|
+
protected container: Container;
|
|
1075
1111
|
private appModule;
|
|
1076
1112
|
private options;
|
|
1077
1113
|
isInitialized: boolean;
|
|
1078
|
-
setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): void
|
|
1114
|
+
setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<void>;
|
|
1115
|
+
getContainer(): Container;
|
|
1079
1116
|
init(): Promise<void>;
|
|
1080
|
-
private getFastifyInstance;
|
|
1081
|
-
private configureFastifyInstance;
|
|
1082
|
-
configureMultipart(server: FastifyInstance, options: FastifyMultipartOptions | true): Promise<void>;
|
|
1083
1117
|
private initModules;
|
|
1084
|
-
enableCors(options:
|
|
1085
|
-
enableMultipart(options:
|
|
1118
|
+
enableCors(options: any): void;
|
|
1119
|
+
enableMultipart(options: any): void;
|
|
1086
1120
|
setGlobalPrefix(prefix: string): void;
|
|
1087
|
-
getServer():
|
|
1088
|
-
listen(options:
|
|
1121
|
+
getServer(): any;
|
|
1122
|
+
listen(options: AbstractHttpListenOptions): Promise<void>;
|
|
1089
1123
|
dispose(): Promise<void>;
|
|
1090
1124
|
close(): Promise<void>;
|
|
1091
1125
|
}
|
|
@@ -1101,13 +1135,26 @@ declare interface NaviosApplicationContextOptions {
|
|
|
1101
1135
|
export { NaviosApplicationContextOptions }
|
|
1102
1136
|
export { NaviosApplicationContextOptions as NaviosApplicationContextOptions_alias_1 }
|
|
1103
1137
|
|
|
1104
|
-
declare interface NaviosApplicationOptions extends
|
|
1138
|
+
declare interface NaviosApplicationOptions extends NaviosApplicationContextOptions {
|
|
1139
|
+
adapter: NaviosEnvironmentOptions | NaviosEnvironmentOptions[];
|
|
1105
1140
|
}
|
|
1106
1141
|
export { NaviosApplicationOptions }
|
|
1107
1142
|
export { NaviosApplicationOptions as NaviosApplicationOptions_alias_1 }
|
|
1108
1143
|
|
|
1144
|
+
export declare class NaviosEnvironment {
|
|
1145
|
+
private httpTokens;
|
|
1146
|
+
setupHttpEnvironment(tokens: Map<InjectionToken<any, undefined>, AnyInjectableType>): void;
|
|
1147
|
+
getHttpToken(token: InjectionToken<any, undefined>): AnyInjectableType | undefined;
|
|
1148
|
+
hasHttpSetup(): boolean;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export declare interface NaviosEnvironmentOptions {
|
|
1152
|
+
httpTokens?: Map<InjectionToken<any, undefined>, AnyInjectableType>;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1109
1155
|
declare class NaviosFactory {
|
|
1110
1156
|
static create(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<NaviosApplication>;
|
|
1157
|
+
private static registerEnvironment;
|
|
1111
1158
|
private static registerLoggerConfiguration;
|
|
1112
1159
|
}
|
|
1113
1160
|
export { NaviosFactory }
|
|
@@ -1135,8 +1182,21 @@ export { NotFoundException }
|
|
|
1135
1182
|
export { NotFoundException as NotFoundException_alias_1 }
|
|
1136
1183
|
export { NotFoundException as NotFoundException_alias_2 }
|
|
1137
1184
|
|
|
1185
|
+
declare type OmitIndexSignature<T> = {
|
|
1186
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
1187
|
+
};
|
|
1188
|
+
export { OmitIndexSignature }
|
|
1189
|
+
export { OmitIndexSignature as OmitIndexSignature_alias_1 }
|
|
1190
|
+
export { OmitIndexSignature as OmitIndexSignature_alias_2 }
|
|
1191
|
+
|
|
1192
|
+
export { OnServiceDestroy }
|
|
1193
|
+
|
|
1194
|
+
export { OnServiceInit }
|
|
1195
|
+
|
|
1138
1196
|
export { OptionalInjectionTokenSchemaType }
|
|
1139
1197
|
|
|
1198
|
+
declare type OriginType = string | boolean | RegExp;
|
|
1199
|
+
|
|
1140
1200
|
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
1201
|
export { Path }
|
|
1142
1202
|
export { Path as Path_alias_1 }
|
|
@@ -1157,45 +1217,46 @@ export { PathValue }
|
|
|
1157
1217
|
export { PathValue as PathValue_alias_1 }
|
|
1158
1218
|
export { PathValue as PathValue_alias_2 }
|
|
1159
1219
|
|
|
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 }
|
|
1220
|
+
export { PopUnion }
|
|
1176
1221
|
|
|
1177
1222
|
declare function provideConfig<ConfigMap extends ConfigServiceOptions>(options: z.input<typeof ConfigProviderOptions>): FactoryInjectionToken<ConfigService<ConfigMap>, typeof ConfigServiceOptionsSchema>;
|
|
1178
1223
|
export { provideConfig }
|
|
1179
1224
|
export { provideConfig as provideConfig_alias_1 }
|
|
1180
1225
|
export { provideConfig as provideConfig_alias_2 }
|
|
1181
1226
|
|
|
1182
|
-
export {
|
|
1183
|
-
|
|
1184
|
-
export { ProxyServiceLocator }
|
|
1227
|
+
export { provideFactoryContext }
|
|
1185
1228
|
|
|
1186
1229
|
export { Registry }
|
|
1187
1230
|
|
|
1188
|
-
declare const Reply: InjectionToken<
|
|
1231
|
+
declare const Reply: InjectionToken<any, undefined, false>;
|
|
1189
1232
|
export { Reply }
|
|
1190
1233
|
export { Reply as Reply_alias_1 }
|
|
1191
1234
|
export { Reply as Reply_alias_2 }
|
|
1192
1235
|
|
|
1193
|
-
declare
|
|
1236
|
+
declare class ReplyFactory {
|
|
1237
|
+
private readonly environment;
|
|
1238
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1239
|
+
}
|
|
1240
|
+
export { ReplyFactory }
|
|
1241
|
+
export { ReplyFactory as ReplyFactory_alias_1 }
|
|
1242
|
+
export { ReplyFactory as ReplyFactory_alias_2 }
|
|
1243
|
+
|
|
1244
|
+
declare const Request_2: InjectionToken<any, undefined, false>;
|
|
1194
1245
|
export { Request_2 as Request }
|
|
1195
1246
|
export { Request_2 as Request_alias_1 }
|
|
1196
1247
|
export { Request_2 as Request_alias_2 }
|
|
1197
1248
|
|
|
1198
|
-
export {
|
|
1249
|
+
export { RequestContextHolder }
|
|
1250
|
+
|
|
1251
|
+
declare class RequestFactory {
|
|
1252
|
+
private readonly environment;
|
|
1253
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1254
|
+
}
|
|
1255
|
+
export { RequestFactory }
|
|
1256
|
+
export { RequestFactory as RequestFactory_alias_1 }
|
|
1257
|
+
export { RequestFactory as RequestFactory_alias_2 }
|
|
1258
|
+
|
|
1259
|
+
export { ServiceInstantiator }
|
|
1199
1260
|
|
|
1200
1261
|
export { ServiceLocator }
|
|
1201
1262
|
|
|
@@ -1213,7 +1274,7 @@ export { ServiceLocatorInstanceHolderCreating }
|
|
|
1213
1274
|
|
|
1214
1275
|
export { ServiceLocatorInstanceHolderDestroying }
|
|
1215
1276
|
|
|
1216
|
-
export {
|
|
1277
|
+
export { ServiceLocatorInstanceHolderError }
|
|
1217
1278
|
|
|
1218
1279
|
export { ServiceLocatorInstanceHolderStatus }
|
|
1219
1280
|
|
|
@@ -1221,22 +1282,20 @@ export { ServiceLocatorManager }
|
|
|
1221
1282
|
|
|
1222
1283
|
declare function Stream<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, RequestSchema = ZodType>(endpoint: {
|
|
1223
1284
|
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:
|
|
1285
|
+
}): (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
1286
|
export { Stream }
|
|
1226
1287
|
export { Stream as Stream_alias_1 }
|
|
1227
1288
|
export { Stream as Stream_alias_2 }
|
|
1228
1289
|
|
|
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>;
|
|
1290
|
+
declare class StreamAdapterFactory {
|
|
1291
|
+
private readonly environment;
|
|
1292
|
+
create(ctx: FactoryContext): Promise<any>;
|
|
1234
1293
|
}
|
|
1235
|
-
export {
|
|
1236
|
-
export {
|
|
1237
|
-
export {
|
|
1294
|
+
export { StreamAdapterFactory }
|
|
1295
|
+
export { StreamAdapterFactory as StreamAdapterFactory_alias_1 }
|
|
1296
|
+
export { StreamAdapterFactory as StreamAdapterFactory_alias_2 }
|
|
1238
1297
|
|
|
1239
|
-
declare const StreamAdapterToken: InjectionToken<
|
|
1298
|
+
declare const StreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
|
|
1240
1299
|
export { StreamAdapterToken }
|
|
1241
1300
|
export { StreamAdapterToken as StreamAdapterToken_alias_1 }
|
|
1242
1301
|
export { StreamAdapterToken as StreamAdapterToken_alias_2 }
|
|
@@ -1254,8 +1313,6 @@ export { stripEndSlash as stripEndSlash_alias_1 }
|
|
|
1254
1313
|
export { stripEndSlash as stripEndSlash_alias_2 }
|
|
1255
1314
|
export { stripEndSlash as stripEndSlash_alias_3 }
|
|
1256
1315
|
|
|
1257
|
-
export { syncInject }
|
|
1258
|
-
|
|
1259
1316
|
declare class UnauthorizedException extends HttpException {
|
|
1260
1317
|
constructor(message: string | object, error?: Error);
|
|
1261
1318
|
}
|
|
@@ -1263,6 +1320,12 @@ export { UnauthorizedException }
|
|
|
1263
1320
|
export { UnauthorizedException as UnauthorizedException_alias_1 }
|
|
1264
1321
|
export { UnauthorizedException as UnauthorizedException_alias_2 }
|
|
1265
1322
|
|
|
1323
|
+
export { UnionToArray }
|
|
1324
|
+
|
|
1325
|
+
export { UnionToIntersection }
|
|
1326
|
+
|
|
1327
|
+
export { UnionToOvlds }
|
|
1328
|
+
|
|
1266
1329
|
export { UnknownError }
|
|
1267
1330
|
|
|
1268
1331
|
declare function UseGuards(...guards: (ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>)[]): <T extends Function>(target: T, context: ClassMethodDecoratorContext | ClassDecoratorContext) => T;
|
|
@@ -1270,6 +1333,8 @@ export { UseGuards }
|
|
|
1270
1333
|
export { UseGuards as UseGuards_alias_1 }
|
|
1271
1334
|
export { UseGuards as UseGuards_alias_2 }
|
|
1272
1335
|
|
|
1336
|
+
declare type ValueOrArray<T> = T | ArrayOfValueOrArray<T>;
|
|
1337
|
+
|
|
1273
1338
|
export { wrapSyncInit }
|
|
1274
1339
|
|
|
1275
1340
|
declare const yellow: (text: string) => string;
|