@artu-ai/compliance-sdk 0.9.2 → 0.10.1
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/index.d.ts +2 -2
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/index.js +1 -1
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts +15 -2
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts +15 -2
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts +15 -2
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts +15 -2
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts.map +1 -1
- package/dist/exports/mexico/cnbv/transmisor.d.ts +14 -1
- package/dist/exports/mexico/cnbv/transmisor.d.ts.map +1 -1
- package/dist/exports/mexico/index.d.ts +1 -1
- package/dist/exports/mexico/index.d.ts.map +1 -1
- package/dist/models/Alert.d.ts +0 -4
- package/dist/models/Alert.d.ts.map +1 -1
- package/dist/models/Alert.js +0 -6
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts +2 -2
- package/dist/namespaces/mexico/index.d.ts +29 -3
- package/dist/namespaces/mexico/index.d.ts.map +1 -1
- package/dist/resources/alerts.d.ts +17 -18
- package/dist/resources/alerts.d.ts.map +1 -1
- package/dist/resources/alerts.js +28 -28
- package/dist/resources/bank-accounts.d.ts +4 -0
- package/dist/resources/bank-accounts.d.ts.map +1 -1
- package/dist/resources/bank-accounts.js +79 -8
- 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/avi/alerts.d.ts +10 -23
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.js +33 -52
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts +9 -13
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.js +32 -42
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts +9 -13
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.js +32 -42
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts +9 -13
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.js +32 -42
- package/dist/resources/mex/alerts.d.ts +26 -41
- package/dist/resources/mex/alerts.d.ts.map +1 -1
- package/dist/resources/mex/alerts.js +55 -60
- package/dist/resources/mex/cnbv/transmisor/alerts.d.ts +7 -6
- package/dist/resources/mex/cnbv/transmisor/alerts.d.ts.map +1 -1
- package/dist/resources/mex/cnbv/transmisor/alerts.js +27 -32
- package/dist/resources/reports.d.ts +78 -0
- package/dist/resources/reports.d.ts.map +1 -0
- package/dist/resources/reports.js +81 -0
- package/dist/sdk/ComplianceSDK.d.ts +28 -11
- package/dist/sdk/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/ComplianceSDK.js +24 -6
- package/dist/sdk/mex/types.d.ts +2 -0
- package/dist/sdk/mex/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* - Transforms flattened filters to nested format
|
|
7
7
|
* - Returns MexAlert models
|
|
8
8
|
*/
|
|
9
|
+
import { createMexAlertInputSchema, createMexAlertItemInputSchema, mexAlertDefaultsInputSchema, mexAlertFieldMapping, transformSort, updateMexAlertInputSchema, updateMexAlertItemInputSchema, upsertMexAlertInputSchema, } from "@artu-ai/shared";
|
|
9
10
|
import { z } from "zod";
|
|
10
|
-
import { createMexAlertInputSchema, updateMexAlertInputSchema, upsertMexAlertInputSchema, createMexAlertItemInputSchema, updateMexAlertItemInputSchema, mexSubmitAlertInputSchema, transformSort, mexAlertFieldMapping, mexAlertDefaultsInputSchema, } from "@artu-ai/shared";
|
|
11
|
-
import { AlertsResource, } from "../alerts";
|
|
12
11
|
import { MexAlert } from "../../models";
|
|
13
12
|
import { MexAlertItem } from "../../models/mex";
|
|
13
|
+
import { AlertsResource, } from "../alerts";
|
|
14
14
|
// ===========================
|
|
15
15
|
// MexAlertsResource
|
|
16
16
|
// ===========================
|
|
@@ -297,7 +297,7 @@ export class MexAlertsResource extends AlertsResource {
|
|
|
297
297
|
*
|
|
298
298
|
* @example
|
|
299
299
|
* ```typescript
|
|
300
|
-
* const result = await mexSdk.alerts.
|
|
300
|
+
* const result = await mexSdk.alerts.validateReport(alert.id, {
|
|
301
301
|
* actividadVulnerable: {
|
|
302
302
|
* rfc: "ABC200101XXX",
|
|
303
303
|
* AVI: {
|
|
@@ -308,10 +308,12 @@ export class MexAlertsResource extends AlertsResource {
|
|
|
308
308
|
* });
|
|
309
309
|
* ```
|
|
310
310
|
*/
|
|
311
|
-
async
|
|
312
|
-
const validated =
|
|
313
|
-
|
|
314
|
-
|
|
311
|
+
async validateReport(alertId, reportType, defaults) {
|
|
312
|
+
const validated = defaults
|
|
313
|
+
? this.validate(mexAlertDefaultsInputSchema, defaults)
|
|
314
|
+
: undefined;
|
|
315
|
+
const nestedInput = this.transformValidateToNested(alertId, reportType, validated);
|
|
316
|
+
return this.execute(() => this.trpc.alerts.validateReport.mutate(nestedInput));
|
|
315
317
|
}
|
|
316
318
|
// ─────────────────────────────────────────────────────────────────
|
|
317
319
|
// Generation
|
|
@@ -319,65 +321,37 @@ export class MexAlertsResource extends AlertsResource {
|
|
|
319
321
|
/**
|
|
320
322
|
* Generates XML for a Mexico alert.
|
|
321
323
|
*
|
|
322
|
-
* Uses the same input as
|
|
324
|
+
* Uses the same input as validateReport since generation requires
|
|
323
325
|
* the same transformation and defaults.
|
|
324
326
|
*
|
|
325
327
|
* @param alertId - The alert ID to generate XML for
|
|
326
|
-
* @param
|
|
328
|
+
* @param reportType - The report type (e.g., "mex.actividad-vulnerable.avi")
|
|
329
|
+
* @param defaults - Mexico alert defaults including activity-specific settings (optional)
|
|
327
330
|
*
|
|
328
331
|
* @example
|
|
329
332
|
* ```typescript
|
|
330
|
-
* const result = await mexSdk.alerts.
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
333
|
+
* const result = await mexSdk.alerts.generateReport(
|
|
334
|
+
* alert.id,
|
|
335
|
+
* ReportType.MexActividadVulnerableAVI,
|
|
336
|
+
* {
|
|
337
|
+
* actividadVulnerable: {
|
|
338
|
+
* rfc: "ABC200101XXX",
|
|
339
|
+
* AVI: {
|
|
340
|
+
* platformDomain: "https://example.com",
|
|
341
|
+
* alertType: "100",
|
|
342
|
+
* },
|
|
336
343
|
* },
|
|
337
344
|
* },
|
|
338
|
-
* });
|
|
339
|
-
* console.log(result.xml);
|
|
340
|
-
* ```
|
|
341
|
-
*/
|
|
342
|
-
async generateAlert(alertId, defaults) {
|
|
343
|
-
const validated = this.validate(mexAlertDefaultsInputSchema, defaults);
|
|
344
|
-
const nestedInput = this.transformValidateToNested(alertId, validated);
|
|
345
|
-
return this.execute(() => this.trpc.alerts.generate.mutate(nestedInput));
|
|
346
|
-
}
|
|
347
|
-
// ─────────────────────────────────────────────────────────────────
|
|
348
|
-
// Submission
|
|
349
|
-
// ─────────────────────────────────────────────────────────────────
|
|
350
|
-
/**
|
|
351
|
-
* Submits a validated Mexico alert.
|
|
352
|
-
*
|
|
353
|
-
* The alert must be in "valid" status. After submission, the alert
|
|
354
|
-
* is locked and cannot be edited (except rejected alerts which can
|
|
355
|
-
* be edited and resubmitted).
|
|
356
|
-
*
|
|
357
|
-
* @param alertId - The alert ID
|
|
358
|
-
* @param actividadVulnerable - The activity type (AVI, JYS, or TSC)
|
|
359
|
-
* @param data - Optional submission data (acuseRecibo, notes)
|
|
360
|
-
*
|
|
361
|
-
* @example
|
|
362
|
-
* ```typescript
|
|
363
|
-
* const result = await mexSdk.alerts.submitAlert(
|
|
364
|
-
* alert.id,
|
|
365
|
-
* "AVI",
|
|
366
|
-
* { acuseRecibo: "SAT-12345", notes: "Submitted via portal" }
|
|
367
345
|
* );
|
|
346
|
+
* console.log(result.xml);
|
|
368
347
|
* ```
|
|
369
348
|
*/
|
|
370
|
-
async
|
|
371
|
-
const validated =
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
};
|
|
377
|
-
return this.execute(() => this.trpc.alerts.submit.mutate({
|
|
378
|
-
alertId: validated.alertId,
|
|
379
|
-
jurisdictions,
|
|
380
|
-
}));
|
|
349
|
+
async generateReport(alertId, reportType, defaults) {
|
|
350
|
+
const validated = defaults
|
|
351
|
+
? this.validate(mexAlertDefaultsInputSchema, defaults)
|
|
352
|
+
: undefined;
|
|
353
|
+
const nestedInput = this.transformGenerateToNested(alertId, reportType, validated);
|
|
354
|
+
return this.execute(() => this.trpc.alerts.generateReport.mutate(nestedInput));
|
|
381
355
|
}
|
|
382
356
|
// ─────────────────────────────────────────────────────────────────
|
|
383
357
|
// Protected Helpers
|
|
@@ -496,14 +470,35 @@ export class MexAlertsResource extends AlertsResource {
|
|
|
496
470
|
};
|
|
497
471
|
}
|
|
498
472
|
/**
|
|
499
|
-
* Transforms flattened MX validate
|
|
473
|
+
* Transforms flattened MX validate input to nested API format.
|
|
500
474
|
*/
|
|
501
|
-
transformValidateToNested(alertId, defaults) {
|
|
475
|
+
transformValidateToNested(alertId, reportType, defaults) {
|
|
502
476
|
return {
|
|
503
477
|
alertId,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
478
|
+
reportType,
|
|
479
|
+
defaults: defaults
|
|
480
|
+
? {
|
|
481
|
+
jurisdictions: {
|
|
482
|
+
MX: defaults,
|
|
483
|
+
},
|
|
484
|
+
}
|
|
485
|
+
: undefined,
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Transforms flattened MX generate input to nested API format.
|
|
490
|
+
*/
|
|
491
|
+
transformGenerateToNested(alertId, reportType, defaults) {
|
|
492
|
+
return {
|
|
493
|
+
alertId,
|
|
494
|
+
reportType,
|
|
495
|
+
defaults: defaults
|
|
496
|
+
? {
|
|
497
|
+
jurisdictions: {
|
|
498
|
+
MX: defaults,
|
|
499
|
+
},
|
|
500
|
+
}
|
|
501
|
+
: undefined,
|
|
507
502
|
};
|
|
508
503
|
}
|
|
509
504
|
}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* - Returns MexTransmisorAlert models
|
|
7
7
|
* - Nests Transmisor fields under jurisdictions.MX.cnbv.TRANSMISOR
|
|
8
8
|
*/
|
|
9
|
-
import type { CreateAlertInput, UpdateAlertInput, CreateAlertItemInput, UpdateAlertItemInput, CreateTransmisorAlertInput, UpdateTransmisorAlertInput, UpsertTransmisorAlertInput, CreateTransmisorAlertItemInput, UpdateTransmisorAlertItemInput,
|
|
9
|
+
import type { CreateAlertInput, UpdateAlertInput, CreateAlertItemInput, UpdateAlertItemInput, CreateTransmisorAlertInput, UpdateTransmisorAlertInput, UpsertTransmisorAlertInput, CreateTransmisorAlertItemInput, UpdateTransmisorAlertItemInput, ListOptions, PaginatedResponse, AtomicBatchResult, PartialBatchResult, ValidationResult, GenerateResult, TransmisorAlertDefaultsInput, UpsertResult } from "@artu-ai/shared";
|
|
10
|
+
import { ReportType } from "@artu-ai/shared";
|
|
10
11
|
import type { TransmisorAlertFilter, TransmisorAlertSort, TransmisorAlertItemFilter, AlertSort, AlertItemFilter, AlertItemSort } from "@artu-ai/shared";
|
|
11
12
|
import { MexAlertsResource } from "../../alerts";
|
|
12
13
|
import { MexTransmisorAlert, MexTransmisorAlertItem, type AlertData, type AlertItemData } from "../../../../models";
|
|
@@ -51,9 +52,8 @@ export declare class TransmisorAlertsResource extends MexAlertsResource<Transmis
|
|
|
51
52
|
added: number;
|
|
52
53
|
items: MexTransmisorAlertItem[];
|
|
53
54
|
}>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
submit(input: SubmitTransmisorAlertInput): Promise<SubmissionResult>;
|
|
55
|
+
validateReport(alertId: string, defaults?: TransmisorAlertDefaultsInput): Promise<ValidationResult>;
|
|
56
|
+
generateReport(alertId: string, defaults?: TransmisorAlertDefaultsInput): Promise<GenerateResult>;
|
|
57
57
|
protected applyScopeToSort(sort?: TransmisorAlertSort): AlertSort | undefined;
|
|
58
58
|
protected transformToNested(data: CreateTransmisorAlertInput): CreateAlertInput;
|
|
59
59
|
protected transformUpdateToNested(data: UpdateTransmisorAlertInput): UpdateAlertInput;
|
|
@@ -64,9 +64,10 @@ export declare class TransmisorAlertsResource extends MexAlertsResource<Transmis
|
|
|
64
64
|
/**
|
|
65
65
|
* Transforms Transmisor defaults to nested API format for validate/generate.
|
|
66
66
|
*/
|
|
67
|
-
protected transformDefaultsToNested(alertId: string, defaults
|
|
67
|
+
protected transformDefaultsToNested(alertId: string, defaults?: TransmisorAlertDefaultsInput): {
|
|
68
68
|
alertId: string;
|
|
69
|
-
|
|
69
|
+
reportType: ReportType;
|
|
70
|
+
defaults?: unknown;
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
//# sourceMappingURL=alerts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/cnbv/transmisor/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAEhB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../../src/resources/m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BvB,SAAS,CAAC,2BAA2B,CACpC,IAAI,EAAE,8BAA8B,GAClC,oBAAoB;IAiCvB;;OAEG;IACH,SAAS,CAAC,yBAAyB,CAClC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,4BAA4B,GACrC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;CAuBlE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Nests Transmisor fields under jurisdictions.MX.cnbv.TRANSMISOR
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { createTransmisorAlertInputSchema, updateTransmisorAlertInputSchema, upsertTransmisorAlertInputSchema, createTransmisorAlertItemInputSchema, updateTransmisorAlertItemInputSchema,
|
|
10
|
+
import { ReportType, createTransmisorAlertInputSchema, updateTransmisorAlertInputSchema, upsertTransmisorAlertInputSchema, createTransmisorAlertItemInputSchema, updateTransmisorAlertItemInputSchema, transmisorDefaultsInputSchema, transformSort, transmisorAlertFieldMapping, } from "@artu-ai/shared";
|
|
11
11
|
import { MexAlertsResource } from "../../alerts";
|
|
12
12
|
import { MexTransmisorAlert, MexTransmisorAlertItem, } from "../../../../models";
|
|
13
13
|
// ===========================
|
|
@@ -198,38 +198,24 @@ export class TransmisorAlertsResource extends MexAlertsResource {
|
|
|
198
198
|
// ─────────────────────────────────────────────────────────────────
|
|
199
199
|
// Validation
|
|
200
200
|
// ─────────────────────────────────────────────────────────────────
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
// @ts-expect-error - Scoped SDK provides simpler API without requiring reportType
|
|
202
|
+
async validateReport(alertId, defaults) {
|
|
203
|
+
const validated = defaults
|
|
204
|
+
? this.validate(transmisorDefaultsInputSchema, defaults)
|
|
205
|
+
: undefined;
|
|
203
206
|
const nestedInput = this.transformDefaultsToNested(alertId, validated);
|
|
204
|
-
return this.execute(() => this.trpc.alerts.
|
|
207
|
+
return this.execute(() => this.trpc.alerts.validateReport.mutate(nestedInput));
|
|
205
208
|
}
|
|
206
209
|
// ─────────────────────────────────────────────────────────────────
|
|
207
210
|
// Generation
|
|
208
211
|
// ─────────────────────────────────────────────────────────────────
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
// @ts-expect-error - Scoped SDK provides simpler API without requiring reportType
|
|
213
|
+
async generateReport(alertId, defaults) {
|
|
214
|
+
const validated = defaults
|
|
215
|
+
? this.validate(transmisorDefaultsInputSchema, defaults)
|
|
216
|
+
: undefined;
|
|
211
217
|
const nestedInput = this.transformDefaultsToNested(alertId, validated);
|
|
212
|
-
return this.execute(() => this.trpc.alerts.
|
|
213
|
-
}
|
|
214
|
-
// ─────────────────────────────────────────────────────────────────
|
|
215
|
-
// Submission
|
|
216
|
-
// ─────────────────────────────────────────────────────────────────
|
|
217
|
-
async submit(input) {
|
|
218
|
-
const validated = this.validate(submitTransmisorAlertInputSchema, input);
|
|
219
|
-
const jurisdictions = {
|
|
220
|
-
MX: {
|
|
221
|
-
cnbv: {
|
|
222
|
-
TRANSMISOR: {
|
|
223
|
-
acuseRecibo: validated.acuseRecibo,
|
|
224
|
-
notes: validated.notes,
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
return this.execute(() => this.trpc.alerts.submit.mutate({
|
|
230
|
-
alertId: validated.alertId,
|
|
231
|
-
jurisdictions,
|
|
232
|
-
}));
|
|
218
|
+
return this.execute(() => this.trpc.alerts.generateReport.mutate(nestedInput));
|
|
233
219
|
}
|
|
234
220
|
// ─────────────────────────────────────────────────────────────────
|
|
235
221
|
// Protected Helpers
|
|
@@ -349,13 +335,22 @@ export class TransmisorAlertsResource extends MexAlertsResource {
|
|
|
349
335
|
* Transforms Transmisor defaults to nested API format for validate/generate.
|
|
350
336
|
*/
|
|
351
337
|
transformDefaultsToNested(alertId, defaults) {
|
|
338
|
+
if (!defaults) {
|
|
339
|
+
return {
|
|
340
|
+
alertId,
|
|
341
|
+
reportType: ReportType.MexCNBVTransmisor,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
352
344
|
return {
|
|
353
345
|
alertId,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
346
|
+
reportType: ReportType.MexCNBVTransmisor,
|
|
347
|
+
defaults: {
|
|
348
|
+
jurisdictions: {
|
|
349
|
+
MX: {
|
|
350
|
+
cnbv: {
|
|
351
|
+
...defaults,
|
|
352
|
+
TRANSMISOR: defaults,
|
|
353
|
+
},
|
|
359
354
|
},
|
|
360
355
|
},
|
|
361
356
|
},
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports Resource
|
|
3
|
+
*
|
|
4
|
+
* Read-only operations for generated report files.
|
|
5
|
+
* Reports are generated from alerts and stored in S3 with hash-based deduplication.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReportResponse, ReportDownloadUrl, ReportFilter, ReportSort, ListOptions, PaginatedResponse } from "@artu-ai/shared";
|
|
8
|
+
import type { TRPCClient } from "../utils/trpc-client";
|
|
9
|
+
export type { ReportFilter, ReportSort, ReportDownloadUrl };
|
|
10
|
+
/**
|
|
11
|
+
* Report model (read-only)
|
|
12
|
+
*/
|
|
13
|
+
export type Report = ReportResponse;
|
|
14
|
+
/**
|
|
15
|
+
* Resource manager for report operations.
|
|
16
|
+
*
|
|
17
|
+
* Reports are generated from alerts and stored in S3. This resource provides
|
|
18
|
+
* read-only access to retrieve, list, and download reports.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Get a specific report
|
|
23
|
+
* const report = await sdk.reports.retrieve("report_123");
|
|
24
|
+
*
|
|
25
|
+
* // List reports for an alert
|
|
26
|
+
* const reports = await sdk.reports.listByAlert("alert_123");
|
|
27
|
+
*
|
|
28
|
+
* // Get download URL
|
|
29
|
+
* const { url } = await sdk.reports.getDownloadUrl("report_123");
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class ReportsResource {
|
|
33
|
+
private readonly trpc;
|
|
34
|
+
constructor(trpc: TRPCClient);
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves a report by ID.
|
|
37
|
+
*/
|
|
38
|
+
retrieve(id: string): Promise<Report>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists reports with optional filtering and pagination.
|
|
41
|
+
*/
|
|
42
|
+
list(options?: ListOptions<ReportFilter, ReportSort>): Promise<PaginatedResponse<Report>>;
|
|
43
|
+
/**
|
|
44
|
+
* Lists reports for a specific alert with pagination.
|
|
45
|
+
*
|
|
46
|
+
* @param alertId - The alert ID
|
|
47
|
+
* @param options - Pagination and filter options
|
|
48
|
+
*/
|
|
49
|
+
listByAlert(alertId: string, options?: {
|
|
50
|
+
/** If true (default), only returns current versions */
|
|
51
|
+
currentOnly?: boolean;
|
|
52
|
+
/** Pagination limit */
|
|
53
|
+
limit?: number;
|
|
54
|
+
/** Pagination offset */
|
|
55
|
+
offset?: number;
|
|
56
|
+
/** Include total count in response */
|
|
57
|
+
includeTotalCount?: boolean;
|
|
58
|
+
/** Sort options */
|
|
59
|
+
sort?: ReportSort;
|
|
60
|
+
}): Promise<PaginatedResponse<Report>>;
|
|
61
|
+
/**
|
|
62
|
+
* Counts reports matching the given filter.
|
|
63
|
+
*
|
|
64
|
+
* @param filter - Optional filter criteria
|
|
65
|
+
* @returns The count of matching reports
|
|
66
|
+
*/
|
|
67
|
+
count(filter?: ReportFilter): Promise<number>;
|
|
68
|
+
/**
|
|
69
|
+
* Gets a presigned download URL for a report file.
|
|
70
|
+
*
|
|
71
|
+
* The URL is valid for a limited time (typically 15 minutes).
|
|
72
|
+
*
|
|
73
|
+
* @param id - Report ID
|
|
74
|
+
* @returns Presigned URL with metadata
|
|
75
|
+
*/
|
|
76
|
+
getDownloadUrl(id: string): Promise<ReportDownloadUrl>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=reports.d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;;;;;OAOG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAG5D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports Resource
|
|
3
|
+
*
|
|
4
|
+
* Read-only operations for generated report files.
|
|
5
|
+
* Reports are generated from alerts and stored in S3 with hash-based deduplication.
|
|
6
|
+
*/
|
|
7
|
+
// ===========================
|
|
8
|
+
// ReportsResource
|
|
9
|
+
// ===========================
|
|
10
|
+
/**
|
|
11
|
+
* Resource manager for report operations.
|
|
12
|
+
*
|
|
13
|
+
* Reports are generated from alerts and stored in S3. This resource provides
|
|
14
|
+
* read-only access to retrieve, list, and download reports.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Get a specific report
|
|
19
|
+
* const report = await sdk.reports.retrieve("report_123");
|
|
20
|
+
*
|
|
21
|
+
* // List reports for an alert
|
|
22
|
+
* const reports = await sdk.reports.listByAlert("alert_123");
|
|
23
|
+
*
|
|
24
|
+
* // Get download URL
|
|
25
|
+
* const { url } = await sdk.reports.getDownloadUrl("report_123");
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class ReportsResource {
|
|
29
|
+
trpc;
|
|
30
|
+
constructor(trpc) {
|
|
31
|
+
this.trpc = trpc;
|
|
32
|
+
}
|
|
33
|
+
// ─────────────────────────────────────────────────────────────────
|
|
34
|
+
// Retrieval
|
|
35
|
+
// ─────────────────────────────────────────────────────────────────
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a report by ID.
|
|
38
|
+
*/
|
|
39
|
+
async retrieve(id) {
|
|
40
|
+
return this.trpc.reports.retrieve.query({ id });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Lists reports with optional filtering and pagination.
|
|
44
|
+
*/
|
|
45
|
+
async list(options) {
|
|
46
|
+
return this.trpc.reports.list.query(options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Lists reports for a specific alert with pagination.
|
|
50
|
+
*
|
|
51
|
+
* @param alertId - The alert ID
|
|
52
|
+
* @param options - Pagination and filter options
|
|
53
|
+
*/
|
|
54
|
+
async listByAlert(alertId, options) {
|
|
55
|
+
return this.trpc.reports.listByAlert.query({ alertId, ...options });
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Counts reports matching the given filter.
|
|
59
|
+
*
|
|
60
|
+
* @param filter - Optional filter criteria
|
|
61
|
+
* @returns The count of matching reports
|
|
62
|
+
*/
|
|
63
|
+
async count(filter) {
|
|
64
|
+
const response = await this.trpc.reports.count.query({ filter });
|
|
65
|
+
return response.count;
|
|
66
|
+
}
|
|
67
|
+
// ─────────────────────────────────────────────────────────────────
|
|
68
|
+
// Download
|
|
69
|
+
// ─────────────────────────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* Gets a presigned download URL for a report file.
|
|
72
|
+
*
|
|
73
|
+
* The URL is valid for a limited time (typically 15 minutes).
|
|
74
|
+
*
|
|
75
|
+
* @param id - Report ID
|
|
76
|
+
* @returns Presigned URL with metadata
|
|
77
|
+
*/
|
|
78
|
+
async getDownloadUrl(id) {
|
|
79
|
+
return this.trpc.reports.getDownloadUrl.query({ id });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
import {
|
|
43
|
-
import { type
|
|
44
|
-
import { type
|
|
42
|
+
import { CodigoActividad, type CodigoSujetoCNBV, Jurisdiction } from "@artu-ai/shared";
|
|
43
|
+
import { type SDKSessionOptions, type SDKSessionOptionsWithReturnTo, type SessionResultWithoutRedirect, type SessionResultWithRedirect } from "../utils/session";
|
|
44
|
+
import { type APIVersion, type TRPCClient } from "../utils/trpc-client";
|
|
45
45
|
import { type UnscopedSDKOptions } from "./base";
|
|
46
|
-
import { type
|
|
47
|
-
import { type
|
|
48
|
-
import { type
|
|
49
|
-
import { type
|
|
50
|
-
import { type
|
|
51
|
-
import { type
|
|
46
|
+
import { type AVIComplianceSDK, type AVISDKOptions } from "./mex/actividad-vulnerable/avi/types";
|
|
47
|
+
import { type JYSComplianceSDK, type JYSSDKOptions } from "./mex/actividad-vulnerable/jys/types";
|
|
48
|
+
import { type TSCComplianceSDK, type TSCSDKOptions } from "./mex/actividad-vulnerable/tsc/types";
|
|
49
|
+
import { type TransmisorComplianceSDK, type TransmisorSDKOptions } from "./mex/cnbv/transmisor/types";
|
|
50
|
+
import { type ComplianceSDKOptionsMexico, type MexicoComplianceSDK, type MexicoSDKOptions } from "./mex/types";
|
|
51
|
+
import { type BaseComplianceSDK, type ComplianceAuthMode, type Environment, type FetchCredentials, type OtherJurisdictionSDKOptions, type SDKScope } from "./types";
|
|
52
52
|
export type { ComplianceSDKOptionsBase } from "./types";
|
|
53
|
-
import {
|
|
53
|
+
import { AddressesResource, type AlertsResource, BankAccountsResource, type ClientsResource, ContactMethodsResource, DocumentsResource, ExchangeRatesResource, ReportsResource, type TransactionsResource } from "../resources";
|
|
54
54
|
export type { SDKScope };
|
|
55
55
|
export type { ComplianceSDKOptionsMexico, MexicoSDKOptions, AVISDKOptions, JYSSDKOptions, TSCSDKOptions, TransmisorSDKOptions, MexicoComplianceSDK, AVIComplianceSDK, JYSComplianceSDK, TSCComplianceSDK, TransmisorComplianceSDK, };
|
|
56
56
|
/**
|
|
@@ -71,6 +71,7 @@ export interface UnscopedComplianceSDK extends BaseComplianceSDK {
|
|
|
71
71
|
readonly contactMethods: ContactMethodsResource;
|
|
72
72
|
readonly documents: DocumentsResource;
|
|
73
73
|
readonly exchangeRates: ExchangeRatesResource;
|
|
74
|
+
readonly reports: ReportsResource;
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
76
77
|
* Main entry point for the Compliance SDK.
|
|
@@ -285,7 +286,7 @@ export declare class ComplianceSDKImpl {
|
|
|
285
286
|
* });
|
|
286
287
|
*
|
|
287
288
|
* // Validate and generate
|
|
288
|
-
* const validation = await sdk.alerts.
|
|
289
|
+
* const validation = await sdk.alerts.validateReport(alert.id);
|
|
289
290
|
* if (validation.valid) {
|
|
290
291
|
* const result = await sdk.alerts.generate(alert.id);
|
|
291
292
|
* }
|
|
@@ -307,6 +308,22 @@ export declare class ComplianceSDKImpl {
|
|
|
307
308
|
* ```
|
|
308
309
|
*/
|
|
309
310
|
readonly exchangeRates: ExchangeRatesResource;
|
|
311
|
+
/**
|
|
312
|
+
* Reports resource manager.
|
|
313
|
+
*
|
|
314
|
+
* Provides read-only access to generated report files.
|
|
315
|
+
* Reports are generated from alerts and stored in S3.
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* // Get reports for an alert
|
|
320
|
+
* const reports = await sdk.reports.listByAlert(alertId);
|
|
321
|
+
*
|
|
322
|
+
* // Get download URL for a report
|
|
323
|
+
* const { url } = await sdk.reports.getDownloadUrl(reportId);
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
readonly reports: ReportsResource;
|
|
310
327
|
constructor(options: ComplianceSDKOptions);
|
|
311
328
|
/**
|
|
312
329
|
* 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,EACN,
|
|
1
|
+
{"version":3,"file":"ComplianceSDK.d.ts","sourceRoot":"","sources":["../../src/sdk/ComplianceSDK.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EACN,eAAe,EACf,KAAK,gBAAgB,EACrB,YAAY,EACZ,MAAM,iBAAiB,CAAC;AAMzB,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,E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|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
43
|
+
import { resolveBaseUrl, resolveEnvironment, resolveOrganizationId, } from "../utils/environment";
|
|
44
|
+
import { fetchSession, } from "../utils/session";
|
|
45
|
+
import { createAPIClient, DEFAULT_TIMEOUT, LATEST_API_VERSION, } from "../utils/trpc-client";
|
|
46
46
|
import { getResourceFactories } from "./resource-registry";
|
|
47
47
|
import { getSDKClass } from "./sdk-registry";
|
|
48
|
-
import {
|
|
48
|
+
import { buildScope, isMexicoScope, } from "./types";
|
|
49
49
|
// Resources
|
|
50
|
-
import {
|
|
50
|
+
import { AddressesResource, BankAccountsResource, ContactMethodsResource, DocumentsResource, ExchangeRatesResource, ReportsResource, } from "../resources";
|
|
51
51
|
// ===========================
|
|
52
52
|
// ComplianceSDK Class
|
|
53
53
|
// ===========================
|
|
@@ -270,7 +270,7 @@ export class ComplianceSDKImpl {
|
|
|
270
270
|
* });
|
|
271
271
|
*
|
|
272
272
|
* // Validate and generate
|
|
273
|
-
* const validation = await sdk.alerts.
|
|
273
|
+
* const validation = await sdk.alerts.validateReport(alert.id);
|
|
274
274
|
* if (validation.valid) {
|
|
275
275
|
* const result = await sdk.alerts.generate(alert.id);
|
|
276
276
|
* }
|
|
@@ -292,6 +292,22 @@ export class ComplianceSDKImpl {
|
|
|
292
292
|
* ```
|
|
293
293
|
*/
|
|
294
294
|
exchangeRates;
|
|
295
|
+
/**
|
|
296
|
+
* Reports resource manager.
|
|
297
|
+
*
|
|
298
|
+
* Provides read-only access to generated report files.
|
|
299
|
+
* Reports are generated from alerts and stored in S3.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```typescript
|
|
303
|
+
* // Get reports for an alert
|
|
304
|
+
* const reports = await sdk.reports.listByAlert(alertId);
|
|
305
|
+
*
|
|
306
|
+
* // Get download URL for a report
|
|
307
|
+
* const { url } = await sdk.reports.getDownloadUrl(reportId);
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
reports;
|
|
295
311
|
// ===========================
|
|
296
312
|
// Constructor
|
|
297
313
|
// ===========================
|
|
@@ -404,6 +420,8 @@ export class ComplianceSDKImpl {
|
|
|
404
420
|
this.documents = new DocumentsResource(resourceConfig);
|
|
405
421
|
// Utility resources (no scope needed)
|
|
406
422
|
this.exchangeRates = new ExchangeRatesResource(this.trpc);
|
|
423
|
+
// Reports (read-only, not scoped)
|
|
424
|
+
this.reports = new ReportsResource(this.trpc);
|
|
407
425
|
}
|
|
408
426
|
// ===========================
|
|
409
427
|
// Public Getters - Environment
|
package/dist/sdk/mex/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { MexClientsResource, MexTransactionsResource, MexBankAccountsResour
|
|
|
10
10
|
import type { ContactMethodsResource } from "../../resources/contact-methods";
|
|
11
11
|
import type { DocumentsResource } from "../../resources/documents";
|
|
12
12
|
import type { ExchangeRatesResource } from "../../resources/exchange-rates";
|
|
13
|
+
import type { ReportsResource } from "../../resources/reports";
|
|
13
14
|
/**
|
|
14
15
|
* SDK options - Mexico jurisdiction (supports actividadVulnerable and cnbv)
|
|
15
16
|
*/
|
|
@@ -57,6 +58,7 @@ export interface MexicoComplianceSDK extends BaseComplianceSDK {
|
|
|
57
58
|
readonly contactMethods: ContactMethodsResource;
|
|
58
59
|
readonly documents: DocumentsResource;
|
|
59
60
|
readonly exchangeRates: ExchangeRatesResource;
|
|
61
|
+
readonly reports: ReportsResource;
|
|
60
62
|
/**
|
|
61
63
|
* EBR (Evaluación Basada en Riesgos) resource.
|
|
62
64
|
* Mexico-only resource for risk-based evaluation methodology.
|