@ddd-ts-kit/kernel 0.7.0 → 0.9.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 +111 -9
- package/dist/application/audit/tenant-scope-of.d.ts +4 -1
- package/dist/application/audit/tenant-scope-of.d.ts.map +1 -1
- package/dist/application/audit/tenant-scope-of.js +6 -2
- package/dist/application/audit/tenant-scope-of.js.map +1 -1
- package/dist/application/cache/tenant-cache-key.d.ts +5 -0
- package/dist/application/cache/tenant-cache-key.d.ts.map +1 -0
- package/dist/application/cache/tenant-cache-key.js +7 -0
- package/dist/application/cache/tenant-cache-key.js.map +1 -0
- package/dist/application/events/execution-context-of-event.d.ts +2 -1
- package/dist/application/events/execution-context-of-event.d.ts.map +1 -1
- package/dist/application/events/execution-context-of-event.js +3 -1
- package/dist/application/events/execution-context-of-event.js.map +1 -1
- package/dist/application/events/integration-event.d.ts +6 -0
- package/dist/application/events/integration-event.d.ts.map +1 -1
- package/dist/application/events/scoped-publisher.d.ts +4 -3
- package/dist/application/events/scoped-publisher.d.ts.map +1 -1
- package/dist/application/events/scoped-publisher.js +11 -5
- package/dist/application/events/scoped-publisher.js.map +1 -1
- package/dist/application/execution/execution-context.d.ts +7 -1
- package/dist/application/execution/execution-context.d.ts.map +1 -1
- package/dist/application/execution/execution-context.js +7 -2
- package/dist/application/execution/execution-context.js.map +1 -1
- package/dist/application/execution/log-fields-of.d.ts.map +1 -1
- package/dist/application/execution/log-fields-of.js +1 -0
- package/dist/application/execution/log-fields-of.js.map +1 -1
- 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/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/tenant-directory.d.ts +8 -0
- package/dist/application/ports/tenant-directory.d.ts.map +1 -0
- package/dist/application/ports/tenant-directory.js +10 -0
- package/dist/application/ports/tenant-directory.js.map +1 -0
- package/dist/application/scheduling/execution-context-of-job.d.ts +3 -1
- package/dist/application/scheduling/execution-context-of-job.d.ts.map +1 -1
- package/dist/application/scheduling/execution-context-of-job.js +1 -1
- package/dist/application/scheduling/execution-context-of-job.js.map +1 -1
- package/dist/application/scheduling/job-execution.d.ts +2 -0
- package/dist/application/scheduling/job-execution.d.ts.map +1 -1
- package/dist/application/scheduling/job-options.d.ts +6 -0
- package/dist/application/scheduling/job-options.d.ts.map +1 -1
- package/dist/application/scheduling/job-policy.d.ts.map +1 -1
- package/dist/application/scheduling/job-policy.js +4 -2
- package/dist/application/scheduling/job-policy.js.map +1 -1
- package/dist/application/session/has-scope.d.ts +5 -0
- package/dist/application/session/has-scope.d.ts.map +1 -0
- package/dist/application/session/has-scope.js +5 -0
- package/dist/application/session/has-scope.js.map +1 -0
- package/dist/application/session/session-scope.d.ts +4 -0
- package/dist/application/session/session-scope.d.ts.map +1 -0
- package/dist/application/session/session-scope.js +2 -0
- package/dist/application/session/session-scope.js.map +1 -0
- package/dist/application/session/session-scopes.d.ts +11 -0
- package/dist/application/session/session-scopes.d.ts.map +1 -0
- package/dist/application/session/session-scopes.js +2 -0
- package/dist/application/session/session-scopes.js.map +1 -0
- package/dist/application/session/session.d.ts +6 -0
- package/dist/application/session/session.d.ts.map +1 -1
- package/dist/application/tenancy/across-tenants.d.ts +12 -0
- package/dist/application/tenancy/across-tenants.d.ts.map +1 -0
- package/dist/application/tenancy/across-tenants.js +47 -0
- package/dist/application/tenancy/across-tenants.js.map +1 -0
- package/dist/application/tenancy/assert-tenant-id.d.ts +3 -0
- package/dist/application/tenancy/assert-tenant-id.d.ts.map +1 -0
- package/dist/application/tenancy/assert-tenant-id.js +10 -0
- package/dist/application/tenancy/assert-tenant-id.js.map +1 -0
- package/dist/application/tenancy/elevation-options.d.ts +12 -0
- package/dist/application/tenancy/elevation-options.d.ts.map +1 -0
- package/dist/application/tenancy/elevation-options.js +2 -0
- package/dist/application/tenancy/elevation-options.js.map +1 -0
- package/dist/application/tenancy/invalid-tenant-elevation-error.d.ts +5 -0
- package/dist/application/tenancy/invalid-tenant-elevation-error.d.ts.map +1 -0
- package/dist/application/tenancy/invalid-tenant-elevation-error.js +8 -0
- package/dist/application/tenancy/invalid-tenant-elevation-error.js.map +1 -0
- package/dist/application/tenancy/invalid-tenant-id-error.d.ts +6 -0
- package/dist/application/tenancy/invalid-tenant-id-error.d.ts.map +1 -0
- package/dist/application/tenancy/invalid-tenant-id-error.js +10 -0
- package/dist/application/tenancy/invalid-tenant-id-error.js.map +1 -0
- package/dist/application/tenancy/is-tenant-id.d.ts +3 -0
- package/dist/application/tenancy/is-tenant-id.d.ts.map +1 -0
- package/dist/application/tenancy/is-tenant-id.js +12 -0
- package/dist/application/tenancy/is-tenant-id.js.map +1 -0
- package/dist/application/tenancy/is-tenant-member.d.ts +4 -0
- package/dist/application/tenancy/is-tenant-member.d.ts.map +1 -0
- package/dist/application/tenancy/is-tenant-member.js +6 -0
- package/dist/application/tenancy/is-tenant-member.js.map +1 -0
- package/dist/application/tenancy/tenant-elevation.d.ts +11 -0
- package/dist/application/tenancy/tenant-elevation.d.ts.map +1 -0
- package/dist/application/tenancy/tenant-elevation.js +2 -0
- package/dist/application/tenancy/tenant-elevation.js.map +1 -0
- package/dist/application/tenancy/tenant-key.d.ts +9 -0
- package/dist/application/tenancy/tenant-key.d.ts.map +1 -0
- package/dist/application/tenancy/tenant-key.js +11 -0
- package/dist/application/tenancy/tenant-key.js.map +1 -0
- package/dist/application/tenancy/tenant-reach-of.d.ts +9 -0
- package/dist/application/tenancy/tenant-reach-of.d.ts.map +1 -0
- package/dist/application/tenancy/tenant-reach-of.js +18 -0
- package/dist/application/tenancy/tenant-reach-of.js.map +1 -0
- package/dist/application/tenancy/tenant-reach.d.ts +12 -0
- package/dist/application/tenancy/tenant-reach.d.ts.map +1 -0
- package/dist/application/tenancy/tenant-reach.js +2 -0
- package/dist/application/tenancy/tenant-reach.js.map +1 -0
- package/dist/application/tenancy/tenants-of.d.ts +8 -0
- package/dist/application/tenancy/tenants-of.d.ts.map +1 -0
- package/dist/application/tenancy/tenants-of.js +14 -0
- package/dist/application/tenancy/tenants-of.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -0
- 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/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-tenant-directory.d.ts +8 -0
- package/dist/infrastructure/in-memory/in-memory-tenant-directory.d.ts.map +1 -0
- package/dist/infrastructure/in-memory/in-memory-tenant-directory.js +12 -0
- package/dist/infrastructure/in-memory/in-memory-tenant-directory.js.map +1 -0
- package/dist/infrastructure/tenancy/tenant-isolation-policies.d.ts +13 -0
- package/dist/infrastructure/tenancy/tenant-isolation-policies.d.ts.map +1 -0
- package/dist/infrastructure/tenancy/tenant-isolation-policies.js +13 -0
- package/dist/infrastructure/tenancy/tenant-isolation-policies.js.map +1 -0
- package/dist/infrastructure/tenancy/tenant-policy-expressions.d.ts +11 -0
- package/dist/infrastructure/tenancy/tenant-policy-expressions.d.ts.map +1 -0
- package/dist/infrastructure/tenancy/tenant-policy-expressions.js +15 -0
- package/dist/infrastructure/tenancy/tenant-policy-expressions.js.map +1 -0
- package/dist/infrastructure/tenancy/tenant-setting-values.d.ts +13 -0
- package/dist/infrastructure/tenancy/tenant-setting-values.d.ts.map +1 -0
- package/dist/infrastructure/tenancy/tenant-setting-values.js +19 -0
- package/dist/infrastructure/tenancy/tenant-setting-values.js.map +1 -0
- package/dist/infrastructure/tenancy/tenant-settings.d.ts +13 -0
- package/dist/infrastructure/tenancy/tenant-settings.d.ts.map +1 -0
- package/dist/infrastructure/tenancy/tenant-settings.js +13 -0
- package/dist/infrastructure/tenancy/tenant-settings.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAA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AAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uCAAuC,CAAC;AACtD,cAAc,0DAA0D,CAAC;AACzE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC;AACpE,cAAc,iEAAiE,CAAC;AAChF,cAAc,wDAAwD,CAAC;AACvE,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,mDAAmD,CAAC;AAClE,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC;AACzE,cAAc,sDAAsD,CAAC;AACrE,cAAc,sDAAsD,CAAC;AACrE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `work` once the unit of work in progress has committed, after its `after-commit`
|
|
3
|
+
* handlers, and never when it rolled back; outside of any unit of work, at once. At most once:
|
|
4
|
+
* a crash between the commit and the work loses it, and a rejection after the commit is dropped
|
|
5
|
+
* (`work` reports its own). So only for work whose loss wastes and never loses what a committed
|
|
6
|
+
* row relies on, such as deleting a file no row references any more. An effect a row relies on
|
|
7
|
+
* goes through `atCommit`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function afterCommit(work: () => Promise<void>): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=after-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"after-commit.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/after-commit.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAW1E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { unitOfWorkScope } from './unit-of-work-scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `work` once the unit of work in progress has committed, after its `after-commit`
|
|
4
|
+
* handlers, and never when it rolled back; outside of any unit of work, at once. At most once:
|
|
5
|
+
* a crash between the commit and the work loses it, and a rejection after the commit is dropped
|
|
6
|
+
* (`work` reports its own). So only for work whose loss wastes and never loses what a committed
|
|
7
|
+
* row relies on, such as deleting a file no row references any more. An effect a row relies on
|
|
8
|
+
* goes through `atCommit`.
|
|
9
|
+
*/
|
|
10
|
+
export async function afterCommit(work) {
|
|
11
|
+
const scope = unitOfWorkScope.getStore();
|
|
12
|
+
const open = scope?.kind === 'unit-of-work' && (scope.stage === 'open' || scope.stage === 'before-commit');
|
|
13
|
+
if (open && scope.committed !== undefined) {
|
|
14
|
+
scope.committed.push(work);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
await work();
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=after-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"after-commit.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/after-commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAyB;IACzD,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,CAAC;IAE3G,IAAI,IAAI,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC1C,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE3B,OAAO;IACT,CAAC;IAED,MAAM,IAAI,EAAE,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommitStep } from './commit-step.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `step.apply` as the last step of the unit of work in progress: after its work and its
|
|
4
|
+
* `before-commit` handlers, inside the transaction, just before the commit. A step that rejects
|
|
5
|
+
* rolls the whole back, so nothing commits that the effect did not reach. When the transaction
|
|
6
|
+
* rolls back after it applied (a later step, the commit itself), its `undo` runs, newest step
|
|
7
|
+
* first. Outside of any unit of work, `apply` runs at once. For an effect a committed row relies
|
|
8
|
+
* on, such as moving a staged file to the key the row records.
|
|
9
|
+
*/
|
|
10
|
+
export declare function atCommit(step: CommitStep): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=at-commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"at-commit.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/at-commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAW9D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { unitOfWorkScope } from './unit-of-work-scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `step.apply` as the last step of the unit of work in progress: after its work and its
|
|
4
|
+
* `before-commit` handlers, inside the transaction, just before the commit. A step that rejects
|
|
5
|
+
* rolls the whole back, so nothing commits that the effect did not reach. When the transaction
|
|
6
|
+
* rolls back after it applied (a later step, the commit itself), its `undo` runs, newest step
|
|
7
|
+
* first. Outside of any unit of work, `apply` runs at once. For an effect a committed row relies
|
|
8
|
+
* on, such as moving a staged file to the key the row records.
|
|
9
|
+
*/
|
|
10
|
+
export async function atCommit(step) {
|
|
11
|
+
const scope = unitOfWorkScope.getStore();
|
|
12
|
+
const open = scope?.kind === 'unit-of-work' && (scope.stage === 'open' || scope.stage === 'before-commit');
|
|
13
|
+
if (open && scope.atCommit !== undefined) {
|
|
14
|
+
scope.atCommit.push(step);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
await step.apply();
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=at-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"at-commit.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/at-commit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAgB;IAC7C,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,CAAC;IAE3G,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1B,OAAO;IACT,CAAC;IAED,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An effect outside the database that must land with a commit: `apply` runs inside the
|
|
3
|
+
* transaction, as its last step, and `undo` when the transaction rolls back all the same.
|
|
4
|
+
*/
|
|
5
|
+
export interface CommitStep {
|
|
6
|
+
readonly apply: () => Promise<void>;
|
|
7
|
+
/** Reverses `apply` as far as it can; it reports its own failure, which is dropped. */
|
|
8
|
+
readonly undo: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=commit-step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-step.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/commit-step.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit-step.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/commit-step.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
2
|
import type { DomainEventDispatcher } from '../../application/ports/domain-event-dispatcher.js';
|
|
3
3
|
import type { DomainEvent } from '../../domain/domain-event.js';
|
|
4
|
+
import type { CommitStep } from './commit-step.js';
|
|
4
5
|
/** One event waiting for the end of its scope: who dispatches it, and in which asynchronous context. */
|
|
5
6
|
export interface QueuedDomainEvent {
|
|
6
7
|
readonly event: DomainEvent;
|
|
@@ -18,6 +19,10 @@ export interface UnitOfWorkScope {
|
|
|
18
19
|
readonly queue: QueuedDomainEvent[];
|
|
19
20
|
/** Dispatched before the commit, in that order: what the `after-commit` phase is given. */
|
|
20
21
|
readonly dispatched: QueuedDomainEvent[];
|
|
22
|
+
/** What `afterCommit` was handed in a unit of work: run after the `after-commit` handlers, never on a rollback. */
|
|
23
|
+
readonly committed?: (() => Promise<void>)[];
|
|
24
|
+
/** What `atCommit` was handed in a unit of work: applied last, inside the transaction. */
|
|
25
|
+
readonly atCommit?: CommitStep[];
|
|
21
26
|
}
|
|
22
27
|
export declare const unitOfWorkScope: AsyncLocalStorage<UnitOfWorkScope>;
|
|
23
28
|
//# sourceMappingURL=unit-of-work-scope.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work-scope.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"unit-of-work-scope.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,wGAAwG;AACxG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC;IACvC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC5D,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACpC,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IACzC,mHAAmH;IACnH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAC7C,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CAClC;AAGD,eAAO,MAAM,eAAe,oCAA2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-of-work-scope.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"unit-of-work-scope.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA6BrD,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAmB,CAAC"}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* inside `transaction`: the handlers see every save, and what they save or append to the outbox
|
|
8
8
|
* commits with the rest. A handler that fails, like `work` that fails, rejects the whole: the
|
|
9
9
|
* transaction rolls back, the waiting events are dropped and never come back on the aggregates.
|
|
10
|
-
*
|
|
10
|
+
* The steps handed to `atCommit` are applied last, still inside `transaction`; when it rejects,
|
|
11
|
+
* those applied are undone. Once `transaction` has resolved, and only then, the `after-commit`
|
|
12
|
+
* handlers run, then the work handed to `afterCommit`.
|
|
11
13
|
*
|
|
12
14
|
* Called inside a unit of work already running on the same asynchronous call chain it joins it:
|
|
13
15
|
* `transaction(work)` and nothing else, so one dispatch, at the end of the outermost. Two
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"within-unit-of-work.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
|
|
@@ -10,7 +10,9 @@ import { unitOfWorkScope } from './unit-of-work-scope.js';
|
|
|
10
10
|
* inside `transaction`: the handlers see every save, and what they save or append to the outbox
|
|
11
11
|
* commits with the rest. A handler that fails, like `work` that fails, rejects the whole: the
|
|
12
12
|
* transaction rolls back, the waiting events are dropped and never come back on the aggregates.
|
|
13
|
-
*
|
|
13
|
+
* The steps handed to `atCommit` are applied last, still inside `transaction`; when it rejects,
|
|
14
|
+
* those applied are undone. Once `transaction` has resolved, and only then, the `after-commit`
|
|
15
|
+
* handlers run, then the work handed to `afterCommit`.
|
|
14
16
|
*
|
|
15
17
|
* Called inside a unit of work already running on the same asynchronous call chain it joins it:
|
|
16
18
|
* `transaction(work)` and nothing else, so one dispatch, at the end of the outermost. Two
|
|
@@ -20,22 +22,47 @@ export async function withinUnitOfWork(work, transaction) {
|
|
|
20
22
|
if (isRunning(unitOfWorkScope.getStore())) {
|
|
21
23
|
return transaction(work);
|
|
22
24
|
}
|
|
23
|
-
const scope =
|
|
25
|
+
const scope = openScope();
|
|
26
|
+
const applied = [];
|
|
24
27
|
const result = await unitOfWorkScope
|
|
25
|
-
.run(scope, () => transaction(() => thenDispatched(work, scope)))
|
|
28
|
+
.run(scope, () => transaction(() => thenDispatched(work, scope, applied)))
|
|
29
|
+
.catch(async (error) => {
|
|
30
|
+
await undone(applied);
|
|
31
|
+
throw error;
|
|
32
|
+
})
|
|
26
33
|
.finally(() => {
|
|
27
34
|
scope.stage = 'closed';
|
|
28
35
|
scope.queue.length = 0;
|
|
29
36
|
});
|
|
30
|
-
await
|
|
37
|
+
await afterTheCommit(scope);
|
|
31
38
|
return result;
|
|
32
39
|
}
|
|
33
40
|
function isRunning(scope) {
|
|
34
41
|
return scope?.kind === 'unit-of-work' && (scope.stage === 'open' || scope.stage === 'before-commit');
|
|
35
42
|
}
|
|
36
|
-
|
|
43
|
+
function openScope() {
|
|
44
|
+
return { kind: 'unit-of-work', stage: 'open', queue: [], dispatched: [], committed: [], atCommit: [] };
|
|
45
|
+
}
|
|
46
|
+
async function thenDispatched(work, scope, applied) {
|
|
37
47
|
const result = await work();
|
|
38
48
|
await dispatchBeforeCommit(scope);
|
|
49
|
+
for (const step of scope.atCommit ?? []) {
|
|
50
|
+
await step.apply();
|
|
51
|
+
applied.push(step);
|
|
52
|
+
}
|
|
39
53
|
return result;
|
|
40
54
|
}
|
|
55
|
+
/** Newest first; an undo that fails reported itself, and the others still run. */
|
|
56
|
+
async function undone(applied) {
|
|
57
|
+
for (const step of [...applied].reverse()) {
|
|
58
|
+
await step.undo().catch(() => undefined);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** The `after-commit` handlers, then the work handed to `afterCommit`; a rejection is dropped, the work reported its own. */
|
|
62
|
+
async function afterTheCommit(scope) {
|
|
63
|
+
await dispatchAfterCommit(scope);
|
|
64
|
+
for (const work of scope.committed ?? []) {
|
|
65
|
+
await work().catch(() => undefined);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
41
68
|
//# sourceMappingURL=within-unit-of-work.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"within-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"within-unit-of-work.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/within-unit-of-work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAwB,MAAM,yBAAyB,CAAC;AAEhF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAsB,EACtB,WAAmD;IAEnD,IAAI,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;QAC1C,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,eAAe;SACjC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;SACzE,KAAK,CAAC,KAAK,EAAE,KAAc,EAAE,EAAE;QAC9B,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;QAC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C;IAC3C,CAAC;AACH,CAAC;AAED,6HAA6H;AAC7H,KAAK,UAAU,cAAc,CAAC,KAAsB;IAClD,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;QACzC,MAAM,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ScanVerdict } from '../../application/files/scan-verdict.js';
|
|
2
|
+
import type { FileScanner } from '../../application/ports/file-scanner.js';
|
|
3
|
+
/** The scanner of a project that has none yet: accepts every file without reading it. Bind a real one before accepting files from strangers. */
|
|
4
|
+
export declare class AcceptEveryFileScanner implements FileScanner {
|
|
5
|
+
scan(): Promise<ScanVerdict>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=accept-every-file-scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept-every-file-scanner.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/accept-every-file-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAE3E,gJAAgJ;AAChJ,qBAAa,sBAAuB,YAAW,WAAW;IACxD,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAE3B;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The scanner of a project that has none yet: accepts every file without reading it. Bind a real one before accepting files from strangers. */
|
|
2
|
+
export class AcceptEveryFileScanner {
|
|
3
|
+
scan() {
|
|
4
|
+
return Promise.resolve({ accepted: true });
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=accept-every-file-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept-every-file-scanner.js","sourceRoot":"","sources":["../../../src/infrastructure/files/accept-every-file-scanner.ts"],"names":[],"mappings":"AAGA,gJAAgJ;AAChJ,MAAM,OAAO,sBAAsB;IACjC,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/collect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,uFAAuF;AACvF,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAOlD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
/** The end of a pipeline that keeps every chunk: for the storage of the tests only. */
|
|
3
|
+
export function collect(chunks) {
|
|
4
|
+
return new Writable({
|
|
5
|
+
write(chunk, _encoding, done) {
|
|
6
|
+
chunks.push(chunk);
|
|
7
|
+
done();
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=collect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.js","sourceRoot":"","sources":["../../../src/infrastructure/files/collect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,uFAAuF;AACvF,MAAM,UAAU,OAAO,CAAC,MAAgB;IACtC,OAAO,IAAI,QAAQ,CAAC;QAClB,KAAK,CAAC,KAAa,EAAE,SAAS,EAAE,IAAI;YAClC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,IAAI,EAAE,CAAC;QACT,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** What a signed link allows: one action on one key, until `expiresAt` (seconds since the epoch). */
|
|
2
|
+
export interface FileGrant {
|
|
3
|
+
readonly action: 'download' | 'upload';
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly expiresAt: number;
|
|
6
|
+
readonly fileName?: string;
|
|
7
|
+
readonly mediaType?: string;
|
|
8
|
+
/** The size an upload may not exceed, in bytes. */
|
|
9
|
+
readonly maxBytes?: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=file-grant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-grant.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/file-grant.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-grant.js","sourceRoot":"","sources":["../../../src/infrastructure/files/file-grant.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Transform, type TransformCallback } from 'node:stream';
|
|
2
|
+
import type { InspectionLimits } from '../../application/files/inspection-limits.js';
|
|
3
|
+
/**
|
|
4
|
+
* A pass-through for content on its way to a storage: counts it and fails beyond `maxBytes`,
|
|
5
|
+
* hashes it, and when an expectation is given holds back the first bytes until they prove the
|
|
6
|
+
* declared media type. Nothing of a refused content goes on. Read `size` and `checksum` once the
|
|
7
|
+
* stream has finished.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileInspection extends Transform {
|
|
10
|
+
private readonly limits;
|
|
11
|
+
size: number;
|
|
12
|
+
private readonly hash;
|
|
13
|
+
private held;
|
|
14
|
+
private verified;
|
|
15
|
+
constructor(limits?: InspectionLimits);
|
|
16
|
+
get checksum(): string;
|
|
17
|
+
_transform(chunk: unknown, _encoding: BufferEncoding, done: TransformCallback): void;
|
|
18
|
+
_flush(done: TransformCallback): void;
|
|
19
|
+
private pass;
|
|
20
|
+
private refusalOf;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=file-inspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-inspection.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/file-inspection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAKrF;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAS/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IARnC,IAAI,SAAK;IAET,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8B;IAEnD,OAAO,CAAC,IAAI,CAAgB;IAE5B,OAAO,CAAC,QAAQ,CAAU;IAE1B,YAA6B,MAAM,GAAE,gBAAqB,EAGzD;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAEQ,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAa5F;IAEQ,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAE7C;IAED,OAAO,CAAC,IAAI;IAqBZ,OAAO,CAAC,SAAS;CAalB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { Transform } from 'node:stream';
|
|
3
|
+
import { acceptsMediaType } from '../../application/files/accepts-media-type.js';
|
|
4
|
+
import { contentMatches } from '../../application/files/content-matches.js';
|
|
5
|
+
import { FileError } from '../../application/files/file-error.js';
|
|
6
|
+
/** Enough bytes for every signature, and for a fair judgement of text. */
|
|
7
|
+
const HEAD_BYTES = 4_096;
|
|
8
|
+
/**
|
|
9
|
+
* A pass-through for content on its way to a storage: counts it and fails beyond `maxBytes`,
|
|
10
|
+
* hashes it, and when an expectation is given holds back the first bytes until they prove the
|
|
11
|
+
* declared media type. Nothing of a refused content goes on. Read `size` and `checksum` once the
|
|
12
|
+
* stream has finished.
|
|
13
|
+
*/
|
|
14
|
+
export class FileInspection extends Transform {
|
|
15
|
+
limits;
|
|
16
|
+
size = 0;
|
|
17
|
+
hash = createHash('sha256');
|
|
18
|
+
held = [];
|
|
19
|
+
verified;
|
|
20
|
+
constructor(limits = {}) {
|
|
21
|
+
super();
|
|
22
|
+
this.limits = limits;
|
|
23
|
+
this.verified = limits.expected === undefined;
|
|
24
|
+
}
|
|
25
|
+
get checksum() {
|
|
26
|
+
return `sha256:${this.hash.copy().digest('hex')}`;
|
|
27
|
+
}
|
|
28
|
+
_transform(chunk, _encoding, done) {
|
|
29
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk instanceof Uint8Array ? chunk : String(chunk));
|
|
30
|
+
this.size += bytes.length;
|
|
31
|
+
if (this.limits.maxBytes !== undefined && this.size > this.limits.maxBytes) {
|
|
32
|
+
done(FileError.tooLarge(this.limits.maxBytes));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.hash.update(bytes);
|
|
36
|
+
this.pass(bytes, false, done);
|
|
37
|
+
}
|
|
38
|
+
_flush(done) {
|
|
39
|
+
this.pass(Buffer.alloc(0), true, done);
|
|
40
|
+
}
|
|
41
|
+
pass(bytes, ended, done) {
|
|
42
|
+
if (this.verified) {
|
|
43
|
+
done(null, bytes);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.held.push(bytes);
|
|
47
|
+
const head = Buffer.concat(this.held);
|
|
48
|
+
if (head.length < HEAD_BYTES && !ended) {
|
|
49
|
+
done();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.held = [];
|
|
53
|
+
this.verified = true;
|
|
54
|
+
done(this.refusalOf(head), head);
|
|
55
|
+
}
|
|
56
|
+
refusalOf(head) {
|
|
57
|
+
const { expected } = this.limits;
|
|
58
|
+
if (expected === undefined) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const valid = acceptsMediaType(expected.accepted, expected.mediaType) &&
|
|
62
|
+
contentMatches(head.subarray(0, HEAD_BYTES), expected.mediaType);
|
|
63
|
+
return valid ? null : FileError.unsupportedMediaType(expected.mediaType, expected.accepted);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=file-inspection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-inspection.js","sourceRoot":"","sources":["../../../src/infrastructure/files/file-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,SAAS,EAA0B,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE,0EAA0E;AAC1E,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IASd,MAAM;IARnC,IAAI,GAAG,CAAC,CAAC;IAEQ,IAAI,GAAS,UAAU,CAAC,QAAQ,CAAC,CAAC;IAE3C,IAAI,GAAa,EAAE,CAAC;IAEpB,QAAQ,CAAU;IAE1B,YAA6B,MAAM,GAAqB,EAAE;QACxD,KAAK,EAAE,CAAC;sBAD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QACT,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,IAAI,CAAC,MAAM,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC;YACvC,IAAI,EAAE,CAAC;YAEP,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAEO,SAAS,CAAC,IAAY;QAC5B,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAEjC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GACT,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC;YACvD,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEnE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ContentExpectation } from '../../application/files/content-expectation.js';
|
|
2
|
+
import type { FileSource } from '../../application/files/file-source.js';
|
|
3
|
+
import type { PendingUpload } from '../../application/files/pending-upload.js';
|
|
4
|
+
import type { PendingUploadLink } from '../../application/files/pending-upload-link.js';
|
|
5
|
+
import type { PutOptions } from '../../application/files/put-options.js';
|
|
6
|
+
import type { StoredFile } from '../../application/files/stored-file.js';
|
|
7
|
+
import type { UploadUrlOptions } from '../../application/files/upload-url-options.js';
|
|
8
|
+
import type { ErrorReporter } from '../../application/ports/error-reporter.js';
|
|
9
|
+
import type { FileScanner } from '../../application/ports/file-scanner.js';
|
|
10
|
+
import type { FileStorage } from '../../application/ports/file-storage.js';
|
|
11
|
+
/**
|
|
12
|
+
* Keeps the storage consistent with the database, which a write to the storage cannot join in a
|
|
13
|
+
* transaction. A file is staged first (under `staging/`, scanned, where nothing reads), before
|
|
14
|
+
* the unit of work opens when it comes from a client. The handler records its reference, under
|
|
15
|
+
* its final key, in the aggregate it saves, and asks for `promoteOnCommit`: the file moves to its
|
|
16
|
+
* key as the last step of the transaction, and back to `staging/` if the transaction rolls back.
|
|
17
|
+
* So a committed row never points into `staging/`, and every staged file is an orphan (a refused
|
|
18
|
+
* command, a rollback, an upload never confirmed) that `purge` removes on a schedule.
|
|
19
|
+
*/
|
|
20
|
+
export declare class FileStaging {
|
|
21
|
+
private readonly storage;
|
|
22
|
+
private readonly scanner;
|
|
23
|
+
private readonly reporter;
|
|
24
|
+
constructor(storage: FileStorage, scanner: FileScanner, reporter: ErrorReporter);
|
|
25
|
+
/** Writes the content under the staged key, then has it scanned; a refused file is removed and `FILE_REJECTED` thrown. */
|
|
26
|
+
stage(key: string, content: FileSource, options: PutOptions): Promise<StoredFile>;
|
|
27
|
+
/**
|
|
28
|
+
* A request the client sends the file with, straight to the staged key, and the grant to keep
|
|
29
|
+
* on the server (on the aggregate that awaits the file) for `confirm` to read back.
|
|
30
|
+
*/
|
|
31
|
+
uploadUrl(key: string, options: UploadUrlOptions & Pick<ContentExpectation, 'accepted'>): Promise<PendingUploadLink>;
|
|
32
|
+
/**
|
|
33
|
+
* Reads a file uploaded straight to the staged key of a grant the server kept: its size against
|
|
34
|
+
* the cap of the grant, its media type on its bytes, its checksum, the scan. A file that fails
|
|
35
|
+
* is discarded.
|
|
36
|
+
*/
|
|
37
|
+
confirm(pending: PendingUpload): Promise<StoredFile>;
|
|
38
|
+
/**
|
|
39
|
+
* Moves the staged file to its key as the last step of the unit of work in progress, so that
|
|
40
|
+
* the commit and the file land together: a promotion that fails rolls the command back, and a
|
|
41
|
+
* transaction that rolls back after it returns the file to `staging/`. At once outside of any.
|
|
42
|
+
*/
|
|
43
|
+
promoteOnCommit(key: string): Promise<void>;
|
|
44
|
+
/** Moves the staged file to its key. Promoting twice is not an error; a key staged nowhere and stored nowhere is `FILE_NOT_FOUND`. */
|
|
45
|
+
promote(key: string): Promise<void>;
|
|
46
|
+
/** Deletes a stored file once the unit of work in progress has committed, the one its aggregate no longer references; a failure is reported. */
|
|
47
|
+
deleteAfterCommit(key: string): Promise<void>;
|
|
48
|
+
/** Removes a staged file, one a command will not record. */
|
|
49
|
+
discard(key: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Removes the staged files older than the instant; answers how many. Each is an orphan: no
|
|
52
|
+
* committed row points into `staging/`, since a promotion lands with its commit.
|
|
53
|
+
*/
|
|
54
|
+
purge(olderThan: Date): Promise<number>;
|
|
55
|
+
/** A transaction rolled back after the promotion: the file goes back where the purge finds it; a failure is reported. */
|
|
56
|
+
private returnToStaging;
|
|
57
|
+
private scanned;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=file-staging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-staging.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/files/file-staging.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEzF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEzE,OAAO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