@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.
Files changed (275) hide show
  1. package/README.md +10 -0
  2. package/dist/async/utilities/delay/delay.d.ts +1 -12
  3. package/dist/async/utilities/delay/delay.js +1 -12
  4. package/dist/async/utilities/delay/delay.js.map +1 -1
  5. package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +99 -65
  6. package/dist/async/utilities/lazy-promise/lazy-promise.js +151 -111
  7. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  8. package/dist/cache/contracts/_module-exports.d.ts +1 -0
  9. package/dist/cache/contracts/_module-exports.js +1 -0
  10. package/dist/cache/contracts/_module-exports.js.map +1 -1
  11. package/dist/cache/contracts/cache-adapter.contract.d.ts +19 -21
  12. package/dist/cache/contracts/cache-adapter.contract.js +1 -4
  13. package/dist/cache/contracts/cache-adapter.contract.js.map +1 -1
  14. package/dist/cache/contracts/cache-factory.contract.d.ts +1 -1
  15. package/dist/cache/contracts/cache.contract.d.ts +52 -88
  16. package/dist/cache/contracts/cache.contract.js +1 -2
  17. package/dist/cache/contracts/cache.contract.js.map +1 -1
  18. package/dist/cache/contracts/cache.errors.js +2 -5
  19. package/dist/cache/contracts/cache.errors.js.map +1 -1
  20. package/dist/cache/contracts/cache.events.d.ts +10 -10
  21. package/dist/cache/contracts/cache.events.js +2 -5
  22. package/dist/cache/contracts/cache.events.js.map +1 -1
  23. package/dist/cache/contracts/database-cache-adapter.contract.d.ts +89 -0
  24. package/dist/cache/contracts/database-cache-adapter.contract.js +5 -0
  25. package/dist/cache/contracts/database-cache-adapter.contract.js.map +1 -0
  26. package/dist/cache/implementations/adapters/_module-exports.d.ts +0 -1
  27. package/dist/cache/implementations/adapters/_module-exports.js +0 -1
  28. package/dist/cache/implementations/adapters/_module-exports.js.map +1 -1
  29. package/dist/cache/implementations/adapters/{kysely-sqlite-cache-adapter → kysely-cache-adapter}/_module.d.ts +1 -1
  30. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js +2 -0
  31. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +1 -0
  32. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +73 -0
  33. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +224 -0
  34. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -0
  35. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +29 -39
  36. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +45 -54
  37. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
  38. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +17 -33
  39. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +43 -52
  40. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  41. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.d.ts +13 -0
  42. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js +38 -0
  43. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js.map +1 -0
  44. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +27 -33
  45. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +145 -197
  46. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  47. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.d.ts +13 -0
  48. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js +39 -0
  49. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js.map +1 -0
  50. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +16 -22
  51. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +51 -132
  52. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  53. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.d.ts +13 -0
  54. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +69 -0
  55. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -0
  56. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +29 -40
  57. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +46 -55
  58. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
  59. package/dist/cache/implementations/derivables/_module-exports.d.ts +1 -1
  60. package/dist/cache/implementations/derivables/_module-exports.js +1 -1
  61. package/dist/cache/implementations/derivables/_module-exports.js.map +1 -1
  62. package/dist/cache/implementations/derivables/cache/_module.d.ts +1 -0
  63. package/dist/cache/implementations/derivables/cache/_module.js +1 -0
  64. package/dist/cache/implementations/derivables/cache/_module.js.map +1 -1
  65. package/dist/cache/implementations/derivables/cache/cache.d.ts +122 -565
  66. package/dist/cache/implementations/derivables/cache/cache.js +342 -854
  67. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  68. package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +21 -0
  69. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +110 -0
  70. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -0
  71. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.d.ts +9 -0
  72. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js +20 -0
  73. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -0
  74. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +65 -104
  75. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +101 -85
  76. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  77. package/dist/cache/implementations/test-utilities/_module-exports.d.ts +1 -0
  78. package/dist/cache/implementations/test-utilities/_module-exports.js +1 -0
  79. package/dist/cache/implementations/test-utilities/_module-exports.js.map +1 -1
  80. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +9 -11
  81. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +246 -247
  82. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
  83. package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +16 -30
  84. package/dist/cache/implementations/test-utilities/cache.test-suite.js +271 -996
  85. package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
  86. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +60 -0
  87. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +698 -0
  88. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -0
  89. package/dist/collection/contracts/async-collection.contract.d.ts +2 -3
  90. package/dist/collection/contracts/async-collection.contract.js +1 -12
  91. package/dist/collection/contracts/async-collection.contract.js.map +1 -1
  92. package/dist/collection/contracts/collection.contract.d.ts +1 -1
  93. package/dist/collection/contracts/collection.errors.d.ts +1 -1
  94. package/dist/collection/contracts/collection.errors.js +3 -6
  95. package/dist/collection/contracts/collection.errors.js.map +1 -1
  96. package/dist/collection/implementations/_shared.d.ts +4 -4
  97. package/dist/collection/implementations/_shared.js +6 -9
  98. package/dist/collection/implementations/_shared.js.map +1 -1
  99. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +2 -2
  100. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -1
  101. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +1 -1
  102. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +6 -5
  103. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  104. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
  105. package/dist/collection/implementations/iterable-collection/iterable-collection.js +1 -1
  106. package/dist/collection/implementations/list-collection/list-collection.d.ts +1 -1
  107. package/dist/collection/implementations/list-collection/list-collection.js +1 -1
  108. package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -9
  109. package/dist/event-bus/contracts/event-bus.contract.d.ts +5 -5
  110. package/dist/event-bus/contracts/event-bus.contract.js.map +1 -1
  111. package/dist/event-bus/contracts/event-bus.errors.js +2 -5
  112. package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
  113. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +9 -29
  114. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +14 -35
  115. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  116. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +1 -3
  117. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +1 -7
  118. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  119. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +8 -15
  120. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +15 -34
  121. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  122. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +78 -267
  123. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +119 -323
  124. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  125. package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +13 -0
  126. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +42 -0
  127. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -0
  128. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +70 -96
  129. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +100 -90
  130. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  131. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +2 -48
  132. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +31 -122
  133. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
  134. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +2 -50
  135. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +41 -89
  136. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  137. package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -9
  138. package/dist/lock/contracts/lock-adapter.contract.d.ts +0 -9
  139. package/dist/lock/contracts/lock-provider.contract.d.ts +1 -1
  140. package/dist/lock/contracts/lock.errors.js +2 -5
  141. package/dist/lock/contracts/lock.errors.js.map +1 -1
  142. package/dist/lock/contracts/lock.events.js +2 -5
  143. package/dist/lock/contracts/lock.events.js.map +1 -1
  144. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -5
  145. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -21
  146. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
  147. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +11 -16
  148. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +11 -20
  149. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +1 -1
  150. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +7 -26
  151. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +7 -35
  152. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
  153. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +13 -20
  154. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +13 -37
  155. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
  156. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +4 -22
  157. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +4 -31
  158. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
  159. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +12 -17
  160. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +12 -21
  161. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +1 -1
  162. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +0 -2
  163. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +2 -8
  164. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
  165. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.d.ts +9 -0
  166. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +17 -0
  167. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -0
  168. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +115 -372
  169. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +197 -455
  170. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  171. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +15 -17
  172. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +42 -40
  173. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
  174. package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +3 -3
  175. package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
  176. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +30 -754
  177. package/dist/lock/implementations/derivables/lock-provider/lock.js +94 -812
  178. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  179. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +58 -161
  180. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +116 -122
  181. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
  182. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +4 -5
  183. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +172 -247
  184. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
  185. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +5 -8
  186. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +93 -98
  187. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
  188. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -20
  189. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +133 -137
  190. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
  191. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +1 -2
  192. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +1 -1
  193. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +2 -2
  194. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +1 -1
  195. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +1 -2
  196. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +1 -1
  197. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +1 -2
  198. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +1 -1
  199. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +2 -2
  200. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +2 -2
  201. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
  202. package/dist/serde/implementations/derivables/serde.d.ts +14 -14
  203. package/dist/serde/implementations/derivables/serde.js +14 -15
  204. package/dist/serde/implementations/derivables/serde.js.map +1 -1
  205. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +4 -4
  206. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +3 -3
  207. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +5 -5
  208. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +4 -4
  209. package/dist/utilities/_module-exports.d.ts +1 -2
  210. package/dist/utilities/_module-exports.js +1 -2
  211. package/dist/utilities/_module-exports.js.map +1 -1
  212. package/dist/utilities/classes/_module.d.ts +4 -0
  213. package/dist/utilities/classes/_module.js +5 -0
  214. package/dist/utilities/classes/_module.js.map +1 -0
  215. package/dist/utilities/classes/key-prefixer/_module.d.ts +2 -0
  216. package/dist/utilities/classes/key-prefixer/_module.js +3 -0
  217. package/dist/utilities/classes/key-prefixer/_module.js.map +1 -0
  218. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +28 -0
  219. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js +5 -0
  220. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js.map +1 -0
  221. package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +73 -0
  222. package/dist/utilities/classes/key-prefixer/key-prefixer.js +135 -0
  223. package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -0
  224. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +1 -0
  225. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +2 -0
  226. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +1 -0
  227. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -0
  228. package/dist/utilities/classes/pipeline/_module.d.ts +1 -0
  229. package/dist/utilities/classes/pipeline/_module.js +2 -0
  230. package/dist/utilities/classes/pipeline/_module.js.map +1 -0
  231. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.d.ts +3 -2
  232. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.js +3 -2
  233. package/dist/utilities/classes/pipeline/pipeline.js.map +1 -0
  234. package/dist/utilities/classes/time-span/_module.d.ts +1 -0
  235. package/dist/utilities/classes/time-span/_module.js +2 -0
  236. package/dist/utilities/classes/time-span/_module.js.map +1 -0
  237. package/dist/utilities/{time-span → classes/time-span}/time-span.d.ts +2 -1
  238. package/dist/utilities/{time-span → classes/time-span}/time-span.js +1 -0
  239. package/dist/utilities/classes/time-span/time-span.js.map +1 -0
  240. package/dist/utilities/contracts/_module.d.ts +2 -1
  241. package/dist/utilities/contracts/_module.js +2 -1
  242. package/dist/utilities/contracts/_module.js.map +1 -1
  243. package/dist/utilities/contracts/prunable.contract.d.ts +11 -0
  244. package/dist/utilities/contracts/prunable.contract.js +5 -0
  245. package/dist/utilities/contracts/prunable.contract.js.map +1 -0
  246. package/dist/utilities/functions.d.ts +30 -2
  247. package/dist/utilities/functions.js +66 -4
  248. package/dist/utilities/functions.js.map +1 -1
  249. package/dist/utilities/types.d.ts +47 -14
  250. package/package.json +14 -13
  251. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js +0 -2
  252. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js.map +0 -1
  253. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +0 -61
  254. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +0 -318
  255. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +0 -1
  256. package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.d.ts +0 -1
  257. package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.js +0 -2
  258. package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.js.map +0 -1
  259. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +0 -22
  260. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +0 -39
  261. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +0 -1
  262. package/dist/utilities/kysely/_module.d.ts +0 -1
  263. package/dist/utilities/kysely/_module.js +0 -2
  264. package/dist/utilities/kysely/_module.js.map +0 -1
  265. package/dist/utilities/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
  266. package/dist/utilities/pipeline/_module.d.ts +0 -1
  267. package/dist/utilities/pipeline/_module.js +0 -2
  268. package/dist/utilities/pipeline/_module.js.map +0 -1
  269. package/dist/utilities/pipeline/pipeline.js.map +0 -1
  270. package/dist/utilities/time-span/_module.d.ts +0 -1
  271. package/dist/utilities/time-span/_module.js +0 -2
  272. package/dist/utilities/time-span/_module.js.map +0 -1
  273. package/dist/utilities/time-span/time-span.js.map +0 -1
  274. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.d.ts +0 -0
  275. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.js +0 -0
