@daiso-tech/core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +32 -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 +24 -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 +292 -4
- 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 +24 -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 +254 -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 +25 -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 +20 -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 +292 -4
- 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 +20 -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 +250 -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 +9 -8
- package/dist/types/collection/contracts/collection.contract.d.ts +8 -7
- 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 +32 -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 +20 -0
- package/dist/types/event-bus/contracts/event-bus.contract.d.ts +91 -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 +20 -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 +23 -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/storage/contracts/_module.d.ts +2 -0
- package/dist/types/storage/contracts/storage-adapter.contract.d.ts +11 -6
- package/dist/types/storage/contracts/storage-events.contract.d.ts +90 -0
- package/dist/types/storage/contracts/storage-manager.contract.d.ts +19 -0
- package/dist/types/storage/contracts/storage.contract.d.ts +51 -26
- package/dist/types/storage/implementations/storage/_module.d.ts +1 -0
- package/dist/types/storage/implementations/storage/storage-manager.d.ts +23 -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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { INamespacedEventBus, IEventBusAdapter, IEventBusManager, EventBusManagerUseSettings, IBaseEvent } from "../../../event-bus/contracts/_module";
|
|
5
|
+
import { type EventBusSettings } from "../../../event-bus/implementations/event-bus/event-bus";
|
|
6
|
+
/**
|
|
7
|
+
* @group Derivables
|
|
8
|
+
*/
|
|
9
|
+
export type EventBusManagerSettings<TAdapters extends string = string> = {
|
|
10
|
+
adapters: Record<TAdapters, IEventBusAdapter>;
|
|
11
|
+
defaultAdapter: NoInfer<TAdapters>;
|
|
12
|
+
adapterSettings?: Omit<EventBusSettings<any>, "validator">;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @group Derivables
|
|
16
|
+
*/
|
|
17
|
+
export declare class EventBusManager<TAdapters extends string = string> implements IEventBusManager<TAdapters> {
|
|
18
|
+
private readonly adapters;
|
|
19
|
+
private readonly defaultAdapter;
|
|
20
|
+
private readonly adapterSettings;
|
|
21
|
+
constructor(settings: EventBusManagerSettings<TAdapters>);
|
|
22
|
+
use<TEvents extends IBaseEvent = IBaseEvent>(adapterSettings: EventBusManagerUseSettings<TEvents, TAdapters>): INamespacedEventBus<TEvents>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { Validator } from "../../../utilities/_module";
|
|
5
|
+
import { LazyPromise } from "../../../utilities/_module";
|
|
6
|
+
import type { SelectEvent, Unsubscribe } from "../../../event-bus/contracts/_module";
|
|
7
|
+
import { type IEventBus, type INamespacedEventBus, type IEventBusAdapter, type Listener, type IBaseEvent } from "../../../event-bus/contracts/_module";
|
|
8
|
+
import type { OneOrMore } from "../../../_shared/types";
|
|
9
|
+
/**
|
|
10
|
+
* @group Derivables
|
|
11
|
+
*/
|
|
12
|
+
export type EventBusSettings<TEvents extends IBaseEvent> = {
|
|
13
|
+
/**
|
|
14
|
+
* You can prefix all keys with a given <i>namespace</i>.
|
|
15
|
+
* This useful if you want to add multitenancy but still use the same database.
|
|
16
|
+
* @default {""}
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { EventBus, MemoryEventBusAdapter } from "@daiso-tech/core";
|
|
20
|
+
*
|
|
21
|
+
* const eventBusA = new EventBus(new MemoryEventBusAdapter(), {
|
|
22
|
+
* rootNamespace: "@a/"
|
|
23
|
+
* });
|
|
24
|
+
* const eventBusB = new EventBus(new MemoryEventBusAdapter(), {
|
|
25
|
+
* rootNamespace: "@b/"
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* (async () => {
|
|
29
|
+
* eventBusB.addListener("add", event => {
|
|
30
|
+
* // This will never be logged because eventBusB has different namespace
|
|
31
|
+
* console.log("eventBusB:", event);
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* eventBusB.addListener("add", event => {
|
|
35
|
+
* // This will be logged
|
|
36
|
+
* console.log("eventBusB:", event);
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* await eventBusA.dispatch([
|
|
40
|
+
* { type: "add", a: 1, b: 2 }
|
|
41
|
+
* ]);
|
|
42
|
+
* })();
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
rootNamespace?: string;
|
|
46
|
+
/**
|
|
47
|
+
* You can pass a custom <i>{@link Validator}</i> to validate, transform and sanitize your data.
|
|
48
|
+
* You could also use <i>{@link zodValidator}</i> which enables you to use zod for validating, transforming, and sanitizing.
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { EventBus, MemoryEventBusAdapter, zodValidator } from "@daiso-tech/core";
|
|
52
|
+
* import { z } from "zod";
|
|
53
|
+
*
|
|
54
|
+
* const addEventSchema = z.object({
|
|
55
|
+
* type: z.literal("add"),
|
|
56
|
+
* a: z.number(),
|
|
57
|
+
* b: z.number(),
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* const subEventSchema = z.object({
|
|
61
|
+
* type: z.literal("sub"),
|
|
62
|
+
* c: z.number(),
|
|
63
|
+
* d: z.number(),
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* const eventBus = new EventBus(new MemoryEventBusAdapter(), {
|
|
67
|
+
* // Event type will be infered from validator
|
|
68
|
+
* validator: zodValidator(addEventSchema.or(subEventSchema))
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* (async () => {
|
|
72
|
+
* // An Typescript error will be seen and ValidationError will be thrown during runtime.
|
|
73
|
+
* await eventBus.dispatch([
|
|
74
|
+
* {
|
|
75
|
+
* type: "none existing",
|
|
76
|
+
* noneExistingField: 20
|
|
77
|
+
* }
|
|
78
|
+
* ]);
|
|
79
|
+
* })();
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
validator?: Validator<TEvents>;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* <i>EventBus</i> class can be derived from any <i>{@link IEventBusAdapter}</i>.
|
|
86
|
+
* @group Derivables
|
|
87
|
+
*/
|
|
88
|
+
export declare class EventBus<TEvents extends IBaseEvent = IBaseEvent> implements INamespacedEventBus<TEvents> {
|
|
89
|
+
private readonly eventBusAdapter;
|
|
90
|
+
private readonly namespace_;
|
|
91
|
+
private readonly validator;
|
|
92
|
+
constructor(eventBusAdapter: IEventBusAdapter, settings?: EventBusSettings<TEvents>);
|
|
93
|
+
withNamespace(namespace: string): IEventBus<TEvents>;
|
|
94
|
+
getNamespace(): string;
|
|
95
|
+
addListener<TEventType extends TEvents["type"]>(event: TEventType, listener: Listener<SelectEvent<TEvents, TEventType>>): LazyPromise<void>;
|
|
96
|
+
addListenerMany<TEventType extends TEvents["type"]>(events: TEventType[], listener: Listener<SelectEvent<TEvents, TEventType>>): LazyPromise<void>;
|
|
97
|
+
removeListener<TEventType extends TEvents["type"]>(event: TEventType, listener: Listener<SelectEvent<TEvents, TEventType>>): LazyPromise<void>;
|
|
98
|
+
removeListenerMany<TEventType extends TEvents["type"]>(events: TEventType[], listener: Listener<SelectEvent<TEvents, TEventType>>): LazyPromise<void>;
|
|
99
|
+
subscribe<TEventType extends TEvents["type"]>(event: TEventType, listener: Listener<SelectEvent<TEvents, TEventType>>): PromiseLike<Unsubscribe>;
|
|
100
|
+
subscribeMany<TEventType extends TEvents["type"]>(events: TEventType[], listener: Listener<SelectEvent<TEvents, TEventType>>): PromiseLike<Unsubscribe>;
|
|
101
|
+
dispatch(events: OneOrMore<TEvents>): LazyPromise<void>;
|
|
102
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { IBaseEvent, IEventBusAdapter, Listener } from "../../../event-bus/contracts/_module";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class WithNamespaceEventBusAdapter implements IEventBusAdapter {
|
|
9
|
+
private readonly eventBusAdapter;
|
|
10
|
+
private readonly namespace;
|
|
11
|
+
private readonly listenerMap;
|
|
12
|
+
constructor(eventBusAdapter: IEventBusAdapter, namespace: string);
|
|
13
|
+
addListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
14
|
+
removeListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
15
|
+
dispatch(events: IBaseEvent[]): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { Validator } from "../../../utilities/_module";
|
|
5
|
+
import type { IBaseEvent, IEventBusAdapter, Listener } from "../../../event-bus/contracts/_module";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class WithValidationEventBusAdapter implements IEventBusAdapter {
|
|
10
|
+
private readonly eventBusAdapter;
|
|
11
|
+
private readonly validator;
|
|
12
|
+
private readonly listenerMap;
|
|
13
|
+
constructor(eventBusAdapter: IEventBusAdapter, validator: Validator<IBaseEvent>);
|
|
14
|
+
addListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
15
|
+
removeListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
16
|
+
dispatch(events: IBaseEvent[]): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../event-bus/implementations/memory-event-bus-adapter/_module";
|
package/dist/types/event-bus/implementations/memory-event-bus-adapter/memory-event-bus-adapter.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { IBaseEvent, IEventBusAdapter, Listener } from "../../../event-bus/contracts/_module";
|
|
5
|
+
import { EventEmitter } from "node:events";
|
|
6
|
+
/**
|
|
7
|
+
* @group Adapters
|
|
8
|
+
*/
|
|
9
|
+
export declare class MemoryEventBusAdapter implements IEventBusAdapter {
|
|
10
|
+
private readonly eventEmiter;
|
|
11
|
+
constructor(eventEmiter?: EventEmitter<[never]>);
|
|
12
|
+
addListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
13
|
+
removeListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
14
|
+
dispatch(events: IBaseEvent[]): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter";
|
package/dist/types/event-bus/implementations/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import type { Listener, IBaseEvent } from "../../../_module";
|
|
5
|
+
import type { IEventBusAdapter } from "../../../event-bus/contracts/event-bus-adapter.contract";
|
|
6
|
+
/**
|
|
7
|
+
* This <i>NoOpEventBusAdapter</i> will do nothing and is used for easily mocking IEventBus for testing.
|
|
8
|
+
* @group Adapters
|
|
9
|
+
*/
|
|
10
|
+
export declare class NoOpEventBusAdapter implements IEventBusAdapter {
|
|
11
|
+
addListener(_event: string, _listener: Listener<IBaseEvent>): Promise<void>;
|
|
12
|
+
removeListener(_event: string, _listener: Listener<IBaseEvent>): Promise<void>;
|
|
13
|
+
dispatch(_events: IBaseEvent[]): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../event-bus/implementations/memory-event-bus-adapter/_module";
|
package/dist/types/event-bus/implementations/redis-event-bus-adapter/redis-event-bus-adapter.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import { type ISerializer } from "../../../serializer/contracts/_module";
|
|
5
|
+
import type { IBaseEvent, IEventBusAdapter, Listener } from "../../../event-bus/contracts/_module";
|
|
6
|
+
import type Redis from "ioredis";
|
|
7
|
+
/**
|
|
8
|
+
* @group Adapters
|
|
9
|
+
*/
|
|
10
|
+
export type RedisEventBusAdapterSettings = {
|
|
11
|
+
dispatcherClient: Redis;
|
|
12
|
+
listenerClient: Redis;
|
|
13
|
+
serializer?: ISerializer<string>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @group Adapters
|
|
17
|
+
*/
|
|
18
|
+
export declare class RedisEventBusAdapter implements IEventBusAdapter {
|
|
19
|
+
private readonly serializer;
|
|
20
|
+
private readonly dispatcherClient;
|
|
21
|
+
private readonly listenerClient;
|
|
22
|
+
private readonly eventEmitter;
|
|
23
|
+
constructor({ dispatcherClient, listenerClient, serializer, }: RedisEventBusAdapterSettings);
|
|
24
|
+
private redisListener;
|
|
25
|
+
addListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
26
|
+
removeListener(event: string, listener: Listener<IBaseEvent>): Promise<void>;
|
|
27
|
+
dispatch(events: IBaseEvent[]): Promise<void>;
|
|
28
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from "../../storage/contracts/_shared";
|
|
2
2
|
export * from "../../storage/contracts/storage.contract";
|
|
3
3
|
export * from "../../storage/contracts/storage-adapter.contract";
|
|
4
|
+
export * from "../../storage/contracts/storage-events.contract";
|
|
5
|
+
export * from "../../storage/contracts/storage-manager.contract";
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @module Storage
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
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>
|
|
5
7
|
* @throws {StorageError} {@link StorageError}
|
|
6
8
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
7
9
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
@@ -9,43 +11,46 @@
|
|
|
9
11
|
*/
|
|
10
12
|
export type IStorageAdapter<TType> = {
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
14
|
+
* The <i>getMany</i> returns the value for the <i>keys</i> that are found otherwise null will be returned.
|
|
13
15
|
* @throws {StorageError} {@link StorageError}
|
|
14
16
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
15
17
|
*/
|
|
16
18
|
getMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, TType | null>>;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* 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.
|
|
19
21
|
* @throws {StorageError} {@link StorageError}
|
|
20
22
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
21
23
|
*/
|
|
22
24
|
addMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
26
|
+
* The <i>updateMany</i> method updates the given keys. Returns true for the keys that exists otherwise false will be returned.
|
|
25
27
|
* @throws {StorageError} {@link StorageError}
|
|
26
28
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
27
29
|
*/
|
|
28
30
|
updateMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* 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.
|
|
31
33
|
* @throws {StorageError} {@link StorageError}
|
|
32
34
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
33
35
|
*/
|
|
34
36
|
putMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
35
37
|
/**
|
|
36
|
-
*
|
|
38
|
+
* The <i>removesMany</i> method removes the keys that are found. Returns true for the keys that are found otherwise false is returned.
|
|
37
39
|
* @throws {StorageError} {@link StorageError}
|
|
38
40
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
39
41
|
*/
|
|
40
42
|
removeMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
41
43
|
/**
|
|
42
|
-
*
|
|
44
|
+
* The <i>increment</i> method will increment the given <i>key</i> if found otherwise nonthing will occur.
|
|
45
|
+
* Returns true if key exists otherwise false will be returned.
|
|
46
|
+
* An error will thrown if the key is not a number.
|
|
43
47
|
* @throws {StorageError} {@link StorageError}
|
|
44
48
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
45
49
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
46
50
|
*/
|
|
47
51
|
increment(key: string, value: number): PromiseLike<boolean>;
|
|
48
52
|
/**
|
|
53
|
+
* The <i>clear</i> method removes all keys that starts <i>prefix</i>.
|
|
49
54
|
* @throws {StorageError} {@link StorageError}
|
|
50
55
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
51
56
|
*/
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
* @group Events
|
|
83
|
+
*/
|
|
84
|
+
export type KeysClearedStorageEvent = StorageEvent & {
|
|
85
|
+
type: (typeof STORAGE_EVENTS)["KEYS_CLEARED"];
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @group Events
|
|
89
|
+
*/
|
|
90
|
+
export type AllStorageEvents<TType = unknown> = KeysFoundStorageEvent<TType> | KeysNotFoundStorageEvent | KeysAddedStorageEvent<TType> | KeysUpdatedStorageEvent<TType> | KeysRemovedStorageEvent | KeysClearedStorageEvent | KeyIncrementedStorageEvent | KeyDecrementedStorageEvent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Storage
|
|
3
|
+
*/
|
|
4
|
+
import type { Validator } from "../../utilities/_module";
|
|
5
|
+
import type { INamespacedStorage } from "../../storage/contracts/storage.contract";
|
|
6
|
+
/**
|
|
7
|
+
* @group Contracts
|
|
8
|
+
*/
|
|
9
|
+
export type StorageManagerUseSettings<TType, TAdapters extends string = string> = {
|
|
10
|
+
adapter?: TAdapters;
|
|
11
|
+
validator?: Validator<TType>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The <i>IStorageManager</i> contract makes it easy to switch between different <i>{@link IStorageAdapter | storage adapters}</i> dynamically.
|
|
15
|
+
* @group Contracts
|
|
16
|
+
*/
|
|
17
|
+
export type IStorageManager<TAdapters extends string = string> = {
|
|
18
|
+
use<TType>(settings?: StorageManagerUseSettings<TType, TAdapters>): INamespacedStorage<TType>;
|
|
19
|
+
};
|
|
@@ -1,151 +1,176 @@
|
|
|
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
|
/**
|
|
9
|
+
* The <i>IStorage</i> contract defines a way for storing data as key-value pairs independent of storage.
|
|
10
|
+
* It commes with more convient methods compared to <i>IStorageAdapter</i>.
|
|
7
11
|
* @throws {StorageError} {@link StorageError}
|
|
8
12
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
9
13
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
10
14
|
* @group Contracts
|
|
11
15
|
*/
|
|
12
|
-
export type IStorage<TType = unknown> = {
|
|
16
|
+
export type IStorage<TType = unknown> = IListenable<AllStorageEvents<TType>> & {
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
namespace(name: string): IStorage<TType>;
|
|
17
|
-
/**
|
|
18
|
-
* Returns true when key is found otherwise false will be returned.
|
|
18
|
+
* The <i>exists</i> method returns true when <i>key</i> is found otherwise false will be returned.
|
|
19
19
|
* @throws {StorageError} {@link StorageError}
|
|
20
20
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
21
21
|
*/
|
|
22
22
|
exists(key: string): PromiseLike<boolean>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* The <i>existsMany</i> method returns true for the <i>keys</i> that are found otherwise false will be returned.
|
|
25
25
|
* @throws {StorageError} {@link StorageError}
|
|
26
26
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
27
27
|
*/
|
|
28
28
|
existsMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* The <i>missing</i> method returns true when <i>key</i> is not found otherwise false will be returned.
|
|
31
31
|
* @throws {StorageError} {@link StorageError}
|
|
32
32
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
33
33
|
*/
|
|
34
34
|
missing(key: string): PromiseLike<boolean>;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* The <i>missingMany</i> method returns true for the <i>keys</i> that are not found otherwise false will be returned.
|
|
37
37
|
* @throws {StorageError} {@link StorageError}
|
|
38
38
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
39
39
|
*/
|
|
40
40
|
missingMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* The <i>get</i> method returns the value when <i>key</i> is found otherwise null will be returned.
|
|
43
43
|
* @throws {StorageError} {@link StorageError}
|
|
44
44
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
45
45
|
*/
|
|
46
46
|
get(key: string): PromiseLike<TType | null>;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* The <i>getMany</i> returns the value for the <i>keys</i> that are found otherwise null will be returned.
|
|
49
49
|
* @throws {StorageError} {@link StorageError}
|
|
50
50
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
51
51
|
*/
|
|
52
52
|
getMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, TType | null>>;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* The <i>getOr</i> method returns the value when <i>key</i> is found otherwise <i>defaultValue</i> will be returned.
|
|
55
55
|
* @throws {StorageError} {@link StorageError}
|
|
56
56
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
57
57
|
*/
|
|
58
58
|
getOr(key: string, defaultValue: AsyncLazyable<TType>): PromiseLike<TType>;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* The <i>getOrMany</i> method returns the value for the keys that are found otherwise defaultValue will be returned.
|
|
61
61
|
* @throws {StorageError} {@link StorageError}
|
|
62
62
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
63
63
|
*/
|
|
64
64
|
getOrMany<TKeys extends string>(keysWithDefaults: Record<TKeys, AsyncLazyable<TType>>): PromiseLike<Record<TKeys, TType>>;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* The <i>getOrFail</i> method returns the value when <i>key</i> is found otherwise an error will be thrown.
|
|
67
67
|
* @throws {StorageError} {@link StorageError}
|
|
68
68
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
69
69
|
* @throws {KeyNotFoundStorageError} {@link KeyNotFoundStorageError}
|
|
70
70
|
*/
|
|
71
71
|
getOrFail(key: string): PromiseLike<TType>;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* 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.
|
|
74
74
|
* @throws {StorageError} {@link StorageError}
|
|
75
75
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
76
76
|
*/
|
|
77
77
|
add(key: string, value: StorageValue<TType>): PromiseLike<boolean>;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* 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.
|
|
80
80
|
* @throws {StorageError} {@link StorageError}
|
|
81
81
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
82
82
|
*/
|
|
83
83
|
addMany<TKeys extends string>(values: Record<TKeys, StorageValue<TType>>): PromiseLike<Record<TKeys, boolean>>;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* 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.
|
|
86
86
|
* @throws {StorageError} {@link StorageError}
|
|
87
87
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
88
88
|
*/
|
|
89
89
|
update(key: string, value: TType): PromiseLike<boolean>;
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* The <i>updateMany</i> method updates the given keys. Returns true for the keys that exists otherwise false will be returned.
|
|
92
92
|
* @throws {StorageError} {@link StorageError}
|
|
93
93
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
94
94
|
*/
|
|
95
95
|
updateMany<TKeys extends string>(values: Record<TKeys, TType>): PromiseLike<Record<TKeys, boolean>>;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* 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.
|
|
98
98
|
* @throws {StorageError} {@link StorageError}
|
|
99
99
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
100
100
|
*/
|
|
101
101
|
put(key: string, value: StorageValue<TType>): PromiseLike<boolean>;
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
103
|
+
* 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.
|
|
104
104
|
* @throws {StorageError} {@link StorageError}
|
|
105
105
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
106
106
|
*/
|
|
107
107
|
putMany<TKeys extends string>(values: Record<TKeys, StorageValue<TType>>): PromiseLike<Record<TKeys, boolean>>;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* The <i>remove</i> method removes the given <i>key</i> when found. Returns true if the key is found otherwise false is returned.
|
|
110
110
|
* @throws {StorageError} {@link StorageError}
|
|
111
111
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
112
112
|
*/
|
|
113
113
|
remove(key: string): PromiseLike<boolean>;
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* The <i>removesMany</i> method removes the keys that are found. Returns true for the keys that are found otherwise false is returned.
|
|
116
116
|
* @throws {StorageError} {@link StorageError}
|
|
117
117
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
118
118
|
*/
|
|
119
119
|
removeMany<TKeys extends string>(keys: TKeys[]): PromiseLike<Record<TKeys, boolean>>;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* The <i>getAndRemove</i> method removes the given <i>key</i> and returns it when found otherwise null will be returned.
|
|
122
122
|
* @throws {StorageError} {@link StorageError}
|
|
123
123
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
124
124
|
*/
|
|
125
125
|
getAndRemove(key: string): PromiseLike<TType | null>;
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* The <i>getOrAdd</i> method will retrieve the given <i>key</i> if found otherwise <i>valueToAdd</i> will be added and returned.
|
|
128
128
|
* @throws {StorageError} {@link StorageError}
|
|
129
129
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
130
130
|
*/
|
|
131
131
|
getOrAdd(key: string, valueToAdd: AsyncLazyable<StorageValue<GetOrAddValue<TType>>>): PromiseLike<TType>;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* The <i>increment</i> method will increment the given <i>key</i> if found otherwise nonthing will occur.
|
|
134
|
+
* Returns true if key exists otherwise false will be returned.
|
|
135
|
+
* An error will thrown if the key is not a number.
|
|
134
136
|
* @throws {StorageError} {@link StorageError}
|
|
135
137
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
136
138
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
137
139
|
*/
|
|
138
140
|
increment(key: string, value?: Extract<TType, number>): PromiseLike<boolean>;
|
|
139
141
|
/**
|
|
140
|
-
*
|
|
142
|
+
* The <i>decrement</i> method will decrement the given <i>key</i> if found otherwise nonthing will occur.
|
|
143
|
+
* Returns true if key exists otherwise false will be returned.
|
|
144
|
+
* An error will thrown if the key is not a number.
|
|
141
145
|
* @throws {StorageError} {@link StorageError}
|
|
142
146
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
143
147
|
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
148
|
+
* An error will thrown if the key is not a number.
|
|
144
149
|
*/
|
|
145
150
|
decrement(key: string, value?: Extract<TType, number>): PromiseLike<boolean>;
|
|
146
151
|
/**
|
|
152
|
+
* The <i>clear</i> method removes all the keys in the storage.
|
|
147
153
|
* @throws {StorageError} {@link StorageError}
|
|
148
154
|
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
149
155
|
*/
|
|
150
156
|
clear(): PromiseLike<void>;
|
|
151
157
|
};
|
|
158
|
+
/**
|
|
159
|
+
* The <i>INamespacedStorage</i> contract defines a way for storing data as key-value pairs independent of storage.
|
|
160
|
+
* It commes with one extra method which is useful for multitennat applications compared to <i>IStorage</i>.
|
|
161
|
+
* @throws {StorageError} {@link StorageError}
|
|
162
|
+
* @throws {UnexpectedStorageError} {@link UnexpectedStorageError}
|
|
163
|
+
* @throws {TypeStorageError} {@link TypeStorageError}
|
|
164
|
+
* @group Contracts
|
|
165
|
+
*/
|
|
166
|
+
export type INamespacedStorage<TType = unknown> = IStorage<TType> & {
|
|
167
|
+
/**
|
|
168
|
+
* 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>.
|
|
169
|
+
* This useful for multitennat applications.
|
|
170
|
+
*/
|
|
171
|
+
withNamespace(namespace: string): IStorage<TType>;
|
|
172
|
+
/**
|
|
173
|
+
* The <i>getNamespace</i> method return the complete namespace.
|
|
174
|
+
*/
|
|
175
|
+
getNamespace(): string;
|
|
176
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Storage
|
|
3
|
+
*/
|
|
4
|
+
import type { INamespacedStorage, IStorageAdapter, IStorageManager, StorageManagerUseSettings } from "../../../storage/contracts/_module";
|
|
5
|
+
import { type StorageSettings } from "../../../storage/implementations/storage/storage";
|
|
6
|
+
/**
|
|
7
|
+
* @group Derivables
|
|
8
|
+
*/
|
|
9
|
+
export type StorageManagerSettings<TAdapters extends string = string> = {
|
|
10
|
+
adapters: Record<TAdapters, IStorageAdapter<any>>;
|
|
11
|
+
defaultAdapter: NoInfer<TAdapters>;
|
|
12
|
+
adapterSettings?: Omit<StorageSettings<any>, "validator">;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @group Derivables
|
|
16
|
+
*/
|
|
17
|
+
export declare class StorageManager<TAdapters extends string = string> implements IStorageManager<TAdapters> {
|
|
18
|
+
private readonly adapters;
|
|
19
|
+
private readonly defaultAdapter;
|
|
20
|
+
private readonly adapterSettings;
|
|
21
|
+
constructor(settings: StorageManagerSettings<TAdapters>);
|
|
22
|
+
use<TType>(adapterSettings?: StorageManagerUseSettings<TType, TAdapters>): INamespacedStorage<TType>;
|
|
23
|
+
}
|