@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/service.js
CHANGED
|
@@ -19,15 +19,28 @@ export class DossiersOSAPIService {
|
|
|
19
19
|
accounts;
|
|
20
20
|
counterparties;
|
|
21
21
|
devices;
|
|
22
|
+
paymentInstruments;
|
|
23
|
+
sessions;
|
|
24
|
+
channelEndpoints;
|
|
22
25
|
transactions;
|
|
26
|
+
transactionAttempts;
|
|
27
|
+
behaviorSettings;
|
|
23
28
|
events;
|
|
29
|
+
riskSignals;
|
|
30
|
+
employees;
|
|
31
|
+
branches;
|
|
24
32
|
exchangeRates;
|
|
33
|
+
states;
|
|
25
34
|
identificationDocuments;
|
|
26
35
|
alerts;
|
|
27
36
|
platform;
|
|
28
37
|
config;
|
|
29
38
|
setup;
|
|
30
39
|
settings;
|
|
40
|
+
customLists;
|
|
41
|
+
teams;
|
|
42
|
+
reports;
|
|
43
|
+
partyRelationships;
|
|
31
44
|
constructor(options) {
|
|
32
45
|
if (!options.baseUrl)
|
|
33
46
|
throw new Error('DossiersOSAPIService: baseUrl is required');
|
|
@@ -44,15 +57,28 @@ export class DossiersOSAPIService {
|
|
|
44
57
|
this.accounts = new AccountsResource(req);
|
|
45
58
|
this.counterparties = new CounterpartiesResource(req);
|
|
46
59
|
this.devices = new DevicesResource(req);
|
|
60
|
+
this.paymentInstruments = new PaymentInstrumentsResource(req);
|
|
61
|
+
this.sessions = new SessionsResource(req);
|
|
62
|
+
this.channelEndpoints = new ChannelEndpointsResource(req);
|
|
47
63
|
this.transactions = new TransactionsResource(req);
|
|
64
|
+
this.transactionAttempts = new TransactionAttemptsResource(req);
|
|
65
|
+
this.behaviorSettings = new BehaviorSettingsResource(req);
|
|
48
66
|
this.events = new EventsResource(req);
|
|
67
|
+
this.riskSignals = new RiskSignalsResource(req);
|
|
68
|
+
this.employees = new EmployeesResource(req);
|
|
69
|
+
this.branches = new BranchesResource(req);
|
|
49
70
|
this.exchangeRates = new ExchangeRatesResource(req);
|
|
71
|
+
this.states = new StatesResource(req);
|
|
50
72
|
this.identificationDocuments = new IdentificationDocumentsResource(req);
|
|
51
73
|
this.alerts = new AlertsResource(req);
|
|
52
74
|
this.platform = new PlatformResource(req);
|
|
53
75
|
this.config = new ConfigResource(req);
|
|
54
76
|
this.setup = new SetupResource(req);
|
|
55
77
|
this.settings = new SettingsResource(req);
|
|
78
|
+
this.customLists = new CustomListsResource(req);
|
|
79
|
+
this.teams = new TeamsResource(req);
|
|
80
|
+
this.reports = new ReportsResource((path) => this.requestBinary(path));
|
|
81
|
+
this.partyRelationships = new PartyRelationshipsResource(req);
|
|
56
82
|
}
|
|
57
83
|
async request(method, path, opts = {}) {
|
|
58
84
|
const url = new URL(`${this.baseUrl}${path}`);
|
|
@@ -92,6 +118,44 @@ export class DossiersOSAPIService {
|
|
|
92
118
|
}
|
|
93
119
|
return parsed;
|
|
94
120
|
}
|
|
121
|
+
/** GET a binary body (PDF reports). Errors are parsed the same way as JSON requests. */
|
|
122
|
+
async requestBinary(path) {
|
|
123
|
+
const url = `${this.baseUrl}${path}`;
|
|
124
|
+
const response = await this.fetchImpl(url, {
|
|
125
|
+
method: 'GET',
|
|
126
|
+
headers: { Authorization: `Bearer ${this.apiKey}`, Accept: 'application/pdf' },
|
|
127
|
+
});
|
|
128
|
+
if (!response.ok) {
|
|
129
|
+
const raw = await response.text();
|
|
130
|
+
const parsed = raw.length > 0 ? safeJsonParse(raw) : undefined;
|
|
131
|
+
const message = (parsed && typeof parsed === 'object' && 'message' in parsed
|
|
132
|
+
? String(parsed.message)
|
|
133
|
+
: null) ?? `Dossiers OS API GET ${path} failed: ${response.status}`;
|
|
134
|
+
throw new DossiersOSAPIError(response.status, message, parsed ?? raw);
|
|
135
|
+
}
|
|
136
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export class PartyRelationshipsResource {
|
|
140
|
+
req;
|
|
141
|
+
constructor(req) {
|
|
142
|
+
this.req = req;
|
|
143
|
+
}
|
|
144
|
+
listTypes() {
|
|
145
|
+
return this.req('GET', '/v1/party-relationships/types');
|
|
146
|
+
}
|
|
147
|
+
createType(input) {
|
|
148
|
+
return this.req('POST', '/v1/party-relationships/types', { body: input });
|
|
149
|
+
}
|
|
150
|
+
list(partyType, partyId) {
|
|
151
|
+
return this.req('GET', '/v1/party-relationships', { query: { partyType, partyId } });
|
|
152
|
+
}
|
|
153
|
+
create(input) {
|
|
154
|
+
return this.req('POST', '/v1/party-relationships', { body: input });
|
|
155
|
+
}
|
|
156
|
+
end(id) {
|
|
157
|
+
return this.req('POST', `/v1/party-relationships/${encodeURIComponent(id)}/end`);
|
|
158
|
+
}
|
|
95
159
|
}
|
|
96
160
|
function safeJsonParse(raw) {
|
|
97
161
|
try {
|
|
@@ -191,8 +255,16 @@ export class IndividualsResource {
|
|
|
191
255
|
list(query = {}) {
|
|
192
256
|
return this.req('GET', '/v1/customers/individuals', { query });
|
|
193
257
|
}
|
|
194
|
-
|
|
195
|
-
|
|
258
|
+
/**
|
|
259
|
+
* `POST /v1/customers/individuals` — create an individual. Pass
|
|
260
|
+
* `{ screening: 'sync' }` to run the INITIAL screening before the call
|
|
261
|
+
* returns; the result and its matches then arrive under `screening`.
|
|
262
|
+
*/
|
|
263
|
+
create(input, options = {}) {
|
|
264
|
+
return this.req('POST', '/v1/customers/individuals', {
|
|
265
|
+
body: input,
|
|
266
|
+
query: { screening: options.screening },
|
|
267
|
+
});
|
|
196
268
|
}
|
|
197
269
|
get(customerId, query = {}) {
|
|
198
270
|
return this.req('GET', `/v1/customers/individuals/${encodeURIComponent(customerId)}`, {
|
|
@@ -256,8 +328,16 @@ export class EntitiesResource {
|
|
|
256
328
|
list(query = {}) {
|
|
257
329
|
return this.req('GET', '/v1/customers/entities', { query });
|
|
258
330
|
}
|
|
259
|
-
|
|
260
|
-
|
|
331
|
+
/**
|
|
332
|
+
* `POST /v1/customers/entities` — create an entity. Pass
|
|
333
|
+
* `{ screening: 'sync' }` to run the INITIAL screening before the call
|
|
334
|
+
* returns; the result and its matches then arrive under `screening`.
|
|
335
|
+
*/
|
|
336
|
+
create(input, options = {}) {
|
|
337
|
+
return this.req('POST', '/v1/customers/entities', {
|
|
338
|
+
body: input,
|
|
339
|
+
query: { screening: options.screening },
|
|
340
|
+
});
|
|
261
341
|
}
|
|
262
342
|
get(customerId, query = {}) {
|
|
263
343
|
return this.req('GET', `/v1/customers/entities/${encodeURIComponent(customerId)}`, {
|
|
@@ -301,23 +381,104 @@ export class EntityIdentificationDocumentsResource {
|
|
|
301
381
|
}
|
|
302
382
|
}
|
|
303
383
|
export class CustomersResource {
|
|
384
|
+
req;
|
|
304
385
|
notes;
|
|
305
386
|
files;
|
|
306
387
|
screening;
|
|
388
|
+
kyc;
|
|
307
389
|
riskRating;
|
|
308
390
|
status;
|
|
309
391
|
riskAssessments;
|
|
310
392
|
expectedActivity;
|
|
311
393
|
devices;
|
|
394
|
+
assignment;
|
|
312
395
|
constructor(req) {
|
|
396
|
+
this.req = req;
|
|
313
397
|
this.notes = new CustomerNotesResource(req);
|
|
314
398
|
this.files = new CustomerFilesResource(req);
|
|
315
399
|
this.screening = new CustomerScreeningResource(req);
|
|
400
|
+
this.kyc = new CustomerKycResource(req);
|
|
316
401
|
this.riskRating = new CustomerRiskRatingResource(req);
|
|
317
402
|
this.status = new CustomerStatusResource(req);
|
|
318
403
|
this.riskAssessments = new CustomerRiskAssessmentsResource(req);
|
|
319
404
|
this.expectedActivity = new CustomerExpectedActivityResource(req);
|
|
320
405
|
this.devices = new CustomerDevicesResource(req);
|
|
406
|
+
this.assignment = new CustomerAssignmentResource(req);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* `POST /v1/customers/{customerId}/archive` — archive a customer
|
|
410
|
+
* (organization owner/admin only, irreversible). Frees the customer's
|
|
411
|
+
* external ID for reuse and makes the record read-only.
|
|
412
|
+
*/
|
|
413
|
+
archive(customerId, input = {}) {
|
|
414
|
+
return this.req('POST', `/v1/customers/${encodeURIComponent(customerId)}/archive`, {
|
|
415
|
+
body: input,
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
export class CustomerAssignmentResource {
|
|
420
|
+
req;
|
|
421
|
+
constructor(req) {
|
|
422
|
+
this.req = req;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* `POST /v1/customers/{customerId}/assignment` — add users/teams to a
|
|
426
|
+
* customer's standing assignment (additive; never silently removes).
|
|
427
|
+
*/
|
|
428
|
+
assign(customerId, input) {
|
|
429
|
+
return this.req('POST', `/v1/customers/${encodeURIComponent(customerId)}/assignment`, {
|
|
430
|
+
body: input,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* `DELETE /v1/customers/{customerId}/assignment` — remove users/teams from
|
|
435
|
+
* a customer's standing assignment.
|
|
436
|
+
*/
|
|
437
|
+
unassign(customerId, input) {
|
|
438
|
+
return this.req('DELETE', `/v1/customers/${encodeURIComponent(customerId)}/assignment`, {
|
|
439
|
+
body: input,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* `POST /v1/customers/assignment` — assign many customers to the same
|
|
444
|
+
* users/teams. Customers that already carry the target are skipped.
|
|
445
|
+
*/
|
|
446
|
+
assignMany(input) {
|
|
447
|
+
return this.req('POST', '/v1/customers/assignment', { body: input });
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
export class TeamsResource {
|
|
451
|
+
req;
|
|
452
|
+
constructor(req) {
|
|
453
|
+
this.req = req;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Active teams. `tags` is an any-of filter over the team's `team.tags`
|
|
457
|
+
* catalogue values (repeated as `?tags=a&tags=b`).
|
|
458
|
+
*/
|
|
459
|
+
list(query = {}) {
|
|
460
|
+
return this.req('GET', '/v1/teams', { query });
|
|
461
|
+
}
|
|
462
|
+
get(id) {
|
|
463
|
+
return this.req('GET', `/v1/teams/${encodeURIComponent(id)}`);
|
|
464
|
+
}
|
|
465
|
+
create(input) {
|
|
466
|
+
return this.req('POST', '/v1/teams', { body: input });
|
|
467
|
+
}
|
|
468
|
+
update(id, input) {
|
|
469
|
+
return this.req('PATCH', `/v1/teams/${encodeURIComponent(id)}`, { body: input });
|
|
470
|
+
}
|
|
471
|
+
archive(id) {
|
|
472
|
+
return this.req('POST', `/v1/teams/${encodeURIComponent(id)}/archive`);
|
|
473
|
+
}
|
|
474
|
+
delete(id) {
|
|
475
|
+
return this.req('DELETE', `/v1/teams/${encodeURIComponent(id)}`);
|
|
476
|
+
}
|
|
477
|
+
addMembers(id, input) {
|
|
478
|
+
return this.req('POST', `/v1/teams/${encodeURIComponent(id)}/members`, { body: input });
|
|
479
|
+
}
|
|
480
|
+
removeMembers(id, input) {
|
|
481
|
+
return this.req('DELETE', `/v1/teams/${encodeURIComponent(id)}/members`, { body: input });
|
|
321
482
|
}
|
|
322
483
|
}
|
|
323
484
|
export class CustomerNotesResource {
|
|
@@ -371,10 +532,89 @@ export class CustomerScreeningResource {
|
|
|
371
532
|
trigger(customerId) {
|
|
372
533
|
return this.req('POST', `/v1/customers/${encodeURIComponent(customerId)}/screen`);
|
|
373
534
|
}
|
|
535
|
+
/**
|
|
536
|
+
* `GET /v1/customers/{customerId}/screening-history` — every screening run
|
|
537
|
+
* for the customer, most recent first. `limit` caps the number of entries
|
|
538
|
+
* returned (default 50 server-side).
|
|
539
|
+
*/
|
|
540
|
+
listHistory(customerId, params = {}) {
|
|
541
|
+
const query = {};
|
|
542
|
+
if (params.limit !== undefined)
|
|
543
|
+
query.limit = params.limit;
|
|
544
|
+
return this.req('GET', `/v1/customers/${encodeURIComponent(customerId)}/screening-history`, { query });
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* `GET /v1/customers/{customerId}/screening-history/latest` — the most
|
|
548
|
+
* recent screening run, or `null` if the customer has never been screened.
|
|
549
|
+
*/
|
|
550
|
+
async getLast(customerId) {
|
|
551
|
+
const latest = await this.req('GET', `/v1/customers/${encodeURIComponent(customerId)}/screening-history/latest`);
|
|
552
|
+
return latest ?? null;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* `GET /v1/customers/{customerId}/screening-results` — every match for the
|
|
556
|
+
* customer with its current disposition (true positives = `CONFIRMED`,
|
|
557
|
+
* false positives = `FALSE_POSITIVE`, plus undecided `PENDING`, which
|
|
558
|
+
* also covers matches a workflow reviewer marked inconclusive). Pass
|
|
559
|
+
* `disposition` to filter (e.g. `['CONFIRMED', 'FALSE_POSITIVE']`).
|
|
560
|
+
*/
|
|
561
|
+
listResults(customerId, params = {}) {
|
|
562
|
+
const query = {};
|
|
563
|
+
if (params.disposition && params.disposition.length > 0) {
|
|
564
|
+
query.disposition = params.disposition.join(',');
|
|
565
|
+
}
|
|
566
|
+
return this.req('GET', `/v1/customers/${encodeURIComponent(customerId)}/screening-results`, { query });
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* `GET /v1/customers/{customerId}/confirmed-matches` — confirmed
|
|
570
|
+
* (true-positive) matches only. Alias for `listResults` filtered to
|
|
571
|
+
* `CONFIRMED`, kept for backwards compatibility.
|
|
572
|
+
*/
|
|
374
573
|
listConfirmedMatches(customerId) {
|
|
375
574
|
return this.req('GET', `/v1/customers/${encodeURIComponent(customerId)}/confirmed-matches`);
|
|
376
575
|
}
|
|
377
576
|
}
|
|
577
|
+
/**
|
|
578
|
+
* KYC verification sessions for a customer. A session is an asynchronous,
|
|
579
|
+
* customer-driven flow: `start()` returns a hosted `sessionUrl` the customer
|
|
580
|
+
* visits; completion arrives out-of-band (provider webhook) or can be pulled
|
|
581
|
+
* with `refresh()`.
|
|
582
|
+
*/
|
|
583
|
+
export class CustomerKycResource {
|
|
584
|
+
req;
|
|
585
|
+
constructor(req) {
|
|
586
|
+
this.req = req;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* `POST /v1/customers/{customerId}/kyc/sessions` — start a KYC session with
|
|
590
|
+
* the organization's active provider. Hand the returned `sessionUrl` to the
|
|
591
|
+
* customer.
|
|
592
|
+
*/
|
|
593
|
+
start(customerId) {
|
|
594
|
+
return this.req('POST', `/v1/customers/${encodeURIComponent(customerId)}/kyc/sessions`);
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* `GET /v1/customers/{customerId}/kyc/sessions` — list a customer's KYC
|
|
598
|
+
* sessions, newest first.
|
|
599
|
+
*/
|
|
600
|
+
list(customerId) {
|
|
601
|
+
return this.req('GET', `/v1/customers/${encodeURIComponent(customerId)}/kyc/sessions`);
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* `POST /v1/customers/{customerId}/kyc/sessions/{sessionId}/refresh` — pull
|
|
605
|
+
* the latest provider state for a session and persist it.
|
|
606
|
+
*/
|
|
607
|
+
refresh(customerId, sessionId) {
|
|
608
|
+
return this.req('POST', `/v1/customers/${encodeURIComponent(customerId)}/kyc/sessions/${encodeURIComponent(sessionId)}/refresh`);
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* `DELETE /v1/customers/{customerId}/kyc/sessions/{sessionId}` — cancel the
|
|
612
|
+
* session at the provider and remove the local record.
|
|
613
|
+
*/
|
|
614
|
+
delete(customerId, sessionId) {
|
|
615
|
+
return this.req('DELETE', `/v1/customers/${encodeURIComponent(customerId)}/kyc/sessions/${encodeURIComponent(sessionId)}`);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
378
618
|
export class CustomerRiskRatingResource {
|
|
379
619
|
req;
|
|
380
620
|
constructor(req) {
|
|
@@ -539,6 +779,62 @@ export class DevicesResource {
|
|
|
539
779
|
get(deviceId) {
|
|
540
780
|
return this.req('GET', `/v1/devices/${encodeURIComponent(deviceId)}`);
|
|
541
781
|
}
|
|
782
|
+
/** Canonicalize the source device into the target without deleting history. */
|
|
783
|
+
merge(targetDeviceId, input) {
|
|
784
|
+
return this.req('POST', `/v1/devices/${encodeURIComponent(targetDeviceId)}/merge`, { body: input });
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
export class PaymentInstrumentsResource {
|
|
788
|
+
req;
|
|
789
|
+
constructor(req) {
|
|
790
|
+
this.req = req;
|
|
791
|
+
}
|
|
792
|
+
list() {
|
|
793
|
+
return this.req('GET', '/v1/payment-instruments');
|
|
794
|
+
}
|
|
795
|
+
get(id) {
|
|
796
|
+
return this.req('GET', `/v1/payment-instruments/${encodeURIComponent(id)}`);
|
|
797
|
+
}
|
|
798
|
+
create(input) {
|
|
799
|
+
return this.req('POST', '/v1/payment-instruments', { body: input });
|
|
800
|
+
}
|
|
801
|
+
update(id, input) {
|
|
802
|
+
return this.req('PATCH', `/v1/payment-instruments/${encodeURIComponent(id)}`, { body: input });
|
|
803
|
+
}
|
|
804
|
+
linkAccount(id, input) {
|
|
805
|
+
return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/accounts`, { body: input });
|
|
806
|
+
}
|
|
807
|
+
unlinkAccount(id, relationshipId, validTo) {
|
|
808
|
+
return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/accounts/${encodeURIComponent(relationshipId)}/unlink`, { body: { validTo } });
|
|
809
|
+
}
|
|
810
|
+
linkCustomer(id, input) {
|
|
811
|
+
return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/customers`, { body: input });
|
|
812
|
+
}
|
|
813
|
+
unlinkCustomer(id, relationshipId, validTo) {
|
|
814
|
+
return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/customers/${encodeURIComponent(relationshipId)}/unlink`, { body: { validTo } });
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
export class SessionsResource {
|
|
818
|
+
req;
|
|
819
|
+
constructor(req) {
|
|
820
|
+
this.req = req;
|
|
821
|
+
}
|
|
822
|
+
list() { return this.req('GET', '/v1/sessions'); }
|
|
823
|
+
get(id) { return this.req('GET', `/v1/sessions/${encodeURIComponent(id)}`); }
|
|
824
|
+
update(id, input) {
|
|
825
|
+
return this.req('PATCH', `/v1/sessions/${encodeURIComponent(id)}`, { body: input });
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
export class ChannelEndpointsResource {
|
|
829
|
+
req;
|
|
830
|
+
constructor(req) {
|
|
831
|
+
this.req = req;
|
|
832
|
+
}
|
|
833
|
+
list() { return this.req('GET', '/v1/channel-endpoints'); }
|
|
834
|
+
get(id) { return this.req('GET', `/v1/channel-endpoints/${encodeURIComponent(id)}`); }
|
|
835
|
+
update(id, input) {
|
|
836
|
+
return this.req('PATCH', `/v1/channel-endpoints/${encodeURIComponent(id)}`, { body: input });
|
|
837
|
+
}
|
|
542
838
|
}
|
|
543
839
|
export class TransactionsResource {
|
|
544
840
|
req;
|
|
@@ -555,16 +851,193 @@ export class TransactionsResource {
|
|
|
555
851
|
patchStatus(input) {
|
|
556
852
|
return this.req('PATCH', '/v1/transactions', { body: input });
|
|
557
853
|
}
|
|
854
|
+
/**
|
|
855
|
+
* Read back a stored transaction. By default `reference` is your own
|
|
856
|
+
* `transactionId`; pass `{ by: 'id' }` to look up the internal UUID
|
|
857
|
+
* returned by `ingest()`.
|
|
858
|
+
*/
|
|
859
|
+
get(reference, opts = {}) {
|
|
860
|
+
return this.req('GET', `/v1/transactions/${encodeURIComponent(reference)}`, {
|
|
861
|
+
query: opts.by ? { by: opts.by } : undefined,
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
export class TransactionAttemptsResource {
|
|
866
|
+
req;
|
|
867
|
+
constructor(req) {
|
|
868
|
+
this.req = req;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* `POST /v1/transaction-attempts` — retain a failed, blocked, or unknown
|
|
872
|
+
* operation as behavioural history. This does not trigger rule evaluation.
|
|
873
|
+
*/
|
|
874
|
+
ingest(input) {
|
|
875
|
+
return this.req('POST', '/v1/transaction-attempts', { body: input });
|
|
876
|
+
}
|
|
877
|
+
/** List retained attempts using an opaque, stable cursor. Requires `config:read`. */
|
|
878
|
+
list(input = {}) {
|
|
879
|
+
return this.req('GET', '/v1/transaction-attempts', { query: input });
|
|
880
|
+
}
|
|
881
|
+
/** Read one retained attempt by its database id. Requires `config:read`. */
|
|
882
|
+
get(id) {
|
|
883
|
+
return this.req('GET', `/v1/transaction-attempts/${encodeURIComponent(id)}`);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
export class BehaviorSettingsResource {
|
|
887
|
+
req;
|
|
888
|
+
constructor(req) {
|
|
889
|
+
this.req = req;
|
|
890
|
+
}
|
|
891
|
+
get() {
|
|
892
|
+
return this.req('GET', '/v1/config/behavior-settings');
|
|
893
|
+
}
|
|
894
|
+
update(input) {
|
|
895
|
+
return this.req('PATCH', '/v1/config/behavior-settings', { body: input });
|
|
896
|
+
}
|
|
558
897
|
}
|
|
559
898
|
export class EventsResource {
|
|
560
899
|
req;
|
|
561
900
|
constructor(req) {
|
|
562
901
|
this.req = req;
|
|
563
902
|
}
|
|
903
|
+
/**
|
|
904
|
+
* `POST /v1/events` — store a behavioral event.
|
|
905
|
+
*
|
|
906
|
+
* Every event is about exactly one resource: pass
|
|
907
|
+
* `resource: { type, id }`. A bare top-level `customerId` is still
|
|
908
|
+
* accepted as the legacy spelling of `resource: { type: 'CUSTOMER', id }`,
|
|
909
|
+
* and `resource` wins when both are present; an event naming neither is
|
|
910
|
+
* rejected with 400.
|
|
911
|
+
*
|
|
912
|
+
* Supply `input.eventId` (your unique identifier) to make retries safe:
|
|
913
|
+
* resubmitting the same `eventId` returns the original stored event with
|
|
914
|
+
* `cached: true` instead of creating a duplicate. Idempotency covers the
|
|
915
|
+
* event's Risk Signals too — a replay echoes the same `riskSignalIds`
|
|
916
|
+
* rather than emitting a second set.
|
|
917
|
+
*
|
|
918
|
+
* The response carries the resolved `resource` and the `riskSignalIds`
|
|
919
|
+
* emitted by the event definition's `riskSignalEffects`.
|
|
920
|
+
*/
|
|
564
921
|
ingest(input) {
|
|
565
922
|
return this.req('POST', '/v1/events', { body: input });
|
|
566
923
|
}
|
|
567
924
|
}
|
|
925
|
+
/**
|
|
926
|
+
* Risk Signals — time-decaying evidence attached to one resource.
|
|
927
|
+
*
|
|
928
|
+
* A Risk Signal is evidence, **not** an Alert: adding one creates no alert, no
|
|
929
|
+
* notification, no assignment and no task, and does not change the resource's
|
|
930
|
+
* Risk Rating. Rules read the aggregate effective weight and decide for
|
|
931
|
+
* themselves.
|
|
932
|
+
*/
|
|
933
|
+
export class RiskSignalsResource {
|
|
934
|
+
req;
|
|
935
|
+
constructor(req) {
|
|
936
|
+
this.req = req;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* `POST /v1/risk-signals` — attach a piece of evidence to one resource.
|
|
940
|
+
*
|
|
941
|
+
* The signal records the strength it had at `occurredAt` and how fast that
|
|
942
|
+
* strength halves, so weight 40 with half-life `P7D` reads 20 after seven
|
|
943
|
+
* days and 10 after fourteen.
|
|
944
|
+
*
|
|
945
|
+
* Supply `externalId` to make retries safe — resubmitting the same
|
|
946
|
+
* `externalId` returns the original signal instead of adding a second one.
|
|
947
|
+
*
|
|
948
|
+
* The server sets the source to `MANUAL` and captures the authenticated
|
|
949
|
+
* actor; a caller cannot claim a signal came from an Event or a Rule.
|
|
950
|
+
*/
|
|
951
|
+
create(input) {
|
|
952
|
+
return this.req('POST', '/v1/risk-signals', { body: input });
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* `GET /v1/risk-signals` — read a resource's Risk Signals with their
|
|
956
|
+
* decayed weights, plus the aggregate effective weight.
|
|
957
|
+
*
|
|
958
|
+
* The aggregate is computed as of `asOf` (defaulting to server time) — it
|
|
959
|
+
* is not a cached score column on the resource, so a historical `asOf`
|
|
960
|
+
* returns what the resource looked like at that moment.
|
|
961
|
+
*
|
|
962
|
+
* `type` and `sourceType` filter which records contribute. They never
|
|
963
|
+
* change how far a contributing signal has decayed: age is always measured
|
|
964
|
+
* to `asOf`.
|
|
965
|
+
*/
|
|
966
|
+
list(query) {
|
|
967
|
+
return this.req('GET', '/v1/risk-signals', { query });
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Employees — people acting inside the financial institution's ecosystem.
|
|
972
|
+
*
|
|
973
|
+
* Monitored domain data, distinct from Dossiers organization members: an
|
|
974
|
+
* Employee need not have a Dossiers login, and an Employee id is never an
|
|
975
|
+
* org-member id. Employees are an attachable resource for Events and Risk
|
|
976
|
+
* Signals.
|
|
977
|
+
*/
|
|
978
|
+
export class EmployeesResource {
|
|
979
|
+
req;
|
|
980
|
+
constructor(req) {
|
|
981
|
+
this.req = req;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* `GET /v1/employees`.
|
|
985
|
+
*
|
|
986
|
+
* The endpoint declares `cursor` / `limit`, but the server currently
|
|
987
|
+
* resolves its own paging defaults (first page, 50 records) — treat paging
|
|
988
|
+
* as server-defaulted rather than caller-controlled.
|
|
989
|
+
*/
|
|
990
|
+
list(query = {}) {
|
|
991
|
+
return this.req('GET', '/v1/employees', { query });
|
|
992
|
+
}
|
|
993
|
+
get(id) {
|
|
994
|
+
return this.req('GET', `/v1/employees/${encodeURIComponent(id)}`);
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* `POST /v1/employees`. `externalEmployeeId` must be unique within the
|
|
998
|
+
* organization; a duplicate is rejected with 400.
|
|
999
|
+
*/
|
|
1000
|
+
create(input) {
|
|
1001
|
+
return this.req('POST', '/v1/employees', { body: input });
|
|
1002
|
+
}
|
|
1003
|
+
update(id, input) {
|
|
1004
|
+
return this.req('PATCH', `/v1/employees/${encodeURIComponent(id)}`, { body: input });
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Branches — the institution's own physical or organizational units, through
|
|
1009
|
+
* which Employees act. Like Employee, an attachable resource for Events and
|
|
1010
|
+
* Risk Signals.
|
|
1011
|
+
*/
|
|
1012
|
+
export class BranchesResource {
|
|
1013
|
+
req;
|
|
1014
|
+
constructor(req) {
|
|
1015
|
+
this.req = req;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* `GET /v1/branches`.
|
|
1019
|
+
*
|
|
1020
|
+
* The endpoint declares `cursor` / `limit`, but the server currently
|
|
1021
|
+
* resolves its own paging defaults (first page, 50 records) — treat paging
|
|
1022
|
+
* as server-defaulted rather than caller-controlled.
|
|
1023
|
+
*/
|
|
1024
|
+
list(query = {}) {
|
|
1025
|
+
return this.req('GET', '/v1/branches', { query });
|
|
1026
|
+
}
|
|
1027
|
+
get(id) {
|
|
1028
|
+
return this.req('GET', `/v1/branches/${encodeURIComponent(id)}`);
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* `POST /v1/branches`. `externalBranchId` must be unique within the
|
|
1032
|
+
* organization.
|
|
1033
|
+
*/
|
|
1034
|
+
create(input) {
|
|
1035
|
+
return this.req('POST', '/v1/branches', { body: input });
|
|
1036
|
+
}
|
|
1037
|
+
update(id, input) {
|
|
1038
|
+
return this.req('PATCH', `/v1/branches/${encodeURIComponent(id)}`, { body: input });
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
568
1041
|
export class ExchangeRatesResource {
|
|
569
1042
|
req;
|
|
570
1043
|
constructor(req) {
|
|
@@ -589,6 +1062,12 @@ export class IdentificationDocumentsResource {
|
|
|
589
1062
|
get(id) {
|
|
590
1063
|
return this.req('GET', `/v1/identification-documents/${encodeURIComponent(id)}`);
|
|
591
1064
|
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Correct captured document fields (name, number, DOB, addresses, …).
|
|
1067
|
+
* Captured fields are frozen while the document is `APPROVED` (400) —
|
|
1068
|
+
* `transition` it back to `PENDING` first. `notes`/`tags`/`attachments`
|
|
1069
|
+
* stay editable in any status.
|
|
1070
|
+
*/
|
|
592
1071
|
update(id, input) {
|
|
593
1072
|
return this.req('PATCH', `/v1/identification-documents/${encodeURIComponent(id)}`, {
|
|
594
1073
|
body: input,
|
|
@@ -612,16 +1091,61 @@ export class IdentificationDocumentsResource {
|
|
|
612
1091
|
}
|
|
613
1092
|
}
|
|
614
1093
|
/**
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
*
|
|
1094
|
+
* Alerts. Screening and rule-trigger alerts are produced by the platform and
|
|
1095
|
+
* delivered via webhooks; **custom alerts** are raised here against an
|
|
1096
|
+
* org-defined Custom Alert Type (`config.customAlertTypes`). Every alert type
|
|
1097
|
+
* supports markdown notes, linked resources and comments.
|
|
1098
|
+
*
|
|
1099
|
+
* Requires the `alerts:read` / `alerts:write` API-key permissions.
|
|
620
1100
|
*/
|
|
621
1101
|
export class AlertsResource {
|
|
1102
|
+
req;
|
|
622
1103
|
comments;
|
|
1104
|
+
resources;
|
|
623
1105
|
constructor(req) {
|
|
1106
|
+
this.req = req;
|
|
624
1107
|
this.comments = new ResourceCommentsProxy(req, 'ALERT');
|
|
1108
|
+
this.resources = new AlertResourcesProxy(req);
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Raise an alert by hand. `alertType` is optional: with one, `fields` are
|
|
1112
|
+
* validated against the type's schema; without one the alert is free-form
|
|
1113
|
+
* and `fields` are self-declaring. Re-sending the same `externalRequestId`
|
|
1114
|
+
* returns the existing alert (201 either way) — the key is scoped per
|
|
1115
|
+
* organization.
|
|
1116
|
+
*/
|
|
1117
|
+
create(input) {
|
|
1118
|
+
return this.req('POST', '/v1/alerts', { body: input });
|
|
1119
|
+
}
|
|
1120
|
+
/** Flat view of any alert, with its linked resources. */
|
|
1121
|
+
get(alertId) {
|
|
1122
|
+
return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}`);
|
|
1123
|
+
}
|
|
1124
|
+
/** Replace the alert's markdown notes (any alert type). */
|
|
1125
|
+
updateNotes(alertId, input) {
|
|
1126
|
+
return this.req('PATCH', `/v1/alerts/${encodeURIComponent(alertId)}/notes`, { body: input });
|
|
1127
|
+
}
|
|
1128
|
+
/** Immutable attempt facts captured when attempt-history rules contributed to an alert. */
|
|
1129
|
+
attemptEvidence(alertId) {
|
|
1130
|
+
return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}/attempt-evidence`);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
/** Resources linked to an alert — `/v1/alerts/{id}/resources`. */
|
|
1134
|
+
export class AlertResourcesProxy {
|
|
1135
|
+
req;
|
|
1136
|
+
constructor(req) {
|
|
1137
|
+
this.req = req;
|
|
1138
|
+
}
|
|
1139
|
+
list(alertId) {
|
|
1140
|
+
return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}/resources`);
|
|
1141
|
+
}
|
|
1142
|
+
/** Idempotent on (resourceType, resourceId): re-linking returns the existing link. */
|
|
1143
|
+
add(alertId, input) {
|
|
1144
|
+
return this.req('POST', `/v1/alerts/${encodeURIComponent(alertId)}/resources`, { body: input });
|
|
1145
|
+
}
|
|
1146
|
+
/** `alertResourceId` is the link id from `list` / `add`, not the target's id. */
|
|
1147
|
+
remove(alertId, alertResourceId) {
|
|
1148
|
+
return this.req('DELETE', `/v1/alerts/${encodeURIComponent(alertId)}/resources/${encodeURIComponent(alertResourceId)}`);
|
|
625
1149
|
}
|
|
626
1150
|
}
|
|
627
1151
|
/**
|
|
@@ -681,21 +1205,32 @@ export class ConfigResource {
|
|
|
681
1205
|
req;
|
|
682
1206
|
rules;
|
|
683
1207
|
constants;
|
|
1208
|
+
alertWorkflows;
|
|
1209
|
+
/** @deprecated Read-only archive. Use alertWorkflows for assignment. */
|
|
1210
|
+
states;
|
|
1211
|
+
assignmentPolicies;
|
|
684
1212
|
products;
|
|
685
1213
|
currencies;
|
|
686
1214
|
eventDefinitions;
|
|
1215
|
+
customAlertTypes;
|
|
687
1216
|
webhooks;
|
|
688
1217
|
tagCatalogue;
|
|
1218
|
+
tagGroups;
|
|
689
1219
|
sync;
|
|
690
1220
|
constructor(req) {
|
|
691
1221
|
this.req = req;
|
|
692
1222
|
this.rules = new ConfigRulesResource(req);
|
|
693
1223
|
this.constants = new ConfigConstantsResource(req);
|
|
1224
|
+
this.alertWorkflows = new ConfigAlertWorkflowsResource(req);
|
|
1225
|
+
this.states = new ConfigStatesResource(req);
|
|
1226
|
+
this.assignmentPolicies = new ConfigAssignmentPoliciesResource(req);
|
|
694
1227
|
this.products = new ConfigProductsResource(req);
|
|
695
1228
|
this.currencies = new ConfigCurrenciesResource(req);
|
|
696
1229
|
this.eventDefinitions = new ConfigEventDefinitionsResource(req);
|
|
1230
|
+
this.customAlertTypes = new ConfigCustomAlertTypesResource(req);
|
|
697
1231
|
this.webhooks = new ConfigWebhooksResource(req);
|
|
698
1232
|
this.tagCatalogue = new ConfigTagCatalogueResource(req);
|
|
1233
|
+
this.tagGroups = new ConfigTagGroupsResource(req);
|
|
699
1234
|
this.sync = new ConfigSyncResource(req);
|
|
700
1235
|
}
|
|
701
1236
|
/** `DELETE /v1/config/reset` — clear all org config (destructive). */
|
|
@@ -744,9 +1279,30 @@ export class ConfigRulesResource {
|
|
|
744
1279
|
getBySyncKey(syncKey) {
|
|
745
1280
|
return this.req('GET', `/v1/config/rules/by-sync-key/${encodeURIComponent(syncKey)}`);
|
|
746
1281
|
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Dry-run rule simulation (spec v0 rules §11 backtest + synthetic
|
|
1284
|
+
* source). Read-only: nothing is persisted and no actions execute —
|
|
1285
|
+
* the response summarises what WOULD have happened. Requires only
|
|
1286
|
+
* `config:read`.
|
|
1287
|
+
*/
|
|
1288
|
+
backtest(input) {
|
|
1289
|
+
return this.req('POST', '/v1/config/rules/backtest', { body: input });
|
|
1290
|
+
}
|
|
747
1291
|
get(id) {
|
|
748
1292
|
return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}`);
|
|
749
1293
|
}
|
|
1294
|
+
/** List a rule's definitional version history, newest first (audit trail). */
|
|
1295
|
+
versions(id) {
|
|
1296
|
+
return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/versions`);
|
|
1297
|
+
}
|
|
1298
|
+
/** Get a single rule version by its version number. */
|
|
1299
|
+
getVersion(id, version) {
|
|
1300
|
+
return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/versions/${version}`);
|
|
1301
|
+
}
|
|
1302
|
+
/** Compute-on-read alert analytics for a rule: disposition breakdown + precision. */
|
|
1303
|
+
analytics(id) {
|
|
1304
|
+
return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/analytics`);
|
|
1305
|
+
}
|
|
750
1306
|
update(id, input) {
|
|
751
1307
|
return this.req('PATCH', `/v1/config/rules/${encodeURIComponent(id)}`, { body: input });
|
|
752
1308
|
}
|
|
@@ -768,6 +1324,75 @@ export class ConfigRulesResource {
|
|
|
768
1324
|
body: targetStatus ? { targetStatus } : undefined,
|
|
769
1325
|
});
|
|
770
1326
|
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Roll the rule back to a previous version. Forward-only: re-applies the
|
|
1329
|
+
* target version's definition through the validated update path and mints a
|
|
1330
|
+
* new version. Returns 409 if the restored definition no longer resolves
|
|
1331
|
+
* (e.g. a tombstoned reference), 403 for system rules.
|
|
1332
|
+
*/
|
|
1333
|
+
rollback(id, toVersion, reason) {
|
|
1334
|
+
return this.req('POST', `/v1/config/rules/${encodeURIComponent(id)}/rollback`, {
|
|
1335
|
+
body: { toVersion, reason },
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* One workflow per alert type. Stages control assignment and review requirements;
|
|
1341
|
+
* routers choose paths. Requires config:read / config:write.
|
|
1342
|
+
*/
|
|
1343
|
+
export class ConfigAlertWorkflowsResource {
|
|
1344
|
+
req;
|
|
1345
|
+
constructor(req) {
|
|
1346
|
+
this.req = req;
|
|
1347
|
+
}
|
|
1348
|
+
/** Organization-wide choice; defaults to SIMPLE until Defined workflows is selected. */
|
|
1349
|
+
getExperience() { return this.req('GET', '/v1/config/alert-workflows/experience'); }
|
|
1350
|
+
/** Requires config:write. Changes only the behavior of newly created alerts. */
|
|
1351
|
+
saveExperience(input) { return this.req('PUT', '/v1/config/alert-workflows/experience', { body: input }); }
|
|
1352
|
+
/** Requires config:read. Returns one workflow per alert type. */
|
|
1353
|
+
list() { return this.req('GET', '/v1/config/alert-workflows'); }
|
|
1354
|
+
/** Newest publication first. A null definition cannot be restored. Requires config:read. */
|
|
1355
|
+
versions(alertType) { return this.req('GET', `/v1/config/alert-workflows/${alertType}/versions`); }
|
|
1356
|
+
/** Replaces the draft with a saved version. Publishing is a separate operation; existing alerts are unchanged. */
|
|
1357
|
+
restore(alertType, input) { return this.req('POST', `/v1/config/alert-workflows/${alertType}/restore`, { body: input }); }
|
|
1358
|
+
get(alertType) { return this.req('GET', `/v1/config/alert-workflows/${alertType}`); }
|
|
1359
|
+
/** Requires config:write. Use revision from get(); publish=false only updates the draft. */
|
|
1360
|
+
save(alertType, input) { return this.req('PUT', `/v1/config/alert-workflows/${alertType}`, { body: input }); }
|
|
1361
|
+
}
|
|
1362
|
+
/** Read-only legacy policies. New alert assignment runs through alertWorkflows. */
|
|
1363
|
+
export class ConfigAssignmentPoliciesResource {
|
|
1364
|
+
req;
|
|
1365
|
+
constructor(req) {
|
|
1366
|
+
this.req = req;
|
|
1367
|
+
}
|
|
1368
|
+
/** List policies in evaluation order. */
|
|
1369
|
+
list() {
|
|
1370
|
+
return this.req('GET', '/v1/config/assignment-policies');
|
|
1371
|
+
}
|
|
1372
|
+
/** Create a policy (appended at the end of the evaluation order). */
|
|
1373
|
+
/** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
|
|
1374
|
+
create(input) {
|
|
1375
|
+
return this.req('POST', '/v1/config/assignment-policies', { body: input });
|
|
1376
|
+
}
|
|
1377
|
+
getBySyncKey(syncKey) {
|
|
1378
|
+
return this.req('GET', `/v1/config/assignment-policies/by-sync-key/${encodeURIComponent(syncKey)}`);
|
|
1379
|
+
}
|
|
1380
|
+
get(id) {
|
|
1381
|
+
return this.req('GET', `/v1/config/assignment-policies/${encodeURIComponent(id)}`);
|
|
1382
|
+
}
|
|
1383
|
+
/** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
|
|
1384
|
+
update(id, input) {
|
|
1385
|
+
return this.req('PUT', `/v1/config/assignment-policies/${encodeURIComponent(id)}`, { body: input });
|
|
1386
|
+
}
|
|
1387
|
+
/** Reorder: pass EVERY policy id in the desired order; priorities are reassigned 1..n. */
|
|
1388
|
+
/** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
|
|
1389
|
+
reorder(input) {
|
|
1390
|
+
return this.req('PUT', '/v1/config/assignment-policies/order/reorder', { body: input });
|
|
1391
|
+
}
|
|
1392
|
+
/** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
|
|
1393
|
+
delete(id) {
|
|
1394
|
+
return this.req('DELETE', `/v1/config/assignment-policies/${encodeURIComponent(id)}`);
|
|
1395
|
+
}
|
|
771
1396
|
}
|
|
772
1397
|
export class ConfigConstantsResource {
|
|
773
1398
|
req;
|
|
@@ -795,9 +1420,38 @@ export class ConfigConstantsResource {
|
|
|
795
1420
|
return this.req('DELETE', `/v1/config/constants/${encodeURIComponent(id)}`, { query });
|
|
796
1421
|
}
|
|
797
1422
|
}
|
|
1423
|
+
export class ConfigStatesResource {
|
|
1424
|
+
req;
|
|
1425
|
+
constructor(req) {
|
|
1426
|
+
this.req = req;
|
|
1427
|
+
}
|
|
1428
|
+
list() {
|
|
1429
|
+
return this.req('GET', '/v1/config/states');
|
|
1430
|
+
}
|
|
1431
|
+
create(input) {
|
|
1432
|
+
return this.req('POST', '/v1/config/states', { body: input });
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
export class StatesResource {
|
|
1436
|
+
req;
|
|
1437
|
+
constructor(req) {
|
|
1438
|
+
this.req = req;
|
|
1439
|
+
}
|
|
1440
|
+
change(input) {
|
|
1441
|
+
return this.req('POST', '/v1/states/change', { body: input });
|
|
1442
|
+
}
|
|
1443
|
+
get(resourceType, resourceId, name) {
|
|
1444
|
+
return this.req('GET', `/v1/states/${resourceType}/${encodeURIComponent(resourceId)}/${encodeURIComponent(name)}`);
|
|
1445
|
+
}
|
|
1446
|
+
history(resourceType, resourceId, name, limit = 100) {
|
|
1447
|
+
return this.req('GET', `/v1/states/${resourceType}/${encodeURIComponent(resourceId)}/${encodeURIComponent(name)}/history`, {
|
|
1448
|
+
query: { limit },
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
798
1452
|
/**
|
|
799
|
-
* Tag catalogue — per-org, per-field tag vocabulary plus enforcement. Backs
|
|
800
|
-
*
|
|
1453
|
+
* Tag catalogue — per-org, per-field tag vocabulary plus enforcement. Backs
|
|
1454
|
+
* every `TagValue[]` resource tag field. Under `strict` enforcement, writes
|
|
801
1455
|
* carrying off-catalogue values are rejected (422).
|
|
802
1456
|
*/
|
|
803
1457
|
export class ConfigTagCatalogueResource {
|
|
@@ -809,9 +1463,12 @@ export class ConfigTagCatalogueResource {
|
|
|
809
1463
|
list(query = {}) {
|
|
810
1464
|
return this.req('GET', '/v1/config/tag-catalogue', { query });
|
|
811
1465
|
}
|
|
812
|
-
/**
|
|
813
|
-
|
|
814
|
-
|
|
1466
|
+
/**
|
|
1467
|
+
* The fixed colour palette. Served by the API so the token list isn't
|
|
1468
|
+
* duplicated (and left to drift) in every client.
|
|
1469
|
+
*/
|
|
1470
|
+
palette() {
|
|
1471
|
+
return this.req('GET', '/v1/config/tag-catalogue/palette');
|
|
815
1472
|
}
|
|
816
1473
|
create(input) {
|
|
817
1474
|
return this.req('POST', '/v1/config/tag-catalogue', { body: input });
|
|
@@ -827,15 +1484,53 @@ export class ConfigTagCatalogueResource {
|
|
|
827
1484
|
delete(id) {
|
|
828
1485
|
return this.req('DELETE', `/v1/config/tag-catalogue/${encodeURIComponent(id)}`);
|
|
829
1486
|
}
|
|
830
|
-
/** Set enforcement (`open` | `strict`) for one field-key. */
|
|
831
|
-
setEnforcement(input) {
|
|
832
|
-
return this.req('PATCH', '/v1/config/tag-catalogue/enforcement', { body: input });
|
|
833
|
-
}
|
|
834
1487
|
/** Re-sync denormalised assignment labels from the catalogue. */
|
|
835
1488
|
backfill(fieldKey) {
|
|
836
1489
|
return this.req('POST', `/v1/config/tag-catalogue/backfill/${encodeURIComponent(fieldKey)}`);
|
|
837
1490
|
}
|
|
838
1491
|
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Tag groups — the facet layer over the catalogue. A group owns a namespace, so
|
|
1494
|
+
* its member tags are stored as `<group>:<tag>` and a group is recoverable from
|
|
1495
|
+
* a tag value by splitting on the first colon.
|
|
1496
|
+
*/
|
|
1497
|
+
export class ConfigTagGroupsResource {
|
|
1498
|
+
req;
|
|
1499
|
+
constructor(req) {
|
|
1500
|
+
this.req = req;
|
|
1501
|
+
}
|
|
1502
|
+
list(query = {}) {
|
|
1503
|
+
return this.req('GET', '/v1/config/tag-groups', { query });
|
|
1504
|
+
}
|
|
1505
|
+
create(input) {
|
|
1506
|
+
return this.req('POST', '/v1/config/tag-groups', { body: input });
|
|
1507
|
+
}
|
|
1508
|
+
update(id, input) {
|
|
1509
|
+
return this.req('PATCH', `/v1/config/tag-groups/${encodeURIComponent(id)}`, { body: input });
|
|
1510
|
+
}
|
|
1511
|
+
/** Archive a group. Its tags keep their namespaced values. */
|
|
1512
|
+
archive(id) {
|
|
1513
|
+
return this.req('POST', `/v1/config/tag-groups/${encodeURIComponent(id)}/archive`);
|
|
1514
|
+
}
|
|
1515
|
+
/** Hard-delete. Rejected while the group still owns tags — archive instead. */
|
|
1516
|
+
delete(id) {
|
|
1517
|
+
return this.req('DELETE', `/v1/config/tag-groups/${encodeURIComponent(id)}`);
|
|
1518
|
+
}
|
|
1519
|
+
/** Records holding more than one tag from this group — the SINGLE pre-flight. */
|
|
1520
|
+
cardinalityConflicts(id) {
|
|
1521
|
+
return this.req('GET', `/v1/config/tag-groups/${encodeURIComponent(id)}/cardinality-conflicts`);
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Move tags into (or out of, with `groupId: null`) a group.
|
|
1525
|
+
*
|
|
1526
|
+
* This changes each tag's stored VALUE, so it also rewrites assignments,
|
|
1527
|
+
* rule condition operands, and assignment-policy routing tables. Run it
|
|
1528
|
+
* with `dryRun: true` first — the report is identical, nothing is written.
|
|
1529
|
+
*/
|
|
1530
|
+
regroup(input) {
|
|
1531
|
+
return this.req('POST', '/v1/config/tag-groups/regroup', { body: input });
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
839
1534
|
export class ConfigProductsResource {
|
|
840
1535
|
req;
|
|
841
1536
|
constructor(req) {
|
|
@@ -896,6 +1591,54 @@ export class ConfigCurrenciesResource {
|
|
|
896
1591
|
bulkUpdateStatus(input) {
|
|
897
1592
|
return this.req('PATCH', '/v1/config/currencies/bulk-status', { body: input });
|
|
898
1593
|
}
|
|
1594
|
+
/** Archive a currency (LIVE → ARCHIVED). Also disables it. */
|
|
1595
|
+
archive(id) {
|
|
1596
|
+
return this.req('POST', `/v1/config/currencies/${encodeURIComponent(id)}/archive`);
|
|
1597
|
+
}
|
|
1598
|
+
/** Tombstone a currency (terminal). Archive-first required — 409 if LIVE. */
|
|
1599
|
+
delete(id) {
|
|
1600
|
+
return this.req('DELETE', `/v1/config/currencies/${encodeURIComponent(id)}`);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Org-defined alert types for custom alerts — `/v1/config/custom-alert-types`.
|
|
1605
|
+
* Requires `config:read` / `config:write`. Follows the canonical lifecycle:
|
|
1606
|
+
* archive (blocked while alerts of the type are OPEN) → tombstone.
|
|
1607
|
+
*/
|
|
1608
|
+
export class ConfigCustomAlertTypesResource {
|
|
1609
|
+
req;
|
|
1610
|
+
constructor(req) {
|
|
1611
|
+
this.req = req;
|
|
1612
|
+
}
|
|
1613
|
+
list(query = {}) {
|
|
1614
|
+
return this.req('GET', '/v1/config/custom-alert-types', { query });
|
|
1615
|
+
}
|
|
1616
|
+
create(input) {
|
|
1617
|
+
return this.req('POST', '/v1/config/custom-alert-types', { body: input });
|
|
1618
|
+
}
|
|
1619
|
+
/** Returns `{ found: false }` when no type has that name. */
|
|
1620
|
+
getByName(name) {
|
|
1621
|
+
return this.req('GET', `/v1/config/custom-alert-types/by-name/${encodeURIComponent(name)}`);
|
|
1622
|
+
}
|
|
1623
|
+
get(id) {
|
|
1624
|
+
return this.req('GET', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`);
|
|
1625
|
+
}
|
|
1626
|
+
/** Schema edits apply to alerts raised afterwards; existing alerts are not re-validated. */
|
|
1627
|
+
update(id, input) {
|
|
1628
|
+
return this.req('PATCH', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`, { body: input });
|
|
1629
|
+
}
|
|
1630
|
+
/** Tombstones the type. Archive-first enforced. */
|
|
1631
|
+
delete(id) {
|
|
1632
|
+
return this.req('DELETE', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`);
|
|
1633
|
+
}
|
|
1634
|
+
/** LIVE → ARCHIVED. 409 while any alert of this type is OPEN. */
|
|
1635
|
+
archive(id) {
|
|
1636
|
+
return this.req('POST', `/v1/config/custom-alert-types/${encodeURIComponent(id)}/archive`);
|
|
1637
|
+
}
|
|
1638
|
+
/** ARCHIVED → LIVE. */
|
|
1639
|
+
unarchive(id) {
|
|
1640
|
+
return this.req('POST', `/v1/config/custom-alert-types/${encodeURIComponent(id)}/unarchive`);
|
|
1641
|
+
}
|
|
899
1642
|
}
|
|
900
1643
|
export class ConfigEventDefinitionsResource {
|
|
901
1644
|
req;
|
|
@@ -1011,4 +1754,105 @@ export class SettingsResource {
|
|
|
1011
1754
|
return this.req('GET', `/v1/settings/sync-snapshots/${encodeURIComponent(id)}/download`);
|
|
1012
1755
|
}
|
|
1013
1756
|
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Custom screening lists — tenant-managed lists (internal blocklists, exited
|
|
1759
|
+
* customers, local regulator lists) checked by every screening run alongside
|
|
1760
|
+
* external providers. Requires `config:read` / `config:write` API-key scope.
|
|
1761
|
+
*/
|
|
1762
|
+
export class CustomListsResource {
|
|
1763
|
+
req;
|
|
1764
|
+
constructor(req) {
|
|
1765
|
+
this.req = req;
|
|
1766
|
+
}
|
|
1767
|
+
/** `GET /v1/screening/custom-lists` — lists, LIVE only by default. */
|
|
1768
|
+
list(params = {}) {
|
|
1769
|
+
return this.req('GET', '/v1/screening/custom-lists', { query: params });
|
|
1770
|
+
}
|
|
1771
|
+
/** `POST /v1/screening/custom-lists` — create a list. */
|
|
1772
|
+
create(input) {
|
|
1773
|
+
return this.req('POST', '/v1/screening/custom-lists', { body: input });
|
|
1774
|
+
}
|
|
1775
|
+
/** `GET /v1/screening/custom-lists/{listId}`. */
|
|
1776
|
+
get(listId) {
|
|
1777
|
+
return this.req('GET', `/v1/screening/custom-lists/${encodeURIComponent(listId)}`);
|
|
1778
|
+
}
|
|
1779
|
+
/** `PATCH /v1/screening/custom-lists/{listId}` — name / description / enabled / tags. */
|
|
1780
|
+
update(listId, input) {
|
|
1781
|
+
return this.req('PATCH', `/v1/screening/custom-lists/${encodeURIComponent(listId)}`, { body: input });
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* `POST /v1/screening/custom-lists/{listId}/archive` — archived lists are
|
|
1785
|
+
* read-only and excluded from screening.
|
|
1786
|
+
*/
|
|
1787
|
+
archive(listId) {
|
|
1788
|
+
return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/archive`);
|
|
1789
|
+
}
|
|
1790
|
+
/** `POST /v1/screening/custom-lists/{listId}/unarchive`. */
|
|
1791
|
+
unarchive(listId) {
|
|
1792
|
+
return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/unarchive`);
|
|
1793
|
+
}
|
|
1794
|
+
/** `GET /v1/screening/custom-lists/{listId}/entries`. */
|
|
1795
|
+
listEntries(listId, params = {}) {
|
|
1796
|
+
return this.req('GET', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries`, {
|
|
1797
|
+
query: params,
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
/** `POST /v1/screening/custom-lists/{listId}/entries` — add a single entry. */
|
|
1801
|
+
createEntry(listId, input) {
|
|
1802
|
+
return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries`, {
|
|
1803
|
+
body: input,
|
|
1804
|
+
});
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* `POST /v1/screening/custom-lists/{listId}/entries/bulk` — import up to
|
|
1808
|
+
* 500 rows per request. Invalid rows are rejected per-row (with reasons)
|
|
1809
|
+
* while valid rows proceed; rows carrying `externalRef` upsert instead of
|
|
1810
|
+
* duplicating, so re-importing a refreshed CSV is safe.
|
|
1811
|
+
*/
|
|
1812
|
+
bulkCreateEntries(listId, rows) {
|
|
1813
|
+
return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/bulk`, {
|
|
1814
|
+
body: { rows },
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
/** `PATCH /v1/screening/custom-lists/{listId}/entries/{entryId}`. */
|
|
1818
|
+
updateEntry(listId, entryId, input) {
|
|
1819
|
+
return this.req('PATCH', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/${encodeURIComponent(entryId)}`, { body: input });
|
|
1820
|
+
}
|
|
1821
|
+
/** `DELETE /v1/screening/custom-lists/{listId}/entries/{entryId}`. */
|
|
1822
|
+
deleteEntry(listId, entryId) {
|
|
1823
|
+
return this.req('DELETE', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/${encodeURIComponent(entryId)}`);
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* On-demand PDF reports (`/v1/reports/...`). Each method resolves to the raw
|
|
1828
|
+
* PDF bytes; write them to disk or hand them to a download response. Requires
|
|
1829
|
+
* the `report:read` grant. Generating a report records a `report.generated`
|
|
1830
|
+
* activity on the subject record.
|
|
1831
|
+
*/
|
|
1832
|
+
export class ReportsResource {
|
|
1833
|
+
getBinary;
|
|
1834
|
+
constructor(getBinary) {
|
|
1835
|
+
this.getBinary = getBinary;
|
|
1836
|
+
}
|
|
1837
|
+
/** Alert case file: facts, subject customer, matches / rule triggers, comments, activity. */
|
|
1838
|
+
alert(alertId) {
|
|
1839
|
+
return this.getBinary(`/v1/reports/alerts/${encodeURIComponent(alertId)}/pdf`);
|
|
1840
|
+
}
|
|
1841
|
+
/** Customer profile: identity, documents, accounts, risk, screening, totals, alerts. */
|
|
1842
|
+
customerProfile(customerId) {
|
|
1843
|
+
return this.getBinary(`/v1/reports/customers/${encodeURIComponent(customerId)}/pdf`);
|
|
1844
|
+
}
|
|
1845
|
+
/** Counterparty profile: classification, identifiers, payment methods, totals. */
|
|
1846
|
+
counterpartyProfile(counterpartyId) {
|
|
1847
|
+
return this.getBinary(`/v1/reports/counterparties/${encodeURIComponent(counterpartyId)}/pdf`);
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* Generic profile for any other registered resource type (`ACCOUNT`,
|
|
1851
|
+
* `DEVICE`, `INSTITUTION`, `PRODUCT`, `TASK`, …). `ALERT`, `CUSTOMER` and
|
|
1852
|
+
* `COUNTERPARTY` are rejected with 400 — use the dedicated methods.
|
|
1853
|
+
*/
|
|
1854
|
+
resourceProfile(resourceType, resourceId) {
|
|
1855
|
+
return this.getBinary(`/v1/reports/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/pdf`);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1014
1858
|
//# sourceMappingURL=service.js.map
|