vesant-sdk 1.7.0-dev.3f9ec86 → 1.7.0-dev.4c91be9

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/index.d.mts CHANGED
@@ -2,7 +2,7 @@ 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';
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-CimDmgZb.mjs';
6
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 DeviceTrustResult, u as GeoIPResult, v as GeofenceAction, w as GeofenceEvaluation, x as GeofenceRule, y as GeofenceRuleType, z as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, E as GeolocationConfigResponse, F as GeolocationRecord, J as JurisdictionConfig, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, U as UpdateDeviceTrustRequest, P as UpdateGeofenceRuleRequest, Q as UpdateJurisdictionRequest, S as UseAlertsOptions, T as UseAlertsResult, W as UseGeolocationOptions, X as UseGeolocationResult, Y as UseLocationCaptureOptions, Z as UseLocationCaptureResult, _ as UseLocationRequestsOptions, $ as UseLocationRequestsResult, a0 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a1 as VerifyIPRequest } from './client-CvWNRwwg.mjs';
7
7
  export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.mjs';
8
8
  export { RiskProfileClient } from './risk-profile/index.mjs';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ 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';
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-CPOrMRaH.js';
6
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 DeviceTrustResult, u as GeoIPResult, v as GeofenceAction, w as GeofenceEvaluation, x as GeofenceRule, y as GeofenceRuleType, z as GeolocationAlert, G as GeolocationClient, B as GeolocationClientConfig, E as GeolocationConfigResponse, F as GeolocationRecord, J as JurisdictionConfig, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, L as LocationVerification, R as ResendLocationRequestRequest, U as UpdateDeviceTrustRequest, P as UpdateGeofenceRuleRequest, Q as UpdateJurisdictionRequest, S as UseAlertsOptions, T as UseAlertsResult, W as UseGeolocationOptions, X as UseGeolocationResult, Y as UseLocationCaptureOptions, Z as UseLocationCaptureResult, _ as UseLocationRequestsOptions, $ as UseLocationRequestsResult, a0 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a1 as VerifyIPRequest } from './client-0NOPDnT0.js';
7
7
  export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.js';
8
8
  export { RiskProfileClient } from './risk-profile/index.js';
package/dist/index.js CHANGED
@@ -755,29 +755,6 @@ async function collectAll(fetchPage) {
755
755
  return items;
756
756
  }
757
757
 
758
- // src/core/dedup.ts
759
- var InMemoryDedupStore = class {
760
- constructor(opts = {}) {
761
- this.expiryById = /* @__PURE__ */ new Map();
762
- this.maxEntries = opts.maxEntries ?? 1e3;
763
- this.now = opts.now ?? (() => Date.now());
764
- }
765
- async seen(id) {
766
- return this.expiryById.has(id);
767
- }
768
- async mark(id, ttlMs) {
769
- const now = this.now();
770
- this.expiryById.set(id, now + ttlMs);
771
- if (this.expiryById.size > this.maxEntries) {
772
- for (const [key, expiresAt] of this.expiryById) {
773
- if (now > expiresAt) {
774
- this.expiryById.delete(key);
775
- }
776
- }
777
- }
778
- }
779
- };
780
-
781
758
  // src/core/webhook-utils.ts
782
759
  async function verifyWebhookSignature(payload, signature, secret, opts = {}) {
783
760
  const signed = parseSignedTimestamp(signature);
@@ -3665,6 +3642,29 @@ var TaxClient = class extends BaseClient {
3665
3642
  }
3666
3643
  };
3667
3644
 
3645
+ // src/webhooks/dedup.ts
3646
+ var InMemoryDedupStore = class {
3647
+ constructor(opts = {}) {
3648
+ this.expiryById = /* @__PURE__ */ new Map();
3649
+ this.maxEntries = opts.maxEntries ?? 1e3;
3650
+ this.now = opts.now ?? (() => Date.now());
3651
+ }
3652
+ async seen(id) {
3653
+ return this.expiryById.has(id);
3654
+ }
3655
+ async mark(id, ttlMs) {
3656
+ const now = this.now();
3657
+ this.expiryById.set(id, now + ttlMs);
3658
+ if (this.expiryById.size > this.maxEntries) {
3659
+ for (const [key, expiresAt] of this.expiryById) {
3660
+ if (now > expiresAt) {
3661
+ this.expiryById.delete(key);
3662
+ }
3663
+ }
3664
+ }
3665
+ }
3666
+ };
3667
+
3668
3668
  // src/webhooks/handler.ts
3669
3669
  function resolveEventId(event) {
3670
3670
  if (event.id) {