vesant-sdk 1.8.0-dev.31d63f0 → 1.8.0-dev.69578db

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.
Files changed (42) hide show
  1. package/README.md +5 -3
  2. package/dist/{client-DUHC-68_.d.ts → client-4oLoc31v.d.ts} +1 -1
  3. package/dist/{client-5q4whhGu.d.mts → client-CJI8VO1i.d.mts} +1 -1
  4. package/dist/compliance/index.d.mts +2 -2
  5. package/dist/compliance/index.d.ts +2 -2
  6. package/dist/compliance/index.js +19 -3
  7. package/dist/compliance/index.js.map +1 -1
  8. package/dist/compliance/index.mjs +19 -3
  9. package/dist/compliance/index.mjs.map +1 -1
  10. package/dist/index.d.mts +3 -3
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +72 -14
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +71 -15
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/kyc/core.d.mts +2 -2
  17. package/dist/kyc/core.d.ts +2 -2
  18. package/dist/kyc/core.js +52 -11
  19. package/dist/kyc/core.js.map +1 -1
  20. package/dist/kyc/core.mjs +52 -12
  21. package/dist/kyc/core.mjs.map +1 -1
  22. package/dist/kyc/index.d.mts +156 -12
  23. package/dist/kyc/index.d.ts +156 -12
  24. package/dist/kyc/index.js +52 -11
  25. package/dist/kyc/index.js.map +1 -1
  26. package/dist/kyc/index.mjs +52 -12
  27. package/dist/kyc/index.mjs.map +1 -1
  28. package/dist/react.d.mts +21 -3
  29. package/dist/react.d.ts +21 -3
  30. package/dist/react.js +8 -1
  31. package/dist/react.js.map +1 -1
  32. package/dist/react.mjs +8 -1
  33. package/dist/react.mjs.map +1 -1
  34. package/dist/risk-profile/index.d.mts +16 -6
  35. package/dist/risk-profile/index.d.ts +16 -6
  36. package/dist/risk-profile/index.js +18 -2
  37. package/dist/risk-profile/index.js.map +1 -1
  38. package/dist/risk-profile/index.mjs +18 -3
  39. package/dist/risk-profile/index.mjs.map +1 -1
  40. package/dist/{types-UGyDl1fd.d.ts → types-1kI4SsKB.d.ts} +44 -1
  41. package/dist/{types-BOFaMQxI.d.mts → types-DfbnIaW_.d.mts} +44 -1
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-BOFaMQxI.mjs';
1
+ import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-DfbnIaW_.mjs';
2
2
  import { c as Reason, R as RiskLevel, P as PaginationParams } from '../types-CBQRNL-l.mjs';
3
3
  import { B as BaseClient, R as RequestOptions } from '../client-q9fN8Hhf.mjs';
4
4
 
@@ -119,14 +119,22 @@ interface Proof {
119
119
  id: string;
120
120
  kyc_id: string;
121
121
  type: ProofType;
122
- document: string;
122
+ /** Storage key. The platform never returns it; use `link` to download. */
123
+ document?: string;
123
124
  document_number?: string;
125
+ /** Document type the customer selected (e.g. `passport`). */
126
+ selected_type?: string;
127
+ /** Short-lived download URL, attached on `getKycRequest`. */
128
+ link?: string;
124
129
  created_at: string;
125
130
  }
126
131
  interface ProofDownloadURL {
132
+ /** Proof ID on the KYC record. */
133
+ id: string;
127
134
  type: ProofType;
128
135
  url: string;
129
- expires_at: string;
136
+ /** Not sent by the platform; the link itself is short-lived. */
137
+ expires_at?: string;
130
138
  }
