vesant-sdk 1.7.1-dev.ec505dc → 1.7.2-dev.5d70bb0
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/dist/{client-BY4Quazn.d.ts → client-B3DCAHlg.d.ts} +1 -1
- package/dist/{client-Yxat9wAO.d.mts → client-BwXMQA2a.d.mts} +35 -1
- package/dist/{client-CX1jcLNZ.d.mts → client-D23KhWeh.d.mts} +1 -1
- package/dist/{client-C-u9lE8N.d.ts → client-fy3trF2K.d.ts} +35 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +47 -2
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +47 -2
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- package/dist/decisions/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 +47 -2
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +47 -2
- 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 +47 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -2
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.js +1 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +1 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.js +1 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +1 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +1 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -1
- package/dist/tax/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -310,7 +310,7 @@ function createConsoleLogger() {
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// src/core/version.ts
|
|
313
|
-
var SDK_VERSION = "1.7.
|
|
313
|
+
var SDK_VERSION = "1.7.2";
|
|
314
314
|
|
|
315
315
|
// src/shared/browser-utils.ts
|
|
316
316
|
function generateUUID() {
|
|
@@ -1069,6 +1069,49 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1069
1069
|
async getGPSConfig(requestOptions) {
|
|
1070
1070
|
return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
|
|
1071
1071
|
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Mint a short-lived, single-use device-signals nonce.
|
|
1074
|
+
*
|
|
1075
|
+
* The nonce is bound to the tenant, user, and event type and is consumed
|
|
1076
|
+
* server-side during validation, so a captured device-signals envelope cannot
|
|
1077
|
+
* be replayed. `validateCipherText` mints and attaches one automatically; call
|
|
1078
|
+
* this directly only if you manage the nonce yourself.
|
|
1079
|
+
*
|
|
1080
|
+
* @param userId - User ID the nonce is bound to
|
|
1081
|
+
* @param eventType - Event type the nonce is bound to (login, registration, ...)
|
|
1082
|
+
* @returns The nonce and its expiry
|
|
1083
|
+
*/
|
|
1084
|
+
async fetchSignalsNonce(userId, eventType, requestOptions) {
|
|
1085
|
+
if (!userId?.trim()) {
|
|
1086
|
+
throw new ValidationError("userId is required and must be a non-empty string", ["userId"]);
|
|
1087
|
+
}
|
|
1088
|
+
const request = { user_id: userId, event_type: eventType };
|
|
1089
|
+
return this.request(
|
|
1090
|
+
"/api/v1/geo/signals-token",
|
|
1091
|
+
{
|
|
1092
|
+
method: "POST",
|
|
1093
|
+
body: JSON.stringify(request)
|
|
1094
|
+
},
|
|
1095
|
+
void 0,
|
|
1096
|
+
requestOptions
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Best-effort nonce mint for validation. Returns undefined if minting fails —
|
|
1101
|
+
* the server is the sole authority and blocks when a nonce is required, so this
|
|
1102
|
+
* never downgrades security on the client's say-so.
|
|
1103
|
+
*/
|
|
1104
|
+
async resolveSignalsNonce(userId, eventType, requestOptions) {
|
|
1105
|
+
try {
|
|
1106
|
+
const { nonce } = await this.fetchSignalsNonce(userId, eventType, requestOptions);
|
|
1107
|
+
return nonce;
|
|
1108
|
+
} catch (err) {
|
|
1109
|
+
this.logger.warn(
|
|
1110
|
+
`Failed to mint device-signals nonce; proceeding without it: ${err instanceof Error ? err.message : String(err)}`
|
|
1111
|
+
);
|
|
1112
|
+
return void 0;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1072
1115
|
// ============================================================================
|
|
1073
1116
|
// CipherText Validation
|
|
1074
1117
|
// ============================================================================
|
|
@@ -1120,12 +1163,14 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1120
1163
|
if (!userId?.trim()) {
|
|
1121
1164
|
throw new ValidationError("userId is required and must be a non-empty string", ["userId"]);
|
|
1122
1165
|
}
|
|
1166
|
+
const nonce = await this.resolveSignalsNonce(userId, eventType, requestOptions);
|
|
1123
1167
|
const request = {
|
|
1124
1168
|
cipher_text: cipherText,
|
|
1125
1169
|
user_id: userId,
|
|
1126
1170
|
event_type: eventType,
|
|
1127
1171
|
expected_ip: expectedIP,
|
|
1128
|
-
customer_data: customerData
|
|
1172
|
+
customer_data: customerData,
|
|
1173
|
+
nonce
|
|
1129
1174
|
};
|
|
1130
1175
|
return this.requestWithRetry(
|
|
1131
1176
|
"/api/v1/geo/validate-ciphertext",
|