bry-biometric-collector 2.0.4 → 2.0.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.
@@ -1,6 +1,6 @@
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";
1
+ import { u as D, $ 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, m as X, o as w, p as $, q as G } from "./main_baf553c3_2.0.6.js";
2
2
  const d = D(C);
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 || {});
3
+ var V = /* @__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))(V || {});
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 = $(T);
76
+ const i = q(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 w, f, O, A, u, o = E.LOW_QUALITY;
103
+ let R, 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") && (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);
108
+ i.nfiqRating = e.quality, (e.quality > W() || e.status === "LOW_QUALITY") && (R = !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 || w || O || u || A || _) {
110
+ if (f || R || 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 = R();
122
+ const m = w();
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 = R();
130
+ const p = w();
131
131
  return { returnCode: o, bodyParts: p, message: t };
132
132
  }
133
- return S(c()), l(!1), G(), { returnCode: E.CAPTURED, bodyParts: R() };
133
+ return S(c()), l(!1), $(), { returnCode: E.CAPTURED, bodyParts: w() };
134
134
  }
135
- function $(n) {
136
- V();
135
+ function q(n) {
136
+ G();
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 $(n) {
141
141
  }
142
142
  export {
143
143
  s as CaptureApiError,
144
- q as CaptureErrorStatusEnum,
144
+ V as CaptureErrorStatusEnum,
145
145
  K as captureSingleFinger
146
146
  };
package/dist/index.d.ts CHANGED
@@ -32,7 +32,11 @@ export enum Props {
32
32
  LIVENESS_ENABLE = 'liveness_enable',
33
33
  IMPORT_LOTTIE = 'import_lottie',
34
34
  HIDE_TABS = 'hide_tabs',
35
- IMPORT_BRY_WEB_COLLECTOR_SCRIPT = 'import_bry_web_collector_script',
35
+ IMPORT_EXTENSION_SCRIPT = 'import_extension_script',
36
+ EXTENSION_URL_SCRIPT = 'extension_url_script',
37
+ EVALUATE_PHOTO = 'evaluate_photo',
38
+ SHOW_CAPTURE_BUTTON = 'show_capture_button',
39
+ SHOW_UNCONFORMITIES = 'show_unconformities',
36
40
  }
37
41
 
38
42
  export const enum BodyPartNames {
@@ -66,6 +70,7 @@ export type FingerName = keyof typeof BodyPartNames;
66
70
 
67
71
  export interface EventResult {
68
72
  'export-face': BodyPart;
73
+ 'export-document': BodyPart;
69
74
  }
70
75
  export type BryWebCollectorComponentEvent<K> = CustomEvent<K>;
71
76
 
@@ -76,12 +81,18 @@ export type BryWebCollectorComponentEvent<K> = CustomEvent<K>;
76
81
  // };
77
82
 
78
83
  export type exportFace = BryWebCollectorComponentEvent<BodyPart>;
84
+ export type exportDocument = BryWebCollectorComponentEvent<BodyPart>;
79
85
  export type faceUnconformitiesValidated = BryWebCollectorComponentEvent<{
80
86
  bodyParts: BodyPart[];
81
87
  errorCode?: string;
82
88
  icaoWarnings?: string[];
83
89
  status: requestResultEnum;
84
90
  }>;
91
+ export type documentUnconformitiesValidated = BryWebCollectorComponentEvent<{
92
+ bodyParts: BodyPart[];
93
+ errorCode?: string;
94
+ status: requestResultEnum;
95
+ }>;
85
96
 
86
97
  declare global {
87
98
  interface BryWebCollectorComponent extends HTMLElement {
@@ -105,14 +116,18 @@ declare global {
105
116
 
106
117
  // PROPS
107
118
  [Props.EXTENSION_NAME]: string;
108
- [Props.COLLECTOR_SELECT]: 'BOTH' | 'FINGERS' | 'FACE';
119
+ [Props.COLLECTOR_SELECT]: 'BOTH' | 'FINGERS' | 'FACE' | 'DOCUMENT';
109
120
  [Props.VIDEO_DIMENSIONS]: string;
110
121
  [Props.ENABLE_MINUTIAE]: string;
111
122
  [Props.WEIGHTS_PATH]: string;
112
123
  [Props.LIVENESS_ENABLE]: string;
113
124
  [Props.IMPORT_LOTTIE]: string;
114
125
  [Props.HIDE_TABS]: string;
115
- [Props.IMPORT_BRY_WEB_COLLECTOR_SCRIPT]: string;
126
+ [Props.IMPORT_EXTENSION_SCRIPT]: string;
127
+ [Props.EXTENSION_URL_SCRIPT]: string;
128
+ [Props.EVALUATE_PHOTO]: string;
129
+ [Props.SHOW_CAPTURE_BUTTON]: string;
130
+ [Props.SHOW_UNCONFORMITIES]: string;
116
131
  /**
117
132
  * Clears fingers and face, to make ready for a new collection.
118
133
  * Will not clear jwtToken.
@@ -193,6 +208,8 @@ declare global {
193
208
  }
194
209
  interface WindowEventMap {
195
210
  'export-face': exportFace;
211
+ 'export-document': exportDocument;
196
212
  'face-unconformities-validated': faceUnconformitiesValidated;
213
+ 'document-unconformities-validated': documentUnconformitiesValidated;
197
214
  }
198
215
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aY as f } from "./main_14ce11df_2.0.4.js";
1
+ import { aX as f } from "./main_baf553c3_2.0.6.js";
2
2
  export {
3
3
  f as default
4
4
  };