vesant-sdk 1.5.0 → 1.5.2

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 (66) hide show
  1. package/README.md +5 -3
  2. package/dist/{client-3cBb_Pp-.d.ts → client-B8pFrXx_.d.ts} +9 -3
  3. package/dist/{client-DKqyESgT.d.mts → client-BZxzOidG.d.mts} +9 -3
  4. package/dist/{client-BQRONu8q.d.mts → client-CIon-bGS.d.mts} +1 -1
  5. package/dist/{client-BQRONu8q.d.ts → client-CIon-bGS.d.ts} +1 -1
  6. package/dist/compliance/index.d.mts +5 -5
  7. package/dist/compliance/index.d.ts +5 -5
  8. package/dist/compliance/index.js +3 -1
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +3 -1
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/decisions/index.d.mts +2 -2
  13. package/dist/decisions/index.d.ts +2 -2
  14. package/dist/decisions/index.js +3 -1
  15. package/dist/decisions/index.js.map +1 -1
  16. package/dist/decisions/index.mjs +3 -1
  17. package/dist/decisions/index.mjs.map +1 -1
  18. package/dist/geolocation/index.d.mts +4 -4
  19. package/dist/geolocation/index.d.ts +4 -4
  20. package/dist/geolocation/index.js +3 -1
  21. package/dist/geolocation/index.js.map +1 -1
  22. package/dist/geolocation/index.mjs +3 -1
  23. package/dist/geolocation/index.mjs.map +1 -1
  24. package/dist/index.d.mts +537 -9
  25. package/dist/index.d.ts +537 -9
  26. package/dist/index.js +274 -110
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +273 -108
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/kyc/core.d.mts +3 -3
  31. package/dist/kyc/core.d.ts +3 -3
  32. package/dist/kyc/core.js +3 -1
  33. package/dist/kyc/core.js.map +1 -1
  34. package/dist/kyc/core.mjs +3 -1
  35. package/dist/kyc/core.mjs.map +1 -1
  36. package/dist/kyc/index.d.mts +7 -3
  37. package/dist/kyc/index.d.ts +7 -3
  38. package/dist/kyc/index.js +3 -1
  39. package/dist/kyc/index.js.map +1 -1
  40. package/dist/kyc/index.mjs +3 -1
  41. package/dist/kyc/index.mjs.map +1 -1
  42. package/dist/react.d.mts +4 -4
  43. package/dist/react.d.ts +4 -4
  44. package/dist/react.js +1 -1
  45. package/dist/react.js.map +1 -1
  46. package/dist/react.mjs +1 -1
  47. package/dist/react.mjs.map +1 -1
  48. package/dist/risk-profile/index.d.mts +4 -4
  49. package/dist/risk-profile/index.d.ts +4 -4
  50. package/dist/risk-profile/index.js +3 -1
  51. package/dist/risk-profile/index.js.map +1 -1
  52. package/dist/risk-profile/index.mjs +3 -1
  53. package/dist/risk-profile/index.mjs.map +1 -1
  54. package/dist/scores/index.d.mts +2 -2
  55. package/dist/scores/index.d.ts +2 -2
  56. package/dist/scores/index.js +3 -1
  57. package/dist/scores/index.js.map +1 -1
  58. package/dist/scores/index.mjs +3 -1
  59. package/dist/scores/index.mjs.map +1 -1
  60. package/dist/{types-_hsTA3Ez.d.mts → types-1RzYeSal.d.mts} +1 -1
  61. package/dist/{types-B1OzEQR3.d.mts → types-B4Ezqo7V.d.mts} +1 -1
  62. package/dist/{types-B1OzEQR3.d.ts → types-B4Ezqo7V.d.ts} +1 -1
  63. package/dist/{types-BnL66DB3.d.ts → types-X5Md_dD_.d.ts} +1 -1
  64. package/dist/webhooks/index.d.mts +1 -1
  65. package/dist/webhooks/index.d.ts +1 -1
  66. package/package.json +6 -1
