vesant-sdk 1.8.0-dev.31d63f0 → 1.8.0-dev.9f7204d

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 (42) hide show
  1. package/README.md +5 -3
  2. package/dist/{client-DUHC-68_.d.ts → client-4oLoc31v.d.ts} +1 -1
  3. package/dist/{client-5q4whhGu.d.mts → client-CJI8VO1i.d.mts} +1 -1
  4. package/dist/compliance/index.d.mts +2 -2
  5. package/dist/compliance/index.d.ts +2 -2
  6. package/dist/compliance/index.js +19 -3
  7. package/dist/compliance/index.js.map +1 -1
  8. package/dist/compliance/index.mjs +19 -3
  9. package/dist/compliance/index.mjs.map +1 -1
  10. package/dist/index.d.mts +3 -3
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +72 -14
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +71 -15
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/kyc/core.d.mts +2 -2
  17. package/dist/kyc/core.d.ts +2 -2
  18. package/dist/kyc/core.js +52 -11
  19. package/dist/kyc/core.js.map +1 -1
  20. package/dist/kyc/core.mjs +52 -12
  21. package/dist/kyc/core.mjs.map +1 -1
  22. package/dist/kyc/index.d.mts +156 -12
  23. package/dist/kyc/index.d.ts +156 -12
  24. package/dist/kyc/index.js +52 -11
  25. package/dist/kyc/index.js.map +1 -1
  26. package/dist/kyc/index.mjs +52 -12
  27. package/dist/kyc/index.mjs.map +1 -1
  28. package/dist/react.d.mts +21 -3
  29. package/dist/react.d.ts +21 -3
  30. package/dist/react.js +8 -1
  31. package/dist/react.js.map +1 -1
  32. package/dist/react.mjs +8 -1
  33. package/dist/react.mjs.map +1 -1
  34. package/dist/risk-profile/index.d.mts +16 -6
  35. package/dist/risk-profile/index.d.ts +16 -6
  36. package/dist/risk-profile/index.js +18 -2
  37. package/dist/risk-profile/index.js.map +1 -1
  38. package/dist/risk-profile/index.mjs +18 -3
  39. package/dist/risk-profile/index.mjs.map +1 -1
  40. package/dist/{types-UGyDl1fd.d.ts → types-1kI4SsKB.d.ts} +44 -1
  41. package/dist/{types-BOFaMQxI.d.mts → types-DfbnIaW_.d.mts} +44 -1
  42. package/package.json +1 -1
package/dist/react.d.mts CHANGED
@@ -1,7 +1,7 @@
1
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';
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-CJI8VO1i.mjs';
3
3
  import { RiskProfileClient } from './risk-profile/index.mjs';
4
- import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
4
+ import { C as CustomerProfile, j as UpdateProfileResult } from './types-DfbnIaW_.mjs';
5
5
  import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
6
6
  import React$1 from 'react';
7
7
  import './client-q9fN8Hhf.mjs';
@@ -221,7 +221,13 @@ interface UseCustomerProfileResult {
221
221
  loading: boolean;
222
222
  error: Error | null;
223
223
  fetchProfile: () => Promise<CustomerProfile>;
224
- updateProfile: (updates: Partial<CustomerProfile>) => Promise<CustomerProfile>;
224
+ /**
225
+ * Update the loaded profile. Resolves to the updated profile, or to a
226
+ * `ProfileUpdateHeldResponse` when the tenant holds a name / date of birth /
227
+ * address change behind KYC — narrow with `isProfileUpdateHeld`. The hook's
228
+ * `profile` state is updated either way (with the profile as stored).
229
+ */
230
+ updateProfile: (updates: Partial<CustomerProfile>) => Promise<UpdateProfileResult>;
225
231
  refresh: () => Promise<CustomerProfile>;
226
232
  }
227
233
  /**
@@ -337,6 +343,9 @@ declare function useKycSubmission(client: KycClient, options?: UseKycSubmissionO
337
343
  * );
338
344
  * }
339
345
  * ```
346
+ *
347
+ * @remarks Console session only: `listKycRequests` and `updateKycStatus` need a
348
+ * dashboard login token. Only `getKycRequest` works with a tenant API key.
340
349
  */
341
350
  declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptions): UseKycRequestsResult;
342
351
  /**
@@ -376,6 +385,9 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
376
385
  * );
377
386
  * }
378
387
  * ```
388
+ *
389
+ * @remarks Console session only: the alert endpoints need a dashboard login
390
+ * token and fail with a tenant API key.
379
391
  */
380
392
  declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions): UseKycAlertsResult;
