vesant-sdk 1.7.0-dev.362ac6b → 1.7.0-dev.5d49984
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -12
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +16 -12
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +16 -12
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +56 -50
- package/dist/kyc/index.d.ts +56 -50
- package/dist/kyc/index.js +16 -12
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +16 -12
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +12 -12
- package/dist/react.d.ts +12 -12
- package/dist/react.js +19 -10
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +19 -10
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -132,10 +132,10 @@ interface UpdateKycAlertRequest {
|
|
|
132
132
|
*
|
|
133
133
|
* - `enabled=false` → event blocked.
|
|
134
134
|
* - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
|
|
135
|
-
* type triggers
|
|
135
|
+
* type triggers Event-Based Face Verification, regardless of amount.
|
|
136
136
|
* - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
|
|
137
137
|
*/
|
|
138
|
-
interface
|
|
138
|
+
interface EventBasedFaceVerificationThresholdTrigger {
|
|
139
139
|
enabled: boolean;
|
|
140
140
|
/** USD threshold; 0 / null / omitted means "any amount". */
|
|
141
141
|
threshold: number;
|
|
@@ -148,15 +148,15 @@ interface ReuseKycThresholdTrigger {
|
|
|
148
148
|
* `event_window_minutes <= window_minutes`. Either bound of 0 means
|
|
149
149
|
* "don't enforce that bound".
|
|
150
150
|
*/
|
|
151
|
-
interface
|
|
151
|
+
interface EventBasedFaceVerificationFrequencyTrigger {
|
|
152
152
|
enabled: boolean;
|
|
153
153
|
/** Minimum number of events; 0 / null / omitted means "any count". */
|
|
154
154
|
count: number;
|
|
155
155
|
/** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
|
|
156
156
|
window_minutes: number;
|
|
157
157
|
}
|
|
158
|
-
/** Events that can trigger
|
|
159
|
-
interface
|
|
158
|
+
/** Events that can trigger Event-Based Face Verification for a tenant. */
|
|
159
|
+
interface EventBasedFaceVerificationTriggers {
|
|
160
160
|
login: boolean;
|
|
161
161
|
password_change: boolean;
|
|
162
162
|
name_change: boolean;
|
|
@@ -165,19 +165,19 @@ interface ReuseKycTriggers {
|
|
|
165
165
|
new_device_or_location: boolean;
|
|
166
166
|
device_fingerprint_change: boolean;
|
|
167
167
|
payment_method_change: boolean;
|
|
168
|
-
deposit:
|
|
169
|
-
withdrawal:
|
|
170
|
-
large_bet_placement:
|
|
171
|
-
high_frequency_betting:
|
|
168
|
+
deposit: EventBasedFaceVerificationThresholdTrigger;
|
|
169
|
+
withdrawal: EventBasedFaceVerificationThresholdTrigger;
|
|
170
|
+
large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
|
|
171
|
+
high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
|
|
172
172
|
account_balance_transfer: boolean;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
|
-
* Reactions taken when a customer exhausts the
|
|
175
|
+
* Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
|
|
176
176
|
* `trigger_alert` is enforced by the server (creates a KYC alert);
|
|
177
177
|
* `enforce_logout` and `freeze_account` are forwarded to the tenant app
|
|
178
178
|
* via the callback `data` field for it to enforce.
|
|
179
179
|
*/
|
|
180
|
-
interface
|
|
180
|
+
interface EventBasedFaceVerificationReactions {
|
|
181
181
|
/** Retries after the first attempt; total submissions = this + 1. */
|
|
182
182
|
max_retry_attempts: number;
|
|
183
183
|
trigger_alert: boolean;
|
|
@@ -193,7 +193,7 @@ interface KycPreferences {
|
|
|
193
193
|
is_face_verification_required: boolean;
|
|
194
194
|
is_address_verification_required: boolean;
|
|
195
195
|
is_age_verification_required: boolean;
|
|
196
|
-
/** Master switch for the
|
|
196
|
+
/** Master switch for the Event-Based Face Verification feature. */
|
|
197
197
|
is_reuse_kyc_enabled?: boolean;
|
|
198
198
|
min_age: number;
|
|
199
199
|
max_age: number;
|
|
@@ -202,10 +202,10 @@ interface KycPreferences {
|
|
|
202
202
|
high_risk_score: number;
|
|
203
203
|
medium_risk_score: number;
|
|
204
204
|
supported_document_types: SupportedDocumentType[];
|
|
205
|
-
/** Per-event triggers for
|
|
206
|
-
reuse_kyc_triggers?:
|
|
207
|
-
/** Retry / reaction policy for
|
|
208
|
-
reuse_kyc_reactions?:
|
|
205
|
+
/** Per-event triggers for Event-Based Face Verification. */
|
|
206
|
+
reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
|
|
207
|
+
/** Retry / reaction policy for Event-Based Face Verification. */
|
|
208
|
+
reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
|
|
209
209
|
created_at: string;
|
|
210
210
|
updated_at: string;
|
|
211
211
|
}
|
|
@@ -224,9 +224,9 @@ interface UpdateKycPreferencesRequest {
|
|
|
224
224
|
medium_risk_score?: number;
|
|
225
225
|
supported_document_types?: SupportedDocumentType[];
|
|
226
226
|
/** Partial update — only the events present here are changed. */
|
|
227
|
-
reuse_kyc_triggers?: Partial<
|
|
227
|
+
reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
|
|
228
228
|
/** Partial update — only the keys present here are changed. */
|
|
229
|
-
reuse_kyc_reactions?: Partial<
|
|
229
|
+
reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
|
|
230
230
|
}
|
|
231
231
|
interface Name {
|
|
232
232
|
first_name?: string;
|
|
@@ -310,25 +310,25 @@ interface RequestKycSubmitLinkRequest {
|
|
|
310
310
|
trigger_event?: string;
|
|
311
311
|
}
|
|
312
312
|
/**
|
|
313
|
-
* Trigger events that can request
|
|
313
|
+
* Trigger events that can request Event-Based Face Verification.
|
|
314
314
|
*
|
|
315
315
|
* Account-sensitive: any sensitive change to the account profile.
|
|
316
316
|
* Transaction events: covered by the per-event rules in
|
|
317
|
-
* `
|
|
317
|
+
* `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
|
|
318
318
|
* `high_frequency_betting`, `account_balance_transfer`).
|
|
319
319
|
*/
|
|
320
|
-
type
|
|
321
|
-
interface
|
|
320
|
+
type EventBasedFaceVerificationEvent = 'login' | 'password_change' | 'name_change' | 'phone_number_change' | 'two_factor_auth_change' | 'new_device_or_location' | 'device_fingerprint_change' | 'payment_method_change' | 'deposit' | 'withdrawal' | 'large_bet_placement' | 'high_frequency_betting' | 'account_balance_transfer';
|
|
321
|
+
interface CreateEventBasedFaceVerificationSessionRequest {
|
|
322
322
|
/** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
|
|
323
323
|
reference: string;
|
|
324
324
|
/** Customer ID to associate with the KYC session */
|
|
325
325
|
customer_id: string;
|
|
326
326
|
/**
|
|
327
|
-
* The triggering event. One of the `
|
|
327
|
+
* The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
|
|
328
328
|
* Required — when empty, the server falls through to the unknown-event
|
|
329
329
|
* passthrough and allows the request silently.
|
|
330
330
|
*/
|
|
331
|
-
event:
|
|
331
|
+
event: EventBasedFaceVerificationEvent;
|
|
332
332
|
/**
|
|
333
333
|
* USD amount associated with the event. Required for threshold-gated
|
|
334
334
|
* events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
|
|
@@ -352,11 +352,11 @@ interface CreateReuseKycSessionRequest {
|
|
|
352
352
|
event_window_minutes?: number;
|
|
353
353
|
/** URL to redirect user after validate the facial submission (optional) */
|
|
354
354
|
redirect_url?: string;
|
|
355
|
-
/** URL to receive callback notifications via POST request when
|
|
355
|
+
/** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
|
|
356
356
|
callback_url?: string;
|
|
357
357
|
}
|
|
358
|
-
interface
|
|
359
|
-
/**
|
|
358
|
+
interface SubmitEventBasedFaceVerificationSessionRequest {
|
|
359
|
+
/** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
|
|
360
360
|
token: string;
|
|
361
361
|
/** Base64 encoded face image or selfie for verification */
|
|
362
362
|
proof: string;
|
|
@@ -370,14 +370,14 @@ interface RequestKycSubmitLinkResponse {
|
|
|
370
370
|
kyc_id: string;
|
|
371
371
|
}
|
|
372
372
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
373
|
-
type
|
|
374
|
-
interface
|
|
375
|
-
/**
|
|
373
|
+
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
374
|
+
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
375
|
+
/** Event-Based Face Verification session reference (echo of the request reference) */
|
|
376
376
|
reference: string;
|
|
377
|
-
/** Generated
|
|
377
|
+
/** Generated Event-Based Face Verification session token, valid 10 minutes */
|
|
378
378
|
token: string;
|
|
379
379
|
/**
|
|
380
|
-
* Empty string when
|
|
380
|
+
* Empty string when Event-Based Face Verification is required. When `is_required` is
|
|
381
381
|
* false, this contains the human-readable reason (e.g. feature
|
|
382
382
|
* disabled, threshold not met, customer has no prior KYC).
|
|
383
383
|
*/
|
|
@@ -406,7 +406,7 @@ interface CreateReuseKycSessionResponse {
|
|
|
406
406
|
* or freeze the account. Reaction flags are only populated when
|
|
407
407
|
* `retry_limit_exceeded` is true.
|
|
408
408
|
*/
|
|
409
|
-
interface
|
|
409
|
+
interface EventBasedFaceVerificationReactionResult {
|
|
410
410
|
/** Submissions the customer still has before the retry limit fires. */
|
|
411
411
|
retries_remaining: number;
|
|
412
412
|
/** True once the latest failed attempt exhausts the retry policy. */
|
|
@@ -414,16 +414,18 @@ interface ReuseKycReactionResult {
|
|
|
414
414
|
trigger_alert: boolean;
|
|
415
415
|
enforce_logout: boolean;
|
|
416
416
|
freeze_account: boolean;
|
|
417
|
+
/** Tenant app should block the action/account when true. */
|
|
418
|
+
block: boolean;
|
|
417
419
|
freeze_duration_minutes: number;
|
|
418
420
|
/** Set when an alert was raised on the dashboard. */
|
|
419
421
|
alert_id?: string;
|
|
420
422
|
}
|
|
421
423
|
/**
|
|
422
|
-
* Shape of the webhook body POSTed to `callback_url` after a
|
|
424
|
+
* Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
|
|
423
425
|
* submission completes (also returned synchronously from
|
|
424
|
-
* `
|
|
426
|
+
* `submitEventBasedFaceVerificationSession`).
|
|
425
427
|
*/
|
|
426
|
-
interface
|
|
428
|
+
interface EventBasedFaceVerificationCallback {
|
|
427
429
|
event: 'reuse_kyc';
|
|
428
430
|
reference: string;
|
|
429
431
|
resource_id: string;
|
|
@@ -434,7 +436,7 @@ interface ReuseKycCallback {
|
|
|
434
436
|
declined_reason?: string;
|
|
435
437
|
/** @deprecated Use structured reasons. */
|
|
436
438
|
warnings?: Record<string, Record<string, string>>;
|
|
437
|
-
data:
|
|
439
|
+
data: EventBasedFaceVerificationReactionResult;
|
|
438
440
|
}
|
|
439
441
|
/**
|
|
440
442
|
* Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
|
|
@@ -450,7 +452,7 @@ interface KycHandoffSession {
|
|
|
450
452
|
face: string;
|
|
451
453
|
/** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
|
|
452
454
|
mobile_connected: boolean;
|
|
453
|
-
/** True after the (normal-KYC) document submission completes; unused for
|
|
455
|
+
/** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
|
|
454
456
|
is_submitted: boolean;
|
|
455
457
|
}
|
|
456
458
|
interface CheckKycStatusRequest {
|
|
@@ -671,7 +673,7 @@ declare class KycClient extends BaseClient {
|
|
|
671
673
|
*/
|
|
672
674
|
requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
|
|
673
675
|
/**
|
|
674
|
-
* Create a
|
|
676
|
+
* Create a Event-Based Face Verification session.
|
|
675
677
|
*
|
|
676
678
|
* Inspect the response before showing UI:
|
|
677
679
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -681,35 +683,39 @@ declare class KycClient extends BaseClient {
|
|
|
681
683
|
*
|
|
682
684
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
683
685
|
*/
|
|
684
|
-
|
|
686
|
+
createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
685
687
|
/**
|
|
686
|
-
* Submit a real-time face capture for an active
|
|
688
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
687
689
|
*
|
|
688
690
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
689
691
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
690
|
-
* QR handoff from `
|
|
692
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
691
693
|
*
|
|
692
694
|
* The `data` field on the response carries `retries_remaining`,
|
|
693
695
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
694
696
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
695
697
|
*
|
|
696
|
-
* @param request - Token from `
|
|
698
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
697
699
|
*/
|
|
698
|
-
|
|
700
|
+
submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
|
|
699
701
|
/**
|
|
700
|
-
* Look up the current state of a
|
|
701
|
-
*
|
|
702
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
703
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
702
704
|
*
|
|
703
|
-
*
|
|
705
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
706
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
707
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
708
|
+
*
|
|
709
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
704
710
|
*/
|
|
705
|
-
|
|
711
|
+
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
706
712
|
/**
|
|
707
713
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
708
714
|
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
709
715
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
710
716
|
* scanned the QR and attached.
|
|
711
717
|
*
|
|
712
|
-
* @param token - The session token returned by `
|
|
718
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
713
719
|
*/
|
|
714
720
|
getHandoffSession(token: string): Promise<KycHandoffSession>;
|
|
715
721
|
/**
|
|
@@ -1043,4 +1049,4 @@ declare class KycClient extends BaseClient {
|
|
|
1043
1049
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1044
1050
|
}
|
|
1045
1051
|
|
|
1046
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type
|
|
1052
|
+
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 KycCustomerProfile, type KycDeclinedCode, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, 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 };
|
package/dist/kyc/index.d.ts
CHANGED
|
@@ -132,10 +132,10 @@ interface UpdateKycAlertRequest {
|
|
|
132
132
|
*
|
|
133
133
|
* - `enabled=false` → event blocked.
|
|
134
134
|
* - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
|
|
135
|
-
* type triggers
|
|
135
|
+
* type triggers Event-Based Face Verification, regardless of amount.
|
|
136
136
|
* - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
|
|
137
137
|
*/
|
|
138
|
-
interface
|
|
138
|
+
interface EventBasedFaceVerificationThresholdTrigger {
|
|
139
139
|
enabled: boolean;
|
|
140
140
|
/** USD threshold; 0 / null / omitted means "any amount". */
|
|
141
141
|
threshold: number;
|
|
@@ -148,15 +148,15 @@ interface ReuseKycThresholdTrigger {
|
|
|
148
148
|
* `event_window_minutes <= window_minutes`. Either bound of 0 means
|
|
149
149
|
* "don't enforce that bound".
|
|
150
150
|
*/
|
|
151
|
-
interface
|
|
151
|
+
interface EventBasedFaceVerificationFrequencyTrigger {
|
|
152
152
|
enabled: boolean;
|
|
153
153
|
/** Minimum number of events; 0 / null / omitted means "any count". */
|
|
154
154
|
count: number;
|
|
155
155
|
/** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
|
|
156
156
|
window_minutes: number;
|
|
157
157
|
}
|
|
158
|
-
/** Events that can trigger
|
|
159
|
-
interface
|
|
158
|
+
/** Events that can trigger Event-Based Face Verification for a tenant. */
|
|
159
|
+
interface EventBasedFaceVerificationTriggers {
|
|
160
160
|
login: boolean;
|
|
161
161
|
password_change: boolean;
|
|
162
162
|
name_change: boolean;
|
|
@@ -165,19 +165,19 @@ interface ReuseKycTriggers {
|
|
|
165
165
|
new_device_or_location: boolean;
|
|
166
166
|
device_fingerprint_change: boolean;
|
|
167
167
|
payment_method_change: boolean;
|
|
168
|
-
deposit:
|
|
169
|
-
withdrawal:
|
|
170
|
-
large_bet_placement:
|
|
171
|
-
high_frequency_betting:
|
|
168
|
+
deposit: EventBasedFaceVerificationThresholdTrigger;
|
|
169
|
+
withdrawal: EventBasedFaceVerificationThresholdTrigger;
|
|
170
|
+
large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
|
|
171
|
+
high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
|
|
172
172
|
account_balance_transfer: boolean;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
|
-
* Reactions taken when a customer exhausts the
|
|
175
|
+
* Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
|
|
176
176
|
* `trigger_alert` is enforced by the server (creates a KYC alert);
|
|
177
177
|
* `enforce_logout` and `freeze_account` are forwarded to the tenant app
|
|
178
178
|
* via the callback `data` field for it to enforce.
|
|
179
179
|
*/
|
|
180
|
-
interface
|
|
180
|
+
interface EventBasedFaceVerificationReactions {
|
|
181
181
|
/** Retries after the first attempt; total submissions = this + 1. */
|
|
182
182
|
max_retry_attempts: number;
|
|
183
183
|
trigger_alert: boolean;
|
|
@@ -193,7 +193,7 @@ interface KycPreferences {
|
|
|
193
193
|
is_face_verification_required: boolean;
|
|
194
194
|
is_address_verification_required: boolean;
|
|
195
195
|
is_age_verification_required: boolean;
|
|
196
|
-
/** Master switch for the
|
|
196
|
+
/** Master switch for the Event-Based Face Verification feature. */
|
|
197
197
|
is_reuse_kyc_enabled?: boolean;
|
|
198
198
|
min_age: number;
|
|
199
199
|
max_age: number;
|
|
@@ -202,10 +202,10 @@ interface KycPreferences {
|
|
|
202
202
|
high_risk_score: number;
|
|
203
203
|
medium_risk_score: number;
|
|
204
204
|
supported_document_types: SupportedDocumentType[];
|
|
205
|
-
/** Per-event triggers for
|
|
206
|
-
reuse_kyc_triggers?:
|
|
207
|
-
/** Retry / reaction policy for
|
|
208
|
-
reuse_kyc_reactions?:
|
|
205
|
+
/** Per-event triggers for Event-Based Face Verification. */
|
|
206
|
+
reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
|
|
207
|
+
/** Retry / reaction policy for Event-Based Face Verification. */
|
|
208
|
+
reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
|
|
209
209
|
created_at: string;
|
|
210
210
|
updated_at: string;
|
|
211
211
|
}
|
|
@@ -224,9 +224,9 @@ interface UpdateKycPreferencesRequest {
|
|
|
224
224
|
medium_risk_score?: number;
|
|
225
225
|
supported_document_types?: SupportedDocumentType[];
|
|
226
226
|
/** Partial update — only the events present here are changed. */
|
|
227
|
-
reuse_kyc_triggers?: Partial<
|
|
227
|
+
reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
|
|
228
228
|
/** Partial update — only the keys present here are changed. */
|
|
229
|
-
reuse_kyc_reactions?: Partial<
|
|
229
|
+
reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
|
|
230
230
|
}
|
|
231
231
|
interface Name {
|
|
232
232
|
first_name?: string;
|
|
@@ -310,25 +310,25 @@ interface RequestKycSubmitLinkRequest {
|
|
|
310
310
|
trigger_event?: string;
|
|
311
311
|
}
|
|
312
312
|
/**
|
|
313
|
-
* Trigger events that can request
|
|
313
|
+
* Trigger events that can request Event-Based Face Verification.
|
|
314
314
|
*
|
|
315
315
|
* Account-sensitive: any sensitive change to the account profile.
|
|
316
316
|
* Transaction events: covered by the per-event rules in
|
|
317
|
-
* `
|
|
317
|
+
* `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
|
|
318
318
|
* `high_frequency_betting`, `account_balance_transfer`).
|
|
319
319
|
*/
|
|
320
|
-
type
|
|
321
|
-
interface
|
|
320
|
+
type EventBasedFaceVerificationEvent = 'login' | 'password_change' | 'name_change' | 'phone_number_change' | 'two_factor_auth_change' | 'new_device_or_location' | 'device_fingerprint_change' | 'payment_method_change' | 'deposit' | 'withdrawal' | 'large_bet_placement' | 'high_frequency_betting' | 'account_balance_transfer';
|
|
321
|
+
interface CreateEventBasedFaceVerificationSessionRequest {
|
|
322
322
|
/** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
|
|
323
323
|
reference: string;
|
|
324
324
|
/** Customer ID to associate with the KYC session */
|
|
325
325
|
customer_id: string;
|
|
326
326
|
/**
|
|
327
|
-
* The triggering event. One of the `
|
|
327
|
+
* The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
|
|
328
328
|
* Required — when empty, the server falls through to the unknown-event
|
|
329
329
|
* passthrough and allows the request silently.
|
|
330
330
|
*/
|
|
331
|
-
event:
|
|
331
|
+
event: EventBasedFaceVerificationEvent;
|
|
332
332
|
/**
|
|
333
333
|
* USD amount associated with the event. Required for threshold-gated
|
|
334
334
|
* events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
|
|
@@ -352,11 +352,11 @@ interface CreateReuseKycSessionRequest {
|
|
|
352
352
|
event_window_minutes?: number;
|
|
353
353
|
/** URL to redirect user after validate the facial submission (optional) */
|
|
354
354
|
redirect_url?: string;
|
|
355
|
-
/** URL to receive callback notifications via POST request when
|
|
355
|
+
/** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
|
|
356
356
|
callback_url?: string;
|
|
357
357
|
}
|
|
358
|
-
interface
|
|
359
|
-
/**
|
|
358
|
+
interface SubmitEventBasedFaceVerificationSessionRequest {
|
|
359
|
+
/** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
|
|
360
360
|
token: string;
|
|
361
361
|
/** Base64 encoded face image or selfie for verification */
|
|
362
362
|
proof: string;
|
|
@@ -370,14 +370,14 @@ interface RequestKycSubmitLinkResponse {
|
|
|
370
370
|
kyc_id: string;
|
|
371
371
|
}
|
|
372
372
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
373
|
-
type
|
|
374
|
-
interface
|
|
375
|
-
/**
|
|
373
|
+
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
374
|
+
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
375
|
+
/** Event-Based Face Verification session reference (echo of the request reference) */
|
|
376
376
|
reference: string;
|
|
377
|
-
/** Generated
|
|
377
|
+
/** Generated Event-Based Face Verification session token, valid 10 minutes */
|
|
378
378
|
token: string;
|
|
379
379
|
/**
|
|
380
|
-
* Empty string when
|
|
380
|
+
* Empty string when Event-Based Face Verification is required. When `is_required` is
|
|
381
381
|
* false, this contains the human-readable reason (e.g. feature
|
|
382
382
|
* disabled, threshold not met, customer has no prior KYC).
|
|
383
383
|
*/
|
|
@@ -406,7 +406,7 @@ interface CreateReuseKycSessionResponse {
|
|
|
406
406
|
* or freeze the account. Reaction flags are only populated when
|
|
407
407
|
* `retry_limit_exceeded` is true.
|
|
408
408
|
*/
|
|
409
|
-
interface
|
|
409
|
+
interface EventBasedFaceVerificationReactionResult {
|
|
410
410
|
/** Submissions the customer still has before the retry limit fires. */
|
|
411
411
|
retries_remaining: number;
|
|
412
412
|
/** True once the latest failed attempt exhausts the retry policy. */
|
|
@@ -414,16 +414,18 @@ interface ReuseKycReactionResult {
|
|
|
414
414
|
trigger_alert: boolean;
|
|
415
415
|
enforce_logout: boolean;
|
|
416
416
|
freeze_account: boolean;
|
|
417
|
+
/** Tenant app should block the action/account when true. */
|
|
418
|
+
block: boolean;
|
|
417
419
|
freeze_duration_minutes: number;
|
|
418
420
|
/** Set when an alert was raised on the dashboard. */
|
|
419
421
|
alert_id?: string;
|
|
420
422
|
}
|
|
421
423
|
/**
|
|
422
|
-
* Shape of the webhook body POSTed to `callback_url` after a
|
|
424
|
+
* Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
|
|
423
425
|
* submission completes (also returned synchronously from
|
|
424
|
-
* `
|
|
426
|
+
* `submitEventBasedFaceVerificationSession`).
|
|
425
427
|
*/
|
|
426
|
-
interface
|
|
428
|
+
interface EventBasedFaceVerificationCallback {
|
|
427
429
|
event: 'reuse_kyc';
|
|
428
430
|
reference: string;
|
|
429
431
|
resource_id: string;
|
|
@@ -434,7 +436,7 @@ interface ReuseKycCallback {
|
|
|
434
436
|
declined_reason?: string;
|
|
435
437
|
/** @deprecated Use structured reasons. */
|
|
436
438
|
warnings?: Record<string, Record<string, string>>;
|
|
437
|
-
data:
|
|
439
|
+
data: EventBasedFaceVerificationReactionResult;
|
|
438
440
|
}
|
|
439
441
|
/**
|
|
440
442
|
* Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
|
|
@@ -450,7 +452,7 @@ interface KycHandoffSession {
|
|
|
450
452
|
face: string;
|
|
451
453
|
/** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
|
|
452
454
|
mobile_connected: boolean;
|
|
453
|
-
/** True after the (normal-KYC) document submission completes; unused for
|
|
455
|
+
/** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
|
|
454
456
|
is_submitted: boolean;
|
|
455
457
|
}
|
|
456
458
|
interface CheckKycStatusRequest {
|
|
@@ -671,7 +673,7 @@ declare class KycClient extends BaseClient {
|
|
|
671
673
|
*/
|
|
672
674
|
requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
|
|
673
675
|
/**
|
|
674
|
-
* Create a
|
|
676
|
+
* Create a Event-Based Face Verification session.
|
|
675
677
|
*
|
|
676
678
|
* Inspect the response before showing UI:
|
|
677
679
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -681,35 +683,39 @@ declare class KycClient extends BaseClient {
|
|
|
681
683
|
*
|
|
682
684
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
683
685
|
*/
|
|
684
|
-
|
|
686
|
+
createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
685
687
|
/**
|
|
686
|
-
* Submit a real-time face capture for an active
|
|
688
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
687
689
|
*
|
|
688
690
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
689
691
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
690
|
-
* QR handoff from `
|
|
692
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
691
693
|
*
|
|
692
694
|
* The `data` field on the response carries `retries_remaining`,
|
|
693
695
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
694
696
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
695
697
|
*
|
|
696
|
-
* @param request - Token from `
|
|
698
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
697
699
|
*/
|
|
698
|
-
|
|
700
|
+
submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
|
|
699
701
|
/**
|
|
700
|
-
* Look up the current state of a
|
|
701
|
-
*
|
|
702
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
703
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
702
704
|
*
|
|
703
|
-
*
|
|
705
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
706
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
707
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
708
|
+
*
|
|
709
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
704
710
|
*/
|
|
705
|
-
|
|
711
|
+
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
706
712
|
/**
|
|
707
713
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
708
714
|
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
709
715
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
710
716
|
* scanned the QR and attached.
|
|
711
717
|
*
|
|
712
|
-
* @param token - The session token returned by `
|
|
718
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
713
719
|
*/
|
|
714
720
|
getHandoffSession(token: string): Promise<KycHandoffSession>;
|
|
715
721
|
/**
|
|
@@ -1043,4 +1049,4 @@ declare class KycClient extends BaseClient {
|
|
|
1043
1049
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1044
1050
|
}
|
|
1045
1051
|
|
|
1046
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type
|
|
1052
|
+
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 KycCustomerProfile, type KycDeclinedCode, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitEventBasedFaceVerificationSessionRequest, type SubmittedDocument, 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 };
|
package/dist/kyc/index.js
CHANGED
|
@@ -626,7 +626,7 @@ var KycClient = class extends BaseClient {
|
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
629
|
-
* Create a
|
|
629
|
+
* Create a Event-Based Face Verification session.
|
|
630
630
|
*
|
|
631
631
|
* Inspect the response before showing UI:
|
|
632
632
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -636,7 +636,7 @@ var KycClient = class extends BaseClient {
|
|
|
636
636
|
*
|
|
637
637
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
638
638
|
*/
|
|
639
|
-
async
|
|
639
|
+
async createEventBasedFaceVerificationSession(request) {
|
|
640
640
|
return this.request("/api/v1/kyc/face/session", {
|
|
641
641
|
method: "POST",
|
|
642
642
|
body: JSON.stringify(request),
|
|
@@ -644,19 +644,19 @@ var KycClient = class extends BaseClient {
|
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
646
|
/**
|
|
647
|
-
* Submit a real-time face capture for an active
|
|
647
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
648
648
|
*
|
|
649
649
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
650
650
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
651
|
-
* QR handoff from `
|
|
651
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
652
652
|
*
|
|
653
653
|
* The `data` field on the response carries `retries_remaining`,
|
|
654
654
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
655
655
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
656
656
|
*
|
|
657
|
-
* @param request - Token from `
|
|
657
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
658
658
|
*/
|
|
659
|
-
async
|
|
659
|
+
async submitEventBasedFaceVerificationSession(request) {
|
|
660
660
|
return this.request("/api/v1/kyc/face/submit", {
|
|
661
661
|
method: "POST",
|
|
662
662
|
body: JSON.stringify(request),
|
|
@@ -664,13 +664,17 @@ var KycClient = class extends BaseClient {
|
|
|
664
664
|
});
|
|
665
665
|
}
|
|
666
666
|
/**
|
|
667
|
-
* Look up the current state of a
|
|
668
|
-
*
|
|
667
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
668
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
669
669
|
*
|
|
670
|
-
*
|
|
670
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
671
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
672
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
673
|
+
*
|
|
674
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
671
675
|
*/
|
|
672
|
-
async
|
|
673
|
-
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(
|
|
676
|
+
async getEventBasedFaceVerificationSessionStatus(token) {
|
|
677
|
+
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(token)}`, {
|
|
674
678
|
method: "GET",
|
|
675
679
|
headers: this.getUserHeaders()
|
|
676
680
|
});
|
|
@@ -681,7 +685,7 @@ var KycClient = class extends BaseClient {
|
|
|
681
685
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
682
686
|
* scanned the QR and attached.
|
|
683
687
|
*
|
|
684
|
-
* @param token - The session token returned by `
|
|
688
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
685
689
|
*/
|
|
686
690
|
async getHandoffSession(token) {
|
|
687
691
|
return this.request(
|