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.
Files changed (53) hide show
  1. package/dist/{client-BY4Quazn.d.ts → client-B3DCAHlg.d.ts} +1 -1
  2. package/dist/{client-Yxat9wAO.d.mts → client-BwXMQA2a.d.mts} +35 -1
  3. package/dist/{client-CX1jcLNZ.d.mts → client-D23KhWeh.d.mts} +1 -1
  4. package/dist/{client-C-u9lE8N.d.ts → client-fy3trF2K.d.ts} +35 -1
  5. package/dist/compliance/index.d.mts +2 -2
  6. package/dist/compliance/index.d.ts +2 -2
  7. package/dist/compliance/index.js +47 -2
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +47 -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 +47 -2
  18. package/dist/geolocation/index.js.map +1 -1
  19. package/dist/geolocation/index.mjs +47 -2
  20. package/dist/geolocation/index.mjs.map +1 -1
  21. package/dist/index.d.mts +3 -3
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +47 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +47 -2
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/kyc/core.js +1 -1
  28. package/dist/kyc/core.js.map +1 -1
  29. package/dist/kyc/core.mjs +1 -1
  30. package/dist/kyc/core.mjs.map +1 -1
  31. package/dist/kyc/index.js +1 -1
  32. package/dist/kyc/index.js.map +1 -1
  33. package/dist/kyc/index.mjs +1 -1
  34. package/dist/kyc/index.mjs.map +1 -1
  35. package/dist/react.d.mts +2 -2
  36. package/dist/react.d.ts +2 -2
  37. package/dist/react.js +1 -1
  38. package/dist/react.js.map +1 -1
  39. package/dist/react.mjs +1 -1
  40. package/dist/react.mjs.map +1 -1
  41. package/dist/risk-profile/index.js +1 -1
  42. package/dist/risk-profile/index.js.map +1 -1
  43. package/dist/risk-profile/index.mjs +1 -1
  44. package/dist/risk-profile/index.mjs.map +1 -1
  45. package/dist/scores/index.js +1 -1
  46. package/dist/scores/index.js.map +1 -1
  47. package/dist/scores/index.mjs +1 -1
  48. package/dist/scores/index.mjs.map +1 -1
  49. package/dist/tax/index.js +1 -1
  50. package/dist/tax/index.js.map +1 -1
  51. package/dist/tax/index.mjs +1 -1
  52. package/dist/tax/index.mjs.map +1 -1
  53. 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.1";
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",