381
393
  /**
@@ -407,6 +419,9 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
407
419
  * );
408
420
  * }
409
421
  * ```
422
+ *
423
+ * @remarks Console session only: the overview endpoint needs a dashboard login
424
+ * token and fails with a tenant API key.
410
425
  */
411
426
  declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
412
427
  /**
@@ -438,6 +453,9 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
438
453
  * );
439
454
  * }
440
455
  * ```
456
+ *
457
+ * @remarks Console session only: the preferences endpoints need a dashboard
458
+ * login token and fail with a tenant API key.
441
459
  */
442
460
  declare function useKycPreferences(client: KycClient, autoFetch?: boolean): UseKycPreferencesResult;
443
461
  /**
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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';
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-4oLoc31v.js';
3
3
  import { RiskProfileClient } from './risk-profile/index.js';
4
- import { C as CustomerProfile } from './types-UGyDl1fd.js';
4
+ import { C as CustomerProfile, j as UpdateProfileResult } from './types-1kI4SsKB.js';
5
5
  import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
6
6
  import React$1 from 'react';
7
7
  import './client-q9fN8Hhf.js';
@@ -221,7 +221,13 @@ interface UseCustomerProfileResult {
221
221
  loading: boolean;
222
222
  error: Error | null;
223
223
  fetchProfile: () => Promise<CustomerProfile>;
224
- updateProfile: (updates: Partial<CustomerProfile>) => Promise<CustomerProfile>;
224
+ /**
225
+ * Update the loaded profile. Resolves to the updated profile, or to a
226
+ * `ProfileUpdateHeldResponse` when the tenant holds a name / date of birth /
227
+ * address change behind KYC — narrow with `isProfileUpdateHeld`. The hook's
228
+ * `profile` state is updated either way (with the profile as stored).
229
+ */
230
+ updateProfile: (updates: Partial<CustomerProfile>) => Promise<UpdateProfileResult>;
225
231
  refresh: () => Promise<CustomerProfile>;
226
232
  }
227
233
  /**
@@ -337,6 +343,9 @@ declare function useKycSubmission(client: KycClient, options?: UseKycSubmissionO
337
343
  * );
338
344
  * }
339
345
  * ```
346
+ *
347
+ * @remarks Console session only: `listKycRequests` and `updateKycStatus` need a
348
+ * dashboard login token. Only `getKycRequest` works with a tenant API key.
340
349
  */
341
350
  declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptions): UseKycRequestsResult;
342
351
  /**
@@ -376,6 +385,9 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
376
385
  * );
377
386
  * }
378
387
  * ```
388
+ *
389
+ * @remarks Console session only: the alert endpoints need a dashboard login
390
+ * token and fail with a tenant API key.
379
391
  */
380
392
  declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions): UseKycAlertsResult;
381
393
  /**
@@ -407,6 +419,9 @@ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions):
407
419
  * );
408
420
  * }
409
421
  * ```
422
+ *
423
+ * @remarks Console session only: the overview endpoint needs a dashboard login
424
+ * token and fails with a tenant API key.
410
425
  */
411
426
  declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
412
427
  /**
@@ -438,6 +453,9 @@ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptio
438
453
  * );
439
454
  * }
440
455
  * ```
456
+ *
457
+ * @remarks Console session only: the preferences endpoints need a dashboard
458
+ * login token and fail with a tenant API key.
441
459
  */
442
460
  declare function useKycPreferences(client: KycClient, autoFetch?: boolean): UseKycPreferencesResult;
443
461
  /**
package/dist/react.js CHANGED
@@ -871,6 +871,13 @@ function useTransactionVerification(client, options = {}) {
871
871
  verifyTransaction
872
872
  };
873
873
  }
874
+
875
+ // src/risk-profile/types.ts
876
+ function isProfileUpdateHeld(result) {
877
+ return typeof result === "object" && result !== null && result.status === "kyc_required" && result.kyc_required === true;
878
+ }
879
+
880
+ // src/risk-profile/hooks.ts
874
881
  function useCustomerProfile(client, customerId, options = {}) {
875
882
  const [profile, setProfile] = React.useState(null);
876
883
  const [loading, setLoading] = React.useState(false);
@@ -899,7 +906,7 @@ function useCustomerProfile(client, customerId, options = {}) {
899
906
  setError(null);
900
907
  try {
901
908
  const updated = await client.updateProfile(profileRef.current.id, updates);
902
- setProfile(updated);
909
+ setProfile(isProfileUpdateHeld(updated) ? updated.profile : updated);
903
910
  return updated;
904
911
  } catch (err) {
905
912
  const error2 = err instanceof Error ? err : new Error("Failed to update profile");