gbc-kyc-kit 3.0.15 → 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 +21 -34
- package/dist/gbc-kyc-kit.umd.js +47 -47
- package/package.json +1 -1
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -41133,43 +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
|
-
|
|
41140
|
+
onSendSubmitLiveness(event.detail.data.response);
|
|
41141
41141
|
setData(event.detail.data.response);
|
|
41142
41142
|
} else if (!failLiveness) {
|
|
41143
41143
|
setFailLiveness(true);
|
|
41144
|
-
|
|
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
|
+
});
|
|
41145
41163
|
}
|
|
41146
41164
|
}
|
|
41147
41165
|
}
|
|
41148
41166
|
};
|
|
41149
|
-
useEffect(() => {
|
|
41150
|
-
var _a, _b, _c, _d;
|
|
41151
|
-
if (failLiveness) {
|
|
41152
|
-
saveDataToDB({
|
|
41153
|
-
data: {
|
|
41154
|
-
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,
|
|
41155
|
-
face_result_code: ((_d = (_c = dataFailLiveness.detail.data) == null ? void 0 : _c.response) == null ? void 0 : _d.code) ? dataFailLiveness.detail.data.response.code : 250
|
|
41156
|
-
},
|
|
41157
|
-
component: "liveness",
|
|
41158
|
-
eventId,
|
|
41159
|
-
source: source2,
|
|
41160
|
-
inProduction,
|
|
41161
|
-
clientId,
|
|
41162
|
-
geolocation
|
|
41163
|
-
}).then((res) => {
|
|
41164
|
-
dataLiveness({
|
|
41165
|
-
countAttempts: res.count_try,
|
|
41166
|
-
error: true
|
|
41167
|
-
});
|
|
41168
|
-
setFailLiveness(false);
|
|
41169
|
-
setDataFailLiveness({});
|
|
41170
|
-
});
|
|
41171
|
-
}
|
|
41172
|
-
}, [failLiveness]);
|
|
41173
41167
|
useEffect(() => {
|
|
41174
41168
|
if (countryCodeAllowed && (geolocation == null ? void 0 : geolocation.data_connection.isocode)) {
|
|
41175
41169
|
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.some((item) => item === (geolocation == null ? void 0 : geolocation.data_connection.isocode))) {
|
|
@@ -41188,13 +41182,6 @@ const LivenessController = (clientId, eventId, source2, inProduction, countryCod
|
|
|
41188
41182
|
setMessage("");
|
|
41189
41183
|
setIsLoading(false);
|
|
41190
41184
|
};
|
|
41191
|
-
useEffect(() => {
|
|
41192
|
-
console.log(data2, "dataaaaa");
|
|
41193
|
-
if (!lib$1(data2)) {
|
|
41194
|
-
console.log(data2);
|
|
41195
|
-
onSendSubmitLiveness();
|
|
41196
|
-
}
|
|
41197
|
-
}, [data2]);
|
|
41198
41185
|
const onSendSubmitLiveness = async () => {
|
|
41199
41186
|
try {
|
|
41200
41187
|
const customHeaders = {
|