@navios/core 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/{index-BFwNx9WQ.d.cts → index-DW9EPAE6.d.mts} +222 -17
  3. package/lib/index-DW9EPAE6.d.mts.map +1 -0
  4. package/lib/{index-D657ijFO.d.mts → index-pHp-dIGt.d.cts} +222 -17
  5. package/lib/index-pHp-dIGt.d.cts.map +1 -0
  6. package/lib/index.cjs +5 -5
  7. package/lib/index.d.cts +2 -2
  8. package/lib/index.d.mts +2 -2
  9. package/lib/index.mjs +1 -1
  10. package/lib/legacy-compat/index.cjs +1 -1
  11. package/lib/legacy-compat/index.d.cts +1 -1
  12. package/lib/legacy-compat/index.d.cts.map +1 -1
  13. package/lib/legacy-compat/index.d.mts +1 -1
  14. package/lib/legacy-compat/index.d.mts.map +1 -1
  15. package/lib/{src-DzPY5s6d.mjs → src-DyvCDuKO.mjs} +121 -31
  16. package/lib/src-DyvCDuKO.mjs.map +1 -0
  17. package/lib/{src-Cb1aTjl0.cjs → src-QnxR5b7c.cjs} +164 -74
  18. package/lib/src-QnxR5b7c.cjs.map +1 -0
  19. package/lib/testing/index.cjs +6 -6
  20. package/lib/testing/index.cjs.map +1 -1
  21. package/lib/testing/index.d.cts +1 -1
  22. package/lib/testing/index.d.mts +1 -1
  23. package/lib/testing/index.mjs +1 -1
  24. package/lib/{use-guards.decorator-DdvUhB03.cjs → use-guards.decorator-B6q_N0sf.cjs} +17 -17
  25. package/lib/{use-guards.decorator-DdvUhB03.cjs.map → use-guards.decorator-B6q_N0sf.cjs.map} +1 -1
  26. package/package.json +12 -12
  27. package/src/interfaces/abstract-http-adapter.interface.mts +52 -0
  28. package/src/interfaces/index.mts +1 -0
  29. package/src/interfaces/plugin.interface.mts +105 -0
  30. package/src/logger/logger.service.mts +5 -3
  31. package/src/navios.application.mts +77 -27
  32. package/src/navios.factory.mts +10 -9
  33. package/src/services/module-loader.service.mts +102 -1
  34. package/lib/index-BFwNx9WQ.d.cts.map +0 -1
  35. package/lib/index-D657ijFO.d.mts.map +0 -1
  36. package/lib/src-Cb1aTjl0.cjs.map +0 -1
  37. package/lib/src-DzPY5s6d.mjs.map +0 -1
  38. package/src/attribute.factory.d.mts +0 -175
  39. package/src/attribute.factory.d.mts.map +0 -1
  40. package/src/config/config-service.interface.d.mts +0 -39
  41. package/src/config/config-service.interface.d.mts.map +0 -1
  42. package/src/config/config.provider.d.mts +0 -46
  43. package/src/config/config.provider.d.mts.map +0 -1
  44. package/src/config/config.service.d.mts +0 -108
  45. package/src/config/config.service.d.mts.map +0 -1
  46. package/src/config/index.d.mts +0 -6
  47. package/src/config/index.d.mts.map +0 -1
  48. package/src/config/types.d.mts +0 -13
  49. package/src/config/types.d.mts.map +0 -1
  50. package/src/config/utils/helpers.d.mts +0 -3
  51. package/src/config/utils/helpers.d.mts.map +0 -1
  52. package/src/config/utils/index.d.mts +0 -2
  53. package/src/config/utils/index.d.mts.map +0 -1
  54. package/src/decorators/controller.decorator.d.mts +0 -33
  55. package/src/decorators/controller.decorator.d.mts.map +0 -1
  56. package/src/decorators/endpoint.decorator.d.mts +0 -89
  57. package/src/decorators/endpoint.decorator.d.mts.map +0 -1
  58. package/src/decorators/header.decorator.d.mts +0 -22
  59. package/src/decorators/header.decorator.d.mts.map +0 -1
  60. package/src/decorators/http-code.decorator.d.mts +0 -22
  61. package/src/decorators/http-code.decorator.d.mts.map +0 -1
  62. package/src/decorators/index.d.mts +0 -9
  63. package/src/decorators/index.d.mts.map +0 -1
  64. package/src/decorators/module.decorator.d.mts +0 -42
  65. package/src/decorators/module.decorator.d.mts.map +0 -1
  66. package/src/decorators/multipart.decorator.d.mts +0 -54
  67. package/src/decorators/multipart.decorator.d.mts.map +0 -1
  68. package/src/decorators/stream.decorator.d.mts +0 -42
  69. package/src/decorators/stream.decorator.d.mts.map +0 -1
  70. package/src/decorators/use-guards.decorator.d.mts +0 -33
  71. package/src/decorators/use-guards.decorator.d.mts.map +0 -1
  72. package/src/exceptions/bad-request.exception.d.mts +0 -26
  73. package/src/exceptions/bad-request.exception.d.mts.map +0 -1
  74. package/src/exceptions/conflict.exception.d.mts +0 -29
  75. package/src/exceptions/conflict.exception.d.mts.map +0 -1
  76. package/src/exceptions/forbidden.exception.d.mts +0 -28
  77. package/src/exceptions/forbidden.exception.d.mts.map +0 -1
  78. package/src/exceptions/http.exception.d.mts +0 -33
  79. package/src/exceptions/http.exception.d.mts.map +0 -1
  80. package/src/exceptions/index.d.mts +0 -8
  81. package/src/exceptions/index.d.mts.map +0 -1
  82. package/src/exceptions/internal-server-error.exception.d.mts +0 -31
  83. package/src/exceptions/internal-server-error.exception.d.mts.map +0 -1
  84. package/src/exceptions/not-found.exception.d.mts +0 -30
  85. package/src/exceptions/not-found.exception.d.mts.map +0 -1
  86. package/src/exceptions/unauthorized.exception.d.mts +0 -28
  87. package/src/exceptions/unauthorized.exception.d.mts.map +0 -1
  88. package/src/factories/endpoint-adapter.factory.d.mts +0 -6
  89. package/src/factories/endpoint-adapter.factory.d.mts.map +0 -1
  90. package/src/factories/http-adapter.factory.d.mts +0 -6
  91. package/src/factories/http-adapter.factory.d.mts.map +0 -1
  92. package/src/factories/index.d.mts +0 -8
  93. package/src/factories/index.d.mts.map +0 -1
  94. package/src/factories/multipart-adapter.factory.d.mts +0 -6
  95. package/src/factories/multipart-adapter.factory.d.mts.map +0 -1
  96. package/src/factories/reply.factory.d.mts +0 -6
  97. package/src/factories/reply.factory.d.mts.map +0 -1
  98. package/src/factories/request.factory.d.mts +0 -6
  99. package/src/factories/request.factory.d.mts.map +0 -1
  100. package/src/factories/stream-adapter.factory.d.mts +0 -6
  101. package/src/factories/stream-adapter.factory.d.mts.map +0 -1
  102. package/src/factories/xml-stream-adapter.factory.d.mts +0 -6
  103. package/src/factories/xml-stream-adapter.factory.d.mts.map +0 -1
  104. package/src/index.d.mts +0 -15
  105. package/src/index.d.mts.map +0 -1
  106. package/src/interfaces/abstract-execution-context.inteface.d.mts +0 -44
  107. package/src/interfaces/abstract-execution-context.inteface.d.mts.map +0 -1
  108. package/src/interfaces/abstract-http-adapter.interface.d.mts +0 -15
  109. package/src/interfaces/abstract-http-adapter.interface.d.mts.map +0 -1
  110. package/src/interfaces/abstract-http-cors-options.interface.d.mts +0 -58
  111. package/src/interfaces/abstract-http-cors-options.interface.d.mts.map +0 -1
  112. package/src/interfaces/abstract-http-handler-adapter.interface.d.mts +0 -7
  113. package/src/interfaces/abstract-http-handler-adapter.interface.d.mts.map +0 -1
  114. package/src/interfaces/abstract-http-listen-options.interface.d.mts +0 -5
  115. package/src/interfaces/abstract-http-listen-options.interface.d.mts.map +0 -1
  116. package/src/interfaces/can-activate.d.mts +0 -36
  117. package/src/interfaces/can-activate.d.mts.map +0 -1
  118. package/src/interfaces/http-header.d.mts +0 -10
  119. package/src/interfaces/http-header.d.mts.map +0 -1
  120. package/src/interfaces/index.d.mts +0 -9
  121. package/src/interfaces/index.d.mts.map +0 -1
  122. package/src/interfaces/navios-module.d.mts +0 -29
  123. package/src/interfaces/navios-module.d.mts.map +0 -1
  124. package/src/legacy-compat/context-compat.d.mts +0 -19
  125. package/src/legacy-compat/context-compat.d.mts.map +0 -1
  126. package/src/legacy-compat/decorators/controller.decorator.d.mts +0 -21
  127. package/src/legacy-compat/decorators/controller.decorator.d.mts.map +0 -1
  128. package/src/legacy-compat/decorators/endpoint.decorator.d.mts +0 -33
  129. package/src/legacy-compat/decorators/endpoint.decorator.d.mts.map +0 -1
  130. package/src/legacy-compat/decorators/header.decorator.d.mts +0 -24
  131. package/src/legacy-compat/decorators/header.decorator.d.mts.map +0 -1
  132. package/src/legacy-compat/decorators/http-code.decorator.d.mts +0 -22
  133. package/src/legacy-compat/decorators/http-code.decorator.d.mts.map +0 -1
  134. package/src/legacy-compat/decorators/index.d.mts +0 -9
  135. package/src/legacy-compat/decorators/index.d.mts.map +0 -1
  136. package/src/legacy-compat/decorators/module.decorator.d.mts +0 -22
  137. package/src/legacy-compat/decorators/module.decorator.d.mts.map +0 -1
  138. package/src/legacy-compat/decorators/multipart.decorator.d.mts +0 -34
  139. package/src/legacy-compat/decorators/multipart.decorator.d.mts.map +0 -1
  140. package/src/legacy-compat/decorators/stream.decorator.d.mts +0 -34
  141. package/src/legacy-compat/decorators/stream.decorator.d.mts.map +0 -1
  142. package/src/legacy-compat/decorators/use-guards.decorator.d.mts +0 -29
  143. package/src/legacy-compat/decorators/use-guards.decorator.d.mts.map +0 -1
  144. package/src/legacy-compat/index.d.mts +0 -19
  145. package/src/legacy-compat/index.d.mts.map +0 -1
  146. package/src/logger/console-logger.service.d.mts +0 -196
  147. package/src/logger/console-logger.service.d.mts.map +0 -1
  148. package/src/logger/index.d.mts +0 -7
  149. package/src/logger/index.d.mts.map +0 -1
  150. package/src/logger/log-levels.d.mts +0 -14
  151. package/src/logger/log-levels.d.mts.map +0 -1
  152. package/src/logger/logger-service.interface.d.mts +0 -36
  153. package/src/logger/logger-service.interface.d.mts.map +0 -1
  154. package/src/logger/logger.service.d.mts +0 -57
  155. package/src/logger/logger.service.d.mts.map +0 -1
  156. package/src/logger/logger.tokens.d.mts +0 -36
  157. package/src/logger/logger.tokens.d.mts.map +0 -1
  158. package/src/logger/utils/cli-colors.util.d.mts +0 -10
  159. package/src/logger/utils/cli-colors.util.d.mts.map +0 -1
  160. package/src/logger/utils/filter-log-levelts.util.d.mts +0 -6
  161. package/src/logger/utils/filter-log-levelts.util.d.mts.map +0 -1
  162. package/src/logger/utils/index.d.mts +0 -6
  163. package/src/logger/utils/index.d.mts.map +0 -1
  164. package/src/logger/utils/is-log-level-enabled.d.mts +0 -8
  165. package/src/logger/utils/is-log-level-enabled.d.mts.map +0 -1
  166. package/src/logger/utils/is-log-level.util.d.mts +0 -6
  167. package/src/logger/utils/is-log-level.util.d.mts.map +0 -1
  168. package/src/logger/utils/shared.utils.d.mts +0 -14
  169. package/src/logger/utils/shared.utils.d.mts.map +0 -1
  170. package/src/metadata/controller.metadata.d.mts +0 -13
  171. package/src/metadata/controller.metadata.d.mts.map +0 -1
  172. package/src/metadata/handler.metadata.d.mts +0 -18
  173. package/src/metadata/handler.metadata.d.mts.map +0 -1
  174. package/src/metadata/index.d.mts +0 -4
  175. package/src/metadata/index.d.mts.map +0 -1
  176. package/src/metadata/module.metadata.d.mts +0 -13
  177. package/src/metadata/module.metadata.d.mts.map +0 -1
  178. package/src/navios.application.d.mts +0 -210
  179. package/src/navios.application.d.mts.map +0 -1
  180. package/src/navios.environment.d.mts +0 -11
  181. package/src/navios.environment.d.mts.map +0 -1
  182. package/src/navios.factory.d.mts +0 -68
  183. package/src/navios.factory.d.mts.map +0 -1
  184. package/src/services/guard-runner.service.d.mts +0 -10
  185. package/src/services/guard-runner.service.d.mts.map +0 -1
  186. package/src/services/index.d.mts +0 -3
  187. package/src/services/index.d.mts.map +0 -1
  188. package/src/services/module-loader.service.d.mts +0 -17
  189. package/src/services/module-loader.service.d.mts.map +0 -1
  190. package/src/stores/index.d.mts +0 -2
  191. package/src/stores/index.d.mts.map +0 -1
  192. package/src/stores/request-id.store.d.mts +0 -37
  193. package/src/stores/request-id.store.d.mts.map +0 -1
  194. package/src/tokens/endpoint-adapter.token.d.mts +0 -4
  195. package/src/tokens/endpoint-adapter.token.d.mts.map +0 -1
  196. package/src/tokens/execution-context.token.d.mts +0 -5
  197. package/src/tokens/execution-context.token.d.mts.map +0 -1
  198. package/src/tokens/http-adapter.token.d.mts +0 -4
  199. package/src/tokens/http-adapter.token.d.mts.map +0 -1
  200. package/src/tokens/index.d.mts +0 -9
  201. package/src/tokens/index.d.mts.map +0 -1
  202. package/src/tokens/multipart-adapter.token.d.mts +0 -4
  203. package/src/tokens/multipart-adapter.token.d.mts.map +0 -1
  204. package/src/tokens/reply.token.d.mts +0 -3
  205. package/src/tokens/reply.token.d.mts.map +0 -1
  206. package/src/tokens/request.token.d.mts +0 -3
  207. package/src/tokens/request.token.d.mts.map +0 -1
  208. package/src/tokens/stream-adapter.token.d.mts +0 -4
  209. package/src/tokens/stream-adapter.token.d.mts.map +0 -1
  210. package/src/tokens/xml-stream-adapter.token.d.mts +0 -4
  211. package/src/tokens/xml-stream-adapter.token.d.mts.map +0 -1
