idmission-web-sdk 1.0.28 → 1.0.30
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/customer_flows/VideoIdValidation.d.ts +15 -1
- package/dist/components/video_id/IdVideoCapture.d.ts +23 -6
- package/dist/components/video_id/IdVideoCaptureFlipIdPrompt.d.ts +3 -1
- package/dist/components/video_id/IdVideoCaptureGuides.d.ts +15 -4
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +15 -2
- package/dist/contexts/SubmissionContext.d.ts +6 -2
- package/dist/lib/camera/Camera.d.ts +3 -2
- package/dist/lib/utils/useTimeout.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +412 -199
- 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 +413 -200
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +412 -199
- 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/stories/CustomerFlows/VideoIdValidation.stories.d.ts +24 -0
- package/dist/stories/IdCapture/LicenseFrontCapture.stories.d.ts +1 -2
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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>;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { IdVideoCaptureGuidesAssets, IdVideoCaptureGuidesVerbiage } from './IdVideoCaptureGuides';
|
|
2
3
|
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
4
|
+
import { LoaderButtonColors } from '../common/LoaderButton';
|
|
5
|
+
export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
|
|
6
|
+
export type IdVideoCaptureAssets = {
|
|
7
|
+
guides?: IdVideoCaptureGuidesAssets;
|
|
8
|
+
};
|
|
9
|
+
export type IdVideoCaptureColors = {
|
|
10
|
+
guidesSatisfiedColor?: string;
|
|
11
|
+
guidesUnsatisfiedColor?: string;
|
|
12
|
+
readTextDoneBtn?: LoaderButtonColors;
|
|
13
|
+
};
|
|
3
14
|
export type IdVideoCaptureVerbiage = {
|
|
4
|
-
|
|
5
|
-
|
|
15
|
+
guides?: IdVideoCaptureGuidesVerbiage;
|
|
16
|
+
readTextHeading?: CustomerSuppliedVerbiage;
|
|
17
|
+
readTextDoneBtnText?: CustomerSuppliedVerbiage;
|
|
6
18
|
};
|
|
7
19
|
export type IdVideoCaptureProps = {
|
|
8
20
|
onComplete?: (videoUrl: string) => void;
|
|
9
21
|
onFaceNotDetected?: () => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
idCardFrontDetectionThreshold?: number;
|
|
23
|
+
idCardFrontFocusThreshold?: number;
|
|
24
|
+
goodIdCardFrontFramesThreshold?: number;
|
|
25
|
+
showIdCardBackDurationMs?: 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,
|
|
33
|
+
export declare const IdVideoCapture: ({ onComplete, onFaceNotDetected, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, assets, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
@@ -8,8 +8,10 @@ export type IdVideoCaptureFlipIdPromptVerbiage = {
|
|
|
8
8
|
instructionText?: CustomerSuppliedVerbiage;
|
|
9
9
|
};
|
|
10
10
|
export type IdVideoCaptureFlipIdPromptProps = {
|
|
11
|
+
imageWidth?: number;
|
|
12
|
+
imageHeight?: number;
|
|
11
13
|
style?: CSSProperties;
|
|
12
14
|
assets?: IdVideoCaptureFlipIdPromptAssets;
|
|
13
15
|
verbiage?: IdVideoCaptureFlipIdPromptVerbiage;
|
|
14
16
|
};
|
|
15
|
-
export declare const IdVideoCaptureFlipIdPrompt: ({ style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
17
|
+
export declare const IdVideoCaptureFlipIdPrompt: ({ imageWidth, imageHeight, style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
3
|
+
export type Action = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'READ_TEXT';
|
|
4
|
+
export type IdVideoCaptureGuidesAssets = {
|
|
5
|
+
frontImageUrl?: string;
|
|
6
|
+
backImageUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
export type IdVideoCaptureGuidesVerbiage = {
|
|
9
|
+
idFrontInstructionText?: CustomerSuppliedVerbiage;
|
|
10
|
+
idBackInstructionText?: CustomerSuppliedVerbiage;
|
|
11
|
+
flipIdInstructionText?: CustomerSuppliedVerbiage;
|
|
12
|
+
};
|
|
2
13
|
export type IdVideoCaptureGuidesProps = {
|
|
3
|
-
instructionText?: string;
|
|
4
14
|
borderWidth?: number;
|
|
5
15
|
borderColor?: string;
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
requestedAction?: Action;
|
|
17
|
+
assets?: IdVideoCaptureGuidesAssets;
|
|
18
|
+
verbiage?: IdVideoCaptureGuidesVerbiage;
|
|
8
19
|
};
|
|
9
|
-
export declare const IdVideoCaptureGuides: ({
|
|
20
|
+
export declare const IdVideoCaptureGuides: ({ requestedAction, borderWidth, borderColor, assets, verbiage: rawVerbiage, }: IdVideoCaptureGuidesProps) => ReactElement;
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { IdCaptureWizardAssets, IdCaptureWizardColors, IdCaptureWizardProps, IdCaptureWizardVerbiage } from '../id_capture/IdCaptureWizard';
|
|
3
|
-
import { FaceLivenessAssets, 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;
|
|
6
10
|
faceLiveness?: FaceLivenessAssets;
|
|
11
|
+
idVideoCapture?: IdVideoCaptureAssets;
|
|
7
12
|
};
|
|
8
13
|
export type VideoIdWizardColors = {
|
|
9
14
|
idCapture?: IdCaptureWizardColors;
|
|
10
15
|
faceLiveness?: FaceLivenessColors;
|
|
16
|
+
idVideoCapture?: IdVideoCaptureColors;
|
|
17
|
+
success?: IdVideoCaptureSuccessColors;
|
|
11
18
|
};
|
|
12
19
|
export type VideoIdWizardVerbiage = {
|
|
13
20
|
idCapture?: IdCaptureWizardVerbiage;
|
|
14
21
|
faceLiveness?: FaceLivenessVerbiage;
|
|
22
|
+
idVideoCapture?: IdVideoCaptureVerbiage;
|
|
23
|
+
success?: IdVideoCaptureSuccessVerbiage;
|
|
15
24
|
};
|
|
16
25
|
export type VideoIdWizardProps = {
|
|
17
26
|
idCaptureProps?: IdCaptureWizardProps;
|
|
27
|
+
faceLivenessProps?: FaceLivenessWizardProps;
|
|
28
|
+
onExitAfterFailure?: (submissionResponse: SubmissionResponse | null) => void;
|
|
29
|
+
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
30
|
+
readTextTimeoutDurationMs?: number;
|
|
18
31
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
19
32
|
assets?: VideoIdWizardAssets;
|
|
20
33
|
colors?: VideoIdWizardColors;
|
|
21
34
|
verbiage?: VideoIdWizardVerbiage;
|
|
22
35
|
debugMode?: boolean;
|
|
23
36
|
};
|
|
24
|
-
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
};
|