131
139
  interface KycCustomerProfile {
132
140
  id: string;
@@ -243,6 +251,17 @@ interface EventBasedFaceVerificationReactions {
243
251
  /** @deprecated Never populated; read `data.freeze_duration_minutes` on the callback instead. */
244
252
  freeze_duration_minutes?: number;
245
253
  }
254
+ /**
255
+ * On Account Sensitive Action: hold a change to the customer's name, date of
256
+ * birth or residential address behind a full KYC verification. Configured in
257
+ * the Vesant console; off by default. See {@link ProfileUpdateHeldResponse}.
258
+ */
259
+ interface AccountSensitiveActionTrigger {
260
+ enabled: boolean;
261
+ full_name: boolean;
262
+ date_of_birth: boolean;
263
+ residential_address: boolean;
264
+ }
246
265
  /** Per-event toggles that decide when a submit-link request requires KYC. */
247
266
  interface KycVerificationTriggers {
248
267
  onboarding: boolean;
@@ -250,6 +269,8 @@ interface KycVerificationTriggers {
250
269
  first_purchase: boolean;
251
270
  /** Re-trigger verification once the customer's identity document has expired. */
252
271
  auto_trigger_on_id_expiration: boolean;
272
+ /** Hold sensitive profile changes (name, DOB, address) behind KYC. */
273
+ account_sensitive_action?: AccountSensitiveActionTrigger;
253
274
  }
254
275
  interface KycSkipOptions {
255
276
  /** Let a `manual` trigger be skipped (`can_skip` on the submit-link response). */
@@ -429,7 +450,16 @@ type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
429
450
  * (asked, skippable — "Remind me later"), or verified with a valid document
430
451
  * (not asked). One call covers every customer.
431
452
  */
432
- | 'login';
453
+ | 'login'
454
+ /**
455
+ * The customer changed their name, date of birth or address and
456
+ * `updateProfile` answered `202` with `kyc_required: true`. Required — not
457
+ * skippable — while Vesant holds a pending change for the customer; not
458
+ * required when nothing is held or the tenant switched the trigger off.
459
+ * The verification is seeded with the requested identity and, on approval,
460
+ * releases the held change. See the `profile_change` webhook.
461
+ */
462
+ | 'profile_change';
433
463
  /**
434
464
  * Why verification is — or is not — being asked for. Codes are stable;
435
465
  * `message` is display-ready text you can show the customer as-is.
@@ -453,10 +483,14 @@ type KycRequestReasonCode =
453
483
  | 'KYC_REQUIRED_ID_EXPIRED'
454
484
  /** Verification was explicitly requested by the tenant. */
455
485
  | 'KYC_REQUIRED_MANUAL'
486
+ /** Required before a held name / date of birth / address change is applied. */
487
+ | 'KYC_REQUIRED_PROFILE_CHANGE'
456
488
  /** Not required — the customer already has an accepted verification. */
457
489
  | 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
458
490
  /** Not required — the tenant has this trigger event switched off. */
459
- | 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
491
+ | 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
492
+ /** Not required — `profile_change` was sent but Vesant holds no pending change for the customer. */
493
+ | 'KYC_NOT_REQUIRED_NO_PENDING_CHANGE';
460
494
  interface RequestKycSubmitLinkRequest {
461
495
  /** User ID to generate KYC submission link for */
462
496
  user_id: string;
@@ -641,6 +675,79 @@ interface KycDocumentExpiredCallbackEvent {
641
675
  * signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
642
676
  */
643
677
  declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
678
+ /** Sensitive profile field held behind KYC by On Account Sensitive Action. */
679
+ type ProfileChangeField = 'full_name' | 'date_of_birth' | 'residential_address';
680
+ /** How a held profile change ended. */
681
+ type ProfileChangeStatus = 'approved' | 'rejected' | 'expired';
682
+ /**
683
+ * Reactions a verification fired, mirrored from the tenant's KYC alert
684
+ * configuration. Vesant holds no account state on your platform: these flags
685
+ * tell you what the tenant configured, they do not do it. Present on the
686
+ * `kyc` status callback only when a rule with reactions matched — today the
687
+ * On Account Sensitive Action rules.
688
+ */
689
+ interface KycCallbackReactions {
690
+ /** The alert rules that fired, e.g. `["profile_change_name"]`. */
691
+ events: string[];
692
+ trigger_alert: boolean;
693
+ block: boolean;
694
+ freeze_account: boolean;
695
+ /** Set when `freeze_account` is true: the tenant's default freeze window. */
696
+ freeze_duration_minutes?: number;
697
+ enforce_logout: boolean;
698
+ }
699
+ /**
700
+ * Body POSTed to your `callback_url` when a held sensitive profile change is
701
+ * settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
702
+ * raw body), like every other Vesant callback.
703
+ *
704
+ * Sent once per held change: `approved` after the customer's `profile_change`
705
+ * verification was accepted and the verified values were written to the
706
+ * profile; `rejected` after it was declined and the profile was left as it
707
+ * was; `expired` when no verification arrived within the hold window (seven
708
+ * days by default). On `rejected`, show the customer `declined_reasons` — this
709
+ * is the "KYC decline message" for the change.
710
+ */
711
+ interface ProfileChangeCallbackEvent {
712
+ /** Always `"profile_change"` — dispatch on this. */
713
+ event: 'profile_change';
714
+ /** Your customer identifier (the `user_id` you supplied). */
715
+ reference: string;
716
+ /** The pending change id returned by `updateProfile`. */
717
+ resource_id: string;
718
+ status: ProfileChangeStatus;
719
+ /** First decline message, `rejected` only. */
720
+ declined_reason?: string;
721
+ /** Structured decline, `rejected` only. */
722
+ declined_reasons?: Reason[];
723
+ data: {
724
+ customer_id: string;
725
+ profile_id: string;
726
+ pending_change_id: string;
727
+ /** The verification that settled the change; empty if it expired unverified. */
728
+ kyc_id: string;
729
+ changed_fields: ProfileChangeField[];
730
+ /** What the customer asked for. */
731
+ requested_values: Partial<Record<ProfileChangeField, string>>;
732
+ /** What the profile held before the change. */
733
+ previous_values: Partial<Record<ProfileChangeField, string>>;
734
+ /**
735
+ * What the document verified, `approved` only. The verified values are
736
+ * what was written to the profile — when they differ from
737
+ * `requested_values` (`values_match: false`) the document wins and a
738
+ * review alert is raised in the Vesant console.
739
+ */
740
+ verified_values?: Partial<Record<ProfileChangeField, string>>;
741
+ values_match?: boolean | null;
742
+ expires_at: string;
743
+ resolved_at?: string | null;
744
+ };
745
+ }
746
+ /**
747
+ * Type guard for the held-profile-change webhook. Narrows an already
748
+ * signature-verified, parsed payload to {@link ProfileChangeCallbackEvent}.
749
+ */
750
+ declare function isProfileChangeCallbackEvent(value: unknown): value is ProfileChangeCallbackEvent;
644
751
  /** Device class detected by the SDK (purely client-side — server doesn't care). */
645
752
  type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
646
753
  interface CreateEventBasedFaceVerificationSessionResponse {
@@ -1145,15 +1252,20 @@ declare class KycClient extends BaseClient {
1145
1252
  */
1146
1253
  submitVerification(request: DocumentVerificationRequest, requestOptions?: RequestOptions): Promise<DocumentVerificationResponse>;
1147
1254
  /**
1148
- * Get a KYC request by ID
1255
+ * Get a KYC record by ID
1149
1256
  *
1150
- * @param id - KYC request ID
1151
- * @returns KYC request details including proofs and alerts
1257
+ * Works with your tenant API key. Each entry in `proofs` carries a
1258
+ * short-lived `link` for downloading that document, and `reference` holds
1259
+ * your own customer reference (the `forward_reference`).
1260
+ *
1261
+ * @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
1262
+ * @returns KYC record including proofs (with download links) and alerts
1152
1263
  *
1153
1264
  * @example
1154
1265
  * ```typescript
1155
1266
  * const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
1156
1267
  * console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
1268
+ * kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
1157
1269
  * ```
1158
1270
  */
1159
1271
  getKycRequest(id: string): Promise<KycRequest>;
@@ -1172,6 +1284,10 @@ declare class KycClient extends BaseClient {
1172
1284
  * );
1173
1285
  * console.log(`Found ${requests.total} pending requests`);
1174
1286
  * ```
1287
+ *
1288
+ * @remarks Console session only. This endpoint accepts a Vesant console
1289
+ * (dashboard login) token, not a tenant API key; called with an API key it
1290
+ * fails with `AuthenticationError` or a permission error.
1175
1291
  */
1176
1292
  listKycRequests(filters?: KycRequestFilters, pagination?: PaginationParams): Promise<KycRequestListResponse>;
1177
1293
  /**
@@ -1195,6 +1311,10 @@ declare class KycClient extends BaseClient {
1195
1311
  * reason: "Document expired"
1196
1312
  * });
1197
1313
  * ```
1314
+ *
1315
+ * @remarks Console session only. This endpoint accepts a Vesant console
1316
+ * (dashboard login) token, not a tenant API key; called with an API key it
1317
+ * fails with `AuthenticationError` or a permission error.
1198
1318
  */
1199
1319
  updateKycStatus(request: UpdateKycStatusRequest): Promise<void>;
1200
1320
  /**
@@ -1219,14 +1339,18 @@ declare class KycClient extends BaseClient {
1219
1339
  /**
1220
1340
  * Get downloadable URLs for KYC proofs/documents
1221
1341
  *
1222
- * @param kycId - KYC request ID
1223
- * @returns Array of proof download URLs with expiration
1342
+ * Derived from the `proofs` of `getKycRequest`: the platform attaches a
1343
+ * short-lived download link to every proof on the KYC record, so no
1344
+ * separate endpoint is needed. Proofs without a link are omitted.
1345
+ *
1346
+ * @param kycId - KYC record ID
1347
+ * @returns Array of proof download URLs
1224
1348
  *
1225
1349
  * @example
1226
1350
  * ```typescript
1227
1351
  * const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
1228
1352
  * proofs.forEach(proof => {
1229
- * console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
1353
+ * console.log(`${proof.type}: ${proof.url}`);
1230
1354
  * });
1231
1355
  * ```
1232
1356
  */
@@ -1247,6 +1371,10 @@ declare class KycClient extends BaseClient {
1247
1371
  * console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
1248
1372
  * console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
1249
1373
  * ```
1374
+ *
1375
+ * @remarks Console session only. This endpoint accepts a Vesant console
1376
+ * (dashboard login) token, not a tenant API key; called with an API key it
1377
+ * fails with `AuthenticationError` or a permission error.
1250
1378
  */
1251
1379
  getOverview(fromDate?: string, toDate?: string): Promise<KycOverview>;
1252
1380
  /**
@@ -1254,6 +1382,10 @@ declare class KycClient extends BaseClient {
1254
1382
  *
1255
1383
  * @param alertId - Alert ID
1256
1384
  * @returns Alert details
1385
+ *
1386
+ * @remarks Console session only. This endpoint accepts a Vesant console
1387
+ * (dashboard login) token, not a tenant API key; called with an API key it
1388
+ * fails with `AuthenticationError` or a permission error.
1257
1389
  */
1258
1390
  getAlert(alertId: string): Promise<KycAlert>;
1259
1391
  /**
@@ -1275,6 +1407,10 @@ declare class KycClient extends BaseClient {
1275
1407
  * );
1276
1408
  * console.log(`Found ${alerts.total} alerts`);
1277
1409
  * ```
1410
+ *
1411
+ * @remarks Console session only. This endpoint accepts a Vesant console
1412
+ * (dashboard login) token, not a tenant API key; called with an API key it
1413
+ * fails with `AuthenticationError` or a permission error.
1278
1414
  */
1279
1415
  listAlerts(filters?: KycAlertFilters, pagination?: PaginationParams): Promise<KycAlertListResponse>;
1280
1416
  /**
@@ -1304,6 +1440,10 @@ declare class KycClient extends BaseClient {
1304
1440
  * reason: "Requires senior review - suspicious documents"
1305
1441
  * });
1306
1442
  * ```
1443
+ *
1444
+ * @remarks Console session only. This endpoint accepts a Vesant console
1445
+ * (dashboard login) token, not a tenant API key; called with an API key it
1446
+ * fails with `AuthenticationError` or a permission error.
1307
1447
  */
1308
1448
  updateAlert(alertId: string, update: UpdateKycAlertRequest): Promise<void>;
1309
1449
  /**
@@ -1317,6 +1457,10 @@ declare class KycClient extends BaseClient {
1317
1457
  * console.log(`Face verification required: ${prefs.is_face_verification_required}`);
1318
1458
  * console.log(`Required documents: ${prefs.required_document_count}`);
1319
1459
  * ```
1460
+ *
1461
+ * @remarks Console session only. This endpoint accepts a Vesant console
1462
+ * (dashboard login) token, not a tenant API key; called with an API key it
1463
+ * fails with `AuthenticationError` or a permission error.
1320
1464
  */
1321
1465
  getPreferences(): Promise<KycPreferences>;
1322
1466
  /**
@@ -1415,4 +1559,4 @@ declare class KycClient extends BaseClient {
1415
1559
  createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
1416
1560
  }
1417
1561
 
1418
- export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDisclosureConsent, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOtherReason, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycSkipOptions, type KycStatus, type KycTriggerEvent, type KycVerificationTriggers, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, type SupportedAddressDocumentType, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent };
1562
+ export { type AccountSensitiveActionTrigger, type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, type KycCallbackReactions, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDisclosureConsent, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOtherReason, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycSkipOptions, type KycStatus, type KycTriggerEvent, type KycVerificationTriggers, type Name, PaginationParams, type ProfileChangeCallbackEvent, type ProfileChangeField, type ProfileChangeStatus, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, type SupportedAddressDocumentType, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isProfileChangeCallbackEvent };
@@ -1,4 +1,4 @@
1
- import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-UGyDl1fd.js';
1
+ import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-1kI4SsKB.js';
2
2
  import { c as Reason, R as RiskLevel, P as PaginationParams } from '../types-CBQRNL-l.js';
3
3
  import { B as BaseClient, R as RequestOptions } from '../client-q9fN8Hhf.js';
4
4
 
@@ -119,14 +119,22 @@ interface Proof {
119
119
  id: string;
120
120
  kyc_id: string;
121
121
  type: ProofType;
122
- document: string;
122
+ /** Storage key. The platform never returns it; use `link` to download. */
123
+ document?: string;
123
124
  document_number?: string;
125
+ /** Document type the customer selected (e.g. `passport`). */
126
+ selected_type?: string;
127
+ /** Short-lived download URL, attached on `getKycRequest`. */
128
+ link?: string;
124
129
  created_at: string;
125
130
  }
126
131
  interface ProofDownloadURL {
132
+ /** Proof ID on the KYC record. */
133
+ id: string;
127
134
  type: ProofType;
128
135
  url: string;
129
- expires_at: string;
136
+ /** Not sent by the platform; the link itself is short-lived. */
137
+ expires_at?: string;
130
138
  }
131
139
  interface KycCustomerProfile {
132
140
  id: string;
@@ -243,6 +251,17 @@ interface EventBasedFaceVerificationReactions {
243
251
  /** @deprecated Never populated; read `data.freeze_duration_minutes` on the callback instead. */
244
252
  freeze_duration_minutes?: number;
245
253
  }
254
+ /**
255
+ * On Account Sensitive Action: hold a change to the customer's name, date of
256
+ * birth or residential address behind a full KYC verification. Configured in
257
+ * the Vesant console; off by default. See {@link ProfileUpdateHeldResponse}.
258
+ */
259
+ interface AccountSensitiveActionTrigger {
260
+ enabled: boolean;
261
+ full_name: boolean;
262
+ date_of_birth: boolean;
263
+ residential_address: boolean;
264
+ }
246
265
  /** Per-event toggles that decide when a submit-link request requires KYC. */
247
266
  interface KycVerificationTriggers {
248
267
  onboarding: boolean;
@@ -250,6 +269,8 @@ interface KycVerificationTriggers {
250
269
  first_purchase: boolean;
251
270
  /** Re-trigger verification once the customer's identity document has expired. */
252
271
  auto_trigger_on_id_expiration: boolean;
272
+ /** Hold sensitive profile changes (name, DOB, address) behind KYC. */
273
+ account_sensitive_action?: AccountSensitiveActionTrigger;
253
274
  }
254
275
  interface KycSkipOptions {
255
276
  /** Let a `manual` trigger be skipped (`can_skip` on the submit-link response). */
@@ -429,7 +450,16 @@ type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
429
450
  * (asked, skippable — "Remind me later"), or verified with a valid document
430
451
  * (not asked). One call covers every customer.
431
452
  */
432
- | 'login';
453
+ | 'login'
454
+ /**
455
+ * The customer changed their name, date of birth or address and
456
+ * `updateProfile` answered `202` with `kyc_required: true`. Required — not
457
+ * skippable — while Vesant holds a pending change for the customer; not
458
+ * required when nothing is held or the tenant switched the trigger off.
459
+ * The verification is seeded with the requested identity and, on approval,
460
+ * releases the held change. See the `profile_change` webhook.
461
+ */
462
+ | 'profile_change';
433
463
  /**
434
464
  * Why verification is — or is not — being asked for. Codes are stable;
435
465
  * `message` is display-ready text you can show the customer as-is.
@@ -453,10 +483,14 @@ type KycRequestReasonCode =
453
483
  | 'KYC_REQUIRED_ID_EXPIRED'
454
484
  /** Verification was explicitly requested by the tenant. */
455
485
  | 'KYC_REQUIRED_MANUAL'
486
+ /** Required before a held name / date of birth / address change is applied. */
487
+ | 'KYC_REQUIRED_PROFILE_CHANGE'
456
488
  /** Not required — the customer already has an accepted verification. */
457
489
  | 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
458
490
  /** Not required — the tenant has this trigger event switched off. */
459
- | 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
491
+ | 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
492
+ /** Not required — `profile_change` was sent but Vesant holds no pending change for the customer. */
493
+ | 'KYC_NOT_REQUIRED_NO_PENDING_CHANGE';
460
494
  interface RequestKycSubmitLinkRequest {
461
495
  /** User ID to generate KYC submission link for */
462
496
  user_id: string;
@@ -641,6 +675,79 @@ interface KycDocumentExpiredCallbackEvent {
641
675
  * signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
642
676
  */
643
677
  declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
678
+ /** Sensitive profile field held behind KYC by On Account Sensitive Action. */
679
+ type ProfileChangeField = 'full_name' | 'date_of_birth' | 'residential_address';
680
+ /** How a held profile change ended. */
681
+ type ProfileChangeStatus = 'approved' | 'rejected' | 'expired';
682
+ /**
683
+ * Reactions a verification fired, mirrored from the tenant's KYC alert
684
+ * configuration. Vesant holds no account state on your platform: these flags
685
+ * tell you what the tenant configured, they do not do it. Present on the
686
+ * `kyc` status callback only when a rule with reactions matched — today the
687
+ * On Account Sensitive Action rules.
688
+ */
689
+ interface KycCallbackReactions {
690
+ /** The alert rules that fired, e.g. `["profile_change_name"]`. */
691
+ events: string[];
692
+ trigger_alert: boolean;
693
+ block: boolean;
694
+ freeze_account: boolean;
695
+ /** Set when `freeze_account` is true: the tenant's default freeze window. */
696
+ freeze_duration_minutes?: number;
697
+ enforce_logout: boolean;
698
+ }
699
+ /**
700
+ * Body POSTed to your `callback_url` when a held sensitive profile change is
701
+ * settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
702
+ * raw body), like every other Vesant callback.
703
+ *
704
+ * Sent once per held change: `approved` after the customer's `profile_change`
705
+ * verification was accepted and the verified values were written to the
706
+ * profile; `rejected` after it was declined and the profile was left as it
707
+ * was; `expired` when no verification arrived within the hold window (seven
708
+ * days by default). On `rejected`, show the customer `declined_reasons` — this
709
+ * is the "KYC decline message" for the change.
710
+ */
711
+ interface ProfileChangeCallbackEvent {
712
+ /** Always `"profile_change"` — dispatch on this. */
713
+ event: 'profile_change';
714
+ /** Your customer identifier (the `user_id` you supplied). */
715
+ reference: string;
716
+ /** The pending change id returned by `updateProfile`. */
717
+ resource_id: string;
718
+ status: ProfileChangeStatus;
719
+ /** First decline message, `rejected` only. */
720
+ declined_reason?: string;
721
+ /** Structured decline, `rejected` only. */
722
+ declined_reasons?: Reason[];
723
+ data: {
724
+ customer_id: string;
725
+ profile_id: string;
726
+ pending_change_id: string;
727
+ /** The verification that settled the change; empty if it expired unverified. */
728
+ kyc_id: string;
729
+ changed_fields: ProfileChangeField[];
730
+ /** What the customer asked for. */
731
+ requested_values: Partial<Record<ProfileChangeField, string>>;
732
+ /** What the profile held before the change. */
733
+ previous_values: Partial<Record<ProfileChangeField, string>>;
734
+ /**
735
+ * What the document verified, `approved` only. The verified values are
736
+ * what was written to the profile — when they differ from
737
+ * `requested_values` (`values_match: false`) the document wins and a
738
+ * review alert is raised in the Vesant console.
739
+ */
740
+ verified_values?: Partial<Record<ProfileChangeField, string>>;
741
+ values_match?: boolean | null;
742
+ expires_at: string;
743
+ resolved_at?: string | null;
744
+ };
745
+ }
746
+ /**
747
+ * Type guard for the held-profile-change webhook. Narrows an already
748
+ * signature-verified, parsed payload to {@link ProfileChangeCallbackEvent}.
749
+ */
750
+ declare function isProfileChangeCallbackEvent(value: unknown): value is ProfileChangeCallbackEvent;
644
751
  /** Device class detected by the SDK (purely client-side — server doesn't care). */
645
752
  type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
646
753
  interface CreateEventBasedFaceVerificationSessionResponse {
@@ -1145,15 +1252,20 @@ declare class KycClient extends BaseClient {
1145
1252
  */
1146
1253
  submitVerification(request: DocumentVerificationRequest, requestOptions?: RequestOptions): Promise<DocumentVerificationResponse>;
1147
1254
  /**
1148
- * Get a KYC request by ID
1255
+ * Get a KYC record by ID
1149
1256
  *
1150
- * @param id - KYC request ID
1151
- * @returns KYC request details including proofs and alerts
1257
+ * Works with your tenant API key. Each entry in `proofs` carries a
1258
+ * short-lived `link` for downloading that document, and `reference` holds
1259
+ * your own customer reference (the `forward_reference`).
1260
+ *
1261
+ * @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
1262
+ * @returns KYC record including proofs (with download links) and alerts
1152
1263
  *
1153
1264
  * @example
1154
1265
  * ```typescript
1155
1266
  * const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
1156
1267
  * console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
1268
+ * kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
1157
1269
  * ```
1158
1270
  */
1159
1271
  getKycRequest(id: string): Promise<KycRequest>;
@@ -1172,6 +1284,10 @@ declare class KycClient extends BaseClient {
1172
1284
  * );
1173
1285
  * console.log(`Found ${requests.total} pending requests`);
1174
1286
  * ```
1287
+ *
1288
+ * @remarks Console session only. This endpoint accepts a Vesant console
1289
+ * (dashboard login) token, not a tenant API key; called with an API key it
1290
+ * fails with `AuthenticationError` or a permission error.
1175
1291
  */
1176
1292
  listKycRequests(filters?: KycRequestFilters, pagination?: PaginationParams): Promise<KycRequestListResponse>;
1177
1293
  /**
@@ -1195,6 +1311,10 @@ declare class KycClient extends BaseClient {
1195
1311
  * reason: "Document expired"
1196
1312
  * });
1197
1313
  * ```
1314
+ *
1315
+ * @remarks Console session only. This endpoint accepts a Vesant console
1316
+ * (dashboard login) token, not a tenant API key; called with an API key it
1317
+ * fails with `AuthenticationError` or a permission error.
1198
1318
  */
1199
1319
  updateKycStatus(request: UpdateKycStatusRequest): Promise<void>;
1200
1320
  /**
@@ -1219,14 +1339,18 @@ declare class KycClient extends BaseClient {
1219
1339
  /**
1220
1340
  * Get downloadable URLs for KYC proofs/documents
1221
1341
  *
1222
- * @param kycId - KYC request ID
1223
- * @returns Array of proof download URLs with expiration
1342
+ * Derived from the `proofs` of `getKycRequest`: the platform attaches a
1343
+ * short-lived download link to every proof on the KYC record, so no
1344
+ * separate endpoint is needed. Proofs without a link are omitted.
1345
+ *
1346
+ * @param kycId - KYC record ID
1347
+ * @returns Array of proof download URLs
1224
1348
  *
1225
1349
  * @example
1226
1350
  * ```typescript
1227
1351
  * const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
1228
1352
  * proofs.forEach(proof => {
1229
- * console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
1353
+ * console.log(`${proof.type}: ${proof.url}`);
1230
1354
  * });
1231
1355
  * ```
1232
1356
  */
@@ -1247,6 +1371,10 @@ declare class KycClient extends BaseClient {
1247
1371
  * console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
1248
1372
  * console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
1249
1373
  * ```
1374
+ *
1375
+ * @remarks Console session only. This endpoint accepts a Vesant console
1376
+ * (dashboard login) token, not a tenant API key; called with an API key it
1377
+ * fails with `AuthenticationError` or a permission error.
1250
1378
  */
1251
1379
  getOverview(fromDate?: string, toDate?: string): Promise<KycOverview>;
1252
1380
  /**
@@ -1254,6 +1382,10 @@ declare class KycClient extends BaseClient {
1254
1382
  *
1255
1383
  * @param alertId - Alert ID
1256
1384
  * @returns Alert details
1385
+ *
1386
+ * @remarks Console session only. This endpoint accepts a Vesant console
1387
+ * (dashboard login) token, not a tenant API key; called with an API key it
1388
+ * fails with `AuthenticationError` or a permission error.
1257
1389
  */
1258
1390
  getAlert(alertId: string): Promise<KycAlert>;
1259
1391
  /**
@@ -1275,6 +1407,10 @@ declare class KycClient extends BaseClient {
1275
1407
  * );
1276
1408
  * console.log(`Found ${alerts.total} alerts`);
1277
1409
  * ```
1410
+ *
1411
+ * @remarks Console session only. This endpoint accepts a Vesant console
1412
+ * (dashboard login) token, not a tenant API key; called with an API key it
1413
+ * fails with `AuthenticationError` or a permission error.
1278
1414
  */
1279
1415
  listAlerts(filters?: KycAlertFilters, pagination?: PaginationParams): Promise<KycAlertListResponse>;
1280
1416
  /**
@@ -1304,6 +1440,10 @@ declare class KycClient extends BaseClient {
1304
1440
  * reason: "Requires senior review - suspicious documents"
1305
1441
  * });
1306
1442
  * ```
1443
+ *
1444
+ * @remarks Console session only. This endpoint accepts a Vesant console
1445
+ * (dashboard login) token, not a tenant API key; called with an API key it
1446
+ * fails with `AuthenticationError` or a permission error.
1307
1447
  */
1308
1448
  updateAlert(alertId: string, update: UpdateKycAlertRequest): Promise<void>;
1309
1449
  /**
@@ -1317,6 +1457,10 @@ declare class KycClient extends BaseClient {
1317
1457
  * console.log(`Face verification required: ${prefs.is_face_verification_required}`);
1318
1458
  * console.log(`Required documents: ${prefs.required_document_count}`);
1319
1459
  * ```
1460
+ *
1461
+ * @remarks Console session only. This endpoint accepts a Vesant console
1462
+ * (dashboard login) token, not a tenant API key; called with an API key it
1463
+ * fails with `AuthenticationError` or a permission error.
1320
1464
  */
1321
1465
  getPreferences(): Promise<KycPreferences>;
1322
1466
  /**
@@ -1415,4 +1559,4 @@ declare class KycClient extends BaseClient {
1415
1559
  createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
1416
1560
  }
1417
1561
 
1418
- export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDisclosureConsent, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOtherReason, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycSkipOptions, type KycStatus, type KycTriggerEvent, type KycVerificationTriggers, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, type SupportedAddressDocumentType, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent };
1562
+ export { type AccountSensitiveActionTrigger, type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, type KycCallbackReactions, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDisclosureConsent, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOtherReason, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycSkipOptions, type KycStatus, type KycTriggerEvent, type KycVerificationTriggers, type Name, PaginationParams, type ProfileChangeCallbackEvent, type ProfileChangeField, type ProfileChangeStatus, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, type SupportedAddressDocumentType, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isProfileChangeCallbackEvent };