@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial-backoff-policy.js","sourceRoot":"","sources":["../../../../../src/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAiCjE,MAAM,UAAU,uBAAuB,CACnC,WAE8D,EAAE;IAEhE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;YACjC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QACD,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,QAAQ,CAAC;QACrD,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;YAC/B,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;QACzC,CAAC;QACD,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;YAC/B,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;QACzC,CAAC;QACD,MAAM,EACF,MAAM,GAAG,CAAC,EACV,MAAM,GAAG,GAAG,EACZ,WAAW,GAAG,IAAI,CAAC,MAAM,GAC5B,GAAG,QAAQ,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CACvB,QAAQ,EACR,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CACvC,CAAC;QACF,OAAO,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACvD,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-errors.js","sourceRoot":"","sources":["../../../src/utilities/global-errors.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,YAAa,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IAClC,CAAC;CACJ;AAED,MAAM,OAAO,4BAA6B,SAAQ,YAAY;IAC1D,YAAY,WAAmB;QAC3B,KAAK,CAAC,uCAAuC,WAAW,GAAG,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC,IAAI,CAAC;IAClD,CAAC;CACJ;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAAY;IACrD,YAAY,UAAkB;QAC1B,KAAK,CAAC,wBAAwB,UAAU,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC,IAAI,CAAC;IAC7C,CAAC;CACJ"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class ValidationError extends Error {
|
|
2
|
-
constructor(message, cause) {
|
|
3
|
-
super(message, { cause });
|
|
4
|
-
this.name = ValidationError.name;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export function zodValidator(schema) {
|
|
8
|
-
return (value) => {
|
|
9
|
-
try {
|
|
10
|
-
return schema.parse(value);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
throw new ValidationError(`Validation error occured "${String(error)}"`, error);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=_module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/utilities/validation/_module.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,YAAY,OAAe,EAAE,KAAc;QACvC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACrC,CAAC;CACJ;AAwBD,MAAM,UAAU,YAAY,CACxB,MAAe;IAEf,OAAO,CAAC,KAAK,EAAE,EAAE;QACb,IAAI,CAAC;YAED,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,IAAI,eAAe,CACrB,6BAA6B,MAAM,CAAC,KAAK,CAAC,GAAG,EAC7C,KAAK,CACR,CAAC;QACN,CAAC;IACL,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../_shared/kysely/kysely-table-name-transformer-plugin";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Shared
|
|
3
|
-
*/
|
|
4
|
-
import type Redis from "ioredis";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export declare class ClearIterable implements AsyncIterable<void> {
|
|
9
|
-
private readonly client;
|
|
10
|
-
private readonly pattern;
|
|
11
|
-
constructor(client: Redis, pattern: string);
|
|
12
|
-
[Symbol.asyncIterator](): AsyncIterator<void>;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Collection
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class AsyncErrorHandlerIterable<TInput> implements AsyncIterable<TInput> {
|
|
8
|
-
private readonly iterable;
|
|
9
|
-
private readonly errorPasser;
|
|
10
|
-
constructor(iterable: AsyncIterable<TInput>, errorPasser: (error: unknown) => boolean);
|
|
11
|
-
[Symbol.asyncIterator](): AsyncIterator<TInput>;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../../event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite";
|
|
@@ -1,36 +0,0 @@
|
|
|
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 "../../../../_shared/types";
|
|
7
|
-
/**
|
|
8
|
-
* @group Utilities
|
|
9
|
-
*/
|
|
10
|
-
export type EventBusTestSuiteSettings = {
|
|
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
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { eventBusAdapterTestSuite, MemoryEventBusAdapter } from "@daiso-tech/core";
|
|
22
|
-
* import { expext, test, describe, beforeEach } from "vitest";
|
|
23
|
-
*
|
|
24
|
-
* describe("class: MemoryEventBusAdapter", () => {
|
|
25
|
-
* eventBusAdapterTestSuite({
|
|
26
|
-
* createAdapter: () => new MemoryEventBusAdapter(),
|
|
27
|
-
* test,
|
|
28
|
-
* beforeEach,
|
|
29
|
-
* expect,
|
|
30
|
-
* describe,
|
|
31
|
-
* });
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
* @group Utilities
|
|
35
|
-
*/
|
|
36
|
-
export declare function eventBusAdapterTestSuite(settings: EventBusTestSuiteSettings): void;
|
package/dist/types/event-bus/implementations/derivables/with-validation-event-bus-adapter.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "../../utilities/async/_shared";
|
|
2
|
-
export * from "../../utilities/async/abortable/_module";
|
|
3
|
-
export * from "../../utilities/async/abortable-iterable/_module";
|
|
4
|
-
export * from "../../utilities/async/delay/_module";
|
|
5
|
-
export * from "../../utilities/async/delay-iterable/_module";
|
|
6
|
-
export * from "../../utilities/async/lazy-promise/_module";
|
|
7
|
-
export * from "../../utilities/async/retry/_module";
|
|
8
|
-
export { retryIterable as unstable_retryIterable } from "../../utilities/async/retry-iterable/_module";
|
|
9
|
-
export * from "../../utilities/async/timeout/_module";
|
|
10
|
-
export * from "../../utilities/async/timeout-iterable/_module";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/abortable/abortable";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
import { LazyPromise } from "../../../utilities/async/lazy-promise/_module";
|
|
5
|
-
/**
|
|
6
|
-
* The <i>abortable</i> function makes a <i>{@link PromiseLike}</i> object abortable.
|
|
7
|
-
* @group Async utilities
|
|
8
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
9
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { abortable } from "@daiso-tech/core"
|
|
13
|
-
*
|
|
14
|
-
* let a = 0;
|
|
15
|
-
* const abortController = new AbortController();
|
|
16
|
-
* const fn = async () => {
|
|
17
|
-
* a = 1;
|
|
18
|
-
* abortController.abort("My message")
|
|
19
|
-
* await new Promise<void>(resolve => {
|
|
20
|
-
* setTimeout(() => {
|
|
21
|
-
* resolve()
|
|
22
|
-
* }, 0)
|
|
23
|
-
* })
|
|
24
|
-
* a = 2;
|
|
25
|
-
* }
|
|
26
|
-
* const promise = abortable(fn, abortController.signal);
|
|
27
|
-
* (async () => {
|
|
28
|
-
* try {
|
|
29
|
-
* // An error will be thrown
|
|
30
|
-
* await promise;
|
|
31
|
-
* }
|
|
32
|
-
* finally {
|
|
33
|
-
* // Will be 1
|
|
34
|
-
* console.log(a);
|
|
35
|
-
* }
|
|
36
|
-
* })();
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function abortable<TValue>(asyncFn: () => PromiseLike<TValue>, abortSignal: AbortSignal): LazyPromise<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/abortable-iterable/abortable-iterable";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* The <i>abortableIterable</i> function makes a <i>{@link AsyncIterable}</i> abortable.
|
|
6
|
-
* @group Async utilities
|
|
7
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
8
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { abortableIterable } from "@daiso-tech/core"
|
|
12
|
-
*
|
|
13
|
-
* let a = 0;
|
|
14
|
-
* const abortController = new AbortController();
|
|
15
|
-
* const iterable: AsyncIterable<void> = {
|
|
16
|
-
* async *[Symbol.asyncIterator]() {
|
|
17
|
-
* a = 1;
|
|
18
|
-
* abortController.abort("My abort");
|
|
19
|
-
* yield undefined;
|
|
20
|
-
* a = 2;
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* const newIterable = abortableIterable(iterable, abortController.signal);
|
|
24
|
-
* (async () => {
|
|
25
|
-
* try {
|
|
26
|
-
* // An error will be thrown
|
|
27
|
-
* for await (const _ of newIterable);
|
|
28
|
-
* }
|
|
29
|
-
* finally {
|
|
30
|
-
* // Will be 1
|
|
31
|
-
* console.log(a);
|
|
32
|
-
* }
|
|
33
|
-
* })();
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function abortableIterable<TValue>(iterable: AsyncIterable<TValue>, abortSignal: AbortSignal): AsyncIterable<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/delay/delay";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
import type { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
import { LazyPromise } from "../../../utilities/async/lazy-promise/_module";
|
|
6
|
-
/**
|
|
7
|
-
* The <i>delay</i> function creates a promise that will be fulfilled after given <i>time</i> and can be aborted by providing <i>abortSignal</i>.
|
|
8
|
-
* @group Async utilities
|
|
9
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
10
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { delay, TimeSpan } from "@daiso-tech/core";
|
|
14
|
-
* (async () => {
|
|
15
|
-
* console.log("a");
|
|
16
|
-
* await delay(TimeSpan.fromSeconds(2));
|
|
17
|
-
* console.log("b");
|
|
18
|
-
* })();
|
|
19
|
-
* ```
|
|
20
|
-
* @example with abortSignal
|
|
21
|
-
* ```ts
|
|
22
|
-
* import { delay, TimeSpan } from "@daiso-tech/core";
|
|
23
|
-
*
|
|
24
|
-
* const abortController = new AbortController();
|
|
25
|
-
* setTimeout(() => {
|
|
26
|
-
* abortController.abort("My abort error");
|
|
27
|
-
* }, TimeSpan.fromSeconds(1).toMilliseconds());
|
|
28
|
-
* const promise = delay(TimeSpan.fromSeconds(2), abortController.signal);
|
|
29
|
-
*
|
|
30
|
-
* (async () => {
|
|
31
|
-
* console.log("a");
|
|
32
|
-
* // Will throw AbortAsyncError
|
|
33
|
-
* await promise;
|
|
34
|
-
* console.log("b");
|
|
35
|
-
* })();
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function delay(time: TimeSpan, abortSignal?: AbortSignal): LazyPromise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/delay-iterable/delay-iterable";
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
import type { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
/**
|
|
6
|
-
* The <i>delayIterable</i> function adds delay to each iteration of <i>{@link AsyncIterable}</i> and the delay can be aborted by providing <i>abortSignal</i>.
|
|
7
|
-
* @group Async utilities
|
|
8
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
9
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* import { delayIterable, TimeSpan } from "@daiso-tech/core";
|
|
13
|
-
*
|
|
14
|
-
* const iterable: AsyncIterable<void> = {
|
|
15
|
-
* async *[Symbol.asyncIterator]() {
|
|
16
|
-
* yield 1;
|
|
17
|
-
* yield 2;
|
|
18
|
-
* yield 3;
|
|
19
|
-
* yield 4;
|
|
20
|
-
* yield 5;
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* (async () => {
|
|
25
|
-
* for await (const item of delayIterable(iterable, TimeSpan.fromSeconds(1))) {
|
|
26
|
-
* console.log(item);
|
|
27
|
-
* }
|
|
28
|
-
* })();
|
|
29
|
-
* ```
|
|
30
|
-
* @example with abortSignal
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { delayIterable, TimeSpan } from "@daiso-tech/core";
|
|
33
|
-
*
|
|
34
|
-
* const abortController = new AbortController();
|
|
35
|
-
* setTimeout(() => {
|
|
36
|
-
* abortController.abort("My abort error");
|
|
37
|
-
* }, TimeSpan.fromSeconds(3).toMilliseconds());
|
|
38
|
-
*
|
|
39
|
-
* const iterable: AsyncIterable<void> = {
|
|
40
|
-
* async *[Symbol.asyncIterator]() {
|
|
41
|
-
* yield 1;
|
|
42
|
-
* yield 2;
|
|
43
|
-
* yield 3;
|
|
44
|
-
* yield 4;
|
|
45
|
-
* yield 5;
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
*
|
|
49
|
-
* (async () => {
|
|
50
|
-
* // Will throw AbortAsyncError
|
|
51
|
-
* for await (const item of delayIterable(iterable, TimeSpan.fromSeconds(1), abortController.signal)) {
|
|
52
|
-
* console.log(item);
|
|
53
|
-
* }
|
|
54
|
-
* })();
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function delayIterable<TValue>(iterable: AsyncIterable<TValue>, time: TimeSpan, abortSignal?: AbortSignal): AsyncIterable<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/lazy-promise/lazy-promise";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* The <i>LazyPromise</i> class is used for creating lazy <i>{@link PromiseLike}<i> object that will only execute when awaited or when then method is called.
|
|
6
|
-
* @group Async utilities
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* (async () => {
|
|
10
|
-
* const promise = new LazyPromise(async () => {
|
|
11
|
-
* console.log("I am lazy");
|
|
12
|
-
* });
|
|
13
|
-
* // "I am lazy" will only logged when awaited or then method i called.
|
|
14
|
-
* await promise;
|
|
15
|
-
* })();
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
19
|
-
private readonly asyncFn;
|
|
20
|
-
private promise;
|
|
21
|
-
constructor(asyncFn: () => PromiseLike<TValue>);
|
|
22
|
-
then<TResult1 = TValue, TResult2 = never>(onfulfilled?: ((value: TValue) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The <i>deferLazyPromise</i> function will execute <i>{@link LazyPromise}</i> without awaiting it.
|
|
26
|
-
* @group Async utilities
|
|
27
|
-
*/
|
|
28
|
-
export declare function deferLazyPromise<TValue>(promise: LazyPromise<TValue>): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/retry/retry";
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
import type { BackoffPolicy } from "../../../utilities/backof-policies/_module";
|
|
5
|
-
import { LazyPromise } from "../../../utilities/async/lazy-promise/_module";
|
|
6
|
-
import { TimeSpan } from "../../../utilities/_module";
|
|
7
|
-
/**
|
|
8
|
-
* @group Async utilities
|
|
9
|
-
*/
|
|
10
|
-
export type RetryPolicy = (error: unknown) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @group Async utilities
|
|
13
|
-
*/
|
|
14
|
-
export type RetrySettings = {
|
|
15
|
-
/**
|
|
16
|
-
* @default {4}
|
|
17
|
-
*/
|
|
18
|
-
maxAttempts?: number;
|
|
19
|
-
backoffPolicy?: BackoffPolicy;
|
|
20
|
-
retryPolicy?: RetryPolicy;
|
|
21
|
-
/**
|
|
22
|
-
* @default 60_000 milliseconds
|
|
23
|
-
*/
|
|
24
|
-
retryTimeout?: TimeSpan;
|
|
25
|
-
abortSignal?: AbortSignal;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* The <i>retry</i> function will retry a async function if it throws an error until given <i>settings.maxAttempts</i>.
|
|
29
|
-
* You can add timeout for each retry by passing <i>settings.retryTimeout</i> and <i>settings.abortSignal</i> for aborting it on your own.
|
|
30
|
-
* You can also customize the retry policy by passing <i>settings.retryPolicy</i> and custom backof policy by passing <i>settings.backoffPolicy</i>.
|
|
31
|
-
* @group Async utilities
|
|
32
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
33
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
34
|
-
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
35
|
-
* @throws {RetryAsyncError} {@link RetryAsyncError}
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* import { retry, TimeSpan, exponentialBackoffPolicy } from "@daiso-tech/core";
|
|
39
|
-
*
|
|
40
|
-
* (async () => {
|
|
41
|
-
* // Will throw RetryAsyncError after failing 4:th attempt
|
|
42
|
-
* await retry(async () => {
|
|
43
|
-
* throw new Error("My error mesasge");
|
|
44
|
-
* }, {
|
|
45
|
-
* // You can choose the max retry attempts
|
|
46
|
-
* maxAttempts: 4,
|
|
47
|
-
* // You can provide a custom backoff policy
|
|
48
|
-
* backoffPolicy: exponentialBackoffPolicy(),
|
|
49
|
-
* // You can choose what error to retry, this function will retry all errors thrown
|
|
50
|
-
* retryPolicy: () => true,
|
|
51
|
-
* // You can provide a timeout for each retry
|
|
52
|
-
* retryTimeout: TimeSpan.fromMilliseconds(60_000),
|
|
53
|
-
* });
|
|
54
|
-
* })();
|
|
55
|
-
* ```
|
|
56
|
-
* @example with abortSignal
|
|
57
|
-
* ```ts
|
|
58
|
-
* import { retry, TimeSpan } from "@daiso-tech/core";
|
|
59
|
-
*
|
|
60
|
-
* (async () => {
|
|
61
|
-
* const abortController = new AbortController();
|
|
62
|
-
* abortController.abort("My abort message");
|
|
63
|
-
*
|
|
64
|
-
* // Will be aborted by throwing AbortAsyncError
|
|
65
|
-
* await retry(async () => {
|
|
66
|
-
* throw new Error("My error message");
|
|
67
|
-
* }, {
|
|
68
|
-
* abortSignal: abortController.signal
|
|
69
|
-
* });
|
|
70
|
-
* })();
|
|
71
|
-
* ```
|
|
72
|
-
* @example with custom retry policy
|
|
73
|
-
* ```ts
|
|
74
|
-
* import { retry, TimeSpan } from "@daiso-tech/core";
|
|
75
|
-
*
|
|
76
|
-
* class ErrorA extends Error {};
|
|
77
|
-
* class ErrorB extends Error {};
|
|
78
|
-
*
|
|
79
|
-
* (async () => {
|
|
80
|
-
* // Will not retry and ErrorB will be thrown
|
|
81
|
-
* await retry(async () => {
|
|
82
|
-
* throw new ErrorB("My error message");
|
|
83
|
-
* }, {
|
|
84
|
-
* retryPolicy: error => error instanceof ErrorA
|
|
85
|
-
* });
|
|
86
|
-
* })();
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
export declare function retry<TValue = void>(asyncFn: () => PromiseLike<TValue>, settings?: RetrySettings): LazyPromise<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/retry-iterable/retry-iterable";
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { RetrySettings } from "../../../utilities/async/retry/_module";
|
|
2
|
-
/**
|
|
3
|
-
* The <i>retryIterable</i> function will retry each iteration of {@link AsyncIterable} if it throws an error until given <i>settings.maxAttempts</i>.
|
|
4
|
-
* You can add timeout for each retry by passing <i>settings.retryTimeout</i> and <i>settings.abortSignal</i> for aborting it on your own.
|
|
5
|
-
* You can also customize the retry policy by passing <i>settings.retryPolicy</i> and custom backof policy by passing <i>settings.backoffPolicy</i>.
|
|
6
|
-
* @group Async utilities
|
|
7
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
8
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
9
|
-
* @throws {RetryAsyncError} {@link RetryAsyncError}
|
|
10
|
-
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { retryIterable, TimeSpan, exponentialBackoffPolicy } from "@daiso-tech/core";
|
|
14
|
-
*
|
|
15
|
-
* const iterable: AsyncIterable<void> = {
|
|
16
|
-
* async *[Symbol.asyncIterator]() {
|
|
17
|
-
* yield 1;
|
|
18
|
-
* throw new Error("My error mesasge");
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* (async () => {
|
|
23
|
-
* // Will throw RetryAsyncError after failing 4:th attempt
|
|
24
|
-
* for await (const item of retryIterable(iterable, {
|
|
25
|
-
* // You can choose the max retry attempts
|
|
26
|
-
* maxAttempts: 4,
|
|
27
|
-
* // You can provide a custom backoff policy
|
|
28
|
-
* backoffPolicy: exponentialBackoffPolicy(),
|
|
29
|
-
* // You can choose what error to retry, this function will retry all errors thrown
|
|
30
|
-
* retryPolicy: () => true,
|
|
31
|
-
* // You can provide a timeout for each retry
|
|
32
|
-
* retryTimeout: TimeSpan.fromMilliseconds(60_000),
|
|
33
|
-
* })) {
|
|
34
|
-
* console.log(item)
|
|
35
|
-
* }
|
|
36
|
-
* })();
|
|
37
|
-
* ```
|
|
38
|
-
* @example with abortSignal
|
|
39
|
-
* ```ts
|
|
40
|
-
* import { retryIterable, TimeSpan } from "@daiso-tech/core";
|
|
41
|
-
*
|
|
42
|
-
* const iterable: AsyncIterable<void> = {
|
|
43
|
-
* async *[Symbol.asyncIterator]() {
|
|
44
|
-
* yield 1;
|
|
45
|
-
* throw new Error("My error mesasge");
|
|
46
|
-
* }
|
|
47
|
-
* }
|
|
48
|
-
*
|
|
49
|
-
* (async () => {
|
|
50
|
-
* const abortController = new AbortController();
|
|
51
|
-
* abortController.abort("My abort message");
|
|
52
|
-
*
|
|
53
|
-
* // Will be aborted by throwing AbortAsyncError
|
|
54
|
-
* for await (const item of retry(iterable, {
|
|
55
|
-
* abortSignal: abortController.signal
|
|
56
|
-
* })) {
|
|
57
|
-
* console.log(item)
|
|
58
|
-
* }
|
|
59
|
-
* })();
|
|
60
|
-
* ```
|
|
61
|
-
* @example with abortSignal
|
|
62
|
-
* ```ts
|
|
63
|
-
* import { retryIterable, TimeSpan } from "@daiso-tech/core";
|
|
64
|
-
*
|
|
65
|
-
* class ErrorA extends Error {};
|
|
66
|
-
* class ErrorB extends Error {};
|
|
67
|
-
*
|
|
68
|
-
* const iterable: AsyncIterable<void> = {
|
|
69
|
-
* async *[Symbol.asyncIterator]() {
|
|
70
|
-
* yield 1;
|
|
71
|
-
* throw new ErrorB("My error mesasge");
|
|
72
|
-
* }
|
|
73
|
-
* }
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* (async () => {
|
|
77
|
-
* // Will not retry and ErrorB will be thrown
|
|
78
|
-
* for await (const item of retry(iterable, {
|
|
79
|
-
* retryPolicy: error => error instanceof ErrorA
|
|
80
|
-
* })) {
|
|
81
|
-
* console.log(item)
|
|
82
|
-
* }
|
|
83
|
-
* })();
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
export declare function retryIterable<TValue>(iterable: AsyncIterable<TValue>, settings?: RetrySettings): AsyncIterable<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/timeout/timeout";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Utilities
|
|
3
|
-
*/
|
|
4
|
-
import { LazyPromise } from "../../../utilities/async/lazy-promise/_module";
|
|
5
|
-
import type { TimeSpan } from "../../../utilities/_module";
|
|
6
|
-
/**
|
|
7
|
-
* The <i>timeout</i> function makes a <i>{@link PromiseLike}</i> object abort after a given <i>time</i> and you can also abort it on your own by passing <i>abortSignal</i>.
|
|
8
|
-
* @group Async utilities
|
|
9
|
-
* @throws {AsyncError} {@link AsyncError}
|
|
10
|
-
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
11
|
-
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { timeout, delay, TimeSpan } from "@daiso-tech/core";
|
|
15
|
-
*
|
|
16
|
-
* (async () => {
|
|
17
|
-
* // Will throw an AbortAsyncError
|
|
18
|
-
* await timeout(async () => {
|
|
19
|
-
* await delay(TimeSpan.fromSeconds(10));
|
|
20
|
-
* }, TimeSpan.fromSeconds(5));
|
|
21
|
-
* })();
|
|
22
|
-
* ```
|
|
23
|
-
* @example with abortSignal
|
|
24
|
-
* ```ts
|
|
25
|
-
* import { timeout, delay, TimeSpan } from "@daiso-tech/core";
|
|
26
|
-
*
|
|
27
|
-
* const abortController = new AbortController();
|
|
28
|
-
* setTimeout(() => {
|
|
29
|
-
* abortController.abort("My abort error");
|
|
30
|
-
* }, TimeSpan.fromSeconds(1));
|
|
31
|
-
*
|
|
32
|
-
* (async () => {
|
|
33
|
-
* // Will abort after 1 second by throwing AbortAsyncError
|
|
34
|
-
* await timeout(async () => {
|
|
35
|
-
* await delay(TimeSpan.fromSeconds(10));
|
|
36
|
-
* }, TimeSpan.fromSeconds(5), abortController.signal);
|
|
37
|
-
* })();
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export declare function timeout<TValue>(asyncFn: () => PromiseLike<TValue>, time: TimeSpan, abortSignal?: AbortSignal): LazyPromise<TValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../utilities/async/timeout-iterable/timeout-iterable";
|