@artu-ai/compliance-sdk 0.0.5 → 0.2.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 (484) hide show
  1. package/dist/errors/api.d.ts +160 -0
  2. package/dist/errors/api.d.ts.map +1 -0
  3. package/dist/errors/api.js +255 -0
  4. package/dist/errors/base.d.ts +87 -0
  5. package/dist/errors/base.d.ts.map +1 -0
  6. package/dist/errors/base.js +84 -0
  7. package/dist/errors/index.d.ts +32 -0
  8. package/dist/errors/index.d.ts.map +1 -0
  9. package/dist/errors/index.js +35 -0
  10. package/dist/errors/upload.d.ts +109 -0
  11. package/dist/errors/upload.d.ts.map +1 -0
  12. package/dist/errors/upload.js +163 -0
  13. package/dist/errors/validation.d.ts +98 -0
  14. package/dist/errors/validation.d.ts.map +1 -0
  15. package/dist/errors/validation.js +129 -0
  16. package/dist/exports/base.d.ts +12 -0
  17. package/dist/exports/base.d.ts.map +1 -0
  18. package/dist/exports/base.js +21 -0
  19. package/dist/exports/index.d.ts +40 -0
  20. package/dist/exports/index.d.ts.map +1 -0
  21. package/dist/exports/index.js +59 -0
  22. package/dist/{mexico → exports/mexico}/actividad-vulnerable/avi.d.ts +130 -138
  23. package/dist/exports/mexico/actividad-vulnerable/avi.d.ts.map +1 -0
  24. package/dist/exports/mexico/actividad-vulnerable/avi.js +108 -0
  25. package/dist/{mexico → exports/mexico}/actividad-vulnerable/jys.d.ts +147 -158
  26. package/dist/exports/mexico/actividad-vulnerable/jys.d.ts.map +1 -0
  27. package/dist/exports/mexico/actividad-vulnerable/jys.js +115 -0
  28. package/dist/{mexico → exports/mexico}/actividad-vulnerable/tsc.d.ts +118 -129
  29. package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts.map +1 -0
  30. package/dist/exports/mexico/actividad-vulnerable/tsc.js +103 -0
  31. package/dist/exports/mexico/index.d.ts +48 -0
  32. package/dist/exports/mexico/index.d.ts.map +1 -0
  33. package/dist/exports/mexico/index.js +70 -0
  34. package/dist/models/Address.d.ts +118 -0
  35. package/dist/models/Address.d.ts.map +1 -0
  36. package/dist/models/Address.js +187 -0
  37. package/dist/models/BankAccount.d.ts +124 -0
  38. package/dist/models/BankAccount.d.ts.map +1 -0
  39. package/dist/models/BankAccount.js +190 -0
  40. package/dist/models/Client.d.ts +170 -0
  41. package/dist/models/Client.d.ts.map +1 -0
  42. package/dist/models/Client.js +257 -0
  43. package/dist/models/ContactMethod.d.ts +102 -0
  44. package/dist/models/ContactMethod.d.ts.map +1 -0
  45. package/dist/models/ContactMethod.js +152 -0
  46. package/dist/models/Document.d.ts +167 -0
  47. package/dist/models/Document.d.ts.map +1 -0
  48. package/dist/models/Document.js +295 -0
  49. package/dist/models/LinkedClient.d.ts +62 -0
  50. package/dist/models/LinkedClient.d.ts.map +1 -0
  51. package/dist/models/LinkedClient.js +70 -0
  52. package/dist/models/Report.d.ts +98 -0
  53. package/dist/models/Report.d.ts.map +1 -0
  54. package/dist/models/Report.js +156 -0
  55. package/dist/models/ReportItem.d.ts +106 -0
  56. package/dist/models/ReportItem.d.ts.map +1 -0
  57. package/dist/models/ReportItem.js +167 -0
  58. package/dist/models/Transaction.d.ts +108 -0
  59. package/dist/models/Transaction.d.ts.map +1 -0
  60. package/dist/models/Transaction.js +175 -0
  61. package/dist/models/base.d.ts +42 -0
  62. package/dist/models/base.d.ts.map +1 -0
  63. package/dist/models/base.js +51 -0
  64. package/dist/models/index.d.ts +20 -0
  65. package/dist/models/index.d.ts.map +1 -0
  66. package/dist/models/index.js +34 -0
  67. package/dist/models/mex/MexAddress.d.ts +93 -0
  68. package/dist/models/mex/MexAddress.d.ts.map +1 -0
  69. package/dist/models/mex/MexAddress.js +148 -0
  70. package/dist/models/mex/MexBankAccount.d.ts +65 -0
  71. package/dist/models/mex/MexBankAccount.d.ts.map +1 -0
  72. package/dist/models/mex/MexBankAccount.js +90 -0
  73. package/dist/models/mex/MexClient.d.ts +88 -0
  74. package/dist/models/mex/MexClient.d.ts.map +1 -0
  75. package/dist/models/mex/MexClient.js +133 -0
  76. package/dist/models/mex/MexDocument.d.ts +415 -0
  77. package/dist/models/mex/MexDocument.d.ts.map +1 -0
  78. package/dist/models/mex/MexDocument.js +687 -0
  79. package/dist/models/mex/MexReport.d.ts +50 -0
  80. package/dist/models/mex/MexReport.d.ts.map +1 -0
  81. package/dist/models/mex/MexReport.js +73 -0
  82. package/dist/models/mex/MexReportItem.d.ts +39 -0
  83. package/dist/models/mex/MexReportItem.d.ts.map +1 -0
  84. package/dist/models/mex/MexReportItem.js +50 -0
  85. package/dist/models/mex/MexTransaction.d.ts +53 -0
  86. package/dist/models/mex/MexTransaction.d.ts.map +1 -0
  87. package/dist/models/mex/MexTransaction.js +78 -0
  88. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.d.ts +37 -0
  89. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.d.ts.map +1 -0
  90. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.js +46 -0
  91. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts +38 -0
  92. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts.map +1 -0
  93. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.js +39 -0
  94. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts +38 -0
  95. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts.map +1 -0
  96. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.js +39 -0
  97. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.d.ts +29 -0
  98. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.d.ts.map +1 -0
  99. package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.js +37 -0
  100. package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.d.ts +43 -0
  101. package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.d.ts.map +1 -0
  102. package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.js +59 -0
  103. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts +53 -0
  104. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts.map +1 -0
  105. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.js +75 -0
  106. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts +56 -0
  107. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts.map +1 -0
  108. package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.js +63 -0
  109. package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts +67 -0
  110. package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts.map +1 -0
  111. package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.js +136 -0
  112. package/dist/models/mex/actividad-vulnerable/index.d.ts +20 -0
  113. package/dist/models/mex/actividad-vulnerable/index.d.ts.map +1 -0
  114. package/dist/models/mex/actividad-vulnerable/index.js +25 -0
  115. package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.d.ts +39 -0
  116. package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.d.ts.map +1 -0
  117. package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.js +53 -0
  118. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts +53 -0
  119. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts.map +1 -0
  120. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.js +75 -0
  121. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts +56 -0
  122. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts.map +1 -0
  123. package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.js +63 -0
  124. package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.d.ts +85 -0
  125. package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.d.ts.map +1 -0
  126. package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.js +152 -0
  127. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.d.ts +39 -0
  128. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.d.ts.map +1 -0
  129. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.js +53 -0
  130. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts +53 -0
  131. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts.map +1 -0
  132. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.js +75 -0
  133. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts +56 -0
  134. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts.map +1 -0
  135. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.js +63 -0
  136. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.d.ts +53 -0
  137. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.d.ts.map +1 -0
  138. package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.js +82 -0
  139. package/dist/models/mex/index.d.ts +12 -0
  140. package/dist/models/mex/index.d.ts.map +1 -0
  141. package/dist/models/mex/index.js +20 -0
  142. package/dist/models/types.d.ts +81 -0
  143. package/dist/models/types.d.ts.map +1 -0
  144. package/dist/models/types.js +6 -0
  145. package/dist/namespaces/index.d.ts +25 -0
  146. package/dist/namespaces/index.d.ts.map +1 -0
  147. package/dist/namespaces/index.js +27 -0
  148. package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts +322 -0
  149. package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts.map +1 -0
  150. package/dist/namespaces/mexico/actividad-vulnerable/avi/index.js +42 -0
  151. package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts +1361 -0
  152. package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts.map +1 -0
  153. package/dist/namespaces/mexico/actividad-vulnerable/index.js +53 -0
  154. package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts +454 -0
  155. package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts.map +1 -0
  156. package/dist/namespaces/mexico/actividad-vulnerable/jys/index.js +52 -0
  157. package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts +162 -0
  158. package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts.map +1 -0
  159. package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.js +40 -0
  160. package/dist/namespaces/mexico/index.d.ts +2481 -0
  161. package/dist/namespaces/mexico/index.d.ts.map +1 -0
  162. package/dist/namespaces/mexico/index.js +140 -0
  163. package/dist/resources/addresses.d.ts +171 -0
  164. package/dist/resources/addresses.d.ts.map +1 -0
  165. package/dist/resources/addresses.js +208 -0
  166. package/dist/resources/bank-accounts.d.ts +174 -0
  167. package/dist/resources/bank-accounts.d.ts.map +1 -0
  168. package/dist/resources/bank-accounts.js +220 -0
  169. package/dist/resources/base.d.ts +191 -0
  170. package/dist/resources/base.d.ts.map +1 -0
  171. package/dist/resources/base.js +202 -0
  172. package/dist/resources/clients.d.ts +446 -0
  173. package/dist/resources/clients.d.ts.map +1 -0
  174. package/dist/resources/clients.js +448 -0
  175. package/dist/resources/contact-methods.d.ts +176 -0
  176. package/dist/resources/contact-methods.d.ts.map +1 -0
  177. package/dist/resources/contact-methods.js +215 -0
  178. package/dist/resources/documents.d.ts +253 -0
  179. package/dist/resources/documents.d.ts.map +1 -0
  180. package/dist/resources/documents.js +340 -0
  181. package/dist/resources/index.d.ts +23 -0
  182. package/dist/resources/index.d.ts.map +1 -0
  183. package/dist/resources/index.js +25 -0
  184. package/dist/resources/mex/actividad-vulnerable/avi/clients.d.ts +159 -0
  185. package/dist/resources/mex/actividad-vulnerable/avi/clients.d.ts.map +1 -0
  186. package/dist/resources/mex/actividad-vulnerable/avi/clients.js +304 -0
  187. package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts +7 -0
  188. package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts.map +1 -0
  189. package/dist/resources/mex/actividad-vulnerable/avi/index.js +6 -0
  190. package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts +134 -0
  191. package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts.map +1 -0
  192. package/dist/resources/mex/actividad-vulnerable/avi/reports.js +333 -0
  193. package/dist/resources/mex/actividad-vulnerable/avi/transactions.d.ts +83 -0
  194. package/dist/resources/mex/actividad-vulnerable/avi/transactions.d.ts.map +1 -0
  195. package/dist/resources/mex/actividad-vulnerable/avi/transactions.js +239 -0
  196. package/dist/resources/mex/actividad-vulnerable/index.d.ts +7 -0
  197. package/dist/resources/mex/actividad-vulnerable/index.d.ts.map +1 -0
  198. package/dist/resources/mex/actividad-vulnerable/index.js +9 -0
  199. package/dist/resources/mex/actividad-vulnerable/jys/clients.d.ts +112 -0
  200. package/dist/resources/mex/actividad-vulnerable/jys/clients.d.ts.map +1 -0
  201. package/dist/resources/mex/actividad-vulnerable/jys/clients.js +218 -0
  202. package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts +7 -0
  203. package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts.map +1 -0
  204. package/dist/resources/mex/actividad-vulnerable/jys/index.js +6 -0
  205. package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts +110 -0
  206. package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts.map +1 -0
  207. package/dist/resources/mex/actividad-vulnerable/jys/reports.js +309 -0
  208. package/dist/resources/mex/actividad-vulnerable/jys/transactions.d.ts +86 -0
  209. package/dist/resources/mex/actividad-vulnerable/jys/transactions.d.ts.map +1 -0
  210. package/dist/resources/mex/actividad-vulnerable/jys/transactions.js +240 -0
  211. package/dist/resources/mex/actividad-vulnerable/tsc/clients.d.ts +112 -0
  212. package/dist/resources/mex/actividad-vulnerable/tsc/clients.d.ts.map +1 -0
  213. package/dist/resources/mex/actividad-vulnerable/tsc/clients.js +218 -0
  214. package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts +7 -0
  215. package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts.map +1 -0
  216. package/dist/resources/mex/actividad-vulnerable/tsc/index.js +6 -0
  217. package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts +110 -0
  218. package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts.map +1 -0
  219. package/dist/resources/mex/actividad-vulnerable/tsc/reports.js +309 -0
  220. package/dist/resources/mex/actividad-vulnerable/tsc/transactions.d.ts +83 -0
  221. package/dist/resources/mex/actividad-vulnerable/tsc/transactions.d.ts.map +1 -0
  222. package/dist/resources/mex/actividad-vulnerable/tsc/transactions.js +246 -0
  223. package/dist/resources/mex/addresses.d.ts +135 -0
  224. package/dist/resources/mex/addresses.d.ts.map +1 -0
  225. package/dist/resources/mex/addresses.js +313 -0
  226. package/dist/resources/mex/bank-accounts.d.ts +99 -0
  227. package/dist/resources/mex/bank-accounts.d.ts.map +1 -0
  228. package/dist/resources/mex/bank-accounts.js +147 -0
  229. package/dist/resources/mex/clients.d.ts +186 -0
  230. package/dist/resources/mex/clients.d.ts.map +1 -0
  231. package/dist/resources/mex/clients.js +438 -0
  232. package/dist/resources/mex/ebr.d.ts +213 -0
  233. package/dist/resources/mex/ebr.d.ts.map +1 -0
  234. package/dist/resources/mex/ebr.js +417 -0
  235. package/dist/resources/mex/index.d.ts +11 -0
  236. package/dist/resources/mex/index.d.ts.map +1 -0
  237. package/dist/resources/mex/index.js +12 -0
  238. package/dist/resources/mex/reports.d.ts +204 -0
  239. package/dist/resources/mex/reports.d.ts.map +1 -0
  240. package/dist/resources/mex/reports.js +404 -0
  241. package/dist/resources/mex/transactions.d.ts +117 -0
  242. package/dist/resources/mex/transactions.d.ts.map +1 -0
  243. package/dist/resources/mex/transactions.js +259 -0
  244. package/dist/resources/reports.d.ts +217 -0
  245. package/dist/resources/reports.d.ts.map +1 -0
  246. package/dist/resources/reports.js +310 -0
  247. package/dist/resources/transactions.d.ts +142 -0
  248. package/dist/resources/transactions.d.ts.map +1 -0
  249. package/dist/resources/transactions.js +221 -0
  250. package/dist/sdk/ComplianceSDK.d.ts +457 -0
  251. package/dist/sdk/ComplianceSDK.d.ts.map +1 -0
  252. package/dist/sdk/ComplianceSDK.js +520 -0
  253. package/dist/sdk/base.d.ts +17 -0
  254. package/dist/sdk/base.d.ts.map +1 -0
  255. package/dist/sdk/base.js +22 -0
  256. package/dist/sdk/index.d.ts +18 -0
  257. package/dist/sdk/index.d.ts.map +1 -0
  258. package/dist/sdk/index.js +43 -0
  259. package/dist/{ComplianceSDK-CsFkAge8.d.ts → sdk/mex/ComplianceSDK.d.ts} +16 -7
  260. package/dist/sdk/mex/ComplianceSDK.d.ts.map +1 -0
  261. package/dist/{ComplianceSDK-DzmqGCLF.d.cts → sdk/mex/ComplianceSDK.js} +26 -11
  262. package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts +44 -0
  263. package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts.map +1 -0
  264. package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.js +39 -0
  265. package/dist/sdk/mex/actividad-vulnerable/avi/index.d.ts +8 -0
  266. package/dist/sdk/mex/actividad-vulnerable/avi/index.d.ts.map +1 -0
  267. package/dist/sdk/mex/actividad-vulnerable/avi/index.js +9 -0
  268. package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts +35 -0
  269. package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts.map +1 -0
  270. package/dist/sdk/mex/actividad-vulnerable/avi/types.js +19 -0
  271. package/dist/sdk/mex/actividad-vulnerable/index.d.ts +13 -0
  272. package/dist/sdk/mex/actividad-vulnerable/index.d.ts.map +1 -0
  273. package/dist/sdk/mex/actividad-vulnerable/index.js +31 -0
  274. package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts +44 -0
  275. package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts.map +1 -0
  276. package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.js +39 -0
  277. package/dist/sdk/mex/actividad-vulnerable/jys/index.d.ts +8 -0
  278. package/dist/sdk/mex/actividad-vulnerable/jys/index.d.ts.map +1 -0
  279. package/dist/sdk/mex/actividad-vulnerable/jys/index.js +9 -0
  280. package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts +35 -0
  281. package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts.map +1 -0
  282. package/dist/sdk/mex/actividad-vulnerable/jys/types.js +19 -0
  283. package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts +44 -0
  284. package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts.map +1 -0
  285. package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.js +39 -0
  286. package/dist/sdk/mex/actividad-vulnerable/tsc/index.d.ts +8 -0
  287. package/dist/sdk/mex/actividad-vulnerable/tsc/index.d.ts.map +1 -0
  288. package/dist/sdk/mex/actividad-vulnerable/tsc/index.js +9 -0
  289. package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts +35 -0
  290. package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts.map +1 -0
  291. package/dist/sdk/mex/actividad-vulnerable/tsc/types.js +19 -0
  292. package/dist/sdk/mex/index.d.ts +13 -0
  293. package/dist/sdk/mex/index.d.ts.map +1 -0
  294. package/dist/sdk/mex/index.js +38 -0
  295. package/dist/sdk/mex/types.d.ts +57 -0
  296. package/dist/sdk/mex/types.d.ts.map +1 -0
  297. package/dist/sdk/mex/types.js +7 -0
  298. package/dist/sdk/resource-registry.d.ts +118 -0
  299. package/dist/sdk/resource-registry.d.ts.map +1 -0
  300. package/dist/sdk/resource-registry.js +145 -0
  301. package/dist/sdk/sdk-registry.d.ts +59 -0
  302. package/dist/sdk/sdk-registry.d.ts.map +1 -0
  303. package/dist/sdk/sdk-registry.js +82 -0
  304. package/dist/sdk/types.d.ts +209 -0
  305. package/dist/sdk/types.d.ts.map +1 -0
  306. package/dist/sdk/types.js +42 -0
  307. package/dist/utils/environment.d.ts +102 -0
  308. package/dist/utils/environment.d.ts.map +1 -0
  309. package/dist/utils/environment.js +110 -0
  310. package/dist/utils/filters.d.ts +338 -0
  311. package/dist/utils/filters.d.ts.map +1 -0
  312. package/dist/utils/filters.js +373 -0
  313. package/dist/utils/index.d.ts +13 -0
  314. package/dist/utils/index.d.ts.map +1 -0
  315. package/dist/utils/index.js +39 -0
  316. package/dist/utils/pagination.d.ts +85 -0
  317. package/dist/utils/pagination.d.ts.map +1 -0
  318. package/dist/utils/pagination.js +120 -0
  319. package/dist/utils/session.d.ts +155 -0
  320. package/dist/utils/session.d.ts.map +1 -0
  321. package/dist/utils/session.js +50 -0
  322. package/dist/utils/trpc-client.d.ts +19337 -0
  323. package/dist/utils/trpc-client.d.ts.map +1 -0
  324. package/dist/utils/trpc-client.js +128 -0
  325. package/package.json +16 -27
  326. package/src/errors/api.ts +305 -0
  327. package/src/errors/base.ts +127 -0
  328. package/src/errors/index.ts +63 -0
  329. package/src/errors/upload.ts +204 -0
  330. package/src/errors/validation.ts +163 -0
  331. package/src/exports/base.ts +139 -0
  332. package/src/exports/index.ts +187 -0
  333. package/src/exports/mexico/actividad-vulnerable/avi.ts +207 -0
  334. package/src/exports/mexico/actividad-vulnerable/jys.ts +214 -0
  335. package/src/exports/mexico/actividad-vulnerable/tsc.ts +202 -0
  336. package/src/exports/mexico/index.ts +215 -0
  337. package/src/models/Address.ts +235 -0
  338. package/src/models/BankAccount.ts +235 -0
  339. package/src/models/Client.ts +343 -0
  340. package/src/models/ContactMethod.ts +197 -0
  341. package/src/models/Document.ts +355 -0
  342. package/src/models/LinkedClient.ts +84 -0
  343. package/src/models/Report.ts +193 -0
  344. package/src/models/ReportItem.ts +211 -0
  345. package/src/models/Transaction.ts +219 -0
  346. package/src/models/base.ts +56 -0
  347. package/src/models/index.ts +148 -0
  348. package/src/models/mex/MexAddress.ts +184 -0
  349. package/src/models/mex/MexBankAccount.ts +121 -0
  350. package/src/models/mex/MexClient.ts +177 -0
  351. package/src/models/mex/MexDocument.ts +890 -0
  352. package/src/models/mex/MexReport.ts +99 -0
  353. package/src/models/mex/MexReportItem.ts +79 -0
  354. package/src/models/mex/MexTransaction.ts +105 -0
  355. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableClient.ts +66 -0
  356. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReport.ts +73 -0
  357. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.ts +74 -0
  358. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.ts +50 -0
  359. package/src/models/mex/actividad-vulnerable/avi/MexAVIClient.ts +80 -0
  360. package/src/models/mex/actividad-vulnerable/avi/MexAVIReport.ts +114 -0
  361. package/src/models/mex/actividad-vulnerable/avi/MexAVIReportItem.ts +105 -0
  362. package/src/models/mex/actividad-vulnerable/avi/MexAVITransaction.ts +157 -0
  363. package/src/models/mex/actividad-vulnerable/index.ts +78 -0
  364. package/src/models/mex/actividad-vulnerable/jys/MexJYSClient.ts +73 -0
  365. package/src/models/mex/actividad-vulnerable/jys/MexJYSReport.ts +114 -0
  366. package/src/models/mex/actividad-vulnerable/jys/MexJYSReportItem.ts +105 -0
  367. package/src/models/mex/actividad-vulnerable/jys/MexJYSTransaction.ts +178 -0
  368. package/src/models/mex/actividad-vulnerable/tsc/MexTSCClient.ts +73 -0
  369. package/src/models/mex/actividad-vulnerable/tsc/MexTSCReport.ts +114 -0
  370. package/src/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.ts +105 -0
  371. package/src/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.ts +104 -0
  372. package/src/models/mex/index.ts +57 -0
  373. package/src/models/types.ts +196 -0
  374. package/src/namespaces/index.ts +29 -0
  375. package/src/namespaces/mexico/actividad-vulnerable/avi/index.ts +62 -0
  376. package/src/namespaces/mexico/actividad-vulnerable/index.ts +79 -0
  377. package/src/namespaces/mexico/actividad-vulnerable/jys/index.ts +72 -0
  378. package/src/namespaces/mexico/actividad-vulnerable/tsc/index.ts +60 -0
  379. package/src/namespaces/mexico/index.ts +325 -0
  380. package/src/resources/addresses.ts +387 -0
  381. package/src/resources/bank-accounts.ts +413 -0
  382. package/src/resources/base.ts +322 -0
  383. package/src/resources/clients.ts +802 -0
  384. package/src/resources/contact-methods.ts +410 -0
  385. package/src/resources/documents.ts +508 -0
  386. package/src/resources/index.ts +35 -0
  387. package/src/resources/mex/actividad-vulnerable/avi/clients.ts +537 -0
  388. package/src/resources/mex/actividad-vulnerable/avi/index.ts +7 -0
  389. package/src/resources/mex/actividad-vulnerable/avi/reports.ts +513 -0
  390. package/src/resources/mex/actividad-vulnerable/avi/transactions.ts +386 -0
  391. package/src/resources/mex/actividad-vulnerable/index.ts +12 -0
  392. package/src/resources/mex/actividad-vulnerable/jys/clients.ts +427 -0
  393. package/src/resources/mex/actividad-vulnerable/jys/index.ts +7 -0
  394. package/src/resources/mex/actividad-vulnerable/jys/reports.ts +489 -0
  395. package/src/resources/mex/actividad-vulnerable/jys/transactions.ts +377 -0
  396. package/src/resources/mex/actividad-vulnerable/tsc/clients.ts +427 -0
  397. package/src/resources/mex/actividad-vulnerable/tsc/index.ts +7 -0
  398. package/src/resources/mex/actividad-vulnerable/tsc/reports.ts +489 -0
  399. package/src/resources/mex/actividad-vulnerable/tsc/transactions.ts +386 -0
  400. package/src/resources/mex/addresses.ts +471 -0
  401. package/src/resources/mex/bank-accounts.ts +259 -0
  402. package/src/resources/mex/clients.ts +735 -0
  403. package/src/resources/mex/ebr.ts +621 -0
  404. package/src/resources/mex/index.ts +23 -0
  405. package/src/resources/mex/reports.ts +575 -0
  406. package/src/resources/mex/transactions.ts +400 -0
  407. package/src/resources/reports.ts +493 -0
  408. package/src/resources/transactions.ts +354 -0
  409. package/src/sdk/ComplianceSDK.ts +797 -0
  410. package/src/sdk/base.ts +43 -0
  411. package/src/sdk/index.ts +98 -0
  412. package/src/sdk/mex/ComplianceSDK.ts +140 -0
  413. package/src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts +51 -0
  414. package/src/sdk/mex/actividad-vulnerable/avi/index.ts +16 -0
  415. package/src/sdk/mex/actividad-vulnerable/avi/types.ts +72 -0
  416. package/src/sdk/mex/actividad-vulnerable/index.ts +58 -0
  417. package/src/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.ts +51 -0
  418. package/src/sdk/mex/actividad-vulnerable/jys/index.ts +16 -0
  419. package/src/sdk/mex/actividad-vulnerable/jys/types.ts +72 -0
  420. package/src/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.ts +51 -0
  421. package/src/sdk/mex/actividad-vulnerable/tsc/index.ts +16 -0
  422. package/src/sdk/mex/actividad-vulnerable/tsc/types.ts +72 -0
  423. package/src/sdk/mex/index.ts +66 -0
  424. package/src/sdk/mex/types.ts +84 -0
  425. package/src/sdk/resource-registry.ts +204 -0
  426. package/src/sdk/sdk-registry.ts +99 -0
  427. package/src/sdk/types.ts +275 -0
  428. package/src/utils/environment.ts +145 -0
  429. package/src/utils/filters.ts +412 -0
  430. package/src/utils/index.ts +115 -0
  431. package/src/utils/pagination.ts +143 -0
  432. package/src/utils/session.ts +273 -0
  433. package/src/utils/trpc-client.ts +233 -0
  434. package/dist/chunk-C4Y56E4V.js +0 -23
  435. package/dist/chunk-C4Y56E4V.js.map +0 -1
  436. package/dist/chunk-E36XEOE2.js +0 -22558
  437. package/dist/chunk-E36XEOE2.js.map +0 -1
  438. package/dist/chunk-EO7ANPLK.cjs +0 -26
  439. package/dist/chunk-EO7ANPLK.cjs.map +0 -1
  440. package/dist/chunk-F5LRN233.cjs +0 -26
  441. package/dist/chunk-F5LRN233.cjs.map +0 -1
  442. package/dist/chunk-IS3YJ7Y5.cjs +0 -26
  443. package/dist/chunk-IS3YJ7Y5.cjs.map +0 -1
  444. package/dist/chunk-MNPRPINS.js +0 -23
  445. package/dist/chunk-MNPRPINS.js.map +0 -1
  446. package/dist/chunk-NQWTMQQL.js +0 -249
  447. package/dist/chunk-NQWTMQQL.js.map +0 -1
  448. package/dist/chunk-Q3J7CQWL.js +0 -23
  449. package/dist/chunk-Q3J7CQWL.js.map +0 -1
  450. package/dist/chunk-U3W5OO7I.cjs +0 -22711
  451. package/dist/chunk-U3W5OO7I.cjs.map +0 -1
  452. package/dist/chunk-UVM75OVG.cjs +0 -261
  453. package/dist/chunk-UVM75OVG.cjs.map +0 -1
  454. package/dist/filters-CEVr2pEJ.d.cts +0 -6368
  455. package/dist/filters-CEVr2pEJ.d.ts +0 -6368
  456. package/dist/index-CWAflRhP.d.ts +0 -2866
  457. package/dist/index-FBXIzHa9.d.cts +0 -2866
  458. package/dist/index.cjs +0 -417
  459. package/dist/index.cjs.map +0 -1
  460. package/dist/index.d.cts +0 -9
  461. package/dist/index.d.ts +0 -9
  462. package/dist/index.js +0 -28
  463. package/dist/index.js.map +0 -1
  464. package/dist/mexico/actividad-vulnerable/avi.cjs +0 -320
  465. package/dist/mexico/actividad-vulnerable/avi.cjs.map +0 -1
  466. package/dist/mexico/actividad-vulnerable/avi.d.cts +0 -680
  467. package/dist/mexico/actividad-vulnerable/avi.js +0 -55
  468. package/dist/mexico/actividad-vulnerable/avi.js.map +0 -1
  469. package/dist/mexico/actividad-vulnerable/jys.cjs +0 -330
  470. package/dist/mexico/actividad-vulnerable/jys.cjs.map +0 -1
  471. package/dist/mexico/actividad-vulnerable/jys.d.cts +0 -746
  472. package/dist/mexico/actividad-vulnerable/jys.js +0 -65
  473. package/dist/mexico/actividad-vulnerable/jys.js.map +0 -1
  474. package/dist/mexico/actividad-vulnerable/tsc.cjs +0 -318
  475. package/dist/mexico/actividad-vulnerable/tsc.cjs.map +0 -1
  476. package/dist/mexico/actividad-vulnerable/tsc.d.cts +0 -600
  477. package/dist/mexico/actividad-vulnerable/tsc.js +0 -53
  478. package/dist/mexico/actividad-vulnerable/tsc.js.map +0 -1
  479. package/dist/mexico/index.cjs +0 -384
  480. package/dist/mexico/index.cjs.map +0 -1
  481. package/dist/mexico/index.d.cts +0 -1422
  482. package/dist/mexico/index.d.ts +0 -1422
  483. package/dist/mexico/index.js +0 -7
  484. package/dist/mexico/index.js.map +0 -1
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Reports Resource
3
+ *
4
+ * CRUD operations, report items management, validation, and generation.
5
+ *
6
+ * This is the base (unscoped) resource. For jurisdiction-scoped SDKs, use:
7
+ * - MexReportsResource - Mexico-scoped with flattened MX fields
8
+ * - AVIReportsResource - Mexico AVI-scoped with flattened AVI fields
9
+ * - JYSReportsResource - Mexico JYS-scoped with flattened JYS fields
10
+ * - TSCReportsResource - Mexico TSC-scoped with flattened TSC fields
11
+ */
12
+ import { z } from "zod";
13
+ import { createReportInputSchema, updateReportInputSchema, createReportItemInputSchema, updateReportItemInputSchema, validateReportInputSchema, submitReportInputSchema, } from "@artu-ai/shared";
14
+ import { BaseResource } from "./base";
15
+ import { Report, ReportItem, } from "../models";
16
+ // ===========================
17
+ // ReportsResource
18
+ // ===========================
19
+ /**
20
+ * Base resource manager for report operations.
21
+ *
22
+ * Provides:
23
+ * - CRUD operations (create, retrieve, update, delete)
24
+ * - Report items management (add, update, remove items)
25
+ * - Validation and generation
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Create a report with full nested format
30
+ * const report = await sdk.reports.create({
31
+ * jurisdictions: {
32
+ * MX: {
33
+ * actividadVulnerable: {
34
+ * AVI: { mesReportado: "202401" }
35
+ * }
36
+ * }
37
+ * }
38
+ * });
39
+ *
40
+ * // Add items to the report
41
+ * await sdk.reports.addItem(report.id, {
42
+ * transactionId: "txn_123",
43
+ * });
44
+ *
45
+ * // Validate the report
46
+ * const result = await sdk.reports.validate(report.id);
47
+ * if (result.valid) {
48
+ * // Generate XML
49
+ * const xml = await sdk.reports.generate(report.id);
50
+ * }
51
+ * ```
52
+ */
53
+ export class ReportsResource extends BaseResource {
54
+ // ─────────────────────────────────────────────────────────────────
55
+ // Report CRUD
56
+ // ─────────────────────────────────────────────────────────────────
57
+ /**
58
+ * Creates a new report.
59
+ *
60
+ * @param data - Report creation data in nested format
61
+ * @returns The created report model
62
+ */
63
+ async create(data) {
64
+ const validated = this.validate(createReportInputSchema, data);
65
+ const response = await this.execute(() => this.trpc.reports.create.mutate(validated));
66
+ return this.instantiate(response);
67
+ }
68
+ /**
69
+ * Retrieves a report by ID.
70
+ */
71
+ async retrieve(id) {
72
+ const response = await this.execute(() => this.trpc.reports.retrieve.query({ id }));
73
+ return this.instantiate(response);
74
+ }
75
+ /**
76
+ * Retrieves a report by metadata key/value.
77
+ */
78
+ async retrieveByMetadata(key, value) {
79
+ const response = await this.execute(() => this.trpc.reports.retrieveByMetadata.query({ key, value }));
80
+ return this.instantiate(response);
81
+ }
82
+ /**
83
+ * Retrieves a report by externalId.
84
+ */
85
+ async retrieveByExternalId(externalId) {
86
+ const response = await this.execute(() => this.trpc.reports.retrieveByExternalId.query({ externalId }));
87
+ return this.instantiate(response);
88
+ }
89
+ /**
90
+ * Updates a report.
91
+ */
92
+ async update(id, data) {
93
+ const validated = this.validate(updateReportInputSchema, data);
94
+ const response = await this.execute(() => this.trpc.reports.update.mutate({ id, data: validated }));
95
+ return this.instantiate(response);
96
+ }
97
+ /**
98
+ * Deletes a report.
99
+ */
100
+ async delete(id) {
101
+ await this.execute(() => this.trpc.reports.delete.mutate({ id }));
102
+ }
103
+ /**
104
+ * Lists reports with optional filtering and pagination.
105
+ */
106
+ async list(options) {
107
+ const response = await this.execute(() => this.trpc.reports.list.query(options));
108
+ return {
109
+ data: response.data.map((r) => this.instantiate(r)),
110
+ pagination: response.pagination,
111
+ };
112
+ }
113
+ /**
114
+ * Returns an async iterator over all reports matching the filter.
115
+ */
116
+ iterate(filter) {
117
+ return this.createIterator({ filter });
118
+ }
119
+ // ─────────────────────────────────────────────────────────────────
120
+ // Report Items
121
+ // ─────────────────────────────────────────────────────────────────
122
+ /**
123
+ * Adds an item to a report.
124
+ */
125
+ async addItem(reportId, data) {
126
+ const validated = this.validate(createReportItemInputSchema, data);
127
+ const response = await this.execute(() => this.trpc.reports.addItem.mutate({ reportId, data: validated }));
128
+ return this.instantiateItem(response);
129
+ }
130
+ /**
131
+ * Gets a specific report item.
132
+ */
133
+ async getItem(reportId, itemId) {
134
+ const response = await this.execute(() => this.trpc.reports.getItem.query({ reportId, itemId }));
135
+ return this.instantiateItem(response);
136
+ }
137
+ /**
138
+ * Updates a report item.
139
+ */
140
+ async updateItem(reportId, itemId, data) {
141
+ const validated = this.validate(updateReportItemInputSchema, data);
142
+ const response = await this.execute(() => this.trpc.reports.updateItem.mutate({ reportId, itemId, data: validated }));
143
+ return this.instantiateItem(response);
144
+ }
145
+ /**
146
+ * Removes an item from a report.
147
+ */
148
+ async removeItem(reportId, itemId) {
149
+ await this.execute(() => this.trpc.reports.removeItem.mutate({ reportId, itemId }));
150
+ }
151
+ /**
152
+ * Lists items in a report.
153
+ */
154
+ async listItems(reportId, options) {
155
+ const response = await this.execute(() => this.trpc.reports.listItems.query({
156
+ reportId,
157
+ ...options,
158
+ }));
159
+ return {
160
+ data: response.data.map((i) => this.instantiateItem(i)),
161
+ pagination: response.pagination,
162
+ };
163
+ }
164
+ /**
165
+ * Adds multiple items to a report.
166
+ * Validates all items upfront - fails fast if any item is invalid.
167
+ */
168
+ async addItems(reportId, items) {
169
+ const validated = this.validate(z.array(createReportItemInputSchema), items);
170
+ const response = await this.execute(() => this.trpc.reports.addItems.mutate({ reportId, items: validated }));
171
+ return {
172
+ added: response.added,
173
+ items: response.items.map((i) => this.instantiateItem(i)),
174
+ };
175
+ }
176
+ /**
177
+ * Removes multiple items from a report.
178
+ */
179
+ async removeItems(reportId, itemIds) {
180
+ return this.execute(() => this.trpc.reports.removeItems.mutate({ reportId, itemIds }));
181
+ }
182
+ // ─────────────────────────────────────────────────────────────────
183
+ // Validation & Generation
184
+ // ─────────────────────────────────────────────────────────────────
185
+ /**
186
+ * Validates a report and its items.
187
+ *
188
+ * Requires jurisdiction and activity-specific defaults.
189
+ * For scoped SDKs, use the scoped resource which provides a simpler API.
190
+ *
191
+ * @example
192
+ * ```typescript
193
+ * const result = await sdk.reports.validateReport({
194
+ * reportId: report.id,
195
+ * jurisdiction: "MX",
196
+ * actividadVulnerable: "AVI",
197
+ * defaults: {
198
+ * rfc: "ABC200101XXX",
199
+ * platformDomain: "https://example.com",
200
+ * },
201
+ * });
202
+ * ```
203
+ */
204
+ async validateReport(input) {
205
+ const validated = this.validate(validateReportInputSchema, input);
206
+ return this.execute(() => this.trpc.reports.validate.mutate(validated));
207
+ }
208
+ /**
209
+ * Generates the report output (e.g., XML for Mexico reports).
210
+ *
211
+ * Requires the same input as validateReport since generation uses
212
+ * the same transformation and defaults.
213
+ *
214
+ * @example
215
+ * ```typescript
216
+ * const result = await sdk.reports.generate({
217
+ * reportId: report.id,
218
+ * jurisdiction: "MX",
219
+ * actividadVulnerable: "AVI",
220
+ * defaults: {
221
+ * rfc: "ABC200101XXX",
222
+ * platformDomain: "https://example.com",
223
+ * },
224
+ * });
225
+ * ```
226
+ */
227
+ async generate(input) {
228
+ const validated = this.validate(validateReportInputSchema, input);
229
+ return this.execute(() => this.trpc.reports.generate.mutate(validated));
230
+ }
231
+ // ─────────────────────────────────────────────────────────────────
232
+ // Submission
233
+ // ─────────────────────────────────────────────────────────────────
234
+ /**
235
+ * Submits a validated report.
236
+ *
237
+ * The report must be in "valid" status. After submission, the report
238
+ * is locked and cannot be edited.
239
+ *
240
+ * @param reportId - The report ID
241
+ * @param input - Submission data with jurisdiction-specific structure
242
+ */
243
+ async submit(input) {
244
+ const validated = this.validate(submitReportInputSchema, input);
245
+ return this.execute(() => this.trpc.reports.submit.mutate(validated));
246
+ }
247
+ async createMany(reports, options = {}) {
248
+ const atomic = options.atomic ?? true;
249
+ const validated = this.validate(z.array(createReportInputSchema), reports);
250
+ const response = await this.execute(() => this.trpc.reports.createMany.mutate({ items: validated, atomic }));
251
+ if (response.atomic) {
252
+ return {
253
+ atomic: true,
254
+ data: response.data.map((r) => this.instantiate(r)),
255
+ };
256
+ }
257
+ else {
258
+ return {
259
+ atomic: false,
260
+ succeeded: response.succeeded.map((item) => ({
261
+ index: item.index,
262
+ data: this.instantiate(item.data),
263
+ })),
264
+ failed: response.failed,
265
+ };
266
+ }
267
+ }
268
+ async updateMany(updates, options = {}) {
269
+ const atomic = options.atomic ?? true;
270
+ const updateItemSchema = z.object({
271
+ id: z.uuid(),
272
+ data: updateReportInputSchema,
273
+ });
274
+ const validated = this.validate(z.array(updateItemSchema), updates);
275
+ const response = await this.execute(() => this.trpc.reports.updateMany.mutate({ items: validated, atomic }));
276
+ if (response.atomic) {
277
+ return {
278
+ atomic: true,
279
+ data: response.data.map((r) => this.instantiate(r)),
280
+ };
281
+ }
282
+ else {
283
+ return {
284
+ atomic: false,
285
+ succeeded: response.succeeded.map((item) => ({
286
+ index: item.index,
287
+ data: this.instantiate(item.data),
288
+ })),
289
+ failed: response.failed,
290
+ };
291
+ }
292
+ }
293
+ // ─────────────────────────────────────────────────────────────────
294
+ // Instantiation (protected for subclasses to override)
295
+ // ─────────────────────────────────────────────────────────────────
296
+ /**
297
+ * Instantiates a Report model from API response data.
298
+ * Subclasses override this to return their specific model type.
299
+ */
300
+ instantiate(data) {
301
+ return new Report(data);
302
+ }
303
+ /**
304
+ * Instantiates a ReportItem model from API response data.
305
+ * Subclasses override this to return their specific model type.
306
+ */
307
+ instantiateItem(data) {
308
+ return new ReportItem(data);
309
+ }
310
+ }
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Transactions Resource
3
+ *
4
+ * CRUD operations, filtering, pagination, and client relationships.
5
+ *
6
+ * This is the base (unscoped) resource. For jurisdiction-scoped SDKs, use:
7
+ * - MexTransactionsResource - Mexico-scoped with flattened MX fields
8
+ * - AVITransactionsResource - Mexico AVI-scoped with flattened AVI fields
9
+ * - JYSTransactionsResource - Mexico JYS-scoped with flattened JYS fields
10
+ * - TSCTransactionsResource - Mexico TSC-scoped with flattened TSC fields
11
+ */
12
+ import type { CreateTransactionInput, UpdateTransactionInput, TransactionFilter, ListOptions, PaginatedResponse, AtomicBatchResult, PartialBatchResult, RelatedClient } from "@artu-ai/shared";
13
+ import { ClientRole } from "@artu-ai/shared";
14
+ import { BaseResource } from "./base";
15
+ import { Transaction, type TransactionData } from "../models";
16
+ /**
17
+ * Base resource manager for transaction operations.
18
+ *
19
+ * Provides:
20
+ * - CRUD operations (create, retrieve, update, delete)
21
+ * - Filtering and pagination
22
+ * - Client relationship management (linkClient, unlinkClient)
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Create a transaction with full nested format
27
+ * const txn = await sdk.transactions.create({
28
+ * amount: 50000,
29
+ * currency: "MXN",
30
+ * primaryJurisdiction: "MX",
31
+ * relatedClientIds: ["client_sender"],
32
+ * timestamp: new Date(),
33
+ * jurisdictions: {
34
+ * MX: { actividadVulnerable: { AVI: { ... } } },
35
+ * },
36
+ * });
37
+ *
38
+ * // List with filtering
39
+ * const { data, pagination } = await sdk.transactions.list({
40
+ * filter: { status: "completed" },
41
+ * limit: 20,
42
+ * });
43
+ * ```
44
+ */
45
+ export declare class TransactionsResource extends BaseResource<Transaction, CreateTransactionInput, UpdateTransactionInput, TransactionFilter> {
46
+ /**
47
+ * Creates a new transaction.
48
+ *
49
+ * @param data - Transaction creation data in nested format
50
+ * @returns The created transaction model
51
+ */
52
+ create(data: CreateTransactionInput): Promise<Transaction>;
53
+ /**
54
+ * Retrieves a transaction by ID.
55
+ */
56
+ retrieve(id: string): Promise<Transaction>;
57
+ /**
58
+ * Retrieves a transaction by metadata key/value.
59
+ */
60
+ retrieveByMetadata(key: string, value: string): Promise<Transaction>;
61
+ /**
62
+ * Retrieves a transaction by externalId.
63
+ */
64
+ retrieveByExternalId(externalId: string): Promise<Transaction>;
65
+ /**
66
+ * Updates a transaction.
67
+ */
68
+ update(id: string, data: UpdateTransactionInput): Promise<Transaction>;
69
+ /**
70
+ * Deletes a transaction (soft delete).
71
+ */
72
+ delete(id: string): Promise<void>;
73
+ /**
74
+ * Lists transactions with optional filtering and pagination.
75
+ */
76
+ list(options?: ListOptions<TransactionFilter>): Promise<PaginatedResponse<Transaction>>;
77
+ /**
78
+ * Lists all transactions for a specific client.
79
+ *
80
+ * @param clientId - The client ID
81
+ * @param options - Optional pagination options
82
+ * @returns Paginated list of Transactions
83
+ */
84
+ listByClient(clientId: string, options?: {
85
+ cursor?: string;
86
+ limit?: number;
87
+ }): Promise<PaginatedResponse<Transaction>>;
88
+ /**
89
+ * Returns an async iterator over all transactions matching the filter.
90
+ */
91
+ iterate(filter?: TransactionFilter): AsyncGenerator<Transaction, void, undefined>;
92
+ /**
93
+ * Links a client to a transaction with an optional role.
94
+ */
95
+ linkClient(transactionId: string, clientId: string, role?: ClientRole): Promise<Transaction>;
96
+ /**
97
+ * Unlinks a client from a transaction.
98
+ */
99
+ unlinkClient(transactionId: string, clientId: string): Promise<Transaction>;
100
+ /**
101
+ * Replaces all clients related to a transaction.
102
+ */
103
+ setClients(transactionId: string, clients: RelatedClient[]): Promise<Transaction>;
104
+ /**
105
+ * Creates multiple transactions in a single request.
106
+ *
107
+ * @param transactions - Array of transaction creation data
108
+ * @param options - Batch options (atomic: true by default)
109
+ * @returns Atomic result with data array, or partial result with succeeded/failed
110
+ */
111
+ createMany(transactions: CreateTransactionInput[], options?: {
112
+ atomic?: true;
113
+ }): Promise<AtomicBatchResult<Transaction>>;
114
+ createMany(transactions: CreateTransactionInput[], options: {
115
+ atomic: false;
116
+ }): Promise<PartialBatchResult<Transaction>>;
117
+ /**
118
+ * Updates multiple transactions in a single request.
119
+ *
120
+ * @param updates - Array of { id, data } updates
121
+ * @param options - Batch options (atomic: true by default)
122
+ * @returns Atomic result with data array, or partial result with succeeded/failed
123
+ */
124
+ updateMany(updates: {
125
+ id: string;
126
+ data: UpdateTransactionInput;
127
+ }[], options?: {
128
+ atomic?: true;
129
+ }): Promise<AtomicBatchResult<Transaction>>;
130
+ updateMany(updates: {
131
+ id: string;
132
+ data: UpdateTransactionInput;
133
+ }[], options: {
134
+ atomic: false;
135
+ }): Promise<PartialBatchResult<Transaction>>;
136
+ /**
137
+ * Instantiates a Transaction model from API response data.
138
+ * Subclasses override this to return their specific model type.
139
+ */
140
+ protected instantiate(data: TransactionData): Transaction;
141
+ }
142
+ //# sourceMappingURL=transactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/resources/transactions.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Transactions Resource
3
+ *
4
+ * CRUD operations, filtering, pagination, and client relationships.
5
+ *
6
+ * This is the base (unscoped) resource. For jurisdiction-scoped SDKs, use:
7
+ * - MexTransactionsResource - Mexico-scoped with flattened MX fields
8
+ * - AVITransactionsResource - Mexico AVI-scoped with flattened AVI fields
9
+ * - JYSTransactionsResource - Mexico JYS-scoped with flattened JYS fields
10
+ * - TSCTransactionsResource - Mexico TSC-scoped with flattened TSC fields
11
+ */
12
+ import { z } from "zod";
13
+ import { createTransactionInputSchema, updateTransactionInputSchema, } from "@artu-ai/shared";
14
+ import { BaseResource } from "./base";
15
+ import { Transaction } from "../models";
16
+ // ===========================
17
+ // TransactionsResource
18
+ // ===========================
19
+ /**
20
+ * Base resource manager for transaction operations.
21
+ *
22
+ * Provides:
23
+ * - CRUD operations (create, retrieve, update, delete)
24
+ * - Filtering and pagination
25
+ * - Client relationship management (linkClient, unlinkClient)
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Create a transaction with full nested format
30
+ * const txn = await sdk.transactions.create({
31
+ * amount: 50000,
32
+ * currency: "MXN",
33
+ * primaryJurisdiction: "MX",
34
+ * relatedClientIds: ["client_sender"],
35
+ * timestamp: new Date(),
36
+ * jurisdictions: {
37
+ * MX: { actividadVulnerable: { AVI: { ... } } },
38
+ * },
39
+ * });
40
+ *
41
+ * // List with filtering
42
+ * const { data, pagination } = await sdk.transactions.list({
43
+ * filter: { status: "completed" },
44
+ * limit: 20,
45
+ * });
46
+ * ```
47
+ */
48
+ export class TransactionsResource extends BaseResource {
49
+ // ─────────────────────────────────────────────────────────────────
50
+ // CRUD Operations
51
+ // ─────────────────────────────────────────────────────────────────
52
+ /**
53
+ * Creates a new transaction.
54
+ *
55
+ * @param data - Transaction creation data in nested format
56
+ * @returns The created transaction model
57
+ */
58
+ async create(data) {
59
+ const validated = this.validate(createTransactionInputSchema, data);
60
+ const response = await this.execute(() => this.trpc.transactions.create.mutate(validated));
61
+ return this.instantiate(response);
62
+ }
63
+ /**
64
+ * Retrieves a transaction by ID.
65
+ */
66
+ async retrieve(id) {
67
+ const response = await this.execute(() => this.trpc.transactions.retrieve.query({ id }));
68
+ return this.instantiate(response);
69
+ }
70
+ /**
71
+ * Retrieves a transaction by metadata key/value.
72
+ */
73
+ async retrieveByMetadata(key, value) {
74
+ const response = await this.execute(() => this.trpc.transactions.retrieveByMetadata.query({ key, value }));
75
+ return this.instantiate(response);
76
+ }
77
+ /**
78
+ * Retrieves a transaction by externalId.
79
+ */
80
+ async retrieveByExternalId(externalId) {
81
+ const response = await this.execute(() => this.trpc.transactions.retrieveByExternalId.query({ externalId }));
82
+ return this.instantiate(response);
83
+ }
84
+ /**
85
+ * Updates a transaction.
86
+ */
87
+ async update(id, data) {
88
+ const validated = this.validate(updateTransactionInputSchema, data);
89
+ const response = await this.execute(() => this.trpc.transactions.update.mutate({ id, data: validated }));
90
+ return this.instantiate(response);
91
+ }
92
+ /**
93
+ * Deletes a transaction (soft delete).
94
+ */
95
+ async delete(id) {
96
+ await this.execute(() => this.trpc.transactions.delete.mutate({ id }));
97
+ }
98
+ // ─────────────────────────────────────────────────────────────────
99
+ // List & Pagination
100
+ // ─────────────────────────────────────────────────────────────────
101
+ /**
102
+ * Lists transactions with optional filtering and pagination.
103
+ */
104
+ async list(options) {
105
+ const response = await this.execute(() => this.trpc.transactions.list.query(options));
106
+ return {
107
+ data: response.data.map((t) => this.instantiate(t)),
108
+ pagination: response.pagination,
109
+ };
110
+ }
111
+ /**
112
+ * Lists all transactions for a specific client.
113
+ *
114
+ * @param clientId - The client ID
115
+ * @param options - Optional pagination options
116
+ * @returns Paginated list of Transactions
117
+ */
118
+ async listByClient(clientId, options) {
119
+ const response = await this.execute(() => this.trpc.transactions.listByClient.query({ clientId, ...options }));
120
+ return {
121
+ data: response.data.map((t) => this.instantiate(t)),
122
+ pagination: response.pagination,
123
+ };
124
+ }
125
+ /**
126
+ * Returns an async iterator over all transactions matching the filter.
127
+ */
128
+ iterate(filter) {
129
+ return this.createIterator({ filter });
130
+ }
131
+ // ─────────────────────────────────────────────────────────────────
132
+ // Client Relationship Management
133
+ // ─────────────────────────────────────────────────────────────────
134
+ /**
135
+ * Links a client to a transaction with an optional role.
136
+ */
137
+ async linkClient(transactionId, clientId, role) {
138
+ const response = await this.execute(() => this.trpc.transactions.linkClient.mutate({
139
+ transactionId,
140
+ clientId,
141
+ role,
142
+ }));
143
+ return this.instantiate(response);
144
+ }
145
+ /**
146
+ * Unlinks a client from a transaction.
147
+ */
148
+ async unlinkClient(transactionId, clientId) {
149
+ const response = await this.execute(() => this.trpc.transactions.unlinkClient.mutate({
150
+ transactionId,
151
+ clientId,
152
+ }));
153
+ return this.instantiate(response);
154
+ }
155
+ /**
156
+ * Replaces all clients related to a transaction.
157
+ */
158
+ async setClients(transactionId, clients) {
159
+ const response = await this.execute(() => this.trpc.transactions.setClients.mutate({
160
+ transactionId,
161
+ clients,
162
+ }));
163
+ return this.instantiate(response);
164
+ }
165
+ async createMany(transactions, options = {}) {
166
+ const atomic = options.atomic ?? true;
167
+ const validated = this.validate(z.array(createTransactionInputSchema), transactions);
168
+ const response = await this.execute(() => this.trpc.transactions.createMany.mutate({ items: validated, atomic }));
169
+ if (response.atomic) {
170
+ return {
171
+ atomic: true,
172
+ data: response.data.map((t) => this.instantiate(t)),
173
+ };
174
+ }
175
+ else {
176
+ return {
177
+ atomic: false,
178
+ succeeded: response.succeeded.map((item) => ({
179
+ index: item.index,
180
+ data: this.instantiate(item.data),
181
+ })),
182
+ failed: response.failed,
183
+ };
184
+ }
185
+ }
186
+ async updateMany(updates, options = {}) {
187
+ const atomic = options.atomic ?? true;
188
+ const updateItemSchema = z.object({
189
+ id: z.uuid(),
190
+ data: updateTransactionInputSchema,
191
+ });
192
+ const validated = this.validate(z.array(updateItemSchema), updates);
193
+ const response = await this.execute(() => this.trpc.transactions.updateMany.mutate({ items: validated, atomic }));
194
+ if (response.atomic) {
195
+ return {
196
+ atomic: true,
197
+ data: response.data.map((t) => this.instantiate(t)),
198
+ };
199
+ }
200
+ else {
201
+ return {
202
+ atomic: false,
203
+ succeeded: response.succeeded.map((item) => ({
204
+ index: item.index,
205
+ data: this.instantiate(item.data),
206
+ })),
207
+ failed: response.failed,
208
+ };
209
+ }
210
+ }
211
+ // ─────────────────────────────────────────────────────────────────
212
+ // Instantiation (protected for subclasses to override)
213
+ // ─────────────────────────────────────────────────────────────────
214
+ /**
215
+ * Instantiates a Transaction model from API response data.
216
+ * Subclasses override this to return their specific model type.
217
+ */
218
+ instantiate(data) {
219
+ return new Transaction(data);
220
+ }
221
+ }