vesant-sdk 1.4.3 → 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 +13 -22
  2. package/dist/compliance/index.js.map +1 -1
  3. package/dist/compliance/index.mjs +13 -22
  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 +13 -22
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +13 -22
  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
package/dist/index.mjs CHANGED
@@ -239,7 +239,7 @@ var noopLogger = {
239
239
  };
240
240
 
241
241
  // src/core/version.ts
242
- var SDK_VERSION = "1.4.1";
242
+ var SDK_VERSION = "1.4.4";
243
243
 
244
244
  // src/shared/browser-utils.ts
245
245
  function generateUUID() {
@@ -1332,16 +1332,19 @@ var RiskProfileClient = class extends BaseClient {
1332
1332
  * ```
1333
1333
  */
1334
1334
  async getProfile(customerId, requestOptions) {
1335
- const response = await this.queryProfiles({
1336
- search: customerId,
1337
- page: 1,
1338
- page_size: 10
1339
- }, requestOptions);
1340
- const profile = response.data.find((p) => p.customer_id === customerId);
1341
- if (!profile) {
1342
- throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1335
+ try {
1336
+ return await this.request(
1337
+ `/api/v1/profiles?customer_id=${encodeURIComponent(customerId)}`,
1338
+ void 0,
1339
+ void 0,
1340
+ requestOptions
1341
+ );
1342
+ } catch (error) {
1343
+ if (error instanceof CGSError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
1344
+ throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1345
+ }
1346
+ throw error;
1343
1347
  }
1344
- return profile;
1345
1348
  }
1346
1349
  /**
1347
1350
  * Update customer profile
@@ -1394,18 +1397,6 @@ var RiskProfileClient = class extends BaseClient {
1394
1397
  throw error;
1395
1398
  }
1396
1399
  }
1397
- /**
1398
- * Query profiles with filters (internal helper for getProfile)
1399
- */
1400
- async queryProfiles(filters = {}, requestOptions) {
1401
- const queryString = this.buildQueryString(filters);
1402
- return this.request(
1403
- `/api/v1/risk-dashboard/profiles${queryString}`,
1404
- void 0,
1405
- void 0,
1406
- requestOptions
1407
- );
1408
- }
1409
1400
  };
1410
1401
 
1411
1402
  // src/compliance/types.ts