@regulaforensics/idv-document 3.1.239 → 3.2.3-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 +55 -3
- package/dist/index.d.ts +51 -38
- package/dist/main.iife.js +269 -200
- package/dist/main.js +20063 -24813
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
|
-
# Document
|
|
1
|
+
# Document Reader IDV Module
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The **idv-document** module is an npm package plugin designed to work with **DocreaderSDK** via a Web Component:
|
|
4
|
+
https://www.npmjs.com/package/@regulaforensics/vp-frontend-document-components
|
|
5
|
+
|
|
6
|
+
It is delivered as part of the **IDV Capturing** solution and has a version synchronized with **idv-capture-web**. Currently, compatibility is guaranteed at the **major.minor** version level.
|
|
7
|
+
|
|
8
|
+
## What the Module Is
|
|
9
|
+
|
|
10
|
+
The module is an **npm package** that **exports a Web Component**, inside which the **Lit** framework (LitJS) is used for rendering and component logic.
|
|
11
|
+
|
|
12
|
+
## DocreaderSDK Versioning
|
|
13
|
+
|
|
14
|
+
This module declares a **peerDependency** on:
|
|
15
|
+
https://www.npmjs.com/package/@regulaforensics/vp-frontend-document-components
|
|
16
|
+
to ensure compatibility with specific versions of DocreaderSDK.
|
|
17
|
+
|
|
18
|
+
- If the root project already has a version of `vp-frontend-document-components` installed and it matches the allowed versions in `peerDependencies`, that version will be used.
|
|
19
|
+
- If the installed version does **not** match, then starting from **npm v7+**, npm will automatically install a suitable version.
|
|
20
|
+
- In earlier versions of npm, the application developer must manually install the required compatible version.
|
|
21
|
+
|
|
22
|
+
## How It Works
|
|
23
|
+
|
|
24
|
+
The module receives typed configuration data following the unified interface used by all **idv-capture-web** modules.
|
|
25
|
+
The type definitions for the Docreader IDV module configuration are located inside this package.
|
|
26
|
+
|
|
27
|
+
The Web Component then interacts with `vp-frontend-document-components`, which communicates with the **DocreaderSDK service**.
|
|
28
|
+
|
|
29
|
+
## Module Output
|
|
30
|
+
|
|
31
|
+
The result of execution can be either:
|
|
32
|
+
|
|
33
|
+
- **Data** for submission to the platform, or
|
|
34
|
+
- A typed **BaseError**, which contains detailed information explaining why the module failed.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Important Note: Licensing
|
|
38
|
+
|
|
39
|
+
Licensing for this module is **domain-based**.
|
|
40
|
+
However, you may also provide a **development license (`devLicense`)**, encoded in **Base64**.
|
|
41
|
+
|
|
42
|
+
### Providing a devLicense in Ready for Production mode
|
|
43
|
+
|
|
44
|
+
When running in a production environment, you can pass a development license to the module via `moduleProps` in the parent component service of **idv-capture-web**.
|
|
45
|
+
|
|
46
|
+
### Providing a devLicense for Development
|
|
47
|
+
|
|
48
|
+
If the module is used **for development purposes**, the license can be supplied using:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
modulesConfig: {
|
|
52
|
+
docreader: {
|
|
53
|
+
devLicense: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
```
|
|
4
57
|
|
|
5
|
-
Exports React component which can be used in Idv-capture-web-components and IDV Platform
|
package/dist/index.d.ts
CHANGED
|
@@ -1,47 +1,60 @@
|
|
|
1
|
-
import { DocumentReaderDetailType } from '@regulaforensics/vp-frontend-document-components';
|
|
2
|
-
import { DocumentReaderWebComponent } from '@regulaforensics/vp-frontend-document-components';
|
|
3
1
|
import { InternalScenarios } from '@regulaforensics/vp-frontend-document-components';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
4
3
|
import { MirrorType } from '@regulaforensics/vp-frontend-document-components';
|
|
5
|
-
import {
|
|
4
|
+
import { TemplateResult } from 'lit-html';
|
|
6
5
|
|
|
7
6
|
declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
|
|
8
7
|
abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
|
|
9
8
|
abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
declare
|
|
11
|
+
declare type DocumentGalleryProps = {
|
|
12
|
+
processParam?: {
|
|
13
|
+
multipageProcessing?: boolean;
|
|
14
|
+
scenario: string;
|
|
15
|
+
internalScenario: string | InternalScenarios;
|
|
16
|
+
backendProcessing?: {
|
|
17
|
+
serviceURL?: string;
|
|
18
|
+
rfidServerSideChipVerification?: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
selectionLimit: number;
|
|
22
|
+
templateId: typeof DocumentIdvSteps.DOC_READER_GALLERY;
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
tag?: string;
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
serviceToken?: string;
|
|
27
|
+
locale?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export declare class DocumentIdv extends LitElement implements BaseModule<DocumentModuleProps, DocumentModulesConfig> {
|
|
13
31
|
props: IdvModuleProps<DocumentModuleProps, DocumentModulesConfig> | null;
|
|
14
|
-
webComponent: DocumentReaderWebComponent | null;
|
|
15
|
-
constructor();
|
|
16
|
-
static displayName: string;
|
|
17
|
-
listener: (data: CustomEvent<DocumentReaderDetailType | TransactionEvent>) => void;
|
|
18
|
-
private prepareStyles;
|
|
19
|
-
private injectStyles;
|
|
20
|
-
private prepareSettings;
|
|
21
32
|
setProps(props: IdvModuleProps<DocumentModuleProps, DocumentModulesConfig>): void;
|
|
22
|
-
setDocReaderProps(props: IdvModuleProps<DocumentModuleProps, DocumentModulesConfig>): void;
|
|
23
|
-
setDocReaderGalleryProps(props: IdvModuleProps<DocumentModuleProps, DocumentModulesConfig>): void;
|
|
24
|
-
connectedCallback(): void;
|
|
25
|
-
private getFilesAndProcess;
|
|
26
|
-
private render;
|
|
27
|
-
private renderDocReader;
|
|
28
|
-
private renderDocReaderGallery;
|
|
29
|
-
disconnectedCallback(): void;
|
|
30
33
|
static isReady(): boolean;
|
|
31
|
-
static getSupportedTemplates: (
|
|
34
|
+
static getSupportedTemplates(): ("DOC_READER" | "DOC_READER_GALLERY")[];
|
|
32
35
|
static initialize(modulesConfig: DocumentModulesConfig): void;
|
|
33
36
|
static deinitialize(): void;
|
|
34
|
-
static getIdentifier
|
|
37
|
+
static getIdentifier(): string;
|
|
38
|
+
static displayName: string;
|
|
39
|
+
render(): TemplateResult<1>;
|
|
35
40
|
}
|
|
36
|
-
export { DocumentIdv }
|
|
37
|
-
export default DocumentIdv;
|
|
38
41
|
|
|
39
|
-
declare
|
|
40
|
-
DOC_READER
|
|
41
|
-
DOC_READER_GALLERY
|
|
42
|
-
}
|
|
42
|
+
declare const DocumentIdvSteps: {
|
|
43
|
+
readonly DOC_READER: "DOC_READER";
|
|
44
|
+
readonly DOC_READER_GALLERY: "DOC_READER_GALLERY";
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
declare type DocumentIdvSteps = (typeof DocumentIdvSteps)[keyof typeof DocumentIdvSteps];
|
|
48
|
+
|
|
49
|
+
declare type DocumentModuleProps = DocumentGalleryProps | DocumentReaderProps;
|
|
50
|
+
|
|
51
|
+
declare type DocumentModulesConfig = {
|
|
52
|
+
docreader: {
|
|
53
|
+
devLicense: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
43
56
|
|
|
44
|
-
declare type
|
|
57
|
+
declare type DocumentReaderProps = {
|
|
45
58
|
processParam?: {
|
|
46
59
|
multipageProcessing?: boolean;
|
|
47
60
|
scenario: string;
|
|
@@ -79,7 +92,7 @@ declare type DocumentModuleProps = {
|
|
|
79
92
|
maxImageSize?: number;
|
|
80
93
|
maxResolutionSize?: number;
|
|
81
94
|
};
|
|
82
|
-
customization
|
|
95
|
+
customization?: {
|
|
83
96
|
cameraFrameWidthOffset?: number;
|
|
84
97
|
backgroundMaskAlpha?: number;
|
|
85
98
|
backgroundMaskColor?: string;
|
|
@@ -118,26 +131,26 @@ declare type DocumentModuleProps = {
|
|
|
118
131
|
};
|
|
119
132
|
copyright?: boolean;
|
|
120
133
|
tag?: string;
|
|
121
|
-
templateId:
|
|
134
|
+
templateId: typeof DocumentIdvSteps.DOC_READER;
|
|
122
135
|
sessionId?: string;
|
|
123
136
|
serviceToken?: string;
|
|
124
137
|
locale?: string;
|
|
125
138
|
backgroundColor?: string;
|
|
126
|
-
selectionLimit?: number;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
declare type DocumentModulesConfig = {
|
|
130
|
-
docreader: {
|
|
131
|
-
devLicense: string;
|
|
132
|
-
};
|
|
133
139
|
};
|
|
134
140
|
|
|
135
141
|
declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
|
|
136
142
|
isProcessing?: (isProcessing: boolean) => void;
|
|
137
143
|
moduleProps: TModuleProps;
|
|
138
144
|
modulesConfig?: TModulesConfig;
|
|
139
|
-
perform: (data: any) => void;
|
|
145
|
+
perform: (data: any, type?: PerformType) => void;
|
|
140
146
|
idvEventListener: (module: string, data: any) => void;
|
|
141
147
|
};
|
|
142
148
|
|
|
149
|
+
declare type PerformType = (typeof performType)[keyof typeof performType] | undefined;
|
|
150
|
+
|
|
151
|
+
declare const performType: {
|
|
152
|
+
readonly FORM: "form";
|
|
153
|
+
readonly DATA: "data";
|
|
154
|
+
};
|
|
155
|
+
|
|
143
156
|
export { }
|