vesant-sdk 1.8.0-dev.d0a7c04 → 1.8.0-dev.d8b25c5

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.
Files changed (58) hide show
  1. package/README.md +1 -3
  2. package/dist/{client-4oLoc31v.d.ts → client-BPALLldd.d.ts} +1 -1
  3. package/dist/{client-CJI8VO1i.d.mts → client-_OhkfnyJ.d.mts} +1 -1
  4. package/dist/compliance/index.d.mts +2 -2
  5. package/dist/compliance/index.d.ts +2 -2
  6. package/dist/compliance/index.js +7 -6
  7. package/dist/compliance/index.js.map +1 -1
  8. package/dist/compliance/index.mjs +7 -6
  9. package/dist/compliance/index.mjs.map +1 -1
  10. package/dist/decisions/index.js +7 -6
  11. package/dist/decisions/index.js.map +1 -1
  12. package/dist/decisions/index.mjs +7 -6
  13. package/dist/decisions/index.mjs.map +1 -1
  14. package/dist/geolocation/index.js +7 -6
  15. package/dist/geolocation/index.js.map +1 -1
  16. package/dist/geolocation/index.mjs +7 -6
  17. package/dist/geolocation/index.mjs.map +1 -1
  18. package/dist/index.d.mts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +14 -182
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +14 -183
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/kyc/core.d.mts +2 -2
  25. package/dist/kyc/core.d.ts +2 -2
  26. package/dist/kyc/core.js +14 -182
  27. package/dist/kyc/core.js.map +1 -1
  28. package/dist/kyc/core.mjs +14 -183
  29. package/dist/kyc/core.mjs.map +1 -1
  30. package/dist/kyc/index.d.mts +82 -238
  31. package/dist/kyc/index.d.ts +82 -238
  32. package/dist/kyc/index.js +14 -182
  33. package/dist/kyc/index.js.map +1 -1
  34. package/dist/kyc/index.mjs +14 -183
  35. package/dist/kyc/index.mjs.map +1 -1
  36. package/dist/react.d.mts +6 -122
  37. package/dist/react.d.ts +6 -122
  38. package/dist/react.js +0 -185
  39. package/dist/react.js.map +1 -1
  40. package/dist/react.mjs +1 -183
  41. package/dist/react.mjs.map +1 -1
  42. package/dist/risk-profile/index.d.mts +2 -2
  43. package/dist/risk-profile/index.d.ts +2 -2
  44. package/dist/risk-profile/index.js +7 -6
  45. package/dist/risk-profile/index.js.map +1 -1
  46. package/dist/risk-profile/index.mjs +7 -6
  47. package/dist/risk-profile/index.mjs.map +1 -1
  48. package/dist/scores/index.js +7 -6
  49. package/dist/scores/index.js.map +1 -1
  50. package/dist/scores/index.mjs +7 -6
  51. package/dist/scores/index.mjs.map +1 -1
  52. package/dist/tax/index.js +7 -6
  53. package/dist/tax/index.js.map +1 -1
  54. package/dist/tax/index.mjs +7 -6
  55. package/dist/tax/index.mjs.map +1 -1
  56. package/dist/{types-DfbnIaW_.d.mts → types-DbvVph_0.d.mts} +1 -1
  57. package/dist/{types-1kI4SsKB.d.ts → types-qXamJr2q.d.ts} +1 -1
  58. package/package.json +1 -1
package/README.md CHANGED
@@ -354,9 +354,7 @@ interface ComplianceClientConfig {
354
354
  | `submitVerification(request)` | Submit document verification |
355
355
  | `getKycRequest(id)` | Get a KYC record with proof download links |
356
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) |
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 |
@@ -1,7 +1,7 @@
1
1
  import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-BaUekQT8.js';
2
2
  import { RiskProfileClient } from './risk-profile/index.js';
3
3
  import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.js';
4
- import { C as CustomerProfile } from './types-1kI4SsKB.js';
4
+ import { C as CustomerProfile } from './types-qXamJr2q.js';
5
5
  import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.js';
6
6
 
7
7
  interface RegistrationVerificationRequest {
@@ -1,7 +1,7 @@
1
1
  import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-XDEhh9VN.mjs';
2
2
  import { RiskProfileClient } from './risk-profile/index.mjs';
3
3
  import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.mjs';
4
- import { C as CustomerProfile } from './types-DfbnIaW_.mjs';
4
+ import { C as CustomerProfile } from './types-DbvVph_0.mjs';
5
5
  import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.mjs';
6
6
 
7
7
  interface RegistrationVerificationRequest {
@@ -1,9 +1,9 @@
1
1
  import { B as BlockReason } from '../types-CBQRNL-l.mjs';
2
- export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-CJI8VO1i.mjs';
2
+ export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-_OhkfnyJ.mjs';
3
3
  export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-XDEhh9VN.mjs';
4
4
  import '../risk-profile/index.mjs';
5
5
  import '../client-q9fN8Hhf.mjs';
6
- import '../types-DfbnIaW_.mjs';
6
+ import '../types-DbvVph_0.mjs';
7
7
 
8
8
  declare const sdkReasons: {
9
9
  jurisdictionBlocked: (country: string, countryISO: string) => BlockReason;
@@ -1,9 +1,9 @@
1
1
  import { B as BlockReason } from '../types-CBQRNL-l.js';
2
- export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-4oLoc31v.js';
2
+ export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-BPALLldd.js';
3
3
  export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-BaUekQT8.js';
4
4
  import '../risk-profile/index.js';
5
5
  import '../client-q9fN8Hhf.js';
6
- import '../types-1kI4SsKB.js';
6
+ import '../types-qXamJr2q.js';
7
7
 
8
8
  declare const sdkReasons: {
9
9
  jurisdictionBlocked: (country: string, countryISO: string) => BlockReason;
@@ -647,19 +647,20 @@ var BaseClient = class {
647
647
  * Handle error responses from API
648
648
  */
649
649
  handleErrorResponse(status, data, requestId) {
650
- const message = data.error || data.message || `HTTP ${status}`;
650
+ const structured = data.error && typeof data.error === "object" && !Array.isArray(data.error) ? data.error : void 0;
651
+ const message = typeof data.error === "string" && data.error || typeof structured?.message === "string" && structured.message || typeof data.message === "string" && data.message || `HTTP ${status}`;
651
652
  const createError = () => {
652
653
  switch (status) {
653
654
  case 400:
654
- return new VesantError(message, "BAD_REQUEST", 400);
655
+ return new VesantError(message, "BAD_REQUEST", 400, structured);
655
656
  case 401:
656
657
  return new AuthenticationError(message);
657
658
  case 403:
658
- return new VesantError(message, "FORBIDDEN", 403);
659
+ return new VesantError(message, "FORBIDDEN", 403, structured);
659
660
  case 404:
660
- return new VesantError(message, "NOT_FOUND", 404);
661
+ return new VesantError(message, "NOT_FOUND", 404, structured);
661
662
  case 409:
662
- return new VesantError(message, "DUPLICATE_PROFILE", 409);
663
+ return new VesantError(message, "DUPLICATE_PROFILE", 409, structured);
663
664
  case 429: {
664
665
  const retryAfter = data.retry_after || data.retryAfter;
665
666
  return new RateLimitError(retryAfter);
@@ -670,7 +671,7 @@ var BaseClient = class {
670
671
  case 504:
671
672
  return new ServiceUnavailableError(message);
672
673
  default:
673
- return new VesantError(message, "UNKNOWN_ERROR", status);
674
+ return new VesantError(message, "UNKNOWN_ERROR", status, structured);
674
675
  }
675
676
  };
676
677
  const error = createError();