@daiso-tech/core 0.40.0 → 0.41.1

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 (672) hide show
  1. package/README.md +8 -1
  2. package/dist/backoff-policies/_module-exports.d.ts +5 -0
  3. package/dist/backoff-policies/_module-exports.js +6 -0
  4. package/dist/backoff-policies/_module-exports.js.map +1 -0
  5. package/dist/{async/backof-policies → backoff-policies}/_shared.d.ts +6 -7
  6. package/dist/{async/backof-policies → backoff-policies}/_shared.js +1 -1
  7. package/dist/backoff-policies/_shared.js.map +1 -0
  8. package/dist/backoff-policies/constant-backoff-policy/_module.d.ts +1 -0
  9. package/dist/backoff-policies/constant-backoff-policy/_module.js +2 -0
  10. package/dist/backoff-policies/constant-backoff-policy/_module.js.map +1 -0
  11. package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.d.ts +6 -8
  12. package/dist/{async/backof-policies → backoff-policies}/constant-backoff-policy/constant-backoff-policy.js +8 -10
  13. package/dist/backoff-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
  14. package/dist/backoff-policies/exponential-backoff-policy/_module.d.ts +1 -0
  15. package/dist/backoff-policies/exponential-backoff-policy/_module.js +2 -0
  16. package/dist/backoff-policies/exponential-backoff-policy/_module.js.map +1 -0
  17. package/dist/{async/backof-policies → backoff-policies}/exponential-backoff-policy/exponential-backoff-policy.d.ts +7 -9
  18. package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js +30 -0
  19. package/dist/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
  20. package/dist/backoff-policies/linear-backoff-policy/_module.d.ts +1 -0
  21. package/dist/backoff-policies/linear-backoff-policy/_module.js +2 -0
  22. package/dist/backoff-policies/linear-backoff-policy/_module.js.map +1 -0
  23. package/dist/{async/backof-policies → backoff-policies}/linear-backoff-policy/linear-backoff-policy.d.ts +7 -9
  24. package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js +30 -0
  25. package/dist/backoff-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
  26. package/dist/backoff-policies/polynomial-backoff-policy/_module.d.ts +1 -0
  27. package/dist/backoff-policies/polynomial-backoff-policy/_module.js +2 -0
  28. package/dist/backoff-policies/polynomial-backoff-policy/_module.js.map +1 -0
  29. package/dist/{async/backof-policies → backoff-policies}/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +7 -9
  30. package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +30 -0
  31. package/dist/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
  32. package/dist/cache/contracts/cache-adapter.contract.d.ts +3 -3
  33. package/dist/cache/contracts/cache.contract.d.ts +22 -22
  34. package/dist/cache/contracts/cache.errors.d.ts +7 -14
  35. package/dist/cache/contracts/cache.errors.js +12 -24
  36. package/dist/cache/contracts/cache.errors.js.map +1 -1
  37. package/dist/cache/contracts/cache.events.d.ts +1 -1
  38. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +1 -1
  39. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +4 -4
  40. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
  41. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +1 -1
  42. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +2 -2
  43. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
  44. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +3 -2
  45. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +3 -3
  46. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
  47. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
  48. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
  49. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +2 -2
  50. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
  51. package/dist/cache/implementations/derivables/cache/cache.d.ts +38 -43
  52. package/dist/cache/implementations/derivables/cache/cache.js +106 -101
  53. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  54. package/dist/cache/implementations/derivables/cache/database-cache-adapter.d.ts +1 -1
  55. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js +3 -3
  56. package/dist/cache/implementations/derivables/cache/database-cache-adapter.js.map +1 -1
  57. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +6 -8
  58. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +5 -15
  59. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  60. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +1 -1
  61. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +48 -48
  62. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js.map +1 -1
  63. package/dist/cache/implementations/test-utilities/cache.test-suite.js +107 -107
  64. package/dist/cache/implementations/test-utilities/cache.test-suite.js.map +1 -1
  65. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +2 -1
  66. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -1
  67. package/dist/collection/contracts/async-collection.contract.d.ts +43 -43
  68. package/dist/collection/contracts/collection.contract.d.ts +15 -1
  69. package/dist/collection/contracts/collection.contract.js +1 -3
  70. package/dist/collection/contracts/collection.contract.js.map +1 -1
  71. package/dist/collection/contracts/collection.errors.d.ts +4 -13
  72. package/dist/collection/contracts/collection.errors.js +4 -16
  73. package/dist/collection/contracts/collection.errors.js.map +1 -1
  74. package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.d.ts +6 -0
  75. package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js +3 -0
  76. package/dist/collection/implementations/async-iterable-collection/_shared/async-validate-iterable.js.map +1 -1
  77. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +40 -51
  78. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +31 -37
  79. package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
  80. package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.d.ts +3 -0
  81. package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js +6 -0
  82. package/dist/collection/implementations/iterable-collection/_shared/validate-iterable.js.map +1 -1
  83. package/dist/collection/implementations/iterable-collection/iterable-collection.d.ts +3 -3
  84. package/dist/collection/implementations/iterable-collection/iterable-collection.js +5 -2
  85. package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
  86. package/dist/collection/implementations/list-collection/list-collection.d.ts +3 -3
  87. package/dist/collection/implementations/list-collection/list-collection.js +5 -2
  88. package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
  89. package/dist/event-bus/contracts/event-bus.contract.d.ts +10 -10
  90. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +3 -6
  91. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +7 -9
  92. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  93. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +17 -24
  94. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +32 -32
  95. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
  96. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +1 -3
  97. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +4 -8
  98. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  99. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +34 -32
  100. package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
  101. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +195 -190
  102. package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
  103. package/dist/hooks/_module-exports.d.ts +3 -0
  104. package/dist/hooks/_module-exports.js +4 -0
  105. package/dist/hooks/_module-exports.js.map +1 -0
  106. package/dist/{utilities/classes/hooks → hooks}/async-hooks.d.ts +15 -26
  107. package/dist/{utilities/classes/hooks → hooks}/async-hooks.js +4 -6
  108. package/dist/hooks/async-hooks.js.map +1 -0
  109. package/dist/{utilities/classes/hooks → hooks}/hooks.d.ts +11 -18
  110. package/dist/{utilities/classes/hooks → hooks}/hooks.js +4 -5
  111. package/dist/hooks/hooks.js.map +1 -0
  112. package/dist/{utilities/classes/hooks → hooks}/types.d.ts +2 -3
  113. package/dist/hooks/types.js +5 -0
  114. package/dist/hooks/types.js.map +1 -0
  115. package/dist/lock/contracts/_module-exports.d.ts +4 -2
  116. package/dist/lock/contracts/_module-exports.js +4 -2
  117. package/dist/lock/contracts/_module-exports.js.map +1 -1
  118. package/dist/lock/contracts/database-lock-adapter.contract.d.ts +24 -17
  119. package/dist/lock/contracts/lock-adapter.contract.d.ts +15 -24
  120. package/dist/lock/contracts/lock-adapter.contract.js +1 -10
  121. package/dist/lock/contracts/lock-adapter.contract.js.map +1 -1
  122. package/dist/lock/contracts/lock-provider.contract.d.ts +5 -5
  123. package/dist/lock/contracts/lock-state.contract.d.ts +52 -0
  124. package/dist/lock/contracts/lock-state.contract.js +14 -0
  125. package/dist/lock/contracts/lock-state.contract.js.map +1 -0
  126. package/dist/lock/contracts/lock.contract.d.ts +64 -55
  127. package/dist/lock/contracts/lock.errors.d.ts +13 -20
  128. package/dist/lock/contracts/lock.errors.js +19 -26
  129. package/dist/lock/contracts/lock.errors.js.map +1 -1
  130. package/dist/lock/contracts/lock.events.d.ts +21 -49
  131. package/dist/lock/contracts/lock.events.js +2 -3
  132. package/dist/lock/contracts/lock.events.js.map +1 -1
  133. package/dist/lock/contracts/types.d.ts +11 -0
  134. package/dist/lock/contracts/types.js +5 -0
  135. package/dist/lock/contracts/types.js.map +1 -0
  136. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +21 -19
  137. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +92 -61
  138. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
  139. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +8 -5
  140. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +33 -13
  141. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
  142. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +7 -8
  143. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +33 -20
  144. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
  145. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +6 -5
  146. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +7 -5
  147. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -1
  148. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +26 -8
  149. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +61 -28
  150. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
  151. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +6 -5
  152. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +33 -33
  153. package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
  154. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.d.ts +2 -2
  155. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +4 -6
  156. package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
  157. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +29 -39
  158. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +31 -35
  159. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  160. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +5 -8
  161. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +27 -23
  162. package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
  163. package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +38 -34
  164. package/dist/lock/implementations/derivables/lock-provider/lock.js +182 -257
  165. package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
  166. package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.d.ts +9 -0
  167. package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.js +12 -0
  168. package/dist/lock/implementations/derivables/lock-provider/resolve-database-lock-adapter.js.map +1 -0
  169. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +12 -13
  170. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +7 -16
  171. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
  172. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +310 -207
  173. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
  174. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +1 -1
  175. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +376 -292
  176. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
  177. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +15 -5
  178. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +3285 -2976
  179. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
  180. package/dist/namespace/_module-exports.d.ts +1 -0
  181. package/dist/namespace/_module-exports.js +2 -0
  182. package/dist/namespace/_module-exports.js.map +1 -0
  183. package/dist/namespace/namespace.d.ts +87 -0
  184. package/dist/namespace/namespace.js +117 -0
  185. package/dist/namespace/namespace.js.map +1 -0
  186. package/dist/resilience/_module-exports.d.ts +2 -0
  187. package/dist/resilience/_module-exports.js +3 -0
  188. package/dist/resilience/_module-exports.js.map +1 -0
  189. package/dist/resilience/middlewares/_module.d.ts +5 -0
  190. package/dist/resilience/middlewares/_module.js +6 -0
  191. package/dist/resilience/middlewares/_module.js.map +1 -0
  192. package/dist/resilience/middlewares/dynamic/_module.d.ts +1 -0
  193. package/dist/resilience/middlewares/dynamic/_module.js +2 -0
  194. package/dist/resilience/middlewares/dynamic/_module.js.map +1 -0
  195. package/dist/{async → resilience}/middlewares/dynamic/dynamic.middleware.d.ts +6 -6
  196. package/dist/{async → resilience}/middlewares/dynamic/dynamic.middleware.js +5 -5
  197. package/dist/resilience/middlewares/dynamic/dynamic.middleware.js.map +1 -0
  198. package/dist/resilience/middlewares/fallback/_module.d.ts +2 -0
  199. package/dist/resilience/middlewares/fallback/_module.js +3 -0
  200. package/dist/resilience/middlewares/fallback/_module.js.map +1 -0
  201. package/dist/{async → resilience}/middlewares/fallback/fallback.middleware.d.ts +9 -9
  202. package/dist/{async → resilience}/middlewares/fallback/fallback.middleware.js +7 -6
  203. package/dist/resilience/middlewares/fallback/fallback.middleware.js.map +1 -0
  204. package/dist/{async → resilience}/middlewares/fallback/fallback.types.d.ts +7 -6
  205. package/dist/{async → resilience}/middlewares/fallback/fallback.types.js +1 -1
  206. package/dist/resilience/middlewares/fallback/fallback.types.js.map +1 -0
  207. package/dist/resilience/middlewares/observe/_module.d.ts +2 -0
  208. package/dist/resilience/middlewares/observe/_module.js +3 -0
  209. package/dist/resilience/middlewares/observe/_module.js.map +1 -0
  210. package/dist/{async → resilience}/middlewares/observe/observe.middleware.d.ts +13 -11
  211. package/dist/{async → resilience}/middlewares/observe/observe.middleware.js +14 -10
  212. package/dist/resilience/middlewares/observe/observe.middleware.js.map +1 -0
  213. package/dist/{async → resilience}/middlewares/observe/observe.types.d.ts +13 -12
  214. package/dist/resilience/middlewares/observe/observe.types.js +5 -0
  215. package/dist/resilience/middlewares/observe/observe.types.js.map +1 -0
  216. package/dist/resilience/middlewares/retry/_module.d.ts +2 -0
  217. package/dist/resilience/middlewares/retry/_module.js +3 -0
  218. package/dist/resilience/middlewares/retry/_module.js.map +1 -0
  219. package/dist/{async → resilience}/middlewares/retry/retry.middleware.d.ts +12 -9
  220. package/dist/{async → resilience}/middlewares/retry/retry.middleware.js +19 -15
  221. package/dist/resilience/middlewares/retry/retry.middleware.js.map +1 -0
  222. package/dist/{async → resilience}/middlewares/retry/retry.types.d.ts +14 -12
  223. package/dist/resilience/middlewares/retry/retry.types.js +7 -0
  224. package/dist/resilience/middlewares/retry/retry.types.js.map +1 -0
  225. package/dist/resilience/middlewares/timeout/_module.d.ts +2 -0
  226. package/dist/resilience/middlewares/timeout/_module.js +3 -0
  227. package/dist/resilience/middlewares/timeout/_module.js.map +1 -0
  228. package/dist/{async → resilience}/middlewares/timeout/timeout.middleware.d.ts +9 -7
  229. package/dist/{async → resilience}/middlewares/timeout/timeout.middleware.js +12 -11
  230. package/dist/resilience/middlewares/timeout/timeout.middleware.js.map +1 -0
  231. package/dist/{async → resilience}/middlewares/timeout/timeout.type.d.ts +10 -9
  232. package/dist/resilience/middlewares/timeout/timeout.type.js +5 -0
  233. package/dist/resilience/middlewares/timeout/timeout.type.js.map +1 -0
  234. package/dist/resilience/resilience.errors.d.ts +40 -0
  235. package/dist/resilience/resilience.errors.js +48 -0
  236. package/dist/resilience/resilience.errors.js.map +1 -0
  237. package/dist/resilience/utilities/_module.d.ts +2 -0
  238. package/dist/resilience/utilities/_module.js +3 -0
  239. package/dist/resilience/utilities/_module.js.map +1 -0
  240. package/dist/resilience/utilities/abort-and-fail/_module.d.ts +1 -0
  241. package/dist/resilience/utilities/abort-and-fail/_module.js +2 -0
  242. package/dist/resilience/utilities/abort-and-fail/_module.js.map +1 -0
  243. package/dist/resilience/utilities/abort-and-fail/abort-and-fail.d.ts +7 -0
  244. package/dist/resilience/utilities/abort-and-fail/abort-and-fail.js +51 -0
  245. package/dist/resilience/utilities/abort-and-fail/abort-and-fail.js.map +1 -0
  246. package/dist/resilience/utilities/timeout-and-fail/_module.d.ts +1 -0
  247. package/dist/resilience/utilities/timeout-and-fail/_module.js +2 -0
  248. package/dist/resilience/utilities/timeout-and-fail/_module.js.map +1 -0
  249. package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.d.ts +7 -0
  250. package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.js +23 -0
  251. package/dist/resilience/utilities/timeout-and-fail/timeout-and-fail.js.map +1 -0
  252. package/dist/semaphore/contracts/_module-exports.d.ts +9 -0
  253. package/dist/semaphore/contracts/_module-exports.js +10 -0
  254. package/dist/semaphore/contracts/_module-exports.js.map +1 -0
  255. package/dist/semaphore/contracts/database-semaphore-adapter.contract.d.ts +90 -0
  256. package/dist/semaphore/contracts/database-semaphore-adapter.contract.js +5 -0
  257. package/dist/semaphore/contracts/database-semaphore-adapter.contract.js.map +1 -0
  258. package/dist/semaphore/contracts/semaphore-adapter.contract.d.ts +61 -0
  259. package/dist/semaphore/contracts/semaphore-adapter.contract.js +5 -0
  260. package/dist/semaphore/contracts/semaphore-adapter.contract.js.map +1 -0
  261. package/dist/semaphore/contracts/semaphore-provider-factory.contract.d.ts +19 -0
  262. package/dist/semaphore/contracts/semaphore-provider-factory.contract.js +9 -0
  263. package/dist/semaphore/contracts/semaphore-provider-factory.contract.js.map +1 -0
  264. package/dist/semaphore/contracts/semaphore-provider.contract.d.ts +50 -0
  265. package/dist/semaphore/contracts/semaphore-provider.contract.js +5 -0
  266. package/dist/semaphore/contracts/semaphore-provider.contract.js.map +1 -0
  267. package/dist/semaphore/contracts/semaphore-state.contract.d.ts +70 -0
  268. package/dist/semaphore/contracts/semaphore-state.contract.js +15 -0
  269. package/dist/semaphore/contracts/semaphore-state.contract.js.map +1 -0
  270. package/dist/semaphore/contracts/semaphore.contract.d.ts +127 -0
  271. package/dist/semaphore/contracts/semaphore.contract.js +5 -0
  272. package/dist/semaphore/contracts/semaphore.contract.js.map +1 -0
  273. package/dist/semaphore/contracts/semaphore.errors.d.ts +52 -0
  274. package/dist/semaphore/contracts/semaphore.errors.js +63 -0
  275. package/dist/semaphore/contracts/semaphore.errors.js.map +1 -0
  276. package/dist/semaphore/contracts/semaphore.events.d.ts +101 -0
  277. package/dist/semaphore/contracts/semaphore.events.js +19 -0
  278. package/dist/semaphore/contracts/semaphore.events.js.map +1 -0
  279. package/dist/semaphore/contracts/types.d.ts +11 -0
  280. package/dist/semaphore/contracts/types.js +5 -0
  281. package/dist/semaphore/contracts/types.js.map +1 -0
  282. package/dist/semaphore/implementations/adapters/_module-exports.d.ts +5 -0
  283. package/dist/semaphore/implementations/adapters/_module-exports.js +6 -0
  284. package/dist/semaphore/implementations/adapters/_module-exports.js.map +1 -0
  285. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.d.ts +1 -0
  286. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.js +2 -0
  287. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.js.map +1 -0
  288. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.d.ts +97 -0
  289. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js +313 -0
  290. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js.map +1 -0
  291. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.d.ts +1 -0
  292. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.js +2 -0
  293. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.js.map +1 -0
  294. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.d.ts +49 -0
  295. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js +141 -0
  296. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js.map +1 -0
  297. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.d.ts +1 -0
  298. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.js +2 -0
  299. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.js.map +1 -0
  300. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.d.ts +80 -0
  301. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js +390 -0
  302. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js.map +1 -0
  303. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.d.ts +1 -0
  304. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.js +2 -0
  305. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.js.map +1 -0
  306. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.d.ts +18 -0
  307. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js +30 -0
  308. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js.map +1 -0
  309. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.d.ts +1 -0
  310. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.js +2 -0
  311. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.js.map +1 -0
  312. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.d.ts +48 -0
  313. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js +338 -0
  314. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js.map +1 -0
  315. package/dist/semaphore/implementations/derivables/_module-exports.d.ts +2 -0
  316. package/dist/semaphore/implementations/derivables/_module-exports.js +3 -0
  317. package/dist/semaphore/implementations/derivables/_module-exports.js.map +1 -0
  318. package/dist/semaphore/implementations/derivables/semaphore-provider/_module.d.ts +1 -0
  319. package/dist/semaphore/implementations/derivables/semaphore-provider/_module.js +2 -0
  320. package/dist/semaphore/implementations/derivables/semaphore-provider/_module.js.map +1 -0
  321. package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.d.ts +17 -0
  322. package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.js +74 -0
  323. package/dist/semaphore/implementations/derivables/semaphore-provider/database-semaphore-adapter.js.map +1 -0
  324. package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.d.ts +8 -0
  325. package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.js +15 -0
  326. package/dist/semaphore/implementations/derivables/semaphore-provider/is-database-semaphore-adapter.js.map +1 -0
  327. package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.d.ts +8 -0
  328. package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.js +15 -0
  329. package/dist/semaphore/implementations/derivables/semaphore-provider/resolve-database-semaphore-adapter.js.map +1 -0
  330. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.d.ts +149 -0
  331. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js +135 -0
  332. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js.map +1 -0
  333. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.d.ts +41 -0
  334. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.js +77 -0
  335. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-serde-transformer.js.map +1 -0
  336. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.d.ts +83 -0
  337. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js +336 -0
  338. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore.js.map +1 -0
  339. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.d.ts +1 -0
  340. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.js +2 -0
  341. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/_module.js.map +1 -0
  342. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.d.ts +40 -0
  343. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js +67 -0
  344. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js.map +1 -0
  345. package/dist/semaphore/implementations/test-utilities/_module-exports.d.ts +3 -0
  346. package/dist/semaphore/implementations/test-utilities/_module-exports.js +4 -0
  347. package/dist/semaphore/implementations/test-utilities/_module-exports.js.map +1 -0
  348. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.d.ts +59 -0
  349. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js +536 -0
  350. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js.map +1 -0
  351. package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.d.ts +59 -0
  352. package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js +961 -0
  353. package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js.map +1 -0
  354. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.d.ts +67 -0
  355. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js +4981 -0
  356. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js.map +1 -0
  357. package/dist/serde/contracts/_module-exports.d.ts +0 -1
  358. package/dist/serde/contracts/_module-exports.js +0 -1
  359. package/dist/serde/contracts/_module-exports.js.map +1 -1
  360. package/dist/serde/contracts/flexible-serde.contract.d.ts +21 -5
  361. package/dist/serde/contracts/serde.errors.d.ts +14 -11
  362. package/dist/serde/contracts/serde.errors.js +15 -14
  363. package/dist/serde/contracts/serde.errors.js.map +1 -1
  364. package/dist/serde/implementations/adapters/_module-exports.d.ts +0 -3
  365. package/dist/serde/implementations/adapters/_module-exports.js +0 -3
  366. package/dist/serde/implementations/adapters/_module-exports.js.map +1 -1
  367. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +6 -0
  368. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js.map +1 -1
  369. package/dist/serde/implementations/derivables/serde-transformers.d.ts +38 -30
  370. package/dist/serde/implementations/derivables/serde-transformers.js +62 -20
  371. package/dist/serde/implementations/derivables/serde-transformers.js.map +1 -1
  372. package/dist/serde/implementations/derivables/serde.d.ts +12 -3
  373. package/dist/serde/implementations/derivables/serde.js +5 -2
  374. package/dist/serde/implementations/derivables/serde.js.map +1 -1
  375. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +85 -1
  376. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js.map +1 -1
  377. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +85 -1
  378. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js.map +1 -1
  379. package/dist/shared-lock/contracts/_module-exports.d.ts +10 -0
  380. package/dist/shared-lock/contracts/_module-exports.js +11 -0
  381. package/dist/shared-lock/contracts/_module-exports.js.map +1 -0
  382. package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.d.ts +145 -0
  383. package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.js +5 -0
  384. package/dist/shared-lock/contracts/database-shared-lock-adapter.contract.js.map +1 -0
  385. package/dist/shared-lock/contracts/shared-lock-adapter.contract.d.ts +96 -0
  386. package/dist/shared-lock/contracts/shared-lock-adapter.contract.js +5 -0
  387. package/dist/shared-lock/contracts/shared-lock-adapter.contract.js.map +1 -0
  388. package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.d.ts +19 -0
  389. package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.js +9 -0
  390. package/dist/shared-lock/contracts/shared-lock-provider-factory.contract.js.map +1 -0
  391. package/dist/shared-lock/contracts/shared-lock-provider.contract.d.ts +53 -0
  392. package/dist/shared-lock/contracts/shared-lock-provider.contract.js +5 -0
  393. package/dist/shared-lock/contracts/shared-lock-provider.contract.js.map +1 -0
  394. package/dist/shared-lock/contracts/shared-lock-state.contract.d.ts +133 -0
  395. package/dist/shared-lock/contracts/shared-lock-state.contract.js +33 -0
  396. package/dist/shared-lock/contracts/shared-lock-state.contract.js.map +1 -0
  397. package/dist/shared-lock/contracts/shared-lock.contract.d.ts +222 -0
  398. package/dist/shared-lock/contracts/shared-lock.contract.js +13 -0
  399. package/dist/shared-lock/contracts/shared-lock.contract.js.map +1 -0
  400. package/dist/shared-lock/contracts/shared-lock.errors.d.ts +124 -0
  401. package/dist/shared-lock/contracts/shared-lock.errors.js +136 -0
  402. package/dist/shared-lock/contracts/shared-lock.errors.js.map +1 -0
  403. package/dist/shared-lock/contracts/shared-lock.events.d.ts +205 -0
  404. package/dist/shared-lock/contracts/shared-lock.events.js +43 -0
  405. package/dist/shared-lock/contracts/shared-lock.events.js.map +1 -0
  406. package/dist/shared-lock/contracts/types.d.ts +10 -0
  407. package/dist/shared-lock/contracts/types.js +5 -0
  408. package/dist/shared-lock/contracts/types.js.map +1 -0
  409. package/dist/shared-lock/implementations/adapters/_module-exports.d.ts +5 -0
  410. package/dist/shared-lock/implementations/adapters/_module-exports.js +6 -0
  411. package/dist/shared-lock/implementations/adapters/_module-exports.js.map +1 -0
  412. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.d.ts +1 -0
  413. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.js +2 -0
  414. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.js.map +1 -0
  415. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.d.ts +114 -0
  416. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js +496 -0
  417. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js.map +1 -0
  418. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.d.ts +1 -0
  419. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.js +2 -0
  420. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.js.map +1 -0
  421. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.d.ts +79 -0
  422. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js +347 -0
  423. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js.map +1 -0
  424. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.d.ts +1 -0
  425. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.js +2 -0
  426. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.js.map +1 -0
  427. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.d.ts +112 -0
  428. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js +805 -0
  429. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js.map +1 -0
  430. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.d.ts +1 -0
  431. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.js +2 -0
  432. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.js.map +1 -0
  433. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.d.ts +23 -0
  434. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js +42 -0
  435. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js.map +1 -0
  436. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.d.ts +1 -0
  437. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.js +2 -0
  438. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.js.map +1 -0
  439. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.d.ts +79 -0
  440. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.js +630 -0
  441. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.js.map +1 -0
  442. package/dist/shared-lock/implementations/derivables/_module-exports.d.ts +2 -0
  443. package/dist/shared-lock/implementations/derivables/_module-exports.js +3 -0
  444. package/dist/shared-lock/implementations/derivables/_module-exports.js.map +1 -0
  445. package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.d.ts +1 -0
  446. package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.js +2 -0
  447. package/dist/shared-lock/implementations/derivables/shared-lock-provider/_module.js.map +1 -0
  448. package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.d.ts +27 -0
  449. package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.js +208 -0
  450. package/dist/shared-lock/implementations/derivables/shared-lock-provider/database-shared-lock-adapter.js.map +1 -0
  451. package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.d.ts +8 -0
  452. package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.js +12 -0
  453. package/dist/shared-lock/implementations/derivables/shared-lock-provider/is-database-shared-lock-adapter.js.map +1 -0
  454. package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.d.ts +8 -0
  455. package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.js +15 -0
  456. package/dist/shared-lock/implementations/derivables/shared-lock-provider/resolve-database-shared-lock-adapter.js.map +1 -0
  457. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts +190 -0
  458. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js +177 -0
  459. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map +1 -0
  460. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.d.ts +41 -0
  461. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js +77 -0
  462. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-serde-transformer.js.map +1 -0
  463. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.d.ts +95 -0
  464. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js +542 -0
  465. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock.js.map +1 -0
  466. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.d.ts +1 -0
  467. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.js +2 -0
  468. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/_module.js.map +1 -0
  469. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.d.ts +97 -0
  470. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js +128 -0
  471. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js.map +1 -0
  472. package/dist/shared-lock/implementations/test-utilities/_module-exports.d.ts +3 -0
  473. package/dist/shared-lock/implementations/test-utilities/_module-exports.js +4 -0
  474. package/dist/shared-lock/implementations/test-utilities/_module-exports.js.map +1 -0
  475. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.d.ts +59 -0
  476. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js +944 -0
  477. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js.map +1 -0
  478. package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.d.ts +59 -0
  479. package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js +1921 -0
  480. package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js.map +1 -0
  481. package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.d.ts +67 -0
  482. package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js +9833 -0
  483. package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js.map +1 -0
  484. package/dist/task/_module-exports.d.ts +1 -0
  485. package/dist/task/_module-exports.js +2 -0
  486. package/dist/task/_module-exports.js.map +1 -0
  487. package/dist/{async/utilities/abort-and-fail → task}/abort-and-fail.d.ts +1 -1
  488. package/dist/{async/utilities/abort-and-fail → task}/abort-and-fail.js +1 -1
  489. package/dist/task/abort-and-fail.js.map +1 -0
  490. package/dist/task/task.d.ts +194 -0
  491. package/dist/task/task.js +212 -0
  492. package/dist/task/task.js.map +1 -0
  493. package/dist/time-span/contracts/_module-exports.d.ts +1 -0
  494. package/dist/time-span/contracts/_module-exports.js +2 -0
  495. package/dist/time-span/contracts/_module-exports.js.map +1 -0
  496. package/dist/time-span/contracts/time-span.contract.d.ts +19 -0
  497. package/dist/time-span/contracts/time-span.contract.js +10 -0
  498. package/dist/time-span/contracts/time-span.contract.js.map +1 -0
  499. package/dist/time-span/implementations/_module-exports.d.ts +1 -0
  500. package/dist/time-span/implementations/_module-exports.js +2 -0
  501. package/dist/time-span/implementations/_module-exports.js.map +1 -0
  502. package/dist/{utilities/classes/time-span → time-span/implementations}/time-span.d.ts +49 -11
  503. package/dist/{utilities/classes/time-span → time-span/implementations}/time-span.js +33 -11
  504. package/dist/time-span/implementations/time-span.js.map +1 -0
  505. package/dist/utilities/classes/_module.d.ts +0 -3
  506. package/dist/utilities/classes/_module.js +0 -3
  507. package/dist/utilities/classes/_module.js.map +1 -1
  508. package/dist/utilities/contracts/_module.d.ts +1 -1
  509. package/dist/utilities/contracts/_module.js +1 -1
  510. package/dist/utilities/contracts/_module.js.map +1 -1
  511. package/dist/utilities/contracts/comparable.contract.d.ts +49 -0
  512. package/dist/utilities/contracts/comparable.contract.js +5 -0
  513. package/dist/utilities/contracts/comparable.contract.js.map +1 -0
  514. package/dist/utilities/functions/is-standard-schema.d.ts +6 -0
  515. package/dist/utilities/functions/is-standard-schema.js +6 -0
  516. package/dist/utilities/functions/is-standard-schema.js.map +1 -1
  517. package/dist/utilities/functions/lazy.d.ts +3 -3
  518. package/dist/utilities/functions/lazy.js +3 -3
  519. package/dist/utilities/functions/lazy.js.map +1 -1
  520. package/dist/utilities/functions/option.d.ts +3 -0
  521. package/dist/utilities/functions/option.js +3 -0
  522. package/dist/utilities/functions/option.js.map +1 -1
  523. package/dist/utilities/functions/validate.d.ts +5 -0
  524. package/dist/utilities/functions/validate.js +5 -0
  525. package/dist/utilities/functions/validate.js.map +1 -1
  526. package/dist/utilities/types/any-class.type.d.ts +6 -0
  527. package/dist/utilities/types/any-class.type.js +3 -0
  528. package/dist/utilities/types/any-class.type.js.map +1 -1
  529. package/package.json +67 -5
  530. package/dist/async/_module-exports.d.ts +0 -4
  531. package/dist/async/_module-exports.js +0 -5
  532. package/dist/async/_module-exports.js.map +0 -1
  533. package/dist/async/async.errors.d.ts +0 -47
  534. package/dist/async/async.errors.js +0 -61
  535. package/dist/async/async.errors.js.map +0 -1
  536. package/dist/async/backof-policies/_module.d.ts +0 -5
  537. package/dist/async/backof-policies/_module.js +0 -6
  538. package/dist/async/backof-policies/_module.js.map +0 -1
  539. package/dist/async/backof-policies/_shared.js.map +0 -1
  540. package/dist/async/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
  541. package/dist/async/backof-policies/constant-backoff-policy/_module.js +0 -2
  542. package/dist/async/backof-policies/constant-backoff-policy/_module.js.map +0 -1
  543. package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
  544. package/dist/async/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
  545. package/dist/async/backof-policies/exponential-backoff-policy/_module.js +0 -2
  546. package/dist/async/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
  547. package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +0 -35
  548. package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
  549. package/dist/async/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
  550. package/dist/async/backof-policies/linear-backoff-policy/_module.js +0 -2
  551. package/dist/async/backof-policies/linear-backoff-policy/_module.js.map +0 -1
  552. package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js +0 -35
  553. package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
  554. package/dist/async/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
  555. package/dist/async/backof-policies/polynomial-backoff-policy/_module.js +0 -2
  556. package/dist/async/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
  557. package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +0 -35
  558. package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
  559. package/dist/async/middlewares/_module.d.ts +0 -7
  560. package/dist/async/middlewares/_module.js +0 -8
  561. package/dist/async/middlewares/_module.js.map +0 -1
  562. package/dist/async/middlewares/bulkhead/_module.d.ts +0 -1
  563. package/dist/async/middlewares/bulkhead/_module.js +0 -2
  564. package/dist/async/middlewares/bulkhead/_module.js.map +0 -1
  565. package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +0 -80
  566. package/dist/async/middlewares/bulkhead/bulkhead.middleware.js +0 -46
  567. package/dist/async/middlewares/bulkhead/bulkhead.middleware.js.map +0 -1
  568. package/dist/async/middlewares/dynamic/_module.d.ts +0 -1
  569. package/dist/async/middlewares/dynamic/_module.js +0 -2
  570. package/dist/async/middlewares/dynamic/_module.js.map +0 -1
  571. package/dist/async/middlewares/dynamic/dynamic.middleware.js.map +0 -1
  572. package/dist/async/middlewares/fallback/_module.d.ts +0 -2
  573. package/dist/async/middlewares/fallback/_module.js +0 -3
  574. package/dist/async/middlewares/fallback/_module.js.map +0 -1
  575. package/dist/async/middlewares/fallback/fallback.middleware.js.map +0 -1
  576. package/dist/async/middlewares/fallback/fallback.types.js.map +0 -1
  577. package/dist/async/middlewares/hedging/_module.d.ts +0 -2
  578. package/dist/async/middlewares/hedging/_module.js +0 -3
  579. package/dist/async/middlewares/hedging/_module.js.map +0 -1
  580. package/dist/async/middlewares/hedging/hedging.types.d.ts +0 -121
  581. package/dist/async/middlewares/hedging/hedging.types.js +0 -6
  582. package/dist/async/middlewares/hedging/hedging.types.js.map +0 -1
  583. package/dist/async/middlewares/hedging/sequential-hedging.middleware.d.ts +0 -51
  584. package/dist/async/middlewares/hedging/sequential-hedging.middleware.js +0 -133
  585. package/dist/async/middlewares/hedging/sequential-hedging.middleware.js.map +0 -1
  586. package/dist/async/middlewares/observe/_module.d.ts +0 -2
  587. package/dist/async/middlewares/observe/_module.js +0 -3
  588. package/dist/async/middlewares/observe/_module.js.map +0 -1
  589. package/dist/async/middlewares/observe/observe.middleware.js.map +0 -1
  590. package/dist/async/middlewares/observe/observe.types.js +0 -6
  591. package/dist/async/middlewares/observe/observe.types.js.map +0 -1
  592. package/dist/async/middlewares/retry/_module.d.ts +0 -2
  593. package/dist/async/middlewares/retry/_module.js +0 -3
  594. package/dist/async/middlewares/retry/_module.js.map +0 -1
  595. package/dist/async/middlewares/retry/retry.middleware.js.map +0 -1
  596. package/dist/async/middlewares/retry/retry.types.js +0 -7
  597. package/dist/async/middlewares/retry/retry.types.js.map +0 -1
  598. package/dist/async/middlewares/timeout/_module.d.ts +0 -2
  599. package/dist/async/middlewares/timeout/_module.js +0 -3
  600. package/dist/async/middlewares/timeout/_module.js.map +0 -1
  601. package/dist/async/middlewares/timeout/timeout.middleware.js.map +0 -1
  602. package/dist/async/middlewares/timeout/timeout.type.js +0 -6
  603. package/dist/async/middlewares/timeout/timeout.type.js.map +0 -1
  604. package/dist/async/utilities/_module.d.ts +0 -4
  605. package/dist/async/utilities/_module.js +0 -5
  606. package/dist/async/utilities/_module.js.map +0 -1
  607. package/dist/async/utilities/abort-and-fail/_module.d.ts +0 -1
  608. package/dist/async/utilities/abort-and-fail/_module.js +0 -2
  609. package/dist/async/utilities/abort-and-fail/_module.js.map +0 -1
  610. package/dist/async/utilities/abort-and-fail/abort-and-fail.js.map +0 -1
  611. package/dist/async/utilities/lazy-promise/_module.d.ts +0 -1
  612. package/dist/async/utilities/lazy-promise/_module.js +0 -2
  613. package/dist/async/utilities/lazy-promise/_module.js.map +0 -1
  614. package/dist/async/utilities/lazy-promise/lazy-promise.d.ts +0 -153
  615. package/dist/async/utilities/lazy-promise/lazy-promise.js +0 -176
  616. package/dist/async/utilities/lazy-promise/lazy-promise.js.map +0 -1
  617. package/dist/async/utilities/promise-queue/_module.d.ts +0 -1
  618. package/dist/async/utilities/promise-queue/_module.js +0 -2
  619. package/dist/async/utilities/promise-queue/_module.js.map +0 -1
  620. package/dist/async/utilities/promise-queue/promise-queue.d.ts +0 -32
  621. package/dist/async/utilities/promise-queue/promise-queue.js +0 -118
  622. package/dist/async/utilities/promise-queue/promise-queue.js.map +0 -1
  623. package/dist/async/utilities/timeout-and-fail/_module.d.ts +0 -1
  624. package/dist/async/utilities/timeout-and-fail/_module.js +0 -2
  625. package/dist/async/utilities/timeout-and-fail/_module.js.map +0 -1
  626. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.d.ts +0 -7
  627. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js +0 -22
  628. package/dist/async/utilities/timeout-and-fail/timeout-and-fail.js.map +0 -1
  629. package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +0 -40
  630. package/dist/lock/implementations/derivables/lock-provider/lock-state.js +0 -60
  631. package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +0 -1
  632. package/dist/serde/contracts/serializable.contract.d.ts +0 -12
  633. package/dist/serde/contracts/serializable.contract.js +0 -5
  634. package/dist/serde/contracts/serializable.contract.js.map +0 -1
  635. package/dist/serde/implementations/adapters/mongodb-serde/_module.d.ts +0 -1
  636. package/dist/serde/implementations/adapters/mongodb-serde/_module.js +0 -2
  637. package/dist/serde/implementations/adapters/mongodb-serde/_module.js.map +0 -1
  638. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.d.ts +0 -13
  639. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js +0 -38
  640. package/dist/serde/implementations/adapters/mongodb-serde/mongodb-serde.js.map +0 -1
  641. package/dist/serde/implementations/adapters/redis-serde/_module.d.ts +0 -1
  642. package/dist/serde/implementations/adapters/redis-serde/_module.js +0 -2
  643. package/dist/serde/implementations/adapters/redis-serde/_module.js.map +0 -1
  644. package/dist/serde/implementations/adapters/redis-serde/redis-serde.d.ts +0 -13
  645. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js +0 -39
  646. package/dist/serde/implementations/adapters/redis-serde/redis-serde.js.map +0 -1
  647. package/dist/serde/implementations/adapters/sql-serde/_module.d.ts +0 -1
  648. package/dist/serde/implementations/adapters/sql-serde/_module.js +0 -2
  649. package/dist/serde/implementations/adapters/sql-serde/_module.js.map +0 -1
  650. package/dist/serde/implementations/adapters/sql-serde/sql-serde.d.ts +0 -13
  651. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js +0 -39
  652. package/dist/serde/implementations/adapters/sql-serde/sql-serde.js.map +0 -1
  653. package/dist/utilities/classes/hooks/_module.d.ts +0 -3
  654. package/dist/utilities/classes/hooks/_module.js +0 -4
  655. package/dist/utilities/classes/hooks/_module.js.map +0 -1
  656. package/dist/utilities/classes/hooks/async-hooks.js.map +0 -1
  657. package/dist/utilities/classes/hooks/hooks.js.map +0 -1
  658. package/dist/utilities/classes/hooks/types.js +0 -5
  659. package/dist/utilities/classes/hooks/types.js.map +0 -1
  660. package/dist/utilities/classes/namespace/_module.d.ts +0 -1
  661. package/dist/utilities/classes/namespace/_module.js +0 -2
  662. package/dist/utilities/classes/namespace/_module.js.map +0 -1
  663. package/dist/utilities/classes/namespace/namespace.d.ts +0 -85
  664. package/dist/utilities/classes/namespace/namespace.js +0 -125
  665. package/dist/utilities/classes/namespace/namespace.js.map +0 -1
  666. package/dist/utilities/classes/time-span/_module.d.ts +0 -1
  667. package/dist/utilities/classes/time-span/_module.js +0 -2
  668. package/dist/utilities/classes/time-span/_module.js.map +0 -1
  669. package/dist/utilities/classes/time-span/time-span.js.map +0 -1
  670. package/dist/utilities/contracts/serialized-error.contract.d.ts +0 -13
  671. package/dist/utilities/contracts/serialized-error.contract.js +0 -5
  672. package/dist/utilities/contracts/serialized-error.contract.js.map +0 -1
