@ddd-ts-kit/kernel 0.8.0 → 0.10.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 +207 -2
- package/dist/application/criteria/index.d.ts +33 -0
- package/dist/application/criteria/index.d.ts.map +1 -0
- package/dist/application/criteria/index.js +33 -0
- package/dist/application/criteria/index.js.map +1 -0
- package/dist/application/event-sourcing/appended.d.ts +8 -0
- package/dist/application/event-sourcing/appended.d.ts.map +1 -0
- package/dist/application/event-sourcing/appended.js +2 -0
- package/dist/application/event-sourcing/appended.js.map +1 -0
- package/dist/application/event-sourcing/define-stored-event.d.ts +10 -0
- package/dist/application/event-sourcing/define-stored-event.d.ts.map +1 -0
- package/dist/application/event-sourcing/define-stored-event.js +22 -0
- package/dist/application/event-sourcing/define-stored-event.js.map +1 -0
- package/dist/application/event-sourcing/erased-personal-data.d.ts +3 -0
- package/dist/application/event-sourcing/erased-personal-data.d.ts.map +1 -0
- package/dist/application/event-sourcing/erased-personal-data.js +3 -0
- package/dist/application/event-sourcing/erased-personal-data.js.map +1 -0
- package/dist/application/event-sourcing/event-envelope.d.ts +9 -0
- package/dist/application/event-sourcing/event-envelope.d.ts.map +1 -0
- package/dist/application/event-sourcing/event-envelope.js +2 -0
- package/dist/application/event-sourcing/event-envelope.js.map +1 -0
- package/dist/application/event-sourcing/event-to-append.d.ts +15 -0
- package/dist/application/event-sourcing/event-to-append.d.ts.map +1 -0
- package/dist/application/event-sourcing/event-to-append.js +2 -0
- package/dist/application/event-sourcing/event-to-append.js.map +1 -0
- package/dist/application/event-sourcing/index.d.ts +21 -0
- package/dist/application/event-sourcing/index.d.ts.map +1 -0
- package/dist/application/event-sourcing/index.js +21 -0
- package/dist/application/event-sourcing/index.js.map +1 -0
- package/dist/application/event-sourcing/is-stored-data.d.ts +5 -0
- package/dist/application/event-sourcing/is-stored-data.d.ts.map +1 -0
- package/dist/application/event-sourcing/is-stored-data.js +5 -0
- package/dist/application/event-sourcing/is-stored-data.js.map +1 -0
- package/dist/application/event-sourcing/is-stored-list.d.ts +4 -0
- package/dist/application/event-sourcing/is-stored-list.d.ts.map +1 -0
- package/dist/application/event-sourcing/is-stored-list.js +5 -0
- package/dist/application/event-sourcing/is-stored-list.js.map +1 -0
- package/dist/application/event-sourcing/personal-data.d.ts +14 -0
- package/dist/application/event-sourcing/personal-data.d.ts.map +1 -0
- package/dist/application/event-sourcing/personal-data.js +9 -0
- package/dist/application/event-sourcing/personal-data.js.map +1 -0
- package/dist/application/event-sourcing/stored-data-of.d.ts +9 -0
- package/dist/application/event-sourcing/stored-data-of.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-data-of.js +40 -0
- package/dist/application/event-sourcing/stored-data-of.js.map +1 -0
- package/dist/application/event-sourcing/stored-data.d.ts +6 -0
- package/dist/application/event-sourcing/stored-data.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-data.js +2 -0
- package/dist/application/event-sourcing/stored-data.js.map +1 -0
- package/dist/application/event-sourcing/stored-event-data.d.ts +25 -0
- package/dist/application/event-sourcing/stored-event-data.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-event-data.js +82 -0
- package/dist/application/event-sourcing/stored-event-data.js.map +1 -0
- package/dist/application/event-sourcing/stored-event-spec.d.ts +20 -0
- package/dist/application/event-sourcing/stored-event-spec.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-event-spec.js +2 -0
- package/dist/application/event-sourcing/stored-event-spec.js.map +1 -0
- package/dist/application/event-sourcing/stored-event-type.d.ts +14 -0
- package/dist/application/event-sourcing/stored-event-type.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-event-type.js +2 -0
- package/dist/application/event-sourcing/stored-event-type.js.map +1 -0
- package/dist/application/event-sourcing/stored-event-types.d.ts +9 -0
- package/dist/application/event-sourcing/stored-event-types.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-event-types.js +2 -0
- package/dist/application/event-sourcing/stored-event-types.js.map +1 -0
- package/dist/application/event-sourcing/stored-event.d.ts +12 -0
- package/dist/application/event-sourcing/stored-event.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-event.js +2 -0
- package/dist/application/event-sourcing/stored-event.js.map +1 -0
- package/dist/application/event-sourcing/stored-json.d.ts +5 -0
- package/dist/application/event-sourcing/stored-json.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-json.js +2 -0
- package/dist/application/event-sourcing/stored-json.js.map +1 -0
- package/dist/application/event-sourcing/stored-snapshot.d.ts +11 -0
- package/dist/application/event-sourcing/stored-snapshot.d.ts.map +1 -0
- package/dist/application/event-sourcing/stored-snapshot.js +2 -0
- package/dist/application/event-sourcing/stored-snapshot.js.map +1 -0
- package/dist/application/event-sourcing/subject-key.d.ts +10 -0
- package/dist/application/event-sourcing/subject-key.d.ts.map +1 -0
- package/dist/application/event-sourcing/subject-key.js +2 -0
- package/dist/application/event-sourcing/subject-key.js.map +1 -0
- package/dist/application/event-sourcing/unreadable-event-error.d.ts +5 -0
- package/dist/application/event-sourcing/unreadable-event-error.d.ts.map +1 -0
- package/dist/application/event-sourcing/unreadable-event-error.js +8 -0
- package/dist/application/event-sourcing/unreadable-event-error.js.map +1 -0
- package/dist/application/event-sourcing/upcaster.d.ts +4 -0
- package/dist/application/event-sourcing/upcaster.d.ts.map +1 -0
- package/dist/application/event-sourcing/upcaster.js +2 -0
- package/dist/application/event-sourcing/upcaster.js.map +1 -0
- package/dist/application/files/accepts-media-type.d.ts +3 -0
- package/dist/application/files/accepts-media-type.d.ts.map +1 -0
- package/dist/application/files/accepts-media-type.js +11 -0
- package/dist/application/files/accepts-media-type.js.map +1 -0
- package/dist/application/files/assert-expiry.d.ts +3 -0
- package/dist/application/files/assert-expiry.d.ts.map +1 -0
- package/dist/application/files/assert-expiry.js +10 -0
- package/dist/application/files/assert-expiry.js.map +1 -0
- package/dist/application/files/assert-file-key.d.ts +3 -0
- package/dist/application/files/assert-file-key.d.ts.map +1 -0
- package/dist/application/files/assert-file-key.js +10 -0
- package/dist/application/files/assert-file-key.js.map +1 -0
- package/dist/application/files/assert-final-key.d.ts +3 -0
- package/dist/application/files/assert-final-key.d.ts.map +1 -0
- package/dist/application/files/assert-final-key.js +11 -0
- package/dist/application/files/assert-final-key.js.map +1 -0
- package/dist/application/files/content-disposition.d.ts +3 -0
- package/dist/application/files/content-disposition.d.ts.map +1 -0
- package/dist/application/files/content-disposition.js +9 -0
- package/dist/application/files/content-disposition.js.map +1 -0
- package/dist/application/files/content-expectation.d.ts +6 -0
- package/dist/application/files/content-expectation.d.ts.map +1 -0
- package/dist/application/files/content-expectation.js +2 -0
- package/dist/application/files/content-expectation.js.map +1 -0
- package/dist/application/files/content-matches.d.ts +7 -0
- package/dist/application/files/content-matches.d.ts.map +1 -0
- package/dist/application/files/content-matches.js +39 -0
- package/dist/application/files/content-matches.js.map +1 -0
- package/dist/application/files/download-url-options.d.ts +7 -0
- package/dist/application/files/download-url-options.d.ts.map +1 -0
- package/dist/application/files/download-url-options.js +2 -0
- package/dist/application/files/download-url-options.js.map +1 -0
- package/dist/application/files/file-content.d.ts +8 -0
- package/dist/application/files/file-content.d.ts.map +1 -0
- package/dist/application/files/file-content.js +2 -0
- package/dist/application/files/file-content.js.map +1 -0
- package/dist/application/files/file-error.d.ts +28 -0
- package/dist/application/files/file-error.d.ts.map +1 -0
- package/dist/application/files/file-error.js +29 -0
- package/dist/application/files/file-error.js.map +1 -0
- package/dist/application/files/file-metadata.d.ts +10 -0
- package/dist/application/files/file-metadata.d.ts.map +1 -0
- package/dist/application/files/file-metadata.js +2 -0
- package/dist/application/files/file-metadata.js.map +1 -0
- package/dist/application/files/file-source.d.ts +4 -0
- package/dist/application/files/file-source.d.ts.map +1 -0
- package/dist/application/files/file-source.js +2 -0
- package/dist/application/files/file-source.js.map +1 -0
- package/dist/application/files/file-upload.d.ts +25 -0
- package/dist/application/files/file-upload.d.ts.map +1 -0
- package/dist/application/files/file-upload.js +36 -0
- package/dist/application/files/file-upload.js.map +1 -0
- package/dist/application/files/index.d.ts +31 -0
- package/dist/application/files/index.d.ts.map +1 -0
- package/dist/application/files/index.js +31 -0
- package/dist/application/files/index.js.map +1 -0
- package/dist/application/files/inspection-limits.d.ts +8 -0
- package/dist/application/files/inspection-limits.d.ts.map +1 -0
- package/dist/application/files/inspection-limits.js +2 -0
- package/dist/application/files/inspection-limits.js.map +1 -0
- package/dist/application/files/is-file-key.d.ts +7 -0
- package/dist/application/files/is-file-key.d.ts.map +1 -0
- package/dist/application/files/is-file-key.js +11 -0
- package/dist/application/files/is-file-key.js.map +1 -0
- package/dist/application/files/listed-file.d.ts +7 -0
- package/dist/application/files/listed-file.d.ts.map +1 -0
- package/dist/application/files/listed-file.js +2 -0
- package/dist/application/files/listed-file.js.map +1 -0
- package/dist/application/files/max-signed-url-seconds.d.ts +3 -0
- package/dist/application/files/max-signed-url-seconds.d.ts.map +1 -0
- package/dist/application/files/max-signed-url-seconds.js +3 -0
- package/dist/application/files/max-signed-url-seconds.js.map +1 -0
- package/dist/application/files/media-type-of.d.ts +3 -0
- package/dist/application/files/media-type-of.d.ts.map +1 -0
- package/dist/application/files/media-type-of.js +5 -0
- package/dist/application/files/media-type-of.js.map +1 -0
- package/dist/application/files/pending-upload-link.d.ts +10 -0
- package/dist/application/files/pending-upload-link.d.ts.map +1 -0
- package/dist/application/files/pending-upload-link.js +2 -0
- package/dist/application/files/pending-upload-link.js.map +1 -0
- package/dist/application/files/pending-upload.d.ts +15 -0
- package/dist/application/files/pending-upload.d.ts.map +1 -0
- package/dist/application/files/pending-upload.js +2 -0
- package/dist/application/files/pending-upload.js.map +1 -0
- package/dist/application/files/put-options.d.ts +7 -0
- package/dist/application/files/put-options.d.ts.map +1 -0
- package/dist/application/files/put-options.js +2 -0
- package/dist/application/files/put-options.js.map +1 -0
- package/dist/application/files/received-file.d.ts +15 -0
- package/dist/application/files/received-file.d.ts.map +1 -0
- package/dist/application/files/received-file.js +2 -0
- package/dist/application/files/received-file.js.map +1 -0
- package/dist/application/files/scan-verdict.d.ts +8 -0
- package/dist/application/files/scan-verdict.d.ts.map +1 -0
- package/dist/application/files/scan-verdict.js +2 -0
- package/dist/application/files/scan-verdict.js.map +1 -0
- package/dist/application/files/signature-of.d.ts +3 -0
- package/dist/application/files/signature-of.d.ts.map +1 -0
- package/dist/application/files/signature-of.js +28 -0
- package/dist/application/files/signature-of.js.map +1 -0
- package/dist/application/files/signed-download.d.ts +6 -0
- package/dist/application/files/signed-download.d.ts.map +1 -0
- package/dist/application/files/signed-download.js +2 -0
- package/dist/application/files/signed-download.js.map +1 -0
- package/dist/application/files/signed-upload.d.ts +9 -0
- package/dist/application/files/signed-upload.d.ts.map +1 -0
- package/dist/application/files/signed-upload.js +2 -0
- package/dist/application/files/signed-upload.js.map +1 -0
- package/dist/application/files/signed-url.d.ts +6 -0
- package/dist/application/files/signed-url.d.ts.map +1 -0
- package/dist/application/files/signed-url.js +2 -0
- package/dist/application/files/signed-url.js.map +1 -0
- package/dist/application/files/staged-key-of.d.ts +5 -0
- package/dist/application/files/staged-key-of.d.ts.map +1 -0
- package/dist/application/files/staged-key-of.js +7 -0
- package/dist/application/files/staged-key-of.js.map +1 -0
- package/dist/application/files/stored-file.d.ts +16 -0
- package/dist/application/files/stored-file.d.ts.map +1 -0
- package/dist/application/files/stored-file.js +2 -0
- package/dist/application/files/stored-file.js.map +1 -0
- package/dist/application/files/upload-url-options.d.ts +12 -0
- package/dist/application/files/upload-url-options.d.ts.map +1 -0
- package/dist/application/files/upload-url-options.js +2 -0
- package/dist/application/files/upload-url-options.js.map +1 -0
- package/dist/application/persistence/append-changes.d.ts +18 -0
- package/dist/application/persistence/append-changes.d.ts.map +1 -0
- package/dist/application/persistence/append-changes.js +17 -0
- package/dist/application/persistence/append-changes.js.map +1 -0
- package/dist/application/ports/checkpoint-store.d.ts +14 -0
- package/dist/application/ports/checkpoint-store.d.ts.map +1 -0
- package/dist/application/ports/checkpoint-store.js +10 -0
- package/dist/application/ports/checkpoint-store.js.map +1 -0
- package/dist/application/ports/event-store.d.ts +24 -0
- package/dist/application/ports/event-store.d.ts.map +1 -0
- package/dist/application/ports/event-store.js +12 -0
- package/dist/application/ports/event-store.js.map +1 -0
- package/dist/application/ports/file-keys.d.ts +9 -0
- package/dist/application/ports/file-keys.d.ts.map +1 -0
- package/dist/application/ports/file-keys.js +10 -0
- package/dist/application/ports/file-keys.js.map +1 -0
- package/dist/application/ports/file-scanner.d.ts +13 -0
- package/dist/application/ports/file-scanner.d.ts.map +1 -0
- package/dist/application/ports/file-scanner.js +12 -0
- package/dist/application/ports/file-scanner.js.map +1 -0
- package/dist/application/ports/file-storage.d.ts +40 -0
- package/dist/application/ports/file-storage.d.ts.map +1 -0
- package/dist/application/ports/file-storage.js +15 -0
- package/dist/application/ports/file-storage.js.map +1 -0
- package/dist/application/ports/served-file-storage.d.ts +16 -0
- package/dist/application/ports/served-file-storage.d.ts.map +1 -0
- package/dist/application/ports/served-file-storage.js +12 -0
- package/dist/application/ports/served-file-storage.js.map +1 -0
- package/dist/application/ports/snapshot-store.d.ts +8 -0
- package/dist/application/ports/snapshot-store.d.ts.map +1 -0
- package/dist/application/ports/snapshot-store.js +7 -0
- package/dist/application/ports/snapshot-store.js.map +1 -0
- package/dist/application/ports/subject-key-store.d.ts +17 -0
- package/dist/application/ports/subject-key-store.d.ts.map +1 -0
- package/dist/application/ports/subject-key-store.js +13 -0
- package/dist/application/ports/subject-key-store.js.map +1 -0
- package/dist/declarations/decorators/projection-options.d.ts +5 -0
- package/dist/declarations/decorators/projection-options.d.ts.map +1 -0
- package/dist/declarations/decorators/projection-options.js +2 -0
- package/dist/declarations/decorators/projection-options.js.map +1 -0
- package/dist/declarations/decorators/projection.d.ts +4 -0
- package/dist/declarations/decorators/projection.d.ts.map +1 -1
- package/dist/declarations/decorators/projection.js +16 -8
- package/dist/declarations/decorators/projection.js.map +1 -1
- package/dist/declarations/model/projection-declaration.d.ts +3 -0
- package/dist/declarations/model/projection-declaration.d.ts.map +1 -1
- package/dist/declarations/model/projection-feed.d.ts +8 -0
- package/dist/declarations/model/projection-feed.d.ts.map +1 -0
- package/dist/declarations/model/projection-feed.js +2 -0
- package/dist/declarations/model/projection-feed.js.map +1 -0
- package/dist/declarations/projection/applying-projection.d.ts +14 -0
- package/dist/declarations/projection/applying-projection.d.ts.map +1 -0
- package/dist/declarations/projection/applying-projection.js +32 -0
- package/dist/declarations/projection/applying-projection.js.map +1 -0
- package/dist/declarations.d.ts +3 -0
- package/dist/declarations.d.ts.map +1 -1
- package/dist/declarations.js +1 -0
- package/dist/declarations.js.map +1 -1
- package/dist/domain/event-sourcing/aggregate-history.d.ts +10 -0
- package/dist/domain/event-sourcing/aggregate-history.d.ts.map +1 -0
- package/dist/domain/event-sourcing/aggregate-history.js +2 -0
- package/dist/domain/event-sourcing/aggregate-history.js.map +1 -0
- package/dist/domain/event-sourcing/aggregate-snapshot.d.ts +6 -0
- package/dist/domain/event-sourcing/aggregate-snapshot.d.ts.map +1 -0
- package/dist/domain/event-sourcing/aggregate-snapshot.js +2 -0
- package/dist/domain/event-sourcing/aggregate-snapshot.js.map +1 -0
- package/dist/domain/event-sourcing/appliers.d.ts +12 -0
- package/dist/domain/event-sourcing/appliers.d.ts.map +1 -0
- package/dist/domain/event-sourcing/appliers.js +2 -0
- package/dist/domain/event-sourcing/appliers.js.map +1 -0
- package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts +28 -0
- package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts.map +1 -0
- package/dist/domain/event-sourcing/event-sourced-aggregate.js +51 -0
- package/dist/domain/event-sourcing/event-sourced-aggregate.js.map +1 -0
- package/dist/domain/event-sourcing/unstored-events.d.ts +8 -0
- package/dist/domain/event-sourcing/unstored-events.d.ts.map +1 -0
- package/dist/domain/event-sourcing/unstored-events.js +7 -0
- package/dist/domain/event-sourcing/unstored-events.js.map +1 -0
- package/dist/index.d.ts +52 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -32
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/domain-events/after-commit.d.ts +10 -0
- package/dist/infrastructure/domain-events/after-commit.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/after-commit.js +19 -0
- package/dist/infrastructure/domain-events/after-commit.js.map +1 -0
- package/dist/infrastructure/domain-events/at-commit.d.ts +11 -0
- package/dist/infrastructure/domain-events/at-commit.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/at-commit.js +19 -0
- package/dist/infrastructure/domain-events/at-commit.js.map +1 -0
- package/dist/infrastructure/domain-events/commit-step.d.ts +10 -0
- package/dist/infrastructure/domain-events/commit-step.d.ts.map +1 -0
- package/dist/infrastructure/domain-events/commit-step.js +2 -0
- package/dist/infrastructure/domain-events/commit-step.js.map +1 -0
- package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts +5 -0
- 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/within-unit-of-work.d.ts +3 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.d.ts.map +1 -1
- package/dist/infrastructure/domain-events/within-unit-of-work.js +32 -5
- package/dist/infrastructure/domain-events/within-unit-of-work.js.map +1 -1
- package/dist/infrastructure/event-sourcing/catch-up-subscription.d.ts +33 -0
- package/dist/infrastructure/event-sourcing/catch-up-subscription.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/catch-up-subscription.js +39 -0
- package/dist/infrastructure/event-sourcing/catch-up-subscription.js.map +1 -0
- package/dist/infrastructure/event-sourcing/event-serializer.d.ts +35 -0
- package/dist/infrastructure/event-sourcing/event-serializer.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/event-serializer.js +104 -0
- package/dist/infrastructure/event-sourcing/event-serializer.js.map +1 -0
- package/dist/infrastructure/event-sourcing/event-sourced-repository.d.ts +32 -0
- package/dist/infrastructure/event-sourcing/event-sourced-repository.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/event-sourced-repository.js +68 -0
- package/dist/infrastructure/event-sourcing/event-sourced-repository.js.map +1 -0
- package/dist/infrastructure/event-sourcing/event-sourcing-stores.d.ts +12 -0
- package/dist/infrastructure/event-sourcing/event-sourcing-stores.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/event-sourcing-stores.js +2 -0
- package/dist/infrastructure/event-sourcing/event-sourcing-stores.js.map +1 -0
- package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.d.ts +34 -0
- package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.js +48 -0
- package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.js.map +1 -0
- package/dist/infrastructure/event-sourcing/personal-data-cipher.d.ts +19 -0
- package/dist/infrastructure/event-sourcing/personal-data-cipher.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/personal-data-cipher.js +84 -0
- package/dist/infrastructure/event-sourcing/personal-data-cipher.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.d.ts +6 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.js +2 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.d.ts +9 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.js +32 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables.d.ts +9 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables.js +9 -0
- package/dist/infrastructure/event-sourcing/postgres/event-store-tables.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts +3 -0
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js +22 -0
- package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.d.ts +12 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.js +26 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.d.ts +6 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.js +14 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts +31 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js +120 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.d.ts +13 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.js +28 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.d.ts +21 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.js +48 -0
- package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/qualified-table.d.ts +4 -0
- package/dist/infrastructure/event-sourcing/postgres/qualified-table.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/qualified-table.js +10 -0
- package/dist/infrastructure/event-sourcing/postgres/qualified-table.js.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/stored-data-from.d.ts +4 -0
- package/dist/infrastructure/event-sourcing/postgres/stored-data-from.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/postgres/stored-data-from.js +23 -0
- package/dist/infrastructure/event-sourcing/postgres/stored-data-from.js.map +1 -0
- package/dist/infrastructure/event-sourcing/rewrite-objects.d.ts +8 -0
- package/dist/infrastructure/event-sourcing/rewrite-objects.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/rewrite-objects.js +16 -0
- package/dist/infrastructure/event-sourcing/rewrite-objects.js.map +1 -0
- package/dist/infrastructure/event-sourcing/snapshot-policy.d.ts +14 -0
- package/dist/infrastructure/event-sourcing/snapshot-policy.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/snapshot-policy.js +2 -0
- package/dist/infrastructure/event-sourcing/snapshot-policy.js.map +1 -0
- package/dist/infrastructure/event-sourcing/stored-origins.d.ts +5 -0
- package/dist/infrastructure/event-sourcing/stored-origins.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/stored-origins.js +3 -0
- package/dist/infrastructure/event-sourcing/stored-origins.js.map +1 -0
- package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts +10 -0
- package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts.map +1 -0
- package/dist/infrastructure/event-sourcing/stored-stamp-of.js +14 -0
- package/dist/infrastructure/event-sourcing/stored-stamp-of.js.map +1 -0
- package/dist/infrastructure/files/accept-every-file-scanner.d.ts +7 -0
- package/dist/infrastructure/files/accept-every-file-scanner.d.ts.map +1 -0
- package/dist/infrastructure/files/accept-every-file-scanner.js +7 -0
- package/dist/infrastructure/files/accept-every-file-scanner.js.map +1 -0
- package/dist/infrastructure/files/collect.d.ts +4 -0
- package/dist/infrastructure/files/collect.d.ts.map +1 -0
- package/dist/infrastructure/files/collect.js +11 -0
- package/dist/infrastructure/files/collect.js.map +1 -0
- package/dist/infrastructure/files/file-grant.d.ts +11 -0
- package/dist/infrastructure/files/file-grant.d.ts.map +1 -0
- package/dist/infrastructure/files/file-grant.js +2 -0
- package/dist/infrastructure/files/file-grant.js.map +1 -0
- package/dist/infrastructure/files/file-inspection.d.ts +22 -0
- package/dist/infrastructure/files/file-inspection.d.ts.map +1 -0
- package/dist/infrastructure/files/file-inspection.js +66 -0
- package/dist/infrastructure/files/file-inspection.js.map +1 -0
- package/dist/infrastructure/files/file-staging.d.ts +59 -0
- package/dist/infrastructure/files/file-staging.d.ts.map +1 -0
- package/dist/infrastructure/files/file-staging.js +142 -0
- package/dist/infrastructure/files/file-staging.js.map +1 -0
- package/dist/infrastructure/files/file-uploads-middleware.d.ts +11 -0
- package/dist/infrastructure/files/file-uploads-middleware.d.ts.map +1 -0
- package/dist/infrastructure/files/file-uploads-middleware.js +25 -0
- package/dist/infrastructure/files/file-uploads-middleware.js.map +1 -0
- package/dist/infrastructure/files/in-memory-file-storage.d.ts +25 -0
- package/dist/infrastructure/files/in-memory-file-storage.d.ts.map +1 -0
- package/dist/infrastructure/files/in-memory-file-storage.js +73 -0
- package/dist/infrastructure/files/in-memory-file-storage.js.map +1 -0
- package/dist/infrastructure/files/is-file-grant.d.ts +3 -0
- package/dist/infrastructure/files/is-file-grant.d.ts.map +1 -0
- package/dist/infrastructure/files/is-file-grant.js +16 -0
- package/dist/infrastructure/files/is-file-grant.js.map +1 -0
- package/dist/infrastructure/files/is-stored-metadata.d.ts +3 -0
- package/dist/infrastructure/files/is-stored-metadata.d.ts.map +1 -0
- package/dist/infrastructure/files/is-stored-metadata.js +8 -0
- package/dist/infrastructure/files/is-stored-metadata.js.map +1 -0
- package/dist/infrastructure/files/local-file-storage-options.d.ts +6 -0
- package/dist/infrastructure/files/local-file-storage-options.d.ts.map +1 -0
- package/dist/infrastructure/files/local-file-storage-options.js +2 -0
- package/dist/infrastructure/files/local-file-storage-options.js.map +1 -0
- package/dist/infrastructure/files/local-file-storage.d.ts +29 -0
- package/dist/infrastructure/files/local-file-storage.d.ts.map +1 -0
- package/dist/infrastructure/files/local-file-storage.js +103 -0
- package/dist/infrastructure/files/local-file-storage.js.map +1 -0
- package/dist/infrastructure/files/local-paths.d.ts +12 -0
- package/dist/infrastructure/files/local-paths.d.ts.map +1 -0
- package/dist/infrastructure/files/local-paths.js +33 -0
- package/dist/infrastructure/files/local-paths.js.map +1 -0
- package/dist/infrastructure/files/purge-staged-files.d.ts +16 -0
- package/dist/infrastructure/files/purge-staged-files.d.ts.map +1 -0
- package/dist/infrastructure/files/purge-staged-files.js +21 -0
- package/dist/infrastructure/files/purge-staged-files.js.map +1 -0
- package/dist/infrastructure/files/self-signed-file-storage.d.ts +23 -0
- package/dist/infrastructure/files/self-signed-file-storage.d.ts.map +1 -0
- package/dist/infrastructure/files/self-signed-file-storage.js +57 -0
- package/dist/infrastructure/files/self-signed-file-storage.js.map +1 -0
- package/dist/infrastructure/files/signed-file-tokens.d.ts +20 -0
- package/dist/infrastructure/files/signed-file-tokens.d.ts.map +1 -0
- package/dist/infrastructure/files/signed-file-tokens.js +45 -0
- package/dist/infrastructure/files/signed-file-tokens.js.map +1 -0
- package/dist/infrastructure/files/signed-link-options.d.ts +10 -0
- package/dist/infrastructure/files/signed-link-options.d.ts.map +1 -0
- package/dist/infrastructure/files/signed-link-options.js +2 -0
- package/dist/infrastructure/files/signed-link-options.js.map +1 -0
- package/dist/infrastructure/files/stored-metadata.d.ts +6 -0
- package/dist/infrastructure/files/stored-metadata.d.ts.map +1 -0
- package/dist/infrastructure/files/stored-metadata.js +2 -0
- package/dist/infrastructure/files/stored-metadata.js.map +1 -0
- package/dist/infrastructure/files/tenant-file-keys.d.ts +20 -0
- package/dist/infrastructure/files/tenant-file-keys.d.ts.map +1 -0
- package/dist/infrastructure/files/tenant-file-keys.js +27 -0
- package/dist/infrastructure/files/tenant-file-keys.js.map +1 -0
- package/dist/infrastructure/files/upload-desk.d.ts +8 -0
- package/dist/infrastructure/files/upload-desk.d.ts.map +1 -0
- package/dist/infrastructure/files/upload-desk.js +2 -0
- package/dist/infrastructure/files/upload-desk.js.map +1 -0
- package/dist/infrastructure/files/without-trailing-slashes.d.ts +3 -0
- package/dist/infrastructure/files/without-trailing-slashes.d.ts.map +1 -0
- package/dist/infrastructure/files/without-trailing-slashes.js +9 -0
- package/dist/infrastructure/files/without-trailing-slashes.js.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-checkpoint-store.d.ts +8 -0
- package/dist/infrastructure/in-memory/in-memory-checkpoint-store.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-checkpoint-store.js +15 -0
- package/dist/infrastructure/in-memory/in-memory-checkpoint-store.js.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-event-store.d.ts +14 -0
- package/dist/infrastructure/in-memory/in-memory-event-store.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-event-store.js +37 -0
- package/dist/infrastructure/in-memory/in-memory-event-store.js.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-snapshot-store.d.ts +9 -0
- package/dist/infrastructure/in-memory/in-memory-snapshot-store.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-snapshot-store.js +15 -0
- package/dist/infrastructure/in-memory/in-memory-snapshot-store.js.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-subject-key-store.d.ts +10 -0
- package/dist/infrastructure/in-memory/in-memory-subject-key-store.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-subject-key-store.js +21 -0
- package/dist/infrastructure/in-memory/in-memory-subject-key-store.js.map +1 -0
- package/dist/infrastructure/read-model/shadow-read-model-store.d.ts +20 -0
- package/dist/infrastructure/read-model/shadow-read-model-store.d.ts.map +1 -0
- package/dist/infrastructure/read-model/shadow-read-model-store.js +25 -0
- package/dist/infrastructure/read-model/shadow-read-model-store.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,24 +2,32 @@ import { isJobName } from '../../application/scheduling/is-job-name.js';
|
|
|
2
2
|
import { DeclarationError } from '../registry/declaration-error.js';
|
|
3
3
|
import { record } from '../registry/record.js';
|
|
4
4
|
import { pendingApplications } from './pending-applications.js';
|
|
5
|
-
|
|
6
|
-
* A projector: the class that keeps one read model up to date, each of its `@On` methods
|
|
7
|
-
* applying one event through a port of its own read model:
|
|
8
|
-
* `@Projection('scheduling.appointment-list')`. The name is the consumer
|
|
9
|
-
* it is subscribed as: stable, `<context>.<name>`, unique in the application.
|
|
10
|
-
*/
|
|
11
|
-
export function Projection(name, dependencies) {
|
|
5
|
+
export function Projection(name, second, third) {
|
|
12
6
|
if (!isJobName(name)) {
|
|
13
7
|
throw new DeclarationError(`"${name}" is not a projection name: write <context>.<name> in lower case, words separated by dashes, as in 'scheduling.appointment-list'.`);
|
|
14
8
|
}
|
|
9
|
+
const options = isOptions(second) ? second : undefined;
|
|
10
|
+
const dependencies = isOptions(second) ? third : second;
|
|
11
|
+
const feed = options?.feed ?? 'dispatch';
|
|
15
12
|
return (target) => {
|
|
16
13
|
const applies = claimed(target);
|
|
17
14
|
if (applies.length === 0) {
|
|
18
15
|
throw new DeclarationError(`Projection ${target.name} applies no event: write @On(...) on the methods that do.`);
|
|
19
16
|
}
|
|
20
|
-
|
|
17
|
+
assertFedBy(feed, target, applies);
|
|
18
|
+
record(target, { role: 'projection', name, implementation: target, dependencies, feed, applies });
|
|
21
19
|
};
|
|
22
20
|
}
|
|
21
|
+
function isOptions(value) {
|
|
22
|
+
return typeof value === 'object' && 'feed' in value;
|
|
23
|
+
}
|
|
24
|
+
/** A projection fed by the event store applies the domain events of its context, nothing else. */
|
|
25
|
+
function assertFedBy(feed, target, applies) {
|
|
26
|
+
const integration = applies.find((application) => application.kind === 'integration');
|
|
27
|
+
if (feed === 'event-store' && integration !== undefined) {
|
|
28
|
+
throw new DeclarationError(`Projection ${target.name} is fed by the event store and applies the integration event of its method "${integration.method}": an integration event reaches a projection fed where it is consumed.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
23
31
|
/** The `@On` of the methods of the class: they ran just before its `@Projection`. */
|
|
24
32
|
function claimed(target) {
|
|
25
33
|
const pending = pendingApplications().splice(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../../src/declarations/decorators/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../../src/declarations/decorators/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAOxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAqBhE,MAAM,UAAU,UAAU,CACxB,IAA2B,EAC3B,MAAiD,EACjD,KAA4B;IAE5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,gBAAgB,CACxB,IAAI,IAAI,mIAAmI,CAC5I,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,UAAU,CAAC;IAEzC,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAEhC,IAAI,OAAO,CAAC,MAAM,KAAK,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C;QAEhH,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,gBAAgB,CACxB,iCAAiC,WAAW,CAAC,MAAM,mEAAmE,MAAM,CAAC,IAAI,GAAG,CACrI,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Token } from '../token/token.js';
|
|
2
2
|
import type { ProjectionApplication } from './projection-application.js';
|
|
3
|
+
import type { ProjectionFeed } from './projection-feed.js';
|
|
3
4
|
export interface ProjectionDeclaration {
|
|
4
5
|
readonly role: 'projection';
|
|
5
6
|
/** `<context>.<name>`: the consumer the projection is subscribed as, its idempotency scope and its label. */
|
|
@@ -7,6 +8,8 @@ export interface ProjectionDeclaration {
|
|
|
7
8
|
readonly implementation: new (...args: never) => object;
|
|
8
9
|
/** The list the decorator wrote; `undefined` when the constructor states the dependencies. */
|
|
9
10
|
readonly dependencies: readonly Token<unknown>[] | undefined;
|
|
11
|
+
/** Where its domain events come from: `dispatch` unless `@Projection` says `{ feed: 'event-store' }`. */
|
|
12
|
+
readonly feed: ProjectionFeed;
|
|
10
13
|
/** In the order the methods are written. */
|
|
11
14
|
readonly applies: readonly ProjectionApplication[];
|
|
12
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-declaration.d.ts","sourceRoot":"","sources":["../../../src/declarations/model/projection-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"projection-declaration.d.ts","sourceRoot":"","sources":["../../../src/declarations/model/projection-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,6GAA6G;IAC7G,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,cAAc,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;IACxD,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,EAAE,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAC7D,yGAAyG;IACzG,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACpD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a projection receives the domain events of its context. `dispatch`, the default: where they
|
|
3
|
+
* are dispatched, inside the save, in its transaction. `event-store`: from the event store, by a
|
|
4
|
+
* catch-up subscription under the name of the projection, which keeps a checkpoint and can rebuild
|
|
5
|
+
* the read model from position zero; the dispatcher does not call it.
|
|
6
|
+
*/
|
|
7
|
+
export type ProjectionFeed = 'dispatch' | 'event-store';
|
|
8
|
+
//# sourceMappingURL=projection-feed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-feed.d.ts","sourceRoot":"","sources":["../../../src/declarations/model/projection-feed.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-feed.js","sourceRoot":"","sources":["../../../src/declarations/model/projection-feed.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoredEvent } from '../../application/event-sourcing/stored-event.js';
|
|
2
|
+
import type { DomainEvent } from '../../domain/domain-event.js';
|
|
3
|
+
import type { EventSerializer } from '../../infrastructure/event-sourcing/event-serializer.js';
|
|
4
|
+
/**
|
|
5
|
+
* How a declared projection applies the events of an event store: an event whose name one of its
|
|
6
|
+
* `@On` methods applies is read back with the serializer of its aggregate and handed to that
|
|
7
|
+
* method; every other event of the store is passed over. What a `CatchUpSubscription` and an
|
|
8
|
+
* `EventStoreProjectionRebuild` are given: `applyingProjection(new AttendanceHistoryProjection(copy), serializer)`.
|
|
9
|
+
* Every event an `@On` method names has to be declared by that serializer: one it does not
|
|
10
|
+
* declare would be passed over at every event, silently, so it is refused here. A projection fed
|
|
11
|
+
* by the store therefore follows the events of one event-sourced aggregate.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyingProjection<E extends DomainEvent>(projection: object, serializer: EventSerializer<E>): (event: StoredEvent) => Promise<void>;
|
|
14
|
+
//# sourceMappingURL=applying-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applying-projection.d.ts","sourceRoot":"","sources":["../../../src/declarations/projection/applying-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yDAAyD,CAAC;AAI/F;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EACtD,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,GAC7B,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAkCvC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DeclarationError } from '../registry/declaration-error.js';
|
|
2
|
+
import { declarationOf } from '../registry/declaration-of.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a declared projection applies the events of an event store: an event whose name one of its
|
|
5
|
+
* `@On` methods applies is read back with the serializer of its aggregate and handed to that
|
|
6
|
+
* method; every other event of the store is passed over. What a `CatchUpSubscription` and an
|
|
7
|
+
* `EventStoreProjectionRebuild` are given: `applyingProjection(new AttendanceHistoryProjection(copy), serializer)`.
|
|
8
|
+
* Every event an `@On` method names has to be declared by that serializer: one it does not
|
|
9
|
+
* declare would be passed over at every event, silently, so it is refused here. A projection fed
|
|
10
|
+
* by the store therefore follows the events of one event-sourced aggregate.
|
|
11
|
+
*/
|
|
12
|
+
export function applyingProjection(projection, serializer) {
|
|
13
|
+
const declaration = declarationOf(projection.constructor);
|
|
14
|
+
if (declaration?.role !== 'projection') {
|
|
15
|
+
throw new DeclarationError(`${projection.constructor.name} is not a declared projection: it carries no @Projection.`);
|
|
16
|
+
}
|
|
17
|
+
const methods = new Map(declaration.applies.flatMap((application) => application.kind === 'domain' ? [[application.name, application.method]] : []));
|
|
18
|
+
const undeclared = [...methods.keys()].filter((name) => !serializer.declares(name));
|
|
19
|
+
if (undeclared.length > 0) {
|
|
20
|
+
throw new DeclarationError(`${projection.constructor.name} applies ${undeclared.join(', ')}, which the serializer it is given does not declare: a projection fed by the event store follows the stored events of one aggregate, read back by the serializer of that aggregate.`);
|
|
21
|
+
}
|
|
22
|
+
return async (stored) => {
|
|
23
|
+
const method = methods.get(stored.type);
|
|
24
|
+
if (method !== undefined) {
|
|
25
|
+
const apply = Reflect.get(projection, method);
|
|
26
|
+
if (typeof apply === 'function') {
|
|
27
|
+
await Reflect.apply(apply, projection, [await serializer.deserialize(stored)]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=applying-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applying-projection.js","sourceRoot":"","sources":["../../../src/declarations/projection/applying-projection.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAAkB,EAClB,UAA8B;IAE9B,MAAM,WAAW,GAAG,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAE1D,IAAI,WAAW,EAAE,IAAI,KAAK,YAAY,EAAE,CAAC;QACvC,MAAM,IAAI,gBAAgB,CACxB,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,2DAA2D,CAC1F,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAC1C,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CACvF,CACF,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,gBAAgB,CACxB,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,qLAAqL,CACrP,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAEvD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;gBAChC,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/declarations.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { type PolicyOptions, Policy } from './declarations/decorators/policy.js'
|
|
|
10
10
|
export type { PortOptions } from './declarations/decorators/port-options.js';
|
|
11
11
|
export type { ProjectionMethodDecorator } from './declarations/decorators/projection-method-decorator.js';
|
|
12
12
|
export { Projection } from './declarations/decorators/projection.js';
|
|
13
|
+
export { applyingProjection } from './declarations/projection/applying-projection.js';
|
|
14
|
+
export type { ProjectionOptions } from './declarations/decorators/projection-options.js';
|
|
13
15
|
export { type PublicOptions, Public } from './declarations/decorators/public.js';
|
|
14
16
|
export { QueryHandler } from './declarations/decorators/query-handler.js';
|
|
15
17
|
export { Repository } from './declarations/decorators/repository.js';
|
|
@@ -51,6 +53,7 @@ export type { PolicyVerdict } from './declarations/model/policy-verdict.js';
|
|
|
51
53
|
export type { PortDeclaration } from './declarations/model/port-declaration.js';
|
|
52
54
|
export type { DomainEventApplication, IntegrationEventApplication, ProjectionApplication, } from './declarations/model/projection-application.js';
|
|
53
55
|
export type { ProjectionDeclaration } from './declarations/model/projection-declaration.js';
|
|
56
|
+
export type { ProjectionFeed } from './declarations/model/projection-feed.js';
|
|
54
57
|
export type { ResourcePointer } from './declarations/model/resource-pointer.js';
|
|
55
58
|
export { DeclarationError } from './declarations/registry/declaration-error.js';
|
|
56
59
|
export { declarationOf } from './declarations/registry/declaration-of.js';
|
|
@@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E,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACnF,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAC1E,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5G,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC"}
|
package/dist/declarations.js
CHANGED
|
@@ -7,6 +7,7 @@ export { IntegrationEventHandler, } from './declarations/decorators/integration-
|
|
|
7
7
|
export { On } from './declarations/decorators/on.js';
|
|
8
8
|
export { Policy } from './declarations/decorators/policy.js';
|
|
9
9
|
export { Projection } from './declarations/decorators/projection.js';
|
|
10
|
+
export { applyingProjection } from './declarations/projection/applying-projection.js';
|
|
10
11
|
export { Public } from './declarations/decorators/public.js';
|
|
11
12
|
export { QueryHandler } from './declarations/decorators/query-handler.js';
|
|
12
13
|
export { Repository } from './declarations/decorators/repository.js';
|
package/dist/declarations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.js","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAkC,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvH,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAEL,uBAAuB,GACxB,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,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QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAyB,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAW1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AA+BhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DomainEvent } from '../domain-event.js';
|
|
2
|
+
import type { AggregateSnapshot } from './aggregate-snapshot.js';
|
|
3
|
+
/** What an event-sourced aggregate is rebuilt from: its stream, read from a snapshot when one was taken. */
|
|
4
|
+
export interface AggregateHistory<E extends DomainEvent, S = never> {
|
|
5
|
+
/** The state at a version of the stream: only the events after it follow. */
|
|
6
|
+
readonly snapshot?: AggregateSnapshot<S>;
|
|
7
|
+
/** In the order they were recorded. */
|
|
8
|
+
readonly events: readonly E[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=aggregate-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-history.d.ts","sourceRoot":"","sources":["../../../src/domain/event-sourcing/aggregate-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,4GAA4G;AAC5G,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,GAAG,KAAK;IAChE,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzC,uCAAuC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-history.js","sourceRoot":"","sources":["../../../src/domain/event-sourcing/aggregate-history.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-snapshot.d.ts","sourceRoot":"","sources":["../../../src/domain/event-sourcing/aggregate-snapshot.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-snapshot.js","sourceRoot":"","sources":["../../../src/domain/event-sourcing/aggregate-snapshot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DomainEvent } from '../domain-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* The apply method of each event an event-sourced aggregate records, by the name the event
|
|
4
|
+
* carries: `{ 'billing.invoice.issued': (event) => this.applyIssued(event) }`. Every name of the
|
|
5
|
+
* union is asked for, so an event without its apply method does not compile.
|
|
6
|
+
*/
|
|
7
|
+
export type Appliers<E extends DomainEvent> = {
|
|
8
|
+
readonly [Name in E['name']]: (event: Extract<E, {
|
|
9
|
+
readonly name: Name;
|
|
10
|
+
}>) => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=appliers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appliers.d.ts","sourceRoot":"","sources":["../../../src/domain/event-sourcing/appliers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,WAAW,IAAI;IAC5C,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,KAAK,IAAI;CACnF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appliers.js","sourceRoot":"","sources":["../../../src/domain/event-sourcing/appliers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AggregateRoot } from '../aggregate-root.js';
|
|
2
|
+
import type { DomainEvent } from '../domain-event.js';
|
|
3
|
+
import type { AggregateHistory } from './aggregate-history.js';
|
|
4
|
+
import type { Appliers } from './appliers.js';
|
|
5
|
+
/**
|
|
6
|
+
* An aggregate whose state is the sum of its events. A command checks the invariants, then
|
|
7
|
+
* records the event of what it decided; recording applies the event through the apply method
|
|
8
|
+
* the aggregate declares for it in `appliers`, and only apply methods change the state. Loading
|
|
9
|
+
* replays the stream, from a snapshot when one was taken, through the same apply methods,
|
|
10
|
+
* recording nothing. `version` is the number of events of the stream the aggregate reflects:
|
|
11
|
+
* the version the stream must still have when its new events are appended.
|
|
12
|
+
*
|
|
13
|
+
* Chosen per aggregate: the other aggregates of a context keep their state in tables.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class EventSourcedAggregate<E extends DomainEvent, S = never> extends AggregateRoot<string> {
|
|
16
|
+
protected constructor(id: string);
|
|
17
|
+
/** The apply method of each event this aggregate records, by the name the event carries. */
|
|
18
|
+
protected abstract appliers(): Appliers<E>;
|
|
19
|
+
/** Applies the event, then keeps it for the next save, which stores it and dispatches it. */
|
|
20
|
+
protected record(event: E): void;
|
|
21
|
+
/**
|
|
22
|
+
* Rebuilds the state from the history of the stream and records nothing. A history that starts
|
|
23
|
+
* from a snapshot needs `restore`, which takes the state the snapshot kept.
|
|
24
|
+
*/
|
|
25
|
+
protected replay(history: AggregateHistory<E, S>, restore?: (state: S) => void): this;
|
|
26
|
+
private applyEvent;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=event-sourced-aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-sourced-aggregate.d.ts","sourceRoot":"","sources":["../../../src/domain/event-sourcing/event-sourced-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C;;;;;;;;;GASG;AACH,8BAAsB,qBAAqB,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,GAAG,KAAK,CAAE,SAAQ,aAAa,CAAC,MAAM,CAAC;IACzG,SAAS,aAAa,EAAE,EAAE,MAAM,EAG/B;IAED,4FAA4F;IAC5F,SAAS,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE3C,6FAA6F;IAC7F,UAAmB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAIxC;IAED;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI,CAkBpF;IAED,OAAO,CAAC,UAAU;CASnB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AggregateRoot } from '../aggregate-root.js';
|
|
2
|
+
import { unstoredEvents } from './unstored-events.js';
|
|
3
|
+
/**
|
|
4
|
+
* An aggregate whose state is the sum of its events. A command checks the invariants, then
|
|
5
|
+
* records the event of what it decided; recording applies the event through the apply method
|
|
6
|
+
* the aggregate declares for it in `appliers`, and only apply methods change the state. Loading
|
|
7
|
+
* replays the stream, from a snapshot when one was taken, through the same apply methods,
|
|
8
|
+
* recording nothing. `version` is the number of events of the stream the aggregate reflects:
|
|
9
|
+
* the version the stream must still have when its new events are appended.
|
|
10
|
+
*
|
|
11
|
+
* Chosen per aggregate: the other aggregates of a context keep their state in tables.
|
|
12
|
+
*/
|
|
13
|
+
export class EventSourcedAggregate extends AggregateRoot {
|
|
14
|
+
constructor(id) {
|
|
15
|
+
super(id);
|
|
16
|
+
unstoredEvents.set(this, []);
|
|
17
|
+
}
|
|
18
|
+
/** Applies the event, then keeps it for the next save, which stores it and dispatches it. */
|
|
19
|
+
record(event) {
|
|
20
|
+
this.applyEvent(event);
|
|
21
|
+
super.record(event);
|
|
22
|
+
unstoredEvents.get(this)?.push(event);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Rebuilds the state from the history of the stream and records nothing. A history that starts
|
|
26
|
+
* from a snapshot needs `restore`, which takes the state the snapshot kept.
|
|
27
|
+
*/
|
|
28
|
+
replay(history, restore) {
|
|
29
|
+
const { snapshot, events } = history;
|
|
30
|
+
if (snapshot !== undefined) {
|
|
31
|
+
if (restore === undefined) {
|
|
32
|
+
throw new TypeError(`${this.constructor.name} was given a snapshot and restores none: pass restore to replay`);
|
|
33
|
+
}
|
|
34
|
+
restore(snapshot.state);
|
|
35
|
+
this.version = snapshot.version;
|
|
36
|
+
}
|
|
37
|
+
for (const event of events) {
|
|
38
|
+
this.applyEvent(event);
|
|
39
|
+
this.version += 1;
|
|
40
|
+
}
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
applyEvent(event) {
|
|
44
|
+
const apply = Reflect.get(this.appliers(), event.name);
|
|
45
|
+
if (typeof apply !== 'function') {
|
|
46
|
+
throw new TypeError(`${this.constructor.name} has no apply method for "${event.name}"`);
|
|
47
|
+
}
|
|
48
|
+
Reflect.apply(apply, this, [event]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=event-sourced-aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-sourced-aggregate.js","sourceRoot":"","sources":["../../../src/domain/event-sourcing/event-sourced-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,OAAgB,qBAAwD,SAAQ,aAAqB;IACzG,YAAsB,EAAU;QAC9B,KAAK,CAAC,EAAE,CAAC,CAAC;QACV,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAKD,6FAA6F;IAC1E,MAAM,CAAC,KAAQ;QAChC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpB,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACO,MAAM,CAAC,OAA+B,EAAE,OAA4B;QAC5E,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAErC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,iEAAiE,CAAC,CAAC;YACjH,CAAC;YAED,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAClC,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACvB,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,UAAU,CAAC,KAAQ;QACzB,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAEhE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,6BAA6B,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;QAC1F,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,cAAc,gCAAuC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './domain/aggregate-root.js';
|
|
2
2
|
export * from './domain/domain-event.js';
|
|
3
3
|
export * from './domain/entity.js';
|
|
4
|
+
export * from './domain/event-sourcing/aggregate-history.js';
|
|
5
|
+
export * from './domain/event-sourcing/aggregate-snapshot.js';
|
|
6
|
+
export * from './domain/event-sourcing/appliers.js';
|
|
7
|
+
export * from './domain/event-sourcing/event-sourced-aggregate.js';
|
|
4
8
|
export * from './domain/errors/code-of.js';
|
|
5
9
|
export * from './domain/errors/concept-error.js';
|
|
6
10
|
export * from './domain/errors/concurrency-error.js';
|
|
@@ -67,6 +71,7 @@ export * from './application/error-reporting/error-report.js';
|
|
|
67
71
|
export * from './application/error-reporting/error-severity.js';
|
|
68
72
|
export * from './application/error-reporting/is-unexpected-error.js';
|
|
69
73
|
export * from './application/error-reporting/report-once.js';
|
|
74
|
+
export * from './application/event-sourcing/index.js';
|
|
70
75
|
export * from './application/events/after-commit-failure.js';
|
|
71
76
|
export * from './application/events/domain-event-callback.js';
|
|
72
77
|
export * from './application/events/domain-event-phase.js';
|
|
@@ -118,38 +123,8 @@ export * from './application/metrics/counter.js';
|
|
|
118
123
|
export * from './application/metrics/gauge.js';
|
|
119
124
|
export * from './application/metrics/histogram.js';
|
|
120
125
|
export * from './application/metrics/metric-labels.js';
|
|
121
|
-
export * from './application/criteria/
|
|
122
|
-
export * from './application/
|
|
123
|
-
export * from './application/criteria/field-of.js';
|
|
124
|
-
export * from './application/criteria/operator-of.js';
|
|
125
|
-
export * from './application/criteria/operand-of.js';
|
|
126
|
-
export * from './application/criteria/filter-node.js';
|
|
127
|
-
export * from './application/criteria/filters.js';
|
|
128
|
-
export * from './application/criteria/criteria.js';
|
|
129
|
-
export * from './application/criteria/field-type.js';
|
|
130
|
-
export * from './application/criteria/field-type-of.js';
|
|
131
|
-
export * from './application/criteria/field-rule.js';
|
|
132
|
-
export * from './application/criteria/field-declaration.js';
|
|
133
|
-
export * from './application/criteria/criteria-limits.js';
|
|
134
|
-
export * from './application/criteria/criteria-declaration.js';
|
|
135
|
-
export * from './application/criteria/criteria-definition.js';
|
|
136
|
-
export * from './application/criteria/criteria-definition-error.js';
|
|
137
|
-
export * from './application/criteria/define-criteria.js';
|
|
138
|
-
export * from './application/criteria/criteria-violation.js';
|
|
139
|
-
export * from './application/criteria/validate-criteria.js';
|
|
140
|
-
export * from './application/criteria/invalid-criteria-error.js';
|
|
141
|
-
export * from './application/criteria/read-scope.js';
|
|
142
|
-
export * from './application/criteria/read-scope-mapping.js';
|
|
143
|
-
export * from './application/criteria/unmapped-read-scope-error.js';
|
|
144
|
-
export * from './application/criteria/scoped-criteria.js';
|
|
145
|
-
export * from './application/criteria/scoped.js';
|
|
146
|
-
export * from './application/criteria/predicate.js';
|
|
147
|
-
export * from './application/criteria/criteria-plan.js';
|
|
148
|
-
export * from './application/criteria/plan-criteria.js';
|
|
149
|
-
export * from './application/criteria/page-of-plan.js';
|
|
150
|
-
export * from './application/criteria/select-rows.js';
|
|
151
|
-
export * from './application/criteria/evaluate-plan.js';
|
|
152
|
-
export * from './application/criteria/evaluate-criteria.js';
|
|
126
|
+
export * from './application/criteria/index.js';
|
|
127
|
+
export * from './application/files/index.js';
|
|
153
128
|
export * from './application/hydration/hydrate.js';
|
|
154
129
|
export * from './application/hydration/hydration.js';
|
|
155
130
|
export * from './application/hydration/hydrated-page.js';
|
|
@@ -178,19 +153,25 @@ export * from './application/pagination/page-request.js';
|
|
|
178
153
|
export * from './application/pagination/page.js';
|
|
179
154
|
export * from './application/pagination/sort-direction.js';
|
|
180
155
|
export * from './application/pagination/sort.js';
|
|
156
|
+
export * from './application/persistence/append-changes.js';
|
|
181
157
|
export * from './application/persistence/optimistic-update.js';
|
|
182
158
|
export * from './application/persistence/schema-name-of.js';
|
|
183
159
|
export * from './application/ports/actor-context.js';
|
|
184
160
|
export * from './application/ports/audit-reader.js';
|
|
185
161
|
export * from './application/ports/audit-trail.js';
|
|
186
162
|
export * from './application/ports/cache.js';
|
|
163
|
+
export * from './application/ports/checkpoint-store.js';
|
|
187
164
|
export * from './application/ports/clock.js';
|
|
188
165
|
export * from './application/ports/command-bus.js';
|
|
189
166
|
export * from './application/ports/domain-event-dispatcher.js';
|
|
190
167
|
export * from './application/ports/error-reporter.js';
|
|
191
168
|
export * from './application/ports/event-bus.js';
|
|
169
|
+
export * from './application/ports/event-store.js';
|
|
192
170
|
export * from './application/ports/event-subscribers.js';
|
|
193
171
|
export * from './application/ports/execution-scope.js';
|
|
172
|
+
export * from './application/ports/file-keys.js';
|
|
173
|
+
export * from './application/ports/file-scanner.js';
|
|
174
|
+
export * from './application/ports/file-storage.js';
|
|
194
175
|
export * from './application/ports/id-generator.js';
|
|
195
176
|
export * from './application/ports/integration-event-publisher.js';
|
|
196
177
|
export * from './application/ports/integration-event-subscriber.js';
|
|
@@ -205,6 +186,9 @@ export * from './application/ports/read-model-rows.js';
|
|
|
205
186
|
export * from './application/ports/read-model-store.js';
|
|
206
187
|
export * from './application/ports/read-model-table.js';
|
|
207
188
|
export * from './application/ports/repository.js';
|
|
189
|
+
export * from './application/ports/served-file-storage.js';
|
|
190
|
+
export * from './application/ports/snapshot-store.js';
|
|
191
|
+
export * from './application/ports/subject-key-store.js';
|
|
208
192
|
export * from './application/ports/unit-of-work.js';
|
|
209
193
|
export * from './application/ports/tenant-directory.js';
|
|
210
194
|
export * from './application/rate-limit/rate-limit-decision-of.js';
|
|
@@ -268,21 +252,54 @@ export * from './infrastructure/context/scoped-actor-context.js';
|
|
|
268
252
|
export * from './infrastructure/error-reporting/dead-letter-error.js';
|
|
269
253
|
export * from './infrastructure/error-reporting/dead-letter-reports.js';
|
|
270
254
|
export * from './infrastructure/error-reporting/report-process-failures.js';
|
|
255
|
+
export * from './infrastructure/domain-events/after-commit.js';
|
|
256
|
+
export * from './infrastructure/domain-events/at-commit.js';
|
|
257
|
+
export * from './infrastructure/domain-events/commit-step.js';
|
|
271
258
|
export * from './infrastructure/domain-events/announce-domain-events.js';
|
|
272
259
|
export * from './infrastructure/domain-events/dispatching-on-save.js';
|
|
273
260
|
export * from './infrastructure/domain-events/report-after-commit-failures.js';
|
|
274
261
|
export * from './infrastructure/domain-events/save-after-commit-error.js';
|
|
275
262
|
export * from './infrastructure/domain-events/unit-of-work-stage.js';
|
|
276
263
|
export * from './infrastructure/domain-events/within-unit-of-work.js';
|
|
264
|
+
export * from './infrastructure/event-sourcing/catch-up-subscription.js';
|
|
265
|
+
export * from './infrastructure/event-sourcing/event-serializer.js';
|
|
266
|
+
export * from './infrastructure/event-sourcing/event-sourcing-stores.js';
|
|
267
|
+
export * from './infrastructure/event-sourcing/event-sourced-repository.js';
|
|
268
|
+
export * from './infrastructure/event-sourcing/event-store-projection-rebuild.js';
|
|
269
|
+
export * from './infrastructure/event-sourcing/personal-data-cipher.js';
|
|
270
|
+
export * from './infrastructure/event-sourcing/postgres/event-store-tables-sql.js';
|
|
271
|
+
export * from './infrastructure/event-sourcing/postgres/event-store-tables-options.js';
|
|
272
|
+
export * from './infrastructure/event-sourcing/postgres/event-store-tables.js';
|
|
273
|
+
export * from './infrastructure/event-sourcing/postgres/postgres-checkpoint-store.js';
|
|
274
|
+
export * from './infrastructure/event-sourcing/postgres/postgres-event-sourcing.js';
|
|
275
|
+
export * from './infrastructure/event-sourcing/postgres/postgres-event-store.js';
|
|
276
|
+
export * from './infrastructure/event-sourcing/postgres/postgres-snapshot-store.js';
|
|
277
|
+
export * from './infrastructure/event-sourcing/postgres/postgres-subject-key-store.js';
|
|
278
|
+
export * from './infrastructure/event-sourcing/snapshot-policy.js';
|
|
279
|
+
export * from './infrastructure/event-sourcing/stored-stamp-of.js';
|
|
277
280
|
export * from './infrastructure/events/idempotent.js';
|
|
281
|
+
export * from './infrastructure/files/accept-every-file-scanner.js';
|
|
282
|
+
export * from './infrastructure/files/file-inspection.js';
|
|
283
|
+
export * from './infrastructure/files/file-staging.js';
|
|
284
|
+
export * from './infrastructure/files/file-uploads-middleware.js';
|
|
285
|
+
export * from './infrastructure/files/in-memory-file-storage.js';
|
|
286
|
+
export * from './infrastructure/files/local-file-storage.js';
|
|
287
|
+
export * from './infrastructure/files/local-file-storage-options.js';
|
|
288
|
+
export * from './infrastructure/files/purge-staged-files.js';
|
|
289
|
+
export * from './infrastructure/files/self-signed-file-storage.js';
|
|
290
|
+
export * from './infrastructure/files/signed-link-options.js';
|
|
291
|
+
export * from './infrastructure/files/tenant-file-keys.js';
|
|
292
|
+
export * from './infrastructure/files/upload-desk.js';
|
|
278
293
|
export * from './infrastructure/id/sequential-id-generator.js';
|
|
279
294
|
export * from './infrastructure/id/uuid-generator.js';
|
|
280
295
|
export * from './infrastructure/in-memory/error-reporting-middleware.js';
|
|
281
296
|
export * from './infrastructure/in-memory/in-memory-cache.js';
|
|
297
|
+
export * from './infrastructure/in-memory/in-memory-checkpoint-store.js';
|
|
282
298
|
export * from './infrastructure/in-memory/in-memory-command-bus.js';
|
|
283
299
|
export * from './infrastructure/in-memory/in-memory-domain-event-dispatcher.js';
|
|
284
300
|
export * from './infrastructure/in-memory/in-memory-error-reporter.js';
|
|
285
301
|
export * from './infrastructure/in-memory/in-memory-event-bus.js';
|
|
302
|
+
export * from './infrastructure/in-memory/in-memory-event-store.js';
|
|
286
303
|
export * from './infrastructure/in-memory/in-memory-lock.js';
|
|
287
304
|
export * from './infrastructure/in-memory/in-memory-logger.js';
|
|
288
305
|
export * from './infrastructure/in-memory/in-memory-metrics.js';
|
|
@@ -290,6 +307,8 @@ export * from './infrastructure/in-memory/in-memory-processed-event-store.js';
|
|
|
290
307
|
export * from './infrastructure/in-memory/in-memory-query-bus.js';
|
|
291
308
|
export * from './infrastructure/in-memory/in-memory-read-model-store.js';
|
|
292
309
|
export * from './infrastructure/in-memory/in-memory-read-model-table.js';
|
|
310
|
+
export * from './infrastructure/in-memory/in-memory-snapshot-store.js';
|
|
311
|
+
export * from './infrastructure/in-memory/in-memory-subject-key-store.js';
|
|
293
312
|
export * from './infrastructure/in-memory/in-memory-rate-limiter.js';
|
|
294
313
|
export * from './infrastructure/in-memory/in-memory-unit-of-work.js';
|
|
295
314
|
export * from './infrastructure/in-memory/metric-sample.js';
|
|
@@ -297,6 +316,7 @@ export * from './infrastructure/in-memory/unit-of-work-middleware.js';
|
|
|
297
316
|
export * from './infrastructure/in-memory/in-memory-tenant-directory.js';
|
|
298
317
|
export * from './infrastructure/read-model/postgres-read-model-rebuild.js';
|
|
299
318
|
export * from './infrastructure/read-model/projection-rebuild.js';
|
|
319
|
+
export * from './infrastructure/read-model/shadow-read-model-store.js';
|
|
300
320
|
export * from './infrastructure/read-model/sql-run.js';
|
|
301
321
|
export * from './infrastructure/read-model/table-read-model-store.js';
|
|
302
322
|
export * from './infrastructure/read-model/write-if-newer.js';
|