idmission-web-sdk 2.2.105 → 2.2.107

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.105';
214
+ var webSdkVersion = '2.2.107';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2153,83 +2153,87 @@
2153
2153
  userSuppliedOnRequestFailure = _a.onRequestFailure,
2154
2154
  clientRequestID = _a.clientRequestID,
2155
2155
  _x = _a.useDocumentServiceForLivenessChecks,
2156
- useDocumentServiceForLivenessChecks = _x === void 0 ? false : _x;
2156
+ useDocumentServiceForLivenessChecks = _x === void 0 ? false : _x,
2157
+ _y = _a.estimateAge,
2158
+ estimateAge = _y === void 0 ? false : _y,
2159
+ _z = _a.predictGender,
2160
+ predictGender = _z === void 0 ? false : _z;
2157
2161
  var sessionId = useAuthContext()[0].sessionId;
2158
- var _y = React.useState(SubmissionStatus.READY),
2159
- submissionStatus = _y[0],
2160
- setSubmissionStatus = _y[1];
2161
- var _z = React.useState(null),
2162
- submissionRequest = _z[0],
2163
- setSubmissionRequest = _z[1];
2164
- var _0 = React.useState(null),
2165
- submissionResponse = _0[0],
2166
- setSubmissionResponse = _0[1];
2162
+ var _0 = React.useState(SubmissionStatus.READY),
2163
+ submissionStatus = _0[0],
2164
+ setSubmissionStatus = _0[1];
2167
2165
  var _1 = React.useState(null),
2168
- submissionError = _1[0],
2169
- setSubmissionError = _1[1];
2166
+ submissionRequest = _1[0],
2167
+ setSubmissionRequest = _1[1];
2170
2168
  var _2 = React.useState(null),
2171
- retrySubmission = _2[0],
2172
- setRetrySubmission = _2[1];
2169
+ submissionResponse = _2[0],
2170
+ setSubmissionResponse = _2[1];
2173
2171
  var _3 = React.useState(null),
2174
- livenessCheckRequest = _3[0],
2175
- setLivenessCheckRequest = _3[1];
2172
+ submissionError = _3[0],
2173
+ setSubmissionError = _3[1];
2176
2174
  var _4 = React.useState(null),
2177
- idFrontImage = _4[0],
2178
- setIdFrontImage = _4[1];
2175
+ retrySubmission = _4[0],
2176
+ setRetrySubmission = _4[1];
2179
2177
  var _5 = React.useState(null),
2180
- idBackImage = _5[0],
2181
- setIdBackImage = _5[1];
2178
+ livenessCheckRequest = _5[0],
2179
+ setLivenessCheckRequest = _5[1];
2182
2180
  var _6 = React.useState(null),
2183
- passportImage = _6[0],
2184
- setPassportImage = _6[1];
2181
+ idFrontImage = _6[0],
2182
+ setIdFrontImage = _6[1];
2185
2183
  var _7 = React.useState(null),
2186
- selfieImage = _7[0],
2187
- setSelfieImage = _7[1];
2184
+ idBackImage = _7[0],
2185
+ setIdBackImage = _7[1];
2188
2186
  var _8 = React.useState(null),
2189
- signatureData = _8[0],
2190
- setSignatureData = _8[1];
2187
+ passportImage = _8[0],
2188
+ setPassportImage = _8[1];
2191
2189
  var _9 = React.useState(null),
2192
- signatureVideoUrl = _9[0],
2193
- setSignatureVideoUrl = _9[1];
2190
+ selfieImage = _9[0],
2191
+ setSelfieImage = _9[1];
2194
2192
  var _10 = React.useState(null),
2195
- idCaptureVideoUrl = _10[0],
2196
- setIdCaptureVideoUrl = _10[1];
2193
+ signatureData = _10[0],
2194
+ setSignatureData = _10[1];
2197
2195
  var _11 = React.useState(null),
