@daiso-tech/core 0.26.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/README.md +13 -3
  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 +143 -71
  6. package/dist/async/utilities/lazy-promise/lazy-promise.js +223 -142
  7. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  8. package/dist/async/utilities/retry/retry-or-fail.d.ts +2 -0
  9. package/dist/async/utilities/retry/retry-or-fail.js.map +1 -1
  10. package/dist/cache/contracts/_module-exports.d.ts +1 -0
  11. package/dist/cache/contracts/_module-exports.js +1 -0
  12. package/dist/cache/contracts/_module-exports.js.map +1 -1
  13. package/dist/cache/contracts/cache-adapter.contract.d.ts +19 -21
  14. package/dist/cache/contracts/cache-adapter.contract.js +1 -4
  15. package/dist/cache/contracts/cache-adapter.contract.js.map +1 -1
  16. package/dist/cache/contracts/cache-factory.contract.d.ts +1 -1
  17. package/dist/cache/contracts/cache.contract.d.ts +144 -96
  18. package/dist/cache/contracts/cache.contract.js +1 -2
  19. package/dist/cache/contracts/cache.contract.js.map +1 -1
  20. package/dist/cache/contracts/cache.errors.js +2 -5
  21. package/dist/cache/contracts/cache.errors.js.map +1 -1
  22. package/dist/cache/contracts/cache.events.d.ts +10 -10
  23. package/dist/cache/contracts/cache.events.js +2 -5
  24. package/dist/cache/contracts/cache.events.js.map +1 -1
  25. package/dist/cache/contracts/database-cache-adapter.contract.d.ts +89 -0
  26. package/dist/cache/contracts/database-cache-adapter.contract.js +5 -0
  27. package/dist/cache/contracts/database-cache-adapter.contract.js.map +1 -0
  28. package/dist/cache/implementations/adapters/{kysely-sqlite-cache-adapter → kysely-cache-adapter}/_module.d.ts +1 -1
  29. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js +2 -0
  30. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +1 -0
  31. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +73 -0
  32. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +224 -0
  33. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -0
  34. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +29 -39
  35. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +45 -54
  36. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
  37. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +17 -33
  38. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +43 -52
  39. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  40. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.d.ts +13 -0
  41. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js +38 -0
  42. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter-serde.js.map +1 -0
  43. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +27 -33
  44. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +145 -197
  45. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  46. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +14 -13
  47. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +19 -17
  48. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
  49. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.d.ts +13 -0
  50. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js +39 -0
  51. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter-serde.js.map +1 -0
  52. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +16 -22
  53. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +51 -132
  54. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  55. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.d.ts +13 -0
  56. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +69 -0
  57. package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -0
  58. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +29 -41
  59. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +46 -55
  60. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
  61. package/dist/cache/implementations/derivables/_module-exports.d.ts +1 -1
  62. package/dist/cache/implementations/derivables/_module-exports.js +1 -1
  63. package/dist/cache/implementations/derivables/_module-exports.js.map +1 -1
  64. package/dist/cache/implementations/derivables/cache/_module.d.ts +1 -0
  65. package/dist/cache/implementations/derivables/cache/_module.js +1 -0
  66. package/dist/cache/implementations/derivables/cache/_module.js.map +1 -1
  67. package/dist/cache/implementations/derivables/cache/cache.d.ts +269 -507
  68. package/dist/cache/implementations/derivables/cache/cache.js +538 -822
  69. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  70. package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +21 -0
  71. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +110 -0
  72. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -0
  73. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.d.ts +9 -0
  74. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js +20 -0
  75. package/dist/cache/implementations/derivables/cache/is-database-cache-adapter.js.map +1 -0
  76. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +69 -105
  77. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +117 -87
  78. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  79. package/dist/cache/implementations/test-utilities/_module-exports.d.ts +1 -0
  80. package/dist/cache/implementations/test-utilities/_module-exports.js +1 -0
  81. package/dist/cache/implementations/test-utilities/_module-exports.js.map +1 -1
  82. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +9 -11
  83. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +246 -247
  84. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
  85. package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +16 -30
  86. package/dist/cache/implementations/test-utilities/cache.test-suite.js +271 -996
  87. package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
  88. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +60 -0
  89. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +698 -0
  90. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -0
  91. package/dist/collection/contracts/async-collection.contract.d.ts +2 -3
  92. package/dist/collection/contracts/async-collection.contract.js +1 -12
  93. package/dist/collection/contracts/async-collection.contract.js.map +1 -1
  94. package/dist/collection/contracts/collection.contract.d.ts +1 -1
  95. package/dist/collection/contracts/collection.errors.d.ts +1 -1
  96. package/dist/collection/contracts/collection.errors.js +3 -6
  97. package/dist/collection/contracts/collection.errors.js.map +1 -1
  98. package/dist/collection/implementations/_shared.d.ts +4 -4
  99. package/dist/collection/implementations/_shared.js +6 -9
  100. package/dist/collection/implementations/_shared.js.map +1 -1
  101. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +2 -2
  102. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -1
  103. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +5 -21
  104. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +12 -8
  105. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  106. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +1 -1
  107. package/dist/collection/implementations/iterable-collection/iterable-collection.js +1 -1
  108. package/dist/collection/implementations/list-collection/list-collection.d.ts +1 -1
  109. package/dist/collection/implementations/list-collection/list-collection.js +1 -1
  110. package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +0 -9
  111. package/dist/event-bus/contracts/event-bus.contract.d.ts +5 -5
  112. package/dist/event-bus/contracts/event-bus.contract.js.map +1 -1
  113. package/dist/event-bus/contracts/event-bus.errors.js +2 -5
  114. package/dist/event-bus/contracts/event-bus.errors.js.map +1 -1
  115. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +9 -29
  116. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +14 -35
  117. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
  118. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -4
  119. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -8
  120. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
  121. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +8 -15
  122. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +15 -34
  123. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  124. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +85 -289
  125. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +128 -325
  126. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  127. package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +13 -0
  128. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +42 -0
  129. package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -0
  130. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +103 -86
  131. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +135 -77
  132. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  133. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +2 -48
  134. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +31 -122
  135. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
  136. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +2 -50
  137. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +41 -89
  138. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  139. package/dist/lock/contracts/database-lock-adapter.contract.d.ts +0 -9
  140. package/dist/lock/contracts/lock-adapter.contract.d.ts +0 -9
  141. package/dist/lock/contracts/lock-provider.contract.d.ts +20 -6
  142. package/dist/lock/contracts/lock.contract.d.ts +37 -8
  143. package/dist/lock/contracts/lock.errors.js +2 -5
  144. package/dist/lock/contracts/lock.errors.js.map +1 -1
  145. package/dist/lock/contracts/lock.events.js +2 -5
  146. package/dist/lock/contracts/lock.events.js.map +1 -1
  147. package/dist/lock/implementations/adapters/_module-exports.d.ts +1 -0
  148. package/dist/lock/implementations/adapters/_module-exports.js +1 -0
  149. package/dist/lock/implementations/adapters/_module-exports.js.map +1 -1
  150. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +0 -5
  151. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -21
  152. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
  153. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +11 -16
  154. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +11 -20
  155. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js.map +1 -1
  156. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +7 -26
  157. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +7 -35
  158. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
  159. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +13 -20
  160. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +13 -37
  161. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
  162. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.d.ts +1 -0
  163. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js +2 -0
  164. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js.map +1 -0
  165. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +17 -0
  166. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +24 -0
  167. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -0
  168. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +4 -22
  169. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +4 -31
  170. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
  171. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +14 -20
  172. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +12 -21
  173. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js.map +1 -1
  174. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +0 -2
  175. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +2 -8
  176. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
  177. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +1 -5
  178. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
  179. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +181 -369
  180. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +259 -407
  181. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  182. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +15 -17
  183. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +42 -40
  184. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
  185. package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +3 -3
  186. package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
  187. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +194 -680
  188. package/dist/lock/implementations/derivables/lock-provider/lock.js +284 -744
  189. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  190. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +106 -143
  191. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +173 -101
  192. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
  193. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +4 -5
  194. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +172 -247
  195. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
  196. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +5 -8
  197. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +93 -98
  198. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
  199. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -20
  200. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +295 -145
  201. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
  202. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +1 -2
  203. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +1 -1
  204. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +3 -2
  205. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -1
  206. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js.map +1 -1
  207. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +1 -2
  208. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +1 -1
  209. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +1 -2
  210. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +1 -1
  211. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +2 -2
  212. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +2 -2
  213. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
  214. package/dist/serde/implementations/derivables/serde.d.ts +14 -14
  215. package/dist/serde/implementations/derivables/serde.js +14 -15
  216. package/dist/serde/implementations/derivables/serde.js.map +1 -1
  217. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +4 -4
  218. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +3 -3
  219. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +5 -5
  220. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +4 -4
  221. package/dist/utilities/_module-exports.d.ts +2 -3
  222. package/dist/utilities/_module-exports.js +2 -3
  223. package/dist/utilities/_module-exports.js.map +1 -1
  224. package/dist/utilities/classes/_module.d.ts +4 -0
  225. package/dist/utilities/classes/_module.js +5 -0
  226. package/dist/utilities/classes/_module.js.map +1 -0
  227. package/dist/utilities/classes/key-prefixer/_module.d.ts +2 -0
  228. package/dist/utilities/classes/key-prefixer/_module.js +3 -0
  229. package/dist/utilities/classes/key-prefixer/_module.js.map +1 -0
  230. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.d.ts +28 -0
  231. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js +5 -0
  232. package/dist/utilities/classes/key-prefixer/key-prefixer.contract.js.map +1 -0
  233. package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +73 -0
  234. package/dist/utilities/classes/key-prefixer/key-prefixer.js +135 -0
  235. package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -0
  236. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +1 -0
  237. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +2 -0
  238. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +1 -0
  239. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -0
  240. package/dist/utilities/classes/pipeline/_module.d.ts +1 -0
  241. package/dist/utilities/classes/pipeline/_module.js +2 -0
  242. package/dist/utilities/classes/pipeline/_module.js.map +1 -0
  243. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.d.ts +3 -2
  244. package/dist/utilities/{pipeline → classes/pipeline}/pipeline.js +3 -2
  245. package/dist/utilities/classes/pipeline/pipeline.js.map +1 -0
  246. package/dist/utilities/classes/time-span/_module.d.ts +1 -0
  247. package/dist/utilities/classes/time-span/_module.js +2 -0
  248. package/dist/utilities/classes/time-span/_module.js.map +1 -0
  249. package/dist/utilities/{time-span → classes/time-span}/time-span.d.ts +2 -1
  250. package/dist/utilities/{time-span → classes/time-span}/time-span.js +1 -0
  251. package/dist/utilities/classes/time-span/time-span.js.map +1 -0
  252. package/dist/utilities/{_constants.d.ts → constants.d.ts} +0 -3
  253. package/dist/utilities/constants.js +5 -0
  254. package/dist/utilities/constants.js.map +1 -0
  255. package/dist/utilities/contracts/_module.d.ts +3 -1
  256. package/dist/utilities/contracts/_module.js +3 -1
  257. package/dist/utilities/contracts/_module.js.map +1 -1
  258. package/dist/utilities/contracts/prunable.contract.d.ts +11 -0
  259. package/dist/utilities/contracts/prunable.contract.js +5 -0
  260. package/dist/utilities/contracts/prunable.contract.js.map +1 -0
  261. package/dist/utilities/contracts/sqlite-database.contract.d.ts +26 -0
  262. package/dist/utilities/contracts/sqlite-database.contract.js +5 -0
  263. package/dist/utilities/contracts/sqlite-database.contract.js.map +1 -0
  264. package/dist/utilities/functions.d.ts +34 -2
  265. package/dist/utilities/functions.js +72 -4
  266. package/dist/utilities/functions.js.map +1 -1
  267. package/dist/utilities/types.d.ts +49 -16
  268. package/package.json +14 -13
  269. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js +0 -2
  270. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/_module.js.map +0 -1
  271. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +0 -61
  272. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +0 -318
  273. package/dist/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +0 -1
  274. package/dist/utilities/_constants.js +0 -8
  275. package/dist/utilities/_constants.js.map +0 -1
  276. package/dist/utilities/kysely/_module.d.ts +0 -1
  277. package/dist/utilities/kysely/_module.js +0 -2
  278. package/dist/utilities/kysely/_module.js.map +0 -1
  279. package/dist/utilities/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
  280. package/dist/utilities/pipeline/_module.d.ts +0 -1
  281. package/dist/utilities/pipeline/_module.js +0 -2
  282. package/dist/utilities/pipeline/_module.js.map +0 -1
  283. package/dist/utilities/pipeline/pipeline.js.map +0 -1
  284. package/dist/utilities/time-span/_module.d.ts +0 -1
  285. package/dist/utilities/time-span/_module.js +0 -2
  286. package/dist/utilities/time-span/_module.js.map +0 -1
  287. package/dist/utilities/time-span/time-span.js.map +0 -1
  288. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.d.ts +0 -0
  289. /package/dist/utilities/{kysely → classes/kysely-table-name-transformer-plugin}/kysely-table-name-transformer-plugin.js +0 -0
