@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,39 @@
|
|
|
1
|
+
import { signatureOf } from './signature-of.js';
|
|
2
|
+
import { mediaTypeOf } from './media-type-of.js';
|
|
3
|
+
/** Office and e-book documents are zip archives: their signature is the one of a zip. */
|
|
4
|
+
const ZIP_CONTAINERS = new Set([
|
|
5
|
+
'application/zip',
|
|
6
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
7
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
8
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
9
|
+
'application/vnd.oasis.opendocument.text',
|
|
10
|
+
'application/vnd.oasis.opendocument.spreadsheet',
|
|
11
|
+
'application/epub+zip',
|
|
12
|
+
]);
|
|
13
|
+
/** Text has no signature: it is accepted when its first bytes are UTF-8 without control characters. */
|
|
14
|
+
const TEXT_TYPES = new Set(['text/plain', 'text/csv', 'text/markdown', 'application/json']);
|
|
15
|
+
/** Tab, line feed, form feed and carriage return are text; every other C0 control character is not. */
|
|
16
|
+
const TEXT_CONTROLS = new Set([9, 10, 12, 13]);
|
|
17
|
+
/**
|
|
18
|
+
* Whether the first bytes of a content are what its declared media type says, read on the bytes
|
|
19
|
+
* and never on a file name: a PDF starts with `%PDF-`, a PNG with its eight bytes. A binary
|
|
20
|
+
* format the kit does not recognise, SVG included, never matches.
|
|
21
|
+
*/
|
|
22
|
+
export function contentMatches(head, declared) {
|
|
23
|
+
const essence = mediaTypeOf(declared);
|
|
24
|
+
const signature = signatureOf(head);
|
|
25
|
+
if (signature !== undefined) {
|
|
26
|
+
return signature === essence || (signature === 'application/zip' && ZIP_CONTAINERS.has(essence));
|
|
27
|
+
}
|
|
28
|
+
return TEXT_TYPES.has(essence) && looksLikeText(head);
|
|
29
|
+
}
|
|
30
|
+
function looksLikeText(head) {
|
|
31
|
+
try {
|
|
32
|
+
new TextDecoder('utf-8', { fatal: true }).decode(head, { stream: true });
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return head.every((byte) => byte >= 32 || TEXT_CONTROLS.has(byte));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=content-matches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-matches.js","sourceRoot":"","sources":["../../../src/application/files/content-matches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,yFAAyF;AACzF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,iBAAiB;IACjB,yEAAyE;IACzE,mEAAmE;IACnE,2EAA2E;IAC3E,yCAAyC;IACzC,gDAAgD;IAChD,sBAAsB;CACvB,CAAC,CAAC;AAEH,uGAAuG;AACvG,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAE5F,uGAAuG;AACvG,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,QAAgB;IAC/D,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,KAAK,OAAO,IAAI,CAAC,SAAS,KAAK,iBAAiB,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,aAAa,CAAC,IAAgB;IACrC,IAAI,CAAC;QACH,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface DownloadUrlOptions {
|
|
2
|
+
/** Short: at most `MAX_SIGNED_URL_SECONDS`. A link leaks with the page, the log or the mail that holds it. */
|
|
3
|
+
readonly expiresInSeconds: number;
|
|
4
|
+
/** Offered to the browser as the name to save under (`Content-Disposition: attachment`). */
|
|
5
|
+
readonly fileName?: string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=download-url-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-url-options.d.ts","sourceRoot":"","sources":["../../../src/application/files/download-url-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,8GAA8G;IAC9G,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-url-options.js","sourceRoot":"","sources":["../../../src/application/files/download-url-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
import type { FileMetadata } from './file-metadata.js';
|
|
3
|
+
/** A file being read: what the storage knows of it, and its content as a stream to consume once. */
|
|
4
|
+
export interface FileContent {
|
|
5
|
+
readonly metadata: FileMetadata;
|
|
6
|
+
readonly stream: Readable;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=file-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-content.d.ts","sourceRoot":"","sources":["../../../src/application/files/file-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,oGAAoG;AACpG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-content.js","sourceRoot":"","sources":["../../../src/application/files/file-content.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConceptError } from '../../domain/errors/concept-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* The refusals of a file. `FILE_TOO_LARGE` and `UNSUPPORTED_MEDIA_TYPE` are answered 413 and 415
|
|
4
|
+
* by `@ddd-ts-kit/http`; the key itself never leaves the process.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FileError extends ConceptError {
|
|
7
|
+
static tooLarge(maxBytes: number): import("../../index.js").Refusal<FileError, "FILE_TOO_LARGE", {
|
|
8
|
+
readonly maxBytes: number;
|
|
9
|
+
}>;
|
|
10
|
+
static unsupportedMediaType(mediaType: string, accepted: readonly string[]): import("../../index.js").Refusal<FileError, "UNSUPPORTED_MEDIA_TYPE", {
|
|
11
|
+
readonly mediaType: string;
|
|
12
|
+
readonly accepted: string;
|
|
13
|
+
}>;
|
|
14
|
+
static notFound(key: string): import("../../index.js").Refusal<FileError, "FILE_NOT_FOUND", {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
}>;
|
|
17
|
+
static invalidKey(key: string): import("../../index.js").Refusal<FileError, "INVALID_FILE_KEY", {
|
|
18
|
+
readonly key: string;
|
|
19
|
+
}>;
|
|
20
|
+
static rejected(key: string, reason: string): import("../../index.js").Refusal<FileError, "FILE_REJECTED", {
|
|
21
|
+
readonly key: string;
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
}>;
|
|
24
|
+
static invalidExpiry(seconds: number): import("../../index.js").Refusal<FileError, "INVALID_FILE_URL_EXPIRY", {
|
|
25
|
+
readonly seconds: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=file-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-error.d.ts","sourceRoot":"","sources":["../../../src/application/files/file-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGpE;;;GAGG;AACH,qBAAa,SAAU,SAAQ,YAAY;IACzC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;;OAI/B;IAED,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE;;;OAMzE;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM;;OAE1B;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;;OAM5B;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;OAE1C;IAED,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;;OAMnC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConceptError } from '../../domain/errors/concept-error.js';
|
|
2
|
+
import { MAX_SIGNED_URL_SECONDS } from './max-signed-url-seconds.js';
|
|
3
|
+
/**
|
|
4
|
+
* The refusals of a file. `FILE_TOO_LARGE` and `UNSUPPORTED_MEDIA_TYPE` are answered 413 and 415
|
|
5
|
+
* by `@ddd-ts-kit/http`; the key itself never leaves the process.
|
|
6
|
+
*/
|
|
7
|
+
export class FileError extends ConceptError {
|
|
8
|
+
static tooLarge(maxBytes) {
|
|
9
|
+
return FileError.refusal('FILE_TOO_LARGE', `The file is larger than ${String(maxBytes)} bytes.`, {
|
|
10
|
+
maxBytes,
|
|
11
|
+
}).exposing('maxBytes');
|
|
12
|
+
}
|
|
13
|
+
static unsupportedMediaType(mediaType, accepted) {
|
|
14
|
+
return FileError.refusal('UNSUPPORTED_MEDIA_TYPE', `The content is not one of ${accepted.join(', ')} (declared ${mediaType}).`, { mediaType, accepted: accepted.join(',') }).exposing('accepted');
|
|
15
|
+
}
|
|
16
|
+
static notFound(key) {
|
|
17
|
+
return FileError.refusal('FILE_NOT_FOUND', 'No file is stored under this key.', { key });
|
|
18
|
+
}
|
|
19
|
+
static invalidKey(key) {
|
|
20
|
+
return FileError.refusal('INVALID_FILE_KEY', 'A file key is made of segments of letters, digits, dots, hyphens and underscores, none starting with a dot.', { key });
|
|
21
|
+
}
|
|
22
|
+
static rejected(key, reason) {
|
|
23
|
+
return FileError.refusal('FILE_REJECTED', `The content was refused: ${reason}.`, { key, reason });
|
|
24
|
+
}
|
|
25
|
+
static invalidExpiry(seconds) {
|
|
26
|
+
return FileError.refusal('INVALID_FILE_URL_EXPIRY', `A signed link lives between 1 and ${String(MAX_SIGNED_URL_SECONDS)} seconds, not ${String(seconds)}.`, { seconds });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=file-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-error.js","sourceRoot":"","sources":["../../../src/application/files/file-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAY;IACzC,MAAM,CAAC,QAAQ,CAAC,QAAgB;QAC9B,OAAO,SAAS,CAAC,OAAO,CAAC,gBAAgB,EAAE,2BAA2B,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE;YAC/F,QAAQ;SACT,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,SAAiB,EAAE,QAA2B;QACxE,OAAO,SAAS,CAAC,OAAO,CACtB,wBAAwB,EACxB,6BAA6B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,SAAS,IAAI,EAC3E,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAC5C,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAW;QACzB,OAAO,SAAS,CAAC,OAAO,CAAC,gBAAgB,EAAE,mCAAmC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,SAAS,CAAC,OAAO,CACtB,kBAAkB,EAClB,6GAA6G,EAC7G,EAAE,GAAG,EAAE,CACR,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAW,EAAE,MAAc;QACzC,OAAO,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,4BAA4B,MAAM,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,OAAe;QAClC,OAAO,SAAS,CAAC,OAAO,CACtB,yBAAyB,EACzB,qCAAqC,MAAM,CAAC,sBAAsB,CAAC,iBAAiB,MAAM,CAAC,OAAO,CAAC,GAAG,EACtG,EAAE,OAAO,EAAE,CACZ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What a storage knows of a file it holds, without reading the content. */
|
|
2
|
+
export interface FileMetadata {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly size: number;
|
|
5
|
+
readonly mediaType: string;
|
|
6
|
+
readonly lastModified: Date;
|
|
7
|
+
/** `sha256:<hex>`, when the connector keeps it: the S3 connector does not. */
|
|
8
|
+
readonly checksum?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=file-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-metadata.d.ts","sourceRoot":"","sources":["../../../src/application/files/file-metadata.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-metadata.js","sourceRoot":"","sources":["../../../src/application/files/file-metadata.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-source.d.ts","sourceRoot":"","sources":["../../../src/application/files/file-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,kGAAkG;AAClG,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-source.js","sourceRoot":"","sources":["../../../src/application/files/file-source.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReceivedFile } from './received-file.js';
|
|
2
|
+
import type { StoredFile } from './stored-file.js';
|
|
3
|
+
/**
|
|
4
|
+
* A file a command carries. The controller hands over the `ReceivedFile`, still streaming, and
|
|
5
|
+
* the `fileUploadsMiddleware` of the bus stages it under a key of `area`, scanned, before the
|
|
6
|
+
* unit of work opens: no transaction waits on a client that uploads slowly. The handler then
|
|
7
|
+
* reads `file`, records it and asks `FileStaging.promoteOnCommit` for it.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileUpload {
|
|
10
|
+
readonly received: ReceivedFile;
|
|
11
|
+
/** A key prefix of the project, such as `appointment-documents`. */
|
|
12
|
+
readonly area: string;
|
|
13
|
+
private stored;
|
|
14
|
+
constructor(received: ReceivedFile,
|
|
15
|
+
/** A key prefix of the project, such as `appointment-documents`. */
|
|
16
|
+
area: string);
|
|
17
|
+
/** The name the client gave: shown back to a person, never a key or a path. */
|
|
18
|
+
get fileName(): string;
|
|
19
|
+
get isStaged(): boolean;
|
|
20
|
+
/** The staged file, under its final key. Read before the middleware staged it, a defect of the wiring. */
|
|
21
|
+
get file(): StoredFile;
|
|
22
|
+
/** Called by whoever staged it, once. */
|
|
23
|
+
stagedAs(file: StoredFile): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=file-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/application/files/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;GAKG;AACH,qBAAa,UAAU;IAInB,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM;IALvB,OAAO,CAAC,MAAM,CAAyB;IAEvC,YACW,QAAQ,EAAE,YAAY;IAC/B,oEAAoE;IAC3D,IAAI,EAAE,MAAM,EACnB;IAEJ,+EAA+E;IAC/E,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,0GAA0G;IAC1G,IAAI,IAAI,IAAI,UAAU,CAQrB;IAED,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAE/B;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A file a command carries. The controller hands over the `ReceivedFile`, still streaming, and
|
|
3
|
+
* the `fileUploadsMiddleware` of the bus stages it under a key of `area`, scanned, before the
|
|
4
|
+
* unit of work opens: no transaction waits on a client that uploads slowly. The handler then
|
|
5
|
+
* reads `file`, records it and asks `FileStaging.promoteOnCommit` for it.
|
|
6
|
+
*/
|
|
7
|
+
export class FileUpload {
|
|
8
|
+
received;
|
|
9
|
+
area;
|
|
10
|
+
stored;
|
|
11
|
+
constructor(received,
|
|
12
|
+
/** A key prefix of the project, such as `appointment-documents`. */
|
|
13
|
+
area) {
|
|
14
|
+
this.received = received;
|
|
15
|
+
this.area = area;
|
|
16
|
+
}
|
|
17
|
+
/** The name the client gave: shown back to a person, never a key or a path. */
|
|
18
|
+
get fileName() {
|
|
19
|
+
return this.received.fileName;
|
|
20
|
+
}
|
|
21
|
+
get isStaged() {
|
|
22
|
+
return this.stored !== undefined;
|
|
23
|
+
}
|
|
24
|
+
/** The staged file, under its final key. Read before the middleware staged it, a defect of the wiring. */
|
|
25
|
+
get file() {
|
|
26
|
+
if (this.stored === undefined) {
|
|
27
|
+
throw new Error(`The file upload of area "${this.area}" was read before it was staged: install fileUploadsMiddleware on the command bus, before the unit of work.`);
|
|
28
|
+
}
|
|
29
|
+
return this.stored;
|
|
30
|
+
}
|
|
31
|
+
/** Called by whoever staged it, once. */
|
|
32
|
+
stagedAs(file) {
|
|
33
|
+
this.stored = file;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=file-upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload.js","sourceRoot":"","sources":["../../../src/application/files/file-upload.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAIV,QAAQ;IAER,IAAI;IALP,MAAM,CAAyB;IAEvC,YACW,QAAsB;IAC/B,oEAAoE;IAC3D,IAAY;wBAFZ,QAAQ;oBAER,IAAI;IACZ,CAAC;IAEJ,+EAA+E;IAC/E,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC;IACnC,CAAC;IAED,0GAA0G;IAC1G,IAAI,IAAI;QACN,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,4BAA4B,IAAI,CAAC,IAAI,6GAA6G,CACnJ,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,yCAAyC;IACzC,QAAQ,CAAC,IAAgB;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './accepts-media-type.js';
|
|
2
|
+
export * from './assert-expiry.js';
|
|
3
|
+
export * from './content-disposition.js';
|
|
4
|
+
export * from './content-expectation.js';
|
|
5
|
+
export * from './content-matches.js';
|
|
6
|
+
export * from './download-url-options.js';
|
|
7
|
+
export * from './file-content.js';
|
|
8
|
+
export * from './file-error.js';
|
|
9
|
+
export * from './assert-file-key.js';
|
|
10
|
+
export * from './assert-final-key.js';
|
|
11
|
+
export * from './is-file-key.js';
|
|
12
|
+
export * from './file-metadata.js';
|
|
13
|
+
export * from './file-source.js';
|
|
14
|
+
export * from './file-upload.js';
|
|
15
|
+
export * from './inspection-limits.js';
|
|
16
|
+
export * from './listed-file.js';
|
|
17
|
+
export * from './max-signed-url-seconds.js';
|
|
18
|
+
export * from './media-type-of.js';
|
|
19
|
+
export * from './pending-upload.js';
|
|
20
|
+
export * from './pending-upload-link.js';
|
|
21
|
+
export * from './put-options.js';
|
|
22
|
+
export * from './received-file.js';
|
|
23
|
+
export * from './scan-verdict.js';
|
|
24
|
+
export * from './signature-of.js';
|
|
25
|
+
export * from './signed-download.js';
|
|
26
|
+
export * from './signed-upload.js';
|
|
27
|
+
export * from './signed-url.js';
|
|
28
|
+
export * from './staged-key-of.js';
|
|
29
|
+
export * from './stored-file.js';
|
|
30
|
+
export * from './upload-url-options.js';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/application/files/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './accepts-media-type.js';
|
|
2
|
+
export * from './assert-expiry.js';
|
|
3
|
+
export * from './content-disposition.js';
|
|
4
|
+
export * from './content-expectation.js';
|
|
5
|
+
export * from './content-matches.js';
|
|
6
|
+
export * from './download-url-options.js';
|
|
7
|
+
export * from './file-content.js';
|
|
8
|
+
export * from './file-error.js';
|
|
9
|
+
export * from './assert-file-key.js';
|
|
10
|
+
export * from './assert-final-key.js';
|
|
11
|
+
export * from './is-file-key.js';
|
|
12
|
+
export * from './file-metadata.js';
|
|
13
|
+
export * from './file-source.js';
|
|
14
|
+
export * from './file-upload.js';
|
|
15
|
+
export * from './inspection-limits.js';
|
|
16
|
+
export * from './listed-file.js';
|
|
17
|
+
export * from './max-signed-url-seconds.js';
|
|
18
|
+
export * from './media-type-of.js';
|
|
19
|
+
export * from './pending-upload.js';
|
|
20
|
+
export * from './pending-upload-link.js';
|
|
21
|
+
export * from './put-options.js';
|
|
22
|
+
export * from './received-file.js';
|
|
23
|
+
export * from './scan-verdict.js';
|
|
24
|
+
export * from './signature-of.js';
|
|
25
|
+
export * from './signed-download.js';
|
|
26
|
+
export * from './signed-upload.js';
|
|
27
|
+
export * from './signed-url.js';
|
|
28
|
+
export * from './staged-key-of.js';
|
|
29
|
+
export * from './stored-file.js';
|
|
30
|
+
export * from './upload-url-options.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/application/files/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ContentExpectation } from './content-expectation.js';
|
|
2
|
+
export interface InspectionLimits {
|
|
3
|
+
/** Beyond it the stream fails with `FILE_TOO_LARGE`. */
|
|
4
|
+
readonly maxBytes?: number;
|
|
5
|
+
/** When given, the first bytes are checked against it before any byte goes on. */
|
|
6
|
+
readonly expected?: ContentExpectation;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=inspection-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection-limits.d.ts","sourceRoot":"","sources":["../../../src/application/files/inspection-limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection-limits.js","sourceRoot":"","sources":["../../../src/application/files/inspection-limits.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a key is one the storages accept: segments separated by `/`, each made of letters,
|
|
3
|
+
* digits, dots, hyphens and underscores and none starting with a dot, so a key can never climb
|
|
4
|
+
* out of its directory or prefix (`..`), be absolute, or hide a file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isFileKey(key: string): boolean;
|
|
7
|
+
//# sourceMappingURL=is-file-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-file-key.d.ts","sourceRoot":"","sources":["../../../src/application/files/is-file-key.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const SEGMENT = /^[A-Za-z0-9_-][A-Za-z0-9._-]*$/;
|
|
2
|
+
const MAX_KEY_LENGTH = 1_024;
|
|
3
|
+
/**
|
|
4
|
+
* Whether a key is one the storages accept: segments separated by `/`, each made of letters,
|
|
5
|
+
* digits, dots, hyphens and underscores and none starting with a dot, so a key can never climb
|
|
6
|
+
* out of its directory or prefix (`..`), be absolute, or hide a file.
|
|
7
|
+
*/
|
|
8
|
+
export function isFileKey(key) {
|
|
9
|
+
return key.length > 0 && key.length <= MAX_KEY_LENGTH && key.split('/').every((segment) => SEGMENT.test(segment));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=is-file-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-file-key.js","sourceRoot":"","sources":["../../../src/application/files/is-file-key.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,gCAAgC,CAAC;AACjD,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,cAAc,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACpH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listed-file.d.ts","sourceRoot":"","sources":["../../../src/application/files/listed-file.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listed-file.js","sourceRoot":"","sources":["../../../src/application/files/listed-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-signed-url-seconds.d.ts","sourceRoot":"","sources":["../../../src/application/files/max-signed-url-seconds.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,eAAO,MAAM,sBAAsB,OAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max-signed-url-seconds.js","sourceRoot":"","sources":["../../../src/application/files/max-signed-url-seconds.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-type-of.d.ts","sourceRoot":"","sources":["../../../src/application/files/media-type-of.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-type-of.js","sourceRoot":"","sources":["../../../src/application/files/media-type-of.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,MAAM,UAAU,WAAW,CAAC,WAAmB;IAC7C,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PendingUpload } from './pending-upload.js';
|
|
2
|
+
import type { SignedUpload } from './signed-upload.js';
|
|
3
|
+
/** What `FileStaging.uploadUrl` answers: the request for the client, and the grant for the server to keep. */
|
|
4
|
+
export interface PendingUploadLink {
|
|
5
|
+
/** Handed to the client. */
|
|
6
|
+
readonly link: SignedUpload;
|
|
7
|
+
/** Kept on the server, on the aggregate that awaits the file; never handed to the client to send back. */
|
|
8
|
+
readonly pending: PendingUpload;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=pending-upload-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-upload-link.d.ts","sourceRoot":"","sources":["../../../src/application/files/pending-upload-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,8GAA8G;AAC9G,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,0GAA0G;IAC1G,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-upload-link.js","sourceRoot":"","sources":["../../../src/application/files/pending-upload-link.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ContentExpectation } from './content-expectation.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the server granted when it signed a link to upload a file straight to the storage: the
|
|
4
|
+
* key, the size cap and the media types. Recorded on the server, on the aggregate that awaits
|
|
5
|
+
* the file, by the command that signed the link; the command that confirms the upload reads it
|
|
6
|
+
* back from there, never from what the client sends, so a client can neither choose the key it
|
|
7
|
+
* confirms nor raise the cap.
|
|
8
|
+
*/
|
|
9
|
+
export interface PendingUpload extends ContentExpectation {
|
|
10
|
+
/** The final key, generated by `FileKeys`; the file waits under its staged key. */
|
|
11
|
+
readonly key: string;
|
|
12
|
+
/** In bytes: what `FileStaging.confirm` accepts at most. */
|
|
13
|
+
readonly maxBytes: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=pending-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-upload.d.ts","sourceRoot":"","sources":["../../../src/application/files/pending-upload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD,mFAAmF;IACnF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-upload.js","sourceRoot":"","sources":["../../../src/application/files/pending-upload.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface PutOptions {
|
|
2
|
+
/** The media type the content was verified to be. */
|
|
3
|
+
readonly mediaType: string;
|
|
4
|
+
/** Beyond it the write fails with `FILE_TOO_LARGE` and leaves nothing under the key. */
|
|
5
|
+
readonly maxBytes?: number;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=put-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"put-options.d.ts","sourceRoot":"","sources":["../../../src/application/files/put-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"put-options.js","sourceRoot":"","sources":["../../../src/application/files/put-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
/**
|
|
3
|
+
* A file received from a client, still streaming: what a controller hands to a command, and the
|
|
4
|
+
* handler to `FileStaging.stage`. Nothing of it is trusted but its bytes, which the edge checks
|
|
5
|
+
* against the declared media type as they stream.
|
|
6
|
+
*/
|
|
7
|
+
export interface ReceivedFile {
|
|
8
|
+
/** The name the client gave: shown back to a person, never a key or a path. */
|
|
9
|
+
readonly fileName: string;
|
|
10
|
+
/** The media type the client declared, which the first bytes must prove. */
|
|
11
|
+
readonly mediaType: string;
|
|
12
|
+
/** The content, to consume once. It fails on its way with `FILE_TOO_LARGE` or `UNSUPPORTED_MEDIA_TYPE`. */
|
|
13
|
+
readonly stream: Readable;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=received-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"received-file.d.ts","sourceRoot":"","sources":["../../../src/application/files/received-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2GAA2G;IAC3G,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"received-file.js","sourceRoot":"","sources":["../../../src/application/files/received-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** What a `FileScanner` concludes: accepted, or refused with a stable reason (`INFECTED`, `ENCRYPTED_ARCHIVE`). */
|
|
2
|
+
export type ScanVerdict = {
|
|
3
|
+
readonly accepted: true;
|
|
4
|
+
} | {
|
|
5
|
+
readonly accepted: false;
|
|
6
|
+
readonly reason: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=scan-verdict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-verdict.d.ts","sourceRoot":"","sources":["../../../src/application/files/scan-verdict.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-verdict.js","sourceRoot":"","sources":["../../../src/application/files/scan-verdict.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-of.d.ts","sourceRoot":"","sources":["../../../src/application/files/signature-of.ts"],"names":[],"mappings":"AAuBA,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAGhE"}
|