2198
- idCaptureVideoIdFrontImage = _11[0],
2199
- setIdCaptureVideoIdFrontImage = _11[1];
2196
+ signatureVideoUrl = _11[0],
2197
+ setSignatureVideoUrl = _11[1];
2200
2198
  var _12 = React.useState(null),
2201
- idCaptureVideoIdBackImage = _12[0],
2202
- setIdCaptureVideoIdBackImage = _12[1];
2199
+ idCaptureVideoUrl = _12[0],
2200
+ setIdCaptureVideoUrl = _12[1];
2203
2201
  var _13 = React.useState(null),
2204
- idCaptureVideoAudioUrl = _13[0],
2205
- setIdCaptureVideoAudioUrl = _13[1];
2202
+ idCaptureVideoIdFrontImage = _13[0],
2203
+ setIdCaptureVideoIdFrontImage = _13[1];
2206
2204
  var _14 = React.useState(null),
2207
- idCaptureVideoAudioStartsAt = _14[0],
2208
- setIdCaptureVideoAudioStartsAt = _14[1];
2205
+ idCaptureVideoIdBackImage = _14[0],
2206
+ setIdCaptureVideoIdBackImage = _14[1];
2209
2207
  var _15 = React.useState(null),
2210
- expectedAudioText = _15[0],
2211
- setExpectedAudioText = _15[1];
2208
+ idCaptureVideoAudioUrl = _15[0],
2209
+ setIdCaptureVideoAudioUrl = _15[1];
2212
2210
  var _16 = React.useState(null),
2213
- additionalDocuments = _16[0],
2214
- setAdditionalDocuments = _16[1];
2211
+ idCaptureVideoAudioStartsAt = _16[0],
2212
+ setIdCaptureVideoAudioStartsAt = _16[1];
2215
2213
  var _17 = React.useState(null),
2216
- geolocationResult = _17[0],
2217
- setGeolocationResult = _17[1];
2218
- var _18 = React.useState(0),
2219
- geolocationAttempts = _18[0],
2220
- setGeolocationAttempts = _18[1];
2221
- var _19 = React.useState(false),
2222
- geolocationBlocked = _19[0],
2223
- setGeolocationBlocked = _19[1];
2224
- var _20 = React.useState([]),
2225
- idFrontCaptureAttempts = _20[0],
2226
- setIdFrontCaptureAttempts = _20[1];
2227
- var _21 = React.useState([]),
2228
- idBackCaptureAttempts = _21[0],
2229
- setIdBackCaptureAttempts = _21[1];
2214
+ expectedAudioText = _17[0],
2215
+ setExpectedAudioText = _17[1];
2216
+ var _18 = React.useState(null),
2217
+ additionalDocuments = _18[0],
2218
+ setAdditionalDocuments = _18[1];
2219
+ var _19 = React.useState(null),
2220
+ geolocationResult = _19[0],
2221
+ setGeolocationResult = _19[1];
2222
+ var _20 = React.useState(0),
2223
+ geolocationAttempts = _20[0],
2224
+ setGeolocationAttempts = _20[1];
2225
+ var _21 = React.useState(false),
2226
+ geolocationBlocked = _21[0],
2227
+ setGeolocationBlocked = _21[1];
2230
2228
  var _22 = React.useState([]),
2231
- selfieCaptureAttempts = _22[0],
2232
- setSelfieCaptureAttempts = _22[1];
2229
+ idFrontCaptureAttempts = _22[0],
2230
+ setIdFrontCaptureAttempts = _22[1];
2231
+ var _23 = React.useState([]),
2232
+ idBackCaptureAttempts = _23[0],
2233
+ setIdBackCaptureAttempts = _23[1];
2234
+ var _24 = React.useState([]),
2235
+ selfieCaptureAttempts = _24[0],
2236
+ setSelfieCaptureAttempts = _24[1];
2233
2237
  var logIdFrontCaptureAttempt = React.useCallback(function (attempt) {
2234
2238
  setIdFrontCaptureAttempts(function (attempts) {
2235
2239
  return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
@@ -2663,8 +2667,8 @@
2663
2667
  additionalData: {
2664
2668
  uniqueRequestId: new Date().getTime().toString(),
2665
2669
  stripSpecialCharacters: webhooksStripSpecialCharacters ? 'Y' : 'N',
2666
- estimateAge: 'N',
2667
- predictGender: 'N'
2670
+ estimateAge: estimateAge ? 'Y' : 'N',
2671
+ predictGender: predictGender ? 'Y' : 'N'
2668
2672
  }
2669
2673
  };
2670
2674
  if (clientRequestID) {
@@ -2697,7 +2701,7 @@
2697
2701
  }
2698
2702
  });
2699
2703
  });
