@daiso-tech/core 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +8 -1
  2. package/dist/cache/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +5 -5
  3. package/dist/cache/implementations/adapters/{_module-exports.js → _module.js} +6 -6
  4. package/dist/cache/implementations/adapters/_module.js.map +1 -0
  5. package/dist/cache/implementations/adapters/kysely-cache-adapter/{_module.js → _module-exports.js} +1 -1
  6. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module-exports.js.map +1 -0
  7. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +6 -6
  8. package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +3 -3
  9. package/dist/cache/implementations/adapters/memory-cache-adapter/{_module.js → _module-exports.js} +1 -1
  10. package/dist/cache/implementations/adapters/memory-cache-adapter/_module-exports.js.map +1 -0
  11. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +2 -2
  12. package/dist/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +2 -2
  13. package/dist/cache/implementations/adapters/mongodb-cache-adapter/{_module.js → _module-exports.js} +1 -1
  14. package/dist/cache/implementations/adapters/mongodb-cache-adapter/_module-exports.js.map +1 -0
  15. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +5 -5
  16. package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +3 -3
  17. package/dist/cache/implementations/adapters/no-op-cache-adapter/{_module.js → _module-exports.js} +1 -1
  18. package/dist/cache/implementations/adapters/no-op-cache-adapter/_module-exports.js.map +1 -0
  19. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +1 -1
  20. package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +1 -1
  21. package/dist/cache/implementations/adapters/redis-cache-adapter/{_module.js → _module-exports.js} +1 -1
  22. package/dist/cache/implementations/adapters/redis-cache-adapter/_module-exports.js.map +1 -0
  23. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +4 -4
  24. package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +3 -3
  25. package/dist/cache/implementations/derivables/cache/cache.d.ts +10 -5
  26. package/dist/cache/implementations/derivables/cache/cache.js +10 -5
  27. package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
  28. package/dist/cache/implementations/derivables/cache-factory/cache-factory.d.ts +6 -4
  29. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js +6 -4
  30. package/dist/cache/implementations/derivables/cache-factory/cache-factory.js.map +1 -1
  31. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.d.ts +2 -2
  32. package/dist/cache/implementations/test-utilities/cache-adapter.test-suite.js +2 -2
  33. package/dist/cache/implementations/test-utilities/cache.test-suite.d.ts +1 -1
  34. package/dist/cache/implementations/test-utilities/cache.test-suite.js +1 -1
  35. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.d.ts +14 -7
  36. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js +14 -7
  37. package/dist/cache/implementations/test-utilities/database-cache-dapter.test-suite.js.map +1 -1
  38. package/dist/event-bus/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +3 -3
  39. package/dist/event-bus/implementations/adapters/{_module-exports.js → _module.js} +4 -4
  40. package/dist/event-bus/implementations/adapters/_module.js.map +1 -0
  41. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/{_module.js → _module-exports.js} +1 -1
  42. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/_module-exports.js.map +1 -0
  43. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +3 -3
  44. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +3 -3
  45. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/{_module.js → _module-exports.js} +1 -1
  46. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/_module-exports.js.map +1 -0
  47. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +1 -1
  48. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +1 -1
  49. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/{_module.js → _module-exports.js} +1 -1
  50. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module-exports.js.map +1 -0
  51. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +4 -4
  52. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +4 -4
  53. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
  54. package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +1 -1
  55. package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +1 -1
  56. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.d.ts +6 -4
  57. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js +6 -4
  58. package/dist/event-bus/implementations/derivables/event-bus-factory/event-bus-factory.js.map +1 -1
  59. package/dist/lock/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +5 -5
  60. package/dist/lock/implementations/adapters/{_module-exports.js → _module.js} +6 -6
  61. package/dist/lock/implementations/adapters/_module.js.map +1 -0
  62. package/dist/lock/implementations/adapters/kysely-lock-adapter/{_module.js → _module-exports.js} +1 -1
  63. package/dist/lock/implementations/adapters/kysely-lock-adapter/_module-exports.js.map +1 -0
  64. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +5 -5
  65. package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +2 -2
  66. package/dist/lock/implementations/adapters/memory-lock-adapter/{_module.js → _module-exports.js} +1 -1
  67. package/dist/lock/implementations/adapters/memory-lock-adapter/_module-exports.js.map +1 -0
  68. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +4 -4
  69. package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +3 -3
  70. package/dist/lock/implementations/adapters/mongodb-lock-adapter/{_module.js → _module-exports.js} +1 -1
  71. package/dist/lock/implementations/adapters/mongodb-lock-adapter/_module-exports.js.map +1 -0
  72. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +4 -4
  73. package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +2 -2
  74. package/dist/lock/implementations/adapters/no-op-lock-adapter/{_module.js → _module-exports.js} +1 -1
  75. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module-exports.js.map +1 -0
  76. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +1 -1
  77. package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +1 -1
  78. package/dist/lock/implementations/adapters/redis-lock-adapter/{_module.js → _module-exports.js} +1 -1
  79. package/dist/lock/implementations/adapters/redis-lock-adapter/_module-exports.js.map +1 -0
  80. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +2 -2
  81. package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +2 -2
  82. package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +12 -8
  83. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +12 -8
  84. package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
  85. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +6 -6
  86. package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js +6 -6
  87. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.d.ts +15 -10
  88. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +16 -11
  89. package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
  90. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.d.ts +1 -1
  91. package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +1 -1
  92. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.d.ts +3 -3
  93. package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +3 -3
  94. package/dist/semaphore/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +5 -5
  95. package/dist/semaphore/implementations/adapters/{_module-exports.js → _module.js} +6 -6
  96. package/dist/semaphore/implementations/adapters/_module.js.map +1 -0
  97. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/{_module.js → _module-exports.js} +1 -1
  98. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module-exports.js.map +1 -0
  99. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.d.ts +6 -6
  100. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/kysely-semaphore-adapter.js +2 -2
  101. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/{_module.js → _module-exports.js} +1 -1
  102. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module-exports.js.map +1 -0
  103. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.d.ts +4 -4
  104. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js +3 -3
  105. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/{_module.js → _module-exports.js} +1 -1
  106. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module-exports.js.map +1 -0
  107. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.d.ts +5 -5
  108. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js +2 -2
  109. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/{_module.js → _module-exports.js} +1 -1
  110. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module-exports.js.map +1 -0
  111. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.d.ts +1 -1
  112. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js +1 -1
  113. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/{_module.js → _module-exports.js} +1 -1
  114. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module-exports.js.map +1 -0
  115. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.d.ts +1 -1
  116. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js +1 -1
  117. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.d.ts +28 -1
  118. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js +28 -1
  119. package/dist/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.js.map +1 -1
  120. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.d.ts +55 -0
  121. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js +55 -0
  122. package/dist/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.js.map +1 -1
  123. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.d.ts +15 -10
  124. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js +15 -10
  125. package/dist/semaphore/implementations/test-utilities/database-semaphore-adapter.test-suite.js.map +1 -1
  126. package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.d.ts +1 -1
  127. package/dist/semaphore/implementations/test-utilities/semaphore-adapter.test-suite.js +1 -1
  128. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.d.ts +3 -3
  129. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js +5 -5
  130. package/dist/semaphore/implementations/test-utilities/semaphore-provider.test-suite.js.map +1 -1
  131. package/dist/serde/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +2 -2
  132. package/dist/serde/implementations/adapters/{_module-exports.js → _module.js} +3 -3
  133. package/dist/serde/implementations/adapters/_module.js.map +1 -0
  134. package/dist/serde/implementations/adapters/no-op-serde-adapter/{_module.js → _module-exports.js} +1 -1
  135. package/dist/serde/implementations/adapters/no-op-serde-adapter/_module-exports.js.map +1 -0
  136. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.d.ts +1 -1
  137. package/dist/serde/implementations/adapters/no-op-serde-adapter/no-op-serde-adapter.js +1 -1
  138. package/dist/serde/implementations/adapters/super-json-serde-adapter/{_module.js → _module-exports.js} +1 -1
  139. package/dist/serde/implementations/adapters/super-json-serde-adapter/_module-exports.js.map +1 -0
  140. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.d.ts +1 -1
  141. package/dist/serde/implementations/adapters/super-json-serde-adapter/super-json-serde-adapter.js +1 -1
  142. package/dist/serde/implementations/derivables/serde.d.ts +5 -5
  143. package/dist/serde/implementations/derivables/serde.js +5 -5
  144. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.d.ts +1 -1
  145. package/dist/serde/implementations/test-utilities/flexible-serde-adapter.test-suite.js +1 -1
  146. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.d.ts +1 -1
  147. package/dist/serde/implementations/test-utilities/flexible-serde.test-suite.js +1 -1
  148. package/dist/shared-lock/implementations/adapters/{_module-exports.d.ts → _module.d.ts} +5 -5
  149. package/dist/shared-lock/implementations/adapters/{_module-exports.js → _module.js} +6 -6
  150. package/dist/shared-lock/implementations/adapters/_module.js.map +1 -0
  151. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/{_module.js → _module-exports.js} +1 -1
  152. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module-exports.js.map +1 -0
  153. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.d.ts +9 -9
  154. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/kysely-shared-lock-adapter.js +4 -4
  155. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/{_module.js → _module-exports.js} +1 -1
  156. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module-exports.js.map +1 -0
  157. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.d.ts +8 -8
  158. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/memory-shared-lock-adapter.js +5 -5
  159. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/{_module.js → _module-exports.js} +1 -1
  160. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module-exports.js.map +1 -0
  161. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.d.ts +9 -9
  162. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/mongodb-shared-lock-adapter.js +4 -4
  163. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/{_module.js → _module-exports.js} +1 -1
  164. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module-exports.js.map +1 -0
  165. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.d.ts +1 -1
  166. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/no-op-shared-lock-adapter.js +1 -1
  167. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/{_module.js → _module-exports.js} +1 -1
  168. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module-exports.js.map +1 -0
  169. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.d.ts +3 -3
  170. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/redis-shared-lock-adapter.js +3 -3
  171. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.d.ts +15 -11
  172. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js +15 -11
  173. package/dist/shared-lock/implementations/derivables/shared-lock-provider/shared-lock-provider.js.map +1 -1
  174. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.d.ts +14 -14
  175. package/dist/shared-lock/implementations/derivables/shared-lock-provider-factory/shared-lock-provider-factory.js +14 -14
  176. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.d.ts +17 -12
  177. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js +17 -12
  178. package/dist/shared-lock/implementations/test-utilities/database-shared-lock-adapter.test-suite.js.map +1 -1
  179. package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.d.ts +1 -1
  180. package/dist/shared-lock/implementations/test-utilities/shared-lock-adapter.test-suite.js +1 -1
  181. package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.d.ts +3 -3
  182. package/dist/shared-lock/implementations/test-utilities/shared-lock-provider.test-suite.js +3 -3
  183. package/dist/utilities/_module-exports.d.ts +0 -1
  184. package/dist/utilities/_module-exports.js +0 -1
  185. package/dist/utilities/_module-exports.js.map +1 -1
  186. package/package.json +95 -19
  187. package/dist/cache/implementations/adapters/_module-exports.js.map +0 -1
  188. package/dist/cache/implementations/adapters/kysely-cache-adapter/_module.js.map +0 -1
  189. package/dist/cache/implementations/adapters/memory-cache-adapter/_module.js.map +0 -1
  190. package/dist/cache/implementations/adapters/mongodb-cache-adapter/_module.js.map +0 -1
  191. package/dist/cache/implementations/adapters/no-op-cache-adapter/_module.js.map +0 -1
  192. package/dist/cache/implementations/adapters/redis-cache-adapter/_module.js.map +0 -1
  193. package/dist/event-bus/implementations/adapters/_module-exports.js.map +0 -1
  194. package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/_module.js.map +0 -1
  195. package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/_module.js.map +0 -1
  196. package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map +0 -1
  197. package/dist/lock/implementations/adapters/_module-exports.js.map +0 -1
  198. package/dist/lock/implementations/adapters/kysely-lock-adapter/_module.js.map +0 -1
  199. package/dist/lock/implementations/adapters/memory-lock-adapter/_module.js.map +0 -1
  200. package/dist/lock/implementations/adapters/mongodb-lock-adapter/_module.js.map +0 -1
  201. package/dist/lock/implementations/adapters/no-op-lock-adapter/_module.js.map +0 -1
  202. package/dist/lock/implementations/adapters/redis-lock-adapter/_module.js.map +0 -1
  203. package/dist/semaphore/implementations/adapters/_module-exports.js.map +0 -1
  204. package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/_module.js.map +0 -1
  205. package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/_module.js.map +0 -1
  206. package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module.js.map +0 -1
  207. package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/_module.js.map +0 -1
  208. package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/_module.js.map +0 -1
  209. package/dist/serde/implementations/adapters/_module-exports.js.map +0 -1
  210. package/dist/serde/implementations/adapters/no-op-serde-adapter/_module.js.map +0 -1
  211. package/dist/serde/implementations/adapters/super-json-serde-adapter/_module.js.map +0 -1
  212. package/dist/shared-lock/implementations/adapters/_module-exports.js.map +0 -1
  213. package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/_module.js.map +0 -1
  214. package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/_module.js.map +0 -1
  215. package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/_module.js.map +0 -1
  216. package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/_module.js.map +0 -1
  217. package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/_module.js.map +0 -1
  218. package/dist/utilities/classes/_module.d.ts +0 -1
  219. package/dist/utilities/classes/_module.js +0 -2
  220. package/dist/utilities/classes/_module.js.map +0 -1
  221. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.d.ts +0 -1
  222. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js +0 -2
  223. package/dist/utilities/classes/kysely-table-name-transformer-plugin/_module.js.map +0 -1
  224. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.d.ts +0 -13
  225. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js +0 -51
  226. package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +0 -1
  227. /package/dist/cache/implementations/adapters/kysely-cache-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  228. /package/dist/cache/implementations/adapters/memory-cache-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  229. /package/dist/cache/implementations/adapters/mongodb-cache-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  230. /package/dist/cache/implementations/adapters/no-op-cache-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  231. /package/dist/cache/implementations/adapters/redis-cache-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  232. /package/dist/event-bus/implementations/adapters/memory-event-bus-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  233. /package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  234. /package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  235. /package/dist/lock/implementations/adapters/kysely-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  236. /package/dist/lock/implementations/adapters/memory-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  237. /package/dist/lock/implementations/adapters/mongodb-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  238. /package/dist/lock/implementations/adapters/no-op-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  239. /package/dist/lock/implementations/adapters/redis-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  240. /package/dist/semaphore/implementations/adapters/kysely-semaphore-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  241. /package/dist/semaphore/implementations/adapters/memory-semaphore-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  242. /package/dist/semaphore/implementations/adapters/mongodb-semaphore-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  243. /package/dist/semaphore/implementations/adapters/no-op-semaphore-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  244. /package/dist/semaphore/implementations/adapters/redis-semaphore-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  245. /package/dist/serde/implementations/adapters/no-op-serde-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  246. /package/dist/serde/implementations/adapters/super-json-serde-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  247. /package/dist/shared-lock/implementations/adapters/kysely-shared-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  248. /package/dist/shared-lock/implementations/adapters/memory-shared-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  249. /package/dist/shared-lock/implementations/adapters/mongodb-shared-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  250. /package/dist/shared-lock/implementations/adapters/no-op-shared-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
  251. /package/dist/shared-lock/implementations/adapters/redis-shared-lock-adapter/{_module.d.ts → _module-exports.d.ts} +0 -0
