vesant-sdk 1.4.5 → 1.5.2
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/README.md +5 -3
- package/dist/{client-BlAt791q.d.ts → client-B8pFrXx_.d.ts} +11 -5
- package/dist/{client-oo_3-0YW.d.mts → client-BZxzOidG.d.mts} +11 -5
- package/dist/{client-CY41e2Z_.d.mts → client-CIon-bGS.d.mts} +9 -5
- package/dist/{client-CY41e2Z_.d.ts → client-CIon-bGS.d.ts} +9 -5
- package/dist/compliance/index.d.mts +7 -7
- package/dist/compliance/index.d.ts +7 -7
- package/dist/compliance/index.js +46 -51
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +46 -51
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +2 -2
- package/dist/decisions/index.d.ts +2 -2
- package/dist/decisions/index.js +32 -33
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +32 -33
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +4 -4
- package/dist/geolocation/index.d.ts +4 -4
- package/dist/geolocation/index.js +33 -34
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +33 -34
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +553 -21
- package/dist/index.d.ts +553 -21
- package/dist/index.js +320 -161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +318 -159
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +3 -3
- package/dist/kyc/core.d.ts +3 -3
- package/dist/kyc/core.js +32 -33
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +32 -33
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +11 -7
- package/dist/kyc/index.d.ts +11 -7
- package/dist/kyc/index.js +32 -33
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +32 -33
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +5 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +5 -5
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +4 -4
- package/dist/risk-profile/index.d.ts +4 -4
- package/dist/risk-profile/index.js +35 -36
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +35 -36
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +2 -2
- package/dist/scores/index.d.ts +2 -2
- package/dist/scores/index.js +32 -33
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +32 -33
- package/dist/scores/index.mjs.map +1 -1
- package/dist/{types-jaLuzruy.d.mts → types-1RzYeSal.d.mts} +2 -2
- package/dist/{types-DZHongaK.d.mts → types-B4Ezqo7V.d.mts} +2 -2
- package/dist/{types-DZHongaK.d.ts → types-B4Ezqo7V.d.ts} +2 -2
- package/dist/{types-DLC7Sfy5.d.ts → types-X5Md_dD_.d.ts} +2 -2
- package/dist/webhooks/index.d.mts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -316,14 +316,16 @@ interface ComplianceClientConfig {
|
|
|
316
316
|
|
|
317
317
|
| Method | Description |
|
|
318
318
|
|--------|-------------|
|
|
319
|
-
| `verifyIP(request)` | Verify IP address and check compliance |
|
|
319
|
+
| `verifyIP(request)` | Verify IP address and check compliance (**use this for allowed/blocked decisions**) |
|
|
320
320
|
| `checkCompliance(countryISO)` | Check jurisdiction compliance |
|
|
321
|
-
| `validateCipherText(cipherText, userId, eventType)` | Validate device fingerprint |
|
|
322
|
-
| `validateAndVerify(cipherText, ip, userId, eventType)` | Combined cipherText + IP verification |
|
|
321
|
+
| `validateCipherText(cipherText, userId, eventType)` | Validate device fingerprint integrity (does **not** check jurisdiction rules) |
|
|
322
|
+
| `validateAndVerify(cipherText, ip, userId, eventType)` | Combined cipherText validation + IP verification |
|
|
323
323
|
| `getGPSConfig()` | Get GPS requirement config per event type |
|
|
324
324
|
| `createLocationRequest(request)` | Create a live location request |
|
|
325
325
|
| `captureLocation(token, capture)` | Submit location capture (customer-facing) |
|
|
326
326
|
|
|
327
|
+
> **Which API should I use?** For registration, login, and transaction flows, use `ComplianceClient` methods (`verifyAtRegistration`, `verifyAtLogin`, `verifyAtTransaction`). These orchestrate geolocation + risk profiling and return a single `allowed` decision. Only use `GeolocationClient` directly if you need low-level access to individual APIs.
|
|
328
|
+
|
|
327
329
|
### RiskProfileClient
|
|
328
330
|
|
|
329
331
|
| Method | Description |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
2
|
-
import { P as PaginationParams } from './types-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CIon-bGS.js';
|
|
2
|
+
import { P as PaginationParams } from './types-B4Ezqo7V.js';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
5
5
|
device_id: string;
|
|
@@ -428,6 +428,10 @@ interface GeolocationRecord {
|
|
|
428
428
|
postal_code?: string;
|
|
429
429
|
latitude: number;
|
|
430
430
|
longitude: number;
|
|
431
|
+
/** Source of the coordinates: "gps" when device GPS was provided, "ip" when derived from IP lookup */
|
|
432
|
+
position_source?: 'gps' | 'ip';
|
|
433
|
+
/** GPS accuracy in meters (only present when position_source is "gps") */
|
|
434
|
+
gps_accuracy?: number;
|
|
431
435
|
timezone?: string;
|
|
432
436
|
is_vpn: boolean;
|
|
433
437
|
is_proxy: boolean;
|
|
@@ -454,6 +458,8 @@ interface GeolocationConfigResponse {
|
|
|
454
458
|
registration: boolean;
|
|
455
459
|
transaction: boolean;
|
|
456
460
|
};
|
|
461
|
+
/** When true, GPS-verified location overrides anonymizer-based blocking */
|
|
462
|
+
trust_gps_over_anonymizer: boolean;
|
|
457
463
|
/** Public signing key (pk_) for client-side HMAC signing */
|
|
458
464
|
signing_key?: string;
|
|
459
465
|
}
|
|
@@ -728,7 +734,7 @@ interface UseLocationCaptureResult {
|
|
|
728
734
|
}
|
|
729
735
|
|
|
730
736
|
/**
|
|
731
|
-
* GeolocationClient - TypeScript SDK for
|
|
737
|
+
* GeolocationClient - TypeScript SDK for Vesant Geolocation & Compliance Service
|
|
732
738
|
*
|
|
733
739
|
* Provides type-safe methods to interact with the geolocation service API.
|
|
734
740
|
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
@@ -737,7 +743,7 @@ interface UseLocationCaptureResult {
|
|
|
737
743
|
/**
|
|
738
744
|
* GeolocationClient extends BaseClient for:
|
|
739
745
|
* - Consistent retry logic with exponential backoff
|
|
740
|
-
* - Unified error handling (
|
|
746
|
+
* - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
|
|
741
747
|
* - Automatic timeout management
|
|
742
748
|
* - Debug logging
|
|
743
749
|
*
|
|
@@ -1002,4 +1008,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1002
1008
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1003
1009
|
}
|
|
1004
1010
|
|
|
1005
|
-
export { type
|
|
1011
|
+
export { type WiFiNetwork as $, type AlertStatus as A, type GeofenceAction as B, type CipherTextOptions as C, type DeviceFingerprintRequest as D, type GeofenceRule as E, type CreateGeofenceRuleRequest as F, GeolocationClient as G, type UpdateGeofenceRuleRequest as H, type UpdateDeviceTrustRequest as I, type JurisdictionConfig as J, type GeolocationRecord as K, type LocationVerification as L, type APIError as M, type GeolocationConfigResponse as N, type GeolocationClientConfig as O, type UseAlertsOptions as P, type UseAlertsResult as Q, type LocationRequestStatus as R, type LocationRequestChannel as S, type LocationRequest as T, type UseGeolocationOptions as U, type ValidateCipherTextRequest as V, type CreateLocationRequestRequest as W, type LocationRequestResult as X, type LocationRequestFilters as Y, type LocationRequestListResponse as Z, type ResendLocationRequestRequest as _, type UseGeolocationResult as a, type LocationCaptureRequest as a0, type LocationShareInfo as a1, type LocationCaptureResponse as a2, type UseLocationRequestsOptions as b, type UseLocationRequestsResult as c, type UseLocationCaptureOptions as d, type UseLocationCaptureResult as e, type CipherTextResult as f, type CipherTextPayload as g, type CipherTextReason as h, type DecryptedCipherText as i, type CipherTextCustomerData as j, type ValidateCipherTextResponse as k, type VerifyIPRequest as l, type GeoIPResult as m, type GeofenceEvaluation as n, type DeviceFingerprint as o, type DeviceTrustResult as p, type ComplianceCheckResponse as q, type AlertSeverity as r, type AlertType as s, type GeolocationAlert as t, type AlertFilters as u, type AlertListResponse as v, type DashboardMetrics as w, type CreateJurisdictionRequest as x, type UpdateJurisdictionRequest as y, type GeofenceRuleType as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
2
|
-
import { P as PaginationParams } from './types-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CIon-bGS.mjs';
|
|
2
|
+
import { P as PaginationParams } from './types-B4Ezqo7V.mjs';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
5
5
|
device_id: string;
|
|
@@ -428,6 +428,10 @@ interface GeolocationRecord {
|
|
|
428
428
|
postal_code?: string;
|
|
429
429
|
latitude: number;
|
|
430
430
|
longitude: number;
|
|
431
|
+
/** Source of the coordinates: "gps" when device GPS was provided, "ip" when derived from IP lookup */
|
|
432
|
+
position_source?: 'gps' | 'ip';
|
|
433
|
+
/** GPS accuracy in meters (only present when position_source is "gps") */
|
|
434
|
+
gps_accuracy?: number;
|
|
431
435
|
timezone?: string;
|
|
432
436
|
is_vpn: boolean;
|
|
433
437
|
is_proxy: boolean;
|
|
@@ -454,6 +458,8 @@ interface GeolocationConfigResponse {
|
|
|
454
458
|
registration: boolean;
|
|
455
459
|
transaction: boolean;
|
|
456
460
|
};
|
|
461
|
+
/** When true, GPS-verified location overrides anonymizer-based blocking */
|
|
462
|
+
trust_gps_over_anonymizer: boolean;
|
|
457
463
|
/** Public signing key (pk_) for client-side HMAC signing */
|
|
458
464
|
signing_key?: string;
|
|
459
465
|
}
|
|
@@ -728,7 +734,7 @@ interface UseLocationCaptureResult {
|
|
|
728
734
|
}
|
|
729
735
|
|
|
730
736
|
/**
|
|
731
|
-
* GeolocationClient - TypeScript SDK for
|
|
737
|
+
* GeolocationClient - TypeScript SDK for Vesant Geolocation & Compliance Service
|
|
732
738
|
*
|
|
733
739
|
* Provides type-safe methods to interact with the geolocation service API.
|
|
734
740
|
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
@@ -737,7 +743,7 @@ interface UseLocationCaptureResult {
|
|
|
737
743
|
/**
|
|
738
744
|
* GeolocationClient extends BaseClient for:
|
|
739
745
|
* - Consistent retry logic with exponential backoff
|
|
740
|
-
* - Unified error handling (
|
|
746
|
+
* - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
|
|
741
747
|
* - Automatic timeout management
|
|
742
748
|
* - Debug logging
|
|
743
749
|
*
|
|
@@ -1002,4 +1008,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1002
1008
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1003
1009
|
}
|
|
1004
1010
|
|
|
1005
|
-
export { type
|
|
1011
|
+
export { type WiFiNetwork as $, type AlertStatus as A, type GeofenceAction as B, type CipherTextOptions as C, type DeviceFingerprintRequest as D, type GeofenceRule as E, type CreateGeofenceRuleRequest as F, GeolocationClient as G, type UpdateGeofenceRuleRequest as H, type UpdateDeviceTrustRequest as I, type JurisdictionConfig as J, type GeolocationRecord as K, type LocationVerification as L, type APIError as M, type GeolocationConfigResponse as N, type GeolocationClientConfig as O, type UseAlertsOptions as P, type UseAlertsResult as Q, type LocationRequestStatus as R, type LocationRequestChannel as S, type LocationRequest as T, type UseGeolocationOptions as U, type ValidateCipherTextRequest as V, type CreateLocationRequestRequest as W, type LocationRequestResult as X, type LocationRequestFilters as Y, type LocationRequestListResponse as Z, type ResendLocationRequestRequest as _, type UseGeolocationResult as a, type LocationCaptureRequest as a0, type LocationShareInfo as a1, type LocationCaptureResponse as a2, type UseLocationRequestsOptions as b, type UseLocationRequestsResult as c, type UseLocationCaptureOptions as d, type UseLocationCaptureResult as e, type CipherTextResult as f, type CipherTextPayload as g, type CipherTextReason as h, type DecryptedCipherText as i, type CipherTextCustomerData as j, type ValidateCipherTextResponse as k, type VerifyIPRequest as l, type GeoIPResult as m, type GeofenceEvaluation as n, type DeviceFingerprint as o, type DeviceTrustResult as p, type ComplianceCheckResponse as q, type AlertSeverity as r, type AlertType as s, type GeolocationAlert as t, type AlertFilters as u, type AlertListResponse as v, type DashboardMetrics as w, type CreateJurisdictionRequest as x, type UpdateJurisdictionRequest as y, type GeofenceRuleType as z };
|
|
@@ -99,7 +99,7 @@ interface BaseClientConfig {
|
|
|
99
99
|
/** Enable rate limit header tracking (default: false) */
|
|
100
100
|
enableRateLimitTracking?: boolean;
|
|
101
101
|
}
|
|
102
|
-
interface
|
|
102
|
+
interface VesantConfig {
|
|
103
103
|
/** Base URL for the Vesant API */
|
|
104
104
|
baseURL: string;
|
|
105
105
|
/** Tenant ID for multi-tenancy */
|
|
@@ -129,8 +129,12 @@ interface CGSConfig {
|
|
|
129
129
|
/** Enable rate limit header tracking (default: false) */
|
|
130
130
|
enableRateLimitTracking?: boolean;
|
|
131
131
|
}
|
|
132
|
-
/**
|
|
133
|
-
type
|
|
132
|
+
/** VesantConfig with core fields required, enterprise features remain optional */
|
|
133
|
+
type RequiredVesantConfig = Required<Pick<VesantConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<VesantConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
134
|
+
/** @deprecated Use VesantConfig instead */
|
|
135
|
+
type CGSConfig = VesantConfig;
|
|
136
|
+
/** @deprecated Use RequiredVesantConfig instead */
|
|
137
|
+
type RequiredCGSConfig = RequiredVesantConfig;
|
|
134
138
|
/** BaseClientConfig with core fields required, enterprise features remain optional */
|
|
135
139
|
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
136
140
|
|
|
@@ -170,7 +174,7 @@ declare class RateLimitTracker {
|
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
/**
|
|
173
|
-
* Base HTTP client for all
|
|
177
|
+
* Base HTTP client for all Vesant SDK clients
|
|
174
178
|
*
|
|
175
179
|
* Provides common functionality:
|
|
176
180
|
* - Request/response handling
|
|
@@ -231,4 +235,4 @@ declare abstract class BaseClient {
|
|
|
231
235
|
}>;
|
|
232
236
|
}
|
|
233
237
|
|
|
234
|
-
export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type
|
|
238
|
+
export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, type RequestInterceptor as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
|
|
@@ -99,7 +99,7 @@ interface BaseClientConfig {
|
|
|
99
99
|
/** Enable rate limit header tracking (default: false) */
|
|
100
100
|
enableRateLimitTracking?: boolean;
|
|
101
101
|
}
|
|
102
|
-
interface
|
|
102
|
+
interface VesantConfig {
|
|
103
103
|
/** Base URL for the Vesant API */
|
|
104
104
|
baseURL: string;
|
|
105
105
|
/** Tenant ID for multi-tenancy */
|
|
@@ -129,8 +129,12 @@ interface CGSConfig {
|
|
|
129
129
|
/** Enable rate limit header tracking (default: false) */
|
|
130
130
|
enableRateLimitTracking?: boolean;
|
|
131
131
|
}
|
|
132
|
-
/**
|
|
133
|
-
type
|
|
132
|
+
/** VesantConfig with core fields required, enterprise features remain optional */
|
|
133
|
+
type RequiredVesantConfig = Required<Pick<VesantConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<VesantConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
134
|
+
/** @deprecated Use VesantConfig instead */
|
|
135
|
+
type CGSConfig = VesantConfig;
|
|
136
|
+
/** @deprecated Use RequiredVesantConfig instead */
|
|
137
|
+
type RequiredCGSConfig = RequiredVesantConfig;
|
|
134
138
|
/** BaseClientConfig with core fields required, enterprise features remain optional */
|
|
135
139
|
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
136
140
|
|
|
@@ -170,7 +174,7 @@ declare class RateLimitTracker {
|
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
/**
|
|
173
|
-
* Base HTTP client for all
|
|
177
|
+
* Base HTTP client for all Vesant SDK clients
|
|
174
178
|
*
|
|
175
179
|
* Provides common functionality:
|
|
176
180
|
* - Request/response handling
|
|
@@ -231,4 +235,4 @@ declare abstract class BaseClient {
|
|
|
231
235
|
}>;
|
|
232
236
|
}
|
|
233
237
|
|
|
234
|
-
export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type
|
|
238
|
+
export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, type RequestInterceptor as b, type RequiredVesantConfig as c, type CGSConfig as d, type RequiredCGSConfig as e, type RequiredBaseClientConfig as f, type CircuitBreakerState as g, type CircuitBreakerStatus as h, CircuitBreaker as i, type RateLimitStatus as j, RateLimitTracker as k };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, T as LocationRequest, G as GeolocationClient, Y as LocationRequestFilters, Z as LocationRequestListResponse } from '../client-BZxzOidG.mjs';
|
|
2
|
+
export { W as CreateLocationRequestRequest, a0 as LocationCaptureRequest, a2 as LocationCaptureResponse, S as LocationRequestChannel, X as LocationRequestResult, R as LocationRequestStatus, a1 as LocationShareInfo, _ as ResendLocationRequestRequest } from '../client-BZxzOidG.mjs';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import { C as CustomerProfile } from '../types-
|
|
6
|
-
import { E as EntityType, P as PaginationParams } from '../types-
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-CIon-bGS.mjs';
|
|
5
|
+
import { C as CustomerProfile } from '../types-1RzYeSal.mjs';
|
|
6
|
+
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.mjs';
|
|
7
7
|
|
|
8
8
|
interface RegistrationVerificationRequest {
|
|
9
9
|
customerId: string;
|
|
@@ -114,7 +114,7 @@ interface ComplianceLocationRequestResult {
|
|
|
114
114
|
* Main integration point for casino platforms. Orchestrates geolocation
|
|
115
115
|
* verification with customer risk profiling for complete compliance coverage.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
117
|
+
* SDK is the primary data injection point for compliance verification.
|
|
118
118
|
*/
|
|
119
119
|
|
|
120
120
|
declare class ComplianceClient {
|
|
@@ -125,7 +125,7 @@ declare class ComplianceClient {
|
|
|
125
125
|
private currencyRates;
|
|
126
126
|
private _currencyRatesCustomized;
|
|
127
127
|
private _currencyRatesWarned;
|
|
128
|
-
constructor(config:
|
|
128
|
+
constructor(config: VesantConfig);
|
|
129
129
|
/** Get the underlying GeolocationClient for direct geolocation API access */
|
|
130
130
|
getGeolocationClient(): GeolocationClient;
|
|
131
131
|
/** Get the underlying RiskProfileClient for direct risk profile API access */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, T as LocationRequest, G as GeolocationClient, Y as LocationRequestFilters, Z as LocationRequestListResponse } from '../client-B8pFrXx_.js';
|
|
2
|
+
export { W as CreateLocationRequestRequest, a0 as LocationCaptureRequest, a2 as LocationCaptureResponse, S as LocationRequestChannel, X as LocationRequestResult, R as LocationRequestStatus, a1 as LocationShareInfo, _ as ResendLocationRequestRequest } from '../client-B8pFrXx_.js';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.js';
|
|
4
|
-
import {
|
|
5
|
-
import { C as CustomerProfile } from '../types-
|
|
6
|
-
import { E as EntityType, P as PaginationParams } from '../types-
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-CIon-bGS.js';
|
|
5
|
+
import { C as CustomerProfile } from '../types-X5Md_dD_.js';
|
|
6
|
+
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.js';
|
|
7
7
|
|
|
8
8
|
interface RegistrationVerificationRequest {
|
|
9
9
|
customerId: string;
|
|
@@ -114,7 +114,7 @@ interface ComplianceLocationRequestResult {
|
|
|
114
114
|
* Main integration point for casino platforms. Orchestrates geolocation
|
|
115
115
|
* verification with customer risk profiling for complete compliance coverage.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
117
|
+
* SDK is the primary data injection point for compliance verification.
|
|
118
118
|
*/
|
|
119
119
|
|
|
120
120
|
declare class ComplianceClient {
|
|
@@ -125,7 +125,7 @@ declare class ComplianceClient {
|
|
|
125
125
|
private currencyRates;
|
|
126
126
|
private _currencyRatesCustomized;
|
|
127
127
|
private _currencyRatesWarned;
|
|
128
|
-
constructor(config:
|
|
128
|
+
constructor(config: VesantConfig);
|
|
129
129
|
/** Get the underlying GeolocationClient for direct geolocation API access */
|
|
130
130
|
getGeolocationClient(): GeolocationClient;
|
|
131
131
|
/** Get the underlying RiskProfileClient for direct risk profile API access */
|
package/dist/compliance/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/core/errors.ts
|
|
4
|
-
var
|
|
4
|
+
var VesantError = class _VesantError extends Error {
|
|
5
5
|
constructor(message, code, statusCode, details) {
|
|
6
6
|
super(message);
|
|
7
7
|
this.code = code;
|
|
8
8
|
this.statusCode = statusCode;
|
|
9
9
|
this.details = details;
|
|
10
|
-
this.name = "
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
10
|
+
this.name = "VesantError";
|
|
11
|
+
Object.setPrototypeOf(this, _VesantError.prototype);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
var NetworkError = class _NetworkError extends
|
|
14
|
+
var NetworkError = class _NetworkError extends VesantError {
|
|
15
15
|
constructor(message, originalError) {
|
|
16
|
-
super(message, "NETWORK_ERROR"
|
|
16
|
+
super(message, "NETWORK_ERROR");
|
|
17
17
|
this.originalError = originalError;
|
|
18
18
|
this.name = "NetworkError";
|
|
19
19
|
Object.setPrototypeOf(this, _NetworkError.prototype);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
var ValidationError = class _ValidationError extends
|
|
22
|
+
var ValidationError = class _ValidationError extends VesantError {
|
|
23
23
|
constructor(message, fields) {
|
|
24
24
|
super(message, "VALIDATION_ERROR", 400, { fields });
|
|
25
25
|
this.name = "ValidationError";
|
|
26
26
|
Object.setPrototypeOf(this, _ValidationError.prototype);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
var ServiceUnavailableError = class _ServiceUnavailableError extends
|
|
30
|
-
constructor(message) {
|
|
31
|
-
super(
|
|
29
|
+
var ServiceUnavailableError = class _ServiceUnavailableError extends VesantError {
|
|
30
|
+
constructor(message = "Service unavailable") {
|
|
31
|
+
super(message, "SERVICE_UNAVAILABLE", 503);
|
|
32
32
|
this.name = "ServiceUnavailableError";
|
|
33
33
|
Object.setPrototypeOf(this, _ServiceUnavailableError.prototype);
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
var AuthenticationError = class _AuthenticationError extends
|
|
36
|
+
var AuthenticationError = class _AuthenticationError extends VesantError {
|
|
37
37
|
constructor(message = "Authentication failed") {
|
|
38
38
|
super(message, "AUTHENTICATION_ERROR", 401);
|
|
39
39
|
this.name = "AuthenticationError";
|
|
40
40
|
Object.setPrototypeOf(this, _AuthenticationError.prototype);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
var RateLimitError = class _RateLimitError extends
|
|
43
|
+
var RateLimitError = class _RateLimitError extends VesantError {
|
|
44
44
|
constructor(retryAfter) {
|
|
45
45
|
super("Rate limit exceeded", "RATE_LIMIT_EXCEEDED", 429, { retryAfter });
|
|
46
46
|
this.retryAfter = retryAfter;
|
|
@@ -48,7 +48,7 @@ var RateLimitError = class _RateLimitError extends CGSError {
|
|
|
48
48
|
Object.setPrototypeOf(this, _RateLimitError.prototype);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
var TimeoutError = class _TimeoutError extends
|
|
51
|
+
var TimeoutError = class _TimeoutError extends VesantError {
|
|
52
52
|
constructor(timeout) {
|
|
53
53
|
super(`Request timeout after ${timeout}ms`, "TIMEOUT", 408, { timeout });
|
|
54
54
|
this.timeout = timeout;
|
|
@@ -56,15 +56,15 @@ var TimeoutError = class _TimeoutError extends CGSError {
|
|
|
56
56
|
Object.setPrototypeOf(this, _TimeoutError.prototype);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
var ComplianceError = class _ComplianceError extends
|
|
59
|
+
var ComplianceError = class _ComplianceError extends VesantError {
|
|
60
60
|
constructor(message, originalError, code = "COMPLIANCE_ERROR") {
|
|
61
|
-
super(message, code
|
|
61
|
+
super(message, code);
|
|
62
62
|
this.originalError = originalError;
|
|
63
63
|
this.name = "ComplianceError";
|
|
64
64
|
Object.setPrototypeOf(this, _ComplianceError.prototype);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
var CircuitBreakerOpenError = class _CircuitBreakerOpenError extends
|
|
67
|
+
var CircuitBreakerOpenError = class _CircuitBreakerOpenError extends VesantError {
|
|
68
68
|
constructor() {
|
|
69
69
|
super("Circuit breaker is open \u2014 requests are temporarily blocked", "CIRCUIT_BREAKER_OPEN", 503);
|
|
70
70
|
this.name = "CircuitBreakerOpenError";
|
|
@@ -209,22 +209,22 @@ var RateLimitTracker = class {
|
|
|
209
209
|
function createConsoleLogger() {
|
|
210
210
|
return {
|
|
211
211
|
debug(message, meta) {
|
|
212
|
-
console.log(`[
|
|
212
|
+
console.log(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
|
|
213
213
|
},
|
|
214
214
|
info(message, meta) {
|
|
215
|
-
console.info(`[
|
|
215
|
+
console.info(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
|
|
216
216
|
},
|
|
217
217
|
warn(message, meta) {
|
|
218
|
-
console.warn(`[
|
|
218
|
+
console.warn(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
|
|
219
219
|
},
|
|
220
220
|
error(message, meta) {
|
|
221
|
-
console.error(`[
|
|
221
|
+
console.error(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// src/core/version.ts
|
|
227
|
-
var SDK_VERSION = "1.
|
|
227
|
+
var SDK_VERSION = "1.5.2";
|
|
228
228
|
|
|
229
229
|
// src/shared/browser-utils.ts
|
|
230
230
|
function generateUUID() {
|
|
@@ -241,7 +241,7 @@ function generateDeviceId() {
|
|
|
241
241
|
if (typeof window === "undefined" || typeof localStorage === "undefined") {
|
|
242
242
|
return generateUUID();
|
|
243
243
|
}
|
|
244
|
-
const storageKey = "
|
|
244
|
+
const storageKey = "vesant_device_id";
|
|
245
245
|
let deviceId = localStorage.getItem(storageKey);
|
|
246
246
|
if (!deviceId) {
|
|
247
247
|
deviceId = generateUUID();
|
|
@@ -316,7 +316,7 @@ var BaseClient = class {
|
|
|
316
316
|
}
|
|
317
317
|
environment = "sandbox";
|
|
318
318
|
} else if (apiKey.startsWith("pk_live_") && environment === "sandbox") {
|
|
319
|
-
this.logger.warn('Production API key (pk_live_*) used with environment: "sandbox" \u2014
|
|
319
|
+
this.logger.warn('Production API key (pk_live_*) used with environment: "sandbox" \u2014 sandbox isolation will still be applied for backward compatibility');
|
|
320
320
|
}
|
|
321
321
|
this.config = {
|
|
322
322
|
...config,
|
|
@@ -388,10 +388,7 @@ var BaseClient = class {
|
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
if (this.config.debug) {
|
|
391
|
-
this.logger.debug(`${finalOptions.method || "GET"} ${
|
|
392
|
-
headers: finalOptions.headers,
|
|
393
|
-
body: finalOptions.body
|
|
394
|
-
});
|
|
391
|
+
this.logger.debug(`${finalOptions.method || "GET"} ${endpoint}`);
|
|
395
392
|
}
|
|
396
393
|
const response = await fetch(url, {
|
|
397
394
|
...finalOptions,
|
|
@@ -425,17 +422,17 @@ var BaseClient = class {
|
|
|
425
422
|
}
|
|
426
423
|
}
|
|
427
424
|
if (this.config.debug) {
|
|
428
|
-
this.logger.debug(
|
|
425
|
+
this.logger.debug(`Response: ${response.status}`);
|
|
429
426
|
}
|
|
430
427
|
return result;
|
|
431
428
|
} catch (error) {
|
|
432
429
|
clearTimeout(timeoutId);
|
|
433
|
-
if (error instanceof
|
|
430
|
+
if (error instanceof VesantError && error.statusCode && error.statusCode >= 500) {
|
|
434
431
|
this.circuitBreaker?.onFailure();
|
|
435
432
|
} else if (error instanceof NetworkError || error instanceof TimeoutError) {
|
|
436
433
|
this.circuitBreaker?.onFailure();
|
|
437
434
|
}
|
|
438
|
-
if (error instanceof
|
|
435
|
+
if (error instanceof VesantError && !error.requestId) {
|
|
439
436
|
error.requestId = requestId;
|
|
440
437
|
}
|
|
441
438
|
if (error instanceof Error) {
|
|
@@ -448,7 +445,7 @@ var BaseClient = class {
|
|
|
448
445
|
if (error instanceof Error) {
|
|
449
446
|
if (error.name === "AbortError") {
|
|
450
447
|
if (requestOptions?.signal?.aborted) {
|
|
451
|
-
const abortError = new
|
|
448
|
+
const abortError = new VesantError("Request aborted", "REQUEST_ABORTED");
|
|
452
449
|
abortError.requestId = requestId;
|
|
453
450
|
throw abortError;
|
|
454
451
|
}
|
|
@@ -457,7 +454,7 @@ var BaseClient = class {
|
|
|
457
454
|
timeoutError.requestId = requestId;
|
|
458
455
|
throw timeoutError;
|
|
459
456
|
}
|
|
460
|
-
if (error instanceof
|
|
457
|
+
if (error instanceof VesantError) {
|
|
461
458
|
throw error;
|
|
462
459
|
}
|
|
463
460
|
}
|
|
@@ -480,7 +477,7 @@ var BaseClient = class {
|
|
|
480
477
|
if (requestOptions?.signal?.aborted) {
|
|
481
478
|
throw lastError;
|
|
482
479
|
}
|
|
483
|
-
if (lastError instanceof
|
|
480
|
+
if (lastError instanceof VesantError && lastError.statusCode && lastError.statusCode >= 400 && lastError.statusCode < 500 && lastError.statusCode !== 429) {
|
|
484
481
|
throw lastError;
|
|
485
482
|
}
|
|
486
483
|
if (attempt === retries) {
|
|
@@ -508,13 +505,15 @@ var BaseClient = class {
|
|
|
508
505
|
const createError = () => {
|
|
509
506
|
switch (status) {
|
|
510
507
|
case 400:
|
|
511
|
-
return new
|
|
508
|
+
return new VesantError(message, "BAD_REQUEST", 400);
|
|
512
509
|
case 401:
|
|
513
510
|
return new AuthenticationError(message);
|
|
514
511
|
case 403:
|
|
515
|
-
return new
|
|
512
|
+
return new VesantError(message, "FORBIDDEN", 403);
|
|
516
513
|
case 404:
|
|
517
|
-
return new
|
|
514
|
+
return new VesantError(message, "NOT_FOUND", 404);
|
|
515
|
+
case 409:
|
|
516
|
+
return new VesantError(message, "DUPLICATE_PROFILE", 409);
|
|
518
517
|
case 429: {
|
|
519
518
|
const retryAfter = data.retry_after || data.retryAfter;
|
|
520
519
|
return new RateLimitError(retryAfter);
|
|
@@ -525,7 +524,7 @@ var BaseClient = class {
|
|
|
525
524
|
case 504:
|
|
526
525
|
return new ServiceUnavailableError(message);
|
|
527
526
|
default:
|
|
528
|
-
return new
|
|
527
|
+
return new VesantError(message, "UNKNOWN_ERROR", status);
|
|
529
528
|
}
|
|
530
529
|
};
|
|
531
530
|
const error = createError();
|
|
@@ -1269,8 +1268,8 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1269
1268
|
requestOptions
|
|
1270
1269
|
);
|
|
1271
1270
|
} catch (error) {
|
|
1272
|
-
if (error instanceof
|
|
1273
|
-
throw new
|
|
1271
|
+
if (error instanceof VesantError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
|
|
1272
|
+
throw new VesantError("Profile not found", "NOT_FOUND", 404);
|
|
1274
1273
|
}
|
|
1275
1274
|
throw error;
|
|
1276
1275
|
}
|
|
@@ -1320,7 +1319,7 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1320
1319
|
try {
|
|
1321
1320
|
return await this.getProfile(customerId, requestOptions);
|
|
1322
1321
|
} catch (error) {
|
|
1323
|
-
if (error instanceof
|
|
1322
|
+
if (error instanceof VesantError && error.code === "NOT_FOUND") {
|
|
1324
1323
|
return await this.createProfile(createRequest, requestOptions);
|
|
1325
1324
|
}
|
|
1326
1325
|
throw error;
|
|
@@ -1487,8 +1486,6 @@ var ComplianceClient = class {
|
|
|
1487
1486
|
if (this.config.debug) {
|
|
1488
1487
|
this.logger.debug("Registration verification complete", {
|
|
1489
1488
|
allowed: true,
|
|
1490
|
-
riskScore: geoVerification.risk_score,
|
|
1491
|
-
profileId: profile.id,
|
|
1492
1489
|
requiresKYC,
|
|
1493
1490
|
requiresEDD
|
|
1494
1491
|
});
|
|
@@ -1504,16 +1501,14 @@ var ComplianceClient = class {
|
|
|
1504
1501
|
};
|
|
1505
1502
|
} catch (error) {
|
|
1506
1503
|
if (this.config.debug) {
|
|
1507
|
-
this.logger.error("Registration verification failed", {
|
|
1504
|
+
this.logger.error("Registration verification failed", {
|
|
1505
|
+
code: error instanceof Error ? error.code : void 0,
|
|
1506
|
+
message: error instanceof Error ? error.message : "Unknown error"
|
|
1507
|
+
});
|
|
1508
1508
|
}
|
|
1509
1509
|
throw new ComplianceError(
|
|
1510
1510
|
"Registration verification failed",
|
|
1511
|
-
|
|
1512
|
-
stage: geoVerification ? "profile_creation" : "geo_verification",
|
|
1513
|
-
geoRecordId: geoVerification?.record_id,
|
|
1514
|
-
customerId: request.customerId,
|
|
1515
|
-
cause: error
|
|
1516
|
-
},
|
|
1511
|
+
error instanceof Error ? error.message : void 0,
|
|
1517
1512
|
geoVerification ? "PROFILE_CREATION_FAILED" : "GEO_VERIFICATION_FAILED"
|
|
1518
1513
|
);
|
|
1519
1514
|
}
|
|
@@ -1730,7 +1725,7 @@ var ComplianceClient = class {
|
|
|
1730
1725
|
processingTime: Date.now() - startTime
|
|
1731
1726
|
};
|
|
1732
1727
|
} catch (error) {
|
|
1733
|
-
throw new ComplianceError("Login verification failed", error);
|
|
1728
|
+
throw new ComplianceError("Login verification failed", error instanceof Error ? error.message : void 0);
|
|
1734
1729
|
}
|
|
1735
1730
|
}
|
|
1736
1731
|
/**
|
|
@@ -1809,7 +1804,7 @@ var ComplianceClient = class {
|
|
|
1809
1804
|
processingTime: Date.now() - startTime
|
|
1810
1805
|
};
|
|
1811
1806
|
} catch (error) {
|
|
1812
|
-
throw new ComplianceError("Transaction verification failed", error);
|
|
1807
|
+
throw new ComplianceError("Transaction verification failed", error instanceof Error ? error.message : void 0);
|
|
1813
1808
|
}
|
|
1814
1809
|
}
|
|
1815
1810
|
/**
|
|
@@ -1855,7 +1850,7 @@ var ComplianceClient = class {
|
|
|
1855
1850
|
async createProfileFromGeo(customerId, geoVerification, customerData) {
|
|
1856
1851
|
if (!customerData?.email || !customerData?.fullName) {
|
|
1857
1852
|
this.logger.warn(
|
|
1858
|
-
|
|
1853
|
+
"Creating profile with incomplete data. Profiles should be created during registration with complete customer information."
|
|
1859
1854
|
);
|
|
1860
1855
|
}
|
|
1861
1856
|
return this.riskClient.createProfile({
|