package/README.md CHANGED
@@ -31,9 +31,15 @@
31
31
  - **EventBus:**
32
32
  Easily send events accross different applications or in-memory.
33
33
 
34
- - **Atomic lock:**
34
+ - **Distributed lock:**
35
35
  Synchronize the access to a shared resource to prevents several processes, or concurrent code, from executing a section of code at the same time.
36
36
 
37
+ - **Distributed semaphore:**
38
+ A semaphore is a concurrency control primitive used to limit the number of processes or systems that can access a shared resource of code concurrently.
39
+
40
+ - **Distributed shared lock:**
41
+ A shared lock (a.k.a reader writer lock) is a concurrency primitive offering better concurrency than a lock by coordinating a reader semaphore for concurrent access and an writer lock for mutual exclusion, strictly preventing conflicting simultaneous access and maintaining data consistency.
42
+
37
43
  - **Serde:**
38
44
  Add custom serialization and deserialization logic that seamlessly integrates with all other components.
39
45
 
@@ -42,3 +48,4 @@
42
48
 
43
49
  - **Hooks:**
44
50
  Extend any sync and async function with agnostic hooks.@daiso-tech/core includes predefined retry, fallback, timeout and hedging hooks to easily allow handling transient failures.
51
+
@@ -0,0 +1,5 @@
1
+ export * from "../backoff-policies/_shared.js";
2
+ export * from "../backoff-policies/constant-backoff-policy/_module.js";
3
+ export * from "../backoff-policies/exponential-backoff-policy/_module.js";
4
+ export * from "../backoff-policies/linear-backoff-policy/_module.js";
5
+ export * from "../backoff-policies/polynomial-backoff-policy/_module.js";
@@ -0,0 +1,6 @@
1
+ export * from "../backoff-policies/_shared.js";
2
+ export * from "../backoff-policies/constant-backoff-policy/_module.js";
3
+ export * from "../backoff-policies/exponential-backoff-policy/_module.js";
4
+ export * from "../backoff-policies/linear-backoff-policy/_module.js";
5
+ export * from "../backoff-policies/polynomial-backoff-policy/_module.js";
6
+ //# sourceMappingURL=_module-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../src/backoff-policies/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uDAAuD,CAAC;AACtE,cAAc,0DAA0D,CAAC;AACzE,cAAc,qDAAqD,CAAC;AACpE,cAAc,yDAAyD,CAAC"}
@@ -1,21 +1,20 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import type { Invokable, TimeSpan } from "../../utilities/_module-exports.js";
4
+ import type { ITimeSpan } from "../time-span/contracts/_module-exports.js";
5
+ import type { Invokable } from "../utilities/_module-exports.js";
5
6
  /**
6
7
  * @returns Amount milliseconds to wait
7
8
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/async"`
9
- * @group BackoffPolicies
9
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
10
10
  */
