vesant-sdk 1.4.4 → 1.5.0

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 (65) hide show
  1. package/dist/{client-BlAt791q.d.ts → client-3cBb_Pp-.d.ts} +4 -4
  2. package/dist/{client-CY41e2Z_.d.mts → client-BQRONu8q.d.mts} +9 -5
  3. package/dist/{client-CY41e2Z_.d.ts → client-BQRONu8q.d.ts} +9 -5
  4. package/dist/{client-oo_3-0YW.d.mts → client-DKqyESgT.d.mts} +4 -4
  5. package/dist/compliance/index.d.mts +7 -7
  6. package/dist/compliance/index.d.ts +7 -7
  7. package/dist/compliance/index.js +55 -51
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +55 -51
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/decisions/index.d.mts +2 -2
  12. package/dist/decisions/index.d.ts +2 -2
  13. package/dist/decisions/index.js +41 -33
  14. package/dist/decisions/index.js.map +1 -1
  15. package/dist/decisions/index.mjs +41 -33
  16. package/dist/decisions/index.mjs.map +1 -1
  17. package/dist/geolocation/index.d.mts +4 -4
  18. package/dist/geolocation/index.d.ts +4 -4
  19. package/dist/geolocation/index.js +42 -34
  20. package/dist/geolocation/index.js.map +1 -1
  21. package/dist/geolocation/index.mjs +42 -34
  22. package/dist/geolocation/index.mjs.map +1 -1
  23. package/dist/index.d.mts +23 -19
  24. package/dist/index.d.ts +23 -19
  25. package/dist/index.js +58 -52
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +58 -53
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/kyc/core.d.mts +3 -3
  30. package/dist/kyc/core.d.ts +3 -3
  31. package/dist/kyc/core.js +41 -33
  32. package/dist/kyc/core.js.map +1 -1
  33. package/dist/kyc/core.mjs +41 -33
  34. package/dist/kyc/core.mjs.map +1 -1
  35. package/dist/kyc/index.d.mts +7 -7
  36. package/dist/kyc/index.d.ts +7 -7
  37. package/dist/kyc/index.js +41 -33
  38. package/dist/kyc/index.js.map +1 -1
  39. package/dist/kyc/index.mjs +41 -33
  40. package/dist/kyc/index.mjs.map +1 -1
  41. package/dist/react.d.mts +6 -6
  42. package/dist/react.d.ts +6 -6
  43. package/dist/react.js +5 -5
  44. package/dist/react.js.map +1 -1
  45. package/dist/react.mjs +5 -5
  46. package/dist/react.mjs.map +1 -1
  47. package/dist/risk-profile/index.d.mts +4 -4
  48. package/dist/risk-profile/index.d.ts +4 -4
  49. package/dist/risk-profile/index.js +44 -36
  50. package/dist/risk-profile/index.js.map +1 -1
  51. package/dist/risk-profile/index.mjs +44 -36
  52. package/dist/risk-profile/index.mjs.map +1 -1
  53. package/dist/scores/index.d.mts +2 -2
  54. package/dist/scores/index.d.ts +2 -2
  55. package/dist/scores/index.js +41 -33
  56. package/dist/scores/index.js.map +1 -1
  57. package/dist/scores/index.mjs +41 -33
  58. package/dist/scores/index.mjs.map +1 -1
  59. package/dist/{types-DZHongaK.d.mts → types-B1OzEQR3.d.mts} +1 -1
  60. package/dist/{types-DZHongaK.d.ts → types-B1OzEQR3.d.ts} +1 -1
  61. package/dist/{types-DLC7Sfy5.d.ts → types-BnL66DB3.d.ts} +2 -2
  62. package/dist/{types-jaLuzruy.d.mts → types-_hsTA3Ez.d.mts} +2 -2
  63. package/dist/webhooks/index.d.mts +1 -1
  64. package/dist/webhooks/index.d.ts +1 -1
  65. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CY41e2Z_.js';
2
- import { P as PaginationParams } from './types-DZHongaK.js';
1
+ import { L as Logger, B as BaseClient, R as RequestOptions } from './client-BQRONu8q.js';
2
+ import { P as PaginationParams } from './types-B1OzEQR3.js';
3
3
 
