@daiso-tech/core 0.26.0 → 0.27.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 +10 -0
- 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 +99 -65
- package/dist/async/utilities/lazy-promise/lazy-promise.js +151 -111
- package/dist/async/utilities/lazy-promise/lazy-promise.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 +52 -88
- 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/_module-exports.d.ts +0 -1
- package/dist/cache/implementations/adapters/_module-exports.js +0 -1
- package/dist/cache/implementations/adapters/_module-exports.js.map +1 -1
- 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/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 -40
- 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 +122 -565
- package/dist/cache/implementations/derivables/cache/cache.js +342 -854
- 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 +65 -104
- package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +101 -85
- 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 +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +6 -5
- 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 +1 -3
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +1 -7
- 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 +78 -267
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +119 -323
- 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 +70 -96
- package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +100 -90
- 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 +1 -1
- 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/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/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 +12 -17
- 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.d.ts +9 -0
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +17 -0
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -0
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +115 -372
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +197 -455
- 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 +30 -754
- package/dist/lock/implementations/derivables/lock-provider/lock.js +94 -812
- 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 +58 -161
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +116 -122
- 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 +133 -137
- 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 +2 -2
- package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +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 +1 -2
- package/dist/utilities/_module-exports.js +1 -2
- 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/contracts/_module.d.ts +2 -1
- package/dist/utilities/contracts/_module.js +2 -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/functions.d.ts +30 -2
- package/dist/utilities/functions.js +66 -4
- package/dist/utilities/functions.js.map +1 -1
- package/dist/utilities/types.d.ts +47 -14
- 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/cache/implementations/adapters/no-op-cache-adapter/_module.d.ts +0 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.js +0 -2
- package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.js.map +0 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +0 -22
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +0 -39
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.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
|
@@ -2,110 +2,97 @@
|
|
|
2
2
|
* @module Cache
|
|
3
3
|
*/
|
|
4
4
|
import { DefaultAdapterNotDefinedError, UnregisteredAdapterError, } from "../../../../utilities/_module-exports.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Cache } from "../../../../cache/implementations/derivables/cache/cache.js";
|
|
5
|
+
import { Cache, } from "../../../../cache/implementations/derivables/cache/_module.js";
|
|
7
6
|
/**
|
|
8
7
|
*
|
|
9
|
-
* IMPORT_PATH: ```"@daiso-tech/core/cache
|
|
8
|
+
* IMPORT_PATH: ```"@daiso-tech/core/cache"```
|
|
10
9
|
* @group Derivables
|
|
11
10
|
*/
|
|
12
11
|
export class CacheFactory {
|
|
13
|
-
|
|
14
|
-
defaultAdapter;
|
|
15
|
-
eventBus;
|
|
16
|
-
defaultTtl;
|
|
17
|
-
retryAttempts;
|
|
18
|
-
backoffPolicy;
|
|
19
|
-
retryPolicy;
|
|
20
|
-
timeout;
|
|
21
|
-
serde;
|
|
22
|
-
shouldRegisterErrors;
|
|
23
|
-
shouldRegisterEvents;
|
|
12
|
+
settings;
|
|
24
13
|
/**
|
|
25
14
|
* @example
|
|
26
15
|
* ```ts
|
|
27
|
-
* import { CacheFactory } from "@daiso-tech/core/cache/implementations/derivables";
|
|
28
|
-
* import { MemoryCacheAdapter, RedisCacheAdapter } from "@daiso-tech/core/cache/implementations/adapters";
|
|
29
|
-
* import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
|
|
30
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
|
|
31
|
-
* import Redis from "ioredis"
|
|
32
|
-
*
|
|
33
|
-
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
34
|
-
* const cacheFactory = new CacheFactory({
|
|
35
|
-
* serde,
|
|
36
|
-
* adapters: {
|
|
37
|
-
* memory: new MemoryCacheAdapter({
|
|
38
|
-
* rootGroup: "@global"
|
|
39
|
-
* }),
|
|
40
|
-
* redis: new RedisCacheAdapter({
|
|
41
|
-
* client: new Redis("YOUR_REDIS_CONNECTION"),
|
|
42
|
-
* serde,
|
|
43
|
-
* rootGroup: "@global"
|
|
44
|
-
* }),
|
|
45
|
-
* },
|
|
46
|
-
* defaultAdapter: "memory",
|
|
47
|
-
* });
|
|
48
16
|
* ```
|
|
49
17
|
*/
|
|
50
18
|
constructor(settings) {
|
|
51
|
-
|
|
52
|
-
this.shouldRegisterErrors = shouldRegisterErrors;
|
|
53
|
-
this.shouldRegisterEvents = shouldRegisterEvents;
|
|
54
|
-
this.serde = serde;
|
|
55
|
-
this.defaultAdapter = defaultAdapter;
|
|
56
|
-
this.eventBus = eventBus;
|
|
57
|
-
this.defaultTtl = defaultTtl;
|
|
58
|
-
this.retryAttempts = retryAttempts;
|
|
59
|
-
this.backoffPolicy = backoffPolicy;
|
|
60
|
-
this.retryPolicy = retryPolicy;
|
|
61
|
-
this.timeout = timeout;
|
|
62
|
-
this.cacheRecord = this.init(adapters);
|
|
19
|
+
this.settings = settings;
|
|
63
20
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
21
|
+
setKeyPrefixer(keyPrefixer) {
|
|
22
|
+
return new CacheFactory({
|
|
23
|
+
...this.settings,
|
|
24
|
+
keyPrefixer,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
setDefaultTtl(ttl) {
|
|
28
|
+
return new CacheFactory({
|
|
29
|
+
...this.settings,
|
|
30
|
+
defaultTtl: ttl,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
setEventBus(eventBus) {
|
|
34
|
+
return new CacheFactory({
|
|
35
|
+
...this.settings,
|
|
36
|
+
eventBus,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
setRetryAttempts(attempts) {
|
|
40
|
+
return new CacheFactory({
|
|
41
|
+
...this.settings,
|
|
42
|
+
retryAttempts: attempts,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
setBackoffPolicy(policy) {
|
|
46
|
+
return new CacheFactory({
|
|
47
|
+
...this.settings,
|
|
48
|
+
backoffPolicy: policy,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
setRetryPolicy(policy) {
|
|
52
|
+
return new CacheFactory({
|
|
53
|
+
...this.settings,
|
|
54
|
+
retryPolicy: policy,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
setTimeout(timeout) {
|
|
58
|
+
return new CacheFactory({
|
|
59
|
+
...this.settings,
|
|
60
|
+
timeout,
|
|
61
|
+
});
|
|
88
62
|
}
|
|
89
63
|
/**
|
|
90
64
|
* @example
|
|
91
65
|
* ```ts
|
|
92
|
-
* import { CacheFactory } from "@daiso-tech/core/cache
|
|
93
|
-
* import { MemoryCacheAdapter, RedisCacheAdapter } from "@daiso-tech/core/cache/
|
|
94
|
-
* import { Serde } from "@daiso-tech/core/serde
|
|
95
|
-
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/
|
|
66
|
+
* import { CacheFactory } from "@daiso-tech/core/cache";
|
|
67
|
+
* import { MemoryCacheAdapter, RedisCacheAdapter, SqliteCacheAdapter } from "@daiso-tech/core/cache/adapters";
|
|
68
|
+
* import { Serde } from "@daiso-tech/core/serde";
|
|
69
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
|
|
70
|
+
* import { KeyPrefixer, TimeSpan, type IFactoryObject, type Promiseable } from "@daiso-tech/core/utilities";
|
|
96
71
|
* import Redis from "ioredis"
|
|
72
|
+
* import Sqlite from "better-sqlite3";
|
|
97
73
|
*
|
|
98
74
|
* const serde = new Serde(new SuperJsonSerdeAdapter());
|
|
75
|
+
*
|
|
76
|
+
* async function cahceAdapterFactory(prefix: string): Promiseable<SqliteCacheAdapter> {
|
|
77
|
+
* const database = new Sqlite("local.db");
|
|
78
|
+
* const cacheAdapter = new SqliteCacheAdapter({
|
|
79
|
+
* database,
|
|
80
|
+
* serde,
|
|
81
|
+
* tableName: `cache_${prefix}`
|
|
82
|
+
* });
|
|
83
|
+
* await cacheAdapter.init();
|
|
84
|
+
* return cacheAdapter;
|
|
85
|
+
* }
|
|
86
|
+
*
|
|
99
87
|
* const cacheFactory = new CacheFactory({
|
|
100
88
|
* serde,
|
|
89
|
+
* keyPrefixer: new KeyPrefixer("cache"),
|
|
101
90
|
* adapters: {
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* }),
|
|
91
|
+
* sqlite: cahceAdapterFactory,
|
|
92
|
+
* memory: new MemoryCacheAdapter(),
|
|
105
93
|
* redis: new RedisCacheAdapter({
|
|
106
94
|
* client: new Redis("YOUR_REDIS_CONNECTION"),
|
|
107
95
|
* serde,
|
|
108
|
-
* rootGroup: "@global"
|
|
109
96
|
* }),
|
|
110
97
|
* },
|
|
111
98
|
* defaultAdapter: "memory",
|
|
@@ -113,21 +100,50 @@ export class CacheFactory {
|
|
|
113
100
|
* });
|
|
114
101
|
*
|
|
115
102
|
* // Will add key to cache using the default adapter which is MemoryCacheAdapter
|
|
116
|
-
* await cacheFactory
|
|
103
|
+
* await cacheFactory
|
|
104
|
+
* .use()
|
|
105
|
+
* .add("a", 1);
|
|
117
106
|
*
|
|
118
107
|
* // Will add key to cache using the redis adapter which is RedisCacheAdapter
|
|
119
|
-
* await cacheFactory
|
|
108
|
+
* await cacheFactory
|
|
109
|
+
* .use("redis")
|
|
110
|
+
* .add("a", 1);
|
|
111
|
+
*
|
|
112
|
+
* // You can change the default settings of the returned Cache instance.
|
|
113
|
+
* await cacheFactory
|
|
114
|
+
* .setDefaultTtl(TimeSpan.fromMinutes(2))
|
|
115
|
+
* .use("sqlite")
|
|
116
|
+
* .add("a", 1);
|
|
117
|
+
*
|
|
118
|
+
* // You can reuse the settings
|
|
119
|
+
* const longLivedCacheFactory = cacheFactory
|
|
120
|
+
* .setDefaultTtl(TimeSpan.fromMinutes(2));
|
|
121
|
+
*
|
|
122
|
+
* await longLivedCacheFactory
|
|
123
|
+
* .use()
|
|
124
|
+
* .add("a", 1);
|
|
125
|
+
*
|
|
126
|
+
* // You can extend the settings
|
|
127
|
+
* const extendedCacheFactory = longLivedCacheFactory
|
|
128
|
+
* .setTimeout(TimeSpan.fromSeconds(1));
|
|
129
|
+
*
|
|
130
|
+
* await extendedCacheFactory
|
|
131
|
+
* .use()
|
|
132
|
+
* .add("a", 1);
|
|
120
133
|
* ```
|
|
121
134
|
*/
|
|
122
|
-
use(adapterName = this.defaultAdapter) {
|
|
135
|
+
use(adapterName = this.settings.defaultAdapter) {
|
|
123
136
|
if (adapterName === undefined) {
|
|
124
137
|
throw new DefaultAdapterNotDefinedError(CacheFactory.name);
|
|
125
138
|
}
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
139
|
+
const adapter = this.settings.adapters[adapterName];
|
|
140
|
+
if (adapter === undefined) {
|
|
128
141
|
throw new UnregisteredAdapterError(adapterName);
|
|
129
142
|
}
|
|
130
|
-
return
|
|
143
|
+
return new Cache({
|
|
144
|
+
adapter,
|
|
145
|
+
...this.settings,
|
|
146
|
+
});
|
|
131
147
|
}
|
|
132
148
|
}
|
|
133
149
|
//# sourceMappingURL=cache-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-factory.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/derivables/cache-factory/cache-factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"cache-factory.js","sourceRoot":"","sources":["../../../../../src/cache/implementations/derivables/cache-factory/cache-factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EACH,KAAK,GAGR,MAAM,qDAAqD,CAAC;AAyB7D;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAQQ;IAL7B;;;;OAIG;IACH,YAA6B,QAAyC;QAAzC,aAAQ,GAAR,QAAQ,CAAiC;IAAG,CAAC;IAE1E,cAAc,CAAC,WAAwB;QACnC,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,WAAW;SACd,CAAC,CAAC;IACP,CAAC;IAED,aAAa,CAAC,GAAa;QACvB,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,UAAU,EAAE,GAAG;SAClB,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAC,QAAiC;QACzC,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,QAAQ;SACX,CAAC,CAAC;IACP,CAAC;IAED,gBAAgB,CAAC,QAAgB;QAC7B,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,aAAa,EAAE,QAAQ;SAC1B,CAAC,CAAC;IACP,CAAC;IAED,gBAAgB,CAAC,MAAqB;QAClC,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,aAAa,EAAE,MAAM;SACxB,CAAC,CAAC;IACP,CAAC;IAED,cAAc,CAAC,MAAmB;QAC9B,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,WAAW,EAAE,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAED,UAAU,CAAC,OAAiB;QACxB,OAAO,IAAI,YAAY,CAAC;YACpB,GAAG,IAAI,CAAC,QAAQ;YAChB,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuEG;IACH,GAAG,CACC,cAAqC,IAAI,CAAC,QAAQ,CAAC,cAAc;QAEjE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,IAAI,6BAA6B,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC/D,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,OAAO,IAAI,KAAK,CAAC;YACb,OAAO;YACP,GAAG,IAAI,CAAC,QAAQ;SACnB,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export * from "../../../cache/implementations/test-utilities/cache-adapter.test-suite.js";
|
|
2
2
|
export * from "../../../cache/implementations/test-utilities/cache.test-suite.js";
|
|
3
|
+
export * from "../../../cache/implementations/test-utilities/database-cache-dapter.test-suite.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from "../../../cache/implementations/test-utilities/cache-adapter.test-suite.js";
|
|
2
2
|
export * from "../../../cache/implementations/test-utilities/cache.test-suite.js";
|
|
3
|
+
export * from "../../../cache/implementations/test-utilities/database-cache-dapter.test-suite.js";
|
|
3
4
|
//# sourceMappingURL=_module-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../src/cache/implementations/test-utilities/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,oEAAoE,CAAC;AACnF,cAAc,4DAA4D,CAAC"}
|
|
1
|
+
{"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../src/cache/implementations/test-utilities/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,oEAAoE,CAAC;AACnF,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4EAA4E,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { type ICacheAdapter } from "../../../cache/contracts/_module-exports.js"
|
|
|
6
6
|
import { type Promisable } from "../../../utilities/_module-exports.js";
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
|
-
* IMPORT_PATH: ```"@daiso-tech/core/cache/
|
|
9
|
+
* IMPORT_PATH: ```"@daiso-tech/core/cache/test-utilities"```
|
|
10
10
|
* @group Test utilities
|
|
11
11
|
*/
|
|
12
12
|
export type CacheAdapterTestSuiteSettings = {
|
|
@@ -19,21 +19,21 @@ export type CacheAdapterTestSuiteSettings = {
|
|
|
19
19
|
/**
|
|
20
20
|
* The <i>cacheAdapterTestSuite</i> function simplifies the process of testing your custom implementation of <i>{@link ICacheAdapter}</i> with <i>vitest</i>.
|
|
21
21
|
*
|
|
22
|
-
* IMPORT_PATH: ```"@daiso-tech/core/cache/
|
|
22
|
+
* IMPORT_PATH: ```"@daiso-tech/core/cache/test-utilities"```
|
|
23
23
|
* @group Test utilities
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts
|
|
26
26
|
* import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
27
|
-
* import { cacheAdapterTestSuite } from "@daiso-tech/core/cache/implementations/test-utilities";
|
|
28
|
-
* import { RedisCacheAdapter } from "@daiso-tech/core/cache/implementations/adapters";
|
|
29
27
|
* import { Redis } from "ioredis";
|
|
30
28
|
* import {
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* RedisContainer,
|
|
30
|
+
* type StartedRedisContainer,
|
|
33
31
|
* } from "@testcontainers/redis";
|
|
34
|
-
* import {
|
|
35
|
-
* import {
|
|
36
|
-
* import {
|
|
32
|
+
* import { cacheAdapterTestSuite } from "@daiso-tech/cache/implementations/test-utilities";
|
|
33
|
+
* import { RedisCacheAdapter } from "@daiso-tech/cache/implementations/adapters";
|
|
34
|
+
* import { TimeSpan } from "@daiso-tech/cache/utilities";
|
|
35
|
+
* import { SuperJsonSerdeAdapter } from "@daiso-tech/cache/serde/implementations/adapters";
|
|
36
|
+
* import { Serde } from "@daiso-tech/cache/serde/implementations/derivables";
|
|
37
37
|
*
|
|
38
38
|
* const timeout = TimeSpan.fromMinutes(2);
|
|
39
39
|
* describe("class: RedisCacheAdapter", () => {
|
|
@@ -52,7 +52,6 @@ export type CacheAdapterTestSuiteSettings = {
|
|
|
52
52
|
* new RedisCacheAdapter({
|
|
53
53
|
* database: client,
|
|
54
54
|
* serde: new Serde(new SuperJsonSerdeAdapter()),
|
|
55
|
-
* rootGroup: "@a",
|
|
56
55
|
* }),
|
|
57
56
|
* test,
|
|
58
57
|
* beforeEach,
|
|
@@ -60,7 +59,6 @@ export type CacheAdapterTestSuiteSettings = {
|
|
|
60
59
|
* describe,
|
|
61
60
|
* });
|
|
62
61
|
* });
|
|
63
|
-
*
|
|
64
62
|
* ```
|
|
65
63
|
*/
|
|
66
64
|
export declare function cacheAdapterTestSuite(settings: CacheAdapterTestSuiteSettings): void;
|