vesant-sdk 1.4.0 → 1.4.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/dist/{client-DoczGA6L.d.ts → client-BlAt791q.d.ts} +12 -1
- package/dist/{client-DzElM7u-.d.mts → client-CY41e2Z_.d.mts} +4 -8
- package/dist/{client-DzElM7u-.d.ts → client-CY41e2Z_.d.ts} +4 -8
- package/dist/{client-B6fUFAUM.d.mts → client-oo_3-0YW.d.mts} +12 -1
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +34 -16
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +34 -16
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +1 -1
- package/dist/decisions/index.d.ts +1 -1
- package/dist/decisions/index.js +2 -10
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +2 -10
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +3 -3
- package/dist/geolocation/index.d.ts +3 -3
- package/dist/geolocation/index.js +34 -16
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +34 -16
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +36 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -17
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +4 -11
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +4 -11
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +3 -1
- package/dist/kyc/index.d.ts +3 -1
- package/dist/kyc/index.js +4 -11
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +4 -11
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +1 -1
- package/dist/risk-profile/index.d.ts +1 -1
- package/dist/risk-profile/index.js +2 -10
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +2 -10
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +1 -1
- package/dist/scores/index.d.ts +1 -1
- package/dist/scores/index.js +2 -10
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +2 -10
- package/dist/scores/index.mjs.map +1 -1
- package/dist/webhooks/index.d.mts +1 -0
- package/dist/webhooks/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CY41e2Z_.js';
|
|
2
2
|
import { P as PaginationParams } from './types-DZHongaK.js';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -472,6 +472,8 @@ interface GeolocationClientConfig {
|
|
|
472
472
|
debug?: boolean;
|
|
473
473
|
/** Custom logger instance */
|
|
474
474
|
logger?: Logger;
|
|
475
|
+
/** Environment mode - 'sandbox' uses isolated sandbox data */
|
|
476
|
+
environment?: 'production' | 'sandbox';
|
|
475
477
|
}
|
|
476
478
|
interface UseGeolocationOptions {
|
|
477
479
|
/** Auto-detect and verify user's IP on mount */
|
|
@@ -804,6 +806,15 @@ declare class GeolocationClient extends BaseClient {
|
|
|
804
806
|
* ```
|
|
805
807
|
*/
|
|
806
808
|
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
809
|
+
/**
|
|
810
|
+
* Fetch the signing key from the dedicated authenticated endpoint.
|
|
811
|
+
*
|
|
812
|
+
* Falls back to getGPSConfig() for backward compatibility with older servers
|
|
813
|
+
* that don't expose `/api/v1/geo/signing-key`.
|
|
814
|
+
*
|
|
815
|
+
* @returns The signing key string, or undefined if unavailable
|
|
816
|
+
*/
|
|
817
|
+
fetchSigningKey(requestOptions?: RequestOptions): Promise<string | undefined>;
|
|
807
818
|
/**
|
|
808
819
|
* Validate a cipherText generated by the frontend SDK
|
|
809
820
|
*
|
|
@@ -92,10 +92,8 @@ interface BaseClientConfig {
|
|
|
92
92
|
interceptors?: RequestInterceptor[];
|
|
93
93
|
/** Custom logger instance */
|
|
94
94
|
logger?: Logger;
|
|
95
|
-
/** Environment mode (default: 'production') */
|
|
95
|
+
/** Environment mode (default: 'production'). When 'sandbox', adds X-Sandbox header to all requests for data isolation. */
|
|
96
96
|
environment?: 'production' | 'sandbox';
|
|
97
|
-
/** Base URL to use in sandbox mode */
|
|
98
|
-
sandboxBaseURL?: string;
|
|
99
97
|
/** Circuit breaker configuration */
|
|
100
98
|
circuitBreaker?: CircuitBreakerConfig;
|
|
101
99
|
/** Enable rate limit header tracking (default: false) */
|
|
@@ -124,19 +122,17 @@ interface CGSConfig {
|
|
|
124
122
|
interceptors?: RequestInterceptor[];
|
|
125
123
|
/** Custom logger instance */
|
|
126
124
|
logger?: Logger;
|
|
127
|
-
/** Environment mode (default: 'production') */
|
|
125
|
+
/** Environment mode (default: 'production'). When 'sandbox', adds X-Sandbox header to all requests for data isolation. */
|
|
128
126
|
environment?: 'production' | 'sandbox';
|
|
129
|
-
/** Base URL to use in sandbox mode */
|
|
130
|
-
sandboxBaseURL?: string;
|
|
131
127
|
/** Circuit breaker configuration */
|
|
132
128
|
circuitBreaker?: CircuitBreakerConfig;
|
|
133
129
|
/** Enable rate limit header tracking (default: false) */
|
|
134
130
|
enableRateLimitTracking?: boolean;
|
|
135
131
|
}
|
|
136
132
|
/** CGSConfig with core fields required, enterprise features remain optional */
|
|
137
|
-
type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | '
|
|
133
|
+
type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
138
134
|
/** BaseClientConfig with core fields required, enterprise features remain optional */
|
|
139
|
-
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | '
|
|
135
|
+
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
140
136
|
|
|
141
137
|
/**
|
|
142
138
|
* Rate limit tracking from API response headers.
|
|
@@ -92,10 +92,8 @@ interface BaseClientConfig {
|
|
|
92
92
|
interceptors?: RequestInterceptor[];
|
|
93
93
|
/** Custom logger instance */
|
|
94
94
|
logger?: Logger;
|
|
95
|
-
/** Environment mode (default: 'production') */
|
|
95
|
+
/** Environment mode (default: 'production'). When 'sandbox', adds X-Sandbox header to all requests for data isolation. */
|
|
96
96
|
environment?: 'production' | 'sandbox';
|
|
97
|
-
/** Base URL to use in sandbox mode */
|
|
98
|
-
sandboxBaseURL?: string;
|
|
99
97
|
/** Circuit breaker configuration */
|
|
100
98
|
circuitBreaker?: CircuitBreakerConfig;
|
|
101
99
|
/** Enable rate limit header tracking (default: false) */
|
|
@@ -124,19 +122,17 @@ interface CGSConfig {
|
|
|
124
122
|
interceptors?: RequestInterceptor[];
|
|
125
123
|
/** Custom logger instance */
|
|
126
124
|
logger?: Logger;
|
|
127
|
-
/** Environment mode (default: 'production') */
|
|
125
|
+
/** Environment mode (default: 'production'). When 'sandbox', adds X-Sandbox header to all requests for data isolation. */
|
|
128
126
|
environment?: 'production' | 'sandbox';
|
|
129
|
-
/** Base URL to use in sandbox mode */
|
|
130
|
-
sandboxBaseURL?: string;
|
|
131
127
|
/** Circuit breaker configuration */
|
|
132
128
|
circuitBreaker?: CircuitBreakerConfig;
|
|
133
129
|
/** Enable rate limit header tracking (default: false) */
|
|
134
130
|
enableRateLimitTracking?: boolean;
|
|
135
131
|
}
|
|
136
132
|
/** CGSConfig with core fields required, enterprise features remain optional */
|
|
137
|
-
type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | '
|
|
133
|
+
type RequiredCGSConfig = Required<Pick<CGSConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'autoCreateProfiles' | 'syncMode' | 'interceptors' | 'logger'>> & Pick<CGSConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
138
134
|
/** BaseClientConfig with core fields required, enterprise features remain optional */
|
|
139
|
-
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | '
|
|
135
|
+
type RequiredBaseClientConfig = Required<Pick<BaseClientConfig, 'baseURL' | 'tenantId' | 'apiKey' | 'headers' | 'timeout' | 'retries' | 'debug' | 'interceptors' | 'logger'>> & Pick<BaseClientConfig, 'environment' | 'circuitBreaker' | 'enableRateLimitTracking'>;
|
|
140
136
|
|
|
141
137
|
/**
|
|
142
138
|
* Rate limit tracking from API response headers.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-CY41e2Z_.mjs';
|
|
2
2
|
import { P as PaginationParams } from './types-DZHongaK.mjs';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -472,6 +472,8 @@ interface GeolocationClientConfig {
|
|
|
472
472
|
debug?: boolean;
|
|
473
473
|
/** Custom logger instance */
|
|
474
474
|
logger?: Logger;
|
|
475
|
+
/** Environment mode - 'sandbox' uses isolated sandbox data */
|
|
476
|
+
environment?: 'production' | 'sandbox';
|
|
475
477
|
}
|
|
476
478
|
interface UseGeolocationOptions {
|
|
477
479
|
/** Auto-detect and verify user's IP on mount */
|
|
@@ -804,6 +806,15 @@ declare class GeolocationClient extends BaseClient {
|
|
|
804
806
|
* ```
|
|
805
807
|
*/
|
|
806
808
|
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
809
|
+
/**
|
|
810
|
+
* Fetch the signing key from the dedicated authenticated endpoint.
|
|
811
|
+
*
|
|
812
|
+
* Falls back to getGPSConfig() for backward compatibility with older servers
|
|
813
|
+
* that don't expose `/api/v1/geo/signing-key`.
|
|
814
|
+
*
|
|
815
|
+
* @returns The signing key string, or undefined if unavailable
|
|
816
|
+
*/
|
|
817
|
+
fetchSigningKey(requestOptions?: RequestOptions): Promise<string | undefined>;
|
|
807
818
|
/**
|
|
808
819
|
* Validate a cipherText generated by the frontend SDK
|
|
809
820
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-
|
|
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-
|
|
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';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.mjs';
|
|
4
|
-
import { c as CGSConfig, R as RequestOptions } from '../client-
|
|
4
|
+
import { c as CGSConfig, R as RequestOptions } from '../client-CY41e2Z_.mjs';
|
|
5
5
|
import { C as CustomerProfile } from '../types-jaLuzruy.mjs';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-DZHongaK.mjs';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-
|
|
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-
|
|
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';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.js';
|
|
4
|
-
import { c as CGSConfig, R as RequestOptions } from '../client-
|
|
4
|
+
import { c as CGSConfig, R as RequestOptions } from '../client-CY41e2Z_.js';
|
|
5
5
|
import { C as CustomerProfile } from '../types-DLC7Sfy5.js';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-DZHongaK.js';
|
|
7
7
|
|
package/dist/compliance/index.js
CHANGED
|
@@ -224,7 +224,7 @@ function createConsoleLogger() {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// src/core/version.ts
|
|
227
|
-
var SDK_VERSION = "1.4.
|
|
227
|
+
var SDK_VERSION = "1.4.1";
|
|
228
228
|
|
|
229
229
|
// src/shared/browser-utils.ts
|
|
230
230
|
function generateUUID() {
|
|
@@ -318,12 +318,6 @@ var BaseClient = class {
|
|
|
318
318
|
interceptors: this.interceptors,
|
|
319
319
|
logger: this.logger
|
|
320
320
|
};
|
|
321
|
-
if (this.config.environment === "sandbox" && this.config.apiKey?.startsWith("pk_live_")) {
|
|
322
|
-
this.logger.warn("Production API key used with sandbox environment. Use your sandbox API key (sk_sandbox_) instead.");
|
|
323
|
-
}
|
|
324
|
-
if (this.config.environment !== "sandbox" && this.config.apiKey?.startsWith("sk_sandbox_")) {
|
|
325
|
-
this.logger.warn("Sandbox API key used with production environment. Use your production API key (pk_live_) instead.");
|
|
326
|
-
}
|
|
327
321
|
if (config.circuitBreaker) {
|
|
328
322
|
this.circuitBreaker = new CircuitBreaker(config.circuitBreaker);
|
|
329
323
|
}
|
|
@@ -347,9 +341,7 @@ var BaseClient = class {
|
|
|
347
341
|
error.requestId = requestId;
|
|
348
342
|
throw error;
|
|
349
343
|
}
|
|
350
|
-
const
|
|
351
|
-
const resolvedBaseURL = this.config.environment === "sandbox" ? this.config.sandboxBaseURL || DEFAULT_SANDBOX_URL : serviceURL || this.config.baseURL;
|
|
352
|
-
const url = `${serviceURL || resolvedBaseURL}${endpoint}`;
|
|
344
|
+
const url = `${serviceURL || this.config.baseURL}${endpoint}`;
|
|
353
345
|
const headers = {
|
|
354
346
|
"Content-Type": "application/json",
|
|
355
347
|
"X-Tenant-ID": this.config.tenantId,
|
|
@@ -794,7 +786,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
794
786
|
retries: 3,
|
|
795
787
|
// Default retry count for geolocation calls
|
|
796
788
|
debug: config.debug,
|
|
797
|
-
logger: config.logger
|
|
789
|
+
logger: config.logger,
|
|
790
|
+
environment: config.environment
|
|
798
791
|
};
|
|
799
792
|
super(baseConfig);
|
|
800
793
|
}
|
|
@@ -888,6 +881,32 @@ var GeolocationClient = class extends BaseClient {
|
|
|
888
881
|
}
|
|
889
882
|
return config;
|
|
890
883
|
}
|
|
884
|
+
/**
|
|
885
|
+
* Fetch the signing key from the dedicated authenticated endpoint.
|
|
886
|
+
*
|
|
887
|
+
* Falls back to getGPSConfig() for backward compatibility with older servers
|
|
888
|
+
* that don't expose `/api/v1/geo/signing-key`.
|
|
889
|
+
*
|
|
890
|
+
* @returns The signing key string, or undefined if unavailable
|
|
891
|
+
*/
|
|
892
|
+
async fetchSigningKey(requestOptions) {
|
|
893
|
+
try {
|
|
894
|
+
const response = await this.requestWithRetry(
|
|
895
|
+
"/api/v1/geo/signing-key",
|
|
896
|
+
void 0,
|
|
897
|
+
void 0,
|
|
898
|
+
void 0,
|
|
899
|
+
requestOptions
|
|
900
|
+
);
|
|
901
|
+
if (response.signing_key) {
|
|
902
|
+
this.cachedSigningKey = response.signing_key;
|
|
903
|
+
return response.signing_key;
|
|
904
|
+
}
|
|
905
|
+
} catch {
|
|
906
|
+
}
|
|
907
|
+
const config = await this.getGPSConfig(requestOptions);
|
|
908
|
+
return config.signing_key;
|
|
909
|
+
}
|
|
891
910
|
// ============================================================================
|
|
892
911
|
// CipherText Validation
|
|
893
912
|
// ============================================================================
|
|
@@ -1168,11 +1187,10 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1168
1187
|
let signingKey = this.cachedSigningKey;
|
|
1169
1188
|
let resolvedGpsConfig = gpsConfig;
|
|
1170
1189
|
if (!signingKey) {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1190
|
+
signingKey = await this.fetchSigningKey();
|
|
1191
|
+
}
|
|
1192
|
+
if (!resolvedGpsConfig) {
|
|
1193
|
+
resolvedGpsConfig = await this.getGPSConfig();
|
|
1176
1194
|
}
|
|
1177
1195
|
return generateCipherText(
|
|
1178
1196
|
{ ...options, signingKey: signingKey || void 0 },
|