@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,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
import { LazyPromise } from "
|
|
5
|
-
import type { AsyncLazyable, IInvokableObject, Invokable } from "
|
|
4
|
+
import { LazyPromise } from "../../../async/_module-exports.js";
|
|
5
|
+
import type { AsyncLazyable, IInvokableObject, Invokable } from "../../../utilities/types.js";
|
|
6
6
|
/**
|
|
7
7
|
* The <i>Pipeline</i> class provides a convenient way to pipe multiple functions and <i>{@link IInvokableObject}</i>,
|
|
8
8
|
* giving each functions and <i>{@link IInvokableObject}</i> the opportunity to inspect or modify the input.
|
|
9
9
|
* Pipeline class is immutable meaning you can extend it without causing problems.
|
|
10
10
|
*
|
|
11
11
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
12
|
+
* @group Pipeline
|
|
12
13
|
*/
|
|
13
14
|
export declare class Pipeline<TInitial, TPrev = TInitial, TCurrent = TPrev> implements IInvokableObject<AsyncLazyable<TInitial>, TCurrent> {
|
|
14
15
|
/**
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
import { LazyPromise } from "
|
|
5
|
-
import { resolveAsyncLazyable } from "
|
|
4
|
+
import { LazyPromise } from "../../../async/_module-exports.js";
|
|
5
|
+
import { resolveAsyncLazyable } from "../../../utilities/functions.js";
|
|
6
6
|
/**
|
|
7
7
|
* The <i>Pipeline</i> class provides a convenient way to pipe multiple functions and <i>{@link IInvokableObject}</i>,
|
|
8
8
|
* giving each functions and <i>{@link IInvokableObject}</i> the opportunity to inspect or modify the input.
|
|
9
9
|
* Pipeline class is immutable meaning you can extend it without causing problems.
|
|
10
10
|
*
|
|
11
11
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
12
|
+
* @group Pipeline
|
|
12
13
|
*/
|
|
13
14
|
export class Pipeline {
|
|
14
15
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../../src/utilities/classes/pipeline/pipeline.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAMzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,OAAO,QAAQ;IAGjB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,KAAK;QACR,OAAO,IAAI,QAAQ,E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ilities/classes/time-span/time-span.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/utilities/classes/time-span/_module.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
import type { ISerializable } from "
|
|
4
|
+
import type { ISerializable } from "../../../serde/contracts/_module-exports.js";
|
|
5
5
|
/**
|
|
6
6
|
* The <i>TimeSpan</i> class is used for representing time interval that is the difference between two times measured in a number of days, hours, minutes, and seconds.
|
|
7
7
|
* <i>TimeSpan</i> cannot be negative.
|
|
8
8
|
*
|
|
9
9
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
10
|
+
* @group TimeSpan
|
|
10
11
|
*/
|
|
11
12
|
export declare class TimeSpan implements ISerializable<number> {
|
|
12
13
|
private readonly milliseconds;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-span.js","sourceRoot":"","sources":["../../../../src/utilities/classes/time-span/time-span.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;GAMG;AACH,MAAM,OAAO,QAAQ;IAUoB;IAT7B,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,oBAAoB,GAAG,EAAE,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,kBAAkB,GAAG,EAAE,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IAC/D,MAAM,CAAC,iBAAiB,GAAG,EAAE,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IAEpE,MAAM,CAAC,WAAW,CAAC,QAAgB;QAC/B,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,YAAqC,eAAuB,CAAC;QAAxB,iBAAY,GAAZ,YAAY,CAAY;QACzD,IAAI,CAAC,YAA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C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utilities/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
2
1
|
export * from "../../utilities/contracts/deinitizable.contract.js";
|
|
3
2
|
export * from "../../utilities/contracts/initizable.contract.js";
|
|
3
|
+
export * from "../../utilities/contracts/prunable.contract.js";
|
|
4
|
+
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
5
|
+
export * from "../../utilities/contracts/sqlite-database.contract.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
2
1
|
export * from "../../utilities/contracts/deinitizable.contract.js";
|
|
3
2
|
export * from "../../utilities/contracts/initizable.contract.js";
|
|
3
|
+
export * from "../../utilities/contracts/prunable.contract.js";
|
|
4
|
+
export * from "../../utilities/contracts/serialized-error.contract.js";
|
|
5
|
+
export * from "../../utilities/contracts/sqlite-database.contract.js";
|
|
4
6
|
//# sourceMappingURL=_module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mDAAmD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prunable.contract.js","sourceRoot":"","sources":["../../../src/utilities/contracts/prunable.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
7
|
+
* @group Contracts
|
|
8
|
+
*/
|
|
9
|
+
export type ISqliteStatement = {
|
|
10
|
+
readonly reader: boolean;
|
|
11
|
+
all(parameters: ReadonlyArray<unknown>): unknown[];
|
|
12
|
+
run(parameters: ReadonlyArray<unknown>): {
|
|
13
|
+
changes: number | bigint;
|
|
14
|
+
lastInsertRowid: number | bigint;
|
|
15
|
+
};
|
|
16
|
+
iterate(parameters: ReadonlyArray<unknown>): IterableIterator<unknown>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
21
|
+
* @group Contracts
|
|
22
|
+
*/
|
|
23
|
+
export type ISqliteDatabase = {
|
|
24
|
+
close(): void;
|
|
25
|
+
prepare(sql: string): ISqliteStatement;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-database.contract.js","sourceRoot":"","sources":["../../../src/utilities/contracts/sqlite-database.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
import type { Lazyable, OneOrMore } from "../utilities/types.js";
|
|
4
|
+
import type { Factory, Factoryable, FactoryFn, IFactoryObject, Invokable, InvokableFn, Lazyable, OneOrMore } from "../utilities/types.js";
|
|
5
5
|
import { type AsyncLazyable } from "../utilities/types.js";
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -18,8 +18,40 @@ export declare function isObjectEmpty(object: Record<string | number | symbol, a
|
|
|
18
18
|
/**
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function resolveOneOrMore<TType>(value: OneOrMore<TType>): TType[];
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveOneOrMoreStr(name: OneOrMore<string>, joinStr?: string): string;
|
|
22
26
|
/**
|
|
23
27
|
* @internal
|
|
24
28
|
*/
|
|
25
29
|
export declare function getConstructorName(instance: object): string;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare function isFactoryFn<TInput, TOutput>(factory: Factoryable<TInput, TOutput>): factory is FactoryFn<TInput, TOutput>;
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare function isFactoryObject<TInput, TOutput>(factory: Factoryable<TInput, TOutput>): factory is IFactoryObject<TInput, TOutput>;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function isFactory<TInput, TOutput>(factoryable: Factoryable<TInput, TOutput>): factoryable is Factory<TInput, TOutput>;
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveFactory<TInput, TOutput>(factory: Factory<TInput, TOutput>): FactoryFn<TInput, TOutput>;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveFactoryable<TInput, TOutput>(factoryable: Factoryable<TInput, TOutput>, input: TInput): Promise<TOutput>;
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveInvokable<TInput, TOutput>(invokable: Invokable<TInput, TOutput>): InvokableFn<TInput, TOutput>;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export declare function removeUndefinedProperties<TObject extends Partial<Record<string, unknown>>>(object: TObject): TObject;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
import { LazyPromise } from "../async/_module-exports.js";
|
|
5
|
+
import { isIterable } from "../collection/implementations/_shared.js";
|
|
5
6
|
import {} from "../utilities/types.js";
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
@@ -40,11 +41,22 @@ object) {
|
|
|
40
41
|
/**
|
|
41
42
|
* @internal
|
|
42
43
|
*/
|
|
43
|
-
export function
|
|
44
|
-
if (
|
|
45
|
-
|
|
44
|
+
export function resolveOneOrMore(value) {
|
|
45
|
+
if (isIterable(value)) {
|
|
46
|
+
return [...value];
|
|
46
47
|
}
|
|
47
|
-
return
|
|
48
|
+
return [value];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function resolveOneOrMoreStr(name, joinStr = "/") {
|
|
54
|
+
if (typeof name === "string") {
|
|
55
|
+
return name;
|
|
56
|
+
}
|
|
57
|
+
return resolveOneOrMore(name)
|
|
58
|
+
.filter((str) => str.length > 0)
|
|
59
|
+
.join(joinStr);
|
|
48
60
|
}
|
|
49
61
|
/**
|
|
50
62
|
* @internal
|
|
@@ -52,4 +64,60 @@ export function resolveOneOrMoreStr(name) {
|
|
|
52
64
|
export function getConstructorName(instance) {
|
|
53
65
|
return instance.constructor.name;
|
|
54
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export function isFactoryFn(factory) {
|
|
71
|
+
return typeof factory === "function";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
export function isFactoryObject(factory) {
|
|
77
|
+
return (typeof factory === "object" &&
|
|
78
|
+
factory !== null &&
|
|
79
|
+
typeof factory["use"] === "function");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export function isFactory(factoryable) {
|
|
85
|
+
return isFactoryFn(factoryable) || isFactoryObject(factoryable);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
export function resolveFactory(factory) {
|
|
91
|
+
if (isFactoryObject(factory)) {
|
|
92
|
+
return factory.use.bind(factory);
|
|
93
|
+
}
|
|
94
|
+
return factory;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export async function resolveFactoryable(factoryable, input) {
|
|
100
|
+
if (isFactory(factoryable)) {
|
|
101
|
+
const factory = resolveFactory(factoryable);
|
|
102
|
+
return await factory(input);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return factoryable;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export function resolveInvokable(invokable) {
|
|
112
|
+
if (typeof invokable === "function") {
|
|
113
|
+
return invokable;
|
|
114
|
+
}
|
|
115
|
+
return invokable.invoke.bind(invokable);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
export function removeUndefinedProperties(object) {
|
|
121
|
+
return Object.fromEntries(Object.entries(object).filter(([_key, value]) => value !== undefined));
|
|
122
|
+
}
|
|
55
123
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/utilities/functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/utilities/functions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAWrE,OAAO,EAAsB,MAAM,sBAAsB,CAAC;AAE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,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAEvC,MAAe;IACb,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAC7D,CAAC;AACjB,CAAC"}
|
|
@@ -2,70 +2,103 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
import type { LazyPromise } from "../async/_module-exports.js";
|
|
5
|
+
export type Items<TArray extends any[]> = TArray[number];
|
|
5
6
|
/**
|
|
7
|
+
*
|
|
6
8
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
7
|
-
* @group Contracts
|
|
8
9
|
*/
|
|
9
|
-
export type
|
|
10
|
+
export type AtLeastOne<TItem> = [TItem, ...TItem[]];
|
|
10
11
|
/**
|
|
12
|
+
*
|
|
13
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
14
|
+
*/
|
|
15
|
+
export type OneOrMore<TItem> = TItem | Iterable<TItem>;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
11
18
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
12
|
-
* @group Contracts
|
|
13
19
|
*/
|
|
14
20
|
export type Lazyable<TValue> = TValue | (() => TValue);
|
|
15
21
|
/**
|
|
22
|
+
*
|
|
16
23
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
17
|
-
* @group Contracts
|
|
18
24
|
*/
|
|
19
25
|
export type Promisable<TValue> = TValue | PromiseLike<TValue>;
|
|
20
26
|
/**
|
|
27
|
+
*
|
|
21
28
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
22
|
-
* @group Contracts
|
|
23
29
|
*/
|
|
24
30
|
export type LazyPromiseable<TValue> = LazyPromise<TValue> | (() => Promisable<TValue>);
|
|
25
31
|
/**
|
|
32
|
+
*
|
|
26
33
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
27
|
-
* @group Contracts
|
|
28
34
|
*/
|
|
29
35
|
export type AsyncLazyable<TValue> = TValue | LazyPromiseable<TValue>;
|
|
30
36
|
/**
|
|
37
|
+
*
|
|
31
38
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
32
|
-
* @group Contracts
|
|
33
39
|
*/
|
|
34
40
|
export type Result<TValue, TError> = [TValue, null] | [null, TError];
|
|
35
41
|
/**
|
|
42
|
+
*
|
|
36
43
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
37
|
-
* @group Contracts
|
|
38
44
|
*/
|
|
39
45
|
export type AsyncIterableValue<TInput> = Iterable<TInput> | AsyncIterable<TInput>;
|
|
40
46
|
/**
|
|
47
|
+
*
|
|
41
48
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
42
|
-
* @group Contracts
|
|
43
49
|
*/
|
|
44
|
-
export type
|
|
50
|
+
export type Func<TArgs extends unknown[], TReturn> = (...args_: TArgs) => TReturn;
|
|
45
51
|
/**
|
|
52
|
+
*
|
|
46
53
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
47
|
-
* @group Contracts
|
|
48
54
|
*/
|
|
49
|
-
export type Func<
|
|
55
|
+
export type AnyFunction = Func<any[], any>;
|
|
50
56
|
/**
|
|
57
|
+
*
|
|
58
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
59
|
+
*/
|
|
60
|
+
export type NoneFunction<TType> = Exclude<TType, AnyFunction>;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
51
63
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
52
|
-
* @group Contracts
|
|
53
64
|
*/
|
|
54
65
|
export type GetOrAddValue<TValue> = Awaited<TValue extends AnyFunction ? ReturnType<TValue> : TValue>;
|
|
55
66
|
/**
|
|
67
|
+
*
|
|
56
68
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
57
|
-
* @group Contracts
|
|
58
69
|
*/
|
|
59
70
|
export type InvokableFn<TInput = unknown, TOutput = unknown> = (value: TInput) => Promisable<TOutput>;
|
|
60
71
|
/**
|
|
72
|
+
*
|
|
61
73
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
62
|
-
* @group Contracts
|
|
63
74
|
*/
|
|
64
75
|
export type IInvokableObject<TInput = unknown, TOutput = unknown> = {
|
|
65
76
|
invoke(value: TInput): Promisable<TOutput>;
|
|
66
77
|
};
|
|
67
78
|
/**
|
|
79
|
+
*
|
|
68
80
|
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
69
|
-
* @group Contracts
|
|
70
81
|
*/
|
|
71
82
|
export type Invokable<TInput = unknown, TOutput = unknown> = InvokableFn<TInput, TOutput> | IInvokableObject<TInput, TOutput>;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
86
|
+
*/
|
|
87
|
+
export type FactoryFn<TInput, TOutput> = (value: TInput) => Promisable<NoneFunction<TOutput>>;
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
91
|
+
*/
|
|
92
|
+
export type IFactoryObject<TInput, TOutput> = {
|
|
93
|
+
use(value: TInput): Promisable<NoneFunction<TOutput>>;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
98
|
+
*/
|
|
99
|
+
export type Factory<TInput, TOutput> = FactoryFn<TInput, TOutput> | IFactoryObject<TInput, TOutput>;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* IMPORT_PATH: ```"@daiso-tech/core/utilities"```
|
|
103
|
+
*/
|
|
104
|
+
export type Factoryable<TInput, TOutput> = NoneFunction<TOutput> | Factory<TInput, TOutput>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daiso-tech/core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"author": "Yousif Abdulkarim",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
],
|
|
44
44
|
"exports": {
|
|
45
45
|
"./*": {
|
|
46
|
-
"import":
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"types":
|
|
46
|
+
"import": [
|
|
47
|
+
"./dist/*/_module-exports.js",
|
|
48
|
+
"./dist/*/implementations/_module-exports.js",
|
|
49
|
+
"./dist/*/implementations/derivables/_module-exports.js"
|
|
50
|
+
],
|
|
51
|
+
"types": [
|
|
52
|
+
"./dist/*/_module-exports.d.ts",
|
|
53
|
+
"./dist/*/implementations/_module-exports.d.ts",
|
|
54
|
+
"./dist/*/implementations/derivables/_module-exports.d.ts"
|
|
55
|
+
]
|
|
52
56
|
},
|
|
53
57
|
"./*/contracts": {
|
|
54
58
|
"import": "./dist/*/contracts/_module-exports.js",
|
|
55
59
|
"types": "./dist/*/contracts/_module-exports.d.ts"
|
|
56
60
|
},
|
|
57
|
-
"./*/
|
|
61
|
+
"./*/adapters": {
|
|
58
62
|
"import": "./dist/*/implementations/adapters/_module-exports.js",
|
|
59
63
|
"types": "./dist/*/implementations/adapters/_module-exports.d.ts"
|
|
60
64
|
},
|
|
61
|
-
"./*/
|
|
62
|
-
"import": "./dist/*/implementations/derivables/_module-exports.js",
|
|
63
|
-
"types": "./dist/*/implementations/derivables/_module-exports.d.ts"
|
|
64
|
-
},
|
|
65
|
-
"./*/implementations/test-utilities": {
|
|
65
|
+
"./*/test-utilities": {
|
|
66
66
|
"import": "./dist/*/implementations/test-utilities/_module-exports.js",
|
|
67
67
|
"types": "./dist/*/implementations/test-utilities/_module-exports.d.ts"
|
|
68
68
|
}
|
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {
|
|
131
131
|
"@libsql/kysely-libsql": "^0.4.0",
|
|
132
|
+
"escape-string-regexp": "^5.0.0",
|
|
132
133
|
"kysely": "^0.27.0",
|
|
133
134
|
"superjson-cjs": "^2.2.3",
|
|
134
135
|
"uuid": "^11.0.5"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.ts"],"names":[],"mappings":"AAAA,cAAc,6FAA6F,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module Cache
|
|
3
|
-
*/
|
|
4
|
-
import { type ICacheAdapter } from "../../../../cache/contracts/_module-exports.js";
|
|
5
|
-
import { type Kysely } from "kysely";
|
|
6
|
-
import { type ISerde } from "../../../../serde/contracts/_module-exports.js";
|
|
7
|
-
import type { IDeinitizable, IInitizable } from "../../../../utilities/_module-exports.js";
|
|
8
|
-
import { TimeSpan } from "../../../../utilities/_module-exports.js";
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
type KyselySqliteCacheTable = {
|
|
13
|
-
group: string;
|
|
14
|
-
key: string;
|
|
15
|
-
value: string;
|
|
16
|
-
expiresAt: number | null;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
type KyselySqliteTables = {
|
|
22
|
-
cache: KyselySqliteCacheTable;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
type KyselySqliteSettings = {
|
|
28
|
-
db: Kysely<KyselySqliteTables>;
|
|
29
|
-
serde: ISerde<string>;
|
|
30
|
-
enableTransactions: boolean;
|
|
31
|
-
expiredKeysRemovalInterval?: TimeSpan;
|
|
32
|
-
shouldRemoveExpiredKeys?: boolean;
|
|
33
|
-
rootGroup: string;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
export declare class KyselySqliteCacheAdapter<TType = unknown> implements ICacheAdapter<TType>, IInitizable, IDeinitizable {
|
|
39
|
-
private readonly group;
|
|
40
|
-
private readonly serde;
|
|
41
|
-
private readonly enableTransactions;
|
|
42
|
-
private readonly expiredKeysRemovalInterval;
|
|
43
|
-
private readonly shouldRemoveExpiredKeys;
|
|
44
|
-
private timeoutId;
|
|
45
|
-
private readonly db;
|
|
46
|
-
constructor(settings: KyselySqliteSettings);
|
|
47
|
-
getGroup(): string;
|
|
48
|
-
withGroup(group: string): ICacheAdapter<TType>;
|
|
49
|
-
private withTransaction;
|
|
50
|
-
removeExpiredKeys(): Promise<void>;
|
|
51
|
-
init(): Promise<void>;
|
|
52
|
-
deInit(): Promise<void>;
|
|
53
|
-
get(key: string): Promise<TType | null>;
|
|
54
|
-
add(key: string, value: TType, ttl: TimeSpan | null): Promise<boolean>;
|
|
55
|
-
update(key: string, value: TType): Promise<boolean>;
|
|
56
|
-
put(key: string, value: TType, ttl: TimeSpan | null): Promise<boolean>;
|
|
57
|
-
remove(key: string): Promise<boolean>;
|
|
58
|
-
increment(key: string, value: number): Promise<boolean>;
|
|
59
|
-
clear(): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export {};
|