gbc-kyc-kit 3.0.14 → 3.0.16
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 -34
- package/dist/gbc-kyc-kit.umd.js +47 -47
- package/package.json +2 -2
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -41133,42 +41133,37 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41133
41133
|
const [failLiveness, setFailLiveness] = useState(false);
|
|
41134
41134
|
const [dataFailLiveness, setDataFailLiveness] = useState({});
|
|
41135
41135
|
const listener = (event) => {
|
|
41136
|
-
var _a, _b;
|
|
41136
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41137
41137
|
if (event.detail) {
|
|
41138
41138
|
if (event.detail.action === "PROCESS_FINISHED") {
|
|
41139
41139
|
if (((_b = (_a = event.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.code) == 0) {
|
|
41140
|
+
onSendSubmitLiveness(event.detail.data.response);
|
|
41140
41141
|
setData(event.detail.data.response);
|
|
41141
41142
|
} else if (!failLiveness) {
|
|
41142
41143
|
setFailLiveness(true);
|
|
41143
|
-
|
|
41144
|
+
saveDataToDB({
|
|
41145
|
+
data: {
|
|
41146
|
+
first_image: ((_d = (_c = dataFailLiveness.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.images) ? "data:image/jpeg;base64," + dataFailLiveness.detail.data.response.images[0] : null,
|
|
41147
|
+
face_result_code: ((_f = (_e = dataFailLiveness.detail.data) == null ? void 0 : _e.response) == null ? void 0 : _f.code) ? dataFailLiveness.detail.data.response.code : 250
|
|
41148
|
+
},
|
|
41149
|
+
component: "liveness",
|
|
41150
|
+
eventId,
|
|
41151
|
+
source: source2,
|
|
41152
|
+
inProduction,
|
|
41153
|
+
clientId,
|
|
41154
|
+
geolocation
|
|
41155
|
+
}).then((res) => {
|
|
41156
|
+
dataLiveness({
|
|
41157
|
+
countAttempts: res.count_try,
|
|
41158
|
+
error: true
|
|
41159
|
+
});
|
|
41160
|
+
setFailLiveness(false);
|
|
41161
|
+
setDataFailLiveness({});
|
|
41162
|
+
});
|
|
41144
41163
|
}
|
|
41145
41164
|
}
|
|
41146
41165
|
}
|
|
41147
41166
|
};
|
|
41148
|
-
useEffect(() => {
|
|
41149
|
-
var _a, _b, _c, _d;
|
|
41150
|
-
if (failLiveness) {
|
|
41151
|
-
saveDataToDB({
|
|
41152
|
-
data: {
|
|
41153
|
-
first_image: ((_b = (_a = dataFailLiveness.detail.data) == null ? void 0 : _a.response) == null ? void 0 : _b.images) ? "data:image/jpeg;base64," + dataFailLiveness.detail.data.response.images[0] : null,
|
|
41154
|
-
face_result_code: ((_d = (_c = dataFailLiveness.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.code) ? dataFailLiveness.detail.data.response.code : 250
|
|
41155
|
-
},
|
|
41156
|
-
component: "liveness",
|
|
41157
|
-
eventId,
|
|
41158
|
-
source: source2,
|
|
41159
|
-
inProduction,
|
|
41160
|
-
clientId,
|
|
41161
|
-
geolocation
|
|
41162
|
-
}).then((res) => {
|
|
41163
|
-
dataLiveness({
|
|
41164
|
-
countAttempts: res.count_try,
|
|
41165
|
-
error: true
|
|
41166
|
-
});
|
|
41167
|
-
setFailLiveness(false);
|
|
41168
|
-
setDataFailLiveness({});
|
|
41169
|
-
});
|
|
41170
|
-
}
|
|
41171
|
-
}, [failLiveness]);
|
|
41172
41167
|
useEffect(() => {
|
|
41173
41168
|
if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
|
|
41174
41169
|
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
|
|
@@ -41187,13 +41182,6 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41187
41182
|
setMessage("");
|
|
41188
41183
|
setIsLoading(false);
|
|
41189
41184
|
};
|
|
41190
|
-
useEffect(() => {
|
|
41191
|
-
console.log(data2, "dataaaaa");
|
|
41192
|
-
if (!lib$1(data2)) {
|
|
41193
|
-
console.log(data2);
|
|
41194
|
-
onSendSubmitLiveness();
|
|
41195
|
-
}
|
|
41196
|
-
}, [data2]);
|
|
41197
41185
|
const onSendSubmitLiveness = async () => {
|
|
41198
41186
|
try {
|
|
41199
41187
|
const customHeaders = {
|
|
@@ -42512,7 +42500,8 @@ function LivenessCheck({
|
|
|
42512
42500
|
message
|
|
42513
42501
|
})]
|
|
42514
42502
|
}) : lib$1(data2) && faceMatch || faceMatch === null ? /* @__PURE__ */ jsx$1("face-liveness", {
|
|
42515
|
-
class: "liveness"
|
|
42503
|
+
class: "liveness",
|
|
42504
|
+
dataLiveness
|
|
42516
42505
|
}) : /* @__PURE__ */ jsx$1(Box$1, {
|
|
42517
42506
|
className: `box-liveness ${isMobile_1 && "responsive"}`,
|
|
42518
42507
|
children: similarity === 0 ? /* @__PURE__ */ jsxs(Box$1, {
|