vesant-sdk 1.6.6-next.ac58d2b → 1.7.0-dev.059da4f

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 (72) hide show
  1. package/README.md +4 -4
  2. package/dist/client-C3DCmGe9.d.ts +436 -0
  3. package/dist/{client-D6PE3pcB.d.mts → client-DMIRx7Tu.d.mts} +4 -2
  4. package/dist/{client-DPtiuQvW.d.ts → client-DoMSYMMR.d.ts} +4 -2
  5. package/dist/client-ZNdnpWe7.d.mts +436 -0
  6. package/dist/compliance/index.d.mts +25 -429
  7. package/dist/compliance/index.d.ts +25 -429
  8. package/dist/compliance/index.js +181 -79
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +181 -80
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/decisions/index.d.mts +1 -1
  13. package/dist/decisions/index.d.ts +1 -1
  14. package/dist/decisions/index.js +1 -1
  15. package/dist/decisions/index.js.map +1 -1
  16. package/dist/decisions/index.mjs +1 -1
  17. package/dist/decisions/index.mjs.map +1 -1
  18. package/dist/geolocation/index.d.mts +3 -3
  19. package/dist/geolocation/index.d.ts +3 -3
  20. package/dist/geolocation/index.js +2 -1
  21. package/dist/geolocation/index.js.map +1 -1
  22. package/dist/geolocation/index.mjs +2 -1
  23. package/dist/geolocation/index.mjs.map +1 -1
  24. package/dist/index.d.mts +9 -8
  25. package/dist/index.d.ts +9 -8
  26. package/dist/index.js +269 -93
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +268 -94
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/kyc/core.d.mts +3 -3
  31. package/dist/kyc/core.d.ts +3 -3
  32. package/dist/kyc/core.js +77 -15
  33. package/dist/kyc/core.js.map +1 -1
  34. package/dist/kyc/core.mjs +77 -16
  35. package/dist/kyc/core.mjs.map +1 -1
  36. package/dist/kyc/index.d.mts +267 -26
  37. package/dist/kyc/index.d.ts +267 -26
  38. package/dist/kyc/index.js +77 -15
  39. package/dist/kyc/index.js.map +1 -1
  40. package/dist/kyc/index.mjs +77 -16
  41. package/dist/kyc/index.mjs.map +1 -1
  42. package/dist/react.d.mts +45 -8
  43. package/dist/react.d.ts +45 -8
  44. package/dist/react.js +874 -272
  45. package/dist/react.js.map +1 -1
  46. package/dist/react.mjs +873 -271
  47. package/dist/react.mjs.map +1 -1
  48. package/dist/risk-profile/index.d.mts +3 -3
  49. package/dist/risk-profile/index.d.ts +3 -3
  50. package/dist/risk-profile/index.js +1 -1
  51. package/dist/risk-profile/index.js.map +1 -1
  52. package/dist/risk-profile/index.mjs +1 -1
  53. package/dist/risk-profile/index.mjs.map +1 -1
  54. package/dist/scores/index.d.mts +1 -1
  55. package/dist/scores/index.d.ts +1 -1
  56. package/dist/scores/index.js +1 -1
  57. package/dist/scores/index.js.map +1 -1
  58. package/dist/scores/index.mjs +1 -1
  59. package/dist/scores/index.mjs.map +1 -1
  60. package/dist/tax/index.d.mts +41 -1
  61. package/dist/tax/index.d.ts +41 -1
  62. package/dist/tax/index.js +13 -1
  63. package/dist/tax/index.js.map +1 -1
  64. package/dist/tax/index.mjs +13 -1
  65. package/dist/tax/index.mjs.map +1 -1
  66. package/dist/{types-DGDVnogO.d.mts → types-BOFaMQxI.d.mts} +2 -2
  67. package/dist/{types-B4Ezqo7V.d.mts → types-CBQRNL-l.d.mts} +14 -1
  68. package/dist/{types-B4Ezqo7V.d.ts → types-CBQRNL-l.d.ts} +14 -1
  69. package/dist/{types-_YQdS3Ax.d.ts → types-UGyDl1fd.d.ts} +2 -2
  70. package/dist/webhooks/index.d.mts +12 -4
  71. package/dist/webhooks/index.d.ts +12 -4
  72. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './index.mjs';
