@sinequa/atomic 0.0.129 → 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 +725 -622
- 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/api-endpoints.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.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/types/user-profile/user-profile.d.ts +31 -0
- package/dist/types/user-profile/user-profile.d.ts.map +1 -0
- 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/helpers/methods/patch.d.ts.map +1 -1
- package/dist/web-api/index.d.ts +1 -0
- package/dist/web-api/index.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-principal.d.ts +55 -0
- package/dist/web-api/v1/fetch-principal.d.ts.map +1 -1
- 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 +69 -0
- package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -0
- package/package.json +7 -4
package/dist/atomic.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var le = (e, t, r) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var Y = (e, t, r) => le(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
function w(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 w(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 j(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 pe(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 pt(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,17 +308,17 @@ const bt = {
|
|
|
313
308
|
});
|
|
314
309
|
}
|
|
315
310
|
};
|
|
316
|
-
var
|
|
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 || {});
|
|
317
312
|
let $ = {
|
|
318
313
|
level: 1,
|
|
319
314
|
enableConsoleOutput: !0
|
|
320
315
|
};
|
|
321
|
-
function
|
|
316
|
+
function yt(e) {
|
|
322
317
|
$ = { ...$, ...e };
|
|
323
318
|
}
|
|
324
|
-
function
|
|
319
|
+
function I(e, t, r) {
|
|
325
320
|
if (e < $.level) return;
|
|
326
|
-
const a = `${`[${
|
|
321
|
+
const a = `${`[${T[e]}]`} ${t}`;
|
|
327
322
|
if ($.enableConsoleOutput)
|
|
328
323
|
switch (e) {
|
|
329
324
|
case 0:
|
|
@@ -340,17 +335,17 @@ 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
341
|
function S(e, t) {
|
|
347
|
-
|
|
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");
|
|
@@ -366,98 +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);
|
|
432
|
+
n.append("content-type", "application/json");
|
|
433
|
+
const { app: a, backendUrl: o } = u, s = {
|
|
438
434
|
app: a,
|
|
439
435
|
...t,
|
|
440
436
|
locale: t.locale || navigator.language,
|
|
441
437
|
noUserOverride: !0,
|
|
442
438
|
noAutoAuthentication: !0
|
|
443
|
-
},
|
|
444
|
-
|
|
439
|
+
}, c = o ? `${o}/${e}` : `${e}`;
|
|
440
|
+
y(`Making PATCH request to: ${c}`);
|
|
445
441
|
try {
|
|
446
|
-
const
|
|
442
|
+
const i = await fetch(c, {
|
|
447
443
|
method: "PATCH",
|
|
448
444
|
headers: n,
|
|
449
445
|
credentials: "include",
|
|
450
|
-
body: JSON.stringify(
|
|
446
|
+
body: JSON.stringify(s)
|
|
451
447
|
});
|
|
452
|
-
return C(
|
|
453
|
-
} catch (
|
|
454
|
-
throw
|
|
448
|
+
return C(i, r?.responseType);
|
|
449
|
+
} catch (i) {
|
|
450
|
+
throw f("Error making PATCH request:", i), i;
|
|
455
451
|
}
|
|
456
452
|
}
|
|
457
|
-
async function
|
|
458
|
-
const n =
|
|
453
|
+
async function l(e, t, r) {
|
|
454
|
+
const n = x(r?.headers), { app: a, backendUrl: o } = u;
|
|
459
455
|
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
460
|
-
const
|
|
456
|
+
const s = {
|
|
461
457
|
app: a,
|
|
462
458
|
...t,
|
|
463
459
|
locale: t.locale || navigator.language,
|
|
@@ -465,137 +461,130 @@ async function u(e, t, r) {
|
|
|
465
461
|
noAutoAuthentication: !0
|
|
466
462
|
};
|
|
467
463
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
468
|
-
const
|
|
469
|
-
|
|
464
|
+
const c = o ? `${o}/${e}` : `${e}`;
|
|
465
|
+
y(`Making POST request to: ${c}`);
|
|
470
466
|
try {
|
|
471
|
-
const
|
|
467
|
+
const i = await fetch(c, {
|
|
472
468
|
method: "POST",
|
|
473
469
|
headers: n,
|
|
474
470
|
credentials: "include",
|
|
475
|
-
body: JSON.stringify(
|
|
476
|
-
signal: r
|
|
471
|
+
body: JSON.stringify(s),
|
|
472
|
+
signal: r?.signal
|
|
477
473
|
});
|
|
478
|
-
return C(
|
|
479
|
-
} catch (
|
|
480
|
-
throw
|
|
474
|
+
return C(i, r?.responseType);
|
|
475
|
+
} catch (i) {
|
|
476
|
+
throw f("Error making POST request:", i), i;
|
|
481
477
|
}
|
|
482
478
|
}
|
|
483
479
|
async function Pt(e, t, r) {
|
|
484
|
-
const n =
|
|
480
|
+
const n = x(r?.headers), { app: a, backendUrl: o } = u, s = {
|
|
485
481
|
app: a,
|
|
486
482
|
...t,
|
|
487
483
|
locale: t.locale || navigator.language,
|
|
488
484
|
noUserOverride: !0,
|
|
489
485
|
noAutoAuthentication: !0
|
|
490
|
-
},
|
|
491
|
-
|
|
486
|
+
}, c = `${o}/${e}`;
|
|
487
|
+
y(`Making PUT request to: ${c}`);
|
|
492
488
|
try {
|
|
493
|
-
const
|
|
489
|
+
const i = await fetch(c, {
|
|
494
490
|
method: "PUT",
|
|
495
491
|
headers: n,
|
|
496
492
|
credentials: "include",
|
|
497
|
-
body: JSON.stringify(
|
|
493
|
+
body: JSON.stringify(s)
|
|
498
494
|
});
|
|
499
|
-
return C(
|
|
500
|
-
} catch (
|
|
501
|
-
throw
|
|
495
|
+
return C(i, r?.responseType);
|
|
496
|
+
} catch (i) {
|
|
497
|
+
throw f("Error making PUT request:", i), i;
|
|
502
498
|
}
|
|
503
499
|
}
|
|
504
|
-
function
|
|
500
|
+
function xt(e) {
|
|
505
501
|
const t = new AbortController(), { signal: r } = t;
|
|
506
502
|
return e && setTimeout(() => {
|
|
507
|
-
r.aborted || t.abort(new
|
|
503
|
+
r.aborted || t.abort(new ae(`Request timed out after ${e}ms`));
|
|
508
504
|
}, e), { controller: t, signal: r };
|
|
509
505
|
}
|
|
510
|
-
function
|
|
506
|
+
function ee(e) {
|
|
511
507
|
if (!e) return;
|
|
512
508
|
const t = new Date(e);
|
|
513
509
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
514
510
|
}
|
|
515
|
-
function
|
|
516
|
-
const t =
|
|
511
|
+
function Lt(e) {
|
|
512
|
+
const t = ee(e);
|
|
517
513
|
return !!t && t.getTime() <= Date.now();
|
|
518
514
|
}
|
|
519
515
|
function Ot(e, t = 7) {
|
|
520
|
-
const r =
|
|
516
|
+
const r = ee(e);
|
|
521
517
|
if (!r) return !1;
|
|
522
|
-
const n = Date.now(), a = n + t * 24 * 60 * 60 * 1e3,
|
|
523
|
-
return
|
|
518
|
+
const n = Date.now(), a = n + t * 24 * 60 * 60 * 1e3, o = r.getTime();
|
|
519
|
+
return o > n && o <= a;
|
|
524
520
|
}
|
|
525
521
|
async function $t(e, t = 0, r = 1e3) {
|
|
526
522
|
let n;
|
|
527
523
|
for (let a = 0; a <= t; a++)
|
|
528
524
|
try {
|
|
529
525
|
return await e();
|
|
530
|
-
} catch (
|
|
531
|
-
if (n =
|
|
532
|
-
throw
|
|
533
|
-
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)));
|
|
534
530
|
}
|
|
535
531
|
throw n;
|
|
536
532
|
}
|
|
537
533
|
function Ut(e, t, r) {
|
|
538
|
-
var s, i, o, c;
|
|
539
534
|
if (!e || !t) return;
|
|
540
535
|
if (r) {
|
|
541
|
-
const
|
|
542
|
-
let
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
return (M = (X = F.aliases) == null ? void 0 : X.split(",")) == null ? void 0 : M.includes(e);
|
|
547
|
-
});
|
|
548
|
-
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;
|
|
549
541
|
}
|
|
550
|
-
const n =
|
|
551
|
-
var f;
|
|
552
|
-
return (f = l[1].aliases) == null ? void 0 : f.includes(e);
|
|
553
|
-
});
|
|
542
|
+
const n = t.indexes?._?.columns, a = Object.entries(n).find((o) => o[1].aliases?.includes(e));
|
|
554
543
|
if (a) return a[0];
|
|
555
544
|
}
|
|
556
|
-
var
|
|
557
|
-
const
|
|
558
|
-
var
|
|
559
|
-
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) {
|
|
560
549
|
if (!e)
|
|
561
|
-
return
|
|
550
|
+
return h.none;
|
|
562
551
|
switch (e.toLocaleLowerCase()) {
|
|
563
552
|
case "bool":
|
|
564
553
|
case "boolean":
|
|
565
|
-
return
|
|
554
|
+
return h.bool;
|
|
566
555
|
case "date":
|
|
567
|
-
return
|
|
556
|
+
return h.date;
|
|
568
557
|
case "datetime":
|
|
569
|
-
return
|
|
558
|
+
return h.dateTime;
|
|
570
559
|
case "time":
|
|
571
|
-
return
|
|
560
|
+
return h.time;
|
|
572
561
|
case "unsigned":
|
|
573
|
-
return
|
|
562
|
+
return h.unsigned;
|
|
574
563
|
case "integer":
|
|
575
|
-
return
|
|
564
|
+
return h.integer;
|
|
576
565
|
case "float":
|
|
577
|
-
return
|
|
566
|
+
return h.float;
|
|
578
567
|
case "double":
|
|
579
|
-
return
|
|
568
|
+
return h.double;
|
|
580
569
|
case "dates":
|
|
581
|
-
return
|
|
570
|
+
return h.dates;
|
|
582
571
|
case "datetimes":
|
|
583
|
-
return
|
|
572
|
+
return h.dateTimes;
|
|
584
573
|
case "times":
|
|
585
|
-
return
|
|
574
|
+
return h.times;
|
|
586
575
|
case "varchar":
|
|
587
|
-
return
|
|
576
|
+
return h.varchar;
|
|
588
577
|
case "binary":
|
|
589
|
-
return
|
|
578
|
+
return h.binary;
|
|
590
579
|
case "string":
|
|
591
|
-
return
|
|
580
|
+
return h.string;
|
|
592
581
|
case "csv":
|
|
593
|
-
return
|
|
582
|
+
return h.csv;
|
|
594
583
|
default:
|
|
595
|
-
return
|
|
584
|
+
return h.none;
|
|
596
585
|
}
|
|
597
586
|
}
|
|
598
|
-
function
|
|
587
|
+
function ke(e) {
|
|
599
588
|
switch (e) {
|
|
600
589
|
case "a":
|
|
601
590
|
return g.a;
|
|
@@ -621,41 +610,41 @@ function Re(e) {
|
|
|
621
610
|
return g.none;
|
|
622
611
|
}
|
|
623
612
|
}
|
|
624
|
-
function
|
|
613
|
+
function be(e) {
|
|
625
614
|
let t = g.none;
|
|
626
615
|
if (e)
|
|
627
616
|
for (const r of e)
|
|
628
|
-
t |=
|
|
617
|
+
t |= ke(r);
|
|
629
618
|
return t;
|
|
630
619
|
}
|
|
631
|
-
function
|
|
632
|
-
const a =
|
|
620
|
+
function m(e, t, r, n) {
|
|
621
|
+
const a = Se(t), o = be(r || "");
|
|
633
622
|
return {
|
|
634
623
|
name: e,
|
|
635
624
|
type: t,
|
|
636
625
|
typeModifier: r,
|
|
637
626
|
eType: a,
|
|
638
|
-
eTypeModifier:
|
|
627
|
+
eTypeModifier: o,
|
|
639
628
|
aliases: n
|
|
640
629
|
};
|
|
641
630
|
}
|
|
642
|
-
const
|
|
643
|
-
id:
|
|
644
|
-
text:
|
|
645
|
-
documentlanguages:
|
|
646
|
-
databasealias:
|
|
647
|
-
globalrelevance:
|
|
648
|
-
matchingpartnames:
|
|
649
|
-
matchlocations:
|
|
650
|
-
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"),
|
|
651
640
|
// json
|
|
652
|
-
extracts:
|
|
653
|
-
extractsperpartname:
|
|
641
|
+
extracts: m("extracts", "csv"),
|
|
642
|
+
extractsperpartname: m("extractsperpartname", "varchar"),
|
|
654
643
|
// json
|
|
655
|
-
extractslocations:
|
|
656
|
-
documentweight:
|
|
657
|
-
groupcount:
|
|
658
|
-
accesslists:
|
|
644
|
+
extractslocations: m("extractslocations", "csv"),
|
|
645
|
+
documentweight: m("documentweight", "varchar"),
|
|
646
|
+
groupcount: m("groupcount", "integer"),
|
|
647
|
+
accesslists: m("accesslists", "varchar", void 0, ["accessLists"])
|
|
659
648
|
// json
|
|
660
649
|
};
|
|
661
650
|
function At(e, t) {
|
|
@@ -674,8 +663,8 @@ function Nt(e, t) {
|
|
|
674
663
|
if (typeof a == "string")
|
|
675
664
|
return { display: a.trim(), value: a.trim() };
|
|
676
665
|
if (typeof a == "object" && a !== null && "display" in a) {
|
|
677
|
-
const
|
|
678
|
-
return { display:
|
|
666
|
+
const o = a.display.trim(), s = "value" in a ? String(a.value).trim() : o;
|
|
667
|
+
return { display: o, value: s };
|
|
679
668
|
}
|
|
680
669
|
}).filter(
|
|
681
670
|
(a) => a !== void 0
|
|
@@ -686,30 +675,36 @@ function Nt(e, t) {
|
|
|
686
675
|
function A(e) {
|
|
687
676
|
return e !== null && typeof e == "object";
|
|
688
677
|
}
|
|
689
|
-
function
|
|
678
|
+
function ve(e) {
|
|
690
679
|
return A(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
691
680
|
}
|
|
692
|
-
function
|
|
681
|
+
function Ce(e) {
|
|
693
682
|
return A(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
694
683
|
}
|
|
684
|
+
function Re(e) {
|
|
685
|
+
return Object.prototype.toString.call(e) === "[object Date]";
|
|
686
|
+
}
|
|
695
687
|
function ye(e) {
|
|
696
688
|
return typeof e == "string";
|
|
697
689
|
}
|
|
698
|
-
function
|
|
699
|
-
return (A(e) || Array.isArray(e)) && !
|
|
690
|
+
function qt(e) {
|
|
691
|
+
return (A(e) || Array.isArray(e)) && !ve(e) && !Ce(e) && !ye(e);
|
|
700
692
|
}
|
|
701
|
-
function
|
|
693
|
+
function Pe(e) {
|
|
694
|
+
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
695
|
+
}
|
|
696
|
+
function xe(e = !0) {
|
|
702
697
|
let t = Date.now();
|
|
703
698
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
704
699
|
const a = (t + Math.random() * 16) % 16 | 0;
|
|
705
700
|
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
706
701
|
});
|
|
707
702
|
}
|
|
708
|
-
function
|
|
703
|
+
function Ft(e) {
|
|
709
704
|
if (!e)
|
|
710
705
|
return "``";
|
|
711
706
|
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
712
|
-
return
|
|
707
|
+
return `\`${e}\``;
|
|
713
708
|
const t = ["`"];
|
|
714
709
|
for (let r = 0, n = e.length; r < n; r++) {
|
|
715
710
|
const a = e[r];
|
|
@@ -717,28 +712,30 @@ function Bt(e) {
|
|
|
717
712
|
}
|
|
718
713
|
return t.push("`"), t.join("");
|
|
719
714
|
}
|
|
720
|
-
function
|
|
715
|
+
function Bt(e) {
|
|
721
716
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
722
717
|
try {
|
|
723
|
-
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)));
|
|
724
721
|
} catch {
|
|
725
|
-
return Promise.resolve(
|
|
722
|
+
return Promise.resolve(F(e));
|
|
726
723
|
}
|
|
727
|
-
return Promise.resolve(
|
|
724
|
+
return Promise.resolve(F(e));
|
|
728
725
|
}
|
|
729
|
-
function
|
|
726
|
+
function F(e) {
|
|
730
727
|
let n = 2166136261;
|
|
731
|
-
for (let
|
|
732
|
-
n ^= e.charCodeAt(
|
|
733
|
-
const a = n.toString(16).padStart(8, "0"),
|
|
734
|
-
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);
|
|
735
732
|
}
|
|
736
|
-
let
|
|
737
|
-
function
|
|
738
|
-
let r =
|
|
739
|
-
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;
|
|
740
737
|
}
|
|
741
|
-
function
|
|
738
|
+
function Le(e) {
|
|
742
739
|
if (!e)
|
|
743
740
|
return;
|
|
744
741
|
let t;
|
|
@@ -752,57 +749,54 @@ function $e(e) {
|
|
|
752
749
|
}
|
|
753
750
|
return { auditEvents: t };
|
|
754
751
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
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;
|
|
760
756
|
}), e;
|
|
761
757
|
}
|
|
762
|
-
function
|
|
763
|
-
var r;
|
|
758
|
+
function $e(e) {
|
|
764
759
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
765
|
-
return
|
|
766
|
-
|
|
760
|
+
return e?.auditEvents?.forEach((r) => {
|
|
761
|
+
r.detail || (r.detail = {}), r.detail.url = t;
|
|
767
762
|
}), e;
|
|
768
763
|
}
|
|
769
|
-
function
|
|
770
|
-
return (!
|
|
764
|
+
function Ue() {
|
|
765
|
+
return (!B || De()) && (B = xe()), te = /* @__PURE__ */ new Date(), B;
|
|
771
766
|
}
|
|
772
|
-
function
|
|
773
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
767
|
+
function De() {
|
|
768
|
+
return (/* @__PURE__ */ new Date()).getTime() - te.getTime() > 600 * 1e3;
|
|
774
769
|
}
|
|
775
|
-
async function
|
|
770
|
+
async function Ie(e, t = !0) {
|
|
776
771
|
const r = {
|
|
777
|
-
event:
|
|
772
|
+
event: b.None,
|
|
778
773
|
$auditRecord: e
|
|
779
774
|
};
|
|
780
|
-
return
|
|
775
|
+
return L(r, t), l("api/v1/audit.notify", r);
|
|
781
776
|
}
|
|
782
|
-
const
|
|
783
|
-
async function
|
|
784
|
-
|
|
785
|
-
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 = {
|
|
786
780
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: a } } },
|
|
787
781
|
$auditRecord: { auditEvents: [r] }
|
|
788
782
|
};
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
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);
|
|
792
786
|
}
|
|
793
|
-
async function
|
|
794
|
-
const { app: e } =
|
|
795
|
-
return
|
|
787
|
+
async function Vt() {
|
|
788
|
+
const { app: e } = u, t = new URLSearchParams({ app: e || "" });
|
|
789
|
+
return w("api/v1/app", t);
|
|
796
790
|
}
|
|
797
|
-
async function
|
|
798
|
-
const { app: e } =
|
|
791
|
+
async function Ae() {
|
|
792
|
+
const { app: e } = u, t = new URLSearchParams({
|
|
799
793
|
app: e || "",
|
|
800
794
|
preLogin: "true"
|
|
801
795
|
});
|
|
802
|
-
return
|
|
796
|
+
return w("api/v1/app", t);
|
|
803
797
|
}
|
|
804
|
-
function
|
|
805
|
-
let { backendUrl: e, app: t, useCredentials: r } =
|
|
798
|
+
function Gt() {
|
|
799
|
+
let { backendUrl: e, app: t, useCredentials: r } = u;
|
|
806
800
|
if (typeof window < "u") {
|
|
807
801
|
if (e || (e = window.location.origin), !t) {
|
|
808
802
|
const n = window.location.pathname.match(
|
|
@@ -811,48 +805,48 @@ function jt() {
|
|
|
811
805
|
n && (t = n[1]);
|
|
812
806
|
}
|
|
813
807
|
k({
|
|
814
|
-
...
|
|
808
|
+
...u,
|
|
815
809
|
backendUrl: e,
|
|
816
810
|
app: t
|
|
817
811
|
});
|
|
818
812
|
}
|
|
819
813
|
return r ? (k({
|
|
820
|
-
...
|
|
814
|
+
...u,
|
|
821
815
|
useCredentials: !0,
|
|
822
816
|
useSSO: !1,
|
|
823
817
|
autoOAuthProvider: void 0,
|
|
824
818
|
autoSAMLProvider: void 0,
|
|
825
819
|
bearerToken: void 0,
|
|
826
820
|
useSAML: void 0
|
|
827
|
-
}), Promise.resolve({})) :
|
|
828
|
-
const { autoOAuthProvider: a, autoSAMLProvider:
|
|
821
|
+
}), Promise.resolve({})) : Ae().then((n) => {
|
|
822
|
+
const { autoOAuthProvider: a, autoSAMLProvider: o } = u, s = !a && !n.autoOAuthProvider && !o && !n.autoSAMLProvider;
|
|
829
823
|
return k({
|
|
830
|
-
...
|
|
824
|
+
...u,
|
|
831
825
|
autoOAuthProvider: a || n.autoOAuthProvider,
|
|
832
|
-
autoSAMLProvider:
|
|
833
|
-
useCredentials:
|
|
834
|
-
useSSO:
|
|
826
|
+
autoSAMLProvider: o || n.autoSAMLProvider,
|
|
827
|
+
useCredentials: s,
|
|
828
|
+
useSSO: s
|
|
835
829
|
}), n;
|
|
836
830
|
}).catch((n) => {
|
|
837
|
-
throw
|
|
831
|
+
throw f("atomic:fetchAppPreLogin error", n), n;
|
|
838
832
|
});
|
|
839
833
|
}
|
|
840
834
|
async function zt(e, t, r = {}) {
|
|
841
|
-
const n = `api/v1/search.dataset/${e}/${t}`, a = await
|
|
842
|
-
if ("errorCode" in
|
|
843
|
-
throw new Error(
|
|
844
|
-
return
|
|
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;
|
|
845
839
|
}
|
|
846
840
|
async function Ht(e, t) {
|
|
847
841
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: a = [] } = t;
|
|
848
|
-
return (await
|
|
842
|
+
return (await l(r, { parameters: n, datasets: a })).datasets;
|
|
849
843
|
}
|
|
850
844
|
async function Jt(e) {
|
|
851
|
-
return await
|
|
845
|
+
return await w(`api/v1/search.dataset/${e}`);
|
|
852
846
|
}
|
|
853
847
|
async function Wt(e, t = !0, r) {
|
|
854
848
|
try {
|
|
855
|
-
return (await
|
|
849
|
+
return (await l("api/v1/labels", {
|
|
856
850
|
action: "list",
|
|
857
851
|
q: e,
|
|
858
852
|
public: t,
|
|
@@ -860,18 +854,18 @@ async function Wt(e, t = !0, r) {
|
|
|
860
854
|
localize: !1
|
|
861
855
|
})).labels;
|
|
862
856
|
} catch (n) {
|
|
863
|
-
throw
|
|
857
|
+
throw f("Error in fetchLabels", n), n;
|
|
864
858
|
}
|
|
865
859
|
}
|
|
866
|
-
async function
|
|
860
|
+
async function Ne() {
|
|
867
861
|
try {
|
|
868
|
-
const { app: e = "" } =
|
|
862
|
+
const { app: e = "" } = u, t = new URLSearchParams({
|
|
869
863
|
app: e,
|
|
870
864
|
action: "getUserRights"
|
|
871
865
|
});
|
|
872
|
-
return
|
|
866
|
+
return w("api/v1/labels", t);
|
|
873
867
|
} catch (e) {
|
|
874
|
-
throw
|
|
868
|
+
throw f("Error in getUserRights", e), e;
|
|
875
869
|
}
|
|
876
870
|
}
|
|
877
871
|
async function qe(e, t, r = !0) {
|
|
@@ -884,7 +878,7 @@ async function qe(e, t, r = !0) {
|
|
|
884
878
|
$auditRecord: {
|
|
885
879
|
auditEvents: [
|
|
886
880
|
{
|
|
887
|
-
type:
|
|
881
|
+
type: b.Label_AddDoc,
|
|
888
882
|
detail: {
|
|
889
883
|
public: r,
|
|
890
884
|
label: e ? e.toString() : null,
|
|
@@ -900,12 +894,12 @@ async function qe(e, t, r = !0) {
|
|
|
900
894
|
]
|
|
901
895
|
}
|
|
902
896
|
};
|
|
903
|
-
return
|
|
897
|
+
return l("api/v1/labels", n);
|
|
904
898
|
} catch (n) {
|
|
905
|
-
throw
|
|
899
|
+
throw f("Error in add", n), n;
|
|
906
900
|
}
|
|
907
901
|
}
|
|
908
|
-
async function
|
|
902
|
+
async function Fe(e, t, r = !0) {
|
|
909
903
|
try {
|
|
910
904
|
const n = {
|
|
911
905
|
action: "remove",
|
|
@@ -915,7 +909,7 @@ async function Qe(e, t, r = !0) {
|
|
|
915
909
|
$auditRecord: {
|
|
916
910
|
auditEvents: [
|
|
917
911
|
{
|
|
918
|
-
type:
|
|
912
|
+
type: b.Label_RemoveDoc,
|
|
919
913
|
detail: {
|
|
920
914
|
public: r,
|
|
921
915
|
label: e ? e.toString() : null,
|
|
@@ -931,12 +925,12 @@ async function Qe(e, t, r = !0) {
|
|
|
931
925
|
]
|
|
932
926
|
}
|
|
933
927
|
};
|
|
934
|
-
return
|
|
928
|
+
return l("api/v1/labels", n);
|
|
935
929
|
} catch (n) {
|
|
936
|
-
throw
|
|
930
|
+
throw f("Error in remove", n), n;
|
|
937
931
|
}
|
|
938
932
|
}
|
|
939
|
-
async function
|
|
933
|
+
async function Be(e, t, r = !0) {
|
|
940
934
|
try {
|
|
941
935
|
const n = {
|
|
942
936
|
action: "rename",
|
|
@@ -944,7 +938,7 @@ async function Ve(e, t, r = !0) {
|
|
|
944
938
|
newLabel: t,
|
|
945
939
|
public: r,
|
|
946
940
|
auditEvents: {
|
|
947
|
-
type:
|
|
941
|
+
type: b.Label_Rename,
|
|
948
942
|
detail: {
|
|
949
943
|
public: r,
|
|
950
944
|
oldlabel: e ? e.toString() : null,
|
|
@@ -952,31 +946,31 @@ async function Ve(e, t, r = !0) {
|
|
|
952
946
|
}
|
|
953
947
|
}
|
|
954
948
|
};
|
|
955
|
-
return
|
|
949
|
+
return l("api/v1/labels", n);
|
|
956
950
|
} catch (n) {
|
|
957
|
-
throw
|
|
951
|
+
throw f("Error in rename", n), n;
|
|
958
952
|
}
|
|
959
953
|
}
|
|
960
|
-
async function
|
|
954
|
+
async function je(e, t = !0) {
|
|
961
955
|
try {
|
|
962
956
|
const r = {
|
|
963
957
|
action: "delete",
|
|
964
958
|
labels: e,
|
|
965
959
|
public: t,
|
|
966
960
|
auditEvents: {
|
|
967
|
-
type:
|
|
961
|
+
type: b.Label_Delete,
|
|
968
962
|
detail: {
|
|
969
963
|
public: t,
|
|
970
964
|
label: e ? e.toString() : null
|
|
971
965
|
}
|
|
972
966
|
}
|
|
973
967
|
};
|
|
974
|
-
return
|
|
968
|
+
return l("api/v1/labels", r);
|
|
975
969
|
} catch (r) {
|
|
976
|
-
throw
|
|
970
|
+
throw f("Error in deleteLabels", r), r;
|
|
977
971
|
}
|
|
978
972
|
}
|
|
979
|
-
async function
|
|
973
|
+
async function Qe(e, t, r = !0) {
|
|
980
974
|
try {
|
|
981
975
|
const n = {
|
|
982
976
|
action: "bulkAdd",
|
|
@@ -984,7 +978,7 @@ async function je(e, t, r = !0) {
|
|
|
984
978
|
query: t,
|
|
985
979
|
public: r,
|
|
986
980
|
auditEvents: {
|
|
987
|
-
type:
|
|
981
|
+
type: b.Label_Add,
|
|
988
982
|
detail: {
|
|
989
983
|
public: r,
|
|
990
984
|
label: e ? e.toString() : null,
|
|
@@ -992,12 +986,12 @@ async function je(e, t, r = !0) {
|
|
|
992
986
|
}
|
|
993
987
|
}
|
|
994
988
|
};
|
|
995
|
-
return
|
|
989
|
+
return l("api/v1/labels", n);
|
|
996
990
|
} catch (n) {
|
|
997
|
-
throw
|
|
991
|
+
throw f("Error in bulkAdd", n), n;
|
|
998
992
|
}
|
|
999
993
|
}
|
|
1000
|
-
async function
|
|
994
|
+
async function Ve(e, t, r = !0) {
|
|
1001
995
|
try {
|
|
1002
996
|
const n = {
|
|
1003
997
|
action: "bulkRemove",
|
|
@@ -1005,7 +999,7 @@ async function ze(e, t, r = !0) {
|
|
|
1005
999
|
query: t,
|
|
1006
1000
|
public: r,
|
|
1007
1001
|
auditEvents: {
|
|
1008
|
-
type:
|
|
1002
|
+
type: b.Label_Delete,
|
|
1009
1003
|
detail: {
|
|
1010
1004
|
public: r,
|
|
1011
1005
|
label: e ? e.toString() : null,
|
|
@@ -1013,29 +1007,29 @@ async function ze(e, t, r = !0) {
|
|
|
1013
1007
|
}
|
|
1014
1008
|
}
|
|
1015
1009
|
};
|
|
1016
|
-
return
|
|
1010
|
+
return l("api/v1/labels", n);
|
|
1017
1011
|
} catch (n) {
|
|
1018
|
-
throw
|
|
1012
|
+
throw f("Error in bulkRemove", n), n;
|
|
1019
1013
|
}
|
|
1020
1014
|
}
|
|
1021
|
-
const
|
|
1022
|
-
getUserRights:
|
|
1015
|
+
const Mt = {
|
|
1016
|
+
getUserRights: Ne,
|
|
1023
1017
|
add: qe,
|
|
1024
|
-
remove:
|
|
1025
|
-
rename:
|
|
1026
|
-
delete:
|
|
1027
|
-
bulkAdd:
|
|
1028
|
-
bulkRemove:
|
|
1018
|
+
remove: Fe,
|
|
1019
|
+
rename: Be,
|
|
1020
|
+
delete: je,
|
|
1021
|
+
bulkAdd: Qe,
|
|
1022
|
+
bulkRemove: Ve
|
|
1029
1023
|
};
|
|
1030
|
-
async function
|
|
1024
|
+
async function Xt(e, t) {
|
|
1031
1025
|
if (typeof window > "u")
|
|
1032
|
-
return
|
|
1026
|
+
return l("api/v1/preview", {
|
|
1033
1027
|
action: "get",
|
|
1034
1028
|
id: e,
|
|
1035
1029
|
query: t
|
|
1036
1030
|
});
|
|
1037
|
-
const r = `${window.location.origin}${window.location.pathname}`, n = { name: t
|
|
1038
|
-
return
|
|
1031
|
+
const r = `${window.location.origin}${window.location.pathname}`, n = { name: t?.name, text: t?.text };
|
|
1032
|
+
return l("api/v1/preview", {
|
|
1039
1033
|
action: "get",
|
|
1040
1034
|
id: e,
|
|
1041
1035
|
query: n,
|
|
@@ -1054,68 +1048,99 @@ async function Yt(e) {
|
|
|
1054
1048
|
);
|
|
1055
1049
|
C(r);
|
|
1056
1050
|
}
|
|
1057
|
-
async function
|
|
1051
|
+
async function re() {
|
|
1058
1052
|
const e = new URLSearchParams({
|
|
1059
1053
|
action: "get",
|
|
1060
1054
|
noAutoAuthentication: "true"
|
|
1061
1055
|
});
|
|
1062
|
-
return
|
|
1056
|
+
return w("api/v1/principal", e);
|
|
1063
1057
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1058
|
+
async function Ge(e) {
|
|
1059
|
+
const t = {
|
|
1060
|
+
noAutoAuthentication: "true",
|
|
1061
|
+
...e
|
|
1062
|
+
}, r = new URLSearchParams();
|
|
1063
|
+
return Object.entries(t).forEach(([n, a]) => {
|
|
1064
|
+
a !== void 0 && r.append(n, String(a));
|
|
1065
|
+
}), w("api/v1/principal/list", r);
|
|
1066
|
+
}
|
|
1067
|
+
async function ze(e) {
|
|
1068
|
+
if (!e)
|
|
1069
|
+
return Promise.reject(new Error("userid is required"));
|
|
1070
|
+
const t = new URLSearchParams({
|
|
1071
|
+
action: "userid",
|
|
1072
|
+
noAutoAuthentication: "true",
|
|
1073
|
+
userid: e
|
|
1074
|
+
});
|
|
1075
|
+
return w("api/v1/principal", t);
|
|
1076
|
+
}
|
|
1077
|
+
async function He(e) {
|
|
1078
|
+
if (e.length === 0)
|
|
1079
|
+
return Promise.reject(new Error("userids is required"));
|
|
1080
|
+
const t = new URLSearchParams({
|
|
1081
|
+
noAutoAuthentication: "true",
|
|
1082
|
+
userids: [...e].join(",")
|
|
1083
|
+
});
|
|
1084
|
+
return w("api/v1/principal/userids", t);
|
|
1085
|
+
}
|
|
1086
|
+
const Kt = {
|
|
1087
|
+
principal: {
|
|
1088
|
+
get: re,
|
|
1089
|
+
list: Ge,
|
|
1090
|
+
userid: ze,
|
|
1091
|
+
userids: He
|
|
1092
|
+
}
|
|
1093
|
+
}, ne = 11;
|
|
1094
|
+
async function Zt(e, t, r) {
|
|
1095
|
+
const a = await l("api/v1/query", {
|
|
1068
1096
|
query: e,
|
|
1069
1097
|
$auditRecord: t,
|
|
1070
1098
|
queryIntentData: r
|
|
1071
1099
|
});
|
|
1072
|
-
a.aggregations.forEach((
|
|
1073
|
-
|
|
1074
|
-
}),
|
|
1075
|
-
const
|
|
1076
|
-
return Promise.resolve(
|
|
1077
|
-
}
|
|
1078
|
-
async function
|
|
1079
|
-
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 = {
|
|
1080
1108
|
methods: [],
|
|
1081
1109
|
mode: t,
|
|
1082
1110
|
propagateErrors: !0,
|
|
1083
1111
|
$auditRecord: { auditEvents: [r] }
|
|
1084
1112
|
};
|
|
1085
|
-
for (const
|
|
1113
|
+
for (const c of e)
|
|
1086
1114
|
a.methods.push({
|
|
1087
1115
|
method: "query",
|
|
1088
1116
|
app: n,
|
|
1089
|
-
query:
|
|
1117
|
+
query: c
|
|
1090
1118
|
});
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
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);
|
|
1095
1123
|
});
|
|
1096
|
-
}),
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
});
|
|
1100
|
-
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 }));
|
|
1101
|
-
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);
|
|
1102
1127
|
}
|
|
1103
|
-
function
|
|
1128
|
+
function V(e, t = "", r = 0) {
|
|
1104
1129
|
let n = [];
|
|
1105
1130
|
return e.items && e.items.forEach((a) => {
|
|
1106
|
-
let
|
|
1107
|
-
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;
|
|
1108
1133
|
}), n;
|
|
1109
1134
|
}
|
|
1110
|
-
async function
|
|
1111
|
-
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 = {
|
|
1112
1137
|
app: t,
|
|
1113
1138
|
webservice: a,
|
|
1114
1139
|
query: r,
|
|
1115
|
-
type:
|
|
1116
|
-
format:
|
|
1117
|
-
maxcount:
|
|
1118
|
-
exportedColumns:
|
|
1140
|
+
type: i,
|
|
1141
|
+
format: o,
|
|
1142
|
+
maxcount: s,
|
|
1143
|
+
exportedColumns: c,
|
|
1119
1144
|
$auditRecord: {
|
|
1120
1145
|
auditEvents: [{
|
|
1121
1146
|
type: "Search_ExportCSV",
|
|
@@ -1125,16 +1150,15 @@ async function Et({ model: e, appName: t, query: r, article: n }) {
|
|
|
1125
1150
|
}]
|
|
1126
1151
|
}
|
|
1127
1152
|
};
|
|
1128
|
-
return
|
|
1153
|
+
return L(d), await l("api/v1/search.queryexport", d, { responseType: "blob" });
|
|
1129
1154
|
}
|
|
1130
|
-
async function
|
|
1131
|
-
|
|
1155
|
+
async function er(e) {
|
|
1156
|
+
return (await l("api/v1/queryintent", {
|
|
1132
1157
|
query: e
|
|
1133
|
-
});
|
|
1134
|
-
return r == null ? void 0 : r.intents;
|
|
1158
|
+
}))?.intents;
|
|
1135
1159
|
}
|
|
1136
|
-
async function
|
|
1137
|
-
return (await
|
|
1160
|
+
async function tr(e, t, r) {
|
|
1161
|
+
return (await l(
|
|
1138
1162
|
"api/v1/similardocuments",
|
|
1139
1163
|
{
|
|
1140
1164
|
sourceDocumentId: e,
|
|
@@ -1145,17 +1169,55 @@ async function er(e, t, r) {
|
|
|
1145
1169
|
{ signal: r }
|
|
1146
1170
|
)).data;
|
|
1147
1171
|
}
|
|
1148
|
-
async function
|
|
1149
|
-
|
|
1150
|
-
const n = await u("api/v1/query.links", {
|
|
1172
|
+
async function rr(e, t) {
|
|
1173
|
+
return (await l("api/v1/query.links", {
|
|
1151
1174
|
webservice: e,
|
|
1152
1175
|
query: t
|
|
1153
|
-
});
|
|
1154
|
-
|
|
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;
|
|
1194
|
+
}
|
|
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
|
+
}
|
|
1155
1217
|
}
|
|
1156
|
-
async function
|
|
1157
|
-
const { app:
|
|
1158
|
-
app:
|
|
1218
|
+
async function nr(e, t, r, n, a) {
|
|
1219
|
+
const { app: o } = u, s = {
|
|
1220
|
+
app: o || "",
|
|
1159
1221
|
suggestQuery: e,
|
|
1160
1222
|
text: t,
|
|
1161
1223
|
filter: r,
|
|
@@ -1163,55 +1225,66 @@ async function rr(e, t, r, n, a) {
|
|
|
1163
1225
|
showSource: a
|
|
1164
1226
|
};
|
|
1165
1227
|
try {
|
|
1166
|
-
return (await
|
|
1167
|
-
|
|
1168
|
-
|
|
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;
|
|
1169
1234
|
}
|
|
1170
1235
|
}
|
|
1171
|
-
async function
|
|
1172
|
-
const { app: a } =
|
|
1173
|
-
return (await
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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;
|
|
1180
1248
|
}
|
|
1181
|
-
async function
|
|
1249
|
+
async function or(e, t, r) {
|
|
1182
1250
|
if (!t) return Promise.resolve([]);
|
|
1183
|
-
const { app:
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
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", {
|
|
1193
1266
|
id: e,
|
|
1194
1267
|
textChunks: t,
|
|
1195
1268
|
highlights: r,
|
|
1196
1269
|
query: n,
|
|
1197
1270
|
leftSentencesCount: a,
|
|
1198
|
-
rightSentencesCount:
|
|
1271
|
+
rightSentencesCount: o
|
|
1199
1272
|
});
|
|
1200
1273
|
}
|
|
1201
|
-
async function
|
|
1202
|
-
const { app: e } =
|
|
1274
|
+
async function ir() {
|
|
1275
|
+
const { app: e } = u, t = new URLSearchParams({
|
|
1203
1276
|
app: e || "",
|
|
1204
1277
|
action: "load"
|
|
1205
1278
|
});
|
|
1206
|
-
return
|
|
1279
|
+
return w("api/v1/usersettings", t);
|
|
1207
1280
|
}
|
|
1208
|
-
async function
|
|
1281
|
+
async function Me(e, t) {
|
|
1209
1282
|
const r = {
|
|
1210
1283
|
action: "save",
|
|
1211
1284
|
userSettings: e,
|
|
1212
1285
|
$auditRecord: { auditEvents: [t] }
|
|
1213
1286
|
};
|
|
1214
|
-
return
|
|
1287
|
+
return L(r), l("api/v1/usersettings", r);
|
|
1215
1288
|
}
|
|
1216
1289
|
async function cr(e, t) {
|
|
1217
1290
|
const n = {
|
|
@@ -1219,28 +1292,49 @@ async function cr(e, t) {
|
|
|
1219
1292
|
userSettings: e,
|
|
1220
1293
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1221
1294
|
};
|
|
1222
|
-
return
|
|
1295
|
+
return L(n), l("api/v1/usersettings", n);
|
|
1223
1296
|
}
|
|
1224
|
-
async function
|
|
1225
|
-
return
|
|
1297
|
+
async function lr() {
|
|
1298
|
+
return Me({}, { type: "UserSettings_Reset" });
|
|
1226
1299
|
}
|
|
1227
|
-
async function
|
|
1228
|
-
return
|
|
1300
|
+
async function ur(e, t) {
|
|
1301
|
+
return l("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1229
1302
|
}
|
|
1230
|
-
async function
|
|
1303
|
+
async function dr(e) {
|
|
1231
1304
|
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1232
1305
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1233
1306
|
userName: e
|
|
1234
1307
|
};
|
|
1235
|
-
return
|
|
1308
|
+
return l(t, n);
|
|
1309
|
+
}
|
|
1310
|
+
async function fr(e) {
|
|
1311
|
+
return await w(`api/v2/user-profile/${e}`);
|
|
1312
|
+
}
|
|
1313
|
+
async function hr(e) {
|
|
1314
|
+
return await l("api/v2/user-profile", e);
|
|
1315
|
+
}
|
|
1316
|
+
async function mr(e, t, r) {
|
|
1317
|
+
return await ge(
|
|
1318
|
+
`api/v2/user-profile/${e.data?.id}/${t}/${r}`,
|
|
1319
|
+
e
|
|
1320
|
+
);
|
|
1236
1321
|
}
|
|
1237
|
-
async function
|
|
1238
|
-
|
|
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");
|
|
1239
1333
|
}
|
|
1240
|
-
const
|
|
1241
|
-
const { autoOAuthProvider: e } =
|
|
1334
|
+
const Xe = async () => {
|
|
1335
|
+
const { autoOAuthProvider: e } = u;
|
|
1242
1336
|
if (typeof window > "u")
|
|
1243
|
-
return
|
|
1337
|
+
return l("security.oauth", {
|
|
1244
1338
|
action: "getcode",
|
|
1245
1339
|
provider: e,
|
|
1246
1340
|
tokenInCookie: !0,
|
|
@@ -1253,7 +1347,7 @@ const We = async () => {
|
|
|
1253
1347
|
originalUrl: window.location.href
|
|
1254
1348
|
};
|
|
1255
1349
|
try {
|
|
1256
|
-
const r = await
|
|
1350
|
+
const r = await l(
|
|
1257
1351
|
"api/v1/security.oauth",
|
|
1258
1352
|
t
|
|
1259
1353
|
);
|
|
@@ -1261,10 +1355,10 @@ const We = async () => {
|
|
|
1261
1355
|
} catch (r) {
|
|
1262
1356
|
throw console.error("Failed to authenticate with OAuth", r), r;
|
|
1263
1357
|
}
|
|
1264
|
-
},
|
|
1265
|
-
const { autoSAMLProvider: e } =
|
|
1358
|
+
}, Ye = async () => {
|
|
1359
|
+
const { autoSAMLProvider: e } = u;
|
|
1266
1360
|
if (typeof window > "u")
|
|
1267
|
-
return
|
|
1361
|
+
return l("security.saml", {
|
|
1268
1362
|
action: "getresponse",
|
|
1269
1363
|
provider: e,
|
|
1270
1364
|
tokenInCookie: !0,
|
|
@@ -1277,7 +1371,7 @@ const We = async () => {
|
|
|
1277
1371
|
originalUrl: window.location.href
|
|
1278
1372
|
};
|
|
1279
1373
|
try {
|
|
1280
|
-
const r = await
|
|
1374
|
+
const r = await l(
|
|
1281
1375
|
"api/v1/security.saml",
|
|
1282
1376
|
t
|
|
1283
1377
|
);
|
|
@@ -1285,7 +1379,7 @@ const We = async () => {
|
|
|
1285
1379
|
} catch (r) {
|
|
1286
1380
|
throw console.error("Failed to authenticate with SAML", r), r;
|
|
1287
1381
|
}
|
|
1288
|
-
},
|
|
1382
|
+
}, G = {
|
|
1289
1383
|
store: {},
|
|
1290
1384
|
getItem(e) {
|
|
1291
1385
|
return this.store[e] ?? null;
|
|
@@ -1299,36 +1393,36 @@ const We = async () => {
|
|
|
1299
1393
|
clear() {
|
|
1300
1394
|
this.store = {};
|
|
1301
1395
|
}
|
|
1302
|
-
},
|
|
1303
|
-
function Me(e) {
|
|
1304
|
-
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1305
|
-
}
|
|
1306
|
-
function Ye(e) {
|
|
1307
|
-
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1308
|
-
}
|
|
1396
|
+
}, z = G;
|
|
1309
1397
|
function Ke(e) {
|
|
1310
|
-
return typeof window > "u" || !window.
|
|
1398
|
+
return typeof window > "u" || !window.localStorage ? G.getItem(e) : window.localStorage.getItem(e);
|
|
1311
1399
|
}
|
|
1312
|
-
function Ze(e
|
|
1313
|
-
typeof window > "u" || !window.
|
|
1400
|
+
function Ze(e) {
|
|
1401
|
+
typeof window > "u" || !window.localStorage ? G.removeItem(e) : window.localStorage.removeItem(e);
|
|
1314
1402
|
}
|
|
1315
1403
|
function Ee(e) {
|
|
1316
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1404
|
+
return typeof window > "u" || !window.sessionStorage ? z.getItem(e) : window.sessionStorage.getItem(e);
|
|
1405
|
+
}
|
|
1406
|
+
function Te(e, t) {
|
|
1407
|
+
typeof window > "u" || !window.sessionStorage ? z.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1317
1408
|
}
|
|
1318
|
-
|
|
1409
|
+
function et(e) {
|
|
1410
|
+
typeof window > "u" || !window.sessionStorage ? z.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1411
|
+
}
|
|
1412
|
+
const U = (e) => Te(
|
|
1319
1413
|
"sinequa-credentials",
|
|
1320
1414
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1321
|
-
),
|
|
1415
|
+
), tt = async () => {
|
|
1322
1416
|
try {
|
|
1323
|
-
const e = await
|
|
1417
|
+
const e = await w(
|
|
1324
1418
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true"
|
|
1325
1419
|
);
|
|
1326
|
-
return e
|
|
1420
|
+
return e?.csrfToken ? (U(e.csrfToken), e.csrfToken) : null;
|
|
1327
1421
|
} catch (e) {
|
|
1328
|
-
throw
|
|
1422
|
+
throw f("Failed to get CSRF token", e), e;
|
|
1329
1423
|
}
|
|
1330
1424
|
};
|
|
1331
|
-
async function
|
|
1425
|
+
async function rt(e) {
|
|
1332
1426
|
if (e) {
|
|
1333
1427
|
const { username: t, password: r } = e, n = {
|
|
1334
1428
|
action: "get",
|
|
@@ -1339,11 +1433,11 @@ async function et(e) {
|
|
|
1339
1433
|
noAutoAuthentication: !0
|
|
1340
1434
|
};
|
|
1341
1435
|
try {
|
|
1342
|
-
const a = await
|
|
1436
|
+
const a = await l(
|
|
1343
1437
|
"api/v1/security.webtoken",
|
|
1344
1438
|
n
|
|
1345
1439
|
);
|
|
1346
|
-
return a
|
|
1440
|
+
return a?.csrfToken ? (U(a.csrfToken), a.csrfToken) : null;
|
|
1347
1441
|
} catch (a) {
|
|
1348
1442
|
throw console.error("Failed to get JWT", a), a;
|
|
1349
1443
|
}
|
|
@@ -1354,7 +1448,7 @@ async function et(e) {
|
|
|
1354
1448
|
noUserOverride: !0,
|
|
1355
1449
|
noAutoAuthentication: !1
|
|
1356
1450
|
// Allow auto authentication for credentialless requests
|
|
1357
|
-
}, { bearerToken: r } =
|
|
1451
|
+
}, { bearerToken: r } = u;
|
|
1358
1452
|
if (!r)
|
|
1359
1453
|
throw new Error(
|
|
1360
1454
|
"Bearer token is required in globalConfig for credentialless JWT retrieval."
|
|
@@ -1362,7 +1456,7 @@ async function et(e) {
|
|
|
1362
1456
|
const n = new Headers();
|
|
1363
1457
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${r}`);
|
|
1364
1458
|
try {
|
|
1365
|
-
const a = await
|
|
1459
|
+
const a = await l(
|
|
1366
1460
|
"api/v1/security.webtoken",
|
|
1367
1461
|
t,
|
|
1368
1462
|
{ headers: n }
|
|
@@ -1373,195 +1467,204 @@ async function et(e) {
|
|
|
1373
1467
|
}
|
|
1374
1468
|
}
|
|
1375
1469
|
}
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
const e = Ke("sinequa-credentials");
|
|
1470
|
+
const H = () => {
|
|
1471
|
+
const e = Ee("sinequa-credentials");
|
|
1379
1472
|
if (e)
|
|
1380
1473
|
try {
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1474
|
+
const n = JSON.parse(e).data?.csrfToken;
|
|
1475
|
+
if (n !== void 0) return n;
|
|
1383
1476
|
} catch {
|
|
1384
1477
|
}
|
|
1385
|
-
const t =
|
|
1478
|
+
const t = Ke("csrfToken");
|
|
1386
1479
|
return t !== null ? t : null;
|
|
1387
|
-
},
|
|
1480
|
+
}, wr = async (e) => {
|
|
1388
1481
|
if (e)
|
|
1389
1482
|
S("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1390
1483
|
else {
|
|
1391
|
-
let
|
|
1484
|
+
let c = null;
|
|
1392
1485
|
try {
|
|
1393
|
-
S("Attempting to retrieve CSRF token from the backend"),
|
|
1394
|
-
} catch (
|
|
1395
|
-
|
|
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);
|
|
1396
1489
|
}
|
|
1397
1490
|
try {
|
|
1398
|
-
if (
|
|
1399
|
-
const { autoOAuthProvider:
|
|
1400
|
-
if (
|
|
1401
|
-
return S("Initiating OAuth authentication flow"), await
|
|
1402
|
-
if (
|
|
1403
|
-
return S("Initiating SAML authentication flow"), await
|
|
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;
|
|
1404
1497
|
S(
|
|
1405
1498
|
"No direct authentication method available, will try SSO then credentials"
|
|
1406
1499
|
), k({ useCredentials: !0, useSSO: !0 });
|
|
1407
1500
|
} else
|
|
1408
|
-
return S("User authenticated via existing token"),
|
|
1409
|
-
} catch (
|
|
1410
|
-
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;
|
|
1411
1504
|
}
|
|
1412
1505
|
}
|
|
1413
|
-
if (
|
|
1506
|
+
if (u.useCredentials && u.useSSO)
|
|
1414
1507
|
try {
|
|
1415
|
-
if (S("Checking if user is authenticated via SSO"), await
|
|
1416
|
-
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }),
|
|
1417
|
-
} catch (
|
|
1418
|
-
if (
|
|
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)
|
|
1419
1512
|
return S("SSO authentication failed with 401, falling back to credentials"), k({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1420
|
-
throw
|
|
1513
|
+
throw f("SSO authentication failed with unexpected error", c), p(!1), f;
|
|
1421
1514
|
}
|
|
1422
|
-
const { useSSO: r } =
|
|
1515
|
+
const { useSSO: r } = u, n = H();
|
|
1423
1516
|
if (n && n !== null || r)
|
|
1424
|
-
return S("user already authenticated", n), k({ isRedirectUrl: !1 }),
|
|
1425
|
-
const { useCredentials: a } =
|
|
1426
|
-
if (a && !
|
|
1427
|
-
return
|
|
1428
|
-
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)
|
|
1429
1522
|
try {
|
|
1430
1523
|
S("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1431
|
-
const { userOverrideActive:
|
|
1432
|
-
return k({ userOverrideActive: !1, useroverride: void 0 }), await
|
|
1433
|
-
} catch (
|
|
1434
|
-
throw
|
|
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;
|
|
1435
1528
|
}
|
|
1436
|
-
return
|
|
1529
|
+
return p(!1), f(
|
|
1437
1530
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1438
1531
|
), !1;
|
|
1439
|
-
},
|
|
1532
|
+
}, nt = async () => {
|
|
1440
1533
|
const e = new URLSearchParams({
|
|
1441
1534
|
action: "deleteWebTokenCookie",
|
|
1442
1535
|
noUserOverride: "true",
|
|
1443
1536
|
noAutoAuthentication: "true"
|
|
1444
1537
|
});
|
|
1445
|
-
return
|
|
1446
|
-
},
|
|
1447
|
-
const { useCredentials: e, userOverrideActive: t } =
|
|
1448
|
-
|
|
1449
|
-
},
|
|
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();
|
|
1450
1543
|
export {
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1544
|
+
Kt as API,
|
|
1545
|
+
v as ApiError,
|
|
1546
|
+
jt as Audit,
|
|
1547
|
+
b as AuditEventType,
|
|
1548
|
+
we as DidYouMeanKind,
|
|
1549
|
+
h as EngineType,
|
|
1456
1550
|
g as EngineTypeModifier,
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
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,
|
|
1482
1578
|
Ot as expiresSoon,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1579
|
+
It as extraColumns,
|
|
1580
|
+
Qt as fetchAggregation,
|
|
1581
|
+
Vt as fetchApp,
|
|
1582
|
+
Ae as fetchAppPreLogin,
|
|
1583
|
+
Et as fetchBulkQuery,
|
|
1584
|
+
ur as fetchChangePassword,
|
|
1489
1585
|
zt as fetchDataset,
|
|
1490
1586
|
Jt as fetchDatasetList,
|
|
1491
1587
|
Ht as fetchDatasets,
|
|
1492
1588
|
Wt as fetchLabels,
|
|
1493
|
-
|
|
1589
|
+
Xt as fetchPreview,
|
|
1494
1590
|
Yt as fetchPreviewUrl,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
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,
|
|
1505
1604
|
sr as fetchTextChunks,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
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,
|
|
1516
1616
|
At as getMetadata,
|
|
1517
1617
|
Nt as getMetadataWithValues,
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
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,
|
|
1528
1629
|
C as handleResponse,
|
|
1529
1630
|
S as info,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
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,
|
|
1536
1638
|
A as isObject,
|
|
1537
1639
|
ye as isString,
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
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,
|
|
1547
1650
|
cr as patchUserSettings,
|
|
1548
|
-
|
|
1651
|
+
l as post,
|
|
1549
1652
|
Pt as put,
|
|
1550
1653
|
R as queryParamsFromUrl,
|
|
1551
|
-
|
|
1552
|
-
|
|
1654
|
+
ut as removeConcept,
|
|
1655
|
+
dt as removeConcepts,
|
|
1553
1656
|
Ut as resolveToColumnName,
|
|
1554
|
-
|
|
1555
|
-
|
|
1657
|
+
Q as rewriteText,
|
|
1658
|
+
Me as saveUserSettings,
|
|
1556
1659
|
k as setGlobalConfig,
|
|
1557
1660
|
U as setToken,
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
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,
|
|
1565
1668
|
P as warn,
|
|
1566
1669
|
$t as withRetry
|
|
1567
1670
|
};
|