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.
- 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-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
- package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +46 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -3
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.js +1 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +1 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.js +1 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +1 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +9 -2
- package/dist/react.d.ts +9 -2
- package/dist/react.js +15 -10
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +15 -10
- 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/dist/webhooks/index.d.mts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +6 -0
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +6 -1
- package/dist/webhooks/index.mjs.map +1 -1
- 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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
-
|
|
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 (
|
|
463
|
+
if (client) {
|
|
458
464
|
try {
|
|
459
|
-
|
|
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([]);
|