vesant-sdk 1.7.0-dev.e0ee6d5 → 1.7.0-dev.e1da577
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-ZNdnpWe7.d.mts → client-B0qhE2kr.d.mts} +1 -1
- package/dist/{client-DoMSYMMR.d.ts → client-DF7hlMEz.d.ts} +13 -0
- package/dist/{client-DMIRx7Tu.d.mts → client-DrjgZoH_.d.mts} +13 -0
- package/dist/{client-C3DCmGe9.d.ts → client-DtH2RLuy.d.ts} +1 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +0 -3
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +0 -3
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +40 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -22
- 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 +36 -18
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +36 -18
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +161 -58
- package/dist/kyc/index.d.ts +161 -58
- package/dist/kyc/index.js +36 -18
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +36 -18
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +18 -14
- package/dist/react.d.ts +18 -14
- package/dist/react.js +303 -35
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +303 -35
- 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.mjs
CHANGED
|
@@ -601,7 +601,13 @@ var KycClient = class extends BaseClient {
|
|
|
601
601
|
*
|
|
602
602
|
* Generates a link that the user can visit to submit their KYC documents.
|
|
603
603
|
*
|
|
604
|
-
*
|
|
604
|
+
* Optionally pass the customer's registered identity data as
|
|
605
|
+
* `customer_data` (same shape as the geolocation `customer_data` block).
|
|
606
|
+
* It seeds the customer's risk profile so document verification can
|
|
607
|
+
* cross-check the submitted document against trusted reference data;
|
|
608
|
+
* fields never overwrite data already on the profile.
|
|
609
|
+
*
|
|
610
|
+
* @param request - Request containing the user ID, optional redirect URL, optional callback URL (receives POST requests), and optional customer identity data
|
|
605
611
|
* @returns Response containing the redirect link and KYC ID
|
|
606
612
|
*
|
|
607
613
|
* @example
|
|
@@ -609,7 +615,15 @@ var KycClient = class extends BaseClient {
|
|
|
609
615
|
* const result = await client.requestKycSubmitLink({
|
|
610
616
|
* user_id: "user_123",
|
|
611
617
|
* redirect_url: "https://merchant.com/kyc-complete", // optional
|
|
612
|
-
* callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
|
|
618
|
+
* callback_url: "https://merchant.com/api/kyc-webhook", // optional - receives POST requests on status change
|
|
619
|
+
* customer_data: { // optional - seeds the risk profile for document cross-checks
|
|
620
|
+
* full_name: "John Doe",
|
|
621
|
+
* date_of_birth: "1999-06-02", // ISO 8601
|
|
622
|
+
* email: "john@example.com",
|
|
623
|
+
* phone: "+94771234567",
|
|
624
|
+
* address: "12 Main St, Colombo", // used for address verification
|
|
625
|
+
* country: "LK"
|
|
626
|
+
* }
|
|
613
627
|
* });
|
|
614
628
|
*
|
|
615
629
|
* console.log(`Redirect user to: ${result.link}`);
|
|
@@ -624,7 +638,7 @@ var KycClient = class extends BaseClient {
|
|
|
624
638
|
});
|
|
625
639
|
}
|
|
626
640
|
/**
|
|
627
|
-
* Create a
|
|
641
|
+
* Create a Event-Based Face Verification session.
|
|
628
642
|
*
|
|
629
643
|
* Inspect the response before showing UI:
|
|
630
644
|
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
@@ -634,7 +648,7 @@ var KycClient = class extends BaseClient {
|
|
|
634
648
|
*
|
|
635
649
|
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
636
650
|
*/
|
|
637
|
-
async
|
|
651
|
+
async createEventBasedFaceVerificationSession(request) {
|
|
638
652
|
return this.request("/api/v1/kyc/face/session", {
|
|
639
653
|
method: "POST",
|
|
640
654
|
body: JSON.stringify(request),
|
|
@@ -642,19 +656,19 @@ var KycClient = class extends BaseClient {
|
|
|
642
656
|
});
|
|
643
657
|
}
|
|
644
658
|
/**
|
|
645
|
-
* Submit a real-time face capture for an active
|
|
659
|
+
* Submit a real-time face capture for an active Event-Based Face Verification session.
|
|
646
660
|
*
|
|
647
661
|
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
648
662
|
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
649
|
-
* QR handoff from `
|
|
663
|
+
* QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
|
|
650
664
|
*
|
|
651
665
|
* The `data` field on the response carries `retries_remaining`,
|
|
652
666
|
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
653
667
|
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
654
668
|
*
|
|
655
|
-
* @param request - Token from `
|
|
669
|
+
* @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
|
|
656
670
|
*/
|
|
657
|
-
async
|
|
671
|
+
async submitEventBasedFaceVerificationSession(request) {
|
|
658
672
|
return this.request("/api/v1/kyc/face/submit", {
|
|
659
673
|
method: "POST",
|
|
660
674
|
body: JSON.stringify(request),
|
|
@@ -662,13 +676,17 @@ var KycClient = class extends BaseClient {
|
|
|
662
676
|
});
|
|
663
677
|
}
|
|
664
678
|
/**
|
|
665
|
-
* Look up the current state of a
|
|
666
|
-
*
|
|
679
|
+
* Look up the current state of a Event-Based Face Verification session by its
|
|
680
|
+
* session token. Useful for desktop pollers waiting on the mobile handoff.
|
|
681
|
+
*
|
|
682
|
+
* The lookup is scoped by the unguessable, server-issued session token (not
|
|
683
|
+
* the enumerable forward reference): the endpoint is public/unauthenticated,
|
|
684
|
+
* and scoping by the token is what prevents cross-tenant status reads.
|
|
667
685
|
*
|
|
668
|
-
* @param
|
|
686
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
669
687
|
*/
|
|
670
|
-
async
|
|
671
|
-
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(
|
|
688
|
+
async getEventBasedFaceVerificationSessionStatus(token) {
|
|
689
|
+
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(token)}`, {
|
|
672
690
|
method: "GET",
|
|
673
691
|
headers: this.getUserHeaders()
|
|
674
692
|
});
|
|
@@ -679,7 +697,7 @@ var KycClient = class extends BaseClient {
|
|
|
679
697
|
* callers poll `mobile_connected` to detect when a mobile device has
|
|
680
698
|
* scanned the QR and attached.
|
|
681
699
|
*
|
|
682
|
-
* @param token - The session token returned by `
|
|
700
|
+
* @param token - The session token returned by `createEventBasedFaceVerificationSession`.
|
|
683
701
|
*/
|
|
684
702
|
async getHandoffSession(token) {
|
|
685
703
|
return this.request(
|
|
@@ -754,7 +772,7 @@ var KycClient = class extends BaseClient {
|
|
|
754
772
|
* @example
|
|
755
773
|
* ```typescript
|
|
756
774
|
* const result = await client.submitVerification({
|
|
757
|
-
* reference: "
|
|
775
|
+
* reference: "4d2aff34-ab86-422d-992e-50b1234a5b67",
|
|
758
776
|
* email: "customer@example.com",
|
|
759
777
|
* country: "US",
|
|
760
778
|
* document: {
|
|
@@ -786,7 +804,7 @@ var KycClient = class extends BaseClient {
|
|
|
786
804
|
*
|
|
787
805
|
* @example
|
|
788
806
|
* ```typescript
|
|
789
|
-
* const kyc = await client.getKycRequest("
|
|
807
|
+
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
790
808
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
791
809
|
* ```
|
|
792
810
|
*/
|
|
@@ -861,7 +879,7 @@ var KycClient = class extends BaseClient {
|
|
|
861
879
|
* @example
|
|
862
880
|
* ```typescript
|
|
863
881
|
* await client.requestAdditionalDocuments({
|
|
864
|
-
* id: "
|
|
882
|
+
* id: "550e8400-e29b-41d4-a716-446655440000",
|
|
865
883
|
* document_types: ["address", "document_two"],
|
|
866
884
|
* message: "Please provide proof of address and secondary ID"
|
|
867
885
|
* });
|
|
@@ -882,7 +900,7 @@ var KycClient = class extends BaseClient {
|
|
|
882
900
|
*
|
|
883
901
|
* @example
|
|
884
902
|
* ```typescript
|
|
885
|
-
* const proofs = await client.getProofDownloadURLs("
|
|
903
|
+
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
886
904
|
* proofs.forEach(proof => {
|
|
887
905
|
* console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
|
|
888
906
|
* });
|