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.
Files changed (60) hide show
  1. package/dist/components/CompositeWizard.d.ts.map +1 -1
  2. package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +1 -1
  3. package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts.map +1 -1
  4. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +1 -1
  5. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts.map +1 -1
  6. package/dist/components/customer_flows/CustomerIdentification.d.ts +1 -1
  7. package/dist/components/customer_flows/CustomerIdentification.d.ts.map +1 -1
  8. package/dist/components/customer_flows/CustomerVerification.d.ts +1 -1
  9. package/dist/components/customer_flows/CustomerVerification.d.ts.map +1 -1
  10. package/dist/components/customer_flows/DocumentCapture.d.ts.map +1 -1
  11. package/dist/components/customer_flows/FaceValidation.d.ts +1 -1
  12. package/dist/components/customer_flows/FaceValidation.d.ts.map +1 -1
  13. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +1 -1
  14. package/dist/components/customer_flows/IdAndFaceValidation.d.ts.map +1 -1
  15. package/dist/components/customer_flows/IdValidation.d.ts +1 -1
  16. package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
  17. package/dist/components/customer_flows/SignatureKYC.d.ts +1 -1
  18. package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
  19. package/dist/components/customer_flows/VideoIdValidation.d.ts +1 -1
  20. package/dist/components/customer_flows/VideoIdValidation.d.ts.map +1 -1
  21. package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts +1 -1
  22. package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts.map +1 -1
  23. package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts +1 -1
  24. package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts.map +1 -1
  25. package/dist/components/customer_verification/CustomerVerificationCapture.d.ts +1 -1
  26. package/dist/components/customer_verification/CustomerVerificationCapture.d.ts.map +1 -1
  27. package/dist/components/customer_verification/CustomerVerificationWizard.d.ts +1 -1
  28. package/dist/components/customer_verification/CustomerVerificationWizard.d.ts.map +1 -1
  29. package/dist/components/face_liveness/FaceLivenessCapture.d.ts.map +1 -1
  30. package/dist/components/face_liveness/FaceLivenessWizard.d.ts +1 -1
  31. package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
  32. package/dist/components/id_capture/IdCapture.d.ts +1 -1
  33. package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
  34. package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
  35. package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
  36. package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
  37. package/dist/components/submission/Errors.d.ts +1 -1
  38. package/dist/components/submission/Errors.d.ts.map +1 -1
  39. package/dist/components/submission/SubmissionProvider.d.ts +2 -2
  40. package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
  41. package/dist/components/submission/types.d.ts +188 -0
  42. package/dist/components/submission/types.d.ts.map +1 -0
  43. package/dist/components/video_id/IdVideoCaptureWizard.d.ts +1 -1
  44. package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
  45. package/dist/contexts/SubmissionContext.d.ts +1 -187
  46. package/dist/contexts/SubmissionContext.d.ts.map +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/sdk2.cjs.development.js +97 -94
  50. package/dist/sdk2.cjs.development.js.map +1 -1
  51. package/dist/sdk2.cjs.production.js +1 -1
  52. package/dist/sdk2.cjs.production.js.map +1 -1
  53. package/dist/sdk2.esm.js +97 -94
  54. package/dist/sdk2.esm.js.map +1 -1
  55. package/dist/sdk2.umd.development.js +97 -94
  56. package/dist/sdk2.umd.development.js.map +1 -1
  57. package/dist/sdk2.umd.production.js +1 -1
  58. package/dist/sdk2.umd.production.js.map +1 -1
  59. package/dist/version.d.ts +1 -1
  60. package/package.json +2 -2
@@ -230,7 +230,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
230
230
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
231
231
  };
232
232
 
233
- var webSdkVersion = '2.2.6';
233
+ var webSdkVersion = '2.2.8';
234
234
 
