@haskou/ddd-kernel 2.0.15 → 3.0.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.
- package/dist/{RetryPredicate-CLVmhikX.d.cts → RetryPredicate-BKlKFvI4.d.cts} +1 -1
- package/dist/{RetryPredicate-Cs5bLFe9.d.ts → RetryPredicate-DG6jcGCX.d.ts} +1 -1
- package/dist/{ServiceClass-IInu6j5L.d.ts → ServiceClass-C-ZCUQWE.d.ts} +2 -4
- package/dist/{ServiceClass-D_0gCcMr.d.cts → ServiceClass-U0Vk46dN.d.cts} +2 -4
- package/dist/{ShutdownHook-D8r9l6N5.d.ts → ShutdownHook-BCQgEMUI.d.ts} +1 -1
- package/dist/{ShutdownHook-DC2sOpcz.d.cts → ShutdownHook-CCtg4Ypg.d.cts} +1 -1
- package/dist/adapters/index.cjs +28 -27
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +3 -3
- package/dist/adapters/index.d.ts +3 -3
- package/dist/adapters/index.js +28 -27
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/pubsub/amqp/index.cjs +28 -27
- package/dist/adapters/pubsub/amqp/index.cjs.map +1 -1
- package/dist/adapters/pubsub/amqp/index.js +28 -27
- package/dist/adapters/pubsub/amqp/index.js.map +1 -1
- package/dist/adapters/pubsub/index.cjs +28 -27
- package/dist/adapters/pubsub/index.cjs.map +1 -1
- package/dist/adapters/pubsub/index.d.cts +3 -3
- package/dist/adapters/pubsub/index.d.ts +3 -3
- package/dist/adapters/pubsub/index.js +28 -27
- package/dist/adapters/pubsub/index.js.map +1 -1
- package/dist/adapters/ui/express/index.d.cts +2 -2
- package/dist/adapters/ui/express/index.d.ts +2 -2
- package/dist/adapters/ui/index.cjs +28 -27
- package/dist/adapters/ui/index.cjs.map +1 -1
- package/dist/adapters/ui/index.d.cts +2 -2
- package/dist/adapters/ui/index.d.ts +2 -2
- package/dist/adapters/ui/index.js +28 -27
- package/dist/adapters/ui/index.js.map +1 -1
- package/dist/adapters/ui/routes/index.cjs +28 -27
- package/dist/adapters/ui/routes/index.cjs.map +1 -1
- package/dist/adapters/ui/routes/index.js +28 -27
- package/dist/adapters/ui/routes/index.js.map +1 -1
- package/dist/contracts/index.d.cts +3 -3
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/kernel/index.d.cts +3 -3
- package/dist/contracts/kernel/index.d.ts +3 -3
- package/dist/index.cjs +28 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +28 -27
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/dependency-injection/index.cjs +28 -27
- package/dist/infrastructure/dependency-injection/index.cjs.map +1 -1
- package/dist/infrastructure/dependency-injection/index.d.cts +6 -2
- package/dist/infrastructure/dependency-injection/index.d.ts +6 -2
- package/dist/infrastructure/dependency-injection/index.js +28 -27
- package/dist/infrastructure/dependency-injection/index.js.map +1 -1
- package/dist/infrastructure/express/index.d.cts +2 -2
- package/dist/infrastructure/express/index.d.ts +2 -2
- package/dist/infrastructure/scheduler/index.cjs +28 -27
- package/dist/infrastructure/scheduler/index.cjs.map +1 -1
- package/dist/infrastructure/scheduler/index.js +28 -27
- package/dist/infrastructure/scheduler/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -31,7 +31,6 @@ interface DependencyInjectionOptions {
|
|
|
31
31
|
declare class DependencyInjection implements ServiceResolver {
|
|
32
32
|
private readonly options;
|
|
33
33
|
private static configuredInstance;
|
|
34
|
-
private autowire;
|
|
35
34
|
private loader;
|
|
36
35
|
private readonly container;
|
|
37
36
|
private readonly overrideTokenIds;
|
|
@@ -45,9 +44,7 @@ declare class DependencyInjection implements ServiceResolver {
|
|
|
45
44
|
private getOverrideId;
|
|
46
45
|
private hasDirectService;
|
|
47
46
|
private ensureSyntheticService;
|
|
48
|
-
private
|
|
49
|
-
private serviceIdMatchesService;
|
|
50
|
-
private serviceIdReferencesService;
|
|
47
|
+
private idNamesService;
|
|
51
48
|
private getReferenceId;
|
|
52
49
|
private getDefinitionArgumentReferences;
|
|
53
50
|
private findConcreteChildServiceId;
|
|
@@ -60,6 +57,7 @@ declare class DependencyInjection implements ServiceResolver {
|
|
|
60
57
|
private applyFactoryOverride;
|
|
61
58
|
private applyValueOverride;
|
|
62
59
|
private applyOverrides;
|
|
60
|
+
private trackAutowireAliasIds;
|
|
63
61
|
private processAutowire;
|
|
64
62
|
private registerParentAliases;
|
|
65
63
|
compile(): Promise<void>;
|
|
@@ -31,7 +31,6 @@ interface DependencyInjectionOptions {
|
|
|
31
31
|
declare class DependencyInjection implements ServiceResolver {
|
|
32
32
|
private readonly options;
|
|
33
33
|
private static configuredInstance;
|
|
34
|
-
private autowire;
|
|
35
34
|
private loader;
|
|
36
35
|
private readonly container;
|
|
37
36
|
private readonly overrideTokenIds;
|
|
@@ -45,9 +44,7 @@ declare class DependencyInjection implements ServiceResolver {
|
|
|
45
44
|
private getOverrideId;
|
|
46
45
|
private hasDirectService;
|
|
47
46
|
private ensureSyntheticService;
|
|
48
|
-
private
|
|
49
|
-
private serviceIdMatchesService;
|
|
50
|
-
private serviceIdReferencesService;
|
|
47
|
+
private idNamesService;
|
|
51
48
|
private getReferenceId;
|
|
52
49
|
private getDefinitionArgumentReferences;
|
|
53
50
|
private findConcreteChildServiceId;
|
|
@@ -60,6 +57,7 @@ declare class DependencyInjection implements ServiceResolver {
|
|
|
60
57
|
private applyFactoryOverride;
|
|
61
58
|
private applyValueOverride;
|
|
62
59
|
private applyOverrides;
|
|
60
|
+
private trackAutowireAliasIds;
|
|
63
61
|
private processAutowire;
|
|
64
62
|
private registerParentAliases;
|
|
65
63
|
compile(): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as DomainEvent } from './DomainEvent-C2OvBSCS.js';
|
|
2
2
|
import { DotenvConfigOutput } from 'dotenv';
|
|
3
|
-
import { b as DependencyOverride, D as DependencyInjection, S as ServiceClass } from './ServiceClass-
|
|
3
|
+
import { b as DependencyOverride, D as DependencyInjection, S as ServiceClass } from './ServiceClass-C-ZCUQWE.js';
|
|
4
4
|
import { Initializer, Runtime } from './infrastructure/lifecycle/index.js';
|
|
5
5
|
import { a as Scheduler } from './Scheduler-Cm24s3-v.js';
|
|
6
6
|
import { K as KernelLogger } from './KernelLogger-BESOFrpW.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as DomainEvent } from './DomainEvent-C2OvBSCS.cjs';
|
|
2
2
|
import { DotenvConfigOutput } from 'dotenv';
|
|
3
|
-
import { b as DependencyOverride, D as DependencyInjection, S as ServiceClass } from './ServiceClass-
|
|
3
|
+
import { b as DependencyOverride, D as DependencyInjection, S as ServiceClass } from './ServiceClass-U0Vk46dN.cjs';
|
|
4
4
|
import { Initializer, Runtime } from './infrastructure/lifecycle/index.cjs';
|
|
5
5
|
import { a as Scheduler } from './Scheduler-Cm24s3-v.cjs';
|
|
6
6
|
import { K as KernelLogger } from './KernelLogger-BESOFrpW.cjs';
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -167,7 +167,6 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
167
167
|
}
|
|
168
168
|
options;
|
|
169
169
|
static configuredInstance;
|
|
170
|
-
autowire;
|
|
171
170
|
loader;
|
|
172
171
|
container;
|
|
173
172
|
overrideTokenIds = /* @__PURE__ */ new Map();
|
|
@@ -208,20 +207,8 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
208
207
|
definition.synthetic = true;
|
|
209
208
|
this.container.set(id, value);
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
const parentName = Buffer.from(parentId, "base64").toString("utf8");
|
|
216
|
-
return parentName.endsWith(`__${serviceClassName}__${serviceClassName}`);
|
|
217
|
-
}
|
|
218
|
-
serviceIdMatchesService(serviceId, serviceClassName) {
|
|
219
|
-
const serviceName = Buffer.from(serviceId, "base64").toString("utf8");
|
|
220
|
-
return serviceName.endsWith(`__${serviceClassName}__${serviceClassName}`);
|
|
221
|
-
}
|
|
222
|
-
serviceIdReferencesService(serviceId, serviceClassName) {
|
|
223
|
-
const serviceName = Buffer.from(serviceId, "base64").toString("utf8");
|
|
224
|
-
return serviceName.endsWith(`__${serviceClassName}`);
|
|
210
|
+
idNamesService(id, serviceClassName) {
|
|
211
|
+
return import_node_path.default.posix.basename(id) === serviceClassName;
|
|
225
212
|
}
|
|
226
213
|
getReferenceId(value) {
|
|
227
214
|
if (typeof value === "object" && value !== null && "id" in value && typeof value.id === "string") {
|
|
@@ -245,7 +232,7 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
245
232
|
return void 0;
|
|
246
233
|
}
|
|
247
234
|
const matches = [...this.definitions.entries()].filter(([, definition]) => definition._abstract !== true).filter(
|
|
248
|
-
([, definition]) => this.
|
|
235
|
+
([, definition]) => definition._parent && this.idNamesService(definition._parent, serviceClassName)
|
|
249
236
|
).map(([id]) => id);
|
|
250
237
|
return matches[matches.length - 1];
|
|
251
238
|
}
|
|
@@ -255,7 +242,7 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
255
242
|
return void 0;
|
|
256
243
|
}
|
|
257
244
|
const matches = [...this.definitions.keys()].filter(
|
|
258
|
-
(id) => this.
|
|
245
|
+
(id) => this.idNamesService(id, serviceClassName)
|
|
259
246
|
);
|
|
260
247
|
return matches[matches.length - 1];
|
|
261
248
|
}
|
|
@@ -265,7 +252,7 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
265
252
|
return void 0;
|
|
266
253
|
}
|
|
267
254
|
const matches = [...this.aliases.keys()].filter(
|
|
268
|
-
(id) => this.
|
|
255
|
+
(id) => this.idNamesService(id, serviceClassName)
|
|
269
256
|
);
|
|
270
257
|
return matches[matches.length - 1];
|
|
271
258
|
}
|
|
@@ -278,9 +265,7 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
278
265
|
...new Set(
|
|
279
266
|
[...this.definitions.values()].flatMap(
|
|
280
267
|
(definition) => this.getDefinitionArgumentReferences(definition)
|
|
281
|
-
).filter(
|
|
282
|
-
(id) => this.serviceIdReferencesService(id, serviceClassName)
|
|
283
|
-
)
|
|
268
|
+
).filter((id) => this.idNamesService(id, serviceClassName))
|
|
284
269
|
)
|
|
285
270
|
];
|
|
286
271
|
}
|
|
@@ -349,14 +334,31 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
349
334
|
this.applyValueOverride(override);
|
|
350
335
|
}
|
|
351
336
|
}
|
|
352
|
-
|
|
337
|
+
trackAutowireAliasIds(autowire) {
|
|
338
|
+
const internals = autowire;
|
|
339
|
+
const createLegacyServiceId = internals._getLegacyServiceId.bind(autowire);
|
|
340
|
+
const aliasIds = /* @__PURE__ */ new Set();
|
|
341
|
+
internals._getLegacyServiceId = async (...args) => {
|
|
342
|
+
const id = await createLegacyServiceId(...args);
|
|
343
|
+
if (!this.container.hasAlias(id) && !this.container.hasDefinition(id)) {
|
|
344
|
+
aliasIds.add(id);
|
|
345
|
+
}
|
|
346
|
+
return id;
|
|
347
|
+
};
|
|
348
|
+
return aliasIds;
|
|
349
|
+
}
|
|
350
|
+
async processAutowire(autowire) {
|
|
353
351
|
const previousLogger = this.container.logger;
|
|
352
|
+
const autowireAliasIds = this.trackAutowireAliasIds(autowire);
|
|
354
353
|
this.container.logger = new AutowireWarningFilter(previousLogger);
|
|
355
354
|
try {
|
|
356
|
-
await
|
|
355
|
+
await autowire.process();
|
|
357
356
|
} finally {
|
|
358
357
|
this.container.logger = previousLogger;
|
|
359
358
|
}
|
|
359
|
+
for (const id of autowireAliasIds) {
|
|
360
|
+
this.aliases.delete(id);
|
|
361
|
+
}
|
|
360
362
|
}
|
|
361
363
|
registerParentAliases() {
|
|
362
364
|
for (const [id, definition] of this.definitions.entries()) {
|
|
@@ -369,13 +371,12 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
369
371
|
async compile() {
|
|
370
372
|
if (this.options.containerBuild) {
|
|
371
373
|
await this.ensureFolderExists(this.options.servicesYamlPath);
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this.autowire.serviceFile = new import_node_dependency_injection.ServiceFile(
|
|
374
|
+
const autowire = new import_node_dependency_injection.Autowire(this.container);
|
|
375
|
+
autowire.serviceFile = new import_node_dependency_injection.ServiceFile(
|
|
375
376
|
this.options.servicesYamlPath,
|
|
376
377
|
false
|
|
377
378
|
);
|
|
378
|
-
await this.processAutowire();
|
|
379
|
+
await this.processAutowire(autowire);
|
|
379
380
|
} else {
|
|
380
381
|
this.loader = new import_node_dependency_injection.YamlFileLoader(this.container);
|
|
381
382
|
await this.loader.load(this.options.servicesYamlPath);
|