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