@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConcurrencyError } from '../../domain/errors/concurrency-error.js';
|
|
2
|
+
/** Reference implementation, for tests and single-process apps. Not transactional: a failed unit of work keeps what it appended. */
|
|
3
|
+
export class InMemoryEventStore {
|
|
4
|
+
events = [];
|
|
5
|
+
async append(stream, expectedVersion, events) {
|
|
6
|
+
const version = this.versionOf(stream);
|
|
7
|
+
if (version !== expectedVersion) {
|
|
8
|
+
throw new ConcurrencyError(stream);
|
|
9
|
+
}
|
|
10
|
+
events.forEach((event, index) => {
|
|
11
|
+
this.events.push(structuredClone({
|
|
12
|
+
...event,
|
|
13
|
+
metadata: event.metadata ?? {},
|
|
14
|
+
stream,
|
|
15
|
+
version: version + index + 1,
|
|
16
|
+
position: this.events.length + 1,
|
|
17
|
+
}));
|
|
18
|
+
});
|
|
19
|
+
return { version: version + events.length, position: this.events.length };
|
|
20
|
+
}
|
|
21
|
+
async readStream(stream, after = 0) {
|
|
22
|
+
return this.events.filter((event) => event.stream === stream && event.version > after).map(copy);
|
|
23
|
+
}
|
|
24
|
+
async readAll(after, limit) {
|
|
25
|
+
return this.events.slice(Math.max(0, after), Math.max(0, after) + Math.max(0, limit)).map(copy);
|
|
26
|
+
}
|
|
27
|
+
async head() {
|
|
28
|
+
return this.events.length;
|
|
29
|
+
}
|
|
30
|
+
versionOf(stream) {
|
|
31
|
+
return this.events.filter((event) => event.stream === stream).length;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function copy(event) {
|
|
35
|
+
return structuredClone(event);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=in-memory-event-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-event-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-event-store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,oIAAoI;AACpI,MAAM,OAAO,kBAAkB;IACZ,MAAM,GAAkB,EAAE,CAAC;IAE5C,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,eAAuB,EAAE,MAAgC;QACpF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEvC,IAAI,OAAO,KAAK,eAAe,EAAE,CAAC;YAChC,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,eAAe,CAAC;gBACd,GAAG,KAAK;gBACR,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE;gBAC9B,MAAM;gBACN,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,CAAC;gBAC5B,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;aACjC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,KAAK,GAAG,CAAC;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnG,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,KAAa;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClG,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;IAEO,SAAS,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;IACvE,CAAC;CACF;AAED,SAAS,IAAI,CAAC,KAAkB;IAC9B,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StoredSnapshot } from '../../application/event-sourcing/stored-snapshot.js';
|
|
2
|
+
import type { SnapshotStore } from '../../application/ports/snapshot-store.js';
|
|
3
|
+
/** Reference implementation, for tests and single-process apps. */
|
|
4
|
+
export declare class InMemorySnapshotStore implements SnapshotStore {
|
|
5
|
+
private readonly snapshots;
|
|
6
|
+
find(stream: string): Promise<StoredSnapshot | undefined>;
|
|
7
|
+
save(snapshot: StoredSnapshot): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=in-memory-snapshot-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-snapshot-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-snapshot-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,mEAAmE;AACnE,qBAAa,qBAAsB,YAAW,aAAa;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqC;IAEzD,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAI9D;IAEK,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAMlD;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Reference implementation, for tests and single-process apps. */
|
|
2
|
+
export class InMemorySnapshotStore {
|
|
3
|
+
snapshots = new Map();
|
|
4
|
+
async find(stream) {
|
|
5
|
+
const snapshot = this.snapshots.get(stream);
|
|
6
|
+
return snapshot === undefined ? undefined : structuredClone(snapshot);
|
|
7
|
+
}
|
|
8
|
+
async save(snapshot) {
|
|
9
|
+
const held = this.snapshots.get(snapshot.stream);
|
|
10
|
+
if (held === undefined || held.version < snapshot.version) {
|
|
11
|
+
this.snapshots.set(snapshot.stream, structuredClone(snapshot));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=in-memory-snapshot-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-snapshot-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-snapshot-store.ts"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,MAAM,OAAO,qBAAqB;IACf,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE/D,KAAK,CAAC,IAAI,CAAC,MAAc;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAE5C,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAwB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC1D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SubjectKey } from '../../application/event-sourcing/subject-key.js';
|
|
2
|
+
import type { SubjectKeyStore } from '../../application/ports/subject-key-store.js';
|
|
3
|
+
/** Reference implementation, for tests and single-process apps: the keys die with the process. */
|
|
4
|
+
export declare class InMemorySubjectKeyStore implements SubjectKeyStore {
|
|
5
|
+
private readonly current;
|
|
6
|
+
keyFor(subject: string): Promise<SubjectKey>;
|
|
7
|
+
find(keyId: string): Promise<SubjectKey | undefined>;
|
|
8
|
+
erase(subject: string): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=in-memory-subject-key-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-subject-key-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-subject-key-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAEpF,kGAAkG;AAClG,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IAEnD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAYjD;IAEK,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAEzD;IAEK,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7C;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { randomBytes, randomUUID } from 'node:crypto';
|
|
2
|
+
/** Reference implementation, for tests and single-process apps: the keys die with the process. */
|
|
3
|
+
export class InMemorySubjectKeyStore {
|
|
4
|
+
current = new Map();
|
|
5
|
+
async keyFor(subject) {
|
|
6
|
+
const held = this.current.get(subject);
|
|
7
|
+
if (held !== undefined) {
|
|
8
|
+
return held;
|
|
9
|
+
}
|
|
10
|
+
const key = { id: randomUUID(), subject, material: randomBytes(32).toString('base64') };
|
|
11
|
+
this.current.set(subject, key);
|
|
12
|
+
return key;
|
|
13
|
+
}
|
|
14
|
+
async find(keyId) {
|
|
15
|
+
return [...this.current.values()].find((key) => key.id === keyId);
|
|
16
|
+
}
|
|
17
|
+
async erase(subject) {
|
|
18
|
+
return this.current.delete(subject);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=in-memory-subject-key-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-subject-key-store.js","sourceRoot":"","sources":["../../../src/infrastructure/in-memory/in-memory-subject-key-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAItD,kGAAkG;AAClG,MAAM,OAAO,uBAAuB;IACjB,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEzD,KAAK,CAAC,MAAM,CAAC,OAAe;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,GAAG,GAAG,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAExF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAE/B,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAa;QACtB,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAe;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ScopedCriteria } from '../../application/criteria/scoped-criteria.js';
|
|
2
|
+
import type { Page } from '../../application/pagination/page.js';
|
|
3
|
+
import type { ReadModelRows } from '../../application/ports/read-model-rows.js';
|
|
4
|
+
import type { ReadModelStore } from '../../application/ports/read-model-store.js';
|
|
5
|
+
import type { EventStamp } from '../../application/read-model/event-stamp.js';
|
|
6
|
+
import type { ReadModelWrite } from '../../application/read-model/read-model-write.js';
|
|
7
|
+
/**
|
|
8
|
+
* The copy a rebuild fills, as the store of a projection: the same writes as the live store,
|
|
9
|
+
* "apply if newer" included, on the rows `ReadModelTable.shadow()` gives. A projection writes, it
|
|
10
|
+
* does not search: `search` is refused.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ShadowReadModelStore<Row> implements ReadModelStore<Row> {
|
|
13
|
+
private readonly rows;
|
|
14
|
+
constructor(rows: ReadModelRows<Row>);
|
|
15
|
+
get(key: string): Promise<Row | undefined>;
|
|
16
|
+
upsertIfNewer(key: string, stamp: EventStamp, next: (current: Row | undefined) => Row | undefined): Promise<ReadModelWrite>;
|
|
17
|
+
delete(key: string, stamp: EventStamp): Promise<ReadModelWrite>;
|
|
18
|
+
search(criteria: ScopedCriteria<Row>): Promise<Page<Row>>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=shadow-read-model-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow-read-model-store.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/read-model/shadow-read-model-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAGvF;;;;GAIG;AACH,qBAAa,oBAAoB,CAAC,GAAG,CAAE,YAAW,cAAc,CAAC,GAAG,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAjC,YAA6B,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAI;IAEnD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC,CAE/C;IAED,aAAa,CACX,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,SAAS,KAAK,GAAG,GAAG,SAAS,GAClD,OAAO,CAAC,cAAc,CAAC,CAEzB;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAE9D;IAED,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAExD;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { writeIfNewer } from './write-if-newer.js';
|
|
2
|
+
/**
|
|
3
|
+
* The copy a rebuild fills, as the store of a projection: the same writes as the live store,
|
|
4
|
+
* "apply if newer" included, on the rows `ReadModelTable.shadow()` gives. A projection writes, it
|
|
5
|
+
* does not search: `search` is refused.
|
|
6
|
+
*/
|
|
7
|
+
export class ShadowReadModelStore {
|
|
8
|
+
rows;
|
|
9
|
+
constructor(rows) {
|
|
10
|
+
this.rows = rows;
|
|
11
|
+
}
|
|
12
|
+
async get(key) {
|
|
13
|
+
return (await this.rows.find(key))?.row;
|
|
14
|
+
}
|
|
15
|
+
upsertIfNewer(key, stamp, next) {
|
|
16
|
+
return writeIfNewer(this.rows, { key, stamp, next });
|
|
17
|
+
}
|
|
18
|
+
delete(key, stamp) {
|
|
19
|
+
return writeIfNewer(this.rows, { key, stamp });
|
|
20
|
+
}
|
|
21
|
+
search(criteria) {
|
|
22
|
+
return Promise.reject(new TypeError('The copy of a read model being rebuilt is written, never searched'));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=shadow-read-model-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow-read-model-store.js","sourceRoot":"","sources":["../../../src/infrastructure/read-model/shadow-read-model-store.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IACF,IAAI;IAAjC,YAA6B,IAAwB;oBAAxB,IAAI;IAAuB,CAAC;IAEzD,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC;IAC1C,CAAC;IAED,aAAa,CACX,GAAW,EACX,KAAiB,EACjB,IAAmD;QAEnD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,KAAiB;QACnC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,QAA6B;QAClC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,mEAAmE,CAAC,CAAC,CAAC;IAC5G,CAAC;CACF"}
|