@daiso-tech/core 0.7.0 → 0.8.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/dist/cjs/_module.js +2 -0
- package/dist/cjs/_module.js.map +1 -1
- package/dist/cjs/_shared/utilities.js +9 -0
- package/dist/cjs/_shared/utilities.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js +2 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/{utilities/async/backof-policies/exponential-backoff-policy → event-bus/contracts}/_module.js +4 -1
- package/dist/cjs/event-bus/contracts/_module.js.map +1 -0
- package/dist/cjs/event-bus/contracts/_shared.js +39 -0
- package/dist/cjs/event-bus/contracts/_shared.js.map +1 -0
- package/dist/cjs/event-bus/contracts/event-bus-adapter.contract.js +3 -0
- package/dist/cjs/event-bus/contracts/event-bus-adapter.contract.js.map +1 -0
- package/dist/cjs/event-bus/contracts/event-bus-manager.contract.js +3 -0
- package/dist/cjs/event-bus/contracts/event-bus-manager.contract.js.map +1 -0
- package/dist/cjs/event-bus/contracts/event-bus.contract.js +3 -0
- package/dist/cjs/event-bus/contracts/event-bus.contract.js.map +1 -0
- package/dist/cjs/{serializer → event-bus/implementations}/_module.js +5 -5
- package/dist/cjs/event-bus/implementations/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js +18 -0
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +51 -0
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/cjs/event-bus/implementations/event-bus/_module.js +19 -0
- package/dist/cjs/event-bus/implementations/event-bus/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/event-bus/event-bus-manager.js +31 -0
- package/dist/cjs/event-bus/implementations/event-bus/event-bus-manager.js.map +1 -0
- package/dist/cjs/event-bus/implementations/event-bus/event-bus.js +104 -0
- package/dist/cjs/event-bus/implementations/event-bus/event-bus.js.map +1 -0
- package/dist/cjs/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js +41 -0
- package/dist/cjs/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js.map +1 -0
- package/dist/cjs/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js +35 -0
- package/dist/cjs/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js.map +1 -0
- package/dist/cjs/{utilities/async-iterable/timeout-iterable → event-bus/implementations/memory-event-bus-adapter}/_module.js +1 -1
- package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js +23 -0
- package/dist/cjs/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -0
- package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/_module.js +18 -0
- package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js +16 -0
- package/dist/cjs/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -0
- package/dist/cjs/{utilities/async-iterable/abortable-iterable → event-bus/implementations/redis-event-bus-adapter}/_module.js +1 -1
- package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js +45 -0
- package/dist/cjs/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -0
- package/dist/cjs/storage/contracts/_module.js +2 -0
- package/dist/cjs/storage/contracts/_module.js.map +1 -1
- package/dist/cjs/storage/contracts/storage-events.contract.js +14 -0
- package/dist/cjs/storage/contracts/storage-events.contract.js.map +1 -0
- package/dist/cjs/storage/contracts/storage-manager.contract.js +3 -0
- package/dist/cjs/storage/contracts/storage-manager.contract.js.map +1 -0
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js +294 -6
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js.map +1 -1
- package/dist/cjs/storage/implementations/storage/_module.js +1 -0
- package/dist/cjs/storage/implementations/storage/_module.js.map +1 -1
- package/dist/cjs/storage/implementations/storage/storage-manager.js +34 -0
- package/dist/cjs/storage/implementations/storage/storage-manager.js.map +1 -0
- package/dist/cjs/storage/implementations/storage/storage.js +67 -21
- package/dist/cjs/storage/implementations/storage/storage.js.map +1 -1
- package/dist/cjs/storage/implementations/storage/with-event-storage-adapter.js +255 -0
- package/dist/cjs/storage/implementations/storage/with-event-storage-adapter.js.map +1 -0
- package/dist/cjs/storage/implementations/storage/with-namespace-storage-adapter.js +0 -3
- package/dist/cjs/storage/implementations/storage/with-namespace-storage-adapter.js.map +1 -1
- package/dist/cjs/storage/implementations/storage/with-validation-storage-adapter.js.map +1 -1
- package/dist/cjs/utilities/_module.js +1 -2
- package/dist/cjs/utilities/_module.js.map +1 -1
- package/dist/cjs/utilities/async/_module.js +6 -1
- package/dist/cjs/utilities/async/_module.js.map +1 -1
- package/dist/cjs/utilities/{async-iterable/retry-iterable → async/abortable-iterable}/_module.js +1 -1
- package/dist/cjs/utilities/async/abortable-iterable/_module.js.map +1 -0
- package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js.map +1 -0
- package/dist/cjs/utilities/{async-iterable → async}/delay-iterable/_module.js +1 -1
- package/dist/cjs/utilities/async/delay-iterable/_module.js.map +1 -0
- package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js.map +1 -0
- package/dist/cjs/utilities/async/retry/retry.js +1 -1
- package/dist/cjs/utilities/async/retry/retry.js.map +1 -1
- package/dist/cjs/utilities/async/retry-iterable/_module.js +18 -0
- package/dist/cjs/utilities/async/retry-iterable/_module.js.map +1 -0
- package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js.map +1 -0
- package/dist/cjs/utilities/async/timeout-iterable/_module.js +18 -0
- package/dist/cjs/utilities/async/timeout-iterable/_module.js.map +1 -0
- package/dist/cjs/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.js +1 -1
- package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/_module.js +21 -0
- package/dist/cjs/utilities/backof-policies/_module.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/_shared.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js +18 -0
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.js +2 -2
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js +18 -0
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.js +2 -2
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js +18 -0
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.js +2 -2
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js +18 -0
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.js +2 -2
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/cjs/utilities/time-span/time-span.js.map +1 -1
- package/dist/cjs/utilities/validation/_module.js.map +1 -1
- package/dist/esm/_module.js +2 -0
- package/dist/esm/_module.js.map +1 -1
- package/dist/esm/_shared/utilities.js +7 -0
- package/dist/esm/_shared/utilities.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-map-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-update-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-when-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/chunk-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/chunk-while-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/collapse-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/count-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/entries-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/filter-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/flat-map-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/group-by-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/insert-after-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/insert-before-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/map-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/pad-end-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/pad-start-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/partion-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/repeat-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/reverse-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/shuffle-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/skip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/skip-until-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/slice-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/sliding-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/sort-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/take-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/take-until-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/tap-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/unique-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/update-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/when-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js +2 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/esm/event-bus/contracts/_module.js +5 -0
- package/dist/esm/event-bus/contracts/_module.js.map +1 -0
- package/dist/esm/event-bus/contracts/_shared.js +31 -0
- package/dist/esm/event-bus/contracts/_shared.js.map +1 -0
- package/dist/esm/event-bus/contracts/event-bus-adapter.contract.js +1 -0
- package/dist/esm/event-bus/contracts/event-bus-adapter.contract.js.map +1 -0
- package/dist/esm/event-bus/contracts/event-bus-manager.contract.js +1 -0
- package/dist/esm/event-bus/contracts/event-bus-manager.contract.js.map +1 -0
- package/dist/esm/event-bus/contracts/event-bus.contract.js +1 -0
- package/dist/esm/event-bus/contracts/event-bus.contract.js.map +1 -0
- package/dist/esm/event-bus/implementations/_module.js +6 -0
- package/dist/esm/event-bus/implementations/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js +2 -0
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +48 -0
- package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/esm/event-bus/implementations/event-bus/_module.js +3 -0
- package/dist/esm/event-bus/implementations/event-bus/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/event-bus/event-bus-manager.js +27 -0
- package/dist/esm/event-bus/implementations/event-bus/event-bus-manager.js.map +1 -0
- package/dist/esm/event-bus/implementations/event-bus/event-bus.js +100 -0
- package/dist/esm/event-bus/implementations/event-bus/event-bus.js.map +1 -0
- package/dist/esm/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js +37 -0
- package/dist/esm/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.js.map +1 -0
- package/dist/esm/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js +31 -0
- package/dist/esm/event-bus/implementations/event-bus/with-validation-event-bus-adapter.js.map +1 -0
- package/dist/esm/event-bus/implementations/memory-event-bus-adapter/_module.js +2 -0
- package/dist/esm/event-bus/implementations/memory-event-bus-adapter/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js +19 -0
- package/dist/esm/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -0
- package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/_module.js +2 -0
- package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js +12 -0
- package/dist/esm/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -0
- package/dist/esm/event-bus/implementations/redis-event-bus-adapter/_module.js +2 -0
- package/dist/esm/event-bus/implementations/redis-event-bus-adapter/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js +41 -0
- package/dist/esm/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -0
- package/dist/esm/storage/contracts/_module.js +2 -0
- package/dist/esm/storage/contracts/_module.js.map +1 -1
- package/dist/esm/storage/contracts/storage-events.contract.js +11 -0
- package/dist/esm/storage/contracts/storage-events.contract.js.map +1 -0
- package/dist/esm/storage/contracts/storage-manager.contract.js +1 -0
- package/dist/esm/storage/contracts/storage-manager.contract.js.map +1 -0
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js +293 -5
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.js.map +1 -1
- package/dist/esm/storage/implementations/storage/_module.js +1 -0
- package/dist/esm/storage/implementations/storage/_module.js.map +1 -1
- package/dist/esm/storage/implementations/storage/storage-manager.js +30 -0
- package/dist/esm/storage/implementations/storage/storage-manager.js.map +1 -0
- package/dist/esm/storage/implementations/storage/storage.js +69 -23
- package/dist/esm/storage/implementations/storage/storage.js.map +1 -1
- package/dist/esm/storage/implementations/storage/with-event-storage-adapter.js +251 -0
- package/dist/esm/storage/implementations/storage/with-event-storage-adapter.js.map +1 -0
- package/dist/esm/storage/implementations/storage/with-namespace-storage-adapter.js +0 -3
- package/dist/esm/storage/implementations/storage/with-namespace-storage-adapter.js.map +1 -1
- package/dist/esm/storage/implementations/storage/with-validation-storage-adapter.js.map +1 -1
- package/dist/esm/utilities/_module.js +1 -2
- package/dist/esm/utilities/_module.js.map +1 -1
- package/dist/esm/utilities/async/_module.js +4 -1
- package/dist/esm/utilities/async/_module.js.map +1 -1
- package/dist/esm/utilities/async/abortable-iterable/_module.js +2 -0
- package/dist/esm/utilities/async/abortable-iterable/_module.js.map +1 -0
- package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js.map +1 -0
- package/dist/esm/utilities/async/delay-iterable/_module.js +2 -0
- package/dist/esm/utilities/async/delay-iterable/_module.js.map +1 -0
- package/dist/esm/utilities/async/delay-iterable/delay-iterable.js.map +1 -0
- package/dist/esm/utilities/async/retry/retry.js +1 -1
- package/dist/esm/utilities/async/retry/retry.js.map +1 -1
- package/dist/esm/utilities/async/retry-iterable/_module.js +2 -0
- package/dist/esm/utilities/async/retry-iterable/_module.js.map +1 -0
- package/dist/esm/utilities/async/retry-iterable/retry-iterable.js.map +1 -0
- package/dist/esm/utilities/async/timeout-iterable/_module.js +2 -0
- package/dist/esm/utilities/async/timeout-iterable/_module.js.map +1 -0
- package/dist/esm/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.js +1 -1
- package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js.map +1 -0
- package/dist/esm/utilities/backof-policies/_module.js +5 -0
- package/dist/esm/utilities/backof-policies/_module.js.map +1 -0
- package/dist/esm/utilities/backof-policies/_shared.js.map +1 -0
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js +2 -0
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/esm/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.js +2 -2
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js +2 -0
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/esm/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.js +2 -2
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js +2 -0
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/esm/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.js +2 -2
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js +2 -0
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/esm/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.js +2 -2
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/esm/utilities/time-span/time-span.js.map +1 -1
- package/dist/esm/utilities/validation/_module.js.map +1 -1
- package/dist/types/_module.d.ts +2 -0
- package/dist/types/_shared/types.d.ts +1 -1
- package/dist/types/_shared/utilities.d.ts +8 -0
- package/dist/types/collection/contracts/async-collection.contract.d.ts +236 -43
- package/dist/types/collection/contracts/collection.contract.d.ts +229 -42
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-collapse-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-count-by-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-filter-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-map-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-shuffle-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-skip-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-skip-until-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-slice-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-sliding-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-sort-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-split-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-tap-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-unique-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-update-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-when-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +10 -9
- package/dist/types/collection/implementations/iterable-collection/_shared/chunk-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/chunk-while-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/collapse-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/count-by-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/cross-join-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/entries-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/filter-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/flat-map-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/group-by-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/insert-after-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/insert-before-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/map-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/merge-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/pad-end-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/pad-start-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/partion-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/repeat-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/reverse-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/shuffle-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/skip-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/skip-until-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/slice-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/sliding-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/sort-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/split-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/take-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/take-until-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/tap-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/unique-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/update-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/when-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/_shared/zip-iterable.d.ts +3 -0
- package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +7 -7
- package/dist/types/collection/implementations/list-collection/list-collection.d.ts +7 -7
- package/dist/types/event-bus/contracts/_module.d.ts +4 -0
- package/dist/types/event-bus/contracts/_shared.d.ts +38 -0
- package/dist/types/event-bus/contracts/event-bus-adapter.contract.d.ts +23 -0
- package/dist/types/event-bus/contracts/event-bus-manager.contract.d.ts +120 -0
- package/dist/types/event-bus/contracts/event-bus.contract.d.ts +119 -0
- package/dist/types/event-bus/implementations/_module.d.ts +5 -0
- package/dist/types/event-bus/implementations/_shared/test-utilities/_module.d.ts +1 -0
- package/dist/types/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.d.ts +36 -0
- package/dist/types/event-bus/implementations/event-bus/_module.d.ts +2 -0
- package/dist/types/event-bus/implementations/event-bus/event-bus-manager.d.ts +26 -0
- package/dist/types/event-bus/implementations/event-bus/event-bus.d.ts +102 -0
- package/dist/types/event-bus/implementations/event-bus/with-namespace-event-bus-adapter.d.ts +16 -0
- package/dist/types/event-bus/implementations/event-bus/with-validation-event-bus-adapter.d.ts +17 -0
- package/dist/types/event-bus/implementations/memory-event-bus-adapter/_module.d.ts +1 -0
- package/dist/types/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +15 -0
- package/dist/types/event-bus/implementations/no-op-event-bus-adapter/_module.d.ts +1 -0
- package/dist/types/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +14 -0
- package/dist/types/event-bus/implementations/redis-event-bus-adapter/_module.d.ts +1 -0
- package/dist/types/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.d.ts +28 -0
- package/dist/types/serializer/contracts/serializer.contract.d.ts +0 -3
- package/dist/types/storage/contracts/_module.d.ts +2 -0
- package/dist/types/storage/contracts/storage-adapter.contract.d.ts +12 -24
- package/dist/types/storage/contracts/storage-events.contract.d.ts +91 -0
- package/dist/types/storage/contracts/storage-manager.contract.d.ts +100 -0
- package/dist/types/storage/contracts/storage.contract.d.ts +84 -51
- package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.d.ts +18 -2
- package/dist/types/storage/implementations/storage/_module.d.ts +1 -0
- package/dist/types/storage/implementations/storage/storage-manager.d.ts +29 -0
- package/dist/types/storage/implementations/storage/storage.d.ts +81 -8
- package/dist/types/storage/implementations/storage/with-event-storage-adapter.d.ts +31 -0
- package/dist/types/storage/implementations/storage/with-namespace-storage-adapter.d.ts +0 -1
- package/dist/types/storage/implementations/storage/with-validation-storage-adapter.d.ts +3 -0
- package/dist/types/utilities/_module.d.ts +1 -2
- package/dist/types/utilities/async/_module.d.ts +4 -1
- package/dist/types/utilities/async/_shared.d.ts +6 -6
- package/dist/types/utilities/async/abortable/abortable.d.ts +2 -2
- package/dist/types/utilities/async/abortable-iterable/_module.d.ts +1 -0
- package/dist/types/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.d.ts +2 -2
- package/dist/types/utilities/async/delay/delay.d.ts +2 -2
- package/dist/types/utilities/async/delay-iterable/_module.d.ts +1 -0
- package/dist/types/utilities/{async-iterable → async}/delay-iterable/delay-iterable.d.ts +2 -2
- package/dist/types/utilities/async/lazy-promise/lazy-promise.d.ts +3 -3
- package/dist/types/utilities/async/retry/retry.d.ts +7 -4
- package/dist/types/utilities/async/retry-iterable/_module.d.ts +1 -0
- package/dist/types/utilities/{async-iterable → async}/retry-iterable/retry-iterable.d.ts +1 -1
- package/dist/types/utilities/async/timeout/timeout.d.ts +2 -2
- package/dist/types/utilities/async/timeout-iterable/_module.d.ts +1 -0
- package/dist/types/utilities/{async-iterable → async}/timeout-iterable/timeout-iterable.d.ts +2 -2
- package/dist/types/utilities/backof-policies/_module.d.ts +5 -0
- package/dist/types/utilities/{async/backof-policies → backof-policies}/_shared.d.ts +2 -2
- package/dist/types/utilities/backof-policies/constant-backoff-policy/_module.d.ts +1 -0
- package/dist/types/utilities/{async/backof-policies → backof-policies}/constant-backoff-policy/constant-backoff-policy.d.ts +3 -3
- package/dist/types/utilities/backof-policies/exponential-backoff-policy/_module.d.ts +1 -0
- package/dist/types/utilities/{async/backof-policies → backof-policies}/exponential-backoff-policy/exponential-backoff-policy.d.ts +3 -3
- package/dist/types/utilities/backof-policies/linear-backoff-policy/_module.d.ts +1 -0
- package/dist/types/utilities/{async/backof-policies → backof-policies}/linear-backoff-policy/linear-backoff-policy.d.ts +3 -3
- package/dist/types/utilities/backof-policies/polynomial-backoff-policy/_module.d.ts +1 -0
- package/dist/types/utilities/{async/backof-policies → backof-policies}/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +3 -3
- package/dist/types/utilities/time-span/time-span.d.ts +2 -1
- package/dist/types/utilities/validation/_module.d.ts +21 -1
- package/package.json +1 -1
- package/dist/cjs/serializer/_module.js.map +0 -1
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js +0 -300
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js.map +0 -1
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js +0 -1208
- package/dist/cjs/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/_module.js +0 -21
- package/dist/cjs/utilities/async/backof-policies/_module.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/_shared.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/_module.js +0 -23
- package/dist/cjs/utilities/async-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/abortable-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/delay-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/retry-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/timeout-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async-iterable/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/esm/serializer/_module.js +0 -6
- package/dist/esm/serializer/_module.js.map +0 -1
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js +0 -297
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.js.map +0 -1
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js +0 -1205
- package/dist/esm/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/_module.js +0 -5
- package/dist/esm/utilities/async/backof-policies/_module.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/_shared.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/async-iterable/_module.js +0 -5
- package/dist/esm/utilities/async-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async-iterable/abortable-iterable/_module.js +0 -2
- package/dist/esm/utilities/async-iterable/abortable-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async-iterable/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/esm/utilities/async-iterable/delay-iterable/_module.js +0 -2
- package/dist/esm/utilities/async-iterable/delay-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async-iterable/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/esm/utilities/async-iterable/retry-iterable/_module.js +0 -2
- package/dist/esm/utilities/async-iterable/retry-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async-iterable/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/esm/utilities/async-iterable/timeout-iterable/_module.js +0 -2
- package/dist/esm/utilities/async-iterable/timeout-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async-iterable/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/types/serializer/_module.d.ts +0 -5
- package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter-api.test-suite.d.ts +0 -20
- package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter-value.test-suite.d.ts +0 -20
- package/dist/types/utilities/async/backof-policies/_module.d.ts +0 -5
- package/dist/types/utilities/async/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/async/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/async/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/async/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/async-iterable/_module.d.ts +0 -4
- package/dist/types/utilities/async-iterable/abortable-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async-iterable/delay-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async-iterable/retry-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async-iterable/timeout-iterable/_module.d.ts +0 -1
- /package/dist/cjs/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.js +0 -0
- /package/dist/cjs/utilities/{async-iterable → async}/delay-iterable/delay-iterable.js +0 -0
- /package/dist/cjs/utilities/{async-iterable → async}/retry-iterable/retry-iterable.js +0 -0
- /package/dist/cjs/utilities/{async/backof-policies → backof-policies}/_shared.js +0 -0
- /package/dist/esm/utilities/{async-iterable → async}/abortable-iterable/abortable-iterable.js +0 -0
- /package/dist/esm/utilities/{async-iterable → async}/delay-iterable/delay-iterable.js +0 -0
- /package/dist/esm/utilities/{async-iterable → async}/retry-iterable/retry-iterable.js +0 -0
- /package/dist/esm/utilities/{async/backof-policies → backof-policies}/_shared.js +0 -0
|
@@ -2,52 +2,40 @@
|
|
|
2
2
|
* @module Storage
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
5
|
+
* The <i>IStorageAdapter</i> contract defines a way for storing data as key-value pairs independent of storage.
|
|
6
|
+
* This interface is not meant to be used directly, instead you should use <i>IStorage</i>
|
|
8
7
|
* @group Contracts
|
|
9
8
|
*/
|
|
10
|
-
export type IStorageAdapter<TType> = {
|
|
9
|
+
export type IStorageAdapter<TType = unknown> = {
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @throws {StorageError} {@link StorageError}
|
|
14
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
11
|
+
* The <i>getMany</i> returns the value for the <i>keys</i> that are found otherwise null will be returned.
|
|
15
12
|
*/
|
|
16
13
|
getMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, TType | null>>;
|
|
17
14
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @throws {StorageError} {@link StorageError}
|
|
20
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
15
|
+
* The <i>addMany</i> method adds the keys that doesn't exists. Returns true for the keys that doesn't exists otherwise false will be returned.
|
|
21
16
|
*/
|
|
22
17
|
addMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
23
18
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @throws {StorageError} {@link StorageError}
|
|
26
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
19
|
+
* The <i>updateMany</i> method updates the given keys. Returns true for the keys that exists otherwise false will be returned.
|
|
27
20
|
*/
|
|
28
21
|
updateMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
29
22
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @throws {StorageError} {@link StorageError}
|
|
32
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
23
|
+
* The <i>putMany</i> method replaces the keys that are found. Adds keys that are not found. Returns true for all the keys that are found otherwise false is returned.
|
|
33
24
|
*/
|
|
34
25
|
putMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
35
26
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @throws {StorageError} {@link StorageError}
|
|
38
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
27
|
+
* The <i>removesMany</i> method removes the keys that are found. Returns true for the keys that are found otherwise false is returned.
|
|
39
28
|
*/
|
|
40
29
|
removeMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
41
30
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
31
|
+
* The <i>increment</i> method will increment the given <i>key</i> if found otherwise nonthing will occur.
|
|
32
|
+
* Returns true if key exists otherwise false will be returned.
|
|
33
|
+
* An error will thrown if the key is not a number.
|
|
45
34
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
46
35
|
*/
|
|
47
36
|
increment(key: string, value: number): PromiseLike<boolean>;
|
|
48
37
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
38
|
+
* The <i>clear</i> method removes all keys that starts <i>prefix</i>.
|
|
51
39
|
*/
|
|
52
40
|
clear(prefix: string): PromiseLike<void>;
|
|
53
41
|
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Storage
|
|
3
|
+
*/
|
|
4
|
+
import type { IStorageAdapter } from "../../storage/contracts/storage-adapter.contract";
|
|
5
|
+
/**
|
|
6
|
+
* Name of all the events of <i>{@link IStorage}</i>.
|
|
7
|
+
* @group Events
|
|
8
|
+
*/
|
|
9
|
+
export declare const STORAGE_EVENTS: {
|
|
10
|
+
readonly KEYS_FOUND: "keys_found";
|
|
11
|
+
readonly KEYS_NOT_FOUND: "keys_not_found";
|
|
12
|
+
readonly KEYS_ADDED: "keys_added";
|
|
13
|
+
readonly KEYS_UPDATED: "keys_updated";
|
|
14
|
+
readonly KEYS_REMOVED: "keys_removed";
|
|
15
|
+
readonly KEYS_CLEARED: "keys_cleared";
|
|
16
|
+
readonly KEY_INCREMENTED: "key_incremented";
|
|
17
|
+
readonly KEY_DECREMENTED: "key_decremented";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @group Events
|
|
21
|
+
*/
|
|
22
|
+
export type StorageEventNames = (typeof STORAGE_EVENTS)[keyof typeof STORAGE_EVENTS];
|
|
23
|
+
/**
|
|
24
|
+
* @group Events
|
|
25
|
+
*/
|
|
26
|
+
export type StorageEvent = {
|
|
27
|
+
namespace: string;
|
|
28
|
+
adapter: IStorageAdapter<any>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @group Events
|
|
32
|
+
*/
|
|
33
|
+
export type KeysFoundStorageEvent<TType> = StorageEvent & {
|
|
34
|
+
type: (typeof STORAGE_EVENTS)["KEYS_FOUND"];
|
|
35
|
+
values: Record<string, TType>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @group Events
|
|
39
|
+
*/
|
|
40
|
+
export type KeysNotFoundStorageEvent = StorageEvent & {
|
|
41
|
+
type: (typeof STORAGE_EVENTS)["KEYS_NOT_FOUND"];
|
|
42
|
+
keys: string[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @group Events
|
|
46
|
+
*/
|
|
47
|
+
export type KeysAddedStorageEvent<TType> = StorageEvent & {
|
|
48
|
+
type: (typeof STORAGE_EVENTS)["KEYS_ADDED"];
|
|
49
|
+
values: Record<string, TType>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @group Events
|
|
53
|
+
*/
|
|
54
|
+
export type KeysUpdatedStorageEvent<TType> = StorageEvent & {
|
|
55
|
+
type: (typeof STORAGE_EVENTS)["KEYS_UPDATED"];
|
|
56
|
+
values: Record<string, TType>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @group Events
|
|
60
|
+
*/
|
|
61
|
+
export type KeyIncrementedStorageEvent = StorageEvent & {
|
|
62
|
+
type: (typeof STORAGE_EVENTS)["KEY_INCREMENTED"];
|
|
63
|
+
key: string;
|
|
64
|
+
value: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @group Events
|
|
68
|
+
*/
|
|
69
|
+
export type KeyDecrementedStorageEvent = StorageEvent & {
|
|
70
|
+
type: (typeof STORAGE_EVENTS)["KEY_DECREMENTED"];
|
|
71
|
+
key: string;
|
|
72
|
+
value: number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* @group Events
|
|
76
|
+
*/
|
|
77
|
+
export type KeysRemovedStorageEvent = StorageEvent & {
|
|
78
|
+
type: (typeof STORAGE_EVENTS)["KEYS_REMOVED"];
|
|
79
|
+
keys: string[];
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* This event will be triggered when storage is cleared.
|
|
83
|
+
* @group Events
|
|
84
|
+
*/
|
|
85
|
+
export type KeysClearedStorageEvent = StorageEvent & {
|
|
86
|
+
type: (typeof STORAGE_EVENTS)["KEYS_CLEARED"];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @group Events
|
|
90
|
+
*/
|
|
91
|
+
export type AllStorageEvents<TType = unknown> = KeysFoundStorageEvent<TType> | KeysNotFoundStorageEvent | KeysAddedStorageEvent<TType> | KeysUpdatedStorageEvent<TType> | KeysRemovedStorageEvent | KeysClearedStorageEvent | KeyIncrementedStorageEvent | KeyDecrementedStorageEvent;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Storage
|
|
3
|
+
*/
|
|
4
|
+
import type { Validator } from "../../utilities/_module";
|
|
5
|
+
import type { INamespacedStorage } from "../../storage/contracts/storage.contract";
|
|
6
|
+
/**
|
|
7
|
+
* The <i>IStorageFactory</i> contract makes it easy to switch between different <i>{@link IStorageAdapter | storage adapters}</i> dynamically.
|
|
8
|
+
* @group Contracts
|
|
9
|
+
*/
|
|
10
|
+
export type IStorageFactory<TAdapters extends string = string, TType = unknown> = {
|
|
11
|
+
/**
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { StorageManager, MemoryStorageAdapter, RedisStorageAdapter } from "@daiso-tech/core";
|
|
15
|
+
* import Redis from "ioredis";
|
|
16
|
+
*
|
|
17
|
+
* const storageManager = new StorageManager({
|
|
18
|
+
* adapters: {
|
|
19
|
+
* memory: new MemoryStorageAdapter(),
|
|
20
|
+
* redis: new RedisStorageAdapter(new Redis()),
|
|
21
|
+
* },
|
|
22
|
+
* defaultAdapter: "memory",
|
|
23
|
+
* rootNamespace: "@storage/"
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* (async () => {
|
|
27
|
+
* // Will add key using the default adapter which is the memory addapter
|
|
28
|
+
* await storageManager
|
|
29
|
+
* .use()
|
|
30
|
+
* .add("a", 1);
|
|
31
|
+
* // Will add key using the redis addapter
|
|
32
|
+
* await storageManager
|
|
33
|
+
* .use("redis")
|
|
34
|
+
* .add("a", 1);
|
|
35
|
+
* })();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
use(adapter?: TAdapters): INamespacedStorage<TType>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The <i>IStorageManager</i> contract makes it easy to configure and switch between different <i>{@link IStorageAdapter | storage adapters}</i> dynamically.
|
|
42
|
+
* @group Contracts
|
|
43
|
+
*/
|
|
44
|
+
export type IStorageManager<TAdapters extends string = string, TType = unknown> = IStorageFactory<TAdapters, TType> & {
|
|
45
|
+
/**
|
|
46
|
+
* The <i>withValidation</i> method is used to set a <i>validator</i>, which validates the storage values during runtime.
|
|
47
|
+
* The type is inferred from the provided <i>validator</i>.
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { StorageManager, MemoryStorageAdapter, RedisStorageAdapter, zodValidator } from "@daiso-tech/core";
|
|
51
|
+
* import Redis from "ioredis";
|
|
52
|
+
* import { z } from "zod"
|
|
53
|
+
*
|
|
54
|
+
* const storageManager = new StorageManager({
|
|
55
|
+
* adapters: {
|
|
56
|
+
* memory: new MemoryStorageAdapter(),
|
|
57
|
+
* redis: new RedisStorageAdapter(new Redis()),
|
|
58
|
+
* },
|
|
59
|
+
* defaultAdapter: "memory",
|
|
60
|
+
* rootNamespace: "@storage/"
|
|
61
|
+
* });
|
|
62
|
+
*
|
|
63
|
+
* (async () => {
|
|
64
|
+
* await storageManager
|
|
65
|
+
* .withValidation(zodValidator(z.string()))
|
|
66
|
+
* .use()
|
|
67
|
+
* // You will se an typescript error and get runtime erorr
|
|
68
|
+
* .add("a", 1);
|
|
69
|
+
* })();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
withValidation<TOutput extends TType = TType>(validator: Validator<TOutput>): IStorageFactory<TAdapters, TOutput>;
|
|
73
|
+
/**
|
|
74
|
+
* The <i>withTypes</i> method is used to set the value types of the storage.
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* import { StorageManager, MemoryStorageAdapter, RedisStorageAdapter, zodValidator } from "@daiso-tech/core";
|
|
78
|
+
* import Redis from "ioredis";
|
|
79
|
+
* import { z } from "zod"
|
|
80
|
+
*
|
|
81
|
+
* const storageManager = new StorageManager({
|
|
82
|
+
* adapters: {
|
|
83
|
+
* memory: new MemoryStorageAdapter(),
|
|
84
|
+
* redis: new RedisStorageAdapter(new Redis()),
|
|
85
|
+
* },
|
|
86
|
+
* defaultAdapter: "memory",
|
|
87
|
+
* rootNamespace: "@storage/"
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* (async () => {
|
|
91
|
+
* await storageManager
|
|
92
|
+
* .withTypes<string>()
|
|
93
|
+
* .use()
|
|
94
|
+
* // You will se an typescript error
|
|
95
|
+
* .add("a", 1)
|
|
96
|
+
* })();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
withType<TOutput extends TType = TType>(): IStorageFactory<TAdapters, TOutput>;
|
|
100
|
+
};
|
|
@@ -1,151 +1,184 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Storage
|
|
3
3
|
*/
|
|
4
|
+
import type { IListenable } from "../../event-bus/contracts/_module";
|
|
4
5
|
import { type AnyFunction, type AsyncLazyable, type GetOrAddValue } from "../../_shared/types";
|
|
6
|
+
import type { AllStorageEvents } from "../../storage/contracts/_module";
|
|
5
7
|
export type StorageValue<T> = Exclude<T, AnyFunction | undefined | null>;
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
* The <i>IStorageListenable</i> contract defines a way for listening <i>{@link IStorage}</i> crud operations.
|
|
10
|
+
*/
|
|
11
|
+
export type IStorageListenable<TType = unknown> = IListenable<AllStorageEvents<TType>>;
|
|
12
|
+
/**
|
|
13
|
+
* The <i>IStorage</i> contract defines a way for storing data as key-value pairs independent of storage.
|
|
14
|
+
* It commes with more convient methods compared to <i>IStorageAdapter</i>.
|
|
10
15
|
* @group Contracts
|
|
11
16
|
*/
|
|
12
|
-
export type IStorage<TType = unknown> = {
|
|
17
|
+
export type IStorage<TType = unknown> = IStorageListenable & {
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
namespace(name: string): IStorage<TType>;
|
|
17
|
-
/**
|
|
18
|
-
* Returns true when key is found otherwise false will be returned.
|
|
19
|
-
* @throws {StorageError} {@link StorageError}
|
|
19
|
+
* The <i>exists</i> method returns true when <i>key</i> is found otherwise false will be returned.
|
|
20
20
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
21
21
|
*/
|
|
22
22
|
exists(key: string): PromiseLike<boolean>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @throws {StorageError} {@link StorageError}
|
|
24
|
+
* The <i>existsMany</i> method returns true for the <i>keys</i> that are found otherwise false will be returned.
|
|
26
25
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
27
26
|
*/
|
|
28
27
|
existsMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
29
28
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @throws {StorageError} {@link StorageError}
|
|
29
|
+
* The <i>missing</i> method returns true when <i>key</i> is not found otherwise false will be returned.
|
|
32
30
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
33
31
|
*/
|
|
34
32
|
missing(key: string): PromiseLike<boolean>;
|
|
35
33
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @throws {StorageError} {@link StorageError}
|
|
34
|
+
* The <i>missingMany</i> method returns true for the <i>keys</i> that are not found otherwise false will be returned.
|
|
38
35
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
39
36
|
*/
|
|
40
37
|
missingMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
41
38
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @throws {StorageError} {@link StorageError}
|
|
39
|
+
* The <i>get</i> method returns the value when <i>key</i> is found otherwise null will be returned.
|
|
44
40
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
45
41
|
*/
|
|
46
42
|
get(key: string): PromiseLike<TType | null>;
|
|
47
43
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @throws {StorageError} {@link StorageError}
|
|
44
|
+
* The <i>getMany</i> returns the value for the <i>keys</i> that are found otherwise null will be returned.
|
|
50
45
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
51
46
|
*/
|
|
52
47
|
getMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, TType | null>>;
|
|
53
48
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @throws {StorageError} {@link StorageError}
|
|
49
|
+
* The <i>getOr</i> method returns the value when <i>key</i> is found otherwise <i>defaultValue</i> will be returned.
|
|
56
50
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
57
51
|
*/
|
|
58
52
|
getOr(key: string, defaultValue: AsyncLazyable<TType>): PromiseLike<TType>;
|
|
59
53
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @throws {StorageError} {@link StorageError}
|
|
54
|
+
* The <i>getOrMany</i> method returns the value for the keys that are found otherwise defaultValue will be returned.
|
|
62
55
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
63
56
|
*/
|
|
64
57
|
getOrMany<TKeys extends string>(keysWithDefaults: Record<TKeys, AsyncLazyable<TType>>): PromiseLike<Record<TKeys, TType>>;
|
|
65
58
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @throws {StorageError} {@link StorageError}
|
|
59
|
+
* The <i>getOrFail</i> method returns the value when <i>key</i> is found otherwise an error will be thrown.
|
|
68
60
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
69
61
|
* @throws {KeyNotFoundStorageError} {@link KeyNotFoundStorageError}
|
|
70
62
|
*/
|
|
71
63
|
getOrFail(key: string): PromiseLike<TType>;
|
|
72
64
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @throws {StorageError} {@link StorageError}
|
|
65
|
+
* The <i>add</i> method adds a <i>key</i> with given <i>value</i> when key doesn't exists. Returns true when key doesn't exists otherwise false will be returned.
|
|
75
66
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
76
67
|
*/
|
|
77
68
|
add(key: string, value: StorageValue<TType>): PromiseLike<boolean>;
|
|
78
69
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @throws {StorageError} {@link StorageError}
|
|
70
|
+
* The <i>addMany</i> method adds the keys that doesn't exists. Returns true for the keys that doesn't exists otherwise false will be returned.
|
|
81
71
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
82
72
|
*/
|
|
83
73
|
addMany<TKeys extends string>(values: Record<TKeys, StorageValue<TType>>): PromiseLike<Record<TKeys, boolean>>;
|
|
84
74
|
/**
|
|
85
|
-
*
|
|
86
|
-
* @throws {StorageError} {@link StorageError}
|
|
75
|
+
* The <i>update</i> method updates the given <i>key</i> with given <i>value</i>. Returns true when key otherwise false will be returned.
|
|
87
76
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
88
77
|
*/
|
|
89
78
|
update(key: string, value: TType): PromiseLike<boolean>;
|
|
90
79
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @throws {StorageError} {@link StorageError}
|
|
80
|
+
* The <i>updateMany</i> method updates the given keys. Returns true for the keys that exists otherwise false will be returned.
|
|
93
81
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
94
82
|
*/
|
|
95
83
|
updateMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
96
84
|
/**
|
|
97
|
-
*
|
|
98
|
-
* @throws {StorageError} {@link StorageError}
|
|
85
|
+
* The <i>put</i> method replaces the key with given <i>value</i> if found. If the <i>key</i> is not found it will just be added. True is returned if the key is found otherwise false will be returned.
|
|
99
86
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
100
87
|
*/
|
|
101
88
|
put(key: string, value: StorageValue<TType>): PromiseLike<boolean>;
|
|
102
89
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @throws {StorageError} {@link StorageError}
|
|
90
|
+
* The <i>putMany</i> method replaces the keys that are found. Adds keys that are not found. Returns true for all the keys that are found otherwise false is returned.
|
|
105
91
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
106
92
|
*/
|
|
107
93
|
putMany<TKeys extends string>(values: Record<TKeys, StorageValue<TType>>): PromiseLike<Record<TKeys, boolean>>;
|
|
108
94
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @throws {StorageError} {@link StorageError}
|
|
95
|
+
* The <i>remove</i> method removes the given <i>key</i> when found. Returns true if the key is found otherwise false is returned.
|
|
111
96
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
112
97
|
*/
|
|
113
98
|
remove(key: string): PromiseLike<boolean>;
|
|
114
99
|
/**
|
|
115
|
-
*
|
|
116
|
-
* @throws {StorageError} {@link StorageError}
|
|
100
|
+
* The <i>removesMany</i> method removes the keys that are found. Returns true for the keys that are found otherwise false is returned.
|
|
117
101
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
118
102
|
*/
|
|
119
103
|
removeMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
120
104
|
/**
|
|
121
|
-
*
|
|
122
|
-
* @throws {StorageError} {@link StorageError}
|
|
105
|
+
* The <i>getAndRemove</i> method removes the given <i>key</i> and returns it when found otherwise null will be returned.
|
|
123
106
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
124
107
|
*/
|
|
125
108
|
getAndRemove(key: string): PromiseLike<TType | null>;
|
|
126
109
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @throws {StorageError} {@link StorageError}
|
|
110
|
+
* The <i>getOrAdd</i> method will retrieve the given <i>key</i> if found otherwise <i>valueToAdd</i> will be added and returned.
|
|
129
111
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
130
112
|
*/
|
|
131
113
|
getOrAdd(key: string, valueToAdd: AsyncLazyable<StorageValue<GetOrAddValue<TType>>>): PromiseLike<TType>;
|
|
132
114
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
115
|
+
* The <i>increment</i> method will increment the given <i>key</i> if found otherwise nonthing will occur.
|
|
116
|
+
* Returns true if key exists otherwise false will be returned.
|
|
117
|
+
* An error will thrown if the key is not a number.
|
|
135
118
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
136
119
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
137
120
|
*/
|
|
138
121
|
increment(key: string, value?: Extract<TType, number>): PromiseLike<boolean>;
|
|
139
122
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
123
|
+
* The <i>decrement</i> method will decrement the given <i>key</i> if found otherwise nonthing will occur.
|
|
124
|
+
* Returns true if key exists otherwise false will be returned.
|
|
125
|
+
* An error will thrown if the key is not a number.
|
|
142
126
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
143
127
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
128
|
+
* An error will thrown if the key is not a number.
|
|
144
129
|
*/
|
|
145
130
|
decrement(key: string, value?: Extract<TType, number>): PromiseLike<boolean>;
|
|
146
131
|
/**
|
|
147
|
-
*
|
|
132
|
+
* The <i>clear</i> method removes all the keys in the storage.
|
|
148
133
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
149
134
|
*/
|
|
150
135
|
clear(): PromiseLike<void>;
|
|
136
|
+
/**
|
|
137
|
+
* The <i>getNamespace</i> method return the complete namespace.
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* const storage = new Storage(new MemoryStorageAdapter(), {
|
|
141
|
+
* rootNamespace: "@root/"
|
|
142
|
+
* });
|
|
143
|
+
*
|
|
144
|
+
* // Will be "@root/"
|
|
145
|
+
* console.log(storage.getNamespace())
|
|
146
|
+
*
|
|
147
|
+
* const storageA = storage.withNamespace("a/");
|
|
148
|
+
*
|
|
149
|
+
* // Will be "@root/a/"
|
|
150
|
+
* console.log(storageA.getNamespace())
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
getNamespace(): string;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* The <i>INamespacedStorage</i> contract defines a way for storing data as key-value pairs independent of storage.
|
|
157
|
+
* It commes with one extra method which is useful for multitennat applications compared to <i>IStorage</i>.
|
|
158
|
+
* @group Contracts
|
|
159
|
+
*/
|
|
160
|
+
export type INamespacedStorage<TType = unknown> = IStorage<TType> & {
|
|
161
|
+
/**
|
|
162
|
+
* The <i>withNamespace</i> method returns new instance of <i>{@link IStorage}</i> where all the keys will be prefixed with a given <i>namespace</i>.
|
|
163
|
+
* This useful for multitennat applications.
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* import { Storage, MemoryStorageAdapter } from "@daiso-tech/core";
|
|
167
|
+
*
|
|
168
|
+
* (async () => {
|
|
169
|
+
* const storage = new Storage(new MemoryStorageAdapter());
|
|
170
|
+
*
|
|
171
|
+
* const storageA = storage.withNamespace("a");
|
|
172
|
+
* await storageA.add("a", 1);
|
|
173
|
+
*
|
|
174
|
+
* const storageB = storage.withNamespace("b");
|
|
175
|
+
* await storageB.add("b", 2);
|
|
176
|
+
*
|
|
177
|
+
* // Will print { a: 1, b: null }
|
|
178
|
+
* console.log(await storageA.getMany(["a", "b"]));
|
|
179
|
+
* })();
|
|
180
|
+
*
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
withNamespace(namespace: string): IStorage<TType>;
|
|
151
184
|
};
|
package/dist/types/storage/implementations/_shared/test-utilities/storage-adapter.test-suite.d.ts
CHANGED
|
@@ -12,9 +12,25 @@ export type StorageAdapterTestSuiteSettings = {
|
|
|
12
12
|
test: TestAPI;
|
|
13
13
|
describe: SuiteAPI;
|
|
14
14
|
beforeEach: typeof beforeEach;
|
|
15
|
-
createAdapter: () => Promisable<IStorageAdapter
|
|
15
|
+
createAdapter: () => Promisable<IStorageAdapter>;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
+
* The <i>storageAdapterTestSuite</i> function simplifies the process of testing your custom implementation of <i>{@link IStorageAdapter}</i>.
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { storageAdapterTestSuite, MemoryStorageAdapter } from "@daiso-tech/core";
|
|
22
|
+
* import { expext, test, describe, beforeEach } from "vitest";
|
|
23
|
+
*
|
|
24
|
+
* describe("class: MemoryStorageAdapter", () => {
|
|
25
|
+
* storageAdapterTestSuite({
|
|
26
|
+
* createAdapter: () => new MemoryStorageAdapter(),
|
|
27
|
+
* test,
|
|
28
|
+
* beforeEach,
|
|
29
|
+
* expect,
|
|
30
|
+
* describe,
|
|
31
|
+
* });
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
18
34
|
* @group Utilities
|
|
19
35
|
*/
|
|
20
|
-
export declare function
|
|
36
|
+
export declare function storageAdapterTestSuite(settings: StorageAdapterTestSuiteSettings): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Storage
|
|
3
|
+
*/
|
|
4
|
+
import type { INamespacedEventBus } from "../../../event-bus/contracts/_module";
|
|
5
|
+
import type { IStorageFactory, INamespacedStorage, IStorageAdapter, IStorageManager } from "../../../storage/contracts/_module";
|
|
6
|
+
import type { Validator } from "../../../utilities/_module";
|
|
7
|
+
/**
|
|
8
|
+
* @group Derivables
|
|
9
|
+
*/
|
|
10
|
+
export type StorageManagerSettings<TAdapters extends string = string> = {
|
|
11
|
+
adapters: Record<TAdapters, IStorageAdapter<any>>;
|
|
12
|
+
defaultAdapter: NoInfer<TAdapters>;
|
|
13
|
+
rootNamespace: string;
|
|
14
|
+
eventBus?: INamespacedEventBus<any>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @group Derivables
|
|
18
|
+
*/
|
|
19
|
+
export declare class StorageManager<TAdapters extends string = string, TType = unknown> implements IStorageManager<TAdapters, TType> {
|
|
20
|
+
private readonly adapters;
|
|
21
|
+
private readonly defaultAdapter;
|
|
22
|
+
private readonly rootNamespace;
|
|
23
|
+
private readonly eventBus?;
|
|
24
|
+
private validator;
|
|
25
|
+
constructor(settings: StorageManagerSettings<TAdapters>);
|
|
26
|
+
use(adapter?: TAdapters): INamespacedStorage<TType>;
|
|
27
|
+
withValidation<TOutput extends TType = TType>(validator: Validator<TOutput>): IStorageFactory<TAdapters, TOutput>;
|
|
28
|
+
withType<TOutput extends TType = TType>(): IStorageFactory<TAdapters, TOutput>;
|
|
29
|
+
}
|