vesant-sdk 1.7.2 → 1.8.0-dev.31d63f0

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 (61) hide show
  1. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  2. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  3. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  4. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  5. package/dist/compliance/index.d.mts +2 -2
  6. package/dist/compliance/index.d.ts +2 -2
  7. package/dist/compliance/index.js +40 -2
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +40 -2
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/decisions/index.js +1 -1
  12. package/dist/decisions/index.js.map +1 -1
  13. package/dist/decisions/index.mjs +1 -1
  14. package/dist/decisions/index.mjs.map +1 -1
  15. package/dist/geolocation/index.d.mts +2 -2
  16. package/dist/geolocation/index.d.ts +2 -2
  17. package/dist/geolocation/index.js +40 -2
  18. package/dist/geolocation/index.js.map +1 -1
  19. package/dist/geolocation/index.mjs +40 -2
  20. package/dist/geolocation/index.mjs.map +1 -1
  21. package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
  22. package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
  23. package/dist/index.d.mts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +46 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +46 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/kyc/core.js +1 -1
  30. package/dist/kyc/core.js.map +1 -1
  31. package/dist/kyc/core.mjs +1 -1
  32. package/dist/kyc/core.mjs.map +1 -1
  33. package/dist/kyc/index.js +1 -1
  34. package/dist/kyc/index.js.map +1 -1
  35. package/dist/kyc/index.mjs +1 -1
  36. package/dist/kyc/index.mjs.map +1 -1
  37. package/dist/react.d.mts +9 -2
  38. package/dist/react.d.ts +9 -2
  39. package/dist/react.js +15 -10
  40. package/dist/react.js.map +1 -1
  41. package/dist/react.mjs +15 -10
  42. package/dist/react.mjs.map +1 -1
  43. package/dist/risk-profile/index.js +1 -1
  44. package/dist/risk-profile/index.js.map +1 -1
  45. package/dist/risk-profile/index.mjs +1 -1
  46. package/dist/risk-profile/index.mjs.map +1 -1
  47. package/dist/scores/index.js +1 -1
  48. package/dist/scores/index.js.map +1 -1
  49. package/dist/scores/index.mjs +1 -1
  50. package/dist/scores/index.mjs.map +1 -1
  51. package/dist/tax/index.js +1 -1
  52. package/dist/tax/index.js.map +1 -1
  53. package/dist/tax/index.mjs +1 -1
  54. package/dist/tax/index.mjs.map +1 -1
  55. package/dist/webhooks/index.d.mts +1 -1
  56. package/dist/webhooks/index.d.ts +1 -1
  57. package/dist/webhooks/index.js +6 -0
  58. package/dist/webhooks/index.js.map +1 -1
  59. package/dist/webhooks/index.mjs +6 -1
  60. package/dist/webhooks/index.mjs.map +1 -1
  61. package/package.json +1 -1
@@ -227,7 +227,7 @@ function createConsoleLogger() {
227
227
  }
228
228
 
229
229
  // src/core/version.ts
230
- var SDK_VERSION = "1.7.2";
230
+ var SDK_VERSION = "1.8.0";
231
231
 
232
232
  // src/shared/browser-utils.ts
233
233
  function generateUUID() {
@@ -910,6 +910,7 @@ function isCipherTextExpired(cipherText) {
910
910
  }
911
911
 
912
912
  // src/geolocation/client.ts
913
+ var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
913
914
  var GeolocationClient = class extends BaseClient {
914
915
  constructor(config) {
915
916
  const baseConfig = {
@@ -925,6 +926,8 @@ var GeolocationClient = class extends BaseClient {
925
926
  environment: config.environment
926
927
  };
927
928
  super(baseConfig);
929
+ this.gpsConfigCache = null;
930
+ this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
928
931
  }
929
932
  // ============================================================================
930
933
  // IP Verification & Compliance
@@ -1010,7 +1013,42 @@ var GeolocationClient = class extends BaseClient {
1010
1013
  * ```
1011
1014
  */
1012
1015
  async getGPSConfig(requestOptions) {
1013
- return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
1016
+ const cached = this.gpsConfigCache;
1017
+ if (cached && cached.expiresAt > Date.now()) {
1018
+ return cached.value;
1019
+ }
1020
+ return this.refreshGPSConfig(requestOptions);
1021
+ }
1022
+ /**
1023
+ * Re-read the tenant's GPS requirement configuration, ignoring any copy held
1024
+ * from an earlier read.
1025
+ *
1026
+ * These requirements are edited in the compliance console while your
1027
+ * application is running. `getGPSConfig` reuses a fetched copy for a short
1028
+ * period so a long-lived session does not call the API on every event; call
1029
+ * this when you need a change to take effect immediately — for example right
1030
+ * after an administrator saves new settings.
1031
+ *
1032
+ * @returns The current GPS requirement config per event type
1033
+ *
1034
+ * @example
1035
+ * ```typescript
1036
+ * const config = await client.refreshGPSConfig();
1037
+ * if (config.require_gps.login) {
1038
+ * // GPS is now required for login
1039
+ * }
1040
+ * ```
1041
+ */
1042
+ async refreshGPSConfig(requestOptions) {
1043
+ const value = await this.requestWithRetry(
1044
+ "/api/v1/geo/config",
1045
+ void 0,
1046
+ void 0,
1047
+ void 0,
1048
+ requestOptions
1049
+ );
1050
+ this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
1051
+ return value;
1014
1052
  }
1015
1053
  /**
1016
1054
  * Mint a short-lived, single-use device-signals nonce.