package/README.md CHANGED
@@ -316,14 +316,16 @@ interface ComplianceClientConfig {
316
316
 
317
317
  | Method | Description |
318
318
  |--------|-------------|
319
- | `verifyIP(request)` | Verify IP address and check compliance |
319
+ | `verifyIP(request)` | Verify IP address and check compliance (**use this for allowed/blocked decisions**) |
320
320
  | `checkCompliance(countryISO)` | Check jurisdiction compliance |
321
- | `validateCipherText(cipherText, userId, eventType)` | Validate device fingerprint |
322
- | `validateAndVerify(cipherText, ip, userId, eventType)` | Combined cipherText + IP verification |
321
+ | `validateCipherText(cipherText, userId, eventType)` | Validate device fingerprint integrity (does **not** check jurisdiction rules) |
322
+ | `validateAndVerify(cipherText, ip, userId, eventType)` | Combined cipherText validation + IP verification |
323
323
  | `getGPSConfig()` | Get GPS requirement config per event type |
324
324
  | `createLocationRequest(request)` | Create a live location request |
325
325
  | `captureLocation(token, capture)` | Submit location capture (customer-facing) |
326
326
 
327
+ > **Which API should I use?** For registration, login, and transaction flows, use `ComplianceClient` methods (`verifyAtRegistration`, `verifyAtLogin`, `verifyAtTransaction`). These orchestrate geolocation + risk profiling and return a single `allowed` decision. Only use `GeolocationClient` directly if you need low-level access to individual APIs.
328
+
327
329
  ### RiskProfileClient
328
330
 
329
331
  | Method | Description |
@@ -1,5 +1,5 @@
1
- import { L as Logger, B as BaseClient, R as RequestOptions } from './client-BQRONu8q.js';
2
- import { P as PaginationParams } from './types-B1OzEQR3.js';
1
+ import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CIon-bGS.js';
2
+ import { P as PaginationParams } from './types-B4Ezqo7V.js';
3
3
 
4
4
  interface DeviceFingerprintRequest {
5
5
  device_id: string;
@@ -428,6 +428,10 @@ interface GeolocationRecord {
428
428
  postal_code?: string;
429
429
  latitude: number;
430
430
  longitude: number;
431
+ /** Source of the coordinates: "gps" when device GPS was provided, "ip" when derived from IP lookup */
432
+ position_source?: 'gps' | 'ip';
433
+ /** GPS accuracy in meters (only present when position_source is "gps") */
434
+ gps_accuracy?: number;
431
435
  timezone?: string;
432
436
  is_vpn: boolean;
433
437
  is_proxy: boolean;
@@ -454,6 +458,8 @@ interface GeolocationConfigResponse {
454
458
  registration: boolean;
455
459
  transaction: boolean;
456
460
  };
461
+ /** When true, GPS-verified location overrides anonymizer-based blocking */
462
+ trust_gps_over_anonymizer: boolean;
457
463
  /** Public signing key (pk_) for client-side HMAC signing */
458
464
  signing_key?: string;
459
465
  }
@@ -1002,4 +1008,4 @@ declare class GeolocationClient extends BaseClient {
1002
1008
  generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
1003
1009
  }
1004
1010
 
1005
- export { type UseLocationRequestsOptions as $, type AlertStatus as A, type APIError as B, type CipherTextPayload as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationClientConfig as F, GeolocationClient as G, type UseGeolocationOptions as H, type UseGeolocationResult as I, type JurisdictionConfig as J, type UseAlertsOptions as K, type LocationVerification as L, type UseAlertsResult as M, type LocationRequestStatus as N, type LocationRequestChannel as O, type LocationRequest as P, type CreateLocationRequestRequest as Q, type LocationRequestResult as R, type LocationRequestFilters as S, type LocationRequestListResponse as T, type UpdateJurisdictionRequest as U, type ValidateCipherTextRequest as V, type ResendLocationRequestRequest as W, type WiFiNetwork as X, type LocationCaptureRequest as Y, type LocationShareInfo as Z, type LocationCaptureResponse as _, type CipherTextReason as a, type UseLocationRequestsResult as a0, type UseLocationCaptureOptions as a1, type UseLocationCaptureResult as a2, type CipherTextOptions as b, type CipherTextResult as c, type DecryptedCipherText as d, type CipherTextCustomerData as e, type ValidateCipherTextResponse as f, type VerifyIPRequest as g, type GeoIPResult as h, type GeofenceEvaluation as i, type DeviceFingerprint as j, type DeviceTrustResult as k, type ComplianceCheckResponse as l, type AlertSeverity as m, type AlertType as n, type GeolocationAlert as o, type AlertFilters as p, type AlertListResponse as q, type DashboardMetrics as r, type CreateJurisdictionRequest as s, type GeofenceRuleType as t, type GeofenceAction as u, type GeofenceRule as v, type CreateGeofenceRuleRequest as w, type UpdateGeofenceRuleRequest as x, type UpdateDeviceTrustRequest as y, type GeolocationRecord as z };
1011
+ export { type WiFiNetwork as $, type AlertStatus as A, type GeofenceAction as B, type CipherTextOptions as C, type DeviceFingerprintRequest as D, type GeofenceRule as E, type CreateGeofenceRuleRequest as F, GeolocationClient as G, type UpdateGeofenceRuleRequest as H, type UpdateDeviceTrustRequest as I, type JurisdictionConfig as J, type GeolocationRecord as K, type LocationVerification as L, type APIError as M, type GeolocationConfigResponse as N, type GeolocationClientConfig as O, type UseAlertsOptions as P, type UseAlertsResult as Q, type LocationRequestStatus as R, type LocationRequestChannel as S, type LocationRequest as T, type UseGeolocationOptions as U, type ValidateCipherTextRequest as V, type CreateLocationRequestRequest as W, type LocationRequestResult as X, type LocationRequestFilters as Y, type LocationRequestListResponse as Z, type ResendLocationRequestRequest as _, type UseGeolocationResult as a, type LocationCaptureRequest as a0, type LocationShareInfo as a1, type LocationCaptureResponse as a2, type UseLocationRequestsOptions as b, type UseLocationRequestsResult as c, type UseLocationCaptureOptions as d, type UseLocationCaptureResult as e, type CipherTextResult as f, type CipherTextPayload as g, type CipherTextReason as h, type DecryptedCipherText as i, type CipherTextCustomerData as j, type ValidateCipherTextResponse as k, type VerifyIPRequest as l, type GeoIPResult as m, type GeofenceEvaluation as n, type DeviceFingerprint as o, type DeviceTrustResult as p, type ComplianceCheckResponse as q, type AlertSeverity as r, type AlertType as s, type GeolocationAlert as t, type AlertFilters as u, type AlertListResponse as v, type DashboardMetrics as w, type CreateJurisdictionRequest as x, type UpdateJurisdictionRequest as y, type GeofenceRuleType as z };
@@ -1,5 +1,5 @@
1
- import { L as Logger, B as BaseClient, R as RequestOptions } from './client-BQRONu8q.mjs';
2
- import { P as PaginationParams } from './types-B1OzEQR3.mjs';
1
+ import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CIon-bGS.mjs';
2
+ import { P as PaginationParams } from './types-B4Ezqo7V.mjs';
3
3
 
4
4
  interface DeviceFingerprintRequest {
5
5
  device_id: string;
@@ -428,6 +428,10 @@ interface GeolocationRecord {
428
428
  postal_code?: string;
429
429
  latitude: number;
430
430
  longitude: number;
431
+ /** Source of the coordinates: "gps" when device GPS was provided, "ip" when derived from IP lookup */
432
+ position_source?: 'gps' | 'ip';
433
+ /** GPS accuracy in meters (only present when position_source is "gps") */
434
+ gps_accuracy?: number;
431
435
  timezone?: string;
432
436
  is_vpn: boolean;
433
437
  is_proxy: boolean;
@@ -454,6 +458,8 @@ interface GeolocationConfigResponse {
454
458
  registration: boolean;
455
459
  transaction: boolean;
456
460
  };
461
+ /** When true, GPS-verified location overrides anonymizer-based blocking */
462
+ trust_gps_over_anonymizer: boolean;
457
463
  /** Public signing key (pk_) for client-side HMAC signing */
458
464
  signing_key?: string;
459
465
  }
@@ -1002,4 +1008,4 @@ declare class GeolocationClient extends BaseClient {
1002
1008
  generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
1003
1009
  }
1004
1010
 
1005
- export { type UseLocationRequestsOptions as $, type AlertStatus as A, type APIError as B, type CipherTextPayload as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationClientConfig as F, GeolocationClient as G, type UseGeolocationOptions as H, type UseGeolocationResult as I, type JurisdictionConfig as J, type UseAlertsOptions as K, type LocationVerification as L, type UseAlertsResult as M, type LocationRequestStatus as N, type LocationRequestChannel as O, type LocationRequest as P, type CreateLocationRequestRequest as Q, type LocationRequestResult as R, type LocationRequestFilters as S, type LocationRequestListResponse as T, type UpdateJurisdictionRequest as U, type ValidateCipherTextRequest as V, type ResendLocationRequestRequest as W, type WiFiNetwork as X, type LocationCaptureRequest as Y, type LocationShareInfo as Z, type LocationCaptureResponse as _, type CipherTextReason as a, type UseLocationRequestsResult as a0, type UseLocationCaptureOptions as a1, type UseLocationCaptureResult as a2, type CipherTextOptions as b, type CipherTextResult as c, type DecryptedCipherText as d, type CipherTextCustomerData as e, type ValidateCipherTextResponse as f, type VerifyIPRequest as g, type GeoIPResult as h, type GeofenceEvaluation as i, type DeviceFingerprint as j, type DeviceTrustResult as k, type ComplianceCheckResponse as l, type AlertSeverity as m, type AlertType as n, type GeolocationAlert as o, type AlertFilters as p, type AlertListResponse as q, type DashboardMetrics as r, type CreateJurisdictionRequest as s, type GeofenceRuleType as t, type GeofenceAction as u, type GeofenceRule as v, type CreateGeofenceRuleRequest as w, type UpdateGeofenceRuleRequest as x, type UpdateDeviceTrustRequest as y, type GeolocationRecord as z };
1011
+ export { type WiFiNetwork as $, type AlertStatus as A, type GeofenceAction as B, type CipherTextOptions as C, type DeviceFingerprintRequest as D, type GeofenceRule as E, type CreateGeofenceRuleRequest as F, GeolocationClient as G, type UpdateGeofenceRuleRequest as H, type UpdateDeviceTrustRequest as I, type JurisdictionConfig as J, type GeolocationRecord as K, type LocationVerification as L, type APIError as M, type GeolocationConfigResponse as N, type GeolocationClientConfig as O, type UseAlertsOptions as P, type UseAlertsResult as Q, type LocationRequestStatus as R, type LocationRequestChannel as S, type LocationRequest as T, type UseGeolocationOptions as U, type ValidateCipherTextRequest as V, type CreateLocationRequestRequest as W, type LocationRequestResult as X, type LocationRequestFilters as Y, type LocationRequestListResponse as Z, type ResendLocationRequestRequest as _, type UseGeolocationResult as a, type LocationCaptureRequest as a0, type LocationShareInfo as a1, type LocationCaptureResponse as a2, type UseLocationRequestsOptions as b, type UseLocationRequestsResult as c, type UseLocationCaptureOptions as d, type UseLocationCaptureResult as e, type CipherTextResult as f, type CipherTextPayload as g, type CipherTextReason as h, type DecryptedCipherText as i, type CipherTextCustomerData as j, type ValidateCipherTextResponse as k, type VerifyIPRequest as l, type GeoIPResult as m, type GeofenceEvaluation as n, type DeviceFingerprint as o, type DeviceTrustResult as p, type ComplianceCheckResponse as q, type AlertSeverity as r, type AlertType as s, type GeolocationAlert as t, type AlertFilters as u, type AlertListResponse as v, type DashboardMetrics as w, type CreateJurisdictionRequest as x, type UpdateJurisdictionRequest as y, type GeofenceRuleType as z };
@@ -235,4 +235,4 @@ declare abstract class BaseClient {
235
235
  }>;
236
236
  }
237
237
 
238
- export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type RequestInterceptor as a, type BaseClientConfig as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
238
+ export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, type RequestInterceptor as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
@@ -235,4 +235,4 @@ declare abstract class BaseClient {
235
235
  }>;
236
236
  }
237
237
 
238
- export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type RequestInterceptor as a, type BaseClientConfig as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
238
+ export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, type RequestInterceptor as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
@@ -1,9 +1,9 @@
1
- import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-DKqyESgT.mjs';
2
- export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-DKqyESgT.mjs';
1
+ import { D as DeviceFingerprintRequest, L as LocationVerification, T as LocationRequest, G as GeolocationClient, Y as LocationRequestFilters, Z as LocationRequestListResponse } from '../client-BZxzOidG.mjs';
2
+ export { W as CreateLocationRequestRequest, a0 as LocationCaptureRequest, a2 as LocationCaptureResponse, S as LocationRequestChannel, X as LocationRequestResult, R as LocationRequestStatus, a1 as LocationShareInfo, _ as ResendLocationRequestRequest } from '../client-BZxzOidG.mjs';
3
3
  import { RiskProfileClient } from '../risk-profile/index.mjs';
4
- import { V as VesantConfig, R as RequestOptions } from '../client-BQRONu8q.mjs';
5
- import { C as CustomerProfile } from '../types-_hsTA3Ez.mjs';
6
- import { E as EntityType, P as PaginationParams } from '../types-B1OzEQR3.mjs';
4
+ import { V as VesantConfig, R as RequestOptions } from '../client-CIon-bGS.mjs';
5
+ import { C as CustomerProfile } from '../types-1RzYeSal.mjs';
6
+ import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.mjs';
7
7
 
8
8
  interface RegistrationVerificationRequest {
9
9
  customerId: string;
@@ -1,9 +1,9 @@
1
- import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-3cBb_Pp-.js';
2
- export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-3cBb_Pp-.js';
1
+ import { D as DeviceFingerprintRequest, L as LocationVerification, T as LocationRequest, G as GeolocationClient, Y as LocationRequestFilters, Z as LocationRequestListResponse } from '../client-B8pFrXx_.js';
2
+ export { W as CreateLocationRequestRequest, a0 as LocationCaptureRequest, a2 as LocationCaptureResponse, S as LocationRequestChannel, X as LocationRequestResult, R as LocationRequestStatus, a1 as LocationShareInfo, _ as ResendLocationRequestRequest } from '../client-B8pFrXx_.js';
3
3
  import { RiskProfileClient } from '../risk-profile/index.js';
4
- import { V as VesantConfig, R as RequestOptions } from '../client-BQRONu8q.js';
5
- import { C as CustomerProfile } from '../types-BnL66DB3.js';
6
- import { E as EntityType, P as PaginationParams } from '../types-B1OzEQR3.js';
4
+ import { V as VesantConfig, R as RequestOptions } from '../client-CIon-bGS.js';
5
+ import { C as CustomerProfile } from '../types-X5Md_dD_.js';
6
+ import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.js';
7
7
 
8
8
  interface RegistrationVerificationRequest {
9
9
  customerId: string;
@@ -224,7 +224,7 @@ function createConsoleLogger() {
224
224
  }
225
225
 
226
226
  // src/core/version.ts
227
- var SDK_VERSION = "1.5.0";
227
+ var SDK_VERSION = "1.5.2";
228
228
 
229
229
  // src/shared/browser-utils.ts
230
230
  function generateUUID() {
@@ -512,6 +512,8 @@ var BaseClient = class {
512
512
  return new VesantError(message, "FORBIDDEN", 403);
513
513
  case 404:
514
514
  return new VesantError(message, "NOT_FOUND", 404);
515
+ case 409:
516
+ return new VesantError(message, "DUPLICATE_PROFILE", 409);
515
517
  case 429: {
516
518
  const retryAfter = data.retry_after || data.retryAfter;
517
519
  return new RateLimitError(retryAfter);