@regulaforensics/vp-frontend-document-components 2.6.1 → 7.2.1606

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,14 +1,3 @@
1
- /*!
2
- * ASP.NET SignalR JavaScript Library v2.2.2
3
- * http://signalr.net/
4
- *
5
- * Copyright (c) .NET Foundation. All rights reserved.
6
- * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
7
- *
8
- */
9
-
10
- /*! jQuery v2.2.0 | (c) jQuery Foundation | jquery.org/license */
11
-
12
1
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
13
2
 
14
3
  /**
package/lib/index.d.ts CHANGED
@@ -5,41 +5,9 @@ import {
5
5
  MeasureSystem,
6
6
  DocumentFormat,
7
7
  MRZFormat,
8
+ ContainerList,
8
9
  } from '@regulaforensics/document-reader-webclient';
9
10
 
10
- interface Connection {
11
- id: string;
12
- proxies: { [hubName: string]: any };
13
- transport: {
14
- name: string;
15
- supportsKeepAlive: SupportsKeepAliveHandler;
16
- };
17
- createHubProxy(hubName: string): Proxy;
18
- start(options?: any, callback?: () => void): any;
19
- stop(async?: boolean, notifyServer?: boolean): void;
20
- reconnecting(callback: () => void): void;
21
- disconnected(callback: () => void): void;
22
- }
23
-
24
- interface Proxy {
25
- state: any;
26
- connection: Connection;
27
- hubName: string;
28
- init(connection: Connection, hubName: string): void;
29
- hasSubscriptions(): boolean;
30
- on(eventName: string, callback?: (...msg: any[]) => void): Proxy;
31
- off(eventName: string, callback?: (...msg: any[]) => void): Proxy;
32
- invoke(methodName: string, ...args: any[]): Promise<any>;
33
- }
34
-
35
- interface Options {
36
- qs?: string | undefined;
37
- logging?: boolean | undefined;
38
- useDefaultPath?: boolean | undefined;
39
- }
40
-
41
- type SupportsKeepAliveHandler = () => boolean;
42
-
43
11
  interface DeviceInfo {
44
12
  reader_ready: boolean;
45
13
  rfid_ready: boolean;
@@ -137,7 +105,7 @@ type FrameLineCap = 'butt' | 'round' | 'square';
137
105
 
138
106
  type CameraMode = 'user' | 'environment';
139
107
 
140
- type DocumentReaderResponseType = Response;
108
+ type DocumentReaderResponseType = Response & { TransactionInfo?: TransactionInfo };
141
109
  type CameraSnapshotResponseType = Array<{ raw: string; mimeType: string }>;
142
110
 
143
111
  declare enum ResponseCode {
@@ -149,9 +117,10 @@ declare enum ResponseCode {
149
117
 
150
118
  interface CustomEventDataType<R> {
151
119
  status: ResponseCode;
120
+ details?: unknown;
152
121
  reason?: ErrorTypes;
153
122
  response?: R;
154
- video?: Blob;
123
+ video?: VideoData;
155
124
  }
156
125
 
157
126
  interface DetailEvent<A, R> {
@@ -182,13 +151,6 @@ interface DocumentReaderImage {
182
151
  pageIdx: number;
183
152
  }
184
153
 
185
- interface ProcessingRequest {
186
- tag?: string;
187
- processParam: DocumentReaderProcessParam;
188
- imagesList?: Array<DocumentReaderImage>;
189
- imageInputParam?: ImageInputParamType;
190
- }
191
-
192
154
  interface WidthAndHeight {
193
155
  width: number;
194
156
  height: number;
@@ -202,11 +164,27 @@ interface StreamParams {
202
164
  resolution: Resolution;
203
165
  }
204
166
 
167
+ interface VideoData {
168
+ data: Blob;
169
+ mimeType: string;
170
+ }
171
+
205
172
  interface VideoRecordSettings {
206
173
  delay?: number;
207
174
  duration?: number;
208
175
  }
209
176
 
177
+ interface TransactionInfo {
178
+ tag: string;
179
+ transactionId: string;
180
+ }
181
+
182
+ interface PackageParams {
183
+ sizeBytes: number;
184
+ dataName: string;
185
+ metadata?: Record<string, any>;
186
+ }
187
+
210
188
  interface DocumentReaderProcessParam {
211
189
  returnPackageForReprocess?: boolean;
212
190
  returnUncroppedImage?: boolean;
@@ -249,12 +227,39 @@ interface DocumentReaderProcessParam {
249
227
  maxGlaringPart?: number;
250
228
  };
251
229
  };
230
+ backendProcessing?: {
231
+ serviceURL?: string;
232
+ httpHeaders?: Record<string, string>;
233
+ };
234
+ }
235
+
236
+ interface NewTransaction {
237
+ ContainerList: ContainerList;
238
+ TransactionInfo: {
239
+ ComputerName: string;
240
+ DateTime: string;
241
+ SystemInfo: string;
242
+ Tag: string;
243
+ TransactionID: string;
244
+ };
245
+ sessionLogFolder: string;
246
+ }
247
+
248
+ interface ProcessingRequest {
249
+ metadata?: Record<string, any>;
250
+ tag?: string;
251
+ processParam: DocumentReaderProcessParam;
252
+ imagesList?: Array<DocumentReaderImage>;
253
+ imageInputParam?: ImageInputParamType;
252
254
  }
253
255
 
254
256
  interface ImageProcessingRequest {
255
257
  tag?: string;
256
258
  imageInputParam?: ImageInputParamType;
257
- processParam: Pick<DocumentReaderProcessParam, 'returnPackageForReprocess' | 'returnUncroppedImage' | 'scenario'>;
259
+ processParam: Pick<
260
+ DocumentReaderProcessParam,
261
+ 'returnPackageForReprocess' | 'returnUncroppedImage' | 'scenario' | 'backendProcessing'
262
+ >;
258
263
  }
259
264
 
260
265
  interface CurrentPage {
@@ -284,7 +289,6 @@ interface DocumentTranslations {
284
289
  fromGallery?: string;
285
290
  processing?: string;
286
291
  preparingService?: string;
287
- detectingDocument?: string;
288
292
  placeDocumentIntoFrame?: string;
289
293
  positionDocumentCenter?: string;
290
294
  noFocus?: string;
@@ -327,14 +331,6 @@ interface CameraSnapshotSettings {
327
331
  statusBackgroundColor?: string;
328
332
  }
329
333
 
330
- interface DocumentReaderDeviceSettings {
331
- locale?: Locales | string;
332
- nonce?: string;
333
- serviceUrl?: string;
334
- regulaLogo?: boolean;
335
- properties?: Record<string, any>;
336
- }
337
-
338
334
  interface DocumentReaderSettings extends CameraSnapshotSettings {
339
335
  internalScenario?: InternalScenarios | string;
340
336
  multipageProcessing?: boolean;
@@ -385,12 +381,12 @@ type DocumentDictionaries = Partial<Record<Locales, DocumentTranslations>>;
385
381
  type RecognizeListener = (data: Response) => void;
386
382
  type ResponseListener = (currentPage: CurrentPage) => void;
387
383
  type PrepareListener = ({ isPrepared }: { isPrepared: boolean }) => void;
384
+ type ProcessingListener = ({ isProcessing }: { isProcessing: boolean }) => void;
388
385
  type InitializeListener = ({ isInitialized }: { isInitialized: boolean }) => void;
389
386
 
390
387
  declare global {
391
388
  interface HTMLElementEventMap {
392
389
  'document-reader': CustomEvent<DocumentReaderDetailType>;
393
- 'document-reader-device': CustomEvent<DocumentReaderDetailType>;
394
390
  'camera-snapshot': CustomEvent<CameraSnapshotDetailType>;
395
391
  }
396
392
  }
@@ -442,13 +438,6 @@ export class DocumentReaderCaptureWebComponent extends HTMLElement {
442
438
  get settings(): CameraSnapshotSettings;
443
439
  }
444
440
 
445
- export class DocumentReaderDeviceWebComponent extends HTMLElement {
446
- set translations(dictionary: DocumentDictionaries | null);
447
- get translations(): DocumentDictionaries | null;
448
- set settings(params: DocumentReaderDeviceSettings);
449
- get settings(): DocumentReaderDeviceSettings;
450
- }
451
-
452
441
  export class DocumentReaderProcessor {
453
442
  isProcessing: boolean;
454
443
  isInitialized: boolean;
@@ -483,6 +472,8 @@ export class DocumentReaderService {
483
472
  recognizeListener: RecognizeListener | null;
484
473
  workerPath: string;
485
474
  version: { component: string };
475
+ get processingListener(): ProcessingListener | null;
476
+ set processingListener(listener: ProcessingListener | null);
486
477
  get prepareListener(): PrepareListener | null;
487
478
  set prepareListener(listener: PrepareListener | null);
488
479
  get initializeListener(): InitializeListener | null;
@@ -493,22 +484,9 @@ export class DocumentReaderService {
493
484
  process(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
494
485
  processImage(imageDataArray: Array<ImageData>, params?: ProcessingRequest): Promise<Response>;
495
486
  startNewPage(): Promise<void>;
496
- startNewDocument(): Promise<void>;
487
+ startNewDocument(metadata?: Record<string, any>): Promise<NewTransaction>;
488
+ createBackendTransaction(metadata?: Record<string, any>): Promise<NewTransaction>;
489
+ finalizePackage(): Promise<TransactionInfo>;
490
+ addDataToPackage(data: Uint8ClampedArray, params: PackageParams): Promise<void>;
497
491
  shutdown(): void;
498
492
  }
499
-
500
- export class DocumentReaderController {
501
- hubProxy: null | Proxy;
502
- isInitialized: boolean;
503
- get serviceUrl(): string;
504
- set serviceUrl(url: string);
505
- initRegulaReader(): Promise<void>;
506
- getLastResults(): Promise<Response>;
507
- getImages(): Promise<void>;
508
- setProperty(name: string, value: any): Promise<void>;
509
- getProperty(name: string): Promise<any>;
510
- getAvailableDevices(index: number): Promise<string>;
511
- clearResults(): Promise<void>;
512
- healthCheck(): Promise<DeviceInfo>;
513
- disconnect(): void;
514
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/vp-frontend-document-components",
3
- "version": "2.6.1",
3
+ "version": "7.2.1606",
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.1"
21
+ "@regulaforensics/document-reader-webclient": "^7.2.2"
22
22
  }
23
23
  }