vesant-sdk 1.7.1-dev.ec505dc → 1.7.2-dev.5ca1247

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
package/dist/index.d.ts CHANGED
@@ -3,12 +3,12 @@ export { A as AuthCredential, B as BaseClient, a as BaseClientConfig, C as CGSCo
3
3
  import { a as PaginatedResponse } from './types-CBQRNL-l.js';
4
4
  export { A as APIResponse, B as BlockReason, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, P as PaginationParams, c as Reason, d as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-CBQRNL-l.js';
5
5
  export { B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload, a as GeolocationVerifiedPayload, I as InMemoryDedupStore, b as InMemoryDedupStoreOptions, K as KycStatusChangedPayload, L as LabelAppliedPayload, c as LocationRequestCompletedPayload, N as NotificationWebhookEvent, P as ProfileCreatedPayload, d as ProfileUpdatedPayload, R as RiskCategoryChangedPayload, e as RiskScoreChangedPayload, T as TaxReminderSentPayload, V as VerifyWebhookSignatureOptions, W as WebhookAnyHandler, f as WebhookDedupStore, g as WebhookEvent, h as WebhookEventHandler, i as WebhookEventType, j as WebhookHandler, k as WebhookHandlerConfig, l as WebhookMiddlewareOptions, m as WebhookNotification, n as createNextWebhookHandler, o as createWebhookMiddleware, v as verifyWebhookSignature } from './index-DSDgS09k.js';
6
- export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceSignalsEnvelope, u as DeviceTrustResult, v as GeoIPResult, w as GeofenceAction, x as GeofenceEvaluation, y as GeofenceRule, z as GeofenceRuleType, B as GeolocationAlert, G as GeolocationClient, E as GeolocationClientConfig, F as GeolocationConfigResponse, H as GeolocationRecord, J as JurisdictionConfig, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, U as UpdateDeviceTrustRequest, Q as UpdateGeofenceRuleRequest, S as UpdateJurisdictionRequest, T as UseAlertsOptions, W as UseAlertsResult, X as UseGeolocationOptions, Y as UseGeolocationResult, Z as UseLocationCaptureOptions, _ as UseLocationCaptureResult, $ as UseLocationRequestsOptions, a0 as UseLocationRequestsResult, a1 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a2 as VerifyIPRequest } from './client-C-u9lE8N.js';
6
+ export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceSignalsEnvelope, u as DeviceTrustResult, v as GeoIPResult, w as GeofenceAction, x as GeofenceEvaluation, y as GeofenceRule, z as GeofenceRuleType, B as GeolocationAlert, G as GeolocationClient, E as GeolocationClientConfig, F as GeolocationConfigResponse, H as GeolocationRecord, J as JurisdictionConfig, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, S as SignalsNonce, U as UpdateDeviceTrustRequest, Q as UpdateGeofenceRuleRequest, T as UpdateJurisdictionRequest, W as UseAlertsOptions, X as UseAlertsResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult, a2 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a3 as VerifyIPRequest } from './client-fy3trF2K.js';
7
7
  export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, collectDeviceSignals, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.js';
8
8
  export { RiskProfileClient } from './risk-profile/index.js';
9
9
  export { a as CreateCustomerProfileRequest, a as CreateProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, c as ProfileDetailsResponse, P as ProfileFilters, b as ProfileListResponse, R as RiskCategory, d as RiskConfiguration, e as RiskDashboardMetrics, f as RiskFactor, g as RiskFactorType, h as RiskHistory, S as ScreeningStatus, U as UpdateProfileRequest } from './types-UGyDl1fd.js';
10
10
  export { sdkReasons } from './compliance/index.js';
11
- export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from './client-BY4Quazn.js';
11
+ export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from './client-B3DCAHlg.js';
12
12
  export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycStatus, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
13
13
  export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileDocuments, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, RemindersRunResult, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.js';
14
14
 
