vesant-sdk 1.6.6 → 2.0.0-dev.37c7832
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-BJ87_Vv5.d.ts +430 -0
- 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-BlCxjbY2.d.mts → client-Bvp-f05-.d.ts} +7 -7
- package/dist/{client-C_A7QLcB.d.ts → client-CIEa7xYG.d.mts} +7 -7
- package/dist/client-IAOGCBfm.d.mts +430 -0
- package/dist/compliance/index.d.mts +25 -429
- package/dist/compliance/index.d.ts +25 -429
- package/dist/compliance/index.js +137 -58
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +137 -59
- 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 +6 -24
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +6 -24
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +14 -71
- package/dist/index.d.ts +14 -71
- package/dist/index.js +190 -237
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +189 -236
- 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 +24 -13
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +24 -14
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +22 -27
- package/dist/kyc/index.d.ts +22 -27
- package/dist/kyc/index.js +24 -13
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +24 -14
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +18 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +18 -5
- 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-X5Md_dD_.d.ts → types-2utj53GK.d.ts} +2 -2
- package/dist/{types-1RzYeSal.d.mts → types-C4Zx0d_u.d.mts} +2 -2
- package/dist/{types-B4Ezqo7V.d.mts → types-QUCWam16.d.mts} +7 -1
- package/dist/{types-B4Ezqo7V.d.ts → types-QUCWam16.d.ts} +7 -1
- package/dist/webhooks/index.d.mts +181 -2
- package/dist/webhooks/index.d.ts +181 -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/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { B as BaseClient } from '../client-
|
|
1
|
+
import { P as ProfileFilters, b as ProfileListResponse, C as CustomerProfile, a as CreateProfileRequest } from '../types-2utj53GK.js';
|
|
2
|
+
import { R as RiskLevel, P as PaginationParams } from '../types-QUCWam16.js';
|
|
3
|
+
import { B as BaseClient } from '../client-BolQlL5e.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* TypeScript type definitions for Vesant KYC Service API
|
|
@@ -12,12 +12,13 @@ import { B as BaseClient } from '../client-ePzhQKp9.js';
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
type KycStatus = 'pending' | 'accepted' | 'declined' | 'review.pending' | 'unknown';
|
|
15
|
+
type KycDeclinedCode = 'KYC_DOCUMENT_EXPIRED' | 'KYC_DOCUMENT_INVALID' | 'KYC_FACE_MISMATCH' | 'KYC_AGE_REQUIREMENT' | 'KYC_DUPLICATE_IDENTITY' | 'KYC_ADDRESS_MISMATCH' | 'KYC_NAME_MISMATCH' | 'KYC_PROVIDER_REJECTED' | 'KYC_DECLINED';
|
|
16
|
+
declare const KYC_DECLINED_DESCRIPTIONS: Record<KycDeclinedCode, string>;
|
|
15
17
|
type KycAlertStatus = 'pending' | 'in_progress' | 'resolved' | 'closed' | 'escalated';
|
|
16
18
|
type KycAlertType = 'kyc' | 'fraud';
|
|
17
19
|
type DocumentType = 'id_card' | 'driving_license' | 'passport';
|
|
18
20
|
type ProofType = 'document' | 'document_two' | 'face' | 'address' | 'additional_document';
|
|
19
21
|
type SupportedDocumentType = 'id_card' | 'passport' | 'driving_license';
|
|
20
|
-
type KycTriggerEvent = 'onboarding' | 'first_withdrawal' | 'first_purchase' | 'manual' | 'withdrawal' | 'purchase';
|
|
21
22
|
interface KycRequest {
|
|
22
23
|
id: string;
|
|
23
24
|
reference: string;
|
|
@@ -45,6 +46,7 @@ interface KycRequest {
|
|
|
45
46
|
callback_url: string;
|
|
46
47
|
redirect_url?: string;
|
|
47
48
|
declined_reason?: string;
|
|
49
|
+
declined_code?: KycDeclinedCode;
|
|
48
50
|
accepted_reason?: string;
|
|
49
51
|
other_reason?: string;
|
|
50
52
|
warnings?: Record<string, Record<string, string>>;
|
|
@@ -223,12 +225,12 @@ interface UpdateKycStatusRequest {
|
|
|
223
225
|
interface RequestKycSubmitLinkRequest {
|
|
224
226
|
/** User ID to generate KYC submission link for */
|
|
225
227
|
user_id: string;
|
|
226
|
-
/** URL to redirect user after KYC submission */
|
|
227
|
-
redirect_url
|
|
228
|
-
/** URL to receive callback notifications via POST request when KYC status changes */
|
|
229
|
-
callback_url
|
|
230
|
-
/** Event that triggered the KYC request */
|
|
231
|
-
trigger_event
|
|
228
|
+
/** URL to redirect user after KYC submission (optional) */
|
|
229
|
+
redirect_url?: string;
|
|
230
|
+
/** URL to receive callback notifications via POST request when KYC status changes (optional) */
|
|
231
|
+
callback_url?: string;
|
|
232
|
+
/** Event that triggered the KYC request (e.g. "onboarding", "login", "transaction") */
|
|
233
|
+
trigger_event?: string;
|
|
232
234
|
}
|
|
233
235
|
interface CreateReuseKycSessionRequest {
|
|
234
236
|
/** Unique reference for the KYC session (e.g., customer ID or transaction ID) */
|
|
@@ -251,14 +253,10 @@ interface SubmitReuseKycSessionRequest {
|
|
|
251
253
|
reference?: string;
|
|
252
254
|
}
|
|
253
255
|
interface RequestKycSubmitLinkResponse {
|
|
254
|
-
/** Whether KYC is required for this user */
|
|
255
|
-
kyc_required: boolean;
|
|
256
|
-
/** Whether the user can skip KYC */
|
|
257
|
-
can_skip: boolean;
|
|
258
256
|
/** Generated KYC submission redirect URL */
|
|
259
|
-
link
|
|
257
|
+
link: string;
|
|
260
258
|
/** KYC request ID */
|
|
261
|
-
kyc_id
|
|
259
|
+
kyc_id: string;
|
|
262
260
|
}
|
|
263
261
|
interface CreateReuseKycSessionResponse {
|
|
264
262
|
/** Generated reuse KYC session token, valid X minutes */
|
|
@@ -290,6 +288,7 @@ interface CheckKycStatusResponse {
|
|
|
290
288
|
face_verified: boolean;
|
|
291
289
|
age_verified: boolean;
|
|
292
290
|
declined_reason?: string;
|
|
291
|
+
declined_code?: KycDeclinedCode;
|
|
293
292
|
other_reason?: string;
|
|
294
293
|
accepted_reason?: string;
|
|
295
294
|
warnings?: Record<string, Record<string, string>>;
|
|
@@ -461,23 +460,19 @@ declare class KycClient extends BaseClient {
|
|
|
461
460
|
*
|
|
462
461
|
* Generates a link that the user can visit to submit their KYC documents.
|
|
463
462
|
*
|
|
464
|
-
* @param request - Request containing the user ID, redirect URL, callback URL
|
|
465
|
-
* @returns Response containing
|
|
463
|
+
* @param request - Request containing the user ID, optional redirect URL, and optional callback URL (receives POST requests)
|
|
464
|
+
* @returns Response containing the redirect link and KYC ID
|
|
466
465
|
*
|
|
467
466
|
* @example
|
|
468
467
|
* ```typescript
|
|
469
468
|
* const result = await client.requestKycSubmitLink({
|
|
470
469
|
* user_id: "user_123",
|
|
471
|
-
* redirect_url: "https://merchant.com/kyc-complete",
|
|
472
|
-
* callback_url: "https://merchant.com/api/kyc-webhook"
|
|
473
|
-
* trigger_event: "onboarding"
|
|
470
|
+
* redirect_url: "https://merchant.com/kyc-complete", // optional
|
|
471
|
+
* callback_url: "https://merchant.com/api/kyc-webhook" // optional - receives POST requests on status change
|
|
474
472
|
* });
|
|
475
473
|
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
* } else if (result.can_skip) {
|
|
479
|
-
* console.log("KYC not required, user can proceed");
|
|
480
|
-
* }
|
|
474
|
+
* console.log(`Redirect user to: ${result.link}`);
|
|
475
|
+
* console.log(`KYC ID: ${result.kyc_id}`);
|
|
481
476
|
* ```
|
|
482
477
|
*/
|
|
483
478
|
requestKycSubmitLink(request: RequestKycSubmitLinkRequest): Promise<RequestKycSubmitLinkResponse>;
|
|
@@ -819,4 +814,4 @@ declare class KycClient extends BaseClient {
|
|
|
819
814
|
createCustomerProfile(profile: CreateProfileRequest): Promise<CustomerProfile>;
|
|
820
815
|
}
|
|
821
816
|
|
|
822
|
-
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateReuseKycSessionRequest, type CreateReuseKycSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type FaceProof, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerProfile, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type
|
|
817
|
+
export { type CheckKycStatusRequest, type CheckKycStatusResponse, CreateProfileRequest as CreateCustomerProfileRequest, type CreateReuseKycSessionRequest, type CreateReuseKycSessionResponse, CustomerProfile, ProfileFilters as CustomerProfileFilters, ProfileListResponse as CustomerProfileListResponse, type DocumentType, type DocumentVerificationRequest, type DocumentVerificationResponse, type FaceProof, KYC_DECLINED_DESCRIPTIONS, type KycAlert, type KycAlertFilters, type KycAlertListResponse, type KycAlertStatus, type KycAlertType, KycClient, type KycClientConfig, type KycCustomerProfile, type KycDeclinedCode, type KycOverview, type KycPagination, type KycPreferences, type KycRequest, type KycRequestFilters, type KycRequestListResponse, type KycStatus, type Name, PaginationParams, type Proof, type ProofDownloadURL, type ProofType, type RequestAdditionalDocumentsRequest, type RequestKycSubmitLinkRequest, type RequestKycSubmitLinkResponse, RiskLevel, type SubmitReuseKycSessionRequest, type SubmittedDocument, type SupportedDocumentType, type UpdateKycAlertRequest, type UpdateKycPreferencesRequest, type UpdateKycStatusRequest, type UseKycAlertsOptions, type UseKycAlertsResult, type UseKycOverviewOptions, type UseKycOverviewResult, type UseKycPreferencesResult, type UseKycRequestsOptions, type UseKycRequestsResult, type UseKycSubmissionOptions, type UseKycSubmissionResult };
|
package/dist/kyc/index.js
CHANGED
|
@@ -216,7 +216,7 @@ function createConsoleLogger() {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
// src/core/version.ts
|
|
219
|
-
var SDK_VERSION = "
|
|
219
|
+
var SDK_VERSION = "2.0.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) {
|
|
@@ -1022,8 +1018,9 @@ var KycClient = class extends BaseClient {
|
|
|
1022
1018
|
*/
|
|
1023
1019
|
async riskProfileRequest(path, options = {}) {
|
|
1024
1020
|
if (!this.riskProfileBaseURL) {
|
|
1025
|
-
throw new
|
|
1026
|
-
"Risk Profile Service URL not configured. Please provide riskProfileBaseURL in KycClientConfig."
|
|
1021
|
+
throw new ValidationError(
|
|
1022
|
+
"Risk Profile Service URL not configured. Please provide riskProfileBaseURL in KycClientConfig.",
|
|
1023
|
+
["riskProfileBaseURL"]
|
|
1027
1024
|
);
|
|
1028
1025
|
}
|
|
1029
1026
|
return this.request(path, {
|
|
@@ -1135,6 +1132,20 @@ var KycClient = class extends BaseClient {
|
|
|
1135
1132
|
// ============================================================================
|
|
1136
1133
|
};
|
|
1137
1134
|
|
|
1135
|
+
// src/kyc/types.ts
|
|
1136
|
+
var KYC_DECLINED_DESCRIPTIONS = {
|
|
1137
|
+
KYC_DOCUMENT_EXPIRED: "The submitted document has expired",
|
|
1138
|
+
KYC_DOCUMENT_INVALID: "The submitted document could not be verified",
|
|
1139
|
+
KYC_FACE_MISMATCH: "Face verification did not match the identity document",
|
|
1140
|
+
KYC_AGE_REQUIREMENT: "Age requirement not met",
|
|
1141
|
+
KYC_DUPLICATE_IDENTITY: "This identity has already been verified under another account",
|
|
1142
|
+
KYC_ADDRESS_MISMATCH: "Address verification failed",
|
|
1143
|
+
KYC_NAME_MISMATCH: "Name on document does not match the registered name",
|
|
1144
|
+
KYC_PROVIDER_REJECTED: "Identity verification was rejected by the verification provider",
|
|
1145
|
+
KYC_DECLINED: "Identity verification was declined"
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
exports.KYC_DECLINED_DESCRIPTIONS = KYC_DECLINED_DESCRIPTIONS;
|
|
1138
1149
|
exports.KycClient = KycClient;
|
|
1139
1150
|
//# sourceMappingURL=index.js.map
|
|
1140
1151
|
//# sourceMappingURL=index.js.map
|