@dossier-wiki/os-sdk 0.7.0 → 1.3.1-staging.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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
- create(input) {
195
- return this.req('POST', '/v1/customers/individuals', { body: input });
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
- create(input) {
260
- return this.req('POST', '/v1/customers/entities', { body: input });
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) {
@@ -507,6 +747,15 @@ export class CounterpartiesResource {
507
747
  body: input,
508
748
  });
509
749
  }
750
+ /**
751
+ * Merge `input.sourceId` into `counterpartyId` (the survivor). Linked records
752
+ * move across and the source stays as a MERGED tombstone.
753
+ */
754
+ merge(counterpartyId, input) {
755
+ return this.req('POST', `/v1/counterparties/${encodeURIComponent(counterpartyId)}/merge`, {
756
+ body: input,
757
+ });
758
+ }
510
759
  }
511
760
  export class CounterpartyRiskAssessmentsResource {
512
761
  req;
@@ -539,6 +788,62 @@ export class DevicesResource {
539
788
  get(deviceId) {
540
789
  return this.req('GET', `/v1/devices/${encodeURIComponent(deviceId)}`);
541
790
  }
791
+ /** Canonicalize the source device into the target without deleting history. */
792
+ merge(targetDeviceId, input) {
793
+ return this.req('POST', `/v1/devices/${encodeURIComponent(targetDeviceId)}/merge`, { body: input });
794
+ }
795
+ }
796
+ export class PaymentInstrumentsResource {
797
+ req;
798
+ constructor(req) {
799
+ this.req = req;
800
+ }
801
+ list() {
802
+ return this.req('GET', '/v1/payment-instruments');
803
+ }
804
+ get(id) {
805
+ return this.req('GET', `/v1/payment-instruments/${encodeURIComponent(id)}`);
806
+ }
807
+ create(input) {
808
+ return this.req('POST', '/v1/payment-instruments', { body: input });
809
+ }
810
+ update(id, input) {
811
+ return this.req('PATCH', `/v1/payment-instruments/${encodeURIComponent(id)}`, { body: input });
812
+ }
813
+ linkAccount(id, input) {
814
+ return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/accounts`, { body: input });
815
+ }
816
+ unlinkAccount(id, relationshipId, validTo) {
817
+ return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/accounts/${encodeURIComponent(relationshipId)}/unlink`, { body: { validTo } });
818
+ }
819
+ linkCustomer(id, input) {
820
+ return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/customers`, { body: input });
821
+ }
822
+ unlinkCustomer(id, relationshipId, validTo) {
823
+ return this.req('POST', `/v1/payment-instruments/${encodeURIComponent(id)}/customers/${encodeURIComponent(relationshipId)}/unlink`, { body: { validTo } });
824
+ }
825
+ }
826
+ export class SessionsResource {
827
+ req;
828
+ constructor(req) {
829
+ this.req = req;
830
+ }
831
+ list() { return this.req('GET', '/v1/sessions'); }
832
+ get(id) { return this.req('GET', `/v1/sessions/${encodeURIComponent(id)}`); }
833
+ update(id, input) {
834
+ return this.req('PATCH', `/v1/sessions/${encodeURIComponent(id)}`, { body: input });
835
+ }
836
+ }
837
+ export class ChannelEndpointsResource {
838
+ req;
839
+ constructor(req) {
840
+ this.req = req;
841
+ }
842
+ list() { return this.req('GET', '/v1/channel-endpoints'); }
843
+ get(id) { return this.req('GET', `/v1/channel-endpoints/${encodeURIComponent(id)}`); }
844
+ update(id, input) {
845
+ return this.req('PATCH', `/v1/channel-endpoints/${encodeURIComponent(id)}`, { body: input });
846
+ }
542
847
  }
543
848
  export class TransactionsResource {
544
849
  req;
@@ -555,16 +860,193 @@ export class TransactionsResource {
555
860
  patchStatus(input) {
556
861
  return this.req('PATCH', '/v1/transactions', { body: input });
557
862
  }
863
+ /**
864
+ * Read back a stored transaction. By default `reference` is your own
865
+ * `transactionId`; pass `{ by: 'id' }` to look up the internal UUID
866
+ * returned by `ingest()`.
867
+ */
868
+ get(reference, opts = {}) {
869
+ return this.req('GET', `/v1/transactions/${encodeURIComponent(reference)}`, {
870
+ query: opts.by ? { by: opts.by } : undefined,
871
+ });
872
+ }
873
+ }
874
+ export class TransactionAttemptsResource {
875
+ req;
876
+ constructor(req) {
877
+ this.req = req;
878
+ }
879
+ /**
880
+ * `POST /v1/transaction-attempts` — retain a failed, blocked, or unknown
881
+ * operation as behavioural history. This does not trigger rule evaluation.
882
+ */
883
+ ingest(input) {
884
+ return this.req('POST', '/v1/transaction-attempts', { body: input });
885
+ }
886
+ /** List retained attempts using an opaque, stable cursor. Requires `config:read`. */
887
+ list(input = {}) {
888
+ return this.req('GET', '/v1/transaction-attempts', { query: input });
889
+ }
890
+ /** Read one retained attempt by its database id. Requires `config:read`. */
891
+ get(id) {
892
+ return this.req('GET', `/v1/transaction-attempts/${encodeURIComponent(id)}`);
893
+ }
894
+ }
895
+ export class BehaviorSettingsResource {
896
+ req;
897
+ constructor(req) {
898
+ this.req = req;
899
+ }
900
+ get() {
901
+ return this.req('GET', '/v1/config/behavior-settings');
902
+ }
903
+ update(input) {
904
+ return this.req('PATCH', '/v1/config/behavior-settings', { body: input });
905
+ }
558
906
  }
559
907
  export class EventsResource {
560
908
  req;
561
909
  constructor(req) {
562
910
  this.req = req;
563
911
  }
912
+ /**
913
+ * `POST /v1/events` — store a behavioral event.
914
+ *
915
+ * Every event is about exactly one resource: pass
916
+ * `resource: { type, id }`. A bare top-level `customerId` is still
917
+ * accepted as the legacy spelling of `resource: { type: 'CUSTOMER', id }`,
918
+ * and `resource` wins when both are present; an event naming neither is
919
+ * rejected with 400.
920
+ *
921
+ * Supply `input.eventId` (your unique identifier) to make retries safe:
922
+ * resubmitting the same `eventId` returns the original stored event with
923
+ * `cached: true` instead of creating a duplicate. Idempotency covers the
924
+ * event's Risk Signals too — a replay echoes the same `riskSignalIds`
925
+ * rather than emitting a second set.
926
+ *
927
+ * The response carries the resolved `resource` and the `riskSignalIds`
928
+ * emitted by the event definition's `riskSignalEffects`.
929
+ */
564
930
  ingest(input) {
565
931
  return this.req('POST', '/v1/events', { body: input });
566
932
  }
567
933
  }
934
+ /**
935
+ * Risk Signals — time-decaying evidence attached to one resource.
936
+ *
937
+ * A Risk Signal is evidence, **not** an Alert: adding one creates no alert, no
938
+ * notification, no assignment and no task, and does not change the resource's
939
+ * Risk Rating. Rules read the aggregate effective weight and decide for
940
+ * themselves.
941
+ */
942
+ export class RiskSignalsResource {
943
+ req;
944
+ constructor(req) {
945
+ this.req = req;
946
+ }
947
+ /**
948
+ * `POST /v1/risk-signals` — attach a piece of evidence to one resource.
949
+ *
950
+ * The signal records the strength it had at `occurredAt` and how fast that
951
+ * strength halves, so weight 40 with half-life `P7D` reads 20 after seven
952
+ * days and 10 after fourteen.
953
+ *
954
+ * Supply `externalId` to make retries safe — resubmitting the same
955
+ * `externalId` returns the original signal instead of adding a second one.
956
+ *
957
+ * The server sets the source to `MANUAL` and captures the authenticated
958
+ * actor; a caller cannot claim a signal came from an Event or a Rule.
959
+ */
960
+ create(input) {
961
+ return this.req('POST', '/v1/risk-signals', { body: input });
962
+ }
963
+ /**
964
+ * `GET /v1/risk-signals` — read a resource's Risk Signals with their
965
+ * decayed weights, plus the aggregate effective weight.
966
+ *
967
+ * The aggregate is computed as of `asOf` (defaulting to server time) — it
968
+ * is not a cached score column on the resource, so a historical `asOf`
969
+ * returns what the resource looked like at that moment.
970
+ *
971
+ * `type` and `sourceType` filter which records contribute. They never
972
+ * change how far a contributing signal has decayed: age is always measured
973
+ * to `asOf`.
974
+ */
975
+ list(query) {
976
+ return this.req('GET', '/v1/risk-signals', { query });
977
+ }
978
+ }
979
+ /**
980
+ * Employees — people acting inside the financial institution's ecosystem.
981
+ *
982
+ * Monitored domain data, distinct from Dossiers organization members: an
983
+ * Employee need not have a Dossiers login, and an Employee id is never an
984
+ * org-member id. Employees are an attachable resource for Events and Risk
985
+ * Signals.
986
+ */
987
+ export class EmployeesResource {
988
+ req;
989
+ constructor(req) {
990
+ this.req = req;
991
+ }
992
+ /**
993
+ * `GET /v1/employees`.
994
+ *
995
+ * The endpoint declares `cursor` / `limit`, but the server currently
996
+ * resolves its own paging defaults (first page, 50 records) — treat paging
997
+ * as server-defaulted rather than caller-controlled.
998
+ */
999
+ list(query = {}) {
1000
+ return this.req('GET', '/v1/employees', { query });
1001
+ }
1002
+ get(id) {
1003
+ return this.req('GET', `/v1/employees/${encodeURIComponent(id)}`);
1004
+ }
1005
+ /**
1006
+ * `POST /v1/employees`. `externalEmployeeId` must be unique within the
1007
+ * organization; a duplicate is rejected with 400.
1008
+ */
1009
+ create(input) {
1010
+ return this.req('POST', '/v1/employees', { body: input });
1011
+ }
1012
+ update(id, input) {
1013
+ return this.req('PATCH', `/v1/employees/${encodeURIComponent(id)}`, { body: input });
1014
+ }
1015
+ }
1016
+ /**
1017
+ * Branches — the institution's own physical or organizational units, through
1018
+ * which Employees act. Like Employee, an attachable resource for Events and
1019
+ * Risk Signals.
1020
+ */
1021
+ export class BranchesResource {
1022
+ req;
1023
+ constructor(req) {
1024
+ this.req = req;
1025
+ }
1026
+ /**
1027
+ * `GET /v1/branches`.
1028
+ *
1029
+ * The endpoint declares `cursor` / `limit`, but the server currently
1030
+ * resolves its own paging defaults (first page, 50 records) — treat paging
1031
+ * as server-defaulted rather than caller-controlled.
1032
+ */
1033
+ list(query = {}) {
1034
+ return this.req('GET', '/v1/branches', { query });
1035
+ }
1036
+ get(id) {
1037
+ return this.req('GET', `/v1/branches/${encodeURIComponent(id)}`);
1038
+ }
1039
+ /**
1040
+ * `POST /v1/branches`. `externalBranchId` must be unique within the
1041
+ * organization.
1042
+ */
1043
+ create(input) {
1044
+ return this.req('POST', '/v1/branches', { body: input });
1045
+ }
1046
+ update(id, input) {
1047
+ return this.req('PATCH', `/v1/branches/${encodeURIComponent(id)}`, { body: input });
1048
+ }
1049
+ }
568
1050
  export class ExchangeRatesResource {
569
1051
  req;
570
1052
  constructor(req) {
@@ -589,6 +1071,12 @@ export class IdentificationDocumentsResource {
589
1071
  get(id) {
590
1072
  return this.req('GET', `/v1/identification-documents/${encodeURIComponent(id)}`);
591
1073
  }
1074
+ /**
1075
+ * Correct captured document fields (name, number, DOB, addresses, …).
1076
+ * Captured fields are frozen while the document is `APPROVED` (400) —
1077
+ * `transition` it back to `PENDING` first. `notes`/`tags`/`attachments`
1078
+ * stay editable in any status.
1079
+ */
592
1080
  update(id, input) {
593
1081
  return this.req('PATCH', `/v1/identification-documents/${encodeURIComponent(id)}`, {
594
1082
  body: input,
@@ -612,16 +1100,61 @@ export class IdentificationDocumentsResource {
612
1100
  }
613
1101
  }
614
1102
  /**
615
- * Surfaces comments on alerts received via webhooks. The OS API does not
616
- * currently expose a top-level alerts CRUD; alerts are produced by rule
617
- * evaluation and delivered via webhooks. This resource lets callers
618
- * attach/inspect notes against an alert id without going through the
619
- * platform comments interface.
1103
+ * Alerts. Screening and rule-trigger alerts are produced by the platform and
1104
+ * delivered via webhooks; **custom alerts** are raised here against an
1105
+ * org-defined Custom Alert Type (`config.customAlertTypes`). Every alert type
1106
+ * supports markdown notes, linked resources and comments.
1107
+ *
1108
+ * Requires the `alerts:read` / `alerts:write` API-key permissions.
620
1109
  */
621
1110
  export class AlertsResource {
1111
+ req;
622
1112
  comments;
1113
+ resources;
623
1114
  constructor(req) {
1115
+ this.req = req;
624
1116
  this.comments = new ResourceCommentsProxy(req, 'ALERT');
1117
+ this.resources = new AlertResourcesProxy(req);
1118
+ }
1119
+ /**
1120
+ * Raise an alert by hand. `alertType` is optional: with one, `fields` are
1121
+ * validated against the type's schema; without one the alert is free-form
1122
+ * and `fields` are self-declaring. Re-sending the same `externalRequestId`
1123
+ * returns the existing alert (201 either way) — the key is scoped per
1124
+ * organization.
1125
+ */
1126
+ create(input) {
1127
+ return this.req('POST', '/v1/alerts', { body: input });
1128
+ }
1129
+ /** Flat view of any alert, with its linked resources. */
1130
+ get(alertId) {
1131
+ return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}`);
1132
+ }
1133
+ /** Replace the alert's markdown notes (any alert type). */
1134
+ updateNotes(alertId, input) {
1135
+ return this.req('PATCH', `/v1/alerts/${encodeURIComponent(alertId)}/notes`, { body: input });
1136
+ }
1137
+ /** Immutable attempt facts captured when attempt-history rules contributed to an alert. */
1138
+ attemptEvidence(alertId) {
1139
+ return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}/attempt-evidence`);
1140
+ }
1141
+ }
1142
+ /** Resources linked to an alert — `/v1/alerts/{id}/resources`. */
1143
+ export class AlertResourcesProxy {
1144
+ req;
1145
+ constructor(req) {
1146
+ this.req = req;
1147
+ }
1148
+ list(alertId) {
1149
+ return this.req('GET', `/v1/alerts/${encodeURIComponent(alertId)}/resources`);
1150
+ }
1151
+ /** Idempotent on (resourceType, resourceId): re-linking returns the existing link. */
1152
+ add(alertId, input) {
1153
+ return this.req('POST', `/v1/alerts/${encodeURIComponent(alertId)}/resources`, { body: input });
1154
+ }
1155
+ /** `alertResourceId` is the link id from `list` / `add`, not the target's id. */
1156
+ remove(alertId, alertResourceId) {
1157
+ return this.req('DELETE', `/v1/alerts/${encodeURIComponent(alertId)}/resources/${encodeURIComponent(alertResourceId)}`);
625
1158
  }
626
1159
  }
627
1160
  /**
@@ -681,21 +1214,32 @@ export class ConfigResource {
681
1214
  req;
682
1215
  rules;
683
1216
  constants;
1217
+ alertWorkflows;
1218
+ /** @deprecated Read-only archive. Use alertWorkflows for assignment. */
1219
+ states;
1220
+ assignmentPolicies;
684
1221
  products;
685
1222
  currencies;
686
1223
  eventDefinitions;
1224
+ customAlertTypes;
687
1225
  webhooks;
688
1226
  tagCatalogue;
1227
+ tagGroups;
689
1228
  sync;
690
1229
  constructor(req) {
691
1230
  this.req = req;
692
1231
  this.rules = new ConfigRulesResource(req);
693
1232
  this.constants = new ConfigConstantsResource(req);
1233
+ this.alertWorkflows = new ConfigAlertWorkflowsResource(req);
1234
+ this.states = new ConfigStatesResource(req);
1235
+ this.assignmentPolicies = new ConfigAssignmentPoliciesResource(req);
694
1236
  this.products = new ConfigProductsResource(req);
695
1237
  this.currencies = new ConfigCurrenciesResource(req);
696
1238
  this.eventDefinitions = new ConfigEventDefinitionsResource(req);
1239
+ this.customAlertTypes = new ConfigCustomAlertTypesResource(req);
697
1240
  this.webhooks = new ConfigWebhooksResource(req);
698
1241
  this.tagCatalogue = new ConfigTagCatalogueResource(req);
1242
+ this.tagGroups = new ConfigTagGroupsResource(req);
699
1243
  this.sync = new ConfigSyncResource(req);
700
1244
  }
701
1245
  /** `DELETE /v1/config/reset` — clear all org config (destructive). */
@@ -744,9 +1288,30 @@ export class ConfigRulesResource {
744
1288
  getBySyncKey(syncKey) {
745
1289
  return this.req('GET', `/v1/config/rules/by-sync-key/${encodeURIComponent(syncKey)}`);
746
1290
  }
1291
+ /**
1292
+ * Dry-run rule simulation (spec v0 rules §11 backtest + synthetic
1293
+ * source). Read-only: nothing is persisted and no actions execute —
1294
+ * the response summarises what WOULD have happened. Requires only
1295
+ * `config:read`.
1296
+ */
1297
+ backtest(input) {
1298
+ return this.req('POST', '/v1/config/rules/backtest', { body: input });
1299
+ }
747
1300
  get(id) {
748
1301
  return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}`);
