@daiso-tech/core 0.33.0 → 0.35.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 (365) hide show
  1. package/README.md +66 -45
  2. package/dist/async/_module-exports.d.ts +1 -1
  3. package/dist/async/_module-exports.js +1 -1
  4. package/dist/async/_module-exports.js.map +1 -1
  5. package/dist/async/async.errors.d.ts +27 -19
  6. package/dist/async/async.errors.js +33 -20
  7. package/dist/async/async.errors.js.map +1 -1
  8. package/dist/async/backof-policies/_shared.d.ts +6 -2
  9. package/dist/async/backof-policies/_shared.js +1 -0
  10. package/dist/async/backof-policies/_shared.js.map +1 -1
  11. package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +2 -2
  12. package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
  13. package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
  14. package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
  15. package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +2 -2
  16. package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
  17. package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
  18. package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
  19. package/dist/async/middlewares/_module.d.ts +8 -0
  20. package/dist/async/middlewares/_module.js +9 -0
  21. package/dist/async/middlewares/_module.js.map +1 -0
  22. package/dist/async/middlewares/_shared.d.ts +10 -0
  23. package/dist/async/middlewares/_shared.js +5 -0
  24. package/dist/async/middlewares/_shared.js.map +1 -0
  25. package/dist/async/middlewares/bulkhead/_module.d.ts +1 -0
  26. package/dist/async/middlewares/bulkhead/_module.js +2 -0
  27. package/dist/async/middlewares/bulkhead/_module.js.map +1 -0
  28. package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +80 -0
  29. package/dist/async/middlewares/bulkhead/bulkhead.middleware.js +46 -0
  30. package/dist/async/middlewares/bulkhead/bulkhead.middleware.js.map +1 -0
  31. package/dist/async/middlewares/dynamic/_module.d.ts +1 -0
  32. package/dist/async/middlewares/dynamic/_module.js +2 -0
  33. package/dist/async/middlewares/dynamic/_module.js.map +1 -0
  34. package/dist/async/middlewares/dynamic/dynamic.middleware.d.ts +34 -0
  35. package/dist/async/middlewares/dynamic/dynamic.middleware.js +36 -0
  36. package/dist/async/middlewares/dynamic/dynamic.middleware.js.map +1 -0
  37. package/dist/async/middlewares/fallback/_module.d.ts +1 -0
  38. package/dist/async/middlewares/fallback/_module.js +2 -0
  39. package/dist/async/middlewares/fallback/_module.js.map +1 -0
  40. package/dist/async/middlewares/fallback/fallback.middleware.d.ts +78 -0
  41. package/dist/async/middlewares/fallback/fallback.middleware.js +52 -0
  42. package/dist/async/middlewares/fallback/fallback.middleware.js.map +1 -0
  43. package/dist/async/middlewares/hedging/_module.d.ts +2 -0
  44. package/dist/async/middlewares/hedging/_module.js +3 -0
  45. package/dist/async/middlewares/hedging/_module.js.map +1 -0
  46. package/dist/async/middlewares/hedging/_shared.d.ts +93 -0
  47. package/dist/async/middlewares/hedging/_shared.js +5 -0
  48. package/dist/async/middlewares/hedging/_shared.js.map +1 -0
  49. package/dist/async/middlewares/hedging/concurrent-hedging/_module.d.ts +1 -0
  50. package/dist/async/middlewares/hedging/concurrent-hedging/_module.js +2 -0
  51. package/dist/async/middlewares/hedging/concurrent-hedging/_module.js.map +1 -0
  52. package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.d.ts +51 -0
  53. package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js +138 -0
  54. package/dist/async/middlewares/hedging/concurrent-hedging/concurrent-hedging.middleware.js.map +1 -0
  55. package/dist/async/middlewares/hedging/sequential-hedging/_module.d.ts +1 -0
  56. package/dist/async/middlewares/hedging/sequential-hedging/_module.js +2 -0
  57. package/dist/async/middlewares/hedging/sequential-hedging/_module.js.map +1 -0
  58. package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.d.ts +51 -0
  59. package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js +104 -0
  60. package/dist/async/middlewares/hedging/sequential-hedging/sequential-hedging.middleware.js.map +1 -0
  61. package/dist/async/middlewares/observe/_module.d.ts +1 -0
  62. package/dist/async/middlewares/observe/_module.js +2 -0
  63. package/dist/async/middlewares/observe/_module.js.map +1 -0
  64. package/dist/async/middlewares/observe/observe.middleware.d.ts +130 -0
  65. package/dist/async/middlewares/observe/observe.middleware.js +80 -0
  66. package/dist/async/middlewares/observe/observe.middleware.js.map +1 -0
  67. package/dist/async/middlewares/retry/_module.d.ts +1 -0
  68. package/dist/async/middlewares/retry/_module.js +2 -0
  69. package/dist/async/middlewares/retry/_module.js.map +1 -0
  70. package/dist/async/middlewares/retry/retry.middleware.d.ts +117 -0
  71. package/dist/async/middlewares/retry/retry.middleware.js +82 -0
  72. package/dist/async/middlewares/retry/retry.middleware.js.map +1 -0
  73. package/dist/async/middlewares/timeout/_module.d.ts +1 -0
  74. package/dist/async/middlewares/timeout/_module.js +2 -0
  75. package/dist/async/middlewares/timeout/_module.js.map +1 -0
  76. package/dist/async/middlewares/timeout/timeout.middleware.d.ts +83 -0
  77. package/dist/async/middlewares/timeout/timeout.middleware.js +60 -0
  78. package/dist/async/middlewares/timeout/timeout.middleware.js.map +1 -0
  79. package/dist/async/utilities/_module.d.ts +3 -4
  80. package/dist/async/utilities/_module.js +3 -4
  81. package/dist/async/utilities/_module.js.map +1 -1
  82. package/dist/async/utilities/abort-and-fail/_module.d.ts +1 -0
  83. package/dist/async/utilities/abort-and-fail/_module.js +2 -0
  84. package/dist/async/utilities/abort-and-fail/_module.js.map +1 -0
  85. package/dist/async/utilities/abort-and-fail/abort-and-fail.d.ts +7 -0
  86. package/dist/async/utilities/{abort → abort-and-fail}/abort-and-fail.js +6 -6
  87. package/dist/async/utilities/abort-and-fail/abort-and-fail.js.map +1 -0
  88. package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +37 -194
  89. package/dist/async/utilities/lazy-promise/lazy-promise.js +62 -359
  90. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +1 -1
  91. package/dist/async/utilities/promise-queue/_module.d.ts +1 -0
  92. package/dist/async/utilities/promise-queue/_module.js +2 -0
  93. package/dist/async/utilities/promise-queue/_module.js.map +1 -0
  94. package/dist/async/utilities/promise-queue/promise-queue.d.ts +32 -0
  95. package/dist/async/utilities/promise-queue/promise-queue.js +107 -0
  96. package/dist/async/utilities/promise-queue/promise-queue.js.map +1 -0
  97. package/dist/async/utilities/timeout-and-fail/_module.d.ts +1 -0
  98. package/dist/async/utilities/timeout-and-fail/_module.js +2 -0
  99. package/dist/async/utilities/timeout-and-fail/_module.js.map +1 -0
  100. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.d.ts +7 -0
  101. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js +19 -0
  102. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js.map +1 -0
  103. package/dist/cache/contracts/cache-adapter.contract.d.ts +14 -14
  104. package/dist/cache/contracts/cache-factory.contract.d.ts +3 -3
  105. package/dist/cache/contracts/cache.contract.d.ts +73 -73
  106. package/dist/cache/contracts/cache.errors.d.ts +7 -7
  107. package/dist/cache/contracts/cache.errors.js +7 -7
  108. package/dist/cache/contracts/cache.events.d.ts +54 -58
  109. package/dist/cache/contracts/cache.events.js +6 -104
  110. package/dist/cache/contracts/cache.events.js.map +1 -1
  111. package/dist/cache/contracts/database-cache-adapter.contract.d.ts +16 -16
  112. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +3 -3
  113. package/dist/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +2 -2
  114. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +3 -9
  115. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +3 -9
  116. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  117. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +4 -4
  118. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +3 -3
  119. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +2 -2
  120. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +2 -2
  121. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +3 -3
  122. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +2 -2
  123. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +3 -3
  124. package/dist/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +2 -2
  125. package/dist/cache/implementations/derivables/cache/cache.d.ts +26 -27
  126. package/dist/cache/implementations/derivables/cache/cache.js +102 -91
  127. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  128. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +5 -4
  129. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +2 -1
  130. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  131. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +3 -3
  132. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +2 -2
  133. package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +3 -3
  134. package/dist/cache/implementations/test-utilities/cache.test-suite.js +140 -149
  135. package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
  136. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +3 -3
  137. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +2 -2
  138. package/dist/collection/contracts/_shared/compartor.type.d.ts +1 -1
  139. package/dist/collection/contracts/_shared/cross-join-result.type.d.ts +1 -1
  140. package/dist/collection/contracts/_shared/ensure-map.type.d.ts +1 -1
  141. package/dist/collection/contracts/_shared/ensure-record.type.d.ts +1 -1
  142. package/dist/collection/contracts/_shared/foreach.type.d.ts +2 -2
  143. package/dist/collection/contracts/_shared/map.type.d.ts +2 -2
  144. package/dist/collection/contracts/_shared/modifier.type.d.ts +2 -2
  145. package/dist/collection/contracts/_shared/predicate.type.d.ts +7 -7
  146. package/dist/collection/contracts/_shared/reduce.type.d.ts +2 -2
  147. package/dist/collection/contracts/_shared/tap.type.d.ts +2 -2
  148. package/dist/collection/contracts/_shared/transform.type.d.ts +2 -2
  149. package/dist/collection/contracts/async-collection.contract.d.ts +109 -198
  150. package/dist/collection/contracts/collection.contract.d.ts +103 -103
  151. package/dist/collection/contracts/collection.errors.d.ts +11 -11
  152. package/dist/collection/contracts/collection.errors.js +11 -11
  153. package/dist/collection/implementations/_shared.d.ts +8 -8
  154. package/dist/collection/implementations/_shared.js +8 -8
  155. package/dist/collection/implementations/async-iterable-collection/_shared/_module.d.ts +0 -4
  156. package/dist/collection/implementations/async-iterable-collection/_shared/_module.js +0 -4
  157. package/dist/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
  158. package/dist/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js +21 -19
  159. package/dist/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.js.map +1 -1
  160. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +15 -19
  161. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +15 -30
  162. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  163. package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.d.ts +3 -3
  164. package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.js +18 -20
  165. package/dist/collection/implementations/iterable-collection/_shared/cross-join-iterable.js.map +1 -1
  166. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +11 -12
  167. package/dist/collection/implementations/iterable-collection/iterable-collection.js +11 -12
  168. package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  169. package/dist/collection/implementations/list-collection/list-collection.d.ts +11 -11
  170. package/dist/collection/implementations/list-collection/list-collection.js +24 -30
  171. package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
  172. package/dist/event-bus/contracts/_module-exports.d.ts +0 -1
  173. package/dist/event-bus/contracts/_module-exports.js +0 -1
  174. package/dist/event-bus/contracts/_module-exports.js.map +1 -1
  175. package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +13 -8
  176. package/dist/event-bus/contracts/event-bus-factory.contract.d.ts +6 -7
  177. package/dist/event-bus/contracts/event-bus-factory.contract.js.map +1 -1
  178. package/dist/event-bus/contracts/event-bus.contract.d.ts +30 -41
  179. package/dist/event-bus/contracts/event-bus.errors.d.ts +8 -8
  180. package/dist/event-bus/contracts/event-bus.errors.js +8 -8
  181. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +3 -3
  182. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +3 -3
  183. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +2 -2
  184. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +2 -2
  185. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +3 -3
  186. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +2 -2
  187. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +15 -15
  188. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +32 -32
  189. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  190. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +17 -10
  191. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +13 -6
  192. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  193. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.d.ts +3 -5
  194. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +15 -22
  195. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
  196. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.d.ts +3 -5
  197. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +189 -209
  198. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  199. package/dist/lock/contracts/database-lock-adapter.contract.d.ts +9 -9
  200. package/dist/lock/contracts/lock-adapter.contract.d.ts +7 -7
  201. package/dist/lock/contracts/lock-provider-factory.contract.d.ts +4 -4
  202. package/dist/lock/contracts/lock-provider.contract.d.ts +14 -14
  203. package/dist/lock/contracts/lock.contract.d.ts +22 -22
  204. package/dist/lock/contracts/lock.errors.d.ts +10 -10
  205. package/dist/lock/contracts/lock.errors.js +10 -10
  206. package/dist/lock/contracts/lock.events.d.ts +45 -54
  207. package/dist/lock/contracts/lock.events.js +9 -91
  208. package/dist/lock/contracts/lock.events.js.map +1 -1
  209. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.d.ts +5 -5
  210. package/dist/lock/implementations/adapters/libsql-lock-adapter/libsql-lock-adapter.js +4 -4
  211. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +3 -3
  212. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +3 -3
  213. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +5 -5
  214. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +4 -4
  215. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +2 -2
  216. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +2 -2
  217. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +3 -3
  218. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +3 -3
  219. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.d.ts +5 -5
  220. package/dist/lock/implementations/adapters/sqlite-lock-adapter/sqlite-lock-adapter.js +4 -4
  221. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +33 -33
  222. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +30 -30
  223. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  224. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +2 -2
  225. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
  226. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +3 -3
  227. package/dist/lock/implementations/derivables/lock-provider/lock.js +77 -58
  228. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  229. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +5 -4
  230. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +2 -1
  231. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
  232. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +3 -3
  233. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +2 -2
  234. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +3 -3
  235. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +2 -2
  236. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +3 -3
  237. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +214 -214
  238. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
  239. package/dist/serde/contracts/deserializer.contract.d.ts +2 -2
  240. package/dist/serde/contracts/flexible-serde-adapter.contract.d.ts +4 -4
  241. package/dist/serde/contracts/flexible-serde.contract.d.ts +8 -19
  242. package/dist/serde/contracts/serde.contract.d.ts +2 -2
  243. package/dist/serde/contracts/serde.errors.d.ts +4 -4
  244. package/dist/serde/contracts/serde.errors.js +4 -4
  245. package/dist/serde/contracts/serializable.contract.d.ts +2 -2
  246. package/dist/serde/contracts/serializer.contract.d.ts +2 -2
  247. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +2 -2
  248. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +2 -2
  249. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +1 -1
  250. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +1 -1
  251. package/dist/serde/implementations/derivables/serde.d.ts +4 -35
  252. package/dist/serde/implementations/derivables/serde.js +2 -47
  253. package/dist/serde/implementations/derivables/serde.js.map +1 -1
  254. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +3 -3
  255. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +2 -2
  256. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +3 -3
  257. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +2 -2
  258. package/dist/utilities/classes/_module.d.ts +1 -1
  259. package/dist/utilities/classes/_module.js +1 -1
  260. package/dist/utilities/classes/_module.js.map +1 -1
  261. package/dist/utilities/classes/hooks/_module.d.ts +3 -0
  262. package/dist/utilities/classes/hooks/_module.js +4 -0
  263. package/dist/utilities/classes/hooks/_module.js.map +1 -0
  264. package/dist/utilities/classes/hooks/async-hooks.d.ts +209 -0
  265. package/dist/utilities/classes/hooks/async-hooks.js +145 -0
  266. package/dist/utilities/classes/hooks/async-hooks.js.map +1 -0
  267. package/dist/utilities/classes/hooks/hooks.d.ts +139 -0
  268. package/dist/utilities/classes/hooks/hooks.js +116 -0
  269. package/dist/utilities/classes/hooks/hooks.js.map +1 -0
  270. package/dist/utilities/classes/hooks/types.d.ts +9 -0
  271. package/dist/utilities/classes/hooks/types.js +5 -0
  272. package/dist/utilities/classes/hooks/types.js.map +1 -0
  273. package/dist/utilities/classes/key-prefixer/key-prefixer.d.ts +3 -3
  274. package/dist/utilities/classes/key-prefixer/key-prefixer.js +4 -4
  275. package/dist/utilities/classes/key-prefixer/key-prefixer.js.map +1 -1
  276. package/dist/utilities/classes/time-span/time-span.d.ts +5 -5
  277. package/dist/utilities/classes/time-span/time-span.js +5 -5
  278. package/dist/utilities/contracts/_module.d.ts +0 -1
  279. package/dist/utilities/contracts/_module.js +0 -1
  280. package/dist/utilities/contracts/_module.js.map +1 -1
  281. package/dist/utilities/contracts/deinitizable.contract.d.ts +1 -1
  282. package/dist/utilities/contracts/initizable.contract.d.ts +1 -1
  283. package/dist/utilities/contracts/prunable.contract.d.ts +1 -1
  284. package/dist/utilities/contracts/serialized-error.contract.d.ts +1 -1
  285. package/dist/utilities/contracts/sqlite-database.contract.d.ts +2 -2
  286. package/dist/utilities/errors.d.ts +5 -5
  287. package/dist/utilities/errors.js +5 -5
  288. package/dist/utilities/functions/factory.js +3 -3
  289. package/dist/utilities/functions/factory.js.map +1 -1
  290. package/dist/utilities/functions/invokable.d.ts +9 -5
  291. package/dist/utilities/functions/invokable.js +12 -2
  292. package/dist/utilities/functions/invokable.js.map +1 -1
  293. package/dist/utilities/functions/lazy.d.ts +5 -0
  294. package/dist/utilities/functions/lazy.js +12 -3
  295. package/dist/utilities/functions/lazy.js.map +1 -1
  296. package/dist/utilities/types/async-iterable-value.type.d.ts +1 -1
  297. package/dist/utilities/types/at-least-one.type.d.ts +1 -1
  298. package/dist/utilities/types/factory.type.d.ts +8 -8
  299. package/dist/utilities/types/invokable.type.d.ts +3 -3
  300. package/dist/utilities/types/items.type.d.ts +1 -1
  301. package/dist/utilities/types/lazy.type.d.ts +5 -5
  302. package/dist/utilities/types/none-func.type.d.ts +1 -1
  303. package/dist/utilities/types/one-or-more.type.d.ts +1 -1
  304. package/dist/utilities/types/promiseable.type.d.ts +1 -1
  305. package/dist/utilities/types/result.type.d.ts +1 -1
  306. package/package.json +22 -2
  307. package/dist/async/async.events.d.ts +0 -105
  308. package/dist/async/async.events.js +0 -82
  309. package/dist/async/async.events.js.map +0 -1
  310. package/dist/async/utilities/abort/_module.d.ts +0 -2
  311. package/dist/async/utilities/abort/_module.js +0 -3
  312. package/dist/async/utilities/abort/_module.js.map +0 -1
  313. package/dist/async/utilities/abort/abort-and-fail.d.ts +0 -4
  314. package/dist/async/utilities/abort/abort-and-fail.js.map +0 -1
  315. package/dist/async/utilities/abort/abort.d.ts +0 -9
  316. package/dist/async/utilities/abort/abort.js +0 -18
  317. package/dist/async/utilities/abort/abort.js.map +0 -1
  318. package/dist/async/utilities/delay/_module.d.ts +0 -1
  319. package/dist/async/utilities/delay/_module.js +0 -2
  320. package/dist/async/utilities/delay/_module.js.map +0 -1
  321. package/dist/async/utilities/delay/delay.d.ts +0 -10
  322. package/dist/async/utilities/delay/delay.js +0 -34
  323. package/dist/async/utilities/delay/delay.js.map +0 -1
  324. package/dist/async/utilities/retry/_module.d.ts +0 -2
  325. package/dist/async/utilities/retry/_module.js +0 -3
  326. package/dist/async/utilities/retry/_module.js.map +0 -1
  327. package/dist/async/utilities/retry/retry-or-fail.d.ts +0 -29
  328. package/dist/async/utilities/retry/retry-or-fail.js +0 -39
  329. package/dist/async/utilities/retry/retry-or-fail.js.map +0 -1
  330. package/dist/async/utilities/retry/retry.d.ts +0 -10
  331. package/dist/async/utilities/retry/retry.js +0 -21
  332. package/dist/async/utilities/retry/retry.js.map +0 -1
  333. package/dist/async/utilities/timeout/_module.d.ts +0 -2
  334. package/dist/async/utilities/timeout/_module.js +0 -3
  335. package/dist/async/utilities/timeout/_module.js.map +0 -1
  336. package/dist/async/utilities/timeout/timeout-and-fail.d.ts +0 -5
  337. package/dist/async/utilities/timeout/timeout-and-fail.js +0 -28
  338. package/dist/async/utilities/timeout/timeout-and-fail.js.map +0 -1
  339. package/dist/async/utilities/timeout/timeout.d.ts +0 -10
  340. package/dist/async/utilities/timeout/timeout.js +0 -21
  341. package/dist/async/utilities/timeout/timeout.js.map +0 -1
  342. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.d.ts +0 -13
  343. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +0 -30
  344. package/dist/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +0 -1
  345. package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.d.ts +0 -13
  346. package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +0 -36
  347. package/dist/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +0 -1
  348. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.d.ts +0 -9
  349. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +0 -39
  350. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +0 -1
  351. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.d.ts +0 -13
  352. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +0 -52
  353. package/dist/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +0 -1
  354. package/dist/event-bus/contracts/_shared.d.ts +0 -12
  355. package/dist/event-bus/contracts/_shared.js +0 -15
  356. package/dist/event-bus/contracts/_shared.js.map +0 -1
  357. package/dist/utilities/classes/sync-event-bus/_module.d.ts +0 -1
  358. package/dist/utilities/classes/sync-event-bus/_module.js +0 -2
  359. package/dist/utilities/classes/sync-event-bus/_module.js.map +0 -1
  360. package/dist/utilities/classes/sync-event-bus/sync-event-bus.d.ts +0 -16
  361. package/dist/utilities/classes/sync-event-bus/sync-event-bus.js +0 -53
  362. package/dist/utilities/classes/sync-event-bus/sync-event-bus.js.map +0 -1
  363. package/dist/utilities/contracts/sync-event-bus-listenable.d.ts +0 -13
  364. package/dist/utilities/contracts/sync-event-bus-listenable.js +0 -5
  365. package/dist/utilities/contracts/sync-event-bus-listenable.js.map +0 -1
