gbc-kyc-kit 3.0.28 → 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 +29 -60
- package/dist/gbc-kyc-kit.umd.js +58 -58
- package/package.json +1 -1
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -41133,47 +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
|
|
41143
|
-
|
|
41144
|
-
|
|
41145
|
-
|
|
41146
|
-
|
|
41147
|
-
|
|
41148
|
-
|
|
41149
|
-
|
|
41150
|
-
|
|
41151
|
-
(event) => {
|
|
41152
|
-
var _a, _b, _c, _d;
|
|
41153
|
-
console.log("Listener triggered:", event.detail);
|
|
41154
|
-
if (event.detail) {
|
|
41155
|
-
if (event.detail.action === "PROCESS_FINISHED") {
|
|
41156
|
-
console.log("Process finished, code:", (_b = (_a = event.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.code);
|
|
41157
|
-
if (((_d = (_c = event.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.code) == 0) {
|
|
41158
|
-
console.log("Setting data:", event.detail.data.response);
|
|
41159
|
-
console.log("About to call setData with:", event.detail.data.response);
|
|
41160
|
-
console.log("Using setDataRef.current:", setDataRef.current);
|
|
41161
|
-
setDataRef.current((prev2) => {
|
|
41162
|
-
console.log("setData callback executed, prev:", prev2, "new:", event.detail.data.response);
|
|
41163
|
-
return {
|
|
41164
|
-
...event.detail.data.response
|
|
41165
|
-
};
|
|
41166
|
-
});
|
|
41167
|
-
} else if (!failLiveness) {
|
|
41168
|
-
console.log("Setting fail liveness");
|
|
41169
|
-
setFailLivenessRef.current(true);
|
|
41170
|
-
setDataFailLivenessRef.current(event);
|
|
41171
|
-
}
|
|
41139
|
+
const listener = (event) => {
|
|
41140
|
+
var _a, _b;
|
|
41141
|
+
if (event.detail) {
|
|
41142
|
+
if (event.detail.action === "PROCESS_FINISHED") {
|
|
41143
|
+
if (((_b = (_a = event.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.code) == 0) {
|
|
41144
|
+
setData(event.detail.data.response);
|
|
41145
|
+
} else if (!failLiveness) {
|
|
41146
|
+
setFailLiveness(true);
|
|
41147
|
+
setDataFailLiveness(event);
|
|
41172
41148
|
}
|
|
41173
41149
|
}
|
|
41174
|
-
}
|
|
41175
|
-
|
|
41176
|
-
);
|
|
41150
|
+
}
|
|
41151
|
+
};
|
|
41177
41152
|
useEffect(() => {
|
|
41178
41153
|
var _a, _b, _c, _d;
|
|
41179
41154
|
if (failLiveness) {
|
|
@@ -41217,9 +41192,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41217
41192
|
setIsLoading(false);
|
|
41218
41193
|
};
|
|
41219
41194
|
useEffect(() => {
|
|
41220
|
-
console.log("useEffect [data] triggered, data:", data2, "isEmpty:", lib$1(data2), "data keys:", Object.keys(data2));
|
|
41221
41195
|
if (!lib$1(data2)) {
|
|
41222
|
-
console.log(data2, ":::Data");
|
|
41223
41196
|
onSendSubmitLiveness();
|
|
41224
41197
|
}
|
|
41225
41198
|
}, [data2]);
|
|
@@ -41231,28 +41204,24 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41231
41204
|
access_token: token2
|
|
41232
41205
|
};
|
|
41233
41206
|
try {
|
|
41234
|
-
|
|
41235
|
-
|
|
41236
|
-
|
|
41237
|
-
|
|
41238
|
-
|
|
41239
|
-
|
|
41240
|
-
|
|
41241
|
-
|
|
41242
|
-
|
|
41243
|
-
|
|
41244
|
-
|
|
41245
|
-
|
|
41246
|
-
|
|
41247
|
-
|
|
41248
|
-
|
|
41249
|
-
|
|
41250
|
-
geolocation
|
|
41251
|
-
});
|
|
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
|
|
41252
41223
|
});
|
|
41253
|
-
}
|
|
41254
|
-
await wrapAndSaveData();
|
|
41255
|
-
}
|
|
41224
|
+
}) : wrapAndSaveData();
|
|
41256
41225
|
} catch (error) {
|
|
41257
41226
|
let message2 = "";
|
|
41258
41227
|
const {
|
|
@@ -41293,7 +41262,7 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41293
41262
|
await saveDataToDB({
|
|
41294
41263
|
data: {
|
|
41295
41264
|
selfie: `data:image/jpeg;base64,${data2.images[0]}`,
|
|
41296
|
-
similarity:
|
|
41265
|
+
similarity: faceMatch ? similarity : null,
|
|
41297
41266
|
face_result_code: 0
|
|
41298
41267
|
},
|
|
41299
41268
|
component: "liveness",
|