2
- export { C as CreateCustomerProfileRequest, a as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-DGDVnogO.mjs';
3
- export { P as PaginationParams, R as RiskLevel } from '../types-B4Ezqo7V.mjs';
1
+ export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycDeclinedCode, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './index.mjs';
2
+ export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-BOFaMQxI.mjs';
3
+ export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.mjs';
4
4
  import '../client-BolQlL5e.mjs';
@@ -1,4 +1,4 @@
1
- export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, FaceProof, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitReuseKycSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './index.js';
2
- export { C as CreateCustomerProfileRequest, a as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-_YQdS3Ax.js';
3
- export { P as PaginationParams, R as RiskLevel } from '../types-B4Ezqo7V.js';
1
+ export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerProfile, KycDeclinedCode, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './index.js';
2
+ export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-UGyDl1fd.js';
3
+ export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.js';
4
4
  import '../client-BolQlL5e.js';
package/dist/kyc/core.js CHANGED
@@ -216,7 +216,7 @@ function createConsoleLogger() {
216
216
  }
217
217
 
218
218
  // src/core/version.ts
219
- var SDK_VERSION = "1.6.6";
219
+ var SDK_VERSION = "1.7.0";
220
220
 
221
221
  // src/shared/browser-utils.ts
222
222
  function generateUUID() {
@@ -626,40 +626,88 @@ var KycClient = class extends BaseClient {
626
626
  });
627
627
  }
628
628
  /**
629
- * Create a reuse KYC session for validate a user with existing KYC verification
629
+ * Create a Event-Based Face Verification session.
630
630
  *
631
- * @param request - Request containing the reference, customer_id, optional redirect URL, and callback URL (receives POST requests)
631
+ * Inspect the response before showing UI:
632
+ * - `is_required === false` → skip face capture; `reason` explains why.
633
+ * - `device_type === 'desktop'` → render `qr_payload` as a QR; the
634
+ * mobile device picks up the session via the connect endpoint.
635
+ * - `device_type === 'mobile'` → open the face capture modal directly.
636
+ *
637
+ * @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
632
638
  */
633
- async createReuseKycSession(request) {
634
- return this.requestWithRetry("/api/v1/kyc/face/session", {
639
+ async createEventBasedFaceVerificationSession(request) {
640
+ return this.request("/api/v1/kyc/face/session", {
635
641
  method: "POST",
636
642
  body: JSON.stringify(request),
637
643
  headers: this.getUserHeaders()
638
644
  });
639
645
  }
640
646
  /**
641
- * Submit a reuse KYC session for validate a user with existing KYC verification
647
+ * Submit a real-time face capture for an active Event-Based Face Verification session.
648
+ *
649
+ * **Mobile-only.** The server rejects desktop User-Agents with HTTP
650
+ * 400 (`face capture must be completed on a mobile device`). Use the
651
+ * QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
652
+ *
653
+ * The `data` field on the response carries `retries_remaining`,
654
+ * `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
655
+ * `freeze_account`, etc.) so the tenant app can act on a final failure.
642
656
  *
643
- * @param request - Request containing the reference, token and proof (receives POST requests)
657
+ * @param request - Token from `createEventBasedFaceVerificationSession`, plus the base64 selfie.
644
658
  */
645
- async submitReuseKycSession(request) {
646
- return this.requestWithRetry("/api/v1/kyc/face/submit", {
659
+ async submitEventBasedFaceVerificationSession(request) {
660
+ return this.request("/api/v1/kyc/face/submit", {
647
661
  method: "POST",
648
662
  body: JSON.stringify(request),
649
663
  headers: this.getUserHeaders()
650
664
  });
651
665
  }
652
666
  /**
653
- * Check reuse KYC session status for a reference
654
- * @param reference - The unique reference used for the reuse KYC session (e.g., customer ID or transaction ID)
655
- * @returns Response with kyc_status and message (reason)
656
- * **/
657
- async getReuseKycSessionStatus(reference) {
658
- return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(reference)}`, {
667
+ * Look up the current state of a Event-Based Face Verification session by its
668
+ * session token. Useful for desktop pollers waiting on the mobile handoff.
669
+ *
670
+ * The lookup is scoped by the unguessable, server-issued session token (not
671
+ * the enumerable forward reference): the endpoint is public/unauthenticated,
672
+ * and scoping by the token is what prevents cross-tenant status reads.
673
+ *
674
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
675
+ */
676
+ async getEventBasedFaceVerificationSessionStatus(token) {
677
+ return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(token)}`, {
659
678
  method: "GET",
660
679
  headers: this.getUserHeaders()
661
680
  });
662
681
  }
682
+ /**
683
+ * Fetch the Redis-backed handoff session for a token. Same backing
684
+ * store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
685
+ * callers poll `mobile_connected` to detect when a mobile device has
686
+ * scanned the QR and attached.
687
+ *
688
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
689
+ */
690
+ async getHandoffSession(token) {
691
+ return this.request(
692
+ `/api/v1/kyc/session${this.buildQueryString({ token })}`,
693
+ { headers: this.getUserHeaders() }
694
+ );
695
+ }
696
+ /**
697
+ * Attach a mobile device to a desktop-initiated session. The mobile
698
+ * client calls this after scanning the QR code. The desktop poller
699
+ * sees `mobile_connected: true` on the next `getHandoffSession`.
700
+ *
701
+ * @param token - The session token transferred via the QR payload.
702
+ * @param isDisconnect - Pass true to release the session (default false).
703
+ */
704
+ async connectMobileSession(token, isDisconnect = false) {
705
+ return this.request("/api/v1/kyc/session/connect", {
706
+ method: "PUT",
707
+ body: JSON.stringify({ token, is_disconnect: isDisconnect }),
708
+ headers: this.getUserHeaders()
709
+ });
710
+ }
663
711
  /**
664
712
  * Check KYC status for a user
665
713
  *
@@ -1132,6 +1180,20 @@ var KycClient = class extends BaseClient {
1132
1180
  // ============================================================================
1133
1181
  };
1134
1182
 
1183
+ // src/kyc/types.ts
1184
+ var KYC_DECLINED_DESCRIPTIONS = {
1185
+ KYC_DOCUMENT_EXPIRED: "The submitted document has expired",
1186
+ KYC_DOCUMENT_INVALID: "The submitted document could not be verified",
1187
+ KYC_FACE_MISMATCH: "Face verification did not match the identity document",
1188
+ KYC_AGE_REQUIREMENT: "Age requirement not met",
1189
+ KYC_DUPLICATE_IDENTITY: "This identity has already been verified under another account",
1190
+ KYC_ADDRESS_MISMATCH: "Address verification failed",
1191
+ KYC_NAME_MISMATCH: "Name on document does not match the registered name",
1192
+ KYC_PROVIDER_REJECTED: "Identity verification was rejected by the verification provider",
1193
+ KYC_DECLINED: "Identity verification was declined"
1194
+ };
1195
+
1196
+ exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
1135
1197
  exports.KycClient = KycClient;
1136
1198
  //# sourceMappingURL=core.js.map
1137
1199
  //# sourceMappingURL=core.js.map