@temboplus/afloat 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +21 -0
  3. package/esm/_dnt.test_shims.d.ts.map +1 -0
  4. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  8. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  10. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  14. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  17. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  38. package/esm/mod.d.ts +7 -0
  39. package/esm/mod.d.ts.map +1 -0
  40. package/esm/mod.js +6 -0
  41. package/esm/package.json +3 -0
  42. package/esm/src/errors/api_error.d.ts +63 -0
  43. package/esm/src/errors/api_error.d.ts.map +1 -0
  44. package/esm/src/errors/api_error.js +90 -0
  45. package/esm/src/errors/index.d.ts +3 -0
  46. package/esm/src/errors/index.d.ts.map +1 -0
  47. package/esm/src/errors/index.js +2 -0
  48. package/esm/src/errors/permission_error.d.ts +48 -0
  49. package/esm/src/errors/permission_error.d.ts.map +1 -0
  50. package/esm/src/errors/permission_error.js +70 -0
  51. package/esm/src/features/auth/contract.d.ts +123 -0
  52. package/esm/src/features/auth/contract.d.ts.map +1 -0
  53. package/esm/src/features/auth/contract.js +50 -0
  54. package/esm/src/features/auth/index.d.ts +2 -0
  55. package/esm/src/features/auth/index.d.ts.map +1 -0
  56. package/esm/src/features/auth/index.js +1 -0
  57. package/esm/src/features/auth/manager.d.ts +71 -0
  58. package/esm/src/features/auth/manager.d.ts.map +1 -0
  59. package/esm/src/features/auth/manager.js +118 -0
  60. package/esm/src/features/auth/repository.d.ts +30 -0
  61. package/esm/src/features/auth/repository.d.ts.map +1 -0
  62. package/esm/src/features/auth/repository.js +94 -0
  63. package/esm/src/features/contact/contract.d.ts +170 -0
  64. package/esm/src/features/contact/contract.d.ts.map +1 -0
  65. package/esm/src/features/contact/contract.js +49 -0
  66. package/esm/src/features/contact/index.d.ts +2 -0
  67. package/esm/src/features/contact/index.d.ts.map +1 -0
  68. package/esm/src/features/contact/index.js +1 -0
  69. package/esm/src/features/contact/repository.d.ts +47 -0
  70. package/esm/src/features/contact/repository.d.ts.map +1 -0
  71. package/esm/src/features/contact/repository.js +94 -0
  72. package/esm/src/features/files-gen/contract.d.ts +67 -0
  73. package/esm/src/features/files-gen/contract.d.ts.map +1 -0
  74. package/esm/src/features/files-gen/contract.js +40 -0
  75. package/esm/src/features/files-gen/repository.d.ts +47 -0
  76. package/esm/src/features/files-gen/repository.d.ts.map +1 -0
  77. package/esm/src/features/files-gen/repository.js +48 -0
  78. package/esm/src/features/payout/contract.d.ts +623 -0
  79. package/esm/src/features/payout/contract.d.ts.map +1 -0
  80. package/esm/src/features/payout/contract.js +75 -0
  81. package/esm/src/features/payout/index.d.ts +2 -0
  82. package/esm/src/features/payout/index.d.ts.map +1 -0
  83. package/esm/src/features/payout/index.js +1 -0
  84. package/esm/src/features/payout/repository.d.ts +62 -0
  85. package/esm/src/features/payout/repository.d.ts.map +1 -0
  86. package/esm/src/features/payout/repository.js +158 -0
  87. package/esm/src/features/wallet/contract.d.ts +103 -0
  88. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  89. package/esm/src/features/wallet/contract.js +35 -0
  90. package/esm/src/features/wallet/index.d.ts +2 -0
  91. package/esm/src/features/wallet/index.d.ts.map +1 -0
  92. package/esm/src/features/wallet/index.js +1 -0
  93. package/esm/src/features/wallet/repository.d.ts +74 -0
  94. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  95. package/esm/src/features/wallet/repository.js +132 -0
  96. package/esm/src/models/contact/derivatives/contact.d.ts +168 -0
  97. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  98. package/esm/src/models/contact/derivatives/contact.js +260 -0
  99. package/esm/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  100. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  101. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  103. package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  104. package/esm/src/models/contact/index.d.ts +5 -0
  105. package/esm/src/models/contact/index.d.ts.map +1 -0
  106. package/esm/src/models/contact/index.js +4 -0
  107. package/esm/src/models/contact/schemas.d.ts +66 -0
  108. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  109. package/esm/src/models/contact/schemas.js +64 -0
  110. package/esm/src/models/contact/validation.d.ts +37 -0
  111. package/esm/src/models/contact/validation.d.ts.map +1 -0
  112. package/esm/src/models/contact/validation.js +139 -0
  113. package/esm/src/models/contact/validation.test.d.ts.map +1 -0
  114. package/esm/src/models/index.d.ts +6 -0
  115. package/esm/src/models/index.d.ts.map +1 -0
  116. package/esm/src/models/index.js +5 -0
  117. package/esm/src/models/payout/api.d.ts +29 -0
  118. package/esm/src/models/payout/api.d.ts.map +1 -0
  119. package/esm/src/models/payout/api.js +1 -0
  120. package/esm/src/models/payout/channel.d.ts +58 -0
  121. package/esm/src/models/payout/channel.d.ts.map +1 -0
  122. package/esm/src/models/payout/channel.js +46 -0
  123. package/esm/src/models/payout/derivatives/payout.d.ts +156 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  125. package/esm/src/models/payout/derivatives/payout.js +261 -0
  126. package/esm/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  127. package/esm/src/models/payout/index.d.ts +6 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +5 -0
  130. package/esm/src/models/payout/schemas.d.ts +154 -0
  131. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  132. package/esm/src/models/payout/schemas.js +103 -0
  133. package/esm/src/models/payout/status.d.ts +31 -0
  134. package/esm/src/models/payout/status.d.ts.map +1 -0
  135. package/esm/src/models/payout/status.js +32 -0
  136. package/esm/src/models/permission.d.ts +42 -0
  137. package/esm/src/models/permission.d.ts.map +1 -0
  138. package/esm/src/models/permission.js +37 -0
  139. package/esm/src/models/user/index.d.ts +3 -0
  140. package/esm/src/models/user/index.d.ts.map +1 -0
  141. package/esm/src/models/user/index.js +2 -0
  142. package/esm/src/models/user/profile.d.ts +38 -0
  143. package/esm/src/models/user/profile.d.ts.map +1 -0
  144. package/esm/src/models/user/profile.js +25 -0
  145. package/esm/src/models/user/user.d.ts +80 -0
  146. package/esm/src/models/user/user.d.ts.map +1 -0
  147. package/esm/src/models/user/user.js +149 -0
  148. package/esm/src/models/wallet/guards.d.ts +11 -0
  149. package/esm/src/models/wallet/guards.d.ts.map +1 -0
  150. package/esm/src/models/wallet/guards.js +14 -0
  151. package/esm/src/models/wallet/index.d.ts +4 -0
  152. package/esm/src/models/wallet/index.d.ts.map +1 -0
  153. package/esm/src/models/wallet/index.js +3 -0
  154. package/esm/src/models/wallet/schemas.d.ts +50 -0
  155. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  156. package/esm/src/models/wallet/schemas.js +64 -0
  157. package/esm/src/models/wallet/statement.d.ts +27 -0
  158. package/esm/src/models/wallet/statement.d.ts.map +1 -0
  159. package/esm/src/models/wallet/statement.js +13 -0
  160. package/esm/src/shared/base_repository.d.ts +56 -0
  161. package/esm/src/shared/base_repository.d.ts.map +1 -0
  162. package/esm/src/shared/base_repository.js +95 -0
  163. package/esm/src/shared/common_responses.d.ts +13 -0
  164. package/esm/src/shared/common_responses.d.ts.map +1 -0
  165. package/esm/src/shared/common_responses.js +10 -0
  166. package/esm/src/shared/index.d.ts +3 -0
  167. package/esm/src/shared/index.d.ts.map +1 -0
  168. package/esm/src/shared/index.js +2 -0
  169. package/package.json +40 -0
  170. package/script/_dnt.test_shims.d.ts.map +1 -0
  171. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  172. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  173. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  174. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  175. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  176. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  177. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  179. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  180. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  181. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  182. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  183. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  184. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  185. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  187. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  188. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  189. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  191. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  192. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  193. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  194. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  195. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  196. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  197. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  199. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  200. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  201. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  203. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  204. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  205. package/script/mod.d.ts +7 -0
  206. package/script/mod.d.ts.map +1 -0
  207. package/script/mod.js +22 -0
  208. package/script/package.json +3 -0
  209. package/script/src/errors/api_error.d.ts +63 -0
  210. package/script/src/errors/api_error.d.ts.map +1 -0
  211. package/script/src/errors/api_error.js +94 -0
  212. package/script/src/errors/index.d.ts +3 -0
  213. package/script/src/errors/index.d.ts.map +1 -0
  214. package/script/src/errors/index.js +18 -0
  215. package/script/src/errors/permission_error.d.ts +48 -0
  216. package/script/src/errors/permission_error.d.ts.map +1 -0
  217. package/script/src/errors/permission_error.js +74 -0
  218. package/script/src/features/auth/contract.d.ts +123 -0
  219. package/script/src/features/auth/contract.d.ts.map +1 -0
  220. package/script/src/features/auth/contract.js +53 -0
  221. package/script/src/features/auth/index.d.ts +2 -0
  222. package/script/src/features/auth/index.d.ts.map +1 -0
  223. package/script/src/features/auth/index.js +17 -0
  224. package/script/src/features/auth/manager.d.ts +71 -0
  225. package/script/src/features/auth/manager.d.ts.map +1 -0
  226. package/script/src/features/auth/manager.js +122 -0
  227. package/script/src/features/auth/repository.d.ts +30 -0
  228. package/script/src/features/auth/repository.d.ts.map +1 -0
  229. package/script/src/features/auth/repository.js +98 -0
  230. package/script/src/features/contact/contract.d.ts +170 -0
  231. package/script/src/features/contact/contract.d.ts.map +1 -0
  232. package/script/src/features/contact/contract.js +52 -0
  233. package/script/src/features/contact/index.d.ts +2 -0
  234. package/script/src/features/contact/index.d.ts.map +1 -0
  235. package/script/src/features/contact/index.js +17 -0
  236. package/script/src/features/contact/repository.d.ts +47 -0
  237. package/script/src/features/contact/repository.d.ts.map +1 -0
  238. package/script/src/features/contact/repository.js +98 -0
  239. package/script/src/features/files-gen/contract.d.ts +67 -0
  240. package/script/src/features/files-gen/contract.d.ts.map +1 -0
  241. package/script/src/features/files-gen/contract.js +43 -0
  242. package/script/src/features/files-gen/repository.d.ts +47 -0
  243. package/script/src/features/files-gen/repository.d.ts.map +1 -0
  244. package/script/src/features/files-gen/repository.js +52 -0
  245. package/script/src/features/payout/contract.d.ts +623 -0
  246. package/script/src/features/payout/contract.d.ts.map +1 -0
  247. package/script/src/features/payout/contract.js +78 -0
  248. package/script/src/features/payout/index.d.ts +2 -0
  249. package/script/src/features/payout/index.d.ts.map +1 -0
  250. package/script/src/features/payout/index.js +17 -0
  251. package/script/src/features/payout/repository.d.ts +62 -0
  252. package/script/src/features/payout/repository.d.ts.map +1 -0
  253. package/script/src/features/payout/repository.js +162 -0
  254. package/script/src/features/wallet/contract.d.ts +103 -0
  255. package/script/src/features/wallet/contract.d.ts.map +1 -0
  256. package/script/src/features/wallet/contract.js +38 -0
  257. package/script/src/features/wallet/index.d.ts +2 -0
  258. package/script/src/features/wallet/index.d.ts.map +1 -0
  259. package/script/src/features/wallet/index.js +17 -0
  260. package/script/src/features/wallet/repository.d.ts +74 -0
  261. package/script/src/features/wallet/repository.d.ts.map +1 -0
  262. package/script/src/features/wallet/repository.js +136 -0
  263. package/script/src/models/contact/derivatives/contact.d.ts +168 -0
  264. package/script/src/models/contact/derivatives/contact.d.ts.map +1 -0
  265. package/script/src/models/contact/derivatives/contact.js +264 -0
  266. package/script/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  267. package/script/src/models/contact/derivatives/contact_info.d.ts +188 -0
  268. package/script/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  269. package/script/src/models/contact/derivatives/contact_info.js +260 -0
  270. package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  271. package/script/src/models/contact/index.d.ts +5 -0
  272. package/script/src/models/contact/index.d.ts.map +1 -0
  273. package/script/src/models/contact/index.js +20 -0
  274. package/script/src/models/contact/schemas.d.ts +66 -0
  275. package/script/src/models/contact/schemas.d.ts.map +1 -0
  276. package/script/src/models/contact/schemas.js +67 -0
  277. package/script/src/models/contact/validation.d.ts +37 -0
  278. package/script/src/models/contact/validation.d.ts.map +1 -0
  279. package/script/src/models/contact/validation.js +146 -0
  280. package/script/src/models/contact/validation.test.d.ts.map +1 -0
  281. package/script/src/models/index.d.ts +6 -0
  282. package/script/src/models/index.d.ts.map +1 -0
  283. package/script/src/models/index.js +21 -0
  284. package/script/src/models/payout/api.d.ts +29 -0
  285. package/script/src/models/payout/api.d.ts.map +1 -0
  286. package/script/src/models/payout/api.js +2 -0
  287. package/script/src/models/payout/channel.d.ts +58 -0
  288. package/script/src/models/payout/channel.d.ts.map +1 -0
  289. package/script/src/models/payout/channel.js +49 -0
  290. package/script/src/models/payout/derivatives/payout.d.ts +156 -0
  291. package/script/src/models/payout/derivatives/payout.d.ts.map +1 -0
  292. package/script/src/models/payout/derivatives/payout.js +265 -0
  293. package/script/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  294. package/script/src/models/payout/index.d.ts +6 -0
  295. package/script/src/models/payout/index.d.ts.map +1 -0
  296. package/script/src/models/payout/index.js +21 -0
  297. package/script/src/models/payout/schemas.d.ts +154 -0
  298. package/script/src/models/payout/schemas.d.ts.map +1 -0
  299. package/script/src/models/payout/schemas.js +106 -0
  300. package/script/src/models/payout/status.d.ts +31 -0
  301. package/script/src/models/payout/status.d.ts.map +1 -0
  302. package/script/src/models/payout/status.js +35 -0
  303. package/script/src/models/permission.d.ts +42 -0
  304. package/script/src/models/permission.d.ts.map +1 -0
  305. package/script/src/models/permission.js +40 -0
  306. package/script/src/models/user/index.d.ts +3 -0
  307. package/script/src/models/user/index.d.ts.map +1 -0
  308. package/script/src/models/user/index.js +18 -0
  309. package/script/src/models/user/profile.d.ts +38 -0
  310. package/script/src/models/user/profile.d.ts.map +1 -0
  311. package/script/src/models/user/profile.js +28 -0
  312. package/script/src/models/user/user.d.ts +80 -0
  313. package/script/src/models/user/user.d.ts.map +1 -0
  314. package/script/src/models/user/user.js +153 -0
  315. package/script/src/models/wallet/guards.d.ts +11 -0
  316. package/script/src/models/wallet/guards.d.ts.map +1 -0
  317. package/script/src/models/wallet/guards.js +17 -0
  318. package/script/src/models/wallet/index.d.ts +4 -0
  319. package/script/src/models/wallet/index.d.ts.map +1 -0
  320. package/script/src/models/wallet/index.js +19 -0
  321. package/script/src/models/wallet/schemas.d.ts +50 -0
  322. package/script/src/models/wallet/schemas.d.ts.map +1 -0
  323. package/script/src/models/wallet/schemas.js +67 -0
  324. package/script/src/models/wallet/statement.d.ts +27 -0
  325. package/script/src/models/wallet/statement.d.ts.map +1 -0
  326. package/script/src/models/wallet/statement.js +16 -0
  327. package/script/src/shared/base_repository.d.ts +56 -0
  328. package/script/src/shared/base_repository.d.ts.map +1 -0
  329. package/script/src/shared/base_repository.js +99 -0
  330. package/script/src/shared/common_responses.d.ts +13 -0
  331. package/script/src/shared/common_responses.d.ts.map +1 -0
  332. package/script/src/shared/common_responses.js +13 -0
  333. package/script/src/shared/index.d.ts +3 -0
  334. package/script/src/shared/index.d.ts.map +1 -0
  335. package/script/src/shared/index.js +18 -0
