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
package/dist/sdk2.esm.js
CHANGED
|
@@ -200,7 +200,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
200
200
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
-
var webSdkVersion = '2.2.
|
|
203
|
+
var webSdkVersion = '2.2.8';
|
|
204
204
|
|
|
205
205
|
function getPlatform() {
|
|
206
206
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -279,6 +279,7 @@ var submissionHosts = {
|
|
|
279
279
|
prod: 'https://api.idmission.com',
|
|
280
280
|
demo: 'https://apidemo.idmission.com'
|
|
281
281
|
};
|
|
282
|
+
|
|
282
283
|
function determineSubmissionHost(environment, token) {
|
|
283
284
|
var host = submissionHosts[environment];
|
|
284
285
|
if (!host) throw new Error("unrecognized SubmissionEnvironment ".concat(environment));
|
|
@@ -4321,105 +4322,107 @@ var _reducer = function reducer(state, action) {
|
|
|
4321
4322
|
guideImageHeight: action.payload.height
|
|
4322
4323
|
});
|
|
4323
4324
|
case 'objectsDetected':
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4325
|
+
{
|
|
4326
|
+
var _d = action.payload.prediction,
|
|
4327
|
+
detectedObjects = _d.detectedObjects,
|
|
4328
|
+
detectionThresholdMet = _d.detectionThresholdMet,
|
|
4329
|
+
detectedDocumentType = _d.detectedDocumentType,
|
|
4330
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
4331
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
4332
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
4333
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
4334
|
+
passportDetectionScore = _d.passportDetectionScore,
|
|
4335
|
+
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
4336
|
+
bestDocument = _d.bestDocument,
|
|
4337
|
+
documentInBounds = _d.documentInBounds,
|
|
4338
|
+
documentTooClose = _d.documentTooClose,
|
|
4339
|
+
documentIsStable = _d.documentIsStable,
|
|
4340
|
+
focusScore = _d.focusScore,
|
|
4341
|
+
focusThresholdMet = _d.focusThresholdMet,
|
|
4342
|
+
frameWidth = _d.frameWidth,
|
|
4343
|
+
frameHeight = _d.frameHeight;
|
|
4344
|
+
var frameCapturedAt = new Date();
|
|
4345
|
+
var frameCaptureRate = 0;
|
|
4346
|
+
var goodFramesThreshold = state.goodFramesThreshold;
|
|
4347
|
+
if (state.lastFrameCapturedAt) {
|
|
4348
|
+
var frameTime = frameCapturedAt.getTime() - state.lastFrameCapturedAt.getTime();
|
|
4349
|
+
if (frameTime > 0) {
|
|
4350
|
+
frameCaptureRate = 1000.0 / frameTime;
|
|
4351
|
+
if (frameCaptureRate > 0) {
|
|
4352
|
+
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
4353
|
+
}
|
|
4351
4354
|
}
|
|
4352
4355
|
}
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
wrongDocumentTypePredictions += 1;
|
|
4365
|
-
}
|
|
4366
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
|
|
4367
|
-
var goodFramesCount = state.goodFramesCount;
|
|
4368
|
-
if (isGoodFrame) {
|
|
4369
|
-
goodFramesCount += 1;
|
|
4370
|
-
}
|
|
4371
|
-
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
4372
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
4373
|
-
if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
|
|
4374
|
-
if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
|
|
4375
|
-
requestedDocumentType = 'idCardFront';
|
|
4376
|
-
} else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
|
|
4377
|
-
requestedDocumentType = 'idCardBack';
|
|
4356
|
+
var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
|
|
4357
|
+
var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
|
|
4358
|
+
var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
|
|
4359
|
+
var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
|
|
4360
|
+
var idCardBeingCaptured = idCardFrontWasCaptured && !idCardBackWasCaptured || !idCardFrontWasCaptured && idCardBackWasCaptured;
|
|
4361
|
+
var passportDetectedButNotAllowed = detectedDocumentType === 'passport' && (passportNotAllowed || idCardBeingCaptured);
|
|
4362
|
+
var flipRequired = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardFrontWasCaptured && detectedDocumentType === 'idCardFront' : state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront');
|
|
4363
|
+
var backDetectedFirst = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardBackWasCaptured && detectedDocumentType === 'idCardBack' : state.requestedDocumentType === 'idCardFront' && detectedDocumentType === 'idCardBack');
|
|
4364
|
+
var wrongDocumentTypePredictions = state.wrongDocumentTypePredictions;
|
|
4365
|
+
if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
|
|
4366
|
+
wrongDocumentTypePredictions += 1;
|
|
4378
4367
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
if (
|
|
4382
|
-
|
|
4368
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
|
|
4369
|
+
var goodFramesCount = state.goodFramesCount;
|
|
4370
|
+
if (isGoodFrame) {
|
|
4371
|
+
goodFramesCount += 1;
|
|
4372
|
+
}
|
|
4373
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
4374
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
4375
|
+
if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
|
|
4376
|
+
if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
|
|
4377
|
+
requestedDocumentType = 'idCardFront';
|
|
4378
|
+
} else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
|
|
4379
|
+
requestedDocumentType = 'idCardBack';
|
|
4380
|
+
}
|
|
4383
4381
|
}
|
|
4384
|
-
if (
|
|
4385
|
-
|
|
4382
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4383
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
4384
|
+
requestedDocumentType = 'passport';
|
|
4385
|
+
}
|
|
4386
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
4387
|
+
requestedDocumentType = idCardFrontWasCaptured ? 'idCardBack' : 'idCardFront';
|
|
4388
|
+
}
|
|
4386
4389
|
}
|
|
4390
|
+
var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
|
|
4391
|
+
var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
|
|
4392
|
+
var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
|
|
4393
|
+
return _assign(_assign({}, state), {
|
|
4394
|
+
videoWidth: frameWidth,
|
|
4395
|
+
videoHeight: frameHeight,
|
|
4396
|
+
detectedObjects: detectedObjects,
|
|
4397
|
+
bestDocument: bestDocument,
|
|
4398
|
+
requestedDocumentType: requestedDocumentType,
|
|
4399
|
+
detectedDocumentType: detectedDocumentType,
|
|
4400
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
4401
|
+
documentInBounds: documentInBounds,
|
|
4402
|
+
documentTooClose: documentTooClose,
|
|
4403
|
+
documentIsStable: documentIsStable,
|
|
4404
|
+
flipRequired: flipRequired,
|
|
4405
|
+
backDetectedFirst: backDetectedFirst,
|
|
4406
|
+
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
4407
|
+
passportDetectedButNotAllowed: passportDetectedButNotAllowed,
|
|
4408
|
+
allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
|
|
4409
|
+
wrongDocumentTypePredictions: wrongDocumentTypePredictions,
|
|
4410
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
4411
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
4412
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4413
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4414
|
+
passportDetectionScore: passportDetectionScore,
|
|
4415
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4416
|
+
focusScore: focusScore,
|
|
4417
|
+
focusThresholdMet: focusThresholdMet,
|
|
4418
|
+
isGoodFrame: isGoodFrame,
|
|
4419
|
+
goodFramesCount: goodFramesCount,
|
|
4420
|
+
goodFramesThreshold: goodFramesThreshold,
|
|
4421
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
4422
|
+
lastFrameCapturedAt: frameCapturedAt,
|
|
4423
|
+
frameCaptureRate: frameCaptureRate
|
|
4424
|
+
});
|
|
4387
4425
|
}
|
|
4388
|
-
var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
|
|
4389
|
-
var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
|
|
4390
|
-
var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
|
|
4391
|
-
return _assign(_assign({}, state), {
|
|
4392
|
-
videoWidth: frameWidth,
|
|
4393
|
-
videoHeight: frameHeight,
|
|
4394
|
-
detectedObjects: detectedObjects,
|
|
4395
|
-
bestDocument: bestDocument,
|
|
4396
|
-
requestedDocumentType: requestedDocumentType,
|
|
4397
|
-
detectedDocumentType: detectedDocumentType,
|
|
4398
|
-
detectionThresholdMet: detectionThresholdMet,
|
|
4399
|
-
documentInBounds: documentInBounds,
|
|
4400
|
-
documentTooClose: documentTooClose,
|
|
4401
|
-
documentIsStable: documentIsStable,
|
|
4402
|
-
flipRequired: flipRequired,
|
|
4403
|
-
backDetectedFirst: backDetectedFirst,
|
|
4404
|
-
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
4405
|
-
passportDetectedButNotAllowed: passportDetectedButNotAllowed,
|
|
4406
|
-
allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
|
|
4407
|
-
wrongDocumentTypePredictions: wrongDocumentTypePredictions,
|
|
4408
|
-
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
4409
|
-
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
4410
|
-
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4411
|
-
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4412
|
-
passportDetectionScore: passportDetectionScore,
|
|
4413
|
-
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4414
|
-
focusScore: focusScore,
|
|
4415
|
-
focusThresholdMet: focusThresholdMet,
|
|
4416
|
-
isGoodFrame: isGoodFrame,
|
|
4417
|
-
goodFramesCount: goodFramesCount,
|
|
4418
|
-
goodFramesThreshold: goodFramesThreshold,
|
|
4419
|
-
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
4420
|
-
lastFrameCapturedAt: frameCapturedAt,
|
|
4421
|
-
frameCaptureRate: frameCaptureRate
|
|
4422
|
-
});
|
|
4423
4426
|
case 'captureStarted':
|
|
4424
4427
|
return _assign(_assign({}, state), {
|
|
4425
4428
|
captureStartedAt: new Date(),
|