vesant-sdk 1.8.0-dev.9f7204d → 1.8.0-next.65ec9ad

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 CHANGED
@@ -352,11 +352,9 @@ 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
- | `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) |
355
+ | `listKycRequests(filters)` | List KYC requests |
356
+ | `getPreferences()` | Get KYC preferences |
357
+ | `listAlerts(filters)` | List KYC alerts |
360
358
  | `createEventBasedFaceVerificationSession(request)` | Start a face re-verification session (backend) |
361
359
  | `submitEventBasedFaceVerificationSession(request)` | Submit a face capture for a session |
362
360
  | `getEventBasedFaceVerificationSessionStatus(token)` | Look up a session's current result |
package/dist/index.js CHANGED
@@ -3205,26 +3205,19 @@ var KycClient = class extends BaseClient {
3205
3205
  }, void 0, requestOptions);
3206
3206
  }
3207
3207
  /**
3208
- * Get a KYC record by ID
3208
+ * Get a KYC request by ID
3209
3209
  *
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
3210
+ * @param id - KYC request ID
3211
+ * @returns KYC request details including proofs and alerts
3216
3212
  *
3217
3213
  * @example
3218
3214
  * ```typescript
3219
3215
  * const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
3220
3216
  * console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
3221
- * kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
3222
3217
  * ```
3223
3218
  */
3224
3219
  async getKycRequest(id) {
3225
- return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
3226
- headers: this.getUserHeaders()
3227
- });
3220
+ return this.request(`/api/v1/kyc/requests/${id}`);
3228
3221
  }
3229
3222
  /**
3230
3223
  * List KYC requests with filters and pagination
@@ -3241,10 +3234,6 @@ var KycClient = class extends BaseClient {
3241
3234
  * );
3242
3235
  * console.log(`Found ${requests.total} pending requests`);
3243
3236
  * ```
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.
3248
3237
  */
3249
3238
  async listKycRequests(filters, pagination) {
3250
3239
  const params = {};
@@ -3282,10 +3271,6 @@ var KycClient = class extends BaseClient {
3282
3271
  * reason: "Document expired"
3283
3272
  * });
3284
3273
  * ```
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.
3289
3274
  */
3290
3275
  async updateKycStatus(request) {
3291
3276
  await this.request("/api/v1/kyc/status", {
@@ -3322,24 +3307,22 @@ var KycClient = class extends BaseClient {
3322
3307
  /**
3323
3308
  * Get downloadable URLs for KYC proofs/documents
3324
3309
  *
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
3310
+ * @param kycId - KYC request ID
3311
+ * @returns Array of proof download URLs with expiration
3331
3312
  *
3332
3313
  * @example
3333
3314
  * ```typescript
3334
3315
  * const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
3335
3316
  * proofs.forEach(proof => {
3336
- * console.log(`${proof.type}: ${proof.url}`);
3317
+ * console.log(`${proof.type}: ${proof.url} (expires: ${proof.expires_at})`);
3337
3318
  * });
3338
3319
  * ```
3339
3320
  */
3340
3321
  async getProofDownloadURLs(kycId) {
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 }));
3322
+ return this.request(
3323
+ `/api/v1/kyc/proofs/${kycId}`,
3324
+ { headers: this.getUserHeaders() }
3325
+ );
3343
3326
  }
3344
3327
  // ============================================================================
3345
3328
  // KYC Overview & Statistics
@@ -3360,10 +3343,6 @@ var KycClient = class extends BaseClient {
3360
3343
  * console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
3361
3344
  * console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
3362
3345
  * ```
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.
3367
3346
  */
3368
3347
  async getOverview(fromDate, toDate) {
3369
3348
  const params = {};
@@ -3381,10 +3360,6 @@ var KycClient = class extends BaseClient {
3381
3360
  *
3382
3361
  * @param alertId - Alert ID
3383
3362
  * @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.
3388
3363
  */
3389
3364
  async getAlert(alertId) {
3390
3365
  return this.request(`/api/v1/kyc/alerts/${alertId}`);
@@ -3408,10 +3383,6 @@ var KycClient = class extends BaseClient {
3408
3383
  * );
3409
3384
  * console.log(`Found ${alerts.total} alerts`);
3410
3385
  * ```
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.
3415
3386
  */
3416
3387
  async listAlerts(filters, pagination) {
3417
3388
  const params = {};
@@ -3458,10 +3429,6 @@ var KycClient = class extends BaseClient {
3458
3429
  * reason: "Requires senior review - suspicious documents"
3459
3430
  * });
3460
3431
  * ```
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.
3465
3432
  */
3466
3433
  async updateAlert(alertId, update) {
3467
3434
  await this.request(`/api/v1/kyc/alerts/${alertId}`, {
@@ -3484,10 +3451,6 @@ var KycClient = class extends BaseClient {
3484
3451
  * console.log(`Face verification required: ${prefs.is_face_verification_required}`);
3485
3452
  * console.log(`Required documents: ${prefs.required_document_count}`);
3486
3453
  * ```
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.
3491
3454
  */
3492
3455
  async getPreferences() {
3493
3456
  return this.request("/api/v1/kyc/preferences");