vesant-sdk 1.6.4 → 1.6.6

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 (51) hide show
  1. package/dist/compliance/index.js +24 -2
  2. package/dist/compliance/index.js.map +1 -1
  3. package/dist/compliance/index.mjs +24 -2
  4. package/dist/compliance/index.mjs.map +1 -1
  5. package/dist/decisions/index.js +1 -1
  6. package/dist/decisions/index.js.map +1 -1
  7. package/dist/decisions/index.mjs +1 -1
  8. package/dist/decisions/index.mjs.map +1 -1
  9. package/dist/fraud/index.js +1 -1
  10. package/dist/fraud/index.js.map +1 -1
  11. package/dist/fraud/index.mjs +1 -1
  12. package/dist/fraud/index.mjs.map +1 -1
  13. package/dist/geolocation/index.js +21 -2
  14. package/dist/geolocation/index.js.map +1 -1
  15. package/dist/geolocation/index.mjs +21 -2
  16. package/dist/geolocation/index.mjs.map +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +29 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +29 -2
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/kyc/core.js +1 -1
  24. package/dist/kyc/core.js.map +1 -1
  25. package/dist/kyc/core.mjs +1 -1
  26. package/dist/kyc/core.mjs.map +1 -1
  27. package/dist/kyc/index.d.mts +1 -1
  28. package/dist/kyc/index.d.ts +1 -1
  29. package/dist/kyc/index.js +1 -1
  30. package/dist/kyc/index.js.map +1 -1
  31. package/dist/kyc/index.mjs +1 -1
  32. package/dist/kyc/index.mjs.map +1 -1
  33. package/dist/react.js +1 -1
  34. package/dist/react.js.map +1 -1
  35. package/dist/react.mjs +1 -1
  36. package/dist/react.mjs.map +1 -1
  37. package/dist/risk-profile/index.js +1 -1
  38. package/dist/risk-profile/index.js.map +1 -1
  39. package/dist/risk-profile/index.mjs +1 -1
  40. package/dist/risk-profile/index.mjs.map +1 -1
  41. package/dist/scores/index.js +1 -1
  42. package/dist/scores/index.js.map +1 -1
  43. package/dist/scores/index.mjs +1 -1
  44. package/dist/scores/index.mjs.map +1 -1
  45. package/dist/tax/index.d.mts +6 -1
  46. package/dist/tax/index.d.ts +6 -1
  47. package/dist/tax/index.js +6 -1
  48. package/dist/tax/index.js.map +1 -1
  49. package/dist/tax/index.mjs +6 -1
  50. package/dist/tax/index.mjs.map +1 -1
  51. package/package.json +1 -1
@@ -222,7 +222,7 @@ function createConsoleLogger() {
222
222
  }
223
223
 
224
224
  // src/core/version.ts
225
- var SDK_VERSION = "1.6.4";
225
+ var SDK_VERSION = "1.6.6";
226
226
 
227
227
  // src/shared/browser-utils.ts
228
228
  function generateUUID() {
@@ -845,9 +845,10 @@ var GeolocationClient = class extends BaseClient {
845
845
  if (!request.ip_address?.trim()) {
846
846
  throw new ValidationError("ip_address is required and must be a non-empty string", ["ip_address"]);
847
847
  }
848
+ const enrichedRequest = request.device_fingerprint ? request : { ...request, device_fingerprint: collectDeviceFingerprint() };
848
849
  return this.requestWithRetry("/api/v1/geo/verify", {
849
850
  method: "POST",
850
- body: JSON.stringify(request)
851
+ body: JSON.stringify(enrichedRequest)
851
852
  }, void 0, void 0, requestOptions);
852
853
  }
853
854
  /**
@@ -1251,6 +1252,24 @@ var GeolocationClient = class extends BaseClient {
1251
1252
  // Utility Methods (inherited from BaseClient: healthCheck, updateConfig, getConfig, buildQueryString)
1252
1253
  // ============================================================================
1253
1254
  };
1255
+ function collectDeviceFingerprint() {
1256
+ const deviceId = generateDeviceId();
1257
+ const browserInfo = getBrowserInfo();
1258
+ const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "server";
1259
+ const platform = typeof navigator !== "undefined" ? navigator.platform || "unknown" : "server";
1260
+ return {
1261
+ device_id: deviceId,
1262
+ user_agent: userAgent,
1263
+ platform,
1264
+ browser: browserInfo.browser,
1265
+ browser_version: browserInfo.browser_version,
1266
+ os: browserInfo.os,
1267
+ os_version: browserInfo.os_version,
1268
+ screen_resolution: typeof screen !== "undefined" ? `${screen.width}x${screen.height}` : void 0,
1269
+ language: typeof navigator !== "undefined" ? navigator.language : void 0,
1270
+ timezone: Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone
1271
+ };
1272
+ }
1254
1273
 
1255
1274
  // src/risk-profile/client.ts
1256
1275
  var RiskProfileClient = class extends BaseClient {
@@ -1571,6 +1590,9 @@ var ComplianceClient = class {
1571
1590
  message: error instanceof Error ? error.message : "Unknown error"
1572
1591
  });
1573
1592
  }
1593
+ if (error instanceof VesantError && error.code === "DUPLICATE_PROFILE") {
1594
+ throw error;
1595
+ }
1574
1596
  throw new ComplianceError(
1575
1597
  "Registration verification failed",
1576
1598
  error instanceof Error ? error.message : void 0,