vesant-sdk 1.8.0-dev.d4d3b0d → 1.8.0-dev.df00db7

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 (50) hide show
  1. package/README.md +1 -3
  2. package/dist/compliance/index.js +7 -6
  3. package/dist/compliance/index.js.map +1 -1
  4. package/dist/compliance/index.mjs +7 -6
  5. package/dist/compliance/index.mjs.map +1 -1
  6. package/dist/decisions/index.js +7 -6
  7. package/dist/decisions/index.js.map +1 -1
  8. package/dist/decisions/index.mjs +7 -6
  9. package/dist/decisions/index.mjs.map +1 -1
  10. package/dist/geolocation/index.js +7 -6
  11. package/dist/geolocation/index.js.map +1 -1
  12. package/dist/geolocation/index.mjs +7 -6
  13. package/dist/geolocation/index.mjs.map +1 -1
  14. package/dist/index.d.mts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +10 -182
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +10 -182
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/kyc/core.d.mts +1 -1
  21. package/dist/kyc/core.d.ts +1 -1
  22. package/dist/kyc/core.js +10 -182
  23. package/dist/kyc/core.js.map +1 -1
  24. package/dist/kyc/core.mjs +10 -182
  25. package/dist/kyc/core.mjs.map +1 -1
  26. package/dist/kyc/index.d.mts +4 -204
  27. package/dist/kyc/index.d.ts +4 -204
  28. package/dist/kyc/index.js +10 -182
  29. package/dist/kyc/index.js.map +1 -1
  30. package/dist/kyc/index.mjs +10 -182
  31. package/dist/kyc/index.mjs.map +1 -1
  32. package/dist/react.d.mts +4 -120
  33. package/dist/react.d.ts +4 -120
  34. package/dist/react.js +0 -185
  35. package/dist/react.js.map +1 -1
  36. package/dist/react.mjs +1 -183
  37. package/dist/react.mjs.map +1 -1
  38. package/dist/risk-profile/index.js +7 -6
  39. package/dist/risk-profile/index.js.map +1 -1
  40. package/dist/risk-profile/index.mjs +7 -6
  41. package/dist/risk-profile/index.mjs.map +1 -1
  42. package/dist/scores/index.js +7 -6
  43. package/dist/scores/index.js.map +1 -1
  44. package/dist/scores/index.mjs +7 -6
  45. package/dist/scores/index.mjs.map +1 -1
  46. package/dist/tax/index.js +7 -6
  47. package/dist/tax/index.js.map +1 -1
  48. package/dist/tax/index.mjs +7 -6
  49. package/dist/tax/index.mjs.map +1 -1
  50. package/package.json +1 -1
package/dist/react.d.mts CHANGED
@@ -2,7 +2,7 @@ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextO
2
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-_OhkfnyJ.mjs';
3
3
  import { RiskProfileClient } from './risk-profile/index.mjs';
4
4
  import { C as CustomerProfile, j as UpdateProfileResult } from './types-DbvVph_0.mjs';
5
- import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
5
+ import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.mjs';
6
6
  import React$1 from 'react';
7
7
  import './client-q9fN8Hhf.mjs';
8
8
  import './types-CBQRNL-l.mjs';
