@ddd-ts-kit/kernel 0.113.2 → 0.115.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.fr.md +70 -62
- package/README.md +65 -57
- package/dist/application/audit/restamped.d.ts +9 -0
- package/dist/application/audit/restamped.d.ts.map +1 -0
- package/dist/application/audit/restamped.js +9 -0
- package/dist/application/audit/restamped.js.map +1 -0
- package/dist/application/audit/stamp-update.d.ts +1 -6
- package/dist/application/audit/stamp-update.d.ts.map +1 -1
- package/dist/application/audit/stamp-update.js +2 -8
- package/dist/application/audit/stamp-update.js.map +1 -1
- package/dist/application/background/enqueued-job.d.ts +1 -1
- package/dist/application/background/enqueued-job.d.ts.map +1 -1
- package/dist/application/error-reporting/report-once.d.ts.map +1 -1
- package/dist/application/error-reporting/report-once.js +2 -6
- package/dist/application/error-reporting/report-once.js.map +1 -1
- package/dist/application/event-sourcing/event-envelope.d.ts +2 -1
- package/dist/application/event-sourcing/event-envelope.d.ts.map +1 -1
- package/dist/application/event-sourcing/event-to-append.d.ts +1 -1
- package/dist/application/event-sourcing/event-to-append.d.ts.map +1 -1
- package/dist/application/execution/with-actor.d.ts +2 -2
- package/dist/application/execution/with-actor.js +3 -3
- package/dist/application/execution/with-actor.js.map +1 -1
- package/dist/application/files/stored-file.d.ts +3 -3
- package/dist/application/files/stored-file.d.ts.map +1 -1
- package/dist/application/hydration/hydration.d.ts.map +1 -1
- package/dist/application/hydration/hydration.js +3 -2
- package/dist/application/hydration/hydration.js.map +1 -1
- package/dist/application/logging/hidden-keys.d.ts +8 -0
- package/dist/application/logging/hidden-keys.d.ts.map +1 -0
- package/dist/application/logging/hidden-keys.js +10 -0
- package/dist/application/logging/hidden-keys.js.map +1 -0
- package/dist/application/logging/index.d.ts +1 -0
- package/dist/application/logging/index.d.ts.map +1 -1
- package/dist/application/logging/index.js +1 -0
- package/dist/application/logging/index.js.map +1 -1
- package/dist/application/observation/safely.d.ts +6 -0
- package/dist/application/observation/safely.d.ts.map +1 -0
- package/dist/application/observation/safely.js +13 -0
- package/dist/application/observation/safely.js.map +1 -0
- package/dist/application/persistence/append-changes.d.ts +1 -0
- package/dist/application/persistence/append-changes.d.ts.map +1 -1
- package/dist/application/persistence/append-changes.js +7 -6
- package/dist/application/persistence/append-changes.js.map +1 -1
- package/dist/application/persistence/optimistic-update.d.ts +6 -2
- package/dist/application/persistence/optimistic-update.d.ts.map +1 -1
- package/dist/application/persistence/optimistic-update.js +11 -3
- package/dist/application/persistence/optimistic-update.js.map +1 -1
- package/dist/application/ports/domain-event-dispatcher.d.ts +1 -1
- package/dist/application/ports/domain-event-dispatcher.js +1 -1
- package/dist/application/ports/logger.d.ts +3 -3
- package/dist/application/ports/unit-of-work.d.ts +1 -1
- package/dist/application/ports/unit-of-work.js +1 -1
- package/dist/application/read-model/stamp-of.d.ts +11 -4
- package/dist/application/read-model/stamp-of.d.ts.map +1 -1
- package/dist/application/read-model/stamp-of.js +10 -8
- package/dist/application/read-model/stamp-of.js.map +1 -1
- package/dist/application/session/anonymous-session.d.ts.map +1 -1
- package/dist/application/session/anonymous-session.js +4 -2
- package/dist/application/session/anonymous-session.js.map +1 -1
- package/dist/application/session/never-issued.d.ts +2 -1
- package/dist/application/session/never-issued.d.ts.map +1 -1
- package/dist/application/session/never-issued.js +4 -1
- package/dist/application/session/never-issued.js.map +1 -1
- package/dist/application/session/system-session.d.ts.map +1 -1
- package/dist/application/session/system-session.js +2 -2
- package/dist/application/session/system-session.js.map +1 -1
- package/dist/application/undecided/index.d.ts +3 -0
- package/dist/application/undecided/index.d.ts.map +1 -0
- package/dist/application/undecided/index.js +3 -0
- package/dist/application/undecided/index.js.map +1 -0
- package/dist/application/undecided/undecided-error.d.ts +12 -0
- package/dist/application/undecided/undecided-error.d.ts.map +1 -0
- package/dist/application/undecided/undecided-error.js +15 -0
- package/dist/application/undecided/undecided-error.js.map +1 -0
- package/dist/application/undecided/undecided.d.ts +7 -0
- package/dist/application/undecided/undecided.d.ts.map +1 -0
- package/dist/application/undecided/undecided.js +9 -0
- package/dist/application/undecided/undecided.js.map +1 -0
- package/dist/domain/aggregate-root.d.ts +6 -13
- package/dist/domain/aggregate-root.d.ts.map +1 -1
- package/dist/domain/aggregate-root.js +10 -16
- package/dist/domain/aggregate-root.js.map +1 -1
- package/dist/domain/aggregate-tracking.d.ts +30 -0
- package/dist/domain/aggregate-tracking.d.ts.map +1 -0
- package/dist/domain/aggregate-tracking.js +48 -0
- package/dist/domain/aggregate-tracking.js.map +1 -0
- package/dist/domain/domain-event.d.ts +4 -0
- package/dist/domain/domain-event.d.ts.map +1 -1
- package/dist/domain/domain-event.js.map +1 -1
- package/dist/domain/errors/domain-error.d.ts.map +1 -1
- package/dist/domain/errors/domain-error.js +2 -1
- package/dist/domain/errors/domain-error.js.map +1 -1
- package/dist/domain/errors/factual-refusal.d.ts.map +1 -1
- package/dist/domain/errors/factual-refusal.js +3 -0
- package/dist/domain/errors/factual-refusal.js.map +1 -1
- package/dist/domain/errors/kit-codes.d.ts +2 -0
- package/dist/domain/errors/kit-codes.d.ts.map +1 -1
- package/dist/domain/errors/kit-codes.js +2 -0
- package/dist/domain/errors/kit-codes.js.map +1 -1
- package/dist/domain/event-id-of.d.ts +8 -0
- package/dist/domain/event-id-of.d.ts.map +1 -0
- package/dist/domain/event-id-of.js +10 -0
- package/dist/domain/event-id-of.js.map +1 -0
- package/dist/domain/event-rank.d.ts +8 -0
- package/dist/domain/event-rank.d.ts.map +1 -0
- package/dist/domain/event-rank.js +8 -0
- package/dist/domain/event-rank.js.map +1 -0
- package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts +0 -1
- package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts.map +1 -1
- package/dist/domain/event-sourcing/event-sourced-aggregate.js +4 -8
- package/dist/domain/event-sourcing/event-sourced-aggregate.js.map +1 -1
- package/dist/domain/named-domain-event.d.ts +11 -4
- package/dist/domain/named-domain-event.d.ts.map +1 -1
- package/dist/domain/named-domain-event.js +14 -3
- package/dist/domain/named-domain-event.js.map +1 -1
- package/dist/domain/rank-of.d.ts +8 -0
- package/dist/domain/rank-of.d.ts.map +1 -0
- package/dist/domain/rank-of.js +14 -0
- package/dist/domain/rank-of.js.map +1 -0
- package/dist/domain/ranked.d.ts +10 -0
- package/dist/domain/ranked.d.ts.map +1 -0
- package/dist/domain/ranked.js +19 -0
- package/dist/domain/ranked.js.map +1 -0
- package/dist/domain/result/unwrap.d.ts +1 -0
- package/dist/domain/result/unwrap.d.ts.map +1 -1
- package/dist/domain/result/unwrap.js +4 -1
- package/dist/domain/result/unwrap.js.map +1 -1
- package/dist/domain/state-machine/state-machine.d.ts +4 -0
- package/dist/domain/state-machine/state-machine.d.ts.map +1 -1
- package/dist/domain/state-machine/state-machine.js +14 -4
- package/dist/domain/state-machine/state-machine.js.map +1 -1
- package/dist/domain/value-object/frozen-copy.d.ts +8 -0
- package/dist/domain/value-object/frozen-copy.d.ts.map +1 -0
- package/dist/domain/value-object/frozen-copy.js +34 -0
- package/dist/domain/value-object/frozen-copy.js.map +1 -0
- package/dist/domain/value-object/index.d.ts +2 -0
- package/dist/domain/value-object/index.d.ts.map +1 -0
- package/dist/domain/value-object/index.js +2 -0
- package/dist/domain/value-object/index.js.map +1 -0
- package/dist/domain/value-object/is-plain-record.d.ts +3 -0
- package/dist/domain/value-object/is-plain-record.d.ts.map +1 -0
- package/dist/domain/value-object/is-plain-record.js +9 -0
- package/dist/domain/value-object/is-plain-record.js.map +1 -0
- package/dist/domain/value-object/same-value.d.ts +8 -0
- package/dist/domain/value-object/same-value.d.ts.map +1 -0
- package/dist/domain/value-object/same-value.js +43 -0
- package/dist/domain/value-object/same-value.js.map +1 -0
- package/dist/domain/value-object/value-object.d.ts +28 -0
- package/dist/domain/value-object/value-object.d.ts.map +1 -0
- package/dist/domain/value-object/value-object.js +24 -0
- package/dist/domain/value-object/value-object.js.map +1 -0
- package/dist/index.d.ts +9 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/aggregates/aggregate-mapper.d.ts +21 -0
- package/dist/infrastructure/aggregates/aggregate-mapper.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/aggregate-mapper.js +18 -0
- package/dist/infrastructure/aggregates/aggregate-mapper.js.map +1 -0
- package/dist/infrastructure/aggregates/aggregate-save.d.ts +22 -0
- package/dist/infrastructure/aggregates/aggregate-save.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/aggregate-save.js +2 -0
- package/dist/infrastructure/aggregates/aggregate-save.js.map +1 -0
- package/dist/infrastructure/aggregates/as-found.d.ts +8 -0
- package/dist/infrastructure/aggregates/as-found.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/as-found.js +2 -0
- package/dist/infrastructure/aggregates/as-found.js.map +1 -0
- package/dist/infrastructure/aggregates/give-back.d.ts +9 -0
- package/dist/infrastructure/aggregates/give-back.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/give-back.js +13 -0
- package/dist/infrastructure/aggregates/give-back.js.map +1 -0
- package/dist/infrastructure/aggregates/index.d.ts +7 -0
- package/dist/infrastructure/aggregates/index.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/index.js +7 -0
- package/dist/infrastructure/aggregates/index.js.map +1 -0
- package/dist/infrastructure/aggregates/loaded-at.d.ts +8 -0
- package/dist/infrastructure/aggregates/loaded-at.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/loaded-at.js +12 -0
- package/dist/infrastructure/aggregates/loaded-at.js.map +1 -0
- package/dist/infrastructure/aggregates/noted-as-found.d.ts +8 -0
- package/dist/infrastructure/aggregates/noted-as-found.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/noted-as-found.js +15 -0
- package/dist/infrastructure/aggregates/noted-as-found.js.map +1 -0
- package/dist/infrastructure/aggregates/recorded-events-of.d.ts +4 -0
- package/dist/infrastructure/aggregates/recorded-events-of.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/recorded-events-of.js +6 -0
- package/dist/infrastructure/aggregates/recorded-events-of.js.map +1 -0
- package/dist/infrastructure/aggregates/save-aggregate-row.d.ts +23 -0
- package/dist/infrastructure/aggregates/save-aggregate-row.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/save-aggregate-row.js +17 -0
- package/dist/infrastructure/aggregates/save-aggregate-row.js.map +1 -0
- package/dist/infrastructure/aggregates/stored-at.d.ts +7 -0
- package/dist/infrastructure/aggregates/stored-at.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/stored-at.js +14 -0
- package/dist/infrastructure/aggregates/stored-at.js.map +1 -0
- package/dist/infrastructure/aggregates/take-recorded-events.d.ts +9 -0
- package/dist/infrastructure/aggregates/take-recorded-events.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/take-recorded-events.js +17 -0
- package/dist/infrastructure/aggregates/take-recorded-events.js.map +1 -0
- package/dist/infrastructure/aggregates/unstored-events-of.d.ts +4 -0
- package/dist/infrastructure/aggregates/unstored-events-of.d.ts.map +1 -0
- package/dist/infrastructure/aggregates/unstored-events-of.js +7 -0
- package/dist/infrastructure/aggregates/unstored-events-of.js.map +1 -0
- package/dist/infrastructure/clock/fixed-clock.d.ts +2 -1
- package/dist/infrastructure/clock/fixed-clock.d.ts.map +1 -1
- package/dist/infrastructure/clock/fixed-clock.js +5 -4
- package/dist/infrastructure/clock/fixed-clock.js.map +1 -1
- package/dist/infrastructure/context/scoped-actor-context.d.ts.map +1 -1
- package/dist/infrastructure/context/scoped-actor-context.js +2 -6
- package/dist/infrastructure/context/scoped-actor-context.js.map +1 -1
- package/dist/infrastructure/domain-events/announce-domain-events.d.ts +1 -1
- package/dist/infrastructure/domain-events/announce-domain-events.js +1 -1
- package/dist/infrastructure/domain-events/dispatching-on-save.d.ts +1 -1
- package/dist/infrastructure/domain-events/dispatching-on-save.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/dispatching-on-save.js +3 -2
- package/dist/infrastructure/domain-events/dispatching-on-save.js.map +1 -1
- package/dist/infrastructure/domain-events/index.d.ts +13 -0
- package/dist/infrastructure/domain-events/index.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/index.js +13 -0
- package/dist/infrastructure/domain-events/index.js.map +1 -0
- package/dist/infrastructure/domain-events/recorded-aggregates.d.ts +2 -5
- package/dist/infrastructure/domain-events/recorded-aggregates.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/recorded-aggregates.js +3 -5
- package/dist/infrastructure/domain-events/recorded-aggregates.js.map +1 -1
- package/dist/infrastructure/domain-events/unit-of-work-aborted-error.d.ts +10 -0
- package/dist/infrastructure/domain-events/unit-of-work-aborted-error.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/unit-of-work-aborted-error.js +13 -0
- package/dist/infrastructure/domain-events/unit-of-work-aborted-error.js.map +1 -0
- package/dist/infrastructure/domain-events/unit-of-work-over.d.ts +43 -0
- package/dist/infrastructure/domain-events/unit-of-work-over.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/unit-of-work-over.js +132 -0
- package/dist/infrastructure/domain-events/unit-of-work-over.js.map +1 -0
- package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts +9 -1
- package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/unit-of-work-scope.js.map +1 -1
- package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.d.ts +8 -0
- package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.js +11 -0
- package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.js.map +1 -0
- package/dist/infrastructure/domain-events/when-committed.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/when-committed.js +2 -9
- package/dist/infrastructure/domain-events/when-committed.js.map +1 -1
- package/dist/infrastructure/event-sourcing/aggregate-id-of.d.ts +4 -0
- package/dist/infrastructure/event-sourcing/aggregate-id-of.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/aggregate-id-of.js +6 -0
- package/dist/infrastructure/event-sourcing/aggregate-id-of.js.map +1 -0
- package/dist/infrastructure/event-sourcing/event-serializer.d.ts +3 -4
- package/dist/infrastructure/event-sourcing/event-serializer.d.ts.map +1 -1
- package/dist/infrastructure/event-sourcing/event-serializer.js +10 -12
- package/dist/infrastructure/event-sourcing/event-serializer.js.map +1 -1
- package/dist/infrastructure/event-sourcing/event-store-personal-data-export.d.ts.map +1 -1
- package/dist/infrastructure/event-sourcing/event-store-personal-data-export.js +1 -5
- package/dist/infrastructure/event-sourcing/event-store-personal-data-export.js.map +1 -1
- package/dist/infrastructure/events/idempotent.d.ts.map +1 -1
- package/dist/infrastructure/events/idempotent.js +9 -3
- package/dist/infrastructure/events/idempotent.js.map +1 -1
- package/dist/infrastructure/in-memory/as-json-carries.d.ts +9 -0
- package/dist/infrastructure/in-memory/as-json-carries.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/as-json-carries.js +12 -0
- package/dist/infrastructure/in-memory/as-json-carries.js.map +1 -0
- package/dist/infrastructure/in-memory/composite-key.d.ts +6 -0
- package/dist/infrastructure/in-memory/composite-key.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/composite-key.js +8 -0
- package/dist/infrastructure/in-memory/composite-key.js.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-cache.d.ts +3 -1
- package/dist/infrastructure/in-memory/in-memory-cache.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-cache.js +7 -3
- package/dist/infrastructure/in-memory/in-memory-cache.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.d.ts +0 -1
- package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.js +2 -9
- package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-event-bus.d.ts +7 -14
- package/dist/infrastructure/in-memory/in-memory-event-bus.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-event-bus.js +17 -9
- package/dist/infrastructure/in-memory/in-memory-event-bus.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-event-store.d.ts +1 -0
- package/dist/infrastructure/in-memory/in-memory-event-store.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-event-store.js +11 -10
- package/dist/infrastructure/in-memory/in-memory-event-store.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-process-store.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-process-store.js +4 -6
- package/dist/infrastructure/in-memory/in-memory-process-store.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-processed-event-store.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-processed-event-store.js +3 -6
- package/dist/infrastructure/in-memory/in-memory-processed-event-store.js.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-unit-of-work.d.ts +4 -2
- package/dist/infrastructure/in-memory/in-memory-unit-of-work.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-memory-unit-of-work.js +6 -4
- package/dist/infrastructure/in-memory/in-memory-unit-of-work.js.map +1 -1
- package/dist/infrastructure/in-memory/in-process-bus.d.ts +1 -0
- package/dist/infrastructure/in-memory/in-process-bus.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/in-process-bus.js +4 -3
- package/dist/infrastructure/in-memory/in-process-bus.js.map +1 -1
- package/dist/infrastructure/in-memory/unit-of-work-middleware.d.ts +5 -5
- package/dist/infrastructure/in-memory/unit-of-work-middleware.d.ts.map +1 -1
- package/dist/infrastructure/in-memory/unit-of-work-middleware.js +13 -4
- package/dist/infrastructure/in-memory/unit-of-work-middleware.js.map +1 -1
- package/package.json +4 -4
- package/dist/domain/event-sourcing/unstored-events.d.ts +0 -8
- package/dist/domain/event-sourcing/unstored-events.d.ts.map +0 -1
- package/dist/domain/event-sourcing/unstored-events.js +0 -7
- package/dist/domain/event-sourcing/unstored-events.js.map +0 -1
- package/dist/domain/value-object.d.ts +0 -12
- package/dist/domain/value-object.d.ts.map +0 -1
- package/dist/domain/value-object.js +0 -40
- package/dist/domain/value-object.js.map +0 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.d.ts +0 -25
- package/dist/infrastructure/domain-events/within-unit-of-work.d.ts.map +0 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.js +0 -85
- package/dist/infrastructure/domain-events/within-unit-of-work.js.map +0 -1
- package/dist/infrastructure/event-sourcing/stored-origins.d.ts +0 -5
- package/dist/infrastructure/event-sourcing/stored-origins.d.ts.map +0 -1
- package/dist/infrastructure/event-sourcing/stored-origins.js +0 -3
- package/dist/infrastructure/event-sourcing/stored-origins.js.map +0 -1
- package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts +0 -11
- package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts.map +0 -1
- package/dist/infrastructure/event-sourcing/stored-stamp-of.js +0 -15
- package/dist/infrastructure/event-sourcing/stored-stamp-of.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-domain-event-dispatcher.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-domain-event-dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory-domain-event-dispatcher.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-domain-event-dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAElG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,6BAA8B,YAAW,qBAAqB;IAM7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IALpC,8EAA8E;IAC9E,QAAQ,CAAC,mBAAmB,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;KAAE,EAAE,CAAM;IAE9F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IAErE,YAA6B,MAAM,CAAC,EAAE,kBAAkB,YAAA,EAAI;IAE5D,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,YAAY,GAAE,uBAA4B,GAAG,IAAI,CAI/F;IAEK,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,KAAK,GAAE,gBAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,CAUvG;YAEa,SAAS;CAaxB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { safely } from '../../application/observation/safely.js';
|
|
1
2
|
/**
|
|
2
3
|
* Calls the callbacks in process, in registration order. A failure of the `after-commit` phase
|
|
3
4
|
* is kept in `afterCommitFailures`, the last hundred of them, and told to `failed`: give it
|
|
@@ -36,15 +37,7 @@ export class InMemoryDomainEventDispatcher {
|
|
|
36
37
|
if (this.afterCommitFailures.length > KEPT_FAILURES) {
|
|
37
38
|
this.afterCommitFailures.shift();
|
|
38
39
|
}
|
|
39
|
-
this.
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
tell(error, event) {
|
|
43
|
-
try {
|
|
44
|
-
this.failed?.(error, event);
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return;
|
|
40
|
+
safely(() => this.failed?.(error, event));
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-domain-event-dispatcher.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-domain-event-dispatcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-memory-domain-event-dispatcher.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-domain-event-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAI9D;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAMX,MAAM;IALnC,8EAA8E;IACrE,mBAAmB,GAA+D,EAAE,CAAC;IAE7E,QAAQ,GAAG,IAAI,GAAG,EAAiC,CAAC;IAErE,YAA6B,MAA2B;sBAA3B,MAAM;IAAwB,CAAC;IAE5D,EAAE,CAAC,IAAY,EAAE,OAA4B,EAAE,YAAY,GAA4B,EAAE;QACvF,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,eAAe,EAAE,IAAI,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA8B,EAAE,KAAK,GAAqB,eAAe;QACtF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACxE,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;oBAC9B,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,OAA4B,EAAE,KAAkB;QACtE,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAEhD,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC;gBACpD,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;YACnC,CAAC;YAED,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;CACF;AAED,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,SAAS,KAAK,CAAC,KAAuB,EAAE,IAAY;IAClD,OAAO,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -3,29 +3,22 @@ import type { IntegrationEvent } from '../../application/events/integration-even
|
|
|
3
3
|
import type { Subscription } from '../../application/events/subscription.js';
|
|
4
4
|
import type { IntegrationEventPublisher } from '../../application/ports/integration-event-publisher.js';
|
|
5
5
|
import type { IntegrationEventSubscriber } from '../../application/ports/integration-event-subscriber.js';
|
|
6
|
-
/**
|
|
7
|
-
* How `publish` rejects once its handlers ran. `aggregated`: always an `AggregateError` holding
|
|
8
|
-
* every failure, even a single one. `as-thrown`: one failure is rethrown as it is, so its class
|
|
9
|
-
* and its `code` (`CONCURRENCY_CONFLICT`, answered 409) reach the caller; several are rethrown
|
|
10
|
-
* together in an `AggregateError`.
|
|
11
|
-
*/
|
|
12
|
-
export type EventBusFailures = 'aggregated' | 'as-thrown';
|
|
13
|
-
export interface InMemoryEventBusOptions {
|
|
14
|
-
/** Default `aggregated`; it becomes `as-thrown` in a later minor version. */
|
|
15
|
-
readonly failures?: EventBusFailures | undefined;
|
|
16
|
-
}
|
|
17
6
|
/**
|
|
18
7
|
* Reference provider for IntegrationEvents, for tests, local dev and single-process apps.
|
|
19
8
|
* Delivery is at-least-once-shaped: handlers are awaited in order, a failing handler
|
|
20
|
-
* does not stop the others
|
|
9
|
+
* does not stop the others. `publish` then rejects with the failure of a single handler as it
|
|
10
|
+
* is, so its class and its `code` (`CONCURRENCY_CONFLICT`, answered 409) reach the caller, and
|
|
11
|
+
* with an `AggregateError` of several.
|
|
12
|
+
* An event is delivered as a broker delivers it, as JSON carries it: the handlers of a type
|
|
13
|
+
* share one copy, where a `Date` is its text, and an event JSON cannot carry (a bigint, a
|
|
14
|
+
* cycle) is refused at the publication.
|
|
21
15
|
*/
|
|
22
16
|
export declare class InMemoryEventBus implements IntegrationEventPublisher, IntegrationEventSubscriber {
|
|
23
17
|
/** Read by what observes the bus from outside: the name of the transport. */
|
|
24
18
|
readonly messagingSystem = "in-memory";
|
|
19
|
+
/** Every event published so far, as JSON carried it, apart from what the handlers received. */
|
|
25
20
|
readonly published: IntegrationEvent[];
|
|
26
21
|
private readonly handlers;
|
|
27
|
-
private readonly failureMode;
|
|
28
|
-
constructor(options?: InMemoryEventBusOptions);
|
|
29
22
|
publish(events: readonly IntegrationEvent[]): Promise<void>;
|
|
30
23
|
subscribe(type: string, handler: IntegrationEventCallback): Subscription;
|
|
31
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-event-bus.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory-event-bus.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAGvG;;;;;;;;;GASG;AACH,qBAAa,gBAAiB,YAAW,yBAAyB,EAAE,0BAA0B;IAC5F,6EAA6E;IAC7E,QAAQ,CAAC,eAAe,eAAe;IAEvC,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,gBAAgB,EAAE,CAAM;IAE5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;IAEvE,OAAO,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhE;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,YAAY,CAOvE;CACF"}
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
+
import { asJsonCarries } from './as-json-carries.js';
|
|
1
2
|
/**
|
|
2
3
|
* Reference provider for IntegrationEvents, for tests, local dev and single-process apps.
|
|
3
4
|
* Delivery is at-least-once-shaped: handlers are awaited in order, a failing handler
|
|
4
|
-
* does not stop the others
|
|
5
|
+
* does not stop the others. `publish` then rejects with the failure of a single handler as it
|
|
6
|
+
* is, so its class and its `code` (`CONCURRENCY_CONFLICT`, answered 409) reach the caller, and
|
|
7
|
+
* with an `AggregateError` of several.
|
|
8
|
+
* An event is delivered as a broker delivers it, as JSON carries it: the handlers of a type
|
|
9
|
+
* share one copy, where a `Date` is its text, and an event JSON cannot carry (a bigint, a
|
|
10
|
+
* cycle) is refused at the publication.
|
|
5
11
|
*/
|
|
6
12
|
export class InMemoryEventBus {
|
|
7
13
|
/** Read by what observes the bus from outside: the name of the transport. */
|
|
8
14
|
messagingSystem = 'in-memory';
|
|
15
|
+
/** Every event published so far, as JSON carried it, apart from what the handlers received. */
|
|
9
16
|
published = [];
|
|
10
17
|
handlers = new Map();
|
|
11
|
-
failureMode;
|
|
12
|
-
constructor(options = {}) {
|
|
13
|
-
this.failureMode = options.failures ?? 'aggregated';
|
|
14
|
-
}
|
|
15
18
|
async publish(events) {
|
|
16
19
|
const failures = [];
|
|
17
20
|
for (const event of events) {
|
|
18
|
-
this.published.push(event);
|
|
21
|
+
this.published.push(carried(event));
|
|
22
|
+
const delivered = carried(event);
|
|
19
23
|
for (const handler of this.handlers.get(event.type) ?? []) {
|
|
20
24
|
try {
|
|
21
|
-
await handler(
|
|
25
|
+
await handler(delivered, { attempt: 1, system: this.messagingSystem, destination: event.type });
|
|
22
26
|
}
|
|
23
27
|
catch (error) {
|
|
24
28
|
failures.push(error);
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
|
-
if (failures.length === 1
|
|
32
|
+
if (failures.length === 1) {
|
|
29
33
|
throw failures[0];
|
|
30
34
|
}
|
|
31
|
-
if (failures.length >
|
|
35
|
+
if (failures.length > 1) {
|
|
32
36
|
throw new AggregateError(failures, `${failures.length} event handler(s) failed`);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -39,4 +43,8 @@ export class InMemoryEventBus {
|
|
|
39
43
|
return { unsubscribe: () => void set.delete(handler) };
|
|
40
44
|
}
|
|
41
45
|
}
|
|
46
|
+
function carried(event) {
|
|
47
|
+
// eslint-disable-next-line ddd-ts-kit/clean-no-escape-hatch -- the JSON of an envelope, read back, is that envelope: only the values JSON does not carry changed
|
|
48
|
+
return asJsonCarries(event);
|
|
49
|
+
}
|
|
42
50
|
//# sourceMappingURL=in-memory-event-bus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-event-bus.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-bus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-memory-event-bus.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-bus.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAO,gBAAgB;IAC3B,6EAA6E;IACpE,eAAe,GAAG,WAAW,CAAC;IAEvC,+FAA+F;IACtF,SAAS,GAAuB,EAAE,CAAC;IAE3B,QAAQ,GAAG,IAAI,GAAG,EAAyC,CAAC;IAE7E,KAAK,CAAC,OAAO,CAAC,MAAmC;QAC/C,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YAEjC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1D,IAAI,CAAC;oBACH,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;gBAClG,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,0BAA0B,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,SAAS,CAAC,IAAY,EAAE,OAAiC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAEjD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAE7B,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IACzD,CAAC;CACF;AAED,SAAS,OAAO,CAAC,KAAuB;IACtC,iKAAiK;IACjK,OAAO,aAAa,CAAC,KAAK,CAAqB,CAAC;AAClD,CAAC"}
|
|
@@ -4,6 +4,7 @@ import type { StoredEvent } from '../../application/event-sourcing/stored-event.
|
|
|
4
4
|
import type { EventStore } from '../../application/ports/event-store.js';
|
|
5
5
|
import type { ExecutionScope } from '../../application/ports/execution-scope.js';
|
|
6
6
|
/** Reference implementation, for tests and single-process apps. Not transactional: a failed unit of work keeps what it appended.
|
|
7
|
+
* An append stores its whole batch or nothing.
|
|
7
8
|
*
|
|
8
9
|
* Given the execution scope, it holds tenant data, as the SQL stores do: it records the tenant of the
|
|
9
10
|
* work at the first append of a stream, refuses a read or an append of a stream of another tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-event-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAI9E
|
|
1
|
+
{"version":3,"file":"in-memory-event-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAI9E;;;;;;GAMG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IAGvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAFnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,YAA6B,KAAK,CAAC,EAAE,cAAc,YAAA,EAAI;IAEjD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0BzG;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAI3E;IAEK,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAE3E;IAEK,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5B;IAED,OAAO,CAAC,OAAO;CAiBhB"}
|
|
@@ -2,6 +2,7 @@ import { assertStreamReach } from '../../application/event-sourcing/assert-strea
|
|
|
2
2
|
import { assertNamesTenant } from '../../application/tenancy/assert-names-tenant.js';
|
|
3
3
|
import { ConcurrencyError } from '../../domain/errors/concurrency-error.js';
|
|
4
4
|
/** Reference implementation, for tests and single-process apps. Not transactional: a failed unit of work keeps what it appended.
|
|
5
|
+
* An append stores its whole batch or nothing.
|
|
5
6
|
*
|
|
6
7
|
* Given the execution scope, it holds tenant data, as the SQL stores do: it records the tenant of the
|
|
7
8
|
* work at the first append of a stream, refuses a read or an append of a stream of another tenant
|
|
@@ -20,16 +21,16 @@ export class InMemoryEventStore {
|
|
|
20
21
|
throw new ConcurrencyError(stream);
|
|
21
22
|
}
|
|
22
23
|
const tenantId = held[0]?.tenantId ?? this.scope?.current()?.tenantId;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
const position = this.events.length;
|
|
25
|
+
const placed = events.map((event, index) => structuredClone({
|
|
26
|
+
...event,
|
|
27
|
+
metadata: event.metadata ?? {},
|
|
28
|
+
stream,
|
|
29
|
+
...(tenantId === undefined ? {} : { tenantId }),
|
|
30
|
+
version: version + index + 1,
|
|
31
|
+
position: position + index + 1,
|
|
32
|
+
}));
|
|
33
|
+
this.events.push(...placed);
|
|
33
34
|
return { version: version + events.length, position: this.events.length };
|
|
34
35
|
}
|
|
35
36
|
async readStream(stream, after = 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-event-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAGzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"in-memory-event-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAGzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IAGA,KAAK;IAFjB,MAAM,GAAkB,EAAE,CAAC;IAE5C,YAA6B,KAAsB;qBAAtB,KAAK;IAAoB,CAAC;IAEvD,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,eAAuB,EAAE,MAAgC;QACpF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;QAE5B,IAAI,OAAO,KAAK,eAAe,EAAE,CAAC;YAChC,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC;QAEtE,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAEpC,MAAM,MAAM,G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IAEO,OAAO,CAAC,MAAc,EAAE,MAAwB;QACtD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;QAEpE,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAErC,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAEnC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,iBAAiB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,SAAS,IAAI,CAAC,KAAkB;IAC9B,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-process-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-process-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory-process-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-process-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAI9E,iIAAiI;AACjI,qBAAa,oBAAqB,YAAW,YAAY;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAExD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAIvE;IAEK,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAShD;IAED,iEAAiE;IACjE,IAAI,IAAI,aAAa,EAAE,CAEtB;CACF"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { ConcurrencyError } from '../../domain/errors/concurrency-error.js';
|
|
2
|
+
import { compositeKey } from './composite-key.js';
|
|
2
3
|
/** The instances of the process managers in the memory of the process, as JSON: for tests and one process. Not transactional. */
|
|
3
4
|
export class InMemoryProcessStore {
|
|
4
5
|
processes = new Map();
|
|
5
6
|
async load(name, id) {
|
|
6
|
-
const stored = this.processes.get(
|
|
7
|
+
const stored = this.processes.get(compositeKey(name, id));
|
|
7
8
|
return stored === undefined ? undefined : copyOf(stored);
|
|
8
9
|
}
|
|
9
10
|
async save(process) {
|
|
10
|
-
const key =
|
|
11
|
+
const key = compositeKey(process.name, process.id);
|
|
11
12
|
const current = this.processes.get(key)?.version ?? 0;
|
|
12
13
|
if (process.version !== current + 1) {
|
|
13
|
-
throw new ConcurrencyError(
|
|
14
|
+
throw new ConcurrencyError(`${process.name}:${process.id}`);
|
|
14
15
|
}
|
|
15
16
|
this.processes.set(key, copyOf(process));
|
|
16
17
|
}
|
|
@@ -19,9 +20,6 @@ export class InMemoryProcessStore {
|
|
|
19
20
|
return [...this.processes.values()].map(copyOf);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
function keyOf(name, id) {
|
|
23
|
-
return `${name}:${id}`;
|
|
24
|
-
}
|
|
25
23
|
function copyOf(process) {
|
|
26
24
|
const state = process.state === undefined ? null : JSON.parse(JSON.stringify(process.state));
|
|
27
25
|
return { ...process, state, timeouts: { ...process.timeouts } };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-process-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-process-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory-process-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-process-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,iIAAiI;AACjI,MAAM,OAAO,oBAAoB;IACd,SAAS,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE9D,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,EAAU;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QAE1D,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAsB;QAC/B,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,IAAI,CAAC,CAAC;QAEtD,IAAI,OAAO,CAAC,OAAO,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,gBAAgB,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,iEAAiE;IACjE,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;CACF;AAED,SAAS,MAAM,CAAC,OAAsB;IACpC,MAAM,KAAK,GAAY,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAEtG,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-processed-event-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-processed-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory-processed-event-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-processed-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAGzF,qBAAa,2BAA4B,YAAW,mBAAmB;IACrE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAEpC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUvE;IAEK,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;CACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { compositeKey } from './composite-key.js';
|
|
1
2
|
export class InMemoryProcessedEventStore {
|
|
2
3
|
seen = new Set();
|
|
3
4
|
async markProcessed(consumer, eventId) {
|
|
4
|
-
const key =
|
|
5
|
+
const key = compositeKey(consumer, eventId);
|
|
5
6
|
if (this.seen.has(key)) {
|
|
6
7
|
return false;
|
|
7
8
|
}
|
|
@@ -9,11 +10,7 @@ export class InMemoryProcessedEventStore {
|
|
|
9
10
|
return true;
|
|
10
11
|
}
|
|
11
12
|
async release(consumer, eventId) {
|
|
12
|
-
this.seen.delete(
|
|
13
|
+
this.seen.delete(compositeKey(consumer, eventId));
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
// JSON keeps the pair unambiguous: 'a:b' + 'c' must not equal 'a' + 'b:c'.
|
|
16
|
-
function keyOf(consumer, eventId) {
|
|
17
|
-
return JSON.stringify([consumer, eventId]);
|
|
18
|
-
}
|
|
19
16
|
//# sourceMappingURL=in-memory-processed-event-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-processed-event-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-processed-event-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"in-memory-processed-event-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-processed-event-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,OAAO,2BAA2B;IACrB,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1C,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,OAAe;QACnD,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAE5C,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEnB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB,EAAE,OAAe;QAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { UnitOfWork } from '../../application/ports/unit-of-work.js';
|
|
2
2
|
/**
|
|
3
|
-
* No transaction to open: runs the work as is, and nothing is undone when it fails
|
|
4
|
-
*
|
|
3
|
+
* No transaction to open: runs the work as is, and nothing is undone when it fails, the version
|
|
4
|
+
* of the aggregates it saved no more than what the fakes stored. The domain events are dispatched
|
|
5
|
+
* at its end all the same. Real adapters wrap a DB transaction.
|
|
5
6
|
*/
|
|
6
7
|
export declare class InMemoryUnitOfWork implements UnitOfWork {
|
|
8
|
+
private readonly unitOfWork;
|
|
7
9
|
run<T>(work: () => Promise<T>): Promise<T>;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=in-memory-unit-of-work.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAGvE
|
|
1
|
+
{"version":3,"file":"in-memory-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAGvE;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0D;IAErF,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEzC;CACF"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unitOfWorkOver } from '../domain-events/unit-of-work-over.js';
|
|
2
2
|
/**
|
|
3
|
-
* No transaction to open: runs the work as is, and nothing is undone when it fails
|
|
4
|
-
*
|
|
3
|
+
* No transaction to open: runs the work as is, and nothing is undone when it fails, the version
|
|
4
|
+
* of the aggregates it saved no more than what the fakes stored. The domain events are dispatched
|
|
5
|
+
* at its end all the same. Real adapters wrap a DB transaction.
|
|
5
6
|
*/
|
|
6
7
|
export class InMemoryUnitOfWork {
|
|
8
|
+
unitOfWork = unitOfWorkOver((work) => work(), { rollsBack: false });
|
|
7
9
|
run(work) {
|
|
8
|
-
return
|
|
10
|
+
return this.unitOfWork.run(work);
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=in-memory-unit-of-work.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-unit-of-work.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"in-memory-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-unit-of-work.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACZ,UAAU,GAAG,cAAc,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAErF,GAAG,CAAI,IAAsB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -20,6 +20,7 @@ export declare class InProcessBus {
|
|
|
20
20
|
*/
|
|
21
21
|
aroundHandler(middleware: BusMiddleware): this;
|
|
22
22
|
protected add(type: MessageType<Message>, handler: AnyHandler, registration?: HandlerRegistration): void;
|
|
23
|
+
/** Answers a promise whatever fails: a handler that throws before its first `await` rejects, as one that throws after it. */
|
|
23
24
|
protected dispatch<M extends Message>(message: M): Promise<ResultOf<M>>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=in-process-bus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process-bus.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-process-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAGhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,YAAY;IASX,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAE3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IAEvD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IAEnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAEtD,YAA6B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAI;IAE1D,GAAG,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAInC;IAED;;;;OAIG;IACH,aAAa,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,CAI7C;IAED,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,GAAE,mBAAwB,GAAG,I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-31,15 +31,16 @@ export class InProcessBus {
|
|
|
31
31
|
this.contexts.set(type, registration.context);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
/** Answers a promise whatever fails: a handler that throws before its first `await` rejects, as one that throws after it. */
|
|
35
|
+
async dispatch(message) {
|
|
35
36
|
const context = this.contexts.get(message.constructor);
|
|
36
37
|
const name = message.constructor.name;
|
|
37
38
|
const info = { kind: this.kind, name, ...(context === undefined ? {} : { context }) };
|
|
38
39
|
const handler = this.handlers.get(message.constructor);
|
|
39
40
|
if (!handler) {
|
|
40
|
-
|
|
41
|
+
throw new HandlerNotFoundError(info);
|
|
41
42
|
}
|
|
42
|
-
const run = [...this.middlewares, ...this.aroundHandlers].reduceRight((next, middleware) => () => middleware(message, next, info), () => handler.execute(message));
|
|
43
|
+
const run = [...this.middlewares, ...this.aroundHandlers].reduceRight((next, middleware) => () => middleware(message, next, info), async () => handler.execute(message));
|
|
43
44
|
// eslint-disable-next-line ddd-ts-kit/clean-no-escape-hatch -- handlers of every message type share one map and middlewares answer unknown: the link between a message and its result is only known to register()
|
|
44
45
|
return run();
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-process-bus.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-process-bus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAQ3F,MAAM,OAAO,YAAY;IASM,IAAI;IARhB,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE1C,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEtC,WAAW,GAAoB,EAAE,CAAC;IAElC,cAAc,GAAoB,EAAE,CAAC;IAEtD,YAA6B,IAAyB;oBAAzB,IAAI;IAAwB,CAAC;IAE1D,GAAG,CAAC,UAAyB;QAC3B,IAAI,CAAC,WAAW,CAAC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C,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,WAAW,CACnE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAC3D,KAAK,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CACrC,CAAC;QAEF,kNAAkN;QAClN,OAAO,GAAG,EAA0B,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BusMiddleware } from '../../application/messaging/bus-middleware.js';
|
|
2
|
+
import type { UnitOfWork } from '../../application/ports/unit-of-work.js';
|
|
2
3
|
/**
|
|
3
4
|
* Runs every command inside one unit of work. Queries are left alone: they do not write. The
|
|
4
5
|
* domain events its saves recorded are dispatched once the handler has returned, before the
|
|
5
|
-
* commit
|
|
6
|
-
*
|
|
6
|
+
* commit: the unit of work does it, the one every adapter builds on `unitOfWorkOver`, and one
|
|
7
|
+
* that does not is refused before the handler runs (`UnscopedUnitOfWorkError`). A command sent
|
|
8
|
+
* from inside a unit of work joins it.
|
|
7
9
|
*/
|
|
8
|
-
export declare function unitOfWorkMiddleware(unitOfWork:
|
|
9
|
-
run<T>(work: () => Promise<T>): Promise<T>;
|
|
10
|
-
}): BusMiddleware;
|
|
10
|
+
export declare function unitOfWorkMiddleware(unitOfWork: Pick<UnitOfWork, 'run'>): BusMiddleware;
|
|
11
11
|
//# sourceMappingURL=unit-of-work-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work-middleware.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/unit-of-work-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"unit-of-work-middleware.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/unit-of-work-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAIvE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,GAAG,aAAa,CAEvF"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unitOfWorkStage } from '../domain-events/unit-of-work-stage.js';
|
|
2
|
+
import { UnscopedUnitOfWorkError } from '../domain-events/unscoped-unit-of-work-error.js';
|
|
2
3
|
/**
|
|
3
4
|
* Runs every command inside one unit of work. Queries are left alone: they do not write. The
|
|
4
5
|
* domain events its saves recorded are dispatched once the handler has returned, before the
|
|
5
|
-
* commit
|
|
6
|
-
*
|
|
6
|
+
* commit: the unit of work does it, the one every adapter builds on `unitOfWorkOver`, and one
|
|
7
|
+
* that does not is refused before the handler runs (`UnscopedUnitOfWorkError`). A command sent
|
|
8
|
+
* from inside a unit of work joins it.
|
|
7
9
|
*/
|
|
8
10
|
export function unitOfWorkMiddleware(unitOfWork) {
|
|
9
|
-
return (_message, next, info) => info.kind === 'command' ?
|
|
11
|
+
return (_message, next, info) => (info.kind === 'command' ? unitOfWork.run(() => scoped(next)) : next());
|
|
12
|
+
}
|
|
13
|
+
async function scoped(next) {
|
|
14
|
+
const stage = unitOfWorkStage();
|
|
15
|
+
if (stage !== 'open' && stage !== 'before-commit') {
|
|
16
|
+
throw new UnscopedUnitOfWorkError();
|
|
17
|
+
}
|
|
18
|
+
return next();
|
|
10
19
|
}
|
|
11
20
|
//# sourceMappingURL=unit-of-work-middleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work-middleware.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/unit-of-work-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unit-of-work-middleware.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/unit-of-work-middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAmC;IACtE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3G,CAAC;AAED,KAAK,UAAU,MAAM,CAAI,IAAsB;IAC7C,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;QAClD,MAAM,IAAI,uBAAuB,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/kernel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.115.0",
|
|
4
4
|
"description": "Framework-agnostic Domain-Driven Design (DDD) building blocks for TypeScript: aggregates, entities, value objects, domain events, CQRS command and query buses, unit of work and application ports, with an in-memory event bus.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/
|
|
21
|
+
"url": "git+https://github.com/ddd-ts-kit/ddd-ts-kit.git",
|
|
22
22
|
"directory": "packages/kernel"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://
|
|
25
|
-
"bugs": "https://github.com/
|
|
24
|
+
"homepage": "https://ddd-ts-kit.github.io/ddd-ts-kit/packages/kernel/",
|
|
25
|
+
"bugs": "https://github.com/ddd-ts-kit/ddd-ts-kit/issues",
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public",
|
|
28
28
|
"provenance": true
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DomainEvent } from '../domain-event.js';
|
|
2
|
-
/**
|
|
3
|
-
* The events an event-sourced aggregate recorded since it was loaded or last stored, kept out of
|
|
4
|
-
* the aggregate so that nothing public exposes them: the aggregate adds, `appendChanges` hands
|
|
5
|
-
* them to the store and clears them.
|
|
6
|
-
*/
|
|
7
|
-
export declare const unstoredEvents: WeakMap<object, DomainEvent[]>;
|
|
8
|
-
//# sourceMappingURL=unstored-events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unstored-events.d.ts","sourceRoot":"","sources":["../../../src/domain/event-sourcing/unstored-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,gCAAuC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The events an event-sourced aggregate recorded since it was loaded or last stored, kept out of
|
|
3
|
-
* the aggregate so that nothing public exposes them: the aggregate adds, `appendChanges` hands
|
|
4
|
-
* them to the store and clears them.
|
|
5
|
-
*/
|
|
6
|
-
export const unstoredEvents = new WeakMap();
|
|
7
|
-
//# sourceMappingURL=unstored-events.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unstored-events.js","sourceRoot":"","sources":["../../../src/domain/event-sourcing/unstored-events.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,OAAO,EAAyB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Immutable, compared by value, valid at construction. Subclass with a private constructor and
|
|
3
|
-
* a `create` factory that validates, then returns the value object or throws the refusal of its
|
|
4
|
-
* concept (or returns a `Result`, in a project that says `"stack.valueObjects": "result"`).
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class ValueObject<Props extends Record<string, unknown>> {
|
|
7
|
-
protected readonly props: Readonly<Props>;
|
|
8
|
-
protected constructor(props: Props);
|
|
9
|
-
equals(other: ValueObject<Props> | undefined | null): boolean;
|
|
10
|
-
toJSON(): Props;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=value-object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value-object.d.ts","sourceRoot":"","sources":["../../src/domain/value-object.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,8BAAsB,WAAW,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1C,SAAS,aAAa,KAAK,EAAE,KAAK,EAEjC;IAED,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAM5D;IAED,MAAM,IAAI,KAAK,CAEd;CACF"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Immutable, compared by value, valid at construction. Subclass with a private constructor and
|
|
3
|
-
* a `create` factory that validates, then returns the value object or throws the refusal of its
|
|
4
|
-
* concept (or returns a `Result`, in a project that says `"stack.valueObjects": "result"`).
|
|
5
|
-
*/
|
|
6
|
-
export class ValueObject {
|
|
7
|
-
props;
|
|
8
|
-
constructor(props) {
|
|
9
|
-
this.props = Object.freeze({ ...props });
|
|
10
|
-
}
|
|
11
|
-
equals(other) {
|
|
12
|
-
if (other === undefined || other === null || other.constructor !== this.constructor) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return structurallyEqual(this.props, other.props);
|
|
16
|
-
}
|
|
17
|
-
toJSON() {
|
|
18
|
-
return this.props;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function structurallyEqual(a, b) {
|
|
22
|
-
if (Object.is(a, b)) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
if (a instanceof Date && b instanceof Date) {
|
|
26
|
-
return a.getTime() === b.getTime();
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(a) && Array.isArray(b)) {
|
|
29
|
-
return a.length === b.length && a.every((item, i) => structurallyEqual(item, b[i]));
|
|
30
|
-
}
|
|
31
|
-
if (isRecord(a) && isRecord(b)) {
|
|
32
|
-
const keys = Object.keys(a);
|
|
33
|
-
return keys.length === Object.keys(b).length && keys.every((key) => key in b && structurallyEqual(a[key], b[key]));
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
function isRecord(value) {
|
|
38
|
-
return typeof value === 'object' && value !== null;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=value-object.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"value-object.js","sourceRoot":"","sources":["../../src/domain/value-object.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAgB,WAAW;IACZ,KAAK,CAAkB;IAE1C,YAAsB,KAAY;QAChC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,KAA4C;QACjD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,EAAE,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