@idscan/idvc2 2.2.2 → 2.3.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/LICENSE.txt +202 -202
- package/README.md +160 -156
- package/dist/idvc.js +1 -1
- package/dist/index.html +95 -95
- package/dist/js/defaultConfig.ts +261 -254
- package/dist/js/environment/capturingModes.json +4 -4
- package/dist/js/environment/cssVariables.json +191 -191
- package/dist/js/environment/designations.ts +19 -19
- package/dist/js/environment/documentTypes.ts +145 -145
- package/dist/js/environment/langs.ts +293 -293
- package/dist/js/environment/loadModes.json +11 -11
- package/dist/js/environment/loopResult.ts +14 -14
- package/dist/js/environment/networkNames.json +20 -20
- package/dist/js/environment/realFaceModes.ts +15 -15
- package/dist/js/environment/stepsDescription.ts +85 -85
- package/dist/js/environment/triangulation.ts +188 -188
- package/dist/js/geometry.d.ts +8 -8
- package/dist/js/idvc.d.ts +3 -3
- package/dist/js/image.d.ts +4 -4
- package/dist/js/index.d.ts +12 -12
- package/dist/js/loop.d.ts +21 -21
- package/dist/js/mrz.d.ts +105 -105
- package/dist/networks/{130.0b466182.js → 130-bd8e-chunk.js} +0 -0
- package/dist/networks/215-741c-chunk.js +1 -0
- package/dist/networks/{400.8e839581.js → 400-bc2f-chunk.js} +0 -0
- package/dist/networks/716-6f4b-chunk.js +1 -0
- package/dist/networks/{Face.728ec3c6.js → Face-e893-chunk.js} +0 -0
- package/dist/networks/{MRZ.16515b82.js → MRZ-f8b7-chunk.js} +0 -0
- package/dist/networks/{PDF.04105754.js → PDF-a795-chunk.js} +0 -0
- package/dist/networks/{ZXing.d5fea691.js → ZXing-c4dc-chunk.js} +0 -0
- package/dist/networks/angles20210831.json +1 -1
- package/dist/networks/asyncLoader-87ca-chunk.js +1 -0
- package/dist/networks/cdnLoader-c56e-chunk.js +1 -0
- package/dist/networks/classLocal20220112.json +1 -1
- package/dist/networks/detectormodel20220817.json +1 -1
- package/dist/networks/landmarkmodel20220817.json +1 -1
- package/dist/networks/mrz20220531.json +1953 -1953
- package/package.json +4 -4
- package/dist/networks/215.bf164218.js +0 -1
- package/dist/networks/716.7c63165d.js +0 -1
- package/dist/networks/asyncLoader.c80a6980.js +0 -1
- package/dist/networks/cdnLoader.64c17c7d.js +0 -1
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 8 | 9;
|
|
2
|
-
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'VIN' | 'Barcode';
|
|
3
|
-
export type HumanName = 'Driver\'s License or ID card' | 'Passport' | 'Passport Card' | 'Green Card or Employment Authorization' | 'International ID' | 'Vehicle Identification Number' | '1-D and 2-D Barcodes';
|
|
4
|
-
export type ImageSource = 'video' | 'file';
|
|
5
|
-
|
|
6
|
-
export interface DocumentRecord {
|
|
7
|
-
name: DocumentTypeName,
|
|
8
|
-
id: DocumentTypeIndex,
|
|
9
|
-
nName: string,
|
|
10
|
-
humanName: HumanName,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface DocumentType {
|
|
14
|
-
readonly items: DocumentRecord[],
|
|
15
|
-
length: number,
|
|
16
|
-
ids(): DocumentTypeIndex[],
|
|
17
|
-
names(): DocumentTypeName[],
|
|
18
|
-
nameById(id: DocumentTypeIndex): DocumentTypeName | '',
|
|
19
|
-
humanNameById(id: DocumentTypeIndex | 0): HumanName | '',
|
|
20
|
-
humanNames(): HumanName[],
|
|
21
|
-
humanNameByName(name: DocumentTypeName): HumanName | '',
|
|
22
|
-
idByName(name: DocumentTypeName): DocumentTypeIndex | 0,
|
|
23
|
-
idsByNames(names: DocumentTypeName[]): (DocumentTypeIndex | 0)[],
|
|
24
|
-
recordById(id: DocumentTypeIndex | 0): DocumentRecord | null,
|
|
25
|
-
setHumanName(names): void,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const documentType: DocumentType = {
|
|
29
|
-
items: [
|
|
30
|
-
{
|
|
31
|
-
name: 'ID',
|
|
32
|
-
id: 1,
|
|
33
|
-
nName: '',
|
|
34
|
-
humanName: 'Driver\'s License or ID card',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'Passport',
|
|
38
|
-
id: 2,
|
|
39
|
-
nName: 'passp',
|
|
40
|
-
humanName: 'Passport',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'PassportCard',
|
|
44
|
-
id: 3,
|
|
45
|
-
nName: 'passpcard',
|
|
46
|
-
humanName: 'Passport Card',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'GreenCard',
|
|
50
|
-
id: 6,
|
|
51
|
-
nName: 'gc',
|
|
52
|
-
humanName: 'Green Card or Employment Authorization',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'InternationalId',
|
|
56
|
-
id: 7,
|
|
57
|
-
nName: 'iid',
|
|
58
|
-
humanName: 'International ID',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'VIN',
|
|
62
|
-
id: 8,
|
|
63
|
-
nName: 'vin',
|
|
64
|
-
humanName: 'Vehicle Identification Number',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'Barcode',
|
|
68
|
-
id: 9,
|
|
69
|
-
nName: 'barcode',
|
|
70
|
-
humanName: '1-D and 2-D Barcodes',
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
get length() {
|
|
74
|
-
return this.items.length;
|
|
75
|
-
},
|
|
76
|
-
ids() {
|
|
77
|
-
return this.items.map((item) => item.id);
|
|
78
|
-
},
|
|
79
|
-
names() {
|
|
80
|
-
return this.items.map((item) => item.name);
|
|
81
|
-
},
|
|
82
|
-
nameById(id) {
|
|
83
|
-
const res = this.items.filter((item) => item.id === id);
|
|
84
|
-
return res.length ? res[0].name : '';
|
|
85
|
-
},
|
|
86
|
-
humanNameById(id) {
|
|
87
|
-
const res = this.items.filter((item) => item.id === id);
|
|
88
|
-
return res.length ? res[0].humanName : '';
|
|
89
|
-
},
|
|
90
|
-
humanNames() {
|
|
91
|
-
const names: HumanName[] = [];
|
|
92
|
-
this.items.forEach((item) => {
|
|
93
|
-
names[item.id] = item.humanName;
|
|
94
|
-
});
|
|
95
|
-
return names;
|
|
96
|
-
},
|
|
97
|
-
humanNameByName(name) {
|
|
98
|
-
const lowerName = name.toLowerCase();
|
|
99
|
-
const record = this.items.find((item) => item.name.toLowerCase() === lowerName);
|
|
100
|
-
if (record) {
|
|
101
|
-
return record.humanName;
|
|
102
|
-
}
|
|
103
|
-
return '';
|
|
104
|
-
},
|
|
105
|
-
setHumanName(names) {
|
|
106
|
-
Object.keys(names).forEach((key) => {
|
|
107
|
-
const record = this.items.find((item) => item.name === key);
|
|
108
|
-
record.humanName = names[key];
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* return object's id by its name
|
|
113
|
-
* @param {string} name
|
|
114
|
-
* @returns {Number} id of element by its name or 0 if name not found
|
|
115
|
-
*/
|
|
116
|
-
idByName(name) {
|
|
117
|
-
const lowerName = name.toLowerCase();
|
|
118
|
-
if (this.items && this.items.length > 0) {
|
|
119
|
-
const item = this.items.find((record) => record?.name.toLowerCase() === lowerName);
|
|
120
|
-
return item?.id || 0;
|
|
121
|
-
}
|
|
122
|
-
return 0;
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* return ids by names
|
|
126
|
-
* @param {[string]} names
|
|
127
|
-
* @return {[Number]}
|
|
128
|
-
*/
|
|
129
|
-
idsByNames(names) {
|
|
130
|
-
return names.map(this.idByName.bind(this));
|
|
131
|
-
},
|
|
132
|
-
/**
|
|
133
|
-
* return type item { name: String, id: Number, nName: String, humanName: String }
|
|
134
|
-
* @param {number} id
|
|
135
|
-
*/
|
|
136
|
-
recordById(id) {
|
|
137
|
-
if (id === 0) return null;
|
|
138
|
-
for (let i = 0; i <= this.length; i += 1) {
|
|
139
|
-
if (this.items[i].id === id) return this.items[i];
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export default documentType;
|
|
1
|
+
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 8 | 9;
|
|
2
|
+
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'VIN' | 'Barcode';
|
|
3
|
+
export type HumanName = 'Driver\'s License or ID card' | 'Passport' | 'Passport Card' | 'Green Card or Employment Authorization' | 'International ID' | 'Vehicle Identification Number' | '1-D and 2-D Barcodes';
|
|
4
|
+
export type ImageSource = 'video' | 'file';
|
|
5
|
+
|
|
6
|
+
export interface DocumentRecord {
|
|
7
|
+
name: DocumentTypeName,
|
|
8
|
+
id: DocumentTypeIndex,
|
|
9
|
+
nName: string,
|
|
10
|
+
humanName: HumanName,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface DocumentType {
|
|
14
|
+
readonly items: DocumentRecord[],
|
|
15
|
+
length: number,
|
|
16
|
+
ids(): DocumentTypeIndex[],
|
|
17
|
+
names(): DocumentTypeName[],
|
|
18
|
+
nameById(id: DocumentTypeIndex): DocumentTypeName | '',
|
|
19
|
+
humanNameById(id: DocumentTypeIndex | 0): HumanName | '',
|
|
20
|
+
humanNames(): HumanName[],
|
|
21
|
+
humanNameByName(name: DocumentTypeName): HumanName | '',
|
|
22
|
+
idByName(name: DocumentTypeName): DocumentTypeIndex | 0,
|
|
23
|
+
idsByNames(names: DocumentTypeName[]): (DocumentTypeIndex | 0)[],
|
|
24
|
+
recordById(id: DocumentTypeIndex | 0): DocumentRecord | null,
|
|
25
|
+
setHumanName(names): void,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const documentType: DocumentType = {
|
|
29
|
+
items: [
|
|
30
|
+
{
|
|
31
|
+
name: 'ID',
|
|
32
|
+
id: 1,
|
|
33
|
+
nName: '',
|
|
34
|
+
humanName: 'Driver\'s License or ID card',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Passport',
|
|
38
|
+
id: 2,
|
|
39
|
+
nName: 'passp',
|
|
40
|
+
humanName: 'Passport',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'PassportCard',
|
|
44
|
+
id: 3,
|
|
45
|
+
nName: 'passpcard',
|
|
46
|
+
humanName: 'Passport Card',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'GreenCard',
|
|
50
|
+
id: 6,
|
|
51
|
+
nName: 'gc',
|
|
52
|
+
humanName: 'Green Card or Employment Authorization',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'InternationalId',
|
|
56
|
+
id: 7,
|
|
57
|
+
nName: 'iid',
|
|
58
|
+
humanName: 'International ID',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'VIN',
|
|
62
|
+
id: 8,
|
|
63
|
+
nName: 'vin',
|
|
64
|
+
humanName: 'Vehicle Identification Number',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Barcode',
|
|
68
|
+
id: 9,
|
|
69
|
+
nName: 'barcode',
|
|
70
|
+
humanName: '1-D and 2-D Barcodes',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
get length() {
|
|
74
|
+
return this.items.length;
|
|
75
|
+
},
|
|
76
|
+
ids() {
|
|
77
|
+
return this.items.map((item) => item.id);
|
|
78
|
+
},
|
|
79
|
+
names() {
|
|
80
|
+
return this.items.map((item) => item.name);
|
|
81
|
+
},
|
|
82
|
+
nameById(id) {
|
|
83
|
+
const res = this.items.filter((item) => item.id === id);
|
|
84
|
+
return res.length ? res[0].name : '';
|
|
85
|
+
},
|
|
86
|
+
humanNameById(id) {
|
|
87
|
+
const res = this.items.filter((item) => item.id === id);
|
|
88
|
+
return res.length ? res[0].humanName : '';
|
|
89
|
+
},
|
|
90
|
+
humanNames() {
|
|
91
|
+
const names: HumanName[] = [];
|
|
92
|
+
this.items.forEach((item) => {
|
|
93
|
+
names[item.id] = item.humanName;
|
|
94
|
+
});
|
|
95
|
+
return names;
|
|
96
|
+
},
|
|
97
|
+
humanNameByName(name) {
|
|
98
|
+
const lowerName = name.toLowerCase();
|
|
99
|
+
const record = this.items.find((item) => item.name.toLowerCase() === lowerName);
|
|
100
|
+
if (record) {
|
|
101
|
+
return record.humanName;
|
|
102
|
+
}
|
|
103
|
+
return '';
|
|
104
|
+
},
|
|
105
|
+
setHumanName(names) {
|
|
106
|
+
Object.keys(names).forEach((key) => {
|
|
107
|
+
const record = this.items.find((item) => item.name === key);
|
|
108
|
+
record.humanName = names[key];
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* return object's id by its name
|
|
113
|
+
* @param {string} name
|
|
114
|
+
* @returns {Number} id of element by its name or 0 if name not found
|
|
115
|
+
*/
|
|
116
|
+
idByName(name) {
|
|
117
|
+
const lowerName = name.toLowerCase();
|
|
118
|
+
if (this.items && this.items.length > 0) {
|
|
119
|
+
const item = this.items.find((record) => record?.name.toLowerCase() === lowerName);
|
|
120
|
+
return item?.id || 0;
|
|
121
|
+
}
|
|
122
|
+
return 0;
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* return ids by names
|
|
126
|
+
* @param {[string]} names
|
|
127
|
+
* @return {[Number]}
|
|
128
|
+
*/
|
|
129
|
+
idsByNames(names) {
|
|
130
|
+
return names.map(this.idByName.bind(this));
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* return type item { name: String, id: Number, nName: String, humanName: String }
|
|
134
|
+
* @param {number} id
|
|
135
|
+
*/
|
|
136
|
+
recordById(id) {
|
|
137
|
+
if (id === 0) return null;
|
|
138
|
+
for (let i = 0; i <= this.length; i += 1) {
|
|
139
|
+
if (this.items[i].id === id) return this.items[i];
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default documentType;
|