idmission-web-sdk 2.2.157 → 2.2.158

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.157';
206
+ var webSdkVersion = '2.2.158';
207
207
 
208
208
  function getPlatform() {
209
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1177,83 +1177,85 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1177
1177
  _y = _a.estimateAge,
1178
1178
  estimateAge = _y === void 0 ? false : _y,
1179
1179
  _z = _a.predictGender,
1180
- predictGender = _z === void 0 ? false : _z;
1180
+ predictGender = _z === void 0 ? false : _z,
1181
+ _0 = _a.throwErrorsOnFailure,
1182
+ throwErrorsOnFailure = _0 === void 0 ? !userSuppliedOnRequestFailure : _0;
1181
1183
  var sessionId = useAuthContext()[0].sessionId;
1182
- var _0 = useState(SubmissionStatus.READY),
1183
- submissionStatus = _0[0],
1184
- setSubmissionStatus = _0[1];
1185
- var _1 = useState(null),
1186
- submissionRequest = _1[0],
1187
- setSubmissionRequest = _1[1];
1184
+ var _1 = useState(SubmissionStatus.READY),
1185
+ submissionStatus = _1[0],
1186
+ setSubmissionStatus = _1[1];
1188
1187
  var _2 = useState(null),
1189
- submissionResponse = _2[0],
1190
- setSubmissionResponse = _2[1];
1188
+ submissionRequest = _2[0],
1189
+ setSubmissionRequest = _2[1];
1191
1190
  var _3 = useState(null),
1192
- submissionError = _3[0],
1193
- setSubmissionError = _3[1];
1191
+ submissionResponse = _3[0],
1192
+ setSubmissionResponse = _3[1];
1194
1193
  var _4 = useState(null),
1195
- retrySubmission = _4[0],
1196
- setRetrySubmission = _4[1];
1194
+ submissionError = _4[0],
1195
+ setSubmissionError = _4[1];
1197
1196
  var _5 = useState(null),
1198
- livenessCheckRequest = _5[0],
1199
- setLivenessCheckRequest = _5[1];
1197
+ retrySubmission = _5[0],
1198
+ setRetrySubmission = _5[1];
1200
1199
  var _6 = useState(null),
1201
- idFrontImage = _6[0],
1202
- setIdFrontImage = _6[1];
1200
+ livenessCheckRequest = _6[0],
1201
+ setLivenessCheckRequest = _6[1];
1203
1202
  var _7 = useState(null),
1204
- idBackImage = _7[0],
1205
- setIdBackImage = _7[1];
1203
+ idFrontImage = _7[0],
1204
+ setIdFrontImage = _7[1];
1206
1205
  var _8 = useState(null),
1207
- passportImage = _8[0],
1208
- setPassportImage = _8[1];
1206
+ idBackImage = _8[0],
1207
+ setIdBackImage = _8[1];
1209
1208
  var _9 = useState(null),
1210
- selfieImage = _9[0],
1211
- setSelfieImage = _9[1];
1209
+ passportImage = _9[0],
1210
+ setPassportImage = _9[1];
1212
1211
  var _10 = useState(null),
1213
- signatureData = _10[0],
1214
- setSignatureData = _10[1];
1212
+ selfieImage = _10[0],
1213
+ setSelfieImage = _10[1];
1215
1214
  var _11 = useState(null),
1216
- signatureVideoUrl = _11[0],
1217
- setSignatureVideoUrl = _11[1];
1215
+ signatureData = _11[0],
1216
+ setSignatureData = _11[1];
1218
1217
  var _12 = useState(null),
1219
- idCaptureVideoUrl = _12[0],
1220
- setIdCaptureVideoUrl = _12[1];
1218
+ signatureVideoUrl = _12[0],
1219
+ setSignatureVideoUrl = _12[1];
1221
1220
  var _13 = useState(null),
1222
- idCaptureVideoIdFrontImage = _13[0],
1223
- setIdCaptureVideoIdFrontImage = _13[1];
1221
+ idCaptureVideoUrl = _13[0],
1222
+ setIdCaptureVideoUrl = _13[1];
1224
1223
  var _14 = useState(null),
1225
- idCaptureVideoIdBackImage = _14[0],
1226
- setIdCaptureVideoIdBackImage = _14[1];
1224
+ idCaptureVideoIdFrontImage = _14[0],
1225
+ setIdCaptureVideoIdFrontImage = _14[1];
1227
1226
  var _15 = useState(null),
1228
- idCaptureVideoAudioUrl = _15[0],
1229
- setIdCaptureVideoAudioUrl = _15[1];
1227
+ idCaptureVideoIdBackImage = _15[0],
1228
+ setIdCaptureVideoIdBackImage = _15[1];
1230
1229
  var _16 = useState(null),
1231
- idCaptureVideoAudioStartsAt = _16[0],
1232
- setIdCaptureVideoAudioStartsAt = _16[1];
1230
+ idCaptureVideoAudioUrl = _16[0],
1231
+ setIdCaptureVideoAudioUrl = _16[1];
1233
1232
  var _17 = useState(null),
1234
- expectedAudioText = _17[0],
1235
- setExpectedAudioText = _17[1];
1233
+ idCaptureVideoAudioStartsAt = _17[0],
1234
+ setIdCaptureVideoAudioStartsAt = _17[1];
1236
1235
  var _18 = useState(null),
1237
- additionalDocuments = _18[0],
1238
- setAdditionalDocuments = _18[1];
1236
+ expectedAudioText = _18[0],
1237
+ setExpectedAudioText = _18[1];
1239
1238
  var _19 = useState(null),
1240
- geolocationResult = _19[0],
1241
- setGeolocationResult = _19[1];
1242
- var _20 = useState(0),
1243
- geolocationAttempts = _20[0],
1244
- setGeolocationAttempts = _20[1];
1245
- var _21 = useState(false),
1246
- geolocationBlocked = _21[0],
1247
- setGeolocationBlocked = _21[1];
1248
- var _22 = useState([]),
1249
- idFrontCaptureAttempts = _22[0],
1250
- setIdFrontCaptureAttempts = _22[1];
1239
+ additionalDocuments = _19[0],
1240
+ setAdditionalDocuments = _19[1];
1241
+ var _20 = useState(null),
1242
+ geolocationResult = _20[0],
1243
+ setGeolocationResult = _20[1];
1244
+ var _21 = useState(0),
1245
+ geolocationAttempts = _21[0],
1246
+ setGeolocationAttempts = _21[1];
1247
+ var _22 = useState(false),
1248
+ geolocationBlocked = _22[0],
1249
+ setGeolocationBlocked = _22[1];
1251
1250
  var _23 = useState([]),
1252
- idBackCaptureAttempts = _23[0],
1253
- setIdBackCaptureAttempts = _23[1];
1251
+ idFrontCaptureAttempts = _23[0],
1252
+ setIdFrontCaptureAttempts = _23[1];
1254
1253
  var _24 = useState([]),
1255
- selfieCaptureAttempts = _24[0],
1256
- setSelfieCaptureAttempts = _24[1];
1254
+ idBackCaptureAttempts = _24[0],
1255
+ setIdBackCaptureAttempts = _24[1];
1256
+ var _25 = useState([]),
1257
+ selfieCaptureAttempts = _25[0],
1258
+ setSelfieCaptureAttempts = _25[1];
1257
1259
  var logIdFrontCaptureAttempt = useCallback(function (attempt) {
1258
1260
  setIdFrontCaptureAttempts(function (attempts) {
1259
1261
  return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
@@ -1630,13 +1632,14 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1630
1632
  } : defaultOnSubmit;
1631
1633
  });
1632
1634
  (_c = onRequestFailure.current) === null || _c === void 0 ? void 0 : _c.call(onRequestFailure, err);
1633
- throw err;
1635
+ if (throwErrorsOnFailure) throw err;
1636
+ return [3 /*break*/, 8];
1634
1637
  case 8:
1635
1638
  return [2 /*return*/];
1636
1639
  }
1637
1640
  });
