@regulaforensics/vp-frontend-document-components 7.5.1917-rc → 7.5.1925-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 +18 -7
- package/dist/index.d.ts +10 -2
- package/dist/main.iife.js +37 -37
- package/dist/main.js +10929 -10873
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -268,6 +268,7 @@ After adding `DocumentReaderService` to the global variable, you can change the
|
|
|
268
268
|
| **scenario** | Recognition scenario. | string | 'MrzAndLocate' | 'MrzAndLocate', 'MrzOrLocate', 'Mrz', 'Locate' |
|
|
269
269
|
| **multipageProcessing** | Whether to enable multi-page document processing mode. | boolean | `true` | `true`, `false` |
|
|
270
270
|
| **timeout** | Recognition timeout in milliseconds. After this time process will be finished. | number | 2000 | numbers > 0 |
|
|
271
|
+
| **timeoutFromFirstDetect** | Start the countdown from the moment the document is detected. | number | 5000 | numbers > 0 |
|
|
271
272
|
| **resultTypeOutput** | Types of results to return in response. [] - all available types. | number[] | [] | `1` - DocumentImageResult, `3` - TextDataResult, `5` - DocBarCodeInfo, `6` - GraphicsResult, `8` - DocumentTypesCandidatesResult, `9` - ChosenDocumentTypeResult, `20` - AuthenticityResult, `15` - LexicalAnalysisResult, `17` - TextDataResult, `18` - TextDataResult, `19` - GraphicsResult, `30` - ImageQualityResult, `33` - StatusResult, `36` - TextResult, `37` - ImagesResult, `85` - DocumentPositionResult, `102` - TextDataResult, `103` - GraphicsResult, `50` - LicenseResult, `49` - EncryptedRCLResult |
|
|
272
273
|
| **returnPackageForReprocess** | When enabled, returns the package for reprocessing on the backend. | boolean | `false` | `true`, `false` |
|
|
273
274
|
| **imageQa** | When enabled, image quality checks status affects document optical and overall status. | | | |
|
|
@@ -425,6 +426,7 @@ Available fields of `event.detail.data` object:
|
|
|
425
426
|
| `NO_CAMERA` | There is no camera available |
|
|
426
427
|
| `INCORRECT_CAMERA_ID` | Camera with this ID was not found |
|
|
427
428
|
| `CONNECTION_ERROR` | Connection errors |
|
|
429
|
+
| `BAD_CONFIGURATION` | Incompatible component settings are installed |
|
|
428
430
|
|
|
429
431
|
#### Remote action data
|
|
430
432
|
|
|
@@ -1061,6 +1063,7 @@ You can send the results to the backend for further processing:
|
|
|
1061
1063
|
```javascript
|
|
1062
1064
|
window.RegulaDocumentSDK.recognizerProcessParam = {
|
|
1063
1065
|
processParam: {
|
|
1066
|
+
scenario: InternalScenarios.MrzAndLocate,
|
|
1064
1067
|
backendProcessing: {
|
|
1065
1068
|
serviceURL: 'YOUR_SERVICE_URL',
|
|
1066
1069
|
httpHeaders: { // you can set http headers if necessary
|
|
@@ -1090,11 +1093,19 @@ For cases when user's main device lacks camera or does not succeed to scan with
|
|
|
1090
1093
|
you have an option to delegate scanning to another available device (i.e. phone).
|
|
1091
1094
|
|
|
1092
1095
|
#### 1. "From other phone" action may be configured on the start screen:
|
|
1093
|
-
-
|
|
1094
|
-
- add 'delegateURL' and 'tag':
|
|
1096
|
+
- add 'delegateProcessing' and 'tag':
|
|
1095
1097
|
```javascript
|
|
1096
1098
|
processor.recognizerProcessParam = {
|
|
1097
|
-
|
|
1099
|
+
processParam: {
|
|
1100
|
+
scenario: InternalScenarios.MrzAndLocate,
|
|
1101
|
+
},
|
|
1102
|
+
delegateProcessing: {
|
|
1103
|
+
delegateURL: 'https://your-page.com?tag={tag}', // the page which will be used by other device
|
|
1104
|
+
serviceURL: 'https://my-service.com', // your backend service
|
|
1105
|
+
httpHeaders: { // http headers if needed
|
|
1106
|
+
header: 'value'
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1098
1109
|
tag: 123 // your session id, will be added to delegateURL in place of {tag} substring
|
|
1099
1110
|
}
|
|
1100
1111
|
```
|
|
@@ -1107,14 +1118,12 @@ you have an option to delegate scanning to another available device (i.e. phone)
|
|
|
1107
1118
|
|
|
1108
1119
|
#### 2. Configure Delegate page component on delegateURL:
|
|
1109
1120
|
- configure [backend reprocessing](#backend-reprocessing)
|
|
1121
|
+
- backendProcessing setting for the device and delegateProcessing setting for the main page must match
|
|
1110
1122
|
- use the same tag as on the main page
|
|
1111
1123
|
```javascript
|
|
1112
|
-
window.RegulaDocumentSDK.recognizerProcessParam = {
|
|
1113
|
-
tag: 123 // your session id, i.e. it can be extracted from your delegate page URL
|
|
1114
|
-
};
|
|
1115
|
-
|
|
1116
1124
|
element.settings = {
|
|
1117
1125
|
startScreen: false, // From camera recognition is expected
|
|
1126
|
+
mobileDelegate: true
|
|
1118
1127
|
}
|
|
1119
1128
|
```
|
|
1120
1129
|
- use finalizePackage() to send the data for further reprocessing
|
|
@@ -1233,6 +1242,8 @@ See the following table with localized labels, used in the components.
|
|
|
1233
1242
|
| **fromFilesDesktop** | Pick a document from the files and upload it | `document-reader` |
|
|
1234
1243
|
| **fromMobileDesktop** | Use your mobile camera to capture a document | `document-reader` |
|
|
1235
1244
|
| **fromGalleryMobile** | Pick a document from the gallery and upload it | `document-reader` |
|
|
1245
|
+
| **returnToComputer** | Return to the computer | `document-reader` |
|
|
1246
|
+
| **documentCaptured** | Your document has been captured | `document-reader` |
|
|
1236
1247
|
|
|
1237
1248
|
## Document Reader Processor
|
|
1238
1249
|
|
package/dist/index.d.ts
CHANGED
|
@@ -231,6 +231,7 @@ export declare class DocumentReaderService {
|
|
|
231
231
|
private _initializeListener;
|
|
232
232
|
private _processingListener;
|
|
233
233
|
private _queueService;
|
|
234
|
+
onFinalize: TOnFinalize | null;
|
|
234
235
|
isAutoPrepare: boolean;
|
|
235
236
|
isPrepared: boolean;
|
|
236
237
|
isInitialized: boolean;
|
|
@@ -383,7 +384,8 @@ export declare enum ErrorTypes {
|
|
|
383
384
|
INCORRECT_CAMERA_ID = "INCORRECT_CAMERA_ID",
|
|
384
385
|
CONNECTION_ERROR = "CONNECTION_ERROR",
|
|
385
386
|
HTTP_NOT_SUPPORTED = "HTTP_NOT_SUPPORTED",
|
|
386
|
-
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT"
|
|
387
|
+
INSECURE_PAGE_CONTEXT = "INSECURE_PAGE_CONTEXT",
|
|
388
|
+
BAD_CONFIGURATION = "BAD_CONFIGURATION"
|
|
387
389
|
}
|
|
388
390
|
|
|
389
391
|
export declare enum EventActions {
|
|
@@ -520,7 +522,11 @@ export declare interface PackageParams {
|
|
|
520
522
|
|
|
521
523
|
export declare interface ProcessingRequest extends BaseRequest {
|
|
522
524
|
metadata?: Record<string, any>;
|
|
523
|
-
|
|
525
|
+
delegateProcessing?: {
|
|
526
|
+
serviceURL: string;
|
|
527
|
+
delegateURL: string;
|
|
528
|
+
httpHeaders?: Record<string, string>;
|
|
529
|
+
};
|
|
524
530
|
processParam: DocumentReaderProcessParam;
|
|
525
531
|
imagesList?: Array<DocumentReaderImage>;
|
|
526
532
|
imageInputParam?: ImageInputParamType;
|
|
@@ -549,6 +555,8 @@ declare type TInitializeListener = ({ isInitialized }: {
|
|
|
549
555
|
isInitialized: boolean;
|
|
550
556
|
}) => void;
|
|
551
557
|
|
|
558
|
+
declare type TOnFinalize = (transaction: TransactionInfo) => void;
|
|
559
|
+
|
|
552
560
|
declare type TPrepareListener = ({ isPrepared }: {
|
|
553
561
|
isPrepared: boolean;
|
|
554
562
|
}) => void;
|