vesant-sdk 1.7.1-dev.9fc141f → 1.7.1-dev.a6a3bb0

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 (39) hide show
  1. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  2. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  3. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  4. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  5. package/dist/compliance/index.d.mts +2 -2
  6. package/dist/compliance/index.d.ts +2 -2
  7. package/dist/compliance/index.js +39 -1
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +39 -1
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/geolocation/index.d.mts +2 -2
  12. package/dist/geolocation/index.d.ts +2 -2
  13. package/dist/geolocation/index.js +39 -1
  14. package/dist/geolocation/index.js.map +1 -1
  15. package/dist/geolocation/index.mjs +39 -1
  16. package/dist/geolocation/index.mjs.map +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +62 -8
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +62 -8
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/kyc/core.js +23 -7
  24. package/dist/kyc/core.js.map +1 -1
  25. package/dist/kyc/core.mjs +23 -7
  26. package/dist/kyc/core.mjs.map +1 -1
  27. package/dist/kyc/index.d.mts +28 -10
  28. package/dist/kyc/index.d.ts +28 -10
  29. package/dist/kyc/index.js +23 -7
  30. package/dist/kyc/index.js.map +1 -1
  31. package/dist/kyc/index.mjs +23 -7
  32. package/dist/kyc/index.mjs.map +1 -1
  33. package/dist/react.d.mts +9 -2
  34. package/dist/react.d.ts +9 -2
  35. package/dist/react.js +144 -19
  36. package/dist/react.js.map +1 -1
  37. package/dist/react.mjs +144 -19
  38. package/dist/react.mjs.map +1 -1
  39. 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, 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';
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-BaUekQT8.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-B3DCAHlg.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-DUHC-68_.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, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycStatus, KycTriggerEvent, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } 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
 
package/dist/index.js CHANGED
@@ -1104,6 +1104,7 @@ function isCipherTextExpired(cipherText) {
1104
1104
  }
1105
1105
 
1106
1106
  // src/geolocation/client.ts
1107
+ var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
1107
1108
  var GeolocationClient = class extends BaseClient {
1108
1109
  constructor(config) {
1109
1110
  const baseConfig = {
@@ -1119,6 +1120,8 @@ var GeolocationClient = class extends BaseClient {
1119
1120
  environment: config.environment
1120
1121
  };
1121
1122
  super(baseConfig);
1123
+ this.gpsConfigCache = null;
1124
+ this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
1122
1125
  }
1123
1126
  // ============================================================================
1124
1127
  // IP Verification & Compliance
@@ -1204,7 +1207,42 @@ var GeolocationClient = class extends BaseClient {
1204
1207
  * ```
1205
1208
  */
1206
1209
  async getGPSConfig(requestOptions) {
1207
- return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
1210
+ const cached = this.gpsConfigCache;
1211
+ if (cached && cached.expiresAt > Date.now()) {
1212
+ return cached.value;
1213
+ }
1214
+ return this.refreshGPSConfig(requestOptions);
1215
+ }
1216
+ /**
1217
+ * Re-read the tenant's GPS requirement configuration, ignoring any copy held
1218
+ * from an earlier read.
1219
+ *
1220
+ * These requirements are edited in the compliance console while your
1221
+ * application is running. `getGPSConfig` reuses a fetched copy for a short
1222
+ * period so a long-lived session does not call the API on every event; call
1223
+ * this when you need a change to take effect immediately — for example right
1224
+ * after an administrator saves new settings.
1225
+ *
1226
+ * @returns The current GPS requirement config per event type
1227
+ *
1228
+ * @example
1229
+ * ```typescript
1230
+ * const config = await client.refreshGPSConfig();
1231
+ * if (config.require_gps.login) {
1232
+ * // GPS is now required for login
1233
+ * }
1234
+ * ```
1235
+ */
1236
+ async refreshGPSConfig(requestOptions) {
1237
+ const value = await this.requestWithRetry(
1238
+ "/api/v1/geo/config",
1239
+ void 0,
1240
+ void 0,
1241
+ void 0,
1242
+ requestOptions
1243
+ );
1244
+ this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
1245
+ return value;
1208
1246
  }
1209
1247
  /**
1210
1248
  * Mint a short-lived, single-use device-signals nonce.
@@ -2963,10 +3001,9 @@ var KycClient = class extends BaseClient {
2963
3001
  * Create a Event-Based Face Verification session.
2964
3002
  *
2965
3003
  * Inspect the response before showing UI:
2966
- * - `is_required === false` → skip face capture; `reason` explains why.
2967
- * - `device_type === 'desktop'` render `qr_payload` as a QR; the
2968
- * mobile device picks up the session via the connect endpoint.
2969
- * - `device_type === 'mobile'` → open the face capture modal directly.
3004
+ * - `is_required === false` → skip face verification; `reason` explains why.
3005
+ * - `verification_url` presentembed the hosted journey and poll status.
3006
+ * - `verification_url` absent → use the local camera / QR fallback.
2970
3007
  *
2971
3008
  * @param request - Reference, customer_id, event, amount (for threshold events), optional URLs.
2972
3009
  */
@@ -3013,11 +3050,28 @@ var KycClient = class extends BaseClient {
3013
3050
  headers: this.getUserHeaders()
3014
3051
  });
3015
3052
  }
3053
+ /**
3054
+ * Mint a fresh hosted verification journey for the next attempt on an
3055
+ * active session whose previous hosted-journey attempt was declined.
3056
+ * Only valid while the session is active and attempts remain; the
3057
+ * response carries the new `verification_url` to embed. Used internally
3058
+ * by `FaceCaptureModal`'s Try Again flow in hosted-journey mode.
3059
+ *
3060
+ * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
3061
+ */
3062
+ async retryEventBasedFaceVerificationJourney(token) {
3063
+ return this.request("/api/v1/kyc/face/onsite/journey", {
3064
+ method: "POST",
3065
+ body: JSON.stringify({ token }),
3066
+ headers: this.getUserHeaders()
3067
+ });
3068
+ }
3016
3069
  /**
3017
3070
  * Fetch the Redis-backed handoff session for a token. Same backing
3018
- * store as normal KYC (`kyc:session:<token>`, 15-minute TTL). Desktop
3019
- * callers poll `mobile_connected` to detect when a mobile device has
3020
- * scanned the QR and attached.
3071
+ * store as normal KYC (`kyc:session:<token>`, 15-minute TTL). The
3072
+ * Event-Based Face Verification database session still expires after
3073
+ * 10 minutes. Desktop callers poll `mobile_connected` to detect when a
3074
+ * mobile device has scanned the QR and attached.
3021
3075
  *
3022
3076
  * @param token - The session token returned by `createEventBasedFaceVerificationSession`.
3023
3077
  */