vesant-sdk 1.7.2 → 1.8.0-dev.153299b
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/{client-B3DCAHlg.d.ts → client-4oLoc31v.d.ts} +2 -2
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-D23KhWeh.d.mts → client-CJI8VO1i.d.mts} +2 -2
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +59 -5
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +59 -5
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/geolocation/index.js +40 -2
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +40 -2
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
- package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +70 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -6
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +2 -2
- package/dist/kyc/core.d.ts +2 -2
- package/dist/kyc/core.js +5 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +5 -2
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +103 -4
- package/dist/kyc/index.d.ts +103 -4
- package/dist/kyc/index.js +5 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +5 -2
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +17 -4
- package/dist/react.d.ts +17 -4
- package/dist/react.js +23 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +23 -11
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +16 -6
- package/dist/risk-profile/index.d.ts +16 -6
- package/dist/risk-profile/index.js +19 -3
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +19 -4
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +1 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -1
- package/dist/tax/index.mjs.map +1 -1
- package/dist/{types-UGyDl1fd.d.ts → types-1kI4SsKB.d.ts} +44 -1
- package/dist/{types-BOFaMQxI.d.mts → types-DfbnIaW_.d.mts} +44 -1
- package/dist/webhooks/index.d.mts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +6 -0
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +6 -1
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-
|
|
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
|
|
|
@@ -243,6 +243,17 @@ interface EventBasedFaceVerificationReactions {
|
|
|
243
243
|
/** @deprecated Never populated; read `data.freeze_duration_minutes` on the callback instead. */
|
|
244
244
|
freeze_duration_minutes?: number;
|
|
245
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* On Account Sensitive Action: hold a change to the customer's name, date of
|
|
248
|
+
* birth or residential address behind a full KYC verification. Configured in
|
|
249
|
+
* the Vesant console; off by default. See {@link ProfileUpdateHeldResponse}.
|
|
250
|
+
*/
|
|
251
|
+
interface AccountSensitiveActionTrigger {
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
full_name: boolean;
|
|
254
|
+
date_of_birth: boolean;
|
|
255
|
+
residential_address: boolean;
|
|
256
|
+
}
|
|
246
257
|
/** Per-event toggles that decide when a submit-link request requires KYC. */
|
|
247
258
|
interface KycVerificationTriggers {
|
|
248
259
|
onboarding: boolean;
|
|
@@ -250,6 +261,8 @@ interface KycVerificationTriggers {
|
|
|
250
261
|
first_purchase: boolean;
|
|
251
262
|
/** Re-trigger verification once the customer's identity document has expired. */
|
|
252
263
|
auto_trigger_on_id_expiration: boolean;
|
|
264
|
+
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
265
|
+
account_sensitive_action?: AccountSensitiveActionTrigger;
|
|
253
266
|
}
|
|
254
267
|
interface KycSkipOptions {
|
|
255
268
|
/** Let a `manual` trigger be skipped (`can_skip` on the submit-link response). */
|
|
@@ -429,7 +442,16 @@ type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
|
429
442
|
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
430
443
|
* (not asked). One call covers every customer.
|
|
431
444
|
*/
|
|
432
|
-
| 'login'
|
|
445
|
+
| 'login'
|
|
446
|
+
/**
|
|
447
|
+
* The customer changed their name, date of birth or address and
|
|
448
|
+
* `updateProfile` answered `202` with `kyc_required: true`. Required — not
|
|
449
|
+
* skippable — while Vesant holds a pending change for the customer; not
|
|
450
|
+
* required when nothing is held or the tenant switched the trigger off.
|
|
451
|
+
* The verification is seeded with the requested identity and, on approval,
|
|
452
|
+
* releases the held change. See the `profile_change` webhook.
|
|
453
|
+
*/
|
|
454
|
+
| 'profile_change';
|
|
433
455
|
/**
|
|
434
456
|
* Why verification is — or is not — being asked for. Codes are stable;
|
|
435
457
|
* `message` is display-ready text you can show the customer as-is.
|
|
@@ -453,10 +475,14 @@ type KycRequestReasonCode =
|
|
|
453
475
|
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
454
476
|
/** Verification was explicitly requested by the tenant. */
|
|
455
477
|
| 'KYC_REQUIRED_MANUAL'
|
|
478
|
+
/** Required before a held name / date of birth / address change is applied. */
|
|
479
|
+
| 'KYC_REQUIRED_PROFILE_CHANGE'
|
|
456
480
|
/** Not required — the customer already has an accepted verification. */
|
|
457
481
|
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
458
482
|
/** Not required — the tenant has this trigger event switched off. */
|
|
459
|
-
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
|
|
483
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
|
|
484
|
+
/** Not required — `profile_change` was sent but Vesant holds no pending change for the customer. */
|
|
485
|
+
| 'KYC_NOT_REQUIRED_NO_PENDING_CHANGE';
|
|
460
486
|
interface RequestKycSubmitLinkRequest {
|
|
461
487
|
/** User ID to generate KYC submission link for */
|
|
462
488
|
user_id: string;
|
|
@@ -641,6 +667,79 @@ interface KycDocumentExpiredCallbackEvent {
|
|
|
641
667
|
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
642
668
|
*/
|
|
643
669
|
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
670
|
+
/** Sensitive profile field held behind KYC by On Account Sensitive Action. */
|
|
671
|
+
type ProfileChangeField = 'full_name' | 'date_of_birth' | 'residential_address';
|
|
672
|
+
/** How a held profile change ended. */
|
|
673
|
+
type ProfileChangeStatus = 'approved' | 'rejected' | 'expired';
|
|
674
|
+
/**
|
|
675
|
+
* Reactions a verification fired, mirrored from the tenant's KYC alert
|
|
676
|
+
* configuration. Vesant holds no account state on your platform: these flags
|
|
677
|
+
* tell you what the tenant configured, they do not do it. Present on the
|
|
678
|
+
* `kyc` status callback only when a rule with reactions matched — today the
|
|
679
|
+
* On Account Sensitive Action rules.
|
|
680
|
+
*/
|
|
681
|
+
interface KycCallbackReactions {
|
|
682
|
+
/** The alert rules that fired, e.g. `["profile_change_name"]`. */
|
|
683
|
+
events: string[];
|
|
684
|
+
trigger_alert: boolean;
|
|
685
|
+
block: boolean;
|
|
686
|
+
freeze_account: boolean;
|
|
687
|
+
/** Set when `freeze_account` is true: the tenant's default freeze window. */
|
|
688
|
+
freeze_duration_minutes?: number;
|
|
689
|
+
enforce_logout: boolean;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
693
|
+
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
694
|
+
* raw body), like every other Vesant callback.
|
|
695
|
+
*
|
|
696
|
+
* Sent once per held change: `approved` after the customer's `profile_change`
|
|
697
|
+
* verification was accepted and the verified values were written to the
|
|
698
|
+
* profile; `rejected` after it was declined and the profile was left as it
|
|
699
|
+
* was; `expired` when no verification arrived within the hold window (seven
|
|
700
|
+
* days by default). On `rejected`, show the customer `declined_reasons` — this
|
|
701
|
+
* is the "KYC decline message" for the change.
|
|
702
|
+
*/
|
|
703
|
+
interface ProfileChangeCallbackEvent {
|
|
704
|
+
/** Always `"profile_change"` — dispatch on this. */
|
|
705
|
+
event: 'profile_change';
|
|
706
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
707
|
+
reference: string;
|
|
708
|
+
/** The pending change id returned by `updateProfile`. */
|
|
709
|
+
resource_id: string;
|
|
710
|
+
status: ProfileChangeStatus;
|
|
711
|
+
/** First decline message, `rejected` only. */
|
|
712
|
+
declined_reason?: string;
|
|
713
|
+
/** Structured decline, `rejected` only. */
|
|
714
|
+
declined_reasons?: Reason[];
|
|
715
|
+
data: {
|
|
716
|
+
customer_id: string;
|
|
717
|
+
profile_id: string;
|
|
718
|
+
pending_change_id: string;
|
|
719
|
+
/** The verification that settled the change; empty if it expired unverified. */
|
|
720
|
+
kyc_id: string;
|
|
721
|
+
changed_fields: ProfileChangeField[];
|
|
722
|
+
/** What the customer asked for. */
|
|
723
|
+
requested_values: Partial<Record<ProfileChangeField, string>>;
|
|
724
|
+
/** What the profile held before the change. */
|
|
725
|
+
previous_values: Partial<Record<ProfileChangeField, string>>;
|
|
726
|
+
/**
|
|
727
|
+
* What the document verified, `approved` only. The verified values are
|
|
728
|
+
* what was written to the profile — when they differ from
|
|
729
|
+
* `requested_values` (`values_match: false`) the document wins and a
|
|
730
|
+
* review alert is raised in the Vesant console.
|
|
731
|
+
*/
|
|
732
|
+
verified_values?: Partial<Record<ProfileChangeField, string>>;
|
|
733
|
+
values_match?: boolean | null;
|
|
734
|
+
expires_at: string;
|
|
735
|
+
resolved_at?: string | null;
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Type guard for the held-profile-change webhook. Narrows an already
|
|
740
|
+
* signature-verified, parsed payload to {@link ProfileChangeCallbackEvent}.
|
|
741
|
+
*/
|
|
742
|
+
declare function isProfileChangeCallbackEvent(value: unknown): value is ProfileChangeCallbackEvent;
|
|
644
743
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
645
744
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
646
745
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -1415,4 +1514,4 @@ declare class KycClient extends BaseClient {
|
|
|
1415
1514
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1416
1515
|
}
|
|
1417
1516
|
|
|
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 };
|
|
1517
|
+
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 };
|
package/dist/kyc/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-
|
|
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
|
|
|
@@ -243,6 +243,17 @@ interface EventBasedFaceVerificationReactions {
|
|
|
243
243
|
/** @deprecated Never populated; read `data.freeze_duration_minutes` on the callback instead. */
|
|
244
244
|
freeze_duration_minutes?: number;
|
|
245
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* On Account Sensitive Action: hold a change to the customer's name, date of
|
|
248
|
+
* birth or residential address behind a full KYC verification. Configured in
|
|
249
|
+
* the Vesant console; off by default. See {@link ProfileUpdateHeldResponse}.
|
|
250
|
+
*/
|
|
251
|
+
interface AccountSensitiveActionTrigger {
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
full_name: boolean;
|
|
254
|
+
date_of_birth: boolean;
|
|
255
|
+
residential_address: boolean;
|
|
256
|
+
}
|
|
246
257
|
/** Per-event toggles that decide when a submit-link request requires KYC. */
|
|
247
258
|
interface KycVerificationTriggers {
|
|
248
259
|
onboarding: boolean;
|
|
@@ -250,6 +261,8 @@ interface KycVerificationTriggers {
|
|
|
250
261
|
first_purchase: boolean;
|
|
251
262
|
/** Re-trigger verification once the customer's identity document has expired. */
|
|
252
263
|
auto_trigger_on_id_expiration: boolean;
|
|
264
|
+
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
265
|
+
account_sensitive_action?: AccountSensitiveActionTrigger;
|
|
253
266
|
}
|
|
254
267
|
interface KycSkipOptions {
|
|
255
268
|
/** Let a `manual` trigger be skipped (`can_skip` on the submit-link response). */
|
|
@@ -429,7 +442,16 @@ type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
|
429
442
|
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
430
443
|
* (not asked). One call covers every customer.
|
|
431
444
|
*/
|
|
432
|
-
| 'login'
|
|
445
|
+
| 'login'
|
|
446
|
+
/**
|
|
447
|
+
* The customer changed their name, date of birth or address and
|
|
448
|
+
* `updateProfile` answered `202` with `kyc_required: true`. Required — not
|
|
449
|
+
* skippable — while Vesant holds a pending change for the customer; not
|
|
450
|
+
* required when nothing is held or the tenant switched the trigger off.
|
|
451
|
+
* The verification is seeded with the requested identity and, on approval,
|
|
452
|
+
* releases the held change. See the `profile_change` webhook.
|
|
453
|
+
*/
|
|
454
|
+
| 'profile_change';
|
|
433
455
|
/**
|
|
434
456
|
* Why verification is — or is not — being asked for. Codes are stable;
|
|
435
457
|
* `message` is display-ready text you can show the customer as-is.
|
|
@@ -453,10 +475,14 @@ type KycRequestReasonCode =
|
|
|
453
475
|
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
454
476
|
/** Verification was explicitly requested by the tenant. */
|
|
455
477
|
| 'KYC_REQUIRED_MANUAL'
|
|
478
|
+
/** Required before a held name / date of birth / address change is applied. */
|
|
479
|
+
| 'KYC_REQUIRED_PROFILE_CHANGE'
|
|
456
480
|
/** Not required — the customer already has an accepted verification. */
|
|
457
481
|
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
458
482
|
/** Not required — the tenant has this trigger event switched off. */
|
|
459
|
-
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
|
|
483
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED'
|
|
484
|
+
/** Not required — `profile_change` was sent but Vesant holds no pending change for the customer. */
|
|
485
|
+
| 'KYC_NOT_REQUIRED_NO_PENDING_CHANGE';
|
|
460
486
|
interface RequestKycSubmitLinkRequest {
|
|
461
487
|
/** User ID to generate KYC submission link for */
|
|
462
488
|
user_id: string;
|
|
@@ -641,6 +667,79 @@ interface KycDocumentExpiredCallbackEvent {
|
|
|
641
667
|
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
642
668
|
*/
|
|
643
669
|
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
670
|
+
/** Sensitive profile field held behind KYC by On Account Sensitive Action. */
|
|
671
|
+
type ProfileChangeField = 'full_name' | 'date_of_birth' | 'residential_address';
|
|
672
|
+
/** How a held profile change ended. */
|
|
673
|
+
type ProfileChangeStatus = 'approved' | 'rejected' | 'expired';
|
|
674
|
+
/**
|
|
675
|
+
* Reactions a verification fired, mirrored from the tenant's KYC alert
|
|
676
|
+
* configuration. Vesant holds no account state on your platform: these flags
|
|
677
|
+
* tell you what the tenant configured, they do not do it. Present on the
|
|
678
|
+
* `kyc` status callback only when a rule with reactions matched — today the
|
|
679
|
+
* On Account Sensitive Action rules.
|
|
680
|
+
*/
|
|
681
|
+
interface KycCallbackReactions {
|
|
682
|
+
/** The alert rules that fired, e.g. `["profile_change_name"]`. */
|
|
683
|
+
events: string[];
|
|
684
|
+
trigger_alert: boolean;
|
|
685
|
+
block: boolean;
|
|
686
|
+
freeze_account: boolean;
|
|
687
|
+
/** Set when `freeze_account` is true: the tenant's default freeze window. */
|
|
688
|
+
freeze_duration_minutes?: number;
|
|
689
|
+
enforce_logout: boolean;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
693
|
+
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
694
|
+
* raw body), like every other Vesant callback.
|
|
695
|
+
*
|
|
696
|
+
* Sent once per held change: `approved` after the customer's `profile_change`
|
|
697
|
+
* verification was accepted and the verified values were written to the
|
|
698
|
+
* profile; `rejected` after it was declined and the profile was left as it
|
|
699
|
+
* was; `expired` when no verification arrived within the hold window (seven
|
|
700
|
+
* days by default). On `rejected`, show the customer `declined_reasons` — this
|
|
701
|
+
* is the "KYC decline message" for the change.
|
|
702
|
+
*/
|
|
703
|
+
interface ProfileChangeCallbackEvent {
|
|
704
|
+
/** Always `"profile_change"` — dispatch on this. */
|
|
705
|
+
event: 'profile_change';
|
|
706
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
707
|
+
reference: string;
|
|
708
|
+
/** The pending change id returned by `updateProfile`. */
|
|
709
|
+
resource_id: string;
|
|
710
|
+
status: ProfileChangeStatus;
|
|
711
|
+
/** First decline message, `rejected` only. */
|
|
712
|
+
declined_reason?: string;
|
|
713
|
+
/** Structured decline, `rejected` only. */
|
|
714
|
+
declined_reasons?: Reason[];
|
|
715
|
+
data: {
|
|
716
|
+
customer_id: string;
|
|
717
|
+
profile_id: string;
|
|
718
|
+
pending_change_id: string;
|
|
719
|
+
/** The verification that settled the change; empty if it expired unverified. */
|
|
720
|
+
kyc_id: string;
|
|
721
|
+
changed_fields: ProfileChangeField[];
|
|
722
|
+
/** What the customer asked for. */
|
|
723
|
+
requested_values: Partial<Record<ProfileChangeField, string>>;
|
|
724
|
+
/** What the profile held before the change. */
|
|
725
|
+
previous_values: Partial<Record<ProfileChangeField, string>>;
|
|
726
|
+
/**
|
|
727
|
+
* What the document verified, `approved` only. The verified values are
|
|
728
|
+
* what was written to the profile — when they differ from
|
|
729
|
+
* `requested_values` (`values_match: false`) the document wins and a
|
|
730
|
+
* review alert is raised in the Vesant console.
|
|
731
|
+
*/
|
|
732
|
+
verified_values?: Partial<Record<ProfileChangeField, string>>;
|
|
733
|
+
values_match?: boolean | null;
|
|
734
|
+
expires_at: string;
|
|
735
|
+
resolved_at?: string | null;
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Type guard for the held-profile-change webhook. Narrows an already
|
|
740
|
+
* signature-verified, parsed payload to {@link ProfileChangeCallbackEvent}.
|
|
741
|
+
*/
|
|
742
|
+
declare function isProfileChangeCallbackEvent(value: unknown): value is ProfileChangeCallbackEvent;
|
|
644
743
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
645
744
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
646
745
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -1415,4 +1514,4 @@ declare class KycClient extends BaseClient {
|
|
|
1415
1514
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1416
1515
|
}
|
|
1417
1516
|
|
|
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 };
|
|
1517
|
+
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 };
|
package/dist/kyc/index.js
CHANGED
|
@@ -229,7 +229,7 @@ function createConsoleLogger() {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// src/core/version.ts
|
|
232
|
-
var SDK_VERSION = "1.
|
|
232
|
+
var SDK_VERSION = "1.8.0";
|
|
233
233
|
|
|
234
234
|
// src/shared/browser-utils.ts
|
|
235
235
|
function generateUUID() {
|
|
@@ -1311,9 +1311,13 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1311
1311
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1312
1312
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1313
1313
|
}
|
|
1314
|
+
function isProfileChangeCallbackEvent(value) {
|
|
1315
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
1316
|
+
}
|
|
1314
1317
|
|
|
1315
1318
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1316
1319
|
exports.KycClient = KycClient;
|
|
1317
1320
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1321
|
+
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
1318
1322
|
//# sourceMappingURL=index.js.map
|
|
1319
1323
|
//# sourceMappingURL=index.js.map
|