vesant-sdk 1.4.1 → 1.4.3
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.
- package/dist/{client-DoczGA6L.d.ts → client-BlAt791q.d.ts} +12 -1
- package/dist/{client-DzElM7u-.d.mts → client-CY41e2Z_.d.mts} +4 -8
- package/dist/{client-DzElM7u-.d.ts → client-CY41e2Z_.d.ts} +4 -8
- package/dist/{client-B6fUFAUM.d.mts → client-oo_3-0YW.d.mts} +12 -1
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +39 -18
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +39 -18
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +1 -1
- package/dist/decisions/index.d.ts +1 -1
- package/dist/decisions/index.js +2 -10
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +2 -10
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +3 -3
- package/dist/geolocation/index.d.ts +3 -3
- package/dist/geolocation/index.js +34 -16
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +34 -16
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +41 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -19
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +4 -11
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +4 -11
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +3 -1
- package/dist/kyc/index.d.ts +3 -1
- package/dist/kyc/index.js +4 -11
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +4 -11
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +1 -1
- package/dist/risk-profile/index.d.ts +1 -1
- package/dist/risk-profile/index.js +2 -10
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +2 -10
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +1 -1
- package/dist/scores/index.d.ts +1 -1
- package/dist/scores/index.js +2 -10
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +2 -10
- package/dist/scores/index.mjs.map +1 -1
- package/dist/webhooks/index.d.mts +1 -0
- package/dist/webhooks/index.d.ts +1 -0
- 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.
|
|
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
|
|
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
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
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 },
|
|
@@ -1340,6 +1358,7 @@ var ComplianceClient = class {
|
|
|
1340
1358
|
autoCreateProfiles: config.autoCreateProfiles !== false,
|
|
1341
1359
|
// default true
|
|
1342
1360
|
syncMode: config.syncMode || "sync",
|
|
1361
|
+
environment: config.environment,
|
|
1343
1362
|
interceptors,
|
|
1344
1363
|
logger: this.logger
|
|
1345
1364
|
};
|
|
@@ -1350,7 +1369,8 @@ var ComplianceClient = class {
|
|
|
1350
1369
|
headers: this.config.headers,
|
|
1351
1370
|
timeout: this.config.timeout,
|
|
1352
1371
|
debug: this.config.debug,
|
|
1353
|
-
logger: this.logger
|
|
1372
|
+
logger: this.logger,
|
|
1373
|
+
environment: this.config.environment
|
|
1354
1374
|
});
|
|
1355
1375
|
this.riskClient = new RiskProfileClient({
|
|
1356
1376
|
baseURL: this.config.baseURL,
|
|
@@ -1360,7 +1380,8 @@ var ComplianceClient = class {
|
|
|
1360
1380
|
timeout: this.config.timeout,
|
|
1361
1381
|
debug: this.config.debug,
|
|
1362
1382
|
interceptors,
|
|
1363
|
-
logger: this.logger
|
|
1383
|
+
logger: this.logger,
|
|
1384
|
+
environment: this.config.environment
|
|
1364
1385
|
});
|
|
1365
1386
|
this.currencyRates = DEFAULT_CURRENCY_RATES;
|
|
1366
1387
|
}
|