@temboplus/afloat 0.1.61 → 0.1.63

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 (398) hide show
  1. package/README.md +246 -42
  2. package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
  3. package/{script/npm/src/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
  4. package/dist/features/admin/admin.repository.d.ts +179 -0
  5. package/dist/features/admin/index.d.ts +2 -0
  6. package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
  7. package/dist/features/auth/access/access.repository.d.ts +55 -0
  8. package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
  9. package/dist/features/auth/auth.manager.d.ts +249 -0
  10. package/dist/features/auth/auth.repository.d.ts +66 -0
  11. package/dist/features/auth/auth.store.d.ts +139 -0
  12. package/{script/npm/src/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
  13. package/dist/features/auth/identity/identity.repository.d.ts +58 -0
  14. package/dist/features/auth/index.d.ts +5 -0
  15. package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
  16. package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
  17. package/dist/features/auth/profile/profile.repository.d.ts +56 -0
  18. package/{script/npm/src/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
  19. package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
  20. package/{script/npm/src/src → dist}/features/auth/storage/types.d.ts +1 -2
  21. package/dist/features/contact/contact-input-handler.d.ts +16 -0
  22. package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
  23. package/dist/features/contact/contact.dtos.d.ts +90 -0
  24. package/dist/features/contact/contact.repository.d.ts +116 -0
  25. package/dist/features/contact/index.d.ts +2 -0
  26. package/dist/features/payout/index.d.ts +3 -0
  27. package/dist/features/payout/payout-channel-handler.d.ts +108 -0
  28. package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
  29. package/dist/features/payout/payout.dtos.d.ts +365 -0
  30. package/dist/features/payout/payout.repository.d.ts +193 -0
  31. package/dist/features/wallet/index.d.ts +4 -0
  32. package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
  33. package/{script/npm/src/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
  34. package/dist/features/wallet/wallet.dtos.d.ts +204 -0
  35. package/dist/features/wallet/wallet.repository.d.ts +173 -0
  36. package/dist/features/wallet/wallet.utils.d.ts +17 -0
  37. package/dist/index.cjs.js +2 -0
  38. package/dist/index.cjs.js.map +1 -0
  39. package/dist/index.d.ts +7 -0
  40. package/dist/index.esm.js +2 -0
  41. package/dist/index.esm.js.map +1 -0
  42. package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
  43. package/{script/npm/src/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
  44. package/dist/lib/api/index.d.ts +2 -0
  45. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  46. package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  47. package/dist/lib/error/error.utils.d.ts +22 -0
  48. package/dist/lib/error/index.d.ts +3 -0
  49. package/dist/models/contact-info.model.d.ts +817 -0
  50. package/{script/npm/src/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
  51. package/dist/models/index.d.ts +11 -0
  52. package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
  53. package/dist/models/narration.model.d.ts +184 -0
  54. package/{script/npm/src/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +14 -16
  55. package/{esm/src → dist}/models/permission.d.ts +1 -2
  56. package/{script/npm/src/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
  57. package/{script/npm/src/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
  58. package/dist/models/statement-entry.model.d.ts +248 -0
  59. package/dist/models/user.model.d.ts +65 -0
  60. package/{script/npm/src/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
  61. package/package.json +47 -24
  62. package/LICENSE +0 -7
  63. package/esm/mod.d.ts +0 -8
  64. package/esm/mod.d.ts.map +0 -1
  65. package/esm/mod.js +0 -7
  66. package/esm/package.json +0 -3
  67. package/esm/src/errors/api_error.d.ts.map +0 -1
  68. package/esm/src/errors/api_error.js +0 -90
  69. package/esm/src/errors/index.d.ts +0 -3
  70. package/esm/src/errors/index.d.ts.map +0 -1
  71. package/esm/src/errors/index.js +0 -2
  72. package/esm/src/errors/permission_error.d.ts +0 -48
  73. package/esm/src/errors/permission_error.d.ts.map +0 -1
  74. package/esm/src/errors/permission_error.js +0 -70
  75. package/esm/src/features/admin/contract.d.ts.map +0 -1
  76. package/esm/src/features/admin/contract.js +0 -210
  77. package/esm/src/features/admin/index.d.ts +0 -4
  78. package/esm/src/features/admin/index.d.ts.map +0 -1
  79. package/esm/src/features/admin/index.js +0 -3
  80. package/esm/src/features/admin/repository.d.ts +0 -114
  81. package/esm/src/features/admin/repository.d.ts.map +0 -1
  82. package/esm/src/features/admin/repository.js +0 -248
  83. package/esm/src/features/admin/schemas.d.ts +0 -146
  84. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  85. package/esm/src/features/admin/schemas.js +0 -206
  86. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  87. package/esm/src/features/auth/access/contract.js +0 -14
  88. package/esm/src/features/auth/access/repository.d.ts +0 -11
  89. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  90. package/esm/src/features/auth/access/repository.js +0 -25
  91. package/esm/src/features/auth/contract.d.ts.map +0 -1
  92. package/esm/src/features/auth/contract.js +0 -43
  93. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  94. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  95. package/esm/src/features/auth/identity/contract.js +0 -17
  96. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  97. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  98. package/esm/src/features/auth/identity/repository.js +0 -30
  99. package/esm/src/features/auth/index.d.ts +0 -6
  100. package/esm/src/features/auth/index.d.ts.map +0 -1
  101. package/esm/src/features/auth/index.js +0 -5
  102. package/esm/src/features/auth/manager.d.ts +0 -105
  103. package/esm/src/features/auth/manager.d.ts.map +0 -1
  104. package/esm/src/features/auth/manager.js +0 -181
  105. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  106. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  107. package/esm/src/features/auth/profile/contract.js +0 -14
  108. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  109. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  110. package/esm/src/features/auth/profile/repository.js +0 -25
  111. package/esm/src/features/auth/repository.d.ts +0 -30
  112. package/esm/src/features/auth/repository.d.ts.map +0 -1
  113. package/esm/src/features/auth/repository.js +0 -69
  114. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  115. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  116. package/esm/src/features/auth/storage/client_store.js +0 -46
  117. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  118. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  119. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  120. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  121. package/esm/src/features/auth/storage/server_store.js +0 -34
  122. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  123. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  124. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  125. package/esm/src/features/auth/storage/types.d.ts +0 -42
  126. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  127. package/esm/src/features/auth/storage/types.js +0 -1
  128. package/esm/src/features/contact/contract.d.ts.map +0 -1
  129. package/esm/src/features/contact/contract.js +0 -49
  130. package/esm/src/features/contact/index.d.ts +0 -2
  131. package/esm/src/features/contact/index.d.ts.map +0 -1
  132. package/esm/src/features/contact/index.js +0 -1
  133. package/esm/src/features/contact/repository.d.ts +0 -58
  134. package/esm/src/features/contact/repository.d.ts.map +0 -1
  135. package/esm/src/features/contact/repository.js +0 -108
  136. package/esm/src/features/payout/contract.d.ts.map +0 -1
  137. package/esm/src/features/payout/contract.js +0 -75
  138. package/esm/src/features/payout/index.d.ts +0 -2
  139. package/esm/src/features/payout/index.d.ts.map +0 -1
  140. package/esm/src/features/payout/index.js +0 -1
  141. package/esm/src/features/payout/repository.d.ts +0 -67
  142. package/esm/src/features/payout/repository.d.ts.map +0 -1
  143. package/esm/src/features/payout/repository.js +0 -163
  144. package/esm/src/features/wallet/contract.d.ts +0 -137
  145. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  146. package/esm/src/features/wallet/contract.js +0 -38
  147. package/esm/src/features/wallet/index.d.ts +0 -2
  148. package/esm/src/features/wallet/index.d.ts.map +0 -1
  149. package/esm/src/features/wallet/index.js +0 -1
  150. package/esm/src/features/wallet/repository.d.ts +0 -57
  151. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  152. package/esm/src/features/wallet/repository.js +0 -93
  153. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  154. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  155. package/esm/src/models/contact/derivatives/contact.js +0 -266
  156. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  157. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  158. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  159. package/esm/src/models/contact/index.d.ts +0 -5
  160. package/esm/src/models/contact/index.d.ts.map +0 -1
  161. package/esm/src/models/contact/index.js +0 -4
  162. package/esm/src/models/contact/schemas.d.ts +0 -66
  163. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  164. package/esm/src/models/contact/schemas.js +0 -64
  165. package/esm/src/models/contact/validation.d.ts +0 -37
  166. package/esm/src/models/contact/validation.d.ts.map +0 -1
  167. package/esm/src/models/contact/validation.js +0 -146
  168. package/esm/src/models/index.d.ts +0 -7
  169. package/esm/src/models/index.d.ts.map +0 -1
  170. package/esm/src/models/index.js +0 -6
  171. package/esm/src/models/payout/api.d.ts +0 -29
  172. package/esm/src/models/payout/api.d.ts.map +0 -1
  173. package/esm/src/models/payout/api.js +0 -1
  174. package/esm/src/models/payout/channel.d.ts +0 -58
  175. package/esm/src/models/payout/channel.d.ts.map +0 -1
  176. package/esm/src/models/payout/channel.js +0 -53
  177. package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
  178. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  179. package/esm/src/models/payout/derivatives/payout.js +0 -265
  180. package/esm/src/models/payout/index.d.ts +0 -7
  181. package/esm/src/models/payout/index.d.ts.map +0 -1
  182. package/esm/src/models/payout/index.js +0 -6
  183. package/esm/src/models/payout/narration.d.ts +0 -164
  184. package/esm/src/models/payout/narration.d.ts.map +0 -1
  185. package/esm/src/models/payout/narration.js +0 -308
  186. package/esm/src/models/payout/schemas.d.ts +0 -156
  187. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  188. package/esm/src/models/payout/schemas.js +0 -105
  189. package/esm/src/models/payout/status.d.ts +0 -33
  190. package/esm/src/models/payout/status.d.ts.map +0 -1
  191. package/esm/src/models/payout/status.js +0 -34
  192. package/esm/src/models/permission.d.ts.map +0 -1
  193. package/esm/src/models/permission.js +0 -50
  194. package/esm/src/models/role.d.ts +0 -21
  195. package/esm/src/models/role.d.ts.map +0 -1
  196. package/esm/src/models/role.js +0 -73
  197. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  198. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  199. package/esm/src/models/user/authenticated-user.js +0 -226
  200. package/esm/src/models/user/index.d.ts +0 -4
  201. package/esm/src/models/user/index.d.ts.map +0 -1
  202. package/esm/src/models/user/index.js +0 -3
  203. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  204. package/esm/src/models/user/managed-user.js +0 -255
  205. package/esm/src/models/user/profile.d.ts +0 -161
  206. package/esm/src/models/user/profile.d.ts.map +0 -1
  207. package/esm/src/models/user/profile.js +0 -334
  208. package/esm/src/models/wallet/index.d.ts +0 -4
  209. package/esm/src/models/wallet/index.d.ts.map +0 -1
  210. package/esm/src/models/wallet/index.js +0 -3
  211. package/esm/src/models/wallet/schemas.d.ts +0 -95
  212. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  213. package/esm/src/models/wallet/schemas.js +0 -35
  214. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  215. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  216. package/esm/src/models/wallet/statement_entry.js +0 -255
  217. package/esm/src/models/wallet/wallet.d.ts +0 -147
  218. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  219. package/esm/src/models/wallet/wallet.js +0 -279
  220. package/esm/src/shared/base_repository.d.ts.map +0 -1
  221. package/esm/src/shared/base_repository.js +0 -153
  222. package/esm/src/shared/common_responses.d.ts +0 -13
  223. package/esm/src/shared/common_responses.d.ts.map +0 -1
  224. package/esm/src/shared/common_responses.js +0 -10
  225. package/esm/src/shared/index.d.ts +0 -3
  226. package/esm/src/shared/index.d.ts.map +0 -1
  227. package/esm/src/shared/index.js +0 -2
  228. package/esm/src/shared/token_required_repository.d.ts +0 -78
  229. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  230. package/esm/src/shared/token_required_repository.js +0 -128
  231. package/script/mod.d.ts +0 -8
  232. package/script/mod.d.ts.map +0 -1
  233. package/script/mod.js +0 -23
  234. package/script/npm/src/mod.d.ts +0 -8
  235. package/script/npm/src/mod.d.ts.map +0 -1
  236. package/script/npm/src/mod.js +0 -23
  237. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  238. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  239. package/script/npm/src/src/errors/api_error.js +0 -94
  240. package/script/npm/src/src/errors/index.d.ts +0 -3
  241. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  242. package/script/npm/src/src/errors/index.js +0 -18
  243. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  244. package/script/npm/src/src/errors/permission_error.js +0 -74
  245. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  246. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  247. package/script/npm/src/src/features/admin/contract.js +0 -213
  248. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  249. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  250. package/script/npm/src/src/features/admin/index.js +0 -19
  251. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  252. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  253. package/script/npm/src/src/features/admin/repository.js +0 -252
  254. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  255. package/script/npm/src/src/features/admin/schemas.js +0 -209
  256. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  257. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  258. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  259. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  260. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  261. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  262. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  263. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  264. package/script/npm/src/src/features/auth/contract.js +0 -46
  265. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  266. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  267. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  268. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  269. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  270. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  271. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  272. package/script/npm/src/src/features/auth/index.js +0 -21
  273. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  274. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  275. package/script/npm/src/src/features/auth/manager.js +0 -185
  276. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  277. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  278. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  279. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  280. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  281. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  282. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  283. package/script/npm/src/src/features/auth/repository.js +0 -73
  284. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  285. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  286. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  287. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  288. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  289. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  290. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  291. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  292. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  293. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  294. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  295. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  296. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  297. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  298. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  299. package/script/npm/src/src/features/contact/contract.js +0 -52
  300. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  301. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  302. package/script/npm/src/src/features/contact/index.js +0 -17
  303. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  304. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  305. package/script/npm/src/src/features/contact/repository.js +0 -112
  306. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  307. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  308. package/script/npm/src/src/features/payout/contract.js +0 -78
  309. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  310. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  311. package/script/npm/src/src/features/payout/index.js +0 -17
  312. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  313. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  314. package/script/npm/src/src/features/payout/repository.js +0 -167
  315. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  316. package/script/npm/src/src/features/wallet/contract.js +0 -41
  317. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  318. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  319. package/script/npm/src/src/features/wallet/index.js +0 -17
  320. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  321. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  322. package/script/npm/src/src/features/wallet/repository.js +0 -97
  323. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  324. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  325. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  326. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  327. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  328. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  329. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  330. package/script/npm/src/src/models/contact/index.js +0 -20
  331. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  332. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  333. package/script/npm/src/src/models/contact/schemas.js +0 -67
  334. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  335. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  336. package/script/npm/src/src/models/contact/validation.js +0 -153
  337. package/script/npm/src/src/models/index.d.ts +0 -7
  338. package/script/npm/src/src/models/index.d.ts.map +0 -1
  339. package/script/npm/src/src/models/index.js +0 -22
  340. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  341. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  342. package/script/npm/src/src/models/payout/api.js +0 -2
  343. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  344. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  345. package/script/npm/src/src/models/payout/channel.js +0 -56
  346. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  347. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -269
  348. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  349. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  350. package/script/npm/src/src/models/payout/index.js +0 -22
  351. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  352. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  353. package/script/npm/src/src/models/payout/narration.js +0 -312
  354. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  355. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  356. package/script/npm/src/src/models/payout/schemas.js +0 -108
  357. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  358. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  359. package/script/npm/src/src/models/payout/status.js +0 -37
  360. package/script/npm/src/src/models/permission.d.ts +0 -55
  361. package/script/npm/src/src/models/permission.d.ts.map +0 -1
  362. package/script/npm/src/src/models/permission.js +0 -53
  363. package/script/npm/src/src/models/role.d.ts.map +0 -1
  364. package/script/npm/src/src/models/role.js +0 -77
  365. package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
  366. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
  367. package/script/npm/src/src/models/user/authenticated-user.js +0 -230
  368. package/script/npm/src/src/models/user/index.d.ts +0 -4
  369. package/script/npm/src/src/models/user/index.d.ts.map +0 -1
  370. package/script/npm/src/src/models/user/index.js +0 -19
  371. package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
  372. package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
  373. package/script/npm/src/src/models/user/managed-user.js +0 -260
  374. package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
  375. package/script/npm/src/src/models/user/profile.js +0 -338
  376. package/script/npm/src/src/models/wallet/index.d.ts +0 -4
  377. package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
  378. package/script/npm/src/src/models/wallet/index.js +0 -19
  379. package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
  380. package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
  381. package/script/npm/src/src/models/wallet/schemas.js +0 -38
  382. package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
  383. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
  384. package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
  385. package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
  386. package/script/npm/src/src/models/wallet/wallet.js +0 -283
  387. package/script/npm/src/src/shared/base_repository.d.ts +0 -80
  388. package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
  389. package/script/npm/src/src/shared/base_repository.js +0 -157
  390. package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
  391. package/script/npm/src/src/shared/common_responses.js +0 -13
  392. package/script/npm/src/src/shared/index.d.ts +0 -3
  393. package/script/npm/src/src/shared/index.d.ts.map +0 -1
  394. package/script/npm/src/src/shared/index.js +0 -18
  395. package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
  396. package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
  397. package/script/npm/src/src/shared/token_required_repository.js +0 -132
  398. package/script/package.json +0 -3
@@ -1,260 +0,0 @@
1
- "use strict";
2
- // deno-lint-ignore-file no-explicit-any
3
- // ====================== Base User Entity ====================== //
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.ManagedUser = exports.UserEntity = void 0;
6
- const role_js_1 = require("../role.js");
7
- /**
8
- * Base user entity - represents a user in the system
9
- */
10
- class UserEntity {
11
- constructor(data) {
12
- Object.defineProperty(this, "id", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: void 0
17
- });
18
- Object.defineProperty(this, "name", {
19
- enumerable: true,
20
- configurable: true,
21
- writable: true,
22
- value: void 0
23
- });
24
- Object.defineProperty(this, "identity", {
25
- enumerable: true,
26
- configurable: true,
27
- writable: true,
28
- value: void 0
29
- }); // email or phone
30
- Object.defineProperty(this, "profileId", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
- Object.defineProperty(this, "permissions", {
37
- enumerable: true,
38
- configurable: true,
39
- writable: true,
40
- value: void 0
41
- });
42
- this.id = data.id;
43
- this.name = data.name;
44
- this.identity = data.identity;
45
- this.profileId = data.profileId;
46
- this.permissions = new Set(data.permissions);
47
- }
48
- /**
49
- * Check if user has a specific permission
50
- */
51
- can(permission) {
52
- return this.permissions.has(permission);
53
- }
54
- /**
55
- * Check if user has any of the specified permissions
56
- */
57
- canAny(permissions) {
58
- return permissions.some((p) => this.permissions.has(p));
59
- }
60
- /**
61
- * Check if user has all of the specified permissions
62
- */
63
- canAll(permissions) {
64
- return permissions.every((p) => this.permissions.has(p));
65
- }
66
- }
67
- exports.UserEntity = UserEntity;
68
- /**
69
- * Represents a user from the admin management perspective.
70
- * Same person as AuthenticatedUser but with management metadata and capabilities.
71
- */
72
- class ManagedUser extends UserEntity {
73
- constructor(data) {
74
- super({
75
- id: data.id,
76
- name: data.name,
77
- identity: data.identity,
78
- profileId: data.profileId,
79
- permissions: data.role?.access ?? [],
80
- });
81
- Object.defineProperty(this, "type", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: void 0
86
- });
87
- Object.defineProperty(this, "roleId", {
88
- enumerable: true,
89
- configurable: true,
90
- writable: true,
91
- value: void 0
92
- });
93
- Object.defineProperty(this, "resetPassword", {
94
- enumerable: true,
95
- configurable: true,
96
- writable: true,
97
- value: void 0
98
- });
99
- Object.defineProperty(this, "isActive", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: void 0
104
- });
105
- Object.defineProperty(this, "isArchived", {
106
- enumerable: true,
107
- configurable: true,
108
- writable: true,
109
- value: void 0
110
- });
111
- Object.defineProperty(this, "role", {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: void 0
116
- });
117
- Object.defineProperty(this, "createdAt", {
118
- enumerable: true,
119
- configurable: true,
120
- writable: true,
121
- value: void 0
122
- });
123
- Object.defineProperty(this, "updatedAt", {
124
- enumerable: true,
125
- configurable: true,
126
- writable: true,
127
- value: void 0
128
- });
129
- this.type = data.type;
130
- this.roleId = data.roleId;
131
- this.resetPassword = data.resetPassword;
132
- this.isActive = data.isActive;
133
- this.isArchived = data.isArchived;
134
- this.createdAt = new Date(data.createdAt);
135
- this.updatedAt = new Date(data.updatedAt);
136
- if (data.role) {
137
- try {
138
- this.role = new role_js_1.Role(data.role);
139
- }
140
- catch (_) {
141
- //
142
- }
143
- }
144
- }
145
- /**
146
- * Check if user account is active
147
- */
148
- isAccountActive() {
149
- return this.isActive;
150
- }
151
- /**
152
- * Check if user account is archived
153
- */
154
- isAccountArchived() {
155
- return this.isArchived;
156
- }
157
- /**
158
- * Check if user needs to reset password
159
- */
160
- needsPasswordReset() {
161
- return this.resetPassword;
162
- }
163
- /**
164
- * Get comprehensive account status
165
- */
166
- getAccountStatus() {
167
- if (this.isArchived) {
168
- return {
169
- status: "archived",
170
- label: "Archived",
171
- color: "default",
172
- description: "Account has been archived and is no longer accessible",
173
- };
174
- }
175
- if (!this.isActive) {
176
- return {
177
- status: "inactive",
178
- label: "Inactive",
179
- color: "error",
180
- description: "Account has been deactivated by an administrator",
181
- };
182
- }
183
- if (this.resetPassword) {
184
- return {
185
- status: "password_reset_required",
186
- label: "Password Reset Required",
187
- color: "warning",
188
- description: "User must reset their password on next login",
189
- };
190
- }
191
- return {
192
- status: "active",
193
- label: "Active",
194
- color: "success",
195
- description: "Account is active and ready to use",
196
- };
197
- }
198
- /**
199
- * Get role display name
200
- */
201
- getRoleName() {
202
- return this.role?.name ?? "";
203
- }
204
- /**
205
- * Get formatted creation date
206
- */
207
- getCreatedDate() {
208
- return this.createdAt.toLocaleDateString();
209
- }
210
- /**
211
- * Get time since last update
212
- */
213
- getLastUpdateInfo() {
214
- const now = new Date();
215
- const diffMs = now.getTime() - this.updatedAt.getTime();
216
- const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
217
- if (diffDays === 0)
218
- return "Today";
219
- if (diffDays === 1)
220
- return "Yesterday";
221
- if (diffDays < 7)
222
- return `${diffDays} days ago`;
223
- if (diffDays < 30)
224
- return `${Math.floor(diffDays / 7)} weeks ago`;
225
- return this.updatedAt.toLocaleDateString();
226
- }
227
- static from(data) {
228
- try {
229
- if (!data?.id || !data?.name || !data?.identity || !data?.roleId) {
230
- console.error("Missing required ManagedUser fields:", data);
231
- return undefined;
232
- }
233
- return new ManagedUser(data);
234
- }
235
- catch (error) {
236
- console.error("Error creating ManagedUser:", error);
237
- return undefined;
238
- }
239
- }
240
- static createMany(dataArray) {
241
- return dataArray.map((data) => ManagedUser.from(data)).filter(Boolean);
242
- }
243
- toJSON() {
244
- return {
245
- id: this.id,
246
- name: this.name,
247
- identity: this.identity,
248
- type: this.type,
249
- profileId: this.profileId,
250
- roleId: this.roleId,
251
- resetPassword: this.resetPassword,
252
- isActive: this.isActive,
253
- isArchived: this.isArchived,
254
- role: this.role?.toJSON(),
255
- createdAt: this.createdAt.toISOString(),
256
- updatedAt: this.updatedAt.toISOString(),
257
- };
258
- }
259
- }
260
- exports.ManagedUser = ManagedUser;
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/user/profile.ts"],"names":[],"mappings":"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"}
@@ -1,338 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Profile = exports.profileSchema = void 0;
4
- const zod_1 = require("zod");
5
- const frontend_core_1 = require("@temboplus/frontend-core");
6
- /**
7
- * Zod schema for validating user profile data.
8
- * Defines validation rules and constraints for each profile field.
9
- *
10
- * @const {ProfileType}
11
- *
12
- * @property {string} id - Unique identifier for the profile
13
- * @property {string | null | undefined} firstName - User's first name, can be null or undefined
14
- * @property {string | null | undefined} lastName - User's last name, can be null or undefined
15
- * @property {string} displayName - User's display name
16
- * @property {string | null | undefined} phone - User's contact phone number, can be null or undefined
17
- * @property {string} accountNo - User's account number
18
- * @property {string | null | undefined} email - User's email address, can be null or undefined
19
- */
20
- exports.profileSchema = zod_1.z.object({
21
- id: zod_1.z.string(),
22
- firstName: zod_1.z.string().optional().nullable(),
23
- lastName: zod_1.z.string().optional().nullable(),
24
- displayName: zod_1.z.string(),
25
- phone: zod_1.z.string().optional().nullable(),
26
- accountNo: zod_1.z.string().min(1),
27
- email: zod_1.z.string().email().optional().nullable(),
28
- });
29
- /**
30
- * Represents a user profile in the system.
31
- *
32
- * This class provides methods for creating, validating, and manipulating user profile data.
33
- * It integrates with the Zod schema validation for data integrity.
34
- */
35
- class Profile {
36
- /**
37
- * Gets the profile schema used for validation.
38
- */
39
- static get schema() {
40
- return exports.profileSchema;
41
- }
42
- /**
43
- * Creates a new Profile instance with the provided data.
44
- *
45
- * Private constructor to enforce use of static factory methods.
46
- *
47
- * @param data - Object containing profile information
48
- */
49
- constructor(data) {
50
- /** Unique identifier for the profile */
51
- Object.defineProperty(this, "_id", {
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- value: void 0
56
- });
57
- /** User's first name */
58
- Object.defineProperty(this, "_firstName", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- /** User's last name */
65
- Object.defineProperty(this, "_lastName", {
66
- enumerable: true,
67
- configurable: true,
68
- writable: true,
69
- value: void 0
70
- });
71
- /** User's display name, can be used for presentation */
72
- Object.defineProperty(this, "_displayName", {
73
- enumerable: true,
74
- configurable: true,
75
- writable: true,
76
- value: void 0
77
- });
78
- /** User's phone number, stored as a PhoneNumber object */
79
- Object.defineProperty(this, "_phone", {
80
- enumerable: true,
81
- configurable: true,
82
- writable: true,
83
- value: void 0
84
- });
85
- /** User's account number */
86
- Object.defineProperty(this, "_accountNo", {
87
- enumerable: true,
88
- configurable: true,
89
- writable: true,
90
- value: void 0
91
- });
92
- /** User's email address */
93
- Object.defineProperty(this, "_email", {
94
- enumerable: true,
95
- configurable: true,
96
- writable: true,
97
- value: void 0
98
- });
99
- this._id = data.id;
100
- this._firstName = data.firstName;
101
- this._lastName = data.lastName;
102
- this._displayName = data.displayName;
103
- this._phone = data.phone;
104
- this._accountNo = data.accountNo;
105
- this._email = data.email;
106
- }
107
- /**
108
- * Creates a new Profile instance with the provided data.
109
- *
110
- * @param data - Object containing profile information.
111
- */
112
- static create(data) {
113
- let phoneObj = undefined;
114
- if (data.phone !== undefined && data.phone !== null) {
115
- let phoneString = data.phone ?? "";
116
- if (!phoneString.startsWith("+"))
117
- phoneString = "+" + phoneString;
118
- phoneObj = frontend_core_1.PhoneNumber.from(phoneString);
119
- if (!phoneObj) {
120
- console.error("Failed to parse phone number:", data.phone);
121
- return undefined;
122
- }
123
- }
124
- else {
125
- phoneObj = data.phone; // Preserve null or undefined
126
- }
127
- return new Profile({
128
- id: data.id,
129
- firstName: data.firstName,
130
- lastName: data.lastName,
131
- displayName: data.displayName,
132
- phone: phoneObj,
133
- accountNo: data.accountNo,
134
- email: data.email,
135
- });
136
- }
137
- /**
138
- * Gets the profile's unique identifier.
139
- */
140
- get id() {
141
- return this._id;
142
- }
143
- /**
144
- * Gets the user's first name.
145
- */
146
- get firstName() {
147
- return this._firstName;
148
- }
149
- /**
150
- * Gets the user's last name.
151
- */
152
- get lastName() {
153
- return this._lastName;
154
- }
155
- /**
156
- * Gets the user's display name.
157
- */
158
- get displayName() {
159
- return this._displayName;
160
- }
161
- /**
162
- * Gets the user's phone number object.
163
- */
164
- get phone() {
165
- return this._phone;
166
- }
167
- /**
168
- * Gets the user's account number.
169
- */
170
- get accountNo() {
171
- return this._accountNo;
172
- }
173
- /**
174
- * Gets the user's email address.
175
- */
176
- get email() {
177
- return this._email;
178
- }
179
- /**
180
- * Gets the user's formatted phone number in international format.
181
- */
182
- get formattedPhone() {
183
- if (this._phone === undefined) {
184
- return undefined;
185
- }
186
- return this._phone?.label ?? null;
187
- }
188
- /**
189
- * Gets the user's name for display purposes.
190
- * Returns the display name if it exists, otherwise returns the first and last name combined.
191
- */
192
- getName() {
193
- if (this._displayName && this._displayName.trim() !== "") {
194
- return this._displayName;
195
- }
196
- const firstName = this._firstName ?? "";
197
- const lastName = this._lastName ?? "";
198
- return `${firstName} ${lastName}`.trim();
199
- }
200
- /**
201
- * Creates a plain object representation of the profile for validation or serialization.
202
- *
203
- * @returns A plain object matching the ProfileType interface
204
- */
205
- toObject() {
206
- // Handle the phone specially to ensure we preserve undefined vs null
207
- let phoneString = undefined;
208
- if (this._phone !== undefined) {
209
- phoneString = this._phone?.label ?? null;
210
- }
211
- return {
212
- id: this._id,
213
- firstName: this._firstName,
214
- lastName: this._lastName,
215
- displayName: this._displayName,
216
- phone: phoneString,
217
- accountNo: this._accountNo,
218
- email: this._email,
219
- };
220
- }
221
- /**
222
- * Converts the profile to a JSON string.
223
- *
224
- * @returns A JSON string representation of the profile
225
- */
226
- toJSON() {
227
- return JSON.stringify(this.toObject());
228
- }
229
- /**
230
- * Validates the profile data against the Zod schema.
231
- *
232
- * @returns True if the profile is valid, false otherwise
233
- */
234
- validate() {
235
- try {
236
- const result = Profile.schema.safeParse(this.toObject());
237
- return result.success;
238
- }
239
- catch (error) {
240
- console.error("Profile validation error:", error);
241
- return false;
242
- }
243
- }
244
- /**
245
- * Creates a Profile instance from a JSON string.
246
- *
247
- * @param jsonString - JSON string containing profile data
248
- * @returns A new Profile instance, or undefined if parsing failed
249
- */
250
- static fromJSON(jsonString) {
251
- try {
252
- const data = JSON.parse(jsonString);
253
- return Profile.from(data);
254
- }
255
- catch (error) {
256
- console.error("Error parsing profile JSON:", error);
257
- return undefined;
258
- }
259
- }
260
- /**
261
- * Creates a Profile instance from a plain object.
262
- *
263
- * @param data - Object containing profile data
264
- * @returns A new Profile instance, or undefined if parsing failed
265
- */
266
- // deno-lint-ignore no-explicit-any
267
- static from(data) {
268
- try {
269
- if (!data) {
270
- console.error("Data is null or undefined");
271
- return undefined;
272
- }
273
- if (typeof data !== "object") {
274
- console.error("Data is not an object");
275
- return undefined;
276
- }
277
- if (!data.id || !data.accountNo || !data.displayName) {
278
- console.error("Missing required profile fields");
279
- return undefined;
280
- }
281
- return Profile.create({
282
- id: data.id,
283
- firstName: data.firstName,
284
- lastName: data.lastName,
285
- displayName: data.displayName,
286
- phone: data.phone,
287
- accountNo: data.accountNo,
288
- email: data.email,
289
- });
290
- }
291
- catch (error) {
292
- console.error("Error creating profile from object:", error);
293
- return undefined;
294
- }
295
- }
296
- /**
297
- * Type guard to check if an unknown object is a valid Profile instance.
298
- *
299
- * @param obj - The object to check
300
- * @returns Type predicate indicating if the object is a valid Profile
301
- */
302
- static is(obj) {
303
- if (!obj || typeof obj !== "object")
304
- return false;
305
- const maybeProfile = obj;
306
- // Check required properties
307
- if (typeof maybeProfile._id !== "string" ||
308
- typeof maybeProfile._displayName !== "string" ||
309
- typeof maybeProfile._accountNo !== "string") {
310
- return false;
311
- }
312
- // Check nullable/optional properties have the right type when present
313
- if (maybeProfile._firstName !== null &&
314
- maybeProfile._firstName !== undefined &&
315
- typeof maybeProfile._firstName !== "string") {
316
- return false;
317
- }
318
- if (maybeProfile._lastName !== null &&
319
- maybeProfile._lastName !== undefined &&
320
- typeof maybeProfile._lastName !== "string") {
321
- return false;
322
- }
323
- if (maybeProfile._email !== null &&
324
- maybeProfile._email !== undefined &&
325
- typeof maybeProfile._email !== "string") {
326
- return false;
327
- }
328
- // Check phone number
329
- const phone = maybeProfile._phone;
330
- if (phone !== null &&
331
- phone !== undefined &&
332
- !frontend_core_1.PhoneNumber.is(phone)) {
333
- return false;
334
- }
335
- return true;
336
- }
337
- }
338
- exports.Profile = Profile;
@@ -1,4 +0,0 @@
1
- export * from "./statement_entry.js";
2
- export * from "./wallet.js";
3
- export * from "./schemas.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/wallet/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./statement_entry.js"), exports);
18
- __exportStar(require("./wallet.js"), exports);
19
- __exportStar(require("./schemas.js"), exports);