@temboplus/afloat 0.1.77-beta.9 → 0.1.79

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 (415) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +42 -246
  3. package/esm/mod.d.ts +8 -0
  4. package/esm/mod.d.ts.map +1 -0
  5. package/esm/mod.js +7 -0
  6. package/esm/package.json +3 -0
  7. package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
  8. package/esm/src/errors/api_error.d.ts.map +1 -0
  9. package/esm/src/errors/api_error.js +90 -0
  10. package/esm/src/errors/index.d.ts +3 -0
  11. package/esm/src/errors/index.d.ts.map +1 -0
  12. package/esm/src/errors/index.js +2 -0
  13. package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
  14. package/esm/src/errors/permission_error.d.ts.map +1 -0
  15. package/esm/src/errors/permission_error.js +70 -0
  16. package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
  17. package/esm/src/features/admin/contract.d.ts.map +1 -0
  18. package/esm/src/features/admin/contract.js +210 -0
  19. package/esm/src/features/admin/index.d.ts +4 -0
  20. package/esm/src/features/admin/index.d.ts.map +1 -0
  21. package/esm/src/features/admin/index.js +3 -0
  22. package/esm/src/features/admin/repository.d.ts +114 -0
  23. package/esm/src/features/admin/repository.d.ts.map +1 -0
  24. package/esm/src/features/admin/repository.js +248 -0
  25. package/esm/src/features/admin/schemas.d.ts +146 -0
  26. package/esm/src/features/admin/schemas.d.ts.map +1 -0
  27. package/esm/src/features/admin/schemas.js +206 -0
  28. package/esm/src/features/auth/access/contract.d.ts +14 -0
  29. package/esm/src/features/auth/access/contract.d.ts.map +1 -0
  30. package/esm/src/features/auth/access/contract.js +14 -0
  31. package/esm/src/features/auth/access/repository.d.ts +11 -0
  32. package/esm/src/features/auth/access/repository.d.ts.map +1 -0
  33. package/esm/src/features/auth/access/repository.js +25 -0
  34. package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
  35. package/esm/src/features/auth/contract.d.ts.map +1 -0
  36. package/esm/src/features/auth/contract.js +43 -0
  37. package/esm/src/features/auth/identity/contract.d.ts +23 -0
  38. package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
  39. package/esm/src/features/auth/identity/contract.js +17 -0
  40. package/esm/src/features/auth/identity/repository.d.ts +22 -0
  41. package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
  42. package/esm/src/features/auth/identity/repository.js +30 -0
  43. package/esm/src/features/auth/index.d.ts +6 -0
  44. package/esm/src/features/auth/index.d.ts.map +1 -0
  45. package/esm/src/features/auth/index.js +5 -0
  46. package/esm/src/features/auth/manager.d.ts +105 -0
  47. package/esm/src/features/auth/manager.d.ts.map +1 -0
  48. package/esm/src/features/auth/manager.js +181 -0
  49. package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
  50. package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
  51. package/esm/src/features/auth/profile/contract.js +14 -0
  52. package/esm/src/features/auth/profile/repository.d.ts +11 -0
  53. package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
  54. package/esm/src/features/auth/profile/repository.js +25 -0
  55. package/esm/src/features/auth/repository.d.ts +30 -0
  56. package/esm/src/features/auth/repository.d.ts.map +1 -0
  57. package/esm/src/features/auth/repository.js +69 -0
  58. package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
  59. package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
  60. package/esm/src/features/auth/storage/client_store.js +46 -0
  61. package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
  62. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  63. package/esm/src/features/auth/storage/client_token_handler.js +36 -0
  64. package/esm/src/features/auth/storage/server_store.d.ts +24 -0
  65. package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
  66. package/esm/src/features/auth/storage/server_store.js +34 -0
  67. package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
  68. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  69. package/esm/src/features/auth/storage/server_token_handler.js +115 -0
  70. package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
  71. package/esm/src/features/auth/storage/types.d.ts.map +1 -0
  72. package/esm/src/features/auth/storage/types.js +1 -0
  73. package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
  74. package/esm/src/features/contact/contract.d.ts.map +1 -0
  75. package/esm/src/features/contact/contract.js +49 -0
  76. package/esm/src/features/contact/index.d.ts +2 -0
  77. package/esm/src/features/contact/index.d.ts.map +1 -0
  78. package/esm/src/features/contact/index.js +1 -0
  79. package/esm/src/features/contact/repository.d.ts +58 -0
  80. package/esm/src/features/contact/repository.d.ts.map +1 -0
  81. package/esm/src/features/contact/repository.js +108 -0
  82. package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
  83. package/esm/src/features/payout/contract.d.ts.map +1 -0
  84. package/esm/src/features/payout/contract.js +75 -0
  85. package/esm/src/features/payout/index.d.ts +2 -0
  86. package/esm/src/features/payout/index.d.ts.map +1 -0
  87. package/esm/src/features/payout/index.js +1 -0
  88. package/esm/src/features/payout/repository.d.ts +67 -0
  89. package/esm/src/features/payout/repository.d.ts.map +1 -0
  90. package/esm/src/features/payout/repository.js +163 -0
  91. package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
  92. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  93. package/esm/src/features/wallet/contract.js +38 -0
  94. package/esm/src/features/wallet/index.d.ts +2 -0
  95. package/esm/src/features/wallet/index.d.ts.map +1 -0
  96. package/esm/src/features/wallet/index.js +1 -0
  97. package/esm/src/features/wallet/repository.d.ts +57 -0
  98. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  99. package/esm/src/features/wallet/repository.js +93 -0
  100. package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
  101. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact.js +266 -0
  103. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  104. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  105. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  106. package/esm/src/models/contact/index.d.ts +5 -0
  107. package/esm/src/models/contact/index.d.ts.map +1 -0
  108. package/esm/src/models/contact/index.js +4 -0
  109. package/esm/src/models/contact/schemas.d.ts +66 -0
  110. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  111. package/esm/src/models/contact/schemas.js +64 -0
  112. package/esm/src/models/contact/validation.d.ts +37 -0
  113. package/esm/src/models/contact/validation.d.ts.map +1 -0
  114. package/esm/src/models/contact/validation.js +146 -0
  115. package/esm/src/models/index.d.ts +7 -0
  116. package/esm/src/models/index.d.ts.map +1 -0
  117. package/esm/src/models/index.js +6 -0
  118. package/esm/src/models/payout/api.d.ts +29 -0
  119. package/esm/src/models/payout/api.d.ts.map +1 -0
  120. package/esm/src/models/payout/api.js +1 -0
  121. package/esm/src/models/payout/channel.d.ts +58 -0
  122. package/esm/src/models/payout/channel.d.ts.map +1 -0
  123. package/esm/src/models/payout/channel.js +53 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
  125. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  126. package/esm/src/models/payout/derivatives/payout.js +271 -0
  127. package/esm/src/models/payout/index.d.ts +7 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +6 -0
  130. package/esm/src/models/payout/narration.d.ts +164 -0
  131. package/esm/src/models/payout/narration.d.ts.map +1 -0
  132. package/esm/src/models/payout/narration.js +308 -0
  133. package/esm/src/models/payout/schemas.d.ts +156 -0
  134. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  135. package/esm/src/models/payout/schemas.js +105 -0
  136. package/esm/src/models/payout/status.d.ts +33 -0
  137. package/esm/src/models/payout/status.d.ts.map +1 -0
  138. package/esm/src/models/payout/status.js +34 -0
  139. package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
  140. package/esm/src/models/permission.d.ts.map +1 -0
  141. package/esm/src/models/permission.js +50 -0
  142. package/esm/src/models/role.d.ts +21 -0
  143. package/esm/src/models/role.d.ts.map +1 -0
  144. package/esm/src/models/role.js +73 -0
  145. package/esm/src/models/user/authenticated-user.d.ts +77 -0
  146. package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
  147. package/esm/src/models/user/authenticated-user.js +226 -0
  148. package/esm/src/models/user/index.d.ts +4 -0
  149. package/esm/src/models/user/index.d.ts.map +1 -0
  150. package/esm/src/models/user/index.js +3 -0
  151. package/esm/src/models/user/managed-user.d.ts +108 -0
  152. package/esm/src/models/user/managed-user.d.ts.map +1 -0
  153. package/esm/src/models/user/managed-user.js +255 -0
  154. package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
  155. package/esm/src/models/user/profile.d.ts.map +1 -0
  156. package/esm/src/models/user/profile.js +334 -0
  157. package/esm/src/models/wallet/index.d.ts +4 -0
  158. package/esm/src/models/wallet/index.d.ts.map +1 -0
  159. package/esm/src/models/wallet/index.js +3 -0
  160. package/esm/src/models/wallet/schemas.d.ts +95 -0
  161. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  162. package/esm/src/models/wallet/schemas.js +35 -0
  163. package/esm/src/models/wallet/statement_entry.d.ts +160 -0
  164. package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
  165. package/esm/src/models/wallet/statement_entry.js +255 -0
  166. package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
  167. package/esm/src/models/wallet/wallet.d.ts.map +1 -0
  168. package/esm/src/models/wallet/wallet.js +279 -0
  169. package/esm/src/shared/base_repository.d.ts +80 -0
  170. package/esm/src/shared/base_repository.d.ts.map +1 -0
  171. package/esm/src/shared/base_repository.js +153 -0
  172. package/esm/src/shared/common_responses.d.ts +13 -0
  173. package/esm/src/shared/common_responses.d.ts.map +1 -0
  174. package/esm/src/shared/common_responses.js +10 -0
  175. package/esm/src/shared/index.d.ts +3 -0
  176. package/esm/src/shared/index.d.ts.map +1 -0
  177. package/esm/src/shared/index.js +2 -0
  178. package/esm/src/shared/token_required_repository.d.ts +78 -0
  179. package/esm/src/shared/token_required_repository.d.ts.map +1 -0
  180. package/esm/src/shared/token_required_repository.js +128 -0
  181. package/package.json +23 -49
  182. package/script/mod.d.ts +8 -0
  183. package/script/mod.d.ts.map +1 -0
  184. package/script/mod.js +23 -0
  185. package/script/npm/src/mod.d.ts +8 -0
  186. package/script/npm/src/mod.d.ts.map +1 -0
  187. package/script/npm/src/mod.js +23 -0
  188. package/script/npm/src/src/errors/api_error.d.ts +63 -0
  189. package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
  190. package/script/npm/src/src/errors/api_error.js +94 -0
  191. package/script/npm/src/src/errors/index.d.ts +3 -0
  192. package/script/npm/src/src/errors/index.d.ts.map +1 -0
  193. package/script/npm/src/src/errors/index.js +18 -0
  194. package/script/npm/src/src/errors/permission_error.d.ts +48 -0
  195. package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
  196. package/script/npm/src/src/errors/permission_error.js +74 -0
  197. package/script/npm/src/src/features/admin/contract.d.ts +842 -0
  198. package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
  199. package/script/npm/src/src/features/admin/contract.js +213 -0
  200. package/script/npm/src/src/features/admin/index.d.ts +4 -0
  201. package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
  202. package/script/npm/src/src/features/admin/index.js +19 -0
  203. package/script/npm/src/src/features/admin/repository.d.ts +114 -0
  204. package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
  205. package/script/npm/src/src/features/admin/repository.js +252 -0
  206. package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
  207. package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
  208. package/script/npm/src/src/features/admin/schemas.js +209 -0
  209. package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
  210. package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
  211. package/script/npm/src/src/features/auth/access/contract.js +17 -0
  212. package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
  213. package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
  214. package/script/npm/src/src/features/auth/access/repository.js +29 -0
  215. package/script/npm/src/src/features/auth/contract.d.ts +112 -0
  216. package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
  217. package/script/npm/src/src/features/auth/contract.js +46 -0
  218. package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
  219. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
  220. package/script/npm/src/src/features/auth/identity/contract.js +20 -0
  221. package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
  222. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
  223. package/script/npm/src/src/features/auth/identity/repository.js +34 -0
  224. package/script/npm/src/src/features/auth/index.d.ts +6 -0
  225. package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
  226. package/script/npm/src/src/features/auth/index.js +21 -0
  227. package/script/npm/src/src/features/auth/manager.d.ts +105 -0
  228. package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
  229. package/script/npm/src/src/features/auth/manager.js +185 -0
  230. package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
  231. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
  232. package/script/npm/src/src/features/auth/profile/contract.js +17 -0
  233. package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
  234. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
  235. package/script/npm/src/src/features/auth/profile/repository.js +29 -0
  236. package/script/npm/src/src/features/auth/repository.d.ts +30 -0
  237. package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
  238. package/script/npm/src/src/features/auth/repository.js +73 -0
  239. package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
  240. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
  241. package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
  242. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
  243. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  244. package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
  245. package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
  246. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
  247. package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
  248. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
  249. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  250. package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
  251. package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
  252. package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
  253. package/script/npm/src/src/features/auth/storage/types.js +2 -0
  254. package/script/npm/src/src/features/contact/contract.d.ts +170 -0
  255. package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
  256. package/script/npm/src/src/features/contact/contract.js +52 -0
  257. package/script/npm/src/src/features/contact/index.d.ts +2 -0
  258. package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
  259. package/script/npm/src/src/features/contact/index.js +17 -0
  260. package/script/npm/src/src/features/contact/repository.d.ts +58 -0
  261. package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
  262. package/script/npm/src/src/features/contact/repository.js +112 -0
  263. package/script/npm/src/src/features/payout/contract.d.ts +623 -0
  264. package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
  265. package/script/npm/src/src/features/payout/contract.js +78 -0
  266. package/script/npm/src/src/features/payout/index.d.ts +2 -0
  267. package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
  268. package/script/npm/src/src/features/payout/index.js +17 -0
  269. package/script/npm/src/src/features/payout/repository.d.ts +67 -0
  270. package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
  271. package/script/npm/src/src/features/payout/repository.js +167 -0
  272. package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
  273. package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
  274. package/script/npm/src/src/features/wallet/contract.js +41 -0
  275. package/script/npm/src/src/features/wallet/index.d.ts +2 -0
  276. package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
  277. package/script/npm/src/src/features/wallet/index.js +17 -0
  278. package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
  279. package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
  280. package/script/npm/src/src/features/wallet/repository.js +97 -0
  281. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
  282. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
  283. package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
  284. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
  285. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  286. package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
  287. package/script/npm/src/src/models/contact/index.d.ts +5 -0
  288. package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
  289. package/script/npm/src/src/models/contact/index.js +20 -0
  290. package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
  291. package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
  292. package/script/npm/src/src/models/contact/schemas.js +67 -0
  293. package/script/npm/src/src/models/contact/validation.d.ts +37 -0
  294. package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
  295. package/script/npm/src/src/models/contact/validation.js +153 -0
  296. package/script/npm/src/src/models/index.d.ts +7 -0
  297. package/script/npm/src/src/models/index.d.ts.map +1 -0
  298. package/script/npm/src/src/models/index.js +22 -0
  299. package/script/npm/src/src/models/payout/api.d.ts +29 -0
  300. package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
  301. package/script/npm/src/src/models/payout/api.js +2 -0
  302. package/script/npm/src/src/models/payout/channel.d.ts +58 -0
  303. package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
  304. package/script/npm/src/src/models/payout/channel.js +56 -0
  305. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
  306. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
  307. package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
  308. package/script/npm/src/src/models/payout/index.d.ts +7 -0
  309. package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
  310. package/script/npm/src/src/models/payout/index.js +22 -0
  311. package/script/npm/src/src/models/payout/narration.d.ts +164 -0
  312. package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
  313. package/script/npm/src/src/models/payout/narration.js +312 -0
  314. package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
  315. package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
  316. package/script/npm/src/src/models/payout/schemas.js +108 -0
  317. package/script/npm/src/src/models/payout/status.d.ts +33 -0
  318. package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
  319. package/script/npm/src/src/models/payout/status.js +37 -0
  320. package/script/npm/src/src/models/permission.d.ts +55 -0
  321. package/script/npm/src/src/models/permission.d.ts.map +1 -0
  322. package/script/npm/src/src/models/permission.js +53 -0
  323. package/script/npm/src/src/models/role.d.ts +21 -0
  324. package/script/npm/src/src/models/role.d.ts.map +1 -0
  325. package/script/npm/src/src/models/role.js +77 -0
  326. package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
  327. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
  328. package/script/npm/src/src/models/user/authenticated-user.js +230 -0
  329. package/script/npm/src/src/models/user/index.d.ts +4 -0
  330. package/script/npm/src/src/models/user/index.d.ts.map +1 -0
  331. package/script/npm/src/src/models/user/index.js +19 -0
  332. package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
  333. package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
  334. package/script/npm/src/src/models/user/managed-user.js +260 -0
  335. package/script/npm/src/src/models/user/profile.d.ts +161 -0
  336. package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
  337. package/script/npm/src/src/models/user/profile.js +338 -0
  338. package/script/npm/src/src/models/wallet/index.d.ts +4 -0
  339. package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
  340. package/script/npm/src/src/models/wallet/index.js +19 -0
  341. package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
  342. package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
  343. package/script/npm/src/src/models/wallet/schemas.js +38 -0
  344. package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
  345. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
  346. package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
  347. package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
  348. package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
  349. package/script/npm/src/src/models/wallet/wallet.js +283 -0
  350. package/script/npm/src/src/shared/base_repository.d.ts +80 -0
  351. package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
  352. package/script/npm/src/src/shared/base_repository.js +157 -0
  353. package/script/npm/src/src/shared/common_responses.d.ts +13 -0
  354. package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
  355. package/script/npm/src/src/shared/common_responses.js +13 -0
  356. package/script/npm/src/src/shared/index.d.ts +3 -0
  357. package/script/npm/src/src/shared/index.d.ts.map +1 -0
  358. package/script/npm/src/src/shared/index.js +18 -0
  359. package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
  360. package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
  361. package/script/npm/src/src/shared/token_required_repository.js +132 -0
  362. package/script/package.json +3 -0
  363. package/dist/index.cjs.js +0 -2
  364. package/dist/index.cjs.js.map +0 -1
  365. package/dist/index.d.ts +0 -10
  366. package/dist/index.esm.js +0 -2
  367. package/dist/index.esm.js.map +0 -1
  368. package/dist/lib/api/base-repository.d.ts +0 -175
  369. package/dist/lib/api/index.d.ts +0 -1
  370. package/dist/lib/error/error.utils.d.ts +0 -22
  371. package/dist/lib/error/index.d.ts +0 -3
  372. package/dist/lib/query/index.d.ts +0 -4
  373. package/dist/lib/query/pagination/pagination.d.ts +0 -73
  374. package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
  375. package/dist/lib/query/query.builder.d.ts +0 -71
  376. package/dist/lib/query/query.types.d.ts +0 -36
  377. package/dist/modules/auth/auth.manager.d.ts +0 -249
  378. package/dist/modules/auth/auth.repository.d.ts +0 -83
  379. package/dist/modules/auth/auth.store.d.ts +0 -139
  380. package/dist/modules/auth/company-membership.model.d.ts +0 -171
  381. package/dist/modules/auth/index.d.ts +0 -4
  382. package/dist/modules/auth/user.model.d.ts +0 -363
  383. package/dist/modules/contact/contact-info.model.d.ts +0 -485
  384. package/dist/modules/contact/contact-input-handler.d.ts +0 -16
  385. package/dist/modules/contact/contact.dtos.d.ts +0 -84
  386. package/dist/modules/contact/contact.model.d.ts +0 -441
  387. package/dist/modules/contact/contact.repository.d.ts +0 -116
  388. package/dist/modules/contact/index.d.ts +0 -4
  389. package/dist/modules/login/index.d.ts +0 -4
  390. package/dist/modules/login/login.api-contract.d.ts +0 -51
  391. package/dist/modules/login/login.dtos.d.ts +0 -85
  392. package/dist/modules/login/login.model.d.ts +0 -168
  393. package/dist/modules/login/login.repository.d.ts +0 -58
  394. package/dist/modules/payout/index.d.ts +0 -5
  395. package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
  396. package/dist/modules/payout/payout.dtos.d.ts +0 -605
  397. package/dist/modules/payout/payout.model.d.ts +0 -379
  398. package/dist/modules/payout/payout.query.d.ts +0 -133
  399. package/dist/modules/payout/payout.repository.d.ts +0 -181
  400. package/dist/modules/profile/index.d.ts +0 -3
  401. package/dist/modules/profile/profile.dtos.d.ts +0 -80
  402. package/dist/modules/profile/profile.repository.d.ts +0 -56
  403. package/dist/modules/team-member/index.d.ts +0 -4
  404. package/dist/modules/team-member/role.model.d.ts +0 -61
  405. package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
  406. package/dist/modules/team-member/team-member.model.d.ts +0 -237
  407. package/dist/modules/team-member/team-member.repository.d.ts +0 -179
  408. package/dist/modules/wallet/index.d.ts +0 -7
  409. package/dist/modules/wallet/narration.model.d.ts +0 -225
  410. package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
  411. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
  412. package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
  413. package/dist/modules/wallet/wallet.query.d.ts +0 -95
  414. package/dist/modules/wallet/wallet.repository.d.ts +0 -205
  415. package/dist/modules/wallet/wallet.utils.d.ts +0 -17
