idmission-web-sdk 1.0.122 → 1.0.124

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.
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  import { CardData, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
3
3
  import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
4
4
  import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
@@ -95,6 +95,7 @@ export interface CustomerEnrollmentProps extends PropsWithChildren {
95
95
  faceLivenessTimeoutDurationMs?: number;
96
96
  /** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
97
97
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
98
+ idCaptureInstructions?: ReactNode;
98
99
  /** Callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned. */
99
100
  onBeforeSubmit?: (req: SubmissionRequest) => Promise<SubmissionRequest>;
100
101
  /** Callback function that fires when the user has completed the flow instead of making a call to IDmission's servers, allowing customers to specify their own submission logic. Arguments: the request payload that would have been dispatched to IDmission's API, which contains the images/documents/video submitted by the user. Note that when this parameter is supplied, `onComplete` will never fire, and the customer will need to implement their own error handling/retry logic. Use at your own risk! */
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  import { CardData, LivenessCheckRequest, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
3
3
  import { FaceLivenessAssets, FaceLivenessClassNames, FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
4
4
  import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
@@ -92,6 +92,8 @@ export interface IdAndFaceValidationProps extends PropsWithChildren {
92
92
  faceLivenessTimeoutDurationMs?: number;
93
93
  /** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
94
94
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
95
+ /** React element or string to render on the instructions screen. */
96
+ idCaptureInstructions?: ReactNode;
95
97
  /** Callback function that fires immediately prior to liveness check, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The liveness check request is passed in as a parameter and a promise resolving to the updated request should be returned. */
96
98
  onBeforeLivenessCheck?: (req: LivenessCheckRequest) => Promise<LivenessCheckRequest>;
97
99
  /** Callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned. */
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { FC, PropsWithChildren, ReactNode } from 'react';
2
2
  import { CardData, PersonalData, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
3
3
  import { IdCaptureWizardAssets, IdCaptureWizardClassNames, IdCaptureWizardColors, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
4
4
  import { AdditionalDocumentCaptureWizardClassNames, AdditionalDocumentCaptureWizardVerbiage } from '../additional_document_capture/AdditionalDocumentCaptureWizard';
@@ -74,6 +74,8 @@ export interface IdValidationProps extends PropsWithChildren {
74
74
  passportFocusScoreThreshold?: number;
75
75
  /** Boolean or async function to indicate whether to proceed automatically after capture guidance is satisfied. If an async function is supplied returning a boolean, it will be evaluated at the time of capture guidance satisfaction. Defaults to `false`. */
76
76
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
77
+ /** React element or string to render on the instructions screen. */
78
+ instructions?: ReactNode;
77
79
  /** Object to allow documents that have been previously captured to be submitted. Valid keys: `idCardFront`, `idCardBack , `passport`.*/
78
80
  precapturedDocuments?: CapturedDocuments;
79
81
  /** Callback function that fires immediately prior to submission, giving the client application an opportunity to specify custom asynchronous logic that mutates the request before it executes. The submission request is passed in as a parameter and a promise resolving to the updated request should be returned. */
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { CameraAccessDeniedOverlayAssets, CameraAccessDeniedOverlayClassNames, CameraAccessDeniedOverlayColors, CameraAccessDeniedOverlayVerbiage } from '../camera/CameraAccessDeniedOverlay';
3
3
  import { LoaderButtonColors } from '../common/LoaderButton';
4
4
  import { CustomerSuppliedVerbiage } from '../../lib/locales';
@@ -34,9 +34,10 @@ export type IdCaptureLoadingOverlayVerbiage = {
34
34
  export type IdCaptureLoadingOverlayProps = {
35
35
  onDismissed?: () => void;
36
36
  onUserCancel?: () => void;
37
+ instructions?: ReactNode;
37
38
  assets?: IdCaptureLoadingOverlayAssets;
38
39
  classNames?: IdCaptureLoadingOverlayClassNames;
39
40
  colors?: IdCaptureLoadingOverlayColors;
40
41
  verbiage?: IdCaptureLoadingOverlayVerbiage;
41
42
  };
42
- export declare const IdCaptureLoadingOverlay: ({ onDismissed, onUserCancel, assets, classNames, colors, verbiage: rawVerbiage, }: IdCaptureLoadingOverlayProps) => ReactElement;
43
+ export declare const IdCaptureLoadingOverlay: ({ onDismissed, onUserCancel, instructions, assets, classNames, colors, verbiage: rawVerbiage, }: IdCaptureLoadingOverlayProps) => ReactElement;
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { IdCaptureAssets, IdCaptureClassNames, IdCaptureColors, IdCaptureVerbiage } from './IdCapture';
3
3
  import { IdCaptureLoadingOverlayAssets, IdCaptureLoadingOverlayClassNames, IdCaptureLoadingOverlayColors, IdCaptureLoadingOverlayVerbiage } from './IdCaptureLoadingOverlay';
4
4
  import { FlipIdPromptAssets, FlipIdPromptClassNames, FlipIdPromptVerbiage } from './FlipIdPrompt';
@@ -59,6 +59,7 @@ export type IdCaptureWizardProps = {
59
59
  idCardFocusScoreThreshold?: number;
60
60
  passportFocusScoreThreshold?: number;
61
61
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
62
+ instructions?: ReactNode;
62
63
  releaseCameraAccessOnExit?: boolean;
63
64
  assets?: IdCaptureWizardAssets;
64
65
  classNames?: IdCaptureWizardClassNames;
@@ -66,4 +67,4 @@ export type IdCaptureWizardProps = {
66
67
  verbiage?: IdCaptureWizardVerbiage;
67
68
  debugMode?: boolean;
68
69
  };
69
- export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, releaseCameraAccessOnExit, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
70
+ export declare const IdCaptureWizard: ({ onSuccess, onExitCapture, onUserCancel, precapturedDocuments, captureRequirement, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, releaseCameraAccessOnExit, assets, classNames, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
@@ -47,7 +47,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
47
47
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
48
48
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
49
49
 
50
- var webSdkVersion = '1.0.122';
50
+ var webSdkVersion = '1.0.124';
51
51
 
52
52
  function getPlatform() {
53
53
  if (typeof window === 'undefined') return;
@@ -10241,6 +10241,7 @@ var ContinuityCameraCheckbox = styled__default['default'].input(templateObject_2
10241
10241
  var IdCaptureLoadingOverlay = function IdCaptureLoadingOverlay(_a) {
10242
10242
  var onDismissed = _a.onDismissed,
10243
10243
  onUserCancel = _a.onUserCancel,
10244
+ instructions = _a.instructions,
10244
10245
  _b = _a.assets,
10245
10246
  assets = _b === void 0 ? {} : _b,
10246
10247
  _c = _a.classNames,
@@ -10304,7 +10305,7 @@ var IdCaptureLoadingOverlay = function IdCaptureLoadingOverlay(_a) {
10304
10305
  alt: verbiage.headingText,
10305
10306
  src: assets.instructionImageUrl,
10306
10307
  className: classNames.image
10307
- })), /*#__PURE__*/React__default['default'].createElement(ContinuityCameraCheckboxContainer, {
10308
+ })), instructions, /*#__PURE__*/React__default['default'].createElement(ContinuityCameraCheckboxContainer, {
10308
10309
  className: classNames.continuityCameraCheckboxContainer
10309
10310
  }, iphoneContinuityCameraAvailable && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ContinuityCameraCheckbox, {
10310
10311
  className: classNames.continuityCameraCheckbox,
@@ -10571,11 +10572,20 @@ var CapturedImage = function CapturedImage(_a) {
10571
10572
  url = _b[0],
10572
10573
  setUrl = _b[1];
10573
10574
  React.useEffect(function () {
10574
- if (!image.boundingBox) return;
10575
+ if (!image.boundingBox) {
10576
+ console.error('no bounding box received!');
10577
+ return;
10578
+ }
10575
10579
  var im = new Image();
10576
10580
  im.onload = function () {
10581
+ console.log('image has been loaded');
10577
10582
  cropToBoundingBox(im, image.boundingBox, canvasRef.current);
10578
- setUrl(canvasRef.current.toDataURL());
10583
+ var croppedDataUrl = canvasRef.current.toDataURL();
10584
+ console.log('croppedDataUrl', croppedDataUrl);
10585
+ setUrl(croppedDataUrl);
10586
+ };
10587
+ im.onerror = function (e) {
10588
+ console.error('failed to load image', e);
10579
10589
  };
10580
10590
  im.src = image.imageData;
10581
10591
  }, [image.boundingBox, image.height, image.imageData, image.width]);
@@ -10915,6 +10925,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
10915
10925
  passportFocusScoreThreshold = _x === void 0 ? 0.3 : _x,
10916
10926
  _y = _a.skipSuccessScreen,
10917
10927
  skipSuccessScreen = _y === void 0 ? false : _y,
10928
+ instructions = _a.instructions,
10918
10929
  _z = _a.releaseCameraAccessOnExit,
10919
10930
  releaseCameraAccessOnExit = _z === void 0 ? true : _z,
10920
10931
  _0 = _a.assets,
@@ -11152,6 +11163,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
11152
11163
  }
11153
11164
  }(), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
11154
11165
  key: attempt,
11166
+ instructions: instructions,
11155
11167
  assets: assets.loadingOverlay,
11156
11168
  classNames: classNames.loadingOverlay,
11157
11169
  colors: colors.loadingOverlay,
@@ -14440,6 +14452,7 @@ var IdValidation = function IdValidation(_a) {
14440
14452
  passportFocusScoreThreshold = _h === void 0 ? 0.3 : _h,
14441
14453
  _j = _a.skipSuccessScreen,
14442
14454
  skipSuccessScreen = _j === void 0 ? false : _j,
14455
+ instructions = _a.instructions,
14443
14456
  onBeforeSubmit = _a.onBeforeSubmit,
14444
14457
  onSubmit = _a.onSubmit,
14445
14458
  onComplete = _a.onComplete,
@@ -14484,13 +14497,14 @@ var IdValidation = function IdValidation(_a) {
14484
14497
  passportFocusScoreThreshold: passportFocusScoreThreshold,
14485
14498
  barcodeScanningEnabled: false,
14486
14499
  skipSuccessScreen: skipSuccessScreen,
14500
+ instructions: instructions,
14487
14501
  assets: assets,
14488
14502
  classNames: classNames,
14489
14503
  colors: colors,
14490
14504
  verbiage: verbiage,
14491
14505
  debugMode: debugMode
14492
14506
  };
14493
- }, [onExitCapture, onUserCancel, precapturedDocuments, idCaptureRequirement, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, assets, classNames, colors, verbiage, debugMode]);
14507
+ }, [onExitCapture, onUserCancel, precapturedDocuments, idCaptureRequirement, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, instructions, assets, classNames, colors, verbiage, debugMode]);
14494
14508
  var additionalDocumentCaptureProps = React.useMemo(function () {
14495
14509
  return {
14496
14510
  documents: captureAdditionalDocuments,
@@ -14684,6 +14698,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
14684
14698
  faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
14685
14699
  _l = _a.skipSuccessScreen,
14686
14700
  skipSuccessScreen = _l === void 0 ? false : _l,
14701
+ idCaptureInstructions = _a.idCaptureInstructions,
14687
14702
  onBeforeLivenessCheck = _a.onBeforeLivenessCheck,
14688
14703
  onBeforeSubmit = _a.onBeforeSubmit,
14689
14704
  onSubmit = _a.onSubmit,
@@ -14732,10 +14747,11 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
14732
14747
  mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
14733
14748
  idCardFocusScoreThreshold: idCardFocusScoreThreshold,
14734
14749
  passportFocusScoreThreshold: passportFocusScoreThreshold,
14750
+ instructions: idCaptureInstructions,
14735
14751
  skipSuccessScreen: skipSuccessScreen,
14736
14752
  debugMode: debugMode
14737
14753
  };
14738
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureRequirement, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, precapturedDocuments, skipSuccessScreen, verbiage.idCapture]);
14754
+ }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureInstructions, idCaptureRequirement, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, precapturedDocuments, skipSuccessScreen, verbiage.idCapture]);
14739
14755
  var faceLivenessProps = React.useMemo(function () {
14740
14756
  return {
14741
14757
  timeoutDurationMs: faceLivenessTimeoutDurationMs,
@@ -14872,6 +14888,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
14872
14888
  faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
14873
14889
  _l = _a.skipSuccessScreen,
14874
14890
  skipSuccessScreen = _l === void 0 ? false : _l,
14891
+ idCaptureInstructions = _a.idCaptureInstructions,
14875
14892
  onBeforeSubmit = _a.onBeforeSubmit,
14876
14893
  onSubmit = _a.onSubmit,
14877
14894
  onComplete = _a.onComplete,
@@ -14916,12 +14933,13 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
14916
14933
  mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
14917
14934
  idCardFocusScoreThreshold: idCardFocusScoreThreshold,
14918
14935
  passportFocusScoreThreshold: passportFocusScoreThreshold,
14936
+ instructions: idCaptureInstructions,
14919
14937
  onExitCapture: onExitCapture,
14920
14938
  onUserCancel: onUserCancel,
14921
14939
  skipSuccessScreen: skipSuccessScreen,
14922
14940
  debugMode: debugMode
14923
14941
  };
14924
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureRequirement, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, verbiage.idCapture]);
14942
+ }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureInstructions, idCaptureRequirement, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, verbiage.idCapture]);
14925
14943
  var faceLivenessProps = React.useMemo(function () {
14926
14944
  return {
14927
14945
  onExitCapture: onExitCapture,