vesant-sdk 1.7.1-next.edfc6a6 → 1.7.2-dev.03a9c84
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 +4 -0
- package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +40 -2
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +40 -2
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/geolocation/index.js +40 -2
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +40 -2
- 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 +110 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -31
- 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 +71 -30
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +71 -30
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +215 -52
- package/dist/kyc/index.d.ts +215 -52
- package/dist/kyc/index.js +71 -30
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +71 -30
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +126 -48
- package/dist/react.d.ts +126 -48
- package/dist/react.js +236 -20
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +234 -21
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +1 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -1
- package/dist/tax/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -355,6 +355,10 @@ interface ComplianceClientConfig {
|
|
|
355
355
|
| `listKycRequests(filters)` | List KYC requests |
|
|
356
356
|
| `getPreferences()` | Get KYC preferences |
|
|
357
357
|
| `listAlerts(filters)` | List KYC alerts |
|
|
358
|
+
| `createEventBasedFaceVerificationSession(request)` | Start a face re-verification session (backend) |
|
|
359
|
+
| `submitEventBasedFaceVerificationSession(request)` | Submit a face capture for a session |
|
|
360
|
+
| `getEventBasedFaceVerificationSessionStatus(token)` | Look up a session's current result |
|
|
361
|
+
| `retryEventBasedFaceVerificationJourney(token)` | Mint the next hosted journey after a decline |
|
|
358
362
|
|
|
359
363
|
## Documentation
|
|
360
364
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-XDEhh9VN.mjs';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.mjs';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.mjs';
|
|
4
4
|
import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
|
|
@@ -534,6 +534,15 @@ interface GeolocationClientConfig {
|
|
|
534
534
|
logger?: Logger;
|
|
535
535
|
/** Environment mode - 'sandbox' uses isolated sandbox data */
|
|
536
536
|
environment?: 'production' | 'sandbox';
|
|
537
|
+
/**
|
|
538
|
+
* How long a fetched GPS requirement config is reused before it is read again,
|
|
539
|
+
* in milliseconds (default: 300000, i.e. 5 minutes).
|
|
540
|
+
*
|
|
541
|
+
* These requirements are edited in the compliance console while your
|
|
542
|
+
* application is running, so a lower value makes changes take effect sooner at
|
|
543
|
+
* the cost of more requests. Use `refreshGPSConfig()` to re-read immediately.
|
|
544
|
+
*/
|
|
545
|
+
gpsConfigTtlMs?: number;
|
|
537
546
|
}
|
|
538
547
|
interface UseGeolocationOptions {
|
|
539
548
|
/** Auto-detect and verify user's IP on mount */
|
|
@@ -786,17 +795,9 @@ interface UseLocationCaptureResult {
|
|
|
786
795
|
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
787
796
|
*/
|
|
788
797
|
|
|
789
|
-
/**
|
|
790
|
-
* GeolocationClient extends BaseClient for:
|
|
791
|
-
* - Consistent retry logic with exponential backoff
|
|
792
|
-
* - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
|
|
793
|
-
* - Automatic timeout management
|
|
794
|
-
* - Debug logging
|
|
795
|
-
*
|
|
796
|
-
* All geolocation verification calls use requestWithRetry() to handle
|
|
797
|
-
* transient failures gracefully.
|
|
798
|
-
*/
|
|
799
798
|
declare class GeolocationClient extends BaseClient {
|
|
799
|
+
private readonly gpsConfigTtlMs;
|
|
800
|
+
private gpsConfigCache;
|
|
800
801
|
constructor(config: GeolocationClientConfig);
|
|
801
802
|
/**
|
|
802
803
|
* Verify an IP address and check compliance
|
|
@@ -857,6 +858,27 @@ declare class GeolocationClient extends BaseClient {
|
|
|
857
858
|
* ```
|
|
858
859
|
*/
|
|
859
860
|
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
861
|
+
/**
|
|
862
|
+
* Re-read the tenant's GPS requirement configuration, ignoring any copy held
|
|
863
|
+
* from an earlier read.
|
|
864
|
+
*
|
|
865
|
+
* These requirements are edited in the compliance console while your
|
|
866
|
+
* application is running. `getGPSConfig` reuses a fetched copy for a short
|
|
867
|
+
* period so a long-lived session does not call the API on every event; call
|
|
868
|
+
* this when you need a change to take effect immediately — for example right
|
|
869
|
+
* after an administrator saves new settings.
|
|
870
|
+
*
|
|
871
|
+
* @returns The current GPS requirement config per event type
|
|
872
|
+
*
|
|
873
|
+
* @example
|
|
874
|
+
* ```typescript
|
|
875
|
+
* const config = await client.refreshGPSConfig();
|
|
876
|
+
* if (config.require_gps.login) {
|
|
877
|
+
* // GPS is now required for login
|
|
878
|
+
* }
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
refreshGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
860
882
|
/**
|
|
861
883
|
* Mint a short-lived, single-use device-signals nonce.
|
|
862
884
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-BaUekQT8.js';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.js';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.js';
|
|
4
4
|
import { C as CustomerProfile } from './types-UGyDl1fd.js';
|
|
@@ -534,6 +534,15 @@ interface GeolocationClientConfig {
|
|
|
534
534
|
logger?: Logger;
|
|
535
535
|
/** Environment mode - 'sandbox' uses isolated sandbox data */
|
|
536
536
|
environment?: 'production' | 'sandbox';
|
|
537
|
+
/**
|
|
538
|
+
* How long a fetched GPS requirement config is reused before it is read again,
|
|
539
|
+
* in milliseconds (default: 300000, i.e. 5 minutes).
|
|
540
|
+
*
|
|
541
|
+
* These requirements are edited in the compliance console while your
|
|
542
|
+
* application is running, so a lower value makes changes take effect sooner at
|
|
543
|
+
* the cost of more requests. Use `refreshGPSConfig()` to re-read immediately.
|
|
544
|
+
*/
|
|
545
|
+
gpsConfigTtlMs?: number;
|
|
537
546
|
}
|
|
538
547
|
interface UseGeolocationOptions {
|
|
539
548
|
/** Auto-detect and verify user's IP on mount */
|
|
@@ -786,17 +795,9 @@ interface UseLocationCaptureResult {
|
|
|
786
795
|
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
787
796
|
*/
|
|
788
797
|
|
|
789
|
-
/**
|
|
790
|
-
* GeolocationClient extends BaseClient for:
|
|
791
|
-
* - Consistent retry logic with exponential backoff
|
|
792
|
-
* - Unified error handling (VesantError, NetworkError, TimeoutError, etc.)
|
|
793
|
-
* - Automatic timeout management
|
|
794
|
-
* - Debug logging
|
|
795
|
-
*
|
|
796
|
-
* All geolocation verification calls use requestWithRetry() to handle
|
|
797
|
-
* transient failures gracefully.
|
|
798
|
-
*/
|
|
799
798
|
declare class GeolocationClient extends BaseClient {
|
|
799
|
+
private readonly gpsConfigTtlMs;
|
|
800
|
+
private gpsConfigCache;
|
|
800
801
|
constructor(config: GeolocationClientConfig);
|
|
801
802
|
/**
|
|
802
803
|
* Verify an IP address and check compliance
|
|
@@ -857,6 +858,27 @@ declare class GeolocationClient extends BaseClient {
|
|
|
857
858
|
* ```
|
|
858
859
|
*/
|
|
859
860
|
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
861
|
+
/**
|
|
862
|
+
* Re-read the tenant's GPS requirement configuration, ignoring any copy held
|
|
863
|
+
* from an earlier read.
|
|
864
|
+
*
|
|
865
|
+
* These requirements are edited in the compliance console while your
|
|
866
|
+
* application is running. `getGPSConfig` reuses a fetched copy for a short
|
|
867
|
+
* period so a long-lived session does not call the API on every event; call
|
|
868
|
+
* this when you need a change to take effect immediately — for example right
|
|
869
|
+
* after an administrator saves new settings.
|
|
870
|
+
*
|
|
871
|
+
* @returns The current GPS requirement config per event type
|
|
872
|
+
*
|
|
873
|
+
* @example
|
|
874
|
+
* ```typescript
|
|
875
|
+
* const config = await client.refreshGPSConfig();
|
|
876
|
+
* if (config.require_gps.login) {
|
|
877
|
+
* // GPS is now required for login
|
|
878
|
+
* }
|
|
879
|
+
* ```
|
|
880
|
+
*/
|
|
881
|
+
refreshGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
860
882
|
/**
|
|
861
883
|
* Mint a short-lived, single-use device-signals nonce.
|
|
862
884
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as BlockReason } from '../types-CBQRNL-l.mjs';
|
|
2
|
-
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-
|
|
3
|
-
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-
|
|
2
|
+
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-5q4whhGu.mjs';
|
|
3
|
+
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-XDEhh9VN.mjs';
|
|
4
4
|
import '../risk-profile/index.mjs';
|
|
5
5
|
import '../client-q9fN8Hhf.mjs';
|
|
6
6
|
import '../types-BOFaMQxI.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as BlockReason } from '../types-CBQRNL-l.js';
|
|
2
|
-
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-
|
|
3
|
-
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-
|
|
2
|
+
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-DUHC-68_.js';
|
|
3
|
+
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-BaUekQT8.js';
|
|
4
4
|
import '../risk-profile/index.js';
|
|
5
5
|
import '../client-q9fN8Hhf.js';
|
|
6
6
|
import '../types-UGyDl1fd.js';
|
package/dist/compliance/index.js
CHANGED
|
@@ -312,7 +312,7 @@ function createConsoleLogger() {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
// src/core/version.ts
|
|
315
|
-
var SDK_VERSION = "1.7.
|
|
315
|
+
var SDK_VERSION = "1.7.2";
|
|
316
316
|
|
|
317
317
|
// src/shared/browser-utils.ts
|
|
318
318
|
function generateUUID() {
|
|
@@ -969,6 +969,7 @@ async function generateCipherText(options, config) {
|
|
|
969
969
|
}
|
|
970
970
|
|
|
971
971
|
// src/geolocation/client.ts
|
|
972
|
+
var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
|
|
972
973
|
var GeolocationClient = class extends BaseClient {
|
|
973
974
|
constructor(config) {
|
|
974
975
|
const baseConfig = {
|
|
@@ -984,6 +985,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
984
985
|
environment: config.environment
|
|
985
986
|
};
|
|
986
987
|
super(baseConfig);
|
|
988
|
+
this.gpsConfigCache = null;
|
|
989
|
+
this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
|
|
987
990
|
}
|
|
988
991
|
// ============================================================================
|
|
989
992
|
// IP Verification & Compliance
|
|
@@ -1069,7 +1072,42 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1069
1072
|
* ```
|
|
1070
1073
|
*/
|
|
1071
1074
|
async getGPSConfig(requestOptions) {
|
|
1072
|
-
|
|
1075
|
+
const cached = this.gpsConfigCache;
|
|
1076
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
1077
|
+
return cached.value;
|
|
1078
|
+
}
|
|
1079
|
+
return this.refreshGPSConfig(requestOptions);
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Re-read the tenant's GPS requirement configuration, ignoring any copy held
|
|
1083
|
+
* from an earlier read.
|
|
1084
|
+
*
|
|
1085
|
+
* These requirements are edited in the compliance console while your
|
|
1086
|
+
* application is running. `getGPSConfig` reuses a fetched copy for a short
|
|
1087
|
+
* period so a long-lived session does not call the API on every event; call
|
|
1088
|
+
* this when you need a change to take effect immediately — for example right
|
|
1089
|
+
* after an administrator saves new settings.
|
|
1090
|
+
*
|
|
1091
|
+
* @returns The current GPS requirement config per event type
|
|
1092
|
+
*
|
|
1093
|
+
* @example
|
|
1094
|
+
* ```typescript
|
|
1095
|
+
* const config = await client.refreshGPSConfig();
|
|
1096
|
+
* if (config.require_gps.login) {
|
|
1097
|
+
* // GPS is now required for login
|
|
1098
|
+
* }
|
|
1099
|
+
* ```
|
|
1100
|
+
*/
|
|
1101
|
+
async refreshGPSConfig(requestOptions) {
|
|
1102
|
+
const value = await this.requestWithRetry(
|
|
1103
|
+
"/api/v1/geo/config",
|
|
1104
|
+
void 0,
|
|
1105
|
+
void 0,
|
|
1106
|
+
void 0,
|
|
1107
|
+
requestOptions
|
|
1108
|
+
);
|
|
1109
|
+
this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
|
|
1110
|
+
return value;
|
|
1073
1111
|
}
|
|
1074
1112
|
/**
|
|
1075
1113
|
* Mint a short-lived, single-use device-signals nonce.
|