1638
1641
  });
1639
- }, [action, buildSubmissionPayload, submissionUrl, environment, idFrontImage, idBackImage, passportImage, selfieImage, sessionId, sendBase64DocumentsInSwaggerProxy]);
1642
+ }, [action, buildSubmissionPayload, submissionUrl, environment, idFrontImage, idBackImage, passportImage, selfieImage, sessionId, sendBase64DocumentsInSwaggerProxy, throwErrorsOnFailure]);
1640
1643
  var submit = useCallback(function () {
1641
1644
  return __awaiter(void 0, void 0, void 0, function () {
1642
1645
  var _a, _b;
@@ -1784,13 +1787,14 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1784
1787
  };
1785
1788
  });
1786
1789
  (_a = onRequestFailure.current) === null || _a === void 0 ? void 0 : _a.call(onRequestFailure, err);
1787
- throw err;
1790
+ if (throwErrorsOnFailure) throw err;
1791
+ return [3 /*break*/, 7];
1788
1792
  case 7:
1789
1793
  return [2 /*return*/];
1790
1794
  }
1791
1795
  });
1792
1796
  });
1793
- }, [buildLivenessCheckPayload, submissionUrl, environment, idCardForFaceMatch, sessionId, sendBase64DocumentsInSwaggerProxy]);
1797
+ }, [buildLivenessCheckPayload, submissionUrl, environment, idCardForFaceMatch, sessionId, sendBase64DocumentsInSwaggerProxy, throwErrorsOnFailure]);
1794
1798
  var retryLocationAccess = useCallback(function () {
1795
1799
  setGeolocationAttempts(function (n) {
1796
1800
  return n + 1;