@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,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletRepo = void 0;
4
+ const base_repository_js_1 = require("../../shared/base_repository.js");
5
+ const contract_js_1 = require("./contract.js");
6
+ const repository_js_1 = require("../files-gen/repository.js");
7
+ const manager_js_1 = require("../auth/manager.js");
8
+ const permission_js_1 = require("../../models/permission.js");
9
+ const index_js_1 = require("../../errors/index.js");
10
+ /**
11
+ * Repository class for managing wallet operations including balance checking,
12
+ * statement generation, and wallet information retrieval.
13
+ * @extends {BaseRepository<typeof contract>}
14
+ */
15
+ class WalletRepo extends base_repository_js_1.BaseRepository {
16
+ /**
17
+ * Creates an instance of WalletRepo initialized with the wallet contract.
18
+ */
19
+ constructor() {
20
+ super("wallet", contract_js_1.contract);
21
+ }
22
+ /**
23
+ * Gets an instance of the file generation repository.
24
+ * @private
25
+ * @returns {AfloatFilesRepo} A new instance of AfloatFilesRepo
26
+ */
27
+ get fileGenRepo() {
28
+ return new repository_js_1.AfloatFilesRepo();
29
+ }
30
+ /**
31
+ * Retrieves the current available balance for the wallet.
32
+ * @throws {PermissionError} If user lacks the ViewBalance permission
33
+ * @throws {Error} If the balance fetch operation fails
34
+ * @returns {Promise<number>} The available balance amount
35
+ */
36
+ async getBalance() {
37
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewBalance;
38
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requirePerm)) {
39
+ throw new index_js_1.PermissionError({
40
+ message: "You are not authorized to view the account balance.",
41
+ requiredPermissions: [requirePerm],
42
+ });
43
+ }
44
+ const result = await this.client.getBalance();
45
+ if (result.status === 201) {
46
+ return result.body.availableBalance;
47
+ }
48
+ throw new Error("An error occured while fetching balance");
49
+ }
50
+ /**
51
+ * Retrieves all wallets associated with the current context.
52
+ * @throws {Error} If the wallet fetch operation fails
53
+ * @returns {Promise<Wallet[]>} Array of wallet objects
54
+ */
55
+ async getWallets() {
56
+ const result = await this.client.getWallets();
57
+ if (result.status === 200) {
58
+ return result.body;
59
+ }
60
+ throw new Error("An error occured while fetching wallets");
61
+ }
62
+ /**
63
+ * Retrieves wallet statement items for a specified date range and account.
64
+ * If no range is provided, defaults to the current month (1st to 30th).
65
+ * @param {Object} props - The statement request properties
66
+ * @param {Object} [props.range] - Optional date range for the statement
67
+ * @param {Date} props.range.startDate - Start date for the statement period
68
+ * @param {Date} props.range.endDate - End date for the statement period
69
+ * @param {string} [props.accountNo] - Optional account number to fetch statement for
70
+ * @throws {PermissionError} If user lacks the ViewStatement permission
71
+ * @throws {Error} If the statement fetch operation fails
72
+ * @returns {Promise<WalletStatementItem[]>} Array of statement items for the specified period
73
+ */
74
+ async getStatement(props) {
75
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewStatement;
76
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requirePerm)) {
77
+ throw new index_js_1.PermissionError({
78
+ message: "You are not authorized to view the statement.",
79
+ requiredPermissions: [requirePerm],
80
+ });
81
+ }
82
+ const now = new Date();
83
+ const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);
84
+ const monthEnd = new Date(now.getFullYear(), now.getMonth(), 30);
85
+ const range = props.range !== undefined
86
+ ? { startDate: props.range.startDate, endDate: props.range.endDate }
87
+ : { startDate: monthStart, endDate: monthEnd };
88
+ const body = { ...range, accountNo: props.accountNo };
89
+ const result = await this.client.getStatement({ body });
90
+ if (result.status === 201) {
91
+ return result.body;
92
+ }
93
+ throw new Error("An error occured while fetching statement");
94
+ }
95
+ /**
96
+ * Generates a statement file for the specified period and account.
97
+ * @param {STATEMENT_OUTPUT_TYPE} fileType - The desired output format type for the statement
98
+ * @param {Object} props - The statement generation properties
99
+ * @param {Date} props.startDate - Start date for the statement period
100
+ * @param {Date} props.endDate - End date for the statement period
101
+ * @param {string} [props.accountNo] - Optional account number to generate statement for
102
+ * @throws {PermissionError} If user lacks the ViewStatement permission
103
+ * @returns {Promise<StatementFile>} The generated statement file
104
+ */
105
+ async genStatement(fileType, props) {
106
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewStatement;
107
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requirePerm)) {
108
+ throw new index_js_1.PermissionError({
109
+ message: "You are not authorized to view the statement.",
110
+ requiredPermissions: [requirePerm],
111
+ });
112
+ }
113
+ return await this.fileGenRepo.downloadStatement({
114
+ start_date: props.startDate,
115
+ end_date: props.endDate,
116
+ return_file_type: fileType,
117
+ account_no: props.accountNo,
118
+ });
119
+ }
120
+ /**
121
+ * Generates a PDF containing detailed wallet account information.
122
+ * @throws {PermissionError} If user lacks the ViewBalance permission
123
+ * @returns {Promise<StatementFile>} The generated PDF file containing wallet details
124
+ */
125
+ async genWalletDetailsPDF() {
126
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewBalance;
127
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requirePerm)) {
128
+ throw new index_js_1.PermissionError({
129
+ message: "You are not authorized to view the account details.",
130
+ requiredPermissions: [requirePerm],
131
+ });
132
+ }
133
+ return await this.fileGenRepo.genAccountDetailsPDF();
134
+ }
135
+ }
136
+ exports.WalletRepo = WalletRepo;
@@ -0,0 +1,168 @@
1
+ import { type ContactData, type ContactType } from "../schemas.js";
2
+ import { type ContactInfo } from "./contact_info.js";
3
+ /**
4
+ * Contact class that wraps the Zod schema and provides additional functionality
5
+ */
6
+ export declare class Contact {
7
+ private readonly data;
8
+ /**
9
+ * Private constructor - use static methods to create instances
10
+ */
11
+ private constructor();
12
+ /**
13
+ * Unique identifier for the contact
14
+ */
15
+ get id(): string;
16
+ /**
17
+ * Profile identifier associated with this contact
18
+ */
19
+ get profileId(): string;
20
+ /**
21
+ * Display name of the contact
22
+ */
23
+ get displayName(): string;
24
+ /**
25
+ * Type of contact (Bank or Mobile)
26
+ */
27
+ get type(): ContactType;
28
+ /**
29
+ * Creation timestamp of the contact
30
+ */
31
+ get createdAt(): Date;
32
+ /**
33
+ * Detailed contact information based on contact type
34
+ *
35
+ * @returns {ContactInfo | undefined} Contact information object:
36
+ * - MobileContactInfo for mobile money contacts
37
+ * - BankContactInfo for bank contacts
38
+ * - undefined if contact information cannot be constructed
39
+ *
40
+ * @remarks
41
+ * For mobile contacts, constructs from phone number
42
+ * For bank contacts, constructs from SWIFT code and account number
43
+ */
44
+ get info(): ContactInfo | undefined;
45
+ /**
46
+ * Payment channel for the contact
47
+ *
48
+ * @returns {string} Channel information:
49
+ * - For valid contacts, returns formatted channel from ContactInfo
50
+ * - For invalid contacts, falls back to account number
51
+ */
52
+ get channel(): string;
53
+ /**
54
+ * Account number for the contact
55
+ *
56
+ * @returns {string} Account number:
57
+ * - For valid contacts, returns formatted account number from ContactInfo
58
+ * - For invalid contacts, falls back to raw account number
59
+ */
60
+ get accNo(): string;
61
+ /**
62
+ * Account name for the contact
63
+ * Always returns the display name
64
+ */
65
+ get accName(): string;
66
+ /**
67
+ * Label for the account number field based on contact type
68
+ *
69
+ * @returns {string} Appropriate label:
70
+ * - "Phone Number" for mobile contacts
71
+ * - "Bank Account Number" for bank contacts
72
+ * - "Account Number" as fallback
73
+ */
74
+ get accNoLabel(): string;
75
+ /**
76
+ * Label for the channel field based on contact type
77
+ *
78
+ * @returns {string} Appropriate label:
79
+ * - "Channel" for mobile contacts
80
+ * - "Bank" for bank contacts
81
+ * - "Channel" as fallback
82
+ */
83
+ get channelLabel(): string;
84
+ /**
85
+ * Label for the account name field based on contact type
86
+ *
87
+ * @returns {string} Appropriate label:
88
+ * - "Full Name" for mobile contacts
89
+ * - "Bank Account Name" for bank contacts
90
+ * - "Display Name" as fallback
91
+ */
92
+ get accNameLabel(): string;
93
+ /**
94
+ * Creates a Contact instance from raw data
95
+ * @throws {ZodError} if validation fails
96
+ */
97
+ static create(data: ContactData): Contact;
98
+ /**
99
+ * Creates multiple Contact instances from an array of raw data
100
+ * @throws {ZodError} if validation fails for any item
101
+ */
102
+ static createMany(dataArray: ContactData[]): Contact[];
103
+ /**
104
+ * Creates a Contact instance from raw data without throwing
105
+ * @returns {Contact | null} Contact instance or null if validation fails
106
+ */
107
+ static createSafe(data: ContactData): Contact | null;
108
+ /**
109
+ * Checks if an unknown value contains valid data to construct a Contact instance.
110
+ * This is useful when validating raw data structures before instantiation.
111
+ *
112
+ * @param {unknown} obj - The value containing potential contact data
113
+ * @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * const rawData = await fetchFromAPI();
118
+ * if (Contact.canConstruct(rawData)) {
119
+ * const contact = Contact.create(rawData);
120
+ * // TypeScript knows contact is valid here
121
+ * console.log(contact.displayName);
122
+ * }
123
+ * ```
124
+ *
125
+ * @throws {never} This method never throws errors
126
+ *
127
+ * @remarks
128
+ * This method performs strict validation against the {@link ContactData} schema.
129
+ */
130
+ static canConstruct(obj: unknown): obj is Contact;
131
+ /**
132
+ * Validates if an unknown value is a Contact instance.
133
+ * This is a runtime type guard that ensures proper object structure and data validity.
134
+ *
135
+ * @param {unknown} obj - The value to validate
136
+ * @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * const maybeContact = getContactFromCache();
141
+ * if (Contact.is(maybeContact)) {
142
+ * // TypeScript knows maybeContact is a Contact here
143
+ * console.log(maybeContact.displayName);
144
+ * }
145
+ * ```
146
+ *
147
+ * @throws {never} This method never throws errors
148
+ *
149
+ * @remarks
150
+ * This method performs a complete structural validation:
151
+ * 1. Checks if the value is an object
152
+ * 2. Verifies presence of internal data property
153
+ * 3. Validates the data against ContactData schema
154
+ * 4. Ensures the object is a proper Contact instance
155
+ *
156
+ * Use this method when:
157
+ * - Validating cached Contact instances
158
+ * - Checking serialized Contact objects
159
+ * - Verifying API responses
160
+ * - Type narrowing in conditional blocks
161
+ */
162
+ static is(obj: unknown): obj is Contact;
163
+ /**
164
+ * Converts Payout instance to a plain object
165
+ */
166
+ toJSON(): ContactData;
167
+ }
168
+ //# sourceMappingURL=contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/contact/derivatives/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IAEnC;;OAEG;IACH,OAAO;IAIP;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,WAAW,CAEtB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED;;;;;;;;;;;OAWG;IACH,IAAI,IAAI,IAAI,WAAW,GAAG,SAAS,CAoBlC;IAED;;;;;;OAMG;IACH,IAAI,OAAO,IAAI,MAAM,CAIpB;IAED;;;;;;OAMG;IACH,IAAI,KAAK,IAAI,MAAM,CAIlB;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IAAI,MAAM,CAKvB;IAED;;;;;;;OAOG;IACH,IAAI,YAAY,IAAI,MAAM,CAKzB;IAED;;;;;;;OAOG;IACH,IAAI,YAAY,IAAI,MAAM,CAKzB;IAED;;;OAGG;WACW,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;IAIhD;;;OAGG;WACW,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE;IAI7D;;;OAGG;WACW,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,IAAI;IAQ3D;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO;IAUxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO;IAO9C;;OAEG;IACH,MAAM,IAAI,WAAW;CAGtB"}
@@ -0,0 +1,264 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contact = void 0;
4
+ const schemas_js_1 = require("../schemas.js");
5
+ const index_js_1 = require("../index.js");
6
+ const frontend_core_1 = require("@temboplus/frontend-core");
7
+ const contact_info_js_1 = require("./contact_info.js");
8
+ /**
9
+ * Contact class that wraps the Zod schema and provides additional functionality
10
+ */
11
+ class Contact {
12
+ /**
13
+ * Private constructor - use static methods to create instances
14
+ */
15
+ constructor(data) {
16
+ Object.defineProperty(this, "data", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: void 0
21
+ });
22
+ this.data = schemas_js_1.ContactSchemas.contactData.parse(data);
23
+ }
24
+ /**
25
+ * Unique identifier for the contact
26
+ */
27
+ get id() {
28
+ return this.data.id;
29
+ }
30
+ /**
31
+ * Profile identifier associated with this contact
32
+ */
33
+ get profileId() {
34
+ return this.data.profileId;
35
+ }
36
+ /**
37
+ * Display name of the contact
38
+ */
39
+ get displayName() {
40
+ return this.data.displayName;
41
+ }
42
+ /**
43
+ * Type of contact (Bank or Mobile)
44
+ */
45
+ get type() {
46
+ return this.data.type;
47
+ }
48
+ /**
49
+ * Creation timestamp of the contact
50
+ */
51
+ get createdAt() {
52
+ return this.data.createdAt;
53
+ }
54
+ /**
55
+ * Detailed contact information based on contact type
56
+ *
57
+ * @returns {ContactInfo | undefined} Contact information object:
58
+ * - MobileContactInfo for mobile money contacts
59
+ * - BankContactInfo for bank contacts
60
+ * - undefined if contact information cannot be constructed
61
+ *
62
+ * @remarks
63
+ * For mobile contacts, constructs from phone number
64
+ * For bank contacts, constructs from SWIFT code and account number
65
+ */
66
+ get info() {
67
+ if (this.data.type === "Mobile") {
68
+ const phone = frontend_core_1.PhoneNumber.from(this.data.accountNo);
69
+ if (phone) {
70
+ return new index_js_1.MobileContactInfo(this.data.displayName, phone);
71
+ }
72
+ }
73
+ if (this.data.type === "Bank") {
74
+ const bank = frontend_core_1.Bank.fromSWIFTCode(this.data.channel);
75
+ if (bank) {
76
+ return new contact_info_js_1.BankContactInfo(this.data.displayName, bank, this.data.accountNo);
77
+ }
78
+ }
79
+ return undefined;
80
+ }
81
+ /**
82
+ * Payment channel for the contact
83
+ *
84
+ * @returns {string} Channel information:
85
+ * - For valid contacts, returns formatted channel from ContactInfo
86
+ * - For invalid contacts, falls back to account number
87
+ */
88
+ get channel() {
89
+ const info = this.info;
90
+ if (info)
91
+ return info.channel;
92
+ return this.data.accountNo;
93
+ }
94
+ /**
95
+ * Account number for the contact
96
+ *
97
+ * @returns {string} Account number:
98
+ * - For valid contacts, returns formatted account number from ContactInfo
99
+ * - For invalid contacts, falls back to raw account number
100
+ */
101
+ get accNo() {
102
+ const info = this.info;
103
+ if (info)
104
+ return info.accNumber;
105
+ return this.data.accountNo;
106
+ }
107
+ /**
108
+ * Account name for the contact
109
+ * Always returns the display name
110
+ */
111
+ get accName() {
112
+ return this.data.displayName;
113
+ }
114
+ /**
115
+ * Label for the account number field based on contact type
116
+ *
117
+ * @returns {string} Appropriate label:
118
+ * - "Phone Number" for mobile contacts
119
+ * - "Bank Account Number" for bank contacts
120
+ * - "Account Number" as fallback
121
+ */
122
+ get accNoLabel() {
123
+ const info = this.info;
124
+ if (info instanceof index_js_1.MobileContactInfo)
125
+ return "Phone Number";
126
+ if (info instanceof contact_info_js_1.BankContactInfo)
127
+ return "Bank Account Number";
128
+ return "Account Number";
129
+ }
130
+ /**
131
+ * Label for the channel field based on contact type
132
+ *
133
+ * @returns {string} Appropriate label:
134
+ * - "Channel" for mobile contacts
135
+ * - "Bank" for bank contacts
136
+ * - "Channel" as fallback
137
+ */
138
+ get channelLabel() {
139
+ const info = this.info;
140
+ if (info instanceof index_js_1.MobileContactInfo)
141
+ return "Channel";
142
+ if (info instanceof contact_info_js_1.BankContactInfo)
143
+ return "Bank";
144
+ return "Channel";
145
+ }
146
+ /**
147
+ * Label for the account name field based on contact type
148
+ *
149
+ * @returns {string} Appropriate label:
150
+ * - "Full Name" for mobile contacts
151
+ * - "Bank Account Name" for bank contacts
152
+ * - "Display Name" as fallback
153
+ */
154
+ get accNameLabel() {
155
+ const info = this.info;
156
+ if (info instanceof index_js_1.MobileContactInfo)
157
+ return "Full Name";
158
+ if (info instanceof contact_info_js_1.BankContactInfo)
159
+ return "Bank Account Name";
160
+ return "Display Name";
161
+ }
162
+ /**
163
+ * Creates a Contact instance from raw data
164
+ * @throws {ZodError} if validation fails
165
+ */
166
+ static create(data) {
167
+ return new Contact(data);
168
+ }
169
+ /**
170
+ * Creates multiple Contact instances from an array of raw data
171
+ * @throws {ZodError} if validation fails for any item
172
+ */
173
+ static createMany(dataArray) {
174
+ return dataArray.map((data) => new Contact(data));
175
+ }
176
+ /**
177
+ * Creates a Contact instance from raw data without throwing
178
+ * @returns {Contact | null} Contact instance or null if validation fails
179
+ */
180
+ static createSafe(data) {
181
+ try {
182
+ return new Contact(data);
183
+ }
184
+ catch {
185
+ return null;
186
+ }
187
+ }
188
+ /**
189
+ * Checks if an unknown value contains valid data to construct a Contact instance.
190
+ * This is useful when validating raw data structures before instantiation.
191
+ *
192
+ * @param {unknown} obj - The value containing potential contact data
193
+ * @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const rawData = await fetchFromAPI();
198
+ * if (Contact.canConstruct(rawData)) {
199
+ * const contact = Contact.create(rawData);
200
+ * // TypeScript knows contact is valid here
201
+ * console.log(contact.displayName);
202
+ * }
203
+ * ```
204
+ *
205
+ * @throws {never} This method never throws errors
206
+ *
207
+ * @remarks
208
+ * This method performs strict validation against the {@link ContactData} schema.
209
+ */
210
+ static canConstruct(obj) {
211
+ if (!obj || typeof obj !== "object")
212
+ return false;
213
+ const result = schemas_js_1.ContactSchemas.contactData.safeParse(obj);
214
+ if (!result.success)
215
+ return false;
216
+ const contact = Contact.createSafe(result.data);
217
+ return contact !== null;
218
+ }
219
+ /**
220
+ * Validates if an unknown value is a Contact instance.
221
+ * This is a runtime type guard that ensures proper object structure and data validity.
222
+ *
223
+ * @param {unknown} obj - The value to validate
224
+ * @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
225
+ *
226
+ * @example
227
+ * ```typescript
228
+ * const maybeContact = getContactFromCache();
229
+ * if (Contact.is(maybeContact)) {
230
+ * // TypeScript knows maybeContact is a Contact here
231
+ * console.log(maybeContact.displayName);
232
+ * }
233
+ * ```
234
+ *
235
+ * @throws {never} This method never throws errors
236
+ *
237
+ * @remarks
238
+ * This method performs a complete structural validation:
239
+ * 1. Checks if the value is an object
240
+ * 2. Verifies presence of internal data property
241
+ * 3. Validates the data against ContactData schema
242
+ * 4. Ensures the object is a proper Contact instance
243
+ *
244
+ * Use this method when:
245
+ * - Validating cached Contact instances
246
+ * - Checking serialized Contact objects
247
+ * - Verifying API responses
248
+ * - Type narrowing in conditional blocks
249
+ */
250
+ static is(obj) {
251
+ if (!obj || typeof obj !== "object")
252
+ return false;
253
+ if (!("data" in obj))
254
+ return false;
255
+ return Contact.canConstruct(obj.data);
256
+ }
257
+ /**
258
+ * Converts Payout instance to a plain object
259
+ */
260
+ toJSON() {
261
+ return { ...this.data };
262
+ }
263
+ }
264
+ exports.Contact = Contact;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.test.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/contact/derivatives/contact.test.ts"],"names":[],"mappings":""}