@daiso-tech/core 0.26.1 → 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.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 +115 -371
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +198 -436
- 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
package/README.md
CHANGED
|
@@ -33,3 +33,13 @@ This library is heavily inspired laravel but built in modular way where you can
|
|
|
33
33
|
#### NOTE: This library only supports ESM (ecmascript) module.
|
|
34
34
|
|
|
35
35
|
### Visit the [docs](https://yousif-khalil-abdulkarim.github.io/daiso-core/) for more information!
|
|
36
|
+
|
|
37
|
+
@daiso-tech/core/cache/implementations/adapters
|
|
38
|
+
@daiso-tech/core/cache/adapters
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@daiso-tech/core/cache/implementations/test-utilities
|
|
42
|
+
@daiso-tech/core/cache/test-utilities
|
|
43
|
+
|
|
44
|
+
@daiso-tech/core/cache/implementations/derivables
|
|
45
|
+
@daiso-tech/core/cache
|
|
@@ -3,19 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type TimeSpan } from "../../../utilities/_module-exports.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
9
|
-
* @group Utilities
|
|
6
|
+
* @internal
|
|
10
7
|
* @throws {AsyncError} {@link AsyncError}
|
|
11
8
|
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* import { delay, TimeSpan } from "@daiso-tech/core";
|
|
15
|
-
* (async () => {
|
|
16
|
-
* console.log("a");
|
|
17
|
-
* await delay(TimeSpan.fromSeconds(2));
|
|
18
|
-
* console.log("b");
|
|
19
|
-
* })();
|
|
20
9
|
*/
|
|
21
10
|
export declare function delay(time: TimeSpan, abortSignal?: AbortSignal): Promise<void>;
|
|
@@ -9,20 +9,9 @@ AsyncError,
|
|
|
9
9
|
AbortAsyncError, } from "../../../async/async.errors.js";
|
|
10
10
|
import { abortAndFail } from "../../../async/utilities/abort/_module.js";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
15
|
-
* @group Utilities
|
|
12
|
+
* @internal
|
|
16
13
|
* @throws {AsyncError} {@link AsyncError}
|
|
17
14
|
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* import { delay, TimeSpan } from "@daiso-tech/core";
|
|
21
|
-
* (async () => {
|
|
22
|
-
* console.log("a");
|
|
23
|
-
* await delay(TimeSpan.fromSeconds(2));
|
|
24
|
-
* console.log("b");
|
|
25
|
-
* })();
|
|
26
15
|
*/
|
|
27
16
|
export async function delay(time, abortSignal = new AbortController().signal) {
|
|
28
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../src/async/utilities/delay/delay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO;AACH,6DAA6D;AAC7D,UAAU;AACV,6DAA6D;AAC7D,eAAe,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../src/async/utilities/delay/delay.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO;AACH,6DAA6D;AAC7D,UAAU;AACV,6DAA6D;AAC7D,eAAe,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACvB,IAAc,EACd,cAA2B,IAAI,eAAe,EAAE,CAAC,MAAM;IAEvD,8DAA8D;IAC9D,IAAI,SAAS,GAAQ,IAAI,CAAC;IAC1B,IAAI,CAAC;QACD,2DAA2D;QAC3D,OAAO,YAAY,CACf,GAAG,EAAE,CACD,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC1B,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBACxB,OAAO,EAAE,CAAC;YACd,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC9B,CAAC,CAAC,EACN,WAAW,CACd,CAAC;IACN,CAAC;YAAS,CAAC;QACP,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrB,iEAAiE;YACjE,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -9,10 +9,30 @@ import { type Func } from "../../../utilities/_module-exports.js";
|
|
|
9
9
|
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
10
10
|
* @group Utilities
|
|
11
11
|
*/
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type LazyPromiseOnFinally = () => Promisable<void>;
|
|
13
|
+
/**
|
|
14
|
+
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
15
|
+
* @group Utilities
|
|
16
|
+
*/
|
|
17
|
+
export type LazyPromiseOnSuccess<TValue> = (value: TValue) => Promisable<void>;
|
|
18
|
+
/**
|
|
19
|
+
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
20
|
+
* @group Utilities
|
|
21
|
+
*/
|
|
22
|
+
export type LazyPromiseOnError = (error: unknown) => Promisable<void>;
|
|
23
|
+
/**
|
|
24
|
+
* IMPORT_PATH: ```"@daiso-tech/core/async"```
|
|
25
|
+
* @group Utilities
|
|
26
|
+
*/
|
|
27
|
+
export type LazyPromiseSettings<TValue = unknown> = {
|
|
28
|
+
retryAttempts?: number | null;
|
|
29
|
+
backoffPolicy?: BackoffPolicy | null;
|
|
30
|
+
retryPolicy?: RetryPolicy | null;
|
|
31
|
+
abortSignal?: AbortSignal | null;
|
|
32
|
+
timeout?: TimeSpan | null;
|
|
33
|
+
onFinally?: LazyPromiseOnFinally;
|
|
34
|
+
onSuccess?: LazyPromiseOnSuccess<TValue>;
|
|
35
|
+
onError?: LazyPromiseOnError;
|
|
16
36
|
};
|
|
17
37
|
/**
|
|
18
38
|
* The <i>LazyPromise</i> class is used for creating lazy <i>{@link PromiseLike}<i> object that will only execute when awaited or when then method is called.
|
|
@@ -40,19 +60,33 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
40
60
|
* The <i>wrapFn</i> is convience method used for wrapping a async method with a <i>LazyPromise</i>.
|
|
41
61
|
* @example
|
|
42
62
|
* ```ts
|
|
43
|
-
* import { LazyPromise
|
|
63
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
64
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
44
65
|
* import { readFile as readFileNodeJs } from "node:fs/promises";
|
|
45
66
|
*
|
|
46
|
-
* const readFile = LazyPromise.wrapFn(readFileNodeJs
|
|
47
|
-
* retryAttempts: 3
|
|
48
|
-
* });
|
|
67
|
+
* const readFile = LazyPromise.wrapFn(readFileNodeJs);
|
|
49
68
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
69
|
+
* const file = await readFile("none_existing_file.txt")
|
|
70
|
+
* .setRetryAttempts(4)
|
|
71
|
+
* .timeout(TimeSpan.fromMinutes(1));
|
|
53
72
|
* ```
|
|
54
73
|
*/
|
|
55
|
-
static wrapFn<TParameters extends unknown[], TReturn>(fn: Func<TParameters, PromiseLike<TReturn
|
|
74
|
+
static wrapFn<TParameters extends unknown[], TReturn>(fn: Func<TParameters, PromiseLike<TReturn>>, settings?: LazyPromiseSettings<TReturn>): Func<TParameters, LazyPromise<TReturn>>;
|
|
75
|
+
/**
|
|
76
|
+
* The <i>delay</i> method creates a <i>{@link LazyPromise}</i> that will be fulfilled after given <i>time</i>.
|
|
77
|
+
*
|
|
78
|
+
* @throws {AsyncError} {@link AsyncError}
|
|
79
|
+
* @throws {AbortAsyncError} {@link AbortAsyncError}
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
83
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
84
|
+
*
|
|
85
|
+
* console.log("a");
|
|
86
|
+
* await LazyPromise.delay(TimeSpan.fromSeconds(2));
|
|
87
|
+
* console.log("b");
|
|
88
|
+
*/
|
|
89
|
+
static delay(time: TimeSpan): LazyPromise<void>;
|
|
56
90
|
/**
|
|
57
91
|
* The <i>all<i> method works similarly to <i>{@link Promise.all}</i> with the key distinction that it operates lazily.
|
|
58
92
|
*/
|
|
@@ -70,26 +104,21 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
70
104
|
*/
|
|
71
105
|
static any<TValue>(promises: LazyPromise<TValue>[]): LazyPromise<TValue>;
|
|
72
106
|
private promise;
|
|
73
|
-
private attempts;
|
|
74
|
-
private backoffPolicy_;
|
|
75
|
-
private retryPolicy_;
|
|
76
|
-
private abortSignal;
|
|
77
|
-
private time;
|
|
78
107
|
private asyncFn;
|
|
108
|
+
private readonly settings;
|
|
79
109
|
/**
|
|
80
110
|
* @example
|
|
81
111
|
* ```ts
|
|
82
|
-
* import { LazyPromise } from "@daiso-tech/core";
|
|
112
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
83
113
|
*
|
|
84
|
-
* (async () => {
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* })();
|
|
114
|
+
* const promise = new LazyPromise(async () => {
|
|
115
|
+
* console.log("I am lazy");
|
|
116
|
+
* });
|
|
117
|
+
*
|
|
118
|
+
* // "I am lazy" will only logged when awaited or then method i called.
|
|
119
|
+
* await promise;
|
|
91
120
|
*/
|
|
92
|
-
constructor(asyncFn: LazyPromiseable<TValue>);
|
|
121
|
+
constructor(asyncFn: LazyPromiseable<TValue>, settings?: LazyPromiseSettings<TValue>);
|
|
93
122
|
private applyTimeout;
|
|
94
123
|
private applyRetry;
|
|
95
124
|
private applyAbort;
|
|
@@ -104,7 +133,7 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
104
133
|
* The <i>setRetryAttempts</i> method is used for setting max retry attempts.
|
|
105
134
|
* @example
|
|
106
135
|
* ```ts
|
|
107
|
-
* import { LazyPromise } from "@daiso-tech/core";
|
|
136
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
108
137
|
*
|
|
109
138
|
* const promise =
|
|
110
139
|
* new LazyPromise(async () => {
|
|
@@ -112,18 +141,17 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
112
141
|
* throw new Error("Error occured!");
|
|
113
142
|
* })
|
|
114
143
|
* .setRetryAttempts(3)
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* })();
|
|
144
|
+
*
|
|
145
|
+
* // Will log "A" 3 times and then retry error will be thrown.
|
|
146
|
+
* await promise;
|
|
119
147
|
* ```
|
|
120
148
|
*/
|
|
121
|
-
setRetryAttempts(attempts: number | null):
|
|
149
|
+
setRetryAttempts(attempts: number | null): LazyPromise<TValue>;
|
|
122
150
|
/**
|
|
123
151
|
* The <i>setBackoffPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
|
|
124
|
-
* @example
|
|
125
152
|
* ```ts
|
|
126
|
-
* import { LazyPromise, linearBackoffPolicy } from "@daiso-tech/core";
|
|
153
|
+
* import { LazyPromise, linearBackoffPolicy } from "@daiso-tech/core/async";
|
|
154
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
127
155
|
*
|
|
128
156
|
* const promise =
|
|
129
157
|
* new LazyPromise(async () => {
|
|
@@ -132,18 +160,17 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
132
160
|
* })
|
|
133
161
|
* .setRetryAttempts(3)
|
|
134
162
|
* .setBackoffPolicy(linearBackoffPolicy())
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* })();
|
|
163
|
+
*
|
|
164
|
+
* // Will log "A" 3 times and then retry error will be thrown.
|
|
165
|
+
* await promise;
|
|
139
166
|
* ```
|
|
140
167
|
*/
|
|
141
|
-
setBackoffPolicy(policy: BackoffPolicy | null):
|
|
168
|
+
setBackoffPolicy(policy: BackoffPolicy | null): LazyPromise<TValue>;
|
|
142
169
|
/**
|
|
143
170
|
* The <i>setRetryPolicy</i> method is used for setting a custom <i>{@link BackoffPolicy}</i>.
|
|
144
171
|
* @example
|
|
145
172
|
* ```ts
|
|
146
|
-
* import { LazyPromise } from "@daiso-tech/core";
|
|
173
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
147
174
|
*
|
|
148
175
|
* class ErrorA extends Error {}
|
|
149
176
|
*
|
|
@@ -155,69 +182,76 @@ export declare class LazyPromise<TValue> implements PromiseLike<TValue> {
|
|
|
155
182
|
* .setRetryAttempts(3)
|
|
156
183
|
* // Will only retry an error that is instance ErrorA
|
|
157
184
|
* .setRetryPolicy(error => error instanceof ErrorA)
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* })();
|
|
185
|
+
*
|
|
186
|
+
* // Will log "A" 1 time and then error will be thrown.
|
|
187
|
+
* await promise;
|
|
162
188
|
* ```
|
|
163
189
|
*/
|
|
164
|
-
setRetryPolicy(policy: RetryPolicy | null):
|
|
190
|
+
setRetryPolicy(policy: RetryPolicy | null): LazyPromise<TValue>;
|
|
165
191
|
/**
|
|
166
192
|
* The <i>setTimeout</i> method aborts the <i>LazyPromise</i> if it exceeds the given <i>time</i> by throwning an error.
|
|
167
193
|
* @example
|
|
168
194
|
* ```ts
|
|
169
|
-
* import { LazyPromise
|
|
195
|
+
* import { LazyPromise } from "@daiso-tech/core/async";
|
|
196
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
170
197
|
*
|
|
171
198
|
* const promise =
|
|
172
199
|
* new LazyPromise(async () => {
|
|
173
|
-
* await delay(TimeSpan.fromMinutes(1));
|
|
200
|
+
* await LazyPromise.delay(TimeSpan.fromMinutes(1));
|
|
174
201
|
* })
|
|
175
202
|
* .setTimeout(TimeSpan.fromSeconds(1));
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* })();
|
|
203
|
+
*
|
|
204
|
+
* // An timeout error will be thrown.
|
|
205
|
+
* await promise;
|
|
180
206
|
* ```
|
|
181
207
|
*/
|
|
182
|
-
setTimeout(time: TimeSpan | null):
|
|
208
|
+
setTimeout(time: TimeSpan | null): LazyPromise<TValue>;
|
|
183
209
|
/**
|
|
184
210
|
* The <i>setAbortSignal</i> method aborts the <i>LazyPromise</i> by the passed in <i>abortSignal</i>.
|
|
185
211
|
* @example
|
|
186
212
|
* ```ts
|
|
187
|
-
* import { LazyPromise
|
|
213
|
+
* import { LazyPromise } from "@daiso-tech/core";
|
|
214
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
188
215
|
*
|
|
189
216
|
* const abortController = new AbortController();
|
|
190
217
|
* const promise =
|
|
191
218
|
* new LazyPromise(async () => {
|
|
192
|
-
* await delay(TimeSpan.fromMinutes(1));
|
|
219
|
+
* await LazyPromise.delay(TimeSpan.fromMinutes(1));
|
|
193
220
|
* })
|
|
194
221
|
* .setAbortSignal(abortController.signal);
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
222
|
+
*
|
|
223
|
+
* setTimeout(() => {
|
|
224
|
+
* abortController.abort();
|
|
225
|
+
* }, 1000);
|
|
226
|
+
*
|
|
227
|
+
* // An timeout error will be thrown.
|
|
228
|
+
* await promise;
|
|
202
229
|
* ```
|
|
203
230
|
*/
|
|
204
|
-
setAbortSignal(abortSignal: AbortSignal | null):
|
|
231
|
+
setAbortSignal(abortSignal: AbortSignal | null): LazyPromise<TValue>;
|
|
232
|
+
onFinally(cb: LazyPromiseOnFinally): LazyPromise<TValue>;
|
|
233
|
+
onSuccess(cb: LazyPromiseOnSuccess<TValue>): LazyPromise<TValue>;
|
|
234
|
+
onError(cb: LazyPromiseOnError): LazyPromise<TValue>;
|
|
205
235
|
/**
|
|
206
236
|
* The <i>defer</i> method executes the <i>LazyPromise</i> without awaiting it.
|
|
207
237
|
* @example
|
|
208
238
|
* ```ts
|
|
209
|
-
* import { LazyPromise
|
|
239
|
+
* import { LazyPromise } from "@daiso-tech/core";
|
|
240
|
+
* import { TimeSpan } from "@daiso-tech/core/utilities";
|
|
210
241
|
*
|
|
211
242
|
* const promise =
|
|
212
243
|
* new LazyPromise(async () => {
|
|
213
|
-
* await delay(TimeSpan.fromSeconds(1));
|
|
244
|
+
* await LazyPromise.delay(TimeSpan.fromSeconds(1));
|
|
214
245
|
* // Will be loged after one second
|
|
215
246
|
* console.log("Done !");
|
|
216
247
|
* });
|
|
248
|
+
*
|
|
217
249
|
* promise.defer();
|
|
250
|
+
*
|
|
218
251
|
* // Will be logged immediately
|
|
219
252
|
* console.log("Hello");
|
|
253
|
+
* await LazyPromise.delay(TimeSpan.fromSeconds(2));
|
|
220
254
|
* ```
|
|
221
255
|
*/
|
|
222
|
-
defer(
|
|
256
|
+
defer(): void;
|
|
223
257
|
}
|