@@ -0,0 +1,47 @@
1
+ import { BaseRepository } from "../../shared/base_repository.js";
2
+ import { contract } from "./contract.js";
3
+ import { Contact, type ContactInput } from "../../models/contact/index.js";
4
+ /**
5
+ * Repository class for managing `Contact` data through API interactions.
6
+ * Extends the `BaseRepository` to leverage shared functionality.
7
+ */
8
+ export declare class ContactRepository extends BaseRepository<typeof contract> {
9
+ /**
10
+ * Creates an instance of `ContactRepository` using the contact contract.
11
+ */
12
+ constructor();
13
+ /**
14
+ * Creates a new contact record.
15
+ * @param {ContactInput} input - The data required to create a new contact.
16
+ * @returns {Promise<Contact>} A promise that resolves to the newly created contact.
17
+ * @throws {APIError} If the response status code is not 201.
18
+ */
19
+ create(input: ContactInput): Promise<Contact>;
20
+ /**
21
+ * Updates an existing contact record by ID.
22
+ * @param {string} id - The unique identifier of the contact to edit.
23
+ * @param {ContactInput} input - The data to update the contact with.
24
+ * @returns {Promise<Contact>} A promise that resolves to the updated contact.
25
+ * @throws {APIError} If the response status code is not 200.
26
+ */
27
+ edit(id: string, input: ContactInput): Promise<Contact>;
28
+ /**
29
+ * Deletes a contact record by ID.
30
+ * @param {string} id - The unique identifier of the contact to remove.
31
+ * @returns {Promise<void>} A promise that resolves when the deletion is complete.
32
+ * @throws {APIError} If the response status code is not 200.
33
+ */
34
+ remove(id: string): Promise<void>;
35
+ /**
36
+ * Retrieves all contacts
37
+ * Results are ordered in descending order by default.
38
+ *
39
+ * @returns {Promise<Contact[]>} A promise that resolves to an array of contacts.
40
+ * @throws {APIError} If the response status code is not 200 or the range is invalid.
41
+ * @example
42
+ * const repository = new ContactRepository();
43
+ * repository.getAll().then(contacts => console.log(contacts));
44
+ */
45
+ getAll(): Promise<Contact[]>;
46
+ }
47
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/contact/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,OAAO,EAEP,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAKvC;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IACpE;;OAEG;;IAKH;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAanD;;;;;;OAMG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB7D;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvC;;;;;;;;;OASG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAanC"}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContactRepository = void 0;
4
+ const base_repository_js_1 = require("../../shared/base_repository.js");
5
+ const contract_js_1 = require("./contract.js");
6
+ const index_js_1 = require("../../models/contact/index.js");
7
+ const index_js_2 = require("../auth/index.js");
8
+ const index_js_3 = require("../../models/index.js");
9
+ const index_js_4 = require("../../errors/index.js");
10
+ /**
11
+ * Repository class for managing `Contact` data through API interactions.
12
+ * Extends the `BaseRepository` to leverage shared functionality.
13
+ */
14
+ class ContactRepository extends base_repository_js_1.BaseRepository {
15
+ /**
16
+ * Creates an instance of `ContactRepository` using the contact contract.
17
+ */
18
+ constructor() {
19
+ super("contact", contract_js_1.contract);
20
+ }
21
+ /**
22
+ * Creates a new contact record.
23
+ * @param {ContactInput} input - The data required to create a new contact.
24
+ * @returns {Promise<Contact>} A promise that resolves to the newly created contact.
25
+ * @throws {APIError} If the response status code is not 201.
26
+ */
27
+ async create(input) {
28
+ if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Create)) {
29
+ throw new index_js_4.PermissionError({
30
+ message: "You are not authorized to add contacts.",
31
+ requiredPermissions: [index_js_3.Permissions.Contact.Create],
32
+ });
33
+ }
34
+ const result = await this.client.postContact({ body: input });
35
+ const data = this.handleResponse(result, 201);
36
+ return index_js_1.Contact.create(data);
37
+ }
38
+ /**
39
+ * Updates an existing contact record by ID.
40
+ * @param {string} id - The unique identifier of the contact to edit.
41
+ * @param {ContactInput} input - The data to update the contact with.
42
+ * @returns {Promise<Contact>} A promise that resolves to the updated contact.
43
+ * @throws {APIError} If the response status code is not 200.
44
+ */
45
+ async edit(id, input) {
46
+ if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Update)) {
47
+ throw new index_js_4.PermissionError({
48
+ message: "You are not authorized to update contacts.",
49
+ requiredPermissions: [index_js_3.Permissions.Contact.Update],
50
+ });
51
+ }
52
+ const result = await this.client.editContact({
53
+ params: { id },
54
+ body: input,
55
+ });
56
+ const data = this.handleResponse(result, 200);
57
+ return index_js_1.Contact.create(data);
58
+ }
59
+ /**
60
+ * Deletes a contact record by ID.
61
+ * @param {string} id - The unique identifier of the contact to remove.
62
+ * @returns {Promise<void>} A promise that resolves when the deletion is complete.
63
+ * @throws {APIError} If the response status code is not 200.
64
+ */
65
+ async remove(id) {
66
+ if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Delete)) {
67
+ throw new index_js_4.PermissionError({
68
+ message: "You are not authorized to delete contacts.",
69
+ requiredPermissions: [index_js_3.Permissions.Contact.Delete],
70
+ });
71
+ }
72
+ const result = await this.client.deleteContact({ params: { id } });
73
+ this.handleResponse(result, 200);
74
+ }
75
+ /**
76
+ * Retrieves all contacts
77
+ * Results are ordered in descending order by default.
78
+ *
79
+ * @returns {Promise<Contact[]>} A promise that resolves to an array of contacts.
80
+ * @throws {APIError} If the response status code is not 200 or the range is invalid.
81
+ * @example
82
+ * const repository = new ContactRepository();
83
+ * repository.getAll().then(contacts => console.log(contacts));
84
+ */
85
+ async getAll() {
86
+ if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.List)) {
87
+ throw new index_js_4.PermissionError({
88
+ message: "You are not authorized to view contacts.",
89
+ requiredPermissions: [index_js_3.Permissions.Contact.List],
90
+ });
91
+ }
92
+ const query = { orderByDesc: "createdAt" };
93
+ const result = await this.client.getContacts({ query });
94
+ const data = this.handleResponse(result, 200);
95
+ return index_js_1.Contact.createMany(data);
96
+ }
97
+ }
98
+ exports.ContactRepository = ContactRepository;
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ import { STATEMENT_OUTPUT_TYPE } from "../../models/wallet/index.js";
3
+ export declare const contract: {
4
+ genStatementPDF: {
5
+ method: "POST";
6
+ body: z.ZodObject<{
7
+ end_date: z.ZodDate;
8
+ start_date: z.ZodDate;
9
+ account_no: z.ZodOptional<z.ZodString>;
10
+ return_file_type: z.ZodEnum<[STATEMENT_OUTPUT_TYPE.EXCEL, STATEMENT_OUTPUT_TYPE.PDF]>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ end_date: Date;
13
+ start_date: Date;
14
+ return_file_type: STATEMENT_OUTPUT_TYPE;
15
+ account_no?: string | undefined;
16
+ }, {
17
+ end_date: Date;
18
+ start_date: Date;
19
+ return_file_type: STATEMENT_OUTPUT_TYPE;
20
+ account_no?: string | undefined;
21
+ }>;
22
+ path: "/statement";
23
+ responses: {
24
+ 201: z.ZodObject<{
25
+ file: z.ZodString;
26
+ file_extension: z.ZodString;
27
+ mime_type: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ file: string;
30
+ file_extension: string;
31
+ mime_type: string;
32
+ }, {
33
+ file: string;
34
+ file_extension: string;
35
+ mime_type: string;
36
+ }>;
37
+ 202: z.ZodObject<{
38
+ message: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ message: string;
41
+ }, {
42
+ message: string;
43
+ }>;
44
+ };
45
+ };
46
+ genAccountDetailsPDF: {
47
+ method: "POST";
48
+ body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
49
+ path: "/account_details";
50
+ responses: {
51
+ 201: z.ZodObject<{
52
+ file: z.ZodString;
53
+ file_extension: z.ZodString;
54
+ mime_type: z.ZodString;
55
+ }, "strip", z.ZodTypeAny, {
56
+ file: string;
57
+ file_extension: string;
58
+ mime_type: string;
59
+ }, {
60
+ file: string;
61
+ file_extension: string;
62
+ mime_type: string;
63
+ }>;
64
+ };
65
+ };
66
+ };
67
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/files-gen/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contract = void 0;
4
+ const zod_1 = require("zod");
5
+ const core_1 = require("@ts-rest/core");
6
+ const index_js_1 = require("../../models/wallet/index.js");
7
+ exports.contract = (0, core_1.initContract)().router({
8
+ genStatementPDF: {
9
+ method: "POST",
10
+ path: "/statement",
11
+ body: zod_1.z.object({
12
+ end_date: zod_1.z.date(),
13
+ start_date: zod_1.z.date(),
14
+ account_no: zod_1.z.string().optional(),
15
+ return_file_type: zod_1.z.enum([
16
+ index_js_1.STATEMENT_OUTPUT_TYPE.EXCEL,
17
+ index_js_1.STATEMENT_OUTPUT_TYPE.PDF,
18
+ ]),
19
+ }),
20
+ responses: {
21
+ 201: zod_1.z.object({
22
+ file: zod_1.z.string(),
23
+ file_extension: zod_1.z.string(),
24
+ mime_type: zod_1.z.string(),
25
+ }),
26
+ 202: zod_1.z.object({
27
+ message: zod_1.z.string(),
28
+ }),
29
+ },
30
+ },
31
+ genAccountDetailsPDF: {
32
+ method: "POST",
33
+ path: "/account_details",
34
+ body: zod_1.z.object({}),
35
+ responses: {
36
+ 201: zod_1.z.object({
37
+ file: zod_1.z.string(),
38
+ file_extension: zod_1.z.string(),
39
+ mime_type: zod_1.z.string(),
40
+ }),
41
+ },
42
+ },
43
+ });
@@ -0,0 +1,47 @@
1
+ import { contract } from "./contract.js";
2
+ import { BaseRepository } from "../../shared/index.js";
3
+ import type { ClientInferRequest, ClientInferResponseBody } from "@ts-rest/core";
4
+ import type { StatementFile } from "../../models/wallet/index.js";
5
+ /**
6
+ * Type definition for statement generation input parameters.
7
+ * Inferred from the contract's genStatementPDF endpoint request body.
8
+ * @typedef {ClientInferRequest<typeof contract.genStatementPDF>["body"]} GenStatementInput
9
+ */
10
+ type GenStatementInput = ClientInferRequest<typeof contract.genStatementPDF>["body"];
11
+ /**
12
+ * Type definition for account details response.
13
+ * Inferred from the contract's genAccountDetailsPDF endpoint response body.
14
+ * @typedef {ClientInferResponseBody<typeof contract.genAccountDetailsPDF>} GenAccountDetailsResponse
15
+ */
16
+ type GenAccountDetailsResponse = ClientInferResponseBody<typeof contract.genAccountDetailsPDF>;
17
+ /**
18
+ * Repository class for managing file generation operations including
19
+ * statement PDFs and account details documents.
20
+ * @extends {BaseRepository<typeof contract>}
21
+ */
22
+ export declare class AfloatFilesRepo extends BaseRepository<typeof contract> {
23
+ /**
24
+ * Creates an instance of AfloatFilesRepo initialized with the files generation contract.
25
+ * Configures the repository with the PDF maker service endpoint.
26
+ */
27
+ constructor();
28
+ /**
29
+ * Generates and downloads a statement PDF based on the provided parameters.
30
+ * @param {GenStatementInput} body - The statement generation parameters
31
+ * @param {Date} body.start_date - Start date for the statement period
32
+ * @param {Date} body.end_date - End date for the statement period
33
+ * @param {string} body.return_file_type - Desired file format for the statement
34
+ * @param {string} [body.account_no] - Optional account number to generate statement for
35
+ * @throws {APIError} If the statement generation operation fails
36
+ * @returns {Promise<StatementFile>} The generated statement file
37
+ */
38
+ downloadStatement(body: GenStatementInput): Promise<StatementFile>;
39
+ /**
40
+ * Generates a PDF containing detailed account information.
41
+ * @throws {APIError} If the PDF generation operation fails
42
+ * @returns {Promise<GenAccountDetailsResponse>} The generated account details PDF
43
+ */
44
+ genAccountDetailsPDF(): Promise<GenAccountDetailsResponse>;
45
+ }
46
+ export {};
47
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/files-gen/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;GAIG;AACH,KAAK,iBAAiB,GAAG,kBAAkB,CACzC,OAAO,QAAQ,CAAC,eAAe,CAChC,CAAC,MAAM,CAAC,CAAC;AAEV;;;;GAIG;AACH,KAAK,yBAAyB,GAAG,uBAAuB,CACtD,OAAO,QAAQ,CAAC,oBAAoB,CACrC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAClE;;;OAGG;;IAOH;;;;;;;;;OASG;IACG,iBAAiB,CACrB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,aAAa,CAAC;IAUzB;;;;OAIG;IACG,oBAAoB,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAWjE"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AfloatFilesRepo = void 0;
4
+ const contract_js_1 = require("./contract.js");
5
+ const index_js_1 = require("../../shared/index.js");
6
+ const api_error_js_1 = require("../../errors/api_error.js");
7
+ /**
8
+ * Repository class for managing file generation operations including
9
+ * statement PDFs and account details documents.
10
+ * @extends {BaseRepository<typeof contract>}
11
+ */
12
+ class AfloatFilesRepo extends index_js_1.BaseRepository {
13
+ /**
14
+ * Creates an instance of AfloatFilesRepo initialized with the files generation contract.
15
+ * Configures the repository with the PDF maker service endpoint.
16
+ */
17
+ constructor() {
18
+ super("wallet", contract_js_1.contract, {
19
+ root: "https://api.afloat.money/pdf-maker/afloat",
20
+ });
21
+ }
22
+ /**
23
+ * Generates and downloads a statement PDF based on the provided parameters.
24
+ * @param {GenStatementInput} body - The statement generation parameters
25
+ * @param {Date} body.start_date - Start date for the statement period
26
+ * @param {Date} body.end_date - End date for the statement period
27
+ * @param {string} body.return_file_type - Desired file format for the statement
28
+ * @param {string} [body.account_no] - Optional account number to generate statement for
29
+ * @throws {APIError} If the statement generation operation fails
30
+ * @returns {Promise<StatementFile>} The generated statement file
31
+ */
32
+ async downloadStatement(body) {
33
+ const result = await this.client.genStatementPDF({ body });
34
+ if (result.status === 201) {
35
+ return result.body;
36
+ }
37
+ throw api_error_js_1.APIError.unknown("An error occurred while generating statement PDF");
38
+ }
39
+ /**
40
+ * Generates a PDF containing detailed account information.
41
+ * @throws {APIError} If the PDF generation operation fails
42
+ * @returns {Promise<GenAccountDetailsResponse>} The generated account details PDF
43
+ */
44
+ async genAccountDetailsPDF() {
45
+ const result = await this.client.genAccountDetailsPDF();
46
+ if (result.status === 201) {
47
+ return result.body;
48
+ }
49
+ throw api_error_js_1.APIError.unknown("An error occurred while generating account details PDF");
50
+ }
51
+ }
52
+ exports.AfloatFilesRepo = AfloatFilesRepo;