@navios/core 1.1.0 → 2.0.0-alpha.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 (237) hide show
  1. package/CHANGELOG.md +85 -13
  2. package/README.md +69 -220
  3. package/lib/async-context-BAdt7bno.d.mts +239 -0
  4. package/lib/async-context-BAdt7bno.d.mts.map +1 -0
  5. package/lib/async-context-RsWmy2Hi.d.cts +239 -0
  6. package/lib/async-context-RsWmy2Hi.d.cts.map +1 -0
  7. package/lib/attribute-factory-BW1kgBqf.d.mts +70 -0
  8. package/lib/attribute-factory-BW1kgBqf.d.mts.map +1 -0
  9. package/lib/attribute-factory-DqN4x5XM.d.cts +70 -0
  10. package/lib/attribute-factory-DqN4x5XM.d.cts.map +1 -0
  11. package/lib/attribute-value-BNiJjxl1.mjs +225 -0
  12. package/lib/attribute-value-BNiJjxl1.mjs.map +1 -0
  13. package/lib/attribute-value-Cux5HhOL.cjs +314 -0
  14. package/lib/attribute-value-Cux5HhOL.cjs.map +1 -0
  15. package/lib/basic-execution-context-5uq2DvEA.cjs +318 -0
  16. package/lib/basic-execution-context-5uq2DvEA.cjs.map +1 -0
  17. package/lib/basic-execution-context-u1VktGoM.mjs +277 -0
  18. package/lib/basic-execution-context-u1VktGoM.mjs.map +1 -0
  19. package/lib/execution-context-BVSmLkYp.d.cts +71 -0
  20. package/lib/execution-context-BVSmLkYp.d.cts.map +1 -0
  21. package/lib/execution-context-C5F9rojO.d.mts +71 -0
  22. package/lib/execution-context-C5F9rojO.d.mts.map +1 -0
  23. package/lib/execution-context-token--cKS4cJv.cjs +270 -0
  24. package/lib/execution-context-token--cKS4cJv.cjs.map +1 -0
  25. package/lib/execution-context-token-Cb3M3Ao0.mjs +223 -0
  26. package/lib/execution-context-token-Cb3M3Ao0.mjs.map +1 -0
  27. package/lib/index.cjs +1672 -4426
  28. package/lib/index.cjs.map +1 -1
  29. package/lib/index.d.cts +842 -3
  30. package/lib/index.d.cts.map +1 -0
  31. package/lib/index.d.mts +842 -3
  32. package/lib/index.d.mts.map +1 -0
  33. package/lib/index.mjs +1559 -4221
  34. package/lib/index.mjs.map +1 -1
  35. package/lib/legacy-compat/index.cjs +72 -371
  36. package/lib/legacy-compat/index.cjs.map +1 -1
  37. package/lib/legacy-compat/index.d.cts +42 -382
  38. package/lib/legacy-compat/index.d.cts.map +1 -1
  39. package/lib/legacy-compat/index.d.mts +41 -382
  40. package/lib/legacy-compat/index.d.mts.map +1 -1
  41. package/lib/legacy-compat/index.mjs +51 -345
  42. package/lib/legacy-compat/index.mjs.map +1 -1
  43. package/lib/module-Bz83ZnJ5.cjs +173 -0
  44. package/lib/module-Bz83ZnJ5.cjs.map +1 -0
  45. package/lib/module-options-CSqQUSTm.d.mts +51 -0
  46. package/lib/module-options-CSqQUSTm.d.mts.map +1 -0
  47. package/lib/module-options-DSRBri4J.d.cts +51 -0
  48. package/lib/module-options-DSRBri4J.d.cts.map +1 -0
  49. package/lib/module-zPXwR2qp.mjs +138 -0
  50. package/lib/module-zPXwR2qp.mjs.map +1 -0
  51. package/lib/settled-within-B6gpu2XW.cjs +32 -0
  52. package/lib/settled-within-B6gpu2XW.cjs.map +1 -0
  53. package/lib/settled-within-Bc2pj8WB.mjs +21 -0
  54. package/lib/settled-within-Bc2pj8WB.mjs.map +1 -0
  55. package/lib/testing/index.cjs +74 -414
  56. package/lib/testing/index.cjs.map +1 -1
  57. package/lib/testing/index.d.cts +25 -385
  58. package/lib/testing/index.d.cts.map +1 -1
  59. package/lib/testing/index.d.mts +24 -385
  60. package/lib/testing/index.d.mts.map +1 -1
  61. package/lib/testing/index.mjs +72 -408
  62. package/lib/testing/index.mjs.map +1 -1
  63. package/lib/transport.cjs +36 -0
  64. package/lib/transport.d.cts +254 -0
  65. package/lib/transport.d.cts.map +1 -0
  66. package/lib/transport.d.mts +254 -0
  67. package/lib/transport.d.mts.map +1 -0
  68. package/lib/transport.mjs +6 -0
  69. package/package.json +37 -17
  70. package/docs/README.md +0 -316
  71. package/docs/adapters.md +0 -308
  72. package/docs/application-setup.md +0 -524
  73. package/docs/attributes.md +0 -689
  74. package/docs/controllers.md +0 -373
  75. package/docs/endpoints.md +0 -444
  76. package/docs/exceptions.md +0 -352
  77. package/docs/guards.md +0 -550
  78. package/docs/legacy-compat.md +0 -356
  79. package/docs/modules.md +0 -377
  80. package/docs/quick-start.md +0 -290
  81. package/docs/services.md +0 -427
  82. package/docs/testing.md +0 -827
  83. package/lib/index-3LcTrbxz.d.mts +0 -3804
  84. package/lib/index-3LcTrbxz.d.mts.map +0 -1
  85. package/lib/index-B14SekVb.d.cts +0 -3804
  86. package/lib/index-B14SekVb.d.cts.map +0 -1
  87. package/lib/navios.factory-CUrO_p6K.cjs +0 -4538
  88. package/lib/navios.factory-CUrO_p6K.cjs.map +0 -1
  89. package/lib/navios.factory-DjUOOVVL.mjs +0 -4151
  90. package/lib/navios.factory-DjUOOVVL.mjs.map +0 -1
  91. package/lib/tokens-BEuBMGGX.cjs +0 -193
  92. package/lib/tokens-BEuBMGGX.cjs.map +0 -1
  93. package/lib/tokens-COyNGV1I.mjs +0 -97
  94. package/lib/tokens-COyNGV1I.mjs.map +0 -1
  95. package/lib/use-guards.decorator-DLmRl2CV.mjs +0 -336
  96. package/lib/use-guards.decorator-DLmRl2CV.mjs.map +0 -1
  97. package/lib/use-guards.decorator-DhumFTk3.cjs +0 -444
  98. package/lib/use-guards.decorator-DhumFTk3.cjs.map +0 -1
  99. package/project.json +0 -66
  100. package/src/__tests__/attribute.factory.spec.mts +0 -300
  101. package/src/__tests__/config.service.spec.mts +0 -43
  102. package/src/__tests__/console-logger.service.spec.mts +0 -312
  103. package/src/__tests__/controller-resolver.spec.mts +0 -229
  104. package/src/__tests__/controller.spec.mts +0 -58
  105. package/src/__tests__/guard-runner.service.spec.mts +0 -399
  106. package/src/__tests__/logger.service.spec.mts +0 -147
  107. package/src/__tests__/responders.spec.mts +0 -340
  108. package/src/__tests__/testing-module.spec.mts +0 -459
  109. package/src/__tests__/unit-testing-module.spec.mts +0 -424
  110. package/src/attribute.factory.mts +0 -325
  111. package/src/config/config-service.interface.mts +0 -47
  112. package/src/config/config.provider.mts +0 -69
  113. package/src/config/config.service.mts +0 -176
  114. package/src/config/index.mts +0 -5
  115. package/src/config/types.mts +0 -58
  116. package/src/config/utils/helpers.mts +0 -23
  117. package/src/config/utils/index.mts +0 -1
  118. package/src/decorators/controller.decorator.mts +0 -81
  119. package/src/decorators/endpoint.decorator.mts +0 -181
  120. package/src/decorators/header.decorator.mts +0 -38
  121. package/src/decorators/http-code.decorator.mts +0 -38
  122. package/src/decorators/index.mts +0 -8
  123. package/src/decorators/module.decorator.mts +0 -106
  124. package/src/decorators/multipart.decorator.mts +0 -169
  125. package/src/decorators/stream.decorator.mts +0 -155
  126. package/src/decorators/use-guards.decorator.mts +0 -73
  127. package/src/exceptions/bad-request.exception.mts +0 -28
  128. package/src/exceptions/conflict.exception.mts +0 -31
  129. package/src/exceptions/forbidden.exception.mts +0 -30
  130. package/src/exceptions/http.exception.mts +0 -33
  131. package/src/exceptions/index.mts +0 -7
  132. package/src/exceptions/internal-server-error.exception.mts +0 -33
  133. package/src/exceptions/not-found.exception.mts +0 -33
  134. package/src/exceptions/unauthorized.exception.mts +0 -30
  135. package/src/factories/adapter.factory.mts +0 -20
  136. package/src/factories/endpoint-adapter.factory.mts +0 -21
  137. package/src/factories/http-adapter.factory.mts +0 -20
  138. package/src/factories/index.mts +0 -8
  139. package/src/factories/multipart-adapter.factory.mts +0 -21
  140. package/src/factories/reply.factory.mts +0 -21
  141. package/src/factories/request.factory.mts +0 -21
  142. package/src/factories/stream-adapter.factory.mts +0 -20
  143. package/src/factories/xml-stream-adapter.factory.mts +0 -20
  144. package/src/index.mts +0 -16
  145. package/src/interfaces/abstract-adapter.interface.mts +0 -32
  146. package/src/interfaces/abstract-execution-context.inteface.mts +0 -48
  147. package/src/interfaces/abstract-http-adapter.interface.mts +0 -79
  148. package/src/interfaces/abstract-http-cors-options.interface.mts +0 -59
  149. package/src/interfaces/abstract-http-handler-adapter.interface.mts +0 -127
  150. package/src/interfaces/abstract-http-listen-options.interface.mts +0 -4
  151. package/src/interfaces/adapter-environment.interface.mts +0 -74
  152. package/src/interfaces/can-activate.mts +0 -38
  153. package/src/interfaces/http-header.mts +0 -18
  154. package/src/interfaces/index.mts +0 -14
  155. package/src/interfaces/navios-module.mts +0 -28
  156. package/src/interfaces/plugin-context.mts +0 -104
  157. package/src/interfaces/plugin-stage.mts +0 -62
  158. package/src/interfaces/plugin.interface.mts +0 -119
  159. package/src/interfaces/staged-plugin.interface.mts +0 -209
  160. package/src/legacy-compat/__type-tests__/legacy-decorators.spec-d.mts +0 -521
  161. package/src/legacy-compat/__type-tests__/tsconfig.json +0 -15
  162. package/src/legacy-compat/attribute.factory.mts +0 -351
  163. package/src/legacy-compat/decorators/controller.decorator.mts +0 -31
  164. package/src/legacy-compat/decorators/endpoint.decorator.mts +0 -73
  165. package/src/legacy-compat/decorators/header.decorator.mts +0 -43
  166. package/src/legacy-compat/decorators/http-code.decorator.mts +0 -39
  167. package/src/legacy-compat/decorators/index.mts +0 -11
  168. package/src/legacy-compat/decorators/module.decorator.mts +0 -37
  169. package/src/legacy-compat/decorators/multipart.decorator.mts +0 -72
  170. package/src/legacy-compat/decorators/stream.decorator.mts +0 -89
  171. package/src/legacy-compat/decorators/use-guards.decorator.mts +0 -80
  172. package/src/legacy-compat/index.mts +0 -57
  173. package/src/logger/README.md +0 -3
  174. package/src/logger/console-logger.service.mts +0 -714
  175. package/src/logger/index.mts +0 -6
  176. package/src/logger/log-levels.mts +0 -21
  177. package/src/logger/logger-service.interface.mts +0 -42
  178. package/src/logger/logger.service.mts +0 -113
  179. package/src/logger/logger.tokens.mts +0 -44
  180. package/src/logger/utils/cli-colors.util.mts +0 -17
  181. package/src/logger/utils/filter-log-levelts.util.mts +0 -29
  182. package/src/logger/utils/index.mts +0 -5
  183. package/src/logger/utils/is-log-level-enabled.mts +0 -33
  184. package/src/logger/utils/is-log-level.util.mts +0 -10
  185. package/src/logger/utils/shared.utils.mts +0 -51
  186. package/src/metadata/controller.metadata.mts +0 -79
  187. package/src/metadata/handler.metadata.mts +0 -80
  188. package/src/metadata/index.mts +0 -4
  189. package/src/metadata/module.metadata.mts +0 -116
  190. package/src/metadata/navios-managed.metadata.mts +0 -42
  191. package/src/navios.application.mts +0 -678
  192. package/src/navios.environment.mts +0 -42
  193. package/src/navios.factory.mts +0 -158
  194. package/src/responders/enums/framework-error.enum.mts +0 -38
  195. package/src/responders/enums/index.mts +0 -1
  196. package/src/responders/index.mts +0 -4
  197. package/src/responders/interfaces/error-responder.interface.mts +0 -42
  198. package/src/responders/interfaces/error-response.interface.mts +0 -22
  199. package/src/responders/interfaces/index.mts +0 -3
  200. package/src/responders/interfaces/problem-details.interface.mts +0 -34
  201. package/src/responders/services/error-response-producer.service.mts +0 -143
  202. package/src/responders/services/forbidden-responder.service.mts +0 -77
  203. package/src/responders/services/index.mts +0 -5
  204. package/src/responders/services/internal-server-error-responder.service.mts +0 -57
  205. package/src/responders/services/not-found-responder.service.mts +0 -76
  206. package/src/responders/services/validation-error-responder.service.mts +0 -78
  207. package/src/responders/tokens/index.mts +0 -1
  208. package/src/responders/tokens/responder.tokens.mts +0 -84
  209. package/src/services/abstract-handler-adapter.service.mts +0 -366
  210. package/src/services/guard-runner.service.mts +0 -152
  211. package/src/services/index.mts +0 -4
  212. package/src/services/instance-resolver.service.mts +0 -177
  213. package/src/services/module-loader.service.mts +0 -255
  214. package/src/stores/index.mts +0 -1
  215. package/src/stores/request-id.store.mts +0 -85
  216. package/src/testing/index.mts +0 -3
  217. package/src/testing/testing-module.mts +0 -393
  218. package/src/testing/unit-testing-module.mts +0 -298
  219. package/src/tokens/adapter.token.mts +0 -6
  220. package/src/tokens/endpoint-adapter.token.mts +0 -8
  221. package/src/tokens/execution-context.token.mts +0 -9
  222. package/src/tokens/http-adapter.token.mts +0 -8
  223. package/src/tokens/index.mts +0 -10
  224. package/src/tokens/multipart-adapter.token.mts +0 -8
  225. package/src/tokens/navios-options.token.mts +0 -6
  226. package/src/tokens/reply.token.mts +0 -3
  227. package/src/tokens/request.token.mts +0 -3
  228. package/src/tokens/stream-adapter.token.mts +0 -8
  229. package/src/tokens/xml-stream-adapter.token.mts +0 -8
  230. package/src/utils/adapter-supports.util.mts +0 -47
  231. package/src/utils/define-plugin.mts +0 -251
  232. package/src/utils/index.mts +0 -2
  233. package/tsconfig.json +0 -21
  234. package/tsconfig.lib.json +0 -8
  235. package/tsconfig.spec.json +0 -15
  236. package/tsdown.config.mts +0 -35
  237. package/vitest.config.mts +0 -15
