idmission-web-sdk 2.2.157 → 2.2.159

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.157';
214
+ var webSdkVersion = '2.2.159';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2159,83 +2159,85 @@
2159
2159
  _y = _a.estimateAge,
2160
2160
  estimateAge = _y === void 0 ? false : _y,
2161
2161
  _z = _a.predictGender,
2162
- predictGender = _z === void 0 ? false : _z;
2162
+ predictGender = _z === void 0 ? false : _z,
2163
+ _0 = _a.throwErrorsOnFailure,
2164
+ throwErrorsOnFailure = _0 === void 0 ? !userSuppliedOnRequestFailure : _0;
2163
2165
  var sessionId = useAuthContext()[0].sessionId;
2164
- var _0 = React.useState(SubmissionStatus.READY),
2165
- submissionStatus = _0[0],
2166
- setSubmissionStatus = _0[1];
2167
- var _1 = React.useState(null),
2168
- submissionRequest = _1[0],
2169
- setSubmissionRequest = _1[1];
2166
+ var _1 = React.useState(SubmissionStatus.READY),
2167
+ submissionStatus = _1[0],
2168
+ setSubmissionStatus = _1[1];
2170
2169
  var _2 = React.useState(null),
2171
- submissionResponse = _2[0],
2172
- setSubmissionResponse = _2[1];
2170
+ submissionRequest = _2[0],
2171
+ setSubmissionRequest = _2[1];
2173
2172
  var _3 = React.useState(null),
2174
- submissionError = _3[0],
2175
- setSubmissionError = _3[1];
2173
+ submissionResponse = _3[0],
2174
+ setSubmissionResponse = _3[1];
2176
2175
  var _4 = React.useState(null),
2177
- retrySubmission = _4[0],
2178
- setRetrySubmission = _4[1];
2176
+ submissionError = _4[0],
2177
+ setSubmissionError = _4[1];
2179
2178
  var _5 = React.useState(null),
2180
- livenessCheckRequest = _5[0],
2181
- setLivenessCheckRequest = _5[1];
2179
+ retrySubmission = _5[0],
2180
+ setRetrySubmission = _5[1];
2182
2181
  var _6 = React.useState(null),
2183
- idFrontImage = _6[0],
2184
- setIdFrontImage = _6[1];
2182
+ livenessCheckRequest = _6[0],
2183
+ setLivenessCheckRequest = _6[1];
2185
2184
  var _7 = React.useState(null),
2186
- idBackImage = _7[0],
2187
- setIdBackImage = _7[1];
2185
+ idFrontImage = _7[0],
2186
+ setIdFrontImage = _7[1];
2188
2187
  var _8 = React.useState(null),
2189
- passportImage = _8[0],
2190
- setPassportImage = _8[1];
2188
+ idBackImage = _8[0],
2189
+ setIdBackImage = _8[1];
2191
2190
  var _9 = React.useState(null),
2192
- selfieImage = _9[0],
2193
- setSelfieImage = _9[1];
2191
+ passportImage = _9[0],
2192
+ setPassportImage = _9[1];
2194
2193
  var _10 = React.useState(null),
2195
- signatureData = _10[0],
2196
- setSignatureData = _10[1];
2194
+ selfieImage = _10[0],
2195
+ setSelfieImage = _10[1];
2197
2196
  var _11 = React.useState(null),
2198
- signatureVideoUrl = _11[0],
2199
- setSignatureVideoUrl = _11[1];
2197
+ signatureData = _11[0],
2198
+ setSignatureData = _11[1];
2200
2199
  var _12 = React.useState(null),
2201
- idCaptureVideoUrl = _12[0],
2202
- setIdCaptureVideoUrl = _12[1];
2200
+ signatureVideoUrl = _12[0],
2201
+ setSignatureVideoUrl = _12[1];
2203
2202
  var _13 = React.useState(null),
2204
- idCaptureVideoIdFrontImage = _13[0],
2205
- setIdCaptureVideoIdFrontImage = _13[1];
2203
+ idCaptureVideoUrl = _13[0],
2204
+ setIdCaptureVideoUrl = _13[1];
2206
2205
  var _14 = React.useState(null),
2207
- idCaptureVideoIdBackImage = _14[0],
2208
- setIdCaptureVideoIdBackImage = _14[1];
2206
+ idCaptureVideoIdFrontImage = _14[0],
2207
+ setIdCaptureVideoIdFrontImage = _14[1];
2209
2208
  var _15 = React.useState(null),
2210
- idCaptureVideoAudioUrl = _15[0],
2211
- setIdCaptureVideoAudioUrl = _15[1];
2209
+ idCaptureVideoIdBackImage = _15[0],
2210
+ setIdCaptureVideoIdBackImage = _15[1];
2212
2211
  var _16 = React.useState(null),
2213
- idCaptureVideoAudioStartsAt = _16[0],
2214
- setIdCaptureVideoAudioStartsAt = _16[1];
2212
+ idCaptureVideoAudioUrl = _16[0],
2213
+ setIdCaptureVideoAudioUrl = _16[1];
2215
2214
  var _17 = React.useState(null),
2216
- expectedAudioText = _17[0],
2217
- setExpectedAudioText = _17[1];
2215
+ idCaptureVideoAudioStartsAt = _17[0],
2216
+ setIdCaptureVideoAudioStartsAt = _17[1];
2218
2217
  var _18 = React.useState(null),
2219
- additionalDocuments = _18[0],
2220
- setAdditionalDocuments = _18[1];
2218
+ expectedAudioText = _18[0],
2219
+ setExpectedAudioText = _18[1];
2221
2220
  var _19 = React.useState(null),
