@sinequa/atomic 0.0.101 → 0.0.108
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 +588 -481
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/auth.d.ts.map +1 -1
- package/dist/configurations/global.config.d.ts +1 -1
- package/dist/configurations/global.config.d.ts.map +1 -1
- package/dist/polyfills/storage.d.ts +7 -0
- package/dist/polyfills/storage.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/notification.d.ts +17 -0
- package/dist/utils/notification.d.ts.map +1 -0
- package/dist/utils/query-params.d.ts +21 -0
- package/dist/utils/query-params.d.ts.map +1 -1
- package/dist/web-api/fetch-app.d.ts.map +1 -1
- package/dist/web-api/fetch-audit.d.ts.map +1 -1
- package/dist/web-api/fetch-preview.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/atomic.js
CHANGED
|
@@ -1,15 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const u = { apiPath: "api/v1", loginPath: "/login", backendUrl: window.location.origin };
|
|
5
|
-
function
|
|
1
|
+
var oe = Object.defineProperty;
|
|
2
|
+
var se = (e, t, r) => t in e ? oe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var H = (e, t, r) => se(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
const u = { apiPath: "api/v1", loginPath: "/login", backendUrl: typeof window < "u" ? window.location.origin : "http://localhost", createRoutes: !1 };
|
|
5
|
+
function S(e) {
|
|
6
6
|
Object.assign(u, e);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const y = {
|
|
9
|
+
store: {},
|
|
10
|
+
getItem(e) {
|
|
11
|
+
return this.store[e] ?? null;
|
|
12
|
+
},
|
|
13
|
+
setItem(e, t) {
|
|
14
|
+
this.store[e] = t.toString();
|
|
15
|
+
},
|
|
16
|
+
removeItem(e) {
|
|
17
|
+
delete this.store[e];
|
|
18
|
+
},
|
|
19
|
+
clear() {
|
|
20
|
+
this.store = {};
|
|
21
|
+
}
|
|
22
|
+
}, Q = y;
|
|
23
|
+
function F(e) {
|
|
24
|
+
return typeof window > "u" || !window.localStorage ? y.getItem(e) : window.localStorage.getItem(e);
|
|
25
|
+
}
|
|
26
|
+
function E(e, t) {
|
|
27
|
+
typeof window > "u" || !window.localStorage ? y.setItem(e, t) : window.localStorage.setItem(e, t);
|
|
28
|
+
}
|
|
29
|
+
function x(e) {
|
|
30
|
+
typeof window > "u" || !window.localStorage ? y.removeItem(e) : window.localStorage.removeItem(e);
|
|
31
|
+
}
|
|
32
|
+
function ce(e) {
|
|
33
|
+
return typeof window > "u" || !window.sessionStorage ? Q.getItem(e) : window.sessionStorage.getItem(e);
|
|
34
|
+
}
|
|
35
|
+
function ie(e, t) {
|
|
36
|
+
typeof window > "u" || !window.sessionStorage ? Q.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
37
|
+
}
|
|
38
|
+
function le(e) {
|
|
39
|
+
typeof window > "u" || !window.sessionStorage ? Q.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
40
|
+
}
|
|
41
|
+
function Ze(e, t) {
|
|
42
|
+
var a;
|
|
43
|
+
return !(e != null && e.items) || ((a = e == null ? void 0 : e.items) == null ? void 0 : a.length) === 0 ? [] : e.items.reduce((o, s) => {
|
|
11
44
|
if (!s.value || s.value === "") return o;
|
|
12
|
-
const c =
|
|
45
|
+
const c = ue(s, e.column);
|
|
13
46
|
return o.push({
|
|
14
47
|
operator: c.operator,
|
|
15
48
|
value: c.value,
|
|
@@ -20,10 +53,10 @@ function je(e, t) {
|
|
|
20
53
|
}), o;
|
|
21
54
|
}, []);
|
|
22
55
|
}
|
|
23
|
-
function
|
|
24
|
-
const r = t,
|
|
25
|
-
if (
|
|
26
|
-
const o = (
|
|
56
|
+
function ue(e, t) {
|
|
57
|
+
const r = t, n = e.value.match(/.*\:\(?([><=\d\-\.AND ]+)\)?/);
|
|
58
|
+
if (n != null && n[1]) {
|
|
59
|
+
const o = (n == null ? void 0 : n[1].split(" AND ")).map((s) => {
|
|
27
60
|
const c = s.indexOf(">=") !== -1 ? "gte" : "lt";
|
|
28
61
|
let i = s.substring(s.indexOf(" ") + 1);
|
|
29
62
|
return { field: r, operator: c, value: i, display: e.display || e.value };
|
|
@@ -36,51 +69,51 @@ function te(e, t) {
|
|
|
36
69
|
}
|
|
37
70
|
return { field: r, operator: "eq", value: e.value, display: e.display };
|
|
38
71
|
}
|
|
39
|
-
function
|
|
72
|
+
function Me(e, t, r) {
|
|
40
73
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
41
74
|
}
|
|
42
|
-
function
|
|
75
|
+
function Ee(e, t) {
|
|
43
76
|
const r = [];
|
|
44
77
|
if (e.length > 0) {
|
|
45
|
-
const
|
|
78
|
+
const n = /* @__PURE__ */ new Map(), a = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp("\\b" + a, "i");
|
|
46
79
|
e.forEach((s) => {
|
|
47
80
|
if (s.display.length > 1) {
|
|
48
81
|
const c = o.exec(s.display);
|
|
49
|
-
|
|
82
|
+
T(r, n, "/", s.display, +(s.frequency || 0), 1, ((c == null ? void 0 : c.index) || 0) + t.length);
|
|
50
83
|
}
|
|
51
84
|
});
|
|
52
85
|
}
|
|
53
86
|
return r;
|
|
54
87
|
}
|
|
55
|
-
function
|
|
56
|
-
const c =
|
|
88
|
+
function T(e, t, r, n, a, o, s) {
|
|
89
|
+
const c = n.indexOf("/", r.length), i = n.substring(0, c + 1);
|
|
57
90
|
let l = t.get(i);
|
|
58
91
|
if (!l) {
|
|
59
|
-
const
|
|
92
|
+
const h = i.replace(/^\/|\/$/g, "");
|
|
60
93
|
l = {
|
|
61
|
-
value:
|
|
62
|
-
count:
|
|
94
|
+
value: n.substring(r.length, c),
|
|
95
|
+
count: a,
|
|
63
96
|
items: [],
|
|
64
97
|
hasChildren: !1,
|
|
65
98
|
$level: o,
|
|
66
99
|
$opened: s >= i.length,
|
|
67
|
-
$path:
|
|
100
|
+
$path: h
|
|
68
101
|
}, t.set(i, l), e.push(l);
|
|
69
102
|
}
|
|
70
|
-
i.length <
|
|
103
|
+
i.length < n.length && (l.hasChildren = !0, T(l.items, t, i, n, a, o + 1, s));
|
|
71
104
|
}
|
|
72
|
-
function
|
|
73
|
-
return e.reduce((r,
|
|
105
|
+
function Te(e, t) {
|
|
106
|
+
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
74
107
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
108
|
+
const de = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, fe = 2, W = 3, he = 5, X = 6, _e = 8, Y = 9, we = 11, K = 12, Se = 14, Z = 15;
|
|
109
|
+
function I(e) {
|
|
77
110
|
if (!e) return [];
|
|
78
|
-
const t = [], r = e.matchAll(
|
|
79
|
-
for (let
|
|
80
|
-
|
|
111
|
+
const t = [], r = e.matchAll(de);
|
|
112
|
+
for (let n of r)
|
|
113
|
+
n[W] ? t.push({ type: "group", value: n[W], op: n[fe] }) : n[X] ? t.push({ type: "adjacent", value: n[X], op: n[he] }) : n[Y] ? t.push({ type: "exact", value: n[Y], op: n[_e] }) : n[K] ? t.push({ type: "regex", value: n[K], op: n[we] }) : n[Z] && t.push({ type: "token", value: n[Z], op: n[Se] });
|
|
81
114
|
return t;
|
|
82
115
|
}
|
|
83
|
-
function
|
|
116
|
+
function G(e) {
|
|
84
117
|
return e.map((t) => {
|
|
85
118
|
const r = t.op || "";
|
|
86
119
|
switch (t.type) {
|
|
@@ -97,59 +130,66 @@ function N(e) {
|
|
|
97
130
|
}
|
|
98
131
|
}).join(" ");
|
|
99
132
|
}
|
|
100
|
-
function
|
|
101
|
-
let
|
|
102
|
-
for (let
|
|
103
|
-
|
|
104
|
-
return
|
|
133
|
+
function et(e, t, r) {
|
|
134
|
+
let n = I(e);
|
|
135
|
+
for (let a of t)
|
|
136
|
+
n.push({ type: "adjacent", value: a, op: r });
|
|
137
|
+
return G(n);
|
|
105
138
|
}
|
|
106
|
-
function
|
|
107
|
-
const r =
|
|
108
|
-
return
|
|
139
|
+
function tt(e, t) {
|
|
140
|
+
const r = I(t), n = r.findIndex((a) => a.value === e);
|
|
141
|
+
return n !== -1 ? (r.splice(n, 1), t = G(r)) : t;
|
|
109
142
|
}
|
|
110
|
-
function
|
|
111
|
-
const t =
|
|
112
|
-
return
|
|
143
|
+
function rt(e) {
|
|
144
|
+
const t = I(e).filter((r) => r.type !== "adjacent");
|
|
145
|
+
return G(t);
|
|
113
146
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
147
|
+
function nt(e) {
|
|
148
|
+
return I(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
116
149
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
return
|
|
150
|
+
function at(e, t, r) {
|
|
151
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: o, isFuture: s } = me(t, r);
|
|
152
|
+
return n.format(a * (s ? 1 : -1), o);
|
|
120
153
|
}
|
|
121
|
-
function
|
|
122
|
-
const r = new Date(e),
|
|
154
|
+
function me(e, t) {
|
|
155
|
+
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), a = Math.abs(n.getTime() - r.getTime());
|
|
123
156
|
return {
|
|
124
|
-
offset: Math.floor(
|
|
157
|
+
offset: Math.floor(a / (1e3 * 60 * 60 * 24)),
|
|
125
158
|
unit: "day",
|
|
126
|
-
isFuture: r >
|
|
159
|
+
isFuture: r > n
|
|
127
160
|
};
|
|
128
161
|
}
|
|
129
|
-
function
|
|
162
|
+
function ot(e) {
|
|
130
163
|
const t = e.target;
|
|
131
164
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
132
165
|
}
|
|
133
|
-
function
|
|
166
|
+
function st(e) {
|
|
134
167
|
if (e === void 0) return;
|
|
135
|
-
const { q: t, f: r, p:
|
|
168
|
+
const { q: t, f: r, p: n, s: a, t: o, n: s, b: c } = R(e), [i] = e.split("?");
|
|
136
169
|
return {
|
|
137
170
|
path: i,
|
|
138
171
|
text: t,
|
|
139
|
-
filters: r ?
|
|
140
|
-
page:
|
|
141
|
-
sort:
|
|
172
|
+
filters: r ? ee(r) : void 0,
|
|
173
|
+
page: n ? parseInt(n, 10) : void 0,
|
|
174
|
+
sort: a,
|
|
142
175
|
tab: o,
|
|
143
176
|
name: s,
|
|
144
177
|
basket: c
|
|
145
178
|
};
|
|
146
179
|
}
|
|
147
|
-
function
|
|
180
|
+
function ct(e) {
|
|
181
|
+
if (!e) return "";
|
|
182
|
+
const { text: t, filters: r, page: n, sort: a, tab: o, name: s, basket: c } = e, i = {};
|
|
183
|
+
t && (i.q = t), r && (i.f = JSON.stringify(r)), n && (i.p = n.toString()), a && (i.s = a), o && (i.t = o), s && (i.n = s), c && (i.b = c);
|
|
184
|
+
const l = new URLSearchParams(i).toString();
|
|
185
|
+
return l || "";
|
|
186
|
+
}
|
|
187
|
+
function it(e) {
|
|
148
188
|
if (e === void 0) return [];
|
|
149
189
|
const { f: t } = R(e);
|
|
150
|
-
return
|
|
190
|
+
return ee(t);
|
|
151
191
|
}
|
|
152
|
-
function
|
|
192
|
+
function ee(e) {
|
|
153
193
|
const t = decodeURIComponent(e);
|
|
154
194
|
try {
|
|
155
195
|
return JSON.parse(t ?? "[]");
|
|
@@ -163,55 +203,55 @@ function R(e) {
|
|
|
163
203
|
const r = new URLSearchParams(t);
|
|
164
204
|
return Object.fromEntries(r);
|
|
165
205
|
}
|
|
166
|
-
function
|
|
206
|
+
function lt(e) {
|
|
167
207
|
const { q: t = "" } = R(e);
|
|
168
208
|
return t;
|
|
169
209
|
}
|
|
170
|
-
function
|
|
210
|
+
function ut(e) {
|
|
171
211
|
const { id: t } = R(e);
|
|
172
212
|
return decodeURIComponent(t);
|
|
173
213
|
}
|
|
174
|
-
function
|
|
214
|
+
function dt(e) {
|
|
175
215
|
const { p: t = "0" } = R(e);
|
|
176
216
|
return parseInt(t, 10);
|
|
177
217
|
}
|
|
178
|
-
function
|
|
218
|
+
function ft(e) {
|
|
179
219
|
const { t } = R(e);
|
|
180
220
|
return t;
|
|
181
221
|
}
|
|
182
|
-
function
|
|
222
|
+
function ht(e, t) {
|
|
183
223
|
if (!e)
|
|
184
224
|
return e;
|
|
185
225
|
let r = 0;
|
|
186
|
-
const
|
|
187
|
-
let
|
|
188
|
-
if (e[
|
|
189
|
-
for (;
|
|
190
|
-
|
|
191
|
-
e[
|
|
226
|
+
const n = e.length;
|
|
227
|
+
let a = 0;
|
|
228
|
+
if (e[a] === "[") {
|
|
229
|
+
for (; a < n && /[0-9]/.test(e[a]); )
|
|
230
|
+
a++;
|
|
231
|
+
e[a] === "]" && (r = a + 1);
|
|
192
232
|
}
|
|
193
|
-
const o =
|
|
233
|
+
const o = B(e, r, !1);
|
|
194
234
|
if (!o)
|
|
195
235
|
return e;
|
|
196
236
|
const s = t.charCodeAt(0), c = t.charCodeAt(1);
|
|
197
237
|
let i = o;
|
|
198
238
|
for (; i; )
|
|
199
239
|
if (s === i.lang1 && c === i.lang2) {
|
|
200
|
-
const
|
|
201
|
-
return e.substring(
|
|
240
|
+
const h = B(e, i.end + 4, !0);
|
|
241
|
+
return e.substring(h.start, h.end);
|
|
202
242
|
} else
|
|
203
|
-
i =
|
|
243
|
+
i = B(e, i.end + 4, !1);
|
|
204
244
|
const l = e.substring(o.start, o.end);
|
|
205
245
|
return l || e;
|
|
206
246
|
}
|
|
207
|
-
function
|
|
208
|
-
for (let
|
|
209
|
-
if (e[
|
|
247
|
+
function B(e, t, r) {
|
|
248
|
+
for (let n = t, a = e.length - 3; n < a; n++)
|
|
249
|
+
if (e[n] === "[" && e[n + 3] === "]")
|
|
210
250
|
return {
|
|
211
251
|
start: t,
|
|
212
|
-
end:
|
|
213
|
-
lang1: e.charCodeAt(
|
|
214
|
-
lang2: e.charCodeAt(
|
|
252
|
+
end: n,
|
|
253
|
+
lang1: e.charCodeAt(n + 1),
|
|
254
|
+
lang2: e.charCodeAt(n + 2)
|
|
215
255
|
};
|
|
216
256
|
if (r)
|
|
217
257
|
return {
|
|
@@ -221,22 +261,60 @@ function y(e, t, r) {
|
|
|
221
261
|
lang2: -1
|
|
222
262
|
};
|
|
223
263
|
}
|
|
224
|
-
function
|
|
225
|
-
const { useLocale: r, useLocaleAsPrefix:
|
|
264
|
+
function _t(e, t) {
|
|
265
|
+
const { useLocale: r, useLocaleAsPrefix: n, indexFile: a, path: o, folder: s } = t, c = r ? `${e}/` : null, i = n ? `${e}.${a}` : a ?? "";
|
|
226
266
|
return [o, s, `${c || ""}${i}`].filter((l) => l !== void 0).join("/");
|
|
227
267
|
}
|
|
228
|
-
|
|
229
|
-
|
|
268
|
+
function O(e) {
|
|
269
|
+
const t = new CustomEvent("notification", {
|
|
270
|
+
bubbles: !0,
|
|
271
|
+
cancelable: !1,
|
|
272
|
+
detail: e
|
|
273
|
+
});
|
|
274
|
+
dispatchEvent(t);
|
|
275
|
+
}
|
|
276
|
+
const wt = {
|
|
277
|
+
success: (e, t) => {
|
|
278
|
+
O({
|
|
279
|
+
type: "success",
|
|
280
|
+
message: e,
|
|
281
|
+
options: t
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
info: (e, t) => {
|
|
285
|
+
O({
|
|
286
|
+
type: "info",
|
|
287
|
+
message: e,
|
|
288
|
+
options: t
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
warning: (e, t) => {
|
|
292
|
+
O({
|
|
293
|
+
type: "warning",
|
|
294
|
+
message: e,
|
|
295
|
+
options: t
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
error: (e, t) => {
|
|
299
|
+
O({
|
|
300
|
+
type: "error",
|
|
301
|
+
message: e,
|
|
302
|
+
options: t
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
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 || {});
|
|
307
|
+
let U = {
|
|
230
308
|
level: 1,
|
|
231
309
|
enableConsoleOutput: !0
|
|
232
310
|
};
|
|
233
|
-
function
|
|
234
|
-
|
|
311
|
+
function St(e) {
|
|
312
|
+
U = { ...U, ...e };
|
|
235
313
|
}
|
|
236
|
-
function
|
|
237
|
-
if (e <
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
314
|
+
function D(e, t, r) {
|
|
315
|
+
if (e < U.level) return;
|
|
316
|
+
const n = (/* @__PURE__ */ new Date()).toISOString(), o = `${`[${te[e]}][${n}]`} ${t}`;
|
|
317
|
+
if (U.enableConsoleOutput)
|
|
240
318
|
switch (e) {
|
|
241
319
|
case 0:
|
|
242
320
|
console.debug(o, r || "");
|
|
@@ -252,135 +330,135 @@ function $(e, t, r) {
|
|
|
252
330
|
break;
|
|
253
331
|
}
|
|
254
332
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
333
|
+
function p(e, t) {
|
|
334
|
+
D(0, e, t);
|
|
257
335
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
336
|
+
function w(e, t) {
|
|
337
|
+
D(1, e, t);
|
|
260
338
|
}
|
|
261
339
|
function C(e, t) {
|
|
262
|
-
|
|
340
|
+
D(2, e, t);
|
|
263
341
|
}
|
|
264
|
-
function
|
|
265
|
-
|
|
342
|
+
function f(e, t) {
|
|
343
|
+
D(3, e, t);
|
|
266
344
|
}
|
|
267
|
-
function
|
|
345
|
+
function mt(e, t, r) {
|
|
268
346
|
var o, s, c, i;
|
|
269
347
|
if (!e || !t) return;
|
|
270
348
|
if (r) {
|
|
271
|
-
const l = Object.keys(t.queries).find((
|
|
272
|
-
let
|
|
273
|
-
l && (
|
|
274
|
-
const v = (s = ((o =
|
|
275
|
-
var
|
|
276
|
-
return (
|
|
349
|
+
const l = Object.keys(t.queries).find((N) => N === (r == null ? void 0 : r.toLowerCase()));
|
|
350
|
+
let h;
|
|
351
|
+
l && (h = t.queries[l]);
|
|
352
|
+
const v = (s = ((o = h == null ? void 0 : h.columnsInfo) == null ? void 0 : o.columns) || []) == null ? void 0 : s.find((N) => {
|
|
353
|
+
var J, z;
|
|
354
|
+
return (z = (J = N.aliases) == null ? void 0 : J.split(",")) == null ? void 0 : z.includes(e);
|
|
277
355
|
});
|
|
278
356
|
if (v) return v.name;
|
|
279
357
|
}
|
|
280
|
-
const
|
|
281
|
-
var
|
|
282
|
-
return (
|
|
358
|
+
const n = (i = (c = t.indexes) == null ? void 0 : c._) == null ? void 0 : i.columns, a = Object.entries(n).find((l) => {
|
|
359
|
+
var h;
|
|
360
|
+
return (h = l[1].aliases) == null ? void 0 : h.includes(e);
|
|
283
361
|
});
|
|
284
|
-
if (
|
|
362
|
+
if (a) return a[0];
|
|
285
363
|
}
|
|
286
|
-
function
|
|
364
|
+
function kt(e, t) {
|
|
287
365
|
const r = e[t];
|
|
288
|
-
return r === void 0 ? [] : Array.isArray(r) ? r.map((
|
|
289
|
-
if (typeof
|
|
290
|
-
return
|
|
291
|
-
if (typeof
|
|
292
|
-
return
|
|
293
|
-
}).filter((
|
|
294
|
-
}
|
|
295
|
-
function
|
|
366
|
+
return r === void 0 ? [] : Array.isArray(r) ? r.map((n) => {
|
|
367
|
+
if (typeof n == "string")
|
|
368
|
+
return n;
|
|
369
|
+
if (typeof n == "object" && n !== null && "display" in n)
|
|
370
|
+
return n.display;
|
|
371
|
+
}).filter((n) => n !== void 0) : [String(r)];
|
|
372
|
+
}
|
|
373
|
+
function A(e) {
|
|
296
374
|
return e !== null && typeof e == "object";
|
|
297
375
|
}
|
|
298
|
-
function
|
|
299
|
-
return
|
|
376
|
+
function ke(e) {
|
|
377
|
+
return A(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
300
378
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
379
|
+
function ge(e) {
|
|
380
|
+
return A(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
303
381
|
}
|
|
304
|
-
function
|
|
382
|
+
function be(e) {
|
|
305
383
|
return typeof e == "string";
|
|
306
384
|
}
|
|
307
|
-
function
|
|
308
|
-
return (
|
|
385
|
+
function gt(e) {
|
|
386
|
+
return (A(e) || Array.isArray(e)) && !ke(e) && !ge(e) && !be(e);
|
|
309
387
|
}
|
|
310
|
-
function
|
|
388
|
+
function Ce(e = !0) {
|
|
311
389
|
let t = Date.now();
|
|
312
|
-
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (
|
|
313
|
-
const
|
|
314
|
-
return t = Math.floor(t / 16), (
|
|
390
|
+
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
391
|
+
const a = (t + Math.random() * 16) % 16 | 0;
|
|
392
|
+
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
315
393
|
});
|
|
316
394
|
}
|
|
317
|
-
function
|
|
395
|
+
function bt(e) {
|
|
318
396
|
if (!e)
|
|
319
397
|
return "``";
|
|
320
398
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
321
399
|
return "`" + e + "`";
|
|
322
400
|
const t = ["`"];
|
|
323
|
-
for (let r = 0,
|
|
324
|
-
const
|
|
325
|
-
(
|
|
401
|
+
for (let r = 0, n = e.length; r < n; r++) {
|
|
402
|
+
const a = e[r];
|
|
403
|
+
(a === "\\" || a === "`") && t.push("\\"), t.push(a);
|
|
326
404
|
}
|
|
327
405
|
return t.push("`"), t.join("");
|
|
328
406
|
}
|
|
329
|
-
function
|
|
407
|
+
function Ct(e) {
|
|
330
408
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then((t) => Array.prototype.map.call(new Uint8Array(t), (r) => ("00" + r.toString(16)).slice(-2)).join(""));
|
|
331
409
|
}
|
|
332
|
-
var k = /* @__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))(k || {}),
|
|
333
|
-
const
|
|
334
|
-
var
|
|
335
|
-
class
|
|
336
|
-
constructor(r,
|
|
410
|
+
var k = /* @__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))(k || {}), Re = /* @__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))(Re || {}), pe = /* @__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))(pe || {});
|
|
411
|
+
const Rt = "1.0";
|
|
412
|
+
var ve = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(ve || {}), xe = /* @__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))(xe || {});
|
|
413
|
+
class m extends Error {
|
|
414
|
+
constructor(r, n) {
|
|
337
415
|
super(r);
|
|
338
|
-
|
|
339
|
-
this.name = "ApiError", this.status =
|
|
416
|
+
H(this, "status");
|
|
417
|
+
this.name = "ApiError", this.status = n;
|
|
340
418
|
}
|
|
341
419
|
}
|
|
342
|
-
class
|
|
420
|
+
class re extends m {
|
|
343
421
|
constructor(t = "Unauthorized access") {
|
|
344
422
|
super(t, 401), this.name = "UnauthorizedError";
|
|
345
423
|
}
|
|
346
424
|
}
|
|
347
|
-
class
|
|
425
|
+
class Pe extends m {
|
|
348
426
|
constructor(t = "Server error") {
|
|
349
427
|
super(t, 500), this.name = "ServerError";
|
|
350
428
|
}
|
|
351
429
|
}
|
|
352
|
-
class
|
|
430
|
+
class Le extends m {
|
|
353
431
|
constructor(t = "Request timed out") {
|
|
354
432
|
super(t, 408), this.name = "TimeoutError";
|
|
355
433
|
}
|
|
356
434
|
}
|
|
357
|
-
function
|
|
435
|
+
function pt(e) {
|
|
358
436
|
const t = new AbortController(), { signal: r } = t;
|
|
359
437
|
return e && setTimeout(() => {
|
|
360
|
-
r.aborted || t.abort(new
|
|
438
|
+
r.aborted || t.abort(new Le(`Request timed out after ${e}ms`));
|
|
361
439
|
}, e), { controller: t, signal: r };
|
|
362
440
|
}
|
|
363
|
-
async function
|
|
364
|
-
let
|
|
365
|
-
for (let
|
|
441
|
+
async function vt(e, t = 0, r = 1e3) {
|
|
442
|
+
let n;
|
|
443
|
+
for (let a = 0; a <= t; a++)
|
|
366
444
|
try {
|
|
367
445
|
return await e();
|
|
368
446
|
} catch (o) {
|
|
369
|
-
if (
|
|
447
|
+
if (n = o, o instanceof m && o.status >= 400 && o.status < 500 && o.status !== 429 || o instanceof DOMException && o.name === "AbortError")
|
|
370
448
|
throw o;
|
|
371
|
-
|
|
449
|
+
a < t && (C(`Retrying request (${a + 1}/${t})`, { error: o }), await new Promise((s) => setTimeout(s, r)));
|
|
372
450
|
}
|
|
373
|
-
throw
|
|
451
|
+
throw n;
|
|
374
452
|
}
|
|
375
|
-
function
|
|
376
|
-
const t =
|
|
453
|
+
function P(e) {
|
|
454
|
+
const t = $(), r = new Headers(e);
|
|
377
455
|
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
378
|
-
const { userOverride:
|
|
379
|
-
return o && r.append("Authorization", `Bearer ${o}`),
|
|
456
|
+
const { userOverride: n, userOverrideActive: a, bearerToken: o } = u;
|
|
457
|
+
return o && r.append("Authorization", `Bearer ${o}`), n && a && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
380
458
|
}
|
|
381
459
|
async function g(e, t = "json") {
|
|
382
460
|
const r = e.headers.get("sinequa-jwt-refresh");
|
|
383
|
-
if (r !== null &&
|
|
461
|
+
if (r !== null && V(r), e.status === 200)
|
|
384
462
|
switch (t) {
|
|
385
463
|
case "arraybuffer":
|
|
386
464
|
return await e.arrayBuffer();
|
|
@@ -394,141 +472,141 @@ async function g(e, t = "json") {
|
|
|
394
472
|
}
|
|
395
473
|
if (e.status === 401) {
|
|
396
474
|
if (u.userOverrideActive)
|
|
397
|
-
throw u.userOverrideActive = !1, C("Unauthorized access attempt with user override", { endpoint: e.url }), new
|
|
398
|
-
await
|
|
475
|
+
throw u.userOverrideActive = !1, C("Unauthorized access attempt with user override", { endpoint: e.url }), new re("Unauthorized... User override failed.");
|
|
476
|
+
await M(e, 401);
|
|
399
477
|
}
|
|
400
|
-
throw e.status === 500 && (
|
|
478
|
+
throw e.status === 500 && (f("Server error occurred", { endpoint: e.url }), await M(e, 500)), C(`Unexpected response status: ${e.status}`, { endpoint: e.url }), new m(`Request failed with status ${e.status}`, e.status);
|
|
401
479
|
}
|
|
402
|
-
async function
|
|
480
|
+
async function M(e, t) {
|
|
403
481
|
var r;
|
|
404
482
|
try {
|
|
405
|
-
const { done:
|
|
406
|
-
if (
|
|
407
|
-
throw new
|
|
408
|
-
const o = JSON.parse(new TextDecoder().decode(
|
|
483
|
+
const { done: n, value: a } = await ((r = e.body) == null ? void 0 : r.getReader().read()) || { done: !0, value: void 0 };
|
|
484
|
+
if (n || !a)
|
|
485
|
+
throw new m(`Request failed with status ${t}`, t);
|
|
486
|
+
const o = JSON.parse(new TextDecoder().decode(a));
|
|
409
487
|
throw o.status = t, o;
|
|
410
|
-
} catch (
|
|
411
|
-
throw
|
|
488
|
+
} catch (n) {
|
|
489
|
+
throw n instanceof m ? n : t === 401 ? new re() : t === 500 ? new Pe() : new m(`Request failed with status ${t}`, t);
|
|
412
490
|
}
|
|
413
491
|
}
|
|
414
492
|
async function d(e, t, r) {
|
|
415
|
-
const
|
|
416
|
-
app:
|
|
493
|
+
const n = P(r == null ? void 0 : r.headers), { app: a, backendUrl: o, apiPath: s } = u, c = {
|
|
494
|
+
app: a,
|
|
417
495
|
...t,
|
|
418
496
|
locale: t.locale || navigator.language,
|
|
419
497
|
noUserOverride: !0,
|
|
420
498
|
noAutoAuthentication: !0
|
|
421
499
|
}, i = `${o}/${s}/${e}`;
|
|
422
|
-
|
|
500
|
+
p(`Making POST request to: ${i}`);
|
|
423
501
|
try {
|
|
424
502
|
const l = await fetch(
|
|
425
503
|
i,
|
|
426
504
|
{
|
|
427
505
|
method: "POST",
|
|
428
|
-
headers:
|
|
506
|
+
headers: n,
|
|
429
507
|
credentials: "include",
|
|
430
508
|
body: JSON.stringify(c)
|
|
431
509
|
}
|
|
432
510
|
);
|
|
433
511
|
return g(l, r == null ? void 0 : r.responseType);
|
|
434
512
|
} catch (l) {
|
|
435
|
-
throw
|
|
513
|
+
throw f("Error making POST request:", l), l;
|
|
436
514
|
}
|
|
437
515
|
}
|
|
438
516
|
async function b(e, t, r) {
|
|
439
|
-
const
|
|
440
|
-
|
|
517
|
+
const n = P(r == null ? void 0 : r.headers), { backendUrl: a, apiPath: o } = u, s = t ? `?${new URLSearchParams(t)}` : "", c = `${a}/${o}/${e}${s}`;
|
|
518
|
+
p(`Making GET request to: ${c}`);
|
|
441
519
|
try {
|
|
442
520
|
const i = await fetch(
|
|
443
521
|
c,
|
|
444
522
|
{
|
|
445
523
|
method: "GET",
|
|
446
524
|
credentials: "include",
|
|
447
|
-
headers:
|
|
525
|
+
headers: n
|
|
448
526
|
}
|
|
449
527
|
);
|
|
450
528
|
return g(i, r == null ? void 0 : r.responseType);
|
|
451
529
|
} catch (i) {
|
|
452
|
-
throw
|
|
530
|
+
throw f("Error making GET request:", i), i;
|
|
453
531
|
}
|
|
454
532
|
}
|
|
455
|
-
async function
|
|
456
|
-
const
|
|
457
|
-
app:
|
|
533
|
+
async function xt(e, t, r) {
|
|
534
|
+
const n = P(r == null ? void 0 : r.headers), { app: a, backendUrl: o, apiPath: s } = u, c = {
|
|
535
|
+
app: a,
|
|
458
536
|
...t,
|
|
459
537
|
locale: t.locale || navigator.language,
|
|
460
538
|
noUserOverride: !0,
|
|
461
539
|
noAutoAuthentication: !0
|
|
462
540
|
}, i = `${o}/${s}/${e}`;
|
|
463
|
-
|
|
541
|
+
p(`Making PUT request to: ${i}`);
|
|
464
542
|
try {
|
|
465
543
|
const l = await fetch(
|
|
466
544
|
i,
|
|
467
545
|
{
|
|
468
546
|
method: "PUT",
|
|
469
|
-
headers:
|
|
547
|
+
headers: n,
|
|
470
548
|
credentials: "include",
|
|
471
549
|
body: JSON.stringify(c)
|
|
472
550
|
}
|
|
473
551
|
);
|
|
474
552
|
return g(l, r == null ? void 0 : r.responseType);
|
|
475
553
|
} catch (l) {
|
|
476
|
-
throw
|
|
554
|
+
throw f("Error making PUT request:", l), l;
|
|
477
555
|
}
|
|
478
556
|
}
|
|
479
|
-
async function
|
|
480
|
-
const
|
|
481
|
-
|
|
557
|
+
async function Pt(e, t, r) {
|
|
558
|
+
const n = P(r == null ? void 0 : r.headers), { backendUrl: a, apiPath: o } = u, s = t ? `?${new URLSearchParams(t)}` : "", c = `${a}/${o}/${e}${s}`;
|
|
559
|
+
p(`Making DELETE request to: ${c}`);
|
|
482
560
|
try {
|
|
483
561
|
const i = await fetch(
|
|
484
562
|
c,
|
|
485
563
|
{
|
|
486
564
|
method: "DELETE",
|
|
487
565
|
credentials: "include",
|
|
488
|
-
headers:
|
|
566
|
+
headers: n
|
|
489
567
|
}
|
|
490
568
|
);
|
|
491
569
|
return g(i, r == null ? void 0 : r.responseType);
|
|
492
570
|
} catch (i) {
|
|
493
|
-
throw
|
|
571
|
+
throw f("Error making DELETE request:", i), i;
|
|
494
572
|
}
|
|
495
573
|
}
|
|
496
|
-
async function
|
|
497
|
-
const
|
|
498
|
-
app:
|
|
574
|
+
async function Lt(e, t, r) {
|
|
575
|
+
const n = P(r == null ? void 0 : r.headers), { app: a, backendUrl: o, apiPath: s } = u, c = {
|
|
576
|
+
app: a,
|
|
499
577
|
...t,
|
|
500
578
|
locale: t.locale || navigator.language,
|
|
501
579
|
noUserOverride: !0,
|
|
502
580
|
noAutoAuthentication: !0
|
|
503
581
|
}, i = `${o}/${s}/${e}`;
|
|
504
|
-
|
|
582
|
+
p(`Making PATCH request to: ${i}`);
|
|
505
583
|
try {
|
|
506
584
|
const l = await fetch(
|
|
507
585
|
i,
|
|
508
586
|
{
|
|
509
587
|
method: "PATCH",
|
|
510
|
-
headers:
|
|
588
|
+
headers: n,
|
|
511
589
|
credentials: "include",
|
|
512
590
|
body: JSON.stringify(c)
|
|
513
591
|
}
|
|
514
592
|
);
|
|
515
593
|
return g(l, r == null ? void 0 : r.responseType);
|
|
516
594
|
} catch (l) {
|
|
517
|
-
throw
|
|
595
|
+
throw f("Error making PATCH request:", l), l;
|
|
518
596
|
}
|
|
519
597
|
}
|
|
520
|
-
let
|
|
521
|
-
function
|
|
522
|
-
let r =
|
|
523
|
-
r && (
|
|
598
|
+
let q, ne;
|
|
599
|
+
function L(e, t = !0) {
|
|
600
|
+
let r = Oe(e.$auditRecord);
|
|
601
|
+
r && (Ue(r), t && $e(r)), e.$auditRecord = r;
|
|
524
602
|
}
|
|
525
|
-
function
|
|
603
|
+
function Oe(e) {
|
|
526
604
|
if (!e)
|
|
527
605
|
return;
|
|
528
606
|
let t;
|
|
529
607
|
if (Array.isArray(e))
|
|
530
608
|
t = e;
|
|
531
|
-
else if (
|
|
609
|
+
else if (A(e)) {
|
|
532
610
|
const r = e;
|
|
533
611
|
if (r.auditEvents || r.mlAuditEvents)
|
|
534
612
|
return r;
|
|
@@ -536,91 +614,97 @@ function ge(e) {
|
|
|
536
614
|
}
|
|
537
615
|
return { auditEvents: t };
|
|
538
616
|
}
|
|
539
|
-
function
|
|
617
|
+
function Ue(e) {
|
|
540
618
|
var r;
|
|
541
|
-
const t =
|
|
542
|
-
return (r = e.auditEvents) == null || r.forEach((
|
|
543
|
-
|
|
619
|
+
const t = ye();
|
|
620
|
+
return (r = e.auditEvents) == null || r.forEach((n) => {
|
|
621
|
+
n.detail || (n.detail = {}), n.detail.sessionid = t;
|
|
544
622
|
}), e;
|
|
545
623
|
}
|
|
546
|
-
function
|
|
624
|
+
function $e(e) {
|
|
547
625
|
var r;
|
|
548
|
-
const t = decodeURIComponent(window.location.href);
|
|
549
|
-
return (r = e == null ? void 0 : e.auditEvents) == null || r.forEach((
|
|
550
|
-
|
|
626
|
+
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
627
|
+
return (r = e == null ? void 0 : e.auditEvents) == null || r.forEach((n) => {
|
|
628
|
+
n.detail || (n.detail = {}), n.detail.url = t;
|
|
551
629
|
}), e;
|
|
552
630
|
}
|
|
553
|
-
function
|
|
554
|
-
return (!
|
|
631
|
+
function ye() {
|
|
632
|
+
return (!q || Ie()) && (q = Ce()), ne = /* @__PURE__ */ new Date(), q;
|
|
555
633
|
}
|
|
556
|
-
function
|
|
557
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
634
|
+
function Ie() {
|
|
635
|
+
return (/* @__PURE__ */ new Date()).getTime() - ne.getTime() > 10 * 60 * 1e3;
|
|
558
636
|
}
|
|
559
|
-
async function
|
|
637
|
+
async function De(e, t = !0) {
|
|
560
638
|
const r = {
|
|
561
639
|
event: k.None,
|
|
562
640
|
$auditRecord: e
|
|
563
641
|
};
|
|
564
|
-
return
|
|
642
|
+
return L(r, t), d("audit.notify", r);
|
|
565
643
|
}
|
|
566
|
-
const
|
|
567
|
-
async function
|
|
568
|
-
var
|
|
569
|
-
const
|
|
570
|
-
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip:
|
|
644
|
+
const Ot = { notify: De };
|
|
645
|
+
async function Ut(e, t, r) {
|
|
646
|
+
var h;
|
|
647
|
+
const n = ((h = e.items) == null ? void 0 : h.length) || 0, a = 10, o = {
|
|
648
|
+
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: a } } },
|
|
571
649
|
$auditRecord: { auditEvents: [r] }
|
|
572
650
|
};
|
|
573
|
-
|
|
651
|
+
L(o);
|
|
574
652
|
const s = await d("query", o), c = await g(s), { aggregations: i } = c, l = i[0];
|
|
575
|
-
return l.$hasMore = l.items.length >
|
|
653
|
+
return l.$hasMore = l.items.length > a, l.items = [...e.items, ...l.items], Promise.resolve(l);
|
|
576
654
|
}
|
|
577
|
-
async function
|
|
655
|
+
async function $t() {
|
|
578
656
|
const { app: e } = u, t = new URLSearchParams({ app: e || "" });
|
|
579
657
|
return b("app", t);
|
|
580
658
|
}
|
|
581
|
-
async function
|
|
659
|
+
async function Ae() {
|
|
582
660
|
const { app: e } = u, t = new URLSearchParams({
|
|
583
661
|
app: e || "",
|
|
584
662
|
preLogin: "true"
|
|
585
663
|
});
|
|
586
664
|
return b("app", t);
|
|
587
665
|
}
|
|
588
|
-
function
|
|
666
|
+
function yt() {
|
|
589
667
|
let { backendUrl: e, app: t } = u;
|
|
590
|
-
if (
|
|
591
|
-
|
|
592
|
-
|
|
668
|
+
if (typeof window < "u") {
|
|
669
|
+
if (e || (e = window.location.origin), !t) {
|
|
670
|
+
const r = window.location.pathname.match(
|
|
671
|
+
/\/app(?:-debug)?\/([^\/#]+)/
|
|
672
|
+
);
|
|
673
|
+
r && (t = r[1]);
|
|
674
|
+
}
|
|
675
|
+
S({
|
|
676
|
+
...u,
|
|
677
|
+
backendUrl: e,
|
|
678
|
+
app: t
|
|
679
|
+
});
|
|
593
680
|
}
|
|
594
|
-
return
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
app: t
|
|
598
|
-
}), pe().then((r) => {
|
|
599
|
-
const { autoOAuthProvider: a, autoSAMLProvider: n } = u, o = !a && !r.autoOAuthProvider && !n && !r.autoSAMLProvider;
|
|
600
|
-
return m({
|
|
681
|
+
return Ae().then((r) => {
|
|
682
|
+
const { autoOAuthProvider: n, autoSAMLProvider: a } = u, o = !n && !r.autoOAuthProvider && !a && !r.autoSAMLProvider;
|
|
683
|
+
return S({
|
|
601
684
|
...u,
|
|
602
|
-
autoOAuthProvider:
|
|
603
|
-
autoSAMLProvider:
|
|
604
|
-
|
|
685
|
+
autoOAuthProvider: n || r.autoOAuthProvider,
|
|
686
|
+
autoSAMLProvider: a || r.autoSAMLProvider,
|
|
687
|
+
useCredentials: o,
|
|
688
|
+
useSSO: o
|
|
605
689
|
}), r;
|
|
606
690
|
}).catch((r) => {
|
|
607
691
|
throw console.error("atomic:fetchAppPreLogin error", r), r;
|
|
608
692
|
});
|
|
609
693
|
}
|
|
610
|
-
async function
|
|
611
|
-
const
|
|
694
|
+
async function It(e, t, r = {}) {
|
|
695
|
+
const n = `search.dataset/${e}/${t}`, a = await d(n, { parameters: r }), o = t[0].toLowerCase() + t.slice(1), s = a.datasets[o];
|
|
612
696
|
if ("errorCode" in s && "errorMessage" in s)
|
|
613
697
|
throw new Error(s.errorMessage);
|
|
614
698
|
return s;
|
|
615
699
|
}
|
|
616
|
-
async function
|
|
617
|
-
const r = `search.dataset/${e}`, { parameters:
|
|
618
|
-
return (await d(r, { parameters:
|
|
700
|
+
async function Dt(e, t) {
|
|
701
|
+
const r = `search.dataset/${e}`, { parameters: n = {}, datasets: a = [] } = t;
|
|
702
|
+
return (await d(r, { parameters: n, datasets: a })).datasets;
|
|
619
703
|
}
|
|
620
|
-
async function
|
|
704
|
+
async function At(e) {
|
|
621
705
|
return await b(`search.dataset/${e}`);
|
|
622
706
|
}
|
|
623
|
-
async function
|
|
707
|
+
async function Nt(e, t = !0, r) {
|
|
624
708
|
try {
|
|
625
709
|
return (await d("labels", {
|
|
626
710
|
action: "list",
|
|
@@ -629,11 +713,11 @@ async function vt(e, t = !0, r) {
|
|
|
629
713
|
locale: r,
|
|
630
714
|
localize: !1
|
|
631
715
|
})).labels;
|
|
632
|
-
} catch (
|
|
633
|
-
throw
|
|
716
|
+
} catch (n) {
|
|
717
|
+
throw f("Error in fetchLabels", n), n;
|
|
634
718
|
}
|
|
635
719
|
}
|
|
636
|
-
async function
|
|
720
|
+
async function Ne() {
|
|
637
721
|
try {
|
|
638
722
|
const { app: e = "" } = u, t = new URLSearchParams({
|
|
639
723
|
app: e,
|
|
@@ -641,12 +725,12 @@ async function Pe() {
|
|
|
641
725
|
});
|
|
642
726
|
return b("labels", t);
|
|
643
727
|
} catch (e) {
|
|
644
|
-
throw
|
|
728
|
+
throw f("Error in getUserRights", e), e;
|
|
645
729
|
}
|
|
646
730
|
}
|
|
647
|
-
async function
|
|
731
|
+
async function Be(e, t, r = !0) {
|
|
648
732
|
try {
|
|
649
|
-
const
|
|
733
|
+
const n = {
|
|
650
734
|
action: "add",
|
|
651
735
|
labels: e,
|
|
652
736
|
ids: t,
|
|
@@ -670,14 +754,14 @@ async function Le(e, t, r = !0) {
|
|
|
670
754
|
]
|
|
671
755
|
}
|
|
672
756
|
};
|
|
673
|
-
return d("labels",
|
|
674
|
-
} catch (
|
|
675
|
-
throw
|
|
757
|
+
return d("labels", n);
|
|
758
|
+
} catch (n) {
|
|
759
|
+
throw f("Error in add", n), n;
|
|
676
760
|
}
|
|
677
761
|
}
|
|
678
|
-
async function
|
|
762
|
+
async function qe(e, t, r = !0) {
|
|
679
763
|
try {
|
|
680
|
-
const
|
|
764
|
+
const n = {
|
|
681
765
|
action: "remove",
|
|
682
766
|
labels: e,
|
|
683
767
|
ids: t,
|
|
@@ -701,14 +785,14 @@ async function Oe(e, t, r = !0) {
|
|
|
701
785
|
]
|
|
702
786
|
}
|
|
703
787
|
};
|
|
704
|
-
return d("labels",
|
|
705
|
-
} catch (
|
|
706
|
-
throw
|
|
788
|
+
return d("labels", n);
|
|
789
|
+
} catch (n) {
|
|
790
|
+
throw f("Error in remove", n), n;
|
|
707
791
|
}
|
|
708
792
|
}
|
|
709
|
-
async function
|
|
793
|
+
async function Fe(e, t, r = !0) {
|
|
710
794
|
try {
|
|
711
|
-
const
|
|
795
|
+
const n = {
|
|
712
796
|
action: "rename",
|
|
713
797
|
labels: e,
|
|
714
798
|
newLabel: t,
|
|
@@ -722,12 +806,12 @@ async function Ue(e, t, r = !0) {
|
|
|
722
806
|
}
|
|
723
807
|
}
|
|
724
808
|
};
|
|
725
|
-
return d("labels",
|
|
726
|
-
} catch (
|
|
727
|
-
throw
|
|
809
|
+
return d("labels", n);
|
|
810
|
+
} catch (n) {
|
|
811
|
+
throw f("Error in rename", n), n;
|
|
728
812
|
}
|
|
729
813
|
}
|
|
730
|
-
async function
|
|
814
|
+
async function Qe(e, t = !0) {
|
|
731
815
|
try {
|
|
732
816
|
const r = {
|
|
733
817
|
action: "delete",
|
|
@@ -743,12 +827,12 @@ async function $e(e, t = !0) {
|
|
|
743
827
|
};
|
|
744
828
|
return d("labels", r);
|
|
745
829
|
} catch (r) {
|
|
746
|
-
throw
|
|
830
|
+
throw f("Error in deleteLabels", r), r;
|
|
747
831
|
}
|
|
748
832
|
}
|
|
749
|
-
async function
|
|
833
|
+
async function Ge(e, t, r = !0) {
|
|
750
834
|
try {
|
|
751
|
-
const
|
|
835
|
+
const n = {
|
|
752
836
|
action: "bulkAdd",
|
|
753
837
|
labels: e,
|
|
754
838
|
query: t,
|
|
@@ -762,14 +846,14 @@ async function De(e, t, r = !0) {
|
|
|
762
846
|
}
|
|
763
847
|
}
|
|
764
848
|
};
|
|
765
|
-
return d("labels",
|
|
766
|
-
} catch (
|
|
767
|
-
throw
|
|
849
|
+
return d("labels", n);
|
|
850
|
+
} catch (n) {
|
|
851
|
+
throw f("Error in bulkAdd", n), n;
|
|
768
852
|
}
|
|
769
853
|
}
|
|
770
|
-
async function
|
|
854
|
+
async function je(e, t, r = !0) {
|
|
771
855
|
try {
|
|
772
|
-
const
|
|
856
|
+
const n = {
|
|
773
857
|
action: "bulkRemove",
|
|
774
858
|
labels: e,
|
|
775
859
|
query: t,
|
|
@@ -783,30 +867,36 @@ async function Ie(e, t, r = !0) {
|
|
|
783
867
|
}
|
|
784
868
|
}
|
|
785
869
|
};
|
|
786
|
-
return d("labels",
|
|
787
|
-
} catch (
|
|
788
|
-
throw
|
|
870
|
+
return d("labels", n);
|
|
871
|
+
} catch (n) {
|
|
872
|
+
throw f("Error in bulkRemove", n), n;
|
|
789
873
|
}
|
|
790
874
|
}
|
|
791
|
-
const
|
|
792
|
-
getUserRights:
|
|
793
|
-
add:
|
|
794
|
-
remove:
|
|
795
|
-
rename:
|
|
796
|
-
delete:
|
|
797
|
-
bulkAdd:
|
|
798
|
-
bulkRemove:
|
|
875
|
+
const Bt = {
|
|
876
|
+
getUserRights: Ne,
|
|
877
|
+
add: Be,
|
|
878
|
+
remove: qe,
|
|
879
|
+
rename: Fe,
|
|
880
|
+
delete: Qe,
|
|
881
|
+
bulkAdd: Ge,
|
|
882
|
+
bulkRemove: je
|
|
799
883
|
};
|
|
800
|
-
async function
|
|
801
|
-
|
|
884
|
+
async function qt(e, t) {
|
|
885
|
+
if (typeof window > "u")
|
|
886
|
+
return d("preview", {
|
|
887
|
+
action: "get",
|
|
888
|
+
id: e,
|
|
889
|
+
query: t
|
|
890
|
+
});
|
|
891
|
+
const r = `${window.location.origin}${window.location.pathname}`, n = { name: t == null ? void 0 : t.name, text: t == null ? void 0 : t.text };
|
|
802
892
|
return d("preview", {
|
|
803
893
|
action: "get",
|
|
804
894
|
id: e,
|
|
805
|
-
query:
|
|
895
|
+
query: n,
|
|
806
896
|
browserUrl: r
|
|
807
897
|
});
|
|
808
898
|
}
|
|
809
|
-
async function
|
|
899
|
+
async function Ft(e) {
|
|
810
900
|
const t = new Headers();
|
|
811
901
|
t.append("content-type", "text");
|
|
812
902
|
const r = await fetch(
|
|
@@ -818,44 +908,44 @@ async function Lt(e) {
|
|
|
818
908
|
);
|
|
819
909
|
g(r);
|
|
820
910
|
}
|
|
821
|
-
async function
|
|
911
|
+
async function Ve() {
|
|
822
912
|
const e = new URLSearchParams({
|
|
823
913
|
action: "get",
|
|
824
914
|
noAutoAuthentication: "true"
|
|
825
915
|
});
|
|
826
916
|
return b("principal", e);
|
|
827
917
|
}
|
|
828
|
-
const
|
|
829
|
-
async function
|
|
918
|
+
const ae = 11;
|
|
919
|
+
async function Qt(e, t, r) {
|
|
830
920
|
var s;
|
|
831
|
-
const
|
|
921
|
+
const a = await d("query", {
|
|
832
922
|
query: e,
|
|
833
923
|
$auditRecord: t,
|
|
834
924
|
queryIntentData: r
|
|
835
925
|
});
|
|
836
|
-
|
|
837
|
-
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length ===
|
|
838
|
-
}), (s =
|
|
839
|
-
const o = { ...
|
|
926
|
+
a.aggregations.forEach((c) => {
|
|
927
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === ae), c.isTree && c.items && j(c);
|
|
928
|
+
}), (s = a.records) == null || s.map((c) => Object.assign(c, { value: c.title, type: "default" }));
|
|
929
|
+
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 };
|
|
840
930
|
return Promise.resolve(o);
|
|
841
931
|
}
|
|
842
|
-
async function
|
|
843
|
-
const { app:
|
|
932
|
+
async function Gt(e, t, r) {
|
|
933
|
+
const { app: n = "" } = u, a = {
|
|
844
934
|
methods: [],
|
|
845
935
|
mode: t,
|
|
846
936
|
propagateErrors: !0,
|
|
847
937
|
$auditRecord: { auditEvents: [r] }
|
|
848
938
|
};
|
|
849
939
|
for (const c of e)
|
|
850
|
-
|
|
940
|
+
a.methods.push({
|
|
851
941
|
method: "query",
|
|
852
|
-
app:
|
|
942
|
+
app: n,
|
|
853
943
|
query: c
|
|
854
944
|
});
|
|
855
|
-
const o = await d("multi",
|
|
945
|
+
const o = await d("multi", a);
|
|
856
946
|
o.results.forEach((c) => {
|
|
857
947
|
c.aggregations.forEach((i) => {
|
|
858
|
-
i.$hasMore = !1, !i.isDistribution && !i.isTree && i.items && (i.$hasMore = i.items.length ===
|
|
948
|
+
i.$hasMore = !1, !i.isDistribution && !i.isTree && i.items && (i.$hasMore = i.items.length === ae), i.isTree && j(i);
|
|
859
949
|
});
|
|
860
950
|
}), o.results.forEach((c) => {
|
|
861
951
|
var i;
|
|
@@ -864,23 +954,23 @@ async function Ut(e, t, r) {
|
|
|
864
954
|
const s = o.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 }));
|
|
865
955
|
return Promise.resolve(s);
|
|
866
956
|
}
|
|
867
|
-
function
|
|
868
|
-
let
|
|
869
|
-
return e.items && e.items.forEach((
|
|
870
|
-
let o = t ? `${t}/${
|
|
871
|
-
|
|
872
|
-
}),
|
|
957
|
+
function j(e, t = "", r = 0) {
|
|
958
|
+
let n = [];
|
|
959
|
+
return e.items && e.items.forEach((a) => {
|
|
960
|
+
let o = t ? `${t}/${a.value}` : a.value, s = r + 1;
|
|
961
|
+
n.push({ path: o, level: s }), a.$path = o, a.$level = s, a.hasChildren ? n = n.concat(j(a, o, s)) : a.hasChildren = !1;
|
|
962
|
+
}), n;
|
|
873
963
|
}
|
|
874
|
-
async function
|
|
964
|
+
async function jt(e) {
|
|
875
965
|
const r = await d("queryintent", {
|
|
876
966
|
query: e
|
|
877
967
|
});
|
|
878
968
|
return r == null ? void 0 : r.intents;
|
|
879
969
|
}
|
|
880
|
-
async function
|
|
881
|
-
const { webservice:
|
|
970
|
+
async function Vt({ model: e, appName: t, query: r, article: n }) {
|
|
971
|
+
const { webservice: a, format: o, maxcount: s, exportedColumns: c, export: i } = e, l = {
|
|
882
972
|
app: t,
|
|
883
|
-
webservice:
|
|
973
|
+
webservice: a,
|
|
884
974
|
query: r,
|
|
885
975
|
type: i,
|
|
886
976
|
format: o,
|
|
@@ -890,14 +980,14 @@ async function Dt({ model: e, appName: t, query: r, article: a }) {
|
|
|
890
980
|
auditEvents: [{
|
|
891
981
|
type: "Search_ExportCSV",
|
|
892
982
|
detail: {
|
|
893
|
-
resultid:
|
|
983
|
+
resultid: n ? n.id : void 0
|
|
894
984
|
}
|
|
895
985
|
}]
|
|
896
986
|
}
|
|
897
987
|
};
|
|
898
|
-
return
|
|
988
|
+
return L(l), await d("search.queryexport", l, { responseType: "blob" });
|
|
899
989
|
}
|
|
900
|
-
async function
|
|
990
|
+
async function Jt(e, t) {
|
|
901
991
|
return await d(
|
|
902
992
|
"similardocuments",
|
|
903
993
|
{
|
|
@@ -908,22 +998,22 @@ async function It(e, t) {
|
|
|
908
998
|
}
|
|
909
999
|
);
|
|
910
1000
|
}
|
|
911
|
-
async function
|
|
912
|
-
var
|
|
913
|
-
const
|
|
1001
|
+
async function zt(e, t) {
|
|
1002
|
+
var a;
|
|
1003
|
+
const n = await d("query.links", {
|
|
914
1004
|
webservice: e,
|
|
915
1005
|
query: t
|
|
916
1006
|
});
|
|
917
|
-
return (
|
|
1007
|
+
return (a = n == null ? void 0 : n.links) == null ? void 0 : a.map((o) => ({ ...o, query: t }));
|
|
918
1008
|
}
|
|
919
|
-
async function
|
|
1009
|
+
async function Ht(e, t, r, n, a) {
|
|
920
1010
|
const { app: o } = u, s = {
|
|
921
1011
|
app: o || "",
|
|
922
1012
|
suggestQuery: e,
|
|
923
1013
|
text: t,
|
|
924
1014
|
filter: r,
|
|
925
|
-
kinds:
|
|
926
|
-
showSource:
|
|
1015
|
+
kinds: n,
|
|
1016
|
+
showSource: a
|
|
927
1017
|
};
|
|
928
1018
|
try {
|
|
929
1019
|
return (await d("search.suggest", s)).suggests;
|
|
@@ -931,17 +1021,17 @@ async function At(e, t, r, a, n) {
|
|
|
931
1021
|
throw console.error("Error fetching suggestions:", c), c;
|
|
932
1022
|
}
|
|
933
1023
|
}
|
|
934
|
-
async function
|
|
935
|
-
const { app:
|
|
1024
|
+
async function Wt(e, t, r, n) {
|
|
1025
|
+
const { app: a } = u;
|
|
936
1026
|
return (await d("suggestquery", {
|
|
937
|
-
app:
|
|
1027
|
+
app: a || "",
|
|
938
1028
|
suggestQuery: e,
|
|
939
1029
|
text: t,
|
|
940
1030
|
query: r,
|
|
941
|
-
kinds:
|
|
1031
|
+
kinds: n
|
|
942
1032
|
})).suggests;
|
|
943
1033
|
}
|
|
944
|
-
async function
|
|
1034
|
+
async function Xt(e, t) {
|
|
945
1035
|
if (!t) return Promise.resolve([]);
|
|
946
1036
|
const { app: r } = u;
|
|
947
1037
|
return (await d("suggestfield", {
|
|
@@ -951,41 +1041,41 @@ async function Bt(e, t) {
|
|
|
951
1041
|
fields: t
|
|
952
1042
|
})).suggests;
|
|
953
1043
|
}
|
|
954
|
-
async function
|
|
1044
|
+
async function Yt(e, t, r, n, a, o) {
|
|
955
1045
|
return d("doc.textchunks", {
|
|
956
1046
|
id: e,
|
|
957
1047
|
textChunks: t,
|
|
958
1048
|
highlights: r,
|
|
959
|
-
query:
|
|
960
|
-
leftSentencesCount:
|
|
1049
|
+
query: n,
|
|
1050
|
+
leftSentencesCount: a,
|
|
961
1051
|
rightSentencesCount: o
|
|
962
1052
|
});
|
|
963
1053
|
}
|
|
964
|
-
async function
|
|
1054
|
+
async function Kt() {
|
|
965
1055
|
const { app: e } = u, t = new URLSearchParams({
|
|
966
1056
|
app: e || "",
|
|
967
1057
|
action: "load"
|
|
968
1058
|
});
|
|
969
1059
|
return b("usersettings", t);
|
|
970
1060
|
}
|
|
971
|
-
async function
|
|
1061
|
+
async function Je(e, t) {
|
|
972
1062
|
const r = {
|
|
973
1063
|
action: "save",
|
|
974
1064
|
userSettings: e,
|
|
975
1065
|
$auditRecord: { auditEvents: [t] }
|
|
976
1066
|
};
|
|
977
|
-
return
|
|
1067
|
+
return L(r), d("usersettings", r);
|
|
978
1068
|
}
|
|
979
|
-
async function
|
|
980
|
-
const
|
|
1069
|
+
async function Zt(e, t) {
|
|
1070
|
+
const n = {
|
|
981
1071
|
action: "patch",
|
|
982
1072
|
userSettings: e,
|
|
983
1073
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
984
1074
|
};
|
|
985
|
-
return
|
|
1075
|
+
return L(n), d("usersettings", n);
|
|
986
1076
|
}
|
|
987
|
-
async function
|
|
988
|
-
return
|
|
1077
|
+
async function Mt() {
|
|
1078
|
+
return Je({}, { type: "UserSettings_Reset" });
|
|
989
1079
|
}
|
|
990
1080
|
function _(e) {
|
|
991
1081
|
const t = new CustomEvent(
|
|
@@ -998,8 +1088,16 @@ function _(e) {
|
|
|
998
1088
|
);
|
|
999
1089
|
dispatchEvent(t);
|
|
1000
1090
|
}
|
|
1001
|
-
const
|
|
1002
|
-
const { autoOAuthProvider: e } = u
|
|
1091
|
+
const ze = async () => {
|
|
1092
|
+
const { autoOAuthProvider: e } = u;
|
|
1093
|
+
if (typeof window > "u")
|
|
1094
|
+
return d("security.oauth", {
|
|
1095
|
+
action: "getcode",
|
|
1096
|
+
provider: e,
|
|
1097
|
+
tokenInCookie: !0,
|
|
1098
|
+
originalUrl: "http://localhost"
|
|
1099
|
+
});
|
|
1100
|
+
const t = {
|
|
1003
1101
|
action: "getcode",
|
|
1004
1102
|
provider: e,
|
|
1005
1103
|
tokenInCookie: !0,
|
|
@@ -1007,12 +1105,20 @@ const Ne = async () => {
|
|
|
1007
1105
|
};
|
|
1008
1106
|
try {
|
|
1009
1107
|
const r = await d("security.oauth", t);
|
|
1010
|
-
return r.redirectUrl && (
|
|
1108
|
+
return r.redirectUrl && (E("oauthRedirectUrl", r.redirectUrl), window.location.href = r.redirectUrl), r;
|
|
1011
1109
|
} catch (r) {
|
|
1012
1110
|
throw console.error("Failed to authenticate with OAuth", r), r;
|
|
1013
1111
|
}
|
|
1014
|
-
},
|
|
1015
|
-
const { autoSAMLProvider: e } = u
|
|
1112
|
+
}, He = async () => {
|
|
1113
|
+
const { autoSAMLProvider: e } = u;
|
|
1114
|
+
if (typeof window > "u")
|
|
1115
|
+
return d("security.saml", {
|
|
1116
|
+
action: "getresponse",
|
|
1117
|
+
provider: e,
|
|
1118
|
+
tokenInCookie: !0,
|
|
1119
|
+
originalUrl: "http://localhost"
|
|
1120
|
+
});
|
|
1121
|
+
const t = {
|
|
1016
1122
|
action: "getresponse",
|
|
1017
1123
|
provider: e,
|
|
1018
1124
|
tokenInCookie: !0,
|
|
@@ -1020,12 +1126,12 @@ const Ne = async () => {
|
|
|
1020
1126
|
};
|
|
1021
1127
|
try {
|
|
1022
1128
|
const r = await d("security.saml", t);
|
|
1023
|
-
return r.redirectUrl && (
|
|
1129
|
+
return r.redirectUrl && (E("samlRedirectUrl", r.redirectUrl), window.location.href = r.redirectUrl), r;
|
|
1024
1130
|
} catch (r) {
|
|
1025
1131
|
throw console.error("Failed to authenticate with SAML", r), r;
|
|
1026
1132
|
}
|
|
1027
|
-
},
|
|
1028
|
-
const { username: t, password: r } = e || {},
|
|
1133
|
+
}, We = async (e) => {
|
|
1134
|
+
const { username: t, password: r } = e || {}, n = {
|
|
1029
1135
|
action: "get",
|
|
1030
1136
|
tokenInCookie: !0,
|
|
1031
1137
|
user: t,
|
|
@@ -1034,179 +1140,180 @@ const Ne = async () => {
|
|
|
1034
1140
|
noAutoAuthentication: !0
|
|
1035
1141
|
};
|
|
1036
1142
|
try {
|
|
1037
|
-
const
|
|
1038
|
-
return
|
|
1039
|
-
} catch (
|
|
1040
|
-
throw console.error("Failed to get JWT",
|
|
1143
|
+
const a = await d("security.webtoken", n);
|
|
1144
|
+
return a.csrfToken ? (V(a.csrfToken), a.csrfToken) : null;
|
|
1145
|
+
} catch (a) {
|
|
1146
|
+
throw console.error("Failed to get JWT", a), a;
|
|
1041
1147
|
}
|
|
1042
|
-
},
|
|
1148
|
+
}, Xe = async () => {
|
|
1043
1149
|
const e = new URLSearchParams({
|
|
1044
1150
|
action: "deleteWebTokenCookie",
|
|
1045
1151
|
noUserOverride: "true",
|
|
1046
1152
|
noAutoAuthentication: "true"
|
|
1047
1153
|
});
|
|
1048
1154
|
return b("challenge", e);
|
|
1049
|
-
},
|
|
1050
|
-
const e =
|
|
1155
|
+
}, $ = () => {
|
|
1156
|
+
const e = F("csrfToken"), t = ce("sinequa-credentials");
|
|
1051
1157
|
return t ? JSON.parse(t).data.csrfToken : e || null;
|
|
1052
|
-
},
|
|
1158
|
+
}, V = (e) => ie("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), Et = async (e) => {
|
|
1053
1159
|
if (e)
|
|
1054
|
-
|
|
1160
|
+
w("Attempting authentication using credentials"), S({ useCredentials: !0, useSSO: !1 });
|
|
1055
1161
|
else
|
|
1056
1162
|
try {
|
|
1057
|
-
const s =
|
|
1058
|
-
|
|
1059
|
-
const i = await
|
|
1060
|
-
if (
|
|
1163
|
+
const s = F("oauthRedirectUrl"), c = F("samlRedirectUrl");
|
|
1164
|
+
w("Attempting to retrieve CSRF token");
|
|
1165
|
+
const i = await Ye();
|
|
1166
|
+
if (p("CSRF token retrieval result", i ? "success" : "failed"), i === null) {
|
|
1061
1167
|
if (s || c)
|
|
1062
|
-
return C("Redirection from provider failed after previous attempt"),
|
|
1063
|
-
const { autoOAuthProvider: l, autoSAMLProvider:
|
|
1168
|
+
return C("Redirection from provider failed after previous attempt"), x("oauthRedirectUrl"), x("samlRedirectUrl"), _(!1), !1;
|
|
1169
|
+
const { autoOAuthProvider: l, autoSAMLProvider: h, useSAML: v } = u;
|
|
1064
1170
|
if (l && !v)
|
|
1065
|
-
return
|
|
1066
|
-
if (
|
|
1067
|
-
return
|
|
1068
|
-
|
|
1171
|
+
return w("Initiating OAuth authentication flow"), await ze(), C("OAuth authentication flow did not redirect as expected"), _(!1), !1;
|
|
1172
|
+
if (h)
|
|
1173
|
+
return w("Initiating SAML authentication flow"), await He(), C("SAML authentication flow did not redirect as expected"), _(!1), !1;
|
|
1174
|
+
w("No direct authentication method available, will try SSO then credentials"), S({ useCredentials: !0, useSSO: !0 });
|
|
1069
1175
|
} else
|
|
1070
|
-
return
|
|
1176
|
+
return x("oauthRedirectUrl"), x("samlRedirectUrl"), w("User authenticated via existing token"), _(!0), !0;
|
|
1071
1177
|
} catch (s) {
|
|
1072
|
-
throw
|
|
1178
|
+
throw f("Unexpected error during authentication", s), _(!1), s;
|
|
1073
1179
|
}
|
|
1074
|
-
|
|
1075
|
-
if (r)
|
|
1180
|
+
if (u.useCredentials && u.useSSO)
|
|
1076
1181
|
try {
|
|
1077
|
-
if (
|
|
1078
|
-
return
|
|
1182
|
+
if (w("Checking if user is authenticated via SSO"), await Ve())
|
|
1183
|
+
return w("User authenticated using SSO"), S({ useCredentials: !1, useSSO: !0 }), _(!0), !0;
|
|
1079
1184
|
} catch (s) {
|
|
1080
1185
|
if ((s == null ? void 0 : s.status) === 401)
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
throw h("SSO authentication failed with unexpected error", s), _(!1), h;
|
|
1186
|
+
return w("SSO authentication failed with 401, falling back to credentials"), S({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1187
|
+
throw f("SSO authentication failed with unexpected error", s), _(!1), f;
|
|
1084
1188
|
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1189
|
+
const { useSSO: r } = u;
|
|
1190
|
+
if ($() !== null || r)
|
|
1191
|
+
return w("user already authenticated", $()), S({ isRedirectUrl: !1 }), _(!0), !0;
|
|
1192
|
+
const { useCredentials: n } = u, { username: a, password: o } = e || {};
|
|
1193
|
+
if (n && !a && !o)
|
|
1194
|
+
return f("Credentials are required for authentication"), _(!1), !1;
|
|
1195
|
+
if (a && o)
|
|
1091
1196
|
try {
|
|
1092
|
-
return
|
|
1197
|
+
return w("authentication using credentials..."), S({ useCredentials: !0, useSSO: !1 }), await We(e), _(!0), !0;
|
|
1093
1198
|
} catch (s) {
|
|
1094
1199
|
throw _(!1), s;
|
|
1095
1200
|
}
|
|
1096
|
-
return _(!1),
|
|
1097
|
-
},
|
|
1201
|
+
return _(!1), f("No authentication method available. Please provide credentials or configure OAuth/SAML."), !1;
|
|
1202
|
+
}, Tt = async () => {
|
|
1098
1203
|
const { useCredentials: e, userOverrideActive: t } = u;
|
|
1099
|
-
|
|
1100
|
-
},
|
|
1204
|
+
x("csrfToken"), le("sinequa-credentials"), e && !t ? (await Xe()).methodresult === "ok" ? _(!1) : console.error("logout failed") : _(!1);
|
|
1205
|
+
}, er = () => !!$(), Ye = async () => {
|
|
1101
1206
|
const { backendUrl: e, apiPath: t } = u;
|
|
1102
1207
|
try {
|
|
1103
|
-
const
|
|
1104
|
-
return
|
|
1208
|
+
const n = await (await fetch(`${e}/${t}/challenge?action=getCsrfToken&suppressErrors=true`)).json();
|
|
1209
|
+
return n != null && n.csrfToken ? (V(n.csrfToken), n.csrfToken) : null;
|
|
1105
1210
|
} catch (r) {
|
|
1106
1211
|
throw console.error("Failed to get CSRF token", r), r;
|
|
1107
1212
|
}
|
|
1108
1213
|
};
|
|
1109
1214
|
export {
|
|
1110
|
-
|
|
1111
|
-
|
|
1215
|
+
m as ApiError,
|
|
1216
|
+
Ot as Audit,
|
|
1112
1217
|
k as AuditEventType,
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1218
|
+
ve as DidYouMeanKind,
|
|
1219
|
+
Re as EngineType,
|
|
1220
|
+
pe as EngineTypeModifier,
|
|
1221
|
+
te as LogLevel,
|
|
1222
|
+
Rt as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1223
|
+
xe as RFMDisplay,
|
|
1224
|
+
Pe as ServerError,
|
|
1225
|
+
Le as TimeoutError,
|
|
1226
|
+
re as UnauthorizedError,
|
|
1227
|
+
L as addAuditAdditionalInfo,
|
|
1228
|
+
et as addConcepts,
|
|
1229
|
+
Ue as addSessionId,
|
|
1230
|
+
$e as addUrl,
|
|
1231
|
+
Me as aggregationItemStrictCompare,
|
|
1232
|
+
yt as appInitializerFn,
|
|
1233
|
+
Te as bisect,
|
|
1234
|
+
j as buildPathsAndLevels,
|
|
1235
|
+
St as configureLogger,
|
|
1236
|
+
P as createHeaders,
|
|
1237
|
+
pt as createTimeoutController,
|
|
1238
|
+
p as debug,
|
|
1239
|
+
Pt as del,
|
|
1240
|
+
Mt as deleteUserSettings,
|
|
1241
|
+
Xe as deleteWebTokenCookie,
|
|
1242
|
+
f as error,
|
|
1243
|
+
bt as escapeExpr,
|
|
1244
|
+
Ut as fetchAggregation,
|
|
1245
|
+
$t as fetchApp,
|
|
1246
|
+
Ae as fetchAppPreLogin,
|
|
1247
|
+
Gt as fetchBulkQuery,
|
|
1248
|
+
It as fetchDataset,
|
|
1249
|
+
At as fetchDatasetList,
|
|
1250
|
+
Dt as fetchDatasets,
|
|
1251
|
+
Nt as fetchLabels,
|
|
1252
|
+
qt as fetchPreview,
|
|
1253
|
+
Ft as fetchPreviewUrl,
|
|
1254
|
+
Ve as fetchPrincipal,
|
|
1255
|
+
Qt as fetchQuery,
|
|
1256
|
+
Vt as fetchQueryExport,
|
|
1257
|
+
jt as fetchQueryIntent,
|
|
1258
|
+
Jt as fetchSimilarDocuments,
|
|
1259
|
+
zt as fetchSponsoredLinks,
|
|
1260
|
+
Ht as fetchSuggest,
|
|
1261
|
+
Xt as fetchSuggestField,
|
|
1262
|
+
Wt as fetchSuggestQuery,
|
|
1263
|
+
Yt as fetchTextChunks,
|
|
1264
|
+
Kt as fetchUserSettings,
|
|
1160
1265
|
b as get,
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1266
|
+
nt as getConcepts,
|
|
1267
|
+
Ye as getCsrfToken,
|
|
1268
|
+
ee as getFiltersFromURI,
|
|
1269
|
+
it as getFiltersFromUrl,
|
|
1270
|
+
_t as getHelpIndexUrl,
|
|
1271
|
+
ut as getIdFromUrl,
|
|
1272
|
+
We as getJWToken,
|
|
1273
|
+
kt as getMetadata,
|
|
1274
|
+
me as getOffsetFromDates,
|
|
1275
|
+
dt as getQueryPageFromUrl,
|
|
1276
|
+
st as getQueryParamsFromUrl,
|
|
1277
|
+
ft as getQueryTabFromUrl,
|
|
1278
|
+
lt as getQueryTextFromUrl,
|
|
1279
|
+
at as getRelativeDate,
|
|
1280
|
+
$ as getToken,
|
|
1281
|
+
ct as getUrlParamsFromQueryParams,
|
|
1176
1282
|
u as globalConfig,
|
|
1177
|
-
|
|
1283
|
+
Ce as guid,
|
|
1178
1284
|
g as handleResponse,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1285
|
+
w as info,
|
|
1286
|
+
ke as isArrayBuffer,
|
|
1287
|
+
er as isAuthenticated,
|
|
1288
|
+
ge as isBlob,
|
|
1289
|
+
gt as isJsonable,
|
|
1290
|
+
ot as isNotInputEvent,
|
|
1291
|
+
A as isObject,
|
|
1292
|
+
be as isString,
|
|
1293
|
+
Bt as labels,
|
|
1294
|
+
Et as login,
|
|
1295
|
+
Tt as logout,
|
|
1296
|
+
wt as notify,
|
|
1297
|
+
I as parseText,
|
|
1298
|
+
ue as parseValueAndOperatorFromItem,
|
|
1299
|
+
Lt as patch,
|
|
1300
|
+
Zt as patchUserSettings,
|
|
1194
1301
|
d as post,
|
|
1195
|
-
|
|
1302
|
+
xt as put,
|
|
1196
1303
|
R as queryParamsFromUrl,
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1304
|
+
tt as removeConcept,
|
|
1305
|
+
rt as removeConcepts,
|
|
1306
|
+
mt as resolveToColumnName,
|
|
1307
|
+
G as rewriteText,
|
|
1308
|
+
Je as saveUserSettings,
|
|
1309
|
+
S as setGlobalConfig,
|
|
1310
|
+
V as setToken,
|
|
1311
|
+
Ct as sha512,
|
|
1312
|
+
Ee as suggestionsToTreeAggregationNodes,
|
|
1313
|
+
ht as sysLang,
|
|
1314
|
+
Ze as translateAggregationToDateOptions,
|
|
1315
|
+
ze as tryOAuthAuthentication,
|
|
1316
|
+
He as trySAMLAuthentication,
|
|
1210
1317
|
C as warn,
|
|
1211
|
-
|
|
1318
|
+
vt as withRetry
|
|
1212
1319
|
};
|