@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/utilities/kysely/_module.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kysely-table-name-transformer-plugin.js","sourceRoot":"","sources":["../../../../src/utilities/kysely/kysely-table-name-transformer-plugin.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAKlD,MAAM,oBAAqB,SAAQ,wBAAwB;IAC1B;IAA7B,YAA6B,YAAoC;QAC7D,KAAK,EAAE,CAAC;QADiB,iBAAY,GAAZ,YAAY,CAAwB;IAEjE,CAAC;IAEkB,cAAc,CAAC,IAAe;QAC7C,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACnD,OAAO;YACH,GAAG,eAAe;YAClB,KAAK,EAAE;gBACH,GAAG,eAAe,CAAC,KAAK;gBACxB,UAAU,EAAE;oBACR,GAAG,eAAe,CAAC,KAAK,CAAC,UAAU;oBACnC,IAAI,EAAE,CAAC,GAAG,EAAE;wBACR,MAAM,YAAY,GACd,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;wBAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;wBACvD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;4BAC/B,MAAM,IAAI,KAAK,CACX,yBAAyB,YAAY,GAAG,CAC3C,CAAC;wBACN,CAAC;wBACD,OAAO,cAAc,CAAC;oBAC1B,CAAC,CAAC,EAAE;iBACP;aACJ;SACJ,CAAC;IACN,CAAC;CACJ;AAKD,MAAM,OAAO,gCAAgC;IACxB,WAAW,CAAuB;IAEnD,YAAY,YAAoC;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,cAAc,CAAC,IAA8B;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED,eAAe,CACX,IAA+B;QAE/B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utilities/types.ts"],"names":[],"mappings":""}
|
package/dist/types/_module.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Async
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* @group
|
|
5
|
+
* @group Errors
|
|
6
6
|
*/
|
|
7
7
|
export declare class AsyncError extends Error {
|
|
8
8
|
constructor(message: string, cause?: unknown);
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* @group
|
|
11
|
+
* @group Errors
|
|
12
12
|
*/
|
|
13
13
|
export declare class AbortAsyncError extends AsyncError {
|
|
14
14
|
constructor(message: string, cause?: unknown);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* @group
|
|
17
|
+
* @group Errors
|
|
18
18
|
*/
|
|
19
19
|
export declare class TimeoutAsyncError extends AsyncError {
|
|
20
20
|
constructor(message: string, cause?: unknown);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* @group
|
|
23
|
+
* @group Errors
|
|
24
24
|
*/
|
|
25
25
|
export type RetryAsyncErrorData = {
|
|
26
26
|
cause?: unknown;
|
|
27
27
|
maxAttempts: number;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
* @group
|
|
30
|
+
* @group Errors
|
|
31
31
|
*/
|
|
32
32
|
export declare class RetryAsyncError extends AsyncError {
|
|
33
33
|
readonly maxAttempts: number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type BackoffPolicy } from "../../async/backof-policies/_shared";
|
|
2
|
+
export * from "../../async/backof-policies/constant-backoff-policy/_module";
|
|
3
|
+
export * from "../../async/backof-policies/exponential-backoff-policy/_module";
|
|
4
|
+
export * from "../../async/backof-policies/linear-backoff-policy/_module";
|
|
5
|
+
export * from "../../async/backof-policies/polynomial-backoff-policy/_module";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/backof-policies/constant-backoff-policy/constant-backoff-policy";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Async
|
|
3
3
|
*/
|
|
4
4
|
import { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
import { type BackoffPolicy } from "../../../
|
|
5
|
+
import { type BackoffPolicy } from "../../../async/backof-policies/_shared";
|
|
6
6
|
/**
|
|
7
7
|
* @group Backoff policies
|
|
8
8
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/backof-policies/exponential-backoff-policy/exponential-backoff-policy";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Async
|
|
3
3
|
*/
|
|
4
4
|
import { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
import type { BackoffPolicy } from "../../../
|
|
5
|
+
import type { BackoffPolicy } from "../../../async/backof-policies/_shared";
|
|
6
6
|
/**
|
|
7
7
|
* @group Backoff policies
|
|
8
8
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/backof-policies/linear-backoff-policy/linear-backoff-policy";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Async
|
|
3
3
|
*/
|
|
4
4
|
import { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
import type { BackoffPolicy } from "../../../
|
|
5
|
+
import type { BackoffPolicy } from "../../../async/backof-policies/_shared";
|
|
6
6
|
/**
|
|
7
7
|
* @group Backoff policies
|
|
8
8
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Async
|
|
3
3
|
*/
|
|
4
4
|
import { TimeSpan } from "../../../utilities/_module";
|
|
5
|
-
import type { BackoffPolicy } from "../../../
|
|
5
|
+
import type { BackoffPolicy } from "../../../async/backof-policies/_shared";
|
|
6
6
|
/**
|
|
7
7
|
* @group Backoff policies
|
|
8
8
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import type { Result } from "../../../utilities/types";
|
|
5
|
+
import { AbortAsyncError } from "../../../async/async.errors";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function abort<TValue>(asyncFn: () => PromiseLike<TValue>, abortSignal: AbortSignal): Promise<Result<TValue, AbortAsyncError>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/utilities/delay/delay";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import { type TimeSpan } from "../../../utilities/_module";
|
|
5
|
+
/**
|
|
6
|
+
* 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>.
|
|
7
|
+
* @group Utilities
|
|
8
|
+
* @throws {AsyncError} {@link AsyncError}
|
|
9
|
+
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { delay, TimeSpan } from "@daiso-tech/core";
|
|
13
|
+
* (async () => {
|
|
14
|
+
* console.log("a");
|
|
15
|
+
* await delay(TimeSpan.fromSeconds(2));
|
|
16
|
+
* console.log("b");
|
|
17
|
+
* })();
|
|
18
|
+
*/
|
|
19
|
+
export declare function delay(time: TimeSpan, abortSignal?: AbortSignal): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../async/utilities/lazy-promise/lazy-promise";
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import type { BackoffPolicy } from "../../../async/backof-policies/_module";
|
|
5
|
+
import type { TimeSpan } from "../../../utilities/time-span/_module";
|
|
6
|
+
import type { RetryPolicy } from "../../../async/utilities/retry/_module";
|
|
7
|
+
/**
|
|
8
|
+
* @group Utilities
|
|
9
|
+
*/
|
|
10
|
+
export type LazyPromiseSettings = {
|
|
11
|
+
retryAttempts?: number | null;
|
|
12
|
+
backoffPolicy?: BackoffPolicy | null;
|
|
13
|
+
retryPolicy?: RetryPolicy | null;
|
|
14
|
+
abortSignal?: AbortSignal | null;
|
|
15
|
+
time?: TimeSpan | null;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 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.
|
|
19
|
+
* The class includes helpful methods
|
|
20
|
+
* - <i>defer</i>
|
|
21
|
+
* - <i>retryAttempts</i>
|
|
22
|
+
* - <i>retryPolicy</i>
|
|
23
|
+
* - <i>backoffPolicy</i>
|
|
24
|
+
* - <i>abort</i>
|
|
25
|
+
* - <i>timeout</i>
|
|
26
|
+
*
|
|
27
|
+
* The order in which these methods are called does not affect their functionality. Internally, the following execution order is applied:
|
|
28
|
+
* 1. <i>timeout</i>
|
|
29
|
+
* 2. <i>retryAttempts</i>
|
|
30
|
+
* 3. <i>abort</i>
|
|
31
|
+
*
|
|
32
|
+
* This means that combining all methods ensures the <i>retryAttempts</i> method will continue retrying even if the timeout is triggered,
|
|
33
|
+
* while the <i>abort</i> method takes priority to cancel all operations if activated.
|
|
34
|
+
* @group Utilities
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* (async () => {
|
|
38
|
+
* const promise = new LazyPromise(async () => {
|
|
39
|
+
* console.log("I am lazy");
|
|
40
|
+
* });
|
|
41
|
+
* // "I am lazy" will only logged when awaited or then method i called.
|
|
42
|
+
* await promise;
|
|
43
|
+
* })();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
47
|
+
private asyncFn;
|
|
48
|
+
private promise;
|
|
49
|
+
private attempts;
|
|
50
|
+
private backoffPolicy_;
|
|
51
|
+
private retryPolicy_;
|
|
52
|
+
private abortSignal;
|
|
53
|
+
private time;
|
|
54
|
+
constructor(asyncFn: () => PromiseLike<TValue>, settings?: LazyPromiseSettings);
|
|
55
|
+
private applyTimeout;
|
|
56
|
+
private applyRetry;
|
|
57
|
+
private applyAbort;
|
|
58
|
+
private applySettings;
|
|
59
|
+
/**
|
|
60
|
+
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
61
|
+
* @throws {TimeoutAsyncError} {@link TimeoutAsyncError}
|
|
62
|
+
* @throws {RetryAsyncError} {@link RetryAsyncError}
|
|
63
|
+
*/
|
|
64
|
+
then<TResult1 = TValue, TResult2 = never>(onfulfilled?: ((value: TValue) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
65
|
+
/**
|
|
66
|
+
* The <i>retryAttempts</i> method is used for setting max retry attempts.
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { LazyPromise } from "@daiso-tech/core";
|
|
70
|
+
*
|
|
71
|
+
* const promise =
|
|
72
|
+
* new LazyPromise(async () => {
|
|
73
|
+
* console.log("A");
|
|
74
|
+
* throw new Error("Error occured!");
|
|
75
|
+
* })
|
|
76
|
+
* .retryAttempts(3)
|
|
77
|
+
* (async () => {
|
|
78
|
+
* // Will log "A" 3 times and then retry error will be thrown.
|
|
79
|
+
* await promise;
|
|
80
|
+
* })();
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
retryAttempts(attempts: number): this;
|
|
84
|
+
/**
|
|
85
|
+
* The <i>backoffPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { LazyPromise, linearBackoffPolicy } from "@daiso-tech/core";
|
|
89
|
+
*
|
|
90
|
+
* const promise =
|
|
91
|
+
* new LazyPromise(async () => {
|
|
92
|
+
* console.log("A");
|
|
93
|
+
* throw new Error("Error occured!");
|
|
94
|
+
* })
|
|
95
|
+
* .retryAttempts(3)
|
|
96
|
+
* .backoffPolicy(linearBackoffPolicy())
|
|
97
|
+
* (async () => {
|
|
98
|
+
* // Will log "A" 3 times and then retry error will be thrown.
|
|
99
|
+
* await promise;
|
|
100
|
+
* })();
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
backoffPolicy(policy: BackoffPolicy): this;
|
|
104
|
+
/**
|
|
105
|
+
* The <i>backoffPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { LazyPromise } from "@daiso-tech/core";
|
|
109
|
+
*
|
|
110
|
+
* class ErrorA extends Error {}
|
|
111
|
+
*
|
|
112
|
+
* const promise =
|
|
113
|
+
* new LazyPromise(async () => {
|
|
114
|
+
* console.log("A");
|
|
115
|
+
* throw new Error("Error occured!");
|
|
116
|
+
* })
|
|
117
|
+
* .retryAttempts(3)
|
|
118
|
+
* // Will only retry an error that is instance ErrorA
|
|
119
|
+
* .retryPolicy(error => error instanceof ErrorA)
|
|
120
|
+
* (async () => {
|
|
121
|
+
* // Will log "A" 1 time and then error will be thrown.
|
|
122
|
+
* await promise;
|
|
123
|
+
* })();
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
retryPolicy(policy: RetryPolicy): this;
|
|
127
|
+
/**
|
|
128
|
+
* The <i>timeout</i> method aborts the <i>LazyPromise</i> if it exceeds the given <i>time</i> by throwning an error.
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
|
|
132
|
+
*
|
|
133
|
+
* const promise =
|
|
134
|
+
* new LazyPromise(async () => {
|
|
135
|
+
* await delay(TimeSpan.fromMinutes(1));
|
|
136
|
+
* })
|
|
137
|
+
* .timeout(TimeSpan.fromSeconds(1));
|
|
138
|
+
* (async () => {
|
|
139
|
+
* // An timeout error will be thrown.
|
|
140
|
+
* await promise;
|
|
141
|
+
* })();
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
timeout(time: TimeSpan): this;
|
|
145
|
+
/**
|
|
146
|
+
* The <i>abort</i> method aborts the <i>LazyPromise</i> by the passed in <i>abortSignal</i>.
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
|
|
150
|
+
*
|
|
151
|
+
* const abortController = new AbortController();
|
|
152
|
+
* const promise =
|
|
153
|
+
* new LazyPromise(async () => {
|
|
154
|
+
* await delay(TimeSpan.fromMinutes(1));
|
|
155
|
+
* })
|
|
156
|
+
* .abort(abortController.signal);
|
|
157
|
+
* (async () => {
|
|
158
|
+
* setTimeout(() => {
|
|
159
|
+
* abortController.abort();
|
|
160
|
+
* }, 1000);
|
|
161
|
+
* // An timeout error will be thrown.
|
|
162
|
+
* await promise;
|
|
163
|
+
* })();
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
abort(abortSignal: AbortSignal): this;
|
|
167
|
+
/**
|
|
168
|
+
* The <i>defer</i> method executes the <i>LazyPromise</i> without awaiting it.
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { LazyPromise, delay, TimeSpan } from "@daiso-tech/core";
|
|
172
|
+
*
|
|
173
|
+
* const promise =
|
|
174
|
+
* new LazyPromise(async () => {
|
|
175
|
+
* await delay(TimeSpan.fromSeconds(1));
|
|
176
|
+
* // Will be loged after one second
|
|
177
|
+
* console.log("Done !");
|
|
178
|
+
* });
|
|
179
|
+
* promise.defer();
|
|
180
|
+
* // Will be logged immediately
|
|
181
|
+
* console.log("Hello");
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
defer(): void;
|
|
185
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import type { BackoffPolicy } from "../../../async/backof-policies/_module";
|
|
5
|
+
/**
|
|
6
|
+
* @group Utilities
|
|
7
|
+
*/
|
|
8
|
+
export type RetryPolicy = (error: unknown) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @group Utilities
|
|
11
|
+
*/
|
|
12
|
+
export type RetrySettings = {
|
|
13
|
+
/**
|
|
14
|
+
* @default {4}
|
|
15
|
+
*/
|
|
16
|
+
maxAttempts?: number;
|
|
17
|
+
backoffPolicy?: BackoffPolicy;
|
|
18
|
+
retryPolicy?: RetryPolicy;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function retryOrFail<TValue = void>(asyncFn: () => PromiseLike<TValue>, settings?: RetrySettings): Promise<TValue>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import { RetryAsyncError } from "../../../async/async.errors";
|
|
5
|
+
import type { Result } from "../../../utilities/types";
|
|
6
|
+
import type { RetrySettings } from "../../../async/utilities/retry/retry-or-fail";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function retry<TValue = void>(asyncFn: () => PromiseLike<TValue>, settings?: RetrySettings): Promise<Result<TValue, RetryAsyncError>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Async
|
|
3
|
+
*/
|
|
4
|
+
import { TimeoutAsyncError } from "../../../async/async.errors";
|
|
5
|
+
import type { TimeSpan } from "../../../utilities/_module";
|
|
6
|
+
import type { Result } from "../../../utilities/types";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function timeout<TValue>(asyncFn: () => PromiseLike<TValue>, time: TimeSpan): Promise<Result<TValue, TimeoutAsyncError>>;
|
|
@@ -22,7 +22,7 @@ export type ICacheAdapter<TType = unknown> = {
|
|
|
22
22
|
*/
|
|
23
23
|
update(key: string, value: TType): PromiseLike<boolean>;
|
|
24
24
|
/**
|
|
25
|
-
* The <i>put</i> method replaces a <i>key</i> that exists or adds <i>key</i> that do not exists.
|
|
25
|
+
* The <i>put</i> method replaces a <i>key</i> that exists or adds <i>key</i> that do not exists. Returns true if the <i>key</i> where updated otherwise false is returned.
|
|
26
26
|
* You can provide a <i>ttl</i> value. If null is passed, the item will not expire.
|
|
27
27
|
*/
|
|
28
28
|
put(key: string, value: TType, ttl: TimeSpan | null): PromiseLike<boolean>;
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
4
|
import type { IListenable } from "../../event-bus/contracts/_module";
|
|
5
|
-
import type { OneOrMore } from "../../
|
|
6
|
-
import { type AsyncLazyable, type GetOrAddValue } from "../../
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
5
|
+
import type { OneOrMore } from "../../utilities/_module";
|
|
6
|
+
import { type AsyncLazyable, type GetOrAddValue } from "../../utilities/_module";
|
|
7
|
+
import type { CacheEvents } from "../../cache/contracts/_module";
|
|
8
|
+
import type { TimeSpan } from "../../utilities/_module";
|
|
9
|
+
import type { LazyPromise } from "../../async/_module";
|
|
9
10
|
/**
|
|
10
11
|
* The <i>ICacheListenable</i> contract defines a way for listening <i>{@link ICache}</i> crud operations.
|
|
11
12
|
* @group Contracts
|
|
12
13
|
*/
|
|
13
|
-
export type ICacheListenable<TType = unknown> = IListenable<
|
|
14
|
+
export type ICacheListenable<TType = unknown> = IListenable<CacheEvents<TType>>;
|
|
14
15
|
/**
|
|
15
16
|
* @group Contracts
|
|
16
17
|
*/
|
|
@@ -29,107 +30,87 @@ export type WithTtlValue<TType> = {
|
|
|
29
30
|
export type ICache<TType = unknown> = ICacheListenable & {
|
|
30
31
|
/**
|
|
31
32
|
* The <i>exists</i> method returns true when <i>key</i> is found otherwise false will be returned.
|
|
32
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
33
33
|
*/
|
|
34
34
|
exists(key: string): LazyPromise<boolean>;
|
|
35
35
|
/**
|
|
36
36
|
* The <i>existsMany</i> method returns true for the <i>keys</i> that are found otherwise false will be returned.
|
|
37
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
38
37
|
*/
|
|
39
38
|
existsMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
40
39
|
/**
|
|
41
40
|
* The <i>missing</i> method returns true when <i>key</i> is not found otherwise false will be returned.
|
|
42
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
43
41
|
*/
|
|
44
42
|
missing(key: string): LazyPromise<boolean>;
|
|
45
43
|
/**
|
|
46
44
|
* The <i>missingMany</i> method returns true for the <i>keys</i> that are not found otherwise false will be returned.
|
|
47
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
48
45
|
*/
|
|
49
46
|
missingMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
50
47
|
/**
|
|
51
48
|
* The <i>get</i> method returns the value when <i>key</i> is found otherwise null will be returned.
|
|
52
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
53
49
|
*/
|
|
54
50
|
get(key: string): LazyPromise<TType | null>;
|
|
55
51
|
/**
|
|
56
52
|
* The <i>getMany</i> returns the value for the <i>keys</i> that are found otherwise null will be returned.
|
|
57
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
58
53
|
*/
|
|
59
54
|
getMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, TType | null>>;
|
|
60
55
|
/**
|
|
61
56
|
* The <i>getOr</i> method returns the value when <i>key</i> is found otherwise <i>defaultValue</i> will be returned.
|
|
62
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
63
57
|
*/
|
|
64
58
|
getOr(key: string, defaultValue: AsyncLazyable<TType>): LazyPromise<TType>;
|
|
65
59
|
/**
|
|
66
60
|
* The <i>getOrMany</i> method returns the value for the keys that are found otherwise defaultValue will be returned.
|
|
67
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
68
61
|
*/
|
|
69
62
|
getOrMany<TKeys extends string>(keysWithDefaults: Record<TKeys, AsyncLazyable<TType>>): LazyPromise<Record<TKeys, TType>>;
|
|
70
63
|
/**
|
|
71
64
|
* The <i>getOrFail</i> method returns the value when <i>key</i> is found otherwise an error will be thrown.
|
|
72
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
73
65
|
* @throws {KeyNotFoundCacheError} {@link KeyNotFoundCacheError}
|
|
74
66
|
*/
|
|
75
67
|
getOrFail(key: string): LazyPromise<TType>;
|
|
76
68
|
/**
|
|
77
69
|
* The <i>add</i> method adds a <i>key</i> with given <i>value</i> when key doesn't exists. Returns true when key doesn't exists otherwise false will be returned.
|
|
78
70
|
* You can provide a <i>ttl</i> value. If null is passed, the item will not expire.
|
|
79
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
80
71
|
*/
|
|
81
72
|
add(key: string, value: TType, ttl?: TimeSpan | null): LazyPromise<boolean>;
|
|
82
73
|
/**
|
|
83
74
|
* The <i>addMany</i> method adds new keys. Returns true for the keys that where added otherwise false will be returned.
|
|
84
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
85
75
|
*/
|
|
86
76
|
addMany<TKeys extends string>(values: Record<TKeys, WithTtlValue<TType>>): LazyPromise<Record<TKeys, boolean>>;
|
|
87
77
|
/**
|
|
88
78
|
* The <i>update</i> method updates the given <i>key</i> with given <i>value</i>. Returns true when key otherwise false will be returned.
|
|
89
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
90
79
|
*/
|
|
91
80
|
update(key: string, value: TType): LazyPromise<boolean>;
|
|
92
81
|
/**
|
|
93
82
|
* The <i>updateMany</i> method updates the given keys. Returns true for the keys that where updated otherwise false will be returned.
|
|
94
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
95
83
|
*/
|
|
96
84
|
updateMany<TKeys extends string>(values: Record<TKeys, TType>): LazyPromise<Record<TKeys, boolean>>;
|
|
97
85
|
/**
|
|
98
86
|
* The <i>put</i> method replaces the key with given <i>value</i> if found. If the <i>key</i> is not found it will just be added. True is returned if the key is found otherwise false will be returned.
|
|
99
87
|
* You can provide a <i>ttl</i> value. If null is passed, the item will not expire.
|
|
100
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
101
88
|
*/
|
|
102
89
|
put(key: string, value: TType, ttl?: TimeSpan | null): LazyPromise<boolean>;
|
|
103
90
|
/**
|
|
104
|
-
* The <i>putMany</i> method replaces the keys that exists. Adds keys that do not exists.
|
|
105
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
91
|
+
* The <i>putMany</i> method replaces the keys that exists. Adds keys that do not exists. Returns true for all the keys that where updated otherwise false is returned.
|
|
106
92
|
*/
|
|
107
93
|
putMany<TKeys extends string>(values: Record<TKeys, WithTtlValue<TType>>): LazyPromise<Record<TKeys, boolean>>;
|
|
108
94
|
/**
|
|
109
95
|
* The <i>remove</i> method removes the given <i>key</i> when found. Returns true if the key is found otherwise false is returned.
|
|
110
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
111
96
|
*/
|
|
112
97
|
remove(key: string): LazyPromise<boolean>;
|
|
113
98
|
/**
|
|
114
99
|
* The <i>removeMany</i> method removes keys. Returns true for the keys that are removed otherwise false is returned.
|
|
115
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
116
100
|
*/
|
|
117
101
|
removeMany<TKeys extends string>(keys: TKeys[]): LazyPromise<Record<TKeys, boolean>>;
|
|
118
102
|
/**
|
|
119
103
|
* The <i>getAndRemove</i> method removes the given <i>key</i> and returns it when found otherwise null will be returned.
|
|
120
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
121
104
|
*/
|
|
122
105
|
getAndRemove(key: string): LazyPromise<TType | null>;
|
|
123
106
|
/**
|
|
124
107
|
* The <i>getOrAdd</i> method will retrieve the given <i>key</i> if found otherwise <i>valueToAdd</i> will be added and returned.
|
|
125
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
126
108
|
*/
|
|
127
109
|
getOrAdd(key: string, valueToAdd: AsyncLazyable<GetOrAddValue<TType>>, ttl?: TimeSpan | null): LazyPromise<TType>;
|
|
128
110
|
/**
|
|
129
111
|
* The <i>increment</i> method will increment the given <i>key</i> if found otherwise nonthing will occur.
|
|
130
112
|
* Returns true if key is incremented otherwise false will be returned.
|
|
131
113
|
* An error will thrown if the key is not a number.
|
|
132
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
133
114
|
* @throws {TypeCacheError} {@link TypeCacheError}
|
|
134
115
|
*/
|
|
135
116
|
increment(key: string, value?: Extract<TType, number>): LazyPromise<boolean>;
|
|
@@ -137,14 +118,12 @@ export type ICache<TType = unknown> = ICacheListenable & {
|
|
|
137
118
|
* The <i>decrement</i> method will decrement the given <i>key</i> if found otherwise nonthing will occur.
|
|
138
119
|
* Returns true if key exists otherwise false will be returned.
|
|
139
120
|
* An error will thrown if the key is not a number.
|
|
140
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
141
121
|
* @throws {TypeCacheError} {@link TypeCacheError}
|
|
142
122
|
* An error will thrown if the key is not a number.
|
|
143
123
|
*/
|
|
144
124
|
decrement(key: string, value?: Extract<TType, number>): LazyPromise<boolean>;
|
|
145
125
|
/**
|
|
146
126
|
* The <i>clear</i> method removes all the keys in the cache.
|
|
147
|
-
* @throws {UnexpectedCacheError} {@link UnexpectedCacheError}
|
|
148
127
|
*/
|
|
149
128
|
clear(): LazyPromise<void>;
|
|
150
129
|
/**
|