vesant-sdk 1.6.6 → 1.7.0-dev.e0ee6d5
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/README.md +14 -4
- package/dist/{client-ePzhQKp9.d.mts → client-BolQlL5e.d.mts} +1 -1
- package/dist/{client-ePzhQKp9.d.ts → client-BolQlL5e.d.ts} +1 -1
- package/dist/client-C3DCmGe9.d.ts +436 -0
- package/dist/{client-C_A7QLcB.d.ts → client-DMIRx7Tu.d.mts} +5 -3
- package/dist/{client-BlCxjbY2.d.mts → client-DoMSYMMR.d.ts} +5 -3
- package/dist/client-ZNdnpWe7.d.mts +436 -0
- package/dist/compliance/index.d.mts +25 -429
- package/dist/compliance/index.d.ts +25 -429
- package/dist/compliance/index.js +187 -103
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +187 -104
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +2 -2
- package/dist/decisions/index.d.ts +2 -2
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +4 -4
- package/dist/geolocation/index.d.ts +4 -4
- package/dist/geolocation/index.js +7 -24
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +7 -24
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +12 -70
- package/dist/index.d.ts +12 -70
- package/dist/index.js +294 -292
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +293 -291
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +4 -4
- package/dist/kyc/core.d.ts +4 -4
- package/dist/kyc/core.js +78 -23
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +78 -24
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +269 -45
- package/dist/kyc/index.d.ts +269 -45
- package/dist/kyc/index.js +78 -23
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +78 -24
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +42 -7
- package/dist/react.d.ts +42 -7
- package/dist/react.js +663 -277
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +663 -277
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +4 -4
- package/dist/risk-profile/index.d.ts +4 -4
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +2 -2
- package/dist/scores/index.d.ts +2 -2
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +6 -41
- package/dist/tax/index.d.ts +6 -41
- package/dist/tax/index.js +1 -36
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -36
- package/dist/tax/index.mjs.map +1 -1
- package/dist/{types-1RzYeSal.d.mts → types-BOFaMQxI.d.mts} +2 -2
- package/dist/{types-B4Ezqo7V.d.mts → types-CBQRNL-l.d.mts} +14 -1
- package/dist/{types-B4Ezqo7V.d.ts → types-CBQRNL-l.d.ts} +14 -1
- package/dist/{types-X5Md_dD_.d.ts → types-UGyDl1fd.d.ts} +2 -2
- package/dist/webhooks/index.d.mts +189 -2
- package/dist/webhooks/index.d.ts +189 -2
- package/dist/webhooks/index.js +49 -7
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +49 -7
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +16 -13
- package/dist/fraud/index.d.mts +0 -80
- package/dist/fraud/index.d.ts +0 -80
- package/dist/fraud/index.js +0 -606
- package/dist/fraud/index.js.map +0 -1
- package/dist/fraud/index.mjs +0 -604
- package/dist/fraud/index.mjs.map +0 -1
- package/dist/index-B04H4xfJ.d.mts +0 -320
- package/dist/index-CItMPmLL.d.ts +0 -320
package/dist/kyc/core.d.mts
CHANGED
|
@@ -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,
|
|
2
|
-
export { P as
|
|
3
|
-
export {
|
|
4
|
-
import '../client-
|
|
1
|
+
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, 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, ReuseKycCallback, ReuseKycDeviceType, ReuseKycEvent, ReuseKycFrequencyTrigger, ReuseKycReactionResult, ReuseKycReactions, ReuseKycThresholdTrigger, ReuseKycTriggers, SubmitReuseKycSessionRequest, 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
|
+
import '../client-BolQlL5e.mjs';
|
package/dist/kyc/core.d.ts
CHANGED
|
@@ -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,
|
|
2
|
-
export { P as
|
|
3
|
-
export {
|
|
4
|
-
import '../client-
|
|
1
|
+
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateReuseKycSessionRequest, CreateReuseKycSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, 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, ReuseKycCallback, ReuseKycDeviceType, ReuseKycEvent, ReuseKycFrequencyTrigger, ReuseKycReactionResult, ReuseKycReactions, ReuseKycThresholdTrigger, ReuseKycTriggers, SubmitReuseKycSessionRequest, 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
|
+
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.
|
|
219
|
+
var SDK_VERSION = "1.7.0";
|
|
220
220
|
|
|
221
221
|
// src/shared/browser-utils.ts
|
|
222
222
|
function generateUUID() {
|
|
@@ -603,23 +603,19 @@ var KycClient = class extends BaseClient {
|
|
|
603
603
|
*
|
|
604
604
|
* Generates a link that the user can visit to submit their KYC documents.
|
|
605
605
|
*
|
|
606
|
-
* @param request - Request containing the user ID, redirect URL, callback URL
|
|
607
|
-
* @returns Response containing
|
|
606
|
+
* @param request - Request containing the user ID, optional redirect URL, and optional callback URL (receives POST requests)
|
|
607
|
+
* @returns Response containing the redirect link and KYC ID
|
|
608
608
|
*
|
|
609
609
|
* @example
|
|
610
610
|
* ```typescript
|
|
611
611
|
* const result = await client.requestKycSubmitLink({
|
|
612
612
|
* user_id: "user_123",
|
|
613
|
-
* redirect_url: "https://merchant.com/kyc-complete",
|
|
614
|
-
* callback_url: "https://merchant.com/api/kyc-webhook"
|
|
615
|
-
* trigger_event: "onboarding"
|
|
613
|
+
* redirect_url: "https://merchant.com/kyc-complete", // optional
|
|
614
|
+
* callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
|
|
616
615
|
* });
|
|
617
616
|
*
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
* } else if (result.can_skip) {
|
|
621
|
-
* console.log("KYC not required, user can proceed");
|
|
622
|
-
* }
|
|
617
|
+
* console.log(`Redirect user to: ${result.link}`);
|
|
618
|
+
* console.log(`KYC ID: ${result.kyc_id}`);
|
|
623
619
|
* ```
|
|
624
620
|
*/
|
|
625
621
|
async requestKycSubmitLink(request) {
|
|
@@ -630,40 +626,84 @@ var KycClient = class extends BaseClient {
|
|
|
630
626
|
});
|
|
631
627
|
}
|
|
632
628
|
/**
|
|
633
|
-
* Create a
|
|
629
|
+
* Create a Re-Use KYC session.
|
|
630
|
+
*
|
|
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.
|
|
634
636
|
*
|
|
635
|
-
* @param request -
|
|
637
|
+
* @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
|
|
636
638
|
*/
|
|
637
639
|
async createReuseKycSession(request) {
|
|
638
|
-
return this.
|
|
640
|
+
return this.request("/api/v1/kyc/face/session", {
|
|
639
641
|
method: "POST",
|
|
640
642
|
body: JSON.stringify(request),
|
|
641
643
|
headers: this.getUserHeaders()
|
|
642
644
|
});
|
|
643
645
|
}
|
|
644
646
|
/**
|
|
645
|
-
* Submit a
|
|
647
|
+
* Submit a real-time face capture for an active Re-Use KYC 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 `createReuseKycSession` for desktop callers.
|
|
646
652
|
*
|
|
647
|
-
*
|
|
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.
|
|
656
|
+
*
|
|
657
|
+
* @param request - Token from `createReuseKycSession`, plus the base64 selfie.
|
|
648
658
|
*/
|
|
649
659
|
async submitReuseKycSession(request) {
|
|
650
|
-
return this.
|
|
660
|
+
return this.request("/api/v1/kyc/face/submit", {
|
|
651
661
|
method: "POST",
|
|
652
662
|
body: JSON.stringify(request),
|
|
653
663
|
headers: this.getUserHeaders()
|
|
654
664
|
});
|
|
655
665
|
}
|
|
656
666
|
/**
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
*
|
|
667
|
+
* Look up the current state of a Re-Use KYC session by its forward
|
|
668
|
+
* reference. Useful for desktop pollers waiting on the mobile handoff.
|
|
669
|
+
*
|
|
670
|
+
* @param reference - The reference used when the session was created.
|
|
671
|
+
*/
|
|
661
672
|
async getReuseKycSessionStatus(reference) {
|
|
662
673
|
return this.requestWithRetry(`/api/v1/kyc/face/verify/${encodeURIComponent(reference)}`, {
|
|
663
674
|
method: "GET",
|
|
664
675
|
headers: this.getUserHeaders()
|
|
665
676
|
});
|
|
666
677
|
}
|
|
678
|
+
/**
|
|
679
|
+
* Fetch the Redis-backed handoff session for a token. Same backing
|
|
680
|
+
* store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
|
|
681
|
+
* callers poll `mobile_connected` to detect when a mobile device has
|
|
682
|
+
* scanned the QR and attached.
|
|
683
|
+
*
|
|
684
|
+
* @param token - The session token returned by `createReuseKycSession`.
|
|
685
|
+
*/
|
|
686
|
+
async getHandoffSession(token) {
|
|
687
|
+
return this.request(
|
|
688
|
+
`/api/v1/kyc/session${this.buildQueryString({ token })}`,
|
|
689
|
+
{ headers: this.getUserHeaders() }
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Attach a mobile device to a desktop-initiated session. The mobile
|
|
694
|
+
* client calls this after scanning the QR code. The desktop poller
|
|
695
|
+
* sees `mobile_connected: true` on the next `getHandoffSession`.
|
|
696
|
+
*
|
|
697
|
+
* @param token - The session token transferred via the QR payload.
|
|
698
|
+
* @param isDisconnect - Pass true to release the session (default false).
|
|
699
|
+
*/
|
|
700
|
+
async connectMobileSession(token, isDisconnect = false) {
|
|
701
|
+
return this.request("/api/v1/kyc/session/connect", {
|
|
702
|
+
method: "PUT",
|
|
703
|
+
body: JSON.stringify({ token, is_disconnect: isDisconnect }),
|
|
704
|
+
headers: this.getUserHeaders()
|
|
705
|
+
});
|
|
706
|
+
}
|
|
667
707
|
/**
|
|
668
708
|
* Check KYC status for a user
|
|
669
709
|
*
|
|
@@ -1022,8 +1062,9 @@ var KycClient = class extends BaseClient {
|
|
|
1022
1062
|
*/
|
|
1023
1063
|
async riskProfileRequest(path, options = {}) {
|
|
1024
1064
|
if (!this.riskProfileBaseURL) {
|
|
1025
|
-
throw new
|
|
1026
|
-
"Risk Profile Service URL not configured. Please provide riskProfileBaseURL in KycClientConfig."
|
|
1065
|
+
throw new ValidationError(
|
|
1066
|
+
"Risk Profile Service URL not configured. Please provide riskProfileBaseURL in KycClientConfig.",
|
|
1067
|
+
["riskProfileBaseURL"]
|
|
1027
1068
|
);
|
|
1028
1069
|
}
|
|
1029
1070
|
return this.request(path, {
|
|
@@ -1135,6 +1176,20 @@ var KycClient = class extends BaseClient {
|
|
|
1135
1176
|
// ============================================================================
|
|
1136
1177
|
};
|
|
1137
1178
|
|
|
1179
|
+
// src/kyc/types.ts
|
|
1180
|
+
var KYC_DECLINED_DESCRIPTIONS = {
|
|
1181
|
+
KYC_DOCUMENT_EXPIRED: "The submitted document has expired",
|
|
1182
|
+
KYC_DOCUMENT_INVALID: "The submitted document could not be verified",
|
|
1183
|
+
KYC_FACE_MISMATCH: "Face verification did not match the identity document",
|
|
1184
|
+
KYC_AGE_REQUIREMENT: "Age requirement not met",
|
|
1185
|
+
KYC_DUPLICATE_IDENTITY: "This identity has already been verified under another account",
|
|
1186
|
+
KYC_ADDRESS_MISMATCH: "Address verification failed",
|
|
1187
|
+
KYC_NAME_MISMATCH: "Name on document does not match the registered name",
|
|
1188
|
+
KYC_PROVIDER_REJECTED: "Identity verification was rejected by the verification provider",
|
|
1189
|
+
KYC_DECLINED: "Identity verification was declined"
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1138
1193
|
exports.KycClient = KycClient;
|
|
1139
1194
|
//# sourceMappingURL=core.js.map
|
|
1140
1195
|
//# sourceMappingURL=core.js.map
|