@temboplus/afloat 0.1.77-beta.9 → 0.1.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +42 -246
  3. package/esm/mod.d.ts +8 -0
  4. package/esm/mod.d.ts.map +1 -0
  5. package/esm/mod.js +7 -0
  6. package/esm/package.json +3 -0
  7. package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
  8. package/esm/src/errors/api_error.d.ts.map +1 -0
  9. package/esm/src/errors/api_error.js +90 -0
  10. package/esm/src/errors/index.d.ts +3 -0
  11. package/esm/src/errors/index.d.ts.map +1 -0
  12. package/esm/src/errors/index.js +2 -0
  13. package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
  14. package/esm/src/errors/permission_error.d.ts.map +1 -0
  15. package/esm/src/errors/permission_error.js +70 -0
  16. package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
  17. package/esm/src/features/admin/contract.d.ts.map +1 -0
  18. package/esm/src/features/admin/contract.js +210 -0
  19. package/esm/src/features/admin/index.d.ts +4 -0
  20. package/esm/src/features/admin/index.d.ts.map +1 -0
  21. package/esm/src/features/admin/index.js +3 -0
  22. package/esm/src/features/admin/repository.d.ts +114 -0
  23. package/esm/src/features/admin/repository.d.ts.map +1 -0
  24. package/esm/src/features/admin/repository.js +248 -0
  25. package/esm/src/features/admin/schemas.d.ts +146 -0
  26. package/esm/src/features/admin/schemas.d.ts.map +1 -0
  27. package/esm/src/features/admin/schemas.js +206 -0
  28. package/esm/src/features/auth/access/contract.d.ts +14 -0
  29. package/esm/src/features/auth/access/contract.d.ts.map +1 -0
  30. package/esm/src/features/auth/access/contract.js +14 -0
  31. package/esm/src/features/auth/access/repository.d.ts +11 -0
  32. package/esm/src/features/auth/access/repository.d.ts.map +1 -0
  33. package/esm/src/features/auth/access/repository.js +25 -0
  34. package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
  35. package/esm/src/features/auth/contract.d.ts.map +1 -0
  36. package/esm/src/features/auth/contract.js +43 -0
  37. package/esm/src/features/auth/identity/contract.d.ts +23 -0
  38. package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
  39. package/esm/src/features/auth/identity/contract.js +17 -0
  40. package/esm/src/features/auth/identity/repository.d.ts +22 -0
  41. package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
  42. package/esm/src/features/auth/identity/repository.js +30 -0
  43. package/esm/src/features/auth/index.d.ts +6 -0
  44. package/esm/src/features/auth/index.d.ts.map +1 -0
  45. package/esm/src/features/auth/index.js +5 -0
  46. package/esm/src/features/auth/manager.d.ts +105 -0
  47. package/esm/src/features/auth/manager.d.ts.map +1 -0
  48. package/esm/src/features/auth/manager.js +181 -0
  49. package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
  50. package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
  51. package/esm/src/features/auth/profile/contract.js +14 -0
  52. package/esm/src/features/auth/profile/repository.d.ts +11 -0
  53. package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
  54. package/esm/src/features/auth/profile/repository.js +25 -0
  55. package/esm/src/features/auth/repository.d.ts +30 -0
  56. package/esm/src/features/auth/repository.d.ts.map +1 -0
  57. package/esm/src/features/auth/repository.js +69 -0
  58. package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
  59. package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
  60. package/esm/src/features/auth/storage/client_store.js +46 -0
  61. package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
  62. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  63. package/esm/src/features/auth/storage/client_token_handler.js +36 -0
  64. package/esm/src/features/auth/storage/server_store.d.ts +24 -0
  65. package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
  66. package/esm/src/features/auth/storage/server_store.js +34 -0
  67. package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
  68. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  69. package/esm/src/features/auth/storage/server_token_handler.js +115 -0
  70. package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
  71. package/esm/src/features/auth/storage/types.d.ts.map +1 -0
  72. package/esm/src/features/auth/storage/types.js +1 -0
  73. package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
  74. package/esm/src/features/contact/contract.d.ts.map +1 -0
  75. package/esm/src/features/contact/contract.js +49 -0
  76. package/esm/src/features/contact/index.d.ts +2 -0
  77. package/esm/src/features/contact/index.d.ts.map +1 -0
  78. package/esm/src/features/contact/index.js +1 -0
  79. package/esm/src/features/contact/repository.d.ts +58 -0
  80. package/esm/src/features/contact/repository.d.ts.map +1 -0
  81. package/esm/src/features/contact/repository.js +108 -0
  82. package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
  83. package/esm/src/features/payout/contract.d.ts.map +1 -0
  84. package/esm/src/features/payout/contract.js +75 -0
  85. package/esm/src/features/payout/index.d.ts +2 -0
  86. package/esm/src/features/payout/index.d.ts.map +1 -0
  87. package/esm/src/features/payout/index.js +1 -0
  88. package/esm/src/features/payout/repository.d.ts +67 -0
  89. package/esm/src/features/payout/repository.d.ts.map +1 -0
  90. package/esm/src/features/payout/repository.js +163 -0
  91. package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
  92. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  93. package/esm/src/features/wallet/contract.js +38 -0
  94. package/esm/src/features/wallet/index.d.ts +2 -0
  95. package/esm/src/features/wallet/index.d.ts.map +1 -0
  96. package/esm/src/features/wallet/index.js +1 -0
  97. package/esm/src/features/wallet/repository.d.ts +57 -0
  98. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  99. package/esm/src/features/wallet/repository.js +93 -0
  100. package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
  101. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact.js +266 -0
  103. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  104. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  105. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  106. package/esm/src/models/contact/index.d.ts +5 -0
  107. package/esm/src/models/contact/index.d.ts.map +1 -0
  108. package/esm/src/models/contact/index.js +4 -0
  109. package/esm/src/models/contact/schemas.d.ts +66 -0
  110. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  111. package/esm/src/models/contact/schemas.js +64 -0
  112. package/esm/src/models/contact/validation.d.ts +37 -0
  113. package/esm/src/models/contact/validation.d.ts.map +1 -0
  114. package/esm/src/models/contact/validation.js +146 -0
  115. package/esm/src/models/index.d.ts +7 -0
  116. package/esm/src/models/index.d.ts.map +1 -0
  117. package/esm/src/models/index.js +6 -0
  118. package/esm/src/models/payout/api.d.ts +29 -0
  119. package/esm/src/models/payout/api.d.ts.map +1 -0
  120. package/esm/src/models/payout/api.js +1 -0
  121. package/esm/src/models/payout/channel.d.ts +58 -0
  122. package/esm/src/models/payout/channel.d.ts.map +1 -0
  123. package/esm/src/models/payout/channel.js +53 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
  125. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  126. package/esm/src/models/payout/derivatives/payout.js +271 -0
  127. package/esm/src/models/payout/index.d.ts +7 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +6 -0
  130. package/esm/src/models/payout/narration.d.ts +164 -0
  131. package/esm/src/models/payout/narration.d.ts.map +1 -0
  132. package/esm/src/models/payout/narration.js +308 -0
  133. package/esm/src/models/payout/schemas.d.ts +156 -0
  134. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  135. package/esm/src/models/payout/schemas.js +105 -0
  136. package/esm/src/models/payout/status.d.ts +33 -0
  137. package/esm/src/models/payout/status.d.ts.map +1 -0
  138. package/esm/src/models/payout/status.js +34 -0
  139. package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
  140. package/esm/src/models/permission.d.ts.map +1 -0
  141. package/esm/src/models/permission.js +50 -0
  142. package/esm/src/models/role.d.ts +21 -0
  143. package/esm/src/models/role.d.ts.map +1 -0
  144. package/esm/src/models/role.js +73 -0
  145. package/esm/src/models/user/authenticated-user.d.ts +77 -0
  146. package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
  147. package/esm/src/models/user/authenticated-user.js +226 -0
  148. package/esm/src/models/user/index.d.ts +4 -0
  149. package/esm/src/models/user/index.d.ts.map +1 -0
  150. package/esm/src/models/user/index.js +3 -0
  151. package/esm/src/models/user/managed-user.d.ts +108 -0
  152. package/esm/src/models/user/managed-user.d.ts.map +1 -0
  153. package/esm/src/models/user/managed-user.js +255 -0
  154. package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
  155. package/esm/src/models/user/profile.d.ts.map +1 -0
  156. package/esm/src/models/user/profile.js +334 -0
  157. package/esm/src/models/wallet/index.d.ts +4 -0
  158. package/esm/src/models/wallet/index.d.ts.map +1 -0
  159. package/esm/src/models/wallet/index.js +3 -0
  160. package/esm/src/models/wallet/schemas.d.ts +95 -0
  161. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  162. package/esm/src/models/wallet/schemas.js +35 -0
  163. package/esm/src/models/wallet/statement_entry.d.ts +160 -0
  164. package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
  165. package/esm/src/models/wallet/statement_entry.js +255 -0
  166. package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
  167. package/esm/src/models/wallet/wallet.d.ts.map +1 -0
  168. package/esm/src/models/wallet/wallet.js +279 -0
  169. package/esm/src/shared/base_repository.d.ts +80 -0
  170. package/esm/src/shared/base_repository.d.ts.map +1 -0
  171. package/esm/src/shared/base_repository.js +153 -0
  172. package/esm/src/shared/common_responses.d.ts +13 -0
  173. package/esm/src/shared/common_responses.d.ts.map +1 -0
  174. package/esm/src/shared/common_responses.js +10 -0
  175. package/esm/src/shared/index.d.ts +3 -0
  176. package/esm/src/shared/index.d.ts.map +1 -0
  177. package/esm/src/shared/index.js +2 -0
  178. package/esm/src/shared/token_required_repository.d.ts +78 -0
  179. package/esm/src/shared/token_required_repository.d.ts.map +1 -0
  180. package/esm/src/shared/token_required_repository.js +128 -0
  181. package/package.json +23 -49
  182. package/script/mod.d.ts +8 -0
  183. package/script/mod.d.ts.map +1 -0
  184. package/script/mod.js +23 -0
  185. package/script/npm/src/mod.d.ts +8 -0
  186. package/script/npm/src/mod.d.ts.map +1 -0
  187. package/script/npm/src/mod.js +23 -0
  188. package/script/npm/src/src/errors/api_error.d.ts +63 -0
  189. package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
  190. package/script/npm/src/src/errors/api_error.js +94 -0
  191. package/script/npm/src/src/errors/index.d.ts +3 -0
  192. package/script/npm/src/src/errors/index.d.ts.map +1 -0
  193. package/script/npm/src/src/errors/index.js +18 -0
  194. package/script/npm/src/src/errors/permission_error.d.ts +48 -0
  195. package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
  196. package/script/npm/src/src/errors/permission_error.js +74 -0
  197. package/script/npm/src/src/features/admin/contract.d.ts +842 -0
  198. package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
  199. package/script/npm/src/src/features/admin/contract.js +213 -0
  200. package/script/npm/src/src/features/admin/index.d.ts +4 -0
  201. package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
  202. package/script/npm/src/src/features/admin/index.js +19 -0
  203. package/script/npm/src/src/features/admin/repository.d.ts +114 -0
  204. package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
  205. package/script/npm/src/src/features/admin/repository.js +252 -0
  206. package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
  207. package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
  208. package/script/npm/src/src/features/admin/schemas.js +209 -0
  209. package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
  210. package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
  211. package/script/npm/src/src/features/auth/access/contract.js +17 -0
  212. package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
  213. package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
  214. package/script/npm/src/src/features/auth/access/repository.js +29 -0
  215. package/script/npm/src/src/features/auth/contract.d.ts +112 -0
  216. package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
  217. package/script/npm/src/src/features/auth/contract.js +46 -0
  218. package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
  219. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
  220. package/script/npm/src/src/features/auth/identity/contract.js +20 -0
  221. package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
  222. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
  223. package/script/npm/src/src/features/auth/identity/repository.js +34 -0
  224. package/script/npm/src/src/features/auth/index.d.ts +6 -0
  225. package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
  226. package/script/npm/src/src/features/auth/index.js +21 -0
  227. package/script/npm/src/src/features/auth/manager.d.ts +105 -0
  228. package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
  229. package/script/npm/src/src/features/auth/manager.js +185 -0
  230. package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
  231. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
  232. package/script/npm/src/src/features/auth/profile/contract.js +17 -0
  233. package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
  234. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
  235. package/script/npm/src/src/features/auth/profile/repository.js +29 -0
  236. package/script/npm/src/src/features/auth/repository.d.ts +30 -0
  237. package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
  238. package/script/npm/src/src/features/auth/repository.js +73 -0
  239. package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
  240. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
  241. package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
  242. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
  243. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  244. package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
  245. package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
  246. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
  247. package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
  248. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
  249. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  250. package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
  251. package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
  252. package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
  253. package/script/npm/src/src/features/auth/storage/types.js +2 -0
  254. package/script/npm/src/src/features/contact/contract.d.ts +170 -0
  255. package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
  256. package/script/npm/src/src/features/contact/contract.js +52 -0
  257. package/script/npm/src/src/features/contact/index.d.ts +2 -0
  258. package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
  259. package/script/npm/src/src/features/contact/index.js +17 -0
  260. package/script/npm/src/src/features/contact/repository.d.ts +58 -0
  261. package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
  262. package/script/npm/src/src/features/contact/repository.js +112 -0
  263. package/script/npm/src/src/features/payout/contract.d.ts +623 -0
  264. package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
  265. package/script/npm/src/src/features/payout/contract.js +78 -0
  266. package/script/npm/src/src/features/payout/index.d.ts +2 -0
  267. package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
  268. package/script/npm/src/src/features/payout/index.js +17 -0
  269. package/script/npm/src/src/features/payout/repository.d.ts +67 -0
  270. package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
  271. package/script/npm/src/src/features/payout/repository.js +167 -0
  272. package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
  273. package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
  274. package/script/npm/src/src/features/wallet/contract.js +41 -0
  275. package/script/npm/src/src/features/wallet/index.d.ts +2 -0
  276. package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
  277. package/script/npm/src/src/features/wallet/index.js +17 -0
  278. package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
  279. package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
  280. package/script/npm/src/src/features/wallet/repository.js +97 -0
  281. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
  282. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
  283. package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
  284. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
  285. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  286. package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
  287. package/script/npm/src/src/models/contact/index.d.ts +5 -0
  288. package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
  289. package/script/npm/src/src/models/contact/index.js +20 -0
  290. package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
  291. package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
  292. package/script/npm/src/src/models/contact/schemas.js +67 -0
  293. package/script/npm/src/src/models/contact/validation.d.ts +37 -0
  294. package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
  295. package/script/npm/src/src/models/contact/validation.js +153 -0
  296. package/script/npm/src/src/models/index.d.ts +7 -0
  297. package/script/npm/src/src/models/index.d.ts.map +1 -0
  298. package/script/npm/src/src/models/index.js +22 -0
  299. package/script/npm/src/src/models/payout/api.d.ts +29 -0
  300. package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
  301. package/script/npm/src/src/models/payout/api.js +2 -0
  302. package/script/npm/src/src/models/payout/channel.d.ts +58 -0
  303. package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
  304. package/script/npm/src/src/models/payout/channel.js +56 -0
  305. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
  306. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
  307. package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
  308. package/script/npm/src/src/models/payout/index.d.ts +7 -0
  309. package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
  310. package/script/npm/src/src/models/payout/index.js +22 -0
  311. package/script/npm/src/src/models/payout/narration.d.ts +164 -0
  312. package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
  313. package/script/npm/src/src/models/payout/narration.js +312 -0
  314. package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
  315. package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
  316. package/script/npm/src/src/models/payout/schemas.js +108 -0
  317. package/script/npm/src/src/models/payout/status.d.ts +33 -0
  318. package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
  319. package/script/npm/src/src/models/payout/status.js +37 -0
  320. package/script/npm/src/src/models/permission.d.ts +55 -0
  321. package/script/npm/src/src/models/permission.d.ts.map +1 -0
  322. package/script/npm/src/src/models/permission.js +53 -0
  323. package/script/npm/src/src/models/role.d.ts +21 -0
  324. package/script/npm/src/src/models/role.d.ts.map +1 -0
  325. package/script/npm/src/src/models/role.js +77 -0
  326. package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
  327. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
  328. package/script/npm/src/src/models/user/authenticated-user.js +230 -0
  329. package/script/npm/src/src/models/user/index.d.ts +4 -0
  330. package/script/npm/src/src/models/user/index.d.ts.map +1 -0
  331. package/script/npm/src/src/models/user/index.js +19 -0
  332. package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
  333. package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
  334. package/script/npm/src/src/models/user/managed-user.js +260 -0
  335. package/script/npm/src/src/models/user/profile.d.ts +161 -0
  336. package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
  337. package/script/npm/src/src/models/user/profile.js +338 -0
  338. package/script/npm/src/src/models/wallet/index.d.ts +4 -0
  339. package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
  340. package/script/npm/src/src/models/wallet/index.js +19 -0
  341. package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
  342. package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
  343. package/script/npm/src/src/models/wallet/schemas.js +38 -0
  344. package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
  345. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
  346. package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
  347. package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
  348. package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
  349. package/script/npm/src/src/models/wallet/wallet.js +283 -0
  350. package/script/npm/src/src/shared/base_repository.d.ts +80 -0
  351. package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
  352. package/script/npm/src/src/shared/base_repository.js +157 -0
  353. package/script/npm/src/src/shared/common_responses.d.ts +13 -0
  354. package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
  355. package/script/npm/src/src/shared/common_responses.js +13 -0
  356. package/script/npm/src/src/shared/index.d.ts +3 -0
  357. package/script/npm/src/src/shared/index.d.ts.map +1 -0
  358. package/script/npm/src/src/shared/index.js +18 -0
  359. package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
  360. package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
  361. package/script/npm/src/src/shared/token_required_repository.js +132 -0
  362. package/script/package.json +3 -0
  363. package/dist/index.cjs.js +0 -2
  364. package/dist/index.cjs.js.map +0 -1
  365. package/dist/index.d.ts +0 -10
  366. package/dist/index.esm.js +0 -2
  367. package/dist/index.esm.js.map +0 -1
  368. package/dist/lib/api/base-repository.d.ts +0 -175
  369. package/dist/lib/api/index.d.ts +0 -1
  370. package/dist/lib/error/error.utils.d.ts +0 -22
  371. package/dist/lib/error/index.d.ts +0 -3
  372. package/dist/lib/query/index.d.ts +0 -4
  373. package/dist/lib/query/pagination/pagination.d.ts +0 -73
  374. package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
  375. package/dist/lib/query/query.builder.d.ts +0 -71
  376. package/dist/lib/query/query.types.d.ts +0 -36
  377. package/dist/modules/auth/auth.manager.d.ts +0 -249
  378. package/dist/modules/auth/auth.repository.d.ts +0 -83
  379. package/dist/modules/auth/auth.store.d.ts +0 -139
  380. package/dist/modules/auth/company-membership.model.d.ts +0 -171
  381. package/dist/modules/auth/index.d.ts +0 -4
  382. package/dist/modules/auth/user.model.d.ts +0 -363
  383. package/dist/modules/contact/contact-info.model.d.ts +0 -485
  384. package/dist/modules/contact/contact-input-handler.d.ts +0 -16
  385. package/dist/modules/contact/contact.dtos.d.ts +0 -84
  386. package/dist/modules/contact/contact.model.d.ts +0 -441
  387. package/dist/modules/contact/contact.repository.d.ts +0 -116
  388. package/dist/modules/contact/index.d.ts +0 -4
  389. package/dist/modules/login/index.d.ts +0 -4
  390. package/dist/modules/login/login.api-contract.d.ts +0 -51
  391. package/dist/modules/login/login.dtos.d.ts +0 -85
  392. package/dist/modules/login/login.model.d.ts +0 -168
  393. package/dist/modules/login/login.repository.d.ts +0 -58
  394. package/dist/modules/payout/index.d.ts +0 -5
  395. package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
  396. package/dist/modules/payout/payout.dtos.d.ts +0 -605
  397. package/dist/modules/payout/payout.model.d.ts +0 -379
  398. package/dist/modules/payout/payout.query.d.ts +0 -133
  399. package/dist/modules/payout/payout.repository.d.ts +0 -181
  400. package/dist/modules/profile/index.d.ts +0 -3
  401. package/dist/modules/profile/profile.dtos.d.ts +0 -80
  402. package/dist/modules/profile/profile.repository.d.ts +0 -56
  403. package/dist/modules/team-member/index.d.ts +0 -4
  404. package/dist/modules/team-member/role.model.d.ts +0 -61
  405. package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
  406. package/dist/modules/team-member/team-member.model.d.ts +0 -237
  407. package/dist/modules/team-member/team-member.repository.d.ts +0 -179
  408. package/dist/modules/wallet/index.d.ts +0 -7
  409. package/dist/modules/wallet/narration.model.d.ts +0 -225
  410. package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
  411. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
  412. package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
  413. package/dist/modules/wallet/wallet.query.d.ts +0 -95
  414. package/dist/modules/wallet/wallet.repository.d.ts +0 -205
  415. package/dist/modules/wallet/wallet.utils.d.ts +0 -17
