vesant-sdk 1.7.1-dev.afc5a32 → 1.7.1-dev.c2ac5a5

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 (42) hide show
  1. package/README.md +4 -0
  2. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  3. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  4. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  5. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  6. package/dist/compliance/index.d.mts +2 -2
  7. package/dist/compliance/index.d.ts +2 -2
  8. package/dist/compliance/index.js +39 -1
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +39 -1
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/geolocation/index.d.mts +2 -2
  13. package/dist/geolocation/index.d.ts +2 -2
  14. package/dist/geolocation/index.js +39 -1
  15. package/dist/geolocation/index.js.map +1 -1
  16. package/dist/geolocation/index.mjs +39 -1
  17. package/dist/geolocation/index.mjs.map +1 -1
  18. package/dist/index.d.mts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +86 -23
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +86 -23
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/kyc/core.d.mts +1 -1
  25. package/dist/kyc/core.d.ts +1 -1
  26. package/dist/kyc/core.js +47 -22
  27. package/dist/kyc/core.js.map +1 -1
  28. package/dist/kyc/core.mjs +47 -22
  29. package/dist/kyc/core.mjs.map +1 -1
  30. package/dist/kyc/index.d.mts +178 -39
  31. package/dist/kyc/index.d.ts +178 -39
  32. package/dist/kyc/index.js +47 -22
  33. package/dist/kyc/index.js.map +1 -1
  34. package/dist/kyc/index.mjs +47 -22
  35. package/dist/kyc/index.mjs.map +1 -1
  36. package/dist/react.d.mts +126 -48
  37. package/dist/react.d.ts +126 -48
  38. package/dist/react.js +131 -20
  39. package/dist/react.js.map +1 -1
  40. package/dist/react.mjs +129 -21
  41. package/dist/react.mjs.map +1 -1
  42. package/package.json +1 -1
@@ -1,4 +1,4 @@
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, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycStatus, KycTriggerEvent, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './index.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, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './index.mjs';
2
2
  export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-BOFaMQxI.mjs';
3
3
  export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.mjs';
4
4
  import '../client-q9fN8Hhf.mjs';
@@ -1,4 +1,4 @@
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, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycStatus, KycTriggerEvent, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './index.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, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './index.js';
2
2
  export { a as CreateCustomerProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse } from '../types-UGyDl1fd.js';
3
3
  export { P as PaginationParams, R as RiskLevel } from '../types-CBQRNL-l.js';
4
4
  import '../client-q9fN8Hhf.js';
