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
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.6';
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
- var _d = action.payload.prediction,
4325
- detectedObjects = _d.detectedObjects,
4326
- detectionThresholdMet = _d.detectionThresholdMet,
4327
- detectedDocumentType = _d.detectedDocumentType,
4328
- idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
4329
- idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
4330
- idCardBackDetectionScore = _d.idCardBackDetectionScore,
4331
- idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
4332
- passportDetectionScore = _d.passportDetectionScore,
4333
- passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
4334
- bestDocument = _d.bestDocument,
4335
- documentInBounds = _d.documentInBounds,
4336
- documentTooClose = _d.documentTooClose,
4337
- documentIsStable = _d.documentIsStable,
4338
- focusScore = _d.focusScore,
4339
- focusThresholdMet = _d.focusThresholdMet,
4340
- frameWidth = _d.frameWidth,
4341
- frameHeight = _d.frameHeight;
4342
- var frameCapturedAt = new Date();
4343
- var frameCaptureRate = 0;
4344
- var goodFramesThreshold = state.goodFramesThreshold;
4345
- if (state.lastFrameCapturedAt) {
4346
- var frameTime = frameCapturedAt.getTime() - state.lastFrameCapturedAt.getTime();
4347
- if (frameTime > 0) {
4348
- frameCaptureRate = 1000.0 / frameTime;
4349
- if (frameCaptureRate > 0) {
4350
- goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
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
- var idCardDetectedButNotAllowed = detectedDocumentType.includes('idCard') && !state.captureRequirement.includes('idCard');
4355
- var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
4356
- var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
4357
- var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
4358
- var idCardBeingCaptured = idCardFrontWasCaptured && !idCardBackWasCaptured || !idCardFrontWasCaptured && idCardBackWasCaptured;
4359
- var passportDetectedButNotAllowed = detectedDocumentType === 'passport' && (passportNotAllowed || idCardBeingCaptured);
4360
- var flipRequired = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardFrontWasCaptured && detectedDocumentType === 'idCardFront' : state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront');
4361
- var backDetectedFirst = !state.overrideWrongDocumentTypeGuidance && (state.allowIdCardBackToFrontCapture ? idCardBackWasCaptured && detectedDocumentType === 'idCardBack' : state.requestedDocumentType === 'idCardFront' && detectedDocumentType === 'idCardBack');
4362
- var wrongDocumentTypePredictions = state.wrongDocumentTypePredictions;
4363
- if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
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
- if (state.captureRequirement === 'idCardOrPassport') {
4381
- if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
4382
- requestedDocumentType = 'passport';
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 (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
4385
- requestedDocumentType = idCardFrontWasCaptured ? 'idCardBack' : 'idCardFront';
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(),