235
235
  function getPlatform() {
236
236
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -309,6 +309,7 @@ var submissionHosts = {
309
309
  prod: 'https://api.idmission.com',
310
310
  demo: 'https://apidemo.idmission.com'
311
311
  };
312
+
312
313
  function determineSubmissionHost(environment, token) {
313
314
  var host = submissionHosts[environment];
314
315
  if (!host) throw new Error("unrecognized SubmissionEnvironment ".concat(environment));
@@ -4351,105 +4352,107 @@ var _reducer = function reducer(state, action) {
4351
4352
  guideImageHeight: action.payload.height
4352
4353
  });
4353
4354
  case 'objectsDetected':
4354
- var _d = action.payload.prediction,
4355
- detectedObjects = _d.detectedObjects,
4356
- detectionThresholdMet = _d.detectionThresholdMet,
4357
- detectedDocumentType = _d.detectedDocumentType,
4358
- idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
4359
- idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
4360
- idCardBackDetectionScore = _d.idCardBackDetectionScore,
4361
- idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
4362
- passportDetectionScore = _d.passportDetectionScore,
4363
- passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
4364
- bestDocument = _d.bestDocument,
4365
- documentInBounds = _d.documentInBounds,
4366
- documentTooClose = _d.documentTooClose,
4367
- documentIsStable = _d.documentIsStable,
4368
- focusScore = _d.focusScore,
4369
- focusThresholdMet = _d.focusThresholdMet,
4370
- frameWidth = _d.frameWidth,
4371
- frameHeight = _d.frameHeight;
4372
- var frameCapturedAt = new Date();
4373
- var frameCaptureRate = 0;
4374
- var goodFramesThreshold = state.goodFramesThreshold;
4375
- if (state.lastFrameCapturedAt) {
4376
- var frameTime = frameCapturedAt.getTime() - state.lastFrameCapturedAt.getTime();
4377
- if (frameTime > 0) {
4378
- frameCaptureRate = 1000.0 / frameTime;
4379
- if (frameCaptureRate > 0) {
4380
- goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
4355
+ {
4356
+ var _d = action.payload.prediction,
4357
+ detectedObjects = _d.detectedObjects,
4358
+ detectionThresholdMet = _d.detectionThresholdMet,
4359
+ detectedDocumentType = _d.detectedDocumentType,
4360
+ idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
4361
+ idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
4362
+ idCardBackDetectionScore = _d.idCardBackDetectionScore,
4363
+ idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
4364
+ passportDetectionScore = _d.passportDetectionScore,
4365
+ passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
4366
+ bestDocument = _d.bestDocument,
4367
+ documentInBounds = _d.documentInBounds,
4368
+ documentTooClose = _d.documentTooClose,
4369
+ documentIsStable = _d.documentIsStable,
4370
+ focusScore = _d.focusScore,
4371
+ focusThresholdMet = _d.focusThresholdMet,
4372
+ frameWidth = _d.frameWidth,
4373
+ frameHeight = _d.frameHeight;
4374
+ var frameCapturedAt = new Date();
4375
+ var frameCaptureRate = 0;
4376
+ var goodFramesThreshold = state.goodFramesThreshold;
4377
+ if (state.lastFrameCapturedAt) {
4378
+ var frameTime = frameCapturedAt.getTime() - state.lastFrameCapturedAt.getTime();
4379
+ if (frameTime > 0) {
4380
+ frameCaptureRate = 1000.0 / frameTime;
4381
+ if (frameCaptureRate > 0) {
4382
+ goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
4383
+ }
4381
4384
  }
4382
4385
  }
4383
- }
4384
- var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
4385
- var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
4386
- var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
4387
- var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
4388
- var idCardBeingCaptured = idCardFrontWasCaptured && !idCardBackWasCaptured || !idCardFrontWasCaptured && idCardBackWasCaptured;
4389
- var passportDetectedButNotAllowed = detectedDocumentType === 'passport' && (passportNotAllowed || idCardBeingCaptured);
4390
- var flipRequired = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardFrontWasCaptured && detectedDocumentType === 'idCardFront' : state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront');
4391
- var backDetectedFirst = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardBackWasCaptured && detectedDocumentType === 'idCardBack' : state.requestedDocumentType === 'idCardFront' && detectedDocumentType === 'idCardBack');
4392
- var wrongDocumentTypePredictions = state.wrongDocumentTypePredictions;
4393
- if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
4394
- wrongDocumentTypePredictions += 1;
4395
- }
4396
- var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
4397
- var goodFramesCount = state.goodFramesCount;
4398
- if (isGoodFrame) {
4399
- goodFramesCount += 1;
4400
- }
4401
- var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
4402
- var requestedDocumentType = state.requestedDocumentType;
4403
- if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
4404
- if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
4405
- requestedDocumentType = 'idCardFront';
4406
- } else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
4407
- requestedDocumentType = 'idCardBack';
4386
+ var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
4387
+ var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
4388
+ var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
4389
+ var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
4390
+ var idCardBeingCaptured = idCardFrontWasCaptured && !idCardBackWasCaptured || !idCardFrontWasCaptured && idCardBackWasCaptured;
4391
+ var passportDetectedButNotAllowed = detectedDocumentType === 'passport' && (passportNotAllowed || idCardBeingCaptured);
4392
+ var flipRequired = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardFrontWasCaptured && detectedDocumentType === 'idCardFront' : state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront');
4393
+ var backDetectedFirst = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardBackWasCaptured && detectedDocumentType === 'idCardBack' : state.requestedDocumentType === 'idCardFront' && detectedDocumentType === 'idCardBack');
4394
+ var wrongDocumentTypePredictions = state.wrongDocumentTypePredictions;
4395
+ if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
4396
+ wrongDocumentTypePredictions += 1;
4408
4397
  }
