@idscan/onboarding 2.10.2 → 2.11.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/dist/Wrapper.css +1 -1
- package/dist/Wrapper.d.ts +108 -61
- package/dist/wrapper.es.js +8810 -2854
- package/dist/wrapper.umd.js +5 -1
- package/package.json +79 -70
- package/readme.md +20 -1
- package/dist/src/Wrapper.d.ts +0 -49
package/package.json
CHANGED
|
@@ -1,70 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@idscan/onboarding",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Wrapper of the IDVC library for DIVE Online.",
|
|
5
|
-
"main": "dist/wrapper.umd.js",
|
|
6
|
-
"module": "dist/wrapper.es.js",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"types": "dist/
|
|
9
|
-
"files": [
|
|
10
|
-
"dist/**",
|
|
11
|
-
".npmignore",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"lint": "eslint \"src/**/*.{js,ts}\" --ignore-pattern \"src/UI/**\"",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"storybook": "storybook
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@storybook/
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"storybook": "^10.3.5",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@idscan/onboarding",
|
|
3
|
+
"version": "2.11.0",
|
|
4
|
+
"description": "Wrapper of the IDVC library for DIVE Online.",
|
|
5
|
+
"main": "dist/wrapper.umd.js",
|
|
6
|
+
"module": "dist/wrapper.es.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"types": "dist/Wrapper.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/**",
|
|
11
|
+
".npmignore",
|
|
12
|
+
"LICENSE.txt",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "vite --host",
|
|
17
|
+
"build": "vite build",
|
|
18
|
+
"prod": "vite build --mode production",
|
|
19
|
+
"pack": "npm pack",
|
|
20
|
+
"patch": "npm version patch",
|
|
21
|
+
"lint": "eslint \"src/**/*.{js,ts,svelte}\" --ignore-pattern \"src/UI/**\"",
|
|
22
|
+
"lint:fix": "eslint \"src/**/*.{js,ts,svelte}\" --ignore-pattern \"src/UI/**\" --fix",
|
|
23
|
+
"minor": "npm version minor",
|
|
24
|
+
"storybook": "storybook dev -p 6006",
|
|
25
|
+
"build-storybook": "storybook build",
|
|
26
|
+
"typecheck": "svelte-check --tsconfig ./tsconfig.json",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
|
+
"test:coverage": "vitest run --coverage"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"dompurify": "^3.4.16",
|
|
33
|
+
"qrcode": "^1.5.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@chromatic-com/storybook": "^5.1.2",
|
|
37
|
+
"@idscan/eslint-config": "file:src/UI/eslint/eslint-flat",
|
|
38
|
+
"@idscan/idvc2": "3.9.3",
|
|
39
|
+
"@storybook/addon-a11y": "^10.3.5",
|
|
40
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
41
|
+
"@storybook/svelte-vite": "^10.3.5",
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
|
43
|
+
"@types/qrcode": "^1.5.0",
|
|
44
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
45
|
+
"eslint-plugin-storybook": "^10.3.5",
|
|
46
|
+
"eslint-plugin-svelte": "^3.23.0",
|
|
47
|
+
"globals": "^16.2.0",
|
|
48
|
+
"jsdom": "^30.1.2",
|
|
49
|
+
"msw": "^2.13.4",
|
|
50
|
+
"msw-storybook-addon": "^2.0.7",
|
|
51
|
+
"sass": "^1.43.5",
|
|
52
|
+
"storybook": "^10.3.5",
|
|
53
|
+
"svelte": "^5.57.1",
|
|
54
|
+
"svelte-check": "^4.7.6",
|
|
55
|
+
"typescript": "^5.0.4",
|
|
56
|
+
"vite": "^6.3.5",
|
|
57
|
+
"vite-plugin-checker": "^0.11.0",
|
|
58
|
+
"vite-plugin-dts": "^4.5.4",
|
|
59
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
60
|
+
"vite-plugin-mkcert": "^1.17.9",
|
|
61
|
+
"vite-plugin-static-copy": "^3.1.4",
|
|
62
|
+
"vitest": "^5.0.1"
|
|
63
|
+
},
|
|
64
|
+
"author": "IDScan.net",
|
|
65
|
+
"license": "Apache-2.0",
|
|
66
|
+
"keywords": [
|
|
67
|
+
"idscan",
|
|
68
|
+
"idvc",
|
|
69
|
+
"onboarding",
|
|
70
|
+
"dvs",
|
|
71
|
+
"dive",
|
|
72
|
+
"online"
|
|
73
|
+
],
|
|
74
|
+
"msw": {
|
|
75
|
+
"workerDirectory": [
|
|
76
|
+
".storybook/public"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
package/readme.md
CHANGED
|
@@ -73,6 +73,8 @@ Available fields:
|
|
|
73
73
|
|
|
74
74
|
**domainApi** (string) - URL address of onboarding API. Required.
|
|
75
75
|
|
|
76
|
+
**apiVersion** (string) - Version of the DIVE Online API used for verification: `'v2'` (legacy API, default) or `'2-online'` (new DIVE API).
|
|
77
|
+
|
|
76
78
|
**publicKey** (string) - DVS Web API Public Key. Required.
|
|
77
79
|
|
|
78
80
|
**isAuth** (boolean) - Flag indicating that only face authentication is required.
|
|
@@ -85,7 +87,7 @@ Available fields:
|
|
|
85
87
|
|
|
86
88
|
**useCDN** (boolean) - Flag indicating that you want to load networks from cdn instead of your domain.
|
|
87
89
|
|
|
88
|
-
**preferApiConfig** (boolean) - Flag indicating that you prefer to use IDVC library configuration, that was sent from the DVS Online API, instead of the configuration used when initializing the wrapper.
|
|
90
|
+
**preferApiConfig** (boolean) - Flag indicating that you prefer to use IDVC library configuration, that was sent from the DVS Online API, instead of the configuration used when initializing the wrapper. The `networkUrl` and `chunkPublicPath` options from the wrapper config are still applied, because they depend on where the host serves the files.
|
|
89
91
|
|
|
90
92
|
**hideDocumentTitle** (boolean) - This option switches on/off the displaying document titles.
|
|
91
93
|
|
|
@@ -177,8 +179,25 @@ btn.addEventListener('click', () => {
|
|
|
177
179
|
|
|
178
180
|
**updateConfig** (string) - the method that reinitialize wrapper with new config. Parameter is an JSON encoded IDVC config. Works only in demo mode.
|
|
179
181
|
|
|
182
|
+
**destroy** () - the method that removes the wrapper UI (modals, consent form, QR code button), stops pending requests to DIVE Online, removes the styles (and the CDN script) added for IDVC and puts the element from the `el` option back in its place. Call it before leaving the page in single-page applications.
|
|
183
|
+
|
|
184
|
+
*Note: IDVC itself has no teardown method, so the widget (including the camera) keeps running while its element is on the page. Remove the element after `destroy()` to stop it.*
|
|
185
|
+
|
|
180
186
|
## Version history
|
|
181
187
|
|
|
188
|
+
- **2.11.0**
|
|
189
|
+
- feat: Added support for the new DIVE API, set with the `apiVersion` option (DVS-4470)
|
|
190
|
+
- feat: Added the `destroy()` method that removes the wrapper UI and stops pending requests
|
|
191
|
+
- feat: Show an error modal when the IDVC library fails to load
|
|
192
|
+
- fix: The `networkUrl` and `chunkPublicPath` options from the wrapper config are applied when `preferApiConfig` is set
|
|
193
|
+
- fix: Escaped error messages from the API before showing them in the modal
|
|
194
|
+
- chore: Rewrote the wrapper UI (modals, consent form, QR code button) with Svelte
|
|
195
|
+
|
|
196
|
+
- **2.10.3**
|
|
197
|
+
- fix: Fixed the behavior of the `showQrCode` flag from config
|
|
198
|
+
- fix: Rename loading spinner class
|
|
199
|
+
- feat: Add type guards to validators
|
|
200
|
+
|
|
182
201
|
- **2.10.2**
|
|
183
202
|
- fix: Corrected the validation result modal position when an error response is shown
|
|
184
203
|
|
package/dist/src/Wrapper.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { IWrapperConfig, JSONString } from './@types/Data';
|
|
2
|
-
import { default as VideoCapturing } from '@idscan/idvc2';
|
|
3
|
-
export default class Wrapper {
|
|
4
|
-
private api;
|
|
5
|
-
private lib;
|
|
6
|
-
private configs;
|
|
7
|
-
private readonly IDVCModule;
|
|
8
|
-
private validationOutput;
|
|
9
|
-
private form;
|
|
10
|
-
private validationModal;
|
|
11
|
-
private QRCodeModal;
|
|
12
|
-
private options;
|
|
13
|
-
private embeddedAppConnectionId;
|
|
14
|
-
private readonly config;
|
|
15
|
-
private readonly fingerPrintData;
|
|
16
|
-
private qrCodeBtn;
|
|
17
|
-
private wrapperContainerId;
|
|
18
|
-
constructor(config: IWrapperConfig, IDVCModule: typeof VideoCapturing);
|
|
19
|
-
private get isEmbeddedFromQR();
|
|
20
|
-
private get QRCodeIsAvailable();
|
|
21
|
-
updateConfig(newConfig: JSONString): void;
|
|
22
|
-
/**
|
|
23
|
-
* reinitialize the library with new applicant id
|
|
24
|
-
*/
|
|
25
|
-
setApplicant(applicantId: string): Promise<void>;
|
|
26
|
-
restart(): Promise<void>;
|
|
27
|
-
showLoader(val: boolean, bottomText?: string, topText?: string): void;
|
|
28
|
-
private wrapIDVCComponent;
|
|
29
|
-
private beforeMount;
|
|
30
|
-
private applyWrapperConfigSettings;
|
|
31
|
-
private mountQRCodeButton;
|
|
32
|
-
private mount;
|
|
33
|
-
private unmount;
|
|
34
|
-
private checkApplicantIsValid;
|
|
35
|
-
private prepareConfig;
|
|
36
|
-
private showSpinner;
|
|
37
|
-
private submit;
|
|
38
|
-
private showValidationSuccess;
|
|
39
|
-
private createPostModel;
|
|
40
|
-
private start;
|
|
41
|
-
private mountQR;
|
|
42
|
-
private loadOptions;
|
|
43
|
-
private forceClose;
|
|
44
|
-
private mountValidationModal;
|
|
45
|
-
private mountQRCodeModal;
|
|
46
|
-
private processEmbeddedAppStart;
|
|
47
|
-
private processEmbeddedAppEnd;
|
|
48
|
-
private onError;
|
|
49
|
-
}
|