vesant-sdk 1.7.2 → 1.8.0-dev.2b9e28d

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 (61) 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 +40 -2
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +40 -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 +40 -2
  18. package/dist/geolocation/index.js.map +1 -1
  19. package/dist/geolocation/index.mjs +40 -2
  20. package/dist/geolocation/index.mjs.map +1 -1
  21. package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
  22. package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
  23. package/dist/index.d.mts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +46 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +46 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/kyc/core.js +1 -1
  30. package/dist/kyc/core.js.map +1 -1
  31. package/dist/kyc/core.mjs +1 -1
  32. package/dist/kyc/core.mjs.map +1 -1
  33. package/dist/kyc/index.js +1 -1
  34. package/dist/kyc/index.js.map +1 -1
  35. package/dist/kyc/index.mjs +1 -1
  36. package/dist/kyc/index.mjs.map +1 -1
  37. package/dist/react.d.mts +9 -2
  38. package/dist/react.d.ts +9 -2
  39. package/dist/react.js +15 -10
  40. package/dist/react.js.map +1 -1
  41. package/dist/react.mjs +15 -10
  42. package/dist/react.mjs.map +1 -1
  43. package/dist/risk-profile/index.js +1 -1
  44. package/dist/risk-profile/index.js.map +1 -1
  45. package/dist/risk-profile/index.mjs +1 -1
  46. package/dist/risk-profile/index.mjs.map +1 -1
  47. package/dist/scores/index.js +1 -1
  48. package/dist/scores/index.js.map +1 -1
  49. package/dist/scores/index.mjs +1 -1
  50. package/dist/scores/index.mjs.map +1 -1
  51. package/dist/tax/index.js +1 -1
  52. package/dist/tax/index.js.map +1 -1
  53. package/dist/tax/index.mjs +1 -1
  54. package/dist/tax/index.mjs.map +1 -1
  55. package/dist/webhooks/index.d.mts +1 -1
  56. package/dist/webhooks/index.d.ts +1 -1
  57. package/dist/webhooks/index.js +6 -0
  58. package/dist/webhooks/index.js.map +1 -1
  59. package/dist/webhooks/index.mjs +6 -1
  60. package/dist/webhooks/index.mjs.map +1 -1
  61. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { U as UUID, T as Timestamp, R as RiskLevel } from './types-CBQRNL-l.js';
1
+ import { R as RiskLevel, T as Timestamp, U as UUID } from './types-CBQRNL-l.js';
2
2
 
3
3
  /**
4
4
  * Pluggable dedup store for webhook replay protection.
@@ -189,6 +189,61 @@ type WebhookEventHandler<T extends WebhookEventType = WebhookEventType> = (event
189
189
  event_type: T;
190
190
  }>) => void | Promise<void>;
191
191
  type WebhookAnyHandler = (event: WebhookEvent) => void | Promise<void>;
192
+ /** Watchlist category an AML screening matched. */
193
+ type AmlCallbackCategory = 'sanction' | 'pep' | 'adverse_media' | 'fraud' | 'terrorism' | 'narcotics' | 'financial_crime' | 'warning' | 'fitness_probity' | 'previous_client' | 'unknown' | (string & Record<string, never>);
194
+ interface AmlBlockCallbackData {
195
+ /** Your customer identifier — the one the screening ran against. */
196
+ customer_id: string;
197
+ /** Screened full name. Omitted when the screening had no full name. */
198
+ customer_name?: string;
199
+ /**
200
+ * Derived from the number of matches against your tenant's risk thresholds —
201
+ * not from the category. A sanction match is not automatically `high`.
202
+ */
203
+ risk_level: RiskLevel;
204
+ /** The category that matched. `previous_client` is a match on your internal watchlist only. */
205
+ category: AmlCallbackCategory;
206
+ /** Total matches, including internal watchlist matches. */
207
+ hits_count: number;
208
+ /** Name of the AML alert rule that decided the block. */
209
+ applied_rule?: string;
210
+ /** ISO 8601 UTC time the screening ran. */
211
+ screened_at?: Timestamp;
212
+ }
213
+ /**
214
+ * Body POSTed to the webhook URL in your AML screening settings when a
215
+ * screening matches a watchlist and the governing alert rule carries the
216
+ * `block` reaction. Signed with `X-Webhook-Signature: sha256=<hex>`
217
+ * (HMAC-SHA256 of the raw body).
218
+ *
219
+ * Sent only for blocks — nothing is delivered for a clear screening or for a
220
+ * rule that only alerts. Screenings that run without a request from you (after
221
+ * an accepted KYC, or after a name or date-of-birth change) are reported only
222
+ * through this webhook.
223
+ */
224
+ interface AmlBlockCallbackEvent {
225
+ /** Always `"aml"` — dispatch on this. */
226
+ event: 'aml';
227
+ /** The screening reference you supplied, or a generated identifier for automatic screenings. */
228
+ reference: string;
229
+ /** The screening record ID — unique per screening, so dedup on it. */
230
+ resource_id: string;
231
+ /** Always `"blocked"`. */
232
+ status: 'blocked';
233
+ /** Always `true`. */
234
+ block: true;
235
+ /**
236
+ * Human-readable reason for display and audit. Wording is not stable — branch
237
+ * on `data.category` and `data.risk_level` instead.
238
+ */
239
+ block_reason: string;
240
+ data: AmlBlockCallbackData;
241
+ }
242
+ /**
243
+ * Type guard for the AML block webhook. Narrows an already signature-verified,
244
+ * parsed payload to {@link AmlBlockCallbackEvent}.
245
+ */
246
+ declare function isAmlBlockCallbackEvent(value: unknown): value is AmlBlockCallbackEvent;
192
247
 
