@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
@@ -1,18 +1,16 @@
1
1
  /**
2
- * @module Utilities
2
+ * @module Hooks
3
3
  */
4
- import { type IInvokableObject, type Invokable, type InvokableFn, type OneOrMore } from "../../../utilities/functions/_module.js";
5
- import type { HookContext } from "../../../utilities/classes/hooks/types.js";
4
+ import { type IInvokableObject, type Invokable, type InvokableFn, type OneOrMore } from "../utilities/_module-exports.js";
5
+ import type { HookContext } from "../hooks/types.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
9
- * @group Hooks
8
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
10
9
  */
11
10
  export type NextFunc<TParameters extends unknown[] = unknown[], TReturn = unknown> = InvokableFn<TParameters, TReturn>;
12
11
  /**
13
12
  *
14
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
15
- * @group Hooks
13
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
16
14
  */
17
15
  export type Context<TContext extends HookContext = HookContext> = {
18
16
  name: string;
@@ -20,8 +18,7 @@ export type Context<TContext extends HookContext = HookContext> = {
20
18
  };
21
19
  /**
22
20
  *
23
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
24
- * @group Hooks
21
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
25
22
  */
26
23
  export type MiddlewareFn<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = InvokableFn<[
27
24
  arguments_: TParameters,
@@ -30,8 +27,7 @@ export type MiddlewareFn<TParameters extends unknown[] = unknown[], TReturn = un
30
27
  ], TReturn>;
31
28
  /**
32
29
  *
33
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
34
- * @group Hooks
30
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
35
31
  */
36
32
  export type IMiddlewareObject<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IInvokableObject<[
37
33
  arguments_: TParameters,
@@ -40,14 +36,12 @@ export type IMiddlewareObject<TParameters extends unknown[] = unknown[], TReturn
40
36
  ], TReturn>;
41
37
  /**
42
38
  *
43
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
44
- * @group Hooks
39
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
45
40
  */
46
41
  export type Middleware<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> = IMiddlewareObject<TParameters, TReturn, TContext> | MiddlewareFn<TParameters, TReturn, TContext>;
47
42
  /**
48
43
  *
49
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
50
- * @group Hooks
44
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
51
45
  */
52
46
  export type HooksSettings<TContext extends HookContext = HookContext> = {
53
47
  /**
@@ -66,8 +60,7 @@ export type HooksSettings<TContext extends HookContext = HookContext> = {
66
60
  *
67
61
  * Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
68
62
  *
69
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
70
- * @group Hooks
63
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
71
64
  */
72
65
  export declare class Hooks<TParameters extends unknown[] = unknown[], TReturn = unknown, TContext extends HookContext = HookContext> implements IInvokableObject<TParameters, TReturn> {
73
66
  private readonly invokable;
@@ -78,7 +71,7 @@ export declare class Hooks<TParameters extends unknown[] = unknown[], TReturn =
78
71
  /**
79
72
  * @example
80
73
  * ```ts
81
- * import { Hooks, type MiddlewareFn } from "@daiso-tech/core/utilities";
74
+ * import { Hooks, type MiddlewareFn } from "@daiso-tech/core/hooks";
82
75
  *
83
76
  * function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
84
77
  * return (args, next, { name: funcName }) => {
@@ -1,15 +1,14 @@
1
1
  /**
2
- * @module Utilities
2
+ * @module Hooks
3
3
  */
4
- import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../../../utilities/functions/_module.js";
4
+ import { getInvokableName, resolveInvokable, resolveOneOrMore, } from "../utilities/_module-exports.js";
5
5
  /**
6
6
  * The `Hooks` class provides a convenient way to change and inspect arguments and return value of only sync functions.
7
7
  * For example `Hooks` class can be used to log function arguments and return values. Note this class is immutable.
8
8
  *
9
9
  * Middlewares apply left to right: each wraps the next, with the leftmost being the outermost layer and the rightmost wrapping the original function.
10
10
  *
11
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
12
- * @group Hooks
11
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
13
12
  */
14
13
  export class Hooks {
15
14
  invokable;
@@ -35,7 +34,7 @@ export class Hooks {
35
34
  /**
36
35
  * @example
37
36
  * ```ts
38
- * import { Hooks, type MiddlewareFn } from "@daiso-tech/core/utilities";
37
+ * import { Hooks, type MiddlewareFn } from "@daiso-tech/core/hooks";
39
38
  *
40
39
  * function log<TParameters extends unknown[], TReturn>(): MiddlewareFn<TParameters, TReturn, { funcName: string; }> {
41
40
  * return (args, next, { name: funcName }) => {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKnB,MAAM,gCAAgC,CAAC;AAoFxC;;;;;;;GAOG;AACH,MAAM,OAAO,KAAK;IAoFO;IACA;IAGA;IAlFb,MAAM,CAAC,IAAI,CAKf,SAA0C,EAC1C,WAAkE,EAClE,EACI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,EAClC,OAAO,GAAG,EAAc,GACF;QAE1B,IAAI,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,WAAW,CAAC;aAC3C,GAAG,CAAC,gBAAgB,CAAC;aACrB,OAAO,EAAE,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC;YACtB,MAAM,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE,CACxC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC;YAC5B,IAAI,GAAG,CAAC,GAAG,UAAuB,EAAE,EAAE;gBAClC,OAAO,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE;oBAC1B,IAAI;oBACJ,OAAO;iBACV,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEgB,IAAI,CAAoC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACH,YACqB,SAA0C,EAC1C,WAEhB,EACgB,WAAoC,EAAE;QAJtC,cAAS,GAAT,SAAS,CAAiC;QAC1C,gBAAW,GAAX,WAAW,CAE3B;QACgB,aAAQ,GAAR,QAAQ,CAA8B;QAEvD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,IAAI,CACA,WAAkE;QAElE,OAAO,IAAI,KAAK,CACZ,IAAI,CAAC,SAAS,EACd;YACI,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC;YACrC,GAAG,gBAAgB,CAAC,WAAW,CAAC;SACnC,EACD,IAAI,CAAC,QAAQ,CAChB,CAAC;IACN,CAAC;IAED;;OAEG;IACH,QAAQ,CACJ,SAAkB,EAClB,WAAkE;QAElE,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACF,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAG,UAAuB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IACpC,CAAC;CACJ"}
@@ -1,9 +1,8 @@
1
1
  /**
2
- * @module Utilities
2
+ * @module Hooks
3
3
  */
4
4
  /**
5
5
  *
6
- * IMPORT_PATH: `"@daiso-tech/core/utilities"`
7
- * @group Hooks
6
+ * IMPORT_PATH: `"@daiso-tech/core/hooks"`
8
7
  */
9
8
  export type HookContext = Partial<Record<string | symbol, unknown>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module Hooks
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/hooks/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,7 +1,9 @@
1
- export * from "../../lock/contracts/lock-adapter.contract.js";
2
1
  export * from "../../lock/contracts/database-lock-adapter.contract.js";
3
- export * from "../../lock/contracts/lock-provider.contract.js";
2
+ export * from "../../lock/contracts/lock-adapter.contract.js";
4
3
  export * from "../../lock/contracts/lock-provider-factory.contract.js";
4
+ export * from "../../lock/contracts/lock-provider.contract.js";
5
+ export * from "../../lock/contracts/lock-state.contract.js";
5
6
  export * from "../../lock/contracts/lock.contract.js";
6
7
  export * from "../../lock/contracts/lock.errors.js";
7
8
  export * from "../../lock/contracts/lock.events.js";
9
+ export * from "../../lock/contracts/types.js";
@@ -1,8 +1,10 @@
1
- export * from "../../lock/contracts/lock-adapter.contract.js";
2
1
  export * from "../../lock/contracts/database-lock-adapter.contract.js";
3
- export * from "../../lock/contracts/lock-provider.contract.js";
2
+ export * from "../../lock/contracts/lock-adapter.contract.js";
4
3
  export * from "../../lock/contracts/lock-provider-factory.contract.js";
4
+ export * from "../../lock/contracts/lock-provider.contract.js";
5
+ export * from "../../lock/contracts/lock-state.contract.js";
5
6
  export * from "../../lock/contracts/lock.contract.js";
6
7
  export * from "../../lock/contracts/lock.errors.js";
7
8
  export * from "../../lock/contracts/lock.events.js";
9
+ export * from "../../lock/contracts/types.js";
8
10
  //# sourceMappingURL=_module-exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/lock/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oDAAoD,CAAC;AACnE,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../src/lock/contracts/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @module Lock
3
3
  */
4
+ import type { InvokableFn } from "../../utilities/_module-exports.js";
4
5
  /**
5
6
  *
6
7
  * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
@@ -24,6 +25,21 @@ export type ILockData = ILockExpirationData & {
24
25
  */
25
26
  owner: string;
26
27
  };
28
+ /**
29
+ *
30
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
31
+ * @group Contracts
32
+ */
33
+ export type IDatabaseLockTransaction = {
34
+ /**
35
+ * The `find` returns the lock if it exists otherwise `null` is returned.
36
+ */
37
+ find(key: string): Promise<ILockData | null>;
38
+ /**
39
+ * The `upsert` inserts a lock if it doesnt exist otherwise it will be updated.
40
+ */
41
+ upsert(key: string, lockId: string, expiration: Date | null): Promise<void>;
42
+ };
27
43
  /**
28
44
  * The `IDatabaseLockAdapter` contract defines a way for managing locks independent of data storage.
29
45
  * This contract simplifies the implementation of lock adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.
@@ -33,23 +49,14 @@ export type ILockData = ILockExpirationData & {
33
49
  */
34
50
  export type IDatabaseLockAdapter = {
35
51
  /**
36
- * Inserts a new lock into the database.
37
- *
38
- * @param key The unique identifier for the lock.
39
- * @param owner The identifier of the entity acquiring the lock.
40
- * @param expiration The date and time when the lock should expire. Use `null` for a lock that doesn't expire.
41
- */
42
- insert(key: string, owner: string, expiration: Date | null): Promise<void>;
43
- /**
44
- * Conditionally renews the lock on `key` if it has already expired, setting a new `owner` and `expiration`.
45
- * Note you need to check if the expiration field is not null and greater than or equal to current time.
52
+ * The `transaction` method runs the `fn` function inside a transaction.
53
+ * The `fn` function is given a {@link IDatabaseLockTransaction | `IDatabaseLockTransaction`} object.
46
54
  *
47
- * @param key The unique identifier for the lock.
48
- * @param owner The new identifier for the entity acquiring the lock.
49
- * @param expiration The new date and time when the lock should expire. Use `null` for a lock that doesn't expire.
50
- * @returns Returns number of updated.
55
+ * Note when implementing this method use the strictest transaction level mode.
51
56
  */
52
- updateIfExpired(key: string, owner: string, expiration: Date | null): Promise<number>;
57
+ transaction<TReturn>(fn: InvokableFn<[
58
+ transaction: IDatabaseLockTransaction
59
+ ], Promise<TReturn>>): Promise<TReturn>;
53
60
  /**
54
61
  * Removes a lock from the database regardless of its owner.
55
62
  *
@@ -63,7 +70,7 @@ export type IDatabaseLockAdapter = {
63
70
  * @param owner The identifier of the expected owner.
64
71
  * @returns Returns {@link ILockExpirationData |`ILockExpirationData | null`}. The {@link ILockExpirationData |`ILockExpirationData`} data if successfully removed, otherwise `null` if the lock wasn't found or the owner didn't match.
65
72
  */
66
- removeIfOwner(key: string, owner: string): Promise<ILockData | null>;
73
+ removeIfOwner(key: string, lockId: string): Promise<ILockData | null>;
67
74
  /**
68
75
  * Updates the expiration date of a lock if it is currently held by the specified owner.
69
76
  *
@@ -72,7 +79,7 @@ export type IDatabaseLockAdapter = {
72
79
  * @param expiration The new date and time when the lock should expire.
73
80
  * @returns Returns a number greater than or equal to `1` if the lock's expiration was updated, or `0` if the lock wasn't found or the owner didn't match.
74
81
  */
75
- updateExpirationIfOwner(key: string, owner: string, expiration: Date): Promise<number>;
82
+ updateExpiration(key: string, lockId: string, expiration: Date): Promise<number>;
76
83
  /**
77
84
  * Retrieves the current lock data for a given key.
78
85
  *
@@ -1,23 +1,15 @@
1
1
  /**
2
2
  * @module Lock
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
- *
7
6
  * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
8
7
  * @group Contracts
9
8
  */
10
- export declare const LOCK_REFRESH_RESULT: {
11
- readonly REFRESHED: "refreshed";
12
- readonly UNOWNED_REFRESH: "unonwned_refresh";
13
- readonly UNEXPIRABLE_KEY: "unexpireable_key";
9
+ export type ILockAdapterState = {
10
+ owner: string;
11
+ expiration: Date | null;
14
12
  };
15
- /**
16
- *
17
- * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
18
- * @group Contracts
19
- */
20
- export type LockRefreshResult = (typeof LOCK_REFRESH_RESULT)[keyof typeof LOCK_REFRESH_RESULT];
21
13
  /**
22
14
  * The `ILockAdapter` contract defines a way for managing locks independent of the underlying technology.
23
15
  * This contract is not meant to be used directly, instead you should use {@link ILockProvider | `ILockProvider`} contract.
@@ -27,29 +19,28 @@ export type LockRefreshResult = (typeof LOCK_REFRESH_RESULT)[keyof typeof LOCK_R
27
19
  */
28
20
  export type ILockAdapter = {
29
21
  /**
30
- * The `acquire` method acquires a lock only if the lock is not acquired.
22
+ * The `acquire` method acquires a lock only if expired.
31
23
  *
32
- * @returns Returns true if lock is not already acquired or false.
24
+ * @returns Returns `true` if expired otherwise `false` is returned.
33
25
  */
34
- acquire(key: string, owner: string, ttl: TimeSpan | null): Promise<boolean>;
26
+ acquire(key: string, lockId: string, ttl: TimeSpan | null): Promise<boolean>;
35
27
  /**
36
28
  * The `release` method releases a lock if the owner matches.
37
29
  *
38
- * @returns Returns true if released otherwise false is returned.
30
+ * @returns Returns `true` if released otherwise `false` is returned.
39
31
  */
40
- release(key: string, owner: string): Promise<boolean>;
32
+ release(key: string, lockId: string): Promise<boolean>;
41
33
  /**
42
34
  * The `forceRelease` method releases a lock regardless of the owner.
43
35
  *
44
- * @returns Returns true if the lock was released or false if the lock doesnt exists
36
+ * @returns Returns `true` if the lock exists or `false` if the lock is expired.
45
37
  */
46
38
  forceRelease(key: string): Promise<boolean>;
47
39
  /**
48
- * The `refresh` method will upadte `ttl` of lock if it matches the given `key`, given `owner` and is expireable.
49
- * @returns
50
- * - {@link LOCK_REFRESH_RESULT.UNOWNED_REFRESH | `LOCK_REFRESH_RESULT.UNOWNED_REFRESH`}: The lock doesn't exist or is owned by a different owner.
51
- * - {@link LOCK_REFRESH_RESULT.UNEXPIRABLE_KEY | `LOCK_REFRESH_RESULT.UNEXPIRABLE_KEY`}: The lock is owned by the same owner but cannot be refreshed because it's unexpirable.
52
- * - {@link LOCK_REFRESH_RESULT.REFRESHED | `LOCK_REFRESH_RESULT.REFRESHED`}: The lock is owned by the same owner and its ttl has been updated.
40
+ * The `refresh` method will upadte `ttl` of lock if it matches the `owner` and is expireable.
41
+ *
42
+ * @returns Returns `false` if the lock is unexpireable, the is expired, does not match the `owner` otherwise `true` is returned.
53
43
  */
54
- refresh(key: string, owner: string, ttl: TimeSpan): Promise<LockRefreshResult>;
44
+ refresh(key: string, lockId: string, ttl: TimeSpan): Promise<boolean>;
45
+ getState(key: string): Promise<ILockAdapterState | null>;
55
46
  };
@@ -1,14 +1,5 @@
1
1
  /**
2
2
  * @module Lock
3
3
  */
4
- /**
5
- *
6
- * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
7
- * @group Contracts
8
- */
9
- export const LOCK_REFRESH_RESULT = {
10
- REFRESHED: "refreshed",
11
- UNOWNED_REFRESH: "unonwned_refresh",
12
- UNEXPIRABLE_KEY: "unexpireable_key",
13
- };
4
+ export {};
14
5
  //# sourceMappingURL=lock-adapter.contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lock-adapter.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,kBAAkB;IACnC,eAAe,EAAE,kBAAkB;CAC7B,CAAC"}
1
+ {"version":3,"file":"lock-adapter.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-adapter.contract.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @module Lock
3
3
  */
4
- import type { OneOrMore, TimeSpan } from "../../utilities/_module-exports.js";
5
4
  import type { ILock } from "../../lock/contracts/lock.contract.js";
6
5
  import type { IEventListenable } from "../../event-bus/contracts/_module-exports.js";
7
6
  import type { LockEventMap } from "../../lock/contracts/lock.events.js";
7
+ import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
8
8
  /**
9
9
  * The `ILockListenable` contract defines a way for listening {@link ILock | `ILock`} operations.
10
10
  *
@@ -21,11 +21,11 @@ export type LockProviderCreateSettings = {
21
21
  /**
22
22
  * You can also provide a `settings.ttl` value using. If not specified it defaults to null, meaning no TTL is applied.
23
23
  */
24
- ttl?: TimeSpan | null;
24
+ ttl?: ITimeSpan | null;
25
25
  /**
26
- * You can provide a custom owner. If not specified a unique owner will be generated by default.
26
+ * You can provide a custom lock id. If not specified a unique lock id will be generated by default.
27
27
  */
28
- owner?: OneOrMore<string>;
28
+ lockId?: string;
29
29
  };
30
30
  /**
31
31
  *
@@ -40,7 +40,7 @@ export type ILockProviderBase = {
40
40
  * If it's an `Iterable`, it will be joined into a single string.
41
41
  * Think of an `Iterable` as representing a path.
42
42
  */
43
- create(key: OneOrMore<string>, settings?: LockProviderCreateSettings): ILock;
43
+ create(key: string, settings?: LockProviderCreateSettings): ILock;
44
44
  };
45
45
  /**
46
46
  * The `ILockProvider` contract defines a way for managing locks independent of the underlying technology.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @module Lock
3
+ */
4
+ import type { TimeSpan } from "../../time-span/implementations/_module-exports.js";
5
+ /**
6
+ *
7
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
8
+ * @group Contracts
9
+ */
10
+ export declare const LOCK_STATE: {
11
+ readonly EXPIRED: "EXPIRED";
12
+ readonly UNAVAILABLE: "UNAVAILABLE";
13
+ readonly ACQUIRED: "ACQUIRED";
14
+ };
15
+ /**
16
+ *
17
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
18
+ * @group Contracts
19
+ */
20
+ export type LockState = (typeof LOCK_STATE)[keyof typeof LOCK_STATE];
21
+ /**
22
+ *
23
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
24
+ * @group Contracts
25
+ */
26
+ export type ILockExpiredState = {
27
+ type: (typeof LOCK_STATE)["EXPIRED"];
28
+ };
29
+ /**
30
+ *
31
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
32
+ * @group Contracts
33
+ */
34
+ export type ILockUnavailableState = {
35
+ type: (typeof LOCK_STATE)["UNAVAILABLE"];
36
+ owner: string;
37
+ };
38
+ /**
39
+ *
40
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
41
+ * @group Contracts
42
+ */
43
+ export type ILockAcquiredState = {
44
+ type: (typeof LOCK_STATE)["ACQUIRED"];
45
+ remainingTime: TimeSpan | null;
46
+ };
47
+ /**
48
+ *
49
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
50
+ * @group Contracts
51
+ */
52
+ export type ILockState = ILockUnavailableState | ILockAcquiredState | ILockExpiredState;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module Lock
3
+ */
4
+ /**
5
+ *
6
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
7
+ * @group Contracts
8
+ */
9
+ export const LOCK_STATE = {
10
+ EXPIRED: "EXPIRED",
11
+ UNAVAILABLE: "UNAVAILABLE",
12
+ ACQUIRED: "ACQUIRED",
13
+ };
14
+ //# sourceMappingURL=lock-state.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-state.contract.js","sourceRoot":"","sources":["../../../src/lock/contracts/lock-state.contract.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,UAAU;CACd,CAAC"}
@@ -1,120 +1,129 @@
1
1
  /**
2
2
  * @module Lock
3
3
  */
4
- import type { AsyncLazy, Result, TimeSpan } from "../../utilities/_module-exports.js";
5
- import type { LazyPromise } from "../../async/_module-exports.js";
6
- import type { KeyAlreadyAcquiredLockError } from "../../lock/contracts/lock.errors.js";
4
+ import type { AsyncLazy, Result } from "../../utilities/_module-exports.js";
5
+ import type { Task } from "../../task/_module-exports.js";
6
+ import type { FailedAcquireLockError } from "../../lock/contracts/lock.errors.js";
7
+ import type { ILockState } from "../../lock/contracts/lock-state.contract.js";
8
+ import type { ITimeSpan } from "../../time-span/contracts/_module-exports.js";
7
9
  /**
8
10
  *
9
11
  * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
10
12
  * @group Contracts
11
13
  */
12
14
  export type LockAquireBlockingSettings = {
13
- time?: TimeSpan;
14
- interval?: TimeSpan;
15
+ time?: ITimeSpan;
16
+ interval?: ITimeSpan;
15
17
  };
16
18
  /**
17
19
  *
18
20
  * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
19
21
  * @group Contracts
20
22
  */
21
- export type ILock = {
23
+ export type ILockStateMethods = {
24
+ getState(): Task<ILockState>;
22
25
  /**
23
- * The `run` method wraps an {@link Invokable | `Invokable`} or {@link LazyPromise| `LazyPromise`} with the `acquire` and `release` method.
26
+ * The `key` of the `ILock` instance.
24
27
  */
25
- run<TValue = void>(asyncFn: AsyncLazy<TValue>): LazyPromise<Result<TValue, KeyAlreadyAcquiredLockError>>;
28
+ readonly key: string;
26
29
  /**
27
- * The `runOrFail` method wraps an {@link Invokable | `Invokable`} or {@link LazyPromise| `LazyPromise`} with the `acquireOrFail` and `release` method.
28
- * @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
30
+ * The `id` of the `ILock` instance.
29
31
  */
30
- runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): LazyPromise<TValue>;
32
+ readonly id: string;
31
33
  /**
32
- * The `runBlocking` method wraps an {@link Invokable | `Invokable`} or {@link LazyPromise| `LazyPromise`} with the `acquireBlocking` and `release` method.
34
+ * The `ttl` of `ILock` instance.
33
35
  */
34
- runBlocking<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): LazyPromise<Result<TValue, KeyAlreadyAcquiredLockError>>;
36
+ readonly ttl: ITimeSpan | null;
37
+ };
38
+ /**
39
+ *
40
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
41
+ * @group Contracts
42
+ */
43
+ export type ILockBase = {
35
44
  /**
36
- * The `runBlockingOrFail` method wraps an {@link Invokable | `Invokable`} or {@link LazyPromise| `LazyPromise`} with the `acquireBlockingOrFail` and `release` method.
37
- * @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
45
+ * The `run` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquire` and `release` method.
38
46
  */
39
- runBlockingOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): LazyPromise<TValue>;
47
+ run<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<Result<TValue, FailedAcquireLockError>>;
40
48
  /**
41
- * The `acquire` method acquires a lock only if the lock is not already acquired by different owner.
49
+ * The `runOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireOrFail` and `release` method.
50
+ * @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
51
+ */
52
+ runOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>): Task<TValue>;
53
+ /**
54
+ * The `runBlocking` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlocking` and `release` method.
55
+ */
56
+ runBlocking<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<Result<TValue, FailedAcquireLockError>>;
57
+ /**
58
+ * The `runBlockingOrFail` method wraps an {@link Invokable | `Invokable`} or {@link Task | `Task`} with the `acquireBlockingOrFail` and `release` method.
59
+ * @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
60
+ */
61
+ runBlockingOrFail<TValue = void>(asyncFn: AsyncLazy<TValue>, settings?: LockAquireBlockingSettings): Task<TValue>;
62
+ /**
63
+ * The `acquire` method acquires a lock only if the key is not already acquired by different owner.
42
64
  *
43
65
  * @returns Returns true if the lock is not already acquired otherwise false is returned.
44
66
  */
45
- acquire(): LazyPromise<boolean>;
67
+ acquire(): Task<boolean>;
46
68
  /**
47
- * The `acquireOrFail` method acquires a lock only if the lock is not already acquired by different owner.
69
+ * The `acquireOrFail` method acquires a lock only if the key is not already acquired by different owner.
48
70
  * Throws an error if the lock is already acquired by different owner.
49
71
  *
50
- * @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
72
+ * @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
51
73
  */
52
- acquireOrFail(): LazyPromise<void>;
74
+ acquireOrFail(): Task<void>;
53
75
  /**
54
- * The `acquireBlocking` method acquires a lock only if the lock is not already acquired by different owner.
76
+ * The `acquireBlocking` method acquires a lock only if the key is not already acquired by different owner.
55
77
  * If the lock is not acquired, it retries every `settings.interval` until `settings.time` is reached.
56
78
  *
57
79
  * @returns Returns true if the lock is not already acquired otherwise false is returned.
58
80
  */
59
- acquireBlocking(settings?: LockAquireBlockingSettings): LazyPromise<boolean>;
81
+ acquireBlocking(settings?: LockAquireBlockingSettings): Task<boolean>;
60
82
  /**
61
- * The `acquireBlockingOrFail` method acquires a lock only if the lock is not already acquired by different owner.
83
+ * The `acquireBlockingOrFail` method acquires a lock only if the key is not already acquired by different owner.
62
84
  * If the lock is not acquired, it retries every `settings.interval` until `settings.time` is reached.
63
85
  * Throws an error if the lock is already acquired by different owner.
64
86
  *
65
- * @throws {KeyAlreadyAcquiredLockError} {@link KeyAlreadyAcquiredLockError}
87
+ * @throws {FailedAcquireLockError} {@link FailedAcquireLockError}
66
88
  */
67
- acquireBlockingOrFail(settings?: LockAquireBlockingSettings): LazyPromise<void>;
89
+ acquireBlockingOrFail(settings?: LockAquireBlockingSettings): Task<void>;
68
90
  /**
69
91
  * The `release` method releases a lock if owned by the same owner.
70
92
  *
71
93
  * @returns Returns true if the lock is released otherwise false is returned.
72
94
  */
73
- release(): LazyPromise<boolean>;
95
+ release(): Task<boolean>;
74
96
  /**
75
97
  * The `releaseOrFail` method releases a lock if owned by the same owner.
76
- * Throws an error if a different owner attempts to release the lock.
98
+ * Throws an error if the lock is not owned by same owner.
77
99
  *
78
- * @throws {UnownedReleaseLockError} {@link UnownedReleaseLockError}
100
+ * @throws {FailedReleaseLockError} {@link FailedReleaseLockError}
79
101
  */
80
- releaseOrFail(): LazyPromise<void>;
102
+ releaseOrFail(): Task<void>;
81
103
  /**
82
104
  * The `forceRelease` method releases a lock regardless of the owner.
83
105
  *
84
- * @returns Returns true if the lock was released or false if the lock doesnt exists
85
- */
86
- forceRelease(): LazyPromise<boolean>;
87
- /**
88
- * The `isExpired` method returns true if the lock is expired otherwise false is returned.
89
- */
90
- isExpired(): LazyPromise<boolean>;
91
- /**
92
- * The `isLocked` method returns true if the lock is unexpirable or unexpired otherwise false is returned.
106
+ * @returns Returns true if the lock exists or false if the lock doesnt exists.
93
107
  */
94
- isLocked(): LazyPromise<boolean>;
108
+ forceRelease(): Task<boolean>;
95
109
  /**
96
110
  * The `refresh` method updates the `ttl` of the lock if expireable and owned by the same owner.
97
111
  *
98
112
  * @returns Returns true if the lock is refreshed otherwise false is returned.
99
113
  */
100
- refresh(ttl?: TimeSpan): LazyPromise<boolean>;
114
+ refresh(ttl?: ITimeSpan): Task<boolean>;
101
115
  /**
102
116
  * The `refreshOrFail` method updates the `ttl` of the lock if expireable and owned by the same owner.
103
- * Throws an error if a different owner attempts to refresh the lock.
117
+ * Throws an error if the lock is not owned by same owner.
104
118
  * Throws an error if the key is unexpirable.
105
119
  *
106
- * @throws {UnownedRefreshLockError} {@link UnownedRefreshLockError}
107
- * @throws {UnrefreshableKeyLockError} {@link UnrefreshableKeyLockError}
120
+ * @throws {FailedRefreshLockError} {@link FailedRefreshLockError}
108
121
  */
109
- refreshOrFail(ttl?: TimeSpan): LazyPromise<void>;
110
- /**
111
- * The `getRemainingTime` return the reaming time as {@link TimeSpan | `TimeSpan`}.
112
- *
113
- * @returns Returns null if the key doesnt exist, key has no expiration and key has expired.
114
- */
115
- getRemainingTime(): LazyPromise<TimeSpan | null>;
116
- /**
117
- * The `getOwner` method return the current owner.
118
- */
119
- getOwner(): LazyPromise<string>;
122
+ refreshOrFail(ttl?: ITimeSpan): Task<void>;
120
123
  };
124
+ /**
125
+ *
126
+ * IMPORT_PATH: `"@daiso-tech/core/lock/contracts"`
127
+ * @group Contracts
128
+ */
129
+ export type ILock = ILockBase & ILockStateMethods;