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
@@ -224,7 +224,7 @@ function createConsoleLogger() {
224
224
  }
225
225
 
226
226
  // src/core/version.ts
227
- var SDK_VERSION = "1.4.1";
227
+ var SDK_VERSION = "1.4.4";
228
228
 
229
229
  // src/shared/browser-utils.ts
230
230
  function generateUUID() {
@@ -1250,16 +1250,19 @@ var RiskProfileClient = class extends BaseClient {
1250
1250
  * ```
1251
1251
  */
1252
1252
  async getProfile(customerId, requestOptions) {
1253
- const response = await this.queryProfiles({
1254
- search: customerId,
1255
- page: 1,
1256
- page_size: 10
1257
- }, requestOptions);
1258
- const profile = response.data.find((p) => p.customer_id === customerId);
1259
- if (!profile) {
1260
- throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1253
+ try {
1254
+ return await this.request(
1255
+ `/api/v1/profiles?customer_id=${encodeURIComponent(customerId)}`,
1256
+ void 0,
1257
+ void 0,
1258
+ requestOptions
1259
+ );
1260
+ } catch (error) {
1261
+ if (error instanceof CGSError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
1262
+ throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1263
+ }
1264
+ throw error;
1261
1265
  }
1262
- return profile;
1263
1266
  }
1264
1267
  /**
1265
1268
  * Update customer profile
@@ -1312,18 +1315,6 @@ var RiskProfileClient = class extends BaseClient {
1312
1315
  throw error;
1313
1316
  }
1314
1317
  }
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
1318
  };
1328
1319
 
1329
1320
  // src/compliance/types.ts
@@ -1360,6 +1351,7 @@ var ComplianceClient = class {
1360
1351
  autoCreateProfiles: config.autoCreateProfiles !== false,
1361
1352
  // default true
1362
1353
  syncMode: config.syncMode || "sync",
1354
+ environment: config.environment,
1363
1355
  interceptors,
1364
1356
  logger: this.logger
1365
1357
  };
@@ -1370,7 +1362,8 @@ var ComplianceClient = class {
1370
1362
  headers: this.config.headers,
1371
1363
  timeout: this.config.timeout,
1372
1364
  debug: this.config.debug,
1373
- logger: this.logger
1365
+ logger: this.logger,
1366
+ environment: this.config.environment
1374
1367
  });
1375
1368
  this.riskClient = new RiskProfileClient({
1376
1369
  baseURL: this.config.baseURL,
@@ -1380,7 +1373,8 @@ var ComplianceClient = class {
1380
1373
  timeout: this.config.timeout,
1381
1374
  debug: this.config.debug,
1382
1375
  interceptors,
1383
- logger: this.logger
1376
+ logger: this.logger,
1377
+ environment: this.config.environment
1384
1378
  });
1385
1379
  this.currencyRates = DEFAULT_CURRENCY_RATES;
1386
1380
  }