@haskou/ddd-kernel 3.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{RetryPredicate-DG6jcGCX.d.ts → RetryPredicate-BR91-irp.d.ts} +3 -5
- package/dist/{RetryPredicate-BKlKFvI4.d.cts → RetryPredicate-Drg7hU3-.d.cts} +3 -5
- package/dist/adapters/index.cjs +7 -30
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +7 -30
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/pubsub/amqp/index.cjs +2 -2
- package/dist/adapters/pubsub/amqp/index.cjs.map +1 -1
- package/dist/adapters/pubsub/amqp/index.js +2 -2
- package/dist/adapters/pubsub/amqp/index.js.map +1 -1
- package/dist/adapters/pubsub/index.cjs +7 -24
- package/dist/adapters/pubsub/index.cjs.map +1 -1
- package/dist/adapters/pubsub/index.d.cts +1 -4
- package/dist/adapters/pubsub/index.d.ts +1 -4
- package/dist/adapters/pubsub/index.js +7 -24
- package/dist/adapters/pubsub/index.js.map +1 -1
- package/dist/adapters/ui/express/index.cjs +0 -6
- package/dist/adapters/ui/express/index.cjs.map +1 -1
- package/dist/adapters/ui/express/index.d.cts +0 -10
- package/dist/adapters/ui/express/index.d.ts +0 -10
- package/dist/adapters/ui/express/index.js +0 -6
- package/dist/adapters/ui/express/index.js.map +1 -1
- package/dist/adapters/ui/index.cjs +2 -8
- package/dist/adapters/ui/index.cjs.map +1 -1
- package/dist/adapters/ui/index.js +2 -8
- package/dist/adapters/ui/index.js.map +1 -1
- package/dist/adapters/ui/routes/index.cjs +2 -2
- package/dist/adapters/ui/routes/index.cjs.map +1 -1
- package/dist/adapters/ui/routes/index.js +2 -2
- package/dist/adapters/ui/routes/index.js.map +1 -1
- package/dist/contracts/index.d.cts +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/kernel/index.d.cts +1 -1
- package/dist/contracts/kernel/index.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/dependency-injection/index.cjs +2 -2
- package/dist/infrastructure/dependency-injection/index.cjs.map +1 -1
- package/dist/infrastructure/dependency-injection/index.js +2 -2
- package/dist/infrastructure/dependency-injection/index.js.map +1 -1
- package/dist/infrastructure/express/index.cjs +0 -6
- package/dist/infrastructure/express/index.cjs.map +1 -1
- package/dist/infrastructure/express/index.js +0 -6
- package/dist/infrastructure/express/index.js.map +1 -1
- package/dist/infrastructure/scheduler/index.cjs +2 -2
- package/dist/infrastructure/scheduler/index.cjs.map +1 -1
- package/dist/infrastructure/scheduler/index.js +2 -2
- package/dist/infrastructure/scheduler/index.js.map +1 -1
- package/package.json +1 -1
package/dist/adapters/index.js
CHANGED
|
@@ -286,10 +286,10 @@ var DependencyInjection = class _DependencyInjection {
|
|
|
286
286
|
}
|
|
287
287
|
trackAutowireAliasIds(autowire) {
|
|
288
288
|
const internals = autowire;
|
|
289
|
-
const
|
|
289
|
+
const createServiceId = internals._getLegacyServiceId.bind(autowire);
|
|
290
290
|
const aliasIds = /* @__PURE__ */ new Set();
|
|
291
291
|
internals._getLegacyServiceId = async (...args) => {
|
|
292
|
-
const id = await
|
|
292
|
+
const id = await createServiceId(...args);
|
|
293
293
|
if (!this.container.hasAlias(id) && !this.container.hasDefinition(id)) {
|
|
294
294
|
aliasIds.add(id);
|
|
295
295
|
}
|
|
@@ -806,34 +806,20 @@ var IdempotencyConsumerMiddleware = class {
|
|
|
806
806
|
this.options = options;
|
|
807
807
|
}
|
|
808
808
|
options;
|
|
809
|
-
async
|
|
810
|
-
const
|
|
809
|
+
async handle(event, next, context) {
|
|
810
|
+
const key = this.options.key?.(event, context) ?? context.eventId;
|
|
811
|
+
const claimed = await this.options.store.claim(key);
|
|
811
812
|
if (!claimed) {
|
|
812
813
|
return;
|
|
813
814
|
}
|
|
814
815
|
try {
|
|
815
816
|
await next();
|
|
816
|
-
await
|
|
817
|
+
await this.options.store.commit(key);
|
|
817
818
|
} catch (error) {
|
|
818
|
-
await this.options.store.release
|
|
819
|
+
await this.options.store.release(key);
|
|
819
820
|
throw error;
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
|
-
async handleLegacyKey(key, next) {
|
|
823
|
-
if (await this.options.store.has(key)) {
|
|
824
|
-
return;
|
|
825
|
-
}
|
|
826
|
-
await next();
|
|
827
|
-
await this.options.store.mark(key);
|
|
828
|
-
}
|
|
829
|
-
async handle(event, next, context) {
|
|
830
|
-
const key = this.options.key?.(event, context) ?? context.eventId;
|
|
831
|
-
if (this.options.store.claim) {
|
|
832
|
-
await this.handleClaimedKey(key, next);
|
|
833
|
-
} else {
|
|
834
|
-
await this.handleLegacyKey(key, next);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
823
|
};
|
|
838
824
|
|
|
839
825
|
// src/adapters/pubsub/InMemoryIdempotencyStore.ts
|
|
@@ -857,9 +843,6 @@ var InMemoryIdempotencyStore = class {
|
|
|
857
843
|
has(key) {
|
|
858
844
|
return this.handledKeys.has(key);
|
|
859
845
|
}
|
|
860
|
-
mark(key) {
|
|
861
|
-
this.handledKeys.add(key);
|
|
862
|
-
}
|
|
863
846
|
};
|
|
864
847
|
|
|
865
848
|
// src/adapters/pubsub/PublisherHookPipeline.ts
|
|
@@ -1088,8 +1071,6 @@ var ExpressKernelServer = class {
|
|
|
1088
1071
|
options.postControllerMiddlewares
|
|
1089
1072
|
);
|
|
1090
1073
|
this.preControllerMiddlewares = this.copy(options.preControllerMiddlewares);
|
|
1091
|
-
this.staticHooks = this.copy(options.staticHooks);
|
|
1092
|
-
this.swaggerHooks = this.copy(options.swaggerHooks);
|
|
1093
1074
|
}
|
|
1094
1075
|
options;
|
|
1095
1076
|
applicationRequire = createRequire(
|
|
@@ -1105,8 +1086,6 @@ var ExpressKernelServer = class {
|
|
|
1105
1086
|
postControllerMiddlewares;
|
|
1106
1087
|
preControllerMiddlewares;
|
|
1107
1088
|
serverInstance;
|
|
1108
|
-
staticHooks;
|
|
1109
|
-
swaggerHooks;
|
|
1110
1089
|
copy(items) {
|
|
1111
1090
|
return [...items ?? []];
|
|
1112
1091
|
}
|
|
@@ -1264,8 +1243,6 @@ var ExpressKernelServer = class {
|
|
|
1264
1243
|
this.applyMiddlewares(app, this.postControllerMiddlewares);
|
|
1265
1244
|
await this.runHooks(this.afterControllersHooks, app);
|
|
1266
1245
|
await this.runPhaseHooks("afterControllers", app);
|
|
1267
|
-
await this.runHooks(this.swaggerHooks, app);
|
|
1268
|
-
await this.runHooks(this.staticHooks, app);
|
|
1269
1246
|
await this.runPhaseHooks("beforeErrors", app);
|
|
1270
1247
|
this.applyErrorHandlers(app);
|
|
1271
1248
|
this.appInstance = app;
|