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.
package/dist/sdk2.esm.js CHANGED
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
203
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
204
204
  };
205
205
 
206
- var webSdkVersion = '2.2.78';
206
+ var webSdkVersion = '2.2.79';
207
207
 
208
208
  function getPlatform() {
209
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -10611,6 +10611,7 @@ var reducer$2 = function reducer(state, action) {
10611
10611
  var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10612
10612
  var _b, _c, _d, _e;
10613
10613
  var onCapture = _a.onCapture,
10614
+ onLivenessChecked = _a.onLivenessChecked,
10614
10615
  onSuccess = _a.onSuccess,
10615
10616
  onFailure = _a.onFailure,
10616
10617
  onTimeout = _a.onTimeout,
@@ -10683,6 +10684,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10683
10684
  return [4 /*yield*/, _a.apply(void 0, [_b.sent()])];
10684
10685
  case 2:
10685
10686
  response = _b.sent();
10687
+ onLivenessChecked === null || onLivenessChecked === void 0 ? void 0 : onLivenessChecked(response);
10686
10688
  dispatch({
10687
10689
  type: 'livenessChecked',
10688
10690
  payload: {
@@ -10708,7 +10710,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
10708
10710
  });
10709
10711
  });
10710
10712
  })();
10711
- }, [checkLiveness, face, frame, isReady, submissionError]);
10713
+ }, [checkLiveness, face, frame, isReady, onLivenessChecked, submissionError]);
10712
10714
  var onFallbackImageCaptured = useCallback(function (imageUrl) {
10713
10715
  return __awaiter(void 0, void 0, void 0, function () {
10714
10716
  var imageData, response, e_2;
@@ -11350,6 +11352,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
11350
11352
  var captureStartedAt = useRef();
11351
11353
  var captureEndedAt = useRef();
11352
11354
  var operationStartedAt = useRef();
11355
+ var livenessScore = useRef();
11353
11356
  var _y = useContext(SelfieGuidanceModelsContext),
11354
11357
  start = _y.start,
11355
11358
  stop = _y.stop;
@@ -11360,19 +11363,21 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
11360
11363
  if (captureState !== 'CAPTURING') return;
11361
11364
  captureStartedAt.current = new Date();
11362
11365
  start();
11363
- return function () {
11364
- stop();
11365
- };
11366
+ return stop;
11366
11367
  }, [captureState, start, stop]);
11367
11368
  var onCapture = useCallback(function () {
11368
11369
  captureEndedAt.current = new Date();
11369
11370
  }, []);
11371
+ var onLivenessChecked = useCallback(function (resp) {
11372
+ livenessScore.current = resp.resultData.realScore;
11373
+ }, []);
11370
11374
  var logCaptureMetadata = useCallback(function () {
11371
11375
  var _a, _b, _c;
11372
11376
  logSelfieCaptureAttempt({
11373
11377
  autoCapture: 'Y',
11374
11378
  captureTime: ((_a = captureEndedAt.current) !== null && _a !== void 0 ? _a : new Date()).getTime() - ((_b = captureStartedAt.current) !== null && _b !== void 0 ? _b : new Date()).getTime(),
11375
- operationTime: new Date().getTime() - ((_c = operationStartedAt.current) !== null && _c !== void 0 ? _c : new Date()).getTime()
11379
+ operationTime: new Date().getTime() - ((_c = operationStartedAt.current) !== null && _c !== void 0 ? _c : new Date()).getTime(),
11380
+ livenessScore: livenessScore.current
11376
11381
  });
11377
11382
  operationStartedAt.current = new Date();
11378
11383
  }, [logSelfieCaptureAttempt]);
@@ -11417,7 +11422,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
11417
11422
  setCaptureState('LOADING');
11418
11423
  releaseCameraAccess();
11419
11424
  onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
11420
- requestCameraAccess();
11425
+ void requestCameraAccess();
11421
11426
  }, [onExitCapture, releaseCameraAccess, requestCameraAccess]);
11422
11427
  var onRetryCallback = useCallback(function () {
11423
11428
  logCaptureMetadata();
@@ -11429,7 +11434,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
11429
11434
  });
11430
11435
  setCaptureState('LOADING');
11431
11436
  releaseCameraAccess();
11432
- requestCameraAccess();
11437
+ void requestCameraAccess();
11433
11438
  }, [logCaptureMetadata, releaseCameraAccess, requestCameraAccess]);
11434
11439
  var onDoneCallback = useCallback(function () {
11435
11440
  logCaptureMetadata();
@@ -11467,6 +11472,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
11467
11472
  return /*#__PURE__*/React__default.createElement(FaceLivenessCapture, {
11468
11473
  key: "capture".concat(attempt),
11469
11474
  onCapture: onCapture,
11475
+ onLivenessChecked: onLivenessChecked,
11470
11476
  onSuccess: onSuccessCallback,
11471
11477
  onFailure: onFailureCallback,
11472
11478
  onTimeout: onTimeout,