4
4
  interface DeviceFingerprintRequest {
5
5
  device_id: string;
@@ -728,7 +728,7 @@ interface UseLocationCaptureResult {
728
728
  }
729
729
 
730
730
  /**
731
- * GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
731
+ * GeolocationClient - TypeScript SDK for Vesant Geolocation & Compliance Service
732
732
  *
733
733
  * Provides type-safe methods to interact with the geolocation service API.
734
734
  * Extends BaseClient for consistent retry logic, timeout handling, and error management.
@@ -737,7 +737,7 @@ interface UseLocationCaptureResult {
737
737
  /**
738
738
  * GeolocationClient extends BaseClient for:
739
739
  * - Consistent retry logic with exponential backoff
740
- * - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
740
+ * - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
741
741
  * - Automatic timeout management
742
742
  * - Debug logging
743
743
  *
@@ -99,7 +99,7 @@ interface BaseClientConfig {
99
99
  /** Enable rate limit header tracking (default: false) */
100
100
  enableRateLimitTracking?: boolean;
101
101
  }
102
- interface CGSConfig {
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
- /** CGSConfig with core fields required, enterprise features remain optional */
133
- type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
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 CGS SDK clients
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 RequestInterceptor as a, type BaseClientConfig as b, type CGSConfig as c, type RequiredCGSConfig as d, type RequiredBaseClientConfig as e, type CircuitBreakerState as f, type CircuitBreakerStatus as g, CircuitBreaker as h, type RateLimitStatus as i, RateLimitTracker as j };
238
+ export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type RequestInterceptor as a, type BaseClientConfig 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 CGSConfig {
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
- /** CGSConfig with core fields required, enterprise features remain optional */
133
- type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
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 CGS SDK clients
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 RequestInterceptor as a, type BaseClientConfig as b, type CGSConfig as c, type RequiredCGSConfig as d, type RequiredBaseClientConfig as e, type CircuitBreakerState as f, type CircuitBreakerStatus as g, CircuitBreaker as h, type RateLimitStatus as i, RateLimitTracker as j };
238
+ export { BaseClient as B, type CircuitBreakerConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type RequestInterceptor as a, type BaseClientConfig 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,5 +1,5 @@
1
- import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CY41e2Z_.mjs';
2
- import { P as PaginationParams } from './types-DZHongaK.mjs';
1
+ import { L as Logger, B as BaseClient, R as RequestOptions } from './client-BQRONu8q.mjs';
2
+ import { P as PaginationParams } from './types-B1OzEQR3.mjs';
3
3
 
4
4
  interface DeviceFingerprintRequest {
5
5
  device_id: string;
@@ -728,7 +728,7 @@ interface UseLocationCaptureResult {
728
728
  }
729
729
 
730
730
  /**
731
- * GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
731
+ * GeolocationClient - TypeScript SDK for Vesant Geolocation & Compliance Service
732
732
  *
733
733
  * Provides type-safe methods to interact with the geolocation service API.
734
734
  * Extends BaseClient for consistent retry logic, timeout handling, and error management.
@@ -737,7 +737,7 @@ interface UseLocationCaptureResult {
737
737
  /**
738
738
  * GeolocationClient extends BaseClient for:
739
739
  * - Consistent retry logic with exponential backoff
740
- * - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
740
+ * - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
741
741
  * - Automatic timeout management
742
742
  * - Debug logging
743
743
  *
@@ -1,9 +1,9 @@
1
- import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-oo_3-0YW.mjs';
2
- export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-oo_3-0YW.mjs';
1
+ import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-DKqyESgT.mjs';
2
+ export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-DKqyESgT.mjs';
3
3
  import { RiskProfileClient } from '../risk-profile/index.mjs';
4
- import { c as CGSConfig, R as RequestOptions } from '../client-CY41e2Z_.mjs';
5
- import { C as CustomerProfile } from '../types-jaLuzruy.mjs';
6
- import { E as EntityType, P as PaginationParams } from '../types-DZHongaK.mjs';
4
+ import { V as VesantConfig, R as RequestOptions } from '../client-BQRONu8q.mjs';
5
+ import { C as CustomerProfile } from '../types-_hsTA3Ez.mjs';
6
+ import { E as EntityType, P as PaginationParams } from '../types-B1OzEQR3.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
- * GeoComply-style approach: SDK is the primary data injection point.
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: CGSConfig);
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, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-BlAt791q.js';
2
- export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-BlAt791q.js';
1
+ import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-3cBb_Pp-.js';
2
+ export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-3cBb_Pp-.js';
3
3
  import { RiskProfileClient } from '../risk-profile/index.js';
4
- import { c as CGSConfig, R as RequestOptions } from '../client-CY41e2Z_.js';
5
- import { C as CustomerProfile } from '../types-DLC7Sfy5.js';
6
- import { E as EntityType, P as PaginationParams } from '../types-DZHongaK.js';
4
+ import { V as VesantConfig, R as RequestOptions } from '../client-BQRONu8q.js';
5
+ import { C as CustomerProfile } from '../types-BnL66DB3.js';
6
+ import { E as EntityType, P as PaginationParams } from '../types-B1OzEQR3.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
- * GeoComply-style approach: SDK is the primary data injection point.
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: CGSConfig);
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,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
3
  // src/core/errors.ts
4
- var CGSError = class _CGSError extends Error {
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 = "CGSError";
11
- Object.setPrototypeOf(this, _CGSError.prototype);
10
+ this.name = "VesantError";
11
+ Object.setPrototypeOf(this, _VesantError.prototype);
12
12
  }
13
13
  };
14
- var NetworkError = class _NetworkError extends CGSError {
14
+ var NetworkError = class _NetworkError extends VesantError {
15
15
  constructor(message, originalError) {
16
- super(message, "NETWORK_ERROR", void 0, { originalError });
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 CGSError {
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 CGSError {
30
- constructor(message) {
31
- super(`${message} is unavailable`, "SERVICE_UNAVAILABLE", 503, { service: message });
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 CGSError {
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 CGSError {
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 CGSError {
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 CGSError {
59
+ var ComplianceError = class _ComplianceError extends VesantError {
60
60
  constructor(message, originalError, code = "COMPLIANCE_ERROR") {
61
- super(message, code, void 0, { originalError });
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 CGSError {
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(`[CGS SDK] ${message}`, meta !== void 0 ? meta : "");
212
+ console.log(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
213
213
  },
214
214
  info(message, meta) {
215
- console.info(`[CGS SDK] ${message}`, meta !== void 0 ? meta : "");
215
+ console.info(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
216
216
  },
217
217
  warn(message, meta) {
218
- console.warn(`[CGS SDK] ${message}`, meta !== void 0 ? meta : "");
218
+ console.warn(`[Vesant SDK] ${message}`, meta !== void 0 ? meta : "");
219
219
  },
220
220
  error(message, meta) {
221
- console.error(`[CGS SDK] ${message}`, meta !== void 0 ? meta : "");
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.4.4";
227
+ var SDK_VERSION = "1.5.0";
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 = "cgs_device_id";
244
+ const storageKey = "vesant_device_id";
245
245
  let deviceId = localStorage.getItem(storageKey);
246
246
  if (!deviceId) {
247
247
  deviceId = generateUUID();
@@ -308,9 +308,20 @@ var BaseClient = class {
308
308
  }
309
309
  this.interceptors = config.interceptors || [];
310
310
  this.logger = config.logger || createConsoleLogger();
311
+ let environment = config.environment;
312
+ const apiKey = config.apiKey || "";
313
+ if (apiKey.startsWith("pk_test_")) {
314
+ if (environment === "production") {
315
+ this.logger.warn('Sandbox API key (pk_test_*) used with environment: "production" \u2014 overriding to "sandbox"');
316
+ }
317
+ environment = "sandbox";
318
+ } else if (apiKey.startsWith("pk_live_") && environment === "sandbox") {
319
+ this.logger.warn('Production API key (pk_live_*) used with environment: "sandbox" \u2014 sandbox isolation will still be applied for backward compatibility');
320
+ }
311
321
  this.config = {
312
322
  ...config,
313
- apiKey: config.apiKey || "",
323
+ apiKey,
324
+ environment,
314
325
  headers: config.headers || {},
315
326
  timeout: config.timeout || 1e4,
316
327
  retries: config.retries || 3,
@@ -377,10 +388,7 @@ var BaseClient = class {
377
388
  }
378
389
  }
379
390
  if (this.config.debug) {
380
- this.logger.debug(`${finalOptions.method || "GET"} ${url}`, {
381
- headers: finalOptions.headers,
382
- body: finalOptions.body
383
- });
391
+ this.logger.debug(`${finalOptions.method || "GET"} ${endpoint}`);
384
392
  }
385
393
  const response = await fetch(url, {
386
394
  ...finalOptions,
@@ -414,17 +422,17 @@ var BaseClient = class {
414
422
  }
415
423
  }
416
424
  if (this.config.debug) {
417
- this.logger.debug("Response:", { data: result });
425
+ this.logger.debug(`Response: ${response.status}`);
418
426
  }
419
427
  return result;
420
428
  } catch (error) {
421
429
  clearTimeout(timeoutId);
422
- if (error instanceof CGSError && error.statusCode && error.statusCode >= 500) {
430
+ if (error instanceof VesantError && error.statusCode && error.statusCode >= 500) {
423
431
  this.circuitBreaker?.onFailure();
424
432
  } else if (error instanceof NetworkError || error instanceof TimeoutError) {
425
433
  this.circuitBreaker?.onFailure();
426
434
  }
427
- if (error instanceof CGSError && !error.requestId) {
435
+ if (error instanceof VesantError && !error.requestId) {
428
436
  error.requestId = requestId;
429
437
  }
430
438
  if (error instanceof Error) {
@@ -437,7 +445,7 @@ var BaseClient = class {
437
445
  if (error instanceof Error) {
438
446
  if (error.name === "AbortError") {
439
447
  if (requestOptions?.signal?.aborted) {
440
- const abortError = new CGSError("Request aborted", "REQUEST_ABORTED");
448
+ const abortError = new VesantError("Request aborted", "REQUEST_ABORTED");
441
449
  abortError.requestId = requestId;
442
450
  throw abortError;
443
451
  }
@@ -446,7 +454,7 @@ var BaseClient = class {
446
454
  timeoutError.requestId = requestId;
447
455
  throw timeoutError;
448
456
  }
449
- if (error instanceof CGSError) {
457
+ if (error instanceof VesantError) {
450
458
  throw error;
451
459
  }
452
460
  }
@@ -469,7 +477,7 @@ var BaseClient = class {
469
477
  if (requestOptions?.signal?.aborted) {
470
478
  throw lastError;
471
479
  }
472
- if (lastError instanceof CGSError && lastError.statusCode && lastError.statusCode >= 400 && lastError.statusCode < 500 && lastError.statusCode !== 429) {
480
+ if (lastError instanceof VesantError && lastError.statusCode && lastError.statusCode >= 400 && lastError.statusCode < 500 && lastError.statusCode !== 429) {
473
481
  throw lastError;
474
482
  }
475
483
  if (attempt === retries) {
@@ -497,13 +505,13 @@ var BaseClient = class {
497
505
  const createError = () => {
498
506
  switch (status) {
499
507
  case 400:
500
- return new CGSError(message, "BAD_REQUEST", 400, data);
508
+ return new VesantError(message, "BAD_REQUEST", 400);
501
509
  case 401:
502
510
  return new AuthenticationError(message);
503
511
  case 403:
504
- return new CGSError(message, "FORBIDDEN", 403, data);
512
+ return new VesantError(message, "FORBIDDEN", 403);
505
513
  case 404:
506
- return new CGSError(message, "NOT_FOUND", 404, data);
514
+ return new VesantError(message, "NOT_FOUND", 404);
507
515
  case 429: {
508
516
  const retryAfter = data.retry_after || data.retryAfter;
509
517
  return new RateLimitError(retryAfter);
@@ -514,7 +522,7 @@ var BaseClient = class {
514
522
  case 504:
515
523
  return new ServiceUnavailableError(message);
516
524
  default:
517
- return new CGSError(message, "UNKNOWN_ERROR", status, data);
525
+ return new VesantError(message, "UNKNOWN_ERROR", status);
518
526
  }
519
527
  };
520
528
  const error = createError();
@@ -1258,8 +1266,8 @@ var RiskProfileClient = class extends BaseClient {
1258
1266
  requestOptions
1259
1267
  );
1260
1268
  } catch (error) {
1261
- if (error instanceof CGSError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
1262
- throw new CGSError(`Profile not found for customer ID: ${customerId}`, "NOT_FOUND", 404);
1269
+ if (error instanceof VesantError && (error.statusCode === 404 || error.code === "NOT_FOUND")) {
1270
+ throw new VesantError("Profile not found", "NOT_FOUND", 404);
1263
1271
  }
1264
1272
  throw error;
1265
1273
  }
@@ -1309,7 +1317,7 @@ var RiskProfileClient = class extends BaseClient {
1309
1317
  try {
1310
1318
  return await this.getProfile(customerId, requestOptions);
1311
1319
  } catch (error) {
1312
- if (error instanceof CGSError && error.code === "NOT_FOUND") {
1320
+ if (error instanceof VesantError && error.code === "NOT_FOUND") {
1313
1321
  return await this.createProfile(createRequest, requestOptions);
1314
1322
  }
1315
1323
  throw error;
@@ -1476,8 +1484,6 @@ var ComplianceClient = class {
1476
1484
  if (this.config.debug) {
1477
1485
  this.logger.debug("Registration verification complete", {
1478
1486
  allowed: true,
1479
- riskScore: geoVerification.risk_score,
1480
- profileId: profile.id,
1481
1487
  requiresKYC,
1482
1488
  requiresEDD
1483
1489
  });
@@ -1493,16 +1499,14 @@ var ComplianceClient = class {
1493
1499
  };
1494
1500
  } catch (error) {
1495
1501
  if (this.config.debug) {
1496
- this.logger.error("Registration verification failed", { error });
1502
+ this.logger.error("Registration verification failed", {
1503
+ code: error instanceof Error ? error.code : void 0,
1504
+ message: error instanceof Error ? error.message : "Unknown error"
1505
+ });
1497
1506
  }
1498
1507
  throw new ComplianceError(
1499
1508
  "Registration verification failed",
1500
- {
1501
- stage: geoVerification ? "profile_creation" : "geo_verification",
1502
- geoRecordId: geoVerification?.record_id,
1503
- customerId: request.customerId,
1504
- cause: error
1505
- },
1509
+ error instanceof Error ? error.message : void 0,
1506
1510
  geoVerification ? "PROFILE_CREATION_FAILED" : "GEO_VERIFICATION_FAILED"
1507
1511
  );
1508
1512
  }
@@ -1719,7 +1723,7 @@ var ComplianceClient = class {
1719
1723
  processingTime: Date.now() - startTime
1720
1724
  };
1721
1725
  } catch (error) {
1722
- throw new ComplianceError("Login verification failed", error);
1726
+ throw new ComplianceError("Login verification failed", error instanceof Error ? error.message : void 0);
1723
1727
  }
1724
1728
  }
1725
1729
  /**
@@ -1798,7 +1802,7 @@ var ComplianceClient = class {
1798
1802
  processingTime: Date.now() - startTime
1799
1803
  };
1800
1804
  } catch (error) {
1801
- throw new ComplianceError("Transaction verification failed", error);
1805
+ throw new ComplianceError("Transaction verification failed", error instanceof Error ? error.message : void 0);
1802
1806
  }
1803
1807
  }
1804
1808
  /**
@@ -1844,7 +1848,7 @@ var ComplianceClient = class {
1844
1848
  async createProfileFromGeo(customerId, geoVerification, customerData) {
1845
1849
  if (!customerData?.email || !customerData?.fullName) {
1846
1850
  this.logger.warn(
1847
- `Creating profile for ${customerId} with incomplete data. Profiles should be created during registration with complete customer information.`
1851
+ "Creating profile with incomplete data. Profiles should be created during registration with complete customer information."
1848
1852
  );
1849
1853
  }
1850
1854
  return this.riskClient.createProfile({