4409
- }
4410
- if (state.captureRequirement === 'idCardOrPassport') {
4411
- if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
4412
- requestedDocumentType = 'passport';
4398
+ var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet && !idCardDetectedButNotAllowed && !passportDetectedButNotAllowed && documentIsStable;
4399
+ var goodFramesCount = state.goodFramesCount;
4400
+ if (isGoodFrame) {
4401
+ goodFramesCount += 1;
4402
+ }
4403
+ var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
4404
+ var requestedDocumentType = state.requestedDocumentType;
4405
+ if (state.captureRequirement.includes('idCard') && state.allowIdCardBackToFrontCapture) {
4406
+ if (detectedDocumentType === 'idCardFront' && state.requestedDocumentType !== 'idCardFront' && !idCardFrontWasCaptured) {
4407
+ requestedDocumentType = 'idCardFront';
4408
+ } else if (detectedDocumentType === 'idCardBack' && state.requestedDocumentType !== 'idCardBack' && !idCardBackWasCaptured) {
4409
+ requestedDocumentType = 'idCardBack';
4410
+ }
4413
4411
  }
4414
- if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
4415
- requestedDocumentType = idCardFrontWasCaptured ? 'idCardBack' : 'idCardFront';
4412
+ if (state.captureRequirement === 'idCardOrPassport') {
4413
+ if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
4414
+ requestedDocumentType = 'passport';
4415
+ }
4416
+ if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
4417
+ requestedDocumentType = idCardFrontWasCaptured ? 'idCardBack' : 'idCardFront';
4418
+ }
4416
4419
  }