@@ -1,3 +1,4 @@
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/serialized-error.contract.js";
4
+ export * from "../../utilities/contracts/prunable.contract.js";
@@ -1,4 +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/serialized-error.contract.js";
4
+ export * from "../../utilities/contracts/prunable.contract.js";
4
5
  //# sourceMappingURL=_module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/utilities/contracts/_module.ts"],"names":[],"mappings":"AAAA,cAAc,oDAAoD,CAAC;AACnE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,8CAA8C,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,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module Utilities
3
+ */
4
+ /**
5
+ *
6
+ * IMPORT_PATH: ```"@daiso-tech/core/utilities/contracts"```
7
+ * @group Contracts
8
+ */
9
+ export type IPrunable = {
10
+ removeAllExpired(): PromiseLike<void>;
11
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Utilities
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=prunable.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prunable.contract.js","sourceRoot":"","sources":["../../../src/utilities/contracts/prunable.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,36 @@ export declare function isObjectEmpty(object: Record<string | number | symbol, a
18
18
  /**
19
19
  * @internal
20
20
  */
21
- export declare function resolveOneOrMoreStr(name: OneOrMore<string>): string;
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>;
@@ -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 resolveOneOrMoreStr(name) {
44
- if (Array.isArray(name)) {
45
- name = name.filter((str) => str.length > 0).join("/");
44
+ export function resolveOneOrMore(value) {
45
+ if (Array.isArray(value)) {
46
+ return value;
46
47
  }
47
- return name;
48
+ else if (isIterable(value)) {
49
+ return [...value];
50
+ }
51
+ return [value];
52
+ }
53
+ /**
54
+ * @internal
55
+ */
56
+ export function resolveOneOrMoreStr(name, joinStr = "/") {
57
+ return resolveOneOrMore(name)
58
+ .filter((str) => str.length > 0)
59
+ .join(joinStr);
48
60
  }
49
61
  /**
50
62
  * @internal
@@ -52,4 +64,54 @@ 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
+ }
55
117
  //# 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;AAEzD,OAAO,EAAsB,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,M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C,WAAW,CAAC,CAAC;QAC5C,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;SAAM,CAAC;QACJ,OAAO,WAAW,CAAC;IACvB,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,SAAqC;IAErC,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC5C,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 OneOrMore<TItem> = TItem | [TItem, ...TItem[]];
10
+ export type AtLeastOne<TItem> = [TItem, ...TItem[]];
10
11
  /**
12
+ *
13
+ * IMPORT_PATH: ```"@daiso-tech/core/utilities"```
14
+ */
15
+ export type OneOrMore<TItem> = TItem | AtLeastOne<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
50
  export type AnyFunction = (...parameters: unknown[]) => unknown;
45
51
  /**
52
+ *
53
+ * IMPORT_PATH: ```"@daiso-tech/core/utilities"```
54
+ */
55
+ export type NoneFunction<TType> = Exclude<TType, AnyFunction>;
56
+ /**
57
+ *
46
58
  * IMPORT_PATH: ```"@daiso-tech/core/utilities"```
47
- * @group Contracts
48
59
  */
49
60
  export type Func<TArgs extends unknown[], TReturn> = (...args_: TArgs) => TReturn;
50
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.26.0",
4
+ "version": "0.27.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": "./dist/*/_module-exports.js",
47
- "types": "./dist/*/_module-exports.d.ts"
48
- },
49
- "./*/implementations": {
50
- "import": "./dist/*/implementations/_module-exports.js",
51
- "types": "./dist/*/implementations/_module-exports.d.ts"
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
- "./*/implementations/adapters": {
61
+ "./*/adapters": {
58
62
  "import": "./dist/*/implementations/adapters/_module-exports.js",
59
63
  "types": "./dist/*/implementations/adapters/_module-exports.d.ts"
60
64
  },
61
- "./*/implementations/derivables": {
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,2 +0,0 @@
1
- export * from "../../../../cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js";
2
- //# sourceMappingURL=_module.js.map
@@ -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 {};