@artu-ai/compliance-sdk 0.10.1 → 0.10.3
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/models/Transaction.d.ts +5 -4
- package/dist/models/Transaction.d.ts.map +1 -1
- package/dist/models/Transaction.js +7 -5
- package/dist/models/mex/actividad-vulnerable/avi/MexAVITransaction.d.ts +1 -1
- package/dist/models/mex/actividad-vulnerable/mjr/MexMJRTransaction.js +1 -1
- package/dist/resources/alert-items.d.ts +55 -0
- package/dist/resources/alert-items.d.ts.map +1 -0
- package/dist/resources/alert-items.js +86 -0
- package/dist/resources/alerts.d.ts +20 -1
- package/dist/resources/alerts.d.ts.map +1 -1
- package/dist/resources/alerts.js +27 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -0
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.d.ts +147 -1
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/avi/alerts.js +7 -0
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts +147 -1
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/jys/alerts.js +7 -0
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts +147 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/mjr/alerts.js +7 -0
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts +147 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.d.ts.map +1 -1
- package/dist/resources/mex/actividad-vulnerable/tsc/alerts.js +7 -0
- package/dist/resources/mex/alerts.d.ts +1 -1
- package/dist/resources/mex/alerts.d.ts.map +1 -1
- package/dist/resources/mex/cnbv/transmisor/alerts.d.ts +136 -1
- package/dist/resources/mex/cnbv/transmisor/alerts.d.ts.map +1 -1
- package/dist/resources/mex/cnbv/transmisor/alerts.js +7 -0
- package/package.json +2 -2
|
@@ -48,9 +48,10 @@ export declare class Transaction extends BaseModel<TransactionData> {
|
|
|
48
48
|
*/
|
|
49
49
|
get isPending(): boolean;
|
|
50
50
|
/**
|
|
51
|
-
* Transaction amount
|
|
51
|
+
* Transaction amount as a precision-safe string.
|
|
52
|
+
* Use `Number(transaction.amount)` if you need a numeric value.
|
|
52
53
|
*/
|
|
53
|
-
get amount():
|
|
54
|
+
get amount(): string;
|
|
54
55
|
/**
|
|
55
56
|
* Currency code (ISO 4217)
|
|
56
57
|
*/
|
|
@@ -94,9 +95,9 @@ export declare class Transaction extends BaseModel<TransactionData> {
|
|
|
94
95
|
/**
|
|
95
96
|
* Exchange rates for currency conversion.
|
|
96
97
|
* Format: Record<targetCurrency, rate>
|
|
97
|
-
* Example: { "MXN": 17.5 } means 1 unit of transaction currency = 17.5 MXN
|
|
98
|
+
* Example: { "MXN": "17.5" } means 1 unit of transaction currency = 17.5 MXN
|
|
98
99
|
*/
|
|
99
|
-
get exchangeRates(): Record<string,
|
|
100
|
+
get exchangeRates(): Record<string, string> | undefined;
|
|
100
101
|
/**
|
|
101
102
|
* When the transaction record was created
|
|
102
103
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../src/models/Transaction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMrE;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;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,CAW5B;IAMD;;OAEG;IACH,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAE/B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAMD;;OAEG;IACH,IAAI,mBAAmB,IAAI,YAAY,GAAG,SAAS,CAElD;IAED;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAKpD;;OAEG;IACH,IAAI,aAAa,IAAI,eAAe,CAAC,eAAe,CAAC,CAEpD;IAMD;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAMD;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAElD;IAED;;;;OAIG;IACH,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAItD;IAMD;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAMQ,QAAQ,IAAI,MAAM;CAG3B;AAMD;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
|
|
@@ -54,7 +54,8 @@ export class Transaction extends BaseModel {
|
|
|
54
54
|
// Amount
|
|
55
55
|
// ─────────────────────────────────────────────────────────────────
|
|
56
56
|
/**
|
|
57
|
-
* Transaction amount
|
|
57
|
+
* Transaction amount as a precision-safe string.
|
|
58
|
+
* Use `Number(transaction.amount)` if you need a numeric value.
|
|
58
59
|
*/
|
|
59
60
|
get amount() {
|
|
60
61
|
return this._data.amount;
|
|
@@ -69,15 +70,16 @@ export class Transaction extends BaseModel {
|
|
|
69
70
|
* Formats amount with currency
|
|
70
71
|
*/
|
|
71
72
|
get formattedAmount() {
|
|
73
|
+
const numericAmount = Number(this.amount);
|
|
72
74
|
try {
|
|
73
75
|
return new Intl.NumberFormat("en-US", {
|
|
74
76
|
style: "currency",
|
|
75
77
|
currency: this.currency,
|
|
76
|
-
}).format(
|
|
78
|
+
}).format(numericAmount);
|
|
77
79
|
}
|
|
78
80
|
catch {
|
|
79
81
|
// Fallback for unsupported currencies
|
|
80
|
-
return `${this.currency} ${
|
|
82
|
+
return `${this.currency} ${numericAmount.toLocaleString()}`;
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
// ─────────────────────────────────────────────────────────────────
|
|
@@ -145,10 +147,10 @@ export class Transaction extends BaseModel {
|
|
|
145
147
|
/**
|
|
146
148
|
* Exchange rates for currency conversion.
|
|
147
149
|
* Format: Record<targetCurrency, rate>
|
|
148
|
-
* Example: { "MXN": 17.5 } means 1 unit of transaction currency = 17.5 MXN
|
|
150
|
+
* Example: { "MXN": "17.5" } means 1 unit of transaction currency = 17.5 MXN
|
|
149
151
|
*/
|
|
150
152
|
get exchangeRates() {
|
|
151
|
-
// Cast is safe: Zod guarantees all values are
|
|
153
|
+
// Cast is safe: Zod guarantees all values are strings at runtime.
|
|
152
154
|
// The Partial wrapper is a type-level artifact of z.partialRecord().
|
|
153
155
|
return this._data.exchangeRates;
|
|
154
156
|
}
|
|
@@ -46,7 +46,7 @@ export declare class MexAVITransaction extends MexActividadVulnerableTransaction
|
|
|
46
46
|
* For buy/sell: the amount of cryptocurrency.
|
|
47
47
|
* For exchange: the received amount.
|
|
48
48
|
*/
|
|
49
|
-
get cryptoAmount():
|
|
49
|
+
get cryptoAmount(): string | undefined;
|
|
50
50
|
toString(): string;
|
|
51
51
|
}
|
|
52
52
|
import type { TransactionModel } from "../../../types";
|
|
@@ -94,7 +94,7 @@ export class MexMJRTransaction extends MexActividadVulnerableTransaction {
|
|
|
94
94
|
* Total payment amount across all payments
|
|
95
95
|
*/
|
|
96
96
|
get totalPaymentAmount() {
|
|
97
|
-
return this.payments.reduce((sum, p) => sum + p.amount, 0);
|
|
97
|
+
return this.payments.reduce((sum, p) => sum + Number(p.amount), 0);
|
|
98
98
|
}
|
|
99
99
|
// ─────────────────────────────────────────────────────────────────
|
|
100
100
|
// Helpers
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert Items Resource
|
|
3
|
+
*
|
|
4
|
+
* Provides top-level access to alert items across all alerts.
|
|
5
|
+
* Exposed as `sdk.alerts.items.list()`, `sdk.alerts.items.count()`, etc.
|
|
6
|
+
*
|
|
7
|
+
* This is NOT a BaseResource subclass — it only supports list/count/iterate
|
|
8
|
+
* and delegates model instantiation to the parent AlertsResource via a callback.
|
|
9
|
+
*/
|
|
10
|
+
import type { AlertItemFilter, AlertItemSort, ListOptions, PaginatedResponse } from "@artu-ai/shared";
|
|
11
|
+
import type { TRPCClient } from "../utils/trpc-client";
|
|
12
|
+
import type { AlertItem, AlertItemData } from "../models";
|
|
13
|
+
/**
|
|
14
|
+
* Resource for querying alert items across all alerts.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // List all alert items with filtering
|
|
19
|
+
* const items = await sdk.alerts.items.list({
|
|
20
|
+
* filter: { alertId: { eq: "alert_123" } },
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Count all alert items
|
|
24
|
+
* const count = await sdk.alerts.items.count();
|
|
25
|
+
*
|
|
26
|
+
* // Iterate over all alert items
|
|
27
|
+
* for await (const item of sdk.alerts.items.iterate()) {
|
|
28
|
+
* console.log(item.id);
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class AlertItemsResource<TItem extends AlertItem = AlertItem, TItemFilter = AlertItemFilter> {
|
|
33
|
+
private readonly trpc;
|
|
34
|
+
private readonly instantiateItemFn;
|
|
35
|
+
private readonly transformFilterFn;
|
|
36
|
+
constructor(trpc: TRPCClient, instantiateItemFn: (data: AlertItemData) => TItem, transformFilterFn?: (filter?: TItemFilter) => AlertItemFilter | undefined);
|
|
37
|
+
/**
|
|
38
|
+
* Lists alert items across all alerts with optional filtering and pagination.
|
|
39
|
+
*/
|
|
40
|
+
list(options?: ListOptions<TItemFilter, AlertItemSort>): Promise<PaginatedResponse<TItem>>;
|
|
41
|
+
/**
|
|
42
|
+
* Counts alert items matching the given filter.
|
|
43
|
+
*/
|
|
44
|
+
count(filter?: TItemFilter): Promise<number>;
|
|
45
|
+
/**
|
|
46
|
+
* Returns an async iterator over all alert items matching the filter.
|
|
47
|
+
*/
|
|
48
|
+
iterate(options?: {
|
|
49
|
+
filter?: TItemFilter;
|
|
50
|
+
sort?: AlertItemSort;
|
|
51
|
+
pageSize?: number;
|
|
52
|
+
}): AsyncGenerator<TItem, void, undefined>;
|
|
53
|
+
private execute;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=alert-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-items.d.ts","sourceRoot":"","sources":["../../src/resources/alert-items.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAkB,CAC9B,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,WAAW,GAAG,eAAe;IAE7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiC;IACnE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAED;gBAGhC,IAAI,EAAE,UAAU,EAChB,iBAAiB,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,KAAK,EACjD,iBAAiB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,eAAe,GAAG,SAAS;IAQ1E;;OAEG;IACG,IAAI,CACT,OAAO,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,CAAC,GAC/C,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAgBpC;;OAEG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlD;;OAEG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE;QACjB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC;YAY5B,OAAO;CAUrB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert Items Resource
|
|
3
|
+
*
|
|
4
|
+
* Provides top-level access to alert items across all alerts.
|
|
5
|
+
* Exposed as `sdk.alerts.items.list()`, `sdk.alerts.items.count()`, etc.
|
|
6
|
+
*
|
|
7
|
+
* This is NOT a BaseResource subclass — it only supports list/count/iterate
|
|
8
|
+
* and delegates model instantiation to the parent AlertsResource via a callback.
|
|
9
|
+
*/
|
|
10
|
+
import { TRPCClientError } from "@trpc/client";
|
|
11
|
+
import { mapTRPCError } from "../errors";
|
|
12
|
+
import { createPaginatedIterator } from "../utils/pagination";
|
|
13
|
+
/**
|
|
14
|
+
* Resource for querying alert items across all alerts.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // List all alert items with filtering
|
|
19
|
+
* const items = await sdk.alerts.items.list({
|
|
20
|
+
* filter: { alertId: { eq: "alert_123" } },
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // Count all alert items
|
|
24
|
+
* const count = await sdk.alerts.items.count();
|
|
25
|
+
*
|
|
26
|
+
* // Iterate over all alert items
|
|
27
|
+
* for await (const item of sdk.alerts.items.iterate()) {
|
|
28
|
+
* console.log(item.id);
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class AlertItemsResource {
|
|
33
|
+
trpc;
|
|
34
|
+
instantiateItemFn;
|
|
35
|
+
transformFilterFn;
|
|
36
|
+
constructor(trpc, instantiateItemFn, transformFilterFn) {
|
|
37
|
+
this.trpc = trpc;
|
|
38
|
+
this.instantiateItemFn = instantiateItemFn;
|
|
39
|
+
this.transformFilterFn =
|
|
40
|
+
transformFilterFn ?? ((f) => f);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Lists alert items across all alerts with optional filtering and pagination.
|
|
44
|
+
*/
|
|
45
|
+
async list(options) {
|
|
46
|
+
const transformedFilter = this.transformFilterFn(options?.filter);
|
|
47
|
+
const response = await this.execute(() => this.trpc.alerts.items.list.query({
|
|
48
|
+
...options,
|
|
49
|
+
filter: transformedFilter,
|
|
50
|
+
sort: options?.sort,
|
|
51
|
+
}));
|
|
52
|
+
return {
|
|
53
|
+
data: response.data.map((i) => this.instantiateItemFn(i)),
|
|
54
|
+
pagination: response.pagination,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Counts alert items matching the given filter.
|
|
59
|
+
*/
|
|
60
|
+
async count(filter) {
|
|
61
|
+
const transformedFilter = this.transformFilterFn(filter);
|
|
62
|
+
const response = await this.execute(() => this.trpc.alerts.items.count.query({ filter: transformedFilter }));
|
|
63
|
+
return response.count;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns an async iterator over all alert items matching the filter.
|
|
67
|
+
*/
|
|
68
|
+
iterate(options) {
|
|
69
|
+
return createPaginatedIterator((pagination) => this.list({
|
|
70
|
+
filter: options?.filter,
|
|
71
|
+
sort: options?.sort,
|
|
72
|
+
...pagination,
|
|
73
|
+
}), { limit: options?.pageSize });
|
|
74
|
+
}
|
|
75
|
+
async execute(operation) {
|
|
76
|
+
try {
|
|
77
|
+
return await operation();
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (error instanceof TRPCClientError) {
|
|
81
|
+
throw mapTRPCError(error);
|
|
82
|
+
}
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { CreateAlertInput, UpdateAlertInput, UpsertAlertInput, UpdateReportStatusInput, CreateAlertItemInput, UpdateAlertItemInput, AlertFilter, AlertSort, AlertItemFilter, AlertItemSort, ValidationResult, GenerateResult, ListOptions, PaginatedResponse, AtomicBatchResult, PartialBatchResult, AlertDefaultsInput, UpsertResult, SplitOptions, ReportType } from "@artu-ai/shared";
|
|
13
13
|
import { BaseResource } from "./base";
|
|
14
|
+
import { AlertItemsResource } from "./alert-items";
|
|
14
15
|
import { Alert, AlertItem, type AlertData, type AlertItemData } from "../models";
|
|
15
16
|
export type { AlertFilter, AlertItemFilter, AlertItemSort };
|
|
16
17
|
/**
|
|
@@ -54,7 +55,19 @@ export interface AddItemsResult {
|
|
|
54
55
|
* }
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
export declare class AlertsResource<TSort = AlertSort, TDefaults = AlertDefaultsInput> extends BaseResource<Alert, CreateAlertInput, UpdateAlertInput, AlertFilter, TSort> {
|
|
58
|
+
export declare class AlertsResource<TSort = AlertSort, TDefaults = AlertDefaultsInput, TItem extends AlertItem = AlertItem, TItemFilter = AlertItemFilter> extends BaseResource<Alert, CreateAlertInput, UpdateAlertInput, AlertFilter, TSort> {
|
|
59
|
+
/**
|
|
60
|
+
* Top-level alert items sub-resource.
|
|
61
|
+
* Provides list/count/iterate across all alerts.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const items = await sdk.alerts.items.list();
|
|
66
|
+
* const count = await sdk.alerts.items.count({ alertId: { eq: "..." } });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
readonly items: AlertItemsResource<TItem, TItemFilter>;
|
|
70
|
+
constructor(config: import("./base").ResourceConfig);
|
|
58
71
|
/**
|
|
59
72
|
* Creates a new alert.
|
|
60
73
|
*
|
|
@@ -230,6 +243,12 @@ export declare class AlertsResource<TSort = AlertSort, TDefaults = AlertDefaults
|
|
|
230
243
|
}[], options: {
|
|
231
244
|
atomic: false;
|
|
232
245
|
}): Promise<PartialBatchResult<Alert>>;
|
|
246
|
+
/**
|
|
247
|
+
* Creates the AlertItemsResource sub-resource.
|
|
248
|
+
* Uses an arrow function callback so subclass overrides of
|
|
249
|
+
* `instantiateItem` are correctly dispatched at runtime.
|
|
250
|
+
*/
|
|
251
|
+
protected createItemsResource(): AlertItemsResource<TItem, TItemFilter>;
|
|
233
252
|
/**
|
|
234
253
|
* Instantiates a Alert model from API response data.
|
|
235
254
|
* Subclasses override this to return their specific model type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../src/resources/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACN,KAAK,EACL,SAAS,EACT,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,MAAM,WAAW,CAAC;AAOnB,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,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,GACxB,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAsCrC;;;;OAIG;IACH,SAAS,CAAC,mBAAmB,IAAI,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC;IAWvE;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK;IAI7C;;;OAGG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS;CAGzD"}
|
package/dist/resources/alerts.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { createAlertInputSchema, updateAlertInputSchema, upsertAlertInputSchema, updateReportStatusInputSchema, createAlertItemInputSchema, updateAlertItemInputSchema, validateReportInputSchema, generateReportInputSchema, } from "@artu-ai/shared";
|
|
14
14
|
import { BaseResource } from "./base";
|
|
15
|
+
import { AlertItemsResource } from "./alert-items";
|
|
15
16
|
import { Alert, AlertItem, } from "../models";
|
|
16
17
|
// ===========================
|
|
17
18
|
// AlertsResource
|
|
@@ -51,6 +52,21 @@ import { Alert, AlertItem, } from "../models";
|
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
54
|
export class AlertsResource extends BaseResource {
|
|
55
|
+
/**
|
|
56
|
+
* Top-level alert items sub-resource.
|
|
57
|
+
* Provides list/count/iterate across all alerts.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const items = await sdk.alerts.items.list();
|
|
62
|
+
* const count = await sdk.alerts.items.count({ alertId: { eq: "..." } });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
items;
|
|
66
|
+
constructor(config) {
|
|
67
|
+
super(config);
|
|
68
|
+
this.items = this.createItemsResource();
|
|
69
|
+
}
|
|
54
70
|
// ─────────────────────────────────────────────────────────────────
|
|
55
71
|
// Alert CRUD
|
|
56
72
|
// ─────────────────────────────────────────────────────────────────
|
|
@@ -357,6 +373,17 @@ export class AlertsResource extends BaseResource {
|
|
|
357
373
|
}
|
|
358
374
|
}
|
|
359
375
|
// ─────────────────────────────────────────────────────────────────
|
|
376
|
+
// Sub-resource Factory
|
|
377
|
+
// ─────────────────────────────────────────────────────────────────
|
|
378
|
+
/**
|
|
379
|
+
* Creates the AlertItemsResource sub-resource.
|
|
380
|
+
* Uses an arrow function callback so subclass overrides of
|
|
381
|
+
* `instantiateItem` are correctly dispatched at runtime.
|
|
382
|
+
*/
|
|
383
|
+
createItemsResource() {
|
|
384
|
+
return new AlertItemsResource(this.trpc, (data) => this.instantiateItem(data));
|
|
385
|
+
}
|
|
386
|
+
// ─────────────────────────────────────────────────────────────────
|
|
360
387
|
// Instantiation (protected for subclasses to override)
|
|
361
388
|
// ─────────────────────────────────────────────────────────────────
|
|
362
389
|
/**
|
|
@@ -14,6 +14,7 @@ export { BaseResource, ReadOnlyResource, type ResourceConfig } from "./base";
|
|
|
14
14
|
export { ClientsResource, type BatchOptions } from "./clients";
|
|
15
15
|
export { TransactionsResource } from "./transactions";
|
|
16
16
|
export type { RelatedClient, LinkedClient } from "@artu-ai/shared";
|
|
17
|
+
export { AlertItemsResource } from "./alert-items";
|
|
17
18
|
export { AlertsResource, type AlertFilter, type AlertItemFilter, type AddItemsResult, } from "./alerts";
|
|
18
19
|
export { AddressesResource } from "./addresses";
|
|
19
20
|
export { ContactMethodsResource } from "./contact-methods";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG7E,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,YAAY,EA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,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACN,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,GAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EACN,eAAe,EACf,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,GACtB,MAAM,WAAW,CAAC;AAGnB,cAAc,OAAO,CAAC"}
|
package/dist/resources/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { BaseResource, ReadOnlyResource } from "./base";
|
|
|
15
15
|
// Base resource implementations (unscoped)
|
|
16
16
|
export { ClientsResource } from "./clients";
|
|
17
17
|
export { TransactionsResource } from "./transactions";
|
|
18
|
+
export { AlertItemsResource } from "./alert-items";
|
|
18
19
|
export { AlertsResource, } from "./alerts";
|
|
19
20
|
// Supporting resources
|
|
20
21
|
export { AddressesResource } from "./addresses";
|
|
@@ -9,6 +9,7 @@ import type { CreateAlertInput, UpdateAlertInput, CreateAlertItemInput, UpdateAl
|
|
|
9
9
|
import { ReportType } from "@artu-ai/shared";
|
|
10
10
|
import type { AVIAlertFilter, AVIAlertSort, AVIAlertItemFilter, AlertSort, AlertItemFilter, AlertItemSort } from "@artu-ai/shared";
|
|
11
11
|
import { MexAlertsResource } from "../../alerts";
|
|
12
|
+
import { AlertItemsResource } from "../../../alert-items";
|
|
12
13
|
import { MexAVIAlert, MexAVIAlertItem, type AlertData, type AlertItemData } from "../../../../models";
|
|
13
14
|
/**
|
|
14
15
|
* AVI (Activos Virtuales) scoped alerts resource.
|
|
@@ -30,7 +31,7 @@ import { MexAVIAlert, MexAVIAlertItem, type AlertData, type AlertItemData } from
|
|
|
30
31
|
* console.log(alert.mesReportado);
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
|
-
export declare class AVIAlertsResource extends MexAlertsResource<AVIAlertSort, AviAlertDefaultsInput> {
|
|
34
|
+
export declare class AVIAlertsResource extends MexAlertsResource<AVIAlertSort, AviAlertDefaultsInput, MexAVIAlertItem, AVIAlertItemFilter> {
|
|
34
35
|
create(data: CreateAVIAlertInput): Promise<MexAVIAlert>;
|
|
35
36
|
retrieve(id: string): Promise<MexAVIAlert>;
|
|
36
37
|
retrieveByMetadata(key: string, value: string): Promise<MexAVIAlert>;
|
|
@@ -109,6 +110,151 @@ export declare class AVIAlertsResource extends MexAlertsResource<AVIAlertSort, A
|
|
|
109
110
|
added: number;
|
|
110
111
|
items: MexAVIAlertItem[];
|
|
111
112
|
}>;
|
|
113
|
+
protected createItemsResource(): AlertItemsResource<MexAVIAlertItem, {
|
|
114
|
+
clientId?: string | {
|
|
115
|
+
eq?: string | undefined;
|
|
116
|
+
in?: string[] | undefined;
|
|
117
|
+
nin?: string[] | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
createdAt?: string | {
|
|
120
|
+
eq?: string | undefined;
|
|
121
|
+
gt?: string | undefined;
|
|
122
|
+
gte?: string | undefined;
|
|
123
|
+
lt?: string | undefined;
|
|
124
|
+
lte?: string | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
updatedAt?: string | {
|
|
127
|
+
eq?: string | undefined;
|
|
128
|
+
gt?: string | undefined;
|
|
129
|
+
gte?: string | undefined;
|
|
130
|
+
lt?: string | undefined;
|
|
131
|
+
lte?: string | undefined;
|
|
132
|
+
} | undefined;
|
|
133
|
+
metadataFilters?: {
|
|
134
|
+
key: string;
|
|
135
|
+
value: string;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
alertId?: string | {
|
|
138
|
+
eq?: string | undefined;
|
|
139
|
+
in?: string[] | undefined;
|
|
140
|
+
nin?: string[] | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
transactionId?: string | {
|
|
143
|
+
eq?: string | undefined;
|
|
144
|
+
in?: string[] | undefined;
|
|
145
|
+
nin?: string[] | undefined;
|
|
146
|
+
} | undefined;
|
|
147
|
+
hasErrors?: boolean | undefined;
|
|
148
|
+
clientNames?: string | {
|
|
149
|
+
eq?: string | undefined;
|
|
150
|
+
contains?: string | undefined;
|
|
151
|
+
startsWith?: string | undefined;
|
|
152
|
+
endsWith?: string | undefined;
|
|
153
|
+
in?: string[] | undefined;
|
|
154
|
+
nin?: string[] | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
transactionAmount?: number | {
|
|
157
|
+
eq?: number | undefined;
|
|
158
|
+
gt?: number | undefined;
|
|
159
|
+
gte?: number | undefined;
|
|
160
|
+
lt?: number | undefined;
|
|
161
|
+
lte?: number | undefined;
|
|
162
|
+
in?: number[] | undefined;
|
|
163
|
+
nin?: number[] | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
transactionCurrency?: string | {
|
|
166
|
+
eq?: string | undefined;
|
|
167
|
+
in?: string[] | undefined;
|
|
168
|
+
nin?: string[] | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
transactionDate?: string | {
|
|
171
|
+
eq?: string | undefined;
|
|
172
|
+
gt?: string | undefined;
|
|
173
|
+
gte?: string | undefined;
|
|
174
|
+
lt?: string | undefined;
|
|
175
|
+
lte?: string | undefined;
|
|
176
|
+
} | undefined;
|
|
177
|
+
actividadVulnerable?: {
|
|
178
|
+
AVI?: {
|
|
179
|
+
alertType?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta | {
|
|
180
|
+
eq?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta | undefined;
|
|
181
|
+
in?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta[] | undefined;
|
|
182
|
+
nin?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta[] | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
alertDescription?: string | {
|
|
185
|
+
eq?: string | undefined;
|
|
186
|
+
contains?: string | undefined;
|
|
187
|
+
startsWith?: string | undefined;
|
|
188
|
+
endsWith?: string | undefined;
|
|
189
|
+
in?: string[] | undefined;
|
|
190
|
+
nin?: string[] | undefined;
|
|
191
|
+
} | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
JYS?: {
|
|
194
|
+
alertType?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/jys/index").TipoAlerta | {
|
|
195
|
+
eq?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/jys/index").TipoAlerta | undefined;
|
|
196
|
+
in?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/jys/index").TipoAlerta[] | undefined;
|
|
197
|
+
nin?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/jys/index").TipoAlerta[] | undefined;
|
|
198
|
+
} | undefined;
|
|
199
|
+
alertDescription?: string | {
|
|
200
|
+
eq?: string | undefined;
|
|
201
|
+
contains?: string | undefined;
|
|
202
|
+
startsWith?: string | undefined;
|
|
203
|
+
endsWith?: string | undefined;
|
|
204
|
+
in?: string[] | undefined;
|
|
205
|
+
nin?: string[] | undefined;
|
|
206
|
+
} | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
MJR?: {
|
|
209
|
+
alertType?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/mjr/index").TipoAlerta | {
|
|
210
|
+
eq?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/mjr/index").TipoAlerta | undefined;
|
|
211
|
+
in?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/mjr/index").TipoAlerta[] | undefined;
|
|
212
|
+
nin?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/mjr/index").TipoAlerta[] | undefined;
|
|
213
|
+
} | undefined;
|
|
214
|
+
alertDescription?: string | {
|
|
215
|
+
eq?: string | undefined;
|
|
216
|
+
contains?: string | undefined;
|
|
217
|
+
startsWith?: string | undefined;
|
|
218
|
+
endsWith?: string | undefined;
|
|
219
|
+
in?: string[] | undefined;
|
|
220
|
+
nin?: string[] | undefined;
|
|
221
|
+
} | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
TSC?: {
|
|
224
|
+
alertType?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/tsc/index").TipoAlerta | {
|
|
225
|
+
eq?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/tsc/index").TipoAlerta | undefined;
|
|
226
|
+
in?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/tsc/index").TipoAlerta[] | undefined;
|
|
227
|
+
nin?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/tsc/index").TipoAlerta[] | undefined;
|
|
228
|
+
} | undefined;
|
|
229
|
+
alertDescription?: string | {
|
|
230
|
+
eq?: string | undefined;
|
|
231
|
+
contains?: string | undefined;
|
|
232
|
+
startsWith?: string | undefined;
|
|
233
|
+
endsWith?: string | undefined;
|
|
234
|
+
in?: string[] | undefined;
|
|
235
|
+
nin?: string[] | undefined;
|
|
236
|
+
} | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
} | undefined;
|
|
239
|
+
cnbv?: {
|
|
240
|
+
TRANSMISOR?: {
|
|
241
|
+
isPrimary?: boolean | undefined;
|
|
242
|
+
} | undefined;
|
|
243
|
+
} | undefined;
|
|
244
|
+
alertType?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta | {
|
|
245
|
+
eq?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta | undefined;
|
|
246
|
+
in?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta[] | undefined;
|
|
247
|
+
nin?: import("@artu-ai/shared/schemas/mex/actividad-vulnerable/avi/index").TipoAlerta[] | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
alertDescription?: string | {
|
|
250
|
+
eq?: string | undefined;
|
|
251
|
+
contains?: string | undefined;
|
|
252
|
+
startsWith?: string | undefined;
|
|
253
|
+
endsWith?: string | undefined;
|
|
254
|
+
in?: string[] | undefined;
|
|
255
|
+
nin?: string[] | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
}>;
|
|
112
258
|
/**
|
|
113
259
|
* Validates an AVI alert.
|
|
114
260
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/avi/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACX,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,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEN,UAAU,EASV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,aAAa,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../../../src/resources/mex/actividad-vulnerable/avi/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACX,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,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEN,UAAU,EASV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,cAAc,EACd,YAAY,EACZ,kBAA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ACjB,SAAS,GAAG,SAAS;cAOL,iBAAiB,CACnC,IAAI,EAAE,mBAAmB,GACvB,gBAAgB;IAenB;;;;;;OAMG;cACgB,uBAAuB,CACzC,IAAI,EAAE,mBAAmB,GACvB,gBAAgB;cAcA,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW;cAIzC,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe;IAIxE,SAAS,CAAC,qBAAqB,CAC9B,IAAI,EAAE,uBAAuB,GAC3B,oBAAoB;IAqBvB,SAAS,CAAC,2BAA2B,CACpC,IAAI,EAAE,uBAAuB,GAC3B,oBAAoB;IAyBvB;;OAEG;IACH,SAAS,CAAC,4BAA4B,CACrC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,qBAAqB,GAC9B;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;CA6BlE"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { CodigoActividad, ReportType, createAVIAlertInputSchema, updateAVIAlertInputSchema, upsertAVIAlertInputSchema, createAVIAlertItemInputSchema, updateAVIAlertItemInputSchema, aviDefaultsInputSchema, transformSort, aviAlertFieldMapping, } from "@artu-ai/shared";
|
|
10
10
|
import { MexAlertsResource } from "../../alerts";
|
|
11
|
+
import { AlertItemsResource } from "../../../alert-items";
|
|
11
12
|
import { MexAVIAlert, MexAVIAlertItem, } from "../../../../models";
|
|
12
13
|
// ===========================
|
|
13
14
|
// AVIAlertsResource
|
|
@@ -280,6 +281,12 @@ export class AVIAlertsResource extends MexAlertsResource {
|
|
|
280
281
|
};
|
|
281
282
|
}
|
|
282
283
|
// ─────────────────────────────────────────────────────────────────
|
|
284
|
+
// Sub-resource Factory
|
|
285
|
+
// ─────────────────────────────────────────────────────────────────
|
|
286
|
+
createItemsResource() {
|
|
287
|
+
return new AlertItemsResource(this.trpc, (data) => this.instantiateItem(data), (filter) => this.applyScopeToItemFilter(filter));
|
|
288
|
+
}
|
|
289
|
+
// ─────────────────────────────────────────────────────────────────
|
|
283
290
|
// Validation
|
|
284
291
|
// ─────────────────────────────────────────────────────────────────
|
|
285
292
|
/**
|