gbc-kyc-kit 3.0.27 → 3.0.29
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/gbc-kyc-kit.es.js +23 -42
- package/dist/gbc-kyc-kit.umd.js +55 -55
- package/package.json +1 -1
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -41133,35 +41133,22 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41133
41133
|
const [countryCode, setCountryCode] = useState(null);
|
|
41134
41134
|
const geolocation = useGeolocation(inProduction);
|
|
41135
41135
|
const [data2, setData] = useState({});
|
|
41136
|
-
useEffect(() => {
|
|
41137
|
-
console.log("Data state changed to:", data2);
|
|
41138
|
-
}, [data2]);
|
|
41139
41136
|
const [similarity, setSimilarity] = useState(0);
|
|
41140
41137
|
const [failLiveness, setFailLiveness] = useState(false);
|
|
41141
41138
|
const [dataFailLiveness, setDataFailLiveness] = useState({});
|
|
41142
|
-
const listener =
|
|
41143
|
-
var _a, _b
|
|
41144
|
-
console.log("Listener triggered:", event.detail);
|
|
41139
|
+
const listener = (event) => {
|
|
41140
|
+
var _a, _b;
|
|
41145
41141
|
if (event.detail) {
|
|
41146
41142
|
if (event.detail.action === "PROCESS_FINISHED") {
|
|
41147
|
-
|
|
41148
|
-
|
|
41149
|
-
console.log("Setting data:", event.detail.data.response);
|
|
41150
|
-
console.log("About to call setData with:", event.detail.data.response);
|
|
41151
|
-
setData((prev2) => {
|
|
41152
|
-
console.log("setData callback executed, prev:", prev2, "new:", event.detail.data.response);
|
|
41153
|
-
return {
|
|
41154
|
-
...event.detail.data.response
|
|
41155
|
-
};
|
|
41156
|
-
});
|
|
41143
|
+
if (((_b = (_a = event.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.code) == 0) {
|
|
41144
|
+
setData(event.detail.data.response);
|
|
41157
41145
|
} else if (!failLiveness) {
|
|
41158
|
-
console.log("Setting fail liveness");
|
|
41159
41146
|
setFailLiveness(true);
|
|
41160
41147
|
setDataFailLiveness(event);
|
|
41161
41148
|
}
|
|
41162
41149
|
}
|
|
41163
41150
|
}
|
|
41164
|
-
}
|
|
41151
|
+
};
|
|
41165
41152
|
useEffect(() => {
|
|
41166
41153
|
var _a, _b, _c, _d;
|
|
41167
41154
|
if (failLiveness) {
|
|
@@ -41205,9 +41192,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41205
41192
|
setIsLoading(false);
|
|
41206
41193
|
};
|
|
41207
41194
|
useEffect(() => {
|
|
41208
|
-
console.log("useEffect [data] triggered, data:", data2, "isEmpty:", lib$1(data2), "data keys:", Object.keys(data2));
|
|
41209
41195
|
if (!lib$1(data2)) {
|
|
41210
|
-
console.log(data2, ":::Data");
|
|
41211
41196
|
onSendSubmitLiveness();
|
|
41212
41197
|
}
|
|
41213
41198
|
}, [data2]);
|
|
@@ -41219,28 +41204,24 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41219
41204
|
access_token: token2
|
|
41220
41205
|
};
|
|
41221
41206
|
try {
|
|
41222
|
-
|
|
41223
|
-
|
|
41224
|
-
|
|
41225
|
-
|
|
41226
|
-
|
|
41227
|
-
|
|
41228
|
-
|
|
41229
|
-
|
|
41230
|
-
|
|
41231
|
-
|
|
41232
|
-
|
|
41233
|
-
|
|
41234
|
-
|
|
41235
|
-
|
|
41236
|
-
|
|
41237
|
-
|
|
41238
|
-
geolocation
|
|
41239
|
-
});
|
|
41207
|
+
faceMatch ? await fetchFaceMatch(faceMatch, `data:image/jpeg;base64,${data2.images[0]}`, inProduction, customHeaders).then((res) => {
|
|
41208
|
+
setSimilarity(res.data.similarity);
|
|
41209
|
+
setMessage(successMessage ? successMessage : "Verificaci\xF3n de identidad completada");
|
|
41210
|
+
saveDataToDB({
|
|
41211
|
+
data: {
|
|
41212
|
+
similarity: res.data.similarity,
|
|
41213
|
+
first_image: `data:image/jpeg;base64,${data2.images[0]}`,
|
|
41214
|
+
second_image: faceMatch,
|
|
41215
|
+
status_code: 200
|
|
41216
|
+
},
|
|
41217
|
+
component: "facematch",
|
|
41218
|
+
eventId,
|
|
41219
|
+
source: source2,
|
|
41220
|
+
inProduction,
|
|
41221
|
+
clientId,
|
|
41222
|
+
geolocation
|
|
41240
41223
|
});
|
|
41241
|
-
}
|
|
41242
|
-
await wrapAndSaveData();
|
|
41243
|
-
}
|
|
41224
|
+
}) : wrapAndSaveData();
|
|
41244
41225
|
} catch (error) {
|
|
41245
41226
|
let message2 = "";
|
|
41246
41227
|
const {
|
|
@@ -41281,7 +41262,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41281
41262
|
await saveDataToDB({
|
|
41282
41263
|
data: {
|
|
41283
41264
|
selfie: `data:image/jpeg;base64,${data2.images[0]}`,
|
|
41284
|
-
similarity:
|
|
41265
|
+
similarity: faceMatch ? similarity : null,
|
|
41285
41266
|
face_result_code: 0
|
|
41286
41267
|
},
|
|
41287
41268
|
component: "liveness",
|