749
1302
  }
1303
+ /** List a rule's definitional version history, newest first (audit trail). */
1304
+ versions(id) {
1305
+ return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/versions`);
1306
+ }
1307
+ /** Get a single rule version by its version number. */
1308
+ getVersion(id, version) {
1309
+ return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/versions/${version}`);
1310
+ }
1311
+ /** Compute-on-read alert analytics for a rule: disposition breakdown + precision. */
1312
+ analytics(id) {
1313
+ return this.req('GET', `/v1/config/rules/${encodeURIComponent(id)}/analytics`);
1314
+ }
750
1315
  update(id, input) {
751
1316
  return this.req('PATCH', `/v1/config/rules/${encodeURIComponent(id)}`, { body: input });
752
1317
  }
@@ -768,6 +1333,75 @@ export class ConfigRulesResource {
768
1333
  body: targetStatus ? { targetStatus } : undefined,
769
1334
  });
770
1335
  }
1336
+ /**
1337
+ * Roll the rule back to a previous version. Forward-only: re-applies the
1338
+ * target version's definition through the validated update path and mints a
1339
+ * new version. Returns 409 if the restored definition no longer resolves
1340
+ * (e.g. a tombstoned reference), 403 for system rules.
1341
+ */
1342
+ rollback(id, toVersion, reason) {
1343
+ return this.req('POST', `/v1/config/rules/${encodeURIComponent(id)}/rollback`, {
1344
+ body: { toVersion, reason },
1345
+ });
1346
+ }
1347
+ }
1348
+ /**
1349
+ * One workflow per alert type. Stages control assignment and review requirements;
1350
+ * routers choose paths. Requires config:read / config:write.
1351
+ */
1352
+ export class ConfigAlertWorkflowsResource {
1353
+ req;
1354
+ constructor(req) {
1355
+ this.req = req;
1356
+ }
1357
+ /** Organization-wide choice; defaults to SIMPLE until Defined workflows is selected. */
1358
+ getExperience() { return this.req('GET', '/v1/config/alert-workflows/experience'); }
1359
+ /** Requires config:write. Changes only the behavior of newly created alerts. */
1360
+ saveExperience(input) { return this.req('PUT', '/v1/config/alert-workflows/experience', { body: input }); }
1361
+ /** Requires config:read. Returns one workflow per alert type. */
1362
+ list() { return this.req('GET', '/v1/config/alert-workflows'); }
1363
+ /** Newest publication first. A null definition cannot be restored. Requires config:read. */
1364
+ versions(alertType) { return this.req('GET', `/v1/config/alert-workflows/${alertType}/versions`); }
1365
+ /** Replaces the draft with a saved version. Publishing is a separate operation; existing alerts are unchanged. */
1366
+ restore(alertType, input) { return this.req('POST', `/v1/config/alert-workflows/${alertType}/restore`, { body: input }); }
1367
+ get(alertType) { return this.req('GET', `/v1/config/alert-workflows/${alertType}`); }
1368
+ /** Requires config:write. Use revision from get(); publish=false only updates the draft. */
1369
+ save(alertType, input) { return this.req('PUT', `/v1/config/alert-workflows/${alertType}`, { body: input }); }
1370
+ }
1371
+ /** Read-only legacy policies. New alert assignment runs through alertWorkflows. */
1372
+ export class ConfigAssignmentPoliciesResource {
1373
+ req;
1374
+ constructor(req) {
1375
+ this.req = req;
1376
+ }
1377
+ /** List policies in evaluation order. */
1378
+ list() {
1379
+ return this.req('GET', '/v1/config/assignment-policies');
1380
+ }
1381
+ /** Create a policy (appended at the end of the evaluation order). */
1382
+ /** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
1383
+ create(input) {
1384
+ return this.req('POST', '/v1/config/assignment-policies', { body: input });
1385
+ }
1386
+ getBySyncKey(syncKey) {
1387
+ return this.req('GET', `/v1/config/assignment-policies/by-sync-key/${encodeURIComponent(syncKey)}`);
1388
+ }
1389
+ get(id) {
1390
+ return this.req('GET', `/v1/config/assignment-policies/${encodeURIComponent(id)}`);
1391
+ }
1392
+ /** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
1393
+ update(id, input) {
1394
+ return this.req('PUT', `/v1/config/assignment-policies/${encodeURIComponent(id)}`, { body: input });
1395
+ }
1396
+ /** Reorder: pass EVERY policy id in the desired order; priorities are reassigned 1..n. */
1397
+ /** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
1398
+ reorder(input) {
1399
+ return this.req('PUT', '/v1/config/assignment-policies/order/reorder', { body: input });
1400
+ }
1401
+ /** @deprecated Returns HTTP 410. Use config.alertWorkflows.save() to configure stage assignment. */
1402
+ delete(id) {
1403
+ return this.req('DELETE', `/v1/config/assignment-policies/${encodeURIComponent(id)}`);
1404
+ }
771
1405
  }
