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
package/dist/index.mjs CHANGED
@@ -240,7 +240,7 @@ var noopLogger = {
240
240
  };
241
241
 
242
242
  // src/core/version.ts
243
- var SDK_VERSION = "1.6.4";
243
+ var SDK_VERSION = "1.6.6";
244
244
 
245
245
  // src/shared/browser-utils.ts
246
246
  function generateUUID() {
@@ -930,9 +930,10 @@ var GeolocationClient = class extends BaseClient {
930
930
  if (!request.ip_address?.trim()) {
931
931
  throw new ValidationError("ip_address is required and must be a non-empty string", ["ip_address"]);
932
932
  }
933
+ const enrichedRequest = request.device_fingerprint ? request : { ...request, device_fingerprint: collectDeviceFingerprint() };
933
934
  return this.requestWithRetry("/api/v1/geo/verify", {
934
935
  method: "POST",
935
- body: JSON.stringify(request)
936
+ body: JSON.stringify(enrichedRequest)
936
937
  }, void 0, void 0, requestOptions);
937
938
  }
938
939
  /**
@@ -1336,6 +1337,24 @@ var GeolocationClient = class extends BaseClient {
1336
1337
  // Utility Methods (inherited from BaseClient: healthCheck, updateConfig, getConfig, buildQueryString)
1337
1338
  // ============================================================================
1338
1339
  };
1340
+ function collectDeviceFingerprint() {
1341
+ const deviceId = generateDeviceId();
1342
+ const browserInfo = getBrowserInfo();
1343
+ const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "server";
1344
+ const platform = typeof navigator !== "undefined" ? navigator.platform || "unknown" : "server";
1345
+ return {
1346
+ device_id: deviceId,
1347
+ user_agent: userAgent,
1348
+ platform,
1349
+ browser: browserInfo.browser,
1350
+ browser_version: browserInfo.browser_version,
1351
+ os: browserInfo.os,
1352
+ os_version: browserInfo.os_version,
1353
+ screen_resolution: typeof screen !== "undefined" ? `${screen.width}x${screen.height}` : void 0,
1354
+ language: typeof navigator !== "undefined" ? navigator.language : void 0,
1355
+ timezone: Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone
1356
+ };
1357
+ }
1339
1358
 
1340
1359
  // src/risk-profile/client.ts
1341
1360
  var RiskProfileClient = class extends BaseClient {
@@ -1656,6 +1675,9 @@ var ComplianceClient = class {
1656
1675
  message: error instanceof Error ? error.message : "Unknown error"
1657
1676
  });
1658
1677
  }
1678
+ if (error instanceof VesantError && error.code === "DUPLICATE_PROFILE") {
1679
+ throw error;
1680
+ }
1659
1681
  throw new ComplianceError(
1660
1682
  "Registration verification failed",
1661
1683
  error instanceof Error ? error.message : void 0,
@@ -3189,6 +3211,11 @@ var TaxClient = class extends BaseClient {
3189
3211
  }
3190
3212
  );
3191
3213
  }
3214
+ async getCustomerDocuments(customerID) {
3215
+ return this.request(
3216
+ `/api/v1/tax/customer-tax-profiles/${customerID}/documents`
3217
+ );
3218
+ }
3192
3219
  async downloadTaxForm(customerID, requestOptions) {
3193
3220
  return this.request(
3194
3221
  `/api/v1/tax/customer-tax-profiles/${customerID}/download-form`,