@sinequa/atomic 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -219
- package/dist/atomic.js +373 -362
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/index.d.ts +1 -1
- package/dist/authentication/index.d.ts.map +1 -1
- package/dist/authentication/session/index.d.ts +1 -1
- package/dist/authentication/session/index.d.ts.map +1 -1
- package/dist/authentication/session/logout.d.ts +7 -3
- package/dist/authentication/session/logout.d.ts.map +1 -1
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts +1 -0
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts +2 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/atomic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function w(e) {
|
|
2
2
|
if (typeof CustomEvent > "u" || typeof dispatchEvent > "u")
|
|
3
3
|
return;
|
|
4
4
|
const t = new CustomEvent("authenticated", {
|
|
@@ -16,46 +16,46 @@ function k(e) {
|
|
|
16
16
|
Object.assign(u, e);
|
|
17
17
|
}
|
|
18
18
|
const se = /.*\:\(?([><=\d\-\.AND ]+)\)?/;
|
|
19
|
-
function
|
|
20
|
-
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((
|
|
21
|
-
if (!
|
|
22
|
-
const s = ie(
|
|
23
|
-
return
|
|
19
|
+
function ct(e, t) {
|
|
20
|
+
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((o, a) => {
|
|
21
|
+
if (!a.value || a.value === "") return o;
|
|
22
|
+
const s = ie(a, e.column);
|
|
23
|
+
return o.push({
|
|
24
24
|
operator: s.operator,
|
|
25
25
|
value: s.value,
|
|
26
|
-
display:
|
|
26
|
+
display: a.display || s.display,
|
|
27
27
|
filters: s.filters,
|
|
28
|
-
disabled:
|
|
29
|
-
hidden:
|
|
30
|
-
}),
|
|
28
|
+
disabled: a.count === 0,
|
|
29
|
+
hidden: a.count === 0 && e.isDistribution ? !t : !1
|
|
30
|
+
}), o;
|
|
31
31
|
}, []);
|
|
32
32
|
}
|
|
33
33
|
function ie(e, t) {
|
|
34
34
|
const r = t, n = e.value.match(se);
|
|
35
35
|
if (n?.[1]) {
|
|
36
|
-
const
|
|
36
|
+
const a = (n?.[1].split(" AND ")).map((s) => {
|
|
37
37
|
const i = s.indexOf(">=") !== -1 ? "gte" : "lt";
|
|
38
38
|
let c = s.substring(s.indexOf(" ") + 1);
|
|
39
39
|
return { field: r, operator: i, value: c, display: e.display || e.value };
|
|
40
40
|
});
|
|
41
|
-
if (
|
|
42
|
-
return { field: r, operator: "and", filters:
|
|
43
|
-
if (
|
|
44
|
-
return { ...
|
|
41
|
+
if (a.length === 2)
|
|
42
|
+
return { field: r, operator: "and", filters: a, value: e.value, display: a[0].display || a[0].value };
|
|
43
|
+
if (a.length === 1)
|
|
44
|
+
return { ...a[0], field: r };
|
|
45
45
|
throw new Error("Failed to parse distribution expression");
|
|
46
46
|
}
|
|
47
47
|
return { field: r, operator: "eq", value: e.value, display: e.display };
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function lt(e, t, r) {
|
|
50
50
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
51
51
|
}
|
|
52
52
|
function ce(e) {
|
|
53
53
|
return e.items && (e.items = e.items.map((t) => ce(t))), e.items && e.items.some((t) => t.$selected || t.$opened) && (e.$opened = !0), e;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function ut(e, t) {
|
|
56
56
|
const r = [];
|
|
57
57
|
if (e.length > 0) {
|
|
58
|
-
const n = /* @__PURE__ */ new Map(),
|
|
58
|
+
const n = /* @__PURE__ */ new Map(), a = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), s = new RegExp("\\b" + a, "i");
|
|
59
59
|
e.forEach((i) => {
|
|
60
60
|
if (i.display.length > 1) {
|
|
61
61
|
const c = i.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), d = s.exec(c);
|
|
@@ -65,24 +65,24 @@ function lt(e, t) {
|
|
|
65
65
|
}
|
|
66
66
|
return r;
|
|
67
67
|
}
|
|
68
|
-
function T(e, t, r, n,
|
|
68
|
+
function T(e, t, r, n, o, a, s) {
|
|
69
69
|
const i = n.indexOf("/", r.length), c = n.substring(0, i + 1);
|
|
70
70
|
let d = t.get(c);
|
|
71
71
|
if (!d) {
|
|
72
72
|
const _ = c.replace(/^\/|\/$/g, "");
|
|
73
73
|
d = {
|
|
74
74
|
value: n.substring(r.length, i),
|
|
75
|
-
count:
|
|
75
|
+
count: o,
|
|
76
76
|
items: [],
|
|
77
77
|
hasChildren: !1,
|
|
78
|
-
$level:
|
|
78
|
+
$level: a,
|
|
79
79
|
$opened: s >= c.length,
|
|
80
80
|
$path: _
|
|
81
81
|
}, t.set(c, d), e.push(d);
|
|
82
82
|
}
|
|
83
|
-
c.length < n.length && (d.hasChildren = !0, T(d.items, t, c, n,
|
|
83
|
+
c.length < n.length && (d.hasChildren = !0, T(d.items, t, c, n, o, a + 1, s));
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function dt(e, t) {
|
|
86
86
|
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
87
87
|
}
|
|
88
88
|
const le = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, ue = 2, M = 3, de = 5, X = 6, fe = 8, Y = 9, he = 11, K = 12, ge = 14, Z = 15;
|
|
@@ -110,61 +110,61 @@ function G(e) {
|
|
|
110
110
|
}
|
|
111
111
|
}).join(" ");
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function ft(e, t, r) {
|
|
114
114
|
let n = A(e);
|
|
115
|
-
for (let
|
|
116
|
-
n.push({ type: "adjacent", value:
|
|
115
|
+
for (let o of t)
|
|
116
|
+
n.push({ type: "adjacent", value: o, op: r });
|
|
117
117
|
return G(n);
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
const r = A(t), n = r.findIndex((
|
|
119
|
+
function ht(e, t) {
|
|
120
|
+
const r = A(t), n = r.findIndex((o) => o.value === e);
|
|
121
121
|
return n !== -1 ? (r.splice(n, 1), t = G(r)) : t;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function gt(e) {
|
|
124
124
|
const t = A(e).filter((r) => r.type !== "adjacent");
|
|
125
125
|
return G(t);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function pt(e) {
|
|
128
128
|
return A(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset:
|
|
132
|
-
return n.format(
|
|
130
|
+
function mt(e, t, r) {
|
|
131
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: o, unit: a, isFuture: s } = pe(t, r);
|
|
132
|
+
return n.format(o * (s ? 1 : -1), a);
|
|
133
133
|
}
|
|
134
134
|
function pe(e, t) {
|
|
135
|
-
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(),
|
|
135
|
+
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), o = Math.abs(n.getTime() - r.getTime());
|
|
136
136
|
return {
|
|
137
|
-
offset: Math.floor(
|
|
137
|
+
offset: Math.floor(o / (1e3 * 60 * 60 * 24)),
|
|
138
138
|
unit: "day",
|
|
139
139
|
isFuture: r > n
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function wt(e) {
|
|
143
143
|
const t = e.target;
|
|
144
144
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function _t(e) {
|
|
147
147
|
if (e === void 0) return;
|
|
148
|
-
const { q: t, f: r, p: n, s:
|
|
148
|
+
const { q: t, f: r, p: n, s: o, t: a, n: s, b: i } = x(e), [c] = e.split("?");
|
|
149
149
|
return {
|
|
150
150
|
path: c,
|
|
151
151
|
text: t,
|
|
152
152
|
filters: r ? ee(r) : void 0,
|
|
153
153
|
page: n ? parseInt(n, 10) : void 0,
|
|
154
|
-
sort:
|
|
155
|
-
tab:
|
|
154
|
+
sort: o,
|
|
155
|
+
tab: a,
|
|
156
156
|
name: s,
|
|
157
157
|
basket: i
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function St(e) {
|
|
161
161
|
if (!e) return "";
|
|
162
|
-
const { text: t, filters: r, page: n, sort:
|
|
163
|
-
t && (c.q = t), r && (c.f = JSON.stringify(r)), n && (c.p = n.toString()),
|
|
162
|
+
const { text: t, filters: r, page: n, sort: o, tab: a, name: s, basket: i } = e, c = {};
|
|
163
|
+
t && (c.q = t), r && (c.f = JSON.stringify(r)), n && (c.p = n.toString()), o && (c.s = o), a && (c.t = a), s && (c.n = s), i && (c.b = i);
|
|
164
164
|
const d = new URLSearchParams(c).toString();
|
|
165
165
|
return d || "";
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function kt(e) {
|
|
168
168
|
if (e === void 0) return [];
|
|
169
169
|
const { f: t } = x(e);
|
|
170
170
|
return ee(t);
|
|
@@ -183,49 +183,49 @@ function x(e) {
|
|
|
183
183
|
const r = new URLSearchParams(t);
|
|
184
184
|
return Object.fromEntries(r);
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function bt(e) {
|
|
187
187
|
const { q: t = "" } = x(e);
|
|
188
188
|
return t;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function vt(e) {
|
|
191
191
|
const { id: t } = x(e);
|
|
192
192
|
return decodeURIComponent(t);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Ct(e) {
|
|
195
195
|
const { p: t = "0" } = x(e);
|
|
196
196
|
return parseInt(t, 10);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Rt(e) {
|
|
199
199
|
const { t } = x(e);
|
|
200
200
|
return t;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function Pt(e, t) {
|
|
203
203
|
if (!e)
|
|
204
204
|
return e;
|
|
205
205
|
let r = 0;
|
|
206
206
|
const n = e.length;
|
|
207
|
-
let
|
|
208
|
-
if (e[
|
|
209
|
-
for (;
|
|
210
|
-
|
|
211
|
-
e[
|
|
207
|
+
let o = 0;
|
|
208
|
+
if (e[o] === "[") {
|
|
209
|
+
for (; o < n && /[0-9]/.test(e[o]); )
|
|
210
|
+
o++;
|
|
211
|
+
e[o] === "]" && (r = o + 1);
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
if (!
|
|
213
|
+
const a = q(e, r, !1);
|
|
214
|
+
if (!a)
|
|
215
215
|
return e;
|
|
216
216
|
const s = t.charCodeAt(0), i = t.charCodeAt(1);
|
|
217
|
-
let c =
|
|
217
|
+
let c = a;
|
|
218
218
|
for (; c; )
|
|
219
219
|
if (s === c.lang1 && i === c.lang2) {
|
|
220
220
|
const _ = q(e, c.end + 4, !0);
|
|
221
221
|
return e.substring(_.start, _.end);
|
|
222
222
|
} else
|
|
223
223
|
c = q(e, c.end + 4, !1);
|
|
224
|
-
const d = e.substring(
|
|
224
|
+
const d = e.substring(a.start, a.end);
|
|
225
225
|
return d || e;
|
|
226
226
|
}
|
|
227
227
|
function q(e, t, r) {
|
|
228
|
-
for (let n = t,
|
|
228
|
+
for (let n = t, o = e.length - 3; n < o; n++)
|
|
229
229
|
if (e[n] === "[" && e[n + 3] === "]")
|
|
230
230
|
return {
|
|
231
231
|
start: t,
|
|
@@ -241,9 +241,9 @@ function q(e, t, r) {
|
|
|
241
241
|
lang2: -1
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const { useLocale: r, useLocaleAsPrefix: n, indexFile:
|
|
246
|
-
return [
|
|
244
|
+
function yt(e, t) {
|
|
245
|
+
const { useLocale: r, useLocaleAsPrefix: n, indexFile: o, path: a, folder: s } = t, i = r ? `${e}/` : null, c = n ? `${e}.${o}` : o ?? "";
|
|
246
|
+
return [a, s, `${i || ""}${c}`].filter((d) => d !== void 0).join("/");
|
|
247
247
|
}
|
|
248
248
|
function U(e) {
|
|
249
249
|
const t = new CustomEvent("notification", {
|
|
@@ -253,7 +253,7 @@ function U(e) {
|
|
|
253
253
|
});
|
|
254
254
|
dispatchEvent(t);
|
|
255
255
|
}
|
|
256
|
-
const
|
|
256
|
+
const xt = {
|
|
257
257
|
success: (e, t) => {
|
|
258
258
|
U({
|
|
259
259
|
type: "success",
|
|
@@ -288,25 +288,25 @@ let D = {
|
|
|
288
288
|
level: 1,
|
|
289
289
|
enableConsoleOutput: !0
|
|
290
290
|
};
|
|
291
|
-
function
|
|
291
|
+
function Lt(e) {
|
|
292
292
|
D = { ...D, ...e };
|
|
293
293
|
}
|
|
294
294
|
function N(e, t, r) {
|
|
295
295
|
if (e < D.level) return;
|
|
296
|
-
const
|
|
296
|
+
const o = `${`[${te[e]}]`} ${t}`;
|
|
297
297
|
if (D.enableConsoleOutput)
|
|
298
298
|
switch (e) {
|
|
299
299
|
case 0:
|
|
300
|
-
console.debug(
|
|
300
|
+
console.debug(o, r || "");
|
|
301
301
|
break;
|
|
302
302
|
case 1:
|
|
303
|
-
console.info(
|
|
303
|
+
console.info(o, r || "");
|
|
304
304
|
break;
|
|
305
305
|
case 2:
|
|
306
|
-
console.warn(
|
|
306
|
+
console.warn(o, r || "");
|
|
307
307
|
break;
|
|
308
308
|
case 3:
|
|
309
|
-
console.error(
|
|
309
|
+
console.error(o, r || "");
|
|
310
310
|
break;
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -325,8 +325,8 @@ function f(e, t) {
|
|
|
325
325
|
function O(e) {
|
|
326
326
|
const t = W(), r = new Headers(e);
|
|
327
327
|
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
328
|
-
const { userOverride: n, userOverrideActive:
|
|
329
|
-
return
|
|
328
|
+
const { userOverride: n, userOverrideActive: o, bearerToken: a } = u;
|
|
329
|
+
return a && r.append("Authorization", `Bearer ${a}`), n && o && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
330
330
|
}
|
|
331
331
|
class R extends Error {
|
|
332
332
|
status;
|
|
@@ -381,13 +381,13 @@ async function B(e, t) {
|
|
|
381
381
|
};
|
|
382
382
|
if (r || !n)
|
|
383
383
|
throw t === 401 ? new V() : t === 500 ? new E() : new R(`Request failed with status ${t}`, t);
|
|
384
|
-
const
|
|
384
|
+
const o = JSON.parse(new TextDecoder().decode(n));
|
|
385
385
|
throw new Error(
|
|
386
|
-
|
|
386
|
+
o.errorMessage || o.message || `Request failed with status ${t}`,
|
|
387
387
|
{
|
|
388
388
|
cause: {
|
|
389
|
-
errorCode:
|
|
390
|
-
errorCodeTest:
|
|
389
|
+
errorCode: o.errorCode,
|
|
390
|
+
errorCodeTest: o.errorCodeTest
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
);
|
|
@@ -399,7 +399,7 @@ async function B(e, t) {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
async function we(e, t, r) {
|
|
402
|
-
const n = O(r?.headers), { backendUrl:
|
|
402
|
+
const n = O(r?.headers), { backendUrl: o } = u, a = t ? `?${new URLSearchParams(t)}` : "", s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
403
403
|
L(`Making DELETE request to: ${s}`);
|
|
404
404
|
try {
|
|
405
405
|
const i = await fetch(s, {
|
|
@@ -412,10 +412,10 @@ async function we(e, t, r) {
|
|
|
412
412
|
throw f("Error making DELETE request:", i), i;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
async function
|
|
416
|
-
const n = O(r?.headers), { backendUrl:
|
|
415
|
+
async function m(e, t, r) {
|
|
416
|
+
const n = O(r?.headers), { backendUrl: o } = u, a = t ? `?${new URLSearchParams(t)}` : "";
|
|
417
417
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
418
|
-
const s =
|
|
418
|
+
const s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
419
419
|
L(`Making GET request to: ${s}`);
|
|
420
420
|
try {
|
|
421
421
|
const i = await fetch(s, {
|
|
@@ -432,13 +432,13 @@ async function w(e, t, r) {
|
|
|
432
432
|
async function _e(e, t, r) {
|
|
433
433
|
const n = O(r?.headers);
|
|
434
434
|
n.append("content-type", "application/json");
|
|
435
|
-
const { app:
|
|
436
|
-
app:
|
|
435
|
+
const { app: o, backendUrl: a } = u, s = {
|
|
436
|
+
app: o,
|
|
437
437
|
...t,
|
|
438
438
|
locale: t.locale || navigator.language,
|
|
439
439
|
noUserOverride: !0,
|
|
440
440
|
noAutoAuthentication: !0
|
|
441
|
-
}, i =
|
|
441
|
+
}, i = a ? `${a}/${e}` : `${e}`;
|
|
442
442
|
L(`Making PATCH request to: ${i}`);
|
|
443
443
|
try {
|
|
444
444
|
const c = await fetch(i, {
|
|
@@ -453,17 +453,17 @@ async function _e(e, t, r) {
|
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
async function l(e, t, r) {
|
|
456
|
-
const n = O(r?.headers), { app:
|
|
456
|
+
const n = O(r?.headers), { app: o, backendUrl: a } = u;
|
|
457
457
|
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
458
458
|
const s = {
|
|
459
|
-
app:
|
|
459
|
+
app: o,
|
|
460
460
|
...t,
|
|
461
461
|
locale: t.locale || navigator.language,
|
|
462
462
|
noUserOverride: !0,
|
|
463
463
|
noAutoAuthentication: !0
|
|
464
464
|
};
|
|
465
465
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
466
|
-
const i =
|
|
466
|
+
const i = a ? `${a}/${e}` : `${e}`;
|
|
467
467
|
L(`Making POST request to: ${i}`);
|
|
468
468
|
try {
|
|
469
469
|
const c = await fetch(i, {
|
|
@@ -478,14 +478,14 @@ async function l(e, t, r) {
|
|
|
478
478
|
throw f("Error making POST request:", c), c;
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
async function
|
|
482
|
-
const n = O(r?.headers), { app:
|
|
483
|
-
app:
|
|
481
|
+
async function Ot(e, t, r) {
|
|
482
|
+
const n = O(r?.headers), { app: o, backendUrl: a } = u, s = {
|
|
483
|
+
app: o,
|
|
484
484
|
...t,
|
|
485
485
|
locale: t.locale || navigator.language,
|
|
486
486
|
noUserOverride: !0,
|
|
487
487
|
noAutoAuthentication: !0
|
|
488
|
-
}, i = `${
|
|
488
|
+
}, i = `${a}/${e}`;
|
|
489
489
|
L(`Making PUT request to: ${i}`);
|
|
490
490
|
try {
|
|
491
491
|
const c = await fetch(i, {
|
|
@@ -510,42 +510,42 @@ function re(e) {
|
|
|
510
510
|
const t = new Date(e);
|
|
511
511
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function $t(e) {
|
|
514
514
|
const t = re(e);
|
|
515
515
|
return !!t && t.getTime() <= Date.now();
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function Ut(e, t = 7) {
|
|
518
518
|
const r = re(e);
|
|
519
519
|
if (!r) return !1;
|
|
520
|
-
const n = Date.now(),
|
|
521
|
-
return
|
|
520
|
+
const n = Date.now(), o = n + t * 24 * 60 * 60 * 1e3, a = r.getTime();
|
|
521
|
+
return a > n && a <= o;
|
|
522
522
|
}
|
|
523
|
-
async function
|
|
523
|
+
async function Dt(e, t = 0, r = 1e3) {
|
|
524
524
|
let n;
|
|
525
|
-
for (let
|
|
525
|
+
for (let o = 0; o <= t; o++)
|
|
526
526
|
try {
|
|
527
527
|
return await e();
|
|
528
|
-
} catch (
|
|
529
|
-
if (n =
|
|
530
|
-
throw
|
|
531
|
-
|
|
528
|
+
} catch (a) {
|
|
529
|
+
if (n = a, a instanceof R && a.status >= 400 && a.status < 500 && a.status !== 429 || a instanceof DOMException && a.name === "AbortError")
|
|
530
|
+
throw a;
|
|
531
|
+
o < t && (y(`Retrying request (${o + 1}/${t})`, { error: a }), await new Promise((s) => setTimeout(s, r)));
|
|
532
532
|
}
|
|
533
533
|
throw n;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function It(e, t, r) {
|
|
536
536
|
if (!e || !t) return;
|
|
537
537
|
if (r) {
|
|
538
|
-
const
|
|
538
|
+
const a = Object.keys(t.queries).find((c) => c === r?.toLowerCase());
|
|
539
539
|
let s;
|
|
540
|
-
|
|
540
|
+
a && (s = t.queries[a]);
|
|
541
541
|
const i = (s?.columnsInfo?.columns || [])?.find((c) => c.aliases?.split(",")?.includes(e));
|
|
542
542
|
if (i) return i.name;
|
|
543
543
|
}
|
|
544
|
-
const n = t.indexes?._?.columns,
|
|
545
|
-
if (
|
|
544
|
+
const n = t.indexes?._?.columns, o = Object.entries(n).find((a) => a[1].aliases?.includes(e));
|
|
545
|
+
if (o) return o[0];
|
|
546
546
|
}
|
|
547
|
-
var C = /* @__PURE__ */ ((e) => (e.None = "None", e.Search_FirstPage = "Search_FirstPage", e.Search_Text = "Search_Text", e.Search_Refine = "Search_Refine", e.Search_Select_Item = "Search_Select_Item", e.Search_Select_Custom = "Search_Select_Custom", e.Search_Select_Concept = "Search_Select_Concept", e.Search_Select_Correction = "Search_Select_Correction", e.Search_GotoPage = "Search_GotoPage", e.Search_GotoTab = "Search_GotoTab", e.Search_DisplayResult = "Search_DisplayResult", e.Search_RemoveResult = "Search_RemoveResult", e.Search_RemoveAdvanced = "Search_RemoveAdvanced", e.Search_SavedQuery = "Search_SavedQuery", e.Search_WebService = "Search_WebService", e.Search_DidYouMean_Original = "Search_DidYouMean_Original", e.Search_DidYouMean_Correction = "Search_DidYouMean_Correction", e.Search_ExportCSV = "Search_ExportCSV", e.Search_SavedQuery_ExportCSV = "Search_SavedQuery_ExportCSV", e.Search_Selection_ExportCSV = "Search_Selection_ExportCSV", e.Search_AlertQuery = "Search_AlertQuery", e.Search_Select_AnalyticsItem = "Search_Select_AnalyticsItem", e.Search_Sort = "Search_Sort", e.Search_Exit_Logout = "Search_Exit_Logout", e.Search_Timeline_Usage = "Search_Timeline_Usage", e.Search_AutoComplete = "Search_Autocomplete", e.Search_Login_Success = "Login_Success_Form", e.Search_QueryIntent_Detected = "Search_QueryIntent_Detected", e.SavedQuery_Add = "SavedQuery_Add", e.SavedQuery_Delete = "SavedQuery_Delete", e.SavedQuery_DeleteAll = "SavedQuery_DeleteAll", e.SavedQuery_Rename = "SavedQuery_Rename", e.Alert_Edit = "Alert_Edit", e.Alert_Delete = "Alert_Delete", e.Alert_DeleteAll = "Alert_DeleteAll", e.Link_Display = "Link_Display", e.Link_Click = "Link_Click", e.Basket_Add = "Basket_Add", e.Basket_Delete = "Basket_Delete", e.Basket_DeleteAll = "Basket_DeleteAll", e.Basket_Rename = "Basket_Rename", e.Basket_AddDoc = "Basket_AddDoc", e.Basket_RemoveDoc = "Basket_RemoveDoc", e.Basket_Open = "Basket_Open", e.Basket_ExportCSV = "Basket_ExportCSV", e.Label_Add = "Label_Add", e.Label_Delete = "Label_Delete", e.Label_Rename = "Label_Rename", e.Label_Open = "Label_Open", e.Label_AddDoc = "Label_AddDoc", e.Label_RemoveDoc = "Label_RemoveDoc", e.Label_ExportCSV = "Label_ExportCSV", e.Label_Menu_ExportCSV = "Label_Menu_ExportCSV", e.Rating_Set = "Rating_Set", e.Rating_Delete = "Rating_Delete", e.Doc_Preview = "Doc_Preview", e.Doc_CacheHtml = "Doc_CacheHtml", e.Doc_CachePdf = "Doc_CachePdf", e.Doc_CacheOriginal = "Doc_CacheOriginal", e.Doc_Url1 = "Doc_Url1", e.Doc_Url2 = "Doc_Url2", e.Preview_Close = "Preview_Close", e.Click_ResultLink = "Click_ResultLink", e.Click_ResultLink1 = "Click_ResultLink1", e.Click_ResultLink2 = "Click_ResultLink2", e.Click_ResultLink3 = "Click_ResultLink3", e.Click_ResultLink4 = "Click_ResultLink4", e.Click_ResultLink5 = "Click_ResultLink5", e.Click_ResultLink6 = "Click_ResultLink6", e.Click_ResultLink7 = "Click_ResultLink7", e.Click_ResultLink8 = "Click_ResultLink8", e.Click_ResultLink9 = "Click_ResultLink9", e.Click_ResultLink10 = "Click_ResultLink10", e.Click_PreviewLink1 = "Click_PreviewLink1", e.Click_PreviewLink2 = "Click_PreviewLink2", e.Click_PreviewLink3 = "Click_PreviewLink3", e.Click_PreviewLink4 = "Click_PreviewLink4", e.Click_PreviewLink5 = "Click_PreviewLink5", e.Click_PreviewLink6 = "Click_PreviewLink6", e.Click_PreviewLink7 = "Click_PreviewLink7", e.Click_PreviewLink8 = "Click_PreviewLink8", e.Click_PreviewLink9 = "Click_PreviewLink9", e.Click_PreviewLink10 = "Click_PreviewLink10", e.RFM_ClickSet = "RFM_ClickSet", e.RFM_ClickReset = "RFM_ClickReset", e.RFM_Like = "RFM_Like", e.RFM_LikeReset = "RFM_LikeReset", e.RFM_Dislike = "RFM_Dislike", e.RFM_Important = "RFM_Important", e.RFM_ImportantReset = "RFM_ImportantReset", e.RFM_Ban = "RFM_Ban", e.Navigation_Exit = "Navigation_Exit", e.Navigation_Return = "Navigation_Return", e.Navigation_Route = "Navigation_Route", e.Answer_Display = "Answer_Display", e.Answer_Click = "Answer_Click", e.Answer_Result = "Answer_Result", e.Answer_Liked = "Answer_Liked", e.Answer_Disliked = "Answer_Disliked", e.Answer_Liked_Cancelled = "Answer_Liked_Cancelled", e.Answer_Disliked_Cancelled = "Answer_Disliked_Cancelled", e.TopPassages_Display = "TopPassages_Display", e.TopPassages_Click = "TopPassages_Click", e.UserSettings_Reset = "UserSettings_Reset", e.Change_Password_Failed = "change.password.failed", e.Change_Password_Success_Form = "change.password.success.form", e.Forgot_Password_Request = "forgot.password.request", e.Login_Denied = "login.denied", e.Login_Success_Form = "login.success.form", e.Send_Reset_Password_Link = "send.reset.password.link", e.Xrest_ChangePassword = "xrest.changepassword", e))(C || {}), h = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.bool = 1] = "bool", e[e.date = 2] = "date", e[e.dateTime = 3] = "dateTime", e[e.time = 4] = "time", e[e.unsigned = 5] = "unsigned", e[e.integer = 6] = "integer", e[e.float = 7] = "float", e[e.double = 8] = "double", e[e.dates = 9] = "dates", e[e.dateTimes = 10] = "dateTimes", e[e.times = 11] = "times", e[e.varchar = 12] = "varchar", e[e.binary = 13] = "binary", e[e.string = 14] = "string", e[e.csv = 15] = "csv", e))(h || {}),
|
|
548
|
-
const
|
|
547
|
+
var C = /* @__PURE__ */ ((e) => (e.None = "None", e.Search_FirstPage = "Search_FirstPage", e.Search_Text = "Search_Text", e.Search_Refine = "Search_Refine", e.Search_Select_Item = "Search_Select_Item", e.Search_Select_Custom = "Search_Select_Custom", e.Search_Select_Concept = "Search_Select_Concept", e.Search_Select_Correction = "Search_Select_Correction", e.Search_GotoPage = "Search_GotoPage", e.Search_GotoTab = "Search_GotoTab", e.Search_DisplayResult = "Search_DisplayResult", e.Search_RemoveResult = "Search_RemoveResult", e.Search_RemoveAdvanced = "Search_RemoveAdvanced", e.Search_SavedQuery = "Search_SavedQuery", e.Search_WebService = "Search_WebService", e.Search_DidYouMean_Original = "Search_DidYouMean_Original", e.Search_DidYouMean_Correction = "Search_DidYouMean_Correction", e.Search_ExportCSV = "Search_ExportCSV", e.Search_SavedQuery_ExportCSV = "Search_SavedQuery_ExportCSV", e.Search_Selection_ExportCSV = "Search_Selection_ExportCSV", e.Search_AlertQuery = "Search_AlertQuery", e.Search_Select_AnalyticsItem = "Search_Select_AnalyticsItem", e.Search_Sort = "Search_Sort", e.Search_Exit_Logout = "Search_Exit_Logout", e.Search_Timeline_Usage = "Search_Timeline_Usage", e.Search_AutoComplete = "Search_Autocomplete", e.Search_Login_Success = "Login_Success_Form", e.Search_QueryIntent_Detected = "Search_QueryIntent_Detected", e.SavedQuery_Add = "SavedQuery_Add", e.SavedQuery_Delete = "SavedQuery_Delete", e.SavedQuery_DeleteAll = "SavedQuery_DeleteAll", e.SavedQuery_Rename = "SavedQuery_Rename", e.Alert_Edit = "Alert_Edit", e.Alert_Delete = "Alert_Delete", e.Alert_DeleteAll = "Alert_DeleteAll", e.Link_Display = "Link_Display", e.Link_Click = "Link_Click", e.Basket_Add = "Basket_Add", e.Basket_Delete = "Basket_Delete", e.Basket_DeleteAll = "Basket_DeleteAll", e.Basket_Rename = "Basket_Rename", e.Basket_AddDoc = "Basket_AddDoc", e.Basket_RemoveDoc = "Basket_RemoveDoc", e.Basket_Open = "Basket_Open", e.Basket_ExportCSV = "Basket_ExportCSV", e.Label_Add = "Label_Add", e.Label_Delete = "Label_Delete", e.Label_Rename = "Label_Rename", e.Label_Open = "Label_Open", e.Label_AddDoc = "Label_AddDoc", e.Label_RemoveDoc = "Label_RemoveDoc", e.Label_ExportCSV = "Label_ExportCSV", e.Label_Menu_ExportCSV = "Label_Menu_ExportCSV", e.Rating_Set = "Rating_Set", e.Rating_Delete = "Rating_Delete", e.Doc_Preview = "Doc_Preview", e.Doc_CacheHtml = "Doc_CacheHtml", e.Doc_CachePdf = "Doc_CachePdf", e.Doc_CacheOriginal = "Doc_CacheOriginal", e.Doc_Url1 = "Doc_Url1", e.Doc_Url2 = "Doc_Url2", e.Preview_Close = "Preview_Close", e.Click_ResultLink = "Click_ResultLink", e.Click_ResultLink1 = "Click_ResultLink1", e.Click_ResultLink2 = "Click_ResultLink2", e.Click_ResultLink3 = "Click_ResultLink3", e.Click_ResultLink4 = "Click_ResultLink4", e.Click_ResultLink5 = "Click_ResultLink5", e.Click_ResultLink6 = "Click_ResultLink6", e.Click_ResultLink7 = "Click_ResultLink7", e.Click_ResultLink8 = "Click_ResultLink8", e.Click_ResultLink9 = "Click_ResultLink9", e.Click_ResultLink10 = "Click_ResultLink10", e.Click_PreviewLink1 = "Click_PreviewLink1", e.Click_PreviewLink2 = "Click_PreviewLink2", e.Click_PreviewLink3 = "Click_PreviewLink3", e.Click_PreviewLink4 = "Click_PreviewLink4", e.Click_PreviewLink5 = "Click_PreviewLink5", e.Click_PreviewLink6 = "Click_PreviewLink6", e.Click_PreviewLink7 = "Click_PreviewLink7", e.Click_PreviewLink8 = "Click_PreviewLink8", e.Click_PreviewLink9 = "Click_PreviewLink9", e.Click_PreviewLink10 = "Click_PreviewLink10", e.RFM_ClickSet = "RFM_ClickSet", e.RFM_ClickReset = "RFM_ClickReset", e.RFM_Like = "RFM_Like", e.RFM_LikeReset = "RFM_LikeReset", e.RFM_Dislike = "RFM_Dislike", e.RFM_Important = "RFM_Important", e.RFM_ImportantReset = "RFM_ImportantReset", e.RFM_Ban = "RFM_Ban", e.Navigation_Exit = "Navigation_Exit", e.Navigation_Return = "Navigation_Return", e.Navigation_Route = "Navigation_Route", e.Answer_Display = "Answer_Display", e.Answer_Click = "Answer_Click", e.Answer_Result = "Answer_Result", e.Answer_Liked = "Answer_Liked", e.Answer_Disliked = "Answer_Disliked", e.Answer_Liked_Cancelled = "Answer_Liked_Cancelled", e.Answer_Disliked_Cancelled = "Answer_Disliked_Cancelled", e.TopPassages_Display = "TopPassages_Display", e.TopPassages_Click = "TopPassages_Click", e.UserSettings_Reset = "UserSettings_Reset", e.Change_Password_Failed = "change.password.failed", e.Change_Password_Success_Form = "change.password.success.form", e.Forgot_Password_Request = "forgot.password.request", e.Login_Denied = "login.denied", e.Login_Success_Form = "login.success.form", e.Send_Reset_Password_Link = "send.reset.password.link", e.Xrest_ChangePassword = "xrest.changepassword", e))(C || {}), h = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.bool = 1] = "bool", e[e.date = 2] = "date", e[e.dateTime = 3] = "dateTime", e[e.time = 4] = "time", e[e.unsigned = 5] = "unsigned", e[e.integer = 6] = "integer", e[e.float = 7] = "float", e[e.double = 8] = "double", e[e.dates = 9] = "dates", e[e.dateTimes = 10] = "dateTimes", e[e.times = 11] = "times", e[e.varchar = 12] = "varchar", e[e.binary = 13] = "binary", e[e.string = 14] = "string", e[e.csv = 15] = "csv", e))(h || {}), p = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.a = 2053] = "a", e[e.c = 4] = "c", e[e.d = 8] = "d", e[e.e = 2068] = "e", e[e.i = 256] = "i", e[e.l = 2052] = "l", e[e.n = 8192] = "n", e[e.t = 524292] = "t", e[e.x = 8388608] = "x", e[e.z = 33554432] = "z", e[e.f_ordinal = 8192] = "f_ordinal", e[e.f_multidates = 8192] = "f_multidates", e[e.f_varchar = 33554432] = "f_varchar", e[e.f_binary = 33562624] = "f_binary", e[e.f_string = 33562888] = "f_string", e[e.f_csv = 42477853] = "f_csv", e[e.f_overridable = 33554696] = "f_overridable", e))(p || {});
|
|
548
|
+
const At = "1.0";
|
|
549
549
|
var Se = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(Se || {}), ke = /* @__PURE__ */ ((e) => (e[e.none = 0] = "none", e[e.positiveRate = 1] = "positiveRate", e[e.mainlyPosRate = 2] = "mainlyPosRate", e[e.unrate = 4] = "unrate", e[e.mainlyNegRate = 8] = "mainlyNegRate", e[e.negativeRate = 16] = "negativeRate", e[e.all = 31] = "all", e[e.positiveOnly = 7] = "positiveOnly", e[e.negativeOnly = 28] = "negativeOnly", e[e.personalAll = 21] = "personalAll", e[e.personalPosOnly = 5] = "personalPosOnly", e[e.personalNegOnly = 20] = "personalNegOnly", e))(ke || {});
|
|
550
550
|
function be(e) {
|
|
551
551
|
if (!e)
|
|
@@ -589,67 +589,67 @@ function be(e) {
|
|
|
589
589
|
function ve(e) {
|
|
590
590
|
switch (e) {
|
|
591
591
|
case "a":
|
|
592
|
-
return
|
|
592
|
+
return p.a;
|
|
593
593
|
case "c":
|
|
594
|
-
return
|
|
594
|
+
return p.c;
|
|
595
595
|
case "d":
|
|
596
|
-
return
|
|
596
|
+
return p.d;
|
|
597
597
|
case "e":
|
|
598
|
-
return
|
|
598
|
+
return p.e;
|
|
599
599
|
case "i":
|
|
600
|
-
return
|
|
600
|
+
return p.i;
|
|
601
601
|
case "l":
|
|
602
|
-
return
|
|
602
|
+
return p.l;
|
|
603
603
|
case "n":
|
|
604
|
-
return
|
|
604
|
+
return p.n;
|
|
605
605
|
case "t":
|
|
606
|
-
return
|
|
606
|
+
return p.t;
|
|
607
607
|
case "x":
|
|
608
|
-
return
|
|
608
|
+
return p.x;
|
|
609
609
|
case "z":
|
|
610
|
-
return
|
|
610
|
+
return p.z;
|
|
611
611
|
default:
|
|
612
|
-
return
|
|
612
|
+
return p.none;
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
function Ce(e) {
|
|
616
|
-
let t =
|
|
616
|
+
let t = p.none;
|
|
617
617
|
if (e)
|
|
618
618
|
for (const r of e)
|
|
619
619
|
t |= ve(r);
|
|
620
620
|
return t;
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
const
|
|
622
|
+
function g(e, t, r, n) {
|
|
623
|
+
const o = be(t), a = Ce(r || "");
|
|
624
624
|
return {
|
|
625
625
|
name: e,
|
|
626
626
|
type: t,
|
|
627
627
|
typeModifier: r,
|
|
628
|
-
eType:
|
|
629
|
-
eTypeModifier:
|
|
628
|
+
eType: o,
|
|
629
|
+
eTypeModifier: a,
|
|
630
630
|
aliases: n
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
id:
|
|
635
|
-
text:
|
|
636
|
-
documentlanguages:
|
|
637
|
-
databasealias:
|
|
638
|
-
globalrelevance:
|
|
639
|
-
matchingpartnames:
|
|
640
|
-
matchlocations:
|
|
641
|
-
matchlocationsperpartname:
|
|
633
|
+
const Nt = {
|
|
634
|
+
id: g("id", "string"),
|
|
635
|
+
text: g("text", "varchar"),
|
|
636
|
+
documentlanguages: g("documentlanguages", "csv", "ci", ["language"]),
|
|
637
|
+
databasealias: g("databasealias", "varchar"),
|
|
638
|
+
globalrelevance: g("globalrelevance", "double"),
|
|
639
|
+
matchingpartnames: g("matchingpartnames", "csv"),
|
|
640
|
+
matchlocations: g("matchlocations", "csv"),
|
|
641
|
+
matchlocationsperpartname: g("matchlocationsperpartname", "varchar"),
|
|
642
642
|
// json
|
|
643
|
-
extracts:
|
|
644
|
-
extractsperpartname:
|
|
643
|
+
extracts: g("extracts", "csv"),
|
|
644
|
+
extractsperpartname: g("extractsperpartname", "varchar"),
|
|
645
645
|
// json
|
|
646
|
-
extractslocations:
|
|
647
|
-
documentweight:
|
|
648
|
-
groupcount:
|
|
649
|
-
accesslists:
|
|
646
|
+
extractslocations: g("extractslocations", "csv"),
|
|
647
|
+
documentweight: g("documentweight", "varchar"),
|
|
648
|
+
groupcount: g("groupcount", "integer"),
|
|
649
|
+
accesslists: g("accesslists", "varchar", void 0, ["accessLists"])
|
|
650
650
|
// json
|
|
651
651
|
};
|
|
652
|
-
function
|
|
652
|
+
function Ft(e, t) {
|
|
653
653
|
let r = e[t];
|
|
654
654
|
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
655
655
|
if (typeof n == "string") return n.trim();
|
|
@@ -657,19 +657,19 @@ function Nt(e, t) {
|
|
|
657
657
|
return n.display.trim();
|
|
658
658
|
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function qt(e, t) {
|
|
661
661
|
let r = e[t];
|
|
662
662
|
if (r === void 0) return [];
|
|
663
663
|
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
664
|
-
return r.map((
|
|
665
|
-
if (typeof
|
|
666
|
-
return { display:
|
|
667
|
-
if (typeof
|
|
668
|
-
const
|
|
669
|
-
return { display:
|
|
664
|
+
return r.map((o) => {
|
|
665
|
+
if (typeof o == "string")
|
|
666
|
+
return { display: o.trim(), value: o.trim() };
|
|
667
|
+
if (typeof o == "object" && o !== null && "display" in o) {
|
|
668
|
+
const a = o.display.trim(), s = "value" in o ? String(o.value).trim() : a;
|
|
669
|
+
return { display: a, value: s };
|
|
670
670
|
}
|
|
671
671
|
}).filter(
|
|
672
|
-
(
|
|
672
|
+
(o) => o !== void 0
|
|
673
673
|
);
|
|
674
674
|
const n = String(r).trim();
|
|
675
675
|
return [{ display: n, value: n }];
|
|
@@ -689,7 +689,7 @@ function ye(e) {
|
|
|
689
689
|
function xe(e) {
|
|
690
690
|
return typeof e == "string";
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function Bt(e) {
|
|
693
693
|
return (F(e) || Array.isArray(e)) && !Re(e) && !Pe(e) && !xe(e);
|
|
694
694
|
}
|
|
695
695
|
function Le(e) {
|
|
@@ -698,23 +698,23 @@ function Le(e) {
|
|
|
698
698
|
function Oe(e = !0) {
|
|
699
699
|
let t = Date.now();
|
|
700
700
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
701
|
-
const
|
|
702
|
-
return t = Math.floor(t / 16), (n === "x" ?
|
|
701
|
+
const o = (t + Math.random() * 16) % 16 | 0;
|
|
702
|
+
return t = Math.floor(t / 16), (n === "x" ? o : o & 3 | 8).toString(16);
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function jt(e) {
|
|
706
706
|
if (!e)
|
|
707
707
|
return "``";
|
|
708
708
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
709
709
|
return `\`${e}\``;
|
|
710
710
|
const t = ["`"];
|
|
711
711
|
for (let r = 0, n = e.length; r < n; r++) {
|
|
712
|
-
const
|
|
713
|
-
(
|
|
712
|
+
const o = e[r];
|
|
713
|
+
(o === "\\" || o === "`") && t.push("\\"), t.push(o);
|
|
714
714
|
}
|
|
715
715
|
return t.push("`"), t.join("");
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Qt(e) {
|
|
718
718
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
719
719
|
try {
|
|
720
720
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then(
|
|
@@ -729,7 +729,7 @@ function j(e) {
|
|
|
729
729
|
let n = 2166136261;
|
|
730
730
|
for (let _ = 0; _ < e.length; _++)
|
|
731
731
|
n ^= e.charCodeAt(_), n = n * 16777619 >>> 0;
|
|
732
|
-
const
|
|
732
|
+
const o = n.toString(16).padStart(8, "0"), a = ((n ^ 2863311530) >>> 0).toString(16).padStart(8, "0"), s = ((n ^ 1431655765) >>> 0).toString(16).padStart(8, "0"), i = ((n ^ 3435973836) >>> 0).toString(16).padStart(8, "0"), c = o + a + s + i;
|
|
733
733
|
return (c + c + c + c).substring(0, 128);
|
|
734
734
|
}
|
|
735
735
|
let Q, ne;
|
|
@@ -776,28 +776,28 @@ async function Ne(e, t = !0) {
|
|
|
776
776
|
};
|
|
777
777
|
return $(r, t), l("api/v1/audit.notify", r);
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
async function
|
|
781
|
-
const n = e.items?.length || 0,
|
|
782
|
-
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count:
|
|
779
|
+
const Vt = { notify: Ne };
|
|
780
|
+
async function Gt(e, t, r) {
|
|
781
|
+
const n = e.items?.length || 0, o = 10, a = {
|
|
782
|
+
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: o } } },
|
|
783
783
|
$auditRecord: { auditEvents: [r] }
|
|
784
784
|
};
|
|
785
|
-
$(
|
|
786
|
-
const s = await l("api/v1/query",
|
|
787
|
-
return d.$hasMore = d.items.length >
|
|
785
|
+
$(a);
|
|
786
|
+
const s = await l("api/v1/query", a), i = await P(s), { aggregations: c } = i, d = c[0];
|
|
787
|
+
return d.$hasMore = d.items.length > o, d.items = [...e.items, ...d.items], Promise.resolve(d);
|
|
788
788
|
}
|
|
789
|
-
async function
|
|
790
|
-
const
|
|
791
|
-
return
|
|
789
|
+
async function zt(e) {
|
|
790
|
+
const t = e || u.app, r = new URLSearchParams({ app: t || "" });
|
|
791
|
+
return m("api/v1/app", r);
|
|
792
792
|
}
|
|
793
793
|
async function Fe() {
|
|
794
794
|
const { app: e } = u, t = new URLSearchParams({
|
|
795
795
|
app: e || "",
|
|
796
796
|
preLogin: "true"
|
|
797
797
|
});
|
|
798
|
-
return
|
|
798
|
+
return m("api/v1/app", t);
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function Ht() {
|
|
801
801
|
let { backendUrl: e, app: t, useCredentials: r } = u;
|
|
802
802
|
if (typeof window < "u") {
|
|
803
803
|
if (e || (e = window.location.origin), !t) {
|
|
@@ -821,11 +821,11 @@ function zt() {
|
|
|
821
821
|
bearerToken: void 0,
|
|
822
822
|
useSAML: void 0
|
|
823
823
|
}), Promise.resolve({})) : Fe().then((n) => {
|
|
824
|
-
const { autoOAuthProvider:
|
|
824
|
+
const { autoOAuthProvider: o, autoSAMLProvider: a } = u, s = !o && !n.autoOAuthProvider && !a && !n.autoSAMLProvider;
|
|
825
825
|
return k({
|
|
826
826
|
...u,
|
|
827
|
-
autoOAuthProvider:
|
|
828
|
-
autoSAMLProvider:
|
|
827
|
+
autoOAuthProvider: o || n.autoOAuthProvider,
|
|
828
|
+
autoSAMLProvider: a || n.autoSAMLProvider,
|
|
829
829
|
useCredentials: s,
|
|
830
830
|
useSSO: s
|
|
831
831
|
}), n;
|
|
@@ -833,20 +833,20 @@ function zt() {
|
|
|
833
833
|
throw f("atomic:fetchAppPreLogin error", n), n;
|
|
834
834
|
});
|
|
835
835
|
}
|
|
836
|
-
async function
|
|
837
|
-
const n = `api/v1/search.dataset/${e}/${t}`,
|
|
836
|
+
async function Jt(e, t, r = {}) {
|
|
837
|
+
const n = `api/v1/search.dataset/${e}/${t}`, o = await l(n, { parameters: r }), a = t[0].toLowerCase() + t.slice(1), s = o.datasets[a];
|
|
838
838
|
if ("errorCode" in s && "errorMessage" in s)
|
|
839
839
|
throw new Error(s.errorMessage);
|
|
840
840
|
return s;
|
|
841
841
|
}
|
|
842
|
-
async function
|
|
843
|
-
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets:
|
|
844
|
-
return (await l(r, { parameters: n, datasets:
|
|
842
|
+
async function Wt(e, t) {
|
|
843
|
+
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: o = [] } = t;
|
|
844
|
+
return (await l(r, { parameters: n, datasets: o })).datasets;
|
|
845
845
|
}
|
|
846
|
-
async function
|
|
847
|
-
return await
|
|
846
|
+
async function Mt(e) {
|
|
847
|
+
return await m(`api/v1/search.dataset/${e}`);
|
|
848
848
|
}
|
|
849
|
-
async function
|
|
849
|
+
async function Xt(e, t = !0, r) {
|
|
850
850
|
try {
|
|
851
851
|
return (await l("api/v1/labels", {
|
|
852
852
|
action: "list",
|
|
@@ -865,7 +865,7 @@ async function qe() {
|
|
|
865
865
|
app: e,
|
|
866
866
|
action: "getUserRights"
|
|
867
867
|
});
|
|
868
|
-
return
|
|
868
|
+
return m("api/v1/labels", t);
|
|
869
869
|
} catch (e) {
|
|
870
870
|
throw f("Error in getUserRights", e), e;
|
|
871
871
|
}
|
|
@@ -1014,7 +1014,7 @@ async function ze(e, t, r = !0) {
|
|
|
1014
1014
|
throw f("Error in bulkRemove", n), n;
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1017
|
+
const Yt = {
|
|
1018
1018
|
getUserRights: qe,
|
|
1019
1019
|
add: Be,
|
|
1020
1020
|
remove: je,
|
|
@@ -1023,7 +1023,7 @@ const Xt = {
|
|
|
1023
1023
|
bulkAdd: Ge,
|
|
1024
1024
|
bulkRemove: ze
|
|
1025
1025
|
};
|
|
1026
|
-
async function
|
|
1026
|
+
async function Kt(e, t) {
|
|
1027
1027
|
if (typeof window > "u")
|
|
1028
1028
|
return l("api/v1/preview", {
|
|
1029
1029
|
action: "get",
|
|
@@ -1038,7 +1038,7 @@ async function Yt(e, t) {
|
|
|
1038
1038
|
browserUrl: r
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
|
-
async function
|
|
1041
|
+
async function Zt(e) {
|
|
1042
1042
|
const t = new Headers();
|
|
1043
1043
|
t.append("content-type", "text");
|
|
1044
1044
|
const r = await fetch(
|
|
@@ -1050,21 +1050,21 @@ async function Kt(e) {
|
|
|
1050
1050
|
);
|
|
1051
1051
|
P(r);
|
|
1052
1052
|
}
|
|
1053
|
-
async function
|
|
1053
|
+
async function oe() {
|
|
1054
1054
|
const e = new URLSearchParams({
|
|
1055
1055
|
action: "get",
|
|
1056
1056
|
noAutoAuthentication: "true"
|
|
1057
1057
|
});
|
|
1058
|
-
return
|
|
1058
|
+
return m("api/v1/principal", e);
|
|
1059
1059
|
}
|
|
1060
1060
|
async function He(e) {
|
|
1061
1061
|
const t = {
|
|
1062
1062
|
noAutoAuthentication: "true",
|
|
1063
1063
|
...e
|
|
1064
1064
|
}, r = new URLSearchParams();
|
|
1065
|
-
return Object.entries(t).forEach(([n,
|
|
1066
|
-
|
|
1067
|
-
}),
|
|
1065
|
+
return Object.entries(t).forEach(([n, o]) => {
|
|
1066
|
+
o !== void 0 && r.append(n, String(o));
|
|
1067
|
+
}), m("api/v1/principal/list", r);
|
|
1068
1068
|
}
|
|
1069
1069
|
async function Je(e) {
|
|
1070
1070
|
if (!e)
|
|
@@ -1074,7 +1074,7 @@ async function Je(e) {
|
|
|
1074
1074
|
noAutoAuthentication: "true",
|
|
1075
1075
|
userid: e
|
|
1076
1076
|
});
|
|
1077
|
-
return
|
|
1077
|
+
return m("api/v1/principal", t);
|
|
1078
1078
|
}
|
|
1079
1079
|
async function We(e) {
|
|
1080
1080
|
if (e.length === 0)
|
|
@@ -1083,64 +1083,64 @@ async function We(e) {
|
|
|
1083
1083
|
noAutoAuthentication: "true",
|
|
1084
1084
|
userids: [...e].join(",")
|
|
1085
1085
|
});
|
|
1086
|
-
return
|
|
1086
|
+
return m("api/v1/principal/userids", t);
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1088
|
+
const Et = {
|
|
1089
1089
|
principal: {
|
|
1090
|
-
get:
|
|
1090
|
+
get: oe,
|
|
1091
1091
|
list: He,
|
|
1092
1092
|
userid: Je,
|
|
1093
1093
|
userids: We
|
|
1094
1094
|
}
|
|
1095
|
-
},
|
|
1096
|
-
async function
|
|
1097
|
-
const
|
|
1095
|
+
}, ae = 11;
|
|
1096
|
+
async function Tt(e, t, r) {
|
|
1097
|
+
const o = await l("api/v1/query", {
|
|
1098
1098
|
query: e,
|
|
1099
1099
|
$auditRecord: t,
|
|
1100
1100
|
queryIntentData: r
|
|
1101
1101
|
});
|
|
1102
|
-
|
|
1103
|
-
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length ===
|
|
1104
|
-
}),
|
|
1105
|
-
const
|
|
1106
|
-
return Promise.resolve(
|
|
1107
|
-
}
|
|
1108
|
-
async function
|
|
1109
|
-
const { app: n = "" } = u,
|
|
1102
|
+
o.aggregations.forEach((s) => {
|
|
1103
|
+
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length === ae), s.isTree && s.items && z(s);
|
|
1104
|
+
}), o.records?.map((s) => Object.assign(s, { value: s.title, type: "default" }));
|
|
1105
|
+
const a = { ...o, nextPage: o.page < Math.ceil(o.rowCount / o.pageSize) ? o.page + 1 : void 0, previousPage: o.page > 1 ? o.page - 1 : void 0 };
|
|
1106
|
+
return Promise.resolve(a);
|
|
1107
|
+
}
|
|
1108
|
+
async function er(e, t, r) {
|
|
1109
|
+
const { app: n = "" } = u, o = {
|
|
1110
1110
|
methods: [],
|
|
1111
1111
|
mode: t,
|
|
1112
1112
|
propagateErrors: !0,
|
|
1113
1113
|
$auditRecord: { auditEvents: [r] }
|
|
1114
1114
|
};
|
|
1115
1115
|
for (const i of e)
|
|
1116
|
-
|
|
1116
|
+
o.methods.push({
|
|
1117
1117
|
method: "query",
|
|
1118
1118
|
app: n,
|
|
1119
1119
|
query: i
|
|
1120
1120
|
});
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1121
|
+
const a = await l("api/v1/multi", o);
|
|
1122
|
+
a.results.forEach((i) => {
|
|
1123
1123
|
i.aggregations.forEach((c) => {
|
|
1124
|
-
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length ===
|
|
1124
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === ae), c.isTree && z(c);
|
|
1125
1125
|
});
|
|
1126
|
-
}),
|
|
1127
|
-
const s =
|
|
1126
|
+
}), a.results.forEach((i) => i.records?.map((c) => Object.assign(c, { value: c.title, type: "default" })));
|
|
1127
|
+
const s = a.results.map((i) => ({ ...i, nextPage: i.page < Math.ceil(i.rowCount / i.pageSize) ? i.page + 1 : void 0, previousPage: i.page > 1 ? i.page - 1 : void 0 }));
|
|
1128
1128
|
return Promise.resolve(s);
|
|
1129
1129
|
}
|
|
1130
1130
|
function z(e, t = "", r = 0) {
|
|
1131
1131
|
let n = [];
|
|
1132
|
-
return e.items && e.items.forEach((
|
|
1133
|
-
let
|
|
1134
|
-
n.push({ path:
|
|
1132
|
+
return e.items && e.items.forEach((o) => {
|
|
1133
|
+
let a = t ? `${t}/${o.value}` : o.value, s = r + 1;
|
|
1134
|
+
n.push({ path: a, level: s }), o.$path = a, o.$level = s, o.hasChildren ? n = n.concat(z(o, a, s)) : o.hasChildren = !1;
|
|
1135
1135
|
}), n;
|
|
1136
1136
|
}
|
|
1137
|
-
async function
|
|
1138
|
-
const { webservice:
|
|
1137
|
+
async function tr({ model: e, appName: t, query: r, article: n }) {
|
|
1138
|
+
const { webservice: o, format: a, maxcount: s, exportedColumns: i, export: c } = e, d = {
|
|
1139
1139
|
app: t,
|
|
1140
|
-
webservice:
|
|
1140
|
+
webservice: o,
|
|
1141
1141
|
query: r,
|
|
1142
1142
|
type: c,
|
|
1143
|
-
format:
|
|
1143
|
+
format: a,
|
|
1144
1144
|
maxcount: s,
|
|
1145
1145
|
exportedColumns: i,
|
|
1146
1146
|
$auditRecord: {
|
|
@@ -1154,12 +1154,12 @@ async function er({ model: e, appName: t, query: r, article: n }) {
|
|
|
1154
1154
|
};
|
|
1155
1155
|
return $(d), await l("api/v1/search.queryexport", d, { responseType: "blob" });
|
|
1156
1156
|
}
|
|
1157
|
-
async function
|
|
1157
|
+
async function rr(e) {
|
|
1158
1158
|
return (await l("api/v1/queryintent", {
|
|
1159
1159
|
query: e
|
|
1160
1160
|
}))?.intents;
|
|
1161
1161
|
}
|
|
1162
|
-
async function
|
|
1162
|
+
async function nr(e, t, r) {
|
|
1163
1163
|
return (await l(
|
|
1164
1164
|
"api/v1/similardocuments",
|
|
1165
1165
|
{
|
|
@@ -1171,11 +1171,11 @@ async function rr(e, t, r) {
|
|
|
1171
1171
|
{ signal: r }
|
|
1172
1172
|
)).data;
|
|
1173
1173
|
}
|
|
1174
|
-
async function
|
|
1174
|
+
async function or(e, t) {
|
|
1175
1175
|
return (await l("api/v1/query.links", {
|
|
1176
1176
|
webservice: e,
|
|
1177
1177
|
query: t
|
|
1178
|
-
}))?.links?.map((
|
|
1178
|
+
}))?.links?.map((o) => ({ ...o, query: t }));
|
|
1179
1179
|
}
|
|
1180
1180
|
function Me(e, t) {
|
|
1181
1181
|
if (typeof e == "number")
|
|
@@ -1217,14 +1217,14 @@ function Xe(e) {
|
|
|
1217
1217
|
return "Invalid date";
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
|
-
async function ar(e, t, r, n,
|
|
1221
|
-
const { app:
|
|
1222
|
-
app:
|
|
1220
|
+
async function ar(e, t, r, n, o) {
|
|
1221
|
+
const { app: a } = u, s = {
|
|
1222
|
+
app: a || "",
|
|
1223
1223
|
suggestQuery: e,
|
|
1224
1224
|
text: t,
|
|
1225
1225
|
filter: r,
|
|
1226
1226
|
kinds: n,
|
|
1227
|
-
showSource:
|
|
1227
|
+
showSource: o
|
|
1228
1228
|
};
|
|
1229
1229
|
try {
|
|
1230
1230
|
return (await l(
|
|
@@ -1235,12 +1235,12 @@ async function ar(e, t, r, n, a) {
|
|
|
1235
1235
|
throw console.error("Error fetching suggestions:", i), i;
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
|
-
async function
|
|
1239
|
-
const { app:
|
|
1238
|
+
async function sr(e, t, r, n) {
|
|
1239
|
+
const { app: o } = u;
|
|
1240
1240
|
return (await l(
|
|
1241
1241
|
"api/v1/suggestquery",
|
|
1242
1242
|
{
|
|
1243
|
-
app:
|
|
1243
|
+
app: o || "",
|
|
1244
1244
|
suggestQuery: e,
|
|
1245
1245
|
text: t,
|
|
1246
1246
|
query: r,
|
|
@@ -1248,9 +1248,9 @@ async function or(e, t, r, n) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
)).suggests;
|
|
1250
1250
|
}
|
|
1251
|
-
async function
|
|
1251
|
+
async function ir(e, t, r) {
|
|
1252
1252
|
if (!t) return Promise.resolve([]);
|
|
1253
|
-
const { app: n } = u,
|
|
1253
|
+
const { app: n } = u, a = await l(
|
|
1254
1254
|
"api/v1/suggestfield",
|
|
1255
1255
|
{
|
|
1256
1256
|
app: n || "",
|
|
@@ -1259,26 +1259,26 @@ async function sr(e, t, r) {
|
|
|
1259
1259
|
query: r
|
|
1260
1260
|
}
|
|
1261
1261
|
);
|
|
1262
|
-
return
|
|
1262
|
+
return a.suggests.forEach((s) => {
|
|
1263
1263
|
s.display = Me(s.display);
|
|
1264
|
-
}),
|
|
1264
|
+
}), a.suggests;
|
|
1265
1265
|
}
|
|
1266
|
-
async function
|
|
1266
|
+
async function cr(e, t, r, n, o, a) {
|
|
1267
1267
|
return l("api/v1/doc.textchunks", {
|
|
1268
1268
|
id: e,
|
|
1269
1269
|
textChunks: t,
|
|
1270
1270
|
highlights: r,
|
|
1271
1271
|
query: n,
|
|
1272
|
-
leftSentencesCount:
|
|
1273
|
-
rightSentencesCount:
|
|
1272
|
+
leftSentencesCount: o,
|
|
1273
|
+
rightSentencesCount: a
|
|
1274
1274
|
});
|
|
1275
1275
|
}
|
|
1276
|
-
async function
|
|
1276
|
+
async function lr() {
|
|
1277
1277
|
const { app: e } = u, t = new URLSearchParams({
|
|
1278
1278
|
app: e || "",
|
|
1279
1279
|
action: "load"
|
|
1280
1280
|
});
|
|
1281
|
-
return
|
|
1281
|
+
return m("api/v1/usersettings", t);
|
|
1282
1282
|
}
|
|
1283
1283
|
async function Ye(e, t) {
|
|
1284
1284
|
const r = {
|
|
@@ -1288,7 +1288,7 @@ async function Ye(e, t) {
|
|
|
1288
1288
|
};
|
|
1289
1289
|
return $(r), l("api/v1/usersettings", r);
|
|
1290
1290
|
}
|
|
1291
|
-
async function
|
|
1291
|
+
async function ur(e, t) {
|
|
1292
1292
|
const n = {
|
|
1293
1293
|
action: "patch",
|
|
1294
1294
|
userSettings: e,
|
|
@@ -1296,32 +1296,32 @@ async function lr(e, t) {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
return $(n), l("api/v1/usersettings", n);
|
|
1298
1298
|
}
|
|
1299
|
-
async function
|
|
1299
|
+
async function dr() {
|
|
1300
1300
|
return Ye({}, { type: "UserSettings_Reset" });
|
|
1301
1301
|
}
|
|
1302
|
-
async function
|
|
1302
|
+
async function fr(e, t) {
|
|
1303
1303
|
return l("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1304
1304
|
}
|
|
1305
|
-
async function
|
|
1305
|
+
async function hr(e) {
|
|
1306
1306
|
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1307
1307
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1308
1308
|
userName: e
|
|
1309
1309
|
};
|
|
1310
1310
|
return l(t, n);
|
|
1311
1311
|
}
|
|
1312
|
-
async function hr(e) {
|
|
1313
|
-
return await w(`api/v2/user-profile/${e}`);
|
|
1314
|
-
}
|
|
1315
1312
|
async function gr(e) {
|
|
1313
|
+
return await m(`api/v2/user-profile/${e}`);
|
|
1314
|
+
}
|
|
1315
|
+
async function pr(e) {
|
|
1316
1316
|
return await l("api/v2/user-profile", e);
|
|
1317
1317
|
}
|
|
1318
|
-
async function
|
|
1318
|
+
async function mr(e, t, r) {
|
|
1319
1319
|
return await _e(
|
|
1320
1320
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`,
|
|
1321
1321
|
e
|
|
1322
1322
|
);
|
|
1323
1323
|
}
|
|
1324
|
-
async function
|
|
1324
|
+
async function wr(e, t, r) {
|
|
1325
1325
|
try {
|
|
1326
1326
|
return (await we(
|
|
1327
1327
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`
|
|
@@ -1330,8 +1330,8 @@ async function mr(e, t, r) {
|
|
|
1330
1330
|
return !1;
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
|
-
async function
|
|
1334
|
-
return await
|
|
1333
|
+
async function _r() {
|
|
1334
|
+
return await m("api/v2/version");
|
|
1335
1335
|
}
|
|
1336
1336
|
const v = 1e4, Ke = async () => {
|
|
1337
1337
|
const { autoOAuthProvider: e } = u;
|
|
@@ -1366,8 +1366,8 @@ const v = 1e4, Ke = async () => {
|
|
|
1366
1366
|
{ signal: r }
|
|
1367
1367
|
);
|
|
1368
1368
|
if (n.redirectUrl) {
|
|
1369
|
-
const
|
|
1370
|
-
(
|
|
1369
|
+
const o = new URL(n.redirectUrl, window.location.origin);
|
|
1370
|
+
(o.protocol === "https:" || o.protocol === "http:") && (window.location.href = o.href);
|
|
1371
1371
|
}
|
|
1372
1372
|
return n;
|
|
1373
1373
|
} catch (r) {
|
|
@@ -1406,8 +1406,8 @@ const v = 1e4, Ke = async () => {
|
|
|
1406
1406
|
{ signal: r }
|
|
1407
1407
|
);
|
|
1408
1408
|
if (n.redirectUrl) {
|
|
1409
|
-
const
|
|
1410
|
-
(
|
|
1409
|
+
const o = new URL(n.redirectUrl, window.location.origin);
|
|
1410
|
+
(o.protocol === "https:" || o.protocol === "http:") && (window.location.href = o.href);
|
|
1411
1411
|
}
|
|
1412
1412
|
return n;
|
|
1413
1413
|
} catch (r) {
|
|
@@ -1448,7 +1448,7 @@ const I = (e) => tt(
|
|
|
1448
1448
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1449
1449
|
), nt = async () => {
|
|
1450
1450
|
try {
|
|
1451
|
-
const { signal: e } = b(v), t = await
|
|
1451
|
+
const { signal: e } = b(v), t = await m(
|
|
1452
1452
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true",
|
|
1453
1453
|
void 0,
|
|
1454
1454
|
{ signal: e }
|
|
@@ -1458,7 +1458,7 @@ const I = (e) => tt(
|
|
|
1458
1458
|
throw f("Failed to get CSRF token", e), e;
|
|
1459
1459
|
}
|
|
1460
1460
|
};
|
|
1461
|
-
async function
|
|
1461
|
+
async function ot(e) {
|
|
1462
1462
|
if (e) {
|
|
1463
1463
|
const { username: t, password: r } = e, n = {
|
|
1464
1464
|
action: "get",
|
|
@@ -1469,14 +1469,14 @@ async function at(e) {
|
|
|
1469
1469
|
noAutoAuthentication: !0
|
|
1470
1470
|
};
|
|
1471
1471
|
try {
|
|
1472
|
-
const { signal:
|
|
1472
|
+
const { signal: o } = b(v), a = await l(
|
|
1473
1473
|
"api/v1/security.webtoken",
|
|
1474
1474
|
n,
|
|
1475
|
-
{ signal:
|
|
1475
|
+
{ signal: o }
|
|
1476
1476
|
);
|
|
1477
|
-
return
|
|
1478
|
-
} catch (
|
|
1479
|
-
throw f("Failed to get JWT",
|
|
1477
|
+
return a?.csrfToken ? (I(a.csrfToken), a.csrfToken) : null;
|
|
1478
|
+
} catch (o) {
|
|
1479
|
+
throw f("Failed to get JWT", o), o;
|
|
1480
1480
|
}
|
|
1481
1481
|
} else {
|
|
1482
1482
|
const t = {
|
|
@@ -1493,14 +1493,14 @@ async function at(e) {
|
|
|
1493
1493
|
const n = new Headers();
|
|
1494
1494
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${r}`);
|
|
1495
1495
|
try {
|
|
1496
|
-
const { signal:
|
|
1496
|
+
const { signal: o } = b(v), a = await l(
|
|
1497
1497
|
"api/v1/security.webtoken",
|
|
1498
1498
|
t,
|
|
1499
|
-
{ headers: n, signal:
|
|
1499
|
+
{ headers: n, signal: o }
|
|
1500
1500
|
);
|
|
1501
|
-
return
|
|
1502
|
-
} catch (
|
|
1503
|
-
throw f("Failed to get JWT without credentials",
|
|
1501
|
+
return a?.csrfToken ? (I(a.csrfToken), a.csrfToken) : null;
|
|
1502
|
+
} catch (o) {
|
|
1503
|
+
throw f("Failed to get JWT without credentials", o), o;
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
1506
|
}
|
|
@@ -1518,7 +1518,7 @@ const W = () => {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
const t = Ee("csrfToken");
|
|
1520
1520
|
return t || null;
|
|
1521
|
-
},
|
|
1521
|
+
}, Sr = async (e) => {
|
|
1522
1522
|
if (e)
|
|
1523
1523
|
S("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1524
1524
|
else {
|
|
@@ -1531,187 +1531,198 @@ const W = () => {
|
|
|
1531
1531
|
if (i === null) {
|
|
1532
1532
|
const { autoOAuthProvider: c, autoSAMLProvider: d, useSAML: _ } = u;
|
|
1533
1533
|
if (c && !_)
|
|
1534
|
-
return S("Initiating OAuth authentication flow"), await Ke(), y("OAuth authentication flow did not redirect as expected"),
|
|
1534
|
+
return S("Initiating OAuth authentication flow"), await Ke(), y("OAuth authentication flow did not redirect as expected"), w(!1), !1;
|
|
1535
1535
|
if (d)
|
|
1536
|
-
return S("Initiating SAML authentication flow"), await Ze(), y("SAML authentication flow did not redirect as expected"),
|
|
1536
|
+
return S("Initiating SAML authentication flow"), await Ze(), y("SAML authentication flow did not redirect as expected"), w(!1), !1;
|
|
1537
1537
|
S(
|
|
1538
1538
|
"No direct authentication method available, will try SSO then credentials"
|
|
1539
1539
|
), k({ useCredentials: !0, useSSO: !0 });
|
|
1540
1540
|
} else
|
|
1541
|
-
return S("User authenticated via existing token"),
|
|
1541
|
+
return S("User authenticated via existing token"), w(!0), !0;
|
|
1542
1542
|
} catch (c) {
|
|
1543
|
-
throw f("Unexpected error during authentication", c),
|
|
1543
|
+
throw f("Unexpected error during authentication", c), w(!1), c;
|
|
1544
1544
|
}
|
|
1545
1545
|
}
|
|
1546
1546
|
if (u.useCredentials && u.useSSO)
|
|
1547
1547
|
try {
|
|
1548
|
-
if (S("Checking if user is authenticated via SSO"), await
|
|
1549
|
-
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }),
|
|
1548
|
+
if (S("Checking if user is authenticated via SSO"), await oe())
|
|
1549
|
+
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }), w(!0), !0;
|
|
1550
1550
|
} catch (i) {
|
|
1551
1551
|
if (i?.status === 401)
|
|
1552
1552
|
return S("SSO authentication failed with 401, falling back to credentials"), k({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1553
|
-
throw f("SSO authentication failed with unexpected error", i),
|
|
1553
|
+
throw f("SSO authentication failed with unexpected error", i), w(!1), i;
|
|
1554
1554
|
}
|
|
1555
1555
|
const { useSSO: r } = u, n = W();
|
|
1556
1556
|
if (n || r)
|
|
1557
|
-
return S("user already authenticated", n), k({ isRedirectUrl: !1 }),
|
|
1558
|
-
const { useCredentials:
|
|
1559
|
-
if (
|
|
1560
|
-
return f("Credentials are required for authentication"),
|
|
1561
|
-
if (
|
|
1557
|
+
return S("user already authenticated", n), k({ isRedirectUrl: !1 }), w(!0), !0;
|
|
1558
|
+
const { useCredentials: o } = u, { username: a, password: s } = e || {};
|
|
1559
|
+
if (o && (!a || !s))
|
|
1560
|
+
return f("Credentials are required for authentication"), w(!1), !1;
|
|
1561
|
+
if (a && s)
|
|
1562
1562
|
try {
|
|
1563
1563
|
S("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1564
1564
|
const { userOverrideActive: i, useroverride: c } = u;
|
|
1565
|
-
return k({ userOverrideActive: !1, useroverride: void 0 }), await
|
|
1565
|
+
return k({ userOverrideActive: !1, useroverride: void 0 }), await ot({ username: a, password: s }), k({ userOverrideActive: i, useroverride: c }), w(!0), !0;
|
|
1566
1566
|
} catch (i) {
|
|
1567
|
-
throw
|
|
1567
|
+
throw w(!1), i;
|
|
1568
1568
|
}
|
|
1569
|
-
return
|
|
1569
|
+
return w(!1), f(
|
|
1570
1570
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1571
1571
|
), !1;
|
|
1572
|
-
},
|
|
1572
|
+
}, at = async () => {
|
|
1573
1573
|
const e = new URLSearchParams({
|
|
1574
1574
|
action: "deleteWebTokenCookie",
|
|
1575
1575
|
noUserOverride: "true",
|
|
1576
1576
|
noAutoAuthentication: "true"
|
|
1577
1577
|
}), { signal: t } = b(v);
|
|
1578
|
-
return
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1578
|
+
return m(
|
|
1579
|
+
"api/v1/challenge",
|
|
1580
|
+
e,
|
|
1581
|
+
{ signal: t }
|
|
1582
|
+
);
|
|
1583
|
+
};
|
|
1584
|
+
async function kr() {
|
|
1585
|
+
const { userOverrideActive: e } = u;
|
|
1586
|
+
if (st(), !e)
|
|
1582
1587
|
try {
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1588
|
+
const { methodresult: t, logoutUrl: r } = await at();
|
|
1589
|
+
if (t === "ok")
|
|
1590
|
+
return r;
|
|
1591
|
+
f("logout failed");
|
|
1592
|
+
} catch (t) {
|
|
1593
|
+
f("logout failed", t);
|
|
1586
1594
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1595
|
+
}
|
|
1596
|
+
function st() {
|
|
1597
|
+
Te("csrfToken"), rt("sinequa-credentials"), w(!1);
|
|
1598
|
+
}
|
|
1599
|
+
const br = () => !!W();
|
|
1590
1600
|
export {
|
|
1591
|
-
|
|
1601
|
+
Et as API,
|
|
1592
1602
|
R as ApiError,
|
|
1593
|
-
|
|
1603
|
+
Vt as Audit,
|
|
1594
1604
|
C as AuditEventType,
|
|
1595
1605
|
Se as DidYouMeanKind,
|
|
1596
1606
|
h as EngineType,
|
|
1597
|
-
|
|
1607
|
+
p as EngineTypeModifier,
|
|
1598
1608
|
te as LogLevel,
|
|
1599
|
-
|
|
1609
|
+
At as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1600
1610
|
ke as RFMDisplay,
|
|
1601
1611
|
E as ServerError,
|
|
1602
1612
|
me as TimeoutError,
|
|
1603
1613
|
V as UnauthorizedError,
|
|
1604
1614
|
$ as addAuditAdditionalInfo,
|
|
1605
|
-
|
|
1615
|
+
ft as addConcepts,
|
|
1606
1616
|
Ue as addSessionId,
|
|
1607
1617
|
De as addUrl,
|
|
1608
1618
|
se as aggItemRegex,
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1619
|
+
lt as aggregationItemStrictCompare,
|
|
1620
|
+
Ht as appInitializerFn,
|
|
1621
|
+
dt as bisect,
|
|
1612
1622
|
z as buildPathsAndLevels,
|
|
1613
|
-
|
|
1623
|
+
st as clearSessionTokens,
|
|
1624
|
+
Lt as configureLogger,
|
|
1614
1625
|
O as createHeaders,
|
|
1615
1626
|
b as createTimeoutController,
|
|
1616
|
-
|
|
1627
|
+
pr as createUserProfile,
|
|
1617
1628
|
L as debug,
|
|
1618
1629
|
we as del,
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1630
|
+
wr as deleteUserProfileProperty,
|
|
1631
|
+
dr as deleteUserSettings,
|
|
1632
|
+
at as deleteWebTokenCookie,
|
|
1633
|
+
w as emitAuthenticatedEvent,
|
|
1623
1634
|
f as error,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1635
|
+
jt as escapeExpr,
|
|
1636
|
+
Ut as expiresSoon,
|
|
1637
|
+
Nt as extraColumns,
|
|
1638
|
+
Gt as fetchAggregation,
|
|
1639
|
+
zt as fetchApp,
|
|
1629
1640
|
Fe as fetchAppPreLogin,
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1641
|
+
er as fetchBulkQuery,
|
|
1642
|
+
fr as fetchChangePassword,
|
|
1643
|
+
Jt as fetchDataset,
|
|
1644
|
+
Mt as fetchDatasetList,
|
|
1645
|
+
Wt as fetchDatasets,
|
|
1646
|
+
Xt as fetchLabels,
|
|
1647
|
+
Kt as fetchPreview,
|
|
1648
|
+
Zt as fetchPreviewUrl,
|
|
1649
|
+
oe as fetchPrincipal,
|
|
1639
1650
|
He as fetchPrincipalList,
|
|
1640
1651
|
Je as fetchPrincipalUserid,
|
|
1641
1652
|
We as fetchPrincipalUserids,
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1653
|
+
Tt as fetchQuery,
|
|
1654
|
+
tr as fetchQueryExport,
|
|
1655
|
+
rr as fetchQueryIntent,
|
|
1656
|
+
hr as fetchSendPasswordResetEmail,
|
|
1657
|
+
nr as fetchSimilarDocuments,
|
|
1658
|
+
or as fetchSponsoredLinks,
|
|
1648
1659
|
ar as fetchSuggest,
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1660
|
+
ir as fetchSuggestField,
|
|
1661
|
+
sr as fetchSuggestQuery,
|
|
1662
|
+
cr as fetchTextChunks,
|
|
1663
|
+
gr as fetchUserProfile,
|
|
1664
|
+
lr as fetchUserSettings,
|
|
1665
|
+
_r as fetchVersion,
|
|
1666
|
+
m as get,
|
|
1667
|
+
pt as getConcepts,
|
|
1657
1668
|
nt as getCsrfToken,
|
|
1658
1669
|
ee as getFiltersFromURI,
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1670
|
+
kt as getFiltersFromUrl,
|
|
1671
|
+
yt as getHelpIndexUrl,
|
|
1672
|
+
vt as getIdFromUrl,
|
|
1673
|
+
ot as getJWToken,
|
|
1674
|
+
Ft as getMetadata,
|
|
1675
|
+
qt as getMetadataWithValues,
|
|
1665
1676
|
pe as getOffsetFromDates,
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1677
|
+
Ct as getQueryPageFromUrl,
|
|
1678
|
+
_t as getQueryParamsFromUrl,
|
|
1679
|
+
Rt as getQueryTabFromUrl,
|
|
1680
|
+
bt as getQueryTextFromUrl,
|
|
1681
|
+
mt as getRelativeDate,
|
|
1671
1682
|
Le as getTime,
|
|
1672
1683
|
W as getToken,
|
|
1673
|
-
|
|
1684
|
+
St as getUrlParamsFromQueryParams,
|
|
1674
1685
|
u as globalConfig,
|
|
1675
1686
|
Oe as guid,
|
|
1676
1687
|
P as handleResponse,
|
|
1677
1688
|
S as info,
|
|
1678
1689
|
Re as isArrayBuffer,
|
|
1679
|
-
|
|
1690
|
+
br as isAuthenticated,
|
|
1680
1691
|
Pe as isBlob,
|
|
1681
1692
|
ye as isDate,
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1693
|
+
$t as isExpired,
|
|
1694
|
+
Bt as isJsonable,
|
|
1695
|
+
wt as isNotInputEvent,
|
|
1685
1696
|
F as isObject,
|
|
1686
1697
|
xe as isString,
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1698
|
+
Yt as labels,
|
|
1699
|
+
Sr as login,
|
|
1700
|
+
kr as logout,
|
|
1701
|
+
g as makeColumn,
|
|
1702
|
+
xt as notify,
|
|
1692
1703
|
ce as openParentNodes,
|
|
1693
1704
|
A as parseText,
|
|
1694
1705
|
ie as parseValueAndOperatorFromItem,
|
|
1695
1706
|
_e as patch,
|
|
1696
|
-
|
|
1697
|
-
|
|
1707
|
+
mr as patchUserProfile,
|
|
1708
|
+
ur as patchUserSettings,
|
|
1698
1709
|
l as post,
|
|
1699
|
-
|
|
1710
|
+
Ot as put,
|
|
1700
1711
|
x as queryParamsFromUrl,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1712
|
+
ht as removeConcept,
|
|
1713
|
+
gt as removeConcepts,
|
|
1714
|
+
It as resolveToColumnName,
|
|
1704
1715
|
G as rewriteText,
|
|
1705
1716
|
Ye as saveUserSettings,
|
|
1706
1717
|
k as setGlobalConfig,
|
|
1707
1718
|
I as setToken,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1719
|
+
Qt as sha512,
|
|
1720
|
+
ut as suggestionsToTreeAggregationNodes,
|
|
1721
|
+
Pt as sysLang,
|
|
1711
1722
|
re as toDate,
|
|
1712
|
-
|
|
1723
|
+
ct as translateAggregationToDateOptions,
|
|
1713
1724
|
Ke as tryOAuthAuthentication,
|
|
1714
1725
|
Ze as trySAMLAuthentication,
|
|
1715
1726
|
y as warn,
|
|
1716
|
-
|
|
1727
|
+
Dt as withRetry
|
|
1717
1728
|
};
|