@@ -83,6 +83,6 @@ declare const noopLogger: Logger;
83
83
  /**
84
84
  * Single source of truth for the SDK version.
85
85
  */
86
- declare const SDK_VERSION = "1.7.1";
86
+ declare const SDK_VERSION = "1.7.2";
87
87
 
88
88
  export { AuthenticationError, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError, Logger, NetworkError, PaginatedResponse, RateLimitError, SDK_VERSION, ServiceUnavailableError, TimeoutError, ValidationError, VesantError, collectAll, createConsoleLogger, noopLogger, paginate };
package/dist/index.js CHANGED
@@ -298,7 +298,7 @@ var noopLogger = {
298
298
  };
299
299
 
300
300
  // src/core/version.ts
301
- var SDK_VERSION = "1.7.1";
301
+ var SDK_VERSION = "1.7.2";
302
302
 
303
303
  // src/shared/browser-utils.ts
304
304
  function generateUUID() {
@@ -1206,6 +1206,49 @@ var GeolocationClient = class extends BaseClient {
1206
1206
  async getGPSConfig(requestOptions) {
1207
1207
  return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
1208
1208
  }
1209
+ /**
1210
+ * Mint a short-lived, single-use device-signals nonce.
1211
+ *
1212
+ * The nonce is bound to the tenant, user, and event type and is consumed
1213
+ * server-side during validation, so a captured device-signals envelope cannot
1214
+ * be replayed. `validateCipherText` mints and attaches one automatically; call
1215
+ * this directly only if you manage the nonce yourself.
1216
+ *
1217
+ * @param userId - User ID the nonce is bound to
1218
+ * @param eventType - Event type the nonce is bound to (login, registration, ...)
1219
+ * @returns The nonce and its expiry
1220
+ */
1221
+ async fetchSignalsNonce(userId, eventType, requestOptions) {
1222
+ if (!userId?.trim()) {
1223
+ throw new ValidationError("userId is required and must be a non-empty string", ["userId"]);
1224
+ }
1225
+ const request = { user_id: userId, event_type: eventType };
1226
+ return this.request(
1227
+ "/api/v1/geo/signals-token",
1228
+ {
1229
+ method: "POST",
1230
+ body: JSON.stringify(request)
1231
+ },
1232
+ void 0,
1233
+ requestOptions
1234
+ );
1235
+ }
1236
+ /**
1237
+ * Best-effort nonce mint for validation. Returns undefined if minting fails —
1238
+ * the server is the sole authority and blocks when a nonce is required, so this
1239
+ * never downgrades security on the client's say-so.
1240
+ */
1241
+ async resolveSignalsNonce(userId, eventType, requestOptions) {
1242
+ try {
1243
+ const { nonce } = await this.fetchSignalsNonce(userId, eventType, requestOptions);
1244
+ return nonce;
1245
+ } catch (err) {
1246
+ this.logger.warn(
1247
+ `Failed to mint device-signals nonce; proceeding without it: ${err instanceof Error ? err.message : String(err)}`
1248
+ );
1249
+ return void 0;
1250
+ }
1251
+ }
1209
1252
  // ============================================================================
1210
1253
  // CipherText Validation
1211
1254
  // ============================================================================
@@ -1257,12 +1300,14 @@ var GeolocationClient = class extends BaseClient {
1257
1300
  if (!userId?.trim()) {
1258
1301
  throw new ValidationError("userId is required and must be a non-empty string", ["userId"]);
1259
1302
  }
1303
+ const nonce = await this.resolveSignalsNonce(userId, eventType, requestOptions);
1260
1304
  const request = {
1261
1305
  cipher_text: cipherText,
1262
1306
  user_id: userId,
1263
1307
  event_type: eventType,
1264
1308
  expected_ip: expectedIP,
1265
- customer_data: customerData
1309
+ customer_data: customerData,
1310
+ nonce
1266
1311
  };
1267
1312
  return this.requestWithRetry(
1268
1313
  "/api/v1/geo/validate-ciphertext",