vesant-sdk 1.7.0-dev.362ac6b → 1.7.0-dev.5305eb7
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -13
- 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 +76 -50
- package/dist/kyc/index.d.ts +76 -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/dist/tax/index.d.mts +18 -1
- package/dist/tax/index.d.ts +18 -1
- package/dist/tax/index.js +4 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +4 -1
- package/dist/tax/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -57,6 +57,18 @@ interface KycRequest {
|
|
|
57
57
|
other_reason?: string;
|
|
58
58
|
/** @deprecated Use {@link warning_reasons}. */
|
|
59
59
|
warnings?: Record<string, Record<string, string>>;
|
|
60
|
+
/**
|
|
61
|
+
* Tenant app should block onboarding/the action when true. Set when a
|
|
62
|
+
* failed verification matches a per-event KYC alert rule with the `block`
|
|
63
|
+
* reaction; sticky once set (a later non-blocking update won't clear it).
|
|
64
|
+
*/
|
|
65
|
+
block: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Names the configured verification that triggered the block (e.g.
|
|
68
|
+
* `document_verification`, `face_verification`, `address_verification`,
|
|
69
|
+
* `age_verification`). Empty when {@link block} is false.
|
|
70
|
+
*/
|
|
71
|
+
block_reason?: string;
|
|
60
72
|
proofs?: Proof[];
|
|
61
73
|
alerts?: KycAlert[];
|
|
62
74
|
risk_profile?: KycCustomerProfile;
|
|
@@ -132,10 +144,10 @@ interface UpdateKycAlertRequest {
|
|
|
132
144
|
*
|
|
133
145
|
* - `enabled=false` → event blocked.
|
|
134
146
|
* - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
|
|
135
|
-
* type triggers
|
|
147
|
+
* type triggers Event-Based Face Verification, regardless of amount.
|
|
136
148
|
* - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
|
|
137
149
|
*/
|
|
138
|
-
interface
|
|
150
|
+
interface EventBasedFaceVerificationThresholdTrigger {
|
|
139
151
|
enabled: boolean;
|
|
140
152
|
/** USD threshold; 0 / null / omitted means "any amount". */
|
|
141
153
|
threshold: number;
|
|
@@ -148,15 +160,15 @@ interface ReuseKycThresholdTrigger {
|
|
|
148
160
|
* `event_window_minutes <= window_minutes`. Either bound of 0 means
|
|
149
161
|
* "don't enforce that bound".
|
|
150
162
|
*/
|
|
151
|
-
interface
|
|
163
|
+
interface EventBasedFaceVerificationFrequencyTrigger {
|
|
152
164
|
enabled: boolean;
|
|
153
165
|
/** Minimum number of events; 0 / null / omitted means "any count". */
|
|
154
166
|
count: number;
|
|
155
167
|
/** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
|
|
156
168
|
window_minutes: number;
|
|
157
169
|
}
|
|
158
|
-
/** Events that can trigger
|
|
159
|
-
interface
|
|
170
|
+
/** Events that can trigger Event-Based Face Verification for a tenant. */
|
|
171
|
+
interface EventBasedFaceVerificationTriggers {
|
|
160
172
|
login: boolean;
|
|
161
173
|
password_change: boolean;
|
|
162
174
|
name_change: boolean;
|
|
@@ -165,19 +177,19 @@ interface ReuseKycTriggers {
|
|
|
165
177
|
new_device_or_location: boolean;
|
|
166
178
|
device_fingerprint_change: boolean;
|
|
167
179
|
payment_method_change: boolean;
|
|
168
|
-
deposit:
|
|
169
|
-
withdrawal:
|
|
170
|
-
large_bet_placement:
|
|
171
|
-
high_frequency_betting:
|
|
180
|
+
deposit: EventBasedFaceVerificationThresholdTrigger;
|
|
181
|
+
withdrawal: EventBasedFaceVerificationThresholdTrigger;
|
|
182
|
+
large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
|
|
183
|
+
high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
|
|
172
184
|
account_balance_transfer: boolean;
|
|
173
185
|
}
|
|
174
186
|
/**
|
|
175
|
-
* Reactions taken when a customer exhausts the
|
|
187
|
+
* Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
|
|
176
188
|
* `trigger_alert` is enforced by the server (creates a KYC alert);
|
|
177
189
|
* `enforce_logout` and `freeze_account` are forwarded to the tenant app
|
|
178
190
|
* via the callback `data` field for it to enforce.
|
|
179
191
|
*/
|
|
180
|
-
interface
|
|
192
|
+
interface EventBasedFaceVerificationReactions {
|
|
181
193
|
/** Retries after the first attempt; total submissions = this + 1. */
|
|
182
194
|
max_retry_attempts: number;
|
|
183
195
|
trigger_alert: boolean;
|
|
@@ -193,7 +205,7 @@ interface KycPreferences {
|
|
|
193
205
|
is_face_verification_required: boolean;
|
|
194
206
|
is_address_verification_required: boolean;
|
|
195
207
|
is_age_verification_required: boolean;
|
|
196
|
-
/** Master switch for the
|
|
208
|
+
/** Master switch for the Event-Based Face Verification feature. */
|
|
197
209
|
is_reuse_kyc_enabled?: boolean;
|
|
198
210
|
min_age: number;
|
|
199
211
|
max_age: number;
|
|
@@ -202,10 +214,10 @@ interface KycPreferences {
|
|
|
202
214
|
high_risk_score: number;
|
|
203
215
|
medium_risk_score: number;
|
|
204
216
|
supported_document_types: SupportedDocumentType[];
|
|
205
|
-
/** Per-event triggers for
|
|
206
|
-
reuse_kyc_triggers?:
|
|
207
|
-
/** Retry / reaction policy for
|
|
208
|
-
reuse_kyc_reactions?:
|
|
217
|
+
/** Per-event triggers for Event-Based Face Verification. */
|
|
218
|
+
reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
|
|
219
|
+
/** Retry / reaction policy for Event-Based Face Verification. */
|
|
220
|
+
reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
|
|
209
221
|
created_at: string;
|
|
210
222
|
updated_at: string;
|
|
211
223
|
}
|
|
@@ -224,9 +236,9 @@ interface UpdateKycPreferencesRequest {
|
|
|
224
236
|
medium_risk_score?: number;
|
|
225
237
|
supported_document_types?: SupportedDocumentType[];
|
|
226
238
|
/** Partial update — only the events present here are changed. */
|
|
227
|
-
reuse_kyc_triggers?: Partial<
|
|
239
|
+
reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
|
|
228
240
|
/** Partial update — only the keys present here are changed. */
|
|
229
|
-
reuse_kyc_reactions?: Partial<
|
|
241
|
+
reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
|
|
230
242
|
}
|
|
231
243
|
interface Name {
|
|
232
244
|
first_name?: string;
|
|
@@ -310,25 +322,25 @@ interface RequestKycSubmitLinkRequest {
|
|
|
310
322
|
trigger_event?: string;
|
|
311
323
|
}
|
|
312
324
|
/**
|
|
313
|
-
* Trigger events that can request
|
|
325
|
+
* Trigger events that can request Event-Based Face Verification.
|
|
314
326
|
*
|
|
315
327
|
* Account-sensitive: any sensitive change to the account profile.
|
|
316
328
|
* Transaction events: covered by the per-event rules in
|
|
317
|
-
* `
|
|
329
|
+
* `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
|
|
318
330
|
* `high_frequency_betting`, `account_balance_transfer`).
|
|
319
331
|
*/
|
|
320
|
-
type
|
|
321
|
-
interface
|
|
332
|
+
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';
|
|
333
|
+
interface CreateEventBasedFaceVerificationSessionRequest {
|
|
322
334
|
/** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
|
|
323
335
|
reference: string;
|
|
324
336
|
/** Customer ID to associate with the KYC session */
|
|
325
337
|
customer_id: string;
|
|
326
338
|
/**
|
|
327
|
-
* The triggering event. One of the `
|
|
339
|
+
* The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
|
|
328
340
|
* Required — when empty, the server falls through to the unknown-event
|
|
329
341
|
* passthrough and allows the request silently.
|
|
330
342
|
*/
|
|
331
|
-
event:
|
|
343
|
+
event: EventBasedFaceVerificationEvent;
|
|
332
344
|
/**
|
|
333
345
|
* USD amount associated with the event. Required for threshold-gated
|
|
334
346
|
* events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
|
|
@@ -352,11 +364,11 @@ interface CreateReuseKycSessionRequest {
|
|
|
352
364
|
event_window_minutes?: number;
|
|
353
365
|
/** URL to redirect user after validate the facial submission (optional) */
|
|
354
366
|
redirect_url?: string;
|
|
355
|
-
/** URL to receive callback notifications via POST request when
|
|
367
|
+
/** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
|
|
356
368
|
callback_url?: string;
|
|
357
369
|
}
|
|
358
|
-
interface
|
|
359
|
-
/**
|
|
370
|
+
interface SubmitEventBasedFaceVerificationSessionRequest {
|
|
371
|
+
/** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
|
|
360
372
|
token: string;
|
|
361
373
|
/** Base64 encoded face image or selfie for verification */
|
|
362
374
|
proof: string;
|
|
@@ -370,14 +382,14 @@ interface RequestKycSubmitLinkResponse {
|
|
|
370
382
|
kyc_id: string;
|
|
371
383
|
}
|
|
372
384
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
373
|
-
type
|
|
374
|
-
interface
|
|
375
|
-
/**
|
|
385
|
+
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
386
|
+
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
387
|
+
/** Event-Based Face Verification session reference (echo of the request reference) */
|
|
376
388
|
reference: string;
|
|
377
|
-
/** Generated
|
|
389
|
+
/** Generated Event-Based Face Verification session token, valid 10 minutes */
|
|
378
390
|
token: string;
|
|
379
391
|
/**
|
|
380
|
-
* Empty string when
|
|
392
|
+
* Empty string when Event-Based Face Verification is required. When `is_required` is
|
|
381
393
|
* false, this contains the human-readable reason (e.g. feature
|
|
382
394
|
* disabled, threshold not met, customer has no prior KYC).
|
|
383
395
|
*/
|
|
@@ -406,7 +418,7 @@ interface CreateReuseKycSessionResponse {
|
|
|
406
418
|
* or freeze the account. Reaction flags are only populated when
|
|
407
419
|
* `retry_limit_exceeded` is true.
|
|
408
420
|
*/
|
|
409
|
-
interface
|
|
421
|
+
interface EventBasedFaceVerificationReactionResult {
|
|
410
422
|
/** Submissions the customer still has before the retry limit fires. */
|
|
411
423
|
retries_remaining: number;
|
|
412
424
|
/** True once the latest failed attempt exhausts the retry policy. */
|
|
@@ -414,27 +426,37 @@ interface ReuseKycReactionResult {
|
|
|
414
426
|
trigger_alert: boolean;
|
|
415
427
|
enforce_logout: boolean;
|
|
416
428
|
freeze_account: boolean;
|
|
429
|
+
/** Tenant app should block the action/account when true. */
|
|
430
|
+
block: boolean;
|
|
417
431
|
freeze_duration_minutes: number;
|
|
418
432
|
/** Set when an alert was raised on the dashboard. */
|
|
419
433
|
alert_id?: string;
|
|
420
434
|
}
|
|
421
435
|
/**
|
|
422
|
-
* Shape of the webhook body POSTed to `callback_url` after a
|
|
436
|
+
* Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
|
|
423
437
|
* submission completes (also returned synchronously from
|
|
424
|
-
* `
|
|
438
|
+
* `submitEventBasedFaceVerificationSession`).
|
|
425
439
|
*/
|
|
426
|
-
interface
|
|
440
|
+
interface EventBasedFaceVerificationCallback {
|
|
427
441
|
event: 'reuse_kyc';
|
|
428
442
|
reference: string;
|
|
429
443
|
resource_id: string;
|
|
430
444
|
status: KycStatus;
|
|
445
|
+
/**
|
|
446
|
+
* True when the tenant app should block the action/account. Mirrors the
|
|
447
|
+
* `block` reaction on {@link data} at the top level of the callback so
|
|
448
|
+
* consumers can branch without inspecting `data`. Omitted when false.
|
|
449
|
+
*/
|
|
450
|
+
block?: boolean;
|
|
451
|
+
/** Names the event/verification that triggered the block. Omitted when not blocked. */
|
|
452
|
+
block_reason?: string;
|
|
431
453
|
/** Structured decline reasons. */
|
|
432
454
|
declined_reasons?: Reason[];
|
|
433
455
|
/** @deprecated Use {@link declined_reasons}. */
|
|
434
456
|
declined_reason?: string;
|
|
435
457
|
/** @deprecated Use structured reasons. */
|
|
436
458
|
warnings?: Record<string, Record<string, string>>;
|
|
437
|
-
data:
|
|
459
|
+
data: EventBasedFaceVerificationReactionResult;
|
|
438
460
|
}
|
|
439
461
|
/**
|
|
440
462
|
* Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
|
|
@@ -450,7 +472,7 @@ interface KycHandoffSession {
|
|
|
450
472
|
face: string;
|
|
451
473
|
/** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
|
|
452
474
|
mobile_connected: boolean;
|
|
453
|
-
/** True after the (normal-KYC) document submission completes; unused for
|
|
475
|
+
/** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
|
|
454
476
|
is_submitted: boolean;
|
|
455
477
|
}
|
|
456
478
|
interface CheckKycStatusRequest {
|
|
@@ -671,7 +693,7 @@ declare class KycClient extends BaseClient {
|
|
|
671
693
|
*/
|
|
672
694
|
requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
|
|
673
695
|
/**
|
|
674
|
-
* Create a
|
|
696
|
+
* Create a Event-Based Face Verification session.
|
|
675
697
|
*
|
|
676
698
|
* Inspect the response before showing UI:
|
|
677
699
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -681,35 +703,39 @@ declare class KycClient extends BaseClient {
|
|
|
681
703
|
*
|
|
682
704
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
683
705
|
*/
|
|
684
|
-
|
|
706
|
+
createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
685
707
|
/**
|
|
686
|
-
* Submit a real-time face capture for an active
|
|
708
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
687
709
|
*
|
|
688
710
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
689
711
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
690
|
-
* QR handoff from `
|
|
712
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
691
713
|
*
|
|
692
714
|
* The `data` field on the response carries `retries_remaining`,
|
|
693
715
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
694
716
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
695
717
|
*
|
|
696
|
-
* @param request - Token from `
|
|
718
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
697
719
|
*/
|
|
698
|
-
|
|
720
|
+
submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
|
|
699
721
|
/**
|
|
700
|
-
* Look up the current state of a
|
|
701
|
-
*
|
|
722
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
723
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
724
|
+
*
|
|
725
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
726
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
727
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
702
728
|
*
|
|
703
|
-
* @param
|
|
729
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
704
730
|
*/
|
|
705
|
-
|
|
731
|
+
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
706
732
|
/**
|
|
707
733
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
708
734
|
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
709
735
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
710
736
|
* scanned the QR and attached.
|
|
711
737
|
*
|
|
712
|
-
* @param token - The session token returned by `
|
|
738
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
713
739
|
*/
|
|
714
740
|
getHandoffSession(token: string): Promise<KycHandoffSession>;
|
|
715
741
|
/**
|
|
@@ -1043,4 +1069,4 @@ declare class KycClient extends BaseClient {
|
|
|
1043
1069
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1044
1070
|
}
|
|
1045
1071
|
|
|
1046
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type
|
|
1072
|
+
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
|
@@ -57,6 +57,18 @@ interface KycRequest {
|
|
|
57
57
|
other_reason?: string;
|
|
58
58
|
/** @deprecated Use {@link warning_reasons}. */
|
|
59
59
|
warnings?: Record<string, Record<string, string>>;
|
|
60
|
+
/**
|
|
61
|
+
* Tenant app should block onboarding/the action when true. Set when a
|
|
62
|
+
* failed verification matches a per-event KYC alert rule with the `block`
|
|
63
|
+
* reaction; sticky once set (a later non-blocking update won't clear it).
|
|
64
|
+
*/
|
|
65
|
+
block: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Names the configured verification that triggered the block (e.g.
|
|
68
|
+
* `document_verification`, `face_verification`, `address_verification`,
|
|
69
|
+
* `age_verification`). Empty when {@link block} is false.
|
|
70
|
+
*/
|
|
71
|
+
block_reason?: string;
|
|
60
72
|
proofs?: Proof[];
|
|
61
73
|
alerts?: KycAlert[];
|
|
62
74
|
risk_profile?: KycCustomerProfile;
|
|
@@ -132,10 +144,10 @@ interface UpdateKycAlertRequest {
|
|
|
132
144
|
*
|
|
133
145
|
* - `enabled=false` → event blocked.
|
|
134
146
|
* - `enabled=true`, `threshold=0` (or null/omitted) → every event of this
|
|
135
|
-
* type triggers
|
|
147
|
+
* type triggers Event-Based Face Verification, regardless of amount.
|
|
136
148
|
* - `enabled=true`, `threshold>0` → only amounts `>= threshold` trigger.
|
|
137
149
|
*/
|
|
138
|
-
interface
|
|
150
|
+
interface EventBasedFaceVerificationThresholdTrigger {
|
|
139
151
|
enabled: boolean;
|
|
140
152
|
/** USD threshold; 0 / null / omitted means "any amount". */
|
|
141
153
|
threshold: number;
|
|
@@ -148,15 +160,15 @@ interface ReuseKycThresholdTrigger {
|
|
|
148
160
|
* `event_window_minutes <= window_minutes`. Either bound of 0 means
|
|
149
161
|
* "don't enforce that bound".
|
|
150
162
|
*/
|
|
151
|
-
interface
|
|
163
|
+
interface EventBasedFaceVerificationFrequencyTrigger {
|
|
152
164
|
enabled: boolean;
|
|
153
165
|
/** Minimum number of events; 0 / null / omitted means "any count". */
|
|
154
166
|
count: number;
|
|
155
167
|
/** Maximum lookback window in minutes; 0 / null / omitted means "any window". */
|
|
156
168
|
window_minutes: number;
|
|
157
169
|
}
|
|
158
|
-
/** Events that can trigger
|
|
159
|
-
interface
|
|
170
|
+
/** Events that can trigger Event-Based Face Verification for a tenant. */
|
|
171
|
+
interface EventBasedFaceVerificationTriggers {
|
|
160
172
|
login: boolean;
|
|
161
173
|
password_change: boolean;
|
|
162
174
|
name_change: boolean;
|
|
@@ -165,19 +177,19 @@ interface ReuseKycTriggers {
|
|
|
165
177
|
new_device_or_location: boolean;
|
|
166
178
|
device_fingerprint_change: boolean;
|
|
167
179
|
payment_method_change: boolean;
|
|
168
|
-
deposit:
|
|
169
|
-
withdrawal:
|
|
170
|
-
large_bet_placement:
|
|
171
|
-
high_frequency_betting:
|
|
180
|
+
deposit: EventBasedFaceVerificationThresholdTrigger;
|
|
181
|
+
withdrawal: EventBasedFaceVerificationThresholdTrigger;
|
|
182
|
+
large_bet_placement: EventBasedFaceVerificationThresholdTrigger;
|
|
183
|
+
high_frequency_betting: EventBasedFaceVerificationFrequencyTrigger;
|
|
172
184
|
account_balance_transfer: boolean;
|
|
173
185
|
}
|
|
174
186
|
/**
|
|
175
|
-
* Reactions taken when a customer exhausts the
|
|
187
|
+
* Reactions taken when a customer exhausts the Event-Based Face Verification retry limit.
|
|
176
188
|
* `trigger_alert` is enforced by the server (creates a KYC alert);
|
|
177
189
|
* `enforce_logout` and `freeze_account` are forwarded to the tenant app
|
|
178
190
|
* via the callback `data` field for it to enforce.
|
|
179
191
|
*/
|
|
180
|
-
interface
|
|
192
|
+
interface EventBasedFaceVerificationReactions {
|
|
181
193
|
/** Retries after the first attempt; total submissions = this + 1. */
|
|
182
194
|
max_retry_attempts: number;
|
|
183
195
|
trigger_alert: boolean;
|
|
@@ -193,7 +205,7 @@ interface KycPreferences {
|
|
|
193
205
|
is_face_verification_required: boolean;
|
|
194
206
|
is_address_verification_required: boolean;
|
|
195
207
|
is_age_verification_required: boolean;
|
|
196
|
-
/** Master switch for the
|
|
208
|
+
/** Master switch for the Event-Based Face Verification feature. */
|
|
197
209
|
is_reuse_kyc_enabled?: boolean;
|
|
198
210
|
min_age: number;
|
|
199
211
|
max_age: number;
|
|
@@ -202,10 +214,10 @@ interface KycPreferences {
|
|
|
202
214
|
high_risk_score: number;
|
|
203
215
|
medium_risk_score: number;
|
|
204
216
|
supported_document_types: SupportedDocumentType[];
|
|
205
|
-
/** Per-event triggers for
|
|
206
|
-
reuse_kyc_triggers?:
|
|
207
|
-
/** Retry / reaction policy for
|
|
208
|
-
reuse_kyc_reactions?:
|
|
217
|
+
/** Per-event triggers for Event-Based Face Verification. */
|
|
218
|
+
reuse_kyc_triggers?: EventBasedFaceVerificationTriggers;
|
|
219
|
+
/** Retry / reaction policy for Event-Based Face Verification. */
|
|
220
|
+
reuse_kyc_reactions?: EventBasedFaceVerificationReactions;
|
|
209
221
|
created_at: string;
|
|
210
222
|
updated_at: string;
|
|
211
223
|
}
|
|
@@ -224,9 +236,9 @@ interface UpdateKycPreferencesRequest {
|
|
|
224
236
|
medium_risk_score?: number;
|
|
225
237
|
supported_document_types?: SupportedDocumentType[];
|
|
226
238
|
/** Partial update — only the events present here are changed. */
|
|
227
|
-
reuse_kyc_triggers?: Partial<
|
|
239
|
+
reuse_kyc_triggers?: Partial<EventBasedFaceVerificationTriggers>;
|
|
228
240
|
/** Partial update — only the keys present here are changed. */
|
|
229
|
-
reuse_kyc_reactions?: Partial<
|
|
241
|
+
reuse_kyc_reactions?: Partial<EventBasedFaceVerificationReactions>;
|
|
230
242
|
}
|
|
231
243
|
interface Name {
|
|
232
244
|
first_name?: string;
|
|
@@ -310,25 +322,25 @@ interface RequestKycSubmitLinkRequest {
|
|
|
310
322
|
trigger_event?: string;
|
|
311
323
|
}
|
|
312
324
|
/**
|
|
313
|
-
* Trigger events that can request
|
|
325
|
+
* Trigger events that can request Event-Based Face Verification.
|
|
314
326
|
*
|
|
315
327
|
* Account-sensitive: any sensitive change to the account profile.
|
|
316
328
|
* Transaction events: covered by the per-event rules in
|
|
317
|
-
* `
|
|
329
|
+
* `EventBasedFaceVerificationTriggers` (`deposit`, `withdrawal`, `large_bet_placement`,
|
|
318
330
|
* `high_frequency_betting`, `account_balance_transfer`).
|
|
319
331
|
*/
|
|
320
|
-
type
|
|
321
|
-
interface
|
|
332
|
+
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';
|
|
333
|
+
interface CreateEventBasedFaceVerificationSessionRequest {
|
|
322
334
|
/** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
|
|
323
335
|
reference: string;
|
|
324
336
|
/** Customer ID to associate with the KYC session */
|
|
325
337
|
customer_id: string;
|
|
326
338
|
/**
|
|
327
|
-
* The triggering event. One of the `
|
|
339
|
+
* The triggering event. One of the `EventBasedFaceVerificationEvent` union members.
|
|
328
340
|
* Required — when empty, the server falls through to the unknown-event
|
|
329
341
|
* passthrough and allows the request silently.
|
|
330
342
|
*/
|
|
331
|
-
event:
|
|
343
|
+
event: EventBasedFaceVerificationEvent;
|
|
332
344
|
/**
|
|
333
345
|
* USD amount associated with the event. Required for threshold-gated
|
|
334
346
|
* events (`deposit`, `withdrawal`, `large_bet_placement`); ignored for
|
|
@@ -352,11 +364,11 @@ interface CreateReuseKycSessionRequest {
|
|
|
352
364
|
event_window_minutes?: number;
|
|
353
365
|
/** URL to redirect user after validate the facial submission (optional) */
|
|
354
366
|
redirect_url?: string;
|
|
355
|
-
/** URL to receive callback notifications via POST request when
|
|
367
|
+
/** URL to receive callback notifications via POST request when Event-Based Face Verification status changes (optional) */
|
|
356
368
|
callback_url?: string;
|
|
357
369
|
}
|
|
358
|
-
interface
|
|
359
|
-
/**
|
|
370
|
+
interface SubmitEventBasedFaceVerificationSessionRequest {
|
|
371
|
+
/** Event-Based Face Verification session token generated from createEventBasedFaceVerificationSession */
|
|
360
372
|
token: string;
|
|
361
373
|
/** Base64 encoded face image or selfie for verification */
|
|
362
374
|
proof: string;
|
|
@@ -370,14 +382,14 @@ interface RequestKycSubmitLinkResponse {
|
|
|
370
382
|
kyc_id: string;
|
|
371
383
|
}
|
|
372
384
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
373
|
-
type
|
|
374
|
-
interface
|
|
375
|
-
/**
|
|
385
|
+
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
386
|
+
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
387
|
+
/** Event-Based Face Verification session reference (echo of the request reference) */
|
|
376
388
|
reference: string;
|
|
377
|
-
/** Generated
|
|
389
|
+
/** Generated Event-Based Face Verification session token, valid 10 minutes */
|
|
378
390
|
token: string;
|
|
379
391
|
/**
|
|
380
|
-
* Empty string when
|
|
392
|
+
* Empty string when Event-Based Face Verification is required. When `is_required` is
|
|
381
393
|
* false, this contains the human-readable reason (e.g. feature
|
|
382
394
|
* disabled, threshold not met, customer has no prior KYC).
|
|
383
395
|
*/
|
|
@@ -406,7 +418,7 @@ interface CreateReuseKycSessionResponse {
|
|
|
406
418
|
* or freeze the account. Reaction flags are only populated when
|
|
407
419
|
* `retry_limit_exceeded` is true.
|
|
408
420
|
*/
|
|
409
|
-
interface
|
|
421
|
+
interface EventBasedFaceVerificationReactionResult {
|
|
410
422
|
/** Submissions the customer still has before the retry limit fires. */
|
|
411
423
|
retries_remaining: number;
|
|
412
424
|
/** True once the latest failed attempt exhausts the retry policy. */
|
|
@@ -414,27 +426,37 @@ interface ReuseKycReactionResult {
|
|
|
414
426
|
trigger_alert: boolean;
|
|
415
427
|
enforce_logout: boolean;
|
|
416
428
|
freeze_account: boolean;
|
|
429
|
+
/** Tenant app should block the action/account when true. */
|
|
430
|
+
block: boolean;
|
|
417
431
|
freeze_duration_minutes: number;
|
|
418
432
|
/** Set when an alert was raised on the dashboard. */
|
|
419
433
|
alert_id?: string;
|
|
420
434
|
}
|
|
421
435
|
/**
|
|
422
|
-
* Shape of the webhook body POSTed to `callback_url` after a
|
|
436
|
+
* Shape of the webhook body POSTed to `callback_url` after a Event-Based Face Verification
|
|
423
437
|
* submission completes (also returned synchronously from
|
|
424
|
-
* `
|
|
438
|
+
* `submitEventBasedFaceVerificationSession`).
|
|
425
439
|
*/
|
|
426
|
-
interface
|
|
440
|
+
interface EventBasedFaceVerificationCallback {
|
|
427
441
|
event: 'reuse_kyc';
|
|
428
442
|
reference: string;
|
|
429
443
|
resource_id: string;
|
|
430
444
|
status: KycStatus;
|
|
445
|
+
/**
|
|
446
|
+
* True when the tenant app should block the action/account. Mirrors the
|
|
447
|
+
* `block` reaction on {@link data} at the top level of the callback so
|
|
448
|
+
* consumers can branch without inspecting `data`. Omitted when false.
|
|
449
|
+
*/
|
|
450
|
+
block?: boolean;
|
|
451
|
+
/** Names the event/verification that triggered the block. Omitted when not blocked. */
|
|
452
|
+
block_reason?: string;
|
|
431
453
|
/** Structured decline reasons. */
|
|
432
454
|
declined_reasons?: Reason[];
|
|
433
455
|
/** @deprecated Use {@link declined_reasons}. */
|
|
434
456
|
declined_reason?: string;
|
|
435
457
|
/** @deprecated Use structured reasons. */
|
|
436
458
|
warnings?: Record<string, Record<string, string>>;
|
|
437
|
-
data:
|
|
459
|
+
data: EventBasedFaceVerificationReactionResult;
|
|
438
460
|
}
|
|
439
461
|
/**
|
|
440
462
|
* Server-side handoff session backed by Redis (TTL: 15 minutes). Shared
|
|
@@ -450,7 +472,7 @@ interface KycHandoffSession {
|
|
|
450
472
|
face: string;
|
|
451
473
|
/** True after a mobile device hits PUT /api/v1/kyc/session/connect. */
|
|
452
474
|
mobile_connected: boolean;
|
|
453
|
-
/** True after the (normal-KYC) document submission completes; unused for
|
|
475
|
+
/** True after the (normal-KYC) document submission completes; unused for Event-Based Face Verification. */
|
|
454
476
|
is_submitted: boolean;
|
|
455
477
|
}
|
|
456
478
|
interface CheckKycStatusRequest {
|
|
@@ -671,7 +693,7 @@ declare class KycClient extends BaseClient {
|
|
|
671
693
|
*/
|
|
672
694
|
requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
|
|
673
695
|
/**
|
|
674
|
-
* Create a
|
|
696
|
+
* Create a Event-Based Face Verification session.
|
|
675
697
|
*
|
|
676
698
|
* Inspect the response before showing UI:
|
|
677
699
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -681,35 +703,39 @@ declare class KycClient extends BaseClient {
|
|
|
681
703
|
*
|
|
682
704
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
683
705
|
*/
|
|
684
|
-
|
|
706
|
+
createEventBasedFaceVerificationSession(request: CreateEventBasedFaceVerificationSessionRequest): Promise<CreateEventBasedFaceVerificationSessionResponse>;
|
|
685
707
|
/**
|
|
686
|
-
* Submit a real-time face capture for an active
|
|
708
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
687
709
|
*
|
|
688
710
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
689
711
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
690
|
-
* QR handoff from `
|
|
712
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
691
713
|
*
|
|
692
714
|
* The `data` field on the response carries `retries_remaining`,
|
|
693
715
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
694
716
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
695
717
|
*
|
|
696
|
-
* @param request - Token from `
|
|
718
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
697
719
|
*/
|
|
698
|
-
|
|
720
|
+
submitEventBasedFaceVerificationSession(request: SubmitEventBasedFaceVerificationSessionRequest): Promise<EventBasedFaceVerificationCallback>;
|
|
699
721
|
/**
|
|
700
|
-
* Look up the current state of a
|
|
701
|
-
*
|
|
722
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
723
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
724
|
+
*
|
|
725
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
726
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
727
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
702
728
|
*
|
|
703
|
-
* @param
|
|
729
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
704
730
|
*/
|
|
705
|
-
|
|
731
|
+
getEventBasedFaceVerificationSessionStatus(token: string): Promise<EventBasedFaceVerificationCallback>;
|
|
706
732
|
/**
|
|
707
733
|
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
708
734
|
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
709
735
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
710
736
|
* scanned the QR and attached.
|
|
711
737
|
*
|
|
712
|
-
* @param token - The session token returned by `
|
|
738
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
713
739
|
*/
|
|
714
740
|
getHandoffSession(token: string): Promise<KycHandoffSession>;
|
|
715
741
|
/**
|
|
@@ -1043,4 +1069,4 @@ declare class KycClient extends BaseClient {
|
|
|
1043
1069
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1044
1070
|
}
|
|
1045
1071
|
|
|
1046
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type
|
|
1072
|
+
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 };
|