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.
- package/README.md +4 -0
- package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +39 -1
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +39 -1
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/geolocation/index.js +39 -1
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +39 -1
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +113 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -31
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +74 -29
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +74 -30
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +334 -65
- package/dist/kyc/index.d.ts +334 -65
- package/dist/kyc/index.js +74 -29
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +74 -30
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +126 -48
- package/dist/react.d.ts +126 -48
- package/dist/react.js +257 -35
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +255 -36
- package/dist/react.mjs.map +1 -1
- 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
|
-
|
|
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.
|