@daiso-tech/core 0.26.1 → 0.28.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/README.md +13 -3
- package/dist/async/utilities/delay/delay.d.ts +1 -12
- package/dist/async/utilities/delay/delay.js +1 -12
- package/dist/async/utilities/delay/delay.js.map +1 -1
- package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +143 -71
- package/dist/async/utilities/lazy-promise/lazy-promise.js +223 -142
- package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
- package/dist/async/utilities/retry/retry-or-fail.d.ts +2 -0
- package/dist/async/utilities/retry/retry-or-fail.js.map +1 -1
- package/dist/cache/contracts/_module-exports.d.ts +1 -0
- package/dist/cache/contracts/_module-exports.js +1 -0
- package/dist/cache/contracts/_module-exports.js.map +1 -1
- package/dist/cache/contracts/cache-adapter.contract.d.ts +19 -21
- package/dist/cache/contracts/cache-adapter.contract.js +1 -4
- package/dist/cache/contracts/cache-adapter.contract.js.map +1 -1
- package/dist/cache/contracts/cache-factory.contract.d.ts +1 -1
- package/dist/cache/contracts/cache.contract.d.ts +144 -96
- package/dist/cache/contracts/cache.contract.js +1 -2
- package/dist/cache/contracts/cache.contract.js.map +1 -1
- package/dist/cache/contracts/cache.errors.js +2 -5
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/contracts/cache.events.d.ts +10 -10
- package/dist/cache/contracts/cache.events.js +2 -5
- package/dist/cache/contracts/cache.events.js.map +1 -1
- package/dist/cache/contracts/database-cache-adapter.contract.d.ts +89 -0
- package/dist/cache/contracts/database-cache-adapter.contract.js +5 -0
- package/dist/cache/contracts/database-cache-adapter.contract.js.map +1 -0
- package/dist/cache/implementations/adapters/{kysely-sqlite-cache-adapter → kysely-cache-adapter}/_module.d.ts +1 -1
- package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js +2 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +1 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +73 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +224 -0
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +29 -39
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +45 -54
- package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +17 -33
- package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +43 -52
- 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-serde.d.ts +13 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js +38 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js.map +1 -0
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +27 -33
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +145 -197
- 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 +14 -13
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +19 -17
- 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-serde.d.ts +13 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js +39 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js.map +1 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +16 -22
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +51 -132
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.d.ts +13 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +69 -0
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -0
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +29 -41
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +46 -55
- package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/derivables/_module-exports.d.ts +1 -1
- package/dist/cache/implementations/derivables/_module-exports.js +1 -1
- package/dist/cache/implementations/derivables/_module-exports.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/_module.d.ts +1 -0
- package/dist/cache/implementations/derivables/cache/_module.js +1 -0
- package/dist/cache/implementations/derivables/cache/_module.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +269 -507
- package/dist/cache/implementations/derivables/cache/cache.js +538 -822
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +21 -0
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +110 -0
- package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.d.ts +9 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js +20 -0
- package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -0
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +69 -105
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +117 -87
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
- package/dist/cache/implementations/test-utilities/_module-exports.d.ts +1 -0
- package/dist/cache/implementations/test-utilities/_module-exports.js +1 -0
- package/dist/cache/implementations/test-utilities/_module-exports.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +9 -11
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +246 -247
- package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +16 -30
- package/dist/cache/implementations/test-utilities/cache.test-suite.js +271 -996
- package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +60 -0
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +698 -0
- package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -0
- package/dist/collection/contracts/async-collection.contract.d.ts +2 -3
- package/dist/collection/contracts/async-collection.contract.js +1 -12
- package/dist/collection/contracts/async-collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.contract.d.ts +1 -1
- package/dist/collection/contracts/collection.errors.d.ts +1 -1
- package/dist/collection/contracts/collection.errors.js +3 -6
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/_shared.d.ts +4 -4
- package/dist/collection/implementations/_shared.js +6 -9
- package/dist/collection/implementations/_shared.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +2 -2
- package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +5 -21
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +12 -8
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +1 -1
- package/dist/collection/implementations/list-collection/list-collection.d.ts +1 -1
- package/dist/collection/implementations/list-collection/list-collection.js +1 -1
- package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -9
- package/dist/event-bus/contracts/event-bus.contract.d.ts +5 -5
- package/dist/event-bus/contracts/event-bus.contract.js.map +1 -1
- package/dist/event-bus/contracts/event-bus.errors.js +2 -5
- package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +9 -29
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +14 -35
- package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -4
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -8
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +8 -15
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +15 -34
- 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 +85 -289
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +128 -325
- 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 +13 -0
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +42 -0
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -0
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +103 -86
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +135 -77
- 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.d.ts +2 -48
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +31 -122
- 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.d.ts +2 -50
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +41 -89
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -9
- package/dist/lock/contracts/lock-adapter.contract.d.ts +0 -9
- package/dist/lock/contracts/lock-provider.contract.d.ts +20 -6
- package/dist/lock/contracts/lock.contract.d.ts +37 -8
- package/dist/lock/contracts/lock.errors.js +2 -5
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.js +2 -5
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -0
- package/dist/lock/implementations/adapters/_module-exports.js +1 -0
- package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -5
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -21
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +11 -16
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +11 -20
- package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +7 -26
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +7 -35
- 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 +13 -20
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +13 -37
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.d.ts +1 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js +2 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js.map +1 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +17 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +24 -0
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -0
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +4 -22
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +4 -31
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +14 -20
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +12 -21
- package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +0 -2
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +2 -8
- 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.js +1 -5
- 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 +181 -369
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +259 -407
- 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 +15 -17
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +42 -40
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +194 -680
- package/dist/lock/implementations/derivables/lock-provider/lock.js +284 -744
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +106 -143
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +173 -101
- 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.d.ts +4 -5
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +172 -247
- 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 +5 -8
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +93 -98
- 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 -20
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +295 -145
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +1 -2
- package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +3 -2
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -1
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +1 -2
- package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +1 -2
- package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +1 -1
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +2 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +2 -2
- package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +14 -14
- package/dist/serde/implementations/derivables/serde.js +14 -15
- package/dist/serde/implementations/derivables/serde.js.map +1 -1
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +4 -4
- package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +3 -3
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +5 -5
- package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +4 -4
- package/dist/utilities/_module-exports.d.ts +2 -3
- package/dist/utilities/_module-exports.js +2 -3
- package/dist/utilities/_module-exports.js.map +1 -1
- package/dist/utilities/classes/_module.d.ts +4 -0
- package/dist/utilities/classes/_module.js +5 -0
- package/dist/utilities/classes/_module.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/_module.d.ts +2 -0
- package/dist/utilities/classes/key-prefixer/_module.js +3 -0
- package/dist/utilities/classes/key-prefixer/_module.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +28 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js +5 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js.map +1 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +73 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.js +135 -0
- package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +2 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +1 -0
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/utilities/classes/pipeline/_module.d.ts +1 -0
- package/dist/utilities/classes/pipeline/_module.js +2 -0
- package/dist/utilities/classes/pipeline/_module.js.map +1 -0
- package/dist/utilities/{pipeline → classes/pipeline}/pipeline.d.ts +3 -2
- package/dist/utilities/{pipeline → classes/pipeline}/pipeline.js +3 -2
- package/dist/utilities/classes/pipeline/pipeline.js.map +1 -0
- package/dist/utilities/classes/time-span/_module.d.ts +1 -0
- package/dist/utilities/classes/time-span/_module.js +2 -0
- package/dist/utilities/classes/time-span/_module.js.map +1 -0
- package/dist/utilities/{time-span → classes/time-span}/time-span.d.ts +2 -1
- package/dist/utilities/{time-span → classes/time-span}/time-span.js +1 -0
- package/dist/utilities/classes/time-span/time-span.js.map +1 -0
- package/dist/utilities/{_constants.d.ts → constants.d.ts} +0 -3
- package/dist/utilities/constants.js +5 -0
- package/dist/utilities/constants.js.map +1 -0
- package/dist/utilities/contracts/_module.d.ts +3 -1
- package/dist/utilities/contracts/_module.js +3 -1
- package/dist/utilities/contracts/_module.js.map +1 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +11 -0
- package/dist/utilities/contracts/prunable.contract.js +5 -0
- package/dist/utilities/contracts/prunable.contract.js.map +1 -0
- package/dist/utilities/contracts/sqlite-database.contract.d.ts +26 -0
- package/dist/utilities/contracts/sqlite-database.contract.js +5 -0
- package/dist/utilities/contracts/sqlite-database.contract.js.map +1 -0
- package/dist/utilities/functions.d.ts +34 -2
- package/dist/utilities/functions.js +72 -4
- package/dist/utilities/functions.js.map +1 -1
- package/dist/utilities/types.d.ts +49 -16
- package/package.json +14 -13
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +0 -61
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +0 -318
- package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +0 -1
- package/dist/utilities/_constants.js +0 -8
- package/dist/utilities/_constants.js.map +0 -1
- package/dist/utilities/kysely/_module.d.ts +0 -1
- package/dist/utilities/kysely/_module.js +0 -2
- package/dist/utilities/kysely/_module.js.map +0 -1
- package/dist/utilities/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/utilities/pipeline/_module.d.ts +0 -1
- package/dist/utilities/pipeline/_module.js +0 -2
- package/dist/utilities/pipeline/_module.js.map +0 -1
- package/dist/utilities/pipeline/pipeline.js.map +0 -1
- package/dist/utilities/time-span/_module.d.ts +0 -1
- package/dist/utilities/time-span/_module.js +0 -2
- package/dist/utilities/time-span/_module.js.map +0 -1
- package/dist/utilities/time-span/time-span.js.map +0 -1
- /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.d.ts +0 -0
- /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.js +0 -0
|
@@ -1,156 +1,228 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { LockProvider } from "../../../../lock/implementations/derivables/lock-provider/_module.js";
|
|
4
|
+
import { DefaultAdapterNotDefinedError, KeyPrefixer, resolveOneOrMore, UnregisteredAdapterError, } from "../../../../utilities/_module-exports.js";
|
|
5
|
+
import { LockProvider, } from "../../../../lock/implementations/derivables/lock-provider/_module.js";
|
|
7
6
|
/**
|
|
8
7
|
*
|
|
9
|
-
* IMPORT_PATH: ```"@daiso-tech/core/lock
|
|
8
|
+
* IMPORT_PATH: ```"@daiso-tech/core/lock"```
|
|
10
9
|
* @group Derivables
|
|
11
10
|
*/
|
|
12
11
|
export class LockProviderFactory {
|
|
13
|
-
|
|
14
|
-
shouldRegisterErrors;
|
|
15
|
-
shouldRegisterEvents;
|
|
16
|
-
defaultAdapter;
|
|
17
|
-
lockProviderRecord;
|
|
18
|
-
createOwnerId;
|
|
19
|
-
eventBus;
|
|
20
|
-
defaultTtl;
|
|
21
|
-
defaultBlockingInterval;
|
|
22
|
-
defaultBlockingTime;
|
|
23
|
-
defaultRefreshTime;
|
|
24
|
-
retryAttempts;
|
|
25
|
-
backoffPolicy;
|
|
26
|
-
retryPolicy;
|
|
27
|
-
timeout;
|
|
12
|
+
settings;
|
|
28
13
|
/**
|
|
29
14
|
* @example
|
|
30
15
|
* ```ts
|
|
31
|
-
* import { LockProviderFactory } from "@daiso-tech/core/lock
|
|
32
|
-
* import {
|
|
33
|
-
* import {
|
|
34
|
-
* import {
|
|
35
|
-
* import {
|
|
36
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/
|
|
16
|
+
* import { LockProviderFactory } from "@daiso-tech/core/lock";
|
|
17
|
+
* import type { ILockAdapter } from "@daiso-tech/core/lock/contracts";
|
|
18
|
+
* import { MemoryLockAdapter, RedisLockAdapter, SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
19
|
+
* import { Serde } from "@daiso-tech/core/serde";
|
|
20
|
+
* import type { ISerde } from "@daiso-tech/core/serde/contracts";
|
|
21
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
22
|
+
* import { KeyPrefixer, TimeSpan, type ISqliteDatabase, type FactoryFn } from "@daiso-tech/core/utilities";
|
|
37
23
|
* import Redis from "ioredis"
|
|
24
|
+
* import Sqlite from "better-sqlite3";
|
|
38
25
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
26
|
+
* function lockAdapterFactory(database: ISqliteDatabase, serde: ISerde<string>): FactoryFn<string, ILockAdapter> {
|
|
27
|
+
* return async (prefix) => {
|
|
28
|
+
* const lockAdapter = new SqliteLockAdapter({
|
|
29
|
+
* database,
|
|
30
|
+
* serde,
|
|
31
|
+
* tableName: `lock_${prefix}`
|
|
32
|
+
* });
|
|
33
|
+
* await lockAdapter.init();
|
|
34
|
+
* return lockAdapter;
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* const database = new Sqlite("local.db");
|
|
42
39
|
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
43
40
|
* const lockProviderFactory = new LockProviderFactory({
|
|
44
41
|
* serde,
|
|
42
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
45
43
|
* adapters: {
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* }),
|
|
44
|
+
* sqlite: lockAdapterFactory(database, serde),
|
|
45
|
+
* memory: new MemoryLockAdapter(),
|
|
49
46
|
* redis: new RedisLockAdapter({
|
|
50
47
|
* client: new Redis("YOUR_REDIS_CONNECTION"),
|
|
51
|
-
*
|
|
48
|
+
* serde,
|
|
52
49
|
* }),
|
|
53
50
|
* },
|
|
54
51
|
* defaultAdapter: "memory",
|
|
55
|
-
* eventBus,
|
|
56
52
|
* });
|
|
57
53
|
* ```
|
|
58
54
|
*/
|
|
59
55
|
constructor(settings) {
|
|
60
|
-
|
|
61
|
-
this.serde = serde;
|
|
62
|
-
this.shouldRegisterErrors = shouldRegisterErrors;
|
|
63
|
-
this.shouldRegisterEvents = shouldRegisterEvents;
|
|
64
|
-
this.defaultAdapter = defaultAdapter;
|
|
65
|
-
this.createOwnerId = createOwnerId;
|
|
66
|
-
this.eventBus = eventBus;
|
|
67
|
-
this.defaultTtl = defaultTtl;
|
|
68
|
-
this.defaultBlockingInterval = defaultBlockingInterval;
|
|
69
|
-
this.defaultBlockingTime = defaultBlockingTime;
|
|
70
|
-
this.defaultRefreshTime = defaultRefreshTime;
|
|
71
|
-
this.retryAttempts = retryAttempts;
|
|
72
|
-
this.backoffPolicy = backoffPolicy;
|
|
73
|
-
this.retryPolicy = retryPolicy;
|
|
74
|
-
this.timeout = timeout;
|
|
75
|
-
this.lockProviderRecord = this.init(adapters);
|
|
56
|
+
this.settings = settings;
|
|
76
57
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
58
|
+
setKeyPrefixer(keyPrefixer) {
|
|
59
|
+
return new LockProviderFactory({
|
|
60
|
+
...this.settings,
|
|
61
|
+
keyPrefixer,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
setCreateOwnerId(createId) {
|
|
65
|
+
return new LockProviderFactory({
|
|
66
|
+
...this.settings,
|
|
67
|
+
createOwnerId: createId,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
setEventBus(eventBus) {
|
|
71
|
+
return new LockProviderFactory({
|
|
72
|
+
...this.settings,
|
|
73
|
+
eventBus,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
setDefaultTtl(ttl) {
|
|
77
|
+
return new LockProviderFactory({
|
|
78
|
+
...this.settings,
|
|
79
|
+
defaultTtl: ttl,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
setDefaultBlockingInterval(interval) {
|
|
83
|
+
return new LockProviderFactory({
|
|
84
|
+
...this.settings,
|
|
85
|
+
defaultBlockingInterval: interval,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
setDefaultBlockingTime(time) {
|
|
89
|
+
return new LockProviderFactory({
|
|
90
|
+
...this.settings,
|
|
91
|
+
defaultBlockingTime: time,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
setDefaultRefreshTime(time) {
|
|
95
|
+
return new LockProviderFactory({
|
|
96
|
+
...this.settings,
|
|
97
|
+
defaultRefreshTime: time,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
setRetryAttempts(attempts) {
|
|
101
|
+
return new LockProviderFactory({
|
|
102
|
+
...this.settings,
|
|
103
|
+
retryAttempts: attempts,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
setBackoffPolicy(policy) {
|
|
107
|
+
return new LockProviderFactory({
|
|
108
|
+
...this.settings,
|
|
109
|
+
backoffPolicy: policy,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
setRetryPolicy(policy) {
|
|
113
|
+
return new LockProviderFactory({
|
|
114
|
+
...this.settings,
|
|
115
|
+
retryPolicy: policy,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
setRetryTimeout(timeout) {
|
|
119
|
+
return new LockProviderFactory({
|
|
120
|
+
...this.settings,
|
|
121
|
+
retryTimeout: timeout,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
setTotalTimeout(timeout) {
|
|
125
|
+
return new LockProviderFactory({
|
|
126
|
+
...this.settings,
|
|
127
|
+
totalTimeout: timeout,
|
|
128
|
+
});
|
|
107
129
|
}
|
|
108
130
|
/**
|
|
109
131
|
* @example
|
|
110
132
|
* ```ts
|
|
111
|
-
* import { LockProviderFactory } from "@daiso-tech/core/lock
|
|
112
|
-
* import {
|
|
113
|
-
* import {
|
|
114
|
-
* import {
|
|
115
|
-
* import {
|
|
116
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/
|
|
133
|
+
* import { LockProviderFactory } from "@daiso-tech/core/lock";
|
|
134
|
+
* import type { ILockAdapter } from "@daiso-tech/core/lock/contracts";
|
|
135
|
+
* import { MemoryLockAdapter, RedisLockAdapter, SqliteLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
136
|
+
* import { Serde } from "@daiso-tech/core/serde";
|
|
137
|
+
* import type { ISerde } from "@daiso-tech/core/serde/contracts";
|
|
138
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
139
|
+
* import { KeyPrefixer, TimeSpan, type ISqliteDatabase, type FactoryFn } from "@daiso-tech/core/utilities";
|
|
117
140
|
* import Redis from "ioredis"
|
|
141
|
+
* import Sqlite from "better-sqlite3";
|
|
118
142
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
143
|
+
* function lockAdapterFactory(database: ISqliteDatabase, serde: ISerde<string>): FactoryFn<string, ILockAdapter> {
|
|
144
|
+
* return async (prefix) => {
|
|
145
|
+
* const lockAdapter = new SqliteLockAdapter({
|
|
146
|
+
* database,
|
|
147
|
+
* serde,
|
|
148
|
+
* tableName: `lock_${prefix}`
|
|
149
|
+
* });
|
|
150
|
+
* await lockAdapter.init();
|
|
151
|
+
* return lockAdapter;
|
|
152
|
+
* }
|
|
153
|
+
* }
|
|
154
|
+
*
|
|
155
|
+
* const database = new Sqlite("local.db");
|
|
122
156
|
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
123
157
|
* const lockProviderFactory = new LockProviderFactory({
|
|
124
158
|
* serde,
|
|
159
|
+
* keyPrefixer: new KeyPrefixer("lock"),
|
|
125
160
|
* adapters: {
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* }),
|
|
161
|
+
* sqlite: lockAdapterFactory(database, serde),
|
|
162
|
+
* memory: new MemoryLockAdapter(),
|
|
129
163
|
* redis: new RedisLockAdapter({
|
|
130
164
|
* client: new Redis("YOUR_REDIS_CONNECTION"),
|
|
131
|
-
*
|
|
165
|
+
* serde,
|
|
132
166
|
* }),
|
|
133
167
|
* },
|
|
134
168
|
* defaultAdapter: "memory",
|
|
135
|
-
* eventBus,
|
|
136
169
|
* });
|
|
137
170
|
*
|
|
138
|
-
* // Will
|
|
139
|
-
* await lockProviderFactory
|
|
171
|
+
* // Will acquire key using the default adapter which is MemoryLockAdapter
|
|
172
|
+
* await lockProviderFactory
|
|
173
|
+
* .use()
|
|
174
|
+
* .create("a")
|
|
175
|
+
* .acquire();
|
|
176
|
+
*
|
|
177
|
+
* // Will acquire key using the redis adapter which is RedisLockAdapter
|
|
178
|
+
* await lockProviderFactory
|
|
179
|
+
* .use("redis")
|
|
180
|
+
* .create("a")
|
|
181
|
+
* .acquire();
|
|
182
|
+
*
|
|
183
|
+
* // You can change the default settings of the returned Lock instance.
|
|
184
|
+
* await lockProviderFactory
|
|
185
|
+
* .setDefaultTtl(TimeSpan.fromMinutes(2))
|
|
186
|
+
* .use("sqlite")
|
|
187
|
+
* .create("a")
|
|
188
|
+
* .acquire();
|
|
189
|
+
*
|
|
190
|
+
* // You can reuse the settings
|
|
191
|
+
* const longLivedLockProviderFactory = lockProviderFactory
|
|
192
|
+
* .setDefaultTtl(TimeSpan.fromMinutes(2));
|
|
193
|
+
*
|
|
194
|
+
* await longLivedLockProviderFactory
|
|
195
|
+
* .use()
|
|
196
|
+
* .create("a")
|
|
197
|
+
* .acquire();
|
|
198
|
+
*
|
|
199
|
+
* // You can extend the settings
|
|
200
|
+
* const extendedLockProviderFactory = longLivedLockProviderFactory
|
|
201
|
+
* .setRetryTimeout(TimeSpan.fromSeconds(1));
|
|
140
202
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
203
|
+
* await extendedLockProviderFactory
|
|
204
|
+
* .use()
|
|
205
|
+
* .create("a")
|
|
206
|
+
* .acquire();
|
|
143
207
|
* ```
|
|
144
208
|
*/
|
|
145
|
-
use(adapterName = this.defaultAdapter) {
|
|
209
|
+
use(adapterName = this.settings.defaultAdapter) {
|
|
146
210
|
if (adapterName === undefined) {
|
|
147
211
|
throw new DefaultAdapterNotDefinedError(LockProviderFactory.name);
|
|
148
212
|
}
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
213
|
+
const adapter = this.settings.adapters[adapterName];
|
|
214
|
+
if (adapter === undefined) {
|
|
151
215
|
throw new UnregisteredAdapterError(adapterName);
|
|
152
216
|
}
|
|
153
|
-
|
|
217
|
+
const { keyPrefixer } = this.settings;
|
|
218
|
+
return new LockProvider({
|
|
219
|
+
...this.settings,
|
|
220
|
+
adapter,
|
|
221
|
+
keyPrefixer: new KeyPrefixer([
|
|
222
|
+
...resolveOneOrMore(keyPrefixer.originalRootPrefix),
|
|
223
|
+
adapterName,
|
|
224
|
+
]),
|
|
225
|
+
});
|
|
154
226
|
}
|
|
155
227
|
}
|
|
156
228
|
//# sourceMappingURL=lock-provider-factory.js.map
|
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":"AAAA;;GAEG;AAQH,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"lock-provider-factory.js","sourceRoot":"","sources":["../../../../../src/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.ts"],"names":[],"mappings":"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"}
|
|
@@ -6,7 +6,7 @@ import { type IDatabaseLockAdapter } from "../../../lock/contracts/_module-expor
|
|
|
6
6
|
import { type Promisable } from "../../../utilities/_module-exports.js";
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
|
-
* IMPORT_PATH: ```"@daiso-tech/core/lock/
|
|
9
|
+
* IMPORT_PATH: ```"@daiso-tech/core/lock/test-utilities"```
|
|
10
10
|
* @group Utilities
|
|
11
11
|
*/
|
|
12
12
|
export type DatabaseLockAdapterTestSuiteSettings = {
|
|
@@ -19,13 +19,13 @@ export type DatabaseLockAdapterTestSuiteSettings = {
|
|
|
19
19
|
/**
|
|
20
20
|
* The <i>databaseLockAdapterTestSuite</i> function simplifies the process of testing your custom implementation of <i>{@link IDatabaseLockAdapter}</i> with <i>vitest</i>.
|
|
21
21
|
*
|
|
22
|
-
* IMPORT_PATH: ```"@daiso-tech/core/lock/
|
|
22
|
+
* IMPORT_PATH: ```"@daiso-tech/core/lock/test-utilities"```
|
|
23
23
|
* @group Utilities
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
26
26
|
* import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
27
|
-
* import { databaseLockAdapterTestSuite } from "@@daiso-tech/core/lock/
|
|
28
|
-
* import { LibsqlLockAdapter } from "@daiso-tech/core/lock/
|
|
27
|
+
* import { databaseLockAdapterTestSuite } from "@@daiso-tech/core/lock/test-utilities";
|
|
28
|
+
* import { LibsqlLockAdapter } from "@daiso-tech/core/lock/adapters";
|
|
29
29
|
* import { type Client, createClient } from "@libsql/client";
|
|
30
30
|
*
|
|
31
31
|
* describe("class: LibsqlLockAdapter", () => {
|
|
@@ -44,7 +44,6 @@ export type DatabaseLockAdapterTestSuiteSettings = {
|
|
|
44
44
|
* database: client,
|
|
45
45
|
* tableName: "custom_table",
|
|
46
46
|
* shouldRemoveExpiredKeys: false,
|
|
47
|
-
* rootGroup: "@a",
|
|
48
47
|
* });
|
|
49
48
|
* await lockAdapter.init();
|
|
50
49
|
* return lockAdapter;
|