@artu-ai/compliance-sdk 0.8.2 → 0.9.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/README.md +2 -2
- package/dist/errors/base.d.ts +1 -1
- package/dist/errors/base.js +1 -1
- package/dist/exports/index.d.ts +4 -4
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/index.js +2 -2
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts +11 -11
- package/dist/exports/mexico/actividad-vulnerable/avi.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/avi.js +10 -10
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts +11 -11
- package/dist/exports/mexico/actividad-vulnerable/jys.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/jys.js +10 -10
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts +11 -11
- package/dist/exports/mexico/actividad-vulnerable/mjr.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/mjr.js +10 -10
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts +11 -11
- package/dist/exports/mexico/actividad-vulnerable/tsc.d.ts.map +1 -1
- package/dist/exports/mexico/actividad-vulnerable/tsc.js +10 -10
- package/dist/exports/mexico/index.d.ts +4 -4
- package/dist/exports/mexico/index.d.ts.map +1 -1
- package/dist/exports/mexico/index.js +3 -3
- package/dist/models/Alert.d.ts +106 -0
- package/dist/models/Alert.d.ts.map +1 -0
- package/dist/models/{Report.js → Alert.js} +44 -31
- package/dist/models/{ReportItem.d.ts → AlertItem.d.ts} +15 -15
- package/dist/models/AlertItem.d.ts.map +1 -0
- package/dist/models/{ReportItem.js → AlertItem.js} +13 -13
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +7 -7
- package/dist/models/mex/MexAlert.d.ts +50 -0
- package/dist/models/mex/MexAlert.d.ts.map +1 -0
- package/dist/models/mex/{MexReport.js → MexAlert.js} +15 -15
- package/dist/models/mex/MexAlertItem.d.ts +39 -0
- package/dist/models/mex/MexAlertItem.d.ts.map +1 -0
- package/dist/models/mex/{MexReportItem.js → MexAlertItem.js} +11 -11
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableAlert.d.ts +38 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableAlert.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/{MexActividadVulnerableReport.js → MexActividadVulnerableAlert.js} +11 -11
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableAlertItem.d.ts +38 -0
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableAlertItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/{MexActividadVulnerableReportItem.js → MexActividadVulnerableAlertItem.js} +11 -11
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIAlert.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIAlert.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/{MexAVIReport.js → MexAVIAlert.js} +14 -14
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIAlertItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIAlertItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/avi/{MexAVIReportItem.js → MexAVIAlertItem.js} +13 -13
- package/dist/models/mex/actividad-vulnerable/index.d.ts +10 -10
- package/dist/models/mex/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/models/mex/actividad-vulnerable/index.js +12 -12
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSAlert.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSAlert.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/{MexJYSReport.js → MexJYSAlert.js} +14 -14
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSAlertItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSAlertItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/jys/{MexJYSReportItem.js → MexJYSAlertItem.js} +13 -13
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRAlert.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRAlert.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/{MexMJRReport.js → MexMJRAlert.js} +14 -14
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRAlertItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRAlertItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/mjr/{MexMJRReportItem.js → MexMJRAlertItem.js} +13 -13
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCAlert.d.ts +53 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCAlert.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/{MexTSCReport.js → MexTSCAlert.js} +14 -14
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCAlertItem.d.ts +56 -0
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCAlertItem.d.ts.map +1 -0
- package/dist/models/mex/actividad-vulnerable/tsc/{MexTSCReportItem.js → MexTSCAlertItem.js} +13 -13
- package/dist/models/mex/index.d.ts +2 -2
- package/dist/models/mex/index.d.ts.map +1 -1
- package/dist/models/mex/index.js +3 -3
- package/dist/models/types.d.ts +17 -17
- package/dist/models/types.d.ts.map +1 -1
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts +12 -12
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/actividad-vulnerable/avi/index.js +7 -7
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts +24 -24
- package/dist/namespaces/mexico/actividad-vulnerable/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/actividad-vulnerable/index.js +5 -5
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts +12 -12
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/actividad-vulnerable/jys/index.js +7 -7
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts +12 -12
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/actividad-vulnerable/tsc/index.js +7 -7
- package/dist/namespaces/mexico/index.d.ts +48 -48
- package/dist/namespaces/mexico/index.d.ts.map +1 -1
- package/dist/namespaces/mexico/index.js +8 -8
- package/dist/resources/alerts.d.ts +245 -0
- package/dist/resources/alerts.d.ts.map +1 -0
- package/dist/resources/{reports.js → alerts.js} +107 -107
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -1
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.d.ts +190 -0
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/{reports.js → alerts.js} +86 -86
- package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts +1 -1
- package/dist/resources/mex/actividad-vulnerable/avi/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/avi/index.js +1 -1
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts +170 -0
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/jys/{reports.js → alerts.js} +82 -82
- package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts +1 -1
- package/dist/resources/mex/actividad-vulnerable/jys/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/jys/index.js +1 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts +170 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/{reports.js → alerts.js} +83 -83
- package/dist/resources/mex/actividad-vulnerable/mjr/index.d.ts +1 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/index.js +1 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts +170 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts.map +1 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/{reports.js → alerts.js} +82 -82
- package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts +1 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/index.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/index.js +1 -1
- package/dist/resources/mex/alerts.d.ts +266 -0
- package/dist/resources/mex/alerts.d.ts.map +1 -0
- package/dist/resources/mex/{reports.js → alerts.js} +109 -109
- package/dist/resources/mex/ebr.d.ts +1 -1
- package/dist/resources/mex/ebr.js +1 -1
- package/dist/resources/mex/index.d.ts +1 -1
- package/dist/resources/mex/index.d.ts.map +1 -1
- package/dist/resources/mex/index.js +1 -1
- package/dist/sdk/ComplianceSDK.d.ts +10 -10
- package/dist/sdk/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/ComplianceSDK.js +9 -9
- package/dist/sdk/base.js +2 -2
- package/dist/sdk/mex/ComplianceSDK.d.ts +3 -3
- package/dist/sdk/mex/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/mex/ComplianceSDK.js +1 -1
- package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts +2 -2
- package/dist/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts +3 -3
- package/dist/sdk/mex/actividad-vulnerable/avi/types.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/avi/types.js +2 -2
- package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts +2 -2
- package/dist/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts +3 -3
- package/dist/sdk/mex/actividad-vulnerable/jys/types.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/jys/types.js +2 -2
- package/dist/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.d.ts +2 -2
- package/dist/sdk/mex/actividad-vulnerable/mjr/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.d.ts +3 -3
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/mjr/types.js +2 -2
- package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts +2 -2
- package/dist/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts +3 -3
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.d.ts.map +1 -1
- package/dist/sdk/mex/actividad-vulnerable/tsc/types.js +2 -2
- package/dist/sdk/mex/index.js +2 -2
- package/dist/sdk/mex/types.d.ts +2 -2
- package/dist/sdk/mex/types.d.ts.map +1 -1
- package/dist/sdk/resource-registry.d.ts +4 -4
- package/dist/sdk/resource-registry.d.ts.map +1 -1
- package/dist/sdk/resource-registry.js +1 -1
- package/dist/utils/upload.js +1 -1
- package/package.json +2 -2
- package/dist/models/Report.d.ts +0 -98
- package/dist/models/Report.d.ts.map +0 -1
- package/dist/models/ReportItem.d.ts.map +0 -1
- package/dist/models/mex/MexReport.d.ts +0 -50
- package/dist/models/mex/MexReport.d.ts.map +0 -1
- package/dist/models/mex/MexReportItem.d.ts +0 -39
- package/dist/models/mex/MexReportItem.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts +0 -38
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReport.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts +0 -38
- package/dist/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts +0 -53
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReport.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts +0 -56
- package/dist/models/mex/actividad-vulnerable/avi/MexAVIReportItem.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts +0 -53
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReport.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts +0 -56
- package/dist/models/mex/actividad-vulnerable/jys/MexJYSReportItem.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReport.d.ts +0 -53
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReport.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReportItem.d.ts +0 -56
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRReportItem.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts +0 -53
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReport.d.ts.map +0 -1
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts +0 -56
- package/dist/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.d.ts.map +0 -1
- package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts +0 -190
- package/dist/resources/mex/actividad-vulnerable/avi/reports.d.ts.map +0 -1
- package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts +0 -170
- package/dist/resources/mex/actividad-vulnerable/jys/reports.d.ts.map +0 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/reports.d.ts +0 -170
- package/dist/resources/mex/actividad-vulnerable/mjr/reports.d.ts.map +0 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts +0 -170
- package/dist/resources/mex/actividad-vulnerable/tsc/reports.d.ts.map +0 -1
- package/dist/resources/mex/reports.d.ts +0 -266
- package/dist/resources/mex/reports.d.ts.map +0 -1
- package/dist/resources/reports.d.ts +0 -245
- package/dist/resources/reports.d.ts.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JYS (Juegos y Sorteos)
|
|
2
|
+
* JYS (Juegos y Sorteos) Alerts Resource
|
|
3
3
|
*
|
|
4
|
-
* Extends
|
|
5
|
-
* - Accepts flattened
|
|
6
|
-
* - Returns
|
|
4
|
+
* Extends MexAlertsResource with JYS-specific behavior:
|
|
5
|
+
* - Accepts flattened CreateJYSAlertInput (JYS fields at root level)
|
|
6
|
+
* - Returns MexJYSAlert models
|
|
7
7
|
*/
|
|
8
8
|
import { z } from "zod";
|
|
9
|
-
import { CodigoActividad,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { CodigoActividad, createJYSAlertInputSchema, updateJYSAlertInputSchema, upsertJYSAlertInputSchema, createJYSAlertItemInputSchema, updateJYSAlertItemInputSchema, jysDefaultsInputSchema, submitJYSSubmissionInputSchema, transformSort, jysAlertFieldMapping, } from "@artu-ai/shared";
|
|
10
|
+
import { MexAlertsResource } from "../../alerts";
|
|
11
|
+
import { MexJYSAlert, MexJYSAlertItem, } from "../../../../models";
|
|
12
12
|
// ===========================
|
|
13
|
-
//
|
|
13
|
+
// JYSAlertsResource
|
|
14
14
|
// ===========================
|
|
15
15
|
/**
|
|
16
|
-
* JYS (Juegos y Sorteos) scoped
|
|
16
|
+
* JYS (Juegos y Sorteos) scoped alerts resource.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```typescript
|
|
@@ -24,54 +24,54 @@ import { MexJYSReport, MexJYSReportItem, } from "../../../../models";
|
|
|
24
24
|
* });
|
|
25
25
|
*
|
|
26
26
|
* // Create with fully flattened input
|
|
27
|
-
* const
|
|
27
|
+
* const alert = await jysSdk.alerts.create({
|
|
28
28
|
* mesReportado: "202401",
|
|
29
29
|
* });
|
|
30
30
|
*
|
|
31
|
-
* // Returns
|
|
32
|
-
* console.log(
|
|
31
|
+
* // Returns MexJYSAlert
|
|
32
|
+
* console.log(alert.mesReportado);
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export class
|
|
35
|
+
export class JYSAlertsResource extends MexAlertsResource {
|
|
36
36
|
// ─────────────────────────────────────────────────────────────────
|
|
37
|
-
//
|
|
37
|
+
// Alert CRUD
|
|
38
38
|
// ─────────────────────────────────────────────────────────────────
|
|
39
39
|
async create(data) {
|
|
40
|
-
const validated = this.validate(
|
|
40
|
+
const validated = this.validate(createJYSAlertInputSchema, data);
|
|
41
41
|
const nestedData = this.transformToNested(validated);
|
|
42
|
-
const response = await this.execute(() => this.trpc.
|
|
42
|
+
const response = await this.execute(() => this.trpc.alerts.create.mutate(nestedData));
|
|
43
43
|
return this.instantiate(response);
|
|
44
44
|
}
|
|
45
45
|
async retrieve(id) {
|
|
46
|
-
const response = await this.execute(() => this.trpc.
|
|
46
|
+
const response = await this.execute(() => this.trpc.alerts.retrieve.query({ id }));
|
|
47
47
|
return this.instantiate(response);
|
|
48
48
|
}
|
|
49
49
|
async retrieveByMetadata(key, value) {
|
|
50
|
-
const response = await this.execute(() => this.trpc.
|
|
50
|
+
const response = await this.execute(() => this.trpc.alerts.retrieveByMetadata.query({ key, value }));
|
|
51
51
|
return this.instantiate(response);
|
|
52
52
|
}
|
|
53
53
|
async retrieveByExternalId(externalId) {
|
|
54
|
-
const response = await this.execute(() => this.trpc.
|
|
54
|
+
const response = await this.execute(() => this.trpc.alerts.retrieveByExternalId.query({ externalId }));
|
|
55
55
|
return this.instantiate(response);
|
|
56
56
|
}
|
|
57
57
|
async update(id, data) {
|
|
58
|
-
const validated = this.validate(
|
|
58
|
+
const validated = this.validate(updateJYSAlertInputSchema, data);
|
|
59
59
|
const nestedData = this.transformUpdateToNested(validated);
|
|
60
|
-
const response = await this.execute(() => this.trpc.
|
|
60
|
+
const response = await this.execute(() => this.trpc.alerts.update.mutate({ id, data: nestedData }));
|
|
61
61
|
return this.instantiate(response);
|
|
62
62
|
}
|
|
63
63
|
// ─────────────────────────────────────────────────────────────────
|
|
64
64
|
// List & Pagination
|
|
65
65
|
// ─────────────────────────────────────────────────────────────────
|
|
66
66
|
/**
|
|
67
|
-
* Lists JYS
|
|
67
|
+
* Lists JYS alerts with optional filtering.
|
|
68
68
|
*
|
|
69
|
-
* Accepts flattened JYS filter (future JYS-specific
|
|
69
|
+
* Accepts flattened JYS filter (future JYS-specific alert fields at root level).
|
|
70
70
|
*/
|
|
71
71
|
async list(options) {
|
|
72
72
|
const scopedFilter = this.applyScopeToFilter(options?.filter);
|
|
73
73
|
const scopedSort = this.applyScopeToSort(options?.sort);
|
|
74
|
-
const response = await this.execute(() => this.trpc.
|
|
74
|
+
const response = await this.execute(() => this.trpc.alerts.list.query({
|
|
75
75
|
...options,
|
|
76
76
|
filter: scopedFilter,
|
|
77
77
|
sort: scopedSort,
|
|
@@ -82,9 +82,9 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Iterates over JYS
|
|
85
|
+
* Iterates over JYS alerts.
|
|
86
86
|
*
|
|
87
|
-
* Accepts flattened JYS filter (future JYS-specific
|
|
87
|
+
* Accepts flattened JYS filter (future JYS-specific alert fields at root level).
|
|
88
88
|
*/
|
|
89
89
|
iterate(options) {
|
|
90
90
|
const scopedFilter = this.applyScopeToFilter(options?.filter);
|
|
@@ -96,21 +96,21 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* Counts JYS
|
|
99
|
+
* Counts JYS alerts matching the given filter.
|
|
100
100
|
*
|
|
101
101
|
* @param filter - Optional filter criteria (with JYS fields at root level)
|
|
102
|
-
* @returns The count of matching
|
|
102
|
+
* @returns The count of matching alerts
|
|
103
103
|
*/
|
|
104
104
|
async count(filter) {
|
|
105
105
|
const scopedFilter = this.applyScopeToFilter(filter);
|
|
106
|
-
const response = await this.execute(() => this.trpc.
|
|
106
|
+
const response = await this.execute(() => this.trpc.alerts.count.query({ filter: scopedFilter }));
|
|
107
107
|
return response.count;
|
|
108
108
|
}
|
|
109
|
-
async createMany(
|
|
109
|
+
async createMany(alerts, options = {}) {
|
|
110
110
|
const atomic = options.atomic ?? true;
|
|
111
|
-
const validated = this.validate(z.array(
|
|
111
|
+
const validated = this.validate(z.array(createJYSAlertInputSchema), alerts);
|
|
112
112
|
const nestedItems = validated.map((r) => this.transformToNested(r));
|
|
113
|
-
const response = await this.execute(() => this.trpc.
|
|
113
|
+
const response = await this.execute(() => this.trpc.alerts.createMany.mutate({ items: nestedItems, atomic }));
|
|
114
114
|
if (response.atomic) {
|
|
115
115
|
return {
|
|
116
116
|
atomic: true,
|
|
@@ -132,14 +132,14 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
132
132
|
const atomic = options.atomic ?? true;
|
|
133
133
|
const updateItemSchema = z.object({
|
|
134
134
|
id: z.uuid(),
|
|
135
|
-
data:
|
|
135
|
+
data: updateJYSAlertInputSchema,
|
|
136
136
|
});
|
|
137
137
|
const validated = this.validate(z.array(updateItemSchema), updates);
|
|
138
138
|
const nestedUpdates = validated.map((u) => ({
|
|
139
139
|
id: u.id,
|
|
140
140
|
data: this.transformUpdateToNested(u.data),
|
|
141
141
|
}));
|
|
142
|
-
const response = await this.execute(() => this.trpc.
|
|
142
|
+
const response = await this.execute(() => this.trpc.alerts.updateMany.mutate({ items: nestedUpdates, atomic }));
|
|
143
143
|
if (response.atomic) {
|
|
144
144
|
return {
|
|
145
145
|
atomic: true,
|
|
@@ -161,25 +161,25 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
161
161
|
// Upsert Operations
|
|
162
162
|
// ─────────────────────────────────────────────────────────────────
|
|
163
163
|
/**
|
|
164
|
-
* Creates or updates a JYS
|
|
164
|
+
* Creates or updates a JYS alert by externalId.
|
|
165
165
|
*
|
|
166
|
-
* @param data -
|
|
167
|
-
* @returns The created or updated
|
|
166
|
+
* @param data - Alert upsert data with JYS fields at root level (must include externalId)
|
|
167
|
+
* @returns The created or updated alert with action indicator
|
|
168
168
|
*/
|
|
169
169
|
async upsertByExternalId(data) {
|
|
170
|
-
const validated = this.validate(
|
|
170
|
+
const validated = this.validate(upsertJYSAlertInputSchema, data);
|
|
171
171
|
const nestedData = this.transformToNested(validated);
|
|
172
|
-
const response = await this.execute(() => this.trpc.
|
|
172
|
+
const response = await this.execute(() => this.trpc.alerts.upsertByExternalId.mutate(nestedData));
|
|
173
173
|
return {
|
|
174
174
|
data: this.instantiate(response.data),
|
|
175
175
|
action: response.action,
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
async upsertManyByExternalId(
|
|
178
|
+
async upsertManyByExternalId(alerts, options = {}) {
|
|
179
179
|
const atomic = options.atomic ?? true;
|
|
180
|
-
const validated = this.validate(z.array(
|
|
180
|
+
const validated = this.validate(z.array(upsertJYSAlertInputSchema), alerts);
|
|
181
181
|
const nestedItems = validated.map((r) => this.transformToNested(r));
|
|
182
|
-
const response = await this.execute(() => this.trpc.
|
|
182
|
+
const response = await this.execute(() => this.trpc.alerts.upsertManyByExternalId.mutate({
|
|
183
183
|
items: nestedItems,
|
|
184
184
|
atomic,
|
|
185
185
|
}));
|
|
@@ -207,33 +207,33 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
// ─────────────────────────────────────────────────────────────────
|
|
210
|
-
//
|
|
210
|
+
// Alert Items
|
|
211
211
|
// ─────────────────────────────────────────────────────────────────
|
|
212
|
-
async addItem(
|
|
213
|
-
const validated = this.validate(
|
|
212
|
+
async addItem(alertId, data) {
|
|
213
|
+
const validated = this.validate(createJYSAlertItemInputSchema, data);
|
|
214
214
|
const nestedData = this.transformItemToNested(validated);
|
|
215
|
-
const response = await this.execute(() => this.trpc.
|
|
215
|
+
const response = await this.execute(() => this.trpc.alerts.addItem.mutate({ alertId, data: nestedData }));
|
|
216
216
|
return this.instantiateItem(response);
|
|
217
217
|
}
|
|
218
|
-
async getItem(
|
|
219
|
-
const response = await this.execute(() => this.trpc.
|
|
218
|
+
async getItem(alertId, itemId) {
|
|
219
|
+
const response = await this.execute(() => this.trpc.alerts.getItem.query({ alertId, itemId }));
|
|
220
220
|
return this.instantiateItem(response);
|
|
221
221
|
}
|
|
222
|
-
async updateItem(
|
|
223
|
-
const validated = this.validate(
|
|
222
|
+
async updateItem(alertId, itemId, data) {
|
|
223
|
+
const validated = this.validate(updateJYSAlertItemInputSchema, data);
|
|
224
224
|
const nestedData = this.transformItemUpdateToNested(validated);
|
|
225
|
-
const response = await this.execute(() => this.trpc.
|
|
226
|
-
|
|
225
|
+
const response = await this.execute(() => this.trpc.alerts.updateItem.mutate({
|
|
226
|
+
alertId,
|
|
227
227
|
itemId,
|
|
228
228
|
data: nestedData,
|
|
229
229
|
}));
|
|
230
230
|
return this.instantiateItem(response);
|
|
231
231
|
}
|
|
232
|
-
async listItems(
|
|
232
|
+
async listItems(alertId, options) {
|
|
233
233
|
// Transform flattened JYS filter to nested format
|
|
234
234
|
const scopedFilter = this.applyScopeToItemFilter(options?.filter);
|
|
235
|
-
const response = await this.execute(() => this.trpc.
|
|
236
|
-
|
|
235
|
+
const response = await this.execute(() => this.trpc.alerts.listItems.query({
|
|
236
|
+
alertId,
|
|
237
237
|
...options,
|
|
238
238
|
filter: scopedFilter,
|
|
239
239
|
}));
|
|
@@ -243,7 +243,7 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
|
-
* Transforms a flattened
|
|
246
|
+
* Transforms a flattened JYSAlertItemFilter to nested AlertItemFilter format.
|
|
247
247
|
*/
|
|
248
248
|
applyScopeToItemFilter(filter) {
|
|
249
249
|
if (!filter)
|
|
@@ -270,10 +270,10 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
270
270
|
},
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
async addItems(
|
|
274
|
-
const validated = this.validate(z.array(
|
|
273
|
+
async addItems(alertId, items) {
|
|
274
|
+
const validated = this.validate(z.array(createJYSAlertItemInputSchema), items);
|
|
275
275
|
const nestedItems = validated.map((i) => this.transformItemToNested(i));
|
|
276
|
-
const response = await this.execute(() => this.trpc.
|
|
276
|
+
const response = await this.execute(() => this.trpc.alerts.addItems.mutate({ alertId, items: nestedItems }));
|
|
277
277
|
return {
|
|
278
278
|
added: response.added,
|
|
279
279
|
items: response.items.map((i) => this.instantiateItem(i)),
|
|
@@ -283,47 +283,47 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
283
283
|
// Validation
|
|
284
284
|
// ─────────────────────────────────────────────────────────────────
|
|
285
285
|
/**
|
|
286
|
-
* Validates a JYS
|
|
286
|
+
* Validates a JYS alert.
|
|
287
287
|
*
|
|
288
288
|
* Uses JYS-scoped validation input (jurisdiction and activity are implicit).
|
|
289
289
|
*
|
|
290
|
-
* @param
|
|
291
|
-
* @param defaults - JYS
|
|
290
|
+
* @param alertId - The alert ID to validate
|
|
291
|
+
* @param defaults - JYS alert defaults including rfc, alertType, etc.
|
|
292
292
|
*
|
|
293
293
|
* @example
|
|
294
294
|
* ```typescript
|
|
295
|
-
* const result = await jysSdk.
|
|
295
|
+
* const result = await jysSdk.alerts.validateAlert(alert.id, {
|
|
296
296
|
* rfc: "ABC200101XXX",
|
|
297
297
|
* alertType: "100",
|
|
298
298
|
* });
|
|
299
299
|
* ```
|
|
300
300
|
*/
|
|
301
|
-
async
|
|
301
|
+
async validateAlert(alertId, defaults) {
|
|
302
302
|
const validated = this.validate(jysDefaultsInputSchema, defaults);
|
|
303
|
-
const nestedInput = this.transformJysDefaultsToNested(
|
|
304
|
-
return this.execute(() => this.trpc.
|
|
303
|
+
const nestedInput = this.transformJysDefaultsToNested(alertId, validated);
|
|
304
|
+
return this.execute(() => this.trpc.alerts.validate.mutate(nestedInput));
|
|
305
305
|
}
|
|
306
306
|
// ─────────────────────────────────────────────────────────────────
|
|
307
307
|
// Generation
|
|
308
308
|
// ─────────────────────────────────────────────────────────────────
|
|
309
309
|
/**
|
|
310
|
-
* Generates XML for a JYS
|
|
310
|
+
* Generates XML for a JYS alert.
|
|
311
311
|
*
|
|
312
|
-
* Uses the same input as
|
|
312
|
+
* Uses the same input as validateAlert.
|
|
313
313
|
*
|
|
314
|
-
* @param
|
|
315
|
-
* @param defaults - JYS
|
|
314
|
+
* @param alertId - The alert ID to generate XML for
|
|
315
|
+
* @param defaults - JYS alert defaults including rfc, alertType, etc.
|
|
316
316
|
*/
|
|
317
|
-
async
|
|
317
|
+
async generateAlert(alertId, defaults) {
|
|
318
318
|
const validated = this.validate(jysDefaultsInputSchema, defaults);
|
|
319
|
-
const nestedInput = this.transformJysDefaultsToNested(
|
|
320
|
-
return this.execute(() => this.trpc.
|
|
319
|
+
const nestedInput = this.transformJysDefaultsToNested(alertId, validated);
|
|
320
|
+
return this.execute(() => this.trpc.alerts.generate.mutate(nestedInput));
|
|
321
321
|
}
|
|
322
322
|
// ─────────────────────────────────────────────────────────────────
|
|
323
323
|
// Submission
|
|
324
324
|
// ─────────────────────────────────────────────────────────────────
|
|
325
325
|
/**
|
|
326
|
-
* Submits a validated JYS
|
|
326
|
+
* Submits a validated JYS alert.
|
|
327
327
|
*
|
|
328
328
|
* Uses JYS-scoped submission input (activity is implicit).
|
|
329
329
|
*/
|
|
@@ -339,8 +339,8 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
339
339
|
},
|
|
340
340
|
},
|
|
341
341
|
};
|
|
342
|
-
return this.execute(() => this.trpc.
|
|
343
|
-
|
|
342
|
+
return this.execute(() => this.trpc.alerts.submit.mutate({
|
|
343
|
+
alertId: validated.alertId,
|
|
344
344
|
jurisdictions,
|
|
345
345
|
}));
|
|
346
346
|
}
|
|
@@ -348,7 +348,7 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
348
348
|
// Protected Helpers
|
|
349
349
|
// ─────────────────────────────────────────────────────────────────
|
|
350
350
|
/**
|
|
351
|
-
* Transforms a flattened
|
|
351
|
+
* Transforms a flattened JYSAlertSort to nested AlertSort format.
|
|
352
352
|
*
|
|
353
353
|
* Maps flattened field names to their full API paths.
|
|
354
354
|
*/
|
|
@@ -356,7 +356,7 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
356
356
|
if (!sort || sort.length === 0) {
|
|
357
357
|
return undefined;
|
|
358
358
|
}
|
|
359
|
-
return transformSort(sort,
|
|
359
|
+
return transformSort(sort, jysAlertFieldMapping);
|
|
360
360
|
}
|
|
361
361
|
transformToNested(data) {
|
|
362
362
|
const { mesReportado, ...baseFields } = data;
|
|
@@ -392,10 +392,10 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
instantiate(data) {
|
|
395
|
-
return new
|
|
395
|
+
return new MexJYSAlert(data);
|
|
396
396
|
}
|
|
397
397
|
instantiateItem(data) {
|
|
398
|
-
return new
|
|
398
|
+
return new MexJYSAlertItem(data);
|
|
399
399
|
}
|
|
400
400
|
transformItemToNested(data) {
|
|
401
401
|
const { alertType, alertDescription, amendment, ...baseFields } = data;
|
|
@@ -443,10 +443,10 @@ export class JYSReportsResource extends MexReportsResource {
|
|
|
443
443
|
/**
|
|
444
444
|
* Transforms JYS defaults to nested API format for validate/generate.
|
|
445
445
|
*/
|
|
446
|
-
transformJysDefaultsToNested(
|
|
446
|
+
transformJysDefaultsToNested(alertId, defaults) {
|
|
447
447
|
const { rfc, collegiateEntityCode, exempt, priority, ...jysFields } = defaults;
|
|
448
448
|
return {
|
|
449
|
-
|
|
449
|
+
alertId,
|
|
450
450
|
jurisdictions: {
|
|
451
451
|
MX: {
|
|
452
452
|
actividadVulnerable: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/jys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/jys/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MJR (Metales y Joyas - Precious Metals and Jewelry) Alerts Resource
|
|
3
|
+
*
|
|
4
|
+
* Extends MexAlertsResource with MJR-specific behavior:
|
|
5
|
+
* - Accepts flattened CreateMJRAlertInput (MJR fields at root level)
|
|
6
|
+
* - Returns MexMJRAlert models
|
|
7
|
+
*/
|
|
8
|
+
import type { CreateAlertInput, UpdateAlertInput, CreateAlertItemInput, UpdateAlertItemInput, CreateMJRAlertInput, UpdateMJRAlertInput, UpsertMJRAlertInput, CreateMJRAlertItemInput, UpdateMJRAlertItemInput, ListOptions, PaginatedResponse, AtomicBatchResult, PartialBatchResult, MjrAlertDefaultsInput, ValidationResult, GenerateResult, SubmissionResult, SubmitMJRSubmissionInput, UpsertResult } from "@artu-ai/shared";
|
|
9
|
+
import type { MJRAlertFilter, MJRAlertSort, MJRAlertItemFilter, AlertSort, AlertItemFilter, AlertItemSort } from "@artu-ai/shared";
|
|
10
|
+
import { MexAlertsResource } from "../../alerts";
|
|
11
|
+
import { MexMJRAlert, MexMJRAlertItem, type AlertData, type AlertItemData } from "../../../../models";
|
|
12
|
+
/**
|
|
13
|
+
* MJR (Metales y Joyas) scoped alerts resource.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const mjrSdk = new ComplianceSDK({
|
|
18
|
+
* apiKey,
|
|
19
|
+
* jurisdiction: Jurisdiction.Mexico,
|
|
20
|
+
* actividadVulnerable: CodigoActividad.MJR,
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Create with fully flattened input
|
|
24
|
+
* const alert = await mjrSdk.alerts.create({
|
|
25
|
+
* mesReportado: "202401",
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Returns MexMJRAlert
|
|
29
|
+
* console.log(alert.mesReportado);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class MJRAlertsResource extends MexAlertsResource<MJRAlertSort, MjrAlertDefaultsInput> {
|
|
33
|
+
create(data: CreateMJRAlertInput): Promise<MexMJRAlert>;
|
|
34
|
+
retrieve(id: string): Promise<MexMJRAlert>;
|
|
35
|
+
retrieveByMetadata(key: string, value: string): Promise<MexMJRAlert>;
|
|
36
|
+
retrieveByExternalId(externalId: string): Promise<MexMJRAlert>;
|
|
37
|
+
update(id: string, data: UpdateMJRAlertInput): Promise<MexMJRAlert>;
|
|
38
|
+
/**
|
|
39
|
+
* Lists MJR alerts with optional filtering.
|
|
40
|
+
*
|
|
41
|
+
* Accepts flattened MJR filter (future MJR-specific alert fields at root level).
|
|
42
|
+
*/
|
|
43
|
+
list(options?: ListOptions<MJRAlertFilter, MJRAlertSort>): Promise<PaginatedResponse<MexMJRAlert>>;
|
|
44
|
+
/**
|
|
45
|
+
* Iterates over MJR alerts.
|
|
46
|
+
*
|
|
47
|
+
* Accepts flattened MJR filter (future MJR-specific alert fields at root level).
|
|
48
|
+
*/
|
|
49
|
+
iterate(options?: {
|
|
50
|
+
filter?: MJRAlertFilter;
|
|
51
|
+
sort?: MJRAlertSort;
|
|
52
|
+
pageSize?: number;
|
|
53
|
+
}): AsyncGenerator<MexMJRAlert, void, undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Counts MJR alerts matching the given filter.
|
|
56
|
+
*
|
|
57
|
+
* @param filter - Optional filter criteria (with MJR fields at root level)
|
|
58
|
+
* @returns The count of matching alerts
|
|
59
|
+
*/
|
|
60
|
+
count(filter?: MJRAlertFilter): Promise<number>;
|
|
61
|
+
createMany(alerts: CreateMJRAlertInput[], options?: {
|
|
62
|
+
atomic?: true;
|
|
63
|
+
}): Promise<AtomicBatchResult<MexMJRAlert>>;
|
|
64
|
+
createMany(alerts: CreateMJRAlertInput[], options: {
|
|
65
|
+
atomic: false;
|
|
66
|
+
}): Promise<PartialBatchResult<MexMJRAlert>>;
|
|
67
|
+
updateMany(updates: {
|
|
68
|
+
id: string;
|
|
69
|
+
data: UpdateMJRAlertInput;
|
|
70
|
+
}[], options?: {
|
|
71
|
+
atomic?: true;
|
|
72
|
+
}): Promise<AtomicBatchResult<MexMJRAlert>>;
|
|
73
|
+
updateMany(updates: {
|
|
74
|
+
id: string;
|
|
75
|
+
data: UpdateMJRAlertInput;
|
|
76
|
+
}[], options: {
|
|
77
|
+
atomic: false;
|
|
78
|
+
}): Promise<PartialBatchResult<MexMJRAlert>>;
|
|
79
|
+
/**
|
|
80
|
+
* Creates or updates a MJR alert by externalId.
|
|
81
|
+
*
|
|
82
|
+
* @param data - Alert upsert data with MJR fields at root level (must include externalId)
|
|
83
|
+
* @returns The created or updated alert with action indicator
|
|
84
|
+
*/
|
|
85
|
+
upsertByExternalId(data: UpsertMJRAlertInput): Promise<UpsertResult<MexMJRAlert>>;
|
|
86
|
+
/**
|
|
87
|
+
* Creates or updates multiple MJR alerts by externalId.
|
|
88
|
+
*
|
|
89
|
+
* @param alerts - Array of alert upsert data (each must include externalId)
|
|
90
|
+
* @param options - Batch options (atomic: true by default)
|
|
91
|
+
* @returns Atomic result with data array, or partial result with succeeded/failed
|
|
92
|
+
*/
|
|
93
|
+
upsertManyByExternalId(alerts: UpsertMJRAlertInput[], options?: {
|
|
94
|
+
atomic?: true;
|
|
95
|
+
}): Promise<AtomicBatchResult<UpsertResult<MexMJRAlert>>>;
|
|
96
|
+
upsertManyByExternalId(alerts: UpsertMJRAlertInput[], options: {
|
|
97
|
+
atomic: false;
|
|
98
|
+
}): Promise<PartialBatchResult<UpsertResult<MexMJRAlert>>>;
|
|
99
|
+
addItem(alertId: string, data: CreateMJRAlertItemInput): Promise<MexMJRAlertItem>;
|
|
100
|
+
getItem(alertId: string, itemId: string): Promise<MexMJRAlertItem>;
|
|
101
|
+
updateItem(alertId: string, itemId: string, data: UpdateMJRAlertItemInput): Promise<MexMJRAlertItem>;
|
|
102
|
+
listItems(alertId: string, options?: ListOptions<MJRAlertItemFilter, AlertItemSort>): Promise<PaginatedResponse<MexMJRAlertItem>>;
|
|
103
|
+
/**
|
|
104
|
+
* Transforms a flattened MJRAlertItemFilter to nested AlertItemFilter format.
|
|
105
|
+
*/
|
|
106
|
+
protected applyScopeToItemFilter(filter?: MJRAlertItemFilter): AlertItemFilter | undefined;
|
|
107
|
+
addItems(alertId: string, items: CreateMJRAlertItemInput[]): Promise<{
|
|
108
|
+
added: number;
|
|
109
|
+
items: MexMJRAlertItem[];
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Validates a MJR alert.
|
|
113
|
+
*
|
|
114
|
+
* Uses MJR-scoped validation input (jurisdiction and activity are implicit).
|
|
115
|
+
*
|
|
116
|
+
* @param alertId - The alert ID to validate
|
|
117
|
+
* @param defaults - MJR alert defaults including rfc, alertType, etc.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* const result = await mjrSdk.alerts.validateAlert(alert.id, {
|
|
122
|
+
* rfc: "ABC200101XXX",
|
|
123
|
+
* alertType: "100",
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
validateAlert(alertId: string, defaults: MjrAlertDefaultsInput): Promise<ValidationResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Generates XML for a MJR alert.
|
|
130
|
+
*
|
|
131
|
+
* Uses the same input as validateAlert.
|
|
132
|
+
*
|
|
133
|
+
* @param alertId - The alert ID to generate XML for
|
|
134
|
+
* @param defaults - MJR alert defaults including rfc, alertType, etc.
|
|
135
|
+
*/
|
|
136
|
+
generateAlert(alertId: string, defaults: MjrAlertDefaultsInput): Promise<GenerateResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Submits a validated MJR alert.
|
|
139
|
+
*
|
|
140
|
+
* Uses MJR-scoped submission input (activity is implicit).
|
|
141
|
+
*/
|
|
142
|
+
submit(input: SubmitMJRSubmissionInput): Promise<SubmissionResult>;
|
|
143
|
+
protected transformToNested(data: CreateMJRAlertInput): CreateAlertInput;
|
|
144
|
+
/**
|
|
145
|
+
* Transforms flattened MJR alert update to nested API format.
|
|
146
|
+
*
|
|
147
|
+
* NOTE: Always includes `actividadVulnerable: { MJR: {} }` even if no
|
|
148
|
+
* MJR-specific fields are provided. This ensures that records touched via
|
|
149
|
+
* the MJR SDK can be filtered by `activityCodes: { in: ["MJR"] }`.
|
|
150
|
+
*/
|
|
151
|
+
protected transformUpdateToNested(data: UpdateMJRAlertInput): UpdateAlertInput;
|
|
152
|
+
protected instantiate(data: AlertData): MexMJRAlert;
|
|
153
|
+
protected instantiateItem(data: AlertItemData): MexMJRAlertItem;
|
|
154
|
+
protected transformItemToNested(data: CreateMJRAlertItemInput): CreateAlertItemInput;
|
|
155
|
+
protected transformItemUpdateToNested(data: UpdateMJRAlertItemInput): UpdateAlertItemInput;
|
|
156
|
+
/**
|
|
157
|
+
* Transforms a flattened MJRAlertSort to nested AlertSort format.
|
|
158
|
+
*
|
|
159
|
+
* Maps flattened field names to their full API paths using MJR-specific field mapping.
|
|
160
|
+
*/
|
|
161
|
+
protected applyScopeToSort(sort?: MJRAlertSort): AlertSort | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Transforms MJR defaults to nested API format for validate/generate.
|
|
164
|
+
*/
|
|
165
|
+
protected transformMjrDefaultsToNested(alertId: string, defaults: MjrAlertDefaultsInput): {
|
|
166
|
+
alertId: string;
|
|
167
|
+
jurisdictions: unknown;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=alerts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/mjr/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAEhB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACb,MAAM,iBAAiB,CAAC;AAazB,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,aAAa,EACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EACL,WAAW,EACX,eAAe,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAM5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,iBAAkB,SAAQ,iBAAiB,CACtD,YAAY,EACZ,qBAAqB,CACtB;IAKO,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAWvD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAO1C,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAA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