772
1406
  export class ConfigConstantsResource {
773
1407
  req;
@@ -795,9 +1429,38 @@ export class ConfigConstantsResource {
795
1429
  return this.req('DELETE', `/v1/config/constants/${encodeURIComponent(id)}`, { query });
796
1430
  }
797
1431
  }
1432
+ export class ConfigStatesResource {
1433
+ req;
1434
+ constructor(req) {
1435
+ this.req = req;
1436
+ }
1437
+ list() {
1438
+ return this.req('GET', '/v1/config/states');
1439
+ }
1440
+ create(input) {
1441
+ return this.req('POST', '/v1/config/states', { body: input });
1442
+ }
1443
+ }
1444
+ export class StatesResource {
1445
+ req;
1446
+ constructor(req) {
1447
+ this.req = req;
1448
+ }
1449
+ change(input) {
1450
+ return this.req('POST', '/v1/states/change', { body: input });
1451
+ }
1452
+ get(resourceType, resourceId, name) {
1453
+ return this.req('GET', `/v1/states/${resourceType}/${encodeURIComponent(resourceId)}/${encodeURIComponent(name)}`);
1454
+ }
1455
+ history(resourceType, resourceId, name, limit = 100) {
1456
+ return this.req('GET', `/v1/states/${resourceType}/${encodeURIComponent(resourceId)}/${encodeURIComponent(name)}/history`, {
1457
+ query: { limit },
1458
+ });
1459
+ }
1460
+ }
798
1461
  /**
799
- * Tag catalogue — per-org, per-field tag vocabulary plus enforcement. Backs the
800
- * eight `TagValue[]` resource tag fields. Under `strict` enforcement, writes
1462
+ * Tag catalogue — per-org, per-field tag vocabulary plus enforcement. Backs
1463
+ * every `TagValue[]` resource tag field. Under `strict` enforcement, writes
801
1464
  * carrying off-catalogue values are rejected (422).
802
1465
  */