193
248
  /**
194
249
  * Webhook event handler with signature verification and typed dispatch.
@@ -261,4 +316,4 @@ declare function createWebhookMiddleware(options: WebhookMiddlewareOptions): (re
261
316
  */
262
317
  declare function createNextWebhookHandler(options: WebhookMiddlewareOptions): (request: Request) => Promise<Response>;
263
318
 
264
- export { type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type GeolocationVerifiedPayload as a, type InMemoryDedupStoreOptions as b, type LocationRequestCompletedPayload as c, type ProfileUpdatedPayload as d, type RiskScoreChangedPayload as e, type WebhookDedupStore as f, type WebhookEvent as g, type WebhookEventHandler as h, type WebhookEventType as i, WebhookHandler as j, type WebhookHandlerConfig as k, type WebhookMiddlewareOptions as l, type WebhookNotification as m, createNextWebhookHandler as n, createWebhookMiddleware as o, verifyWebhookSignature as v };
319
+ export { type AmlBlockCallbackData as A, type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type AmlBlockCallbackEvent as a, type AmlCallbackCategory as b, type GeolocationVerifiedPayload as c, type InMemoryDedupStoreOptions as d, type LocationRequestCompletedPayload as e, type ProfileUpdatedPayload as f, type RiskScoreChangedPayload as g, type WebhookDedupStore as h, type WebhookEvent as i, type WebhookEventHandler as j, type WebhookEventType as k, WebhookHandler as l, type WebhookHandlerConfig as m, type WebhookMiddlewareOptions as n, type WebhookNotification as o, createNextWebhookHandler as p, createWebhookMiddleware as q, isAmlBlockCallbackEvent as r, verifyWebhookSignature as v };
@@ -1,4 +1,4 @@
1
- import { U as UUID, T as Timestamp, R as RiskLevel } from './types-CBQRNL-l.mjs';
1
+ import { R as RiskLevel, T as Timestamp, U as UUID } from './types-CBQRNL-l.mjs';
2
2
 
