idmission-web-sdk 2.2.101 → 2.2.102

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.101';
214
+ var webSdkVersion = '2.2.102';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -18558,6 +18558,7 @@
18558
18558
  }, /*#__PURE__*/React.createElement(XIcon, null)))));
18559
18559
  }
18560
18560
  function PassportUploadScreen(_a) {
18561
+ var _this = this;
18561
18562
  var _b = _a.classNames,
18562
18563
  classNames = _b === void 0 ? {} : _b,
18563
18564
  _c = _a.verbiage,
@@ -18565,7 +18566,6 @@
18565
18566
  var _d = React.useState(null),
18566
18567
  file = _d[0],
18567
18568
  setFile = _d[1];
18568
- var onCapturedManually = useOnCapturedManually();
18569
18569
  var verbiage = useTranslations(rawVerbiage, {
18570
18570
  uploadPassportText: 'Upload Passport',
18571
18571
  loadingText: 'Loading...',
@@ -18591,7 +18591,23 @@
18591
18591
  disabled: !file,
18592
18592
  colors: buttonColors,
18593
18593
  onClick: function onClick() {
18594
- return onCapturedManually(file);
18594
+ return __awaiter(_this, void 0, void 0, function () {
18595
+ var _a;
18596
+ var _b, _c;
18597
+ return __generator(this, function (_d) {
18598
+ switch (_d.label) {
18599
+ case 0:
18600
+ _a = dispatchIdCaptureAction;
18601
+ _b = {
18602
+ type: 'documentCaptured'
18603
+ };
18604
+ _c = {};
18605
+ return [4 /*yield*/, readFile(file)];
18606
+ case 1:
18607
+ return [2 /*return*/, _a.apply(void 0, [(_b.payload = (_c.imageData = _d.sent(), _c.documentType = 'passport', _c.width = 0, _c.height = 0, _c), _b)])];
18608
+ }
18609
+ });
18610
+ });
18595
18611
  }
18596
18612
  }, verbiage.continueText)));
18597
18613
  }
@@ -18648,41 +18664,33 @@
18648
18664
  colors: buttonColors,
18649
18665
  onClick: function onClick() {
18650
18666
  return __awaiter(_this, void 0, void 0, function () {
18651
- var _a, _b, _c, _d, _e;
18652
- var _f, _g, _h, _j, _k;
18653
- return __generator(this, function (_l) {
18654
- switch (_l.label) {
18667
+ var _a, _b, _c, _d;
18668
+ var _e, _f, _g, _h;
18669
+ return __generator(this, function (_j) {
18670
+ switch (_j.label) {
18655
18671
  case 0:
18656
- if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
18657
- state.dispatch({
18658
- type: 'setUploadingDocumentsType',
18659
- payload: 'singlePage'
18660
- });
18661
18672
  _b = (_a = state).dispatch;
18662
- _f = {
18663
- type: 'documentCaptured'
18673
+ _e = {
18674
+ type: 'documentsCaptured'
18664
18675
  };
18665
- _g = {};
18676
+ if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
18677
+ _f = {};
18666
18678
  return [4 /*yield*/, readFile(idFrontFile)];
18667
18679
  case 1:
18668
- _b.apply(_a, [(_f.payload = (_g.imageData = _l.sent(), _g.documentType = 'singlePage', _g.width = 0, _g.height = 0, _g), _f)]);
18680
+ _c = [(_f.imageData = _j.sent(), _f.documentType = 'singlePage', _f.width = 0, _f.height = 0, _f)];
18669
18681
  return [3 /*break*/, 5];
18670
18682
  case 2:
18671
- _d = (_c = state).dispatch;
18672
- _h = {
18673
- type: 'documentsCaptured'
18674
- };
18675
- _j = {};
18683
+ _g = {};
18676
18684
  return [4 /*yield*/, readFile(idFrontFile)];
18677
18685
  case 3:
18678
- _e = [(_j.imageData = _l.sent(), _j.documentType = 'idCardFront', _j.width = 0, _j.height = 0, _j)];
18679
- _k = {};
18686
+ _d = [(_g.imageData = _j.sent(), _g.documentType = 'idCardFront', _g.width = 0, _g.height = 0, _g)];
18687
+ _h = {};
18680
18688
  return [4 /*yield*/, readFile(idBackFile)];
18681
18689
  case 4:
18682
- _d.apply(_c, [(_h.payload = _e.concat([(_k.imageData = _l.sent(), _k.documentType = 'idCardBack', _k.width = 0, _k.height = 0, _k)]), _h)]);
18683
- _l.label = 5;
18690
+ _c = _d.concat([(_h.imageData = _j.sent(), _h.documentType = 'idCardBack', _h.width = 0, _h.height = 0, _h)]);
18691
+ _j.label = 5;
18684
18692
  case 5:
18685
- return [2 /*return*/];
18693
+ return [2 /*return*/, _b.apply(_a, [(_e.payload = _c, _e)])];
18686
18694
  }
18687
18695
  });
18688
18696
  });
@@ -18703,25 +18711,6 @@
18703
18711
  }
18704
18712
  }, children);
18705
18713
  }
18706
- function useOnCapturedManually() {
18707
- return React.useCallback(function () {
18708
- var files = [];
18709
- for (var _i = 0; _i < arguments.length; _i++) {
18710
- files[_i] = arguments[_i];
18711
- }
18712
- return Promise.all(files.filter(Boolean).map(readFile)).then(function (f) {
18713
- for (var _i = 0, f_1 = f; _i < f_1.length; _i++) {
18714
- var imageData = f_1[_i];
18715
- dispatchIdCaptureAction({
18716
- type: 'documentCapturedManually',
18717
- payload: {
18718
- imageData: imageData
18719
- }
18720
- });
18721
- }
18722
- });
18723
- }, []);
18724
- }
18725
18714
  function readFile(file) {
18726
18715
  return new Promise(function (resolve, reject) {
18727
18716
  if (!file) return reject(new Error('File is undefined'));