11
11
  export type BackoffPolicy = Invokable<[
12
12
  attempt: number,
13
13
  error: unknown
14
- ], TimeSpan>;
14
+ ], ITimeSpan>;
15
15
  /**
16
16
  *
17
- * IMPORT_PATH: `"@daiso-tech/core/async"`
18
- * @group BackoffPolicies
17
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
19
18
  */
20
19
  export type DynamicBackoffPolicy<TSettings> = TSettings | Invokable<[error: unknown], TSettings | undefined>;
21
20
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
4
  /**
5
5
  * @internal
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../src/backoff-policies/_shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH;;GAEG;AACH,MAAM,UAAU,UAAU,CACtB,MAAc,EACd,KAAa,EACb,UAAwB;IAExB,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,UAAU,EAAE,CAAC,GAAG,KAAK,CAAC;AAC/C,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "../../backoff-policies/constant-backoff-policy/constant-backoff-policy.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../backoff-policies/constant-backoff-policy/constant-backoff-policy.js";
2
+ //# sourceMappingURL=_module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/backoff-policies/constant-backoff-policy/_module.ts"],"names":[],"mappings":"AAAA,cAAc,uEAAuE,CAAC"}
@@ -1,18 +1,17 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import { TimeSpan } from "../../../utilities/_module-exports.js";
5
- import { type BackoffPolicy, type DynamicBackoffPolicy } from "../../../async/backof-policies/_shared.js";
4
+ import { type BackoffPolicy, type DynamicBackoffPolicy } from "../../backoff-policies/_shared.js";
5
+ import { type ITimeSpan } from "../../time-span/contracts/_module-exports.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/async"`
9
- * @group BackoffPolicies
8
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
10
9
  */