@@ -306,48 +306,6 @@ declare function useCustomerProfile(client: RiskProfileClient, customerId: strin
306
306
  * ```
307
307
  */
308
308
  declare function useKycSubmission(client: KycClient, options?: UseKycSubmissionOptions): UseKycSubmissionResult;
309
- /**
310
- * React hook for managing KYC requests
311
- *
312
- * @param client - KycClient instance
313
- * @param options - Hook options
314
- * @returns KYC requests state and management methods
315
- *
316
- * @example
317
- * ```tsx
318
- * function KycDashboard() {
319
- * const {
320
- * requests,
321
- * total,
322
- * loading,
323
- * fetchRequests,
324
- * updateStatus
325
- * } = useKycRequests(client, {
326
- * autoFetch: true,
327
- * filters: { status: "pending" },
328
- * pagination: { page: 1, page_size: 20 }
329
- * });
330
- *
331
- * return (
332
- * <div>
333
- * <h2>{total} Pending KYC Requests</h2>
334
- * {requests.map(req => (
335
- * <KycCard
336
- * key={req.id}
337
- * request={req}
338
- * onApprove={() => updateStatus(req.reference, "accepted", "Verified")}
339
- * onReject={() => updateStatus(req.reference, "declined", "Invalid document")}
340
- * />
341
- * ))}
342
- * </div>
343
- * );
344
- * }
345
- * ```
346
- *
347
- * @remarks Console session only: `listKycRequests` and `updateKycStatus` need a
348
- * dashboard login token. Only `getKycRequest` works with a tenant API key.
349
- */
350
- declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptions): UseKycRequestsResult;
351
309
  /**
352
310
  * React hook for managing KYC alerts
353
311
  *
@@ -362,8 +320,7 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
362
320
  * alerts,
363
321
  * total,
364
322
  * loading,
365
- * fetchAlerts,
366
- * updateAlert
323
+ * fetchAlerts
367
324
  * } = useKycAlerts(client, {
368
325
  * autoFetch: true,
369
326
  * filters: { status: ["pending", "in_progress"], risk: "critical" },
@@ -374,12 +331,7 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
374
331
  * <div>
375
332
  * <h2>{total} Critical Alerts</h2>
376
333
  * {alerts.map(alert => (
377
- * <AlertCard
378
- * key={alert.id}
379
- * alert={alert}
380
- * onAssign={(userId) => updateAlert(alert.id, { assigned_for: userId, status: "in_progress" })}
381
- * onResolve={() => updateAlert(alert.id, { status: "resolved", reason: "Verified" })}
382
- * />
334
+ * <AlertCard key={alert.id} alert={alert} />
383
335
  * ))}
384
336
  * </div>
385
337
  * );
@@ -390,74 +342,6 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
390
342
  * token and fail with a tenant API key.
391
343
  */
392
344
  declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions): UseKycAlertsResult;
393
- /**
394
- * React hook for KYC overview statistics
395
- *
396
- * @param client - KycClient instance
397
- * @param options - Hook options
398
- * @returns KYC overview state
399
- *
400
- * @example
401
- * ```tsx
402
- * function KycStats() {
403
- * const { overview, loading, refresh } = useKycOverview(client, {
404
- * autoFetch: true,
405
- * fromDate: "2024-01-01T00:00:00Z",
406
- * toDate: "2024-12-31T23:59:59Z"
407
- * });
408
- *
409
- * if (loading) return <Spinner />;
410
- *
411
- * return (
412
- * <div>
413
- * <StatCard label="Total" value={overview?.total} />
414
- * <StatCard label="Pending" value={overview?.pending} />
415
- * <StatCard label="Approved" value={overview?.approved} />
416
- * <StatCard label="Rejected" value={overview?.rejected} />
417
- * <StatCard label="High Risk" value={overview?.high_risk} />
418
- * </div>
419
- * );
420
- * }
421
- * ```
422
- *
423
- * @remarks Console session only: the overview endpoint needs a dashboard login
424
- * token and fails with a tenant API key.
425
- */
426
- declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
427
- /**
428
- * React hook for reading KYC preferences
429
- *
430
- * Preferences are managed in the Vesant console. The returned
431
- * `updatePreferences` is deprecated: the platform exposes no update
432
- * operation, so it always fails.
433
- *
434
- * @param client - KycClient instance
435
- * @param autoFetch - Auto-fetch preferences on mount (default: true)
436
- * @returns KYC preferences state and methods
437
- *
438
- * @example
439
- * ```tsx
440
- * function PreferencesSummary() {
441
- * const { preferences, loading, refresh } = useKycPreferences(client);
442
- *
443
- * if (loading) return <Spinner />;
444
- *
445
- * return (
446
- * <dl>
447
- * <dt>Face verification required</dt>
448
- * <dd>{String(preferences?.is_face_verification_required)}</dd>
449
- * <dt>Required documents</dt>
450
- * <dd>{preferences?.required_document_count}</dd>
451
- * <button onClick={refresh}>Refresh</button>
452
- * </dl>
453
- * );
454
- * }
455
- * ```
456
- *
457
- * @remarks Console session only: the preferences endpoints need a dashboard
458
- * login token and fail with a tenant API key.
459
- */
460
- declare function useKycPreferences(client: KycClient, autoFetch?: boolean): UseKycPreferencesResult;
461
345
  /**
462
346
  * Convert a File to base64 string for document upload
463
347
  *
@@ -650,4 +534,4 @@ interface FaceCaptureModalProps {
650
534
  }
651
535
  declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
652
536
 
653
- export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
537
+ export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
package/dist/react.d.ts CHANGED
@@ -2,7 +2,7 @@ import { D as DeviceFingerprintRequest, G as GeolocationClient, i as CipherTextO
2
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-BPALLldd.js';
3
3
  import { RiskProfileClient } from './risk-profile/index.js';
4
4
  import { C as CustomerProfile, j as UpdateProfileResult } from './types-qXamJr2q.js';
5
- import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
5
+ import { CreateEventBasedFaceVerificationSessionResponse, EventBasedFaceVerificationCallback, KycClient, CreateEventBasedFaceVerificationSessionRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult } from './kyc/index.js';
6
6
  import React$1 from 'react';
7
7
  import './client-q9fN8Hhf.js';
8
8
  import './types-CBQRNL-l.js';
@@ -306,48 +306,6 @@ declare function useCustomerProfile(client: RiskProfileClient, customerId: strin
306
306
  * ```
307
307
  */
308
308
  declare function useKycSubmission(client: KycClient, options?: UseKycSubmissionOptions): UseKycSubmissionResult;
309
- /**
310
- * React hook for managing KYC requests
311
- *
312
- * @param client - KycClient instance
313
- * @param options - Hook options
314
- * @returns KYC requests state and management methods
315
- *
316
- * @example
317
- * ```tsx
318
- * function KycDashboard() {
319
- * const {
320
- * requests,
321
- * total,
322
- * loading,
323
- * fetchRequests,
324
- * updateStatus
325
- * } = useKycRequests(client, {
326
- * autoFetch: true,
327
- * filters: { status: "pending" },
328
- * pagination: { page: 1, page_size: 20 }
329
- * });
330
- *
331
- * return (
332
- * <div>
333
- * <h2>{total} Pending KYC Requests</h2>
334
- * {requests.map(req => (
335
- * <KycCard
336
- * key={req.id}
337
- * request={req}
338
- * onApprove={() => updateStatus(req.reference, "accepted", "Verified")}
339
- * onReject={() => updateStatus(req.reference, "declined", "Invalid document")}
340
- * />
341
- * ))}
342
- * </div>
343
- * );
344
- * }
345
- * ```
346
- *
347
- * @remarks Console session only: `listKycRequests` and `updateKycStatus` need a
348
- * dashboard login token. Only `getKycRequest` works with a tenant API key.
349
- */
350
- declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptions): UseKycRequestsResult;
351
309
  /**
352
310
  * React hook for managing KYC alerts
353
311
  *
@@ -362,8 +320,7 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
362
320
  * alerts,
363
321
  * total,
364
322
  * loading,
365
- * fetchAlerts,
366
- * updateAlert
323
+ * fetchAlerts
367
324
  * } = useKycAlerts(client, {
368
325
  * autoFetch: true,
369
326
  * filters: { status: ["pending", "in_progress"], risk: "critical" },
@@ -374,12 +331,7 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
374
331
  * <div>
375
332
  * <h2>{total} Critical Alerts</h2>
376
333
  * {alerts.map(alert => (
377
- * <AlertCard
378
- * key={alert.id}
379
- * alert={alert}
380
- * onAssign={(userId) => updateAlert(alert.id, { assigned_for: userId, status: "in_progress" })}
381
- * onResolve={() => updateAlert(alert.id, { status: "resolved", reason: "Verified" })}
382
- * />
334
+ * <AlertCard key={alert.id} alert={alert} />
383
335
  * ))}
384
336
  * </div>
385
337
  * );
@@ -390,74 +342,6 @@ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptio
390
342
  * token and fail with a tenant API key.
391
343
  */
