vesant-sdk 1.4.0 → 1.4.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 (61) hide show
  1. package/dist/{client-DoczGA6L.d.ts → client-BlAt791q.d.ts} +12 -1
  2. package/dist/{client-DzElM7u-.d.mts → client-CY41e2Z_.d.mts} +4 -8
  3. package/dist/{client-DzElM7u-.d.ts → client-CY41e2Z_.d.ts} +4 -8
  4. package/dist/{client-B6fUFAUM.d.mts → client-oo_3-0YW.d.mts} +12 -1
  5. package/dist/compliance/index.d.mts +3 -3
  6. package/dist/compliance/index.d.ts +3 -3
  7. package/dist/compliance/index.js +34 -16
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +34 -16
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/decisions/index.d.mts +1 -1
  12. package/dist/decisions/index.d.ts +1 -1
  13. package/dist/decisions/index.js +2 -10
  14. package/dist/decisions/index.js.map +1 -1
  15. package/dist/decisions/index.mjs +2 -10
  16. package/dist/decisions/index.mjs.map +1 -1
  17. package/dist/geolocation/index.d.mts +3 -3
  18. package/dist/geolocation/index.d.ts +3 -3
  19. package/dist/geolocation/index.js +34 -16
  20. package/dist/geolocation/index.js.map +1 -1
  21. package/dist/geolocation/index.mjs +34 -16
  22. package/dist/geolocation/index.mjs.map +1 -1
  23. package/dist/index.d.mts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +36 -17
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +36 -17
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/kyc/core.d.mts +1 -1
  30. package/dist/kyc/core.d.ts +1 -1
  31. package/dist/kyc/core.js +4 -11
  32. package/dist/kyc/core.js.map +1 -1
  33. package/dist/kyc/core.mjs +4 -11
  34. package/dist/kyc/core.mjs.map +1 -1
  35. package/dist/kyc/index.d.mts +3 -1
  36. package/dist/kyc/index.d.ts +3 -1
  37. package/dist/kyc/index.js +4 -11
  38. package/dist/kyc/index.js.map +1 -1
  39. package/dist/kyc/index.mjs +4 -11
  40. package/dist/kyc/index.mjs.map +1 -1
  41. package/dist/react.d.mts +2 -2
  42. package/dist/react.d.ts +2 -2
  43. package/dist/react.js +1 -1
  44. package/dist/react.js.map +1 -1
  45. package/dist/react.mjs +1 -1
  46. package/dist/react.mjs.map +1 -1
  47. package/dist/risk-profile/index.d.mts +1 -1
  48. package/dist/risk-profile/index.d.ts +1 -1
  49. package/dist/risk-profile/index.js +2 -10
  50. package/dist/risk-profile/index.js.map +1 -1
  51. package/dist/risk-profile/index.mjs +2 -10
  52. package/dist/risk-profile/index.mjs.map +1 -1
  53. package/dist/scores/index.d.mts +1 -1
  54. package/dist/scores/index.d.ts +1 -1
  55. package/dist/scores/index.js +2 -10
  56. package/dist/scores/index.js.map +1 -1
  57. package/dist/scores/index.mjs +2 -10
  58. package/dist/scores/index.mjs.map +1 -1
  59. package/dist/webhooks/index.d.mts +1 -0
  60. package/dist/webhooks/index.d.ts +1 -0
  61. 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.4.0";
225
+ var SDK_VERSION = "1.4.1";
226
226
 
227
227
  // src/shared/browser-utils.ts
228
228
  function generateUUID() {
@@ -316,12 +316,6 @@ var BaseClient = class {
316
316
  interceptors: this.interceptors,
317
317
  logger: this.logger
318
318
  };
319
- if (this.config.environment === "sandbox" && this.config.apiKey?.startsWith("pk_live_")) {
320
- this.logger.warn("Production API key used with sandbox environment. Use your sandbox API key (sk_sandbox_) instead.");
321
- }
322
- if (this.config.environment !== "sandbox" && this.config.apiKey?.startsWith("sk_sandbox_")) {
323
- this.logger.warn("Sandbox API key used with production environment. Use your production API key (pk_live_) instead.");
324
- }
325
319
  if (config.circuitBreaker) {
326
320
  this.circuitBreaker = new CircuitBreaker(config.circuitBreaker);
327
321
  }
@@ -345,9 +339,7 @@ var BaseClient = class {
345
339
  error.requestId = requestId;
346
340
  throw error;
347
341
  }
348
- const DEFAULT_SANDBOX_URL = "https://sandbox-api.vesant.ai";
349
- const resolvedBaseURL = this.config.environment === "sandbox" ? this.config.sandboxBaseURL || DEFAULT_SANDBOX_URL : serviceURL || this.config.baseURL;
350
- const url = `${serviceURL || resolvedBaseURL}${endpoint}`;
342
+ const url = `${serviceURL || this.config.baseURL}${endpoint}`;
351
343
  const headers = {
352
344
  "Content-Type": "application/json",
353
345
  "X-Tenant-ID": this.config.tenantId,
@@ -792,7 +784,8 @@ var GeolocationClient = class extends BaseClient {
792
784
  retries: 3,
793
785
  // Default retry count for geolocation calls
794
786
  debug: config.debug,
795
- logger: config.logger
787
+ logger: config.logger,
788
+ environment: config.environment
796
789
  };
797
790
  super(baseConfig);
798
791
  }
@@ -886,6 +879,32 @@ var GeolocationClient = class extends BaseClient {
886
879
  }
887
880
  return config;
888
881
  }
882
+ /**
883
+ * Fetch the signing key from the dedicated authenticated endpoint.
884
+ *
885
+ * Falls back to getGPSConfig() for backward compatibility with older servers
886
+ * that don't expose `/api/v1/geo/signing-key`.
887
+ *
888
+ * @returns The signing key string, or undefined if unavailable
889
+ */
890
+ async fetchSigningKey(requestOptions) {
891
+ try {
892
+ const response = await this.requestWithRetry(
893
+ "/api/v1/geo/signing-key",
894
+ void 0,
895
+ void 0,
896
+ void 0,
897
+ requestOptions
898
+ );
899
+ if (response.signing_key) {
900
+ this.cachedSigningKey = response.signing_key;
901
+ return response.signing_key;
902
+ }
903
+ } catch {
904
+ }
905
+ const config = await this.getGPSConfig(requestOptions);
906
+ return config.signing_key;
907
+ }
889
908
  // ============================================================================
890
909
  // CipherText Validation
891
910
  // ============================================================================
@@ -1166,11 +1185,10 @@ var GeolocationClient = class extends BaseClient {
1166
1185
  let signingKey = this.cachedSigningKey;
1167
1186
  let resolvedGpsConfig = gpsConfig;
1168
1187
  if (!signingKey) {
1169
- const config = await this.getGPSConfig();
1170
- signingKey = config.signing_key;
1171
- if (!resolvedGpsConfig) {
1172
- resolvedGpsConfig = config;
1173
- }
1188
+ signingKey = await this.fetchSigningKey();
1189
+ }
1190
+ if (!resolvedGpsConfig) {
1191
+ resolvedGpsConfig = await this.getGPSConfig();
1174
1192
  }
1175
1193
  return generateCipherText(
1176
1194
  { ...options, signingKey: signingKey || void 0 },