vesant-sdk 1.8.0-dev.9f7204d → 1.8.0-dev.a26e5ed
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-4oLoc31v.d.ts → client-BPALLldd.d.ts} +1 -1
- package/dist/{client-CJI8VO1i.d.mts → client-_OhkfnyJ.d.mts} +1 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- 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 +4 -0
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +4 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +89 -33
- package/dist/kyc/index.d.ts +89 -33
- package/dist/kyc/index.js +4 -0
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +4 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/risk-profile/index.d.mts +2 -2
- package/dist/risk-profile/index.d.ts +2 -2
- package/dist/tax/index.d.mts +1 -1
- package/dist/tax/index.d.ts +1 -1
- package/dist/{types-DfbnIaW_.d.mts → types-DbvVph_0.d.mts} +1 -1
- package/dist/{types-1kI4SsKB.d.ts → types-qXamJr2q.d.ts} +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CustomerProfile, P as ProfileFilters, b as ProfileListResponse, a as CreateProfileRequest } from '../types-DbvVph_0.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
|
|
|
@@ -15,7 +15,7 @@ type KycStatus =
|
|
|
15
15
|
/** Submit link issued but the customer has not submitted documents yet — not "in progress". */
|
|
16
16
|
'awaiting_kyc'
|
|
17
17
|
/** Documents submitted, verification in progress. */
|
|
18
|
-
| 'pending' | 'accepted' | 'declined' | 'review.pending'
|
|
18
|
+
| 'pending' | 'accepted' | 'declined' | 'review.pending';
|
|
19
19
|
type KycDeclinedCode = 'KYC_DOCUMENT_EXPIRED' | 'KYC_DOCUMENT_INVALID' | 'KYC_FACE_MISMATCH' | 'KYC_AGE_REQUIREMENT' | 'KYC_DUPLICATE_IDENTITY' | 'KYC_ADDRESS_MISMATCH' | 'KYC_NAME_MISMATCH' | 'KYC_PROVIDER_REJECTED' | 'KYC_DECLINED';
|
|
20
20
|
declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
|
|
21
21
|
type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
|
|
@@ -111,7 +111,8 @@ interface KycRequest {
|
|
|
111
111
|
block_reason?: string;
|
|
112
112
|
proofs?: Proof[];
|
|
113
113
|
alerts?: KycAlert[];
|
|
114
|
-
|
|
114
|
+
/** The customer's risk profile (`risk_category`, `risk_score`, `kyc_status`, ...). */
|
|
115
|
+
risk_profile?: CustomerProfile;
|
|
115
116
|
created_at: string;
|
|
116
117
|
updated_at: string;
|
|
117
118
|
}
|
|
@@ -136,21 +137,17 @@ interface ProofDownloadURL {
|
|
|
136
137
|
/** Not sent by the platform; the link itself is short-lived. */
|
|
137
138
|
expires_at?: string;
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
sanctions_status?: boolean;
|
|
151
|
-
created_at: string;
|
|
152
|
-
updated_at: string;
|
|
153
|
-
}
|
|
140
|
+
/**
|
|
141
|
+
* The customer's risk profile as embedded on a KYC record
|
|
142
|
+
* (`additional_data.risk_profile`). The platform preloads the full
|
|
143
|
+
* `customer_profiles` row, so this is the same shape as
|
|
144
|
+
* {@link CustomerProfile}: read `risk_category` / `risk_score`, `kyc_status`,
|
|
145
|
+
* `is_pep`, `has_sanctions`. There is no `risk_level` field on the wire.
|
|
146
|
+
*
|
|
147
|
+
* @deprecated Use {@link CustomerProfile}; this alias is kept for existing
|
|
148
|
+
* imports and will be removed in a future major.
|
|
149
|
+
*/
|
|
150
|
+
type KycCustomerProfile = CustomerProfile;
|
|
154
151
|
interface KycAlert {
|
|
155
152
|
id: string;
|
|
156
153
|
kyc_id: string;
|
|
@@ -269,6 +266,16 @@ interface KycVerificationTriggers {
|
|
|
269
266
|
first_purchase: boolean;
|
|
270
267
|
/** Re-trigger verification once the customer's identity document has expired. */
|
|
271
268
|
auto_trigger_on_id_expiration: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Manual KYC Verification: whether customers may start a verification
|
|
271
|
+
* themselves (`trigger_event: "manual"`), independent of the event
|
|
272
|
+
* triggers and of their status. On by default. When on, a `manual`
|
|
273
|
+
* request always returns a link — an already verified customer included.
|
|
274
|
+
* When off, it answers `kyc_required: false` with reason
|
|
275
|
+
* `KYC_NOT_REQUIRED_TRIGGER_DISABLED`; hide your Verification option in
|
|
276
|
+
* that case.
|
|
277
|
+
*/
|
|
278
|
+
manual: boolean;
|
|
272
279
|
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
273
280
|
account_sensitive_action?: AccountSensitiveActionTrigger;
|
|
274
281
|
}
|
|
@@ -438,8 +445,9 @@ interface UpdateKycStatusRequest {
|
|
|
438
445
|
}
|
|
439
446
|
/**
|
|
440
447
|
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
441
|
-
* the tenant's KYC verification trigger preferences
|
|
442
|
-
*
|
|
448
|
+
* the tenant's KYC verification trigger preferences (`manual` to the Manual
|
|
449
|
+
* KYC Verification toggle), except `login` (only for an expired identity
|
|
450
|
+
* document).
|
|
443
451
|
*/
|
|
444
452
|
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
445
453
|
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
@@ -501,8 +509,12 @@ interface RequestKycSubmitLinkRequest {
|
|
|
501
509
|
/**
|
|
502
510
|
* Event that triggered the KYC request. The tenant's KYC verification
|
|
503
511
|
* trigger preferences decide, per event, whether KYC is required
|
|
504
|
-
* (`kyc_required` in the response). "manual"
|
|
505
|
-
*
|
|
512
|
+
* (`kyc_required` in the response). "manual" — the customer starting
|
|
513
|
+
* verification themselves — is governed by the tenant's Manual KYC
|
|
514
|
+
* Verification toggle (on by default): when on it always returns a link,
|
|
515
|
+
* even for an already verified customer, and honors the
|
|
516
|
+
* allow-skip-on-manual option (`can_skip`); when off it answers
|
|
517
|
+
* `kyc_required: false` with `KYC_NOT_REQUIRED_TRIGGER_DISABLED`. "login"
|
|
506
518
|
* answers for any customer state — never verified (asked, not skippable),
|
|
507
519
|
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
508
520
|
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
@@ -627,7 +639,8 @@ interface RequestKycSubmitLinkResponse {
|
|
|
627
639
|
* Whether the user may skip verification. `true` for
|
|
628
640
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
629
641
|
* for `"login"` when an expired identity document triggered the request
|
|
630
|
-
* (offer "Remind me later"), and when the customer is already verified
|
|
642
|
+
* (offer "Remind me later"), and when the customer is already verified
|
|
643
|
+
* (except on `"manual"`, which always issues a link while enabled).
|
|
631
644
|
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
632
645
|
* postponed re-verification becomes mandatory.
|
|
633
646
|
*/
|
|
@@ -648,9 +661,9 @@ interface RequestKycSubmitLinkResponse {
|
|
|
648
661
|
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
649
662
|
* once per customer, when the document first becomes expired.
|
|
650
663
|
*
|
|
651
|
-
* It is sent
|
|
652
|
-
*
|
|
653
|
-
*
|
|
664
|
+
* It is sent only while the tenant's auto-trigger-on-ID-expiration setting is
|
|
665
|
+
* enabled; with the setting off the document is still flagged as expired, but
|
|
666
|
+
* no webhook is sent.
|
|
654
667
|
*/
|
|
655
668
|
interface KycDocumentExpiredCallbackEvent {
|
|
656
669
|
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
@@ -692,10 +705,49 @@ interface KycCallbackReactions {
|
|
|
692
705
|
trigger_alert: boolean;
|
|
693
706
|
block: boolean;
|
|
694
707
|
freeze_account: boolean;
|
|
695
|
-
/** Set when `freeze_account` is true: the tenant
|
|
708
|
+
/** Set when `freeze_account` is true: the freeze window the tenant set for the rules that fired. */
|
|
696
709
|
freeze_duration_minutes?: number;
|
|
697
710
|
enforce_logout: boolean;
|
|
698
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Body POSTed to your KYC `callback_url` whenever a document verification
|
|
714
|
+
* reaches an outcome (`accepted`, `declined`, `review.pending`). This is a flat
|
|
715
|
+
* callback, not a platform event envelope: there is no `event_type`, `id` or
|
|
716
|
+
* `timestamp`, so it cannot go through `WebhookHandler`. Verify it with
|
|
717
|
+
* `verifyWebhookSignature`, narrow it with {@link isKycStatusCallbackEvent},
|
|
718
|
+
* and deduplicate on `resource_id` + `status` yourself.
|
|
719
|
+
*/
|
|
720
|
+
interface KycStatusCallbackEvent {
|
|
721
|
+
/** Always `"kyc"` — dispatch on this. */
|
|
722
|
+
event: 'kyc';
|
|
723
|
+
/** The verification reference (your customer identifier). */
|
|
724
|
+
reference: string;
|
|
725
|
+
/** Vesant KYC record ID (`kyc_id`). */
|
|
726
|
+
resource_id: string;
|
|
727
|
+
/** Verification outcome. `awaiting_kyc` / `pending` are never sent. */
|
|
728
|
+
status: 'accepted' | 'declined' | 'review.pending';
|
|
729
|
+
/**
|
|
730
|
+
* `true` when your app should block the triggering action. Set when a
|
|
731
|
+
* failed verification matched a per-event alert rule with the `block`
|
|
732
|
+
* reaction. Sticky once set on the record. Omitted when `false`.
|
|
733
|
+
*/
|
|
734
|
+
block?: boolean;
|
|
735
|
+
/** The event that triggered the block; omitted when not blocked. */
|
|
736
|
+
block_reason?: string;
|
|
737
|
+
/** Comma-joined decline text; the structured list is `data.declined_reasons`. */
|
|
738
|
+
declined_reason?: string;
|
|
739
|
+
/** @deprecated Legacy category → message map; use `data.warning_reasons`. */
|
|
740
|
+
warnings?: Record<string, Record<string, string>>;
|
|
741
|
+
/** Present only when a rule with reactions matched (On Account Sensitive Action). */
|
|
742
|
+
reactions?: KycCallbackReactions;
|
|
743
|
+
/** The full KYC record, with `risk_profile` and proof download links. */
|
|
744
|
+
data: KycRequest;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Type guard for the KYC status callback. Narrows an already
|
|
748
|
+
* signature-verified, parsed payload to {@link KycStatusCallbackEvent}.
|
|
749
|
+
*/
|
|
750
|
+
declare function isKycStatusCallbackEvent(value: unknown): value is KycStatusCallbackEvent;
|
|
699
751
|
/**
|
|
700
752
|
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
701
753
|
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
@@ -803,7 +855,11 @@ interface EventBasedFaceVerificationReactionResult {
|
|
|
803
855
|
/** Tenant app should block the action/account when true. */
|
|
804
856
|
block: boolean;
|
|
805
857
|
freeze_duration_minutes: number;
|
|
806
|
-
/**
|
|
858
|
+
/**
|
|
859
|
+
* Reserved. The dashboard alert is raised after the submit response and
|
|
860
|
+
* the webhook have been built, so neither carries the alert id today;
|
|
861
|
+
* read it from `listAlerts()` / the console instead.
|
|
862
|
+
*/
|
|
807
863
|
alert_id?: string;
|
|
808
864
|
}
|
|
809
865
|
/**
|
|
@@ -817,12 +873,12 @@ interface EventBasedFaceVerificationCallback {
|
|
|
817
873
|
resource_id: string;
|
|
818
874
|
status: KycStatus;
|
|
819
875
|
/**
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
876
|
+
* Reserved and not populated on face verification callbacks: the block
|
|
877
|
+
* decision is `data.block`. Only the document-KYC `kyc` callback sets a
|
|
878
|
+
* top-level `block`.
|
|
823
879
|
*/
|
|
824
880
|
block?: boolean;
|
|
825
|
-
/**
|
|
881
|
+
/** Reserved and not populated; see `data.block`. */
|
|
826
882
|
block_reason?: string;
|
|
827
883
|
/**
|
|
828
884
|
* Structured decline reasons. Returned by
|
|
@@ -1559,4 +1615,4 @@ declare class KycClient extends BaseClient {
|
|
|
1559
1615
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1560
1616
|
}
|
|
1561
1617
|
|
|
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 };
|
|
1618
|
+
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 KycStatusCallbackEvent, 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, isKycStatusCallbackEvent, isProfileChangeCallbackEvent };
|
package/dist/kyc/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CustomerProfile, P as ProfileFilters, b as ProfileListResponse, a as CreateProfileRequest } from '../types-qXamJr2q.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
|
|
|
@@ -15,7 +15,7 @@ type KycStatus =
|
|
|
15
15
|
/** Submit link issued but the customer has not submitted documents yet — not "in progress". */
|
|
16
16
|
'awaiting_kyc'
|
|
17
17
|
/** Documents submitted, verification in progress. */
|
|
18
|
-
| 'pending' | 'accepted' | 'declined' | 'review.pending'
|
|
18
|
+
| 'pending' | 'accepted' | 'declined' | 'review.pending';
|
|
19
19
|
type KycDeclinedCode = 'KYC_DOCUMENT_EXPIRED' | 'KYC_DOCUMENT_INVALID' | 'KYC_FACE_MISMATCH' | 'KYC_AGE_REQUIREMENT' | 'KYC_DUPLICATE_IDENTITY' | 'KYC_ADDRESS_MISMATCH' | 'KYC_NAME_MISMATCH' | 'KYC_PROVIDER_REJECTED' | 'KYC_DECLINED';
|
|
20
20
|
declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
|
|
21
21
|
type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
|
|
@@ -111,7 +111,8 @@ interface KycRequest {
|
|
|
111
111
|
block_reason?: string;
|
|
112
112
|
proofs?: Proof[];
|
|
113
113
|
alerts?: KycAlert[];
|
|
114
|
-
|
|
114
|
+
/** The customer's risk profile (`risk_category`, `risk_score`, `kyc_status`, ...). */
|
|
115
|
+
risk_profile?: CustomerProfile;
|
|
115
116
|
created_at: string;
|
|
116
117
|
updated_at: string;
|
|
117
118
|
}
|
|
@@ -136,21 +137,17 @@ interface ProofDownloadURL {
|
|
|
136
137
|
/** Not sent by the platform; the link itself is short-lived. */
|
|
137
138
|
expires_at?: string;
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
sanctions_status?: boolean;
|
|
151
|
-
created_at: string;
|
|
152
|
-
updated_at: string;
|
|
153
|
-
}
|
|
140
|
+
/**
|
|
141
|
+
* The customer's risk profile as embedded on a KYC record
|
|
142
|
+
* (`additional_data.risk_profile`). The platform preloads the full
|
|
143
|
+
* `customer_profiles` row, so this is the same shape as
|
|
144
|
+
* {@link CustomerProfile}: read `risk_category` / `risk_score`, `kyc_status`,
|
|
145
|
+
* `is_pep`, `has_sanctions`. There is no `risk_level` field on the wire.
|
|
146
|
+
*
|
|
147
|
+
* @deprecated Use {@link CustomerProfile}; this alias is kept for existing
|
|
148
|
+
* imports and will be removed in a future major.
|
|
149
|
+
*/
|
|
150
|
+
type KycCustomerProfile = CustomerProfile;
|
|
154
151
|
interface KycAlert {
|
|
155
152
|
id: string;
|
|
156
153
|
kyc_id: string;
|
|
@@ -269,6 +266,16 @@ interface KycVerificationTriggers {
|
|
|
269
266
|
first_purchase: boolean;
|
|
270
267
|
/** Re-trigger verification once the customer's identity document has expired. */
|
|
271
268
|
auto_trigger_on_id_expiration: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Manual KYC Verification: whether customers may start a verification
|
|
271
|
+
* themselves (`trigger_event: "manual"`), independent of the event
|
|
272
|
+
* triggers and of their status. On by default. When on, a `manual`
|
|
273
|
+
* request always returns a link — an already verified customer included.
|
|
274
|
+
* When off, it answers `kyc_required: false` with reason
|
|
275
|
+
* `KYC_NOT_REQUIRED_TRIGGER_DISABLED`; hide your Verification option in
|
|
276
|
+
* that case.
|
|
277
|
+
*/
|
|
278
|
+
manual: boolean;
|
|
272
279
|
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
273
280
|
account_sensitive_action?: AccountSensitiveActionTrigger;
|
|
274
281
|
}
|
|
@@ -438,8 +445,9 @@ interface UpdateKycStatusRequest {
|
|
|
438
445
|
}
|
|
439
446
|
/**
|
|
440
447
|
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
441
|
-
* the tenant's KYC verification trigger preferences
|
|
442
|
-
*
|
|
448
|
+
* the tenant's KYC verification trigger preferences (`manual` to the Manual
|
|
449
|
+
* KYC Verification toggle), except `login` (only for an expired identity
|
|
450
|
+
* document).
|
|
443
451
|
*/
|
|
444
452
|
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
445
453
|
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
@@ -501,8 +509,12 @@ interface RequestKycSubmitLinkRequest {
|
|
|
501
509
|
/**
|
|
502
510
|
* Event that triggered the KYC request. The tenant's KYC verification
|
|
503
511
|
* trigger preferences decide, per event, whether KYC is required
|
|
504
|
-
* (`kyc_required` in the response). "manual"
|
|
505
|
-
*
|
|
512
|
+
* (`kyc_required` in the response). "manual" — the customer starting
|
|
513
|
+
* verification themselves — is governed by the tenant's Manual KYC
|
|
514
|
+
* Verification toggle (on by default): when on it always returns a link,
|
|
515
|
+
* even for an already verified customer, and honors the
|
|
516
|
+
* allow-skip-on-manual option (`can_skip`); when off it answers
|
|
517
|
+
* `kyc_required: false` with `KYC_NOT_REQUIRED_TRIGGER_DISABLED`. "login"
|
|
506
518
|
* answers for any customer state — never verified (asked, not skippable),
|
|
507
519
|
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
508
520
|
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
@@ -627,7 +639,8 @@ interface RequestKycSubmitLinkResponse {
|
|
|
627
639
|
* Whether the user may skip verification. `true` for
|
|
628
640
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
629
641
|
* for `"login"` when an expired identity document triggered the request
|
|
630
|
-
* (offer "Remind me later"), and when the customer is already verified
|
|
642
|
+
* (offer "Remind me later"), and when the customer is already verified
|
|
643
|
+
* (except on `"manual"`, which always issues a link while enabled).
|
|
631
644
|
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
632
645
|
* postponed re-verification becomes mandatory.
|
|
633
646
|
*/
|
|
@@ -648,9 +661,9 @@ interface RequestKycSubmitLinkResponse {
|
|
|
648
661
|
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
649
662
|
* once per customer, when the document first becomes expired.
|
|
650
663
|
*
|
|
651
|
-
* It is sent
|
|
652
|
-
*
|
|
653
|
-
*
|
|
664
|
+
* It is sent only while the tenant's auto-trigger-on-ID-expiration setting is
|
|
665
|
+
* enabled; with the setting off the document is still flagged as expired, but
|
|
666
|
+
* no webhook is sent.
|
|
654
667
|
*/
|
|
655
668
|
interface KycDocumentExpiredCallbackEvent {
|
|
656
669
|
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
@@ -692,10 +705,49 @@ interface KycCallbackReactions {
|
|
|
692
705
|
trigger_alert: boolean;
|
|
693
706
|
block: boolean;
|
|
694
707
|
freeze_account: boolean;
|
|
695
|
-
/** Set when `freeze_account` is true: the tenant
|
|
708
|
+
/** Set when `freeze_account` is true: the freeze window the tenant set for the rules that fired. */
|
|
696
709
|
freeze_duration_minutes?: number;
|
|
697
710
|
enforce_logout: boolean;
|
|
698
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Body POSTed to your KYC `callback_url` whenever a document verification
|
|
714
|
+
* reaches an outcome (`accepted`, `declined`, `review.pending`). This is a flat
|
|
715
|
+
* callback, not a platform event envelope: there is no `event_type`, `id` or
|
|
716
|
+
* `timestamp`, so it cannot go through `WebhookHandler`. Verify it with
|
|
717
|
+
* `verifyWebhookSignature`, narrow it with {@link isKycStatusCallbackEvent},
|
|
718
|
+
* and deduplicate on `resource_id` + `status` yourself.
|
|
719
|
+
*/
|
|
720
|
+
interface KycStatusCallbackEvent {
|
|
721
|
+
/** Always `"kyc"` — dispatch on this. */
|
|
722
|
+
event: 'kyc';
|
|
723
|
+
/** The verification reference (your customer identifier). */
|
|
724
|
+
reference: string;
|
|
725
|
+
/** Vesant KYC record ID (`kyc_id`). */
|
|
726
|
+
resource_id: string;
|
|
727
|
+
/** Verification outcome. `awaiting_kyc` / `pending` are never sent. */
|
|
728
|
+
status: 'accepted' | 'declined' | 'review.pending';
|
|
729
|
+
/**
|
|
730
|
+
* `true` when your app should block the triggering action. Set when a
|
|
731
|
+
* failed verification matched a per-event alert rule with the `block`
|
|
732
|
+
* reaction. Sticky once set on the record. Omitted when `false`.
|
|
733
|
+
*/
|
|
734
|
+
block?: boolean;
|
|
735
|
+
/** The event that triggered the block; omitted when not blocked. */
|
|
736
|
+
block_reason?: string;
|
|
737
|
+
/** Comma-joined decline text; the structured list is `data.declined_reasons`. */
|
|
738
|
+
declined_reason?: string;
|
|
739
|
+
/** @deprecated Legacy category → message map; use `data.warning_reasons`. */
|
|
740
|
+
warnings?: Record<string, Record<string, string>>;
|
|
741
|
+
/** Present only when a rule with reactions matched (On Account Sensitive Action). */
|
|
742
|
+
reactions?: KycCallbackReactions;
|
|
743
|
+
/** The full KYC record, with `risk_profile` and proof download links. */
|
|
744
|
+
data: KycRequest;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Type guard for the KYC status callback. Narrows an already
|
|
748
|
+
* signature-verified, parsed payload to {@link KycStatusCallbackEvent}.
|
|
749
|
+
*/
|
|
750
|
+
declare function isKycStatusCallbackEvent(value: unknown): value is KycStatusCallbackEvent;
|
|
699
751
|
/**
|
|
700
752
|
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
701
753
|
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
@@ -803,7 +855,11 @@ interface EventBasedFaceVerificationReactionResult {
|
|
|
803
855
|
/** Tenant app should block the action/account when true. */
|
|
804
856
|
block: boolean;
|
|
805
857
|
freeze_duration_minutes: number;
|
|
806
|
-
/**
|
|
858
|
+
/**
|
|
859
|
+
* Reserved. The dashboard alert is raised after the submit response and
|
|
860
|
+
* the webhook have been built, so neither carries the alert id today;
|
|
861
|
+
* read it from `listAlerts()` / the console instead.
|
|
862
|
+
*/
|
|
807
863
|
alert_id?: string;
|
|
808
864
|
}
|
|
809
865
|
/**
|
|
@@ -817,12 +873,12 @@ interface EventBasedFaceVerificationCallback {
|
|
|
817
873
|
resource_id: string;
|
|
818
874
|
status: KycStatus;
|
|
819
875
|
/**
|
|
820
|
-
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
876
|
+
* Reserved and not populated on face verification callbacks: the block
|
|
877
|
+
* decision is `data.block`. Only the document-KYC `kyc` callback sets a
|
|
878
|
+
* top-level `block`.
|
|
823
879
|
*/
|
|
824
880
|
block?: boolean;
|
|
825
|
-
/**
|
|
881
|
+
/** Reserved and not populated; see `data.block`. */
|
|
826
882
|
block_reason?: string;
|
|
827
883
|
/**
|
|
828
884
|
* Structured decline reasons. Returned by
|
|
@@ -1559,4 +1615,4 @@ declare class KycClient extends BaseClient {
|
|
|
1559
1615
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1560
1616
|
}
|
|
1561
1617
|
|
|
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 };
|
|
1618
|
+
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 KycStatusCallbackEvent, 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, isKycStatusCallbackEvent, isProfileChangeCallbackEvent };
|
package/dist/kyc/index.js
CHANGED
|
@@ -1348,6 +1348,9 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1348
1348
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1349
1349
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1350
1350
|
}
|
|
1351
|
+
function isKycStatusCallbackEvent(value) {
|
|
1352
|
+
return typeof value === "object" && value !== null && value.event === "kyc";
|
|
1353
|
+
}
|
|
1351
1354
|
function isProfileChangeCallbackEvent(value) {
|
|
1352
1355
|
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
1353
1356
|
}
|
|
@@ -1355,6 +1358,7 @@ function isProfileChangeCallbackEvent(value) {
|
|
|
1355
1358
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1356
1359
|
exports.KycClient = KycClient;
|
|
1357
1360
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1361
|
+
exports.isKycStatusCallbackEvent = isKycStatusCallbackEvent;
|
|
1358
1362
|
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
1359
1363
|
//# sourceMappingURL=index.js.map
|
|
1360
1364
|
//# sourceMappingURL=index.js.map
|