@navios/core 0.3.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.
Files changed (96) hide show
  1. package/README.md +96 -3
  2. package/docs/README.md +310 -3
  3. package/docs/adapters.md +308 -0
  4. package/docs/application-setup.md +524 -0
  5. package/docs/attributes.md +689 -0
  6. package/docs/controllers.md +373 -0
  7. package/docs/endpoints.md +444 -0
  8. package/docs/exceptions.md +316 -0
  9. package/docs/guards.md +550 -0
  10. package/docs/modules.md +251 -0
  11. package/docs/quick-start.md +295 -0
  12. package/docs/services.md +428 -0
  13. package/docs/testing.md +704 -0
  14. package/lib/_tsup-dts-rollup.d.mts +313 -280
  15. package/lib/_tsup-dts-rollup.d.ts +313 -280
  16. package/lib/index.d.mts +47 -26
  17. package/lib/index.d.ts +47 -26
  18. package/lib/index.js +633 -1068
  19. package/lib/index.js.map +1 -1
  20. package/lib/index.mjs +632 -1061
  21. package/lib/index.mjs.map +1 -1
  22. package/package.json +11 -12
  23. package/project.json +17 -4
  24. package/src/__tests__/config.service.spec.mts +11 -9
  25. package/src/__tests__/controller.spec.mts +1 -2
  26. package/src/attribute.factory.mts +1 -1
  27. package/src/config/config.provider.mts +2 -2
  28. package/src/config/config.service.mts +4 -4
  29. package/src/decorators/controller.decorator.mts +1 -1
  30. package/src/decorators/endpoint.decorator.mts +9 -10
  31. package/src/decorators/header.decorator.mts +1 -1
  32. package/src/decorators/multipart.decorator.mts +5 -5
  33. package/src/decorators/stream.decorator.mts +5 -6
  34. package/src/factories/endpoint-adapter.factory.mts +21 -0
  35. package/src/factories/http-adapter.factory.mts +20 -0
  36. package/src/factories/index.mts +6 -0
  37. package/src/factories/multipart-adapter.factory.mts +21 -0
  38. package/src/factories/reply.factory.mts +21 -0
  39. package/src/factories/request.factory.mts +21 -0
  40. package/src/factories/stream-adapter.factory.mts +20 -0
  41. package/src/index.mts +1 -1
  42. package/src/interfaces/abstract-execution-context.inteface.mts +13 -0
  43. package/src/interfaces/abstract-http-adapter.interface.mts +20 -0
  44. package/src/interfaces/abstract-http-cors-options.interface.mts +59 -0
  45. package/src/interfaces/abstract-http-handler-adapter.interface.mts +13 -0
  46. package/src/interfaces/abstract-http-listen-options.interface.mts +4 -0
  47. package/src/interfaces/can-activate.mts +4 -2
  48. package/src/interfaces/http-header.mts +18 -0
  49. package/src/interfaces/index.mts +6 -0
  50. package/src/logger/console-logger.service.mts +28 -44
  51. package/src/logger/index.mts +1 -2
  52. package/src/logger/logger.service.mts +9 -128
  53. package/src/logger/logger.tokens.mts +21 -0
  54. package/src/metadata/handler.metadata.mts +7 -5
  55. package/src/navios.application.mts +65 -172
  56. package/src/navios.environment.mts +30 -0
  57. package/src/navios.factory.mts +53 -12
  58. package/src/services/guard-runner.service.mts +19 -9
  59. package/src/services/index.mts +0 -2
  60. package/src/services/module-loader.service.mts +4 -3
  61. package/src/tokens/endpoint-adapter.token.mts +8 -0
  62. package/src/tokens/execution-context.token.mts +2 -2
  63. package/src/tokens/http-adapter.token.mts +8 -0
  64. package/src/tokens/index.mts +4 -1
  65. package/src/tokens/multipart-adapter.token.mts +8 -0
  66. package/src/tokens/reply.token.mts +1 -5
  67. package/src/tokens/request.token.mts +1 -7
  68. package/src/tokens/stream-adapter.token.mts +8 -0
  69. package/tsconfig.json +6 -1
  70. package/tsconfig.lib.json +8 -0
  71. package/tsconfig.spec.json +12 -0
  72. package/tsup.config.mts +1 -0
  73. package/docs/recipes/prisma.md +0 -60
  74. package/examples/simple-test/api/index.mts +0 -64
  75. package/examples/simple-test/config/config.service.mts +0 -14
  76. package/examples/simple-test/config/configuration.mts +0 -7
  77. package/examples/simple-test/index.mts +0 -16
  78. package/examples/simple-test/src/acl/acl-modern.guard.mts +0 -15
  79. package/examples/simple-test/src/acl/acl.guard.mts +0 -14
  80. package/examples/simple-test/src/acl/app.guard.mts +0 -27
  81. package/examples/simple-test/src/acl/one-more.guard.mts +0 -15
  82. package/examples/simple-test/src/acl/public.attribute.mts +0 -21
  83. package/examples/simple-test/src/app.module.mts +0 -9
  84. package/examples/simple-test/src/user/user.controller.mts +0 -72
  85. package/examples/simple-test/src/user/user.module.mts +0 -14
  86. package/examples/simple-test/src/user/user.service.mts +0 -14
  87. package/src/adapters/endpoint-adapter.service.mts +0 -72
  88. package/src/adapters/handler-adapter.interface.mts +0 -21
  89. package/src/adapters/index.mts +0 -4
  90. package/src/adapters/multipart-adapter.service.mts +0 -131
  91. package/src/adapters/stream-adapter.service.mts +0 -91
  92. package/src/logger/logger.factory.mts +0 -36
  93. package/src/logger/pino-wrapper.mts +0 -64
  94. package/src/services/controller-adapter.service.mts +0 -124
  95. package/src/services/execution-context.mts +0 -54
  96. package/src/tokens/application.token.mts +0 -9
