@xeno-js/shared 0.1.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 (731) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +274 -0
  3. package/dist/application/cqrs/command/command.d.ts +8 -0
  4. package/dist/application/cqrs/command/command.d.ts.map +1 -0
  5. package/dist/application/cqrs/command/command.js +9 -0
  6. package/dist/application/cqrs/command/command.js.map +1 -0
  7. package/dist/application/cqrs/command/index.d.ts +2 -0
  8. package/dist/application/cqrs/command/index.d.ts.map +1 -0
  9. package/dist/application/cqrs/command/index.js +2 -0
  10. package/dist/application/cqrs/command/index.js.map +1 -0
  11. package/dist/application/cqrs/index.d.ts +3 -0
  12. package/dist/application/cqrs/index.d.ts.map +1 -0
  13. package/dist/application/cqrs/index.js +3 -0
  14. package/dist/application/cqrs/index.js.map +1 -0
  15. package/dist/application/cqrs/query/index.d.ts +2 -0
  16. package/dist/application/cqrs/query/index.d.ts.map +1 -0
  17. package/dist/application/cqrs/query/index.js +2 -0
  18. package/dist/application/cqrs/query/index.js.map +1 -0
  19. package/dist/application/cqrs/query/query.d.ts +9 -0
  20. package/dist/application/cqrs/query/query.d.ts.map +1 -0
  21. package/dist/application/cqrs/query/query.js +11 -0
  22. package/dist/application/cqrs/query/query.js.map +1 -0
  23. package/dist/application/index.d.ts +3 -0
  24. package/dist/application/index.d.ts.map +1 -0
  25. package/dist/application/index.js +3 -0
  26. package/dist/application/index.js.map +1 -0
  27. package/dist/application/loggers/__tests__/base.logger.test.d.ts +2 -0
  28. package/dist/application/loggers/__tests__/base.logger.test.d.ts.map +1 -0
  29. package/dist/application/loggers/__tests__/base.logger.test.js +132 -0
  30. package/dist/application/loggers/__tests__/base.logger.test.js.map +1 -0
  31. package/dist/application/loggers/base.logger.d.ts +48 -0
  32. package/dist/application/loggers/base.logger.d.ts.map +1 -0
  33. package/dist/application/loggers/base.logger.js +68 -0
  34. package/dist/application/loggers/base.logger.js.map +1 -0
  35. package/dist/application/loggers/index.d.ts +2 -0
  36. package/dist/application/loggers/index.d.ts.map +1 -0
  37. package/dist/application/loggers/index.js +2 -0
  38. package/dist/application/loggers/index.js.map +1 -0
  39. package/dist/domain/config/auth.config.d.ts +14 -0
  40. package/dist/domain/config/auth.config.d.ts.map +1 -0
  41. package/dist/domain/config/auth.config.js +2 -0
  42. package/dist/domain/config/auth.config.js.map +1 -0
  43. package/dist/domain/config/cache.config.d.ts +92 -0
  44. package/dist/domain/config/cache.config.d.ts.map +1 -0
  45. package/dist/domain/config/cache.config.js +2 -0
  46. package/dist/domain/config/cache.config.js.map +1 -0
  47. package/dist/domain/config/db.config.d.ts +29 -0
  48. package/dist/domain/config/db.config.d.ts.map +1 -0
  49. package/dist/domain/config/db.config.js +2 -0
  50. package/dist/domain/config/db.config.js.map +1 -0
  51. package/dist/domain/config/http.config.d.ts +148 -0
  52. package/dist/domain/config/http.config.d.ts.map +1 -0
  53. package/dist/domain/config/http.config.js +2 -0
  54. package/dist/domain/config/http.config.js.map +1 -0
  55. package/dist/domain/config/index.d.ts +5 -0
  56. package/dist/domain/config/index.d.ts.map +1 -0
  57. package/dist/domain/config/index.js +2 -0
  58. package/dist/domain/config/index.js.map +1 -0
  59. package/dist/domain/config/resilience.config.d.ts +94 -0
  60. package/dist/domain/config/resilience.config.d.ts.map +1 -0
  61. package/dist/domain/config/resilience.config.js +2 -0
  62. package/dist/domain/config/resilience.config.js.map +1 -0
  63. package/dist/domain/contracts/cache/icache.contracts.d.ts +93 -0
  64. package/dist/domain/contracts/cache/icache.contracts.d.ts.map +1 -0
  65. package/dist/domain/contracts/cache/icache.contracts.js +2 -0
  66. package/dist/domain/contracts/cache/icache.contracts.js.map +1 -0
  67. package/dist/domain/contracts/cache/ikey-builder.contracts.d.ts +34 -0
  68. package/dist/domain/contracts/cache/ikey-builder.contracts.d.ts.map +1 -0
  69. package/dist/domain/contracts/cache/ikey-builder.contracts.js +2 -0
  70. package/dist/domain/contracts/cache/ikey-builder.contracts.js.map +1 -0
  71. package/dist/domain/contracts/cache/index.d.ts +3 -0
  72. package/dist/domain/contracts/cache/index.d.ts.map +1 -0
  73. package/dist/domain/contracts/cache/index.js +2 -0
  74. package/dist/domain/contracts/cache/index.js.map +1 -0
  75. package/dist/domain/contracts/configuration/iconfiguration.contracts.d.ts +61 -0
  76. package/dist/domain/contracts/configuration/iconfiguration.contracts.d.ts.map +1 -0
  77. package/dist/domain/contracts/configuration/iconfiguration.contracts.js +2 -0
  78. package/dist/domain/contracts/configuration/iconfiguration.contracts.js.map +1 -0
  79. package/dist/domain/contracts/configuration/index.d.ts +2 -0
  80. package/dist/domain/contracts/configuration/index.d.ts.map +1 -0
  81. package/dist/domain/contracts/configuration/index.js +2 -0
  82. package/dist/domain/contracts/configuration/index.js.map +1 -0
  83. package/dist/domain/contracts/context/context_types/identity-context.types.d.ts +63 -0
  84. package/dist/domain/contracts/context/context_types/identity-context.types.d.ts.map +1 -0
  85. package/dist/domain/contracts/context/context_types/identity-context.types.js +2 -0
  86. package/dist/domain/contracts/context/context_types/identity-context.types.js.map +1 -0
  87. package/dist/domain/contracts/context/context_types/index.d.ts +6 -0
  88. package/dist/domain/contracts/context/context_types/index.d.ts.map +1 -0
  89. package/dist/domain/contracts/context/context_types/index.js +2 -0
  90. package/dist/domain/contracts/context/context_types/index.js.map +1 -0
  91. package/dist/domain/contracts/context/context_types/messaging-context.types.d.ts +70 -0
  92. package/dist/domain/contracts/context/context_types/messaging-context.types.d.ts.map +1 -0
  93. package/dist/domain/contracts/context/context_types/messaging-context.types.js +2 -0
  94. package/dist/domain/contracts/context/context_types/messaging-context.types.js.map +1 -0
  95. package/dist/domain/contracts/context/context_types/network-context.types.d.ts +82 -0
  96. package/dist/domain/contracts/context/context_types/network-context.types.d.ts.map +1 -0
  97. package/dist/domain/contracts/context/context_types/network-context.types.js +2 -0
  98. package/dist/domain/contracts/context/context_types/network-context.types.js.map +1 -0
  99. package/dist/domain/contracts/context/context_types/request-context.types.d.ts +48 -0
  100. package/dist/domain/contracts/context/context_types/request-context.types.d.ts.map +1 -0
  101. package/dist/domain/contracts/context/context_types/request-context.types.js +2 -0
  102. package/dist/domain/contracts/context/context_types/request-context.types.js.map +1 -0
  103. package/dist/domain/contracts/context/context_types/tracing-context.types.d.ts +54 -0
  104. package/dist/domain/contracts/context/context_types/tracing-context.types.d.ts.map +1 -0
  105. package/dist/domain/contracts/context/context_types/tracing-context.types.js +2 -0
  106. package/dist/domain/contracts/context/context_types/tracing-context.types.js.map +1 -0
  107. package/dist/domain/contracts/context/index.d.ts +3 -0
  108. package/dist/domain/contracts/context/index.d.ts.map +1 -0
  109. package/dist/domain/contracts/context/index.js +2 -0
  110. package/dist/domain/contracts/context/index.js.map +1 -0
  111. package/dist/domain/contracts/context/irequest-context.contracts.d.ts +68 -0
  112. package/dist/domain/contracts/context/irequest-context.contracts.d.ts.map +1 -0
  113. package/dist/domain/contracts/context/irequest-context.contracts.js +2 -0
  114. package/dist/domain/contracts/context/irequest-context.contracts.js.map +1 -0
  115. package/dist/domain/contracts/controllers/icontroller.contracts.d.ts +25 -0
  116. package/dist/domain/contracts/controllers/icontroller.contracts.d.ts.map +1 -0
  117. package/dist/domain/contracts/controllers/icontroller.contracts.js +2 -0
  118. package/dist/domain/contracts/controllers/icontroller.contracts.js.map +1 -0
  119. package/dist/domain/contracts/controllers/index.d.ts +2 -0
  120. package/dist/domain/contracts/controllers/index.d.ts.map +1 -0
  121. package/dist/domain/contracts/controllers/index.js +2 -0
  122. package/dist/domain/contracts/controllers/index.js.map +1 -0
  123. package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.d.ts +30 -0
  124. package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.d.ts.map +1 -0
  125. package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.js +2 -0
  126. package/dist/domain/contracts/cqrs/cqrs_types/icommand.types.js.map +1 -0
  127. package/dist/domain/contracts/cqrs/cqrs_types/index.d.ts +4 -0
  128. package/dist/domain/contracts/cqrs/cqrs_types/index.d.ts.map +1 -0
  129. package/dist/domain/contracts/cqrs/cqrs_types/index.js +2 -0
  130. package/dist/domain/contracts/cqrs/cqrs_types/index.js.map +1 -0
  131. package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.d.ts +32 -0
  132. package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.d.ts.map +1 -0
  133. package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.js +2 -0
  134. package/dist/domain/contracts/cqrs/cqrs_types/iquery.types.js.map +1 -0
  135. package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.d.ts +30 -0
  136. package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.d.ts.map +1 -0
  137. package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.js +2 -0
  138. package/dist/domain/contracts/cqrs/cqrs_types/irequest.types.js.map +1 -0
  139. package/dist/domain/contracts/cqrs/ihandler.contracts.d.ts +30 -0
  140. package/dist/domain/contracts/cqrs/ihandler.contracts.d.ts.map +1 -0
  141. package/dist/domain/contracts/cqrs/ihandler.contracts.js +2 -0
  142. package/dist/domain/contracts/cqrs/ihandler.contracts.js.map +1 -0
  143. package/dist/domain/contracts/cqrs/imediator.contracts.d.ts +41 -0
  144. package/dist/domain/contracts/cqrs/imediator.contracts.d.ts.map +1 -0
  145. package/dist/domain/contracts/cqrs/imediator.contracts.js +2 -0
  146. package/dist/domain/contracts/cqrs/imediator.contracts.js.map +1 -0
  147. package/dist/domain/contracts/cqrs/index.d.ts +5 -0
  148. package/dist/domain/contracts/cqrs/index.d.ts.map +1 -0
  149. package/dist/domain/contracts/cqrs/index.js +2 -0
  150. package/dist/domain/contracts/cqrs/index.js.map +1 -0
  151. package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.d.ts +42 -0
  152. package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.d.ts.map +1 -0
  153. package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.js +2 -0
  154. package/dist/domain/contracts/cqrs/ipipeline-behavior.contracts.js.map +1 -0
  155. package/dist/domain/contracts/datasources/index.d.ts +4 -0
  156. package/dist/domain/contracts/datasources/index.d.ts.map +1 -0
  157. package/dist/domain/contracts/datasources/index.js +2 -0
  158. package/dist/domain/contracts/datasources/index.js.map +1 -0
  159. package/dist/domain/contracts/datasources/iread-datasource.contracts.d.ts +41 -0
  160. package/dist/domain/contracts/datasources/iread-datasource.contracts.d.ts.map +1 -0
  161. package/dist/domain/contracts/datasources/iread-datasource.contracts.js +2 -0
  162. package/dist/domain/contracts/datasources/iread-datasource.contracts.js.map +1 -0
  163. package/dist/domain/contracts/datasources/iremote-datasource.contracts.d.ts +73 -0
  164. package/dist/domain/contracts/datasources/iremote-datasource.contracts.d.ts.map +1 -0
  165. package/dist/domain/contracts/datasources/iremote-datasource.contracts.js +2 -0
  166. package/dist/domain/contracts/datasources/iremote-datasource.contracts.js.map +1 -0
  167. package/dist/domain/contracts/datasources/iwrite-datasource.contracts.d.ts +82 -0
  168. package/dist/domain/contracts/datasources/iwrite-datasource.contracts.d.ts.map +1 -0
  169. package/dist/domain/contracts/datasources/iwrite-datasource.contracts.js +2 -0
  170. package/dist/domain/contracts/datasources/iwrite-datasource.contracts.js.map +1 -0
  171. package/dist/domain/contracts/disposables/idisposable.contracts.d.ts +23 -0
  172. package/dist/domain/contracts/disposables/idisposable.contracts.d.ts.map +1 -0
  173. package/dist/domain/contracts/disposables/idisposable.contracts.js +6 -0
  174. package/dist/domain/contracts/disposables/idisposable.contracts.js.map +1 -0
  175. package/dist/domain/contracts/disposables/index.d.ts +2 -0
  176. package/dist/domain/contracts/disposables/index.d.ts.map +1 -0
  177. package/dist/domain/contracts/disposables/index.js +2 -0
  178. package/dist/domain/contracts/disposables/index.js.map +1 -0
  179. package/dist/domain/contracts/factories/ifactory.contracts.d.ts +29 -0
  180. package/dist/domain/contracts/factories/ifactory.contracts.d.ts.map +1 -0
  181. package/dist/domain/contracts/factories/ifactory.contracts.js +2 -0
  182. package/dist/domain/contracts/factories/ifactory.contracts.js.map +1 -0
  183. package/dist/domain/contracts/factories/index.d.ts +2 -0
  184. package/dist/domain/contracts/factories/index.d.ts.map +1 -0
  185. package/dist/domain/contracts/factories/index.js +2 -0
  186. package/dist/domain/contracts/factories/index.js.map +1 -0
  187. package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.d.ts +27 -0
  188. package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.d.ts.map +1 -0
  189. package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.js +2 -0
  190. package/dist/domain/contracts/gate_keepers/igate-keeper.contracts.js.map +1 -0
  191. package/dist/domain/contracts/gate_keepers/index.d.ts +2 -0
  192. package/dist/domain/contracts/gate_keepers/index.d.ts.map +1 -0
  193. package/dist/domain/contracts/gate_keepers/index.js +2 -0
  194. package/dist/domain/contracts/gate_keepers/index.js.map +1 -0
  195. package/dist/domain/contracts/http/iallow-origin.contracts.d.ts +1 -0
  196. package/dist/domain/contracts/http/iallow-origin.contracts.d.ts.map +1 -0
  197. package/dist/domain/contracts/http/iallow-origin.contracts.js +2 -0
  198. package/dist/domain/contracts/http/iallow-origin.contracts.js.map +1 -0
  199. package/dist/domain/contracts/http/ihttp-client.contracts.d.ts +81 -0
  200. package/dist/domain/contracts/http/ihttp-client.contracts.d.ts.map +1 -0
  201. package/dist/domain/contracts/http/ihttp-client.contracts.js +2 -0
  202. package/dist/domain/contracts/http/ihttp-client.contracts.js.map +1 -0
  203. package/dist/domain/contracts/http/index.d.ts +2 -0
  204. package/dist/domain/contracts/http/index.d.ts.map +1 -0
  205. package/dist/domain/contracts/http/index.js +2 -0
  206. package/dist/domain/contracts/http/index.js.map +1 -0
  207. package/dist/domain/contracts/idempotency/idempotency-store.contracts.d.ts +71 -0
  208. package/dist/domain/contracts/idempotency/idempotency-store.contracts.d.ts.map +1 -0
  209. package/dist/domain/contracts/idempotency/idempotency-store.contracts.js +2 -0
  210. package/dist/domain/contracts/idempotency/idempotency-store.contracts.js.map +1 -0
  211. package/dist/domain/contracts/idempotency/index.d.ts +2 -0
  212. package/dist/domain/contracts/idempotency/index.d.ts.map +1 -0
  213. package/dist/domain/contracts/idempotency/index.js +2 -0
  214. package/dist/domain/contracts/idempotency/index.js.map +1 -0
  215. package/dist/domain/contracts/index.d.ts +22 -0
  216. package/dist/domain/contracts/index.d.ts.map +1 -0
  217. package/dist/domain/contracts/index.js +2 -0
  218. package/dist/domain/contracts/index.js.map +1 -0
  219. package/dist/domain/contracts/loggers/ilogger-client.contracts.d.ts +27 -0
  220. package/dist/domain/contracts/loggers/ilogger-client.contracts.d.ts.map +1 -0
  221. package/dist/domain/contracts/loggers/ilogger-client.contracts.js +2 -0
  222. package/dist/domain/contracts/loggers/ilogger-client.contracts.js.map +1 -0
  223. package/dist/domain/contracts/loggers/ilogger.contracts.d.ts +62 -0
  224. package/dist/domain/contracts/loggers/ilogger.contracts.d.ts.map +1 -0
  225. package/dist/domain/contracts/loggers/ilogger.contracts.js +2 -0
  226. package/dist/domain/contracts/loggers/ilogger.contracts.js.map +1 -0
  227. package/dist/domain/contracts/loggers/index.d.ts +3 -0
  228. package/dist/domain/contracts/loggers/index.d.ts.map +1 -0
  229. package/dist/domain/contracts/loggers/index.js +2 -0
  230. package/dist/domain/contracts/loggers/index.js.map +1 -0
  231. package/dist/domain/contracts/mappers/ibase-mapper.contracts.d.ts +33 -0
  232. package/dist/domain/contracts/mappers/ibase-mapper.contracts.d.ts.map +1 -0
  233. package/dist/domain/contracts/mappers/ibase-mapper.contracts.js +2 -0
  234. package/dist/domain/contracts/mappers/ibase-mapper.contracts.js.map +1 -0
  235. package/dist/domain/contracts/mappers/imapper.contracts.d.ts +53 -0
  236. package/dist/domain/contracts/mappers/imapper.contracts.d.ts.map +1 -0
  237. package/dist/domain/contracts/mappers/imapper.contracts.js +2 -0
  238. package/dist/domain/contracts/mappers/imapper.contracts.js.map +1 -0
  239. package/dist/domain/contracts/mappers/index.d.ts +3 -0
  240. package/dist/domain/contracts/mappers/index.d.ts.map +1 -0
  241. package/dist/domain/contracts/mappers/index.js +2 -0
  242. package/dist/domain/contracts/mappers/index.js.map +1 -0
  243. package/dist/domain/contracts/middlewares/imiddleware.contracts.d.ts +34 -0
  244. package/dist/domain/contracts/middlewares/imiddleware.contracts.d.ts.map +1 -0
  245. package/dist/domain/contracts/middlewares/imiddleware.contracts.js +2 -0
  246. package/dist/domain/contracts/middlewares/imiddleware.contracts.js.map +1 -0
  247. package/dist/domain/contracts/middlewares/index.d.ts +2 -0
  248. package/dist/domain/contracts/middlewares/index.d.ts.map +1 -0
  249. package/dist/domain/contracts/middlewares/index.js +2 -0
  250. package/dist/domain/contracts/middlewares/index.js.map +1 -0
  251. package/dist/domain/contracts/policies/index.d.ts +2 -0
  252. package/dist/domain/contracts/policies/index.d.ts.map +1 -0
  253. package/dist/domain/contracts/policies/index.js +2 -0
  254. package/dist/domain/contracts/policies/index.js.map +1 -0
  255. package/dist/domain/contracts/policies/ipolicy-registry.contracts.d.ts +38 -0
  256. package/dist/domain/contracts/policies/ipolicy-registry.contracts.d.ts.map +1 -0
  257. package/dist/domain/contracts/policies/ipolicy-registry.contracts.js +2 -0
  258. package/dist/domain/contracts/policies/ipolicy-registry.contracts.js.map +1 -0
  259. package/dist/domain/contracts/repositories/index.d.ts +3 -0
  260. package/dist/domain/contracts/repositories/index.d.ts.map +1 -0
  261. package/dist/domain/contracts/repositories/index.js +2 -0
  262. package/dist/domain/contracts/repositories/index.js.map +1 -0
  263. package/dist/domain/contracts/repositories/iread-dao.contracts.d.ts +41 -0
  264. package/dist/domain/contracts/repositories/iread-dao.contracts.d.ts.map +1 -0
  265. package/dist/domain/contracts/repositories/iread-dao.contracts.js +2 -0
  266. package/dist/domain/contracts/repositories/iread-dao.contracts.js.map +1 -0
  267. package/dist/domain/contracts/repositories/irepository.contracts.d.ts +95 -0
  268. package/dist/domain/contracts/repositories/irepository.contracts.d.ts.map +1 -0
  269. package/dist/domain/contracts/repositories/irepository.contracts.js +2 -0
  270. package/dist/domain/contracts/repositories/irepository.contracts.js.map +1 -0
  271. package/dist/domain/contracts/services/auth/iauth-service.contracts.d.ts +71 -0
  272. package/dist/domain/contracts/services/auth/iauth-service.contracts.d.ts.map +1 -0
  273. package/dist/domain/contracts/services/auth/iauth-service.contracts.js +2 -0
  274. package/dist/domain/contracts/services/auth/iauth-service.contracts.js.map +1 -0
  275. package/dist/domain/contracts/services/auth/index.d.ts +2 -0
  276. package/dist/domain/contracts/services/auth/index.d.ts.map +1 -0
  277. package/dist/domain/contracts/services/auth/index.js +2 -0
  278. package/dist/domain/contracts/services/auth/index.js.map +1 -0
  279. package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.d.ts +25 -0
  280. package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.d.ts.map +1 -0
  281. package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.js +2 -0
  282. package/dist/domain/contracts/services/concurrency/concurrency-service.contracts.js.map +1 -0
  283. package/dist/domain/contracts/services/concurrency/index.d.ts +2 -0
  284. package/dist/domain/contracts/services/concurrency/index.d.ts.map +1 -0
  285. package/dist/domain/contracts/services/concurrency/index.js +2 -0
  286. package/dist/domain/contracts/services/concurrency/index.js.map +1 -0
  287. package/dist/domain/contracts/services/extractors/iextractor-service.contracts.d.ts +24 -0
  288. package/dist/domain/contracts/services/extractors/iextractor-service.contracts.d.ts.map +1 -0
  289. package/dist/domain/contracts/services/extractors/iextractor-service.contracts.js +2 -0
  290. package/dist/domain/contracts/services/extractors/iextractor-service.contracts.js.map +1 -0
  291. package/dist/domain/contracts/services/extractors/index.d.ts +2 -0
  292. package/dist/domain/contracts/services/extractors/index.d.ts.map +1 -0
  293. package/dist/domain/contracts/services/extractors/index.js +2 -0
  294. package/dist/domain/contracts/services/extractors/index.js.map +1 -0
  295. package/dist/domain/contracts/services/index.d.ts +6 -0
  296. package/dist/domain/contracts/services/index.d.ts.map +1 -0
  297. package/dist/domain/contracts/services/index.js +2 -0
  298. package/dist/domain/contracts/services/index.js.map +1 -0
  299. package/dist/domain/contracts/services/resiliences/index.d.ts +2 -0
  300. package/dist/domain/contracts/services/resiliences/index.d.ts.map +1 -0
  301. package/dist/domain/contracts/services/resiliences/index.js +2 -0
  302. package/dist/domain/contracts/services/resiliences/index.js.map +1 -0
  303. package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.d.ts +26 -0
  304. package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.d.ts.map +1 -0
  305. package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.js +2 -0
  306. package/dist/domain/contracts/services/resiliences/iresilience-service.contracts.js.map +1 -0
  307. package/dist/domain/contracts/services/validators/index.d.ts +2 -0
  308. package/dist/domain/contracts/services/validators/index.d.ts.map +1 -0
  309. package/dist/domain/contracts/services/validators/index.js +2 -0
  310. package/dist/domain/contracts/services/validators/index.js.map +1 -0
  311. package/dist/domain/contracts/services/validators/ivalidator-service.contracts.d.ts +38 -0
  312. package/dist/domain/contracts/services/validators/ivalidator-service.contracts.d.ts.map +1 -0
  313. package/dist/domain/contracts/services/validators/ivalidator-service.contracts.js +2 -0
  314. package/dist/domain/contracts/services/validators/ivalidator-service.contracts.js.map +1 -0
  315. package/dist/domain/contracts/specifications/index.d.ts +2 -0
  316. package/dist/domain/contracts/specifications/index.d.ts.map +1 -0
  317. package/dist/domain/contracts/specifications/index.js +2 -0
  318. package/dist/domain/contracts/specifications/index.js.map +1 -0
  319. package/dist/domain/contracts/specifications/ispecification.contracts.d.ts +58 -0
  320. package/dist/domain/contracts/specifications/ispecification.contracts.d.ts.map +1 -0
  321. package/dist/domain/contracts/specifications/ispecification.contracts.js +2 -0
  322. package/dist/domain/contracts/specifications/ispecification.contracts.js.map +1 -0
  323. package/dist/domain/contracts/storage/index.d.ts +2 -0
  324. package/dist/domain/contracts/storage/index.d.ts.map +1 -0
  325. package/dist/domain/contracts/storage/index.js +2 -0
  326. package/dist/domain/contracts/storage/index.js.map +1 -0
  327. package/dist/domain/contracts/storage/istorage.contracts.d.ts +6 -0
  328. package/dist/domain/contracts/storage/istorage.contracts.d.ts.map +1 -0
  329. package/dist/domain/contracts/storage/istorage.contracts.js +2 -0
  330. package/dist/domain/contracts/storage/istorage.contracts.js.map +1 -0
  331. package/dist/domain/contracts/strategies/index.d.ts +2 -0
  332. package/dist/domain/contracts/strategies/index.d.ts.map +1 -0
  333. package/dist/domain/contracts/strategies/index.js +2 -0
  334. package/dist/domain/contracts/strategies/index.js.map +1 -0
  335. package/dist/domain/contracts/strategies/istrategy.contracts.d.ts +25 -0
  336. package/dist/domain/contracts/strategies/istrategy.contracts.d.ts.map +1 -0
  337. package/dist/domain/contracts/strategies/istrategy.contracts.js +2 -0
  338. package/dist/domain/contracts/strategies/istrategy.contracts.js.map +1 -0
  339. package/dist/domain/contracts/transaction/index.d.ts +3 -0
  340. package/dist/domain/contracts/transaction/index.d.ts.map +1 -0
  341. package/dist/domain/contracts/transaction/index.js +2 -0
  342. package/dist/domain/contracts/transaction/index.js.map +1 -0
  343. package/dist/domain/contracts/transaction/itransaction-state.types.d.ts +44 -0
  344. package/dist/domain/contracts/transaction/itransaction-state.types.d.ts.map +1 -0
  345. package/dist/domain/contracts/transaction/itransaction-state.types.js +2 -0
  346. package/dist/domain/contracts/transaction/itransaction-state.types.js.map +1 -0
  347. package/dist/domain/contracts/transaction/iunit-of-work.types.d.ts +25 -0
  348. package/dist/domain/contracts/transaction/iunit-of-work.types.d.ts.map +1 -0
  349. package/dist/domain/contracts/transaction/iunit-of-work.types.js +2 -0
  350. package/dist/domain/contracts/transaction/iunit-of-work.types.js.map +1 -0
  351. package/dist/domain/entities/__tests__/entity.test.d.ts +2 -0
  352. package/dist/domain/entities/__tests__/entity.test.d.ts.map +1 -0
  353. package/dist/domain/entities/__tests__/entity.test.js +53 -0
  354. package/dist/domain/entities/__tests__/entity.test.js.map +1 -0
  355. package/dist/domain/entities/entity.d.ts +43 -0
  356. package/dist/domain/entities/entity.d.ts.map +1 -0
  357. package/dist/domain/entities/entity.js +55 -0
  358. package/dist/domain/entities/entity.js.map +1 -0
  359. package/dist/domain/entities/ientity.contracts.d.ts +43 -0
  360. package/dist/domain/entities/ientity.contracts.d.ts.map +1 -0
  361. package/dist/domain/entities/ientity.contracts.js +2 -0
  362. package/dist/domain/entities/ientity.contracts.js.map +1 -0
  363. package/dist/domain/entities/index.d.ts +3 -0
  364. package/dist/domain/entities/index.d.ts.map +1 -0
  365. package/dist/domain/entities/index.js +2 -0
  366. package/dist/domain/entities/index.js.map +1 -0
  367. package/dist/domain/errors/__tests__/app-error.test.d.ts +2 -0
  368. package/dist/domain/errors/__tests__/app-error.test.d.ts.map +1 -0
  369. package/dist/domain/errors/__tests__/app-error.test.js +94 -0
  370. package/dist/domain/errors/__tests__/app-error.test.js.map +1 -0
  371. package/dist/domain/errors/app-error.d.ts +243 -0
  372. package/dist/domain/errors/app-error.d.ts.map +1 -0
  373. package/dist/domain/errors/app-error.js +259 -0
  374. package/dist/domain/errors/app-error.js.map +1 -0
  375. package/dist/domain/errors/index.d.ts +2 -0
  376. package/dist/domain/errors/index.d.ts.map +1 -0
  377. package/dist/domain/errors/index.js +2 -0
  378. package/dist/domain/errors/index.js.map +1 -0
  379. package/dist/domain/index.d.ts +8 -0
  380. package/dist/domain/index.d.ts.map +1 -0
  381. package/dist/domain/index.js +6 -0
  382. package/dist/domain/index.js.map +1 -0
  383. package/dist/domain/results/__tests__/result.test.d.ts +2 -0
  384. package/dist/domain/results/__tests__/result.test.d.ts.map +1 -0
  385. package/dist/domain/results/__tests__/result.test.js +109 -0
  386. package/dist/domain/results/__tests__/result.test.js.map +1 -0
  387. package/dist/domain/results/index.d.ts +3 -0
  388. package/dist/domain/results/index.d.ts.map +1 -0
  389. package/dist/domain/results/index.js +2 -0
  390. package/dist/domain/results/index.js.map +1 -0
  391. package/dist/domain/results/result.d.ts +125 -0
  392. package/dist/domain/results/result.d.ts.map +1 -0
  393. package/dist/domain/results/result.js +144 -0
  394. package/dist/domain/results/result.js.map +1 -0
  395. package/dist/domain/results/result.types.d.ts +15 -0
  396. package/dist/domain/results/result.types.d.ts.map +1 -0
  397. package/dist/domain/results/result.types.js +2 -0
  398. package/dist/domain/results/result.types.js.map +1 -0
  399. package/dist/domain/unique_id/__tests__/unique-id.test.d.ts +2 -0
  400. package/dist/domain/unique_id/__tests__/unique-id.test.d.ts.map +1 -0
  401. package/dist/domain/unique_id/__tests__/unique-id.test.js +29 -0
  402. package/dist/domain/unique_id/__tests__/unique-id.test.js.map +1 -0
  403. package/dist/domain/unique_id/index.d.ts +2 -0
  404. package/dist/domain/unique_id/index.d.ts.map +1 -0
  405. package/dist/domain/unique_id/index.js +2 -0
  406. package/dist/domain/unique_id/index.js.map +1 -0
  407. package/dist/domain/unique_id/unique-id.d.ts +72 -0
  408. package/dist/domain/unique_id/unique-id.d.ts.map +1 -0
  409. package/dist/domain/unique_id/unique-id.js +87 -0
  410. package/dist/domain/unique_id/unique-id.js.map +1 -0
  411. package/dist/domain/value_objects/__tests__/value-object.test.d.ts +2 -0
  412. package/dist/domain/value_objects/__tests__/value-object.test.d.ts.map +1 -0
  413. package/dist/domain/value_objects/__tests__/value-object.test.js +43 -0
  414. package/dist/domain/value_objects/__tests__/value-object.test.js.map +1 -0
  415. package/dist/domain/value_objects/index.d.ts +3 -0
  416. package/dist/domain/value_objects/index.d.ts.map +1 -0
  417. package/dist/domain/value_objects/index.js +2 -0
  418. package/dist/domain/value_objects/index.js.map +1 -0
  419. package/dist/domain/value_objects/ivalue-object.contracts.d.ts +46 -0
  420. package/dist/domain/value_objects/ivalue-object.contracts.d.ts.map +1 -0
  421. package/dist/domain/value_objects/ivalue-object.contracts.js +2 -0
  422. package/dist/domain/value_objects/ivalue-object.contracts.js.map +1 -0
  423. package/dist/domain/value_objects/value-object.d.ts +26 -0
  424. package/dist/domain/value_objects/value-object.d.ts.map +1 -0
  425. package/dist/domain/value_objects/value-object.js +37 -0
  426. package/dist/domain/value_objects/value-object.js.map +1 -0
  427. package/dist/index.d.ts +5 -0
  428. package/dist/index.d.ts.map +1 -0
  429. package/dist/index.js +5 -0
  430. package/dist/index.js.map +1 -0
  431. package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.d.ts +2 -0
  432. package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.d.ts.map +1 -0
  433. package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.js +128 -0
  434. package/dist/infrastructure/auth/__tests__/supabase-auth.service.test.js.map +1 -0
  435. package/dist/infrastructure/auth/index.d.ts +3 -0
  436. package/dist/infrastructure/auth/index.d.ts.map +1 -0
  437. package/dist/infrastructure/auth/index.js +3 -0
  438. package/dist/infrastructure/auth/index.js.map +1 -0
  439. package/dist/infrastructure/auth/storage/cookie.storage.d.ts +4 -0
  440. package/dist/infrastructure/auth/storage/cookie.storage.d.ts.map +1 -0
  441. package/dist/infrastructure/auth/storage/cookie.storage.js +31 -0
  442. package/dist/infrastructure/auth/storage/cookie.storage.js.map +1 -0
  443. package/dist/infrastructure/auth/storage/index.d.ts +4 -0
  444. package/dist/infrastructure/auth/storage/index.d.ts.map +1 -0
  445. package/dist/infrastructure/auth/storage/index.js +4 -0
  446. package/dist/infrastructure/auth/storage/index.js.map +1 -0
  447. package/dist/infrastructure/auth/storage/memory.storage.d.ts +3 -0
  448. package/dist/infrastructure/auth/storage/memory.storage.d.ts.map +1 -0
  449. package/dist/infrastructure/auth/storage/memory.storage.js +14 -0
  450. package/dist/infrastructure/auth/storage/memory.storage.js.map +1 -0
  451. package/dist/infrastructure/auth/storage/storage.utils.d.ts +10 -0
  452. package/dist/infrastructure/auth/storage/storage.utils.d.ts.map +1 -0
  453. package/dist/infrastructure/auth/storage/storage.utils.js +22 -0
  454. package/dist/infrastructure/auth/storage/storage.utils.js.map +1 -0
  455. package/dist/infrastructure/auth/supabase-auth.service.d.ts +31 -0
  456. package/dist/infrastructure/auth/supabase-auth.service.d.ts.map +1 -0
  457. package/dist/infrastructure/auth/supabase-auth.service.js +90 -0
  458. package/dist/infrastructure/auth/supabase-auth.service.js.map +1 -0
  459. package/dist/infrastructure/cache/__tests__/in-memory.cache.test.d.ts +2 -0
  460. package/dist/infrastructure/cache/__tests__/in-memory.cache.test.d.ts.map +1 -0
  461. package/dist/infrastructure/cache/__tests__/in-memory.cache.test.js +69 -0
  462. package/dist/infrastructure/cache/__tests__/in-memory.cache.test.js.map +1 -0
  463. package/dist/infrastructure/cache/in-memory.cache.d.ts +34 -0
  464. package/dist/infrastructure/cache/in-memory.cache.d.ts.map +1 -0
  465. package/dist/infrastructure/cache/in-memory.cache.js +66 -0
  466. package/dist/infrastructure/cache/in-memory.cache.js.map +1 -0
  467. package/dist/infrastructure/cache/index.d.ts +3 -0
  468. package/dist/infrastructure/cache/index.d.ts.map +1 -0
  469. package/dist/infrastructure/cache/index.js +3 -0
  470. package/dist/infrastructure/cache/index.js.map +1 -0
  471. package/dist/infrastructure/cache/key-builder.cache.d.ts +25 -0
  472. package/dist/infrastructure/cache/key-builder.cache.d.ts.map +1 -0
  473. package/dist/infrastructure/cache/key-builder.cache.js +39 -0
  474. package/dist/infrastructure/cache/key-builder.cache.js.map +1 -0
  475. package/dist/infrastructure/datasources/__tests__/remote.datasource.test.d.ts +2 -0
  476. package/dist/infrastructure/datasources/__tests__/remote.datasource.test.d.ts.map +1 -0
  477. package/dist/infrastructure/datasources/__tests__/remote.datasource.test.js +176 -0
  478. package/dist/infrastructure/datasources/__tests__/remote.datasource.test.js.map +1 -0
  479. package/dist/infrastructure/datasources/index.d.ts +2 -0
  480. package/dist/infrastructure/datasources/index.d.ts.map +1 -0
  481. package/dist/infrastructure/datasources/index.js +2 -0
  482. package/dist/infrastructure/datasources/index.js.map +1 -0
  483. package/dist/infrastructure/datasources/remote.datasource.d.ts +43 -0
  484. package/dist/infrastructure/datasources/remote.datasource.d.ts.map +1 -0
  485. package/dist/infrastructure/datasources/remote.datasource.js +111 -0
  486. package/dist/infrastructure/datasources/remote.datasource.js.map +1 -0
  487. package/dist/infrastructure/factories/axios.factory.d.ts +15 -0
  488. package/dist/infrastructure/factories/axios.factory.d.ts.map +1 -0
  489. package/dist/infrastructure/factories/axios.factory.js +26 -0
  490. package/dist/infrastructure/factories/axios.factory.js.map +1 -0
  491. package/dist/infrastructure/factories/cockatiel-resilience.factory.d.ts +16 -0
  492. package/dist/infrastructure/factories/cockatiel-resilience.factory.d.ts.map +1 -0
  493. package/dist/infrastructure/factories/cockatiel-resilience.factory.js +114 -0
  494. package/dist/infrastructure/factories/cockatiel-resilience.factory.js.map +1 -0
  495. package/dist/infrastructure/factories/index.d.ts +2 -0
  496. package/dist/infrastructure/factories/index.d.ts.map +1 -0
  497. package/dist/infrastructure/factories/index.js +2 -0
  498. package/dist/infrastructure/factories/index.js.map +1 -0
  499. package/dist/infrastructure/http/__tests__/axios.http.test.d.ts +2 -0
  500. package/dist/infrastructure/http/__tests__/axios.http.test.d.ts.map +1 -0
  501. package/dist/infrastructure/http/__tests__/axios.http.test.js +196 -0
  502. package/dist/infrastructure/http/__tests__/axios.http.test.js.map +1 -0
  503. package/dist/infrastructure/http/allow-origin.http.d.ts +8 -0
  504. package/dist/infrastructure/http/allow-origin.http.d.ts.map +1 -0
  505. package/dist/infrastructure/http/allow-origin.http.js +13 -0
  506. package/dist/infrastructure/http/allow-origin.http.js.map +1 -0
  507. package/dist/infrastructure/http/axios.http.d.ts +17 -0
  508. package/dist/infrastructure/http/axios.http.d.ts.map +1 -0
  509. package/dist/infrastructure/http/axios.http.js +89 -0
  510. package/dist/infrastructure/http/axios.http.js.map +1 -0
  511. package/dist/infrastructure/http/index.d.ts +2 -0
  512. package/dist/infrastructure/http/index.d.ts.map +1 -0
  513. package/dist/infrastructure/http/index.js +2 -0
  514. package/dist/infrastructure/http/index.js.map +1 -0
  515. package/dist/infrastructure/index.d.ts +7 -0
  516. package/dist/infrastructure/index.d.ts.map +1 -0
  517. package/dist/infrastructure/index.js +7 -0
  518. package/dist/infrastructure/index.js.map +1 -0
  519. package/dist/infrastructure/mappers/index.d.ts +3 -0
  520. package/dist/infrastructure/mappers/index.d.ts.map +1 -0
  521. package/dist/infrastructure/mappers/index.js +3 -0
  522. package/dist/infrastructure/mappers/index.js.map +1 -0
  523. package/dist/infrastructure/mappers/supabase-claims.mapper.d.ts +15 -0
  524. package/dist/infrastructure/mappers/supabase-claims.mapper.d.ts.map +1 -0
  525. package/dist/infrastructure/mappers/supabase-claims.mapper.js +30 -0
  526. package/dist/infrastructure/mappers/supabase-claims.mapper.js.map +1 -0
  527. package/dist/infrastructure/mappers/supabase-session.mapper.d.ts +8 -0
  528. package/dist/infrastructure/mappers/supabase-session.mapper.d.ts.map +1 -0
  529. package/dist/infrastructure/mappers/supabase-session.mapper.js +16 -0
  530. package/dist/infrastructure/mappers/supabase-session.mapper.js.map +1 -0
  531. package/dist/infrastructure/resiliences/__tests__/resilience.service.test.d.ts +2 -0
  532. package/dist/infrastructure/resiliences/__tests__/resilience.service.test.d.ts.map +1 -0
  533. package/dist/infrastructure/resiliences/__tests__/resilience.service.test.js +47 -0
  534. package/dist/infrastructure/resiliences/__tests__/resilience.service.test.js.map +1 -0
  535. package/dist/infrastructure/resiliences/index.d.ts +2 -0
  536. package/dist/infrastructure/resiliences/index.d.ts.map +1 -0
  537. package/dist/infrastructure/resiliences/index.js +2 -0
  538. package/dist/infrastructure/resiliences/index.js.map +1 -0
  539. package/dist/infrastructure/resiliences/resilience.service.d.ts +18 -0
  540. package/dist/infrastructure/resiliences/resilience.service.d.ts.map +1 -0
  541. package/dist/infrastructure/resiliences/resilience.service.js +21 -0
  542. package/dist/infrastructure/resiliences/resilience.service.js.map +1 -0
  543. package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.d.ts +2 -0
  544. package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.d.ts.map +1 -0
  545. package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.js +68 -0
  546. package/dist/infrastructure/validators/__tests__/schema-zod.utils.test.js.map +1 -0
  547. package/dist/infrastructure/validators/__tests__/zod.validator.test.d.ts +2 -0
  548. package/dist/infrastructure/validators/__tests__/zod.validator.test.d.ts.map +1 -0
  549. package/dist/infrastructure/validators/__tests__/zod.validator.test.js +72 -0
  550. package/dist/infrastructure/validators/__tests__/zod.validator.test.js.map +1 -0
  551. package/dist/infrastructure/validators/base-schema.constant.d.ts +30 -0
  552. package/dist/infrastructure/validators/base-schema.constant.d.ts.map +1 -0
  553. package/dist/infrastructure/validators/base-schema.constant.js +41 -0
  554. package/dist/infrastructure/validators/base-schema.constant.js.map +1 -0
  555. package/dist/infrastructure/validators/constants/zod.constant.d.ts +24 -0
  556. package/dist/infrastructure/validators/constants/zod.constant.d.ts.map +1 -0
  557. package/dist/infrastructure/validators/constants/zod.constant.js +23 -0
  558. package/dist/infrastructure/validators/constants/zod.constant.js.map +1 -0
  559. package/dist/infrastructure/validators/index.d.ts +3 -0
  560. package/dist/infrastructure/validators/index.d.ts.map +1 -0
  561. package/dist/infrastructure/validators/index.js +3 -0
  562. package/dist/infrastructure/validators/index.js.map +1 -0
  563. package/dist/infrastructure/validators/schema-zod.utils.d.ts +27 -0
  564. package/dist/infrastructure/validators/schema-zod.utils.d.ts.map +1 -0
  565. package/dist/infrastructure/validators/schema-zod.utils.js +27 -0
  566. package/dist/infrastructure/validators/schema-zod.utils.js.map +1 -0
  567. package/dist/infrastructure/validators/zod.validator.d.ts +31 -0
  568. package/dist/infrastructure/validators/zod.validator.d.ts.map +1 -0
  569. package/dist/infrastructure/validators/zod.validator.js +53 -0
  570. package/dist/infrastructure/validators/zod.validator.js.map +1 -0
  571. package/dist/shared/constants/concurrency.constants.d.ts +42 -0
  572. package/dist/shared/constants/concurrency.constants.d.ts.map +1 -0
  573. package/dist/shared/constants/concurrency.constants.js +42 -0
  574. package/dist/shared/constants/concurrency.constants.js.map +1 -0
  575. package/dist/shared/constants/error.constants.d.ts +272 -0
  576. package/dist/shared/constants/error.constants.d.ts.map +1 -0
  577. package/dist/shared/constants/error.constants.js +278 -0
  578. package/dist/shared/constants/error.constants.js.map +1 -0
  579. package/dist/shared/constants/guest.constants.d.ts +52 -0
  580. package/dist/shared/constants/guest.constants.d.ts.map +1 -0
  581. package/dist/shared/constants/guest.constants.js +53 -0
  582. package/dist/shared/constants/guest.constants.js.map +1 -0
  583. package/dist/shared/constants/idempotency.constants.d.ts +72 -0
  584. package/dist/shared/constants/idempotency.constants.d.ts.map +1 -0
  585. package/dist/shared/constants/idempotency.constants.js +72 -0
  586. package/dist/shared/constants/idempotency.constants.js.map +1 -0
  587. package/dist/shared/constants/index.d.ts +11 -0
  588. package/dist/shared/constants/index.d.ts.map +1 -0
  589. package/dist/shared/constants/index.js +11 -0
  590. package/dist/shared/constants/index.js.map +1 -0
  591. package/dist/shared/constants/log-level.constants.d.ts +64 -0
  592. package/dist/shared/constants/log-level.constants.d.ts.map +1 -0
  593. package/dist/shared/constants/log-level.constants.js +89 -0
  594. package/dist/shared/constants/log-level.constants.js.map +1 -0
  595. package/dist/shared/constants/pagination.constants.d.ts +70 -0
  596. package/dist/shared/constants/pagination.constants.d.ts.map +1 -0
  597. package/dist/shared/constants/pagination.constants.js +88 -0
  598. package/dist/shared/constants/pagination.constants.js.map +1 -0
  599. package/dist/shared/constants/request.constants.d.ts +34 -0
  600. package/dist/shared/constants/request.constants.d.ts.map +1 -0
  601. package/dist/shared/constants/request.constants.js +26 -0
  602. package/dist/shared/constants/request.constants.js.map +1 -0
  603. package/dist/shared/constants/resilience.constants.d.ts +89 -0
  604. package/dist/shared/constants/resilience.constants.d.ts.map +1 -0
  605. package/dist/shared/constants/resilience.constants.js +89 -0
  606. package/dist/shared/constants/resilience.constants.js.map +1 -0
  607. package/dist/shared/constants/roles.constants.d.ts +84 -0
  608. package/dist/shared/constants/roles.constants.d.ts.map +1 -0
  609. package/dist/shared/constants/roles.constants.js +68 -0
  610. package/dist/shared/constants/roles.constants.js.map +1 -0
  611. package/dist/shared/constants/tokens.constants.d.ts +373 -0
  612. package/dist/shared/constants/tokens.constants.d.ts.map +1 -0
  613. package/dist/shared/constants/tokens.constants.js +373 -0
  614. package/dist/shared/constants/tokens.constants.js.map +1 -0
  615. package/dist/shared/index.d.ts +4 -0
  616. package/dist/shared/index.d.ts.map +1 -0
  617. package/dist/shared/index.js +3 -0
  618. package/dist/shared/index.js.map +1 -0
  619. package/dist/shared/types/api-response.types.d.ts +185 -0
  620. package/dist/shared/types/api-response.types.d.ts.map +1 -0
  621. package/dist/shared/types/api-response.types.js +2 -0
  622. package/dist/shared/types/api-response.types.js.map +1 -0
  623. package/dist/shared/types/auth-policy.types.d.ts +48 -0
  624. package/dist/shared/types/auth-policy.types.d.ts.map +1 -0
  625. package/dist/shared/types/auth-policy.types.js +2 -0
  626. package/dist/shared/types/auth-policy.types.js.map +1 -0
  627. package/dist/shared/types/auth.types.d.ts +106 -0
  628. package/dist/shared/types/auth.types.d.ts.map +1 -0
  629. package/dist/shared/types/auth.types.js +2 -0
  630. package/dist/shared/types/auth.types.js.map +1 -0
  631. package/dist/shared/types/cache.types.d.ts +64 -0
  632. package/dist/shared/types/cache.types.d.ts.map +1 -0
  633. package/dist/shared/types/cache.types.js +2 -0
  634. package/dist/shared/types/cache.types.js.map +1 -0
  635. package/dist/shared/types/common.types.d.ts +213 -0
  636. package/dist/shared/types/common.types.d.ts.map +1 -0
  637. package/dist/shared/types/common.types.js +3 -0
  638. package/dist/shared/types/common.types.js.map +1 -0
  639. package/dist/shared/types/http.types.d.ts +188 -0
  640. package/dist/shared/types/http.types.d.ts.map +1 -0
  641. package/dist/shared/types/http.types.js +2 -0
  642. package/dist/shared/types/http.types.js.map +1 -0
  643. package/dist/shared/types/index.d.ts +10 -0
  644. package/dist/shared/types/index.d.ts.map +1 -0
  645. package/dist/shared/types/index.js +2 -0
  646. package/dist/shared/types/index.js.map +1 -0
  647. package/dist/shared/types/injection-token.types.d.ts +38 -0
  648. package/dist/shared/types/injection-token.types.d.ts.map +1 -0
  649. package/dist/shared/types/injection-token.types.js +2 -0
  650. package/dist/shared/types/injection-token.types.js.map +1 -0
  651. package/dist/shared/types/metadata.types.d.ts +150 -0
  652. package/dist/shared/types/metadata.types.d.ts.map +1 -0
  653. package/dist/shared/types/metadata.types.js +2 -0
  654. package/dist/shared/types/metadata.types.js.map +1 -0
  655. package/dist/shared/types/pagination.types.d.ts +88 -0
  656. package/dist/shared/types/pagination.types.d.ts.map +1 -0
  657. package/dist/shared/types/pagination.types.js +3 -0
  658. package/dist/shared/types/pagination.types.js.map +1 -0
  659. package/dist/shared/utils/__tests__/date.utils.test.d.ts +2 -0
  660. package/dist/shared/utils/__tests__/date.utils.test.d.ts.map +1 -0
  661. package/dist/shared/utils/__tests__/date.utils.test.js +97 -0
  662. package/dist/shared/utils/__tests__/date.utils.test.js.map +1 -0
  663. package/dist/shared/utils/__tests__/guards.utils.test.d.ts +2 -0
  664. package/dist/shared/utils/__tests__/guards.utils.test.d.ts.map +1 -0
  665. package/dist/shared/utils/__tests__/guards.utils.test.js +324 -0
  666. package/dist/shared/utils/__tests__/guards.utils.test.js.map +1 -0
  667. package/dist/shared/utils/__tests__/guid.utils.test.d.ts +2 -0
  668. package/dist/shared/utils/__tests__/guid.utils.test.d.ts.map +1 -0
  669. package/dist/shared/utils/__tests__/guid.utils.test.js +97 -0
  670. package/dist/shared/utils/__tests__/guid.utils.test.js.map +1 -0
  671. package/dist/shared/utils/__tests__/http.utils.test.d.ts +2 -0
  672. package/dist/shared/utils/__tests__/http.utils.test.d.ts.map +1 -0
  673. package/dist/shared/utils/__tests__/http.utils.test.js +230 -0
  674. package/dist/shared/utils/__tests__/http.utils.test.js.map +1 -0
  675. package/dist/shared/utils/__tests__/math.utils.test.d.ts +2 -0
  676. package/dist/shared/utils/__tests__/math.utils.test.d.ts.map +1 -0
  677. package/dist/shared/utils/__tests__/math.utils.test.js +93 -0
  678. package/dist/shared/utils/__tests__/math.utils.test.js.map +1 -0
  679. package/dist/shared/utils/__tests__/promise.utils.test.d.ts +2 -0
  680. package/dist/shared/utils/__tests__/promise.utils.test.d.ts.map +1 -0
  681. package/dist/shared/utils/__tests__/promise.utils.test.js +101 -0
  682. package/dist/shared/utils/__tests__/promise.utils.test.js.map +1 -0
  683. package/dist/shared/utils/__tests__/string.utils.test.d.ts +2 -0
  684. package/dist/shared/utils/__tests__/string.utils.test.d.ts.map +1 -0
  685. package/dist/shared/utils/__tests__/string.utils.test.js +153 -0
  686. package/dist/shared/utils/__tests__/string.utils.test.js.map +1 -0
  687. package/dist/shared/utils/abort.utils.d.ts +34 -0
  688. package/dist/shared/utils/abort.utils.d.ts.map +1 -0
  689. package/dist/shared/utils/abort.utils.js +55 -0
  690. package/dist/shared/utils/abort.utils.js.map +1 -0
  691. package/dist/shared/utils/date.utils.d.ts +75 -0
  692. package/dist/shared/utils/date.utils.d.ts.map +1 -0
  693. package/dist/shared/utils/date.utils.js +88 -0
  694. package/dist/shared/utils/date.utils.js.map +1 -0
  695. package/dist/shared/utils/enumerable.utils.d.ts +43 -0
  696. package/dist/shared/utils/enumerable.utils.d.ts.map +1 -0
  697. package/dist/shared/utils/enumerable.utils.js +52 -0
  698. package/dist/shared/utils/enumerable.utils.js.map +1 -0
  699. package/dist/shared/utils/guards.utils.d.ts +245 -0
  700. package/dist/shared/utils/guards.utils.d.ts.map +1 -0
  701. package/dist/shared/utils/guards.utils.js +308 -0
  702. package/dist/shared/utils/guards.utils.js.map +1 -0
  703. package/dist/shared/utils/guid.utils.d.ts +73 -0
  704. package/dist/shared/utils/guid.utils.d.ts.map +1 -0
  705. package/dist/shared/utils/guid.utils.js +89 -0
  706. package/dist/shared/utils/guid.utils.js.map +1 -0
  707. package/dist/shared/utils/http.utils.d.ts +75 -0
  708. package/dist/shared/utils/http.utils.d.ts.map +1 -0
  709. package/dist/shared/utils/http.utils.js +144 -0
  710. package/dist/shared/utils/http.utils.js.map +1 -0
  711. package/dist/shared/utils/index.d.ts +11 -0
  712. package/dist/shared/utils/index.d.ts.map +1 -0
  713. package/dist/shared/utils/index.js +11 -0
  714. package/dist/shared/utils/index.js.map +1 -0
  715. package/dist/shared/utils/math.utils.d.ts +79 -0
  716. package/dist/shared/utils/math.utils.d.ts.map +1 -0
  717. package/dist/shared/utils/math.utils.js +97 -0
  718. package/dist/shared/utils/math.utils.js.map +1 -0
  719. package/dist/shared/utils/promise.utils.d.ts +40 -0
  720. package/dist/shared/utils/promise.utils.d.ts.map +1 -0
  721. package/dist/shared/utils/promise.utils.js +45 -0
  722. package/dist/shared/utils/promise.utils.js.map +1 -0
  723. package/dist/shared/utils/sanitize.utils.d.ts +39 -0
  724. package/dist/shared/utils/sanitize.utils.d.ts.map +1 -0
  725. package/dist/shared/utils/sanitize.utils.js +67 -0
  726. package/dist/shared/utils/sanitize.utils.js.map +1 -0
  727. package/dist/shared/utils/string.utils.d.ts +102 -0
  728. package/dist/shared/utils/string.utils.d.ts.map +1 -0
  729. package/dist/shared/utils/string.utils.js +157 -0
  730. package/dist/shared/utils/string.utils.js.map +1 -0
  731. package/package.json +111 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory.cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/in-memory.cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;;;;KAQK;AACL,MAAM,OAAO,aAAa;IAYd;IAXV;;;;;;;;;OASG;IACH,YACU,SAAsE,IAAI,GAAG,EAAE;QAA/E,WAAM,GAAN,MAAM,CAAyE;IACtF,CAAC;IAEG,KAAK,CAAC,GAAG,CAAI,GAAW;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACtE,I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GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACtE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;IACrB,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export * from './in-memory.cache';