@@ -0,0 +1,254 @@
1
+ /**
2
+ * What the author of a transport needs and application code does not: the
3
+ * transport contract, the module graph, handler metadata, and the pieces of
4
+ * an execution context.
5
+ *
6
+ * Application code imports from `@navios/core`.
7
+ */
8
+ import { a as ContextValue, i as ContextKey, n as ExecutionContext, r as HandlerInfo } from "./execution-context-BVSmLkYp.cjs";
9
+ import { a as TransportDefinition, d as buildModuleGraph, f as moduleClasses, h as needsScope, l as defineTransport, p as ContextHost, r as runInContext, s as TransportHost, u as ModuleNode } from "./async-context-RsWmy2Hi.cjs";
10
+ import { ClassType, Container, Provider, ScopedContainer } from "@navios/di";
11
+ import { constructedInstances, disposeScope } from "@navios/di/internal";
12
+ import { a as Interceptor, i as AttributeValue, n as Guard } from "./module-options-DSRBri4J.cjs";
13
+ /** The longest delay a timer takes; a longer one fires at once. */
14
+ export declare const MAX_DELAY_MS: number;
15
+ /**
16
+ * Whether `work` settles within `ms`, or within `MAX_DELAY_MS` when `ms` is
17
+ * longer. Rejects when it rejects in time; a later rejection is dropped.
18
+ */
19
+ export declare function settledWithin(work: PromiseLike<unknown>, ms: number): Promise<boolean>;
20
+ /** The `metadata` of a decorator context. */
21
+ type DecoratorMetadata = Record<PropertyKey, unknown>;
22
+ /**
23
+ * The value stored in decorator metadata under `key`, created for this class
24
+ * from what a parent class has, if anything. The metadata object of a class
25
+ * inherits from that of its parent, so writing to an inherited value would
26
+ * change the parent.
27
+ */
28
+ export declare function ownMetadata<T>(metadata: DecoratorMetadata, key: symbol, create: (inherited?: T) => T): T;
29
+ /** The metadata of a decorator context, which has to have one. */
30
+ export declare function requireMetadata(context: {
31
+ metadata?: DecoratorMetadata;
32
+ }): DecoratorMetadata;
33
+ interface ModuleMetadata {
34
+ imports: ClassType[];
35
+ guards: ClassType[];
36
+ interceptors: ClassType[];
37
+ providers: Provider[];
38
+ attributes: Map<symbol, unknown>;
39
+ /**
40
+ * Every option the module system itself does not use, by option name, as
41
+ * written. A transport reads its own from here.
42
+ */
43
+ entries: Map<string, unknown>;
44
+ }
45
+ export declare function getModuleMetadata(target: ClassType): ModuleMetadata;
46
+ /**
47
+ * What decorators and `handler()` options can attach to a handler.
48
+ */
49
+ interface HandlerExtras {
50
+ guards: ClassType[];
51
+ interceptors: ClassType[];
52
+ attributes: Map<symbol, unknown>;
53
+ }
54
+ /**
55
+ * A class member that is, or may become, a handler: what decorators attached
56
+ * to it.
57
+ */
58
+ interface MethodHandlerMetadata extends HandlerExtras {
59
+ name: string;
60
+ /**
61
+ * What makes the member a handler of a transport, under that transport's
62
+ * own symbol.
63
+ */
64
+ entries: Map<symbol, unknown>;
65
+ }
66
+ /**
67
+ * What decorators attached to a member, inherited ones included, to read and to
68
+ * add to.
69
+ */
70
+ export declare function memberMetadata(context: {
71
+ metadata?: DecoratorMetadata;
72
+ }, name: string): MethodHandlerMetadata;
73
+ /** What a transport's decorator for handler classes may take. */
74
+ interface HandlerClassOptions {
75
+ guards?: Iterable<ClassType>;
76
+ interceptors?: Iterable<ClassType>;
77
+ attributes?: AttributeValue[];
78
+ }
79
+ /** A class that owns handlers: what applies to all of them, and its members. */
80
+ interface HandlerClassMetadata extends HandlerExtras {
81
+ /** The members decorators were applied to, by name. */
82
+ members: Map<string, MethodHandlerMetadata>;
83
+ }
84
+ /**
85
+ * What decorators attached to a class of handlers and to its members, together
86
+ * with the options of the class decorator that asks. The lists are live:
87
+ * `@UseGuards` and the like placed above that decorator run after it and are
88
+ * still seen.
89
+ */
90
+ export declare function describeHandlerClass(context: {
91
+ metadata?: DecoratorMetadata;
92
+ }, options?: HandlerClassOptions): HandlerClassMetadata;
93
+ /** What a class decorator stores on the class it decorates. */
94
+ interface ClassMetadata<T> {
95
+ /** Stores `value` on `target`, where it is not enumerable and can be replaced. */
96
+ define(target: ClassType, value: T): void;
97
+ /**
98
+ * What is stored on `target` itself. A subclass does not inherit it: it is
99
+ * not what the decorator makes of a class unless it is decorated itself.
100
+ * Throws when there is none.
101
+ */
102
+ get(target: ClassType): T;
103
+ /** Whether `get` would find something. */
104
+ has(target: ClassType): boolean;
105
+ }
106
+ /**
107
+ * Metadata that a class decorator stores on classes under `key`. `what` and
108
+ * `decorator` name it when a class has none: `Users is not a controller. Make
109
+ * sure it is decorated with @Controller.`
110
+ *
111
+ * ```ts
112
+ * const queueHandlers = classMetadata<HandlerClassMetadata>(
113
+ * Symbol.for('my-transport.handlers'),
114
+ * 'a queue handler',
115
+ * 'QueueHandler',
116
+ * )
117
+ * ```
118
+ */
119
+ export declare function classMetadata<T>(key: symbol, what: string, decorator: string): ClassMetadata<T>;
120
+ interface Extras {
121
+ readonly guards: readonly ClassType[];
122
+ readonly interceptors: readonly ClassType[];
123
+ }
124
+ interface OwnExtras extends Extras {
125
+ readonly attributes: ReadonlyMap<symbol, unknown>;
126
+ }
127
+ interface HandlerChainInput {
128
+ /**
129
+ * Interceptors around every handler of the application or of the transport,
130
+ * outermost first.
131
+ */
132
+ application: readonly ClassType[];
133
+ /** The module the handler belongs to, with what it inherits. */
134
+ node: Extras & Pick<ModuleNode, 'module' | 'attributes' | 'disputed'>;
135
+ /** The class that owns the handler. */
136
+ controller: ClassType;
137
+ /** What applies to every handler of `controller`. */
138
+ owner: OwnExtras;
139
+ /** The name of the handler in its class. */
140
+ handlerName: string;
141
+ /** The handler itself. */
142
+ member: OwnExtras;
143
+ }
144
+ interface HandlerChain {
145
+ /** What the contexts of the handler tell about it. */
146
+ info: HandlerInfo;
147
+ /** Interceptors around the guards: those of the application. */
148
+ outer: ClassType[];
149
+ /** Interceptors inside the guards: those of the module, the class and the handler. */
150
+ inner: ClassType[];
151
+ }
152
+ /**
153
+ * The guards and interceptors that apply to one handler, in the order they
154
+ * run, and what its contexts tell about it: the interceptors of the
155
+ * application, then the guards from the module chain, the owning class and
156
+ * the handler, then the interceptors of the same three. A class that appears
157
+ * twice is kept where it first appears. `info.guards` are the guards and
158
+ * `info.interceptors` the interceptors, `outer` and then `inner`.
159
+ *
160
+ * An interceptor of the application sees every execution, denied ones
161
+ * included, as tracing and logging need. One that is attached to handlers runs
162
+ * only for what their guards let through.
163
+ *
164
+ * Throws when the handler would inherit an attribute that the importers of its
165
+ * module do not agree about.
166
+ *
167
+ * Every transport uses this, so the rule is the same everywhere.
168
+ * `resolveChain` resolves the chain and `runChain` runs it.
169
+ */
170
+ export declare function handlerChain(input: HandlerChainInput): HandlerChain;
171
+ /** A handler's chain with its instances, ready to run. */
172
+ interface ResolvedChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown> {
173
+ readonly outer: ReadonlyArray<Interceptor<Ctx, Result>>;
174
+ readonly guards: ReadonlyArray<{
175
+ readonly type: ClassType;
176
+ readonly guard: Guard<Ctx>;
177
+ }>;
178
+ readonly inner: ReadonlyArray<Interceptor<Ctx, Result>>;
179
+ }
180
+ /**
181
+ * Resolves the classes of a chain that `handlerChain` returned. A transport
182
+ * does this once per handler, while it is set up.
183
+ */
184
+ export declare function resolveChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown>(container: Pick<Container, 'get'>, chain: {
185
+ readonly info: Pick<HandlerInfo, 'guards'>;
186
+ readonly outer: readonly ClassType[];
187
+ readonly inner: readonly ClassType[];
188
+ }): Promise<ResolvedChain<Ctx, Result>>;
189
+ /**
190
+ * Runs a handler with what applies to it: the outer interceptors, the guards
191
+ * one after another, the inner interceptors, the handler. When a guard refuses,
192
+ * nothing further runs and `onDenied` says what becomes of the execution: what
193
+ * it returns is the result, and what it throws is the failure.
194
+ */
195
+ export declare function runChain<Ctx extends ExecutionContext, Result>(ctx: Ctx, chain: ResolvedChain<Ctx, Result>, handler: () => Result | Promise<Result>, onDenied: (guard: ClassType) => Result | Promise<Result>): Promise<Result>;
196
+ /**
197
+ * Runs a handler with what applies to it, as `runChain`, in the async context
198
+ * when the application keeps one, and then finishes its context, whatever the
199
+ * outcome. The context is finished inside the async context, so that
200
+ * `currentContext()` still answers in `onFinish` callbacks.
201
+ */
202
+ export declare function executeChain<Ctx extends ExecutionContext & {
203
+ finish(): Promise<void>;
204
+ }, Result>(host: {
205
+ readonly asyncContext: boolean;
206
+ }, ctx: Ctx, chain: ResolvedChain<Ctx, Result>, handler: () => Result | Promise<Result>, onDenied: (guard: ClassType) => Result | Promise<Result>): Promise<Result>;
207
+ interface BasicExecutionContextInit {
208
+ /** The transport kind, for example `'cli'`. */
209
+ kind: string;
210
+ id: string;
211
+ handler: HandlerInfo;
212
+ host: ContextHost;
213
+ }
214
+ /**
215
+ * An `ExecutionContext` for transports that need nothing beyond the neutral
216
+ * contract. The transport creates one per execution and calls `finish()` when
217
+ * the handler is done.
218
+ */
219
+ export declare class BasicExecutionContext implements ExecutionContext {
220
+ readonly kind: string;
221
+ readonly id: string;
222
+ readonly handler: HandlerInfo;
223
+ private readonly host;
224
+ private ownSignal;
225
+ private slots;
226
+ private scope;
227
+ private finishers;
228
+ private finished;
229
+ private finishing;
230
+ constructor(init: BasicExecutionContextInit);
231
+ /**
232
+ * A signal that never aborts. Not shared between contexts: listeners would
233
+ * outlive their execution.
234
+ */
235
+ get signal(): AbortSignal;
236
+ get<K extends ContextKey>(key: K): ContextValue<K>;
237
+ find<K extends ContextKey>(key: K): ContextValue<K> | undefined;
238
+ set<K extends ContextKey>(key: K, value: ContextValue<K>): void;
239
+ has(key: ContextKey): boolean;
240
+ use: ScopedContainer['getSync'];
241
+ resolve: ScopedContainer['get'];
242
+ onFinish(callback: () => void | Promise<void>): void;
243
+ /**
244
+ * Runs the `onFinish` callbacks in reverse order, those they register
245
+ * included, then disposes the DI scope. Runs once, however often it is
246
+ * called; every caller waits for that run.
247
+ */
248
+ finish(): Promise<void>;
249
+ private runFinishers;
250
+ /** Runs a callback whose failure must not stop what follows. */
251
+ private runFinisher;
252
+ }
253
+ export { type BasicExecutionContextInit, type ClassMetadata, type ContextHost, type DecoratorMetadata, type HandlerChain, type HandlerChainInput, type HandlerClassMetadata, type HandlerClassOptions, type HandlerExtras, type MethodHandlerMetadata, type ModuleMetadata, type ModuleNode, type ResolvedChain, type TransportDefinition, type TransportHost, buildModuleGraph, constructedInstances, defineTransport, disposeScope, moduleClasses, needsScope, runInContext };
254
+ //# sourceMappingURL=transport.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.cts","names":[],"sources":["../src/transports/settled-within.mts","../src/metadata/decorator-metadata.mts","../src/modules/module-metadata.mts","../src/metadata/member-metadata.mts","../src/metadata/handler-class.mts","../src/metadata/class-store.mts","../src/metadata/handler-chain.mts","../src/metadata/run-chain.mts","../src/execution/basic-execution-context.mts"],"mappings":";;;;;;;;;;;;;qBACa;;;;;wBAMS,cAAc,MAAM,sBAAsB,aAAa;;KCNjE,oBAAoB,OAAO;;;;;;;wBAQvB,YAAY,GAC1B,UAAU,mBACV,aACA,SAAS,YAAY,MAAM,IAC1B;;wBAQa,gBAAgB;EAAW,WAAW;IAAsB;UCN3D;EACf,SAAS;EACT,QAAQ;EACR,cAAc;EACd,WAAW;EACX,YAAY;;;;;EAKZ,SAAS;;wBAyFK,kBAAkB,QAAQ,YAAY;;;;UCzGrC;EACf,QAAQ;EACR,cAAc;EACd,YAAY;;;;;;UAOG,8BAA8B;EAC7C;;;;;EAKA,SAAS;;;;;;wBAUK,eACd;EAAW,WAAW;GACtB,eACC;;UCxBc;EACf,SAAS,SAAS;EAClB,eAAe,SAAS;EACxB,aAAa;;;UAIE,6BAA6B;;EAE5C,SAAS,YAAY;;;;;;;;wBASP,qBACd;EAAW,WAAW;GACtB,UAAS,sBACR;;UChCc,cAAc;;EAE7B,OAAO,QAAQ,WAAW,OAAO;;;;;;EAMjC,IAAI,QAAQ,YAAY;;EAExB,IAAI,QAAQ;;;;;;;;;;;;;;;wBAgBE,cAAc,GAAG,aAAa,cAAc,oBAAoB,cAAc;UCxBpF;WACC,iBAAiB;WACjB,uBAAuB;;UAGxB,kBAAkB;WACjB,YAAY;;UAGN;;;;;EAKf,sBAAsB;;EAEtB,MAAM,SAAS,KAAK;;EAEpB,YAAY;;EAEZ,OAAO;;EAEP;;EAEA,QAAQ;;UAGO;;EAEf,MAAM;;EAEN,OAAO;;EAEP,OAAO;;;;;;;;;;;;;;;;;;;;wBAqCO,aAAa,OAAO,oBAAoB;;UChEvC,cAAc,YAAY,mBAAmB,kBAAkB;WACrE,OAAO,cAAc,YAAY,KAAK;WACtC,QAAQ;aAAyB,MAAM;aAAoB,OAAO,MAAM;;WACxE,OAAO,cAAc,YAAY,KAAK;;;;;;wBAoB3B,aACpB,YAAY,mBAAmB,kBAC/B,kBAEA,WAAW,KAAK,mBAChB;WACW,MAAM,KAAK;WACX,gBAAgB;WAChB,gBAAgB;IAE1B,QAAQ,cAAc,KAAK;;;;;;;wBAoCd,SAAS,YAAY,kBAAkB,QACrD,KAAK,KACL,OAAO,cAAc,KAAK,SAC1B,eAAe,SAAS,QAAQ,SAChC,WAAW,OAAO,cAAc,SAAS,QAAQ,UAChD,QAAQ;;;;;;;wBAkBK,aAAa,YAAY;EAAqB,UAAU;GAAiB,QACvF;WAAiB;GACjB,KAAK,KACL,OAAO,cAAc,KAAK,SAC1B,eAAe,SAAS,QAAQ,SAChC,WAAW,OAAO,cAAc,SAAS,QAAQ,UAChD,QAAQ;UClGM;;EAEf;EACA;EACA,SAAS;EACT,MAAM;;;;;;;qBAQK,iCAAiC;WACnC;WACA;WACA,SAAS;mBACD;UACT;UACA;UACA;UACA;UACA;UACA;EAER,YAAY,MAAM;;;;;MAWd,UAAU;EAId,IAAI,UAAU,YAAY,KAAK,IAAI,aAAa;EAWhD,KAAK,UAAU,YAAY,KAAK,IAAI,aAAa;EAIjD,IAAI,UAAU,YAAY,KAAK,GAAG,OAAO,aAAa;EAItD,IAAI,KAAK;EA+BD,KAAK;EAEL,SAAS;EAEjB,SAAS,uBAAuB;;;;;;EAahC,UAAU;UAII;;UAeA"}
@@ -0,0 +1,254 @@
1
+ /**
2
+ * What the author of a transport needs and application code does not: the
3
+ * transport contract, the module graph, handler metadata, and the pieces of
4
+ * an execution context.
5
+ *
6
+ * Application code imports from `@navios/core`.
7
+ */
8
+ import { a as TransportDefinition, d as buildModuleGraph, f as moduleClasses, h as needsScope, l as defineTransport, p as ContextHost, r as runInContext, s as TransportHost, u as ModuleNode } from "./async-context-BAdt7bno.mjs";
9
+ import { constructedInstances, disposeScope } from "@navios/di/internal";
10
+ import { ClassType, Container, Provider, ScopedContainer } from "@navios/di";
11
+ import { a as Interceptor, i as AttributeValue, n as Guard } from "./module-options-CSqQUSTm.mjs";
12
+ import { a as ContextValue, i as ContextKey, n as ExecutionContext, r as HandlerInfo } from "./execution-context-C5F9rojO.mjs";
13
+ /** The longest delay a timer takes; a longer one fires at once. */
14
+ export declare const MAX_DELAY_MS: number;
15
+ /**
16
+ * Whether `work` settles within `ms`, or within `MAX_DELAY_MS` when `ms` is
17
+ * longer. Rejects when it rejects in time; a later rejection is dropped.
18
+ */
19
+ export declare function settledWithin(work: PromiseLike<unknown>, ms: number): Promise<boolean>;
20
+ /** The `metadata` of a decorator context. */
21
+ type DecoratorMetadata = Record<PropertyKey, unknown>;
22
+ /**
23
+ * The value stored in decorator metadata under `key`, created for this class
24
+ * from what a parent class has, if anything. The metadata object of a class
25
+ * inherits from that of its parent, so writing to an inherited value would
26
+ * change the parent.
27
+ */
28
+ export declare function ownMetadata<T>(metadata: DecoratorMetadata, key: symbol, create: (inherited?: T) => T): T;
29
+ /** The metadata of a decorator context, which has to have one. */
30
+ export declare function requireMetadata(context: {
31
+ metadata?: DecoratorMetadata;
32
+ }): DecoratorMetadata;
33
+ interface ModuleMetadata {
34
+ imports: ClassType[];
35
+ guards: ClassType[];
36
+ interceptors: ClassType[];
37
+ providers: Provider[];
38
+ attributes: Map<symbol, unknown>;
39
+ /**
40
+ * Every option the module system itself does not use, by option name, as
41
+ * written. A transport reads its own from here.
42
+ */
43
+ entries: Map<string, unknown>;
44
+ }
45
+ export declare function getModuleMetadata(target: ClassType): ModuleMetadata;
46
+ /**
47
+ * What decorators and `handler()` options can attach to a handler.
48
+ */
49
+ interface HandlerExtras {
50
+ guards: ClassType[];
51
+ interceptors: ClassType[];
52
+ attributes: Map<symbol, unknown>;
53
+ }
54
+ /**
55
+ * A class member that is, or may become, a handler: what decorators attached
56
+ * to it.
57
+ */
58
+ interface MethodHandlerMetadata extends HandlerExtras {
59
+ name: string;
60
+ /**
61
+ * What makes the member a handler of a transport, under that transport's
62
+ * own symbol.
63
+ */
64
+ entries: Map<symbol, unknown>;
65
+ }
66
+ /**
67
+ * What decorators attached to a member, inherited ones included, to read and to
68
+ * add to.
69
+ */
70
+ export declare function memberMetadata(context: {
71
+ metadata?: DecoratorMetadata;
72
+ }, name: string): MethodHandlerMetadata;
73
+ /** What a transport's decorator for handler classes may take. */
74
+ interface HandlerClassOptions {
75
+ guards?: Iterable<ClassType>;
76
+ interceptors?: Iterable<ClassType>;
77
+ attributes?: AttributeValue[];
78
+ }
79
+ /** A class that owns handlers: what applies to all of them, and its members. */
80
+ interface HandlerClassMetadata extends HandlerExtras {
81
+ /** The members decorators were applied to, by name. */
82
+ members: Map<string, MethodHandlerMetadata>;
83
+ }
84
+ /**
85
+ * What decorators attached to a class of handlers and to its members, together
86
+ * with the options of the class decorator that asks. The lists are live:
87
+ * `@UseGuards` and the like placed above that decorator run after it and are
88
+ * still seen.
89
+ */
90
+ export declare function describeHandlerClass(context: {
91
+ metadata?: DecoratorMetadata;
92
+ }, options?: HandlerClassOptions): HandlerClassMetadata;
93
+ /** What a class decorator stores on the class it decorates. */
94
+ interface ClassMetadata<T> {
95
+ /** Stores `value` on `target`, where it is not enumerable and can be replaced. */
96
+ define(target: ClassType, value: T): void;
97
+ /**
98
+ * What is stored on `target` itself. A subclass does not inherit it: it is
99
+ * not what the decorator makes of a class unless it is decorated itself.
100
+ * Throws when there is none.
101
+ */
102
+ get(target: ClassType): T;
103
+ /** Whether `get` would find something. */
104
+ has(target: ClassType): boolean;
105
+ }
106
+ /**
107
+ * Metadata that a class decorator stores on classes under `key`. `what` and
108
+ * `decorator` name it when a class has none: `Users is not a controller. Make
109
+ * sure it is decorated with @Controller.`
110
+ *
111
+ * ```ts
112
+ * const queueHandlers = classMetadata<HandlerClassMetadata>(
113
+ * Symbol.for('my-transport.handlers'),
114
+ * 'a queue handler',
115
+ * 'QueueHandler',
116
+ * )
117
+ * ```
118
+ */
119
+ export declare function classMetadata<T>(key: symbol, what: string, decorator: string): ClassMetadata<T>;
120
+ interface Extras {
121
+ readonly guards: readonly ClassType[];
122
+ readonly interceptors: readonly ClassType[];
123
+ }
124
+ interface OwnExtras extends Extras {
125
+ readonly attributes: ReadonlyMap<symbol, unknown>;
126
+ }
127
+ interface HandlerChainInput {
128
+ /**
129
+ * Interceptors around every handler of the application or of the transport,
130
+ * outermost first.
131
+ */
132
+ application: readonly ClassType[];
133
+ /** The module the handler belongs to, with what it inherits. */
134
+ node: Extras & Pick<ModuleNode, 'module' | 'attributes' | 'disputed'>;
135
+ /** The class that owns the handler. */
136
+ controller: ClassType;
137
+ /** What applies to every handler of `controller`. */
138
+ owner: OwnExtras;
139
+ /** The name of the handler in its class. */
140
+ handlerName: string;
141
+ /** The handler itself. */
142
+ member: OwnExtras;
143
+ }
144
+ interface HandlerChain {
145
+ /** What the contexts of the handler tell about it. */
146
+ info: HandlerInfo;
147
+ /** Interceptors around the guards: those of the application. */
148
+ outer: ClassType[];
149
+ /** Interceptors inside the guards: those of the module, the class and the handler. */
150
+ inner: ClassType[];
151
+ }
152
+ /**
153
+ * The guards and interceptors that apply to one handler, in the order they
154
+ * run, and what its contexts tell about it: the interceptors of the
155
+ * application, then the guards from the module chain, the owning class and
156
+ * the handler, then the interceptors of the same three. A class that appears
157
+ * twice is kept where it first appears. `info.guards` are the guards and
158
+ * `info.interceptors` the interceptors, `outer` and then `inner`.
159
+ *
160
+ * An interceptor of the application sees every execution, denied ones
161
+ * included, as tracing and logging need. One that is attached to handlers runs
162
+ * only for what their guards let through.
163
+ *
164
+ * Throws when the handler would inherit an attribute that the importers of its
165
+ * module do not agree about.
166
+ *
167
+ * Every transport uses this, so the rule is the same everywhere.
168
+ * `resolveChain` resolves the chain and `runChain` runs it.
169
+ */
170
+ export declare function handlerChain(input: HandlerChainInput): HandlerChain;
171
+ /** A handler's chain with its instances, ready to run. */
172
+ interface ResolvedChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown> {
173
+ readonly outer: ReadonlyArray<Interceptor<Ctx, Result>>;
174
+ readonly guards: ReadonlyArray<{
175
+ readonly type: ClassType;
176
+ readonly guard: Guard<Ctx>;
177
+ }>;
178
+ readonly inner: ReadonlyArray<Interceptor<Ctx, Result>>;
179
+ }
180
+ /**
181
+ * Resolves the classes of a chain that `handlerChain` returned. A transport
182
+ * does this once per handler, while it is set up.
183
+ */
184
+ export declare function resolveChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown>(container: Pick<Container, 'get'>, chain: {
185
+ readonly info: Pick<HandlerInfo, 'guards'>;
186
+ readonly outer: readonly ClassType[];
187
+ readonly inner: readonly ClassType[];
188
+ }): Promise<ResolvedChain<Ctx, Result>>;
189
+ /**
190
+ * Runs a handler with what applies to it: the outer interceptors, the guards
191
+ * one after another, the inner interceptors, the handler. When a guard refuses,
192
+ * nothing further runs and `onDenied` says what becomes of the execution: what
193
+ * it returns is the result, and what it throws is the failure.
194
+ */
195
+ export declare function runChain<Ctx extends ExecutionContext, Result>(ctx: Ctx, chain: ResolvedChain<Ctx, Result>, handler: () => Result | Promise<Result>, onDenied: (guard: ClassType) => Result | Promise<Result>): Promise<Result>;
196
+ /**
197
+ * Runs a handler with what applies to it, as `runChain`, in the async context
198
+ * when the application keeps one, and then finishes its context, whatever the
199
+ * outcome. The context is finished inside the async context, so that
200
+ * `currentContext()` still answers in `onFinish` callbacks.
201
+ */
202
+ export declare function executeChain<Ctx extends ExecutionContext & {
203
+ finish(): Promise<void>;
204
+ }, Result>(host: {
205
+ readonly asyncContext: boolean;
206
+ }, ctx: Ctx, chain: ResolvedChain<Ctx, Result>, handler: () => Result | Promise<Result>, onDenied: (guard: ClassType) => Result | Promise<Result>): Promise<Result>;
207
+ interface BasicExecutionContextInit {
208
+ /** The transport kind, for example `'cli'`. */
209
+ kind: string;
210
+ id: string;
211
+ handler: HandlerInfo;
212
+ host: ContextHost;
213
+ }
214
+ /**
215
+ * An `ExecutionContext` for transports that need nothing beyond the neutral
216
+ * contract. The transport creates one per execution and calls `finish()` when
217
+ * the handler is done.
218
+ */
219
+ export declare class BasicExecutionContext implements ExecutionContext {
220
+ readonly kind: string;
221
+ readonly id: string;
222
+ readonly handler: HandlerInfo;
223
+ private readonly host;
224
+ private ownSignal;
225
+ private slots;
226
+ private scope;
227
+ private finishers;
228
+ private finished;
229
+ private finishing;
230
+ constructor(init: BasicExecutionContextInit);
231
+ /**
232
+ * A signal that never aborts. Not shared between contexts: listeners would
233
+ * outlive their execution.
234
+ */
235
+ get signal(): AbortSignal;
236
+ get<K extends ContextKey>(key: K): ContextValue<K>;
237
+ find<K extends ContextKey>(key: K): ContextValue<K> | undefined;
238
+ set<K extends ContextKey>(key: K, value: ContextValue<K>): void;
239
+ has(key: ContextKey): boolean;
240
+ use: ScopedContainer['getSync'];
241
+ resolve: ScopedContainer['get'];
242
+ onFinish(callback: () => void | Promise<void>): void;
243
+ /**
244
+ * Runs the `onFinish` callbacks in reverse order, those they register
245
+ * included, then disposes the DI scope. Runs once, however often it is
246
+ * called; every caller waits for that run.
247
+ */
248
+ finish(): Promise<void>;
249
+ private runFinishers;
250
+ /** Runs a callback whose failure must not stop what follows. */
251
+ private runFinisher;
252
+ }
253
+ export { type BasicExecutionContextInit, type ClassMetadata, type ContextHost, type DecoratorMetadata, type HandlerChain, type HandlerChainInput, type HandlerClassMetadata, type HandlerClassOptions, type HandlerExtras, type MethodHandlerMetadata, type ModuleMetadata, type ModuleNode, type ResolvedChain, type TransportDefinition, type TransportHost, buildModuleGraph, constructedInstances, defineTransport, disposeScope, moduleClasses, needsScope, runInContext };
254
+ //# sourceMappingURL=transport.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.mts","names":[],"sources":["../src/transports/settled-within.mts","../src/metadata/decorator-metadata.mts","../src/modules/module-metadata.mts","../src/metadata/member-metadata.mts","../src/metadata/handler-class.mts","../src/metadata/class-store.mts","../src/metadata/handler-chain.mts","../src/metadata/run-chain.mts","../src/execution/basic-execution-context.mts"],"mappings":";;;;;;;;;;;;;qBACa;;;;;wBAMS,cAAc,MAAM,sBAAsB,aAAa;;KCNjE,oBAAoB,OAAO;;;;;;;wBAQvB,YAAY,GAC1B,UAAU,mBACV,aACA,SAAS,YAAY,MAAM,IAC1B;;wBAQa,gBAAgB;EAAW,WAAW;IAAsB;UCN3D;EACf,SAAS;EACT,QAAQ;EACR,cAAc;EACd,WAAW;EACX,YAAY;;;;;EAKZ,SAAS;;wBAyFK,kBAAkB,QAAQ,YAAY;;;;UCzGrC;EACf,QAAQ;EACR,cAAc;EACd,YAAY;;;;;;UAOG,8BAA8B;EAC7C;;;;;EAKA,SAAS;;;;;;wBAUK,eACd;EAAW,WAAW;GACtB,eACC;;UCxBc;EACf,SAAS,SAAS;EAClB,eAAe,SAAS;EACxB,aAAa;;;UAIE,6BAA6B;;EAE5C,SAAS,YAAY;;;;;;;;wBASP,qBACd;EAAW,WAAW;GACtB,UAAS,sBACR;;UChCc,cAAc;;EAE7B,OAAO,QAAQ,WAAW,OAAO;;;;;;EAMjC,IAAI,QAAQ,YAAY;;EAExB,IAAI,QAAQ;;;;;;;;;;;;;;;wBAgBE,cAAc,GAAG,aAAa,cAAc,oBAAoB,cAAc;UCxBpF;WACC,iBAAiB;WACjB,uBAAuB;;UAGxB,kBAAkB;WACjB,YAAY;;UAGN;;;;;EAKf,sBAAsB;;EAEtB,MAAM,SAAS,KAAK;;EAEpB,YAAY;;EAEZ,OAAO;;EAEP;;EAEA,QAAQ;;UAGO;;EAEf,MAAM;;EAEN,OAAO;;EAEP,OAAO;;;;;;;;;;;;;;;;;;;;wBAqCO,aAAa,OAAO,oBAAoB;;UChEvC,cAAc,YAAY,mBAAmB,kBAAkB;WACrE,OAAO,cAAc,YAAY,KAAK;WACtC,QAAQ;aAAyB,MAAM;aAAoB,OAAO,MAAM;;WACxE,OAAO,cAAc,YAAY,KAAK;;;;;;wBAoB3B,aACpB,YAAY,mBAAmB,kBAC/B,kBAEA,WAAW,KAAK,mBAChB;WACW,MAAM,KAAK;WACX,gBAAgB;WAChB,gBAAgB;IAE1B,QAAQ,cAAc,KAAK;;;;;;;wBAoCd,SAAS,YAAY,kBAAkB,QACrD,KAAK,KACL,OAAO,cAAc,KAAK,SAC1B,eAAe,SAAS,QAAQ,SAChC,WAAW,OAAO,cAAc,SAAS,QAAQ,UAChD,QAAQ;;;;;;;wBAkBK,aAAa,YAAY;EAAqB,UAAU;GAAiB,QACvF;WAAiB;GACjB,KAAK,KACL,OAAO,cAAc,KAAK,SAC1B,eAAe,SAAS,QAAQ,SAChC,WAAW,OAAO,cAAc,SAAS,QAAQ,UAChD,QAAQ;UClGM;;EAEf;EACA;EACA,SAAS;EACT,MAAM;;;;;;;qBAQK,iCAAiC;WACnC;WACA;WACA,SAAS;mBACD;UACT;UACA;UACA;UACA;UACA;UACA;EAER,YAAY,MAAM;;;;;MAWd,UAAU;EAId,IAAI,UAAU,YAAY,KAAK,IAAI,aAAa;EAWhD,KAAK,UAAU,YAAY,KAAK,IAAI,aAAa;EAIjD,IAAI,UAAU,YAAY,KAAK,GAAG,OAAO,aAAa;EAItD,IAAI,KAAK;EA+BD,KAAK;EAEL,SAAS;EAEjB,SAAS,uBAAuB;;;;;;EAahC,UAAU;UAII;;UAeA"}
@@ -0,0 +1,6 @@
1
+ import { c as classMetadata, h as requireMetadata, i as memberMetadata, m as ownMetadata, s as getModuleMetadata } from "./attribute-value-BNiJjxl1.mjs";
2
+ import { a as handlerChain, i as runChain, n as executeChain, o as describeHandlerClass, r as resolveChain, s as defineTransport, t as BasicExecutionContext } from "./basic-execution-context-u1VktGoM.mjs";
3
+ import { constructedInstances, disposeScope } from "@navios/di/internal";
4
+ import { n as settledWithin, t as MAX_DELAY_MS } from "./settled-within-Bc2pj8WB.mjs";
5
+ import { a as needsScope, c as runInContext, n as buildModuleGraph, r as moduleClasses } from "./execution-context-token-Cb3M3Ao0.mjs";
6
+ export { BasicExecutionContext, MAX_DELAY_MS, buildModuleGraph, classMetadata, constructedInstances, defineTransport, describeHandlerClass, disposeScope, executeChain, getModuleMetadata, handlerChain, memberMetadata, moduleClasses, needsScope, ownMetadata, requireMetadata, resolveChain, runChain, runInContext, settledWithin };
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@navios/core",
3
- "version": "1.1.0",
3
+ "version": "2.0.0-alpha.1",
4
+ "license": "MIT",
4
5
  "author": {
5
6
  "name": "Oleksandr Hanzha",
6
7
  "email": "alex@granted.name"
7
8
  },