@@ -1,6 +1,8 @@
1
- import type { AnyZodObject } from 'zod';
1
+ import { AnyInjectableType } from '@navios/di';
2
+ import { asyncInject } from '@navios/di';
2
3
  import type { BaseEndpointConfig } from '@navios/builder';
3
4
  import { BaseInjectionTokenSchemaType } from '@navios/di';
5
+ import { BaseInstanceHolderManager } from '@navios/di';
4
6
  import type { BaseStreamConfig } from '@navios/builder';
5
7
  import { BoundInjectionToken } from '@navios/di';
6
8
  import { ChannelEmitter } from '@navios/di';
@@ -10,7 +12,12 @@ import { ClassTypeWithInstance } from '@navios/di';
10
12
  import { ClassTypeWithInstanceAndArgument } from '@navios/di';
11
13
  import { ClassTypeWithInstanceAndOptionalArgument } from '@navios/di';
12
14
  import { ClassTypeWithOptionalArgument } from '@navios/di';
13
- import { CreateInjectorsOptions } from '@navios/di';
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';
14
21
  import type { EndpointFunctionArgs } from '@navios/builder';
15
22
  import { ErrorsEnum } from '@navios/di';
16
23
  import { EventEmitter } from '@navios/di';
@@ -18,55 +25,45 @@ import { EventEmitterInterface } from '@navios/di';
18
25
  import { EventsArgs } from '@navios/di';
19
26
  import { EventsConfig } from '@navios/di';
20
27
  import { EventsNames } from '@navios/di';
28
+ import { Factorable } from '@navios/di';
29
+ import { FactorableWithArgs } from '@navios/di';
21
30
  import { Factory } from '@navios/di';
22
31
  import { FactoryContext } from '@navios/di';
23
32
  import { FactoryInjectionToken } from '@navios/di';
24
33
  import { FactoryNotFound } from '@navios/di';
34
+ import { FactoryOptions } from '@navios/di';
25
35
  import { FactoryRecord } from '@navios/di';
26
36
  import { FactoryTokenNotResolved } from '@navios/di';
27
- import { FactoryWithArgs } from '@navios/di';
28
- import { FastifyBaseLogger } from 'fastify';
29
- import type { FastifyCorsOptions } from '@fastify/cors';
30
- import type { FastifyInstance } from 'fastify';
31
- import type { FastifyListenOptions } from 'fastify';
32
- import type { FastifyMultipartOptions } from '@fastify/multipart';
33
- import type { FastifyReply } from 'fastify';
34
- import type { FastifyRequest } from 'fastify';
35
- import { FastifySchema } from 'fastify';
36
- import type { FastifyServerOptions } from 'fastify';
37
- import { FastifyTypeProviderDefault } from 'fastify';
38
- import { getGlobalServiceLocator } from '@navios/di';
39
37
  import { getInjectableToken } from '@navios/di';
40
38
  import { getInjectors } from '@navios/di';
41
39
  import { globalRegistry } from '@navios/di';
42
- import type { HttpHeader } from 'fastify/types/utils.js';
43
40
  import type { HttpMethod } from '@navios/builder';
44
- import { IncomingMessage } from 'http';
45
41
  import { inject } from '@navios/di';
46
42
  import { Injectable } from '@navios/di';
47
43
  import { InjectableOptions } from '@navios/di';
48
44
  import { InjectableScope } from '@navios/di';
49
45
  import { InjectableTokenMeta } from '@navios/di';
50
46
  import { InjectableType } from '@navios/di';
51
- import { InjectionFactory } from '@navios/di';
52
47
  import { InjectionToken } from '@navios/di';
53
48
  import { InjectionTokenSchemaType } from '@navios/di';
49
+ import { InjectionTokenType } from '@navios/di';
54
50
  import { Injectors } from '@navios/di';
55
- import { InjectorsBase } from '@navios/di';
51
+ import { InjectState } from '@navios/di';
56
52
  import type { InspectOptions } from 'util';
57
53
  import { InstanceDestroying } from '@navios/di';
58
54
  import { InstanceExpired } from '@navios/di';
59
55
  import { InstanceNotFound } from '@navios/di';
60
- import { makeProxyServiceLocator } from '@navios/di';
56
+ import { IsUnion } from '@navios/di';
57
+ import { Join } from '@navios/di';
58
+ import { OnServiceDestroy } from '@navios/di';
59
+ import { OnServiceInit } from '@navios/di';
61
60
  import { OptionalInjectionTokenSchemaType } from '@navios/di';
62
- import { provideServiceLocator } from '@navios/di';
63
- import { ProxyServiceLocator } from '@navios/di';
64
- import { RawServerDefault } from 'fastify';
61
+ import type { OutgoingHttpHeaders } from 'http';
62
+ import { PopUnion } from '@navios/di';
63
+ import { provideFactoryContext } from '@navios/di';
65
64
  import { Registry } from '@navios/di';
66
- import { ResolveFastifyRequestType } from 'fastify/types/type-provider.js';
67
- import { resolveService } from '@navios/di';
68
- import { RouteGenericInterface } from 'fastify';
69
- import { ServerResponse } from 'http';
65
+ import { RequestContextHolder } from '@navios/di';
66
+ import { ServiceInstantiator } from '@navios/di';
70
67
  import { ServiceLocator } from '@navios/di';
71
68
  import { ServiceLocatorEventBus } from '@navios/di';
72
69
  import { ServiceLocatorInstanceDestroyListener } from '@navios/di';
@@ -75,16 +72,116 @@ import { ServiceLocatorInstanceHolder } from '@navios/di';
75
72
  import { ServiceLocatorInstanceHolderCreated } from '@navios/di';
76
73
  import { ServiceLocatorInstanceHolderCreating } from '@navios/di';
77
74
  import { ServiceLocatorInstanceHolderDestroying } from '@navios/di';
78
- import { ServiceLocatorInstanceHolderKind } from '@navios/di';
75
+ import { ServiceLocatorInstanceHolderError } from '@navios/di';
79
76
  import { ServiceLocatorInstanceHolderStatus } from '@navios/di';
80
77
  import { ServiceLocatorManager } from '@navios/di';
