@navios/core 2.0.0-alpha.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 (85) hide show
  1. package/CHANGELOG.md +33 -3
  2. package/README.md +8 -6
  3. package/lib/{async-context-6pdlnNLA.d.mts → async-context-BAdt7bno.d.mts} +11 -9
  4. package/lib/async-context-BAdt7bno.d.mts.map +1 -0
  5. package/lib/{async-context-Dqk7pE-D.d.cts → async-context-RsWmy2Hi.d.cts} +11 -9
  6. package/lib/async-context-RsWmy2Hi.d.cts.map +1 -0
  7. package/lib/{attribute-factory-B3VuYnp7.d.cts → attribute-factory-BW1kgBqf.d.mts} +2 -2
  8. package/lib/{attribute-factory-B3VuYnp7.d.cts.map → attribute-factory-BW1kgBqf.d.mts.map} +1 -1
  9. package/lib/{attribute-factory-mKOXoVnV.d.mts → attribute-factory-DqN4x5XM.d.cts} +2 -2
  10. package/lib/{attribute-factory-mKOXoVnV.d.mts.map → attribute-factory-DqN4x5XM.d.cts.map} +1 -1
  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-DSk5MNtc.cjs → basic-execution-context-5uq2DvEA.cjs} +66 -29
  16. package/lib/basic-execution-context-5uq2DvEA.cjs.map +1 -0
  17. package/lib/{basic-execution-context-CeGuhMOz.mjs → basic-execution-context-u1VktGoM.mjs} +61 -30
  18. package/lib/basic-execution-context-u1VktGoM.mjs.map +1 -0
  19. package/lib/{execution-context-BPD3FeFb.d.mts → execution-context-BVSmLkYp.d.cts} +2 -2
  20. package/lib/{execution-context-BPD3FeFb.d.mts.map → execution-context-BVSmLkYp.d.cts.map} +1 -1
  21. package/lib/{execution-context-BTJdHhbf.d.cts → execution-context-C5F9rojO.d.mts} +2 -2
  22. package/lib/{execution-context-BTJdHhbf.d.cts.map → execution-context-C5F9rojO.d.mts.map} +1 -1
  23. package/lib/{module-graph-DCP9MHG0.cjs → execution-context-token--cKS4cJv.cjs} +135 -12
  24. package/lib/execution-context-token--cKS4cJv.cjs.map +1 -0
  25. package/lib/{module-graph-xvVEykFM.mjs → execution-context-token-Cb3M3Ao0.mjs} +93 -12
  26. package/lib/execution-context-token-Cb3M3Ao0.mjs.map +1 -0
  27. package/lib/index.cjs +84 -101
  28. package/lib/index.cjs.map +1 -1
  29. package/lib/index.d.cts +14 -10
  30. package/lib/index.d.cts.map +1 -1
  31. package/lib/index.d.mts +14 -10
  32. package/lib/index.d.mts.map +1 -1
  33. package/lib/index.mjs +76 -92
  34. package/lib/index.mjs.map +1 -1
  35. package/lib/legacy-compat/index.cjs +2 -2
  36. package/lib/legacy-compat/index.d.cts +3 -3
  37. package/lib/legacy-compat/index.d.mts +2 -2
  38. package/lib/legacy-compat/index.mjs +2 -2
  39. package/lib/{module-DZewk_2r.cjs → module-Bz83ZnJ5.cjs} +43 -34
  40. package/lib/module-Bz83ZnJ5.cjs.map +1 -0
  41. package/lib/{module-options-Dmse0gii.d.mts → module-options-CSqQUSTm.d.mts} +2 -2
  42. package/lib/{module-options-Dmse0gii.d.mts.map → module-options-CSqQUSTm.d.mts.map} +1 -1
  43. package/lib/{module-options-IuDO-p8u.d.cts → module-options-DSRBri4J.d.cts} +2 -2
  44. package/lib/{module-options-IuDO-p8u.d.cts.map → module-options-DSRBri4J.d.cts.map} +1 -1
  45. package/lib/{module-Bha7GER_.mjs → module-zPXwR2qp.mjs} +38 -35
  46. package/lib/module-zPXwR2qp.mjs.map +1 -0
  47. package/lib/settled-within-B6gpu2XW.cjs +32 -0
  48. package/lib/settled-within-B6gpu2XW.cjs.map +1 -0
  49. package/lib/settled-within-Bc2pj8WB.mjs +21 -0
  50. package/lib/settled-within-Bc2pj8WB.mjs.map +1 -0
  51. package/lib/testing/index.cjs +12 -34
  52. package/lib/testing/index.cjs.map +1 -1
  53. package/lib/testing/index.d.cts +2 -2
  54. package/lib/testing/index.d.cts.map +1 -1
  55. package/lib/testing/index.d.mts +1 -1
  56. package/lib/testing/index.d.mts.map +1 -1
  57. package/lib/testing/index.mjs +12 -34
  58. package/lib/testing/index.mjs.map +1 -1
  59. package/lib/transport.cjs +19 -8
  60. package/lib/transport.d.cts +102 -38
  61. package/lib/transport.d.cts.map +1 -1
  62. package/lib/transport.d.mts +102 -38
  63. package/lib/transport.d.mts.map +1 -1
  64. package/lib/transport.mjs +6 -7
  65. package/package.json +2 -2
  66. package/lib/async-context-6pdlnNLA.d.mts.map +0 -1
  67. package/lib/async-context-Dqk7pE-D.d.cts.map +0 -1
  68. package/lib/attribute-value-CjX9ZkLq.cjs +0 -172
  69. package/lib/attribute-value-CjX9ZkLq.cjs.map +0 -1
  70. package/lib/attribute-value-DMEA255r.mjs +0 -119
  71. package/lib/attribute-value-DMEA255r.mjs.map +0 -1
  72. package/lib/basic-execution-context-CeGuhMOz.mjs.map +0 -1
  73. package/lib/basic-execution-context-DSk5MNtc.cjs.map +0 -1
  74. package/lib/execution-context-token-BXUKB2hf.cjs +0 -112
  75. package/lib/execution-context-token-BXUKB2hf.cjs.map +0 -1
  76. package/lib/execution-context-token-CrXmTvk2.mjs +0 -77
  77. package/lib/execution-context-token-CrXmTvk2.mjs.map +0 -1
  78. package/lib/module-Bha7GER_.mjs.map +0 -1
  79. package/lib/module-DZewk_2r.cjs.map +0 -1
  80. package/lib/module-graph-DCP9MHG0.cjs.map +0 -1
  81. package/lib/module-graph-xvVEykFM.mjs.map +0 -1
  82. package/lib/module-metadata-C8S92seK.cjs +0 -95
  83. package/lib/module-metadata-C8S92seK.cjs.map +0 -1
  84. package/lib/module-metadata-k3RTt20x.mjs +0 -66
  85. package/lib/module-metadata-k3RTt20x.mjs.map +0 -1
@@ -5,17 +5,35 @@
5
5
  *
6
6
  * Application code imports from `@navios/core`.
7
7
  */
