@dossier-wiki/os-sdk 0.7.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +401 -14
- package/dist/alert-workflow-types.d.ts +113 -0
- package/dist/alert-workflow-types.d.ts.map +1 -0
- package/dist/alert-workflow-types.js +2 -0
- package/dist/alert-workflow-types.js.map +1 -0
- package/dist/service.d.ts +588 -15
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +862 -18
- package/dist/service.js.map +1 -1
- package/dist/types.d.ts +2438 -99
- package/dist/types.d.ts.map +1 -1
- package/docs/REFERENCE.md +429 -5
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -17,14 +17,71 @@ export interface TagValueInput {
|
|
|
17
17
|
label: string;
|
|
18
18
|
value?: string;
|
|
19
19
|
}
|
|
20
|
-
/** The
|
|
21
|
-
export type TagFieldKey = 'customer.tags' | 'customer.riskTags' | 'counterparty.tags' | 'counterparty.riskTags' | 'alert.dispositionTags' | 'address.tags' | 'rule.tags' | 'identificationDocument.tags';
|
|
22
|
-
|
|
20
|
+
/** The catalogue-governed tag field-keys. */
|
|
21
|
+
export type TagFieldKey = 'customer.tags' | 'customer.riskTags' | 'counterparty.tags' | 'counterparty.riskTags' | 'alert.dispositionTags' | 'product.tags' | 'address.tags' | 'rule.tags' | 'identificationDocument.tags' | 'customScreeningList.tags' | 'team.tags' | 'channelEndpoint.tags' | 'channelEndpoint.riskTags' | 'institution.riskTags';
|
|
22
|
+
/** How many tags from one group a single record may carry. */
|
|
23
|
+
export type TagGroupCardinality = 'SINGLE' | 'MULTI';
|
|
24
|
+
/**
|
|
25
|
+
* A tag group — the facet ("Occupation", "Primary Branch") that owns a slice of
|
|
26
|
+
* one field-key's vocabulary. Its `value` is the namespace its member tags
|
|
27
|
+
* carry: `primary-branch:kandy`.
|
|
28
|
+
*/
|
|
29
|
+
export interface TagGroup {
|
|
30
|
+
id: string;
|
|
31
|
+
fieldKey: TagFieldKey;
|
|
32
|
+
/** Namespace slug. Never contains ':'. */
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
description?: string | null;
|
|
36
|
+
color?: string | null;
|
|
37
|
+
cardinality: TagGroupCardinality;
|
|
38
|
+
sortOrder: number;
|
|
39
|
+
archivedAt?: string | null;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}
|
|
43
|
+
export interface TagGroupInput {
|
|
44
|
+
fieldKey: TagFieldKey;
|
|
45
|
+
label: string;
|
|
46
|
+
/** Namespace slug. Derived from label when omitted. May not contain ':'. */
|
|
47
|
+
value?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
color?: string;
|
|
50
|
+
cardinality?: TagGroupCardinality;
|
|
51
|
+
sortOrder?: number;
|
|
52
|
+
}
|
|
53
|
+
/** `fieldKey`/`value` are absent by design — see `regroup` for why. */
|
|
54
|
+
export interface UpdateTagGroupInput {
|
|
55
|
+
label?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
color?: string;
|
|
58
|
+
/** Tightening to SINGLE is rejected while records hold more than one member tag. */
|
|
59
|
+
cardinality?: TagGroupCardinality;
|
|
60
|
+
sortOrder?: number;
|
|
61
|
+
}
|
|
62
|
+
/** What a regroup did, or (dryRun) exactly what it would do. */
|
|
63
|
+
export interface RegroupReport {
|
|
64
|
+
dryRun: boolean;
|
|
65
|
+
entriesMoved: number;
|
|
66
|
+
assignmentsRewritten: number;
|
|
67
|
+
rulesRewritten: number;
|
|
68
|
+
assignmentPoliciesRewritten: number;
|
|
69
|
+
moves: {
|
|
70
|
+
label: string;
|
|
71
|
+
from: string;
|
|
72
|
+
to: string;
|
|
73
|
+
}[];
|
|
74
|
+
}
|
|
23
75
|
export interface TagCatalogueEntry {
|
|
24
76
|
id: string;
|
|
25
77
|
fieldKey: TagFieldKey;
|
|
78
|
+
/** Namespaced (`primary-branch:kandy`) when the entry belongs to a group. */
|
|
26
79
|
value: string;
|
|
27
80
|
label: string;
|
|
81
|
+
/** Owning group id, or null when ungrouped. */
|
|
82
|
+
groupId?: string | null;
|
|
83
|
+
/** Namespace prefix of `value` — the owning group's slug, or null. */
|
|
84
|
+
groupValue?: string | null;
|
|
28
85
|
color?: string | null;
|
|
29
86
|
description?: string | null;
|
|
30
87
|
archivedAt?: string | null;
|
|
@@ -34,7 +91,10 @@ export interface TagCatalogueEntry {
|
|
|
34
91
|
export interface TagCatalogueEntryInput {
|
|
35
92
|
fieldKey: TagFieldKey;
|
|
36
93
|
label: string;
|
|
94
|
+
/** Unqualified slug. May not contain ':' — join a group via `groupId`. */
|
|
37
95
|
value?: string;
|
|
96
|
+
/** Owning group. The server composes the namespaced stored value. */
|
|
97
|
+
groupId?: string;
|
|
38
98
|
color?: string;
|
|
39
99
|
description?: string;
|
|
40
100
|
}
|
|
@@ -43,20 +103,16 @@ export interface UpdateTagCatalogueEntryInput {
|
|
|
43
103
|
color?: string;
|
|
44
104
|
description?: string;
|
|
45
105
|
}
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export interface SetTagEnforcementInput {
|
|
51
|
-
fieldKey: TagFieldKey;
|
|
52
|
-
enforcement: TagCatalogueEnforcement;
|
|
53
|
-
}
|
|
54
|
-
export type TypedFieldType = 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'SET' | 'CURRENCY' | 'MONETARY';
|
|
55
|
-
/** Schema declaration carried on a parent resource (e.g. `Product.typedAccountFieldConfig`). */
|
|
106
|
+
export type TypedFieldType = 'TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'LIST' | 'SINGLE_SELECT' | 'MULTI_SELECT'
|
|
107
|
+
/** @deprecated Use LIST, SINGLE_SELECT, or MULTI_SELECT. */
|
|
108
|
+
| 'SET' | 'CURRENCY' | 'MONETARY';
|
|
109
|
+
/** Schema declaration carried on a parent resource (e.g. `Product.accountFieldConfig`). */
|
|
56
110
|
export interface TypedFieldDefinition {
|
|
57
111
|
key: string;
|
|
58
112
|
displayName: string;
|
|
59
113
|
type: TypedFieldType;
|
|
114
|
+
/** Required closed vocabulary for SINGLE_SELECT and MULTI_SELECT. */
|
|
115
|
+
options?: string[] | null;
|
|
60
116
|
required: boolean;
|
|
61
117
|
/** Default applied at write time when the caller omits the key. Raw value, validated against `type`. */
|
|
62
118
|
defaultValue?: unknown;
|
|
@@ -68,7 +124,8 @@ export interface TypedFieldDefinition {
|
|
|
68
124
|
* - TEXT / DATE / CURRENCY → string
|
|
69
125
|
* - NUMBER → finite JS number
|
|
70
126
|
* - BOOLEAN → boolean
|
|
71
|
-
* - SET → string[]
|
|
127
|
+
* - LIST / MULTI_SELECT / legacy SET → string[]
|
|
128
|
+
* - SINGLE_SELECT → one string from the definition's options
|
|
72
129
|
* - MONETARY → denominated literal `"<amount>@<TYPE:CODE>"`, e.g. `"50000.00@FIAT:USD"`
|
|
73
130
|
*/
|
|
74
131
|
export interface TypedFieldValueInput {
|
|
@@ -102,6 +159,20 @@ export type TypedFieldStored = {
|
|
|
102
159
|
type: 'date';
|
|
103
160
|
value: string;
|
|
104
161
|
} | {
|
|
162
|
+
key: string;
|
|
163
|
+
type: 'list';
|
|
164
|
+
value: string[];
|
|
165
|
+
} | {
|
|
166
|
+
key: string;
|
|
167
|
+
type: 'single_select';
|
|
168
|
+
value: string;
|
|
169
|
+
} | {
|
|
170
|
+
key: string;
|
|
171
|
+
type: 'multi_select';
|
|
172
|
+
value: string[];
|
|
173
|
+
}
|
|
174
|
+
/** @deprecated Legacy open list. */
|
|
175
|
+
| {
|
|
105
176
|
key: string;
|
|
106
177
|
type: 'set';
|
|
107
178
|
value: string[];
|
|
@@ -127,8 +198,9 @@ export interface AccountResponseDto {
|
|
|
127
198
|
productId?: string;
|
|
128
199
|
label: string;
|
|
129
200
|
accountCategory: 'DEPOSIT' | 'CREDIT' | 'LOAN' | 'WALLET' | 'SECURITIES' | 'OTHER';
|
|
201
|
+
/** @deprecated Retained for API compatibility. Prefer product tags for classification. */
|
|
130
202
|
accountType: 'CHECKING' | 'SAVINGS' | 'OPERATING' | 'TRUST' | 'INVESTMENT' | 'ESCROW' | 'CREDIT_CARD' | 'LINE_OF_CREDIT' | 'PERSONAL_LOAN' | 'MORTGAGE' | 'AUTO_LOAN' | 'BUSINESS_LOAN' | 'CRYPTO_WALLET' | 'MOBILE_WALLET' | 'PREPAID_CARD' | 'E_WALLET' | 'BROKERAGE' | 'FUND' | 'OTHER';
|
|
131
|
-
status: 'ACTIVE' | 'FROZEN' | 'CLOSED' | 'DORMANT';
|
|
203
|
+
status: 'PENDING' | 'ACTIVE' | 'FROZEN' | 'CLOSED' | 'DORMANT';
|
|
132
204
|
currency?: string;
|
|
133
205
|
/** Typed Field bag (Tier A). Validated against `Product.typedAccountFieldConfig`. */
|
|
134
206
|
fields?: TypedFieldStored[];
|
|
@@ -156,8 +228,32 @@ export type AddressCategory = 'HOME' | 'MAILING' | 'BILLING' | 'WORK' | 'REGISTE
|
|
|
156
228
|
export type Iso20022AddressType = 'BIZZ' | 'DLVY' | 'HOME' | 'MLTO' | 'PBOX' | 'ADDR';
|
|
157
229
|
export type AddressVerificationStatus = 'PENDING' | 'VERIFIED' | 'REJECTED' | 'EXPIRED';
|
|
158
230
|
export type Lifecycle = 'LIVE' | 'ARCHIVED' | 'TOMBSTONED';
|
|
231
|
+
/**
|
|
232
|
+
* A geographic point — the platform's one coordinate shape.
|
|
233
|
+
*
|
|
234
|
+
* A latitude without its longitude is not half a location. Everywhere the API
|
|
235
|
+
* carries a point it carries this: one value, one field.
|
|
236
|
+
*/
|
|
237
|
+
export interface CoordinatesDto {
|
|
238
|
+
latitude: number;
|
|
239
|
+
longitude: number;
|
|
240
|
+
/** @deprecated The original spelling. Same number as `latitude`. */
|
|
241
|
+
lat?: number;
|
|
242
|
+
/** @deprecated The original spelling. Same number as `longitude`. */
|
|
243
|
+
lng?: number;
|
|
244
|
+
}
|
|
159
245
|
export interface AddressCoordinatesDto {
|
|
246
|
+
/**
|
|
247
|
+
* The point.
|
|
248
|
+
*
|
|
249
|
+
* On a write this is the only accepted shape — a caller cannot send half a
|
|
250
|
+
* coordinate. On a read, `lat`/`lng` are still returned alongside it for
|
|
251
|
+
* consumers written against the original spelling.
|
|
252
|
+
*/
|
|
253
|
+
point?: CoordinatesDto;
|
|
254
|
+
/** @deprecated Read-only. Use `point.latitude`. */
|
|
160
255
|
lat?: number;
|
|
256
|
+
/** @deprecated Read-only. Use `point.longitude`. */
|
|
161
257
|
lng?: number;
|
|
162
258
|
/** Provenance, e.g. 'manual', 'google.geocode'. */
|
|
163
259
|
source?: string;
|
|
@@ -167,8 +263,7 @@ export interface AddressCoordinatesDto {
|
|
|
167
263
|
/**
|
|
168
264
|
* Operational postal address. Lives in the polymorphic `addresses` table on the
|
|
169
265
|
* server (owner = CUSTOMER / COUNTERPARTY / INSTITUTION). Exposed on the Customer
|
|
170
|
-
* subtypes as `Individual.addresses` and `Entity.
|
|
171
|
-
* semantic field name.
|
|
266
|
+
* subtypes as `Individual.addresses` and `Entity.addresses` — same shape.
|
|
172
267
|
*
|
|
173
268
|
* Categories (semantic) and `iso20022Type` (wire-protocol) are parallel
|
|
174
269
|
* discriminators; customer rows use `category`, counterparty/institution rows
|
|
@@ -318,10 +413,30 @@ export interface CashDetailsDto {
|
|
|
318
413
|
export interface ChannelDto {
|
|
319
414
|
/** Channel type (WEB, MOBILE_APP, BRANCH, ATM, POS, API). */
|
|
320
415
|
type: string;
|
|
416
|
+
/** Stable identifier for the concrete endpoint, such as a POS terminal, ATM, API client, or web page. */
|
|
417
|
+
identifier?: string;
|
|
418
|
+
/** Integration/provider namespace. Identical identifiers from different providers resolve independently. */
|
|
419
|
+
provider?: string;
|
|
420
|
+
/** Human-readable endpoint name used when it is first observed. */
|
|
421
|
+
displayName?: string;
|
|
321
422
|
/** Session identifier. */
|
|
322
423
|
sessionId?: string;
|
|
323
424
|
/** Embedded session events (auth, copy-paste, form-fill, etc.). */
|
|
324
425
|
events?: ChannelEventDto[];
|
|
426
|
+
/** Physical endpoint location, distinct from the device location. */
|
|
427
|
+
physicalLocation?: LocationObservationDto;
|
|
428
|
+
/** Bounded integration-defined values. Credential-like keys are rejected by the API. */
|
|
429
|
+
context?: Record<string, string | number | boolean | null>;
|
|
430
|
+
}
|
|
431
|
+
export interface LocationObservationDto {
|
|
432
|
+
latitude: number;
|
|
433
|
+
longitude: number;
|
|
434
|
+
accuracyMeters?: number;
|
|
435
|
+
confidence?: number;
|
|
436
|
+
source?: string;
|
|
437
|
+
method?: string;
|
|
438
|
+
isEstimated?: boolean;
|
|
439
|
+
observedAt?: string;
|
|
325
440
|
}
|
|
326
441
|
export interface ChannelEventDto {
|
|
327
442
|
/** Event type (e.g. session.auth, session.copy_paste). */
|
|
@@ -446,8 +561,9 @@ export interface CreateAccountDto {
|
|
|
446
561
|
externalId?: string;
|
|
447
562
|
/**
|
|
448
563
|
* Product this account is instantiated from. Determines `accountCategory`
|
|
449
|
-
*
|
|
450
|
-
*
|
|
564
|
+
* and the required typed-field schema. The deprecated `accountType`
|
|
565
|
+
* compatibility field is still derived from the product and is not
|
|
566
|
+
* accepted from the caller.
|
|
451
567
|
*/
|
|
452
568
|
productId?: string;
|
|
453
569
|
label: string;
|
|
@@ -469,14 +585,12 @@ export interface CreateApiKeyDto {
|
|
|
469
585
|
scope: 'full_access' | 'evaluate_only';
|
|
470
586
|
/** Expiration in seconds (default: 1 year) */
|
|
471
587
|
expiresInSeconds?: number;
|
|
472
|
-
/** Organization ID to scope this key to (defaults to active org) */
|
|
473
|
-
organizationId?: string;
|
|
474
588
|
}
|
|
475
589
|
export interface CreateConstantDto {
|
|
476
590
|
/** Constant name (e.g. $global.highRiskCountries). */
|
|
477
591
|
name: string;
|
|
478
592
|
/** Scope (derived from name if omitted). */
|
|
479
|
-
scope?: 'global' | 'product' | 'customer' | 'account' | 'counterparty' | '
|
|
593
|
+
scope?: 'global' | 'product' | 'customer' | 'account' | 'counterparty' | 'paymentInstrument' | 'device';
|
|
480
594
|
/** Constant type. Determines the required shape of `value`. */
|
|
481
595
|
type: 'scalar' | 'monetary' | 'set' | 'range' | 'text' | 'number' | 'boolean' | 'date' | 'currency' | 'regex';
|
|
482
596
|
/** Payload shape depends on the constant's `type`. Pick the matching variant below. Validated at write time. */
|
|
@@ -495,6 +609,65 @@ export interface CreateConstantDto {
|
|
|
495
609
|
description?: string;
|
|
496
610
|
/** Sync key for config-as-code management. */
|
|
497
611
|
syncKey?: string;
|
|
612
|
+
/** Product id for a product-bound `$account.*` definition. */
|
|
613
|
+
productId?: string;
|
|
614
|
+
}
|
|
615
|
+
export type StateScope = 'customer' | 'account' | 'counterparty' | 'product' | 'paymentInstrument' | 'device';
|
|
616
|
+
export type StateResourceType = 'CUSTOMER' | 'ACCOUNT' | 'COUNTERPARTY' | 'PRODUCT' | 'PAYMENT_INSTRUMENT' | 'DEVICE';
|
|
617
|
+
export type StateType = 'text' | 'number' | 'boolean' | 'date' | 'currency' | 'monetary' | 'set';
|
|
618
|
+
export type StateOperation = 'SET' | 'INCREMENT' | 'DECREMENT';
|
|
619
|
+
export interface CreateStateDefinitionInput {
|
|
620
|
+
name: string;
|
|
621
|
+
scope: StateScope;
|
|
622
|
+
type: StateType;
|
|
623
|
+
initialValue?: unknown;
|
|
624
|
+
description?: string;
|
|
625
|
+
/** Only valid for account-scoped definitions. */
|
|
626
|
+
productId?: string;
|
|
627
|
+
}
|
|
628
|
+
export interface StateDefinitionDto extends Omit<CreateStateDefinitionInput, 'productId'> {
|
|
629
|
+
id: string;
|
|
630
|
+
productId: string | null;
|
|
631
|
+
createdAt: string;
|
|
632
|
+
updatedAt: string;
|
|
633
|
+
}
|
|
634
|
+
export interface ChangeResourceStateInput {
|
|
635
|
+
resourceType: StateResourceType;
|
|
636
|
+
resourceId: string;
|
|
637
|
+
name: string;
|
|
638
|
+
operation: StateOperation;
|
|
639
|
+
/** Replacement value for SET; magnitude for INCREMENT or DECREMENT. */
|
|
640
|
+
value: unknown;
|
|
641
|
+
reason?: string;
|
|
642
|
+
}
|
|
643
|
+
export interface ResourceStateDto {
|
|
644
|
+
id: string;
|
|
645
|
+
resourceType: StateResourceType;
|
|
646
|
+
resourceId: string;
|
|
647
|
+
name: string;
|
|
648
|
+
type: StateType;
|
|
649
|
+
value: unknown;
|
|
650
|
+
updatedByActorType: string;
|
|
651
|
+
updatedByActorId: string;
|
|
652
|
+
reason: string | null;
|
|
653
|
+
createdAt: string;
|
|
654
|
+
updatedAt: string;
|
|
655
|
+
}
|
|
656
|
+
export interface ResourceStateHistoryDto {
|
|
657
|
+
id: string;
|
|
658
|
+
resourceStateId: string;
|
|
659
|
+
resourceType: StateResourceType;
|
|
660
|
+
resourceId: string;
|
|
661
|
+
name: string;
|
|
662
|
+
type: StateType;
|
|
663
|
+
operation: StateOperation;
|
|
664
|
+
operand: unknown | null;
|
|
665
|
+
previousValue: unknown | null;
|
|
666
|
+
newValue: unknown;
|
|
667
|
+
actorType: string;
|
|
668
|
+
actorId: string;
|
|
669
|
+
reason: string | null;
|
|
670
|
+
changedAt: string;
|
|
498
671
|
}
|
|
499
672
|
export interface CreateCounterpartyDto {
|
|
500
673
|
externalId?: string;
|
|
@@ -504,33 +677,152 @@ export interface CreateCounterpartyDto {
|
|
|
504
677
|
classification: 'BANK_ACCOUNT' | 'WALLET' | 'MERCHANT' | 'FINANCIAL_INSTITUTION' | 'PAYMENT_NETWORK' | 'UNKNOWN';
|
|
505
678
|
/** ISO 3166-1 alpha-3 country code */
|
|
506
679
|
country?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Catalogue-governed tags (e.g. operating branch), stamped at creation so
|
|
682
|
+
* the INITIAL screening run — and any assignment-policy tag routing —
|
|
683
|
+
* sees them. Values not in the catalogue are rejected.
|
|
684
|
+
*/
|
|
685
|
+
tags?: TagValueInput[];
|
|
507
686
|
bankAccount?: BankAccountDetailsDto;
|
|
508
687
|
wallet?: CryptoWalletDetailsDto;
|
|
509
688
|
merchant?: MerchantDetailsDto;
|
|
510
689
|
institution?: InstitutionDetailsDto;
|
|
511
690
|
}
|
|
512
|
-
/**
|
|
513
|
-
export type
|
|
514
|
-
|
|
691
|
+
/** Currency classification. Mirrors the backend `CurrencyType` enum. */
|
|
692
|
+
export type CurrencyType = 'FIAT' | 'CRYPTO' | 'OTHER';
|
|
693
|
+
/** Product/account category. Mirrors the backend `AccountCategory` enum. */
|
|
694
|
+
export type AccountCategory = 'DEPOSIT' | 'CREDIT' | 'LOAN' | 'WALLET' | 'SECURITIES' | 'OTHER';
|
|
695
|
+
/** Base account type. Mirrors the backend `AccountType` enum. */
|
|
696
|
+
export type AccountType = 'CHECKING' | 'SAVINGS' | 'OPERATING' | 'TRUST' | 'INVESTMENT' | 'ESCROW' | 'CREDIT_CARD' | 'LINE_OF_CREDIT' | 'PERSONAL_LOAN' | 'MORTGAGE' | 'AUTO_LOAN' | 'BUSINESS_LOAN' | 'CRYPTO_WALLET' | 'MOBILE_WALLET' | 'PREPAID_CARD' | 'E_WALLET' | 'BROKERAGE' | 'FUND' | 'OTHER';
|
|
697
|
+
/** Product lifecycle status. Mirrors the backend `ProductStatus` enum. */
|
|
698
|
+
export type ProductStatus = 'ACTIVE' | 'DISCONTINUED';
|
|
699
|
+
export interface CreateCurrencyInput {
|
|
700
|
+
type: CurrencyType;
|
|
701
|
+
code: string;
|
|
702
|
+
/** Number of minor-unit decimal places (0–18). */
|
|
703
|
+
precision: number;
|
|
704
|
+
name: string;
|
|
705
|
+
symbol?: string;
|
|
706
|
+
}
|
|
707
|
+
export interface ContactEntryInput {
|
|
708
|
+
value: string;
|
|
709
|
+
primary: boolean;
|
|
710
|
+
}
|
|
711
|
+
/** Identification document embedded in an individual-create request. */
|
|
712
|
+
export interface InlineIdentificationDocumentInput {
|
|
713
|
+
id?: string;
|
|
714
|
+
type: string;
|
|
715
|
+
number: string;
|
|
716
|
+
/** ISO 3166-1 alpha-3 country code. */
|
|
717
|
+
country: string;
|
|
718
|
+
/** @deprecated Alias for `country`, honoured only when `country` is absent. */
|
|
719
|
+
issuingCountry?: string;
|
|
720
|
+
expiryDate?: string;
|
|
721
|
+
dateOfIssue?: string;
|
|
722
|
+
fullNameEn?: string;
|
|
723
|
+
transliterationNames?: string[];
|
|
724
|
+
addresses?: RichAddressInputDto[];
|
|
725
|
+
dateOfBirth?: string;
|
|
726
|
+
sex?: string;
|
|
727
|
+
other?: Record<string, unknown>;
|
|
728
|
+
notes?: string;
|
|
729
|
+
attachments?: IdDocFileAttachmentInput[];
|
|
730
|
+
/** @deprecated Use `attachments` instead. */
|
|
731
|
+
fileIds?: string[];
|
|
732
|
+
}
|
|
733
|
+
/** Canonical REST/GraphQL entity-create request. */
|
|
734
|
+
export interface CreateEntityInput {
|
|
515
735
|
/** Your external identifier for this entity. Must be unique within the organization. */
|
|
516
736
|
externalId: string;
|
|
517
737
|
legalName: string;
|
|
738
|
+
status?: CustomerStatus;
|
|
518
739
|
tradingNames?: string[];
|
|
519
740
|
registrationNumber?: string;
|
|
741
|
+
/** Tax Identification Number (TIN). */
|
|
742
|
+
taxId?: string;
|
|
520
743
|
/** ISO 3166-1 alpha-3 country code */
|
|
521
744
|
countryOfIncorporation?: string;
|
|
522
745
|
dateOfIncorporation?: string;
|
|
523
746
|
entityType?: string;
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
email?: string;
|
|
527
|
-
phone?: string;
|
|
747
|
+
websites?: string[];
|
|
748
|
+
stakeholders?: StakeholderInput[];
|
|
528
749
|
/** Inline fan-out into the polymorphic `addresses` table. Same shape as
|
|
529
|
-
* Individual.addresses;
|
|
530
|
-
* GraphQL field for entities. */
|
|
750
|
+
* Individual.addresses; named `locations` on entities. */
|
|
531
751
|
locations?: AddressInputDto[];
|
|
532
|
-
/**
|
|
752
|
+
/**
|
|
753
|
+
* Catalogue-governed tags (e.g. operating branch), stamped at creation so
|
|
754
|
+
* the INITIAL screening run — and any assignment-policy tag routing —
|
|
755
|
+
* sees them. Values not in the catalogue are rejected.
|
|
756
|
+
*/
|
|
757
|
+
tags?: TagValueInput[];
|
|
758
|
+
/**
|
|
759
|
+
* Standing assignment (user ids), stamped at creation so INITIAL screening
|
|
760
|
+
* and CUSTOMER_ASSIGNEE routing see it. Post-create edits via
|
|
761
|
+
* `customers.assignment.assign`.
|
|
762
|
+
*/
|
|
763
|
+
assignedToUserIds?: string[];
|
|
764
|
+
/**
|
|
765
|
+
* Standing assignment (team ids), stamped at creation so INITIAL screening
|
|
766
|
+
* and CUSTOMER_ASSIGNEE routing see it. Post-create edits via
|
|
767
|
+
* `customers.assignment.assign`.
|
|
768
|
+
*/
|
|
769
|
+
assignedToTeamIds?: string[];
|
|
770
|
+
/** @deprecated Use `emails`. Honoured only when `emails` is absent. */
|
|
771
|
+
email?: string;
|
|
772
|
+
/** @deprecated Use `phones`. Honoured only when `phones` is absent. */
|
|
773
|
+
phone?: string;
|
|
774
|
+
/** Override the creation timestamp (ISO 8601). For data-loading tools backfilling historical records. */
|
|
533
775
|
createdAt?: string;
|
|
776
|
+
/** @deprecated Alias for `locations`, honoured only when `locations` is absent. */
|
|
777
|
+
addresses?: AddressInputDto[];
|
|
778
|
+
/** Parent entity for subsidiaries. */
|
|
779
|
+
parentEntityId?: string;
|
|
780
|
+
}
|
|
781
|
+
/** @deprecated Use `CreateEntityInput`. */
|
|
782
|
+
export type CreateEntityDto = CreateEntityInput;
|
|
783
|
+
/**
|
|
784
|
+
* A Risk Signal to emit on every valid occurrence of an event.
|
|
785
|
+
*
|
|
786
|
+
* Tenant configuration: an integration pushing an event cannot add, change, or
|
|
787
|
+
* suppress an effect. `weight` and `halfLife` are snapshotted onto each emitted
|
|
788
|
+
* signal, so editing the definition later never rewrites signals already
|
|
789
|
+
* recorded.
|
|
790
|
+
*/
|
|
791
|
+
export interface RiskSignalEffect {
|
|
792
|
+
/** Dotted signal type to emit, e.g. `authentication.password_change_attempt`. */
|
|
793
|
+
type: string;
|
|
794
|
+
/** Strength at the event timestamp. Must be greater than zero. */
|
|
795
|
+
weight: number;
|
|
796
|
+
/**
|
|
797
|
+
* Positive ISO 8601 duration, e.g. `P3D`. Calendar units (Y/M) are
|
|
798
|
+
* rejected — they have no fixed length.
|
|
799
|
+
*/
|
|
800
|
+
halfLife: string;
|
|
801
|
+
/**
|
|
802
|
+
* Defaults to `EVENT_RESOURCE` — the signal attaches to the event's own
|
|
803
|
+
* primary resource.
|
|
804
|
+
*/
|
|
805
|
+
target?: 'EVENT_RESOURCE';
|
|
806
|
+
}
|
|
807
|
+
/** What a declared resource is to the event. */
|
|
808
|
+
export type EventResourceRole = 'SUBJECT' | 'CONTEXT';
|
|
809
|
+
/** Every resource an Event Definition can name, in either role. */
|
|
810
|
+
export type EventDeclaredResource = 'CUSTOMER' | 'ACCOUNT' | 'COUNTERPARTY' | 'EMPLOYEE' | 'BRANCH' | 'PAYMENT_INSTRUMENT' | 'DEVICE' | 'SESSION' | 'TRANSACTION';
|
|
811
|
+
/**
|
|
812
|
+
* One resource an Event Definition names.
|
|
813
|
+
*
|
|
814
|
+
* `SUBJECT` entries enumerate the kinds an occurrence may be *about*; an
|
|
815
|
+
* occurrence names exactly one, so `required` carries no meaning there and the
|
|
816
|
+
* API normalises it to true. `CONTEXT` entries are the further resources it
|
|
817
|
+
* references, where `required` decides whether ingestion accepts an occurrence
|
|
818
|
+
* without one.
|
|
819
|
+
*
|
|
820
|
+
* `DEVICE`, `SESSION` and `TRANSACTION` are declarable as `CONTEXT` only.
|
|
821
|
+
*/
|
|
822
|
+
export interface EventResourceDeclarationDto {
|
|
823
|
+
resource: EventDeclaredResource;
|
|
824
|
+
role: EventResourceRole;
|
|
825
|
+
required: boolean;
|
|
534
826
|
}
|
|
535
827
|
export interface CreateEventDefinitionDto {
|
|
536
828
|
/** Unique event name (used as key). */
|
|
@@ -541,29 +833,67 @@ export interface CreateEventDefinitionDto {
|
|
|
541
833
|
description?: string;
|
|
542
834
|
/** Event category. */
|
|
543
835
|
category?: string;
|
|
544
|
-
/**
|
|
545
|
-
|
|
836
|
+
/**
|
|
837
|
+
* Resources this event names, each as SUBJECT (what an occurrence is
|
|
838
|
+
* about) or CONTEXT (what it also references). Omit to accept any
|
|
839
|
+
* attachable subject and expect no context.
|
|
840
|
+
*/
|
|
841
|
+
resources?: EventResourceDeclarationDto[];
|
|
842
|
+
/** Event property schema. Same shape as `TypedFieldDefinition` (including `options` for select types). */
|
|
843
|
+
properties?: TypedFieldDefinition[];
|
|
844
|
+
/** Risk Signals to emit on every valid occurrence of this event. */
|
|
845
|
+
riskSignalEffects?: RiskSignalEffect[];
|
|
546
846
|
/** Sync key for config-as-code management. */
|
|
547
847
|
syncKey?: string;
|
|
548
848
|
}
|
|
549
|
-
|
|
849
|
+
/** Canonical REST/GraphQL individual-create request. */
|
|
850
|
+
export interface CreateIndividualInput {
|
|
550
851
|
/** Your external identifier for this customer. Must be unique within the organization. */
|
|
551
852
|
externalId: string;
|
|
552
853
|
fullName: string;
|
|
854
|
+
status?: CustomerStatus;
|
|
553
855
|
preferredName?: string;
|
|
856
|
+
aliases?: string[];
|
|
554
857
|
dateOfBirth?: string;
|
|
555
858
|
/** ISO 3166-1 alpha-3 country codes */
|
|
556
859
|
nationality?: string[];
|
|
557
860
|
/** ISO 3166-1 alpha-3 country codes */
|
|
558
861
|
countryOfResidence?: string[];
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
862
|
+
/** Tax Identification Number (TIN). */
|
|
863
|
+
taxId?: string;
|
|
864
|
+
emails?: ContactEntryInput[];
|
|
865
|
+
phones?: ContactEntryInput[];
|
|
866
|
+
identificationDocuments?: InlineIdentificationDocumentInput[];
|
|
867
|
+
faceImageFileIds?: string[];
|
|
562
868
|
/** Inline fan-out into the polymorphic `addresses` table. */
|
|
563
869
|
addresses?: AddressInputDto[];
|
|
564
|
-
/**
|
|
870
|
+
/**
|
|
871
|
+
* Catalogue-governed tags (e.g. operating branch), stamped at creation so
|
|
872
|
+
* the INITIAL screening run — and any assignment-policy tag routing —
|
|
873
|
+
* sees them. Values not in the catalogue are rejected.
|
|
874
|
+
*/
|
|
875
|
+
tags?: TagValueInput[];
|
|
876
|
+
/**
|
|
877
|
+
* Standing assignment (user ids), stamped at creation so INITIAL screening
|
|
878
|
+
* and CUSTOMER_ASSIGNEE routing see it. Post-create edits via
|
|
879
|
+
* `customers.assignment.assign`.
|
|
880
|
+
*/
|
|
881
|
+
assignedToUserIds?: string[];
|
|
882
|
+
/**
|
|
883
|
+
* Standing assignment (team ids), stamped at creation so INITIAL screening
|
|
884
|
+
* and CUSTOMER_ASSIGNEE routing see it. Post-create edits via
|
|
885
|
+
* `customers.assignment.assign`.
|
|
886
|
+
*/
|
|
887
|
+
assignedToTeamIds?: string[];
|
|
888
|
+
/** @deprecated Use `emails`. Honoured only when `emails` is absent. */
|
|
889
|
+
email?: string;
|
|
890
|
+
/** @deprecated Use `phones`. Honoured only when `phones` is absent. */
|
|
891
|
+
phone?: string;
|
|
892
|
+
/** Override the creation timestamp (ISO 8601). For data-loading tools backfilling historical records. */
|
|
565
893
|
createdAt?: string;
|
|
566
894
|
}
|
|
895
|
+
/** @deprecated Use `CreateIndividualInput`. */
|
|
896
|
+
export type CreateIndividualDto = CreateIndividualInput;
|
|
567
897
|
export interface CreateNoteDto {
|
|
568
898
|
/** Note text content */
|
|
569
899
|
text: string;
|
|
@@ -576,19 +906,20 @@ export interface CreateProductDto {
|
|
|
576
906
|
/** Product description. */
|
|
577
907
|
description?: string;
|
|
578
908
|
/** Account category. */
|
|
579
|
-
category:
|
|
580
|
-
/**
|
|
581
|
-
|
|
909
|
+
category: AccountCategory;
|
|
910
|
+
/** Preferred product classification, governed by the `product.tags` catalogue. */
|
|
911
|
+
tags?: TagValueInput[];
|
|
912
|
+
/** @deprecated Use `tags`. Omitted values are stored as `OTHER`. */
|
|
913
|
+
baseType?: AccountType;
|
|
582
914
|
/** Default currency in TYPE:CODE format. */
|
|
583
915
|
defaultCurrency: string;
|
|
584
|
-
/**
|
|
916
|
+
/** @deprecated Use `tags` when product classification is needed. */
|
|
585
917
|
country?: string;
|
|
586
918
|
/** Supported transaction method IDs. */
|
|
587
919
|
supportedMethodIds: string[];
|
|
588
|
-
/**
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
*/
|
|
920
|
+
/** Account field template for accounts created from this product. */
|
|
921
|
+
accountFieldConfig?: TypedFieldDefinition[];
|
|
922
|
+
/** @deprecated Use `accountFieldConfig`. */
|
|
592
923
|
typedAccountFieldConfig?: TypedFieldDefinition[];
|
|
593
924
|
/** Product-level typed bag (Tier B, self-declaring). */
|
|
594
925
|
fields?: TypedFieldValueInput[];
|
|
@@ -597,6 +928,14 @@ export interface CreateProductDto {
|
|
|
597
928
|
/** Sync key for config-as-code management. */
|
|
598
929
|
syncKey?: string;
|
|
599
930
|
}
|
|
931
|
+
/** Attachment metadata for a file already uploaded via the file-upload flow. */
|
|
932
|
+
export interface RiskAssessmentFileDto {
|
|
933
|
+
/** Uploaded file id (customer file id, or fileKey for platform uploads) */
|
|
934
|
+
id: string;
|
|
935
|
+
name: string;
|
|
936
|
+
/** File size in bytes */
|
|
937
|
+
size: number;
|
|
938
|
+
}
|
|
600
939
|
export interface CreateRiskAssessmentDto {
|
|
601
940
|
answers: RiskAssessmentAnswerDto[];
|
|
602
941
|
resultingRiskRating: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
@@ -605,20 +944,87 @@ export interface CreateRiskAssessmentDto {
|
|
|
605
944
|
overrideJustification?: string;
|
|
606
945
|
narrative?: string;
|
|
607
946
|
riskTags?: TagValueInput[];
|
|
947
|
+
files?: RiskAssessmentFileDto[];
|
|
608
948
|
}
|
|
609
949
|
export interface CreateCustomerRiskAssessmentDto {
|
|
610
950
|
answers: CustomerRiskAssessmentAnswerDto[];
|
|
611
951
|
/** Optional narrative summary */
|
|
612
952
|
narrative?: string;
|
|
953
|
+
files?: RiskAssessmentFileDto[];
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* One action executed when a rule fires (spec v0 rules §8).
|
|
957
|
+
* `CREATE_ALERT` accepts an optional `severity` override
|
|
958
|
+
* (CRITICAL/HIGH/MEDIUM/LOW) plus `assignToTeamIds` / `assignToUserIds`;
|
|
959
|
+
* `SEND_WEBHOOK` references a configured webhook destination by `webhookId`;
|
|
960
|
+
* `FLAG_ENTITY` requires `entityType` + `flagType`; `TAG_CUSTOMER` requires
|
|
961
|
+
* `tag`; `ESCALATE` accepts an optional raising `severity` (HIGH/CRITICAL);
|
|
962
|
+
* `ADD_RISK_SIGNAL` requires `signalType`, `weight`, `halfLife` and `target`.
|
|
963
|
+
* Non-webhook types may appear at most once per rule — duplicates are
|
|
964
|
+
* rejected with 400. `ADD_RISK_SIGNAL` is exempt (one rule may legitimately
|
|
965
|
+
* record several kinds of evidence, or the same evidence against several
|
|
966
|
+
* resources); what it rejects is the same `signalType` on the same
|
|
967
|
+
* `target.resource` twice, which would double-count in every aggregate.
|
|
968
|
+
*/
|
|
969
|
+
export interface RuleAction {
|
|
970
|
+
type: 'CREATE_ALERT' | 'SEND_WEBHOOK' | 'FLAG_ENTITY' | 'TAG_CUSTOMER' | 'BLOCK_TRANSACTION' | 'FREEZE_ACCOUNT' | 'ADD_RISK_SIGNAL' | 'ASSIGN_FOR_REVIEW' | 'ESCALATE';
|
|
971
|
+
/** CREATE_ALERT: alert risk level override (defaults to the rule
|
|
972
|
+
* severity). ESCALATE: HIGH or CRITICAL only. */
|
|
973
|
+
severity?: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
974
|
+
/** CREATE_ALERT: better-auth team ids assigned to the alert on creation. */
|
|
975
|
+
assignToTeamIds?: string[];
|
|
976
|
+
/** CREATE_ALERT: user ids assigned to the alert on creation. */
|
|
977
|
+
assignToUserIds?: string[];
|
|
978
|
+
/** SEND_WEBHOOK: configured webhook destination id. */
|
|
979
|
+
webhookId?: string;
|
|
980
|
+
/** FLAG_ENTITY: which entity the flag lands on (required). */
|
|
981
|
+
entityType?: 'TRANSACTION' | 'CUSTOMER' | 'ACCOUNT';
|
|
982
|
+
/** FLAG_ENTITY: tenant-meaningful flag label, e.g. REVIEW_REQUIRED (required). */
|
|
983
|
+
flagType?: string;
|
|
984
|
+
/** TAG_CUSTOMER: tag appended to the customer record (required). */
|
|
985
|
+
tag?: string;
|
|
986
|
+
/**
|
|
987
|
+
* ADD_RISK_SIGNAL: dotted signal type to record (required). Tenant
|
|
988
|
+
* vocabulary — not a fixed platform enum.
|
|
989
|
+
*/
|
|
990
|
+
signalType?: string;
|
|
991
|
+
/**
|
|
992
|
+
* ADD_RISK_SIGNAL: strength at the moment the rule fires (required, > 0).
|
|
993
|
+
* Snapshotted onto every signal the action emits.
|
|
994
|
+
*/
|
|
995
|
+
weight?: number;
|
|
996
|
+
/**
|
|
997
|
+
* ADD_RISK_SIGNAL: positive ISO 8601 duration (required), e.g. `P7D`.
|
|
998
|
+
* Calendar units (Y/M) are rejected — they have no fixed length.
|
|
999
|
+
*/
|
|
1000
|
+
halfLife?: string;
|
|
1001
|
+
/**
|
|
1002
|
+
* ADD_RISK_SIGNAL: which resource in the evaluation the signal attaches to
|
|
1003
|
+
* (required). A closed selector, never a field expression.
|
|
1004
|
+
*
|
|
1005
|
+
* `employee` and `branch` are **not** valid selectors: no evaluation
|
|
1006
|
+
* envelope resolves either slot yet, so a rule targeting one could never
|
|
1007
|
+
* fire. Both are rejected at save time with a 400 explaining why.
|
|
1008
|
+
*/
|
|
1009
|
+
target?: {
|
|
1010
|
+
resource: 'customer' | 'account' | 'counterparty' | 'paymentInstrument';
|
|
1011
|
+
};
|
|
1012
|
+
[key: string]: unknown;
|
|
613
1013
|
}
|
|
614
1014
|
export interface CreateRuleDto {
|
|
615
1015
|
/** Rule name. */
|
|
616
1016
|
name: string;
|
|
617
1017
|
/** Rule description. */
|
|
618
1018
|
description?: string;
|
|
619
|
-
/** Rule subject. */
|
|
1019
|
+
/** Rule subject: 'TRANSACTION' | 'EVENT' | 'CUSTOMER' | 'ALL'. */
|
|
620
1020
|
subject: string;
|
|
621
|
-
/**
|
|
1021
|
+
/**
|
|
1022
|
+
* Rule trigger — the event type that causes evaluation. Core triggers:
|
|
1023
|
+
* `transaction.*` (subject TRANSACTION), `customer.*` / `account.*`
|
|
1024
|
+
* (subject EVENT). Custom triggers use `custom.{slug}` and must name an
|
|
1025
|
+
* ACTIVE event definition (Event Definitions API). `'*'` fires on all
|
|
1026
|
+
* events in the subject's scope. Invalid pairs are rejected with 400.
|
|
1027
|
+
*/
|
|
622
1028
|
trigger?: string;
|
|
623
1029
|
/** Rule severity. */
|
|
624
1030
|
severity: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
@@ -627,15 +1033,19 @@ export interface CreateRuleDto {
|
|
|
627
1033
|
/** Condition tree (AND/OR logic with leaf conditions). */
|
|
628
1034
|
conditionTree?: Record<string, unknown>;
|
|
629
1035
|
/** Actions to execute when the rule triggers. */
|
|
630
|
-
actions?:
|
|
1036
|
+
actions?: RuleAction[];
|
|
631
1037
|
/** Window period for aggregate conditions. */
|
|
632
1038
|
windowPeriod?: string;
|
|
633
1039
|
/** Initial status for the rule. */
|
|
634
1040
|
initialStatus?: 'DRAFT' | 'ACTIVE' | 'DISABLED';
|
|
635
1041
|
/** Sync key for config-as-code management. */
|
|
636
1042
|
syncKey?: string;
|
|
1043
|
+
/** Product applicability. Omit or empty products = unscoped. */
|
|
1044
|
+
scope?: {
|
|
1045
|
+
products?: string[];
|
|
1046
|
+
};
|
|
637
1047
|
}
|
|
638
|
-
export interface
|
|
1048
|
+
export interface StakeholderInput {
|
|
639
1049
|
name: string;
|
|
640
1050
|
role: 'SHAREHOLDER' | 'UBO' | 'DIRECTOR';
|
|
641
1051
|
/** Ownership percentage (0–100) */
|
|
@@ -648,6 +1058,8 @@ export interface CreateStakeholderDto {
|
|
|
648
1058
|
/** Link to an existing Entity customer */
|
|
649
1059
|
entityId?: string;
|
|
650
1060
|
}
|
|
1061
|
+
/** @deprecated Use `StakeholderInput`. */
|
|
1062
|
+
export type CreateStakeholderDto = StakeholderInput;
|
|
651
1063
|
export interface CreateWebhookDto {
|
|
652
1064
|
/** Webhook destination name. */
|
|
653
1065
|
name: string;
|
|
@@ -732,15 +1144,25 @@ export interface EntityResponseDto {
|
|
|
732
1144
|
countryOfIncorporation?: string;
|
|
733
1145
|
dateOfIncorporation?: string;
|
|
734
1146
|
entityType?: string;
|
|
1147
|
+
/** Tax Identification Number (TIN). */
|
|
1148
|
+
taxId?: string;
|
|
735
1149
|
parentEntityId?: string;
|
|
736
1150
|
email?: string;
|
|
737
1151
|
phone?: string;
|
|
738
1152
|
riskRating: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
739
1153
|
kycTier?: 'NO_KYC' | 'SDD' | 'CDD' | 'EDD' | 'ONGOING';
|
|
1154
|
+
/**
|
|
1155
|
+
* Standing assignment — the users/teams responsible for compliance work on
|
|
1156
|
+
* this customer. NOT ownership ("owner" here means UBO or account owner).
|
|
1157
|
+
* Read by the CUSTOMER_ASSIGNEE routing block, so a new alert can go to
|
|
1158
|
+
* whoever holds the customer.
|
|
1159
|
+
*/
|
|
1160
|
+
assignedToUserIds?: string[];
|
|
1161
|
+
assignedToTeamIds?: string[];
|
|
740
1162
|
alertCount: number;
|
|
741
1163
|
/** Operational footprint (REGISTERED office, BRANCH, WAREHOUSE, …). Read-only here;
|
|
742
1164
|
* use granular add/update/remove/verify/reject mutations on the addresses endpoint. */
|
|
743
|
-
|
|
1165
|
+
addresses: AddressDto[];
|
|
744
1166
|
createdAt: string;
|
|
745
1167
|
updatedAt: string;
|
|
746
1168
|
}
|
|
@@ -779,14 +1201,28 @@ export interface IPSessionDto {
|
|
|
779
1201
|
country?: string;
|
|
780
1202
|
isVPN?: boolean;
|
|
781
1203
|
vpnProvider?: string;
|
|
1204
|
+
asn?: string;
|
|
1205
|
+
networkName?: string;
|
|
1206
|
+
confidence?: number;
|
|
782
1207
|
}
|
|
783
1208
|
export interface IdentificationDocumentDto {
|
|
1209
|
+
id?: string;
|
|
784
1210
|
/** Document type */
|
|
785
1211
|
type: string;
|
|
786
1212
|
number: string;
|
|
787
1213
|
/** ISO 3166-1 alpha-3 country code */
|
|
788
|
-
|
|
1214
|
+
country: string;
|
|
1215
|
+
/**
|
|
1216
|
+
* @deprecated Accepted on write as an alias for `country`, but never
|
|
1217
|
+
* returned — responses have always carried `country`. Read `country`.
|
|
1218
|
+
*/
|
|
1219
|
+
issuingCountry?: string;
|
|
789
1220
|
expiryDate?: string;
|
|
1221
|
+
dateOfIssue?: string;
|
|
1222
|
+
notes?: string;
|
|
1223
|
+
attachments?: AttachmentDto[];
|
|
1224
|
+
/** @deprecated Use `attachments`. */
|
|
1225
|
+
fileIds?: string[];
|
|
790
1226
|
}
|
|
791
1227
|
export type IdentificationDocumentStatus = 'PENDING' | 'APPROVED' | 'REJECTED';
|
|
792
1228
|
/** Computed status — also reflects expiry and archive state. */
|
|
@@ -950,7 +1386,7 @@ export interface DeleteIdentificationDocumentResponse {
|
|
|
950
1386
|
deletedId: string;
|
|
951
1387
|
}
|
|
952
1388
|
/** Resource types that can carry platform comments. */
|
|
953
|
-
export type CommentResourceType = 'CUSTOMER' | 'ACCOUNT' | 'TRANSACTION' | 'TASK' | 'ALERT' | 'COMMENT' | 'COUNTERPARTY' | 'DEVICE' | 'RULE' | 'PRODUCT' | '
|
|
1389
|
+
export type CommentResourceType = 'CUSTOMER' | 'ACCOUNT' | 'TRANSACTION' | 'TASK' | 'ALERT' | 'COMMENT' | 'COUNTERPARTY' | 'DEVICE' | 'RULE' | 'PRODUCT' | 'PAYMENT_INSTRUMENT' | 'IDENTIFICATION_DOCUMENT';
|
|
954
1390
|
export interface PlatformCommentAttachmentInput {
|
|
955
1391
|
/** fileId returned by /platform/v1/files/upload-url */
|
|
956
1392
|
fileId: string;
|
|
@@ -962,7 +1398,12 @@ export interface PlatformCommentAttachment extends PlatformCommentAttachmentInpu
|
|
|
962
1398
|
/** Short-lived presigned download URL (when resolved by the server). */
|
|
963
1399
|
downloadUrl?: string;
|
|
964
1400
|
}
|
|
1401
|
+
export interface CommentLinksInput {
|
|
1402
|
+
/** Screening matches attached to this comment. Empty removes all attachments; omitting links on update preserves them. */
|
|
1403
|
+
matchIds?: string[];
|
|
1404
|
+
}
|
|
965
1405
|
export interface PlatformCreateCommentDto {
|
|
1406
|
+
links?: CommentLinksInput;
|
|
966
1407
|
resourceType: CommentResourceType;
|
|
967
1408
|
resourceId: string;
|
|
968
1409
|
/** Markdown body (GFM tables supported). */
|
|
@@ -972,6 +1413,7 @@ export interface PlatformCreateCommentDto {
|
|
|
972
1413
|
externalRequestId?: string;
|
|
973
1414
|
}
|
|
974
1415
|
export interface PlatformUpdateCommentDto {
|
|
1416
|
+
links?: CommentLinksInput;
|
|
975
1417
|
/** Markdown body (GFM tables supported). */
|
|
976
1418
|
body: string;
|
|
977
1419
|
}
|
|
@@ -980,7 +1422,15 @@ export interface ListPlatformCommentsQuery {
|
|
|
980
1422
|
resourceId: string;
|
|
981
1423
|
}
|
|
982
1424
|
/** Comment response shape — the OpenAPI spec does not document a full schema, so callers should narrow as needed. */
|
|
1425
|
+
/** Stable references to screening results, with labels retained after a rescreen. */
|
|
1426
|
+
export interface PlatformCommentMatchReference {
|
|
1427
|
+
matchId: string;
|
|
1428
|
+
name: string;
|
|
1429
|
+
category: 'WATCHLIST' | 'HIGH_RISK' | 'CUSTOM_LIST';
|
|
1430
|
+
}
|
|
983
1431
|
export interface PlatformComment {
|
|
1432
|
+
/** Always present; empty when the comment references no screening result. */
|
|
1433
|
+
matchReferences: PlatformCommentMatchReference[];
|
|
984
1434
|
id: string;
|
|
985
1435
|
resourceType: CommentResourceType;
|
|
986
1436
|
resourceId: string;
|
|
@@ -1038,10 +1488,20 @@ export interface IndividualResponseDto {
|
|
|
1038
1488
|
dateOfBirth?: string;
|
|
1039
1489
|
nationality?: string[];
|
|
1040
1490
|
countryOfResidence?: string[];
|
|
1491
|
+
/** Tax Identification Number (TIN). */
|
|
1492
|
+
taxId?: string;
|
|
1041
1493
|
email?: string;
|
|
1042
1494
|
phone?: string;
|
|
1043
1495
|
riskRating: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
1044
1496
|
kycTier?: 'NO_KYC' | 'SDD' | 'CDD' | 'EDD' | 'ONGOING';
|
|
1497
|
+
/**
|
|
1498
|
+
* Standing assignment — the users/teams responsible for compliance work on
|
|
1499
|
+
* this customer. NOT ownership ("owner" here means UBO or account owner).
|
|
1500
|
+
* Read by the CUSTOMER_ASSIGNEE routing block, so a new alert can go to
|
|
1501
|
+
* whoever holds the customer.
|
|
1502
|
+
*/
|
|
1503
|
+
assignedToUserIds?: string[];
|
|
1504
|
+
assignedToTeamIds?: string[];
|
|
1045
1505
|
alertCount: number;
|
|
1046
1506
|
identificationDocuments: IdentificationDocumentDto[];
|
|
1047
1507
|
/** Postal addresses (HOME / MAILING / BILLING / WORK). Read-only here;
|
|
@@ -1066,14 +1526,54 @@ export interface IngestDevicePayloadDto {
|
|
|
1066
1526
|
botProbability?: number;
|
|
1067
1527
|
/** Detection confidence score (0-1). */
|
|
1068
1528
|
confidence?: number;
|
|
1529
|
+
/** Device location observation. Multiple observations are retained over time. */
|
|
1530
|
+
location?: LocationObservationDto;
|
|
1531
|
+
}
|
|
1532
|
+
/** Resource an Event occurrence attaches to as its single primary subject. */
|
|
1533
|
+
export type EventResourceType = 'CUSTOMER' | 'ACCOUNT' | 'COUNTERPARTY' | 'EMPLOYEE' | 'BRANCH' | 'PAYMENT_INSTRUMENT';
|
|
1534
|
+
/** Resource a Risk Signal attaches to. */
|
|
1535
|
+
export type RiskSignalResourceType = 'CUSTOMER' | 'ACCOUNT' | 'COUNTERPARTY' | 'EMPLOYEE' | 'BRANCH' | 'PAYMENT_INSTRUMENT';
|
|
1536
|
+
/** The single resource an Event is about. Exactly one, always. */
|
|
1537
|
+
export interface EventResourceRef {
|
|
1538
|
+
type: EventResourceType;
|
|
1539
|
+
/** Id of the resource, which must already exist in your organization. */
|
|
1540
|
+
id: string;
|
|
1069
1541
|
}
|
|
1070
1542
|
export interface IngestEventDto {
|
|
1543
|
+
/**
|
|
1544
|
+
* Your unique identifier for this event (max 255 chars). Used for
|
|
1545
|
+
* idempotency: resubmitting the same eventId returns the original
|
|
1546
|
+
* stored event (`cached: true`) instead of creating a duplicate — safe
|
|
1547
|
+
* for client retries. Omit to skip deduplication.
|
|
1548
|
+
*/
|
|
1549
|
+
eventId?: string;
|
|
1071
1550
|
/** Event type (core or custom). Core types: customer.failed_login, customer.profile_updated. Custom types match event definitions. */
|
|
1072
1551
|
type: string;
|
|
1073
1552
|
/** When the event occurred. */
|
|
1074
1553
|
timestamp: string;
|
|
1075
|
-
/**
|
|
1076
|
-
|
|
1554
|
+
/**
|
|
1555
|
+
* The single resource this event is about. Supply either `resource` or the
|
|
1556
|
+
* legacy top-level `customerId` — `resource` wins when both are present.
|
|
1557
|
+
* An event that names neither is rejected with 400.
|
|
1558
|
+
*
|
|
1559
|
+
* `deviceId` and `sessionId` may qualify an event but never substitute for
|
|
1560
|
+
* its primary resource.
|
|
1561
|
+
*/
|
|
1562
|
+
resource?: EventResourceRef;
|
|
1563
|
+
/**
|
|
1564
|
+
* Customer this event relates to.
|
|
1565
|
+
*
|
|
1566
|
+
* Two roles: as the legacy attachment field it is exactly equivalent to
|
|
1567
|
+
* `resource: { type: 'CUSTOMER', id }`, and alongside a non-customer
|
|
1568
|
+
* `resource` it is context that customer-scoped event aggregates read.
|
|
1569
|
+
*
|
|
1570
|
+
* @deprecated `resource` is the contract. A bare `customerId` is still
|
|
1571
|
+
* accepted as the legacy spelling of `resource: { type: 'CUSTOMER', id }`,
|
|
1572
|
+
* but new integrations should send `resource` — it is the only way to
|
|
1573
|
+
* attach an event to an account, counterparty, employee, branch, or
|
|
1574
|
+
* payment instrument.
|
|
1575
|
+
*/
|
|
1576
|
+
customerId?: string;
|
|
1077
1577
|
/** Account ID if the event is account-scoped. */
|
|
1078
1578
|
accountId?: string;
|
|
1079
1579
|
/** Device identifier for device-context rules. */
|
|
@@ -1093,8 +1593,8 @@ export interface IngestTransactionDto {
|
|
|
1093
1593
|
timestamp: string;
|
|
1094
1594
|
/** The transaction payload. */
|
|
1095
1595
|
transaction: TransactionBodyDto;
|
|
1096
|
-
/** Payment
|
|
1097
|
-
|
|
1596
|
+
/** Canonical Payment Instrument identity or protected credential for deterministic create-on-miss resolution. */
|
|
1597
|
+
paymentInstrument?: PaymentInstrumentPayloadDto;
|
|
1098
1598
|
/** Intermediary banks/institutions in the payment chain. */
|
|
1099
1599
|
intermediaries?: IntermediaryDto[];
|
|
1100
1600
|
/** Device / fingerprint data used for device-based rules and device-trust resolution. */
|
|
@@ -1102,6 +1602,169 @@ export interface IngestTransactionDto {
|
|
|
1102
1602
|
/** Set to true for async processing. Returns 202 Accepted immediately; results delivered via webhook. */
|
|
1103
1603
|
async?: boolean;
|
|
1104
1604
|
}
|
|
1605
|
+
/** Why a payment operation failed to become a transaction in the source system. */
|
|
1606
|
+
export type TransactionAttemptOutcome = 'FAILED' | 'BLOCKED' | 'UNKNOWN';
|
|
1607
|
+
export interface TransactionAttemptOutcomeDto {
|
|
1608
|
+
type: TransactionAttemptOutcome;
|
|
1609
|
+
code?: string;
|
|
1610
|
+
reason?: string;
|
|
1611
|
+
/** System or provider that supplied the outcome. */
|
|
1612
|
+
source?: string;
|
|
1613
|
+
retryable?: boolean;
|
|
1614
|
+
/** Whether the integration considers this the final outcome for the operation. */
|
|
1615
|
+
final?: boolean;
|
|
1616
|
+
}
|
|
1617
|
+
export interface AttemptedAmountDto {
|
|
1618
|
+
/** Attempted value in the supplied currency's minor units. */
|
|
1619
|
+
amountMinor: number;
|
|
1620
|
+
/** Structured currency code, for example `FIAT:USD`. */
|
|
1621
|
+
currency: string;
|
|
1622
|
+
precision: number;
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Durable behavioural record for an operation that did not become a source
|
|
1626
|
+
* transaction. Snapshot objects must contain safe descriptors only—never PANs,
|
|
1627
|
+
* raw payment tokens, API keys, or unprotected device fingerprints.
|
|
1628
|
+
*/
|
|
1629
|
+
export interface IngestTransactionAttemptDto {
|
|
1630
|
+
/** Tenant-scoped idempotency key. */
|
|
1631
|
+
attemptId: string;
|
|
1632
|
+
/** When the source system observed the attempt. */
|
|
1633
|
+
timestamp: string;
|
|
1634
|
+
/** Integration-defined payment operation, for example `CARD_AUTHORIZATION`. */
|
|
1635
|
+
operation: string;
|
|
1636
|
+
outcome: TransactionAttemptOutcomeDto;
|
|
1637
|
+
amount?: AttemptedAmountDto;
|
|
1638
|
+
direction?: 'IN' | 'OUT';
|
|
1639
|
+
mode?: Record<string, unknown>;
|
|
1640
|
+
channel?: Record<string, unknown>;
|
|
1641
|
+
authentication?: Record<string, unknown>;
|
|
1642
|
+
principalParty?: Record<string, unknown>;
|
|
1643
|
+
counterparty?: Record<string, unknown>;
|
|
1644
|
+
/** Lookup-only Payment Instrument reference. A miss never creates a Payment Instrument. */
|
|
1645
|
+
paymentInstrument?: AttemptPaymentInstrumentDto;
|
|
1646
|
+
device?: Record<string, unknown>;
|
|
1647
|
+
context?: Record<string, unknown>;
|
|
1648
|
+
}
|
|
1649
|
+
export interface IngestTransactionAttemptResponse {
|
|
1650
|
+
attemptId: string;
|
|
1651
|
+
/** Database record ID. */
|
|
1652
|
+
id: string;
|
|
1653
|
+
/** True when an identical tenant-scoped replay returned the existing record. */
|
|
1654
|
+
cached: boolean;
|
|
1655
|
+
observedAt: string;
|
|
1656
|
+
expiresAt: string;
|
|
1657
|
+
}
|
|
1658
|
+
export type AttemptCoverage = 'ALL' | 'SELECTIVE';
|
|
1659
|
+
/**
|
|
1660
|
+
* What event ingestion does with a type that has no Event Definition.
|
|
1661
|
+
* `ACCEPT` (the default) records it as history that links to no Definition and
|
|
1662
|
+
* emits no Risk Signals; `REJECT` fails the request instead.
|
|
1663
|
+
*/
|
|
1664
|
+
export type UnknownEventTypePolicy = 'ACCEPT' | 'REJECT';
|
|
1665
|
+
export interface TenantBehaviorSettings {
|
|
1666
|
+
attemptRetentionDays: number;
|
|
1667
|
+
attemptCoverage: AttemptCoverage;
|
|
1668
|
+
unknownEventTypes: UnknownEventTypePolicy;
|
|
1669
|
+
}
|
|
1670
|
+
export interface UpdateTenantBehaviorSettingsInput {
|
|
1671
|
+
attemptRetentionDays?: number;
|
|
1672
|
+
attemptCoverage?: AttemptCoverage;
|
|
1673
|
+
unknownEventTypes?: UnknownEventTypePolicy;
|
|
1674
|
+
}
|
|
1675
|
+
export interface ListTransactionAttemptsInput {
|
|
1676
|
+
limit?: number;
|
|
1677
|
+
cursor?: string;
|
|
1678
|
+
outcomes?: TransactionAttemptOutcome[];
|
|
1679
|
+
operation?: string;
|
|
1680
|
+
observedFrom?: string;
|
|
1681
|
+
observedTo?: string;
|
|
1682
|
+
customerId?: string;
|
|
1683
|
+
accountId?: string;
|
|
1684
|
+
counterpartyId?: string;
|
|
1685
|
+
paymentInstrumentId?: string;
|
|
1686
|
+
deviceId?: string;
|
|
1687
|
+
sessionId?: string;
|
|
1688
|
+
channelEndpointId?: string;
|
|
1689
|
+
iin?: string;
|
|
1690
|
+
}
|
|
1691
|
+
/** Safe read projection. Protected request/fingerprint/IP hashes are never returned. */
|
|
1692
|
+
export interface TransactionAttemptDto {
|
|
1693
|
+
id: string;
|
|
1694
|
+
attemptId: string;
|
|
1695
|
+
observedAt: string;
|
|
1696
|
+
outcome: TransactionAttemptOutcome;
|
|
1697
|
+
outcomeCode?: string | null;
|
|
1698
|
+
outcomeReason?: string | null;
|
|
1699
|
+
outcomeSource?: string | null;
|
|
1700
|
+
retryable?: boolean | null;
|
|
1701
|
+
final: boolean;
|
|
1702
|
+
operation: string;
|
|
1703
|
+
mode?: Record<string, unknown> | null;
|
|
1704
|
+
channel?: Record<string, unknown> | null;
|
|
1705
|
+
authentication?: Record<string, unknown> | null;
|
|
1706
|
+
direction?: 'IN' | 'OUT' | null;
|
|
1707
|
+
originAmountMinor?: number | null;
|
|
1708
|
+
originCurrency?: string | null;
|
|
1709
|
+
originPrecision?: number | null;
|
|
1710
|
+
baseAmountMinor?: number | null;
|
|
1711
|
+
baseCurrency?: string | null;
|
|
1712
|
+
basePrecision?: number | null;
|
|
1713
|
+
customerId?: string | null;
|
|
1714
|
+
accountId?: string | null;
|
|
1715
|
+
counterpartyId?: string | null;
|
|
1716
|
+
paymentInstrumentId?: string | null;
|
|
1717
|
+
deviceId?: string | null;
|
|
1718
|
+
sessionId?: string | null;
|
|
1719
|
+
channelEndpointId?: string | null;
|
|
1720
|
+
iin?: string | null;
|
|
1721
|
+
countryCode?: string | null;
|
|
1722
|
+
principalParty?: Record<string, unknown> | null;
|
|
1723
|
+
counterparty?: Record<string, unknown> | null;
|
|
1724
|
+
paymentInstrument?: Record<string, unknown> | null;
|
|
1725
|
+
device?: Record<string, unknown> | null;
|
|
1726
|
+
context?: Record<string, unknown> | null;
|
|
1727
|
+
expiresAt: string;
|
|
1728
|
+
createdAt: string;
|
|
1729
|
+
}
|
|
1730
|
+
export interface TransactionAttemptPage {
|
|
1731
|
+
items: TransactionAttemptDto[];
|
|
1732
|
+
nextCursor?: string | null;
|
|
1733
|
+
}
|
|
1734
|
+
export interface ContributingAttemptFact {
|
|
1735
|
+
attemptId: string;
|
|
1736
|
+
observedAt: string;
|
|
1737
|
+
outcome?: string;
|
|
1738
|
+
operation?: string;
|
|
1739
|
+
customerId?: string | null;
|
|
1740
|
+
accountId?: string | null;
|
|
1741
|
+
counterpartyId?: string | null;
|
|
1742
|
+
paymentInstrumentId?: string | null;
|
|
1743
|
+
deviceId?: string | null;
|
|
1744
|
+
sessionId?: string | null;
|
|
1745
|
+
channelEndpointId?: string | null;
|
|
1746
|
+
originAmountMinor?: number | null;
|
|
1747
|
+
originCurrency?: string | null;
|
|
1748
|
+
originPrecision?: number | null;
|
|
1749
|
+
baseAmountMinor?: number | null;
|
|
1750
|
+
baseCurrency?: string | null;
|
|
1751
|
+
basePrecision?: number | null;
|
|
1752
|
+
iin?: string | null;
|
|
1753
|
+
countryCode?: string | null;
|
|
1754
|
+
ipLookupHash?: string | null;
|
|
1755
|
+
}
|
|
1756
|
+
export interface AlertAttemptEvidence {
|
|
1757
|
+
id: string;
|
|
1758
|
+
alertId: string;
|
|
1759
|
+
ruleId: string;
|
|
1760
|
+
ruleVersion?: number | null;
|
|
1761
|
+
attempts: ContributingAttemptFact[];
|
|
1762
|
+
contributingAttemptCount: number;
|
|
1763
|
+
capturedAttemptCount: number;
|
|
1764
|
+
truncated: boolean;
|
|
1765
|
+
capturedAt: string;
|
|
1766
|
+
retainedUntil?: string | null;
|
|
1767
|
+
}
|
|
1105
1768
|
export interface InitializeSetupDto {
|
|
1106
1769
|
/** Admin user full name */
|
|
1107
1770
|
name: string;
|
|
@@ -1113,6 +1776,8 @@ export interface InitializeSetupDto {
|
|
|
1113
1776
|
organizationName: string;
|
|
1114
1777
|
/** Organization slug (URL-friendly identifier) */
|
|
1115
1778
|
organizationSlug: string;
|
|
1779
|
+
/** Definition of the tenant base currency. Created as the only currency at setup. Defaults to FIAT USD. */
|
|
1780
|
+
baseCurrency?: CreateCurrencyInput;
|
|
1116
1781
|
/** Enable Transaction Intelligence product */
|
|
1117
1782
|
transactionIntelligence?: boolean;
|
|
1118
1783
|
/** Enable KYC vendor integration (within Customer Monitoring) */
|
|
@@ -1123,18 +1788,6 @@ export interface InstitutionDetailsDto {
|
|
|
1123
1788
|
lei?: string;
|
|
1124
1789
|
regulatoryStatus?: string;
|
|
1125
1790
|
}
|
|
1126
|
-
export interface InstrumentPayloadDto {
|
|
1127
|
-
/** Instrument identifier. */
|
|
1128
|
-
id: string;
|
|
1129
|
-
/** Human-readable name persisted as instruments.displayName (e.g. "Personal Visa", "Travel Card"). */
|
|
1130
|
-
name?: string;
|
|
1131
|
-
/** Instrument type (CARD, VIRTUAL_CARD, WALLET_TOKEN, etc.). */
|
|
1132
|
-
type?: string;
|
|
1133
|
-
/** Instrument status (ACTIVE, BLOCKED, EXPIRED, etc.). */
|
|
1134
|
-
status?: string;
|
|
1135
|
-
/** Token or masked identifier. */
|
|
1136
|
-
token?: string;
|
|
1137
|
-
}
|
|
1138
1791
|
export interface IntermediaryDto {
|
|
1139
1792
|
/** Role of the intermediary (e.g. CORRESPONDENT, CLEARING_BANK). */
|
|
1140
1793
|
role: string;
|
|
@@ -1228,7 +1881,11 @@ export interface OtherPaymentDetailsDto {
|
|
|
1228
1881
|
}
|
|
1229
1882
|
export interface PaginationMeta {
|
|
1230
1883
|
/** Cursor to fetch the next page, null if no more results */
|
|
1231
|
-
|
|
1884
|
+
/**
|
|
1885
|
+
* Opaque cursor for the next page — the last row's id — or `null` on the
|
|
1886
|
+
* final page. Pass it straight back as `cursor`.
|
|
1887
|
+
*/
|
|
1888
|
+
nextCursor: string | null;
|
|
1232
1889
|
/** Total number of items matching the query */
|
|
1233
1890
|
totalCount: number;
|
|
1234
1891
|
}
|
|
@@ -1244,8 +1901,79 @@ export interface PatchTransactionStatusDto {
|
|
|
1244
1901
|
/** Human-readable reason for terminal transitions (REJECTED, REVERSED, BLOCKED). Stored in statusHistory for audit. */
|
|
1245
1902
|
terminalReason?: string;
|
|
1246
1903
|
}
|
|
1904
|
+
/** Integer minor-unit amount with the currency and precision needed to display it. */
|
|
1905
|
+
export interface MonetaryAmountDto {
|
|
1906
|
+
/** Integer amount in minor units (cents, satoshi, …). */
|
|
1907
|
+
amountMinor: number;
|
|
1908
|
+
/** Currency in `TYPE:CODE` form, e.g. `FIAT:USD`. */
|
|
1909
|
+
currency: string;
|
|
1910
|
+
/** Decimal places: `major = amountMinor / 10^precision`. */
|
|
1911
|
+
precision: number;
|
|
1912
|
+
}
|
|
1913
|
+
export interface TransactionStatusHistoryEntryDto {
|
|
1914
|
+
from?: string;
|
|
1915
|
+
to: string;
|
|
1916
|
+
/** ISO 8601 — when the change occurred in the caller's system. */
|
|
1917
|
+
changedAt: string;
|
|
1918
|
+
reason?: string;
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* A stored transaction as the platform holds it after ingestion: the caller's
|
|
1922
|
+
* payload plus what resolution and normalisation added. Returned by
|
|
1923
|
+
* `GET /v1/transactions/{transactionId}`.
|
|
1924
|
+
*/
|
|
1925
|
+
export interface TransactionResponseDto {
|
|
1926
|
+
/** Internal transaction UUID (the `id` returned by `POST /transactions`). */
|
|
1927
|
+
id: string;
|
|
1928
|
+
/** Caller-supplied reference (the `transactionId` sent on ingest). */
|
|
1929
|
+
transactionId: string;
|
|
1930
|
+
kind: 'TRANSFER' | 'ACCOUNT_ENTRY' | (string & {});
|
|
1931
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETE' | 'REJECTED' | 'REVERSED' | 'BLOCKED' | (string & {});
|
|
1932
|
+
statusChangedAt?: string | null;
|
|
1933
|
+
statusHistory?: TransactionStatusHistoryEntryDto[];
|
|
1934
|
+
/** Immutable window anchor. */
|
|
1935
|
+
executedAt: string;
|
|
1936
|
+
settledAt?: string | null;
|
|
1937
|
+
direction?: 'IN' | 'OUT' | null;
|
|
1938
|
+
entryType?: string | null;
|
|
1939
|
+
mode?: Record<string, unknown> | null;
|
|
1940
|
+
channel?: Record<string, unknown> | null;
|
|
1941
|
+
memo?: string | null;
|
|
1942
|
+
/** Amount as ingested. */
|
|
1943
|
+
origin: MonetaryAmountDto;
|
|
1944
|
+
/** Amount normalised to the tenant base currency. */
|
|
1945
|
+
base?: MonetaryAmountDto | null;
|
|
1946
|
+
destination?: MonetaryAmountDto | null;
|
|
1947
|
+
baseExchangeRate?: number | null;
|
|
1948
|
+
fees?: unknown[] | null;
|
|
1949
|
+
baseFeeTotalMinor?: number | null;
|
|
1950
|
+
paymentInfo?: Record<string, unknown> | null;
|
|
1951
|
+
principalParty?: Record<string, unknown> | null;
|
|
1952
|
+
counterparty?: Record<string, unknown> | null;
|
|
1953
|
+
customerId?: string | null;
|
|
1954
|
+
accountId?: string | null;
|
|
1955
|
+
counterpartyId?: string | null;
|
|
1956
|
+
counterpartyPaymentMethodId?: string | null;
|
|
1957
|
+
counterpartyResolutionStatus?: string | null;
|
|
1958
|
+
/** @deprecated Mirrors `paymentInstrumentId`. */
|
|
1959
|
+
instrumentId?: string | null;
|
|
1960
|
+
paymentInstrumentId?: string | null;
|
|
1961
|
+
channelEndpointId?: string | null;
|
|
1962
|
+
deviceId?: string | null;
|
|
1963
|
+
sessionId?: string | null;
|
|
1964
|
+
isInternalTxn?: boolean | null;
|
|
1965
|
+
isSelfTransfer?: boolean | null;
|
|
1966
|
+
internalCounterpartyCustomerId?: string | null;
|
|
1967
|
+
internalCounterpartyAccountId?: string | null;
|
|
1968
|
+
relatedTransactions?: unknown[] | null;
|
|
1969
|
+
isFlagged: boolean;
|
|
1970
|
+
flaggedAlertIds: string[];
|
|
1971
|
+
metadata?: Record<string, unknown> | null;
|
|
1972
|
+
createdAt: string;
|
|
1973
|
+
updatedAt: string;
|
|
1974
|
+
}
|
|
1247
1975
|
export interface PaymentDetailsDto {
|
|
1248
|
-
/** Discriminator selecting which payment subtype block to populate. NOTE:
|
|
1976
|
+
/** Discriminator selecting which payment subtype block to populate. NOTE: the Payment Instrument used by the principal customer is modelled separately on the transaction `paymentInstrument` field — counterparty payment details describe how the counterparty receives money. */
|
|
1249
1977
|
type: 'BANK_ACCOUNT' | 'CRYPTO_WALLET' | 'DIGITAL_WALLET' | 'MERCHANT' | 'PROCESSOR' | 'CASH' | 'CHECK' | 'ATM' | 'OTHER';
|
|
1250
1978
|
bankAccount?: BankAccountDetailsDto;
|
|
1251
1979
|
cryptoWallet?: CryptoWalletDetailsDto;
|
|
@@ -1291,12 +2019,21 @@ export interface PaymentLocationAddressDto {
|
|
|
1291
2019
|
/** ISO 3166-1 alpha-3 country code. */
|
|
1292
2020
|
country?: string;
|
|
1293
2021
|
}
|
|
2022
|
+
/**
|
|
2023
|
+
* A point on an ingested payment location.
|
|
2024
|
+
*
|
|
2025
|
+
* Both spellings are accepted; send either. Exactly one point is stored.
|
|
2026
|
+
*/
|
|
1294
2027
|
export interface PaymentLocationCoordinatesDto {
|
|
1295
2028
|
/** Latitude (WGS84). */
|
|
1296
|
-
|
|
2029
|
+
latitude?: number;
|
|
1297
2030
|
/** Longitude (WGS84). */
|
|
1298
|
-
|
|
1299
|
-
|
|
2031
|
+
longitude?: number;
|
|
2032
|
+
/** Latitude (WGS84). Prefer `latitude`. */
|
|
2033
|
+
lat?: number;
|
|
2034
|
+
/** Longitude (WGS84). Prefer `longitude`. */
|
|
2035
|
+
lng?: number;
|
|
2036
|
+
}
|
|
1300
2037
|
export interface PlaceOfBirthDto {
|
|
1301
2038
|
cityOfBirth?: string;
|
|
1302
2039
|
provinceOfBirth?: string;
|
|
@@ -1356,13 +2093,22 @@ export interface RegisterDeviceBrowserDetailsDto {
|
|
|
1356
2093
|
userAgent?: string;
|
|
1357
2094
|
}
|
|
1358
2095
|
export interface RegisterDeviceDto {
|
|
1359
|
-
/**
|
|
1360
|
-
|
|
1361
|
-
browserDetails
|
|
1362
|
-
/** IP sessions observed for the device */
|
|
1363
|
-
ipSessions?: unknown[];
|
|
2096
|
+
/** Raw identities used only for tenant-bound protected resolution; values are never persisted or returned. */
|
|
2097
|
+
fingerprints: RegisterDeviceFingerprintDto[];
|
|
2098
|
+
browserDetails?: RegisterDeviceBrowserDetailsDto;
|
|
1364
2099
|
botProbability?: number;
|
|
1365
2100
|
confidence?: number;
|
|
2101
|
+
/** ISO 8601 observation time. Defaults to server receipt time. */
|
|
2102
|
+
observedAt?: string;
|
|
2103
|
+
}
|
|
2104
|
+
export interface RegisterDeviceFingerprintDto {
|
|
2105
|
+
/** Raw identity value used in memory only. */
|
|
2106
|
+
value: string;
|
|
2107
|
+
/** Provider namespace. Defaults to INGEST to converge with transaction ingestion. */
|
|
2108
|
+
provider?: string;
|
|
2109
|
+
/** Provider-qualified identity type. Defaults to DEVICE. */
|
|
2110
|
+
type?: string;
|
|
2111
|
+
confidence?: number;
|
|
1366
2112
|
}
|
|
1367
2113
|
export interface RelatedTransactionDto {
|
|
1368
2114
|
/** Transaction ID of the related transaction. Use the same identifier format as `transactionId` (your external reference). */
|
|
@@ -1406,9 +2152,23 @@ export interface TaxIdentificationDto {
|
|
|
1406
2152
|
/** YYYY-MM-DD */
|
|
1407
2153
|
registrationDate?: string;
|
|
1408
2154
|
}
|
|
2155
|
+
/**
|
|
2156
|
+
* Ledger-line classification for an `ACCOUNT_ENTRY` transaction — a fee, an
|
|
2157
|
+
* interest movement, a payment, or an adjustment.
|
|
2158
|
+
*/
|
|
2159
|
+
export type AccountEntryType = 'MONTHLY_FEE' | 'WIRE_FEE' | 'OVERDRAFT_FEE' | 'LATE_PAYMENT_FEE' | 'ANNUAL_FEE' | 'ATM_FEE' | 'FOREIGN_TRANSACTION_FEE' | 'INTEREST_CHARGE' | 'INTEREST_PAYMENT' | 'PRINCIPAL_PAYMENT' | 'ESCROW_PAYMENT' | 'MINIMUM_PAYMENT' | 'STATEMENT_PAYMENT' | 'REWARD_REDEMPTION' | 'CASHBACK' | 'ADJUSTMENT' | 'CHARGEBACK' | 'PROMOTIONAL_CREDIT' | 'PENALTY' | 'REFUND';
|
|
1409
2160
|
export interface TransactionBodyDto {
|
|
1410
2161
|
/** Transaction kind discriminator. */
|
|
1411
2162
|
kind: 'TRANSFER' | 'ACCOUNT_ENTRY';
|
|
2163
|
+
/**
|
|
2164
|
+
* What kind of ledger line an `ACCOUNT_ENTRY` is — a fee, an interest
|
|
2165
|
+
* credit, an adjustment, and so on.
|
|
2166
|
+
*
|
|
2167
|
+
* Required when `kind` is `'ACCOUNT_ENTRY'`, ignored for `'TRANSFER'`. The
|
|
2168
|
+
* read model exposes it as non-nullable, so an account entry ingested
|
|
2169
|
+
* without one cannot be rendered.
|
|
2170
|
+
*/
|
|
2171
|
+
entryType?: AccountEntryType;
|
|
1412
2172
|
/** Two-level payment classification: closed category enum + open method string. */
|
|
1413
2173
|
mode: Record<string, unknown>;
|
|
1414
2174
|
/** Channel and session context for the transaction. */
|
|
@@ -1427,6 +2187,8 @@ export interface TransactionBodyDto {
|
|
|
1427
2187
|
reference?: string;
|
|
1428
2188
|
/** Free-text memo or note. */
|
|
1429
2189
|
memo?: string;
|
|
2190
|
+
/** Resource tags for this transaction, as catalogue values (slugs) or labels from the `txn.tags` tag catalogue (Settings → Tags). Stored on `transactions.tags`, read by rules as the `txn.tags` set field, and filterable inside aggregate brackets — e.g. `account.txn(24h).sum(amount)[tags IN (top-up)]`. Values not in the catalogue are rejected (HTTP 400). Tags are written at ingest only; status updates leave them unchanged. */
|
|
2191
|
+
tags?: string[];
|
|
1430
2192
|
/** IDs of related transactions (e.g. funding legs, reversals, fees). Useful when multiple transactions form a single logical transfer. */
|
|
1431
2193
|
relatedTransactions?: RelatedTransactionDto[];
|
|
1432
2194
|
/** Open per-transaction key/value bag stored on `transactions.metadata` and exposed to the rules engine as `txn.metadata.{key}`. Each value is either a **bare primitive** (string / number / boolean — coerced to `text` at ingest) or a **typed wrapper** `{ "type": "...", "value": ... }` so the evaluator can run typed comparisons. See spec evaluation/02 §1.M.
|
|
@@ -1483,10 +2245,30 @@ export interface UpdateCounterpartyDto {
|
|
|
1483
2245
|
institution?: InstitutionDetailsDto;
|
|
1484
2246
|
}
|
|
1485
2247
|
/** OpenAPI schema is empty; treated as an opaque key/value bag — narrow on the caller side. */
|
|
1486
|
-
export
|
|
2248
|
+
export interface UpdateCurrencyInput {
|
|
2249
|
+
name?: string;
|
|
2250
|
+
symbol?: string;
|
|
2251
|
+
/** Number of minor-unit decimal places (0–18). */
|
|
2252
|
+
precision?: number;
|
|
2253
|
+
isEnabled?: boolean;
|
|
2254
|
+
}
|
|
1487
2255
|
export interface UpdateDeviceTrustDto {
|
|
1488
2256
|
trustLevel: 'KNOWN' | 'NEW' | 'SUSPICIOUS';
|
|
1489
2257
|
}
|
|
2258
|
+
export interface MergeDeviceDto {
|
|
2259
|
+
sourceDeviceId: string;
|
|
2260
|
+
reason: string;
|
|
2261
|
+
}
|
|
2262
|
+
export interface DeviceMergeResponseDto {
|
|
2263
|
+
id: string;
|
|
2264
|
+
organizationId: string;
|
|
2265
|
+
sourceDeviceId: string;
|
|
2266
|
+
targetDeviceId: string;
|
|
2267
|
+
canonicalDeviceId: string;
|
|
2268
|
+
reason: string;
|
|
2269
|
+
mergedBy: Record<string, unknown>;
|
|
2270
|
+
mergedAt: string;
|
|
2271
|
+
}
|
|
1490
2272
|
export interface UpdateEntityDto {
|
|
1491
2273
|
legalName?: string;
|
|
1492
2274
|
tradingNames?: string[];
|
|
@@ -1495,6 +2277,8 @@ export interface UpdateEntityDto {
|
|
|
1495
2277
|
countryOfIncorporation?: string;
|
|
1496
2278
|
dateOfIncorporation?: string;
|
|
1497
2279
|
entityType?: string;
|
|
2280
|
+
/** Tax Identification Number (TIN). */
|
|
2281
|
+
taxId?: string;
|
|
1498
2282
|
/** Parent entity ID for subsidiaries */
|
|
1499
2283
|
parentEntityId?: string;
|
|
1500
2284
|
email?: string;
|
|
@@ -1520,8 +2304,22 @@ export interface UpdateEventDefinitionDto {
|
|
|
1520
2304
|
description?: string;
|
|
1521
2305
|
/** Event category. */
|
|
1522
2306
|
category?: string;
|
|
1523
|
-
/** Event
|
|
1524
|
-
|
|
2307
|
+
/** Event definition status. */
|
|
2308
|
+
status?: 'ACTIVE' | 'DEPRECATED' | 'DRAFT';
|
|
2309
|
+
/**
|
|
2310
|
+
* Resources this event names, each as SUBJECT (what an occurrence is
|
|
2311
|
+
* about) or CONTEXT (what it also references). Omit to accept any
|
|
2312
|
+
* attachable subject and expect no context.
|
|
2313
|
+
*/
|
|
2314
|
+
resources?: EventResourceDeclarationDto[];
|
|
2315
|
+
/** Event property schema. Same shape as `TypedFieldDefinition` (including `options` for select types). */
|
|
2316
|
+
properties?: TypedFieldDefinition[];
|
|
2317
|
+
/**
|
|
2318
|
+
* Risk Signals to emit on every valid occurrence of this event. Supplying
|
|
2319
|
+
* the array replaces the declared effects; signals already recorded keep
|
|
2320
|
+
* the weight and half-life snapshotted when they were created.
|
|
2321
|
+
*/
|
|
2322
|
+
riskSignalEffects?: RiskSignalEffect[];
|
|
1525
2323
|
}
|
|
1526
2324
|
export interface UpdateExpectedActivityDto {
|
|
1527
2325
|
expectedMonthlyTransactionCount: number;
|
|
@@ -1553,6 +2351,8 @@ export interface UpdateIndividualDto {
|
|
|
1553
2351
|
countryOfResidence?: string[];
|
|
1554
2352
|
/** Additional name variants the customer is known by. */
|
|
1555
2353
|
aliases?: string[];
|
|
2354
|
+
/** Tax Identification Number (TIN). */
|
|
2355
|
+
taxId?: string;
|
|
1556
2356
|
email?: string;
|
|
1557
2357
|
phone?: string;
|
|
1558
2358
|
identificationDocuments?: IdentificationDocumentDto[];
|
|
@@ -1616,10 +2416,14 @@ export interface UpdateProductDto {
|
|
|
1616
2416
|
/** Product description. */
|
|
1617
2417
|
description?: string;
|
|
1618
2418
|
/** Product status. */
|
|
1619
|
-
status?:
|
|
2419
|
+
status?: ProductStatus;
|
|
2420
|
+
/** Preferred product classification, governed by the `product.tags` catalogue. */
|
|
2421
|
+
tags?: TagValueInput[];
|
|
1620
2422
|
/** Supported transaction method IDs. */
|
|
1621
2423
|
supportedMethodIds?: string[];
|
|
1622
|
-
/**
|
|
2424
|
+
/** Account field template for accounts created from this product. */
|
|
2425
|
+
accountFieldConfig?: TypedFieldDefinition[];
|
|
2426
|
+
/** @deprecated Use `accountFieldConfig`. */
|
|
1623
2427
|
typedAccountFieldConfig?: TypedFieldDefinition[];
|
|
1624
2428
|
/** Product-level typed bag (Tier B, self-declaring). */
|
|
1625
2429
|
fields?: TypedFieldValueInput[];
|
|
@@ -1645,14 +2449,31 @@ export interface UpdateCustomerStatusResponse {
|
|
|
1645
2449
|
statusReason: string | null;
|
|
1646
2450
|
updatedAt: string;
|
|
1647
2451
|
}
|
|
2452
|
+
/** Body for archiving a customer (admin-only, irreversible). */
|
|
2453
|
+
export interface ArchiveCustomerDto {
|
|
2454
|
+
/** Audit reason for archiving the customer. */
|
|
2455
|
+
reason?: string;
|
|
2456
|
+
}
|
|
2457
|
+
export interface ArchiveCustomerResponse {
|
|
2458
|
+
customerId: string;
|
|
2459
|
+
/** When the customer was archived (ISO 8601). */
|
|
2460
|
+
archivedAt: string | null;
|
|
2461
|
+
/** The original (clean) external ID, preserved for audit. The live external ID is freed for reuse. */
|
|
2462
|
+
archivedExternalId: string | null;
|
|
2463
|
+
archivedReason: string | null;
|
|
2464
|
+
}
|
|
1648
2465
|
export interface UpdateRuleDto {
|
|
1649
2466
|
/** Rule name. */
|
|
1650
2467
|
name?: string;
|
|
1651
2468
|
/** Rule description. */
|
|
1652
2469
|
description?: string;
|
|
1653
|
-
/** Rule subject. */
|
|
2470
|
+
/** Rule subject: 'TRANSACTION' | 'EVENT' | 'CUSTOMER' | 'ALL'. */
|
|
1654
2471
|
subject?: string;
|
|
1655
|
-
/**
|
|
2472
|
+
/**
|
|
2473
|
+
* Rule trigger — see CreateRuleDto.trigger. The post-update
|
|
2474
|
+
* subject/trigger pair is validated, so patching only the trigger must
|
|
2475
|
+
* still be compatible with the rule's existing subject.
|
|
2476
|
+
*/
|
|
1656
2477
|
trigger?: string;
|
|
1657
2478
|
/** Rule severity. */
|
|
1658
2479
|
severity?: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
@@ -1663,9 +2484,18 @@ export interface UpdateRuleDto {
|
|
|
1663
2484
|
/** Condition tree. */
|
|
1664
2485
|
conditionTree?: Record<string, unknown>;
|
|
1665
2486
|
/** Actions to execute. */
|
|
1666
|
-
actions?:
|
|
2487
|
+
actions?: RuleAction[];
|
|
1667
2488
|
/** Window period. */
|
|
1668
2489
|
windowPeriod?: string;
|
|
2490
|
+
/**
|
|
2491
|
+
* Optional note recorded against the version this edit mints (audit trail).
|
|
2492
|
+
* Ignored if the edit changes no definitional field.
|
|
2493
|
+
*/
|
|
2494
|
+
changeNote?: string;
|
|
2495
|
+
/** Product applicability. Pass null or empty products to unscope. */
|
|
2496
|
+
scope?: {
|
|
2497
|
+
products?: string[];
|
|
2498
|
+
} | null;
|
|
1669
2499
|
}
|
|
1670
2500
|
export interface UpdateStakeholderDto {
|
|
1671
2501
|
name?: string;
|
|
@@ -1719,6 +2549,8 @@ export interface IngestTransactionResponse {
|
|
|
1719
2549
|
matches: IngestTransactionMatch[];
|
|
1720
2550
|
/** Server-side evaluation time in milliseconds. */
|
|
1721
2551
|
executionTimeMs: number;
|
|
2552
|
+
/** The stored transaction after resolution and evaluation — the same shape `transactions.get()` returns. */
|
|
2553
|
+
transaction?: TransactionResponseDto;
|
|
1722
2554
|
}
|
|
1723
2555
|
/** Async response (202) from POST /v1/transactions when accepted for background processing. */
|
|
1724
2556
|
export interface IngestTransactionAsyncResponse {
|
|
@@ -1726,12 +2558,44 @@ export interface IngestTransactionAsyncResponse {
|
|
|
1726
2558
|
id: string;
|
|
1727
2559
|
async: true;
|
|
1728
2560
|
status: 'ACCEPTED' | string;
|
|
2561
|
+
/** The stored transaction after resolution; evaluation has not run yet, so flags are not set. */
|
|
2562
|
+
transaction?: TransactionResponseDto;
|
|
1729
2563
|
}
|
|
1730
2564
|
export interface IngestEventResponse {
|
|
1731
|
-
/**
|
|
2565
|
+
/**
|
|
2566
|
+
* Echo of the request `eventId`; the database record ID when the
|
|
2567
|
+
* request carried none.
|
|
2568
|
+
*/
|
|
1732
2569
|
eventId: string;
|
|
2570
|
+
/** Database record ID for the ingested event. */
|
|
2571
|
+
id: string;
|
|
1733
2572
|
/** Echoed event type. */
|
|
1734
2573
|
type: string;
|
|
2574
|
+
/**
|
|
2575
|
+
* The Event Definition the type resolved to. `null` means the type has no
|
|
2576
|
+
* Definition: the occurrence is recorded, but nothing described it and no
|
|
2577
|
+
* Risk Signal fired for it — catch a typo here rather than by noticing the
|
|
2578
|
+
* absence of signals days later. A tenant that would rather the request
|
|
2579
|
+
* fail sets the `unknownEventTypes` behaviour setting to `REJECT`.
|
|
2580
|
+
*/
|
|
2581
|
+
definitionId: string | null;
|
|
2582
|
+
/**
|
|
2583
|
+
* The resolved primary resource the event was attached to. Echoed back
|
|
2584
|
+
* resolved, so a request that used the legacy `customerId` spelling reads
|
|
2585
|
+
* back as `{ type: 'CUSTOMER', id }`.
|
|
2586
|
+
*/
|
|
2587
|
+
resource: EventResourceRef;
|
|
2588
|
+
/**
|
|
2589
|
+
* Ids of the Risk Signals the event definition's `riskSignalEffects`
|
|
2590
|
+
* emitted for this occurrence. Empty when the definition declares none.
|
|
2591
|
+
*
|
|
2592
|
+
* The Event and its signals are written in one transaction, and a replay
|
|
2593
|
+
* echoes the signals the original ingestion produced — the event's
|
|
2594
|
+
* idempotency covers its Risk Signals too.
|
|
2595
|
+
*/
|
|
2596
|
+
riskSignalIds: string[];
|
|
2597
|
+
/** Present (true) when this request deduplicated against an already-stored event. */
|
|
2598
|
+
cached?: boolean;
|
|
1735
2599
|
}
|
|
1736
2600
|
export interface CursorPaginationQuery {
|
|
1737
2601
|
cursor?: string;
|
|
@@ -1745,6 +2609,10 @@ export interface ListCurrenciesQuery {
|
|
|
1745
2609
|
export interface SyncKeyQuery {
|
|
1746
2610
|
syncKey?: string;
|
|
1747
2611
|
}
|
|
2612
|
+
export interface ListConstantsQuery extends SyncKeyQuery {
|
|
2613
|
+
/** Restrict to product-bound `$account.*` definitions for this product. */
|
|
2614
|
+
productId?: string;
|
|
2615
|
+
}
|
|
1748
2616
|
export interface DeleteConstantQuery {
|
|
1749
2617
|
force?: boolean;
|
|
1750
2618
|
reason?: string;
|
|
@@ -1799,17 +2667,496 @@ export interface PlatformUploadUrlResponseDto {
|
|
|
1799
2667
|
/** Response shape for `POST /v1/platform/v1/files/confirm` — typically `{ fileId, downloadUrl, ... }`. */
|
|
1800
2668
|
export type PlatformConfirmUploadResponseDto = OpaqueResponse;
|
|
1801
2669
|
export type StakeholderResponseDto = OpaqueResponse;
|
|
1802
|
-
export
|
|
1803
|
-
|
|
2670
|
+
export interface DevicePublicBrowserDetailsDto {
|
|
2671
|
+
browserName: string;
|
|
2672
|
+
browserMajorVersion: string;
|
|
2673
|
+
browserFullVersion: string;
|
|
2674
|
+
os: 'WINDOWS' | 'MACOS' | 'LINUX' | 'IOS' | 'ANDROID' | 'OTHER';
|
|
2675
|
+
osVersion: string;
|
|
2676
|
+
device: 'DESKTOP' | 'MOBILE' | 'TABLET' | 'UNKNOWN';
|
|
2677
|
+
userAgent: string;
|
|
2678
|
+
}
|
|
2679
|
+
export interface DeviceGeolocationDto {
|
|
2680
|
+
country: string;
|
|
2681
|
+
city: string;
|
|
2682
|
+
/** The observed point. Same numbers as `latitude`/`longitude`, kept paired. */
|
|
2683
|
+
coordinates: CoordinatesDto;
|
|
2684
|
+
latitude: number;
|
|
2685
|
+
longitude: number;
|
|
2686
|
+
timezone: string;
|
|
2687
|
+
accuracyRadius: number;
|
|
2688
|
+
continent?: string;
|
|
2689
|
+
postalCode?: string;
|
|
2690
|
+
}
|
|
2691
|
+
export interface DeviceVpnDetectionMethodsDto {
|
|
2692
|
+
timezoneMismatch: boolean;
|
|
2693
|
+
publicVPN: boolean;
|
|
2694
|
+
auxiliaryMobile: boolean;
|
|
2695
|
+
relay: boolean;
|
|
2696
|
+
}
|
|
2697
|
+
export interface DeviceVpnDetectionDto {
|
|
2698
|
+
result: boolean;
|
|
2699
|
+
confidence: number;
|
|
2700
|
+
originTimezone: string;
|
|
2701
|
+
originCountry: string;
|
|
2702
|
+
methods: DeviceVpnDetectionMethodsDto;
|
|
2703
|
+
}
|
|
2704
|
+
export interface DeviceIpSessionDto {
|
|
2705
|
+
geolocation: DeviceGeolocationDto;
|
|
2706
|
+
vpn: DeviceVpnDetectionDto;
|
|
2707
|
+
isProxy: boolean;
|
|
2708
|
+
isTor: boolean;
|
|
2709
|
+
incognito: boolean;
|
|
2710
|
+
seenAt: string;
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* A customer linked to a device.
|
|
2714
|
+
*
|
|
2715
|
+
* The dates are the link's own, not the device's: on a device used by more than
|
|
2716
|
+
* one customer they say who had it when.
|
|
2717
|
+
*/
|
|
2718
|
+
export interface DeviceCustomerLinkDto {
|
|
2719
|
+
customerId: string;
|
|
2720
|
+
name?: string | null;
|
|
2721
|
+
/** INDIVIDUAL or ENTITY. */
|
|
2722
|
+
type?: string | null;
|
|
2723
|
+
status?: string | null;
|
|
2724
|
+
riskRating?: string | null;
|
|
2725
|
+
externalId?: string | null;
|
|
2726
|
+
firstSeenAt: string;
|
|
2727
|
+
lastSeenAt: string;
|
|
2728
|
+
}
|
|
2729
|
+
/** Safe canonical Device response. It never contains raw fingerprint or IP identity values. */
|
|
2730
|
+
export interface DeviceResponseDto {
|
|
2731
|
+
id: string;
|
|
2732
|
+
requestId?: string | null;
|
|
2733
|
+
browserDetails: DevicePublicBrowserDetailsDto;
|
|
2734
|
+
ipSessions: DeviceIpSessionDto[];
|
|
2735
|
+
botProbability: number;
|
|
2736
|
+
confidence: number;
|
|
2737
|
+
trustLevel: 'KNOWN' | 'NEW' | 'SUSPICIOUS';
|
|
2738
|
+
firstSeenAt: string;
|
|
2739
|
+
lastSeenAt: string;
|
|
2740
|
+
/**
|
|
2741
|
+
* Every customer linked to this device. Returned by `GET /devices/{id}`;
|
|
2742
|
+
* absent on endpoints that list devices in bulk.
|
|
2743
|
+
*/
|
|
2744
|
+
customers?: DeviceCustomerLinkDto[];
|
|
2745
|
+
}
|
|
2746
|
+
/** @deprecated Customer Device endpoints now return the canonical Device response. */
|
|
2747
|
+
export type DeviceSummaryDto = DeviceResponseDto;
|
|
1804
2748
|
export type CustomerRiskAssessmentResponseDto = OpaqueResponse;
|
|
1805
2749
|
export type RiskAssessmentResponseDto = OpaqueResponse;
|
|
1806
2750
|
export type ExpectedActivityResponseDto = OpaqueResponse;
|
|
1807
2751
|
export type ScreeningResultDto = OpaqueResponse;
|
|
1808
2752
|
export type ConfirmedMatchDto = OpaqueResponse;
|
|
1809
|
-
|
|
2753
|
+
/**
|
|
2754
|
+
* The screening provider's automated false-positive assessment of a weak
|
|
2755
|
+
* match — why the match is, or is not, the customer, decided from date of
|
|
2756
|
+
* birth, geography, role timeline and entity kind rather than from the name.
|
|
2757
|
+
*
|
|
2758
|
+
* Present only where the provider ran it: the customer record carried
|
|
2759
|
+
* attributes to compare against. Absence is not an implied `retain`.
|
|
2760
|
+
*
|
|
2761
|
+
* A `decision` of `discard` sets the match's `disposition` to
|
|
2762
|
+
* `FALSE_POSITIVE` with no human involved — so whenever you see a disposition
|
|
2763
|
+
* none of your users set, `rationale` is the reason.
|
|
2764
|
+
*/
|
|
2765
|
+
export interface MatchDisambiguationDto {
|
|
2766
|
+
/**
|
|
2767
|
+
* `discard` where an attribute positively contradicts identity — this is
|
|
2768
|
+
* what auto-dispositions the match. `retain` is the default and is not a
|
|
2769
|
+
* confirmation, only the absence of grounds to eliminate.
|
|
2770
|
+
*/
|
|
2771
|
+
decision?: 'discard' | 'retain';
|
|
2772
|
+
/**
|
|
2773
|
+
* How to queue the match. `likely_false_positive` means the evidence
|
|
2774
|
+
* pointed that way but did not clear the provider's confidence floor —
|
|
2775
|
+
* deprioritise, do not dismiss.
|
|
2776
|
+
*/
|
|
2777
|
+
dispositionHint?: 'false_positive' | 'likely_false_positive' | 'needs_review' | 'possible_match';
|
|
2778
|
+
/** Confidence in the verdict. A `discard` is only ever emitted at `high`. */
|
|
2779
|
+
confidence?: 'high' | 'medium' | 'low';
|
|
2780
|
+
/**
|
|
2781
|
+
* `hard` for a date-of-birth contradiction, an entity-type mismatch, an
|
|
2782
|
+
* implausible age for the role timeline, or a nationality conflict;
|
|
2783
|
+
* `soft` for jurisdiction or residence geography and gender. A sanctions
|
|
2784
|
+
* listing is never discarded on soft evidence alone.
|
|
2785
|
+
*/
|
|
2786
|
+
contradictionStrength?: 'hard' | 'soft' | 'none';
|
|
2787
|
+
/**
|
|
2788
|
+
* The rules that fired, from the provider's closed vocabulary — e.g.
|
|
2789
|
+
* `DOB_CONTRADICTION`, `AGE_IMPLAUSIBLE_FOR_ROLE_TIMELINE`,
|
|
2790
|
+
* `ENTITY_TYPE_MISMATCH`, `NATIONALITY_CONFLICT`, `INSUFFICIENT_DATA_TO_ELIMINATE`.
|
|
2791
|
+
*/
|
|
2792
|
+
reasonCodes?: string[];
|
|
2793
|
+
/**
|
|
2794
|
+
* One to three sentences naming the field values compared — the audit
|
|
2795
|
+
* answer to "why was this match eliminated".
|
|
2796
|
+
*/
|
|
2797
|
+
rationale?: string;
|
|
2798
|
+
}
|
|
2799
|
+
/**
|
|
2800
|
+
* A single screening match for a customer, read live with its current
|
|
2801
|
+
* disposition. Returned by `GET /v1/customers/{customerId}/screening-results`
|
|
2802
|
+
* — the full true-positive (`CONFIRMED`) / false-positive (`FALSE_POSITIVE`) /
|
|
2803
|
+
* unresolved (`PENDING`) picture. Confirmed and false-positive matches persist
|
|
2804
|
+
* across re-screens.
|
|
2805
|
+
*/
|
|
2806
|
+
export interface ScreeningMatchResultDto {
|
|
2807
|
+
/** Match record ID. */
|
|
2808
|
+
id: string;
|
|
2809
|
+
matchType: 'WATCHLIST' | 'HIGH_RISK' | 'CUSTOM_LIST';
|
|
2810
|
+
disposition: 'PENDING' | 'CONFIRMED' | 'FALSE_POSITIVE';
|
|
2811
|
+
/** Matched entity name. */
|
|
2812
|
+
matchedName: string;
|
|
2813
|
+
/** List/source label, e.g. `OFAC SDN` (high-risk → `High Risk`, custom list → list name). */
|
|
2814
|
+
source?: string;
|
|
2815
|
+
/** For CUSTOM_LIST matches: the list's current tags. */
|
|
2816
|
+
listTags?: Array<{
|
|
2817
|
+
value: string;
|
|
2818
|
+
label: string;
|
|
2819
|
+
}>;
|
|
2820
|
+
/**
|
|
2821
|
+
* Short role/bio line. Populated for `HIGH_RISK` (PEP) matches when the
|
|
2822
|
+
* provider supplies one; always present and `""` otherwise — never omitted
|
|
2823
|
+
* or null, so it can be read without a presence check.
|
|
2824
|
+
*/
|
|
2825
|
+
tagline: string;
|
|
2826
|
+
/** General free-text profile summary (composed by the screening provider). */
|
|
2827
|
+
summary?: string;
|
|
2828
|
+
/** Provider match confidence, 0–1. */
|
|
2829
|
+
matchConfidence?: number;
|
|
2830
|
+
/** ISO-8601 timestamp the disposition was set. */
|
|
2831
|
+
resolvedAt?: string;
|
|
2832
|
+
/** Who set the disposition. */
|
|
2833
|
+
resolvedBy?: Record<string, unknown>;
|
|
2834
|
+
/**
|
|
2835
|
+
* The provider's automated false-positive assessment, where it ran. When
|
|
2836
|
+
* `disposition` is `FALSE_POSITIVE` and `resolvedBy` is the screening
|
|
2837
|
+
* service rather than one of your users, this is why.
|
|
2838
|
+
*/
|
|
2839
|
+
disambiguation?: MatchDisambiguationDto;
|
|
2840
|
+
}
|
|
2841
|
+
/**
|
|
2842
|
+
* A single screening run from
|
|
2843
|
+
* `GET /v1/customers/{customerId}/screening-history[/latest]`. One entry per
|
|
2844
|
+
* time the customer was screened (initial, ongoing, manual, event-triggered).
|
|
2845
|
+
*/
|
|
2846
|
+
export interface ScreeningHistoryEntryDto {
|
|
2847
|
+
/** Screening log entry ID. */
|
|
2848
|
+
id: string;
|
|
2849
|
+
customerId: string;
|
|
2850
|
+
customerName: string;
|
|
2851
|
+
/** What triggered the screening, e.g. `INITIAL` | `ONGOING` | `MANUAL` | `EVENT_TRIGGERED`. */
|
|
2852
|
+
screeningType: string;
|
|
2853
|
+
/** Run status, e.g. `COMPLETED` | `PENDING` | `FAILED`. */
|
|
2854
|
+
status: string;
|
|
2855
|
+
/** Total matches surfaced across all sources. */
|
|
2856
|
+
matchesFound: number;
|
|
2857
|
+
/** Number of alerts raised from this screening. */
|
|
2858
|
+
alertsGenerated: number;
|
|
2859
|
+
/** Watchlist matches suppressed by whitelisting/dispositions. */
|
|
2860
|
+
suppressedWatchlistCount: number;
|
|
2861
|
+
/** High-risk/PEP matches suppressed by whitelisting/dispositions. */
|
|
2862
|
+
suppressedHighRiskCount: number;
|
|
2863
|
+
/** Custom-list matches suppressed by prior false-positive dispositions. */
|
|
2864
|
+
suppressedCustomListCount: number;
|
|
2865
|
+
/** Which checks were run, e.g. `['WATCHLIST', 'HIGH_RISK', 'CUSTOM_LIST']`. */
|
|
2866
|
+
checksRun: string[];
|
|
2867
|
+
/** ISO-8601 timestamp the screening was initiated. */
|
|
2868
|
+
createdAt: string;
|
|
2869
|
+
/** ISO-8601 timestamp the screening finished, if completed. */
|
|
2870
|
+
completedAt?: string;
|
|
2871
|
+
[key: string]: unknown;
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Options for `individuals.create` / `entities.create`.
|
|
2875
|
+
*/
|
|
2876
|
+
export interface CreateCustomerOptions {
|
|
2877
|
+
/**
|
|
2878
|
+
* How the INITIAL screening runs. `async` (default) queues it and the
|
|
2879
|
+
* call returns at once — poll `customers.screening.history` /
|
|
2880
|
+
* `listResults`, or listen for the screening webhooks. `sync` runs it
|
|
2881
|
+
* before responding and returns the run and its matches under
|
|
2882
|
+
* `screening` on the response.
|
|
2883
|
+
*/
|
|
2884
|
+
screening?: 'async' | 'sync';
|
|
2885
|
+
}
|
|
2886
|
+
/**
|
|
2887
|
+
* Outcome of the INITIAL screening run performed inline by
|
|
2888
|
+
* `individuals.create(input, { screening: 'sync' })` and the entities twin.
|
|
2889
|
+
*/
|
|
2890
|
+
export interface InitialScreeningResultDto {
|
|
2891
|
+
/** Screening log entry ID — the same id `screening.history` returns. */
|
|
2892
|
+
id: string;
|
|
2893
|
+
/** Always `INITIAL` for a create-time run. */
|
|
2894
|
+
screeningType: string;
|
|
2895
|
+
/**
|
|
2896
|
+
* `COMPLETED` when every configured check ran. `FAILED` when no provider
|
|
2897
|
+
* is configured or every provider failed — the customer still exists;
|
|
2898
|
+
* rerun with `customers.screening.trigger(customerId)`.
|
|
2899
|
+
*/
|
|
2900
|
+
status: 'COMPLETED' | 'FAILED';
|
|
2901
|
+
/** Why the run FAILED, e.g. `no_providers_configured`, `all_providers_failed`. */
|
|
2902
|
+
statusReason?: string;
|
|
2903
|
+
/** Which checks actually ran, e.g. `['WATCHLIST', 'HIGH_RISK', 'CUSTOM_LIST']`. */
|
|
2904
|
+
checksRun: string[];
|
|
2905
|
+
/** Total matches surfaced across all sources, including auto-dismissed ones. */
|
|
2906
|
+
matchesFound: number;
|
|
2907
|
+
/** Number of alerts raised from this screening (0 or 1). */
|
|
2908
|
+
alertsGenerated: number;
|
|
2909
|
+
/** The screening alert holding these matches, when any were found. Absent on a clear run. */
|
|
2910
|
+
alertId?: string;
|
|
2911
|
+
/**
|
|
2912
|
+
* Matches the provider's attribute assessment eliminated as false
|
|
2913
|
+
* positives. Still counted in `matchesFound` and listed in `matches`
|
|
2914
|
+
* with disposition `FALSE_POSITIVE`.
|
|
2915
|
+
*/
|
|
2916
|
+
autoDismissedMatchCount: number;
|
|
2917
|
+
/** True when every match was auto-dismissed and the alert closed itself. */
|
|
2918
|
+
alertAutoClosed: boolean;
|
|
2919
|
+
/** ISO-8601 timestamp the screening was initiated. */
|
|
2920
|
+
createdAt: string;
|
|
2921
|
+
/** ISO-8601 timestamp the screening finished. */
|
|
2922
|
+
completedAt?: string;
|
|
2923
|
+
/**
|
|
2924
|
+
* Every match this run surfaced, with its disposition — the same shape
|
|
2925
|
+
* as `customers.screening.listResults`. Empty on a clear or FAILED run.
|
|
2926
|
+
*/
|
|
2927
|
+
matches: ScreeningMatchResultDto[];
|
|
2928
|
+
}
|
|
2929
|
+
/**
|
|
2930
|
+
* `individuals.create` response. Identical to `IndividualResponseDto` unless
|
|
2931
|
+
* the call used `{ screening: 'sync' }`, in which case `screening` carries
|
|
2932
|
+
* the INITIAL run's outcome and matches.
|
|
2933
|
+
*/
|
|
2934
|
+
export interface IndividualCreatedResponseDto extends IndividualResponseDto {
|
|
2935
|
+
screening?: InitialScreeningResultDto;
|
|
2936
|
+
}
|
|
2937
|
+
/** `entities.create` response — see `IndividualCreatedResponseDto`. */
|
|
2938
|
+
export interface EntityCreatedResponseDto extends EntityResponseDto {
|
|
2939
|
+
screening?: InitialScreeningResultDto;
|
|
2940
|
+
}
|
|
2941
|
+
/** KYC verification status, mirroring the backend `KYCVerificationStatus` enum. */
|
|
2942
|
+
export type KycVerificationStatus = 'VERIFIED' | 'FAILED' | 'PENDING' | 'EXPIRED';
|
|
2943
|
+
/**
|
|
2944
|
+
* Result of starting a KYC session
|
|
2945
|
+
* (`POST /v1/customers/{customerId}/kyc/sessions`). Hand `sessionUrl` to the
|
|
2946
|
+
* customer to complete verification.
|
|
2947
|
+
*/
|
|
2948
|
+
export interface StartKycSessionResponseDto {
|
|
2949
|
+
/** Local KYC session id. */
|
|
2950
|
+
sessionId: string;
|
|
2951
|
+
/** The provider's own session id. */
|
|
2952
|
+
providerSessionId: string;
|
|
2953
|
+
/** Hosted URL the customer visits to complete verification. */
|
|
2954
|
+
sessionUrl: string;
|
|
2955
|
+
status: KycVerificationStatus;
|
|
2956
|
+
/** ISO-8601 expiry, or null. */
|
|
2957
|
+
expiresAt?: string | null;
|
|
2958
|
+
/** ISO-8601 creation time. */
|
|
2959
|
+
createdAt: string;
|
|
2960
|
+
}
|
|
2961
|
+
/**
|
|
2962
|
+
* A persisted KYC session, returned by
|
|
2963
|
+
* `GET /v1/customers/{customerId}/kyc/sessions` and the refresh endpoint.
|
|
2964
|
+
*/
|
|
2965
|
+
export interface KycSessionDto {
|
|
2966
|
+
id: string;
|
|
2967
|
+
customerId: string;
|
|
2968
|
+
status: KycVerificationStatus;
|
|
2969
|
+
/** Which provider ran the session, e.g. `dossiers`. */
|
|
2970
|
+
provider?: string | null;
|
|
2971
|
+
/** Hosted URL the customer visits to complete verification. */
|
|
2972
|
+
sessionUrl?: string | null;
|
|
2973
|
+
/** Per-step verification progress (provider-normalized). */
|
|
2974
|
+
steps: Record<string, unknown>[];
|
|
2975
|
+
/** Verified identity documents (provider-normalized). */
|
|
2976
|
+
documents: Record<string, unknown>[];
|
|
2977
|
+
overallResult?: string | null;
|
|
2978
|
+
/** ISO-8601 expiry, or null. */
|
|
2979
|
+
expiresAt?: string | null;
|
|
2980
|
+
/** ISO-8601 creation time. */
|
|
2981
|
+
createdAt: string;
|
|
2982
|
+
/** ISO-8601 completion time, if completed. */
|
|
2983
|
+
completedAt?: string | null;
|
|
2984
|
+
[key: string]: unknown;
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* A saved rule as returned by the Config — Rules API
|
|
2988
|
+
* (`POST`/`GET`/`PATCH /v1/config/rules[/:id]`). Mirrors the backend
|
|
2989
|
+
* `RULE_SCHEMA`.
|
|
2990
|
+
*/
|
|
2991
|
+
export interface RuleResponseDto {
|
|
2992
|
+
id: string;
|
|
2993
|
+
name: string;
|
|
2994
|
+
description?: string;
|
|
2995
|
+
/** Rule subject: 'TRANSACTION' | 'EVENT' | 'CUSTOMER' | 'ALL'. */
|
|
2996
|
+
subject: string;
|
|
2997
|
+
/** Rule trigger — see CreateRuleDto.trigger. */
|
|
2998
|
+
trigger: string;
|
|
2999
|
+
severity: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
3000
|
+
status: 'DRAFT' | 'ACTIVE' | 'DISABLED';
|
|
3001
|
+
tags: string[];
|
|
3002
|
+
/** Condition tree (AND/OR logic with leaf conditions). */
|
|
3003
|
+
conditionTree: Record<string, unknown>;
|
|
3004
|
+
/** Actions to execute when the rule triggers. */
|
|
3005
|
+
actions: Record<string, unknown>[];
|
|
3006
|
+
/** Window period for aggregate conditions. */
|
|
3007
|
+
windowPeriod?: string;
|
|
3008
|
+
/** Sync key for config-as-code management. */
|
|
3009
|
+
syncKey?: string;
|
|
3010
|
+
isSystemRule: boolean;
|
|
3011
|
+
/** Product applicability. Null / empty products = unscoped. */
|
|
3012
|
+
scope?: {
|
|
3013
|
+
products?: string[];
|
|
3014
|
+
} | null;
|
|
3015
|
+
createdAt: string;
|
|
3016
|
+
updatedAt: string;
|
|
3017
|
+
}
|
|
3018
|
+
/**
|
|
3019
|
+
* A single immutable rule version snapshot from
|
|
3020
|
+
* GET /v1/config/rules/{id}/versions[/{version}]. Carries the definitional
|
|
3021
|
+
* fields plus audit metadata (version, changeKind, changeNote, actor, createdAt).
|
|
3022
|
+
*/
|
|
3023
|
+
export type RuleVersionResponseDto = OpaqueResponse;
|
|
3024
|
+
/** Response from GET /v1/config/rules/:id/analytics — disposition breakdown + precision (#42). */
|
|
3025
|
+
export type RuleAnalyticsResponseDto = OpaqueResponse;
|
|
3026
|
+
/** Input for POST /v1/config/rules/backtest (spec v0 rules §11 + synthetic source). */
|
|
3027
|
+
export interface SimulateRulesDto {
|
|
3028
|
+
/** Default HISTORICAL. */
|
|
3029
|
+
source?: 'HISTORICAL' | 'SYNTHETIC';
|
|
3030
|
+
/** Existing rules to simulate; conditionTreeOverride A/B-tests changes without saving. */
|
|
3031
|
+
rules?: Array<{
|
|
3032
|
+
ruleId: string;
|
|
3033
|
+
conditionTreeOverride?: Record<string, unknown>;
|
|
3034
|
+
}>;
|
|
3035
|
+
/** Inline unsaved rules — evaluated only for this run. */
|
|
3036
|
+
adHocRules?: Array<{
|
|
3037
|
+
name: string;
|
|
3038
|
+
severity: string;
|
|
3039
|
+
conditionTree: Record<string, unknown>;
|
|
3040
|
+
}>;
|
|
3041
|
+
period: {
|
|
3042
|
+
from: string;
|
|
3043
|
+
to: string;
|
|
3044
|
+
};
|
|
3045
|
+
filters?: {
|
|
3046
|
+
customerIds?: string[];
|
|
3047
|
+
accountIds?: string[];
|
|
3048
|
+
modeCategories?: string[];
|
|
3049
|
+
minAmountMinor?: number;
|
|
3050
|
+
};
|
|
3051
|
+
/** Cap on transactions evaluated (default 5000, max 100000). */
|
|
3052
|
+
maxTransactions?: number;
|
|
3053
|
+
/** Generator parameters (SYNTHETIC source only). */
|
|
3054
|
+
synthetic?: {
|
|
3055
|
+
count?: number;
|
|
3056
|
+
customerIds?: string[];
|
|
3057
|
+
minAmountMinor?: number;
|
|
3058
|
+
maxAmountMinor?: number;
|
|
3059
|
+
modeCategories?: string[];
|
|
3060
|
+
directions?: string[];
|
|
3061
|
+
/**
|
|
3062
|
+
* Event occurrences to generate across the period (default one per 20
|
|
3063
|
+
* transactions, max 500). Events that typically precede activity pull a
|
|
3064
|
+
* run of transactions in behind them.
|
|
3065
|
+
*/
|
|
3066
|
+
eventCount?: number;
|
|
3067
|
+
/** Event Definition names to draw from. Default: the org's active definitions. */
|
|
3068
|
+
eventTypes?: string[];
|
|
3069
|
+
};
|
|
3070
|
+
includeMatches?: boolean;
|
|
3071
|
+
}
|
|
3072
|
+
/** Dry-run simulation report — nothing was persisted, no actions executed. */
|
|
3073
|
+
export interface SimulationReportDto {
|
|
3074
|
+
simulationId: string;
|
|
3075
|
+
source: 'HISTORICAL' | 'SYNTHETIC';
|
|
3076
|
+
dryRun: true;
|
|
3077
|
+
periodFrom: string;
|
|
3078
|
+
periodTo: string;
|
|
3079
|
+
transactionsEvaluated: number;
|
|
3080
|
+
totalMatches: number;
|
|
3081
|
+
executionTimeMs: number;
|
|
3082
|
+
/** Tenant base currency (TYPE:CODE) that per-rule matched volumes are denominated in. */
|
|
3083
|
+
baseCurrency: string;
|
|
3084
|
+
byRule: Array<{
|
|
3085
|
+
ruleId: string;
|
|
3086
|
+
ruleName: string;
|
|
3087
|
+
severity: string;
|
|
3088
|
+
matchCount: number;
|
|
3089
|
+
distinctCustomers: number;
|
|
3090
|
+
distinctAccounts: number;
|
|
3091
|
+
totalMatchedVolumeMinor: number;
|
|
3092
|
+
matches: Array<{
|
|
3093
|
+
transactionId: string;
|
|
3094
|
+
/** Internal transactions.id — null for synthetic rows (nothing stored). */
|
|
3095
|
+
transactionDbId: string | null;
|
|
3096
|
+
customerId: string | null;
|
|
3097
|
+
bookedAt: string;
|
|
3098
|
+
baseAmountMinor: number | null;
|
|
3099
|
+
/** Currency of `baseAmountMinor` (TYPE:CODE) — pair these when formatting. */
|
|
3100
|
+
baseCurrency: string | null;
|
|
3101
|
+
/** Minor-unit precision of `baseCurrency`. */
|
|
3102
|
+
basePrecision: number | null;
|
|
3103
|
+
originCurrency: string | null;
|
|
3104
|
+
flagReasons: string[];
|
|
3105
|
+
wouldHaveExecuted: Array<Record<string, unknown>>;
|
|
3106
|
+
/** Full transaction snapshot (mode, status, monetary legs, parties, metadata). */
|
|
3107
|
+
transactionDetail: Record<string, unknown>;
|
|
3108
|
+
}>;
|
|
3109
|
+
}>;
|
|
3110
|
+
/** Synthetic Events generated for the period, and the activity behind them. */
|
|
3111
|
+
syntheticEvents: Array<{
|
|
3112
|
+
/** Event Definition name the occurrences were generated from. */
|
|
3113
|
+
type: string;
|
|
3114
|
+
count: number;
|
|
3115
|
+
/** Synthetic transactions clustered in the window behind these events. */
|
|
3116
|
+
followedByTransactions: number;
|
|
3117
|
+
}>;
|
|
3118
|
+
coverageGaps: string[];
|
|
3119
|
+
warnings: string[];
|
|
3120
|
+
}
|
|
1810
3121
|
export type ConstantResponseDto = OpaqueResponse;
|
|
1811
|
-
export
|
|
1812
|
-
|
|
3122
|
+
export interface ProductResponseDto {
|
|
3123
|
+
id: string;
|
|
3124
|
+
externalId: string;
|
|
3125
|
+
name: string;
|
|
3126
|
+
description?: string | null;
|
|
3127
|
+
category: AccountCategory;
|
|
3128
|
+
tags: TagValue[];
|
|
3129
|
+
/** @deprecated Use `tags`. Retained for API compatibility. */
|
|
3130
|
+
baseType: AccountType;
|
|
3131
|
+
status: ProductStatus;
|
|
3132
|
+
defaultCurrency: string;
|
|
3133
|
+
/** @deprecated Use `tags` when product classification is needed. */
|
|
3134
|
+
country?: string | null;
|
|
3135
|
+
supportedMethodIds: string[];
|
|
3136
|
+
accountFieldConfig?: TypedFieldDefinition[];
|
|
3137
|
+
/** @deprecated Use `accountFieldConfig`. */
|
|
3138
|
+
typedAccountFieldConfig?: TypedFieldDefinition[];
|
|
3139
|
+
fields?: TypedFieldValueInput[];
|
|
3140
|
+
otherProperties?: UntypedKeyValueInput[];
|
|
3141
|
+
syncKey?: string | null;
|
|
3142
|
+
createdAt: string;
|
|
3143
|
+
updatedAt: string;
|
|
3144
|
+
}
|
|
3145
|
+
export interface CurrencyResponseDto {
|
|
3146
|
+
id: string;
|
|
3147
|
+
type: CurrencyType;
|
|
3148
|
+
code: string;
|
|
3149
|
+
/** Composite identifier in TYPE:CODE form (e.g. FIAT:USD). */
|
|
3150
|
+
currencyId: string;
|
|
3151
|
+
/** Number of minor-unit decimal places. */
|
|
3152
|
+
precision: number;
|
|
3153
|
+
name: string;
|
|
3154
|
+
symbol: string;
|
|
3155
|
+
isEnabled: boolean;
|
|
3156
|
+
isCustom: boolean;
|
|
3157
|
+
createdAt: string;
|
|
3158
|
+
updatedAt: string;
|
|
3159
|
+
}
|
|
1813
3160
|
export type EventDefinitionResponseDto = OpaqueResponse;
|
|
1814
3161
|
export type WebhookResponseDto = OpaqueResponse;
|
|
1815
3162
|
export interface SyncSnapshotActor {
|
|
@@ -1850,9 +3197,84 @@ export interface SyncConfig {
|
|
|
1850
3197
|
rules?: Record<string, SyncRuleConfig>;
|
|
1851
3198
|
/** Keyed by TYPE:CODE (e.g. "FIAT:USD", "CRYPTO:BTC"). */
|
|
1852
3199
|
currencies?: Record<string, SyncCurrencyConfig>;
|
|
3200
|
+
/**
|
|
3201
|
+
* Tag catalogue vocabulary — keyed by `<fieldKey>:<value>` (e.g.
|
|
3202
|
+
* "rule.tags:high-risk"). Unlike the other sections, an ABSENT section is
|
|
3203
|
+
* "unmanaged", not "empty": omitting it never retires live tags.
|
|
3204
|
+
*/
|
|
3205
|
+
tagCatalogue?: Record<string, SyncTagCatalogueEntryConfig>;
|
|
3206
|
+
/**
|
|
3207
|
+
* Tag groups — keyed `<fieldKey>:<groupValue>` (e.g.
|
|
3208
|
+
* "customer.tags:primary-branch"). Same "absent means unmanaged" rule as
|
|
3209
|
+
* `tagCatalogue`, and applied BEFORE it so a namespaced tag can resolve
|
|
3210
|
+
* the group that owns it.
|
|
3211
|
+
*/
|
|
3212
|
+
tagGroups?: Record<string, SyncTagGroupConfig>;
|
|
3213
|
+
/**
|
|
3214
|
+
* @deprecated Retired. Assignment policies were replaced by alert
|
|
3215
|
+
* workflows; the server rejects a bundle whose `assignmentPolicies`
|
|
3216
|
+
* section is non-empty. Configure stage assignment through
|
|
3217
|
+
* `config.alertWorkflows` instead.
|
|
3218
|
+
*/
|
|
3219
|
+
assignmentPolicies?: Record<string, SyncAssignmentPolicyConfig>;
|
|
3220
|
+
/**
|
|
3221
|
+
* Tenant-wide attempt retention/coverage. Absent means unmanaged and
|
|
3222
|
+
* supplied fields update only those values.
|
|
3223
|
+
*/
|
|
3224
|
+
behaviorSettings?: SyncBehaviorSettingsConfig;
|
|
1853
3225
|
customerFieldPolicy?: Record<string, SyncCustomerFieldPolicyConfig>;
|
|
1854
3226
|
accountStatusPolicy?: SyncAccountStatusPolicyConfig;
|
|
1855
3227
|
}
|
|
3228
|
+
export interface SyncBehaviorSettingsConfig {
|
|
3229
|
+
attemptRetentionDays?: number;
|
|
3230
|
+
attemptCoverage?: 'ALL' | 'SELECTIVE';
|
|
3231
|
+
unknownEventTypes?: 'ACCEPT' | 'REJECT';
|
|
3232
|
+
}
|
|
3233
|
+
/**
|
|
3234
|
+
* Assignment policy (screening-alert auto-assignment routing). Targets are
|
|
3235
|
+
* org-local better-auth user ids / domain team uuids, validated against
|
|
3236
|
+
* membership on apply.
|
|
3237
|
+
*
|
|
3238
|
+
* @deprecated Retired with `SyncConfig.assignmentPolicies`; the server
|
|
3239
|
+
* rejects a non-empty section. Use `config.alertWorkflows`.
|
|
3240
|
+
*/
|
|
3241
|
+
export interface SyncAssignmentPolicyConfig {
|
|
3242
|
+
name: string;
|
|
3243
|
+
description?: string;
|
|
3244
|
+
/** Default true. */
|
|
3245
|
+
enabled?: boolean;
|
|
3246
|
+
/** Evaluation order, ascending. First match wins. Must be unique per config. */
|
|
3247
|
+
priority: number;
|
|
3248
|
+
/** Qualifier tree; `{logic:'AND', conditions:[]}` = catch-all. */
|
|
3249
|
+
conditionTree: AssignmentPolicyConditionGroup;
|
|
3250
|
+
/** STATIC (default): fixed targets. TAG_MAP: route by `tagMap`. */
|
|
3251
|
+
targetMode?: AssignmentTargetMode;
|
|
3252
|
+
tagMap?: AssignmentPolicyTagMap;
|
|
3253
|
+
assignToUserIds?: string[];
|
|
3254
|
+
assignToTeamIds?: string[];
|
|
3255
|
+
}
|
|
3256
|
+
export interface SyncTagCatalogueEntryConfig {
|
|
3257
|
+
/** Human-readable display label. The value slug lives in the section key. */
|
|
3258
|
+
label: string;
|
|
3259
|
+
/** Fixed palette token (e.g. `neutral`, `red`, `blue`), not a hex value. */
|
|
3260
|
+
color?: string;
|
|
3261
|
+
description?: string;
|
|
3262
|
+
/**
|
|
3263
|
+
* Owning group's slug, unqualified (e.g. `primary-branch`). When set, the
|
|
3264
|
+
* section key must already carry the namespace:
|
|
3265
|
+
* `<fieldKey>:<group>:<tag>`.
|
|
3266
|
+
*/
|
|
3267
|
+
group?: string;
|
|
3268
|
+
}
|
|
3269
|
+
export interface SyncTagGroupConfig {
|
|
3270
|
+
/** Human-readable display label. The namespace slug lives in the section key. */
|
|
3271
|
+
label: string;
|
|
3272
|
+
description?: string;
|
|
3273
|
+
color?: string;
|
|
3274
|
+
/** `SINGLE` allows one member tag per record. Defaults to `MULTI`. */
|
|
3275
|
+
cardinality?: TagGroupCardinality;
|
|
3276
|
+
sortOrder?: number;
|
|
3277
|
+
}
|
|
1856
3278
|
export interface SyncCurrencyConfig {
|
|
1857
3279
|
name: string;
|
|
1858
3280
|
symbol?: string;
|
|
@@ -1872,10 +3294,16 @@ export interface SyncProductDefinitionConfig {
|
|
|
1872
3294
|
name: string;
|
|
1873
3295
|
description?: string;
|
|
1874
3296
|
category: string;
|
|
1875
|
-
|
|
3297
|
+
/** Plain tag labels governed by the `product.tags` catalogue. */
|
|
3298
|
+
tags?: string[];
|
|
3299
|
+
/** @deprecated Use `tags`. Omitted values are persisted as `OTHER`. */
|
|
3300
|
+
baseType?: string;
|
|
1876
3301
|
defaultCurrency: string;
|
|
3302
|
+
/** @deprecated Use `tags` when product classification is needed. */
|
|
1877
3303
|
country?: string;
|
|
1878
3304
|
supportedMethods: string[];
|
|
3305
|
+
/** Account field template inherited by accounts created from this product. */
|
|
3306
|
+
accountFieldConfig?: TypedFieldDefinition[];
|
|
1879
3307
|
metadata?: Record<string, unknown>;
|
|
1880
3308
|
}
|
|
1881
3309
|
export interface SyncEventDefConfig {
|
|
@@ -1897,7 +3325,7 @@ export interface SyncRuleConfig {
|
|
|
1897
3325
|
severity: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
1898
3326
|
tags?: string[];
|
|
1899
3327
|
conditionTree: unknown;
|
|
1900
|
-
actions?:
|
|
3328
|
+
actions?: RuleAction[];
|
|
1901
3329
|
initialStatus?: 'DRAFT' | 'ACTIVE' | 'DISABLED';
|
|
1902
3330
|
status?: 'DRAFT' | 'ACTIVE' | 'DISABLED';
|
|
1903
3331
|
}
|
|
@@ -1937,6 +3365,10 @@ export interface SyncPlan {
|
|
|
1937
3365
|
webhooks: SyncDiffOp[];
|
|
1938
3366
|
rules: SyncDiffOp[];
|
|
1939
3367
|
currencies: SyncDiffOp[];
|
|
3368
|
+
tagGroups: SyncDiffOp[];
|
|
3369
|
+
tagCatalogue: SyncDiffOp[];
|
|
3370
|
+
assignmentPolicies: SyncDiffOp[];
|
|
3371
|
+
behaviorSettings: SyncDiffOp[];
|
|
1940
3372
|
immutableViolations: SyncImmutableViolation[];
|
|
1941
3373
|
}
|
|
1942
3374
|
/** `POST /v1/config/sync/validate` response. */
|
|
@@ -1968,7 +3400,914 @@ export interface SyncExportQuery {
|
|
|
1968
3400
|
}
|
|
1969
3401
|
export type ResetConfigResponseDto = OpaqueResponse;
|
|
1970
3402
|
export type PushExchangeRatesResponseDto = OpaqueResponse;
|
|
1971
|
-
export
|
|
1972
|
-
|
|
1973
|
-
|
|
3403
|
+
export interface BulkCurrencyStatusResponseDto {
|
|
3404
|
+
updatedCount: number;
|
|
3405
|
+
}
|
|
3406
|
+
/** Bulk update body for `PATCH /v1/config/currencies/bulk-status`. */
|
|
3407
|
+
export interface BulkCurrencyStatusInput {
|
|
3408
|
+
ids: string[];
|
|
3409
|
+
enabled: boolean;
|
|
3410
|
+
}
|
|
3411
|
+
/** Catalogue-governed tag: slugified `value` + human-readable `label`. */
|
|
3412
|
+
export interface CustomListTagValue {
|
|
3413
|
+
value: string;
|
|
3414
|
+
label: string;
|
|
3415
|
+
}
|
|
3416
|
+
/** Offset pagination meta returned by the custom-lists list endpoints. */
|
|
3417
|
+
export interface CustomListPageMeta {
|
|
3418
|
+
page: number;
|
|
3419
|
+
pageSize: number;
|
|
3420
|
+
totalItems: number;
|
|
3421
|
+
totalPages: number;
|
|
3422
|
+
hasNextPage: boolean;
|
|
3423
|
+
hasPreviousPage: boolean;
|
|
3424
|
+
}
|
|
3425
|
+
/**
|
|
3426
|
+
* A tenant-managed screening list. Enabled LIVE lists are checked by every
|
|
3427
|
+
* screening run (initial, ongoing, manual, ad-hoc search) alongside external
|
|
3428
|
+
* providers; the list's tags are shown against every match it produces.
|
|
3429
|
+
*/
|
|
3430
|
+
export interface CustomScreeningListDto {
|
|
3431
|
+
id: string;
|
|
3432
|
+
name: string;
|
|
3433
|
+
description?: string | null;
|
|
3434
|
+
/** Disabled lists are skipped by screening but stay editable. */
|
|
3435
|
+
enabled: boolean;
|
|
3436
|
+
tags: CustomListTagValue[];
|
|
3437
|
+
entryCount: number;
|
|
3438
|
+
/** `LIVE` | `ARCHIVED`. Archived lists are read-only and never screened. */
|
|
3439
|
+
lifecycle: string;
|
|
3440
|
+
archivedAt?: string | null;
|
|
3441
|
+
createdAt: string;
|
|
3442
|
+
updatedAt: string;
|
|
3443
|
+
}
|
|
3444
|
+
export interface CustomListEntryDto {
|
|
3445
|
+
id: string;
|
|
3446
|
+
listId: string;
|
|
3447
|
+
name: string;
|
|
3448
|
+
entryType: 'INDIVIDUAL' | 'ENTITY';
|
|
3449
|
+
aliases: string[];
|
|
3450
|
+
/** YYYY-MM-DD. */
|
|
3451
|
+
dateOfBirth?: string | null;
|
|
3452
|
+
/** ISO 3166-1 alpha-3 country code. */
|
|
3453
|
+
country?: string | null;
|
|
3454
|
+
idNumber?: string | null;
|
|
3455
|
+
notes?: string | null;
|
|
3456
|
+
/** Caller identifier; bulk imports upsert rows carrying the same externalRef. */
|
|
3457
|
+
externalRef?: string | null;
|
|
3458
|
+
createdAt: string;
|
|
3459
|
+
updatedAt: string;
|
|
3460
|
+
}
|
|
3461
|
+
export interface CreateCustomScreeningListInput {
|
|
3462
|
+
name: string;
|
|
3463
|
+
description?: string;
|
|
3464
|
+
/** Defaults to true. */
|
|
3465
|
+
enabled?: boolean;
|
|
3466
|
+
tags?: CustomListTagValue[];
|
|
3467
|
+
}
|
|
3468
|
+
export interface UpdateCustomScreeningListInput {
|
|
3469
|
+
name?: string;
|
|
3470
|
+
description?: string;
|
|
3471
|
+
enabled?: boolean;
|
|
3472
|
+
tags?: CustomListTagValue[];
|
|
3473
|
+
}
|
|
3474
|
+
export interface CustomListEntryInput {
|
|
3475
|
+
name: string;
|
|
3476
|
+
/** Defaults to INDIVIDUAL. */
|
|
3477
|
+
entryType?: 'INDIVIDUAL' | 'ENTITY';
|
|
3478
|
+
aliases?: string[];
|
|
3479
|
+
/** YYYY-MM-DD. */
|
|
3480
|
+
dateOfBirth?: string;
|
|
3481
|
+
/** ISO 3166-1 alpha-3 country code. */
|
|
3482
|
+
country?: string;
|
|
3483
|
+
idNumber?: string;
|
|
3484
|
+
notes?: string;
|
|
3485
|
+
externalRef?: string;
|
|
3486
|
+
}
|
|
3487
|
+
export type UpdateCustomListEntryInput = Partial<CustomListEntryInput>;
|
|
3488
|
+
/** One rejected row from a bulk import, with the zero-based batch index. */
|
|
3489
|
+
export interface BulkCustomListImportRejectedRow {
|
|
3490
|
+
index: number;
|
|
3491
|
+
reason: string;
|
|
3492
|
+
name?: string | null;
|
|
3493
|
+
}
|
|
3494
|
+
/**
|
|
3495
|
+
* Result of a bulk entry import. The request succeeds even with rejections —
|
|
3496
|
+
* invalid rows are reported per-row instead of failing the batch.
|
|
3497
|
+
*/
|
|
3498
|
+
export interface BulkCustomListImportResultDto {
|
|
3499
|
+
createdCount: number;
|
|
3500
|
+
updatedCount: number;
|
|
3501
|
+
rejectedCount: number;
|
|
3502
|
+
rejected: BulkCustomListImportRejectedRow[];
|
|
3503
|
+
}
|
|
3504
|
+
export interface CustomScreeningListListResponse {
|
|
3505
|
+
data: CustomScreeningListDto[];
|
|
3506
|
+
meta: CustomListPageMeta;
|
|
3507
|
+
}
|
|
3508
|
+
export interface CustomListEntryListResponse {
|
|
3509
|
+
data: CustomListEntryDto[];
|
|
3510
|
+
meta: CustomListPageMeta;
|
|
3511
|
+
}
|
|
3512
|
+
export interface AssignmentPolicyConditionLeaf {
|
|
3513
|
+
/** Qualifier field key (e.g. `customer.riskRating`, `screening.type`). */
|
|
3514
|
+
field: string;
|
|
3515
|
+
/** Operator from the rules-engine matrix (e.g. `=`, `IN`, `CONTAINS_ANY`, `>`). */
|
|
3516
|
+
operator: string;
|
|
3517
|
+
/** Comparison value. Omitted for null-aware operators (IS_NULL, IS_EMPTY, …). */
|
|
3518
|
+
value?: string;
|
|
3519
|
+
/** Result when the field resolves null under a non-null-aware operator. Default 'FALSE'. */
|
|
3520
|
+
whenMissing?: 'TRUE' | 'FALSE';
|
|
3521
|
+
}
|
|
3522
|
+
export interface AssignmentPolicyConditionGroup {
|
|
3523
|
+
logic: 'AND' | 'OR' | 'NOT';
|
|
3524
|
+
conditions: (AssignmentPolicyConditionLeaf | AssignmentPolicyConditionGroup)[];
|
|
3525
|
+
}
|
|
3526
|
+
export type AssignmentTargetMode = 'STATIC' | 'TAG_MAP';
|
|
3527
|
+
export interface AssignmentPolicyTagMapEntry {
|
|
3528
|
+
/** Catalogue value slug this entry routes (e.g. "branch-colombo-01"). */
|
|
3529
|
+
tag: string;
|
|
3530
|
+
assignToUserIds?: string[];
|
|
3531
|
+
assignToTeamIds?: string[];
|
|
3532
|
+
}
|
|
3533
|
+
/**
|
|
3534
|
+
* TAG_MAP routing table: routes by the customer's tag values (branch
|
|
3535
|
+
* workflow — one policy covers any number of branch→team mappings).
|
|
3536
|
+
* Entries are ordered; for a customer carrying several mapped values the
|
|
3537
|
+
* FIRST matching entry wins. No entry matching → the policy does not match
|
|
3538
|
+
* and evaluation falls through to the next one.
|
|
3539
|
+
*/
|
|
3540
|
+
/** @deprecated Superseded by {@link AssignmentRouting}, which supports several blocks per policy. */
|
|
3541
|
+
export interface AssignmentPolicyTagMap {
|
|
3542
|
+
field: 'customer.tags' | 'customer.activeRiskTags' | 'customer.country';
|
|
3543
|
+
/**
|
|
3544
|
+
* Tag group whose membership this table routes, e.g. `primary-branch`.
|
|
3545
|
+
* When set, every entry's `tag` must be a member of that group — that is,
|
|
3546
|
+
* namespaced as `primary-branch:…` — and the server rejects the write
|
|
3547
|
+
* otherwise. Not consulted at match time; it exists so a row that could
|
|
3548
|
+
* never match is caught on save instead of failing silently forever.
|
|
3549
|
+
*
|
|
3550
|
+
* Null / omitted for a table over ungrouped tags, and required to be null
|
|
3551
|
+
* for `customer.country`, which has no tag catalogue.
|
|
3552
|
+
*/
|
|
3553
|
+
groupValue?: string | null;
|
|
3554
|
+
entries: AssignmentPolicyTagMapEntry[];
|
|
3555
|
+
}
|
|
3556
|
+
/**
|
|
3557
|
+
* How a policy resolves its targets, when not the fixed
|
|
3558
|
+
* `assignToUserIds` / `assignToTeamIds`. Exactly ONE of these — anything more
|
|
3559
|
+
* (ordering, cross-field matching) is expressed as additional policies with
|
|
3560
|
+
* their own qualifiers, which is what the policy list already does.
|
|
3561
|
+
*
|
|
3562
|
+
* Supersedes {@link AssignmentPolicyTagMap}. A policy written before this
|
|
3563
|
+
* existed is served here in the current shape, so clients read one thing.
|
|
3564
|
+
*/
|
|
3565
|
+
export type AssignmentRouting = {
|
|
3566
|
+
/**
|
|
3567
|
+
* Route to whoever is standing-assigned the customer. Carries no
|
|
3568
|
+
* targets of its own — they come from the customer record, so this
|
|
3569
|
+
* can replace a per-branch routing table entirely.
|
|
3570
|
+
*
|
|
3571
|
+
* Does NOT match an unassigned customer: the alert falls through to
|
|
3572
|
+
* the next policy.
|
|
3573
|
+
*/
|
|
3574
|
+
kind: 'CUSTOMER_ASSIGNEE';
|
|
3575
|
+
/** Which side of the assignment to use. Default BOTH. */
|
|
3576
|
+
use?: 'BOTH' | 'TEAMS' | 'USERS' | null;
|
|
3577
|
+
} | {
|
|
3578
|
+
/** Look the customer up in one tag group's table; first match wins. */
|
|
3579
|
+
kind: 'TAG_GROUP';
|
|
3580
|
+
field: 'customer.tags' | 'customer.activeRiskTags' | 'customer.country';
|
|
3581
|
+
/**
|
|
3582
|
+
* Tag group whose membership this table routes. Every entry must be a
|
|
3583
|
+
* member (`primary-branch:…`), or the write is rejected. Null routes
|
|
3584
|
+
* ungrouped values, or country, which has no catalogue.
|
|
3585
|
+
*/
|
|
3586
|
+
groupValue?: string | null;
|
|
3587
|
+
entries: AssignmentPolicyTagMapEntry[];
|
|
3588
|
+
};
|
|
3589
|
+
export interface AssignmentPolicyResponseDto {
|
|
3590
|
+
id: string;
|
|
3591
|
+
name: string;
|
|
3592
|
+
description: string | null;
|
|
3593
|
+
enabled: boolean;
|
|
3594
|
+
/** Evaluation order, ascending. First match wins. */
|
|
3595
|
+
priority: number;
|
|
3596
|
+
/** Qualifier tree. `{logic:'AND', conditions:[]}` = catch-all. */
|
|
3597
|
+
conditionTree: AssignmentPolicyConditionGroup;
|
|
3598
|
+
/** STATIC: fixed targets. TAG_MAP: routed via `routing`. */
|
|
3599
|
+
targetMode: AssignmentTargetMode;
|
|
3600
|
+
/** @deprecated Read `routing`. Null on anything saved since blocks landed. */
|
|
3601
|
+
tagMap: AssignmentPolicyTagMap | null;
|
|
3602
|
+
/** TAG_MAP: the ordered routing blocks. Legacy rows are served as one block. */
|
|
3603
|
+
routing: AssignmentRouting | null;
|
|
3604
|
+
assignToUserIds: string[];
|
|
3605
|
+
assignToTeamIds: string[];
|
|
3606
|
+
syncKey: string | null;
|
|
3607
|
+
createdAt: string;
|
|
3608
|
+
updatedAt: string;
|
|
3609
|
+
}
|
|
3610
|
+
export interface CreateAssignmentPolicyDto {
|
|
3611
|
+
name: string;
|
|
3612
|
+
description?: string | null;
|
|
3613
|
+
/** Default true. */
|
|
3614
|
+
enabled?: boolean;
|
|
3615
|
+
/** Omitted = catch-all. */
|
|
3616
|
+
conditionTree?: AssignmentPolicyConditionGroup;
|
|
3617
|
+
/** Default STATIC. TAG_MAP requires `routing` and ignores the static targets. */
|
|
3618
|
+
targetMode?: AssignmentTargetMode;
|
|
3619
|
+
routing?: AssignmentRouting | null;
|
|
3620
|
+
/** STATIC mode: at least one user or team target is required. */
|
|
3621
|
+
assignToUserIds?: string[];
|
|
3622
|
+
assignToTeamIds?: string[];
|
|
3623
|
+
syncKey?: string | null;
|
|
3624
|
+
}
|
|
3625
|
+
export interface UpdateAssignmentPolicyDto {
|
|
3626
|
+
name?: string;
|
|
3627
|
+
description?: string | null;
|
|
3628
|
+
enabled?: boolean;
|
|
3629
|
+
conditionTree?: AssignmentPolicyConditionGroup;
|
|
3630
|
+
targetMode?: AssignmentTargetMode;
|
|
3631
|
+
routing?: AssignmentRouting | null;
|
|
3632
|
+
assignToUserIds?: string[];
|
|
3633
|
+
assignToTeamIds?: string[];
|
|
3634
|
+
}
|
|
3635
|
+
export interface ReorderAssignmentPoliciesDto {
|
|
3636
|
+
/** Complete permutation of the org's policy ids in the desired evaluation order. */
|
|
3637
|
+
orderedIds: string[];
|
|
3638
|
+
}
|
|
3639
|
+
export interface TeamRefDto {
|
|
3640
|
+
teamId: string;
|
|
3641
|
+
name: string;
|
|
3642
|
+
memberCount: number;
|
|
3643
|
+
/** Catalogue-governed tags (`team.tags`). */
|
|
3644
|
+
tags: TagValue[];
|
|
3645
|
+
}
|
|
3646
|
+
export interface TeamMemberDto {
|
|
3647
|
+
userId: string;
|
|
3648
|
+
name: string;
|
|
3649
|
+
email?: string;
|
|
3650
|
+
role?: string;
|
|
3651
|
+
avatar?: string;
|
|
3652
|
+
}
|
|
3653
|
+
export interface TeamDto {
|
|
3654
|
+
id: string;
|
|
3655
|
+
name: string;
|
|
3656
|
+
description?: string | null;
|
|
3657
|
+
archivedAt?: string | null;
|
|
3658
|
+
/** Catalogue-governed tags (`team.tags`). */
|
|
3659
|
+
tags: TagValue[];
|
|
3660
|
+
memberCount: number;
|
|
3661
|
+
members: TeamMemberDto[];
|
|
3662
|
+
createdAt: string;
|
|
3663
|
+
updatedAt: string;
|
|
3664
|
+
}
|
|
3665
|
+
export interface CreateTeamDto {
|
|
3666
|
+
name: string;
|
|
3667
|
+
description?: string | null;
|
|
3668
|
+
/** Initial members (better-auth user ids). Each must be a member of the organization. */
|
|
3669
|
+
memberUserIds?: string[];
|
|
3670
|
+
/**
|
|
3671
|
+
* Catalogue-governed tags (`team.tags`). Every value must already exist in
|
|
3672
|
+
* the org tag catalogue — the catalogue is closed.
|
|
3673
|
+
*/
|
|
3674
|
+
tags?: TagValueInput[];
|
|
3675
|
+
}
|
|
3676
|
+
export interface UpdateTeamDto {
|
|
3677
|
+
name?: string;
|
|
3678
|
+
description?: string | null;
|
|
3679
|
+
/**
|
|
3680
|
+
* Replaces the full tag set — send every tag the team should end up with,
|
|
3681
|
+
* not a delta. Omit to leave the tags unchanged; pass `[]` to clear them.
|
|
3682
|
+
*/
|
|
3683
|
+
tags?: TagValueInput[];
|
|
3684
|
+
}
|
|
3685
|
+
export interface TeamMemberIdsDto {
|
|
3686
|
+
userIds: string[];
|
|
3687
|
+
}
|
|
3688
|
+
/** An array with at least one item. */
|
|
3689
|
+
export type NonEmptyArray<T> = [T, ...T[]];
|
|
3690
|
+
/**
|
|
3691
|
+
* Assignment targets. The API rejects a request unless at least one target
|
|
3692
|
+
* array is present and non-empty.
|
|
3693
|
+
*/
|
|
3694
|
+
export type CustomerAssignmentInput = {
|
|
3695
|
+
userIds: NonEmptyArray<string>;
|
|
3696
|
+
teamIds?: string[];
|
|
3697
|
+
} | {
|
|
3698
|
+
userIds?: string[];
|
|
3699
|
+
teamIds: NonEmptyArray<string>;
|
|
3700
|
+
};
|
|
3701
|
+
/**
|
|
3702
|
+
* Bulk assignment preflight-validates every customer and target before
|
|
3703
|
+
* assignment begins.
|
|
3704
|
+
*/
|
|
3705
|
+
export type BulkCustomerAssignmentInput = CustomerAssignmentInput & {
|
|
3706
|
+
customerIds: NonEmptyArray<string>;
|
|
3707
|
+
};
|
|
3708
|
+
export interface CustomerAssignmentResponse {
|
|
3709
|
+
id: string;
|
|
3710
|
+
assignedToUserIds: string[];
|
|
3711
|
+
assignedToTeamIds: string[];
|
|
3712
|
+
}
|
|
3713
|
+
export interface BulkCustomerAssignmentResult {
|
|
3714
|
+
/** How many customers actually changed. Already-assigned targets are skipped. */
|
|
3715
|
+
updated: number;
|
|
3716
|
+
}
|
|
3717
|
+
/** @deprecated Use `CustomerAssignmentInput`. */
|
|
3718
|
+
export type CustomerAssignmentDto = CustomerAssignmentInput;
|
|
3719
|
+
/** @deprecated Use `BulkCustomerAssignmentInput`. */
|
|
3720
|
+
export type BulkCustomerAssignmentDto = BulkCustomerAssignmentInput;
|
|
3721
|
+
/** @deprecated Use `CustomerAssignmentResponse`. */
|
|
3722
|
+
export type CustomerAssignmentResponseDto = CustomerAssignmentResponse;
|
|
3723
|
+
/** @deprecated Use `BulkCustomerAssignmentResult`. */
|
|
3724
|
+
export type BulkAssignResultDto = BulkCustomerAssignmentResult;
|
|
3725
|
+
export type * from './alert-workflow-types';
|
|
3726
|
+
export interface AlertWorkflowSettings {
|
|
3727
|
+
id: string;
|
|
3728
|
+
name: string;
|
|
3729
|
+
alertType: import('./alert-workflow-types').WorkflowAlertType;
|
|
3730
|
+
revision: number;
|
|
3731
|
+
publishedVersion: number;
|
|
3732
|
+
draft: import('./alert-workflow-types').WorkflowDefinition;
|
|
3733
|
+
published: import('./alert-workflow-types').WorkflowPublication | null;
|
|
3734
|
+
}
|
|
3735
|
+
export interface SaveAlertWorkflowInput {
|
|
3736
|
+
id?: string;
|
|
3737
|
+
name: string;
|
|
3738
|
+
expectedRevision: number;
|
|
3739
|
+
definition: import('./alert-workflow-types').WorkflowDefinition;
|
|
3740
|
+
publish: boolean;
|
|
3741
|
+
}
|
|
3742
|
+
/** Organization-wide creation experience. Existing alerts retain their saved behavior. */
|
|
3743
|
+
export type AlertWorkflowExperience = 'SIMPLE' | 'DEFINED';
|
|
3744
|
+
export interface AlertWorkflowExperienceSettings {
|
|
3745
|
+
id: string;
|
|
3746
|
+
experience: AlertWorkflowExperience;
|
|
3747
|
+
revision: number;
|
|
3748
|
+
}
|
|
3749
|
+
export interface SaveAlertWorkflowExperienceInput {
|
|
3750
|
+
experience: AlertWorkflowExperience;
|
|
3751
|
+
expectedRevision: number;
|
|
3752
|
+
}
|
|
3753
|
+
/** Published workflow snapshot. Older entries may lack a recoverable definition. */
|
|
3754
|
+
export interface AlertWorkflowVersion {
|
|
3755
|
+
id: string;
|
|
3756
|
+
version: number;
|
|
3757
|
+
isCurrent: boolean;
|
|
3758
|
+
definition: import('./alert-workflow-types').WorkflowDefinition | null;
|
|
3759
|
+
publishedAt: string | null;
|
|
3760
|
+
publishedBy: string | null;
|
|
3761
|
+
}
|
|
3762
|
+
export interface RestoreAlertWorkflowInput {
|
|
3763
|
+
version: number;
|
|
3764
|
+
expectedRevision: number;
|
|
3765
|
+
}
|
|
3766
|
+
export type PaymentInstrumentType = 'CARD' | 'VIRTUAL_CARD' | 'WALLET_TOKEN' | 'ACH_CREDENTIAL' | 'ONLINE_LOGIN' | 'DIGITAL_TOKEN' | 'CREDIT_CARD' | 'DEBIT_CARD' | 'PAYMENT_TOKEN' | 'API_KEY' | 'CRYPTO_WALLET' | 'OTHER';
|
|
3767
|
+
export type PaymentInstrumentStatus = 'ACTIVE' | 'BLOCKED' | 'EXPIRED' | 'LOST' | 'STOLEN' | 'FROZEN' | 'INACTIVE' | 'REVOKED' | 'COMPROMISED';
|
|
3768
|
+
export type ChannelEndpointStatus = 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'RETIRED' | 'UNKNOWN';
|
|
3769
|
+
export interface SessionDto {
|
|
3770
|
+
id: string;
|
|
3771
|
+
externalSessionId: string;
|
|
3772
|
+
customerId?: string | null;
|
|
3773
|
+
deviceId?: string | null;
|
|
3774
|
+
startedAt: string;
|
|
3775
|
+
lastActivityAt: string;
|
|
3776
|
+
metadata?: Record<string, unknown> | null;
|
|
3777
|
+
createdAt: string;
|
|
3778
|
+
}
|
|
3779
|
+
export interface UpdateSessionDto {
|
|
3780
|
+
customerId?: string | null;
|
|
3781
|
+
deviceId?: string | null;
|
|
3782
|
+
startedAt?: string;
|
|
3783
|
+
lastActivityAt?: string;
|
|
3784
|
+
metadata?: Record<string, unknown> | null;
|
|
3785
|
+
}
|
|
3786
|
+
export interface ChannelEndpointDto {
|
|
3787
|
+
id: string;
|
|
3788
|
+
externalId: string;
|
|
3789
|
+
kind: string;
|
|
3790
|
+
provider: string;
|
|
3791
|
+
displayName?: string | null;
|
|
3792
|
+
status: ChannelEndpointStatus;
|
|
3793
|
+
metadata?: Record<string, unknown> | null;
|
|
3794
|
+
firstSeenAt: string;
|
|
3795
|
+
lastSeenAt: string;
|
|
3796
|
+
createdAt: string;
|
|
3797
|
+
updatedAt: string;
|
|
3798
|
+
/** Catalogue-governed tags (`channelEndpoint.tags`). */
|
|
3799
|
+
tags: TagValue[];
|
|
3800
|
+
/** Set by the latest risk assessment. */
|
|
3801
|
+
riskRating?: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL' | null;
|
|
3802
|
+
}
|
|
3803
|
+
export interface UpdateChannelEndpointDto {
|
|
3804
|
+
displayName?: string | null;
|
|
3805
|
+
status?: ChannelEndpointStatus;
|
|
3806
|
+
metadata?: Record<string, unknown> | null;
|
|
3807
|
+
firstSeenAt?: string;
|
|
3808
|
+
lastSeenAt?: string;
|
|
3809
|
+
}
|
|
3810
|
+
export type PaymentInstrumentRelationshipSource = 'EXPLICIT' | 'TRANSACTION' | 'ANALYST' | 'RESOLUTION';
|
|
3811
|
+
export type PaymentInstrumentFingerprintType = 'CARD_PAN' | 'NETWORK_TOKEN' | 'WALLET_TOKEN' | 'ACH_CREDENTIAL' | 'ONLINE_LOGIN' | 'API_KEY' | 'CRYPTO_ADDRESS' | 'EXTERNAL_ID' | 'OTHER';
|
|
3812
|
+
export interface PaymentInstrumentFingerprintDto {
|
|
3813
|
+
type: PaymentInstrumentFingerprintType;
|
|
3814
|
+
/** Raw credential used only for protected fingerprint resolution; never persisted. */
|
|
3815
|
+
value: string;
|
|
3816
|
+
}
|
|
3817
|
+
export interface PaymentInstrumentPayloadDto {
|
|
3818
|
+
/** Internal Payment Instrument ID. */
|
|
3819
|
+
paymentInstrumentId?: string;
|
|
3820
|
+
/** Integration-owned stable Payment Instrument ID. */
|
|
3821
|
+
externalId?: string;
|
|
3822
|
+
type?: PaymentInstrumentType;
|
|
3823
|
+
fingerprint?: PaymentInstrumentFingerprintDto;
|
|
3824
|
+
}
|
|
3825
|
+
type PaymentInstrumentDecimalDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
3826
|
+
/** A safe masked payment-instrument suffix containing exactly four decimal digits. */
|
|
3827
|
+
export type PaymentInstrumentLast4 = `${PaymentInstrumentDecimalDigit}${PaymentInstrumentDecimalDigit}${PaymentInstrumentDecimalDigit}${PaymentInstrumentDecimalDigit}`;
|
|
3828
|
+
export interface AttemptPaymentInstrumentDto extends PaymentInstrumentPayloadDto {
|
|
3829
|
+
/** Safe issuer identification number for BIN/IIN attack analysis. */
|
|
3830
|
+
iin?: string;
|
|
3831
|
+
/** Safe masked suffix containing exactly four decimal digits. */
|
|
3832
|
+
last4?: PaymentInstrumentLast4;
|
|
3833
|
+
}
|
|
3834
|
+
export interface PaymentInstrumentDto {
|
|
3835
|
+
id: string;
|
|
3836
|
+
organizationId: string;
|
|
3837
|
+
externalId?: string | null;
|
|
3838
|
+
type: PaymentInstrumentType;
|
|
3839
|
+
status: PaymentInstrumentStatus;
|
|
3840
|
+
parentPaymentInstrumentId?: string | null;
|
|
3841
|
+
displayName?: string | null;
|
|
3842
|
+
createdSource: PaymentInstrumentRelationshipSource;
|
|
3843
|
+
managedAt?: string | null;
|
|
3844
|
+
firstSeenAt?: string | null;
|
|
3845
|
+
lastUsedAt?: string | null;
|
|
3846
|
+
issuedAt?: string | null;
|
|
3847
|
+
expiresAt?: string | null;
|
|
3848
|
+
riskFlags: string[];
|
|
3849
|
+
metadata: Record<string, unknown>;
|
|
3850
|
+
createdAt: string;
|
|
3851
|
+
updatedAt: string;
|
|
3852
|
+
}
|
|
3853
|
+
export interface CreatePaymentInstrumentDto {
|
|
3854
|
+
externalId?: string;
|
|
3855
|
+
type: PaymentInstrumentType;
|
|
3856
|
+
status?: PaymentInstrumentStatus;
|
|
3857
|
+
parentPaymentInstrumentId?: string;
|
|
3858
|
+
displayName?: string;
|
|
3859
|
+
createdSource: PaymentInstrumentRelationshipSource;
|
|
3860
|
+
managedAt?: string;
|
|
3861
|
+
firstSeenAt?: string;
|
|
3862
|
+
issuedAt?: string;
|
|
3863
|
+
expiresAt?: string;
|
|
3864
|
+
metadata?: Record<string, unknown>;
|
|
3865
|
+
}
|
|
3866
|
+
export interface UpdatePaymentInstrumentDto {
|
|
3867
|
+
status?: PaymentInstrumentStatus;
|
|
3868
|
+
parentPaymentInstrumentId?: string | null;
|
|
3869
|
+
displayName?: string | null;
|
|
3870
|
+
managedAt?: string | null;
|
|
3871
|
+
issuedAt?: string | null;
|
|
3872
|
+
expiresAt?: string | null;
|
|
3873
|
+
metadata?: Record<string, unknown>;
|
|
3874
|
+
}
|
|
3875
|
+
export interface LinkPaymentInstrumentAccountDto {
|
|
3876
|
+
accountId: string;
|
|
3877
|
+
relationshipType: 'ACCESS_CREDENTIAL' | 'FUNDING_SOURCE' | 'SETTLEMENT_DESTINATION' | 'OTHER';
|
|
3878
|
+
source: PaymentInstrumentRelationshipSource;
|
|
3879
|
+
validFrom?: string;
|
|
3880
|
+
validTo?: string;
|
|
3881
|
+
confidence?: number;
|
|
3882
|
+
}
|
|
3883
|
+
export interface LinkPaymentInstrumentCustomerDto {
|
|
3884
|
+
customerId: string;
|
|
3885
|
+
role: 'PRIMARY_HOLDER' | 'AUTHORIZED_USER' | 'CORPORATE_USER' | 'CUSTODIAN' | 'OBSERVED_USER';
|
|
3886
|
+
source: PaymentInstrumentRelationshipSource;
|
|
3887
|
+
validFrom?: string;
|
|
3888
|
+
validTo?: string;
|
|
3889
|
+
confidence?: number;
|
|
3890
|
+
}
|
|
3891
|
+
export interface PaymentInstrumentAccountRelationshipDto {
|
|
3892
|
+
id: string;
|
|
3893
|
+
accountId: string;
|
|
3894
|
+
paymentInstrumentId: string;
|
|
3895
|
+
relationshipType: 'ACCESS_CREDENTIAL' | 'FUNDING_SOURCE' | 'SETTLEMENT_DESTINATION' | 'OTHER';
|
|
3896
|
+
validFrom: string;
|
|
3897
|
+
validTo?: string | null;
|
|
3898
|
+
source: PaymentInstrumentRelationshipSource;
|
|
3899
|
+
confidence?: number | null;
|
|
3900
|
+
createdAt: string;
|
|
3901
|
+
updatedAt: string;
|
|
3902
|
+
}
|
|
3903
|
+
export interface PaymentInstrumentCustomerRelationshipDto {
|
|
3904
|
+
id: string;
|
|
3905
|
+
customerId: string;
|
|
3906
|
+
paymentInstrumentId: string;
|
|
3907
|
+
role: 'PRIMARY_HOLDER' | 'AUTHORIZED_USER' | 'CORPORATE_USER' | 'CUSTODIAN' | 'OBSERVED_USER';
|
|
3908
|
+
validFrom: string;
|
|
3909
|
+
validTo?: string | null;
|
|
3910
|
+
source: PaymentInstrumentRelationshipSource;
|
|
3911
|
+
confidence?: number | null;
|
|
3912
|
+
createdAt: string;
|
|
3913
|
+
updatedAt: string;
|
|
3914
|
+
}
|
|
3915
|
+
/** @deprecated Use the account- or customer-specific relationship response type. */
|
|
3916
|
+
export type PaymentInstrumentRelationshipDto = PaymentInstrumentAccountRelationshipDto | PaymentInstrumentCustomerRelationshipDto;
|
|
3917
|
+
export interface ConnectionEdge<T> {
|
|
3918
|
+
node: T;
|
|
3919
|
+
/** Opaque offset cursor. */
|
|
3920
|
+
cursor: string;
|
|
3921
|
+
}
|
|
3922
|
+
export interface ConnectionPageInfo {
|
|
3923
|
+
hasNextPage: boolean;
|
|
3924
|
+
hasPreviousPage: boolean;
|
|
3925
|
+
startCursor?: string;
|
|
3926
|
+
endCursor?: string;
|
|
3927
|
+
}
|
|
3928
|
+
export interface ConnectionPageMeta {
|
|
3929
|
+
page: number;
|
|
3930
|
+
pageSize: number;
|
|
3931
|
+
totalItems: number;
|
|
3932
|
+
totalPages: number;
|
|
3933
|
+
hasNextPage: boolean;
|
|
3934
|
+
hasPreviousPage: boolean;
|
|
3935
|
+
}
|
|
3936
|
+
/** Where a Risk Signal came from. Immutable provenance, set by the server. */
|
|
3937
|
+
export type RiskSignalSourceType = 'EVENT' | 'RULE' | 'MANUAL';
|
|
3938
|
+
export interface RiskSignal {
|
|
3939
|
+
id: string;
|
|
3940
|
+
/** Caller-supplied idempotency key, for explicitly created signals. */
|
|
3941
|
+
externalId?: string | null;
|
|
3942
|
+
/** Dotted signal type. Tenant vocabulary — not a fixed platform enum. */
|
|
3943
|
+
type: string;
|
|
3944
|
+
resourceType: RiskSignalResourceType;
|
|
3945
|
+
resourceId: string;
|
|
3946
|
+
/** Strength at `occurredAt`. Immutable. */
|
|
3947
|
+
weight: number;
|
|
3948
|
+
/** Half-life in seconds. Immutable. */
|
|
3949
|
+
halfLifeSeconds: number;
|
|
3950
|
+
/** Half-life as an ISO 8601 duration, e.g. `P7D`. Immutable. */
|
|
3951
|
+
halfLife: string;
|
|
3952
|
+
occurredAt: string;
|
|
3953
|
+
/** Decayed weight at the requested `asOf` time. */
|
|
3954
|
+
effectiveWeight: number;
|
|
3955
|
+
sourceType: RiskSignalSourceType;
|
|
3956
|
+
/** The Event id, evaluation id, or acting user id behind this signal. */
|
|
3957
|
+
sourceId: string;
|
|
3958
|
+
/** Safe audit facts only — never secrets or raw source payloads. */
|
|
3959
|
+
sourceSnapshot: Record<string, unknown>;
|
|
3960
|
+
createdBy: unknown;
|
|
3961
|
+
createdAt: string;
|
|
3962
|
+
}
|
|
3963
|
+
/**
|
|
3964
|
+
* Explicit Risk Signal creation.
|
|
3965
|
+
*
|
|
3966
|
+
* The caller does not choose the source: the server sets `sourceType: 'MANUAL'`
|
|
3967
|
+
* and captures the authenticated actor. There is deliberately no way to claim a
|
|
3968
|
+
* signal came from an Event or a Rule.
|
|
3969
|
+
*/
|
|
3970
|
+
export interface CreateRiskSignalInput {
|
|
3971
|
+
/**
|
|
3972
|
+
* Your idempotency key for this signal (max 255 chars). Resubmitting the
|
|
3973
|
+
* same `externalId` returns the original signal rather than adding a
|
|
3974
|
+
* second one.
|
|
3975
|
+
*/
|
|
3976
|
+
externalId?: string | null;
|
|
3977
|
+
/** Dotted signal type, e.g. `analyst.concerning_account_behaviour`. */
|
|
3978
|
+
type: string;
|
|
3979
|
+
resourceType: RiskSignalResourceType;
|
|
3980
|
+
resourceId: string;
|
|
3981
|
+
/** Strength at `occurredAt`. Must be greater than zero. */
|
|
3982
|
+
weight: number;
|
|
3983
|
+
/**
|
|
3984
|
+
* Half-life as a positive ISO 8601 duration, e.g. `P14D`. Calendar units
|
|
3985
|
+
* (Y/M) are rejected — they have no fixed length.
|
|
3986
|
+
*/
|
|
3987
|
+
halfLife: string;
|
|
3988
|
+
/** When the evidence occurred (ISO 8601). Defaults to now. */
|
|
3989
|
+
occurredAt?: string | null;
|
|
3990
|
+
/** Analyst justification, recorded in the signal's source snapshot (max 2000 chars). */
|
|
3991
|
+
note?: string | null;
|
|
3992
|
+
}
|
|
3993
|
+
export interface ListRiskSignalsQuery {
|
|
3994
|
+
/** Required. Which kind of resource to read signals for. */
|
|
3995
|
+
resourceType: RiskSignalResourceType;
|
|
3996
|
+
/** Required. Id of that resource. */
|
|
3997
|
+
resourceId: string;
|
|
3998
|
+
/**
|
|
3999
|
+
* ISO 8601 timestamp the decay is computed as of. Defaults to server time;
|
|
4000
|
+
* a historical `asOf` returns what the resource looked like at that moment.
|
|
4001
|
+
*/
|
|
4002
|
+
asOf?: string;
|
|
4003
|
+
/** Restrict which signal types contribute. Repeatable. */
|
|
4004
|
+
type?: string[];
|
|
4005
|
+
/** Restrict which provenances contribute. Repeatable. */
|
|
4006
|
+
sourceType?: RiskSignalSourceType[];
|
|
4007
|
+
/** 1–200. Defaults to 50. */
|
|
4008
|
+
limit?: number;
|
|
4009
|
+
/** Defaults to 0. */
|
|
4010
|
+
offset?: number;
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* A resource's Risk Signals with their decayed weights, plus the aggregate.
|
|
4014
|
+
*
|
|
4015
|
+
* `type` / `sourceType` filter which records contribute; they never change how
|
|
4016
|
+
* far a contributing signal has decayed — age is always measured to `asOf`.
|
|
4017
|
+
*/
|
|
4018
|
+
export interface RiskSignalListResponse {
|
|
4019
|
+
edges: ConnectionEdge<RiskSignal>[];
|
|
4020
|
+
pageInfo: ConnectionPageInfo;
|
|
4021
|
+
totalCount: number;
|
|
4022
|
+
/** The time the decay was computed as of. */
|
|
4023
|
+
asOf: string;
|
|
4024
|
+
/**
|
|
4025
|
+
* Sum of every contributing signal's effective weight at `asOf`. Computed
|
|
4026
|
+
* on read — not a cached score on the resource.
|
|
4027
|
+
*/
|
|
4028
|
+
aggregateEffectiveWeight: number;
|
|
4029
|
+
/** Number of contributing signal records. */
|
|
4030
|
+
contributingCount: number;
|
|
4031
|
+
/** Latest contributing occurrence. */
|
|
4032
|
+
latestAt?: string | null;
|
|
4033
|
+
/** Distinct contributing signal types. */
|
|
4034
|
+
uniqueTypeCount: number;
|
|
4035
|
+
}
|
|
4036
|
+
export type EmployeeStatus = 'ACTIVE' | 'INACTIVE' | 'SUSPENDED' | 'TERMINATED';
|
|
4037
|
+
export type BranchStatus = 'ACTIVE' | 'INACTIVE' | 'CLOSED';
|
|
4038
|
+
export interface Employee {
|
|
4039
|
+
id: string;
|
|
4040
|
+
/** The institution's own staff identifier. */
|
|
4041
|
+
externalEmployeeId?: string | null;
|
|
4042
|
+
fullName: string;
|
|
4043
|
+
email?: string | null;
|
|
4044
|
+
jobTitle?: string | null;
|
|
4045
|
+
department?: string | null;
|
|
4046
|
+
/** Home Branch id. */
|
|
4047
|
+
branchId?: string | null;
|
|
4048
|
+
status: EmployeeStatus;
|
|
4049
|
+
/**
|
|
4050
|
+
* Optional link to the Dossiers organization member who is this same
|
|
4051
|
+
* person. Null for employees without a Dossiers login. Never an identity
|
|
4052
|
+
* substitute — Events and Risk Signals always attach by Employee id.
|
|
4053
|
+
*/
|
|
4054
|
+
orgMemberId?: string | null;
|
|
4055
|
+
metadata: Record<string, unknown>;
|
|
4056
|
+
createdAt: string;
|
|
4057
|
+
updatedAt: string;
|
|
4058
|
+
lifecycle: Lifecycle;
|
|
4059
|
+
archivedAt?: string | null;
|
|
4060
|
+
tombstonedAt?: string | null;
|
|
4061
|
+
}
|
|
4062
|
+
export interface CreateEmployeeInput {
|
|
4063
|
+
fullName: string;
|
|
4064
|
+
/**
|
|
4065
|
+
* The institution's own staff identifier. Unique within the organization;
|
|
4066
|
+
* lets ingestion resolve an Employee without a Dossiers UUID round-trip.
|
|
4067
|
+
*/
|
|
4068
|
+
externalEmployeeId?: string | null;
|
|
4069
|
+
email?: string | null;
|
|
4070
|
+
jobTitle?: string | null;
|
|
4071
|
+
department?: string | null;
|
|
4072
|
+
/** Home Branch id. Must belong to the same organization. */
|
|
4073
|
+
branchId?: string | null;
|
|
4074
|
+
/** Defaults to `ACTIVE`. */
|
|
4075
|
+
status?: EmployeeStatus;
|
|
4076
|
+
/**
|
|
4077
|
+
* Optional link to the Dossiers organization member who is this same
|
|
4078
|
+
* person. Leave unset for employees without a Dossiers login.
|
|
4079
|
+
*/
|
|
4080
|
+
orgMemberId?: string | null;
|
|
4081
|
+
}
|
|
4082
|
+
export interface UpdateEmployeeInput {
|
|
4083
|
+
fullName?: string;
|
|
4084
|
+
email?: string | null;
|
|
4085
|
+
jobTitle?: string | null;
|
|
4086
|
+
department?: string | null;
|
|
4087
|
+
branchId?: string | null;
|
|
4088
|
+
status?: EmployeeStatus;
|
|
4089
|
+
orgMemberId?: string | null;
|
|
4090
|
+
metadata?: Record<string, unknown>;
|
|
4091
|
+
}
|
|
4092
|
+
export interface EmployeeListResponse {
|
|
4093
|
+
data: Employee[];
|
|
4094
|
+
edges: ConnectionEdge<Employee>[];
|
|
4095
|
+
pageInfo: ConnectionPageInfo;
|
|
4096
|
+
meta: ConnectionPageMeta;
|
|
4097
|
+
}
|
|
4098
|
+
export interface Branch {
|
|
4099
|
+
id: string;
|
|
4100
|
+
/** The institution's own branch identifier. */
|
|
4101
|
+
externalBranchId?: string | null;
|
|
4102
|
+
name: string;
|
|
4103
|
+
code?: string | null;
|
|
4104
|
+
country?: string | null;
|
|
4105
|
+
city?: string | null;
|
|
4106
|
+
/**
|
|
4107
|
+
* Owning Institution id, when the tenant models its own legal entities as
|
|
4108
|
+
* Institutions.
|
|
4109
|
+
*/
|
|
4110
|
+
institutionId?: string | null;
|
|
4111
|
+
status: BranchStatus;
|
|
4112
|
+
metadata: Record<string, unknown>;
|
|
4113
|
+
createdAt: string;
|
|
4114
|
+
updatedAt: string;
|
|
4115
|
+
lifecycle: Lifecycle;
|
|
4116
|
+
archivedAt?: string | null;
|
|
4117
|
+
tombstonedAt?: string | null;
|
|
4118
|
+
}
|
|
4119
|
+
export interface CreateBranchInput {
|
|
4120
|
+
name: string;
|
|
4121
|
+
/**
|
|
4122
|
+
* The institution's own branch identifier. Unique within the organization;
|
|
4123
|
+
* lets ingestion resolve a Branch without a Dossiers UUID round-trip.
|
|
4124
|
+
*/
|
|
4125
|
+
externalBranchId?: string | null;
|
|
4126
|
+
code?: string | null;
|
|
4127
|
+
country?: string | null;
|
|
4128
|
+
city?: string | null;
|
|
4129
|
+
institutionId?: string | null;
|
|
4130
|
+
/** Defaults to `ACTIVE`. */
|
|
4131
|
+
status?: BranchStatus;
|
|
4132
|
+
}
|
|
4133
|
+
export interface UpdateBranchInput {
|
|
4134
|
+
name?: string;
|
|
4135
|
+
code?: string | null;
|
|
4136
|
+
country?: string | null;
|
|
4137
|
+
city?: string | null;
|
|
4138
|
+
institutionId?: string | null;
|
|
4139
|
+
status?: BranchStatus;
|
|
4140
|
+
metadata?: Record<string, unknown>;
|
|
4141
|
+
}
|
|
4142
|
+
export interface BranchListResponse {
|
|
4143
|
+
data: Branch[];
|
|
4144
|
+
edges: ConnectionEdge<Branch>[];
|
|
4145
|
+
pageInfo: ConnectionPageInfo;
|
|
4146
|
+
meta: ConnectionPageMeta;
|
|
4147
|
+
}
|
|
4148
|
+
export type PartyRelationshipDirection = 'DIRECTED' | 'SYMMETRIC';
|
|
4149
|
+
export type PartyRelationshipPartyType = 'CUSTOMER' | 'COUNTERPARTY';
|
|
4150
|
+
export interface PartyRelationshipType {
|
|
4151
|
+
id: string;
|
|
4152
|
+
key: string;
|
|
4153
|
+
label: string;
|
|
4154
|
+
description?: string | null;
|
|
4155
|
+
direction: PartyRelationshipDirection;
|
|
4156
|
+
createdAt: string;
|
|
4157
|
+
updatedAt: string;
|
|
4158
|
+
}
|
|
4159
|
+
export interface CreatePartyRelationshipTypeInput {
|
|
4160
|
+
key: string;
|
|
4161
|
+
label: string;
|
|
4162
|
+
description?: string;
|
|
4163
|
+
direction: PartyRelationshipDirection;
|
|
4164
|
+
}
|
|
4165
|
+
/** One end of a relationship, resolved to something displayable. */
|
|
4166
|
+
export interface PartyRef {
|
|
4167
|
+
type: PartyRelationshipPartyType;
|
|
4168
|
+
id: string;
|
|
4169
|
+
label: string;
|
|
4170
|
+
}
|
|
4171
|
+
export interface PartyRelationship {
|
|
4172
|
+
id: string;
|
|
4173
|
+
typeId: string;
|
|
4174
|
+
relationshipType: PartyRelationshipType;
|
|
4175
|
+
sourceType: PartyRelationshipPartyType;
|
|
4176
|
+
sourceId: string;
|
|
4177
|
+
targetType: PartyRelationshipPartyType;
|
|
4178
|
+
targetId: string;
|
|
4179
|
+
sourceParty?: PartyRef | null;
|
|
4180
|
+
targetParty?: PartyRef | null;
|
|
4181
|
+
description?: string | null;
|
|
4182
|
+
validFrom?: string | null;
|
|
4183
|
+
validTo?: string | null;
|
|
4184
|
+
source?: string | null;
|
|
4185
|
+
confidence?: number | null;
|
|
4186
|
+
createdAt: string;
|
|
4187
|
+
updatedAt: string;
|
|
4188
|
+
}
|
|
4189
|
+
export interface CreatePartyRelationshipInput {
|
|
4190
|
+
typeId: string;
|
|
4191
|
+
sourceType: PartyRelationshipPartyType;
|
|
4192
|
+
sourceId: string;
|
|
4193
|
+
targetType: PartyRelationshipPartyType;
|
|
4194
|
+
targetId: string;
|
|
4195
|
+
description?: string;
|
|
4196
|
+
validFrom?: string;
|
|
4197
|
+
validTo?: string;
|
|
4198
|
+
source?: string;
|
|
4199
|
+
confidence?: number;
|
|
4200
|
+
}
|
|
4201
|
+
export type AlertRiskLevel = 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
4202
|
+
/**
|
|
4203
|
+
* An org-defined alert type. CUSTOM alerts name one of these and carry typed
|
|
4204
|
+
* field values validated against `fields` (Tier A) when raised. Editing the
|
|
4205
|
+
* schema never re-validates existing alerts.
|
|
4206
|
+
*/
|
|
4207
|
+
export interface CustomAlertTypeResponseDto {
|
|
4208
|
+
id: string;
|
|
4209
|
+
/** Stable snake_case machine name; integrators raise alerts by it. Immutable. */
|
|
4210
|
+
name: string;
|
|
4211
|
+
displayName: string;
|
|
4212
|
+
description: string | null;
|
|
4213
|
+
fields: TypedFieldDefinition[];
|
|
4214
|
+
/** Applied when the creator does not choose a risk level. */
|
|
4215
|
+
defaultRiskLevel: AlertRiskLevel;
|
|
4216
|
+
lifecycle: 'LIVE' | 'ARCHIVED' | 'TOMBSTONED';
|
|
4217
|
+
createdAt: string;
|
|
4218
|
+
updatedAt: string;
|
|
4219
|
+
archivedAt?: string | null;
|
|
4220
|
+
tombstonedAt?: string | null;
|
|
4221
|
+
}
|
|
4222
|
+
export interface CreateCustomAlertTypeDto {
|
|
4223
|
+
/** snake_case, starts with a letter, max 64 chars. */
|
|
4224
|
+
name: string;
|
|
4225
|
+
displayName: string;
|
|
4226
|
+
description?: string | null;
|
|
4227
|
+
fields?: TypedFieldDefinition[];
|
|
4228
|
+
/** Defaults to MEDIUM. */
|
|
4229
|
+
defaultRiskLevel?: AlertRiskLevel;
|
|
4230
|
+
}
|
|
4231
|
+
export interface UpdateCustomAlertTypeDto {
|
|
4232
|
+
displayName?: string;
|
|
4233
|
+
description?: string | null;
|
|
4234
|
+
/** Replaces the schema. Applies to alerts raised afterwards only. */
|
|
4235
|
+
fields?: TypedFieldDefinition[];
|
|
4236
|
+
defaultRiskLevel?: AlertRiskLevel;
|
|
4237
|
+
}
|
|
4238
|
+
/** A resource to link to an alert. `resourceType` is case-insensitive (`customer` and `CUSTOMER` both work). */
|
|
4239
|
+
export interface AlertResourceRefDto {
|
|
4240
|
+
resourceType: string;
|
|
4241
|
+
resourceId: string;
|
|
4242
|
+
}
|
|
4243
|
+
export interface AlertResourceDto {
|
|
4244
|
+
/** Link id — pass this to `removeResource`, not the target's id. */
|
|
4245
|
+
id: string;
|
|
4246
|
+
resourceType: string;
|
|
4247
|
+
resourceId: string;
|
|
4248
|
+
addedBy: {
|
|
4249
|
+
userId: string;
|
|
4250
|
+
name: string;
|
|
4251
|
+
};
|
|
4252
|
+
createdAt: string;
|
|
4253
|
+
}
|
|
4254
|
+
export interface CreateCustomAlertDto {
|
|
4255
|
+
/**
|
|
4256
|
+
* Optional. Machine name (or id) of a LIVE custom alert type. Omit for a
|
|
4257
|
+
* free-form alert. With a type that declares fields, `fields` are validated
|
|
4258
|
+
* against its schema; otherwise they are self-declaring.
|
|
4259
|
+
*/
|
|
4260
|
+
alertType?: string | null;
|
|
4261
|
+
subject: string;
|
|
4262
|
+
/** Defaults to the type's `defaultRiskLevel`. */
|
|
4263
|
+
riskLevel?: AlertRiskLevel;
|
|
4264
|
+
/** Customer the alert is about. Archived customers are allowed. */
|
|
4265
|
+
customerId?: string | null;
|
|
4266
|
+
/** Markdown narrative. */
|
|
4267
|
+
notes?: string | null;
|
|
4268
|
+
/** Structured details. Validated against the type's schema when one is given, self-declaring otherwise. */
|
|
4269
|
+
fields?: TypedFieldValueInput[];
|
|
4270
|
+
/** Org member ids to assign at creation; they are notified. */
|
|
4271
|
+
assignedToUserIds?: string[];
|
|
4272
|
+
/** Team ids to assign at creation; members are notified. */
|
|
4273
|
+
assignedToTeamIds?: string[];
|
|
4274
|
+
resources?: AlertResourceRefDto[];
|
|
4275
|
+
/**
|
|
4276
|
+
* Idempotency key, scoped per **organization** (not per API key): two
|
|
4277
|
+
* keys replaying the same upstream event converge on one alert.
|
|
4278
|
+
*/
|
|
4279
|
+
externalRequestId?: string | null;
|
|
4280
|
+
}
|
|
4281
|
+
export interface UpdateAlertNotesDto {
|
|
4282
|
+
/** Markdown. Null or empty clears the notes. */
|
|
4283
|
+
notes?: string | null;
|
|
4284
|
+
}
|
|
4285
|
+
/** Flat REST view of an alert (any type). The GraphQL surface carries the rich per-type shape. */
|
|
4286
|
+
export interface AlertResponseDto {
|
|
4287
|
+
id: string;
|
|
4288
|
+
type: 'SCREENING' | 'RULE_TRIGGER' | 'CUSTOM';
|
|
4289
|
+
customAlertTypeId: string | null;
|
|
4290
|
+
status: 'OPEN' | 'CLOSED';
|
|
4291
|
+
subject: string;
|
|
4292
|
+
riskLevel: AlertRiskLevel;
|
|
4293
|
+
customerId: string | null;
|
|
4294
|
+
assignedToUserIds: string[];
|
|
4295
|
+
assignedToTeamIds: string[];
|
|
4296
|
+
/** Stored typed-field bag (`{ [key]: { type, value } }`) for CUSTOM alerts; `{}` otherwise. */
|
|
4297
|
+
fields: Record<string, unknown>;
|
|
4298
|
+
notes: string | null;
|
|
4299
|
+
createdBy: {
|
|
4300
|
+
type: 'USER' | 'SERVICE' | 'UNRESOLVED';
|
|
4301
|
+
userId: string;
|
|
4302
|
+
name: string;
|
|
4303
|
+
} | null;
|
|
4304
|
+
externalRequestId: string | null;
|
|
4305
|
+
disposition: string | null;
|
|
4306
|
+
dispositionReason: string | null;
|
|
4307
|
+
closedAt: string | null;
|
|
4308
|
+
createdAt: string;
|
|
4309
|
+
updatedAt: string;
|
|
4310
|
+
/** Present on `alerts.create` and `alerts.get`. */
|
|
4311
|
+
resources?: AlertResourceDto[];
|
|
4312
|
+
}
|
|
1974
4313
|
//# sourceMappingURL=types.d.ts.map
|