@artu-ai/compliance-sdk 0.0.1 → 0.0.2
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/ComplianceSDK-CuOqOAWW.d.cts +97 -0
- package/dist/ComplianceSDK-tCtb3guf.d.ts +97 -0
- package/dist/{chunk-5FWX6MJJ.js → chunk-2U5GSJXC.js} +5 -5
- package/dist/chunk-2U5GSJXC.js.map +1 -0
- package/dist/chunk-6SWNJ2RI.cjs +26 -0
- package/dist/chunk-6SWNJ2RI.cjs.map +1 -0
- package/dist/{chunk-5M73AGYR.js → chunk-HAQ3MDZ3.js} +406 -11
- package/dist/chunk-HAQ3MDZ3.js.map +1 -0
- package/dist/{chunk-FT2LSJUD.js → chunk-HHGLEYAC.js} +5 -5
- package/dist/chunk-HHGLEYAC.js.map +1 -0
- package/dist/{chunk-CLRMY27D.js → chunk-N665EEF5.js} +52 -35
- package/dist/chunk-N665EEF5.js.map +1 -0
- package/dist/chunk-NMCHGBEG.cjs +26 -0
- package/dist/chunk-NMCHGBEG.cjs.map +1 -0
- package/dist/chunk-NOYIUN35.cjs +26 -0
- package/dist/chunk-NOYIUN35.cjs.map +1 -0
- package/dist/chunk-PEMCL7LW.cjs +261 -0
- package/dist/chunk-PEMCL7LW.cjs.map +1 -0
- package/dist/{chunk-QM2YAOGD.cjs → chunk-RMHHOBDM.cjs} +406 -11
- package/dist/chunk-RMHHOBDM.cjs.map +1 -0
- package/dist/{chunk-C4N2ALDL.js → chunk-TYJGEA4A.js} +5 -5
- package/dist/chunk-TYJGEA4A.js.map +1 -0
- package/dist/{filters-BjYmxK8N.d.cts → filters-DQLprGKG.d.cts} +202 -21
- package/dist/{filters-BjYmxK8N.d.ts → filters-DQLprGKG.d.ts} +202 -21
- package/dist/index-D5qqghPa.d.cts +2738 -0
- package/dist/index-DB0m5y8e.d.ts +2738 -0
- package/dist/index.cjs +137 -85
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/mexico/actividad-vulnerable/avi.cjs +93 -83
- package/dist/mexico/actividad-vulnerable/avi.cjs.map +1 -1
- package/dist/mexico/actividad-vulnerable/avi.d.cts +579 -3
- package/dist/mexico/actividad-vulnerable/avi.d.ts +579 -3
- package/dist/mexico/actividad-vulnerable/avi.js +17 -7
- package/dist/mexico/actividad-vulnerable/avi.js.map +1 -1
- package/dist/mexico/actividad-vulnerable/jys.cjs +98 -83
- package/dist/mexico/actividad-vulnerable/jys.cjs.map +1 -1
- package/dist/mexico/actividad-vulnerable/jys.d.cts +642 -5
- package/dist/mexico/actividad-vulnerable/jys.d.ts +642 -5
- package/dist/mexico/actividad-vulnerable/jys.js +22 -7
- package/dist/mexico/actividad-vulnerable/jys.js.map +1 -1
- package/dist/mexico/actividad-vulnerable/tsc.cjs +92 -83
- package/dist/mexico/actividad-vulnerable/tsc.cjs.map +1 -1
- package/dist/mexico/actividad-vulnerable/tsc.d.cts +500 -3
- package/dist/mexico/actividad-vulnerable/tsc.d.ts +500 -3
- package/dist/mexico/actividad-vulnerable/tsc.js +16 -7
- package/dist/mexico/actividad-vulnerable/tsc.js.map +1 -1
- package/dist/mexico/index.cjs +101 -101
- package/dist/mexico/index.d.cts +1194 -77
- package/dist/mexico/index.d.ts +1194 -77
- package/dist/mexico/index.js +5 -5
- package/package.json +6 -2
- package/dist/chunk-5FWX6MJJ.js.map +0 -1
- package/dist/chunk-5M73AGYR.js.map +0 -1
- package/dist/chunk-C4N2ALDL.js.map +0 -1
- package/dist/chunk-CLRMY27D.js.map +0 -1
- package/dist/chunk-FT2LSJUD.js.map +0 -1
- package/dist/chunk-IKDGGCJO.cjs +0 -26
- package/dist/chunk-IKDGGCJO.cjs.map +0 -1
- package/dist/chunk-J2P6EUCD.cjs +0 -26
- package/dist/chunk-J2P6EUCD.cjs.map +0 -1
- package/dist/chunk-QM2YAOGD.cjs.map +0 -1
- package/dist/chunk-X3RBAIDU.cjs +0 -245
- package/dist/chunk-X3RBAIDU.cjs.map +0 -1
- package/dist/chunk-XO3OCPIN.cjs +0 -26
- package/dist/chunk-XO3OCPIN.cjs.map +0 -1
- package/dist/index-BF15okXT.d.ts +0 -777
- package/dist/index-DeVuMBhV.d.cts +0 -777
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MexicoComplianceSDKScoped, registerScope, MexAddressesResource, MexBankAccountsResource, AVIReportsResource, AVITransactionsResource, AVIClientsResource } from './chunk-HAQ3MDZ3.js';
|
|
2
2
|
|
|
3
3
|
// src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts
|
|
4
|
-
var AVIComplianceSDKScoped = class extends
|
|
4
|
+
var AVIComplianceSDKScoped = class extends MexicoComplianceSDKScoped {
|
|
5
5
|
constructor(options) {
|
|
6
|
-
super({ ...options,
|
|
6
|
+
super({ ...options, actividadVulnerable: "AVI" });
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -19,5 +19,5 @@ function registerAVIScope() {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export { AVIComplianceSDKScoped, registerAVIScope };
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-TYJGEA4A.js.map
|
|
23
|
+
//# sourceMappingURL=chunk-TYJGEA4A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts","../src/sdk/mex/actividad-vulnerable/avi/types.ts"],"names":[],"mappings":";;;AAoCO,IAAM,sBAAA,GAAN,cAAqC,yBAAA,CAA0B;AAAA,EACpE,YAAY,OAAA,EAA8B;AACxC,IAAA,KAAA,CAAM,EAAE,GAAG,OAAA,EAAS,mBAAA,EAAqB,OAAO,CAAA;AAAA,EAClD;AACF;;;ACsBO,SAAS,gBAAA,GAAyB;AACvC,EAAA,aAAA,CAAc,QAAA,EAAU;AAAA,IACtB,OAAA,EAAS,CAAC,MAAA,KAAW,IAAI,mBAAmB,MAAM,CAAA;AAAA,IAClD,YAAA,EAAc,CAAC,MAAA,KAAW,IAAI,wBAAwB,MAAM,CAAA;AAAA,IAC5D,OAAA,EAAS,CAAC,MAAA,KACR,IAAI,mBAAmB,MAAM,CAAA;AAAA,IAC/B,YAAA,EAAc,CAAC,MAAA,KAAW,IAAI,wBAAwB,MAAM,CAAA;AAAA,IAC5D,SAAA,EAAW,CAAC,MAAA,KAAW,IAAI,qBAAqB,MAAM;AAAA,GACvD,CAAA;AACH","file":"chunk-TYJGEA4A.js","sourcesContent":["/**\n * AVI-scoped ComplianceSDK\n *\n * Pre-configured SDK for Mexico jurisdiction and Activos Virtuales (AVI) activity.\n * Extends MexicoComplianceSDKScoped to inherit Mexico-specific resources like EBR.\n */\n\nimport { MexicoComplianceSDKScoped } from \"../../ComplianceSDK\";\nimport type { AVIScopedSDKOptions } from \"./types\";\n\n/**\n * AVI-scoped ComplianceSDK.\n * Pre-configured for Mexico jurisdiction and Activos Virtuales (AVI) activity.\n *\n * Inherits Mexico-specific resources:\n * - `ebr` - EBR (Evaluación Basada en Riesgos) for AML/KYC risk evaluation\n *\n * @example\n * ```typescript\n * import { ComplianceSDK } from \"@artu/compliance-sdk/mexico/actividad-vulnerable/avi\";\n *\n * const sdk = new ComplianceSDK({\n * apiKey: process.env.API_KEY!,\n * environment: \"test\",\n * });\n *\n * // Already scoped - no need to specify jurisdiction/activity\n * const client = await sdk.clients.create({\n * type: ClientType.Person,\n * name: \"Juan García\",\n * });\n *\n * // Access inherited EBR resource\n * const weights = sdk.ebr.presets.suggested();\n * ```\n */\nexport class AVIComplianceSDKScoped extends MexicoComplianceSDKScoped {\n constructor(options: AVIScopedSDKOptions) {\n super({ ...options, actividadVulnerable: \"AVI\" });\n }\n}\n","/**\n * AVI SDK Types & Registration\n *\n * Activos Virtuales (Virtual Assets) - cryptocurrency exchanges, wallets, etc.\n */\n\nimport { Jurisdiction, CodigoActividad } from \"@artu-ai/shared\";\nimport type { ComplianceSDKOptionsBase } from \"../../../types\";\nimport type { MexicoComplianceSDK } from \"../../types\";\nimport {\n AVIClientsResource,\n AVITransactionsResource,\n AVIReportsResource,\n MexBankAccountsResource,\n MexAddressesResource,\n} from \"../../../../resources\";\nimport { registerScope } from \"../../../resource-registry\";\nimport type { ReportsResource } from \"../../../../resources/reports\";\nimport type { EBRResource } from \"../../../../resources/mex/ebr\";\n\n// ===========================\n// SDK Options\n// ===========================\n\n/**\n * Options for creating an AVI-scoped SDK\n */\nexport interface AVISDKOptions extends ComplianceSDKOptionsBase {\n jurisdiction: typeof Jurisdiction.Mexico | \"MX\";\n actividadVulnerable: typeof CodigoActividad.AVI | \"AVI\";\n}\n\n/**\n * Options for AVI-scoped SDK (without jurisdiction/activity - pre-configured)\n */\nexport type AVIScopedSDKOptions = Omit<\n ComplianceSDKOptionsBase,\n \"jurisdiction\" | \"actividadVulnerable\"\n>;\n\n// ===========================\n// Typed SDK Interface\n// ===========================\n\n/**\n * Mexico AVI-scoped SDK - uses AVI resource types\n * Extends MexicoComplianceSDK with AVI-specific overrides\n */\nexport interface AVIComplianceSDK\n extends Omit<MexicoComplianceSDK, \"clients\" | \"transactions\" | \"reports\"> {\n readonly clients: AVIClientsResource;\n readonly transactions: AVITransactionsResource;\n readonly reports: AVIReportsResource;\n readonly bankAccounts: MexBankAccountsResource;\n /** EBR resource for risk-based evaluation */\n readonly ebr: EBRResource;\n}\n\n// ===========================\n// Registration\n// ===========================\n\nexport function registerAVIScope(): void {\n registerScope(\"MX:AVI\", {\n clients: (config) => new AVIClientsResource(config),\n transactions: (config) => new AVITransactionsResource(config),\n reports: (config) =>\n new AVIReportsResource(config) as unknown as ReportsResource,\n bankAccounts: (config) => new MexBankAccountsResource(config),\n addresses: (config) => new MexAddressesResource(config),\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jurisdiction, CodigoActividad, ListOptions, PaginatedResponse, IterateOptions, BaseClient, ClientType, BaseTransaction, TransactionStatus, Report as Report$1, ReportStatus, BaseReport, ReportItem as ReportItem$1, ReportItemValidationError, BaseReportItem, Address as Address$1, AddressType, CountryIso2, ContactMethod as ContactMethod$1, ContactMethodType, BankAccount as BankAccount$1, BankAccountType, CurrencyCode, DocumentResponse, DocumentCategory, DocumentStatus, MexAddressData, MexBankAccount as MexBankAccount$1, MexReportJurisdictionData, MexReportItemJurisdictionData, MexTransactionJurisdictionData, ActividadVulnerableReportData, ActividadVulnerableReportItemData, avi, jys, tsc, MexJurisdictionData, CreateClientInput, UpdateClientInput, ClientFilter, AtomicBatchResult as AtomicBatchResult$1, PartialBatchResult as PartialBatchResult$1, ClientRelationshipType, LinkedClient, CreateTransactionInput, UpdateTransactionInput, TransactionFilter, ClientRole, RelatedClient, CreateReportInput, UpdateReportInput, ReportFilter, CreateReportItemInput, UpdateReportItemInput, ReportItemFilter, ValidateReportInput, ValidationResult, GenerateResult, SubmitReportInput, SubmissionResult, CreateBankAccountInput, UpdateBankAccountInput, BankAccountFilter, CreateAddressInput, UpdateAddressInput, AddressFilter, CreateContactMethodInput, UpdateContactMethodInput, ContactMethodFilter, CreateDocumentInput, UpdateDocumentInput, DocumentFilter, CreateMexClientInput, UpdateMexClientInput, CreateMexTransactionInput, UpdateMexTransactionInput, CreateMexAddressInput, UpdateMexAddressInput, CreateMexReportInput, UpdateMexReportInput, CreateMexReportItemInput, UpdateMexReportItemInput, MexValidateReportInput, MexSubmitReportInput, CreateAVIClientInput, UpdateAVIClientInput, CreateAVITransactionInput, UpdateAVITransactionInput, CreateAVIReportInput, UpdateAVIReportInput, CreateAVIReportItemInput, UpdateAVIReportItemInput, MexAVIValidateInput, SubmitAVIReportInput, CreateJYSClientInput, UpdateJYSClientInput, CreateJYSTransactionInput, UpdateJYSTransactionInput, CreateJYSReportInput, UpdateJYSReportInput, CreateJYSReportItemInput, UpdateJYSReportItemInput, MexJYSValidateInput, SubmitJYSSubmissionInput, CreateTSCClientInput, UpdateTSCClientInput, CreateTSCTransactionInput, UpdateTSCTransactionInput, CreateTSCReportInput, UpdateTSCReportInput, CreateTSCReportItemInput, UpdateTSCReportItemInput, MexTSCValidateInput, SubmitTSCSubmissionInput } from '@artu-ai/shared';
|
|
1
|
+
import { Jurisdiction, CodigoActividad, ListOptions, PaginatedResponse, IterateOptions, BaseClient, ClientType, BaseTransaction, TransactionStatus, Report as Report$1, ReportStatus, BaseReport, ReportItem as ReportItem$1, ReportItemValidationError, BaseReportItem, Address as Address$1, AddressType, CountryIso2, ContactMethod as ContactMethod$1, ContactMethodType, BankAccount as BankAccount$1, BankAccountType, CurrencyCode, DocumentResponse, DocumentCategory, DocumentStatus, MexAddressData, MexBankAccount as MexBankAccount$1, MexReportJurisdictionData, MexReportItemJurisdictionData, MexTransactionJurisdictionData, ActividadVulnerableReportData, ActividadVulnerableReportItemData, avi, jys, tsc, MexJurisdictionData, CreateClientInput, UpdateClientInput, ClientFilter, AtomicBatchResult as AtomicBatchResult$1, PartialBatchResult as PartialBatchResult$1, ClientRelationshipType, LinkedClient, CreateTransactionInput, UpdateTransactionInput, TransactionFilter, ClientRole, RelatedClient, CreateReportInput, UpdateReportInput, ReportFilter, CreateReportItemInput, UpdateReportItemInput, ReportItemFilter, ValidateReportInput, ValidationResult, GenerateResult, SubmitReportInput, SubmissionResult, CreateBankAccountInput, UpdateBankAccountInput, BankAccountFilter, CreateAddressInput, UpdateAddressInput, AddressFilter, CreateContactMethodInput, UpdateContactMethodInput, ContactMethodFilter, CreateDocumentInput, UpdateDocumentInput, DocumentFilter, CreateMexClientInput, UpdateMexClientInput, CreateMexTransactionInput, UpdateMexTransactionInput, CreateMexAddressInput, UpdateMexAddressInput, CreateMexReportInput, UpdateMexReportInput, CreateMexReportItemInput, UpdateMexReportItemInput, MexValidateReportInput, MexSubmitReportInput, CreateEBRConfigInput, EBRConfiguration, EBRConfigListItem, WEIGHT_RANGE, ScoreThresholds, InternalRiskLevel, RegulatoryRiskLevel, CreateAVIClientInput, UpdateAVIClientInput, CreateAVITransactionInput, UpdateAVITransactionInput, CreateAVIReportInput, UpdateAVIReportInput, CreateAVIReportItemInput, UpdateAVIReportItemInput, MexAVIValidateInput, SubmitAVIReportInput, CreateJYSClientInput, UpdateJYSClientInput, CreateJYSTransactionInput, UpdateJYSTransactionInput, CreateJYSReportInput, UpdateJYSReportInput, CreateJYSReportItemInput, UpdateJYSReportItemInput, MexJYSValidateInput, SubmitJYSSubmissionInput, CreateTSCClientInput, UpdateTSCClientInput, CreateTSCTransactionInput, UpdateTSCTransactionInput, CreateTSCReportInput, UpdateTSCReportInput, CreateTSCReportItemInput, UpdateTSCReportItemInput, MexTSCValidateInput, SubmitTSCSubmissionInput } from '@artu-ai/shared';
|
|
2
2
|
import { createTRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
3
|
import { ZodType, ZodError } from 'zod';
|
|
4
4
|
|
|
@@ -134,6 +134,10 @@ interface ResourceConfig {
|
|
|
134
134
|
* Optional SDK scope for jurisdiction/activity scoping
|
|
135
135
|
*/
|
|
136
136
|
scope?: SDKScope;
|
|
137
|
+
/**
|
|
138
|
+
* SDK environment (test or live)
|
|
139
|
+
*/
|
|
140
|
+
environment?: Environment;
|
|
137
141
|
}
|
|
138
142
|
/**
|
|
139
143
|
* Abstract base class for all resource managers.
|
|
@@ -4091,33 +4095,198 @@ declare class MexReportsResource extends ReportsResource {
|
|
|
4091
4095
|
}
|
|
4092
4096
|
|
|
4093
4097
|
/**
|
|
4094
|
-
* EBR Resource
|
|
4098
|
+
* EBR Resource
|
|
4099
|
+
*
|
|
4100
|
+
* Provides the SDK interface for managing EBR (Evaluación Basada en Riesgos)
|
|
4101
|
+
* configurations. Supports both global EBR (no AV) and activity-specific EBR.
|
|
4095
4102
|
*
|
|
4096
|
-
*
|
|
4097
|
-
* Currently a placeholder for future implementation.
|
|
4103
|
+
* @module resources/mex/ebr
|
|
4098
4104
|
*/
|
|
4099
4105
|
|
|
4100
4106
|
/**
|
|
4101
|
-
*
|
|
4107
|
+
* Confidence level for weight presets.
|
|
4108
|
+
*/
|
|
4109
|
+
type PresetConfidence = "high" | "medium";
|
|
4110
|
+
/**
|
|
4111
|
+
* A weight preset for a specific Actividad Vulnerable.
|
|
4112
|
+
*/
|
|
4113
|
+
interface WeightPreset {
|
|
4114
|
+
client: number;
|
|
4115
|
+
geographic: number;
|
|
4116
|
+
product: number;
|
|
4117
|
+
transactional: number;
|
|
4118
|
+
confidence: PresetConfidence;
|
|
4119
|
+
}
|
|
4120
|
+
/**
|
|
4121
|
+
* Context for EBR resource operations.
|
|
4122
|
+
* Passed from the main SDK.
|
|
4123
|
+
*/
|
|
4124
|
+
interface EBRResourceContext {
|
|
4125
|
+
/** tRPC client for API communication (optional for backward compatibility) */
|
|
4126
|
+
trpc?: TRPCClient;
|
|
4127
|
+
/** SDK scope (jurisdiction and optional actividadVulnerable) */
|
|
4128
|
+
scope: SDKScope;
|
|
4129
|
+
/** Environment (test or live) */
|
|
4130
|
+
environment: Environment;
|
|
4131
|
+
}
|
|
4132
|
+
/**
|
|
4133
|
+
* Weights sub-resource for accessing weight configuration.
|
|
4134
|
+
*/
|
|
4135
|
+
interface EBRWeightsResource {
|
|
4136
|
+
/** Valid weight range (min: 0.10, max: 0.70) */
|
|
4137
|
+
readonly range: typeof WEIGHT_RANGE;
|
|
4138
|
+
}
|
|
4139
|
+
/**
|
|
4140
|
+
* Thresholds sub-resource for accessing threshold configuration.
|
|
4141
|
+
*/
|
|
4142
|
+
interface EBRThresholdsResource {
|
|
4143
|
+
/** Default/suggested thresholds */
|
|
4144
|
+
readonly defaults: ScoreThresholds;
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* Presets sub-resource for accessing weight presets.
|
|
4148
|
+
*/
|
|
4149
|
+
interface EBRPresetsResource {
|
|
4150
|
+
/**
|
|
4151
|
+
* Lists all available preset activity codes.
|
|
4152
|
+
* @returns Array of activity codes with presets
|
|
4153
|
+
*/
|
|
4154
|
+
list(): readonly string[];
|
|
4155
|
+
/**
|
|
4156
|
+
* Gets the preset for a specific activity.
|
|
4157
|
+
* @param activity - Activity code (e.g., "AVI", "INM")
|
|
4158
|
+
* @returns The weight preset or null if not found
|
|
4159
|
+
*/
|
|
4160
|
+
get(activity: string): WeightPreset | null;
|
|
4161
|
+
/**
|
|
4162
|
+
* Gets the suggested preset for the current SDK scope.
|
|
4163
|
+
* Returns null if SDK is not scoped to an activity or no preset exists.
|
|
4164
|
+
* @returns The suggested weight preset or null
|
|
4165
|
+
*/
|
|
4166
|
+
suggested(): WeightPreset | null;
|
|
4167
|
+
}
|
|
4168
|
+
/**
|
|
4169
|
+
* Risk level sub-resource for risk level utilities.
|
|
4170
|
+
*/
|
|
4171
|
+
interface EBRRiskLevelResource {
|
|
4172
|
+
/**
|
|
4173
|
+
* Maps an internal risk level (5) to regulatory level (3).
|
|
4174
|
+
* @param internal - Internal risk level
|
|
4175
|
+
* @returns Regulatory risk level
|
|
4176
|
+
*/
|
|
4177
|
+
mapToRegulatory(internal: InternalRiskLevel): RegulatoryRiskLevel;
|
|
4178
|
+
/**
|
|
4179
|
+
* Gets the recommended KYC update frequency for a risk level.
|
|
4180
|
+
* @param level - Internal risk level
|
|
4181
|
+
* @returns Update frequency in months
|
|
4182
|
+
*/
|
|
4183
|
+
getUpdateFrequency(level: InternalRiskLevel): number;
|
|
4184
|
+
}
|
|
4185
|
+
/**
|
|
4186
|
+
* EBR Resource
|
|
4102
4187
|
*
|
|
4103
|
-
*
|
|
4104
|
-
*
|
|
4188
|
+
* Manages EBR (Evaluación Basada en Riesgos) configurations for Mexican
|
|
4189
|
+
* AML/KYC compliance under LFPIORPI.
|
|
4190
|
+
*
|
|
4191
|
+
* Key features:
|
|
4192
|
+
* - **Immutable configurations**: No updates - each change creates a new version
|
|
4193
|
+
* - **Scope-aware**: Works with global EBR or activity-specific EBR
|
|
4194
|
+
* - **Validation**: Full client-side validation before API calls
|
|
4195
|
+
* - **Audit trail**: All versions preserved with justifications
|
|
4105
4196
|
*
|
|
4106
4197
|
* @example
|
|
4107
4198
|
* ```typescript
|
|
4108
|
-
*
|
|
4109
|
-
*
|
|
4110
|
-
*
|
|
4111
|
-
*
|
|
4199
|
+
* // Create EBR configuration
|
|
4200
|
+
* const config = await sdk.ebr.create({
|
|
4201
|
+
* weights: { client: 0.25, geographic: 0.35, product: 0.20, transactional: 0.20 },
|
|
4202
|
+
* thresholds: sdk.ebr.thresholds.defaults,
|
|
4203
|
+
* justification: "Initial configuration for Q4 2024",
|
|
4112
4204
|
* });
|
|
4113
4205
|
*
|
|
4114
|
-
* //
|
|
4115
|
-
*
|
|
4206
|
+
* // Get suggested preset for current activity
|
|
4207
|
+
* const suggested = sdk.ebr.presets.suggested();
|
|
4208
|
+
*
|
|
4209
|
+
* // Map risk level for regulatory reporting
|
|
4210
|
+
* const regulatory = sdk.ebr.riskLevel.mapToRegulatory("muy_alto"); // "alto"
|
|
4116
4211
|
* ```
|
|
4117
4212
|
*/
|
|
4118
|
-
declare class
|
|
4119
|
-
protected readonly
|
|
4120
|
-
constructor(
|
|
4213
|
+
declare class EBRResource {
|
|
4214
|
+
protected readonly ctx: EBRResourceContext;
|
|
4215
|
+
constructor(context: EBRResourceContext);
|
|
4216
|
+
/**
|
|
4217
|
+
* Gets the tRPC client, throwing if not available.
|
|
4218
|
+
*/
|
|
4219
|
+
private get trpc();
|
|
4220
|
+
/**
|
|
4221
|
+
* Creates a new EBR configuration.
|
|
4222
|
+
*
|
|
4223
|
+
* If a configuration already exists, the existing one is marked as "superseded"
|
|
4224
|
+
* and a new version is created. This maintains a complete audit trail.
|
|
4225
|
+
*
|
|
4226
|
+
* @param input - Configuration input (weights, thresholds, justification)
|
|
4227
|
+
* @returns The created EBR configuration
|
|
4228
|
+
* @throws {ValidationError} If input validation fails
|
|
4229
|
+
*/
|
|
4230
|
+
create(input: CreateEBRConfigInput): Promise<EBRConfiguration>;
|
|
4231
|
+
/**
|
|
4232
|
+
* Gets the currently active EBR configuration.
|
|
4233
|
+
*
|
|
4234
|
+
* @returns The active configuration or null if none exists
|
|
4235
|
+
*/
|
|
4236
|
+
get(): Promise<EBRConfiguration | null>;
|
|
4237
|
+
/**
|
|
4238
|
+
* Gets an EBR configuration by ID.
|
|
4239
|
+
*
|
|
4240
|
+
* @param id - Configuration ID
|
|
4241
|
+
* @returns The configuration or null if not found
|
|
4242
|
+
*/
|
|
4243
|
+
getById(id: string): Promise<EBRConfiguration | null>;
|
|
4244
|
+
/**
|
|
4245
|
+
* Gets the complete history of EBR configurations.
|
|
4246
|
+
*
|
|
4247
|
+
* @param options - Optional options including limit
|
|
4248
|
+
* @returns Array of all EBR configuration versions, newest first
|
|
4249
|
+
*/
|
|
4250
|
+
getHistory(options?: {
|
|
4251
|
+
limit?: number;
|
|
4252
|
+
}): Promise<EBRConfigListItem[]>;
|
|
4253
|
+
/**
|
|
4254
|
+
* Promotes an EBR configuration from test to live environment.
|
|
4255
|
+
*
|
|
4256
|
+
* Must be called from the test environment.
|
|
4257
|
+
*
|
|
4258
|
+
* @returns The promoted configuration (now in live)
|
|
4259
|
+
*/
|
|
4260
|
+
promote(): Promise<EBRConfiguration>;
|
|
4261
|
+
/**
|
|
4262
|
+
* Weights configuration sub-resource.
|
|
4263
|
+
*/
|
|
4264
|
+
get weights(): EBRWeightsResource;
|
|
4265
|
+
/**
|
|
4266
|
+
* Thresholds configuration sub-resource.
|
|
4267
|
+
*/
|
|
4268
|
+
get thresholds(): EBRThresholdsResource;
|
|
4269
|
+
/**
|
|
4270
|
+
* Presets sub-resource for weight presets.
|
|
4271
|
+
*/
|
|
4272
|
+
get presets(): EBRPresetsResource;
|
|
4273
|
+
/**
|
|
4274
|
+
* Risk level utilities sub-resource.
|
|
4275
|
+
*/
|
|
4276
|
+
get riskLevel(): EBRRiskLevelResource;
|
|
4277
|
+
/**
|
|
4278
|
+
* Gets the current activity from the SDK scope.
|
|
4279
|
+
*/
|
|
4280
|
+
private getCurrentActivity;
|
|
4281
|
+
/**
|
|
4282
|
+
* Wraps a tRPC operation with error mapping.
|
|
4283
|
+
*/
|
|
4284
|
+
private execute;
|
|
4285
|
+
/**
|
|
4286
|
+
* Transforms API response to EBRConfiguration type.
|
|
4287
|
+
* Converts ISO date strings from API to Date objects.
|
|
4288
|
+
*/
|
|
4289
|
+
private transformResponse;
|
|
4121
4290
|
}
|
|
4122
4291
|
|
|
4123
4292
|
/**
|
|
@@ -4865,7 +5034,10 @@ interface MexicoSDKOptions extends ComplianceSDKOptionsBase {
|
|
|
4865
5034
|
/**
|
|
4866
5035
|
* Options for Mexico-scoped SDK (without jurisdiction - pre-configured)
|
|
4867
5036
|
*/
|
|
4868
|
-
type MexicoScopedSDKOptions = Omit<ComplianceSDKOptionsBase, "jurisdiction"
|
|
5037
|
+
type MexicoScopedSDKOptions = Omit<ComplianceSDKOptionsBase, "jurisdiction"> & {
|
|
5038
|
+
/** Activity code - used by activity-scoped subclasses */
|
|
5039
|
+
actividadVulnerable?: CodigoActividad | "AVI" | "JYS" | "TSC";
|
|
5040
|
+
};
|
|
4869
5041
|
/**
|
|
4870
5042
|
* Mexico-scoped SDK - uses Mexico resource types
|
|
4871
5043
|
*/
|
|
@@ -4878,10 +5050,10 @@ interface MexicoComplianceSDK extends BaseComplianceSDK {
|
|
|
4878
5050
|
readonly contactMethods: ContactMethodsResource;
|
|
4879
5051
|
readonly documents: DocumentsResource;
|
|
4880
5052
|
/**
|
|
4881
|
-
* EBR (
|
|
4882
|
-
* Mexico-only resource for
|
|
5053
|
+
* EBR (Evaluación Basada en Riesgos) resource.
|
|
5054
|
+
* Mexico-only resource for risk-based evaluation methodology.
|
|
4883
5055
|
*/
|
|
4884
|
-
readonly ebr:
|
|
5056
|
+
readonly ebr: EBRResource;
|
|
4885
5057
|
}
|
|
4886
5058
|
|
|
4887
5059
|
/**
|
|
@@ -4909,6 +5081,9 @@ interface AVIComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4909
5081
|
readonly clients: AVIClientsResource;
|
|
4910
5082
|
readonly transactions: AVITransactionsResource;
|
|
4911
5083
|
readonly reports: AVIReportsResource;
|
|
5084
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5085
|
+
/** EBR resource for risk-based evaluation */
|
|
5086
|
+
readonly ebr: EBRResource;
|
|
4912
5087
|
}
|
|
4913
5088
|
|
|
4914
5089
|
/**
|
|
@@ -4936,6 +5111,9 @@ interface JYSComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4936
5111
|
readonly clients: JYSClientsResource;
|
|
4937
5112
|
readonly transactions: JYSTransactionsResource;
|
|
4938
5113
|
readonly reports: JYSReportsResource;
|
|
5114
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5115
|
+
/** EBR resource for risk-based evaluation */
|
|
5116
|
+
readonly ebr: EBRResource;
|
|
4939
5117
|
}
|
|
4940
5118
|
|
|
4941
5119
|
/**
|
|
@@ -4963,6 +5141,9 @@ interface TSCComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4963
5141
|
readonly clients: TSCClientsResource;
|
|
4964
5142
|
readonly transactions: TSCTransactionsResource;
|
|
4965
5143
|
readonly reports: TSCReportsResource;
|
|
5144
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5145
|
+
/** EBR resource for risk-based evaluation */
|
|
5146
|
+
readonly ebr: EBRResource;
|
|
4966
5147
|
}
|
|
4967
5148
|
|
|
4968
5149
|
/**
|
|
@@ -6184,4 +6365,4 @@ declare function isNotNull(): {
|
|
|
6184
6365
|
neq: null;
|
|
6185
6366
|
};
|
|
6186
6367
|
|
|
6187
|
-
export {
|
|
6368
|
+
export { notOneOf as $, type AVIScopedSDKOptions as A, mapTRPCError as B, ComplianceSDKImpl as C, isAPIError as D, EBRResource as E, ForbiddenError as F, isUploadError as G, type UploadStage as H, InvalidFileTypeError as I, collectAll as J, collectUpTo as K, getFirst as L, type MexicoScopedSDKOptions as M, NotFoundError as N, DEFAULT_PAGE_SIZE as O, MAX_PAGE_SIZE as P, contains as Q, RateLimitError as R, ServerError as S, TimeoutError as T, UnauthorizedError as U, ValidationError as V, startsWith as W, endsWith as X, equals as Y, notEquals as Z, oneOf as _, type ComplianceSDKOptionsMexico as a, type MexReportItemData as a$, dateRange as a0, after as a1, before as a2, onOrAfter as a3, onOrBefore as a4, numberRange as a5, greaterThan as a6, lessThan as a7, atLeast as a8, atMost as a9, MexTSCClient as aA, MexTSCTransaction as aB, MexTSCReport as aC, MexTSCReportItem as aD, TSCClientsResource as aE, TSCTransactionsResource as aF, TSCReportsResource as aG, isMexTSCClient as aH, isMexTSCTransaction as aI, isMexTSCReport as aJ, isMexTSCReportItem as aK, MexActividadVulnerableClient as aL, MexActividadVulnerableTransaction as aM, MexActividadVulnerableReport as aN, MexActividadVulnerableReportItem as aO, isActividadVulnerable as aP, isActividadVulnerableTransaction as aQ, isActividadVulnerableReport as aR, isActividadVulnerableReportItem as aS, MexClient as aT, MexTransaction as aU, MexAddress as aV, MexReport as aW, MexReportItem as aX, type MexClientData as aY, type MexTransactionData as aZ, type MexReportData as a_, isTrue as aa, isFalse as ab, isNull as ac, isNotNull as ad, Address as ae, type AddressData as af, ContactMethod as ag, type ContactMethodData as ah, Document as ai, type DocumentData as aj, AddressesResource as ak, ContactMethodsResource as al, DocumentsResource as am, type JYSScopedSDKOptions as an, MexJYSClient as ao, MexJYSTransaction as ap, MexJYSReport as aq, MexJYSReportItem as ar, JYSClientsResource as as, JYSTransactionsResource as at, JYSReportsResource as au, isMexJYSClient as av, isMexJYSTransaction as aw, isMexJYSReport as ax, isMexJYSReportItem as ay, type TSCScopedSDKOptions as az, MexAVIClient as b, MexClientsResource as b0, MexTransactionsResource as b1, MexReportsResource as b2, isMexClient as b3, isMexTransaction as b4, isMexBankAccount as b5, isMexAddress as b6, isMexReport as b7, isMexReportItem as b8, ComplianceSDK as b9, type ReportItemModel as bA, isClient as bB, isIndividual as bC, isCompany as bD, isTrust as bE, isTransaction as bF, isBankAccount as bG, isReport as bH, isReportItem as bI, type ComplianceSDKOptions as ba, type ComplianceSDKConstructor as bb, type SDKScope as bc, BaseResource as bd, ReadOnlyResource as be, type ResourceConfig as bf, ClientsResource as bg, TransactionsResource as bh, BankAccountsResource as bi, ReportsResource as bj, type AddItemsResult as bk, BaseModel as bl, Client as bm, type ClientData as bn, Transaction as bo, type TransactionData as bp, Report as bq, type ReportData as br, ReportItem as bs, type ReportItemData as bt, BankAccount as bu, type BankAccountData as bv, type ClientModel as bw, type TransactionModel as bx, type BankAccountModel as by, type ReportModel as bz, MexAVITransaction as c, MexAVIReport as d, MexAVIReportItem as e, MexBankAccount as f, AVIClientsResource as g, AVITransactionsResource as h, AVIReportsResource as i, MexBankAccountsResource as j, isMexAVIClient as k, isMexAVITransaction as l, isMexAVIReport as m, isMexAVIReportItem as n, type MexBankAccountData as o, ComplianceError as p, type ComplianceErrorOptions as q, type ComplianceErrorJSON as r, type ValidationIssue as s, APIError as t, NetworkError as u, UploadError as v, FileTooLargeError as w, UploadTimeoutError as x, UploadAbortedError as y, UploadUrlExpiredError as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jurisdiction, CodigoActividad, ListOptions, PaginatedResponse, IterateOptions, BaseClient, ClientType, BaseTransaction, TransactionStatus, Report as Report$1, ReportStatus, BaseReport, ReportItem as ReportItem$1, ReportItemValidationError, BaseReportItem, Address as Address$1, AddressType, CountryIso2, ContactMethod as ContactMethod$1, ContactMethodType, BankAccount as BankAccount$1, BankAccountType, CurrencyCode, DocumentResponse, DocumentCategory, DocumentStatus, MexAddressData, MexBankAccount as MexBankAccount$1, MexReportJurisdictionData, MexReportItemJurisdictionData, MexTransactionJurisdictionData, ActividadVulnerableReportData, ActividadVulnerableReportItemData, avi, jys, tsc, MexJurisdictionData, CreateClientInput, UpdateClientInput, ClientFilter, AtomicBatchResult as AtomicBatchResult$1, PartialBatchResult as PartialBatchResult$1, ClientRelationshipType, LinkedClient, CreateTransactionInput, UpdateTransactionInput, TransactionFilter, ClientRole, RelatedClient, CreateReportInput, UpdateReportInput, ReportFilter, CreateReportItemInput, UpdateReportItemInput, ReportItemFilter, ValidateReportInput, ValidationResult, GenerateResult, SubmitReportInput, SubmissionResult, CreateBankAccountInput, UpdateBankAccountInput, BankAccountFilter, CreateAddressInput, UpdateAddressInput, AddressFilter, CreateContactMethodInput, UpdateContactMethodInput, ContactMethodFilter, CreateDocumentInput, UpdateDocumentInput, DocumentFilter, CreateMexClientInput, UpdateMexClientInput, CreateMexTransactionInput, UpdateMexTransactionInput, CreateMexAddressInput, UpdateMexAddressInput, CreateMexReportInput, UpdateMexReportInput, CreateMexReportItemInput, UpdateMexReportItemInput, MexValidateReportInput, MexSubmitReportInput, CreateAVIClientInput, UpdateAVIClientInput, CreateAVITransactionInput, UpdateAVITransactionInput, CreateAVIReportInput, UpdateAVIReportInput, CreateAVIReportItemInput, UpdateAVIReportItemInput, MexAVIValidateInput, SubmitAVIReportInput, CreateJYSClientInput, UpdateJYSClientInput, CreateJYSTransactionInput, UpdateJYSTransactionInput, CreateJYSReportInput, UpdateJYSReportInput, CreateJYSReportItemInput, UpdateJYSReportItemInput, MexJYSValidateInput, SubmitJYSSubmissionInput, CreateTSCClientInput, UpdateTSCClientInput, CreateTSCTransactionInput, UpdateTSCTransactionInput, CreateTSCReportInput, UpdateTSCReportInput, CreateTSCReportItemInput, UpdateTSCReportItemInput, MexTSCValidateInput, SubmitTSCSubmissionInput } from '@artu-ai/shared';
|
|
1
|
+
import { Jurisdiction, CodigoActividad, ListOptions, PaginatedResponse, IterateOptions, BaseClient, ClientType, BaseTransaction, TransactionStatus, Report as Report$1, ReportStatus, BaseReport, ReportItem as ReportItem$1, ReportItemValidationError, BaseReportItem, Address as Address$1, AddressType, CountryIso2, ContactMethod as ContactMethod$1, ContactMethodType, BankAccount as BankAccount$1, BankAccountType, CurrencyCode, DocumentResponse, DocumentCategory, DocumentStatus, MexAddressData, MexBankAccount as MexBankAccount$1, MexReportJurisdictionData, MexReportItemJurisdictionData, MexTransactionJurisdictionData, ActividadVulnerableReportData, ActividadVulnerableReportItemData, avi, jys, tsc, MexJurisdictionData, CreateClientInput, UpdateClientInput, ClientFilter, AtomicBatchResult as AtomicBatchResult$1, PartialBatchResult as PartialBatchResult$1, ClientRelationshipType, LinkedClient, CreateTransactionInput, UpdateTransactionInput, TransactionFilter, ClientRole, RelatedClient, CreateReportInput, UpdateReportInput, ReportFilter, CreateReportItemInput, UpdateReportItemInput, ReportItemFilter, ValidateReportInput, ValidationResult, GenerateResult, SubmitReportInput, SubmissionResult, CreateBankAccountInput, UpdateBankAccountInput, BankAccountFilter, CreateAddressInput, UpdateAddressInput, AddressFilter, CreateContactMethodInput, UpdateContactMethodInput, ContactMethodFilter, CreateDocumentInput, UpdateDocumentInput, DocumentFilter, CreateMexClientInput, UpdateMexClientInput, CreateMexTransactionInput, UpdateMexTransactionInput, CreateMexAddressInput, UpdateMexAddressInput, CreateMexReportInput, UpdateMexReportInput, CreateMexReportItemInput, UpdateMexReportItemInput, MexValidateReportInput, MexSubmitReportInput, CreateEBRConfigInput, EBRConfiguration, EBRConfigListItem, WEIGHT_RANGE, ScoreThresholds, InternalRiskLevel, RegulatoryRiskLevel, CreateAVIClientInput, UpdateAVIClientInput, CreateAVITransactionInput, UpdateAVITransactionInput, CreateAVIReportInput, UpdateAVIReportInput, CreateAVIReportItemInput, UpdateAVIReportItemInput, MexAVIValidateInput, SubmitAVIReportInput, CreateJYSClientInput, UpdateJYSClientInput, CreateJYSTransactionInput, UpdateJYSTransactionInput, CreateJYSReportInput, UpdateJYSReportInput, CreateJYSReportItemInput, UpdateJYSReportItemInput, MexJYSValidateInput, SubmitJYSSubmissionInput, CreateTSCClientInput, UpdateTSCClientInput, CreateTSCTransactionInput, UpdateTSCTransactionInput, CreateTSCReportInput, UpdateTSCReportInput, CreateTSCReportItemInput, UpdateTSCReportItemInput, MexTSCValidateInput, SubmitTSCSubmissionInput } from '@artu-ai/shared';
|
|
2
2
|
import { createTRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
3
|
import { ZodType, ZodError } from 'zod';
|
|
4
4
|
|
|
@@ -134,6 +134,10 @@ interface ResourceConfig {
|
|
|
134
134
|
* Optional SDK scope for jurisdiction/activity scoping
|
|
135
135
|
*/
|
|
136
136
|
scope?: SDKScope;
|
|
137
|
+
/**
|
|
138
|
+
* SDK environment (test or live)
|
|
139
|
+
*/
|
|
140
|
+
environment?: Environment;
|
|
137
141
|
}
|
|
138
142
|
/**
|
|
139
143
|
* Abstract base class for all resource managers.
|
|
@@ -4091,33 +4095,198 @@ declare class MexReportsResource extends ReportsResource {
|
|
|
4091
4095
|
}
|
|
4092
4096
|
|
|
4093
4097
|
/**
|
|
4094
|
-
* EBR Resource
|
|
4098
|
+
* EBR Resource
|
|
4099
|
+
*
|
|
4100
|
+
* Provides the SDK interface for managing EBR (Evaluación Basada en Riesgos)
|
|
4101
|
+
* configurations. Supports both global EBR (no AV) and activity-specific EBR.
|
|
4095
4102
|
*
|
|
4096
|
-
*
|
|
4097
|
-
* Currently a placeholder for future implementation.
|
|
4103
|
+
* @module resources/mex/ebr
|
|
4098
4104
|
*/
|
|
4099
4105
|
|
|
4100
4106
|
/**
|
|
4101
|
-
*
|
|
4107
|
+
* Confidence level for weight presets.
|
|
4108
|
+
*/
|
|
4109
|
+
type PresetConfidence = "high" | "medium";
|
|
4110
|
+
/**
|
|
4111
|
+
* A weight preset for a specific Actividad Vulnerable.
|
|
4112
|
+
*/
|
|
4113
|
+
interface WeightPreset {
|
|
4114
|
+
client: number;
|
|
4115
|
+
geographic: number;
|
|
4116
|
+
product: number;
|
|
4117
|
+
transactional: number;
|
|
4118
|
+
confidence: PresetConfidence;
|
|
4119
|
+
}
|
|
4120
|
+
/**
|
|
4121
|
+
* Context for EBR resource operations.
|
|
4122
|
+
* Passed from the main SDK.
|
|
4123
|
+
*/
|
|
4124
|
+
interface EBRResourceContext {
|
|
4125
|
+
/** tRPC client for API communication (optional for backward compatibility) */
|
|
4126
|
+
trpc?: TRPCClient;
|
|
4127
|
+
/** SDK scope (jurisdiction and optional actividadVulnerable) */
|
|
4128
|
+
scope: SDKScope;
|
|
4129
|
+
/** Environment (test or live) */
|
|
4130
|
+
environment: Environment;
|
|
4131
|
+
}
|
|
4132
|
+
/**
|
|
4133
|
+
* Weights sub-resource for accessing weight configuration.
|
|
4134
|
+
*/
|
|
4135
|
+
interface EBRWeightsResource {
|
|
4136
|
+
/** Valid weight range (min: 0.10, max: 0.70) */
|
|
4137
|
+
readonly range: typeof WEIGHT_RANGE;
|
|
4138
|
+
}
|
|
4139
|
+
/**
|
|
4140
|
+
* Thresholds sub-resource for accessing threshold configuration.
|
|
4141
|
+
*/
|
|
4142
|
+
interface EBRThresholdsResource {
|
|
4143
|
+
/** Default/suggested thresholds */
|
|
4144
|
+
readonly defaults: ScoreThresholds;
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* Presets sub-resource for accessing weight presets.
|
|
4148
|
+
*/
|
|
4149
|
+
interface EBRPresetsResource {
|
|
4150
|
+
/**
|
|
4151
|
+
* Lists all available preset activity codes.
|
|
4152
|
+
* @returns Array of activity codes with presets
|
|
4153
|
+
*/
|
|
4154
|
+
list(): readonly string[];
|
|
4155
|
+
/**
|
|
4156
|
+
* Gets the preset for a specific activity.
|
|
4157
|
+
* @param activity - Activity code (e.g., "AVI", "INM")
|
|
4158
|
+
* @returns The weight preset or null if not found
|
|
4159
|
+
*/
|
|
4160
|
+
get(activity: string): WeightPreset | null;
|
|
4161
|
+
/**
|
|
4162
|
+
* Gets the suggested preset for the current SDK scope.
|
|
4163
|
+
* Returns null if SDK is not scoped to an activity or no preset exists.
|
|
4164
|
+
* @returns The suggested weight preset or null
|
|
4165
|
+
*/
|
|
4166
|
+
suggested(): WeightPreset | null;
|
|
4167
|
+
}
|
|
4168
|
+
/**
|
|
4169
|
+
* Risk level sub-resource for risk level utilities.
|
|
4170
|
+
*/
|
|
4171
|
+
interface EBRRiskLevelResource {
|
|
4172
|
+
/**
|
|
4173
|
+
* Maps an internal risk level (5) to regulatory level (3).
|
|
4174
|
+
* @param internal - Internal risk level
|
|
4175
|
+
* @returns Regulatory risk level
|
|
4176
|
+
*/
|
|
4177
|
+
mapToRegulatory(internal: InternalRiskLevel): RegulatoryRiskLevel;
|
|
4178
|
+
/**
|
|
4179
|
+
* Gets the recommended KYC update frequency for a risk level.
|
|
4180
|
+
* @param level - Internal risk level
|
|
4181
|
+
* @returns Update frequency in months
|
|
4182
|
+
*/
|
|
4183
|
+
getUpdateFrequency(level: InternalRiskLevel): number;
|
|
4184
|
+
}
|
|
4185
|
+
/**
|
|
4186
|
+
* EBR Resource
|
|
4102
4187
|
*
|
|
4103
|
-
*
|
|
4104
|
-
*
|
|
4188
|
+
* Manages EBR (Evaluación Basada en Riesgos) configurations for Mexican
|
|
4189
|
+
* AML/KYC compliance under LFPIORPI.
|
|
4190
|
+
*
|
|
4191
|
+
* Key features:
|
|
4192
|
+
* - **Immutable configurations**: No updates - each change creates a new version
|
|
4193
|
+
* - **Scope-aware**: Works with global EBR or activity-specific EBR
|
|
4194
|
+
* - **Validation**: Full client-side validation before API calls
|
|
4195
|
+
* - **Audit trail**: All versions preserved with justifications
|
|
4105
4196
|
*
|
|
4106
4197
|
* @example
|
|
4107
4198
|
* ```typescript
|
|
4108
|
-
*
|
|
4109
|
-
*
|
|
4110
|
-
*
|
|
4111
|
-
*
|
|
4199
|
+
* // Create EBR configuration
|
|
4200
|
+
* const config = await sdk.ebr.create({
|
|
4201
|
+
* weights: { client: 0.25, geographic: 0.35, product: 0.20, transactional: 0.20 },
|
|
4202
|
+
* thresholds: sdk.ebr.thresholds.defaults,
|
|
4203
|
+
* justification: "Initial configuration for Q4 2024",
|
|
4112
4204
|
* });
|
|
4113
4205
|
*
|
|
4114
|
-
* //
|
|
4115
|
-
*
|
|
4206
|
+
* // Get suggested preset for current activity
|
|
4207
|
+
* const suggested = sdk.ebr.presets.suggested();
|
|
4208
|
+
*
|
|
4209
|
+
* // Map risk level for regulatory reporting
|
|
4210
|
+
* const regulatory = sdk.ebr.riskLevel.mapToRegulatory("muy_alto"); // "alto"
|
|
4116
4211
|
* ```
|
|
4117
4212
|
*/
|
|
4118
|
-
declare class
|
|
4119
|
-
protected readonly
|
|
4120
|
-
constructor(
|
|
4213
|
+
declare class EBRResource {
|
|
4214
|
+
protected readonly ctx: EBRResourceContext;
|
|
4215
|
+
constructor(context: EBRResourceContext);
|
|
4216
|
+
/**
|
|
4217
|
+
* Gets the tRPC client, throwing if not available.
|
|
4218
|
+
*/
|
|
4219
|
+
private get trpc();
|
|
4220
|
+
/**
|
|
4221
|
+
* Creates a new EBR configuration.
|
|
4222
|
+
*
|
|
4223
|
+
* If a configuration already exists, the existing one is marked as "superseded"
|
|
4224
|
+
* and a new version is created. This maintains a complete audit trail.
|
|
4225
|
+
*
|
|
4226
|
+
* @param input - Configuration input (weights, thresholds, justification)
|
|
4227
|
+
* @returns The created EBR configuration
|
|
4228
|
+
* @throws {ValidationError} If input validation fails
|
|
4229
|
+
*/
|
|
4230
|
+
create(input: CreateEBRConfigInput): Promise<EBRConfiguration>;
|
|
4231
|
+
/**
|
|
4232
|
+
* Gets the currently active EBR configuration.
|
|
4233
|
+
*
|
|
4234
|
+
* @returns The active configuration or null if none exists
|
|
4235
|
+
*/
|
|
4236
|
+
get(): Promise<EBRConfiguration | null>;
|
|
4237
|
+
/**
|
|
4238
|
+
* Gets an EBR configuration by ID.
|
|
4239
|
+
*
|
|
4240
|
+
* @param id - Configuration ID
|
|
4241
|
+
* @returns The configuration or null if not found
|
|
4242
|
+
*/
|
|
4243
|
+
getById(id: string): Promise<EBRConfiguration | null>;
|
|
4244
|
+
/**
|
|
4245
|
+
* Gets the complete history of EBR configurations.
|
|
4246
|
+
*
|
|
4247
|
+
* @param options - Optional options including limit
|
|
4248
|
+
* @returns Array of all EBR configuration versions, newest first
|
|
4249
|
+
*/
|
|
4250
|
+
getHistory(options?: {
|
|
4251
|
+
limit?: number;
|
|
4252
|
+
}): Promise<EBRConfigListItem[]>;
|
|
4253
|
+
/**
|
|
4254
|
+
* Promotes an EBR configuration from test to live environment.
|
|
4255
|
+
*
|
|
4256
|
+
* Must be called from the test environment.
|
|
4257
|
+
*
|
|
4258
|
+
* @returns The promoted configuration (now in live)
|
|
4259
|
+
*/
|
|
4260
|
+
promote(): Promise<EBRConfiguration>;
|
|
4261
|
+
/**
|
|
4262
|
+
* Weights configuration sub-resource.
|
|
4263
|
+
*/
|
|
4264
|
+
get weights(): EBRWeightsResource;
|
|
4265
|
+
/**
|
|
4266
|
+
* Thresholds configuration sub-resource.
|
|
4267
|
+
*/
|
|
4268
|
+
get thresholds(): EBRThresholdsResource;
|
|
4269
|
+
/**
|
|
4270
|
+
* Presets sub-resource for weight presets.
|
|
4271
|
+
*/
|
|
4272
|
+
get presets(): EBRPresetsResource;
|
|
4273
|
+
/**
|
|
4274
|
+
* Risk level utilities sub-resource.
|
|
4275
|
+
*/
|
|
4276
|
+
get riskLevel(): EBRRiskLevelResource;
|
|
4277
|
+
/**
|
|
4278
|
+
* Gets the current activity from the SDK scope.
|
|
4279
|
+
*/
|
|
4280
|
+
private getCurrentActivity;
|
|
4281
|
+
/**
|
|
4282
|
+
* Wraps a tRPC operation with error mapping.
|
|
4283
|
+
*/
|
|
4284
|
+
private execute;
|
|
4285
|
+
/**
|
|
4286
|
+
* Transforms API response to EBRConfiguration type.
|
|
4287
|
+
* Converts ISO date strings from API to Date objects.
|
|
4288
|
+
*/
|
|
4289
|
+
private transformResponse;
|
|
4121
4290
|
}
|
|
4122
4291
|
|
|
4123
4292
|
/**
|
|
@@ -4865,7 +5034,10 @@ interface MexicoSDKOptions extends ComplianceSDKOptionsBase {
|
|
|
4865
5034
|
/**
|
|
4866
5035
|
* Options for Mexico-scoped SDK (without jurisdiction - pre-configured)
|
|
4867
5036
|
*/
|
|
4868
|
-
type MexicoScopedSDKOptions = Omit<ComplianceSDKOptionsBase, "jurisdiction"
|
|
5037
|
+
type MexicoScopedSDKOptions = Omit<ComplianceSDKOptionsBase, "jurisdiction"> & {
|
|
5038
|
+
/** Activity code - used by activity-scoped subclasses */
|
|
5039
|
+
actividadVulnerable?: CodigoActividad | "AVI" | "JYS" | "TSC";
|
|
5040
|
+
};
|
|
4869
5041
|
/**
|
|
4870
5042
|
* Mexico-scoped SDK - uses Mexico resource types
|
|
4871
5043
|
*/
|
|
@@ -4878,10 +5050,10 @@ interface MexicoComplianceSDK extends BaseComplianceSDK {
|
|
|
4878
5050
|
readonly contactMethods: ContactMethodsResource;
|
|
4879
5051
|
readonly documents: DocumentsResource;
|
|
4880
5052
|
/**
|
|
4881
|
-
* EBR (
|
|
4882
|
-
* Mexico-only resource for
|
|
5053
|
+
* EBR (Evaluación Basada en Riesgos) resource.
|
|
5054
|
+
* Mexico-only resource for risk-based evaluation methodology.
|
|
4883
5055
|
*/
|
|
4884
|
-
readonly ebr:
|
|
5056
|
+
readonly ebr: EBRResource;
|
|
4885
5057
|
}
|
|
4886
5058
|
|
|
4887
5059
|
/**
|
|
@@ -4909,6 +5081,9 @@ interface AVIComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4909
5081
|
readonly clients: AVIClientsResource;
|
|
4910
5082
|
readonly transactions: AVITransactionsResource;
|
|
4911
5083
|
readonly reports: AVIReportsResource;
|
|
5084
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5085
|
+
/** EBR resource for risk-based evaluation */
|
|
5086
|
+
readonly ebr: EBRResource;
|
|
4912
5087
|
}
|
|
4913
5088
|
|
|
4914
5089
|
/**
|
|
@@ -4936,6 +5111,9 @@ interface JYSComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4936
5111
|
readonly clients: JYSClientsResource;
|
|
4937
5112
|
readonly transactions: JYSTransactionsResource;
|
|
4938
5113
|
readonly reports: JYSReportsResource;
|
|
5114
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5115
|
+
/** EBR resource for risk-based evaluation */
|
|
5116
|
+
readonly ebr: EBRResource;
|
|
4939
5117
|
}
|
|
4940
5118
|
|
|
4941
5119
|
/**
|
|
@@ -4963,6 +5141,9 @@ interface TSCComplianceSDK extends Omit<MexicoComplianceSDK, "clients" | "transa
|
|
|
4963
5141
|
readonly clients: TSCClientsResource;
|
|
4964
5142
|
readonly transactions: TSCTransactionsResource;
|
|
4965
5143
|
readonly reports: TSCReportsResource;
|
|
5144
|
+
readonly bankAccounts: MexBankAccountsResource;
|
|
5145
|
+
/** EBR resource for risk-based evaluation */
|
|
5146
|
+
readonly ebr: EBRResource;
|
|
4966
5147
|
}
|
|
4967
5148
|
|
|
4968
5149
|
/**
|
|
@@ -6184,4 +6365,4 @@ declare function isNotNull(): {
|
|
|
6184
6365
|
neq: null;
|
|
6185
6366
|
};
|
|
6186
6367
|
|
|
6187
|
-
export {
|
|
6368
|
+
export { notOneOf as $, type AVIScopedSDKOptions as A, mapTRPCError as B, ComplianceSDKImpl as C, isAPIError as D, EBRResource as E, ForbiddenError as F, isUploadError as G, type UploadStage as H, InvalidFileTypeError as I, collectAll as J, collectUpTo as K, getFirst as L, type MexicoScopedSDKOptions as M, NotFoundError as N, DEFAULT_PAGE_SIZE as O, MAX_PAGE_SIZE as P, contains as Q, RateLimitError as R, ServerError as S, TimeoutError as T, UnauthorizedError as U, ValidationError as V, startsWith as W, endsWith as X, equals as Y, notEquals as Z, oneOf as _, type ComplianceSDKOptionsMexico as a, type MexReportItemData as a$, dateRange as a0, after as a1, before as a2, onOrAfter as a3, onOrBefore as a4, numberRange as a5, greaterThan as a6, lessThan as a7, atLeast as a8, atMost as a9, MexTSCClient as aA, MexTSCTransaction as aB, MexTSCReport as aC, MexTSCReportItem as aD, TSCClientsResource as aE, TSCTransactionsResource as aF, TSCReportsResource as aG, isMexTSCClient as aH, isMexTSCTransaction as aI, isMexTSCReport as aJ, isMexTSCReportItem as aK, MexActividadVulnerableClient as aL, MexActividadVulnerableTransaction as aM, MexActividadVulnerableReport as aN, MexActividadVulnerableReportItem as aO, isActividadVulnerable as aP, isActividadVulnerableTransaction as aQ, isActividadVulnerableReport as aR, isActividadVulnerableReportItem as aS, MexClient as aT, MexTransaction as aU, MexAddress as aV, MexReport as aW, MexReportItem as aX, type MexClientData as aY, type MexTransactionData as aZ, type MexReportData as a_, isTrue as aa, isFalse as ab, isNull as ac, isNotNull as ad, Address as ae, type AddressData as af, ContactMethod as ag, type ContactMethodData as ah, Document as ai, type DocumentData as aj, AddressesResource as ak, ContactMethodsResource as al, DocumentsResource as am, type JYSScopedSDKOptions as an, MexJYSClient as ao, MexJYSTransaction as ap, MexJYSReport as aq, MexJYSReportItem as ar, JYSClientsResource as as, JYSTransactionsResource as at, JYSReportsResource as au, isMexJYSClient as av, isMexJYSTransaction as aw, isMexJYSReport as ax, isMexJYSReportItem as ay, type TSCScopedSDKOptions as az, MexAVIClient as b, MexClientsResource as b0, MexTransactionsResource as b1, MexReportsResource as b2, isMexClient as b3, isMexTransaction as b4, isMexBankAccount as b5, isMexAddress as b6, isMexReport as b7, isMexReportItem as b8, ComplianceSDK as b9, type ReportItemModel as bA, isClient as bB, isIndividual as bC, isCompany as bD, isTrust as bE, isTransaction as bF, isBankAccount as bG, isReport as bH, isReportItem as bI, type ComplianceSDKOptions as ba, type ComplianceSDKConstructor as bb, type SDKScope as bc, BaseResource as bd, ReadOnlyResource as be, type ResourceConfig as bf, ClientsResource as bg, TransactionsResource as bh, BankAccountsResource as bi, ReportsResource as bj, type AddItemsResult as bk, BaseModel as bl, Client as bm, type ClientData as bn, Transaction as bo, type TransactionData as bp, Report as bq, type ReportData as br, ReportItem as bs, type ReportItemData as bt, BankAccount as bu, type BankAccountData as bv, type ClientModel as bw, type TransactionModel as bx, type BankAccountModel as by, type ReportModel as bz, MexAVITransaction as c, MexAVIReport as d, MexAVIReportItem as e, MexBankAccount as f, AVIClientsResource as g, AVITransactionsResource as h, AVIReportsResource as i, MexBankAccountsResource as j, isMexAVIClient as k, isMexAVITransaction as l, isMexAVIReport as m, isMexAVIReportItem as n, type MexBankAccountData as o, ComplianceError as p, type ComplianceErrorOptions as q, type ComplianceErrorJSON as r, type ValidationIssue as s, APIError as t, NetworkError as u, UploadError as v, FileTooLargeError as w, UploadTimeoutError as x, UploadAbortedError as y, UploadUrlExpiredError as z };
|