vesant-sdk 1.7.2-next.ec7157c → 1.8.0-dev.2b9e28d

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 (66) hide show
  1. package/README.md +4 -0
  2. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  3. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  4. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  5. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  6. package/dist/compliance/index.d.mts +2 -2
  7. package/dist/compliance/index.d.ts +2 -2
  8. package/dist/compliance/index.js +40 -2
  9. package/dist/compliance/index.js.map +1 -1
  10. package/dist/compliance/index.mjs +40 -2
  11. package/dist/compliance/index.mjs.map +1 -1
  12. package/dist/decisions/index.js +1 -1
  13. package/dist/decisions/index.js.map +1 -1
  14. package/dist/decisions/index.mjs +1 -1
  15. package/dist/decisions/index.mjs.map +1 -1
  16. package/dist/geolocation/index.d.mts +2 -2
  17. package/dist/geolocation/index.d.ts +2 -2
  18. package/dist/geolocation/index.js +40 -2
  19. package/dist/geolocation/index.js.map +1 -1
  20. package/dist/geolocation/index.mjs +40 -2
  21. package/dist/geolocation/index.mjs.map +1 -1
  22. package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
  23. package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
  24. package/dist/index.d.mts +5 -5
  25. package/dist/index.d.ts +5 -5
  26. package/dist/index.js +120 -31
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +119 -32
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/kyc/core.d.mts +1 -1
  31. package/dist/kyc/core.d.ts +1 -1
  32. package/dist/kyc/core.js +75 -30
  33. package/dist/kyc/core.js.map +1 -1
  34. package/dist/kyc/core.mjs +75 -31
  35. package/dist/kyc/core.mjs.map +1 -1
  36. package/dist/kyc/index.d.mts +334 -65
  37. package/dist/kyc/index.d.ts +334 -65
  38. package/dist/kyc/index.js +75 -30
  39. package/dist/kyc/index.js.map +1 -1
  40. package/dist/kyc/index.mjs +75 -31
  41. package/dist/kyc/index.mjs.map +1 -1
  42. package/dist/react.d.mts +126 -48
  43. package/dist/react.d.ts +126 -48
  44. package/dist/react.js +258 -36
  45. package/dist/react.js.map +1 -1
  46. package/dist/react.mjs +256 -37
  47. package/dist/react.mjs.map +1 -1
  48. package/dist/risk-profile/index.js +1 -1
  49. package/dist/risk-profile/index.js.map +1 -1
  50. package/dist/risk-profile/index.mjs +1 -1
  51. package/dist/risk-profile/index.mjs.map +1 -1
  52. package/dist/scores/index.js +1 -1
  53. package/dist/scores/index.js.map +1 -1
  54. package/dist/scores/index.mjs +1 -1
  55. package/dist/scores/index.mjs.map +1 -1
  56. package/dist/tax/index.js +1 -1
  57. package/dist/tax/index.js.map +1 -1
  58. package/dist/tax/index.mjs +1 -1
  59. package/dist/tax/index.mjs.map +1 -1
  60. package/dist/webhooks/index.d.mts +1 -1
  61. package/dist/webhooks/index.d.ts +1 -1
  62. package/dist/webhooks/index.js +6 -0
  63. package/dist/webhooks/index.js.map +1 -1
  64. package/dist/webhooks/index.mjs +6 -1
  65. package/dist/webhooks/index.mjs.map +1 -1
  66. 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-BwXMQA2a.mjs';
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-fy3trF2K.js';
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-D23KhWeh.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-BwXMQA2a.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-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-B3DCAHlg.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-fy3trF2K.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-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';
@@ -312,7 +312,7 @@ function createConsoleLogger() {
312
312
  }
313
313
 
314
314
  // src/core/version.ts
315
- var SDK_VERSION = "1.7.2";
315
+ var SDK_VERSION = "1.8.0";
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
- return this.requestWithRetry("/api/v1/geo/config", void 0, void 0, void 0, requestOptions);
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.