8
- import { _ as LoggerService, a as TransportDefinition, c as TransportInstance, d as buildModuleGraph, f as ContextHost, i as Transport, l as defineTransport, m as needsScope, o as TransportFactory, r as runInContext, s as TransportHost, u as ModuleNode } from "./async-context-6pdlnNLA.mjs";
9
- import { ClassType, ClassType as ClassType$1, Container, Provider, ScopedContainer } from "@navios/di";
10
- import { constructedInstances } from "@navios/di/internal";
11
- import { a as Interceptor, i as AttributeValue, n as Guard, o as InterceptorClass, r as GuardClass } from "./module-options-Dmse0gii.mjs";
12
- import { a as ContextValue, i as ContextKey, n as ExecutionContext, r as HandlerInfo, t as AttributeMap } from "./execution-context-BPD3FeFb.mjs";
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>;
13
20
  /** The `metadata` of a decorator context. */
14
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;
15
33
  interface ModuleMetadata {
16
- imports: ClassType$1[];
17
- guards: ClassType$1[];
18
- interceptors: ClassType$1[];
34
+ imports: ClassType[];
35
+ guards: ClassType[];
36
+ interceptors: ClassType[];
19
37
  providers: Provider[];
20
38
  attributes: Map<symbol, unknown>;
21
39
  /**
@@ -24,14 +42,13 @@ interface ModuleMetadata {
24
42
  */
25
43
  entries: Map<string, unknown>;
26
44
  }
27
- export declare function getModuleMetadata(target: ClassType$1): ModuleMetadata;
28
- export declare function hasModuleMetadata(target: ClassType$1): boolean;
45
+ export declare function getModuleMetadata(target: ClassType): ModuleMetadata;
29
46
  /**
30
47
  * What decorators and `handler()` options can attach to a handler.
31
48
  */
32
49
  interface HandlerExtras {
33
- guards: ClassType$1[];
34
- interceptors: ClassType$1[];
50
+ guards: ClassType[];
51
+ interceptors: ClassType[];
35
52
  attributes: Map<symbol, unknown>;
36
53
  }
37
54
  /**
@@ -55,8 +72,8 @@ export declare function memberMetadata(context: {
55
72
  }, name: string): MethodHandlerMetadata;
56
73
  /** What a transport's decorator for handler classes may take. */
57
74
  interface HandlerClassOptions {
58
- guards?: Iterable<ClassType$1>;
59
- interceptors?: Iterable<ClassType$1>;
75
+ guards?: Iterable<ClassType>;
76
+ interceptors?: Iterable<ClassType>;
60
77
  attributes?: AttributeValue[];
61
78
  }
62
79
  /** A class that owns handlers: what applies to all of them, and its members. */