@@ -0,0 +1,3 @@
1
+ export * from "./profile.js";
2
+ export * from "./authenticated-user.js";
3
+ export * from "./managed-user.js";
@@ -0,0 +1,108 @@
1
+ import { Role, type RoleData } from "../role.js";
2
+ export interface UserEntityData {
3
+ id: string;
4
+ name: string;
5
+ identity: string;
6
+ profileId: string;
7
+ permissions: string[];
8
+ }
9
+ /**
10
+ * Base user entity - represents a user in the system
11
+ */
12
+ export declare class UserEntity {
13
+ readonly id: string;
14
+ readonly name: string;
15
+ readonly identity: string;
16
+ readonly profileId: string;
17
+ readonly permissions: ReadonlySet<string>;
18
+ constructor(data: UserEntityData);
19
+ /**
20
+ * Check if user has a specific permission
21
+ */
22
+ can(permission: string): boolean;
23
+ /**
24
+ * Check if user has any of the specified permissions
25
+ */
26
+ canAny(permissions: string[]): boolean;
27
+ /**
28
+ * Check if user has all of the specified permissions
29
+ */
30
+ canAll(permissions: string[]): boolean;
31
+ }
32
+ export interface AuthenticatedUserData {
33
+ name: string;
34
+ identity: string;
35
+ profileId: string;
36
+ profile: any;
37
+ token: string;
38
+ resetPassword: boolean;
39
+ permissions: string[];
40
+ sessionId?: string;
41
+ expiresAt?: string;
42
+ }
43
+ export interface ManagedUserData {
44
+ id: string;
45
+ name: string;
46
+ identity: string;
47
+ type: string;
48
+ profileId: string;
49
+ roleId: string;
50
+ resetPassword: boolean;
51
+ isActive: boolean;
52
+ isArchived: boolean;
53
+ role?: RoleData;
54
+ createdAt: string;
55
+ updatedAt: string;
56
+ }
57
+ /**
58
+ * Represents a user from the admin management perspective.
59
+ * Same person as AuthenticatedUser but with management metadata and capabilities.
60
+ */
61
+ export declare class ManagedUser extends UserEntity {
62
+ readonly type: string;
63
+ readonly roleId: string;
64
+ readonly resetPassword: boolean;
65
+ readonly isActive: boolean;
66
+ readonly isArchived: boolean;
67
+ readonly role?: Role;
68
+ readonly createdAt: Date;
69
+ readonly updatedAt: Date;
70
+ constructor(data: ManagedUserData);
71
+ /**
72
+ * Check if user account is active
73
+ */
74
+ isAccountActive(): boolean;
75
+ /**
76
+ * Check if user account is archived
77
+ */
78
+ isAccountArchived(): boolean;
79
+ /**
80
+ * Check if user needs to reset password
81
+ */
82
+ needsPasswordReset(): boolean;
83
+ /**
84
+ * Get comprehensive account status
85
+ */
86
+ getAccountStatus(): {
87
+ status: "active" | "inactive" | "archived" | "password_reset_required";
88
+ label: string;
89
+ color: "success" | "warning" | "error" | "default";
90
+ description: string;
91
+ };
92
+ /**
93
+ * Get role display name
94
+ */
95
+ getRoleName(): string;
96
+ /**
97
+ * Get formatted creation date
98
+ */
99
+ getCreatedDate(): string;
100
+ /**
101
+ * Get time since last update
102
+ */
103
+ getLastUpdateInfo(): string;
104
+ static from(data: any): ManagedUser | undefined;
105
+ static createMany(dataArray: any[]): ManagedUser[];
106
+ toJSON(): any;
107
+ }
108
+ //# sourceMappingURL=managed-user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-user.d.ts","sourceRoot":"","sources":["../../../../src/src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,MAAM,IAAI,GAAG;CAgBd"}
@@ -0,0 +1,255 @@
1
+ // deno-lint-ignore-file no-explicit-any
2
+ // ====================== Base User Entity ====================== //
3
+ import { Role } from "../role.js";
4
+ /**
5
+ * Base user entity - represents a user in the system
6
+ */
7
+ export class UserEntity {
8
+ constructor(data) {
9
+ Object.defineProperty(this, "id", {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value: void 0
14
+ });
15
+ Object.defineProperty(this, "name", {
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true,
19
+ value: void 0
20
+ });
21
+ Object.defineProperty(this, "identity", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: void 0
26
+ }); // email or phone
27
+ Object.defineProperty(this, "profileId", {
28
+ enumerable: true,
29
+ configurable: true,
30
+ writable: true,
31
+ value: void 0
32
+ });
33
+ Object.defineProperty(this, "permissions", {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value: void 0
38
+ });
39
+ this.id = data.id;
40
+ this.name = data.name;
41
+ this.identity = data.identity;
42
+ this.profileId = data.profileId;
43
+ this.permissions = new Set(data.permissions);
44
+ }
45
+ /**
46
+ * Check if user has a specific permission
47
+ */
48
+ can(permission) {
49
+ return this.permissions.has(permission);
50
+ }
51
+ /**
52
+ * Check if user has any of the specified permissions
53
+ */
54
+ canAny(permissions) {
55
+ return permissions.some((p) => this.permissions.has(p));
56
+ }
57
+ /**
58
+ * Check if user has all of the specified permissions
59
+ */
60
+ canAll(permissions) {
61
+ return permissions.every((p) => this.permissions.has(p));
62
+ }
63
+ }
64
+ /**
65
+ * Represents a user from the admin management perspective.
66
+ * Same person as AuthenticatedUser but with management metadata and capabilities.
67
+ */
68
+ export class ManagedUser extends UserEntity {
69
+ constructor(data) {
70
+ super({
71
+ id: data.id,
72
+ name: data.name,
73
+ identity: data.identity,
74
+ profileId: data.profileId,
75
+ permissions: data.role?.access ?? [],
76
+ });
77
+ Object.defineProperty(this, "type", {
78
+ enumerable: true,
79
+ configurable: true,
80
+ writable: true,
81
+ value: void 0
82
+ });
83
+ Object.defineProperty(this, "roleId", {
84
+ enumerable: true,
85
+ configurable: true,
86
+ writable: true,
87
+ value: void 0
88
+ });
89
+ Object.defineProperty(this, "resetPassword", {
90
+ enumerable: true,
91
+ configurable: true,
92
+ writable: true,
93
+ value: void 0
94
+ });
95
+ Object.defineProperty(this, "isActive", {
96
+ enumerable: true,
97
+ configurable: true,
98
+ writable: true,
99
+ value: void 0
100
+ });
101
+ Object.defineProperty(this, "isArchived", {
102
+ enumerable: true,
103
+ configurable: true,
104
+ writable: true,
105
+ value: void 0
106
+ });
107
+ Object.defineProperty(this, "role", {
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true,
111
+ value: void 0
112
+ });
113
+ Object.defineProperty(this, "createdAt", {
114
+ enumerable: true,
115
+ configurable: true,
116
+ writable: true,
117
+ value: void 0
118
+ });
119
+ Object.defineProperty(this, "updatedAt", {
120
+ enumerable: true,
121
+ configurable: true,
122
+ writable: true,
123
+ value: void 0
124
+ });
125
+ this.type = data.type;
126
+ this.roleId = data.roleId;
127
+ this.resetPassword = data.resetPassword;
128
+ this.isActive = data.isActive;
129
+ this.isArchived = data.isArchived;
130
+ this.createdAt = new Date(data.createdAt);
131
+ this.updatedAt = new Date(data.updatedAt);
132
+ if (data.role) {
133
+ try {
134
+ this.role = new Role(data.role);
135
+ }
136
+ catch (_) {
137
+ //
138
+ }
139
+ }
140
+ }
141
+ /**
142
+ * Check if user account is active
143
+ */
144
+ isAccountActive() {
145
+ return this.isActive;
146
+ }
147
+ /**
148
+ * Check if user account is archived
149
+ */
150
+ isAccountArchived() {
151
+ return this.isArchived;
152
+ }
153
+ /**
154
+ * Check if user needs to reset password
155
+ */
156
+ needsPasswordReset() {
157
+ return this.resetPassword;
158
+ }
159
+ /**
160
+ * Get comprehensive account status
161
+ */
162
+ getAccountStatus() {
163
+ if (this.isArchived) {
164
+ return {
165
+ status: "archived",
166
+ label: "Archived",
167
+ color: "default",
168
+ description: "Account has been archived and is no longer accessible",
169
+ };
170
+ }
171
+ if (!this.isActive) {
172
+ return {
173
+ status: "inactive",
174
+ label: "Inactive",
175
+ color: "error",
176
+ description: "Account has been deactivated by an administrator",
177
+ };
178
+ }
179
+ if (this.resetPassword) {
180
+ return {
181
+ status: "password_reset_required",
182
+ label: "Password Reset Required",
183
+ color: "warning",
184
+ description: "User must reset their password on next login",
185
+ };
186
+ }
187
+ return {
188
+ status: "active",
189
+ label: "Active",
190
+ color: "success",
191
+ description: "Account is active and ready to use",
192
+ };
193
+ }
194
+ /**
195
+ * Get role display name
196
+ */
197
+ getRoleName() {
198
+ return this.role?.name ?? "";
199
+ }
200
+ /**
201
+ * Get formatted creation date
202
+ */
203
+ getCreatedDate() {
204
+ return this.createdAt.toLocaleDateString();
205
+ }
206
+ /**
207
+ * Get time since last update
208
+ */
209
+ getLastUpdateInfo() {
210
+ const now = new Date();
211
+ const diffMs = now.getTime() - this.updatedAt.getTime();
212
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
213
+ if (diffDays === 0)
214
+ return "Today";
215
+ if (diffDays === 1)
216
+ return "Yesterday";
217
+ if (diffDays < 7)
218
+ return `${diffDays} days ago`;
219
+ if (diffDays < 30)
220
+ return `${Math.floor(diffDays / 7)} weeks ago`;
221
+ return this.updatedAt.toLocaleDateString();
222
+ }
223
+ static from(data) {
224
+ try {
225
+ if (!data?.id || !data?.name || !data?.identity || !data?.roleId) {
226
+ console.error("Missing required ManagedUser fields:", data);
227
+ return undefined;
228
+ }
229
+ return new ManagedUser(data);
230
+ }
231
+ catch (error) {
232
+ console.error("Error creating ManagedUser:", error);
233
+ return undefined;
234
+ }
235
+ }
236
+ static createMany(dataArray) {
237
+ return dataArray.map((data) => ManagedUser.from(data)).filter(Boolean);
238
+ }
239
+ toJSON() {
240
+ return {
241
+ id: this.id,
242
+ name: this.name,
243
+ identity: this.identity,
244
+ type: this.type,
245
+ profileId: this.profileId,
246
+ roleId: this.roleId,
247
+ resetPassword: this.resetPassword,
248
+ isActive: this.isActive,
249
+ isArchived: this.isArchived,
250
+ role: this.role?.toJSON(),
251
+ createdAt: this.createdAt.toISOString(),
252
+ updatedAt: this.updatedAt.toISOString(),
253
+ };
254
+ }
255
+ }
@@ -1,42 +1,38 @@
1
1
  import { z } from "zod";
