idmission-web-sdk 2.3.128 → 2.3.129
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/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCaptureWizard.d.ts.map +1 -1
- package/dist/components/submission/SubmissionProvider.d.ts +5 -4
- package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +4 -0
- package/dist/components/submission/types.d.ts.map +1 -1
- package/dist/contexts/SubmissionContext.d.ts +2 -1
- package/dist/contexts/SubmissionContext.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +185 -56
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +185 -56
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +185 -56
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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.3.
|
|
214
|
+
var webSdkVersion = '2.3.129';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -361,11 +361,13 @@
|
|
|
361
361
|
var selfieCaptureAttempts = _a.selfieCaptureAttempts,
|
|
362
362
|
idFrontCaptureAttempts = _a.idFrontCaptureAttempts,
|
|
363
363
|
idBackCaptureAttempts = _a.idBackCaptureAttempts,
|
|
364
|
+
barcodeCaptureAttempts = _a.barcodeCaptureAttempts,
|
|
364
365
|
geolocationResult = _a.geolocationResult;
|
|
365
366
|
var metadata = {
|
|
366
367
|
selfie: selfieCaptureAttempts,
|
|
367
368
|
front: idFrontCaptureAttempts,
|
|
368
369
|
back: idBackCaptureAttempts,
|
|
370
|
+
barcode: barcodeCaptureAttempts,
|
|
369
371
|
isRealIDCheckRequired: 'false',
|
|
370
372
|
sdkVersion: "WebSDK_".concat(webSdkVersion),
|
|
371
373
|
Resolution: typeof window !== 'undefined' ? "".concat(window.innerWidth, " x ").concat(window.innerHeight) : 'unknown'
|
|
@@ -2064,6 +2066,26 @@
|
|
|
2064
2066
|
setDefaultSubmissionUrl(url + '/swagger');
|
|
2065
2067
|
setDefaultDocumentServiceUrl(url + '/files/');
|
|
2066
2068
|
}
|
|
2069
|
+
var capturedDocumentTypeToSubmissionKey = {
|
|
2070
|
+
idCardFront: 'idFrontImage',
|
|
2071
|
+
idCardBack: 'idBackImage',
|
|
2072
|
+
passport: 'passportImage',
|
|
2073
|
+
singlePage: 'idFrontImage',
|
|
2074
|
+
selfie: 'selfieImage',
|
|
2075
|
+
idFrontIrImage: 'idFrontIrImage',
|
|
2076
|
+
idBackIrImage: 'idBackIrImage',
|
|
2077
|
+
idFrontUvImage: 'idFrontUvImage',
|
|
2078
|
+
idBackUvImage: 'idBackUvImage',
|
|
2079
|
+
idBarcodeImage: 'idBarcodeImage'
|
|
2080
|
+
};
|
|
2081
|
+
var sanitizeMetadata = function sanitizeMetadata(metadata) {
|
|
2082
|
+
var entries = Object.entries(metadata).filter(function (_a) {
|
|
2083
|
+
var value = _a[1];
|
|
2084
|
+
return value !== undefined && value !== null;
|
|
2085
|
+
});
|
|
2086
|
+
if (!entries.length) return null;
|
|
2087
|
+
return Object.fromEntries(entries);
|
|
2088
|
+
};
|
|
2067
2089
|
var SubmissionContext = /*#__PURE__*/React.createContext({
|
|
2068
2090
|
submit: function submit() {
|
|
2069
2091
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -2151,6 +2173,9 @@
|
|
|
2151
2173
|
setAdditionalDocuments: function setAdditionalDocuments() {
|
|
2152
2174
|
return null;
|
|
2153
2175
|
},
|
|
2176
|
+
setDocumentFileMetadata: function setDocumentFileMetadata() {
|
|
2177
|
+
return null;
|
|
2178
|
+
},
|
|
2154
2179
|
uploadDocument: Promise.resolve,
|
|
2155
2180
|
logIdFrontCaptureAttempt: function logIdFrontCaptureAttempt() {
|
|
2156
2181
|
return null;
|
|
@@ -2302,60 +2327,139 @@
|
|
|
2302
2327
|
var _18 = React.useState(null),
|
|
2303
2328
|
signatureVideoMetadata = _18[0],
|
|
2304
2329
|
setSignatureVideoMetadata = _18[1];
|
|
2305
|
-
var _19 = React.useState(
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
var _20 = React.useState(
|
|
2309
|
-
|
|
2310
|
-
|
|
2330
|
+
var _19 = React.useState({}),
|
|
2331
|
+
documentFileMetadata = _19[0],
|
|
2332
|
+
setDocumentFileMetadataState = _19[1];
|
|
2333
|
+
var _20 = React.useState([]),
|
|
2334
|
+
barcodeCaptureAttempts = _20[0],
|
|
2335
|
+
setBarcodeCaptureAttempts = _20[1];
|
|
2311
2336
|
var _21 = React.useState(null),
|
|
2312
|
-
|
|
2313
|
-
|
|
2337
|
+
idCaptureVideoUrl = _21[0],
|
|
2338
|
+
setIdCaptureVideoUrl = _21[1];
|
|
2314
2339
|
var _22 = React.useState(null),
|
|
2315
|
-
|
|
2316
|
-
|
|
2340
|
+
idCaptureVideoIdFrontImage = _22[0],
|
|
2341
|
+
setIdCaptureVideoIdFrontImage = _22[1];
|
|
2317
2342
|
var _23 = React.useState(null),
|
|
2318
|
-
|
|
2319
|
-
|
|
2343
|
+
idCaptureVideoIdBackImage = _23[0],
|
|
2344
|
+
setIdCaptureVideoIdBackImage = _23[1];
|
|
2320
2345
|
var _24 = React.useState(null),
|
|
2321
|
-
|
|
2322
|
-
|
|
2346
|
+
idCaptureVideoAudioUrl = _24[0],
|
|
2347
|
+
setIdCaptureVideoAudioUrl = _24[1];
|
|
2323
2348
|
var _25 = React.useState(null),
|
|
2324
|
-
|
|
2325
|
-
|
|
2349
|
+
idCaptureVideoAudioStartsAt = _25[0],
|
|
2350
|
+
setIdCaptureVideoAudioStartsAt = _25[1];
|
|
2326
2351
|
var _26 = React.useState(null),
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
var _27 = React.useState(
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
var
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2352
|
+
expectedAudioText = _26[0],
|
|
2353
|
+
setExpectedAudioText = _26[1];
|
|
2354
|
+
var _27 = React.useState(null),
|
|
2355
|
+
additionalDocuments = _27[0],
|
|
2356
|
+
setAdditionalDocuments = _27[1];
|
|
2357
|
+
var setDocumentFileMetadata = React.useCallback(function (key, metadata) {
|
|
2358
|
+
var sanitized = metadata ? sanitizeMetadata(metadata) : null;
|
|
2359
|
+
setDocumentFileMetadataState(function (current) {
|
|
2360
|
+
var _a;
|
|
2361
|
+
if (!sanitized) {
|
|
2362
|
+
if (!(key in current)) return current;
|
|
2363
|
+
var next = _assign({}, current);
|
|
2364
|
+
delete next[key];
|
|
2365
|
+
if (key === 'idBarcodeImage') {
|
|
2366
|
+
setBarcodeCaptureAttempts([]);
|
|
2367
|
+
}
|
|
2368
|
+
return next;
|
|
2369
|
+
}
|
|
2370
|
+
return _assign(_assign({}, current), (_a = {}, _a[key] = sanitized, _a));
|
|
2371
|
+
});
|
|
2372
|
+
}, []);
|
|
2373
|
+
var _28 = React.useState(null),
|
|
2374
|
+
geolocationResult = _28[0],
|
|
2375
|
+
setGeolocationResult = _28[1];
|
|
2376
|
+
var _29 = React.useState(0),
|
|
2377
|
+
geolocationAttempts = _29[0],
|
|
2378
|
+
setGeolocationAttempts = _29[1];
|
|
2379
|
+
var _30 = React.useState(false),
|
|
2380
|
+
geolocationBlocked = _30[0],
|
|
2381
|
+
setGeolocationBlocked = _30[1];
|
|
2341
2382
|
var _31 = React.useState([]),
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
var
|
|
2383
|
+
idFrontCaptureAttempts = _31[0],
|
|
2384
|
+
setIdFrontCaptureAttempts = _31[1];
|
|
2385
|
+
var _32 = React.useState([]),
|
|
2386
|
+
idBackCaptureAttempts = _32[0],
|
|
2387
|
+
setIdBackCaptureAttempts = _32[1];
|
|
2388
|
+
var _33 = React.useState([]),
|
|
2389
|
+
selfieCaptureAttempts = _33[0],
|
|
2390
|
+
setSelfieCaptureAttempts = _33[1];
|
|
2391
|
+
var logIdFrontCaptureAttempt = React.useCallback(function (attempt, documentType) {
|
|
2345
2392
|
setIdFrontCaptureAttempts(function (attempts) {
|
|
2346
2393
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
2347
2394
|
});
|
|
2348
|
-
|
|
2349
|
-
|
|
2395
|
+
var submissionKey = capturedDocumentTypeToSubmissionKey[documentType];
|
|
2396
|
+
if (submissionKey) {
|
|
2397
|
+
setDocumentFileMetadata(submissionKey, {
|
|
2398
|
+
documentType: documentType,
|
|
2399
|
+
documentKey: submissionKey,
|
|
2400
|
+
captureMode: attempt.captureMode,
|
|
2401
|
+
autoCapture: attempt.autoCapture,
|
|
2402
|
+
captureTime: attempt.captureTime,
|
|
2403
|
+
operationTime: attempt.operationTime,
|
|
2404
|
+
bestDetectionScore: attempt.bestDetectionScore,
|
|
2405
|
+
bestFocusScore: attempt.bestFocusScore,
|
|
2406
|
+
bestBarcodeScore: attempt.bestBarcodeScore,
|
|
2407
|
+
boundingBox: attempt.boundingBox
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
if (attempt.bestBarcodeScore !== undefined && attempt.bestBarcodeScore !== null) {
|
|
2411
|
+
setBarcodeCaptureAttempts(function (attempts) {
|
|
2412
|
+
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
2413
|
+
});
|
|
2414
|
+
setDocumentFileMetadata('idBarcodeImage', {
|
|
2415
|
+
documentType: 'idBarcodeImage',
|
|
2416
|
+
sourceDocumentType: documentType,
|
|
2417
|
+
documentKey: 'idBarcodeImage',
|
|
2418
|
+
bestBarcodeScore: attempt.bestBarcodeScore,
|
|
2419
|
+
captureMode: attempt.captureMode,
|
|
2420
|
+
autoCapture: attempt.autoCapture,
|
|
2421
|
+
captureTime: attempt.captureTime,
|
|
2422
|
+
operationTime: attempt.operationTime
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
}, [setDocumentFileMetadata]);
|
|
2426
|
+
var logIdBackCaptureAttempt = React.useCallback(function (attempt, documentType) {
|
|
2350
2427
|
setIdBackCaptureAttempts(function (attempts) {
|
|
2351
2428
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
2352
2429
|
});
|
|
2353
|
-
|
|
2430
|
+
var submissionKey = capturedDocumentTypeToSubmissionKey[documentType];
|
|
2431
|
+
if (submissionKey) {
|
|
2432
|
+
setDocumentFileMetadata(submissionKey, {
|
|
2433
|
+
documentType: documentType,
|
|
2434
|
+
documentKey: submissionKey,
|
|
2435
|
+
captureMode: attempt.captureMode,
|
|
2436
|
+
autoCapture: attempt.autoCapture,
|
|
2437
|
+
captureTime: attempt.captureTime,
|
|
2438
|
+
operationTime: attempt.operationTime,
|
|
2439
|
+
bestDetectionScore: attempt.bestDetectionScore,
|
|
2440
|
+
bestFocusScore: attempt.bestFocusScore,
|
|
2441
|
+
bestBarcodeScore: attempt.bestBarcodeScore,
|
|
2442
|
+
boundingBox: attempt.boundingBox
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
}, [setDocumentFileMetadata]);
|
|
2354
2446
|
var logSelfieCaptureAttempt = React.useCallback(function (attempt) {
|
|
2355
2447
|
setSelfieCaptureAttempts(function (attempts) {
|
|
2356
2448
|
return __spreadArray(__spreadArray([], attempts, true), [attempt], false);
|
|
2357
2449
|
});
|
|
2358
|
-
|
|
2450
|
+
setDocumentFileMetadata('selfieImage', {
|
|
2451
|
+
documentType: 'selfie',
|
|
2452
|
+
documentKey: 'selfieImage',
|
|
2453
|
+
captureMode: attempt.captureMode,
|
|
2454
|
+
autoCapture: attempt.autoCapture,
|
|
2455
|
+
captureTime: attempt.captureTime,
|
|
2456
|
+
operationTime: attempt.operationTime,
|
|
2457
|
+
livenessScore: attempt.livenessScore,
|
|
2458
|
+
bestDetectionScore: attempt.bestDetectionScore,
|
|
2459
|
+
bestFocusScore: attempt.bestFocusScore,
|
|
2460
|
+
boundingBox: attempt.boundingBox
|
|
2461
|
+
});
|
|
2462
|
+
}, [setDocumentFileMetadata]);
|
|
2359
2463
|
useRevokeObjectUrlOnUnmount(signatureVideoUrl);
|
|
2360
2464
|
useRevokeObjectUrlOnUnmount(idCaptureVideoUrl);
|
|
2361
2465
|
useRevokeObjectUrlOnUnmount(idCaptureVideoAudioUrl);
|
|
@@ -2505,14 +2609,15 @@
|
|
|
2505
2609
|
if (!documentServiceUrl) return [3 /*break*/, 8];
|
|
2506
2610
|
return [4 /*yield*/, Promise.all(Object.keys(documents).map(function (k) {
|
|
2507
2611
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2508
|
-
var filetype, metadata, _a, _b;
|
|
2612
|
+
var filetype, metadataSource, metadata, _a, _b;
|
|
2509
2613
|
return __generator(this, function (_c) {
|
|
2510
2614
|
switch (_c.label) {
|
|
2511
2615
|
case 0:
|
|
2512
2616
|
if (!documents[k]) return [3 /*break*/, 2];
|
|
2513
2617
|
filetype = k.endsWith('Video') ? 'video/mp4' : k.endsWith('Audio') ? 'audio/mp4' : 'image/jpeg';
|
|
2514
|
-
|
|
2515
|
-
|
|
2618
|
+
metadataSource = k === 'signatureVideo' && signatureVideoMetadata ? signatureVideoMetadata : documentFileMetadata[k];
|
|
2619
|
+
metadata = metadataSource ? {
|
|
2620
|
+
filemetadata: JSON.stringify(metadataSource)
|
|
2516
2621
|
} : {};
|
|
2517
2622
|
_a = documents;
|
|
2518
2623
|
_b = k;
|
|
@@ -2663,7 +2768,8 @@
|
|
|
2663
2768
|
selfieCaptureAttempts: selfieCaptureAttempts,
|
|
2664
2769
|
idFrontCaptureAttempts: idFrontCaptureAttempts,
|
|
2665
2770
|
idBackCaptureAttempts: idBackCaptureAttempts,
|
|
2666
|
-
geolocationResult: geolocationResult
|
|
2771
|
+
geolocationResult: geolocationResult,
|
|
2772
|
+
barcodeCaptureAttempts: barcodeCaptureAttempts
|
|
2667
2773
|
});
|
|
2668
2774
|
if (!onBeforeSubmit.current) return [3 /*break*/, 10];
|
|
2669
2775
|
return [4 /*yield*/, onBeforeSubmit.current(submissionRequest)];
|
|
@@ -2676,7 +2782,7 @@
|
|
|
2676
2782
|
}
|
|
2677
2783
|
});
|
|
2678
2784
|
});
|
|
2679
|
-
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idBarcodeImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, signatureVideoMetadata, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
2785
|
+
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, barcodeCaptureAttempts, documentFileMetadata, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idBarcodeImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, signatureVideoMetadata, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
2680
2786
|
var defaultOnSubmit = React.useCallback(function () {
|
|
2681
2787
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2682
2788
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -2836,7 +2942,8 @@
|
|
|
2836
2942
|
selfieCaptureAttempts: selfieCaptureAttempts,
|
|
2837
2943
|
idFrontCaptureAttempts: idFrontCaptureAttempts,
|
|
2838
2944
|
idBackCaptureAttempts: idBackCaptureAttempts,
|
|
2839
|
-
geolocationResult: geolocationResult
|
|
2945
|
+
geolocationResult: geolocationResult,
|
|
2946
|
+
barcodeCaptureAttempts: barcodeCaptureAttempts
|
|
2840
2947
|
});
|
|
2841
2948
|
if (!onBeforeLivenessCheck.current) return [3 /*break*/, 5];
|
|
2842
2949
|
return [4 /*yield*/, onBeforeLivenessCheck.current(request)];
|
|
@@ -2850,7 +2957,7 @@
|
|
|
2850
2957
|
}
|
|
2851
2958
|
});
|
|
2852
2959
|
});
|
|
2853
|
-
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, jobId, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
2960
|
+
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, barcodeCaptureAttempts, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, jobId, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
2854
2961
|
var checkLiveness = React.useCallback(function (imageDataUrl) {
|
|
2855
2962
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2856
2963
|
var request, host, endpoint, response, statusMessage, submissionResponse_3, e_2, err;
|
|
@@ -2983,6 +3090,7 @@
|
|
|
2983
3090
|
setIdCaptureVideoAudioStartsAt: setIdCaptureVideoAudioStartsAt,
|
|
2984
3091
|
setExpectedAudioText: setExpectedAudioText,
|
|
2985
3092
|
setAdditionalDocuments: setAdditionalDocuments,
|
|
3093
|
+
setDocumentFileMetadata: setDocumentFileMetadata,
|
|
2986
3094
|
uploadDocument: uploadDocument,
|
|
2987
3095
|
logIdFrontCaptureAttempt: logIdFrontCaptureAttempt,
|
|
2988
3096
|
logIdBackCaptureAttempt: logIdBackCaptureAttempt,
|
|
@@ -2991,7 +3099,7 @@
|
|
|
2991
3099
|
checkLiveness: checkLiveness,
|
|
2992
3100
|
retryLocationAccess: retryLocationAccess
|
|
2993
3101
|
};
|
|
2994
|
-
}, [additionalDocuments, checkLiveness, environment, idBackImage, idBackIrImage, idBackUvImage, idBarcodeImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idFrontImage, idFrontIrImage, idFrontUvImage, livenessCheckRequest, logIdBackCaptureAttempt, logIdFrontCaptureAttempt, logSelfieCaptureAttempt, passportImage, retryLocationAccess, selfieImage, signatureData, signatureVideoUrl, submissionError, submissionRequest, submissionResponse, submissionStatus, submit, uploadDocument]);
|
|
3102
|
+
}, [additionalDocuments, checkLiveness, environment, idBackImage, idBackIrImage, idBackUvImage, idBarcodeImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idFrontImage, idFrontIrImage, idFrontUvImage, livenessCheckRequest, logIdBackCaptureAttempt, logIdFrontCaptureAttempt, logSelfieCaptureAttempt, passportImage, retryLocationAccess, selfieImage, signatureData, signatureVideoUrl, setDocumentFileMetadata, submissionError, submissionRequest, submissionResponse, submissionStatus, submit, uploadDocument]);
|
|
2995
3103
|
return /*#__PURE__*/React.createElement(SubmissionContext.Provider, {
|
|
2996
3104
|
value: value
|
|
2997
3105
|
}, geolocationRequired && geolocationBlocked ? ( /*#__PURE__*/React.createElement(GeolocationAccessDeniedOverlay, null)) : children, submissionError && ( /*#__PURE__*/React.createElement(SubmissionErrorOverlay, {
|
|
@@ -3056,23 +3164,26 @@
|
|
|
3056
3164
|
return 'unknown';
|
|
3057
3165
|
}
|
|
3058
3166
|
var CREATE_UPLOAD_RETRY_DELAYS = [1500, 3000, 6000, 12000];
|
|
3059
|
-
|
|
3167
|
+
var RETRYABLE_STATUS_CODES = new Set([408, 409, 423]);
|
|
3168
|
+
function shouldRetryTusError(error, retryableMethods) {
|
|
3060
3169
|
var _a, _b, _c, _d;
|
|
3061
3170
|
if (typeof ProgressEvent !== 'undefined' && error instanceof ProgressEvent) {
|
|
3062
3171
|
return true;
|
|
3063
3172
|
}
|
|
3064
3173
|
if (error instanceof tusJsClient.DetailedError) {
|
|
3174
|
+
var method = void 0;
|
|
3065
3175
|
try {
|
|
3066
|
-
|
|
3067
|
-
return false;
|
|
3068
|
-
}
|
|
3176
|
+
method = (_b = (_a = error.originalRequest) === null || _a === void 0 ? void 0 : _a.getMethod) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3069
3177
|
} catch (requestMethodError) {
|
|
3070
3178
|
warn('Unable to read request method from tus error', requestMethodError);
|
|
3071
3179
|
return false;
|
|
3072
3180
|
}
|
|
3181
|
+
if (method && retryableMethods.length && !retryableMethods.includes(method)) {
|
|
3182
|
+
return false;
|
|
3183
|
+
}
|
|
3073
3184
|
var status_1 = (_d = (_c = error.originalResponse) === null || _c === void 0 ? void 0 : _c.getStatus) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
3074
3185
|
if (typeof status_1 === 'number') {
|
|
3075
|
-
if (status_1 >= 500 || status_1
|
|
3186
|
+
if (status_1 >= 500 || RETRYABLE_STATUS_CODES.has(status_1)) {
|
|
3076
3187
|
return true;
|
|
3077
3188
|
}
|
|
3078
3189
|
return false;
|
|
@@ -3081,6 +3192,12 @@
|
|
|
3081
3192
|
}
|
|
3082
3193
|
return false;
|
|
3083
3194
|
}
|
|
3195
|
+
function shouldRetryCreateRequest(error) {
|
|
3196
|
+
return shouldRetryTusError(error, ['POST']);
|
|
3197
|
+
}
|
|
3198
|
+
function shouldRetryChunkRequest(error) {
|
|
3199
|
+
return shouldRetryTusError(error, ['PATCH', 'POST']);
|
|
3200
|
+
}
|
|
3084
3201
|
function normalizeUploadError(error) {
|
|
3085
3202
|
if (error instanceof Error) {
|
|
3086
3203
|
return error;
|
|
@@ -3205,6 +3322,9 @@
|
|
|
3205
3322
|
},
|
|
3206
3323
|
onError: function onError(error) {
|
|
3207
3324
|
reject(error);
|
|
3325
|
+
},
|
|
3326
|
+
onShouldRetry: function onShouldRetry(error) {
|
|
3327
|
+
return shouldRetryChunkRequest(error);
|
|
3208
3328
|
}
|
|
3209
3329
|
});
|
|
3210
3330
|
upload.findPreviousUploads().then(function (previousUploads) {
|
|
@@ -16294,7 +16414,8 @@
|
|
|
16294
16414
|
var capturedDocumentType = documentType;
|
|
16295
16415
|
setTimeout(function () {
|
|
16296
16416
|
var _a, _b;
|
|
16297
|
-
var
|
|
16417
|
+
var captureStartedAt = (_a = state.captureStartedAt) === null || _a === void 0 ? void 0 : _a.getTime();
|
|
16418
|
+
var captureTime = captureStartedAt ? Date.now() - captureStartedAt : 0;
|
|
16298
16419
|
var metadata = {
|
|
16299
16420
|
autoCapture: 'Y',
|
|
16300
16421
|
captureTime: captureTime,
|
|
@@ -20169,12 +20290,14 @@
|
|
|
20169
20290
|
captureState = _a.captureState,
|
|
20170
20291
|
operationStartedAt = _a.operationStartedAt,
|
|
20171
20292
|
requestedDocumentType = _a.requestedDocumentType;
|
|
20293
|
+
if (!requestedDocumentType) return;
|
|
20294
|
+
var docType = requestedDocumentType;
|
|
20172
20295
|
metadata.operationTime = new Date().getTime() - (operationStartedAt !== null && operationStartedAt !== void 0 ? operationStartedAt : new Date()).getTime();
|
|
20173
20296
|
metadata.captureMode = isFallbackMode ? 'Manual' : captureState === 'uploading' ? 'Upload' : 'Auto';
|
|
20174
|
-
if (
|
|
20175
|
-
logIdBackCaptureAttempt(metadata);
|
|
20297
|
+
if (docType === 'idCardBack') {
|
|
20298
|
+
logIdBackCaptureAttempt(metadata, docType);
|
|
20176
20299
|
} else {
|
|
20177
|
-
logIdFrontCaptureAttempt(metadata);
|
|
20300
|
+
logIdFrontCaptureAttempt(metadata, docType);
|
|
20178
20301
|
}
|
|
20179
20302
|
}, [isFallbackMode, logIdBackCaptureAttempt, logIdFrontCaptureAttempt]);
|
|
20180
20303
|
React.useEffect(function startModelsWhenCapturing() {
|
|
@@ -25345,10 +25468,16 @@
|
|
|
25345
25468
|
onCapture === null || onCapture === void 0 ? void 0 : onCapture(imageUrl);
|
|
25346
25469
|
}, [logCaptureMetadata, onCapture]);
|
|
25347
25470
|
var onFallbackImageCaptured = React.useCallback(function (imageUrl) {
|
|
25471
|
+
logSelfieCaptureAttempt({
|
|
25472
|
+
autoCapture: 'N',
|
|
25473
|
+
captureMode: 'Upload',
|
|
25474
|
+
captureTime: 0,
|
|
25475
|
+
operationTime: 0
|
|
25476
|
+
});
|
|
25348
25477
|
setSelfieImage(imageUrl);
|
|
25349
25478
|
setCaptureState('SUCCESS');
|
|
25350
25479
|
onCapture === null || onCapture === void 0 ? void 0 : onCapture(imageUrl);
|
|
25351
|
-
}, [onCapture, setSelfieImage]);
|
|
25480
|
+
}, [logSelfieCaptureAttempt, onCapture, setSelfieImage]);
|
|
25352
25481
|
var guidesByRequestState = React.useCallback(function (props) {
|
|
25353
25482
|
var GuidesComponent = guidesComponent !== null && guidesComponent !== void 0 ? guidesComponent : FaceCaptureGuideOverlay;
|
|
25354
25483
|
var status = ['IN_PROGRESS', 'CAPTURE_STARTED', 'GUIDANCE_SATISFIED', 'CAPTURED'].includes(captureState) ? 'processing' : ['FAILED', 'ERROR'].includes(captureState) ? 'failure' : 'ready';
|