2222
- geolocationResult = _19[0],
2223
- setGeolocationResult = _19[1];
2224
- var _20 = React.useState(0),
2225
- geolocationAttempts = _20[0],
2226
- setGeolocationAttempts = _20[1];
2227
- var _21 = React.useState(false),
2228
- geolocationBlocked = _21[0],
2229
- setGeolocationBlocked = _21[1];
2230
- var _22 = React.useState([]),
2231
- idFrontCaptureAttempts = _22[0],
2232
- setIdFrontCaptureAttempts = _22[1];
2221
+ additionalDocuments = _19[0],
2222
+ setAdditionalDocuments = _19[1];
2223
+ var _20 = React.useState(null),
2224
+ geolocationResult = _20[0],
2225
+ setGeolocationResult = _20[1];
2226
+ var _21 = React.useState(0),
2227
+ geolocationAttempts = _21[0],
2228
+ setGeolocationAttempts = _21[1];
2229
+ var _22 = React.useState(false),
2230
+ geolocationBlocked = _22[0],
2231
+ setGeolocationBlocked = _22[1];
2233
2232
  var _23 = React.useState([]),
2234
- idBackCaptureAttempts = _23[0],
2235
- setIdBackCaptureAttempts = _23[1];
2233
+ idFrontCaptureAttempts = _23[0],
2234
+ setIdFrontCaptureAttempts = _23[1];
2236
2235
  var _24 = React.useState([]),
2237
- selfieCaptureAttempts = _24[0],
2238
- setSelfieCaptureAttempts = _24[1];
2236
+ idBackCaptureAttempts = _24[0],
2237
+ setIdBackCaptureAttempts = _24[1];
2238
+ var _25 = React.useState([]),
2239
+ selfieCaptureAttempts = _25[0],
2240
+ setSelfieCaptureAttempts = _25[1];
2239
2241
  var logIdFrontCaptureAttempt = React.useCallback(function (attempt) {
2240
2242
  setIdFrontCaptureAttempts(function (attempts) {
2241
2243
  return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
@@ -2321,11 +2323,14 @@
2321
2323
  onDocumentUploadProgress: onDocumentUploadProgress.current,
2322
2324
  onDocumentUploaded: onDocumentUploaded.current,
2323
2325
  onDocumentUploadFailed: onDocumentUploadFailed.current
2326
+ })["catch"](function (e) {
2327
+ if (!throwErrorsOnFailure) throw e;
2328
+ return '';
2324
2329
  })];
2325
2330
  }
2326
2331
  });
2327
2332
  });
2328
- }, [documentServiceUrl, jobId, sessionId, taskId]);
2333
+ }, [documentServiceUrl, jobId, sessionId, taskId, throwErrorsOnFailure]);
2329
2334
  var buildSubmissionPayload = React.useCallback(function () {
2330
2335
  return __awaiter(void 0, void 0, void 0, function () {
2331
2336
  function uploadIfPossible(src_1, filename_1) {
@@ -2461,10 +2466,6 @@
2461
2466
  submissionRequest.customerData.idData.idImageFront = documents.passportImage;
2462
2467
  }
2463
2468
  if (documents.selfieImage) {
2464
- // if (action === SubmissionAction.IDENTIFY) {
2465
- // // TODO: remove once API is fixed
2466
- // submissionRequest.biometricData = { selfie: documents.selfieImage }
2467
- // }
2468
2469
  submissionRequest.customerData.biometricData = {
2469
2470
  selfie: documents.selfieImage
2470
2471
  };
@@ -2612,13 +2613,14 @@
2612
2613
  } : defaultOnSubmit;
2613
2614
  });
2614
2615
  (_c = onRequestFailure.current) === null || _c === void 0 ? void 0 : _c.call(onRequestFailure, err);
2615
- throw err;
2616
+ if (throwErrorsOnFailure) throw err;
2617
+ return [3 /*break*/, 8];
2616
2618
  case 8:
2617
2619
  return [2 /*return*/];
2618
2620
  }
2619
2621
  });
2620
2622
  });
2621
- }, [action, buildSubmissionPayload, submissionUrl, environment, idFrontImage, idBackImage, passportImage, selfieImage, sessionId, sendBase64DocumentsInSwaggerProxy]);
2623
+ }, [action, buildSubmissionPayload, submissionUrl, environment, idFrontImage, idBackImage, passportImage, selfieImage, sessionId, sendBase64DocumentsInSwaggerProxy, throwErrorsOnFailure]);
2622
2624
  var submit = React.useCallback(function () {
2623
2625
  return __awaiter(void 0, void 0, void 0, function () {
2624
2626
  var _a, _b;
@@ -2766,13 +2768,14 @@
2766
2768
  };
2767
2769
  });
2768
2770
  (_a = onRequestFailure.current) === null || _a === void 0 ? void 0 : _a.call(onRequestFailure, err);
2769
- throw err;
2771
+ if (throwErrorsOnFailure) throw err;
2772
+ return [3 /*break*/, 7];
2770
2773
  case 7:
2771
2774
  return [2 /*return*/];
2772
2775
  }
2773
2776
  });
2774
2777
  });
2775
- }, [buildLivenessCheckPayload, submissionUrl, environment, idCardForFaceMatch, sessionId, sendBase64DocumentsInSwaggerProxy]);
2778
+ }, [buildLivenessCheckPayload, submissionUrl, environment, idCardForFaceMatch, sessionId, sendBase64DocumentsInSwaggerProxy, throwErrorsOnFailure]);
2776
2779
  var retryLocationAccess = React.useCallback(function () {
2777
2780
  setGeolocationAttempts(function (n) {
2778
2781
  return n + 1;