2
+ export * from './key-builder.cache';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './in-memory.cache';
2
+ export * from './key-builder.cache';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,25 @@
1
+ import type { ICacheKeyBuilder, IIdentityAccessor } from '@xeno-js/shared';
2
+ /**
3
+ * @description The CacheKeyBuilder class implements the ICacheKeyBuilder interface, providing a method to build contextual cache keys based on the user's identity. This class utilizes an instance of IIdentityAccessor to retrieve the current user's identity, allowing for the creation of tenant-specific cache keys in multi-tenant applications. If a tenant ID is present in the identity, the cache key is prefixed with the tenant ID; otherwise, it defaults to a public cache key. This approach ensures that cached data is appropriately scoped to the user's context, preventing data leakage between tenants.
4
+ *
5
+ * @author Xeno
6
+ * @version 1.0.0
7
+ * @since 2025-09-30
8
+ * @link https://github.com/xeno-js/xeno-js
9
+ */
10
+ export declare class CacheKeyBuilder implements ICacheKeyBuilder {
11
+ private readonly _identityAccessor;
12
+ /**
13
+ * @description Constructs a new instance of the CacheKeyBuilder class, which requires an IIdentityAccessor to access the current user's identity. The constructor initializes the dependency needed for building contextual cache keys based on the user's identity, enabling tenant-specific caching behavior in multi-tenant applications.
14
+ * @param _identityAccessor An instance of IIdentityAccessor used to retrieve the current user's identity, allowing for the construction of tenant-specific cache keys.
15
+ *
16
+ * @author Xeno
17
+ * @version 1.0.0
18
+ * @since 2025-09-30
19
+ * @link https://github.com/xeno-js/xeno-js
20
+ */
21
+ constructor(_identityAccessor: IIdentityAccessor);
22
+ buildContextualKey(key: string): string;
23
+ buildUserScopedKey(key: string): string;
24
+ }
25
+ //# sourceMappingURL=key-builder.cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-builder.cache.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/cache/key-builder.cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAG1E;;;;;;;GAOG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IAU1C,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAT9C;;;;;;;;OAQG;gBAC0B,iBAAiB,EAAE,iBAAiB;IAE1D,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAUvC,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAS/C"}
@@ -0,0 +1,39 @@
1
+ import { Guards } from '@xeno-js/shared';
2
+ /**
3
+ * @description The CacheKeyBuilder class implements the ICacheKeyBuilder interface, providing a method to build contextual cache keys based on the user's identity. This class utilizes an instance of IIdentityAccessor to retrieve the current user's identity, allowing for the creation of tenant-specific cache keys in multi-tenant applications. If a tenant ID is present in the identity, the cache key is prefixed with the tenant ID; otherwise, it defaults to a public cache key. This approach ensures that cached data is appropriately scoped to the user's context, preventing data leakage between tenants.
4
+ *
5
+ * @author Xeno
6
+ * @version 1.0.0
7
+ * @since 2025-09-30
8
+ * @link https://github.com/xeno-js/xeno-js
9
+ */
10
+ export class CacheKeyBuilder {
11
+ _identityAccessor;
12
+ /**
13
+ * @description Constructs a new instance of the CacheKeyBuilder class, which requires an IIdentityAccessor to access the current user's identity. The constructor initializes the dependency needed for building contextual cache keys based on the user's identity, enabling tenant-specific caching behavior in multi-tenant applications.
14
+ * @param _identityAccessor An instance of IIdentityAccessor used to retrieve the current user's identity, allowing for the construction of tenant-specific cache keys.
15
+ *
16
+ * @author Xeno
17
+ * @version 1.0.0
18
+ * @since 2025-09-30
19
+ * @link https://github.com/xeno-js/xeno-js
20
+ */
21
+ constructor(_identityAccessor) {
22
+ this._identityAccessor = _identityAccessor;
23
+ }
24
+ buildContextualKey(key) {
25
+ const identity = this._identityAccessor.getIdentity();
26
+ if (Guards.isDefined(identity) && !Guards.isNullOrEmpty(identity.tenantId)) {
27
+ return `tenant:${identity.tenantId}:${key}`;
28
+ }
29
+ return `${key}:public`;
30
+ }
31
+ buildUserScopedKey(key) {
32
+ const identity = this._identityAccessor.getIdentity();
33
+ if (Guards.isDefined(identity) && !Guards.isNullOrEmpty(identity.userId)) {
34
+ return this.buildContextualKey(`user:${identity.userId}:${key}`);
35
+ }
36
+ return this.buildContextualKey(key);
37
+ }
38
+ }
39
+ //# sourceMappingURL=key-builder.cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-builder.cache.js","sourceRoot":"","sources":["../../../src/infrastructure/cache/key-builder.cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAUG;IAT7B;;;;;;;;OAQG;IACH,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAE9D,kBAAkB,CAAC,GAAW;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAA;QAErD,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3E,OAAO,UAAU,QAAQ,CAAC,QAAQ,IAAI,GAAG,EAAE,CAAA;QAC7C,CAAC;QAED,OAAO,GAAG,GAAG,SAAS,CAAA;IACxB,CAAC;IAEM,kBAAkB,CAAC,GAAW;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAA;QAErD,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACzE,OAAO,IAAI,CAAC,kBAAkB,CAAC,QAAQ,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,CAAA;QAClE,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAA;IACrC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=remote.datasource.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.datasource.test.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/datasources/__tests__/remote.datasource.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,176 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import { RemoteDataSource } from '../remote.datasource';
3
+ class MyRemoteDataSource extends RemoteDataSource {
4
+ }
5
+ function makeRequest(method, body) {
6
+ return {
7
+ method,
8
+ url: '/ignored-by-remote-datasource',
9
+ body,
10
+ headers: { authorization: 'Bearer token' },
11
+ query: { page: 1 },
12
+ signal: undefined,
13
+ timeoutMs: 1_000,
14
+ };
15
+ }
16
+ function makeDeps() {
17
+ const getMock = vi.fn();
18
+ const postMock = vi.fn();
19
+ const putMock = vi.fn();
20
+ const patchMock = vi.fn();
21
+ const deleteMock = vi.fn();
22
+ const executeMock = vi.fn(async (action) => await action());
23
+ const httpClient = {
24
+ get: getMock,
25
+ post: postMock,
26
+ put: putMock,
27
+ patch: patchMock,
28
+ delete: deleteMock,
29
+ };
30
+ const resilienceService = {
31
+ execute: executeMock,
32
+ };
33
+ return {
34
+ httpClient,
35
+ resilienceService,
36
+ mocks: {
37
+ getMock,
38
+ postMock,
39
+ putMock,
40
+ patchMock,
41
+ deleteMock,
42
+ executeMock,
43
+ },
44
+ };
45
+ }
46
+ describe('RemoteDataSource', () => {
47
+ it('get calls httpClient.get and returns ok(response.data)', async () => {
48
+ const { httpClient, resilienceService, mocks } = makeDeps();
49
+ const endpoint = '/users';
50
+ const request = makeRequest('GET', undefined);
51
+ const data = { id: '1', name: 'Alice' };
52
+ mocks.getMock.mockResolvedValue({ data });
53
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
54
+ const baseReq = {
55
+ query: request.query,
56
+ signal: request.signal,
57
+ timeoutMs: request.timeoutMs,
58
+ headers: request.headers,
59
+ };
60
+ const result = await datasource.get(endpoint, baseReq);
61
+ expect(mocks.executeMock).toHaveBeenCalledWith(expect.any(Function), request.signal);
62
+ expect(mocks.getMock).toHaveBeenCalledWith(endpoint, { ...baseReq, method: 'GET' });
63
+ expect(result.isOk()).toBe(true);
64
+ expect(result.getValueOrThrow()).toEqual(data);
65
+ });
66
+ it('post calls httpClient.post with body and returns data', async () => {
67
+ const { httpClient, resilienceService, mocks } = makeDeps();
68
+ const endpoint = '/users';
69
+ const request = makeRequest('POST', { name: 'Alice' });
70
+ const data = { id: '1', name: 'Alice' };
71
+ mocks.postMock.mockResolvedValue({ data });
72
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
73
+ const result = await datasource.post(endpoint, { name: 'Alice' }, {
74
+ query: request.query,
75
+ signal: request.signal,
76
+ timeoutMs: request.timeoutMs,
77
+ headers: request.headers,
78
+ });
79
+ expect(mocks.postMock).toHaveBeenCalledWith(endpoint, { name: 'Alice' }, {
80
+ query: request.query,
81
+ signal: request.signal,
82
+ timeoutMs: request.timeoutMs,
83
+ headers: request.headers,
84
+ body: { name: 'Alice' },
85
+ method: 'POST',
86
+ });
87
+ expect(result.isOk()).toBe(true);
88
+ expect(result.getValueOrThrow()).toEqual(data);
89
+ });
90
+ it('put calls httpClient.put with body and returns data', async () => {
91
+ const { httpClient, resilienceService, mocks } = makeDeps();
92
+ const endpoint = '/users/1';
93
+ const request = makeRequest('PUT', { name: 'Alice Updated' });
94
+ const data = { id: '1', name: 'Alice Updated' };
95
+ mocks.putMock.mockResolvedValue({ data });
96
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
97
+ const result = await datasource.put(endpoint, { name: 'Alice Updated' }, {
98
+ query: request.query,
99
+ signal: request.signal,
100
+ timeoutMs: request.timeoutMs,
101
+ headers: request.headers,
102
+ });
103
+ expect(mocks.putMock).toHaveBeenCalledWith(endpoint, { name: 'Alice Updated' }, {
104
+ query: request.query,
105
+ signal: request.signal,
106
+ timeoutMs: request.timeoutMs,
107
+ headers: request.headers,
108
+ method: 'PUT',
109
+ body: { name: 'Alice Updated' },
110
+ });
111
+ expect(result.isOk()).toBe(true);
112
+ expect(result.getValueOrThrow()).toEqual(data);
113
+ });
114
+ it('patch calls httpClient.patch with body and returns data', async () => {
115
+ const { httpClient, resilienceService, mocks } = makeDeps();
116
+ const endpoint = '/users/1';
117
+ const request = makeRequest('PATCH', { name: 'Alice Patched' });
118
+ const data = { id: '1', name: 'Alice Patched' };
119
+ mocks.patchMock.mockResolvedValue({ data });
120
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
121
+ const result = await datasource.patch(endpoint, { name: 'Alice Patched' }, {
122
+ query: request.query,
123
+ signal: request.signal,
124
+ timeoutMs: request.timeoutMs,
125
+ headers: request.headers,
126
+ });
127
+ expect(mocks.patchMock).toHaveBeenCalledWith(endpoint, { name: 'Alice Patched' }, {
128
+ query: request.query,
129
+ signal: request.signal,
130
+ timeoutMs: request.timeoutMs,
131
+ headers: request.headers,
132
+ method: 'PATCH',
133
+ body: { name: 'Alice Patched' },
134
+ });
135
+ expect(result.isOk()).toBe(true);
136
+ expect(result.getValueOrThrow()).toEqual(data);
137
+ });
138
+ it('delete calls httpClient.delete and returns data', async () => {
139
+ const { httpClient, resilienceService, mocks } = makeDeps();
140
+ const endpoint = '/users/1';
141
+ const request = makeRequest('DELETE', undefined);
142
+ const data = { id: '1', name: 'Alice' };
143
+ mocks.deleteMock.mockResolvedValue({ data });
144
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
145
+ const result = await datasource.delete(endpoint, {
146
+ query: request.query,
147
+ signal: request.signal,
148
+ timeoutMs: request.timeoutMs,
149
+ headers: request.headers,
150
+ });
151
+ expect(mocks.deleteMock).toHaveBeenCalledWith(endpoint, {
152
+ query: request.query,
153
+ signal: request.signal,
154
+ timeoutMs: request.timeoutMs,
155
+ headers: request.headers,
156
+ method: 'DELETE',
157
+ });
158
+ expect(result.isOk()).toBe(true);
159
+ expect(result.getValueOrThrow()).toEqual(data);
160
+ });
161
+ it('get propagates errors thrown by resilience service', async () => {
162
+ const { httpClient, resilienceService, mocks } = makeDeps();
163
+ const endpoint = '/users';
164
+ const request = makeRequest('GET', undefined);
165
+ const expectedError = new Error('resilience failure');
166
+ mocks.executeMock.mockRejectedValue(expectedError);
167
+ const datasource = new MyRemoteDataSource(httpClient, resilienceService);
168
+ await expect(datasource.get(endpoint, {
169
+ query: request.query,
170
+ signal: request.signal,
171
+ timeoutMs: request.timeoutMs,
172
+ headers: request.headers,
173
+ })).rejects.toThrow('resilience failure');
174
+ });
175
+ });
176
+ //# sourceMappingURL=remote.datasource.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.datasource.test.js","sourceRoot":"","sources":["../../../../src/infrastructure/datasources/__tests__/remote.datasource.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,kB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F,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAAI,EAAE;QAClE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;QAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAA;QACzB,MAAM,OAAO,GAAG,WAAW,CAAY,KAAK,EAAE,SAAS,CAAC,CAAA;QACxD,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAErD,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAA;QAElD,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;QAExE,MAAM,MAAM,CACV,UAAU,CAAC,GAAG,CAAU,QAAQ,EAAE;YAChC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './remote.datasource';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/datasources/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './remote.datasource';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/datasources/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,43 @@
1
+ import type { IHttpClient, IRemoteDataSource, IServiceResilience, ResultType } from '../../domain';
2
+ import type { HttpBaseRequest } from '../../shared';
3
+ /**
4
+ * @description Concrete implementation of the IRemoteDataSource contract that utilizes an agnostic HTTP client and a resilience service to fetch data from remote endpoints. The RemoteDataSource class is responsible for sending HTTP requests based on the provided HttpClientRequest parameters, while leveraging the resilience features of the IServiceResilience to ensure reliable communication with external services. This implementation abstracts away the details of how HTTP requests are made and how resilience is handled, allowing for flexibility in choosing different HTTP clients and resilience strategies without affecting the consumers of the IRemoteDataSource interface.
5
+ *
6
+ * @author Xeno
7
+ * @version 1.0.0
8
+ * @since 2025-09-30
9
+ * @link https://github.com/Mattia-Carcione/xeno-js
10
+ */
11
+ export declare abstract class RemoteDataSource implements IRemoteDataSource {
12
+ private readonly _httpClient;
13
+ private readonly _resilienceService;
14
+ /** The constructor of the RemoteDataSource class takes two dependencies: an instance of an agnostic HTTP client that implements the IHttpClient interface, and an instance of a resilience service that implements the IServiceResilience interface.
15
+ * These dependencies are injected into the class, allowing for greater flexibility and testability.
16
+ * The HTTP client is used to send requests to remote endpoints, while the resilience service is used to execute these requests with built-in support for retries, timeouts, and circuit breakers, ensuring that the remote calls are more resilient to failures and can recover gracefully from errors.
17
+ * @param _httpClient An instance of an agnostic HTTP client that implements the IHttpClient interface, used for sending HTTP requests to remote endpoints.
18
+ * @param _resilienceService An instance of a resilience service that implements the IServiceResilience interface, used for executing HTTP requests with built-in support for retries, timeouts, and circuit breakers to enhance the reliability of remote calls.
19
+ *
20
+ * @author Xeno
21
+ * @version 1.0.0
22
+ * @since 2025-09-30
23
+ * @link https://github.com/Mattia-Carcione/xeno-js
24
+ */
25
+ constructor(_httpClient: IHttpClient, _resilienceService: IServiceResilience);
26
+ /** @description Private method that sends an HTTP request to a specified endpoint using the provided HttpRequest options. The method utilizes the resilience service to execute the request, ensuring that it is performed with built-in support for retries, timeouts, and circuit breakers. The response from the HTTP client is then wrapped in a ResultType, which encapsulates either the successful response data or an error, providing a consistent way to handle both success and failure cases.
27
+ * @param endpoint The URL or endpoint to which the HTTP request is sent.
28
+ * @param options The HttpRequest options that specify the HTTP method, headers, query parameters, body, and other request configurations.
29
+ * @returns A Promise that resolves to a ResultType containing either the successful response data or an error if the request fails.
30
+ *
31
+ * @author Xeno
32
+ * @version 1.0.0
33
+ * @since 2025-09-30
34
+ * @link https://github.com/Mattia-Carcione/xeno-js
35
+ */
36
+ private send;
37
+ get<TResponse>(endpoint: string, request?: HttpBaseRequest): Promise<ResultType<TResponse>>;
38
+ post<TResponse, TBody = unknown>(endpoint: string, body: TBody, request?: HttpBaseRequest): Promise<ResultType<TResponse>>;
39
+ put<TResponse, TBody = unknown>(endpoint: string, body: TBody, request?: HttpBaseRequest): Promise<ResultType<TResponse>>;
40
+ patch<TResponse, TBody = unknown>(endpoint: string, body: TBody, request?: HttpBaseRequest): Promise<ResultType<TResponse>>;
41
+ delete<TResponse>(endpoint: string, request?: HttpBaseRequest): Promise<ResultType<TResponse>>;
42
+ }
43
+ //# sourceMappingURL=remote.datasource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.datasource.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/datasources/remote.datasource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE9F,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAA;AAE5D;;;;;;;GAOG;AACH,8BAAsB,gBAAiB,YAAW,iBAAiB;IAa/D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAbrC;;;;;;;;;;OAUG;gBAEgB,WAAW,EAAE,WAAW,EACxB,kBAAkB,EAAE,kBAAkB;IAGzD;;;;;;;;;OASG;YACW,IAAI;IA2BL,GAAG,CAAC,SAAS,EACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAYpB,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,EAC1C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,KAAK,EACX,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAapB,GAAG,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,EACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,KAAK,EACX,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAapB,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,OAAO,EAC3C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,KAAK,EACX,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAapB,MAAM,CAAC,SAAS,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;CAWlC"}
@@ -0,0 +1,111 @@
1
+ import { AppError, Result } from '../../domain';
2
+ /**
3
+ * @description Concrete implementation of the IRemoteDataSource contract that utilizes an agnostic HTTP client and a resilience service to fetch data from remote endpoints. The RemoteDataSource class is responsible for sending HTTP requests based on the provided HttpClientRequest parameters, while leveraging the resilience features of the IServiceResilience to ensure reliable communication with external services. This implementation abstracts away the details of how HTTP requests are made and how resilience is handled, allowing for flexibility in choosing different HTTP clients and resilience strategies without affecting the consumers of the IRemoteDataSource interface.
4
+ *
5
+ * @author Xeno
6
+ * @version 1.0.0
7
+ * @since 2025-09-30
8
+ * @link https://github.com/Mattia-Carcione/xeno-js
9
+ */
10
+ export class RemoteDataSource {
11
+ _httpClient;
12
+ _resilienceService;
13
+ /** The constructor of the RemoteDataSource class takes two dependencies: an instance of an agnostic HTTP client that implements the IHttpClient interface, and an instance of a resilience service that implements the IServiceResilience interface.
14
+ * These dependencies are injected into the class, allowing for greater flexibility and testability.
15
+ * The HTTP client is used to send requests to remote endpoints, while the resilience service is used to execute these requests with built-in support for retries, timeouts, and circuit breakers, ensuring that the remote calls are more resilient to failures and can recover gracefully from errors.
16
+ * @param _httpClient An instance of an agnostic HTTP client that implements the IHttpClient interface, used for sending HTTP requests to remote endpoints.
17
+ * @param _resilienceService An instance of a resilience service that implements the IServiceResilience interface, used for executing HTTP requests with built-in support for retries, timeouts, and circuit breakers to enhance the reliability of remote calls.
18
+ *
19
+ * @author Xeno
20
+ * @version 1.0.0
21
+ * @since 2025-09-30
22
+ * @link https://github.com/Mattia-Carcione/xeno-js
23
+ */
24
+ constructor(_httpClient, _resilienceService) {
25
+ this._httpClient = _httpClient;
26
+ this._resilienceService = _resilienceService;
27
+ }
28
+ /** @description Private method that sends an HTTP request to a specified endpoint using the provided HttpRequest options. The method utilizes the resilience service to execute the request, ensuring that it is performed with built-in support for retries, timeouts, and circuit breakers. The response from the HTTP client is then wrapped in a ResultType, which encapsulates either the successful response data or an error, providing a consistent way to handle both success and failure cases.
29
+ * @param endpoint The URL or endpoint to which the HTTP request is sent.
30
+ * @param options The HttpRequest options that specify the HTTP method, headers, query parameters, body, and other request configurations.
31
+ * @returns A Promise that resolves to a ResultType containing either the successful response data or an error if the request fails.
32
+ *
33
+ * @author Xeno
34
+ * @version 1.0.0
35
+ * @since 2025-09-30
36
+ * @link https://github.com/Mattia-Carcione/xeno-js
37
+ */
38
+ async send(endpoint, options) {
39
+ const response = await this._resilienceService.execute(async () => {
40
+ switch (options.method) {
41
+ case 'GET':
42
+ return await this._httpClient.get(endpoint, options);
43
+ case 'POST':
44
+ return await this._httpClient.post(endpoint, options.body, options);
45
+ case 'PUT':
46
+ return await this._httpClient.put(endpoint, options.body, options);
47
+ case 'PATCH':
48
+ return await this._httpClient.patch(endpoint, options.body, options);
49
+ case 'DELETE':
50
+ return await this._httpClient.delete(endpoint, options);
51
+ default:
52
+ throw AppError.notSupported(this.constructor.name, `Unsupported HTTP method: ${options.method}`);
53
+ }
54
+ }, options.signal);
55
+ return Result.ok(response.data);
56
+ }
57
+ async get(endpoint, request) {
58
+ const options = {
59
+ query: request?.query,
60
+ signal: request?.signal,
61
+ timeoutMs: request?.timeoutMs,
62
+ headers: request?.headers,
63
+ method: 'GET',
64
+ };
65
+ return await this.send(endpoint, options);
66
+ }
67
+ async post(endpoint, body, request) {
68
+ const options = {
69
+ query: request?.query,
70
+ signal: request?.signal,
71
+ timeoutMs: request?.timeoutMs,
72
+ headers: request?.headers,
73
+ method: 'POST',
74
+ body,
75
+ };
76
+ return await this.send(endpoint, options);
77
+ }
78
+ async put(endpoint, body, request) {
79
+ const options = {
80
+ query: request?.query,
81
+ signal: request?.signal,
82
+ timeoutMs: request?.timeoutMs,
83
+ headers: request?.headers,
84
+ method: 'PUT',
85
+ body,
86
+ };
87
+ return await this.send(endpoint, options);
88
+ }
89
+ async patch(endpoint, body, request) {
90
+ const options = {
91
+ query: request?.query,
92
+ signal: request?.signal,
93
+ timeoutMs: request?.timeoutMs,
94
+ headers: request?.headers,
95
+ method: 'PATCH',
96
+ body,
97
+ };
98
+ return await this.send(endpoint, options);
99
+ }
100
+ async delete(endpoint, request) {
101
+ const options = {
102
+ query: request?.query,
103
+ signal: request?.signal,
104
+ timeoutMs: request?.timeoutMs,
105
+ headers: request?.headers,
106
+ method: 'DELETE',
107
+ };
108
+ return await this.send(endpoint, options);
109
+ }
110
+ }
111
+ //# sourceMappingURL=remote.datasource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.datasource.js","sourceRoot":"","sources":["../../../src/infrastructure/datasources/remote.datasource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAG3C;;;;;;;GAOG;AACH,MAAM,OAAgB,gBAAgB;IAajB;IACA;IAbnB;;;;;;;;;;OAUG;IACH,YACmB,WAAwB,EACxB,kBAAsC;QADtC,gBAAW,GAAX,WAAW,CAAa;QACxB,uBAAkB,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AAM,IAAI,CAAC,IAAI,CAAmB,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC7D,CAAC;IAEM,KAAK,CAAC,MAAM,CACjB,QAAgB,EAChB,OAAyB;QAEzB,MAAM,OAAO,GAAgB;YAC3B,KAAK,EAAE,OAAO,EAAE,KAAK;YACrB,MAAM,EAAE,OAAO,EAAE,MAAM;YACvB,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,OAAO,EAAE,OAAO,EAAE,OAAO;YACzB,MAAM,EAAE,QAAQ;SACjB,CAAA;QAED,OAAO,MAAM,IAAI,CAAC,IAAI,CAAY,QAAQ,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { IFactory, IHttpClient } from '@xeno-js/shared';
2
+ import type { HttpClientConfig } from '../../domain';
3
+ /**
4
+ * @description Factory class responsible for creating instances of AxiosHttpClient based on the provided configuration. It implements the IFactory interface, allowing for easy integration with dependency injection systems. The factory encapsulates the creation logic for the AxiosHttpClient, including the initialization of the underlying Axios instance with the specified configuration options such as base URL, default headers, and timeout settings. This design promotes separation of concerns and allows for flexibility in managing AxiosHttpClient instances across the application.
5
+
6
+ *
7
+ * @author Xeno
8
+ * @version 1.0.0
9
+ * @since 2025-09-30
10
+ * @link https://github.com/xeno-js/xeno-js
11
+ */
12
+ export declare class AxiosFactory implements IFactory<HttpClientConfig, IHttpClient> {
13
+ create(config: HttpClientConfig): IHttpClient;
14
+ }
15
+ //# sourceMappingURL=axios.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios.factory.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/factories/axios.factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIhD;;;;;;;;KAQK;AACL,qBAAa,YAAa,YAAW,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC;IACnE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW;CAarD"}
@@ -0,0 +1,26 @@
1
+ import axios from 'axios';
2
+ import { AxiosHttpClient } from '../http/axios.http';
3
+ /**
4
+ * @description Factory class responsible for creating instances of AxiosHttpClient based on the provided configuration. It implements the IFactory interface, allowing for easy integration with dependency injection systems. The factory encapsulates the creation logic for the AxiosHttpClient, including the initialization of the underlying Axios instance with the specified configuration options such as base URL, default headers, and timeout settings. This design promotes separation of concerns and allows for flexibility in managing AxiosHttpClient instances across the application.
5
+
6
+ *
7
+ * @author Xeno
8
+ * @version 1.0.0
9
+ * @since 2025-09-30
10
+ * @link https://github.com/xeno-js/xeno-js
11
+ */
12
+ export class AxiosFactory {
13
+ create(config) {
14
+ const axiosInstance = axios.create({
15
+ baseURL: config.baseURL,
16
+ headers: config.defaultHeaders,
17
+ timeout: config.timeoutMs,
18
+ maxRedirects: config.maxRedirects ?? 5,
19
+ decompress: config.decompress ?? true,
20
+ proxy: config.proxy,
21
+ withCredentials: config.withCredentials,
22
+ });
23
+ return new AxiosHttpClient(axiosInstance);
24
+ }
25
+ }
26
+ //# sourceMappingURL=axios.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios.factory.js","sourceRoot":"","sources":["../../../src/infrastructure/factories/axios.factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD;;;;;;;;KAQK;AACL,MAAM,OAAO,YAAY;IAChB,MAAM,CAAC,MAAwB;QACpC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YACjC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,MAAM,CAAC,cAAc;YAC9B,OAAO,EAAE,MAAM,CAAC,SAAS;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,CAAC;YACtC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;YACrC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC,CAAC,CAAA;QAEF,OAAO,IAAI,eAAe,CAAC,aAAa,CAAC,CAAA;IAC3C,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { IFactory, IServiceResilience, ResilienceConfig } from '../../domain';
2
+ /**
3
+ * @description Factory class responsible for creating instances of ServiceResilience based on the provided configuration. It implements the IFactory interface, allowing for easy integration with dependency injection systems. The factory encapsulates the creation logic for the ServiceResilience, including the initialization of the underlying resilience policies with the specified configuration options such as retry, circuit breaker, and bulkhead. This design promotes separation of concerns and allows for flexibility in managing ServiceResilience instances across the application.
4
+ *
5
+ * @author Xeno
6
+ * @version 1.0.0
7
+ * @since 2025-09-30
8
+ * @link https://github.com/Mattia-Carcione/xeno-js
9
+ */
10
+ export declare class CockatielResilienceFactory implements IFactory<ResilienceConfig, IServiceResilience> {
11
+ create(config: ResilienceConfig): IServiceResilience;
12
+ private isTransientError;
13
+ private isTransientAndIdempotent;
14
+ private checkConfigValue;
15
+ }
16
+ //# sourceMappingURL=cockatiel-resilience.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cockatiel-resilience.factory.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/factories/cockatiel-resilience.factory.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAe9E;;;;;;;GAOG;AACH,qBAAa,0BAA2B,YAAW,QAAQ,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;IACxF,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB;IAkE3D,OAAO,CAAC,gBAAgB;IA0CxB,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,gBAAgB;CAOzB"}