@artu-ai/compliance-sdk 0.6.8 → 0.7.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/exports/mexico/actividad-vulnerable/avi.d.ts +2 -1
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts +2 -1
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts +677 -0
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts.map +1 -0
- package/dist/exports/mexico/actividad-vulnerable/mjr.js +110 -0
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts +2 -1
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts.map +1 -1
- package/dist/models/Client.d.ts +7 -1
- package/dist/models/Client.d.ts.map +1 -1
- package/dist/models/Client.js +19 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +3 -3
- package/dist/models/mex/MexClient.d.ts +1 -1
- package/dist/models/mex/MexClient.d.ts.map +1 -1
- package/dist/models/mex/MexClient.js +2 -9
- package/dist/models/mex/MexReport.d.ts.map +1 -1
- package/dist/models/mex/MexReport.js +2 -9
- package/dist/models/mex/MexTransaction.d.ts +1 -1
- package/dist/models/mex/MexTransaction.d.ts.map +1 -1
- package/dist/models/mex/MexTransaction.js +2 -9
- package/dist/models/mex/actividad-vulnerable/index.d.ts +4 -0
- package/dist/models/mex/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/models/mex/actividad-vulnerable/index.js +4 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRClient.d.ts +40 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRClient.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRClient.js +54 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReport.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReport.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReport.js +75 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReportItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReportItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReportItem.js +63 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRTransaction.d.ts +79 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRTransaction.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRTransaction.js +126 -0
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts +4 -2
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/index.d.ts +2 -1
- package/dist/namespaces/mexico/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/index.d.ts +1 -0
- package/dist/resources/mex/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/index.js +2 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/clients.d.ts +177 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/clients.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/clients.js +320 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/index.d.ts +7 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/index.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/index.js +6 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/reports.d.ts +170 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/reports.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/reports.js +463 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/transactions.d.ts +128 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/transactions.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/transactions.js +343 -0
- package/dist/sdk/mex/actividad-vulnerable/index.d.ts +1 -0
- package/dist/sdk/mex/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/index.js +6 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.d.ts +56 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.js +51 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/index.d.ts +8 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/index.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/index.js +9 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.d.ts +35 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.d.ts.map +1 -0
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.js +20 -0
- package/dist/sdk/mex/types.d.ts +2 -2
- package/dist/sdk/mex/types.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +1 -1
- package/dist/sdk/types.d.ts.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR (Metales y Joyas - Precious Metals and Jewelry) Transactions Resource
|
|
3
|
+
*
|
|
4
|
+
* Extends MexTransactionsResource with MJR-specific behavior:
|
|
5
|
+
* - Accepts flattened CreateMJRTransactionInput (MJR fields at root level)
|
|
6
|
+
* - Returns MexMJRTransaction models
|
|
7
|
+
* - Handles nested goods[] and payments[] arrays
|
|
8
|
+
*/
|
|
9
|
+
import type { CreateTransactionInput, UpdateTransactionInput, ListOptions, PaginatedResponse, CreateMJRTransactionInput, UpdateMJRTransactionInput, UpsertMJRTransactionInput, AtomicBatchResult, PartialBatchResult, RelatedClient, MJRTransactionFilter, MJRTransactionSort, UpsertResult } from "@artu-ai/shared";
|
|
10
|
+
import { ClientRole } from "@artu-ai/shared";
|
|
11
|
+
import type { TransactionSort } from "@artu-ai/shared";
|
|
12
|
+
import { MexTransactionsResource } from "../../transactions";
|
|
13
|
+
import { MexMJRTransaction, type TransactionData } from "../../../../models";
|
|
14
|
+
/**
|
|
15
|
+
* MJR (Metales y Joyas) scoped transactions resource.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const mjrSdk = new ComplianceSDK({
|
|
20
|
+
* apiKey,
|
|
21
|
+
* jurisdiction: Jurisdiction.Mexico,
|
|
22
|
+
* actividadVulnerable: CodigoActividad.MJR,
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Create with fully flattened input
|
|
26
|
+
* const txn = await mjrSdk.transactions.create({
|
|
27
|
+
* amount: 50000,
|
|
28
|
+
* currency: "MXN",
|
|
29
|
+
* timestamp: new Date(),
|
|
30
|
+
* operationType: "601", // Sale
|
|
31
|
+
* operationPostalCode: "06600",
|
|
32
|
+
* goods: [
|
|
33
|
+
* { goodType: "1", unit: "1", quantity: 1 }
|
|
34
|
+
* ],
|
|
35
|
+
* payments: [
|
|
36
|
+
* { paymentDate: new Date(), paymentForm: "1", monetaryInstrument: "1", currency: "2", amount: 50000 }
|
|
37
|
+
* ],
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* // Returns MexMJRTransaction
|
|
41
|
+
* console.log(txn.goods);
|
|
42
|
+
* console.log(txn.payments);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class MJRTransactionsResource extends MexTransactionsResource<MJRTransactionSort> {
|
|
46
|
+
create(data: CreateMJRTransactionInput): Promise<MexMJRTransaction>;
|
|
47
|
+
retrieve(id: string): Promise<MexMJRTransaction>;
|
|
48
|
+
retrieveByMetadata(key: string, value: string): Promise<MexMJRTransaction>;
|
|
49
|
+
update(id: string, data: UpdateMJRTransactionInput): Promise<MexMJRTransaction>;
|
|
50
|
+
/**
|
|
51
|
+
* Lists MJR transactions with optional filtering.
|
|
52
|
+
*
|
|
53
|
+
* Accepts flattened MJR filter (future MJR-specific transaction fields at root level).
|
|
54
|
+
*/
|
|
55
|
+
list(options?: ListOptions<MJRTransactionFilter, MJRTransactionSort>): Promise<PaginatedResponse<MexMJRTransaction>>;
|
|
56
|
+
/**
|
|
57
|
+
* Iterates over MJR transactions.
|
|
58
|
+
*
|
|
59
|
+
* Accepts flattened MJR filter (future MJR-specific transaction fields at root level).
|
|
60
|
+
*/
|
|
61
|
+
iterate(options?: {
|
|
62
|
+
filter?: MJRTransactionFilter;
|
|
63
|
+
sort?: MJRTransactionSort;
|
|
64
|
+
pageSize?: number;
|
|
65
|
+
}): AsyncGenerator<MexMJRTransaction, void, undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Counts MJR transactions matching the given filter.
|
|
68
|
+
*
|
|
69
|
+
* @param filter - Optional filter criteria (with MJR fields at root level)
|
|
70
|
+
* @returns The count of matching transactions
|
|
71
|
+
*/
|
|
72
|
+
count(filter?: MJRTransactionFilter): Promise<number>;
|
|
73
|
+
listByClient(clientId: string, options?: {
|
|
74
|
+
cursor?: string;
|
|
75
|
+
limit?: number;
|
|
76
|
+
}): Promise<PaginatedResponse<MexMJRTransaction>>;
|
|
77
|
+
linkClient(transactionId: string, clientId: string, role?: ClientRole): Promise<MexMJRTransaction>;
|
|
78
|
+
unlinkClient(transactionId: string, clientId: string): Promise<MexMJRTransaction>;
|
|
79
|
+
setClients(transactionId: string, clients: RelatedClient[]): Promise<MexMJRTransaction>;
|
|
80
|
+
createMany(transactions: CreateMJRTransactionInput[], options?: {
|
|
81
|
+
atomic?: true;
|
|
82
|
+
}): Promise<AtomicBatchResult<MexMJRTransaction>>;
|
|
83
|
+
createMany(transactions: CreateMJRTransactionInput[], options: {
|
|
84
|
+
atomic: false;
|
|
85
|
+
}): Promise<PartialBatchResult<MexMJRTransaction>>;
|
|
86
|
+
updateMany(updates: {
|
|
87
|
+
id: string;
|
|
88
|
+
data: UpdateMJRTransactionInput;
|
|
89
|
+
}[], options?: {
|
|
90
|
+
atomic?: true;
|
|
91
|
+
}): Promise<AtomicBatchResult<MexMJRTransaction>>;
|
|
92
|
+
updateMany(updates: {
|
|
93
|
+
id: string;
|
|
94
|
+
data: UpdateMJRTransactionInput;
|
|
95
|
+
}[], options: {
|
|
96
|
+
atomic: false;
|
|
97
|
+
}): Promise<PartialBatchResult<MexMJRTransaction>>;
|
|
98
|
+
/**
|
|
99
|
+
* Creates or updates a MJR transaction by externalId.
|
|
100
|
+
*
|
|
101
|
+
* @param data - Transaction upsert data with MJR fields at root level (must include externalId)
|
|
102
|
+
* @returns The created or updated transaction with action indicator
|
|
103
|
+
*/
|
|
104
|
+
upsertByExternalId(data: UpsertMJRTransactionInput): Promise<UpsertResult<MexMJRTransaction>>;
|
|
105
|
+
/**
|
|
106
|
+
* Creates or updates multiple MJR transactions by externalId.
|
|
107
|
+
*
|
|
108
|
+
* @param transactions - Array of transaction upsert data (each must include externalId)
|
|
109
|
+
* @param options - Batch options (atomic: true by default)
|
|
110
|
+
* @returns Atomic result with data array, or partial result with succeeded/failed
|
|
111
|
+
*/
|
|
112
|
+
upsertManyByExternalId(transactions: UpsertMJRTransactionInput[], options?: {
|
|
113
|
+
atomic?: true;
|
|
114
|
+
}): Promise<AtomicBatchResult<UpsertResult<MexMJRTransaction>>>;
|
|
115
|
+
upsertManyByExternalId(transactions: UpsertMJRTransactionInput[], options: {
|
|
116
|
+
atomic: false;
|
|
117
|
+
}): Promise<PartialBatchResult<UpsertResult<MexMJRTransaction>>>;
|
|
118
|
+
protected transformToNested(data: CreateMJRTransactionInput): CreateTransactionInput;
|
|
119
|
+
protected transformUpdateToNested(data: UpdateMJRTransactionInput): UpdateTransactionInput;
|
|
120
|
+
protected instantiate(data: TransactionData): MexMJRTransaction;
|
|
121
|
+
/**
|
|
122
|
+
* Transforms a flattened MJRTransactionSort to nested TransactionSort format.
|
|
123
|
+
*
|
|
124
|
+
* Maps flattened field names to their full API paths using MJR-specific field mapping.
|
|
125
|
+
*/
|
|
126
|
+
protected applyScopeToSort(sort?: MJRTransactionSort): TransactionSort | undefined;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/mjr/transactions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EAEtB,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAML,UAAU,EAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAM7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,uBAAwB,SAAQ,uBAAuB,CAAC,kBAAkB,CAAC;IAKhF,MAAM,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAWnE,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOhD,kBAAkB,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,iBAAiB,CAAC;IAOvB,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,iBAAiB,CAAC;IAc7B;;;;OAIG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,WAAW,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,GAC9D,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAkBhD;;;;OAIG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE,oBAAoB,CAAC;QAC9B,IAAI,CAAC,EAAE,kBAAkB,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,cAAc,CAAC,iBAAiB,EAAE,IAAI,EAAE,SAAS,CAAC;IAUtD;;;;;OAKG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAYrD,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAW1C,UAAU,CACd,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,UAAU,GAChB,OAAO,CAAC,iBAAiB,CAAC;IAWvB,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,iBAAiB,CAAC;IAUvB,UAAU,CACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,aAAa,EAAE,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAcvB,UAAU,CACd,YAAY,EAAE,yBAAyB,EAAE,EACzC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,IAAI,CAAA;KAAE,GAC1B,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC1C,UAAU,CACd,YAAY,EAAE,yBAAyB,EAAE,EACzC,OAAO,EAAE;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,GACzB,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IAmC3C,UAAU,CACd,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,yBAAyB,CAAA;KAAE,EAAE,EAC1D,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,IAAI,CAAA;KAAE,GAC1B,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC1C,UAAU,CACd,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,yBAAyB,CAAA;KAAE,EAAE,EAC1D,OAAO,EAAE;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,GACzB,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IA+CjD;;;;;OAKG;IACG,kBAAkB,CACtB,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAgB3C;;;;;;OAMG;IACG,sBAAsB,CAC1B,YAAY,EAAE,yBAAyB,EAAE,EACzC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,IAAI,CAAA;KAAE,GAC1B,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACxD,sBAAsB,CAC1B,YAAY,EAAE,yBAAyB,EAAE,EACzC,OAAO,EAAE;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,GACzB,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC;cAmD5C,iBAAiB,CAClC,IAAI,EAAE,yBAAyB,GAC9B,sBAAsB;cA+CN,uBAAuB,CACxC,IAAI,EAAE,yBAAyB,GAC9B,sBAAsB;cAkDN,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,iBAAiB;IAIxE;;;;OAIG;cACgB,gBAAgB,CACjC,IAAI,CAAC,EAAE,kBAAkB,GACxB,eAAe,GAAG,SAAS;CAM/B"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR (Metales y Joyas - Precious Metals and Jewelry) Transactions Resource
|
|
3
|
+
*
|
|
4
|
+
* Extends MexTransactionsResource with MJR-specific behavior:
|
|
5
|
+
* - Accepts flattened CreateMJRTransactionInput (MJR fields at root level)
|
|
6
|
+
* - Returns MexMJRTransaction models
|
|
7
|
+
* - Handles nested goods[] and payments[] arrays
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { Jurisdiction, CodigoActividad, createMJRTransactionInputSchema, updateMJRTransactionInputSchema, upsertMJRTransactionInputSchema, transformSort, mjrTransactionFieldMapping, } from "@artu-ai/shared";
|
|
11
|
+
import { MexTransactionsResource } from "../../transactions";
|
|
12
|
+
import { MexMJRTransaction } from "../../../../models";
|
|
13
|
+
// ===========================
|
|
14
|
+
// MJRTransactionsResource
|
|
15
|
+
// ===========================
|
|
16
|
+
/**
|
|
17
|
+
* MJR (Metales y Joyas) scoped transactions resource.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const mjrSdk = new ComplianceSDK({
|
|
22
|
+
* apiKey,
|
|
23
|
+
* jurisdiction: Jurisdiction.Mexico,
|
|
24
|
+
* actividadVulnerable: CodigoActividad.MJR,
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Create with fully flattened input
|
|
28
|
+
* const txn = await mjrSdk.transactions.create({
|
|
29
|
+
* amount: 50000,
|
|
30
|
+
* currency: "MXN",
|
|
31
|
+
* timestamp: new Date(),
|
|
32
|
+
* operationType: "601", // Sale
|
|
33
|
+
* operationPostalCode: "06600",
|
|
34
|
+
* goods: [
|
|
35
|
+
* { goodType: "1", unit: "1", quantity: 1 }
|
|
36
|
+
* ],
|
|
37
|
+
* payments: [
|
|
38
|
+
* { paymentDate: new Date(), paymentForm: "1", monetaryInstrument: "1", currency: "2", amount: 50000 }
|
|
39
|
+
* ],
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Returns MexMJRTransaction
|
|
43
|
+
* console.log(txn.goods);
|
|
44
|
+
* console.log(txn.payments);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export class MJRTransactionsResource extends MexTransactionsResource {
|
|
48
|
+
// ─────────────────────────────────────────────────────────────────
|
|
49
|
+
// CRUD Operations
|
|
50
|
+
// ─────────────────────────────────────────────────────────────────
|
|
51
|
+
async create(data) {
|
|
52
|
+
const validated = this.validate(createMJRTransactionInputSchema, data);
|
|
53
|
+
const nestedData = this.transformToNested(validated);
|
|
54
|
+
const response = await this.execute(() => this.trpc.transactions.create.mutate(nestedData));
|
|
55
|
+
return this.instantiate(response);
|
|
56
|
+
}
|
|
57
|
+
async retrieve(id) {
|
|
58
|
+
const response = await this.execute(() => this.trpc.transactions.retrieve.query({ id }));
|
|
59
|
+
return this.instantiate(response);
|
|
60
|
+
}
|
|
61
|
+
async retrieveByMetadata(key, value) {
|
|
62
|
+
const response = await this.execute(() => this.trpc.transactions.retrieveByMetadata.query({ key, value }));
|
|
63
|
+
return this.instantiate(response);
|
|
64
|
+
}
|
|
65
|
+
async update(id, data) {
|
|
66
|
+
const validated = this.validate(updateMJRTransactionInputSchema, data);
|
|
67
|
+
const nestedData = this.transformUpdateToNested(validated);
|
|
68
|
+
const response = await this.execute(() => this.trpc.transactions.update.mutate({ id, data: nestedData }));
|
|
69
|
+
return this.instantiate(response);
|
|
70
|
+
}
|
|
71
|
+
// ─────────────────────────────────────────────────────────────────
|
|
72
|
+
// List & Pagination
|
|
73
|
+
// ─────────────────────────────────────────────────────────────────
|
|
74
|
+
/**
|
|
75
|
+
* Lists MJR transactions with optional filtering.
|
|
76
|
+
*
|
|
77
|
+
* Accepts flattened MJR filter (future MJR-specific transaction fields at root level).
|
|
78
|
+
*/
|
|
79
|
+
async list(options) {
|
|
80
|
+
const scopedFilter = this.applyScopeToFilter(options?.filter);
|
|
81
|
+
const scopedSort = this.applyScopeToSort(options?.sort);
|
|
82
|
+
const response = await this.execute(() => this.trpc.transactions.list.query({
|
|
83
|
+
...options,
|
|
84
|
+
filter: scopedFilter,
|
|
85
|
+
sort: scopedSort,
|
|
86
|
+
}));
|
|
87
|
+
return {
|
|
88
|
+
data: response.data.map((t) => this.instantiate(t)),
|
|
89
|
+
pagination: response.pagination,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Iterates over MJR transactions.
|
|
94
|
+
*
|
|
95
|
+
* Accepts flattened MJR filter (future MJR-specific transaction fields at root level).
|
|
96
|
+
*/
|
|
97
|
+
iterate(options) {
|
|
98
|
+
const scopedFilter = this.applyScopeToFilter(options?.filter);
|
|
99
|
+
// Note: sort is passed through - createIterator calls list() which handles transformation
|
|
100
|
+
return this.createIterator({
|
|
101
|
+
filter: scopedFilter,
|
|
102
|
+
sort: options?.sort,
|
|
103
|
+
pageSize: options?.pageSize,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Counts MJR transactions matching the given filter.
|
|
108
|
+
*
|
|
109
|
+
* @param filter - Optional filter criteria (with MJR fields at root level)
|
|
110
|
+
* @returns The count of matching transactions
|
|
111
|
+
*/
|
|
112
|
+
async count(filter) {
|
|
113
|
+
const scopedFilter = this.applyScopeToFilter(filter);
|
|
114
|
+
const response = await this.execute(() => this.trpc.transactions.count.query({ filter: scopedFilter }));
|
|
115
|
+
return response.count;
|
|
116
|
+
}
|
|
117
|
+
// ─────────────────────────────────────────────────────────────────
|
|
118
|
+
// Client Relationship Management (scoped returns)
|
|
119
|
+
// ─────────────────────────────────────────────────────────────────
|
|
120
|
+
async listByClient(clientId, options) {
|
|
121
|
+
const response = await this.execute(() => this.trpc.transactions.listByClient.query({ clientId, ...options }));
|
|
122
|
+
return {
|
|
123
|
+
data: response.data.map((t) => this.instantiate(t)),
|
|
124
|
+
pagination: response.pagination,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
async linkClient(transactionId, clientId, role) {
|
|
128
|
+
const response = await this.execute(() => this.trpc.transactions.linkClient.mutate({
|
|
129
|
+
transactionId,
|
|
130
|
+
clientId,
|
|
131
|
+
role,
|
|
132
|
+
}));
|
|
133
|
+
return this.instantiate(response);
|
|
134
|
+
}
|
|
135
|
+
async unlinkClient(transactionId, clientId) {
|
|
136
|
+
const response = await this.execute(() => this.trpc.transactions.unlinkClient.mutate({
|
|
137
|
+
transactionId,
|
|
138
|
+
clientId,
|
|
139
|
+
}));
|
|
140
|
+
return this.instantiate(response);
|
|
141
|
+
}
|
|
142
|
+
async setClients(transactionId, clients) {
|
|
143
|
+
const response = await this.execute(() => this.trpc.transactions.setClients.mutate({
|
|
144
|
+
transactionId,
|
|
145
|
+
clients,
|
|
146
|
+
}));
|
|
147
|
+
return this.instantiate(response);
|
|
148
|
+
}
|
|
149
|
+
async createMany(transactions, options = {}) {
|
|
150
|
+
const atomic = options.atomic ?? true;
|
|
151
|
+
const validated = this.validate(z.array(createMJRTransactionInputSchema), transactions);
|
|
152
|
+
const nestedItems = validated.map((t) => this.transformToNested(t));
|
|
153
|
+
const response = await this.execute(() => this.trpc.transactions.createMany.mutate({ items: nestedItems, atomic }));
|
|
154
|
+
if (response.atomic) {
|
|
155
|
+
return {
|
|
156
|
+
atomic: true,
|
|
157
|
+
data: response.data.map((t) => this.instantiate(t)),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return {
|
|
162
|
+
atomic: false,
|
|
163
|
+
succeeded: response.succeeded.map((item) => ({
|
|
164
|
+
index: item.index,
|
|
165
|
+
data: this.instantiate(item.data),
|
|
166
|
+
})),
|
|
167
|
+
failed: response.failed,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async updateMany(updates, options = {}) {
|
|
172
|
+
const atomic = options.atomic ?? true;
|
|
173
|
+
const updateItemSchema = z.object({
|
|
174
|
+
id: z.uuid(),
|
|
175
|
+
data: updateMJRTransactionInputSchema,
|
|
176
|
+
});
|
|
177
|
+
const validated = this.validate(z.array(updateItemSchema), updates);
|
|
178
|
+
const nestedUpdates = validated.map((u) => ({
|
|
179
|
+
id: u.id,
|
|
180
|
+
data: this.transformUpdateToNested(u.data),
|
|
181
|
+
}));
|
|
182
|
+
const response = await this.execute(() => this.trpc.transactions.updateMany.mutate({
|
|
183
|
+
items: nestedUpdates,
|
|
184
|
+
atomic,
|
|
185
|
+
}));
|
|
186
|
+
if (response.atomic) {
|
|
187
|
+
return {
|
|
188
|
+
atomic: true,
|
|
189
|
+
data: response.data.map((t) => this.instantiate(t)),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
return {
|
|
194
|
+
atomic: false,
|
|
195
|
+
succeeded: response.succeeded.map((item) => ({
|
|
196
|
+
index: item.index,
|
|
197
|
+
data: this.instantiate(item.data),
|
|
198
|
+
})),
|
|
199
|
+
failed: response.failed,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// ─────────────────────────────────────────────────────────────────
|
|
204
|
+
// Upsert Operations
|
|
205
|
+
// ─────────────────────────────────────────────────────────────────
|
|
206
|
+
/**
|
|
207
|
+
* Creates or updates a MJR transaction by externalId.
|
|
208
|
+
*
|
|
209
|
+
* @param data - Transaction upsert data with MJR fields at root level (must include externalId)
|
|
210
|
+
* @returns The created or updated transaction with action indicator
|
|
211
|
+
*/
|
|
212
|
+
async upsertByExternalId(data) {
|
|
213
|
+
const validated = this.validate(upsertMJRTransactionInputSchema, data);
|
|
214
|
+
const nestedData = this.transformToNested(validated);
|
|
215
|
+
const response = await this.execute(() => this.trpc.transactions.upsertByExternalId.mutate(nestedData));
|
|
216
|
+
return {
|
|
217
|
+
data: this.instantiate(response.data),
|
|
218
|
+
action: response.action,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
async upsertManyByExternalId(transactions, options = {}) {
|
|
222
|
+
const atomic = options.atomic ?? true;
|
|
223
|
+
const validated = this.validate(z.array(upsertMJRTransactionInputSchema), transactions);
|
|
224
|
+
const nestedItems = validated.map((t) => this.transformToNested(t));
|
|
225
|
+
const response = await this.execute(() => this.trpc.transactions.upsertManyByExternalId.mutate({
|
|
226
|
+
items: nestedItems,
|
|
227
|
+
atomic,
|
|
228
|
+
}));
|
|
229
|
+
if (response.atomic) {
|
|
230
|
+
return {
|
|
231
|
+
atomic: true,
|
|
232
|
+
data: response.data.map((item) => ({
|
|
233
|
+
data: this.instantiate(item.data),
|
|
234
|
+
action: item.action,
|
|
235
|
+
})),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
return {
|
|
240
|
+
atomic: false,
|
|
241
|
+
succeeded: response.succeeded.map((item) => ({
|
|
242
|
+
index: item.index,
|
|
243
|
+
data: {
|
|
244
|
+
data: this.instantiate(item.data.data),
|
|
245
|
+
action: item.data.action,
|
|
246
|
+
},
|
|
247
|
+
})),
|
|
248
|
+
failed: response.failed,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// ─────────────────────────────────────────────────────────────────
|
|
253
|
+
// Protected Helpers
|
|
254
|
+
// ─────────────────────────────────────────────────────────────────
|
|
255
|
+
transformToNested(data) {
|
|
256
|
+
const { amount, currency, timestamp, relatedClientIds, description, externalId, metadata, operationType, operationPostalCode, goods, payments, } = data;
|
|
257
|
+
// Build base fields (relatedClientIds is required)
|
|
258
|
+
const baseFields = {
|
|
259
|
+
amount,
|
|
260
|
+
currency,
|
|
261
|
+
timestamp,
|
|
262
|
+
relatedClientIds,
|
|
263
|
+
};
|
|
264
|
+
if (description !== undefined)
|
|
265
|
+
baseFields.description = description;
|
|
266
|
+
if (externalId !== undefined)
|
|
267
|
+
baseFields.externalId = externalId;
|
|
268
|
+
if (metadata !== undefined)
|
|
269
|
+
baseFields.metadata = metadata;
|
|
270
|
+
// MJR-specific fields
|
|
271
|
+
const mjrFields = {
|
|
272
|
+
operationType,
|
|
273
|
+
operationPostalCode,
|
|
274
|
+
goods,
|
|
275
|
+
payments,
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
...baseFields,
|
|
279
|
+
primaryJurisdiction: Jurisdiction.Mexico,
|
|
280
|
+
jurisdictions: {
|
|
281
|
+
MX: {
|
|
282
|
+
actividadVulnerable: {
|
|
283
|
+
[CodigoActividad.MJR]: mjrFields,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
transformUpdateToNested(data) {
|
|
290
|
+
// Cast to access fields - Zod validation ensures correctness
|
|
291
|
+
const input = data;
|
|
292
|
+
const { status, description, externalId, metadata, primaryJurisdiction, operationType, operationPostalCode, goods, payments, } = input;
|
|
293
|
+
// Build base update fields
|
|
294
|
+
const result = {};
|
|
295
|
+
if (status !== undefined)
|
|
296
|
+
result.status = status;
|
|
297
|
+
if (description !== undefined)
|
|
298
|
+
result.description = description;
|
|
299
|
+
if (externalId !== undefined)
|
|
300
|
+
result.externalId = externalId;
|
|
301
|
+
if (metadata !== undefined)
|
|
302
|
+
result.metadata = metadata;
|
|
303
|
+
if (primaryJurisdiction !== undefined)
|
|
304
|
+
result.primaryJurisdiction =
|
|
305
|
+
primaryJurisdiction;
|
|
306
|
+
// Build MJR fields object (even if empty, to ensure filterability)
|
|
307
|
+
const mjrData = {};
|
|
308
|
+
if (operationType !== undefined)
|
|
309
|
+
mjrData.operationType = operationType;
|
|
310
|
+
if (operationPostalCode !== undefined)
|
|
311
|
+
mjrData.operationPostalCode = operationPostalCode;
|
|
312
|
+
if (goods !== undefined)
|
|
313
|
+
mjrData.goods = goods;
|
|
314
|
+
if (payments !== undefined)
|
|
315
|
+
mjrData.payments = payments;
|
|
316
|
+
// Always include MJR activity marker to ensure filterability
|
|
317
|
+
// NOTE: Always includes `actividadVulnerable: { MJR: {} }` even if no
|
|
318
|
+
// MJR-specific fields are provided. This ensures that records touched via
|
|
319
|
+
// the MJR SDK can be filtered by `activityCodes: { in: ["MJR"] }`.
|
|
320
|
+
result.jurisdictions = {
|
|
321
|
+
MX: {
|
|
322
|
+
actividadVulnerable: {
|
|
323
|
+
[CodigoActividad.MJR]: mjrData,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
instantiate(data) {
|
|
330
|
+
return new MexMJRTransaction(data);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Transforms a flattened MJRTransactionSort to nested TransactionSort format.
|
|
334
|
+
*
|
|
335
|
+
* Maps flattened field names to their full API paths using MJR-specific field mapping.
|
|
336
|
+
*/
|
|
337
|
+
applyScopeToSort(sort) {
|
|
338
|
+
if (!sort || sort.length === 0) {
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
return transformSort(sort, mjrTransactionFieldMapping);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { type AVISDKOptions, type AVIScopedSDKOptions, type AVIComplianceSDK, registerAVIScope, AVIComplianceSDKScoped, } from "./avi";
|
|
7
7
|
export { type JYSSDKOptions, type JYSScopedSDKOptions, type JYSComplianceSDK, registerJYSScope, JYSComplianceSDKScoped, } from "./jys";
|
|
8
|
+
export { type MJRSDKOptions, type MJRScopedSDKOptions, type MJRComplianceSDK, registerMJRScope, MJRComplianceSDKScoped, } from "./mjr";
|
|
8
9
|
export { type TSCSDKOptions, type TSCScopedSDKOptions, type TSCComplianceSDK, registerTSCScope, TSCComplianceSDKScoped, } from "./tsc";
|
|
9
10
|
/**
|
|
10
11
|
* Registers all Actividad Vulnerable activity scopes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/mex/actividad-vulnerable/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/mex/actividad-vulnerable/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,OAAO,CAAC;AAWf;;GAEG;AACH,wBAAgB,iCAAiC,IAAI,IAAI,CAKxD"}
|
|
@@ -12,6 +12,10 @@ export { registerAVIScope, AVIComplianceSDKScoped, } from "./avi";
|
|
|
12
12
|
// ===========================
|
|
13
13
|
export { registerJYSScope, JYSComplianceSDKScoped, } from "./jys";
|
|
14
14
|
// ===========================
|
|
15
|
+
// MJR
|
|
16
|
+
// ===========================
|
|
17
|
+
export { registerMJRScope, MJRComplianceSDKScoped, } from "./mjr";
|
|
18
|
+
// ===========================
|
|
15
19
|
// TSC
|
|
16
20
|
// ===========================
|
|
17
21
|
export { registerTSCScope, TSCComplianceSDKScoped, } from "./tsc";
|
|
@@ -20,6 +24,7 @@ export { registerTSCScope, TSCComplianceSDKScoped, } from "./tsc";
|
|
|
20
24
|
// ===========================
|
|
21
25
|
import { registerAVIScope } from "./avi";
|
|
22
26
|
import { registerJYSScope } from "./jys";
|
|
27
|
+
import { registerMJRScope } from "./mjr";
|
|
23
28
|
import { registerTSCScope } from "./tsc";
|
|
24
29
|
/**
|
|
25
30
|
* Registers all Actividad Vulnerable activity scopes
|
|
@@ -27,5 +32,6 @@ import { registerTSCScope } from "./tsc";
|
|
|
27
32
|
export function registerActividadVulnerableScopes() {
|
|
28
33
|
registerAVIScope();
|
|
29
34
|
registerJYSScope();
|
|
35
|
+
registerMJRScope();
|
|
30
36
|
registerTSCScope();
|
|
31
37
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR-scoped ComplianceSDK
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured SDK for Mexico jurisdiction and Metales y Joyas (MJR) activity.
|
|
5
|
+
* Extends MexicoComplianceSDKScoped to inherit Mexico-specific resources like EBR.
|
|
6
|
+
*/
|
|
7
|
+
import { MexicoComplianceSDKScoped } from "../../ComplianceSDK";
|
|
8
|
+
import type { MJRScopedSDKOptions } from "./types";
|
|
9
|
+
import type { MJRClientsResource } from "../../../../resources/mex/actividad-vulnerable/mjr/clients";
|
|
10
|
+
import type { MJRTransactionsResource } from "../../../../resources/mex/actividad-vulnerable/mjr/transactions";
|
|
11
|
+
import type { MJRReportsResource } from "../../../../resources/mex/actividad-vulnerable/mjr/reports";
|
|
12
|
+
/**
|
|
13
|
+
* MJR-scoped ComplianceSDK.
|
|
14
|
+
* Pre-configured for Mexico jurisdiction and Metales y Joyas (MJR) activity.
|
|
15
|
+
*
|
|
16
|
+
* Inherits Mexico-specific resources:
|
|
17
|
+
* - `ebr` - EBR (Evaluación Basada en Riesgos) for AML/KYC risk evaluation
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { ComplianceSDK } from "@artu/compliance-sdk/mexico/actividad-vulnerable/mjr";
|
|
22
|
+
*
|
|
23
|
+
* const sdk = new ComplianceSDK({
|
|
24
|
+
* apiKey: process.env.API_KEY!,
|
|
25
|
+
* environment: "test",
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Already scoped - no need to specify jurisdiction/activity
|
|
29
|
+
* const client = await sdk.clients.create({
|
|
30
|
+
* type: ClientType.Person,
|
|
31
|
+
* name: "Juan García",
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Create transactions with nested goods and payments
|
|
35
|
+
* const txn = await sdk.transactions.create({
|
|
36
|
+
* amount: 50000,
|
|
37
|
+
* currency: "MXN",
|
|
38
|
+
* timestamp: new Date(),
|
|
39
|
+
* operationType: "601",
|
|
40
|
+
* operationPostalCode: "06600",
|
|
41
|
+
* goods: [{ goodType: "1", unit: "1", quantity: 1 }],
|
|
42
|
+
* payments: [{ paymentDate: new Date(), paymentForm: "1", monetaryInstrument: "1", currency: "2", amount: 50000 }],
|
|
43
|
+
* relatedClientIds: [client.id],
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Access inherited EBR resource
|
|
47
|
+
* const weights = sdk.ebr.presets.suggested();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class MJRComplianceSDKScoped extends MexicoComplianceSDKScoped {
|
|
51
|
+
readonly clients: MJRClientsResource;
|
|
52
|
+
readonly transactions: MJRTransactionsResource;
|
|
53
|
+
readonly reports: MJRReportsResource;
|
|
54
|
+
constructor(options: MJRScopedSDKOptions);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ComplianceSDK.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComplianceSDK.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AACrG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAC/G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAErG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,sBAAuB,SAAQ,yBAAyB;IAInE,SAAwB,OAAO,EAAE,kBAAkB,CAAC;IAEpD,SAAwB,YAAY,EAAE,uBAAuB,CAAC;IAE9D,SAAwB,OAAO,EAAE,kBAAkB,CAAC;gBAGxC,OAAO,EAAE,mBAAmB;CAGzC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR-scoped ComplianceSDK
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured SDK for Mexico jurisdiction and Metales y Joyas (MJR) activity.
|
|
5
|
+
* Extends MexicoComplianceSDKScoped to inherit Mexico-specific resources like EBR.
|
|
6
|
+
*/
|
|
7
|
+
import { MexicoComplianceSDKScoped } from "../../ComplianceSDK";
|
|
8
|
+
/**
|
|
9
|
+
* MJR-scoped ComplianceSDK.
|
|
10
|
+
* Pre-configured for Mexico jurisdiction and Metales y Joyas (MJR) activity.
|
|
11
|
+
*
|
|
12
|
+
* Inherits Mexico-specific resources:
|
|
13
|
+
* - `ebr` - EBR (Evaluación Basada en Riesgos) for AML/KYC risk evaluation
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { ComplianceSDK } from "@artu/compliance-sdk/mexico/actividad-vulnerable/mjr";
|
|
18
|
+
*
|
|
19
|
+
* const sdk = new ComplianceSDK({
|
|
20
|
+
* apiKey: process.env.API_KEY!,
|
|
21
|
+
* environment: "test",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // Already scoped - no need to specify jurisdiction/activity
|
|
25
|
+
* const client = await sdk.clients.create({
|
|
26
|
+
* type: ClientType.Person,
|
|
27
|
+
* name: "Juan García",
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Create transactions with nested goods and payments
|
|
31
|
+
* const txn = await sdk.transactions.create({
|
|
32
|
+
* amount: 50000,
|
|
33
|
+
* currency: "MXN",
|
|
34
|
+
* timestamp: new Date(),
|
|
35
|
+
* operationType: "601",
|
|
36
|
+
* operationPostalCode: "06600",
|
|
37
|
+
* goods: [{ goodType: "1", unit: "1", quantity: 1 }],
|
|
38
|
+
* payments: [{ paymentDate: new Date(), paymentForm: "1", monetaryInstrument: "1", currency: "2", amount: 50000 }],
|
|
39
|
+
* relatedClientIds: [client.id],
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Access inherited EBR resource
|
|
43
|
+
* const weights = sdk.ebr.presets.suggested();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export class MJRComplianceSDKScoped extends MexicoComplianceSDKScoped {
|
|
47
|
+
// addresses and bankAccounts inherited from MexicoComplianceSDKImpl (MexAddressesResource, MexBankAccountsResource)
|
|
48
|
+
constructor(options) {
|
|
49
|
+
super({ ...options, actividadVulnerable: "MJR" });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR SDK Module
|
|
3
|
+
*
|
|
4
|
+
* Exports types, registration, and scoped SDK for Metales y Joyas.
|
|
5
|
+
*/
|
|
6
|
+
export { type MJRSDKOptions, type MJRScopedSDKOptions, type MJRComplianceSDK, registerMJRScope, } from "./types";
|
|
7
|
+
export { MJRComplianceSDKScoped } from "./ComplianceSDK";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/mex/actividad-vulnerable/mjr/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
|