@temboplus/afloat 0.1.61 → 0.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/README.md +246 -42
  2. package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
  3. package/{script/npm/src/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
  4. package/dist/features/admin/admin.repository.d.ts +179 -0
  5. package/dist/features/admin/index.d.ts +2 -0
  6. package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
  7. package/dist/features/auth/access/access.repository.d.ts +55 -0
  8. package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
  9. package/dist/features/auth/auth.manager.d.ts +249 -0
  10. package/dist/features/auth/auth.repository.d.ts +66 -0
  11. package/dist/features/auth/auth.store.d.ts +139 -0
  12. package/{script/npm/src/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
  13. package/dist/features/auth/identity/identity.repository.d.ts +58 -0
  14. package/dist/features/auth/index.d.ts +5 -0
  15. package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
  16. package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
  17. package/dist/features/auth/profile/profile.repository.d.ts +56 -0
  18. package/{script/npm/src/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
  19. package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
  20. package/{script/npm/src/src → dist}/features/auth/storage/types.d.ts +1 -2
  21. package/dist/features/contact/contact-input-handler.d.ts +16 -0
  22. package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
  23. package/dist/features/contact/contact.dtos.d.ts +90 -0
  24. package/dist/features/contact/contact.repository.d.ts +116 -0
  25. package/dist/features/contact/index.d.ts +2 -0
  26. package/dist/features/payout/index.d.ts +3 -0
  27. package/dist/features/payout/payout-channel-handler.d.ts +108 -0
  28. package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
  29. package/dist/features/payout/payout.dtos.d.ts +365 -0
  30. package/dist/features/payout/payout.repository.d.ts +193 -0
  31. package/dist/features/wallet/index.d.ts +4 -0
  32. package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
  33. package/{script/npm/src/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
  34. package/dist/features/wallet/wallet.dtos.d.ts +204 -0
  35. package/dist/features/wallet/wallet.repository.d.ts +173 -0
  36. package/dist/features/wallet/wallet.utils.d.ts +17 -0
  37. package/dist/index.cjs.js +2 -0
  38. package/dist/index.cjs.js.map +1 -0
  39. package/dist/index.d.ts +7 -0
  40. package/dist/index.esm.js +2 -0
  41. package/dist/index.esm.js.map +1 -0
  42. package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
  43. package/{script/npm/src/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
  44. package/dist/lib/api/index.d.ts +2 -0
  45. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  46. package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  47. package/dist/lib/error/error.utils.d.ts +22 -0
  48. package/dist/lib/error/index.d.ts +3 -0
  49. package/dist/models/contact-info.model.d.ts +817 -0
  50. package/{script/npm/src/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
  51. package/dist/models/index.d.ts +11 -0
  52. package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
  53. package/dist/models/narration.model.d.ts +184 -0
  54. package/{script/npm/src/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +14 -16
  55. package/{esm/src → dist}/models/permission.d.ts +1 -2
  56. package/{script/npm/src/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
  57. package/{script/npm/src/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
  58. package/dist/models/statement-entry.model.d.ts +248 -0
  59. package/dist/models/user.model.d.ts +65 -0
  60. package/{script/npm/src/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
  61. package/package.json +47 -24
  62. package/LICENSE +0 -7
  63. package/esm/mod.d.ts +0 -8
  64. package/esm/mod.d.ts.map +0 -1
  65. package/esm/mod.js +0 -7
  66. package/esm/package.json +0 -3
  67. package/esm/src/errors/api_error.d.ts.map +0 -1
  68. package/esm/src/errors/api_error.js +0 -90
  69. package/esm/src/errors/index.d.ts +0 -3
  70. package/esm/src/errors/index.d.ts.map +0 -1
  71. package/esm/src/errors/index.js +0 -2
  72. package/esm/src/errors/permission_error.d.ts +0 -48
  73. package/esm/src/errors/permission_error.d.ts.map +0 -1
  74. package/esm/src/errors/permission_error.js +0 -70
  75. package/esm/src/features/admin/contract.d.ts.map +0 -1
  76. package/esm/src/features/admin/contract.js +0 -210
  77. package/esm/src/features/admin/index.d.ts +0 -4
  78. package/esm/src/features/admin/index.d.ts.map +0 -1
  79. package/esm/src/features/admin/index.js +0 -3
  80. package/esm/src/features/admin/repository.d.ts +0 -114
  81. package/esm/src/features/admin/repository.d.ts.map +0 -1
  82. package/esm/src/features/admin/repository.js +0 -248
  83. package/esm/src/features/admin/schemas.d.ts +0 -146
  84. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  85. package/esm/src/features/admin/schemas.js +0 -206
  86. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  87. package/esm/src/features/auth/access/contract.js +0 -14
  88. package/esm/src/features/auth/access/repository.d.ts +0 -11
  89. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  90. package/esm/src/features/auth/access/repository.js +0 -25
  91. package/esm/src/features/auth/contract.d.ts.map +0 -1
  92. package/esm/src/features/auth/contract.js +0 -43
  93. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  94. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  95. package/esm/src/features/auth/identity/contract.js +0 -17
  96. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  97. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  98. package/esm/src/features/auth/identity/repository.js +0 -30
  99. package/esm/src/features/auth/index.d.ts +0 -6
  100. package/esm/src/features/auth/index.d.ts.map +0 -1
  101. package/esm/src/features/auth/index.js +0 -5
  102. package/esm/src/features/auth/manager.d.ts +0 -105
  103. package/esm/src/features/auth/manager.d.ts.map +0 -1
  104. package/esm/src/features/auth/manager.js +0 -181
  105. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  106. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  107. package/esm/src/features/auth/profile/contract.js +0 -14
  108. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  109. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  110. package/esm/src/features/auth/profile/repository.js +0 -25
  111. package/esm/src/features/auth/repository.d.ts +0 -30
  112. package/esm/src/features/auth/repository.d.ts.map +0 -1
  113. package/esm/src/features/auth/repository.js +0 -69
  114. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  115. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  116. package/esm/src/features/auth/storage/client_store.js +0 -46
  117. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  118. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  119. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  120. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  121. package/esm/src/features/auth/storage/server_store.js +0 -34
  122. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  123. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  124. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  125. package/esm/src/features/auth/storage/types.d.ts +0 -42
  126. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  127. package/esm/src/features/auth/storage/types.js +0 -1
  128. package/esm/src/features/contact/contract.d.ts.map +0 -1
  129. package/esm/src/features/contact/contract.js +0 -49
  130. package/esm/src/features/contact/index.d.ts +0 -2
  131. package/esm/src/features/contact/index.d.ts.map +0 -1
  132. package/esm/src/features/contact/index.js +0 -1
  133. package/esm/src/features/contact/repository.d.ts +0 -58
  134. package/esm/src/features/contact/repository.d.ts.map +0 -1
  135. package/esm/src/features/contact/repository.js +0 -108
  136. package/esm/src/features/payout/contract.d.ts.map +0 -1
  137. package/esm/src/features/payout/contract.js +0 -75
  138. package/esm/src/features/payout/index.d.ts +0 -2
  139. package/esm/src/features/payout/index.d.ts.map +0 -1
  140. package/esm/src/features/payout/index.js +0 -1
  141. package/esm/src/features/payout/repository.d.ts +0 -67
  142. package/esm/src/features/payout/repository.d.ts.map +0 -1
  143. package/esm/src/features/payout/repository.js +0 -163
  144. package/esm/src/features/wallet/contract.d.ts +0 -137
  145. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  146. package/esm/src/features/wallet/contract.js +0 -38
  147. package/esm/src/features/wallet/index.d.ts +0 -2
  148. package/esm/src/features/wallet/index.d.ts.map +0 -1
  149. package/esm/src/features/wallet/index.js +0 -1
  150. package/esm/src/features/wallet/repository.d.ts +0 -57
  151. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  152. package/esm/src/features/wallet/repository.js +0 -93
  153. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  154. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  155. package/esm/src/models/contact/derivatives/contact.js +0 -266
  156. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  157. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  158. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  159. package/esm/src/models/contact/index.d.ts +0 -5
  160. package/esm/src/models/contact/index.d.ts.map +0 -1
  161. package/esm/src/models/contact/index.js +0 -4
  162. package/esm/src/models/contact/schemas.d.ts +0 -66
  163. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  164. package/esm/src/models/contact/schemas.js +0 -64
  165. package/esm/src/models/contact/validation.d.ts +0 -37
  166. package/esm/src/models/contact/validation.d.ts.map +0 -1
  167. package/esm/src/models/contact/validation.js +0 -146
  168. package/esm/src/models/index.d.ts +0 -7
  169. package/esm/src/models/index.d.ts.map +0 -1
  170. package/esm/src/models/index.js +0 -6
  171. package/esm/src/models/payout/api.d.ts +0 -29
  172. package/esm/src/models/payout/api.d.ts.map +0 -1
  173. package/esm/src/models/payout/api.js +0 -1
  174. package/esm/src/models/payout/channel.d.ts +0 -58
  175. package/esm/src/models/payout/channel.d.ts.map +0 -1
  176. package/esm/src/models/payout/channel.js +0 -53
  177. package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
  178. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  179. package/esm/src/models/payout/derivatives/payout.js +0 -265
  180. package/esm/src/models/payout/index.d.ts +0 -7
  181. package/esm/src/models/payout/index.d.ts.map +0 -1
  182. package/esm/src/models/payout/index.js +0 -6
  183. package/esm/src/models/payout/narration.d.ts +0 -164
  184. package/esm/src/models/payout/narration.d.ts.map +0 -1
  185. package/esm/src/models/payout/narration.js +0 -308
  186. package/esm/src/models/payout/schemas.d.ts +0 -156
  187. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  188. package/esm/src/models/payout/schemas.js +0 -105
  189. package/esm/src/models/payout/status.d.ts +0 -33
  190. package/esm/src/models/payout/status.d.ts.map +0 -1
  191. package/esm/src/models/payout/status.js +0 -34
  192. package/esm/src/models/permission.d.ts.map +0 -1
  193. package/esm/src/models/permission.js +0 -50
  194. package/esm/src/models/role.d.ts +0 -21
  195. package/esm/src/models/role.d.ts.map +0 -1
  196. package/esm/src/models/role.js +0 -73
  197. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  198. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  199. package/esm/src/models/user/authenticated-user.js +0 -226
  200. package/esm/src/models/user/index.d.ts +0 -4
  201. package/esm/src/models/user/index.d.ts.map +0 -1
  202. package/esm/src/models/user/index.js +0 -3
  203. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  204. package/esm/src/models/user/managed-user.js +0 -255
  205. package/esm/src/models/user/profile.d.ts +0 -161
  206. package/esm/src/models/user/profile.d.ts.map +0 -1
  207. package/esm/src/models/user/profile.js +0 -334
  208. package/esm/src/models/wallet/index.d.ts +0 -4
  209. package/esm/src/models/wallet/index.d.ts.map +0 -1
  210. package/esm/src/models/wallet/index.js +0 -3
  211. package/esm/src/models/wallet/schemas.d.ts +0 -95
  212. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  213. package/esm/src/models/wallet/schemas.js +0 -35
  214. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  215. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  216. package/esm/src/models/wallet/statement_entry.js +0 -255
  217. package/esm/src/models/wallet/wallet.d.ts +0 -147
  218. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  219. package/esm/src/models/wallet/wallet.js +0 -279
  220. package/esm/src/shared/base_repository.d.ts.map +0 -1
  221. package/esm/src/shared/base_repository.js +0 -153
  222. package/esm/src/shared/common_responses.d.ts +0 -13
  223. package/esm/src/shared/common_responses.d.ts.map +0 -1
  224. package/esm/src/shared/common_responses.js +0 -10
  225. package/esm/src/shared/index.d.ts +0 -3
  226. package/esm/src/shared/index.d.ts.map +0 -1
  227. package/esm/src/shared/index.js +0 -2
  228. package/esm/src/shared/token_required_repository.d.ts +0 -78
  229. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  230. package/esm/src/shared/token_required_repository.js +0 -128
  231. package/script/mod.d.ts +0 -8
  232. package/script/mod.d.ts.map +0 -1
  233. package/script/mod.js +0 -23
  234. package/script/npm/src/mod.d.ts +0 -8
  235. package/script/npm/src/mod.d.ts.map +0 -1
  236. package/script/npm/src/mod.js +0 -23
  237. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  238. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  239. package/script/npm/src/src/errors/api_error.js +0 -94
  240. package/script/npm/src/src/errors/index.d.ts +0 -3
  241. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  242. package/script/npm/src/src/errors/index.js +0 -18
  243. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  244. package/script/npm/src/src/errors/permission_error.js +0 -74
  245. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  246. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  247. package/script/npm/src/src/features/admin/contract.js +0 -213
  248. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  249. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  250. package/script/npm/src/src/features/admin/index.js +0 -19
  251. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  252. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  253. package/script/npm/src/src/features/admin/repository.js +0 -252
  254. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  255. package/script/npm/src/src/features/admin/schemas.js +0 -209
  256. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  257. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  258. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  259. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  260. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  261. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  262. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  263. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  264. package/script/npm/src/src/features/auth/contract.js +0 -46
  265. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  266. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  267. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  268. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  269. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  270. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  271. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  272. package/script/npm/src/src/features/auth/index.js +0 -21
  273. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  274. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  275. package/script/npm/src/src/features/auth/manager.js +0 -185
  276. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  277. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  278. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  279. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  280. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  281. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  282. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  283. package/script/npm/src/src/features/auth/repository.js +0 -73
  284. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  285. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  286. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  287. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  288. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  289. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  290. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  291. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  292. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  293. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  294. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  295. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  296. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  297. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  298. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  299. package/script/npm/src/src/features/contact/contract.js +0 -52
  300. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  301. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  302. package/script/npm/src/src/features/contact/index.js +0 -17
  303. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  304. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  305. package/script/npm/src/src/features/contact/repository.js +0 -112
  306. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  307. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  308. package/script/npm/src/src/features/payout/contract.js +0 -78
  309. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  310. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  311. package/script/npm/src/src/features/payout/index.js +0 -17
  312. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  313. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  314. package/script/npm/src/src/features/payout/repository.js +0 -167
  315. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  316. package/script/npm/src/src/features/wallet/contract.js +0 -41
  317. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  318. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  319. package/script/npm/src/src/features/wallet/index.js +0 -17
  320. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  321. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  322. package/script/npm/src/src/features/wallet/repository.js +0 -97
  323. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  324. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  325. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  326. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  327. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  328. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  329. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  330. package/script/npm/src/src/models/contact/index.js +0 -20
  331. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  332. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  333. package/script/npm/src/src/models/contact/schemas.js +0 -67
  334. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  335. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  336. package/script/npm/src/src/models/contact/validation.js +0 -153
  337. package/script/npm/src/src/models/index.d.ts +0 -7
  338. package/script/npm/src/src/models/index.d.ts.map +0 -1
  339. package/script/npm/src/src/models/index.js +0 -22
  340. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  341. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  342. package/script/npm/src/src/models/payout/api.js +0 -2
  343. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  344. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  345. package/script/npm/src/src/models/payout/channel.js +0 -56
  346. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  347. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -269
  348. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  349. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  350. package/script/npm/src/src/models/payout/index.js +0 -22
  351. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  352. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  353. package/script/npm/src/src/models/payout/narration.js +0 -312
  354. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  355. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  356. package/script/npm/src/src/models/payout/schemas.js +0 -108
  357. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  358. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  359. package/script/npm/src/src/models/payout/status.js +0 -37
  360. package/script/npm/src/src/models/permission.d.ts +0 -55
  361. package/script/npm/src/src/models/permission.d.ts.map +0 -1
  362. package/script/npm/src/src/models/permission.js +0 -53
  363. package/script/npm/src/src/models/role.d.ts.map +0 -1
  364. package/script/npm/src/src/models/role.js +0 -77
  365. package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
  366. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
  367. package/script/npm/src/src/models/user/authenticated-user.js +0 -230
  368. package/script/npm/src/src/models/user/index.d.ts +0 -4
  369. package/script/npm/src/src/models/user/index.d.ts.map +0 -1
  370. package/script/npm/src/src/models/user/index.js +0 -19
  371. package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
  372. package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
  373. package/script/npm/src/src/models/user/managed-user.js +0 -260
  374. package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
  375. package/script/npm/src/src/models/user/profile.js +0 -338
  376. package/script/npm/src/src/models/wallet/index.d.ts +0 -4
  377. package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
  378. package/script/npm/src/src/models/wallet/index.js +0 -19
  379. package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
  380. package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
  381. package/script/npm/src/src/models/wallet/schemas.js +0 -38
  382. package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
  383. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
  384. package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
  385. package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
  386. package/script/npm/src/src/models/wallet/wallet.js +0 -283
  387. package/script/npm/src/src/shared/base_repository.d.ts +0 -80
  388. package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
  389. package/script/npm/src/src/shared/base_repository.js +0 -157
  390. package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
  391. package/script/npm/src/src/shared/common_responses.js +0 -13
  392. package/script/npm/src/src/shared/index.d.ts +0 -3
  393. package/script/npm/src/src/shared/index.d.ts.map +0 -1
  394. package/script/npm/src/src/shared/index.js +0 -18
  395. package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
  396. package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
  397. package/script/npm/src/src/shared/token_required_repository.js +0 -132
  398. package/script/package.json +0 -3
@@ -0,0 +1,248 @@
1
+ import { WalletStatementEntryDTO } from "@/features/wallet/wallet.dtos";
2
+ import { Amount, AmountJson } from "@temboplus/frontend-core";
3
+ import { Narration, NarrationJson } from "./narration.model";
4
+ /**
5
+ * Interface for the JSON representation of WalletStatementEntry
6
+ */
7
+ export interface WalletStatementEntryJson {
8
+ accountNo?: string;
9
+ debitOrCredit: string;
10
+ tranRefNo: string;
11
+ narration: NarrationJson;
12
+ txnDate: string;
13
+ valueDate: string;
14
+ amountCredited: AmountJson;
15
+ amountDebited: AmountJson;
16
+ balance: AmountJson;
17
+ currencyCode: string;
18
+ version?: string;
19
+ }
20
+ /**
21
+ * Represents a single entry in a Wallet's statement history.
22
+ *
23
+ * This class provides methods for creating, validating, and accessing statement entry data.
24
+ * It integrates with the Zod schema validation for data integrity and includes narration parsing capabilities.
25
+ * The narration field now uses the Narration class for enhanced functionality.
26
+ */
27
+ export declare class WalletStatementEntry {
28
+ private _accountNo?;
29
+ private _debitOrCredit;
30
+ private _tranRefNo;
31
+ private _narration;
32
+ private _txnDate;
33
+ private _valueDate;
34
+ private _amountCredited;
35
+ private _amountDebited;
36
+ private _balance;
37
+ private _currencyCode;
38
+ /**
39
+ * Gets the statement entry schema used for validation.
40
+ */
41
+ static get schema(): import("zod").ZodObject<{
42
+ accountNo: import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>;
43
+ debitOrCredit: import("zod").ZodString;
44
+ tranRefNo: import("zod").ZodString;
45
+ narration: import("zod").ZodString;
46
+ txnDate: import("zod").ZodDate;
47
+ valueDate: import("zod").ZodDate;
48
+ amountCredited: import("zod").ZodNumber;
49
+ amountDebited: import("zod").ZodNumber;
50
+ balance: import("zod").ZodNumber;
51
+ currencyCode: import("zod").ZodDefault<import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>>;
52
+ }, "strip", import("zod").ZodTypeAny, {
53
+ currencyCode: string;
54
+ debitOrCredit: string;
55
+ tranRefNo: string;
56
+ narration: string;
57
+ txnDate: Date;
58
+ valueDate: Date;
59
+ amountCredited: number;
60
+ amountDebited: number;
61
+ balance: number;
62
+ accountNo?: string | undefined;
63
+ }, {
64
+ debitOrCredit: string;
65
+ tranRefNo: string;
66
+ narration: string;
67
+ txnDate: Date;
68
+ valueDate: Date;
69
+ amountCredited: number;
70
+ amountDebited: number;
71
+ balance: number;
72
+ accountNo?: string | undefined;
73
+ currencyCode?: string | undefined;
74
+ }>;
75
+ /**
76
+ * Private constructor to enforce use of static factory methods.
77
+ * Assumes data is already validated and dates are Date objects.
78
+ * @param data - Object containing statement entry information conforming to WalletStatementEntryDTO.
79
+ * @param narration - Narration instance for the transaction
80
+ */
81
+ private constructor();
82
+ /**
83
+ * Creates a new WalletStatementEntry instance after validating the input data.
84
+ * Handles date coercion via the schema and uses currencyCode from the data.
85
+ *
86
+ * @param data - Object containing statement entry information. Dates can be strings or Date objects.
87
+ * @returns A new WalletStatementEntry instance, or undefined if validation fails.
88
+ */
89
+ static create(data: {
90
+ accountNo?: string | null;
91
+ debitOrCredit: string;
92
+ tranRefNo: string;
93
+ narration: string | Narration;
94
+ txnDate: string | Date;
95
+ valueDate: string | Date;
96
+ amountCredited: number;
97
+ amountDebited: number;
98
+ balance: number;
99
+ currencyCode?: string;
100
+ }): WalletStatementEntry | undefined;
101
+ /**
102
+ * Creates a new WalletStatementEntry with a payout narration using the V2 format.
103
+ * This is a convenience method for creating statement entries for payout transactions.
104
+ *
105
+ * @param data - Statement entry data without narration
106
+ * @param payoutId - Unique payout identifier for generating narration
107
+ * @returns A new WalletStatementEntry instance with generated narration, or undefined if validation fails
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * const entry = WalletStatementEntry.createWithPayoutNarration({
112
+ * debitOrCredit: "DEBIT",
113
+ * tranRefNo: "TXN-12345",
114
+ * txnDate: new Date(),
115
+ * valueDate: new Date(),
116
+ * amountDebited: 50000,
117
+ * amountCredited: 0,
118
+ * balance: 450000,
119
+ * currencyCode: "TZS"
120
+ * }, "AF-2024-001234");
121
+ * // Creates entry with narration: "TEMBO-DISB #AF-2024-001234"
122
+ * ```
123
+ */
124
+ static createWithPayoutNarration(data: {
125
+ accountNo?: string | null;
126
+ debitOrCredit: string;
127
+ tranRefNo: string;
128
+ txnDate: string | Date;
129
+ valueDate: string | Date;
130
+ amountCredited: number;
131
+ amountDebited: number;
132
+ balance: number;
133
+ currencyCode?: string;
134
+ }, payoutId: string): WalletStatementEntry | undefined;
135
+ get accountNo(): string | undefined;
136
+ get debitOrCredit(): string;
137
+ get tranRefNo(): string;
138
+ get narration(): Narration;
139
+ get txnDate(): Date;
140
+ get valueDate(): Date;
141
+ get amountCredited(): Amount;
142
+ get amountDebited(): Amount;
143
+ get balance(): Amount;
144
+ get currencyCode(): string;
145
+ /**
146
+ * Gets the payout ID from the narration if it's a V2 format payout narration.
147
+ * This is a convenience method that delegates to the narration instance.
148
+ *
149
+ * @returns The payout ID if available, undefined otherwise
150
+ */
151
+ get payoutId(): string | undefined;
152
+ /**
153
+ * Checks if this statement entry represents a payout transaction.
154
+ * Determined by checking if the narration contains a payout ID.
155
+ *
156
+ * @returns True if this is a payout transaction, false otherwise
157
+ */
158
+ get isPayout(): boolean;
159
+ /**
160
+ * Serializes the WalletStatementEntry instance to a JSON-compatible object.
161
+ * Dates are converted to ISO strings, amounts are serialized using Amount.toJson(),
162
+ * and narration is serialized using Narration.toJson().
163
+ *
164
+ * @returns {WalletStatementEntryJson} A plain object containing all necessary data
165
+ */
166
+ toJson(): WalletStatementEntryJson;
167
+ /**
168
+ * Creates a WalletStatementEntry instance from a JSON-compatible object.
169
+ *
170
+ * @param {WalletStatementEntryJson | string} json - Either a WalletStatementEntryJson object or a JSON string
171
+ * @returns {WalletStatementEntry | undefined} A WalletStatementEntry instance if valid, undefined otherwise
172
+ */
173
+ static fromJson(json: WalletStatementEntryJson | string): WalletStatementEntry | undefined;
174
+ /**
175
+ * Type guard to check if an object is a valid WalletStatementEntryJson
176
+ *
177
+ * @param obj - The object to validate
178
+ * @returns True if the object conforms to WalletStatementEntryJson structure
179
+ */
180
+ static isWalletStatementEntryJson(obj: unknown): obj is WalletStatementEntryJson;
181
+ /**
182
+ * Validates the current statement entry instance data against the schema.
183
+ * @returns True if the statement entry instance data is valid, false otherwise.
184
+ */
185
+ validate(): boolean;
186
+ /**
187
+ * Type guard to check if an unknown object is a valid WalletStatementEntry instance.
188
+ * Performs structural checks (duck typing).
189
+ * @param obj - The object to check.
190
+ * @returns Type predicate indicating if the object is a WalletStatementEntry instance.
191
+ */
192
+ static is(obj: unknown): obj is WalletStatementEntry;
193
+ /**
194
+ * Checks if two WalletStatementEntry instances are equal based on their transaction reference numbers.
195
+ * @param other - Another WalletStatementEntry to compare with.
196
+ * @returns True if both entries have the same transaction reference number.
197
+ */
198
+ equals(other: WalletStatementEntry): boolean;
199
+ /**
200
+ * Creates a copy of this WalletStatementEntry with the same data.
201
+ * @returns A new WalletStatementEntry instance with identical data.
202
+ */
203
+ clone(): WalletStatementEntry | undefined;
204
+ /**
205
+ * Returns a string representation of the statement entry for debugging.
206
+ * @returns A formatted string with key transaction details.
207
+ */
208
+ toString(): string;
209
+ /**
210
+ * Serializes an array of WalletStatementEntry instances to JSON-compatible objects
211
+ *
212
+ * @param entries - Array of WalletStatementEntry instances to serialize
213
+ * @returns Array of WalletStatementEntryJson objects
214
+ */
215
+ static toJsonArray(entries: WalletStatementEntry[]): WalletStatementEntryJson[];
216
+ /**
217
+ * Creates WalletStatementEntry instances from an array of JSON-compatible objects
218
+ *
219
+ * @param jsonArray - Array of WalletStatementEntryJson objects or JSON string
220
+ * @returns Array of WalletStatementEntry instances (invalid items are filtered out)
221
+ */
222
+ static fromJsonArray(jsonArray: WalletStatementEntryJson[] | string): WalletStatementEntry[];
223
+ /**
224
+ * Legacy method for backwards compatibility - creates object representation
225
+ * @deprecated Use toJson() instead for proper serialization
226
+ */
227
+ toObject(): Omit<WalletStatementEntryDTO, "amountCredited" | "amountDebited" | "balance" | "narration"> & {
228
+ amountCredited: AmountJson;
229
+ amountDebited: AmountJson;
230
+ balance: AmountJson;
231
+ narration: string;
232
+ };
233
+ /**
234
+ * Legacy method for backwards compatibility - converts to JSON string
235
+ * @deprecated Use JSON.stringify(entry.toJson()) instead
236
+ */
237
+ toJSON(): string;
238
+ /**
239
+ * Legacy method for backwards compatibility
240
+ * @deprecated Use fromJson() instead
241
+ */
242
+ static fromJSON(jsonString: string): WalletStatementEntry | undefined;
243
+ /**
244
+ * Legacy method for backwards compatibility - creates from plain object
245
+ * @deprecated Use fromJson() for serialized data or create() for raw data
246
+ */
247
+ static from(data: any): WalletStatementEntry | undefined;
248
+ }
@@ -0,0 +1,65 @@
1
+ import { Profile } from "./profile.model";
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 access 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.
19
+ */
20
+ profile: Profile;
21
+ /**
22
+ * The user's authentication token.
23
+ */
24
+ token: string;
25
+ /**
26
+ * Indicates whether the user must change their default password.
27
+ */
28
+ resetPassword: boolean;
29
+ /**
30
+ * A list of granted access keys (permissions).
31
+ */
32
+ access: string[];
33
+ /**
34
+ * A map of access keys to boolean values for fast permission checks.
35
+ */
36
+ private accessMap;
37
+ /**
38
+ * Creates a new `User` instance.
39
+ */
40
+ private constructor();
41
+ /**
42
+ * Checks if the user has a specific access permission.
43
+ *
44
+ * @param key - The access key to check.
45
+ * @returns `true` if the user has the specified access, otherwise `false`.
46
+ */
47
+ can(key: string): boolean;
48
+ /**
49
+ * Returns a plain object representation of the user.
50
+ * This can safely be embedded in a JWT payload.
51
+ */
52
+ toObject(): Record<string, any>;
53
+ /**
54
+ * Serializes the `User` instance to a JSON string.
55
+ */
56
+ toJSON(): string;
57
+ /**
58
+ * Creates a new `User` instance from a JSON string.
59
+ */
60
+ static fromJSON(jsonString: string): User | undefined;
61
+ /**
62
+ * Creates a new `User` instance from a plain object.
63
+ */
64
+ static from(data: any): User | undefined;
65
+ }
@@ -1,46 +1,5 @@
1
- import { z } from "zod";
2
1
  import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
3
- /**
4
- * Zod schema definition for validating Wallet data structures.
5
- * Ensures data integrity for wallet objects, including runtime validation
6
- * of country codes against the imported ISO2CountryCodesSet.
7
- */
8
- declare const walletSchema: z.ZodObject<{
9
- id: z.ZodString;
10
- profileId: z.ZodString;
11
- accountNo: z.ZodString;
12
- accountName: z.ZodString;
13
- channel: z.ZodString;
14
- countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
15
- currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
16
- createdAt: z.ZodString;
17
- updatedAt: z.ZodString;
18
- }, "strip", z.ZodTypeAny, {
19
- id: string;
20
- accountNo: string;
21
- channel: string;
22
- profileId: string;
23
- createdAt: string;
24
- updatedAt: string;
25
- accountName: string;
26
- countryCode: string;
27
- currencyCode: string;
28
- }, {
29
- id: string;
30
- accountNo: string;
31
- channel: string;
32
- profileId: string;
33
- createdAt: string;
34
- updatedAt: string;
35
- accountName: string;
36
- countryCode?: string | undefined;
37
- currencyCode?: string | undefined;
38
- }>;
39
- /**
40
- * TypeScript type representing the validated data structure for a Wallet.
41
- * Derived from the walletSchema. Note: countryCode is inferred as string.
42
- */
43
- type WalletDataType = z.infer<typeof walletSchema>;
2
+ import { WalletDTO, WalletDTOSchemas } from "@/features/wallet/wallet.dtos";
44
3
  /**
45
4
  * Represents a digital Wallet entity.
46
5
  *
@@ -61,7 +20,7 @@ export declare class Wallet {
61
20
  * Retrieves the Zod schema used for Wallet validation.
62
21
  * @returns The Zod schema object for Wallet.
63
22
  */
64
- static get schema(): typeof walletSchema;
23
+ static get schema(): typeof WalletDTOSchemas.walletDTO;
65
24
  /**
66
25
  * Private constructor enforces instantiation via static factory methods.
67
26
  * @param data - The validated wallet data object (countryCode is string).
@@ -109,7 +68,7 @@ export declare class Wallet {
109
68
  * Suitable for serialization or validation.
110
69
  * @returns A plain object conforming to the WalletDataType structure.
111
70
  */
112
- toObject(): WalletDataType;
71
+ toObject(): WalletDTO;
113
72
  /**
114
73
  * Serializes the Wallet instance into a JSON string.
115
74
  * @returns A JSON string representation of the wallet data.
@@ -143,5 +102,3 @@ export declare class Wallet {
143
102
  */
144
103
  static is(obj: unknown): obj is Wallet;
145
104
  }
146
- export {};
147
- //# sourceMappingURL=wallet.d.ts.map
package/package.json CHANGED
@@ -1,38 +1,61 @@
1
1
  {
2
2
  "name": "@temboplus/afloat",
3
- "version": "0.1.61",
4
- "description": "A JavaScript/TypeScript package providing common utilities and logic shared across all Temboplus-Afloat Projects",
3
+ "version": "0.1.63",
4
+ "description": "A foundational library for Temboplus-Afloat projects.",
5
+ "main": "./dist/index.cjs.js",
6
+ "module": "./dist/index.esm.js",
7
+ "types": "./dist/index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "rollup -c rollup.config.js",
21
+ "prepare": "npm run build",
22
+ "dev": "npm run build -- --watch",
23
+ "test": "echo \"Error: no test specified\" && exit 1"
24
+ },
5
25
  "repository": {
6
26
  "type": "git",
7
- "url": "git+https://github.com/TemboPlus-Frontend/afloat-js"
27
+ "url": "git+https://github.com/TemboPlus-Frontend/afloat-js.git"
8
28
  },
29
+ "keywords": [
30
+ "temboplus",
31
+ "afloat"
32
+ ],
33
+ "author": "Okello Gerald",
9
34
  "license": "MIT",
10
35
  "bugs": {
11
36
  "url": "https://github.com/TemboPlus-Frontend/afloat-js/issues"
12
37
  },
13
- "main": "./script/mod.js",
14
- "module": "./esm/mod.js",
15
- "exports": {
16
- ".": {
17
- "import": "./esm/mod.js",
18
- "require": "./script/mod.js"
19
- }
20
- },
21
- "scripts": {
22
- "test": "node test_runner.js"
23
- },
24
- "private": false,
25
- "dependencies": {
26
- "@temboplus/frontend-core": "^0.2.9",
38
+ "homepage": "https://github.com/TemboPlus-Frontend/afloat-js#readme",
39
+ "peerDependencies": {
40
+ "@temboplus/frontend-core": "^0.2.11",
27
41
  "@ts-rest/core": "^3.52.1",
28
- "antd": "^5.24.5",
42
+ "tslib": "^2.8.1",
29
43
  "uuid": "^11.1.0",
30
44
  "zod": "^3.24.2",
31
- "zustand": "^5.0.3"
45
+ "zustand": "^4.5.7"
32
46
  },
33
47
  "devDependencies": {
34
- "@types/node": "^20.9.0",
35
- "picocolors": "^1.0.0"
36
- },
37
- "_generatedBy": "dnt@dev"
38
- }
48
+ "@rollup/plugin-alias": "^5.1.1",
49
+ "@rollup/plugin-commonjs": "^28.0.3",
50
+ "@rollup/plugin-json": "^6.1.0",
51
+ "@rollup/plugin-node-resolve": "^16.0.1",
52
+ "@rollup/plugin-terser": "^0.4.4",
53
+ "@rollup/plugin-typescript": "^12.1.3",
54
+ "@types/jest": "^29.5.14",
55
+ "jest": "^29.7.0",
56
+ "rollup": "^4.39.0",
57
+ "ts-jest": "^29.3.1",
58
+ "ts-node": "^10.9.2",
59
+ "typescript": "^5.8.3"
60
+ }
61
+ }
package/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2025 TemboPlus Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/esm/mod.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./src/features/auth/index.js";
2
- export * from "./src/features/contact/index.js";
3
- export * from "./src/features/wallet/index.js";
4
- export * from "./src/features/payout/index.js";
5
- export * from "./src/features/admin/index.js";
6
- export * from "./src/errors/index.js";
7
- export * from "./src/models/index.js";
8
- //# sourceMappingURL=mod.d.ts.map
package/esm/mod.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
package/esm/mod.js DELETED
@@ -1,7 +0,0 @@
1
- export * from "./src/features/auth/index.js";
2
- export * from "./src/features/contact/index.js";
3
- export * from "./src/features/wallet/index.js";
4
- export * from "./src/features/payout/index.js";
5
- export * from "./src/features/admin/index.js";
6
- export * from "./src/errors/index.js";
7
- export * from "./src/models/index.js";
package/esm/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"api_error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/api_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC;;;OAGG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;;OAGG;IACH,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElD;;;;;;;OAOG;gBACS,IAAI,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;IASD;;;;;;;;;;;;;;;;;OAiBG;WACW,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;WAKrC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ;IAOjD,WAAkB,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACrB,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;QACxB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;KACxC,CAAC,CAOD;CACF"}
@@ -1,90 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Custom error class representing API-related errors.
4
- * Extends the built-in `Error` class to include additional properties such as `statusCode`, `error`, and `details`.
5
- */
6
- export class APIError extends Error {
7
- /**
8
- * Creates a new `APIError` instance.
9
- * @param {Object} args - The arguments to initialize the error.
10
- * @param {string} args.message - The error message.
11
- * @param {number} args.statusCode - The HTTP status code associated with the error.
12
- * @param {string} [args.error] - An optional error identifier or code.
13
- * @param {Record<string, unknown>} [args.details] - Additional details about the error.
14
- */
15
- constructor(args) {
16
- super(args.message);
17
- /**
18
- * The HTTP status code associated with the error.
19
- * @type {number}
20
- */
21
- Object.defineProperty(this, "statusCode", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: void 0
26
- });
27
- /**
28
- * An optional error identifier or code.
29
- * @type {string | undefined}
30
- */
31
- Object.defineProperty(this, "error", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: void 0
36
- });
37
- /**
38
- * Additional details about the error, often used for debugging purposes.
39
- * @type {Record<string, unknown> | undefined}
40
- */
41
- Object.defineProperty(this, "details", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: void 0
46
- });
47
- this.name = "ApiError";
48
- this.statusCode = args.statusCode;
49
- if (this.error)
50
- this.error = args.error;
51
- if (args.details)
52
- this.details = args.details;
53
- }
54
- /**
55
- * Validates whether an unknown value conforms to the APIError schema.
56
- * This is more thorough than an instanceof check as it verifies all required properties
57
- * and their types using the defined schema.
58
- *
59
- * @param {unknown} error - Any value to be validated
60
- * @returns {error is APIError} Type predicate indicating if the value is a valid APIError
61
- *
62
- * @example
63
- * try {
64
- * throw new Error('Network failed');
65
- * } catch (err) {
66
- * if (APIError.is(err)) {
67
- * // err is typed as APIError here
68
- * console.log(err.statusCode);
69
- * }
70
- * }
71
- */
72
- static is(error) {
73
- const result = APIError.schema.safeParse(error);
74
- return result.success;
75
- }
76
- static unknown(message) {
77
- return new APIError({
78
- message: message ?? "An unknown error occurred",
79
- statusCode: 502,
80
- });
81
- }
82
- static get schema() {
83
- return z.object({
84
- message: z.string(),
85
- statusCode: z.number().int(),
86
- error: z.string().optional(),
87
- details: z.object({}).optional(),
88
- });
89
- }
90
- }
@@ -1,3 +0,0 @@
1
- export * from "./api_error.js";
2
- export * from "./permission_error.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./api_error.js";
2
- export * from "./permission_error.js";
@@ -1,48 +0,0 @@
1
- import { type Permission } from "../models/permission.js";
2
- /**
3
- * Custom error class representing an error caused by missing required permissions.
4
- * Extends the built-in {@link Error} class to include the `requiredPermissions` property.
5
- */
6
- export declare class PermissionError extends Error {
7
- /**
8
- * The permissions that are required but were not present, causing the error.
9
- * @type {Permission[]}
10
- */
11
- readonly requiredPermissions: Permission[];
12
- /**
13
- * Creates a new `PermissionError` instance.
14
- * @param {Object} args - The constructor arguments.
15
- * @param {Permission[]} args.requiredPermissions - An array of permissions required for the operation.
16
- * @param {string} [args.message] - An optional custom error message. Defaults to listing the missing permissions.
17
- */
18
- constructor(args: {
19
- requiredPermissions: Permission[];
20
- message?: string;
21
- });
22
- /**
23
- * Validates if an unknown value is a valid PermissionError instance.
24
- * Performs structural validation of the error object and its properties.
25
- *
26
- * @param {unknown} error - The value to validate.
27
- * @returns {error is PermissionError} Type predicate indicating if the value is a valid PermissionError.
28
- *
29
- * @example
30
- * try {
31
- * throw new Error('Access denied');
32
- * } catch (error) {
33
- * if (PermissionError.is(error)) {
34
- * // error is typed as PermissionError with properly typed requiredPermissions
35
- * console.log(error.requiredPermissions);
36
- * }
37
- * }
38
- *
39
- * @remarks
40
- * Validates the following:
41
- * - Has all required Error properties
42
- * - Has correct error name
43
- * - Contains properly structured requiredPermissions array
44
- * - Maintains proper prototype chain
45
- */
46
- static is(error: unknown): error is PermissionError;
47
- }
48
- //# sourceMappingURL=permission_error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permission_error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/permission_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAC;AAGvE;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC;;;OAGG;IACH,SAAgB,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAElD;;;;;OAKG;gBACS,IAAI,EAAE;QAChB,mBAAmB,EAAE,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IASD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACW,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe;CAkB3D"}