@sinequa/atomic 0.0.139 → 1.0.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/dist/atomic.js +604 -557
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/constants.d.ts +5 -0
- package/dist/authentication/constants.d.ts.map +1 -0
- package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -1
- package/dist/authentication/providers/oauth-authentication.d.ts +6 -0
- package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
- package/dist/authentication/providers/saml-authentication.d.ts +6 -0
- package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
- package/dist/authentication/session/logout.d.ts.map +1 -1
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts +1 -1
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
- package/dist/authentication/tokens/get-csrf-token.d.ts +4 -4
- package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-jwt-token.d.ts +10 -8
- package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-token.d.ts +2 -2
- package/dist/authentication/tokens/get-token.d.ts.map +1 -1
- package/dist/types/audit/AuditEventType.d.ts +9 -2
- package/dist/types/audit/AuditEventType.d.ts.map +1 -1
- package/package.json +5 -2
package/dist/atomic.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function g(e) {
|
|
2
|
+
if (typeof CustomEvent > "u" || typeof dispatchEvent > "u")
|
|
3
|
+
return;
|
|
2
4
|
const t = new CustomEvent("authenticated", {
|
|
3
5
|
bubbles: !0,
|
|
4
6
|
cancelable: !1,
|
|
@@ -13,38 +15,11 @@ const u = {
|
|
|
13
15
|
function k(e) {
|
|
14
16
|
Object.assign(u, e);
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
19
|
-
const { userOverride: n, userOverrideActive: a, bearerToken: o } = u;
|
|
20
|
-
return o && r.append("Authorization", `Bearer ${o}`), n && a && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
21
|
-
}
|
|
22
|
-
class v extends Error {
|
|
23
|
-
status;
|
|
24
|
-
constructor(t, r) {
|
|
25
|
-
super(t), this.name = "ApiError", this.status = r;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
class J extends v {
|
|
29
|
-
constructor(t = "Server error") {
|
|
30
|
-
super(t, 500), this.name = "ServerError";
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
class ae extends v {
|
|
34
|
-
constructor(t = "Request timed out") {
|
|
35
|
-
super(t, 408), this.name = "TimeoutError";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
class j extends v {
|
|
39
|
-
constructor(t = "Unauthorized access") {
|
|
40
|
-
super(t, 401), this.name = "UnauthorizedError";
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const oe = /.*\:\(?([><=\d\-\.AND ]+)\)?/;
|
|
44
|
-
function ot(e, t) {
|
|
18
|
+
const se = /.*\:\(?([><=\d\-\.AND ]+)\)?/;
|
|
19
|
+
function it(e, t) {
|
|
45
20
|
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((a, o) => {
|
|
46
21
|
if (!o.value || o.value === "") return a;
|
|
47
|
-
const s =
|
|
22
|
+
const s = ie(o, e.column);
|
|
48
23
|
return a.push({
|
|
49
24
|
operator: s.operator,
|
|
50
25
|
value: s.value,
|
|
@@ -55,13 +30,13 @@ function ot(e, t) {
|
|
|
55
30
|
}), a;
|
|
56
31
|
}, []);
|
|
57
32
|
}
|
|
58
|
-
function
|
|
59
|
-
const r = t, n = e.value.match(
|
|
33
|
+
function ie(e, t) {
|
|
34
|
+
const r = t, n = e.value.match(se);
|
|
60
35
|
if (n?.[1]) {
|
|
61
36
|
const o = (n?.[1].split(" AND ")).map((s) => {
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
return { field: r, operator:
|
|
37
|
+
const i = s.indexOf(">=") !== -1 ? "gte" : "lt";
|
|
38
|
+
let c = s.substring(s.indexOf(" ") + 1);
|
|
39
|
+
return { field: r, operator: i, value: c, display: e.display || e.value };
|
|
65
40
|
});
|
|
66
41
|
if (o.length === 2)
|
|
67
42
|
return { field: r, operator: "and", filters: o, value: e.value, display: o[0].display || o[0].value };
|
|
@@ -71,54 +46,54 @@ function se(e, t) {
|
|
|
71
46
|
}
|
|
72
47
|
return { field: r, operator: "eq", value: e.value, display: e.display };
|
|
73
48
|
}
|
|
74
|
-
function
|
|
49
|
+
function ct(e, t, r) {
|
|
75
50
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
76
51
|
}
|
|
77
|
-
function
|
|
78
|
-
return e.items && (e.items = e.items.map((t) =>
|
|
52
|
+
function ce(e) {
|
|
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;
|
|
79
54
|
}
|
|
80
|
-
function
|
|
55
|
+
function lt(e, t) {
|
|
81
56
|
const r = [];
|
|
82
57
|
if (e.length > 0) {
|
|
83
58
|
const n = /* @__PURE__ */ new Map(), o = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), s = new RegExp("\\b" + o, "i");
|
|
84
|
-
e.forEach((
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
59
|
+
e.forEach((i) => {
|
|
60
|
+
if (i.display.length > 1) {
|
|
61
|
+
const c = i.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), d = s.exec(c);
|
|
62
|
+
T(r, n, "/", i.display, +(i.frequency || 0), 1, (d?.index || 0) + t.length);
|
|
88
63
|
}
|
|
89
64
|
});
|
|
90
65
|
}
|
|
91
66
|
return r;
|
|
92
67
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
let d = t.get(
|
|
68
|
+
function T(e, t, r, n, a, o, s) {
|
|
69
|
+
const i = n.indexOf("/", r.length), c = n.substring(0, i + 1);
|
|
70
|
+
let d = t.get(c);
|
|
96
71
|
if (!d) {
|
|
97
|
-
const _ =
|
|
72
|
+
const _ = c.replace(/^\/|\/$/g, "");
|
|
98
73
|
d = {
|
|
99
|
-
value: n.substring(r.length,
|
|
74
|
+
value: n.substring(r.length, i),
|
|
100
75
|
count: a,
|
|
101
76
|
items: [],
|
|
102
77
|
hasChildren: !1,
|
|
103
78
|
$level: o,
|
|
104
|
-
$opened: s >=
|
|
79
|
+
$opened: s >= c.length,
|
|
105
80
|
$path: _
|
|
106
|
-
}, t.set(
|
|
81
|
+
}, t.set(c, d), e.push(d);
|
|
107
82
|
}
|
|
108
|
-
|
|
83
|
+
c.length < n.length && (d.hasChildren = !0, T(d.items, t, c, n, a, o + 1, s));
|
|
109
84
|
}
|
|
110
|
-
function
|
|
85
|
+
function ut(e, t) {
|
|
111
86
|
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
112
87
|
}
|
|
113
|
-
const
|
|
114
|
-
function
|
|
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;
|
|
89
|
+
function A(e) {
|
|
115
90
|
if (!e) return [];
|
|
116
|
-
const t = [], r = e.matchAll(
|
|
91
|
+
const t = [], r = e.matchAll(le);
|
|
117
92
|
for (let n of r)
|
|
118
|
-
n[
|
|
93
|
+
n[M] ? t.push({ type: "group", value: n[M], op: n[ue] }) : n[X] ? t.push({ type: "adjacent", value: n[X], op: n[de] }) : n[Y] ? t.push({ type: "exact", value: n[Y], op: n[fe] }) : n[K] ? t.push({ type: "regex", value: n[K], op: n[he] }) : n[Z] && t.push({ type: "token", value: n[Z], op: n[ge] });
|
|
119
94
|
return t;
|
|
120
95
|
}
|
|
121
|
-
function
|
|
96
|
+
function G(e) {
|
|
122
97
|
return e.map((t) => {
|
|
123
98
|
const r = t.op || "";
|
|
124
99
|
switch (t.type) {
|
|
@@ -135,28 +110,28 @@ function Q(e) {
|
|
|
135
110
|
}
|
|
136
111
|
}).join(" ");
|
|
137
112
|
}
|
|
138
|
-
function
|
|
139
|
-
let n =
|
|
113
|
+
function dt(e, t, r) {
|
|
114
|
+
let n = A(e);
|
|
140
115
|
for (let a of t)
|
|
141
116
|
n.push({ type: "adjacent", value: a, op: r });
|
|
142
|
-
return
|
|
117
|
+
return G(n);
|
|
143
118
|
}
|
|
144
|
-
function
|
|
145
|
-
const r =
|
|
146
|
-
return n !== -1 ? (r.splice(n, 1), t =
|
|
119
|
+
function ft(e, t) {
|
|
120
|
+
const r = A(t), n = r.findIndex((a) => a.value === e);
|
|
121
|
+
return n !== -1 ? (r.splice(n, 1), t = G(r)) : t;
|
|
147
122
|
}
|
|
148
|
-
function
|
|
149
|
-
const t =
|
|
150
|
-
return
|
|
123
|
+
function ht(e) {
|
|
124
|
+
const t = A(e).filter((r) => r.type !== "adjacent");
|
|
125
|
+
return G(t);
|
|
151
126
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
127
|
+
function gt(e) {
|
|
128
|
+
return A(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
154
129
|
}
|
|
155
|
-
function
|
|
156
|
-
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: o, isFuture: s } =
|
|
130
|
+
function pt(e, t, r) {
|
|
131
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: o, isFuture: s } = pe(t, r);
|
|
157
132
|
return n.format(a * (s ? 1 : -1), o);
|
|
158
133
|
}
|
|
159
|
-
function
|
|
134
|
+
function pe(e, t) {
|
|
160
135
|
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), a = Math.abs(n.getTime() - r.getTime());
|
|
161
136
|
return {
|
|
162
137
|
offset: Math.floor(a / (1e3 * 60 * 60 * 24)),
|
|
@@ -168,33 +143,33 @@ function mt(e) {
|
|
|
168
143
|
const t = e.target;
|
|
169
144
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
170
145
|
}
|
|
171
|
-
function
|
|
146
|
+
function wt(e) {
|
|
172
147
|
if (e === void 0) return;
|
|
173
|
-
const { q: t, f: r, p: n, s: a, t: o, n: s, b:
|
|
148
|
+
const { q: t, f: r, p: n, s: a, t: o, n: s, b: i } = x(e), [c] = e.split("?");
|
|
174
149
|
return {
|
|
175
|
-
path:
|
|
150
|
+
path: c,
|
|
176
151
|
text: t,
|
|
177
|
-
filters: r ?
|
|
152
|
+
filters: r ? ee(r) : void 0,
|
|
178
153
|
page: n ? parseInt(n, 10) : void 0,
|
|
179
154
|
sort: a,
|
|
180
155
|
tab: o,
|
|
181
156
|
name: s,
|
|
182
|
-
basket:
|
|
157
|
+
basket: i
|
|
183
158
|
};
|
|
184
159
|
}
|
|
185
|
-
function
|
|
160
|
+
function _t(e) {
|
|
186
161
|
if (!e) return "";
|
|
187
|
-
const { text: t, filters: r, page: n, sort: a, tab: o, name: s, basket:
|
|
188
|
-
t && (
|
|
189
|
-
const d = new URLSearchParams(
|
|
162
|
+
const { text: t, filters: r, page: n, sort: a, tab: o, name: s, basket: i } = e, c = {};
|
|
163
|
+
t && (c.q = t), r && (c.f = JSON.stringify(r)), n && (c.p = n.toString()), a && (c.s = a), o && (c.t = o), s && (c.n = s), i && (c.b = i);
|
|
164
|
+
const d = new URLSearchParams(c).toString();
|
|
190
165
|
return d || "";
|
|
191
166
|
}
|
|
192
|
-
function
|
|
167
|
+
function St(e) {
|
|
193
168
|
if (e === void 0) return [];
|
|
194
|
-
const { f: t } =
|
|
195
|
-
return
|
|
169
|
+
const { f: t } = x(e);
|
|
170
|
+
return ee(t);
|
|
196
171
|
}
|
|
197
|
-
function
|
|
172
|
+
function ee(e) {
|
|
198
173
|
const t = decodeURIComponent(e);
|
|
199
174
|
try {
|
|
200
175
|
return JSON.parse(t ?? "[]");
|
|
@@ -202,29 +177,29 @@ function E(e) {
|
|
|
202
177
|
return console.error(`Error parsing filters from URI: ${e}`), [];
|
|
203
178
|
}
|
|
204
179
|
}
|
|
205
|
-
function
|
|
180
|
+
function x(e) {
|
|
206
181
|
const t = e.split("?")[1];
|
|
207
182
|
if (t === void 0) return {};
|
|
208
183
|
const r = new URLSearchParams(t);
|
|
209
184
|
return Object.fromEntries(r);
|
|
210
185
|
}
|
|
211
|
-
function
|
|
212
|
-
const { q: t = "" } =
|
|
186
|
+
function kt(e) {
|
|
187
|
+
const { q: t = "" } = x(e);
|
|
213
188
|
return t;
|
|
214
189
|
}
|
|
215
|
-
function
|
|
216
|
-
const { id: t } =
|
|
190
|
+
function bt(e) {
|
|
191
|
+
const { id: t } = x(e);
|
|
217
192
|
return decodeURIComponent(t);
|
|
218
193
|
}
|
|
219
|
-
function
|
|
220
|
-
const { p: t = "0" } =
|
|
194
|
+
function vt(e) {
|
|
195
|
+
const { p: t = "0" } = x(e);
|
|
221
196
|
return parseInt(t, 10);
|
|
222
197
|
}
|
|
223
|
-
function
|
|
224
|
-
const { t } =
|
|
198
|
+
function Ct(e) {
|
|
199
|
+
const { t } = x(e);
|
|
225
200
|
return t;
|
|
226
201
|
}
|
|
227
|
-
function
|
|
202
|
+
function Rt(e, t) {
|
|
228
203
|
if (!e)
|
|
229
204
|
return e;
|
|
230
205
|
let r = 0;
|
|
@@ -235,21 +210,21 @@ function vt(e, t) {
|
|
|
235
210
|
a++;
|
|
236
211
|
e[a] === "]" && (r = a + 1);
|
|
237
212
|
}
|
|
238
|
-
const o =
|
|
213
|
+
const o = q(e, r, !1);
|
|
239
214
|
if (!o)
|
|
240
215
|
return e;
|
|
241
|
-
const s = t.charCodeAt(0),
|
|
242
|
-
let
|
|
243
|
-
for (;
|
|
244
|
-
if (s ===
|
|
245
|
-
const _ =
|
|
216
|
+
const s = t.charCodeAt(0), i = t.charCodeAt(1);
|
|
217
|
+
let c = o;
|
|
218
|
+
for (; c; )
|
|
219
|
+
if (s === c.lang1 && i === c.lang2) {
|
|
220
|
+
const _ = q(e, c.end + 4, !0);
|
|
246
221
|
return e.substring(_.start, _.end);
|
|
247
222
|
} else
|
|
248
|
-
|
|
223
|
+
c = q(e, c.end + 4, !1);
|
|
249
224
|
const d = e.substring(o.start, o.end);
|
|
250
225
|
return d || e;
|
|
251
226
|
}
|
|
252
|
-
function
|
|
227
|
+
function q(e, t, r) {
|
|
253
228
|
for (let n = t, a = e.length - 3; n < a; n++)
|
|
254
229
|
if (e[n] === "[" && e[n + 3] === "]")
|
|
255
230
|
return {
|
|
@@ -266,11 +241,11 @@ function N(e, t, r) {
|
|
|
266
241
|
lang2: -1
|
|
267
242
|
};
|
|
268
243
|
}
|
|
269
|
-
function
|
|
270
|
-
const { useLocale: r, useLocaleAsPrefix: n, indexFile: a, path: o, folder: s } = t,
|
|
271
|
-
return [o, s, `${
|
|
244
|
+
function Pt(e, t) {
|
|
245
|
+
const { useLocale: r, useLocaleAsPrefix: n, indexFile: a, path: o, folder: s } = t, i = r ? `${e}/` : null, c = n ? `${e}.${a}` : a ?? "";
|
|
246
|
+
return [o, s, `${i || ""}${c}`].filter((d) => d !== void 0).join("/");
|
|
272
247
|
}
|
|
273
|
-
function
|
|
248
|
+
function U(e) {
|
|
274
249
|
const t = new CustomEvent("notification", {
|
|
275
250
|
bubbles: !0,
|
|
276
251
|
cancelable: !1,
|
|
@@ -278,48 +253,48 @@ function O(e) {
|
|
|
278
253
|
});
|
|
279
254
|
dispatchEvent(t);
|
|
280
255
|
}
|
|
281
|
-
const
|
|
256
|
+
const yt = {
|
|
282
257
|
success: (e, t) => {
|
|
283
|
-
|
|
258
|
+
U({
|
|
284
259
|
type: "success",
|
|
285
260
|
message: e,
|
|
286
261
|
options: t
|
|
287
262
|
});
|
|
288
263
|
},
|
|
289
264
|
info: (e, t) => {
|
|
290
|
-
|
|
265
|
+
U({
|
|
291
266
|
type: "info",
|
|
292
267
|
message: e,
|
|
293
268
|
options: t
|
|
294
269
|
});
|
|
295
270
|
},
|
|
296
271
|
warning: (e, t) => {
|
|
297
|
-
|
|
272
|
+
U({
|
|
298
273
|
type: "warning",
|
|
299
274
|
message: e,
|
|
300
275
|
options: t
|
|
301
276
|
});
|
|
302
277
|
},
|
|
303
278
|
error: (e, t) => {
|
|
304
|
-
|
|
279
|
+
U({
|
|
305
280
|
type: "error",
|
|
306
281
|
message: e,
|
|
307
282
|
options: t
|
|
308
283
|
});
|
|
309
284
|
}
|
|
310
285
|
};
|
|
311
|
-
var
|
|
312
|
-
let
|
|
286
|
+
var te = /* @__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))(te || {});
|
|
287
|
+
let D = {
|
|
313
288
|
level: 1,
|
|
314
289
|
enableConsoleOutput: !0
|
|
315
290
|
};
|
|
316
|
-
function
|
|
317
|
-
|
|
291
|
+
function xt(e) {
|
|
292
|
+
D = { ...D, ...e };
|
|
318
293
|
}
|
|
319
|
-
function
|
|
320
|
-
if (e <
|
|
321
|
-
const a = `${`[${
|
|
322
|
-
if (
|
|
294
|
+
function N(e, t, r) {
|
|
295
|
+
if (e < D.level) return;
|
|
296
|
+
const a = `${`[${te[e]}]`} ${t}`;
|
|
297
|
+
if (D.enableConsoleOutput)
|
|
323
298
|
switch (e) {
|
|
324
299
|
case 0:
|
|
325
300
|
console.debug(a, r || "");
|
|
@@ -335,21 +310,48 @@ function I(e, t, r) {
|
|
|
335
310
|
break;
|
|
336
311
|
}
|
|
337
312
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
313
|
+
function L(e, t) {
|
|
314
|
+
N(0, e, t);
|
|
340
315
|
}
|
|
341
316
|
function S(e, t) {
|
|
342
|
-
|
|
317
|
+
N(1, e, t);
|
|
343
318
|
}
|
|
344
|
-
function
|
|
345
|
-
|
|
319
|
+
function y(e, t) {
|
|
320
|
+
N(2, e, t);
|
|
346
321
|
}
|
|
347
322
|
function f(e, t) {
|
|
348
|
-
|
|
323
|
+
N(3, e, t);
|
|
324
|
+
}
|
|
325
|
+
function O(e) {
|
|
326
|
+
const t = W(), r = new Headers(e);
|
|
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: a, bearerToken: o } = u;
|
|
329
|
+
return o && r.append("Authorization", `Bearer ${o}`), n && a && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
330
|
+
}
|
|
331
|
+
class R extends Error {
|
|
332
|
+
status;
|
|
333
|
+
constructor(t, r) {
|
|
334
|
+
super(t), this.name = "ApiError", this.status = r;
|
|
335
|
+
}
|
|
349
336
|
}
|
|
350
|
-
|
|
337
|
+
class E extends R {
|
|
338
|
+
constructor(t = "Server error") {
|
|
339
|
+
super(t, 500), this.name = "ServerError";
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
class me extends R {
|
|
343
|
+
constructor(t = "Request timed out") {
|
|
344
|
+
super(t, 408), this.name = "TimeoutError";
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
class V extends R {
|
|
348
|
+
constructor(t = "Unauthorized access") {
|
|
349
|
+
super(t, 401), this.name = "UnauthorizedError";
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
async function P(e, t = "json") {
|
|
351
353
|
const r = e.headers.get("sinequa-jwt-refresh");
|
|
352
|
-
if (r !== null &&
|
|
354
|
+
if (r !== null && I(r), e.status === 200)
|
|
353
355
|
switch (t) {
|
|
354
356
|
case "arraybuffer":
|
|
355
357
|
return await e.arrayBuffer();
|
|
@@ -362,23 +364,23 @@ async function C(e, t = "json") {
|
|
|
362
364
|
}
|
|
363
365
|
if (e.status === 401) {
|
|
364
366
|
if (u.userOverrideActive)
|
|
365
|
-
throw
|
|
367
|
+
throw y("Unauthorized access attempt with user override", {
|
|
366
368
|
endpoint: e.url
|
|
367
|
-
}), new
|
|
368
|
-
return await
|
|
369
|
+
}), new V("Unauthorized... User override failed.");
|
|
370
|
+
return await B(e, 401);
|
|
369
371
|
}
|
|
370
|
-
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await
|
|
372
|
+
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await B(e, 500)) : (y(`Unexpected response status: ${e.status}`, {
|
|
371
373
|
endpoint: e.url
|
|
372
|
-
}), await
|
|
374
|
+
}), await B(e, e.status));
|
|
373
375
|
}
|
|
374
|
-
async function
|
|
376
|
+
async function B(e, t) {
|
|
375
377
|
try {
|
|
376
378
|
const { done: r, value: n } = await e.body?.getReader().read() || {
|
|
377
379
|
done: !0,
|
|
378
380
|
value: void 0
|
|
379
381
|
};
|
|
380
382
|
if (r || !n)
|
|
381
|
-
throw t === 401 ? new
|
|
383
|
+
throw t === 401 ? new V() : t === 500 ? new E() : new R(`Request failed with status ${t}`, t);
|
|
382
384
|
const a = JSON.parse(new TextDecoder().decode(n));
|
|
383
385
|
throw new Error(
|
|
384
386
|
a.errorMessage || a.message || `Request failed with status ${t}`,
|
|
@@ -390,45 +392,45 @@ async function q(e, t) {
|
|
|
390
392
|
}
|
|
391
393
|
);
|
|
392
394
|
} catch (r) {
|
|
393
|
-
throw r instanceof
|
|
395
|
+
throw r instanceof R ? r : t === 401 ? new V(r.message) : t === 500 ? new E(r.message) : new R(
|
|
394
396
|
r.message ?? `Request failed with status ${t}`,
|
|
395
397
|
t
|
|
396
398
|
);
|
|
397
399
|
}
|
|
398
400
|
}
|
|
399
|
-
async function
|
|
400
|
-
const n =
|
|
401
|
-
|
|
401
|
+
async function we(e, t, r) {
|
|
402
|
+
const n = O(r?.headers), { backendUrl: a } = u, o = t ? `?${new URLSearchParams(t)}` : "", s = a ? `${a}/${e}${o}` : `${e}${o}`;
|
|
403
|
+
L(`Making DELETE request to: ${s}`);
|
|
402
404
|
try {
|
|
403
|
-
const
|
|
405
|
+
const i = await fetch(s, {
|
|
404
406
|
method: "DELETE",
|
|
405
407
|
credentials: "include",
|
|
406
408
|
headers: n
|
|
407
409
|
});
|
|
408
|
-
return
|
|
409
|
-
} catch (
|
|
410
|
-
throw f("Error making DELETE request:",
|
|
410
|
+
return P(i, r?.responseType);
|
|
411
|
+
} catch (i) {
|
|
412
|
+
throw f("Error making DELETE request:", i), i;
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
415
|
async function w(e, t, r) {
|
|
414
|
-
const n =
|
|
416
|
+
const n = O(r?.headers), { backendUrl: a } = u, o = t ? `?${new URLSearchParams(t)}` : "";
|
|
415
417
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
416
418
|
const s = a ? `${a}/${e}${o}` : `${e}${o}`;
|
|
417
|
-
|
|
419
|
+
L(`Making GET request to: ${s}`);
|
|
418
420
|
try {
|
|
419
|
-
const
|
|
421
|
+
const i = await fetch(s, {
|
|
420
422
|
method: "GET",
|
|
421
423
|
credentials: "include",
|
|
422
424
|
headers: n,
|
|
423
425
|
signal: r?.signal
|
|
424
426
|
});
|
|
425
|
-
return
|
|
426
|
-
} catch (
|
|
427
|
-
throw f("Error making GET request:",
|
|
427
|
+
return P(i, r?.responseType);
|
|
428
|
+
} catch (i) {
|
|
429
|
+
throw f("Error making GET request:", i), i;
|
|
428
430
|
}
|
|
429
431
|
}
|
|
430
|
-
async function
|
|
431
|
-
const n =
|
|
432
|
+
async function _e(e, t, r) {
|
|
433
|
+
const n = O(r?.headers);
|
|
432
434
|
n.append("content-type", "application/json");
|
|
433
435
|
const { app: a, backendUrl: o } = u, s = {
|
|
434
436
|
app: a,
|
|
@@ -436,22 +438,22 @@ async function ge(e, t, r) {
|
|
|
436
438
|
locale: t.locale || navigator.language,
|
|
437
439
|
noUserOverride: !0,
|
|
438
440
|
noAutoAuthentication: !0
|
|
439
|
-
},
|
|
440
|
-
|
|
441
|
+
}, i = o ? `${o}/${e}` : `${e}`;
|
|
442
|
+
L(`Making PATCH request to: ${i}`);
|
|
441
443
|
try {
|
|
442
|
-
const
|
|
444
|
+
const c = await fetch(i, {
|
|
443
445
|
method: "PATCH",
|
|
444
446
|
headers: n,
|
|
445
447
|
credentials: "include",
|
|
446
448
|
body: JSON.stringify(s)
|
|
447
449
|
});
|
|
448
|
-
return
|
|
449
|
-
} catch (
|
|
450
|
-
throw f("Error making PATCH request:",
|
|
450
|
+
return P(c, r?.responseType);
|
|
451
|
+
} catch (c) {
|
|
452
|
+
throw f("Error making PATCH request:", c), c;
|
|
451
453
|
}
|
|
452
454
|
}
|
|
453
455
|
async function l(e, t, r) {
|
|
454
|
-
const n =
|
|
456
|
+
const n = O(r?.headers), { app: a, backendUrl: o } = u;
|
|
455
457
|
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
456
458
|
const s = {
|
|
457
459
|
app: a,
|
|
@@ -461,91 +463,91 @@ async function l(e, t, r) {
|
|
|
461
463
|
noAutoAuthentication: !0
|
|
462
464
|
};
|
|
463
465
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
+
const i = o ? `${o}/${e}` : `${e}`;
|
|
467
|
+
L(`Making POST request to: ${i}`);
|
|
466
468
|
try {
|
|
467
|
-
const
|
|
469
|
+
const c = await fetch(i, {
|
|
468
470
|
method: "POST",
|
|
469
471
|
headers: n,
|
|
470
472
|
credentials: "include",
|
|
471
473
|
body: JSON.stringify(s),
|
|
472
474
|
signal: r?.signal
|
|
473
475
|
});
|
|
474
|
-
return
|
|
475
|
-
} catch (
|
|
476
|
-
throw f("Error making POST request:",
|
|
476
|
+
return P(c, r?.responseType);
|
|
477
|
+
} catch (c) {
|
|
478
|
+
throw f("Error making POST request:", c), c;
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
|
-
async function
|
|
480
|
-
const n =
|
|
481
|
+
async function Lt(e, t, r) {
|
|
482
|
+
const n = O(r?.headers), { app: a, backendUrl: o } = u, s = {
|
|
481
483
|
app: a,
|
|
482
484
|
...t,
|
|
483
485
|
locale: t.locale || navigator.language,
|
|
484
486
|
noUserOverride: !0,
|
|
485
487
|
noAutoAuthentication: !0
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
+
}, i = `${o}/${e}`;
|
|
489
|
+
L(`Making PUT request to: ${i}`);
|
|
488
490
|
try {
|
|
489
|
-
const
|
|
491
|
+
const c = await fetch(i, {
|
|
490
492
|
method: "PUT",
|
|
491
493
|
headers: n,
|
|
492
494
|
credentials: "include",
|
|
493
495
|
body: JSON.stringify(s)
|
|
494
496
|
});
|
|
495
|
-
return
|
|
496
|
-
} catch (
|
|
497
|
-
throw f("Error making PUT request:",
|
|
497
|
+
return P(c, r?.responseType);
|
|
498
|
+
} catch (c) {
|
|
499
|
+
throw f("Error making PUT request:", c), c;
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
|
-
function
|
|
502
|
+
function b(e) {
|
|
501
503
|
const t = new AbortController(), { signal: r } = t;
|
|
502
504
|
return e && setTimeout(() => {
|
|
503
|
-
r.aborted || t.abort(new
|
|
505
|
+
r.aborted || t.abort(new me(`Request timed out after ${e}ms`));
|
|
504
506
|
}, e), { controller: t, signal: r };
|
|
505
507
|
}
|
|
506
|
-
function
|
|
508
|
+
function re(e) {
|
|
507
509
|
if (!e) return;
|
|
508
510
|
const t = new Date(e);
|
|
509
511
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
510
512
|
}
|
|
511
|
-
function
|
|
512
|
-
const t =
|
|
513
|
+
function Ot(e) {
|
|
514
|
+
const t = re(e);
|
|
513
515
|
return !!t && t.getTime() <= Date.now();
|
|
514
516
|
}
|
|
515
|
-
function
|
|
516
|
-
const r =
|
|
517
|
+
function $t(e, t = 7) {
|
|
518
|
+
const r = re(e);
|
|
517
519
|
if (!r) return !1;
|
|
518
520
|
const n = Date.now(), a = n + t * 24 * 60 * 60 * 1e3, o = r.getTime();
|
|
519
521
|
return o > n && o <= a;
|
|
520
522
|
}
|
|
521
|
-
async function
|
|
523
|
+
async function Ut(e, t = 0, r = 1e3) {
|
|
522
524
|
let n;
|
|
523
525
|
for (let a = 0; a <= t; a++)
|
|
524
526
|
try {
|
|
525
527
|
return await e();
|
|
526
528
|
} catch (o) {
|
|
527
|
-
if (n = o, o instanceof
|
|
529
|
+
if (n = o, o instanceof R && o.status >= 400 && o.status < 500 && o.status !== 429 || o instanceof DOMException && o.name === "AbortError")
|
|
528
530
|
throw o;
|
|
529
|
-
a < t && (
|
|
531
|
+
a < t && (y(`Retrying request (${a + 1}/${t})`, { error: o }), await new Promise((s) => setTimeout(s, r)));
|
|
530
532
|
}
|
|
531
533
|
throw n;
|
|
532
534
|
}
|
|
533
|
-
function
|
|
535
|
+
function Dt(e, t, r) {
|
|
534
536
|
if (!e || !t) return;
|
|
535
537
|
if (r) {
|
|
536
|
-
const o = Object.keys(t.queries).find((
|
|
538
|
+
const o = Object.keys(t.queries).find((c) => c === r?.toLowerCase());
|
|
537
539
|
let s;
|
|
538
540
|
o && (s = t.queries[o]);
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
+
const i = (s?.columnsInfo?.columns || [])?.find((c) => c.aliases?.split(",")?.includes(e));
|
|
542
|
+
if (i) return i.name;
|
|
541
543
|
}
|
|
542
544
|
const n = t.indexes?._?.columns, a = Object.entries(n).find((o) => o[1].aliases?.includes(e));
|
|
543
545
|
if (a) return a[0];
|
|
544
546
|
}
|
|
545
|
-
var
|
|
546
|
-
const
|
|
547
|
-
var
|
|
548
|
-
function
|
|
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 || {}), m = /* @__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))(m || {});
|
|
548
|
+
const It = "1.0";
|
|
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
|
+
function be(e) {
|
|
549
551
|
if (!e)
|
|
550
552
|
return h.none;
|
|
551
553
|
switch (e.toLocaleLowerCase()) {
|
|
@@ -584,41 +586,41 @@ function Se(e) {
|
|
|
584
586
|
return h.none;
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
|
-
function
|
|
589
|
+
function ve(e) {
|
|
588
590
|
switch (e) {
|
|
589
591
|
case "a":
|
|
590
|
-
return
|
|
592
|
+
return m.a;
|
|
591
593
|
case "c":
|
|
592
|
-
return
|
|
594
|
+
return m.c;
|
|
593
595
|
case "d":
|
|
594
|
-
return
|
|
596
|
+
return m.d;
|
|
595
597
|
case "e":
|
|
596
|
-
return
|
|
598
|
+
return m.e;
|
|
597
599
|
case "i":
|
|
598
|
-
return
|
|
600
|
+
return m.i;
|
|
599
601
|
case "l":
|
|
600
|
-
return
|
|
602
|
+
return m.l;
|
|
601
603
|
case "n":
|
|
602
|
-
return
|
|
604
|
+
return m.n;
|
|
603
605
|
case "t":
|
|
604
|
-
return
|
|
606
|
+
return m.t;
|
|
605
607
|
case "x":
|
|
606
|
-
return
|
|
608
|
+
return m.x;
|
|
607
609
|
case "z":
|
|
608
|
-
return
|
|
610
|
+
return m.z;
|
|
609
611
|
default:
|
|
610
|
-
return
|
|
612
|
+
return m.none;
|
|
611
613
|
}
|
|
612
614
|
}
|
|
613
|
-
function
|
|
614
|
-
let t =
|
|
615
|
+
function Ce(e) {
|
|
616
|
+
let t = m.none;
|
|
615
617
|
if (e)
|
|
616
618
|
for (const r of e)
|
|
617
|
-
t |=
|
|
619
|
+
t |= ve(r);
|
|
618
620
|
return t;
|
|
619
621
|
}
|
|
620
|
-
function
|
|
621
|
-
const a =
|
|
622
|
+
function p(e, t, r, n) {
|
|
623
|
+
const a = be(t), o = Ce(r || "");
|
|
622
624
|
return {
|
|
623
625
|
name: e,
|
|
624
626
|
type: t,
|
|
@@ -628,26 +630,26 @@ function m(e, t, r, n) {
|
|
|
628
630
|
aliases: n
|
|
629
631
|
};
|
|
630
632
|
}
|
|
631
|
-
const
|
|
632
|
-
id:
|
|
633
|
-
text:
|
|
634
|
-
documentlanguages:
|
|
635
|
-
databasealias:
|
|
636
|
-
globalrelevance:
|
|
637
|
-
matchingpartnames:
|
|
638
|
-
matchlocations:
|
|
639
|
-
matchlocationsperpartname:
|
|
633
|
+
const At = {
|
|
634
|
+
id: p("id", "string"),
|
|
635
|
+
text: p("text", "varchar"),
|
|
636
|
+
documentlanguages: p("documentlanguages", "csv", "ci", ["language"]),
|
|
637
|
+
databasealias: p("databasealias", "varchar"),
|
|
638
|
+
globalrelevance: p("globalrelevance", "double"),
|
|
639
|
+
matchingpartnames: p("matchingpartnames", "csv"),
|
|
640
|
+
matchlocations: p("matchlocations", "csv"),
|
|
641
|
+
matchlocationsperpartname: p("matchlocationsperpartname", "varchar"),
|
|
640
642
|
// json
|
|
641
|
-
extracts:
|
|
642
|
-
extractsperpartname:
|
|
643
|
+
extracts: p("extracts", "csv"),
|
|
644
|
+
extractsperpartname: p("extractsperpartname", "varchar"),
|
|
643
645
|
// json
|
|
644
|
-
extractslocations:
|
|
645
|
-
documentweight:
|
|
646
|
-
groupcount:
|
|
647
|
-
accesslists:
|
|
646
|
+
extractslocations: p("extractslocations", "csv"),
|
|
647
|
+
documentweight: p("documentweight", "varchar"),
|
|
648
|
+
groupcount: p("groupcount", "integer"),
|
|
649
|
+
accesslists: p("accesslists", "varchar", void 0, ["accessLists"])
|
|
648
650
|
// json
|
|
649
651
|
};
|
|
650
|
-
function
|
|
652
|
+
function Nt(e, t) {
|
|
651
653
|
let r = e[t];
|
|
652
654
|
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
653
655
|
if (typeof n == "string") return n.trim();
|
|
@@ -655,7 +657,7 @@ function At(e, t) {
|
|
|
655
657
|
return n.display.trim();
|
|
656
658
|
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
657
659
|
}
|
|
658
|
-
function
|
|
660
|
+
function Ft(e, t) {
|
|
659
661
|
let r = e[t];
|
|
660
662
|
if (r === void 0) return [];
|
|
661
663
|
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
@@ -672,35 +674,35 @@ function Nt(e, t) {
|
|
|
672
674
|
const n = String(r).trim();
|
|
673
675
|
return [{ display: n, value: n }];
|
|
674
676
|
}
|
|
675
|
-
function
|
|
677
|
+
function F(e) {
|
|
676
678
|
return e !== null && typeof e == "object";
|
|
677
679
|
}
|
|
678
|
-
function
|
|
679
|
-
return
|
|
680
|
+
function Re(e) {
|
|
681
|
+
return F(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
680
682
|
}
|
|
681
|
-
function
|
|
682
|
-
return
|
|
683
|
+
function Pe(e) {
|
|
684
|
+
return F(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
683
685
|
}
|
|
684
|
-
function
|
|
686
|
+
function ye(e) {
|
|
685
687
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
686
688
|
}
|
|
687
|
-
function
|
|
689
|
+
function xe(e) {
|
|
688
690
|
return typeof e == "string";
|
|
689
691
|
}
|
|
690
692
|
function qt(e) {
|
|
691
|
-
return (
|
|
693
|
+
return (F(e) || Array.isArray(e)) && !Re(e) && !Pe(e) && !xe(e);
|
|
692
694
|
}
|
|
693
|
-
function
|
|
695
|
+
function Le(e) {
|
|
694
696
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
695
697
|
}
|
|
696
|
-
function
|
|
698
|
+
function Oe(e = !0) {
|
|
697
699
|
let t = Date.now();
|
|
698
700
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
699
701
|
const a = (t + Math.random() * 16) % 16 | 0;
|
|
700
702
|
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
701
703
|
});
|
|
702
704
|
}
|
|
703
|
-
function
|
|
705
|
+
function Bt(e) {
|
|
704
706
|
if (!e)
|
|
705
707
|
return "``";
|
|
706
708
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
@@ -712,36 +714,36 @@ function Ft(e) {
|
|
|
712
714
|
}
|
|
713
715
|
return t.push("`"), t.join("");
|
|
714
716
|
}
|
|
715
|
-
function
|
|
717
|
+
function jt(e) {
|
|
716
718
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
717
719
|
try {
|
|
718
720
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then(
|
|
719
721
|
(t) => Array.prototype.map.call(new Uint8Array(t), (r) => `00${r.toString(16)}`.slice(-2)).join("")
|
|
720
|
-
).catch(() => Promise.resolve(
|
|
722
|
+
).catch(() => Promise.resolve(j(e)));
|
|
721
723
|
} catch {
|
|
722
|
-
return Promise.resolve(
|
|
724
|
+
return Promise.resolve(j(e));
|
|
723
725
|
}
|
|
724
|
-
return Promise.resolve(
|
|
726
|
+
return Promise.resolve(j(e));
|
|
725
727
|
}
|
|
726
|
-
function
|
|
728
|
+
function j(e) {
|
|
727
729
|
let n = 2166136261;
|
|
728
730
|
for (let _ = 0; _ < e.length; _++)
|
|
729
731
|
n ^= e.charCodeAt(_), n = n * 16777619 >>> 0;
|
|
730
|
-
const a = n.toString(16).padStart(8, "0"), o = ((n ^ 2863311530) >>> 0).toString(16).padStart(8, "0"), s = ((n ^ 1431655765) >>> 0).toString(16).padStart(8, "0"),
|
|
731
|
-
return (
|
|
732
|
+
const a = n.toString(16).padStart(8, "0"), o = ((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 = a + o + s + i;
|
|
733
|
+
return (c + c + c + c).substring(0, 128);
|
|
732
734
|
}
|
|
733
|
-
let
|
|
734
|
-
function
|
|
735
|
-
let r =
|
|
736
|
-
r && (
|
|
735
|
+
let Q, ne;
|
|
736
|
+
function $(e, t = !0) {
|
|
737
|
+
let r = $e(e.$auditRecord);
|
|
738
|
+
r && (Ue(r), t && De(r)), e.$auditRecord = r;
|
|
737
739
|
}
|
|
738
|
-
function
|
|
740
|
+
function $e(e) {
|
|
739
741
|
if (!e)
|
|
740
742
|
return;
|
|
741
743
|
let t;
|
|
742
744
|
if (Array.isArray(e))
|
|
743
745
|
t = e;
|
|
744
|
-
else if (
|
|
746
|
+
else if (F(e)) {
|
|
745
747
|
const r = e;
|
|
746
748
|
if (r.auditEvents || r.mlAuditEvents)
|
|
747
749
|
return r;
|
|
@@ -749,53 +751,53 @@ function Le(e) {
|
|
|
749
751
|
}
|
|
750
752
|
return { auditEvents: t };
|
|
751
753
|
}
|
|
752
|
-
function
|
|
753
|
-
const t =
|
|
754
|
+
function Ue(e) {
|
|
755
|
+
const t = Ie();
|
|
754
756
|
return e.auditEvents?.forEach((r) => {
|
|
755
757
|
r.detail || (r.detail = {}), r.detail.sessionid = t;
|
|
756
758
|
}), e;
|
|
757
759
|
}
|
|
758
|
-
function
|
|
760
|
+
function De(e) {
|
|
759
761
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
760
762
|
return e?.auditEvents?.forEach((r) => {
|
|
761
763
|
r.detail || (r.detail = {}), r.detail.url = t;
|
|
762
764
|
}), e;
|
|
763
765
|
}
|
|
764
|
-
function
|
|
765
|
-
return (!
|
|
766
|
+
function Ie() {
|
|
767
|
+
return (!Q || Ae()) && (Q = Oe()), ne = /* @__PURE__ */ new Date(), Q;
|
|
766
768
|
}
|
|
767
|
-
function
|
|
768
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
769
|
+
function Ae() {
|
|
770
|
+
return (/* @__PURE__ */ new Date()).getTime() - ne.getTime() > 600 * 1e3;
|
|
769
771
|
}
|
|
770
|
-
async function
|
|
772
|
+
async function Ne(e, t = !0) {
|
|
771
773
|
const r = {
|
|
772
|
-
event:
|
|
774
|
+
event: C.None,
|
|
773
775
|
$auditRecord: e
|
|
774
776
|
};
|
|
775
|
-
return
|
|
777
|
+
return $(r, t), l("api/v1/audit.notify", r);
|
|
776
778
|
}
|
|
777
|
-
const
|
|
778
|
-
async function
|
|
779
|
+
const Qt = { notify: Ne };
|
|
780
|
+
async function Vt(e, t, r) {
|
|
779
781
|
const n = e.items?.length || 0, a = 10, o = {
|
|
780
782
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: a } } },
|
|
781
783
|
$auditRecord: { auditEvents: [r] }
|
|
782
784
|
};
|
|
783
|
-
|
|
784
|
-
const s = await l("api/v1/query", o),
|
|
785
|
+
$(o);
|
|
786
|
+
const s = await l("api/v1/query", o), i = await P(s), { aggregations: c } = i, d = c[0];
|
|
785
787
|
return d.$hasMore = d.items.length > a, d.items = [...e.items, ...d.items], Promise.resolve(d);
|
|
786
788
|
}
|
|
787
|
-
async function
|
|
789
|
+
async function Gt() {
|
|
788
790
|
const { app: e } = u, t = new URLSearchParams({ app: e || "" });
|
|
789
791
|
return w("api/v1/app", t);
|
|
790
792
|
}
|
|
791
|
-
async function
|
|
793
|
+
async function Fe() {
|
|
792
794
|
const { app: e } = u, t = new URLSearchParams({
|
|
793
795
|
app: e || "",
|
|
794
796
|
preLogin: "true"
|
|
795
797
|
});
|
|
796
798
|
return w("api/v1/app", t);
|
|
797
799
|
}
|
|
798
|
-
function
|
|
800
|
+
function zt() {
|
|
799
801
|
let { backendUrl: e, app: t, useCredentials: r } = u;
|
|
800
802
|
if (typeof window < "u") {
|
|
801
803
|
if (e || (e = window.location.origin), !t) {
|
|
@@ -818,7 +820,7 @@ function Gt() {
|
|
|
818
820
|
autoSAMLProvider: void 0,
|
|
819
821
|
bearerToken: void 0,
|
|
820
822
|
useSAML: void 0
|
|
821
|
-
}), Promise.resolve({})) :
|
|
823
|
+
}), Promise.resolve({})) : Fe().then((n) => {
|
|
822
824
|
const { autoOAuthProvider: a, autoSAMLProvider: o } = u, s = !a && !n.autoOAuthProvider && !o && !n.autoSAMLProvider;
|
|
823
825
|
return k({
|
|
824
826
|
...u,
|
|
@@ -831,20 +833,20 @@ function Gt() {
|
|
|
831
833
|
throw f("atomic:fetchAppPreLogin error", n), n;
|
|
832
834
|
});
|
|
833
835
|
}
|
|
834
|
-
async function
|
|
836
|
+
async function Ht(e, t, r = {}) {
|
|
835
837
|
const n = `api/v1/search.dataset/${e}/${t}`, a = await l(n, { parameters: r }), o = t[0].toLowerCase() + t.slice(1), s = a.datasets[o];
|
|
836
838
|
if ("errorCode" in s && "errorMessage" in s)
|
|
837
839
|
throw new Error(s.errorMessage);
|
|
838
840
|
return s;
|
|
839
841
|
}
|
|
840
|
-
async function
|
|
842
|
+
async function Jt(e, t) {
|
|
841
843
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: a = [] } = t;
|
|
842
844
|
return (await l(r, { parameters: n, datasets: a })).datasets;
|
|
843
845
|
}
|
|
844
|
-
async function
|
|
846
|
+
async function Wt(e) {
|
|
845
847
|
return await w(`api/v1/search.dataset/${e}`);
|
|
846
848
|
}
|
|
847
|
-
async function
|
|
849
|
+
async function Mt(e, t = !0, r) {
|
|
848
850
|
try {
|
|
849
851
|
return (await l("api/v1/labels", {
|
|
850
852
|
action: "list",
|
|
@@ -857,7 +859,7 @@ async function Wt(e, t = !0, r) {
|
|
|
857
859
|
throw f("Error in fetchLabels", n), n;
|
|
858
860
|
}
|
|
859
861
|
}
|
|
860
|
-
async function
|
|
862
|
+
async function qe() {
|
|
861
863
|
try {
|
|
862
864
|
const { app: e = "" } = u, t = new URLSearchParams({
|
|
863
865
|
app: e,
|
|
@@ -868,7 +870,7 @@ async function Ne() {
|
|
|
868
870
|
throw f("Error in getUserRights", e), e;
|
|
869
871
|
}
|
|
870
872
|
}
|
|
871
|
-
async function
|
|
873
|
+
async function Be(e, t, r = !0) {
|
|
872
874
|
try {
|
|
873
875
|
const n = {
|
|
874
876
|
action: "add",
|
|
@@ -878,7 +880,7 @@ async function qe(e, t, r = !0) {
|
|
|
878
880
|
$auditRecord: {
|
|
879
881
|
auditEvents: [
|
|
880
882
|
{
|
|
881
|
-
type:
|
|
883
|
+
type: C.Label_AddDoc,
|
|
882
884
|
detail: {
|
|
883
885
|
public: r,
|
|
884
886
|
label: e ? e.toString() : null,
|
|
@@ -899,7 +901,7 @@ async function qe(e, t, r = !0) {
|
|
|
899
901
|
throw f("Error in add", n), n;
|
|
900
902
|
}
|
|
901
903
|
}
|
|
902
|
-
async function
|
|
904
|
+
async function je(e, t, r = !0) {
|
|
903
905
|
try {
|
|
904
906
|
const n = {
|
|
905
907
|
action: "remove",
|
|
@@ -909,7 +911,7 @@ async function Fe(e, t, r = !0) {
|
|
|
909
911
|
$auditRecord: {
|
|
910
912
|
auditEvents: [
|
|
911
913
|
{
|
|
912
|
-
type:
|
|
914
|
+
type: C.Label_RemoveDoc,
|
|
913
915
|
detail: {
|
|
914
916
|
public: r,
|
|
915
917
|
label: e ? e.toString() : null,
|
|
@@ -930,7 +932,7 @@ async function Fe(e, t, r = !0) {
|
|
|
930
932
|
throw f("Error in remove", n), n;
|
|
931
933
|
}
|
|
932
934
|
}
|
|
933
|
-
async function
|
|
935
|
+
async function Qe(e, t, r = !0) {
|
|
934
936
|
try {
|
|
935
937
|
const n = {
|
|
936
938
|
action: "rename",
|
|
@@ -938,7 +940,7 @@ async function Be(e, t, r = !0) {
|
|
|
938
940
|
newLabel: t,
|
|
939
941
|
public: r,
|
|
940
942
|
auditEvents: {
|
|
941
|
-
type:
|
|
943
|
+
type: C.Label_Rename,
|
|
942
944
|
detail: {
|
|
943
945
|
public: r,
|
|
944
946
|
oldlabel: e ? e.toString() : null,
|
|
@@ -951,14 +953,14 @@ async function Be(e, t, r = !0) {
|
|
|
951
953
|
throw f("Error in rename", n), n;
|
|
952
954
|
}
|
|
953
955
|
}
|
|
954
|
-
async function
|
|
956
|
+
async function Ve(e, t = !0) {
|
|
955
957
|
try {
|
|
956
958
|
const r = {
|
|
957
959
|
action: "delete",
|
|
958
960
|
labels: e,
|
|
959
961
|
public: t,
|
|
960
962
|
auditEvents: {
|
|
961
|
-
type:
|
|
963
|
+
type: C.Label_Delete,
|
|
962
964
|
detail: {
|
|
963
965
|
public: t,
|
|
964
966
|
label: e ? e.toString() : null
|
|
@@ -970,7 +972,7 @@ async function je(e, t = !0) {
|
|
|
970
972
|
throw f("Error in deleteLabels", r), r;
|
|
971
973
|
}
|
|
972
974
|
}
|
|
973
|
-
async function
|
|
975
|
+
async function Ge(e, t, r = !0) {
|
|
974
976
|
try {
|
|
975
977
|
const n = {
|
|
976
978
|
action: "bulkAdd",
|
|
@@ -978,7 +980,7 @@ async function Qe(e, t, r = !0) {
|
|
|
978
980
|
query: t,
|
|
979
981
|
public: r,
|
|
980
982
|
auditEvents: {
|
|
981
|
-
type:
|
|
983
|
+
type: C.Label_Add,
|
|
982
984
|
detail: {
|
|
983
985
|
public: r,
|
|
984
986
|
label: e ? e.toString() : null,
|
|
@@ -991,7 +993,7 @@ async function Qe(e, t, r = !0) {
|
|
|
991
993
|
throw f("Error in bulkAdd", n), n;
|
|
992
994
|
}
|
|
993
995
|
}
|
|
994
|
-
async function
|
|
996
|
+
async function ze(e, t, r = !0) {
|
|
995
997
|
try {
|
|
996
998
|
const n = {
|
|
997
999
|
action: "bulkRemove",
|
|
@@ -999,7 +1001,7 @@ async function Ve(e, t, r = !0) {
|
|
|
999
1001
|
query: t,
|
|
1000
1002
|
public: r,
|
|
1001
1003
|
auditEvents: {
|
|
1002
|
-
type:
|
|
1004
|
+
type: C.Label_Delete,
|
|
1003
1005
|
detail: {
|
|
1004
1006
|
public: r,
|
|
1005
1007
|
label: e ? e.toString() : null,
|
|
@@ -1012,16 +1014,16 @@ async function Ve(e, t, r = !0) {
|
|
|
1012
1014
|
throw f("Error in bulkRemove", n), n;
|
|
1013
1015
|
}
|
|
1014
1016
|
}
|
|
1015
|
-
const
|
|
1016
|
-
getUserRights:
|
|
1017
|
-
add:
|
|
1018
|
-
remove:
|
|
1019
|
-
rename:
|
|
1020
|
-
delete:
|
|
1021
|
-
bulkAdd:
|
|
1022
|
-
bulkRemove:
|
|
1017
|
+
const Xt = {
|
|
1018
|
+
getUserRights: qe,
|
|
1019
|
+
add: Be,
|
|
1020
|
+
remove: je,
|
|
1021
|
+
rename: Qe,
|
|
1022
|
+
delete: Ve,
|
|
1023
|
+
bulkAdd: Ge,
|
|
1024
|
+
bulkRemove: ze
|
|
1023
1025
|
};
|
|
1024
|
-
async function
|
|
1026
|
+
async function Yt(e, t) {
|
|
1025
1027
|
if (typeof window > "u")
|
|
1026
1028
|
return l("api/v1/preview", {
|
|
1027
1029
|
action: "get",
|
|
@@ -1036,7 +1038,7 @@ async function Xt(e, t) {
|
|
|
1036
1038
|
browserUrl: r
|
|
1037
1039
|
});
|
|
1038
1040
|
}
|
|
1039
|
-
async function
|
|
1041
|
+
async function Kt(e) {
|
|
1040
1042
|
const t = new Headers();
|
|
1041
1043
|
t.append("content-type", "text");
|
|
1042
1044
|
const r = await fetch(
|
|
@@ -1046,16 +1048,16 @@ async function Yt(e) {
|
|
|
1046
1048
|
headers: t
|
|
1047
1049
|
}
|
|
1048
1050
|
);
|
|
1049
|
-
|
|
1051
|
+
P(r);
|
|
1050
1052
|
}
|
|
1051
|
-
async function
|
|
1053
|
+
async function ae() {
|
|
1052
1054
|
const e = new URLSearchParams({
|
|
1053
1055
|
action: "get",
|
|
1054
1056
|
noAutoAuthentication: "true"
|
|
1055
1057
|
});
|
|
1056
1058
|
return w("api/v1/principal", e);
|
|
1057
1059
|
}
|
|
1058
|
-
async function
|
|
1060
|
+
async function He(e) {
|
|
1059
1061
|
const t = {
|
|
1060
1062
|
noAutoAuthentication: "true",
|
|
1061
1063
|
...e
|
|
@@ -1064,7 +1066,7 @@ async function Ge(e) {
|
|
|
1064
1066
|
a !== void 0 && r.append(n, String(a));
|
|
1065
1067
|
}), w("api/v1/principal/list", r);
|
|
1066
1068
|
}
|
|
1067
|
-
async function
|
|
1069
|
+
async function Je(e) {
|
|
1068
1070
|
if (!e)
|
|
1069
1071
|
return Promise.reject(new Error("userid is required"));
|
|
1070
1072
|
const t = new URLSearchParams({
|
|
@@ -1074,7 +1076,7 @@ async function ze(e) {
|
|
|
1074
1076
|
});
|
|
1075
1077
|
return w("api/v1/principal", t);
|
|
1076
1078
|
}
|
|
1077
|
-
async function
|
|
1079
|
+
async function We(e) {
|
|
1078
1080
|
if (e.length === 0)
|
|
1079
1081
|
return Promise.reject(new Error("userids is required"));
|
|
1080
1082
|
const t = new URLSearchParams({
|
|
@@ -1083,64 +1085,64 @@ async function He(e) {
|
|
|
1083
1085
|
});
|
|
1084
1086
|
return w("api/v1/principal/userids", t);
|
|
1085
1087
|
}
|
|
1086
|
-
const
|
|
1088
|
+
const Zt = {
|
|
1087
1089
|
principal: {
|
|
1088
|
-
get:
|
|
1089
|
-
list:
|
|
1090
|
-
userid:
|
|
1091
|
-
userids:
|
|
1090
|
+
get: ae,
|
|
1091
|
+
list: He,
|
|
1092
|
+
userid: Je,
|
|
1093
|
+
userids: We
|
|
1092
1094
|
}
|
|
1093
|
-
},
|
|
1094
|
-
async function
|
|
1095
|
+
}, oe = 11;
|
|
1096
|
+
async function Et(e, t, r) {
|
|
1095
1097
|
const a = await l("api/v1/query", {
|
|
1096
1098
|
query: e,
|
|
1097
1099
|
$auditRecord: t,
|
|
1098
1100
|
queryIntentData: r
|
|
1099
1101
|
});
|
|
1100
1102
|
a.aggregations.forEach((s) => {
|
|
1101
|
-
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length ===
|
|
1103
|
+
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length === oe), s.isTree && s.items && z(s);
|
|
1102
1104
|
}), a.records?.map((s) => Object.assign(s, { value: s.title, type: "default" }));
|
|
1103
1105
|
const o = { ...a, nextPage: a.page < Math.ceil(a.rowCount / a.pageSize) ? a.page + 1 : void 0, previousPage: a.page > 1 ? a.page - 1 : void 0 };
|
|
1104
1106
|
return Promise.resolve(o);
|
|
1105
1107
|
}
|
|
1106
|
-
async function
|
|
1108
|
+
async function Tt(e, t, r) {
|
|
1107
1109
|
const { app: n = "" } = u, a = {
|
|
1108
1110
|
methods: [],
|
|
1109
1111
|
mode: t,
|
|
1110
1112
|
propagateErrors: !0,
|
|
1111
1113
|
$auditRecord: { auditEvents: [r] }
|
|
1112
1114
|
};
|
|
1113
|
-
for (const
|
|
1115
|
+
for (const i of e)
|
|
1114
1116
|
a.methods.push({
|
|
1115
1117
|
method: "query",
|
|
1116
1118
|
app: n,
|
|
1117
|
-
query:
|
|
1119
|
+
query: i
|
|
1118
1120
|
});
|
|
1119
1121
|
const o = await l("api/v1/multi", a);
|
|
1120
|
-
o.results.forEach((
|
|
1121
|
-
|
|
1122
|
-
|
|
1122
|
+
o.results.forEach((i) => {
|
|
1123
|
+
i.aggregations.forEach((c) => {
|
|
1124
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === oe), c.isTree && z(c);
|
|
1123
1125
|
});
|
|
1124
|
-
}), o.results.forEach((
|
|
1125
|
-
const s = o.results.map((
|
|
1126
|
+
}), o.results.forEach((i) => i.records?.map((c) => Object.assign(c, { value: c.title, type: "default" })));
|
|
1127
|
+
const s = o.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 }));
|
|
1126
1128
|
return Promise.resolve(s);
|
|
1127
1129
|
}
|
|
1128
|
-
function
|
|
1130
|
+
function z(e, t = "", r = 0) {
|
|
1129
1131
|
let n = [];
|
|
1130
1132
|
return e.items && e.items.forEach((a) => {
|
|
1131
1133
|
let o = t ? `${t}/${a.value}` : a.value, s = r + 1;
|
|
1132
|
-
n.push({ path: o, level: s }), a.$path = o, a.$level = s, a.hasChildren ? n = n.concat(
|
|
1134
|
+
n.push({ path: o, level: s }), a.$path = o, a.$level = s, a.hasChildren ? n = n.concat(z(a, o, s)) : a.hasChildren = !1;
|
|
1133
1135
|
}), n;
|
|
1134
1136
|
}
|
|
1135
|
-
async function
|
|
1136
|
-
const { webservice: a, format: o, maxcount: s, exportedColumns:
|
|
1137
|
+
async function er({ model: e, appName: t, query: r, article: n }) {
|
|
1138
|
+
const { webservice: a, format: o, maxcount: s, exportedColumns: i, export: c } = e, d = {
|
|
1137
1139
|
app: t,
|
|
1138
1140
|
webservice: a,
|
|
1139
1141
|
query: r,
|
|
1140
|
-
type:
|
|
1142
|
+
type: c,
|
|
1141
1143
|
format: o,
|
|
1142
1144
|
maxcount: s,
|
|
1143
|
-
exportedColumns:
|
|
1145
|
+
exportedColumns: i,
|
|
1144
1146
|
$auditRecord: {
|
|
1145
1147
|
auditEvents: [{
|
|
1146
1148
|
type: "Search_ExportCSV",
|
|
@@ -1150,14 +1152,14 @@ async function Tt({ model: e, appName: t, query: r, article: n }) {
|
|
|
1150
1152
|
}]
|
|
1151
1153
|
}
|
|
1152
1154
|
};
|
|
1153
|
-
return
|
|
1155
|
+
return $(d), await l("api/v1/search.queryexport", d, { responseType: "blob" });
|
|
1154
1156
|
}
|
|
1155
|
-
async function
|
|
1157
|
+
async function tr(e) {
|
|
1156
1158
|
return (await l("api/v1/queryintent", {
|
|
1157
1159
|
query: e
|
|
1158
1160
|
}))?.intents;
|
|
1159
1161
|
}
|
|
1160
|
-
async function
|
|
1162
|
+
async function rr(e, t, r) {
|
|
1161
1163
|
return (await l(
|
|
1162
1164
|
"api/v1/similardocuments",
|
|
1163
1165
|
{
|
|
@@ -1169,17 +1171,17 @@ async function tr(e, t, r) {
|
|
|
1169
1171
|
{ signal: r }
|
|
1170
1172
|
)).data;
|
|
1171
1173
|
}
|
|
1172
|
-
async function
|
|
1174
|
+
async function nr(e, t) {
|
|
1173
1175
|
return (await l("api/v1/query.links", {
|
|
1174
1176
|
webservice: e,
|
|
1175
1177
|
query: t
|
|
1176
1178
|
}))?.links?.map((a) => ({ ...a, query: t }));
|
|
1177
1179
|
}
|
|
1178
|
-
function
|
|
1180
|
+
function Me(e, t) {
|
|
1179
1181
|
if (typeof e == "number")
|
|
1180
1182
|
return `${e}`;
|
|
1181
|
-
if (
|
|
1182
|
-
return
|
|
1183
|
+
if (ye(e))
|
|
1184
|
+
return Xe(e);
|
|
1183
1185
|
if (typeof e == "boolean")
|
|
1184
1186
|
return e ? "true" : "false";
|
|
1185
1187
|
if (e === null)
|
|
@@ -1192,11 +1194,11 @@ function Je(e, t) {
|
|
|
1192
1194
|
}
|
|
1193
1195
|
return e;
|
|
1194
1196
|
}
|
|
1195
|
-
function
|
|
1197
|
+
function Xe(e) {
|
|
1196
1198
|
if (!e)
|
|
1197
1199
|
return "";
|
|
1198
1200
|
try {
|
|
1199
|
-
if (
|
|
1201
|
+
if (Le(e) === 0)
|
|
1200
1202
|
return new Intl.DateTimeFormat("en-CA", {
|
|
1201
1203
|
year: "numeric",
|
|
1202
1204
|
month: "2-digit",
|
|
@@ -1215,7 +1217,7 @@ function We(e) {
|
|
|
1215
1217
|
return "Invalid date";
|
|
1216
1218
|
}
|
|
1217
1219
|
}
|
|
1218
|
-
async function
|
|
1220
|
+
async function ar(e, t, r, n, a) {
|
|
1219
1221
|
const { app: o } = u, s = {
|
|
1220
1222
|
app: o || "",
|
|
1221
1223
|
suggestQuery: e,
|
|
@@ -1229,11 +1231,11 @@ async function nr(e, t, r, n, a) {
|
|
|
1229
1231
|
"api/v1/search.suggest",
|
|
1230
1232
|
s
|
|
1231
1233
|
)).suggests;
|
|
1232
|
-
} catch (
|
|
1233
|
-
throw console.error("Error fetching suggestions:",
|
|
1234
|
+
} catch (i) {
|
|
1235
|
+
throw console.error("Error fetching suggestions:", i), i;
|
|
1234
1236
|
}
|
|
1235
1237
|
}
|
|
1236
|
-
async function
|
|
1238
|
+
async function or(e, t, r, n) {
|
|
1237
1239
|
const { app: a } = u;
|
|
1238
1240
|
return (await l(
|
|
1239
1241
|
"api/v1/suggestquery",
|
|
@@ -1246,7 +1248,7 @@ async function ar(e, t, r, n) {
|
|
|
1246
1248
|
}
|
|
1247
1249
|
)).suggests;
|
|
1248
1250
|
}
|
|
1249
|
-
async function
|
|
1251
|
+
async function sr(e, t, r) {
|
|
1250
1252
|
if (!t) return Promise.resolve([]);
|
|
1251
1253
|
const { app: n } = u, o = await l(
|
|
1252
1254
|
"api/v1/suggestfield",
|
|
@@ -1258,10 +1260,10 @@ async function or(e, t, r) {
|
|
|
1258
1260
|
}
|
|
1259
1261
|
);
|
|
1260
1262
|
return o.suggests.forEach((s) => {
|
|
1261
|
-
s.display =
|
|
1263
|
+
s.display = Me(s.display);
|
|
1262
1264
|
}), o.suggests;
|
|
1263
1265
|
}
|
|
1264
|
-
async function
|
|
1266
|
+
async function ir(e, t, r, n, a, o) {
|
|
1265
1267
|
return l("api/v1/doc.textchunks", {
|
|
1266
1268
|
id: e,
|
|
1267
1269
|
textChunks: t,
|
|
@@ -1271,75 +1273,86 @@ async function sr(e, t, r, n, a, o) {
|
|
|
1271
1273
|
rightSentencesCount: o
|
|
1272
1274
|
});
|
|
1273
1275
|
}
|
|
1274
|
-
async function
|
|
1276
|
+
async function cr() {
|
|
1275
1277
|
const { app: e } = u, t = new URLSearchParams({
|
|
1276
1278
|
app: e || "",
|
|
1277
1279
|
action: "load"
|
|
1278
1280
|
});
|
|
1279
1281
|
return w("api/v1/usersettings", t);
|
|
1280
1282
|
}
|
|
1281
|
-
async function
|
|
1283
|
+
async function Ye(e, t) {
|
|
1282
1284
|
const r = {
|
|
1283
1285
|
action: "save",
|
|
1284
1286
|
userSettings: e,
|
|
1285
1287
|
$auditRecord: { auditEvents: [t] }
|
|
1286
1288
|
};
|
|
1287
|
-
return
|
|
1289
|
+
return $(r), l("api/v1/usersettings", r);
|
|
1288
1290
|
}
|
|
1289
|
-
async function
|
|
1291
|
+
async function lr(e, t) {
|
|
1290
1292
|
const n = {
|
|
1291
1293
|
action: "patch",
|
|
1292
1294
|
userSettings: e,
|
|
1293
1295
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1294
1296
|
};
|
|
1295
|
-
return
|
|
1297
|
+
return $(n), l("api/v1/usersettings", n);
|
|
1296
1298
|
}
|
|
1297
|
-
async function
|
|
1298
|
-
return
|
|
1299
|
+
async function ur() {
|
|
1300
|
+
return Ye({}, { type: "UserSettings_Reset" });
|
|
1299
1301
|
}
|
|
1300
|
-
async function
|
|
1302
|
+
async function dr(e, t) {
|
|
1301
1303
|
return l("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1302
1304
|
}
|
|
1303
|
-
async function
|
|
1305
|
+
async function fr(e) {
|
|
1304
1306
|
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1305
1307
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1306
1308
|
userName: e
|
|
1307
1309
|
};
|
|
1308
1310
|
return l(t, n);
|
|
1309
1311
|
}
|
|
1310
|
-
async function
|
|
1312
|
+
async function hr(e) {
|
|
1311
1313
|
return await w(`api/v2/user-profile/${e}`);
|
|
1312
1314
|
}
|
|
1313
|
-
async function
|
|
1315
|
+
async function gr(e) {
|
|
1314
1316
|
return await l("api/v2/user-profile", e);
|
|
1315
1317
|
}
|
|
1316
|
-
async function
|
|
1317
|
-
return await
|
|
1318
|
+
async function pr(e, t, r) {
|
|
1319
|
+
return await _e(
|
|
1318
1320
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`,
|
|
1319
1321
|
e
|
|
1320
1322
|
);
|
|
1321
1323
|
}
|
|
1322
|
-
async function
|
|
1324
|
+
async function mr(e, t, r) {
|
|
1323
1325
|
try {
|
|
1324
|
-
return (await
|
|
1326
|
+
return (await we(
|
|
1325
1327
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`
|
|
1326
1328
|
)).success === !0;
|
|
1327
1329
|
} catch {
|
|
1328
1330
|
return !1;
|
|
1329
1331
|
}
|
|
1330
1332
|
}
|
|
1331
|
-
async function
|
|
1333
|
+
async function wr() {
|
|
1332
1334
|
return await w("api/v2/version");
|
|
1333
1335
|
}
|
|
1334
|
-
const
|
|
1336
|
+
const v = 1e4, Ke = async () => {
|
|
1335
1337
|
const { autoOAuthProvider: e } = u;
|
|
1338
|
+
if (!e)
|
|
1339
|
+
throw new Error("autoOAuthProvider is not configured in globalConfig");
|
|
1336
1340
|
if (typeof window > "u")
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1341
|
+
try {
|
|
1342
|
+
const { signal: r } = b(v);
|
|
1343
|
+
return await l(
|
|
1344
|
+
"security.oauth",
|
|
1345
|
+
{
|
|
1346
|
+
action: "getcode",
|
|
1347
|
+
provider: e,
|
|
1348
|
+
tokenInCookie: !0,
|
|
1349
|
+
originalUrl: "http://localhost"
|
|
1350
|
+
},
|
|
1351
|
+
{ signal: r }
|
|
1352
|
+
);
|
|
1353
|
+
} catch (r) {
|
|
1354
|
+
throw f("Failed to authenticate with OAuth", r), r;
|
|
1355
|
+
}
|
|
1343
1356
|
const t = {
|
|
1344
1357
|
action: "getcode",
|
|
1345
1358
|
provider: e,
|
|
@@ -1347,23 +1360,39 @@ const Xe = async () => {
|
|
|
1347
1360
|
originalUrl: window.location.href
|
|
1348
1361
|
};
|
|
1349
1362
|
try {
|
|
1350
|
-
const r = await l(
|
|
1363
|
+
const { signal: r } = b(v), n = await l(
|
|
1351
1364
|
"api/v1/security.oauth",
|
|
1352
|
-
t
|
|
1365
|
+
t,
|
|
1366
|
+
{ signal: r }
|
|
1353
1367
|
);
|
|
1354
|
-
|
|
1368
|
+
if (n.redirectUrl) {
|
|
1369
|
+
const a = new URL(n.redirectUrl, window.location.origin);
|
|
1370
|
+
(a.protocol === "https:" || a.protocol === "http:") && (window.location.href = a.href);
|
|
1371
|
+
}
|
|
1372
|
+
return n;
|
|
1355
1373
|
} catch (r) {
|
|
1356
|
-
throw
|
|
1374
|
+
throw f("Failed to authenticate with OAuth", r), r;
|
|
1357
1375
|
}
|
|
1358
|
-
},
|
|
1376
|
+
}, Ze = async () => {
|
|
1359
1377
|
const { autoSAMLProvider: e } = u;
|
|
1378
|
+
if (!e)
|
|
1379
|
+
throw new Error("autoSAMLProvider is not configured in globalConfig");
|
|
1360
1380
|
if (typeof window > "u")
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1381
|
+
try {
|
|
1382
|
+
const { signal: r } = b(v);
|
|
1383
|
+
return await l(
|
|
1384
|
+
"security.saml",
|
|
1385
|
+
{
|
|
1386
|
+
action: "getresponse",
|
|
1387
|
+
provider: e,
|
|
1388
|
+
tokenInCookie: !0,
|
|
1389
|
+
originalUrl: "http://localhost"
|
|
1390
|
+
},
|
|
1391
|
+
{ signal: r }
|
|
1392
|
+
);
|
|
1393
|
+
} catch (r) {
|
|
1394
|
+
throw f("Failed to authenticate with SAML", r), r;
|
|
1395
|
+
}
|
|
1367
1396
|
const t = {
|
|
1368
1397
|
action: "getresponse",
|
|
1369
1398
|
provider: e,
|
|
@@ -1371,15 +1400,20 @@ const Xe = async () => {
|
|
|
1371
1400
|
originalUrl: window.location.href
|
|
1372
1401
|
};
|
|
1373
1402
|
try {
|
|
1374
|
-
const r = await l(
|
|
1403
|
+
const { signal: r } = b(v), n = await l(
|
|
1375
1404
|
"api/v1/security.saml",
|
|
1376
|
-
t
|
|
1405
|
+
t,
|
|
1406
|
+
{ signal: r }
|
|
1377
1407
|
);
|
|
1378
|
-
|
|
1408
|
+
if (n.redirectUrl) {
|
|
1409
|
+
const a = new URL(n.redirectUrl, window.location.origin);
|
|
1410
|
+
(a.protocol === "https:" || a.protocol === "http:") && (window.location.href = a.href);
|
|
1411
|
+
}
|
|
1412
|
+
return n;
|
|
1379
1413
|
} catch (r) {
|
|
1380
|
-
throw
|
|
1414
|
+
throw f("Failed to authenticate with SAML", r), r;
|
|
1381
1415
|
}
|
|
1382
|
-
},
|
|
1416
|
+
}, H = {
|
|
1383
1417
|
store: {},
|
|
1384
1418
|
getItem(e) {
|
|
1385
1419
|
return this.store[e] ?? null;
|
|
@@ -1393,36 +1427,38 @@ const Xe = async () => {
|
|
|
1393
1427
|
clear() {
|
|
1394
1428
|
this.store = {};
|
|
1395
1429
|
}
|
|
1396
|
-
},
|
|
1397
|
-
function Ke(e) {
|
|
1398
|
-
return typeof window > "u" || !window.localStorage ? G.getItem(e) : window.localStorage.getItem(e);
|
|
1399
|
-
}
|
|
1400
|
-
function Ze(e) {
|
|
1401
|
-
typeof window > "u" || !window.localStorage ? G.removeItem(e) : window.localStorage.removeItem(e);
|
|
1402
|
-
}
|
|
1430
|
+
}, J = H;
|
|
1403
1431
|
function Ee(e) {
|
|
1404
|
-
return typeof window > "u" || !window.
|
|
1432
|
+
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1405
1433
|
}
|
|
1406
|
-
function Te(e
|
|
1407
|
-
typeof window > "u" || !window.
|
|
1434
|
+
function Te(e) {
|
|
1435
|
+
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1408
1436
|
}
|
|
1409
1437
|
function et(e) {
|
|
1410
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1438
|
+
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
1439
|
+
}
|
|
1440
|
+
function tt(e, t) {
|
|
1441
|
+
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1411
1442
|
}
|
|
1412
|
-
|
|
1443
|
+
function rt(e) {
|
|
1444
|
+
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1445
|
+
}
|
|
1446
|
+
const I = (e) => tt(
|
|
1413
1447
|
"sinequa-credentials",
|
|
1414
1448
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1415
|
-
),
|
|
1449
|
+
), nt = async () => {
|
|
1416
1450
|
try {
|
|
1417
|
-
const e = await w(
|
|
1418
|
-
"api/v1/challenge?action=getCsrfToken&suppressErrors=true"
|
|
1451
|
+
const { signal: e } = b(v), t = await w(
|
|
1452
|
+
"api/v1/challenge?action=getCsrfToken&suppressErrors=true",
|
|
1453
|
+
void 0,
|
|
1454
|
+
{ signal: e }
|
|
1419
1455
|
);
|
|
1420
|
-
return
|
|
1456
|
+
return t?.csrfToken ? (I(t.csrfToken), t.csrfToken) : null;
|
|
1421
1457
|
} catch (e) {
|
|
1422
1458
|
throw f("Failed to get CSRF token", e), e;
|
|
1423
1459
|
}
|
|
1424
1460
|
};
|
|
1425
|
-
async function
|
|
1461
|
+
async function at(e) {
|
|
1426
1462
|
if (e) {
|
|
1427
1463
|
const { username: t, password: r } = e, n = {
|
|
1428
1464
|
action: "get",
|
|
@@ -1433,13 +1469,14 @@ async function rt(e) {
|
|
|
1433
1469
|
noAutoAuthentication: !0
|
|
1434
1470
|
};
|
|
1435
1471
|
try {
|
|
1436
|
-
const a = await l(
|
|
1472
|
+
const { signal: a } = b(v), o = await l(
|
|
1437
1473
|
"api/v1/security.webtoken",
|
|
1438
|
-
n
|
|
1474
|
+
n,
|
|
1475
|
+
{ signal: a }
|
|
1439
1476
|
);
|
|
1440
|
-
return
|
|
1477
|
+
return o?.csrfToken ? (I(o.csrfToken), o.csrfToken) : null;
|
|
1441
1478
|
} catch (a) {
|
|
1442
|
-
throw
|
|
1479
|
+
throw f("Failed to get JWT", a), a;
|
|
1443
1480
|
}
|
|
1444
1481
|
} else {
|
|
1445
1482
|
const t = {
|
|
@@ -1456,215 +1493,225 @@ async function rt(e) {
|
|
|
1456
1493
|
const n = new Headers();
|
|
1457
1494
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${r}`);
|
|
1458
1495
|
try {
|
|
1459
|
-
const a = await l(
|
|
1496
|
+
const { signal: a } = b(v), o = await l(
|
|
1460
1497
|
"api/v1/security.webtoken",
|
|
1461
1498
|
t,
|
|
1462
|
-
{ headers: n }
|
|
1499
|
+
{ headers: n, signal: a }
|
|
1463
1500
|
);
|
|
1464
|
-
return
|
|
1501
|
+
return o?.csrfToken ? (I(o.csrfToken), o.csrfToken) : null;
|
|
1465
1502
|
} catch (a) {
|
|
1466
|
-
throw
|
|
1503
|
+
throw f("Failed to get JWT without credentials", a), a;
|
|
1467
1504
|
}
|
|
1468
1505
|
}
|
|
1469
1506
|
}
|
|
1470
|
-
const
|
|
1471
|
-
const e =
|
|
1507
|
+
const W = () => {
|
|
1508
|
+
const e = et("sinequa-credentials");
|
|
1472
1509
|
if (e)
|
|
1473
1510
|
try {
|
|
1474
1511
|
const n = JSON.parse(e).data?.csrfToken;
|
|
1475
|
-
if (n
|
|
1476
|
-
} catch {
|
|
1512
|
+
if (n) return n;
|
|
1513
|
+
} catch (r) {
|
|
1514
|
+
y(
|
|
1515
|
+
"Failed to parse session storage credentials, falling back to local storage",
|
|
1516
|
+
r
|
|
1517
|
+
);
|
|
1477
1518
|
}
|
|
1478
|
-
const t =
|
|
1479
|
-
return t
|
|
1480
|
-
},
|
|
1519
|
+
const t = Ee("csrfToken");
|
|
1520
|
+
return t || null;
|
|
1521
|
+
}, _r = async (e) => {
|
|
1481
1522
|
if (e)
|
|
1482
1523
|
S("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1483
1524
|
else {
|
|
1484
|
-
let
|
|
1525
|
+
let i = null;
|
|
1485
1526
|
try {
|
|
1486
|
-
S("Attempting to retrieve CSRF token from the backend"),
|
|
1487
|
-
} catch
|
|
1488
|
-
f("Failed to retrieve CSRF token", i);
|
|
1527
|
+
S("Attempting to retrieve CSRF token from the backend"), i = await nt(), L("CSRF token retrieval result", i ? "success" : "failed");
|
|
1528
|
+
} catch {
|
|
1489
1529
|
}
|
|
1490
1530
|
try {
|
|
1491
|
-
if (
|
|
1492
|
-
const { autoOAuthProvider:
|
|
1493
|
-
if (
|
|
1494
|
-
return S("Initiating OAuth authentication flow"), await
|
|
1531
|
+
if (i === null) {
|
|
1532
|
+
const { autoOAuthProvider: c, autoSAMLProvider: d, useSAML: _ } = u;
|
|
1533
|
+
if (c && !_)
|
|
1534
|
+
return S("Initiating OAuth authentication flow"), await Ke(), y("OAuth authentication flow did not redirect as expected"), g(!1), !1;
|
|
1495
1535
|
if (d)
|
|
1496
|
-
return S("Initiating SAML authentication flow"), await
|
|
1536
|
+
return S("Initiating SAML authentication flow"), await Ze(), y("SAML authentication flow did not redirect as expected"), g(!1), !1;
|
|
1497
1537
|
S(
|
|
1498
1538
|
"No direct authentication method available, will try SSO then credentials"
|
|
1499
1539
|
), k({ useCredentials: !0, useSSO: !0 });
|
|
1500
1540
|
} else
|
|
1501
|
-
return S("User authenticated via existing token"),
|
|
1502
|
-
} catch (
|
|
1503
|
-
throw f("Unexpected error during authentication",
|
|
1541
|
+
return S("User authenticated via existing token"), g(!0), !0;
|
|
1542
|
+
} catch (c) {
|
|
1543
|
+
throw f("Unexpected error during authentication", c), g(!1), c;
|
|
1504
1544
|
}
|
|
1505
1545
|
}
|
|
1506
1546
|
if (u.useCredentials && u.useSSO)
|
|
1507
1547
|
try {
|
|
1508
|
-
if (S("Checking if user is authenticated via SSO"), await
|
|
1509
|
-
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }),
|
|
1510
|
-
} catch (
|
|
1511
|
-
if (
|
|
1548
|
+
if (S("Checking if user is authenticated via SSO"), await ae())
|
|
1549
|
+
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }), g(!0), !0;
|
|
1550
|
+
} catch (i) {
|
|
1551
|
+
if (i?.status === 401)
|
|
1512
1552
|
return S("SSO authentication failed with 401, falling back to credentials"), k({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1513
|
-
throw f("SSO authentication failed with unexpected error",
|
|
1553
|
+
throw f("SSO authentication failed with unexpected error", i), g(!1), i;
|
|
1514
1554
|
}
|
|
1515
|
-
const { useSSO: r } = u, n =
|
|
1516
|
-
if (n
|
|
1517
|
-
return S("user already authenticated", n), k({ isRedirectUrl: !1 }),
|
|
1555
|
+
const { useSSO: r } = u, n = W();
|
|
1556
|
+
if (n || r)
|
|
1557
|
+
return S("user already authenticated", n), k({ isRedirectUrl: !1 }), g(!0), !0;
|
|
1518
1558
|
const { useCredentials: a } = u, { username: o, password: s } = e || {};
|
|
1519
|
-
if (a && !o
|
|
1520
|
-
return f("Credentials are required for authentication"),
|
|
1559
|
+
if (a && (!o || !s))
|
|
1560
|
+
return f("Credentials are required for authentication"), g(!1), !1;
|
|
1521
1561
|
if (o && s)
|
|
1522
1562
|
try {
|
|
1523
1563
|
S("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1524
|
-
const { userOverrideActive:
|
|
1525
|
-
return k({ userOverrideActive: !1, useroverride: void 0 }), await
|
|
1526
|
-
} catch (
|
|
1527
|
-
throw
|
|
1564
|
+
const { userOverrideActive: i, useroverride: c } = u;
|
|
1565
|
+
return k({ userOverrideActive: !1, useroverride: void 0 }), await at({ username: o, password: s }), k({ userOverrideActive: i, useroverride: c }), g(!0), !0;
|
|
1566
|
+
} catch (i) {
|
|
1567
|
+
throw g(!1), i;
|
|
1528
1568
|
}
|
|
1529
|
-
return
|
|
1569
|
+
return g(!1), f(
|
|
1530
1570
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1531
1571
|
), !1;
|
|
1532
|
-
},
|
|
1572
|
+
}, ot = async () => {
|
|
1533
1573
|
const e = new URLSearchParams({
|
|
1534
1574
|
action: "deleteWebTokenCookie",
|
|
1535
1575
|
noUserOverride: "true",
|
|
1536
1576
|
noAutoAuthentication: "true"
|
|
1537
|
-
});
|
|
1538
|
-
return w("api/v1/challenge", e);
|
|
1539
|
-
},
|
|
1577
|
+
}), { signal: t } = b(v);
|
|
1578
|
+
return w("api/v1/challenge", e, { signal: t });
|
|
1579
|
+
}, Sr = async () => {
|
|
1540
1580
|
const { useCredentials: e, userOverrideActive: t } = u;
|
|
1541
|
-
|
|
1542
|
-
|
|
1581
|
+
if (Te("csrfToken"), rt("sinequa-credentials"), e && !t)
|
|
1582
|
+
try {
|
|
1583
|
+
(await ot()).methodresult === "ok" || f("logout failed"), g(!1);
|
|
1584
|
+
} catch (r) {
|
|
1585
|
+
f("logout failed", r), g(!1);
|
|
1586
|
+
}
|
|
1587
|
+
else
|
|
1588
|
+
g(!1);
|
|
1589
|
+
}, kr = () => !!W();
|
|
1543
1590
|
export {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1591
|
+
Zt as API,
|
|
1592
|
+
R as ApiError,
|
|
1593
|
+
Qt as Audit,
|
|
1594
|
+
C as AuditEventType,
|
|
1595
|
+
Se as DidYouMeanKind,
|
|
1549
1596
|
h as EngineType,
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1597
|
+
m as EngineTypeModifier,
|
|
1598
|
+
te as LogLevel,
|
|
1599
|
+
It as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1600
|
+
ke as RFMDisplay,
|
|
1601
|
+
E as ServerError,
|
|
1602
|
+
me as TimeoutError,
|
|
1603
|
+
V as UnauthorizedError,
|
|
1604
|
+
$ as addAuditAdditionalInfo,
|
|
1605
|
+
dt as addConcepts,
|
|
1606
|
+
Ue as addSessionId,
|
|
1607
|
+
De as addUrl,
|
|
1608
|
+
se as aggItemRegex,
|
|
1609
|
+
ct as aggregationItemStrictCompare,
|
|
1610
|
+
zt as appInitializerFn,
|
|
1611
|
+
ut as bisect,
|
|
1612
|
+
z as buildPathsAndLevels,
|
|
1613
|
+
xt as configureLogger,
|
|
1614
|
+
O as createHeaders,
|
|
1615
|
+
b as createTimeoutController,
|
|
1616
|
+
gr as createUserProfile,
|
|
1617
|
+
L as debug,
|
|
1618
|
+
we as del,
|
|
1619
|
+
mr as deleteUserProfileProperty,
|
|
1620
|
+
ur as deleteUserSettings,
|
|
1621
|
+
ot as deleteWebTokenCookie,
|
|
1622
|
+
g as emitAuthenticatedEvent,
|
|
1576
1623
|
f as error,
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1624
|
+
Bt as escapeExpr,
|
|
1625
|
+
$t as expiresSoon,
|
|
1626
|
+
At as extraColumns,
|
|
1627
|
+
Vt as fetchAggregation,
|
|
1628
|
+
Gt as fetchApp,
|
|
1629
|
+
Fe as fetchAppPreLogin,
|
|
1630
|
+
Tt as fetchBulkQuery,
|
|
1631
|
+
dr as fetchChangePassword,
|
|
1632
|
+
Ht as fetchDataset,
|
|
1633
|
+
Wt as fetchDatasetList,
|
|
1634
|
+
Jt as fetchDatasets,
|
|
1635
|
+
Mt as fetchLabels,
|
|
1636
|
+
Yt as fetchPreview,
|
|
1637
|
+
Kt as fetchPreviewUrl,
|
|
1638
|
+
ae as fetchPrincipal,
|
|
1639
|
+
He as fetchPrincipalList,
|
|
1640
|
+
Je as fetchPrincipalUserid,
|
|
1641
|
+
We as fetchPrincipalUserids,
|
|
1642
|
+
Et as fetchQuery,
|
|
1643
|
+
er as fetchQueryExport,
|
|
1644
|
+
tr as fetchQueryIntent,
|
|
1645
|
+
fr as fetchSendPasswordResetEmail,
|
|
1646
|
+
rr as fetchSimilarDocuments,
|
|
1647
|
+
nr as fetchSponsoredLinks,
|
|
1648
|
+
ar as fetchSuggest,
|
|
1649
|
+
sr as fetchSuggestField,
|
|
1650
|
+
or as fetchSuggestQuery,
|
|
1651
|
+
ir as fetchTextChunks,
|
|
1652
|
+
hr as fetchUserProfile,
|
|
1653
|
+
cr as fetchUserSettings,
|
|
1654
|
+
wr as fetchVersion,
|
|
1608
1655
|
w as get,
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1656
|
+
gt as getConcepts,
|
|
1657
|
+
nt as getCsrfToken,
|
|
1658
|
+
ee as getFiltersFromURI,
|
|
1659
|
+
St as getFiltersFromUrl,
|
|
1660
|
+
Pt as getHelpIndexUrl,
|
|
1661
|
+
bt as getIdFromUrl,
|
|
1662
|
+
at as getJWToken,
|
|
1663
|
+
Nt as getMetadata,
|
|
1664
|
+
Ft as getMetadataWithValues,
|
|
1665
|
+
pe as getOffsetFromDates,
|
|
1666
|
+
vt as getQueryPageFromUrl,
|
|
1667
|
+
wt as getQueryParamsFromUrl,
|
|
1668
|
+
Ct as getQueryTabFromUrl,
|
|
1669
|
+
kt as getQueryTextFromUrl,
|
|
1670
|
+
pt as getRelativeDate,
|
|
1671
|
+
Le as getTime,
|
|
1672
|
+
W as getToken,
|
|
1673
|
+
_t as getUrlParamsFromQueryParams,
|
|
1627
1674
|
u as globalConfig,
|
|
1628
|
-
|
|
1629
|
-
|
|
1675
|
+
Oe as guid,
|
|
1676
|
+
P as handleResponse,
|
|
1630
1677
|
S as info,
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1678
|
+
Re as isArrayBuffer,
|
|
1679
|
+
kr as isAuthenticated,
|
|
1680
|
+
Pe as isBlob,
|
|
1681
|
+
ye as isDate,
|
|
1682
|
+
Ot as isExpired,
|
|
1636
1683
|
qt as isJsonable,
|
|
1637
1684
|
mt as isNotInputEvent,
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1685
|
+
F as isObject,
|
|
1686
|
+
xe as isString,
|
|
1687
|
+
Xt as labels,
|
|
1688
|
+
_r as login,
|
|
1689
|
+
Sr as logout,
|
|
1690
|
+
p as makeColumn,
|
|
1691
|
+
yt as notify,
|
|
1692
|
+
ce as openParentNodes,
|
|
1693
|
+
A as parseText,
|
|
1694
|
+
ie as parseValueAndOperatorFromItem,
|
|
1695
|
+
_e as patch,
|
|
1696
|
+
pr as patchUserProfile,
|
|
1697
|
+
lr as patchUserSettings,
|
|
1651
1698
|
l as post,
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1699
|
+
Lt as put,
|
|
1700
|
+
x as queryParamsFromUrl,
|
|
1701
|
+
ft as removeConcept,
|
|
1702
|
+
ht as removeConcepts,
|
|
1703
|
+
Dt as resolveToColumnName,
|
|
1704
|
+
G as rewriteText,
|
|
1705
|
+
Ye as saveUserSettings,
|
|
1659
1706
|
k as setGlobalConfig,
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1707
|
+
I as setToken,
|
|
1708
|
+
jt as sha512,
|
|
1709
|
+
lt as suggestionsToTreeAggregationNodes,
|
|
1710
|
+
Rt as sysLang,
|
|
1711
|
+
re as toDate,
|
|
1712
|
+
it as translateAggregationToDateOptions,
|
|
1713
|
+
Ke as tryOAuthAuthentication,
|
|
1714
|
+
Ze as trySAMLAuthentication,
|
|
1715
|
+
y as warn,
|
|
1716
|
+
Ut as withRetry
|
|
1670
1717
|
};
|