@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,4 +1,4 @@
|
|
|
1
|
-
import { Jurisdiction, ClientType, TransactionStatus, ReportStatus, AddressType, ContactMethodType, BankAccountType, DocumentStatus, DocumentCategory, MexDocumentType, avi, jys, tsc, createClientInputSchema, updateClientInputSchema, linkedClientSchema, createTransactionInputSchema, updateTransactionInputSchema, createReportInputSchema, updateReportInputSchema, createReportItemInputSchema, updateReportItemInputSchema, validateReportInputSchema, submitReportInputSchema, createAddressInputSchema, updateAddressInputSchema, createContactMethodInputSchema, updateContactMethodInputSchema, createBankAccountInputSchema, updateBankAccountInputSchema, createDocumentInputSchema, updateDocumentInputSchema, createMexClientInputSchema, updateMexClientInputSchema, createMexTransactionInputSchema, updateMexTransactionInputSchema, createMexReportInputSchema, updateMexReportInputSchema, createMexReportItemInputSchema, updateMexReportItemInputSchema, mexValidateReportInputSchema, mexSubmitReportInputSchema, createAVIClientInputSchema, updateAVIClientInputSchema, CodigoActividad, createAVITransactionInputSchema, updateAVITransactionInputSchema, createAVIReportInputSchema, updateAVIReportInputSchema, createAVIReportItemInputSchema, updateAVIReportItemInputSchema, mexAviValidateInputSchema, submitAVIReportInputSchema, createJYSClientInputSchema, updateJYSClientInputSchema, createJYSTransactionInputSchema, updateJYSTransactionInputSchema, createJYSReportInputSchema, updateJYSReportInputSchema, createJYSReportItemInputSchema, updateJYSReportItemInputSchema, mexJysValidateInputSchema, submitJYSSubmissionInputSchema, createTSCClientInputSchema, updateTSCClientInputSchema, createTSCTransactionInputSchema, updateTSCTransactionInputSchema, createTSCReportInputSchema, updateTSCReportInputSchema, createTSCReportItemInputSchema, updateTSCReportItemInputSchema, mexTscValidateInputSchema, submitTSCSubmissionInputSchema, createMexAddressInputSchema, updateMexAddressInputSchema } from '@artu-ai/shared';
|
|
1
|
+
import { Jurisdiction, ClientType, TransactionStatus, ReportStatus, AddressType, ContactMethodType, BankAccountType, DocumentStatus, DocumentCategory, MexDocumentType, avi, jys, tsc, createClientInputSchema, updateClientInputSchema, linkedClientSchema, createTransactionInputSchema, updateTransactionInputSchema, createReportInputSchema, updateReportInputSchema, createReportItemInputSchema, updateReportItemInputSchema, validateReportInputSchema, submitReportInputSchema, createAddressInputSchema, updateAddressInputSchema, createContactMethodInputSchema, updateContactMethodInputSchema, createBankAccountInputSchema, updateBankAccountInputSchema, createDocumentInputSchema, updateDocumentInputSchema, createMexClientInputSchema, updateMexClientInputSchema, createMexTransactionInputSchema, updateMexTransactionInputSchema, createMexReportInputSchema, updateMexReportInputSchema, createMexReportItemInputSchema, updateMexReportItemInputSchema, mexValidateReportInputSchema, mexSubmitReportInputSchema, createAVIClientInputSchema, updateAVIClientInputSchema, CodigoActividad, createAVITransactionInputSchema, updateAVITransactionInputSchema, createAVIReportInputSchema, updateAVIReportInputSchema, createAVIReportItemInputSchema, updateAVIReportItemInputSchema, mexAviValidateInputSchema, submitAVIReportInputSchema, createJYSClientInputSchema, updateJYSClientInputSchema, createJYSTransactionInputSchema, updateJYSTransactionInputSchema, createJYSReportInputSchema, updateJYSReportInputSchema, createJYSReportItemInputSchema, updateJYSReportItemInputSchema, mexJysValidateInputSchema, submitJYSSubmissionInputSchema, createTSCClientInputSchema, updateTSCClientInputSchema, createTSCTransactionInputSchema, updateTSCTransactionInputSchema, createTSCReportInputSchema, updateTSCReportInputSchema, createTSCReportItemInputSchema, updateTSCReportItemInputSchema, mexTscValidateInputSchema, submitTSCSubmissionInputSchema, createMexAddressInputSchema, updateMexAddressInputSchema, CreateEBRConfigInputSchema, WEIGHT_RANGE, DEFAULT_THRESHOLDS, RiskLevels } from '@artu-ai/shared';
|
|
2
2
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __export = (target, all) => {
|
|
@@ -21626,12 +21626,345 @@ var MexAddressesResource = class extends AddressesResource {
|
|
|
21626
21626
|
return new MexAddress(data);
|
|
21627
21627
|
}
|
|
21628
21628
|
};
|
|
21629
|
-
|
|
21630
|
-
//
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21634
|
-
|
|
21629
|
+
var WEIGHT_PRESETS = {
|
|
21630
|
+
// Inmobiliarias (Real Estate)
|
|
21631
|
+
INM: {
|
|
21632
|
+
client: 0.25,
|
|
21633
|
+
geographic: 0.35,
|
|
21634
|
+
product: 0.2,
|
|
21635
|
+
transactional: 0.2,
|
|
21636
|
+
confidence: "high"
|
|
21637
|
+
},
|
|
21638
|
+
// Metales Preciosos y Joyería (Precious Metals & Jewelry - DPMS)
|
|
21639
|
+
MPJ: {
|
|
21640
|
+
client: 0.25,
|
|
21641
|
+
geographic: 0.2,
|
|
21642
|
+
product: 0.2,
|
|
21643
|
+
transactional: 0.35,
|
|
21644
|
+
confidence: "high"
|
|
21645
|
+
},
|
|
21646
|
+
// Notarios y Corredores (Notaries & Brokers)
|
|
21647
|
+
NOT: {
|
|
21648
|
+
client: 0.4,
|
|
21649
|
+
geographic: 0.2,
|
|
21650
|
+
product: 0.25,
|
|
21651
|
+
transactional: 0.15,
|
|
21652
|
+
confidence: "high"
|
|
21653
|
+
},
|
|
21654
|
+
// Casas de Empeño (Pawn Shops)
|
|
21655
|
+
EMP: {
|
|
21656
|
+
client: 0.25,
|
|
21657
|
+
geographic: 0.2,
|
|
21658
|
+
product: 0.2,
|
|
21659
|
+
transactional: 0.35,
|
|
21660
|
+
confidence: "medium"
|
|
21661
|
+
},
|
|
21662
|
+
// Blindaje de Vehículos (Vehicle Armoring)
|
|
21663
|
+
BLI: {
|
|
21664
|
+
client: 0.35,
|
|
21665
|
+
geographic: 0.25,
|
|
21666
|
+
product: 0.3,
|
|
21667
|
+
transactional: 0.1,
|
|
21668
|
+
confidence: "medium"
|
|
21669
|
+
},
|
|
21670
|
+
// Venta de Vehículos (Vehicle Sales)
|
|
21671
|
+
VEH: {
|
|
21672
|
+
client: 0.25,
|
|
21673
|
+
geographic: 0.2,
|
|
21674
|
+
product: 0.25,
|
|
21675
|
+
transactional: 0.3,
|
|
21676
|
+
confidence: "high"
|
|
21677
|
+
},
|
|
21678
|
+
// Activos Virtuales (Virtual Assets - PSAV)
|
|
21679
|
+
AVI: {
|
|
21680
|
+
client: 0.35,
|
|
21681
|
+
geographic: 0.15,
|
|
21682
|
+
product: 0.3,
|
|
21683
|
+
transactional: 0.2,
|
|
21684
|
+
confidence: "high"
|
|
21685
|
+
},
|
|
21686
|
+
// Juegos y Sorteos (Gaming & Lotteries)
|
|
21687
|
+
JYS: {
|
|
21688
|
+
client: 0.25,
|
|
21689
|
+
geographic: 0.25,
|
|
21690
|
+
product: 0.2,
|
|
21691
|
+
transactional: 0.3,
|
|
21692
|
+
confidence: "high"
|
|
21693
|
+
},
|
|
21694
|
+
// Obras de Arte (Art Trade)
|
|
21695
|
+
ODA: {
|
|
21696
|
+
client: 0.3,
|
|
21697
|
+
geographic: 0.25,
|
|
21698
|
+
product: 0.3,
|
|
21699
|
+
transactional: 0.15,
|
|
21700
|
+
confidence: "high"
|
|
21701
|
+
},
|
|
21702
|
+
// Servicios Profesionales (Professional Services)
|
|
21703
|
+
SPR: {
|
|
21704
|
+
client: 0.4,
|
|
21705
|
+
geographic: 0.15,
|
|
21706
|
+
product: 0.3,
|
|
21707
|
+
transactional: 0.15,
|
|
21708
|
+
confidence: "high"
|
|
21709
|
+
},
|
|
21710
|
+
// Arrendamiento de Inmuebles (Real Estate Leasing)
|
|
21711
|
+
ARR: {
|
|
21712
|
+
client: 0.3,
|
|
21713
|
+
geographic: 0.25,
|
|
21714
|
+
product: 0.2,
|
|
21715
|
+
transactional: 0.25,
|
|
21716
|
+
confidence: "medium"
|
|
21717
|
+
},
|
|
21718
|
+
// Fideicomisos (Trusts)
|
|
21719
|
+
FID: {
|
|
21720
|
+
client: 0.4,
|
|
21721
|
+
geographic: 0.15,
|
|
21722
|
+
product: 0.3,
|
|
21723
|
+
transactional: 0.15,
|
|
21724
|
+
confidence: "high"
|
|
21725
|
+
},
|
|
21726
|
+
// Tarjetas de Servicios y Crédito (Prepaid Cards & Credit Services)
|
|
21727
|
+
TSC: {
|
|
21728
|
+
client: 0.25,
|
|
21729
|
+
geographic: 0.15,
|
|
21730
|
+
product: 0.3,
|
|
21731
|
+
transactional: 0.3,
|
|
21732
|
+
confidence: "medium"
|
|
21733
|
+
},
|
|
21734
|
+
// Donatarias / ONG (Charities & NGOs)
|
|
21735
|
+
DON: {
|
|
21736
|
+
client: 0.35,
|
|
21737
|
+
geographic: 0.25,
|
|
21738
|
+
product: 0.25,
|
|
21739
|
+
transactional: 0.15,
|
|
21740
|
+
confidence: "high"
|
|
21741
|
+
},
|
|
21742
|
+
// Comercio Exterior (Foreign Trade)
|
|
21743
|
+
CEX: {
|
|
21744
|
+
client: 0.25,
|
|
21745
|
+
geographic: 0.35,
|
|
21746
|
+
product: 0.25,
|
|
21747
|
+
transactional: 0.15,
|
|
21748
|
+
confidence: "medium"
|
|
21749
|
+
}
|
|
21750
|
+
};
|
|
21751
|
+
var AVAILABLE_PRESET_ACTIVITIES = Object.keys(
|
|
21752
|
+
WEIGHT_PRESETS
|
|
21753
|
+
);
|
|
21754
|
+
var EBRResource = class {
|
|
21755
|
+
ctx;
|
|
21756
|
+
constructor(context) {
|
|
21757
|
+
this.ctx = context;
|
|
21758
|
+
}
|
|
21759
|
+
/**
|
|
21760
|
+
* Gets the tRPC client, throwing if not available.
|
|
21761
|
+
*/
|
|
21762
|
+
get trpc() {
|
|
21763
|
+
if (!this.ctx.trpc) {
|
|
21764
|
+
throw new Error(
|
|
21765
|
+
"EBRResource requires tRPC client for API operations. Make sure the SDK was initialized with API connection."
|
|
21766
|
+
);
|
|
21767
|
+
}
|
|
21768
|
+
return this.ctx.trpc;
|
|
21769
|
+
}
|
|
21770
|
+
// ===========================
|
|
21771
|
+
// Main Methods
|
|
21772
|
+
// ===========================
|
|
21773
|
+
/**
|
|
21774
|
+
* Creates a new EBR configuration.
|
|
21775
|
+
*
|
|
21776
|
+
* If a configuration already exists, the existing one is marked as "superseded"
|
|
21777
|
+
* and a new version is created. This maintains a complete audit trail.
|
|
21778
|
+
*
|
|
21779
|
+
* @param input - Configuration input (weights, thresholds, justification)
|
|
21780
|
+
* @returns The created EBR configuration
|
|
21781
|
+
* @throws {ValidationError} If input validation fails
|
|
21782
|
+
*/
|
|
21783
|
+
async create(input) {
|
|
21784
|
+
const parseResult = CreateEBRConfigInputSchema.safeParse(input);
|
|
21785
|
+
if (!parseResult.success) {
|
|
21786
|
+
throw ValidationError.fromZodError(parseResult.error);
|
|
21787
|
+
}
|
|
21788
|
+
const validated = parseResult.data;
|
|
21789
|
+
if (validated.actividadVulnerable) {
|
|
21790
|
+
const scopeActivity = this.getCurrentActivity();
|
|
21791
|
+
if (scopeActivity && validated.actividadVulnerable !== scopeActivity) {
|
|
21792
|
+
throw new ValidationError([
|
|
21793
|
+
{
|
|
21794
|
+
path: ["actividadVulnerable"],
|
|
21795
|
+
message: `Activity mismatch - SDK scope is ${scopeActivity} but input specifies ${validated.actividadVulnerable}`,
|
|
21796
|
+
code: "ACTIVITY_MISMATCH"
|
|
21797
|
+
}
|
|
21798
|
+
]);
|
|
21799
|
+
}
|
|
21800
|
+
}
|
|
21801
|
+
const effectiveActivity = validated.actividadVulnerable ?? this.getCurrentActivity();
|
|
21802
|
+
const response = await this.execute(
|
|
21803
|
+
() => this.trpc.ebr.create.mutate({
|
|
21804
|
+
...validated,
|
|
21805
|
+
actividadVulnerable: effectiveActivity ?? void 0
|
|
21806
|
+
})
|
|
21807
|
+
);
|
|
21808
|
+
return this.transformResponse(response);
|
|
21809
|
+
}
|
|
21810
|
+
/**
|
|
21811
|
+
* Gets the currently active EBR configuration.
|
|
21812
|
+
*
|
|
21813
|
+
* @returns The active configuration or null if none exists
|
|
21814
|
+
*/
|
|
21815
|
+
async get() {
|
|
21816
|
+
const activity = this.getCurrentActivity();
|
|
21817
|
+
const response = await this.execute(
|
|
21818
|
+
() => this.trpc.ebr.get.query({
|
|
21819
|
+
actividadVulnerable: activity ?? void 0
|
|
21820
|
+
})
|
|
21821
|
+
);
|
|
21822
|
+
if (!response) {
|
|
21823
|
+
return null;
|
|
21824
|
+
}
|
|
21825
|
+
return this.transformResponse(response);
|
|
21826
|
+
}
|
|
21827
|
+
/**
|
|
21828
|
+
* Gets an EBR configuration by ID.
|
|
21829
|
+
*
|
|
21830
|
+
* @param id - Configuration ID
|
|
21831
|
+
* @returns The configuration or null if not found
|
|
21832
|
+
*/
|
|
21833
|
+
async getById(id) {
|
|
21834
|
+
const response = await this.execute(
|
|
21835
|
+
() => this.trpc.ebr.getById.query({ id })
|
|
21836
|
+
);
|
|
21837
|
+
if (!response) {
|
|
21838
|
+
return null;
|
|
21839
|
+
}
|
|
21840
|
+
return this.transformResponse(response);
|
|
21841
|
+
}
|
|
21842
|
+
/**
|
|
21843
|
+
* Gets the complete history of EBR configurations.
|
|
21844
|
+
*
|
|
21845
|
+
* @param options - Optional options including limit
|
|
21846
|
+
* @returns Array of all EBR configuration versions, newest first
|
|
21847
|
+
*/
|
|
21848
|
+
async getHistory(options) {
|
|
21849
|
+
const activity = this.getCurrentActivity();
|
|
21850
|
+
const response = await this.execute(
|
|
21851
|
+
() => this.trpc.ebr.getHistory.query({
|
|
21852
|
+
actividadVulnerable: activity ?? void 0,
|
|
21853
|
+
limit: options?.limit
|
|
21854
|
+
})
|
|
21855
|
+
);
|
|
21856
|
+
return response;
|
|
21857
|
+
}
|
|
21858
|
+
/**
|
|
21859
|
+
* Promotes an EBR configuration from test to live environment.
|
|
21860
|
+
*
|
|
21861
|
+
* Must be called from the test environment.
|
|
21862
|
+
*
|
|
21863
|
+
* @returns The promoted configuration (now in live)
|
|
21864
|
+
*/
|
|
21865
|
+
async promote() {
|
|
21866
|
+
const activity = this.getCurrentActivity();
|
|
21867
|
+
const response = await this.execute(
|
|
21868
|
+
() => this.trpc.ebr.promote.mutate({
|
|
21869
|
+
actividadVulnerable: activity ?? void 0
|
|
21870
|
+
})
|
|
21871
|
+
);
|
|
21872
|
+
return this.transformResponse(response);
|
|
21873
|
+
}
|
|
21874
|
+
// ===========================
|
|
21875
|
+
// Sub-Resources
|
|
21876
|
+
// ===========================
|
|
21877
|
+
/**
|
|
21878
|
+
* Weights configuration sub-resource.
|
|
21879
|
+
*/
|
|
21880
|
+
get weights() {
|
|
21881
|
+
return {
|
|
21882
|
+
range: WEIGHT_RANGE
|
|
21883
|
+
};
|
|
21884
|
+
}
|
|
21885
|
+
/**
|
|
21886
|
+
* Thresholds configuration sub-resource.
|
|
21887
|
+
*/
|
|
21888
|
+
get thresholds() {
|
|
21889
|
+
return {
|
|
21890
|
+
defaults: DEFAULT_THRESHOLDS
|
|
21891
|
+
};
|
|
21892
|
+
}
|
|
21893
|
+
/**
|
|
21894
|
+
* Presets sub-resource for weight presets.
|
|
21895
|
+
*/
|
|
21896
|
+
get presets() {
|
|
21897
|
+
return {
|
|
21898
|
+
list: () => AVAILABLE_PRESET_ACTIVITIES,
|
|
21899
|
+
get: (activity) => {
|
|
21900
|
+
return WEIGHT_PRESETS[activity] ?? null;
|
|
21901
|
+
},
|
|
21902
|
+
suggested: () => {
|
|
21903
|
+
const activity = this.getCurrentActivity();
|
|
21904
|
+
if (!activity) {
|
|
21905
|
+
return null;
|
|
21906
|
+
}
|
|
21907
|
+
return WEIGHT_PRESETS[activity] ?? null;
|
|
21908
|
+
}
|
|
21909
|
+
};
|
|
21910
|
+
}
|
|
21911
|
+
/**
|
|
21912
|
+
* Risk level utilities sub-resource.
|
|
21913
|
+
*/
|
|
21914
|
+
get riskLevel() {
|
|
21915
|
+
return {
|
|
21916
|
+
mapToRegulatory: RiskLevels.mapToRegulatory,
|
|
21917
|
+
getUpdateFrequency: RiskLevels.getUpdateFrequency
|
|
21918
|
+
};
|
|
21919
|
+
}
|
|
21920
|
+
// ===========================
|
|
21921
|
+
// Private Helpers
|
|
21922
|
+
// ===========================
|
|
21923
|
+
/**
|
|
21924
|
+
* Gets the current activity from the SDK scope.
|
|
21925
|
+
*/
|
|
21926
|
+
getCurrentActivity() {
|
|
21927
|
+
if (isMexicoScope(this.ctx.scope) && this.ctx.scope.actividadVulnerable) {
|
|
21928
|
+
return this.ctx.scope.actividadVulnerable;
|
|
21929
|
+
}
|
|
21930
|
+
return null;
|
|
21931
|
+
}
|
|
21932
|
+
/**
|
|
21933
|
+
* Wraps a tRPC operation with error mapping.
|
|
21934
|
+
*/
|
|
21935
|
+
async execute(operation) {
|
|
21936
|
+
try {
|
|
21937
|
+
return await operation();
|
|
21938
|
+
} catch (error46) {
|
|
21939
|
+
if (error46 instanceof TRPCClientError) {
|
|
21940
|
+
throw mapTRPCError(error46);
|
|
21941
|
+
}
|
|
21942
|
+
throw error46;
|
|
21943
|
+
}
|
|
21944
|
+
}
|
|
21945
|
+
/**
|
|
21946
|
+
* Transforms API response to EBRConfiguration type.
|
|
21947
|
+
* Converts ISO date strings from API to Date objects.
|
|
21948
|
+
*/
|
|
21949
|
+
transformResponse(response) {
|
|
21950
|
+
return {
|
|
21951
|
+
id: response.id,
|
|
21952
|
+
organizationId: response.organizationId,
|
|
21953
|
+
actividadVulnerable: response.actividadVulnerable,
|
|
21954
|
+
environment: response.environment,
|
|
21955
|
+
version: response.version,
|
|
21956
|
+
weights: response.weights,
|
|
21957
|
+
thresholds: response.thresholds,
|
|
21958
|
+
justification: response.justification,
|
|
21959
|
+
reviewPeriodMonths: response.reviewPeriodMonths,
|
|
21960
|
+
validUntil: new Date(response.validUntil),
|
|
21961
|
+
status: response.status,
|
|
21962
|
+
createdAt: new Date(response.createdAt),
|
|
21963
|
+
createdBy: response.createdBy,
|
|
21964
|
+
supersededAt: response.supersededAt ? new Date(response.supersededAt) : void 0,
|
|
21965
|
+
supersededBy: response.supersededBy,
|
|
21966
|
+
promotedFromId: response.promotedFromId
|
|
21967
|
+
};
|
|
21635
21968
|
}
|
|
21636
21969
|
};
|
|
21637
21970
|
|
|
@@ -21953,7 +22286,11 @@ var ComplianceSDKImpl = class _ComplianceSDKImpl {
|
|
|
21953
22286
|
apiVersion,
|
|
21954
22287
|
timeout
|
|
21955
22288
|
});
|
|
21956
|
-
const resourceConfig = {
|
|
22289
|
+
const resourceConfig = {
|
|
22290
|
+
trpc: this.trpc,
|
|
22291
|
+
scope: this._scope,
|
|
22292
|
+
environment: validatedEnvironment
|
|
22293
|
+
};
|
|
21957
22294
|
const factories = getResourceFactories(this._scope);
|
|
21958
22295
|
this.clients = factories.clients(resourceConfig);
|
|
21959
22296
|
this.transactions = factories.transactions(resourceConfig);
|
|
@@ -22082,6 +22419,64 @@ var ComplianceSDKImpl = class _ComplianceSDKImpl {
|
|
|
22082
22419
|
};
|
|
22083
22420
|
var ComplianceSDK = ComplianceSDKImpl;
|
|
22084
22421
|
|
|
22422
|
+
// src/sdk/mex/ComplianceSDK.ts
|
|
22423
|
+
var MexicoComplianceSDKImpl = class extends ComplianceSDKImpl {
|
|
22424
|
+
/**
|
|
22425
|
+
* EBR (Expediente de Beneficiario Real) resource.
|
|
22426
|
+
*
|
|
22427
|
+
* Mexico-only resource for managing beneficial owner records.
|
|
22428
|
+
*/
|
|
22429
|
+
ebr;
|
|
22430
|
+
constructor(options) {
|
|
22431
|
+
super(options);
|
|
22432
|
+
this.ebr = new EBRResource({
|
|
22433
|
+
trpc: this.trpc,
|
|
22434
|
+
scope: this._scope,
|
|
22435
|
+
environment: this.environment
|
|
22436
|
+
});
|
|
22437
|
+
}
|
|
22438
|
+
};
|
|
22439
|
+
var MexicoComplianceSDKScoped = class extends MexicoComplianceSDKImpl {
|
|
22440
|
+
/**
|
|
22441
|
+
* EBR (Evaluación Basada en Riesgos) resource manager.
|
|
22442
|
+
*
|
|
22443
|
+
* Provides risk-based evaluation methodology for AML/KYC compliance
|
|
22444
|
+
* as required by Mexican LFPIORPI regulations.
|
|
22445
|
+
*
|
|
22446
|
+
* Key features:
|
|
22447
|
+
* - Immutable configurations (append-only for audit trail)
|
|
22448
|
+
* - Scope-aware (global or activity-specific)
|
|
22449
|
+
* - Weight presets for all 15 Actividades Vulnerables
|
|
22450
|
+
* - Risk level mapping (5 internal → 3 regulatory)
|
|
22451
|
+
*
|
|
22452
|
+
* @example
|
|
22453
|
+
* ```typescript
|
|
22454
|
+
* // Create EBR configuration
|
|
22455
|
+
* const config = await sdk.ebr.create({
|
|
22456
|
+
* weights: { client: 0.25, geographic: 0.35, product: 0.20, transactional: 0.20 },
|
|
22457
|
+
* thresholds: sdk.ebr.thresholds.defaults,
|
|
22458
|
+
* justification: "Initial configuration Q4 2024",
|
|
22459
|
+
* });
|
|
22460
|
+
*
|
|
22461
|
+
* // Get suggested preset for current activity
|
|
22462
|
+
* const suggested = sdk.ebr.presets.suggested();
|
|
22463
|
+
*
|
|
22464
|
+
* // Map risk level for regulatory reporting
|
|
22465
|
+
* const regulatory = sdk.ebr.riskLevel.mapToRegulatory("muy_alto"); // "alto"
|
|
22466
|
+
* ```
|
|
22467
|
+
*/
|
|
22468
|
+
ebr;
|
|
22469
|
+
constructor(options) {
|
|
22470
|
+
const { actividadVulnerable, ...baseOptions } = options;
|
|
22471
|
+
super({ ...baseOptions, jurisdiction: "MX", actividadVulnerable });
|
|
22472
|
+
this.ebr = new EBRResource({
|
|
22473
|
+
trpc: this.trpc,
|
|
22474
|
+
scope: this.scope,
|
|
22475
|
+
environment: this.environment
|
|
22476
|
+
});
|
|
22477
|
+
}
|
|
22478
|
+
};
|
|
22479
|
+
|
|
22085
22480
|
// src/utils/filters.ts
|
|
22086
22481
|
function contains(value) {
|
|
22087
22482
|
return { contains: value };
|
|
@@ -22158,6 +22553,6 @@ function isNotNull() {
|
|
|
22158
22553
|
(* istanbul ignore if -- @preserve *)
|
|
22159
22554
|
*/
|
|
22160
22555
|
|
|
22161
|
-
export { APIError, AVIClientsResource, AVIReportsResource, AVITransactionsResource, Address, AddressesResource, BankAccount, BankAccountsResource, BaseModel, BaseResource, Client, ClientsResource, ComplianceError, ComplianceSDK,
|
|
22162
|
-
//# sourceMappingURL=chunk-
|
|
22163
|
-
//# sourceMappingURL=chunk-
|
|
22556
|
+
export { APIError, AVIClientsResource, AVIReportsResource, AVITransactionsResource, Address, AddressesResource, BankAccount, BankAccountsResource, BaseModel, BaseResource, Client, ClientsResource, ComplianceError, ComplianceSDK, ContactMethod, ContactMethodsResource, DEFAULT_PAGE_SIZE, Document, DocumentsResource, FileTooLargeError, ForbiddenError, InvalidFileTypeError, JYSClientsResource, JYSReportsResource, JYSTransactionsResource, MAX_PAGE_SIZE, MexAVIClient, MexAVIReport, MexAVIReportItem, MexAVITransaction, MexActaConstitutivaDocument, MexActividadVulnerableClient, MexActividadVulnerableReport, MexActividadVulnerableReportItem, MexActividadVulnerableTransaction, MexAddress, MexAddressProofDocument, MexAddressesResource, MexBankAccount, MexBankAccountsResource, MexClient, MexClientsResource, MexCurpDocument, MexDocument, MexIneBackDocument, MexIneFrontDocument, MexJYSClient, MexJYSReport, MexJYSReportItem, MexJYSTransaction, MexPassportDocument, MexPoderNotarialDocument, MexReport, MexReportItem, MexReportsResource, MexRfcConstanciaDocument, MexTSCClient, MexTSCReport, MexTSCReportItem, MexTSCTransaction, MexTransaction, MexTransactionsResource, MexicoComplianceSDKImpl, MexicoComplianceSDKScoped, NetworkError, NotFoundError, RateLimitError, ReadOnlyResource, Report, ReportItem, ReportsResource, ServerError, TSCClientsResource, TSCReportsResource, TSCTransactionsResource, TimeoutError, Transaction, TransactionsResource, UnauthorizedError, UploadAbortedError, UploadError, UploadTimeoutError, UploadUrlExpiredError, ValidationError, after, atLeast, atMost, before, collectAll, collectUpTo, contains, dateRange, endsWith, equals, getFirst, greaterThan, isAPIError, isActividadVulnerable, isActividadVulnerableReport, isActividadVulnerableReportItem, isActividadVulnerableTransaction, isBankAccount, isClient, isCompany, isFalse, isIndividual, isMexAVIClient, isMexAVIReport, isMexAVIReportItem, isMexAVITransaction, isMexActaConstitutiva, isMexAddress, isMexAddressProof, isMexBankAccount, isMexClient, isMexCurp, isMexDocument, isMexIneBack, isMexIneFront, isMexJYSClient, isMexJYSReport, isMexJYSReportItem, isMexJYSTransaction, isMexPassport, isMexPoderNotarial, isMexReport, isMexReportItem, isMexRfcConstancia, isMexTSCClient, isMexTSCReport, isMexTSCReportItem, isMexTSCTransaction, isMexTransaction, isNotNull, isNull, isReport, isReportItem, isTransaction, isTrue, isTrust, isUploadError, lessThan, mapTRPCError, notEquals, notOneOf, numberRange, onOrAfter, onOrBefore, oneOf, registerSDKClass, registerScope, startsWith };
|
|
22557
|
+
//# sourceMappingURL=chunk-HAQ3MDZ3.js.map
|
|
22558
|
+
//# sourceMappingURL=chunk-HAQ3MDZ3.js.map
|