@@ -1,210 +0,0 @@
1
- import type { ClassTypeWithInstance } from '@navios/di';
2
- import { Container } from '@navios/di';
3
- import type { AbstractHttpListenOptions, NaviosModule } from './interfaces/index.mjs';
4
- import type { LoggerService, LogLevel } from './logger/index.mjs';
5
- import type { NaviosEnvironmentOptions } from './navios.environment.mjs';
6
- /**
7
- * Options for configuring the Navios application context.
8
- * These options control dependency injection and logging behavior.
9
- */
10
- export interface NaviosApplicationContextOptions {
11
- /**
12
- * Specifies the logger to use. Pass `false` to turn off logging.
13
- *
14
- * - `LoggerService` instance: Use a custom logger implementation
15
- * - `LogLevel[]`: Enable specific log levels (e.g., ['error', 'warn', 'log'])
16
- * - `false`: Disable logging completely
17
- */
18
- logger?: LoggerService | LogLevel[] | false;
19
- /**
20
- * Specifies a custom container to use. Useful for testing.
21
- * If not provided, a new Container will be created.
22
- */
23
- container?: Container;
24
- }
25
- /**
26
- * Complete options for creating a Navios application.
27
- * Extends NaviosApplicationContextOptions with adapter configuration.
28
- */
29
- export interface NaviosApplicationOptions extends NaviosApplicationContextOptions {
30
- /**
31
- * HTTP adapter environment(s) to use for the application.
32
- * Can be a single adapter or an array of adapters.
33
- *
34
- * @example
35
- * ```typescript
36
- * adapter: defineFastifyEnvironment()
37
- * // or
38
- * adapter: [defineFastifyEnvironment(), defineBunEnvironment()]
39
- * ```
40
- */
41
- adapter: NaviosEnvironmentOptions | NaviosEnvironmentOptions[];
42
- }
43
- /**
44
- * Main application class for Navios.
45
- *
46
- * This class represents a Navios application instance and provides methods
47
- * for initializing, configuring, and managing the HTTP server.
48
- *
49
- * @example
50
- * ```typescript
51
- * const app = await NaviosFactory.create(AppModule, {
52
- * adapter: defineFastifyEnvironment(),
53
- * })
54
- *
55
- * app.setGlobalPrefix('/api')
56
- * app.enableCors({ origin: ['http://localhost:3000'] })
57
- * await app.init()
58
- * await app.listen({ port: 3000, host: '0.0.0.0' })
59
- * ```
60
- */
61
- export declare class NaviosApplication {
62
- private environment;
63
- private moduleLoader;
64
- private httpApplication;
65
- private logger;
66
- protected container: Container;
67
- private appModule;
68
- private options;
69
- /**
70
- * Indicates whether the application has been initialized.
71
- * Set to `true` after `init()` completes successfully.
72
- */
73
- isInitialized: boolean;
74
- /**
75
- * Sets up the application with the provided module and options.
76
- * This is called automatically by NaviosFactory.create().
77
- *
78
- * @param appModule - The root application module
79
- * @param options - Application configuration options
80
- * @internal
81
- */
82
- setup(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<void>;
83
- /**
84
- * Gets the dependency injection container used by this application.
85
- *
86
- * @returns The Container instance
87
- */
88
- getContainer(): Container;
89
- /**
90
- * Initializes the application.
91
- *
92
- * This method:
93
- * - Loads all modules and their dependencies
94
- * - Sets up the HTTP server if an adapter is configured
95
- * - Calls onModuleInit hooks on all modules
96
- * - Marks the application as initialized
97
- *
98
- * Must be called before `listen()`.
99
- *
100
- * @throws Error if app module is not set
101
- *
102
- * @example
103
- * ```typescript
104
- * const app = await NaviosFactory.create(AppModule, {
105
- * adapter: defineFastifyEnvironment(),
106
- * })
107
- * await app.init()
108
- * await app.listen({ port: 3000 })
109
- * ```
110
- */
111
- init(): Promise<void>;
112
- private initModules;
113
- /**
114
- * Enables CORS (Cross-Origin Resource Sharing) for the application.
115
- *
116
- * @param options - CORS configuration options (adapter-specific)
117
- * @throws Error if HTTP application is not set
118
- *
119
- * @example
120
- * ```typescript
121
- * app.enableCors({
122
- * origin: ['http://localhost:3000', 'https://example.com'],
123
- * methods: ['GET', 'POST', 'PUT', 'DELETE'],
124
- * credentials: true,
125
- * })
126
- * ```
127
- */
128
- enableCors(options: any): void;
129
- /**
130
- * Enables multipart/form-data support for file uploads.
131
- *
132
- * @param options - Multipart configuration options (adapter-specific)
133
- * @throws Error if HTTP application is not set
134
- *
135
- * @example
136
- * ```typescript
137
- * app.enableMultipart({
138
- * limits: {
139
- * fileSize: 1024 * 1024 * 10, // 10MB
140
- * },
141
- * })
142
- * ```
143
- */
144
- enableMultipart(options: any): void;
145
- /**
146
- * Sets a global prefix for all routes.
147
- *
148
- * @param prefix - The prefix to prepend to all route URLs (e.g., '/api')
149
- * @throws Error if HTTP application is not set
150
- *
151
- * @example
152
- * ```typescript
153
- * app.setGlobalPrefix('/api/v1')
154
- * // All routes will be prefixed with /api/v1
155
- * ```
156
- */
157
- setGlobalPrefix(prefix: string): void;
158
- /**
159
- * Gets the underlying HTTP server instance.
160
- *
161
- * The type of the returned server depends on the adapter used:
162
- * - Fastify adapter: Returns FastifyInstance
163
- * - Bun adapter: Returns Bun.Server
164
- *
165
- * @returns The HTTP server instance
166
- * @throws Error if HTTP application is not set
167
- *
168
- * @example
169
- * ```typescript
170
- * const server = app.getServer()
171
- * // Use adapter-specific server methods
172
- * ```
173
- */
174
- getServer(): any;
175
- /**
176
- * Starts the HTTP server and begins listening for requests.
177
- *
178
- * @param options - Listen options (port, host, etc.)
179
- * @throws Error if HTTP application is not set
180
- *
181
- * @example
182
- * ```typescript
183
- * await app.listen({ port: 3000, host: '0.0.0.0' })
184
- * ```
185
- */
186
- listen(options: AbstractHttpListenOptions): Promise<void>;
187
- /**
188
- * Disposes of application resources.
189
- *
190
- * Cleans up the HTTP server and module loader.
191
- * This method is called automatically by `close()`.
192
- */
193
- dispose(): Promise<void>;
194
- /**
195
- * Closes the application and cleans up all resources.
196
- *
197
- * This is an alias for `dispose()`.
198
- *
199
- * @example
200
- * ```typescript
201
- * // Graceful shutdown
202
- * process.on('SIGTERM', async () => {
203
- * await app.close()
204
- * process.exit(0)
205
- * })
206
- * ```
207
- */
208
- close(): Promise<void>;
209
- }
210
- //# sourceMappingURL=navios.application.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navios.application.d.mts","sourceRoot":"","sources":["navios.application.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAA;AAE1D,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAOxE;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,aAAa,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAA;IAE3C;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,wBACf,SAAQ,+BAA+B;IACvC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,wBAAwB,GAAG,wBAAwB,EAAE,CAAA;CAC/D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBACa,iBAAiB;IAC5B,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,eAAe,CAAiD;IACxE,OAAO,CAAC,MAAM,CAEZ;IACF,SAAS,CAAC,SAAS,YAAoB;IAEvC,OAAO,CAAC,SAAS,CAAmD;IACpE,OAAO,CAAC,OAAO,CAEd;IAED;;;OAGG;IACH,aAAa,UAAQ;IAErB;;;;;;;OAOG;IACG,KAAK,CACT,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC,EAC9C,OAAO,GAAE,wBAER;IASH;;;;OAIG;IACH,YAAY;IAIZ;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,IAAI;YAiBI,WAAW;IAKzB;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,OAAO,EAAE,GAAG;IAOvB;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,OAAO,EAAE,GAAG;IAO5B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM;IAO9B;;;;;;;;;;;;;;;OAeG;IACH,SAAS;IAOT;;;;;;;;;;OAUG;IACG,MAAM,CAAC,OAAO,EAAE,yBAAyB;IAO/C;;;;;OAKG;IACG,OAAO;IASb;;;;;;;;;;;;;OAaG;IACG,KAAK;CAGZ"}
@@ -1,11 +0,0 @@
1
- import type { AnyInjectableType, InjectionToken } from '@navios/di';
2
- export interface NaviosEnvironmentOptions {
3
- httpTokens?: Map<InjectionToken<any, undefined>, AnyInjectableType>;
4
- }
5
- export declare class NaviosEnvironment {
6
- private httpTokens;
7
- setupHttpEnvironment(tokens: Map<InjectionToken<any, undefined>, AnyInjectableType>): void;
8
- getHttpToken(token: InjectionToken<any, undefined>): AnyInjectableType | undefined;
9
- hasHttpSetup(): boolean;
10
- }
11
- //# sourceMappingURL=navios.environment.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navios.environment.d.mts","sourceRoot":"","sources":["navios.environment.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAInE,MAAM,WAAW,wBAAwB;IAEvC,UAAU,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAA;CACpE;AAED,qBACa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAGf;IAEH,oBAAoB,CAClB,MAAM,EAAE,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAKhE,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC;IAIlD,YAAY;CAGb"}
@@ -1,68 +0,0 @@
1
- import type { ClassTypeWithInstance } from '@navios/di';
2
- import type { NaviosModule } from './interfaces/index.mjs';
3
- import type { NaviosApplicationOptions } from './navios.application.mjs';
4
- import { NaviosApplication } from './navios.application.mjs';
5
- /**
6
- * Factory class for creating and configuring Navios applications.
7
- *
8
- * This is the main entry point for bootstrapping a Navios application.
9
- * It handles dependency injection container setup, adapter registration,
10
- * and logger configuration.
11
- *
12
- * @example
13
- * ```typescript
14
- * import { NaviosFactory } from '@navios/core'
15
- * import { defineFastifyEnvironment } from '@navios/adapter-fastify'
16
- *
17
- * const app = await NaviosFactory.create(AppModule, {
18
- * adapter: defineFastifyEnvironment(),
19
- * logger: ['log', 'error', 'warn'],
20
- * })
21
- *
22
- * await app.init()
23
- * await app.listen({ port: 3000 })
24
- * ```
25
- */
26
- export declare class NaviosFactory {
27
- /**
28
- * Creates a new Navios application instance.
29
- *
30
- * This method sets up the dependency injection container, registers the HTTP adapter,
31
- * configures logging, and initializes the application with the provided module.
32
- *
33
- * @param appModule - The root application module class decorated with @Module()
34
- * @param options - Configuration options for the application
35
- * @param options.adapter - HTTP adapter environment (required for HTTP server functionality)
36
- * @param options.logger - Logger configuration. Can be:
37
- * - A LoggerService instance for custom logging
38
- * - An array of LogLevel strings to enable specific log levels
39
- * - `false` to disable logging
40
- * @param options.container - Optional custom dependency injection container (useful for testing)
41
- * @returns A configured NaviosApplication instance ready to be initialized
42
- *
43
- * @example
44
- * ```typescript
45
- * // Basic setup with Fastify adapter
46
- * const app = await NaviosFactory.create(AppModule, {
47
- * adapter: defineFastifyEnvironment(),
48
- * })
49
- *
50
- * // With custom logger configuration
51
- * const app = await NaviosFactory.create(AppModule, {
52
- * adapter: defineFastifyEnvironment(),
53
- * logger: ['error', 'warn', 'log'],
54
- * })
55
- *
56
- * // With custom container for testing
57
- * const container = new Container()
58
- * const app = await NaviosFactory.create(AppModule, {
59
- * adapter: defineFastifyEnvironment(),
60
- * container,
61
- * })
62
- * ```
63
- */
64
- static create(appModule: ClassTypeWithInstance<NaviosModule>, options?: NaviosApplicationOptions): Promise<NaviosApplication>;
65
- private static registerEnvironment;
66
- private static registerLoggerConfiguration;
67
- }
68
- //# sourceMappingURL=navios.factory.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navios.factory.d.mts","sourceRoot":"","sources":["navios.factory.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,YAAY,CAAA;AAInB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;WACU,MAAM,CACjB,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC,EAC9C,OAAO,GAAE,wBAER;mBAekB,mBAAmB;mBAanB,2BAA2B;CAyBjD"}
@@ -1,10 +0,0 @@
1
- import type { ClassTypeWithInstance, ScopedContainer } from '@navios/di';
2
- import { InjectionToken } from '@navios/di';
3
- import type { AbstractExecutionContext, CanActivate } from '../interfaces/index.mjs';
4
- import type { ControllerMetadata, HandlerMetadata, ModuleMetadata } from '../metadata/index.mjs';
5
- export declare class GuardRunnerService {
6
- private readonly logger;
7
- runGuards(allGuards: Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>, executionContext: AbstractExecutionContext, context: ScopedContainer): Promise<boolean>;
8
- makeContext(moduleMetadata: ModuleMetadata, controllerMetadata: ControllerMetadata, endpoint: HandlerMetadata): Set<ClassTypeWithInstance<CanActivate> | InjectionToken<CanActivate, undefined>>;
9
- }
10
- //# sourceMappingURL=guard-runner.service.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guard-runner.service.d.mts","sourceRoot":"","sources":["guard-runner.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAExE,OAAO,EAAsB,cAAc,EAAE,MAAM,YAAY,CAAA;AAE/D,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAA;AAK9B,qBACa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAErB;IACI,SAAS,CACb,SAAS,EAAE,GAAG,CACV,qBAAqB,CAAC,WAAW,CAAC,GAClC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CACzC,EACD,gBAAgB,EAAE,wBAAwB,EAC1C,OAAO,EAAE,eAAe;IA0C1B,WAAW,CACT,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,eAAe,GACxB,GAAG,CACJ,qBAAqB,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAC5E;CAyBF"}
@@ -1,3 +0,0 @@
1
- export * from './guard-runner.service.mjs';
2
- export * from './module-loader.service.mjs';
3
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA"}
@@ -1,17 +0,0 @@
1
- import type { ClassTypeWithInstance } from '@navios/di';
2
- import { Container } from '@navios/di';
3
- import type { NaviosModule } from '../interfaces/index.mjs';
4
- import type { ModuleMetadata } from '../metadata/index.mjs';
5
- export declare class ModuleLoaderService {
6
- private logger;
7
- protected container: Container;
8
- private modulesMetadata;
9
- private loadedModules;
10
- private initialized;
11
- loadModules(appModule: ClassTypeWithInstance<NaviosModule>): Promise<void>;
12
- private traverseModules;
13
- private mergeMetadata;
14
- getAllModules(): Map<string, ModuleMetadata>;
15
- dispose(): void;
16
- }
17
- //# sourceMappingURL=module-loader.service.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module-loader.service.d.mts","sourceRoot":"","sources":["module-loader.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAK3D,qBACa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAEZ;IACF,SAAS,CAAC,SAAS,YAAoB;IACvC,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,WAAW,CAAQ;IAErB,WAAW,CAAC,SAAS,EAAE,qBAAqB,CAAC,YAAY,CAAC;YAQlD,eAAe;IA+B7B,OAAO,CAAC,aAAa;IAkBrB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAG5C,OAAO;CAKR"}
@@ -1,2 +0,0 @@
1
- export * from './request-id.store.mjs';
2
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
@@ -1,37 +0,0 @@
1
- import { AsyncLocalStorage } from 'node:async_hooks';
2
- /**
3
- * AsyncLocalStorage store for the current request ID.
4
- *
5
- * This allows logging and other services to access the current request ID
6
- * without explicitly passing it through the call stack.
7
- *
8
- * @example
9
- * ```typescript
10
- * import { requestIdStore, runWithRequestId, getRequestId } from '@navios/core'
11
- *
12
- * // Run code with a request ID in context
13
- * runWithRequestId('req-123', () => {
14
- * // Inside this callback, getRequestId() returns 'req-123'
15
- * logger.log('Processing request') // Will include request ID if logger is configured
16
- * })
17
- *
18
- * // Get current request ID (returns undefined if not in a request context)
19
- * const currentId = getRequestId()
20
- * ```
21
- */
22
- export declare const requestIdStore: AsyncLocalStorage<string>;
23
- /**
24
- * Runs a function with a request ID in the async local storage context.
25
- *
26
- * @param requestId - The request ID to set for this context
27
- * @param fn - The function to run within this context
28
- * @returns The return value of the function
29
- */
30
- export declare function runWithRequestId<R>(requestId: string, fn: () => R): R;
31
- /**
32
- * Gets the current request ID from the async local storage context.
33
- *
34
- * @returns The current request ID, or undefined if not in a request context
35
- */
36
- export declare function getRequestId(): string | undefined;
37
- //# sourceMappingURL=request-id.store.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-id.store.d.mts","sourceRoot":"","sources":["request-id.store.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,2BAAkC,CAAA;AAE7D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAErE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAEjD"}
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
3
- export declare const EndpointAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
4
- //# sourceMappingURL=endpoint-adapter.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoint-adapter.token.d.mts","sourceRoot":"","sources":["endpoint-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,oBAAoB,uEAG9B,CAAA"}
@@ -1,5 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractExecutionContext } from '../interfaces/index.mjs';
3
- export declare const ExecutionContextInjectionToken = "ExecutionContextInjectionToken";
4
- export declare const ExecutionContext: InjectionToken<AbstractExecutionContext, undefined, false>;
5
- //# sourceMappingURL=execution-context.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-context.token.d.mts","sourceRoot":"","sources":["execution-context.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,eAAO,MAAM,8BAA8B,mCAAmC,CAAA;AAE9E,eAAO,MAAM,gBAAgB,4DAE5B,CAAA"}
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractHttpAdapterInterface } from '../interfaces/index.mjs';
3
- export declare const HttpAdapterToken: InjectionToken<AbstractHttpAdapterInterface<any, any, any, any>, undefined, false>;
4
- //# sourceMappingURL=http-adapter.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-adapter.token.d.mts","sourceRoot":"","sources":["http-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAE3E,eAAO,MAAM,gBAAgB,oFAG1B,CAAA"}
@@ -1,9 +0,0 @@
1
- export * from './endpoint-adapter.token.mjs';
2
- export * from './execution-context.token.mjs';
3
- export * from './http-adapter.token.mjs';
4
- export * from './multipart-adapter.token.mjs';
5
- export * from './reply.token.mjs';
6
- export * from './request.token.mjs';
7
- export * from './stream-adapter.token.mjs';
8
- export * from './xml-stream-adapter.token.mjs';
9
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["index.mts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gCAAgC,CAAA"}
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
3
- export declare const MultipartAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
4
- //# sourceMappingURL=multipart-adapter.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multipart-adapter.token.d.mts","sourceRoot":"","sources":["multipart-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,qBAAqB,uEAG/B,CAAA"}
@@ -1,3 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- export declare const Reply: InjectionToken<any, undefined, false>;
3
- //# sourceMappingURL=reply.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reply.token.d.mts","sourceRoot":"","sources":["reply.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,KAAK,uCAA2C,CAAA"}
@@ -1,3 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- export declare const Request: InjectionToken<any, undefined, false>;
3
- //# sourceMappingURL=request.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.token.d.mts","sourceRoot":"","sources":["request.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,OAAO,uCAA6C,CAAA"}
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
3
- export declare const StreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
4
- //# sourceMappingURL=stream-adapter.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-adapter.token.d.mts","sourceRoot":"","sources":["stream-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,kBAAkB,uEAG5B,CAAA"}
@@ -1,4 +0,0 @@
1
- import { InjectionToken } from '@navios/di';
2
- import type { AbstractHttpHandlerAdapterInterface } from '../interfaces/index.mjs';
3
- export declare const XmlStreamAdapterToken: InjectionToken<AbstractHttpHandlerAdapterInterface, undefined, false>;
4
- //# sourceMappingURL=xml-stream-adapter.token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xml-stream-adapter.token.d.mts","sourceRoot":"","sources":["xml-stream-adapter.token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAA;AAElF,eAAO,MAAM,qBAAqB,uEAG/B,CAAA"}