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
package/dist/index.js
CHANGED
|
@@ -241,7 +241,7 @@ var noopLogger = {
|
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
// src/core/version.ts
|
|
244
|
-
var SDK_VERSION = "1.4.
|
|
244
|
+
var SDK_VERSION = "1.4.1";
|
|
245
245
|
|
|
246
246
|
// src/shared/browser-utils.ts
|
|
247
247
|
function generateUUID() {
|
|
@@ -335,12 +335,6 @@ var BaseClient = class {
|
|
|
335
335
|
interceptors: this.interceptors,
|
|
336
336
|
logger: this.logger
|
|
337
337
|
};
|
|
338
|
-
if (this.config.environment === "sandbox" && this.config.apiKey?.startsWith("pk_live_")) {
|
|
339
|
-
this.logger.warn("Production API key used with sandbox environment. Use your sandbox API key (sk_sandbox_) instead.");
|
|
340
|
-
}
|
|
341
|
-
if (this.config.environment !== "sandbox" && this.config.apiKey?.startsWith("sk_sandbox_")) {
|
|
342
|
-
this.logger.warn("Sandbox API key used with production environment. Use your production API key (pk_live_) instead.");
|
|
343
|
-
}
|
|
344
338
|
if (config.circuitBreaker) {
|
|
345
339
|
this.circuitBreaker = new CircuitBreaker(config.circuitBreaker);
|
|
346
340
|
}
|
|
@@ -364,9 +358,7 @@ var BaseClient = class {
|
|
|
364
358
|
error.requestId = requestId;
|
|
365
359
|
throw error;
|
|
366
360
|
}
|
|
367
|
-
const
|
|
368
|
-
const resolvedBaseURL = this.config.environment === "sandbox" ? this.config.sandboxBaseURL || DEFAULT_SANDBOX_URL : serviceURL || this.config.baseURL;
|
|
369
|
-
const url = `${serviceURL || resolvedBaseURL}${endpoint}`;
|
|
361
|
+
const url = `${serviceURL || this.config.baseURL}${endpoint}`;
|
|
370
362
|
const headers = {
|
|
371
363
|
"Content-Type": "application/json",
|
|
372
364
|
"X-Tenant-ID": this.config.tenantId,
|
|
@@ -878,7 +870,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
878
870
|
retries: 3,
|
|
879
871
|
// Default retry count for geolocation calls
|
|
880
872
|
debug: config.debug,
|
|
881
|
-
logger: config.logger
|
|
873
|
+
logger: config.logger,
|
|
874
|
+
environment: config.environment
|
|
882
875
|
};
|
|
883
876
|
super(baseConfig);
|
|
884
877
|
}
|
|
@@ -972,6 +965,32 @@ var GeolocationClient = class extends BaseClient {
|
|
|
972
965
|
}
|
|
973
966
|
return config;
|
|
974
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Fetch the signing key from the dedicated authenticated endpoint.
|
|
970
|
+
*
|
|
971
|
+
* Falls back to getGPSConfig() for backward compatibility with older servers
|
|
972
|
+
* that don't expose `/api/v1/geo/signing-key`.
|
|
973
|
+
*
|
|
974
|
+
* @returns The signing key string, or undefined if unavailable
|
|
975
|
+
*/
|
|
976
|
+
async fetchSigningKey(requestOptions) {
|
|
977
|
+
try {
|
|
978
|
+
const response = await this.requestWithRetry(
|
|
979
|
+
"/api/v1/geo/signing-key",
|
|
980
|
+
void 0,
|
|
981
|
+
void 0,
|
|
982
|
+
void 0,
|
|
983
|
+
requestOptions
|
|
984
|
+
);
|
|
985
|
+
if (response.signing_key) {
|
|
986
|
+
this.cachedSigningKey = response.signing_key;
|
|
987
|
+
return response.signing_key;
|
|
988
|
+
}
|
|
989
|
+
} catch {
|
|
990
|
+
}
|
|
991
|
+
const config = await this.getGPSConfig(requestOptions);
|
|
992
|
+
return config.signing_key;
|
|
993
|
+
}
|
|
975
994
|
// ============================================================================
|
|
976
995
|
// CipherText Validation
|
|
977
996
|
// ============================================================================
|
|
@@ -1252,11 +1271,10 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1252
1271
|
let signingKey = this.cachedSigningKey;
|
|
1253
1272
|
let resolvedGpsConfig = gpsConfig;
|
|
1254
1273
|
if (!signingKey) {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
}
|
|
1274
|
+
signingKey = await this.fetchSigningKey();
|
|
1275
|
+
}
|
|
1276
|
+
if (!resolvedGpsConfig) {
|
|
1277
|
+
resolvedGpsConfig = await this.getGPSConfig();
|
|
1260
1278
|
}
|
|
1261
1279
|
return generateCipherText(
|
|
1262
1280
|
{ ...options, signingKey: signingKey || void 0 },
|
|
@@ -1426,6 +1444,7 @@ var ComplianceClient = class {
|
|
|
1426
1444
|
autoCreateProfiles: config.autoCreateProfiles !== false,
|
|
1427
1445
|
// default true
|
|
1428
1446
|
syncMode: config.syncMode || "sync",
|
|
1447
|
+
environment: config.environment,
|
|
1429
1448
|
interceptors,
|
|
1430
1449
|
logger: this.logger
|
|
1431
1450
|
};
|
|
@@ -1436,7 +1455,8 @@ var ComplianceClient = class {
|
|
|
1436
1455
|
headers: this.config.headers,
|
|
1437
1456
|
timeout: this.config.timeout,
|
|
1438
1457
|
debug: this.config.debug,
|
|
1439
|
-
logger: this.logger
|
|
1458
|
+
logger: this.logger,
|
|
1459
|
+
environment: this.config.environment
|
|
1440
1460
|
});
|
|
1441
1461
|
this.riskClient = new RiskProfileClient({
|
|
1442
1462
|
baseURL: this.config.baseURL,
|
|
@@ -1446,7 +1466,8 @@ var ComplianceClient = class {
|
|
|
1446
1466
|
timeout: this.config.timeout,
|
|
1447
1467
|
debug: this.config.debug,
|
|
1448
1468
|
interceptors,
|
|
1449
|
-
logger: this.logger
|
|
1469
|
+
logger: this.logger,
|
|
1470
|
+
environment: this.config.environment
|
|
1450
1471
|
});
|
|
1451
1472
|
this.currencyRates = DEFAULT_CURRENCY_RATES;
|
|
1452
1473
|
}
|
|
@@ -2256,7 +2277,8 @@ var KycClient = class extends BaseClient {
|
|
|
2256
2277
|
timeout: config.timeout,
|
|
2257
2278
|
retries: 3,
|
|
2258
2279
|
// Default retry count for KYC calls
|
|
2259
|
-
debug: config.debug
|
|
2280
|
+
debug: config.debug,
|
|
2281
|
+
environment: config.environment
|
|
2260
2282
|
};
|
|
2261
2283
|
super(baseConfig);
|
|
2262
2284
|
this.userId = config.userId;
|