vesant-sdk 2.0.0-dev.b41d336 → 2.0.0-dev.b7fc6ce
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 +54 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -10
- 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 +54 -10
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +54 -10
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +230 -19
- package/dist/kyc/index.d.ts +230 -19
- package/dist/kyc/index.js +54 -10
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +54 -10
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +37 -2
- package/dist/react.d.ts +37 -2
- package/dist/react.js +603 -272
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +603 -272
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2728,40 +2728,84 @@ var KycClient = class extends BaseClient {
|
|
|
2728
2728
|
});
|
|
2729
2729
|
}
|
|
2730
2730
|
/**
|
|
2731
|
-
* Create a
|
|
2731
|
+
* Create a Re-Use KYC session.
|
|
2732
2732
|
*
|
|
2733
|
-
*
|
|
2733
|
+
* Inspect the response before showing UI:
|
|
2734
|
+
* - `is_required === false` → skip face capture; `reason` explains why.
|
|
2735
|
+
* - `device_type === 'desktop'` → render `qr_payload` as a QR; the
|
|
2736
|
+
* mobile device picks up the session via the connect endpoint.
|
|
2737
|
+
* - `device_type === 'mobile'` → open the face capture modal directly.
|
|
2738
|
+
*
|
|
2739
|
+
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
2734
2740
|
*/
|
|
2735
2741
|
async createReuseKycSession(request) {
|
|
2736
|
-
return this.
|
|
2742
|
+
return this.request("/api/v1/kyc/face/session", {
|
|
2737
2743
|
method: "POST",
|
|
2738
2744
|
body: JSON.stringify(request),
|
|
2739
2745
|
headers: this.getUserHeaders()
|
|
2740
2746
|
});
|
|
2741
2747
|
}
|
|
2742
2748
|
/**
|
|
2743
|
-
* Submit a
|
|
2749
|
+
* Submit a real-time face capture for an active Re-Use KYC session.
|
|
2750
|
+
*
|
|
2751
|
+
* **Mobile-only.** The server rejects desktop User-Agents with HTTP
|
|
2752
|
+
* 400 (`face capture must be completed on a mobile device`). Use the
|
|
2753
|
+
* QR handoff from `createReuseKycSession` for desktop callers.
|
|
2754
|
+
*
|
|
2755
|
+
* The `data` field on the response carries `retries_remaining`,
|
|
2756
|
+
* `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
|
|
2757
|
+
* `freeze_account`, etc.) so the tenant app can act on a final failure.
|
|
2744
2758
|
*
|
|
2745
|
-
* @param request -
|
|
2759
|
+
* @param request - Token from `createReuseKycSession`, plus the base64 selfie.
|
|
2746
2760
|
*/
|
|
2747
2761
|
async submitReuseKycSession(request) {
|
|
2748
|
-
return this.
|
|
2762
|
+
return this.request("/api/v1/kyc/face/submit", {
|
|
2749
2763
|
method: "POST",
|
|
2750
2764
|
body: JSON.stringify(request),
|
|
2751
2765
|
headers: this.getUserHeaders()
|
|
2752
2766
|
});
|
|
2753
2767
|
}
|
|
2754
2768
|
/**
|
|
2755
|
-
*
|
|
2756
|
-
*
|
|
2757
|
-
*
|
|
2758
|
-
*
|
|
2769
|
+
* Look up the current state of a Re-Use KYC session by its forward
|
|
2770
|
+
* reference. Useful for desktop pollers waiting on the mobile handoff.
|
|
2771
|
+
*
|
|
2772
|
+
* @param reference - The reference used when the session was created.
|
|
2773
|
+
*/
|
|
2759
2774
|
async getReuseKycSessionStatus(reference) {
|
|
2760
2775
|
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(reference)}`, {
|
|
2761
2776
|
method: "GET",
|
|
2762
2777
|
headers: this.getUserHeaders()
|
|
2763
2778
|
});
|
|
2764
2779
|
}
|
|
2780
|
+
/**
|
|
2781
|
+
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
2782
|
+
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
2783
|
+
* callers poll `mobile_connected` to detect when a mobile device has
|
|
2784
|
+
* scanned the QR and attached.
|
|
2785
|
+
*
|
|
2786
|
+
* @param token - The session token returned by `createReuseKycSession`.
|
|
2787
|
+
*/
|
|
2788
|
+
async getHandoffSession(token) {
|
|
2789
|
+
return this.request(
|
|
2790
|
+
`/api/v1/kyc/session${this.buildQueryString({ token })}`,
|
|
2791
|
+
{ headers: this.getUserHeaders() }
|
|
2792
|
+
);
|
|
2793
|
+
}
|
|
2794
|
+
/**
|
|
2795
|
+
* Attach a mobile device to a desktop-initiated session. The mobile
|
|
2796
|
+
* client calls this after scanning the QR code. The desktop poller
|
|
2797
|
+
* sees `mobile_connected: true` on the next `getHandoffSession`.
|
|
2798
|
+
*
|
|
2799
|
+
* @param token - The session token transferred via the QR payload.
|
|
2800
|
+
* @param isDisconnect - Pass true to release the session (default false).
|
|
2801
|
+
*/
|
|
2802
|
+
async connectMobileSession(token, isDisconnect = false) {
|
|
2803
|
+
return this.request("/api/v1/kyc/session/connect", {
|
|
2804
|
+
method: "PUT",
|
|
2805
|
+
body: JSON.stringify({ token, is_disconnect: isDisconnect }),
|
|
2806
|
+
headers: this.getUserHeaders()
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2765
2809
|
/**
|
|
2766
2810
|
* Check KYC status for a user
|
|
2767
2811
|
*
|