idmission-web-sdk 2.2.78 → 2.2.79

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.78';
214
+ var webSdkVersion = '2.2.79';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -19685,6 +19685,7 @@
19685
19685
  var FaceLivenessCapture = function FaceLivenessCapture(_a) {
19686
19686
  var _b, _c, _d, _e;
19687
19687
  var onCapture = _a.onCapture,
19688
+ onLivenessChecked = _a.onLivenessChecked,
19688
19689
  onSuccess = _a.onSuccess,
19689
19690
  onFailure = _a.onFailure,
19690
19691
  onTimeout = _a.onTimeout,
@@ -19757,6 +19758,7 @@
19757
19758
  return [4 /*yield*/, _a.apply(void 0, [_b.sent()])];
19758
19759
  case 2:
19759
19760
  response = _b.sent();
19761
+ onLivenessChecked === null || onLivenessChecked === void 0 ? void 0 : onLivenessChecked(response);
19760
19762
  dispatch({
19761
19763
  type: 'livenessChecked',
19762
19764
  payload: {
@@ -19782,7 +19784,7 @@
19782
19784
  });
19783
19785
  });
19784
19786
  })();
19785
- }, [checkLiveness, face, frame, isReady, submissionError]);
19787
+ }, [checkLiveness, face, frame, isReady, onLivenessChecked, submissionError]);
19786
19788
  var onFallbackImageCaptured = React.useCallback(function (imageUrl) {
19787
19789
  return __awaiter(void 0, void 0, void 0, function () {
19788
19790
  var imageData, response, e_2;
@@ -20424,6 +20426,7 @@
20424
20426
  var captureStartedAt = React.useRef();
20425
20427
  var captureEndedAt = React.useRef();
20426
20428
  var operationStartedAt = React.useRef();
20429
+ var livenessScore = React.useRef();
20427
20430
  var _y = React.useContext(SelfieGuidanceModelsContext),
20428
20431
  start = _y.start,
20429
20432
  stop = _y.stop;
@@ -20434,19 +20437,21 @@
20434
20437
  if (captureState !== 'CAPTURING') return;
20435
20438
  captureStartedAt.current = new Date();
20436
20439
  start();
20437
- return function () {
20438
- stop();
20439
- };
20440
+ return stop;
20440
20441
  }, [captureState, start, stop]);
20441
20442
  var onCapture = React.useCallback(function () {
20442
20443
  captureEndedAt.current = new Date();
20443
20444
  }, []);
20445
+ var onLivenessChecked = React.useCallback(function (resp) {
20446
+ livenessScore.current = resp.resultData.realScore;
20447
+ }, []);
20444
20448
  var logCaptureMetadata = React.useCallback(function () {
20445
20449
  var _a, _b, _c;
20446
20450
  logSelfieCaptureAttempt({
20447
20451
  autoCapture: 'Y',
20448
20452
  captureTime: ((_a = captureEndedAt.current) !== null && _a !== void 0 ? _a : new Date()).getTime() - ((_b = captureStartedAt.current) !== null && _b !== void 0 ? _b : new Date()).getTime(),
20449
- operationTime: new Date().getTime() - ((_c = operationStartedAt.current) !== null && _c !== void 0 ? _c : new Date()).getTime()
20453
+ operationTime: new Date().getTime() - ((_c = operationStartedAt.current) !== null && _c !== void 0 ? _c : new Date()).getTime(),
20454
+ livenessScore: livenessScore.current
20450
20455
  });
20451
20456
  operationStartedAt.current = new Date();
20452
20457
  }, [logSelfieCaptureAttempt]);
@@ -20491,7 +20496,7 @@
20491
20496
  setCaptureState('LOADING');
20492
20497
  releaseCameraAccess();
20493
20498
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
20494
- requestCameraAccess();
20499
+ void requestCameraAccess();
20495
20500
  }, [onExitCapture, releaseCameraAccess, requestCameraAccess]);
20496
20501
  var onRetryCallback = React.useCallback(function () {
20497
20502
  logCaptureMetadata();
@@ -20503,7 +20508,7 @@
20503
20508
  });
20504
20509
  setCaptureState('LOADING');
20505
20510
  releaseCameraAccess();
20506
- requestCameraAccess();
20511
+ void requestCameraAccess();
20507
20512
  }, [logCaptureMetadata, releaseCameraAccess, requestCameraAccess]);
20508
20513
  var onDoneCallback = React.useCallback(function () {
20509
20514
  logCaptureMetadata();
@@ -20541,6 +20546,7 @@
20541
20546
  return /*#__PURE__*/React.createElement(FaceLivenessCapture, {
20542
20547
  key: "capture".concat(attempt),
20543
20548
  onCapture: onCapture,
20549
+ onLivenessChecked: onLivenessChecked,
20544
20550
  onSuccess: onSuccessCallback,
20545
20551
  onFailure: onFailureCallback,
20546
20552
  onTimeout: onTimeout,