@regulaforensics/facesdk-webclient 7.2.294-nightly → 7.2.296-rc

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/index.js DELETED
@@ -1,3237 +0,0 @@
1
- function je(s, e) {
2
- return function() {
3
- return s.apply(e, arguments);
4
- };
5
- }
6
- const { toString: pt } = Object.prototype, { getPrototypeOf: ge } = Object, { iterator: ae, toStringTag: ke } = Symbol, ie = /* @__PURE__ */ ((s) => (e) => {
7
- const t = pt.call(e);
8
- return s[t] || (s[t] = t.slice(8, -1).toLowerCase());
9
- })(/* @__PURE__ */ Object.create(null)), U = (s) => (s = s.toLowerCase(), (e) => ie(e) === s), ce = (s) => (e) => typeof e === s, { isArray: q } = Array, K = ce("undefined");
10
- function ht(s) {
11
- return s !== null && !K(s) && s.constructor !== null && !K(s.constructor) && N(s.constructor.isBuffer) && s.constructor.isBuffer(s);
12
- }
13
- const ve = U("ArrayBuffer");
14
- function ft(s) {
15
- let e;
16
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(s) : e = s && s.buffer && ve(s.buffer), e;
17
- }
18
- const mt = ce("string"), N = ce("function"), ze = ce("number"), le = (s) => s !== null && typeof s == "object", Et = (s) => s === !0 || s === !1, ee = (s) => {
19
- if (ie(s) !== "object")
20
- return !1;
21
- const e = ge(s);
22
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(ke in s) && !(ae in s);
23
- }, At = U("Date"), Ot = U("File"), yt = U("Blob"), St = U("FileList"), Rt = (s) => le(s) && N(s.pipe), Pt = (s) => {
24
- let e;
25
- return s && (typeof FormData == "function" && s instanceof FormData || N(s.append) && ((e = ie(s)) === "formdata" || // detect form-data instance
26
- e === "object" && N(s.toString) && s.toString() === "[object FormData]"));
27
- }, gt = U("URLSearchParams"), [Tt, Ct, bt, _t] = ["ReadableStream", "Request", "Response", "Headers"].map(U), wt = (s) => s.trim ? s.trim() : s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
28
- function X(s, e, { allOwnKeys: t = !1 } = {}) {
29
- if (s === null || typeof s > "u")
30
- return;
31
- let r, n;
32
- if (typeof s != "object" && (s = [s]), q(s))
33
- for (r = 0, n = s.length; r < n; r++)
34
- e.call(null, s[r], r, s);
35
- else {
36
- const o = t ? Object.getOwnPropertyNames(s) : Object.keys(s), a = o.length;
37
- let i;
38
- for (r = 0; r < a; r++)
39
- i = o[r], e.call(null, s[i], i, s);
40
- }
41
- }
42
- function $e(s, e) {
43
- e = e.toLowerCase();
44
- const t = Object.keys(s);
45
- let r = t.length, n;
46
- for (; r-- > 0; )
47
- if (n = t[r], e === n.toLowerCase())
48
- return n;
49
- return null;
50
- }
51
- const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, qe = (s) => !K(s) && s !== j;
52
- function Ae() {
53
- const { caseless: s } = qe(this) && this || {}, e = {}, t = (r, n) => {
54
- const o = s && $e(e, n) || n;
55
- ee(e[o]) && ee(r) ? e[o] = Ae(e[o], r) : ee(r) ? e[o] = Ae({}, r) : q(r) ? e[o] = r.slice() : e[o] = r;
56
- };
57
- for (let r = 0, n = arguments.length; r < n; r++)
58
- arguments[r] && X(arguments[r], t);
59
- return e;
60
- }
61
- const It = (s, e, t, { allOwnKeys: r } = {}) => (X(e, (n, o) => {
62
- t && N(n) ? s[o] = je(n, t) : s[o] = n;
63
- }, { allOwnKeys: r }), s), Lt = (s) => (s.charCodeAt(0) === 65279 && (s = s.slice(1)), s), Nt = (s, e, t, r) => {
64
- s.prototype = Object.create(e.prototype, r), s.prototype.constructor = s, Object.defineProperty(s, "super", {
65
- value: e.prototype
66
- }), t && Object.assign(s.prototype, t);
67
- }, Ft = (s, e, t, r) => {
68
- let n, o, a;
69
- const i = {};
70
- if (e = e || {}, s == null) return e;
71
- do {
72
- for (n = Object.getOwnPropertyNames(s), o = n.length; o-- > 0; )
73
- a = n[o], (!r || r(a, s, e)) && !i[a] && (e[a] = s[a], i[a] = !0);
74
- s = t !== !1 && ge(s);
75
- } while (s && (!t || t(s, e)) && s !== Object.prototype);
76
- return e;
77
- }, Ut = (s, e, t) => {
78
- s = String(s), (t === void 0 || t > s.length) && (t = s.length), t -= e.length;
79
- const r = s.indexOf(e, t);
80
- return r !== -1 && r === t;
81
- }, Vt = (s) => {
82
- if (!s) return null;
83
- if (q(s)) return s;
84
- let e = s.length;
85
- if (!ze(e)) return null;
86
- const t = new Array(e);
87
- for (; e-- > 0; )
88
- t[e] = s[e];
89
- return t;
90
- }, Dt = /* @__PURE__ */ ((s) => (e) => s && e instanceof s)(typeof Uint8Array < "u" && ge(Uint8Array)), Gt = (s, e) => {
91
- const r = (s && s[ae]).call(s);
92
- let n;
93
- for (; (n = r.next()) && !n.done; ) {
94
- const o = n.value;
95
- e.call(s, o[0], o[1]);
96
- }
97
- }, Ht = (s, e) => {
98
- let t;
99
- const r = [];
100
- for (; (t = s.exec(e)) !== null; )
101
- r.push(t);
102
- return r;
103
- }, xt = U("HTMLFormElement"), Bt = (s) => s.toLowerCase().replace(
104
- /[-_\s]([a-z\d])(\w*)/g,
105
- function(t, r, n) {
106
- return r.toUpperCase() + n;
107
- }
108
- ), _e = (({ hasOwnProperty: s }) => (e, t) => s.call(e, t))(Object.prototype), Mt = U("RegExp"), Qe = (s, e) => {
109
- const t = Object.getOwnPropertyDescriptors(s), r = {};
110
- X(t, (n, o) => {
111
- let a;
112
- (a = e(n, o, s)) !== !1 && (r[o] = a || n);
113
- }), Object.defineProperties(s, r);
114
- }, jt = (s) => {
115
- Qe(s, (e, t) => {
116
- if (N(s) && ["arguments", "caller", "callee"].indexOf(t) !== -1)
117
- return !1;
118
- const r = s[t];
119
- if (N(r)) {
120
- if (e.enumerable = !1, "writable" in e) {
121
- e.writable = !1;
122
- return;
123
- }
124
- e.set || (e.set = () => {
125
- throw Error("Can not rewrite read-only method '" + t + "'");
126
- });
127
- }
128
- });
129
- }, kt = (s, e) => {
130
- const t = {}, r = (n) => {
131
- n.forEach((o) => {
132
- t[o] = !0;
133
- });
134
- };
135
- return q(s) ? r(s) : r(String(s).split(e)), t;
136
- }, vt = () => {
137
- }, zt = (s, e) => s != null && Number.isFinite(s = +s) ? s : e;
138
- function $t(s) {
139
- return !!(s && N(s.append) && s[ke] === "FormData" && s[ae]);
140
- }
141
- const qt = (s) => {
142
- const e = new Array(10), t = (r, n) => {
143
- if (le(r)) {
144
- if (e.indexOf(r) >= 0)
145
- return;
146
- if (!("toJSON" in r)) {
147
- e[n] = r;
148
- const o = q(r) ? [] : {};
149
- return X(r, (a, i) => {
150
- const c = t(a, n + 1);
151
- !K(c) && (o[i] = c);
152
- }), e[n] = void 0, o;
153
- }
154
- }
155
- return r;
156
- };
157
- return t(s, 0);
158
- }, Qt = U("AsyncFunction"), Wt = (s) => s && (le(s) || N(s)) && N(s.then) && N(s.catch), We = ((s, e) => s ? setImmediate : e ? ((t, r) => (j.addEventListener("message", ({ source: n, data: o }) => {
159
- n === j && o === t && r.length && r.shift()();
160
- }, !1), (n) => {
161
- r.push(n), j.postMessage(t, "*");
162
- }))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(
163
- typeof setImmediate == "function",
164
- N(j.postMessage)
165
- ), Kt = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || We, Xt = (s) => s != null && N(s[ae]), u = {
166
- isArray: q,
167
- isArrayBuffer: ve,
168
- isBuffer: ht,
169
- isFormData: Pt,
170
- isArrayBufferView: ft,
171
- isString: mt,
172
- isNumber: ze,
173
- isBoolean: Et,
174
- isObject: le,
175
- isPlainObject: ee,
176
- isReadableStream: Tt,
177
- isRequest: Ct,
178
- isResponse: bt,
179
- isHeaders: _t,
180
- isUndefined: K,
181
- isDate: At,
182
- isFile: Ot,
183
- isBlob: yt,
184
- isRegExp: Mt,
185
- isFunction: N,
186
- isStream: Rt,
187
- isURLSearchParams: gt,
188
- isTypedArray: Dt,
189
- isFileList: St,
190
- forEach: X,
191
- merge: Ae,
192
- extend: It,
193
- trim: wt,
194
- stripBOM: Lt,
195
- inherits: Nt,
196
- toFlatObject: Ft,
197
- kindOf: ie,
198
- kindOfTest: U,
199
- endsWith: Ut,
200
- toArray: Vt,
201
- forEachEntry: Gt,
202
- matchAll: Ht,
203
- isHTMLForm: xt,
204
- hasOwnProperty: _e,
205
- hasOwnProp: _e,
206
- // an alias to avoid ESLint no-prototype-builtins detection
207
- reduceDescriptors: Qe,
208
- freezeMethods: jt,
209
- toObjectSet: kt,
210
- toCamelCase: Bt,
211
- noop: vt,
212
- toFiniteNumber: zt,
213
- findKey: $e,
214
- global: j,
215
- isContextDefined: qe,
216
- isSpecCompliantForm: $t,
217
- toJSONObject: qt,
218
- isAsyncFn: Qt,
219
- isThenable: Wt,
220
- setImmediate: We,
221
- asap: Kt,
222
- isIterable: Xt
223
- };
224
- function E(s, e, t, r, n) {
225
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = s, this.name = "AxiosError", e && (this.code = e), t && (this.config = t), r && (this.request = r), n && (this.response = n, this.status = n.status ? n.status : null);
226
- }
227
- u.inherits(E, Error, {
228
- toJSON: function() {
229
- return {
230
- // Standard
231
- message: this.message,
232
- name: this.name,
233
- // Microsoft
234
- description: this.description,
235
- number: this.number,
236
- // Mozilla
237
- fileName: this.fileName,
238
- lineNumber: this.lineNumber,
239
- columnNumber: this.columnNumber,
240
- stack: this.stack,
241
- // Axios
242
- config: u.toJSONObject(this.config),
243
- code: this.code,
244
- status: this.status
245
- };
246
- }
247
- });
248
- const Ke = E.prototype, Xe = {};
249
- [
250
- "ERR_BAD_OPTION_VALUE",
251
- "ERR_BAD_OPTION",
252
- "ECONNABORTED",
253
- "ETIMEDOUT",
254
- "ERR_NETWORK",
255
- "ERR_FR_TOO_MANY_REDIRECTS",
256
- "ERR_DEPRECATED",
257
- "ERR_BAD_RESPONSE",
258
- "ERR_BAD_REQUEST",
259
- "ERR_CANCELED",
260
- "ERR_NOT_SUPPORT",
261
- "ERR_INVALID_URL"
262
- // eslint-disable-next-line func-names
263
- ].forEach((s) => {
264
- Xe[s] = { value: s };
265
- });
266
- Object.defineProperties(E, Xe);
267
- Object.defineProperty(Ke, "isAxiosError", { value: !0 });
268
- E.from = (s, e, t, r, n, o) => {
269
- const a = Object.create(Ke);
270
- return u.toFlatObject(s, a, function(c) {
271
- return c !== Error.prototype;
272
- }, (i) => i !== "isAxiosError"), E.call(a, s.message, e, t, r, n), a.cause = s, a.name = s.name, o && Object.assign(a, o), a;
273
- };
274
- const Jt = null;
275
- function Oe(s) {
276
- return u.isPlainObject(s) || u.isArray(s);
277
- }
278
- function Je(s) {
279
- return u.endsWith(s, "[]") ? s.slice(0, -2) : s;
280
- }
281
- function we(s, e, t) {
282
- return s ? s.concat(e).map(function(n, o) {
283
- return n = Je(n), !t && o ? "[" + n + "]" : n;
284
- }).join(t ? "." : "") : e;
285
- }
286
- function Yt(s) {
287
- return u.isArray(s) && !s.some(Oe);
288
- }
289
- const Zt = u.toFlatObject(u, {}, null, function(e) {
290
- return /^is[A-Z]/.test(e);
291
- });
292
- function ue(s, e, t) {
293
- if (!u.isObject(s))
294
- throw new TypeError("target must be an object");
295
- e = e || new FormData(), t = u.toFlatObject(t, {
296
- metaTokens: !0,
297
- dots: !1,
298
- indexes: !1
299
- }, !1, function(A, f) {
300
- return !u.isUndefined(f[A]);
301
- });
302
- const r = t.metaTokens, n = t.visitor || d, o = t.dots, a = t.indexes, c = (t.Blob || typeof Blob < "u" && Blob) && u.isSpecCompliantForm(e);
303
- if (!u.isFunction(n))
304
- throw new TypeError("visitor must be a function");
305
- function l(h) {
306
- if (h === null) return "";
307
- if (u.isDate(h))
308
- return h.toISOString();
309
- if (u.isBoolean(h))
310
- return h.toString();
311
- if (!c && u.isBlob(h))
312
- throw new E("Blob is not supported. Use a Buffer instead.");
313
- return u.isArrayBuffer(h) || u.isTypedArray(h) ? c && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
314
- }
315
- function d(h, A, f) {
316
- let C = h;
317
- if (h && !f && typeof h == "object") {
318
- if (u.endsWith(A, "{}"))
319
- A = r ? A : A.slice(0, -2), h = JSON.stringify(h);
320
- else if (u.isArray(h) && Yt(h) || (u.isFileList(h) || u.endsWith(A, "[]")) && (C = u.toArray(h)))
321
- return A = Je(A), C.forEach(function(w, G) {
322
- !(u.isUndefined(w) || w === null) && e.append(
323
- // eslint-disable-next-line no-nested-ternary
324
- a === !0 ? we([A], G, o) : a === null ? A : A + "[]",
325
- l(w)
326
- );
327
- }), !1;
328
- }
329
- return Oe(h) ? !0 : (e.append(we(f, A, o), l(h)), !1);
330
- }
331
- const p = [], O = Object.assign(Zt, {
332
- defaultVisitor: d,
333
- convertValue: l,
334
- isVisitable: Oe
335
- });
336
- function b(h, A) {
337
- if (!u.isUndefined(h)) {
338
- if (p.indexOf(h) !== -1)
339
- throw Error("Circular reference detected in " + A.join("."));
340
- p.push(h), u.forEach(h, function(C, _) {
341
- (!(u.isUndefined(C) || C === null) && n.call(
342
- e,
343
- C,
344
- u.isString(_) ? _.trim() : _,
345
- A,
346
- O
347
- )) === !0 && b(C, A ? A.concat(_) : [_]);
348
- }), p.pop();
349
- }
350
- }
351
- if (!u.isObject(s))
352
- throw new TypeError("data must be an object");
353
- return b(s), e;
354
- }
355
- function Ie(s) {
356
- const e = {
357
- "!": "%21",
358
- "'": "%27",
359
- "(": "%28",
360
- ")": "%29",
361
- "~": "%7E",
362
- "%20": "+",
363
- "%00": "\0"
364
- };
365
- return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g, function(r) {
366
- return e[r];
367
- });
368
- }
369
- function Te(s, e) {
370
- this._pairs = [], s && ue(s, this, e);
371
- }
372
- const Ye = Te.prototype;
373
- Ye.append = function(e, t) {
374
- this._pairs.push([e, t]);
375
- };
376
- Ye.toString = function(e) {
377
- const t = e ? function(r) {
378
- return e.call(this, r, Ie);
379
- } : Ie;
380
- return this._pairs.map(function(n) {
381
- return t(n[0]) + "=" + t(n[1]);
382
- }, "").join("&");
383
- };
384
- function es(s) {
385
- return encodeURIComponent(s).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
386
- }
387
- function Ze(s, e, t) {
388
- if (!e)
389
- return s;
390
- const r = t && t.encode || es;
391
- u.isFunction(t) && (t = {
392
- serialize: t
393
- });
394
- const n = t && t.serialize;
395
- let o;
396
- if (n ? o = n(e, t) : o = u.isURLSearchParams(e) ? e.toString() : new Te(e, t).toString(r), o) {
397
- const a = s.indexOf("#");
398
- a !== -1 && (s = s.slice(0, a)), s += (s.indexOf("?") === -1 ? "?" : "&") + o;
399
- }
400
- return s;
401
- }
402
- class Le {
403
- constructor() {
404
- this.handlers = [];
405
- }
406
- /**
407
- * Add a new interceptor to the stack
408
- *
409
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
410
- * @param {Function} rejected The function to handle `reject` for a `Promise`
411
- *
412
- * @return {Number} An ID used to remove interceptor later
413
- */
414
- use(e, t, r) {
415
- return this.handlers.push({
416
- fulfilled: e,
417
- rejected: t,
418
- synchronous: r ? r.synchronous : !1,
419
- runWhen: r ? r.runWhen : null
420
- }), this.handlers.length - 1;
421
- }
422
- /**
423
- * Remove an interceptor from the stack
424
- *
425
- * @param {Number} id The ID that was returned by `use`
426
- *
427
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
428
- */
429
- eject(e) {
430
- this.handlers[e] && (this.handlers[e] = null);
431
- }
432
- /**
433
- * Clear all interceptors from the stack
434
- *
435
- * @returns {void}
436
- */
437
- clear() {
438
- this.handlers && (this.handlers = []);
439
- }
440
- /**
441
- * Iterate over all the registered interceptors
442
- *
443
- * This method is particularly useful for skipping over any
444
- * interceptors that may have become `null` calling `eject`.
445
- *
446
- * @param {Function} fn The function to call for each interceptor
447
- *
448
- * @returns {void}
449
- */
450
- forEach(e) {
451
- u.forEach(this.handlers, function(r) {
452
- r !== null && e(r);
453
- });
454
- }
455
- }
456
- const et = {
457
- silentJSONParsing: !0,
458
- forcedJSONParsing: !0,
459
- clarifyTimeoutError: !1
460
- }, ts = typeof URLSearchParams < "u" ? URLSearchParams : Te, ss = typeof FormData < "u" ? FormData : null, rs = typeof Blob < "u" ? Blob : null, ns = {
461
- isBrowser: !0,
462
- classes: {
463
- URLSearchParams: ts,
464
- FormData: ss,
465
- Blob: rs
466
- },
467
- protocols: ["http", "https", "file", "blob", "url", "data"]
468
- }, Ce = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, os = Ce && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), as = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
469
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", is = Ce && window.location.href || "http://localhost", cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
470
- __proto__: null,
471
- hasBrowserEnv: Ce,
472
- hasStandardBrowserEnv: os,
473
- hasStandardBrowserWebWorkerEnv: as,
474
- navigator: ye,
475
- origin: is
476
- }, Symbol.toStringTag, { value: "Module" })), I = {
477
- ...cs,
478
- ...ns
479
- };
480
- function ls(s, e) {
481
- return ue(s, new I.classes.URLSearchParams(), Object.assign({
482
- visitor: function(t, r, n, o) {
483
- return I.isNode && u.isBuffer(t) ? (this.append(r, t.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
484
- }
485
- }, e));
486
- }
487
- function us(s) {
488
- return u.matchAll(/\w+|\[(\w*)]/g, s).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
489
- }
490
- function ds(s) {
491
- const e = {}, t = Object.keys(s);
492
- let r;
493
- const n = t.length;
494
- let o;
495
- for (r = 0; r < n; r++)
496
- o = t[r], e[o] = s[o];
497
- return e;
498
- }
499
- function tt(s) {
500
- function e(t, r, n, o) {
501
- let a = t[o++];
502
- if (a === "__proto__") return !0;
503
- const i = Number.isFinite(+a), c = o >= t.length;
504
- return a = !a && u.isArray(n) ? n.length : a, c ? (u.hasOwnProp(n, a) ? n[a] = [n[a], r] : n[a] = r, !i) : ((!n[a] || !u.isObject(n[a])) && (n[a] = []), e(t, r, n[a], o) && u.isArray(n[a]) && (n[a] = ds(n[a])), !i);
505
- }
506
- if (u.isFormData(s) && u.isFunction(s.entries)) {
507
- const t = {};
508
- return u.forEachEntry(s, (r, n) => {
509
- e(us(r), n, t, 0);
510
- }), t;
511
- }
512
- return null;
513
- }
514
- function ps(s, e, t) {
515
- if (u.isString(s))
516
- try {
517
- return (e || JSON.parse)(s), u.trim(s);
518
- } catch (r) {
519
- if (r.name !== "SyntaxError")
520
- throw r;
521
- }
522
- return (t || JSON.stringify)(s);
523
- }
524
- const J = {
525
- transitional: et,
526
- adapter: ["xhr", "http", "fetch"],
527
- transformRequest: [function(e, t) {
528
- const r = t.getContentType() || "", n = r.indexOf("application/json") > -1, o = u.isObject(e);
529
- if (o && u.isHTMLForm(e) && (e = new FormData(e)), u.isFormData(e))
530
- return n ? JSON.stringify(tt(e)) : e;
531
- if (u.isArrayBuffer(e) || u.isBuffer(e) || u.isStream(e) || u.isFile(e) || u.isBlob(e) || u.isReadableStream(e))
532
- return e;
533
- if (u.isArrayBufferView(e))
534
- return e.buffer;
535
- if (u.isURLSearchParams(e))
536
- return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
537
- let i;
538
- if (o) {
539
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
540
- return ls(e, this.formSerializer).toString();
541
- if ((i = u.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
542
- const c = this.env && this.env.FormData;
543
- return ue(
544
- i ? { "files[]": e } : e,
545
- c && new c(),
546
- this.formSerializer
547
- );
548
- }
549
- }
550
- return o || n ? (t.setContentType("application/json", !1), ps(e)) : e;
551
- }],
552
- transformResponse: [function(e) {
553
- const t = this.transitional || J.transitional, r = t && t.forcedJSONParsing, n = this.responseType === "json";
554
- if (u.isResponse(e) || u.isReadableStream(e))
555
- return e;
556
- if (e && u.isString(e) && (r && !this.responseType || n)) {
557
- const a = !(t && t.silentJSONParsing) && n;
558
- try {
559
- return JSON.parse(e);
560
- } catch (i) {
561
- if (a)
562
- throw i.name === "SyntaxError" ? E.from(i, E.ERR_BAD_RESPONSE, this, null, this.response) : i;
563
- }
564
- }
565
- return e;
566
- }],
567
- /**
568
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
569
- * timeout is not created.
570
- */
571
- timeout: 0,
572
- xsrfCookieName: "XSRF-TOKEN",
573
- xsrfHeaderName: "X-XSRF-TOKEN",
574
- maxContentLength: -1,
575
- maxBodyLength: -1,
576
- env: {
577
- FormData: I.classes.FormData,
578
- Blob: I.classes.Blob
579
- },
580
- validateStatus: function(e) {
581
- return e >= 200 && e < 300;
582
- },
583
- headers: {
584
- common: {
585
- Accept: "application/json, text/plain, */*",
586
- "Content-Type": void 0
587
- }
588
- }
589
- };
590
- u.forEach(["delete", "get", "head", "post", "put", "patch"], (s) => {
591
- J.headers[s] = {};
592
- });
593
- const hs = u.toObjectSet([
594
- "age",
595
- "authorization",
596
- "content-length",
597
- "content-type",
598
- "etag",
599
- "expires",
600
- "from",
601
- "host",
602
- "if-modified-since",
603
- "if-unmodified-since",
604
- "last-modified",
605
- "location",
606
- "max-forwards",
607
- "proxy-authorization",
608
- "referer",
609
- "retry-after",
610
- "user-agent"
611
- ]), fs = (s) => {
612
- const e = {};
613
- let t, r, n;
614
- return s && s.split(`
615
- `).forEach(function(a) {
616
- n = a.indexOf(":"), t = a.substring(0, n).trim().toLowerCase(), r = a.substring(n + 1).trim(), !(!t || e[t] && hs[t]) && (t === "set-cookie" ? e[t] ? e[t].push(r) : e[t] = [r] : e[t] = e[t] ? e[t] + ", " + r : r);
617
- }), e;
618
- }, Ne = Symbol("internals");
619
- function W(s) {
620
- return s && String(s).trim().toLowerCase();
621
- }
622
- function te(s) {
623
- return s === !1 || s == null ? s : u.isArray(s) ? s.map(te) : String(s);
624
- }
625
- function ms(s) {
626
- const e = /* @__PURE__ */ Object.create(null), t = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
627
- let r;
628
- for (; r = t.exec(s); )
629
- e[r[1]] = r[2];
630
- return e;
631
- }
632
- const Es = (s) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());
633
- function he(s, e, t, r, n) {
634
- if (u.isFunction(r))
635
- return r.call(this, e, t);
636
- if (n && (e = t), !!u.isString(e)) {
637
- if (u.isString(r))
638
- return e.indexOf(r) !== -1;
639
- if (u.isRegExp(r))
640
- return r.test(e);
641
- }
642
- }
643
- function As(s) {
644
- return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, r) => t.toUpperCase() + r);
645
- }
646
- function Os(s, e) {
647
- const t = u.toCamelCase(" " + e);
648
- ["get", "set", "has"].forEach((r) => {
649
- Object.defineProperty(s, r + t, {
650
- value: function(n, o, a) {
651
- return this[r].call(this, e, n, o, a);
652
- },
653
- configurable: !0
654
- });
655
- });
656
- }
657
- let F = class {
658
- constructor(e) {
659
- e && this.set(e);
660
- }
661
- set(e, t, r) {
662
- const n = this;
663
- function o(i, c, l) {
664
- const d = W(c);
665
- if (!d)
666
- throw new Error("header name must be a non-empty string");
667
- const p = u.findKey(n, d);
668
- (!p || n[p] === void 0 || l === !0 || l === void 0 && n[p] !== !1) && (n[p || c] = te(i));
669
- }
670
- const a = (i, c) => u.forEach(i, (l, d) => o(l, d, c));
671
- if (u.isPlainObject(e) || e instanceof this.constructor)
672
- a(e, t);
673
- else if (u.isString(e) && (e = e.trim()) && !Es(e))
674
- a(fs(e), t);
675
- else if (u.isObject(e) && u.isIterable(e)) {
676
- let i = {}, c, l;
677
- for (const d of e) {
678
- if (!u.isArray(d))
679
- throw TypeError("Object iterator must return a key-value pair");
680
- i[l = d[0]] = (c = i[l]) ? u.isArray(c) ? [...c, d[1]] : [c, d[1]] : d[1];
681
- }
682
- a(i, t);
683
- } else
684
- e != null && o(t, e, r);
685
- return this;
686
- }
687
- get(e, t) {
688
- if (e = W(e), e) {
689
- const r = u.findKey(this, e);
690
- if (r) {
691
- const n = this[r];
692
- if (!t)
693
- return n;
694
- if (t === !0)
695
- return ms(n);
696
- if (u.isFunction(t))
697
- return t.call(this, n, r);
698
- if (u.isRegExp(t))
699
- return t.exec(n);
700
- throw new TypeError("parser must be boolean|regexp|function");
701
- }
702
- }
703
- }
704
- has(e, t) {
705
- if (e = W(e), e) {
706
- const r = u.findKey(this, e);
707
- return !!(r && this[r] !== void 0 && (!t || he(this, this[r], r, t)));
708
- }
709
- return !1;
710
- }
711
- delete(e, t) {
712
- const r = this;
713
- let n = !1;
714
- function o(a) {
715
- if (a = W(a), a) {
716
- const i = u.findKey(r, a);
717
- i && (!t || he(r, r[i], i, t)) && (delete r[i], n = !0);
718
- }
719
- }
720
- return u.isArray(e) ? e.forEach(o) : o(e), n;
721
- }
722
- clear(e) {
723
- const t = Object.keys(this);
724
- let r = t.length, n = !1;
725
- for (; r--; ) {
726
- const o = t[r];
727
- (!e || he(this, this[o], o, e, !0)) && (delete this[o], n = !0);
728
- }
729
- return n;
730
- }
731
- normalize(e) {
732
- const t = this, r = {};
733
- return u.forEach(this, (n, o) => {
734
- const a = u.findKey(r, o);
735
- if (a) {
736
- t[a] = te(n), delete t[o];
737
- return;
738
- }
739
- const i = e ? As(o) : String(o).trim();
740
- i !== o && delete t[o], t[i] = te(n), r[i] = !0;
741
- }), this;
742
- }
743
- concat(...e) {
744
- return this.constructor.concat(this, ...e);
745
- }
746
- toJSON(e) {
747
- const t = /* @__PURE__ */ Object.create(null);
748
- return u.forEach(this, (r, n) => {
749
- r != null && r !== !1 && (t[n] = e && u.isArray(r) ? r.join(", ") : r);
750
- }), t;
751
- }
752
- [Symbol.iterator]() {
753
- return Object.entries(this.toJSON())[Symbol.iterator]();
754
- }
755
- toString() {
756
- return Object.entries(this.toJSON()).map(([e, t]) => e + ": " + t).join(`
757
- `);
758
- }
759
- getSetCookie() {
760
- return this.get("set-cookie") || [];
761
- }
762
- get [Symbol.toStringTag]() {
763
- return "AxiosHeaders";
764
- }
765
- static from(e) {
766
- return e instanceof this ? e : new this(e);
767
- }
768
- static concat(e, ...t) {
769
- const r = new this(e);
770
- return t.forEach((n) => r.set(n)), r;
771
- }
772
- static accessor(e) {
773
- const r = (this[Ne] = this[Ne] = {
774
- accessors: {}
775
- }).accessors, n = this.prototype;
776
- function o(a) {
777
- const i = W(a);
778
- r[i] || (Os(n, a), r[i] = !0);
779
- }
780
- return u.isArray(e) ? e.forEach(o) : o(e), this;
781
- }
782
- };
783
- F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
784
- u.reduceDescriptors(F.prototype, ({ value: s }, e) => {
785
- let t = e[0].toUpperCase() + e.slice(1);
786
- return {
787
- get: () => s,
788
- set(r) {
789
- this[t] = r;
790
- }
791
- };
792
- });
793
- u.freezeMethods(F);
794
- function fe(s, e) {
795
- const t = this || J, r = e || t, n = F.from(r.headers);
796
- let o = r.data;
797
- return u.forEach(s, function(i) {
798
- o = i.call(t, o, n.normalize(), e ? e.status : void 0);
799
- }), n.normalize(), o;
800
- }
801
- function st(s) {
802
- return !!(s && s.__CANCEL__);
803
- }
804
- function Q(s, e, t) {
805
- E.call(this, s ?? "canceled", E.ERR_CANCELED, e, t), this.name = "CanceledError";
806
- }
807
- u.inherits(Q, E, {
808
- __CANCEL__: !0
809
- });
810
- function rt(s, e, t) {
811
- const r = t.config.validateStatus;
812
- !t.status || !r || r(t.status) ? s(t) : e(new E(
813
- "Request failed with status code " + t.status,
814
- [E.ERR_BAD_REQUEST, E.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
815
- t.config,
816
- t.request,
817
- t
818
- ));
819
- }
820
- function ys(s) {
821
- const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(s);
822
- return e && e[1] || "";
823
- }
824
- function Ss(s, e) {
825
- s = s || 10;
826
- const t = new Array(s), r = new Array(s);
827
- let n = 0, o = 0, a;
828
- return e = e !== void 0 ? e : 1e3, function(c) {
829
- const l = Date.now(), d = r[o];
830
- a || (a = l), t[n] = c, r[n] = l;
831
- let p = o, O = 0;
832
- for (; p !== n; )
833
- O += t[p++], p = p % s;
834
- if (n = (n + 1) % s, n === o && (o = (o + 1) % s), l - a < e)
835
- return;
836
- const b = d && l - d;
837
- return b ? Math.round(O * 1e3 / b) : void 0;
838
- };
839
- }
840
- function Rs(s, e) {
841
- let t = 0, r = 1e3 / e, n, o;
842
- const a = (l, d = Date.now()) => {
843
- t = d, n = null, o && (clearTimeout(o), o = null), s.apply(null, l);
844
- };
845
- return [(...l) => {
846
- const d = Date.now(), p = d - t;
847
- p >= r ? a(l, d) : (n = l, o || (o = setTimeout(() => {
848
- o = null, a(n);
849
- }, r - p)));
850
- }, () => n && a(n)];
851
- }
852
- const re = (s, e, t = 3) => {
853
- let r = 0;
854
- const n = Ss(50, 250);
855
- return Rs((o) => {
856
- const a = o.loaded, i = o.lengthComputable ? o.total : void 0, c = a - r, l = n(c), d = a <= i;
857
- r = a;
858
- const p = {
859
- loaded: a,
860
- total: i,
861
- progress: i ? a / i : void 0,
862
- bytes: c,
863
- rate: l || void 0,
864
- estimated: l && i && d ? (i - a) / l : void 0,
865
- event: o,
866
- lengthComputable: i != null,
867
- [e ? "download" : "upload"]: !0
868
- };
869
- s(p);
870
- }, t);
871
- }, Fe = (s, e) => {
872
- const t = s != null;
873
- return [(r) => e[0]({
874
- lengthComputable: t,
875
- total: s,
876
- loaded: r
877
- }), e[1]];
878
- }, Ue = (s) => (...e) => u.asap(() => s(...e)), Ps = I.hasStandardBrowserEnv ? /* @__PURE__ */ ((s, e) => (t) => (t = new URL(t, I.origin), s.protocol === t.protocol && s.host === t.host && (e || s.port === t.port)))(
879
- new URL(I.origin),
880
- I.navigator && /(msie|trident)/i.test(I.navigator.userAgent)
881
- ) : () => !0, gs = I.hasStandardBrowserEnv ? (
882
- // Standard browser envs support document.cookie
883
- {
884
- write(s, e, t, r, n, o) {
885
- const a = [s + "=" + encodeURIComponent(e)];
886
- u.isNumber(t) && a.push("expires=" + new Date(t).toGMTString()), u.isString(r) && a.push("path=" + r), u.isString(n) && a.push("domain=" + n), o === !0 && a.push("secure"), document.cookie = a.join("; ");
887
- },
888
- read(s) {
889
- const e = document.cookie.match(new RegExp("(^|;\\s*)(" + s + ")=([^;]*)"));
890
- return e ? decodeURIComponent(e[3]) : null;
891
- },
892
- remove(s) {
893
- this.write(s, "", Date.now() - 864e5);
894
- }
895
- }
896
- ) : (
897
- // Non-standard browser env (web workers, react-native) lack needed support.
898
- {
899
- write() {
900
- },
901
- read() {
902
- return null;
903
- },
904
- remove() {
905
- }
906
- }
907
- );
908
- function Ts(s) {
909
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
910
- }
911
- function Cs(s, e) {
912
- return e ? s.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : s;
913
- }
914
- function nt(s, e, t) {
915
- let r = !Ts(e);
916
- return s && (r || t == !1) ? Cs(s, e) : e;
917
- }
918
- const Ve = (s) => s instanceof F ? { ...s } : s;
919
- function v(s, e) {
920
- e = e || {};
921
- const t = {};
922
- function r(l, d, p, O) {
923
- return u.isPlainObject(l) && u.isPlainObject(d) ? u.merge.call({ caseless: O }, l, d) : u.isPlainObject(d) ? u.merge({}, d) : u.isArray(d) ? d.slice() : d;
924
- }
925
- function n(l, d, p, O) {
926
- if (u.isUndefined(d)) {
927
- if (!u.isUndefined(l))
928
- return r(void 0, l, p, O);
929
- } else return r(l, d, p, O);
930
- }
931
- function o(l, d) {
932
- if (!u.isUndefined(d))
933
- return r(void 0, d);
934
- }
935
- function a(l, d) {
936
- if (u.isUndefined(d)) {
937
- if (!u.isUndefined(l))
938
- return r(void 0, l);
939
- } else return r(void 0, d);
940
- }
941
- function i(l, d, p) {
942
- if (p in e)
943
- return r(l, d);
944
- if (p in s)
945
- return r(void 0, l);
946
- }
947
- const c = {
948
- url: o,
949
- method: o,
950
- data: o,
951
- baseURL: a,
952
- transformRequest: a,
953
- transformResponse: a,
954
- paramsSerializer: a,
955
- timeout: a,
956
- timeoutMessage: a,
957
- withCredentials: a,
958
- withXSRFToken: a,
959
- adapter: a,
960
- responseType: a,
961
- xsrfCookieName: a,
962
- xsrfHeaderName: a,
963
- onUploadProgress: a,
964
- onDownloadProgress: a,
965
- decompress: a,
966
- maxContentLength: a,
967
- maxBodyLength: a,
968
- beforeRedirect: a,
969
- transport: a,
970
- httpAgent: a,
971
- httpsAgent: a,
972
- cancelToken: a,
973
- socketPath: a,
974
- responseEncoding: a,
975
- validateStatus: i,
976
- headers: (l, d, p) => n(Ve(l), Ve(d), p, !0)
977
- };
978
- return u.forEach(Object.keys(Object.assign({}, s, e)), function(d) {
979
- const p = c[d] || n, O = p(s[d], e[d], d);
980
- u.isUndefined(O) && p !== i || (t[d] = O);
981
- }), t;
982
- }
983
- const ot = (s) => {
984
- const e = v({}, s);
985
- let { data: t, withXSRFToken: r, xsrfHeaderName: n, xsrfCookieName: o, headers: a, auth: i } = e;
986
- e.headers = a = F.from(a), e.url = Ze(nt(e.baseURL, e.url, e.allowAbsoluteUrls), s.params, s.paramsSerializer), i && a.set(
987
- "Authorization",
988
- "Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
989
- );
990
- let c;
991
- if (u.isFormData(t)) {
992
- if (I.hasStandardBrowserEnv || I.hasStandardBrowserWebWorkerEnv)
993
- a.setContentType(void 0);
994
- else if ((c = a.getContentType()) !== !1) {
995
- const [l, ...d] = c ? c.split(";").map((p) => p.trim()).filter(Boolean) : [];
996
- a.setContentType([l || "multipart/form-data", ...d].join("; "));
997
- }
998
- }
999
- if (I.hasStandardBrowserEnv && (r && u.isFunction(r) && (r = r(e)), r || r !== !1 && Ps(e.url))) {
1000
- const l = n && o && gs.read(o);
1001
- l && a.set(n, l);
1002
- }
1003
- return e;
1004
- }, bs = typeof XMLHttpRequest < "u", _s = bs && function(s) {
1005
- return new Promise(function(t, r) {
1006
- const n = ot(s);
1007
- let o = n.data;
1008
- const a = F.from(n.headers).normalize();
1009
- let { responseType: i, onUploadProgress: c, onDownloadProgress: l } = n, d, p, O, b, h;
1010
- function A() {
1011
- b && b(), h && h(), n.cancelToken && n.cancelToken.unsubscribe(d), n.signal && n.signal.removeEventListener("abort", d);
1012
- }
1013
- let f = new XMLHttpRequest();
1014
- f.open(n.method.toUpperCase(), n.url, !0), f.timeout = n.timeout;
1015
- function C() {
1016
- if (!f)
1017
- return;
1018
- const w = F.from(
1019
- "getAllResponseHeaders" in f && f.getAllResponseHeaders()
1020
- ), L = {
1021
- data: !i || i === "text" || i === "json" ? f.responseText : f.response,
1022
- status: f.status,
1023
- statusText: f.statusText,
1024
- headers: w,
1025
- config: s,
1026
- request: f
1027
- };
1028
- rt(function(B) {
1029
- t(B), A();
1030
- }, function(B) {
1031
- r(B), A();
1032
- }, L), f = null;
1033
- }
1034
- "onloadend" in f ? f.onloadend = C : f.onreadystatechange = function() {
1035
- !f || f.readyState !== 4 || f.status === 0 && !(f.responseURL && f.responseURL.indexOf("file:") === 0) || setTimeout(C);
1036
- }, f.onabort = function() {
1037
- f && (r(new E("Request aborted", E.ECONNABORTED, s, f)), f = null);
1038
- }, f.onerror = function() {
1039
- r(new E("Network Error", E.ERR_NETWORK, s, f)), f = null;
1040
- }, f.ontimeout = function() {
1041
- let G = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
1042
- const L = n.transitional || et;
1043
- n.timeoutErrorMessage && (G = n.timeoutErrorMessage), r(new E(
1044
- G,
1045
- L.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
1046
- s,
1047
- f
1048
- )), f = null;
1049
- }, o === void 0 && a.setContentType(null), "setRequestHeader" in f && u.forEach(a.toJSON(), function(G, L) {
1050
- f.setRequestHeader(L, G);
1051
- }), u.isUndefined(n.withCredentials) || (f.withCredentials = !!n.withCredentials), i && i !== "json" && (f.responseType = n.responseType), l && ([O, h] = re(l, !0), f.addEventListener("progress", O)), c && f.upload && ([p, b] = re(c), f.upload.addEventListener("progress", p), f.upload.addEventListener("loadend", b)), (n.cancelToken || n.signal) && (d = (w) => {
1052
- f && (r(!w || w.type ? new Q(null, s, f) : w), f.abort(), f = null);
1053
- }, n.cancelToken && n.cancelToken.subscribe(d), n.signal && (n.signal.aborted ? d() : n.signal.addEventListener("abort", d)));
1054
- const _ = ys(n.url);
1055
- if (_ && I.protocols.indexOf(_) === -1) {
1056
- r(new E("Unsupported protocol " + _ + ":", E.ERR_BAD_REQUEST, s));
1057
- return;
1058
- }
1059
- f.send(o || null);
1060
- });
1061
- }, ws = (s, e) => {
1062
- const { length: t } = s = s ? s.filter(Boolean) : [];
1063
- if (e || t) {
1064
- let r = new AbortController(), n;
1065
- const o = function(l) {
1066
- if (!n) {
1067
- n = !0, i();
1068
- const d = l instanceof Error ? l : this.reason;
1069
- r.abort(d instanceof E ? d : new Q(d instanceof Error ? d.message : d));
1070
- }
1071
- };
1072
- let a = e && setTimeout(() => {
1073
- a = null, o(new E(`timeout ${e} of ms exceeded`, E.ETIMEDOUT));
1074
- }, e);
1075
- const i = () => {
1076
- s && (a && clearTimeout(a), a = null, s.forEach((l) => {
1077
- l.unsubscribe ? l.unsubscribe(o) : l.removeEventListener("abort", o);
1078
- }), s = null);
1079
- };
1080
- s.forEach((l) => l.addEventListener("abort", o));
1081
- const { signal: c } = r;
1082
- return c.unsubscribe = () => u.asap(i), c;
1083
- }
1084
- }, Is = function* (s, e) {
1085
- let t = s.byteLength;
1086
- if (t < e) {
1087
- yield s;
1088
- return;
1089
- }
1090
- let r = 0, n;
1091
- for (; r < t; )
1092
- n = r + e, yield s.slice(r, n), r = n;
1093
- }, Ls = async function* (s, e) {
1094
- for await (const t of Ns(s))
1095
- yield* Is(t, e);
1096
- }, Ns = async function* (s) {
1097
- if (s[Symbol.asyncIterator]) {
1098
- yield* s;
1099
- return;
1100
- }
1101
- const e = s.getReader();
1102
- try {
1103
- for (; ; ) {
1104
- const { done: t, value: r } = await e.read();
1105
- if (t)
1106
- break;
1107
- yield r;
1108
- }
1109
- } finally {
1110
- await e.cancel();
1111
- }
1112
- }, De = (s, e, t, r) => {
1113
- const n = Ls(s, e);
1114
- let o = 0, a, i = (c) => {
1115
- a || (a = !0, r && r(c));
1116
- };
1117
- return new ReadableStream({
1118
- async pull(c) {
1119
- try {
1120
- const { done: l, value: d } = await n.next();
1121
- if (l) {
1122
- i(), c.close();
1123
- return;
1124
- }
1125
- let p = d.byteLength;
1126
- if (t) {
1127
- let O = o += p;
1128
- t(O);
1129
- }
1130
- c.enqueue(new Uint8Array(d));
1131
- } catch (l) {
1132
- throw i(l), l;
1133
- }
1134
- },
1135
- cancel(c) {
1136
- return i(c), n.return();
1137
- }
1138
- }, {
1139
- highWaterMark: 2
1140
- });
1141
- }, de = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", at = de && typeof ReadableStream == "function", Fs = de && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((s) => (e) => s.encode(e))(new TextEncoder()) : async (s) => new Uint8Array(await new Response(s).arrayBuffer())), it = (s, ...e) => {
1142
- try {
1143
- return !!s(...e);
1144
- } catch {
1145
- return !1;
1146
- }
1147
- }, Us = at && it(() => {
1148
- let s = !1;
1149
- const e = new Request(I.origin, {
1150
- body: new ReadableStream(),
1151
- method: "POST",
1152
- get duplex() {
1153
- return s = !0, "half";
1154
- }
1155
- }).headers.has("Content-Type");
1156
- return s && !e;
1157
- }), Ge = 64 * 1024, Se = at && it(() => u.isReadableStream(new Response("").body)), ne = {
1158
- stream: Se && ((s) => s.body)
1159
- };
1160
- de && ((s) => {
1161
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
1162
- !ne[e] && (ne[e] = u.isFunction(s[e]) ? (t) => t[e]() : (t, r) => {
1163
- throw new E(`Response type '${e}' is not supported`, E.ERR_NOT_SUPPORT, r);
1164
- });
1165
- });
1166
- })(new Response());
1167
- const Vs = async (s) => {
1168
- if (s == null)
1169
- return 0;
1170
- if (u.isBlob(s))
1171
- return s.size;
1172
- if (u.isSpecCompliantForm(s))
1173
- return (await new Request(I.origin, {
1174
- method: "POST",
1175
- body: s
1176
- }).arrayBuffer()).byteLength;
1177
- if (u.isArrayBufferView(s) || u.isArrayBuffer(s))
1178
- return s.byteLength;
1179
- if (u.isURLSearchParams(s) && (s = s + ""), u.isString(s))
1180
- return (await Fs(s)).byteLength;
1181
- }, Ds = async (s, e) => {
1182
- const t = u.toFiniteNumber(s.getContentLength());
1183
- return t ?? Vs(e);
1184
- }, Gs = de && (async (s) => {
1185
- let {
1186
- url: e,
1187
- method: t,
1188
- data: r,
1189
- signal: n,
1190
- cancelToken: o,
1191
- timeout: a,
1192
- onDownloadProgress: i,
1193
- onUploadProgress: c,
1194
- responseType: l,
1195
- headers: d,
1196
- withCredentials: p = "same-origin",
1197
- fetchOptions: O
1198
- } = ot(s);
1199
- l = l ? (l + "").toLowerCase() : "text";
1200
- let b = ws([n, o && o.toAbortSignal()], a), h;
1201
- const A = b && b.unsubscribe && (() => {
1202
- b.unsubscribe();
1203
- });
1204
- let f;
1205
- try {
1206
- if (c && Us && t !== "get" && t !== "head" && (f = await Ds(d, r)) !== 0) {
1207
- let L = new Request(e, {
1208
- method: "POST",
1209
- body: r,
1210
- duplex: "half"
1211
- }), x;
1212
- if (u.isFormData(r) && (x = L.headers.get("content-type")) && d.setContentType(x), L.body) {
1213
- const [B, Y] = Fe(
1214
- f,
1215
- re(Ue(c))
1216
- );
1217
- r = De(L.body, Ge, B, Y);
1218
- }
1219
- }
1220
- u.isString(p) || (p = p ? "include" : "omit");
1221
- const C = "credentials" in Request.prototype;
1222
- h = new Request(e, {
1223
- ...O,
1224
- signal: b,
1225
- method: t.toUpperCase(),
1226
- headers: d.normalize().toJSON(),
1227
- body: r,
1228
- duplex: "half",
1229
- credentials: C ? p : void 0
1230
- });
1231
- let _ = await fetch(h, O);
1232
- const w = Se && (l === "stream" || l === "response");
1233
- if (Se && (i || w && A)) {
1234
- const L = {};
1235
- ["status", "statusText", "headers"].forEach((be) => {
1236
- L[be] = _[be];
1237
- });
1238
- const x = u.toFiniteNumber(_.headers.get("content-length")), [B, Y] = i && Fe(
1239
- x,
1240
- re(Ue(i), !0)
1241
- ) || [];
1242
- _ = new Response(
1243
- De(_.body, Ge, B, () => {
1244
- Y && Y(), A && A();
1245
- }),
1246
- L
1247
- );
1248
- }
1249
- l = l || "text";
1250
- let G = await ne[u.findKey(ne, l) || "text"](_, s);
1251
- return !w && A && A(), await new Promise((L, x) => {
1252
- rt(L, x, {
1253
- data: G,
1254
- headers: F.from(_.headers),
1255
- status: _.status,
1256
- statusText: _.statusText,
1257
- config: s,
1258
- request: h
1259
- });
1260
- });
1261
- } catch (C) {
1262
- throw A && A(), C && C.name === "TypeError" && /Load failed|fetch/i.test(C.message) ? Object.assign(
1263
- new E("Network Error", E.ERR_NETWORK, s, h),
1264
- {
1265
- cause: C.cause || C
1266
- }
1267
- ) : E.from(C, C && C.code, s, h);
1268
- }
1269
- }), Re = {
1270
- http: Jt,
1271
- xhr: _s,
1272
- fetch: Gs
1273
- };
1274
- u.forEach(Re, (s, e) => {
1275
- if (s) {
1276
- try {
1277
- Object.defineProperty(s, "name", { value: e });
1278
- } catch {
1279
- }
1280
- Object.defineProperty(s, "adapterName", { value: e });
1281
- }
1282
- });
1283
- const He = (s) => `- ${s}`, Hs = (s) => u.isFunction(s) || s === null || s === !1, ct = {
1284
- getAdapter: (s) => {
1285
- s = u.isArray(s) ? s : [s];
1286
- const { length: e } = s;
1287
- let t, r;
1288
- const n = {};
1289
- for (let o = 0; o < e; o++) {
1290
- t = s[o];
1291
- let a;
1292
- if (r = t, !Hs(t) && (r = Re[(a = String(t)).toLowerCase()], r === void 0))
1293
- throw new E(`Unknown adapter '${a}'`);
1294
- if (r)
1295
- break;
1296
- n[a || "#" + o] = r;
1297
- }
1298
- if (!r) {
1299
- const o = Object.entries(n).map(
1300
- ([i, c]) => `adapter ${i} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build")
1301
- );
1302
- let a = e ? o.length > 1 ? `since :
1303
- ` + o.map(He).join(`
1304
- `) : " " + He(o[0]) : "as no adapter specified";
1305
- throw new E(
1306
- "There is no suitable adapter to dispatch the request " + a,
1307
- "ERR_NOT_SUPPORT"
1308
- );
1309
- }
1310
- return r;
1311
- },
1312
- adapters: Re
1313
- };
1314
- function me(s) {
1315
- if (s.cancelToken && s.cancelToken.throwIfRequested(), s.signal && s.signal.aborted)
1316
- throw new Q(null, s);
1317
- }
1318
- function xe(s) {
1319
- return me(s), s.headers = F.from(s.headers), s.data = fe.call(
1320
- s,
1321
- s.transformRequest
1322
- ), ["post", "put", "patch"].indexOf(s.method) !== -1 && s.headers.setContentType("application/x-www-form-urlencoded", !1), ct.getAdapter(s.adapter || J.adapter)(s).then(function(r) {
1323
- return me(s), r.data = fe.call(
1324
- s,
1325
- s.transformResponse,
1326
- r
1327
- ), r.headers = F.from(r.headers), r;
1328
- }, function(r) {
1329
- return st(r) || (me(s), r && r.response && (r.response.data = fe.call(
1330
- s,
1331
- s.transformResponse,
1332
- r.response
1333
- ), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
1334
- });
1335
- }
1336
- const lt = "1.10.0", pe = {};
1337
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((s, e) => {
1338
- pe[s] = function(r) {
1339
- return typeof r === s || "a" + (e < 1 ? "n " : " ") + s;
1340
- };
1341
- });
1342
- const Be = {};
1343
- pe.transitional = function(e, t, r) {
1344
- function n(o, a) {
1345
- return "[Axios v" + lt + "] Transitional option '" + o + "'" + a + (r ? ". " + r : "");
1346
- }
1347
- return (o, a, i) => {
1348
- if (e === !1)
1349
- throw new E(
1350
- n(a, " has been removed" + (t ? " in " + t : "")),
1351
- E.ERR_DEPRECATED
1352
- );
1353
- return t && !Be[a] && (Be[a] = !0, console.warn(
1354
- n(
1355
- a,
1356
- " has been deprecated since v" + t + " and will be removed in the near future"
1357
- )
1358
- )), e ? e(o, a, i) : !0;
1359
- };
1360
- };
1361
- pe.spelling = function(e) {
1362
- return (t, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
1363
- };
1364
- function xs(s, e, t) {
1365
- if (typeof s != "object")
1366
- throw new E("options must be an object", E.ERR_BAD_OPTION_VALUE);
1367
- const r = Object.keys(s);
1368
- let n = r.length;
1369
- for (; n-- > 0; ) {
1370
- const o = r[n], a = e[o];
1371
- if (a) {
1372
- const i = s[o], c = i === void 0 || a(i, o, s);
1373
- if (c !== !0)
1374
- throw new E("option " + o + " must be " + c, E.ERR_BAD_OPTION_VALUE);
1375
- continue;
1376
- }
1377
- if (t !== !0)
1378
- throw new E("Unknown option " + o, E.ERR_BAD_OPTION);
1379
- }
1380
- }
1381
- const se = {
1382
- assertOptions: xs,
1383
- validators: pe
1384
- }, V = se.validators;
1385
- let k = class {
1386
- constructor(e) {
1387
- this.defaults = e || {}, this.interceptors = {
1388
- request: new Le(),
1389
- response: new Le()
1390
- };
1391
- }
1392
- /**
1393
- * Dispatch a request
1394
- *
1395
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1396
- * @param {?Object} config
1397
- *
1398
- * @returns {Promise} The Promise to be fulfilled
1399
- */
1400
- async request(e, t) {
1401
- try {
1402
- return await this._request(e, t);
1403
- } catch (r) {
1404
- if (r instanceof Error) {
1405
- let n = {};
1406
- Error.captureStackTrace ? Error.captureStackTrace(n) : n = new Error();
1407
- const o = n.stack ? n.stack.replace(/^.+\n/, "") : "";
1408
- try {
1409
- r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1410
- ` + o) : r.stack = o;
1411
- } catch {
1412
- }
1413
- }
1414
- throw r;
1415
- }
1416
- }
1417
- _request(e, t) {
1418
- typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = v(this.defaults, t);
1419
- const { transitional: r, paramsSerializer: n, headers: o } = t;
1420
- r !== void 0 && se.assertOptions(r, {
1421
- silentJSONParsing: V.transitional(V.boolean),
1422
- forcedJSONParsing: V.transitional(V.boolean),
1423
- clarifyTimeoutError: V.transitional(V.boolean)
1424
- }, !1), n != null && (u.isFunction(n) ? t.paramsSerializer = {
1425
- serialize: n
1426
- } : se.assertOptions(n, {
1427
- encode: V.function,
1428
- serialize: V.function
1429
- }, !0)), t.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? t.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : t.allowAbsoluteUrls = !0), se.assertOptions(t, {
1430
- baseUrl: V.spelling("baseURL"),
1431
- withXsrfToken: V.spelling("withXSRFToken")
1432
- }, !0), t.method = (t.method || this.defaults.method || "get").toLowerCase();
1433
- let a = o && u.merge(
1434
- o.common,
1435
- o[t.method]
1436
- );
1437
- o && u.forEach(
1438
- ["delete", "get", "head", "post", "put", "patch", "common"],
1439
- (h) => {
1440
- delete o[h];
1441
- }
1442
- ), t.headers = F.concat(a, o);
1443
- const i = [];
1444
- let c = !0;
1445
- this.interceptors.request.forEach(function(A) {
1446
- typeof A.runWhen == "function" && A.runWhen(t) === !1 || (c = c && A.synchronous, i.unshift(A.fulfilled, A.rejected));
1447
- });
1448
- const l = [];
1449
- this.interceptors.response.forEach(function(A) {
1450
- l.push(A.fulfilled, A.rejected);
1451
- });
1452
- let d, p = 0, O;
1453
- if (!c) {
1454
- const h = [xe.bind(this), void 0];
1455
- for (h.unshift.apply(h, i), h.push.apply(h, l), O = h.length, d = Promise.resolve(t); p < O; )
1456
- d = d.then(h[p++], h[p++]);
1457
- return d;
1458
- }
1459
- O = i.length;
1460
- let b = t;
1461
- for (p = 0; p < O; ) {
1462
- const h = i[p++], A = i[p++];
1463
- try {
1464
- b = h(b);
1465
- } catch (f) {
1466
- A.call(this, f);
1467
- break;
1468
- }
1469
- }
1470
- try {
1471
- d = xe.call(this, b);
1472
- } catch (h) {
1473
- return Promise.reject(h);
1474
- }
1475
- for (p = 0, O = l.length; p < O; )
1476
- d = d.then(l[p++], l[p++]);
1477
- return d;
1478
- }
1479
- getUri(e) {
1480
- e = v(this.defaults, e);
1481
- const t = nt(e.baseURL, e.url, e.allowAbsoluteUrls);
1482
- return Ze(t, e.params, e.paramsSerializer);
1483
- }
1484
- };
1485
- u.forEach(["delete", "get", "head", "options"], function(e) {
1486
- k.prototype[e] = function(t, r) {
1487
- return this.request(v(r || {}, {
1488
- method: e,
1489
- url: t,
1490
- data: (r || {}).data
1491
- }));
1492
- };
1493
- });
1494
- u.forEach(["post", "put", "patch"], function(e) {
1495
- function t(r) {
1496
- return function(o, a, i) {
1497
- return this.request(v(i || {}, {
1498
- method: e,
1499
- headers: r ? {
1500
- "Content-Type": "multipart/form-data"
1501
- } : {},
1502
- url: o,
1503
- data: a
1504
- }));
1505
- };
1506
- }
1507
- k.prototype[e] = t(), k.prototype[e + "Form"] = t(!0);
1508
- });
1509
- let Bs = class ut {
1510
- constructor(e) {
1511
- if (typeof e != "function")
1512
- throw new TypeError("executor must be a function.");
1513
- let t;
1514
- this.promise = new Promise(function(o) {
1515
- t = o;
1516
- });
1517
- const r = this;
1518
- this.promise.then((n) => {
1519
- if (!r._listeners) return;
1520
- let o = r._listeners.length;
1521
- for (; o-- > 0; )
1522
- r._listeners[o](n);
1523
- r._listeners = null;
1524
- }), this.promise.then = (n) => {
1525
- let o;
1526
- const a = new Promise((i) => {
1527
- r.subscribe(i), o = i;
1528
- }).then(n);
1529
- return a.cancel = function() {
1530
- r.unsubscribe(o);
1531
- }, a;
1532
- }, e(function(o, a, i) {
1533
- r.reason || (r.reason = new Q(o, a, i), t(r.reason));
1534
- });
1535
- }
1536
- /**
1537
- * Throws a `CanceledError` if cancellation has been requested.
1538
- */
1539
- throwIfRequested() {
1540
- if (this.reason)
1541
- throw this.reason;
1542
- }
1543
- /**
1544
- * Subscribe to the cancel signal
1545
- */
1546
- subscribe(e) {
1547
- if (this.reason) {
1548
- e(this.reason);
1549
- return;
1550
- }
1551
- this._listeners ? this._listeners.push(e) : this._listeners = [e];
1552
- }
1553
- /**
1554
- * Unsubscribe from the cancel signal
1555
- */
1556
- unsubscribe(e) {
1557
- if (!this._listeners)
1558
- return;
1559
- const t = this._listeners.indexOf(e);
1560
- t !== -1 && this._listeners.splice(t, 1);
1561
- }
1562
- toAbortSignal() {
1563
- const e = new AbortController(), t = (r) => {
1564
- e.abort(r);
1565
- };
1566
- return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
1567
- }
1568
- /**
1569
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1570
- * cancels the `CancelToken`.
1571
- */
1572
- static source() {
1573
- let e;
1574
- return {
1575
- token: new ut(function(n) {
1576
- e = n;
1577
- }),
1578
- cancel: e
1579
- };
1580
- }
1581
- };
1582
- function Ms(s) {
1583
- return function(t) {
1584
- return s.apply(null, t);
1585
- };
1586
- }
1587
- function js(s) {
1588
- return u.isObject(s) && s.isAxiosError === !0;
1589
- }
1590
- const Pe = {
1591
- Continue: 100,
1592
- SwitchingProtocols: 101,
1593
- Processing: 102,
1594
- EarlyHints: 103,
1595
- Ok: 200,
1596
- Created: 201,
1597
- Accepted: 202,
1598
- NonAuthoritativeInformation: 203,
1599
- NoContent: 204,
1600
- ResetContent: 205,
1601
- PartialContent: 206,
1602
- MultiStatus: 207,
1603
- AlreadyReported: 208,
1604
- ImUsed: 226,
1605
- MultipleChoices: 300,
1606
- MovedPermanently: 301,
1607
- Found: 302,
1608
- SeeOther: 303,
1609
- NotModified: 304,
1610
- UseProxy: 305,
1611
- Unused: 306,
1612
- TemporaryRedirect: 307,
1613
- PermanentRedirect: 308,
1614
- BadRequest: 400,
1615
- Unauthorized: 401,
1616
- PaymentRequired: 402,
1617
- Forbidden: 403,
1618
- NotFound: 404,
1619
- MethodNotAllowed: 405,
1620
- NotAcceptable: 406,
1621
- ProxyAuthenticationRequired: 407,
1622
- RequestTimeout: 408,
1623
- Conflict: 409,
1624
- Gone: 410,
1625
- LengthRequired: 411,
1626
- PreconditionFailed: 412,
1627
- PayloadTooLarge: 413,
1628
- UriTooLong: 414,
1629
- UnsupportedMediaType: 415,
1630
- RangeNotSatisfiable: 416,
1631
- ExpectationFailed: 417,
1632
- ImATeapot: 418,
1633
- MisdirectedRequest: 421,
1634
- UnprocessableEntity: 422,
1635
- Locked: 423,
1636
- FailedDependency: 424,
1637
- TooEarly: 425,
1638
- UpgradeRequired: 426,
1639
- PreconditionRequired: 428,
1640
- TooManyRequests: 429,
1641
- RequestHeaderFieldsTooLarge: 431,
1642
- UnavailableForLegalReasons: 451,
1643
- InternalServerError: 500,
1644
- NotImplemented: 501,
1645
- BadGateway: 502,
1646
- ServiceUnavailable: 503,
1647
- GatewayTimeout: 504,
1648
- HttpVersionNotSupported: 505,
1649
- VariantAlsoNegotiates: 506,
1650
- InsufficientStorage: 507,
1651
- LoopDetected: 508,
1652
- NotExtended: 510,
1653
- NetworkAuthenticationRequired: 511
1654
- };
1655
- Object.entries(Pe).forEach(([s, e]) => {
1656
- Pe[e] = s;
1657
- });
1658
- function dt(s) {
1659
- const e = new k(s), t = je(k.prototype.request, e);
1660
- return u.extend(t, k.prototype, e, { allOwnKeys: !0 }), u.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(n) {
1661
- return dt(v(s, n));
1662
- }, t;
1663
- }
1664
- const m = dt(J);
1665
- m.Axios = k;
1666
- m.CanceledError = Q;
1667
- m.CancelToken = Bs;
1668
- m.isCancel = st;
1669
- m.VERSION = lt;
1670
- m.toFormData = ue;
1671
- m.AxiosError = E;
1672
- m.Cancel = m.CanceledError;
1673
- m.all = function(e) {
1674
- return Promise.all(e);
1675
- };
1676
- m.spread = Ms;
1677
- m.isAxiosError = js;
1678
- m.mergeConfig = v;
1679
- m.AxiosHeaders = F;
1680
- m.formToJSON = (s) => tt(u.isHTMLForm(s) ? new FormData(s) : s);
1681
- m.getAdapter = ct.getAdapter;
1682
- m.HttpStatusCode = Pe;
1683
- m.default = m;
1684
- const {
1685
- Axios: Er,
1686
- AxiosError: Ar,
1687
- CanceledError: Or,
1688
- isCancel: yr,
1689
- CancelToken: Sr,
1690
- VERSION: Rr,
1691
- all: Pr,
1692
- Cancel: gr,
1693
- isAxiosError: Tr,
1694
- spread: Cr,
1695
- toFormData: br,
1696
- AxiosHeaders: _r,
1697
- HttpStatusCode: wr,
1698
- formToJSON: Ir,
1699
- getAdapter: Lr,
1700
- mergeConfig: Nr
1701
- } = m, S = "http://localhost:41101".replace(/\/+$/, "");
1702
- class z {
1703
- constructor(e, t = S, r = m) {
1704
- this.basePath = t, this.axios = r, e && (this.configuration = e, this.basePath = e.basePath || this.basePath);
1705
- }
1706
- }
1707
- class ks extends Error {
1708
- constructor(e, t) {
1709
- super(t), this.field = e, this.name = "RequiredError";
1710
- }
1711
- }
1712
- const R = "https://example.com", y = function(s, e, t) {
1713
- if (t == null)
1714
- throw new ks(e, `Required parameter ${e} was null or undefined when calling ${s}.`);
1715
- }, P = function(s, ...e) {
1716
- const t = new URLSearchParams(s.search);
1717
- for (const r of e)
1718
- for (const n in r)
1719
- if (Array.isArray(r[n])) {
1720
- t.delete(n);
1721
- for (const o of r[n])
1722
- t.append(n, o);
1723
- } else
1724
- t.set(n, r[n]);
1725
- s.search = t.toString();
1726
- }, D = function(s, e, t) {
1727
- const r = typeof s != "string";
1728
- return (r && t && t.isJsonMime ? t.isJsonMime(e.headers["Content-Type"]) : r) ? JSON.stringify(s !== void 0 ? s : {}) : s || "";
1729
- }, g = function(s) {
1730
- return s.pathname + s.search + s.hash;
1731
- }, T = function(s, e, t, r) {
1732
- return (n = e, o = t) => {
1733
- const a = { ...s.options, url: ((r == null ? void 0 : r.basePath) || o) + s.url };
1734
- return n.request(a);
1735
- };
1736
- }, vs = function(s) {
1737
- return {
1738
- /**
1739
- * Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones.
1740
- * @summary detect and check quality
1741
- * @param {DetectRequest} detectRequest
1742
- * @param {string} [xRequestID] Request header label.
1743
- * @param {*} [options] Override http request option.
1744
- * @throws {RequiredError}
1745
- */
1746
- detect: async (e, t, r = {}) => {
1747
- y("detect", "detectRequest", e);
1748
- const n = "/api/detect", o = new URL(n, R);
1749
- let a;
1750
- s && (a = s.baseOptions);
1751
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
1752
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
1753
- let d = a && a.headers ? a.headers : {};
1754
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
1755
- url: g(o),
1756
- options: i
1757
- };
1758
- },
1759
- /**
1760
- * To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It\'s possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1`
1761
- * @summary compare faces (1:1)
1762
- * @param {MatchRequest} matchRequest
1763
- * @param {string} [xRequestID] Request header label.
1764
- * @param {*} [options] Override http request option.
1765
- * @throws {RequiredError}
1766
- */
1767
- match: async (e, t, r = {}) => {
1768
- y("match", "matchRequest", e);
1769
- const n = "/api/match", o = new URL(n, R);
1770
- let a;
1771
- s && (a = s.baseOptions);
1772
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
1773
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
1774
- let d = a && a.headers ? a.headers : {};
1775
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
1776
- url: g(o),
1777
- options: i
1778
- };
1779
- },
1780
- /**
1781
- * To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out.
1782
- * @summary match and search (1:1 + 1:N)
1783
- * @param {MatchAndSearchRequest} matchAndSearchRequest
1784
- * @param {string} [xRequestID] Request header label.
1785
- * @param {*} [options] Override http request option.
1786
- * @throws {RequiredError}
1787
- */
1788
- matchAndSearch: async (e, t, r = {}) => {
1789
- y("matchAndSearch", "matchAndSearchRequest", e);
1790
- const n = "/api/match_and_search", o = new URL(n, R);
1791
- let a;
1792
- s && (a = s.baseOptions);
1793
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
1794
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
1795
- let d = a && a.headers ? a.headers : {};
1796
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
1797
- url: g(o),
1798
- options: i
1799
- };
1800
- }
1801
- };
1802
- }, Ee = function(s) {
1803
- const e = vs(s);
1804
- return {
1805
- /**
1806
- * Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones.
1807
- * @summary detect and check quality
1808
- * @param {DetectRequest} detectRequest
1809
- * @param {string} [xRequestID] Request header label.
1810
- * @param {*} [options] Override http request option.
1811
- * @throws {RequiredError}
1812
- */
1813
- async detect(t, r, n) {
1814
- const o = await e.detect(t, r, n);
1815
- return T(o, m, S, s);
1816
- },
1817
- /**
1818
- * To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It\'s possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1`
1819
- * @summary compare faces (1:1)
1820
- * @param {MatchRequest} matchRequest
1821
- * @param {string} [xRequestID] Request header label.
1822
- * @param {*} [options] Override http request option.
1823
- * @throws {RequiredError}
1824
- */
1825
- async match(t, r, n) {
1826
- const o = await e.match(t, r, n);
1827
- return T(o, m, S, s);
1828
- },
1829
- /**
1830
- * To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out.
1831
- * @summary match and search (1:1 + 1:N)
1832
- * @param {MatchAndSearchRequest} matchAndSearchRequest
1833
- * @param {string} [xRequestID] Request header label.
1834
- * @param {*} [options] Override http request option.
1835
- * @throws {RequiredError}
1836
- */
1837
- async matchAndSearch(t, r, n) {
1838
- const o = await e.matchAndSearch(t, r, n);
1839
- return T(o, m, S, s);
1840
- }
1841
- };
1842
- };
1843
- let zs = class extends z {
1844
- /**
1845
- * Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people. The Face Detection feature lets you: - **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. - **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. You can perform Face Detection in two ways: - By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated. - By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones.
1846
- * @summary detect and check quality
1847
- * @param {DetectRequest} detectRequest
1848
- * @param {string} [xRequestID] Request header label.
1849
- * @param {*} [options] Override http request option.
1850
- * @throws {RequiredError}
1851
- * @memberof MatchApi
1852
- */
1853
- detect(e, t, r) {
1854
- return Ee(this.configuration).detect(e, t, r).then((n) => n(this.axios, this.basePath));
1855
- }
1856
- /**
1857
- * To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It\'s possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field. Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected). So, if there are two images each of which has two faces in them, the parameters will be the following: - First face in the first image: `faceIndex: 0`, `imageIndex: 0` - Second face in the first image: `faceIndex: 1`, `imageIndex: 0` - First face of the second image: `faceIndex: 0`, `imageIndex: 1` - Second face in the second image: `faceIndex: 1`, `imageIndex: 1`
1858
- * @summary compare faces (1:1)
1859
- * @param {MatchRequest} matchRequest
1860
- * @param {string} [xRequestID] Request header label.
1861
- * @param {*} [options] Override http request option.
1862
- * @throws {RequiredError}
1863
- * @memberof MatchApi
1864
- */
1865
- match(e, t, r) {
1866
- return Ee(this.configuration).match(e, t, r).then((n) => n(this.axios, this.basePath));
1867
- }
1868
- /**
1869
- * To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out.
1870
- * @summary match and search (1:1 + 1:N)
1871
- * @param {MatchAndSearchRequest} matchAndSearchRequest
1872
- * @param {string} [xRequestID] Request header label.
1873
- * @param {*} [options] Override http request option.
1874
- * @throws {RequiredError}
1875
- * @memberof MatchApi
1876
- */
1877
- matchAndSearch(e, t, r) {
1878
- return Ee(this.configuration).matchAndSearch(e, t, r).then((n) => n(this.axios, this.basePath));
1879
- }
1880
- };
1881
- const Ur = {
1882
- AGE: "Age",
1883
- EMOTION: "Emotion",
1884
- EYE_LEFT: "EyeLeft",
1885
- EYE_RIGHT: "EyeRight",
1886
- SMILE: "Smile",
1887
- GLASSES: "Glasses",
1888
- HEAD_COVERING: "HeadCovering",
1889
- FOREHEAD_COVERING: "ForeheadCovering",
1890
- MOUTH: "Mouth",
1891
- MEDICAL_MASK: "MedicalMask",
1892
- OCCLUSION: "Occlusion",
1893
- STRONG_MAKEUP: "StrongMakeup",
1894
- HEADPHONES: "Headphones"
1895
- }, Vr = {
1896
- ALIGN_3x4: 0,
1897
- ALIGN_4x5: 1,
1898
- ALIGN_2x3: 2,
1899
- ALIGN_1x1: 3,
1900
- ALIGN_7x9: 4
1901
- }, Dr = {
1902
- IMAGE_CHARACTERISTICS: 1,
1903
- HEAD_SIZE_AND_POSITIONS: 2,
1904
- FACE_QUALITY: 3,
1905
- EYES_CHARACTERISTICS: 4,
1906
- SHADOWS_AND_LIGHTNING: 5,
1907
- POSE_AND_EXPRESSION: 6,
1908
- HEAD_OCCLUSION: 7,
1909
- BACKGROUND: 8
1910
- }, Gr = {
1911
- IMAGE_CHARACTERISTICS: "ImageCharacteristics",
1912
- HEAD_SIZE_AND_POSITIONS: "HeadSizeAndPosition",
1913
- FACE_QUALITY: "FaceQuality",
1914
- EYES_CHARACTERISTICS: "EyesCharacteristics",
1915
- SHADOWS_AND_LIGHTNING: "ShadowsAndLightning",
1916
- POSE_AND_EXPRESSION: "PoseAndExpression",
1917
- HEAD_OCCLUSION: "HeadOcclusion",
1918
- BACKGROUND: "Background"
1919
- }, Hr = {
1920
- QUALITY_STATUS_FALSE: 0,
1921
- QUALITY_STATUS_TRUE: 1,
1922
- QUALITY_STATUS_UNDETERMINED: 2
1923
- }, xr = {
1924
- IMAGE_WIDTH: "ImageWidth",
1925
- IMAGE_HEIGHT: "ImageHeight",
1926
- IMAGE_WIDTH_TO_HEIGHT: "ImageWidthToHeight",
1927
- IMAGE_CHANNELS_NUMBER: "ImageChannelsNumber",
1928
- PADDING_RATIO: "PaddingRatio",
1929
- FACE_MID_POINT_HORIZONTAL_POSITION: "FaceMidPointHorizontalPosition",
1930
- FACE_MID_POINT_VERTICAL_POSITION: "FaceMidPointVerticalPosition",
1931
- HEAD_WIDTH_RATIO: "HeadWidthRatio",
1932
- HEAD_HEIGHT_RATIO: "HeadHeightRatio",
1933
- EYES_DISTANCE: "EyesDistance",
1934
- YAW: "Yaw",
1935
- PITCH: "Pitch",
1936
- ROLL: "Roll",
1937
- BLUR_LEVEL: "BlurLevel",
1938
- NOISE_LEVEL: "NoiseLevel",
1939
- EYE_RIGHT_CLOSED: "EyeRightClosed",
1940
- EYE_LEFT_CLOSED: "EyeLeftClosed",
1941
- EYE_RIGHT_OCCLUDED: "EyeRightOccluded",
1942
- EYE_LEFT_OCCLUDED: "EyeLeftOccluded",
1943
- EYES_RED: "EyesRed",
1944
- EYE_RIGHT_COVERED_WITH_HAIR: "EyeRightCoveredWithHair",
1945
- EYE_LEFT_COVERED_WITH_HAIR: "EyeLeftCoveredWithHair",
1946
- OFF_GAZE: "OffGaze",
1947
- FACE_DYNAMIC_RANGE: "FaceDynamicRange",
1948
- UNNATURAL_SKIN_TONE: "UnnaturalSkinTone",
1949
- TOO_DARK: "TooDark",
1950
- TOO_LIGHT: "TooLight",
1951
- FACE_GLARE: "FaceGlare",
1952
- SHADOWS_ON_FACE: "ShadowsOnFace",
1953
- DARK_GLASSES: "DarkGlasses",
1954
- REFLECTION_ON_GLASSES: "ReflectionOnGlasses",
1955
- FRAMES_TOO_HEAVY: "FramesTooHeavy",
1956
- FACE_OCCLUDED: "FaceOccluded",
1957
- HEAD_COVERING: "HeadCovering",
1958
- BACKGROUND_UNIFORMITY: "BackgroundUniformity",
1959
- SHADOWS_ON_BACKGROUND: "ShadowsOnBackground",
1960
- OTHER_FACES: "OtherFaces",
1961
- SHOULDERS_POSE: "ShouldersPose",
1962
- EXPRESSION_LEVEL: "ExpressionLevel",
1963
- MOUTH_OPEN: "MouthOpen",
1964
- FOREHEAD_COVERING: "ForeheadCovering",
1965
- SMILE: "Smile",
1966
- STRONG_MAKEUP: "StrongMakeup",
1967
- HEADPHONES: "Headphones",
1968
- MEDICAL_MASK: "MedicalMask",
1969
- BACKGROUND_COLOR_MATCH: "BackgroundColorMatch",
1970
- ART_FACE: "ArtFace",
1971
- CONTACT_LENSES: "ContactLenses"
1972
- }, Br = {
1973
- OLD_MODE: "OldMode",
1974
- QUALITY_FULL: "QualityFull",
1975
- QUALITY_ICAO: "QualityICAO",
1976
- QUALITY_VISA_SCHENGEN: "QualityVisaSchengen",
1977
- QUALITY_VISA_USA: "QualityVisaUSA",
1978
- CROP_CENTRAL_FACE: "CropCentralFace",
1979
- CROP_ALL_FACES: "CropAllFaces",
1980
- THUMBNAIL: "Thumbnail",
1981
- EMPTY: ""
1982
- }, Mr = {
1983
- FACER_OK: 0,
1984
- FR_IMAGE_EMPTY: 1,
1985
- FR_FACE_NOT_DETECTED: 2,
1986
- FR_LANDMARKS_NOT_DETECTED: 3,
1987
- FR_FACE_ALIGHNER_FAILED: 4,
1988
- FR_DESCRIPTOR_EXTRACTOR_ERROR: 5,
1989
- FR_IMAGE_DECODE_ERROR: 6,
1990
- FR_INTERNAL_ERROR: 7,
1991
- FACER_CONFIG_ERROR: 199,
1992
- FACER_NO_LICENSE: 200,
1993
- FACER_IS_NOT_INITIALIZED: 201,
1994
- FACER_COMMAND_IS_NOT_SUPPORTED: 202,
1995
- FACER_COMMAND_PARAMS_READ_ERROR: 203,
1996
- FACER_LESS_THAN_TWO_IMAGES_IN_REQUEST: 224,
1997
- FACER_VIDEO_DECODE_ERROR: 227,
1998
- FACER_NOT_ENOUGH_FRAMES: 228,
1999
- FACER_OUTPUT_IS_NOT_DEFINED: 229,
2000
- FACER_CLOSED_EYES_DETECTED: 230,
2001
- FACER_LOW_QUALITY: 231,
2002
- FACER_HIGH_ASYMMETRY: 232,
2003
- FACER_FACE_OVER_EMOTIONAL: 233,
2004
- FACER_SUNGLASSES_DETECTED: 234,
2005
- FACER_SMALL_AGE: 235,
2006
- FACER_HEADDRESS_DETECTED: 236,
2007
- FACER_FACES_NOT_MATCHED: 237,
2008
- FACER_IMAGES_COUNT_LIMIT_EXCEEDED: 238,
2009
- FACER_MEDICINE_MASK_DETECTED: 239,
2010
- FACER_OCCLUSION_DETECTED: 240,
2011
- FACER_FOREHEAD_GLASSES_DETECTED: 242,
2012
- FACER_MOUTH_OPENED: 243,
2013
- FACER_ART_MASK_DETECTED: 244,
2014
- FACER_ELECTRONIC_DEVICE_DETECTED: 245,
2015
- FACER_TRACK_BREAK: 246,
2016
- FACER_WRONG_GEO: 247,
2017
- FACER_WRONG_OF: 248,
2018
- FACER_WRONG_VIEW: 249,
2019
- FACER_TIMEOUT_LIVENESS_TRANSACTION: 250,
2020
- FACER_FAILED_LIVENESS_TRANSACTION: 251,
2021
- FACER_ABORTED_LIVENESS_TRANSACTION: 252,
2022
- FACER_GENERAL_ERROR: 253,
2023
- FACER_PASSIVE_LIVENESS_FAIL: 254
2024
- }, jr = {
2025
- IN: "in",
2026
- NOT_IN: "nin"
2027
- }, $s = {
2028
- DOCUMENT_PRINTED: 1,
2029
- DOCUMENT_RFID: 2,
2030
- LIVE: 3,
2031
- DOCUMENT_WITH_LIVE: 4,
2032
- EXTERNAL: 5,
2033
- GHOST: 6,
2034
- BARCODE: 7
2035
- }, kr = {
2036
- ACTIVE: 0,
2037
- PASSIVE: 1
2038
- };
2039
- var $ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", qs = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
2040
- for (var Z = 0; Z < $.length; Z++)
2041
- qs[$.charCodeAt(Z)] = Z;
2042
- var oe = function(s) {
2043
- var e = new Uint8Array(s), t, r = e.length, n = "";
2044
- for (t = 0; t < r; t += 3)
2045
- n += $[e[t] >> 2], n += $[(e[t] & 3) << 4 | e[t + 1] >> 4], n += $[(e[t + 1] & 15) << 2 | e[t + 2] >> 6], n += $[e[t + 2] & 63];
2046
- return r % 3 === 2 ? n = n.substring(0, n.length - 1) + "=" : r % 3 === 1 && (n = n.substring(0, n.length - 2) + "=="), n;
2047
- };
2048
- class Qs {
2049
- constructor(e, t, r) {
2050
- this.superClass = new zs(e, t, r);
2051
- }
2052
- async match(e, t, r) {
2053
- for (const o of e.images)
2054
- o.type || (o.type = $s.LIVE), typeof o.data != "string" && (o.data = oe(o.data));
2055
- return (await this.superClass.match(e, t, r)).data;
2056
- }
2057
- async detect(e, t, r) {
2058
- return e.image && typeof e.image != "string" && (e.image = oe(e.image)), (await this.superClass.detect(e, t, r)).data;
2059
- }
2060
- }
2061
- const Ws = function(s) {
2062
- return {
2063
- /**
2064
- *
2065
- * @summary Create group
2066
- * @param {GroupToCreate} groupToCreate Request body for the group to create.
2067
- * @param {string} [xRequestID] Request header label.
2068
- * @param {*} [options] Override http request option.
2069
- * @throws {RequiredError}
2070
- */
2071
- createGroup: async (e, t, r = {}) => {
2072
- y("createGroup", "groupToCreate", e);
2073
- const n = "/api/groups", o = new URL(n, R);
2074
- let a;
2075
- s && (a = s.baseOptions);
2076
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
2077
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
2078
- let d = a && a.headers ? a.headers : {};
2079
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
2080
- url: g(o),
2081
- options: i
2082
- };
2083
- },
2084
- /**
2085
- *
2086
- * @summary Delete group
2087
- * @param {string} groupId Group ID.
2088
- * @param {string} [xRequestID] Request header label.
2089
- * @param {*} [options] Override http request option.
2090
- * @throws {RequiredError}
2091
- */
2092
- deleteGroup: async (e, t, r = {}) => {
2093
- y("deleteGroup", "groupId", e);
2094
- const n = "/api/groups/{groupId}".replace("{groupId}", encodeURIComponent(String(e))), o = new URL(n, R);
2095
- let a;
2096
- s && (a = s.baseOptions);
2097
- const i = { method: "DELETE", ...a, ...r }, c = {}, l = {};
2098
- t != null && (c["X-RequestID"] = String(t)), P(o, l);
2099
- let d = a && a.headers ? a.headers : {};
2100
- return i.headers = { ...c, ...d, ...r.headers }, {
2101
- url: g(o),
2102
- options: i
2103
- };
2104
- },
2105
- /**
2106
- *
2107
- * @summary Get groups
2108
- * @param {number} [page] The page number to get a list of persons or groups.
2109
- * @param {number} [size] The page size with a list of persons or groups, items.
2110
- * @param {string} [xRequestID] Request header label.
2111
- * @param {*} [options] Override http request option.
2112
- * @throws {RequiredError}
2113
- */
2114
- getAllGroups: async (e, t, r, n = {}) => {
2115
- const o = "/api/groups", a = new URL(o, R);
2116
- let i;
2117
- s && (i = s.baseOptions);
2118
- const c = { method: "GET", ...i, ...n }, l = {}, d = {};
2119
- e !== void 0 && (d.page = e), t !== void 0 && (d.size = t), r != null && (l["X-RequestID"] = String(r)), P(a, d);
2120
- let p = i && i.headers ? i.headers : {};
2121
- return c.headers = { ...l, ...p, ...n.headers }, {
2122
- url: g(a),
2123
- options: c
2124
- };
2125
- },
2126
- /**
2127
- *
2128
- * @summary Get group persons
2129
- * @param {string} groupId Group ID.
2130
- * @param {number} [page] The page number to get a list of persons or groups.
2131
- * @param {number} [size] The page size with a list of persons or groups, items.
2132
- * @param {string} [xRequestID] Request header label.
2133
- * @param {*} [options] Override http request option.
2134
- * @throws {RequiredError}
2135
- */
2136
- getAllPersonsByGroupId: async (e, t, r, n, o = {}) => {
2137
- y("getAllPersonsByGroupId", "groupId", e);
2138
- const a = "/api/groups/{groupId}/persons".replace("{groupId}", encodeURIComponent(String(e))), i = new URL(a, R);
2139
- let c;
2140
- s && (c = s.baseOptions);
2141
- const l = { method: "GET", ...c, ...o }, d = {}, p = {};
2142
- t !== void 0 && (p.page = t), r !== void 0 && (p.size = r), n != null && (d["X-RequestID"] = String(n)), P(i, p);
2143
- let O = c && c.headers ? c.headers : {};
2144
- return l.headers = { ...d, ...O, ...o.headers }, {
2145
- url: g(i),
2146
- options: l
2147
- };
2148
- },
2149
- /**
2150
- *
2151
- * @summary Get group
2152
- * @param {string} groupId Group ID.
2153
- * @param {string} [xRequestID] Request header label.
2154
- * @param {*} [options] Override http request option.
2155
- * @throws {RequiredError}
2156
- */
2157
- getGroup: async (e, t, r = {}) => {
2158
- y("getGroup", "groupId", e);
2159
- const n = "/api/groups/{groupId}".replace("{groupId}", encodeURIComponent(String(e))), o = new URL(n, R);
2160
- let a;
2161
- s && (a = s.baseOptions);
2162
- const i = { method: "GET", ...a, ...r }, c = {}, l = {};
2163
- t != null && (c["X-RequestID"] = String(t)), P(o, l);
2164
- let d = a && a.headers ? a.headers : {};
2165
- return i.headers = { ...c, ...d, ...r.headers }, {
2166
- url: g(o),
2167
- options: i
2168
- };
2169
- },
2170
- /**
2171
- *
2172
- * @summary Update group
2173
- * @param {string} groupId Group ID.
2174
- * @param {GroupToCreate} groupToCreate Request body for the group to update.
2175
- * @param {string} [xRequestID] Request header label.
2176
- * @param {*} [options] Override http request option.
2177
- * @throws {RequiredError}
2178
- */
2179
- updateGroup: async (e, t, r, n = {}) => {
2180
- y("updateGroup", "groupId", e), y("updateGroup", "groupToCreate", t);
2181
- const o = "/api/groups/{groupId}".replace("{groupId}", encodeURIComponent(String(e))), a = new URL(o, R);
2182
- let i;
2183
- s && (i = s.baseOptions);
2184
- const c = { method: "PUT", ...i, ...n }, l = {}, d = {};
2185
- r != null && (l["X-RequestID"] = String(r)), l["Content-Type"] = "application/json", P(a, d);
2186
- let p = i && i.headers ? i.headers : {};
2187
- return c.headers = { ...l, ...p, ...n.headers }, c.data = D(t, c, s), {
2188
- url: g(a),
2189
- options: c
2190
- };
2191
- },
2192
- /**
2193
- *
2194
- * @summary Add/remove persons to group
2195
- * @param {string} groupId Group ID.
2196
- * @param {UpdateGroup} updateGroup Request body for person IDs to add or remove.
2197
- * @param {string} [xRequestID] Request header label.
2198
- * @param {*} [options] Override http request option.
2199
- * @throws {RequiredError}
2200
- */
2201
- updatePersonsInGroup: async (e, t, r, n = {}) => {
2202
- y("updatePersonsInGroup", "groupId", e), y("updatePersonsInGroup", "updateGroup", t);
2203
- const o = "/api/groups/{groupId}/persons".replace("{groupId}", encodeURIComponent(String(e))), a = new URL(o, R);
2204
- let i;
2205
- s && (i = s.baseOptions);
2206
- const c = { method: "PUT", ...i, ...n }, l = {}, d = {};
2207
- r != null && (l["X-RequestID"] = String(r)), l["Content-Type"] = "application/json", P(a, d);
2208
- let p = i && i.headers ? i.headers : {};
2209
- return c.headers = { ...l, ...p, ...n.headers }, c.data = D(t, c, s), {
2210
- url: g(a),
2211
- options: c
2212
- };
2213
- }
2214
- };
2215
- }, M = function(s) {
2216
- const e = Ws(s);
2217
- return {
2218
- /**
2219
- *
2220
- * @summary Create group
2221
- * @param {GroupToCreate} groupToCreate Request body for the group to create.
2222
- * @param {string} [xRequestID] Request header label.
2223
- * @param {*} [options] Override http request option.
2224
- * @throws {RequiredError}
2225
- */
2226
- async createGroup(t, r, n) {
2227
- const o = await e.createGroup(t, r, n);
2228
- return T(o, m, S, s);
2229
- },
2230
- /**
2231
- *
2232
- * @summary Delete group
2233
- * @param {string} groupId Group ID.
2234
- * @param {string} [xRequestID] Request header label.
2235
- * @param {*} [options] Override http request option.
2236
- * @throws {RequiredError}
2237
- */
2238
- async deleteGroup(t, r, n) {
2239
- const o = await e.deleteGroup(t, r, n);
2240
- return T(o, m, S, s);
2241
- },
2242
- /**
2243
- *
2244
- * @summary Get groups
2245
- * @param {number} [page] The page number to get a list of persons or groups.
2246
- * @param {number} [size] The page size with a list of persons or groups, items.
2247
- * @param {string} [xRequestID] Request header label.
2248
- * @param {*} [options] Override http request option.
2249
- * @throws {RequiredError}
2250
- */
2251
- async getAllGroups(t, r, n, o) {
2252
- const a = await e.getAllGroups(t, r, n, o);
2253
- return T(a, m, S, s);
2254
- },
2255
- /**
2256
- *
2257
- * @summary Get group persons
2258
- * @param {string} groupId Group ID.
2259
- * @param {number} [page] The page number to get a list of persons or groups.
2260
- * @param {number} [size] The page size with a list of persons or groups, items.
2261
- * @param {string} [xRequestID] Request header label.
2262
- * @param {*} [options] Override http request option.
2263
- * @throws {RequiredError}
2264
- */
2265
- async getAllPersonsByGroupId(t, r, n, o, a) {
2266
- const i = await e.getAllPersonsByGroupId(t, r, n, o, a);
2267
- return T(i, m, S, s);
2268
- },
2269
- /**
2270
- *
2271
- * @summary Get group
2272
- * @param {string} groupId Group ID.
2273
- * @param {string} [xRequestID] Request header label.
2274
- * @param {*} [options] Override http request option.
2275
- * @throws {RequiredError}
2276
- */
2277
- async getGroup(t, r, n) {
2278
- const o = await e.getGroup(t, r, n);
2279
- return T(o, m, S, s);
2280
- },
2281
- /**
2282
- *
2283
- * @summary Update group
2284
- * @param {string} groupId Group ID.
2285
- * @param {GroupToCreate} groupToCreate Request body for the group to update.
2286
- * @param {string} [xRequestID] Request header label.
2287
- * @param {*} [options] Override http request option.
2288
- * @throws {RequiredError}
2289
- */
2290
- async updateGroup(t, r, n, o) {
2291
- const a = await e.updateGroup(t, r, n, o);
2292
- return T(a, m, S, s);
2293
- },
2294
- /**
2295
- *
2296
- * @summary Add/remove persons to group
2297
- * @param {string} groupId Group ID.
2298
- * @param {UpdateGroup} updateGroup Request body for person IDs to add or remove.
2299
- * @param {string} [xRequestID] Request header label.
2300
- * @param {*} [options] Override http request option.
2301
- * @throws {RequiredError}
2302
- */
2303
- async updatePersonsInGroup(t, r, n, o) {
2304
- const a = await e.updatePersonsInGroup(t, r, n, o);
2305
- return T(a, m, S, s);
2306
- }
2307
- };
2308
- };
2309
- let Ks = class extends z {
2310
- /**
2311
- *
2312
- * @summary Create group
2313
- * @param {GroupToCreate} groupToCreate Request body for the group to create.
2314
- * @param {string} [xRequestID] Request header label.
2315
- * @param {*} [options] Override http request option.
2316
- * @throws {RequiredError}
2317
- * @memberof GroupApi
2318
- */
2319
- createGroup(e, t, r) {
2320
- return M(this.configuration).createGroup(e, t, r).then((n) => n(this.axios, this.basePath));
2321
- }
2322
- /**
2323
- *
2324
- * @summary Delete group
2325
- * @param {string} groupId Group ID.
2326
- * @param {string} [xRequestID] Request header label.
2327
- * @param {*} [options] Override http request option.
2328
- * @throws {RequiredError}
2329
- * @memberof GroupApi
2330
- */
2331
- deleteGroup(e, t, r) {
2332
- return M(this.configuration).deleteGroup(e, t, r).then((n) => n(this.axios, this.basePath));
2333
- }
2334
- /**
2335
- *
2336
- * @summary Get groups
2337
- * @param {number} [page] The page number to get a list of persons or groups.
2338
- * @param {number} [size] The page size with a list of persons or groups, items.
2339
- * @param {string} [xRequestID] Request header label.
2340
- * @param {*} [options] Override http request option.
2341
- * @throws {RequiredError}
2342
- * @memberof GroupApi
2343
- */
2344
- getAllGroups(e, t, r, n) {
2345
- return M(this.configuration).getAllGroups(e, t, r, n).then((o) => o(this.axios, this.basePath));
2346
- }
2347
- /**
2348
- *
2349
- * @summary Get group persons
2350
- * @param {string} groupId Group ID.
2351
- * @param {number} [page] The page number to get a list of persons or groups.
2352
- * @param {number} [size] The page size with a list of persons or groups, items.
2353
- * @param {string} [xRequestID] Request header label.
2354
- * @param {*} [options] Override http request option.
2355
- * @throws {RequiredError}
2356
- * @memberof GroupApi
2357
- */
2358
- getAllPersonsByGroupId(e, t, r, n, o) {
2359
- return M(this.configuration).getAllPersonsByGroupId(e, t, r, n, o).then((a) => a(this.axios, this.basePath));
2360
- }
2361
- /**
2362
- *
2363
- * @summary Get group
2364
- * @param {string} groupId Group ID.
2365
- * @param {string} [xRequestID] Request header label.
2366
- * @param {*} [options] Override http request option.
2367
- * @throws {RequiredError}
2368
- * @memberof GroupApi
2369
- */
2370
- getGroup(e, t, r) {
2371
- return M(this.configuration).getGroup(e, t, r).then((n) => n(this.axios, this.basePath));
2372
- }
2373
- /**
2374
- *
2375
- * @summary Update group
2376
- * @param {string} groupId Group ID.
2377
- * @param {GroupToCreate} groupToCreate Request body for the group to update.
2378
- * @param {string} [xRequestID] Request header label.
2379
- * @param {*} [options] Override http request option.
2380
- * @throws {RequiredError}
2381
- * @memberof GroupApi
2382
- */
2383
- updateGroup(e, t, r, n) {
2384
- return M(this.configuration).updateGroup(e, t, r, n).then((o) => o(this.axios, this.basePath));
2385
- }
2386
- /**
2387
- *
2388
- * @summary Add/remove persons to group
2389
- * @param {string} groupId Group ID.
2390
- * @param {UpdateGroup} updateGroup Request body for person IDs to add or remove.
2391
- * @param {string} [xRequestID] Request header label.
2392
- * @param {*} [options] Override http request option.
2393
- * @throws {RequiredError}
2394
- * @memberof GroupApi
2395
- */
2396
- updatePersonsInGroup(e, t, r, n) {
2397
- return M(this.configuration).updatePersonsInGroup(e, t, r, n).then((o) => o(this.axios, this.basePath));
2398
- }
2399
- };
2400
- class Xs {
2401
- constructor(e, t, r) {
2402
- this.superClass = new Ks(e, t, r);
2403
- }
2404
- async createGroup(e, t, r) {
2405
- const n = {
2406
- ...e,
2407
- metadata: e != null && e.metadata ? e.metadata : {}
2408
- };
2409
- return (await this.superClass.createGroup(n, t, r)).data;
2410
- }
2411
- async deleteGroup(e, t, r) {
2412
- await this.superClass.deleteGroup(e, t, r);
2413
- }
2414
- async getAllGroups(e, t, r, n) {
2415
- return (await this.superClass.getAllGroups(e, t, r, n)).data;
2416
- }
2417
- async getAllPersonsByGroupId(e, t, r, n, o) {
2418
- return (await this.superClass.getAllPersonsByGroupId(r, e, t, n, o)).data;
2419
- }
2420
- async getGroup(e, t, r) {
2421
- return (await this.superClass.getGroup(e, t, r)).data;
2422
- }
2423
- async updateGroup(e, t, r, n) {
2424
- await this.superClass.updateGroup(e, t, r, n);
2425
- }
2426
- async updatePersonsInGroup(e, t, r, n) {
2427
- await this.superClass.updatePersonsInGroup(e, t, r, n);
2428
- }
2429
- }
2430
- const Js = function(s) {
2431
- return {
2432
- /**
2433
- *
2434
- * @summary Add person image
2435
- * @param {string} personId Person ID.
2436
- * @param {AddImageToPersonRequest} addImageToPersonRequest Image to add.
2437
- * @param {string} [xRequestID] Request header label.
2438
- * @param {*} [options] Override http request option.
2439
- * @throws {RequiredError}
2440
- */
2441
- addImageToPerson: async (e, t, r, n = {}) => {
2442
- y("addImageToPerson", "personId", e), y("addImageToPerson", "addImageToPersonRequest", t);
2443
- const o = "/api/persons/{personId}/images".replace("{personId}", encodeURIComponent(String(e))), a = new URL(o, R);
2444
- let i;
2445
- s && (i = s.baseOptions);
2446
- const c = { method: "POST", ...i, ...n }, l = {}, d = {};
2447
- r != null && (l["X-RequestID"] = String(r)), l["Content-Type"] = "application/json", P(a, d);
2448
- let p = i && i.headers ? i.headers : {};
2449
- return c.headers = { ...l, ...p, ...n.headers }, c.data = D(t, c, s), {
2450
- url: g(a),
2451
- options: c
2452
- };
2453
- },
2454
- /**
2455
- *
2456
- * @summary Create person
2457
- * @param {PersonFields} personFields
2458
- * @param {string} [xRequestID] Request header label.
2459
- * @param {*} [options] Override http request option.
2460
- * @throws {RequiredError}
2461
- */
2462
- createPerson: async (e, t, r = {}) => {
2463
- y("createPerson", "personFields", e);
2464
- const n = "/api/persons", o = new URL(n, R);
2465
- let a;
2466
- s && (a = s.baseOptions);
2467
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
2468
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
2469
- let d = a && a.headers ? a.headers : {};
2470
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
2471
- url: g(o),
2472
- options: i
2473
- };
2474
- },
2475
- /**
2476
- *
2477
- * @summary Delete image of person
2478
- * @param {string} imageId Image ID.
2479
- * @param {string} personId Person ID.
2480
- * @param {string} [xRequestID] Request header label.
2481
- * @param {*} [options] Override http request option.
2482
- * @throws {RequiredError}
2483
- */
2484
- deleteImageOfPerson: async (e, t, r, n = {}) => {
2485
- y("deleteImageOfPerson", "imageId", e), y("deleteImageOfPerson", "personId", t);
2486
- const o = "/api/persons/{personId}/images/{imageId}".replace("{imageId}", encodeURIComponent(String(e))).replace("{personId}", encodeURIComponent(String(t))), a = new URL(o, R);
2487
- let i;
2488
- s && (i = s.baseOptions);
2489
- const c = { method: "DELETE", ...i, ...n }, l = {}, d = {};
2490
- r != null && (l["X-RequestID"] = String(r)), P(a, d);
2491
- let p = i && i.headers ? i.headers : {};
2492
- return c.headers = { ...l, ...p, ...n.headers }, {
2493
- url: g(a),
2494
- options: c
2495
- };
2496
- },
2497
- /**
2498
- *
2499
- * @summary Delete person
2500
- * @param {string} personId Person ID.
2501
- * @param {string} [xRequestID] Request header label.
2502
- * @param {*} [options] Override http request option.
2503
- * @throws {RequiredError}
2504
- */
2505
- deletePerson: async (e, t, r = {}) => {
2506
- y("deletePerson", "personId", e);
2507
- const n = "/api/persons/{personId}".replace("{personId}", encodeURIComponent(String(e))), o = new URL(n, R);
2508
- let a;
2509
- s && (a = s.baseOptions);
2510
- const i = { method: "DELETE", ...a, ...r }, c = {}, l = {};
2511
- t != null && (c["X-RequestID"] = String(t)), P(o, l);
2512
- let d = a && a.headers ? a.headers : {};
2513
- return i.headers = { ...c, ...d, ...r.headers }, {
2514
- url: g(o),
2515
- options: i
2516
- };
2517
- },
2518
- /**
2519
- *
2520
- * @summary Get person groups
2521
- * @param {string} personId Person ID.
2522
- * @param {number} [page] The page number to get a list of persons or groups.
2523
- * @param {number} [size] The page size with a list of persons or groups, items.
2524
- * @param {string} [xRequestID] Request header label.
2525
- * @param {*} [options] Override http request option.
2526
- * @throws {RequiredError}
2527
- */
2528
- getAllGroupsByPersonId: async (e, t, r, n, o = {}) => {
2529
- y("getAllGroupsByPersonId", "personId", e);
2530
- const a = "/api/persons/{personId}/groups".replace("{personId}", encodeURIComponent(String(e))), i = new URL(a, R);
2531
- let c;
2532
- s && (c = s.baseOptions);
2533
- const l = { method: "GET", ...c, ...o }, d = {}, p = {};
2534
- t !== void 0 && (p.page = t), r !== void 0 && (p.size = r), n != null && (d["X-RequestID"] = String(n)), P(i, p);
2535
- let O = c && c.headers ? c.headers : {};
2536
- return l.headers = { ...d, ...O, ...o.headers }, {
2537
- url: g(i),
2538
- options: l
2539
- };
2540
- },
2541
- /**
2542
- *
2543
- * @summary Get person images
2544
- * @param {string} personId Person ID.
2545
- * @param {number} [page] The page number to get a list of persons or groups.
2546
- * @param {number} [size] The page size with a list of persons or groups, items.
2547
- * @param {string} [xRequestID] Request header label.
2548
- * @param {*} [options] Override http request option.
2549
- * @throws {RequiredError}
2550
- */
2551
- getAllImagesByPersonId: async (e, t, r, n, o = {}) => {
2552
- y("getAllImagesByPersonId", "personId", e);
2553
- const a = "/api/persons/{personId}/images".replace("{personId}", encodeURIComponent(String(e))), i = new URL(a, R);
2554
- let c;
2555
- s && (c = s.baseOptions);
2556
- const l = { method: "GET", ...c, ...o }, d = {}, p = {};
2557
- t !== void 0 && (p.page = t), r !== void 0 && (p.size = r), n != null && (d["X-RequestID"] = String(n)), P(i, p);
2558
- let O = c && c.headers ? c.headers : {};
2559
- return l.headers = { ...d, ...O, ...o.headers }, {
2560
- url: g(i),
2561
- options: l
2562
- };
2563
- },
2564
- /**
2565
- *
2566
- * @summary Get person image by id
2567
- * @param {string} imageId Image ID.
2568
- * @param {string} personId Person ID.
2569
- * @param {string} [xRequestID] Request header label.
2570
- * @param {*} [options] Override http request option.
2571
- * @throws {RequiredError}
2572
- */
2573
- getImageOfPerson: async (e, t, r, n = {}) => {
2574
- y("getImageOfPerson", "imageId", e), y("getImageOfPerson", "personId", t);
2575
- const o = "/api/persons/{personId}/images/{imageId}".replace("{imageId}", encodeURIComponent(String(e))).replace("{personId}", encodeURIComponent(String(t))), a = new URL(o, R);
2576
- let i;
2577
- s && (i = s.baseOptions);
2578
- const c = { method: "GET", ...i, ...n }, l = {}, d = {};
2579
- r != null && (l["X-RequestID"] = String(r)), P(a, d);
2580
- let p = i && i.headers ? i.headers : {};
2581
- return c.headers = { ...l, ...p, ...n.headers }, {
2582
- url: g(a),
2583
- options: c
2584
- };
2585
- },
2586
- /**
2587
- *
2588
- * @summary Get person
2589
- * @param {string} personId Person ID.
2590
- * @param {string} [xRequestID] Request header label.
2591
- * @param {*} [options] Override http request option.
2592
- * @throws {RequiredError}
2593
- */
2594
- getPerson: async (e, t, r = {}) => {
2595
- y("getPerson", "personId", e);
2596
- const n = "/api/persons/{personId}".replace("{personId}", encodeURIComponent(String(e))), o = new URL(n, R);
2597
- let a;
2598
- s && (a = s.baseOptions);
2599
- const i = { method: "GET", ...a, ...r }, c = {}, l = {};
2600
- t != null && (c["X-RequestID"] = String(t)), P(o, l);
2601
- let d = a && a.headers ? a.headers : {};
2602
- return i.headers = { ...c, ...d, ...r.headers }, {
2603
- url: g(o),
2604
- options: i
2605
- };
2606
- },
2607
- /**
2608
- *
2609
- * @summary Update person
2610
- * @param {string} personId Person ID.
2611
- * @param {PersonToUpdateFields} personToUpdateFields Request body for the Person to update.
2612
- * @param {string} [xRequestID] Request header label.
2613
- * @param {*} [options] Override http request option.
2614
- * @throws {RequiredError}
2615
- */
2616
- updatePerson: async (e, t, r, n = {}) => {
2617
- y("updatePerson", "personId", e), y("updatePerson", "personToUpdateFields", t);
2618
- const o = "/api/persons/{personId}".replace("{personId}", encodeURIComponent(String(e))), a = new URL(o, R);
2619
- let i;
2620
- s && (i = s.baseOptions);
2621
- const c = { method: "PUT", ...i, ...n }, l = {}, d = {};
2622
- r != null && (l["X-RequestID"] = String(r)), l["Content-Type"] = "application/json", P(a, d);
2623
- let p = i && i.headers ? i.headers : {};
2624
- return c.headers = { ...l, ...p, ...n.headers }, c.data = D(t, c, s), {
2625
- url: g(a),
2626
- options: c
2627
- };
2628
- }
2629
- };
2630
- }, H = function(s) {
2631
- const e = Js(s);
2632
- return {
2633
- /**
2634
- *
2635
- * @summary Add person image
2636
- * @param {string} personId Person ID.
2637
- * @param {AddImageToPersonRequest} addImageToPersonRequest Image to add.
2638
- * @param {string} [xRequestID] Request header label.
2639
- * @param {*} [options] Override http request option.
2640
- * @throws {RequiredError}
2641
- */
2642
- async addImageToPerson(t, r, n, o) {
2643
- const a = await e.addImageToPerson(t, r, n, o);
2644
- return T(a, m, S, s);
2645
- },
2646
- /**
2647
- *
2648
- * @summary Create person
2649
- * @param {PersonFields} personFields
2650
- * @param {string} [xRequestID] Request header label.
2651
- * @param {*} [options] Override http request option.
2652
- * @throws {RequiredError}
2653
- */
2654
- async createPerson(t, r, n) {
2655
- const o = await e.createPerson(t, r, n);
2656
- return T(o, m, S, s);
2657
- },
2658
- /**
2659
- *
2660
- * @summary Delete image of person
2661
- * @param {string} imageId Image ID.
2662
- * @param {string} personId Person ID.
2663
- * @param {string} [xRequestID] Request header label.
2664
- * @param {*} [options] Override http request option.
2665
- * @throws {RequiredError}
2666
- */
2667
- async deleteImageOfPerson(t, r, n, o) {
2668
- const a = await e.deleteImageOfPerson(t, r, n, o);
2669
- return T(a, m, S, s);
2670
- },
2671
- /**
2672
- *
2673
- * @summary Delete person
2674
- * @param {string} personId Person ID.
2675
- * @param {string} [xRequestID] Request header label.
2676
- * @param {*} [options] Override http request option.
2677
- * @throws {RequiredError}
2678
- */
2679
- async deletePerson(t, r, n) {
2680
- const o = await e.deletePerson(t, r, n);
2681
- return T(o, m, S, s);
2682
- },
2683
- /**
2684
- *
2685
- * @summary Get person groups
2686
- * @param {string} personId Person ID.
2687
- * @param {number} [page] The page number to get a list of persons or groups.
2688
- * @param {number} [size] The page size with a list of persons or groups, items.
2689
- * @param {string} [xRequestID] Request header label.
2690
- * @param {*} [options] Override http request option.
2691
- * @throws {RequiredError}
2692
- */
2693
- async getAllGroupsByPersonId(t, r, n, o, a) {
2694
- const i = await e.getAllGroupsByPersonId(t, r, n, o, a);
2695
- return T(i, m, S, s);
2696
- },
2697
- /**
2698
- *
2699
- * @summary Get person images
2700
- * @param {string} personId Person ID.
2701
- * @param {number} [page] The page number to get a list of persons or groups.
2702
- * @param {number} [size] The page size with a list of persons or groups, items.
2703
- * @param {string} [xRequestID] Request header label.
2704
- * @param {*} [options] Override http request option.
2705
- * @throws {RequiredError}
2706
- */
2707
- async getAllImagesByPersonId(t, r, n, o, a) {
2708
- const i = await e.getAllImagesByPersonId(t, r, n, o, a);
2709
- return T(i, m, S, s);
2710
- },
2711
- /**
2712
- *
2713
- * @summary Get person image by id
2714
- * @param {string} imageId Image ID.
2715
- * @param {string} personId Person ID.
2716
- * @param {string} [xRequestID] Request header label.
2717
- * @param {*} [options] Override http request option.
2718
- * @throws {RequiredError}
2719
- */
2720
- async getImageOfPerson(t, r, n, o) {
2721
- const a = await e.getImageOfPerson(t, r, n, o);
2722
- return T(a, m, S, s);
2723
- },
2724
- /**
2725
- *
2726
- * @summary Get person
2727
- * @param {string} personId Person ID.
2728
- * @param {string} [xRequestID] Request header label.
2729
- * @param {*} [options] Override http request option.
2730
- * @throws {RequiredError}
2731
- */
2732
- async getPerson(t, r, n) {
2733
- const o = await e.getPerson(t, r, n);
2734
- return T(o, m, S, s);
2735
- },
2736
- /**
2737
- *
2738
- * @summary Update person
2739
- * @param {string} personId Person ID.
2740
- * @param {PersonToUpdateFields} personToUpdateFields Request body for the Person to update.
2741
- * @param {string} [xRequestID] Request header label.
2742
- * @param {*} [options] Override http request option.
2743
- * @throws {RequiredError}
2744
- */
2745
- async updatePerson(t, r, n, o) {
2746
- const a = await e.updatePerson(t, r, n, o);
2747
- return T(a, m, S, s);
2748
- }
2749
- };
2750
- };
2751
- let Ys = class extends z {
2752
- /**
2753
- *
2754
- * @summary Add person image
2755
- * @param {string} personId Person ID.
2756
- * @param {AddImageToPersonRequest} addImageToPersonRequest Image to add.
2757
- * @param {string} [xRequestID] Request header label.
2758
- * @param {*} [options] Override http request option.
2759
- * @throws {RequiredError}
2760
- * @memberof PersonApi
2761
- */
2762
- addImageToPerson(e, t, r, n) {
2763
- return H(this.configuration).addImageToPerson(e, t, r, n).then((o) => o(this.axios, this.basePath));
2764
- }
2765
- /**
2766
- *
2767
- * @summary Create person
2768
- * @param {PersonFields} personFields
2769
- * @param {string} [xRequestID] Request header label.
2770
- * @param {*} [options] Override http request option.
2771
- * @throws {RequiredError}
2772
- * @memberof PersonApi
2773
- */
2774
- createPerson(e, t, r) {
2775
- return H(this.configuration).createPerson(e, t, r).then((n) => n(this.axios, this.basePath));
2776
- }
2777
- /**
2778
- *
2779
- * @summary Delete image of person
2780
- * @param {string} imageId Image ID.
2781
- * @param {string} personId Person ID.
2782
- * @param {string} [xRequestID] Request header label.
2783
- * @param {*} [options] Override http request option.
2784
- * @throws {RequiredError}
2785
- * @memberof PersonApi
2786
- */
2787
- deleteImageOfPerson(e, t, r, n) {
2788
- return H(this.configuration).deleteImageOfPerson(e, t, r, n).then((o) => o(this.axios, this.basePath));
2789
- }
2790
- /**
2791
- *
2792
- * @summary Delete person
2793
- * @param {string} personId Person ID.
2794
- * @param {string} [xRequestID] Request header label.
2795
- * @param {*} [options] Override http request option.
2796
- * @throws {RequiredError}
2797
- * @memberof PersonApi
2798
- */
2799
- deletePerson(e, t, r) {
2800
- return H(this.configuration).deletePerson(e, t, r).then((n) => n(this.axios, this.basePath));
2801
- }
2802
- /**
2803
- *
2804
- * @summary Get person groups
2805
- * @param {string} personId Person ID.
2806
- * @param {number} [page] The page number to get a list of persons or groups.
2807
- * @param {number} [size] The page size with a list of persons or groups, items.
2808
- * @param {string} [xRequestID] Request header label.
2809
- * @param {*} [options] Override http request option.
2810
- * @throws {RequiredError}
2811
- * @memberof PersonApi
2812
- */
2813
- getAllGroupsByPersonId(e, t, r, n, o) {
2814
- return H(this.configuration).getAllGroupsByPersonId(e, t, r, n, o).then((a) => a(this.axios, this.basePath));
2815
- }
2816
- /**
2817
- *
2818
- * @summary Get person images
2819
- * @param {string} personId Person ID.
2820
- * @param {number} [page] The page number to get a list of persons or groups.
2821
- * @param {number} [size] The page size with a list of persons or groups, items.
2822
- * @param {string} [xRequestID] Request header label.
2823
- * @param {*} [options] Override http request option.
2824
- * @throws {RequiredError}
2825
- * @memberof PersonApi
2826
- */
2827
- getAllImagesByPersonId(e, t, r, n, o) {
2828
- return H(this.configuration).getAllImagesByPersonId(e, t, r, n, o).then((a) => a(this.axios, this.basePath));
2829
- }
2830
- /**
2831
- *
2832
- * @summary Get person image by id
2833
- * @param {string} imageId Image ID.
2834
- * @param {string} personId Person ID.
2835
- * @param {string} [xRequestID] Request header label.
2836
- * @param {*} [options] Override http request option.
2837
- * @throws {RequiredError}
2838
- * @memberof PersonApi
2839
- */
2840
- getImageOfPerson(e, t, r, n) {
2841
- return H(this.configuration).getImageOfPerson(e, t, r, n).then((o) => o(this.axios, this.basePath));
2842
- }
2843
- /**
2844
- *
2845
- * @summary Get person
2846
- * @param {string} personId Person ID.
2847
- * @param {string} [xRequestID] Request header label.
2848
- * @param {*} [options] Override http request option.
2849
- * @throws {RequiredError}
2850
- * @memberof PersonApi
2851
- */
2852
- getPerson(e, t, r) {
2853
- return H(this.configuration).getPerson(e, t, r).then((n) => n(this.axios, this.basePath));
2854
- }
2855
- /**
2856
- *
2857
- * @summary Update person
2858
- * @param {string} personId Person ID.
2859
- * @param {PersonToUpdateFields} personToUpdateFields Request body for the Person to update.
2860
- * @param {string} [xRequestID] Request header label.
2861
- * @param {*} [options] Override http request option.
2862
- * @throws {RequiredError}
2863
- * @memberof PersonApi
2864
- */
2865
- updatePerson(e, t, r, n) {
2866
- return H(this.configuration).updatePerson(e, t, r, n).then((o) => o(this.axios, this.basePath));
2867
- }
2868
- };
2869
- class Zs {
2870
- constructor(e, t, r) {
2871
- this.superClass = new Ys(e, t, r);
2872
- }
2873
- async createPerson(e, t, r) {
2874
- const n = {
2875
- ...e,
2876
- metadata: e != null && e.metadata ? e.metadata : {}
2877
- };
2878
- return (await this.superClass.createPerson(n, t, r)).data;
2879
- }
2880
- async addImageToPerson(e, t, r, n) {
2881
- var a;
2882
- return (a = t == null ? void 0 : t.image) != null && a.content && typeof t.image.content != "string" && (t.image.content = oe(t.image.content)), (await this.superClass.addImageToPerson(e, t, r, n)).data;
2883
- }
2884
- async deleteImageOfPerson(e, t, r, n) {
2885
- await this.superClass.deleteImageOfPerson(e, t, r, n);
2886
- }
2887
- async deletePerson(e, t, r) {
2888
- await this.superClass.deletePerson(e, t, r);
2889
- }
2890
- async getAllGroupsByPersonId(e, t, r, n, o) {
2891
- return (await this.superClass.getAllGroupsByPersonId(r, e, t, n, o)).data;
2892
- }
2893
- async getAllImagesByPersonId(e, t, r, n, o) {
2894
- return (await this.superClass.getAllImagesByPersonId(r, e, t, n, o)).data;
2895
- }
2896
- async getImageOfPerson(e, t, r, n) {
2897
- return (await this.superClass.getImageOfPerson(e, t, r, n)).data;
2898
- }
2899
- async getPerson(e, t, r) {
2900
- return (await this.superClass.getPerson(e, t, r)).data;
2901
- }
2902
- async updatePerson(e, t, r, n) {
2903
- await this.superClass.updatePerson(e, t, r, n);
2904
- }
2905
- }
2906
- const er = function(s) {
2907
- return {
2908
- /**
2909
- *
2910
- * @summary Find person by image in groups
2911
- * @param {SearchRequest} searchRequest
2912
- * @param {string} [xRequestID] Request header label.
2913
- * @param {*} [options] Override http request option.
2914
- * @throws {RequiredError}
2915
- */
2916
- search: async (e, t, r = {}) => {
2917
- y("search", "searchRequest", e);
2918
- const n = "/api/search", o = new URL(n, R);
2919
- let a;
2920
- s && (a = s.baseOptions);
2921
- const i = { method: "POST", ...a, ...r }, c = {}, l = {};
2922
- t != null && (c["X-RequestID"] = String(t)), c["Content-Type"] = "application/json", P(o, l);
2923
- let d = a && a.headers ? a.headers : {};
2924
- return i.headers = { ...c, ...d, ...r.headers }, i.data = D(e, i, s), {
2925
- url: g(o),
2926
- options: i
2927
- };
2928
- }
2929
- };
2930
- }, tr = function(s) {
2931
- const e = er(s);
2932
- return {
2933
- /**
2934
- *
2935
- * @summary Find person by image in groups
2936
- * @param {SearchRequest} searchRequest
2937
- * @param {string} [xRequestID] Request header label.
2938
- * @param {*} [options] Override http request option.
2939
- * @throws {RequiredError}
2940
- */
2941
- async search(t, r, n) {
2942
- const o = await e.search(t, r, n);
2943
- return T(o, m, S, s);
2944
- }
2945
- };
2946
- };
2947
- let sr = class extends z {
2948
- /**
2949
- *
2950
- * @summary Find person by image in groups
2951
- * @param {SearchRequest} searchRequest
2952
- * @param {string} [xRequestID] Request header label.
2953
- * @param {*} [options] Override http request option.
2954
- * @throws {RequiredError}
2955
- * @memberof SearchApi
2956
- */
2957
- search(e, t, r) {
2958
- return tr(this.configuration).search(e, t, r).then((n) => n(this.axios, this.basePath));
2959
- }
2960
- };
2961
- class rr {
2962
- constructor(e, t, r) {
2963
- this.superClass = new sr(e, t, r);
2964
- }
2965
- async search(e, t, r) {
2966
- var o;
2967
- return (o = e == null ? void 0 : e.image) != null && o.content && typeof e.image.content != "string" && (e.image.content = oe(e.image.content)), (await this.superClass.search(e, t, r)).data;
2968
- }
2969
- }
2970
- const nr = function(s) {
2971
- return {
2972
- /**
2973
- *
2974
- * @summary Checking the license status
2975
- * @param {string} [xRequestID] Request header label.
2976
- * @param {*} [options] Override http request option.
2977
- * @throws {RequiredError}
2978
- */
2979
- readiness: async (e, t = {}) => {
2980
- const r = "/api/readiness", n = new URL(r, R);
2981
- let o;
2982
- s && (o = s.baseOptions);
2983
- const a = { method: "GET", ...o, ...t }, i = {}, c = {};
2984
- e != null && (i["X-RequestID"] = String(e)), P(n, c);
2985
- let l = o && o.headers ? o.headers : {};
2986
- return a.headers = { ...i, ...l, ...t.headers }, {
2987
- url: g(n),
2988
- options: a
2989
- };
2990
- }
2991
- };
2992
- }, or = function(s) {
2993
- const e = nr(s);
2994
- return {
2995
- /**
2996
- *
2997
- * @summary Checking the license status
2998
- * @param {string} [xRequestID] Request header label.
2999
- * @param {*} [options] Override http request option.
3000
- * @throws {RequiredError}
3001
- */
3002
- async readiness(t, r) {
3003
- const n = await e.readiness(t, r);
3004
- return T(n, m, S, s);
3005
- }
3006
- };
3007
- };
3008
- let ar = class extends z {
3009
- /**
3010
- *
3011
- * @summary Checking the license status
3012
- * @param {string} [xRequestID] Request header label.
3013
- * @param {*} [options] Override http request option.
3014
- * @throws {RequiredError}
3015
- * @memberof DiagnosticsApi
3016
- */
3017
- readiness(e, t) {
3018
- return or(this.configuration).readiness(e, t).then((r) => r(this.axios, this.basePath));
3019
- }
3020
- };
3021
- class ir {
3022
- constructor(e, t, r) {
3023
- this.superClass = new ar(e, t, r);
3024
- }
3025
- async readiness(e, t) {
3026
- return (await this.superClass.readiness(e, t)).data;
3027
- }
3028
- }
3029
- const cr = function(s) {
3030
- return {
3031
- /**
3032
- * To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person\'s selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn\'t meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`.
3033
- * @summary liveness check
3034
- * @param {string} transactionId ID of the current liveness transaction.
3035
- * @param {*} [options] Override http request option.
3036
- * @throws {RequiredError}
3037
- */
3038
- getLivenessTransactionInfo: async (e, t = {}) => {
3039
- y("getLivenessTransactionInfo", "transactionId", e);
3040
- const r = "/api/v2/liveness", n = new URL(r, R);
3041
- let o;
3042
- s && (o = s.baseOptions);
3043
- const a = { method: "GET", ...o, ...t }, i = {}, c = {};
3044
- e !== void 0 && (c.transactionId = e), P(n, c);
3045
- let l = o && o.headers ? o.headers : {};
3046
- return a.headers = { ...i, ...l, ...t.headers }, {
3047
- url: g(n),
3048
- options: a
3049
- };
3050
- }
3051
- };
3052
- }, lr = function(s) {
3053
- const e = cr(s);
3054
- return {
3055
- /**
3056
- * To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person\'s selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn\'t meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`.
3057
- * @summary liveness check
3058
- * @param {string} transactionId ID of the current liveness transaction.
3059
- * @param {*} [options] Override http request option.
3060
- * @throws {RequiredError}
3061
- */
3062
- async getLivenessTransactionInfo(t, r) {
3063
- const n = await e.getLivenessTransactionInfo(t, r);
3064
- return T(n, m, S, s);
3065
- }
3066
- };
3067
- };
3068
- let ur = class extends z {
3069
- /**
3070
- * To verify the presence of a real person in front of a camera, use the GET `/api/v2/liveness` endpoint. When starting, you can specify `tag` which all attempts to read liveness will be bound to. If left unspecified, the application automatically generates one. The calling application returns `tag` and `transactionId`. One session may include many transactions, and from a transaction ID it is clear which session it belongs to. When specifying `tag`, note that only Latin uppercase and lowercase letters, digits, and symbols `-` and `_` are allowed. The maximum supported number of characters is 127. The metadata (device model, screen data, frame size, app ID and version, OS version, platform, SDK version, etc.), a person\'s selfie and video of the liveness detection session are stored on the backend at: `faceapi-session/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/{tag}/transactionId` By default, liveness checks operate with eventual consistency. This means that when you submit a request and receive a response, the associated data (like the selfie and session video) may be saved after the response is sent. If this doesn\'t meet your requirements, you can switch to strong consistency; refer to the [Architecture page](https://docs.regulaforensics.com/develop/face-sdk/overview/architecture/#consistency-models) for details. To access the liveness transaction data, use GET `/api/v2/liveness?transactionId={transactionId}`.
3071
- * @summary liveness check
3072
- * @param {string} transactionId ID of the current liveness transaction.
3073
- * @param {*} [options] Override http request option.
3074
- * @throws {RequiredError}
3075
- * @memberof Liveness20Api
3076
- */
3077
- getLivenessTransactionInfo(e, t) {
3078
- return lr(this.configuration).getLivenessTransactionInfo(e, t).then((r) => r(this.axios, this.basePath));
3079
- }
3080
- };
3081
- class dr {
3082
- constructor(e, t, r) {
3083
- this.superClass = new ur(e, t, r);
3084
- }
3085
- async getLivenessTransactionInfo(e, t) {
3086
- return (await this.superClass.getLivenessTransactionInfo(e, t)).data;
3087
- }
3088
- }
3089
- class Wr {
3090
- constructor(e, t = S, r = m) {
3091
- this.basePath = t, this.axios = r, this.matchApi = new Qs(e, t, r), this.groupApi = new Xs(e, t, r), this.personApi = new Zs(e, t, r), this.searchApi = new rr(e, t, r), this.diagnosticsApi = new ir(e, t, r), this.livenessApi = new dr(e, t, r);
3092
- }
3093
- }
3094
- const pr = function(s) {
3095
- return {
3096
- /**
3097
- *
3098
- * @summary Server healthcheck
3099
- * @param {string} [xRequestID] Request header label.
3100
- * @param {*} [options] Override http request option.
3101
- * @throws {RequiredError}
3102
- */
3103
- healthz: async (e, t = {}) => {
3104
- const r = "/api/healthz", n = new URL(r, R);
3105
- let o;
3106
- s && (o = s.baseOptions);
3107
- const a = { method: "GET", ...o, ...t }, i = {}, c = {};
3108
- e != null && (i["X-RequestID"] = String(e)), P(n, c);
3109
- let l = o && o.headers ? o.headers : {};
3110
- return a.headers = { ...i, ...l, ...t.headers }, {
3111
- url: g(n),
3112
- options: a
3113
- };
3114
- },
3115
- /**
3116
- *
3117
- * @summary License healthcheck
3118
- * @param {string} [xRequestID] Request header label.
3119
- * @param {*} [options] Override http request option.
3120
- * @throws {RequiredError}
3121
- */
3122
- readyz: async (e, t = {}) => {
3123
- const r = "/api/readyz", n = new URL(r, R);
3124
- let o;
3125
- s && (o = s.baseOptions);
3126
- const a = { method: "GET", ...o, ...t }, i = {}, c = {};
3127
- e != null && (i["X-RequestID"] = String(e)), P(n, c);
3128
- let l = o && o.headers ? o.headers : {};
3129
- return a.headers = { ...i, ...l, ...t.headers }, {
3130
- url: g(n),
3131
- options: a
3132
- };
3133
- }
3134
- };
3135
- }, Me = function(s) {
3136
- const e = pr(s);
3137
- return {
3138
- /**
3139
- *
3140
- * @summary Server healthcheck
3141
- * @param {string} [xRequestID] Request header label.
3142
- * @param {*} [options] Override http request option.
3143
- * @throws {RequiredError}
3144
- */
3145
- async healthz(t, r) {
3146
- const n = await e.healthz(t, r);
3147
- return T(n, m, S, s);
3148
- },
3149
- /**
3150
- *
3151
- * @summary License healthcheck
3152
- * @param {string} [xRequestID] Request header label.
3153
- * @param {*} [options] Override http request option.
3154
- * @throws {RequiredError}
3155
- */
3156
- async readyz(t, r) {
3157
- const n = await e.readyz(t, r);
3158
- return T(n, m, S, s);
3159
- }
3160
- };
3161
- };
3162
- let hr = class extends z {
3163
- /**
3164
- *
3165
- * @summary Server healthcheck
3166
- * @param {string} [xRequestID] Request header label.
3167
- * @param {*} [options] Override http request option.
3168
- * @throws {RequiredError}
3169
- * @memberof HealthcheckApi
3170
- */
3171
- healthz(e, t) {
3172
- return Me(this.configuration).healthz(e, t).then((r) => r(this.axios, this.basePath));
3173
- }
3174
- /**
3175
- *
3176
- * @summary License healthcheck
3177
- * @param {string} [xRequestID] Request header label.
3178
- * @param {*} [options] Override http request option.
3179
- * @throws {RequiredError}
3180
- * @memberof HealthcheckApi
3181
- */
3182
- readyz(e, t) {
3183
- return Me(this.configuration).readyz(e, t).then((r) => r(this.axios, this.basePath));
3184
- }
3185
- };
3186
- class Xr {
3187
- constructor(e, t, r) {
3188
- this.superClass = new hr(e, t, r);
3189
- }
3190
- async healthz(e, t) {
3191
- return (await this.superClass.healthz(e, t)).data;
3192
- }
3193
- async readyz(e, t) {
3194
- return (await this.superClass.readyz(e, t)).data;
3195
- }
3196
- }
3197
- class Jr {
3198
- constructor(e = {}) {
3199
- this.apiKey = e.apiKey, this.username = e.username, this.password = e.password, this.accessToken = e.accessToken, this.basePath = e.basePath, this.baseOptions = e.baseOptions, this.formDataCtor = e.formDataCtor;
3200
- }
3201
- /**
3202
- * Check if the given MIME is a JSON MIME.
3203
- * JSON MIME examples:
3204
- * application/json
3205
- * application/json; charset=UTF8
3206
- * APPLICATION/JSON
3207
- * application/vnd.company+json
3208
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
3209
- * @return True if the given MIME is JSON, false otherwise.
3210
- */
3211
- isJsonMime(e) {
3212
- const t = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i");
3213
- return e !== null && (t.test(e) || e.toLowerCase() === "application/json-patch+json");
3214
- }
3215
- }
3216
- export {
3217
- Jr as Configuration,
3218
- ir as DiagnosticsApi,
3219
- Ur as FaceAttribute,
3220
- Vr as FaceImageQualityAlignType,
3221
- Dr as FaceImageQualityGroups,
3222
- Gr as FaceImageQualityGroupsStrings,
3223
- Hr as FaceImageQualityStatus,
3224
- xr as FaceQualityConfigName,
3225
- Br as FaceQualityScenarios,
3226
- Mr as FaceSDKResultCode,
3227
- Wr as FaceSdk,
3228
- jr as FilterOp,
3229
- Xs as GroupApi,
3230
- Xr as HealthcheckApi,
3231
- $s as ImageSource,
3232
- dr as Liveness20Api,
3233
- kr as LivenessType,
3234
- Qs as MatchApi,
3235
- Zs as PersonApi,
3236
- rr as SearchApi
3237
- };