@temboplus/afloat 0.1.54 → 0.1.56

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 (465) 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/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/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/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/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/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/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 +120 -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/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/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/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
  51. package/dist/models/index.d.ts +10 -0
  52. package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
  53. package/{script/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +13 -15
  54. package/{esm/src → dist}/models/permission.d.ts +1 -2
  55. package/{script/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
  56. package/{script/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
  57. package/dist/models/statement-entry.model.d.ts +195 -0
  58. package/{script/src/models/user/authenticated-user.d.ts → dist/models/user.model.d.ts} +18 -13
  59. package/{script/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
  60. package/package.json +47 -26
  61. package/LICENSE +0 -7
  62. package/esm/_dnt.test_shims.d.ts.map +0 -1
  63. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  64. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  66. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  67. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  69. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  70. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  72. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  73. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  75. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  76. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  78. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  79. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  80. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  81. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  82. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  83. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  84. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  85. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  87. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  88. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  90. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  91. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  93. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  94. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  96. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  97. package/esm/mod.d.ts +0 -8
  98. package/esm/mod.d.ts.map +0 -1
  99. package/esm/mod.js +0 -7
  100. package/esm/package.json +0 -3
  101. package/esm/src/errors/api_error.d.ts.map +0 -1
  102. package/esm/src/errors/api_error.js +0 -90
  103. package/esm/src/errors/index.d.ts +0 -3
  104. package/esm/src/errors/index.d.ts.map +0 -1
  105. package/esm/src/errors/index.js +0 -2
  106. package/esm/src/errors/permission_error.d.ts +0 -48
  107. package/esm/src/errors/permission_error.d.ts.map +0 -1
  108. package/esm/src/errors/permission_error.js +0 -70
  109. package/esm/src/features/admin/contract.d.ts.map +0 -1
  110. package/esm/src/features/admin/contract.js +0 -210
  111. package/esm/src/features/admin/index.d.ts +0 -4
  112. package/esm/src/features/admin/index.d.ts.map +0 -1
  113. package/esm/src/features/admin/index.js +0 -3
  114. package/esm/src/features/admin/repository.d.ts +0 -114
  115. package/esm/src/features/admin/repository.d.ts.map +0 -1
  116. package/esm/src/features/admin/repository.js +0 -248
  117. package/esm/src/features/admin/schemas.d.ts +0 -146
  118. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  119. package/esm/src/features/admin/schemas.js +0 -206
  120. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  121. package/esm/src/features/auth/access/contract.js +0 -14
  122. package/esm/src/features/auth/access/repository.d.ts +0 -11
  123. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  124. package/esm/src/features/auth/access/repository.js +0 -25
  125. package/esm/src/features/auth/contract.d.ts.map +0 -1
  126. package/esm/src/features/auth/contract.js +0 -43
  127. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  128. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  129. package/esm/src/features/auth/identity/contract.js +0 -17
  130. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  131. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  132. package/esm/src/features/auth/identity/repository.js +0 -30
  133. package/esm/src/features/auth/index.d.ts +0 -6
  134. package/esm/src/features/auth/index.d.ts.map +0 -1
  135. package/esm/src/features/auth/index.js +0 -5
  136. package/esm/src/features/auth/manager.d.ts +0 -105
  137. package/esm/src/features/auth/manager.d.ts.map +0 -1
  138. package/esm/src/features/auth/manager.js +0 -181
  139. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  140. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  141. package/esm/src/features/auth/profile/contract.js +0 -14
  142. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  143. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  144. package/esm/src/features/auth/profile/repository.js +0 -25
  145. package/esm/src/features/auth/repository.d.ts +0 -30
  146. package/esm/src/features/auth/repository.d.ts.map +0 -1
  147. package/esm/src/features/auth/repository.js +0 -69
  148. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  149. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  150. package/esm/src/features/auth/storage/client_store.js +0 -46
  151. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  152. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  153. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  154. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  155. package/esm/src/features/auth/storage/server_store.js +0 -34
  156. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  157. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  158. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  159. package/esm/src/features/auth/storage/types.d.ts +0 -42
  160. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  161. package/esm/src/features/auth/storage/types.js +0 -1
  162. package/esm/src/features/contact/contract.d.ts.map +0 -1
  163. package/esm/src/features/contact/contract.js +0 -49
  164. package/esm/src/features/contact/index.d.ts +0 -2
  165. package/esm/src/features/contact/index.d.ts.map +0 -1
  166. package/esm/src/features/contact/index.js +0 -1
  167. package/esm/src/features/contact/repository.d.ts +0 -58
  168. package/esm/src/features/contact/repository.d.ts.map +0 -1
  169. package/esm/src/features/contact/repository.js +0 -108
  170. package/esm/src/features/payout/contract.d.ts.map +0 -1
  171. package/esm/src/features/payout/contract.js +0 -75
  172. package/esm/src/features/payout/index.d.ts +0 -2
  173. package/esm/src/features/payout/index.d.ts.map +0 -1
  174. package/esm/src/features/payout/index.js +0 -1
  175. package/esm/src/features/payout/repository.d.ts +0 -67
  176. package/esm/src/features/payout/repository.d.ts.map +0 -1
  177. package/esm/src/features/payout/repository.js +0 -163
  178. package/esm/src/features/wallet/contract.d.ts +0 -137
  179. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  180. package/esm/src/features/wallet/contract.js +0 -38
  181. package/esm/src/features/wallet/index.d.ts +0 -2
  182. package/esm/src/features/wallet/index.d.ts.map +0 -1
  183. package/esm/src/features/wallet/index.js +0 -1
  184. package/esm/src/features/wallet/repository.d.ts +0 -57
  185. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  186. package/esm/src/features/wallet/repository.js +0 -93
  187. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  188. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  189. package/esm/src/models/contact/derivatives/contact.js +0 -266
  190. package/esm/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
  191. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  192. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  193. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  194. package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
  195. package/esm/src/models/contact/index.d.ts +0 -5
  196. package/esm/src/models/contact/index.d.ts.map +0 -1
  197. package/esm/src/models/contact/index.js +0 -4
  198. package/esm/src/models/contact/schemas.d.ts +0 -66
  199. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  200. package/esm/src/models/contact/schemas.js +0 -64
  201. package/esm/src/models/contact/validation.d.ts +0 -37
  202. package/esm/src/models/contact/validation.d.ts.map +0 -1
  203. package/esm/src/models/contact/validation.js +0 -139
  204. package/esm/src/models/contact/validation.test.d.ts.map +0 -1
  205. package/esm/src/models/index.d.ts +0 -7
  206. package/esm/src/models/index.d.ts.map +0 -1
  207. package/esm/src/models/index.js +0 -6
  208. package/esm/src/models/payout/api.d.ts +0 -29
  209. package/esm/src/models/payout/api.d.ts.map +0 -1
  210. package/esm/src/models/payout/api.js +0 -1
  211. package/esm/src/models/payout/channel.d.ts +0 -58
  212. package/esm/src/models/payout/channel.d.ts.map +0 -1
  213. package/esm/src/models/payout/channel.js +0 -53
  214. package/esm/src/models/payout/derivatives/payout.d.ts +0 -156
  215. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  216. package/esm/src/models/payout/derivatives/payout.js +0 -261
  217. package/esm/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
  218. package/esm/src/models/payout/index.d.ts +0 -6
  219. package/esm/src/models/payout/index.d.ts.map +0 -1
  220. package/esm/src/models/payout/index.js +0 -5
  221. package/esm/src/models/payout/schemas.d.ts +0 -156
  222. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  223. package/esm/src/models/payout/schemas.js +0 -105
  224. package/esm/src/models/payout/status.d.ts +0 -33
  225. package/esm/src/models/payout/status.d.ts.map +0 -1
  226. package/esm/src/models/payout/status.js +0 -34
  227. package/esm/src/models/permission.d.ts.map +0 -1
  228. package/esm/src/models/permission.js +0 -50
  229. package/esm/src/models/role.d.ts +0 -21
  230. package/esm/src/models/role.d.ts.map +0 -1
  231. package/esm/src/models/role.js +0 -73
  232. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  233. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  234. package/esm/src/models/user/authenticated-user.js +0 -226
  235. package/esm/src/models/user/index.d.ts +0 -4
  236. package/esm/src/models/user/index.d.ts.map +0 -1
  237. package/esm/src/models/user/index.js +0 -3
  238. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  239. package/esm/src/models/user/managed-user.js +0 -255
  240. package/esm/src/models/user/profile.d.ts +0 -161
  241. package/esm/src/models/user/profile.d.ts.map +0 -1
  242. package/esm/src/models/user/profile.js +0 -334
  243. package/esm/src/models/wallet/index.d.ts +0 -4
  244. package/esm/src/models/wallet/index.d.ts.map +0 -1
  245. package/esm/src/models/wallet/index.js +0 -3
  246. package/esm/src/models/wallet/schemas.d.ts +0 -95
  247. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  248. package/esm/src/models/wallet/schemas.js +0 -35
  249. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  250. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  251. package/esm/src/models/wallet/statement_entry.js +0 -255
  252. package/esm/src/models/wallet/wallet.d.ts +0 -147
  253. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  254. package/esm/src/models/wallet/wallet.js +0 -279
  255. package/esm/src/shared/base_repository.d.ts.map +0 -1
  256. package/esm/src/shared/base_repository.js +0 -153
  257. package/esm/src/shared/common_responses.d.ts +0 -13
  258. package/esm/src/shared/common_responses.d.ts.map +0 -1
  259. package/esm/src/shared/common_responses.js +0 -10
  260. package/esm/src/shared/index.d.ts +0 -3
  261. package/esm/src/shared/index.d.ts.map +0 -1
  262. package/esm/src/shared/index.js +0 -2
  263. package/esm/src/shared/token_required_repository.d.ts +0 -78
  264. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  265. package/esm/src/shared/token_required_repository.js +0 -128
  266. package/script/_dnt.test_shims.d.ts.map +0 -1
  267. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  268. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  269. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  270. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  271. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  272. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  273. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  274. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  275. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  276. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  277. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  278. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  279. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  280. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  281. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  282. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  283. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  284. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  285. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  286. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  287. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  288. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  289. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  290. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  291. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  292. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  293. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  294. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  295. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  296. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  297. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  298. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  299. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  300. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  301. package/script/mod.d.ts +0 -8
  302. package/script/mod.d.ts.map +0 -1
  303. package/script/mod.js +0 -23
  304. package/script/package.json +0 -3
  305. package/script/src/errors/api_error.d.ts +0 -63
  306. package/script/src/errors/api_error.d.ts.map +0 -1
  307. package/script/src/errors/api_error.js +0 -94
  308. package/script/src/errors/index.d.ts +0 -3
  309. package/script/src/errors/index.d.ts.map +0 -1
  310. package/script/src/errors/index.js +0 -18
  311. package/script/src/errors/permission_error.d.ts.map +0 -1
  312. package/script/src/errors/permission_error.js +0 -74
  313. package/script/src/features/admin/contract.d.ts +0 -842
  314. package/script/src/features/admin/contract.d.ts.map +0 -1
  315. package/script/src/features/admin/contract.js +0 -213
  316. package/script/src/features/admin/index.d.ts +0 -4
  317. package/script/src/features/admin/index.d.ts.map +0 -1
  318. package/script/src/features/admin/index.js +0 -19
  319. package/script/src/features/admin/repository.d.ts +0 -114
  320. package/script/src/features/admin/repository.d.ts.map +0 -1
  321. package/script/src/features/admin/repository.js +0 -252
  322. package/script/src/features/admin/schemas.d.ts.map +0 -1
  323. package/script/src/features/admin/schemas.js +0 -209
  324. package/script/src/features/auth/access/contract.d.ts +0 -14
  325. package/script/src/features/auth/access/contract.d.ts.map +0 -1
  326. package/script/src/features/auth/access/contract.js +0 -17
  327. package/script/src/features/auth/access/repository.d.ts +0 -11
  328. package/script/src/features/auth/access/repository.d.ts.map +0 -1
  329. package/script/src/features/auth/access/repository.js +0 -29
  330. package/script/src/features/auth/contract.d.ts +0 -112
  331. package/script/src/features/auth/contract.d.ts.map +0 -1
  332. package/script/src/features/auth/contract.js +0 -46
  333. package/script/src/features/auth/identity/contract.d.ts.map +0 -1
  334. package/script/src/features/auth/identity/contract.js +0 -20
  335. package/script/src/features/auth/identity/repository.d.ts +0 -22
  336. package/script/src/features/auth/identity/repository.d.ts.map +0 -1
  337. package/script/src/features/auth/identity/repository.js +0 -34
  338. package/script/src/features/auth/index.d.ts +0 -6
  339. package/script/src/features/auth/index.d.ts.map +0 -1
  340. package/script/src/features/auth/index.js +0 -21
  341. package/script/src/features/auth/manager.d.ts +0 -105
  342. package/script/src/features/auth/manager.d.ts.map +0 -1
  343. package/script/src/features/auth/manager.js +0 -185
  344. package/script/src/features/auth/profile/contract.d.ts.map +0 -1
  345. package/script/src/features/auth/profile/contract.js +0 -17
  346. package/script/src/features/auth/profile/repository.d.ts +0 -11
  347. package/script/src/features/auth/profile/repository.d.ts.map +0 -1
  348. package/script/src/features/auth/profile/repository.js +0 -29
  349. package/script/src/features/auth/repository.d.ts +0 -30
  350. package/script/src/features/auth/repository.d.ts.map +0 -1
  351. package/script/src/features/auth/repository.js +0 -73
  352. package/script/src/features/auth/storage/client_store.d.ts.map +0 -1
  353. package/script/src/features/auth/storage/client_store.js +0 -51
  354. package/script/src/features/auth/storage/client_token_handler.d.ts +0 -32
  355. package/script/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  356. package/script/src/features/auth/storage/client_token_handler.js +0 -40
  357. package/script/src/features/auth/storage/server_store.d.ts +0 -24
  358. package/script/src/features/auth/storage/server_store.d.ts.map +0 -1
  359. package/script/src/features/auth/storage/server_store.js +0 -38
  360. package/script/src/features/auth/storage/server_token_handler.d.ts +0 -36
  361. package/script/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  362. package/script/src/features/auth/storage/server_token_handler.js +0 -119
  363. package/script/src/features/auth/storage/types.d.ts.map +0 -1
  364. package/script/src/features/auth/storage/types.js +0 -2
  365. package/script/src/features/contact/contract.d.ts +0 -170
  366. package/script/src/features/contact/contract.d.ts.map +0 -1
  367. package/script/src/features/contact/contract.js +0 -52
  368. package/script/src/features/contact/index.d.ts +0 -2
  369. package/script/src/features/contact/index.d.ts.map +0 -1
  370. package/script/src/features/contact/index.js +0 -17
  371. package/script/src/features/contact/repository.d.ts +0 -58
  372. package/script/src/features/contact/repository.d.ts.map +0 -1
  373. package/script/src/features/contact/repository.js +0 -112
  374. package/script/src/features/payout/contract.d.ts +0 -623
  375. package/script/src/features/payout/contract.d.ts.map +0 -1
  376. package/script/src/features/payout/contract.js +0 -78
  377. package/script/src/features/payout/index.d.ts +0 -2
  378. package/script/src/features/payout/index.d.ts.map +0 -1
  379. package/script/src/features/payout/index.js +0 -17
  380. package/script/src/features/payout/repository.d.ts +0 -67
  381. package/script/src/features/payout/repository.d.ts.map +0 -1
  382. package/script/src/features/payout/repository.js +0 -167
  383. package/script/src/features/wallet/contract.d.ts.map +0 -1
  384. package/script/src/features/wallet/contract.js +0 -41
  385. package/script/src/features/wallet/index.d.ts +0 -2
  386. package/script/src/features/wallet/index.d.ts.map +0 -1
  387. package/script/src/features/wallet/index.js +0 -17
  388. package/script/src/features/wallet/repository.d.ts +0 -57
  389. package/script/src/features/wallet/repository.d.ts.map +0 -1
  390. package/script/src/features/wallet/repository.js +0 -97
  391. package/script/src/models/contact/derivatives/contact.d.ts.map +0 -1
  392. package/script/src/models/contact/derivatives/contact.js +0 -270
  393. package/script/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
  394. package/script/src/models/contact/derivatives/contact_info.d.ts +0 -188
  395. package/script/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  396. package/script/src/models/contact/derivatives/contact_info.js +0 -260
  397. package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
  398. package/script/src/models/contact/index.d.ts +0 -5
  399. package/script/src/models/contact/index.d.ts.map +0 -1
  400. package/script/src/models/contact/index.js +0 -20
  401. package/script/src/models/contact/schemas.d.ts +0 -66
  402. package/script/src/models/contact/schemas.d.ts.map +0 -1
  403. package/script/src/models/contact/schemas.js +0 -67
  404. package/script/src/models/contact/validation.d.ts +0 -37
  405. package/script/src/models/contact/validation.d.ts.map +0 -1
  406. package/script/src/models/contact/validation.js +0 -146
  407. package/script/src/models/contact/validation.test.d.ts.map +0 -1
  408. package/script/src/models/index.d.ts +0 -7
  409. package/script/src/models/index.d.ts.map +0 -1
  410. package/script/src/models/index.js +0 -22
  411. package/script/src/models/payout/api.d.ts +0 -29
  412. package/script/src/models/payout/api.d.ts.map +0 -1
  413. package/script/src/models/payout/api.js +0 -2
  414. package/script/src/models/payout/channel.d.ts +0 -58
  415. package/script/src/models/payout/channel.d.ts.map +0 -1
  416. package/script/src/models/payout/channel.js +0 -56
  417. package/script/src/models/payout/derivatives/payout.d.ts.map +0 -1
  418. package/script/src/models/payout/derivatives/payout.js +0 -265
  419. package/script/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
  420. package/script/src/models/payout/index.d.ts +0 -6
  421. package/script/src/models/payout/index.d.ts.map +0 -1
  422. package/script/src/models/payout/index.js +0 -21
  423. package/script/src/models/payout/schemas.d.ts +0 -156
  424. package/script/src/models/payout/schemas.d.ts.map +0 -1
  425. package/script/src/models/payout/schemas.js +0 -108
  426. package/script/src/models/payout/status.d.ts +0 -33
  427. package/script/src/models/payout/status.d.ts.map +0 -1
  428. package/script/src/models/payout/status.js +0 -37
  429. package/script/src/models/permission.d.ts +0 -55
  430. package/script/src/models/permission.d.ts.map +0 -1
  431. package/script/src/models/permission.js +0 -53
  432. package/script/src/models/role.d.ts.map +0 -1
  433. package/script/src/models/role.js +0 -77
  434. package/script/src/models/user/authenticated-user.d.ts.map +0 -1
  435. package/script/src/models/user/authenticated-user.js +0 -230
  436. package/script/src/models/user/index.d.ts +0 -4
  437. package/script/src/models/user/index.d.ts.map +0 -1
  438. package/script/src/models/user/index.js +0 -19
  439. package/script/src/models/user/managed-user.d.ts +0 -108
  440. package/script/src/models/user/managed-user.d.ts.map +0 -1
  441. package/script/src/models/user/managed-user.js +0 -260
  442. package/script/src/models/user/profile.d.ts.map +0 -1
  443. package/script/src/models/user/profile.js +0 -338
  444. package/script/src/models/wallet/index.d.ts +0 -4
  445. package/script/src/models/wallet/index.d.ts.map +0 -1
  446. package/script/src/models/wallet/index.js +0 -19
  447. package/script/src/models/wallet/schemas.d.ts +0 -95
  448. package/script/src/models/wallet/schemas.d.ts.map +0 -1
  449. package/script/src/models/wallet/schemas.js +0 -38
  450. package/script/src/models/wallet/statement_entry.d.ts +0 -160
  451. package/script/src/models/wallet/statement_entry.d.ts.map +0 -1
  452. package/script/src/models/wallet/statement_entry.js +0 -259
  453. package/script/src/models/wallet/wallet.d.ts.map +0 -1
  454. package/script/src/models/wallet/wallet.js +0 -283
  455. package/script/src/shared/base_repository.d.ts +0 -80
  456. package/script/src/shared/base_repository.d.ts.map +0 -1
  457. package/script/src/shared/base_repository.js +0 -157
  458. package/script/src/shared/common_responses.d.ts.map +0 -1
  459. package/script/src/shared/common_responses.js +0 -13
  460. package/script/src/shared/index.d.ts +0 -3
  461. package/script/src/shared/index.d.ts.map +0 -1
  462. package/script/src/shared/index.js +0 -18
  463. package/script/src/shared/token_required_repository.d.ts +0 -78
  464. package/script/src/shared/token_required_repository.d.ts.map +0 -1
  465. package/script/src/shared/token_required_repository.js +0 -132
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PayoutSchemas = void 0;
4
- const zod_1 = require("zod");
5
- const status_js_1 = require("./status.js");
6
- /**
7
- * Creates a Zod schema that transforms null values to undefined
8
- * This is useful when dealing with APIs that return null but you want to use undefined in your codebase
9
- *
10
- * @template T - The type of Zod schema being transformed
11
- * @param {T} schema - The original Zod schema to transform
12
- * @returns {MakeOptionalResult<T>} A new schema that:
13
- * - Accepts the original type or null as input
14
- * - Outputs the original type or undefined
15
- * - Automatically transforms null to undefined during validation
16
- *
17
- * @example
18
- * const userSchema = z.object({
19
- * name: makeOptional(z.string()), // accepts: string | null, outputs: string | undefined
20
- * });
21
- *
22
- * // These are all valid:
23
- * userSchema.parse({ name: "John" }) // { name: "John" }
24
- * userSchema.parse({ name: null }) // { name: undefined }
25
- */
26
- const makeOptional = (schema) => schema.nullable().transform((val) => val === null ? undefined : val);
27
- /**
28
- * Schema for identifying users in the payout process
29
- * Used to track who created or actioned a payout
30
- */
31
- const identifierSchema = zod_1.z.object({
32
- name: zod_1.z.string(),
33
- identity: zod_1.z.string(),
34
- });
35
- /**
36
- * Schema for payout status
37
- * Defines all possible states a payout can be in
38
- */
39
- const payoutStatusSchema = zod_1.z.enum([
40
- status_js_1.PAYOUT_STATUS.CREATED,
41
- status_js_1.PAYOUT_STATUS.PAID,
42
- status_js_1.PAYOUT_STATUS.FAILED,
43
- status_js_1.PAYOUT_STATUS.REJECTED,
44
- status_js_1.PAYOUT_STATUS.PENDING,
45
- status_js_1.PAYOUT_STATUS.QUEUED,
46
- status_js_1.PAYOUT_STATUS.REVERSED,
47
- ]);
48
- /**
49
- * Schema for payout approval status
50
- * Defines all possible approval states
51
- */
52
- const approvalPayoutStatusSchema = zod_1.z.enum([
53
- status_js_1.PAYOUT_APPROVAL_STATUS.APPROVED,
54
- status_js_1.PAYOUT_APPROVAL_STATUS.PENDING,
55
- status_js_1.PAYOUT_APPROVAL_STATUS.REJECTED,
56
- ]);
57
- /**
58
- * Base schema for payout operations
59
- * Contains common fields used across all payout operations
60
- */
61
- const basePayoutSchema = zod_1.z.object({
62
- channel: zod_1.z.string(),
63
- msisdn: zod_1.z.string(),
64
- amount: zod_1.z.coerce.number(),
65
- description: zod_1.z.string(),
66
- notes: makeOptional(zod_1.z.string()).optional(),
67
- });
68
- /**
69
- * Schema for creating a new payout
70
- * Extends base payout schema with payee information
71
- */
72
- const payoutInputSchema = basePayoutSchema.extend({
73
- payeeName: zod_1.z.string(),
74
- });
75
- /**
76
- * Schema for complete payout record
77
- * Extends base payout schema with additional fields for:
78
- * - Identification (id, profileId)
79
- * - Status tracking
80
- * - Timestamps
81
- * - Approval information
82
- * - User tracking (created by, actioned by)
83
- */
84
- const payoutSchema = basePayoutSchema.extend({
85
- id: zod_1.z.string(),
86
- profileId: zod_1.z.string(),
87
- payeeName: zod_1.z.string(),
88
- status: payoutStatusSchema,
89
- statusMessage: zod_1.z.string(),
90
- partnerReference: makeOptional(zod_1.z.string()).optional(),
91
- createdAt: zod_1.z.coerce.date(),
92
- updatedAt: zod_1.z.coerce.date(),
93
- actionedAt: makeOptional(zod_1.z.coerce.date()).optional(),
94
- approvalStatus: approvalPayoutStatusSchema,
95
- createdBy: makeOptional(identifierSchema).optional(),
96
- actionedBy: makeOptional(identifierSchema).optional(),
97
- });
98
- /**
99
- * Export object containing all payout-related schemas
100
- * Used for validation and type checking throughout the application
101
- */
102
- exports.PayoutSchemas = {
103
- payoutData: payoutSchema, // Complete payout record schema
104
- payoutInput: payoutInputSchema, // New payout input schema
105
- payoutTransactionStatus: payoutStatusSchema, // Payout status enum schema
106
- payoutApprovalStatus: approvalPayoutStatusSchema, // Approval status enum schema
107
- payoutApprover: identifierSchema, // Identifier schema for approvers
108
- };
@@ -1,33 +0,0 @@
1
- /**
2
- * Represents the current status of a payout transaction.
3
- * @enum {string}
4
- * @readonly
5
- */
6
- export declare enum PAYOUT_STATUS {
7
- QUEUED = "QUEUED",
8
- /** Payout is awaiting processing */
9
- PENDING = "PENDING",
10
- /** Payout has been successfully processed */
11
- PAID = "PAID",
12
- /** Payout processing has failed */
13
- FAILED = "FAILED",
14
- /** Payout has been rejected */
15
- REJECTED = "REJECTED",
16
- /** Payout has been initially created but not yet processed */
17
- CREATED = "CREATED",
18
- REVERSED = "REVERSED"
19
- }
20
- /**
21
- * Represents the approval status for payouts that require authorization.
22
- * @enum {string}
23
- * @readonly
24
- */
25
- export declare enum PAYOUT_APPROVAL_STATUS {
26
- /** Payout is awaiting approval decision */
27
- PENDING = "Pending",
28
- /** Payout has been approved */
29
- APPROVED = "Approved",
30
- /** Payout has been rejected during approval process */
31
- REJECTED = "Rejected"
32
- }
33
- //# sourceMappingURL=status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/src/models/payout/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,aAAa;IACvB,MAAM,WAAW;IAEjB,oCAAoC;IACpC,OAAO,YAAY;IACnB,6CAA6C;IAC7C,IAAI,SAAS;IACb,mCAAmC;IACnC,MAAM,WAAW;IACjB,+BAA+B;IAC/B,QAAQ,aAAa;IACrB,8DAA8D;IAC9D,OAAO,YAAY;IAEnB,QAAQ,aAAa;CACtB;AAED;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,2CAA2C;IAC3C,OAAO,YAAY;IACnB,+BAA+B;IAC/B,QAAQ,aAAa;IACrB,uDAAuD;IACvD,QAAQ,aAAa;CACtB"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PAYOUT_APPROVAL_STATUS = exports.PAYOUT_STATUS = void 0;
4
- /**
5
- * Represents the current status of a payout transaction.
6
- * @enum {string}
7
- * @readonly
8
- */
9
- var PAYOUT_STATUS;
10
- (function (PAYOUT_STATUS) {
11
- PAYOUT_STATUS["QUEUED"] = "QUEUED";
12
- /** Payout is awaiting processing */
13
- PAYOUT_STATUS["PENDING"] = "PENDING";
14
- /** Payout has been successfully processed */
15
- PAYOUT_STATUS["PAID"] = "PAID";
16
- /** Payout processing has failed */
17
- PAYOUT_STATUS["FAILED"] = "FAILED";
18
- /** Payout has been rejected */
19
- PAYOUT_STATUS["REJECTED"] = "REJECTED";
20
- /** Payout has been initially created but not yet processed */
21
- PAYOUT_STATUS["CREATED"] = "CREATED";
22
- PAYOUT_STATUS["REVERSED"] = "REVERSED";
23
- })(PAYOUT_STATUS || (exports.PAYOUT_STATUS = PAYOUT_STATUS = {}));
24
- /**
25
- * Represents the approval status for payouts that require authorization.
26
- * @enum {string}
27
- * @readonly
28
- */
29
- var PAYOUT_APPROVAL_STATUS;
30
- (function (PAYOUT_APPROVAL_STATUS) {
31
- /** Payout is awaiting approval decision */
32
- PAYOUT_APPROVAL_STATUS["PENDING"] = "Pending";
33
- /** Payout has been approved */
34
- PAYOUT_APPROVAL_STATUS["APPROVED"] = "Approved";
35
- /** Payout has been rejected during approval process */
36
- PAYOUT_APPROVAL_STATUS["REJECTED"] = "Rejected";
37
- })(PAYOUT_APPROVAL_STATUS || (exports.PAYOUT_APPROVAL_STATUS = PAYOUT_APPROVAL_STATUS = {}));
@@ -1,55 +0,0 @@
1
- /**
2
- * All Afloat Permissions
3
- */
4
- export declare const Permissions: {
5
- readonly Profile: {
6
- readonly ViewCurrent: "profile.getCurrent";
7
- readonly Update: "profile.update";
8
- };
9
- readonly Contact: {
10
- readonly View: "contact.findById";
11
- readonly List: "contact.findAll";
12
- readonly Create: "contact.create";
13
- readonly Update: "contact.update";
14
- readonly Delete: "contact.delete";
15
- };
16
- readonly Payment: {
17
- readonly View: "payment.findById";
18
- readonly List: "payment.findAll";
19
- readonly Create: "payment.create";
20
- };
21
- readonly Payout: {
22
- readonly View: "payout.findById";
23
- readonly List: "payout.findAll";
24
- readonly Create: "payout.create";
25
- readonly Approve: "payout.approve";
26
- };
27
- readonly Transfer: {
28
- readonly View: "transfer.findById";
29
- readonly List: "transfer.findAll";
30
- readonly Create: "transfer.create";
31
- readonly Approve: "transfer.approve";
32
- };
33
- readonly Wallet: {
34
- readonly ViewBalance: "wallet.getBalance";
35
- readonly ViewStatement: "wallet.getStatement";
36
- };
37
- readonly Role: {
38
- readonly ViewRoles: "role.findAll";
39
- readonly ViewRole: "role.findById";
40
- };
41
- readonly UserManagement: {
42
- readonly ViewUsers: "login.findAll";
43
- readonly ViewUser: "login.findById";
44
- readonly CreateUser: "login.create";
45
- readonly UpdateUser: "login.update";
46
- readonly ArchiveUser: "login.archive";
47
- readonly UnArchiveUser: "login.unarchive";
48
- readonly ResetPassword: "login.resetPassword";
49
- };
50
- };
51
- /**
52
- * Permission Type
53
- */
54
- export type Permission = typeof Permissions.Profile[keyof typeof Permissions.Profile] | typeof Permissions.Contact[keyof typeof Permissions.Contact] | typeof Permissions.Payment[keyof typeof Permissions.Payment] | typeof Permissions.Payout[keyof typeof Permissions.Payout] | typeof Permissions.Transfer[keyof typeof Permissions.Transfer] | typeof Permissions.UserManagement[keyof typeof Permissions.UserManagement] | typeof Permissions.Role[keyof typeof Permissions.Role] | typeof Permissions.Wallet[keyof typeof Permissions.Wallet];
55
- //# sourceMappingURL=permission.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../../src/src/models/permission.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Cd,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,OAAO,WAAW,CAAC,OAAO,CAAC,GAC5D,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,GAC1D,OAAO,WAAW,CAAC,QAAQ,CAAC,MAAM,OAAO,WAAW,CAAC,QAAQ,CAAC,GAC9D,OAAO,WAAW,CAAC,cAAc,CAAC,MAAM,OAAO,WAAW,CAAC,cAAc,CAAC,GAC1E,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,OAAO,WAAW,CAAC,IAAI,CAAC,GACtD,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Permissions = void 0;
4
- /**
5
- * All Afloat Permissions
6
- */
7
- exports.Permissions = {
8
- Profile: {
9
- ViewCurrent: "profile.getCurrent",
10
- Update: "profile.update",
11
- },
12
- Contact: {
13
- View: "contact.findById",
14
- List: "contact.findAll",
15
- Create: "contact.create",
16
- Update: "contact.update",
17
- Delete: "contact.delete",
18
- },
19
- Payment: {
20
- View: "payment.findById",
21
- List: "payment.findAll",
22
- Create: "payment.create",
23
- },
24
- Payout: {
25
- View: "payout.findById",
26
- List: "payout.findAll",
27
- Create: "payout.create",
28
- Approve: "payout.approve",
29
- },
30
- Transfer: {
31
- View: "transfer.findById",
32
- List: "transfer.findAll",
33
- Create: "transfer.create",
34
- Approve: "transfer.approve",
35
- },
36
- Wallet: {
37
- ViewBalance: "wallet.getBalance",
38
- ViewStatement: "wallet.getStatement",
39
- },
40
- Role: {
41
- ViewRoles: "role.findAll",
42
- ViewRole: "role.findById",
43
- },
44
- UserManagement: {
45
- ViewUsers: "login.findAll",
46
- ViewUser: "login.findById",
47
- CreateUser: "login.create",
48
- UpdateUser: "login.update",
49
- ArchiveUser: "login.archive",
50
- UnArchiveUser: "login.unarchive",
51
- ResetPassword: "login.resetPassword",
52
- },
53
- }; // Make it deeply readonly
@@ -1 +0,0 @@
1
- {"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../../src/src/models/role.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,IAAI;IACf,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrC,SAAgB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjD,SAAgB,SAAS,EAAE,IAAI,CAAC;IAChC,SAAgB,SAAS,EAAE,IAAI,CAAC;gBAEpB,IAAI,EAAE,QAAQ;IAS1B,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI1C,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS;IAYxC,MAAM,IAAI,GAAG;CAUd"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- // deno-lint-ignore-file no-explicit-any
3
- // ====================== Role Entity ====================== //
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Role = void 0;
6
- class Role {
7
- constructor(data) {
8
- Object.defineProperty(this, "id", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: void 0
13
- });
14
- Object.defineProperty(this, "name", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: void 0
19
- });
20
- Object.defineProperty(this, "description", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: void 0
25
- });
26
- Object.defineProperty(this, "permissions", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: void 0
31
- });
32
- Object.defineProperty(this, "createdAt", {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: void 0
37
- });
38
- Object.defineProperty(this, "updatedAt", {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: void 0
43
- });
44
- this.id = data.id;
45
- this.name = data.name;
46
- this.description = data.description;
47
- this.permissions = new Set(data.access);
48
- this.createdAt = new Date(data.createdAt);
49
- this.updatedAt = new Date(data.updatedAt);
50
- }
51
- hasPermission(permission) {
52
- return this.permissions.has(permission);
53
- }
54
- static from(data) {
55
- try {
56
- if (!data?.id || !data?.name || !Array.isArray(data?.access)) {
57
- return undefined;
58
- }
59
- return new Role(data);
60
- }
61
- catch (error) {
62
- console.error("Error creating Role:", error);
63
- return undefined;
64
- }
65
- }
66
- toJSON() {
67
- return {
68
- id: this.id,
69
- name: this.name,
70
- description: this.description,
71
- access: Array.from(this.permissions),
72
- createdAt: this.createdAt.toISOString(),
73
- updatedAt: this.updatedAt.toISOString(),
74
- };
75
- }
76
- }
77
- exports.Role = Role;
@@ -1 +0,0 @@
1
- {"version":3,"file":"authenticated-user.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/authenticated-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;GAKG;AACH,qBAAa,IAAI;IACf;;OAEG;IACI,IAAI,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACI,QAAQ,EAAE,MAAM,CAAC;IAExB;;OAEG;IACI,OAAO,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACI,KAAK,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACI,aAAa,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,OAAO,CAAC,cAAc,CAA0B;IAEhD;;;;;OAKG;IACH,OAAO;IAwBP;;;;;OAKG;IACI,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;;;;OAQG;IACI,MAAM,IAAI,MAAM;IAavB;;;;;OAKG;WACW,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAS5D;;;;;OAKG;WACW,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS;CA4FhD"}
@@ -1,230 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.User = void 0;
4
- // deno-lint-ignore-file no-explicit-any
5
- const permission_js_1 = require("../permission.js");
6
- const profile_js_1 = require("./profile.js");
7
- /**
8
- * Represents a user in Afloat.
9
- *
10
- * This class centralizes user-related logic, simplifying interaction
11
- * with user-related data and ensuring consistent permission checks across the application.
12
- */
13
- class User {
14
- /**
15
- * Creates a new instance of the `User` class.
16
- *
17
- * @param userData - An object containing the user's profile, token,
18
- * permissions (access list), and the `resetPassword` flag.
19
- */
20
- constructor(data) {
21
- /**
22
- * Logged-in user name
23
- */
24
- Object.defineProperty(this, "name", {
25
- enumerable: true,
26
- configurable: true,
27
- writable: true,
28
- value: void 0
29
- });
30
- /**
31
- * Logged-in identity: phone-number or email address
32
- */
33
- Object.defineProperty(this, "identity", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: void 0
38
- });
39
- /**
40
- * The user's Afloat profile, containing personal information such as name, contact details, and account information.
41
- */
42
- Object.defineProperty(this, "profile", {
43
- enumerable: true,
44
- configurable: true,
45
- writable: true,
46
- value: void 0
47
- });
48
- /**
49
- * The user's authentication token. This token must be passed in the request headers
50
- * for all authenticated API endpoints.
51
- */
52
- Object.defineProperty(this, "token", {
53
- enumerable: true,
54
- configurable: true,
55
- writable: true,
56
- value: void 0
57
- });
58
- /**
59
- * Indicates whether the user is required to change their default password.
60
- *
61
- * Afloat users are initially provided with a default username and password. After the first
62
- * successful login, `resetPassword` will be set to `true` to prompt the user to set a new password.
63
- */
64
- Object.defineProperty(this, "resetPassword", {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: void 0
69
- });
70
- /**
71
- * A map of permission keys to boolean values, indicating whether the user has access
72
- * to specific actions or features in the system.
73
- */
74
- Object.defineProperty(this, "permissionsMap", {
75
- enumerable: true,
76
- configurable: true,
77
- writable: true,
78
- value: void 0
79
- });
80
- const { profile, token, access, resetPassword, name, identity } = data;
81
- this.profile = profile;
82
- this.token = token;
83
- this.resetPassword = resetPassword;
84
- this.name = name;
85
- this.identity = identity;
86
- this.permissionsMap = {};
87
- for (const group of Object.values(permission_js_1.Permissions)) {
88
- for (const perm of Object.values(group)) {
89
- this.permissionsMap[perm] = access.includes(perm);
90
- }
91
- }
92
- }
93
- /**
94
- * Checks if the user has a specific permission.
95
- *
96
- * @param permission - The permission key to check.
97
- * @returns `true` if the user has the specified permission, otherwise `false`.
98
- */
99
- can(permission) {
100
- return this.permissionsMap[permission] ?? false;
101
- }
102
- /**
103
- * Serializes the `User` instance to a JSON string.
104
- *
105
- * @returns A JSON string representation of the `User` instance, including:
106
- * - `profile`: The user's profile information. (Requires profile.toJSON() method)
107
- * - `token`: The user's authentication token.
108
- * - `resetPassword`: Indicates whether the user must reset their password.
109
- * - `permissions`: An array of permission keys the user has.
110
- */
111
- toJSON() {
112
- return JSON.stringify({
113
- profile: this.profile.toObject(),
114
- token: this.token,
115
- resetPassword: this.resetPassword,
116
- name: this.name,
117
- identity: this.identity,
118
- permissions: Object.keys(this.permissionsMap).filter((key) => this.permissionsMap[key]),
119
- });
120
- }
121
- /**
122
- * Creates a new `User` instance from a JSON string.
123
- *
124
- * @param jsonString - A JSON string containing user data.
125
- * @returns A `User` instance reconstructed from the JSON data, or undefined if jsonString is invalid.
126
- */
127
- static fromJSON(jsonString) {
128
- try {
129
- return User.from(JSON.parse(jsonString));
130
- }
131
- catch (e) {
132
- console.error("Invalid JSON string:", e);
133
- return undefined;
134
- }
135
- }
136
- /**
137
- * Creates a new `User` instance from a data object, JSON string, or object with a Profile instance/object.
138
- *
139
- * @param data - The data object, JSON string, or object with Profile instance/object containing user information.
140
- * @returns A `User` instance, or undefined if data is invalid.
141
- */
142
- static from(data) {
143
- let parsedData;
144
- // Parse JSON string if needed
145
- if (typeof data === "string") {
146
- try {
147
- parsedData = JSON.parse(data);
148
- }
149
- catch (error) {
150
- console.error("Invalid JSON string:", error);
151
- return undefined;
152
- }
153
- }
154
- else {
155
- parsedData = data;
156
- }
157
- if (!parsedData) {
158
- console.error("Data is null or undefined.");
159
- return undefined;
160
- }
161
- // Handle different profile formats
162
- let profile;
163
- let rawProfile = parsedData.profile;
164
- // Handle stringified profile (the case in the provided sample)
165
- if (typeof rawProfile === "string") {
166
- try {
167
- // Attempt to parse the stringified profile
168
- rawProfile = JSON.parse(rawProfile);
169
- }
170
- catch (error) {
171
- console.error("Failed to parse profile JSON string:", error);
172
- return undefined;
173
- }
174
- }
175
- // Create Profile instance based on what we received
176
- if (profile_js_1.Profile.is(rawProfile)) {
177
- // Already a Profile instance
178
- profile = rawProfile;
179
- }
180
- else if (typeof rawProfile === "object" && rawProfile !== null) {
181
- // Convert object to Profile instance
182
- profile = profile_js_1.Profile.from(rawProfile);
183
- if (!profile) {
184
- console.error("Failed to create Profile from data:", rawProfile);
185
- return undefined;
186
- }
187
- }
188
- else if (typeof rawProfile === "string") {
189
- profile = profile_js_1.Profile.fromJSON(rawProfile);
190
- if (!profile) {
191
- console.error("Failed to create Profile from JSON data:", rawProfile);
192
- return undefined;
193
- }
194
- }
195
- else {
196
- console.error("Invalid profile format:", typeof rawProfile);
197
- return undefined;
198
- }
199
- // Validate other required fields
200
- if (!parsedData.token || typeof parsedData.token !== "string" ||
201
- !parsedData.name || typeof parsedData.name !== "string" ||
202
- !parsedData.identity || typeof parsedData.identity !== "string" ||
203
- !Array.isArray(parsedData.permissions) &&
204
- !Array.isArray(parsedData.access) ||
205
- typeof parsedData.resetPassword !== "boolean") {
206
- console.error("Missing or invalid required User fields:", {
207
- token: typeof parsedData.token,
208
- name: typeof parsedData.name,
209
- identity: typeof parsedData.identity,
210
- permissions: Array.isArray(parsedData.permissions),
211
- access: Array.isArray(parsedData.access),
212
- resetPassword: typeof parsedData.resetPassword,
213
- });
214
- return undefined;
215
- }
216
- // Support both 'permissions' and 'access' field names
217
- const access = parsedData.access || parsedData.permissions;
218
- // Create and return the User instance
219
- const args = {
220
- profile: profile,
221
- token: parsedData.token,
222
- access: access,
223
- resetPassword: parsedData.resetPassword,
224
- name: parsedData.name,
225
- identity: parsedData.identity,
226
- };
227
- return new User(args);
228
- }
229
- }
230
- exports.User = User;
@@ -1,4 +0,0 @@
1
- export * from "./profile.js";
2
- export * from "./authenticated-user.js";
3
- export * from "./managed-user.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./profile.js"), exports);
18
- __exportStar(require("./authenticated-user.js"), exports);
19
- __exportStar(require("./managed-user.js"), exports);