vesant-sdk 1.4.2 → 1.4.4

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 (41) hide show
  1. package/dist/compliance/index.js +18 -24
  2. package/dist/compliance/index.js.map +1 -1
  3. package/dist/compliance/index.mjs +18 -24
  4. package/dist/compliance/index.mjs.map +1 -1
  5. package/dist/decisions/index.js +1 -1
  6. package/dist/decisions/index.js.map +1 -1
  7. package/dist/decisions/index.mjs +1 -1
  8. package/dist/decisions/index.mjs.map +1 -1
  9. package/dist/geolocation/index.js +1 -1
  10. package/dist/geolocation/index.js.map +1 -1
  11. package/dist/geolocation/index.mjs +1 -1
  12. package/dist/geolocation/index.mjs.map +1 -1
  13. package/dist/index.d.mts +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +18 -24
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +18 -24
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/kyc/core.js +1 -1
  20. package/dist/kyc/core.js.map +1 -1
  21. package/dist/kyc/core.mjs +1 -1
  22. package/dist/kyc/core.mjs.map +1 -1
  23. package/dist/kyc/index.js +1 -1
  24. package/dist/kyc/index.js.map +1 -1
  25. package/dist/kyc/index.mjs +1 -1
  26. package/dist/kyc/index.mjs.map +1 -1
  27. package/dist/react.js +1 -1
  28. package/dist/react.js.map +1 -1
  29. package/dist/react.mjs +1 -1
  30. package/dist/react.mjs.map +1 -1
  31. package/dist/risk-profile/index.d.mts +0 -4
  32. package/dist/risk-profile/index.d.ts +0 -4
  33. package/dist/risk-profile/index.js +13 -22
  34. package/dist/risk-profile/index.js.map +1 -1
  35. package/dist/risk-profile/index.mjs +13 -22
  36. package/dist/risk-profile/index.mjs.map +1 -1
  37. package/dist/scores/index.js +1 -1
  38. package/dist/scores/index.js.map +1 -1
  39. package/dist/scores/index.mjs +1 -1
  40. package/dist/scores/index.mjs.map +1 -1
  41. 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.1";
225
+ var SDK_VERSION = "1.4.4";
226
226
 
227
227
  // src/shared/browser-utils.ts
228
228
  function generateUUID() {
@@ -1248,16 +1248,19 @@ var RiskProfileClient = class extends BaseClient {
1248
1248
  * ```
1249
1249
  */
1250
1250
  async getProfile(customerId, requestOptions) {
1251
- const response = await this.queryProfiles({
1252
- search: customerId,
1253
- page: 1,
1254
- page_size: 10
1255
- }, requestOptions);
1256
- const profile = response.data.find((p) => p.customer_id === customerId);
1257
- if (!profile) {
1258
- throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1251
+ try {
1252
+ return await this.request(
1253
+ `/api/v1/profiles?customer_id=${encodeURIComponent(customerId)}`,
1254
+ void 0,
1255
+ void 0,
1256
+ requestOptions
1257
+ );
1258
+ } catch (error) {
1259
+ if (error instanceof CGSError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
1260
+ throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1261
+ }
1262
+ throw error;
1259
1263
  }
1260
- return profile;
1261
1264
  }
1262
1265
  /**
1263
1266
  * Update customer profile
@@ -1310,18 +1313,6 @@ var RiskProfileClient = class extends BaseClient {
1310
1313
  throw error;
1311
1314
  }
1312
1315
  }
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
1316
  };
1326
1317
 
1327
1318
  // src/compliance/types.ts
@@ -1358,6 +1349,7 @@ var ComplianceClient = class {
1358
1349
  autoCreateProfiles: config.autoCreateProfiles !== false,
1359
1350
  // default true
1360
1351
  syncMode: config.syncMode || "sync",
1352
+ environment: config.environment,
1361
1353
  interceptors,
1362
1354
  logger: this.logger
1363
1355
  };
@@ -1368,7 +1360,8 @@ var ComplianceClient = class {
1368
1360
  headers: this.config.headers,
1369
1361
  timeout: this.config.timeout,
1370
1362
  debug: this.config.debug,
1371
- logger: this.logger
1363
+ logger: this.logger,
1364
+ environment: this.config.environment
1372
1365
  });
1373
1366
  this.riskClient = new RiskProfileClient({
1374
1367
  baseURL: this.config.baseURL,
@@ -1378,7 +1371,8 @@ var ComplianceClient = class {
1378
1371
  timeout: this.config.timeout,
1379
1372
  debug: this.config.debug,
1380
1373
  interceptors,
1381
- logger: this.logger
1374
+ logger: this.logger,
1375
+ environment: this.config.environment
1382
1376
  });
1383
1377
  this.currencyRates = DEFAULT_CURRENCY_RATES;
1384
1378
  }