vesant-sdk 1.7.1-dev.301c6df → 1.7.1-dev.30e7557
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 +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 +1 -1
- package/dist/kyc/core.d.ts +1 -1
- 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 +122 -16
- package/dist/kyc/index.d.ts +122 -16
- 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.js +22 -16
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +22 -16
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/kyc/index.d.mts
CHANGED
|
@@ -11,7 +11,11 @@ import { B as BaseClient, R as RequestOptions } from '../client-q9fN8Hhf.mjs';
|
|
|
11
11
|
* - services/kyc-service/internal/handler/
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
type KycStatus =
|
|
14
|
+
type KycStatus =
|
|
15
|
+
/** Submit link issued but the customer has not submitted documents yet — not "in progress". */
|
|
16
|
+
'awaiting_kyc'
|
|
17
|
+
/** Documents submitted, verification in progress. */
|
|
18
|
+
| 'pending' | 'accepted' | 'declined' | 'review.pending' | 'unknown';
|
|
15
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';
|
|
16
20
|
declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
|
|
17
21
|
type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
|
|
@@ -311,6 +315,48 @@ interface UpdateKycStatusRequest {
|
|
|
311
315
|
/** Shufti warnings data */
|
|
312
316
|
warnings?: Record<string, Record<string, string>>;
|
|
313
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
320
|
+
* the tenant's KYC verification trigger preferences, except `manual` (always
|
|
321
|
+
* required) and `login` (only for an expired identity document).
|
|
322
|
+
*/
|
|
323
|
+
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
324
|
+
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
325
|
+
| 'withdrawal' | 'purchase' | 'manual'
|
|
326
|
+
/**
|
|
327
|
+
* The customer is signing in. Answers for any state: never verified (asked,
|
|
328
|
+
* not skippable, per the tenant's onboarding policy), document expired
|
|
329
|
+
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
330
|
+
* (not asked). One call covers every customer.
|
|
331
|
+
*/
|
|
332
|
+
| 'login';
|
|
333
|
+
/**
|
|
334
|
+
* Why verification is — or is not — being asked for. Codes are stable;
|
|
335
|
+
* `message` is display-ready text you can show the customer as-is.
|
|
336
|
+
*/
|
|
337
|
+
interface KycRequestReason {
|
|
338
|
+
code: KycRequestReasonCode | (string & Record<string, never>);
|
|
339
|
+
message: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Reason codes returned by `requestKycSubmitLink`. Treat unrecognised codes
|
|
343
|
+
* as "verification required" and fall back to `message` for display.
|
|
344
|
+
*/
|
|
345
|
+
type KycRequestReasonCode =
|
|
346
|
+
/** Required to complete registration. */
|
|
347
|
+
'KYC_REQUIRED_ONBOARDING'
|
|
348
|
+
/** Required before the customer's first withdrawal. */
|
|
349
|
+
| 'KYC_REQUIRED_FIRST_WITHDRAWAL'
|
|
350
|
+
/** Required before the customer's first purchase. */
|
|
351
|
+
| 'KYC_REQUIRED_FIRST_PURCHASE'
|
|
352
|
+
/** The customer's identity document has expired and must be re-verified. */
|
|
353
|
+
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
354
|
+
/** Verification was explicitly requested by the tenant. */
|
|
355
|
+
| 'KYC_REQUIRED_MANUAL'
|
|
356
|
+
/** Not required — the customer already has an accepted verification. */
|
|
357
|
+
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
358
|
+
/** Not required — the tenant has this trigger event switched off. */
|
|
359
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
|
|
314
360
|
interface RequestKycSubmitLinkRequest {
|
|
315
361
|
/** User ID to generate KYC submission link for */
|
|
316
362
|
user_id: string;
|
|
@@ -319,14 +365,20 @@ interface RequestKycSubmitLinkRequest {
|
|
|
319
365
|
/** URL to receive callback notifications via POST request when KYC status changes (optional) */
|
|
320
366
|
callback_url?: string;
|
|
321
367
|
/**
|
|
322
|
-
* Event that triggered the KYC request.
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
368
|
+
* Event that triggered the KYC request. The tenant's KYC verification
|
|
369
|
+
* trigger preferences decide, per event, whether KYC is required
|
|
370
|
+
* (`kyc_required` in the response). "manual" always requires KYC and
|
|
371
|
+
* honors the tenant's allow-skip-on-manual option (`can_skip`). "login"
|
|
372
|
+
* answers for any customer state — never verified (asked, not skippable),
|
|
373
|
+
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
374
|
+
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
375
|
+
* needs only this one call at sign-in. The same expired document is *not*
|
|
376
|
+
* skippable on withdrawal / purchase events: it is enforced on
|
|
377
|
+
* "first_withdrawal", "withdrawal", "first_purchase" and "purchase" alike,
|
|
378
|
+
* so keep sending whichever of those you already send.
|
|
327
379
|
* Omitted or unknown values default to KYC required with no skip.
|
|
328
380
|
*/
|
|
329
|
-
trigger_event?: string;
|
|
381
|
+
trigger_event?: KycTriggerEvent | (string & Record<string, never>);
|
|
330
382
|
/**
|
|
331
383
|
* Registered customer identity data (optional). Seeds the customer's risk
|
|
332
384
|
* profile so document verification can cross-check the submitted document
|
|
@@ -438,12 +490,57 @@ interface RequestKycSubmitLinkResponse {
|
|
|
438
490
|
*/
|
|
439
491
|
kyc_required: boolean;
|
|
440
492
|
/**
|
|
441
|
-
* Whether the user may skip verification.
|
|
493
|
+
* Whether the user may skip verification. `true` for
|
|
442
494
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
443
|
-
*
|
|
495
|
+
* for `"login"` when an expired identity document triggered the request
|
|
496
|
+
* (offer "Remind me later"), and when the customer is already verified.
|
|
497
|
+
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
498
|
+
* postponed re-verification becomes mandatory.
|
|
444
499
|
*/
|
|
445
500
|
can_skip: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Why verification is — or is not — being asked for. Use `reason.code` to
|
|
503
|
+
* branch (for example `KYC_REQUIRED_ID_EXPIRED` warrants a different prompt
|
|
504
|
+
* than a first-time verification) and `reason.message` for display.
|
|
505
|
+
*/
|
|
506
|
+
reason?: KycRequestReason;
|
|
446
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Body POSTed to your `callback_url` when a customer's identity document
|
|
510
|
+
* passes its expiry date. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
511
|
+
* (HMAC-SHA256 of the raw body), like every other Vesant callback.
|
|
512
|
+
*
|
|
513
|
+
* An expiry happens on a **date**, not on a customer action, so this webhook
|
|
514
|
+
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
515
|
+
* once per customer, when the document first becomes expired.
|
|
516
|
+
*
|
|
517
|
+
* It is sent regardless of the tenant's auto-trigger-on-ID-expiration setting:
|
|
518
|
+
* that setting governs whether verification is *enforced*, not whether you are
|
|
519
|
+
* *told*.
|
|
520
|
+
*/
|
|
521
|
+
interface KycDocumentExpiredCallbackEvent {
|
|
522
|
+
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
523
|
+
event: 'kyc_document_expired';
|
|
524
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
525
|
+
reference: string;
|
|
526
|
+
/** The customer's risk-profile ID. */
|
|
527
|
+
resource_id: string;
|
|
528
|
+
/**
|
|
529
|
+
* Always `"expired"`. Describes the document — not the customer's KYC
|
|
530
|
+
* status, which remains `accepted` until they re-verify.
|
|
531
|
+
*/
|
|
532
|
+
status: 'expired';
|
|
533
|
+
data: {
|
|
534
|
+
customer_id: string;
|
|
535
|
+
/** The document's expiry date (ISO 8601 `YYYY-MM-DD`). */
|
|
536
|
+
id_expiry_date: string;
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Type guard for the identity-document expiry webhook. Narrows an already
|
|
541
|
+
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
542
|
+
*/
|
|
543
|
+
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
447
544
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
448
545
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
449
546
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -539,17 +636,22 @@ interface KycHandoffSession {
|
|
|
539
636
|
is_submitted: boolean;
|
|
540
637
|
}
|
|
541
638
|
interface CheckKycStatusRequest {
|
|
542
|
-
/**
|
|
639
|
+
/** Customer identifier. Sent for context only — the lookup is by kyc_id. */
|
|
543
640
|
user_id: string;
|
|
544
|
-
/**
|
|
641
|
+
/** The KYC request ID returned by requestKycSubmitLink; drives the status lookup. */
|
|
545
642
|
kyc_id: string;
|
|
546
643
|
}
|
|
547
644
|
/**
|
|
548
645
|
* Response from checkKycStatus. Always returns the same shape.
|
|
549
646
|
*
|
|
550
|
-
* `additional_data` is `null` when `status
|
|
551
|
-
*
|
|
552
|
-
*
|
|
647
|
+
* `additional_data` is `null` when `status` is `'awaiting_kyc'` or `'pending'`.
|
|
648
|
+
* Otherwise it contains the full KYC record including document details,
|
|
649
|
+
* proofs, and the customer's risk profile.
|
|
650
|
+
*
|
|
651
|
+
* `status === 'awaiting_kyc'` means the submit link was issued but the
|
|
652
|
+
* customer has not submitted documents — treat it as "not started", never as
|
|
653
|
+
* "in progress". Check `link_expired`: `false` → re-surface the existing
|
|
654
|
+
* link; `true` → request a fresh one via `requestKycSubmitLink`.
|
|
553
655
|
*/
|
|
554
656
|
interface CheckKycStatusResponse {
|
|
555
657
|
id: string;
|
|
@@ -578,8 +680,12 @@ interface CheckKycStatusResponse {
|
|
|
578
680
|
is_address_verification_required: boolean;
|
|
579
681
|
is_age_verification_required: boolean;
|
|
580
682
|
created_at: string;
|
|
581
|
-
/** Full KYC record with document details, proofs, and risk profile. Null when status is 'pending'. */
|
|
683
|
+
/** Full KYC record with document details, proofs, and risk profile. Null when status is 'awaiting_kyc' or 'pending'. */
|
|
582
684
|
additional_data: KycRequest | null;
|
|
685
|
+
/** Present when status is 'awaiting_kyc': whether the submit link has expired (request a new one when true). */
|
|
686
|
+
link_expired?: boolean;
|
|
687
|
+
/** Present when status is 'awaiting_kyc': the submit link's expiry time (RFC 3339). */
|
|
688
|
+
link_expires_at?: string;
|
|
583
689
|
}
|
|
584
690
|
interface RequestAdditionalDocumentsRequest {
|
|
585
691
|
/** KYC request ID */
|
|
@@ -1146,4 +1252,4 @@ declare class KycClient extends BaseClient {
|
|
|
1146
1252
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1147
1253
|
}
|
|
1148
1254
|
|
|
1149
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type 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 };
|
|
1255
|
+
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycStatus, type KycTriggerEvent, 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, isKycDocumentExpiredCallbackEvent };
|
package/dist/kyc/index.d.ts
CHANGED
|
@@ -11,7 +11,11 @@ import { B as BaseClient, R as RequestOptions } from '../client-q9fN8Hhf.js';
|
|
|
11
11
|
* - services/kyc-service/internal/handler/
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
type KycStatus =
|
|
14
|
+
type KycStatus =
|
|
15
|
+
/** Submit link issued but the customer has not submitted documents yet — not "in progress". */
|
|
16
|
+
'awaiting_kyc'
|
|
17
|
+
/** Documents submitted, verification in progress. */
|
|
18
|
+
| 'pending' | 'accepted' | 'declined' | 'review.pending' | 'unknown';
|
|
15
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';
|
|
16
20
|
declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
|
|
17
21
|
type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
|
|
@@ -311,6 +315,48 @@ interface UpdateKycStatusRequest {
|
|
|
311
315
|
/** Shufti warnings data */
|
|
312
316
|
warnings?: Record<string, Record<string, string>>;
|
|
313
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Events that can trigger a KYC request. Each maps to a per-event toggle in
|
|
320
|
+
* the tenant's KYC verification trigger preferences, except `manual` (always
|
|
321
|
+
* required) and `login` (only for an expired identity document).
|
|
322
|
+
*/
|
|
323
|
+
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase'
|
|
324
|
+
/** Aliases of `first_withdrawal` / `first_purchase` — same tenant toggles. */
|
|
325
|
+
| 'withdrawal' | 'purchase' | 'manual'
|
|
326
|
+
/**
|
|
327
|
+
* The customer is signing in. Answers for any state: never verified (asked,
|
|
328
|
+
* not skippable, per the tenant's onboarding policy), document expired
|
|
329
|
+
* (asked, skippable — "Remind me later"), or verified with a valid document
|
|
330
|
+
* (not asked). One call covers every customer.
|
|
331
|
+
*/
|
|
332
|
+
| 'login';
|
|
333
|
+
/**
|
|
334
|
+
* Why verification is — or is not — being asked for. Codes are stable;
|
|
335
|
+
* `message` is display-ready text you can show the customer as-is.
|
|
336
|
+
*/
|
|
337
|
+
interface KycRequestReason {
|
|
338
|
+
code: KycRequestReasonCode | (string & Record<string, never>);
|
|
339
|
+
message: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Reason codes returned by `requestKycSubmitLink`. Treat unrecognised codes
|
|
343
|
+
* as "verification required" and fall back to `message` for display.
|
|
344
|
+
*/
|
|
345
|
+
type KycRequestReasonCode =
|
|
346
|
+
/** Required to complete registration. */
|
|
347
|
+
'KYC_REQUIRED_ONBOARDING'
|
|
348
|
+
/** Required before the customer's first withdrawal. */
|
|
349
|
+
| 'KYC_REQUIRED_FIRST_WITHDRAWAL'
|
|
350
|
+
/** Required before the customer's first purchase. */
|
|
351
|
+
| 'KYC_REQUIRED_FIRST_PURCHASE'
|
|
352
|
+
/** The customer's identity document has expired and must be re-verified. */
|
|
353
|
+
| 'KYC_REQUIRED_ID_EXPIRED'
|
|
354
|
+
/** Verification was explicitly requested by the tenant. */
|
|
355
|
+
| 'KYC_REQUIRED_MANUAL'
|
|
356
|
+
/** Not required — the customer already has an accepted verification. */
|
|
357
|
+
| 'KYC_NOT_REQUIRED_ALREADY_VERIFIED'
|
|
358
|
+
/** Not required — the tenant has this trigger event switched off. */
|
|
359
|
+
| 'KYC_NOT_REQUIRED_TRIGGER_DISABLED';
|
|
314
360
|
interface RequestKycSubmitLinkRequest {
|
|
315
361
|
/** User ID to generate KYC submission link for */
|
|
316
362
|
user_id: string;
|
|
@@ -319,14 +365,20 @@ interface RequestKycSubmitLinkRequest {
|
|
|
319
365
|
/** URL to receive callback notifications via POST request when KYC status changes (optional) */
|
|
320
366
|
callback_url?: string;
|
|
321
367
|
/**
|
|
322
|
-
* Event that triggered the KYC request.
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
368
|
+
* Event that triggered the KYC request. The tenant's KYC verification
|
|
369
|
+
* trigger preferences decide, per event, whether KYC is required
|
|
370
|
+
* (`kyc_required` in the response). "manual" always requires KYC and
|
|
371
|
+
* honors the tenant's allow-skip-on-manual option (`can_skip`). "login"
|
|
372
|
+
* answers for any customer state — never verified (asked, not skippable),
|
|
373
|
+
* document expired (asked, skippable so you can offer "Remind me later"),
|
|
374
|
+
* or verified and valid (not asked) — so a platform that gates entry on KYC
|
|
375
|
+
* needs only this one call at sign-in. The same expired document is *not*
|
|
376
|
+
* skippable on withdrawal / purchase events: it is enforced on
|
|
377
|
+
* "first_withdrawal", "withdrawal", "first_purchase" and "purchase" alike,
|
|
378
|
+
* so keep sending whichever of those you already send.
|
|
327
379
|
* Omitted or unknown values default to KYC required with no skip.
|
|
328
380
|
*/
|
|
329
|
-
trigger_event?: string;
|
|
381
|
+
trigger_event?: KycTriggerEvent | (string & Record<string, never>);
|
|
330
382
|
/**
|
|
331
383
|
* Registered customer identity data (optional). Seeds the customer's risk
|
|
332
384
|
* profile so document verification can cross-check the submitted document
|
|
@@ -438,12 +490,57 @@ interface RequestKycSubmitLinkResponse {
|
|
|
438
490
|
*/
|
|
439
491
|
kyc_required: boolean;
|
|
440
492
|
/**
|
|
441
|
-
* Whether the user may skip verification.
|
|
493
|
+
* Whether the user may skip verification. `true` for
|
|
442
494
|
* `trigger_event: "manual"` when the tenant enables allow-skip-on-manual,
|
|
443
|
-
*
|
|
495
|
+
* for `"login"` when an expired identity document triggered the request
|
|
496
|
+
* (offer "Remind me later"), and when the customer is already verified.
|
|
497
|
+
* Always `false` at `"withdrawal"` / `"purchase"` — that is where a
|
|
498
|
+
* postponed re-verification becomes mandatory.
|
|
444
499
|
*/
|
|
445
500
|
can_skip: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Why verification is — or is not — being asked for. Use `reason.code` to
|
|
503
|
+
* branch (for example `KYC_REQUIRED_ID_EXPIRED` warrants a different prompt
|
|
504
|
+
* than a first-time verification) and `reason.message` for display.
|
|
505
|
+
*/
|
|
506
|
+
reason?: KycRequestReason;
|
|
446
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Body POSTed to your `callback_url` when a customer's identity document
|
|
510
|
+
* passes its expiry date. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
511
|
+
* (HMAC-SHA256 of the raw body), like every other Vesant callback.
|
|
512
|
+
*
|
|
513
|
+
* An expiry happens on a **date**, not on a customer action, so this webhook
|
|
514
|
+
* is the only signal for it — nothing the customer does triggers it. Delivered
|
|
515
|
+
* once per customer, when the document first becomes expired.
|
|
516
|
+
*
|
|
517
|
+
* It is sent regardless of the tenant's auto-trigger-on-ID-expiration setting:
|
|
518
|
+
* that setting governs whether verification is *enforced*, not whether you are
|
|
519
|
+
* *told*.
|
|
520
|
+
*/
|
|
521
|
+
interface KycDocumentExpiredCallbackEvent {
|
|
522
|
+
/** Always `"kyc_document_expired"` — dispatch on this. */
|
|
523
|
+
event: 'kyc_document_expired';
|
|
524
|
+
/** Your customer identifier (the `user_id` you supplied). */
|
|
525
|
+
reference: string;
|
|
526
|
+
/** The customer's risk-profile ID. */
|
|
527
|
+
resource_id: string;
|
|
528
|
+
/**
|
|
529
|
+
* Always `"expired"`. Describes the document — not the customer's KYC
|
|
530
|
+
* status, which remains `accepted` until they re-verify.
|
|
531
|
+
*/
|
|
532
|
+
status: 'expired';
|
|
533
|
+
data: {
|
|
534
|
+
customer_id: string;
|
|
535
|
+
/** The document's expiry date (ISO 8601 `YYYY-MM-DD`). */
|
|
536
|
+
id_expiry_date: string;
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Type guard for the identity-document expiry webhook. Narrows an already
|
|
541
|
+
* signature-verified, parsed payload to {@link KycDocumentExpiredCallbackEvent}.
|
|
542
|
+
*/
|
|
543
|
+
declare function isKycDocumentExpiredCallbackEvent(value: unknown): value is KycDocumentExpiredCallbackEvent;
|
|
447
544
|
/** Device class detected by the SDK (purely client-side — server doesn't care). */
|
|
448
545
|
type EventBasedFaceVerificationDeviceType = 'mobile' | 'desktop';
|
|
449
546
|
interface CreateEventBasedFaceVerificationSessionResponse {
|
|
@@ -539,17 +636,22 @@ interface KycHandoffSession {
|
|
|
539
636
|
is_submitted: boolean;
|
|
540
637
|
}
|
|
541
638
|
interface CheckKycStatusRequest {
|
|
542
|
-
/**
|
|
639
|
+
/** Customer identifier. Sent for context only — the lookup is by kyc_id. */
|
|
543
640
|
user_id: string;
|
|
544
|
-
/**
|
|
641
|
+
/** The KYC request ID returned by requestKycSubmitLink; drives the status lookup. */
|
|
545
642
|
kyc_id: string;
|
|
546
643
|
}
|
|
547
644
|
/**
|
|
548
645
|
* Response from checkKycStatus. Always returns the same shape.
|
|
549
646
|
*
|
|
550
|
-
* `additional_data` is `null` when `status
|
|
551
|
-
*
|
|
552
|
-
*
|
|
647
|
+
* `additional_data` is `null` when `status` is `'awaiting_kyc'` or `'pending'`.
|
|
648
|
+
* Otherwise it contains the full KYC record including document details,
|
|
649
|
+
* proofs, and the customer's risk profile.
|
|
650
|
+
*
|
|
651
|
+
* `status === 'awaiting_kyc'` means the submit link was issued but the
|
|
652
|
+
* customer has not submitted documents — treat it as "not started", never as
|
|
653
|
+
* "in progress". Check `link_expired`: `false` → re-surface the existing
|
|
654
|
+
* link; `true` → request a fresh one via `requestKycSubmitLink`.
|
|
553
655
|
*/
|
|
554
656
|
interface CheckKycStatusResponse {
|
|
555
657
|
id: string;
|
|
@@ -578,8 +680,12 @@ interface CheckKycStatusResponse {
|
|
|
578
680
|
is_address_verification_required: boolean;
|
|
579
681
|
is_age_verification_required: boolean;
|
|
580
682
|
created_at: string;
|
|
581
|
-
/** Full KYC record with document details, proofs, and risk profile. Null when status is 'pending'. */
|
|
683
|
+
/** Full KYC record with document details, proofs, and risk profile. Null when status is 'awaiting_kyc' or 'pending'. */
|
|
582
684
|
additional_data: KycRequest | null;
|
|
685
|
+
/** Present when status is 'awaiting_kyc': whether the submit link has expired (request a new one when true). */
|
|
686
|
+
link_expired?: boolean;
|
|
687
|
+
/** Present when status is 'awaiting_kyc': the submit link's expiry time (RFC 3339). */
|
|
688
|
+
link_expires_at?: string;
|
|
583
689
|
}
|
|
584
690
|
interface RequestAdditionalDocumentsRequest {
|
|
585
691
|
/** KYC request ID */
|
|
@@ -1146,4 +1252,4 @@ declare class KycClient extends BaseClient {
|
|
|
1146
1252
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
1147
1253
|
}
|
|
1148
1254
|
|
|
1149
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type 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 };
|
|
1255
|
+
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateEventBasedFaceVerificationSessionRequest, type CreateEventBasedFaceVerificationSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type EventBasedFaceVerificationCallback, type EventBasedFaceVerificationDeviceType, type EventBasedFaceVerificationEvent, type EventBasedFaceVerificationFrequencyTrigger, type EventBasedFaceVerificationReactionResult, type EventBasedFaceVerificationReactions, type EventBasedFaceVerificationThresholdTrigger, type EventBasedFaceVerificationTriggers, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerData, type KycCustomerProfile, type KycDeclinedCode, type KycDocumentExpiredCallbackEvent, type KycHandoffSession, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycRequestReason, type KycRequestReasonCode, type KycStatus, type KycTriggerEvent, 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, isKycDocumentExpiredCallbackEvent };
|
package/dist/kyc/index.js
CHANGED
|
@@ -1267,8 +1267,12 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
1267
1267
|
KYC_PROVIDER_REJECTED: "Identity verification was rejected by the verification provider",
|
|
1268
1268
|
KYC_DECLINED: "Identity verification was declined"
|
|
1269
1269
|
};
|
|
1270
|
+
function isKycDocumentExpiredCallbackEvent(value) {
|
|
1271
|
+
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
1272
|
+
}
|
|
1270
1273
|
|
|
1271
1274
|
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1272
1275
|
exports.KycClient = KycClient;
|
|
1276
|
+
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
1273
1277
|
//# sourceMappingURL=index.js.map
|
|
1274
1278
|
//# sourceMappingURL=index.js.map
|