81
- import { syncInject } from '@navios/di';
78
+ import { UnionToArray } from '@navios/di';
79
+ import { UnionToIntersection } from '@navios/di';
80
+ import { UnionToOvlds } from '@navios/di';
82
81
  import { UnknownError } from '@navios/di';
83
82
  import type { Util_FlatObject } from '@navios/builder';
84
83
  import { wrapSyncInit } from '@navios/di';
85
- import { z } from 'zod';
86
- import { ZodDiscriminatedUnion } from 'zod';
87
- import type { ZodType } from 'zod';
84
+ import { z } from 'zod/v4';
85
+ import { ZodDiscriminatedUnion } from 'zod/v4';
86
+ import type { ZodObject } from 'zod/v4';
87
+ import type { ZodType } from 'zod/v4';
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 }
88
185
 
89
186
  declare const addLeadingSlash: (path?: string) => string;
90
187
  export { addLeadingSlash }
@@ -92,10 +189,12 @@ 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
- declare const Application: InjectionToken<FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>, undefined, false>;
96
- export { Application }
97
- export { Application as Application_alias_1 }
98
- export { Application as Application_alias_2 }
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: ExecutionContext): Promise<boolean> | boolean;
228
+ canActivate(executionContext: AbstractExecutionContext): Promise<boolean> | boolean;
128
229
  }
129
230
  export { CanActivate }
130
231
  export { CanActivate as CanActivate_alias_1 }
@@ -171,12 +272,8 @@ export { clc as clc_alias_2 }
171
272
  export { clc as clc_alias_3 }
172
273
 
173
274
  declare const ConfigProviderOptions: z.ZodObject<{
174
- load: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
175
- }, "strip", z.ZodTypeAny, {
176
- load: (...args: unknown[]) => Record<string, unknown>;
177
- }, {
178
- load: (...args: unknown[]) => Record<string, unknown>;
179
- }>;
275
+ load: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
276
+ }, z.core.$strip>;
180
277
  export { ConfigProviderOptions }
181
278
  export { ConfigProviderOptions as ConfigProviderOptions_alias_1 }
182
279
  export { ConfigProviderOptions as ConfigProviderOptions_alias_2 }
