vesant-sdk 1.7.2 → 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 (61) hide show
  1. package/dist/{client-D23KhWeh.d.mts → client-5q4whhGu.d.mts} +1 -1
  2. package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
  3. package/dist/{client-B3DCAHlg.d.ts → client-DUHC-68_.d.ts} +1 -1
  4. package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
  5. package/dist/compliance/index.d.mts +2 -2
  6. package/dist/compliance/index.d.ts +2 -2
  7. package/dist/compliance/index.js +40 -2
  8. package/dist/compliance/index.js.map +1 -1
  9. package/dist/compliance/index.mjs +40 -2
  10. package/dist/compliance/index.mjs.map +1 -1
  11. package/dist/decisions/index.js +1 -1
  12. package/dist/decisions/index.js.map +1 -1
  13. package/dist/decisions/index.mjs +1 -1
  14. package/dist/decisions/index.mjs.map +1 -1
  15. package/dist/geolocation/index.d.mts +2 -2
  16. package/dist/geolocation/index.d.ts +2 -2
  17. package/dist/geolocation/index.js +40 -2
  18. package/dist/geolocation/index.js.map +1 -1
  19. package/dist/geolocation/index.mjs +40 -2
  20. package/dist/geolocation/index.mjs.map +1 -1
  21. package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
  22. package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
  23. package/dist/index.d.mts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +46 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +46 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/kyc/core.js +1 -1
  30. package/dist/kyc/core.js.map +1 -1
  31. package/dist/kyc/core.mjs +1 -1
  32. package/dist/kyc/core.mjs.map +1 -1
  33. package/dist/kyc/index.js +1 -1
  34. package/dist/kyc/index.js.map +1 -1
  35. package/dist/kyc/index.mjs +1 -1
  36. package/dist/kyc/index.mjs.map +1 -1
  37. package/dist/react.d.mts +9 -2
  38. package/dist/react.d.ts +9 -2
  39. package/dist/react.js +15 -10
  40. package/dist/react.js.map +1 -1
  41. package/dist/react.mjs +15 -10
  42. package/dist/react.mjs.map +1 -1
  43. package/dist/risk-profile/index.js +1 -1
  44. package/dist/risk-profile/index.js.map +1 -1
  45. package/dist/risk-profile/index.mjs +1 -1
  46. package/dist/risk-profile/index.mjs.map +1 -1
  47. package/dist/scores/index.js +1 -1
  48. package/dist/scores/index.js.map +1 -1
  49. package/dist/scores/index.mjs +1 -1
  50. package/dist/scores/index.mjs.map +1 -1
  51. package/dist/tax/index.js +1 -1
  52. package/dist/tax/index.js.map +1 -1
  53. package/dist/tax/index.mjs +1 -1
  54. package/dist/tax/index.mjs.map +1 -1
  55. package/dist/webhooks/index.d.mts +1 -1
  56. package/dist/webhooks/index.d.ts +1 -1
  57. package/dist/webhooks/index.js +6 -0
  58. package/dist/webhooks/index.js.map +1 -1
  59. package/dist/webhooks/index.mjs +6 -1
  60. package/dist/webhooks/index.mjs.map +1 -1
  61. package/package.json +1 -1
package/dist/react.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-BwXMQA2a.mjs';
2
- import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-D23KhWeh.mjs';
1
+ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-XDEhh9VN.mjs';
2
+ import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-5q4whhGu.mjs';
3
3
  import { RiskProfileClient } from './risk-profile/index.mjs';
4
4
  import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
5
5
  import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
@@ -64,6 +64,12 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
64
64
  /**
65
65
  * React hook for generating cipherText
66
66
  *
67
+ * The tenant's GPS requirements are read from the client before each generation.
68
+ * The client reuses a fetched copy for a short period, so this does not add a
69
+ * request per event, and a requirement changed in the compliance console takes
70
+ * effect without reloading the page. Call `refreshConfig` to apply a change
71
+ * immediately.
72
+ *
67
73
  * @example
68
74
  * ```tsx
69
75
  * function LoginForm() {
@@ -80,6 +86,7 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
80
86
  */
