@temboplus/afloat 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 (335) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +21 -0
  3. package/esm/_dnt.test_shims.d.ts.map +1 -0
  4. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  8. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  10. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  14. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  17. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  38. package/esm/mod.d.ts +7 -0
  39. package/esm/mod.d.ts.map +1 -0
  40. package/esm/mod.js +6 -0
  41. package/esm/package.json +3 -0
  42. package/esm/src/errors/api_error.d.ts +63 -0
  43. package/esm/src/errors/api_error.d.ts.map +1 -0
  44. package/esm/src/errors/api_error.js +90 -0
  45. package/esm/src/errors/index.d.ts +3 -0
  46. package/esm/src/errors/index.d.ts.map +1 -0
  47. package/esm/src/errors/index.js +2 -0
  48. package/esm/src/errors/permission_error.d.ts +48 -0
  49. package/esm/src/errors/permission_error.d.ts.map +1 -0
  50. package/esm/src/errors/permission_error.js +70 -0
  51. package/esm/src/features/auth/contract.d.ts +123 -0
  52. package/esm/src/features/auth/contract.d.ts.map +1 -0
  53. package/esm/src/features/auth/contract.js +50 -0
  54. package/esm/src/features/auth/index.d.ts +2 -0
  55. package/esm/src/features/auth/index.d.ts.map +1 -0
  56. package/esm/src/features/auth/index.js +1 -0
  57. package/esm/src/features/auth/manager.d.ts +71 -0
  58. package/esm/src/features/auth/manager.d.ts.map +1 -0
  59. package/esm/src/features/auth/manager.js +118 -0
  60. package/esm/src/features/auth/repository.d.ts +30 -0
  61. package/esm/src/features/auth/repository.d.ts.map +1 -0
  62. package/esm/src/features/auth/repository.js +94 -0
  63. package/esm/src/features/contact/contract.d.ts +170 -0
  64. package/esm/src/features/contact/contract.d.ts.map +1 -0
  65. package/esm/src/features/contact/contract.js +49 -0
  66. package/esm/src/features/contact/index.d.ts +2 -0
  67. package/esm/src/features/contact/index.d.ts.map +1 -0
  68. package/esm/src/features/contact/index.js +1 -0
  69. package/esm/src/features/contact/repository.d.ts +47 -0
  70. package/esm/src/features/contact/repository.d.ts.map +1 -0
  71. package/esm/src/features/contact/repository.js +94 -0
  72. package/esm/src/features/files-gen/contract.d.ts +67 -0
  73. package/esm/src/features/files-gen/contract.d.ts.map +1 -0
  74. package/esm/src/features/files-gen/contract.js +40 -0
  75. package/esm/src/features/files-gen/repository.d.ts +47 -0
  76. package/esm/src/features/files-gen/repository.d.ts.map +1 -0
  77. package/esm/src/features/files-gen/repository.js +48 -0
  78. package/esm/src/features/payout/contract.d.ts +623 -0
  79. package/esm/src/features/payout/contract.d.ts.map +1 -0
  80. package/esm/src/features/payout/contract.js +75 -0
  81. package/esm/src/features/payout/index.d.ts +2 -0
  82. package/esm/src/features/payout/index.d.ts.map +1 -0
  83. package/esm/src/features/payout/index.js +1 -0
  84. package/esm/src/features/payout/repository.d.ts +62 -0
  85. package/esm/src/features/payout/repository.d.ts.map +1 -0
  86. package/esm/src/features/payout/repository.js +158 -0
  87. package/esm/src/features/wallet/contract.d.ts +103 -0
  88. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  89. package/esm/src/features/wallet/contract.js +35 -0
  90. package/esm/src/features/wallet/index.d.ts +2 -0
  91. package/esm/src/features/wallet/index.d.ts.map +1 -0
  92. package/esm/src/features/wallet/index.js +1 -0
  93. package/esm/src/features/wallet/repository.d.ts +74 -0
  94. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  95. package/esm/src/features/wallet/repository.js +132 -0
  96. package/esm/src/models/contact/derivatives/contact.d.ts +168 -0
  97. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  98. package/esm/src/models/contact/derivatives/contact.js +260 -0
  99. package/esm/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  100. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  101. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  103. package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  104. package/esm/src/models/contact/index.d.ts +5 -0
  105. package/esm/src/models/contact/index.d.ts.map +1 -0
  106. package/esm/src/models/contact/index.js +4 -0
  107. package/esm/src/models/contact/schemas.d.ts +66 -0
  108. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  109. package/esm/src/models/contact/schemas.js +64 -0
  110. package/esm/src/models/contact/validation.d.ts +37 -0
  111. package/esm/src/models/contact/validation.d.ts.map +1 -0
  112. package/esm/src/models/contact/validation.js +139 -0
  113. package/esm/src/models/contact/validation.test.d.ts.map +1 -0
  114. package/esm/src/models/index.d.ts +6 -0
  115. package/esm/src/models/index.d.ts.map +1 -0
  116. package/esm/src/models/index.js +5 -0
  117. package/esm/src/models/payout/api.d.ts +29 -0
  118. package/esm/src/models/payout/api.d.ts.map +1 -0
  119. package/esm/src/models/payout/api.js +1 -0
  120. package/esm/src/models/payout/channel.d.ts +58 -0
  121. package/esm/src/models/payout/channel.d.ts.map +1 -0
  122. package/esm/src/models/payout/channel.js +46 -0
  123. package/esm/src/models/payout/derivatives/payout.d.ts +156 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  125. package/esm/src/models/payout/derivatives/payout.js +261 -0
  126. package/esm/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  127. package/esm/src/models/payout/index.d.ts +6 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +5 -0
  130. package/esm/src/models/payout/schemas.d.ts +154 -0
  131. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  132. package/esm/src/models/payout/schemas.js +103 -0
  133. package/esm/src/models/payout/status.d.ts +31 -0
  134. package/esm/src/models/payout/status.d.ts.map +1 -0
  135. package/esm/src/models/payout/status.js +32 -0
  136. package/esm/src/models/permission.d.ts +42 -0
  137. package/esm/src/models/permission.d.ts.map +1 -0
  138. package/esm/src/models/permission.js +37 -0
  139. package/esm/src/models/user/index.d.ts +3 -0
  140. package/esm/src/models/user/index.d.ts.map +1 -0
  141. package/esm/src/models/user/index.js +2 -0
  142. package/esm/src/models/user/profile.d.ts +38 -0
  143. package/esm/src/models/user/profile.d.ts.map +1 -0
  144. package/esm/src/models/user/profile.js +25 -0
  145. package/esm/src/models/user/user.d.ts +80 -0
  146. package/esm/src/models/user/user.d.ts.map +1 -0
  147. package/esm/src/models/user/user.js +149 -0
  148. package/esm/src/models/wallet/guards.d.ts +11 -0
  149. package/esm/src/models/wallet/guards.d.ts.map +1 -0
  150. package/esm/src/models/wallet/guards.js +14 -0
  151. package/esm/src/models/wallet/index.d.ts +4 -0
  152. package/esm/src/models/wallet/index.d.ts.map +1 -0
  153. package/esm/src/models/wallet/index.js +3 -0
  154. package/esm/src/models/wallet/schemas.d.ts +50 -0
  155. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  156. package/esm/src/models/wallet/schemas.js +64 -0
  157. package/esm/src/models/wallet/statement.d.ts +27 -0
  158. package/esm/src/models/wallet/statement.d.ts.map +1 -0
  159. package/esm/src/models/wallet/statement.js +13 -0
  160. package/esm/src/shared/base_repository.d.ts +56 -0
  161. package/esm/src/shared/base_repository.d.ts.map +1 -0
  162. package/esm/src/shared/base_repository.js +95 -0
  163. package/esm/src/shared/common_responses.d.ts +13 -0
  164. package/esm/src/shared/common_responses.d.ts.map +1 -0
  165. package/esm/src/shared/common_responses.js +10 -0
  166. package/esm/src/shared/index.d.ts +3 -0
  167. package/esm/src/shared/index.d.ts.map +1 -0
  168. package/esm/src/shared/index.js +2 -0
  169. package/package.json +40 -0
  170. package/script/_dnt.test_shims.d.ts.map +1 -0
  171. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  172. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  173. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  174. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  175. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  176. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  177. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  179. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  180. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  181. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  182. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  183. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  184. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  185. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  187. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  188. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  189. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  191. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  192. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  193. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  194. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  195. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  196. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  197. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  199. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  200. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  201. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  203. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  204. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  205. package/script/mod.d.ts +7 -0
  206. package/script/mod.d.ts.map +1 -0
  207. package/script/mod.js +22 -0
  208. package/script/package.json +3 -0
  209. package/script/src/errors/api_error.d.ts +63 -0
  210. package/script/src/errors/api_error.d.ts.map +1 -0
  211. package/script/src/errors/api_error.js +94 -0
  212. package/script/src/errors/index.d.ts +3 -0
  213. package/script/src/errors/index.d.ts.map +1 -0
  214. package/script/src/errors/index.js +18 -0
  215. package/script/src/errors/permission_error.d.ts +48 -0
  216. package/script/src/errors/permission_error.d.ts.map +1 -0
  217. package/script/src/errors/permission_error.js +74 -0
  218. package/script/src/features/auth/contract.d.ts +123 -0
  219. package/script/src/features/auth/contract.d.ts.map +1 -0
  220. package/script/src/features/auth/contract.js +53 -0
  221. package/script/src/features/auth/index.d.ts +2 -0
  222. package/script/src/features/auth/index.d.ts.map +1 -0
  223. package/script/src/features/auth/index.js +17 -0
  224. package/script/src/features/auth/manager.d.ts +71 -0
  225. package/script/src/features/auth/manager.d.ts.map +1 -0
  226. package/script/src/features/auth/manager.js +122 -0
  227. package/script/src/features/auth/repository.d.ts +30 -0
  228. package/script/src/features/auth/repository.d.ts.map +1 -0
  229. package/script/src/features/auth/repository.js +98 -0
  230. package/script/src/features/contact/contract.d.ts +170 -0
  231. package/script/src/features/contact/contract.d.ts.map +1 -0
  232. package/script/src/features/contact/contract.js +52 -0
  233. package/script/src/features/contact/index.d.ts +2 -0
  234. package/script/src/features/contact/index.d.ts.map +1 -0
  235. package/script/src/features/contact/index.js +17 -0
  236. package/script/src/features/contact/repository.d.ts +47 -0
  237. package/script/src/features/contact/repository.d.ts.map +1 -0
  238. package/script/src/features/contact/repository.js +98 -0
  239. package/script/src/features/files-gen/contract.d.ts +67 -0
  240. package/script/src/features/files-gen/contract.d.ts.map +1 -0
  241. package/script/src/features/files-gen/contract.js +43 -0
  242. package/script/src/features/files-gen/repository.d.ts +47 -0
  243. package/script/src/features/files-gen/repository.d.ts.map +1 -0
  244. package/script/src/features/files-gen/repository.js +52 -0
  245. package/script/src/features/payout/contract.d.ts +623 -0
  246. package/script/src/features/payout/contract.d.ts.map +1 -0
  247. package/script/src/features/payout/contract.js +78 -0
  248. package/script/src/features/payout/index.d.ts +2 -0
  249. package/script/src/features/payout/index.d.ts.map +1 -0
  250. package/script/src/features/payout/index.js +17 -0
  251. package/script/src/features/payout/repository.d.ts +62 -0
  252. package/script/src/features/payout/repository.d.ts.map +1 -0
  253. package/script/src/features/payout/repository.js +162 -0
  254. package/script/src/features/wallet/contract.d.ts +103 -0
  255. package/script/src/features/wallet/contract.d.ts.map +1 -0
  256. package/script/src/features/wallet/contract.js +38 -0
  257. package/script/src/features/wallet/index.d.ts +2 -0
  258. package/script/src/features/wallet/index.d.ts.map +1 -0
  259. package/script/src/features/wallet/index.js +17 -0
  260. package/script/src/features/wallet/repository.d.ts +74 -0
  261. package/script/src/features/wallet/repository.d.ts.map +1 -0
  262. package/script/src/features/wallet/repository.js +136 -0
  263. package/script/src/models/contact/derivatives/contact.d.ts +168 -0
  264. package/script/src/models/contact/derivatives/contact.d.ts.map +1 -0
  265. package/script/src/models/contact/derivatives/contact.js +264 -0
  266. package/script/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  267. package/script/src/models/contact/derivatives/contact_info.d.ts +188 -0
  268. package/script/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  269. package/script/src/models/contact/derivatives/contact_info.js +260 -0
  270. package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  271. package/script/src/models/contact/index.d.ts +5 -0
  272. package/script/src/models/contact/index.d.ts.map +1 -0
  273. package/script/src/models/contact/index.js +20 -0
  274. package/script/src/models/contact/schemas.d.ts +66 -0
  275. package/script/src/models/contact/schemas.d.ts.map +1 -0
  276. package/script/src/models/contact/schemas.js +67 -0
  277. package/script/src/models/contact/validation.d.ts +37 -0
  278. package/script/src/models/contact/validation.d.ts.map +1 -0
  279. package/script/src/models/contact/validation.js +146 -0
  280. package/script/src/models/contact/validation.test.d.ts.map +1 -0
  281. package/script/src/models/index.d.ts +6 -0
  282. package/script/src/models/index.d.ts.map +1 -0
  283. package/script/src/models/index.js +21 -0
  284. package/script/src/models/payout/api.d.ts +29 -0
  285. package/script/src/models/payout/api.d.ts.map +1 -0
  286. package/script/src/models/payout/api.js +2 -0
  287. package/script/src/models/payout/channel.d.ts +58 -0
  288. package/script/src/models/payout/channel.d.ts.map +1 -0
  289. package/script/src/models/payout/channel.js +49 -0
  290. package/script/src/models/payout/derivatives/payout.d.ts +156 -0
  291. package/script/src/models/payout/derivatives/payout.d.ts.map +1 -0
  292. package/script/src/models/payout/derivatives/payout.js +265 -0
  293. package/script/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  294. package/script/src/models/payout/index.d.ts +6 -0
  295. package/script/src/models/payout/index.d.ts.map +1 -0
  296. package/script/src/models/payout/index.js +21 -0
  297. package/script/src/models/payout/schemas.d.ts +154 -0
  298. package/script/src/models/payout/schemas.d.ts.map +1 -0
  299. package/script/src/models/payout/schemas.js +106 -0
  300. package/script/src/models/payout/status.d.ts +31 -0
  301. package/script/src/models/payout/status.d.ts.map +1 -0
  302. package/script/src/models/payout/status.js +35 -0
  303. package/script/src/models/permission.d.ts +42 -0
  304. package/script/src/models/permission.d.ts.map +1 -0
  305. package/script/src/models/permission.js +40 -0
  306. package/script/src/models/user/index.d.ts +3 -0
  307. package/script/src/models/user/index.d.ts.map +1 -0
  308. package/script/src/models/user/index.js +18 -0
  309. package/script/src/models/user/profile.d.ts +38 -0
  310. package/script/src/models/user/profile.d.ts.map +1 -0
  311. package/script/src/models/user/profile.js +28 -0
  312. package/script/src/models/user/user.d.ts +80 -0
  313. package/script/src/models/user/user.d.ts.map +1 -0
  314. package/script/src/models/user/user.js +153 -0
  315. package/script/src/models/wallet/guards.d.ts +11 -0
  316. package/script/src/models/wallet/guards.d.ts.map +1 -0
  317. package/script/src/models/wallet/guards.js +17 -0
  318. package/script/src/models/wallet/index.d.ts +4 -0
  319. package/script/src/models/wallet/index.d.ts.map +1 -0
  320. package/script/src/models/wallet/index.js +19 -0
  321. package/script/src/models/wallet/schemas.d.ts +50 -0
  322. package/script/src/models/wallet/schemas.d.ts.map +1 -0
  323. package/script/src/models/wallet/schemas.js +67 -0
  324. package/script/src/models/wallet/statement.d.ts +27 -0
  325. package/script/src/models/wallet/statement.d.ts.map +1 -0
  326. package/script/src/models/wallet/statement.js +16 -0
  327. package/script/src/shared/base_repository.d.ts +56 -0
  328. package/script/src/shared/base_repository.d.ts.map +1 -0
  329. package/script/src/shared/base_repository.js +99 -0
  330. package/script/src/shared/common_responses.d.ts +13 -0
  331. package/script/src/shared/common_responses.d.ts.map +1 -0
  332. package/script/src/shared/common_responses.js +13 -0
  333. package/script/src/shared/index.d.ts +3 -0
  334. package/script/src/shared/index.d.ts.map +1 -0
  335. package/script/src/shared/index.js +18 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,GAC1D,OAAO,WAAW,CAAC,QAAQ,CAAC,MAAM,OAAO,WAAW,CAAC,QAAQ,CAAC,GAC9D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Permissions = void 0;