@@ -238,10 +335,6 @@ declare class ConsoleLogger implements LoggerService {
238
335
  * The context of the logger (can be set manually or automatically inferred).
239
336
  */
240
337
  protected context?: string;
241
- /**
242
- * Request ID (if enabled).
243
- */
244
- protected requestId: string | null;
245
338
  /**
246
339
  * The original context of the logger (set in the constructor).
247
340
  */
@@ -253,11 +346,11 @@ declare class ConsoleLogger implements LoggerService {
253
346
  /**
254
347
  * The last timestamp at which the log message was printed.
255
348
  */
256
- protected static lastTimestampAt?: number;
257
- constructor();
258
- constructor(context: string);
259
- constructor(options: ConsoleLoggerOptions);
260
- constructor(context: string, options: ConsoleLoggerOptions);
349
+ protected lastTimestampAt?: number;
350
+ setup(): void;
351
+ setup(context: string): void;
352
+ setup(options: ConsoleLoggerOptions): void;
353
+ setup(context: string, options: ConsoleLoggerOptions): void;
261
354
  /**
262
355
  * Write a 'log' level log, if the configured level allows for it.
263
356
  * Prints to `stdout` with newline.
@@ -311,17 +404,18 @@ declare class ConsoleLogger implements LoggerService {
311
404
  resetContext(): void;
312
405
  isLevelEnabled(level: LogLevel): boolean;
313
406
  protected getTimestamp(): string;
314
- 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;
315
408
  protected printAsJson(message: unknown, options: {
316
409
  context: string;
317
410
  logLevel: LogLevel;
318
411
  writeStreamType?: 'stdout' | 'stderr';
319
412
  errorStack?: unknown;
413
+ requestId?: string;
320
414
  }): void;
321
415
  protected formatPid(pid: number): string;
322
416
  protected formatContext(context: string): string;
323
- protected formatMessage(logLevel: LogLevel, message: unknown, pidMessage: string, formattedLogLevel: string, contextMessage: string, timestampDiff: string): string;
324
- 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;
325
419
  protected stringifyMessage(message: unknown, logLevel: LogLevel): string;
326
420
  protected colorize(message: string, logLevel: LogLevel): string;
327
421
  protected printStackTrace(stack: string): void;
@@ -424,22 +518,13 @@ export { ConsoleLoggerOptions }
424
518
  export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_1 }
425
519
  export { ConsoleLoggerOptions as ConsoleLoggerOptions_alias_2 }
426
520
 
521
+ export { Container }
522
+
427
523
  declare function Controller({ guards }?: ControllerOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
428
524
  export { Controller }
429
525
  export { Controller as Controller_alias_1 }
430
526
  export { Controller as Controller_alias_2 }
431
527
 
432
- declare class ControllerAdapterService {
433
- guardRunner: GuardRunnerService;
434
- private logger;
435
- setupController(controller: ClassType, instance: FastifyInstance, moduleMetadata: ModuleMetadata): Promise<void>;
436
- providePreHandler(executionContext: ExecutionContext): ((request: FastifyRequest, reply: FastifyReply) => Promise<void>) | undefined;
437
- private wrapHandler;
438
- }
439
- export { ControllerAdapterService }
440
- export { ControllerAdapterService as ControllerAdapterService_alias_1 }
441
- export { ControllerAdapterService as ControllerAdapterService_alias_2 }
442
-
443
528
  declare interface ControllerMetadata {
444
529
  endpoints: Set<HandlerMetadata>;
445
530
  guards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
@@ -461,25 +546,32 @@ export { ControllerOptions }
461
546
  export { ControllerOptions as ControllerOptions_alias_1 }
462
547
  export { ControllerOptions as ControllerOptions_alias_2 }
463
548
 
464
- export { CreateInjectorsOptions }
549
+ export { createDeferred }
550
+
551
+ export { createRequestContextHolder }
552
+
553
+ export { defaultInjectors }
554
+
555
+ export { DefaultRequestContextHolder }
556
+
557
+ export { Deferred }
465
558
 
466
559
  declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
467
560
  config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
468
- }): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>;
561
+ }): (target: (params: QuerySchema extends ZodType ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true> : EndpointFunctionArgs<Url, QuerySchema, undefined, true> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema, true> : EndpointFunctionArgs<Url, undefined, undefined, true>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends ZodType ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true> : EndpointFunctionArgs<Url, QuerySchema, undefined, true> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema, true> : EndpointFunctionArgs<Url, undefined, undefined, true>) => Promise<z.input<ResponseSchema>>;
469
562
  export { Endpoint }
470
563
  export { Endpoint as Endpoint_alias_1 }
471
564
  export { Endpoint as Endpoint_alias_2 }
472
565
 
473
- declare class EndpointAdapterService extends StreamAdapterService {
474
- hasSchema(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): boolean;
475
- provideSchema(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): Record<string, any>;
476
- 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>;
477
569
  }
478
- export { EndpointAdapterService }
479
- export { EndpointAdapterService as EndpointAdapterService_alias_1 }
480
- export { EndpointAdapterService as EndpointAdapterService_alias_2 }
570
+ export { EndpointAdapterFactory }
571
+ export { EndpointAdapterFactory as EndpointAdapterFactory_alias_1 }
572
+ export { EndpointAdapterFactory as EndpointAdapterFactory_alias_2 }
481
573
 
482
- declare const EndpointAdapterToken: InjectionToken<EndpointAdapterService, undefined, false>;
574
+ declare const EndpointAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
483
575
  export { EndpointAdapterToken }
484
576
  export { EndpointAdapterToken as EndpointAdapterToken_alias_1 }
485
577
  export { EndpointAdapterToken as EndpointAdapterToken_alias_2 }
@@ -491,14 +583,14 @@ export { EndpointMetadataKey as EndpointMetadataKey_alias_2 }
491
583
 
492
584
  declare type EndpointParams<EndpointDeclaration extends {
493
585
  config: BaseEndpointConfig<any, any, any, any, any>;
494
- }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
586
+ }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends ZodType ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
495
587
  export { EndpointParams }
496
588
  export { EndpointParams as EndpointParams_alias_1 }
497
589
  export { EndpointParams as EndpointParams_alias_2 }
498
590
 
499
591
  declare type EndpointResult<EndpointDeclaration extends {
500
592
  config: BaseEndpointConfig<any, any, any, any, any>;
501
- }> = EndpointDeclaration['config']['responseSchema'] extends ZodDiscriminatedUnion<any, infer Options> ? Promise<z.input<Options[number]>> : Promise<z.input<EndpointDeclaration['config']['responseSchema']>>;
593
+ }> = EndpointDeclaration['config']['responseSchema'] extends ZodDiscriminatedUnion<infer Options> ? Promise<z.input<Options[number]>> : Promise<z.input<EndpointDeclaration['config']['responseSchema']>>;
502
594
  export { EndpointResult }
503
595
  export { EndpointResult as EndpointResult_alias_1 }
504
596
  export { EndpointResult as EndpointResult_alias_2 }
@@ -536,21 +628,7 @@ declare type ExcludedKeys = 'computedTimeRates' | 'aiModelsRates' | 'aiModel';
536
628
 
537
629
  declare type ExcludedParts = 'services' | 'mailer' | 'aws' | 'computedTimeRates' | 'aiModelsRates';
538
630
 
539
- declare class ExecutionContext {
540
- private readonly module;
541
- private readonly controller;
542
- private readonly handler;
543
- private request;
544
- private reply;
545
- constructor(module: ModuleMetadata, controller: ControllerMetadata, handler: HandlerMetadata);
546
- getModule(): ModuleMetadata;
547
- getController(): ControllerMetadata;
548
- getHandler(): HandlerMetadata;
549
- getRequest(): FastifyRequest;
550
- getReply(): FastifyReply;
551
- provideRequest(request: FastifyRequest): void;
552
- provideReply(reply: FastifyReply): void;
553
- }
631
+ declare const ExecutionContext: InjectionToken<AbstractExecutionContext, undefined, false>;
554
632
  export { ExecutionContext }
555
633
  export { ExecutionContext as ExecutionContext_alias_1 }
556
634
  export { ExecutionContext as ExecutionContext_alias_2 }
@@ -560,11 +638,6 @@ export { ExecutionContextInjectionToken }
560
638
  export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_1 }
561
639
  export { ExecutionContextInjectionToken as ExecutionContextInjectionToken_alias_2 }
562
640
 
563
- declare const ExecutionContextToken: InjectionToken<ExecutionContext, undefined, false>;
564
- export { ExecutionContextToken }
565
- export { ExecutionContextToken as ExecutionContextToken_alias_1 }
566
- export { ExecutionContextToken as ExecutionContextToken_alias_2 }
567
-
568
641
  declare function extractControllerMetadata(target: ClassType): ControllerMetadata;
569
642
  export { extractControllerMetadata }
570
643
  export { extractControllerMetadata as extractControllerMetadata_alias_1 }
@@ -575,6 +648,10 @@ export { extractModuleMetadata }
575
648
  export { extractModuleMetadata as extractModuleMetadata_alias_1 }
576
649
  export { extractModuleMetadata as extractModuleMetadata_alias_2 }
577
650
 
651
+ export { Factorable }
652
+
653
+ export { FactorableWithArgs }
654
+
578
655
  export { Factory }
579
656
 
580
657
  export { FactoryContext }
@@ -583,12 +660,12 @@ export { FactoryInjectionToken }
583
660
 
584
661
  export { FactoryNotFound }
585
662
 
663
+ export { FactoryOptions }
664
+
586
665
  export { FactoryRecord }
587
666
 
588
667
  export { FactoryTokenNotResolved }
589
668
 
590
- export { FactoryWithArgs }
591
-
592
669
  /**
593
670
  * @publicApi
594
671
  */
@@ -620,8 +697,6 @@ export { getEndpointMetadata }
620
697
  export { getEndpointMetadata as getEndpointMetadata_alias_1 }
621
698
  export { getEndpointMetadata as getEndpointMetadata_alias_2 }
622
699
 
623
- export { getGlobalServiceLocator }
624
-
625
700
  export { getInjectableToken }
626
701
 
627
702
  export { getInjectors }
@@ -634,28 +709,19 @@ export { getModuleMetadata as getModuleMetadata_alias_2 }
634
709
  export { globalRegistry }
635
710
 
636
711
  declare class GuardRunnerService {
637
- runGuards(allGuards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>, executionContext: ExecutionContext): Promise<boolean>;
638
- makeContext(executionContext: ExecutionContext): Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
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>>;
639
715
  }
640
716
  export { GuardRunnerService }
641
717
  export { GuardRunnerService as GuardRunnerService_alias_1 }
642
718
  export { GuardRunnerService as GuardRunnerService_alias_2 }
643
719
 
644
- declare interface HandlerAdapterInterface {
645
- provideSchema?: (handlerMetadata: HandlerMetadata<any>) => Record<string, any>;
646
- hasSchema?: (handlerMetadata: HandlerMetadata<any>) => boolean;
647
- prepareArguments?: (handlerMetadata: HandlerMetadata<any>) => ((target: Record<string, any>, request: FastifyRequest) => Promise<void> | void)[];
648
- provideHandler: (controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<any>) => (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
649
- }
650
- export { HandlerAdapterInterface }
651
- export { HandlerAdapterInterface as HandlerAdapterInterface_alias_1 }
652
- export { HandlerAdapterInterface as HandlerAdapterInterface_alias_2 }
653
-
654
720
  declare interface HandlerMetadata<Config = null> {
655
721
  classMethod: string;
656
722
  url: string;
657
723
  successStatusCode: number;
658
- adapterToken: InjectionToken<HandlerAdapterInterface, undefined> | ClassTypeWithInstance<HandlerAdapterInterface> | null;
724
+ adapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined> | ClassTypeWithInstance<AbstractHttpHandlerAdapterInterface> | null;
659
725
  headers: Partial<Record<HttpHeader, number | string | string[] | undefined>>;
660
726
  httpMethod: HttpMethod;
661
727
  config: Config;
@@ -681,6 +747,19 @@ export { Header }
681
747
  export { Header as Header_alias_1 }
682
748
  export { Header as Header_alias_2 }
683
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
+
684
763
  declare function HttpCode(code: number): <T extends Function>(target: T, context: ClassMethodDecoratorContext) => T;
685
764
  export { HttpCode }
686
765
  export { HttpCode as HttpCode_alias_1 }
@@ -696,6 +775,15 @@ export { HttpException }
696
775
  export { HttpException as HttpException_alias_1 }
697
776
  export { HttpException as HttpException_alias_2 }
698
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
+
699
787
  export { inject }
700
788
 
701
789
  export { Injectable }
@@ -708,15 +796,15 @@ export { InjectableTokenMeta }
708
796
 
709
797
  export { InjectableType }
710
798
 
711
- export { InjectionFactory }
712
-
713
799
  export { InjectionToken }
714
800
 
715
801
  export { InjectionTokenSchemaType }
716
802
 
803
+ export { InjectionTokenType }
804
+
717
805
  export { Injectors }
718
806
 
719
- export { InjectorsBase }
807
+ export { InjectState }
720
808
 
721
809
  export { InstanceDestroying }
722
810
 
@@ -817,6 +905,10 @@ export { isUndefined as isUndefined_alias_1 }
817
905
  export { isUndefined as isUndefined_alias_2 }
818
906
  export { isUndefined as isUndefined_alias_3 }
819
907
 
908
+ export { IsUnion }
909
+
910
+ export { Join }
911
+
820
912
  declare const LOG_LEVELS: ["verbose", "debug", "log", "warn", "error", "fatal"];
821
913
  export { LOG_LEVELS }
822
914
  export { LOG_LEVELS as LOG_LEVELS_alias_1 }
@@ -824,54 +916,15 @@ export { LOG_LEVELS as LOG_LEVELS_alias_2 }
824
916
 
825
917
  declare const Logger: InjectionToken<LoggerInstance, z.ZodOptional<z.ZodObject<{
826
918
  context: z.ZodOptional<z.ZodString>;
827
- options: z.ZodOptional<z.ZodObject<{
828
- timestamp: z.ZodOptional<z.ZodBoolean>;
829
- }, "strip", z.ZodTypeAny, {
830
- timestamp?: boolean | undefined;
831
- }, {
832
- timestamp?: boolean | undefined;
833
- }>>;
834
- }, "strip", z.ZodTypeAny, {
835
- options?: {
836
- timestamp?: boolean | undefined;
837
- } | undefined;
838
- context?: string | undefined;
839
- }, {
840
- options?: {
841
- timestamp?: boolean | undefined;
842
- } | undefined;
843
- context?: string | undefined;
844
- }>>, false>;
919
+ }, z.core.$strip>>, false>;
845
920
  export { Logger }
846
921
  export { Logger as Logger_alias_1 }
847
922
  export { Logger as Logger_alias_2 }
848
923
 
849
- declare class LoggerFactory {
850
- create(ctx: any, args: z.infer<typeof LoggerOptions>): LoggerInstance;
851
- }
852
- export { LoggerFactory }
853
- export { LoggerFactory as LoggerFactory_alias_1 }
854
- export { LoggerFactory as LoggerFactory_alias_2 }
855
-
856
- declare const LoggerInjectionToken = "LoggerInjectionToken";
857
- export { LoggerInjectionToken }
858
- export { LoggerInjectionToken as LoggerInjectionToken_alias_1 }
859
- export { LoggerInjectionToken as LoggerInjectionToken_alias_2 }
860
-
861
924
  declare class LoggerInstance implements LoggerService {
862
- protected context?: string | undefined;
863
- protected options: {
864
- timestamp?: boolean;
865
- };
866
- protected static staticInstanceRef?: LoggerService;
867
- protected static logLevels?: LogLevel[];
868
- protected localInstanceRef?: LoggerService;
869
- constructor();
870
- constructor(context: string);
871
- constructor(context: string, options?: {
872
- timestamp?: boolean;
873
- });
874
- get localInstance(): LoggerService;
925
+ protected localInstance: LoggerService;
926
+ protected context?: string;
927
+ constructor(config?: LoggerOptions);
875
928
  /**
876
929
  * Write an 'error' level log.
877
930
  */
@@ -902,72 +955,28 @@ declare class LoggerInstance implements LoggerService {
902
955
  */
903
956
  fatal(message: any, context?: string): void;
904
957
  fatal(message: any, ...optionalParams: [...any, string?]): void;
905
- /**
906
- * Write an 'error' level log.
907
- */
908
- static error(message: any, stackOrContext?: string): void;
909
- static error(message: any, context?: string): void;
910
- static error(message: any, stack?: string, context?: string): void;
911
- static error(message: any, ...optionalParams: [...any, string?, string?]): void;
912
- /**
913
- * Write a 'log' level log.
914
- */
915
- static log(message: any, context?: string): void;
916
- static log(message: any, ...optionalParams: [...any, string?]): void;
917
- /**
918
- * Write a 'warn' level log.
919
- */
920
- static warn(message: any, context?: string): void;
921
- static warn(message: any, ...optionalParams: [...any, string?]): void;
922
- /**
923
- * Write a 'debug' level log, if the configured level allows for it.
924
- * Prints to `stdout` with newline.
925
- */
926
- static debug(message: any, context?: string): void;
927
- static debug(message: any, ...optionalParams: [...any, string?]): void;
928
- /**
929
- * Write a 'verbose' level log.
930
- */
931
- static verbose(message: any, context?: string): void;
932
- static verbose(message: any, ...optionalParams: [...any, string?]): void;
933
- /**
934
- * Write a 'fatal' level log.
935
- */
936
- static fatal(message: any, context?: string): void;
937
- static fatal(message: any, ...optionalParams: [...any, string?]): void;
938
- static getTimestamp(): string;
939
- static overrideLogger(logger: LoggerService | LogLevel[] | boolean): any;
940
- static isLevelEnabled(level: LogLevel): boolean;
941
- private registerLocalInstanceRef;
942
958
  }
943
959
  export { LoggerInstance }
944
960
  export { LoggerInstance as LoggerInstance_alias_1 }
945
961
  export { LoggerInstance as LoggerInstance_alias_2 }
946
962
 
947
- declare const LoggerOptions: z.ZodOptional<z.ZodObject<{
948
- context: z.ZodOptional<z.ZodString>;
949
- options: z.ZodOptional<z.ZodObject<{
950
- timestamp: z.ZodOptional<z.ZodBoolean>;
951
- }, "strip", z.ZodTypeAny, {
952
- timestamp?: boolean | undefined;
953
- }, {
954
- timestamp?: boolean | undefined;
955
- }>>;
956
- }, "strip", z.ZodTypeAny, {
957
- options?: {
958
- timestamp?: boolean | undefined;
959
- } | undefined;
960
- context?: string | undefined;
961
- }, {
962
- options?: {
963
- timestamp?: boolean | undefined;
964
- } | undefined;
965
- context?: string | undefined;
966
- }>>;
963
+ declare type LoggerOptions = z.infer<typeof loggerOptionsSchema>;
967
964
  export { LoggerOptions }
968
965
  export { LoggerOptions as LoggerOptions_alias_1 }
969
966
  export { LoggerOptions as LoggerOptions_alias_2 }
970
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
+
971
980
  /**
972
981
  * @publicApi
973
982
  */
@@ -1014,8 +1023,6 @@ export { LogLevel }
1014
1023
  export { LogLevel as LogLevel_alias_1 }
1015
1024
  export { LogLevel as LogLevel_alias_2 }
1016
1025
 
1017
- export { makeProxyServiceLocator }
1018
-
1019
1026
  declare function Module({ controllers, imports, guards }?: ModuleOptions): (target: ClassType, context: ClassDecoratorContext) => ClassType;
1020
1027
  export { Module }
1021
1028
  export { Module as Module_alias_1 }
@@ -1023,6 +1030,7 @@ export { Module as Module_alias_2 }
1023
1030
 
1024
1031
  declare class ModuleLoaderService {
1025
1032
  private logger;
1033
+ protected container: Container;
1026
1034
  private modulesMetadata;
1027
1035
  private loadedModules;
1028
1036
  private initialized;
@@ -1062,29 +1070,27 @@ export { ModuleOptions as ModuleOptions_alias_2 }
1062
1070
 
1063
1071
  declare function Multipart<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
1064
1072
  config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
1065
- }): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>;
1073
+ }): (target: (params: QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>;
1066
1074
  export { Multipart }
1067
1075
  export { Multipart as Multipart_alias_1 }
1068
1076
  export { Multipart as Multipart_alias_2 }
1069
1077
 
1070
- declare class MultipartAdapterService extends EndpointAdapterService {
1071
- prepareArguments(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): ((target: Record<string, any>, request: FastifyRequest) => void)[];
1072
- private populateRequest;
1073
- private analyzeSchema;
1074
- provideSchema(handlerMetadata: HandlerMetadata<BaseEndpointConfig>): Record<string, any>;
1078
+ declare class MultipartAdapterFactory {
1079
+ private readonly environment;
1080
+ create(ctx: FactoryContext): Promise<any>;
1075
1081
  }
1076
- export { MultipartAdapterService }
1077
- export { MultipartAdapterService as MultipartAdapterService_alias_1 }
1078
- export { MultipartAdapterService as MultipartAdapterService_alias_2 }
1082
+ export { MultipartAdapterFactory }
1083
+ export { MultipartAdapterFactory as MultipartAdapterFactory_alias_1 }
1084
+ export { MultipartAdapterFactory as MultipartAdapterFactory_alias_2 }
1079
1085
 
1080
- declare const MultipartAdapterToken: InjectionToken<MultipartAdapterService, undefined, false>;
1086
+ declare const MultipartAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
1081
1087
  export { MultipartAdapterToken }
1082
1088
  export { MultipartAdapterToken as MultipartAdapterToken_alias_1 }
1083
1089
  export { MultipartAdapterToken as MultipartAdapterToken_alias_2 }
1084
1090
 
1085
1091
  declare type MultipartParams<EndpointDeclaration extends {
1086
1092
  config: BaseEndpointConfig<any, any, any, any, any>;
1087
- }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
1093
+ }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends ZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
1088
1094
  export { MultipartParams }
1089
1095
  export { MultipartParams as MultipartParams_alias_1 }
1090
1096
  export { MultipartParams as MultipartParams_alias_2 }
@@ -1097,27 +1103,23 @@ export { MultipartResult as MultipartResult_alias_1 }
1097
1103
  export { MultipartResult as MultipartResult_alias_2 }
1098
1104
 
1099
1105
  declare class NaviosApplication {
1106
+ private environment;
1100
1107
  private moduleLoader;
1101
- private controllerAdapter;
1108
+ private httpApplication;
1102
1109
  private logger;
1103
- private server;
1104
- private corsOptions;
1105
- private multipartOptions;
1106
- private globalPrefix;
1110
+ protected container: Container;
1107
1111
  private appModule;
1108
1112
  private options;
1109
1113
  isInitialized: boolean;
1110
- setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): void;
1114
+ setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<void>;
1115
+ getContainer(): Container;
1111
1116
  init(): Promise<void>;
1112
- private getFastifyInstance;
1113
- private configureFastifyInstance;
1114
- configureMultipart(server: FastifyInstance, options: FastifyMultipartOptions | true): Promise<void>;
1115
1117
  private initModules;
1116
- enableCors(options: FastifyCorsOptions): void;
1117
- enableMultipart(options: FastifyMultipartOptions): void;
1118
+ enableCors(options: any): void;
1119
+ enableMultipart(options: any): void;
1118
1120
  setGlobalPrefix(prefix: string): void;
1119
- getServer(): FastifyInstance;
1120
- listen(options: FastifyListenOptions): Promise<void>;
1121
+ getServer(): any;
1122
+ listen(options: AbstractHttpListenOptions): Promise<void>;
1121
1123
  dispose(): Promise<void>;
1122
1124
  close(): Promise<void>;
1123
1125
  }
@@ -1133,13 +1135,26 @@ declare interface NaviosApplicationContextOptions {
1133
1135
  export { NaviosApplicationContextOptions }
1134
1136
  export { NaviosApplicationContextOptions as NaviosApplicationContextOptions_alias_1 }
1135
1137
 
1136
- declare interface NaviosApplicationOptions extends Omit<FastifyServerOptions, 'logger'>, NaviosApplicationContextOptions {
1138
+ declare interface NaviosApplicationOptions extends NaviosApplicationContextOptions {
1139
+ adapter: NaviosEnvironmentOptions | NaviosEnvironmentOptions[];
1137
1140
  }
1138
1141
  export { NaviosApplicationOptions }
1139
1142
  export { NaviosApplicationOptions as NaviosApplicationOptions_alias_1 }
1140
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
+
1141
1155
  declare class NaviosFactory {
1142
1156
  static create(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<NaviosApplication>;
1157
+ private static registerEnvironment;
1143
1158
  private static registerLoggerConfiguration;
1144
1159
  }
1145
1160
  export { NaviosFactory }
@@ -1167,8 +1182,21 @@ export { NotFoundException }
1167
1182
  export { NotFoundException as NotFoundException_alias_1 }
1168
1183
  export { NotFoundException as NotFoundException_alias_2 }
1169
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
+
1170
1196
  export { OptionalInjectionTokenSchemaType }
1171
1197
 
1198
+ declare type OriginType = string | boolean | RegExp;
1199
+
1172
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;
1173
1201
  export { Path }
1174
1202
  export { Path as Path_alias_1 }
@@ -1189,45 +1217,46 @@ export { PathValue }
1189
1217
  export { PathValue as PathValue_alias_1 }
1190
1218
  export { PathValue as PathValue_alias_2 }
1191
1219
 
1192
- declare class PinoWrapper {
1193
- protected readonly logger: LoggerService;
1194
- constructor(logger: LoggerService);
1195
- fatal(message: any, ...optionalParams: any[]): void;
1196
- error(message: any, ...optionalParams: any[]): void;
1197
- warn(message: any, ...optionalParams: any[]): void;
1198
- info(): void;
1199
- debug(message: any, ...optionalParams: any[]): void;
1200
- trace(message: any, ...optionalParams: any[]): void;
1201
- silent(): void;
1202
- child(options: any): PinoWrapper;
1203
- get level(): any;
1204
- }
1205
- export { PinoWrapper }
1206
- export { PinoWrapper as PinoWrapper_alias_1 }
1207
- export { PinoWrapper as PinoWrapper_alias_2 }
1220
+ export { PopUnion }
1208
1221
 
1209
1222
  declare function provideConfig<ConfigMap extends ConfigServiceOptions>(options: z.input<typeof ConfigProviderOptions>): FactoryInjectionToken<ConfigService<ConfigMap>, typeof ConfigServiceOptionsSchema>;
1210
1223
  export { provideConfig }
1211
1224
  export { provideConfig as provideConfig_alias_1 }
1212
1225
  export { provideConfig as provideConfig_alias_2 }
1213
1226
 
1214
- export { provideServiceLocator }
1215
-
1216
- export { ProxyServiceLocator }
1227
+ export { provideFactoryContext }
1217
1228
 
1218
1229
  export { Registry }
1219
1230
 
1220
- declare const Reply: InjectionToken<FastifyReply<RouteGenericInterface, RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, unknown, FastifySchema, FastifyTypeProviderDefault, unknown>, undefined, false>;
1231
+ declare const Reply: InjectionToken<any, undefined, false>;
1221
1232
  export { Reply }
1222
1233
  export { Reply as Reply_alias_1 }
1223
1234
  export { Reply as Reply_alias_2 }
1224
1235
 
1225
- declare const Request_2: InjectionToken<FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage, FastifySchema, FastifyTypeProviderDefault, unknown, FastifyBaseLogger, ResolveFastifyRequestType<FastifyTypeProviderDefault, FastifySchema, RouteGenericInterface>>, undefined, false>;
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>;
1226
1245
  export { Request_2 as Request }
1227
1246
  export { Request_2 as Request_alias_1 }
1228
1247
  export { Request_2 as Request_alias_2 }
1229
1248
 
1230
- export { resolveService }
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 }
1231
1260
 
1232
1261
  export { ServiceLocator }
1233
1262
 
@@ -1245,7 +1274,7 @@ export { ServiceLocatorInstanceHolderCreating }
1245
1274
 
1246
1275
  export { ServiceLocatorInstanceHolderDestroying }
1247
1276
 
1248
- export { ServiceLocatorInstanceHolderKind }
1277
+ export { ServiceLocatorInstanceHolderError }
1249
1278
 
1250
1279
  export { ServiceLocatorInstanceHolderStatus }
1251
1280
 
@@ -1253,29 +1282,27 @@ export { ServiceLocatorManager }
1253
1282
 
1254
1283
  declare function Stream<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, RequestSchema = ZodType>(endpoint: {
1255
1284
  config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
1256
- }): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>, reply: FastifyReply) => Promise<void>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>, reply: FastifyReply) => Promise<void>;
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>;
1257
1286
  export { Stream }
1258
1287
  export { Stream as Stream_alias_1 }
1259
1288
  export { Stream as Stream_alias_2 }
1260
1289
 
1261
- declare class StreamAdapterService implements HandlerAdapterInterface {
1262
- hasSchema(handlerMetadata: HandlerMetadata<BaseStreamConfig>): boolean;
1263
- prepareArguments(handlerMetadata: HandlerMetadata<BaseStreamConfig>): ((target: Record<string, any>, request: FastifyRequest) => void | Promise<void>)[];
1264
- provideHandler(controller: ClassType, executionContext: ExecutionContext, handlerMetadata: HandlerMetadata<BaseStreamConfig>): (request: FastifyRequest, reply: FastifyReply) => Promise<any>;
1265
- provideSchema(handlerMetadata: HandlerMetadata<BaseStreamConfig>): Record<string, any>;
1290
+ declare class StreamAdapterFactory {
1291
+ private readonly environment;
1292
+ create(ctx: FactoryContext): Promise<any>;
1266
1293
  }
1267
- export { StreamAdapterService }
1268
- export { StreamAdapterService as StreamAdapterService_alias_1 }
1269
- export { StreamAdapterService as StreamAdapterService_alias_2 }
1294
+ export { StreamAdapterFactory }
1295
+ export { StreamAdapterFactory as StreamAdapterFactory_alias_1 }
1296
+ export { StreamAdapterFactory as StreamAdapterFactory_alias_2 }
1270
1297
 
1271
- declare const StreamAdapterToken: InjectionToken<StreamAdapterService, undefined, false>;
1298
+ declare const StreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
1272
1299
  export { StreamAdapterToken }
1273
1300
  export { StreamAdapterToken as StreamAdapterToken_alias_1 }
1274
1301
  export { StreamAdapterToken as StreamAdapterToken_alias_2 }
1275
1302
 
1276
1303
  declare type StreamParams<EndpointDeclaration extends {
1277
1304
  config: BaseStreamConfig<any, any, any, any>;
1278
- }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends AnyZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
1305
+ }, Url extends string = EndpointDeclaration['config']['url'], QuerySchema = EndpointDeclaration['config']['querySchema']> = QuerySchema extends ZodObject ? EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, QuerySchema, undefined, true>> : EndpointDeclaration['config']['requestSchema'] extends ZodType ? Util_FlatObject<EndpointFunctionArgs<Url, undefined, EndpointDeclaration['config']['requestSchema'], true>> : Util_FlatObject<EndpointFunctionArgs<Url, undefined, undefined, true>>;
1279
1306
  export { StreamParams }
1280
1307
  export { StreamParams as StreamParams_alias_1 }
1281
1308
  export { StreamParams as StreamParams_alias_2 }
@@ -1286,8 +1313,6 @@ export { stripEndSlash as stripEndSlash_alias_1 }
1286
1313
  export { stripEndSlash as stripEndSlash_alias_2 }
1287
1314
  export { stripEndSlash as stripEndSlash_alias_3 }
1288
1315
 
1289
- export { syncInject }
1290
-
1291
1316
  declare class UnauthorizedException extends HttpException {
1292
1317
  constructor(message: string | object, error?: Error);
1293
1318
  }
@@ -1295,6 +1320,12 @@ export { UnauthorizedException }
1295
1320
  export { UnauthorizedException as UnauthorizedException_alias_1 }
1296
1321
  export { UnauthorizedException as UnauthorizedException_alias_2 }
1297
1322
 
1323
+ export { UnionToArray }
1324
+
1325
+ export { UnionToIntersection }
1326
+
1327
+ export { UnionToOvlds }
1328
+
1298
1329
  export { UnknownError }
1299
1330
 
1300
1331
  declare function UseGuards(...guards: (ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>)[]): <T extends Function>(target: T, context: ClassMethodDecoratorContext | ClassDecoratorContext) => T;
@@ -1302,6 +1333,8 @@ export { UseGuards }
1302
1333
  export { UseGuards as UseGuards_alias_1 }
1303
1334
  export { UseGuards as UseGuards_alias_2 }
1304
1335
 
1336
+ declare type ValueOrArray<T> = T | ArrayOfValueOrArray<T>;
1337
+
1305
1338
  export { wrapSyncInit }
1306
1339
 
1307
1340
  declare const yellow: (text: string) => string;