vesant-sdk 1.8.0-dev.d0a7c04 → 1.8.0-dev.d4d3b0d
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 +79 -35
- package/dist/kyc/index.d.ts +79 -35
- 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/{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;
|
|
@@ -272,9 +269,11 @@ interface KycVerificationTriggers {
|
|
|
272
269
|
/**
|
|
273
270
|
* Manual KYC Verification: whether customers may start a verification
|
|
274
271
|
* themselves (`trigger_event: "manual"`), independent of the event
|
|
275
|
-
* triggers. On by default. When
|
|
276
|
-
*
|
|
277
|
-
*
|
|
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.
|
|
278
277
|
*/
|
|
279
278
|
manual: boolean;
|
|
280
279
|
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
@@ -512,9 +511,10 @@ interface RequestKycSubmitLinkRequest {
|
|
|
512
511
|
* trigger preferences decide, per event, whether KYC is required
|
|
513
512
|
* (`kyc_required` in the response). "manual" — the customer starting
|
|
514
513
|
* verification themselves — is governed by the tenant's Manual KYC
|
|
515
|
-
* Verification toggle (on by default)
|
|
516
|
-
*
|
|
517
|
-
*
|
|
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"
|
|
518
518
|
* answers for any customer state — never verified (asked, not skippable),
|
|
519
519
|
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
520
520
|
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
@@ -639,7 +639,8 @@ interface RequestKycSubmitLinkResponse {
|
|
|
639
639
|
* Whether the user may skip verification. `true` for
|
|
640
640
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
641
641
|
* for `"login"` when an expired identity document triggered the request
|
|
642
|
-
* (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).
|
|
643
644
|
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
644
645
|
* postponed re-verification becomes mandatory.
|
|
645
646
|
*/
|
|
@@ -660,9 +661,9 @@ interface RequestKycSubmitLinkResponse {
|
|
|
660
661
|
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
661
662
|
* once per customer, when the document first becomes expired.
|
|
662
663
|
*
|
|
663
|
-
* It is sent
|
|
664
|
-
*
|
|
665
|
-
*
|
|
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.
|
|
666
667
|
*/
|
|
667
668
|
interface KycDocumentExpiredCallbackEvent {
|
|
668
669
|
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
@@ -704,10 +705,49 @@ interface KycCallbackReactions {
|
|
|
704
705
|
trigger_alert: boolean;
|
|
705
706
|
block: boolean;
|
|
706
707
|
freeze_account: boolean;
|
|
707
|
-
/** 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. */
|
|
708
709
|
freeze_duration_minutes?: number;
|
|
709
710
|
enforce_logout: boolean;
|
|
710
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;
|
|
711
751
|
/**
|
|
712
752
|
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
713
753
|
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
@@ -815,7 +855,11 @@ interface EventBasedFaceVerificationReactionResult {
|
|
|
815
855
|
/** Tenant app should block the action/account when true. */
|
|
816
856
|
block: boolean;
|
|
817
857
|
freeze_duration_minutes: number;
|
|
818
|
-
/**
|
|
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
|
+
*/
|
|
819
863
|
alert_id?: string;
|
|
820
864
|
}
|
|
821
865
|
/**
|
|
@@ -829,12 +873,12 @@ interface EventBasedFaceVerificationCallback {
|
|
|
829
873
|
resource_id: string;
|
|
830
874
|
status: KycStatus;
|
|
831
875
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
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`.
|
|
835
879
|
*/
|
|
836
880
|
block?: boolean;
|
|
837
|
-
/**
|
|
881
|
+
/** Reserved and not populated; see `data.block`. */
|
|
838
882
|
block_reason?: string;
|
|
839
883
|
/**
|
|
840
884
|
* Structured decline reasons. Returned by
|
|
@@ -1571,4 +1615,4 @@ declare class KycClient extends BaseClient {
|
|
|
1571
1615
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1572
1616
|
}
|
|
1573
1617
|
|
|
1574
|
-
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;
|
|
@@ -272,9 +269,11 @@ interface KycVerificationTriggers {
|
|
|
272
269
|
/**
|
|
273
270
|
* Manual KYC Verification: whether customers may start a verification
|
|
274
271
|
* themselves (`trigger_event: "manual"`), independent of the event
|
|
275
|
-
* triggers. On by default. When
|
|
276
|
-
*
|
|
277
|
-
*
|
|
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.
|
|
278
277
|
*/
|
|
279
278
|
manual: boolean;
|
|
280
279
|
/** Hold sensitive profile changes (name, DOB, address) behind KYC. */
|
|
@@ -512,9 +511,10 @@ interface RequestKycSubmitLinkRequest {
|
|
|
512
511
|
* trigger preferences decide, per event, whether KYC is required
|
|
513
512
|
* (`kyc_required` in the response). "manual" — the customer starting
|
|
514
513
|
* verification themselves — is governed by the tenant's Manual KYC
|
|
515
|
-
* Verification toggle (on by default)
|
|
516
|
-
*
|
|
517
|
-
*
|
|
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"
|
|
518
518
|
* answers for any customer state — never verified (asked, not skippable),
|
|
519
519
|
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
520
520
|
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
@@ -639,7 +639,8 @@ interface RequestKycSubmitLinkResponse {
|
|
|
639
639
|
* Whether the user may skip verification. `true` for
|
|
640
640
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
641
641
|
* for `"login"` when an expired identity document triggered the request
|
|
642
|
-
* (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).
|
|
643
644
|
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
644
645
|
* postponed re-verification becomes mandatory.
|
|
645
646
|
*/
|
|
@@ -660,9 +661,9 @@ interface RequestKycSubmitLinkResponse {
|
|
|
660
661
|
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
661
662
|
* once per customer, when the document first becomes expired.
|
|
662
663
|
*
|
|
663
|
-
* It is sent
|
|
664
|
-
*
|
|
665
|
-
*
|
|
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.
|
|
666
667
|
*/
|
|
667
668
|
interface KycDocumentExpiredCallbackEvent {
|
|
668
669
|
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
@@ -704,10 +705,49 @@ interface KycCallbackReactions {
|
|
|
704
705
|
trigger_alert: boolean;
|
|
705
706
|
block: boolean;
|
|
706
707
|
freeze_account: boolean;
|
|
707
|
-
/** 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. */
|
|
708
709
|
freeze_duration_minutes?: number;
|
|
709
710
|
enforce_logout: boolean;
|
|
710
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;
|
|
711
751
|
/**
|
|
712
752
|
* Body POSTed to your `callback_url` when a held sensitive profile change is
|
|
713
753
|
* settled. Signed with `X-Webhook-Signature: sha256=<hex>` (HMAC-SHA256 of the
|
|
@@ -815,7 +855,11 @@ interface EventBasedFaceVerificationReactionResult {
|
|
|
815
855
|
/** Tenant app should block the action/account when true. */
|
|
816
856
|
block: boolean;
|
|
817
857
|
freeze_duration_minutes: number;
|
|
818
|
-
/**
|
|
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
|
+
*/
|
|
819
863
|
alert_id?: string;
|
|
820
864
|
}
|
|
821
865
|
/**
|
|
@@ -829,12 +873,12 @@ interface EventBasedFaceVerificationCallback {
|
|
|
829
873
|
resource_id: string;
|
|
830
874
|
status: KycStatus;
|
|
831
875
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
*
|
|
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`.
|
|
835
879
|
*/
|
|
836
880
|
block?: boolean;
|
|
837
|
-
/**
|
|
881
|
+
/** Reserved and not populated; see `data.block`. */
|
|
838
882
|
block_reason?: string;
|
|
839
883
|
/**
|
|
840
884
|
* Structured decline reasons. Returned by
|
|
@@ -1571,4 +1615,4 @@ declare class KycClient extends BaseClient {
|
|
|
1571
1615
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1572
1616
|
}
|
|
1573
1617
|
|
|
1574
|
-
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
|