@daiso-tech/core 0.13.0 → 0.15.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 +1 -0
- package/dist/cjs/_module.js.map +1 -1
- package/dist/cjs/async/_module.js +20 -0
- package/dist/cjs/async/_module.js.map +1 -0
- package/dist/cjs/{utilities/async/_shared.js → async/async.errors.js} +1 -1
- package/dist/cjs/async/async.errors.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/_module.js +4 -4
- package/dist/cjs/async/backof-policies/_module.js.map +1 -0
- package/dist/cjs/async/backof-policies/_shared.js.map +1 -0
- package/dist/cjs/{utilities/async/delay-iterable → async/backof-policies/constant-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/cjs/async/backof-policies/exponential-backoff-policy/_module.js +18 -0
- package/dist/cjs/async/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/cjs/{utilities/async/abortable → async/backof-policies/linear-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/cjs/{utilities/async/abortable-iterable → async/backof-policies/polynomial-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/cjs/{event-bus/implementations/_shared/test-utilities → async/utilities}/_module.js +2 -1
- package/dist/cjs/async/utilities/_module.js.map +1 -0
- package/dist/cjs/async/utilities/abort/_module.js +19 -0
- package/dist/cjs/async/utilities/abort/_module.js.map +1 -0
- package/dist/cjs/async/utilities/abort/abort-and-fail.js +45 -0
- package/dist/cjs/async/utilities/abort/abort-and-fail.js.map +1 -0
- package/dist/cjs/async/utilities/abort/abort.js +18 -0
- package/dist/cjs/async/utilities/abort/abort.js.map +1 -0
- package/dist/cjs/{utilities/async/retry → async/utilities/delay}/_module.js +1 -1
- package/dist/cjs/async/utilities/delay/_module.js.map +1 -0
- package/dist/cjs/async/utilities/delay/delay.js +20 -0
- package/dist/cjs/async/utilities/delay/delay.js.map +1 -0
- package/dist/cjs/{utilities/async → async/utilities}/lazy-promise/_module.js +1 -1
- package/dist/cjs/async/utilities/lazy-promise/_module.js.map +1 -0
- package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js +95 -0
- package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js.map +1 -0
- package/dist/cjs/{utilities/async/delay → async/utilities/retry}/_module.js +2 -1
- package/dist/cjs/async/utilities/retry/_module.js.map +1 -0
- package/dist/cjs/async/utilities/retry/retry-or-fail.js +36 -0
- package/dist/cjs/async/utilities/retry/retry-or-fail.js.map +1 -0
- package/dist/cjs/async/utilities/retry/retry.js +18 -0
- package/dist/cjs/async/utilities/retry/retry.js.map +1 -0
- package/dist/cjs/{utilities/async → async/utilities}/timeout/_module.js +2 -1
- package/dist/cjs/async/utilities/timeout/_module.js.map +1 -0
- package/dist/cjs/async/utilities/timeout/timeout-and-fail.js +25 -0
- package/dist/cjs/async/utilities/timeout/timeout-and-fail.js.map +1 -0
- package/dist/cjs/async/utilities/timeout/timeout.js +18 -0
- package/dist/cjs/async/utilities/timeout/timeout.js.map +1 -0
- package/dist/cjs/cache/contracts/cache.events.js +0 -11
- package/dist/cjs/cache/contracts/cache.events.js.map +1 -1
- package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js +12 -11
- package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
- package/dist/cjs/cache/implementations/_shared/cache.test-suite.js +36 -35
- package/dist/cjs/cache/implementations/_shared/cache.test-suite.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/_module.js +1 -0
- package/dist/cjs/cache/implementations/adapters/_module.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +3 -3
- package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +1 -1
- package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/_module.js +18 -0
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/_module.js.map +1 -0
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +28 -0
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -0
- package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +1 -1
- package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +3 -3
- package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/base-cache.js +46 -38
- package/dist/cjs/cache/implementations/derivables/base-cache.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/cache-factory.js +3 -3
- package/dist/cjs/cache/implementations/derivables/cache-factory.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/cache.js +21 -23
- package/dist/cjs/cache/implementations/derivables/cache.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/_module.js +4 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +27 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +33 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +36 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +48 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js +48 -39
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js +5 -5
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js +5 -5
- package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/event-bus/contracts/event-bus.errors.js +3 -3
- package/dist/cjs/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/cjs/event-bus/implementations/_module.js +1 -1
- package/dist/cjs/event-bus/implementations/_module.js.map +1 -1
- package/dist/cjs/event-bus/implementations/_shared/_module.js +19 -0
- package/dist/cjs/event-bus/implementations/_shared/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/{test-utilities/event-bus-adapter.test-suite.js → event-bus-adapter.test-suite.js} +4 -3
- package/dist/cjs/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js +299 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -0
- package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +2 -3
- package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -1
- package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js +47 -0
- package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js.map +1 -0
- package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js +3 -9
- package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
- package/dist/cjs/event-bus/implementations/derivables/event-bus.js +20 -55
- package/dist/cjs/event-bus/implementations/derivables/event-bus.js.map +1 -1
- package/dist/cjs/utilities/_module.js +5 -4
- package/dist/cjs/utilities/_module.js.map +1 -1
- package/dist/cjs/utilities/contracts/_module.js +19 -0
- package/dist/cjs/utilities/contracts/_module.js.map +1 -0
- package/dist/cjs/utilities/contracts/deinitizable.contract.js +3 -0
- package/dist/cjs/utilities/contracts/deinitizable.contract.js.map +1 -0
- package/dist/cjs/utilities/contracts/initizable.contract.js +3 -0
- package/dist/cjs/utilities/contracts/initizable.contract.js.map +1 -0
- package/dist/cjs/utilities/{global-errors.js → errors.js} +1 -1
- package/dist/cjs/utilities/errors.js.map +1 -0
- package/dist/cjs/{_shared/utilities.js → utilities/functions.js} +1 -1
- package/dist/cjs/utilities/functions.js.map +1 -0
- package/dist/cjs/{_shared → utilities}/kysely/_module.js +1 -1
- package/dist/cjs/utilities/kysely/_module.js.map +1 -0
- package/dist/cjs/utilities/kysely/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/cjs/{_shared → utilities}/types.js.map +1 -1
- package/dist/esm/_module.js +1 -0
- package/dist/esm/_module.js.map +1 -1
- package/dist/esm/async/_module.js +4 -0
- package/dist/esm/async/_module.js.map +1 -0
- package/dist/esm/{utilities/async/_shared.js → async/async.errors.js} +1 -1
- package/dist/esm/async/async.errors.js.map +1 -0
- package/dist/esm/async/backof-policies/_module.js +5 -0
- package/dist/esm/async/backof-policies/_module.js.map +1 -0
- package/dist/esm/async/backof-policies/_shared.js.map +1 -0
- package/dist/esm/async/backof-policies/constant-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/exponential-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/linear-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/esm/async/utilities/_module.js +3 -0
- package/dist/esm/async/utilities/_module.js.map +1 -0
- package/dist/esm/async/utilities/abort/_module.js +3 -0
- package/dist/esm/async/utilities/abort/_module.js.map +1 -0
- package/dist/esm/{utilities/async/abortable/abortable.js → async/utilities/abort/abort-and-fail.js} +13 -16
- package/dist/esm/async/utilities/abort/abort-and-fail.js.map +1 -0
- package/dist/esm/async/utilities/abort/abort.js +15 -0
- package/dist/esm/async/utilities/abort/abort.js.map +1 -0
- package/dist/esm/async/utilities/delay/_module.js +2 -0
- package/dist/esm/async/utilities/delay/_module.js.map +1 -0
- package/dist/esm/async/utilities/delay/delay.js +17 -0
- package/dist/esm/async/utilities/delay/delay.js.map +1 -0
- package/dist/esm/async/utilities/lazy-promise/_module.js +2 -0
- package/dist/esm/async/utilities/lazy-promise/_module.js.map +1 -0
- package/dist/esm/async/utilities/lazy-promise/lazy-promise.js +91 -0
- package/dist/esm/async/utilities/lazy-promise/lazy-promise.js.map +1 -0
- package/dist/esm/async/utilities/retry/_module.js +3 -0
- package/dist/esm/async/utilities/retry/_module.js.map +1 -0
- package/dist/esm/async/utilities/retry/retry-or-fail.js +33 -0
- package/dist/esm/async/utilities/retry/retry-or-fail.js.map +1 -0
- package/dist/esm/async/utilities/retry/retry.js +15 -0
- package/dist/esm/async/utilities/retry/retry.js.map +1 -0
- package/dist/esm/async/utilities/timeout/_module.js +3 -0
- package/dist/esm/async/utilities/timeout/_module.js.map +1 -0
- package/dist/esm/async/utilities/timeout/timeout-and-fail.js +22 -0
- package/dist/esm/async/utilities/timeout/timeout-and-fail.js.map +1 -0
- package/dist/esm/async/utilities/timeout/timeout.js +15 -0
- package/dist/esm/async/utilities/timeout/timeout.js.map +1 -0
- package/dist/esm/cache/contracts/cache.events.js +0 -10
- package/dist/esm/cache/contracts/cache.events.js.map +1 -1
- package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js +2 -1
- package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
- package/dist/esm/cache/implementations/_shared/cache.test-suite.js +2 -1
- package/dist/esm/cache/implementations/_shared/cache.test-suite.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/_module.js +1 -0
- package/dist/esm/cache/implementations/adapters/_module.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +4 -4
- package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +2 -2
- package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/_module.js +2 -0
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/_module.js.map +1 -0
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +24 -0
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -0
- package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +2 -2
- package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +3 -3
- package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/base-cache.js +37 -29
- package/dist/esm/cache/implementations/derivables/base-cache.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/cache-factory.js +1 -1
- package/dist/esm/cache/implementations/derivables/cache-factory.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/cache.js +16 -18
- package/dist/esm/cache/implementations/derivables/cache.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/_module.js +4 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +23 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +29 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +32 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +44 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js +46 -37
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js +1 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js +1 -1
- package/dist/esm/event-bus/contracts/event-bus.errors.js +3 -3
- package/dist/esm/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/esm/event-bus/implementations/_module.js +1 -1
- package/dist/esm/event-bus/implementations/_module.js.map +1 -1
- package/dist/esm/event-bus/implementations/_shared/_module.js +3 -0
- package/dist/esm/event-bus/implementations/_shared/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/{test-utilities/event-bus-adapter.test-suite.js → event-bus-adapter.test-suite.js} +2 -1
- package/dist/esm/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js +296 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -0
- package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +3 -4
- package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +1 -1
- package/dist/esm/event-bus/implementations/derivables/base-event-bus.js +43 -0
- package/dist/esm/event-bus/implementations/derivables/base-event-bus.js.map +1 -0
- package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js +1 -7
- package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
- package/dist/esm/event-bus/implementations/derivables/event-bus.js +18 -53
- package/dist/esm/event-bus/implementations/derivables/event-bus.js.map +1 -1
- package/dist/esm/utilities/_module.js +5 -4
- package/dist/esm/utilities/_module.js.map +1 -1
- package/dist/esm/utilities/contracts/_module.js +3 -0
- package/dist/esm/utilities/contracts/_module.js.map +1 -0
- package/dist/esm/utilities/contracts/deinitizable.contract.js +1 -0
- package/dist/esm/utilities/contracts/deinitizable.contract.js.map +1 -0
- package/dist/esm/utilities/contracts/initizable.contract.js +1 -0
- package/dist/esm/utilities/contracts/initizable.contract.js.map +1 -0
- package/dist/esm/utilities/{global-errors.js → errors.js} +1 -1
- package/dist/esm/utilities/errors.js.map +1 -0
- package/dist/esm/{_shared/utilities.js → utilities/functions.js} +1 -1
- package/dist/esm/utilities/functions.js.map +1 -0
- package/dist/esm/utilities/kysely/_module.js +2 -0
- package/dist/esm/utilities/kysely/_module.js.map +1 -0
- package/dist/esm/utilities/kysely/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/esm/{_shared → utilities}/types.js.map +1 -1
- package/dist/types/_module.d.ts +1 -0
- package/dist/types/async/_module.d.ts +3 -0
- package/dist/types/{utilities/async/_shared.d.ts → async/async.errors.d.ts} +6 -6
- package/dist/types/async/backof-policies/_module.d.ts +5 -0
- package/dist/types/{utilities → async}/backof-policies/_shared.d.ts +1 -1
- package/dist/types/async/backof-policies/constant-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/exponential-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/linear-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/polynomial-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
- package/dist/types/async/utilities/_module.d.ts +2 -0
- package/dist/types/async/utilities/abort/_module.d.ts +2 -0
- package/dist/types/async/utilities/abort/abort-and-fail.d.ts +4 -0
- package/dist/types/async/utilities/abort/abort.d.ts +9 -0
- package/dist/types/async/utilities/delay/_module.d.ts +1 -0
- package/dist/types/async/utilities/delay/delay.d.ts +19 -0
- package/dist/types/async/utilities/lazy-promise/_module.d.ts +1 -0
- package/dist/types/async/utilities/lazy-promise/lazy-promise.d.ts +185 -0
- package/dist/types/async/utilities/retry/_module.d.ts +2 -0
- package/dist/types/async/utilities/retry/retry-or-fail.d.ts +23 -0
- package/dist/types/async/utilities/retry/retry.d.ts +10 -0
- package/dist/types/async/utilities/timeout/_module.d.ts +2 -0
- package/dist/types/async/utilities/timeout/timeout-and-fail.d.ts +5 -0
- package/dist/types/async/utilities/timeout/timeout.d.ts +10 -0
- package/dist/types/cache/contracts/cache-adapter.contract.d.ts +1 -1
- package/dist/types/cache/contracts/cache.contract.d.ts +7 -28
- package/dist/types/cache/contracts/cache.events.d.ts +30 -79
- package/dist/types/cache/implementations/_shared/cache-adapter.test-suite.d.ts +26 -24
- package/dist/types/cache/implementations/_shared/cache.test-suite.d.ts +54 -43
- package/dist/types/cache/implementations/adapters/_module.d.ts +1 -0
- package/dist/types/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +1 -1
- package/dist/types/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +23 -4
- package/dist/types/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +15 -0
- package/dist/types/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +20 -4
- package/dist/types/cache/implementations/adapters/no-op-cache-adapter/_module.d.ts +1 -0
- package/dist/types/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +18 -0
- package/dist/types/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +14 -2
- package/dist/types/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +20 -3
- package/dist/types/cache/implementations/derivables/base-cache.d.ts +15 -14
- package/dist/types/cache/implementations/derivables/cache.d.ts +7 -4
- package/dist/types/collection/contracts/async-collection.contract.d.ts +10 -6
- package/dist/types/collection/contracts/collection.contract.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/_module.d.ts +4 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-split-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.d.ts +9 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +4 -3
- package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
- package/dist/types/collection/implementations/list-collection/list-collection.d.ts +1 -1
- package/dist/types/event-bus/contracts/_shared.d.ts +2 -5
- package/dist/types/event-bus/contracts/event-bus-adapter.contract.d.ts +4 -1
- package/dist/types/event-bus/contracts/event-bus-factory.contract.d.ts +3 -28
- package/dist/types/event-bus/contracts/event-bus.contract.d.ts +24 -16
- package/dist/types/event-bus/contracts/event-bus.errors.d.ts +3 -3
- package/dist/types/event-bus/implementations/_module.d.ts +1 -1
- package/dist/types/event-bus/implementations/_shared/_module.d.ts +2 -0
- package/dist/types/event-bus/implementations/_shared/event-bus-adapter.test-suite.d.ts +59 -0
- package/dist/types/event-bus/implementations/_shared/event-bus.test-suite.d.ts +72 -0
- package/dist/types/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +16 -0
- package/dist/types/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.d.ts +16 -1
- package/dist/types/event-bus/implementations/derivables/base-event-bus.d.ts +23 -0
- package/dist/types/event-bus/implementations/derivables/event-bus-factory.d.ts +4 -7
- package/dist/types/event-bus/implementations/derivables/event-bus.d.ts +11 -53
- package/dist/types/serializer/implementations/_shared/test-utilities/serializer.test-suite.d.ts +1 -1
- package/dist/types/utilities/_module.d.ts +5 -4
- package/dist/types/utilities/contracts/_module.d.ts +2 -0
- package/dist/types/utilities/contracts/deinitizable.contract.d.ts +9 -0
- package/dist/types/utilities/contracts/initizable.contract.d.ts +9 -0
- package/dist/types/utilities/{global-errors.d.ts → errors.d.ts} +10 -1
- package/dist/types/{_shared/utilities.d.ts → utilities/functions.d.ts} +3 -3
- package/dist/types/utilities/kysely/_module.d.ts +1 -0
- package/dist/types/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.d.ts +1 -1
- package/dist/types/{_shared → utilities}/types.d.ts +3 -8
- package/package.json +1 -1
- package/dist/cjs/_shared/kysely/_module.js.map +0 -1
- package/dist/cjs/_shared/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/cjs/_shared/redis/_module.js +0 -20
- package/dist/cjs/_shared/redis/_module.js.map +0 -1
- package/dist/cjs/_shared/redis/clear-iterable.js +0 -25
- package/dist/cjs/_shared/redis/clear-iterable.js.map +0 -1
- package/dist/cjs/_shared/redis/escape-redis-chars.js +0 -41
- package/dist/cjs/_shared/redis/escape-redis-chars.js.map +0 -1
- package/dist/cjs/_shared/redis/is-redis-type-error.js +0 -9
- package/dist/cjs/_shared/redis/is-redis-type-error.js.map +0 -1
- package/dist/cjs/_shared/utilities.js.map +0 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js +0 -31
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +0 -1
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +0 -1
- package/dist/cjs/event-bus/implementations/derivables/with-validation-event-bus-adapter.js +0 -35
- package/dist/cjs/event-bus/implementations/derivables/with-validation-event-bus-adapter.js.map +0 -1
- package/dist/cjs/utilities/async/_module.js +0 -29
- package/dist/cjs/utilities/async/_module.js.map +0 -1
- package/dist/cjs/utilities/async/_shared.js.map +0 -1
- package/dist/cjs/utilities/async/abortable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/abortable/abortable.js +0 -48
- package/dist/cjs/utilities/async/abortable/abortable.js.map +0 -1
- package/dist/cjs/utilities/async/abortable-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js +0 -32
- package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/delay/_module.js.map +0 -1
- package/dist/cjs/utilities/async/delay/delay.js +0 -24
- package/dist/cjs/utilities/async/delay/delay.js.map +0 -1
- package/dist/cjs/utilities/async/delay-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js +0 -36
- package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/lazy-promise/_module.js.map +0 -1
- package/dist/cjs/utilities/async/lazy-promise/lazy-promise.js +0 -22
- package/dist/cjs/utilities/async/lazy-promise/lazy-promise.js.map +0 -1
- package/dist/cjs/utilities/async/retry/_module.js.map +0 -1
- package/dist/cjs/utilities/async/retry/retry.js +0 -43
- package/dist/cjs/utilities/async/retry/retry.js.map +0 -1
- package/dist/cjs/utilities/async/retry-iterable/_module.js +0 -18
- package/dist/cjs/utilities/async/retry-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js +0 -32
- package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/timeout/_module.js.map +0 -1
- package/dist/cjs/utilities/async/timeout/timeout.js +0 -28
- package/dist/cjs/utilities/async/timeout/timeout.js.map +0 -1
- package/dist/cjs/utilities/async/timeout-iterable/_module.js +0 -18
- package/dist/cjs/utilities/async/timeout-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js +0 -11
- package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/_shared.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/global-errors.js.map +0 -1
- package/dist/cjs/utilities/validation/_module.js +0 -22
- package/dist/cjs/utilities/validation/_module.js.map +0 -1
- package/dist/esm/_shared/kysely/_module.js +0 -2
- package/dist/esm/_shared/kysely/_module.js.map +0 -1
- package/dist/esm/_shared/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/esm/_shared/redis/_module.js +0 -4
- package/dist/esm/_shared/redis/_module.js.map +0 -1
- package/dist/esm/_shared/redis/clear-iterable.js +0 -21
- package/dist/esm/_shared/redis/clear-iterable.js.map +0 -1
- package/dist/esm/_shared/redis/escape-redis-chars.js +0 -38
- package/dist/esm/_shared/redis/escape-redis-chars.js.map +0 -1
- package/dist/esm/_shared/redis/is-redis-type-error.js +0 -6
- package/dist/esm/_shared/redis/is-redis-type-error.js.map +0 -1
- package/dist/esm/_shared/utilities.js.map +0 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js +0 -27
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +0 -1
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js +0 -2
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +0 -1
- package/dist/esm/event-bus/implementations/derivables/with-validation-event-bus-adapter.js +0 -31
- package/dist/esm/event-bus/implementations/derivables/with-validation-event-bus-adapter.js.map +0 -1
- package/dist/esm/utilities/async/_module.js +0 -11
- package/dist/esm/utilities/async/_module.js.map +0 -1
- package/dist/esm/utilities/async/_shared.js.map +0 -1
- package/dist/esm/utilities/async/abortable/_module.js +0 -2
- package/dist/esm/utilities/async/abortable/_module.js.map +0 -1
- package/dist/esm/utilities/async/abortable/abortable.js.map +0 -1
- package/dist/esm/utilities/async/abortable-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/abortable-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js +0 -29
- package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/esm/utilities/async/delay/_module.js +0 -2
- package/dist/esm/utilities/async/delay/_module.js.map +0 -1
- package/dist/esm/utilities/async/delay/delay.js +0 -21
- package/dist/esm/utilities/async/delay/delay.js.map +0 -1
- package/dist/esm/utilities/async/delay-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/delay-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/delay-iterable/delay-iterable.js +0 -33
- package/dist/esm/utilities/async/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/esm/utilities/async/lazy-promise/_module.js +0 -2
- package/dist/esm/utilities/async/lazy-promise/_module.js.map +0 -1
- package/dist/esm/utilities/async/lazy-promise/lazy-promise.js +0 -17
- package/dist/esm/utilities/async/lazy-promise/lazy-promise.js.map +0 -1
- package/dist/esm/utilities/async/retry/_module.js +0 -2
- package/dist/esm/utilities/async/retry/_module.js.map +0 -1
- package/dist/esm/utilities/async/retry/retry.js +0 -40
- package/dist/esm/utilities/async/retry/retry.js.map +0 -1
- package/dist/esm/utilities/async/retry-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/retry-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/retry-iterable/retry-iterable.js +0 -29
- package/dist/esm/utilities/async/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/esm/utilities/async/timeout/_module.js +0 -2
- package/dist/esm/utilities/async/timeout/_module.js.map +0 -1
- package/dist/esm/utilities/async/timeout/timeout.js +0 -25
- package/dist/esm/utilities/async/timeout/timeout.js.map +0 -1
- package/dist/esm/utilities/async/timeout-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/timeout-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js +0 -8
- package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/esm/utilities/backof-policies/_module.js +0 -5
- package/dist/esm/utilities/backof-policies/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/_shared.js.map +0 -1
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/global-errors.js.map +0 -1
- package/dist/esm/utilities/validation/_module.js +0 -17
- package/dist/esm/utilities/validation/_module.js.map +0 -1
- package/dist/types/_shared/kysely/_module.d.ts +0 -1
- package/dist/types/_shared/redis/_module.d.ts +0 -3
- package/dist/types/_shared/redis/clear-iterable.d.ts +0 -13
- package/dist/types/_shared/redis/escape-redis-chars.d.ts +0 -7
- package/dist/types/_shared/redis/is-redis-type-error.d.ts +0 -7
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +0 -12
- package/dist/types/event-bus/implementations/_shared/test-utilities/_module.d.ts +0 -1
- package/dist/types/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.d.ts +0 -36
- package/dist/types/event-bus/implementations/derivables/with-validation-event-bus-adapter.d.ts +0 -17
- package/dist/types/utilities/async/_module.d.ts +0 -10
- package/dist/types/utilities/async/abortable/_module.d.ts +0 -1
- package/dist/types/utilities/async/abortable/abortable.d.ts +0 -39
- package/dist/types/utilities/async/abortable-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/abortable-iterable/abortable-iterable.d.ts +0 -36
- package/dist/types/utilities/async/delay/_module.d.ts +0 -1
- package/dist/types/utilities/async/delay/delay.d.ts +0 -38
- package/dist/types/utilities/async/delay-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/delay-iterable/delay-iterable.d.ts +0 -57
- package/dist/types/utilities/async/lazy-promise/_module.d.ts +0 -1
- package/dist/types/utilities/async/lazy-promise/lazy-promise.d.ts +0 -28
- package/dist/types/utilities/async/retry/_module.d.ts +0 -1
- package/dist/types/utilities/async/retry/retry.d.ts +0 -89
- package/dist/types/utilities/async/retry-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/retry-iterable/retry-iterable.d.ts +0 -86
- package/dist/types/utilities/async/timeout/_module.d.ts +0 -1
- package/dist/types/utilities/async/timeout/timeout.d.ts +0 -40
- package/dist/types/utilities/async/timeout-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/timeout-iterable/timeout-iterable.d.ts +0 -64
- package/dist/types/utilities/backof-policies/_module.d.ts +0 -5
- package/dist/types/utilities/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/validation/_module.d.ts +0 -32
- /package/dist/cjs/{utilities → async}/backof-policies/_shared.js +0 -0
- /package/dist/cjs/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.js +0 -0
- /package/dist/cjs/{_shared → utilities}/types.js +0 -0
- /package/dist/esm/{utilities → async}/backof-policies/_shared.js +0 -0
- /package/dist/esm/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.js +0 -0
- /package/dist/esm/{_shared → utilities}/types.js +0 -0
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import type { AsyncReduce, CrossJoinResult, AsyncPredicate, AsyncForEach, AsyncMap, AsyncModifier, AsyncTap, AsyncTransform, Comparator, EnsureRecord, EnsureMap } from "../../collection/contracts/_module";
|
|
5
|
-
import type { AsyncLazyable, AsyncIterableValue } from "../../
|
|
6
|
-
import type {
|
|
5
|
+
import type { AsyncLazyable, AsyncIterableValue } from "../../utilities/_module";
|
|
6
|
+
import type { TimeSpan } from "../../utilities/_module";
|
|
7
|
+
import type { LazyPromise } from "../../async/_module";
|
|
7
8
|
export type AsyncCollapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | IAsyncCollection<infer TItem> ? TItem : TValue;
|
|
8
9
|
/**
|
|
9
10
|
* The <i>IAsyncCollection</i> contract offers a fluent and efficient approach to working with {@link AsyncIterable} objects.
|
|
@@ -1485,7 +1486,9 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
1485
1486
|
*/
|
|
1486
1487
|
delay(time: TimeSpan): IAsyncCollection<TInput>;
|
|
1487
1488
|
/**
|
|
1488
|
-
*
|
|
1489
|
+
* @experimental
|
|
1490
|
+
* The <I>takeUntilAbort</i> method returns a new collection that will iterate values until aborted by passing in <i>{@link abortSignal | AbortSignal}</i>.
|
|
1491
|
+
* After when aborted, the collection will stop iterating:
|
|
1489
1492
|
* @example
|
|
1490
1493
|
* ```ts
|
|
1491
1494
|
* import { AsyncIterableCollection } from "@daiso-tech/core";;
|
|
@@ -1499,8 +1502,9 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
1499
1502
|
*/
|
|
1500
1503
|
takeUntilAbort(abortSignal: AbortSignal, shouldThrow?: boolean): IAsyncCollection<TInput>;
|
|
1501
1504
|
/**
|
|
1502
|
-
*
|
|
1503
|
-
*
|
|
1505
|
+
* @experimental
|
|
1506
|
+
* The <I>takeUntilTimeout</i> method returns a new collection that will iterate values until the specified time.
|
|
1507
|
+
* After that time, the collection will stop iterating:
|
|
1504
1508
|
* @example
|
|
1505
1509
|
* ```ts
|
|
1506
1510
|
* import { AsyncIterableCollection } from "@daiso-tech/core";;
|
|
@@ -1519,7 +1523,7 @@ export type IAsyncCollection<TInput> = AsyncIterable<TInput> & {
|
|
|
1519
1523
|
* .forEach(nbr => console.log(nbr))
|
|
1520
1524
|
* ```
|
|
1521
1525
|
*/
|
|
1522
|
-
takeUntilTimeout(
|
|
1526
|
+
takeUntilTimeout(time: TimeSpan, shouldThrow?: boolean): IAsyncCollection<TInput>;
|
|
1523
1527
|
/**
|
|
1524
1528
|
* The <i>toArray</i> method converts the collection to a new <i>{@link Array}</i>.
|
|
1525
1529
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import type { Comparator, Predicate, ForEach, Map, Modifier, Tap, Transform, Reduce, CrossJoinResult, EnsureMap, EnsureRecord } from "../../collection/contracts/_module";
|
|
5
|
-
import type { Lazyable } from "../../
|
|
5
|
+
import type { Lazyable } from "../../utilities/_module";
|
|
6
6
|
export type Collapse<TValue> = TValue extends Array<infer TItem> | Iterable<infer TItem> | ICollection<infer TItem> ? TItem : TValue;
|
|
7
7
|
/**
|
|
8
8
|
* The <i>ICollection</i> contract offers a fluent and efficient approach to working with {@link Iterable} objects.
|
package/dist/types/collection/implementations/async-iterable-collection/_shared/_module.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from "../../../../collection/implementations/async-iterable-collection/
|
|
|
4
4
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-count-by-iterable";
|
|
5
5
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable";
|
|
6
6
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-entries-iterable";
|
|
7
|
-
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable";
|
|
8
7
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-filter-iterable";
|
|
9
8
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-flat-map-iterable";
|
|
10
9
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-group-by-iterable";
|
|
@@ -31,3 +30,7 @@ export * from "../../../../collection/implementations/async-iterable-collection/
|
|
|
31
30
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-update-iterable";
|
|
32
31
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-when-iterable";
|
|
33
32
|
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-zip-iterable";
|
|
33
|
+
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable";
|
|
34
|
+
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable";
|
|
35
|
+
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-delay-iterable";
|
|
36
|
+
export * from "../../../../collection/implementations/async-iterable-collection/_shared/async-retry-iterable";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type AsyncPredicate, type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { CrossJoinResult } from "../../../../collection/contracts/_module";
|
|
5
5
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
6
|
-
import { type AsyncIterableValue } from "../../../../
|
|
6
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Collection
|
|
3
|
+
*/
|
|
4
|
+
import type { TimeSpan } from "../../../../utilities/_module";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class AsyncDelayIterable<TValue> implements AsyncIterable<TValue> {
|
|
9
|
+
private readonly iterable;
|
|
10
|
+
private readonly time;
|
|
11
|
+
constructor(iterable: AsyncIterable<TValue>, time: TimeSpan);
|
|
12
|
+
[Symbol.asyncIterator](): AsyncIterator<TValue>;
|
|
13
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type AsyncMap, type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type AsyncPredicate, type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type AsyncPredicate, type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type AsyncPredicate, type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Collection
|
|
3
|
+
*/
|
|
4
|
+
import { type RetrySettings } from "../../../../async/utilities/retry/_module";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class AsyncRetryIterable<TValue> implements AsyncIterable<TValue> {
|
|
9
|
+
private readonly iterable;
|
|
10
|
+
private readonly settings?;
|
|
11
|
+
constructor(iterable: AsyncIterable<TValue>, settings?: RetrySettings | undefined);
|
|
12
|
+
[Symbol.asyncIterator](): AsyncIterator<TValue>;
|
|
13
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Collection
|
|
3
3
|
*/
|
|
4
4
|
import { type IAsyncCollection } from "../../../../collection/contracts/_module";
|
|
5
|
-
import { type AsyncIterableValue } from "../../../../
|
|
5
|
+
import { type AsyncIterableValue } from "../../../../utilities/_module";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare class AsyncTakeUntilAbortIterable<TValue> implements AsyncIterable<TValue> {
|
|
5
|
+
private readonly iterable;
|
|
6
|
+
private readonly abortSignal;
|
|
7
|
+
constructor(iterable: AsyncIterable<TValue>, abortSignal: AbortSignal);
|
|
8
|
+
[Symbol.asyncIterator](): AsyncIterator<TValue>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Collection
|
|
3
|
+
*/
|
|
4
|
+
import { type TimeSpan } from "../../../../utilities/_module";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class AsyncTakeUntilTimeoutIterable<TInput> implements AsyncIterable<TInput> {
|
|
9
|
+
private readonly iterable;
|
|
10
|
+
private readonly time;
|
|
11
|
+
constructor(iterable: AsyncIterable<TInput>, time: TimeSpan);
|
|
12
|
+
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
13
|
+
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module";
|
|
5
5
|
import { type AsyncCollapse, type AsyncPredicate, type AsyncForEach, type AsyncMap, type AsyncModifier, type AsyncTap, type AsyncTransform, type Comparator, type IAsyncCollection, type AsyncReduce, type CrossJoinResult } from "../../../collection/contracts/_module";
|
|
6
|
-
import { type AsyncIterableValue, type AsyncLazyable } from "../../../
|
|
6
|
+
import { type AsyncIterableValue, type AsyncLazyable } from "../../../utilities/_module";
|
|
7
7
|
import type { TimeSpan } from "../../../utilities/_module";
|
|
8
|
-
import { LazyPromise } from "../../../
|
|
8
|
+
import { LazyPromise } from "../../../async/_module";
|
|
9
9
|
/**
|
|
10
10
|
* All methods that return <i>{@link IAsyncCollection}</i> are executed lazly.
|
|
11
11
|
* The methods that return <i>{@link IAsyncCollection}</i> will only be executed when <i>forEach</i> method is called or <i>for await</i> loop.
|
|
@@ -14,6 +14,7 @@ import { LazyPromise } from "../../../utilities/_module";
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class AsyncIterableCollection<TInput> implements IAsyncCollection<TInput> {
|
|
16
16
|
private readonly iterable;
|
|
17
|
+
private static createLazyPromise;
|
|
17
18
|
private static DEFAULT_CHUNK_SIZE;
|
|
18
19
|
private static makeCollection;
|
|
19
20
|
/**
|
|
@@ -97,7 +98,7 @@ export declare class AsyncIterableCollection<TInput> implements IAsyncCollection
|
|
|
97
98
|
nth(step: number): IAsyncCollection<TInput>;
|
|
98
99
|
delay(time: TimeSpan): IAsyncCollection<TInput>;
|
|
99
100
|
takeUntilAbort(abortSignal: AbortSignal): IAsyncCollection<TInput>;
|
|
100
|
-
takeUntilTimeout(
|
|
101
|
+
takeUntilTimeout(time: TimeSpan): IAsyncCollection<TInput>;
|
|
101
102
|
count(predicateFn: AsyncPredicate<TInput, IAsyncCollection<TInput>>): LazyPromise<number>;
|
|
102
103
|
size(): LazyPromise<number>;
|
|
103
104
|
isEmpty(): LazyPromise<boolean>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module";
|
|
5
5
|
import { type Collapse, type Comparator, type Predicate, type ForEach, type ICollection, type Map, type Modifier, type Tap, type Transform, type Reduce, type CrossJoinResult } from "../../../collection/contracts/_module";
|
|
6
|
-
import { type Lazyable } from "../../../
|
|
6
|
+
import { type Lazyable } from "../../../utilities/_module";
|
|
7
7
|
/**
|
|
8
8
|
* All methods that return <i>{@link ICollection}</i> are executed lazly which means they will be executed when the <i>IterableCollection</i> is iterated with <i>forEach</i> method or "for of" loop.
|
|
9
9
|
* The rest of the methods are executed eagerly.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { EnsureMap, EnsureRecord } from "../../../collection/contracts/_module";
|
|
5
5
|
import { type Collapse, type Comparator, type Predicate, type ICollection, type Map, type Modifier, type Tap, type Transform, type Reduce, type ForEach, type CrossJoinResult } from "../../../collection/contracts/_module";
|
|
6
|
-
import { type Lazyable } from "../../../
|
|
6
|
+
import { type Lazyable } from "../../../utilities/_module";
|
|
7
7
|
/**
|
|
8
8
|
* All methods in <i>ListCollection</i> are executed eagerly.
|
|
9
9
|
* @group Adapters
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module EventBus
|
|
3
3
|
*/
|
|
4
|
-
import type { Promisable } from "../../
|
|
5
|
-
export type
|
|
6
|
-
type: string;
|
|
7
|
-
};
|
|
8
|
-
export type Listener<TEvent extends IBaseEvent> = (event: TEvent) => Promisable<void>;
|
|
4
|
+
import type { Promisable } from "../../utilities/_module";
|
|
5
|
+
export type Listener<TEvent> = (event: TEvent) => Promisable<void>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module EventBus
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { Listener } from "../../event-bus/contracts/_shared";
|
|
5
|
+
export type IBaseEvent = {
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
5
8
|
/**
|
|
6
9
|
* The <i>IEventBusAdapter</i> contract defines a way for dispatching and listening to events independent of underlying technology.
|
|
7
10
|
* This interface is not meant to be used directly, instead you should use <i>IEventBus</i>
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module EventBus
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
import type { INamespacedEventBus } from "../../event-bus/contracts/event-bus.contract";
|
|
6
|
-
import type { IBaseEvent } from "../../event-bus/contracts/_shared";
|
|
4
|
+
import type { BaseEvents, INamespacedEventBus } from "../../event-bus/contracts/event-bus.contract";
|
|
7
5
|
/**
|
|
8
6
|
* The <i>IEventBusFactory</i> contract makes it easy to configure and switch between different <i>{@link INamespacedEventBus}</i> dynamically.
|
|
9
7
|
* @group Contracts
|
|
10
8
|
*/
|
|
11
|
-
export type IEventBusFactory<TDrivers extends string = string, TEvents extends
|
|
9
|
+
export type IEventBusFactory<TDrivers extends string = string, TEvents extends BaseEvents = BaseEvents> = {
|
|
12
10
|
/**
|
|
13
11
|
* The <i>use</i> method will throw an error if you provide it unregisted driver.
|
|
14
12
|
* If no default driver is defined an error will be thrown by <i>use</i> method.
|
|
@@ -31,34 +29,11 @@ export type IEventBusFactory<TDrivers extends string = string, TEvents extends I
|
|
|
31
29
|
* ```
|
|
32
30
|
*/
|
|
33
31
|
use(driverName?: TDrivers): INamespacedEventBus<TEvents>;
|
|
34
|
-
/**
|
|
35
|
-
* The <i>withValidation</i> method is used to set a <i>validator</i>, which validates the event during runtime.
|
|
36
|
-
* The type is inferred from the provided <i>validator</i>.
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* import { type IEventBusFactory, zodValidator } from "@daiso-tech/core";
|
|
40
|
-
* import { z } from "zod"
|
|
41
|
-
*
|
|
42
|
-
* async function main(eventBusFactory: IEventBusFactory): Promise<void> {
|
|
43
|
-
* const addEventSchema = z.zod({
|
|
44
|
-
* type: z.literal("add"),
|
|
45
|
-
* a: z.number(),
|
|
46
|
-
* b: z.number(),
|
|
47
|
-
* });
|
|
48
|
-
* await eventBusFactory
|
|
49
|
-
* .withValidation(zodValidator(addEventSchema))
|
|
50
|
-
* .use()
|
|
51
|
-
* // You will se an typescript error and get runtime erorr
|
|
52
|
-
* .dispatch({ type: "add" });
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
withValidation<TOutput extends TEvents = TEvents>(validator: Validator<TOutput>): IEventBusFactory<TDrivers, TOutput>;
|
|
57
32
|
/**
|
|
58
33
|
* The <i>withTypes</i> method is used to set the event types of the <i>{@link IEventBus}</i>.
|
|
59
34
|
* @example
|
|
60
35
|
* ```ts
|
|
61
|
-
* import { type IEventBusFactory
|
|
36
|
+
* import { type IEventBusFactory } from "@daiso-tech/core";
|
|
62
37
|
*
|
|
63
38
|
* async function main(eventBusFactory: IEventBusFactory): Promise<void> {
|
|
64
39
|
* type AddEvent = {
|
|
@@ -1,71 +1,79 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module EventBus
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
export type
|
|
8
|
-
|
|
4
|
+
import type { OneOrMore, Values } from "../../utilities/_module";
|
|
5
|
+
import type { LazyPromise } from "../../async/_module";
|
|
6
|
+
import type { Listener } from "../../event-bus/contracts/_shared";
|
|
7
|
+
export type BaseEvents = Record<string, Record<string, unknown>>;
|
|
8
|
+
export type AllEvents<TEvents extends BaseEvents> = Values<{
|
|
9
|
+
[TEventName in keyof TEvents]: TEvents[TEventName] & {
|
|
10
|
+
type: TEventName;
|
|
11
|
+
};
|
|
9
12
|
}>;
|
|
13
|
+
export type SelectEvent<TEvents extends BaseEvents, TEventName extends keyof TEvents> = {
|
|
14
|
+
[TEventName in keyof TEvents]: TEvents[TEventName] & {
|
|
15
|
+
type: TEventName;
|
|
16
|
+
};
|
|
17
|
+
}[TEventName];
|
|
10
18
|
export type Unsubscribe = () => LazyPromise<void>;
|
|
11
19
|
/**
|
|
12
20
|
* The <i>IListenable</i> contract defines a way listening to events independent of underlying technology
|
|
13
21
|
* @group Contracts
|
|
14
22
|
*/
|
|
15
|
-
export type IListenable<TEvents extends
|
|
23
|
+
export type IListenable<TEvents extends BaseEvents = BaseEvents> = {
|
|
16
24
|
/**
|
|
17
25
|
* The <i>addListener</i> method is used for adding <i>{@link Listener | listener}</i> for certain <i>event</i>.
|
|
18
26
|
* A listener can only be added once for a specific event. Adding the same listener multiple times will have no effect and nothing will occur.
|
|
19
27
|
* @throws {AddListenerEventBusError} {@link AddListenerEventBusError}
|
|
20
28
|
*/
|
|
21
|
-
addListener<
|
|
29
|
+
addListener<TEventName extends keyof TEvents>(eventName: TEventName, listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<void>;
|
|
22
30
|
/**
|
|
23
31
|
* The <i>addListenerMany</i> method is used for adding multiple <i>{@link Listener | listeners}</i> for certain <i>events</i>.
|
|
24
32
|
* A listener can only be added once for a specific event. Adding the same listener multiple times will have no effect and nothing will occur.
|
|
25
33
|
* @throws {AddListenerEventBusError} {@link AddListenerEventBusError}
|
|
26
34
|
*/
|
|
27
|
-
addListenerMany<
|
|
35
|
+
addListenerMany<TEventName extends keyof TEvents>(eventNames: TEventName[], listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<void>;
|
|
28
36
|
/**
|
|
29
37
|
* The <i>removeListener</i> method is used for removing <i>{@link Listener | listener}</i> for certain <i>event</i>.
|
|
30
38
|
* Removing unadded listener will have no effect and nothing will occur.
|
|
31
39
|
* @throws {RemoveListenerEventBusError} {@link RemoveListenerEventBusError}
|
|
32
40
|
*/
|
|
33
|
-
removeListener<
|
|
41
|
+
removeListener<TEventName extends keyof TEvents>(eventName: TEventName, listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<void>;
|
|
34
42
|
/**
|
|
35
43
|
* The <i>removeListener</i> method is used for removing multiple <i>{@link Listener | listeners}</i> for certain <i>event</i>.
|
|
36
44
|
* Removing unadded listener will have no effect and nothing will occur.
|
|
37
45
|
* @throws {RemoveListenerEventBusError} {@link RemoveListenerEventBusError}
|
|
38
46
|
*/
|
|
39
|
-
removeListenerMany<
|
|
47
|
+
removeListenerMany<TEventName extends keyof TEvents>(eventNames: TEventName[], listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<void>;
|
|
40
48
|
/**
|
|
41
49
|
* The <i>subscribe</i> method is used for adding <i>{@link Listener | listener}</i> for certain <i>event</i>.
|
|
42
50
|
* A listener can only be added once for a specific event. Adding the same listener multiple times will have no effect and nothing will occur.
|
|
43
51
|
*/
|
|
44
|
-
subscribe<
|
|
52
|
+
subscribe<TEventName extends keyof TEvents>(eventName: TEventName, listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<Unsubscribe>;
|
|
45
53
|
/**
|
|
46
54
|
* The <i>subscribeMany</i> method is used for adding <i>{@link Listener | listener}</i> for multiple <i>events</i>.
|
|
47
55
|
* A listener can only be added once for a specific event. Adding the same listener multiple times will have no effect and nothing will occur.
|
|
48
56
|
*/
|
|
49
|
-
subscribeMany<
|
|
57
|
+
subscribeMany<TEventName extends keyof TEvents>(eventNames: TEventName[], listener: Listener<SelectEvent<TEvents, TEventName>>): LazyPromise<Unsubscribe>;
|
|
50
58
|
};
|
|
51
59
|
/**
|
|
52
60
|
* The <i>IDispatcher</i> contract defines a way for dispatching to events independent of underlying technology.
|
|
53
61
|
* @group Contracts
|
|
54
62
|
*/
|
|
55
|
-
export type IDispatcher<TEvents extends
|
|
63
|
+
export type IDispatcher<TEvents extends BaseEvents = BaseEvents> = {
|
|
56
64
|
/**
|
|
57
65
|
* The <i>dispatch</i> method is used for dispatching one or multiple <i>events</i>.
|
|
58
66
|
|
|
59
67
|
* @throws {DispatchEventBusError} {@link DispatchEventBusError}
|
|
60
68
|
*/
|
|
61
|
-
dispatch(events: OneOrMore<TEvents
|
|
69
|
+
dispatch(events: OneOrMore<AllEvents<TEvents>>): LazyPromise<void>;
|
|
62
70
|
};
|
|
63
71
|
/**
|
|
64
72
|
* The <i>IEventBus</i> contract defines a way for dispatching and listening to events independent of underlying technology.
|
|
65
73
|
* It commes with more convient methods compared to <i>IEventBusAdapter</i>.
|
|
66
74
|
* @group Contracts
|
|
67
75
|
*/
|
|
68
|
-
export type IEventBus<TEvents extends
|
|
76
|
+
export type IEventBus<TEvents extends BaseEvents = BaseEvents> = IListenable<TEvents> & IDispatcher<TEvents> & {
|
|
69
77
|
/**
|
|
70
78
|
* The <i>getNamespace</i> method returns the complete namespace.
|
|
71
79
|
* @example
|
|
@@ -90,7 +98,7 @@ export type IEventBus<TEvents extends IBaseEvent = IBaseEvent> = IListenable<TEv
|
|
|
90
98
|
* It commes with one extra method which is useful for multitennat applications compared to <i>IEventBus</i>.
|
|
91
99
|
* @group Contracts
|
|
92
100
|
*/
|
|
93
|
-
export type INamespacedEventBus<TEvents extends
|
|
101
|
+
export type INamespacedEventBus<TEvents extends BaseEvents = BaseEvents> = IEventBus<TEvents> & {
|
|
94
102
|
/**
|
|
95
103
|
* The <i>withNamespace</i> method returns new instance of <i>{@link IEventBus}</i> where all the events names will be prefixed with a given <i>namespace</i>.
|
|
96
104
|
* This useful for multitennat applications.
|
|
@@ -16,18 +16,18 @@ export declare class UnexpectedEventBusError extends EventBusError {
|
|
|
16
16
|
/**
|
|
17
17
|
* @group Errors
|
|
18
18
|
*/
|
|
19
|
-
export declare class RemoveListenerEventBusError extends
|
|
19
|
+
export declare class RemoveListenerEventBusError extends UnexpectedEventBusError {
|
|
20
20
|
constructor(message: string, cause?: unknown);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @group Errors
|
|
24
24
|
*/
|
|
25
|
-
export declare class AddListenerEventBusError extends
|
|
25
|
+
export declare class AddListenerEventBusError extends UnexpectedEventBusError {
|
|
26
26
|
constructor(message: string, cause?: unknown);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* @group Errors
|
|
30
30
|
*/
|
|
31
|
-
export declare class DispatchEventBusError extends
|
|
31
|
+
export declare class DispatchEventBusError extends UnexpectedEventBusError {
|
|
32
32
|
constructor(message: string, cause?: unknown);
|
|
33
33
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../event-bus/implementations/_shared/
|
|
1
|
+
export * from "../../event-bus/implementations/_shared/_module";
|
|
2
2
|
export * from "../../event-bus/implementations/derivables/_module";
|
|
3
3
|
export * from "../../event-bus/implementations/adapters/_module";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module EventBus
|
|
3
|
+
*/
|
|
4
|
+
import { type TestAPI, type SuiteAPI, type ExpectStatic, type beforeEach } from "vitest";
|
|
5
|
+
import type { IEventBusAdapter } from "../../../event-bus/contracts/_module";
|
|
6
|
+
import { type Promisable } from "../../../utilities/_module";
|
|
7
|
+
/**
|
|
8
|
+
* @group Utilities
|
|
9
|
+
*/
|
|
10
|
+
export type EventBusAdapterTestSuiteSettings = {
|
|
11
|
+
expect: ExpectStatic;
|
|
12
|
+
test: TestAPI;
|
|
13
|
+
describe: SuiteAPI;
|
|
14
|
+
beforeEach: typeof beforeEach;
|
|
15
|
+
createAdapter: () => Promisable<IEventBusAdapter>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The <i>eventBusAdapterTestSuite</i> function simplifies the process of testing your custom implementation of <i>{@link IEventBusAdapter}</i> with vitest.
|
|
19
|
+
* @group Utilities
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { describe, test, beforeEach, expect, afterEach } from "vitest";
|
|
23
|
+
* import type { StartedRedisContainer } from "@testcontainers/redis";
|
|
24
|
+
* import { RedisContainer } from "@testcontainers/redis";
|
|
25
|
+
* import Redis from "ioredis";
|
|
26
|
+
* import { SuperJsonSerializer, TimeSpan, RedisEventBusAdapter, eventBusAdapterTestSuite } from "@daiso-tech/core";
|
|
27
|
+
*
|
|
28
|
+
* const timeout = TimeSpan.fromMinutes(2);
|
|
29
|
+
* describe("class: RedisEventBusAdapter", () => {
|
|
30
|
+
* let dispatcherClient: Redis;
|
|
31
|
+
* let listenerClient: Redis;
|
|
32
|
+
* let startedContainer: StartedRedisContainer;
|
|
33
|
+
* const serializer = new SuperJsonSerializer();
|
|
34
|
+
* beforeEach(async () => {
|
|
35
|
+
* startedContainer = await new RedisContainer().start();
|
|
36
|
+
* dispatcherClient = new Redis(startedContainer.getConnectionUrl());
|
|
37
|
+
* listenerClient = new Redis(startedContainer.getConnectionUrl());
|
|
38
|
+
* }, timeout.toMilliseconds());
|
|
39
|
+
* afterEach(async () => {
|
|
40
|
+
* await dispatcherClient.quit();
|
|
41
|
+
* await listenerClient.quit();
|
|
42
|
+
* await startedContainer.stop();
|
|
43
|
+
* }, timeout.toMilliseconds());
|
|
44
|
+
* eventBusAdapterTestSuite({
|
|
45
|
+
* createAdapter: () =>
|
|
46
|
+
* new RedisEventBusAdapter({
|
|
47
|
+
* dispatcherClient,
|
|
48
|
+
* listenerClient,
|
|
49
|
+
* serializer,
|
|
50
|
+
* }),
|
|
51
|
+
* test,
|
|
52
|
+
* beforeEach,
|
|
53
|
+
* expect,
|
|
54
|
+
* describe,
|
|
55
|
+
* });
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function eventBusAdapterTestSuite(settings: EventBusAdapterTestSuiteSettings): void;
|