@@ -73,9 +90,36 @@ interface HandlerClassMetadata extends HandlerExtras {
73
90
  export declare function describeHandlerClass(context: {
74
91
  metadata?: DecoratorMetadata;
75
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>;
76
120
  interface Extras {
77
- readonly guards: readonly ClassType$1[];
78
- readonly interceptors: readonly ClassType$1[];
121
+ readonly guards: readonly ClassType[];
122
+ readonly interceptors: readonly ClassType[];
79
123
  }
80
124
  interface OwnExtras extends Extras {
81
125
  readonly attributes: ReadonlyMap<symbol, unknown>;
@@ -85,28 +129,33 @@ interface HandlerChainInput {
85
129
  * Interceptors around every handler of the application or of the transport,
86
130
  * outermost first.
87
131
  */
88
- application: readonly ClassType$1[];
132
+ application: readonly ClassType[];
89
133
  /** The module the handler belongs to, with what it inherits. */
90
- node: Extras & Pick<ModuleNode, 'module' | 'disputed'>;
134
+ node: Extras & Pick<ModuleNode, 'module' | 'attributes' | 'disputed'>;
91
135
  /** The class that owns the handler. */
136
+ controller: ClassType;
137
+ /** What applies to every handler of `controller`. */
92
138
  owner: OwnExtras;
139
+ /** The name of the handler in its class. */
140
+ handlerName: string;
93
141
  /** The handler itself. */
94
142
  member: OwnExtras;
95
143
  }
96
144
  interface HandlerChain {
97
- guards: ClassType$1[];
98
- /** `outer` and `inner`, one after the other. */
99
- interceptors: ClassType$1[];
145
+ /** What the contexts of the handler tell about it. */
146
+ info: HandlerInfo;
100
147
  /** Interceptors around the guards: those of the application. */
101
- outer: ClassType$1[];
148
+ outer: ClassType[];
102
149
  /** Interceptors inside the guards: those of the module, the class and the handler. */
103
- inner: ClassType$1[];
150
+ inner: ClassType[];
104
151
  }
105
152
  /**
106
153
  * The guards and interceptors that apply to one handler, in the order they
107
- * run: the interceptors of the application, then the guards from the module
108
- * chain, the owning class and the handler, then the interceptors of the same
109
- * three. A class that appears twice is kept where it first appears.
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`.
110
159
  *
111
160
  * An interceptor of the application sees every execution, denied ones
112
161
  * included, as tracing and logging need. One that is attached to handlers runs
@@ -115,39 +164,52 @@ interface HandlerChain {
115
164
  * Throws when the handler would inherit an attribute that the importers of its
116
165
  * module do not agree about.
117
166
  *
118
- * Every transport uses this, so the rule is the same everywhere. `runChain`
119
- * runs the chain.
167
+ * Every transport uses this, so the rule is the same everywhere.
168
+ * `resolveChain` resolves the chain and `runChain` runs it.
120
169
  */
121
170
  export declare function handlerChain(input: HandlerChainInput): HandlerChain;
122
171
  /** A handler's chain with its instances, ready to run. */
123
172
  interface ResolvedChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown> {
124
173
  readonly outer: ReadonlyArray<Interceptor<Ctx, Result>>;
125
174
  readonly guards: ReadonlyArray<{
126
- readonly type: ClassType$1;
175
+ readonly type: ClassType;
127
176
  readonly guard: Guard<Ctx>;
128
177
  }>;
129
178
  readonly inner: ReadonlyArray<Interceptor<Ctx, Result>>;
130
179
  }
131
180
  /**
132
- * Resolves the classes of a chain. A transport does this once per handler,
133
- * while it is set up.
181
+ * Resolves the classes of a chain that `handlerChain` returned. A transport
182
+ * does this once per handler, while it is set up.
134
183
  */
135
- export declare function resolveChain<Ctx extends ExecutionContext = ExecutionContext, Result = unknown>(container: Pick<Container, 'get'>, chain: Pick<HandlerChain, 'outer' | 'guards' | 'inner'>): Promise<ResolvedChain<Ctx, Result>>;
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>>;
136
189
  /**
137
190
  * Runs a handler with what applies to it: the outer interceptors, the guards
138
191
  * one after another, the inner interceptors, the handler. When a guard refuses,
139
192
  * nothing further runs and `onDenied` says what becomes of the execution: what
140
193
  * it returns is the result, and what it throws is the failure.
141
194
  */
142
- export declare function runChain<Ctx extends ExecutionContext, Result>(ctx: Ctx, chain: ResolvedChain<Ctx, Result>, handler: () => Result | Promise<Result>, onDenied: (guard: ClassType$1) => Result | Promise<Result>): Promise<Result>;
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>;
143
207
  interface BasicExecutionContextInit {
144
208
  /** The transport kind, for example `'cli'`. */
145
209
  kind: string;
146
210
  id: string;
147
211
  handler: HandlerInfo;
148
212
  host: ContextHost;
149
- /** Defaults to a signal of the context's own that never aborts. */
150
- signal?: AbortSignal;
151
213
  }
152
214
  /**
153
215
  * An `ExecutionContext` for transports that need nothing beyond the neutral
@@ -159,7 +221,6 @@ export declare class BasicExecutionContext implements ExecutionContext {
159
221
  readonly id: string;
160
222
  readonly handler: HandlerInfo;
161
223
  private readonly host;
162
- private readonly givenSignal;
163
224
  private ownSignal;
164
225
  private slots;
165
226
  private scope;
@@ -167,7 +228,10 @@ export declare class BasicExecutionContext implements ExecutionContext {
167
228
  private finished;
168
229
  private finishing;
169
230
  constructor(init: BasicExecutionContextInit);
170
- /** Not shared between contexts: listeners would outlive their execution. */
231
+ /**
232
+ * A signal that never aborts. Not shared between contexts: listeners would
233
+ * outlive their execution.
234
+ */
171
235
  get signal(): AbortSignal;
172
236
  get<K extends ContextKey>(key: K): ContextValue<K>;
173
237
  find<K extends ContextKey>(key: K): ContextValue<K> | undefined;
@@ -186,5 +250,5 @@ export declare class BasicExecutionContext implements ExecutionContext {
186
250
  /** Runs a callback whose failure must not stop what follows. */
187
251
  private runFinisher;
188
252
  }
189
- export { type AttributeMap, type BasicExecutionContextInit, type ClassType, type ContextHost, type DecoratorMetadata, type ExecutionContext, type Guard, type GuardClass, type HandlerChain, type HandlerChainInput, type HandlerClassMetadata, type HandlerClassOptions, type HandlerExtras, type HandlerInfo, type Interceptor, type InterceptorClass, type LoggerService, type MethodHandlerMetadata, type ModuleMetadata, type ModuleNode, type ResolvedChain, type Transport, type TransportDefinition, type TransportFactory, type TransportHost, type TransportInstance, buildModuleGraph, constructedInstances, defineTransport, needsScope, runInContext };
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 };
190
254
  //# sourceMappingURL=transport.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.mts","names":["ClassType","ClassType","ClassType","ClassType","ClassType"],"sources":["../src/metadata/decorator-metadata.mts","../src/modules/module-metadata.mts","../src/metadata/member-metadata.mts","../src/metadata/handler-class.mts","../src/metadata/handler-chain.mts","../src/metadata/run-chain.mts","../src/execution/basic-execution-context.mts"],"mappings":";;;;;;;;;;;;;KACY,oBAAoB,OAAO;UCetB;EACf,SAASA;EACT,QAAQA;EACR,cAAcA;EACd,WAAW;EACX,YAAY;;;;;EAKZ,SAAS;;wBA4FK,kBAAkB,QAAQA,cAAY;wBAYtC,kBAAkB,QAAQA;;;;UCzHzB;EACf,QAAQC;EACR,cAAcA;EACd,YAAY;;;;;;UAOG,8BAA8B;EAC7C;;;;;EAKA,SAAS;;;;;;wBAUK,eACd;EAAW,WAAW;GACtB,eACC;;UCxBc;EACf,SAAS,SAASC;EAClB,eAAe,SAASA;EACxB,aAAa;;;UAIE,6BAA6B;;EAE5C,SAAS,YAAY;;;;;;;;wBASP,qBACd;EAAW,WAAW;GACtB,UAAS,sBACR;UC/BO;WACC,iBAAiBC;WACjB,uBAAuBA;;UAGxB,kBAAkB;WACjB,YAAY;;UAGN;;;;;EAKf,sBAAsBA;;EAEtB,MAAM,SAAS,KAAK;;EAEpB,OAAO;;EAEP,QAAQ;;UAGO;EACf,QAAQA;;EAER,cAAcA;;EAEd,OAAOA;;EAEP,OAAOA;;;;;;;;;;;;;;;;;;wBAmCO,aAAa,OAAO,oBAAoB;;UC1DvC,cAAc,YAAY,mBAAmB,kBAAkB;WACrE,OAAO,cAAc,YAAY,KAAK;WACtC,QAAQ;aAAyB,MAAMC;aAAoB,OAAO,MAAM;;WACxE,OAAO,cAAc,YAAY,KAAK;;;;;;wBAoB3B,aACpB,YAAY,mBAAmB,kBAC/B,kBAEA,WAAW,KAAK,mBAChB,OAAO,KAAK,8CACX,QAAQ,cAAc,KAAK;;;;;;;wBAoCd,SAAS,YAAY,kBAAkB,QACrD,KAAK,KACL,OAAO,cAAc,KAAK,SAC1B,eAAe,SAAS,QAAQ,SAChC,WAAW,OAAOA,gBAAc,SAAS,QAAQ,UAChD,QAAQ;UCtEM;;EAEf;EACA;EACA,SAAS;EACT,MAAM;;EAEN,SAAS;;;;;;;qBAQE,iCAAiC;WACnC;WACA;WACA,SAAS;mBACD;mBACA;UACT;UACA;UACA;UACA;UACA;UACA;EAER,YAAY,MAAM;;MASd,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;EA4BD,KAAK;EAEL,SAAS;EAEjB,SAAS,uBAAuB;;;;;;EAahC,UAAU;UAII;;UAeA"}
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,QA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ItD,IAAI,KAAK;EA+BD,KAAK;EAEL,SAAS;EAEjB,SAAS,uBAAuB;;;;;;EAahC,UAAU;UAII;;UAeA"}
package/lib/transport.mjs CHANGED
@@ -1,7 +1,6 @@
1
- import { r as memberMetadata } from "./attribute-value-DMEA255r.mjs";
2
- import { a as describeHandlerClass, i as handlerChain, n as resolveChain, o as defineTransport, r as runChain, t as BasicExecutionContext } from "./basic-execution-context-CeGuhMOz.mjs";
3
- import { constructedInstances } from "@navios/di/internal";
4
- import { t as buildModuleGraph } from "./module-graph-xvVEykFM.mjs";
5
- import { a as hasModuleMetadata, i as getModuleMetadata } from "./module-metadata-k3RTt20x.mjs";
6
- import { o as runInContext, r as needsScope } from "./execution-context-token-CrXmTvk2.mjs";
7
- export { BasicExecutionContext, buildModuleGraph, constructedInstances, defineTransport, describeHandlerClass, getModuleMetadata, handlerChain, hasModuleMetadata, memberMetadata, needsScope, resolveChain, runChain, runInContext };
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@navios/core",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Oleksandr Hanzha",
@@ -71,7 +71,7 @@
71
71
  "publish:next": "yarn npm publish --access public --tag next"
72
72
  },
73
73
  "dependencies": {
74
- "@navios/di": "2.0.0-alpha.0"
74
+ "@navios/di": "2.0.0-alpha.1"
75
75
  },
76
76
  "devDependencies": {
77
77
  "tsx": "^4.23.15",
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-context-6pdlnNLA.d.mts","names":[],"sources":["../src/logger/log-levels.mts","../src/logger/logger-output.mts","../src/internal/options-argument.mts","../src/execution/context-host.mts","../src/modules/module-graph.mts","../src/transports/transport.mts","../src/execution/async-context.mts"],"mappings":";;;;;cAGa;;;;;;;;;KAiBD,mBAAmB;;;;iBAKf,WAAW,qBAAqB,iBAAiB;;;;;;iBAgDjD,gBAAgB,2BAAuB;;;;UClEtC;;;;EAIf,IAAI,iBAAiB;;;;EAKrB,MAAM,iBAAiB;;;;EAKvB,KAAK,iBAAiB;;;;EAKtB,OAAO,iBAAiB;;;;EAKxB,SAAS,iBAAiB;;;;EAK1B,OAAO,iBAAiB;;;;;EAMxB,cAAc,QAAQ;;;;;;;;cASX,cAAY,eAAA;;;;;KC/Cb,gBAAgB,SAAS,0CAA0C,WAC1E,UAAU,YAAY,MAAM,SAC5B,SAAS,YAAY,MAAM;;;;UCGf;WACN,WAAW;;;;;EAKpB,eAAe,OAAO;;WAEb,SAAS,KAAK;;;;;;iBAsBT,WAAW,WAAW,WAAW,OAAO;;;;;iBAQxC,kBACd,WAAW,WACX,mCACA,QAAQ,gBACP;;;;;UCvCc;EACf,QAAQ;EACR,WAAW;;EAEX,SAAS;EACT,QAAQ;EACR,cAAc;EACd,YAAY;;;;;;EAMZ,UAAU;;EAEV,WAAW;;EAEX;;;;;;;;;;;;;;;;;;;iBAgHc,iBAAiB,OAAO,cAAc;;;;UCjIrC;WACN,WAAW;WACX,QAAQ;;WAER,aAAa;;WAEb;;;;;WAKA,uBAAuB;;;;;;;UAQjB;;;;;EAKf,MAAM,gBAAgB,sBAAsB;;EAE5C,iBAAiB;;;;;;;;;EASjB,KAAK,2BAA2B;;UAGjB,oBAAoB,SAAS,UAAU;;EAEtD;EACA,OAAO,MAAM,eAAe,SAAS,UAAU,IAAI,QAAQ;;;;;UAM5C,kBAAkB,UAAU,YAAY;WAC9C,YAAY,yBAAyB;;WAErC;;WAEA;;;;;;UAOM,iBAAiB,SAAS,UAAU;MAC/C,MAAM,gBAAgB,UAAU,0BAA0B,kBAAkB;WACvE,YAAY,oBAAoB,SAAS;;;;;;;;;;;;;;;;;;;;;;;iBAwBpC,gBAAgB,gBAAgB,UAAU,YAAY,WACpE,YAAY,oBAAoB,SAAS,KACxC,iBAAiB,SAAS;;;;;iBCtFP,sBAAsB;;;;;iBAW5B,aAAa,GAAG,KAAK,kBAAkB,UAAU,IAAI;;;;;;iBASrD,kBAAkB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-context-Dqk7pE-D.d.cts","names":[],"sources":["../src/logger/log-levels.mts","../src/logger/logger-output.mts","../src/internal/options-argument.mts","../src/execution/context-host.mts","../src/modules/module-graph.mts","../src/transports/transport.mts","../src/execution/async-context.mts"],"mappings":";;;;;cAGa;;;;;;;;;KAiBD,mBAAmB;;;;iBAKf,WAAW,qBAAqB,iBAAiB;;;;;;iBAgDjD,gBAAgB,2BAAuB;;;;UClEtC;;;;EAIf,IAAI,iBAAiB;;;;EAKrB,MAAM,iBAAiB;;;;EAKvB,KAAK,iBAAiB;;;;EAKtB,OAAO,iBAAiB;;;;EAKxB,SAAS,iBAAiB;;;;EAK1B,OAAO,iBAAiB;;;;;EAMxB,cAAc,QAAQ;;;;;;;;cASX,cAAY,eAAA;;;;;KC/Cb,gBAAgB,SAAS,0CAA0C,WAC1E,UAAU,YAAY,MAAM,SAC5B,SAAS,YAAY,MAAM;;;;UCGf;WACN,WAAW;;;;;EAKpB,eAAe,OAAO;;WAEb,SAAS,KAAK;;;;;;iBAsBT,WAAW,WAAW,WAAW,OAAO;;;;;iBAQxC,kBACd,WAAW,WACX,mCACA,QAAQ,gBACP;;;;;UCvCc;EACf,QAAQ;EACR,WAAW;;EAEX,SAAS;EACT,QAAQ;EACR,cAAc;EACd,YAAY;;;;;;EAMZ,UAAU;;EAEV,WAAW;;EAEX;;;;;;;;;;;;;;;;;;;iBAgHc,iBAAiB,OAAO,cAAc;;;;UCjIrC;WACN,WAAW;WACX,QAAQ;;WAER,aAAa;;WAEb;;;;;WAKA,uBAAuB;;;;;;;UAQjB;;;;;EAKf,MAAM,gBAAgB,sBAAsB;;EAE5C,iBAAiB;;;;;;;;;EASjB,KAAK,2BAA2B;;UAGjB,oBAAoB,SAAS,UAAU;;EAEtD;EACA,OAAO,MAAM,eAAe,SAAS,UAAU,IAAI,QAAQ;;;;;UAM5C,kBAAkB,UAAU,YAAY;WAC9C,YAAY,yBAAyB;;WAErC;;WAEA;;;;;;UAOM,iBAAiB,SAAS,UAAU;MAC/C,MAAM,gBAAgB,UAAU,0BAA0B,kBAAkB;WACvE,YAAY,oBAAoB,SAAS;;;;;;;;;;;;;;;;;;;;;;;iBAwBpC,gBAAgB,gBAAgB,UAAU,YAAY,WACpE,YAAY,oBAAoB,SAAS,KACxC,iBAAiB,SAAS;;;;;iBCtFP,sBAAsB;;;;;iBAW5B,aAAa,GAAG,KAAK,kBAAkB,UAAU,IAAI;;;;;;iBASrD,kBAAkB"}
@@ -1,172 +0,0 @@
1
- // src/internal/single-copy.mts
2
- /**
3
- * Warns when a second copy of this package is loaded into the process.
4
- *
5
- * Several things only work with one copy: `@Module` options that other
6
- * packages add by declaration merging, the async store behind
7
- * `currentContext()`, and `instanceof` checks on context keys. Two copies
8
- * usually mean two versions were installed, or one package bundled its own.
9
- */
10
- const registryKey = Symbol.for("navios.core.copies");
11
- function registerCopy(url, warn) {
12
- if (typeof url !== "string") return;
13
- const location = url.replace(/[?#].*$/, "");
14
- const holder = globalThis;
15
- const registry = holder[registryKey] ??= {
16
- locations: /* @__PURE__ */ new Set(),
17
- warned: false
18
- };
19
- if (registry.locations.has(location)) return;
20
- registry.locations.add(location);
21
- if (registry.locations.size > 1 && !registry.warned) {
22
- registry.warned = true;
23
- warn(`[Navios] @navios/core is loaded more than once:\n` + [...registry.locations].map((entry) => ` - ${entry}`).join("\n") + "\nModule options, currentContext() and context keys are not shared between copies. Make sure every package resolves the same @navios/core: one version, not bundled into another package, and not loaded with both import and require.");
24
- }
25
- }
26
- // src/internal/this-copy.mts
27
- /**
28
- * Registers this copy of the package. Every entry point imports this module,
29
- * so a copy is noticed whichever entry is loaded, and counted once: the
30
- * entries of one build share this module.
31
- */
32
- registerCopy(require("url").pathToFileURL(__filename).href, (message) => console.warn(message));
33
- // src/metadata/decorator-metadata.mts
34
- /**
35
- * Returns a value stored in decorator metadata under `key`, creating it for
36
- * this class if it only exists on a parent. Decorator metadata objects
37
- * inherit from the parent class's, so writing through an inherited value
38
- * would change the parent.
39
- * @internal
40
- */
41
- function own(metadata, key, create) {
42
- if (!Object.hasOwn(metadata, key)) metadata[key] = create(metadata[key]);
43
- return metadata[key];
44
- }
45
- /** The metadata of a decorator context, which has to have one. */
46
- function requireMetadata(context) {
47
- if (!context.metadata) throw new Error("[Navios] Decorator metadata is not available. Use standard decorators, or the @navios/core/legacy-compat entry point with experimentalDecorators.");
48
- return context.metadata;
49
- }
50
- // src/metadata/class-metadata.mts
51
- const ClassAttributesKey = Symbol.for("navios.core.classAttributes");
52
- const ClassGuardsKey = Symbol.for("navios.core.classGuards");
53
- const ClassInterceptorsKey = Symbol.for("navios.core.classInterceptors");
54
- /** The attributes of a class, inherited ones included, to read and to add to. */
55
- function classAttributes(context) {
56
- return own(requireMetadata(context), ClassAttributesKey, (inherited) => new Map(inherited));
57
- }
58
- /** The guards of a class, as `classAttributes`. */
59
- function classGuards(context) {
60
- return own(requireMetadata(context), ClassGuardsKey, (inherited) => [...inherited ?? []]);
61
- }
62
- /** The interceptors of a class, as `classAttributes`. */
63
- function classInterceptors(context) {
64
- return own(requireMetadata(context), ClassInterceptorsKey, (inherited) => [...inherited ?? []]);
65
- }
66
- /** @internal */
67
- function unique(list) {
68
- return Array.from(new Set(list));
69
- }
70
- /**
71
- * Puts `first` in front of `list`, in place, skipping duplicates.
72
- */
73
- function prepend(list, first) {
74
- if (first) {
75
- const added = unique([...first]).filter((item) => !list.includes(item));
76
- list.unshift(...added);
77
- }
78
- return list;
79
- }
80
- // src/metadata/member-metadata.mts
81
- /** Where the members of a class are kept in its metadata. */
82
- const MembersKey = Symbol.for("navios.core.members");
83
- /**
84
- * What decorators attached to a member, inherited ones included, to read and to
85
- * add to.
86
- */
87
- function memberMetadata(context, name) {
88
- const members = own(requireMetadata(context), MembersKey, (inherited) => {
89
- const copy = /* @__PURE__ */ new Map();
90
- if (inherited) for (const [key, value] of inherited) copy.set(key, {
91
- ...value,
92
- guards: [...value.guards],
93
- interceptors: [...value.interceptors],
94
- attributes: new Map(value.attributes),
95
- entries: new Map(value.entries)
96
- });
97
- return copy;
98
- });
99
- let member = members.get(name);
100
- if (!member) {
101
- member = {
102
- name,
103
- guards: [],
104
- interceptors: [],
105
- attributes: /* @__PURE__ */ new Map(),
106
- entries: /* @__PURE__ */ new Map()
107
- };
108
- members.set(name, member);
109
- }
110
- return member;
111
- }
112
- // src/attributes/attribute-value.mts
113
- /** Sets the values of attributes on a map of them. */
114
- function applyAttributes(target, attributes) {
115
- for (const attribute of attributes ?? []) target.set(attribute.token, attribute.value);
116
- }
117
- Object.defineProperty(exports, "MembersKey", {
118
- enumerable: true,
119
- get: function() {
120
- return MembersKey;
121
- }
122
- });
123
- Object.defineProperty(exports, "applyAttributes", {
124
- enumerable: true,
125
- get: function() {
126
- return applyAttributes;
127
- }
128
- });
129
- Object.defineProperty(exports, "classAttributes", {
130
- enumerable: true,
131
- get: function() {
132
- return classAttributes;
133
- }
134
- });
135
- Object.defineProperty(exports, "classGuards", {
136
- enumerable: true,
137
- get: function() {
138
- return classGuards;
139
- }
140
- });
141
- Object.defineProperty(exports, "classInterceptors", {
142
- enumerable: true,
143
- get: function() {
144
- return classInterceptors;
145
- }
146
- });
147
- Object.defineProperty(exports, "memberMetadata", {
148
- enumerable: true,
149
- get: function() {
150
- return memberMetadata;
151
- }
152
- });
153
- Object.defineProperty(exports, "prepend", {
154
- enumerable: true,
155
- get: function() {
156
- return prepend;
157
- }
158
- });
159
- Object.defineProperty(exports, "requireMetadata", {
160
- enumerable: true,
161
- get: function() {
162
- return requireMetadata;
163
- }
164
- });
165
- Object.defineProperty(exports, "unique", {
166
- enumerable: true,
167
- get: function() {
168
- return unique;
169
- }
170
- });
171
-
172
- //# sourceMappingURL=attribute-value-CjX9ZkLq.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute-value-CjX9ZkLq.cjs","names":[],"sources":["../src/internal/single-copy.mts","../src/internal/this-copy.mts","../src/metadata/decorator-metadata.mts","../src/metadata/class-metadata.mts","../src/metadata/member-metadata.mts","../src/attributes/attribute-value.mts"],"sourcesContent":["/**\n * Warns when a second copy of this package is loaded into the process.\n *\n * Several things only work with one copy: `@Module` options that other\n * packages add by declaration merging, the async store behind\n * `currentContext()`, and `instanceof` checks on context keys. Two copies\n * usually mean two versions were installed, or one package bundled its own.\n */\nconst registryKey = Symbol.for('navios.core.copies')\n\ninterface Registry {\n locations: Set<string>\n warned: boolean\n}\n\nexport function registerCopy(url: string | undefined, warn: (message: string) => void): void {\n if (typeof url !== 'string') {\n // `import.meta` is empty in a bundle that is not a module.\n return\n }\n // A development server adds a query when it loads a file again.\n const location = url.replace(/[?#].*$/, '')\n const holder = globalThis as { [registryKey]?: Registry }\n const registry = (holder[registryKey] ??= { locations: new Set(), warned: false })\n if (registry.locations.has(location)) {\n // The same file evaluated again: a module reload, not a second copy.\n return\n }\n registry.locations.add(location)\n if (registry.locations.size > 1 && !registry.warned) {\n registry.warned = true\n warn(\n `[Navios] @navios/core is loaded more than once:\\n` +\n [...registry.locations].map((entry) => ` - ${entry}`).join('\\n') +\n `\\nModule options, currentContext() and context keys are not shared between copies. ` +\n `Make sure every package resolves the same @navios/core: one version, not bundled into ` +\n `another package, and not loaded with both import and require.`,\n )\n }\n}\n","/**\n * Registers this copy of the package. Every entry point imports this module,\n * so a copy is noticed whichever entry is loaded, and counted once: the\n * entries of one build share this module.\n */\nimport { registerCopy } from './single-copy.mjs'\n\nregisterCopy(import.meta.url, (message) => console.warn(message))\n","/** The `metadata` of a decorator context. */\nexport type DecoratorMetadata = Record<PropertyKey, unknown>\n\n/**\n * Returns a value stored in decorator metadata under `key`, creating it for\n * this class if it only exists on a parent. Decorator metadata objects\n * inherit from the parent class's, so writing through an inherited value\n * would change the parent.\n * @internal\n */\nexport function own<T>(metadata: DecoratorMetadata, key: symbol, create: (inherited?: T) => T): T {\n if (!Object.hasOwn(metadata, key)) {\n metadata[key] = create(metadata[key] as T | undefined)\n }\n return metadata[key] as T\n}\n\n/** The metadata of a decorator context, which has to have one. */\nexport function requireMetadata(context: { metadata?: DecoratorMetadata }): DecoratorMetadata {\n if (!context.metadata) {\n throw new Error(\n '[Navios] Decorator metadata is not available. Use standard decorators, or the ' +\n '@navios/core/legacy-compat entry point with experimentalDecorators.',\n )\n }\n return context.metadata\n}\n","import type { ClassType } from '@navios/di'\n\nimport { own, requireMetadata } from './decorator-metadata.mjs'\n\nimport type { DecoratorMetadata } from './decorator-metadata.mjs'\n\nconst ClassAttributesKey = Symbol.for('navios.core.classAttributes')\nconst ClassGuardsKey = Symbol.for('navios.core.classGuards')\nconst ClassInterceptorsKey = Symbol.for('navios.core.classInterceptors')\n\n/** The attributes of a class, inherited ones included, to read and to add to. */\nexport function classAttributes(context: { metadata?: DecoratorMetadata }): Map<symbol, unknown> {\n return own(requireMetadata(context), ClassAttributesKey, (inherited) => new Map(inherited))\n}\n\n/** The guards of a class, as `classAttributes`. */\nexport function classGuards(context: { metadata?: DecoratorMetadata }): ClassType[] {\n return own<ClassType[]>(requireMetadata(context), ClassGuardsKey, (inherited) => [\n ...(inherited ?? []),\n ])\n}\n\n/** The interceptors of a class, as `classAttributes`. */\nexport function classInterceptors(context: { metadata?: DecoratorMetadata }): ClassType[] {\n return own<ClassType[]>(requireMetadata(context), ClassInterceptorsKey, (inherited) => [\n ...(inherited ?? []),\n ])\n}\n\n/** @internal */\nexport function unique(list: ClassType[]): ClassType[] {\n return Array.from(new Set(list))\n}\n\n/**\n * Puts `first` in front of `list`, in place, skipping duplicates.\n */\nexport function prepend(list: ClassType[], first: Iterable<ClassType> | undefined): ClassType[] {\n if (first) {\n const added = unique([...first]).filter((item) => !list.includes(item))\n list.unshift(...added)\n }\n return list\n}\n","import type { ClassType } from '@navios/di'\n\nimport { own, requireMetadata } from './decorator-metadata.mjs'\n\nimport type { DecoratorMetadata } from './decorator-metadata.mjs'\n\n/**\n * What decorators and `handler()` options can attach to a handler.\n */\nexport interface HandlerExtras {\n guards: ClassType[]\n interceptors: ClassType[]\n attributes: Map<symbol, unknown>\n}\n\n/**\n * A class member that is, or may become, a handler: what decorators attached\n * to it.\n */\nexport interface MethodHandlerMetadata extends HandlerExtras {\n name: string\n /**\n * What makes the member a handler of a transport, under that transport's\n * own symbol.\n */\n entries: Map<symbol, unknown>\n}\n\n/** Where the members of a class are kept in its metadata. */\nexport const MembersKey = Symbol.for('navios.core.members')\n\n/**\n * What decorators attached to a member, inherited ones included, to read and to\n * add to.\n */\nexport function memberMetadata(\n context: { metadata?: DecoratorMetadata },\n name: string,\n): MethodHandlerMetadata {\n const members = own<Map<string, MethodHandlerMetadata>>(\n requireMetadata(context),\n MembersKey,\n (inherited) => {\n const copy = new Map<string, MethodHandlerMetadata>()\n if (inherited) {\n for (const [key, value] of inherited) {\n copy.set(key, {\n ...value,\n guards: [...value.guards],\n interceptors: [...value.interceptors],\n attributes: new Map(value.attributes),\n entries: new Map(value.entries),\n })\n }\n }\n return copy\n },\n )\n let member = members.get(name)\n if (!member) {\n member = { name, guards: [], interceptors: [], attributes: new Map(), entries: new Map() }\n members.set(name, member)\n }\n return member\n}\n","/** An attribute value as returned by calling an attribute. */\nexport type AttributeValue = { readonly token: symbol; readonly value: unknown }\n\n/** Sets the values of attributes on a map of them. */\nexport function applyAttributes(\n target: Map<symbol, unknown>,\n attributes: AttributeValue[] | undefined,\n): void {\n for (const attribute of attributes ?? []) {\n target.set(attribute.token, attribute.value)\n }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,cAAc,OAAO,IAAI,oBAAoB;AAOnD,SAAgB,aAAa,KAAyB,MAAuC;CAC3F,IAAI,OAAO,QAAQ,UAEjB;CAGF,MAAM,WAAW,IAAI,QAAQ,WAAW,EAAE;CAC1C,MAAM,SAAS;CACf,MAAM,WAAY,OAAO,iBAAiB;EAAE,2BAAW,IAAI,IAAI;EAAG,QAAQ;CAAM;CAChF,IAAI,SAAS,UAAU,IAAI,QAAQ,GAEjC;CAEF,SAAS,UAAU,IAAI,QAAQ;CAC/B,IAAI,SAAS,UAAU,OAAO,KAAK,CAAC,SAAS,QAAQ;EACnD,SAAS,SAAS;EAClB,KACE,sDACE,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,KAAK,UAAU,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,IAChE,wOAGJ;CACF;AACF;;;;;;;AChCA,aAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,OAA+B,YAAY,QAAQ,KAAK,OAAO,CAAC;;;;;;;;;ACGhE,SAAgB,IAAO,UAA6B,KAAa,QAAiC;CAChG,IAAI,CAAC,OAAO,OAAO,UAAU,GAAG,GAC9B,SAAS,OAAO,OAAO,SAAS,IAAqB;CAEvD,OAAO,SAAS;AAClB;;AAGA,SAAgB,gBAAgB,SAA8D;CAC5F,IAAI,CAAC,QAAQ,UACX,MAAM,IAAI,MACR,mJAEF;CAEF,OAAO,QAAQ;AACjB;;ACpBA,MAAM,qBAAqB,OAAO,IAAI,6BAA6B;AACnE,MAAM,iBAAiB,OAAO,IAAI,yBAAyB;AAC3D,MAAM,uBAAuB,OAAO,IAA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AAI;GAAG,yBAAS,IAAI,IAAI;EAAE;EACzF,QAAQ,IAAI,MAAM,MAAM;CAC1B;CACA,OAAO;AACT;;;AC5DA,SAAgB,gBACd,QACA,YACM;CACN,KAAK,MAAM,aAAa,cAAc,CAAC,GACrC,OAAO,IAAI,UAAU,OAAO,UAAU,KAAK;AAE/C"}
@@ -1,119 +0,0 @@
1
- // src/internal/single-copy.mts
2
- /**
3
- * Warns when a second copy of this package is loaded into the process.
4
- *
5
- * Several things only work with one copy: `@Module` options that other
6
- * packages add by declaration merging, the async store behind
7
- * `currentContext()`, and `instanceof` checks on context keys. Two copies
8
- * usually mean two versions were installed, or one package bundled its own.
9
- */
10
- const registryKey = Symbol.for("navios.core.copies");
11
- function registerCopy(url, warn) {
12
- if (typeof url !== "string") return;
13
- const location = url.replace(/[?#].*$/, "");
14
- const holder = globalThis;
15
- const registry = holder[registryKey] ??= {
16
- locations: /* @__PURE__ */ new Set(),
17
- warned: false
18
- };
19
- if (registry.locations.has(location)) return;
20
- registry.locations.add(location);
21
- if (registry.locations.size > 1 && !registry.warned) {
22
- registry.warned = true;
23
- warn(`[Navios] @navios/core is loaded more than once:\n` + [...registry.locations].map((entry) => ` - ${entry}`).join("\n") + "\nModule options, currentContext() and context keys are not shared between copies. Make sure every package resolves the same @navios/core: one version, not bundled into another package, and not loaded with both import and require.");
24
- }
25
- }
26
- // src/internal/this-copy.mts
27
- /**
28
- * Registers this copy of the package. Every entry point imports this module,
29
- * so a copy is noticed whichever entry is loaded, and counted once: the
30
- * entries of one build share this module.
31
- */
32
- registerCopy(import.meta.url, (message) => console.warn(message));
33
- // src/metadata/decorator-metadata.mts
34
- /**
35
- * Returns a value stored in decorator metadata under `key`, creating it for
36
- * this class if it only exists on a parent. Decorator metadata objects
37
- * inherit from the parent class's, so writing through an inherited value
38
- * would change the parent.
39
- * @internal
40
- */
41
- function own(metadata, key, create) {
42
- if (!Object.hasOwn(metadata, key)) metadata[key] = create(metadata[key]);
43
- return metadata[key];
44
- }
45
- /** The metadata of a decorator context, which has to have one. */
46
- function requireMetadata(context) {
47
- if (!context.metadata) throw new Error("[Navios] Decorator metadata is not available. Use standard decorators, or the @navios/core/legacy-compat entry point with experimentalDecorators.");
48
- return context.metadata;
49
- }
50
- // src/metadata/class-metadata.mts
51
- const ClassAttributesKey = Symbol.for("navios.core.classAttributes");
52
- const ClassGuardsKey = Symbol.for("navios.core.classGuards");
53
- const ClassInterceptorsKey = Symbol.for("navios.core.classInterceptors");
54
- /** The attributes of a class, inherited ones included, to read and to add to. */
55
- function classAttributes(context) {
56
- return own(requireMetadata(context), ClassAttributesKey, (inherited) => new Map(inherited));
57
- }
58
- /** The guards of a class, as `classAttributes`. */
59
- function classGuards(context) {
60
- return own(requireMetadata(context), ClassGuardsKey, (inherited) => [...inherited ?? []]);
61
- }
62
- /** The interceptors of a class, as `classAttributes`. */
63
- function classInterceptors(context) {
64
- return own(requireMetadata(context), ClassInterceptorsKey, (inherited) => [...inherited ?? []]);
65
- }
66
- /** @internal */
67
- function unique(list) {
68
- return Array.from(new Set(list));
69
- }
70
- /**
71
- * Puts `first` in front of `list`, in place, skipping duplicates.
72
- */
73
- function prepend(list, first) {
74
- if (first) {
75
- const added = unique([...first]).filter((item) => !list.includes(item));
76
- list.unshift(...added);
77
- }
78
- return list;
79
- }
80
- // src/metadata/member-metadata.mts
81
- /** Where the members of a class are kept in its metadata. */
82
- const MembersKey = Symbol.for("navios.core.members");
83
- /**
84
- * What decorators attached to a member, inherited ones included, to read and to
85
- * add to.
86
- */
87
- function memberMetadata(context, name) {
88
- const members = own(requireMetadata(context), MembersKey, (inherited) => {
89
- const copy = /* @__PURE__ */ new Map();
90
- if (inherited) for (const [key, value] of inherited) copy.set(key, {
91
- ...value,
92
- guards: [...value.guards],
93
- interceptors: [...value.interceptors],
94
- attributes: new Map(value.attributes),
95
- entries: new Map(value.entries)
96
- });
97
- return copy;
98
- });
99
- let member = members.get(name);
100
- if (!member) {
101
- member = {
102
- name,
103
- guards: [],
104
- interceptors: [],
105
- attributes: /* @__PURE__ */ new Map(),
106
- entries: /* @__PURE__ */ new Map()
107
- };
108
- members.set(name, member);
109
- }
110
- return member;
111
- }
112
- // src/attributes/attribute-value.mts
113
- /** Sets the values of attributes on a map of them. */
114
- function applyAttributes(target, attributes) {
115
- for (const attribute of attributes ?? []) target.set(attribute.token, attribute.value);
116
- }
117
- export { classGuards as a, unique as c, classAttributes as i, requireMetadata as l, MembersKey as n, classInterceptors as o, memberMetadata as r, prepend as s, applyAttributes as t };
118
-
119
- //# sourceMappingURL=attribute-value-DMEA255r.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute-value-DMEA255r.mjs","names":[],"sources":["../src/internal/single-copy.mts","../src/internal/this-copy.mts","../src/metadata/decorator-metadata.mts","../src/metadata/class-metadata.mts","../src/metadata/member-metadata.mts","../src/attributes/attribute-value.mts"],"sourcesContent":["/**\n * Warns when a second copy of this package is loaded into the process.\n *\n * Several things only work with one copy: `@Module` options that other\n * packages add by declaration merging, the async store behind\n * `currentContext()`, and `instanceof` checks on context keys. Two copies\n * usually mean two versions were installed, or one package bundled its own.\n */\nconst registryKey = Symbol.for('navios.core.copies')\n\ninterface Registry {\n locations: Set<string>\n warned: boolean\n}\n\nexport function registerCopy(url: string | undefined, warn: (message: string) => void): void {\n if (typeof url !== 'string') {\n // `import.meta` is empty in a bundle that is not a module.\n return\n }\n // A development server adds a query when it loads a file again.\n const location = url.replace(/[?#].*$/, '')\n const holder = globalThis as { [registryKey]?: Registry }\n const registry = (holder[registryKey] ??= { locations: new Set(), warned: false })\n if (registry.locations.has(location)) {\n // The same file evaluated again: a module reload, not a second copy.\n return\n }\n registry.locations.add(location)\n if (registry.locations.size > 1 && !registry.warned) {\n registry.warned = true\n warn(\n `[Navios] @navios/core is loaded more than once:\\n` +\n [...registry.locations].map((entry) => ` - ${entry}`).join('\\n') +\n `\\nModule options, currentContext() and context keys are not shared between copies. ` +\n `Make sure every package resolves the same @navios/core: one version, not bundled into ` +\n `another package, and not loaded with both import and require.`,\n )\n }\n}\n","/**\n * Registers this copy of the package. Every entry point imports this module,\n * so a copy is noticed whichever entry is loaded, and counted once: the\n * entries of one build share this module.\n */\nimport { registerCopy } from './single-copy.mjs'\n\nregisterCopy(import.meta.url, (message) => console.warn(message))\n","/** The `metadata` of a decorator context. */\nexport type DecoratorMetadata = Record<PropertyKey, unknown>\n\n/**\n * Returns a value stored in decorator metadata under `key`, creating it for\n * this class if it only exists on a parent. Decorator metadata objects\n * inherit from the parent class's, so writing through an inherited value\n * would change the parent.\n * @internal\n */\nexport function own<T>(metadata: DecoratorMetadata, key: symbol, create: (inherited?: T) => T): T {\n if (!Object.hasOwn(metadata, key)) {\n metadata[key] = create(metadata[key] as T | undefined)\n }\n return metadata[key] as T\n}\n\n/** The metadata of a decorator context, which has to have one. */\nexport function requireMetadata(context: { metadata?: DecoratorMetadata }): DecoratorMetadata {\n if (!context.metadata) {\n throw new Error(\n '[Navios] Decorator metadata is not available. Use standard decorators, or the ' +\n '@navios/core/legacy-compat entry point with experimentalDecorators.',\n )\n }\n return context.metadata\n}\n","import type { ClassType } from '@navios/di'\n\nimport { own, requireMetadata } from './decorator-metadata.mjs'\n\nimport type { DecoratorMetadata } from './decorator-metadata.mjs'\n\nconst ClassAttributesKey = Symbol.for('navios.core.classAttributes')\nconst ClassGuardsKey = Symbol.for('navios.core.classGuards')\nconst ClassInterceptorsKey = Symbol.for('navios.core.classInterceptors')\n\n/** The attributes of a class, inherited ones included, to read and to add to. */\nexport function classAttributes(context: { metadata?: DecoratorMetadata }): Map<symbol, unknown> {\n return own(requireMetadata(context), ClassAttributesKey, (inherited) => new Map(inherited))\n}\n\n/** The guards of a class, as `classAttributes`. */\nexport function classGuards(context: { metadata?: DecoratorMetadata }): ClassType[] {\n return own<ClassType[]>(requireMetadata(context), ClassGuardsKey, (inherited) => [\n ...(inherited ?? []),\n ])\n}\n\n/** The interceptors of a class, as `classAttributes`. */\nexport function classInterceptors(context: { metadata?: DecoratorMetadata }): ClassType[] {\n return own<ClassType[]>(requireMetadata(context), ClassInterceptorsKey, (inherited) => [\n ...(inherited ?? []),\n ])\n}\n\n/** @internal */\nexport function unique(list: ClassType[]): ClassType[] {\n return Array.from(new Set(list))\n}\n\n/**\n * Puts `first` in front of `list`, in place, skipping duplicates.\n */\nexport function prepend(list: ClassType[], first: Iterable<ClassType> | undefined): ClassType[] {\n if (first) {\n const added = unique([...first]).filter((item) => !list.includes(item))\n list.unshift(...added)\n }\n return list\n}\n","import type { ClassType } from '@navios/di'\n\nimport { own, requireMetadata } from './decorator-metadata.mjs'\n\nimport type { DecoratorMetadata } from './decorator-metadata.mjs'\n\n/**\n * What decorators and `handler()` options can attach to a handler.\n */\nexport interface HandlerExtras {\n guards: ClassType[]\n interceptors: ClassType[]\n attributes: Map<symbol, unknown>\n}\n\n/**\n * A class member that is, or may become, a handler: what decorators attached\n * to it.\n */\nexport interface MethodHandlerMetadata extends HandlerExtras {\n name: string\n /**\n * What makes the member a handler of a transport, under that transport's\n * own symbol.\n */\n entries: Map<symbol, unknown>\n}\n\n/** Where the members of a class are kept in its metadata. */\nexport const MembersKey = Symbol.for('navios.core.members')\n\n/**\n * What decorators attached to a member, inherited ones included, to read and to\n * add to.\n */\nexport function memberMetadata(\n context: { metadata?: DecoratorMetadata },\n name: string,\n): MethodHandlerMetadata {\n const members = own<Map<string, MethodHandlerMetadata>>(\n requireMetadata(context),\n MembersKey,\n (inherited) => {\n const copy = new Map<string, MethodHandlerMetadata>()\n if (inherited) {\n for (const [key, value] of inherited) {\n copy.set(key, {\n ...value,\n guards: [...value.guards],\n interceptors: [...value.interceptors],\n attributes: new Map(value.attributes),\n entries: new Map(value.entries),\n })\n }\n }\n return copy\n },\n )\n let member = members.get(name)\n if (!member) {\n member = { name, guards: [], interceptors: [], attributes: new Map(), entries: new Map() }\n members.set(name, member)\n }\n return member\n}\n","/** An attribute value as returned by calling an attribute. */\nexport type AttributeValue = { readonly token: symbol; readonly value: unknown }\n\n/** Sets the values of attributes on a map of them. */\nexport function applyAttributes(\n target: Map<symbol, unknown>,\n attributes: AttributeValue[] | undefined,\n): void {\n for (const attribute of attributes ?? []) {\n target.set(attribute.token, attribute.value)\n }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,cAAc,OAAO,IAAI,oBAAoB;AAOnD,SAAgB,aAAa,KAAyB,MAAuC;CAC3F,IAAI,OAAO,QAAQ,UAEjB;CAGF,MAAM,WAAW,IAAI,QAAQ,WAAW,EAAE;CAC1C,MAAM,SAAS;CACf,MAAM,WAAY,OAAO,iBAAiB;EAAE,2BAAW,IAAI,IAAI;EAAG,QAAQ;CAAM;CAChF,IAAI,SAAS,UAAU,IAAI,QAAQ,GAEjC;CAEF,SAAS,UAAU,IAAI,QAAQ;CAC/B,IAAI,SAAS,UAAU,OAAO,KAAK,CAAC,SAAS,QAAQ;EACnD,SAAS,SAAS;EAClB,KACE,sDACE,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,KAAK,UAAU,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,IAChE,wOAGJ;CACF;AACF;;;;;;;AChCA,aAAa,YAAY,MAAM,YAAY,QAAQ,KAAK,OAAO,CAAC;;;;;;;;;ACGhE,SAAgB,IAAO,UAA6B,KAAa,QAAiC;CAChG,IAAI,CAAC,OAAO,OAAO,UAAU,GAAG,GAC9B,SAAS,OAAO,OAAO,SAAS,IAAqB;CAEvD,OAAO,SAAS;AAClB;;AAGA,SAAgB,gBAAgB,SAA8D;CAC5F,IAAI,CAAC,QAAQ,UACX,MAAM,IAAI,MACR,mJAEF;CAEF,OAAO,QAAQ;AACjB;;ACpBA,MAAM,qBAAqB,OAAO,IAAI,6BAA6B;AACnE,MAAM,iBAAiB,OAAO,IAAI,yBAAyB;AAC3D,MAAM,uBAAuB,OAAO,IAAI,+BAA+B;;AAGvE,SAAgB,gBAAgB,SAAiE;CAC/F,OAAO,IAAI,gBAAgB,OAAO,GAAG,qBAAqB,cAAc,IAAI,IAAI,S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