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