@regulaforensics/vp-frontend-document-components 2.1.0 → 2.3.0
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/README.md +213 -36
- package/dist/main.js +1 -1
- package/esm/main.js +1 -1
- package/lib/common/Message.d.ts +2 -1
- package/lib/common/NoGlareIconLivenessDetection.d.ts +5 -0
- package/lib/common/NoSmilingIconLivenessDetection.d.ts +5 -0
- package/lib/common/PortraitOrientationOnlyIcon.d.ts +6 -0
- package/lib/common/RegulaLogoLivenessDetection.d.ts +5 -0
- package/lib/components/ButtonFaceLiveness.d.ts +7 -0
- package/lib/components/DocumentReaderLayout.d.ts +4 -6
- package/lib/components/FaceCapture.d.ts +15 -6
- package/lib/components/FaceFullScreenOverlay.d.ts +2 -3
- package/lib/components/FaceHintAnimaition.d.ts +16 -0
- package/lib/components/FaceLayout.d.ts +10 -5
- package/lib/components/InfoScreenFaceLiveness.d.ts +11 -0
- package/lib/components/InstructionVideoScreen.d.ts +9 -0
- package/lib/components/ProcessScreenFaceLiveness.d.ts +6 -0
- package/lib/components/RetryScreenFaceLiveness.d.ts +7 -0
- package/lib/components/SectorAnimationSvg.d.ts +11 -0
- package/lib/constants.d.ts +88 -11
- package/lib/contexts/DocumentAttributesContext.d.ts +5 -2
- package/lib/contexts/DocumentSDKContext.d.ts +3 -1
- package/lib/contexts/FaceAttributesContext.d.ts +6 -3
- package/lib/hoc/withLocalize.d.ts +5 -4
- package/lib/hooks/useDocumentReaderSeries.d.ts +2 -5
- package/lib/hooks/useFaceLiveness.d.ts +13 -3
- package/lib/hooks/useStateCallback.d.ts +1 -0
- package/lib/i18n/dictionaries/_dictionaries.d.ts +2212 -2052
- package/lib/index-document.d.ts +3 -4
- package/lib/media-resources/resourcesBase64.d.ts +7 -0
- package/lib/services/DebugService.d.ts +4 -0
- package/lib/services/DocumentReaderProcessor.d.ts +4 -3
- package/lib/services/DocumentReaderService.d.ts +2 -2
- package/lib/services/FaceLivenessService.d.ts +35 -16
- package/lib/services/FaceService.d.ts +31 -6
- package/lib/types.d.ts +132 -75
- package/lib/web-components/CameraSnapshot.d.ts +6 -3
- package/lib/web-components/DocumentReader.d.ts +6 -3
- package/lib/web-components/FaceDetection.d.ts +2 -3
- package/lib/web-components/FaceLiveness.d.ts +6 -4
- package/lib/web-components/FullScreenContainer.d.ts +1 -1
- package/package.json +6 -4
- package/lib/common/InstructionIconFaceDetection.d.ts +0 -5
- package/lib/common/InstructionIconFaceLiveness.d.ts +0 -5
- package/lib/common/NoGlareIcon.d.ts +0 -5
- package/lib/common/NoSmilingIcon.d.ts +0 -5
- package/lib/components/InstructionScreen.d.ts +0 -9
- package/lib/components/RetryScreen.d.ts +0 -7
package/lib/index-document.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import '@webcomponents/webcomponentsjs/webcomponents-bundle.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { DocumentReaderService, DocumentReaderProcessor, defineComponents };
|
|
2
|
+
export declare function defineComponents(): Promise<[CustomElementConstructor, CustomElementConstructor, CustomElementConstructor]>;
|
|
3
|
+
export { default as DocumentReaderService } from './services/DocumentReaderService';
|
|
4
|
+
export { default as DocumentReaderProcessor } from './services/DocumentReaderProcessor';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const videoInstructionBase64: string;
|
|
2
|
+
export declare const videoInstructionCaptureBase64: string;
|
|
3
|
+
export declare const spriteHint1: string;
|
|
4
|
+
export declare const spriteHint2: string;
|
|
5
|
+
export declare const spriteHint3: string;
|
|
6
|
+
export declare const spriteHint4: string;
|
|
7
|
+
export declare const spriteHint5: string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { logLevels } from '../constants';
|
|
2
2
|
declare class DebugService {
|
|
3
3
|
private readonly logLvl;
|
|
4
|
+
private prevTime;
|
|
5
|
+
private frameResults;
|
|
4
6
|
constructor(logLvl: logLevels);
|
|
5
7
|
private log;
|
|
8
|
+
private frameInfoLog;
|
|
9
|
+
private shutDownInfoLog;
|
|
6
10
|
private time;
|
|
7
11
|
debug(message: string, ...optionalParams: Array<any>): void;
|
|
8
12
|
info(message: string, ...optionalParams: Array<any>): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CurrentPage,
|
|
1
|
+
import { CurrentPage, ImageProcessingRequest, ProcessingRequest, StreamParams } from '../types';
|
|
2
2
|
import { Response } from '../models/DocReaderWebclient/ext';
|
|
3
3
|
declare type ServiceListener = ((data: Response) => void) | null;
|
|
4
4
|
declare type ResponseListener = (currentPage: CurrentPage) => void;
|
|
@@ -16,7 +16,7 @@ declare class DocumentReaderProcessor {
|
|
|
16
16
|
private _isProcessing;
|
|
17
17
|
private _pageIdx;
|
|
18
18
|
constructor(videoElement?: HTMLVideoElement);
|
|
19
|
-
get streamParam(): StreamParams
|
|
19
|
+
get streamParam(): Partial<StreamParams>;
|
|
20
20
|
set streamParam(params: Partial<StreamSettings>);
|
|
21
21
|
get recognizerProcessParam(): ProcessingRequest;
|
|
22
22
|
set recognizerProcessParam(params: ProcessingRequest);
|
|
@@ -30,10 +30,11 @@ declare class DocumentReaderProcessor {
|
|
|
30
30
|
get isInitialized(): boolean;
|
|
31
31
|
get isProcessing(): boolean;
|
|
32
32
|
private startStream;
|
|
33
|
+
private getImageData;
|
|
33
34
|
private detect;
|
|
34
35
|
private startNewPage;
|
|
35
36
|
private startNewDocument;
|
|
36
|
-
startRecognition(responseListener?: ResponseListener): Promise<Response>;
|
|
37
|
+
startRecognition(responseListener?: ResponseListener): Promise<Response | null>;
|
|
37
38
|
processImage(images: FileList | Array<Blob>): Promise<Response>;
|
|
38
39
|
stopRecognition(): void;
|
|
39
40
|
prepare(): Promise<void>;
|
|
@@ -21,9 +21,9 @@ declare class DocumentReaderService {
|
|
|
21
21
|
get imageProcessParam(): ImageProcessingRequest;
|
|
22
22
|
set imageProcessParam(params: ImageProcessingRequest);
|
|
23
23
|
get isInitialized(): boolean;
|
|
24
|
-
|
|
24
|
+
set isInitialized(value: boolean);
|
|
25
25
|
get isPrepared(): boolean;
|
|
26
|
-
|
|
26
|
+
set isPrepared(value: boolean);
|
|
27
27
|
get isProcessing(): boolean;
|
|
28
28
|
get prepareListener(): PrepareListener | null;
|
|
29
29
|
set prepareListener(listener: PrepareListener | null);
|
|
@@ -1,36 +1,55 @@
|
|
|
1
|
-
import { UserAgentType } from '../types';
|
|
2
1
|
import EventEmitter from './EventEmitter';
|
|
3
2
|
import CameraModel from '../models/CameraModel';
|
|
4
|
-
|
|
3
|
+
import { ConfigLivenessParams } from '../types';
|
|
4
|
+
declare type InitializedFaceLivenessData = {
|
|
5
|
+
config: ConfigLivenessParams;
|
|
6
|
+
publicKey: string;
|
|
7
|
+
schema: string;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
transactionId: string;
|
|
10
|
+
metadata: {
|
|
11
|
+
platform: string;
|
|
12
|
+
osVersion: string;
|
|
13
|
+
sdkVersion: string;
|
|
14
|
+
hostAppId: string;
|
|
15
|
+
deviceModel: string;
|
|
16
|
+
currentCameraId: string;
|
|
17
|
+
cameraState: CameraModel[];
|
|
18
|
+
ctx: {
|
|
19
|
+
userIp: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare type InitializedFaceCaptureData = {
|
|
24
|
+
config: {
|
|
25
|
+
scenario: number;
|
|
26
|
+
frameWidth: number;
|
|
27
|
+
frameHeight: number;
|
|
28
|
+
debugOutput: boolean | undefined;
|
|
29
|
+
numChannels: number;
|
|
30
|
+
};
|
|
5
31
|
metadata: {
|
|
6
32
|
hostAppId: string;
|
|
7
33
|
sdkVersion: string;
|
|
8
34
|
deviceModel: string;
|
|
9
35
|
camera: CameraModel;
|
|
10
36
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
37
|
+
};
|
|
38
|
+
declare type InitializeData = InitializedFaceLivenessData | InitializedFaceCaptureData;
|
|
39
|
+
declare type ParamsData = {
|
|
40
|
+
initializedData: InitializeData;
|
|
15
41
|
};
|
|
16
42
|
declare class FaceLivenessService {
|
|
17
43
|
initialized: boolean;
|
|
18
44
|
processing: boolean;
|
|
19
45
|
prepared: boolean;
|
|
20
46
|
worker: Worker | null;
|
|
21
|
-
params:
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
metadata?: MetadataType;
|
|
25
|
-
};
|
|
47
|
+
params: ParamsData | null;
|
|
26
48
|
eventEmitter: EventEmitter;
|
|
27
49
|
constructor();
|
|
28
50
|
prepare(listener: (data: any) => void): Promise<void>;
|
|
29
51
|
initialize(params: {
|
|
30
|
-
|
|
31
|
-
height: number;
|
|
32
|
-
metadata: MetadataType;
|
|
33
|
-
debug?: boolean;
|
|
52
|
+
initializedData: InitializeData;
|
|
34
53
|
}): void;
|
|
35
54
|
private postCustomMessage;
|
|
36
55
|
private emit;
|
|
@@ -38,6 +57,6 @@ declare class FaceLivenessService {
|
|
|
38
57
|
private printErr;
|
|
39
58
|
private onWorkerMessage;
|
|
40
59
|
shutdown(): void;
|
|
41
|
-
processImage(videoFrame: Uint8ClampedArray): void;
|
|
60
|
+
processImage(videoFrame: Uint8ClampedArray, abortSession?: boolean): void;
|
|
42
61
|
}
|
|
43
62
|
export default FaceLivenessService;
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import { FaceLivenessResultType } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ConfigLivenessParams, FaceLivenessResultType } from '../types';
|
|
2
|
+
import CameraModel from '../models/CameraModel';
|
|
3
|
+
declare type GetLivenessDetectionResultOptions = {
|
|
4
|
+
transactionId: string;
|
|
5
5
|
backendURL?: string;
|
|
6
6
|
headers?: Record<string, string>;
|
|
7
|
+
publicKey: string;
|
|
7
8
|
};
|
|
8
|
-
declare
|
|
9
|
+
declare type DeviceMetadata = {
|
|
10
|
+
platform: string;
|
|
11
|
+
osVersion: string;
|
|
12
|
+
sdkVersion: string;
|
|
13
|
+
hostAppId: string;
|
|
14
|
+
deviceModel: string;
|
|
15
|
+
currentCameraId: string;
|
|
16
|
+
cameraState: CameraModel[];
|
|
17
|
+
};
|
|
18
|
+
declare type InitializedFaceLivenessDataResult = {
|
|
19
|
+
config: ConfigLivenessParams;
|
|
20
|
+
metadata: {
|
|
21
|
+
ctx: {
|
|
22
|
+
userIp: string;
|
|
23
|
+
};
|
|
24
|
+
serverTime: string;
|
|
25
|
+
};
|
|
26
|
+
publicKey: string;
|
|
27
|
+
schema: string;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
transactionId: string;
|
|
30
|
+
};
|
|
31
|
+
declare function getLivenessDetectionResult(encryptedBody: Uint8Array, { transactionId, backendURL, headers, publicKey }: GetLivenessDetectionResultOptions): Promise<FaceLivenessResultType>;
|
|
32
|
+
declare function getInitialisingData(deviceMetadata: DeviceMetadata, sessionId?: string, backendUrl?: string): Promise<InitializedFaceLivenessDataResult>;
|
|
9
33
|
declare const _default: {
|
|
10
|
-
|
|
34
|
+
getInitialisingData: typeof getInitialisingData;
|
|
35
|
+
getLivenessDetectionResult: typeof getLivenessDetectionResult;
|
|
11
36
|
};
|
|
12
37
|
export default _default;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
import { Response } from './models/DocReaderWebclient/ext';
|
|
2
|
+
import dictionaries from './i18n/dictionaries/_dictionaries';
|
|
2
3
|
import { DocumentEventActions, FaceEventActions, InternalScenarios, ObjectFit, ResponseCode, StreamStatus, ErrorTypes, CameraFacingMode } from './constants';
|
|
3
4
|
import CameraModel from './models/CameraModel';
|
|
5
|
+
declare type DocumentTranslations = {
|
|
6
|
+
scanIDInBrowser?: string;
|
|
7
|
+
useYourDeviceCamera?: string;
|
|
8
|
+
success?: string;
|
|
9
|
+
processingFinished?: string;
|
|
10
|
+
largeFile?: string;
|
|
11
|
+
selectSmallerFile?: string;
|
|
12
|
+
versionNotSupported?: string;
|
|
13
|
+
updateBrowser?: string;
|
|
14
|
+
licenseError?: string;
|
|
15
|
+
licenseExpired?: string;
|
|
16
|
+
fileCorrupt?: string;
|
|
17
|
+
selectAnotherFile?: string;
|
|
18
|
+
timeout?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
somethingWentWrong?: string;
|
|
21
|
+
tryAgain?: string;
|
|
22
|
+
fromCamera?: string;
|
|
23
|
+
fromGallery?: string;
|
|
24
|
+
processing?: string;
|
|
25
|
+
preparingService?: string;
|
|
26
|
+
detectingDocument?: string;
|
|
27
|
+
placeDocumentIntoFrame?: string;
|
|
28
|
+
positionDocumentCenter?: string;
|
|
29
|
+
noFocus?: string;
|
|
30
|
+
moveCloser?: string;
|
|
31
|
+
glaresOnDocument?: string;
|
|
32
|
+
holdDocumentStraight?: string;
|
|
33
|
+
documentProcessing?: string;
|
|
34
|
+
flipDocument?: string;
|
|
35
|
+
cameraUnavailable?: string;
|
|
36
|
+
preparingCamera?: string;
|
|
37
|
+
noCameraAvailable?: string;
|
|
38
|
+
incorrectCameraId?: string;
|
|
39
|
+
allowAccessToCamera?: string;
|
|
40
|
+
cameraConnection?: string;
|
|
41
|
+
checkCameraId?: string;
|
|
42
|
+
verified?: string;
|
|
43
|
+
photoCapturedSuccessfully?: string;
|
|
44
|
+
uploadPhoto?: string;
|
|
45
|
+
useCameraOrGallery?: string;
|
|
46
|
+
};
|
|
47
|
+
export declare type Locales = keyof typeof dictionaries | string;
|
|
48
|
+
export declare type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
|
|
4
49
|
export declare type XY = {
|
|
5
50
|
x: number;
|
|
6
51
|
y: number;
|
|
@@ -29,7 +74,6 @@ export declare type FacingModeType = keyof typeof CameraFacingMode;
|
|
|
29
74
|
export declare type VideoStatusParamsType = {
|
|
30
75
|
videoStatus: StreamStatus;
|
|
31
76
|
camera: CameraTypes;
|
|
32
|
-
twoFacingModesAvailable: boolean;
|
|
33
77
|
};
|
|
34
78
|
export declare type CaptureFrameType = {
|
|
35
79
|
imageData: Array<ImageData>;
|
|
@@ -54,78 +98,60 @@ export declare type UserAgentType = {
|
|
|
54
98
|
vendor: string;
|
|
55
99
|
vendorSub: string;
|
|
56
100
|
};
|
|
57
|
-
declare type
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
export declare type ConfigLivenessParams = {
|
|
102
|
+
ballSmoothingWeight: number;
|
|
103
|
+
circleRadiusToMinDim: number;
|
|
104
|
+
compressDepthMap: boolean;
|
|
105
|
+
debugOutput: boolean | undefined;
|
|
106
|
+
depthMapBits: number;
|
|
107
|
+
distNormalMaxDeviation: number;
|
|
108
|
+
dontShowReadinessTimeoutMs: number;
|
|
109
|
+
faceBestHeight: number;
|
|
110
|
+
fitFaceMultNear: number;
|
|
111
|
+
frameHeight: number;
|
|
112
|
+
frameWidth: number;
|
|
113
|
+
holdStillNearTimeoutMs: number;
|
|
114
|
+
holdStillNormalTimeoutMs: number;
|
|
115
|
+
maxPitchNear: number;
|
|
116
|
+
maxPitchNormal: number;
|
|
117
|
+
maxRollNormal: number;
|
|
118
|
+
maxYawNear: number;
|
|
119
|
+
maxYawNormal: number;
|
|
120
|
+
minReadinessNear: number;
|
|
121
|
+
minReadinessNormal: number;
|
|
122
|
+
moveAwayMultNear: number;
|
|
123
|
+
moveCloserMultNear: number;
|
|
124
|
+
nearTimeoutMs: number;
|
|
125
|
+
normalTimeoutMs: number;
|
|
126
|
+
numChannels: number;
|
|
127
|
+
numSectors: number;
|
|
128
|
+
pin: number[];
|
|
129
|
+
resizedFrameHeight: number;
|
|
130
|
+
resizedFrameWidth: number;
|
|
131
|
+
scenario: number;
|
|
132
|
+
showGraySectors: boolean;
|
|
133
|
+
showHintDurationMs: number;
|
|
134
|
+
showHintTimeoutMs: number;
|
|
135
|
+
sizeNormalMaxDeviation: number;
|
|
136
|
+
targetSectorRelChange: number;
|
|
137
|
+
};
|
|
138
|
+
export declare type FaceLivenessResultType = {
|
|
78
139
|
code: number;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ageNear: string;
|
|
85
|
-
ageNormal: string;
|
|
86
|
-
distance: number;
|
|
87
|
-
evaluationTime: number;
|
|
88
|
-
eyesNear: FaceLivenessEyesType;
|
|
89
|
-
eyesNormal: FaceLivenessEyesType;
|
|
90
|
-
faceQuality: {
|
|
91
|
-
details: Array<{
|
|
92
|
-
attribute: string;
|
|
93
|
-
score: number;
|
|
94
|
-
}>;
|
|
95
|
-
score: number;
|
|
96
|
-
};
|
|
97
|
-
faceTrackBreak: number;
|
|
98
|
-
occlusionNear: FaceLivenessOcclusionType;
|
|
99
|
-
occlusionNormal: FaceLivenessOcclusionType;
|
|
100
|
-
predArtMaskNear: number;
|
|
101
|
-
predArtMaskNormal: number;
|
|
102
|
-
predElectronicDeviceNear: number;
|
|
103
|
-
predElectronicDeviceNormal: number;
|
|
104
|
-
predGeometryClassifier: number;
|
|
105
|
-
predLivenessViewNear: number;
|
|
106
|
-
predLivenessViewNormal: number;
|
|
107
|
-
predOpticalFlow: number;
|
|
108
|
-
predShadesNear: number;
|
|
109
|
-
predShadesNormal: number;
|
|
110
|
-
predTotal: number;
|
|
111
|
-
probArtMaskNear: number;
|
|
112
|
-
probArtMaskNormal: number;
|
|
113
|
-
probElectronicDeviceNear: number;
|
|
114
|
-
probElectronicDeviceNormal: number;
|
|
115
|
-
probGeometryClassifier: number;
|
|
116
|
-
probOpticalFlow: number;
|
|
117
|
-
probShadesNear: number;
|
|
118
|
-
probShadesNormal: number;
|
|
119
|
-
qualityNear: FaceLivenessQualityType;
|
|
120
|
-
qualityNormal: FaceLivenessQualityType;
|
|
121
|
-
smileNear: string;
|
|
122
|
-
smileNormal: string;
|
|
123
|
-
symNear: number;
|
|
124
|
-
symNormal: number;
|
|
140
|
+
config: ConfigLivenessParams;
|
|
141
|
+
elapsed: number;
|
|
142
|
+
metadata: {
|
|
143
|
+
ctx: {
|
|
144
|
+
userIp: string;
|
|
125
145
|
};
|
|
146
|
+
serverTime: string;
|
|
126
147
|
};
|
|
127
|
-
|
|
128
|
-
|
|
148
|
+
portrait: string;
|
|
149
|
+
sessionId: string;
|
|
150
|
+
status: number;
|
|
151
|
+
transactionId: string;
|
|
152
|
+
video: string;
|
|
153
|
+
};
|
|
154
|
+
export declare type FaceLivenessResponseType = FaceLivenessResultType & {
|
|
129
155
|
images: Array<string>;
|
|
130
156
|
};
|
|
131
157
|
export declare type FaceDetectionResponseType = {
|
|
@@ -133,7 +159,6 @@ export declare type FaceDetectionResponseType = {
|
|
|
133
159
|
};
|
|
134
160
|
export declare type DocumentReaderResponseType = Response;
|
|
135
161
|
export declare type CameraSnapshotResponseType = CaptureType;
|
|
136
|
-
export declare type FaceLivenessResultType = Omit<FaceLivenessResponseType, 'images'>;
|
|
137
162
|
export declare type FaceDebugOutput = {
|
|
138
163
|
cft: boolean;
|
|
139
164
|
face: {
|
|
@@ -241,6 +266,30 @@ export declare type DocumentReaderProcessParam = {
|
|
|
241
266
|
timeoutFromFirstDocType?: number;
|
|
242
267
|
resultTypeOutput?: Array<string>;
|
|
243
268
|
customParams?: Record<string, any>;
|
|
269
|
+
imageOutputMaxHeight?: number;
|
|
270
|
+
imageOutputMaxWidth?: number;
|
|
271
|
+
doublePageSpread?: boolean;
|
|
272
|
+
generateDoublePageSpreadImage?: boolean;
|
|
273
|
+
fieldTypesFilter?: Array<number>;
|
|
274
|
+
dateFormat?: string;
|
|
275
|
+
measureSystem?: number;
|
|
276
|
+
imageDpiOutMax?: number;
|
|
277
|
+
alreadyCropped?: boolean;
|
|
278
|
+
fastDocDetect?: boolean;
|
|
279
|
+
updateOCRValidityByGlare?: boolean;
|
|
280
|
+
returnCroppedBarcode?: boolean;
|
|
281
|
+
respectImageQuality?: boolean;
|
|
282
|
+
forceDocFormat?: number;
|
|
283
|
+
noGraphics?: boolean;
|
|
284
|
+
documentAreaMin?: number;
|
|
285
|
+
depersonalizeLog?: boolean;
|
|
286
|
+
multiDocOnImage?: boolean;
|
|
287
|
+
shiftExpiryDate?: number;
|
|
288
|
+
minimalHolderAge?: number;
|
|
289
|
+
mrzFormatsFilter?: Array<string>;
|
|
290
|
+
forceReadMrzBeforeLocate?: boolean;
|
|
291
|
+
parseBarcodes?: boolean;
|
|
292
|
+
splitNames?: boolean;
|
|
244
293
|
imageQa?: {
|
|
245
294
|
expectedPass?: Array<string>;
|
|
246
295
|
dpiThreshold?: number;
|
|
@@ -269,7 +318,6 @@ export interface StreamDataType {
|
|
|
269
318
|
status: StreamStatus;
|
|
270
319
|
stream: MediaStream | null;
|
|
271
320
|
camera: CameraTypes;
|
|
272
|
-
twoFacingModesAvailable: boolean;
|
|
273
321
|
}
|
|
274
322
|
export declare type StreamParams = {
|
|
275
323
|
cameraMode: FacingModeType;
|
|
@@ -282,7 +330,7 @@ export declare type CameraTypes = {
|
|
|
282
330
|
backCameras: Array<CameraModel>;
|
|
283
331
|
};
|
|
284
332
|
export declare type CurrentPage = {
|
|
285
|
-
data: Response;
|
|
333
|
+
data: Response | null;
|
|
286
334
|
startNextPage: () => Promise<void>;
|
|
287
335
|
finishRecognition: () => void;
|
|
288
336
|
};
|
|
@@ -295,10 +343,11 @@ declare global {
|
|
|
295
343
|
}
|
|
296
344
|
}
|
|
297
345
|
interface IBaseComponent {
|
|
298
|
-
locale?:
|
|
346
|
+
locale?: Locales;
|
|
299
347
|
copyright?: boolean;
|
|
300
348
|
'camera-id'?: string;
|
|
301
349
|
'change-camera'?: boolean;
|
|
350
|
+
'start-screen'?: boolean;
|
|
302
351
|
}
|
|
303
352
|
interface IDocumentBaseComponent extends IBaseComponent {
|
|
304
353
|
'start-screen'?: boolean;
|
|
@@ -318,9 +367,17 @@ export interface IFaceDetection extends IBaseComponent {
|
|
|
318
367
|
debug?: boolean;
|
|
319
368
|
}
|
|
320
369
|
export declare type ICameraSnapshot = IDocumentBaseComponent;
|
|
321
|
-
export
|
|
370
|
+
export declare type FacePositionLivenessDetection = {
|
|
371
|
+
width: number;
|
|
372
|
+
height: number;
|
|
373
|
+
x: number;
|
|
374
|
+
y: number;
|
|
375
|
+
};
|
|
376
|
+
export { default as DocumentReaderService } from './services/DocumentReaderService';
|
|
377
|
+
export { default as DocumentReaderProcessor } from './services/DocumentReaderProcessor';
|
|
322
378
|
export { default as DocumentReaderCaptureWebComponent } from './web-components/CameraSnapshot';
|
|
323
379
|
export { default as DocumentReaderWebComponent } from './web-components/DocumentReader';
|
|
324
380
|
export { default as FaceDetectionWebComponent } from './web-components/FaceDetection';
|
|
325
381
|
export { default as FaceLivenessWebComponent } from './web-components/FaceLiveness';
|
|
326
382
|
export { default as FullScreenContainer } from './web-components/FullScreenContainer';
|
|
383
|
+
export { defineComponents } from './index-document';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocumentDictionaries } from '../types';
|
|
2
2
|
export default class DocumentReaderCaptureWebComponent extends HTMLElement {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
private _root;
|
|
4
|
+
private _mounted;
|
|
5
|
+
private _translations;
|
|
5
6
|
constructor();
|
|
6
7
|
static get observedAttributes(): Array<string>;
|
|
7
8
|
attributeChangedCallback(name: string): void;
|
|
8
9
|
connectedCallback(): void;
|
|
10
|
+
set translations(dictionary: DocumentDictionaries | null);
|
|
11
|
+
get translations(): DocumentDictionaries | null;
|
|
9
12
|
render(): void;
|
|
10
13
|
disconnectedCallback(): void;
|
|
11
14
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocumentDictionaries } from '../types';
|
|
2
2
|
export default class DocumentReaderWebComponent extends HTMLElement {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
private _root;
|
|
4
|
+
private _mounted;
|
|
5
|
+
private _translations;
|
|
5
6
|
constructor();
|
|
6
7
|
static get observedAttributes(): Array<string>;
|
|
7
8
|
attributeChangedCallback(name: string): void;
|
|
8
9
|
connectedCallback(): void;
|
|
10
|
+
set translations(dictionary: DocumentDictionaries | null);
|
|
11
|
+
get translations(): DocumentDictionaries | null;
|
|
9
12
|
render(): void;
|
|
10
13
|
disconnectedCallback(): void;
|
|
11
14
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Root } from 'react-dom/client';
|
|
2
1
|
export default class FaceDetectionWebComponent extends HTMLElement {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
private _root;
|
|
3
|
+
private _mounted;
|
|
5
4
|
constructor();
|
|
6
5
|
static get observedAttributes(): Array<string>;
|
|
7
6
|
attributeChangedCallback(name: string): void;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { Root } from 'react-dom/client';
|
|
2
1
|
export default class FaceLivenessWebComponent extends HTMLElement {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
private _root;
|
|
3
|
+
private _mounted;
|
|
4
|
+
private _headers;
|
|
5
|
+
private _sessionIdValue;
|
|
6
6
|
constructor();
|
|
7
7
|
static get observedAttributes(): Array<string>;
|
|
8
8
|
attributeChangedCallback(name: string): void;
|
|
9
9
|
connectedCallback(): void;
|
|
10
10
|
set headers(headersData: Record<string, string>);
|
|
11
11
|
get headers(): Record<string, string>;
|
|
12
|
+
set sessionId(id: string);
|
|
13
|
+
get sessionId(): string;
|
|
12
14
|
render(): void;
|
|
13
15
|
disconnectedCallback(): void;
|
|
14
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/vp-frontend-document-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Regula framework agnostic web components to work with webcamera",
|
|
5
5
|
"types": "lib/types.d.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"homepage": "https://storybook-document.regulaforensics.com/",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"start": "webpack serve --config webpack.dev.js",
|
|
18
17
|
"build-face": "npm run clean-lib && npm run generate-face-types && webpack --config webpack.face-umd.js",
|
|
19
18
|
"build-document": "npm run clean-lib && npm run generate-document-types && webpack --config webpack.document-umd.js && webpack --config webpack.document-esm.js",
|
|
20
19
|
"storybook": "start-storybook -p 6006 -c .storybook-development -h localhost",
|
|
@@ -24,6 +23,8 @@
|
|
|
24
23
|
"build-storybook-document-rc": "build-storybook -c .storybook-rc/document",
|
|
25
24
|
"build-storybook-face-release": "build-storybook -c .storybook-release/face",
|
|
26
25
|
"build-storybook-document-release": "build-storybook -c .storybook-release/document",
|
|
26
|
+
"build-storybook-document-beta": "build-storybook -c .storybook-beta/document",
|
|
27
|
+
"build-storybook-face-beta": "build-storybook -c .storybook-beta/face",
|
|
27
28
|
"generate-dictionaries": "node scripts/xml-dictionary-parser/index.js Translator.xml src/i18n/dictionaries",
|
|
28
29
|
"clean-lib": "rm -rf ./lib",
|
|
29
30
|
"generate-face-types": "tsc --project ./configs/face.tsconfig.json",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@regulaforensics/facesdk-webclient": "^3.1.2",
|
|
39
|
-
"@webcomponents/webcomponentsjs": "
|
|
40
|
+
"@webcomponents/webcomponentsjs": "2.6.0",
|
|
40
41
|
"localize-react": "^1.7.1",
|
|
41
42
|
"react": "^18.2.0",
|
|
42
43
|
"react-device-detect": "^2.2.2",
|
|
@@ -56,6 +57,8 @@
|
|
|
56
57
|
"@regulaforensics/vp-frontend-face-components": "*",
|
|
57
58
|
"@regulaforensics/vp-frontend-face-components-nightly": "*",
|
|
58
59
|
"@regulaforensics/vp-frontend-face-components-rc": "*",
|
|
60
|
+
"@regulaforensics/vp-frontend-document-components-beta": "*",
|
|
61
|
+
"@regulaforensics/vp-frontend-face-components-beta": "*",
|
|
59
62
|
"@storybook/addon-actions": "^6.5.13",
|
|
60
63
|
"@storybook/addon-essentials": "^6.5.13",
|
|
61
64
|
"@storybook/addon-links": "^6.5.13",
|
|
@@ -77,7 +80,6 @@
|
|
|
77
80
|
"eslint-plugin-react": "^7.31.8",
|
|
78
81
|
"fast-xml-parser": "^4.0.10",
|
|
79
82
|
"he": "^1.2.0",
|
|
80
|
-
"html-webpack-plugin": "^5.5.0",
|
|
81
83
|
"husky": "^8.0.0",
|
|
82
84
|
"lint-staged": "^13.0.3",
|
|
83
85
|
"prettier": "^2.7.1",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type InstructionScreenProps = {
|
|
3
|
-
onStart: () => void;
|
|
4
|
-
icon: string;
|
|
5
|
-
title: string;
|
|
6
|
-
subtitle: string;
|
|
7
|
-
};
|
|
8
|
-
declare function InstructionScreen({ onStart, icon, title, subtitle }: InstructionScreenProps): JSX.Element;
|
|
9
|
-
export default InstructionScreen;
|