@artu-ai/compliance-sdk 0.0.6 → 0.3.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.
- package/dist/errors/api.d.ts +160 -0
- package/dist/errors/api.d.ts.map +1 -0
- package/dist/errors/api.js +255 -0
- package/dist/errors/base.d.ts +87 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +84 -0
- package/dist/errors/index.d.ts +32 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +35 -0
- package/dist/errors/upload.d.ts +109 -0
- package/dist/errors/upload.d.ts.map +1 -0
- package/dist/errors/upload.js +163 -0
- package/dist/errors/validation.d.ts +98 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +129 -0
- package/dist/exports/base.d.ts +12 -0
- package/dist/exports/base.d.ts.map +1 -0
- package/dist/exports/base.js +21 -0
- package/dist/exports/index.d.ts +40 -0
- package/dist/exports/index.d.ts.map +1 -0
- package/dist/exports/index.js +59 -0
- package/dist/{mexico → exports/mexico}/actividad-vulnerable/avi.d.ts +130 -138
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts.map +1 -0
- package/dist/exports/mexico/actividad-vulnerable/avi.js +108 -0
- package/dist/{mexico → exports/mexico}/actividad-vulnerable/jys.d.ts +147 -158
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts.map +1 -0
- package/dist/exports/mexico/actividad-vulnerable/jys.js +115 -0
- package/dist/{mexico → exports/mexico}/actividad-vulnerable/tsc.d.ts +118 -129
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts.map +1 -0
- package/dist/exports/mexico/actividad-vulnerable/tsc.js +103 -0
- package/dist/exports/mexico/index.d.ts +48 -0
- package/dist/exports/mexico/index.d.ts.map +1 -0
- package/dist/exports/mexico/index.js +70 -0
- package/dist/models/Address.d.ts +118 -0
- package/dist/models/Address.d.ts.map +1 -0
- package/dist/models/Address.js +187 -0
- package/dist/models/BankAccount.d.ts +124 -0
- package/dist/models/BankAccount.d.ts.map +1 -0
- package/dist/models/BankAccount.js +190 -0
- package/dist/models/Client.d.ts +170 -0
- package/dist/models/Client.d.ts.map +1 -0
- package/dist/models/Client.js +275 -0
- package/dist/models/ContactMethod.d.ts +102 -0
- package/dist/models/ContactMethod.d.ts.map +1 -0
- package/dist/models/ContactMethod.js +152 -0
- package/dist/models/Document.d.ts +167 -0
- package/dist/models/Document.d.ts.map +1 -0
- package/dist/models/Document.js +295 -0
- package/dist/models/LinkedClient.d.ts +62 -0
- package/dist/models/LinkedClient.d.ts.map +1 -0
- package/dist/models/LinkedClient.js +70 -0
- package/dist/models/Report.d.ts +98 -0
- package/dist/models/Report.d.ts.map +1 -0
- package/dist/models/Report.js +156 -0
- package/dist/models/ReportItem.d.ts +106 -0
- package/dist/models/ReportItem.d.ts.map +1 -0
- package/dist/models/ReportItem.js +167 -0
- package/dist/models/Transaction.d.ts +108 -0
- package/dist/models/Transaction.d.ts.map +1 -0
- package/dist/models/Transaction.js +175 -0
- package/dist/models/base.d.ts +42 -0
- package/dist/models/base.d.ts.map +1 -0
- package/dist/models/base.js +51 -0
- package/dist/models/index.d.ts +20 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +34 -0
- package/dist/models/mex/MexAddress.d.ts +93 -0
- package/dist/models/mex/MexAddress.d.ts.map +1 -0
- package/dist/models/mex/MexAddress.js +148 -0
- package/dist/models/mex/MexBankAccount.d.ts +65 -0
- package/dist/models/mex/MexBankAccount.d.ts.map +1 -0
- package/dist/models/mex/MexBankAccount.js +90 -0
- package/dist/models/mex/MexClient.d.ts +88 -0
- package/dist/models/mex/MexClient.d.ts.map +1 -0
- package/dist/models/mex/MexClient.js +133 -0
- package/dist/models/mex/MexDocument.d.ts +415 -0
- package/dist/models/mex/MexDocument.d.ts.map +1 -0
- package/dist/models/mex/MexDocument.js +687 -0
- package/dist/models/mex/MexReport.d.ts +50 -0
- package/dist/models/mex/MexReport.d.ts.map +1 -0
- package/dist/models/mex/MexReport.js +73 -0
- package/dist/models/mex/MexReportItem.d.ts +39 -0
- package/dist/models/mex/MexReportItem.d.ts.map +1 -0
- package/dist/models/mex/MexReportItem.js +50 -0
- package/dist/models/mex/MexTransaction.d.ts +53 -0
- package/dist/models/mex/MexTransaction.d.ts.map +1 -0
- package/dist/models/mex/MexTransaction.js +78 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.d.ts +37 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableClient.js +46 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts +38 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.js +39 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts +38 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.js +39 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.d.ts +29 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.js +37 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.d.ts +43 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIClient.js +59 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.js +75 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.js +63 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts +67 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.js +136 -0
- package/dist/models/mex/actividad-vulnerable/index.d.ts +20 -0
- package/dist/models/mex/actividad-vulnerable/index.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/index.js +25 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.d.ts +39 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSClient.js +53 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.js +75 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.js +63 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.d.ts +85 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSTransaction.js +152 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.d.ts +39 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCClient.js +53 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.js +75 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.js +63 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.js +82 -0
- package/dist/models/mex/index.d.ts +12 -0
- package/dist/models/mex/index.d.ts.map +1 -0
- package/dist/models/mex/index.js +20 -0
- package/dist/models/types.d.ts +81 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +6 -0
- package/dist/namespaces/index.d.ts +25 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/index.js +27 -0
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts +322 -0
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts.map +1 -0
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.js +42 -0
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts +1361 -0
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts.map +1 -0
- package/dist/namespaces/mexico/actividad-vulnerable/index.js +53 -0
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts +454 -0
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts.map +1 -0
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.js +52 -0
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts +162 -0
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts.map +1 -0
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.js +40 -0
- package/dist/namespaces/mexico/index.d.ts +2481 -0
- package/dist/namespaces/mexico/index.d.ts.map +1 -0
- package/dist/namespaces/mexico/index.js +140 -0
- package/dist/resources/addresses.d.ts +171 -0
- package/dist/resources/addresses.d.ts.map +1 -0
- package/dist/resources/addresses.js +208 -0
- package/dist/resources/bank-accounts.d.ts +174 -0
- package/dist/resources/bank-accounts.d.ts.map +1 -0
- package/dist/resources/bank-accounts.js +220 -0
- package/dist/resources/base.d.ts +192 -0
- package/dist/resources/base.d.ts.map +1 -0
- package/dist/resources/base.js +205 -0
- package/dist/resources/clients.d.ts +446 -0
- package/dist/resources/clients.d.ts.map +1 -0
- package/dist/resources/clients.js +448 -0
- package/dist/resources/contact-methods.d.ts +176 -0
- package/dist/resources/contact-methods.d.ts.map +1 -0
- package/dist/resources/contact-methods.js +215 -0
- package/dist/resources/documents.d.ts +340 -0
- package/dist/resources/documents.d.ts.map +1 -0
- package/dist/resources/documents.js +447 -0
- package/dist/resources/index.d.ts +23 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +25 -0
- package/dist/resources/mex/actividad-vulnerable/avi/clients.d.ts +165 -0
- package/dist/resources/mex/actividad-vulnerable/avi/clients.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/clients.js +317 -0
- package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts +7 -0
- package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/index.js +6 -0
- package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts +152 -0
- package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/reports.js +401 -0
- package/dist/resources/mex/actividad-vulnerable/avi/transactions.d.ts +89 -0
- package/dist/resources/mex/actividad-vulnerable/avi/transactions.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/transactions.js +252 -0
- package/dist/resources/mex/actividad-vulnerable/index.d.ts +7 -0
- package/dist/resources/mex/actividad-vulnerable/index.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/index.js +9 -0
- package/dist/resources/mex/actividad-vulnerable/jys/clients.d.ts +119 -0
- package/dist/resources/mex/actividad-vulnerable/jys/clients.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/jys/clients.js +231 -0
- package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts +7 -0
- package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/jys/index.js +6 -0
- package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts +132 -0
- package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/jys/reports.js +381 -0
- package/dist/resources/mex/actividad-vulnerable/jys/transactions.d.ts +93 -0
- package/dist/resources/mex/actividad-vulnerable/jys/transactions.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/jys/transactions.js +253 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/clients.d.ts +119 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/clients.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/clients.js +231 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts +7 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/index.js +6 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts +132 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/reports.js +381 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/transactions.d.ts +90 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/transactions.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/transactions.js +259 -0
- package/dist/resources/mex/addresses.d.ts +143 -0
- package/dist/resources/mex/addresses.d.ts.map +1 -0
- package/dist/resources/mex/addresses.js +328 -0
- package/dist/resources/mex/bank-accounts.d.ts +107 -0
- package/dist/resources/mex/bank-accounts.d.ts.map +1 -0
- package/dist/resources/mex/bank-accounts.js +163 -0
- package/dist/resources/mex/clients.d.ts +195 -0
- package/dist/resources/mex/clients.d.ts.map +1 -0
- package/dist/resources/mex/clients.js +454 -0
- package/dist/resources/mex/ebr.d.ts +213 -0
- package/dist/resources/mex/ebr.d.ts.map +1 -0
- package/dist/resources/mex/ebr.js +417 -0
- package/dist/resources/mex/index.d.ts +11 -0
- package/dist/resources/mex/index.d.ts.map +1 -0
- package/dist/resources/mex/index.js +12 -0
- package/dist/resources/mex/reports.d.ts +226 -0
- package/dist/resources/mex/reports.d.ts.map +1 -0
- package/dist/resources/mex/reports.js +440 -0
- package/dist/resources/mex/transactions.d.ts +125 -0
- package/dist/resources/mex/transactions.d.ts.map +1 -0
- package/dist/resources/mex/transactions.js +274 -0
- package/dist/resources/reports.d.ts +211 -0
- package/dist/resources/reports.d.ts.map +1 -0
- package/dist/resources/reports.js +308 -0
- package/dist/resources/transactions.d.ts +142 -0
- package/dist/resources/transactions.d.ts.map +1 -0
- package/dist/resources/transactions.js +221 -0
- package/dist/sdk/ComplianceSDK.d.ts +459 -0
- package/dist/sdk/ComplianceSDK.d.ts.map +1 -0
- package/dist/sdk/ComplianceSDK.js +528 -0
- package/dist/sdk/base.d.ts +17 -0
- package/dist/sdk/base.d.ts.map +1 -0
- package/dist/sdk/base.js +22 -0
- package/dist/sdk/index.d.ts +18 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +43 -0
- package/dist/{ComplianceSDK-BgzIwSsY.d.cts → sdk/mex/ComplianceSDK.d.ts} +16 -7
- package/dist/sdk/mex/ComplianceSDK.d.ts.map +1 -0
- package/dist/{ComplianceSDK-DoIZOSJq.d.ts → sdk/mex/ComplianceSDK.js} +26 -11
- package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts +44 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.js +39 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/index.d.ts +8 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/index.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/index.js +9 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts +35 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/avi/types.js +20 -0
- package/dist/sdk/mex/actividad-vulnerable/index.d.ts +13 -0
- package/dist/sdk/mex/actividad-vulnerable/index.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/index.js +31 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts +44 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.js +39 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/index.d.ts +8 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/index.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/index.js +9 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts +35 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/jys/types.js +20 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts +44 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.js +39 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/index.d.ts +8 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/index.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/index.js +9 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts +35 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.js +20 -0
- package/dist/sdk/mex/index.d.ts +13 -0
- package/dist/sdk/mex/index.d.ts.map +1 -0
- package/dist/sdk/mex/index.js +38 -0
- package/dist/sdk/mex/types.d.ts +57 -0
- package/dist/sdk/mex/types.d.ts.map +1 -0
- package/dist/sdk/mex/types.js +7 -0
- package/dist/sdk/resource-registry.d.ts +118 -0
- package/dist/sdk/resource-registry.d.ts.map +1 -0
- package/dist/sdk/resource-registry.js +145 -0
- package/dist/sdk/sdk-registry.d.ts +59 -0
- package/dist/sdk/sdk-registry.d.ts.map +1 -0
- package/dist/sdk/sdk-registry.js +82 -0
- package/dist/sdk/types.d.ts +232 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +42 -0
- package/dist/utils/environment.d.ts +126 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +148 -0
- package/dist/utils/filters.d.ts +338 -0
- package/dist/utils/filters.d.ts.map +1 -0
- package/dist/utils/filters.js +373 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +43 -0
- package/dist/utils/pagination.d.ts +85 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +120 -0
- package/dist/utils/session.d.ts +173 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/dist/utils/session.js +58 -0
- package/dist/utils/trpc-client.d.ts +19507 -0
- package/dist/utils/trpc-client.d.ts.map +1 -0
- package/dist/utils/trpc-client.js +129 -0
- package/dist/utils/upload.d.ts +81 -0
- package/dist/utils/upload.d.ts.map +1 -0
- package/dist/utils/upload.js +261 -0
- package/package.json +17 -27
- package/src/errors/api.ts +305 -0
- package/src/errors/base.ts +127 -0
- package/src/errors/index.ts +63 -0
- package/src/errors/upload.ts +204 -0
- package/src/errors/validation.ts +163 -0
- package/src/exports/base.ts +139 -0
- package/src/exports/index.ts +187 -0
- package/src/exports/mexico/actividad-vulnerable/avi.ts +207 -0
- package/src/exports/mexico/actividad-vulnerable/jys.ts +214 -0
- package/src/exports/mexico/actividad-vulnerable/tsc.ts +202 -0
- package/src/exports/mexico/index.ts +215 -0
- package/src/models/Address.ts +235 -0
- package/src/models/BankAccount.ts +235 -0
- package/src/models/Client.ts +363 -0
- package/src/models/ContactMethod.ts +197 -0
- package/src/models/Document.ts +355 -0
- package/src/models/LinkedClient.ts +84 -0
- package/src/models/Report.ts +193 -0
- package/src/models/ReportItem.ts +211 -0
- package/src/models/Transaction.ts +219 -0
- package/src/models/base.ts +56 -0
- package/src/models/index.ts +148 -0
- package/src/models/mex/MexAddress.ts +184 -0
- package/src/models/mex/MexBankAccount.ts +121 -0
- package/src/models/mex/MexClient.ts +177 -0
- package/src/models/mex/MexDocument.ts +890 -0
- package/src/models/mex/MexReport.ts +99 -0
- package/src/models/mex/MexReportItem.ts +79 -0
- package/src/models/mex/MexTransaction.ts +105 -0
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableClient.ts +66 -0
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReport.ts +73 -0
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.ts +74 -0
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.ts +50 -0
- package/src/models/mex/actividad-vulnerable/avi/MexAVIClient.ts +80 -0
- package/src/models/mex/actividad-vulnerable/avi/MexAVIReport.ts +114 -0
- package/src/models/mex/actividad-vulnerable/avi/MexAVIReportItem.ts +105 -0
- package/src/models/mex/actividad-vulnerable/avi/MexAVITransaction.ts +157 -0
- package/src/models/mex/actividad-vulnerable/index.ts +78 -0
- package/src/models/mex/actividad-vulnerable/jys/MexJYSClient.ts +73 -0
- package/src/models/mex/actividad-vulnerable/jys/MexJYSReport.ts +114 -0
- package/src/models/mex/actividad-vulnerable/jys/MexJYSReportItem.ts +105 -0
- package/src/models/mex/actividad-vulnerable/jys/MexJYSTransaction.ts +178 -0
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCClient.ts +73 -0
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCReport.ts +114 -0
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.ts +105 -0
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.ts +104 -0
- package/src/models/mex/index.ts +57 -0
- package/src/models/types.ts +196 -0
- package/src/namespaces/index.ts +29 -0
- package/src/namespaces/mexico/actividad-vulnerable/avi/index.ts +62 -0
- package/src/namespaces/mexico/actividad-vulnerable/index.ts +79 -0
- package/src/namespaces/mexico/actividad-vulnerable/jys/index.ts +72 -0
- package/src/namespaces/mexico/actividad-vulnerable/tsc/index.ts +60 -0
- package/src/namespaces/mexico/index.ts +325 -0
- package/src/resources/addresses.ts +391 -0
- package/src/resources/bank-accounts.ts +417 -0
- package/src/resources/base.ts +327 -0
- package/src/resources/clients.ts +808 -0
- package/src/resources/contact-methods.ts +412 -0
- package/src/resources/documents.ts +688 -0
- package/src/resources/index.ts +40 -0
- package/src/resources/mex/actividad-vulnerable/avi/clients.ts +559 -0
- package/src/resources/mex/actividad-vulnerable/avi/index.ts +7 -0
- package/src/resources/mex/actividad-vulnerable/avi/reports.ts +609 -0
- package/src/resources/mex/actividad-vulnerable/avi/transactions.ts +404 -0
- package/src/resources/mex/actividad-vulnerable/index.ts +12 -0
- package/src/resources/mex/actividad-vulnerable/jys/clients.ts +445 -0
- package/src/resources/mex/actividad-vulnerable/jys/index.ts +7 -0
- package/src/resources/mex/actividad-vulnerable/jys/reports.ts +591 -0
- package/src/resources/mex/actividad-vulnerable/jys/transactions.ts +395 -0
- package/src/resources/mex/actividad-vulnerable/tsc/clients.ts +445 -0
- package/src/resources/mex/actividad-vulnerable/tsc/index.ts +7 -0
- package/src/resources/mex/actividad-vulnerable/tsc/reports.ts +591 -0
- package/src/resources/mex/actividad-vulnerable/tsc/transactions.ts +404 -0
- package/src/resources/mex/addresses.ts +493 -0
- package/src/resources/mex/bank-accounts.ts +283 -0
- package/src/resources/mex/clients.ts +758 -0
- package/src/resources/mex/ebr.ts +621 -0
- package/src/resources/mex/index.ts +23 -0
- package/src/resources/mex/reports.ts +643 -0
- package/src/resources/mex/transactions.ts +422 -0
- package/src/resources/reports.ts +515 -0
- package/src/resources/transactions.ts +358 -0
- package/src/sdk/ComplianceSDK.ts +812 -0
- package/src/sdk/base.ts +43 -0
- package/src/sdk/index.ts +98 -0
- package/src/sdk/mex/ComplianceSDK.ts +147 -0
- package/src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts +55 -0
- package/src/sdk/mex/actividad-vulnerable/avi/index.ts +16 -0
- package/src/sdk/mex/actividad-vulnerable/avi/types.ts +86 -0
- package/src/sdk/mex/actividad-vulnerable/index.ts +58 -0
- package/src/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.ts +54 -0
- package/src/sdk/mex/actividad-vulnerable/jys/index.ts +16 -0
- package/src/sdk/mex/actividad-vulnerable/jys/types.ts +86 -0
- package/src/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.ts +54 -0
- package/src/sdk/mex/actividad-vulnerable/tsc/index.ts +16 -0
- package/src/sdk/mex/actividad-vulnerable/tsc/types.ts +86 -0
- package/src/sdk/mex/index.ts +66 -0
- package/src/sdk/mex/types.ts +88 -0
- package/src/sdk/resource-registry.ts +204 -0
- package/src/sdk/sdk-registry.ts +99 -0
- package/src/sdk/types.ts +304 -0
- package/src/utils/environment.ts +187 -0
- package/src/utils/filters.ts +412 -0
- package/src/utils/index.ts +134 -0
- package/src/utils/pagination.ts +143 -0
- package/src/utils/session.ts +303 -0
- package/src/utils/trpc-client.ts +242 -0
- package/src/utils/upload.ts +388 -0
- package/dist/chunk-2CIR32CT.cjs +0 -22972
- package/dist/chunk-2CIR32CT.cjs.map +0 -1
- package/dist/chunk-5FXVLHD3.js +0 -23
- package/dist/chunk-5FXVLHD3.js.map +0 -1
- package/dist/chunk-62M35I6I.js +0 -249
- package/dist/chunk-62M35I6I.js.map +0 -1
- package/dist/chunk-ARI5WM5X.js +0 -22819
- package/dist/chunk-ARI5WM5X.js.map +0 -1
- package/dist/chunk-B75YW6BN.cjs +0 -26
- package/dist/chunk-B75YW6BN.cjs.map +0 -1
- package/dist/chunk-F6THYYF5.cjs +0 -26
- package/dist/chunk-F6THYYF5.cjs.map +0 -1
- package/dist/chunk-HAEBRF5N.js +0 -23
- package/dist/chunk-HAEBRF5N.js.map +0 -1
- package/dist/chunk-HEGTPUIS.cjs +0 -26
- package/dist/chunk-HEGTPUIS.cjs.map +0 -1
- package/dist/chunk-TYXYZ3WV.js +0 -23
- package/dist/chunk-TYXYZ3WV.js.map +0 -1
- package/dist/chunk-ZFW24DFL.cjs +0 -261
- package/dist/chunk-ZFW24DFL.cjs.map +0 -1
- package/dist/filters-UX1_wF2Z.d.cts +0 -6460
- package/dist/filters-UX1_wF2Z.d.ts +0 -6460
- package/dist/index-6dNlw8uP.d.cts +0 -2866
- package/dist/index-CUIwWk-y.d.ts +0 -2866
- package/dist/index.cjs +0 -417
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -9
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/mexico/actividad-vulnerable/avi.cjs +0 -320
- package/dist/mexico/actividad-vulnerable/avi.cjs.map +0 -1
- package/dist/mexico/actividad-vulnerable/avi.d.cts +0 -680
- package/dist/mexico/actividad-vulnerable/avi.js +0 -55
- package/dist/mexico/actividad-vulnerable/avi.js.map +0 -1
- package/dist/mexico/actividad-vulnerable/jys.cjs +0 -330
- package/dist/mexico/actividad-vulnerable/jys.cjs.map +0 -1
- package/dist/mexico/actividad-vulnerable/jys.d.cts +0 -746
- package/dist/mexico/actividad-vulnerable/jys.js +0 -65
- package/dist/mexico/actividad-vulnerable/jys.js.map +0 -1
- package/dist/mexico/actividad-vulnerable/tsc.cjs +0 -318
- package/dist/mexico/actividad-vulnerable/tsc.cjs.map +0 -1
- package/dist/mexico/actividad-vulnerable/tsc.d.cts +0 -600
- package/dist/mexico/actividad-vulnerable/tsc.js +0 -53
- package/dist/mexico/actividad-vulnerable/tsc.js.map +0 -1
- package/dist/mexico/index.cjs +0 -384
- package/dist/mexico/index.cjs.map +0 -1
- package/dist/mexico/index.d.cts +0 -1422
- package/dist/mexico/index.d.ts +0 -1422
- package/dist/mexico/index.js +0 -7
- package/dist/mexico/index.js.map +0 -1
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JYS (Juegos y Sorteos) Clients Resource
|
|
3
|
+
*
|
|
4
|
+
* Extends MexClientsResource with JYS-specific behavior.
|
|
5
|
+
* JYS clients have the same fields as Mexico clients (no additional activity fields).
|
|
6
|
+
* Returns MexJYSClient models.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import type {
|
|
11
|
+
CreateClientInput,
|
|
12
|
+
UpdateClientInput,
|
|
13
|
+
ListOptions,
|
|
14
|
+
PaginatedResponse,
|
|
15
|
+
CreateJYSClientInput,
|
|
16
|
+
UpdateJYSClientInput,
|
|
17
|
+
CreateMexClientInput,
|
|
18
|
+
UpdateMexClientInput,
|
|
19
|
+
AtomicBatchResult,
|
|
20
|
+
PartialBatchResult,
|
|
21
|
+
ClientRelationshipType,
|
|
22
|
+
LinkedClient as LinkedClientInput,
|
|
23
|
+
CreateMexAddressInput,
|
|
24
|
+
UpdateMexAddressInput,
|
|
25
|
+
CreateContactMethodInput,
|
|
26
|
+
UpdateContactMethodInput,
|
|
27
|
+
CreateBankAccountInput,
|
|
28
|
+
UpdateBankAccountInput,
|
|
29
|
+
SyncItem,
|
|
30
|
+
SyncResult,
|
|
31
|
+
JYSClientFilter,
|
|
32
|
+
JYSClientSort,
|
|
33
|
+
} from "@artu-ai/shared";
|
|
34
|
+
import {
|
|
35
|
+
CodigoActividad,
|
|
36
|
+
createJYSClientInputSchema,
|
|
37
|
+
updateJYSClientInputSchema,
|
|
38
|
+
linkedClientSchema,
|
|
39
|
+
transformSort,
|
|
40
|
+
jysClientFieldMapping,
|
|
41
|
+
} from "@artu-ai/shared";
|
|
42
|
+
import type { ClientSort } from "@artu-ai/shared";
|
|
43
|
+
import { MexClientsResource } from "../../clients";
|
|
44
|
+
import { type BatchOptions, type ClientIncludeMap } from "../../../clients";
|
|
45
|
+
import {
|
|
46
|
+
MexJYSClient,
|
|
47
|
+
MexAddress,
|
|
48
|
+
MexBankAccount,
|
|
49
|
+
ContactMethod,
|
|
50
|
+
LinkedClient,
|
|
51
|
+
type ClientData,
|
|
52
|
+
} from "../../../../models";
|
|
53
|
+
|
|
54
|
+
// ===========================
|
|
55
|
+
// JYSClientsResource
|
|
56
|
+
// ===========================
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* JYS (Juegos y Sorteos) scoped clients resource.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const jysSdk = new ComplianceSDK({
|
|
64
|
+
* apiKey,
|
|
65
|
+
* environment: "test",
|
|
66
|
+
* jurisdiction: Jurisdiction.Mexico,
|
|
67
|
+
* actividadVulnerable: CodigoActividad.JYS,
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* const client = await jysSdk.clients.create({
|
|
71
|
+
* type: ClientType.Person,
|
|
72
|
+
* name: "Juan García",
|
|
73
|
+
* rfc: "GAJL850101ABC",
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
76
|
+
* // Returns MexJYSClient
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export class JYSClientsResource extends MexClientsResource<JYSClientSort> {
|
|
80
|
+
// ─────────────────────────────────────────────────────────────────
|
|
81
|
+
// CRUD Operations
|
|
82
|
+
// ─────────────────────────────────────────────────────────────────
|
|
83
|
+
|
|
84
|
+
async create(data: CreateJYSClientInput): Promise<MexJYSClient> {
|
|
85
|
+
const validated = this.validate(createJYSClientInputSchema, data);
|
|
86
|
+
const nestedData = this.transformToNested(validated);
|
|
87
|
+
|
|
88
|
+
const response = await this.execute(() =>
|
|
89
|
+
this.trpc.clients.create.mutate(nestedData)
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return this.instantiate(response);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async retrieve(
|
|
96
|
+
id: string,
|
|
97
|
+
include?: ClientIncludeMap
|
|
98
|
+
): Promise<MexJYSClient> {
|
|
99
|
+
const response = await this.execute(() =>
|
|
100
|
+
this.trpc.clients.retrieve.query({ id, include })
|
|
101
|
+
);
|
|
102
|
+
return this.instantiate(response);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async retrieveByExternalId(externalId: string): Promise<MexJYSClient> {
|
|
106
|
+
const response = await this.execute(() =>
|
|
107
|
+
this.trpc.clients.retrieveByExternalId.query({ externalId })
|
|
108
|
+
);
|
|
109
|
+
return this.instantiate(response);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async update(id: string, data: UpdateJYSClientInput): Promise<MexJYSClient> {
|
|
113
|
+
const validated = this.validate(updateJYSClientInputSchema, data);
|
|
114
|
+
const nestedData = this.transformUpdateToNested(validated);
|
|
115
|
+
|
|
116
|
+
const response = await this.execute(() =>
|
|
117
|
+
this.trpc.clients.update.mutate({ id, data: nestedData })
|
|
118
|
+
);
|
|
119
|
+
return this.instantiate(response);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ─────────────────────────────────────────────────────────────────
|
|
123
|
+
// List & Pagination
|
|
124
|
+
// ─────────────────────────────────────────────────────────────────
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Lists JYS clients with optional filtering.
|
|
128
|
+
*
|
|
129
|
+
* Accepts flattened JYS filter (MX fields at root level) and automatically
|
|
130
|
+
* transforms to nested format before calling the API.
|
|
131
|
+
*/
|
|
132
|
+
async list(
|
|
133
|
+
options?: ListOptions<JYSClientFilter, JYSClientSort> & { includePrimaryContacts?: boolean }
|
|
134
|
+
): Promise<PaginatedResponse<MexJYSClient>> {
|
|
135
|
+
const scopedFilter = this.applyScopeToFilter(options?.filter);
|
|
136
|
+
const scopedSort = this.applyScopeToSort(options?.sort);
|
|
137
|
+
|
|
138
|
+
const response = await this.execute(() =>
|
|
139
|
+
this.trpc.clients.list.query({
|
|
140
|
+
...options,
|
|
141
|
+
filter: scopedFilter,
|
|
142
|
+
sort: scopedSort,
|
|
143
|
+
})
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
data: response.data.map((c) => this.instantiate(c)),
|
|
148
|
+
pagination: response.pagination,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Iterates over JYS clients.
|
|
154
|
+
*
|
|
155
|
+
* Accepts flattened JYS filter (MX fields at root level) and automatically
|
|
156
|
+
* transforms to nested format before calling the API.
|
|
157
|
+
*/
|
|
158
|
+
iterate(
|
|
159
|
+
filter?: JYSClientFilter
|
|
160
|
+
): AsyncGenerator<MexJYSClient, void, undefined> {
|
|
161
|
+
const scopedFilter = this.applyScopeToFilter(filter);
|
|
162
|
+
return this.createIterator<MexJYSClient>({ filter: scopedFilter });
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ─────────────────────────────────────────────────────────────────
|
|
166
|
+
// Batch Operations
|
|
167
|
+
// ─────────────────────────────────────────────────────────────────
|
|
168
|
+
|
|
169
|
+
async createMany(
|
|
170
|
+
clients: CreateJYSClientInput[],
|
|
171
|
+
options?: { atomic?: true }
|
|
172
|
+
): Promise<AtomicBatchResult<MexJYSClient>>;
|
|
173
|
+
async createMany(
|
|
174
|
+
clients: CreateJYSClientInput[],
|
|
175
|
+
options: { atomic: false }
|
|
176
|
+
): Promise<PartialBatchResult<MexJYSClient>>;
|
|
177
|
+
async createMany(
|
|
178
|
+
clients: CreateJYSClientInput[],
|
|
179
|
+
options: BatchOptions = {}
|
|
180
|
+
): Promise<
|
|
181
|
+
AtomicBatchResult<MexJYSClient> | PartialBatchResult<MexJYSClient>
|
|
182
|
+
> {
|
|
183
|
+
const atomic = options.atomic ?? true;
|
|
184
|
+
const validated = this.validate(
|
|
185
|
+
z.array(createJYSClientInputSchema),
|
|
186
|
+
clients
|
|
187
|
+
);
|
|
188
|
+
const nestedClients = validated.map((c) => this.transformToNested(c));
|
|
189
|
+
|
|
190
|
+
const response = await this.execute(() =>
|
|
191
|
+
this.trpc.clients.createMany.mutate({ items: nestedClients, atomic })
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
if (response.atomic) {
|
|
195
|
+
return {
|
|
196
|
+
atomic: true,
|
|
197
|
+
data: response.data.map((c) => this.instantiate(c)),
|
|
198
|
+
};
|
|
199
|
+
} else {
|
|
200
|
+
return {
|
|
201
|
+
atomic: false,
|
|
202
|
+
succeeded: response.succeeded.map((item) => ({
|
|
203
|
+
index: item.index,
|
|
204
|
+
data: this.instantiate(item.data),
|
|
205
|
+
})),
|
|
206
|
+
failed: response.failed,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async updateMany(
|
|
212
|
+
updates: { id: string; data: UpdateJYSClientInput }[],
|
|
213
|
+
options?: { atomic?: true }
|
|
214
|
+
): Promise<AtomicBatchResult<MexJYSClient>>;
|
|
215
|
+
async updateMany(
|
|
216
|
+
updates: { id: string; data: UpdateJYSClientInput }[],
|
|
217
|
+
options: { atomic: false }
|
|
218
|
+
): Promise<PartialBatchResult<MexJYSClient>>;
|
|
219
|
+
async updateMany(
|
|
220
|
+
updates: { id: string; data: UpdateJYSClientInput }[],
|
|
221
|
+
options: BatchOptions = {}
|
|
222
|
+
): Promise<
|
|
223
|
+
AtomicBatchResult<MexJYSClient> | PartialBatchResult<MexJYSClient>
|
|
224
|
+
> {
|
|
225
|
+
const atomic = options.atomic ?? true;
|
|
226
|
+
const updateItemSchema = z.object({
|
|
227
|
+
id: z.uuid(),
|
|
228
|
+
data: updateJYSClientInputSchema,
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
const validated = this.validate(z.array(updateItemSchema), updates);
|
|
232
|
+
const nestedUpdates = validated.map((u) => ({
|
|
233
|
+
id: u.id,
|
|
234
|
+
data: this.transformUpdateToNested(u.data),
|
|
235
|
+
}));
|
|
236
|
+
|
|
237
|
+
const response = await this.execute(() =>
|
|
238
|
+
this.trpc.clients.updateMany.mutate({ items: nestedUpdates, atomic })
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
if (response.atomic) {
|
|
242
|
+
return {
|
|
243
|
+
atomic: true,
|
|
244
|
+
data: response.data.map((c) => this.instantiate(c)),
|
|
245
|
+
};
|
|
246
|
+
} else {
|
|
247
|
+
return {
|
|
248
|
+
atomic: false,
|
|
249
|
+
succeeded: response.succeeded.map((item) => ({
|
|
250
|
+
index: item.index,
|
|
251
|
+
data: this.instantiate(item.data),
|
|
252
|
+
})),
|
|
253
|
+
failed: response.failed,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// ─────────────────────────────────────────────────────────────────
|
|
259
|
+
// Client-to-Client Relationship Management (scoped returns)
|
|
260
|
+
// ─────────────────────────────────────────────────────────────────
|
|
261
|
+
|
|
262
|
+
async linkClient(
|
|
263
|
+
parentClientId: string,
|
|
264
|
+
childClientId: string,
|
|
265
|
+
relationshipType: ClientRelationshipType,
|
|
266
|
+
metadata?: Record<string, unknown>
|
|
267
|
+
): Promise<MexJYSClient> {
|
|
268
|
+
const response = await this.execute(() =>
|
|
269
|
+
this.trpc.clients.linkClient.mutate({
|
|
270
|
+
parentClientId,
|
|
271
|
+
childClientId,
|
|
272
|
+
relationshipType,
|
|
273
|
+
metadata,
|
|
274
|
+
})
|
|
275
|
+
);
|
|
276
|
+
return this.instantiate(response);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async unlinkClient(
|
|
280
|
+
parentClientId: string,
|
|
281
|
+
childClientId: string,
|
|
282
|
+
relationshipType: ClientRelationshipType
|
|
283
|
+
): Promise<MexJYSClient> {
|
|
284
|
+
const response = await this.execute(() =>
|
|
285
|
+
this.trpc.clients.unlinkClient.mutate({
|
|
286
|
+
parentClientId,
|
|
287
|
+
childClientId,
|
|
288
|
+
relationshipType,
|
|
289
|
+
})
|
|
290
|
+
);
|
|
291
|
+
return this.instantiate(response);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
async listLinkedClients(
|
|
295
|
+
parentClientId: string,
|
|
296
|
+
relationshipType?: ClientRelationshipType
|
|
297
|
+
): Promise<LinkedClient[]> {
|
|
298
|
+
return super.listLinkedClients(parentClientId, relationshipType);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
async setLinkedClients(
|
|
302
|
+
parentClientId: string,
|
|
303
|
+
linkedClients: LinkedClientInput[]
|
|
304
|
+
): Promise<MexJYSClient> {
|
|
305
|
+
const validated = this.validate(z.array(linkedClientSchema), linkedClients);
|
|
306
|
+
|
|
307
|
+
const response = await this.execute(() =>
|
|
308
|
+
this.trpc.clients.setLinkedClients.mutate({
|
|
309
|
+
parentClientId,
|
|
310
|
+
linkedClients: validated,
|
|
311
|
+
})
|
|
312
|
+
);
|
|
313
|
+
return this.instantiate(response);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ─────────────────────────────────────────────────────────────────
|
|
317
|
+
// Sync All (Atomic)
|
|
318
|
+
// ─────────────────────────────────────────────────────────────────
|
|
319
|
+
|
|
320
|
+
async syncAll(
|
|
321
|
+
clientId: string,
|
|
322
|
+
data: {
|
|
323
|
+
client?: UpdateJYSClientInput;
|
|
324
|
+
addresses?: SyncItem<CreateMexAddressInput>[];
|
|
325
|
+
contactMethods?: SyncItem<CreateContactMethodInput>[];
|
|
326
|
+
bankAccounts?: SyncItem<CreateBankAccountInput>[];
|
|
327
|
+
linkedClients?: LinkedClientInput[];
|
|
328
|
+
},
|
|
329
|
+
options: { replaceMode: true }
|
|
330
|
+
): Promise<{
|
|
331
|
+
client: MexJYSClient;
|
|
332
|
+
addresses: SyncResult<MexAddress>;
|
|
333
|
+
contactMethods: SyncResult<ContactMethod>;
|
|
334
|
+
bankAccounts: SyncResult<MexBankAccount>;
|
|
335
|
+
}>;
|
|
336
|
+
async syncAll(
|
|
337
|
+
clientId: string,
|
|
338
|
+
data: {
|
|
339
|
+
client?: UpdateJYSClientInput;
|
|
340
|
+
addresses?: SyncItem<UpdateMexAddressInput>[];
|
|
341
|
+
contactMethods?: SyncItem<UpdateContactMethodInput>[];
|
|
342
|
+
bankAccounts?: SyncItem<UpdateBankAccountInput>[];
|
|
343
|
+
linkedClients?: LinkedClientInput[];
|
|
344
|
+
},
|
|
345
|
+
options?: { replaceMode?: boolean }
|
|
346
|
+
): Promise<{
|
|
347
|
+
client: MexJYSClient;
|
|
348
|
+
addresses: SyncResult<MexAddress>;
|
|
349
|
+
contactMethods: SyncResult<ContactMethod>;
|
|
350
|
+
bankAccounts: SyncResult<MexBankAccount>;
|
|
351
|
+
}>;
|
|
352
|
+
async syncAll(
|
|
353
|
+
clientId: string,
|
|
354
|
+
data: {
|
|
355
|
+
client?: UpdateJYSClientInput;
|
|
356
|
+
addresses?: SyncItem<UpdateMexAddressInput | CreateMexAddressInput>[];
|
|
357
|
+
contactMethods?: SyncItem<UpdateContactMethodInput | CreateContactMethodInput>[];
|
|
358
|
+
bankAccounts?: SyncItem<UpdateBankAccountInput | CreateBankAccountInput>[];
|
|
359
|
+
linkedClients?: LinkedClientInput[];
|
|
360
|
+
},
|
|
361
|
+
options?: { replaceMode?: boolean }
|
|
362
|
+
): Promise<{
|
|
363
|
+
client: MexJYSClient;
|
|
364
|
+
addresses: SyncResult<MexAddress>;
|
|
365
|
+
contactMethods: SyncResult<ContactMethod>;
|
|
366
|
+
bankAccounts: SyncResult<MexBankAccount>;
|
|
367
|
+
}> {
|
|
368
|
+
// Transform client input using JYS-specific transform
|
|
369
|
+
const transformedClient = data.client
|
|
370
|
+
? this.transformUpdateToNested(data.client)
|
|
371
|
+
: undefined;
|
|
372
|
+
|
|
373
|
+
// Call parent syncAll with transformed client data
|
|
374
|
+
const result = await super.syncAll(
|
|
375
|
+
clientId,
|
|
376
|
+
{
|
|
377
|
+
...data,
|
|
378
|
+
client: transformedClient as UpdateMexClientInput,
|
|
379
|
+
},
|
|
380
|
+
options as { replaceMode?: boolean }
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
// Re-instantiate client with JYS-specific model
|
|
384
|
+
return {
|
|
385
|
+
...result,
|
|
386
|
+
client: this.instantiate(result.client as unknown as ClientData),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// ─────────────────────────────────────────────────────────────────
|
|
391
|
+
// Protected Helpers
|
|
392
|
+
// ─────────────────────────────────────────────────────────────────
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Transforms a flattened JYSClientSort to nested ClientSort format.
|
|
396
|
+
*
|
|
397
|
+
* Maps flattened field names to their full API paths.
|
|
398
|
+
*/
|
|
399
|
+
protected override applyScopeToSort(sort?: JYSClientSort): ClientSort | undefined {
|
|
400
|
+
if (!sort || sort.length === 0) {
|
|
401
|
+
return undefined;
|
|
402
|
+
}
|
|
403
|
+
return transformSort(sort, jysClientFieldMapping);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Transforms JYS input to nested API format.
|
|
408
|
+
* JYS has no additional fields, but we add the JYS activity marker.
|
|
409
|
+
*/
|
|
410
|
+
protected override transformToNested(
|
|
411
|
+
data: CreateJYSClientInput
|
|
412
|
+
): CreateClientInput {
|
|
413
|
+
// Use parent transform for base + MX fields (cast needed for discriminated union)
|
|
414
|
+
const nested = super.transformToNested(
|
|
415
|
+
data as unknown as CreateMexClientInput
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
// Add JYS activity marker (parent always provides jurisdictions.MX)
|
|
419
|
+
const mexData = nested.jurisdictions?.MX;
|
|
420
|
+
|
|
421
|
+
return {
|
|
422
|
+
...nested,
|
|
423
|
+
jurisdictions: {
|
|
424
|
+
MX: {
|
|
425
|
+
...mexData,
|
|
426
|
+
actividadVulnerable: {
|
|
427
|
+
[CodigoActividad.JYS]: {},
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
} as CreateClientInput;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
protected override transformUpdateToNested(
|
|
435
|
+
data: UpdateJYSClientInput
|
|
436
|
+
): UpdateClientInput {
|
|
437
|
+
return super.transformUpdateToNested(
|
|
438
|
+
data as unknown as UpdateMexClientInput
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
protected override instantiate(data: ClientData): MexJYSClient {
|
|
443
|
+
return new MexJYSClient(data);
|
|
444
|
+
}
|
|
445
|
+
}
|