@artu-ai/compliance-sdk 0.6.9 → 0.8.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/Transaction.d.ts +6 -0
- package/dist/models/Transaction.d.ts.map +1 -1
- package/dist/models/Transaction.js +10 -0
- 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/avi/MexAVITransaction.d.ts +11 -21
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts.map +1 -1
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.js +21 -54
- 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/exchange-rates.d.ts +14 -0
- package/dist/resources/exchange-rates.d.ts.map +1 -0
- package/dist/resources/exchange-rates.js +30 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +2 -0
- 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/ComplianceSDK.d.ts +17 -1
- package/dist/sdk/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/ComplianceSDK.js +18 -1
- 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 +4 -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,MAA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,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
|
+
}
|
|
@@ -49,7 +49,7 @@ import { type JYSSDKOptions, type JYSComplianceSDK } from "./mex/actividad-vulne
|
|
|
49
49
|
import { type TSCSDKOptions, type TSCComplianceSDK } from "./mex/actividad-vulnerable/tsc/types";
|
|
50
50
|
import { type SDKSessionOptions, type SDKSessionOptionsWithReturnTo, type SessionResultWithRedirect, type SessionResultWithoutRedirect } from "../utils/session";
|
|
51
51
|
export type { ComplianceSDKOptionsBase } from "./types";
|
|
52
|
-
import { type ClientsResource, type TransactionsResource, type ReportsResource, BankAccountsResource, AddressesResource, ContactMethodsResource, DocumentsResource } from "../resources";
|
|
52
|
+
import { type ClientsResource, type TransactionsResource, type ReportsResource, BankAccountsResource, AddressesResource, ContactMethodsResource, DocumentsResource, ExchangeRatesResource } from "../resources";
|
|
53
53
|
export type { SDKScope };
|
|
54
54
|
export type { ComplianceSDKOptionsMexico, MexicoSDKOptions, AVISDKOptions, JYSSDKOptions, TSCSDKOptions, MexicoComplianceSDK, AVIComplianceSDK, JYSComplianceSDK, TSCComplianceSDK, };
|
|
55
55
|
/**
|
|
@@ -69,6 +69,7 @@ export interface UnscopedComplianceSDK extends BaseComplianceSDK {
|
|
|
69
69
|
readonly addresses: AddressesResource;
|
|
70
70
|
readonly contactMethods: ContactMethodsResource;
|
|
71
71
|
readonly documents: DocumentsResource;
|
|
72
|
+
readonly exchangeRates: ExchangeRatesResource;
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* Main entry point for the Compliance SDK.
|
|
@@ -290,6 +291,21 @@ export declare class ComplianceSDKImpl {
|
|
|
290
291
|
* ```
|
|
291
292
|
*/
|
|
292
293
|
readonly reports: ReportsResource;
|
|
294
|
+
/**
|
|
295
|
+
* Exchange rates resource.
|
|
296
|
+
*
|
|
297
|
+
* Provides exchange rate lookups with multi-level caching.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* const result = await sdk.exchangeRates.getRate({
|
|
302
|
+
* baseCurrency: "USD",
|
|
303
|
+
* targetCurrency: "MXN",
|
|
304
|
+
* });
|
|
305
|
+
* console.log(result.rate); // e.g. 17.25
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
readonly exchangeRates: ExchangeRatesResource;
|
|
293
309
|
constructor(options: ComplianceSDKOptions);
|
|
294
310
|
/**
|
|
295
311
|
* Current environment ("test" or "live").
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplianceSDK.d.ts","sourceRoot":"","sources":["../../src/sdk/ComplianceSDK.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EAIhB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAElC,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EAClC,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,
|
|
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;;;;OAOG;IACH,IAAI,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAE9B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;OAEG;IACH,IAAI,qBAAqB,IAAI,OAAO,CAKnC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6CG;IACG,OAAO,CACX,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,yBAAyB,CAAC;IAC/B,OAAO,CACX,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,4BAA4B,CAAC;CA4BzC;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAAC;IAC/C,KAAK,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAAC;IAC/C,KAAK,OAAO,EAAE,aAAa,GAAG,gBAAgB,CAAC;IAC/C,KAAK,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;IACrD,KACE,OAAO,EAAE,2BAA2B,GAAG,kBAAkB,GACxD,qBAAqB,CAAC;IACzB,KAAK,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAAC;CACpD;AAID,eAAO,MAAM,aAAa,EAAE,wBACmB,CAAC;AAGhD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -47,7 +47,7 @@ import { getResourceFactories } from "./resource-registry";
|
|
|
47
47
|
import { getSDKClass } from "./sdk-registry";
|
|
48
48
|
import { fetchSession, } from "../utils/session";
|
|
49
49
|
// Resources
|
|
50
|
-
import { BankAccountsResource, AddressesResource, ContactMethodsResource, DocumentsResource, } from "../resources";
|
|
50
|
+
import { BankAccountsResource, AddressesResource, ContactMethodsResource, DocumentsResource, ExchangeRatesResource, } from "../resources";
|
|
51
51
|
// ===========================
|
|
52
52
|
// ComplianceSDK Class
|
|
53
53
|
// ===========================
|
|
@@ -277,6 +277,21 @@ export class ComplianceSDKImpl {
|
|
|
277
277
|
* ```
|
|
278
278
|
*/
|
|
279
279
|
reports;
|
|
280
|
+
/**
|
|
281
|
+
* Exchange rates resource.
|
|
282
|
+
*
|
|
283
|
+
* Provides exchange rate lookups with multi-level caching.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* const result = await sdk.exchangeRates.getRate({
|
|
288
|
+
* baseCurrency: "USD",
|
|
289
|
+
* targetCurrency: "MXN",
|
|
290
|
+
* });
|
|
291
|
+
* console.log(result.rate); // e.g. 17.25
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
exchangeRates;
|
|
280
295
|
// ===========================
|
|
281
296
|
// Constructor
|
|
282
297
|
// ===========================
|
|
@@ -385,6 +400,8 @@ export class ComplianceSDKImpl {
|
|
|
385
400
|
// Supporting resources (not scoped by jurisdiction)
|
|
386
401
|
this.contactMethods = new ContactMethodsResource(resourceConfig);
|
|
387
402
|
this.documents = new DocumentsResource(resourceConfig);
|
|
403
|
+
// Utility resources (no scope needed)
|
|
404
|
+
this.exchangeRates = new ExchangeRatesResource(this.trpc);
|
|
388
405
|
}
|
|
389
406
|
// ===========================
|
|
390
407
|
// Public Getters - Environment
|
|
@@ -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
|
}
|