@daiso-tech/core 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backoff-policies/_module-exports.d.ts +5 -0
- package/dist/backoff-policies/_module-exports.js +6 -0
- package/dist/backoff-policies/_module-exports.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/_shared.d.ts +6 -7
- package/dist/{async/backof-policies → backoff-policies}/_shared.js +1 -1
- package/dist/backoff-policies/_shared.js.map +1 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.d.ts +6 -8
- package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.js +8 -10
- package/dist/backoff-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/exponential-backoff-policy/exponential-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js +30 -0
- package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/linear-backoff-policy/linear-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js +30 -0
- package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.d.ts +1 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.js +2 -0
- package/dist/backoff-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/{async/backof-policies → backoff-policies}/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +7 -9
- package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +30 -0
- package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/cache/contracts/cache-adapter.contract.d.ts +12 -12
- 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/contracts/database-cache-adapter.contract.d.ts +10 -10
- 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 +10 -10
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +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-adapter.contract.d.ts +3 -3
- package/dist/event-bus/contracts/event-bus.contract.d.ts +10 -10
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +3 -3
- 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 +18 -24
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +51 -51
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +11 -4
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +17 -12
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.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 +36 -37
- 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 +86 -674
- 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 +59 -14
- package/dist/lock/contracts/lock-adapter.contract.d.ts +22 -10
- 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 +72 -58
- package/dist/lock/contracts/lock.errors.d.ts +18 -15
- package/dist/lock/contracts/lock.errors.js +22 -17
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.d.ts +21 -37
- package/dist/lock/contracts/lock.events.js +2 -2
- 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 +33 -13
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +182 -56
- 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 +25 -9
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +80 -36
- 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 +11 -12
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +164 -79
- 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 +7 -6
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +7 -4
- 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 +27 -9
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +87 -32
- 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 +7 -6
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +56 -24
- 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 +7 -7
- 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 -33
- package/dist/lock/implementations/derivables/lock-provider/lock.js +178 -234
- 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 +312 -191
- 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 +378 -95
- 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 +3110 -1611
- 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/contracts/deinitizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/initizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +1 -1
- 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,5 +1,5 @@
|
|
|
1
|
-
import { DefaultAdapterNotDefinedError,
|
|
2
|
-
import { LockProvider, } from "../../../../lock/implementations/derivables/lock-provider/_module.js";
|
|
1
|
+
import { DefaultAdapterNotDefinedError, UnregisteredAdapterError, } from "../../../../utilities/_module-exports.js";
|
|
2
|
+
import { DEFAULT_LOCK_PROVIDER_NAMESPACE, LockProvider, } from "../../../../lock/implementations/derivables/lock-provider/_module.js";
|
|
3
3
|
/**
|
|
4
4
|
* The `LockProviderFactory` class is immutable.
|
|
5
5
|
*
|
|
@@ -38,10 +38,10 @@ export class LockProviderFactory {
|
|
|
38
38
|
namespace,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
setCreateLockId(createId) {
|
|
42
42
|
return new LockProviderFactory({
|
|
43
43
|
...this.settings,
|
|
44
|
-
|
|
44
|
+
createLockId: createId,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
setEventBus(eventBus) {
|
|
@@ -74,12 +74,6 @@ export class LockProviderFactory {
|
|
|
74
74
|
defaultRefreshTime: time,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
setLazyPromiseFactory(factory) {
|
|
78
|
-
return new LockProviderFactory({
|
|
79
|
-
...this.settings,
|
|
80
|
-
lazyPromiseFactory: factory,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
77
|
/**
|
|
84
78
|
* @example
|
|
85
79
|
* ```ts
|
|
@@ -88,7 +82,7 @@ export class LockProviderFactory {
|
|
|
88
82
|
* import { MemoryLockAdapter, RedisLockAdapter, SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
89
83
|
* import { Serde } from "@daiso-tech/core/serde";
|
|
90
84
|
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
91
|
-
* import { TimeSpan } from "@daiso-tech/core/
|
|
85
|
+
* import { TimeSpan } from "@daiso-tech/core/time-span" from "@daiso-tech/core/time-span";
|
|
92
86
|
* import Redis from "ioredis";
|
|
93
87
|
*
|
|
94
88
|
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
@@ -122,14 +116,11 @@ export class LockProviderFactory {
|
|
|
122
116
|
if (adapter === undefined) {
|
|
123
117
|
throw new UnregisteredAdapterError(adapterName);
|
|
124
118
|
}
|
|
125
|
-
const { namespace =
|
|
119
|
+
const { namespace = DEFAULT_LOCK_PROVIDER_NAMESPACE } = this.settings;
|
|
126
120
|
return new LockProvider({
|
|
127
121
|
...this.settings,
|
|
128
122
|
adapter,
|
|
129
|
-
namespace:
|
|
130
|
-
...resolveOneOrMore(namespace._getInternal().original),
|
|
131
|
-
adapterName,
|
|
132
|
-
]),
|
|
123
|
+
namespace: namespace.appendRoot(adapterName),
|
|
133
124
|
serdeTransformerName: adapterName,
|
|
134
125
|
});
|
|
135
126
|
}
|
package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-provider-factory.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lock-provider-factory.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.ts"],"names":[],"mappings":"AASA,OAAO,EACH,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACH,+BAA+B,EAC/B,YAAY,GAEf,MAAM,4DAA4D,CAAC;AAyBpE;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAyBP;IAtBrB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YACqB,QAAgD;QAAhD,aAAQ,GAAR,QAAQ,CAAwC;IAClE,CAAC;IAEJ,YAAY,CAAC,SAAoB;QAC7B,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAED,eAAe,CACX,QAA+B;QAE/B,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,YAAY,EAAE,QAAQ;SACzB,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAC,QAAmB;QAC3B,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,QAAQ;SACX,CAAC,CAAC;IACP,CAAC;IAED,aAAa,CAAC,GAAc;QACxB,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,UAAU,EAAE,GAAG;SAClB,CAAC,CAAC;IACP,CAAC;IAED,0BAA0B,CACtB,QAAmB;QAEnB,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,uBAAuB,EAAE,QAAQ;SACpC,CAAC,CAAC;IACP,CAAC;IAED,sBAAsB,CAAC,IAAe;QAClC,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,mBAAmB,EAAE,IAAI;SAC5B,CAAC,CAAC;IACP,CAAC;IAED,qBAAqB,CAAC,IAAe;QACjC,OAAO,IAAI,mBAAmB,CAAC;YAC3B,GAAG,IAAI,CAAC,QAAQ;YAChB,kBAAkB,EAAE,IAAI;SAC3B,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,GAAG,CACC,cAAqC,IAAI,CAAC,QAAQ,CAAC,cAAc;QAEjE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,IAAI,6BAA6B,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,wBAAwB,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,EAAE,SAAS,GAAG,+BAA+B,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QACtE,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,OAAO;YACP,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC;YAC5C,oBAAoB,EAAE,WAAW;SACpC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {} from "vitest";
|
|
5
5
|
import {} from "../../../lock/contracts/_module-exports.js";
|
|
6
6
|
import {} from "../../../utilities/_module-exports.js";
|
|
7
|
-
import { TimeSpan } from "../../../
|
|
7
|
+
import { TimeSpan } from "../../../time-span/implementations/_module-exports.js";
|
|
8
8
|
/**
|
|
9
9
|
* The `databaseLockAdapterTestSuite` function simplifies the process of testing your custom implementation of {@link IDatabaseLockAdapter | `IDatabaseLockAdapter`} with `vitest`.
|
|
10
10
|
*
|
|
@@ -47,205 +47,326 @@ import { TimeSpan } from "../../../utilities/_module-exports.js";
|
|
|
47
47
|
*/
|
|
48
48
|
export function databaseLockAdapterTestSuite(settings) {
|
|
49
49
|
const { expect, test, createAdapter, describe, beforeEach } = settings;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const ttl = TimeSpan.fromMilliseconds(50);
|
|
55
|
-
describe("method: insert", () => {
|
|
56
|
-
test("Should insert lock when not existing", async () => {
|
|
57
|
-
const key = "a";
|
|
58
|
-
const owner = "b";
|
|
59
|
-
const expiration = null;
|
|
60
|
-
await adapter.insert(key, owner, expiration);
|
|
61
|
-
const result = await adapter.find(key);
|
|
62
|
-
expect(result).toEqual({
|
|
63
|
-
owner,
|
|
64
|
-
expiration,
|
|
65
|
-
});
|
|
50
|
+
describe("Reusable tests:", () => {
|
|
51
|
+
let adapter;
|
|
52
|
+
beforeEach(async () => {
|
|
53
|
+
adapter = await createAdapter();
|
|
66
54
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
55
|
+
describe("method: transaction find", () => {
|
|
56
|
+
test("Should return null when key doesnt exists", async () => {
|
|
57
|
+
const key = "a";
|
|
58
|
+
const owner = "1";
|
|
59
|
+
const expiration = null;
|
|
60
|
+
await adapter.transaction(async (trx) => {
|
|
61
|
+
await trx.upsert(key, owner, expiration);
|
|
62
|
+
});
|
|
63
|
+
const noneExistingKey = "b";
|
|
64
|
+
const result = await adapter.transaction(async (trx) => {
|
|
65
|
+
return await trx.find(noneExistingKey);
|
|
66
|
+
});
|
|
67
|
+
expect(result).toBeNull();
|
|
76
68
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const expiration = null;
|
|
92
|
-
await adapter.insert(key, owner1, expiration);
|
|
93
|
-
const owner2 = "c";
|
|
94
|
-
const result = await adapter.update(key, owner2, expiration);
|
|
95
|
-
expect(result).toBe(0);
|
|
96
|
-
});
|
|
97
|
-
test("Should not update when lock has no expiration", async () => {
|
|
98
|
-
const key = "a";
|
|
99
|
-
const owner1 = "b";
|
|
100
|
-
const expiration = null;
|
|
101
|
-
await adapter.insert(key, owner1, expiration);
|
|
102
|
-
const owner2 = "c";
|
|
103
|
-
await adapter.update(key, owner2, expiration);
|
|
104
|
-
const result = await adapter.find(key);
|
|
105
|
-
expect(result).toEqual({
|
|
106
|
-
owner: owner1,
|
|
107
|
-
expiration,
|
|
69
|
+
test("Should return ILockData when key exists", async () => {
|
|
70
|
+
const key = "a";
|
|
71
|
+
const owner = "1";
|
|
72
|
+
const expiration = TimeSpan.fromMinutes(2).toEndDate();
|
|
73
|
+
await adapter.transaction(async (trx) => {
|
|
74
|
+
await trx.upsert(key, owner, expiration);
|
|
75
|
+
});
|
|
76
|
+
const result = await adapter.transaction(async (trx) => {
|
|
77
|
+
return await trx.find(key);
|
|
78
|
+
});
|
|
79
|
+
expect(result).toEqual({
|
|
80
|
+
owner,
|
|
81
|
+
expiration,
|
|
82
|
+
});
|
|
108
83
|
});
|
|
109
84
|
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
vi.useFakeTimers();
|
|
142
|
-
const key = "a";
|
|
143
|
-
const owner1 = "b";
|
|
144
|
-
const expiration1 = ttl.toEndDate();
|
|
145
|
-
await adapter.insert(key, owner1, expiration1);
|
|
146
|
-
vi.advanceTimersByTime(ttl.addMilliseconds(1).toMilliseconds());
|
|
147
|
-
const owner2 = "c";
|
|
148
|
-
const expiration2 = ttl.addMilliseconds(25).toEndDate();
|
|
149
|
-
const result = await adapter.update(key, owner2, expiration2);
|
|
150
|
-
expect(result).toBe(1);
|
|
151
|
-
vi.useRealTimers();
|
|
152
|
-
});
|
|
153
|
-
test("Should update when lock has expired", async () => {
|
|
154
|
-
vi.useFakeTimers();
|
|
155
|
-
const key = "a";
|
|
156
|
-
const owner1 = "b";
|
|
157
|
-
const expiration1 = ttl.toEndDate();
|
|
158
|
-
await adapter.insert(key, owner1, expiration1);
|
|
159
|
-
vi.advanceTimersByTime(ttl.addMilliseconds(1).toMilliseconds());
|
|
160
|
-
const owner2 = "c";
|
|
161
|
-
const expiration2 = ttl.addMilliseconds(25).toEndDate();
|
|
162
|
-
await adapter.update(key, owner2, expiration2);
|
|
163
|
-
const result = await adapter.find(key);
|
|
164
|
-
expect(result).toEqual({
|
|
165
|
-
owner: owner2,
|
|
166
|
-
expiration: expiration2,
|
|
167
|
-
});
|
|
168
|
-
vi.useRealTimers();
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
describe("method: remove", () => {
|
|
172
|
-
test("Should not remove lock when not same owner", async () => {
|
|
173
|
-
const key = "a";
|
|
174
|
-
const owner1 = "b";
|
|
175
|
-
const expiration = null;
|
|
176
|
-
await adapter.insert(key, owner1, expiration);
|
|
177
|
-
const owner2 = "c";
|
|
178
|
-
await adapter.remove(key, owner2);
|
|
179
|
-
const result = await adapter.find(key);
|
|
180
|
-
expect(result).toEqual({
|
|
181
|
-
owner: owner1,
|
|
182
|
-
expiration,
|
|
85
|
+
describe("method: transaction upsert", () => {
|
|
86
|
+
test("Should insert when key doesnt exists exists", async () => {
|
|
87
|
+
const key = "a";
|
|
88
|
+
const owner = "b";
|
|
89
|
+
const expiration = null;
|
|
90
|
+
await adapter.transaction(async (trx) => {
|
|
91
|
+
await trx.upsert(key, owner, expiration);
|
|
92
|
+
});
|
|
93
|
+
const lockData = await adapter.find(key);
|
|
94
|
+
expect(lockData).toEqual({
|
|
95
|
+
expiration,
|
|
96
|
+
owner,
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
test("Should update when key exists exists", async () => {
|
|
100
|
+
const key = "a";
|
|
101
|
+
const owner1 = "1";
|
|
102
|
+
const expiration1 = null;
|
|
103
|
+
await adapter.transaction(async (trx) => {
|
|
104
|
+
await trx.upsert(key, owner1, expiration1);
|
|
105
|
+
});
|
|
106
|
+
const owner2 = "2";
|
|
107
|
+
const expiration2 = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
108
|
+
await adapter.transaction(async (trx) => {
|
|
109
|
+
await trx.upsert(key, owner2, expiration2);
|
|
110
|
+
});
|
|
111
|
+
const lockData = await adapter.find(key);
|
|
112
|
+
expect(lockData).toEqual({
|
|
113
|
+
expiration: expiration2,
|
|
114
|
+
owner: owner2,
|
|
115
|
+
});
|
|
183
116
|
});
|
|
184
117
|
});
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
118
|
+
describe("method: remove", () => {
|
|
119
|
+
test("Should return null when key doesnt exists", async () => {
|
|
120
|
+
const key = "a";
|
|
121
|
+
const owner = "b";
|
|
122
|
+
const expiration = null;
|
|
123
|
+
await adapter.transaction(async (trx) => {
|
|
124
|
+
await trx.upsert(key, owner, expiration);
|
|
125
|
+
});
|
|
126
|
+
const noneExistingKey = "c";
|
|
127
|
+
const lockExpirationData = await adapter.remove(noneExistingKey);
|
|
128
|
+
expect(lockExpirationData).toBeNull();
|
|
129
|
+
});
|
|
130
|
+
test("Should return expiration as null when key exists", async () => {
|
|
131
|
+
const key = "a";
|
|
132
|
+
const owner = "b";
|
|
133
|
+
const expiration = null;
|
|
134
|
+
await adapter.transaction(async (trx) => {
|
|
135
|
+
await trx.upsert(key, owner, expiration);
|
|
136
|
+
});
|
|
137
|
+
const lockExpirationData = await adapter.remove(key);
|
|
138
|
+
expect(lockExpirationData).toEqual({
|
|
139
|
+
expiration,
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
test("Should return expiration as date when key exists", async () => {
|
|
143
|
+
const key = "a";
|
|
144
|
+
const owner = "b";
|
|
145
|
+
const expiration = TimeSpan.fromMinutes(5).toEndDate();
|
|
146
|
+
await adapter.transaction(async (trx) => {
|
|
147
|
+
await trx.upsert(key, owner, expiration);
|
|
148
|
+
});
|
|
149
|
+
const lockExpirationData = await adapter.remove(key);
|
|
150
|
+
expect(lockExpirationData).toEqual({
|
|
151
|
+
expiration,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
test("Should remove lock when key exists", async () => {
|
|
155
|
+
const key = "a";
|
|
156
|
+
const owner = "b";
|
|
157
|
+
const expiration = TimeSpan.fromMinutes(5).toEndDate();
|
|
158
|
+
await adapter.transaction(async (trx) => {
|
|
159
|
+
await trx.upsert(key, owner, expiration);
|
|
160
|
+
});
|
|
161
|
+
await adapter.remove(key);
|
|
162
|
+
const lockExpirationData = await adapter.find(key);
|
|
163
|
+
expect(lockExpirationData).toBeNull();
|
|
164
|
+
});
|
|
214
165
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
166
|
+
describe("method: removeIfOwner", () => {
|
|
167
|
+
test("Should return null when key doesnt exists", async () => {
|
|
168
|
+
const key = "a";
|
|
169
|
+
const owner = "b";
|
|
170
|
+
const expiration = null;
|
|
171
|
+
await adapter.transaction(async (trx) => {
|
|
172
|
+
await trx.upsert(key, owner, expiration);
|
|
173
|
+
});
|
|
174
|
+
const noneExistingKey = "c";
|
|
175
|
+
const lockData = await adapter.removeIfOwner(noneExistingKey, owner);
|
|
176
|
+
expect(lockData).toBeNull();
|
|
177
|
+
});
|
|
178
|
+
test("Should return null when owner doesnt exists", async () => {
|
|
179
|
+
const key = "a";
|
|
180
|
+
const owner = "b";
|
|
181
|
+
const expiration = null;
|
|
182
|
+
await adapter.transaction(async (trx) => {
|
|
183
|
+
await trx.upsert(key, owner, expiration);
|
|
184
|
+
});
|
|
185
|
+
const noneExistingOwner = "c";
|
|
186
|
+
const lockData = await adapter.removeIfOwner(key, noneExistingOwner);
|
|
187
|
+
expect(lockData).toBeNull();
|
|
188
|
+
});
|
|
189
|
+
test("Should return expiration as null when key and owner exists and is unexpireable", async () => {
|
|
190
|
+
const key = "a";
|
|
191
|
+
const owner = "b";
|
|
192
|
+
const expiration = null;
|
|
193
|
+
await adapter.transaction(async (trx) => {
|
|
194
|
+
await trx.upsert(key, owner, expiration);
|
|
195
|
+
});
|
|
196
|
+
const lockData = await adapter.removeIfOwner(key, owner);
|
|
197
|
+
expect(lockData).toEqual({
|
|
198
|
+
expiration,
|
|
199
|
+
owner,
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
test("Should return expiration as date when key and owner exists and is unexpireable", async () => {
|
|
203
|
+
const key = "a";
|
|
204
|
+
const owner = "b";
|
|
205
|
+
const expiration = TimeSpan.fromMinutes(10).toEndDate();
|
|
206
|
+
await adapter.transaction(async (trx) => {
|
|
207
|
+
await trx.upsert(key, owner, expiration);
|
|
208
|
+
});
|
|
209
|
+
const lockData = await adapter.removeIfOwner(key, owner);
|
|
210
|
+
expect(lockData).toEqual({
|
|
211
|
+
expiration,
|
|
212
|
+
owner,
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
test("Should remove lock when key and owner exists", async () => {
|
|
216
|
+
const key = "a";
|
|
217
|
+
const owner = "b";
|
|
218
|
+
const expiration = TimeSpan.fromMinutes(10).toEndDate();
|
|
219
|
+
await adapter.transaction(async (trx) => {
|
|
220
|
+
await trx.upsert(key, owner, expiration);
|
|
221
|
+
});
|
|
222
|
+
await adapter.removeIfOwner(key, owner);
|
|
223
|
+
const lockData = await adapter.find(key);
|
|
224
|
+
expect(lockData).toBeNull();
|
|
225
|
+
});
|
|
226
|
+
test("Should not remove lock when key exists and owner does not exists", async () => {
|
|
227
|
+
const key = "a";
|
|
228
|
+
const owner = "b";
|
|
229
|
+
const expiration = TimeSpan.fromMinutes(10).toEndDate();
|
|
230
|
+
await adapter.transaction(async (trx) => {
|
|
231
|
+
await trx.upsert(key, owner, expiration);
|
|
232
|
+
});
|
|
233
|
+
const noneExsitingOwner = "c";
|
|
234
|
+
await adapter.removeIfOwner(key, noneExsitingOwner);
|
|
235
|
+
const lockData = await adapter.find(key);
|
|
236
|
+
expect(lockData).toEqual({
|
|
237
|
+
expiration,
|
|
238
|
+
owner,
|
|
239
|
+
});
|
|
227
240
|
});
|
|
228
241
|
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
242
|
+
describe("method: updateExpiration", () => {
|
|
243
|
+
test("Should return 0 when semaphore key doesnt exists", async () => {
|
|
244
|
+
const key = "a";
|
|
245
|
+
const owner = "1";
|
|
246
|
+
const expiration = TimeSpan.fromMilliseconds(50).toEndDate();
|
|
247
|
+
await adapter.transaction(async (trx) => {
|
|
248
|
+
await trx.upsert(key, owner, expiration);
|
|
249
|
+
});
|
|
250
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
251
|
+
const noneExistingKey = "b";
|
|
252
|
+
const result1 = await adapter.updateExpiration(noneExistingKey, owner, newExpiration);
|
|
253
|
+
expect(result1).toBe(0);
|
|
254
|
+
});
|
|
255
|
+
test("Should return 0 when owner doesnt exists", async () => {
|
|
256
|
+
const key = "a";
|
|
257
|
+
const owner = "1";
|
|
258
|
+
const expiration = TimeSpan.fromMilliseconds(50).toEndDate();
|
|
259
|
+
await adapter.transaction(async (trx) => {
|
|
260
|
+
await trx.upsert(key, owner, expiration);
|
|
261
|
+
});
|
|
262
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
263
|
+
const noneExistingOwner = "b";
|
|
264
|
+
const result1 = await adapter.updateExpiration(key, noneExistingOwner, newExpiration);
|
|
265
|
+
expect(result1).toBe(0);
|
|
266
|
+
});
|
|
267
|
+
test("Should return 0 when lock is expired", async () => {
|
|
268
|
+
const key = "a";
|
|
269
|
+
const owner = "1";
|
|
270
|
+
const expiration = TimeSpan.fromMilliseconds(50).toStartDate();
|
|
271
|
+
await adapter.transaction(async (trx) => {
|
|
272
|
+
await trx.upsert(key, owner, expiration);
|
|
273
|
+
});
|
|
274
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
275
|
+
const result1 = await adapter.updateExpiration(key, owner, newExpiration);
|
|
276
|
+
expect(result1).toBe(0);
|
|
277
|
+
});
|
|
278
|
+
test("Should return 0 when lock is unexpireable", async () => {
|
|
279
|
+
const key = "a";
|
|
280
|
+
const owner = "1";
|
|
281
|
+
const expiration = null;
|
|
282
|
+
await adapter.transaction(async (trx) => {
|
|
283
|
+
await trx.upsert(key, owner, expiration);
|
|
284
|
+
});
|
|
285
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
286
|
+
const result1 = await adapter.updateExpiration(key, owner, newExpiration);
|
|
287
|
+
expect(result1).toBe(0);
|
|
288
|
+
});
|
|
289
|
+
test("Should return number greater than 0 when lock is unexpired", async () => {
|
|
290
|
+
const key = "a";
|
|
291
|
+
const owner = "1";
|
|
292
|
+
const expiration = TimeSpan.fromMilliseconds(50);
|
|
293
|
+
await adapter.transaction(async (trx) => {
|
|
294
|
+
await trx.upsert(key, owner, expiration.toEndDate());
|
|
295
|
+
});
|
|
296
|
+
const newExpiration = TimeSpan.fromMilliseconds(100);
|
|
297
|
+
const result1 = await adapter.updateExpiration(key, owner, newExpiration.toEndDate());
|
|
298
|
+
expect(result1).toBeGreaterThan(0);
|
|
299
|
+
});
|
|
300
|
+
test("Should not update expiration when lock is expired", async () => {
|
|
301
|
+
const key = "a";
|
|
302
|
+
const owner = "1";
|
|
303
|
+
const expiration = TimeSpan.fromMilliseconds(50).toStartDate();
|
|
304
|
+
await adapter.transaction(async (trx) => {
|
|
305
|
+
await trx.upsert(key, owner, expiration);
|
|
306
|
+
});
|
|
307
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
308
|
+
await adapter.updateExpiration(key, owner, newExpiration);
|
|
309
|
+
const lockData = await adapter.find(key);
|
|
310
|
+
expect(lockData).toEqual({
|
|
311
|
+
owner,
|
|
312
|
+
expiration,
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
test("Should not update expiration when lock is unexpireable", async () => {
|
|
316
|
+
const key = "a";
|
|
317
|
+
const owner = "1";
|
|
318
|
+
const expiration = null;
|
|
319
|
+
await adapter.transaction(async (trx) => {
|
|
320
|
+
await trx.upsert(key, owner, expiration);
|
|
321
|
+
});
|
|
322
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
323
|
+
await adapter.updateExpiration(key, owner, newExpiration);
|
|
324
|
+
const lockData = await adapter.find(key);
|
|
325
|
+
expect(lockData).toEqual({
|
|
326
|
+
owner,
|
|
327
|
+
expiration,
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
test("Should update expiration when lock is unexpired", async () => {
|
|
331
|
+
const key = "a";
|
|
332
|
+
const owner = "1";
|
|
333
|
+
const expiration = TimeSpan.fromMilliseconds(50).toEndDate();
|
|
334
|
+
await adapter.transaction(async (trx) => {
|
|
335
|
+
await trx.upsert(key, owner, expiration);
|
|
336
|
+
});
|
|
337
|
+
const newExpiration = TimeSpan.fromMilliseconds(100).toEndDate();
|
|
338
|
+
await adapter.updateExpiration(key, owner, newExpiration);
|
|
339
|
+
const lockData = await adapter.find(key);
|
|
340
|
+
expect(lockData).toEqual({
|
|
341
|
+
owner,
|
|
342
|
+
expiration: newExpiration,
|
|
343
|
+
});
|
|
344
|
+
});
|
|
237
345
|
});
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
346
|
+
describe("method: find", () => {
|
|
347
|
+
test("Should return null when key doesnt exists", async () => {
|
|
348
|
+
const key = "a";
|
|
349
|
+
const owner = "1";
|
|
350
|
+
const expiration = null;
|
|
351
|
+
await adapter.transaction(async (trx) => {
|
|
352
|
+
await trx.upsert(key, owner, expiration);
|
|
353
|
+
});
|
|
354
|
+
const noneExistingKey = "b";
|
|
355
|
+
const result = await adapter.find(noneExistingKey);
|
|
356
|
+
expect(result).toBeNull();
|
|
357
|
+
});
|
|
358
|
+
test("Should return ILockData when key exists", async () => {
|
|
359
|
+
const key = "a";
|
|
360
|
+
const owner = "1";
|
|
361
|
+
const expiration = TimeSpan.fromMinutes(2).toEndDate();
|
|
362
|
+
await adapter.transaction(async (trx) => {
|
|
363
|
+
await trx.upsert(key, owner, expiration);
|
|
364
|
+
});
|
|
365
|
+
const result = await adapter.find(key);
|
|
366
|
+
expect(result).toEqual({
|
|
367
|
+
owner,
|
|
368
|
+
expiration,
|
|
369
|
+
});
|
|
249
370
|
});
|
|
250
371
|
});
|
|
251
372
|
});
|