@daiso-tech/core 0.48.5 → 0.49.1
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 +41 -42
- package/dist/backoff-policies/_shared.d.ts +0 -3
- package/dist/backoff-policies/_shared.js.map +1 -1
- package/dist/backoff-policies/constant-backoff/constant-backoff.d.ts +0 -1
- package/dist/backoff-policies/constant-backoff/constant-backoff.js.map +1 -1
- package/dist/backoff-policies/exponential-backoff/exponential-backoff.d.ts +0 -1
- package/dist/backoff-policies/exponential-backoff/exponential-backoff.js.map +1 -1
- package/dist/backoff-policies/linear-backoff/linear-backoff.d.ts +0 -1
- package/dist/backoff-policies/linear-backoff/linear-backoff.js.map +1 -1
- package/dist/backoff-policies/polynomial-backoff/polynomial-backoff.d.ts +0 -1
- package/dist/backoff-policies/polynomial-backoff/polynomial-backoff.js.map +1 -1
- package/dist/cache/contracts/cache-adapter.contract.d.ts +6 -6
- package/dist/cache/contracts/cache.contract.d.ts +16 -9
- package/dist/cache/contracts/cache.errors.d.ts +1 -4
- package/dist/cache/contracts/cache.errors.js +1 -3
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/contracts/cache.events.d.ts +11 -3
- package/dist/cache/contracts/cache.events.js +1 -1
- package/dist/cache/contracts/cache.events.js.map +1 -1
- package/dist/cache/contracts/database-cache-adapter.contract.d.ts +0 -1
- package/dist/cache/contracts/types.d.ts +0 -2
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +1 -2
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +17 -15
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +0 -2
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +0 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +2 -5
- package/dist/cache/implementations/derivables/cache/cache.js +10 -2
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +0 -2
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +0 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +6 -2
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +0 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +1772 -1735
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker-provider.contract.d.ts +0 -5
- package/dist/circuit-breaker/contracts/circuit-breaker-provider.contract.js +0 -1
- package/dist/circuit-breaker/contracts/circuit-breaker-provider.contract.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker-state.contract.d.ts +0 -2
- package/dist/circuit-breaker/contracts/circuit-breaker-state.contract.js +0 -1
- package/dist/circuit-breaker/contracts/circuit-breaker-state.contract.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker.contract.d.ts +3 -4
- package/dist/circuit-breaker/contracts/circuit-breaker.contract.js +2 -3
- package/dist/circuit-breaker/contracts/circuit-breaker.contract.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker.errors.d.ts +0 -3
- package/dist/circuit-breaker/contracts/circuit-breaker.errors.js +1 -3
- package/dist/circuit-breaker/contracts/circuit-breaker.errors.js.map +1 -1
- package/dist/circuit-breaker/contracts/circuit-breaker.events.d.ts +0 -2
- package/dist/circuit-breaker/contracts/circuit-breaker.events.js +0 -1
- package/dist/circuit-breaker/contracts/circuit-breaker.events.js.map +1 -1
- package/dist/circuit-breaker/implementations/adapters/kysely-circuit-breaker-storage-adapter/kysely-circuit-breaker-storage-adapter.d.ts +2 -2
- package/dist/circuit-breaker/implementations/adapters/kysely-circuit-breaker-storage-adapter/kysely-circuit-breaker-storage-adapter.js +2 -2
- package/dist/circuit-breaker/implementations/adapters/kysely-circuit-breaker-storage-adapter/kysely-circuit-breaker-storage-adapter.js.map +1 -1
- package/dist/circuit-breaker/implementations/adapters/memory-circuit-breaker-storage-adapter/memory-circuit-breaker-storage-adapter.d.ts +2 -3
- package/dist/circuit-breaker/implementations/adapters/memory-circuit-breaker-storage-adapter/memory-circuit-breaker-storage-adapter.js +8 -10
- package/dist/circuit-breaker/implementations/adapters/memory-circuit-breaker-storage-adapter/memory-circuit-breaker-storage-adapter.js.map +1 -1
- package/dist/circuit-breaker/implementations/adapters/mongodb-circuit-breaker-storage-adapter/mongodb-circuit-breaker-storage-adapter.d.ts +2 -2
- package/dist/circuit-breaker/implementations/adapters/mongodb-circuit-breaker-storage-adapter/mongodb-circuit-breaker-storage-adapter.js +2 -2
- package/dist/circuit-breaker/implementations/adapters/mongodb-circuit-breaker-storage-adapter/mongodb-circuit-breaker-storage-adapter.js.map +1 -1
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-adapter/no-op-circuit-breaker-adapter.d.ts +2 -0
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-adapter/no-op-circuit-breaker-adapter.js +2 -0
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-adapter/no-op-circuit-breaker-adapter.js.map +1 -1
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-storage-adapter/no-op-circuit-breaker-storage-adapter.d.ts +2 -0
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-storage-adapter/no-op-circuit-breaker-storage-adapter.js +2 -0
- package/dist/circuit-breaker/implementations/adapters/no-op-circuit-breaker-storage-adapter/no-op-circuit-breaker-storage-adapter.js.map +1 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker-provider.d.ts +2 -4
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker-provider.js.map +1 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker.d.ts +1 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker.js +2 -2
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider/circuit-breaker.js.map +1 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider-factory/circuit-breaker-provider-factory.d.ts +0 -2
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider-factory/circuit-breaker-provider-factory.js.map +1 -1
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider-factory/database-circuit-breaker-provider-factory.d.ts +0 -2
- package/dist/circuit-breaker/implementations/derivables/circuit-breaker-provider-factory/database-circuit-breaker-provider-factory.js.map +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/circuit-breaker-storage-adapter.test-suite.d.ts +0 -1
- package/dist/circuit-breaker/implementations/test-utilities/circuit-breaker-storage-adapter.test-suite.js +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/circuit-breaker-storage-adapter.test-suite.js.map +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/consecutive-breaker.test-suite.d.ts +0 -1
- package/dist/circuit-breaker/implementations/test-utilities/consecutive-breaker.test-suite.js +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/consecutive-breaker.test-suite.js.map +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/count-breaker.test-suite.d.ts +0 -1
- package/dist/circuit-breaker/implementations/test-utilities/count-breaker.test-suite.js +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/count-breaker.test-suite.js.map +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/sampling-breaker.test-suite.d.ts +0 -1
- package/dist/circuit-breaker/implementations/test-utilities/sampling-breaker.test-suite.js +1 -1
- package/dist/circuit-breaker/implementations/test-utilities/sampling-breaker.test-suite.js.map +1 -1
- package/dist/codec/contracts/_module-exports.d.ts +3 -0
- package/dist/codec/contracts/_module-exports.js +2 -0
- package/dist/codec/contracts/_module-exports.js.map +1 -0
- package/dist/codec/contracts/_module.d.ts +4 -0
- package/dist/codec/contracts/_module.js +2 -0
- package/dist/codec/contracts/_module.js.map +1 -0
- package/dist/codec/contracts/codec.contract.d.ts +12 -0
- package/dist/codec/contracts/codec.contract.js +6 -0
- package/dist/codec/contracts/codec.contract.js.map +1 -0
- package/dist/codec/contracts/codec.errors.d.ts +51 -0
- package/dist/codec/contracts/codec.errors.js +64 -0
- package/dist/codec/contracts/codec.errors.js.map +1 -0
- package/dist/codec/contracts/decoder.contract.d.ts +12 -0
- package/dist/codec/contracts/decoder.contract.js +6 -0
- package/dist/codec/contracts/decoder.contract.js.map +1 -0
- package/dist/codec/contracts/encoder.contract.d.ts +12 -0
- package/dist/codec/contracts/encoder.contract.js +6 -0
- package/dist/codec/contracts/encoder.contract.js.map +1 -0
- package/dist/codec/implementations/base-64-codec/_module-exports.d.ts +1 -0
- package/dist/codec/implementations/base-64-codec/_module-exports.js +2 -0
- package/dist/codec/implementations/base-64-codec/_module-exports.js.map +1 -0
- package/dist/codec/implementations/base-64-codec/_module.d.ts +1 -0
- package/dist/codec/implementations/base-64-codec/_module.js +2 -0
- package/dist/codec/implementations/base-64-codec/_module.js.map +1 -0
- package/dist/codec/implementations/base-64-codec/base-64-codec.d.ts +12 -0
- package/dist/codec/implementations/base-64-codec/base-64-codec.js +27 -0
- package/dist/codec/implementations/base-64-codec/base-64-codec.js.map +1 -0
- package/dist/collection/contracts/_shared/compartor.type.d.ts +0 -1
- package/dist/collection/contracts/_shared/cross-join-result.type.d.ts +0 -1
- package/dist/collection/contracts/_shared/ensure-map.type.d.ts +0 -1
- package/dist/collection/contracts/_shared/ensure-record.type.d.ts +0 -1
- package/dist/collection/contracts/_shared/foreach.type.d.ts +0 -2
- package/dist/collection/contracts/_shared/map.type.d.ts +0 -2
- package/dist/collection/contracts/_shared/modifier.type.d.ts +0 -2
- package/dist/collection/contracts/_shared/predicate.type.d.ts +0 -7
- package/dist/collection/contracts/_shared/reduce.type.d.ts +0 -2
- package/dist/collection/contracts/_shared/tap.type.d.ts +0 -2
- package/dist/collection/contracts/_shared/transform.type.d.ts +0 -2
- package/dist/collection/contracts/async-collection.contract.d.ts +0 -1
- package/dist/collection/contracts/collection.contract.d.ts +0 -2
- package/dist/collection/contracts/collection.errors.d.ts +0 -1
- package/dist/collection/contracts/collection.errors.js +0 -1
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -4
- package/dist/event-bus/contracts/event-bus.contract.d.ts +0 -4
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +7 -9
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +1 -1
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +1 -1
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +0 -1
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +2 -5
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +0 -2
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +0 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +0 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/file-size/contracts/_module-exports.d.ts +1 -0
- package/dist/file-size/contracts/_module-exports.js +2 -0
- package/dist/file-size/contracts/_module-exports.js.map +1 -0
- package/dist/file-size/contracts/_module.d.ts +1 -0
- package/dist/file-size/contracts/_module.js +2 -0
- package/dist/file-size/contracts/_module.js.map +1 -0
- package/dist/file-size/contracts/file-size.contract.d.ts +17 -0
- package/dist/file-size/contracts/file-size.contract.js +9 -0
- package/dist/file-size/contracts/file-size.contract.js.map +1 -0
- package/dist/file-size/implementations/_module-exports.d.ts +1 -0
- package/dist/file-size/implementations/_module-exports.js +2 -0
- package/dist/file-size/implementations/_module-exports.js.map +1 -0
- package/dist/file-size/implementations/_module.d.ts +1 -0
- package/dist/file-size/implementations/_module.js +2 -0
- package/dist/file-size/implementations/_module.js.map +1 -0
- package/dist/file-size/implementations/file-size.d.ts +50 -0
- package/dist/file-size/implementations/file-size.js +89 -0
- package/dist/file-size/implementations/file-size.js.map +1 -0
- package/dist/file-storage/contracts/_module-exports.d.ts +7 -0
- package/dist/file-storage/contracts/_module-exports.js +4 -0
- package/dist/file-storage/contracts/_module-exports.js.map +1 -0
- package/dist/file-storage/contracts/_module.d.ts +7 -0
- package/dist/file-storage/contracts/_module.js +4 -0
- package/dist/file-storage/contracts/_module.js.map +1 -0
- package/dist/file-storage/contracts/file-storage-adapter.contract.d.ts +180 -0
- package/dist/file-storage/contracts/file-storage-adapter.contract.js +13 -0
- package/dist/file-storage/contracts/file-storage-adapter.contract.js.map +1 -0
- package/dist/file-storage/contracts/file-storage-factory.contract.d.ts +19 -0
- package/dist/file-storage/contracts/file-storage-factory.contract.js +10 -0
- package/dist/file-storage/contracts/file-storage-factory.contract.js.map +1 -0
- package/dist/file-storage/contracts/file-storage.contract.d.ts +37 -0
- package/dist/file-storage/contracts/file-storage.contract.js +8 -0
- package/dist/file-storage/contracts/file-storage.contract.js.map +1 -0
- package/dist/file-storage/contracts/file.contract.d.ts +224 -0
- package/dist/file-storage/contracts/file.contract.js +10 -0
- package/dist/file-storage/contracts/file.contract.js.map +1 -0
- package/dist/file-storage/contracts/file.errors.d.ts +68 -0
- package/dist/file-storage/contracts/file.errors.js +86 -0
- package/dist/file-storage/contracts/file.errors.js.map +1 -0
- package/dist/file-storage/contracts/file.events.d.ts +135 -0
- package/dist/file-storage/contracts/file.events.js +23 -0
- package/dist/file-storage/contracts/file.events.js.map +1 -0
- package/dist/file-storage/contracts/types.d.ts +9 -0
- package/dist/file-storage/contracts/types.js +5 -0
- package/dist/file-storage/contracts/types.js.map +1 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module-exports.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module-exports.js +2 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module.js +2 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/_module.js.map +1 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/fs-file-storage-adapter.d.ts +82 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/fs-file-storage-adapter.js +302 -0
- package/dist/file-storage/implementations/adapters/fs-file-storage-adapter/fs-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module-exports.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module-exports.js +2 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module.js +2 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/_module.js.map +1 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/memory-file-storage-adapter.d.ts +58 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/memory-file-storage-adapter.js +254 -0
- package/dist/file-storage/implementations/adapters/memory-file-storage-adapter/memory-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module-exports.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module-exports.js +2 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module.js +2 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/_module.js.map +1 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/no-op-file-storage-adapter.d.ts +31 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/no-op-file-storage-adapter.js +70 -0
- package/dist/file-storage/implementations/adapters/no-op-file-storage-adapter/no-op-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module-exports.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module-exports.js +2 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module.d.ts +1 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module.js +2 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/_module.js.map +1 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/s3-file-storage-adapter.d.ts +137 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/s3-file-storage-adapter.js +512 -0
- package/dist/file-storage/implementations/adapters/s3-file-storage-adapter/s3-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/_module-exports.d.ts +2 -0
- package/dist/file-storage/implementations/derivables/_module-exports.js +3 -0
- package/dist/file-storage/implementations/derivables/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/derivables/_module.d.ts +2 -0
- package/dist/file-storage/implementations/derivables/_module.js +3 -0
- package/dist/file-storage/implementations/derivables/_module.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/_module.d.ts +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/_module.js +2 -0
- package/dist/file-storage/implementations/derivables/file-storage/_module.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-serde-transformer.d.ts +48 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-serde-transformer.js +87 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-serde-transformer.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-storage.d.ts +163 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-storage.js +185 -0
- package/dist/file-storage/implementations/derivables/file-storage/file-storage.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/file.d.ts +114 -0
- package/dist/file-storage/implementations/derivables/file-storage/file.js +722 -0
- package/dist/file-storage/implementations/derivables/file-storage/file.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/is-signed-file-storage-adapter.d.ts +8 -0
- package/dist/file-storage/implementations/derivables/file-storage/is-signed-file-storage-adapter.js +62 -0
- package/dist/file-storage/implementations/derivables/file-storage/is-signed-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/merged-file-url-adapter.d.ts +15 -0
- package/dist/file-storage/implementations/derivables/file-storage/merged-file-url-adapter.js +34 -0
- package/dist/file-storage/implementations/derivables/file-storage/merged-file-url-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/no-op-file-url-adapter.d.ts +12 -0
- package/dist/file-storage/implementations/derivables/file-storage/no-op-file-url-adapter.js +19 -0
- package/dist/file-storage/implementations/derivables/file-storage/no-op-file-url-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-content.d.ts +8 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-content.js +18 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-content.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-storage-adapter.d.ts +8 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-storage-adapter.js +16 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-stream.d.ts +12 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-stream.js +20 -0
- package/dist/file-storage/implementations/derivables/file-storage/resolve-file-stream.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage/signed-file-storage-adapter.d.ts +31 -0
- package/dist/file-storage/implementations/derivables/file-storage/signed-file-storage-adapter.js +74 -0
- package/dist/file-storage/implementations/derivables/file-storage/signed-file-storage-adapter.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/_module.d.ts +1 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/_module.js +2 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/_module.js.map +1 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/file-storage-factory.d.ts +59 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/file-storage-factory.js +113 -0
- package/dist/file-storage/implementations/derivables/file-storage-factory/file-storage-factory.js.map +1 -0
- package/dist/file-storage/implementations/test-utilities/_module-exports.d.ts +2 -0
- package/dist/file-storage/implementations/test-utilities/_module-exports.js +3 -0
- package/dist/file-storage/implementations/test-utilities/_module-exports.js.map +1 -0
- package/dist/file-storage/implementations/test-utilities/_module.d.ts +2 -0
- package/dist/file-storage/implementations/test-utilities/_module.js +3 -0
- package/dist/file-storage/implementations/test-utilities/_module.js.map +1 -0
- package/dist/file-storage/implementations/test-utilities/file-storage-adapter.test-suite.d.ts +28 -0
- package/dist/file-storage/implementations/test-utilities/file-storage-adapter.test-suite.js +1637 -0
- package/dist/file-storage/implementations/test-utilities/file-storage-adapter.test-suite.js.map +1 -0
- package/dist/file-storage/implementations/test-utilities/file-storage.test-suite.d.ts +36 -0
- package/dist/file-storage/implementations/test-utilities/file-storage.test-suite.js +3109 -0
- package/dist/file-storage/implementations/test-utilities/file-storage.test-suite.js.map +1 -0
- package/dist/hooks/async-hooks.d.ts +0 -8
- package/dist/hooks/async-hooks.js.map +1 -1
- package/dist/hooks/hooks.d.ts +0 -6
- package/dist/hooks/hooks.js.map +1 -1
- package/dist/hooks/types.d.ts +0 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -3
- package/dist/lock/contracts/lock-provider.contract.d.ts +0 -2
- package/dist/lock/contracts/lock-state.contract.d.ts +0 -6
- package/dist/lock/contracts/lock-state.contract.js +0 -1
- package/dist/lock/contracts/lock-state.contract.js.map +1 -1
- package/dist/lock/contracts/lock.contract.d.ts +3 -6
- package/dist/lock/contracts/lock.contract.js +2 -1
- package/dist/lock/contracts/lock.contract.js.map +1 -1
- package/dist/lock/contracts/lock.errors.d.ts +0 -3
- package/dist/lock/contracts/lock.errors.js +0 -2
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.d.ts +0 -3
- package/dist/lock/contracts/lock.events.js +0 -1
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/contracts/types.d.ts +0 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -3
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +1 -2
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +19 -24
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +0 -2
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +0 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +2 -4
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +4 -4
- package/dist/lock/implementations/derivables/lock-provider/lock.js +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +0 -2
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +0 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +0 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +0 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/namespace/contracts/namespace.contract.d.ts +19 -2
- package/dist/namespace/contracts/namespace.contract.js +1 -1
- package/dist/namespace/contracts/namespace.contract.js.map +1 -1
- package/dist/namespace/implementations/namespace.js +3 -0
- package/dist/namespace/implementations/namespace.js.map +1 -1
- package/dist/namespace/implementations/no-op-namespace.d.ts +1 -1
- package/dist/namespace/implementations/no-op-namespace.js +4 -1
- package/dist/namespace/implementations/no-op-namespace.js.map +1 -1
- package/dist/rate-limiter/contracts/rate-limiter-adapter.contract.d.ts +0 -1
- package/dist/rate-limiter/contracts/rate-limiter-provider.contract.d.ts +0 -1
- package/dist/rate-limiter/contracts/rate-limiter-state.contract.d.ts +0 -6
- package/dist/rate-limiter/contracts/rate-limiter-state.contract.js +0 -1
- package/dist/rate-limiter/contracts/rate-limiter-state.contract.js.map +1 -1
- package/dist/rate-limiter/contracts/rate-limiter-storage-adapter.contract.d.ts +0 -1
- package/dist/rate-limiter/contracts/rate-limiter.contract.d.ts +3 -4
- package/dist/rate-limiter/contracts/rate-limiter.contract.js +2 -1
- package/dist/rate-limiter/contracts/rate-limiter.contract.js.map +1 -1
- package/dist/rate-limiter/contracts/rate-limiter.errors.d.ts +7 -3
- package/dist/rate-limiter/contracts/rate-limiter.errors.js +9 -2
- package/dist/rate-limiter/contracts/rate-limiter.errors.js.map +1 -1
- package/dist/rate-limiter/contracts/rate-limiter.events.d.ts +0 -2
- package/dist/rate-limiter/contracts/rate-limiter.events.js +0 -1
- package/dist/rate-limiter/contracts/rate-limiter.events.js.map +1 -1
- package/dist/rate-limiter/implementations/adapters/memory-rate-limiter-storage-adapter/memory-rate-limiter-storage-adapter.d.ts +2 -1
- package/dist/rate-limiter/implementations/adapters/memory-rate-limiter-storage-adapter/memory-rate-limiter-storage-adapter.js +13 -12
- package/dist/rate-limiter/implementations/adapters/memory-rate-limiter-storage-adapter/memory-rate-limiter-storage-adapter.js.map +1 -1
- package/dist/rate-limiter/implementations/adapters/mongodb-rate-limiter-storage-adapter/mongodb-rate-limiter-storage-adapter.d.ts +1 -1
- package/dist/rate-limiter/implementations/adapters/mongodb-rate-limiter-storage-adapter/mongodb-rate-limiter-storage-adapter.js +1 -1
- package/dist/rate-limiter/implementations/adapters/mongodb-rate-limiter-storage-adapter/mongodb-rate-limiter-storage-adapter.js.map +1 -1
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-adapter/no-op-rate-limiter-adapter.d.ts +2 -0
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-adapter/no-op-rate-limiter-adapter.js +2 -0
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-adapter/no-op-rate-limiter-adapter.js.map +1 -1
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-storage-adapter/no-op-rate-limiter-storage-adapter.d.ts +2 -0
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-storage-adapter/no-op-rate-limiter-storage-adapter.js +2 -0
- package/dist/rate-limiter/implementations/adapters/no-op-rate-limiter-storage-adapter/no-op-rate-limiter-storage-adapter.js.map +1 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter-provider.d.ts +2 -4
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter-provider.js.map +1 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter.d.ts +1 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter.js +6 -6
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider/rate-limiter.js.map +1 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider-factory/database-rate-limiter-provider-factory.d.ts +0 -2
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider-factory/database-rate-limiter-provider-factory.js.map +1 -1
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider-factory/rate-limiter-provider-factory.d.ts +0 -2
- package/dist/rate-limiter/implementations/derivables/rate-limiter-provider-factory/rate-limiter-provider-factory.js.map +1 -1
- package/dist/rate-limiter/implementations/test-utilities/fixed-window-limiter.test-suite.d.ts +0 -1
- package/dist/rate-limiter/implementations/test-utilities/fixed-window-limiter.test-suite.js +1 -1
- package/dist/rate-limiter/implementations/test-utilities/fixed-window-limiter.test-suite.js.map +1 -1
- package/dist/rate-limiter/implementations/test-utilities/rate-limiter-storage-adapter.test-suite.d.ts +0 -1
- package/dist/rate-limiter/implementations/test-utilities/rate-limiter-storage-adapter.test-suite.js +1 -1
- package/dist/rate-limiter/implementations/test-utilities/rate-limiter-storage-adapter.test-suite.js.map +1 -1
- package/dist/rate-limiter/implementations/test-utilities/sliding-window-limiter.test-suite.d.ts +0 -1
- package/dist/rate-limiter/implementations/test-utilities/sliding-window-limiter.test-suite.js +1 -1
- package/dist/rate-limiter/implementations/test-utilities/sliding-window-limiter.test-suite.js.map +1 -1
- package/dist/resilience/middlewares/fallback/fallback.types.d.ts +0 -4
- package/dist/resilience/middlewares/observe/observe.types.d.ts +0 -9
- package/dist/resilience/middlewares/retry/retry.types.d.ts +0 -6
- package/dist/resilience/middlewares/timeout/timeout.type.d.ts +0 -4
- package/dist/resilience/resilience.errors.d.ts +0 -5
- package/dist/resilience/resilience.errors.js +0 -4
- package/dist/resilience/resilience.errors.js.map +1 -1
- package/dist/semaphore/contracts/semaphore-adapter.contract.d.ts +0 -2
- package/dist/semaphore/contracts/semaphore-provider.contract.d.ts +0 -2
- package/dist/semaphore/contracts/semaphore-state.contract.d.ts +0 -7
- package/dist/semaphore/contracts/semaphore-state.contract.js +0 -1
- package/dist/semaphore/contracts/semaphore-state.contract.js.map +1 -1
- package/dist/semaphore/contracts/semaphore.contract.d.ts +3 -6
- package/dist/semaphore/contracts/semaphore.contract.js +2 -1
- package/dist/semaphore/contracts/semaphore.contract.js.map +1 -1
- package/dist/semaphore/contracts/semaphore.errors.d.ts +0 -3
- package/dist/semaphore/contracts/semaphore.errors.js +0 -2
- package/dist/semaphore/contracts/semaphore.errors.js.map +1 -1
- package/dist/semaphore/contracts/semaphore.events.d.ts +0 -3
- package/dist/semaphore/contracts/semaphore.events.js +0 -1
- package/dist/semaphore/contracts/semaphore.events.js.map +1 -1
- package/dist/semaphore/contracts/types.d.ts +0 -1
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.d.ts +0 -4
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js.map +1 -1
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.d.ts +1 -2
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js +18 -23
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js.map +1 -1
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.d.ts +0 -3
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js.map +1 -1
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.d.ts +1 -1
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js +1 -1
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.d.ts +2 -4
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js.map +1 -1
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.js.map +1 -1
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.d.ts +3 -3
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js +2 -2
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js.map +1 -1
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.d.ts +0 -2
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js.map +1 -1
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.d.ts +0 -1
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js +1 -1
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js.map +1 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.d.ts +0 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js +1 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js.map +1 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.d.ts +0 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js +1 -1
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js.map +1 -1
- package/dist/serde/contracts/flexible-serde-adapter.contract.d.ts +0 -1
- package/dist/serde/contracts/flexible-serde.contract.d.ts +0 -2
- package/dist/serde/contracts/serde.errors.d.ts +1 -4
- package/dist/serde/contracts/serde.errors.js +0 -2
- package/dist/serde/contracts/serde.errors.js.map +1 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +1 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +0 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +0 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/derivables/serde-transformers.d.ts +1 -0
- package/dist/serde/implementations/derivables/serde-transformers.js +1 -0
- package/dist/serde/implementations/derivables/serde-transformers.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +0 -2
- package/dist/serde/implementations/derivables/serde.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +0 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +0 -1
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +1 -0
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js.map +1 -1
- package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.d.ts +0 -3
- package/dist/shared-lock/contracts/shared-lock-adapter.contract.d.ts +0 -1
- package/dist/shared-lock/contracts/shared-lock-provider.contract.d.ts +0 -2
- package/dist/shared-lock/contracts/shared-lock-state.contract.d.ts +0 -15
- package/dist/shared-lock/contracts/shared-lock-state.contract.js +0 -3
- package/dist/shared-lock/contracts/shared-lock-state.contract.js.map +1 -1
- package/dist/shared-lock/contracts/shared-lock.contract.d.ts +3 -8
- package/dist/shared-lock/contracts/shared-lock.contract.js +2 -1
- package/dist/shared-lock/contracts/shared-lock.contract.js.map +1 -1
- package/dist/shared-lock/contracts/shared-lock.errors.d.ts +0 -9
- package/dist/shared-lock/contracts/shared-lock.errors.js +0 -6
- package/dist/shared-lock/contracts/shared-lock.errors.js.map +1 -1
- package/dist/shared-lock/contracts/shared-lock.events.d.ts +0 -7
- package/dist/shared-lock/contracts/shared-lock.events.js +0 -3
- package/dist/shared-lock/contracts/shared-lock.events.js.map +1 -1
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.d.ts +0 -5
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js.map +1 -1
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.d.ts +1 -4
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js +42 -52
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js.map +1 -1
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.d.ts +0 -5
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js.map +1 -1
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.d.ts +1 -1
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js +1 -1
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts +2 -4
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map +1 -1
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js.map +1 -1
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.d.ts +5 -5
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js +12 -12
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js.map +1 -1
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.d.ts +0 -2
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js.map +1 -1
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.d.ts +0 -1
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js +1 -1
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js.map +1 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.d.ts +0 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js +1 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js.map +1 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.d.ts +0 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js +1 -1
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js.map +1 -1
- package/dist/task/implementations/task.js +0 -1
- package/dist/task/implementations/task.js.map +1 -1
- package/dist/time-span/contracts/time-span.contract.d.ts +0 -1
- package/dist/time-span/contracts/time-span.contract.js +0 -1
- package/dist/time-span/contracts/time-span.contract.js.map +1 -1
- package/dist/time-span/implementations/time-span.d.ts +1 -3
- package/dist/time-span/implementations/time-span.js +1 -1
- package/dist/time-span/implementations/time-span.js.map +1 -1
- package/dist/utilities/contracts/comparable.contract.d.ts +0 -6
- package/dist/utilities/contracts/deinitizable.contract.d.ts +0 -1
- package/dist/utilities/contracts/initizable.contract.d.ts +0 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +0 -1
- package/dist/utilities/contracts/sqlite-database.contract.d.ts +0 -2
- package/dist/utilities/errors.d.ts +0 -1
- package/dist/utilities/errors.js +0 -1
- package/dist/utilities/errors.js.map +1 -1
- package/dist/utilities/functions/error-policy.d.ts +0 -2
- package/dist/utilities/functions/error-policy.js.map +1 -1
- package/dist/utilities/functions/invokable.d.ts +0 -4
- package/dist/utilities/functions/invokable.js.map +1 -1
- package/dist/utilities/functions/is-positive-nbr.d.ts +0 -1
- package/dist/utilities/functions/is-positive-nbr.js +0 -1
- package/dist/utilities/functions/is-positive-nbr.js.map +1 -1
- package/dist/utilities/functions/iterable-to-async-iterable.js +1 -2
- package/dist/utilities/functions/iterable-to-async-iterable.js.map +1 -1
- package/dist/utilities/functions/lazy.d.ts +0 -5
- package/dist/utilities/functions/lazy.js.map +1 -1
- package/dist/utilities/functions/object.js +2 -6
- package/dist/utilities/functions/object.js.map +1 -1
- package/dist/utilities/functions/resolve-one-or-more.d.ts +0 -1
- package/dist/utilities/functions/resolve-one-or-more.js.map +1 -1
- package/dist/utilities/types/async-iterable-value.type.d.ts +0 -2
- package/dist/utilities/types/none-func.type.d.ts +0 -1
- package/dist/utilities/types/promiseable.type.d.ts +0 -1
- package/package.json +15 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileSize
|
|
3
|
+
*/
|
|
4
|
+
import { TO_BYTES } from "../../file-size/contracts/_module.js";
|
|
5
|
+
import {} from "../../serde/contracts/_module.js";
|
|
6
|
+
import {} from "../../utilities/_module.js";
|
|
7
|
+
/**
|
|
8
|
+
* The `FileSize` class is used for representing file size.
|
|
9
|
+
* `FileSize` class cannot be negative, if you pass negative number it will be converted to 0.
|
|
10
|
+
*
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-size"`
|
|
12
|
+
* @group Implementations
|
|
13
|
+
*/
|
|
14
|
+
export class FileSize {
|
|
15
|
+
fileSizeInBytes;
|
|
16
|
+
static kbInBytes = 1000;
|
|
17
|
+
static mbInBytes = 1000 * FileSize.kbInBytes;
|
|
18
|
+
static gbInBytes = 1000 * FileSize.mbInBytes;
|
|
19
|
+
static tbInBytes = 1000 * FileSize.gbInBytes;
|
|
20
|
+
static pbInBytes = 1000 * FileSize.tbInBytes;
|
|
21
|
+
static deserialize(serializedValue) {
|
|
22
|
+
return new FileSize(serializedValue.fileSizeInBytes);
|
|
23
|
+
}
|
|
24
|
+
static fromBytes(bytes) {
|
|
25
|
+
return new FileSize(bytes);
|
|
26
|
+
}
|
|
27
|
+
static fromKiloBytes(kiloBytes) {
|
|
28
|
+
return new FileSize(kiloBytes * FileSize.kbInBytes);
|
|
29
|
+
}
|
|
30
|
+
static fromMegaBytes(megaBytes) {
|
|
31
|
+
return new FileSize(megaBytes * FileSize.mbInBytes);
|
|
32
|
+
}
|
|
33
|
+
static fromGigaBytes(gigaBytes) {
|
|
34
|
+
return new FileSize(gigaBytes * FileSize.gbInBytes);
|
|
35
|
+
}
|
|
36
|
+
static fromTeraBytes(teraBytes) {
|
|
37
|
+
return new FileSize(teraBytes * FileSize.tbInBytes);
|
|
38
|
+
}
|
|
39
|
+
static fromPetaBytes(petaBytes) {
|
|
40
|
+
return new FileSize(petaBytes * FileSize.pbInBytes);
|
|
41
|
+
}
|
|
42
|
+
constructor(fileSizeInBytes) {
|
|
43
|
+
this.fileSizeInBytes = fileSizeInBytes;
|
|
44
|
+
this.fileSizeInBytes = Math.max(0, this.fileSizeInBytes);
|
|
45
|
+
}
|
|
46
|
+
[TO_BYTES]() {
|
|
47
|
+
return this.fileSizeInBytes;
|
|
48
|
+
}
|
|
49
|
+
equals(value) {
|
|
50
|
+
return value[TO_BYTES]() === this.toBytes();
|
|
51
|
+
}
|
|
52
|
+
gt(value) {
|
|
53
|
+
return value[TO_BYTES]() < this.toBytes();
|
|
54
|
+
}
|
|
55
|
+
gte(value) {
|
|
56
|
+
return value[TO_BYTES]() <= this.toBytes();
|
|
57
|
+
}
|
|
58
|
+
lt(value) {
|
|
59
|
+
return value[TO_BYTES]() > this.toBytes();
|
|
60
|
+
}
|
|
61
|
+
lte(value) {
|
|
62
|
+
return value[TO_BYTES]() >= this.toBytes();
|
|
63
|
+
}
|
|
64
|
+
serialize() {
|
|
65
|
+
return {
|
|
66
|
+
version: "1",
|
|
67
|
+
fileSizeInBytes: this.fileSizeInBytes,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
toBytes() {
|
|
71
|
+
return this[TO_BYTES]();
|
|
72
|
+
}
|
|
73
|
+
toKiloBytes() {
|
|
74
|
+
return Math.floor(this.toBytes() / FileSize.kbInBytes);
|
|
75
|
+
}
|
|
76
|
+
toMegaBytes() {
|
|
77
|
+
return Math.floor(this.toBytes() / FileSize.mbInBytes);
|
|
78
|
+
}
|
|
79
|
+
toGigaBytes() {
|
|
80
|
+
return Math.floor(this.toBytes() / FileSize.gbInBytes);
|
|
81
|
+
}
|
|
82
|
+
toTeraBytes() {
|
|
83
|
+
return Math.floor(this.toBytes() / FileSize.tbInBytes);
|
|
84
|
+
}
|
|
85
|
+
toPetaBytes() {
|
|
86
|
+
return Math.floor(this.toBytes() / FileSize.pbInBytes);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=file-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-size.js","sourceRoot":"","sources":["../../../src/file-size/implementations/file-size.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAkB,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAoB,MAAM,wBAAwB,CAAC;AAW1D;;;;;;GAMG;AACH,MAAM,OAAO,QAAQ;IAwCoB;IAlC7B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC7C,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC7C,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC7C,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC;IAErD,MAAM,CAAC,WAAW,CAAC,eAAmC;QAClD,OAAO,IAAI,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,KAAa;QAC1B,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAiB;QAClC,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAiB;QAClC,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAiB;QAClC,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAiB;QAClC,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,SAAiB;QAClC,OAAO,IAAI,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,YAAqC,eAAuB;QAAvB,oBAAe,GAAf,eAAe,CAAQ;QACxD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;IAED,CAAC,QAAQ,CAAC;QACN,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAgB;QACnB,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IAED,EAAE,CAAC,KAAgB;QACf,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,CAAC;IAED,GAAG,CAAC,KAAgB;QAChB,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,EAAE,CAAC,KAAgB;QACf,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,CAAC;IAED,GAAG,CAAC,KAAgB;QAChB,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,SAAS;QACL,OAAO;YACH,OAAO,EAAE,GAAG;YACZ,eAAe,EAAE,IAAI,CAAC,eAAe;SACxC,CAAC;IACN,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC5B,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../../file-storage/contracts/file-storage-adapter.contract.js";
|
|
2
|
+
export type * from "../../file-storage/contracts/file-storage-factory.contract.js";
|
|
3
|
+
export type * from "../../file-storage/contracts/file-storage.contract.js";
|
|
4
|
+
export type * from "../../file-storage/contracts/file.contract.js";
|
|
5
|
+
export * from "../../file-storage/contracts/file.errors.js";
|
|
6
|
+
export * from "../../file-storage/contracts/file.events.js";
|
|
7
|
+
export type * from "../../file-storage/contracts/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,2DAA2D,CAAC;AAI1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../../file-storage/contracts/file-storage-adapter.contract.js";
|
|
2
|
+
export type * from "../../file-storage/contracts/file-storage-factory.contract.js";
|
|
3
|
+
export type * from "../../file-storage/contracts/file-storage.contract.js";
|
|
4
|
+
export type * from "../../file-storage/contracts/file.contract.js";
|
|
5
|
+
export * from "../../file-storage/contracts/file.errors.js";
|
|
6
|
+
export * from "../../file-storage/contracts/file.events.js";
|
|
7
|
+
export type * from "../../file-storage/contracts/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,2DAA2D,CAAC;AAI1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
6
|
+
* @group Contracts
|
|
7
|
+
*/
|
|
8
|
+
export type FileAdapterSignedDownloadUrlSettings = {
|
|
9
|
+
expirationInSeconds: number;
|
|
10
|
+
contentType: string | null;
|
|
11
|
+
contentDisposition: string | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
15
|
+
* @group Contracts
|
|
16
|
+
*/
|
|
17
|
+
export type FileAdapterSignedUploadUrlSettings = {
|
|
18
|
+
expirationInSeconds: number;
|
|
19
|
+
contentType: string | null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The `IFileUrlAdapter` contract defines a way for creating temporary signed url for uploading and downloading files. It also allows for creating public url for files.
|
|
23
|
+
*
|
|
24
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
25
|
+
* @group Contracts
|
|
26
|
+
*/
|
|
27
|
+
export type IFileUrlAdapter = {
|
|
28
|
+
getPublicUrl(key: string): Promise<string | null>;
|
|
29
|
+
getSignedDownloadUrl(key: string, settings: FileAdapterSignedDownloadUrlSettings): Promise<string | null>;
|
|
30
|
+
getSignedUploadUrl(key: string, settings: FileAdapterSignedUploadUrlSettings): Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
34
|
+
* @group Contracts
|
|
35
|
+
*/
|
|
36
|
+
export type FileAdapterMetadata = {
|
|
37
|
+
etag: string;
|
|
38
|
+
contentType: string;
|
|
39
|
+
fileSizeInBytes: number;
|
|
40
|
+
/**
|
|
41
|
+
* This field tracks the file's creation date and its last modified date.
|
|
42
|
+
*/
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
47
|
+
* @group Contracts
|
|
48
|
+
*/
|
|
49
|
+
export type FileAdapterStream = AsyncIterable<Uint8Array>;
|
|
50
|
+
/**
|
|
51
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
52
|
+
* @group Contracts
|
|
53
|
+
*/
|
|
54
|
+
export type WritableFileAdapterCommonSettings = {
|
|
55
|
+
contentType: string;
|
|
56
|
+
contentLanguage: string | null;
|
|
57
|
+
contentEncoding: string | null;
|
|
58
|
+
contentDisposition: string | null;
|
|
59
|
+
cacheControl: string | null;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
63
|
+
* @group Contracts
|
|
64
|
+
*/
|
|
65
|
+
export type WritableFileAdapterContent = WritableFileAdapterCommonSettings & {
|
|
66
|
+
data: Uint8Array;
|
|
67
|
+
fileSizeInBytes: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
71
|
+
* @group Contracts
|
|
72
|
+
*/
|
|
73
|
+
export type WritableFileAdapterStream = WritableFileAdapterCommonSettings & {
|
|
74
|
+
data: FileAdapterStream;
|
|
75
|
+
fileSizeInBytes: number | null;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
79
|
+
* @group Contracts
|
|
80
|
+
*/
|
|
81
|
+
export declare const FILE_WRITE_ENUM: {
|
|
82
|
+
readonly SUCCESS: "SUCCESS";
|
|
83
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
84
|
+
readonly KEY_EXISTS: "KEY_EXISTS";
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
88
|
+
* @group Contracts
|
|
89
|
+
*/
|
|
90
|
+
export type FileWriteEnum = (typeof FILE_WRITE_ENUM)[keyof typeof FILE_WRITE_ENUM];
|
|
91
|
+
/**
|
|
92
|
+
* The `IFileStorageAdapter` contract defines a way for storing files independent of storage.
|
|
93
|
+
*
|
|
94
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
95
|
+
* @group Contracts
|
|
96
|
+
*/
|
|
97
|
+
export type IFileStorageAdapter = {
|
|
98
|
+
exists(key: string): Promise<boolean>;
|
|
99
|
+
/**
|
|
100
|
+
* The `getStream` method returns the file as stream when `key` is found otherwise null will be returned.
|
|
101
|
+
*/
|
|
102
|
+
getStream(key: string): Promise<FileAdapterStream | null>;
|
|
103
|
+
/**
|
|
104
|
+
* The `getBytes` method returns the file as bytes when `key` is found otherwise null will be returned.
|
|
105
|
+
*/
|
|
106
|
+
getBytes(key: string): Promise<Uint8Array | null>;
|
|
107
|
+
/**
|
|
108
|
+
* The `getMetaData` method returns the file metadata when `key` is found otherwise null will be returned.
|
|
109
|
+
*/
|
|
110
|
+
getMetaData(key: string): Promise<FileAdapterMetadata | null>;
|
|
111
|
+
/**
|
|
112
|
+
* The `add` method adds the file as bytes when `key` doesn't exists. Returns `true` when key doesn't exists otherwise `false` will be returned.
|
|
113
|
+
*/
|
|
114
|
+
add(key: string, content: WritableFileAdapterContent): Promise<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* The `addStream` method adds the file as streaming when `key` doesn't exists. Returns `true` when key doesn't exists otherwise `false` will be returned.
|
|
117
|
+
*/
|
|
118
|
+
addStream(key: string, stream: WritableFileAdapterStream): Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* The `update` method updates the file by bytes. Returns `true` if the `key` where updated otherwise `false` will be returned.
|
|
121
|
+
*/
|
|
122
|
+
update(key: string, content: WritableFileAdapterContent): Promise<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* The `updateStream` method updates the file by stream. Returns `true` if the `key` where updated otherwise `false` will be returned.
|
|
125
|
+
*/
|
|
126
|
+
updateStream(key: string, stream: WritableFileAdapterStream): Promise<boolean>;
|
|
127
|
+
/**
|
|
128
|
+
* The `put` methods upsert the given key with file bytes.
|
|
129
|
+
* Returns `true` when the key was updated otherwise `false` is returned.
|
|
130
|
+
*/
|
|
131
|
+
put(key: string, content: WritableFileAdapterContent): Promise<boolean>;
|
|
132
|
+
/**
|
|
133
|
+
* The `putStream` methods upsert the given key with file stream.
|
|
134
|
+
* Returns `true` when the key was updated otherwise `false` is returned.
|
|
135
|
+
*/
|
|
136
|
+
putStream(key: string, stream: WritableFileAdapterStream): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* The `copy` methods copies the `source` file to the given `destination` when it doesnt exists.
|
|
139
|
+
*
|
|
140
|
+
* Returns
|
|
141
|
+
* - `FILE_WRITE_ENUM.SUCCESS` when file successfully copied.
|
|
142
|
+
* - `FILE_WRITE_ENUM.NOT_FOUND` when `source` file is not found.
|
|
143
|
+
* - `FILE_WRITE_ENUM.KEY_EXISTS` when `destination` file already exists.
|
|
144
|
+
*/
|
|
145
|
+
copy(source: string, destination: string): Promise<FileWriteEnum>;
|
|
146
|
+
/**
|
|
147
|
+
* The `copyAndReplace` methods copies the `source` file to the given `destination`. The `destination` file will always be replaces.
|
|
148
|
+
* Returns `true` if the `source` is found otherwise `false` is returned.
|
|
149
|
+
*/
|
|
150
|
+
copyAndReplace(source: string, destination: string): Promise<boolean>;
|
|
151
|
+
/**
|
|
152
|
+
* The `move` methods moves the `source` file to the given `destination` when it doesnt exists.
|
|
153
|
+
*
|
|
154
|
+
* Returns
|
|
155
|
+
* - `FILE_WRITE_ENUM.SUCCESS` when file successfully moved.
|
|
156
|
+
* - `FILE_WRITE_ENUM.NOT_FOUND` when `source` file is not found.
|
|
157
|
+
* - `FILE_WRITE_ENUM.KEY_EXISTS` when `destination` file already exists.
|
|
158
|
+
*/
|
|
159
|
+
move(source: string, destination: string): Promise<FileWriteEnum>;
|
|
160
|
+
/**
|
|
161
|
+
* The `moveAndReplace` methods moves the `source` file to the given `destination`. The `destination` file will always be replaces.
|
|
162
|
+
* Returns `true` if the `source` is found otherwise `false` is returned.
|
|
163
|
+
*/
|
|
164
|
+
moveAndReplace(source: string, destination: string): Promise<boolean>;
|
|
165
|
+
/**
|
|
166
|
+
* The `removeMany` method removes many keys. Returns `true` if one of the keys where deleted otherwise `false` is returned.
|
|
167
|
+
*/
|
|
168
|
+
removeMany(keys: Array<string>): Promise<boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* The `removeByKeyPrefix` method removes all the keys in the file-storage that starts with the given `prefix`.
|
|
171
|
+
*/
|
|
172
|
+
removeByPrefix(prefix: string): Promise<void>;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* The `ISignedFileStorageAdapter` contract defines a way for storing files independent of storage, creating temporary signed url for uploading and downloading files. It also allows for creating public url for files
|
|
176
|
+
*
|
|
177
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
178
|
+
* @group Contracts
|
|
179
|
+
*/
|
|
180
|
+
export type ISignedFileStorageAdapter = IFileUrlAdapter & IFileStorageAdapter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
6
|
+
* @group Contracts
|
|
7
|
+
*/
|
|
8
|
+
export const FILE_WRITE_ENUM = {
|
|
9
|
+
SUCCESS: "SUCCESS",
|
|
10
|
+
NOT_FOUND: "NOT_FOUND",
|
|
11
|
+
KEY_EXISTS: "KEY_EXISTS",
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=file-storage-adapter.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-storage-adapter.contract.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/file-storage-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AA4FH;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;CAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import { type IFileStorage } from "../../file-storage/contracts/_module.js";
|
|
5
|
+
/**
|
|
6
|
+
* The `IFileStorageFactory` contract makes it easy to configure and switch between different {@link IFileStorage | `IFileStorage`} dynamically.
|
|
7
|
+
*
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
9
|
+
* @group Contracts
|
|
10
|
+
*/
|
|
11
|
+
export type IFileStorageFactory<TAdapters extends string = string> = {
|
|
12
|
+
/**
|
|
13
|
+
* The `use` method will throw an error if you provide it unregisted adapter.
|
|
14
|
+
* If no default adapter is defined an error will be thrown.
|
|
15
|
+
* @throws {UnregisteredAdapterError} {@link UnregisteredAdapterError}
|
|
16
|
+
* @throws {DefaultAdapterNotDefinedError} {@link DefaultAdapterNotDefinedError}
|
|
17
|
+
*/
|
|
18
|
+
use(adapterName?: TAdapters): IFileStorage;
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import {} from "../../file-storage/contracts/_module.js";
|
|
5
|
+
import {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
UnregisteredAdapterError,
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
DefaultAdapterNotDefinedError, } from "../../utilities/_module.js";
|
|
10
|
+
//# sourceMappingURL=file-storage-factory.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-storage-factory.contract.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/file-storage-factory.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO;AACH,6DAA6D;AAC7D,wBAAwB;AACxB,6DAA6D;AAC7D,6BAA6B,GAChC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import { type IEventListenable } from "../../event-bus/contracts/_module.js";
|
|
5
|
+
import { type IFile } from "../../file-storage/contracts/file.contract.js";
|
|
6
|
+
import { type FileEventMap } from "../../file-storage/contracts/file.events.js";
|
|
7
|
+
import { type ITask } from "../../task/contracts/_module.js";
|
|
8
|
+
/**
|
|
9
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
10
|
+
* @group Contracts
|
|
11
|
+
*/
|
|
12
|
+
export type IFileListenable = IEventListenable<FileEventMap>;
|
|
13
|
+
/**
|
|
14
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
15
|
+
* @group Contracts
|
|
16
|
+
*/
|
|
17
|
+
export type IFileProvider = {
|
|
18
|
+
create(key: string): IFile;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
22
|
+
* @group Contracts
|
|
23
|
+
*/
|
|
24
|
+
export type IFileStorageBase = IFileProvider & {
|
|
25
|
+
clear(): ITask<void>;
|
|
26
|
+
removeMany(files: Iterable<IFile>): ITask<boolean>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The `IFileStorage` contract defines a way for managing files independent of the underlying technology.
|
|
30
|
+
* It commes with more convient methods compared to `IFileStorageAdapter`.
|
|
31
|
+
*
|
|
32
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
33
|
+
* @group Contracts
|
|
34
|
+
*/
|
|
35
|
+
export type IFileStorage = IFileStorageBase & {
|
|
36
|
+
readonly events: IFileListenable;
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import {} from "../../event-bus/contracts/_module.js";
|
|
5
|
+
import {} from "../../file-storage/contracts/file.contract.js";
|
|
6
|
+
import {} from "../../file-storage/contracts/file.events.js";
|
|
7
|
+
import {} from "../../task/contracts/_module.js";
|
|
8
|
+
//# sourceMappingURL=file-storage.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-storage.contract.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/file-storage.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAc,MAAM,2CAA2C,CAAC;AACvE,OAAO,EAAqB,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAc,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import { type Readable } from "node:stream";
|
|
5
|
+
import { type IFileSize } from "../../file-size/contracts/_module.js";
|
|
6
|
+
import { type IKey } from "../../namespace/contracts/_module.js";
|
|
7
|
+
import { type ITask } from "../../task/contracts/_module.js";
|
|
8
|
+
import { type ITimeSpan } from "../../time-span/contracts/_module.js";
|
|
9
|
+
/**
|
|
10
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
11
|
+
* @group Contracts
|
|
12
|
+
*/
|
|
13
|
+
export type FileDownloadUrlOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* The ttl of signed url.
|
|
16
|
+
*
|
|
17
|
+
* @default
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { TimeSpan } from "@daiso-tech/time-span"
|
|
20
|
+
*
|
|
21
|
+
* TimeSpan.fromMinutes(10)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
ttl?: ITimeSpan;
|
|
25
|
+
/**
|
|
26
|
+
* The content type will be infered by key.
|
|
27
|
+
*/
|
|
28
|
+
contentType?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* @default null
|
|
31
|
+
*/
|
|
32
|
+
contentDisposition?: string | null;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
36
|
+
* @group Contracts
|
|
37
|
+
*/
|
|
38
|
+
export type FileUploadUrlOptions = {
|
|
39
|
+
/**
|
|
40
|
+
* The ttl of signed url.
|
|
41
|
+
*
|
|
42
|
+
* @default
|
|
43
|
+
* ```ts
|
|
44
|
+
* import { TimeSpan } from "@daiso-tech/time-span"
|
|
45
|
+
*
|
|
46
|
+
* TimeSpan.fromMinutes(10)
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
ttl?: ITimeSpan;
|
|
50
|
+
/**
|
|
51
|
+
* The content type will be infered by key.
|
|
52
|
+
*/
|
|
53
|
+
contentType?: string | null;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
57
|
+
* @group Contracts
|
|
58
|
+
*/
|
|
59
|
+
export type FileMetadata = {
|
|
60
|
+
etag: string;
|
|
61
|
+
contentType: string;
|
|
62
|
+
fileSize: IFileSize;
|
|
63
|
+
updatedAt: Date;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
67
|
+
* @group Contracts
|
|
68
|
+
*/
|
|
69
|
+
export type IReadableFile = {
|
|
70
|
+
readonly key: IKey;
|
|
71
|
+
getText(): ITask<string | null>;
|
|
72
|
+
/**
|
|
73
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
74
|
+
*/
|
|
75
|
+
getTextOrFail(): ITask<string>;
|
|
76
|
+
getBytes(): ITask<Uint8Array | null>;
|
|
77
|
+
/**
|
|
78
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
79
|
+
*/
|
|
80
|
+
getBytesOrFail(): ITask<Uint8Array>;
|
|
81
|
+
getBuffer(): ITask<Buffer | null>;
|
|
82
|
+
/**
|
|
83
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
84
|
+
*/
|
|
85
|
+
getBufferOrFail(): ITask<Buffer>;
|
|
86
|
+
getArrayBuffer(): ITask<ArrayBuffer | null>;
|
|
87
|
+
/**
|
|
88
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
89
|
+
*/
|
|
90
|
+
getArrayBufferOrFail(): ITask<ArrayBuffer>;
|
|
91
|
+
getReadable(): ITask<Readable | null>;
|
|
92
|
+
/**
|
|
93
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
94
|
+
*/
|
|
95
|
+
getReadableOrFail(): ITask<Readable>;
|
|
96
|
+
getReadableStream(): ITask<ReadableStream<Uint8Array> | null>;
|
|
97
|
+
/**
|
|
98
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
99
|
+
*/
|
|
100
|
+
getReadableStreamOrFail(): ITask<ReadableStream<Uint8Array>>;
|
|
101
|
+
getMetadata(): ITask<FileMetadata | null>;
|
|
102
|
+
/**
|
|
103
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
104
|
+
*/
|
|
105
|
+
getMetadataOrFail(): ITask<FileMetadata>;
|
|
106
|
+
exists(): ITask<boolean>;
|
|
107
|
+
missing(): ITask<boolean>;
|
|
108
|
+
getPublicUrl(): ITask<string | null>;
|
|
109
|
+
/**
|
|
110
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
111
|
+
*/
|
|
112
|
+
getPublicUrlOrFail(): ITask<string>;
|
|
113
|
+
getSignedDownloadUrl(options?: FileDownloadUrlOptions): ITask<string | null>;
|
|
114
|
+
/**
|
|
115
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
116
|
+
*/
|
|
117
|
+
getSignedDownloadUrlOrFail(options?: FileUploadUrlOptions): ITask<string>;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
121
|
+
* @group Contracts
|
|
122
|
+
*/
|
|
123
|
+
export type FileContent = string | ArrayBufferLike | ArrayBufferView;
|
|
124
|
+
/**
|
|
125
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
126
|
+
* @group Contracts
|
|
127
|
+
*/
|
|
128
|
+
export type WritableFileCommonSettings = {
|
|
129
|
+
/**
|
|
130
|
+
* You can explicitly set a custom Content-Type. If one is not provided, it will be inferred from the key. For example, a key ending in .txt (such as key-a.txt) will be assigned text/plain.
|
|
131
|
+
* If the key contains a non-standard extension it will default to application/octet-stream.
|
|
132
|
+
*/
|
|
133
|
+
contentType?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Note a default value is always provided. To explicitly unset a field and prevent it from being passed to the underlying adapter, pass in `null`.
|
|
136
|
+
*/
|
|
137
|
+
contentLanguage?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Note a default value is always provided. To explicitly unset a field and prevent it from being passed to the underlying adapter, pass in `null`.
|
|
140
|
+
*/
|
|
141
|
+
contentEncoding?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Note a default value is always provided. To explicitly unset a field and prevent it from being passed to the underlying adapter, pass in `null`.
|
|
144
|
+
*/
|
|
145
|
+
contentDisposition?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Note a default value is always provided. To explicitly unset a field and prevent it from being passed to the underlying adapter, pass in `null`.
|
|
148
|
+
*/
|
|
149
|
+
cacheControl?: string | null;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
153
|
+
* @group Contracts
|
|
154
|
+
*/
|
|
155
|
+
export type WritableFileContent = WritableFileCommonSettings & {
|
|
156
|
+
data: FileContent;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
160
|
+
* @group Contracts
|
|
161
|
+
*/
|
|
162
|
+
export type WritableFileStream = WritableFileCommonSettings & {
|
|
163
|
+
data: AsyncIterable<FileContent>;
|
|
164
|
+
/**
|
|
165
|
+
* @default null
|
|
166
|
+
*/
|
|
167
|
+
fileSize?: IFileSize | null;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* IMPORT_PATH: `"@daiso-tech/core/file-storage/contracts"`
|
|
171
|
+
* @group Contracts
|
|
172
|
+
*/
|
|
173
|
+
export type IFile = IReadableFile & {
|
|
174
|
+
add(content: WritableFileContent): ITask<boolean>;
|
|
175
|
+
/**
|
|
176
|
+
* @throws {KeyExistsFileError} {@link KeyExistsFileError}
|
|
177
|
+
*/
|
|
178
|
+
addOrFail(content: WritableFileContent): ITask<void>;
|
|
179
|
+
addStream(stream: WritableFileStream): ITask<boolean>;
|
|
180
|
+
/**
|
|
181
|
+
* @throws {KeyExistsFileError} {@link KeyExistsFileError}
|
|
182
|
+
*/
|
|
183
|
+
addStreamOrFail(stream: WritableFileStream): ITask<void>;
|
|
184
|
+
update(content: WritableFileContent): ITask<boolean>;
|
|
185
|
+
/**
|
|
186
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
187
|
+
*/
|
|
188
|
+
updateOrFail(content: WritableFileContent): ITask<void>;
|
|
189
|
+
updateStream(stream: WritableFileStream): ITask<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
192
|
+
*/
|
|
193
|
+
updateStreamOrFail(stream: WritableFileStream): ITask<void>;
|
|
194
|
+
put(content: WritableFileContent): ITask<boolean>;
|
|
195
|
+
putStream(stream: WritableFileStream): ITask<boolean>;
|
|
196
|
+
remove(): ITask<boolean>;
|
|
197
|
+
/**
|
|
198
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
199
|
+
*/
|
|
200
|
+
removeOrFail(): ITask<void>;
|
|
201
|
+
copy(destination: string): ITask<boolean>;
|
|
202
|
+
/**
|
|
203
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
204
|
+
* @throws {KeyExistsFileError} {@link KeyExistsFileError}
|
|
205
|
+
*/
|
|
206
|
+
copyOrFail(destination: string): ITask<void>;
|
|
207
|
+
copyAndReplace(destination: string): ITask<boolean>;
|
|
208
|
+
/**
|
|
209
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
210
|
+
*/
|
|
211
|
+
copyAndReplaceOrFail(destination: string): ITask<void>;
|
|
212
|
+
move(destination: string): ITask<boolean>;
|
|
213
|
+
/**
|
|
214
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
215
|
+
* @throws {KeyExistsFileError} {@link KeyExistsFileError}
|
|
216
|
+
*/
|
|
217
|
+
moveOrFail(destination: string): ITask<void>;
|
|
218
|
+
moveAndReplace(destination: string): ITask<boolean>;
|
|
219
|
+
/**
|
|
220
|
+
* @throws {KeyNotFoundFileError} {@link KeyNotFoundFileError}
|
|
221
|
+
*/
|
|
222
|
+
moveAndReplaceOrFail(destination: string): ITask<void>;
|
|
223
|
+
getSignedUploadUrl(options?: FileUploadUrlOptions): ITask<string>;
|
|
224
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module FileStorage
|
|
3
|
+
*/
|
|
4
|
+
import {} from "node:stream";
|
|
5
|
+
import {} from "../../file-size/contracts/_module.js";
|
|
6
|
+
import {} from "../../file-storage/contracts/file.errors.js";
|
|
7
|
+
import {} from "../../namespace/contracts/_module.js";
|
|
8
|
+
import {} from "../../task/contracts/_module.js";
|
|
9
|
+
import {} from "../../time-span/contracts/_module.js";
|
|
10
|
+
//# sourceMappingURL=file.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.contract.js","sourceRoot":"","sources":["../../../src/file-storage/contracts/file.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAKN,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAa,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAc,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAkB,MAAM,kCAAkC,CAAC"}
|