vesant-sdk 1.7.2-dev.617dd44 → 1.7.2-dev.9ef17db

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 (42) hide show
  1. package/README.md +4 -0
  2. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  3. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  4. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  5. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  6. package/dist/compliance/index.d.mts +2 -2
  7. package/dist/compliance/index.d.ts +2 -2
  8. package/dist/compliance/index.js +39 -1
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +39 -1
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/geolocation/index.d.mts +2 -2
  13. package/dist/geolocation/index.d.ts +2 -2
  14. package/dist/geolocation/index.js +39 -1
  15. package/dist/geolocation/index.js.map +1 -1
  16. package/dist/geolocation/index.mjs +39 -1
  17. package/dist/geolocation/index.mjs.map +1 -1
  18. package/dist/index.d.mts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +113 -30
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +113 -31
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/kyc/core.d.mts +1 -1
  25. package/dist/kyc/core.d.ts +1 -1
  26. package/dist/kyc/core.js +74 -29
  27. package/dist/kyc/core.js.map +1 -1
  28. package/dist/kyc/core.mjs +74 -30
  29. package/dist/kyc/core.mjs.map +1 -1
  30. package/dist/kyc/index.d.mts +334 -65
  31. package/dist/kyc/index.d.ts +334 -65
  32. package/dist/kyc/index.js +74 -29
  33. package/dist/kyc/index.js.map +1 -1
  34. package/dist/kyc/index.mjs +74 -30
  35. package/dist/kyc/index.mjs.map +1 -1
  36. package/dist/react.d.mts +126 -48
  37. package/dist/react.d.ts +126 -48
  38. package/dist/react.js +257 -35
  39. package/dist/react.js.map +1 -1
  40. package/dist/react.mjs +255 -36
  41. package/dist/react.mjs.map +1 -1
  42. package/package.json +1 -1
@@ -967,6 +967,7 @@ async function generateCipherText(options, config) {
967
967
  }
968
968
 
969
969
  // src/geolocation/client.ts
970
+ var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
970
971
  var GeolocationClient = class extends BaseClient {
971
972
  constructor(config) {
972
973
  const baseConfig = {
@@ -982,6 +983,8 @@ var GeolocationClient = class extends BaseClient {
982
983
  environment: config.environment
983
984
  };
984
985
  super(baseConfig);
986
+ this.gpsConfigCache = null;
987
+ this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
985
988
  }
986
989
  // ============================================================================
987
990
  // IP Verification & Compliance
@@ -1067,7 +1070,42 @@ var GeolocationClient = class extends BaseClient {
1067
1070
  * ```
1068
1071
  */
1069
1072
  async getGPSConfig(requestOptions) {
1070
- return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
1073
+ const cached = this.gpsConfigCache;
1074
+ if (cached && cached.expiresAt > Date.now()) {
1075
+ return cached.value;
1076
+ }
1077
+ return this.refreshGPSConfig(requestOptions);
1078
+ }
1079
+ /**
1080
+ * Re-read the tenant's GPS requirement configuration, ignoring any copy held
1081
+ * from an earlier read.
1082
+ *
1083
+ * These requirements are edited in the compliance console while your
1084
+ * application is running. `getGPSConfig` reuses a fetched copy for a short
1085
+ * period so a long-lived session does not call the API on every event; call
1086
+ * this when you need a change to take effect immediately — for example right
1087
+ * after an administrator saves new settings.
1088
+ *
1089
+ * @returns The current GPS requirement config per event type
1090
+ *
1091
+ * @example
1092
+ * ```typescript
1093
+ * const config = await client.refreshGPSConfig();
1094
+ * if (config.require_gps.login) {
1095
+ * // GPS is now required for login
1096
+ * }
1097
+ * ```
1098
+ */
1099
+ async refreshGPSConfig(requestOptions) {
1100
+ const value = await this.requestWithRetry(
1101
+ "/api/v1/geo/config",
1102
+ void 0,
1103
+ void 0,
1104
+ void 0,
1105
+ requestOptions
1106
+ );
1107
+ this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
1108
+ return value;
1071
1109
  }
1072
1110
  /**
1073
1111
  * Mint a short-lived, single-use device-signals nonce.