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/dist/index.mjs
CHANGED
|
@@ -3203,19 +3203,26 @@ var KycClient = class extends BaseClient {
|
|
|
3203
3203
|
}, void 0, requestOptions);
|
|
3204
3204
|
}
|
|
3205
3205
|
/**
|
|
3206
|
-
* Get a KYC
|
|
3206
|
+
* Get a KYC record by ID
|
|
3207
3207
|
*
|
|
3208
|
-
*
|
|
3209
|
-
*
|
|
3208
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
3209
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
3210
|
+
* your own customer reference (the `forward_reference`).
|
|
3211
|
+
*
|
|
3212
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
3213
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
3210
3214
|
*
|
|
3211
3215
|
* @example
|
|
3212
3216
|
* ```typescript
|
|
3213
3217
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
3214
3218
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
3219
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
3215
3220
|
* ```
|
|
3216
3221
|
*/
|
|
3217
3222
|
async getKycRequest(id) {
|
|
3218
|
-
return this.request(`/api/v1/kyc
|
|
3223
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
3224
|
+
headers: this.getUserHeaders()
|
|
3225
|
+
});
|
|
3219
3226
|
}
|
|
3220
3227
|
/**
|
|
3221
3228
|
* List KYC requests with filters and pagination
|
|
@@ -3232,6 +3239,10 @@ var KycClient = class extends BaseClient {
|
|
|
3232
3239
|
* );
|
|
3233
3240
|
* console.log(`Found ${requests.total} pending requests`);
|
|
3234
3241
|
* ```
|
|
3242
|
+
*
|
|
3243
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3244
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3245
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3235
3246
|
*/
|
|
3236
3247
|
async listKycRequests(filters, pagination) {
|
|
3237
3248
|
const params = {};
|
|
@@ -3269,6 +3280,10 @@ var KycClient = class extends BaseClient {
|
|
|
3269
3280
|
* reason: "Document expired"
|
|
3270
3281
|
* });
|
|
3271
3282
|
* ```
|
|
3283
|
+
*
|
|
3284
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3285
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3286
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3272
3287
|
*/
|
|
3273
3288
|
async updateKycStatus(request) {
|
|
3274
3289
|
await this.request("/api/v1/kyc/status", {
|
|
@@ -3305,22 +3320,24 @@ var KycClient = class extends BaseClient {
|
|
|
3305
3320
|
/**
|
|
3306
3321
|
* Get downloadable URLs for KYC proofs/documents
|
|
3307
3322
|
*
|
|
3308
|
-
*
|
|
3309
|
-
*
|
|
3323
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
3324
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
3325
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
3326
|
+
*
|
|
3327
|
+
* @param kycId - KYC record ID
|
|
3328
|
+
* @returns Array of proof download URLs
|
|
3310
3329
|
*
|
|
3311
3330
|
* @example
|
|
3312
3331
|
* ```typescript
|
|
3313
3332
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
3314
3333
|
* proofs.forEach(proof => {
|
|
3315
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
3334
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
3316
3335
|
* });
|
|
3317
3336
|
* ```
|
|
3318
3337
|
*/
|
|
3319
3338
|
async getProofDownloadURLs(kycId) {
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
{ headers: this.getUserHeaders() }
|
|
3323
|
-
);
|
|
3339
|
+
const kyc = await this.getKycRequest(kycId);
|
|
3340
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
3324
3341
|
}
|
|
3325
3342
|
// ============================================================================
|
|
3326
3343
|
// KYC Overview & Statistics
|
|
@@ -3341,6 +3358,10 @@ var KycClient = class extends BaseClient {
|
|
|
3341
3358
|
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
3342
3359
|
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
3343
3360
|
* ```
|
|
3361
|
+
*
|
|
3362
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3363
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3364
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3344
3365
|
*/
|
|
3345
3366
|
async getOverview(fromDate, toDate) {
|
|
3346
3367
|
const params = {};
|
|
@@ -3358,6 +3379,10 @@ var KycClient = class extends BaseClient {
|
|
|
3358
3379
|
*
|
|
3359
3380
|
* @param alertId - Alert ID
|
|
3360
3381
|
* @returns Alert details
|
|
3382
|
+
*
|
|
3383
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3384
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3385
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3361
3386
|
*/
|
|
3362
3387
|
async getAlert(alertId) {
|
|
3363
3388
|
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
@@ -3381,6 +3406,10 @@ var KycClient = class extends BaseClient {
|
|
|
3381
3406
|
* );
|
|
3382
3407
|
* console.log(`Found ${alerts.total} alerts`);
|
|
3383
3408
|
* ```
|
|
3409
|
+
*
|
|
3410
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3411
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3412
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3384
3413
|
*/
|
|
3385
3414
|
async listAlerts(filters, pagination) {
|
|
3386
3415
|
const params = {};
|
|
@@ -3427,6 +3456,10 @@ var KycClient = class extends BaseClient {
|
|
|
3427
3456
|
* reason: "Requires senior review - suspicious documents"
|
|
3428
3457
|
* });
|
|
3429
3458
|
* ```
|
|
3459
|
+
*
|
|
3460
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3461
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3462
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3430
3463
|
*/
|
|
3431
3464
|
async updateAlert(alertId, update) {
|
|
3432
3465
|
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
@@ -3449,6 +3482,10 @@ var KycClient = class extends BaseClient {
|
|
|
3449
3482
|
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
3450
3483
|
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
3451
3484
|
* ```
|
|
3485
|
+
*
|
|
3486
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3487
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3488
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3452
3489
|
*/
|
|
3453
3490
|
async getPreferences() {
|
|
3454
3491
|
return this.request("/api/v1/kyc/preferences");
|