4420
+ var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
4421
+ var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
4422
+ var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
4423
+ return _assign(_assign({}, state), {
4424
+ videoWidth: frameWidth,
4425
+ videoHeight: frameHeight,
4426
+ detectedObjects: detectedObjects,
4427
+ bestDocument: bestDocument,
4428
+ requestedDocumentType: requestedDocumentType,
4429
+ detectedDocumentType: detectedDocumentType,
4430
+ detectionThresholdMet: detectionThresholdMet,
4431
+ documentInBounds: documentInBounds,
4432
+ documentTooClose: documentTooClose,
4433
+ documentIsStable: documentIsStable,
4434
+ flipRequired: flipRequired,
4435
+ backDetectedFirst: backDetectedFirst,
4436
+ idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
4437
+ passportDetectedButNotAllowed: passportDetectedButNotAllowed,
4438
+ allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
4439
+ wrongDocumentTypePredictions: wrongDocumentTypePredictions,
4440
+ idCardFrontDetectionScore: idCardFrontDetectionScore,
4441
+ idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
4442
+ idCardBackDetectionScore: idCardBackDetectionScore,
4443
+ idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
4444
+ passportDetectionScore: passportDetectionScore,
4445
+ passportDetectionThresholdMet: passportDetectionThresholdMet,
4446
+ focusScore: focusScore,
4447
+ focusThresholdMet: focusThresholdMet,
4448
+ isGoodFrame: isGoodFrame,
4449
+ goodFramesCount: goodFramesCount,
4450
+ goodFramesThreshold: goodFramesThreshold,
4451
+ goodFramesThresholdMet: goodFramesThresholdMet,
4452
+ lastFrameCapturedAt: frameCapturedAt,
4453
+ frameCaptureRate: frameCaptureRate
4454
+ });
4417
4455
  }
4418
- var hasBeenRunningForLongEnough = !!state.captureStartedAt && new Date().getTime() - state.captureStartedAt.getTime() > 1000;
4419
- var overrideFlipRequirementThreshold = Math.ceil(state.allowOverrideWrongDocumentTypeAfterMs / 1000 * frameCaptureRate);
4420
- var allowOverrideFlipRequirement = state.enableOverrideWrongDocumentTypeDialog && hasBeenRunningForLongEnough && !state.overrideWrongDocumentTypeGuidance && overrideFlipRequirementThreshold > 0 && (state.allowOverrideWrongDocumentTypeGuidance || wrongDocumentTypePredictions >= overrideFlipRequirementThreshold);
4421
- return _assign(_assign({}, state), {
4422
- videoWidth: frameWidth,
4423
- videoHeight: frameHeight,
4424
- detectedObjects: detectedObjects,
4425
- bestDocument: bestDocument,
4426
- requestedDocumentType: requestedDocumentType,
4427
- detectedDocumentType: detectedDocumentType,
4428
- detectionThresholdMet: detectionThresholdMet,
4429
- documentInBounds: documentInBounds,
4430
- documentTooClose: documentTooClose,
4431
- documentIsStable: documentIsStable,
4432
- flipRequired: flipRequired,
4433
- backDetectedFirst: backDetectedFirst,
4434
- idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
4435
- passportDetectedButNotAllowed: passportDetectedButNotAllowed,
4436
- allowOverrideWrongDocumentTypeGuidance: allowOverrideFlipRequirement,
4437
- wrongDocumentTypePredictions: wrongDocumentTypePredictions,
4438
- idCardFrontDetectionScore: idCardFrontDetectionScore,
4439
- idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
4440
- idCardBackDetectionScore: idCardBackDetectionScore,
4441
- idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
4442
- passportDetectionScore: passportDetectionScore,
4443
- passportDetectionThresholdMet: passportDetectionThresholdMet,
4444
- focusScore: focusScore,
4445
- focusThresholdMet: focusThresholdMet,
4446
- isGoodFrame: isGoodFrame,
4447
- goodFramesCount: goodFramesCount,
4448
- goodFramesThreshold: goodFramesThreshold,
4449
- goodFramesThresholdMet: goodFramesThresholdMet,
4450
- lastFrameCapturedAt: frameCapturedAt,
4451
- frameCaptureRate: frameCaptureRate
4452
- });
4453
4456
  case 'captureStarted':
4454
4457
  return _assign(_assign({}, state), {
4455
4458
  captureStartedAt: new Date(),