vesant-sdk 1.8.0-dev.153299b → 1.8.0-dev.237d268
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 +5 -3
- package/dist/index.js +48 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -11
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.js +48 -11
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +48 -11
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +74 -13
- package/dist/kyc/index.d.ts +74 -13
- package/dist/kyc/index.js +48 -11
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +48 -11
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +12 -0
- package/dist/react.d.ts +12 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/tax/index.d.mts +1 -1
- package/dist/tax/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -352,9 +352,11 @@ interface ComplianceClientConfig {
|
|
|
352
352
|
| `requestKycSubmitLink(request)` | Generate a KYC submission link |
|
|
353
353
|
| `checkKycStatus(request)` | Check KYC verification status |
|
|
354
354
|
| `submitVerification(request)` | Submit document verification |
|
|
355
|
-
| `
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
355
|
+
| `getKycRequest(id)` | Get a KYC record with proof download links |
|
|
356
|
+
| `getProofDownloadURLs(id)` | Download links for a record's proofs |
|
|
357
|
+
| `listKycRequests(filters)` | List KYC requests (console session only) |
|
|
358
|
+
| `getPreferences()` | Get KYC preferences (console session only) |
|
|
359
|
+
| `listAlerts(filters)` | List KYC alerts (console session only) |
|
|
358
360
|
| `createEventBasedFaceVerificationSession(request)` | Start a face re-verification session (backend) |
|
|
359
361
|
| `submitEventBasedFaceVerificationSession(request)` | Submit a face capture for a session |
|
|
360
362
|
| `getEventBasedFaceVerificationSessionStatus(token)` | Look up a session's current result |
|
package/dist/index.js
CHANGED
|
@@ -3205,19 +3205,26 @@ var KycClient = class extends BaseClient {
|
|
|
3205
3205
|
}, void 0, requestOptions);
|
|
3206
3206
|
}
|
|
3207
3207
|
/**
|
|
3208
|
-
* Get a KYC
|
|
3208
|
+
* Get a KYC record by ID
|
|
3209
3209
|
*
|
|
3210
|
-
*
|
|
3211
|
-
*
|
|
3210
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
3211
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
3212
|
+
* your own customer reference (the `forward_reference`).
|
|
3213
|
+
*
|
|
3214
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
3215
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
3212
3216
|
*
|
|
3213
3217
|
* @example
|
|
3214
3218
|
* ```typescript
|
|
3215
3219
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
3216
3220
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
3221
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
3217
3222
|
* ```
|
|
3218
3223
|
*/
|
|
3219
3224
|
async getKycRequest(id) {
|
|
3220
|
-
return this.request(`/api/v1/kyc
|
|
3225
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
3226
|
+
headers: this.getUserHeaders()
|
|
3227
|
+
});
|
|
3221
3228
|
}
|
|
3222
3229
|
/**
|
|
3223
3230
|
* List KYC requests with filters and pagination
|
|
@@ -3234,6 +3241,10 @@ var KycClient = class extends BaseClient {
|
|
|
3234
3241
|
* );
|
|
3235
3242
|
* console.log(`Found ${requests.total} pending requests`);
|
|
3236
3243
|
* ```
|
|
3244
|
+
*
|
|
3245
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3246
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3247
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3237
3248
|
*/
|
|
3238
3249
|
async listKycRequests(filters, pagination) {
|
|
3239
3250
|
const params = {};
|
|
@@ -3271,6 +3282,10 @@ var KycClient = class extends BaseClient {
|
|
|
3271
3282
|
* reason: "Document expired"
|
|
3272
3283
|
* });
|
|
3273
3284
|
* ```
|
|
3285
|
+
*
|
|
3286
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3287
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3288
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3274
3289
|
*/
|
|
3275
3290
|
async updateKycStatus(request) {
|
|
3276
3291
|
await this.request("/api/v1/kyc/status", {
|
|
@@ -3307,22 +3322,24 @@ var KycClient = class extends BaseClient {
|
|
|
3307
3322
|
/**
|
|
3308
3323
|
* Get downloadable URLs for KYC proofs/documents
|
|
3309
3324
|
*
|
|
3310
|
-
*
|
|
3311
|
-
*
|
|
3325
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
3326
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
3327
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
3328
|
+
*
|
|
3329
|
+
* @param kycId - KYC record ID
|
|
3330
|
+
* @returns Array of proof download URLs
|
|
3312
3331
|
*
|
|
3313
3332
|
* @example
|
|
3314
3333
|
* ```typescript
|
|
3315
3334
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
3316
3335
|
* proofs.forEach(proof => {
|
|
3317
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
3336
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
3318
3337
|
* });
|
|
3319
3338
|
* ```
|
|
3320
3339
|
*/
|
|
3321
3340
|
async getProofDownloadURLs(kycId) {
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
{ headers: this.getUserHeaders() }
|
|
3325
|
-
);
|
|
3341
|
+
const kyc = await this.getKycRequest(kycId);
|
|
3342
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
3326
3343
|
}
|
|
3327
3344
|
// ============================================================================
|
|
3328
3345
|
// KYC Overview & Statistics
|
|
@@ -3343,6 +3360,10 @@ var KycClient = class extends BaseClient {
|
|
|
3343
3360
|
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
3344
3361
|
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
3345
3362
|
* ```
|
|
3363
|
+
*
|
|
3364
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3365
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3366
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3346
3367
|
*/
|
|
3347
3368
|
async getOverview(fromDate, toDate) {
|
|
3348
3369
|
const params = {};
|
|
@@ -3360,6 +3381,10 @@ var KycClient = class extends BaseClient {
|
|
|
3360
3381
|
*
|
|
3361
3382
|
* @param alertId - Alert ID
|
|
3362
3383
|
* @returns Alert details
|
|
3384
|
+
*
|
|
3385
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3386
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3387
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3363
3388
|
*/
|
|
3364
3389
|
async getAlert(alertId) {
|
|
3365
3390
|
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
@@ -3383,6 +3408,10 @@ var KycClient = class extends BaseClient {
|
|
|
3383
3408
|
* );
|
|
3384
3409
|
* console.log(`Found ${alerts.total} alerts`);
|
|
3385
3410
|
* ```
|
|
3411
|
+
*
|
|
3412
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3413
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3414
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3386
3415
|
*/
|
|
3387
3416
|
async listAlerts(filters, pagination) {
|
|
3388
3417
|
const params = {};
|
|
@@ -3429,6 +3458,10 @@ var KycClient = class extends BaseClient {
|
|
|
3429
3458
|
* reason: "Requires senior review - suspicious documents"
|
|
3430
3459
|
* });
|
|
3431
3460
|
* ```
|
|
3461
|
+
*
|
|
3462
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3463
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3464
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3432
3465
|
*/
|
|
3433
3466
|
async updateAlert(alertId, update) {
|
|
3434
3467
|
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
@@ -3451,6 +3484,10 @@ var KycClient = class extends BaseClient {
|
|
|
3451
3484
|
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
3452
3485
|
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
3453
3486
|
* ```
|
|
3487
|
+
*
|
|
3488
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3489
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3490
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3454
3491
|
*/
|
|
3455
3492
|
async getPreferences() {
|
|
3456
3493
|
return this.request("/api/v1/kyc/preferences");
|