idmission-web-sdk 2.2.52 → 2.2.54

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.52';
214
+ var webSdkVersion = '2.2.54';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2356,9 +2356,9 @@
2356
2356
  }
2357
2357
  var documents, _a, _b, _c, submissionRequest, onBeforeSubmitResult;
2358
2358
  var _d;
2359
- var _e, _f, _g;
2360
- return __generator(this, function (_h) {
2361
- switch (_h.label) {
2359
+ var _e, _f, _g, _h;
2360
+ return __generator(this, function (_j) {
2361
+ switch (_j.label) {
2362
2362
  case 0:
2363
2363
  _d = {
2364
2364
  idFrontImage: idFrontImage,
@@ -2370,24 +2370,24 @@
2370
2370
  if (!_a) return [3 /*break*/, 2];
2371
2371
  return [4 /*yield*/, videoDataUrlToB64(signatureVideoUrl)];
2372
2372
  case 1:
2373
- _a = _h.sent();
2374
- _h.label = 2;
2373
+ _a = _j.sent();
2374
+ _j.label = 2;
2375
2375
  case 2:
2376
2376
  _d.signatureVideo = _a;
2377
2377
  _b = idCaptureVideoUrl;
2378
2378
  if (!_b) return [3 /*break*/, 4];
2379
2379
  return [4 /*yield*/, videoDataUrlToB64(idCaptureVideoUrl)];
2380
2380
  case 3:
2381
- _b = _h.sent();
2382
- _h.label = 4;
2381
+ _b = _j.sent();
2382
+ _j.label = 4;
2383
2383
  case 4:
2384
2384
  _d.idCaptureVideo = _b;
2385
2385
  _c = idCaptureVideoAudioUrl;
2386
2386
  if (!_c) return [3 /*break*/, 6];
2387
2387
  return [4 /*yield*/, videoDataUrlToB64(idCaptureVideoAudioUrl)];
2388
2388
  case 5:
2389
- _c = _h.sent();
2390
- _h.label = 6;
2389
+ _c = _j.sent();
2390
+ _j.label = 6;
2391
2391
  case 6:
2392
2392
  documents = (_d.idCaptureVideoAudio = _c, _d.idCaptureVideoIdFrontImage = idCaptureVideoIdFrontImage, _d.idCaptureVideoIdBackImage = idCaptureVideoIdBackImage, _d);
2393
2393
  if (signatureData) {
@@ -2414,8 +2414,8 @@
2414
2414
  });
2415
2415
  }))];
2416
2416
  case 7:
2417
- _h.sent();
2418
- _h.label = 8;
2417
+ _j.sent();
2418
+ _j.label = 8;
2419
2419
  case 8:
2420
2420
  submissionRequest = {
2421
2421
  securityData: {
@@ -2470,6 +2470,9 @@
2470
2470
  selfie: documents.selfieImage
2471
2471
  };
2472
2472
  }
2473
+ if (idCardForFaceMatch) {
2474
+ (_e = submissionRequest.customerData.idData).idImageFront || (_e.idImageFront = idCardForFaceMatch);
2475
+ }
2473
2476
  if (companyId) {
2474
2477
  submissionRequest.employee = {
2475
2478
  companyId: companyId
@@ -2482,7 +2485,7 @@
2482
2485
  submissionRequest.customerData.cardData = cardData;
2483
2486
  }
2484
2487
  if (enrollmentId) {
2485
- (_e = submissionRequest.customerData).personalData || (_e.personalData = {});
2488
+ (_f = submissionRequest.customerData).personalData || (_f.personalData = {});
2486
2489
  submissionRequest.customerData.personalData.uniqueNumber = enrollmentId;
2487
2490
  }
2488
2491
  if (webhooksClientTraceId) {
@@ -2506,11 +2509,11 @@
2506
2509
  });
2507
2510
  }
2508
2511
  if (documents.idCaptureVideo) {
2509
- (_f = submissionRequest.customerData).biometricData || (_f.biometricData = {});
2512
+ (_g = submissionRequest.customerData).biometricData || (_g.biometricData = {});
2510
2513
  submissionRequest.customerData.biometricData.videoData = documents.idCaptureVideo;
2511
2514
  }
2512
2515
  if (documents.idCaptureVideoAudio) {
2513
- (_g = submissionRequest.customerData).biometricData || (_g.biometricData = {});
2516
+ (_h = submissionRequest.customerData).biometricData || (_h.biometricData = {});
2514
2517
  submissionRequest.customerData.biometricData.voiceData = documents.idCaptureVideoAudio;
2515
2518
  submissionRequest.customerData.biometricData.voiceStartTime = idCaptureVideoAudioStartsAt !== null && idCaptureVideoAudioStartsAt !== void 0 ? idCaptureVideoAudioStartsAt : undefined;
2516
2519
  submissionRequest.customerData.biometricData.expectedAudioText = expectedAudioText !== null && expectedAudioText !== void 0 ? expectedAudioText : undefined;
@@ -2530,15 +2533,15 @@
2530
2533
  if (!onBeforeSubmit.current) return [3 /*break*/, 10];
2531
2534
  return [4 /*yield*/, onBeforeSubmit.current(submissionRequest)];
2532
2535
  case 9:
2533
- onBeforeSubmitResult = _h.sent();
2536
+ onBeforeSubmitResult = _j.sent();
2534
2537
  if (onBeforeSubmitResult) submissionRequest = onBeforeSubmitResult;
2535
- _h.label = 10;
2538
+ _j.label = 10;
2536
2539
  case 10:
2537
2540
  return [2 /*return*/, submissionRequest];
2538
2541
  }
2539
2542
  });