@@ -4,52 +4,32 @@
4
4
  import { type InvokableFn } from "../../../../utilities/_module-exports.js";
5
5
  import type { BaseEvent, IEventBusAdapter } from "../../../../event-bus/contracts/_module-exports.js";
6
6
  import { EventEmitter } from "node:events";
7
- /**
8
- *
9
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
10
- * @group Adapters
11
- */
12
- export type MemoryEventBusAdapterSettings = {
13
- rootGroup: string;
14
- eventEmitter?: EventEmitter;
15
- };
16
7
  /**
17
8
  * To utilize the <i>MemoryEventBusAdapter</i>, you must create instance of it.
18
9
  *
19
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
10
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
20
11
  * @group Adapters
21
12
  */
22
13
  export declare class MemoryEventBusAdapter implements IEventBusAdapter {
23
- private readonly group;
24
14
  private readonly eventEmitter;
25
15
  /**
26
- * @example
16
+ * @example
27
17
  * ```ts
28
- * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
29
- * import { EventEmitter } from "node:events";
18
+ * import { MemoryEventBus } from "@daiso-tech/core/event-bus/adapters";
30
19
  *
31
- * const eventEmitter = new EventEmitter();
32
- * const eventBusAdapter = new MemoryEventBusAdapter({
33
- * eventEmitter
34
- * });
20
+ * const eventBusAdapter = new MemoryEventBus();
35
21
  * ```
36
- * You can also provide an <i>EVentEmitter</i>.
22
+ * You can also provide an <i>{@link EventEmitter}</i> that will be used for storing the data.
37
23
  * @example
38
24
  * ```ts
39
- * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
25
+ * import { MemoryEventBus } from "@daiso-tech/core/event-bus/adapters";
40
26
  * import { EventEmitter } from "node:events";
41
27
  *
42
- * const eventEmitter = new EventEmitter();
43
- * const eventBusAdapter = new MemoryEventBusAdapter({
44
- * rootGroup: "@global",
45
- * eventEmitter
46
- * });
28
+ * const eventEmitter = new EventEmitter<any, any>();
29
+ * const eventBusAdapter = new MemoryEventBus(eventEmitter);
47
30
  * ```
48
31
  */
49
- constructor(settings: MemoryEventBusAdapterSettings);
50
- getGroup(): string;
51
- withGroup(group: string): IEventBusAdapter;
52
- private withPrefix;
32
+ constructor(eventEmitter?: EventEmitter);
53
33
  addListener(eventName: string, listener: InvokableFn<BaseEvent>): Promise<void>;
54
34
  removeListener(eventName: string, listener: InvokableFn<BaseEvent>): Promise<void>;
55
35
  dispatch(eventName: string, eventData: BaseEvent): Promise<void>;
@@ -1,71 +1,50 @@
1
1
  /**
2
2
  * @module EventBus
3
3
  */
4
- import { resolveOneOrMoreStr, } from "../../../../utilities/_module-exports.js";
4
+ import {} from "../../../../utilities/_module-exports.js";
5
5
  import { EventEmitter } from "node:events";
6
6
  /**
7
7
  * To utilize the <i>MemoryEventBusAdapter</i>, you must create instance of it.
8
8
  *
9
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
9
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
10
10
  * @group Adapters
11
11
  */
12
12
  export class MemoryEventBusAdapter {
13
- group;
14
13
  eventEmitter;
15
14
  /**
16
- * @example
15
+ * @example
17
16
  * ```ts
18
- * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
19
- * import { EventEmitter } from "node:events";
17
+ * import { MemoryEventBus } from "@daiso-tech/core/event-bus/adapters";
20
18
  *
21
- * const eventEmitter = new EventEmitter();
22
- * const eventBusAdapter = new MemoryEventBusAdapter({
23
- * eventEmitter
24
- * });
19
+ * const eventBusAdapter = new MemoryEventBus();
25
20
  * ```
26
- * You can also provide an <i>EVentEmitter</i>.
21
+ * You can also provide an <i>{@link EventEmitter}</i> that will be used for storing the data.
27
22
  * @example
28
23
  * ```ts
29
- * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
24
+ * import { MemoryEventBus } from "@daiso-tech/core/event-bus/adapters";
30
25
  * import { EventEmitter } from "node:events";
31
26
  *
32
- * const eventEmitter = new EventEmitter();
33
- * const eventBusAdapter = new MemoryEventBusAdapter({
34
- * rootGroup: "@global",
35
- * eventEmitter
36
- * });
27
+ * const eventEmitter = new EventEmitter<any, any>();
28
+ * const eventBusAdapter = new MemoryEventBus(eventEmitter);
37
29
  * ```
38
30
  */
39
- constructor(settings) {
40
- const { rootGroup, eventEmitter = new EventEmitter() } = settings;
31
+ constructor(eventEmitter = new EventEmitter()) {
32
+ this.eventEmitter = eventEmitter;
41
33
  this.eventEmitter = eventEmitter;
42
- this.group = rootGroup;
43
- }
44
- getGroup() {
45
- return this.group;
46
- }
47
- withGroup(group) {
48
- return new MemoryEventBusAdapter({
49
- rootGroup: resolveOneOrMoreStr([this.group, group]),
50
- eventEmitter: this.eventEmitter,
51
- });
52
- }
53
- withPrefix(event) {
54
- return resolveOneOrMoreStr([this.group, event]);
55
34
  }
56
35
  // eslint-disable-next-line @typescript-eslint/require-await
57
36
  async addListener(eventName, listener) {
58
37
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
59
- this.eventEmitter.on(this.withPrefix(eventName), listener);
38
+ this.eventEmitter.on(eventName, listener);
60
39
  }
61
40
  // eslint-disable-next-line @typescript-eslint/require-await
62
41
  async removeListener(eventName, listener) {
63
42
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
64
- this.eventEmitter.off(this.withPrefix(eventName), listener);
43
+ this.eventEmitter.off(eventName, listener);
65
44
  }
66
45
  // eslint-disable-next-line @typescript-eslint/require-await
67
46
  async dispatch(eventName, eventData) {
68
- this.eventEmitter.emit(this.withPrefix(eventName), eventData);
47
+ this.eventEmitter.emit(eventName, eventData);
69
48
  }
70
49
  }
71
50
  //# sourceMappingURL=memory-event-bus-adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,mBAAmB,GAEtB,MAAM,gCAAgC,CAAC;AAKxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAY3C;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IACb,KAAK,CAAS;IACd,YAAY,CAAe;IAE5C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,YAAY,QAAuC;QAC/C,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI,YAAY,EAAE,EAAE,GAAG,QAAQ,CAAC;QAClE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,KAAa;QACnB,OAAO,IAAI,qBAAqB,CAAC;YAC7B,SAAS,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACnD,YAAY,EAAE,IAAI,CAAC,YAAY;SAClC,CAAC,CAAC;IACP,CAAC;IAEO,UAAU,CAAC,KAAa;QAC5B,OAAO,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,WAAW,CACb,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IAChE,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAoB;QAClD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;IAClE,CAAC;CACJ"}
1
+ {"version":3,"file":"memory-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAoB,MAAM,gCAAgC,CAAC;AAKlE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IAmBT;IAlBrB;;;;;;;;;;;;;;;;OAgBG;IACH,YACqB,eAA6B,IAAI,YAAY,EAAE;QAA/C,iBAAY,GAAZ,YAAY,CAAmC;QAEhE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,WAAW,CACb,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAoB;QAClD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjD,CAAC;CACJ"}
@@ -5,14 +5,12 @@ import type { BaseEvent } from "../../../../event-bus/contracts/_module-exports.
5
5
  import type { IEventBusAdapter } from "../../../../event-bus/contracts/_module-exports.js";
6
6
  import type { InvokableFn } from "../../../../utilities/types.js";
7
7
  /**
8
- * This <i>NoOpEventBusAdapter</i> will do nothing and is used for easily mocking {@link IEventBus} for testing.
8
+ * This <i>NoOpEventBusAdapter</i> will do nothing and is used for easily mocking <i>{@link IEventBus}</i> for testing.
9
9
  *
10
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
10
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
11
11
  * @group Adapters
12
12
  */
13
13
  export declare class NoOpEventBusAdapter implements IEventBusAdapter {
14
- getGroup(): string;
15
- withGroup(_group: string): IEventBusAdapter;
16
14
  addListener(_eventName: string, _listener: InvokableFn<BaseEvent>): PromiseLike<void>;
17
15
  removeListener(_eventName: string, _listener: InvokableFn<BaseEvent>): PromiseLike<void>;
18
16
  dispatch(_eventName: string, _eventData: BaseEvent): PromiseLike<void>;
@@ -2,18 +2,12 @@
2
2
  * @module EventBus
3
3
  */
4
4
  /**
5
- * This <i>NoOpEventBusAdapter</i> will do nothing and is used for easily mocking {@link IEventBus} for testing.
5
+ * This <i>NoOpEventBusAdapter</i> will do nothing and is used for easily mocking <i>{@link IEventBus}</i> for testing.
6
6
  *
7
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
7
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
8
8
  * @group Adapters
9
9
  */
10
10
  export class NoOpEventBusAdapter {
11
- getGroup() {
12
- return "";
13
- }
14
- withGroup(_group) {
15
- return new NoOpEventBusAdapter();
16
- }
17
11
  addListener(_eventName, _listener) {
18
12
  return Promise.resolve();
19
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"no-op-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAC5B,QAAQ;QACJ,OAAO,EAAE,CAAC;IACd,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACrC,CAAC;IAED,WAAW,CACP,UAAkB,EAClB,SAAiC;QAEjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,cAAc,CACV,UAAkB,EAClB,SAAiC;QAEjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,UAAkB,EAAE,UAAqB;QAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ"}
1
+ {"version":3,"file":"no-op-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IAC5B,WAAW,CACP,UAAkB,EAClB,SAAiC;QAEjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,cAAc,CACV,UAAkB,EAClB,SAAiC;QAEjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,UAAkB,EAAE,UAAqB;QAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ"}
@@ -7,34 +7,31 @@ import type { Redis } from "ioredis";
7
7
  import { type InvokableFn } from "../../../../utilities/_module-exports.js";
8
8
  /**
9
9
  *
10
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
10
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
11
11
  * @group Adapters
12
12
  */
13
13
  export type RedisPubSubEventBusAdapterSettings = {
14
14
  dispatcherClient: Redis;
15
15
  listenerClient: Redis;
16
16
  serde: ISerde<string>;
17
- rootGroup: string;
18
17
  };
19
18
  /**
20
19
  * To utilize the <i>RedisPubSubEventBusAdapter</i>, you must install the <i>"ioredis"</i> package and supply a <i>{@link ISerde | ISerde<string> }</i>, with a <i>{@link SuperJsonSerdeAdapter}</i>.
21
20
  *
22
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
21
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
23
22
  * @group Adapters
24
23
  */
25
24
  export declare class RedisPubSubEventBusAdapter implements IEventBusAdapter {
26
- private readonly group;
27
- private readonly baseSerde;
28
- private readonly redisSerde;
25
+ private readonly serde;
29
26
  private readonly dispatcherClient;
30
27
  private readonly listenerClient;
31
28
  private readonly eventEmitter;
32
29
  /**
33
- * @example
30
+ * @example
34
31
  * ```ts
35
- * import { RedisPubSubEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
36
- * import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
37
- * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
32
+ * import { RedisPubSubEventBusAdapter } from "@daiso-tech/core/event-bus/adapters";
33
+ * import { Serde } from "@daiso-tech/core/serde";
34
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters"
38
35
  * import Redis from "ioredis";
39
36
  *
40
37
  * const dispatcherClient = new Redis("YOUR_REDIS_CONNECTION_STRING");
@@ -44,14 +41,10 @@ export declare class RedisPubSubEventBusAdapter implements IEventBusAdapter {
44
41
  * dispatcherClient,
45
42
  * listenerClient,
46
43
  * serde,
47
- * rootGroup: "@global"
48
44
  * });
49
45
  * ```
50
46
  */
51
- constructor({ dispatcherClient, listenerClient, serde, rootGroup, }: RedisPubSubEventBusAdapterSettings);
52
- getGroup(): string;
53
- withGroup(group: string): IEventBusAdapter;
54
- private withPrefix;
47
+ constructor({ dispatcherClient, listenerClient, serde, }: RedisPubSubEventBusAdapterSettings);
55
48
  private redisListener;
56
49
  addListener(eventName: string, listener: InvokableFn<BaseEvent>): Promise<void>;
57
50
  removeListener(eventName: string, listener: InvokableFn<BaseEvent>): Promise<void>;
@@ -6,26 +6,24 @@ import { RedisSerde,
6
6
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
7
  SuperJsonSerdeAdapter, } from "../../../../serde/implementations/adapters/_module-exports.js";
8
8
  import { EventEmitter } from "node:events";
9
- import { resolveOneOrMoreStr, } from "../../../../utilities/_module-exports.js";
9
+ import {} from "../../../../utilities/_module-exports.js";
10
10
  /**
11
11
  * To utilize the <i>RedisPubSubEventBusAdapter</i>, you must install the <i>"ioredis"</i> package and supply a <i>{@link ISerde | ISerde<string> }</i>, with a <i>{@link SuperJsonSerdeAdapter}</i>.
12
12
  *
13
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/implementations/adapters"```
13
+ * IMPORT_PATH: ```"@daiso-tech/core/event-bus/adapters"```
14
14
  * @group Adapters
15
15
  */
16
16
  export class RedisPubSubEventBusAdapter {
17
- group;
18
- baseSerde;
19
- redisSerde;
17
+ serde;
20
18
  dispatcherClient;
21
19
  listenerClient;
22
20
  eventEmitter = new EventEmitter();
23
21
  /**
24
- * @example
22
+ * @example
25
23
  * ```ts
26
- * import { RedisPubSubEventBusAdapter } from "@daiso-tech/core/event-bus/implementations/adapters";
27
- * import { Serde } from "@daiso-tech/core/serde/implementations/derivables";
28
- * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/implementations/adapters";
24
+ * import { RedisPubSubEventBusAdapter } from "@daiso-tech/core/event-bus/adapters";
25
+ * import { Serde } from "@daiso-tech/core/serde";
26
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters"
29
27
  * import Redis from "ioredis";
30
28
  *
31
29
  * const dispatcherClient = new Redis("YOUR_REDIS_CONNECTION_STRING");
@@ -35,48 +33,31 @@ export class RedisPubSubEventBusAdapter {
35
33
  * dispatcherClient,
36
34
  * listenerClient,
37
35
  * serde,
38
- * rootGroup: "@global"
39
36
  * });
40
37
  * ```
41
38
  */
42
- constructor({ dispatcherClient, listenerClient, serde, rootGroup, }) {
43
- this.group = rootGroup;
39
+ constructor({ dispatcherClient, listenerClient, serde, }) {
44
40
  this.dispatcherClient = dispatcherClient;
45
41
  this.listenerClient = listenerClient;
46
- this.baseSerde = serde;
47
- this.redisSerde = new RedisSerde(serde);
48
- }
49
- getGroup() {
50
- return this.group;
51
- }
52
- withGroup(group) {
53
- return new RedisPubSubEventBusAdapter({
54
- listenerClient: this.listenerClient,
55
- dispatcherClient: this.dispatcherClient,
56
- serde: this.baseSerde,
57
- rootGroup: resolveOneOrMoreStr([this.group, group]),
58
- });
59
- }
60
- withPrefix(eventName) {
61
- return resolveOneOrMoreStr([this.group, eventName]);
42
+ this.serde = new RedisSerde(serde);
62
43
  }
63
44
  redisListener = (channel, message) => {
64
- this.eventEmitter.emit(channel, this.redisSerde.deserialize(message));
45
+ this.eventEmitter.emit(channel, this.serde.deserialize(message));
65
46
  };
66
47
  async addListener(eventName, listener) {
67
48
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
68
- this.eventEmitter.on(this.withPrefix(eventName), listener);
69
- await this.listenerClient.subscribe(this.withPrefix(eventName));
49
+ this.eventEmitter.on(eventName, listener);
50
+ await this.listenerClient.subscribe(eventName);
70
51
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
71
52
  this.listenerClient.on("message", this.redisListener);
72
53
  }
73
54
  async removeListener(eventName, listener) {
74
55
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
75
- this.eventEmitter.off(this.withPrefix(eventName), listener);
76
- await this.listenerClient.unsubscribe(this.withPrefix(eventName));
56
+ this.eventEmitter.off(eventName, listener);
57
+ await this.listenerClient.unsubscribe(eventName);
77
58
  }
78
59
  async dispatch(eventName, eventData) {
79
- await this.dispatcherClient.publish(this.withPrefix(eventName), this.redisSerde.serialize(eventData));
60
+ await this.dispatcherClient.publish(eventName, this.serde.serialize(eventData));
80
61
  }
81
62
  }
82
63
  //# sourceMappingURL=redis-pub-sub-event-bus-adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis-pub-sub-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,EACH,UAAU;AACV,6DAA6D;AAC7D,qBAAqB,GACxB,MAAM,qDAAqD,CAAC;AAM7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACH,mBAAmB,GAEtB,MAAM,gCAAgC,CAAC;AAcxC;;;;;GAKG;AACH,MAAM,OAAO,0BAA0B;IAClB,KAAK,CAAS;IACd,SAAS,CAAiB;IAC1B,UAAU,CAAiB;IAC3B,gBAAgB,CAAQ;IACxB,cAAc,CAAQ;IACtB,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IAEnD;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,EACR,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,SAAS,GACwB;QACjC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,KAAa;QACnB,OAAO,IAAI,0BAA0B,CAAC;YAClC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,KAAK,EAAE,IAAI,CAAC,SAAS;YACrB,SAAS,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACtD,CAAC,CAAC;IACP,CAAC;IAEO,UAAU,CAAC,SAAiB;QAChC,OAAO,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IACxD,CAAC;IAEO,aAAa,GAAG,CAAC,OAAe,EAAE,OAAe,EAAQ,EAAE;QAC/D,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC;IAEF,KAAK,CAAC,WAAW,CACb,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE3D,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QAEhE,kEAAkE;QAClE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE5D,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAoB;QAClD,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAC/B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAC1B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CACvC,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"redis-pub-sub-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,EACH,UAAU;AACV,6DAA6D;AAC7D,qBAAqB,GACxB,MAAM,qDAAqD,CAAC;AAM7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAoB,MAAM,gCAAgC,CAAC;AAalE;;;;;GAKG;AACH,MAAM,OAAO,0BAA0B;IAClB,KAAK,CAAiB;IACtB,gBAAgB,CAAQ;IACxB,cAAc,CAAQ;IACtB,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IAEnD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,EACR,gBAAgB,EAChB,cAAc,EACd,KAAK,GAC4B;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAEO,aAAa,GAAG,CAAC,OAAe,EAAE,OAAe,EAAQ,EAAE;QAC/D,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IAEF,KAAK,CAAC,WAAW,CACb,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE1C,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAE/C,kEAAkE;QAClE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAAgC;QAEhC,kEAAkE;QAClE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE3C,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,SAAoB;QAClD,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAC/B,SAAS,EACT,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAClC,CAAC;IACN,CAAC;CACJ"}