@daiso-tech/core 0.40.0 → 0.41.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/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
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Hooks
|
|
3
3
|
*/
|
|
4
|
-
import { type IInvokableObject, type Invokable, type InvokableFn, type OneOrMore } from "
|
|
5
|
-
import type { HookContext } from "
|
|
4
|
+
import { type IInvokableObject, type Invokable, type InvokableFn, type OneOrMore } from "../utilities/_module-exports.js";
|
|
5
|
+
import type { HookContext } from "../hooks/types.js";
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
9
|
-
* @group Hooks
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
10
9
|
*/
|
|
11
10
|
export type NextFunc<TParameters extends unknown[] = unknown[], TReturn = unknown> = InvokableFn<TParameters, TReturn>;
|
|
12
11
|
/**
|
|
13
12
|
*
|
|
14
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
15
|
-
* @group Hooks
|
|
13
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
16
14
|
*/
|
|
17
15
|
export type Context<TContext extends HookContext = HookContext> = {
|
|
18
16
|
name: string;
|
|
@@ -20,8 +18,7 @@ export type Context<TContext extends HookContext = HookContext> = {
|
|
|
20
18
|
};
|
|
21
19
|
/**
|
|
22
20
|
*
|
|
23
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
24
|
-
* @group Hooks
|
|
21
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
25
22
|
*/
|
|
26
23
|
export type MiddlewareFn<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = InvokableFn<[
|
|
27
24
|
arguments_: TParameters,
|
|
@@ -30,8 +27,7 @@ export type MiddlewareFn<TParameters extends unknown[] = unknown[], TReturn = un
|
|
|
30
27
|
], TReturn>;
|
|
31
28
|
/**
|
|
32
29
|
*
|
|
33
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
34
|
-
* @group Hooks
|
|
30
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
35
31
|
*/
|
|
36
32
|
export type IMiddlewareObject<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IInvokableObject<[
|
|
37
33
|
arguments_: TParameters,
|
|
@@ -40,14 +36,12 @@ export type IMiddlewareObject<TParameters extends unknown[] = unknown[], TReturn
|
|
|
40
36
|
], TReturn>;
|
|
41
37
|
/**
|
|
42
38
|
*
|
|
43
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
44
|
-
* @group Hooks
|
|
39
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
45
40
|
*/
|
|
46
41
|
export type Middleware<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IMiddlewareObject<TParameters, TReturn, TContext> | MiddlewareFn<TParameters, TReturn, TContext>;
|
|
47
42
|
/**
|
|
48
43
|
*
|
|
49
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
50
|
-
* @group Hooks
|
|
44
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
51
45
|
*/
|
|
52
46
|
export type HooksSettings<TContext extends HookContext = HookContext> = {
|
|
53
47
|
/**
|
|
@@ -66,8 +60,7 @@ export type HooksSettings<TContext extends HookContext = HookContext> = {
|
|
|
66
60
|
*
|
|
67
61
|
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
68
62
|
*
|
|
69
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
70
|
-
* @group Hooks
|
|
63
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
71
64
|
*/
|
|
72
65
|
export declare class Hooks<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> implements IInvokableObject<TParameters, TReturn> {
|
|
73
66
|
private readonly invokable;
|
|
@@ -78,7 +71,7 @@ export declare class Hooks<TParameters extends unknown[] = unknown[], TReturn =
|
|
|
78
71
|
/**
|
|
79
72
|
* @example
|
|
80
73
|
* ```ts
|
|
81
|
-
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/
|
|
74
|
+
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/hooks";
|
|
82
75
|
*
|
|
83
76
|
* function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
|
|
84
77
|
* return (args, next, { name: funcName }) => {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
2
|
+
* @module Hooks
|
|
3
3
|
*/
|
|
4
|
-
import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "
|
|
4
|
+
import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
6
|
* The `Hooks` class provides a convenient way to change and inspect arguments and return value of only sync functions.
|
|
7
7
|
* For example `Hooks` class can be used to log function arguments and return values. Note this class is immutable.
|
|
8
8
|
*
|
|
9
9
|
* Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
|
|
10
10
|
*
|
|
11
|
-
* IMPORT_PATH: `"@daiso-tech/core/
|
|
12
|
-
* @group Hooks
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/hooks"`
|
|
13
12
|
*/
|
|
14
13
|
export class Hooks {
|
|
15
14
|
invokable;
|
|
@@ -35,7 +34,7 @@ export class Hooks {
|
|
|
35
34
|
/**
|
|
36
35
|
* @example
|
|
37
36
|
* ```ts
|
|
38
|
-
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/
|
|
37
|
+
* import { Hooks, type MiddlewareFn } from "@daiso-tech/core/hooks";
|
|
39
38
|
*
|
|
40
39
|
* function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
|
|
41
40
|
* return (args, next, { name: funcName }) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKnB,MAAM,gCAAgC,CAAC;AAoFxC;;;;;;;GAOG;AACH,MAAM,OAAO,KAAK;IAoFO;IACA;IAGA;IAlFb,MAAM,CAAC,IAAI,CAKf,SAA0C,EAC1C,WAAkE,EAClE,EACI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAClC,OAAO,GAAG,EAAc,GACF;QAE1B,IAAI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,WAAW,CAAC;aAC3C,GAAG,CAAC,gBAAgB,CAAC;aACrB,OAAO,EAAE,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC;YACtB,MAAM,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE,CACxC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC;YAC5B,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE;gBAClC,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE;oBAC1B,IAAI;oBACJ,OAAO;iBACV,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEgB,IAAI,CAAoC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,YACqB,SAA0C,EAC1C,WAEhB,EACgB,WAAoC,EAAE;QAJtC,cAAS,GAAT,SAAS,CAAiC;QAC1C,gBAAW,GAAX,WAAW,CAE3B;QACgB,aAAQ,GAAR,QAAQ,CAA8B;QAEvD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,WAAkE;QAElE,OAAO,IAAI,KAAK,CACZ,IAAI,CAAC,SAAS,EACd;YACI,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;YACrC,GAAG,gBAAgB,CAAC,WAAW,CAAC;SACnC,EACD,IAAI,CAAC,QAAQ,CAChB,CAAC;IACN,CAAC;IAED;;OAEG;IACH,QAAQ,CACJ,SAAkB,EAClB,WAAkE;QAElE,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAG,UAAuB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IACpC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/hooks/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export * from "../../lock/contracts/lock-adapter.contract.js";
|
|
2
1
|
export * from "../../lock/contracts/database-lock-adapter.contract.js";
|
|
3
|
-
export * from "../../lock/contracts/lock-
|
|
2
|
+
export * from "../../lock/contracts/lock-adapter.contract.js";
|
|
4
3
|
export * from "../../lock/contracts/lock-provider-factory.contract.js";
|
|
4
|
+
export * from "../../lock/contracts/lock-provider.contract.js";
|
|
5
|
+
export * from "../../lock/contracts/lock-state.contract.js";
|
|
5
6
|
export * from "../../lock/contracts/lock.contract.js";
|
|
6
7
|
export * from "../../lock/contracts/lock.errors.js";
|
|
7
8
|
export * from "../../lock/contracts/lock.events.js";
|
|
9
|
+
export * from "../../lock/contracts/types.js";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export * from "../../lock/contracts/lock-adapter.contract.js";
|
|
2
1
|
export * from "../../lock/contracts/database-lock-adapter.contract.js";
|
|
3
|
-
export * from "../../lock/contracts/lock-
|
|
2
|
+
export * from "../../lock/contracts/lock-adapter.contract.js";
|
|
4
3
|
export * from "../../lock/contracts/lock-provider-factory.contract.js";
|
|
4
|
+
export * from "../../lock/contracts/lock-provider.contract.js";
|
|
5
|
+
export * from "../../lock/contracts/lock-state.contract.js";
|
|
5
6
|
export * from "../../lock/contracts/lock.contract.js";
|
|
6
7
|
export * from "../../lock/contracts/lock.errors.js";
|
|
7
8
|
export * from "../../lock/contracts/lock.events.js";
|
|
9
|
+
export * from "../../lock/contracts/types.js";
|
|
8
10
|
//# sourceMappingURL=_module-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/lock/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,
|
|
1
|
+
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/lock/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
+
import type { InvokableFn } from "../../utilities/_module-exports.js";
|
|
4
5
|
/**
|
|
5
6
|
*
|
|
6
7
|
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
@@ -24,6 +25,21 @@ export type ILockData = ILockExpirationData & {
|
|
|
24
25
|
*/
|
|
25
26
|
owner: string;
|
|
26
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
31
|
+
* @group Contracts
|
|
32
|
+
*/
|
|
33
|
+
export type IDatabaseLockTransaction = {
|
|
34
|
+
/**
|
|
35
|
+
* The `find` returns the lock if it exists otherwise `null` is returned.
|
|
36
|
+
*/
|
|
37
|
+
find(key: string): Promise<ILockData | null>;
|
|
38
|
+
/**
|
|
39
|
+
* The `upsert` inserts a lock if it doesnt exist otherwise it will be updated.
|
|
40
|
+
*/
|
|
41
|
+
upsert(key: string, lockId: string, expiration: Date | null): Promise<void>;
|
|
42
|
+
};
|
|
27
43
|
/**
|
|
28
44
|
* The `IDatabaseLockAdapter` contract defines a way for managing locks independent of data storage.
|
|
29
45
|
* This contract simplifies the implementation of lock adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.
|
|
@@ -33,23 +49,14 @@ export type ILockData = ILockExpirationData & {
|
|
|
33
49
|
*/
|
|
34
50
|
export type IDatabaseLockAdapter = {
|
|
35
51
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* @param key The unique identifier for the lock.
|
|
39
|
-
* @param owner The identifier of the entity acquiring the lock.
|
|
40
|
-
* @param expiration The date and time when the lock should expire. Use `null` for a lock that doesn't expire.
|
|
41
|
-
*/
|
|
42
|
-
insert(key: string, owner: string, expiration: Date | null): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Conditionally renews the lock on `key` if it has already expired, setting a new `owner` and `expiration`.
|
|
45
|
-
* Note you need to check if the expiration field is not null and greater than or equal to current time.
|
|
52
|
+
* The `transaction` method runs the `fn` function inside a transaction.
|
|
53
|
+
* The `fn` function is given a {@link IDatabaseLockTransaction | `IDatabaseLockTransaction`} object.
|
|
46
54
|
*
|
|
47
|
-
*
|
|
48
|
-
* @param owner The new identifier for the entity acquiring the lock.
|
|
49
|
-
* @param expiration The new date and time when the lock should expire. Use `null` for a lock that doesn't expire.
|
|
50
|
-
* @returns Returns number of updated.
|
|
55
|
+
* Note when implementing this method use the strictest transaction level mode.
|
|
51
56
|
*/
|
|
52
|
-
|
|
57
|
+
transaction<TReturn>(fn: InvokableFn<[
|
|
58
|
+
transaction: IDatabaseLockTransaction
|
|
59
|
+
], Promise<TReturn>>): Promise<TReturn>;
|
|
53
60
|
/**
|
|
54
61
|
* Removes a lock from the database regardless of its owner.
|
|
55
62
|
*
|
|
@@ -63,7 +70,7 @@ export type IDatabaseLockAdapter = {
|
|
|
63
70
|
* @param owner The identifier of the expected owner.
|
|
64
71
|
* @returns Returns {@link ILockExpirationData |`ILockExpirationData | null`}. The {@link ILockExpirationData |`ILockExpirationData`} data if successfully removed, otherwise `null` if the lock wasn't found or the owner didn't match.
|
|
65
72
|
*/
|
|
66
|
-
removeIfOwner(key: string,
|
|
73
|
+
removeIfOwner(key: string, lockId: string): Promise<ILockData | null>;
|
|
67
74
|
/**
|
|
68
75
|
* Updates the expiration date of a lock if it is currently held by the specified owner.
|
|
69
76
|
*
|
|
@@ -72,7 +79,7 @@ export type IDatabaseLockAdapter = {
|
|
|
72
79
|
* @param expiration The new date and time when the lock should expire.
|
|
73
80
|
* @returns Returns a number greater than or equal to `1` if the lock's expiration was updated, or `0` if the lock wasn't found or the owner didn't match.
|
|
74
81
|
*/
|
|
75
|
-
|
|
82
|
+
updateExpiration(key: string, lockId: string, expiration: Date): Promise<number>;
|
|
76
83
|
/**
|
|
77
84
|
* Retrieves the current lock data for a given key.
|
|
78
85
|
*
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import type { TimeSpan } from "../../
|
|
4
|
+
import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
6
|
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
8
7
|
* @group Contracts
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly UNEXPIRABLE_KEY: "unexpireable_key";
|
|
9
|
+
export type ILockAdapterState = {
|
|
10
|
+
owner: string;
|
|
11
|
+
expiration: Date | null;
|
|
14
12
|
};
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
18
|
-
* @group Contracts
|
|
19
|
-
*/
|
|
20
|
-
export type LockRefreshResult = (typeof LOCK_REFRESH_RESULT)[keyof typeof LOCK_REFRESH_RESULT];
|
|
21
13
|
/**
|
|
22
14
|
* The `ILockAdapter` contract defines a way for managing locks independent of the underlying technology.
|
|
23
15
|
* This contract is not meant to be used directly, instead you should use {@link ILockProvider | `ILockProvider`} contract.
|
|
@@ -27,29 +19,28 @@ export type LockRefreshResult = (typeof LOCK_REFRESH_RESULT)[keyof typeof LOCK_R
|
|
|
27
19
|
*/
|
|
28
20
|
export type ILockAdapter = {
|
|
29
21
|
/**
|
|
30
|
-
* The `acquire` method acquires a lock only if
|
|
22
|
+
* The `acquire` method acquires a lock only if expired.
|
|
31
23
|
*
|
|
32
|
-
* @returns Returns true if
|
|
24
|
+
* @returns Returns `true` if expired otherwise `false` is returned.
|
|
33
25
|
*/
|
|
34
|
-
acquire(key: string,
|
|
26
|
+
acquire(key: string, lockId: string, ttl: TimeSpan | null): Promise<boolean>;
|
|
35
27
|
/**
|
|
36
28
|
* The `release` method releases a lock if the owner matches.
|
|
37
29
|
*
|
|
38
|
-
* @returns Returns true if released otherwise false is returned.
|
|
30
|
+
* @returns Returns `true` if released otherwise `false` is returned.
|
|
39
31
|
*/
|
|
40
|
-
release(key: string,
|
|
32
|
+
release(key: string, lockId: string): Promise<boolean>;
|
|
41
33
|
/**
|
|
42
34
|
* The `forceRelease` method releases a lock regardless of the owner.
|
|
43
35
|
*
|
|
44
|
-
* @returns Returns true if the lock
|
|
36
|
+
* @returns Returns `true` if the lock exists or `false` if the lock is expired.
|
|
45
37
|
*/
|
|
46
38
|
forceRelease(key: string): Promise<boolean>;
|
|
47
39
|
/**
|
|
48
|
-
* The `refresh` method will upadte `ttl` of lock if it matches the
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* - {@link LOCK_REFRESH_RESULT.UNEXPIRABLE_KEY | `LOCK_REFRESH_RESULT.UNEXPIRABLE_KEY`}: The lock is owned by the same owner but cannot be refreshed because it's unexpirable.
|
|
52
|
-
* - {@link LOCK_REFRESH_RESULT.REFRESHED | `LOCK_REFRESH_RESULT.REFRESHED`}: The lock is owned by the same owner and its ttl has been updated.
|
|
40
|
+
* The `refresh` method will upadte `ttl` of lock if it matches the `owner` and is expireable.
|
|
41
|
+
*
|
|
42
|
+
* @returns Returns `false` if the lock is unexpireable, the is expired, does not match the `owner` otherwise `true` is returned.
|
|
53
43
|
*/
|
|
54
|
-
refresh(key: string,
|
|
44
|
+
refresh(key: string, lockId: string, ttl: TimeSpan): Promise<boolean>;
|
|
45
|
+
getState(key: string): Promise<ILockAdapterState | null>;
|
|
55
46
|
};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
7
|
-
* @group Contracts
|
|
8
|
-
*/
|
|
9
|
-
export const LOCK_REFRESH_RESULT = {
|
|
10
|
-
REFRESHED: "refreshed",
|
|
11
|
-
UNOWNED_REFRESH: "unonwned_refresh",
|
|
12
|
-
UNEXPIRABLE_KEY: "unexpireable_key",
|
|
13
|
-
};
|
|
4
|
+
export {};
|
|
14
5
|
//# sourceMappingURL=lock-adapter.contract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-adapter.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"lock-adapter.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import type { OneOrMore, TimeSpan } from "../../utilities/_module-exports.js";
|
|
5
4
|
import type { ILock } from "../../lock/contracts/lock.contract.js";
|
|
6
5
|
import type { IEventListenable } from "../../event-bus/contracts/_module-exports.js";
|
|
7
6
|
import type { LockEventMap } from "../../lock/contracts/lock.events.js";
|
|
7
|
+
import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
|
|
8
8
|
/**
|
|
9
9
|
* The `ILockListenable` contract defines a way for listening {@link ILock | `ILock`} operations.
|
|
10
10
|
*
|
|
@@ -21,11 +21,11 @@ export type LockProviderCreateSettings = {
|
|
|
21
21
|
/**
|
|
22
22
|
* You can also provide a `settings.ttl` value using. If not specified it defaults to null, meaning no TTL is applied.
|
|
23
23
|
*/
|
|
24
|
-
ttl?:
|
|
24
|
+
ttl?: ITimeSpan | null;
|
|
25
25
|
/**
|
|
26
|
-
* You can provide a custom
|
|
26
|
+
* You can provide a custom lock id. If not specified a unique lock id will be generated by default.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
lockId?: string;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
@@ -40,7 +40,7 @@ export type ILockProviderBase = {
|
|
|
40
40
|
* If it's an `Iterable`, it will be joined into a single string.
|
|
41
41
|
* Think of an `Iterable` as representing a path.
|
|
42
42
|
*/
|
|
43
|
-
create(key:
|
|
43
|
+
create(key: string, settings?: LockProviderCreateSettings): ILock;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* The `ILockProvider` contract defines a way for managing locks independent of the underlying technology.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Lock
|
|
3
|
+
*/
|
|
4
|
+
import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
8
|
+
* @group Contracts
|
|
9
|
+
*/
|
|
10
|
+
export declare const LOCK_STATE: {
|
|
11
|
+
readonly EXPIRED: "EXPIRED";
|
|
12
|
+
readonly UNAVAILABLE: "UNAVAILABLE";
|
|
13
|
+
readonly ACQUIRED: "ACQUIRED";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
18
|
+
* @group Contracts
|
|
19
|
+
*/
|
|
20
|
+
export type LockState = (typeof LOCK_STATE)[keyof typeof LOCK_STATE];
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
24
|
+
* @group Contracts
|
|
25
|
+
*/
|
|
26
|
+
export type ILockExpiredState = {
|
|
27
|
+
type: (typeof LOCK_STATE)["EXPIRED"];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
32
|
+
* @group Contracts
|
|
33
|
+
*/
|
|
34
|
+
export type ILockUnavailableState = {
|
|
35
|
+
type: (typeof LOCK_STATE)["UNAVAILABLE"];
|
|
36
|
+
owner: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
41
|
+
* @group Contracts
|
|
42
|
+
*/
|
|
43
|
+
export type ILockAcquiredState = {
|
|
44
|
+
type: (typeof LOCK_STATE)["ACQUIRED"];
|
|
45
|
+
remainingTime: TimeSpan | null;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
50
|
+
* @group Contracts
|
|
51
|
+
*/
|
|
52
|
+
export type ILockState = ILockUnavailableState | ILockAcquiredState | ILockExpiredState;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Lock
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
7
|
+
* @group Contracts
|
|
8
|
+
*/
|
|
9
|
+
export const LOCK_STATE = {
|
|
10
|
+
EXPIRED: "EXPIRED",
|
|
11
|
+
UNAVAILABLE: "UNAVAILABLE",
|
|
12
|
+
ACQUIRED: "ACQUIRED",
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=lock-state.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-state.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-state.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;CACd,CAAC"}
|
|
@@ -1,120 +1,129 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import type { AsyncLazy, Result
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
4
|
+
import type { AsyncLazy, Result } from "../../utilities/_module-exports.js";
|
|
5
|
+
import type { Task } from "../../task/_module-exports.js";
|
|
6
|
+
import type { FailedAcquireLockError } from "../../lock/contracts/lock.errors.js";
|
|
7
|
+
import type { ILockState } from "../../lock/contracts/lock-state.contract.js";
|
|
8
|
+
import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
|
|
7
9
|
/**
|
|
8
10
|
*
|
|
9
11
|
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
10
12
|
* @group Contracts
|
|
11
13
|
*/
|
|
12
14
|
export type LockAquireBlockingSettings = {
|
|
13
|
-
time?:
|
|
14
|
-
interval?:
|
|
15
|
+
time?: ITimeSpan;
|
|
16
|
+
interval?: ITimeSpan;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
*
|
|
18
20
|
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
19
21
|
* @group Contracts
|
|
20
22
|
*/
|
|
21
|
-
export type
|
|
23
|
+
export type ILockStateMethods = {
|
|
24
|
+
getState(): Task<ILockState>;
|
|
22
25
|
/**
|
|
23
|
-
* The `
|
|
26
|
+
* The `key` of the `ILock` instance.
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
readonly key: string;
|
|
26
29
|
/**
|
|
27
|
-
* The `
|
|
28
|
-
* @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
|
|
30
|
+
* The `id` of the `ILock` instance.
|
|
29
31
|
*/
|
|
30
|
-
|
|
32
|
+
readonly id: string;
|
|
31
33
|
/**
|
|
32
|
-
* The `
|
|
34
|
+
* The `ttl` of `ILock` instance.
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
readonly ttl: ITimeSpan | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
41
|
+
* @group Contracts
|
|
42
|
+
*/
|
|
43
|
+
export type ILockBase = {
|
|
35
44
|
/**
|
|
36
|
-
* The `
|
|
37
|
-
* @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
|
|
45
|
+
* The `run` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquire` and `release` method.
|
|
38
46
|
*/
|
|
39
|
-
|
|
47
|
+
run<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<Result<TValue, FailedAcquireLockError>>;
|
|
40
48
|
/**
|
|
41
|
-
* The `
|
|
49
|
+
* The `runOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireOrFail` and `release` method.
|
|
50
|
+
* @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
|
|
51
|
+
*/
|
|
52
|
+
runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<TValue>;
|
|
53
|
+
/**
|
|
54
|
+
* The `runBlocking` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlocking` and `release` method.
|
|
55
|
+
*/
|
|
56
|
+
runBlocking<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<Result<TValue, FailedAcquireLockError>>;
|
|
57
|
+
/**
|
|
58
|
+
* The `runBlockingOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlockingOrFail` and `release` method.
|
|
59
|
+
* @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
|
|
60
|
+
*/
|
|
61
|
+
runBlockingOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<TValue>;
|
|
62
|
+
/**
|
|
63
|
+
* The `acquire` method acquires a lock only if the key is not already acquired by different owner.
|
|
42
64
|
*
|
|
43
65
|
* @returns Returns true if the lock is not already acquired otherwise false is returned.
|
|
44
66
|
*/
|
|
45
|
-
acquire():
|
|
67
|
+
acquire(): Task<boolean>;
|
|
46
68
|
/**
|
|
47
|
-
* The `acquireOrFail` method acquires a lock only if the
|
|
69
|
+
* The `acquireOrFail` method acquires a lock only if the key is not already acquired by different owner.
|
|
48
70
|
* Throws an error if the lock is already acquired by different owner.
|
|
49
71
|
*
|
|
50
|
-
* @throws {
|
|
72
|
+
* @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
|
|
51
73
|
*/
|
|
52
|
-
acquireOrFail():
|
|
74
|
+
acquireOrFail(): Task<void>;
|
|
53
75
|
/**
|
|
54
|
-
* The `acquireBlocking` method acquires a lock only if the
|
|
76
|
+
* The `acquireBlocking` method acquires a lock only if the key is not already acquired by different owner.
|
|
55
77
|
* If the lock is not acquired, it retries every `settings.interval` until `settings.time` is reached.
|
|
56
78
|
*
|
|
57
79
|
* @returns Returns true if the lock is not already acquired otherwise false is returned.
|
|
58
80
|
*/
|
|
59
|
-
acquireBlocking(settings?: LockAquireBlockingSettings):
|
|
81
|
+
acquireBlocking(settings?: LockAquireBlockingSettings): Task<boolean>;
|
|
60
82
|
/**
|
|
61
|
-
* The `acquireBlockingOrFail` method acquires a lock only if the
|
|
83
|
+
* The `acquireBlockingOrFail` method acquires a lock only if the key is not already acquired by different owner.
|
|
62
84
|
* If the lock is not acquired, it retries every `settings.interval` until `settings.time` is reached.
|
|
63
85
|
* Throws an error if the lock is already acquired by different owner.
|
|
64
86
|
*
|
|
65
|
-
* @throws {
|
|
87
|
+
* @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
|
|
66
88
|
*/
|
|
67
|
-
acquireBlockingOrFail(settings?: LockAquireBlockingSettings):
|
|
89
|
+
acquireBlockingOrFail(settings?: LockAquireBlockingSettings): Task<void>;
|
|
68
90
|
/**
|
|
69
91
|
* The `release` method releases a lock if owned by the same owner.
|
|
70
92
|
*
|
|
71
93
|
* @returns Returns true if the lock is released otherwise false is returned.
|
|
72
94
|
*/
|
|
73
|
-
release():
|
|
95
|
+
release(): Task<boolean>;
|
|
74
96
|
/**
|
|
75
97
|
* The `releaseOrFail` method releases a lock if owned by the same owner.
|
|
76
|
-
* Throws an error if
|
|
98
|
+
* Throws an error if the lock is not owned by same owner.
|
|
77
99
|
*
|
|
78
|
-
* @throws {
|
|
100
|
+
* @throws {FailedReleaseLockError} {@link FailedReleaseLockError}
|
|
79
101
|
*/
|
|
80
|
-
releaseOrFail():
|
|
102
|
+
releaseOrFail(): Task<void>;
|
|
81
103
|
/**
|
|
82
104
|
* The `forceRelease` method releases a lock regardless of the owner.
|
|
83
105
|
*
|
|
84
|
-
* @returns Returns true if the lock
|
|
85
|
-
*/
|
|
86
|
-
forceRelease(): LazyPromise<boolean>;
|
|
87
|
-
/**
|
|
88
|
-
* The `isExpired` method returns true if the lock is expired otherwise false is returned.
|
|
89
|
-
*/
|
|
90
|
-
isExpired(): LazyPromise<boolean>;
|
|
91
|
-
/**
|
|
92
|
-
* The `isLocked` method returns true if the lock is unexpirable or unexpired otherwise false is returned.
|
|
106
|
+
* @returns Returns true if the lock exists or false if the lock doesnt exists.
|
|
93
107
|
*/
|
|
94
|
-
|
|
108
|
+
forceRelease(): Task<boolean>;
|
|
95
109
|
/**
|
|
96
110
|
* The `refresh` method updates the `ttl` of the lock if expireable and owned by the same owner.
|
|
97
111
|
*
|
|
98
112
|
* @returns Returns true if the lock is refreshed otherwise false is returned.
|
|
99
113
|
*/
|
|
100
|
-
refresh(ttl?:
|
|
114
|
+
refresh(ttl?: ITimeSpan): Task<boolean>;
|
|
101
115
|
/**
|
|
102
116
|
* The `refreshOrFail` method updates the `ttl` of the lock if expireable and owned by the same owner.
|
|
103
|
-
* Throws an error if
|
|
117
|
+
* Throws an error if the lock is not owned by same owner.
|
|
104
118
|
* Throws an error if the key is unexpirable.
|
|
105
119
|
*
|
|
106
|
-
* @throws {
|
|
107
|
-
* @throws {UnrefreshableKeyLockError} {@link UnrefreshableKeyLockError}
|
|
120
|
+
* @throws {FailedRefreshLockError} {@link FailedRefreshLockError}
|
|
108
121
|
*/
|
|
109
|
-
refreshOrFail(ttl?:
|
|
110
|
-
/**
|
|
111
|
-
* The `getRemainingTime` return the reaming time as {@link TimeSpan | `TimeSpan`}.
|
|
112
|
-
*
|
|
113
|
-
* @returns Returns null if the key doesnt exist, key has no expiration and key has expired.
|
|
114
|
-
*/
|
|
115
|
-
getRemainingTime(): LazyPromise<TimeSpan | null>;
|
|
116
|
-
/**
|
|
117
|
-
* The `getOwner` method return the current owner.
|
|
118
|
-
*/
|
|
119
|
-
getOwner(): LazyPromise<string>;
|
|
122
|
+
refreshOrFail(ttl?: ITimeSpan): Task<void>;
|
|
120
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
|
|
127
|
+
* @group Contracts
|
|
128
|
+
*/
|
|
129
|
+
export type ILock = ILockBase & ILockStateMethods;
|