@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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Resilience
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
function abortSignalToPromise(abortSignal) {
|
|
8
|
+
let reject_ = null;
|
|
9
|
+
function abort() {
|
|
10
|
+
if (reject_ === null) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
reject_(abortSignal.reason);
|
|
14
|
+
}
|
|
15
|
+
if (abortSignal.aborted) {
|
|
16
|
+
return {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
18
|
+
promise: Promise.reject(abortSignal.reason),
|
|
19
|
+
abort,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
promise: new Promise((_resolve, reject) => {
|
|
24
|
+
reject_ = reject;
|
|
25
|
+
if (abortSignal.aborted) {
|
|
26
|
+
abort();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
abortSignal.addEventListener("abort", abort, {
|
|
30
|
+
once: true,
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
abort,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export async function abortAndFail(promise, abortSignal) {
|
|
40
|
+
if (abortSignal.aborted) {
|
|
41
|
+
throw abortSignal.reason;
|
|
42
|
+
}
|
|
43
|
+
const { promise: abortSignalPromise, abort } = abortSignalToPromise(abortSignal);
|
|
44
|
+
try {
|
|
45
|
+
return await Promise.race([promise, abortSignalPromise]);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
abortSignal.removeEventListener("abort", abort);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=abort-and-fail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abort-and-fail.js","sourceRoot":"","sources":["../../../../src/resilience/utilities/abort-and-fail/abort-and-fail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,SAAS,oBAAoB,CACzB,WAAwB;IAKxB,IAAI,OAAO,GAAsC,IAAI,CAAC;IACtD,SAAS,KAAK;QACV,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACnB,OAAO;QACX,CAAC;QACD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO;YACH,2EAA2E;YAC3E,OAAO,EAAE,OAAO,CAAC,MAAM,CAAS,WAAW,CAAC,MAAM,CAAC;YACnD,KAAK;SACR,CAAC;IACN,CAAC;IAED,OAAO;QACH,OAAO,EAAE,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACtC,OAAO,GAAG,MAAM,CAAC;YACjB,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;gBACtB,KAAK,EAAE,CAAC;gBACR,OAAO;YACX,CAAC;YACD,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE;gBACzC,IAAI,EAAE,IAAI;aACb,CAAC,CAAC;QACP,CAAC,CAAC;QACF,KAAK;KACR,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAC9B,OAA4B,EAC5B,WAAwB;IAExB,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,WAAW,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,GACxC,oBAAoB,CAAS,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC;QACD,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAC7D,CAAC;YAAS,CAAC;QACP,WAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../resilience/utilities/timeout-and-fail/timeout-and-fail.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/resilience/utilities/timeout-and-fail/_module.ts"],"names":[],"mappings":"AAAA,cAAc,6DAA6D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ITimeSpan } from "../../../time-span/contracts/_module-exports.js";
|
|
2
|
+
/**
|
|
3
|
+
* @throws {TimeoutResilienceError} {@link TimeoutResilienceError}
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function timeoutAndFail<TValue>(promise: PromiseLike<TValue>, time: ITimeSpan, abort: (rejection: unknown) => void, signal: AbortSignal): Promise<TValue>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Resilience
|
|
3
|
+
*/
|
|
4
|
+
import { TimeoutResilienceError } from "../../../resilience/resilience.errors.js";
|
|
5
|
+
import { abortAndFail } from "../../../resilience/utilities/abort-and-fail/_module.js";
|
|
6
|
+
import { TO_MILLISECONDS, } from "../../../time-span/contracts/_module-exports.js";
|
|
7
|
+
/**
|
|
8
|
+
* @throws {TimeoutResilienceError} {@link TimeoutResilienceError}
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export async function timeoutAndFail(promise, time, abort, signal) {
|
|
13
|
+
const timeoutId = setTimeout(() => {
|
|
14
|
+
abort(new TimeoutResilienceError("The promise exceded time"));
|
|
15
|
+
}, time[TO_MILLISECONDS]());
|
|
16
|
+
try {
|
|
17
|
+
return await abortAndFail(promise, signal);
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
clearTimeout(timeoutId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=timeout-and-fail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-and-fail.js","sourceRoot":"","sources":["../../../../src/resilience/utilities/timeout-and-fail/timeout-and-fail.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAChF,OAAO,EACH,eAAe,GAElB,MAAM,0CAA0C,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAChC,OAA4B,EAC5B,IAAe,EACf,KAAmC,EACnC,MAAmB;IAEnB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;QAC9B,KAAK,CAAC,IAAI,sBAAsB,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAClE,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,CAAC;QACD,OAAO,MAAM,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "../../semaphore/contracts/database-semaphore-adapter.contract.js";
|
|
2
|
+
export * from "../../semaphore/contracts/semaphore-adapter.contract.js";
|
|
3
|
+
export * from "../../semaphore/contracts/semaphore-provider-factory.contract.js";
|
|
4
|
+
export * from "../../semaphore/contracts/semaphore-provider.contract.js";
|
|
5
|
+
export * from "../../semaphore/contracts/semaphore-state.contract.js";
|
|
6
|
+
export * from "../../semaphore/contracts/semaphore.contract.js";
|
|
7
|
+
export * from "../../semaphore/contracts/semaphore.errors.js";
|
|
8
|
+
export * from "../../semaphore/contracts/semaphore.events.js";
|
|
9
|
+
export * from "../../semaphore/contracts/types.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "../../semaphore/contracts/database-semaphore-adapter.contract.js";
|
|
2
|
+
export * from "../../semaphore/contracts/semaphore-adapter.contract.js";
|
|
3
|
+
export * from "../../semaphore/contracts/semaphore-provider-factory.contract.js";
|
|
4
|
+
export * from "../../semaphore/contracts/semaphore-provider.contract.js";
|
|
5
|
+
export * from "../../semaphore/contracts/semaphore-state.contract.js";
|
|
6
|
+
export * from "../../semaphore/contracts/semaphore.contract.js";
|
|
7
|
+
export * from "../../semaphore/contracts/semaphore.errors.js";
|
|
8
|
+
export * from "../../semaphore/contracts/semaphore.events.js";
|
|
9
|
+
export * from "../../semaphore/contracts/types.js";
|
|
10
|
+
//# sourceMappingURL=_module-exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qDAAqD,CAAC;AACpE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,sDAAsD,CAAC;AACrE,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { InvokableFn } from "../../utilities/_module-exports.js";
|
|
5
|
+
/**
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
7
|
+
* @group Contracts
|
|
8
|
+
*/
|
|
9
|
+
export type ISemaphoreSlotExpirationData = {
|
|
10
|
+
/**
|
|
11
|
+
* The expiration date and time of the lock.
|
|
12
|
+
* `null` indicates the lock does not expire.
|
|
13
|
+
*/
|
|
14
|
+
expiration: Date | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
18
|
+
* @group Contracts
|
|
19
|
+
*/
|
|
20
|
+
export type ISemaphoreSlotData = ISemaphoreSlotExpirationData & {
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
25
|
+
* @group Contracts
|
|
26
|
+
*/
|
|
27
|
+
export type ISemaphoreData = {
|
|
28
|
+
limit: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
32
|
+
* @group Contracts
|
|
33
|
+
*/
|
|
34
|
+
export type IDatabaseSemaphoreTransaction = {
|
|
35
|
+
/**
|
|
36
|
+
* The `findSemaphore` returns the semaphore if it exists otherwise `null` is returned.
|
|
37
|
+
*/
|
|
38
|
+
findSemaphore(key: string): Promise<ISemaphoreData | null>;
|
|
39
|
+
/**
|
|
40
|
+
* The `findSlots` returns the semaphore slot if it exists otherwise `null` is returned.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
findSlots(key: string): Promise<ISemaphoreSlotData[]>;
|
|
44
|
+
/**
|
|
45
|
+
* The `upsertSemaphore` inserts a semaphore if it doesnt exist otherwise it will be updated.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
upsertSemaphore(key: string, limit: number): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* The `upsertSlot` inserts a semaphore slot if it doesnt exist otherwise it will be updated.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
upsertSlot(key: string, slotId: string, expiration: Date | null): Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The `IDatabaseSemaphoreAdapter` contract defines a way for managing semaphores independent of data storage.
|
|
57
|
+
* This contract simplifies the implementation of semaphore adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.
|
|
58
|
+
*
|
|
59
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
60
|
+
* @group Contracts
|
|
61
|
+
*/
|
|
62
|
+
export type IDatabaseSemaphoreAdapter = {
|
|
63
|
+
/**
|
|
64
|
+
* The `transaction` method runs the `fn` function inside a transaction.
|
|
65
|
+
* The `fn` function is given a {@link IDatabaseSemaphoreTransaction | `IDatabaseSemaphoreTransaction`} object.
|
|
66
|
+
*
|
|
67
|
+
* Note when implementing this method use the strictest transaction level mode.
|
|
68
|
+
*/
|
|
69
|
+
transaction<TValue>(fn: InvokableFn<[
|
|
70
|
+
transaction: IDatabaseSemaphoreTransaction
|
|
71
|
+
], Promise<TValue>>): Promise<TValue>;
|
|
72
|
+
/**
|
|
73
|
+
* The `removeSlot` removes the specified slot.
|
|
74
|
+
*
|
|
75
|
+
* @returns Returns the slot expiration.
|
|
76
|
+
*/
|
|
77
|
+
removeSlot(key: string, slotId: string): Promise<ISemaphoreSlotExpirationData | null>;
|
|
78
|
+
/**
|
|
79
|
+
* The `removeAllSlots` removes all slots of the given semaphore.
|
|
80
|
+
*
|
|
81
|
+
* @returns Returns the slot expiration.
|
|
82
|
+
*/
|
|
83
|
+
removeAllSlots(key: string): Promise<ISemaphoreSlotExpirationData[]>;
|
|
84
|
+
/**
|
|
85
|
+
* The `updateExpiration` updates the specified slot expiration as long as it is expireable and unexpired of the given semaphore.
|
|
86
|
+
*
|
|
87
|
+
* @returns Returns a number greater than `0` if the slot expiration was updated, otherwise returns `0`.
|
|
88
|
+
*/
|
|
89
|
+
updateExpiration(key: string, slotId: string, expiration: Date): Promise<number>;
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database-semaphore-adapter.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/database-semaphore-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
8
|
+
* @group Contracts
|
|
9
|
+
*/
|
|
10
|
+
export type SemaphoreAcquireSettings = {
|
|
11
|
+
key: string;
|
|
12
|
+
slotId: string;
|
|
13
|
+
limit: number;
|
|
14
|
+
ttl: TimeSpan | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
19
|
+
* @group Contracts
|
|
20
|
+
*/
|
|
21
|
+
export type ISemaphoreAdapterState = {
|
|
22
|
+
limit: number;
|
|
23
|
+
acquiredSlots: Map<string, Date | null>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The `ISemaphoreAdapter` contract defines a way for managing semaphores independent of the underlying technology.
|
|
27
|
+
* This contract is not meant to be used directly, instead you should use {@link ISemaphoreProvider | `ISemaphoreProvider`} contract.
|
|
28
|
+
*
|
|
29
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
30
|
+
* @group Contracts
|
|
31
|
+
*/
|
|
32
|
+
export type ISemaphoreAdapter = {
|
|
33
|
+
/**
|
|
34
|
+
* The `acquire` method acquires a slot only if the slot limit is not reached.
|
|
35
|
+
*
|
|
36
|
+
* @returns Returns true if the slot limit is not reached otherwise false is returned.
|
|
37
|
+
*/
|
|
38
|
+
acquire(settings: SemaphoreAcquireSettings): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* The `release` method releases given slot related to the key.
|
|
41
|
+
*
|
|
42
|
+
* @returns Returns true if the semaphore exists and has at least one unavailable slot or false if all slots are available.
|
|
43
|
+
*/
|
|
44
|
+
release(key: string, slotId: string): Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* The `forceReleaseAll` method releases all slots related to the key.
|
|
47
|
+
*/
|
|
48
|
+
forceReleaseAll(key: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* The `refresh` method expiration of slot if not already expired.
|
|
51
|
+
*
|
|
52
|
+
* @returns Returns true if the slot is refreshed* otherwise false is returned.
|
|
53
|
+
*/
|
|
54
|
+
refresh(key: string, slotId: string, ttl: TimeSpan): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* The `getState` method returns the state of the semaphore.
|
|
57
|
+
*
|
|
58
|
+
* @returns Returns {@link ISemaphoreAdapterState | `ISemaphoreAdapterState`} if the semaphore exists in the database or null if doesnt exists.
|
|
59
|
+
*/
|
|
60
|
+
getState(key: string): Promise<ISemaphoreAdapterState | null>;
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semaphore-adapter.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/semaphore-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { ISemaphoreProvider } from "../../semaphore/contracts/semaphore-provider.contract.js";
|
|
5
|
+
/**
|
|
6
|
+
* The `ISemaphoreProviderFactory` contract makes it easy to configure and switch between different {@link ISemaphoreProvider | `ISemaphoreProvider`} dynamically.
|
|
7
|
+
*
|
|
8
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
9
|
+
* @group Contracts
|
|
10
|
+
*/
|
|
11
|
+
export type ISemaphoreProviderFactory<TAdapters extends string = string> = {
|
|
12
|
+
/**
|
|
13
|
+
* The `use` method will throw an error if you provide it unregisted adapter.
|
|
14
|
+
* If no default adapter is defined an error will be thrown by `use` method.
|
|
15
|
+
* @throws {UnregisteredAdapterError} {@link UnregisteredAdapterError}
|
|
16
|
+
* @throws {DefaultAdapterNotDefinedError} {@link DefaultAdapterNotDefinedError}
|
|
17
|
+
*/
|
|
18
|
+
use(adapterName?: TAdapters): ISemaphoreProvider;
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
UnregisteredAdapterError,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
DefaultAdapterNotDefinedError, } from "../../utilities/_module-exports.js";
|
|
9
|
+
//# sourceMappingURL=semaphore-provider-factory.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semaphore-provider-factory.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/semaphore-provider-factory.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO;AACH,6DAA6D;AAC7D,wBAAwB;AACxB,6DAA6D;AAC7D,6BAA6B,GAChC,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { ISemaphore } from "../../semaphore/contracts/semaphore.contract.js";
|
|
5
|
+
import type { IEventListenable } from "../../event-bus/contracts/_module-exports.js";
|
|
6
|
+
import type { SemaphoreEventMap } from "../../semaphore/contracts/semaphore.events.js";
|
|
7
|
+
import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
|
|
8
|
+
/**
|
|
9
|
+
* The `ISemaphoreListenable` contract defines a way for listening {@link ISemaphore | `ISemaphore`} operations.
|
|
10
|
+
*
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
12
|
+
* @group Contracts
|
|
13
|
+
*/
|
|
14
|
+
export type ISemaphoreListenable = IEventListenable<SemaphoreEventMap>;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
18
|
+
* @group Contracts
|
|
19
|
+
*/
|
|
20
|
+
export type SemaphoreProviderCreateSettings = {
|
|
21
|
+
limit: number;
|
|
22
|
+
/**
|
|
23
|
+
* You can also provide a `settings.ttl` value using. If not specified it defaults to null, meaning no TTL is applied.
|
|
24
|
+
*/
|
|
25
|
+
ttl?: ITimeSpan | null;
|
|
26
|
+
slotId?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
31
|
+
* @group Contracts
|
|
32
|
+
*/
|
|
33
|
+
export type ISemaphoreProviderBase = {
|
|
34
|
+
/**
|
|
35
|
+
* The `create` method is used to create an instance of {@link ISemaphore | `ISemaphore`}.
|
|
36
|
+
*
|
|
37
|
+
* @param key - can be a string or an `Iterable` of strings.
|
|
38
|
+
* If it's an `Iterable`, it will be joined into a single string.
|
|
39
|
+
* Think of an `Iterable` as representing a path.
|
|
40
|
+
*/
|
|
41
|
+
create(key: string, settings: SemaphoreProviderCreateSettings): ISemaphore;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The `ISemaphoreProvider` contract defines a way for managing semaphores independent of the underlying technology.
|
|
45
|
+
* It commes with more convient methods compared to `ISemaphoreAdapter`.
|
|
46
|
+
*
|
|
47
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
48
|
+
* @group Contracts
|
|
49
|
+
*/
|
|
50
|
+
export type ISemaphoreProvider = ISemaphoreListenable & ISemaphoreProviderBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semaphore-provider.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/semaphore-provider.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
8
|
+
* @group Contracts
|
|
9
|
+
*/
|
|
10
|
+
export declare const SEMAPHORE_STATE: {
|
|
11
|
+
readonly EXPIRED: "EXPIRED";
|
|
12
|
+
readonly LIMIT_REACHED: "LIMIT_REACHED";
|
|
13
|
+
readonly ACQUIRED: "ACQUIRED";
|
|
14
|
+
readonly UNACQUIRED: "UNACQUIRED";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
19
|
+
* @group Contracts
|
|
20
|
+
*/
|
|
21
|
+
export type SemaphoreState = (typeof SEMAPHORE_STATE)[keyof typeof SEMAPHORE_STATE];
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
25
|
+
* @group Contracts
|
|
26
|
+
*/
|
|
27
|
+
export type ISemaphoreExpiredState = {
|
|
28
|
+
type: (typeof SEMAPHORE_STATE)["EXPIRED"];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
33
|
+
* @group Contracts
|
|
34
|
+
*/
|
|
35
|
+
export type ISemaphoreUnacquiredState = {
|
|
36
|
+
type: (typeof SEMAPHORE_STATE)["UNACQUIRED"];
|
|
37
|
+
limit: number;
|
|
38
|
+
freeSlotsCount: number;
|
|
39
|
+
acquiredSlotsCount: number;
|
|
40
|
+
acquiredSlots: string[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
45
|
+
* @group Contracts
|
|
46
|
+
*/
|
|
47
|
+
export type ISemaphoreAcquiredState = {
|
|
48
|
+
type: (typeof SEMAPHORE_STATE)["ACQUIRED"];
|
|
49
|
+
limit: number;
|
|
50
|
+
remainingTime: TimeSpan | null;
|
|
51
|
+
freeSlotsCount: number;
|
|
52
|
+
acquiredSlotsCount: number;
|
|
53
|
+
acquiredSlots: string[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
58
|
+
* @group Contracts
|
|
59
|
+
*/
|
|
60
|
+
export type ISemaphoreLimitReachedState = {
|
|
61
|
+
type: (typeof SEMAPHORE_STATE)["LIMIT_REACHED"];
|
|
62
|
+
limit: number;
|
|
63
|
+
acquiredSlots: string[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
68
|
+
* @group Contracts
|
|
69
|
+
*/
|
|
70
|
+
export type ISemaphoreState = ISemaphoreExpiredState | ISemaphoreAcquiredState | ISemaphoreUnacquiredState | ISemaphoreLimitReachedState;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
7
|
+
* @group Contracts
|
|
8
|
+
*/
|
|
9
|
+
export const SEMAPHORE_STATE = {
|
|
10
|
+
EXPIRED: "EXPIRED",
|
|
11
|
+
LIMIT_REACHED: "LIMIT_REACHED",
|
|
12
|
+
ACQUIRED: "ACQUIRED",
|
|
13
|
+
UNACQUIRED: "UNACQUIRED",
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=semaphore-state.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semaphore-state.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/semaphore-state.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CAClB,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Semaphore
|
|
3
|
+
*/
|
|
4
|
+
import type { Task } from "../../task/_module-exports.js";
|
|
5
|
+
import type { AsyncLazy, Result } from "../../utilities/_module-exports.js";
|
|
6
|
+
import type { LimitReachedSemaphoreError } from "../../semaphore/contracts/semaphore.errors.js";
|
|
7
|
+
import type { ISemaphoreState } from "../../semaphore/contracts/semaphore-state.contract.js";
|
|
8
|
+
import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
12
|
+
* @group Contracts
|
|
13
|
+
*/
|
|
14
|
+
export type ISemaphoreStateMethods = {
|
|
15
|
+
getState(): Task<ISemaphoreState>;
|
|
16
|
+
/**
|
|
17
|
+
* The `key` of the `ISemaphore` instance.
|
|
18
|
+
*/
|
|
19
|
+
readonly key: string;
|
|
20
|
+
/**
|
|
21
|
+
* The `id` of the `ISemaphore` instance.
|
|
22
|
+
*/
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/**
|
|
25
|
+
* The `ttl` of `ISemaphore` instance.
|
|
26
|
+
*/
|
|
27
|
+
readonly ttl: ITimeSpan | null;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
32
|
+
* @group Contracts
|
|
33
|
+
*/
|
|
34
|
+
export type SemaphoreAquireBlockingSettings = {
|
|
35
|
+
time?: ITimeSpan;
|
|
36
|
+
interval?: ITimeSpan;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
41
|
+
* @group Contracts
|
|
42
|
+
*/
|
|
43
|
+
export type ISemaphoreBase = {
|
|
44
|
+
/**
|
|
45
|
+
* The `run` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquire` and `release` method.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
run<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<Result<TValue, LimitReachedSemaphoreError>>;
|
|
49
|
+
/**
|
|
50
|
+
* The `runOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireOrFail` and `release` method.
|
|
51
|
+
* @throws {LimitReachedSemaphoreError} {@link LimitReachedSemaphoreError}
|
|
52
|
+
*/
|
|
53
|
+
runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<TValue>;
|
|
54
|
+
/**
|
|
55
|
+
* The `runBlocking` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlocking` and `release` method.
|
|
56
|
+
*/
|
|
57
|
+
runBlocking<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: SemaphoreAquireBlockingSettings): Task<Result<TValue, LimitReachedSemaphoreError>>;
|
|
58
|
+
/**
|
|
59
|
+
* The `runBlockingOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlockingOrFail` and `release` method.
|
|
60
|
+
* @throws {LimitReachedSemaphoreError} {@link LimitReachedSemaphoreError}
|
|
61
|
+
*/
|
|
62
|
+
runBlockingOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: SemaphoreAquireBlockingSettings): Task<TValue>;
|
|
63
|
+
/**
|
|
64
|
+
* The `acquire` method acquires an slots only if the slot limit is not reached.
|
|
65
|
+
*
|
|
66
|
+
* @returns Returns true if the slot limit is not reached otherwise false is returned.
|
|
67
|
+
*/
|
|
68
|
+
acquire(): Task<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* The `acquireOrFail` method acquires an slots only if the slot limit is not reached.
|
|
71
|
+
* Throws an error if the slot limit is reached.
|
|
72
|
+
*
|
|
73
|
+
* @throws {LimitReachedSemaphoreError} {@link LimitReachedSemaphoreError}
|
|
74
|
+
*/
|
|
75
|
+
acquireOrFail(): Task<void>;
|
|
76
|
+
/**
|
|
77
|
+
* The `acquireBlocking` method acquires an slots only if the slot limit is not reached.
|
|
78
|
+
* If the slot limit is reached, it retries every `settings.interval` until `settings.time` is reached.
|
|
79
|
+
*
|
|
80
|
+
* @returns Returns true if the slot limit is not reached otherwise false is returned.
|
|
81
|
+
*/
|
|
82
|
+
acquireBlocking(settings?: SemaphoreAquireBlockingSettings): Task<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* The `acquireBlockingOrFail` method acquires an slots only if the slot limit is not reached.
|
|
85
|
+
* If the slot limit is reached, it retries every `settings.interval` until `settings.time` is reached.
|
|
86
|
+
* Throws an error if the slot limit is reached after the given `settings.time`.
|
|
87
|
+
*
|
|
88
|
+
* @throws {LimitReachedSemaphoreError} {@link LimitReachedSemaphoreError}
|
|
89
|
+
*/
|
|
90
|
+
acquireBlockingOrFail(settings?: SemaphoreAquireBlockingSettings): Task<void>;
|
|
91
|
+
/**
|
|
92
|
+
* The `release` method releases the current slot.
|
|
93
|
+
*
|
|
94
|
+
* @returns Returns true if the semaphore exists and has at least one busy slot or false.
|
|
95
|
+
*/
|
|
96
|
+
release(): Task<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* The `releaseOrFail` method releases the current slot.
|
|
99
|
+
* Throws an error if the slot is not acquired.
|
|
100
|
+
* @throws {FailedReleaseSemaphoreError} {@link FailedReleaseSemaphoreError}
|
|
101
|
+
*/
|
|
102
|
+
releaseOrFail(): Task<void>;
|
|
103
|
+
/**
|
|
104
|
+
* The `forceReleaseAll` method releases the all slots.
|
|
105
|
+
*
|
|
106
|
+
* @returns Returns true if the semaphore exists and has at least one unavailable slot or false if all slots are available.
|
|
107
|
+
*/
|
|
108
|
+
forceReleaseAll(): Task<boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* The `refresh` method updates the `ttl` of the slot when acquired.
|
|
111
|
+
*
|
|
112
|
+
* @returns Returns true if the slot is refreshed otherwise false is returned.
|
|
113
|
+
*/
|
|
114
|
+
refresh(ttl?: ITimeSpan): Task<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* The `refreshOrFail` method updates the `ttl` of the slot when acquired.
|
|
117
|
+
* Throws an error if the slot is not acquired.
|
|
118
|
+
* @throws {FailedRefreshSemaphoreError} {@link FailedRefreshSemaphoreError}
|
|
119
|
+
*/
|
|
120
|
+
refreshOrFail(ttl?: ITimeSpan): Task<void>;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* IMPORT_PATH: `"@daiso-tech/core/semaphore/contracts"`
|
|
125
|
+
* @group Contracts
|
|
126
|
+
*/
|
|
127
|
+
export type ISemaphore = ISemaphoreStateMethods & ISemaphoreBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semaphore.contract.js","sourceRoot":"","sources":["../../../src/semaphore/contracts/semaphore.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|