@sinequa/atomic 1.1.0 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomic.js +479 -339
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/authentication/tokens/get-csrf-token.d.ts +5 -4
- package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
- package/dist/helpers/filters.d.ts +82 -0
- package/dist/helpers/filters.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/types/filters/legacy-filters.d.ts +1 -1
- package/dist/types/filters/legacy-filters.d.ts.map +1 -1
- package/dist/types/interfaces/Query.d.ts +11 -3
- package/dist/types/interfaces/Query.d.ts.map +1 -1
- package/dist/utils/aggregations.d.ts +2 -2
- package/dist/utils/aggregations.d.ts.map +1 -1
- package/dist/utils/to-sql.d.ts +21 -0
- package/dist/utils/to-sql.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/atomic.js
CHANGED
|
@@ -15,11 +15,11 @@ const u = {
|
|
|
15
15
|
function k(e) {
|
|
16
16
|
Object.assign(u, e);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
18
|
+
const ce = /.*:\(?([><=\d\-.AND ]+)\)?/;
|
|
19
|
+
function ut(e, t) {
|
|
20
20
|
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((o, a) => {
|
|
21
21
|
if (!a.value || a.value === "") return o;
|
|
22
|
-
const s =
|
|
22
|
+
const s = le(a, e.column);
|
|
23
23
|
return o.push({
|
|
24
24
|
operator: s.operator,
|
|
25
25
|
value: s.value,
|
|
@@ -30,42 +30,60 @@ function ct(e, t) {
|
|
|
30
30
|
}), o;
|
|
31
31
|
}, []);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const r = t, n = e.value.match(
|
|
33
|
+
function le(e, t) {
|
|
34
|
+
const r = t, n = e.value.match(ce);
|
|
35
35
|
if (n?.[1]) {
|
|
36
36
|
const a = (n?.[1].split(" AND ")).map((s) => {
|
|
37
|
-
const i = s.indexOf(">=") !== -1 ? "gte" : "lt";
|
|
38
|
-
let c = s.substring(s.indexOf(" ") + 1);
|
|
37
|
+
const i = s.indexOf(">=") !== -1 ? "gte" : "lt", c = s.substring(s.indexOf(" ") + 1);
|
|
39
38
|
return { field: r, operator: i, value: c, display: e.display || e.value };
|
|
40
39
|
});
|
|
41
40
|
if (a.length === 2)
|
|
42
|
-
return {
|
|
41
|
+
return {
|
|
42
|
+
field: r,
|
|
43
|
+
operator: "and",
|
|
44
|
+
filters: a,
|
|
45
|
+
value: e.value,
|
|
46
|
+
display: a[0].display || a[0].value
|
|
47
|
+
};
|
|
43
48
|
if (a.length === 1)
|
|
44
49
|
return { ...a[0], field: r };
|
|
45
50
|
throw new Error("Failed to parse distribution expression");
|
|
46
51
|
}
|
|
47
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
field: r,
|
|
54
|
+
operator: "eq",
|
|
55
|
+
value: e.value,
|
|
56
|
+
display: e.display
|
|
57
|
+
};
|
|
48
58
|
}
|
|
49
|
-
function
|
|
59
|
+
function dt(e, t, r) {
|
|
50
60
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
51
61
|
}
|
|
52
|
-
function
|
|
53
|
-
return e.items && (e.items = e.items.map((t) =>
|
|
62
|
+
function ue(e) {
|
|
63
|
+
return e.items && (e.items = e.items.map((t) => ue(t))), e.items && e.items.some((t) => t.$selected || t.$opened) && (e.$opened = !0), e;
|
|
54
64
|
}
|
|
55
|
-
function
|
|
65
|
+
function ft(e, t) {
|
|
56
66
|
const r = [];
|
|
57
67
|
if (e.length > 0) {
|
|
58
68
|
const n = /* @__PURE__ */ new Map(), a = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), s = new RegExp("\\b" + a, "i");
|
|
59
69
|
e.forEach((i) => {
|
|
60
70
|
if (i.display.length > 1) {
|
|
61
71
|
const c = i.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), d = s.exec(c);
|
|
62
|
-
|
|
72
|
+
ee(
|
|
73
|
+
r,
|
|
74
|
+
n,
|
|
75
|
+
"/",
|
|
76
|
+
i.display,
|
|
77
|
+
+(i.frequency || 0),
|
|
78
|
+
1,
|
|
79
|
+
(d?.index || 0) + t.length
|
|
80
|
+
);
|
|
63
81
|
}
|
|
64
82
|
});
|
|
65
83
|
}
|
|
66
84
|
return r;
|
|
67
85
|
}
|
|
68
|
-
function
|
|
86
|
+
function ee(e, t, r, n, o, a, s) {
|
|
69
87
|
const i = n.indexOf("/", r.length), c = n.substring(0, i + 1);
|
|
70
88
|
let d = t.get(c);
|
|
71
89
|
if (!d) {
|
|
@@ -80,17 +98,25 @@ function T(e, t, r, n, o, a, s) {
|
|
|
80
98
|
$path: _
|
|
81
99
|
}, t.set(c, d), e.push(d);
|
|
82
100
|
}
|
|
83
|
-
c.length < n.length && (d.hasChildren = !0,
|
|
101
|
+
c.length < n.length && (d.hasChildren = !0, ee(
|
|
102
|
+
d.items,
|
|
103
|
+
t,
|
|
104
|
+
c,
|
|
105
|
+
n,
|
|
106
|
+
o,
|
|
107
|
+
a + 1,
|
|
108
|
+
s
|
|
109
|
+
));
|
|
84
110
|
}
|
|
85
|
-
function
|
|
111
|
+
function ht(e, t) {
|
|
86
112
|
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
87
113
|
}
|
|
88
|
-
const
|
|
114
|
+
const de = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, fe = 2, M = 3, he = 5, X = 6, ge = 8, Y = 9, pe = 11, K = 12, me = 14, Z = 15;
|
|
89
115
|
function A(e) {
|
|
90
116
|
if (!e) return [];
|
|
91
|
-
const t = [], r = e.matchAll(
|
|
117
|
+
const t = [], r = e.matchAll(de);
|
|
92
118
|
for (let n of r)
|
|
93
|
-
n[M] ? t.push({ type: "group", value: n[M], op: n[
|
|
119
|
+
n[M] ? t.push({ type: "group", value: n[M], op: n[fe] }) : n[X] ? t.push({ type: "adjacent", value: n[X], op: n[he] }) : n[Y] ? t.push({ type: "exact", value: n[Y], op: n[ge] }) : n[K] ? t.push({ type: "regex", value: n[K], op: n[pe] }) : n[Z] && t.push({ type: "token", value: n[Z], op: n[me] });
|
|
94
120
|
return t;
|
|
95
121
|
}
|
|
96
122
|
function G(e) {
|
|
@@ -110,28 +136,28 @@ function G(e) {
|
|
|
110
136
|
}
|
|
111
137
|
}).join(" ");
|
|
112
138
|
}
|
|
113
|
-
function
|
|
139
|
+
function gt(e, t, r) {
|
|
114
140
|
let n = A(e);
|
|
115
141
|
for (let o of t)
|
|
116
142
|
n.push({ type: "adjacent", value: o, op: r });
|
|
117
143
|
return G(n);
|
|
118
144
|
}
|
|
119
|
-
function
|
|
145
|
+
function pt(e, t) {
|
|
120
146
|
const r = A(t), n = r.findIndex((o) => o.value === e);
|
|
121
147
|
return n !== -1 ? (r.splice(n, 1), t = G(r)) : t;
|
|
122
148
|
}
|
|
123
|
-
function
|
|
149
|
+
function mt(e) {
|
|
124
150
|
const t = A(e).filter((r) => r.type !== "adjacent");
|
|
125
151
|
return G(t);
|
|
126
152
|
}
|
|
127
|
-
function
|
|
153
|
+
function wt(e) {
|
|
128
154
|
return A(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
129
155
|
}
|
|
130
|
-
function
|
|
131
|
-
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: o, unit: a, isFuture: s } =
|
|
156
|
+
function _t(e, t, r) {
|
|
157
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: o, unit: a, isFuture: s } = we(t, r);
|
|
132
158
|
return n.format(o * (s ? 1 : -1), a);
|
|
133
159
|
}
|
|
134
|
-
function
|
|
160
|
+
function we(e, t) {
|
|
135
161
|
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), o = Math.abs(n.getTime() - r.getTime());
|
|
136
162
|
return {
|
|
137
163
|
offset: Math.floor(o / (1e3 * 60 * 60 * 24)),
|
|
@@ -139,17 +165,17 @@ function pe(e, t) {
|
|
|
139
165
|
isFuture: r > n
|
|
140
166
|
};
|
|
141
167
|
}
|
|
142
|
-
function
|
|
168
|
+
function St(e) {
|
|
143
169
|
const t = e.target;
|
|
144
170
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
145
171
|
}
|
|
146
|
-
function
|
|
172
|
+
function kt(e) {
|
|
147
173
|
if (e === void 0) return;
|
|
148
|
-
const { q: t, f: r, p: n, s: o, t: a, n: s, b: i } =
|
|
174
|
+
const { q: t, f: r, p: n, s: o, t: a, n: s, b: i } = y(e), [c] = e.split("?");
|
|
149
175
|
return {
|
|
150
176
|
path: c,
|
|
151
177
|
text: t,
|
|
152
|
-
filters: r ?
|
|
178
|
+
filters: r ? te(r) : void 0,
|
|
153
179
|
page: n ? parseInt(n, 10) : void 0,
|
|
154
180
|
sort: o,
|
|
155
181
|
tab: a,
|
|
@@ -157,19 +183,19 @@ function _t(e) {
|
|
|
157
183
|
basket: i
|
|
158
184
|
};
|
|
159
185
|
}
|
|
160
|
-
function
|
|
186
|
+
function bt(e) {
|
|
161
187
|
if (!e) return "";
|
|
162
188
|
const { text: t, filters: r, page: n, sort: o, tab: a, name: s, basket: i } = e, c = {};
|
|
163
189
|
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
190
|
const d = new URLSearchParams(c).toString();
|
|
165
191
|
return d || "";
|
|
166
192
|
}
|
|
167
|
-
function
|
|
193
|
+
function vt(e) {
|
|
168
194
|
if (e === void 0) return [];
|
|
169
|
-
const { f: t } =
|
|
170
|
-
return
|
|
195
|
+
const { f: t } = y(e);
|
|
196
|
+
return te(t);
|
|
171
197
|
}
|
|
172
|
-
function
|
|
198
|
+
function te(e) {
|
|
173
199
|
const t = decodeURIComponent(e);
|
|
174
200
|
try {
|
|
175
201
|
return JSON.parse(t ?? "[]");
|
|
@@ -177,29 +203,29 @@ function ee(e) {
|
|
|
177
203
|
return console.error(`Error parsing filters from URI: ${e}`), [];
|
|
178
204
|
}
|
|
179
205
|
}
|
|
180
|
-
function
|
|
206
|
+
function y(e) {
|
|
181
207
|
const t = e.split("?")[1];
|
|
182
208
|
if (t === void 0) return {};
|
|
183
209
|
const r = new URLSearchParams(t);
|
|
184
210
|
return Object.fromEntries(r);
|
|
185
211
|
}
|
|
186
|
-
function
|
|
187
|
-
const { q: t = "" } =
|
|
212
|
+
function Ct(e) {
|
|
213
|
+
const { q: t = "" } = y(e);
|
|
188
214
|
return t;
|
|
189
215
|
}
|
|
190
|
-
function
|
|
191
|
-
const { id: t } =
|
|
216
|
+
function Rt(e) {
|
|
217
|
+
const { id: t } = y(e);
|
|
192
218
|
return decodeURIComponent(t);
|
|
193
219
|
}
|
|
194
|
-
function
|
|
195
|
-
const { p: t = "0" } =
|
|
220
|
+
function Pt(e) {
|
|
221
|
+
const { p: t = "0" } = y(e);
|
|
196
222
|
return parseInt(t, 10);
|
|
197
223
|
}
|
|
198
|
-
function
|
|
199
|
-
const { t } =
|
|
224
|
+
function yt(e) {
|
|
225
|
+
const { t } = y(e);
|
|
200
226
|
return t;
|
|
201
227
|
}
|
|
202
|
-
function
|
|
228
|
+
function xt(e, t) {
|
|
203
229
|
if (!e)
|
|
204
230
|
return e;
|
|
205
231
|
let r = 0;
|
|
@@ -210,21 +236,21 @@ function Pt(e, t) {
|
|
|
210
236
|
o++;
|
|
211
237
|
e[o] === "]" && (r = o + 1);
|
|
212
238
|
}
|
|
213
|
-
const a =
|
|
239
|
+
const a = F(e, r, !1);
|
|
214
240
|
if (!a)
|
|
215
241
|
return e;
|
|
216
242
|
const s = t.charCodeAt(0), i = t.charCodeAt(1);
|
|
217
243
|
let c = a;
|
|
218
244
|
for (; c; )
|
|
219
245
|
if (s === c.lang1 && i === c.lang2) {
|
|
220
|
-
const _ =
|
|
246
|
+
const _ = F(e, c.end + 4, !0);
|
|
221
247
|
return e.substring(_.start, _.end);
|
|
222
248
|
} else
|
|
223
|
-
c =
|
|
249
|
+
c = F(e, c.end + 4, !1);
|
|
224
250
|
const d = e.substring(a.start, a.end);
|
|
225
251
|
return d || e;
|
|
226
252
|
}
|
|
227
|
-
function
|
|
253
|
+
function F(e, t, r) {
|
|
228
254
|
for (let n = t, o = e.length - 3; n < o; n++)
|
|
229
255
|
if (e[n] === "[" && e[n + 3] === "]")
|
|
230
256
|
return {
|
|
@@ -241,11 +267,11 @@ function q(e, t, r) {
|
|
|
241
267
|
lang2: -1
|
|
242
268
|
};
|
|
243
269
|
}
|
|
244
|
-
function
|
|
270
|
+
function Lt(e, t) {
|
|
245
271
|
const { useLocale: r, useLocaleAsPrefix: n, indexFile: o, path: a, folder: s } = t, i = r ? `${e}/` : null, c = n ? `${e}.${o}` : o ?? "";
|
|
246
272
|
return [a, s, `${i || ""}${c}`].filter((d) => d !== void 0).join("/");
|
|
247
273
|
}
|
|
248
|
-
function
|
|
274
|
+
function $(e) {
|
|
249
275
|
const t = new CustomEvent("notification", {
|
|
250
276
|
bubbles: !0,
|
|
251
277
|
cancelable: !1,
|
|
@@ -253,48 +279,48 @@ function U(e) {
|
|
|
253
279
|
});
|
|
254
280
|
dispatchEvent(t);
|
|
255
281
|
}
|
|
256
|
-
const
|
|
282
|
+
const Ot = {
|
|
257
283
|
success: (e, t) => {
|
|
258
|
-
|
|
284
|
+
$({
|
|
259
285
|
type: "success",
|
|
260
286
|
message: e,
|
|
261
287
|
options: t
|
|
262
288
|
});
|
|
263
289
|
},
|
|
264
290
|
info: (e, t) => {
|
|
265
|
-
|
|
291
|
+
$({
|
|
266
292
|
type: "info",
|
|
267
293
|
message: e,
|
|
268
294
|
options: t
|
|
269
295
|
});
|
|
270
296
|
},
|
|
271
297
|
warning: (e, t) => {
|
|
272
|
-
|
|
298
|
+
$({
|
|
273
299
|
type: "warning",
|
|
274
300
|
message: e,
|
|
275
301
|
options: t
|
|
276
302
|
});
|
|
277
303
|
},
|
|
278
304
|
error: (e, t) => {
|
|
279
|
-
|
|
305
|
+
$({
|
|
280
306
|
type: "error",
|
|
281
307
|
message: e,
|
|
282
308
|
options: t
|
|
283
309
|
});
|
|
284
310
|
}
|
|
285
311
|
};
|
|
286
|
-
var
|
|
287
|
-
let
|
|
312
|
+
var re = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(re || {});
|
|
313
|
+
let U = {
|
|
288
314
|
level: 1,
|
|
289
315
|
enableConsoleOutput: !0
|
|
290
316
|
};
|
|
291
|
-
function
|
|
292
|
-
|
|
317
|
+
function $t(e) {
|
|
318
|
+
U = { ...U, ...e };
|
|
293
319
|
}
|
|
294
320
|
function N(e, t, r) {
|
|
295
|
-
if (e <
|
|
296
|
-
const o = `${`[${
|
|
297
|
-
if (
|
|
321
|
+
if (e < U.level) return;
|
|
322
|
+
const o = `${`[${re[e]}]`} ${t}`;
|
|
323
|
+
if (U.enableConsoleOutput)
|
|
298
324
|
switch (e) {
|
|
299
325
|
case 0:
|
|
300
326
|
console.debug(o, r || "");
|
|
@@ -310,19 +336,19 @@ function N(e, t, r) {
|
|
|
310
336
|
break;
|
|
311
337
|
}
|
|
312
338
|
}
|
|
313
|
-
function
|
|
339
|
+
function x(e, t) {
|
|
314
340
|
N(0, e, t);
|
|
315
341
|
}
|
|
316
342
|
function S(e, t) {
|
|
317
343
|
N(1, e, t);
|
|
318
344
|
}
|
|
319
|
-
function
|
|
345
|
+
function D(e, t) {
|
|
320
346
|
N(2, e, t);
|
|
321
347
|
}
|
|
322
348
|
function f(e, t) {
|
|
323
349
|
N(3, e, t);
|
|
324
350
|
}
|
|
325
|
-
function
|
|
351
|
+
function L(e) {
|
|
326
352
|
const t = W(), r = new Headers(e);
|
|
327
353
|
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
328
354
|
const { userOverride: n, userOverrideActive: o, bearerToken: a } = u;
|
|
@@ -339,7 +365,7 @@ class E extends R {
|
|
|
339
365
|
super(t, 500), this.name = "ServerError";
|
|
340
366
|
}
|
|
341
367
|
}
|
|
342
|
-
class
|
|
368
|
+
class _e extends R {
|
|
343
369
|
constructor(t = "Request timed out") {
|
|
344
370
|
super(t, 408), this.name = "TimeoutError";
|
|
345
371
|
}
|
|
@@ -363,13 +389,22 @@ async function P(e, t = "json") {
|
|
|
363
389
|
return await e.json();
|
|
364
390
|
}
|
|
365
391
|
if (e.status === 401) {
|
|
366
|
-
if (u.userOverrideActive)
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
392
|
+
if (u.userOverrideActive) {
|
|
393
|
+
let n = {};
|
|
394
|
+
try {
|
|
395
|
+
n = await e.clone().json();
|
|
396
|
+
} catch {
|
|
397
|
+
}
|
|
398
|
+
throw D("Unauthorized access attempt with user override", {
|
|
399
|
+
endpoint: e.url,
|
|
400
|
+
error: n
|
|
401
|
+
}), new V(
|
|
402
|
+
n.errorMessage ?? n.message ?? "Unauthorized... User override failed."
|
|
403
|
+
);
|
|
404
|
+
}
|
|
370
405
|
return await B(e, 401);
|
|
371
406
|
}
|
|
372
|
-
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await B(e, 500)) : (
|
|
407
|
+
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await B(e, 500)) : (D(`Unexpected response status: ${e.status}`, {
|
|
373
408
|
endpoint: e.url
|
|
374
409
|
}), await B(e, e.status));
|
|
375
410
|
}
|
|
@@ -398,9 +433,9 @@ async function B(e, t) {
|
|
|
398
433
|
);
|
|
399
434
|
}
|
|
400
435
|
}
|
|
401
|
-
async function
|
|
402
|
-
const n =
|
|
403
|
-
|
|
436
|
+
async function Se(e, t, r) {
|
|
437
|
+
const n = L(r?.headers), { backendUrl: o } = u, a = t ? `?${new URLSearchParams(t)}` : "", s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
438
|
+
x(`Making DELETE request to: ${s}`);
|
|
404
439
|
try {
|
|
405
440
|
const i = await fetch(s, {
|
|
406
441
|
method: "DELETE",
|
|
@@ -413,10 +448,10 @@ async function we(e, t, r) {
|
|
|
413
448
|
}
|
|
414
449
|
}
|
|
415
450
|
async function m(e, t, r) {
|
|
416
|
-
const n =
|
|
451
|
+
const n = L(r?.headers), { backendUrl: o } = u, a = t ? `?${new URLSearchParams(t)}` : "";
|
|
417
452
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
418
453
|
const s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
419
|
-
|
|
454
|
+
x(`Making GET request to: ${s}`);
|
|
420
455
|
try {
|
|
421
456
|
const i = await fetch(s, {
|
|
422
457
|
method: "GET",
|
|
@@ -429,8 +464,8 @@ async function m(e, t, r) {
|
|
|
429
464
|
throw f("Error making GET request:", i), i;
|
|
430
465
|
}
|
|
431
466
|
}
|
|
432
|
-
async function
|
|
433
|
-
const n =
|
|
467
|
+
async function ke(e, t, r) {
|
|
468
|
+
const n = L(r?.headers);
|
|
434
469
|
n.append("content-type", "application/json");
|
|
435
470
|
const { app: o, backendUrl: a } = u, s = {
|
|
436
471
|
app: o,
|
|
@@ -439,7 +474,7 @@ async function _e(e, t, r) {
|
|
|
439
474
|
noUserOverride: !0,
|
|
440
475
|
noAutoAuthentication: !0
|
|
441
476
|
}, i = a ? `${a}/${e}` : `${e}`;
|
|
442
|
-
|
|
477
|
+
x(`Making PATCH request to: ${i}`);
|
|
443
478
|
try {
|
|
444
479
|
const c = await fetch(i, {
|
|
445
480
|
method: "PATCH",
|
|
@@ -453,7 +488,7 @@ async function _e(e, t, r) {
|
|
|
453
488
|
}
|
|
454
489
|
}
|
|
455
490
|
async function l(e, t, r) {
|
|
456
|
-
const n =
|
|
491
|
+
const n = L(r?.headers), { app: o, backendUrl: a } = u;
|
|
457
492
|
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
458
493
|
const s = {
|
|
459
494
|
app: o,
|
|
@@ -464,7 +499,7 @@ async function l(e, t, r) {
|
|
|
464
499
|
};
|
|
465
500
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
466
501
|
const i = a ? `${a}/${e}` : `${e}`;
|
|
467
|
-
|
|
502
|
+
x(`Making POST request to: ${i}`);
|
|
468
503
|
try {
|
|
469
504
|
const c = await fetch(i, {
|
|
470
505
|
method: "POST",
|
|
@@ -478,15 +513,15 @@ async function l(e, t, r) {
|
|
|
478
513
|
throw f("Error making POST request:", c), c;
|
|
479
514
|
}
|
|
480
515
|
}
|
|
481
|
-
async function
|
|
482
|
-
const n =
|
|
516
|
+
async function Ut(e, t, r) {
|
|
517
|
+
const n = L(r?.headers), { app: o, backendUrl: a } = u, s = {
|
|
483
518
|
app: o,
|
|
484
519
|
...t,
|
|
485
520
|
locale: t.locale || navigator.language,
|
|
486
521
|
noUserOverride: !0,
|
|
487
522
|
noAutoAuthentication: !0
|
|
488
523
|
}, i = `${a}/${e}`;
|
|
489
|
-
|
|
524
|
+
x(`Making PUT request to: ${i}`);
|
|
490
525
|
try {
|
|
491
526
|
const c = await fetch(i, {
|
|
492
527
|
method: "PUT",
|
|
@@ -502,25 +537,25 @@ async function Ot(e, t, r) {
|
|
|
502
537
|
function b(e) {
|
|
503
538
|
const t = new AbortController(), { signal: r } = t;
|
|
504
539
|
return e && setTimeout(() => {
|
|
505
|
-
r.aborted || t.abort(new
|
|
540
|
+
r.aborted || t.abort(new _e(`Request timed out after ${e}ms`));
|
|
506
541
|
}, e), { controller: t, signal: r };
|
|
507
542
|
}
|
|
508
|
-
function
|
|
543
|
+
function ne(e) {
|
|
509
544
|
if (!e) return;
|
|
510
545
|
const t = new Date(e);
|
|
511
546
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
512
547
|
}
|
|
513
|
-
function
|
|
514
|
-
const t =
|
|
548
|
+
function Dt(e) {
|
|
549
|
+
const t = ne(e);
|
|
515
550
|
return !!t && t.getTime() <= Date.now();
|
|
516
551
|
}
|
|
517
|
-
function
|
|
518
|
-
const r =
|
|
552
|
+
function It(e, t = 7) {
|
|
553
|
+
const r = ne(e);
|
|
519
554
|
if (!r) return !1;
|
|
520
555
|
const n = Date.now(), o = n + t * 24 * 60 * 60 * 1e3, a = r.getTime();
|
|
521
556
|
return a > n && a <= o;
|
|
522
557
|
}
|
|
523
|
-
async function
|
|
558
|
+
async function At(e, t = 0, r = 1e3) {
|
|
524
559
|
let n;
|
|
525
560
|
for (let o = 0; o <= t; o++)
|
|
526
561
|
try {
|
|
@@ -528,11 +563,11 @@ async function Dt(e, t = 0, r = 1e3) {
|
|
|
528
563
|
} catch (a) {
|
|
529
564
|
if (n = a, a instanceof R && a.status >= 400 && a.status < 500 && a.status !== 429 || a instanceof DOMException && a.name === "AbortError")
|
|
530
565
|
throw a;
|
|
531
|
-
o < t && (
|
|
566
|
+
o < t && (D(`Retrying request (${o + 1}/${t})`, { error: a }), await new Promise((s) => setTimeout(s, r)));
|
|
532
567
|
}
|
|
533
568
|
throw n;
|
|
534
569
|
}
|
|
535
|
-
function
|
|
570
|
+
function Nt(e, t, r) {
|
|
536
571
|
if (!e || !t) return;
|
|
537
572
|
if (r) {
|
|
538
573
|
const a = Object.keys(t.queries).find((c) => c === r?.toLowerCase());
|
|
@@ -545,9 +580,9 @@ function It(e, t, r) {
|
|
|
545
580
|
if (o) return o[0];
|
|
546
581
|
}
|
|
547
582
|
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
|
|
549
|
-
var
|
|
550
|
-
function
|
|
583
|
+
const qt = "1.0";
|
|
584
|
+
var be = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(be || {}), ve = /* @__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))(ve || {});
|
|
585
|
+
function Ce(e) {
|
|
551
586
|
if (!e)
|
|
552
587
|
return h.none;
|
|
553
588
|
switch (e.toLocaleLowerCase()) {
|
|
@@ -586,7 +621,7 @@ function be(e) {
|
|
|
586
621
|
return h.none;
|
|
587
622
|
}
|
|
588
623
|
}
|
|
589
|
-
function
|
|
624
|
+
function Re(e) {
|
|
590
625
|
switch (e) {
|
|
591
626
|
case "a":
|
|
592
627
|
return p.a;
|
|
@@ -612,15 +647,15 @@ function ve(e) {
|
|
|
612
647
|
return p.none;
|
|
613
648
|
}
|
|
614
649
|
}
|
|
615
|
-
function
|
|
650
|
+
function Pe(e) {
|
|
616
651
|
let t = p.none;
|
|
617
652
|
if (e)
|
|
618
653
|
for (const r of e)
|
|
619
|
-
t |=
|
|
654
|
+
t |= Re(r);
|
|
620
655
|
return t;
|
|
621
656
|
}
|
|
622
657
|
function g(e, t, r, n) {
|
|
623
|
-
const o =
|
|
658
|
+
const o = Ce(t), a = Pe(r || "");
|
|
624
659
|
return {
|
|
625
660
|
name: e,
|
|
626
661
|
type: t,
|
|
@@ -630,7 +665,7 @@ function g(e, t, r, n) {
|
|
|
630
665
|
aliases: n
|
|
631
666
|
};
|
|
632
667
|
}
|
|
633
|
-
const
|
|
668
|
+
const Ft = {
|
|
634
669
|
id: g("id", "string"),
|
|
635
670
|
text: g("text", "varchar"),
|
|
636
671
|
documentlanguages: g("documentlanguages", "csv", "ci", ["language"]),
|
|
@@ -649,7 +684,108 @@ const Nt = {
|
|
|
649
684
|
accesslists: g("accesslists", "varchar", void 0, ["accessLists"])
|
|
650
685
|
// json
|
|
651
686
|
};
|
|
652
|
-
function
|
|
687
|
+
function oe(e) {
|
|
688
|
+
return e.filter((t) => !!t);
|
|
689
|
+
}
|
|
690
|
+
const Bt = {
|
|
691
|
+
// ── Scalar (leaf) operators ───────────────────────────────────────────────
|
|
692
|
+
/** `field = value`. */
|
|
693
|
+
eq: (e, t) => ({
|
|
694
|
+
field: e,
|
|
695
|
+
operator: "eq",
|
|
696
|
+
value: t
|
|
697
|
+
}),
|
|
698
|
+
/** `field <> value`. */
|
|
699
|
+
neq: (e, t) => ({
|
|
700
|
+
field: e,
|
|
701
|
+
operator: "neq",
|
|
702
|
+
value: t
|
|
703
|
+
}),
|
|
704
|
+
/** `field > value`. */
|
|
705
|
+
gt: (e, t) => ({
|
|
706
|
+
field: e,
|
|
707
|
+
operator: "gt",
|
|
708
|
+
value: t
|
|
709
|
+
}),
|
|
710
|
+
/** `field >= value`. */
|
|
711
|
+
gte: (e, t) => ({
|
|
712
|
+
field: e,
|
|
713
|
+
operator: "gte",
|
|
714
|
+
value: t
|
|
715
|
+
}),
|
|
716
|
+
/** `field < value`. */
|
|
717
|
+
lt: (e, t) => ({
|
|
718
|
+
field: e,
|
|
719
|
+
operator: "lt",
|
|
720
|
+
value: t
|
|
721
|
+
}),
|
|
722
|
+
/** `field <= value`. */
|
|
723
|
+
lte: (e, t) => ({
|
|
724
|
+
field: e,
|
|
725
|
+
operator: "lte",
|
|
726
|
+
value: t
|
|
727
|
+
}),
|
|
728
|
+
/** SQL `LIKE` pattern match (use `*`/`?` wildcards as supported by the engine). */
|
|
729
|
+
like: (e, t) => ({
|
|
730
|
+
field: e,
|
|
731
|
+
operator: "like",
|
|
732
|
+
value: t
|
|
733
|
+
}),
|
|
734
|
+
/** Substring containment. */
|
|
735
|
+
contains: (e, t) => ({
|
|
736
|
+
field: e,
|
|
737
|
+
operator: "contains",
|
|
738
|
+
value: t
|
|
739
|
+
}),
|
|
740
|
+
/** Regular-expression match. */
|
|
741
|
+
regex: (e, t) => ({
|
|
742
|
+
field: e,
|
|
743
|
+
operator: "regex",
|
|
744
|
+
value: t
|
|
745
|
+
}),
|
|
746
|
+
/** `field IS NULL` (no value). */
|
|
747
|
+
isNull: (e) => ({ field: e, operator: "null" }),
|
|
748
|
+
/** `field IS NOT NULL` (no value). */
|
|
749
|
+
isNotNull: (e) => ({ field: e, operator: "notnull" }),
|
|
750
|
+
// ── Range operators ───────────────────────────────────────────────────────
|
|
751
|
+
/**
|
|
752
|
+
* `field IN (...values)` — matches any of the values (logical OR within a field).
|
|
753
|
+
* Prefer this over several `eq` combined with `or` for the same field.
|
|
754
|
+
*/
|
|
755
|
+
in: (e, t) => ({
|
|
756
|
+
field: e,
|
|
757
|
+
operator: "in",
|
|
758
|
+
values: t
|
|
759
|
+
}),
|
|
760
|
+
/** `field BETWEEN start AND end` (inclusive). Works for numbers and ISO dates. */
|
|
761
|
+
between: (e, t, r) => ({
|
|
762
|
+
field: e,
|
|
763
|
+
operator: "between",
|
|
764
|
+
start: t,
|
|
765
|
+
end: r
|
|
766
|
+
}),
|
|
767
|
+
// ── Boolean combinators ───────────────────────────────────────────────────
|
|
768
|
+
/**
|
|
769
|
+
* Combine filters with logical AND. Falsy operands are ignored; with a single
|
|
770
|
+
* effective operand the operand is returned as-is, with none `undefined`.
|
|
771
|
+
*/
|
|
772
|
+
and: (...e) => T("and", e),
|
|
773
|
+
/** Combine filters with logical OR. Same collapsing rules as {@link filter.and}. */
|
|
774
|
+
or: (...e) => T("or", e),
|
|
775
|
+
/**
|
|
776
|
+
* Negate filters. Falsy operands are ignored; returns `undefined` if nothing
|
|
777
|
+
* remains. A `not` node is always kept (even with a single operand).
|
|
778
|
+
*/
|
|
779
|
+
not: (...e) => {
|
|
780
|
+
const t = oe(e);
|
|
781
|
+
return t.length ? { operator: "not", filters: t } : void 0;
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
function T(e, t) {
|
|
785
|
+
const r = oe(t);
|
|
786
|
+
return r.length === 0 ? void 0 : r.length === 1 ? r[0] : { operator: e, filters: r };
|
|
787
|
+
}
|
|
788
|
+
function jt(e, t) {
|
|
653
789
|
let r = e[t];
|
|
654
790
|
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
655
791
|
if (typeof n == "string") return n.trim();
|
|
@@ -657,7 +793,7 @@ function Ft(e, t) {
|
|
|
657
793
|
return n.display.trim();
|
|
658
794
|
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
659
795
|
}
|
|
660
|
-
function
|
|
796
|
+
function Qt(e, t) {
|
|
661
797
|
let r = e[t];
|
|
662
798
|
if (r === void 0) return [];
|
|
663
799
|
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
@@ -674,35 +810,35 @@ function qt(e, t) {
|
|
|
674
810
|
const n = String(r).trim();
|
|
675
811
|
return [{ display: n, value: n }];
|
|
676
812
|
}
|
|
677
|
-
function
|
|
813
|
+
function q(e) {
|
|
678
814
|
return e !== null && typeof e == "object";
|
|
679
815
|
}
|
|
680
|
-
function
|
|
681
|
-
return
|
|
816
|
+
function ye(e) {
|
|
817
|
+
return q(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
682
818
|
}
|
|
683
|
-
function
|
|
684
|
-
return
|
|
819
|
+
function xe(e) {
|
|
820
|
+
return q(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
685
821
|
}
|
|
686
|
-
function
|
|
822
|
+
function Le(e) {
|
|
687
823
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
688
824
|
}
|
|
689
|
-
function
|
|
825
|
+
function Oe(e) {
|
|
690
826
|
return typeof e == "string";
|
|
691
827
|
}
|
|
692
|
-
function
|
|
693
|
-
return (
|
|
828
|
+
function Vt(e) {
|
|
829
|
+
return (q(e) || Array.isArray(e)) && !ye(e) && !xe(e) && !Oe(e);
|
|
694
830
|
}
|
|
695
|
-
function
|
|
831
|
+
function $e(e) {
|
|
696
832
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
697
833
|
}
|
|
698
|
-
function
|
|
834
|
+
function Ue(e = !0) {
|
|
699
835
|
let t = Date.now();
|
|
700
836
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
701
837
|
const o = (t + Math.random() * 16) % 16 | 0;
|
|
702
838
|
return t = Math.floor(t / 16), (n === "x" ? o : o & 3 | 8).toString(16);
|
|
703
839
|
});
|
|
704
840
|
}
|
|
705
|
-
function
|
|
841
|
+
function Gt(e) {
|
|
706
842
|
if (!e)
|
|
707
843
|
return "``";
|
|
708
844
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
@@ -714,7 +850,7 @@ function jt(e) {
|
|
|
714
850
|
}
|
|
715
851
|
return t.push("`"), t.join("");
|
|
716
852
|
}
|
|
717
|
-
function
|
|
853
|
+
function zt(e) {
|
|
718
854
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
719
855
|
try {
|
|
720
856
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then(
|
|
@@ -732,18 +868,18 @@ function j(e) {
|
|
|
732
868
|
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
869
|
return (c + c + c + c).substring(0, 128);
|
|
734
870
|
}
|
|
735
|
-
let Q,
|
|
736
|
-
function
|
|
737
|
-
let r =
|
|
738
|
-
r && (
|
|
871
|
+
let Q, ae;
|
|
872
|
+
function O(e, t = !0) {
|
|
873
|
+
let r = De(e.$auditRecord);
|
|
874
|
+
r && (Ie(r), t && Ae(r)), e.$auditRecord = r;
|
|
739
875
|
}
|
|
740
|
-
function
|
|
876
|
+
function De(e) {
|
|
741
877
|
if (!e)
|
|
742
878
|
return;
|
|
743
879
|
let t;
|
|
744
880
|
if (Array.isArray(e))
|
|
745
881
|
t = e;
|
|
746
|
-
else if (
|
|
882
|
+
else if (q(e)) {
|
|
747
883
|
const r = e;
|
|
748
884
|
if (r.auditEvents || r.mlAuditEvents)
|
|
749
885
|
return r;
|
|
@@ -751,53 +887,53 @@ function $e(e) {
|
|
|
751
887
|
}
|
|
752
888
|
return { auditEvents: t };
|
|
753
889
|
}
|
|
754
|
-
function
|
|
755
|
-
const t =
|
|
890
|
+
function Ie(e) {
|
|
891
|
+
const t = Ne();
|
|
756
892
|
return e.auditEvents?.forEach((r) => {
|
|
757
893
|
r.detail || (r.detail = {}), r.detail.sessionid = t;
|
|
758
894
|
}), e;
|
|
759
895
|
}
|
|
760
|
-
function
|
|
896
|
+
function Ae(e) {
|
|
761
897
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
762
898
|
return e?.auditEvents?.forEach((r) => {
|
|
763
899
|
r.detail || (r.detail = {}), r.detail.url = t;
|
|
764
900
|
}), e;
|
|
765
901
|
}
|
|
766
|
-
function
|
|
767
|
-
return (!Q ||
|
|
902
|
+
function Ne() {
|
|
903
|
+
return (!Q || qe()) && (Q = Ue()), ae = /* @__PURE__ */ new Date(), Q;
|
|
768
904
|
}
|
|
769
|
-
function
|
|
770
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
905
|
+
function qe() {
|
|
906
|
+
return (/* @__PURE__ */ new Date()).getTime() - ae.getTime() > 600 * 1e3;
|
|
771
907
|
}
|
|
772
|
-
async function
|
|
908
|
+
async function Fe(e, t = !0) {
|
|
773
909
|
const r = {
|
|
774
910
|
event: C.None,
|
|
775
911
|
$auditRecord: e
|
|
776
912
|
};
|
|
777
|
-
return
|
|
913
|
+
return O(r, t), l("api/v1/audit.notify", r);
|
|
778
914
|
}
|
|
779
|
-
const
|
|
780
|
-
async function
|
|
915
|
+
const Ht = { notify: Fe };
|
|
916
|
+
async function Jt(e, t, r) {
|
|
781
917
|
const n = e.items?.length || 0, o = 10, a = {
|
|
782
918
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: o } } },
|
|
783
919
|
$auditRecord: { auditEvents: [r] }
|
|
784
920
|
};
|
|
785
|
-
|
|
921
|
+
O(a);
|
|
786
922
|
const s = await l("api/v1/query", a), i = await P(s), { aggregations: c } = i, d = c[0];
|
|
787
923
|
return d.$hasMore = d.items.length > o, d.items = [...e.items, ...d.items], Promise.resolve(d);
|
|
788
924
|
}
|
|
789
|
-
async function
|
|
925
|
+
async function Wt(e) {
|
|
790
926
|
const t = e || u.app, r = new URLSearchParams({ app: t || "" });
|
|
791
927
|
return m("api/v1/app", r);
|
|
792
928
|
}
|
|
793
|
-
async function
|
|
929
|
+
async function Be() {
|
|
794
930
|
const { app: e } = u, t = new URLSearchParams({
|
|
795
931
|
app: e || "",
|
|
796
932
|
preLogin: "true"
|
|
797
933
|
});
|
|
798
934
|
return m("api/v1/app", t);
|
|
799
935
|
}
|
|
800
|
-
function
|
|
936
|
+
function Mt() {
|
|
801
937
|
let { backendUrl: e, app: t, useCredentials: r } = u;
|
|
802
938
|
if (typeof window < "u") {
|
|
803
939
|
if (e || (e = window.location.origin), !t) {
|
|
@@ -820,7 +956,7 @@ function Ht() {
|
|
|
820
956
|
autoSAMLProvider: void 0,
|
|
821
957
|
bearerToken: void 0,
|
|
822
958
|
useSAML: void 0
|
|
823
|
-
}), Promise.resolve({})) :
|
|
959
|
+
}), Promise.resolve({})) : Be().then((n) => {
|
|
824
960
|
const { autoOAuthProvider: o, autoSAMLProvider: a } = u, s = !o && !n.autoOAuthProvider && !a && !n.autoSAMLProvider;
|
|
825
961
|
return k({
|
|
826
962
|
...u,
|
|
@@ -833,20 +969,20 @@ function Ht() {
|
|
|
833
969
|
throw f("atomic:fetchAppPreLogin error", n), n;
|
|
834
970
|
});
|
|
835
971
|
}
|
|
836
|
-
async function
|
|
972
|
+
async function Xt(e, t, r = {}) {
|
|
837
973
|
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
974
|
if ("errorCode" in s && "errorMessage" in s)
|
|
839
975
|
throw new Error(s.errorMessage);
|
|
840
976
|
return s;
|
|
841
977
|
}
|
|
842
|
-
async function
|
|
978
|
+
async function Yt(e, t) {
|
|
843
979
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: o = [] } = t;
|
|
844
980
|
return (await l(r, { parameters: n, datasets: o })).datasets;
|
|
845
981
|
}
|
|
846
|
-
async function
|
|
982
|
+
async function Kt(e) {
|
|
847
983
|
return await m(`api/v1/search.dataset/${e}`);
|
|
848
984
|
}
|
|
849
|
-
async function
|
|
985
|
+
async function Zt(e, t = !0, r) {
|
|
850
986
|
try {
|
|
851
987
|
return (await l("api/v1/labels", {
|
|
852
988
|
action: "list",
|
|
@@ -859,7 +995,7 @@ async function Xt(e, t = !0, r) {
|
|
|
859
995
|
throw f("Error in fetchLabels", n), n;
|
|
860
996
|
}
|
|
861
997
|
}
|
|
862
|
-
async function
|
|
998
|
+
async function je() {
|
|
863
999
|
try {
|
|
864
1000
|
const { app: e = "" } = u, t = new URLSearchParams({
|
|
865
1001
|
app: e,
|
|
@@ -870,7 +1006,7 @@ async function qe() {
|
|
|
870
1006
|
throw f("Error in getUserRights", e), e;
|
|
871
1007
|
}
|
|
872
1008
|
}
|
|
873
|
-
async function
|
|
1009
|
+
async function Qe(e, t, r = !0) {
|
|
874
1010
|
try {
|
|
875
1011
|
const n = {
|
|
876
1012
|
action: "add",
|
|
@@ -901,7 +1037,7 @@ async function Be(e, t, r = !0) {
|
|
|
901
1037
|
throw f("Error in add", n), n;
|
|
902
1038
|
}
|
|
903
1039
|
}
|
|
904
|
-
async function
|
|
1040
|
+
async function Ve(e, t, r = !0) {
|
|
905
1041
|
try {
|
|
906
1042
|
const n = {
|
|
907
1043
|
action: "remove",
|
|
@@ -932,7 +1068,7 @@ async function je(e, t, r = !0) {
|
|
|
932
1068
|
throw f("Error in remove", n), n;
|
|
933
1069
|
}
|
|
934
1070
|
}
|
|
935
|
-
async function
|
|
1071
|
+
async function Ge(e, t, r = !0) {
|
|
936
1072
|
try {
|
|
937
1073
|
const n = {
|
|
938
1074
|
action: "rename",
|
|
@@ -953,7 +1089,7 @@ async function Qe(e, t, r = !0) {
|
|
|
953
1089
|
throw f("Error in rename", n), n;
|
|
954
1090
|
}
|
|
955
1091
|
}
|
|
956
|
-
async function
|
|
1092
|
+
async function ze(e, t = !0) {
|
|
957
1093
|
try {
|
|
958
1094
|
const r = {
|
|
959
1095
|
action: "delete",
|
|
@@ -972,7 +1108,7 @@ async function Ve(e, t = !0) {
|
|
|
972
1108
|
throw f("Error in deleteLabels", r), r;
|
|
973
1109
|
}
|
|
974
1110
|
}
|
|
975
|
-
async function
|
|
1111
|
+
async function He(e, t, r = !0) {
|
|
976
1112
|
try {
|
|
977
1113
|
const n = {
|
|
978
1114
|
action: "bulkAdd",
|
|
@@ -993,7 +1129,7 @@ async function Ge(e, t, r = !0) {
|
|
|
993
1129
|
throw f("Error in bulkAdd", n), n;
|
|
994
1130
|
}
|
|
995
1131
|
}
|
|
996
|
-
async function
|
|
1132
|
+
async function Je(e, t, r = !0) {
|
|
997
1133
|
try {
|
|
998
1134
|
const n = {
|
|
999
1135
|
action: "bulkRemove",
|
|
@@ -1014,16 +1150,16 @@ async function ze(e, t, r = !0) {
|
|
|
1014
1150
|
throw f("Error in bulkRemove", n), n;
|
|
1015
1151
|
}
|
|
1016
1152
|
}
|
|
1017
|
-
const
|
|
1018
|
-
getUserRights:
|
|
1019
|
-
add:
|
|
1020
|
-
remove:
|
|
1021
|
-
rename:
|
|
1022
|
-
delete:
|
|
1023
|
-
bulkAdd:
|
|
1024
|
-
bulkRemove:
|
|
1153
|
+
const Et = {
|
|
1154
|
+
getUserRights: je,
|
|
1155
|
+
add: Qe,
|
|
1156
|
+
remove: Ve,
|
|
1157
|
+
rename: Ge,
|
|
1158
|
+
delete: ze,
|
|
1159
|
+
bulkAdd: He,
|
|
1160
|
+
bulkRemove: Je
|
|
1025
1161
|
};
|
|
1026
|
-
async function
|
|
1162
|
+
async function Tt(e, t) {
|
|
1027
1163
|
if (typeof window > "u")
|
|
1028
1164
|
return l("api/v1/preview", {
|
|
1029
1165
|
action: "get",
|
|
@@ -1038,7 +1174,7 @@ async function Kt(e, t) {
|
|
|
1038
1174
|
browserUrl: r
|
|
1039
1175
|
});
|
|
1040
1176
|
}
|
|
1041
|
-
async function
|
|
1177
|
+
async function er(e) {
|
|
1042
1178
|
const t = new Headers();
|
|
1043
1179
|
t.append("content-type", "text");
|
|
1044
1180
|
const r = await fetch(
|
|
@@ -1050,14 +1186,14 @@ async function Zt(e) {
|
|
|
1050
1186
|
);
|
|
1051
1187
|
P(r);
|
|
1052
1188
|
}
|
|
1053
|
-
async function
|
|
1189
|
+
async function se() {
|
|
1054
1190
|
const e = new URLSearchParams({
|
|
1055
1191
|
action: "get",
|
|
1056
1192
|
noAutoAuthentication: "true"
|
|
1057
1193
|
});
|
|
1058
1194
|
return m("api/v1/principal", e);
|
|
1059
1195
|
}
|
|
1060
|
-
async function
|
|
1196
|
+
async function We(e) {
|
|
1061
1197
|
const t = {
|
|
1062
1198
|
noAutoAuthentication: "true",
|
|
1063
1199
|
...e
|
|
@@ -1066,7 +1202,7 @@ async function He(e) {
|
|
|
1066
1202
|
o !== void 0 && r.append(n, String(o));
|
|
1067
1203
|
}), m("api/v1/principal/list", r);
|
|
1068
1204
|
}
|
|
1069
|
-
async function
|
|
1205
|
+
async function Me(e) {
|
|
1070
1206
|
if (!e)
|
|
1071
1207
|
return Promise.reject(new Error("userid is required"));
|
|
1072
1208
|
const t = new URLSearchParams({
|
|
@@ -1076,7 +1212,7 @@ async function Je(e) {
|
|
|
1076
1212
|
});
|
|
1077
1213
|
return m("api/v1/principal", t);
|
|
1078
1214
|
}
|
|
1079
|
-
async function
|
|
1215
|
+
async function Xe(e) {
|
|
1080
1216
|
if (e.length === 0)
|
|
1081
1217
|
return Promise.reject(new Error("userids is required"));
|
|
1082
1218
|
const t = new URLSearchParams({
|
|
@@ -1085,27 +1221,27 @@ async function We(e) {
|
|
|
1085
1221
|
});
|
|
1086
1222
|
return m("api/v1/principal/userids", t);
|
|
1087
1223
|
}
|
|
1088
|
-
const
|
|
1224
|
+
const tr = {
|
|
1089
1225
|
principal: {
|
|
1090
|
-
get:
|
|
1091
|
-
list:
|
|
1092
|
-
userid:
|
|
1093
|
-
userids:
|
|
1226
|
+
get: se,
|
|
1227
|
+
list: We,
|
|
1228
|
+
userid: Me,
|
|
1229
|
+
userids: Xe
|
|
1094
1230
|
}
|
|
1095
|
-
},
|
|
1096
|
-
async function
|
|
1231
|
+
}, ie = 11;
|
|
1232
|
+
async function rr(e, t, r) {
|
|
1097
1233
|
const o = await l("api/v1/query", {
|
|
1098
1234
|
query: e,
|
|
1099
1235
|
$auditRecord: t,
|
|
1100
1236
|
queryIntentData: r
|
|
1101
1237
|
});
|
|
1102
1238
|
o.aggregations.forEach((s) => {
|
|
1103
|
-
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length ===
|
|
1239
|
+
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length === ie), s.isTree && s.items && z(s);
|
|
1104
1240
|
}), o.records?.map((s) => Object.assign(s, { value: s.title, type: "default" }));
|
|
1105
1241
|
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
1242
|
return Promise.resolve(a);
|
|
1107
1243
|
}
|
|
1108
|
-
async function
|
|
1244
|
+
async function nr(e, t, r) {
|
|
1109
1245
|
const { app: n = "" } = u, o = {
|
|
1110
1246
|
methods: [],
|
|
1111
1247
|
mode: t,
|
|
@@ -1121,7 +1257,7 @@ async function er(e, t, r) {
|
|
|
1121
1257
|
const a = await l("api/v1/multi", o);
|
|
1122
1258
|
a.results.forEach((i) => {
|
|
1123
1259
|
i.aggregations.forEach((c) => {
|
|
1124
|
-
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length ===
|
|
1260
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === ie), c.isTree && z(c);
|
|
1125
1261
|
});
|
|
1126
1262
|
}), a.results.forEach((i) => i.records?.map((c) => Object.assign(c, { value: c.title, type: "default" })));
|
|
1127
1263
|
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 }));
|
|
@@ -1134,7 +1270,7 @@ function z(e, t = "", r = 0) {
|
|
|
1134
1270
|
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
1271
|
}), n;
|
|
1136
1272
|
}
|
|
1137
|
-
async function
|
|
1273
|
+
async function or({ model: e, appName: t, query: r, article: n }) {
|
|
1138
1274
|
const { webservice: o, format: a, maxcount: s, exportedColumns: i, export: c } = e, d = {
|
|
1139
1275
|
app: t,
|
|
1140
1276
|
webservice: o,
|
|
@@ -1152,14 +1288,14 @@ async function tr({ model: e, appName: t, query: r, article: n }) {
|
|
|
1152
1288
|
}]
|
|
1153
1289
|
}
|
|
1154
1290
|
};
|
|
1155
|
-
return
|
|
1291
|
+
return O(d), await l("api/v1/search.queryexport", d, { responseType: "blob" });
|
|
1156
1292
|
}
|
|
1157
|
-
async function
|
|
1293
|
+
async function ar(e) {
|
|
1158
1294
|
return (await l("api/v1/queryintent", {
|
|
1159
1295
|
query: e
|
|
1160
1296
|
}))?.intents;
|
|
1161
1297
|
}
|
|
1162
|
-
async function
|
|
1298
|
+
async function sr(e, t, r) {
|
|
1163
1299
|
return (await l(
|
|
1164
1300
|
"api/v1/similardocuments",
|
|
1165
1301
|
{
|
|
@@ -1171,17 +1307,17 @@ async function nr(e, t, r) {
|
|
|
1171
1307
|
{ signal: r }
|
|
1172
1308
|
)).data;
|
|
1173
1309
|
}
|
|
1174
|
-
async function
|
|
1310
|
+
async function ir(e, t) {
|
|
1175
1311
|
return (await l("api/v1/query.links", {
|
|
1176
1312
|
webservice: e,
|
|
1177
1313
|
query: t
|
|
1178
1314
|
}))?.links?.map((o) => ({ ...o, query: t }));
|
|
1179
1315
|
}
|
|
1180
|
-
function
|
|
1316
|
+
function Ye(e, t) {
|
|
1181
1317
|
if (typeof e == "number")
|
|
1182
1318
|
return `${e}`;
|
|
1183
|
-
if (
|
|
1184
|
-
return
|
|
1319
|
+
if (Le(e))
|
|
1320
|
+
return Ke(e);
|
|
1185
1321
|
if (typeof e == "boolean")
|
|
1186
1322
|
return e ? "true" : "false";
|
|
1187
1323
|
if (e === null)
|
|
@@ -1194,11 +1330,11 @@ function Me(e, t) {
|
|
|
1194
1330
|
}
|
|
1195
1331
|
return e;
|
|
1196
1332
|
}
|
|
1197
|
-
function
|
|
1333
|
+
function Ke(e) {
|
|
1198
1334
|
if (!e)
|
|
1199
1335
|
return "";
|
|
1200
1336
|
try {
|
|
1201
|
-
if (
|
|
1337
|
+
if ($e(e) === 0)
|
|
1202
1338
|
return new Intl.DateTimeFormat("en-CA", {
|
|
1203
1339
|
year: "numeric",
|
|
1204
1340
|
month: "2-digit",
|
|
@@ -1217,7 +1353,7 @@ function Xe(e) {
|
|
|
1217
1353
|
return "Invalid date";
|
|
1218
1354
|
}
|
|
1219
1355
|
}
|
|
1220
|
-
async function
|
|
1356
|
+
async function cr(e, t, r, n, o) {
|
|
1221
1357
|
const { app: a } = u, s = {
|
|
1222
1358
|
app: a || "",
|
|
1223
1359
|
suggestQuery: e,
|
|
@@ -1235,7 +1371,7 @@ async function ar(e, t, r, n, o) {
|
|
|
1235
1371
|
throw console.error("Error fetching suggestions:", i), i;
|
|
1236
1372
|
}
|
|
1237
1373
|
}
|
|
1238
|
-
async function
|
|
1374
|
+
async function lr(e, t, r, n) {
|
|
1239
1375
|
const { app: o } = u;
|
|
1240
1376
|
return (await l(
|
|
1241
1377
|
"api/v1/suggestquery",
|
|
@@ -1248,7 +1384,7 @@ async function sr(e, t, r, n) {
|
|
|
1248
1384
|
}
|
|
1249
1385
|
)).suggests;
|
|
1250
1386
|
}
|
|
1251
|
-
async function
|
|
1387
|
+
async function ur(e, t, r) {
|
|
1252
1388
|
if (!t) return Promise.resolve([]);
|
|
1253
1389
|
const { app: n } = u, a = await l(
|
|
1254
1390
|
"api/v1/suggestfield",
|
|
@@ -1260,10 +1396,10 @@ async function ir(e, t, r) {
|
|
|
1260
1396
|
}
|
|
1261
1397
|
);
|
|
1262
1398
|
return a.suggests.forEach((s) => {
|
|
1263
|
-
s.display =
|
|
1399
|
+
s.display = Ye(s.display);
|
|
1264
1400
|
}), a.suggests;
|
|
1265
1401
|
}
|
|
1266
|
-
async function
|
|
1402
|
+
async function dr(e, t, r, n, o, a) {
|
|
1267
1403
|
return l("api/v1/doc.textchunks", {
|
|
1268
1404
|
id: e,
|
|
1269
1405
|
textChunks: t,
|
|
@@ -1273,67 +1409,67 @@ async function cr(e, t, r, n, o, a) {
|
|
|
1273
1409
|
rightSentencesCount: a
|
|
1274
1410
|
});
|
|
1275
1411
|
}
|
|
1276
|
-
async function
|
|
1412
|
+
async function fr() {
|
|
1277
1413
|
const { app: e } = u, t = new URLSearchParams({
|
|
1278
1414
|
app: e || "",
|
|
1279
1415
|
action: "load"
|
|
1280
1416
|
});
|
|
1281
1417
|
return m("api/v1/usersettings", t);
|
|
1282
1418
|
}
|
|
1283
|
-
async function
|
|
1419
|
+
async function Ze(e, t) {
|
|
1284
1420
|
const r = {
|
|
1285
1421
|
action: "save",
|
|
1286
1422
|
userSettings: e,
|
|
1287
1423
|
$auditRecord: { auditEvents: [t] }
|
|
1288
1424
|
};
|
|
1289
|
-
return
|
|
1425
|
+
return O(r), l("api/v1/usersettings", r);
|
|
1290
1426
|
}
|
|
1291
|
-
async function
|
|
1427
|
+
async function hr(e, t) {
|
|
1292
1428
|
const n = {
|
|
1293
1429
|
action: "patch",
|
|
1294
1430
|
userSettings: e,
|
|
1295
1431
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1296
1432
|
};
|
|
1297
|
-
return
|
|
1433
|
+
return O(n), l("api/v1/usersettings", n);
|
|
1298
1434
|
}
|
|
1299
|
-
async function
|
|
1300
|
-
return
|
|
1435
|
+
async function gr() {
|
|
1436
|
+
return Ze({}, { type: "UserSettings_Reset" });
|
|
1301
1437
|
}
|
|
1302
|
-
async function
|
|
1438
|
+
async function pr(e, t) {
|
|
1303
1439
|
return l("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1304
1440
|
}
|
|
1305
|
-
async function
|
|
1441
|
+
async function mr(e) {
|
|
1306
1442
|
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1307
1443
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1308
1444
|
userName: e
|
|
1309
1445
|
};
|
|
1310
1446
|
return l(t, n);
|
|
1311
1447
|
}
|
|
1312
|
-
async function
|
|
1448
|
+
async function wr(e) {
|
|
1313
1449
|
return await m(`api/v2/user-profile/${e}`);
|
|
1314
1450
|
}
|
|
1315
|
-
async function
|
|
1451
|
+
async function _r(e) {
|
|
1316
1452
|
return await l("api/v2/user-profile", e);
|
|
1317
1453
|
}
|
|
1318
|
-
async function
|
|
1319
|
-
return await
|
|
1454
|
+
async function Sr(e, t, r) {
|
|
1455
|
+
return await ke(
|
|
1320
1456
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`,
|
|
1321
1457
|
e
|
|
1322
1458
|
);
|
|
1323
1459
|
}
|
|
1324
|
-
async function
|
|
1460
|
+
async function kr(e, t, r) {
|
|
1325
1461
|
try {
|
|
1326
|
-
return (await
|
|
1462
|
+
return (await Se(
|
|
1327
1463
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`
|
|
1328
1464
|
)).success === !0;
|
|
1329
1465
|
} catch {
|
|
1330
1466
|
return !1;
|
|
1331
1467
|
}
|
|
1332
1468
|
}
|
|
1333
|
-
async function
|
|
1469
|
+
async function br() {
|
|
1334
1470
|
return await m("api/v2/version");
|
|
1335
1471
|
}
|
|
1336
|
-
const v = 1e4,
|
|
1472
|
+
const v = 1e4, Ee = async () => {
|
|
1337
1473
|
const { autoOAuthProvider: e } = u;
|
|
1338
1474
|
if (!e)
|
|
1339
1475
|
throw new Error("autoOAuthProvider is not configured in globalConfig");
|
|
@@ -1373,7 +1509,7 @@ const v = 1e4, Ke = async () => {
|
|
|
1373
1509
|
} catch (r) {
|
|
1374
1510
|
throw f("Failed to authenticate with OAuth", r), r;
|
|
1375
1511
|
}
|
|
1376
|
-
},
|
|
1512
|
+
}, Te = async () => {
|
|
1377
1513
|
const { autoSAMLProvider: e } = u;
|
|
1378
1514
|
if (!e)
|
|
1379
1515
|
throw new Error("autoSAMLProvider is not configured in globalConfig");
|
|
@@ -1428,37 +1564,39 @@ const v = 1e4, Ke = async () => {
|
|
|
1428
1564
|
this.store = {};
|
|
1429
1565
|
}
|
|
1430
1566
|
}, J = H;
|
|
1431
|
-
function
|
|
1567
|
+
function et(e) {
|
|
1432
1568
|
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1433
1569
|
}
|
|
1434
|
-
function
|
|
1570
|
+
function tt(e) {
|
|
1435
1571
|
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1436
1572
|
}
|
|
1437
|
-
function
|
|
1573
|
+
function rt(e) {
|
|
1438
1574
|
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
1439
1575
|
}
|
|
1440
|
-
function
|
|
1576
|
+
function nt(e, t) {
|
|
1441
1577
|
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1442
1578
|
}
|
|
1443
|
-
function
|
|
1579
|
+
function ot(e) {
|
|
1444
1580
|
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1445
1581
|
}
|
|
1446
|
-
const I = (e) =>
|
|
1582
|
+
const I = (e) => nt(
|
|
1447
1583
|
"sinequa-credentials",
|
|
1448
1584
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1449
|
-
),
|
|
1585
|
+
), at = async () => {
|
|
1450
1586
|
try {
|
|
1451
1587
|
const { signal: e } = b(v), t = await m(
|
|
1452
1588
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true",
|
|
1453
1589
|
void 0,
|
|
1454
1590
|
{ signal: e }
|
|
1455
1591
|
);
|
|
1456
|
-
|
|
1592
|
+
if (t?.csrfToken)
|
|
1593
|
+
return I(t.csrfToken), t.csrfToken;
|
|
1594
|
+
throw new Error("No CSRF token returned");
|
|
1457
1595
|
} catch (e) {
|
|
1458
1596
|
throw f("Failed to get CSRF token", e), e;
|
|
1459
1597
|
}
|
|
1460
1598
|
};
|
|
1461
|
-
async function
|
|
1599
|
+
async function st(e) {
|
|
1462
1600
|
if (e) {
|
|
1463
1601
|
const { username: t, password: r } = e, n = {
|
|
1464
1602
|
action: "get",
|
|
@@ -1505,35 +1643,35 @@ async function ot(e) {
|
|
|
1505
1643
|
}
|
|
1506
1644
|
}
|
|
1507
1645
|
const W = () => {
|
|
1508
|
-
const e =
|
|
1646
|
+
const e = rt("sinequa-credentials");
|
|
1509
1647
|
if (e)
|
|
1510
1648
|
try {
|
|
1511
1649
|
const n = JSON.parse(e).data?.csrfToken;
|
|
1512
1650
|
if (n) return n;
|
|
1513
1651
|
} catch (r) {
|
|
1514
|
-
|
|
1652
|
+
D(
|
|
1515
1653
|
"Failed to parse session storage credentials, falling back to local storage",
|
|
1516
1654
|
r
|
|
1517
1655
|
);
|
|
1518
1656
|
}
|
|
1519
|
-
const t =
|
|
1657
|
+
const t = et("csrfToken");
|
|
1520
1658
|
return t || null;
|
|
1521
|
-
},
|
|
1659
|
+
}, vr = async (e) => {
|
|
1522
1660
|
if (e)
|
|
1523
1661
|
S("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1524
1662
|
else {
|
|
1525
1663
|
let i = null;
|
|
1526
1664
|
try {
|
|
1527
|
-
S("Attempting to retrieve CSRF token from the backend"), i = await
|
|
1665
|
+
S("Attempting to retrieve CSRF token from the backend"), i = await at(), x("CSRF token retrieval result", i ? "success" : "failed");
|
|
1528
1666
|
} catch {
|
|
1529
1667
|
}
|
|
1530
1668
|
try {
|
|
1531
1669
|
if (i === null) {
|
|
1532
1670
|
const { autoOAuthProvider: c, autoSAMLProvider: d, useSAML: _ } = u;
|
|
1533
1671
|
if (c && !_)
|
|
1534
|
-
return S("Initiating OAuth authentication flow"), await
|
|
1672
|
+
return S("Initiating OAuth authentication flow"), await Ee(), w(!1), !1;
|
|
1535
1673
|
if (d)
|
|
1536
|
-
return S("Initiating SAML authentication flow"), await
|
|
1674
|
+
return S("Initiating SAML authentication flow"), await Te(), w(!1), !1;
|
|
1537
1675
|
S(
|
|
1538
1676
|
"No direct authentication method available, will try SSO then credentials"
|
|
1539
1677
|
), k({ useCredentials: !0, useSSO: !0 });
|
|
@@ -1542,10 +1680,11 @@ const W = () => {
|
|
|
1542
1680
|
} catch (c) {
|
|
1543
1681
|
throw f("Unexpected error during authentication", c), w(!1), c;
|
|
1544
1682
|
}
|
|
1683
|
+
return !1;
|
|
1545
1684
|
}
|
|
1546
1685
|
if (u.useCredentials && u.useSSO)
|
|
1547
1686
|
try {
|
|
1548
|
-
if (S("Checking if user is authenticated via SSO"), await
|
|
1687
|
+
if (S("Checking if user is authenticated via SSO"), await se())
|
|
1549
1688
|
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }), w(!0), !0;
|
|
1550
1689
|
} catch (i) {
|
|
1551
1690
|
if (i?.status === 401)
|
|
@@ -1562,14 +1701,14 @@ const W = () => {
|
|
|
1562
1701
|
try {
|
|
1563
1702
|
S("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1564
1703
|
const { userOverrideActive: i, useroverride: c } = u;
|
|
1565
|
-
return k({ userOverrideActive: !1, useroverride: void 0 }), await
|
|
1704
|
+
return k({ userOverrideActive: !1, useroverride: void 0 }), await st({ username: a, password: s }), k({ userOverrideActive: i, useroverride: c }), w(!0), !0;
|
|
1566
1705
|
} catch (i) {
|
|
1567
1706
|
throw w(!1), i;
|
|
1568
1707
|
}
|
|
1569
1708
|
return w(!1), f(
|
|
1570
1709
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1571
1710
|
), !1;
|
|
1572
|
-
},
|
|
1711
|
+
}, it = async () => {
|
|
1573
1712
|
const e = new URLSearchParams({
|
|
1574
1713
|
action: "deleteWebTokenCookie",
|
|
1575
1714
|
noUserOverride: "true",
|
|
@@ -1581,11 +1720,11 @@ const W = () => {
|
|
|
1581
1720
|
{ signal: t }
|
|
1582
1721
|
);
|
|
1583
1722
|
};
|
|
1584
|
-
async function
|
|
1723
|
+
async function Cr() {
|
|
1585
1724
|
const { userOverrideActive: e } = u;
|
|
1586
|
-
if (
|
|
1725
|
+
if (ct(), !e)
|
|
1587
1726
|
try {
|
|
1588
|
-
const { methodresult: t, logoutUrl: r } = await
|
|
1727
|
+
const { methodresult: t, logoutUrl: r } = await it();
|
|
1589
1728
|
if (t === "ok")
|
|
1590
1729
|
return r;
|
|
1591
1730
|
f("logout failed");
|
|
@@ -1593,136 +1732,137 @@ async function kr() {
|
|
|
1593
1732
|
f("logout failed", t);
|
|
1594
1733
|
}
|
|
1595
1734
|
}
|
|
1596
|
-
function
|
|
1597
|
-
|
|
1735
|
+
function ct() {
|
|
1736
|
+
tt("csrfToken"), ot("sinequa-credentials"), w(!1);
|
|
1598
1737
|
}
|
|
1599
|
-
const
|
|
1738
|
+
const Rr = () => !!W();
|
|
1600
1739
|
export {
|
|
1601
|
-
|
|
1740
|
+
tr as API,
|
|
1602
1741
|
R as ApiError,
|
|
1603
|
-
|
|
1742
|
+
Ht as Audit,
|
|
1604
1743
|
C as AuditEventType,
|
|
1605
|
-
|
|
1744
|
+
be as DidYouMeanKind,
|
|
1606
1745
|
h as EngineType,
|
|
1607
1746
|
p as EngineTypeModifier,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1747
|
+
re as LogLevel,
|
|
1748
|
+
qt as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1749
|
+
ve as RFMDisplay,
|
|
1611
1750
|
E as ServerError,
|
|
1612
|
-
|
|
1751
|
+
_e as TimeoutError,
|
|
1613
1752
|
V as UnauthorizedError,
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1753
|
+
O as addAuditAdditionalInfo,
|
|
1754
|
+
gt as addConcepts,
|
|
1755
|
+
Ie as addSessionId,
|
|
1756
|
+
Ae as addUrl,
|
|
1757
|
+
ce as aggItemRegex,
|
|
1758
|
+
dt as aggregationItemStrictCompare,
|
|
1759
|
+
Mt as appInitializerFn,
|
|
1760
|
+
ht as bisect,
|
|
1622
1761
|
z as buildPathsAndLevels,
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1762
|
+
ct as clearSessionTokens,
|
|
1763
|
+
$t as configureLogger,
|
|
1764
|
+
L as createHeaders,
|
|
1626
1765
|
b as createTimeoutController,
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1766
|
+
_r as createUserProfile,
|
|
1767
|
+
x as debug,
|
|
1768
|
+
Se as del,
|
|
1769
|
+
kr as deleteUserProfileProperty,
|
|
1770
|
+
gr as deleteUserSettings,
|
|
1771
|
+
it as deleteWebTokenCookie,
|
|
1633
1772
|
w as emitAuthenticatedEvent,
|
|
1634
1773
|
f as error,
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1774
|
+
Gt as escapeExpr,
|
|
1775
|
+
It as expiresSoon,
|
|
1776
|
+
Ft as extraColumns,
|
|
1777
|
+
Jt as fetchAggregation,
|
|
1778
|
+
Wt as fetchApp,
|
|
1779
|
+
Be as fetchAppPreLogin,
|
|
1780
|
+
nr as fetchBulkQuery,
|
|
1781
|
+
pr as fetchChangePassword,
|
|
1782
|
+
Xt as fetchDataset,
|
|
1783
|
+
Kt as fetchDatasetList,
|
|
1784
|
+
Yt as fetchDatasets,
|
|
1785
|
+
Zt as fetchLabels,
|
|
1786
|
+
Tt as fetchPreview,
|
|
1787
|
+
er as fetchPreviewUrl,
|
|
1788
|
+
se as fetchPrincipal,
|
|
1789
|
+
We as fetchPrincipalList,
|
|
1790
|
+
Me as fetchPrincipalUserid,
|
|
1791
|
+
Xe as fetchPrincipalUserids,
|
|
1792
|
+
rr as fetchQuery,
|
|
1793
|
+
or as fetchQueryExport,
|
|
1794
|
+
ar as fetchQueryIntent,
|
|
1795
|
+
mr as fetchSendPasswordResetEmail,
|
|
1796
|
+
sr as fetchSimilarDocuments,
|
|
1797
|
+
ir as fetchSponsoredLinks,
|
|
1798
|
+
cr as fetchSuggest,
|
|
1799
|
+
ur as fetchSuggestField,
|
|
1800
|
+
lr as fetchSuggestQuery,
|
|
1801
|
+
dr as fetchTextChunks,
|
|
1802
|
+
wr as fetchUserProfile,
|
|
1803
|
+
fr as fetchUserSettings,
|
|
1804
|
+
br as fetchVersion,
|
|
1805
|
+
Bt as filter,
|
|
1666
1806
|
m as get,
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1807
|
+
wt as getConcepts,
|
|
1808
|
+
at as getCsrfToken,
|
|
1809
|
+
te as getFiltersFromURI,
|
|
1810
|
+
vt as getFiltersFromUrl,
|
|
1811
|
+
Lt as getHelpIndexUrl,
|
|
1812
|
+
Rt as getIdFromUrl,
|
|
1813
|
+
st as getJWToken,
|
|
1814
|
+
jt as getMetadata,
|
|
1815
|
+
Qt as getMetadataWithValues,
|
|
1816
|
+
we as getOffsetFromDates,
|
|
1817
|
+
Pt as getQueryPageFromUrl,
|
|
1818
|
+
kt as getQueryParamsFromUrl,
|
|
1819
|
+
yt as getQueryTabFromUrl,
|
|
1820
|
+
Ct as getQueryTextFromUrl,
|
|
1821
|
+
_t as getRelativeDate,
|
|
1822
|
+
$e as getTime,
|
|
1683
1823
|
W as getToken,
|
|
1684
|
-
|
|
1824
|
+
bt as getUrlParamsFromQueryParams,
|
|
1685
1825
|
u as globalConfig,
|
|
1686
|
-
|
|
1826
|
+
Ue as guid,
|
|
1687
1827
|
P as handleResponse,
|
|
1688
1828
|
S as info,
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1829
|
+
ye as isArrayBuffer,
|
|
1830
|
+
Rr as isAuthenticated,
|
|
1831
|
+
xe as isBlob,
|
|
1832
|
+
Le as isDate,
|
|
1833
|
+
Dt as isExpired,
|
|
1834
|
+
Vt as isJsonable,
|
|
1835
|
+
St as isNotInputEvent,
|
|
1836
|
+
q as isObject,
|
|
1837
|
+
Oe as isString,
|
|
1838
|
+
Et as labels,
|
|
1839
|
+
vr as login,
|
|
1840
|
+
Cr as logout,
|
|
1701
1841
|
g as makeColumn,
|
|
1702
|
-
|
|
1703
|
-
|
|
1842
|
+
Ot as notify,
|
|
1843
|
+
ue as openParentNodes,
|
|
1704
1844
|
A as parseText,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1845
|
+
le as parseValueAndOperatorFromItem,
|
|
1846
|
+
ke as patch,
|
|
1847
|
+
Sr as patchUserProfile,
|
|
1848
|
+
hr as patchUserSettings,
|
|
1709
1849
|
l as post,
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1850
|
+
Ut as put,
|
|
1851
|
+
y as queryParamsFromUrl,
|
|
1852
|
+
pt as removeConcept,
|
|
1853
|
+
mt as removeConcepts,
|
|
1854
|
+
Nt as resolveToColumnName,
|
|
1715
1855
|
G as rewriteText,
|
|
1716
|
-
|
|
1856
|
+
Ze as saveUserSettings,
|
|
1717
1857
|
k as setGlobalConfig,
|
|
1718
1858
|
I as setToken,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1859
|
+
zt as sha512,
|
|
1860
|
+
ft as suggestionsToTreeAggregationNodes,
|
|
1861
|
+
xt as sysLang,
|
|
1862
|
+
ne as toDate,
|
|
1863
|
+
ut as translateAggregationToDateOptions,
|
|
1864
|
+
Ee as tryOAuthAuthentication,
|
|
1865
|
+
Te as trySAMLAuthentication,
|
|
1866
|
+
D as warn,
|
|
1867
|
+
At as withRetry
|
|
1728
1868
|
};
|