2540
2543
  });
2541
- }, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idData, idFrontCaptureAttempts, idFrontImage, idImageResolutionCheck, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters]);
2544
+ }, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idImageResolutionCheck, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters]);
2542
2545
  var defaultOnSubmit = React.useCallback(function () {
2543
2546
  return __awaiter(void 0, void 0, void 0, function () {
2544
2547
  var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
@@ -21548,23 +21551,25 @@
21548
21551
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
21549
21552
  var _z = _a.requestedAction,
21550
21553
  requestedAction = _z === void 0 ? 'SHOW_ID_FRONT' : _z,
21551
- _0 = _a.satisfied,
21552
- satisfied = _0 === void 0 ? false : _0,
21553
- _1 = _a.faceGuideStatus,
21554
- faceGuideStatus = _1 === void 0 ? 'success' : _1,
21554
+ _0 = _a.idDocumentType,
21555
+ idDocumentType = _0 === void 0 ? 'idCard' : _0,
21556
+ _1 = _a.satisfied,
21557
+ satisfied = _1 === void 0 ? false : _1,
21558
+ _2 = _a.faceGuideStatus,
21559
+ faceGuideStatus = _2 === void 0 ? 'success' : _2,
21555
21560
  faceGuideBorderWidth = _a.faceGuideBorderWidth,
21556
21561
  faceGuideBorderColor = _a.faceGuideBorderColor,
21557
- _2 = _a.idCardGuideStatus,
21558
- idCardGuideStatus = _2 === void 0 ? 'ready' : _2,
21562
+ _3 = _a.idCardGuideStatus,
21563
+ idCardGuideStatus = _3 === void 0 ? 'ready' : _3,
21559
21564
  idCardGuideBorderWidth = _a.idCardGuideBorderWidth,
21560
21565
  idCardGuideBorderColor = _a.idCardGuideBorderColor,
21561
21566
  idCardCaptureProgress = _a.idCardCaptureProgress,
21562
- _3 = _a.idCaptureGuideImages,
21563
- userSuppliedImages = _3 === void 0 ? defaultIdCaptureGuideImages : _3,
21564
- _4 = _a.classNames,
21565
- classNames = _4 === void 0 ? {} : _4,
21566
- _5 = _a.verbiage,
21567
- rawVerbiage = _5 === void 0 ? {} : _5;
21567
+ _4 = _a.idCaptureGuideImages,
21568
+ userSuppliedImages = _4 === void 0 ? defaultIdCaptureGuideImages : _4,
21569
+ _5 = _a.classNames,
21570
+ classNames = _5 === void 0 ? {} : _5,
21571
+ _6 = _a.verbiage,
21572
+ rawVerbiage = _6 === void 0 ? {} : _6;
21568
21573
  var isRearFacing = useCameraStore(function (state) {
21569
21574
  return state.isRearFacing;
21570
21575
  });
@@ -21581,17 +21586,17 @@
21581
21586
  if (faceGuideBorderColor === undefined) faceGuideBorderColor = (_j = satisfied ? (_f = (_e = theme.idVideoCapture) === null || _e === void 0 ? void 0 : _e.faceGuides) === null || _f === void 0 ? void 0 : _f.satisfiedColor : (_h = (_g = theme.idVideoCapture) === null || _g === void 0 ? void 0 : _g.faceGuides) === null || _h === void 0 ? void 0 : _h.unsatisfiedColor) !== null && _j !== void 0 ? _j : '#D6DCE7';
21582
21587
  if (idCardGuideBorderWidth === undefined) idCardGuideBorderWidth = (_m = (_l = (_k = theme.idVideoCapture) === null || _k === void 0 ? void 0 : _k.idCardGuides) === null || _l === void 0 ? void 0 : _l.borderWidth) !== null && _m !== void 0 ? _m : 20;
21583
21588
  if (idCardGuideBorderColor === undefined) idCardGuideBorderColor = (_s = satisfied ? (_p = (_o = theme.idVideoCapture) === null || _o === void 0 ? void 0 : _o.idCardGuides) === null || _p === void 0 ? void 0 : _p.satisfiedColor : (_r = (_q = theme.idVideoCapture) === null || _q === void 0 ? void 0 : _q.idCardGuides) === null || _r === void 0 ? void 0 : _r.unsatisfiedColor) !== null && _s !== void 0 ? _s : '#D6DCE7';
21584
- var _6 = useResizeObserver(),
21585
- idCardGuideRef = _6.ref,
21586
- _7 = _6.width,
21587
- idCardGuideWidth = _7 === void 0 ? 0 : _7,
21588
- _8 = _6.height,
21589
- idCardGuideHeight = _8 === void 0 ? 0 : _8;
21589
+ var _7 = useResizeObserver(),
21590
+ idCardGuideRef = _7.ref,
21591
+ _8 = _7.width,
21592
+ idCardGuideWidth = _8 === void 0 ? 0 : _8,
21593
+ _9 = _7.height,
21594
+ idCardGuideHeight = _9 === void 0 ? 0 : _9;
21590
21595
  var idCaptureGuideImages = useGuideImages(userSuppliedImages);
21591
21596
  var idCaptureGuideImagesByUrl = useGuideImagesByUrl(idCaptureGuideImages);
21592
- var _9 = React.useState(undefined),
21593
- aspectRatio = _9[0],
21594
- setAspectRatio = _9[1];
21597
+ var _10 = React.useState(undefined),
21598
+ aspectRatio = _10[0],
21599
+ setAspectRatio = _10[1];
21595
21600
  var onImageLoaded = React.useCallback(function (e) {
21596
21601
  var _a, _b, _c, _d;
21597
21602
  var img = e.currentTarget;
@@ -21640,7 +21645,7 @@
21640
21645
  className: classNames.idCardGuideImage,
21641
21646
  "$isMirrored": !isRearFacing,
21642
21647
  style: idCardImageStyle,
21643
- src: requestedAction === 'SHOW_PASSPORT' ? idCaptureGuideImages.landscape.SHOW_PASSPORT.url : requestedAction === 'SHOW_ID_BACK' ? idCaptureGuideImages.landscape.SHOW_ID_BACK.url : idCaptureGuideImages.landscape.SHOW_ID_FRONT.url,
21648
+ src: idDocumentType === 'passport' ? idCaptureGuideImages.landscape.SHOW_PASSPORT.url : requestedAction === 'SHOW_ID_BACK' ? idCaptureGuideImages.landscape.SHOW_ID_BACK.url : idCaptureGuideImages.landscape.SHOW_ID_FRONT.url,
21644
21649
  onLoad: onImageLoaded
21645
21650
  })), requestedAction === 'FLIP_ID' && ( /*#__PURE__*/React.createElement(IdVideoCaptureFlipIdPrompt, {
21646
21651
  idCaptureGuideImages: idCaptureGuideImages,
@@ -22189,6 +22194,7 @@
22189
22194
  classNames: classNames.guides,
22190
22195
  verbiage: rawVerbiage.guides,
22191
22196
  requestedAction: requestedAction,
22197
+ idDocumentType: idDocumentType,
22192
22198
  satisfied: satisfied,
22193
22199
  idCardGuideStatus: countdownStartedAt ? 'capturing' : 'ready',
22194
22200
  idCardCaptureProgress: countdownStartedAt ? 1 : 0,
@@ -22499,10 +22505,11 @@
22499
22505
  var _b, _c, _d, _e;
22500
22506
  var status = _a.status;
22501
22507
  return /*#__PURE__*/React.createElement(IdVideoCaptureGuides, {
22502
- idCaptureGuideImages: idCaptureGuideImages,
22503
22508
  classNames: (_b = classNames.idVideoCapture) === null || _b === void 0 ? void 0 : _b.guides,
22504
22509
  verbiage: (_c = verbiage.idVideoCapture) === null || _c === void 0 ? void 0 : _c.guides,
22505
22510
  requestedAction: "VERIFY_LIVENESS",
22511
+ idCaptureGuideImages: idCaptureGuideImages,
22512
+ idDocumentType: idDocumentType,
22506
22513
  faceGuideStatus: status,
22507
22514
  faceGuideBorderColor: status === 'success' ? (_d = colors.idVideoCapture) === null || _d === void 0 ? void 0 : _d.guidesSatisfiedColor : (_e = colors.idVideoCapture) === null || _e === void 0 ? void 0 : _e.guidesUnsatisfiedColor,
22508
22515
  idCardGuideStatus: "disabled"