package/dist/kyc/core.js CHANGED
@@ -664,19 +664,27 @@ var KycClient = class extends BaseClient {
664
664
  *
665
665
  * Generates a link that the user can visit to submit their KYC documents.
666
666
  *
667
+ * Pass the `trigger_event` that matches the user action so the tenant's
668
+ * trigger preferences decide whether verification is required; inspect
669
+ * `kyc_required` and `reason` on the response before redirecting.
670
+ *
667
671
  * Optionally pass the customer's registered identity data as
668
672
  * `customer_data` (same shape as the geolocation `customer_data` block).
669
673
  * It seeds the customer's risk profile so document verification can
670
674
  * cross-check the submitted document against trusted reference data;
671
675
  * fields never overwrite data already on the profile.
672
676
  *
673
- * @param request - Request containing the user ID, optional redirect URL, optional callback URL (receives POST requests), and optional customer identity data
674
- * @returns Response containing the redirect link and KYC ID
677
+ * The call is made once and is not retried: each request creates a new
678
+ * KYC record and link, so a retry after a timeout would leave duplicates.
679
+ *
680
+ * @param request - Request containing the user ID, trigger event, optional redirect URL, optional callback URL (receives POST requests), and optional customer identity data
681
+ * @returns Response containing the redirect link, KYC ID, `kyc_required`, `can_skip` and `reason`
675
682
  *
676
683
  * @example
677
684
  * ```typescript
678
685
  * const result = await client.requestKycSubmitLink({
679
686
  * user_id: "user_123",
687
+ * trigger_event: "onboarding",
680
688
  * redirect_url: "https://merchant.com/kyc-complete", // optional
681
689
  * callback_url: "https://merchant.com/api/kyc-webhook", // optional - receives POST requests on status change
682
690
  * customer_data: { // optional - seeds the risk profile for document cross-checks
@@ -689,16 +697,17 @@ var KycClient = class extends BaseClient {
689
697
  * }
690
698
  * });
691
699
  *
700
+ * if (!result.kyc_required) return proceed();
692
701
  * console.log(`Redirect user to: ${result.link}`);
693
702
  * console.log(`KYC ID: ${result.kyc_id}`);
694
703
  * ```
695
704
  */
696
705
  async requestKycSubmitLink(request, requestOptions) {
697
- return this.requestWithRetry("/api/v1/kyc/request", {
706
+ return this.request("/api/v1/kyc/request", {
698
707
  method: "POST",
699
708
  body: JSON.stringify(request),
700
709
  headers: this.getUserHeaders()
701
- }, void 0, void 0, requestOptions);
710
+ }, void 0, requestOptions);
702
711
  }
703
712
  /**
704
713
  * Create a Event-Based Face Verification session.
@@ -720,9 +729,9 @@ var KycClient = class extends BaseClient {
720
729
  /**
721
730
  * Submit a real-time face capture for an active Event-Based Face Verification session.
722
731
  *
723
- * **Mobile-only.** The server rejects desktop User-Agents with HTTP
724
- * 400 (`face capture must be completed on a mobile device`). Use the
725
- * QR handoff from `createEventBasedFaceVerificationSession` for desktop callers.
732
+ * Works from any device: the platform does not inspect the User-Agent.
733
+ * `FaceCaptureModal` decides between direct capture and the QR handoff
734
+ * on the client; custom UIs may submit from desktop or mobile alike.
726
735
  *
727
736
  * The `data` field on the response carries `retries_remaining`,
728
737
  * `retry_limit_exceeded`, and the reaction flags (`enforce_logout`,
@@ -803,25 +812,30 @@ var KycClient = class extends BaseClient {
803
812
  * Check KYC status for a user
804
813
  *
805
814
  * Returns the current KYC status:
806
- * - "complete" → KYC verified, show "Continue to Login"
807
- * - "processing" → Under review, show "Continue to Login"
808
- * - "failed" / "declined" → Show error + retry option
809
- * - "pending" / "in_progress" → Keep polling
815
+ * - "accepted" / "review.pending" → verified (limited access while under review)
816
+ * - "pending" → documents submitted, verification running: keep polling
817
+ * - "awaiting_kyc" → nothing submitted yet; check `link_expired` before
818
+ * re-surfacing or re-requesting the link. Never treat as in progress.
819
+ * - "declined" → show `additional_data.declined_reasons` (fallback
820
+ * `declined_reason`) with a retry option
810
821
  *
811
- * @param request - Request containing user_id and token
812
- * @returns Response with kyc_status and message (reason)
822
+ * @param request - Request containing user_id and kyc_id
823
+ * @returns Response with status, verification flags and, once terminal, the full record in `additional_data`
813
824
  *
814
825
  * @example
815
826
  * ```typescript
816
827
  * const result = await client.checkKycStatus({
817
828
  * user_id: "user_123",
818
- * token: "auth_token_xyz"
829
+ * kyc_id: "550e8400-e29b-41d4-a716-446655440000"
819
830
  * });
820
831
  *
821
- * if (result.kyc_status === 'complete') {
822
- * // Show "Continue to Login"
823
- * } else if (result.kyc_status === 'failed' || result.kyc_status === 'declined') {
832
+ * if (result.status === 'accepted' || result.status === 'review.pending') {
833
+ * // Grant access
834
+ * } else if (result.status === 'declined') {
835
+ * const reasons = result.additional_data?.declined_reasons;
824
836
  * // Show error + retry option
837
+ * } else if (result.status === 'awaiting_kyc') {
838
+ * // Prompt to verify; request a new link when result.link_expired is true
825
839
  * } else {
826
840
  * // Keep polling
827
841
  * }
@@ -843,7 +857,9 @@ var KycClient = class extends BaseClient {
843
857
  /**
844
858
  * Submit a document verification request with OCR
845
859
  *
846
- * Uses requestWithRetry() for automatic retry on transient failures.
860
+ * The call is made once and is not retried: every submission is processed
861
+ * and billed, and the platform does not replay this route from an
862
+ * idempotency key. Retry explicitly if the request fails.
847
863
  *
848
864
  * @param request - Document verification request with documents and customer info
849
865
  * @returns Verification response with status and reference
@@ -869,11 +885,11 @@ var KycClient = class extends BaseClient {
869
885
  * ```
870
886
  */
871
887
  async submitVerification(request, requestOptions) {
872
- return this.requestWithRetry("/api/v1/kyc/submit", {
888
+ return this.request("/api/v1/kyc/submit", {
873
889
  method: "POST",
874
890
  body: JSON.stringify(request),
875
891
  headers: this.getUserHeaders()
876
- }, void 0, void 0, requestOptions);
892
+ }, void 0, requestOptions);
877
893
  }
878
894
  /**
879
895
  * Get a KYC request by ID
@@ -930,14 +946,14 @@ var KycClient = class extends BaseClient {
930
946
  * ```typescript
931
947
  * // Accept a KYC request
932
948
  * await client.updateKycStatus({
933
- * reference: "shufti_ref_123",
949
+ * reference: "kyc-ref-123",
934
950
  * status: "accepted",
935
951
  * reason: "All documents verified successfully"
936
952
  * });
937
953
  *
938
954
  * // Decline a KYC request
939
955
  * await client.updateKycStatus({
940
- * reference: "shufti_ref_456",
956
+ * reference: "kyc-ref-456",
941
957
  * status: "declined",
942
958
  * reason: "Document expired"
943
959
  * });
@@ -953,6 +969,10 @@ var KycClient = class extends BaseClient {
953
969
  /**
954
970
  * Request additional documents from customer
955
971
  *
972
+ * @deprecated The platform does not expose this operation; the call always
973
+ * fails. Request additional documents from the Vesant console instead.
974
+ * This method will be removed in a future release.
975
+ *
956
976
  * @param request - Request with KYC ID and document types needed
957
977
  *
958
978
  * @example
@@ -1125,6 +1145,11 @@ var KycClient = class extends BaseClient {
1125
1145
  /**
1126
1146
  * Update KYC preferences for the tenant
1127
1147
  *
1148
+ * @deprecated KYC preferences are managed in the Vesant console; the
1149
+ * platform exposes no update operation to the SDK, so this call always
1150
+ * fails. Use `getPreferences()` to read them. This method will be removed
1151
+ * in a future release.
1152
+ *
1128
1153
  * @param update - Fields to update
1129
1154
  * @returns Updated preferences
1130
1155
  *