803
1466
  export class ConfigTagCatalogueResource {
@@ -809,9 +1472,12 @@ export class ConfigTagCatalogueResource {
809
1472
  list(query = {}) {
810
1473
  return this.req('GET', '/v1/config/tag-catalogue', { query });
811
1474
  }
812
- /** Per field-key enforcement settings (every field-key, defaulting to `open`). */
813
- enforcement() {
814
- return this.req('GET', '/v1/config/tag-catalogue/enforcement');
1475
+ /**
1476
+ * The fixed colour palette. Served by the API so the token list isn't
1477
+ * duplicated (and left to drift) in every client.
1478
+ */
1479
+ palette() {
1480
+ return this.req('GET', '/v1/config/tag-catalogue/palette');
815
1481
  }
816
1482
  create(input) {
817
1483
  return this.req('POST', '/v1/config/tag-catalogue', { body: input });
@@ -827,15 +1493,53 @@ export class ConfigTagCatalogueResource {
827
1493
  delete(id) {
828
1494
  return this.req('DELETE', `/v1/config/tag-catalogue/${encodeURIComponent(id)}`);
829
1495
  }
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
1496
  /** Re-sync denormalised assignment labels from the catalogue. */
835
1497
  backfill(fieldKey) {
836
1498
  return this.req('POST', `/v1/config/tag-catalogue/backfill/${encodeURIComponent(fieldKey)}`);
837
1499
  }
838
1500
  }
1501
+ /**
1502
+ * Tag groups — the facet layer over the catalogue. A group owns a namespace, so
1503
+ * its member tags are stored as `<group>:<tag>` and a group is recoverable from
1504
+ * a tag value by splitting on the first colon.
1505
+ */
1506
+ export class ConfigTagGroupsResource {
1507
+ req;
1508
+ constructor(req) {
1509
+ this.req = req;
1510
+ }
1511
+ list(query = {}) {
1512
+ return this.req('GET', '/v1/config/tag-groups', { query });
1513
+ }
1514
+ create(input) {
1515
+ return this.req('POST', '/v1/config/tag-groups', { body: input });
1516
+ }
1517
+ update(id, input) {
1518
+ return this.req('PATCH', `/v1/config/tag-groups/${encodeURIComponent(id)}`, { body: input });
1519
+ }
1520
+ /** Archive a group. Its tags keep their namespaced values. */
1521
+ archive(id) {
1522
+ return this.req('POST', `/v1/config/tag-groups/${encodeURIComponent(id)}/archive`);
1523
+ }
1524
+ /** Hard-delete. Rejected while the group still owns tags — archive instead. */
1525
+ delete(id) {
1526
+ return this.req('DELETE', `/v1/config/tag-groups/${encodeURIComponent(id)}`);
1527
+ }
1528
+ /** Records holding more than one tag from this group — the SINGLE pre-flight. */
1529
+ cardinalityConflicts(id) {
1530
+ return this.req('GET', `/v1/config/tag-groups/${encodeURIComponent(id)}/cardinality-conflicts`);
1531
+ }
1532
+ /**
1533
+ * Move tags into (or out of, with `groupId: null`) a group.
1534
+ *
1535
+ * This changes each tag's stored VALUE, so it also rewrites assignments,
1536
+ * rule condition operands, and assignment-policy routing tables. Run it
1537
+ * with `dryRun: true` first — the report is identical, nothing is written.
1538
+ */
1539
+ regroup(input) {
1540
+ return this.req('POST', '/v1/config/tag-groups/regroup', { body: input });
1541
+ }
1542
+ }
839
1543
  export class ConfigProductsResource {
840
1544
  req;
841
1545
  constructor(req) {
@@ -896,6 +1600,54 @@ export class ConfigCurrenciesResource {
896
1600
  bulkUpdateStatus(input) {
897
1601
  return this.req('PATCH', '/v1/config/currencies/bulk-status', { body: input });
898
1602
  }
1603
+ /** Archive a currency (LIVE → ARCHIVED). Also disables it. */
1604
+ archive(id) {
1605
+ return this.req('POST', `/v1/config/currencies/${encodeURIComponent(id)}/archive`);
1606
+ }
1607
+ /** Tombstone a currency (terminal). Archive-first required — 409 if LIVE. */
1608
+ delete(id) {
1609
+ return this.req('DELETE', `/v1/config/currencies/${encodeURIComponent(id)}`);
1610
+ }
1611
+ }
1612
+ /**
1613
+ * Org-defined alert types for custom alerts — `/v1/config/custom-alert-types`.
1614
+ * Requires `config:read` / `config:write`. Follows the canonical lifecycle:
1615
+ * archive (blocked while alerts of the type are OPEN) → tombstone.
1616
+ */
1617
+ export class ConfigCustomAlertTypesResource {
1618
+ req;
1619
+ constructor(req) {
1620
+ this.req = req;
1621
+ }
1622
+ list(query = {}) {
1623
+ return this.req('GET', '/v1/config/custom-alert-types', { query });
1624
+ }
1625
+ create(input) {
1626
+ return this.req('POST', '/v1/config/custom-alert-types', { body: input });
1627
+ }
1628
+ /** Returns `{ found: false }` when no type has that name. */
1629
+ getByName(name) {
1630
+ return this.req('GET', `/v1/config/custom-alert-types/by-name/${encodeURIComponent(name)}`);
1631
+ }
1632
+ get(id) {
1633
+ return this.req('GET', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`);
1634
+ }
1635
+ /** Schema edits apply to alerts raised afterwards; existing alerts are not re-validated. */
1636
+ update(id, input) {
1637
+ return this.req('PATCH', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`, { body: input });
1638
+ }
1639
+ /** Tombstones the type. Archive-first enforced. */
1640
+ delete(id) {
1641
+ return this.req('DELETE', `/v1/config/custom-alert-types/${encodeURIComponent(id)}`);
1642
+ }
1643
+ /** LIVE → ARCHIVED. 409 while any alert of this type is OPEN. */
1644
+ archive(id) {
1645
+ return this.req('POST', `/v1/config/custom-alert-types/${encodeURIComponent(id)}/archive`);
1646
+ }
1647
+ /** ARCHIVED → LIVE. */
1648
+ unarchive(id) {
1649
+ return this.req('POST', `/v1/config/custom-alert-types/${encodeURIComponent(id)}/unarchive`);
1650
+ }
899
1651
  }
900
1652
  export class ConfigEventDefinitionsResource {
901
1653
  req;
@@ -1011,4 +1763,105 @@ export class SettingsResource {
1011
1763
  return this.req('GET', `/v1/settings/sync-snapshots/${encodeURIComponent(id)}/download`);
1012
1764
  }
1013
1765
  }
1766
+ /**
1767
+ * Custom screening lists — tenant-managed lists (internal blocklists, exited
1768
+ * customers, local regulator lists) checked by every screening run alongside
1769
+ * external providers. Requires `config:read` / `config:write` API-key scope.
1770
+ */
1771
+ export class CustomListsResource {
1772
+ req;
1773
+ constructor(req) {
1774
+ this.req = req;
1775
+ }
1776
+ /** `GET /v1/screening/custom-lists` — lists, LIVE only by default. */
1777
+ list(params = {}) {
1778
+ return this.req('GET', '/v1/screening/custom-lists', { query: params });
1779
+ }
1780
+ /** `POST /v1/screening/custom-lists` — create a list. */
1781
+ create(input) {
1782
+ return this.req('POST', '/v1/screening/custom-lists', { body: input });
1783
+ }
1784
+ /** `GET /v1/screening/custom-lists/{listId}`. */
1785
+ get(listId) {
1786
+ return this.req('GET', `/v1/screening/custom-lists/${encodeURIComponent(listId)}`);
1787
+ }
1788
+ /** `PATCH /v1/screening/custom-lists/{listId}` — name / description / enabled / tags. */
1789
+ update(listId, input) {
1790
+ return this.req('PATCH', `/v1/screening/custom-lists/${encodeURIComponent(listId)}`, { body: input });
1791
+ }
1792
+ /**
1793
+ * `POST /v1/screening/custom-lists/{listId}/archive` — archived lists are
1794
+ * read-only and excluded from screening.
1795
+ */
1796
+ archive(listId) {
1797
+ return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/archive`);
1798
+ }
1799
+ /** `POST /v1/screening/custom-lists/{listId}/unarchive`. */
1800
+ unarchive(listId) {
1801
+ return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/unarchive`);
1802
+ }
1803
+ /** `GET /v1/screening/custom-lists/{listId}/entries`. */
1804
+ listEntries(listId, params = {}) {
1805
+ return this.req('GET', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries`, {
1806
+ query: params,
1807
+ });
1808
+ }
1809
+ /** `POST /v1/screening/custom-lists/{listId}/entries` — add a single entry. */
1810
+ createEntry(listId, input) {
1811
+ return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries`, {
1812
+ body: input,
1813
+ });
1814
+ }
1815
+ /**
1816
+ * `POST /v1/screening/custom-lists/{listId}/entries/bulk` — import up to
1817
+ * 500 rows per request. Invalid rows are rejected per-row (with reasons)
1818
+ * while valid rows proceed; rows carrying `externalRef` upsert instead of
1819
+ * duplicating, so re-importing a refreshed CSV is safe.
1820
+ */
1821
+ bulkCreateEntries(listId, rows) {
1822
+ return this.req('POST', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/bulk`, {
1823
+ body: { rows },
1824
+ });
1825
+ }
1826
+ /** `PATCH /v1/screening/custom-lists/{listId}/entries/{entryId}`. */
1827
+ updateEntry(listId, entryId, input) {
1828
+ return this.req('PATCH', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/${encodeURIComponent(entryId)}`, { body: input });
1829
+ }
1830
+ /** `DELETE /v1/screening/custom-lists/{listId}/entries/{entryId}`. */
1831
+ deleteEntry(listId, entryId) {
1832
+ return this.req('DELETE', `/v1/screening/custom-lists/${encodeURIComponent(listId)}/entries/${encodeURIComponent(entryId)}`);
1833
+ }
1834
+ }
1835
+ /**
1836
+ * On-demand PDF reports (`/v1/reports/...`). Each method resolves to the raw
1837
+ * PDF bytes; write them to disk or hand them to a download response. Requires
1838
+ * the `report:read` grant. Generating a report records a `report.generated`
1839
+ * activity on the subject record.
1840
+ */
1841
+ export class ReportsResource {
1842
+ getBinary;
1843
+ constructor(getBinary) {
1844
+ this.getBinary = getBinary;
1845
+ }
1846
+ /** Alert case file: facts, subject customer, matches / rule triggers, comments, activity. */
1847
+ alert(alertId) {
1848
+ return this.getBinary(`/v1/reports/alerts/${encodeURIComponent(alertId)}/pdf`);
1849
+ }
1850
+ /** Customer profile: identity, documents, accounts, risk, screening, totals, alerts. */
1851
+ customerProfile(customerId) {
1852
+ return this.getBinary(`/v1/reports/customers/${encodeURIComponent(customerId)}/pdf`);
1853
+ }
1854
+ /** Counterparty profile: classification, identifiers, payment methods, totals. */
1855
+ counterpartyProfile(counterpartyId) {
1856
+ return this.getBinary(`/v1/reports/counterparties/${encodeURIComponent(counterpartyId)}/pdf`);
1857
+ }
1858
+ /**
1859
+ * Generic profile for any other registered resource type (`ACCOUNT`,
1860
+ * `DEVICE`, `INSTITUTION`, `PRODUCT`, `TASK`, …). `ALERT`, `CUSTOMER` and
1861
+ * `COUNTERPARTY` are rejected with 400 — use the dedicated methods.
1862
+ */
1863
+ resourceProfile(resourceType, resourceId) {
1864
+ return this.getBinary(`/v1/reports/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/pdf`);
1865
+ }
1866
+ }
1014
1867
  //# sourceMappingURL=service.js.map