392
344
  declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions): UseKycAlertsResult;
393
- /**
394
- * React hook for KYC overview statistics
395
- *
396
- * @param client - KycClient instance
397
- * @param options - Hook options
398
- * @returns KYC overview state
399
- *
400
- * @example
401
- * ```tsx
402
- * function KycStats() {
403
- * const { overview, loading, refresh } = useKycOverview(client, {
404
- * autoFetch: true,
405
- * fromDate: "2024-01-01T00:00:00Z",
406
- * toDate: "2024-12-31T23:59:59Z"
407
- * });
408
- *
409
- * if (loading) return <Spinner />;
410
- *
411
- * return (
412
- * <div>
413
- * <StatCard label="Total" value={overview?.total} />
414
- * <StatCard label="Pending" value={overview?.pending} />
415
- * <StatCard label="Approved" value={overview?.approved} />
416
- * <StatCard label="Rejected" value={overview?.rejected} />
417
- * <StatCard label="High Risk" value={overview?.high_risk} />
418
- * </div>
419
- * );
420
- * }
421
- * ```
422
- *
423
- * @remarks Console session only: the overview endpoint needs a dashboard login
424
- * token and fails with a tenant API key.
425
- */
426
- declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult;
427
- /**
428
- * React hook for reading KYC preferences
429
- *
430
- * Preferences are managed in the Vesant console. The returned
431
- * `updatePreferences` is deprecated: the platform exposes no update
432
- * operation, so it always fails.
433
- *
434
- * @param client - KycClient instance
435
- * @param autoFetch - Auto-fetch preferences on mount (default: true)
436
- * @returns KYC preferences state and methods
437
- *
438
- * @example
439
- * ```tsx
440
- * function PreferencesSummary() {
441
- * const { preferences, loading, refresh } = useKycPreferences(client);
442
- *
443
- * if (loading) return <Spinner />;
444
- *
445
- * return (
446
- * <dl>
447
- * <dt>Face verification required</dt>
448
- * <dd>{String(preferences?.is_face_verification_required)}</dd>
449
- * <dt>Required documents</dt>
450
- * <dd>{preferences?.required_document_count}</dd>
451
- * <button onClick={refresh}>Refresh</button>
452
- * </dl>
453
- * );
454
- * }
455
- * ```
456
- *
457
- * @remarks Console session only: the preferences endpoints need a dashboard
458
- * login token and fail with a tenant API key.
459
- */
460
- declare function useKycPreferences(client: KycClient, autoFetch?: boolean): UseKycPreferencesResult;
461
345
  /**
462
346
  * Convert a File to base64 string for document upload
463
347
  *
@@ -650,4 +534,4 @@ interface FaceCaptureModalProps {
650
534
  }
651
535
  declare function FaceCaptureModal({ client, session, onComplete, onCancel, defaultDevice, renderQR, mediapipeAssetBasePath, }: Readonly<FaceCaptureModalProps>): React$1.ReactElement;
652
536
 
653
- export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
537
+ export { FaceCaptureModal, type FaceCaptureModalProps, type RunFlowResult, type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, type VerifyFaceOptions, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
package/dist/react.js CHANGED
@@ -2106,81 +2106,6 @@ function useKycSubmission(client, options = {}) {
2106
2106
  reset
2107
2107
  };
2108
2108
  }
2109
- function useKycRequests(client, options = {}) {
2110
- const [requests, setRequests] = React.useState([]);
2111
- const [pagination, setPagination] = React.useState(null);
2112
- const [loading, setLoading] = React.useState(false);
2113
- const [error, setError] = React.useState(null);
2114
- const fetchRequests = React.useCallback(
2115
- async (filters, paginationParams) => {
2116
- setLoading(true);
2117
- setError(null);
2118
- try {
2119
- const result = await client.listKycRequests(
2120
- filters || options.filters,
2121
- paginationParams || options.pagination
2122
- );
2123
- setRequests(result.data);
2124
- setPagination(result.pagination);
2125
- } catch (err) {
2126
- const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC requests");
2127
- setError(error2);
2128
- throw error2;
2129
- } finally {
2130
- setLoading(false);
2131
- }
2132
- },
2133
- [client, options.filters, options.pagination]
2134
- );
2135
- const getRequest = React.useCallback(
2136
- async (id) => {
2137
- try {
2138
- return await client.getKycRequest(id);
2139
- } catch (err) {
2140
- const error2 = err instanceof Error ? err : new Error("Failed to get KYC request");
2141
- setError(error2);
2142
- throw error2;
2143
- }
2144
- },
2145
- [client]
2146
- );
2147
- const updateStatus = React.useCallback(
2148
- async (reference, status, reason) => {
2149
- try {
2150
- await client.updateKycStatus({ reference, status, reason });
2151
- setRequests(
2152
- (prev) => prev.map(
2153
- (req) => req.reference === reference ? {
2154
- ...req,
2155
- status,
2156
- ...status === "accepted" ? { accepted_reason: reason } : { declined_reason: reason }
2157
- } : req
2158
- )
2159
- );
2160
- } catch (err) {
2161
- const error2 = err instanceof Error ? err : new Error("Failed to update KYC status");
2162
- setError(error2);
2163
- throw error2;
2164
- }
2165
- },
2166
- [client]
2167
- );
2168
- const refresh = React.useCallback(async () => {
2169
- await fetchRequests();
2170
- }, [fetchRequests]);
2171
- useAutoFetch(options.autoFetch, fetchRequests);
2172
- usePolling(options.pollInterval, fetchRequests);
2173
- return {
2174
- requests,
2175
- pagination,
2176
- loading,
2177
- error,
2178
- fetchRequests,
2179
- getRequest,
2180
- updateStatus,
2181
- refresh
2182
- };
2183
- }
2184
2109
  function useKycAlerts(client, options = {}) {
2185
2110
  const [alerts, setAlerts] = React.useState([]);
2186
2111
  const [pagination, setPagination] = React.useState(null);
@@ -2207,35 +2132,6 @@ function useKycAlerts(client, options = {}) {
2207
2132
  },
2208
2133
  [client, options.filters, options.pagination]
2209
2134
  );
2210
- const getAlert = React.useCallback(
2211
- async (id) => {
2212
- try {
2213
- return await client.getAlert(id);
2214
- } catch (err) {
2215
- const error2 = err instanceof Error ? err : new Error("Failed to get KYC alert");
2216
- setError(error2);
2217
- throw error2;
2218
- }
2219
- },
2220
- [client]
2221
- );
2222
- const updateAlert = React.useCallback(
2223
- async (id, update) => {
2224
- try {
2225
- await client.updateAlert(id, update);
2226
- setAlerts(
2227
- (prev) => prev.map(
2228
- (alert) => alert.id === id ? { ...alert, ...update } : alert
2229
- )
2230
- );
2231
- } catch (err) {
2232
- const error2 = err instanceof Error ? err : new Error("Failed to update KYC alert");
2233
- setError(error2);
2234
- throw error2;
2235
- }
2236
- },
2237
- [client]
2238
- );
2239
2135
  const refresh = React.useCallback(async () => {
2240
2136
  await fetchAlerts();
2241
2137
  }, [fetchAlerts]);
@@ -2247,87 +2143,9 @@ function useKycAlerts(client, options = {}) {
2247
2143
  loading,
2248
2144
  error,
2249
2145
  fetchAlerts,
2250
- getAlert,
2251
- updateAlert,
2252
2146
  refresh
2253
2147
  };
2254
2148
  }
2255
- function useKycOverview(client, options = {}) {
2256
- const [overview, setOverview] = React.useState(null);
2257
- const [loading, setLoading] = React.useState(false);
2258
- const [error, setError] = React.useState(null);
2259
- const fetchOverview = React.useCallback(
2260
- async (fromDate, toDate) => {
2261
- setLoading(true);
2262
- setError(null);
2263
- try {
2264
- const result = await client.getOverview(
2265
- fromDate || options.fromDate,
2266
- toDate || options.toDate
2267
- );
2268
- setOverview(result);
2269
- } catch (err) {
2270
- const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC overview");
2271
- setError(error2);
2272
- throw error2;
2273
- } finally {
2274
- setLoading(false);
2275
- }
2276
- },
2277
- [client, options.fromDate, options.toDate]
2278
- );
2279
- useAutoFetch(options.autoFetch, fetchOverview);
2280
- return {
2281
- overview,
2282
- loading,
2283
- error,
2284
- refresh: fetchOverview
2285
- };
2286
- }
2287
- function useKycPreferences(client, autoFetch = true) {
2288
- const [preferences, setPreferences] = React.useState(null);
2289
- const [loading, setLoading] = React.useState(false);
2290
- const [error, setError] = React.useState(null);
2291
- const fetchPreferences = React.useCallback(async () => {
2292
- setLoading(true);
2293
- setError(null);
2294
- try {
2295
- const result = await client.getPreferences();
2296
- setPreferences(result);
2297
- } catch (err) {
2298
- const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC preferences");
2299
- setError(error2);
2300
- throw error2;
2301
- } finally {
2302
- setLoading(false);
2303
- }
2304
- }, [client]);
2305
- const updatePreferences = React.useCallback(
2306
- async (update) => {
2307
- setLoading(true);
2308
- setError(null);
2309
- try {
2310
- const result = await client.updatePreferences(update);
2311
- setPreferences(result);
2312
- } catch (err) {
2313
- const error2 = err instanceof Error ? err : new Error("Failed to update KYC preferences");
2314
- setError(error2);
2315
- throw error2;
2316
- } finally {
2317
- setLoading(false);
2318
- }
2319
- },
2320
- [client]
2321
- );
2322
- useAutoFetch(autoFetch, fetchPreferences);
2323
- return {
2324
- preferences,
2325
- loading,
2326
- error,
2327
- updatePreferences,
2328
- refresh: fetchPreferences
2329
- };
2330
- }
2331
2149
  function fileToBase64(file) {
2332
2150
  return new Promise((resolve, reject) => {
2333
2151
  const reader = new FileReader();
@@ -2457,9 +2275,6 @@ exports.useCustomerProfile = useCustomerProfile;
2457
2275
  exports.useEventBasedFaceVerificationSubmission = useEventBasedFaceVerificationSubmission;
2458
2276
  exports.useGeolocation = useGeolocation;
2459
2277
  exports.useKycAlerts = useKycAlerts;
2460
- exports.useKycOverview = useKycOverview;
2461
- exports.useKycPreferences = useKycPreferences;
2462
- exports.useKycRequests = useKycRequests;
2463
2278
  exports.useKycSubmission = useKycSubmission;
2464
2279
  exports.useLocationCapture = useLocationCapture;
2465
2280
  exports.useLocationRequests = useLocationRequests;