@sinequa/atomic 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -8
- package/dist/atomic.js +556 -523
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/constants.d.ts +8 -0
- package/dist/authentication/constants.d.ts.map +1 -1
- package/dist/authentication/index.d.ts +1 -1
- package/dist/authentication/index.d.ts.map +1 -1
- package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
- package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
- package/dist/authentication/session/index.d.ts +1 -0
- package/dist/authentication/session/index.d.ts.map +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/authentication/session/try-auto-authentication.d.ts +19 -0
- package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -0
- package/dist/utils/notification.d.ts +5 -0
- package/dist/utils/notification.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/get.d.ts +4 -0
- package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/atomic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function p(e) {
|
|
2
2
|
if (typeof CustomEvent > "u" || typeof dispatchEvent > "u")
|
|
3
3
|
return;
|
|
4
4
|
const t = new CustomEvent("authenticated", {
|
|
@@ -16,7 +16,7 @@ const g = {
|
|
|
16
16
|
bearer: (e) => ({ kind: "bearer", token: e }),
|
|
17
17
|
unknown: () => ({ kind: "unknown" })
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function ge(e, t) {
|
|
20
20
|
const { useCredentials: r, useSSO: n, useSAML: o } = e;
|
|
21
21
|
return o && t.autoSAMLProvider ? g.saml(t.autoSAMLProvider) : r && n ? g.unknown() : r ? g.credentials() : n ? g.sso() : t.authMode ?? g.unknown();
|
|
22
22
|
}
|
|
@@ -50,22 +50,52 @@ Object.defineProperties(l, {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
function
|
|
53
|
+
function k(e) {
|
|
54
54
|
const { useCredentials: t, useSSO: r, useSAML: n, authMode: o, ...a } = e;
|
|
55
55
|
if (Object.assign(l, a), o !== void 0) {
|
|
56
56
|
l.authMode = o;
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
(t !== void 0 || r !== void 0 || n !== void 0) && (l.authMode =
|
|
59
|
+
(t !== void 0 || r !== void 0 || n !== void 0) && (l.authMode = ge(
|
|
60
60
|
{ useCredentials: t, useSSO: r, useSAML: n },
|
|
61
61
|
l
|
|
62
62
|
));
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const H = {
|
|
65
|
+
store: {},
|
|
66
|
+
getItem(e) {
|
|
67
|
+
return this.store[e] ?? null;
|
|
68
|
+
},
|
|
69
|
+
setItem(e, t) {
|
|
70
|
+
this.store[e] = t.toString();
|
|
71
|
+
},
|
|
72
|
+
removeItem(e) {
|
|
73
|
+
delete this.store[e];
|
|
74
|
+
},
|
|
75
|
+
clear() {
|
|
76
|
+
this.store = {};
|
|
77
|
+
}
|
|
78
|
+
}, J = H;
|
|
79
|
+
function pe(e) {
|
|
80
|
+
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
81
|
+
}
|
|
82
|
+
function me(e) {
|
|
83
|
+
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
84
|
+
}
|
|
85
|
+
function W(e) {
|
|
86
|
+
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
87
|
+
}
|
|
88
|
+
function X(e, t) {
|
|
89
|
+
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
90
|
+
}
|
|
91
|
+
function L(e) {
|
|
92
|
+
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
93
|
+
}
|
|
94
|
+
const we = /.*:\(?([><=\d\-.AND ]+)\)?/;
|
|
95
|
+
function _t(e, t) {
|
|
66
96
|
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((o, a) => {
|
|
67
97
|
if (!a.value || a.value === "") return o;
|
|
68
|
-
const s =
|
|
98
|
+
const s = _e(a, e.column);
|
|
69
99
|
return o.push({
|
|
70
100
|
operator: s.operator,
|
|
71
101
|
value: s.value,
|
|
@@ -76,8 +106,8 @@ function mt(e, t) {
|
|
|
76
106
|
}), o;
|
|
77
107
|
}, []);
|
|
78
108
|
}
|
|
79
|
-
function
|
|
80
|
-
const r = t, n = e.value.match(
|
|
109
|
+
function _e(e, t) {
|
|
110
|
+
const r = t, n = e.value.match(we);
|
|
81
111
|
if (n?.[1]) {
|
|
82
112
|
const a = (n?.[1].split(" AND ")).map((s) => {
|
|
83
113
|
const c = s.indexOf(">=") !== -1 ? "gte" : "lt", i = s.substring(s.indexOf(" ") + 1);
|
|
@@ -102,20 +132,20 @@ function de(e, t) {
|
|
|
102
132
|
display: e.display
|
|
103
133
|
};
|
|
104
134
|
}
|
|
105
|
-
function
|
|
135
|
+
function kt(e, t, r) {
|
|
106
136
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
107
137
|
}
|
|
108
|
-
function
|
|
109
|
-
return e.items && (e.items = e.items.map((t) =>
|
|
138
|
+
function ke(e) {
|
|
139
|
+
return e.items && (e.items = e.items.map((t) => ke(t))), e.items && e.items.some((t) => t.$selected || t.$opened) && (e.$opened = !0), e;
|
|
110
140
|
}
|
|
111
|
-
function
|
|
141
|
+
function St(e, t) {
|
|
112
142
|
const r = [];
|
|
113
143
|
if (e.length > 0) {
|
|
114
144
|
const n = /* @__PURE__ */ new Map(), a = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), s = new RegExp("\\b" + a, "i");
|
|
115
145
|
e.forEach((c) => {
|
|
116
146
|
if (c.display.length > 1) {
|
|
117
147
|
const i = c.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), d = s.exec(i);
|
|
118
|
-
|
|
148
|
+
se(
|
|
119
149
|
r,
|
|
120
150
|
n,
|
|
121
151
|
"/",
|
|
@@ -129,11 +159,11 @@ function _t(e, t) {
|
|
|
129
159
|
}
|
|
130
160
|
return r;
|
|
131
161
|
}
|
|
132
|
-
function
|
|
162
|
+
function se(e, t, r, n, o, a, s) {
|
|
133
163
|
const c = n.indexOf("/", r.length), i = n.substring(0, c + 1);
|
|
134
164
|
let d = t.get(i);
|
|
135
165
|
if (!d) {
|
|
136
|
-
const
|
|
166
|
+
const S = i.replace(/^\/|\/$/g, "");
|
|
137
167
|
d = {
|
|
138
168
|
value: n.substring(r.length, c),
|
|
139
169
|
count: o,
|
|
@@ -141,10 +171,10 @@ function te(e, t, r, n, o, a, s) {
|
|
|
141
171
|
hasChildren: !1,
|
|
142
172
|
$level: a,
|
|
143
173
|
$opened: s >= i.length,
|
|
144
|
-
$path:
|
|
174
|
+
$path: S
|
|
145
175
|
}, t.set(i, d), e.push(d);
|
|
146
176
|
}
|
|
147
|
-
i.length < n.length && (d.hasChildren = !0,
|
|
177
|
+
i.length < n.length && (d.hasChildren = !0, se(
|
|
148
178
|
d.items,
|
|
149
179
|
t,
|
|
150
180
|
i,
|
|
@@ -154,18 +184,18 @@ function te(e, t, r, n, o, a, s) {
|
|
|
154
184
|
s
|
|
155
185
|
));
|
|
156
186
|
}
|
|
157
|
-
function
|
|
187
|
+
function bt(e, t) {
|
|
158
188
|
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
159
189
|
}
|
|
160
|
-
const
|
|
161
|
-
function
|
|
190
|
+
const Se = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, be = 2, E = 3, ve = 5, T = 6, Ce = 8, ee = 9, Re = 11, te = 12, Pe = 14, re = 15;
|
|
191
|
+
function F(e) {
|
|
162
192
|
if (!e) return [];
|
|
163
|
-
const t = [], r = e.matchAll(
|
|
193
|
+
const t = [], r = e.matchAll(Se);
|
|
164
194
|
for (let n of r)
|
|
165
|
-
n[
|
|
195
|
+
n[E] ? t.push({ type: "group", value: n[E], op: n[be] }) : n[T] ? t.push({ type: "adjacent", value: n[T], op: n[ve] }) : n[ee] ? t.push({ type: "exact", value: n[ee], op: n[Ce] }) : n[te] ? t.push({ type: "regex", value: n[te], op: n[Re] }) : n[re] && t.push({ type: "token", value: n[re], op: n[Pe] });
|
|
166
196
|
return t;
|
|
167
197
|
}
|
|
168
|
-
function
|
|
198
|
+
function Y(e) {
|
|
169
199
|
return e.map((t) => {
|
|
170
200
|
const r = t.op || "";
|
|
171
201
|
switch (t.type) {
|
|
@@ -182,28 +212,28 @@ function G(e) {
|
|
|
182
212
|
}
|
|
183
213
|
}).join(" ");
|
|
184
214
|
}
|
|
185
|
-
function
|
|
186
|
-
let n =
|
|
215
|
+
function vt(e, t, r) {
|
|
216
|
+
let n = F(e);
|
|
187
217
|
for (let o of t)
|
|
188
218
|
n.push({ type: "adjacent", value: o, op: r });
|
|
189
|
-
return
|
|
219
|
+
return Y(n);
|
|
190
220
|
}
|
|
191
|
-
function
|
|
192
|
-
const r =
|
|
193
|
-
return n !== -1 ? (r.splice(n, 1), t =
|
|
221
|
+
function Ct(e, t) {
|
|
222
|
+
const r = F(t), n = r.findIndex((o) => o.value === e);
|
|
223
|
+
return n !== -1 ? (r.splice(n, 1), t = Y(r)) : t;
|
|
194
224
|
}
|
|
195
|
-
function
|
|
196
|
-
const t =
|
|
197
|
-
return
|
|
225
|
+
function Rt(e) {
|
|
226
|
+
const t = F(e).filter((r) => r.type !== "adjacent");
|
|
227
|
+
return Y(t);
|
|
198
228
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
229
|
+
function Pt(e) {
|
|
230
|
+
return F(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
201
231
|
}
|
|
202
|
-
function
|
|
203
|
-
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: o, unit: a, isFuture: s } =
|
|
232
|
+
function yt(e, t, r) {
|
|
233
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: o, unit: a, isFuture: s } = ye(t, r);
|
|
204
234
|
return n.format(o * (s ? 1 : -1), a);
|
|
205
235
|
}
|
|
206
|
-
function
|
|
236
|
+
function ye(e, t) {
|
|
207
237
|
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), o = Math.abs(n.getTime() - r.getTime());
|
|
208
238
|
return {
|
|
209
239
|
offset: Math.floor(o / (1e3 * 60 * 60 * 24)),
|
|
@@ -211,17 +241,17 @@ function ke(e, t) {
|
|
|
211
241
|
isFuture: r > n
|
|
212
242
|
};
|
|
213
243
|
}
|
|
214
|
-
function
|
|
244
|
+
function xt(e) {
|
|
215
245
|
const t = e.target;
|
|
216
246
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
217
247
|
}
|
|
218
|
-
function
|
|
248
|
+
function Lt(e) {
|
|
219
249
|
if (e === void 0) return;
|
|
220
|
-
const { q: t, f: r, p: n, s: o, t: a, n: s, b: c } =
|
|
250
|
+
const { q: t, f: r, p: n, s: o, t: a, n: s, b: c } = $(e), [i] = e.split("?");
|
|
221
251
|
return {
|
|
222
252
|
path: i,
|
|
223
253
|
text: t,
|
|
224
|
-
filters: r ?
|
|
254
|
+
filters: r ? ie(r) : void 0,
|
|
225
255
|
page: n ? parseInt(n, 10) : void 0,
|
|
226
256
|
sort: o,
|
|
227
257
|
tab: a,
|
|
@@ -229,19 +259,19 @@ function yt(e) {
|
|
|
229
259
|
basket: c
|
|
230
260
|
};
|
|
231
261
|
}
|
|
232
|
-
function
|
|
262
|
+
function $t(e) {
|
|
233
263
|
if (!e) return "";
|
|
234
264
|
const { text: t, filters: r, page: n, sort: o, tab: a, name: s, basket: c } = e, i = {};
|
|
235
265
|
t && (i.q = t), r && (i.f = JSON.stringify(r)), n && (i.p = n.toString()), o && (i.s = o), a && (i.t = a), s && (i.n = s), c && (i.b = c);
|
|
236
266
|
const d = new URLSearchParams(i).toString();
|
|
237
267
|
return d || "";
|
|
238
268
|
}
|
|
239
|
-
function
|
|
269
|
+
function Ut(e) {
|
|
240
270
|
if (e === void 0) return [];
|
|
241
|
-
const { f: t } =
|
|
242
|
-
return
|
|
271
|
+
const { f: t } = $(e);
|
|
272
|
+
return ie(t);
|
|
243
273
|
}
|
|
244
|
-
function
|
|
274
|
+
function ie(e) {
|
|
245
275
|
const t = decodeURIComponent(e);
|
|
246
276
|
try {
|
|
247
277
|
return JSON.parse(t ?? "[]");
|
|
@@ -249,29 +279,29 @@ function re(e) {
|
|
|
249
279
|
return console.error(`Error parsing filters from URI: ${e}`), [];
|
|
250
280
|
}
|
|
251
281
|
}
|
|
252
|
-
function
|
|
282
|
+
function $(e) {
|
|
253
283
|
const t = e.split("?")[1];
|
|
254
284
|
if (t === void 0) return {};
|
|
255
285
|
const r = new URLSearchParams(t);
|
|
256
286
|
return Object.fromEntries(r);
|
|
257
287
|
}
|
|
258
|
-
function
|
|
259
|
-
const { q: t = "" } =
|
|
288
|
+
function Ot(e) {
|
|
289
|
+
const { q: t = "" } = $(e);
|
|
260
290
|
return t;
|
|
261
291
|
}
|
|
262
|
-
function
|
|
263
|
-
const { id: t } =
|
|
292
|
+
function At(e) {
|
|
293
|
+
const { id: t } = $(e);
|
|
264
294
|
return decodeURIComponent(t);
|
|
265
295
|
}
|
|
266
|
-
function
|
|
267
|
-
const { p: t = "0" } =
|
|
296
|
+
function Dt(e) {
|
|
297
|
+
const { p: t = "0" } = $(e);
|
|
268
298
|
return parseInt(t, 10);
|
|
269
299
|
}
|
|
270
|
-
function
|
|
271
|
-
const { t } =
|
|
300
|
+
function It(e) {
|
|
301
|
+
const { t } = $(e);
|
|
272
302
|
return t;
|
|
273
303
|
}
|
|
274
|
-
function
|
|
304
|
+
function Nt(e, t) {
|
|
275
305
|
if (!e)
|
|
276
306
|
return e;
|
|
277
307
|
let r = 0;
|
|
@@ -282,21 +312,21 @@ function It(e, t) {
|
|
|
282
312
|
o++;
|
|
283
313
|
e[o] === "]" && (r = o + 1);
|
|
284
314
|
}
|
|
285
|
-
const a =
|
|
315
|
+
const a = j(e, r, !1);
|
|
286
316
|
if (!a)
|
|
287
317
|
return e;
|
|
288
318
|
const s = t.charCodeAt(0), c = t.charCodeAt(1);
|
|
289
319
|
let i = a;
|
|
290
320
|
for (; i; )
|
|
291
321
|
if (s === i.lang1 && c === i.lang2) {
|
|
292
|
-
const
|
|
293
|
-
return e.substring(
|
|
322
|
+
const S = j(e, i.end + 4, !0);
|
|
323
|
+
return e.substring(S.start, S.end);
|
|
294
324
|
} else
|
|
295
|
-
i =
|
|
325
|
+
i = j(e, i.end + 4, !1);
|
|
296
326
|
const d = e.substring(a.start, a.end);
|
|
297
327
|
return d || e;
|
|
298
328
|
}
|
|
299
|
-
function
|
|
329
|
+
function j(e, t, r) {
|
|
300
330
|
for (let n = t, o = e.length - 3; n < o; n++)
|
|
301
331
|
if (e[n] === "[" && e[n + 3] === "]")
|
|
302
332
|
return {
|
|
@@ -313,11 +343,11 @@ function B(e, t, r) {
|
|
|
313
343
|
lang2: -1
|
|
314
344
|
};
|
|
315
345
|
}
|
|
316
|
-
function
|
|
346
|
+
function qt(e, t) {
|
|
317
347
|
const { useLocale: r, useLocaleAsPrefix: n, indexFile: o, path: a, folder: s } = t, c = r ? `${e}/` : null, i = n ? `${e}.${o}` : o ?? "";
|
|
318
348
|
return [a, s, `${c || ""}${i}`].filter((d) => d !== void 0).join("/");
|
|
319
349
|
}
|
|
320
|
-
function
|
|
350
|
+
function D(e) {
|
|
321
351
|
const t = new CustomEvent("notification", {
|
|
322
352
|
bubbles: !0,
|
|
323
353
|
cancelable: !1,
|
|
@@ -325,48 +355,48 @@ function O(e) {
|
|
|
325
355
|
});
|
|
326
356
|
dispatchEvent(t);
|
|
327
357
|
}
|
|
328
|
-
const
|
|
358
|
+
const Ft = {
|
|
329
359
|
success: (e, t) => {
|
|
330
|
-
|
|
360
|
+
D({
|
|
331
361
|
type: "success",
|
|
332
362
|
message: e,
|
|
333
363
|
options: t
|
|
334
364
|
});
|
|
335
365
|
},
|
|
336
366
|
info: (e, t) => {
|
|
337
|
-
|
|
367
|
+
D({
|
|
338
368
|
type: "info",
|
|
339
369
|
message: e,
|
|
340
370
|
options: t
|
|
341
371
|
});
|
|
342
372
|
},
|
|
343
373
|
warning: (e, t) => {
|
|
344
|
-
|
|
374
|
+
D({
|
|
345
375
|
type: "warning",
|
|
346
376
|
message: e,
|
|
347
377
|
options: t
|
|
348
378
|
});
|
|
349
379
|
},
|
|
350
380
|
error: (e, t) => {
|
|
351
|
-
|
|
381
|
+
D({
|
|
352
382
|
type: "error",
|
|
353
383
|
message: e,
|
|
354
384
|
options: t
|
|
355
385
|
});
|
|
356
386
|
}
|
|
357
387
|
};
|
|
358
|
-
var
|
|
359
|
-
let
|
|
388
|
+
var ce = /* @__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))(ce || {});
|
|
389
|
+
let I = {
|
|
360
390
|
level: 1,
|
|
361
391
|
enableConsoleOutput: !0
|
|
362
392
|
};
|
|
363
|
-
function
|
|
364
|
-
|
|
393
|
+
function Bt(e) {
|
|
394
|
+
I = { ...I, ...e };
|
|
365
395
|
}
|
|
366
|
-
function
|
|
367
|
-
if (e <
|
|
368
|
-
const o = `${`[${
|
|
369
|
-
if (
|
|
396
|
+
function B(e, t, r) {
|
|
397
|
+
if (e < I.level) return;
|
|
398
|
+
const o = `${`[${ce[e]}]`} ${t}`;
|
|
399
|
+
if (I.enableConsoleOutput)
|
|
370
400
|
switch (e) {
|
|
371
401
|
case 0:
|
|
372
402
|
console.debug(o, r || "");
|
|
@@ -382,48 +412,48 @@ function q(e, t, r) {
|
|
|
382
412
|
break;
|
|
383
413
|
}
|
|
384
414
|
}
|
|
385
|
-
function
|
|
386
|
-
|
|
415
|
+
function U(e, t) {
|
|
416
|
+
B(0, e, t);
|
|
387
417
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
418
|
+
function b(e, t) {
|
|
419
|
+
B(1, e, t);
|
|
390
420
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
421
|
+
function N(e, t) {
|
|
422
|
+
B(2, e, t);
|
|
393
423
|
}
|
|
394
424
|
function f(e, t) {
|
|
395
|
-
|
|
425
|
+
B(3, e, t);
|
|
396
426
|
}
|
|
397
|
-
function
|
|
398
|
-
const t =
|
|
427
|
+
function O(e) {
|
|
428
|
+
const t = Z(), r = new Headers(e);
|
|
399
429
|
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
400
430
|
const { userOverride: n, userOverrideActive: o, bearerToken: a } = l;
|
|
401
431
|
return a && r.append("Authorization", `Bearer ${a}`), n && o && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
402
432
|
}
|
|
403
|
-
class
|
|
433
|
+
class y extends Error {
|
|
404
434
|
status;
|
|
405
435
|
constructor(t, r) {
|
|
406
436
|
super(t), this.name = "ApiError", this.status = r;
|
|
407
437
|
}
|
|
408
438
|
}
|
|
409
|
-
class
|
|
439
|
+
class ne extends y {
|
|
410
440
|
constructor(t = "Server error") {
|
|
411
441
|
super(t, 500), this.name = "ServerError";
|
|
412
442
|
}
|
|
413
443
|
}
|
|
414
|
-
class
|
|
444
|
+
class xe extends y {
|
|
415
445
|
constructor(t = "Request timed out") {
|
|
416
446
|
super(t, 408), this.name = "TimeoutError";
|
|
417
447
|
}
|
|
418
448
|
}
|
|
419
|
-
class
|
|
449
|
+
class G extends y {
|
|
420
450
|
constructor(t = "Unauthorized access") {
|
|
421
451
|
super(t, 401), this.name = "UnauthorizedError";
|
|
422
452
|
}
|
|
423
453
|
}
|
|
424
|
-
async function
|
|
454
|
+
async function x(e, t = "json") {
|
|
425
455
|
const r = e.headers.get("sinequa-jwt-refresh");
|
|
426
|
-
if (r !== null &&
|
|
456
|
+
if (r !== null && q(r), e.status === 200)
|
|
427
457
|
switch (t) {
|
|
428
458
|
case "arraybuffer":
|
|
429
459
|
return await e.arrayBuffer();
|
|
@@ -441,27 +471,27 @@ async function P(e, t = "json") {
|
|
|
441
471
|
n = await e.clone().json();
|
|
442
472
|
} catch {
|
|
443
473
|
}
|
|
444
|
-
throw
|
|
474
|
+
throw N("Unauthorized access attempt with user override", {
|
|
445
475
|
endpoint: e.url,
|
|
446
476
|
error: n
|
|
447
|
-
}), new
|
|
477
|
+
}), new G(
|
|
448
478
|
n.errorMessage ?? n.message ?? "Unauthorized... User override failed."
|
|
449
479
|
);
|
|
450
480
|
}
|
|
451
|
-
return await
|
|
481
|
+
return await Q(e, 401);
|
|
452
482
|
}
|
|
453
|
-
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await
|
|
483
|
+
return e.status === 500 ? (f("Server error occurred", { endpoint: e.url }), await Q(e, 500)) : (N(`Unexpected response status: ${e.status}`, {
|
|
454
484
|
endpoint: e.url
|
|
455
|
-
}), await
|
|
485
|
+
}), await Q(e, e.status));
|
|
456
486
|
}
|
|
457
|
-
async function
|
|
487
|
+
async function Q(e, t) {
|
|
458
488
|
try {
|
|
459
489
|
const { done: r, value: n } = await e.body?.getReader().read() || {
|
|
460
490
|
done: !0,
|
|
461
491
|
value: void 0
|
|
462
492
|
};
|
|
463
493
|
if (r || !n)
|
|
464
|
-
throw t === 401 ? new
|
|
494
|
+
throw t === 401 ? new G() : t === 500 ? new ne() : new y(`Request failed with status ${t}`, t);
|
|
465
495
|
const o = JSON.parse(new TextDecoder().decode(n));
|
|
466
496
|
throw new Error(
|
|
467
497
|
o.errorMessage || o.message || `Request failed with status ${t}`,
|
|
@@ -473,45 +503,46 @@ async function M(e, t) {
|
|
|
473
503
|
}
|
|
474
504
|
);
|
|
475
505
|
} catch (r) {
|
|
476
|
-
throw r instanceof
|
|
506
|
+
throw r instanceof y ? r : t === 401 ? new G(r.message) : t === 500 ? new ne(r.message) : new y(
|
|
477
507
|
r.message ?? `Request failed with status ${t}`,
|
|
478
508
|
t
|
|
479
509
|
);
|
|
480
510
|
}
|
|
481
511
|
}
|
|
482
|
-
async function
|
|
483
|
-
const n =
|
|
484
|
-
|
|
512
|
+
async function Le(e, t, r) {
|
|
513
|
+
const n = O(r?.headers), { backendUrl: o } = l, a = t ? `?${new URLSearchParams(t)}` : "", s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
514
|
+
U(`Making DELETE request to: ${s}`);
|
|
485
515
|
try {
|
|
486
516
|
const c = await fetch(s, {
|
|
487
517
|
method: "DELETE",
|
|
488
518
|
credentials: "include",
|
|
489
519
|
headers: n
|
|
490
520
|
});
|
|
491
|
-
return
|
|
521
|
+
return x(c, r?.responseType);
|
|
492
522
|
} catch (c) {
|
|
493
523
|
throw f("Error making DELETE request:", c), c;
|
|
494
524
|
}
|
|
495
525
|
}
|
|
496
|
-
async function
|
|
497
|
-
const n =
|
|
526
|
+
async function w(e, t, r) {
|
|
527
|
+
const n = O(r?.headers), { backendUrl: o } = l, a = t ? `?${new URLSearchParams(t)}` : "";
|
|
498
528
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
499
529
|
const s = o ? `${o}/${e}${a}` : `${e}${a}`;
|
|
500
|
-
|
|
530
|
+
U(`Making GET request to: ${s}`);
|
|
501
531
|
try {
|
|
502
532
|
const c = await fetch(s, {
|
|
503
533
|
method: "GET",
|
|
504
534
|
credentials: "include",
|
|
505
535
|
headers: n,
|
|
506
|
-
signal: r?.signal
|
|
536
|
+
signal: r?.signal,
|
|
537
|
+
redirect: r?.redirect
|
|
507
538
|
});
|
|
508
|
-
return
|
|
539
|
+
return x(c, r?.responseType);
|
|
509
540
|
} catch (c) {
|
|
510
541
|
throw f("Error making GET request:", c), c;
|
|
511
542
|
}
|
|
512
543
|
}
|
|
513
|
-
async function
|
|
514
|
-
const n =
|
|
544
|
+
async function $e(e, t, r) {
|
|
545
|
+
const n = O(r?.headers);
|
|
515
546
|
n.append("content-type", "application/json");
|
|
516
547
|
const { app: o, backendUrl: a } = l, s = {
|
|
517
548
|
app: o,
|
|
@@ -520,7 +551,7 @@ async function ve(e, t, r) {
|
|
|
520
551
|
noUserOverride: !0,
|
|
521
552
|
noAutoAuthentication: !0
|
|
522
553
|
}, c = a ? `${a}/${e}` : `${e}`;
|
|
523
|
-
|
|
554
|
+
U(`Making PATCH request to: ${c}`);
|
|
524
555
|
try {
|
|
525
556
|
const i = await fetch(c, {
|
|
526
557
|
method: "PATCH",
|
|
@@ -528,13 +559,13 @@ async function ve(e, t, r) {
|
|
|
528
559
|
credentials: "include",
|
|
529
560
|
body: JSON.stringify(s)
|
|
530
561
|
});
|
|
531
|
-
return
|
|
562
|
+
return x(i, r?.responseType);
|
|
532
563
|
} catch (i) {
|
|
533
564
|
throw f("Error making PATCH request:", i), i;
|
|
534
565
|
}
|
|
535
566
|
}
|
|
536
567
|
async function u(e, t, r) {
|
|
537
|
-
const n =
|
|
568
|
+
const n = O(r?.headers), { app: o, backendUrl: a } = l;
|
|
538
569
|
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
539
570
|
const s = {
|
|
540
571
|
app: o,
|
|
@@ -545,7 +576,7 @@ async function u(e, t, r) {
|
|
|
545
576
|
};
|
|
546
577
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
547
578
|
const c = a ? `${a}/${e}` : `${e}`;
|
|
548
|
-
|
|
579
|
+
U(`Making POST request to: ${c}`);
|
|
549
580
|
try {
|
|
550
581
|
const i = await fetch(c, {
|
|
551
582
|
method: "POST",
|
|
@@ -554,20 +585,20 @@ async function u(e, t, r) {
|
|
|
554
585
|
body: JSON.stringify(s),
|
|
555
586
|
signal: r?.signal
|
|
556
587
|
});
|
|
557
|
-
return
|
|
588
|
+
return x(i, r?.responseType);
|
|
558
589
|
} catch (i) {
|
|
559
590
|
throw f("Error making POST request:", i), i;
|
|
560
591
|
}
|
|
561
592
|
}
|
|
562
|
-
async function
|
|
563
|
-
const n =
|
|
593
|
+
async function Mt(e, t, r) {
|
|
594
|
+
const n = O(r?.headers), { app: o, backendUrl: a } = l, s = {
|
|
564
595
|
app: o,
|
|
565
596
|
...t,
|
|
566
597
|
locale: t.locale || navigator.language,
|
|
567
598
|
noUserOverride: !0,
|
|
568
599
|
noAutoAuthentication: !0
|
|
569
600
|
}, c = `${a}/${e}`;
|
|
570
|
-
|
|
601
|
+
U(`Making PUT request to: ${c}`);
|
|
571
602
|
try {
|
|
572
603
|
const i = await fetch(c, {
|
|
573
604
|
method: "PUT",
|
|
@@ -575,45 +606,45 @@ async function Ft(e, t, r) {
|
|
|
575
606
|
credentials: "include",
|
|
576
607
|
body: JSON.stringify(s)
|
|
577
608
|
});
|
|
578
|
-
return
|
|
609
|
+
return x(i, r?.responseType);
|
|
579
610
|
} catch (i) {
|
|
580
611
|
throw f("Error making PUT request:", i), i;
|
|
581
612
|
}
|
|
582
613
|
}
|
|
583
|
-
function
|
|
614
|
+
function C(e) {
|
|
584
615
|
const t = new AbortController(), { signal: r } = t;
|
|
585
616
|
return e && setTimeout(() => {
|
|
586
|
-
r.aborted || t.abort(new
|
|
617
|
+
r.aborted || t.abort(new xe(`Request timed out after ${e}ms`));
|
|
587
618
|
}, e), { controller: t, signal: r };
|
|
588
619
|
}
|
|
589
|
-
function
|
|
620
|
+
function le(e) {
|
|
590
621
|
if (!e) return;
|
|
591
622
|
const t = new Date(e);
|
|
592
623
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
593
624
|
}
|
|
594
|
-
function
|
|
595
|
-
const t =
|
|
625
|
+
function jt(e) {
|
|
626
|
+
const t = le(e);
|
|
596
627
|
return !!t && t.getTime() <= Date.now();
|
|
597
628
|
}
|
|
598
|
-
function
|
|
599
|
-
const r =
|
|
629
|
+
function Qt(e, t = 7) {
|
|
630
|
+
const r = le(e);
|
|
600
631
|
if (!r) return !1;
|
|
601
632
|
const n = Date.now(), o = n + t * 24 * 60 * 60 * 1e3, a = r.getTime();
|
|
602
633
|
return a > n && a <= o;
|
|
603
634
|
}
|
|
604
|
-
async function
|
|
635
|
+
async function Vt(e, t = 0, r = 1e3) {
|
|
605
636
|
let n;
|
|
606
637
|
for (let o = 0; o <= t; o++)
|
|
607
638
|
try {
|
|
608
639
|
return await e();
|
|
609
640
|
} catch (a) {
|
|
610
|
-
if (n = a, a instanceof
|
|
641
|
+
if (n = a, a instanceof y && a.status >= 400 && a.status < 500 && a.status !== 429 || a instanceof DOMException && a.name === "AbortError")
|
|
611
642
|
throw a;
|
|
612
|
-
o < t && (
|
|
643
|
+
o < t && (N(`Retrying request (${o + 1}/${t})`, { error: a }), await new Promise((s) => setTimeout(s, r)));
|
|
613
644
|
}
|
|
614
645
|
throw n;
|
|
615
646
|
}
|
|
616
|
-
function
|
|
647
|
+
function zt(e, t, r) {
|
|
617
648
|
if (!e || !t) return;
|
|
618
649
|
if (r) {
|
|
619
650
|
const a = Object.keys(t.queries).find((i) => i === r?.toLowerCase());
|
|
@@ -625,10 +656,10 @@ function Qt(e, t, r) {
|
|
|
625
656
|
const n = t.indexes?._?.columns, o = Object.entries(n).find((a) => a[1].aliases?.includes(e));
|
|
626
657
|
if (o) return o[0];
|
|
627
658
|
}
|
|
628
|
-
var
|
|
629
|
-
const
|
|
630
|
-
var
|
|
631
|
-
function
|
|
659
|
+
var P = /* @__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))(P || {}), 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 || {}), _ = /* @__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))(_ || {});
|
|
660
|
+
const Gt = "1.0";
|
|
661
|
+
var Ue = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(Ue || {}), Oe = /* @__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))(Oe || {});
|
|
662
|
+
function Ae(e) {
|
|
632
663
|
if (!e)
|
|
633
664
|
return h.none;
|
|
634
665
|
switch (e.toLocaleLowerCase()) {
|
|
@@ -667,41 +698,41 @@ function Pe(e) {
|
|
|
667
698
|
return h.none;
|
|
668
699
|
}
|
|
669
700
|
}
|
|
670
|
-
function
|
|
701
|
+
function De(e) {
|
|
671
702
|
switch (e) {
|
|
672
703
|
case "a":
|
|
673
|
-
return
|
|
704
|
+
return _.a;
|
|
674
705
|
case "c":
|
|
675
|
-
return
|
|
706
|
+
return _.c;
|
|
676
707
|
case "d":
|
|
677
|
-
return
|
|
708
|
+
return _.d;
|
|
678
709
|
case "e":
|
|
679
|
-
return
|
|
710
|
+
return _.e;
|
|
680
711
|
case "i":
|
|
681
|
-
return
|
|
712
|
+
return _.i;
|
|
682
713
|
case "l":
|
|
683
|
-
return
|
|
714
|
+
return _.l;
|
|
684
715
|
case "n":
|
|
685
|
-
return
|
|
716
|
+
return _.n;
|
|
686
717
|
case "t":
|
|
687
|
-
return
|
|
718
|
+
return _.t;
|
|
688
719
|
case "x":
|
|
689
|
-
return
|
|
720
|
+
return _.x;
|
|
690
721
|
case "z":
|
|
691
|
-
return
|
|
722
|
+
return _.z;
|
|
692
723
|
default:
|
|
693
|
-
return
|
|
724
|
+
return _.none;
|
|
694
725
|
}
|
|
695
726
|
}
|
|
696
|
-
function
|
|
697
|
-
let t =
|
|
727
|
+
function Ie(e) {
|
|
728
|
+
let t = _.none;
|
|
698
729
|
if (e)
|
|
699
730
|
for (const r of e)
|
|
700
|
-
t |=
|
|
731
|
+
t |= De(r);
|
|
701
732
|
return t;
|
|
702
733
|
}
|
|
703
|
-
function
|
|
704
|
-
const o =
|
|
734
|
+
function m(e, t, r, n) {
|
|
735
|
+
const o = Ae(t), a = Ie(r || "");
|
|
705
736
|
return {
|
|
706
737
|
name: e,
|
|
707
738
|
type: t,
|
|
@@ -711,29 +742,29 @@ function p(e, t, r, n) {
|
|
|
711
742
|
aliases: n
|
|
712
743
|
};
|
|
713
744
|
}
|
|
714
|
-
const
|
|
715
|
-
id:
|
|
716
|
-
text:
|
|
717
|
-
documentlanguages:
|
|
718
|
-
databasealias:
|
|
719
|
-
globalrelevance:
|
|
720
|
-
matchingpartnames:
|
|
721
|
-
matchlocations:
|
|
722
|
-
matchlocationsperpartname:
|
|
745
|
+
const Ht = {
|
|
746
|
+
id: m("id", "string"),
|
|
747
|
+
text: m("text", "varchar"),
|
|
748
|
+
documentlanguages: m("documentlanguages", "csv", "ci", ["language"]),
|
|
749
|
+
databasealias: m("databasealias", "varchar"),
|
|
750
|
+
globalrelevance: m("globalrelevance", "double"),
|
|
751
|
+
matchingpartnames: m("matchingpartnames", "csv"),
|
|
752
|
+
matchlocations: m("matchlocations", "csv"),
|
|
753
|
+
matchlocationsperpartname: m("matchlocationsperpartname", "varchar"),
|
|
723
754
|
// json
|
|
724
|
-
extracts:
|
|
725
|
-
extractsperpartname:
|
|
755
|
+
extracts: m("extracts", "csv"),
|
|
756
|
+
extractsperpartname: m("extractsperpartname", "varchar"),
|
|
726
757
|
// json
|
|
727
|
-
extractslocations:
|
|
728
|
-
documentweight:
|
|
729
|
-
groupcount:
|
|
730
|
-
accesslists:
|
|
758
|
+
extractslocations: m("extractslocations", "csv"),
|
|
759
|
+
documentweight: m("documentweight", "varchar"),
|
|
760
|
+
groupcount: m("groupcount", "integer"),
|
|
761
|
+
accesslists: m("accesslists", "varchar", void 0, ["accessLists"])
|
|
731
762
|
// json
|
|
732
763
|
};
|
|
733
|
-
function
|
|
764
|
+
function ue(e) {
|
|
734
765
|
return e.filter((t) => !!t);
|
|
735
766
|
}
|
|
736
|
-
const
|
|
767
|
+
const Jt = {
|
|
737
768
|
// ── Scalar (leaf) operators ───────────────────────────────────────────────
|
|
738
769
|
/** `field = value`. */
|
|
739
770
|
eq: (e, t) => ({
|
|
@@ -815,23 +846,23 @@ const zt = {
|
|
|
815
846
|
* Combine filters with logical AND. Falsy operands are ignored; with a single
|
|
816
847
|
* effective operand the operand is returned as-is, with none `undefined`.
|
|
817
848
|
*/
|
|
818
|
-
and: (...e) =>
|
|
849
|
+
and: (...e) => oe("and", e),
|
|
819
850
|
/** Combine filters with logical OR. Same collapsing rules as {@link filter.and}. */
|
|
820
|
-
or: (...e) =>
|
|
851
|
+
or: (...e) => oe("or", e),
|
|
821
852
|
/**
|
|
822
853
|
* Negate filters. Falsy operands are ignored; returns `undefined` if nothing
|
|
823
854
|
* remains. A `not` node is always kept (even with a single operand).
|
|
824
855
|
*/
|
|
825
856
|
not: (...e) => {
|
|
826
|
-
const t =
|
|
857
|
+
const t = ue(e);
|
|
827
858
|
return t.length ? { operator: "not", filters: t } : void 0;
|
|
828
859
|
}
|
|
829
860
|
};
|
|
830
|
-
function
|
|
831
|
-
const r =
|
|
861
|
+
function oe(e, t) {
|
|
862
|
+
const r = ue(t);
|
|
832
863
|
return r.length === 0 ? void 0 : r.length === 1 ? r[0] : { operator: e, filters: r };
|
|
833
864
|
}
|
|
834
|
-
function
|
|
865
|
+
function Wt(e, t) {
|
|
835
866
|
let r = e[t];
|
|
836
867
|
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
837
868
|
if (typeof n == "string") return n.trim();
|
|
@@ -839,7 +870,7 @@ function Ht(e, t) {
|
|
|
839
870
|
return n.display.trim();
|
|
840
871
|
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
841
872
|
}
|
|
842
|
-
function
|
|
873
|
+
function Xt(e, t) {
|
|
843
874
|
let r = e[t];
|
|
844
875
|
if (r === void 0) return [];
|
|
845
876
|
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
@@ -856,35 +887,35 @@ function Jt(e, t) {
|
|
|
856
887
|
const n = String(r).trim();
|
|
857
888
|
return [{ display: n, value: n }];
|
|
858
889
|
}
|
|
859
|
-
function
|
|
890
|
+
function M(e) {
|
|
860
891
|
return e !== null && typeof e == "object";
|
|
861
892
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
893
|
+
function Ne(e) {
|
|
894
|
+
return M(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
864
895
|
}
|
|
865
|
-
function
|
|
866
|
-
return
|
|
896
|
+
function qe(e) {
|
|
897
|
+
return M(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
867
898
|
}
|
|
868
|
-
function
|
|
899
|
+
function Fe(e) {
|
|
869
900
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
870
901
|
}
|
|
871
|
-
function
|
|
902
|
+
function Be(e) {
|
|
872
903
|
return typeof e == "string";
|
|
873
904
|
}
|
|
874
|
-
function
|
|
875
|
-
return (
|
|
905
|
+
function Yt(e) {
|
|
906
|
+
return (M(e) || Array.isArray(e)) && !Ne(e) && !qe(e) && !Be(e);
|
|
876
907
|
}
|
|
877
|
-
function
|
|
908
|
+
function Me(e) {
|
|
878
909
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
879
910
|
}
|
|
880
|
-
function
|
|
911
|
+
function je(e = !0) {
|
|
881
912
|
let t = Date.now();
|
|
882
913
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
883
914
|
const o = (t + Math.random() * 16) % 16 | 0;
|
|
884
915
|
return t = Math.floor(t / 16), (n === "x" ? o : o & 3 | 8).toString(16);
|
|
885
916
|
});
|
|
886
917
|
}
|
|
887
|
-
function
|
|
918
|
+
function Kt(e) {
|
|
888
919
|
if (!e)
|
|
889
920
|
return "``";
|
|
890
921
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
@@ -896,36 +927,36 @@ function Xt(e) {
|
|
|
896
927
|
}
|
|
897
928
|
return t.push("`"), t.join("");
|
|
898
929
|
}
|
|
899
|
-
function
|
|
930
|
+
function Zt(e) {
|
|
900
931
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
901
932
|
try {
|
|
902
933
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then(
|
|
903
934
|
(t) => Array.prototype.map.call(new Uint8Array(t), (r) => `00${r.toString(16)}`.slice(-2)).join("")
|
|
904
|
-
).catch(() => Promise.resolve(
|
|
935
|
+
).catch(() => Promise.resolve(V(e)));
|
|
905
936
|
} catch {
|
|
906
|
-
return Promise.resolve(
|
|
937
|
+
return Promise.resolve(V(e));
|
|
907
938
|
}
|
|
908
|
-
return Promise.resolve(
|
|
939
|
+
return Promise.resolve(V(e));
|
|
909
940
|
}
|
|
910
|
-
function
|
|
941
|
+
function V(e) {
|
|
911
942
|
let n = 2166136261;
|
|
912
|
-
for (let
|
|
913
|
-
n ^= e.charCodeAt(
|
|
943
|
+
for (let S = 0; S < e.length; S++)
|
|
944
|
+
n ^= e.charCodeAt(S), n = n * 16777619 >>> 0;
|
|
914
945
|
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"), c = ((n ^ 3435973836) >>> 0).toString(16).padStart(8, "0"), i = o + a + s + c;
|
|
915
946
|
return (i + i + i + i).substring(0, 128);
|
|
916
947
|
}
|
|
917
|
-
let
|
|
918
|
-
function
|
|
919
|
-
let r =
|
|
920
|
-
r && (
|
|
948
|
+
let z, de;
|
|
949
|
+
function A(e, t = !0) {
|
|
950
|
+
let r = Qe(e.$auditRecord);
|
|
951
|
+
r && (Ve(r), t && ze(r)), e.$auditRecord = r;
|
|
921
952
|
}
|
|
922
|
-
function
|
|
953
|
+
function Qe(e) {
|
|
923
954
|
if (!e)
|
|
924
955
|
return;
|
|
925
956
|
let t;
|
|
926
957
|
if (Array.isArray(e))
|
|
927
958
|
t = e;
|
|
928
|
-
else if (
|
|
959
|
+
else if (M(e)) {
|
|
929
960
|
const r = e;
|
|
930
961
|
if (r.auditEvents || r.mlAuditEvents)
|
|
931
962
|
return r;
|
|
@@ -933,42 +964,42 @@ function Ae(e) {
|
|
|
933
964
|
}
|
|
934
965
|
return { auditEvents: t };
|
|
935
966
|
}
|
|
936
|
-
function
|
|
937
|
-
const t =
|
|
967
|
+
function Ve(e) {
|
|
968
|
+
const t = Ge();
|
|
938
969
|
return e.auditEvents?.forEach((r) => {
|
|
939
970
|
r.detail || (r.detail = {}), r.detail.sessionid = t;
|
|
940
971
|
}), e;
|
|
941
972
|
}
|
|
942
|
-
function
|
|
973
|
+
function ze(e) {
|
|
943
974
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
944
975
|
return e?.auditEvents?.forEach((r) => {
|
|
945
976
|
r.detail || (r.detail = {}), r.detail.url = t;
|
|
946
977
|
}), e;
|
|
947
978
|
}
|
|
948
|
-
function
|
|
949
|
-
return (!
|
|
979
|
+
function Ge() {
|
|
980
|
+
return (!z || He()) && (z = je()), de = /* @__PURE__ */ new Date(), z;
|
|
950
981
|
}
|
|
951
|
-
function
|
|
952
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
982
|
+
function He() {
|
|
983
|
+
return (/* @__PURE__ */ new Date()).getTime() - de.getTime() > 600 * 1e3;
|
|
953
984
|
}
|
|
954
|
-
async function
|
|
985
|
+
async function Je(e, t = !0) {
|
|
955
986
|
const r = {
|
|
956
|
-
event:
|
|
987
|
+
event: P.None,
|
|
957
988
|
$auditRecord: e
|
|
958
989
|
};
|
|
959
|
-
return
|
|
990
|
+
return A(r, t), u("api/v1/audit.notify", r);
|
|
960
991
|
}
|
|
961
|
-
const
|
|
962
|
-
async function
|
|
992
|
+
const Et = { notify: Je };
|
|
993
|
+
async function Tt(e, t, r) {
|
|
963
994
|
const n = e.items?.length || 0, o = 10, a = {
|
|
964
995
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: o } } },
|
|
965
996
|
$auditRecord: { auditEvents: [r] }
|
|
966
997
|
};
|
|
967
|
-
|
|
968
|
-
const s = await u("api/v1/query", a), c = await
|
|
998
|
+
A(a);
|
|
999
|
+
const s = await u("api/v1/query", a), c = await x(s), { aggregations: i } = c, d = i[0];
|
|
969
1000
|
return d.$hasMore = d.items.length > o, d.items = [...e.items, ...d.items], Promise.resolve(d);
|
|
970
1001
|
}
|
|
971
|
-
function
|
|
1002
|
+
function We(e, t) {
|
|
972
1003
|
if (e.authMode?.kind === "credentials") return g.credentials();
|
|
973
1004
|
if (e.bearerToken) return g.bearer(e.bearerToken);
|
|
974
1005
|
const r = e.autoOAuthProvider || t?.autoOAuthProvider;
|
|
@@ -976,18 +1007,18 @@ function je(e, t) {
|
|
|
976
1007
|
const n = e.autoSAMLProvider || t?.autoSAMLProvider;
|
|
977
1008
|
return n ? g.saml(n) : g.unknown();
|
|
978
1009
|
}
|
|
979
|
-
async function
|
|
1010
|
+
async function er(e) {
|
|
980
1011
|
const t = e || l.app, r = new URLSearchParams({ app: t || "" });
|
|
981
|
-
return
|
|
1012
|
+
return w("api/v1/app", r);
|
|
982
1013
|
}
|
|
983
|
-
async function
|
|
1014
|
+
async function Xe() {
|
|
984
1015
|
const { app: e } = l, t = new URLSearchParams({
|
|
985
1016
|
app: e || "",
|
|
986
1017
|
preLogin: "true"
|
|
987
1018
|
});
|
|
988
|
-
return
|
|
1019
|
+
return w("api/v1/app", t);
|
|
989
1020
|
}
|
|
990
|
-
function
|
|
1021
|
+
function Ye() {
|
|
991
1022
|
let { backendUrl: e, app: t } = l;
|
|
992
1023
|
if (typeof window < "u") {
|
|
993
1024
|
if (e || (e = window.location.origin), !t) {
|
|
@@ -996,16 +1027,16 @@ function Ve() {
|
|
|
996
1027
|
);
|
|
997
1028
|
r && (t = r[1]);
|
|
998
1029
|
}
|
|
999
|
-
|
|
1030
|
+
k({ backendUrl: e, app: t });
|
|
1000
1031
|
}
|
|
1001
|
-
return l.authMode?.kind === "credentials" ? (
|
|
1032
|
+
return l.authMode?.kind === "credentials" ? (k({
|
|
1002
1033
|
authMode: g.credentials(),
|
|
1003
1034
|
autoOAuthProvider: void 0,
|
|
1004
1035
|
autoSAMLProvider: void 0,
|
|
1005
1036
|
bearerToken: void 0
|
|
1006
|
-
}), Promise.resolve({})) :
|
|
1007
|
-
const n =
|
|
1008
|
-
return
|
|
1037
|
+
}), Promise.resolve({})) : Xe().then((r) => {
|
|
1038
|
+
const n = We(l, r);
|
|
1039
|
+
return k({
|
|
1009
1040
|
authMode: n,
|
|
1010
1041
|
// Persist the resolved providers as inputs so login()/redirect helpers can read them.
|
|
1011
1042
|
autoOAuthProvider: l.autoOAuthProvider || r.autoOAuthProvider,
|
|
@@ -1015,21 +1046,21 @@ function Ve() {
|
|
|
1015
1046
|
throw f("atomic:fetchAppPreLogin error", r), r;
|
|
1016
1047
|
});
|
|
1017
1048
|
}
|
|
1018
|
-
const
|
|
1019
|
-
async function
|
|
1049
|
+
const tr = Ye;
|
|
1050
|
+
async function rr(e, t, r = {}) {
|
|
1020
1051
|
const n = `api/v1/search.dataset/${e}/${t}`, o = await u(n, { parameters: r }), a = t[0].toLowerCase() + t.slice(1), s = o.datasets[a];
|
|
1021
1052
|
if ("errorCode" in s && "errorMessage" in s)
|
|
1022
1053
|
throw new Error(s.errorMessage);
|
|
1023
1054
|
return s;
|
|
1024
1055
|
}
|
|
1025
|
-
async function
|
|
1056
|
+
async function nr(e, t) {
|
|
1026
1057
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: o = [] } = t;
|
|
1027
1058
|
return (await u(r, { parameters: n, datasets: o })).datasets;
|
|
1028
1059
|
}
|
|
1029
|
-
async function
|
|
1030
|
-
return await
|
|
1060
|
+
async function or(e) {
|
|
1061
|
+
return await w(`api/v1/search.dataset/${e}`);
|
|
1031
1062
|
}
|
|
1032
|
-
async function
|
|
1063
|
+
async function ar(e, t = !0, r) {
|
|
1033
1064
|
try {
|
|
1034
1065
|
return (await u("api/v1/labels", {
|
|
1035
1066
|
action: "list",
|
|
@@ -1042,18 +1073,18 @@ async function nr(e, t = !0, r) {
|
|
|
1042
1073
|
throw f("Error in fetchLabels", n), n;
|
|
1043
1074
|
}
|
|
1044
1075
|
}
|
|
1045
|
-
async function
|
|
1076
|
+
async function Ke() {
|
|
1046
1077
|
try {
|
|
1047
1078
|
const { app: e = "" } = l, t = new URLSearchParams({
|
|
1048
1079
|
app: e,
|
|
1049
1080
|
action: "getUserRights"
|
|
1050
1081
|
});
|
|
1051
|
-
return
|
|
1082
|
+
return w("api/v1/labels", t);
|
|
1052
1083
|
} catch (e) {
|
|
1053
1084
|
throw f("Error in getUserRights", e), e;
|
|
1054
1085
|
}
|
|
1055
1086
|
}
|
|
1056
|
-
async function
|
|
1087
|
+
async function Ze(e, t, r = !0) {
|
|
1057
1088
|
try {
|
|
1058
1089
|
const n = {
|
|
1059
1090
|
action: "add",
|
|
@@ -1063,7 +1094,7 @@ async function ze(e, t, r = !0) {
|
|
|
1063
1094
|
$auditRecord: {
|
|
1064
1095
|
auditEvents: [
|
|
1065
1096
|
{
|
|
1066
|
-
type:
|
|
1097
|
+
type: P.Label_AddDoc,
|
|
1067
1098
|
detail: {
|
|
1068
1099
|
public: r,
|
|
1069
1100
|
label: e ? e.toString() : null,
|
|
@@ -1084,7 +1115,7 @@ async function ze(e, t, r = !0) {
|
|
|
1084
1115
|
throw f("Error in add", n), n;
|
|
1085
1116
|
}
|
|
1086
1117
|
}
|
|
1087
|
-
async function
|
|
1118
|
+
async function Ee(e, t, r = !0) {
|
|
1088
1119
|
try {
|
|
1089
1120
|
const n = {
|
|
1090
1121
|
action: "remove",
|
|
@@ -1094,7 +1125,7 @@ async function He(e, t, r = !0) {
|
|
|
1094
1125
|
$auditRecord: {
|
|
1095
1126
|
auditEvents: [
|
|
1096
1127
|
{
|
|
1097
|
-
type:
|
|
1128
|
+
type: P.Label_RemoveDoc,
|
|
1098
1129
|
detail: {
|
|
1099
1130
|
public: r,
|
|
1100
1131
|
label: e ? e.toString() : null,
|
|
@@ -1115,7 +1146,7 @@ async function He(e, t, r = !0) {
|
|
|
1115
1146
|
throw f("Error in remove", n), n;
|
|
1116
1147
|
}
|
|
1117
1148
|
}
|
|
1118
|
-
async function
|
|
1149
|
+
async function Te(e, t, r = !0) {
|
|
1119
1150
|
try {
|
|
1120
1151
|
const n = {
|
|
1121
1152
|
action: "rename",
|
|
@@ -1123,7 +1154,7 @@ async function Je(e, t, r = !0) {
|
|
|
1123
1154
|
newLabel: t,
|
|
1124
1155
|
public: r,
|
|
1125
1156
|
auditEvents: {
|
|
1126
|
-
type:
|
|
1157
|
+
type: P.Label_Rename,
|
|
1127
1158
|
detail: {
|
|
1128
1159
|
public: r,
|
|
1129
1160
|
oldlabel: e ? e.toString() : null,
|
|
@@ -1136,14 +1167,14 @@ async function Je(e, t, r = !0) {
|
|
|
1136
1167
|
throw f("Error in rename", n), n;
|
|
1137
1168
|
}
|
|
1138
1169
|
}
|
|
1139
|
-
async function
|
|
1170
|
+
async function et(e, t = !0) {
|
|
1140
1171
|
try {
|
|
1141
1172
|
const r = {
|
|
1142
1173
|
action: "delete",
|
|
1143
1174
|
labels: e,
|
|
1144
1175
|
public: t,
|
|
1145
1176
|
auditEvents: {
|
|
1146
|
-
type:
|
|
1177
|
+
type: P.Label_Delete,
|
|
1147
1178
|
detail: {
|
|
1148
1179
|
public: t,
|
|
1149
1180
|
label: e ? e.toString() : null
|
|
@@ -1155,7 +1186,7 @@ async function We(e, t = !0) {
|
|
|
1155
1186
|
throw f("Error in deleteLabels", r), r;
|
|
1156
1187
|
}
|
|
1157
1188
|
}
|
|
1158
|
-
async function
|
|
1189
|
+
async function tt(e, t, r = !0) {
|
|
1159
1190
|
try {
|
|
1160
1191
|
const n = {
|
|
1161
1192
|
action: "bulkAdd",
|
|
@@ -1163,7 +1194,7 @@ async function Xe(e, t, r = !0) {
|
|
|
1163
1194
|
query: t,
|
|
1164
1195
|
public: r,
|
|
1165
1196
|
auditEvents: {
|
|
1166
|
-
type:
|
|
1197
|
+
type: P.Label_Add,
|
|
1167
1198
|
detail: {
|
|
1168
1199
|
public: r,
|
|
1169
1200
|
label: e ? e.toString() : null,
|
|
@@ -1176,7 +1207,7 @@ async function Xe(e, t, r = !0) {
|
|
|
1176
1207
|
throw f("Error in bulkAdd", n), n;
|
|
1177
1208
|
}
|
|
1178
1209
|
}
|
|
1179
|
-
async function
|
|
1210
|
+
async function rt(e, t, r = !0) {
|
|
1180
1211
|
try {
|
|
1181
1212
|
const n = {
|
|
1182
1213
|
action: "bulkRemove",
|
|
@@ -1184,7 +1215,7 @@ async function Ye(e, t, r = !0) {
|
|
|
1184
1215
|
query: t,
|
|
1185
1216
|
public: r,
|
|
1186
1217
|
auditEvents: {
|
|
1187
|
-
type:
|
|
1218
|
+
type: P.Label_Delete,
|
|
1188
1219
|
detail: {
|
|
1189
1220
|
public: r,
|
|
1190
1221
|
label: e ? e.toString() : null,
|
|
@@ -1197,16 +1228,16 @@ async function Ye(e, t, r = !0) {
|
|
|
1197
1228
|
throw f("Error in bulkRemove", n), n;
|
|
1198
1229
|
}
|
|
1199
1230
|
}
|
|
1200
|
-
const
|
|
1201
|
-
getUserRights:
|
|
1202
|
-
add:
|
|
1203
|
-
remove:
|
|
1204
|
-
rename:
|
|
1205
|
-
delete:
|
|
1206
|
-
bulkAdd:
|
|
1207
|
-
bulkRemove:
|
|
1231
|
+
const sr = {
|
|
1232
|
+
getUserRights: Ke,
|
|
1233
|
+
add: Ze,
|
|
1234
|
+
remove: Ee,
|
|
1235
|
+
rename: Te,
|
|
1236
|
+
delete: et,
|
|
1237
|
+
bulkAdd: tt,
|
|
1238
|
+
bulkRemove: rt
|
|
1208
1239
|
};
|
|
1209
|
-
async function
|
|
1240
|
+
async function ir(e, t) {
|
|
1210
1241
|
if (typeof window > "u")
|
|
1211
1242
|
return u("api/v1/preview", {
|
|
1212
1243
|
action: "get",
|
|
@@ -1221,7 +1252,7 @@ async function ar(e, t) {
|
|
|
1221
1252
|
browserUrl: r
|
|
1222
1253
|
});
|
|
1223
1254
|
}
|
|
1224
|
-
async function
|
|
1255
|
+
async function cr(e) {
|
|
1225
1256
|
const t = new Headers();
|
|
1226
1257
|
t.append("content-type", "text");
|
|
1227
1258
|
const r = await fetch(
|
|
@@ -1231,25 +1262,25 @@ async function sr(e) {
|
|
|
1231
1262
|
headers: t
|
|
1232
1263
|
}
|
|
1233
1264
|
);
|
|
1234
|
-
|
|
1265
|
+
x(r);
|
|
1235
1266
|
}
|
|
1236
|
-
async function
|
|
1267
|
+
async function nt() {
|
|
1237
1268
|
const e = new URLSearchParams({
|
|
1238
1269
|
action: "get",
|
|
1239
1270
|
noAutoAuthentication: "true"
|
|
1240
1271
|
});
|
|
1241
|
-
return
|
|
1272
|
+
return w("api/v1/principal", e);
|
|
1242
1273
|
}
|
|
1243
|
-
async function
|
|
1274
|
+
async function ot(e) {
|
|
1244
1275
|
const t = {
|
|
1245
1276
|
noAutoAuthentication: "true",
|
|
1246
1277
|
...e
|
|
1247
1278
|
}, r = new URLSearchParams();
|
|
1248
1279
|
return Object.entries(t).forEach(([n, o]) => {
|
|
1249
1280
|
o !== void 0 && r.append(n, String(o));
|
|
1250
|
-
}),
|
|
1281
|
+
}), w("api/v1/principal/list", r);
|
|
1251
1282
|
}
|
|
1252
|
-
async function
|
|
1283
|
+
async function at(e) {
|
|
1253
1284
|
if (!e)
|
|
1254
1285
|
return Promise.reject(new Error("userid is required"));
|
|
1255
1286
|
const t = new URLSearchParams({
|
|
@@ -1257,38 +1288,38 @@ async function Ee(e) {
|
|
|
1257
1288
|
noAutoAuthentication: "true",
|
|
1258
1289
|
userid: e
|
|
1259
1290
|
});
|
|
1260
|
-
return
|
|
1291
|
+
return w("api/v1/principal", t);
|
|
1261
1292
|
}
|
|
1262
|
-
async function
|
|
1293
|
+
async function st(e) {
|
|
1263
1294
|
if (e.length === 0)
|
|
1264
1295
|
return Promise.reject(new Error("userids is required"));
|
|
1265
1296
|
const t = new URLSearchParams({
|
|
1266
1297
|
noAutoAuthentication: "true",
|
|
1267
1298
|
userids: [...e].join(",")
|
|
1268
1299
|
});
|
|
1269
|
-
return
|
|
1300
|
+
return w("api/v1/principal/userids", t);
|
|
1270
1301
|
}
|
|
1271
|
-
const
|
|
1302
|
+
const lr = {
|
|
1272
1303
|
principal: {
|
|
1273
|
-
get:
|
|
1274
|
-
list:
|
|
1275
|
-
userid:
|
|
1276
|
-
userids:
|
|
1304
|
+
get: nt,
|
|
1305
|
+
list: ot,
|
|
1306
|
+
userid: at,
|
|
1307
|
+
userids: st
|
|
1277
1308
|
}
|
|
1278
|
-
},
|
|
1279
|
-
async function
|
|
1309
|
+
}, fe = 11;
|
|
1310
|
+
async function ur(e, t, r) {
|
|
1280
1311
|
const o = await u("api/v1/query", {
|
|
1281
1312
|
query: e,
|
|
1282
1313
|
$auditRecord: t,
|
|
1283
1314
|
queryIntentData: r
|
|
1284
1315
|
});
|
|
1285
1316
|
o.aggregations.forEach((s) => {
|
|
1286
|
-
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length ===
|
|
1317
|
+
s.$hasMore = !1, !s.isDistribution && !s.isTree && s.items && (s.$hasMore = s.items.length === fe), s.isTree && s.items && K(s);
|
|
1287
1318
|
}), o.records?.map((s) => Object.assign(s, { value: s.title, type: "default" }));
|
|
1288
1319
|
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 };
|
|
1289
1320
|
return Promise.resolve(a);
|
|
1290
1321
|
}
|
|
1291
|
-
async function
|
|
1322
|
+
async function dr(e, t, r) {
|
|
1292
1323
|
const { app: n = "" } = l, o = {
|
|
1293
1324
|
methods: [],
|
|
1294
1325
|
mode: t,
|
|
@@ -1304,20 +1335,20 @@ async function lr(e, t, r) {
|
|
|
1304
1335
|
const a = await u("api/v1/multi", o);
|
|
1305
1336
|
a.results.forEach((c) => {
|
|
1306
1337
|
c.aggregations.forEach((i) => {
|
|
1307
|
-
i.$hasMore = !1, !i.isDistribution && !i.isTree && i.items && (i.$hasMore = i.items.length ===
|
|
1338
|
+
i.$hasMore = !1, !i.isDistribution && !i.isTree && i.items && (i.$hasMore = i.items.length === fe), i.isTree && K(i);
|
|
1308
1339
|
});
|
|
1309
1340
|
}), a.results.forEach((c) => c.records?.map((i) => Object.assign(i, { value: i.title, type: "default" })));
|
|
1310
1341
|
const s = a.results.map((c) => ({ ...c, nextPage: c.page < Math.ceil(c.rowCount / c.pageSize) ? c.page + 1 : void 0, previousPage: c.page > 1 ? c.page - 1 : void 0 }));
|
|
1311
1342
|
return Promise.resolve(s);
|
|
1312
1343
|
}
|
|
1313
|
-
function
|
|
1344
|
+
function K(e, t = "", r = 0) {
|
|
1314
1345
|
let n = [];
|
|
1315
1346
|
return e.items && e.items.forEach((o) => {
|
|
1316
1347
|
let a = t ? `${t}/${o.value}` : o.value, s = r + 1;
|
|
1317
|
-
n.push({ path: a, level: s }), o.$path = a, o.$level = s, o.hasChildren ? n = n.concat(
|
|
1348
|
+
n.push({ path: a, level: s }), o.$path = a, o.$level = s, o.hasChildren ? n = n.concat(K(o, a, s)) : o.hasChildren = !1;
|
|
1318
1349
|
}), n;
|
|
1319
1350
|
}
|
|
1320
|
-
async function
|
|
1351
|
+
async function fr({ model: e, appName: t, query: r, article: n }) {
|
|
1321
1352
|
const { webservice: o, format: a, maxcount: s, exportedColumns: c, export: i } = e, d = {
|
|
1322
1353
|
app: t,
|
|
1323
1354
|
webservice: o,
|
|
@@ -1335,14 +1366,14 @@ async function ur({ model: e, appName: t, query: r, article: n }) {
|
|
|
1335
1366
|
}]
|
|
1336
1367
|
}
|
|
1337
1368
|
};
|
|
1338
|
-
return
|
|
1369
|
+
return A(d), await u("api/v1/search.queryexport", d, { responseType: "blob" });
|
|
1339
1370
|
}
|
|
1340
|
-
async function
|
|
1371
|
+
async function hr(e) {
|
|
1341
1372
|
return (await u("api/v1/queryintent", {
|
|
1342
1373
|
query: e
|
|
1343
1374
|
}))?.intents;
|
|
1344
1375
|
}
|
|
1345
|
-
async function
|
|
1376
|
+
async function gr(e, t, r) {
|
|
1346
1377
|
return (await u(
|
|
1347
1378
|
"api/v1/similardocuments",
|
|
1348
1379
|
{
|
|
@@ -1354,17 +1385,17 @@ async function fr(e, t, r) {
|
|
|
1354
1385
|
{ signal: r }
|
|
1355
1386
|
)).data;
|
|
1356
1387
|
}
|
|
1357
|
-
async function
|
|
1388
|
+
async function pr(e, t) {
|
|
1358
1389
|
return (await u("api/v1/query.links", {
|
|
1359
1390
|
webservice: e,
|
|
1360
1391
|
query: t
|
|
1361
1392
|
}))?.links?.map((o) => ({ ...o, query: t }));
|
|
1362
1393
|
}
|
|
1363
|
-
function
|
|
1394
|
+
function it(e, t) {
|
|
1364
1395
|
if (typeof e == "number")
|
|
1365
1396
|
return `${e}`;
|
|
1366
|
-
if (
|
|
1367
|
-
return
|
|
1397
|
+
if (Fe(e))
|
|
1398
|
+
return ct(e);
|
|
1368
1399
|
if (typeof e == "boolean")
|
|
1369
1400
|
return e ? "true" : "false";
|
|
1370
1401
|
if (e === null)
|
|
@@ -1377,11 +1408,11 @@ function et(e, t) {
|
|
|
1377
1408
|
}
|
|
1378
1409
|
return e;
|
|
1379
1410
|
}
|
|
1380
|
-
function
|
|
1411
|
+
function ct(e) {
|
|
1381
1412
|
if (!e)
|
|
1382
1413
|
return "";
|
|
1383
1414
|
try {
|
|
1384
|
-
if (
|
|
1415
|
+
if (Me(e) === 0)
|
|
1385
1416
|
return new Intl.DateTimeFormat("en-CA", {
|
|
1386
1417
|
year: "numeric",
|
|
1387
1418
|
month: "2-digit",
|
|
@@ -1400,7 +1431,7 @@ function tt(e) {
|
|
|
1400
1431
|
return "Invalid date";
|
|
1401
1432
|
}
|
|
1402
1433
|
}
|
|
1403
|
-
async function
|
|
1434
|
+
async function mr(e, t, r, n, o) {
|
|
1404
1435
|
const { app: a } = l, s = {
|
|
1405
1436
|
app: a || "",
|
|
1406
1437
|
suggestQuery: e,
|
|
@@ -1418,7 +1449,7 @@ async function gr(e, t, r, n, o) {
|
|
|
1418
1449
|
throw console.error("Error fetching suggestions:", c), c;
|
|
1419
1450
|
}
|
|
1420
1451
|
}
|
|
1421
|
-
async function
|
|
1452
|
+
async function wr(e, t, r, n) {
|
|
1422
1453
|
const { app: o } = l;
|
|
1423
1454
|
return (await u(
|
|
1424
1455
|
"api/v1/suggestquery",
|
|
@@ -1431,7 +1462,7 @@ async function pr(e, t, r, n) {
|
|
|
1431
1462
|
}
|
|
1432
1463
|
)).suggests;
|
|
1433
1464
|
}
|
|
1434
|
-
async function
|
|
1465
|
+
async function _r(e, t, r) {
|
|
1435
1466
|
if (!t) return Promise.resolve([]);
|
|
1436
1467
|
const { app: n } = l, a = await u(
|
|
1437
1468
|
"api/v1/suggestfield",
|
|
@@ -1443,10 +1474,10 @@ async function mr(e, t, r) {
|
|
|
1443
1474
|
}
|
|
1444
1475
|
);
|
|
1445
1476
|
return a.suggests.forEach((s) => {
|
|
1446
|
-
s.display =
|
|
1477
|
+
s.display = it(s.display);
|
|
1447
1478
|
}), a.suggests;
|
|
1448
1479
|
}
|
|
1449
|
-
async function
|
|
1480
|
+
async function kr(e, t, r, n, o, a) {
|
|
1450
1481
|
return u("api/v1/doc.textchunks", {
|
|
1451
1482
|
id: e,
|
|
1452
1483
|
textChunks: t,
|
|
@@ -1456,73 +1487,73 @@ async function wr(e, t, r, n, o, a) {
|
|
|
1456
1487
|
rightSentencesCount: a
|
|
1457
1488
|
});
|
|
1458
1489
|
}
|
|
1459
|
-
async function
|
|
1490
|
+
async function Sr() {
|
|
1460
1491
|
const { app: e } = l, t = new URLSearchParams({
|
|
1461
1492
|
app: e || "",
|
|
1462
1493
|
action: "load"
|
|
1463
1494
|
});
|
|
1464
|
-
return
|
|
1495
|
+
return w("api/v1/usersettings", t);
|
|
1465
1496
|
}
|
|
1466
|
-
async function
|
|
1497
|
+
async function lt(e, t) {
|
|
1467
1498
|
const r = {
|
|
1468
1499
|
action: "save",
|
|
1469
1500
|
userSettings: e,
|
|
1470
1501
|
$auditRecord: { auditEvents: [t] }
|
|
1471
1502
|
};
|
|
1472
|
-
return
|
|
1503
|
+
return A(r), u("api/v1/usersettings", r);
|
|
1473
1504
|
}
|
|
1474
|
-
async function
|
|
1505
|
+
async function br(e, t) {
|
|
1475
1506
|
const n = {
|
|
1476
1507
|
action: "patch",
|
|
1477
1508
|
userSettings: e,
|
|
1478
1509
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1479
1510
|
};
|
|
1480
|
-
return
|
|
1511
|
+
return A(n), u("api/v1/usersettings", n);
|
|
1481
1512
|
}
|
|
1482
|
-
async function
|
|
1483
|
-
return
|
|
1513
|
+
async function vr() {
|
|
1514
|
+
return lt({}, { type: "UserSettings_Reset" });
|
|
1484
1515
|
}
|
|
1485
|
-
async function
|
|
1516
|
+
async function Cr(e, t) {
|
|
1486
1517
|
return u("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1487
1518
|
}
|
|
1488
|
-
async function
|
|
1519
|
+
async function Rr(e) {
|
|
1489
1520
|
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1490
1521
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1491
1522
|
userName: e
|
|
1492
1523
|
};
|
|
1493
1524
|
return u(t, n);
|
|
1494
1525
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
return await
|
|
1526
|
+
async function Pr(e) {
|
|
1527
|
+
return await w(`api/v2/user-profile/${e}`);
|
|
1497
1528
|
}
|
|
1498
|
-
async function
|
|
1529
|
+
async function yr(e) {
|
|
1499
1530
|
return await u("api/v2/user-profile", e);
|
|
1500
1531
|
}
|
|
1501
|
-
async function
|
|
1502
|
-
return await
|
|
1532
|
+
async function xr(e, t, r) {
|
|
1533
|
+
return await $e(
|
|
1503
1534
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`,
|
|
1504
1535
|
e
|
|
1505
1536
|
);
|
|
1506
1537
|
}
|
|
1507
|
-
async function
|
|
1538
|
+
async function Lr(e, t, r) {
|
|
1508
1539
|
try {
|
|
1509
|
-
return (await
|
|
1540
|
+
return (await Le(
|
|
1510
1541
|
`api/v2/user-profile/${e.data?.id}/${t}/${r}`
|
|
1511
1542
|
)).success === !0;
|
|
1512
1543
|
} catch {
|
|
1513
1544
|
return !1;
|
|
1514
1545
|
}
|
|
1515
1546
|
}
|
|
1516
|
-
async function
|
|
1517
|
-
return await
|
|
1547
|
+
async function $r() {
|
|
1548
|
+
return await w("api/v2/version");
|
|
1518
1549
|
}
|
|
1519
|
-
const
|
|
1550
|
+
const R = 1e4, v = "sinequa-auth-redirect-attempt", ut = async () => {
|
|
1520
1551
|
const { autoOAuthProvider: e } = l;
|
|
1521
1552
|
if (!e)
|
|
1522
1553
|
throw new Error("autoOAuthProvider is not configured in globalConfig");
|
|
1523
1554
|
if (typeof window > "u")
|
|
1524
1555
|
try {
|
|
1525
|
-
const { signal: r } =
|
|
1556
|
+
const { signal: r } = C(R);
|
|
1526
1557
|
return await u(
|
|
1527
1558
|
"security.oauth",
|
|
1528
1559
|
{
|
|
@@ -1543,26 +1574,32 @@ const v = 1e4, nt = async () => {
|
|
|
1543
1574
|
originalUrl: window.location.href
|
|
1544
1575
|
};
|
|
1545
1576
|
try {
|
|
1546
|
-
const { signal: r } =
|
|
1577
|
+
const { signal: r } = C(R), n = await u(
|
|
1547
1578
|
"api/v1/security.oauth",
|
|
1548
1579
|
t,
|
|
1549
1580
|
{ signal: r }
|
|
1550
1581
|
);
|
|
1551
1582
|
if (n.redirectUrl) {
|
|
1552
1583
|
const o = new URL(n.redirectUrl, window.location.origin);
|
|
1553
|
-
(o.protocol === "https:" || o.protocol === "http:")
|
|
1584
|
+
if (o.protocol === "https:" || o.protocol === "http:") {
|
|
1585
|
+
if (W(v))
|
|
1586
|
+
throw L(v), new Error(
|
|
1587
|
+
`OAuth sign-in with provider "${e}" did not establish a session — its callback is likely not authorized for this application.`
|
|
1588
|
+
);
|
|
1589
|
+
X(v, "1"), window.location.href = o.href;
|
|
1590
|
+
}
|
|
1554
1591
|
}
|
|
1555
1592
|
return n;
|
|
1556
1593
|
} catch (r) {
|
|
1557
1594
|
throw f("Failed to authenticate with OAuth", r), r;
|
|
1558
1595
|
}
|
|
1559
|
-
},
|
|
1596
|
+
}, dt = async () => {
|
|
1560
1597
|
const { autoSAMLProvider: e } = l;
|
|
1561
1598
|
if (!e)
|
|
1562
1599
|
throw new Error("autoSAMLProvider is not configured in globalConfig");
|
|
1563
1600
|
if (typeof window > "u")
|
|
1564
1601
|
try {
|
|
1565
|
-
const { signal: r } =
|
|
1602
|
+
const { signal: r } = C(R);
|
|
1566
1603
|
return await u(
|
|
1567
1604
|
"security.saml",
|
|
1568
1605
|
{
|
|
@@ -1583,67 +1620,43 @@ const v = 1e4, nt = async () => {
|
|
|
1583
1620
|
originalUrl: window.location.href
|
|
1584
1621
|
};
|
|
1585
1622
|
try {
|
|
1586
|
-
const { signal: r } =
|
|
1623
|
+
const { signal: r } = C(R), n = await u(
|
|
1587
1624
|
"api/v1/security.saml",
|
|
1588
1625
|
t,
|
|
1589
1626
|
{ signal: r }
|
|
1590
1627
|
);
|
|
1591
1628
|
if (n.redirectUrl) {
|
|
1592
1629
|
const o = new URL(n.redirectUrl, window.location.origin);
|
|
1593
|
-
(o.protocol === "https:" || o.protocol === "http:")
|
|
1630
|
+
if (o.protocol === "https:" || o.protocol === "http:") {
|
|
1631
|
+
if (W(v))
|
|
1632
|
+
throw L(v), new Error(
|
|
1633
|
+
`SAML sign-in with provider "${e}" did not establish a session — its callback is likely not authorized for this application.`
|
|
1634
|
+
);
|
|
1635
|
+
X(v, "1"), window.location.href = o.href;
|
|
1636
|
+
}
|
|
1594
1637
|
}
|
|
1595
1638
|
return n;
|
|
1596
1639
|
} catch (r) {
|
|
1597
1640
|
throw f("Failed to authenticate with SAML", r), r;
|
|
1598
1641
|
}
|
|
1599
|
-
},
|
|
1600
|
-
store: {},
|
|
1601
|
-
getItem(e) {
|
|
1602
|
-
return this.store[e] ?? null;
|
|
1603
|
-
},
|
|
1604
|
-
setItem(e, t) {
|
|
1605
|
-
this.store[e] = t.toString();
|
|
1606
|
-
},
|
|
1607
|
-
removeItem(e) {
|
|
1608
|
-
delete this.store[e];
|
|
1609
|
-
},
|
|
1610
|
-
clear() {
|
|
1611
|
-
this.store = {};
|
|
1612
|
-
}
|
|
1613
|
-
}, J = H;
|
|
1614
|
-
function at(e) {
|
|
1615
|
-
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1616
|
-
}
|
|
1617
|
-
function st(e) {
|
|
1618
|
-
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1619
|
-
}
|
|
1620
|
-
function it(e) {
|
|
1621
|
-
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
1622
|
-
}
|
|
1623
|
-
function ct(e, t) {
|
|
1624
|
-
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1625
|
-
}
|
|
1626
|
-
function lt(e) {
|
|
1627
|
-
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1628
|
-
}
|
|
1629
|
-
const A = (e) => ct(
|
|
1642
|
+
}, q = (e) => X(
|
|
1630
1643
|
"sinequa-credentials",
|
|
1631
1644
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1632
|
-
),
|
|
1645
|
+
), ae = async () => {
|
|
1633
1646
|
try {
|
|
1634
|
-
const { signal: e } =
|
|
1647
|
+
const { signal: e } = C(R), t = await w(
|
|
1635
1648
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true",
|
|
1636
1649
|
void 0,
|
|
1637
1650
|
{ signal: e }
|
|
1638
1651
|
);
|
|
1639
1652
|
if (t?.csrfToken)
|
|
1640
|
-
return
|
|
1653
|
+
return q(t.csrfToken), t.csrfToken;
|
|
1641
1654
|
throw new Error("No CSRF token returned");
|
|
1642
1655
|
} catch (e) {
|
|
1643
1656
|
throw f("Failed to get CSRF token", e), e;
|
|
1644
1657
|
}
|
|
1645
1658
|
};
|
|
1646
|
-
async function
|
|
1659
|
+
async function he(e) {
|
|
1647
1660
|
if (e) {
|
|
1648
1661
|
const { username: t, password: r } = e, n = {
|
|
1649
1662
|
action: "get",
|
|
@@ -1654,12 +1667,12 @@ async function ce(e) {
|
|
|
1654
1667
|
noAutoAuthentication: !0
|
|
1655
1668
|
};
|
|
1656
1669
|
try {
|
|
1657
|
-
const { signal: o } =
|
|
1670
|
+
const { signal: o } = C(R), a = await u(
|
|
1658
1671
|
"api/v1/security.webtoken",
|
|
1659
1672
|
n,
|
|
1660
1673
|
{ signal: o }
|
|
1661
1674
|
);
|
|
1662
|
-
return a?.csrfToken ? (
|
|
1675
|
+
return a?.csrfToken ? (q(a.csrfToken), a.csrfToken) : null;
|
|
1663
1676
|
} catch (o) {
|
|
1664
1677
|
throw f("Failed to get JWT", o), o;
|
|
1665
1678
|
}
|
|
@@ -1678,96 +1691,115 @@ async function ce(e) {
|
|
|
1678
1691
|
const n = new Headers();
|
|
1679
1692
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${r}`);
|
|
1680
1693
|
try {
|
|
1681
|
-
const { signal: o } =
|
|
1694
|
+
const { signal: o } = C(R), a = await u(
|
|
1682
1695
|
"api/v1/security.webtoken",
|
|
1683
1696
|
t,
|
|
1684
1697
|
{ headers: n, signal: o }
|
|
1685
1698
|
);
|
|
1686
|
-
return a?.csrfToken ? (
|
|
1699
|
+
return a?.csrfToken ? (q(a.csrfToken), a.csrfToken) : null;
|
|
1687
1700
|
} catch (o) {
|
|
1688
1701
|
throw f("Failed to get JWT without credentials", o), o;
|
|
1689
1702
|
}
|
|
1690
1703
|
}
|
|
1691
1704
|
}
|
|
1692
|
-
const
|
|
1693
|
-
const e =
|
|
1705
|
+
const Z = () => {
|
|
1706
|
+
const e = W("sinequa-credentials");
|
|
1694
1707
|
if (e)
|
|
1695
1708
|
try {
|
|
1696
1709
|
const n = JSON.parse(e).data?.csrfToken;
|
|
1697
1710
|
if (n) return n;
|
|
1698
1711
|
} catch (r) {
|
|
1699
|
-
|
|
1712
|
+
N(
|
|
1700
1713
|
"Failed to parse session storage credentials, falling back to local storage",
|
|
1701
1714
|
r
|
|
1702
1715
|
);
|
|
1703
1716
|
}
|
|
1704
|
-
const t =
|
|
1717
|
+
const t = pe("csrfToken");
|
|
1705
1718
|
return t || null;
|
|
1706
|
-
},
|
|
1719
|
+
}, ft = async () => {
|
|
1720
|
+
try {
|
|
1721
|
+
const { signal: e } = C(R);
|
|
1722
|
+
return await w("api/v1/principal", new URLSearchParams({ action: "get" }), {
|
|
1723
|
+
signal: e,
|
|
1724
|
+
redirect: "manual"
|
|
1725
|
+
}), b("Server auto-authenticated the user (OIDC)"), !0;
|
|
1726
|
+
} catch {
|
|
1727
|
+
return !1;
|
|
1728
|
+
}
|
|
1729
|
+
}, Ur = async (e) => {
|
|
1707
1730
|
if (e) {
|
|
1708
1731
|
const { username: r, password: n } = e;
|
|
1709
|
-
return !r || !n ? (f("Credentials are required for authentication"),
|
|
1732
|
+
return !r || !n ? (f("Credentials are required for authentication"), p(!1), !1) : ht({ username: r, password: n });
|
|
1710
1733
|
}
|
|
1711
1734
|
const t = l.authMode ?? g.unknown();
|
|
1712
1735
|
if (t.kind === "credentials")
|
|
1713
|
-
return
|
|
1736
|
+
return p(!1), !1;
|
|
1714
1737
|
if (t.kind === "bearer")
|
|
1715
|
-
return
|
|
1716
|
-
if (
|
|
1717
|
-
return
|
|
1738
|
+
return gt();
|
|
1739
|
+
if (Z())
|
|
1740
|
+
return k({ isRedirectUrl: !1 }), L(v), p(!0), !0;
|
|
1718
1741
|
try {
|
|
1719
|
-
if (
|
|
1720
|
-
return
|
|
1742
|
+
if (b("Checking for an existing session via CSRF token retrieval"), await ae())
|
|
1743
|
+
return b("User already authenticated (existing session / SSO)"), L(v), t.kind === "unknown" && k({ authMode: g.sso() }), p(!0), !0;
|
|
1721
1744
|
} catch {
|
|
1722
1745
|
}
|
|
1723
1746
|
switch (t.kind) {
|
|
1724
1747
|
case "oauth":
|
|
1725
|
-
return
|
|
1748
|
+
return b("Initiating OAuth authentication flow"), await ut(), p(!1), !1;
|
|
1726
1749
|
case "saml":
|
|
1727
|
-
return
|
|
1750
|
+
return b("Initiating SAML authentication flow"), await dt(), p(!1), !1;
|
|
1728
1751
|
case "sso":
|
|
1729
|
-
return
|
|
1730
|
-
default:
|
|
1731
|
-
|
|
1752
|
+
return p(!1), !1;
|
|
1753
|
+
default: {
|
|
1754
|
+
if (b(
|
|
1755
|
+
"No provider declared — probing for server-side auto-authentication (OIDC)"
|
|
1756
|
+
), await ft())
|
|
1757
|
+
try {
|
|
1758
|
+
if (await ae())
|
|
1759
|
+
return b("User auto-authenticated by the server (OIDC)"), L(v), k({ authMode: g.sso() }), p(!0), !0;
|
|
1760
|
+
} catch {
|
|
1761
|
+
}
|
|
1762
|
+
return k({ authMode: g.credentials() }), p(!1), !1;
|
|
1763
|
+
}
|
|
1732
1764
|
}
|
|
1733
1765
|
};
|
|
1734
|
-
async function
|
|
1735
|
-
|
|
1736
|
-
const { userOverrideActive: t,
|
|
1737
|
-
|
|
1766
|
+
async function ht(e) {
|
|
1767
|
+
b("Attempting authentication using credentials"), k({ authMode: g.credentials() });
|
|
1768
|
+
const { userOverrideActive: t, userOverride: r } = l;
|
|
1769
|
+
k({ userOverrideActive: !1, userOverride: void 0 });
|
|
1738
1770
|
try {
|
|
1739
|
-
await
|
|
1771
|
+
await he(e);
|
|
1740
1772
|
} catch (n) {
|
|
1741
|
-
throw
|
|
1773
|
+
throw p(!1), n;
|
|
1742
1774
|
}
|
|
1743
|
-
return
|
|
1775
|
+
return k({ userOverrideActive: t, userOverride: r }), p(!0), !0;
|
|
1744
1776
|
}
|
|
1745
|
-
async function
|
|
1777
|
+
async function gt() {
|
|
1746
1778
|
try {
|
|
1747
|
-
if (
|
|
1748
|
-
return
|
|
1779
|
+
if (b("Attempting authentication using bearer token"), await he())
|
|
1780
|
+
return p(!0), !0;
|
|
1749
1781
|
} catch (e) {
|
|
1750
|
-
throw f("Bearer authentication failed", e),
|
|
1782
|
+
throw f("Bearer authentication failed", e), p(!1), e;
|
|
1751
1783
|
}
|
|
1752
|
-
return
|
|
1784
|
+
return p(!1), !1;
|
|
1753
1785
|
}
|
|
1754
|
-
const
|
|
1786
|
+
const pt = async () => {
|
|
1755
1787
|
const e = new URLSearchParams({
|
|
1756
1788
|
action: "deleteWebTokenCookie",
|
|
1757
1789
|
noUserOverride: "true",
|
|
1758
1790
|
noAutoAuthentication: "true"
|
|
1759
|
-
}), { signal: t } =
|
|
1760
|
-
return
|
|
1791
|
+
}), { signal: t } = C(R);
|
|
1792
|
+
return w(
|
|
1761
1793
|
"api/v1/challenge",
|
|
1762
1794
|
e,
|
|
1763
1795
|
{ signal: t }
|
|
1764
1796
|
);
|
|
1765
1797
|
};
|
|
1766
|
-
async function
|
|
1798
|
+
async function Or() {
|
|
1767
1799
|
const { userOverrideActive: e } = l;
|
|
1768
|
-
if (
|
|
1800
|
+
if (mt(), !e)
|
|
1769
1801
|
try {
|
|
1770
|
-
const { methodresult: t, logoutUrl: r } = await
|
|
1802
|
+
const { methodresult: t, logoutUrl: r } = await pt();
|
|
1771
1803
|
if (t === "ok")
|
|
1772
1804
|
return r;
|
|
1773
1805
|
f("logout failed");
|
|
@@ -1775,141 +1807,142 @@ async function $r() {
|
|
|
1775
1807
|
f("logout failed", t);
|
|
1776
1808
|
}
|
|
1777
1809
|
}
|
|
1778
|
-
function
|
|
1779
|
-
|
|
1810
|
+
function mt() {
|
|
1811
|
+
me("csrfToken"), L("sinequa-credentials"), p(!1);
|
|
1780
1812
|
}
|
|
1781
|
-
const
|
|
1813
|
+
const Ar = () => !!Z();
|
|
1782
1814
|
export {
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1815
|
+
lr as API,
|
|
1816
|
+
y as ApiError,
|
|
1817
|
+
Et as Audit,
|
|
1818
|
+
P as AuditEventType,
|
|
1787
1819
|
g as AuthMode,
|
|
1788
|
-
|
|
1820
|
+
Ue as DidYouMeanKind,
|
|
1789
1821
|
h as EngineType,
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1822
|
+
_ as EngineTypeModifier,
|
|
1823
|
+
ce as LogLevel,
|
|
1824
|
+
Gt as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1825
|
+
Oe as RFMDisplay,
|
|
1826
|
+
ne as ServerError,
|
|
1827
|
+
xe as TimeoutError,
|
|
1828
|
+
G as UnauthorizedError,
|
|
1829
|
+
A as addAuditAdditionalInfo,
|
|
1830
|
+
vt as addConcepts,
|
|
1831
|
+
Ve as addSessionId,
|
|
1832
|
+
ze as addUrl,
|
|
1833
|
+
we as aggItemRegex,
|
|
1834
|
+
kt as aggregationItemStrictCompare,
|
|
1835
|
+
tr as appInitializerFn,
|
|
1836
|
+
bt as bisect,
|
|
1837
|
+
K as buildPathsAndLevels,
|
|
1838
|
+
mt as clearSessionTokens,
|
|
1839
|
+
Bt as configureLogger,
|
|
1840
|
+
O as createHeaders,
|
|
1841
|
+
C as createTimeoutController,
|
|
1842
|
+
yr as createUserProfile,
|
|
1843
|
+
U as debug,
|
|
1844
|
+
Le as del,
|
|
1845
|
+
Lr as deleteUserProfileProperty,
|
|
1846
|
+
vr as deleteUserSettings,
|
|
1847
|
+
pt as deleteWebTokenCookie,
|
|
1848
|
+
We as detectAuthMode,
|
|
1849
|
+
p as emitAuthenticatedEvent,
|
|
1818
1850
|
f as error,
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1851
|
+
Kt as escapeExpr,
|
|
1852
|
+
Qt as expiresSoon,
|
|
1853
|
+
Ht as extraColumns,
|
|
1854
|
+
Tt as fetchAggregation,
|
|
1855
|
+
er as fetchApp,
|
|
1856
|
+
Xe as fetchAppPreLogin,
|
|
1857
|
+
dr as fetchBulkQuery,
|
|
1858
|
+
Cr as fetchChangePassword,
|
|
1859
|
+
rr as fetchDataset,
|
|
1860
|
+
or as fetchDatasetList,
|
|
1861
|
+
nr as fetchDatasets,
|
|
1862
|
+
ar as fetchLabels,
|
|
1863
|
+
ir as fetchPreview,
|
|
1864
|
+
cr as fetchPreviewUrl,
|
|
1865
|
+
nt as fetchPrincipal,
|
|
1866
|
+
ot as fetchPrincipalList,
|
|
1867
|
+
at as fetchPrincipalUserid,
|
|
1868
|
+
st as fetchPrincipalUserids,
|
|
1869
|
+
ur as fetchQuery,
|
|
1870
|
+
fr as fetchQueryExport,
|
|
1871
|
+
hr as fetchQueryIntent,
|
|
1872
|
+
Rr as fetchSendPasswordResetEmail,
|
|
1873
|
+
gr as fetchSimilarDocuments,
|
|
1874
|
+
pr as fetchSponsoredLinks,
|
|
1875
|
+
mr as fetchSuggest,
|
|
1876
|
+
_r as fetchSuggestField,
|
|
1877
|
+
wr as fetchSuggestQuery,
|
|
1878
|
+
kr as fetchTextChunks,
|
|
1879
|
+
Pr as fetchUserProfile,
|
|
1880
|
+
Sr as fetchUserSettings,
|
|
1881
|
+
$r as fetchVersion,
|
|
1882
|
+
Jt as filter,
|
|
1883
|
+
w as get,
|
|
1884
|
+
Pt as getConcepts,
|
|
1885
|
+
ae as getCsrfToken,
|
|
1886
|
+
ie as getFiltersFromURI,
|
|
1887
|
+
Ut as getFiltersFromUrl,
|
|
1888
|
+
qt as getHelpIndexUrl,
|
|
1889
|
+
At as getIdFromUrl,
|
|
1890
|
+
he as getJWToken,
|
|
1891
|
+
Wt as getMetadata,
|
|
1892
|
+
Xt as getMetadataWithValues,
|
|
1893
|
+
ye as getOffsetFromDates,
|
|
1894
|
+
Dt as getQueryPageFromUrl,
|
|
1895
|
+
Lt as getQueryParamsFromUrl,
|
|
1896
|
+
It as getQueryTabFromUrl,
|
|
1897
|
+
Ot as getQueryTextFromUrl,
|
|
1898
|
+
yt as getRelativeDate,
|
|
1899
|
+
Me as getTime,
|
|
1900
|
+
Z as getToken,
|
|
1901
|
+
$t as getUrlParamsFromQueryParams,
|
|
1870
1902
|
l as globalConfig,
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1903
|
+
je as guid,
|
|
1904
|
+
x as handleResponse,
|
|
1905
|
+
b as info,
|
|
1906
|
+
Ye as initializeAppConfig,
|
|
1907
|
+
Ne as isArrayBuffer,
|
|
1908
|
+
Ar as isAuthenticated,
|
|
1909
|
+
qe as isBlob,
|
|
1910
|
+
Fe as isDate,
|
|
1911
|
+
jt as isExpired,
|
|
1912
|
+
Yt as isJsonable,
|
|
1913
|
+
xt as isNotInputEvent,
|
|
1914
|
+
M as isObject,
|
|
1915
|
+
Be as isString,
|
|
1916
|
+
sr as labels,
|
|
1917
|
+
ge as legacyBooleansToAuthMode,
|
|
1918
|
+
Ur as login,
|
|
1919
|
+
Or as logout,
|
|
1920
|
+
m as makeColumn,
|
|
1921
|
+
Ft as notify,
|
|
1922
|
+
ke as openParentNodes,
|
|
1923
|
+
F as parseText,
|
|
1924
|
+
_e as parseValueAndOperatorFromItem,
|
|
1925
|
+
$e as patch,
|
|
1926
|
+
xr as patchUserProfile,
|
|
1927
|
+
br as patchUserSettings,
|
|
1896
1928
|
u as post,
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1929
|
+
Mt as put,
|
|
1930
|
+
$ as queryParamsFromUrl,
|
|
1931
|
+
Ct as removeConcept,
|
|
1932
|
+
Rt as removeConcepts,
|
|
1933
|
+
zt as resolveToColumnName,
|
|
1934
|
+
Y as rewriteText,
|
|
1935
|
+
lt as saveUserSettings,
|
|
1936
|
+
k as setGlobalConfig,
|
|
1937
|
+
q as setToken,
|
|
1938
|
+
Zt as sha512,
|
|
1939
|
+
St as suggestionsToTreeAggregationNodes,
|
|
1940
|
+
Nt as sysLang,
|
|
1941
|
+
le as toDate,
|
|
1942
|
+
_t as translateAggregationToDateOptions,
|
|
1943
|
+
ft as tryAutoAuthentication,
|
|
1944
|
+
ut as tryOAuthAuthentication,
|
|
1945
|
+
dt as trySAMLAuthentication,
|
|
1946
|
+
N as warn,
|
|
1947
|
+
Vt as withRetry
|
|
1915
1948
|
};
|