bry-biometric-collector 2.0.3 → 2.0.4
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 +6 -0
- package/dist/{FaceCollector_93d41450_2.0.3.js → FaceCollector_2518984f_2.0.4.js} +507 -502
- package/dist/bry-biometric-collector-main.js +1 -1
- package/dist/{en-us_360d5d87_2.0.3.js → en-us_5ebe727c_2.0.4.js} +7 -6
- package/dist/{face_api_0e3ce8c8_2.0.3.js → face_api_ebd7fa48_2.0.4.js} +12646 -12823
- package/dist/{fingersApi_7384225f_2.0.3.js → fingersApi_ae9e2572_2.0.4.js} +12 -12
- package/dist/images/face-collector.png +0 -0
- package/dist/images/fingerprint-collector.png +0 -0
- package/dist/index.d.ts +198 -0
- package/dist/index.js +4 -0
- package/dist/{main_4a3321b2_2.0.3.js → main_14ce11df_2.0.4.js} +6789 -6995
- package/dist/{pt-br_c3fe6b06_2.0.3.js → pt-br_cb19a314_2.0.4.js} +1 -0
- package/package.json +5 -8
- /package/dist/{index-no-detector_c7c1d3a2_2.0.3.js → index-no-detector_c7c1d3a2_2.0.4.js} +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { o as D, X as C, n as y, g, i as b, a as M, s as l, b as h, c as U, F, d as x, e as c, v, f as P, A as B, h as S, j as E, k as W, l as k, u as X, m as R, p as G, q as V } from "./main_14ce11df_2.0.4.js";
|
2
2
|
const d = D(C);
|
3
|
-
var
|
3
|
+
var q = /* @__PURE__ */ ((n) => (n.EXTENSION_MISSING = "EXTENSION_MISSING", n.USER_CANCELLED = "USER_CANCELLED", n.UNAUTHORIZED_EXTENSION = "UNAUTHORIZED_EXTENSION", n.SCANNER_NOT_FOUND = "SCANNER_NOT_FOUND", n.EXTENSION_MODULE_NOT_INSTALLED = "EXTENSION_MODULE_NOT_INSTALLED", n.FINGER_NOT_REMOVED = "FINGER_NOT_REMOVED", n.UNKNOWN_ERROR = "UNKNOWN_ERROR", n.EVALUATE_BIOMETRICS_TIMEOUT = "EVALUATE_BIOMETRICS_TIMEOUT", n.EVALUATE_BIOMETRICS_NETWORK_ISSUE = "EVALUATE_BIOMETRICS_NETWORK_ISSUE", n))(q || {});
|
4
4
|
class s extends Error {
|
5
5
|
constructor(a, T) {
|
6
6
|
super(a), this.status = T;
|
@@ -73,7 +73,7 @@ async function K(n, a) {
|
|
73
73
|
"USER_CANCELLED"
|
74
74
|
/* USER_CANCELLED */
|
75
75
|
);
|
76
|
-
const i =
|
76
|
+
const i = $(T);
|
77
77
|
i.image = N?.content.image?.data, i.base64WSQ = N?.content.fingerprint.data, i.nfiqRating = (N?.content.score || 0) + 98, i.status = F.AVAILABLE;
|
78
78
|
const L = x(c());
|
79
79
|
let r, _ = !1;
|
@@ -100,14 +100,14 @@ async function K(n, a) {
|
|
100
100
|
/* EVALUATE_BIOMETRICS_NETWORK_ISSUE */
|
101
101
|
));
|
102
102
|
}
|
103
|
-
let
|
103
|
+
let w, f, O, A, u, o = E.LOW_QUALITY;
|
104
104
|
if (r) {
|
105
105
|
const e = r.bodyParts.find(
|
106
106
|
(t) => t.bodyPart === i.bodyPart
|
107
107
|
);
|
108
|
-
i.nfiqRating = e.quality, (e.quality > W() || e.status === "LOW_QUALITY") && (
|
108
|
+
i.nfiqRating = e.quality, (e.quality > W() || e.status === "LOW_QUALITY") && (w = !0, o = E.LOW_QUALITY), r.bodyParts.find((t) => t.status === "DUPLICATE") && (f = !0, o = E.DUPLICATE), r.bodyParts.find((t) => t.status === "FORBIDDEN") && (O = !0, o = E.FORBIDDEN), r.bodyParts.find((t) => t.status === "AGR") && (A = !0, o = E.AGR_DETECTED), r.bodyParts.find((t) => t.status === "AGR_NOT_MATCH") && (u = !0, o = E.AGR_NO_MATCH);
|
109
109
|
}
|
110
|
-
if (f ||
|
110
|
+
if (f || w || O || u || A || _) {
|
111
111
|
i.nfiqRating = -1, i.base64WSQ = "", i.image = "", i.status = F.AVAILABLE;
|
112
112
|
let e = "badFingerQualitySwal";
|
113
113
|
f ? e = "unknownDuplicateFingerSwal" : O ? e = "forbiddenFingerSwal" : A ? e = "agrFinger" : u && (e = "agrFingerNotMatched");
|
@@ -119,7 +119,7 @@ async function K(n, a) {
|
|
119
119
|
finger2: d(`${e}.${r.matchingFingers?.[1]}`)
|
120
120
|
}
|
121
121
|
});
|
122
|
-
const m =
|
122
|
+
const m = R();
|
123
123
|
return {
|
124
124
|
returnCode: o,
|
125
125
|
bodyParts: m,
|
@@ -127,13 +127,13 @@ async function K(n, a) {
|
|
127
127
|
message: t
|
128
128
|
};
|
129
129
|
}
|
130
|
-
const p =
|
130
|
+
const p = R();
|
131
131
|
return { returnCode: o, bodyParts: p, message: t };
|
132
132
|
}
|
133
|
-
return S(c()), l(!1),
|
133
|
+
return S(c()), l(!1), G(), { returnCode: E.CAPTURED, bodyParts: R() };
|
134
134
|
}
|
135
|
-
function
|
136
|
-
|
135
|
+
function $(n) {
|
136
|
+
V();
|
137
137
|
for (const a of c())
|
138
138
|
if (a.index === n)
|
139
139
|
return a.selected = !0, a;
|
@@ -141,6 +141,6 @@ function q(n) {
|
|
141
141
|
}
|
142
142
|
export {
|
143
143
|
s as CaptureApiError,
|
144
|
-
|
144
|
+
q as CaptureErrorStatusEnum,
|
145
145
|
K as captureSingleFinger
|
146
146
|
};
|
Binary file
|
Binary file
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
export interface livenessResult {
|
2
|
+
capture_liveness: { probability: number; score: number };
|
3
|
+
face_liveness: { probability: number };
|
4
|
+
}
|
5
|
+
|
6
|
+
export interface livenessErrorResult {
|
7
|
+
error: string;
|
8
|
+
error_code: string;
|
9
|
+
}
|
10
|
+
export interface BodyPart {
|
11
|
+
/**
|
12
|
+
* bodypart name
|
13
|
+
*/
|
14
|
+
bodyPart: string;
|
15
|
+
/**
|
16
|
+
* base64 data
|
17
|
+
*/
|
18
|
+
data: string;
|
19
|
+
img?: string;
|
20
|
+
status?: string;
|
21
|
+
justification?: string;
|
22
|
+
nfiq?: number;
|
23
|
+
livenessBlob?: string;
|
24
|
+
livenessResult?: livenessResult | livenessErrorResult;
|
25
|
+
}
|
26
|
+
export enum Props {
|
27
|
+
EXTENSION_NAME = 'extension_name',
|
28
|
+
COLLECTOR_SELECT = 'collector_select',
|
29
|
+
VIDEO_DIMENSIONS = 'video_dimensions',
|
30
|
+
ENABLE_MINUTIAE = 'enable_minutiae',
|
31
|
+
WEIGHTS_PATH = 'weights_path',
|
32
|
+
LIVENESS_ENABLE = 'liveness_enable',
|
33
|
+
IMPORT_LOTTIE = 'import_lottie',
|
34
|
+
HIDE_TABS = 'hide_tabs',
|
35
|
+
IMPORT_BRY_WEB_COLLECTOR_SCRIPT = 'import_bry_web_collector_script',
|
36
|
+
}
|
37
|
+
|
38
|
+
export const enum BodyPartNames {
|
39
|
+
LEFT_HAND_PINKY = 'LEFT_HAND_PINKY',
|
40
|
+
LEFT_HAND_RING = 'LEFT_HAND_RING',
|
41
|
+
LEFT_HAND_MIDDLE = 'LEFT_HAND_MIDDLE',
|
42
|
+
LEFT_HAND_INDEX = 'LEFT_HAND_INDEX',
|
43
|
+
LEFT_HAND_THUMB = 'LEFT_HAND_THUMB',
|
44
|
+
RIGHT_HAND_THUMB = 'RIGHT_HAND_THUMB',
|
45
|
+
RIGHT_HAND_INDEX = 'RIGHT_HAND_INDEX',
|
46
|
+
RIGHT_HAND_MIDDLE = 'RIGHT_HAND_MIDDLE',
|
47
|
+
RIGHT_HAND_RING = 'RIGHT_HAND_RING',
|
48
|
+
RIGHT_HAND_PINKY = 'RIGHT_HAND_PINKY',
|
49
|
+
RIGHT_HAND = 'RIGHT_HAND',
|
50
|
+
LEFT_HAND = 'LEFT_HAND',
|
51
|
+
}
|
52
|
+
|
53
|
+
export const enum requestResultEnum {
|
54
|
+
OK = 'OK',
|
55
|
+
TEMPLATE_EXTRACTION_ERROR = 'TEMPLATE_EXTRACTION_ERROR',
|
56
|
+
UNKNOWN_TEMPLATE_EXTRACTION_ERROR = 'UNKNOWN_TEMPLATE_EXTRACTION_ERROR',
|
57
|
+
LOW_LIVENESS_SCORE = 'LOW_LIVENESS_SCORE',
|
58
|
+
LIVENESS_DETECTION_FAILURE = 'LIVENESS_DETECTION_FAILURE',
|
59
|
+
UNKNOWN_LIVENESS_ERROR = 'UNKNOWN_LIVENESS_ERROR',
|
60
|
+
UNABLE_TO_COMMUNICATE_WITH_LIVENESS_SERVICE = 'UNABLE_TO_COMMUNICATE_WITH_LIVENESS_SERVICE',
|
61
|
+
UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE = 'UNABLE_TO_COMMUNICATE_WITH_TEMPLATE_EXTRACTION_SERVICE',
|
62
|
+
}
|
63
|
+
|
64
|
+
export type FingerIndex = 0 | 1 | 2 | 4 | 6 | 3 | 5 | 7 | 8 | 9 | 10 | 11;
|
65
|
+
export type FingerName = keyof typeof BodyPartNames;
|
66
|
+
|
67
|
+
export interface EventResult {
|
68
|
+
'export-face': BodyPart;
|
69
|
+
}
|
70
|
+
export type BryWebCollectorComponentEvent<K> = CustomEvent<K>;
|
71
|
+
|
72
|
+
// Once the web component fires events form itself instead of from the window, we can uncomment this
|
73
|
+
// export type BryWebCollectorComponentEventMap = HTMLElementEventMap &
|
74
|
+
// {
|
75
|
+
// [P in keyof EventResult]: BryWebCollectorComponentEvent<EventResult[P]>;
|
76
|
+
// };
|
77
|
+
|
78
|
+
export type exportFace = BryWebCollectorComponentEvent<BodyPart>;
|
79
|
+
export type faceUnconformitiesValidated = BryWebCollectorComponentEvent<{
|
80
|
+
bodyParts: BodyPart[];
|
81
|
+
errorCode?: string;
|
82
|
+
icaoWarnings?: string[];
|
83
|
+
status: requestResultEnum;
|
84
|
+
}>;
|
85
|
+
|
86
|
+
declare global {
|
87
|
+
interface BryWebCollectorComponent extends HTMLElement {
|
88
|
+
// And this
|
89
|
+
// addEventListener<K extends keyof BryWebCollectorComponentEventMap>(
|
90
|
+
// type: K,
|
91
|
+
// listener: (
|
92
|
+
// this: BryWebCollectorComponent,
|
93
|
+
// ev: BryWebCollectorComponentEventMap[K]
|
94
|
+
// ) => unknown,
|
95
|
+
// options?: boolean | AddEventListenerOptions
|
96
|
+
// ): void;
|
97
|
+
// removeEventListener<K extends keyof BryWebCollectorComponentEventMap>(
|
98
|
+
// type: K,
|
99
|
+
// listener: (
|
100
|
+
// this: BryWebCollectorComponent,
|
101
|
+
// ev: BryWebCollectorComponentEventMap[K]
|
102
|
+
// ) => unknown,
|
103
|
+
// options?: boolean | EventListenerOptions
|
104
|
+
// ): void;
|
105
|
+
|
106
|
+
// PROPS
|
107
|
+
[Props.EXTENSION_NAME]: string;
|
108
|
+
[Props.COLLECTOR_SELECT]: 'BOTH' | 'FINGERS' | 'FACE';
|
109
|
+
[Props.VIDEO_DIMENSIONS]: string;
|
110
|
+
[Props.ENABLE_MINUTIAE]: string;
|
111
|
+
[Props.WEIGHTS_PATH]: string;
|
112
|
+
[Props.LIVENESS_ENABLE]: string;
|
113
|
+
[Props.IMPORT_LOTTIE]: string;
|
114
|
+
[Props.HIDE_TABS]: string;
|
115
|
+
[Props.IMPORT_BRY_WEB_COLLECTOR_SCRIPT]: string;
|
116
|
+
/**
|
117
|
+
* Clears fingers and face, to make ready for a new collection.
|
118
|
+
* Will not clear jwtToken.
|
119
|
+
*/
|
120
|
+
reset(): void;
|
121
|
+
setCode(usrCode: string): this;
|
122
|
+
setBioAcJWTToken(token: string, bioacUrl: string, validateBiometricsUrl: string): this;
|
123
|
+
getJustification(): string;
|
124
|
+
/**
|
125
|
+
* Wether to send a finger-cleared message whenever the clear btn is clicked.
|
126
|
+
*
|
127
|
+
*/
|
128
|
+
setNotifyFingersCleared(newValue: boolean): this;
|
129
|
+
/**
|
130
|
+
* Sets the face collector component within the web component. This is required when changing tabs in the embedded application.
|
131
|
+
* This is required because of a svelte issue. The component's onDestroy never actually gets called and therefore the on mount
|
132
|
+
* doesn't get called so we have to compensate that here. Hopefully in svelte version 4 that issue will get fixed.
|
133
|
+
* */
|
134
|
+
setFaceCollectorComponent(): Promise<this>;
|
135
|
+
/**
|
136
|
+
* You may disable face Api in case your computer isn't powerful enough.
|
137
|
+
*/
|
138
|
+
setEnableFaceDetector(enabled: boolean): this;
|
139
|
+
/**
|
140
|
+
* You may define a list of fingers and their base64 values that can be captured.
|
141
|
+
* This forces the capture process to match the given finger at the given position, and stopping otherwise.
|
142
|
+
* Only works in wasm mode and requires agrAuthentication to be true
|
143
|
+
* @param _requiredFingers
|
144
|
+
*/
|
145
|
+
setRequiredFingers(
|
146
|
+
_requiredFingers: {
|
147
|
+
data: string;
|
148
|
+
bodyPart: FingerName;
|
149
|
+
}[]
|
150
|
+
): Promise<this>;
|
151
|
+
/**
|
152
|
+
* Sets pre collected fingers. The component will show the fingers as if they had
|
153
|
+
* been just collected.
|
154
|
+
*/
|
155
|
+
setCollectedFingers(
|
156
|
+
fingers: Array<{
|
157
|
+
bodyPart: number | BodyPartNames;
|
158
|
+
data: string;
|
159
|
+
img?: string;
|
160
|
+
nfiq?: number;
|
161
|
+
}>
|
162
|
+
): Promise<this>;
|
163
|
+
setLivenessEndpoint(url: string): this;
|
164
|
+
setEnableLiveness(nv: boolean): this;
|
165
|
+
setShowLivenessResultToast(nv: boolean): this;
|
166
|
+
verify(
|
167
|
+
missingFingers: Array<number | BodyPartNames>,
|
168
|
+
unavailableFingers: Array<number | BodyPartNames>,
|
169
|
+
automaticFingers: Array<number | BodyPartNames>,
|
170
|
+
code: string
|
171
|
+
): Promise<void>;
|
172
|
+
update(
|
173
|
+
missingFingers: Array<number | BodyPartNames>,
|
174
|
+
unavailableFingers: Array<number | BodyPartNames>,
|
175
|
+
automaticFingers: Array<number | BodyPartNames>,
|
176
|
+
code: string
|
177
|
+
): Promise<void>;
|
178
|
+
/**
|
179
|
+
* Sets up the component to perform an enroll according to the PSBIO rules
|
180
|
+
*/
|
181
|
+
enroll(code: string): Promise<void>;
|
182
|
+
verifyAgr(
|
183
|
+
missingFingers: Array<number | BodyPartNames>,
|
184
|
+
unavailableFingers: Array<number | BodyPartNames>,
|
185
|
+
automaticFingers: Array<number | BodyPartNames>,
|
186
|
+
blacklistedFingers: { data: string; bodyPart: FingerName }[],
|
187
|
+
code: string,
|
188
|
+
agrCode: string
|
189
|
+
): Promise<void>;
|
190
|
+
}
|
191
|
+
interface HTMLElementTagNameMap {
|
192
|
+
'biometric-collector': this;
|
193
|
+
}
|
194
|
+
interface WindowEventMap {
|
195
|
+
'export-face': exportFace;
|
196
|
+
'face-unconformities-validated': faceUnconformitiesValidated;
|
197
|
+
}
|
198
|
+
}
|
package/dist/index.js
ADDED