idmission-web-sdk 2.2.6 → 2.2.8
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/CompositeWizard.d.ts.map +1 -1
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +1 -1
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts.map +1 -1
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +1 -1
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts.map +1 -1
- package/dist/components/customer_flows/CustomerIdentification.d.ts +1 -1
- package/dist/components/customer_flows/CustomerIdentification.d.ts.map +1 -1
- package/dist/components/customer_flows/CustomerVerification.d.ts +1 -1
- package/dist/components/customer_flows/CustomerVerification.d.ts.map +1 -1
- package/dist/components/customer_flows/DocumentCapture.d.ts.map +1 -1
- package/dist/components/customer_flows/FaceValidation.d.ts +1 -1
- package/dist/components/customer_flows/FaceValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +1 -1
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/SignatureKYC.d.ts +1 -1
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/customer_flows/VideoIdValidation.d.ts +1 -1
- package/dist/components/customer_flows/VideoIdValidation.d.ts.map +1 -1
- package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts +1 -1
- package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts.map +1 -1
- package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts +1 -1
- package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts.map +1 -1
- package/dist/components/customer_verification/CustomerVerificationCapture.d.ts +1 -1
- package/dist/components/customer_verification/CustomerVerificationCapture.d.ts.map +1 -1
- package/dist/components/customer_verification/CustomerVerificationWizard.d.ts +1 -1
- package/dist/components/customer_verification/CustomerVerificationWizard.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
- package/dist/components/id_capture/IdCapture.d.ts +1 -1
- package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/submission/Errors.d.ts +1 -1
- package/dist/components/submission/Errors.d.ts.map +1 -1
- package/dist/components/submission/SubmissionProvider.d.ts +2 -2
- package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +188 -0
- package/dist/components/submission/types.d.ts.map +1 -0
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +1 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
- package/dist/contexts/SubmissionContext.d.ts +1 -187
- package/dist/contexts/SubmissionContext.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +97 -94
- 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 +97 -94
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +97 -94
- 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 +2 -2
|
@@ -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.
|
|
214
|
+
var webSdkVersion = '2.2.8';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -290,6 +290,7 @@
|
|
|
290
290
|
prod: 'https://api.idmission.com',
|
|
291
291
|
demo: 'https://apidemo.idmission.com'
|
|
292
292
|
};
|
|
293
|
+
|
|
293
294
|
function determineSubmissionHost(environment, token) {
|
|
294
295
|
var host = submissionHosts[environment];
|
|
295
296
|
if (!host) throw new Error("unrecognized SubmissionEnvironment ".concat(environment));
|
|
@@ -10502,105 +10503,107 @@
|
|
|
10502
10503
|
guideImageHeight: action.payload.height
|
|
10503
10504
|
});
|
|
10504
10505
|
case 'objectsDetected':
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10506
|
+
{
|
|
10507
|
+
var _d = action.payload.prediction,
|
|
10508
|
+
detectedObjects = _d.detectedObjects,
|
|
10509
|
+
detectionThresholdMet = _d.detectionThresholdMet,
|
|
10510
|
+
detectedDocumentType = _d.detectedDocumentType,
|
|
10511
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
10512
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
10513
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
10514
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
10515
|
+
passportDetectionScore = _d.passportDetectionScore,
|
|
10516
|
+
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
10517
|
+
bestDocument = _d.bestDocument,
|
|
10518
|
+
documentInBounds = _d.documentInBounds,
|
|
10519
|
+
documentTooClose = _d.documentTooClose,
|
|
10520
|
+
documentIsStable = _d.documentIsStable,
|
|
10521
|
+
focusScore = _d.focusScore,
|
|
10522
|
+
focusThresholdMet = _d.focusThresholdMet,
|
|
10523
|
+
frameWidth = _d.frameWidth,
|
|
10524
|
+
frameHeight = _d.frameHeight;
|
|
10525
|
+
var frameCapturedAt = new Date();
|
|
10526
|
+
var frameCaptureRate = 0;
|
|
10527
|
+
var goodFramesThreshold = state.goodFramesThreshold;
|
|
10528
|
+
if (state.lastFrameCapturedAt) {
|
|
10529
|
+
var frameTime = frameCapturedAt.getTime() - state.lastFrameCapturedAt.getTime();
|
|
10530
|
+
if (frameTime > 0) {
|
|
10531
|
+
frameCaptureRate = 1000.0 / frameTime;
|
|
10532
|
+
if (frameCaptureRate > 0) {
|
|
10533
|
+
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
10534
|
+
}
|
|
10532
10535
|
}
|
|
10533
10536
|
}
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
wrongDocumentTypePredictions += 1;
|
|
10546
|
-
}
|
|
10547
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
|
|
10548
|
-
var goodFramesCount = state.goodFramesCount;
|
|
10549
|
-
if (isGoodFrame) {
|
|
10550
|
-
goodFramesCount += 1;
|
|
10551
|
-
}
|
|
10552
|
-
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10553
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
10554
|
-
if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
|
|
10555
|
-
if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
|
|
10556
|
-
requestedDocumentType = 'idCardFront';
|
|
10557
|
-
} else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
|
|
10558
|
-
requestedDocumentType = 'idCardBack';
|
|
10537
|
+
var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
|
|
10538
|
+
var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
|
|
10539
|
+
var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
|
|
10540
|
+
var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
|
|
10541
|
+
var idCardBeingCaptured = idCardFrontWasCaptured && !idCardBackWasCaptured || !idCardFrontWasCaptured && idCardBackWasCaptured;
|
|
10542
|
+
var passportDetectedButNotAllowed = detectedDocumentType === 'passport' && (passportNotAllowed || idCardBeingCaptured);
|
|
10543
|
+
var flipRequired = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardFrontWasCaptured && detectedDocumentType === 'idCardFront' : state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront');
|
|
10544
|
+
var backDetectedFirst = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardBackWasCaptured && detectedDocumentType === 'idCardBack' : state.requestedDocumentType === 'idCardFront' && detectedDocumentType === 'idCardBack');
|
|
10545
|
+
var wrongDocumentTypePredictions = state.wrongDocumentTypePredictions;
|
|
10546
|
+
if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
|
|
10547
|
+
wrongDocumentTypePredictions += 1;
|
|
10559
10548
|
}
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
if (
|
|
10563
|
-
|
|
10549
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
|
|
10550
|
+
var goodFramesCount = state.goodFramesCount;
|
|
10551
|
+
if (isGoodFrame) {
|
|
10552
|
+
goodFramesCount += 1;
|
|
10553
|
+
}
|
|
10554
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10555
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
10556
|
+
if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
|
|
10557
|
+
if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
|
|
10558
|
+
requestedDocumentType = 'idCardFront';
|
|
10559
|
+
} else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
|
|
10560
|
+
requestedDocumentType = 'idCardBack';
|
|
10561
|
+
}
|
|
10564
10562
|
}
|
|
10565
|
-
if (
|
|
10566
|
-
|
|
10563
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
10564
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
10565
|
+
requestedDocumentType = 'passport';
|
|
10566
|
+
}
|
|
10567
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
10568
|
+
requestedDocumentType = idCardFrontWasCaptured ? 'idCardBack' : 'idCardFront';
|
|
10569
|
+
}
|
|
10567
10570
|
}
|
|
10571
|
+
var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
|
|
10572
|
+
var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
|
|
10573
|
+
var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
|
|
10574
|
+
return _assign(_assign({}, state), {
|
|
10575
|
+
videoWidth: frameWidth,
|
|
10576
|
+
videoHeight: frameHeight,
|
|
10577
|
+
detectedObjects: detectedObjects,
|
|
10578
|
+
bestDocument: bestDocument,
|
|
10579
|
+
requestedDocumentType: requestedDocumentType,
|
|
10580
|
+
detectedDocumentType: detectedDocumentType,
|
|
10581
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
10582
|
+
documentInBounds: documentInBounds,
|
|
10583
|
+
documentTooClose: documentTooClose,
|
|
10584
|
+
documentIsStable: documentIsStable,
|
|
10585
|
+
flipRequired: flipRequired,
|
|
10586
|
+
backDetectedFirst: backDetectedFirst,
|
|
10587
|
+
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
10588
|
+
passportDetectedButNotAllowed: passportDetectedButNotAllowed,
|
|
10589
|
+
allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
|
|
10590
|
+
wrongDocumentTypePredictions: wrongDocumentTypePredictions,
|
|
10591
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
10592
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
10593
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
10594
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
10595
|
+
passportDetectionScore: passportDetectionScore,
|
|
10596
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
10597
|
+
focusScore: focusScore,
|
|
10598
|
+
focusThresholdMet: focusThresholdMet,
|
|
10599
|
+
isGoodFrame: isGoodFrame,
|
|
10600
|
+
goodFramesCount: goodFramesCount,
|
|
10601
|
+
goodFramesThreshold: goodFramesThreshold,
|
|
10602
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
10603
|
+
lastFrameCapturedAt: frameCapturedAt,
|
|
10604
|
+
frameCaptureRate: frameCaptureRate
|
|
10605
|
+
});
|
|
10568
10606
|
}
|
|
10569
|
-
var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
|
|
10570
|
-
var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
|
|
10571
|
-
var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
|
|
10572
|
-
return _assign(_assign({}, state), {
|
|
10573
|
-
videoWidth: frameWidth,
|
|
10574
|
-
videoHeight: frameHeight,
|
|
10575
|
-
detectedObjects: detectedObjects,
|
|
10576
|
-
bestDocument: bestDocument,
|
|
10577
|
-
requestedDocumentType: requestedDocumentType,
|
|
10578
|
-
detectedDocumentType: detectedDocumentType,
|
|
10579
|
-
detectionThresholdMet: detectionThresholdMet,
|
|
10580
|
-
documentInBounds: documentInBounds,
|
|
10581
|
-
documentTooClose: documentTooClose,
|
|
10582
|
-
documentIsStable: documentIsStable,
|
|
10583
|
-
flipRequired: flipRequired,
|
|
10584
|
-
backDetectedFirst: backDetectedFirst,
|
|
10585
|
-
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
10586
|
-
passportDetectedButNotAllowed: passportDetectedButNotAllowed,
|
|
10587
|
-
allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
|
|
10588
|
-
wrongDocumentTypePredictions: wrongDocumentTypePredictions,
|
|
10589
|
-
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
10590
|
-
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
10591
|
-
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
10592
|
-
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
10593
|
-
passportDetectionScore: passportDetectionScore,
|
|
10594
|
-
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
10595
|
-
focusScore: focusScore,
|
|
10596
|
-
focusThresholdMet: focusThresholdMet,
|
|
10597
|
-
isGoodFrame: isGoodFrame,
|
|
10598
|
-
goodFramesCount: goodFramesCount,
|
|
10599
|
-
goodFramesThreshold: goodFramesThreshold,
|
|
10600
|
-
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
10601
|
-
lastFrameCapturedAt: frameCapturedAt,
|
|
10602
|
-
frameCaptureRate: frameCaptureRate
|
|
10603
|
-
});
|
|
10604
10607
|
case 'captureStarted':
|
|
10605
10608
|
return _assign(_assign({}, state), {
|
|
10606
10609
|
captureStartedAt: new Date(),
|