@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
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import type {
|
|
7
|
-
import { type ILock, type LockProviderCreateSettings, type ILockProvider
|
|
8
|
-
import {
|
|
4
|
+
import { type Invokable } from "../../../../utilities/_module-exports.js";
|
|
5
|
+
import { type OneOrMore } from "../../../../utilities/_module-exports.js";
|
|
6
|
+
import type { LockAdapterVariants, LockEventMap } from "../../../../lock/contracts/_module-exports.js";
|
|
7
|
+
import { type ILock, type LockProviderCreateSettings, type ILockProvider } from "../../../../lock/contracts/_module-exports.js";
|
|
8
|
+
import type { Task } from "../../../../task/_module-exports.js";
|
|
9
9
|
import type { EventListener, IEventBus, Unsubscribe } from "../../../../event-bus/contracts/_module-exports.js";
|
|
10
10
|
import type { ISerderRegister } from "../../../../serde/contracts/_module-exports.js";
|
|
11
|
+
import type { ITimeSpan } from "../../../../time-span/contracts/_module-exports.js";
|
|
12
|
+
import { Namespace } from "../../../../namespace/_module-exports.js";
|
|
11
13
|
/**
|
|
12
14
|
*
|
|
13
15
|
* IMPORT_PATH: `"@daiso-tech/core/lock"`
|
|
@@ -17,31 +19,21 @@ export type LockProviderSettingsBase = {
|
|
|
17
19
|
/**
|
|
18
20
|
* @default
|
|
19
21
|
* ```ts
|
|
20
|
-
* import { Namespace } from "@daiso-tech/core/
|
|
22
|
+
* import { Namespace } from "@daiso-tech/core/namespace";
|
|
21
23
|
*
|
|
22
|
-
* new Namespace(
|
|
24
|
+
* new Namespace("@lock")
|
|
23
25
|
* ```
|
|
24
26
|
*/
|
|
25
27
|
namespace?: Namespace;
|
|
26
|
-
/**
|
|
27
|
-
* You can pass a {@link Factory | `Factory`} of {@link LazyPromise| `LazyPromise`} to configure default settings for all {@link LazyPromise| `LazyPromise`} instances used in the `LockProvider` class.
|
|
28
|
-
* @default
|
|
29
|
-
* ```ts
|
|
30
|
-
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
31
|
-
*
|
|
32
|
-
* (invokable) => new LazyPromise(invokable)
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
lazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>;
|
|
36
28
|
serde: OneOrMore<ISerderRegister>;
|
|
37
29
|
/**
|
|
38
30
|
* @default ""
|
|
39
31
|
*/
|
|
40
32
|
serdeTransformerName?: string;
|
|
41
33
|
/**
|
|
42
|
-
* You can pass your
|
|
34
|
+
* You can pass your lock id id generator function.
|
|
43
35
|
*/
|
|
44
|
-
|
|
36
|
+
createLockId?: Invokable<[], string>;
|
|
45
37
|
/**
|
|
46
38
|
* @default
|
|
47
39
|
* ```ts
|
|
@@ -61,7 +53,7 @@ export type LockProviderSettingsBase = {
|
|
|
61
53
|
* TimeSpan.fromMinutes(5);
|
|
62
54
|
* ```
|
|
63
55
|
*/
|
|
64
|
-
defaultTtl?:
|
|
56
|
+
defaultTtl?: ITimeSpan | null;
|
|
65
57
|
/**
|
|
66
58
|
* The default refresh time used in the {@link ILock | `ILock`} `acquireBlocking` and `runBlocking` methods.
|
|
67
59
|
* @default
|
|
@@ -69,7 +61,7 @@ export type LockProviderSettingsBase = {
|
|
|
69
61
|
* TimeSpan.fromSeconds(1);
|
|
70
62
|
* ```
|
|
71
63
|
*/
|
|
72
|
-
defaultBlockingInterval?:
|
|
64
|
+
defaultBlockingInterval?: ITimeSpan;
|
|
73
65
|
/**
|
|
74
66
|
* The default refresh time used in the {@link ILock | `ILock`} `acquireBlocking` and `runBlocking` methods.
|
|
75
67
|
* @default
|
|
@@ -77,29 +69,29 @@ export type LockProviderSettingsBase = {
|
|
|
77
69
|
* TimeSpan.fromMinutes(1);
|
|
78
70
|
* ```
|
|
79
71
|
*/
|
|
80
|
-
defaultBlockingTime?:
|
|
72
|
+
defaultBlockingTime?: ITimeSpan;
|
|
81
73
|
/**
|
|
82
74
|
* The default refresh time used in the {@link ILock | `ILock`} `referesh` method.
|
|
83
75
|
* ```ts
|
|
84
76
|
* TimeSpan.fromMinutes(5);
|
|
85
77
|
* ```
|
|
86
78
|
*/
|
|
87
|
-
defaultRefreshTime?:
|
|
79
|
+
defaultRefreshTime?: ITimeSpan;
|
|
88
80
|
};
|
|
89
81
|
/**
|
|
90
82
|
*
|
|
91
83
|
* IMPORT_PATH: `"@daiso-tech/core/lock"`
|
|
92
84
|
* @group Derivables
|
|
93
85
|
*/
|
|
94
|
-
export type
|
|
86
|
+
export type LockProviderSettings = LockProviderSettingsBase & {
|
|
87
|
+
adapter: LockAdapterVariants;
|
|
88
|
+
};
|
|
95
89
|
/**
|
|
96
90
|
*
|
|
97
91
|
* IMPORT_PATH: `"@daiso-tech/core/lock"`
|
|
98
92
|
* @group Derivables
|
|
99
93
|
*/
|
|
100
|
-
export
|
|
101
|
-
adapter: LockAdapter;
|
|
102
|
-
};
|
|
94
|
+
export declare const DEFAULT_LOCK_PROVIDER_NAMESPACE: Namespace;
|
|
103
95
|
/**
|
|
104
96
|
* `LockProvider` class can be derived from any {@link ILockAdapter | `ILockAdapter`} or {@link IDatabaseLockAdapter | `IDatabaseLockAdapter`}.
|
|
105
97
|
*
|
|
@@ -111,17 +103,16 @@ export type LockProviderSettings = LockProviderSettingsBase & {
|
|
|
111
103
|
* @group Derivables
|
|
112
104
|
*/
|
|
113
105
|
export declare class LockProvider implements ILockProvider {
|
|
114
|
-
private lockStore;
|
|
115
106
|
private readonly eventBus;
|
|
107
|
+
private readonly originalAdapter;
|
|
116
108
|
private readonly adapter;
|
|
117
109
|
private readonly namespace;
|
|
118
|
-
private readonly
|
|
110
|
+
private readonly creatLockId;
|
|
119
111
|
private readonly defaultTtl;
|
|
120
112
|
private readonly defaultBlockingInterval;
|
|
121
113
|
private readonly defaultBlockingTime;
|
|
122
114
|
private readonly defaultRefreshTime;
|
|
123
115
|
private readonly serde;
|
|
124
|
-
private readonly lazyPromiseFactory;
|
|
125
116
|
private readonly serdeTransformerName;
|
|
126
117
|
/**
|
|
127
118
|
* @example
|
|
@@ -152,39 +143,38 @@ export declare class LockProvider implements ILockProvider {
|
|
|
152
143
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
153
144
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
154
145
|
*/
|
|
155
|
-
addListener<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>):
|
|
146
|
+
addListener<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>): Task<void>;
|
|
156
147
|
/**
|
|
157
148
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
158
149
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
159
150
|
*/
|
|
160
|
-
removeListener<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>):
|
|
151
|
+
removeListener<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>): Task<void>;
|
|
161
152
|
/**
|
|
162
153
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
163
154
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
164
155
|
*/
|
|
165
|
-
listenOnce<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>):
|
|
156
|
+
listenOnce<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>): Task<void>;
|
|
166
157
|
/**
|
|
167
158
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
168
159
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
169
160
|
*/
|
|
170
|
-
asPromise<TEventName extends keyof LockEventMap>(eventName: TEventName):
|
|
161
|
+
asPromise<TEventName extends keyof LockEventMap>(eventName: TEventName): Task<LockEventMap[TEventName]>;
|
|
171
162
|
/**
|
|
172
163
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
173
164
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
174
165
|
*/
|
|
175
|
-
subscribeOnce<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>):
|
|
166
|
+
subscribeOnce<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>): Task<Unsubscribe>;
|
|
176
167
|
/**
|
|
177
168
|
* You can listen to the following {@link LockEventMap | `LockEventMap`} of all {@link ILock | `ILock`} instances created by the {@link ILockProvider | `ILockProvider`}.
|
|
178
169
|
* To understand how this method works, refer to {@link IEventListenable | `IEventListenable `}.
|
|
179
170
|
*/
|
|
180
|
-
subscribe<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>):
|
|
181
|
-
private createLazyPromise;
|
|
171
|
+
subscribe<TEventName extends keyof LockEventMap>(eventName: TEventName, listener: EventListener<LockEventMap[TEventName]>): Task<Unsubscribe>;
|
|
182
172
|
/**
|
|
183
173
|
* @example
|
|
184
174
|
* ```ts
|
|
185
175
|
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
186
176
|
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
187
|
-
* import { Namespace } from "@daiso-tech/core/
|
|
177
|
+
* import { Namespace } from "@daiso-tech/core/namespace";
|
|
188
178
|
* import { Serde } from "@daiso-tech/core/serde";
|
|
189
179
|
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
190
180
|
*
|
|
@@ -197,5 +187,5 @@ export declare class LockProvider implements ILockProvider {
|
|
|
197
187
|
* const lock = lockProvider.create("a");
|
|
198
188
|
* ```
|
|
199
189
|
*/
|
|
200
|
-
create(key:
|
|
190
|
+
create(key: string, settings?: LockProviderCreateSettings): ILock;
|
|
201
191
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { CORE, resolveOneOrMore, callInvokable, } from "../../../../utilities/_module-exports.js";
|
|
5
|
+
import {} from "../../../../utilities/_module-exports.js";
|
|
6
6
|
import {} from "../../../../lock/contracts/_module-exports.js";
|
|
7
|
-
import { LazyPromise } from "../../../../async/_module-exports.js";
|
|
8
7
|
import { EventBus } from "../../../../event-bus/implementations/derivables/_module-exports.js";
|
|
9
8
|
import { MemoryEventBusAdapter } from "../../../../event-bus/implementations/adapters/_module-exports.js";
|
|
10
9
|
import { v4 } from "uuid";
|
|
11
10
|
import { Lock } from "../../../../lock/implementations/derivables/lock-provider/lock.js";
|
|
12
|
-
import { LockState, } from "../../../../lock/implementations/derivables/lock-provider/lock-state.js";
|
|
13
|
-
import { isDatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/is-database-lock-adapter.js";
|
|
14
|
-
import { DatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/database-lock-adapter.js";
|
|
15
11
|
import { LockSerdeTransformer } from "../../../../lock/implementations/derivables/lock-provider/lock-serde-transformer.js";
|
|
12
|
+
import { resolveDatabaseLockAdapter } from "../../../../lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.js";
|
|
13
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
14
|
+
import { Namespace } from "../../../../namespace/_module-exports.js";
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* IMPORT_PATH: `"@daiso-tech/core/lock"`
|
|
18
|
+
* @group Derivables
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_LOCK_PROVIDER_NAMESPACE = new Namespace("@lock");
|
|
16
21
|
/**
|
|
17
22
|
* `LockProvider` class can be derived from any {@link ILockAdapter | `ILockAdapter`} or {@link IDatabaseLockAdapter | `IDatabaseLockAdapter`}.
|
|
18
23
|
*
|
|
@@ -24,17 +29,16 @@ import { LockSerdeTransformer } from "../../../../lock/implementations/derivable
|
|
|
24
29
|
* @group Derivables
|
|
25
30
|
*/
|
|
26
31
|
export class LockProvider {
|
|
27
|
-
lockStore = {};
|
|
28
32
|
eventBus;
|
|
33
|
+
originalAdapter;
|
|
29
34
|
adapter;
|
|
30
35
|
namespace;
|
|
31
|
-
|
|
36
|
+
creatLockId;
|
|
32
37
|
defaultTtl;
|
|
33
38
|
defaultBlockingInterval;
|
|
34
39
|
defaultBlockingTime;
|
|
35
40
|
defaultRefreshTime;
|
|
36
41
|
serde;
|
|
37
|
-
lazyPromiseFactory;
|
|
38
42
|
serdeTransformerName;
|
|
39
43
|
/**
|
|
40
44
|
* @example
|
|
@@ -60,37 +64,32 @@ export class LockProvider {
|
|
|
60
64
|
* ```
|
|
61
65
|
*/
|
|
62
66
|
constructor(settings) {
|
|
63
|
-
const { defaultTtl = TimeSpan.fromMinutes(5), defaultBlockingInterval = TimeSpan.fromSeconds(1), defaultBlockingTime = TimeSpan.fromMinutes(1), defaultRefreshTime = TimeSpan.fromMinutes(5),
|
|
67
|
+
const { defaultTtl = TimeSpan.fromMinutes(5), defaultBlockingInterval = TimeSpan.fromSeconds(1), defaultBlockingTime = TimeSpan.fromMinutes(1), defaultRefreshTime = TimeSpan.fromMinutes(5), createLockId = () => v4(), serde, namespace = DEFAULT_LOCK_PROVIDER_NAMESPACE, adapter, eventBus = new EventBus({
|
|
64
68
|
adapter: new MemoryEventBusAdapter(),
|
|
65
|
-
}), serdeTransformerName = "",
|
|
69
|
+
}), serdeTransformerName = "", } = settings;
|
|
66
70
|
this.serde = serde;
|
|
67
|
-
this.defaultBlockingInterval = defaultBlockingInterval;
|
|
68
|
-
this.defaultBlockingTime = defaultBlockingTime;
|
|
69
|
-
this.defaultRefreshTime = defaultRefreshTime;
|
|
70
|
-
this.
|
|
71
|
+
this.defaultBlockingInterval = TimeSpan.fromTimeSpan(defaultBlockingInterval);
|
|
72
|
+
this.defaultBlockingTime = TimeSpan.fromTimeSpan(defaultBlockingTime);
|
|
73
|
+
this.defaultRefreshTime = TimeSpan.fromTimeSpan(defaultRefreshTime);
|
|
74
|
+
this.creatLockId = createLockId;
|
|
71
75
|
this.namespace = namespace;
|
|
72
|
-
this.defaultTtl =
|
|
76
|
+
this.defaultTtl =
|
|
77
|
+
defaultTtl === null ? null : TimeSpan.fromTimeSpan(defaultTtl);
|
|
73
78
|
this.eventBus = eventBus;
|
|
74
|
-
this.lazyPromiseFactory = resolveInvokable(lazyPromiseFactory);
|
|
75
79
|
this.serdeTransformerName = serdeTransformerName;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this.adapter = adapter;
|
|
81
|
-
}
|
|
80
|
+
this.originalAdapter = adapter;
|
|
81
|
+
this.adapter = resolveDatabaseLockAdapter(adapter);
|
|
82
82
|
this.registerToSerde();
|
|
83
83
|
}
|
|
84
84
|
registerToSerde() {
|
|
85
85
|
const transformer = new LockSerdeTransformer({
|
|
86
|
+
originalAdapter: this.originalAdapter,
|
|
86
87
|
adapter: this.adapter,
|
|
87
|
-
createLazyPromise: (asyncFn) => this.createLazyPromise(asyncFn),
|
|
88
88
|
defaultBlockingInterval: this.defaultBlockingInterval,
|
|
89
89
|
defaultBlockingTime: this.defaultBlockingTime,
|
|
90
90
|
defaultRefreshTime: this.defaultRefreshTime,
|
|
91
91
|
eventBus: this.eventBus,
|
|
92
92
|
namespace: this.namespace,
|
|
93
|
-
lockStore: this.lockStore,
|
|
94
93
|
serdeTransformerName: this.serdeTransformerName,
|
|
95
94
|
});
|
|
96
95
|
for (const serde of resolveOneOrMore(this.serde)) {
|
|
@@ -139,15 +138,12 @@ export class LockProvider {
|
|
|
139
138
|
subscribe(eventName, listener) {
|
|
140
139
|
return this.eventBus.subscribe(eventName, listener);
|
|
141
140
|
}
|
|
142
|
-
createLazyPromise(asyncFn) {
|
|
143
|
-
return this.lazyPromiseFactory(asyncFn);
|
|
144
|
-
}
|
|
145
141
|
/**
|
|
146
142
|
* @example
|
|
147
143
|
* ```ts
|
|
148
144
|
* import { LockProvider } from "@daiso-tech/core/lock";
|
|
149
145
|
* import { MemoryLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
150
|
-
* import { Namespace } from "@daiso-tech/core/
|
|
146
|
+
* import { Namespace } from "@daiso-tech/core/namespace";
|
|
151
147
|
* import { Serde } from "@daiso-tech/core/serde";
|
|
152
148
|
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
153
149
|
*
|
|
@@ -161,16 +157,16 @@ export class LockProvider {
|
|
|
161
157
|
* ```
|
|
162
158
|
*/
|
|
163
159
|
create(key, settings = {}) {
|
|
164
|
-
const { ttl = this.defaultTtl,
|
|
165
|
-
const keyObj = this.namespace.
|
|
160
|
+
const { ttl = this.defaultTtl, lockId = callInvokable(this.creatLockId), } = settings;
|
|
161
|
+
const keyObj = this.namespace.create(key);
|
|
166
162
|
return new Lock({
|
|
163
|
+
namespace: this.namespace,
|
|
167
164
|
adapter: this.adapter,
|
|
168
|
-
|
|
169
|
-
lockState: new LockState(this.lockStore, keyObj.namespaced),
|
|
165
|
+
originalAdapter: this.originalAdapter,
|
|
170
166
|
eventDispatcher: this.eventBus,
|
|
171
167
|
key: keyObj,
|
|
172
|
-
|
|
173
|
-
ttl,
|
|
168
|
+
lockId,
|
|
169
|
+
ttl: ttl === null ? null : TimeSpan.fromTimeSpan(ttl),
|
|
174
170
|
serdeTransformerName: this.serdeTransformerName,
|
|
175
171
|
defaultBlockingInterval: this.defaultBlockingInterval,
|
|
176
172
|
defaultBlockingTime: this.defaultBlockingTime,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-provider.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider/lock-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"lock-provider.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider/lock-provider.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,19 +4,17 @@
|
|
|
4
4
|
import type { ISerdeTransformer } from "../../../../serde/contracts/_module-exports.js";
|
|
5
5
|
import { Lock, type ISerializedLock } from "../../../../lock/implementations/derivables/lock-provider/lock.js";
|
|
6
6
|
import type { OneOrMore } from "../../../../utilities/_module-exports.js";
|
|
7
|
-
import type { ILockAdapter, LockEventMap } from "../../../../lock/contracts/_module-exports.js";
|
|
8
|
-
import { type ILockStore } from "../../../../lock/implementations/derivables/lock-provider/lock-state.js";
|
|
9
|
-
import { TimeSpan, type Namespace } from "../../../../utilities/_module-exports.js";
|
|
10
|
-
import type { LazyPromise } from "../../../../async/_module-exports.js";
|
|
7
|
+
import type { ILockAdapter, LockAdapterVariants, LockEventMap } from "../../../../lock/contracts/_module-exports.js";
|
|
11
8
|
import type { IEventBus } from "../../../../event-bus/contracts/_module-exports.js";
|
|
9
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
10
|
+
import type { Namespace } from "../../../../namespace/_module-exports.js";
|
|
12
11
|
/**
|
|
13
12
|
* @internal
|
|
14
13
|
*/
|
|
15
14
|
export type LockSerdeTransformerSettings = {
|
|
16
15
|
adapter: ILockAdapter;
|
|
17
|
-
|
|
16
|
+
originalAdapter: LockAdapterVariants;
|
|
18
17
|
namespace: Namespace;
|
|
19
|
-
createLazyPromise: <TValue = void>(asyncFn: () => Promise<TValue>) => LazyPromise<TValue>;
|
|
20
18
|
defaultBlockingInterval: TimeSpan;
|
|
21
19
|
defaultBlockingTime: TimeSpan;
|
|
22
20
|
defaultRefreshTime: TimeSpan;
|
|
@@ -28,9 +26,8 @@ export type LockSerdeTransformerSettings = {
|
|
|
28
26
|
*/
|
|
29
27
|
export declare class LockSerdeTransformer implements ISerdeTransformer<Lock, ISerializedLock> {
|
|
30
28
|
private readonly adapter;
|
|
31
|
-
private readonly
|
|
29
|
+
private readonly originalAdapter;
|
|
32
30
|
private readonly namespace;
|
|
33
|
-
private readonly createLazyPromise;
|
|
34
31
|
private readonly defaultBlockingInterval;
|
|
35
32
|
private readonly defaultBlockingTime;
|
|
36
33
|
private readonly defaultRefreshTime;
|
|
@@ -2,62 +2,66 @@
|
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
4
|
import { Lock, } from "../../../../lock/implementations/derivables/lock-provider/lock.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { getConstructorName } from "../../../../utilities/_module-exports.js";
|
|
6
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export class LockSerdeTransformer {
|
|
11
11
|
adapter;
|
|
12
|
-
|
|
12
|
+
originalAdapter;
|
|
13
13
|
namespace;
|
|
14
|
-
createLazyPromise;
|
|
15
14
|
defaultBlockingInterval;
|
|
16
15
|
defaultBlockingTime;
|
|
17
16
|
defaultRefreshTime;
|
|
18
17
|
eventBus;
|
|
19
18
|
serdeTransformerName;
|
|
20
19
|
constructor(settings) {
|
|
21
|
-
const { adapter,
|
|
20
|
+
const { adapter, originalAdapter, namespace, defaultBlockingInterval, defaultBlockingTime, defaultRefreshTime, eventBus, serdeTransformerName, } = settings;
|
|
22
21
|
this.serdeTransformerName = serdeTransformerName;
|
|
23
22
|
this.adapter = adapter;
|
|
24
|
-
this.
|
|
23
|
+
this.originalAdapter = originalAdapter;
|
|
25
24
|
this.namespace = namespace;
|
|
26
|
-
this.createLazyPromise = createLazyPromise;
|
|
27
25
|
this.defaultBlockingInterval = defaultBlockingInterval;
|
|
28
26
|
this.defaultBlockingTime = defaultBlockingTime;
|
|
29
27
|
this.defaultRefreshTime = defaultRefreshTime;
|
|
30
28
|
this.eventBus = eventBus;
|
|
31
29
|
}
|
|
32
30
|
get name() {
|
|
33
|
-
if (this.serdeTransformerName) {
|
|
34
|
-
return ["lock", getConstructorName(this.adapter)];
|
|
35
|
-
}
|
|
36
31
|
return [
|
|
37
32
|
"lock",
|
|
38
33
|
this.serdeTransformerName,
|
|
39
|
-
getConstructorName(this.
|
|
40
|
-
|
|
34
|
+
getConstructorName(this.originalAdapter),
|
|
35
|
+
this.namespace.toString(),
|
|
36
|
+
].filter((str) => str !== "");
|
|
41
37
|
}
|
|
42
38
|
isApplicable(value) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
const isLock = value instanceof Lock && getConstructorName(value) === Lock.name;
|
|
40
|
+
if (!isLock) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const isSerdTransformerNameMathcing = this.serdeTransformerName ===
|
|
44
|
+
value._internal_getSerdeTransformerName();
|
|
45
|
+
const isNamespaceMatching = this.namespace.toString() ===
|
|
46
|
+
value._internal_getNamespace().toString();
|
|
47
|
+
const isAdapterMatching = getConstructorName(this.originalAdapter) ===
|
|
48
|
+
getConstructorName(value._internal_getAdapter());
|
|
49
|
+
return (isSerdTransformerNameMathcing &&
|
|
50
|
+
isNamespaceMatching &&
|
|
51
|
+
isAdapterMatching);
|
|
47
52
|
}
|
|
48
53
|
deserialize(serializedValue) {
|
|
49
|
-
const { key,
|
|
50
|
-
const keyObj = this.namespace.
|
|
54
|
+
const { key, ttlInMs, lockId } = serializedValue;
|
|
55
|
+
const keyObj = this.namespace.create(key);
|
|
51
56
|
return new Lock({
|
|
52
|
-
|
|
57
|
+
namespace: this.namespace,
|
|
53
58
|
adapter: this.adapter,
|
|
54
|
-
|
|
59
|
+
originalAdapter: this.originalAdapter,
|
|
55
60
|
eventDispatcher: this.eventBus,
|
|
56
61
|
key: keyObj,
|
|
57
|
-
|
|
62
|
+
lockId,
|
|
58
63
|
serdeTransformerName: this.serdeTransformerName,
|
|
59
|
-
ttl: ttlInMs
|
|
60
|
-
expirationInMs,
|
|
64
|
+
ttl: ttlInMs === null ? null : TimeSpan.fromMilliseconds(ttlInMs),
|
|
61
65
|
defaultBlockingInterval: this.defaultBlockingInterval,
|
|
62
66
|
defaultBlockingTime: this.defaultBlockingTime,
|
|
63
67
|
defaultRefreshTime: this.defaultRefreshTime,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-serde-transformer.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider/lock-serde-transformer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACH,IAAI,GAEP,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"lock-serde-transformer.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider/lock-serde-transformer.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { type AsyncLazy, type Result } from "../../../../utilities/_module-exports.js";
|
|
5
|
+
import type { ILockState, IDatabaseLockAdapter } from "../../../../lock/contracts/_module-exports.js";
|
|
6
|
+
import { FailedAcquireLockError, type LockAquireBlockingSettings, type LockEventMap } from "../../../../lock/contracts/_module-exports.js";
|
|
7
7
|
import { type ILock, type ILockAdapter } from "../../../../lock/contracts/_module-exports.js";
|
|
8
|
-
import {
|
|
8
|
+
import { Task } from "../../../../task/_module-exports.js";
|
|
9
9
|
import type { IEventDispatcher } from "../../../../event-bus/contracts/_module-exports.js";
|
|
10
|
-
import
|
|
10
|
+
import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
|
|
11
|
+
import type { Key, Namespace } from "../../../../namespace/_module-exports.js";
|
|
12
|
+
import type { ITimeSpan } from "../../../../time-span/contracts/_module-exports.js";
|
|
11
13
|
/**
|
|
12
14
|
* @internal
|
|
13
15
|
*/
|
|
14
16
|
export type ISerializedLock = {
|
|
17
|
+
version: "1";
|
|
15
18
|
key: string;
|
|
16
|
-
|
|
17
|
-
owner: string;
|
|
19
|
+
lockId: string;
|
|
18
20
|
ttlInMs: number | null;
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
23
|
* @internal
|
|
22
24
|
*/
|
|
23
25
|
export type LockSettings = {
|
|
24
|
-
createLazyPromise: <TValue = void>(asyncFn: () => Promise<TValue>) => LazyPromise<TValue>;
|
|
25
26
|
serdeTransformerName: string;
|
|
27
|
+
namespace: Namespace;
|
|
26
28
|
adapter: ILockAdapter;
|
|
27
|
-
|
|
29
|
+
originalAdapter: IDatabaseLockAdapter | ILockAdapter;
|
|
28
30
|
eventDispatcher: IEventDispatcher<LockEventMap>;
|
|
29
31
|
key: Key;
|
|
30
|
-
|
|
32
|
+
lockId: string;
|
|
31
33
|
ttl: TimeSpan | null;
|
|
32
|
-
expirationInMs?: number | null;
|
|
33
34
|
defaultBlockingInterval: TimeSpan;
|
|
34
35
|
defaultBlockingTime: TimeSpan;
|
|
35
36
|
defaultRefreshTime: TimeSpan;
|
|
@@ -42,35 +43,38 @@ export declare class Lock implements ILock {
|
|
|
42
43
|
* @internal
|
|
43
44
|
*/
|
|
44
45
|
static _internal_serialize(deserializedValue: Lock): ISerializedLock;
|
|
45
|
-
private readonly
|
|
46
|
+
private readonly namespace;
|
|
46
47
|
private readonly adapter;
|
|
47
|
-
private readonly
|
|
48
|
+
private readonly originalAdapter;
|
|
48
49
|
private readonly eventDispatcher;
|
|
49
|
-
private readonly
|
|
50
|
-
private readonly
|
|
51
|
-
private
|
|
50
|
+
private readonly _key;
|
|
51
|
+
private readonly lockId;
|
|
52
|
+
private _ttl;
|
|
52
53
|
private readonly defaultBlockingInterval;
|
|
53
54
|
private readonly defaultBlockingTime;
|
|
54
55
|
private readonly defaultRefreshTime;
|
|
55
56
|
private readonly serdeTransformerName;
|
|
56
57
|
constructor(settings: LockSettings);
|
|
58
|
+
_internal_getNamespace(): Namespace;
|
|
57
59
|
_internal_getSerdeTransformerName(): string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
refresh(ttl?:
|
|
73
|
-
refreshOrFail(ttl?:
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
_internal_getAdapter(): IDatabaseLockAdapter | ILockAdapter;
|
|
61
|
+
run<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<Result<TValue, FailedAcquireLockError>>;
|
|
62
|
+
runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<TValue>;
|
|
63
|
+
runBlocking<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<Result<TValue, FailedAcquireLockError>>;
|
|
64
|
+
runBlockingOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<TValue>;
|
|
65
|
+
private handleUnexpectedError;
|
|
66
|
+
private handleDispatch;
|
|
67
|
+
acquire(): Task<boolean>;
|
|
68
|
+
acquireOrFail(): Task<void>;
|
|
69
|
+
acquireBlocking(settings?: LockAquireBlockingSettings): Task<boolean>;
|
|
70
|
+
acquireBlockingOrFail(settings?: LockAquireBlockingSettings): Task<void>;
|
|
71
|
+
release(): Task<boolean>;
|
|
72
|
+
releaseOrFail(): Task<void>;
|
|
73
|
+
forceRelease(): Task<boolean>;
|
|
74
|
+
refresh(ttl?: ITimeSpan): Task<boolean>;
|
|
75
|
+
refreshOrFail(ttl?: ITimeSpan): Task<void>;
|
|
76
|
+
get key(): string;
|
|
77
|
+
get id(): string;
|
|
78
|
+
get ttl(): TimeSpan | null;
|
|
79
|
+
getState(): Task<ILockState>;
|
|
76
80
|
}
|