@daiso-tech/core 0.40.0 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/backoff-policies/_module-exports.d.ts +5 -0
- package/dist/backoff-policies/_module-exports.js +6 -0
- package/dist/backoff-policies/_module-exports.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/_shared.d.ts +6 -7
- package/dist/{async/backof-policies → backoff-policies}/_shared.js +1 -1
- package/dist/backoff-policies/_shared.js.map +1 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.d.ts +6 -8
- package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.js +8 -10
- package/dist/backoff-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/exponential-backoff-policy/exponential-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js +30 -0
- package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/linear-backoff-policy/linear-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js +30 -0
- package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +30 -0
- package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/cache/contracts/cache-adapter.contract.d.ts +3 -3
- package/dist/cache/contracts/cache.contract.d.ts +22 -22
- package/dist/cache/contracts/cache.errors.d.ts +7 -14
- package/dist/cache/contracts/cache.errors.js +12 -24
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/contracts/cache.events.d.ts +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +4 -4
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +2 -2
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +3 -2
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +3 -3
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +2 -2
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +38 -43
- package/dist/cache/implementations/derivables/cache/cache.js +106 -101
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +3 -3
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +6 -8
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +5 -15
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +48 -48
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +107 -107
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +2 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -1
- package/dist/collection/contracts/async-collection.contract.d.ts +43 -43
- package/dist/collection/contracts/collection.contract.d.ts +15 -1
- package/dist/collection/contracts/collection.contract.js +1 -3
- package/dist/collection/contracts/collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.errors.d.ts +4 -13
- package/dist/collection/contracts/collection.errors.js +4 -16
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.d.ts +6 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js +3 -0
- package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +40 -51
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +31 -37
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.d.ts +3 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js +6 -0
- package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +3 -3
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +5 -2
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +3 -3
- package/dist/collection/implementations/list-collection/list-collection.js +5 -2
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/event-bus.contract.d.ts +10 -10
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +3 -6
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +7 -9
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +17 -24
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +32 -32
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +1 -3
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +4 -8
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +34 -32
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +195 -190
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/hooks/_module-exports.d.ts +3 -0
- package/dist/hooks/_module-exports.js +4 -0
- package/dist/hooks/_module-exports.js.map +1 -0
- package/dist/{utilities/classes/hooks → hooks}/async-hooks.d.ts +15 -26
- package/dist/{utilities/classes/hooks → hooks}/async-hooks.js +4 -6
- package/dist/hooks/async-hooks.js.map +1 -0
- package/dist/{utilities/classes/hooks → hooks}/hooks.d.ts +11 -18
- package/dist/{utilities/classes/hooks → hooks}/hooks.js +4 -5
- package/dist/hooks/hooks.js.map +1 -0
- package/dist/{utilities/classes/hooks → hooks}/types.d.ts +2 -3
- package/dist/hooks/types.js +5 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/lock/contracts/_module-exports.d.ts +4 -2
- package/dist/lock/contracts/_module-exports.js +4 -2
- package/dist/lock/contracts/_module-exports.js.map +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +24 -17
- package/dist/lock/contracts/lock-adapter.contract.d.ts +15 -24
- package/dist/lock/contracts/lock-adapter.contract.js +1 -10
- package/dist/lock/contracts/lock-adapter.contract.js.map +1 -1
- package/dist/lock/contracts/lock-provider.contract.d.ts +5 -5
- package/dist/lock/contracts/lock-state.contract.d.ts +52 -0
- package/dist/lock/contracts/lock-state.contract.js +14 -0
- package/dist/lock/contracts/lock-state.contract.js.map +1 -0
- package/dist/lock/contracts/lock.contract.d.ts +64 -55
- package/dist/lock/contracts/lock.errors.d.ts +13 -20
- package/dist/lock/contracts/lock.errors.js +19 -26
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.d.ts +21 -49
- package/dist/lock/contracts/lock.events.js +2 -3
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/contracts/types.d.ts +11 -0
- package/dist/lock/contracts/types.js +5 -0
- package/dist/lock/contracts/types.js.map +1 -0
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +21 -19
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +92 -61
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +8 -5
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +33 -13
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +7 -8
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +33 -20
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +6 -5
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +7 -5
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +26 -8
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +61 -28
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +6 -5
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +33 -33
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.d.ts +2 -2
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +4 -6
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +29 -39
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +31 -35
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +5 -8
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +27 -23
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +38 -34
- package/dist/lock/implementations/derivables/lock-provider/lock.js +182 -257
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.d.ts +9 -0
- package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.js +12 -0
- package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.js.map +1 -0
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +12 -13
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +7 -16
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +310 -207
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +376 -292
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -5
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +3285 -2976
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/namespace/_module-exports.d.ts +1 -0
- package/dist/namespace/_module-exports.js +2 -0
- package/dist/namespace/_module-exports.js.map +1 -0
- package/dist/namespace/namespace.d.ts +87 -0
- package/dist/namespace/namespace.js +117 -0
- package/dist/namespace/namespace.js.map +1 -0
- package/dist/resilience/_module-exports.d.ts +2 -0
- package/dist/resilience/_module-exports.js +3 -0
- package/dist/resilience/_module-exports.js.map +1 -0
- package/dist/resilience/middlewares/_module.d.ts +5 -0
- package/dist/resilience/middlewares/_module.js +6 -0
- package/dist/resilience/middlewares/_module.js.map +1 -0
- package/dist/resilience/middlewares/dynamic/_module.d.ts +1 -0
- package/dist/resilience/middlewares/dynamic/_module.js +2 -0
- package/dist/resilience/middlewares/dynamic/_module.js.map +1 -0
- package/dist/{async → resilience}/middlewares/dynamic/dynamic.middleware.d.ts +6 -6
- package/dist/{async → resilience}/middlewares/dynamic/dynamic.middleware.js +5 -5
- package/dist/resilience/middlewares/dynamic/dynamic.middleware.js.map +1 -0
- package/dist/resilience/middlewares/fallback/_module.d.ts +2 -0
- package/dist/resilience/middlewares/fallback/_module.js +3 -0
- package/dist/resilience/middlewares/fallback/_module.js.map +1 -0
- package/dist/{async → resilience}/middlewares/fallback/fallback.middleware.d.ts +9 -9
- package/dist/{async → resilience}/middlewares/fallback/fallback.middleware.js +7 -6
- package/dist/resilience/middlewares/fallback/fallback.middleware.js.map +1 -0
- package/dist/{async → resilience}/middlewares/fallback/fallback.types.d.ts +7 -6
- package/dist/{async → resilience}/middlewares/fallback/fallback.types.js +1 -1
- package/dist/resilience/middlewares/fallback/fallback.types.js.map +1 -0
- package/dist/resilience/middlewares/observe/_module.d.ts +2 -0
- package/dist/resilience/middlewares/observe/_module.js +3 -0
- package/dist/resilience/middlewares/observe/_module.js.map +1 -0
- package/dist/{async → resilience}/middlewares/observe/observe.middleware.d.ts +13 -11
- package/dist/{async → resilience}/middlewares/observe/observe.middleware.js +14 -10
- package/dist/resilience/middlewares/observe/observe.middleware.js.map +1 -0
- package/dist/{async → resilience}/middlewares/observe/observe.types.d.ts +13 -12
- package/dist/resilience/middlewares/observe/observe.types.js +5 -0
- package/dist/resilience/middlewares/observe/observe.types.js.map +1 -0
- package/dist/resilience/middlewares/retry/_module.d.ts +2 -0
- package/dist/resilience/middlewares/retry/_module.js +3 -0
- package/dist/resilience/middlewares/retry/_module.js.map +1 -0
- package/dist/{async → resilience}/middlewares/retry/retry.middleware.d.ts +12 -9
- package/dist/{async → resilience}/middlewares/retry/retry.middleware.js +19 -15
- package/dist/resilience/middlewares/retry/retry.middleware.js.map +1 -0
- package/dist/{async → resilience}/middlewares/retry/retry.types.d.ts +14 -12
- package/dist/resilience/middlewares/retry/retry.types.js +7 -0
- package/dist/resilience/middlewares/retry/retry.types.js.map +1 -0
- package/dist/resilience/middlewares/timeout/_module.d.ts +2 -0
- package/dist/resilience/middlewares/timeout/_module.js +3 -0
- package/dist/resilience/middlewares/timeout/_module.js.map +1 -0
- package/dist/{async → resilience}/middlewares/timeout/timeout.middleware.d.ts +9 -7
- package/dist/{async → resilience}/middlewares/timeout/timeout.middleware.js +12 -11
- package/dist/resilience/middlewares/timeout/timeout.middleware.js.map +1 -0
- package/dist/{async → resilience}/middlewares/timeout/timeout.type.d.ts +10 -9
- package/dist/resilience/middlewares/timeout/timeout.type.js +5 -0
- package/dist/resilience/middlewares/timeout/timeout.type.js.map +1 -0
- package/dist/resilience/resilience.errors.d.ts +40 -0
- package/dist/resilience/resilience.errors.js +48 -0
- package/dist/resilience/resilience.errors.js.map +1 -0
- package/dist/resilience/utilities/_module.d.ts +2 -0
- package/dist/resilience/utilities/_module.js +3 -0
- package/dist/resilience/utilities/_module.js.map +1 -0
- package/dist/resilience/utilities/abort-and-fail/_module.d.ts +1 -0
- package/dist/resilience/utilities/abort-and-fail/_module.js +2 -0
- package/dist/resilience/utilities/abort-and-fail/_module.js.map +1 -0
- package/dist/resilience/utilities/abort-and-fail/abort-and-fail.d.ts +7 -0
- package/dist/resilience/utilities/abort-and-fail/abort-and-fail.js +51 -0
- package/dist/resilience/utilities/abort-and-fail/abort-and-fail.js.map +1 -0
- package/dist/resilience/utilities/timeout-and-fail/_module.d.ts +1 -0
- package/dist/resilience/utilities/timeout-and-fail/_module.js +2 -0
- package/dist/resilience/utilities/timeout-and-fail/_module.js.map +1 -0
- package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.d.ts +7 -0
- package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.js +23 -0
- package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.js.map +1 -0
- package/dist/semaphore/contracts/_module-exports.d.ts +9 -0
- package/dist/semaphore/contracts/_module-exports.js +10 -0
- package/dist/semaphore/contracts/_module-exports.js.map +1 -0
- package/dist/semaphore/contracts/database-semaphore-adapter.contract.d.ts +90 -0
- package/dist/semaphore/contracts/database-semaphore-adapter.contract.js +5 -0
- package/dist/semaphore/contracts/database-semaphore-adapter.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore-adapter.contract.d.ts +61 -0
- package/dist/semaphore/contracts/semaphore-adapter.contract.js +5 -0
- package/dist/semaphore/contracts/semaphore-adapter.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore-provider-factory.contract.d.ts +19 -0
- package/dist/semaphore/contracts/semaphore-provider-factory.contract.js +9 -0
- package/dist/semaphore/contracts/semaphore-provider-factory.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore-provider.contract.d.ts +50 -0
- package/dist/semaphore/contracts/semaphore-provider.contract.js +5 -0
- package/dist/semaphore/contracts/semaphore-provider.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore-state.contract.d.ts +70 -0
- package/dist/semaphore/contracts/semaphore-state.contract.js +15 -0
- package/dist/semaphore/contracts/semaphore-state.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore.contract.d.ts +127 -0
- package/dist/semaphore/contracts/semaphore.contract.js +5 -0
- package/dist/semaphore/contracts/semaphore.contract.js.map +1 -0
- package/dist/semaphore/contracts/semaphore.errors.d.ts +52 -0
- package/dist/semaphore/contracts/semaphore.errors.js +63 -0
- package/dist/semaphore/contracts/semaphore.errors.js.map +1 -0
- package/dist/semaphore/contracts/semaphore.events.d.ts +101 -0
- package/dist/semaphore/contracts/semaphore.events.js +19 -0
- package/dist/semaphore/contracts/semaphore.events.js.map +1 -0
- package/dist/semaphore/contracts/types.d.ts +11 -0
- package/dist/semaphore/contracts/types.js +5 -0
- package/dist/semaphore/contracts/types.js.map +1 -0
- package/dist/semaphore/implementations/adapters/_module-exports.d.ts +5 -0
- package/dist/semaphore/implementations/adapters/_module-exports.js +6 -0
- package/dist/semaphore/implementations/adapters/_module-exports.js.map +1 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.d.ts +1 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.js +2 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.js.map +1 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.d.ts +97 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js +313 -0
- package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.d.ts +1 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.js +2 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.js.map +1 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.d.ts +49 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js +141 -0
- package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.d.ts +1 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.js +2 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.js.map +1 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.d.ts +80 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js +390 -0
- package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.d.ts +1 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.js +2 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.js.map +1 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.d.ts +18 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js +30 -0
- package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.d.ts +1 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.js +2 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.js.map +1 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.d.ts +48 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js +338 -0
- package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/derivables/_module-exports.d.ts +2 -0
- package/dist/semaphore/implementations/derivables/_module-exports.js +3 -0
- package/dist/semaphore/implementations/derivables/_module-exports.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/_module.d.ts +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/_module.js +2 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/_module.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.d.ts +17 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.js +74 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.d.ts +8 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.js +15 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.d.ts +8 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.js +15 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.d.ts +149 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js +135 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.d.ts +41 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.js +77 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.d.ts +83 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js +336 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.d.ts +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.js +2 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.js.map +1 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.d.ts +40 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js +67 -0
- package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js.map +1 -0
- package/dist/semaphore/implementations/test-utilities/_module-exports.d.ts +3 -0
- package/dist/semaphore/implementations/test-utilities/_module-exports.js +4 -0
- package/dist/semaphore/implementations/test-utilities/_module-exports.js.map +1 -0
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.d.ts +59 -0
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js +536 -0
- package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js.map +1 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.d.ts +59 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js +961 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js.map +1 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.d.ts +67 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js +4981 -0
- package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js.map +1 -0
- package/dist/serde/contracts/_module-exports.d.ts +0 -1
- package/dist/serde/contracts/_module-exports.js +0 -1
- package/dist/serde/contracts/_module-exports.js.map +1 -1
- package/dist/serde/contracts/flexible-serde.contract.d.ts +21 -5
- package/dist/serde/contracts/serde.errors.d.ts +14 -11
- package/dist/serde/contracts/serde.errors.js +15 -14
- package/dist/serde/contracts/serde.errors.js.map +1 -1
- package/dist/serde/implementations/adapters/_module-exports.d.ts +0 -3
- package/dist/serde/implementations/adapters/_module-exports.js +0 -3
- package/dist/serde/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +6 -0
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/derivables/serde-transformers.d.ts +38 -30
- package/dist/serde/implementations/derivables/serde-transformers.js +62 -20
- package/dist/serde/implementations/derivables/serde-transformers.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +12 -3
- package/dist/serde/implementations/derivables/serde.js +5 -2
- package/dist/serde/implementations/derivables/serde.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +85 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +85 -1
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js.map +1 -1
- package/dist/shared-lock/contracts/_module-exports.d.ts +10 -0
- package/dist/shared-lock/contracts/_module-exports.js +11 -0
- package/dist/shared-lock/contracts/_module-exports.js.map +1 -0
- package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.d.ts +145 -0
- package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.js +5 -0
- package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock-adapter.contract.d.ts +96 -0
- package/dist/shared-lock/contracts/shared-lock-adapter.contract.js +5 -0
- package/dist/shared-lock/contracts/shared-lock-adapter.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.d.ts +19 -0
- package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.js +9 -0
- package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock-provider.contract.d.ts +53 -0
- package/dist/shared-lock/contracts/shared-lock-provider.contract.js +5 -0
- package/dist/shared-lock/contracts/shared-lock-provider.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock-state.contract.d.ts +133 -0
- package/dist/shared-lock/contracts/shared-lock-state.contract.js +33 -0
- package/dist/shared-lock/contracts/shared-lock-state.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock.contract.d.ts +222 -0
- package/dist/shared-lock/contracts/shared-lock.contract.js +13 -0
- package/dist/shared-lock/contracts/shared-lock.contract.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock.errors.d.ts +124 -0
- package/dist/shared-lock/contracts/shared-lock.errors.js +136 -0
- package/dist/shared-lock/contracts/shared-lock.errors.js.map +1 -0
- package/dist/shared-lock/contracts/shared-lock.events.d.ts +205 -0
- package/dist/shared-lock/contracts/shared-lock.events.js +43 -0
- package/dist/shared-lock/contracts/shared-lock.events.js.map +1 -0
- package/dist/shared-lock/contracts/types.d.ts +10 -0
- package/dist/shared-lock/contracts/types.js +5 -0
- package/dist/shared-lock/contracts/types.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/_module-exports.d.ts +5 -0
- package/dist/shared-lock/implementations/adapters/_module-exports.js +6 -0
- package/dist/shared-lock/implementations/adapters/_module-exports.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.js +2 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.d.ts +114 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js +496 -0
- package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.js +2 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.d.ts +79 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js +347 -0
- package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.js +2 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.d.ts +112 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js +805 -0
- package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.js +2 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.d.ts +23 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js +42 -0
- package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.js +2 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.js.map +1 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.d.ts +79 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.js +630 -0
- package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/_module-exports.d.ts +2 -0
- package/dist/shared-lock/implementations/derivables/_module-exports.js +3 -0
- package/dist/shared-lock/implementations/derivables/_module-exports.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.js +2 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.d.ts +27 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.js +208 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.d.ts +8 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.js +12 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.d.ts +8 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.js +15 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts +190 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js +177 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.d.ts +41 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js +77 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.d.ts +95 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js +542 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.d.ts +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.js +2 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.js.map +1 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.d.ts +97 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js +128 -0
- package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js.map +1 -0
- package/dist/shared-lock/implementations/test-utilities/_module-exports.d.ts +3 -0
- package/dist/shared-lock/implementations/test-utilities/_module-exports.js +4 -0
- package/dist/shared-lock/implementations/test-utilities/_module-exports.js.map +1 -0
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.d.ts +59 -0
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js +944 -0
- package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js.map +1 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.d.ts +59 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js +1921 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js.map +1 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.d.ts +67 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js +9833 -0
- package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js.map +1 -0
- package/dist/task/_module-exports.d.ts +1 -0
- package/dist/task/_module-exports.js +2 -0
- package/dist/task/_module-exports.js.map +1 -0
- package/dist/{async/utilities/abort-and-fail → task}/abort-and-fail.d.ts +1 -1
- package/dist/{async/utilities/abort-and-fail → task}/abort-and-fail.js +1 -1
- package/dist/task/abort-and-fail.js.map +1 -0
- package/dist/task/task.d.ts +194 -0
- package/dist/task/task.js +212 -0
- package/dist/task/task.js.map +1 -0
- package/dist/time-span/contracts/_module-exports.d.ts +1 -0
- package/dist/time-span/contracts/_module-exports.js +2 -0
- package/dist/time-span/contracts/_module-exports.js.map +1 -0
- package/dist/time-span/contracts/time-span.contract.d.ts +19 -0
- package/dist/time-span/contracts/time-span.contract.js +10 -0
- package/dist/time-span/contracts/time-span.contract.js.map +1 -0
- package/dist/time-span/implementations/_module-exports.d.ts +1 -0
- package/dist/time-span/implementations/_module-exports.js +2 -0
- package/dist/time-span/implementations/_module-exports.js.map +1 -0
- package/dist/{utilities/classes/time-span → time-span/implementations}/time-span.d.ts +49 -11
- package/dist/{utilities/classes/time-span → time-span/implementations}/time-span.js +33 -11
- package/dist/time-span/implementations/time-span.js.map +1 -0
- package/dist/utilities/classes/_module.d.ts +0 -3
- package/dist/utilities/classes/_module.js +0 -3
- package/dist/utilities/classes/_module.js.map +1 -1
- package/dist/utilities/contracts/_module.d.ts +1 -1
- package/dist/utilities/contracts/_module.js +1 -1
- package/dist/utilities/contracts/_module.js.map +1 -1
- package/dist/utilities/contracts/comparable.contract.d.ts +49 -0
- package/dist/utilities/contracts/comparable.contract.js +5 -0
- package/dist/utilities/contracts/comparable.contract.js.map +1 -0
- package/dist/utilities/functions/is-standard-schema.d.ts +6 -0
- package/dist/utilities/functions/is-standard-schema.js +6 -0
- package/dist/utilities/functions/is-standard-schema.js.map +1 -1
- package/dist/utilities/functions/lazy.d.ts +3 -3
- package/dist/utilities/functions/lazy.js +3 -3
- package/dist/utilities/functions/lazy.js.map +1 -1
- package/dist/utilities/functions/option.d.ts +3 -0
- package/dist/utilities/functions/option.js +3 -0
- package/dist/utilities/functions/option.js.map +1 -1
- package/dist/utilities/functions/validate.d.ts +5 -0
- package/dist/utilities/functions/validate.js +5 -0
- package/dist/utilities/functions/validate.js.map +1 -1
- package/dist/utilities/types/any-class.type.d.ts +6 -0
- package/dist/utilities/types/any-class.type.js +3 -0
- package/dist/utilities/types/any-class.type.js.map +1 -1
- package/package.json +67 -5
- package/dist/async/_module-exports.d.ts +0 -4
- package/dist/async/_module-exports.js +0 -5
- package/dist/async/_module-exports.js.map +0 -1
- package/dist/async/async.errors.d.ts +0 -47
- package/dist/async/async.errors.js +0 -61
- package/dist/async/async.errors.js.map +0 -1
- package/dist/async/backof-policies/_module.d.ts +0 -5
- package/dist/async/backof-policies/_module.js +0 -6
- package/dist/async/backof-policies/_module.js.map +0 -1
- package/dist/async/backof-policies/_shared.js.map +0 -1
- package/dist/async/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
- package/dist/async/backof-policies/constant-backoff-policy/_module.js +0 -2
- package/dist/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/async/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
- package/dist/async/backof-policies/exponential-backoff-policy/_module.js +0 -2
- package/dist/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +0 -35
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/async/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
- package/dist/async/backof-policies/linear-backoff-policy/_module.js +0 -2
- package/dist/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +0 -35
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/_module.js +0 -2
- package/dist/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +0 -35
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/async/middlewares/_module.d.ts +0 -7
- package/dist/async/middlewares/_module.js +0 -8
- package/dist/async/middlewares/_module.js.map +0 -1
- package/dist/async/middlewares/bulkhead/_module.d.ts +0 -1
- package/dist/async/middlewares/bulkhead/_module.js +0 -2
- package/dist/async/middlewares/bulkhead/_module.js.map +0 -1
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +0 -80
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.js +0 -46
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.js.map +0 -1
- package/dist/async/middlewares/dynamic/_module.d.ts +0 -1
- package/dist/async/middlewares/dynamic/_module.js +0 -2
- package/dist/async/middlewares/dynamic/_module.js.map +0 -1
- package/dist/async/middlewares/dynamic/dynamic.middleware.js.map +0 -1
- package/dist/async/middlewares/fallback/_module.d.ts +0 -2
- package/dist/async/middlewares/fallback/_module.js +0 -3
- package/dist/async/middlewares/fallback/_module.js.map +0 -1
- package/dist/async/middlewares/fallback/fallback.middleware.js.map +0 -1
- package/dist/async/middlewares/fallback/fallback.types.js.map +0 -1
- package/dist/async/middlewares/hedging/_module.d.ts +0 -2
- package/dist/async/middlewares/hedging/_module.js +0 -3
- package/dist/async/middlewares/hedging/_module.js.map +0 -1
- package/dist/async/middlewares/hedging/hedging.types.d.ts +0 -121
- package/dist/async/middlewares/hedging/hedging.types.js +0 -6
- package/dist/async/middlewares/hedging/hedging.types.js.map +0 -1
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.d.ts +0 -51
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js +0 -133
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js.map +0 -1
- package/dist/async/middlewares/observe/_module.d.ts +0 -2
- package/dist/async/middlewares/observe/_module.js +0 -3
- package/dist/async/middlewares/observe/_module.js.map +0 -1
- package/dist/async/middlewares/observe/observe.middleware.js.map +0 -1
- package/dist/async/middlewares/observe/observe.types.js +0 -6
- package/dist/async/middlewares/observe/observe.types.js.map +0 -1
- package/dist/async/middlewares/retry/_module.d.ts +0 -2
- package/dist/async/middlewares/retry/_module.js +0 -3
- package/dist/async/middlewares/retry/_module.js.map +0 -1
- package/dist/async/middlewares/retry/retry.middleware.js.map +0 -1
- package/dist/async/middlewares/retry/retry.types.js +0 -7
- package/dist/async/middlewares/retry/retry.types.js.map +0 -1
- package/dist/async/middlewares/timeout/_module.d.ts +0 -2
- package/dist/async/middlewares/timeout/_module.js +0 -3
- package/dist/async/middlewares/timeout/_module.js.map +0 -1
- package/dist/async/middlewares/timeout/timeout.middleware.js.map +0 -1
- package/dist/async/middlewares/timeout/timeout.type.js +0 -6
- package/dist/async/middlewares/timeout/timeout.type.js.map +0 -1
- package/dist/async/utilities/_module.d.ts +0 -4
- package/dist/async/utilities/_module.js +0 -5
- package/dist/async/utilities/_module.js.map +0 -1
- package/dist/async/utilities/abort-and-fail/_module.d.ts +0 -1
- package/dist/async/utilities/abort-and-fail/_module.js +0 -2
- package/dist/async/utilities/abort-and-fail/_module.js.map +0 -1
- package/dist/async/utilities/abort-and-fail/abort-and-fail.js.map +0 -1
- package/dist/async/utilities/lazy-promise/_module.d.ts +0 -1
- package/dist/async/utilities/lazy-promise/_module.js +0 -2
- package/dist/async/utilities/lazy-promise/_module.js.map +0 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +0 -153
- package/dist/async/utilities/lazy-promise/lazy-promise.js +0 -176
- package/dist/async/utilities/lazy-promise/lazy-promise.js.map +0 -1
- package/dist/async/utilities/promise-queue/_module.d.ts +0 -1
- package/dist/async/utilities/promise-queue/_module.js +0 -2
- package/dist/async/utilities/promise-queue/_module.js.map +0 -1
- package/dist/async/utilities/promise-queue/promise-queue.d.ts +0 -32
- package/dist/async/utilities/promise-queue/promise-queue.js +0 -118
- package/dist/async/utilities/promise-queue/promise-queue.js.map +0 -1
- package/dist/async/utilities/timeout-and-fail/_module.d.ts +0 -1
- package/dist/async/utilities/timeout-and-fail/_module.js +0 -2
- package/dist/async/utilities/timeout-and-fail/_module.js.map +0 -1
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.d.ts +0 -7
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js +0 -22
- package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js.map +0 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +0 -40
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js +0 -60
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +0 -1
- package/dist/serde/contracts/serializable.contract.d.ts +0 -12
- package/dist/serde/contracts/serializable.contract.js +0 -5
- package/dist/serde/contracts/serializable.contract.js.map +0 -1
- package/dist/serde/implementations/adapters/mongodb-serde/_module.d.ts +0 -1
- package/dist/serde/implementations/adapters/mongodb-serde/_module.js +0 -2
- package/dist/serde/implementations/adapters/mongodb-serde/_module.js.map +0 -1
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.d.ts +0 -13
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +0 -38
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +0 -1
- package/dist/serde/implementations/adapters/redis-serde/_module.d.ts +0 -1
- package/dist/serde/implementations/adapters/redis-serde/_module.js +0 -2
- package/dist/serde/implementations/adapters/redis-serde/_module.js.map +0 -1
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.d.ts +0 -13
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +0 -39
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +0 -1
- package/dist/serde/implementations/adapters/sql-serde/_module.d.ts +0 -1
- package/dist/serde/implementations/adapters/sql-serde/_module.js +0 -2
- package/dist/serde/implementations/adapters/sql-serde/_module.js.map +0 -1
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.d.ts +0 -13
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +0 -39
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +0 -1
- package/dist/utilities/classes/hooks/_module.d.ts +0 -3
- package/dist/utilities/classes/hooks/_module.js +0 -4
- package/dist/utilities/classes/hooks/_module.js.map +0 -1
- package/dist/utilities/classes/hooks/async-hooks.js.map +0 -1
- package/dist/utilities/classes/hooks/hooks.js.map +0 -1
- package/dist/utilities/classes/hooks/types.js +0 -5
- package/dist/utilities/classes/hooks/types.js.map +0 -1
- package/dist/utilities/classes/namespace/_module.d.ts +0 -1
- package/dist/utilities/classes/namespace/_module.js +0 -2
- package/dist/utilities/classes/namespace/_module.js.map +0 -1
- package/dist/utilities/classes/namespace/namespace.d.ts +0 -85
- package/dist/utilities/classes/namespace/namespace.js +0 -125
- package/dist/utilities/classes/namespace/namespace.js.map +0 -1
- package/dist/utilities/classes/time-span/_module.d.ts +0 -1
- package/dist/utilities/classes/time-span/_module.js +0 -2
- package/dist/utilities/classes/time-span/_module.js.map +0 -1
- package/dist/utilities/classes/time-span/time-span.js.map +0 -1
- package/dist/utilities/contracts/serialized-error.contract.d.ts +0 -13
- package/dist/utilities/contracts/serialized-error.contract.js +0 -5
- package/dist/utilities/contracts/serialized-error.contract.js.map +0 -1
|
@@ -2,38 +2,31 @@
|
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* The error is thrown when a key is not found
|
|
5
6
|
*
|
|
6
7
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
7
8
|
* @group Errors
|
|
8
9
|
*/
|
|
9
|
-
export declare class
|
|
10
|
+
export declare class KeyNotFoundCacheError extends Error {
|
|
10
11
|
constructor(message: string, cause?: unknown);
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
|
-
* The error is thrown when attempting to increment or decrement a key that is not of number type.
|
|
14
14
|
*
|
|
15
15
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
16
16
|
* @group Errors
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
export declare const CACHE_ERRORS: {
|
|
19
|
+
readonly KeyNotFound: typeof KeyNotFoundCacheError;
|
|
20
|
+
};
|
|
21
21
|
/**
|
|
22
|
-
* The error is thrown when a key is not found
|
|
23
22
|
*
|
|
24
23
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
25
24
|
* @group Errors
|
|
26
25
|
*/
|
|
27
|
-
export
|
|
28
|
-
constructor(message: string, cause?: unknown);
|
|
29
|
-
}
|
|
26
|
+
export type AllCacheErrors = KeyNotFoundCacheError;
|
|
30
27
|
/**
|
|
31
28
|
*
|
|
32
29
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
33
30
|
* @group Errors
|
|
34
31
|
*/
|
|
35
|
-
export declare
|
|
36
|
-
readonly Base: typeof CacheError;
|
|
37
|
-
readonly Type: typeof TypeCacheError;
|
|
38
|
-
readonly KeyNotFound: typeof KeyNotFoundCacheError;
|
|
39
|
-
};
|
|
32
|
+
export declare function isCacheError(value: unknown): value is AllCacheErrors;
|
|
@@ -2,48 +2,36 @@
|
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* The error is thrown when a key is not found
|
|
5
6
|
*
|
|
6
7
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
7
8
|
* @group Errors
|
|
8
9
|
*/
|
|
9
|
-
export class
|
|
10
|
+
export class KeyNotFoundCacheError extends Error {
|
|
10
11
|
constructor(message, cause) {
|
|
11
12
|
super(message, { cause });
|
|
12
|
-
this.name =
|
|
13
|
+
this.name = KeyNotFoundCacheError.name;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
* The error is thrown when attempting to increment or decrement a key that is not of number type.
|
|
17
17
|
*
|
|
18
18
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
19
19
|
* @group Errors
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.name = TypeCacheError.name;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
export const CACHE_ERRORS = {
|
|
22
|
+
KeyNotFound: KeyNotFoundCacheError,
|
|
23
|
+
};
|
|
27
24
|
/**
|
|
28
|
-
* The error is thrown when a key is not found
|
|
29
25
|
*
|
|
30
26
|
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
31
27
|
* @group Errors
|
|
32
28
|
*/
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
export function isCacheError(value) {
|
|
30
|
+
for (const ErrorClass of Object.values(CACHE_ERRORS)) {
|
|
31
|
+
if (!(value instanceof ErrorClass)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
37
34
|
}
|
|
35
|
+
return true;
|
|
38
36
|
}
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
|
|
42
|
-
* @group Errors
|
|
43
|
-
*/
|
|
44
|
-
export const CACHE_ERRORS = {
|
|
45
|
-
Base: CacheError,
|
|
46
|
-
Type: TypeCacheError,
|
|
47
|
-
KeyNotFound: KeyNotFoundCacheError,
|
|
48
|
-
};
|
|
49
37
|
//# sourceMappingURL=cache.errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.errors.js","sourceRoot":"","sources":["../../../src/cache/contracts/cache.errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"cache.errors.js","sourceRoot":"","sources":["../../../src/cache/contracts/cache.errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5C,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;IAC3C,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,WAAW,EAAE,qBAAqB;CAC5B,CAAC;AASX;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACvC,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { type ICacheData, type ICacheInsert, type ICacheUpdate, type IDatabaseCacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import type { ISerde } from "../../../../serde/contracts/_module-exports.js";
|
|
6
6
|
import type { IDeinitizable, IInitizable, IPrunable } from "../../../../utilities/_module-exports.js";
|
|
7
|
-
import { TimeSpan } from "../../../../utilities/_module-exports.js";
|
|
8
7
|
import type { Kysely } from "kysely";
|
|
8
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* IMPORT_PATH: `"@daiso-tech/core/cache/adapters"`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {} from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import { MysqlAdapter, Transaction } from "kysely";
|
|
6
|
-
import { TimeSpan } from "../../../../
|
|
6
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
7
7
|
/**
|
|
8
8
|
* To utilize the `KyselyCacheAdapter`, you must install the [`"kysely"`](https://www.npmjs.com/package/kysely) package and configure a `Kysely` class instance.
|
|
9
9
|
* The adapter have been tested with `sqlite`, `postgres` and `mysql` databases.
|
|
@@ -109,7 +109,7 @@ export class KyselyCacheAdapter {
|
|
|
109
109
|
}
|
|
110
110
|
async deInit() {
|
|
111
111
|
if (this.shouldRemoveExpiredKeys && this.timeoutId !== null) {
|
|
112
|
-
|
|
112
|
+
clearInterval(this.timeoutId);
|
|
113
113
|
}
|
|
114
114
|
// Should throw if the index does not exists thats why the try catch is used.
|
|
115
115
|
try {
|
|
@@ -234,7 +234,7 @@ export class KyselyCacheAdapter {
|
|
|
234
234
|
const { value: serializedValue } = row;
|
|
235
235
|
const value = this.serde.deserialize(serializedValue);
|
|
236
236
|
if (typeof value !== "number") {
|
|
237
|
-
throw new
|
|
237
|
+
throw new TypeError(`Unable to increment or decrement none number type key "${data.key}"`);
|
|
238
238
|
}
|
|
239
239
|
const updateResult = await trx
|
|
240
240
|
.updateTable("cache")
|
package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kysely-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"kysely-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAKN,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAA0B,MAAM,QAAQ,CAAC;AAQ3E,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AA+C1E;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IAOnB,MAAM,CAAC,mBAAmB,CAAC,IAAc;QAC7C,OAAO,CACH,EAAwD,EACK,EAAE;YAC/D,MAAM,eAAe,GAAG,EAAE,CAAC,kBAAkB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAC3D,MAAM,aAAa,GAAG,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,aAAa,GAAG,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAC9D,MAAM,SAAS,GAAG,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAC9C,OAAO,EAAE,CAAC,GAAG,CAAC;gBACV,SAAS;gBACT,EAAE,CAAC,EAAE,CAAC;oBACF,eAAe;oBACf,EAAE,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;iBACzC,CAAC;aACL,CAAC,CAAC;QACP,CAAC,CAAC;IAC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
5
|
-
import type { TimeSpan } from "../../../../
|
|
5
|
+
import type { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
6
6
|
/**
|
|
7
7
|
* To utilize the `MemoryCacheAdapter`, you must create instance of it.
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @module Cache
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import {} from "../../../../cache/contracts/_module-exports.js";
|
|
6
6
|
/**
|
|
7
7
|
* To utilize the `MemoryCacheAdapter`, you must create instance of it.
|
|
8
8
|
*
|
|
@@ -63,7 +63,7 @@ export class MemoryCacheAdapter {
|
|
|
63
63
|
const hasKey = prevValue !== undefined;
|
|
64
64
|
if (hasKey) {
|
|
65
65
|
if (typeof prevValue !== "number") {
|
|
66
|
-
throw new
|
|
66
|
+
throw new TypeError(`Unable to increment or decrement none number type key "${key}"`);
|
|
67
67
|
}
|
|
68
68
|
const newValue = prevValue + value;
|
|
69
69
|
this.map.set(key, newValue);
|
package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"memory-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD;;GAEG;AAEH,OAAO,EAAsB,MAAM,sCAAsC,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAkBE;IAfZ,UAAU,GAAG,IAAI,GAAG,EAGlC,CAAC;IAEJ;;;;;;;;;OASG;IACH,YAA6B,MAA4B,IAAI,GAAG,EAAE;QAArC,QAAG,GAAH,G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AAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACxC,IAAI,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,CAAC;YAClB,CAAC;QACL,CAAC;QACD,OAAO,WAAW,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,SAAS;QACX,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAAc;QAClC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAChC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzB,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC5B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type ICacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import type { ISerde } from "../../../../serde/contracts/_module-exports.js";
|
|
6
|
-
import { type IDeinitizable, type IInitizable
|
|
6
|
+
import { type IDeinitizable, type IInitizable } from "../../../../utilities/_module-exports.js";
|
|
7
7
|
import { type ObjectId } from "mongodb";
|
|
8
8
|
import { type CollectionOptions, type Db } from "mongodb";
|
|
9
|
+
import type { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
11
12
|
* IMPORT_PATH: `"@daiso-tech/core/cache/adapters"`
|
|
@@ -64,7 +65,7 @@ export declare class MongodbCacheAdapter<TType = unknown> implements ICacheAdapt
|
|
|
64
65
|
constructor(settings: MongodbCacheAdapterSettings);
|
|
65
66
|
/**
|
|
66
67
|
* Creates all related indexes.
|
|
67
|
-
* Note the `init` method needs to be called before using the adapter.
|
|
68
|
+
* Note the `init` method needs to be called once before using the adapter.
|
|
68
69
|
*/
|
|
69
70
|
init(): Promise<void>;
|
|
70
71
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {} from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import { MongodbCacheAdapterSerde } from "../../../../cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js";
|
|
6
6
|
import { UnexpectedError, } from "../../../../utilities/_module-exports.js";
|
|
7
7
|
import { MongoServerError } from "mongodb";
|
|
@@ -84,7 +84,7 @@ export class MongodbCacheAdapter {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Creates all related indexes.
|
|
87
|
-
* Note the `init` method needs to be called before using the adapter.
|
|
87
|
+
* Note the `init` method needs to be called once before using the adapter.
|
|
88
88
|
*/
|
|
89
89
|
async init() {
|
|
90
90
|
try {
|
|
@@ -256,7 +256,7 @@ export class MongodbCacheAdapter {
|
|
|
256
256
|
}
|
|
257
257
|
catch (error) {
|
|
258
258
|
if (MongodbCacheAdapter.isMongodbIncrementError(error)) {
|
|
259
|
-
throw new
|
|
259
|
+
throw new TypeError(`Unable to increment or decrement none number type key "${key}"`);
|
|
260
260
|
}
|
|
261
261
|
throw error;
|
|
262
262
|
}
|
package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongodb-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"mongodb-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAsB,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,uFAAuF,CAAC;AACjI,OAAO,EACH,eAAe,GAGlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AAC1D,OAAO,EAKN,MAAM,SAAS,CAAC;AACjB,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAgCtD;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAGpB,MAAM,CAAC,mBAAmB,CAC9B,IAAc;QAEd,MAAM,eAAe,GAAiC;YAClD,UAAU,EAAE;gBACR,GAAG,EAAE,IAAI;aACZ;SACJ,CAAC;QACF,MAAM,aAAa,GAAiC;YAChD,UAAU,EAAE;gBACR,GAAG,EAAE,IAAI;aACZ;SACJ,CAAC;QACF,MAAM,aAAa,GAAiC;YAChD,UAAU,EAAE;gBACR,GAAG,EAAE,IAAI,IAAI,EAAE;aAClB;SACJ,CAAC;QACF,MAAM,SAAS,GAAG;YACd,GAAG,EAAE;gBACD,GAAG,EAAE,IAAI;aACZ;SACJ,CAAC;QACF,OAAO;YACH,IAAI,EAAE;gBACF,SAAS;gBACT;oBACI,GAAG,EAAE;wBACD,eAAe;wBACf;4BACI,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;yBACvC;qBACJ;iBACJ;aACJ;SACJ,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,uBAAuB,CAClC,KAAc;QAEd,OAAO,CACH,KAAK,YAAY,gBAAgB;YACjC,KAAK,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AM,IAAI,eAAe,CAAC,uCAAuC,CAAC,CAAC;QACvE,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
4
|
import { type ICacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
|
-
import type { TimeSpan } from "../../../../
|
|
5
|
+
import type { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
6
6
|
/**
|
|
7
7
|
* This `NoOpCacheAdapter` will do nothing and is used for easily mocking {@link ICache | `ICache`} for testing.
|
|
8
8
|
*
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type ICacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import type { ISerde } from "../../../../serde/contracts/_module-exports.js";
|
|
6
|
-
import type { TimeSpan } from "../../../../utilities/_module-exports.js";
|
|
7
6
|
import { type Redis, type Result } from "ioredis";
|
|
7
|
+
import type { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
8
8
|
declare module "ioredis" {
|
|
9
9
|
interface RedisCommander<Context> {
|
|
10
10
|
daiso_cache_increment(key: string, number: string): Result<number, Context>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {} from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import { ReplyError } from "ioredis";
|
|
6
6
|
import { ClearIterable } from "../../../../cache/implementations/adapters/redis-cache-adapter/utilities.js";
|
|
7
7
|
import { RedisCacheAdapterSerde } from "../../../../cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js";
|
|
@@ -105,7 +105,7 @@ export class RedisCacheAdapter {
|
|
|
105
105
|
if (!RedisCacheAdapter.isRedisTypeError(error)) {
|
|
106
106
|
throw error;
|
|
107
107
|
}
|
|
108
|
-
throw new
|
|
108
|
+
throw new TypeError(`Unable to increment or decrement none number type key "${key}"`);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
async removeMany(keys) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"redis-cache-adapter.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAsB,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mEAAmE,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mFAAmF,CAAC;AAwB3H;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IAGlB,MAAM,CAAC,gBAAgB;IAC3B,iHAAiH;IACjH,KAAU;QAEV,+DAA+D;QAC/D,OAAO,CACH,KAAK,YAAY,UAAU;YAC3B,yGAAyG;YACzG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAC3D,CAAC;IACN,CAAC;IAEgB,KAAK,CAAiB;IACtB,QAAQ,CAAQ;IAEjC;;;;;;;;;;;;;;;OAeG;IACH,YAAY,QAAmC;QAC3C,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEO,oBAAoB;QACxB,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,KAAK,UAAU,EAAE,CAAC;YAC5D,OAAO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YACD,MAAM,IAAI,SAAS,CACf,0DAA0D,GAAG,GAAG,CACnE,CAAC;QACN,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAc;QAC3B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QACtD,OAAO,YAAY,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,SAAS;QACX,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAAc;QAClC,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;YAC7D,WAAW;QACf,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { CacheEventMap, IDatabaseCacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
5
|
import { type ICache, type ICacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
6
|
-
import {
|
|
7
|
-
import { type NoneFunc
|
|
8
|
-
import {
|
|
6
|
+
import type { AsyncLazyable } from "../../../../utilities/_module-exports.js";
|
|
7
|
+
import { type NoneFunc } from "../../../../utilities/_module-exports.js";
|
|
8
|
+
import { Task } from "../../../../task/_module-exports.js";
|
|
9
9
|
import type { IEventBus, Unsubscribe, EventListener } from "../../../../event-bus/contracts/_module-exports.js";
|
|
10
|
-
import type { AsyncLazy, Factory } from "../../../../utilities/_module-exports.js";
|
|
11
10
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
11
|
+
import type { ITimeSpan } from "../../../../time-span/contracts/_module-exports.js";
|
|
12
|
+
import { Namespace } from "../../../../namespace/_module-exports.js";
|
|
12
13
|
/**
|
|
13
14
|
*
|
|
14
15
|
* IMPORT_PATH: `"@daiso-tech/core/cache"`
|
|
@@ -27,22 +28,12 @@ export type CacheSettingsBase<TType = unknown> = {
|
|
|
27
28
|
/**
|
|
28
29
|
* @default
|
|
29
30
|
* ```ts
|
|
30
|
-
* import { Namespace } from "@daiso-tech/core/
|
|
31
|
+
* import { Namespace } from "@daiso-tech/core/namespace";
|
|
31
32
|
*
|
|
32
|
-
* new Namespace(
|
|
33
|
+
* new Namespace("@cache")
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
36
|
namespace?: Namespace;
|
|
36
|
-
/**
|
|
37
|
-
* You can pass a {@link Factory | `Factory`} of {@link LazyPromise| `LazyPromise`} to configure default settings for all {@link LazyPromise| `LazyPromise`} instances used in the `Cache` class.
|
|
38
|
-
* @default
|
|
39
|
-
* ```ts
|
|
40
|
-
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
41
|
-
*
|
|
42
|
-
* (invokable) => new LazyPromise(invokable)
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
lazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>;
|
|
46
37
|
/**
|
|
47
38
|
* @default
|
|
48
39
|
* ```ts
|
|
@@ -59,22 +50,28 @@ export type CacheSettingsBase<TType = unknown> = {
|
|
|
59
50
|
* You can decide the default ttl value. If null is passed then no ttl will be used by default.
|
|
60
51
|
* @default null
|
|
61
52
|
*/
|
|
62
|
-
defaultTtl?:
|
|
53
|
+
defaultTtl?: ITimeSpan | null;
|
|
63
54
|
};
|
|
64
55
|
/**
|
|
65
56
|
*
|
|
66
57
|
* IMPORT_PATH: `"@daiso-tech/core/cache"`
|
|
67
58
|
* @group Derivables
|
|
68
59
|
*/
|
|
69
|
-
export type
|
|
60
|
+
export type CacheAdapterVariants<TType> = ICacheAdapter<TType> | IDatabaseCacheAdapter<TType>;
|
|
70
61
|
/**
|
|
71
62
|
*
|
|
72
63
|
* IMPORT_PATH: `"@daiso-tech/core/cache"`
|
|
73
64
|
* @group Derivables
|
|
74
65
|
*/
|
|
75
66
|
export type CacheSettings<TType = unknown> = CacheSettingsBase<TType> & {
|
|
76
|
-
adapter:
|
|
67
|
+
adapter: CacheAdapterVariants<any>;
|
|
77
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* IMPORT_PATH: `"@daiso-tech/core/cache"`
|
|
72
|
+
* @group Derivables
|
|
73
|
+
*/
|
|
74
|
+
export declare const DEFAULT_CACHE_NAMESPACE: Namespace;
|
|
78
75
|
/**
|
|
79
76
|
*
|
|
80
77
|
* IMPORT_PATH: `"@daiso-tech/core/cache"`
|
|
@@ -85,7 +82,6 @@ export declare class Cache<TType = unknown> implements ICache<TType> {
|
|
|
85
82
|
private readonly adapter;
|
|
86
83
|
private readonly defaultTtl;
|
|
87
84
|
private readonly namespace;
|
|
88
|
-
private readonly lazyPromiseFactory;
|
|
89
85
|
private readonly schema;
|
|
90
86
|
private readonly shouldValidateOutput;
|
|
91
87
|
/**
|
|
@@ -97,7 +93,7 @@ export declare class Cache<TType = unknown> implements ICache<TType> {
|
|
|
97
93
|
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters"
|
|
98
94
|
* import Sqlite from "better-sqlite3";
|
|
99
95
|
* import { Cache } from "@daiso-tech/core/cache";
|
|
100
|
-
* import { Namespace } from "@daiso-tech/core/
|
|
96
|
+
* import { Namespace } from "@daiso-tech/core/namespace";
|
|
101
97
|
*
|
|
102
98
|
* const database = new Sqlite("local.db");
|
|
103
99
|
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
@@ -118,46 +114,45 @@ export declare class Cache<TType = unknown> implements ICache<TType> {
|
|
|
118
114
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
119
115
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
120
116
|
*/
|
|
121
|
-
addListener<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>):
|
|
117
|
+
addListener<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>): Task<void>;
|
|
122
118
|
/**
|
|
123
119
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
124
120
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
125
121
|
*/
|
|
126
|
-
removeListener<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>):
|
|
122
|
+
removeListener<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>): Task<void>;
|
|
127
123
|
/**
|
|
128
124
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
129
125
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
130
126
|
*/
|
|
131
|
-
listenOnce<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>):
|
|
127
|
+
listenOnce<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>): Task<void>;
|
|
132
128
|
/**
|
|
133
129
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
134
130
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
135
131
|
*/
|
|
136
|
-
asPromise<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName):
|
|
132
|
+
asPromise<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName): Task<CacheEventMap<TType>[TEventName]>;
|
|
137
133
|
/**
|
|
138
134
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
139
135
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
140
136
|
*/
|
|
141
|
-
subscribeOnce<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>):
|
|
137
|
+
subscribeOnce<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>): Task<Unsubscribe>;
|
|
142
138
|
/**
|
|
143
139
|
* You can listen to the following {@link CacheEventMap | `CacheEventMap`} of the {@link ICache | `ICache`} instance.
|
|
144
140
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
145
141
|
*/
|
|
146
|
-
subscribe<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>):
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
clear(): LazyPromise<void>;
|
|
142
|
+
subscribe<TEventName extends keyof CacheEventMap<TType>>(eventName: TEventName, listener: EventListener<CacheEventMap<TType>[TEventName]>): Task<Unsubscribe>;
|
|
143
|
+
exists(key: string): Task<boolean>;
|
|
144
|
+
missing(key: string): Task<boolean>;
|
|
145
|
+
get(key: string): Task<TType | null>;
|
|
146
|
+
getOrFail(key: string): Task<TType>;
|
|
147
|
+
getAndRemove(key: string): Task<TType | null>;
|
|
148
|
+
getOr(key: string, defaultValue: AsyncLazyable<NoneFunc<TType>>): Task<TType>;
|
|
149
|
+
getOrAdd(key: string, valueToAdd: AsyncLazyable<NoneFunc<TType>>, ttl?: ITimeSpan | null): Task<TType>;
|
|
150
|
+
add(key: string, value: TType, ttl?: ITimeSpan | null): Task<boolean>;
|
|
151
|
+
put(key: string, value: TType, ttl?: ITimeSpan | null): Task<boolean>;
|
|
152
|
+
update(key: string, value: TType): Task<boolean>;
|
|
153
|
+
increment(key: string, value?: Extract<TType, number>): Task<boolean>;
|
|
154
|
+
decrement(key: string, value?: Extract<TType, number>): Task<boolean>;
|
|
155
|
+
remove(key: string): Task<boolean>;
|
|
156
|
+
removeMany(keys: Iterable<string>): Task<boolean>;
|
|
157
|
+
clear(): Task<void>;
|
|
163
158
|
}
|