@@ -1,29 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { TimeSpan } from "../../../utilities/_module-exports.js";
5
- import type { BackoffPolicy } from "../../../async/backof-policies/_module.js";
6
- /**
7
- *
8
- * IMPORT_PATH: ```"@daiso-tech/core/async"```
9
- * @group Utilities
10
- */
11
- export type RetryPolicy = (error: unknown) => boolean;
12
- /**
13
- *
14
- * IMPORT_PATH: ```"@daiso-tech/core/async"```
15
- * @group Utilities
16
- */
17
- export type RetrySettings = {
18
- /**
19
- * @default {4}
20
- */
21
- maxAttempts?: number;
22
- backoffPolicy?: BackoffPolicy;
23
- retryPolicy?: RetryPolicy;
24
- timeout?: TimeSpan | null;
25
- };
26
- /**
27
- * @internal
28
- */
29
- export declare function retryOrFail<TValue = void>(asyncFn: (attempt: number) => PromiseLike<TValue>, settings?: RetrySettings): Promise<TValue>;
@@ -1,39 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { delay } from "../../../async/utilities/_module.js";
5
- import { AbortAsyncError, RetryAsyncError } from "../../../async/async.errors.js";
6
- import { exponentialBackoffPolicy } from "../../../async/backof-policies/_module.js";
7
- import { TimeSpan } from "../../../utilities/_module-exports.js";
8
- /**
9
- * @internal
10
- */
11
- export async function retryOrFail(asyncFn, settings = {}) {
12
- const { maxAttempts = 4, backoffPolicy = exponentialBackoffPolicy(), retryPolicy = () => true, } = settings;
13
- let error_;
14
- for (let attempt = 1; attempt <= maxAttempts; attempt++) {
15
- try {
16
- return await asyncFn(attempt);
17
- }
18
- catch (error) {
19
- error_ = error;
20
- if (error instanceof AbortAsyncError) {
21
- throw error;
22
- }
23
- if (!retryPolicy(error)) {
24
- throw error;
25
- }
26
- const time = backoffPolicy(attempt, error);
27
- await delay(TimeSpan.fromMilliseconds(time));
28
- }
29
- }
30
- let errorMessage = `Promise was failed after retried ${String(maxAttempts)} times`;
31
- if (error_) {
32
- errorMessage = `${errorMessage} and last thrown error was "${String(error_)}"`;
33
- }
34
- throw new RetryAsyncError(errorMessage, {
35
- cause: error_,
36
- maxAttempts,
37
- });
38
- }
39
- //# sourceMappingURL=retry-or-fail.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry-or-fail.js","sourceRoot":"","sources":["../../../../src/async/utilities/retry/retry-or-fail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAyB1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC7B,OAAiD,EACjD,WAA0B,EAAE;IAE5B,MAAM,EACF,WAAW,GAAG,CAAC,EACf,aAAa,GAAG,wBAAwB,EAAE,EAC1C,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,GAC3B,GAAG,QAAQ,CAAC;IACb,IAAI,MAAe,CAAC;IACpB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACtD,IAAI,CAAC;YACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,MAAM,GAAG,KAAK,CAAC;YACf,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;gBACnC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtB,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC3C,MAAM,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC;IAED,IAAI,YAAY,GAAG,oCAAoC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;IACnF,IAAI,MAAM,EAAE,CAAC;QACT,YAAY,GAAG,GAAG,YAAY,+BAA+B,MAAM,CAAC,MAAiB,CAAC,GAAG,CAAC;IAC9F,CAAC;IACD,MAAM,IAAI,eAAe,CAAC,YAAY,EAAE;QACpC,KAAK,EAAE,MAAM;QACb,WAAW;KACd,CAAC,CAAC;AACP,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { RetryAsyncError } from "../../../async/async.errors.js";
5
- import type { Result } from "../../../utilities/_module-exports.js";
6
- import type { RetrySettings } from "../../../async/utilities/retry/retry-or-fail.js";
7
- /**
8
- * @internal
9
- */
10
- export declare function retry<TValue = void>(asyncFn: (attempt: number) => PromiseLike<TValue>, settings?: RetrySettings): Promise<Result<TValue, RetryAsyncError>>;
@@ -1,21 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { RetryAsyncError } from "../../../async/async.errors.js";
5
- import { retryOrFail } from "../../../async/utilities/retry/retry-or-fail.js";
6
- /**
7
- * @internal
8
- */
9
- export async function retry(asyncFn, settings = {}) {
10
- try {
11
- const value = await retryOrFail(asyncFn, settings);
12
- return [value, null];
13
- }
14
- catch (error) {
15
- if (error instanceof RetryAsyncError) {
16
- return [null, error];
17
- }
18
- throw error;
19
- }
20
- }
21
- //# sourceMappingURL=retry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../../src/async/utilities/retry/retry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CACvB,OAAiD,EACjD,WAA0B,EAAE;IAE5B,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "../../../async/utilities/timeout/timeout-and-fail.js";
2
- export * from "../../../async/utilities/timeout/timeout.js";
@@ -1,3 +0,0 @@
1
- export * from "../../../async/utilities/timeout/timeout-and-fail.js";
2
- export * from "../../../async/utilities/timeout/timeout.js";
3
- //# sourceMappingURL=_module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/async/utilities/timeout/_module.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,sCAAsC,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { TimeSpan } from "../../../utilities/_module-exports.js";
2
- /**
3
- * @internal
4
- */
5
- export declare function timeoutAndFail<TValue>(asyncFn: () => PromiseLike<TValue>, time: TimeSpan): Promise<TValue>;
@@ -1,28 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { AbortAsyncError, TimeoutAsyncError } from "../../../async/async.errors.js";
5
- import { abortAndFail } from "../../../async/utilities/abort/_module.js";
6
- /**
7
- * @internal
8
- */
9
- export async function timeoutAndFail(asyncFn, time) {
10
- const timeoutController = new AbortController();
11
- const timeoutId = setTimeout(() => {
12
- timeoutController.abort(new TimeoutAsyncError("The promise exceded time"));
13
- }, time.toMilliseconds());
14
- try {
15
- return await abortAndFail(asyncFn, timeoutController.signal);
16
- }
17
- catch (error) {
18
- if (error instanceof AbortAsyncError &&
19
- error.cause instanceof TimeoutAsyncError) {
20
- throw error.cause;
21
- }
22
- throw error;
23
- }
24
- finally {
25
- clearTimeout(timeoutId);
26
- }
27
- }
28
- //# sourceMappingURL=timeout-and-fail.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout-and-fail.js","sourceRoot":"","sources":["../../../../src/async/utilities/timeout/timeout-and-fail.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAChC,OAAkC,EAClC,IAAc;IAEd,MAAM,iBAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;IAChD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;QAC9B,iBAAiB,CAAC,KAAK,CACnB,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,CACpD,CAAC;IACN,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC1B,IAAI,CAAC;QACD,OAAO,MAAM,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IACI,KAAK,YAAY,eAAe;YAChC,KAAK,CAAC,KAAK,YAAY,iBAAiB,EAC1C,CAAC;YACC,MAAM,KAAK,CAAC,KAAK,CAAC;QACtB,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { TimeoutAsyncError } from "../../../async/async.errors.js";
5
- import type { TimeSpan } from "../../../utilities/_module-exports.js";
6
- import type { Result } from "../../../utilities/_module-exports.js";
7
- /**
8
- * @internal
9
- */
10
- export declare function timeout<TValue>(asyncFn: () => PromiseLike<TValue>, time: TimeSpan): Promise<Result<TValue, TimeoutAsyncError>>;
@@ -1,21 +0,0 @@
1
- /**
2
- * @module Async
3
- */
4
- import { TimeoutAsyncError } from "../../../async/async.errors.js";
5
- import { timeoutAndFail } from "../../../async/utilities/timeout/timeout-and-fail.js";
6
- /**
7
- * @internal
8
- */
9
- export async function timeout(asyncFn, time) {
10
- try {
11
- const value = await timeoutAndFail(asyncFn, time);
12
- return [value, null];
13
- }
14
- catch (error) {
15
- if (error instanceof TimeoutAsyncError) {
16
- return [null, error];
17
- }
18
- throw error;
19
- }
20
- }
21
- //# sourceMappingURL=timeout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../../src/async/utilities/timeout/timeout.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CACzB,OAAkC,EAClC,IAAc;IAEd,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;YACrC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import type { TimeSpan } from "../../../../utilities/_module-exports.js";
5
- /**
6
- * @internal
7
- */
8
- export declare class AsyncDelayIterable<TValue> implements AsyncIterable<TValue> {
9
- private readonly iterable;
10
- private readonly time;
11
- constructor(iterable: AsyncIterable<TValue>, time: TimeSpan);
12
- [Symbol.asyncIterator](): AsyncIterator<TValue>;
13
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import { LazyPromise } from "../../../../async/_module-exports.js";
5
- /**
6
- * @internal
7
- */
8
- export class AsyncDelayIterable {
9
- iterable;
10
- time;
11
- constructor(iterable, time) {
12
- this.iterable = iterable;
13
- this.time = time;
14
- }
15
- async *[Symbol.asyncIterator]() {
16
- const iterator = this.iterable[Symbol.asyncIterator]();
17
- let result = await iterator.next();
18
- yield result.value;
19
- while (!result.done) {
20
- await LazyPromise.delay(this.time);
21
- result = await iterator.next();
22
- if (result.done) {
23
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
24
- return result.value;
25
- }
26
- yield result.value;
27
- }
28
- }
29
- }
30
- //# sourceMappingURL=async-delay-iterable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-delay-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAEN;IACA;IAFrB,YACqB,QAA+B,EAC/B,IAAc;QADd,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,SAAI,GAAJ,IAAI,CAAU;IAChC,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACvD,IAAI,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,MAAM,CAAC,KAAK,CAAC;QAEnB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBACd,+DAA+D;gBAC/D,OAAO,MAAM,CAAC,KAAK,CAAC;YACxB,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,CAAC;QACvB,CAAC;IACL,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import { type RetrySettings } from "../../../../async/utilities/_module.js";
5
- /**
6
- * @internal
7
- */
8
- export declare class AsyncRetryIterable<TValue> implements AsyncIterable<TValue> {
9
- private readonly iterable;
10
- private readonly settings?;
11
- constructor(iterable: AsyncIterable<TValue>, settings?: RetrySettings | undefined);
12
- [Symbol.asyncIterator](): AsyncIterator<TValue>;
13
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import { retry } from "../../../../async/utilities/_module.js";
5
- /**
6
- * @internal
7
- */
8
- export class AsyncRetryIterable {
9
- iterable;
10
- settings;
11
- constructor(iterable, settings) {
12
- this.iterable = iterable;
13
- this.settings = settings;
14
- }
15
- async *[Symbol.asyncIterator]() {
16
- const iterator = this.iterable[Symbol.asyncIterator]();
17
- let [result] = await retry(() => iterator.next(), this.settings);
18
- if (result === null) {
19
- return;
20
- }
21
- yield result.value;
22
- while (!result.done) {
23
- const [result_] = await retry(() => iterator.next(), this.settings);
24
- if (result_ === null) {
25
- continue;
26
- }
27
- result = result_;
28
- if (result.done) {
29
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
30
- return result.value;
31
- }
32
- yield result.value;
33
- }
34
- }
35
- }
36
- //# sourceMappingURL=async-retry-iterable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-retry-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,EAAsB,MAAM,8BAA8B,CAAC;AAEzE;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAEN;IACA;IAFrB,YACqB,QAA+B,EAC/B,QAAwB;QADxB,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,aAAQ,GAAR,QAAQ,CAAgB;IAC1C,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACX,CAAC;QACD,MAAM,MAAM,CAAC,KAAK,CAAC;QAEnB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACpE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACnB,SAAS;YACb,CAAC;YACD,MAAM,GAAG,OAAO,CAAC;YACjB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBACd,+DAA+D;gBAC/D,OAAO,MAAM,CAAC,KAAK,CAAC;YACxB,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,CAAC;QACvB,CAAC;IACL,CAAC;CACJ"}
@@ -1,9 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- export declare class AsyncTakeUntilAbortIterable<TValue> implements AsyncIterable<TValue> {
5
- private readonly iterable;
6
- private readonly abortSignal;
7
- constructor(iterable: AsyncIterable<TValue>, abortSignal: AbortSignal);
8
- [Symbol.asyncIterator](): AsyncIterator<TValue>;
9
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import { abort } from "../../../../async/utilities/_module.js";
5
- /**
6
- * @internal
7
- */
8
- export class AsyncTakeUntilAbortIterable {
9
- iterable;
10
- abortSignal;
11
- constructor(iterable, abortSignal) {
12
- this.iterable = iterable;
13
- this.abortSignal = abortSignal;
14
- }
15
- async *[Symbol.asyncIterator]() {
16
- const iterator = this.iterable[Symbol.asyncIterator]();
17
- let [result] = await abort(() => iterator.next(), this.abortSignal);
18
- if (result === null) {
19
- return;
20
- }
21
- yield result.value;
22
- while (!result.done) {
23
- if (this.abortSignal.aborted) {
24
- return;
25
- }
26
- const [result_] = await abort(() => iterator.next(), this.abortSignal);
27
- if (result_ === null) {
28
- return;
29
- }
30
- result = result_;
31
- if (result.done) {
32
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
33
- return result.value;
34
- }
35
- yield result.value;
36
- }
37
- }
38
- }
39
- //# sourceMappingURL=async-take-until-abort-iterable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-take-until-abort-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAIf;IACA;IAFrB,YACqB,QAA+B,EAC/B,WAAwB;QADxB,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACpE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACX,CAAC;QACD,MAAM,MAAM,CAAC,KAAK,CAAC;QAEnB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAClB,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC3B,OAAO;YACX,CAAC;YACD,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CACzB,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EACrB,IAAI,CAAC,WAAW,CACnB,CAAC;YACF,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACnB,OAAO;YACX,CAAC;YACD,MAAM,GAAG,OAAO,CAAC;YACjB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;gBACd,+DAA+D;gBAC/D,OAAO,MAAM,CAAC,KAAK,CAAC;YACxB,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,CAAC;QACvB,CAAC;IACL,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import { type TimeSpan } from "../../../../utilities/_module-exports.js";
5
- /**
6
- * @internal
7
- */
8
- export declare class AsyncTakeUntilTimeoutIterable<TInput> implements AsyncIterable<TInput> {
9
- private readonly iterable;
10
- private readonly time;
11
- constructor(iterable: AsyncIterable<TInput>, time: TimeSpan);
12
- [Symbol.asyncIterator](): AsyncIterator<TInput>;
13
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * @module Collection
3
- */
4
- import {} from "../../../../utilities/_module-exports.js";
5
- import { abort } from "../../../../async/utilities/_module.js";
6
- /**
7
- * @internal
8
- */
9
- export class AsyncTakeUntilTimeoutIterable {
10
- iterable;
11
- time;
12
- constructor(iterable, time) {
13
- this.iterable = iterable;
14
- this.time = time;
15
- }
16
- async *[Symbol.asyncIterator]() {
17
- const abortController = new AbortController();
18
- const timeoutId = setTimeout(() => {
19
- abortController.abort("");
20
- }, this.time.toMilliseconds());
21
- try {
22
- const iterator = this.iterable[Symbol.asyncIterator]();
23
- let [result] = await abort(() => iterator.next(), abortController.signal);
24
- if (result === null) {
25
- return;
26
- }
27
- yield result.value;
28
- while (!result.done) {
29
- if (abortController.signal.aborted) {
30
- return;
31
- }
32
- const [result_] = await abort(() => iterator.next(), abortController.signal);
33
- if (result_ === null) {
34
- return;
35
- }
36
- result = result_;
37
- if (result.done) {
38
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
39
- return result.value;
40
- }
41
- yield result.value;
42
- }
43
- }
44
- catch {
45
- return;
46
- }
47
- finally {
48
- clearTimeout(timeoutId);
49
- }
50
- }
51
- }
52
- //# sourceMappingURL=async-take-until-timeout-iterable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-take-until-timeout-iterable.js","sourceRoot":"","sources":["../../../../../src/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,6BAA6B;IAIjB;IACA;IAFrB,YACqB,QAA+B,EAC/B,IAAc;QADd,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,SAAI,GAAJ,IAAI,CAAU;IAChC,CAAC;IAEJ,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QACzB,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;QAC9C,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9B,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,CACtB,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EACrB,eAAe,CAAC,MAAM,CACzB,CAAC;YACF,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBAClB,OAAO;YACX,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,CAAC;YAEnB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBAClB,IAAI,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjC,OAAO;gBACX,CAAC;gBACD,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CACzB,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EACrB,eAAe,CAAC,MAAM,CACzB,CAAC;gBACF,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;oBACnB,OAAO;gBACX,CAAC;gBACD,MAAM,GAAG,OAAO,CAAC;gBACjB,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;oBACd,+DAA+D;oBAC/D,OAAO,MAAM,CAAC,KAAK,CAAC;gBACxB,CAAC;gBACD,MAAM,MAAM,CAAC,KAAK,CAAC;YACvB,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,OAAO;QACX,CAAC;gBAAS,CAAC;YACP,YAAY,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;CACJ"}
@@ -1,12 +0,0 @@
1
- /**
2
- * @module EventBus
3
- */
4
- /**
5
- *
6
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/contracts"```
7
- * @group Contracts
8
- */
9
- export declare abstract class BaseEvent<TFields extends Record<string, unknown> = Record<string, unknown>> {
10
- readonly fields: TFields;
11
- constructor(fields: TFields);
12
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * @module EventBus
3
- */
4
- /**
5
- *
6
- * IMPORT_PATH: ```"@daiso-tech/core/event-bus/contracts"```
7
- * @group Contracts
8
- */
9
- export class BaseEvent {
10
- fields;
11
- constructor(fields) {
12
- this.fields = fields;
13
- }
14
- }
15
- //# sourceMappingURL=_shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../../src/event-bus/contracts/_shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,OAAgB,SAAS;IAGN;IAArB,YAAqB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;CAC3C"}
@@ -1 +0,0 @@
1
- export * from "../../../utilities/classes/sync-event-bus/sync-event-bus.js";
@@ -1,2 +0,0 @@
1
- export * from "../../../utilities/classes/sync-event-bus/sync-event-bus.js";
2
- //# sourceMappingURL=_module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../src/utilities/classes/sync-event-bus/_module.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * @module Utilities
3
- */
4
- import type { EventClass, EventInstance, EventListener } from "../../../event-bus/contracts/_module-exports.js";
5
- import type { BaseEvent } from "../../../event-bus/contracts/_shared.js";
6
- import type { ISyncEventListenable } from "../../../utilities/contracts/sync-event-bus-listenable.js";
7
- /**
8
- * @internal
9
- */
10
- export declare class SyncEventBus<TEvents extends BaseEvent> implements ISyncEventListenable<TEvents> {
11
- private readonly eventMap;
12
- addListener<TEventClass extends EventClass<TEvents>>(event: TEventClass, listener: EventListener<EventInstance<TEventClass>>): void;
13
- removeListener<TEventClass extends EventClass<TEvents>>(event: TEventClass, listener: EventListener<EventInstance<TEventClass>>): void;
14
- dispatch(event: TEvents): void;
15
- clear(): void;
16
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * @module Utilities
3
- */
4
- import { callInvokable, getConstructorName, } from "../../../utilities/_module-exports.js";
5
- /**
6
- * @internal
7
- */
8
- export class SyncEventBus {
9
- eventMap = new Map();
10
- addListener(event, listener) {
11
- const eventName = getConstructorName(event);
12
- let listeners = this.eventMap.get(eventName);
13
- if (listeners === undefined) {
14
- listeners = new Set();
15
- this.eventMap.set(eventName, listeners);
16
- }
17
- listeners.add(listener);
18
- }
19
- removeListener(event, listener) {
20
- const eventName = getConstructorName(event);
21
- const listeners = this.eventMap.get(eventName);
22
- if (listeners === undefined) {
23
- return;
24
- }
25
- listeners.delete(listener);
26
- if (listeners.size === 0) {
27
- this.eventMap.delete(eventName);
28
- }
29
- }
30
- dispatch(event) {
31
- const eventName = getConstructorName(event);
32
- if (this.eventMap.size === 0) {
33
- return;
34
- }
35
- const listeners = this.eventMap.get(eventName);
36
- if (listeners === undefined) {
37
- return;
38
- }
39
- if (listeners.size === 0) {
40
- return;
41
- }
42
- for (const listener of listeners) {
43
- callInvokable(listener, event);
44
- }
45
- }
46
- clear() {
47
- for (const listeners of this.eventMap.values()) {
48
- listeners.clear();
49
- }
50
- this.eventMap.clear();
51
- }
52
- }
53
- //# sourceMappingURL=sync-event-bus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-event-bus.js","sourceRoot":"","sources":["../../../../src/utilities/classes/sync-event-bus/sync-event-bus.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EACH,aAAa,EACb,kBAAkB,GACrB,MAAM,gCAAgC,CAAC;AAGxC;;GAEG;AACH,MAAM,OAAO,YAAY;IAGJ,QAAQ,GAAG,IAAI,GAAG,EAAmC,CAAC;IAEvE,WAAW,CACP,KAAkB,EAClB,QAAmD;QAEnD,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5C,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,cAAc,CACV,KAAkB,EAClB,QAAmD;QAEnD,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO;QACX,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,KAAc;QACnB,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;QACX,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO;QACX,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO;QACX,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;IACL,CAAC;IAED,KAAK;QACD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7C,SAAS,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACJ"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @module Utilities
3
- */
4
- import type { BaseEvent, EventClass, EventInstance, EventListener } from "../../event-bus/contracts/_module-exports.js";
5
- /**
6
- *
7
- * IMPORT_PATH: ```"@daiso-tech/core/utilities"```
8
- * @group Contracts
9
- */
10
- export type ISyncEventListenable<TEvents extends BaseEvent> = {
11
- addListener<TEventClass extends EventClass<TEvents>>(event: TEventClass, listener: EventListener<EventInstance<TEventClass>>): void;
12
- removeListener<TEventClass extends EventClass<TEvents>>(event: TEventClass, listener: EventListener<EventInstance<TEventClass>>): void;
13
- };
@@ -1,5 +0,0 @@
1
- /**
2
- * @module Utilities
3
- */
4
- export {};
5
- //# sourceMappingURL=sync-event-bus-listenable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-event-bus-listenable.js","sourceRoot":"","sources":["../../../src/utilities/contracts/sync-event-bus-listenable.ts"],"names":[],"mappings":"AAAA;;GAEG"}