vesant-sdk 1.4.3 → 1.4.5
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/compliance/index.js +25 -23
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +25 -23
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +13 -2
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +13 -2
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.js +13 -2
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +13 -2
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -23
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.js +13 -2
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +13 -2
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.js +13 -2
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +13 -2
- package/dist/kyc/index.mjs.map +1 -1
- 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 +0 -4
- package/dist/risk-profile/index.d.ts +0 -4
- package/dist/risk-profile/index.js +25 -23
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +25 -23
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +13 -2
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +13 -2
- package/dist/scores/index.mjs.map +1 -1
- 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.5";
|
|
226
226
|
|
|
227
227
|
// src/shared/browser-utils.ts
|
|
228
228
|
function generateUUID() {
|
|
@@ -306,9 +306,20 @@ var BaseClient = class {
|
|
|
306
306
|
}
|
|
307
307
|
this.interceptors = config.interceptors || [];
|
|
308
308
|
this.logger = config.logger || createConsoleLogger();
|
|
309
|
+
let environment = config.environment;
|
|
310
|
+
const apiKey = config.apiKey || "";
|
|
311
|
+
if (apiKey.startsWith("pk_test_")) {
|
|
312
|
+
if (environment === "production") {
|
|
313
|
+
this.logger.warn('Sandbox API key (pk_test_*) used with environment: "production" \u2014 overriding to "sandbox"');
|
|
314
|
+
}
|
|
315
|
+
environment = "sandbox";
|
|
316
|
+
} else if (apiKey.startsWith("pk_live_") && environment === "sandbox") {
|
|
317
|
+
this.logger.warn('Production API key (pk_live_*) used with environment: "sandbox" \u2014 the X-Sandbox header will be sent for backward compatibility');
|
|
318
|
+
}
|
|
309
319
|
this.config = {
|
|
310
320
|
...config,
|
|
311
|
-
apiKey
|
|
321
|
+
apiKey,
|
|
322
|
+
environment,
|
|
312
323
|
headers: config.headers || {},
|
|
313
324
|
timeout: config.timeout || 1e4,
|
|
314
325
|
retries: config.retries || 3,
|
|
@@ -1248,16 +1259,19 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1248
1259
|
* ```
|
|
1249
1260
|
*/
|
|
1250
1261
|
async getProfile(customerId, requestOptions) {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1262
|
+
try {
|
|
1263
|
+
return await this.request(
|
|
1264
|
+
`/api/v1/profiles?customer_id=${encodeURIComponent(customerId)}`,
|
|
1265
|
+
void 0,
|
|
1266
|
+
void 0,
|
|
1267
|
+
requestOptions
|
|
1268
|
+
);
|
|
1269
|
+
} catch (error) {
|
|
1270
|
+
if (error instanceof CGSError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
|
|
1271
|
+
throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
|
|
1272
|
+
}
|
|
1273
|
+
throw error;
|
|
1259
1274
|
}
|
|
1260
|
-
return profile;
|
|
1261
1275
|
}
|
|
1262
1276
|
/**
|
|
1263
1277
|
* Update customer profile
|
|
@@ -1310,18 +1324,6 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1310
1324
|
throw error;
|
|
1311
1325
|
}
|
|
1312
1326
|
}
|
|
1313
|
-
/**
|
|
1314
|
-
* Query profiles with filters (internal helper for getProfile)
|
|
1315
|
-
*/
|
|
1316
|
-
async queryProfiles(filters = {}, requestOptions) {
|
|
1317
|
-
const queryString = this.buildQueryString(filters);
|
|
1318
|
-
return this.request(
|
|
1319
|
-
`/api/v1/risk-dashboard/profiles${queryString}`,
|
|
1320
|
-
void 0,
|
|
1321
|
-
void 0,
|
|
1322
|
-
requestOptions
|
|
1323
|
-
);
|
|
1324
|
-
}
|
|
1325
1327
|
};
|
|
1326
1328
|
|
|
1327
1329
|
// src/compliance/types.ts
|