11
10
  export type ConstantBackoffPolicySettings = {
12
11
  /**
13
12
  * @default 1000 milliseconds
14
13
  */
15
- delay?: TimeSpan;
14
+ delay?: ITimeSpan;
16
15
  /**
17
16
  * @default 0.5
18
17
  */
@@ -26,7 +25,6 @@ export type ConstantBackoffPolicySettings = {
26
25
  /**
27
26
  * Constant backoff policy with jitter
28
27
  *
29
- * IMPORT_PATH: `"@daiso-tech/core/async"`
30
- * @group BackoffPolicies
28
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
31
29
  */
32
30
  export declare function constantBackoffPolicy(settings?: DynamicBackoffPolicy<ConstantBackoffPolicySettings>): BackoffPolicy;
@@ -1,13 +1,14 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import { callInvokable, isInvokable, TimeSpan, } from "../../../utilities/_module-exports.js";
5
- import { withJitter, } from "../../../async/backof-policies/_shared.js";
4
+ import { callInvokable, isInvokable } from "../../utilities/_module-exports.js";
5
+ import { withJitter, } from "../../backoff-policies/_shared.js";
6
+ import { TO_MILLISECONDS, } from "../../time-span/contracts/_module-exports.js";
7
+ import { TimeSpan } from "../../time-span/implementations/_module-exports.js";
6
8
  /**
7
9
  * Constant backoff policy with jitter
8
10
  *
9
- * IMPORT_PATH: `"@daiso-tech/core/async"`
10
- * @group BackoffPolicies
11
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
11
12
  */
12
13
  export function constantBackoffPolicy(settings = {}) {
13
14
  return (_attempt, error) => {
@@ -20,12 +21,9 @@ export function constantBackoffPolicy(settings = {}) {
20
21
  settings = dynamicSettings;
21
22
  }
22
23
  }
23
- let { delay = 1000 } = settings;
24
- if (delay instanceof TimeSpan) {
25
- delay = delay.toMilliseconds();
26
- }
24
+ const { delay = TimeSpan.fromMilliseconds(100) } = settings;
27
25
  const { jitter = 0.5, _mathRandom = Math.random } = settings;
28
- return TimeSpan.fromMilliseconds(withJitter(jitter, delay, _mathRandom));
26
+ return TimeSpan.fromMilliseconds(withJitter(jitter, delay[TO_MILLISECONDS](), _mathRandom));
29
27
  };
30
28
  }
31
29
  //# sourceMappingURL=constant-backoff-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constant-backoff-policy.js","sourceRoot":"","sources":["../../../src/backoff-policies/constant-backoff-policy/constant-backoff-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EACH,UAAU,GAGb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,eAAe,GAElB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAsB1E;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACjC,WAAgE,EAAE;IAElE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QACvB,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAChC,QAAQ,GAAG,EAAE,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACJ,QAAQ,GAAG,eAAe,CAAC;YAC/B,CAAC;QACL,CAAC;QACD,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC;QAE5D,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC;QAC7D,OAAO,QAAQ,CAAC,gBAAgB,CAC5B,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,CAC5D,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "../../backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../backoff-policies/exponential-backoff-policy/exponential-backoff-policy.js";
2
+ //# sourceMappingURL=_module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/backoff-policies/exponential-backoff-policy/_module.ts"],"names":[],"mappings":"AAAA,cAAc,6EAA6E,CAAC"}
@@ -1,22 +1,21 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import { TimeSpan } from "../../../utilities/_module-exports.js";
5
- import type { BackoffPolicy, DynamicBackoffPolicy } from "../../../async/backof-policies/_shared.js";
4
+ import type { BackoffPolicy, DynamicBackoffPolicy } from "../../backoff-policies/_shared.js";
5
+ import { type ITimeSpan } from "../../time-span/contracts/_module-exports.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/async"`
9
- * @group BackoffPolicies
8
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
10
9
  */
11
10
  export type ExponentialBackoffPolicySettings = {
12
11
  /**
13
12
  * @default 60_000 milliseconds
14
13
  */
15
- maxDelay?: TimeSpan;
14
+ maxDelay?: ITimeSpan;
16
15
  /**
17
16
  * @default 1_000 milliseconds
18
17
  */
19
- minDelay?: TimeSpan;
18
+ minDelay?: ITimeSpan;
20
19
  /**
21
20
  * @default 2
22
21
  */
@@ -34,7 +33,6 @@ export type ExponentialBackoffPolicySettings = {
34
33
  /**
35
34
  * Exponential backoff policy with jitter
36
35
  *
37
- * IMPORT_PATH: `"@daiso-tech/core/async"`
38
- * @group BackoffPolicies
36
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
39
37
  */
40
38
  export declare function exponentialBackoffPolicy(settings?: DynamicBackoffPolicy<ExponentialBackoffPolicySettings>): BackoffPolicy;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module BackoffPolicy
3
+ */
4
+ import { callInvokable, isInvokable } from "../../utilities/_module-exports.js";
5
+ import { withJitter } from "../../backoff-policies/_shared.js";
6
+ import { TO_MILLISECONDS, } from "../../time-span/contracts/_module-exports.js";
7
+ import { TimeSpan } from "../../time-span/implementations/_module-exports.js";
8
+ /**
9
+ * Exponential backoff policy with jitter
10
+ *
11
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
12
+ */
13
+ export function exponentialBackoffPolicy(settings = {}) {
14
+ return (attempt, error) => {
15
+ if (isInvokable(settings)) {
16
+ const dynamicSettings = callInvokable(settings, error);
17
+ if (dynamicSettings === undefined) {
18
+ settings = {};
19
+ }
20
+ else {
21
+ settings = dynamicSettings;
22
+ }
23
+ }
24
+ const { maxDelay = TimeSpan.fromMilliseconds(60_000), minDelay = TimeSpan.fromMilliseconds(1_000), } = settings;
25
+ const { multiplier = 2, jitter = 0.5, _mathRandom = Math.random, } = settings;
26
+ const exponential = Math.min(maxDelay[TO_MILLISECONDS](), minDelay[TO_MILLISECONDS]() * Math.pow(multiplier, attempt));
27
+ return TimeSpan.fromMilliseconds(withJitter(jitter, exponential, _mathRandom));
28
+ };
29
+ }
30
+ //# sourceMappingURL=exponential-backoff-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exponential-backoff-policy.js","sourceRoot":"","sources":["../../../src/backoff-policies/exponential-backoff-policy/exponential-backoff-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EACH,eAAe,GAElB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AA8B1E;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACpC,WAAmE,EAAE;IAErE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAChC,QAAQ,GAAG,EAAE,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACJ,QAAQ,GAAG,eAAe,CAAC;YAC/B,CAAC;QACL,CAAC;QACD,MAAM,EACF,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAC5C,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAC9C,GAAG,QAAQ,CAAC;QAEb,MAAM,EACF,UAAU,GAAG,CAAC,EACd,MAAM,GAAG,GAAG,EACZ,WAAW,GAAG,IAAI,CAAC,MAAM,GAC5B,GAAG,QAAQ,CAAC;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CACxB,QAAQ,CAAC,eAAe,CAAC,EAAE,EAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAC9D,CAAC;QACF,OAAO,QAAQ,CAAC,gBAAgB,CAC5B,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,CAC/C,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "../../backoff-policies/linear-backoff-policy/linear-backoff-policy.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../backoff-policies/linear-backoff-policy/linear-backoff-policy.js";
2
+ //# sourceMappingURL=_module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/backoff-policies/linear-backoff-policy/_module.ts"],"names":[],"mappings":"AAAA,cAAc,mEAAmE,CAAC"}
@@ -1,22 +1,21 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import { TimeSpan } from "../../../utilities/_module-exports.js";
5
- import type { BackoffPolicy, DynamicBackoffPolicy } from "../../../async/backof-policies/_shared.js";
4
+ import type { BackoffPolicy, DynamicBackoffPolicy } from "../../backoff-policies/_shared.js";
5
+ import { type ITimeSpan } from "../../time-span/contracts/_module-exports.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/async"`
9
- * @group BackoffPolicies
8
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
10
9
  */
11
10
  export type LinearBackoffPolicySettings = {
12
11
  /**
13
12
  * @default 6000 milliseconds
14
13
  */
15
- maxDelay?: TimeSpan;
14
+ maxDelay?: ITimeSpan;
16
15
  /**
17
16
  * @default 1_000 milliseconds
18
17
  */
19
- minDelay?: TimeSpan;
18
+ minDelay?: ITimeSpan;
20
19
  /**
21
20
  * @default 0.5
22
21
  */
@@ -30,7 +29,6 @@ export type LinearBackoffPolicySettings = {
30
29
  /**
31
30
  * Linear backoff policy with jitter
32
31
  *
33
- * IMPORT_PATH: `"@daiso-tech/core/async"`
34
- * @group BackoffPolicies
32
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
35
33
  */
36
34
  export declare function linearBackoffPolicy(settings?: DynamicBackoffPolicy<LinearBackoffPolicySettings>): BackoffPolicy;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module BackoffPolicy
3
+ */
4
+ import { callInvokable, isInvokable } from "../../utilities/_module-exports.js";
5
+ import { withJitter } from "../../backoff-policies/_shared.js";
6
+ import { TimeSpan } from "../../time-span/implementations/_module-exports.js";
7
+ import { TO_MILLISECONDS, } from "../../time-span/contracts/_module-exports.js";
8
+ /**
9
+ * Linear backoff policy with jitter
10
+ *
11
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
12
+ */
13
+ export function linearBackoffPolicy(settings = {}) {
14
+ return (attempt, error) => {
15
+ if (isInvokable(settings)) {
16
+ const dynamicSettings = callInvokable(settings, error);
17
+ if (dynamicSettings === undefined) {
18
+ settings = {};
19
+ }
20
+ else {
21
+ settings = dynamicSettings;
22
+ }
23
+ }
24
+ const { maxDelay = TimeSpan.fromMilliseconds(6000), minDelay = TimeSpan.fromMilliseconds(1_000), } = settings;
25
+ const { jitter = 0.5, _mathRandom = Math.random } = settings;
26
+ const linear = Math.min(maxDelay[TO_MILLISECONDS](), minDelay[TO_MILLISECONDS]() * attempt);
27
+ return TimeSpan.fromMilliseconds(withJitter(jitter, linear, _mathRandom));
28
+ };
29
+ }
30
+ //# sourceMappingURL=linear-backoff-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linear-backoff-policy.js","sourceRoot":"","sources":["../../../src/backoff-policies/linear-backoff-policy/linear-backoff-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EACH,eAAe,GAElB,MAAM,0CAA0C,CAAC;AA0BlD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAC/B,WAA8D,EAAE;IAEhE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAChC,QAAQ,GAAG,EAAE,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACJ,QAAQ,GAAG,eAAe,CAAC;YAC/B,CAAC;QACL,CAAC;QACD,MAAM,EACF,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC1C,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAC9C,GAAG,QAAQ,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACnB,QAAQ,CAAC,eAAe,CAAC,EAAE,EAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,GAAG,OAAO,CACxC,CAAC;QACF,OAAO,QAAQ,CAAC,gBAAgB,CAC5B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAC1C,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "../../backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.js";
2
+ //# sourceMappingURL=_module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../src/backoff-policies/polynomial-backoff-policy/_module.ts"],"names":[],"mappings":"AAAA,cAAc,2EAA2E,CAAC"}
@@ -1,22 +1,21 @@
1
1
  /**
2
- * @module Async
2
+ * @module BackoffPolicy
3
3
  */
4
- import { TimeSpan } from "../../../utilities/_module-exports.js";
5
- import type { BackoffPolicy, DynamicBackoffPolicy } from "../../../async/backof-policies/_shared.js";
4
+ import type { BackoffPolicy, DynamicBackoffPolicy } from "../../backoff-policies/_shared.js";
5
+ import { type ITimeSpan } from "../../time-span/contracts/_module-exports.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/async"`
9
- * @group BackoffPolicies
8
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
10
9
  */
11
10
  export type PolynomialBackoffPolicySettings = {
12
11
  /**
13
12
  * @default 60_000 milliseconds
14
13
  */
15
- maxDelay?: TimeSpan;
14
+ maxDelay?: ITimeSpan;
16
15
  /**
17
16
  * @default 1_000 milliseconds
18
17
  */
19
- minDelay?: TimeSpan;
18
+ minDelay?: ITimeSpan;
20
19
  /**
21
20
  * @default 2
22
21
  */
@@ -34,7 +33,6 @@ export type PolynomialBackoffPolicySettings = {
34
33
  /**
35
34
  * Polynomial backoff policy with jitter
36
35
  *
37
- * IMPORT_PATH: `"@daiso-tech/core/async"`
38
- * @group BackoffPolicies
36
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
39
37
  */
40
38
  export declare function polynomialBackoffPolicy(settings?: DynamicBackoffPolicy<PolynomialBackoffPolicySettings>): BackoffPolicy;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module BackoffPolicy
3
+ */
4
+ import { callInvokable, isInvokable } from "../../utilities/_module-exports.js";
5
+ import { withJitter } from "../../backoff-policies/_shared.js";
6
+ import { TO_MILLISECONDS, } from "../../time-span/contracts/_module-exports.js";
7
+ import { TimeSpan } from "../../time-span/implementations/_module-exports.js";
8
+ /**
9
+ * Polynomial backoff policy with jitter
10
+ *
11
+ * IMPORT_PATH: `"@daiso-tech/core/backoff-policies"`
12
+ */
13
+ export function polynomialBackoffPolicy(settings = {}) {
14
+ return (attempt, error) => {
15
+ if (isInvokable(settings)) {
16
+ const dynamicSettings = callInvokable(settings, error);
17
+ if (dynamicSettings === undefined) {
18
+ settings = {};
19
+ }
20
+ else {
21
+ settings = dynamicSettings;
22
+ }
23
+ }
24
+ const { maxDelay = TimeSpan.fromMilliseconds(6000), minDelay = TimeSpan.fromMilliseconds(1_000), } = settings;
25
+ const { degree = 2, jitter = 0.5, _mathRandom = Math.random, } = settings;
26
+ const polynomial = Math.min(maxDelay[TO_MILLISECONDS](), minDelay[TO_MILLISECONDS]() * Math.pow(attempt, degree));
27
+ return TimeSpan.fromMilliseconds(withJitter(jitter, polynomial, _mathRandom));
28
+ };
29
+ }
30
+ //# sourceMappingURL=polynomial-backoff-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polynomial-backoff-policy.js","sourceRoot":"","sources":["../../../src/backoff-policies/polynomial-backoff-policy/polynomial-backoff-policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAK5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EACH,eAAe,GAElB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AA8B1E;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACnC,WAAkE,EAAE;IAEpE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxB,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;gBAChC,QAAQ,GAAG,EAAE,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACJ,QAAQ,GAAG,eAAe,CAAC;YAC/B,CAAC;QACL,CAAC;QACD,MAAM,EACF,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC1C,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAC9C,GAAG,QAAQ,CAAC;QACb,MAAM,EACF,MAAM,GAAG,CAAC,EACV,MAAM,GAAG,GAAG,EACZ,WAAW,GAAG,IAAI,CAAC,MAAM,GAC5B,GAAG,QAAQ,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CACvB,QAAQ,CAAC,eAAe,CAAC,EAAE,EAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAC1D,CAAC;QACF,OAAO,QAAQ,CAAC,gBAAgB,CAC5B,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAC9C,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @module Cache
3
3
  */
4
- import type { TimeSpan } from "../../utilities/_module-exports.js";
4
+ import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
5
5
  /**
6
- * The `ICacheAdapter` contract defines a way for key-value pairs independent of data storage.
6
+ * The `ICacheAdapter` contract defines a way for storing key-value pairs with expiration independent of data storage.
7
7
  *
8
8
  * IMPORT_PATH: `"@daiso-tech/core/cache/contracts"`
9
9
  * @group Contracts
@@ -36,7 +36,7 @@ export type ICacheAdapter<TType = unknown> = {
36
36
  * The `increment` method increments the given `key` with given `value`. Returns true if the `key` where incremented otherwise false will be returned.
37
37
  * If `values` is not defined then it will increment the key with 1.
38
38
  * An error will thrown if the key is not a number.
39
- * @throws {TypeCacheError} {@link TypeCacheError}
39
+ * @throws {TypeError} {@link TypeError}
40
40
  */
41
41
  increment(key: string, value: number): Promise<boolean>;
42
42
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @module Cache
3
3
  */
4
- import type { LazyPromise } from "../../async/_module-exports.js";
5
- import type { TimeSpan } from "../../utilities/_module-exports.js";
6
- import type { AsyncLazyable, NoneFunc, OneOrMore } from "../../utilities/_module-exports.js";
4
+ import type { Task } from "../../task/_module-exports.js";
5
+ import type { AsyncLazyable, NoneFunc } from "../../utilities/_module-exports.js";
7
6
  import type { CacheEventMap } from "../../cache/contracts/cache.events.js";
8
7
  import type { IEventListenable } from "../../event-bus/contracts/_module-exports.js";
8
+ import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
9
9
  /**
10
10
  * The `ICacheListenable` contract defines a way for listening {@link ICache | `ICache`} operation events.
11
11
  *
@@ -27,7 +27,7 @@ export type ICacheBase<TType = unknown> = {
27
27
  * If it's an `Iterable`, it will be joined into a single string.
28
28
  * Think of an `Iterable` as representing a path.
29
29
  */
30
- exists(key: OneOrMore<string>): LazyPromise<boolean>;
30
+ exists(key: string): Task<boolean>;
31
31
  /**
32
32
  * The `missing` method returns true when `key` is not found otherwise false will be returned.
33
33
  *
@@ -35,7 +35,7 @@ export type ICacheBase<TType = unknown> = {
35
35
  * If it's an `Iterable`, it will be joined into a single string.
36
36
  * Think of an `Iterable` as representing a path.
37
37
  */
38
- missing(key: OneOrMore<string>): LazyPromise<boolean>;
38
+ missing(key: string): Task<boolean>;
39
39
  /**
40
40
  * The `get` method returns the value when `key` is found otherwise null will be returned.
41
41
  *
@@ -43,7 +43,7 @@ export type ICacheBase<TType = unknown> = {
43
43
  * If it's an `Iterable`, it will be joined into a single string.
44
44
  * Think of an `Iterable` as representing a path.
45
45
  */
46
- get(key: OneOrMore<string>): LazyPromise<TType | null>;
46
+ get(key: string): Task<TType | null>;
47
47
  /**
48
48
  * The `getOrFail` method returns the value when `key` is found otherwise an error will be thrown.
49
49
  *
@@ -53,7 +53,7 @@ export type ICacheBase<TType = unknown> = {
53
53
  *
54
54
  * @throws {KeyNotFoundCacheError} {@link KeyNotFoundCacheError}
55
55
  */
56
- getOrFail(key: OneOrMore<string>): LazyPromise<TType>;
56
+ getOrFail(key: string): Task<TType>;
57
57
  /**
58
58
  * The `getAndRemove` method returns the value when `key` is found otherwise null will be returned.
59
59
  * The key will be removed after it is returned.
@@ -62,7 +62,7 @@ export type ICacheBase<TType = unknown> = {
62
62
  * If it's an `Iterable`, it will be joined into a single string.
63
63
  * Think of an `Iterable` as representing a path.
64
64
  */
65
- getAndRemove(key: OneOrMore<string>): LazyPromise<TType | null>;
65
+ getAndRemove(key: string): Task<TType | null>;
66
66
  /**
67
67
  * The `getOr` method will retrieve the given `key` if found otherwise `defaultValue` will be returned.
68
68
  *
@@ -70,9 +70,9 @@ export type ICacheBase<TType = unknown> = {
70
70
  * If it's an `Iterable`, it will be joined into a single string.
71
71
  * Think of an `Iterable` as representing a path.
72
72
  *
73
- * @param defaultValue - can be regular value, sync or async {@link Invokable | `Invokable`} value and {@link LazyPromise| `LazyPromise`} value.
73
+ * @param defaultValue - can be regular value, sync or async {@link Invokable | `Invokable`} value and {@link Task | `Task`} value.
74
74
  */
75
- getOr(key: OneOrMore<string>, defaultValue: AsyncLazyable<NoneFunc<TType>>): LazyPromise<TType>;
75
+ getOr(key: string, defaultValue: AsyncLazyable<NoneFunc<TType>>): Task<TType>;
76
76
  /**
77
77
  * The `getOrAdd` method will retrieve the given `key` if found otherwise `valueToAdd` will be added and returned.
78
78
  *
@@ -80,9 +80,9 @@ export type ICacheBase<TType = unknown> = {
80
80
  * If it's an `Iterable`, it will be joined into a single string.
81
81
  * Think of an `Iterable` as representing a path.
82
82
  *
83
- * @param valueToAdd - can be regular value, sync or async {@link Invokable | `Invokable`} value and {@link LazyPromise| `LazyPromise`} value.
83
+ * @param valueToAdd - can be regular value, sync or async {@link Invokable | `Invokable`} value and {@link Task | `Task`} value.
84
84
  */
85
- getOrAdd(key: OneOrMore<string>, valueToAdd: AsyncLazyable<NoneFunc<TType>>, ttl?: TimeSpan | null): LazyPromise<TType>;
85
+ getOrAdd(key: string, valueToAdd: AsyncLazyable<NoneFunc<TType>>, ttl?: ITimeSpan | null): Task<TType>;
86
86
  /**
87
87
  * The `add` method adds a `key` with given `value` when key doesn't exists.
88
88
  *
@@ -94,7 +94,7 @@ export type ICacheBase<TType = unknown> = {
94
94
  *
95
95
  * @returns Returns true when key doesn't exists otherwise false will be returned.
96
96
  */
97
- add(key: OneOrMore<string>, value: TType, ttl?: TimeSpan | null): LazyPromise<boolean>;
97
+ add(key: string, value: TType, ttl?: ITimeSpan | null): Task<boolean>;
98
98
  /**
99
99
  * The `put` method replaces th given `key` with the given `value` and `ttl` if the `key` exists
100
100
  * othwerwise it will add the given `value` with the given `ttl`.
@@ -107,7 +107,7 @@ export type ICacheBase<TType = unknown> = {
107
107
  *
108
108
  * @returns Returns true if the `key` where replaced otherwise false is returned.
109
109
  */
110
- put(key: OneOrMore<string>, value: TType, ttl?: TimeSpan | null): LazyPromise<boolean>;
110
+ put(key: string, value: TType, ttl?: ITimeSpan | null): Task<boolean>;
111
111
  /**
112
112
  * The `update` method updates the given `key` with given `value`.
113
113
  *
@@ -117,7 +117,7 @@ export type ICacheBase<TType = unknown> = {
117
117
  *
118
118
  * @returns Returns true if the `key` where updated otherwise false will be returned.
119
119
  */
120
- update(key: OneOrMore<string>, value: TType): LazyPromise<boolean>;
120
+ update(key: string, value: TType): Task<boolean>;
121
121
  /**
122
122
  * The `increment` method increments the given `key` with given `value`.
123
123
  * An error will thrown if the key is not a number.
@@ -130,9 +130,9 @@ export type ICacheBase<TType = unknown> = {
130
130
  *
131
131
  * @returns Returns true if the `key` where incremented otherwise false will be returned.
132
132
  *
133
- * @throws {TypeCacheError} {@link TypeCacheError}
133
+ * @throws {TypeError} {@link TypeError}
134
134
  */
135
- increment(key: OneOrMore<string>, value?: Extract<TType, number>): LazyPromise<boolean>;
135
+ increment(key: string, value?: Extract<TType, number>): Task<boolean>;
136
136
  /**
137
137
  * The `decrement` method decrements the given `key` with given `value`.
138
138
  * An error will thrown if the key is not a number.
@@ -145,9 +145,9 @@ export type ICacheBase<TType = unknown> = {
145
145
  *
146
146
  * @returns Returns true if the `key` where decremented otherwise false will be returned.
147
147
  *
148
- * @throws {TypeCacheError} {@link TypeCacheError}
148
+ * @throws {TypeError} {@link TypeError}
149
149
  */
150
- decrement(key: OneOrMore<string>, value?: Extract<TType, number>): LazyPromise<boolean>;
150
+ decrement(key: string, value?: Extract<TType, number>): Task<boolean>;
151
151
  /**
152
152
  * The `remove` method removes the given `key`.
153
153
  *
@@ -157,7 +157,7 @@ export type ICacheBase<TType = unknown> = {
157
157
  *
158
158
  * @returns Returns true if the key is found otherwise false is returned.
159
159
  */
160
- remove(key: OneOrMore<string>): LazyPromise<boolean>;
160
+ remove(key: string): Task<boolean>;
161
161
  /**
162
162
  * The `removeMany` method removes many keys.
163
163
  *
@@ -167,11 +167,11 @@ export type ICacheBase<TType = unknown> = {
167
167
  *
168
168
  * @returns Returns true if one of the keys where deleted otherwise false is returned.
169
169
  */
170
- removeMany(keys: Iterable<OneOrMore<string>>): LazyPromise<boolean>;
170
+ removeMany(keys: Iterable<string>): Task<boolean>;
171
171
  /**
172
172
  * The `clear` method removes all the keys in the cache. If a cache is in a group then only the keys part of the group will be removed.
173
173
  */
174
- clear(): LazyPromise<void>;
174
+ clear(): Task<void>;
175
175
  };
176
176
  /**
177
177
  * The `ICache` contract defines a way for as key-value pairs independent of data storage and listening to operation events.