4
+ /**
5
+ * All Afloat Permissions
6
+ */
7
+ exports.Permissions = {
8
+ Profile: {
9
+ ViewCurrent: "profile.getCurrent",
10
+ Update: "profile.update",
11
+ },
12
+ Contact: {
13
+ View: "contact.findById",
14
+ List: "contact.findAll",
15
+ Create: "contact.create",
16
+ Update: "contact.update",
17
+ Delete: "contact.delete",
18
+ },
19
+ Payment: {
20
+ View: "payment.findById",
21
+ List: "payment.findAll",
22
+ Create: "payment.create",
23
+ },
24
+ Payout: {
25
+ View: "payout.findById",
26
+ List: "payout.findAll",
27
+ Create: "payout.create",
28
+ Approve: "payout.approve",
29
+ },
30
+ Transfer: {
31
+ View: "transfer.findById",
32
+ List: "transfer.findAll",
33
+ Create: "transfer.create",
34
+ Approve: "transfer.approve",
35
+ },
36
+ Wallet: {
37
+ ViewBalance: "wallet.getBalance",
38
+ ViewStatement: "wallet.getStatement",
39
+ },
40
+ }; // Make it deeply readonly
@@ -0,0 +1,3 @@
1
+ export * from "./profile.js";
2
+ export * from "./user.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,18 @@
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("./profile.js"), exports);
18
+ __exportStar(require("./user.js"), exports);
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Type definition for profile schema using Zod.
4
+ * This type helper ensures type safety when implementing the actual schema.
5
+ */
6
+ type ProfileType = z.ZodObject<{
7
+ id: z.ZodString;
8
+ firstName: z.ZodString;
9
+ lastName: z.ZodString;
10
+ displayName: z.ZodString;
11
+ phone: z.ZodString;
12
+ accountNo: z.ZodString;
13
+ email: z.ZodString;
14
+ }>;
15
+ /**
16
+ * Zod schema for validating user profile data.
17
+ * Defines validation rules and constraints for each profile field.
18
+ *
19
+ * @const {ProfileType}
20
+ *
21
+ * @property {string} id - Unique identifier for the profile
22
+ * @property {string} firstName - User's first name
23
+ * @property {string} lastName - User's last name
24
+ * @property {string} displayName - User's display name
25
+ * @property {string} phone - User's contact phone number
26
+ * @property {string} accountNo - User's account number
27
+ * @property {string} email - User's email address
28
+ */
29
+ export declare const profileSchema: ProfileType;
30
+ /**
31
+ * TypeScript type representing a validated user profile.
32
+ * Use this type for profile instances that have been validated against the schema.
33
+ *
34
+ * @see {@link profileSchema} for validation rules
35
+ */
36
+ export type Profile = z.infer<typeof profileSchema>;
37
+ export {};
38
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,CAAC,SAAS,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC;IAChB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC;IACtB,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC;IACnB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC;CACpB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,EAAE,WAS1B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.profileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Zod schema for validating user profile data.
7
+ * Defines validation rules and constraints for each profile field.
8
+ *
9
+ * @const {ProfileType}
10
+ *
11
+ * @property {string} id - Unique identifier for the profile
12
+ * @property {string} firstName - User's first name
13
+ * @property {string} lastName - User's last name
14
+ * @property {string} displayName - User's display name
15
+ * @property {string} phone - User's contact phone number
16
+ * @property {string} accountNo - User's account number
17
+ * @property {string} email - User's email address
18
+ */
19
+ exports.profileSchema = zod_1.z.object({
20
+ id: zod_1.z.string().uuid("Invalid profile ID format"),
21
+ firstName: zod_1.z.string().min(1, "First name is required"),
22
+ lastName: zod_1.z.string().min(1, "Last name is required"),
23
+ displayName: zod_1.z.string().min(1, "Display name is required"),
24
+ phone: zod_1.z.string().min(1, "Phone number is required")
25
+ .regex(/^\+?[\d\s-]+$/, "Invalid phone number format"),
26
+ accountNo: zod_1.z.string().min(1, "Account number is required"),
27
+ email: zod_1.z.string().email("Invalid email format"),
28
+ });
@@ -0,0 +1,80 @@
1
+ import type { Profile } from "./profile.js";
2
+ /**
3
+ * Represents a user in Afloat
4
+ *
5
+ * This class centralizes user-related logic, simplifying interaction
6
+ * with user-related data and ensuring consistent permission checks across the application.
7
+ */
8
+ export declare class User {
9
+ /**
10
+ * Logged-in user name
11
+ */
12
+ name: string;
13
+ /**
14
+ * Logged-in identity: phone-number or email address
15
+ */
16
+ identity: string;
17
+ /**
18
+ * The user's Afloat profile, containing personal information such as name, contact details, and account information.
19
+ */
20
+ profile: Profile;
21
+ /**
22
+ * The user's authentication token. This token must be passed in the request headers
23
+ * for all authenticated API endpoints.
24
+ */
25
+ token: string;
26
+ /**
27
+ * Indicates whether the user is required to change their default password.
28
+ *
29
+ * Afloat users are initially provided with a default username and password. After the first
30
+ * successful login, `resetPassword` will be set to `true` to prompt the user to set a new password.
31
+ */
32
+ resetPassword: boolean;
33
+ /**
34
+ * A map of permission keys to boolean values, indicating whether the user has access
35
+ * to specific actions or features in the system.
36
+ */
37
+ private permissionsMap;
38
+ /**
39
+ * Creates a new instance of the `User` class.
40
+ *
41
+ * @param userData - An object of type `CoreUser` containing the user's profile, token,
42
+ * permissions (access list), and the `resetPassword` flag.
43
+ */
44
+ constructor(data: {
45
+ profile: Profile;
46
+ token: string;
47
+ access: string[];
48
+ resetPassword: boolean;
49
+ loginCredentials: {
50
+ name: string;
51
+ identity: string;
52
+ };
53
+ });
54
+ /**
55
+ * Checks if the user has a specific permission.
56
+ *
57
+ * @param permission - The permission key to check.
58
+ * @returns `true` if the user has the specified permission, otherwise `false`.
59
+ */
60
+ can(permission: string): boolean;
61
+ /**
62
+ * Serializes the `User` instance to a JSON string.
63
+ *
64
+ * @returns A JSON string representation of the `User` instance, including:
65
+ * - `profile`: The user's profile information.
66
+ * - `token`: The user's authentication token.
67
+ * - `resetPassword`: Indicates whether the user must reset their password.
68
+ * - `permissions`: An array of permission keys the user has.
69
+ */
70
+ toJSON(): string;
71
+ /**
72
+ * Creates a new `User` instance from a JSON string.
73
+ *
74
+ * @param jsonString - A JSON string containing user data.
75
+ * @returns A `User` instance reconstructed from the JSON data.
76
+ * @throws Will throw an error if the JSON data is invalid or incomplete.
77
+ */
78
+ static fromJSON(jsonString: string): User;
79
+ }
80
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/user.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,IAAI;IACf;;OAEG;IACI,IAAI,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACI,QAAQ,EAAE,MAAM,CAAC;IAExB;;OAEG;IACI,OAAO,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACI,aAAa,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,OAAO,CAAC,cAAc,CAA0B;IAEhD;;;;;OAKG;gBACS,IAAI,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;QACvB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;KACH;IAqBD;;;;;OAKG;IACI,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;;;;OAQG;IACI,MAAM,IAAI,MAAM;IAavB;;;;;;OAMG;WACW,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CA4BjD"}
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.User = void 0;
4
+ const permission_js_1 = require("../permission.js");
5
+ /**
6
+ * Represents a user in Afloat
7
+ *
8
+ * This class centralizes user-related logic, simplifying interaction
9
+ * with user-related data and ensuring consistent permission checks across the application.
10
+ */
11
+ class User {
12
+ /**
13
+ * Creates a new instance of the `User` class.
14
+ *
15
+ * @param userData - An object of type `CoreUser` containing the user's profile, token,
16
+ * permissions (access list), and the `resetPassword` flag.
17
+ */
18
+ constructor(data) {
19
+ /**
20
+ * Logged-in user name
21
+ */
22
+ Object.defineProperty(this, "name", {
23
+ enumerable: true,
24
+ configurable: true,
25
+ writable: true,
26
+ value: void 0
27
+ });
28
+ /**
29
+ * Logged-in identity: phone-number or email address
30
+ */
31
+ Object.defineProperty(this, "identity", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ /**
38
+ * The user's Afloat profile, containing personal information such as name, contact details, and account information.
39
+ */
40
+ Object.defineProperty(this, "profile", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
46
+ /**
47
+ * The user's authentication token. This token must be passed in the request headers
48
+ * for all authenticated API endpoints.
49
+ */
50
+ Object.defineProperty(this, "token", {
51
+ enumerable: true,
52
+ configurable: true,
53
+ writable: true,
54
+ value: void 0
55
+ });
56
+ /**
57
+ * Indicates whether the user is required to change their default password.
58
+ *
59
+ * Afloat users are initially provided with a default username and password. After the first
60
+ * successful login, `resetPassword` will be set to `true` to prompt the user to set a new password.
61
+ */
62
+ Object.defineProperty(this, "resetPassword", {
63
+ enumerable: true,
64
+ configurable: true,
65
+ writable: true,
66
+ value: void 0
67
+ });
68
+ /**
69
+ * A map of permission keys to boolean values, indicating whether the user has access
70
+ * to specific actions or features in the system.
71
+ */
72
+ Object.defineProperty(this, "permissionsMap", {
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true,
76
+ value: void 0
77
+ });
78
+ const { profile, token, access, resetPassword } = data;
79
+ this.profile = profile;
80
+ this.token = token;
81
+ this.resetPassword = resetPassword;
82
+ this.name = data.loginCredentials.name;
83
+ this.identity = data.loginCredentials.identity;
84
+ // Initialize the permissions map
85
+ this.permissionsMap = {};
86
+ for (const permission of Object.values(permission_js_1.Permissions)) {
87
+ if (typeof permission === "object") {
88
+ Object.values(permission).forEach((perm) => {
89
+ this.permissionsMap[perm] = access.includes(perm);
90
+ });
91
+ }
92
+ }
93
+ }
94
+ /**
95
+ * Checks if the user has a specific permission.
96
+ *
97
+ * @param permission - The permission key to check.
98
+ * @returns `true` if the user has the specified permission, otherwise `false`.
99
+ */
100
+ can(permission) {
101
+ return this.permissionsMap[permission] ?? false;
102
+ }
103
+ /**
104
+ * Serializes the `User` instance to a JSON string.
105
+ *
106
+ * @returns A JSON string representation of the `User` instance, including:
107
+ * - `profile`: The user's profile information.
108
+ * - `token`: The user's authentication token.
109
+ * - `resetPassword`: Indicates whether the user must reset their password.
110
+ * - `permissions`: An array of permission keys the user has.
111
+ */
112
+ toJSON() {
113
+ return JSON.stringify({
114
+ profile: this.profile,
115
+ token: this.token,
116
+ resetPassword: this.resetPassword,
117
+ name: this.name,
118
+ identity: this.identity,
119
+ permissions: Object.keys(this.permissionsMap).filter((key) => this.permissionsMap[key]),
120
+ });
121
+ }
122
+ /**
123
+ * Creates a new `User` instance from a JSON string.
124
+ *
125
+ * @param jsonString - A JSON string containing user data.
126
+ * @returns A `User` instance reconstructed from the JSON data.
127
+ * @throws Will throw an error if the JSON data is invalid or incomplete.
128
+ */
129
+ static fromJSON(jsonString) {
130
+ const data = JSON.parse(jsonString);
131
+ if (!data.profile ||
132
+ !data.token ||
133
+ !data.name ||
134
+ !data.identity ||
135
+ !Array.isArray(data.permissions) ||
136
+ typeof data.resetPassword !== "boolean") {
137
+ throw new Error("Invalid JSON data for User");
138
+ }
139
+ // Reconstruct the CoreUser structure
140
+ const args = {
141
+ profile: data.profile,
142
+ token: data.token,
143
+ access: data.permissions,
144
+ resetPassword: data.resetPassword,
145
+ loginCredentials: {
146
+ name: data.name,
147
+ identity: data.identity,
148
+ },
149
+ };
150
+ return new User(args);
151
+ }
152
+ }
153
+ exports.User = User;
@@ -0,0 +1,11 @@
1
+ import { type WalletStatementItem } from "./schemas.js";
2
+ /**
3
+ * Type guard function that checks if the provided data is an array of valid wallet statement items.
4
+ * Uses Zod schema validation to ensure each item in the array matches the WalletStatementItem schema.
5
+ *
6
+ * @param {unknown} data - The data to be type checked. Can be any value.
7
+ * @returns {boolean} Returns true if the data is an array of valid WalletStatementItem objects,
8
+ * false otherwise
9
+ */
10
+ export declare function isWalletStatementItemArray(data: unknown): data is WalletStatementItem[];
11
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../../src/src/models/wallet/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,mBAAmB,EAAE,CAG/B"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isWalletStatementItemArray = isWalletStatementItemArray;
4
+ const zod_1 = require("zod");
5
+ const schemas_js_1 = require("./schemas.js");
6
+ /**
7
+ * Type guard function that checks if the provided data is an array of valid wallet statement items.
8
+ * Uses Zod schema validation to ensure each item in the array matches the WalletStatementItem schema.
9
+ *
10
+ * @param {unknown} data - The data to be type checked. Can be any value.
11
+ * @returns {boolean} Returns true if the data is an array of valid WalletStatementItem objects,
12
+ * false otherwise
13
+ */
14
+ function isWalletStatementItemArray(data) {
15
+ const result = zod_1.z.array(schemas_js_1.WalletSchemas.statementEntry).safeParse(data);
16
+ return result.success;
17
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./guards.js";
2
+ export * from "./schemas.js";
3
+ export * from "./statement.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/models/wallet/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,19 @@
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("./guards.js"), exports);
18
+ __exportStar(require("./schemas.js"), exports);
19
+ __exportStar(require("./statement.js"), exports);
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Type definition for statement entry schema using Zod.
4
+ * This is used as a TypeScript type helper for the actual schema implementation.
5
+ */
6
+ type _StatementEntryType = z.ZodObject<{
7
+ accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>>;
8
+ cbaRefNo: z.ZodEffects<z.ZodOptional<z.ZodString>>;
9
+ debitOrCredit: z.ZodString;
10
+ tranRefNo: z.ZodString;
11
+ narration: z.ZodString;
12
+ txnDate: z.ZodDate;
13
+ valueDate: z.ZodDate;
14
+ amountCredited: z.ZodNumber;
15
+ amountDebited: z.ZodNumber;
16
+ balance: z.ZodNumber;
17
+ }>;
18
+ /**
19
+ * Type definition for wallet schema using Zod.
20
+ * This is used as a TypeScript type helper for the actual schema implementation.
21
+ */
22
+ type _WalletType = z.ZodObject<{
23
+ id: z.ZodString;
24
+ profileId: z.ZodString;
25
+ accountNo: z.ZodString;
26
+ accountName: z.ZodString;
27
+ channel: z.ZodString;
28
+ createdAt: z.ZodString;
29
+ updatedAt: z.ZodString;
30
+ }>;
31
+ /**
32
+ * Collection of wallet-related schemas for export.
33
+ * Provides access to both wallet and statement entry validation schemas.
34
+ */
35
+ export declare const WalletSchemas: {
36
+ wallet: _WalletType;
37
+ statementEntry: _StatementEntryType;
38
+ };
39
+ /**
40
+ * TypeScript type for a validated wallet object.
41
+ * Use this type for wallet instances that have been validated against the schema.
42
+ */
43
+ export type Wallet = z.infer<typeof WalletSchemas.wallet>;
44
+ /**
45
+ * TypeScript type for a validated statement entry object.
46
+ * Use this type for statement entries that have been validated against the schema.
47
+ */
48
+ export type WalletStatementItem = z.infer<typeof WalletSchemas.statementEntry>;
49
+ export {};
50
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/src/models/wallet/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;GAGG;AACH,KAAK,mBAAmB,GAAG,CAAC,CAAC,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;IACnB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC;IAC5B,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;CACtB,CAAC,CAAC;AA8BH;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,CAAC,SAAS,CAAC;IAC7B,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC;IAChB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;CACxB,CAAC,CAAC;AAwBH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletSchemas = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Helper function to make a field optional with undefined
7
+ * Transforms null values to undefined for consistency
8
+ * @param schema - The Zod schema to make optional
9
+ * @returns A schema that only allows string or undefined (no null)
10
+ */
11
+ const makeOptional = (schema) => schema.optional().transform((val) => val ?? undefined);
12
+ /**
13
+ * Schema definition for a statement entry.
14
+ * Represents a single transaction in a wallet's statement history.
15
+ *
16
+ * @property {string} accountNo - The account number associated with the transaction (optional)
17
+ * @property {string} cbaRefNo - Core banking system reference number (optional)
18
+ * @property {string} debitOrCredit - Indicator if transaction is debit or credit
19
+ * @property {string} tranRefNo - Transaction reference number
20
+ * @property {string} narration - Description of the transaction
21
+ * @property {Date} txnDate - Date when transaction was initiated
22
+ * @property {Date} valueDate - Date when transaction value was applied
23
+ * @property {number} amountCredited - Amount credited in transaction (if credit)
24
+ * @property {number} amountDebited - Amount debited in transaction (if debit)
25
+ * @property {number} balance - Running balance after transaction
26
+ */
27
+ const statementEntrySchema = zod_1.z.object({
28
+ accountNo: makeOptional(zod_1.z.string()),
29
+ cbaRefNo: makeOptional(zod_1.z.string()),
30
+ debitOrCredit: zod_1.z.string().min(1, "Transaction type is required"),
31
+ tranRefNo: zod_1.z.string().min(1, "Transaction reference is required"),
32
+ narration: zod_1.z.string().min(1, "Transaction description is required"),
33
+ txnDate: zod_1.z.coerce.date(),
34
+ valueDate: zod_1.z.coerce.date(),
35
+ amountCredited: zod_1.z.number().min(0, "Credited amount must be non-negative"),
36
+ amountDebited: zod_1.z.number().min(0, "Debited amount must be non-negative"),
37
+ balance: zod_1.z.number(),
38
+ });
39
+ /**
40
+ * Schema definition for a wallet.
41
+ * Represents a digital wallet that can hold funds and process transactions.
42
+ *
43
+ * @property {string} id - Unique identifier for the wallet
44
+ * @property {string} profileId - ID of the profile that owns this wallet
45
+ * @property {string} accountNo - Account number associated with the wallet
46
+ * @property {string} accountName - Name of the account holder
47
+ * @property {string} channel - Payment channel or provider (e.g., "MPESA", "BANK")
48
+ * @property {string} createdAt - ISO datetime string of wallet creation
49
+ * @property {string} updatedAt - ISO datetime string of last wallet update
50
+ */
51
+ const walletSchema = zod_1.z.object({
52
+ id: zod_1.z.string().uuid("Invalid wallet ID format"),
53
+ profileId: zod_1.z.string().min(1, "Profile ID is required"),
54
+ accountNo: zod_1.z.string().min(1, "Account number is required"),
55
+ accountName: zod_1.z.string().min(1, "Account name is required"),
56
+ channel: zod_1.z.string().min(1, "Channel is required"),
57
+ createdAt: zod_1.z.string().datetime("Invalid creation timestamp"),
58
+ updatedAt: zod_1.z.string().datetime("Invalid update timestamp"),
59
+ });
60
+ /**
61
+ * Collection of wallet-related schemas for export.
62
+ * Provides access to both wallet and statement entry validation schemas.
63
+ */
64
+ exports.WalletSchemas = {
65
+ wallet: walletSchema,
66
+ statementEntry: statementEntrySchema,
67
+ };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Enum representing the supported output formats for statement generation.
3
+ * Used to specify the desired file format when requesting statement downloads.
4
+ *
5
+ * @enum {string}
6
+ */
7
+ export declare enum STATEMENT_OUTPUT_TYPE {
8
+ /** Generate statement as a PDF document */
9
+ PDF = "PDF",
10
+ /** Generate statement as an Excel spreadsheet */
11
+ EXCEL = "EXCEL"
12
+ }
13
+ /**
14
+ * Interface defining the structure of a generated statement file.
15
+ * Contains metadata about the file and its content type.
16
+ *
17
+ * @interface StatementFile
18
+ * @property {string} file - Base64 encoded string of the file content or file path
19
+ * @property {string} file_extension - File extension (e.g., "pdf", "xlsx") without the dot
20
+ * @property {string} mime_type - MIME type of the file (e.g., "application/pdf", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
21
+ */
22
+ export interface StatementFile {
23
+ file: string;
24
+ file_extension: string;
25
+ mime_type: string;
26
+ }
27
+ //# sourceMappingURL=statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.d.ts","sourceRoot":"","sources":["../../../../src/src/models/wallet/statement.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,qBAAqB;IAC/B,2CAA2C;IAC3C,GAAG,QAAQ;IACX,iDAAiD;IACjD,KAAK,UAAU;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STATEMENT_OUTPUT_TYPE = void 0;
4
+ /**
5
+ * Enum representing the supported output formats for statement generation.
6
+ * Used to specify the desired file format when requesting statement downloads.
7
+ *
8
+ * @enum {string}
9
+ */
10
+ var STATEMENT_OUTPUT_TYPE;
11
+ (function (STATEMENT_OUTPUT_TYPE) {
12
+ /** Generate statement as a PDF document */
13
+ STATEMENT_OUTPUT_TYPE["PDF"] = "PDF";
14
+ /** Generate statement as an Excel spreadsheet */
15
+ STATEMENT_OUTPUT_TYPE["EXCEL"] = "EXCEL";
16
+ })(STATEMENT_OUTPUT_TYPE || (exports.STATEMENT_OUTPUT_TYPE = STATEMENT_OUTPUT_TYPE = {}));