idmission-web-sdk 2.2.9 → 2.2.11
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/components/face_liveness/FaceLivenessCapture.d.ts +3 -1
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +9 -7
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +34 -18
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +34 -18
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +34 -18
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sdk2.esm.js
CHANGED
|
@@ -200,7 +200,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
200
200
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
-
var webSdkVersion = '2.2.
|
|
203
|
+
var webSdkVersion = '2.2.11';
|
|
204
204
|
|
|
205
205
|
function getPlatform() {
|
|
206
206
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -9682,7 +9682,9 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
9682
9682
|
var _b, _c, _d, _e;
|
|
9683
9683
|
var onCapture = _a.onCapture,
|
|
9684
9684
|
onSuccess = _a.onSuccess,
|
|
9685
|
+
onFailure = _a.onFailure,
|
|
9685
9686
|
onTimeout = _a.onTimeout,
|
|
9687
|
+
onDenied = _a.onDenied,
|
|
9686
9688
|
onExit = _a.onExit,
|
|
9687
9689
|
_f = _a.timeoutDurationMs,
|
|
9688
9690
|
timeoutDurationMs = _f === void 0 ? 15000 : _f,
|
|
@@ -9793,14 +9795,12 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
9793
9795
|
return [4 /*yield*/, dataUrlToBase64(imageUrl)];
|
|
9794
9796
|
case 2:
|
|
9795
9797
|
imageData = _b.sent();
|
|
9796
|
-
return [4 /*yield*/, checkLiveness(imageData)
|
|
9797
|
-
// todo: JN - this feels dirty and is the reason for the todo around line 83 - but is necessary to handle fallback liveness validation
|
|
9798
|
-
];
|
|
9798
|
+
return [4 /*yield*/, checkLiveness(imageData)];
|
|
9799
9799
|
case 3:
|
|
9800
9800
|
response = _b.sent();
|
|
9801
|
-
// todo: JN - this feels dirty and is the reason for the todo around line 83 - but is necessary to handle fallback liveness validation
|
|
9802
9801
|
if (((_a = response === null || response === void 0 ? void 0 : response.resultData) === null || _a === void 0 ? void 0 : _a.verificationResult) !== 'Live Face Detected') {
|
|
9803
|
-
|
|
9802
|
+
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
|
9803
|
+
onDenied === null || onDenied === void 0 ? void 0 : onDenied();
|
|
9804
9804
|
}
|
|
9805
9805
|
dispatch({
|
|
9806
9806
|
type: 'livenessChecked',
|
|
@@ -9824,7 +9824,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
9824
9824
|
}
|
|
9825
9825
|
});
|
|
9826
9826
|
});
|
|
9827
|
-
}, [checkLiveness,
|
|
9827
|
+
}, [checkLiveness, onFailure, onDenied]);
|
|
9828
9828
|
useEffect(function () {
|
|
9829
9829
|
if (state.requestState === 'FAILED' || state.requestState === 'ERROR') {
|
|
9830
9830
|
setTimeout(function () {
|
|
@@ -9841,10 +9841,15 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
9841
9841
|
if (modelError) return;
|
|
9842
9842
|
var allowedFailures = 2;
|
|
9843
9843
|
if (state.timesLivenessCheckFailed > allowedFailures) {
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9844
|
+
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
|
9845
|
+
onDenied === null || onDenied === void 0 ? void 0 : onDenied();
|
|
9846
|
+
}
|
|
9847
|
+
}, [modelError, onFailure, onDenied, state.timesLivenessCheckFailed]);
|
|
9848
|
+
var callOnTimeoutHooks = useCallback(function () {
|
|
9849
|
+
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
9850
|
+
onDenied === null || onDenied === void 0 ? void 0 : onDenied();
|
|
9851
|
+
}, [onDenied, onTimeout]);
|
|
9852
|
+
useTimeout(timeoutDurationMs, callOnTimeoutHooks, state.requestState === 'PASSED' || !!modelError, state.requestState === 'IN_PROGRESS');
|
|
9848
9853
|
var verbiage = useTranslations(rawVerbiage, {
|
|
9849
9854
|
guidanceLivenessCheckFailedText: 'Could not verify your face.',
|
|
9850
9855
|
guidanceLivenessCheckErrorText: 'An error occurred while verifying your face.',
|
|
@@ -10332,7 +10337,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
10332
10337
|
var _b, _c, _d;
|
|
10333
10338
|
var onComplete = _a.onComplete,
|
|
10334
10339
|
onSuccess = _a.onSuccess,
|
|
10340
|
+
onFailure = _a.onFailure,
|
|
10335
10341
|
onTimeout = _a.onTimeout,
|
|
10342
|
+
onDenied = _a.onDenied,
|
|
10336
10343
|
onExitCapture = _a.onExitCapture,
|
|
10337
10344
|
onExitAfterFailure = _a.onExitAfterFailure,
|
|
10338
10345
|
onUserCancel = _a.onUserCancel,
|
|
@@ -10430,11 +10437,18 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
10430
10437
|
});
|
|
10431
10438
|
});
|
|
10432
10439
|
}, [onSuccess, setSelfieImage, livenessCheckRequest, submissionResponse]);
|
|
10433
|
-
|
|
10434
|
-
|
|
10440
|
+
var onFailureCallback = useCallback(function () {
|
|
10441
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
10442
|
+
return __generator(this, function (_a) {
|
|
10443
|
+
onFailure === null || onFailure === void 0 ? void 0 : onFailure(submissionResponse, livenessCheckRequest);
|
|
10444
|
+
return [2 /*return*/];
|
|
10445
|
+
});
|
|
10446
|
+
});
|
|
10447
|
+
}, [livenessCheckRequest, onFailure, submissionResponse]);
|
|
10448
|
+
var onDeniedCallback = useCallback(function () {
|
|
10435
10449
|
setCaptureState('FAILED');
|
|
10436
|
-
|
|
10437
|
-
}, [
|
|
10450
|
+
onDenied === null || onDenied === void 0 ? void 0 : onDenied(submissionResponse, livenessCheckRequest);
|
|
10451
|
+
}, [onDenied, submissionResponse, livenessCheckRequest]);
|
|
10438
10452
|
var _y = useState(0),
|
|
10439
10453
|
attempt = _y[0],
|
|
10440
10454
|
setAttempt = _y[1];
|
|
@@ -10495,7 +10509,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
10495
10509
|
key: "capture".concat(attempt),
|
|
10496
10510
|
onCapture: onCapture,
|
|
10497
10511
|
onSuccess: onSuccessCallback,
|
|
10498
|
-
|
|
10512
|
+
onFailure: onFailureCallback,
|
|
10513
|
+
onTimeout: onTimeout,
|
|
10514
|
+
onDenied: onDeniedCallback,
|
|
10499
10515
|
onExit: onExitCallback,
|
|
10500
10516
|
timeoutDurationMs: timeoutDurationMs,
|
|
10501
10517
|
silentFallback: silentFallback,
|
|
@@ -13404,7 +13420,7 @@ var FaceValidation = function FaceValidation(_a) {
|
|
|
13404
13420
|
skipSuccessScreen: skipSuccessScreen,
|
|
13405
13421
|
onComplete: onComplete,
|
|
13406
13422
|
onSuccess: onApproved,
|
|
13407
|
-
|
|
13423
|
+
onDenied: onDenied,
|
|
13408
13424
|
onExitCapture: onExitCapture,
|
|
13409
13425
|
onExitAfterFailure: onExitAfterFailure,
|
|
13410
13426
|
onModelError: onModelError,
|
|
@@ -13582,7 +13598,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
13582
13598
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
13583
13599
|
timeoutDurationMs: faceLivenessTimeoutDurationMs,
|
|
13584
13600
|
modelLoadTimeoutMs: selfieCaptureModelLoadTimeoutMs,
|
|
13585
|
-
|
|
13601
|
+
onDenied: onDenied,
|
|
13586
13602
|
onExitCapture: onExitCapture,
|
|
13587
13603
|
onExitAfterFailure: onExitAfterFailure,
|
|
13588
13604
|
onUserCancel: onUserCancel,
|