idmission-web-sdk 1.0.27 → 1.0.29

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,6 +1,12 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { SubmissionEnvironment, SubmissionRequest, SubmissionResponse } from '../../contexts/SubmissionContext';
3
- import { LangOption } from '../../lib/locales';
3
+ import { CustomerSuppliedVerbiage, LangOption } from '../../lib/locales';
4
+ import { VideoIdWizardAssets, VideoIdWizardColors, VideoIdWizardVerbiage } from '../video_id/IdVideoCaptureWizard';
5
+ import { IdCaptureWizardProps } from '../id_capture/IdCaptureWizard';
6
+ import { FaceLivenessWizardProps } from '../face_liveness/FaceLivenessWizard';
7
+ export type VideoIdValidationAssets = VideoIdWizardAssets;
8
+ export type VideoIdValidationColors = VideoIdWizardColors;
9
+ export type VideoIdValidationVerbiage = VideoIdWizardVerbiage;
4
10
  export interface VideoIdValidationProps extends PropsWithChildren {
5
11
  lang?: LangOption;
6
12
  submissionToken: string;
@@ -8,9 +14,17 @@ export interface VideoIdValidationProps extends PropsWithChildren {
8
14
  submissionUrl?: string;
9
15
  onBeforeSubmit?: (request: SubmissionRequest) => Promise<SubmissionRequest>;
10
16
  onComplete?: (submissionResponse: SubmissionResponse) => void;
17
+ onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
18
+ idCaptureProps?: IdCaptureWizardProps;
19
+ faceLivenessProps?: FaceLivenessWizardProps;
20
+ readTextPrompt?: CustomerSuppliedVerbiage;
21
+ readTextTimeoutDurationMs?: number;
11
22
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
12
23
  geolocationEnabled?: boolean;
13
24
  geolocationRequired?: boolean;
25
+ assets?: VideoIdValidationAssets;
26
+ colors?: VideoIdValidationColors;
27
+ verbiage?: VideoIdValidationVerbiage;
14
28
  debugMode?: boolean;
15
29
  }
16
30
  export declare const VideoIdValidation: FC<VideoIdValidationProps>;
@@ -26,9 +26,10 @@ export type FaceLivenessWizardProps = {
26
26
  timeoutDurationMs?: number;
27
27
  maxRetries?: number;
28
28
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
29
+ releaseCameraAccessOnExit?: boolean;
29
30
  assets?: FaceLivenessAssets;
30
31
  colors?: FaceLivenessColors;
31
32
  verbiage?: FaceLivenessVerbiage;
32
33
  debugMode?: boolean;
33
34
  };
34
- export declare const FaceLivenessWizard: ({ onComplete, onSuccess, onTimeout, onExitAfterFailure, timeoutDurationMs, maxRetries, skipSuccessScreen, assets, colors, verbiage, debugMode, }: FaceLivenessWizardProps) => ReactElement;
35
+ export declare const FaceLivenessWizard: ({ onComplete, onSuccess, onTimeout, onExitAfterFailure, timeoutDurationMs, maxRetries, skipSuccessScreen, releaseCameraAccessOnExit, assets, colors, verbiage, debugMode, }: FaceLivenessWizardProps) => ReactElement;
@@ -44,9 +44,10 @@ export type IdCaptureWizardProps = {
44
44
  idCardFocusScoreThreshold?: number;
45
45
  passportFocusScoreThreshold?: number;
46
46
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
47
+ releaseCameraAccessOnExit?: boolean;
47
48
  assets?: IdCaptureWizardAssets;
48
49
  colors?: IdCaptureWizardColors;
49
50
  verbiage?: IdCaptureWizardVerbiage;
50
51
  debugMode?: boolean;
51
52
  };
52
- export declare const IdCaptureWizard: ({ onSuccess, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, assets, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
53
+ export declare const IdCaptureWizard: ({ onSuccess, autoCaptureEnabled, autoCaptureGoodFramesRequired, autoCaptureBarcodeRequired, barcodeScanningEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, releaseCameraAccessOnExit, assets, colors, verbiage, debugMode, }: IdCaptureWizardProps) => ReactElement;
@@ -1,8 +1,21 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { CustomerSuppliedVerbiage } from '../../lib/locales';
3
+ import { LoaderButtonColors } from '../common/LoaderButton';
4
+ export type Action = 'SHOW_ID_FRONT' | 'SHOW_ID_BACK' | 'READ_TEXT';
5
+ export type IdVideoCaptureAssets = {
6
+ idCardFrontGuidesImageUrl?: string;
7
+ idCardBackGuidesImageUrl?: string;
8
+ };
9
+ export type IdVideoCaptureColors = {
10
+ guidesSatisfiedColor?: string;
11
+ guidesUnsatisfiedColor?: string;
12
+ readTextDoneBtn?: LoaderButtonColors;
13
+ };
3
14
  export type IdVideoCaptureVerbiage = {
4
15
  idFrontInstructionText?: CustomerSuppliedVerbiage;
5
16
  idBackInstructionText?: CustomerSuppliedVerbiage;
17
+ readTextHeading?: CustomerSuppliedVerbiage;
18
+ readTextDoneBtnText?: CustomerSuppliedVerbiage;
6
19
  };
7
20
  export type IdVideoCaptureProps = {
8
21
  onComplete?: (videoUrl: string) => void;
@@ -10,7 +23,11 @@ export type IdVideoCaptureProps = {
10
23
  idDetectionThreshold?: number;
11
24
  idFocusThreshold?: number;
12
25
  goodFramesThreshold?: number;
26
+ readTextPrompt?: CustomerSuppliedVerbiage;
27
+ readTextTimeoutDurationMs?: number;
28
+ assets?: IdVideoCaptureAssets;
29
+ colors?: IdVideoCaptureColors;
13
30
  verbiage?: IdVideoCaptureVerbiage;
14
31
  debugMode?: boolean;
15
32
  };
16
- export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idDetectionThreshold, idFocusThreshold, goodFramesThreshold, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
33
+ export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idDetectionThreshold, idFocusThreshold, goodFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
@@ -1,23 +1,37 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { IdCaptureWizardAssets, IdCaptureWizardColors, IdCaptureWizardProps, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
3
- import { FaceLivenessColors, FaceLivenessVerbiage } from '../face_liveness/FaceLivenessWizard';
3
+ import { FaceLivenessAssets, FaceLivenessColors, FaceLivenessVerbiage, FaceLivenessWizardProps } from '../face_liveness/FaceLivenessWizard';
4
+ import { IdVideoCaptureAssets, IdVideoCaptureColors, IdVideoCaptureVerbiage } from './IdVideoCapture';
5
+ import { IdVideoCaptureSuccessColors, IdVideoCaptureSuccessVerbiage } from './IdVideoCaptureSuccess';
6
+ import { CustomerSuppliedVerbiage } from '../../lib/locales';
7
+ import { SubmissionResponse } from '../../contexts/SubmissionContext';
4
8
  export type VideoIdWizardAssets = {
5
9
  idCapture?: IdCaptureWizardAssets;
10
+ faceLiveness?: FaceLivenessAssets;
11
+ idVideoCapture?: IdVideoCaptureAssets;
6
12
  };
7
13
  export type VideoIdWizardColors = {
8
14
  idCapture?: IdCaptureWizardColors;
9
15
  faceLiveness?: FaceLivenessColors;
16
+ idVideoCapture?: IdVideoCaptureColors;
17
+ success?: IdVideoCaptureSuccessColors;
10
18
  };
11
19
  export type VideoIdWizardVerbiage = {
12
20
  idCapture?: IdCaptureWizardVerbiage;
13
21
  faceLiveness?: FaceLivenessVerbiage;
22
+ idVideoCapture?: IdVideoCaptureVerbiage;
23
+ success?: IdVideoCaptureSuccessVerbiage;
14
24
  };
15
25
  export type VideoIdWizardProps = {
16
26
  idCaptureProps?: IdCaptureWizardProps;
27
+ faceLivenessProps?: FaceLivenessWizardProps;
28
+ onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
29
+ readTextPrompt?: CustomerSuppliedVerbiage;
30
+ readTextTimeoutDurationMs?: number;
17
31
  skipSuccessScreen?: boolean | (() => Promise<boolean>);
18
32
  assets?: VideoIdWizardAssets;
19
33
  colors?: VideoIdWizardColors;
20
34
  verbiage?: VideoIdWizardVerbiage;
21
35
  debugMode?: boolean;
22
36
  };
23
- export declare const VideoIdWizard: ({ idCaptureProps, assets, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
37
+ export declare const VideoIdWizard: ({ idCaptureProps, faceLivenessProps, onExitAfterFailure, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
@@ -46,6 +46,7 @@ export type SubmissionRequest = {
46
46
  };
47
47
  biometricData?: {
48
48
  selfie?: string;
49
+ videoData?: string;
49
50
  };
50
51
  additionalData: {
51
52
  uniqueRequestId: string;
@@ -161,14 +162,16 @@ export type SubmissionState = {
161
162
  passportImage: string | null;
162
163
  selfieImage: string | null;
163
164
  signatureData: SignatureData | null;
164
- signatureVideo: string | null;
165
+ signatureVideoUrl: string | null;
166
+ idCaptureVideoUrl: string | null;
165
167
  additionalDocuments: UploadedDocument[] | null;
166
168
  setIdFrontImage: (image: string) => void;
167
169
  setIdBackImage: (image: string) => void;
168
170
  setPassportImage: (image: string) => void;
169
171
  setSelfieImage: (image: string) => void;
170
172
  setSignatureData: (signatureData: SignatureData) => void;
171
- setSignatureVideo: (videoB64: string) => void;
173
+ setSignatureVideoUrl: (videoDataUrl: string) => void;
174
+ setIdCaptureVideoUrl: (videoDataUrl: string) => void;
172
175
  setAdditionalDocuments: (uploadedDocuments: UploadedDocument[]) => void;
173
176
  logIdFrontCaptureAttempt: (attempt: CaptureAttemptMetadata) => void;
174
177
  logIdBackCaptureAttempt: (attempt: CaptureAttemptMetadata) => void;
@@ -187,3 +190,4 @@ export declare function attachMetadataToRequest(request: SubmissionRequest | Liv
187
190
  idBackCaptureAttempts: CaptureAttemptMetadata[];
188
191
  geolocationResult: GeolocationPosition | null;
189
192
  }): void;
193
+ export declare function videoDataUrlToB64(url: string): Promise<string>;
@@ -22,8 +22,9 @@ type Resolution = {
22
22
  };
23
23
  export declare const quickScan: Resolution[];
24
24
  export type FacingMode = 'user' | 'environment' | 'left' | 'right';
25
- export declare function listAvailableCameras(facingMode?: FacingMode): Promise<MediaDeviceInfo[]>;
26
- declare function releaseCameraAccess(): void;
25
+ export declare function listAvailableCameras(facingMode?: FacingMode, requestMicAccess?: boolean): Promise<MediaDeviceInfo[]>;
26
+ export declare function obtainCameraAccess(stream: MediaStream, deviceLabel: string, video?: HTMLVideoElement | null): Camera;
27
+ export declare function releaseCameraAccess(): void;
27
28
  export declare const useHighestResCaptureDevice: ({ preferFrontFacingCamera, preferContinuityCamera, requestMicrophoneAccess, }?: {
28
29
  preferFrontFacingCamera: boolean;
29
30
  preferContinuityCamera: boolean;
@@ -1,4 +1,4 @@
1
- export declare const useTimeout: (durationMs?: number, onTimeout?: () => void, timeoutAverted?: boolean, shouldWaitLonger?: boolean) => {
1
+ export declare const useTimeout: (durationMs?: number, onTimeout?: () => void, timeoutAverted?: boolean, shouldWaitLonger?: boolean, shouldStart?: boolean) => {
2
2
  timedOut: boolean;
3
3
  timeoutStartedAt: Date | null | undefined;
4
4
  };