2
+ import { PhoneNumber } from "@temboplus/frontend-core";
2
3
  /**
3
- * Zod schema for Profile JSON serialization
4
+ * Type definition for profile schema using Zod.
5
+ * This type helper ensures type safety when implementing the actual schema.
4
6
  */
5
- export declare const ProfileJSONSchema: z.ZodObject<{
7
+ type ProfileZodSchemaType = z.ZodObject<{
6
8
  id: z.ZodString;
7
- firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
- lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ firstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
+ lastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
11
  displayName: z.ZodString;
10
- phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
11
13
  accountNo: z.ZodString;
12
- email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
- autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
14
- version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15
- }, "strip", z.ZodTypeAny, {
16
- id: string;
17
- displayName: string;
18
- accountNo: string;
19
- version: string;
20
- firstName?: string | null | undefined;
21
- lastName?: string | null | undefined;
22
- phone?: string | null | undefined;
23
- email?: string | null | undefined;
24
- autoApprove?: boolean | null | undefined;
25
- }, {
26
- id: string;
27
- displayName: string;
28
- accountNo: string;
29
- firstName?: string | null | undefined;
30
- lastName?: string | null | undefined;
31
- phone?: string | null | undefined;
32
- email?: string | null | undefined;
33
- autoApprove?: boolean | null | undefined;
34
- version?: string | undefined;
14
+ email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
15
  }>;
36
16
  /**
37
- * Infer the ProfileJSON type from the schema
17
+ * Zod schema for validating user profile data.
18
+ * Defines validation rules and constraints for each profile field.
19
+ *
20
+ * @const {ProfileType}
21
+ *
22
+ * @property {string} id - Unique identifier for the profile
23
+ * @property {string | null | undefined} firstName - User's first name, can be null or undefined
24
+ * @property {string | null | undefined} lastName - User's last name, can be null or undefined
25
+ * @property {string} displayName - User's display name
26
+ * @property {string | null | undefined} phone - User's contact phone number, can be null or undefined
27
+ * @property {string} accountNo - User's account number
28
+ * @property {string | null | undefined} email - User's email address, can be null or undefined
29
+ */
30
+ export declare const profileSchema: ProfileZodSchemaType;
31
+ /**
32
+ * TypeScript type representing a validated user profile.
33
+ * Use this type for profile instances that have been validated against the schema.
38
34
  */
39
- export type ProfileJSON = z.infer<typeof ProfileJSONSchema>;
35
+ export type ProfileType = z.infer<typeof profileSchema>;
40
36
  /**
41
37
  * Represents a user profile in the system.
42
38
  *
@@ -52,45 +48,16 @@ export declare class Profile {
52
48
  private _lastName?;
53
49
  /** User's display name, can be used for presentation */
54
50
  private _displayName;
55
- /** User's phone number */
51
+ /** User's phone number, stored as a PhoneNumber object */
56
52
  private _phone?;
57
53
  /** User's account number */
58
54
  private _accountNo;
59
55
  /** User's email address */
60
56
  private _email?;
61
- /** Auto-approval setting */
62
- private _autoApprove?;
63
57
  /**
64
58
  * Gets the profile schema used for validation.
65
59
  */
66
- static get schema(): z.ZodObject<{
67
- id: z.ZodString;
68
- firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
- lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
- displayName: z.ZodString;
71
- phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
- accountNo: z.ZodString;
73
- email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
- autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
75
- }, "strip", z.ZodTypeAny, {
76
- id: string;
77
- displayName: string;
78
- accountNo: string;
79
- firstName?: string | null | undefined;
80
- lastName?: string | null | undefined;
81
- phone?: string | null | undefined;
82
- email?: string | null | undefined;
83
- autoApprove?: boolean | null | undefined;
84
- }, {
85
- id: string;
86
- displayName: string;
87
- accountNo: string;
88
- firstName?: string | null | undefined;
89
- lastName?: string | null | undefined;
90
- phone?: string | null | undefined;
91
- email?: string | null | undefined;
92
- autoApprove?: boolean | null | undefined;
93
- }>;
60
+ static get schema(): ProfileZodSchemaType;
94
61
  /**
95
62
  * Creates a new Profile instance with the provided data.
96
63
  *
@@ -112,7 +79,6 @@ export declare class Profile {
112
79
  phone?: string | null;
113
80
  accountNo: string;
114
81
  email?: string | null;
115
- autoApprove?: boolean | null;
116
82
  }): Profile | undefined;
117
83
  /**
118
84
  * Gets the profile's unique identifier.
@@ -133,7 +99,7 @@ export declare class Profile {
133
99
  /**
134
100
  * Gets the user's phone number object.
135
101
  */
136
- get phone(): string | null | undefined;
102
+ get phone(): PhoneNumber | null | undefined;
137
103
  /**
138
104
  * Gets the user's account number.
139
105
  */
@@ -143,20 +109,39 @@ export declare class Profile {
143
109
  */
144
110
  get email(): string | null | undefined;
145
111
  /**
146
- * Gets the auto-approval setting.
112
+ * Gets the user's formatted phone number in international format.
147
113
  */
148
- get autoApprove(): boolean | null | undefined;
114
+ get formattedPhone(): string | null | undefined;
149
115
  /**
150
116
  * Gets the user's name for display purposes.
151
117
  * Returns the display name if it exists, otherwise returns the first and last name combined.
152
118
  */
153
119
  getName(): string;
120
+ /**
121
+ * Creates a plain object representation of the profile for validation or serialization.
122
+ *
123
+ * @returns A plain object matching the ProfileType interface
124
+ */
125
+ toObject(): ProfileType;
126
+ /**
127
+ * Converts the profile to a JSON string.
128
+ *
129
+ * @returns A JSON string representation of the profile
130
+ */
131
+ toJSON(): string;
154
132
  /**
155
133
  * Validates the profile data against the Zod schema.
156
134
  *
157
135
  * @returns True if the profile is valid, false otherwise
158
136
  */
159
137
  validate(): boolean;
138
+ /**
139
+ * Creates a Profile instance from a JSON string.
140
+ *
141
+ * @param jsonString - JSON string containing profile data
142
+ * @returns A new Profile instance, or undefined if parsing failed
143
+ */
144
+ static fromJSON(jsonString: string): Profile | undefined;
160
145
  /**
161
146
  * Creates a Profile instance from a plain object.
162
147
  *
@@ -171,20 +156,6 @@ export declare class Profile {
171
156
  * @returns Type predicate indicating if the object is a valid Profile
172
157
  */
173
158
  static is(obj: unknown): obj is Profile;
174
- /**
175
- * Serializes the Profile instance to a JSON-compatible object
176
- */
177
- toJSON(): ProfileJSON;
178
- /**
179
- * Serializes the Profile instance to a JSON string
180
- */
181
- toJSONString(): string;
182
- /**
183
- * Creates a Profile instance from a JSON-compatible object or string
184
- */
185
- static fromJSON(json: ProfileJSON | string): Profile | undefined;
186
- /**
187
- * Type guard using Zod schema validation
188
- */
189
- static isProfileJSON(obj: unknown): obj is ProfileJSON;
190
159
  }
160
+ export {};
161
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../../src/src/models/user/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,CAAC,CAAC,SAAS,CAAC;IACtC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC;IAChB,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,SAAS,EAAE,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