8
9
  "repository": {
9
- "directory": "packages/core",
10
10
  "type": "git",
11
- "url": "https://github.com/Arilas/navios.git"
12
- },
13
- "license": "MIT",
14
- "peerDependencies": {
15
- "@navios/builder": "^1.0.0",
16
- "zod": "^3.25.0 || ^4.0.0"
11
+ "url": "https://github.com/navios-org/navios.git",
12
+ "directory": "packages/core"
17
13
  },
18
- "typings": "./lib/index.d.mts",
14
+ "files": [
15
+ "lib",
16
+ "README.md",
17
+ "CHANGELOG.md",
18
+ "LICENSE"
19
+ ],
19
20
  "main": "./lib/index.cjs",
20
21
  "module": "./lib/index.mjs",
22
+ "typings": "./lib/index.d.mts",
21
23
  "exports": {
22
24
  ".": {
23
25
  "import": {
@@ -29,6 +31,16 @@
29
31
  "default": "./lib/index.cjs"
30
32
  }
31
33
  },
34
+ "./transport": {
35
+ "import": {
36
+ "types": "./lib/transport.d.mts",
37
+ "default": "./lib/transport.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./lib/transport.d.cts",
41
+ "default": "./lib/transport.cjs"
42
+ }
43
+ },
32
44
  "./testing": {
33
45
  "import": {
34
46
  "types": "./lib/testing/index.d.mts",
@@ -50,15 +62,23 @@
50
62
  }
51
63
  }
52
64
  },
53
- "devDependencies": {
54
- "@navios/builder": "^1.0.0",
55
- "@types/supertest": "^6.0.3",
56
- "supertest": "^7.1.4",
57
- "tsx": "^4.21.0",
58
- "typescript": "^5.9.3",
59
- "zod": "^4.3.5"
65
+ "scripts": {
66
+ "check": "tsc -b",
67
+ "lint": "yarn run -T oxlint --fix && yarn run -T oxfmt",
68
+ "test:ci": "vitest run",
69
+ "build": "tsdown",
70
+ "publish": "node ../../scripts/assert-stable-version.mjs && yarn npm publish --access public",
71
+ "publish:next": "yarn npm publish --access public --tag next"
60
72
  },
61
73
  "dependencies": {
62
- "@navios/di": "^1.0.0"
74
+ "@navios/di": "2.0.0-alpha.1"
75
+ },
76
+ "devDependencies": {
77
+ "tsx": "^4.23.15",
78
+ "typescript": "^7.0.2",
79
+ "zod": "^4.6.7"
80
+ },
81
+ "engines": {
82
+ "node": ">=24"
63
83
  }
64
84
  }