vesant-sdk 1.8.0-dev.d4d3b0d → 1.8.0-dev.d8b25c5
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/README.md +1 -3
- package/dist/compliance/index.js +7 -6
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +7 -6
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +7 -6
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +7 -6
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.js +7 -6
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +7 -6
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -182
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -182
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +10 -182
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +10 -182
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +4 -204
- package/dist/kyc/index.d.ts +4 -204
- package/dist/kyc/index.js +10 -182
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +10 -182
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +4 -120
- package/dist/react.d.ts +4 -120
- package/dist/react.js +0 -185
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -183
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.js +7 -6
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +7 -6
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +7 -6
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +7 -6
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +7 -6
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +7 -6
- package/dist/tax/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -2100,81 +2100,6 @@ function useKycSubmission(client, options = {}) {
|
|
|
2100
2100
|
reset
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
|
-
function useKycRequests(client, options = {}) {
|
|
2104
|
-
const [requests, setRequests] = useState([]);
|
|
2105
|
-
const [pagination, setPagination] = useState(null);
|
|
2106
|
-
const [loading, setLoading] = useState(false);
|
|
2107
|
-
const [error, setError] = useState(null);
|
|
2108
|
-
const fetchRequests = useCallback(
|
|
2109
|
-
async (filters, paginationParams) => {
|
|
2110
|
-
setLoading(true);
|
|
2111
|
-
setError(null);
|
|
2112
|
-
try {
|
|
2113
|
-
const result = await client.listKycRequests(
|
|
2114
|
-
filters || options.filters,
|
|
2115
|
-
paginationParams || options.pagination
|
|
2116
|
-
);
|
|
2117
|
-
setRequests(result.data);
|
|
2118
|
-
setPagination(result.pagination);
|
|
2119
|
-
} catch (err) {
|
|
2120
|
-
const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC requests");
|
|
2121
|
-
setError(error2);
|
|
2122
|
-
throw error2;
|
|
2123
|
-
} finally {
|
|
2124
|
-
setLoading(false);
|
|
2125
|
-
}
|
|
2126
|
-
},
|
|
2127
|
-
[client, options.filters, options.pagination]
|
|
2128
|
-
);
|
|
2129
|
-
const getRequest = useCallback(
|
|
2130
|
-
async (id) => {
|
|
2131
|
-
try {
|
|
2132
|
-
return await client.getKycRequest(id);
|
|
2133
|
-
} catch (err) {
|
|
2134
|
-
const error2 = err instanceof Error ? err : new Error("Failed to get KYC request");
|
|
2135
|
-
setError(error2);
|
|
2136
|
-
throw error2;
|
|
2137
|
-
}
|
|
2138
|
-
},
|
|
2139
|
-
[client]
|
|
2140
|
-
);
|
|
2141
|
-
const updateStatus = useCallback(
|
|
2142
|
-
async (reference, status, reason) => {
|
|
2143
|
-
try {
|
|
2144
|
-
await client.updateKycStatus({ reference, status, reason });
|
|
2145
|
-
setRequests(
|
|
2146
|
-
(prev) => prev.map(
|
|
2147
|
-
(req) => req.reference === reference ? {
|
|
2148
|
-
...req,
|
|
2149
|
-
status,
|
|
2150
|
-
...status === "accepted" ? { accepted_reason: reason } : { declined_reason: reason }
|
|
2151
|
-
} : req
|
|
2152
|
-
)
|
|
2153
|
-
);
|
|
2154
|
-
} catch (err) {
|
|
2155
|
-
const error2 = err instanceof Error ? err : new Error("Failed to update KYC status");
|
|
2156
|
-
setError(error2);
|
|
2157
|
-
throw error2;
|
|
2158
|
-
}
|
|
2159
|
-
},
|
|
2160
|
-
[client]
|
|
2161
|
-
);
|
|
2162
|
-
const refresh = useCallback(async () => {
|
|
2163
|
-
await fetchRequests();
|
|
2164
|
-
}, [fetchRequests]);
|
|
2165
|
-
useAutoFetch(options.autoFetch, fetchRequests);
|
|
2166
|
-
usePolling(options.pollInterval, fetchRequests);
|
|
2167
|
-
return {
|
|
2168
|
-
requests,
|
|
2169
|
-
pagination,
|
|
2170
|
-
loading,
|
|
2171
|
-
error,
|
|
2172
|
-
fetchRequests,
|
|
2173
|
-
getRequest,
|
|
2174
|
-
updateStatus,
|
|
2175
|
-
refresh
|
|
2176
|
-
};
|
|
2177
|
-
}
|
|
2178
2103
|
function useKycAlerts(client, options = {}) {
|
|
2179
2104
|
const [alerts, setAlerts] = useState([]);
|
|
2180
2105
|
const [pagination, setPagination] = useState(null);
|
|
@@ -2201,35 +2126,6 @@ function useKycAlerts(client, options = {}) {
|
|
|
2201
2126
|
},
|
|
2202
2127
|
[client, options.filters, options.pagination]
|
|
2203
2128
|
);
|
|
2204
|
-
const getAlert = useCallback(
|
|
2205
|
-
async (id) => {
|
|
2206
|
-
try {
|
|
2207
|
-
return await client.getAlert(id);
|
|
2208
|
-
} catch (err) {
|
|
2209
|
-
const error2 = err instanceof Error ? err : new Error("Failed to get KYC alert");
|
|
2210
|
-
setError(error2);
|
|
2211
|
-
throw error2;
|
|
2212
|
-
}
|
|
2213
|
-
},
|
|
2214
|
-
[client]
|
|
2215
|
-
);
|
|
2216
|
-
const updateAlert = useCallback(
|
|
2217
|
-
async (id, update) => {
|
|
2218
|
-
try {
|
|
2219
|
-
await client.updateAlert(id, update);
|
|
2220
|
-
setAlerts(
|
|
2221
|
-
(prev) => prev.map(
|
|
2222
|
-
(alert) => alert.id === id ? { ...alert, ...update } : alert
|
|
2223
|
-
)
|
|
2224
|
-
);
|
|
2225
|
-
} catch (err) {
|
|
2226
|
-
const error2 = err instanceof Error ? err : new Error("Failed to update KYC alert");
|
|
2227
|
-
setError(error2);
|
|
2228
|
-
throw error2;
|
|
2229
|
-
}
|
|
2230
|
-
},
|
|
2231
|
-
[client]
|
|
2232
|
-
);
|
|
2233
2129
|
const refresh = useCallback(async () => {
|
|
2234
2130
|
await fetchAlerts();
|
|
2235
2131
|
}, [fetchAlerts]);
|
|
@@ -2241,87 +2137,9 @@ function useKycAlerts(client, options = {}) {
|
|
|
2241
2137
|
loading,
|
|
2242
2138
|
error,
|
|
2243
2139
|
fetchAlerts,
|
|
2244
|
-
getAlert,
|
|
2245
|
-
updateAlert,
|
|
2246
2140
|
refresh
|
|
2247
2141
|
};
|
|
2248
2142
|
}
|
|
2249
|
-
function useKycOverview(client, options = {}) {
|
|
2250
|
-
const [overview, setOverview] = useState(null);
|
|
2251
|
-
const [loading, setLoading] = useState(false);
|
|
2252
|
-
const [error, setError] = useState(null);
|
|
2253
|
-
const fetchOverview = useCallback(
|
|
2254
|
-
async (fromDate, toDate) => {
|
|
2255
|
-
setLoading(true);
|
|
2256
|
-
setError(null);
|
|
2257
|
-
try {
|
|
2258
|
-
const result = await client.getOverview(
|
|
2259
|
-
fromDate || options.fromDate,
|
|
2260
|
-
toDate || options.toDate
|
|
2261
|
-
);
|
|
2262
|
-
setOverview(result);
|
|
2263
|
-
} catch (err) {
|
|
2264
|
-
const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC overview");
|
|
2265
|
-
setError(error2);
|
|
2266
|
-
throw error2;
|
|
2267
|
-
} finally {
|
|
2268
|
-
setLoading(false);
|
|
2269
|
-
}
|
|
2270
|
-
},
|
|
2271
|
-
[client, options.fromDate, options.toDate]
|
|
2272
|
-
);
|
|
2273
|
-
useAutoFetch(options.autoFetch, fetchOverview);
|
|
2274
|
-
return {
|
|
2275
|
-
overview,
|
|
2276
|
-
loading,
|
|
2277
|
-
error,
|
|
2278
|
-
refresh: fetchOverview
|
|
2279
|
-
};
|
|
2280
|
-
}
|
|
2281
|
-
function useKycPreferences(client, autoFetch = true) {
|
|
2282
|
-
const [preferences, setPreferences] = useState(null);
|
|
2283
|
-
const [loading, setLoading] = useState(false);
|
|
2284
|
-
const [error, setError] = useState(null);
|
|
2285
|
-
const fetchPreferences = useCallback(async () => {
|
|
2286
|
-
setLoading(true);
|
|
2287
|
-
setError(null);
|
|
2288
|
-
try {
|
|
2289
|
-
const result = await client.getPreferences();
|
|
2290
|
-
setPreferences(result);
|
|
2291
|
-
} catch (err) {
|
|
2292
|
-
const error2 = err instanceof Error ? err : new Error("Failed to fetch KYC preferences");
|
|
2293
|
-
setError(error2);
|
|
2294
|
-
throw error2;
|
|
2295
|
-
} finally {
|
|
2296
|
-
setLoading(false);
|
|
2297
|
-
}
|
|
2298
|
-
}, [client]);
|
|
2299
|
-
const updatePreferences = useCallback(
|
|
2300
|
-
async (update) => {
|
|
2301
|
-
setLoading(true);
|
|
2302
|
-
setError(null);
|
|
2303
|
-
try {
|
|
2304
|
-
const result = await client.updatePreferences(update);
|
|
2305
|
-
setPreferences(result);
|
|
2306
|
-
} catch (err) {
|
|
2307
|
-
const error2 = err instanceof Error ? err : new Error("Failed to update KYC preferences");
|
|
2308
|
-
setError(error2);
|
|
2309
|
-
throw error2;
|
|
2310
|
-
} finally {
|
|
2311
|
-
setLoading(false);
|
|
2312
|
-
}
|
|
2313
|
-
},
|
|
2314
|
-
[client]
|
|
2315
|
-
);
|
|
2316
|
-
useAutoFetch(autoFetch, fetchPreferences);
|
|
2317
|
-
return {
|
|
2318
|
-
preferences,
|
|
2319
|
-
loading,
|
|
2320
|
-
error,
|
|
2321
|
-
updatePreferences,
|
|
2322
|
-
refresh: fetchPreferences
|
|
2323
|
-
};
|
|
2324
|
-
}
|
|
2325
2143
|
function fileToBase64(file) {
|
|
2326
2144
|
return new Promise((resolve, reject) => {
|
|
2327
2145
|
const reader = new FileReader();
|
|
@@ -2435,6 +2253,6 @@ function useEventBasedFaceVerificationSubmission(client) {
|
|
|
2435
2253
|
return { startSession, verifyFace, runFlow };
|
|
2436
2254
|
}
|
|
2437
2255
|
|
|
2438
|
-
export { FaceCaptureModal_default as FaceCaptureModal, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts,
|
|
2256
|
+
export { FaceCaptureModal_default as FaceCaptureModal, buildEventBasedFaceVerificationQrPayload, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isMobileDevice, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useEventBasedFaceVerificationSubmission, useGeolocation, useKycAlerts, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useTransactionVerification };
|
|
2439
2257
|
//# sourceMappingURL=react.mjs.map
|
|
2440
2258
|
//# sourceMappingURL=react.mjs.map
|