3
3
  /**
4
4
  * Pluggable dedup store for webhook replay protection.
@@ -189,6 +189,61 @@ type WebhookEventHandler<T extends WebhookEventType = WebhookEventType> = (event
189
189
  event_type: T;
190
190
  }>) => void | Promise<void>;
191
191
  type WebhookAnyHandler = (event: WebhookEvent) => void | Promise<void>;
192
+ /** Watchlist category an AML screening matched. */
193
+ type AmlCallbackCategory = 'sanction' | 'pep' | 'adverse_media' | 'fraud' | 'terrorism' | 'narcotics' | 'financial_crime' | 'warning' | 'fitness_probity' | 'previous_client' | 'unknown' | (string & Record<string, never>);
194
+ interface AmlBlockCallbackData {
195
+ /** Your customer identifier — the one the screening ran against. */
196
+ customer_id: string;
197
+ /** Screened full name. Omitted when the screening had no full name. */
198
+ customer_name?: string;
199
+ /**
200
+ * Derived from the number of matches against your tenant's risk thresholds —
201
+ * not from the category. A sanction match is not automatically `high`.
202
+ */
203
+ risk_level: RiskLevel;
204
+ /** The category that matched. `previous_client` is a match on your internal watchlist only. */
205
+ category: AmlCallbackCategory;
206
+ /** Total matches, including internal watchlist matches. */
207
+ hits_count: number;
208
+ /** Name of the AML alert rule that decided the block. */
209
+ applied_rule?: string;
210
+ /** ISO 8601 UTC time the screening ran. */
211
+ screened_at?: Timestamp;
212
+ }
213
+ /**
214
+ * Body POSTed to the webhook URL in your AML screening settings when a
215
+ * screening matches a watchlist and the governing alert rule carries the
216
+ * `block` reaction. Signed with `X-Webhook-Signature: sha256=<hex>`
217
+ * (HMAC-SHA256 of the raw body).
218
+ *
219
+ * Sent only for blocks — nothing is delivered for a clear screening or for a
220
+ * rule that only alerts. Screenings that run without a request from you (after
221
+ * an accepted KYC, or after a name or date-of-birth change) are reported only
222
+ * through this webhook.
223
+ */
224
+ interface AmlBlockCallbackEvent {
225
+ /** Always `"aml"` — dispatch on this. */
226
+ event: 'aml';
227
+ /** The screening reference you supplied, or a generated identifier for automatic screenings. */
228
+ reference: string;
229
+ /** The screening record ID — unique per screening, so dedup on it. */
230
+ resource_id: string;
231
+ /** Always `"blocked"`. */
232
+ status: 'blocked';
233
+ /** Always `true`. */
234
+ block: true;
235
+ /**
236
+ * Human-readable reason for display and audit. Wording is not stable — branch
237
+ * on `data.category` and `data.risk_level` instead.
238
+ */
239
+ block_reason: string;
240
+ data: AmlBlockCallbackData;
241
+ }
242
+ /**
243
+ * Type guard for the AML block webhook. Narrows an already signature-verified,
244
+ * parsed payload to {@link AmlBlockCallbackEvent}.
245
+ */
246
+ declare function isAmlBlockCallbackEvent(value: unknown): value is AmlBlockCallbackEvent;
192
247
 
193
248
  /**
194
249
  * Webhook event handler with signature verification and typed dispatch.
@@ -261,4 +316,4 @@ declare function createWebhookMiddleware(options: WebhookMiddlewareOptions): (re
261
316
  */
262
317
  declare function createNextWebhookHandler(options: WebhookMiddlewareOptions): (request: Request) => Promise<Response>;
263
318
 
264
- export { type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type GeolocationVerifiedPayload as a, type InMemoryDedupStoreOptions as b, type LocationRequestCompletedPayload as c, type ProfileUpdatedPayload as d, type RiskScoreChangedPayload as e, type WebhookDedupStore as f, type WebhookEvent as g, type WebhookEventHandler as h, type WebhookEventType as i, WebhookHandler as j, type WebhookHandlerConfig as k, type WebhookMiddlewareOptions as l, type WebhookNotification as m, createNextWebhookHandler as n, createWebhookMiddleware as o, verifyWebhookSignature as v };
319
+ export { type AmlBlockCallbackData as A, type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type AmlBlockCallbackEvent as a, type AmlCallbackCategory as b, type GeolocationVerifiedPayload as c, type InMemoryDedupStoreOptions as d, type LocationRequestCompletedPayload as e, type ProfileUpdatedPayload as f, type RiskScoreChangedPayload as g, type WebhookDedupStore as h, type WebhookEvent as i, type WebhookEventHandler as j, type WebhookEventType as k, WebhookHandler as l, type WebhookHandlerConfig as m, type WebhookMiddlewareOptions as n, type WebhookNotification as o, createNextWebhookHandler as p, createWebhookMiddleware as q, isAmlBlockCallbackEvent as r, verifyWebhookSignature as v };
package/dist/index.d.mts CHANGED
@@ -2,13 +2,13 @@ import { L as Logger } from './client-q9fN8Hhf.mjs';
2
2
  export { A as AuthCredential, B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RefreshingTokenProvider, i as RefreshingTokenProviderOptions, j as RequestInterceptor, R as RequestOptions, k as RequiredBaseClientConfig, l as RequiredCGSConfig, m as RequiredVesantConfig, S as StaticApiKeyProvider, T as TokenProvider, n as TokenProviderContext, V as VesantConfig } from './client-q9fN8Hhf.mjs';
