@idscan/onboarding 2.1.28 → 2.2.6

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.
Files changed (43) hide show
  1. package/.npmignore +20 -0
  2. package/dist/css/onboarding.css +1 -1
  3. package/dist/js/wrapper.js +1 -1
  4. package/dist/networks/156-6146-chunk.js +1 -0
  5. package/dist/networks/190-200f-chunk.js +1 -0
  6. package/dist/networks/77-eca7-chunk.js +1 -0
  7. package/dist/networks/Face-578d-chunk.js +1 -0
  8. package/dist/networks/MRZ-4756-chunk.js +1 -0
  9. package/dist/networks/PDF-8ef7-chunk.js +1 -0
  10. package/dist/networks/ZXing-e864-chunk.js +1 -0
  11. package/dist/networks/angle03032023.onnx +0 -0
  12. package/dist/networks/classLocal03032023.onnx +0 -0
  13. package/dist/networks/faceDetection03032023.onnx +0 -0
  14. package/dist/networks/faceLandmark03032023.onnx +0 -0
  15. package/dist/networks/mrz03032023.onnx +0 -0
  16. package/dist/networks/ort-wasm-simd-threaded.wasm +0 -0
  17. package/dist/networks/ort-wasm-simd.wasm +0 -0
  18. package/dist/networks/ort-wasm-threaded.wasm +0 -0
  19. package/dist/networks/ort-wasm.wasm +0 -0
  20. package/package.json +8 -4
  21. package/readme.md +386 -0
  22. package/dist/networks/130-3968-chunk.js +0 -1
  23. package/dist/networks/215-cb9e-chunk.js +0 -1
  24. package/dist/networks/400-3816-chunk.js +0 -1
  25. package/dist/networks/716-d3a2-chunk.js +0 -1
  26. package/dist/networks/Face-4ffb-chunk.js +0 -1
  27. package/dist/networks/MRZ-d77b-chunk.js +0 -1
  28. package/dist/networks/PDF-89f3-chunk.js +0 -1
  29. package/dist/networks/ZXing-e76f-chunk.js +0 -1
  30. package/dist/networks/angles20210831.bin +0 -0
  31. package/dist/networks/angles20210831.json +0 -1
  32. package/dist/networks/asyncLoader-4593-chunk.js +0 -1
  33. package/dist/networks/cdnLoader-bdbc-chunk.js +0 -1
  34. package/dist/networks/classLocal20220112.bin +0 -0
  35. package/dist/networks/classLocal20220112.json +0 -1
  36. package/dist/networks/detectormodel20220817.bin +0 -0
  37. package/dist/networks/detectormodel20220817.json +0 -1
  38. package/dist/networks/facemesh20210831.bin +0 -0
  39. package/dist/networks/facemesh20210831.json +0 -1
  40. package/dist/networks/landmarkmodel20220817.bin +0 -0
  41. package/dist/networks/landmarkmodel20220817.json +0 -1
  42. package/dist/networks/mrz20220531.bin +0 -0
  43. package/dist/networks/mrz20220531.json +0 -1953
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@idscan/onboarding",
3
- "version": "2.1.28",
3
+ "version": "2.2.6",
4
4
  "description": "Wrapper of the IDVC library for DVS Online.",
5
5
  "main": "dist/js/wrapper.js",
6
6
  "files": [
7
- "dist"
7
+ "dist/**",
8
+ ".npmignore",
9
+ "notes.txt",
10
+ "LICENSE.txt",
11
+ "README.md"
8
12
  ],
9
13
  "scripts": {
10
14
  "start": "webpack serve --mode development",
@@ -15,7 +19,7 @@
15
19
  "minor": "npm version minor"
16
20
  },
17
21
  "dependencies": {
18
- "@idscan/idvc2": "^2.4.17",
22
+ "@idscan/idvc2": "^2.5.1",
19
23
  "core-js": "^3.30.0",
20
24
  "qrcode": "^1.5.1",
21
25
  "regenerator-runtime": "^0.13.11"
@@ -53,7 +57,7 @@
53
57
  "style-loader": "^3.3.1",
54
58
  "ts-loader": "^9.4.2",
55
59
  "typescript": "^4.9.5",
56
- "webpack": "^5.75.0",
60
+ "webpack": "^5.81.0",
57
61
  "webpack-cli": "^5.0.1",
58
62
  "webpack-dev-server": "^4.11.1"
59
63
  },
