@regulaforensics/vp-frontend-document-components 2.6.0 → 7.2.1567-nightly
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 +46 -9
- package/dist/main.js +1 -1
- package/esm/main.js +1 -1
- package/lib/index.d.ts +60 -12
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
MeasureSystem,
|
|
6
6
|
DocumentFormat,
|
|
7
7
|
MRZFormat,
|
|
8
|
+
ContainerList,
|
|
8
9
|
} from '@regulaforensics/document-reader-webclient';
|
|
9
10
|
|
|
10
11
|
interface Connection {
|
|
@@ -137,7 +138,7 @@ type FrameLineCap = 'butt' | 'round' | 'square';
|
|
|
137
138
|
|
|
138
139
|
type CameraMode = 'user' | 'environment';
|
|
139
140
|
|
|
140
|
-
type DocumentReaderResponseType = Response;
|
|
141
|
+
type DocumentReaderResponseType = Response & { TransactionInfo?: TransactionInfo };
|
|
141
142
|
type CameraSnapshotResponseType = Array<{ raw: string; mimeType: string }>;
|
|
142
143
|
|
|
143
144
|
declare enum ResponseCode {
|
|
@@ -149,9 +150,10 @@ declare enum ResponseCode {
|
|
|
149
150
|
|
|
150
151
|
interface CustomEventDataType<R> {
|
|
151
152
|
status: ResponseCode;
|
|
153
|
+
details?: unknown;
|
|
152
154
|
reason?: ErrorTypes;
|
|
153
155
|
response?: R;
|
|
154
|
-
video?:
|
|
156
|
+
video?: VideoData;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
interface DetailEvent<A, R> {
|
|
@@ -182,13 +184,6 @@ interface DocumentReaderImage {
|
|
|
182
184
|
pageIdx: number;
|
|
183
185
|
}
|
|
184
186
|
|
|
185
|
-
interface ProcessingRequest {
|
|
186
|
-
tag?: string;
|
|
187
|
-
processParam: DocumentReaderProcessParam;
|
|
188
|
-
imagesList?: Array<DocumentReaderImage>;
|
|
189
|
-
imageInputParam?: ImageInputParamType;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
187
|
interface WidthAndHeight {
|
|
193
188
|
width: number;
|
|
194
189
|
height: number;
|
|
@@ -202,11 +197,31 @@ interface StreamParams {
|
|
|
202
197
|
resolution: Resolution;
|
|
203
198
|
}
|
|
204
199
|
|
|
200
|
+
interface VideoData {
|
|
201
|
+
data: Blob;
|
|
202
|
+
width: number;
|
|
203
|
+
height: number;
|
|
204
|
+
mimeType: string;
|
|
205
|
+
duration: number;
|
|
206
|
+
bitrate: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
205
209
|
interface VideoRecordSettings {
|
|
206
210
|
delay?: number;
|
|
207
211
|
duration?: number;
|
|
208
212
|
}
|
|
209
213
|
|
|
214
|
+
interface TransactionInfo {
|
|
215
|
+
tag: string;
|
|
216
|
+
transactionId: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
interface PackageParams {
|
|
220
|
+
sizeBytes: number;
|
|
221
|
+
dataName: string;
|
|
222
|
+
metadata?: Record<string, any>;
|
|
223
|
+
}
|
|
224
|
+
|
|
210
225
|
interface DocumentReaderProcessParam {
|
|
211
226
|
returnPackageForReprocess?: boolean;
|
|
212
227
|
returnUncroppedImage?: boolean;
|
|
@@ -249,12 +264,39 @@ interface DocumentReaderProcessParam {
|
|
|
249
264
|
maxGlaringPart?: number;
|
|
250
265
|
};
|
|
251
266
|
};
|
|
267
|
+
backendProcessing?: {
|
|
268
|
+
serviceURL?: string;
|
|
269
|
+
httpHeaders?: Record<string, string>;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
interface NewTransaction {
|
|
274
|
+
ContainerList: ContainerList;
|
|
275
|
+
TransactionInfo: {
|
|
276
|
+
ComputerName: string;
|
|
277
|
+
DateTime: string;
|
|
278
|
+
SystemInfo: string;
|
|
279
|
+
Tag: string;
|
|
280
|
+
TransactionID: string;
|
|
281
|
+
};
|
|
282
|
+
sessionLogFolder: string;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface ProcessingRequest {
|
|
286
|
+
metadata?: Record<string, any>;
|
|
287
|
+
tag?: string;
|
|
288
|
+
processParam: DocumentReaderProcessParam;
|
|
289
|
+
imagesList?: Array<DocumentReaderImage>;
|
|
290
|
+
imageInputParam?: ImageInputParamType;
|
|
252
291
|
}
|
|
253
292
|
|
|
254
293
|
interface ImageProcessingRequest {
|
|
255
294
|
tag?: string;
|
|
256
295
|
imageInputParam?: ImageInputParamType;
|
|
257
|
-
processParam: Pick<
|
|
296
|
+
processParam: Pick<
|
|
297
|
+
DocumentReaderProcessParam,
|
|
298
|
+
'returnPackageForReprocess' | 'returnUncroppedImage' | 'scenario' | 'backendProcessing'
|
|
299
|
+
>;
|
|
258
300
|
}
|
|
259
301
|
|
|
260
302
|
interface CurrentPage {
|
|
@@ -284,7 +326,6 @@ interface DocumentTranslations {
|
|
|
284
326
|
fromGallery?: string;
|
|
285
327
|
processing?: string;
|
|
286
328
|
preparingService?: string;
|
|
287
|
-
detectingDocument?: string;
|
|
288
329
|
placeDocumentIntoFrame?: string;
|
|
289
330
|
positionDocumentCenter?: string;
|
|
290
331
|
noFocus?: string;
|
|
@@ -385,6 +426,7 @@ type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
|
|
|
385
426
|
type RecognizeListener = (data: Response) => void;
|
|
386
427
|
type ResponseListener = (currentPage: CurrentPage) => void;
|
|
387
428
|
type PrepareListener = ({ isPrepared }: { isPrepared: boolean }) => void;
|
|
429
|
+
type ProcessingListener = ({ isProcessing }: { isProcessing: boolean }) => void;
|
|
388
430
|
type InitializeListener = ({ isInitialized }: { isInitialized: boolean }) => void;
|
|
389
431
|
|
|
390
432
|
declare global {
|
|
@@ -422,6 +464,7 @@ export interface IDocumentReader extends ICameraSnapshot {
|
|
|
422
464
|
}
|
|
423
465
|
|
|
424
466
|
export type DocumentReaderDetailType = DetailEvent<DocumentEventActions, DocumentReaderResponseType>;
|
|
467
|
+
export type DocumentReaderDeviceDetailType = DetailEvent<DocumentEventActions, Response>;
|
|
425
468
|
export type CameraSnapshotDetailType = DetailEvent<DocumentEventActions, CameraSnapshotResponseType>;
|
|
426
469
|
|
|
427
470
|
export function defineComponents(): Promise<void>;
|
|
@@ -483,6 +526,8 @@ export class DocumentReaderService {
|
|
|
483
526
|
recognizeListener: RecognizeListener | null;
|
|
484
527
|
workerPath: string;
|
|
485
528
|
version: { component: string };
|
|
529
|
+
get processingListener(): ProcessingListener | null;
|
|
530
|
+
set processingListener(listener: ProcessingListener | null);
|
|
486
531
|
get prepareListener(): PrepareListener | null;
|
|
487
532
|
set prepareListener(listener: PrepareListener | null);
|
|
488
533
|
get initializeListener(): InitializeListener | null;
|
|
@@ -493,7 +538,10 @@ export class DocumentReaderService {
|
|
|
493
538
|
process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
|
|
494
539
|
processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
|
|
495
540
|
startNewPage(): Promise<void>;
|
|
496
|
-
startNewDocument(): Promise<
|
|
541
|
+
startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
542
|
+
createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
|
|
543
|
+
finalizePackage(): Promise<TransactionInfo>;
|
|
544
|
+
addDataToPackage(data: Uint8ClampedArray, params: PackageParams): Promise<void>;
|
|
497
545
|
shutdown(): void;
|
|
498
546
|
}
|
|
499
547
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regulaforensics/vp-frontend-document-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "7.2.1567-nightly",
|
|
4
4
|
"description": "Regula framework agnostic web components to work with webcamera",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"test": "jest --testPathPattern=src/tests"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@regulaforensics/document-reader-webclient": "^7.1.
|
|
21
|
+
"@regulaforensics/document-reader-webclient": "^7.1.3-beta.1"
|
|
22
22
|
}
|
|
23
23
|
}
|