3
3
  import { a as PaginatedResponse } from './types-CBQRNL-l.mjs';
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.mjs';
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-C3zUKydT.mjs';
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-BwXMQA2a.mjs';
5
+ export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallbackCategory, B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload, c as GeolocationVerifiedPayload, I as InMemoryDedupStore, d as InMemoryDedupStoreOptions, K as KycStatusChangedPayload, L as LabelAppliedPayload, e as LocationRequestCompletedPayload, N as NotificationWebhookEvent, P as ProfileCreatedPayload, f as ProfileUpdatedPayload, R as RiskCategoryChangedPayload, g as RiskScoreChangedPayload, T as TaxReminderSentPayload, V as VerifyWebhookSignatureOptions, W as WebhookAnyHandler, h as WebhookDedupStore, i as WebhookEvent, j as WebhookEventHandler, k as WebhookEventType, l as WebhookHandler, m as WebhookHandlerConfig, n as WebhookMiddlewareOptions, o as WebhookNotification, p as createNextWebhookHandler, q as createWebhookMiddleware, r as isAmlBlockCallbackEvent, v as verifyWebhookSignature } from './index-C49a7fg2.mjs';
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-XDEhh9VN.mjs';
7
7
  export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, collectDeviceSignals, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.mjs';
8
8
  export { RiskProfileClient } from './risk-profile/index.mjs';
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-BOFaMQxI.mjs';
10
10
  export { sdkReasons } from './compliance/index.mjs';
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-D23KhWeh.mjs';
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-5q4whhGu.mjs';
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, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './kyc/index.mjs';
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.mjs';
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.2";
86
+ declare const SDK_VERSION = "1.8.0";
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.d.ts CHANGED
@@ -2,13 +2,13 @@ import { L as Logger } from './client-q9fN8Hhf.js';
2
2
  export { A as AuthCredential, B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RefreshingTokenProvider, i as RefreshingTokenProviderOptions, j as RequestInterceptor, R as RequestOptions, k as RequiredBaseClientConfig, l as RequiredCGSConfig, m as RequiredVesantConfig, S as StaticApiKeyProvider, T as TokenProvider, n as TokenProviderContext, V as VesantConfig } from './client-q9fN8Hhf.js';
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
- 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';
5
+ export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallbackCategory, B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload, c as GeolocationVerifiedPayload, I as InMemoryDedupStore, d as InMemoryDedupStoreOptions, K as KycStatusChangedPayload, L as LabelAppliedPayload, e as LocationRequestCompletedPayload, N as NotificationWebhookEvent, P as ProfileCreatedPayload, f as ProfileUpdatedPayload, R as RiskCategoryChangedPayload, g as RiskScoreChangedPayload, T as TaxReminderSentPayload, V as VerifyWebhookSignatureOptions, W as WebhookAnyHandler, h as WebhookDedupStore, i as WebhookEvent, j as WebhookEventHandler, k as WebhookEventType, l as WebhookHandler, m as WebhookHandlerConfig, n as WebhookMiddlewareOptions, o as WebhookNotification, p as createNextWebhookHandler, q as createWebhookMiddleware, r as isAmlBlockCallbackEvent, v as verifyWebhookSignature } from './index-BosFSGan.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, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, 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
 
@@ -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.2";
86
+ declare const SDK_VERSION = "1.8.0";
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.2";
301
+ var SDK_VERSION = "1.8.0";
302
302
 
303
303
  // src/shared/browser-utils.ts
304
304
  function generateUUID() {
@@ -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.
@@ -3859,6 +3897,11 @@ function buildHandler(options) {
3859
3897
  return handler;
3860
3898
  }
3861
3899
 
3900
+ // src/webhooks/types.ts
3901
+ function isAmlBlockCallbackEvent(value) {
3902
+ return typeof value === "object" && value !== null && value.event === "aml" && value.block === true;
3903
+ }
3904
+
3862
3905
  exports.AuthenticationError = AuthenticationError;
3863
3906
  exports.BaseClient = BaseClient;
3864
3907
  exports.CGSError = CGSError;
@@ -3894,6 +3937,7 @@ exports.createWebhookMiddleware = createWebhookMiddleware;
3894
3937
  exports.decodeCipherText = decodeCipherText;
3895
3938
  exports.generateCipherText = generateCipherText;
3896
3939
  exports.gpsIntegrityInputFromPosition = gpsIntegrityInputFromPosition;
3940
+ exports.isAmlBlockCallbackEvent = isAmlBlockCallbackEvent;
3897
3941
  exports.isCipherTextExpired = isCipherTextExpired;
3898
3942
  exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
3899
3943
  exports.noopLogger = noopLogger;