@@ -7,7 +7,7 @@ import { type IDeinitizable, type IInitizable, type InvokableFn, type IPrunable
7
7
  import { type Kysely } from "kysely";
8
8
  /**
9
9
  *
10
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
10
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
11
11
  * @group Adapters
12
12
  */
13
13
  export type KyselySemaphoreTable = {
@@ -16,7 +16,7 @@ export type KyselySemaphoreTable = {
16
16
  };
17
17
  /**
18
18
  *
19
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
19
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
20
20
  * @group Adapters
21
21
  */
22
22
  export type KyselySemaphoreSlotTable = {
@@ -26,7 +26,7 @@ export type KyselySemaphoreSlotTable = {
26
26
  };
27
27
  /**
28
28
  *
29
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
29
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
30
30
  * @group Adapters
31
31
  */
32
32
  export type KyselySemaphoreTables = {
@@ -35,7 +35,7 @@ export type KyselySemaphoreTables = {
35
35
  };
36
36
  /**
37
37
  *
38
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
38
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
39
39
  * @group Adapters
40
40
  */
41
41
  export type KyselySemaphoreAdapterSettings = {
@@ -58,7 +58,7 @@ export type KyselySemaphoreAdapterSettings = {
58
58
  * Note in order to use `KyselySemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
59
59
  * The adapter have been tested with `sqlite`, `postgres` and `mysql` databases.
60
60
  *
61
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
61
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
62
62
  * @group Adapters
63
63
  */
64
64
  export declare class KyselySemaphoreAdapter implements IDatabaseSemaphoreAdapter, IDeinitizable, IInitizable, IPrunable {
@@ -70,7 +70,7 @@ export declare class KyselySemaphoreAdapter implements IDatabaseSemaphoreAdapter
70
70
  /**
71
71
  * @example
72
72
  * ```ts
73
- * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
73
+ * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
74
74
  * import Sqlite from "better-sqlite3";
75
75
  *
76
76
  * const semaphoreAdapter = new KyselySemaphoreAdapter({
@@ -87,7 +87,7 @@ class DatabaseSemaphoreTransaction {
87
87
  * Note in order to use `KyselySemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
88
88
  * The adapter have been tested with `sqlite`, `postgres` and `mysql` databases.
89
89
  *
90
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
90
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/kysely-semaphore-adapter"`
91
91
  * @group Adapters
92
92
  */
93
93
  export class KyselySemaphoreAdapter {
@@ -99,7 +99,7 @@ export class KyselySemaphoreAdapter {
99
99
  /**
100
100
  * @example
101
101
  * ```ts
102
- * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
102
+ * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
103
103
  * import Sqlite from "better-sqlite3";
104
104
  *
105
105
  * const semaphoreAdapter = new KyselySemaphoreAdapter({
@@ -1,2 +1,2 @@
1
1
  export * from "../../../../semaphore/implementations/adapters/memory-semaphore-adapter/memory-semaphore-adapter.js";
2
- //# sourceMappingURL=_module.js.map
2
+ //# sourceMappingURL=_module-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/adapters/memory-semaphore-adapter/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,2FAA2F,CAAC"}
@@ -5,7 +5,7 @@ import type { ISemaphoreAdapter, ISemaphoreAdapterState, SemaphoreAcquireSetting
5
5
  import type { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
6
6
  /**
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
8
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/memory-semaphore-adapter"`
9
9
  * @group Adapters
10
10
  */
11
11
  export type MemorySemaphoreAdapterData = {
@@ -19,7 +19,7 @@ export type MemorySemaphoreAdapterData = {
19
19
  * Note the `MemorySemaphoreAdapter` is limited to single process usage and cannot be shared across multiple servers or different processes.
20
20
  * This adapter is meant to be used for testing.
21
21
  *
22
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
22
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/memory-semaphore-adapter"`
23
23
  * @group Adapters
24
24
  */
25
25
  export declare class MemorySemaphoreAdapter implements ISemaphoreAdapter {
@@ -27,14 +27,14 @@ export declare class MemorySemaphoreAdapter implements ISemaphoreAdapter {
27
27
  /**
28
28
  * @example
29
29
  * ```ts
30
- * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
30
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
31
31
  *
32
32
  * const semaphoreAdapter = new MemorySemaphoreAdapter();
33
33
  * ```
34
34
  * You can also provide an `Map`.
35
35
  * @example
36
36
  * ```ts
37
- * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
37
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
38
38
  *
39
39
  * const map = new Map<any, any>();
40
40
  * const semaphoreAdapter = new MemorySemaphoreAdapter(map);
@@ -5,7 +5,7 @@
5
5
  * Note the `MemorySemaphoreAdapter` is limited to single process usage and cannot be shared across multiple servers or different processes.
6
6
  * This adapter is meant to be used for testing.
7
7
  *
8
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
8
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/memory-semaphore-adapter"`
9
9
  * @group Adapters
10
10
  */
11
11
  export class MemorySemaphoreAdapter {
@@ -13,14 +13,14 @@ export class MemorySemaphoreAdapter {
13
13
  /**
14
14
  * @example
15
15
  * ```ts
16
- * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
16
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
17
17
  *
18
18
  * const semaphoreAdapter = new MemorySemaphoreAdapter();
19
19
  * ```
20
20
  * You can also provide an `Map`.
21
21
  * @example
22
22
  * ```ts
23
- * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
23
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
24
24
  *
25
25
  * const map = new Map<any, any>();
26
26
  * const semaphoreAdapter = new MemorySemaphoreAdapter(map);
@@ -1,2 +1,2 @@
1
1
  export * from "../../../../semaphore/implementations/adapters/mongodb-semaphore-adapter/mongodb-semaphore-adapter.js";
2
- //# sourceMappingURL=_module.js.map
2
+ //# sourceMappingURL=_module-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/adapters/mongodb-semaphore-adapter/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,6FAA6F,CAAC"}
@@ -8,7 +8,7 @@ import { type CollectionOptions, type Db } from "mongodb";
8
8
  import { TimeSpan } from "../../../../time-span/implementations/_module-exports.js";
9
9
  /**
10
10
  *
11
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
11
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/mongodb-semaphore-adapter"`
12
12
  * @group Adapters
13
13
  */
14
14
  export type MongodbSemaphoreSlotSubDocument = {
@@ -17,7 +17,7 @@ export type MongodbSemaphoreSlotSubDocument = {
17
17
  };
18
18
  /**
19
19
  *
20
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
20
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/mongodb-semaphore-adapter"`
21
21
  * @group Adapters
22
22
  */
23
23
  export type MongodbSemaphoreDocument = {
@@ -29,7 +29,7 @@ export type MongodbSemaphoreDocument = {
29
29
  };
30
30
  /**
31
31
  *
32
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
32
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/mongodb-semaphore-adapter"`
33
33
  * @group Adapters
34
34
  */
35
35
  export type MongodbSemaphoreAdapterSettings = {
@@ -45,7 +45,7 @@ export type MongodbSemaphoreAdapterSettings = {
45
45
  *
46
46
  * Note in order to use `MongodbSemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
47
47
  *
48
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
48
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/mongodb-semaphore-adapter"`
49
49
  * @group Adapters
50
50
  */
51
51
  export declare class MongodbSemaphoreAdapter implements ISemaphoreAdapter, IDeinitizable, IInitizable {
@@ -54,7 +54,7 @@ export declare class MongodbSemaphoreAdapter implements ISemaphoreAdapter, IDein
54
54
  /**
55
55
  * @example
56
56
  * ```ts
57
- * import { MongodbSemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
57
+ * import { MongodbSemaphoreAdapter } from "@daiso-tech/core/semaphore/mongodb-semaphore-adapter";
58
58
  * import { MongoClient } from "mongodb";
59
59
  *
60
60
  * const client = await MongoClient.connect("YOUR_MONGODB_CONNECTION_STRING");
@@ -10,7 +10,7 @@ import { TimeSpan } from "../../../../time-span/implementations/_module-exports.
10
10
  *
11
11
  * Note in order to use `MongodbSemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
12
12
  *
13
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
13
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/mongodb-semaphore-adapter"`
14
14
  * @group Adapters
15
15
  */
16
16
  export class MongodbSemaphoreAdapter {
@@ -19,7 +19,7 @@ export class MongodbSemaphoreAdapter {
19
19
  /**
20
20
  * @example
21
21
  * ```ts
22
- * import { MongodbSemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
22
+ * import { MongodbSemaphoreAdapter } from "@daiso-tech/core/semaphore/mongodb-semaphore-adapter";
23
23
  * import { MongoClient } from "mongodb";
24
24
  *
25
25
  * const client = await MongoClient.connect("YOUR_MONGODB_CONNECTION_STRING");
@@ -1,2 +1,2 @@
1
1
  export * from "../../../../semaphore/implementations/adapters/no-op-semaphore-adapter/no-op-semaphore-adapter.js";
2
- //# sourceMappingURL=_module.js.map
2
+ //# sourceMappingURL=_module-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/adapters/no-op-semaphore-adapter/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,yFAAyF,CAAC"}
@@ -6,7 +6,7 @@ import type { TimeSpan } from "../../../../time-span/implementations/_module-exp
6
6
  /**
7
7
  * This `NoOpSemaphoreAdapter` will do nothing and is used for easily mocking {@link ISemaphoreProvider | `ISemaphoreProvider`} for testing.
8
8
  *
9
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
9
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/no-op-semaphore-adapter"`
10
10
  * @group Adapters
11
11
  */
12
12
  export declare class NoOpSemaphoreAdapter implements ISemaphoreAdapter {
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * This `NoOpSemaphoreAdapter` will do nothing and is used for easily mocking {@link ISemaphoreProvider | `ISemaphoreProvider`} for testing.
6
6
  *
7
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
7
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/no-op-semaphore-adapter"`
8
8
  * @group Adapters
9
9
  */
10
10
  export class NoOpSemaphoreAdapter {
@@ -1,2 +1,2 @@
1
1
  export * from "../../../../semaphore/implementations/adapters/redis-semaphore-adapter/redis-semaphore-adapter.js";
2
- //# sourceMappingURL=_module.js.map
2
+ //# sourceMappingURL=_module-exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_module-exports.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/adapters/redis-semaphore-adapter/_module-exports.ts"],"names":[],"mappings":"AAAA,cAAc,yFAAyF,CAAC"}
@@ -21,7 +21,7 @@ declare module "ioredis" {
21
21
  *
22
22
  * Note in order to use `RedisSemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
23
23
  *
24
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
24
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/redis-semaphore-adapter"`
25
25
  * @group Adapters
26
26
  */
27
27
  export declare class RedisSemaphoreAdapter implements ISemaphoreAdapter {
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Note in order to use `RedisSemaphoreAdapter` correctly, ensure you use a single, consistent database across all server instances.
9
9
  *
10
- * IMPORT_PATH: `"@daiso-tech/core/semaphore/adapters"`
10
+ * IMPORT_PATH: `"@daiso-tech/core/semaphore/redis-semaphore-adapter"`
11
11
  * @group Adapters
12
12
  */
13
13
  export class RedisSemaphoreAdapter {
@@ -37,7 +37,7 @@ export type SemaphoreProviderSettingsBase = {
37
37
  * @default
38
38
  * ```ts
39
39
  * import { EventBus } from "@daiso-tech/core/event-bus";
40
- * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/adapters";
40
+ * import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/memory-event-bus-adapter";
41
41
  *
42
42
  * new EventBus({
43
43
  * adapter: new MemoryEventBusAdapter()
@@ -113,6 +113,33 @@ export declare class SemaphoreProvider implements ISemaphoreProvider {
113
113
  private readonly serde;
114
114
  private readonly serdeTransformerName;
115
115
  private readonly createSlotId;
116
+ /**
117
+ * @example
118
+ * ```ts
119
+ * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
120
+ * import { SemaphoreProvider } from "@daiso-tech/core/semaphore";
121
+ * import { Serde } from "@daiso-tech/core/serde";
122
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
123
+ * import Sqlite from "better-sqlite3";
124
+ * import { Kysely, SqliteDialect } from "kysely";
125
+ *
126
+ * const semaphoreAdapter = new KyselySemaphoreAdapter({
127
+ * kysely: new Kysely({
128
+ * dialect: new SqliteDialect({
129
+ * database: new Sqlite("local.db"),
130
+ * }),
131
+ * });
132
+ * });
133
+ * // You need initialize the adapter once before using it.
134
+ * await semaphoreAdapter.init();
135
+ *
136
+ * const serde = new Serde(new SuperJsonSerdeAdapter())
137
+ * const lockProvider = new SemaphoreProvider({
138
+ * serde,
139
+ * adapter: semaphoreAdapter,
140
+ * });
141
+ * ```
142
+ */
116
143
  constructor(settings: SemaphoreProviderSettings);
117
144
  private registerToSerde;
118
145
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module Semaphore
3
3
  */
4
- import { MemoryEventBusAdapter } from "../../../../event-bus/implementations/adapters/_module-exports.js";
4
+ import { MemoryEventBusAdapter } from "../../../../event-bus/implementations/adapters/_module.js";
5
5
  import { EventBus } from "../../../../event-bus/implementations/derivables/_module-exports.js";
6
6
  import { callInvokable, CORE, isPositiveNbr, resolveOneOrMore, } from "../../../../utilities/_module-exports.js";
7
7
  import { Semaphore } from "../../../../semaphore/implementations/derivables/semaphore-provider/semaphore.js";
@@ -38,6 +38,33 @@ export class SemaphoreProvider {
38
38
  serde;
39
39
  serdeTransformerName;
40
40
  createSlotId;
41
+ /**
42
+ * @example
43
+ * ```ts
44
+ * import { KyselySemaphoreAdapter } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
45
+ * import { SemaphoreProvider } from "@daiso-tech/core/semaphore";
46
+ * import { Serde } from "@daiso-tech/core/serde";
47
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
48
+ * import Sqlite from "better-sqlite3";
49
+ * import { Kysely, SqliteDialect } from "kysely";
50
+ *
51
+ * const semaphoreAdapter = new KyselySemaphoreAdapter({
52
+ * kysely: new Kysely({
53
+ * dialect: new SqliteDialect({
54
+ * database: new Sqlite("local.db"),
55
+ * }),
56
+ * });
57
+ * });
58
+ * // You need initialize the adapter once before using it.
59
+ * await semaphoreAdapter.init();
60
+ *
61
+ * const serde = new Serde(new SuperJsonSerdeAdapter())
62
+ * const lockProvider = new SemaphoreProvider({
63
+ * serde,
64
+ * adapter: semaphoreAdapter,
65
+ * });
66
+ * ```
67
+ */
41
68
  constructor(settings) {
42
69
  const { createSlotId = () => v4(), defaultTtl = TimeSpan.fromMinutes(5), defaultBlockingInterval = TimeSpan.fromSeconds(1), defaultBlockingTime = TimeSpan.fromMinutes(1), defaultRefreshTime = TimeSpan.fromMinutes(5), serde, namespace = DEFAULT_SEMAPHORE_PROVIDER_NAMESPACE, adapter, eventBus = new EventBus({
43
70
  adapter: new MemoryEventBusAdapter(),
@@ -1 +1 @@
1
- {"version":3,"file":"semaphore-provider.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,2DAA2D,CAAC;AAWrF,OAAO,EACH,aAAa,EACb,IAAI,EACJ,aAAa,EACb,gBAAgB,GAGnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,wEAAwE,CAAC;AACnG,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0FAA0F,CAAC;AACrI,OAAO,EAAE,+BAA+B,EAAE,MAAM,iGAAiG,CAAC;AAClJ,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAwF3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;AAEhF;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAiB;IACT,QAAQ,CAA+B;IACvC,OAAO,CAAoB;IAC3B,eAAe,CAEA;IACf,SAAS,CAAY;IACrB,UAAU,CAAkB;IAC5B,uBAAuB,CAAW;IAClC,mBAAmB,CAAW;IAC9B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AAsD;QAEtD,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,SAAS,CACL,SAAqB,EACrB,QAAsD;QAEtD,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,QAAyC;QACzD,MAAM,EACF,GAAG,GAAG,IAAI,CAAC,UAAU,EACrB,KAAK,EACL,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,GAC5C,GAAG,QAAQ,CAAC;QACb,aAAa,CAAC,KAAK,CAAC,CAAC;QAErB,OAAO,IAAI,SAAS,CAAC;YACjB,MAAM;YACN,KAAK;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;YAC/B,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;YACrD,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;YACrD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,SAAS,EAAE,IAAI,CAAC,SAAS;SAC5B,CAAC,CAAC;IACP,CAAC;CACJ"}
1
+ {"version":3,"file":"semaphore-provider.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/derivables/semaphore-provider/semaphore-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,Q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AAC;YACjB,MAAM;YACN,KAAK;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,eAAe,EAAE,IAAI,CAAC,QAAQ;YAC9B,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;YAC/B,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;YACrD,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;YAC/C,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;YACrD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,SAAS,EAAE,IAAI,CAAC,SAAS;SAC5B,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -29,6 +29,27 @@ export type SemaphoreProviderFactorySettings<TAdapters extends string> = Semapho
29
29
  */
30
30
  export declare class SemaphoreProviderFactory<TAdapters extends string> implements ISemaphoreProviderFactory<TAdapters> {
31
31
  private readonly settings;
32
+ /**
33
+ * @example
34
+ * ```ts
35
+ * import { SemaphoreProviderFactory } from "@daiso-tech/core/semaphore";
36
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
37
+ * import { RedisSemaphoreAdapter } from "@daiso-tech/core/semaphore/redis-semaphore-adapter";
38
+ * import { Serde } from "@daiso-tech/core/serde";
39
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
40
+ * import Redis from "ioredis"
41
+ *
42
+ * const serde = new Serde(new SuperJsonSerdeAdapter());
43
+ * const semaphoreProviderFactory = new SemaphoreProviderFactory({
44
+ * serde,
45
+ * adapters: {
46
+ * memory: new MemorySemaphoreAdapter(),
47
+ * redis: new RedisSemaphoreAdapter(new Redis("YOUR_REDIS_CONNECTION")),
48
+ * },
49
+ * defaultAdapter: "memory",
50
+ * });
51
+ * ```
52
+ */
32
53
  constructor(settings: SemaphoreProviderFactorySettings<TAdapters>);
33
54
  setNamespace(namespace: Namespace): SemaphoreProviderFactory<TAdapters>;
34
55
  setEventBus(eventBus: IEventBus): SemaphoreProviderFactory<TAdapters>;
@@ -36,5 +57,39 @@ export declare class SemaphoreProviderFactory<TAdapters extends string> implemen
36
57
  setDefaultBlockingInterval(interval: ITimeSpan): SemaphoreProviderFactory<TAdapters>;
37
58
  setDefaultBlockingTime(time: ITimeSpan): SemaphoreProviderFactory<TAdapters>;
38
59
  setDefaultRefreshTime(time: ITimeSpan): SemaphoreProviderFactory<TAdapters>;
60
+ /**
61
+ * @example
62
+ * ```ts
63
+ * import { SemaphoreProviderFactory } from "@daiso-tech/core/semaphore";
64
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
65
+ * import { RedisSemaphoreAdapter } from "@daiso-tech/core/semaphore/redis-semaphore-adapter";
66
+ * import { Serde } from "@daiso-tech/core/serde";
67
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
68
+ * import { TimeSpan } from "@daiso-tech/core/time-span" from "@daiso-tech/core/time-span";
69
+ * import Redis from "ioredis";
70
+ *
71
+ * const serde = new Serde(new SuperJsonSerdeAdapter());
72
+ * const semaphoreProviderFactory = new SemaphoreProviderFactory({
73
+ * serde,
74
+ * adapters: {
75
+ * memory: new MemorySemaphoreAdapter(),
76
+ * redis: new RedisSemaphoreAdapter(new Redis("YOUR_REDIS_CONNECTION")),
77
+ * },
78
+ * defaultAdapter: "memory",
79
+ * });
80
+ *
81
+ * // Will acquire key using the default adapter which is MemorySemaphoreAdapter
82
+ * await semaphoreProviderFactory
83
+ * .use()
84
+ * .create("a")
85
+ * .acquire();
86
+ *
87
+ * // Will acquire key using the redis adapter which is RedisSemaphoreAdapter
88
+ * await semaphoreProviderFactory
89
+ * .use("redis")
90
+ * .create("a")
91
+ * .acquire();
92
+ * ```
93
+ */
39
94
  use(adapterName?: TAdapters | undefined): ISemaphoreProvider;
40
95
  }
@@ -8,6 +8,27 @@ import { DEFAULT_SEMAPHORE_PROVIDER_NAMESPACE, SemaphoreProvider, } from "../../
8
8
  */
9
9
  export class SemaphoreProviderFactory {
10
10
  settings;
11
+ /**
12
+ * @example
13
+ * ```ts
14
+ * import { SemaphoreProviderFactory } from "@daiso-tech/core/semaphore";
15
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
16
+ * import { RedisSemaphoreAdapter } from "@daiso-tech/core/semaphore/redis-semaphore-adapter";
17
+ * import { Serde } from "@daiso-tech/core/serde";
18
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
19
+ * import Redis from "ioredis"
20
+ *
21
+ * const serde = new Serde(new SuperJsonSerdeAdapter());
22
+ * const semaphoreProviderFactory = new SemaphoreProviderFactory({
23
+ * serde,
24
+ * adapters: {
25
+ * memory: new MemorySemaphoreAdapter(),
26
+ * redis: new RedisSemaphoreAdapter(new Redis("YOUR_REDIS_CONNECTION")),
27
+ * },
28
+ * defaultAdapter: "memory",
29
+ * });
30
+ * ```
31
+ */
11
32
  constructor(settings) {
12
33
  this.settings = settings;
13
34
  }
@@ -47,6 +68,40 @@ export class SemaphoreProviderFactory {
47
68
  defaultRefreshTime: time,
48
69
  });
49
70
  }
71
+ /**
72
+ * @example
73
+ * ```ts
74
+ * import { SemaphoreProviderFactory } from "@daiso-tech/core/semaphore";
75
+ * import { MemorySemaphoreAdapter } from "@daiso-tech/core/semaphore/memory-semaphore-adapter";
76
+ * import { RedisSemaphoreAdapter } from "@daiso-tech/core/semaphore/redis-semaphore-adapter";
77
+ * import { Serde } from "@daiso-tech/core/serde";
78
+ * import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
79
+ * import { TimeSpan } from "@daiso-tech/core/time-span" from "@daiso-tech/core/time-span";
80
+ * import Redis from "ioredis";
81
+ *
82
+ * const serde = new Serde(new SuperJsonSerdeAdapter());
83
+ * const semaphoreProviderFactory = new SemaphoreProviderFactory({
84
+ * serde,
85
+ * adapters: {
86
+ * memory: new MemorySemaphoreAdapter(),
87
+ * redis: new RedisSemaphoreAdapter(new Redis("YOUR_REDIS_CONNECTION")),
88
+ * },
89
+ * defaultAdapter: "memory",
90
+ * });
91
+ *
92
+ * // Will acquire key using the default adapter which is MemorySemaphoreAdapter
93
+ * await semaphoreProviderFactory
94
+ * .use()
95
+ * .create("a")
96
+ * .acquire();
97
+ *
98
+ * // Will acquire key using the redis adapter which is RedisSemaphoreAdapter
99
+ * await semaphoreProviderFactory
100
+ * .use("redis")
101
+ * .create("a")
102
+ * .acquire();
103
+ * ```
104
+ */
50
105
  use(adapterName = this.settings.defaultAdapter) {
51
106
  if (adapterName === undefined) {
52
107
  throw new DefaultAdapterNotDefinedError(SemaphoreProviderFactory.name);
@@ -1 +1 @@
1
- {"version":3,"file":"semaphore-provider-factory.js","sourceRoot":"","sources":["../../../../../src/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.ts"],"names":[],"mappings":"AASA,OAAO,EACH,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,oCAAoC,EACpC,iBAAiB,GAEpB,MAAM,sEAAsE,CAAC;AAyB9E;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAIZ;IADrB,YACqB,QAAqD;QAArD,aAAQ,GAAR,QAAQ,CAA6C;IACvE,CAAC;IAEJ,YAAY,CAAC,SAAoB;QAC7B,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAC,QAAmB;QAC3B,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,QAAQ;SACX,CAAC,CAAC;IACP,CAAC;IAED,aAAa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Root":"","sources":["../../../../../src/semaphore/implementations/derivables/semaphore-provider-factory/semaphore-provider-factory.ts"],"names":[],"mappings":"AASA,OAAO,EACH,6BAA6B,EAC7B,wBAAwB,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACH,oCAAoC,EACpC,iBAAiB,GAEpB,MAAM,sEAAsE,CAAC;AAyB9E;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAyBZ;IAtBrB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YACqB,QAAqD;QAArD,aAAQ,GAAR,QAAQ,CAA6C;IACvE,CAAC;IAEJ,YAAY,CAAC,SAAoB;QAC7B,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,SAAS;SACZ,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAC,QAAmB;QAC3B,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,QAAQ;SACX,CAAC,CAAC;IACP,CAAC;IAED,aAAa,CAAC,GAAc;QACxB,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,UAAU,EAAE,GAAG;SAClB,CAAC,CAAC;IACP,CAAC;IAED,0BAA0B,CACtB,QAAmB;QAEnB,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,uBAAuB,EAAE,QAAQ;SACpC,CAAC,CAAC;IACP,CAAC;IAED,sBAAsB,CAClB,IAAe;QAEf,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,mBAAmB,EAAE,IAAI;SAC5B,CAAC,CAAC;IACP,CAAC;IAED,qBAAqB,CACjB,IAAe;QAEf,OAAO,IAAI,wBAAwB,CAAC;YAChC,GAAG,IAAI,CAAC,QAAQ;YAChB,kBAAkB,EAAE,IAAI;SAC3B,CAAC,CAAC;IACP,CAAC;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,GAAG,CACC,cAAqC,IAAI,CAAC,QAAQ,CAAC,cAAc;QAEjE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,IAAI,6BAA6B,CACnC,wBAAwB,CAAC,IAAI,CAChC,CAAC;QACN,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,wBAAwB,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC;QACD,MAAM,EAAE,SAAS,GAAG,oCAAoC,EAAE,GACtD,IAAI,CAAC,QAAQ,CAAC;QAClB,OAAO,IAAI,iBAAiB,CAAC;YACzB,GAAG,IAAI,CAAC,QAAQ;YAChB,OAAO;YACP,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC;YAC5C,oBAAoB,EAAE,WAAW;SACpC,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -25,24 +25,29 @@ export type DatabaseSemaphoreAdapterTestSuiteSettings = {
25
25
  * ```ts
26
26
  * import { afterEach, beforeEach, describe, expect, test } from "vitest";
27
27
  * import { databaseSemaphoreAdapterTestSuite } from "@daiso-tech/core/semaphore/test-utilities";
28
- * import { LibsqlSemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
29
- * import { type Client, createClient } from "@libsql/client";
28
+ * import { kyselySemaphoreAdapter, type KyselySemaphoreTables } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
29
+ * import { Kysely, SqliteDialect } from "kysely";
30
+ * import Sqlite, { type Database } from "better-sqlite3";
31
+ *
32
+ * describe("class: kyselySemaphoreAdapter", () => {
33
+ * let database: Database;
34
+ * let kysely: Kysely<KyselySemaphoreTables>;
30
35
  *
31
- * describe("class: LibsqlSemaphoreAdapter", () => {
32
- * let client: Client;
33
36
  * beforeEach(() => {
34
- * client = createClient({
35
- * url: ":memory:",
37
+ * database = new Sqlite(":memory:");
38
+ * kysely = new Kysely({
39
+ * dialect: new SqliteDialect({
40
+ * database,
41
+ * }),
36
42
  * });
37
43
  * });
38
44
  * afterEach(() => {
39
- * client.close();
45
+ * database.close();
40
46
  * });
41
47
  * databaseSemaphoreAdapterTestSuite({
42
48
  * createAdapter: async () => {
43
- * const semaphoreAdapter = new LibsqlSemaphoreAdapter({
44
- * database: client,
45
- * tableName: "custom_table",
49
+ * const semaphoreAdapter = new kyselySemaphoreAdapter({
50
+ * kysely,
46
51
  * shouldRemoveExpiredKeys: false,
47
52
  * });
48
53
  * await semaphoreAdapter.init();
@@ -13,24 +13,29 @@ import { TimeSpan } from "../../../time-span/implementations/_module-exports.js"
13
13
  * ```ts
14
14
  * import { afterEach, beforeEach, describe, expect, test } from "vitest";
15
15
  * import { databaseSemaphoreAdapterTestSuite } from "@daiso-tech/core/semaphore/test-utilities";
16
- * import { LibsqlSemaphoreAdapter } from "@daiso-tech/core/semaphore/adapters";
17
- * import { type Client, createClient } from "@libsql/client";
16
+ * import { kyselySemaphoreAdapter, type KyselySemaphoreTables } from "@daiso-tech/core/semaphore/kysely-semaphore-adapter";
17
+ * import { Kysely, SqliteDialect } from "kysely";
18
+ * import Sqlite, { type Database } from "better-sqlite3";
19
+ *
20
+ * describe("class: kyselySemaphoreAdapter", () => {
21
+ * let database: Database;
22
+ * let kysely: Kysely<KyselySemaphoreTables>;
18
23
  *
19
- * describe("class: LibsqlSemaphoreAdapter", () => {
20
- * let client: Client;
21
24
  * beforeEach(() => {
22
- * client = createClient({
23
- * url: ":memory:",
25
+ * database = new Sqlite(":memory:");
26
+ * kysely = new Kysely({
27
+ * dialect: new SqliteDialect({
28
+ * database,
29
+ * }),
24
30
  * });
25
31
  * });
26
32
  * afterEach(() => {
27
- * client.close();
33
+ * database.close();
28
34
  * });
29
35
  * databaseSemaphoreAdapterTestSuite({
30
36
  * createAdapter: async () => {
31
- * const semaphoreAdapter = new LibsqlSemaphoreAdapter({
32
- * database: client,
33
- * tableName: "custom_table",
37
+ * const semaphoreAdapter = new kyselySemaphoreAdapter({
38
+ * kysely,
34
39
  * shouldRemoveExpiredKeys: false,
35
40
  * });
36
41
  * await semaphoreAdapter.init();