2700
- }, [clientRequestID, documentServiceUrl, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
2704
+ }, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
2701
2705
  var checkLiveness = React.useCallback(function (imageDataUrl) {
2702
2706
  return __awaiter(void 0, void 0, void 0, function () {
2703
2707
  var request, host, endpoint, response, statusMessage, submissionResponse_3, e_2, err;
@@ -22968,8 +22972,9 @@
22968
22972
  (function () {
22969
22973
  return __awaiter(_this, void 0, void 0, function () {
22970
22974
  var stream, tracks, audioTrack;
22971
- return __generator(this, function (_a) {
22972
- switch (_a.label) {
22975
+ var _a;
22976
+ return __generator(this, function (_b) {
22977
+ switch (_b.label) {
22973
22978
  case 0:
22974
22979
  if (!!outputCanvas.current) return [3 /*break*/, 2];
22975
22980
  return [4 /*yield*/, new Promise(function (resolve) {
@@ -22981,17 +22986,18 @@
22981
22986
  }, 10);
22982
22987
  })];
22983
22988
  case 1:
22984
- _a.sent();
22985
- _a.label = 2;
22989
+ _b.sent();
22990
+ _b.label = 2;
22986
22991
  case 2:
22987
22992
  startRecordingVideo();
22988
22993
  if (captureAudio) startRecordingAudio();
22989
22994
  stream = outputCanvas.current.captureStream(24 /* fps */);
22990
22995
  tracks = [stream.getVideoTracks()[0]];
22991
- audioTrack = audioStream.getAudioTracks()[0];
22996
+ audioTrack = (_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks()) === null || _a === void 0 ? void 0 : _a[0];
22992
22997
  if (audioTrack) tracks.push(audioTrack);
22993
22998
  signatureRecorder.current = new MediaRecorder(new MediaStream(tracks), {
22994
- videoBitsPerSecond: 270000
22999
+ videoBitsPerSecond: 270000,
23000
+ audioBitsPerSecond: 32000
22995
23001
  });
22996
23002
  signatureRecorder.current.start();
22997
23003
  signatureRecorder.current.ondataavailable = function (event) {
@@ -25289,6 +25295,8 @@
25289
25295
  webhooksFireOnReviewURL = _a.webhooksFireOnReviewURL,
25290
25296
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
25291
25297
  useDocumentServiceForLivenessChecks = _a.useDocumentServiceForLivenessChecks,
25298
+ estimateAge = _a.estimateAge,
25299
+ predictGender = _a.predictGender,
25292
25300
  _d = _a.loadingOverlayMode,
25293
25301
  loadingOverlayMode = _d === void 0 ? 'default' : _d,
25294
25302
  _e = _a.timeoutDurationMs,
@@ -25373,7 +25381,9 @@
25373
25381
  onBeforeLivenessCheck: onBeforeSubmit,
25374
25382
  geolocationEnabled: geolocationEnabled,
25375
25383
  geolocationRequired: geolocationRequired,
25376
- useDocumentServiceForLivenessChecks: useDocumentServiceForLivenessChecks
25384
+ useDocumentServiceForLivenessChecks: useDocumentServiceForLivenessChecks,
25385
+ estimateAge: estimateAge,
25386
+ predictGender: predictGender
25377
25387
  }, /*#__PURE__*/React.createElement(CompositeWizard, {
25378
25388
  checks: React.useMemo(function () {
25379
25389
  return ['FaceLiveness'];