@@ -0,0 +1,97 @@
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 index_js_1 = require("../../models/wallet/index.js");
7
+ const permission_js_1 = require("../../models/permission.js");
8
+ const index_js_2 = require("../../errors/index.js");
9
+ /**
10
+ * Repository class for managing wallet operations including balance checking,
11
+ * statement generation, and wallet information retrieval.
12
+ * @extends {BaseRepository<typeof contract>}
13
+ */
14
+ class WalletRepo extends base_repository_js_1.BaseRepository {
15
+ /**
16
+ * Creates an instance of WalletRepo initialized with the wallet contract.
17
+ * @param {Object} [options] - Optional configuration
18
+ * @param {string} [options.root] - Custom API root URL
19
+ * @param {AfloatAuth} [options.auth] - Auth instance to use
20
+ */
21
+ constructor(props) {
22
+ super("wallet", contract_js_1.contract, {
23
+ root: props?.root,
24
+ auth: props?.auth,
25
+ });
26
+ }
27
+ /**
28
+ * Retrieves the current available balance for the wallet.
29
+ * @throws {PermissionError} If user lacks the ViewBalance permission
30
+ * @throws {Error} If the balance fetch operation fails
31
+ * @returns {Promise<number>} The available balance amount
32
+ */
33
+ async getBalance(props) {
34
+ const auth = this.getAuthForPermissionCheck();
35
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewBalance;
36
+ if (!auth.checkPermission(requirePerm)) {
37
+ throw new index_js_2.PermissionError({
38
+ message: "You are not authorized to view the account balance.",
39
+ requiredPermissions: [requirePerm],
40
+ });
41
+ }
42
+ const result = await this.client.getBalance({
43
+ body: { accountNo: props.accountNo },
44
+ });
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(args) {
56
+ const result = await this.client.getWallets({ query: args });
57
+ if (result.status === 200) {
58
+ return result.body.map((w) => index_js_1.Wallet.from(w));
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<WalletStatementEntry[]>} Array of statement items for the specified period
73
+ */
74
+ async getStatement(props) {
75
+ const auth = this.getAuthForPermissionCheck();
76
+ const requirePerm = permission_js_1.Permissions.Wallet.ViewStatement;
77
+ if (!auth.checkPermission(requirePerm)) {
78
+ throw new index_js_2.PermissionError({
79
+ message: "You are not authorized to view the statement.",
80
+ requiredPermissions: [requirePerm],
81
+ });
82
+ }
83
+ const now = new Date();
84
+ const monthStart = new Date(now.getFullYear(), now.getMonth(), 1);
85
+ const monthEnd = new Date(now.getFullYear(), now.getMonth(), 30);
86
+ const range = props.range !== undefined
87
+ ? { startDate: props.range.startDate, endDate: props.range.endDate }
88
+ : { startDate: monthStart, endDate: monthEnd };
89
+ const body = { ...range, accountNo: props.accountNo };
90
+ const result = await this.client.getStatement({ body });
91
+ if (result.status === 201) {
92
+ return result.body.map((e) => index_js_1.WalletStatementEntry.from(e));
93
+ }
94
+ throw new Error("An error occured while fetching statement");
95
+ }
96
+ }
97
+ exports.WalletRepo = WalletRepo;
@@ -0,0 +1,172 @@
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
+ * Update timestamp of the contact
34
+ */
35
+ get updatedAt(): Date;
36
+ /**
37
+ * Detailed contact information based on contact type
38
+ *
39
+ * @returns {ContactInfo | undefined} Contact information object:
40
+ * - MobileContactInfo for mobile money contacts
41
+ * - BankContactInfo for bank contacts
42
+ * - undefined if contact information cannot be constructed
43
+ *
44
+ * @remarks
45
+ * For mobile contacts, constructs from phone number
46
+ * For bank contacts, constructs from SWIFT code and account number
47
+ */
48
+ get info(): ContactInfo | undefined;
49
+ /**
50
+ * Payment channel for the contact
51
+ *
52
+ * @returns {string} Channel information:
53
+ * - For valid contacts, returns formatted channel from ContactInfo
54
+ * - For invalid contacts, falls back to account number
55
+ */
56
+ get channel(): string;
57
+ /**
58
+ * Account number for the contact
59
+ *
60
+ * @returns {string} Account number:
61
+ * - For valid contacts, returns formatted account number from ContactInfo
62
+ * - For invalid contacts, falls back to raw account number
63
+ */
64
+ get accNo(): string;
65
+ /**
66
+ * Account name for the contact
67
+ * Always returns the display name
68
+ */
69
+ get accName(): string;
70
+ /**
71
+ * Label for the account number field based on contact type
72
+ *
73
+ * @returns {string} Appropriate label:
74
+ * - "Phone Number" for mobile contacts
75
+ * - "Bank Account Number" for bank contacts
76
+ * - "Account Number" as fallback
77
+ */
78
+ get accNoLabel(): string;
79
+ /**
80
+ * Label for the channel field based on contact type
81
+ *
82
+ * @returns {string} Appropriate label:
83
+ * - "Channel" for mobile contacts
84
+ * - "Bank" for bank contacts
85
+ * - "Channel" as fallback
86
+ */
87
+ get channelLabel(): string;
88
+ /**
89
+ * Label for the account name field based on contact type
90
+ *
91
+ * @returns {string} Appropriate label:
92
+ * - "Full Name" for mobile contacts
93
+ * - "Bank Account Name" for bank contacts
94
+ * - "Display Name" as fallback
95
+ */
96
+ get accNameLabel(): string;
97
+ /**
98
+ * Creates a Contact instance from raw data
99
+ * @throws {ZodError} if validation fails
100
+ */
101
+ static create(data: ContactData): Contact;
102
+ /**
103
+ * Creates multiple Contact instances from an array of raw data
104
+ * @throws {ZodError} if validation fails for any item
105
+ */
106
+ static createMany(dataArray: ContactData[]): Contact[];
107
+ /**
108
+ * Creates a Contact instance from raw data without throwing
109
+ * @returns {Contact | null} Contact instance or null if validation fails
110
+ */
111
+ static createSafe(data: ContactData): Contact | null;
112
+ /**
113
+ * Checks if an unknown value contains valid data to construct a Contact instance.
114
+ * This is useful when validating raw data structures before instantiation.
115
+ *
116
+ * @param {unknown} obj - The value containing potential contact data
117
+ * @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * const rawData = await fetchFromAPI();
122
+ * if (Contact.canConstruct(rawData)) {
123
+ * const contact = Contact.create(rawData);
124
+ * // TypeScript knows contact is valid here
125
+ * console.log(contact.displayName);
126
+ * }
127
+ * ```
128
+ *
129
+ * @throws {never} This method never throws errors
130
+ *
131
+ * @remarks
132
+ * This method performs strict validation against the {@link ContactData} schema.
133
+ */
134
+ static canConstruct(obj: unknown): obj is Contact;
135
+ /**
136
+ * Validates if an unknown value is a Contact instance.
137
+ * This is a runtime type guard that ensures proper object structure and data validity.
138
+ *
139
+ * @param {unknown} obj - The value to validate
140
+ * @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * const maybeContact = getContactFromCache();
145
+ * if (Contact.is(maybeContact)) {
146
+ * // TypeScript knows maybeContact is a Contact here
147
+ * console.log(maybeContact.displayName);
148
+ * }
149
+ * ```
150
+ *
151
+ * @throws {never} This method never throws errors
152
+ *
153
+ * @remarks
154
+ * This method performs a complete structural validation:
155
+ * 1. Checks if the value is an object
156
+ * 2. Verifies presence of internal data property
157
+ * 3. Validates the data against ContactData schema
158
+ * 4. Ensures the object is a proper Contact instance
159
+ *
160
+ * Use this method when:
161
+ * - Validating cached Contact instances
162
+ * - Checking serialized Contact objects
163
+ * - Verifying API responses
164
+ * - Type narrowing in conditional blocks
165
+ */
166
+ static is(obj: unknown): obj is Contact;
167
+ /**
168
+ * Converts Payout instance to a plain object
169
+ */
170
+ toJSON(): ContactData;
171
+ }
172
+ //# 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;;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,270 @@
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
+ * Update timestamp of the contact
56
+ */
57
+ get updatedAt() {
58
+ return this.data.updatedAt;
59
+ }
60
+ /**
61
+ * Detailed contact information based on contact type
62
+ *
63
+ * @returns {ContactInfo | undefined} Contact information object:
64
+ * - MobileContactInfo for mobile money contacts
65
+ * - BankContactInfo for bank contacts
66
+ * - undefined if contact information cannot be constructed
67
+ *
68
+ * @remarks
69
+ * For mobile contacts, constructs from phone number
70
+ * For bank contacts, constructs from SWIFT code and account number
71
+ */
72
+ get info() {
73
+ if (this.data.type === "Mobile") {
74
+ const phone = frontend_core_1.TZPhoneNumber.from(this.data.accountNo);
75
+ if (phone) {
76
+ return new index_js_1.MobileContactInfo(this.data.displayName, phone);
77
+ }
78
+ }
79
+ if (this.data.type === "Bank") {
80
+ const bank = frontend_core_1.Bank.fromSWIFTCode(this.data.channel);
81
+ if (bank) {
82
+ return new contact_info_js_1.BankContactInfo(this.data.displayName, bank, this.data.accountNo);
83
+ }
84
+ }
85
+ return undefined;
86
+ }
87
+ /**
88
+ * Payment channel for the contact
89
+ *
90
+ * @returns {string} Channel information:
91
+ * - For valid contacts, returns formatted channel from ContactInfo
92
+ * - For invalid contacts, falls back to account number
93
+ */
94
+ get channel() {
95
+ const info = this.info;
96
+ if (info)
97
+ return info.channel;
98
+ return this.data.accountNo;
99
+ }
100
+ /**
101
+ * Account number for the contact
102
+ *
103
+ * @returns {string} Account number:
104
+ * - For valid contacts, returns formatted account number from ContactInfo
105
+ * - For invalid contacts, falls back to raw account number
106
+ */
107
+ get accNo() {
108
+ const info = this.info;
109
+ if (info)
110
+ return info.accNumber;
111
+ return this.data.accountNo;
112
+ }
113
+ /**
114
+ * Account name for the contact
115
+ * Always returns the display name
116
+ */
117
+ get accName() {
118
+ return this.data.displayName;
119
+ }
120
+ /**
121
+ * Label for the account number field based on contact type
122
+ *
123
+ * @returns {string} Appropriate label:
124
+ * - "Phone Number" for mobile contacts
125
+ * - "Bank Account Number" for bank contacts
126
+ * - "Account Number" as fallback
127
+ */
128
+ get accNoLabel() {
129
+ const info = this.info;
130
+ if (info instanceof index_js_1.MobileContactInfo)
131
+ return "Phone Number";
132
+ if (info instanceof contact_info_js_1.BankContactInfo)
133
+ return "Bank Account Number";
134
+ return "Account Number";
135
+ }
136
+ /**
137
+ * Label for the channel field based on contact type
138
+ *
139
+ * @returns {string} Appropriate label:
140
+ * - "Channel" for mobile contacts
141
+ * - "Bank" for bank contacts
142
+ * - "Channel" as fallback
143
+ */
144
+ get channelLabel() {
145
+ const info = this.info;
146
+ if (info instanceof index_js_1.MobileContactInfo)
147
+ return "Channel";
148
+ if (info instanceof contact_info_js_1.BankContactInfo)
149
+ return "Bank";
150
+ return "Channel";
151
+ }
152
+ /**
153
+ * Label for the account name field based on contact type
154
+ *
155
+ * @returns {string} Appropriate label:
156
+ * - "Full Name" for mobile contacts
157
+ * - "Bank Account Name" for bank contacts
158
+ * - "Display Name" as fallback
159
+ */
160
+ get accNameLabel() {
161
+ const info = this.info;
162
+ if (info instanceof index_js_1.MobileContactInfo)
163
+ return "Full Name";
164
+ if (info instanceof contact_info_js_1.BankContactInfo)
165
+ return "Bank Account Name";
166
+ return "Display Name";
167
+ }
168
+ /**
169
+ * Creates a Contact instance from raw data
170
+ * @throws {ZodError} if validation fails
171
+ */
172
+ static create(data) {
173
+ return new Contact(data);
174
+ }
175
+ /**
176
+ * Creates multiple Contact instances from an array of raw data
177
+ * @throws {ZodError} if validation fails for any item
178
+ */
179
+ static createMany(dataArray) {
180
+ return dataArray.map((data) => new Contact(data));
181
+ }
182
+ /**
183
+ * Creates a Contact instance from raw data without throwing
184
+ * @returns {Contact | null} Contact instance or null if validation fails
185
+ */
186
+ static createSafe(data) {
187
+ try {
188
+ return new Contact(data);
189
+ }
190
+ catch {
191
+ return null;
192
+ }
193
+ }
194
+ /**
195
+ * Checks if an unknown value contains valid data to construct a Contact instance.
196
+ * This is useful when validating raw data structures before instantiation.
197
+ *
198
+ * @param {unknown} obj - The value containing potential contact data
199
+ * @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * const rawData = await fetchFromAPI();
204
+ * if (Contact.canConstruct(rawData)) {
205
+ * const contact = Contact.create(rawData);
206
+ * // TypeScript knows contact is valid here
207
+ * console.log(contact.displayName);
208
+ * }
209
+ * ```
210
+ *
211
+ * @throws {never} This method never throws errors
212
+ *
213
+ * @remarks
214
+ * This method performs strict validation against the {@link ContactData} schema.
215
+ */
216
+ static canConstruct(obj) {
217
+ if (!obj || typeof obj !== "object")
218
+ return false;
219
+ const result = schemas_js_1.ContactSchemas.contactData.safeParse(obj);
220
+ if (!result.success)
221
+ return false;
222
+ const contact = Contact.createSafe(result.data);
223
+ return contact !== null;
224
+ }
225
+ /**
226
+ * Validates if an unknown value is a Contact instance.
227
+ * This is a runtime type guard that ensures proper object structure and data validity.
228
+ *
229
+ * @param {unknown} obj - The value to validate
230
+ * @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * const maybeContact = getContactFromCache();
235
+ * if (Contact.is(maybeContact)) {
236
+ * // TypeScript knows maybeContact is a Contact here
237
+ * console.log(maybeContact.displayName);
238
+ * }
239
+ * ```
240
+ *
241
+ * @throws {never} This method never throws errors
242
+ *
243
+ * @remarks
244
+ * This method performs a complete structural validation:
245
+ * 1. Checks if the value is an object
246
+ * 2. Verifies presence of internal data property
247
+ * 3. Validates the data against ContactData schema
248
+ * 4. Ensures the object is a proper Contact instance
249
+ *
250
+ * Use this method when:
251
+ * - Validating cached Contact instances
252
+ * - Checking serialized Contact objects
253
+ * - Verifying API responses
254
+ * - Type narrowing in conditional blocks
255
+ */
256
+ static is(obj) {
257
+ if (!obj || typeof obj !== "object")
258
+ return false;
259
+ if (!("data" in obj))
260
+ return false;
261
+ return Contact.canConstruct(obj.data);
262
+ }
263
+ /**
264
+ * Converts Payout instance to a plain object
265
+ */
266
+ toJSON() {
267
+ return { ...this.data };
268
+ }
269
+ }
270
+ exports.Contact = Contact;