81
87
  declare function useCipherText(client?: GeolocationClient): {
82
88
  generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
89
+ refreshConfig: () => Promise<void>;
83
90
  configLoading: boolean;
84
91
  configError: Error | null;
85
92
  };
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-fy3trF2K.js';
2
- import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-B3DCAHlg.js';
1
+ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextOptions, l as CipherTextResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult } from './client-BaUekQT8.js';
2
+ import { e as LoginVerificationResponse, L as LoginVerificationRequest, f as RegistrationVerificationResponse, R as RegistrationVerificationRequest, h as TransactionVerificationResponse, g as TransactionVerificationRequest, C as ComplianceClient } from './client-DUHC-68_.js';
3
3
  import { RiskProfileClient } from './risk-profile/index.js';
4
4
  import { C as CustomerProfile } from './types-UGyDl1fd.js';
5
5
  import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
@@ -64,6 +64,12 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
64
64
  /**
65
65
  * React hook for generating cipherText
66
66
  *
67
+ * The tenant's GPS requirements are read from the client before each generation.
68
+ * The client reuses a fetched copy for a short period, so this does not add a
69
+ * request per event, and a requirement changed in the compliance console takes
70
+ * effect without reloading the page. Call `refreshConfig` to apply a change
71
+ * immediately.
72
+ *
67
73
  * @example
68
74
  * ```tsx
69
75
  * function LoginForm() {
@@ -80,6 +86,7 @@ declare function createDeviceFingerprint(): DeviceFingerprintRequest;
80
86
  */
81
87
  declare function useCipherText(client?: GeolocationClient): {
82
88
  generate: (options: CipherTextOptions) => Promise<CipherTextResult | null>;
89
+ refreshConfig: () => Promise<void>;
83
90
  configLoading: boolean;
84
91
  configError: Error | null;
85
92
  };
package/dist/react.js CHANGED
@@ -10,7 +10,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
10
10
  // src/geolocation/hooks.ts
11
11
 
12
12
  // src/core/version.ts
13
- var SDK_VERSION = "1.7.2";
13
+ var SDK_VERSION = "1.8.0";
14
14
 
15
15
  // src/core/errors.ts
16
16
  var VesantError = class _VesantError extends Error {
@@ -429,14 +429,11 @@ function useCipherText(client) {
429
429
  const [configLoading, setConfigLoading] = React.useState(!!client);
430
430
  const [configError, setConfigError] = React.useState(null);
431
431
  const configRef = React.useRef(void 0);
432
- const configPromiseRef = React.useRef(null);
433
432
  React.useEffect(() => {
434
433
  if (!client) return;
435
434
  let cancelled = false;
436
435
  setConfigLoading(true);
437
- const promise = client.getGPSConfig();
438
- configPromiseRef.current = promise;
439
- promise.then((cfg) => {
436
+ client.getGPSConfig().then((cfg) => {
440
437
  if (!cancelled) {
441
438
  configRef.current = cfg;
442
439
  setConfigLoading(false);
@@ -451,13 +448,21 @@ function useCipherText(client) {
451
448
  cancelled = true;
452
449
  };
453
450
  }, [client]);
451
+ const refreshConfig = React.useCallback(async () => {
452
+ if (!client) return;
453
+ try {
454
+ configRef.current = await client.refreshGPSConfig();
455
+ setConfigError(null);
456
+ } catch (error) {
457
+ setConfigError(error instanceof Error ? error : new Error("Failed to refresh GPS config"));
458
+ }
459
+ }, [client]);
454
460
  const generate = React.useCallback(
455
461
  async (options) => {
456
462
  try {
457
- if (configPromiseRef.current) {
463
+ if (client) {
458
464
  try {
459
- const cfg = await configPromiseRef.current;
460
- configRef.current = cfg;
465
+ configRef.current = await client.getGPSConfig();
461
466
  } catch {
462
467
  }
463
468
  }
@@ -467,9 +472,9 @@ function useCipherText(client) {
467
472
  return null;
468
473
  }
469
474
  },
470
- []
475
+ [client]
471
476
  );
472
- return { generate, configLoading, configError };
477
+ return { generate, refreshConfig, configLoading, configError };
473
478
  }
474
479
  function useLocationRequests(client, options = {}) {
475
480
  const [requests, setRequests] = React.useState([]);