package/readme.md ADDED
@@ -0,0 +1,386 @@
1
+ ## Overview
2
+
3
+ Wrapper of the IDVC library for DVS Online.
4
+
5
+ ## Use cases
6
+
7
+ - Capture and determination of the document type
8
+ - Capture of pdf417
9
+ - Capture of MRZ
10
+ - Capture of faces
11
+
12
+ ## Recommendations
13
+
14
+ Use a modern phone with a good camera having the definition of not less than 8 megapixels.
15
+ The capture must be made in a well-lighted room. A document must be located at the uniform background.
16
+
17
+ ## Limitations
18
+
19
+ This component works in phones with the operating system Android in the browser Chrome (minimum version 52) and in phones with the operating system iOS (minimum version 11) in the browser Safari
20
+
21
+ ## Installation
22
+
23
+ ```
24
+ $ npm install @idscan/onboarding
25
+ ```
26
+
27
+ This component contains JS, CSS files which require the mandatory import into your project.
28
+
29
+ 1. Before importing it is necessary to set the webpack-configuration.
30
+
31
+ *Note: The project must use the webpack 4 and later versions.*
32
+
33
+ 1.1. Add the following rules of loading to the field rules
34
+ ```javascript
35
+ {
36
+ test: /\.css$/,
37
+ use: ["style-loader", "css-loader"]
38
+ }
39
+ ```
40
+
41
+ 1.2. If you prefer to use neural networks from your domain, you should add the 'CopyWebpackPlugin' into the section 'plugins' which will copy the files, which are necessary for the work of the neural network, from the folder to another folder that should be selected by you.
42
+
43
+ *Note: The structure inside the folder of the component 'networks' must be saved on the server with due regard to the nesting.
44
+ There are binary files in the folder which do not have the extension. These files must be provided by the server with the header `Content-Type: application/octet-stream`.*
45
+ ```javascript
46
+ new CopyWebpackPlugin ([
47
+ {
48
+ from: 'node_modules/@idscan/onboarding/dist/networks/**/*',
49
+ to: 'networks/[folder]/[name].[ext]',
50
+ toType: 'template'
51
+ }
52
+ ])
53
+ ```
54
+
55
+ 1.3. Import the library and css to your project.
56
+
57
+ ```javascript
58
+ import DVSOIDVC from '@idscan/onboarding';
59
+ import '@idscan/onboarding/dist/css/onboarding.css';
60
+ ```
61
+ ## Initialization
62
+
63
+ Create an instance of the object 'DVS Online IDVC library wrapper'. The object takes one object of the component configuration as a parameter.
64
+
65
+ All configurations of @idscan/IDVC will be fetched from DVS Online by domainId.
66
+
67
+ Available fields:
68
+
69
+ **el** (string) - id of an element on the page where the component will be integrated. Required.
70
+
71
+ **applicantId** (string) - id of applicant. Required
72
+
73
+ **domainId** (string) - domain id where from will get configs and styles. Required
74
+
75
+ **domainApi** (string) - URL address of onboarding API
76
+
77
+ **publicKey** (string) - DVS Web API Public Key. Required
78
+
79
+ **isAuth** (boolean) - Flag indicating that only face authentication is required
80
+
81
+ **chunkPublicPath** (string) - Path to the folder with chunks. Specify the path on the server if you need to remove the folder to another location. The default path is \'networks\'.
82
+
83
+ **callbacks** (object) - object with callback hooks. Available next hooks:
84
+
85
+ - **onChange** - callback-function which will be called after change one step. The returnable value is the object with the type and the image
86
+
87
+ - **onCameraError** - The function that is invoked in case if the camera is not available. The response value is the object with the error code and the message
88
+
89
+ - **onReset** - callback-function which will be called after reset all the steps. The returnable value is the object with the steps
90
+
91
+ - **onRetakeHook** - the function that will be called before reset the current step. The returnable value is the object with the current step
92
+
93
+ - **onValidate** - the function that will be called after validation response received. The returnable value is the object with validation information
94
+
95
+ - **onError** - the function that will be called on error. The response value is the object with the error code and the message
96
+
97
+ - **onReloaded** - the function that will be called after the component finishes reloading. This function doesn't return a value.
98
+
99
+ - **onMounted** - the function that will be called on the component mounted. This function doesn't return a value.
100
+
101
+ - **submit** - callback-function which will be called after completing all the steps. The returnable value is the object with the following content:
102
+ ```javascript
103
+ documentTypes: [
104
+ {
105
+ type: "ID",
106
+ steps:[
107
+ { type: 'front', name: 'Document Front', mode: { uploader: true, video: true } },
108
+ { type: 'pdf', name: 'Document PDF417 Barcode' , mode: { uploader: true, video: true } },
109
+ { type: 'face', name: 'Face', mode: { uploader: false, video: true } }
110
+ ]},
111
+ {
112
+ type: "Passport",
113
+ steps:[
114
+ { type: 'mrz', name: 'Passport Front' , mode: { uploader: true, video: true } },
115
+ { type: 'face', name: 'Face', mode: { uploader: false, video: true } }
116
+ ]},
117
+ ]
118
+ ```
119
+
120
+ steps – steps with the type and the image in the format 'base64'.
121
+
122
+ Also, if you use automatic capture, in the "back" step **trackstring** will be returned (raw PDF417 data from Barcode encoded in base64)
123
+
124
+
125
+ *Note: Request an license key for the library by emailing
126
+ [sales@idscan.net](mailto:sales@idscan.net) or [support@idscan.net](mailto:support@idscan.net)*
127
+
128
+ ## Methods
129
+
130
+ **setApplicant** (string) - the method that reinitialize wrapper for new applicant. Parameter is an applicant id of string type.
131
+ ```javascript
132
+ import DVSOIDVC from './Wrapper';
133
+
134
+ const lib = new DVSOIDVC({
135
+ applicantId: '...',
136
+ domainId: '...',
137
+ publicKey: '...',
138
+ chunkPublicPath: '/customPath/',
139
+ });
140
+
141
+ const btn = document.getElementById('btn');
142
+ btn.addEventListener('click', () => {
143
+ const applicantId = 'new applicant id';
144
+ lib.setApplicant(applicantId);
145
+ });
146
+ ```
147
+
148
+ **updateConfig** (string) - the method that reinitialize wrapper with new config. Parameter is an JSON encoded IDVC config. Works only in demo mode.
149
+
150
+ ## Version history
151
+ - **2.2.6**
152
+ - Fixed config
153
+
154
+ - **2.2.5**
155
+ - Fixed build issue
156
+
157
+ - **2.2.4**
158
+ - Updated IDVC component
159
+
160
+ - **2.2.3**
161
+ - Added: face auth success modal
162
+
163
+ - **2.2.2**
164
+ - Added: config change
165
+ - Changed API calls
166
+
167
+ - **2.2.1**
168
+ - Fix: face validation
169
+
170
+ - **2.2.0**
171
+ - Feat: add flag indicating that only face authentication is required
172
+ - Feat: some minor fixes
173
+
174
+ - **2.1.29**
175
+ - Feat: some minor fixes
176
+
177
+ - **2.1.28**
178
+ - Updated IDVC component
179
+
180
+ - **2.1.27**
181
+ - Updated IDVC component
182
+
183
+ - **2.1.26**
184
+ - Fix: Consent Form styles
185
+
186
+ - **2.1.25**
187
+ - Feat: Add attempt left status text
188
+ - Fix: Validation Modal
189
+
190
+ - **2.1.24**
191
+ - Fix: Consent Form styles
192
+
193
+ - **2.1.23**
194
+ - Feat: rework Consent Form
195
+ - Feat: change Domains Api to Integrations Api
196
+
197
+ - **2.1.22**
198
+ - Fix: embedded app status from api
199
+ - Feat: update IDVC callbacks readme
200
+
201
+ - **2.1.21**
202
+ - Feat: change domain to domainApi
203
+ - Feat: domainApi is required now
204
+
205
+ - **2.1.20**
206
+ - Fix: change showQRCode flag name to showQrCode
207
+
208
+ - **2.1.19**
209
+ - Fix: return old check validation endpoint
210
+ - Feat: add check for showQRCode flag from backend
211
+
212
+ - **2.1.18**
213
+ - Add the possibility of continuing the documents' check on a mobile device
214
+
215
+ - **2.1.17**
216
+ - Change verifyFace option behavior
217
+
218
+ - **2.1.16**
219
+ - Updated IDVC component
220
+
221
+ - **2.1.15**
222
+ - Updated IDVC component
223
+
224
+ - **2.1.14**
225
+ - Updated IDVC component
226
+
227
+ - **2.1.13**
228
+ - Updated IDVC component
229
+
230
+ - **2.1.12**
231
+ - Fix: validation model
232
+
233
+ - **2.1.11**
234
+ - Updated IDVC component
235
+
236
+ - **2.1.10**
237
+ - Updated IDVC component
238
+
239
+ - **2.1.9**
240
+ - Fixed API path
241
+
242
+ - **2.1.8**
243
+ - Updated IDVC component
244
+
245
+ - **2.1.7**
246
+ - Added support for Proxy based frameworks
247
+
248
+ - **2.1.6**
249
+ - Added support for ios < 15
250
+
251
+ - **2.1.5**
252
+ - Updated IDVC component
253
+
254
+ - **2.1.4**
255
+ - Improved document types validation
256
+
257
+ - **2.1.3**
258
+ - Updated IDVC component
259
+
260
+ - **2.1.2**
261
+ - Updated IDVC component
262
+ - Changed: modal message behaviour
263
+
264
+ - **2.1.1**
265
+ - Fixed: submit mrz
266
+
267
+ - **2.1.0**
268
+ - Added: new option in config "chunkPublicPath"
269
+
270
+ - **2.0.19**
271
+ - Updated IDVC component
272
+
273
+ - **2.0.18**
274
+ - Updated IDVC component
275
+
276
+ - **2.0.17**
277
+ - Some improvements
278
+
279
+ - **2.0.16**
280
+ - Some improvements
281
+
282
+ - **2.0.15**
283
+ - Some improvements
284
+
285
+ - **2.0.14**
286
+ - Some improvements
287
+
288
+ - **2.0.13**
289
+ - Updated IDVC component
290
+
291
+ - **2.0.12**
292
+ - Updated IDVC component
293
+
294
+ - **2.0.11**
295
+ - Updated IDVC component
296
+
297
+ - **2.0.10**
298
+ - Updated IDVC component
299
+
300
+ - **2.0.9**
301
+ - Updated IDVC component
302
+
303
+ - **2.0.8**
304
+ - Some improvements
305
+
306
+ - **2.0.7**
307
+ - Fixed background
308
+
309
+ - **2.0.6**
310
+ - Added version 1 config support
311
+
312
+ - **2.0.5**
313
+ - Updated IDVC component
314
+ - Fixed submit method
315
+
316
+ - **2.0.4**
317
+ - Updated IDVC component
318
+
319
+ - **2.0.3**
320
+ - Some improvements
321
+
322
+ - **2.0.2**
323
+ - Updated IDVC component
324
+
325
+ - **2.0.1**
326
+ - Added consent form
327
+
328
+ - **2.0.0**
329
+ - Migrate to the IDVC version 2
330
+
331
+ - **1.0.18**
332
+ - Fixed spinner
333
+
334
+ - **1.0.17**
335
+ - Fixed license key
336
+
337
+ - **1.0.16**
338
+ - Added sign for forced closing of the request
339
+
340
+ - **1.0.15**
341
+ - updated IDVC component
342
+
343
+ - **1.0.14**
344
+ - updated IDVC component
345
+
346
+ - **1.0.13**
347
+ - added ids for style tags
348
+
349
+ - **1.0.12**
350
+ - updated IDVC component
351
+
352
+ - **1.0.11**
353
+ - updated using DVS Online API
354
+
355
+ - **1.0.10**
356
+ - added: onMounted callback
357
+
358
+ - **1.0.9**
359
+ - @idscan/idvc dependency updated
360
+
361
+ - **1.0.8**
362
+ - added: reload component with new configs in demo mode
363
+
364
+ - **1.0.7**
365
+ - updated using DVS Online API
366
+
367
+ - **1.0.6**
368
+ - updated using DVS Online API
369
+
370
+ - **1.0.5**
371
+ - updated IDVC component
372
+ - updated using DVS Online API
373
+
374
+ - **1.0.4**
375
+ - use CDN
376
+
377
+ - **1.0.3**
378
+ - Changed readme
379
+
380
+ - **1.0.2**
381
+ - Some improvements
382
+
383
+ - **1.0.1**
384
+ - Changed readme
385
+
386
+ - **1.0.0**
@@ -1 +0,0 @@
1
- onmessage=({data:e})=>{Object.keys(e).forEach(((t,n)=>{fetch(e[t]).then((e=>e.body)).then((e=>{const t=e.getReader();return new ReadableStream({start(e){!function n(){t.read().then((({done:t,value:s})=>{t?e.close():(e.enqueue(s),n())}))}()}})})).then((e=>new Response(e,{headers:{"Content-Type":"text/javascript"}}).text())).then((t=>{const s=`executedScript${n}`,a="scriptExecuted";let c=t;c+=`\n const event = new Event('${a}');\n document.getElementById('${s}').dispatchEvent(event);\n `,Object.keys(e).length,postMessage({value:c,id:s,event:a})}))}))};
@@ -1 +0,0 @@
1
- const t=(t,e)=>t-e,e=(t,e)=>t+e,r=(t,e)=>t%e>1?t-1:-1,n=(t,e)=>(t+1)%e>=0?t+1:-1,a=(e,n)=>r(t(e,n),n),s=(e,r)=>n(t(e,r),r),o=(t,n)=>r(e(t,n),n),c=(t,r)=>n(e(t,r),r),h=(h,i)=>[a,t,s,n,c,e,o,r].map((t=>t(h,i))),d=(t,e)=>{const r=[],n=[],a=t.length;let s,o=0;const c=()=>{const s=e=>e>0&&0!==t[e]&&e<a;for(;r.length;){const a=r.pop();if(!a)break;t[a]=0,n[o].add(a),h(a,e).forEach((t=>{s(t)&&r.push(t)}))}};for(s=0;s<a;s+=1)0!==t[s]&&(n[o]=new Set,r.push(s),c(),o+=1);return n},i=.3,l=(t,e)=>Math.floor(t/e),u=(t,e)=>{return[(r=t,n=e,r%n),l(t,e)];var r,n},m=t=>null!=t,g=(t,e,r)=>{const n=((t,e=120)=>{const r=t.width*t.height,n=new Uint8ClampedArray(r);let a,s=0,o=0,c=0,h=0;for(a=0;a<r;a+=1){const r=a<<2;s=t.data[r+0],o=t.data[r+1],c=t.data[r+2],h=77*s+151*o+28*c>>8,h<e&&(n[a]=1)}return n})(t);return(({segments:t,width:e,scaleWidth:r,scaleHeight:n})=>t.map((t=>{let a=Number.MAX_VALUE,s=Number.MAX_VALUE,o=Number.MIN_VALUE,c=Number.MIN_VALUE;for(const r of t){const t=u(r,e);t[0]<a&&(a=t[0]),t[1]<s&&(s=t[1]),t[0]>o&&(o=t[0]),t[1]>c&&(c=t[1])}const h=(o-a)*(c-s);return h>5&&h<500?{perimeter:h,x1:Math.trunc(a/i/r),y1:Math.trunc(s/i/n),x2:Math.trunc(o/i/r),y2:Math.trunc(c/i/n)}:null})).filter(m))({segments:d(n,t.width),width:t.width,scaleWidth:e,scaleHeight:r})};onmessage=({data:t})=>{const e=g(t.iData,t.resizedToBorderScaleWidth,t.resizedToBorderScaleHeight);postMessage({segments:e})};