vesant-sdk 2.0.0-dev.76771da → 2.0.0-dev.93ecc12

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.
Files changed (45) hide show
  1. package/dist/{client-CIEa7xYG.d.mts → client-BwkGrRW9.d.mts} +1 -1
  2. package/dist/{client-BJ87_Vv5.d.ts → client-CqSx0lAG.d.ts} +3 -3
  3. package/dist/{client-IAOGCBfm.d.mts → client-Dq0NMaXT.d.mts} +3 -3
  4. package/dist/{client-Bvp-f05-.d.ts → client-DvobLmsc.d.ts} +1 -1
  5. package/dist/compliance/index.d.mts +4 -4
  6. package/dist/compliance/index.d.ts +4 -4
  7. package/dist/decisions/index.d.mts +1 -1
  8. package/dist/decisions/index.d.ts +1 -1
  9. package/dist/geolocation/index.d.mts +3 -3
  10. package/dist/geolocation/index.d.ts +3 -3
  11. package/dist/index.d.mts +6 -6
  12. package/dist/index.d.ts +6 -6
  13. package/dist/index.js +54 -10
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +54 -10
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/kyc/core.d.mts +3 -3
  18. package/dist/kyc/core.d.ts +3 -3
  19. package/dist/kyc/core.js +54 -10
  20. package/dist/kyc/core.js.map +1 -1
  21. package/dist/kyc/core.mjs +54 -10
  22. package/dist/kyc/core.mjs.map +1 -1
  23. package/dist/kyc/index.d.mts +253 -21
  24. package/dist/kyc/index.d.ts +253 -21
  25. package/dist/kyc/index.js +54 -10
  26. package/dist/kyc/index.js.map +1 -1
  27. package/dist/kyc/index.mjs +54 -10
  28. package/dist/kyc/index.mjs.map +1 -1
  29. package/dist/react.d.mts +41 -6
  30. package/dist/react.d.ts +41 -6
  31. package/dist/react.js +603 -272
  32. package/dist/react.js.map +1 -1
  33. package/dist/react.mjs +603 -272
  34. package/dist/react.mjs.map +1 -1
  35. package/dist/risk-profile/index.d.mts +3 -3
  36. package/dist/risk-profile/index.d.ts +3 -3
  37. package/dist/scores/index.d.mts +1 -1
  38. package/dist/scores/index.d.ts +1 -1
  39. package/dist/{types-C4Zx0d_u.d.mts → types-BOFaMQxI.d.mts} +1 -1
  40. package/dist/{types-QUCWam16.d.mts → types-CBQRNL-l.d.mts} +10 -3
  41. package/dist/{types-QUCWam16.d.ts → types-CBQRNL-l.d.ts} +10 -3
  42. package/dist/{types-2utj53GK.d.ts → types-UGyDl1fd.d.ts} +1 -1
  43. package/dist/webhooks/index.d.mts +1 -1
  44. package/dist/webhooks/index.d.ts +1 -1
  45. 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 reuse KYC session for validate a user with existing KYC verification
2731
+ * Create a Re-Use KYC session.
2732
2732
  *
2733
- * @param request - Request containing the reference, customer_id, optional redirect URL, and callback URL (receives POST requests)
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.requestWithRetry("/api/v1/kyc/face/session", {
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 reuse KYC session for validate a user with existing KYC verification
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 - Request containing the reference, token and proof (receives POST requests)
2759
+ * @param request - Token from `createReuseKycSession`, plus the base64 selfie.
2746
2760
  */
2747
2761
  async submitReuseKycSession(request) {
2748
- return this.requestWithRetry("/api/v1/kyc/face/submit", {
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
- * Check reuse KYC session status for a reference
2756
- * @param reference - The unique reference used for the reuse KYC session (e.g., customer ID or transaction ID)
2757
- * @returns Response with kyc_status and message (reason)
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
  *