@sinequa/atomic 2.0.4 → 2.0.6
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.cjs +1 -1
- package/dist/atomic.js +2 -2
- package/dist/authentication/session/auth-state.d.ts +14 -0
- package/dist/authentication/session/auth-state.d.ts.map +1 -0
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/authentication/session/logout.d.ts.map +1 -1
- package/dist/authentication/session/user-authentication.d.ts +4 -0
- package/dist/authentication/session/user-authentication.d.ts.map +1 -1
- package/dist/helpers/filters.d.ts +27 -1
- package/dist/helpers/filters.d.ts.map +1 -1
- package/dist/spfx/index.cjs +1 -1
- package/dist/spfx/index.js +2 -2
- package/dist/src-C1ETFeVe.cjs +1 -0
- package/dist/{src-BW4JX9K-.js → src-xJ8mp2hN.js} +467 -430
- package/dist/web-api/helpers/index.d.ts +1 -0
- package/dist/web-api/helpers/index.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts +16 -0
- package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/src-U6mXZKpZ.cjs +0 -1
|
@@ -156,23 +156,23 @@ function ne(e, t) {
|
|
|
156
156
|
function re(e, t, n) {
|
|
157
157
|
return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return e.items &&= e.items.map((e) =>
|
|
159
|
+
function ie(e) {
|
|
160
|
+
return e.items &&= e.items.map((e) => ie(e)), e.items && e.items.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ae(e, t) {
|
|
163
163
|
let n = [];
|
|
164
164
|
if (e.length > 0) {
|
|
165
165
|
let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp("\\b" + i, "i");
|
|
166
166
|
e.forEach((e) => {
|
|
167
167
|
if (e.display.length > 1) {
|
|
168
168
|
let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
|
|
169
|
-
|
|
169
|
+
oe(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
return n;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function oe(e, t, n, r, i, a, o) {
|
|
176
176
|
let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
|
|
177
177
|
if (!l) {
|
|
178
178
|
let u = c.replace(/^\/|\/$/g, "");
|
|
@@ -186,11 +186,11 @@ function ae(e, t, n, r, i, a, o) {
|
|
|
186
186
|
$path: u
|
|
187
187
|
}, t.set(c, l), e.push(l);
|
|
188
188
|
}
|
|
189
|
-
c.length < r.length && (l.hasChildren = !0,
|
|
189
|
+
c.length < r.length && (l.hasChildren = !0, oe(l.items, t, c, r, i, a + 1, o));
|
|
190
190
|
}
|
|
191
191
|
//#endregion
|
|
192
192
|
//#region src/utils/bisect.ts
|
|
193
|
-
function
|
|
193
|
+
function se(e, t) {
|
|
194
194
|
return e.reduce((e, n) => (t(n) ? e.true.push(n) : e.false.push(n), e), {
|
|
195
195
|
true: [],
|
|
196
196
|
false: []
|
|
@@ -198,34 +198,34 @@ function oe(e, t) {
|
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/utils/concepts.ts
|
|
201
|
-
var
|
|
202
|
-
function
|
|
201
|
+
var ce = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, le = 2, ue = 3, de = 5, fe = 6, pe = 8, me = 9, he = 11, ge = 12, _e = 14, ve = 15;
|
|
202
|
+
function f(e) {
|
|
203
203
|
if (!e) return [];
|
|
204
|
-
let t = [], n = e.matchAll(
|
|
205
|
-
for (let e of n) e[
|
|
204
|
+
let t = [], n = e.matchAll(ce);
|
|
205
|
+
for (let e of n) e[ue] ? t.push({
|
|
206
206
|
type: "group",
|
|
207
|
-
value: e[
|
|
208
|
-
op: e[
|
|
209
|
-
}) : e[
|
|
207
|
+
value: e[ue],
|
|
208
|
+
op: e[le]
|
|
209
|
+
}) : e[fe] ? t.push({
|
|
210
210
|
type: "adjacent",
|
|
211
|
-
value: e[
|
|
212
|
-
op: e[
|
|
213
|
-
}) : e[p] ? t.push({
|
|
214
|
-
type: "exact",
|
|
215
|
-
value: e[p],
|
|
216
|
-
op: e[fe]
|
|
211
|
+
value: e[fe],
|
|
212
|
+
op: e[de]
|
|
217
213
|
}) : e[me] ? t.push({
|
|
218
|
-
type: "
|
|
214
|
+
type: "exact",
|
|
219
215
|
value: e[me],
|
|
220
216
|
op: e[pe]
|
|
221
|
-
}) : e[ge]
|
|
222
|
-
type: "
|
|
217
|
+
}) : e[ge] ? t.push({
|
|
218
|
+
type: "regex",
|
|
223
219
|
value: e[ge],
|
|
224
220
|
op: e[he]
|
|
221
|
+
}) : e[ve] && t.push({
|
|
222
|
+
type: "token",
|
|
223
|
+
value: e[ve],
|
|
224
|
+
op: e[_e]
|
|
225
225
|
});
|
|
226
226
|
return t;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function p(e) {
|
|
229
229
|
return e.map((e) => {
|
|
230
230
|
let t = e.op || "";
|
|
231
231
|
switch (e.type) {
|
|
@@ -237,32 +237,32 @@ function h(e) {
|
|
|
237
237
|
}
|
|
238
238
|
}).join(" ");
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
let r =
|
|
240
|
+
function ye(e, t, n) {
|
|
241
|
+
let r = f(e);
|
|
242
242
|
for (let e of t) r.push({
|
|
243
243
|
type: "adjacent",
|
|
244
244
|
value: e,
|
|
245
245
|
op: n
|
|
246
246
|
});
|
|
247
|
-
return
|
|
247
|
+
return p(r);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
let n =
|
|
251
|
-
return r === -1 ? t : (n.splice(r, 1), t =
|
|
249
|
+
function be(e, t) {
|
|
250
|
+
let n = f(t), r = n.findIndex((t) => t.value === e);
|
|
251
|
+
return r === -1 ? t : (n.splice(r, 1), t = p(n));
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
return
|
|
253
|
+
function xe(e) {
|
|
254
|
+
return p(f(e).filter((e) => e.type !== "adjacent"));
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
256
|
+
function Se(e) {
|
|
257
|
+
return f(e).filter((e) => e.type === "adjacent").map((e) => e.value);
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/utils/date.ts
|
|
261
|
-
function
|
|
262
|
-
let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } =
|
|
261
|
+
function Ce(e, t, n) {
|
|
262
|
+
let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = we(t, n);
|
|
263
263
|
return r.format(i * (o ? 1 : -1), a);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function we(e, t) {
|
|
266
266
|
let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime());
|
|
267
267
|
return {
|
|
268
268
|
offset: Math.floor(i / (1e3 * 60 * 60 * 24)),
|
|
@@ -272,19 +272,19 @@ function Se(e, t) {
|
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region src/utils/is-not-input-event.ts
|
|
275
|
-
function
|
|
275
|
+
function Te(e) {
|
|
276
276
|
let t = e.target;
|
|
277
277
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
278
278
|
}
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/utils/query-params.ts
|
|
281
|
-
function
|
|
281
|
+
function Ee(e) {
|
|
282
282
|
if (e === void 0) return;
|
|
283
|
-
let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } =
|
|
283
|
+
let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = h(e), [c] = e.split("?");
|
|
284
284
|
return {
|
|
285
285
|
path: c,
|
|
286
286
|
text: t,
|
|
287
|
-
filters: n ?
|
|
287
|
+
filters: n ? m(n) : void 0,
|
|
288
288
|
page: r ? parseInt(r, 10) : void 0,
|
|
289
289
|
sort: i,
|
|
290
290
|
tab: a,
|
|
@@ -292,17 +292,17 @@ function we(e) {
|
|
|
292
292
|
basket: s
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function De(e) {
|
|
296
296
|
if (!e) return "";
|
|
297
297
|
let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
|
|
298
298
|
return t && (c.q = t), n && (c.f = JSON.stringify(n)), r && (c.p = r.toString()), i && (c.s = i), a && (c.t = a), o && (c.n = o), s && (c.b = s), new URLSearchParams(c).toString() || "";
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function Oe(e) {
|
|
301
301
|
if (e === void 0) return [];
|
|
302
|
-
let { f: t } =
|
|
303
|
-
return
|
|
302
|
+
let { f: t } = h(e);
|
|
303
|
+
return m(t);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function m(e) {
|
|
306
306
|
let t = decodeURIComponent(e);
|
|
307
307
|
try {
|
|
308
308
|
return JSON.parse(t ?? "[]");
|
|
@@ -310,47 +310,47 @@ function g(e) {
|
|
|
310
310
|
return console.error(`Error parsing filters from URI: ${e}`), [];
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function h(e) {
|
|
314
314
|
let t = e.split("?")[1];
|
|
315
315
|
if (t === void 0) return {};
|
|
316
316
|
let n = new URLSearchParams(t);
|
|
317
317
|
return Object.fromEntries(n);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
let { q: t = "" } =
|
|
319
|
+
function ke(e) {
|
|
320
|
+
let { q: t = "" } = h(e);
|
|
321
321
|
return t;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
let { id: t } =
|
|
323
|
+
function Ae(e) {
|
|
324
|
+
let { id: t } = h(e);
|
|
325
325
|
return decodeURIComponent(t);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let { p: t = "0" } =
|
|
327
|
+
function je(e) {
|
|
328
|
+
let { p: t = "0" } = h(e);
|
|
329
329
|
return parseInt(t, 10);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
let { t } =
|
|
331
|
+
function Me(e) {
|
|
332
|
+
let { t } = h(e);
|
|
333
333
|
return t;
|
|
334
334
|
}
|
|
335
335
|
//#endregion
|
|
336
336
|
//#region src/utils/syslang.ts
|
|
337
|
-
function
|
|
337
|
+
function Ne(e, t) {
|
|
338
338
|
if (!e) return e;
|
|
339
339
|
let n = 0, r = e.length, i = 0;
|
|
340
340
|
if (e[i] === "[") {
|
|
341
341
|
for (; i < r && /[0-9]/.test(e[i]);) i++;
|
|
342
342
|
e[i] === "]" && (n = i + 1);
|
|
343
343
|
}
|
|
344
|
-
let a =
|
|
344
|
+
let a = g(e, n, !1);
|
|
345
345
|
if (!a) return e;
|
|
346
346
|
let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
|
|
347
347
|
for (; c;) if (o === c.lang1 && s === c.lang2) {
|
|
348
|
-
let t =
|
|
348
|
+
let t = g(e, c.end + 4, !0);
|
|
349
349
|
return e.substring(t.start, t.end);
|
|
350
|
-
} else c =
|
|
350
|
+
} else c = g(e, c.end + 4, !1);
|
|
351
351
|
return e.substring(a.start, a.end) || e;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function g(e, t, n) {
|
|
354
354
|
for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
|
|
355
355
|
start: t,
|
|
356
356
|
end: n,
|
|
@@ -366,7 +366,7 @@ function v(e, t, n) {
|
|
|
366
366
|
}
|
|
367
367
|
//#endregion
|
|
368
368
|
//#region src/utils/utilities.ts
|
|
369
|
-
function
|
|
369
|
+
function Pe(e, t) {
|
|
370
370
|
let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
|
|
371
371
|
return [
|
|
372
372
|
a,
|
|
@@ -376,7 +376,7 @@ function Me(e, t) {
|
|
|
376
376
|
}
|
|
377
377
|
//#endregion
|
|
378
378
|
//#region src/utils/notification.ts
|
|
379
|
-
function
|
|
379
|
+
function _(e) {
|
|
380
380
|
let t = new CustomEvent("notification", {
|
|
381
381
|
bubbles: !0,
|
|
382
382
|
cancelable: !1,
|
|
@@ -384,51 +384,51 @@ function y(e) {
|
|
|
384
384
|
});
|
|
385
385
|
dispatchEvent(t);
|
|
386
386
|
}
|
|
387
|
-
var
|
|
387
|
+
var Fe = {
|
|
388
388
|
success: (e, t) => {
|
|
389
|
-
|
|
389
|
+
_({
|
|
390
390
|
type: "success",
|
|
391
391
|
message: e,
|
|
392
392
|
options: t
|
|
393
393
|
});
|
|
394
394
|
},
|
|
395
395
|
info: (e, t) => {
|
|
396
|
-
|
|
396
|
+
_({
|
|
397
397
|
type: "info",
|
|
398
398
|
message: e,
|
|
399
399
|
options: t
|
|
400
400
|
});
|
|
401
401
|
},
|
|
402
402
|
warning: (e, t) => {
|
|
403
|
-
|
|
403
|
+
_({
|
|
404
404
|
type: "warning",
|
|
405
405
|
message: e,
|
|
406
406
|
options: t
|
|
407
407
|
});
|
|
408
408
|
},
|
|
409
409
|
error: (e, t) => {
|
|
410
|
-
|
|
410
|
+
_({
|
|
411
411
|
type: "error",
|
|
412
412
|
message: e,
|
|
413
413
|
options: t
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
},
|
|
416
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
417
417
|
return 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;
|
|
418
|
-
}({}),
|
|
418
|
+
}({}), v = {
|
|
419
419
|
level: 1,
|
|
420
420
|
enableConsoleOutput: !0
|
|
421
421
|
};
|
|
422
|
-
function
|
|
423
|
-
|
|
424
|
-
...
|
|
422
|
+
function Le(e) {
|
|
423
|
+
v = {
|
|
424
|
+
...v,
|
|
425
425
|
...e
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
if (e <
|
|
430
|
-
let r = `${`[${
|
|
431
|
-
if (
|
|
428
|
+
function y(e, t, n) {
|
|
429
|
+
if (e < v.level) return;
|
|
430
|
+
let r = `${`[${Ie[e]}]`} ${t}`;
|
|
431
|
+
if (v.enableConsoleOutput) switch (e) {
|
|
432
432
|
case 0:
|
|
433
433
|
console.debug(r, n || "");
|
|
434
434
|
break;
|
|
@@ -443,51 +443,51 @@ function x(e, t, n) {
|
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
446
|
+
function b(e, t) {
|
|
447
|
+
y(0, e, t);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
|
|
449
|
+
function x(e, t) {
|
|
450
|
+
y(1, e, t);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
|
|
452
|
+
function S(e, t) {
|
|
453
|
+
y(2, e, t);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
|
|
455
|
+
function C(e, t) {
|
|
456
|
+
y(3, e, t);
|
|
457
457
|
}
|
|
458
458
|
//#endregion
|
|
459
459
|
//#region src/web-api/helpers/create-headers.ts
|
|
460
|
-
function
|
|
461
|
-
let t =
|
|
460
|
+
function w(e) {
|
|
461
|
+
let t = Q(), n = new Headers(e);
|
|
462
462
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), t && n.append("Sinequa-csrf-token", t);
|
|
463
463
|
let { userOverride: i, userOverrideActive: a, bearerToken: o } = r;
|
|
464
464
|
return o && n.append("Authorization", `Bearer ${o}`), i && a && (n.append("sinequa-override-user", i.username), n.append("sinequa-override-domain", i.domain)), n;
|
|
465
465
|
}
|
|
466
466
|
//#endregion
|
|
467
467
|
//#region src/web-api/helpers/errors/api-error.ts
|
|
468
|
-
var
|
|
468
|
+
var T = class extends Error {
|
|
469
469
|
status;
|
|
470
470
|
constructor(e, t) {
|
|
471
471
|
super(e), this.name = "ApiError", this.status = t;
|
|
472
472
|
}
|
|
473
|
-
},
|
|
473
|
+
}, E = class extends T {
|
|
474
474
|
constructor(e = "Server error") {
|
|
475
475
|
super(e, 500), this.name = "ServerError";
|
|
476
476
|
}
|
|
477
|
-
},
|
|
477
|
+
}, Re = class extends T {
|
|
478
478
|
constructor(e = "Request timed out") {
|
|
479
479
|
super(e, 408), this.name = "TimeoutError";
|
|
480
480
|
}
|
|
481
|
-
},
|
|
481
|
+
}, D = class extends T {
|
|
482
482
|
constructor(e = "Unauthorized access") {
|
|
483
483
|
super(e, 401), this.name = "UnauthorizedError";
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
486
|
//#endregion
|
|
487
487
|
//#region src/web-api/helpers/handle-response.ts
|
|
488
|
-
async function
|
|
488
|
+
async function O(e, t = "json") {
|
|
489
489
|
let n = e.headers.get("sinequa-jwt-refresh");
|
|
490
|
-
if (n !== null &&
|
|
490
|
+
if (n !== null && Y(n), e.status === 200) switch (t) {
|
|
491
491
|
case "arraybuffer": return await e.arrayBuffer();
|
|
492
492
|
case "blob": return await e.blob();
|
|
493
493
|
case "text": return await e.text();
|
|
@@ -499,32 +499,32 @@ async function A(e, t = "json") {
|
|
|
499
499
|
try {
|
|
500
500
|
t = await (e.clone?.() ?? e).json();
|
|
501
501
|
} catch {}
|
|
502
|
-
throw
|
|
502
|
+
throw S("Unauthorized access attempt with user override", {
|
|
503
503
|
endpoint: e.url ?? "",
|
|
504
504
|
error: t
|
|
505
|
-
}), new
|
|
505
|
+
}), new D(t.errorMessage ?? t.message ?? "Unauthorized... User override failed.");
|
|
506
506
|
}
|
|
507
|
-
return await
|
|
507
|
+
return await k(e, 401);
|
|
508
508
|
}
|
|
509
|
-
return e.status === 500 ? (
|
|
509
|
+
return e.status === 500 ? (C("Server error occurred", { endpoint: e.url ?? "" }), await k(e, 500)) : (S(`Unexpected response status: ${e.status}`, { endpoint: e.url ?? "" }), await k(e, e.status));
|
|
510
510
|
}
|
|
511
|
-
async function
|
|
511
|
+
async function k(e, t) {
|
|
512
512
|
try {
|
|
513
513
|
let { done: n, value: r } = await e.body?.getReader().read() || {
|
|
514
514
|
done: !0,
|
|
515
515
|
value: void 0
|
|
516
516
|
};
|
|
517
|
-
if (n || !r) throw t === 401 ? new
|
|
517
|
+
if (n || !r) throw t === 401 ? new D() : t === 500 ? new E() : new T(`Request failed with status ${t}`, t);
|
|
518
518
|
let i = JSON.parse(new TextDecoder().decode(r));
|
|
519
519
|
throw Error(i.errorMessage || i.message || `Request failed with status ${t}`, { cause: {
|
|
520
520
|
errorCode: i.errorCode,
|
|
521
521
|
errorCodeTest: i.errorCodeTest
|
|
522
522
|
} });
|
|
523
523
|
} catch (e) {
|
|
524
|
-
throw e instanceof
|
|
524
|
+
throw e instanceof T ? e : t === 401 ? new D(e.message) : t === 500 ? new E(e.message) : new T(e.message ?? `Request failed with status ${t}`, t);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
var
|
|
527
|
+
var A = new class {
|
|
528
528
|
client = null;
|
|
529
529
|
initialize(e) {
|
|
530
530
|
this.client = e;
|
|
@@ -537,47 +537,47 @@ var M = new class {
|
|
|
537
537
|
return this.client !== null;
|
|
538
538
|
}
|
|
539
539
|
}();
|
|
540
|
-
function
|
|
541
|
-
|
|
540
|
+
function ze(e) {
|
|
541
|
+
A.initialize(e);
|
|
542
542
|
}
|
|
543
543
|
//#endregion
|
|
544
544
|
//#region src/web-api/helpers/methods/del.ts
|
|
545
|
-
async function
|
|
546
|
-
let i =
|
|
547
|
-
|
|
545
|
+
async function Be(e, t, n) {
|
|
546
|
+
let i = w(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "", s = a ? `${a}/${e}${o}` : `${e}${o}`;
|
|
547
|
+
b(`Making DELETE request to: ${s}`);
|
|
548
548
|
try {
|
|
549
|
-
if (
|
|
550
|
-
let e =
|
|
551
|
-
return
|
|
549
|
+
if (A.isInitialized()) {
|
|
550
|
+
let e = A.getClient();
|
|
551
|
+
return O(await e.fetch(s, e.constructor.configurations.v1, {
|
|
552
552
|
method: "DELETE",
|
|
553
553
|
headers: i
|
|
554
554
|
}), n?.responseType);
|
|
555
555
|
}
|
|
556
|
-
return
|
|
556
|
+
return O(await fetch(s, {
|
|
557
557
|
method: "DELETE",
|
|
558
558
|
credentials: "include",
|
|
559
559
|
headers: i
|
|
560
560
|
}), n?.responseType);
|
|
561
561
|
} catch (e) {
|
|
562
|
-
throw
|
|
562
|
+
throw C("Error making DELETE request:", e), e;
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
//#endregion
|
|
566
566
|
//#region src/web-api/helpers/methods/get.ts
|
|
567
|
-
async function
|
|
568
|
-
let i =
|
|
567
|
+
async function j(e, t, n) {
|
|
568
|
+
let i = w(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "";
|
|
569
569
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
570
570
|
let s = a ? `${a}/${e}${o}` : `${e}${o}`;
|
|
571
|
-
|
|
571
|
+
b(`Making GET request to: ${s}`);
|
|
572
572
|
try {
|
|
573
|
-
if (
|
|
574
|
-
let e =
|
|
575
|
-
return
|
|
573
|
+
if (A.isInitialized()) {
|
|
574
|
+
let e = A.getClient();
|
|
575
|
+
return O(await e.get(s, e.constructor.configurations.v1, {
|
|
576
576
|
headers: i,
|
|
577
577
|
signal: n?.signal
|
|
578
578
|
}), n?.responseType);
|
|
579
579
|
}
|
|
580
|
-
return
|
|
580
|
+
return O(await fetch(s, {
|
|
581
581
|
method: "GET",
|
|
582
582
|
credentials: "include",
|
|
583
583
|
headers: i,
|
|
@@ -585,66 +585,71 @@ async function P(e, t, n) {
|
|
|
585
585
|
redirect: n?.redirect
|
|
586
586
|
}), n?.responseType);
|
|
587
587
|
} catch (e) {
|
|
588
|
-
throw
|
|
588
|
+
throw C("Error making GET request:", e), e;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
//#endregion
|
|
592
|
+
//#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
|
|
593
|
+
function M() {
|
|
594
|
+
return r.authMode?.kind !== "sso";
|
|
595
|
+
}
|
|
596
|
+
//#endregion
|
|
592
597
|
//#region src/web-api/helpers/methods/patch.ts
|
|
593
|
-
async function
|
|
594
|
-
let i =
|
|
598
|
+
async function Ve(e, t, n) {
|
|
599
|
+
let i = w(n?.headers);
|
|
595
600
|
i.append("content-type", "application/json");
|
|
596
601
|
let { app: a, backendUrl: o } = r, s = {
|
|
597
602
|
app: a,
|
|
598
603
|
...t,
|
|
599
604
|
locale: t.locale || navigator.language,
|
|
600
605
|
noUserOverride: !0,
|
|
601
|
-
noAutoAuthentication:
|
|
606
|
+
noAutoAuthentication: M()
|
|
602
607
|
}, c = o ? `${o}/${e}` : `${e}`;
|
|
603
|
-
|
|
608
|
+
b(`Making PATCH request to: ${c}`);
|
|
604
609
|
try {
|
|
605
|
-
if (
|
|
606
|
-
let e =
|
|
607
|
-
return
|
|
610
|
+
if (A.isInitialized()) {
|
|
611
|
+
let e = A.getClient();
|
|
612
|
+
return O(await e.fetch(c, e.constructor.configurations.v1, {
|
|
608
613
|
method: "PATCH",
|
|
609
614
|
headers: i,
|
|
610
615
|
body: JSON.stringify(s)
|
|
611
616
|
}), n?.responseType);
|
|
612
617
|
}
|
|
613
|
-
return
|
|
618
|
+
return O(await fetch(c, {
|
|
614
619
|
method: "PATCH",
|
|
615
620
|
headers: i,
|
|
616
621
|
credentials: "include",
|
|
617
622
|
body: JSON.stringify(s)
|
|
618
623
|
}), n?.responseType);
|
|
619
624
|
} catch (e) {
|
|
620
|
-
throw
|
|
625
|
+
throw C("Error making PATCH request:", e), e;
|
|
621
626
|
}
|
|
622
627
|
}
|
|
623
628
|
//#endregion
|
|
624
629
|
//#region src/web-api/helpers/methods/post.ts
|
|
625
|
-
async function
|
|
626
|
-
let i =
|
|
630
|
+
async function N(e, t, n) {
|
|
631
|
+
let i = w(n?.headers), { app: a, backendUrl: o } = r;
|
|
627
632
|
i.has("Content-Type") || i.set("Content-Type", "application/json");
|
|
628
633
|
let s = {
|
|
629
634
|
app: a,
|
|
630
635
|
...t,
|
|
631
636
|
locale: t.locale || navigator.language,
|
|
632
637
|
noUserOverride: !0,
|
|
633
|
-
noAutoAuthentication:
|
|
638
|
+
noAutoAuthentication: M()
|
|
634
639
|
};
|
|
635
640
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
636
641
|
let c = o ? `${o}/${e}` : `${e}`;
|
|
637
|
-
|
|
642
|
+
b(`Making POST request to: ${c}`);
|
|
638
643
|
try {
|
|
639
|
-
if (
|
|
640
|
-
let e =
|
|
641
|
-
return
|
|
644
|
+
if (A.isInitialized()) {
|
|
645
|
+
let e = A.getClient();
|
|
646
|
+
return O(await e.post(c, e.constructor.configurations.v1, {
|
|
642
647
|
headers: i,
|
|
643
648
|
body: JSON.stringify(s),
|
|
644
649
|
signal: n?.signal
|
|
645
650
|
}), n?.responseType);
|
|
646
651
|
}
|
|
647
|
-
return
|
|
652
|
+
return O(await fetch(c, {
|
|
648
653
|
method: "POST",
|
|
649
654
|
headers: i,
|
|
650
655
|
credentials: "include",
|
|
@@ -652,45 +657,45 @@ async function F(e, t, n) {
|
|
|
652
657
|
signal: n?.signal
|
|
653
658
|
}), n?.responseType);
|
|
654
659
|
} catch (e) {
|
|
655
|
-
throw
|
|
660
|
+
throw C("Error making POST request:", e), e;
|
|
656
661
|
}
|
|
657
662
|
}
|
|
658
663
|
//#endregion
|
|
659
664
|
//#region src/web-api/helpers/methods/put.ts
|
|
660
|
-
async function
|
|
661
|
-
let i =
|
|
665
|
+
async function He(e, t, n) {
|
|
666
|
+
let i = w(n?.headers), { app: a, backendUrl: o } = r, s = {
|
|
662
667
|
app: a,
|
|
663
668
|
...t,
|
|
664
669
|
locale: t.locale || navigator.language,
|
|
665
670
|
noUserOverride: !0,
|
|
666
|
-
noAutoAuthentication:
|
|
671
|
+
noAutoAuthentication: M()
|
|
667
672
|
}, c = `${o}/${e}`;
|
|
668
|
-
|
|
673
|
+
b(`Making PUT request to: ${c}`);
|
|
669
674
|
try {
|
|
670
|
-
if (
|
|
671
|
-
let e =
|
|
672
|
-
return
|
|
675
|
+
if (A.isInitialized()) {
|
|
676
|
+
let e = A.getClient();
|
|
677
|
+
return O(await e.fetch(c, e.constructor.configurations.v1, {
|
|
673
678
|
method: "PUT",
|
|
674
679
|
headers: i,
|
|
675
680
|
body: JSON.stringify(s)
|
|
676
681
|
}), n?.responseType);
|
|
677
682
|
}
|
|
678
|
-
return
|
|
683
|
+
return O(await fetch(c, {
|
|
679
684
|
method: "PUT",
|
|
680
685
|
headers: i,
|
|
681
686
|
credentials: "include",
|
|
682
687
|
body: JSON.stringify(s)
|
|
683
688
|
}), n?.responseType);
|
|
684
689
|
} catch (e) {
|
|
685
|
-
throw
|
|
690
|
+
throw C("Error making PUT request:", e), e;
|
|
686
691
|
}
|
|
687
692
|
}
|
|
688
693
|
//#endregion
|
|
689
694
|
//#region src/web-api/helpers/utils/create-timeout-controller.ts
|
|
690
|
-
function
|
|
695
|
+
function P(e) {
|
|
691
696
|
let t = new AbortController(), { signal: n } = t;
|
|
692
697
|
return e && setTimeout(() => {
|
|
693
|
-
n.aborted || t.abort(new
|
|
698
|
+
n.aborted || t.abort(new Re(`Request timed out after ${e}ms`));
|
|
694
699
|
}, e), {
|
|
695
700
|
controller: t,
|
|
696
701
|
signal: n
|
|
@@ -698,36 +703,36 @@ function I(e) {
|
|
|
698
703
|
}
|
|
699
704
|
//#endregion
|
|
700
705
|
//#region src/web-api/helpers/utils/date-utils..ts
|
|
701
|
-
function
|
|
706
|
+
function F(e) {
|
|
702
707
|
if (!e) return;
|
|
703
708
|
let t = new Date(e);
|
|
704
709
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
705
710
|
}
|
|
706
|
-
function
|
|
707
|
-
let t =
|
|
711
|
+
function Ue(e) {
|
|
712
|
+
let t = F(e);
|
|
708
713
|
return !!t && t.getTime() <= Date.now();
|
|
709
714
|
}
|
|
710
|
-
function
|
|
711
|
-
let n =
|
|
715
|
+
function We(e, t = 7) {
|
|
716
|
+
let n = F(e);
|
|
712
717
|
if (!n) return !1;
|
|
713
718
|
let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
|
|
714
719
|
return a > r && a <= i;
|
|
715
720
|
}
|
|
716
721
|
//#endregion
|
|
717
722
|
//#region src/web-api/helpers/utils/with-retry.ts
|
|
718
|
-
async function
|
|
723
|
+
async function Ge(e, t = 0, n = 1e3) {
|
|
719
724
|
let r;
|
|
720
725
|
for (let i = 0; i <= t; i++) try {
|
|
721
726
|
return await e();
|
|
722
727
|
} catch (e) {
|
|
723
|
-
if (r = e, e instanceof
|
|
724
|
-
i < t && (
|
|
728
|
+
if (r = e, e instanceof T && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
|
|
729
|
+
i < t && (S(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
|
|
725
730
|
}
|
|
726
731
|
throw r;
|
|
727
732
|
}
|
|
728
733
|
//#endregion
|
|
729
734
|
//#region src/helpers/column-resolver.ts
|
|
730
|
-
function
|
|
735
|
+
function Ke(e, t, n) {
|
|
731
736
|
if (!e || !t) return;
|
|
732
737
|
if (n) {
|
|
733
738
|
let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
|
|
@@ -740,93 +745,93 @@ function Ue(e, t, n) {
|
|
|
740
745
|
}
|
|
741
746
|
//#endregion
|
|
742
747
|
//#region src/types/audit/AuditEventType.ts
|
|
743
|
-
var
|
|
748
|
+
var I = /* @__PURE__ */ function(e) {
|
|
744
749
|
return e.None = "None", e.Search_FirstPage = "Search_FirstPage", e.Search_Text = "Search_Text", e.Search_Refine = "Search_Refine", e.Search_Select_Item = "Search_Select_Item", e.Search_Select_Custom = "Search_Select_Custom", e.Search_Select_Concept = "Search_Select_Concept", e.Search_Select_Correction = "Search_Select_Correction", e.Search_GotoPage = "Search_GotoPage", e.Search_GotoTab = "Search_GotoTab", e.Search_DisplayResult = "Search_DisplayResult", e.Search_RemoveResult = "Search_RemoveResult", e.Search_RemoveAdvanced = "Search_RemoveAdvanced", e.Search_SavedQuery = "Search_SavedQuery", e.Search_WebService = "Search_WebService", e.Search_DidYouMean_Original = "Search_DidYouMean_Original", e.Search_DidYouMean_Correction = "Search_DidYouMean_Correction", e.Search_ExportCSV = "Search_ExportCSV", e.Search_SavedQuery_ExportCSV = "Search_SavedQuery_ExportCSV", e.Search_Selection_ExportCSV = "Search_Selection_ExportCSV", e.Search_AlertQuery = "Search_AlertQuery", e.Search_Select_AnalyticsItem = "Search_Select_AnalyticsItem", e.Search_Sort = "Search_Sort", e.Search_Exit_Logout = "Search_Exit_Logout", e.Search_Timeline_Usage = "Search_Timeline_Usage", e.Search_AutoComplete = "Search_Autocomplete", e.Search_Login_Success = "Login_Success_Form", e.Search_QueryIntent_Detected = "Search_QueryIntent_Detected", e.SavedQuery_Add = "SavedQuery_Add", e.SavedQuery_Delete = "SavedQuery_Delete", e.SavedQuery_DeleteAll = "SavedQuery_DeleteAll", e.SavedQuery_Rename = "SavedQuery_Rename", e.Alert_Edit = "Alert_Edit", e.Alert_Delete = "Alert_Delete", e.Alert_DeleteAll = "Alert_DeleteAll", e.Link_Display = "Link_Display", e.Link_Click = "Link_Click", e.Basket_Add = "Basket_Add", e.Basket_Delete = "Basket_Delete", e.Basket_DeleteAll = "Basket_DeleteAll", e.Basket_Rename = "Basket_Rename", e.Basket_AddDoc = "Basket_AddDoc", e.Basket_RemoveDoc = "Basket_RemoveDoc", e.Basket_Open = "Basket_Open", e.Basket_ExportCSV = "Basket_ExportCSV", e.Label_Add = "Label_Add", e.Label_Delete = "Label_Delete", e.Label_Rename = "Label_Rename", e.Label_Open = "Label_Open", e.Label_AddDoc = "Label_AddDoc", e.Label_RemoveDoc = "Label_RemoveDoc", e.Label_ExportCSV = "Label_ExportCSV", e.Label_Menu_ExportCSV = "Label_Menu_ExportCSV", e.Rating_Set = "Rating_Set", e.Rating_Delete = "Rating_Delete", e.Doc_Preview = "Doc_Preview", e.Doc_CacheHtml = "Doc_CacheHtml", e.Doc_CachePdf = "Doc_CachePdf", e.Doc_CacheOriginal = "Doc_CacheOriginal", e.Doc_Url1 = "Doc_Url1", e.Doc_Url2 = "Doc_Url2", e.Preview_Close = "Preview_Close", e.Click_ResultLink = "Click_ResultLink", e.Click_ResultLink1 = "Click_ResultLink1", e.Click_ResultLink2 = "Click_ResultLink2", e.Click_ResultLink3 = "Click_ResultLink3", e.Click_ResultLink4 = "Click_ResultLink4", e.Click_ResultLink5 = "Click_ResultLink5", e.Click_ResultLink6 = "Click_ResultLink6", e.Click_ResultLink7 = "Click_ResultLink7", e.Click_ResultLink8 = "Click_ResultLink8", e.Click_ResultLink9 = "Click_ResultLink9", e.Click_ResultLink10 = "Click_ResultLink10", e.Click_PreviewLink1 = "Click_PreviewLink1", e.Click_PreviewLink2 = "Click_PreviewLink2", e.Click_PreviewLink3 = "Click_PreviewLink3", e.Click_PreviewLink4 = "Click_PreviewLink4", e.Click_PreviewLink5 = "Click_PreviewLink5", e.Click_PreviewLink6 = "Click_PreviewLink6", e.Click_PreviewLink7 = "Click_PreviewLink7", e.Click_PreviewLink8 = "Click_PreviewLink8", e.Click_PreviewLink9 = "Click_PreviewLink9", e.Click_PreviewLink10 = "Click_PreviewLink10", e.RFM_ClickSet = "RFM_ClickSet", e.RFM_ClickReset = "RFM_ClickReset", e.RFM_Like = "RFM_Like", e.RFM_LikeReset = "RFM_LikeReset", e.RFM_Dislike = "RFM_Dislike", e.RFM_Important = "RFM_Important", e.RFM_ImportantReset = "RFM_ImportantReset", e.RFM_Ban = "RFM_Ban", e.Navigation_Exit = "Navigation_Exit", e.Navigation_Return = "Navigation_Return", e.Navigation_Route = "Navigation_Route", e.Answer_Display = "Answer_Display", e.Answer_Click = "Answer_Click", e.Answer_Result = "Answer_Result", e.Answer_Liked = "Answer_Liked", e.Answer_Disliked = "Answer_Disliked", e.Answer_Liked_Cancelled = "Answer_Liked_Cancelled", e.Answer_Disliked_Cancelled = "Answer_Disliked_Cancelled", e.TopPassages_Display = "TopPassages_Display", e.TopPassages_Click = "TopPassages_Click", e.UserSettings_Reset = "UserSettings_Reset", e.Change_Password_Failed = "change.password.failed", e.Change_Password_Success_Form = "change.password.success.form", e.Forgot_Password_Request = "forgot.password.request", e.Login_Denied = "login.denied", e.Login_Success_Form = "login.success.form", e.Send_Reset_Password_Link = "send.reset.password.link", e.Xrest_ChangePassword = "xrest.changepassword", e;
|
|
745
|
-
}({}),
|
|
750
|
+
}({}), L = /* @__PURE__ */ function(e) {
|
|
746
751
|
return 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;
|
|
747
|
-
}({}),
|
|
752
|
+
}({}), R = /* @__PURE__ */ function(e) {
|
|
748
753
|
return 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;
|
|
749
|
-
}({}),
|
|
754
|
+
}({}), qe = "1.0", Je = /* @__PURE__ */ function(e) {
|
|
750
755
|
return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
|
|
751
|
-
}({}),
|
|
756
|
+
}({}), Ye = /* @__PURE__ */ function(e) {
|
|
752
757
|
return 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;
|
|
753
758
|
}({});
|
|
754
759
|
//#endregion
|
|
755
760
|
//#region src/helpers/columns.ts
|
|
756
|
-
function
|
|
757
|
-
if (!e) return
|
|
761
|
+
function Xe(e) {
|
|
762
|
+
if (!e) return L.none;
|
|
758
763
|
switch (e.toLocaleLowerCase()) {
|
|
759
764
|
case "bool":
|
|
760
|
-
case "boolean": return
|
|
761
|
-
case "date": return
|
|
762
|
-
case "datetime": return
|
|
763
|
-
case "time": return
|
|
764
|
-
case "unsigned": return
|
|
765
|
-
case "integer": return
|
|
766
|
-
case "float": return
|
|
767
|
-
case "double": return
|
|
768
|
-
case "dates": return
|
|
769
|
-
case "datetimes": return
|
|
770
|
-
case "times": return
|
|
771
|
-
case "varchar": return
|
|
772
|
-
case "binary": return
|
|
773
|
-
case "string": return
|
|
774
|
-
case "csv": return
|
|
775
|
-
default: return
|
|
765
|
+
case "boolean": return L.bool;
|
|
766
|
+
case "date": return L.date;
|
|
767
|
+
case "datetime": return L.dateTime;
|
|
768
|
+
case "time": return L.time;
|
|
769
|
+
case "unsigned": return L.unsigned;
|
|
770
|
+
case "integer": return L.integer;
|
|
771
|
+
case "float": return L.float;
|
|
772
|
+
case "double": return L.double;
|
|
773
|
+
case "dates": return L.dates;
|
|
774
|
+
case "datetimes": return L.dateTimes;
|
|
775
|
+
case "times": return L.times;
|
|
776
|
+
case "varchar": return L.varchar;
|
|
777
|
+
case "binary": return L.binary;
|
|
778
|
+
case "string": return L.string;
|
|
779
|
+
case "csv": return L.csv;
|
|
780
|
+
default: return L.none;
|
|
776
781
|
}
|
|
777
782
|
}
|
|
778
|
-
function
|
|
783
|
+
function Ze(e) {
|
|
779
784
|
switch (e) {
|
|
780
|
-
case "a": return
|
|
781
|
-
case "c": return
|
|
782
|
-
case "d": return
|
|
783
|
-
case "e": return
|
|
784
|
-
case "i": return
|
|
785
|
-
case "l": return
|
|
786
|
-
case "n": return
|
|
787
|
-
case "t": return
|
|
788
|
-
case "x": return
|
|
789
|
-
case "z": return
|
|
790
|
-
default: return
|
|
785
|
+
case "a": return R.a;
|
|
786
|
+
case "c": return R.c;
|
|
787
|
+
case "d": return R.d;
|
|
788
|
+
case "e": return R.e;
|
|
789
|
+
case "i": return R.i;
|
|
790
|
+
case "l": return R.l;
|
|
791
|
+
case "n": return R.n;
|
|
792
|
+
case "t": return R.t;
|
|
793
|
+
case "x": return R.x;
|
|
794
|
+
case "z": return R.z;
|
|
795
|
+
default: return R.none;
|
|
791
796
|
}
|
|
792
797
|
}
|
|
793
|
-
function
|
|
794
|
-
let t =
|
|
795
|
-
if (e) for (let n of e) t |=
|
|
798
|
+
function Qe(e) {
|
|
799
|
+
let t = R.none;
|
|
800
|
+
if (e) for (let n of e) t |= Ze(n);
|
|
796
801
|
return t;
|
|
797
802
|
}
|
|
798
|
-
function
|
|
803
|
+
function z(e, t, n, r) {
|
|
799
804
|
return {
|
|
800
805
|
name: e,
|
|
801
806
|
type: t,
|
|
802
807
|
typeModifier: n,
|
|
803
|
-
eType:
|
|
804
|
-
eTypeModifier:
|
|
808
|
+
eType: Xe(t),
|
|
809
|
+
eTypeModifier: Qe(n || ""),
|
|
805
810
|
aliases: r
|
|
806
811
|
};
|
|
807
812
|
}
|
|
808
|
-
var
|
|
809
|
-
id:
|
|
810
|
-
text:
|
|
811
|
-
documentlanguages:
|
|
812
|
-
databasealias:
|
|
813
|
-
globalrelevance:
|
|
814
|
-
matchingpartnames:
|
|
815
|
-
matchlocations:
|
|
816
|
-
matchlocationsperpartname:
|
|
817
|
-
extracts:
|
|
818
|
-
extractsperpartname:
|
|
819
|
-
extractslocations:
|
|
820
|
-
documentweight:
|
|
821
|
-
groupcount:
|
|
822
|
-
accesslists:
|
|
813
|
+
var $e = {
|
|
814
|
+
id: z("id", "string"),
|
|
815
|
+
text: z("text", "varchar"),
|
|
816
|
+
documentlanguages: z("documentlanguages", "csv", "ci", ["language"]),
|
|
817
|
+
databasealias: z("databasealias", "varchar"),
|
|
818
|
+
globalrelevance: z("globalrelevance", "double"),
|
|
819
|
+
matchingpartnames: z("matchingpartnames", "csv"),
|
|
820
|
+
matchlocations: z("matchlocations", "csv"),
|
|
821
|
+
matchlocationsperpartname: z("matchlocationsperpartname", "varchar"),
|
|
822
|
+
extracts: z("extracts", "csv"),
|
|
823
|
+
extractsperpartname: z("extractsperpartname", "varchar"),
|
|
824
|
+
extractslocations: z("extractslocations", "csv"),
|
|
825
|
+
documentweight: z("documentweight", "varchar"),
|
|
826
|
+
groupcount: z("groupcount", "integer"),
|
|
827
|
+
accesslists: z("accesslists", "varchar", void 0, ["accessLists"])
|
|
823
828
|
};
|
|
824
829
|
//#endregion
|
|
825
830
|
//#region src/helpers/filters.ts
|
|
826
|
-
function
|
|
831
|
+
function et(e) {
|
|
827
832
|
return e.filter((e) => !!e);
|
|
828
833
|
}
|
|
829
|
-
var
|
|
834
|
+
var B = {
|
|
830
835
|
eq: (e, t) => ({
|
|
831
836
|
field: e,
|
|
832
837
|
operator: "eq",
|
|
@@ -891,33 +896,63 @@ var Qe = {
|
|
|
891
896
|
start: t,
|
|
892
897
|
end: n
|
|
893
898
|
}),
|
|
894
|
-
and: (...e) =>
|
|
895
|
-
or: (...e) =>
|
|
899
|
+
and: (...e) => tt("and", e),
|
|
900
|
+
or: (...e) => tt("or", e),
|
|
896
901
|
not: (...e) => {
|
|
897
|
-
let t =
|
|
902
|
+
let t = et(e);
|
|
898
903
|
return t.length ? {
|
|
899
904
|
operator: "not",
|
|
900
905
|
filters: t
|
|
901
906
|
} : void 0;
|
|
902
907
|
}
|
|
903
908
|
};
|
|
904
|
-
function
|
|
905
|
-
let n =
|
|
909
|
+
function tt(e, t) {
|
|
910
|
+
let n = et(t);
|
|
906
911
|
if (n.length !== 0) return n.length === 1 ? n[0] : {
|
|
907
912
|
operator: e,
|
|
908
913
|
filters: n
|
|
909
914
|
};
|
|
910
915
|
}
|
|
916
|
+
function V(e) {
|
|
917
|
+
if (!e) return;
|
|
918
|
+
let { operator: t, field: n } = e;
|
|
919
|
+
switch (t) {
|
|
920
|
+
case "and":
|
|
921
|
+
case "or": {
|
|
922
|
+
let n = (e.filters ?? []).map((e) => V(e));
|
|
923
|
+
return t === "and" ? B.and(...n) : B.or(...n);
|
|
924
|
+
}
|
|
925
|
+
case "not": {
|
|
926
|
+
let t = (e.filters ?? []).map((e) => V(e));
|
|
927
|
+
return B.not(...t);
|
|
928
|
+
}
|
|
929
|
+
case "in": return n && e.values?.length ? B.in(n, e.values) : void 0;
|
|
930
|
+
case "between": return n && e.start !== void 0 && e.end !== void 0 ? B.between(n, e.start, e.end) : void 0;
|
|
931
|
+
case "null": return n ? B.isNull(n) : void 0;
|
|
932
|
+
case "notnull": return n ? B.isNotNull(n) : void 0;
|
|
933
|
+
case "eq":
|
|
934
|
+
case "neq":
|
|
935
|
+
case "gt":
|
|
936
|
+
case "gte":
|
|
937
|
+
case "lt":
|
|
938
|
+
case "lte":
|
|
939
|
+
case "like":
|
|
940
|
+
case "contains":
|
|
941
|
+
case "regex": return n && e.value !== void 0 ? B[t](n, e.value) : void 0;
|
|
942
|
+
case void 0: return n && e.value !== void 0 ? B.eq(n, e.value) : void 0;
|
|
943
|
+
default: return;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
911
946
|
//#endregion
|
|
912
947
|
//#region src/helpers/metadata.ts
|
|
913
|
-
function
|
|
948
|
+
function nt(e, t) {
|
|
914
949
|
let n = e[t];
|
|
915
950
|
return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
|
|
916
951
|
if (typeof e == "string") return e.trim();
|
|
917
952
|
if (typeof e == "object" && e && "display" in e) return e.display.trim();
|
|
918
953
|
}).filter((e) => e !== void 0) : [String(n).trim()]);
|
|
919
954
|
}
|
|
920
|
-
function
|
|
955
|
+
function rt(e, t) {
|
|
921
956
|
let n = e[t];
|
|
922
957
|
if (n === void 0) return [];
|
|
923
958
|
if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
|
|
@@ -944,32 +979,32 @@ function tt(e, t) {
|
|
|
944
979
|
function H(e) {
|
|
945
980
|
return typeof e == "object" && !!e;
|
|
946
981
|
}
|
|
947
|
-
function
|
|
982
|
+
function it(e) {
|
|
948
983
|
return H(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
949
984
|
}
|
|
950
|
-
function
|
|
985
|
+
function at(e) {
|
|
951
986
|
return H(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
952
987
|
}
|
|
953
|
-
function
|
|
988
|
+
function ot(e) {
|
|
954
989
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
955
990
|
}
|
|
956
|
-
function
|
|
991
|
+
function st(e) {
|
|
957
992
|
return typeof e == "string";
|
|
958
993
|
}
|
|
959
|
-
function
|
|
960
|
-
return (H(e) || Array.isArray(e)) && !
|
|
994
|
+
function ct(e) {
|
|
995
|
+
return (H(e) || Array.isArray(e)) && !it(e) && !at(e) && !st(e);
|
|
961
996
|
}
|
|
962
|
-
function
|
|
997
|
+
function lt(e) {
|
|
963
998
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
964
999
|
}
|
|
965
|
-
function
|
|
1000
|
+
function ut(e = !0) {
|
|
966
1001
|
let t = Date.now();
|
|
967
1002
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
|
|
968
1003
|
let n = (t + Math.random() * 16) % 16 | 0;
|
|
969
1004
|
return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
|
|
970
1005
|
});
|
|
971
1006
|
}
|
|
972
|
-
function
|
|
1007
|
+
function dt(e) {
|
|
973
1008
|
if (!e) return "``";
|
|
974
1009
|
if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
|
|
975
1010
|
let t = ["`"];
|
|
@@ -979,7 +1014,7 @@ function lt(e) {
|
|
|
979
1014
|
}
|
|
980
1015
|
return t.push("`"), t.join("");
|
|
981
1016
|
}
|
|
982
|
-
function
|
|
1017
|
+
function ft(e) {
|
|
983
1018
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function") try {
|
|
984
1019
|
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then((e) => Array.prototype.map.call(new Uint8Array(e), (e) => `00${e.toString(16)}`.slice(-2)).join("")).catch(() => Promise.resolve(U(e)));
|
|
985
1020
|
} catch {
|
|
@@ -995,12 +1030,12 @@ function U(e) {
|
|
|
995
1030
|
}
|
|
996
1031
|
//#endregion
|
|
997
1032
|
//#region src/web-api/v1/fetch-audit.ts
|
|
998
|
-
var W,
|
|
1033
|
+
var W, pt;
|
|
999
1034
|
function G(e, t = !0) {
|
|
1000
|
-
let n =
|
|
1001
|
-
n && (
|
|
1035
|
+
let n = mt(e.$auditRecord);
|
|
1036
|
+
n && (ht(n), t && gt(n)), e.$auditRecord = n;
|
|
1002
1037
|
}
|
|
1003
|
-
function
|
|
1038
|
+
function mt(e) {
|
|
1004
1039
|
if (!e) return;
|
|
1005
1040
|
let t;
|
|
1006
1041
|
if (Array.isArray(e)) t = e;
|
|
@@ -1011,35 +1046,35 @@ function ft(e) {
|
|
|
1011
1046
|
}
|
|
1012
1047
|
return { auditEvents: t };
|
|
1013
1048
|
}
|
|
1014
|
-
function
|
|
1015
|
-
let t =
|
|
1049
|
+
function ht(e) {
|
|
1050
|
+
let t = _t();
|
|
1016
1051
|
return e.auditEvents?.forEach((e) => {
|
|
1017
1052
|
e.detail ||= {}, e.detail.sessionid = t;
|
|
1018
1053
|
}), e;
|
|
1019
1054
|
}
|
|
1020
|
-
function
|
|
1055
|
+
function gt(e) {
|
|
1021
1056
|
let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
1022
1057
|
return e?.auditEvents?.forEach((e) => {
|
|
1023
1058
|
e.detail ||= {}, e.detail.url = t;
|
|
1024
1059
|
}), e;
|
|
1025
1060
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return (!W ||
|
|
1061
|
+
function _t() {
|
|
1062
|
+
return (!W || vt()) && (W = ut()), pt = /* @__PURE__ */ new Date(), W;
|
|
1028
1063
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
1064
|
+
function vt() {
|
|
1065
|
+
return (/* @__PURE__ */ new Date()).getTime() - pt.getTime() > 600 * 1e3;
|
|
1031
1066
|
}
|
|
1032
|
-
async function
|
|
1067
|
+
async function yt(e, t = !0) {
|
|
1033
1068
|
let n = {
|
|
1034
|
-
event:
|
|
1069
|
+
event: I.None,
|
|
1035
1070
|
$auditRecord: e
|
|
1036
1071
|
};
|
|
1037
|
-
return G(n, t),
|
|
1072
|
+
return G(n, t), N("api/v1/audit.notify", n);
|
|
1038
1073
|
}
|
|
1039
|
-
var
|
|
1074
|
+
var bt = { notify: yt };
|
|
1040
1075
|
//#endregion
|
|
1041
1076
|
//#region src/web-api/v1/fetch-aggregation.ts
|
|
1042
|
-
async function
|
|
1077
|
+
async function xt(e, t, n) {
|
|
1043
1078
|
let r = e.items?.length || 0, i = {
|
|
1044
1079
|
query: {
|
|
1045
1080
|
...t,
|
|
@@ -1052,12 +1087,12 @@ async function yt(e, t, n) {
|
|
|
1052
1087
|
$auditRecord: { auditEvents: [n] }
|
|
1053
1088
|
};
|
|
1054
1089
|
G(i);
|
|
1055
|
-
let { aggregations: a } = await
|
|
1090
|
+
let { aggregations: a } = await O(await N("api/v1/query", i)), o = a[0];
|
|
1056
1091
|
return o.$hasMore = o.items.length > 10, o.items = [...e.items, ...o.items], Promise.resolve(o);
|
|
1057
1092
|
}
|
|
1058
1093
|
//#endregion
|
|
1059
1094
|
//#region src/authentication/session/detect-auth-mode.ts
|
|
1060
|
-
function
|
|
1095
|
+
function St(e, n) {
|
|
1061
1096
|
if (e.authMode?.kind === "credentials") return t.credentials();
|
|
1062
1097
|
if (e.bearerToken) return t.bearer(e.bearerToken);
|
|
1063
1098
|
let r = e.autoOAuthProvider || n?.autoOAuthProvider;
|
|
@@ -1067,18 +1102,18 @@ function bt(e, n) {
|
|
|
1067
1102
|
}
|
|
1068
1103
|
//#endregion
|
|
1069
1104
|
//#region src/web-api/v1/fetch-app.ts
|
|
1070
|
-
async function
|
|
1105
|
+
async function Ct(e) {
|
|
1071
1106
|
let t = e || r.app;
|
|
1072
|
-
return
|
|
1107
|
+
return j("api/v1/app", new URLSearchParams({ app: t || "" }));
|
|
1073
1108
|
}
|
|
1074
|
-
async function
|
|
1109
|
+
async function wt() {
|
|
1075
1110
|
let { app: e } = r;
|
|
1076
|
-
return
|
|
1111
|
+
return j("api/v1/app", new URLSearchParams({
|
|
1077
1112
|
app: e || "",
|
|
1078
1113
|
preLogin: "true"
|
|
1079
1114
|
}));
|
|
1080
1115
|
}
|
|
1081
|
-
function
|
|
1116
|
+
function Tt() {
|
|
1082
1117
|
let { backendUrl: e, app: n } = r;
|
|
1083
1118
|
if (typeof window < "u") {
|
|
1084
1119
|
if (e ||= window.location.origin, !n) {
|
|
@@ -1095,37 +1130,37 @@ function Ct() {
|
|
|
1095
1130
|
autoOAuthProvider: void 0,
|
|
1096
1131
|
autoSAMLProvider: void 0,
|
|
1097
1132
|
bearerToken: void 0
|
|
1098
|
-
}), Promise.resolve({})) :
|
|
1099
|
-
authMode:
|
|
1133
|
+
}), Promise.resolve({})) : wt().then((e) => (i({
|
|
1134
|
+
authMode: St(r, e),
|
|
1100
1135
|
autoOAuthProvider: r.autoOAuthProvider || e.autoOAuthProvider,
|
|
1101
1136
|
autoSAMLProvider: r.autoSAMLProvider || e.autoSAMLProvider
|
|
1102
1137
|
}), e)).catch((e) => {
|
|
1103
|
-
throw
|
|
1138
|
+
throw C("atomic:fetchAppPreLogin error", e), e;
|
|
1104
1139
|
});
|
|
1105
1140
|
}
|
|
1106
|
-
var
|
|
1141
|
+
var Et = Tt;
|
|
1107
1142
|
//#endregion
|
|
1108
1143
|
//#region src/web-api/v1/fetch-dataset.ts
|
|
1109
|
-
async function
|
|
1110
|
-
let r = await
|
|
1144
|
+
async function Dt(e, t, n = {}) {
|
|
1145
|
+
let r = await N(`api/v1/search.dataset/${e}/${t}`, { parameters: n }), i = t[0].toLowerCase() + t.slice(1), a = r.datasets[i];
|
|
1111
1146
|
if ("errorCode" in a && "errorMessage" in a) throw Error(a.errorMessage);
|
|
1112
1147
|
return a;
|
|
1113
1148
|
}
|
|
1114
|
-
async function
|
|
1149
|
+
async function Ot(e, t) {
|
|
1115
1150
|
let n = `api/v1/search.dataset/${e}`, { parameters: r = {}, datasets: i = [] } = t;
|
|
1116
|
-
return (await
|
|
1151
|
+
return (await N(n, {
|
|
1117
1152
|
parameters: r,
|
|
1118
1153
|
datasets: i
|
|
1119
1154
|
})).datasets;
|
|
1120
1155
|
}
|
|
1121
|
-
async function
|
|
1122
|
-
return await
|
|
1156
|
+
async function kt(e) {
|
|
1157
|
+
return await j(`api/v1/search.dataset/${e}`);
|
|
1123
1158
|
}
|
|
1124
1159
|
//#endregion
|
|
1125
1160
|
//#region src/web-api/v1/fetch-labels.ts
|
|
1126
|
-
async function
|
|
1161
|
+
async function At(e, t = !0, n) {
|
|
1127
1162
|
try {
|
|
1128
|
-
return (await
|
|
1163
|
+
return (await N("api/v1/labels", {
|
|
1129
1164
|
action: "list",
|
|
1130
1165
|
q: e,
|
|
1131
1166
|
public: t,
|
|
@@ -1133,30 +1168,30 @@ async function Ot(e, t = !0, n) {
|
|
|
1133
1168
|
localize: !1
|
|
1134
1169
|
})).labels;
|
|
1135
1170
|
} catch (e) {
|
|
1136
|
-
throw
|
|
1171
|
+
throw C("Error in fetchLabels", e), e;
|
|
1137
1172
|
}
|
|
1138
1173
|
}
|
|
1139
|
-
async function
|
|
1174
|
+
async function jt() {
|
|
1140
1175
|
try {
|
|
1141
1176
|
let { app: e = "" } = r;
|
|
1142
|
-
return
|
|
1177
|
+
return j("api/v1/labels", new URLSearchParams({
|
|
1143
1178
|
app: e,
|
|
1144
1179
|
action: "getUserRights"
|
|
1145
1180
|
}));
|
|
1146
1181
|
} catch (e) {
|
|
1147
|
-
throw
|
|
1182
|
+
throw C("Error in getUserRights", e), e;
|
|
1148
1183
|
}
|
|
1149
1184
|
}
|
|
1150
|
-
async function
|
|
1185
|
+
async function Mt(e, t, n = !0) {
|
|
1151
1186
|
try {
|
|
1152
|
-
return
|
|
1187
|
+
return N("api/v1/labels", {
|
|
1153
1188
|
action: "add",
|
|
1154
1189
|
labels: e,
|
|
1155
1190
|
ids: t,
|
|
1156
1191
|
public: n,
|
|
1157
1192
|
$auditRecord: {
|
|
1158
1193
|
auditEvents: [{
|
|
1159
|
-
type:
|
|
1194
|
+
type: I.Label_AddDoc,
|
|
1160
1195
|
detail: {
|
|
1161
1196
|
public: n,
|
|
1162
1197
|
label: e ? e.toString() : null,
|
|
@@ -1170,19 +1205,19 @@ async function At(e, t, n = !0) {
|
|
|
1170
1205
|
}
|
|
1171
1206
|
});
|
|
1172
1207
|
} catch (e) {
|
|
1173
|
-
throw
|
|
1208
|
+
throw C("Error in add", e), e;
|
|
1174
1209
|
}
|
|
1175
1210
|
}
|
|
1176
|
-
async function
|
|
1211
|
+
async function Nt(e, t, n = !0) {
|
|
1177
1212
|
try {
|
|
1178
|
-
return
|
|
1213
|
+
return N("api/v1/labels", {
|
|
1179
1214
|
action: "remove",
|
|
1180
1215
|
labels: e,
|
|
1181
1216
|
ids: t,
|
|
1182
1217
|
public: n,
|
|
1183
1218
|
$auditRecord: {
|
|
1184
1219
|
auditEvents: [{
|
|
1185
|
-
type:
|
|
1220
|
+
type: I.Label_RemoveDoc,
|
|
1186
1221
|
detail: {
|
|
1187
1222
|
public: n,
|
|
1188
1223
|
label: e ? e.toString() : null,
|
|
@@ -1196,18 +1231,18 @@ async function jt(e, t, n = !0) {
|
|
|
1196
1231
|
}
|
|
1197
1232
|
});
|
|
1198
1233
|
} catch (e) {
|
|
1199
|
-
throw
|
|
1234
|
+
throw C("Error in remove", e), e;
|
|
1200
1235
|
}
|
|
1201
1236
|
}
|
|
1202
|
-
async function
|
|
1237
|
+
async function Pt(e, t, n = !0) {
|
|
1203
1238
|
try {
|
|
1204
|
-
return
|
|
1239
|
+
return N("api/v1/labels", {
|
|
1205
1240
|
action: "rename",
|
|
1206
1241
|
labels: e,
|
|
1207
1242
|
newLabel: t,
|
|
1208
1243
|
public: n,
|
|
1209
1244
|
auditEvents: {
|
|
1210
|
-
type:
|
|
1245
|
+
type: I.Label_Rename,
|
|
1211
1246
|
detail: {
|
|
1212
1247
|
public: n,
|
|
1213
1248
|
oldlabel: e ? e.toString() : null,
|
|
@@ -1216,17 +1251,17 @@ async function Mt(e, t, n = !0) {
|
|
|
1216
1251
|
}
|
|
1217
1252
|
});
|
|
1218
1253
|
} catch (e) {
|
|
1219
|
-
throw
|
|
1254
|
+
throw C("Error in rename", e), e;
|
|
1220
1255
|
}
|
|
1221
1256
|
}
|
|
1222
|
-
async function
|
|
1257
|
+
async function Ft(e, t = !0) {
|
|
1223
1258
|
try {
|
|
1224
|
-
return
|
|
1259
|
+
return N("api/v1/labels", {
|
|
1225
1260
|
action: "delete",
|
|
1226
1261
|
labels: e,
|
|
1227
1262
|
public: t,
|
|
1228
1263
|
auditEvents: {
|
|
1229
|
-
type:
|
|
1264
|
+
type: I.Label_Delete,
|
|
1230
1265
|
detail: {
|
|
1231
1266
|
public: t,
|
|
1232
1267
|
label: e ? e.toString() : null
|
|
@@ -1234,18 +1269,18 @@ async function Nt(e, t = !0) {
|
|
|
1234
1269
|
}
|
|
1235
1270
|
});
|
|
1236
1271
|
} catch (e) {
|
|
1237
|
-
throw
|
|
1272
|
+
throw C("Error in deleteLabels", e), e;
|
|
1238
1273
|
}
|
|
1239
1274
|
}
|
|
1240
|
-
async function
|
|
1275
|
+
async function It(e, t, n = !0) {
|
|
1241
1276
|
try {
|
|
1242
|
-
return
|
|
1277
|
+
return N("api/v1/labels", {
|
|
1243
1278
|
action: "bulkAdd",
|
|
1244
1279
|
labels: e,
|
|
1245
1280
|
query: t,
|
|
1246
1281
|
public: n,
|
|
1247
1282
|
auditEvents: {
|
|
1248
|
-
type:
|
|
1283
|
+
type: I.Label_Add,
|
|
1249
1284
|
detail: {
|
|
1250
1285
|
public: n,
|
|
1251
1286
|
label: e ? e.toString() : null,
|
|
@@ -1254,18 +1289,18 @@ async function Pt(e, t, n = !0) {
|
|
|
1254
1289
|
}
|
|
1255
1290
|
});
|
|
1256
1291
|
} catch (e) {
|
|
1257
|
-
throw
|
|
1292
|
+
throw C("Error in bulkAdd", e), e;
|
|
1258
1293
|
}
|
|
1259
1294
|
}
|
|
1260
|
-
async function
|
|
1295
|
+
async function Lt(e, t, n = !0) {
|
|
1261
1296
|
try {
|
|
1262
|
-
return
|
|
1297
|
+
return N("api/v1/labels", {
|
|
1263
1298
|
action: "bulkRemove",
|
|
1264
1299
|
labels: e,
|
|
1265
1300
|
query: t,
|
|
1266
1301
|
public: n,
|
|
1267
1302
|
auditEvents: {
|
|
1268
|
-
type:
|
|
1303
|
+
type: I.Label_Delete,
|
|
1269
1304
|
detail: {
|
|
1270
1305
|
public: n,
|
|
1271
1306
|
label: e ? e.toString() : null,
|
|
@@ -1274,28 +1309,28 @@ async function Ft(e, t, n = !0) {
|
|
|
1274
1309
|
}
|
|
1275
1310
|
});
|
|
1276
1311
|
} catch (e) {
|
|
1277
|
-
throw
|
|
1312
|
+
throw C("Error in bulkRemove", e), e;
|
|
1278
1313
|
}
|
|
1279
1314
|
}
|
|
1280
|
-
var
|
|
1281
|
-
getUserRights:
|
|
1282
|
-
add:
|
|
1283
|
-
remove:
|
|
1284
|
-
rename:
|
|
1285
|
-
delete:
|
|
1286
|
-
bulkAdd:
|
|
1287
|
-
bulkRemove:
|
|
1315
|
+
var Rt = {
|
|
1316
|
+
getUserRights: jt,
|
|
1317
|
+
add: Mt,
|
|
1318
|
+
remove: Nt,
|
|
1319
|
+
rename: Pt,
|
|
1320
|
+
delete: Ft,
|
|
1321
|
+
bulkAdd: It,
|
|
1322
|
+
bulkRemove: Lt
|
|
1288
1323
|
};
|
|
1289
1324
|
//#endregion
|
|
1290
1325
|
//#region src/web-api/v1/fetch-preview.ts
|
|
1291
|
-
async function
|
|
1292
|
-
if (typeof window > "u") return
|
|
1326
|
+
async function zt(e, t) {
|
|
1327
|
+
if (typeof window > "u") return N("api/v1/preview", {
|
|
1293
1328
|
action: "get",
|
|
1294
1329
|
id: e,
|
|
1295
1330
|
query: t
|
|
1296
1331
|
});
|
|
1297
1332
|
let n = `${window.location.origin}${window.location.pathname}`;
|
|
1298
|
-
return
|
|
1333
|
+
return N("api/v1/preview", {
|
|
1299
1334
|
action: "get",
|
|
1300
1335
|
id: e,
|
|
1301
1336
|
query: {
|
|
@@ -1305,57 +1340,57 @@ async function Lt(e, t) {
|
|
|
1305
1340
|
browserUrl: n
|
|
1306
1341
|
});
|
|
1307
1342
|
}
|
|
1308
|
-
async function
|
|
1343
|
+
async function Bt(e) {
|
|
1309
1344
|
let t = new Headers();
|
|
1310
|
-
t.append("content-type", "text"),
|
|
1345
|
+
t.append("content-type", "text"), O(await fetch(e, {
|
|
1311
1346
|
method: "GET",
|
|
1312
1347
|
headers: t
|
|
1313
1348
|
}));
|
|
1314
1349
|
}
|
|
1315
1350
|
//#endregion
|
|
1316
1351
|
//#region src/web-api/v1/fetch-principal.ts
|
|
1317
|
-
async function
|
|
1318
|
-
return
|
|
1352
|
+
async function Vt() {
|
|
1353
|
+
return j("api/v1/principal", new URLSearchParams({
|
|
1319
1354
|
action: "get",
|
|
1320
|
-
noAutoAuthentication:
|
|
1355
|
+
noAutoAuthentication: String(M())
|
|
1321
1356
|
}));
|
|
1322
1357
|
}
|
|
1323
|
-
async function
|
|
1358
|
+
async function Ht(e) {
|
|
1324
1359
|
let t = {
|
|
1325
|
-
noAutoAuthentication:
|
|
1360
|
+
noAutoAuthentication: String(M()),
|
|
1326
1361
|
...e
|
|
1327
1362
|
}, n = new URLSearchParams();
|
|
1328
1363
|
return Object.entries(t).forEach(([e, t]) => {
|
|
1329
1364
|
t !== void 0 && n.append(e, String(t));
|
|
1330
|
-
}),
|
|
1365
|
+
}), j("api/v1/principal/list", n);
|
|
1331
1366
|
}
|
|
1332
|
-
async function
|
|
1333
|
-
return e ?
|
|
1367
|
+
async function Ut(e) {
|
|
1368
|
+
return e ? j("api/v1/principal", new URLSearchParams({
|
|
1334
1369
|
action: "userid",
|
|
1335
|
-
noAutoAuthentication:
|
|
1370
|
+
noAutoAuthentication: String(M()),
|
|
1336
1371
|
userid: e
|
|
1337
1372
|
})) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
|
|
1338
1373
|
}
|
|
1339
|
-
async function
|
|
1340
|
-
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) :
|
|
1341
|
-
noAutoAuthentication:
|
|
1374
|
+
async function Wt(e) {
|
|
1375
|
+
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : j("api/v1/principal/userids", new URLSearchParams({
|
|
1376
|
+
noAutoAuthentication: String(M()),
|
|
1342
1377
|
userids: [...e].join(",")
|
|
1343
1378
|
}));
|
|
1344
1379
|
}
|
|
1345
|
-
var
|
|
1346
|
-
get:
|
|
1347
|
-
list:
|
|
1348
|
-
userid:
|
|
1349
|
-
userids:
|
|
1350
|
-
} },
|
|
1351
|
-
async function
|
|
1352
|
-
let r = await
|
|
1380
|
+
var Gt = { principal: {
|
|
1381
|
+
get: Vt,
|
|
1382
|
+
list: Ht,
|
|
1383
|
+
userid: Ut,
|
|
1384
|
+
userids: Wt
|
|
1385
|
+
} }, Kt = 11;
|
|
1386
|
+
async function qt(e, t, n) {
|
|
1387
|
+
let r = await N("api/v1/query", {
|
|
1353
1388
|
query: e,
|
|
1354
1389
|
$auditRecord: t,
|
|
1355
1390
|
queryIntentData: n
|
|
1356
1391
|
});
|
|
1357
1392
|
r.aggregations.forEach((e) => {
|
|
1358
|
-
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length ===
|
|
1393
|
+
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Kt), e.isTree && e.items && K(e);
|
|
1359
1394
|
}), r.records?.map((e) => Object.assign(e, {
|
|
1360
1395
|
value: e.title,
|
|
1361
1396
|
type: "default"
|
|
@@ -1367,7 +1402,7 @@ async function Gt(e, t, n) {
|
|
|
1367
1402
|
};
|
|
1368
1403
|
return Promise.resolve(i);
|
|
1369
1404
|
}
|
|
1370
|
-
async function
|
|
1405
|
+
async function Jt(e, t, n) {
|
|
1371
1406
|
let { app: i = "" } = r, a = {
|
|
1372
1407
|
methods: [],
|
|
1373
1408
|
mode: t,
|
|
@@ -1379,10 +1414,10 @@ async function Kt(e, t, n) {
|
|
|
1379
1414
|
app: i,
|
|
1380
1415
|
query: t
|
|
1381
1416
|
});
|
|
1382
|
-
let o = await
|
|
1417
|
+
let o = await N("api/v1/multi", a);
|
|
1383
1418
|
o.results.forEach((e) => {
|
|
1384
1419
|
e.aggregations.forEach((e) => {
|
|
1385
|
-
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length ===
|
|
1420
|
+
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Kt), e.isTree && K(e);
|
|
1386
1421
|
});
|
|
1387
1422
|
}), o.results.forEach((e) => e.records?.map((e) => Object.assign(e, {
|
|
1388
1423
|
value: e.title,
|
|
@@ -1407,7 +1442,7 @@ function K(e, t = "", n = 0) {
|
|
|
1407
1442
|
}
|
|
1408
1443
|
//#endregion
|
|
1409
1444
|
//#region src/web-api/v1/fetch-query-export.ts
|
|
1410
|
-
async function
|
|
1445
|
+
async function Yt({ model: e, appName: t, query: n, article: r }) {
|
|
1411
1446
|
let { webservice: i, format: a, maxcount: o, exportedColumns: s, export: c } = e, l = {
|
|
1412
1447
|
app: t,
|
|
1413
1448
|
webservice: i,
|
|
@@ -1421,25 +1456,25 @@ async function qt({ model: e, appName: t, query: n, article: r }) {
|
|
|
1421
1456
|
detail: { resultid: r ? r.id : void 0 }
|
|
1422
1457
|
}] }
|
|
1423
1458
|
};
|
|
1424
|
-
return G(l), await
|
|
1459
|
+
return G(l), await N("api/v1/search.queryexport", l, { responseType: "blob" });
|
|
1425
1460
|
}
|
|
1426
1461
|
//#endregion
|
|
1427
1462
|
//#region src/web-api/v1/fetch-query-intent.ts
|
|
1428
|
-
async function
|
|
1429
|
-
return (await
|
|
1463
|
+
async function Xt(e) {
|
|
1464
|
+
return (await N("api/v1/queryintent", { query: e }))?.intents;
|
|
1430
1465
|
}
|
|
1431
1466
|
//#endregion
|
|
1432
1467
|
//#region src/web-api/v1/fetch-similar-documents.ts
|
|
1433
|
-
async function
|
|
1434
|
-
return (await
|
|
1468
|
+
async function Zt(e, t, n) {
|
|
1469
|
+
return (await N("api/v1/similardocuments", {
|
|
1435
1470
|
sourceDocumentId: e,
|
|
1436
1471
|
query: { name: t }
|
|
1437
1472
|
}, { signal: n })).data;
|
|
1438
1473
|
}
|
|
1439
1474
|
//#endregion
|
|
1440
1475
|
//#region src/web-api/v1/fetch-sponsored-links.ts
|
|
1441
|
-
async function
|
|
1442
|
-
return (await
|
|
1476
|
+
async function Qt(e, t) {
|
|
1477
|
+
return (await N("api/v1/query.links", {
|
|
1443
1478
|
webservice: e,
|
|
1444
1479
|
query: t
|
|
1445
1480
|
}))?.links?.map((e) => ({
|
|
@@ -1449,9 +1484,9 @@ async function Xt(e, t) {
|
|
|
1449
1484
|
}
|
|
1450
1485
|
//#endregion
|
|
1451
1486
|
//#region src/utils/to-sql.ts
|
|
1452
|
-
function
|
|
1487
|
+
function $t(e, t) {
|
|
1453
1488
|
if (typeof e == "number") return `${e}`;
|
|
1454
|
-
if (
|
|
1489
|
+
if (ot(e)) return t ? `'${en(e)}'` : en(e);
|
|
1455
1490
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
1456
1491
|
if (e === null) return "null";
|
|
1457
1492
|
if (Array.isArray(e)) {
|
|
@@ -1462,10 +1497,10 @@ function Zt(e, t) {
|
|
|
1462
1497
|
}
|
|
1463
1498
|
return t ? `'${e}'` : e;
|
|
1464
1499
|
}
|
|
1465
|
-
function
|
|
1500
|
+
function en(e) {
|
|
1466
1501
|
if (!e) return "";
|
|
1467
1502
|
try {
|
|
1468
|
-
return
|
|
1503
|
+
return lt(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
|
|
1469
1504
|
year: "numeric",
|
|
1470
1505
|
month: "2-digit",
|
|
1471
1506
|
day: "2-digit"
|
|
@@ -1481,7 +1516,7 @@ function Qt(e) {
|
|
|
1481
1516
|
}
|
|
1482
1517
|
//#endregion
|
|
1483
1518
|
//#region src/web-api/v1/fetch-suggest.ts
|
|
1484
|
-
async function
|
|
1519
|
+
async function tn(e, t, n, i, a) {
|
|
1485
1520
|
let { app: o } = r, s = {
|
|
1486
1521
|
app: o || "",
|
|
1487
1522
|
suggestQuery: e,
|
|
@@ -1491,14 +1526,14 @@ async function $t(e, t, n, i, a) {
|
|
|
1491
1526
|
showSource: a
|
|
1492
1527
|
};
|
|
1493
1528
|
try {
|
|
1494
|
-
return (await
|
|
1529
|
+
return (await N("api/v1/search.suggest", s)).suggests;
|
|
1495
1530
|
} catch (e) {
|
|
1496
1531
|
throw console.error("Error fetching suggestions:", e), e;
|
|
1497
1532
|
}
|
|
1498
1533
|
}
|
|
1499
|
-
async function
|
|
1534
|
+
async function nn(e, t, n, i) {
|
|
1500
1535
|
let { app: a } = r;
|
|
1501
|
-
return (await
|
|
1536
|
+
return (await N("api/v1/suggestquery", {
|
|
1502
1537
|
app: a || "",
|
|
1503
1538
|
suggestQuery: e,
|
|
1504
1539
|
text: t,
|
|
@@ -1506,22 +1541,22 @@ async function en(e, t, n, i) {
|
|
|
1506
1541
|
kinds: i
|
|
1507
1542
|
})).suggests;
|
|
1508
1543
|
}
|
|
1509
|
-
async function
|
|
1544
|
+
async function rn(e, t, n) {
|
|
1510
1545
|
if (!t) return Promise.resolve([]);
|
|
1511
|
-
let { app: i } = r, a = await
|
|
1546
|
+
let { app: i } = r, a = await N("api/v1/suggestfield", {
|
|
1512
1547
|
app: i || "",
|
|
1513
1548
|
text: e,
|
|
1514
1549
|
fields: t,
|
|
1515
1550
|
query: n
|
|
1516
1551
|
});
|
|
1517
1552
|
return a.suggests.forEach((e) => {
|
|
1518
|
-
e.display =
|
|
1553
|
+
e.display = $t(e.display);
|
|
1519
1554
|
}), a.suggests;
|
|
1520
1555
|
}
|
|
1521
1556
|
//#endregion
|
|
1522
1557
|
//#region src/web-api/v1/fetch-text-chunk.ts
|
|
1523
|
-
async function
|
|
1524
|
-
return
|
|
1558
|
+
async function an(e, t, n, r, i, a) {
|
|
1559
|
+
return N("api/v1/doc.textchunks", {
|
|
1525
1560
|
id: e,
|
|
1526
1561
|
textChunks: t,
|
|
1527
1562
|
highlights: n,
|
|
@@ -1532,86 +1567,86 @@ async function nn(e, t, n, r, i, a) {
|
|
|
1532
1567
|
}
|
|
1533
1568
|
//#endregion
|
|
1534
1569
|
//#region src/web-api/v1/fetch-user-settings.ts
|
|
1535
|
-
async function
|
|
1570
|
+
async function on() {
|
|
1536
1571
|
let { app: e } = r;
|
|
1537
|
-
return
|
|
1572
|
+
return j("api/v1/usersettings", new URLSearchParams({
|
|
1538
1573
|
app: e || "",
|
|
1539
1574
|
action: "load"
|
|
1540
1575
|
}));
|
|
1541
1576
|
}
|
|
1542
|
-
async function
|
|
1577
|
+
async function sn(e, t) {
|
|
1543
1578
|
let n = {
|
|
1544
1579
|
action: "save",
|
|
1545
1580
|
userSettings: e,
|
|
1546
1581
|
$auditRecord: { auditEvents: [t] }
|
|
1547
1582
|
};
|
|
1548
|
-
return G(n),
|
|
1583
|
+
return G(n), N("api/v1/usersettings", n);
|
|
1549
1584
|
}
|
|
1550
|
-
async function
|
|
1585
|
+
async function cn(e, t) {
|
|
1551
1586
|
let n = {
|
|
1552
1587
|
action: "patch",
|
|
1553
1588
|
userSettings: e,
|
|
1554
1589
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1555
1590
|
};
|
|
1556
|
-
return G(n),
|
|
1591
|
+
return G(n), N("api/v1/usersettings", n);
|
|
1557
1592
|
}
|
|
1558
|
-
async function
|
|
1559
|
-
return
|
|
1593
|
+
async function ln() {
|
|
1594
|
+
return sn({}, { type: "UserSettings_Reset" });
|
|
1560
1595
|
}
|
|
1561
1596
|
//#endregion
|
|
1562
1597
|
//#region src/web-api/v2/fetch-change-password.ts
|
|
1563
|
-
async function
|
|
1564
|
-
return
|
|
1598
|
+
async function un(e, t) {
|
|
1599
|
+
return N("api/v2/security/password/change", {
|
|
1565
1600
|
newPassword: e,
|
|
1566
1601
|
currentPassword: t
|
|
1567
1602
|
});
|
|
1568
1603
|
}
|
|
1569
1604
|
//#endregion
|
|
1570
1605
|
//#region src/web-api/v2/fetch-forgot-password.ts
|
|
1571
|
-
async function
|
|
1572
|
-
return
|
|
1606
|
+
async function dn(e) {
|
|
1607
|
+
return N("api/v2/security/password/ask-reset-email", {
|
|
1573
1608
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1574
1609
|
userName: e
|
|
1575
1610
|
});
|
|
1576
1611
|
}
|
|
1577
1612
|
//#endregion
|
|
1578
1613
|
//#region src/web-api/v2/fetch-user-profile.ts
|
|
1579
|
-
async function
|
|
1580
|
-
return await
|
|
1614
|
+
async function fn(e) {
|
|
1615
|
+
return await j(`api/v2/user-profile/${e}`);
|
|
1581
1616
|
}
|
|
1582
|
-
async function
|
|
1583
|
-
return await
|
|
1617
|
+
async function pn(e) {
|
|
1618
|
+
return await N("api/v2/user-profile", e);
|
|
1584
1619
|
}
|
|
1585
|
-
async function
|
|
1586
|
-
return await
|
|
1620
|
+
async function mn(e, t, n) {
|
|
1621
|
+
return await Ve(`api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
|
|
1587
1622
|
}
|
|
1588
|
-
async function
|
|
1623
|
+
async function hn(e, t, n) {
|
|
1589
1624
|
try {
|
|
1590
|
-
return (await
|
|
1625
|
+
return (await Be(`api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
|
|
1591
1626
|
} catch {
|
|
1592
1627
|
return !1;
|
|
1593
1628
|
}
|
|
1594
1629
|
}
|
|
1595
1630
|
//#endregion
|
|
1596
1631
|
//#region src/web-api/v2/fetch-version.ts
|
|
1597
|
-
async function
|
|
1598
|
-
return await
|
|
1632
|
+
async function gn() {
|
|
1633
|
+
return await j("api/v2/version");
|
|
1599
1634
|
}
|
|
1600
1635
|
//#endregion
|
|
1601
1636
|
//#region src/authentication/constants.ts
|
|
1602
|
-
var q = 1e4, J = "sinequa-auth-redirect-attempt",
|
|
1637
|
+
var q = 1e4, J = "sinequa-auth-redirect-attempt", _n = async () => {
|
|
1603
1638
|
let { autoOAuthProvider: e } = r;
|
|
1604
1639
|
if (!e) throw Error("autoOAuthProvider is not configured in globalConfig");
|
|
1605
1640
|
if (typeof window > "u") try {
|
|
1606
|
-
let { signal: t } =
|
|
1607
|
-
return await
|
|
1641
|
+
let { signal: t } = P(q);
|
|
1642
|
+
return await N("security.oauth", {
|
|
1608
1643
|
action: "getcode",
|
|
1609
1644
|
provider: e,
|
|
1610
1645
|
tokenInCookie: !0,
|
|
1611
1646
|
originalUrl: "http://localhost"
|
|
1612
1647
|
}, { signal: t });
|
|
1613
1648
|
} catch (e) {
|
|
1614
|
-
throw
|
|
1649
|
+
throw C("Failed to authenticate with OAuth", e), e;
|
|
1615
1650
|
}
|
|
1616
1651
|
let t = {
|
|
1617
1652
|
action: "getcode",
|
|
@@ -1620,7 +1655,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1620
1655
|
originalUrl: window.location.href
|
|
1621
1656
|
};
|
|
1622
1657
|
try {
|
|
1623
|
-
let { signal: n } =
|
|
1658
|
+
let { signal: n } = P(q), r = await N("api/v1/security.oauth", t, { signal: n });
|
|
1624
1659
|
if (r.redirectUrl) {
|
|
1625
1660
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1626
1661
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1630,21 +1665,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1630
1665
|
}
|
|
1631
1666
|
return r;
|
|
1632
1667
|
} catch (e) {
|
|
1633
|
-
throw
|
|
1668
|
+
throw C("Failed to authenticate with OAuth", e), e;
|
|
1634
1669
|
}
|
|
1635
|
-
},
|
|
1670
|
+
}, vn = async () => {
|
|
1636
1671
|
let { autoSAMLProvider: e } = r;
|
|
1637
1672
|
if (!e) throw Error("autoSAMLProvider is not configured in globalConfig");
|
|
1638
1673
|
if (typeof window > "u") try {
|
|
1639
|
-
let { signal: t } =
|
|
1640
|
-
return await
|
|
1674
|
+
let { signal: t } = P(q);
|
|
1675
|
+
return await N("security.saml", {
|
|
1641
1676
|
action: "getresponse",
|
|
1642
1677
|
provider: e,
|
|
1643
1678
|
tokenInCookie: !0,
|
|
1644
1679
|
originalUrl: "http://localhost"
|
|
1645
1680
|
}, { signal: t });
|
|
1646
1681
|
} catch (e) {
|
|
1647
|
-
throw
|
|
1682
|
+
throw C("Failed to authenticate with SAML", e), e;
|
|
1648
1683
|
}
|
|
1649
1684
|
let t = {
|
|
1650
1685
|
action: "getresponse",
|
|
@@ -1653,7 +1688,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1653
1688
|
originalUrl: window.location.href
|
|
1654
1689
|
};
|
|
1655
1690
|
try {
|
|
1656
|
-
let { signal: n } =
|
|
1691
|
+
let { signal: n } = P(q), r = await N("api/v1/security.saml", t, { signal: n });
|
|
1657
1692
|
if (r.redirectUrl) {
|
|
1658
1693
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1659
1694
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1663,21 +1698,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1663
1698
|
}
|
|
1664
1699
|
return r;
|
|
1665
1700
|
} catch (e) {
|
|
1666
|
-
throw
|
|
1701
|
+
throw C("Failed to authenticate with SAML", e), e;
|
|
1667
1702
|
}
|
|
1668
|
-
},
|
|
1703
|
+
}, Y = (e) => u("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), X = async () => {
|
|
1669
1704
|
let e;
|
|
1670
1705
|
try {
|
|
1671
|
-
let { signal: t } =
|
|
1672
|
-
e = await
|
|
1706
|
+
let { signal: t } = P(q);
|
|
1707
|
+
e = await j("api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, { signal: t });
|
|
1673
1708
|
} catch (e) {
|
|
1674
|
-
throw
|
|
1709
|
+
throw S("CSRF token fetch failed", e), e;
|
|
1675
1710
|
}
|
|
1676
|
-
return e?.csrfToken ? (
|
|
1711
|
+
return e?.csrfToken ? (Y(e.csrfToken), e.csrfToken) : null;
|
|
1677
1712
|
};
|
|
1678
1713
|
//#endregion
|
|
1679
1714
|
//#region src/authentication/tokens/get-jwt-token.ts
|
|
1680
|
-
async function
|
|
1715
|
+
async function Z(e) {
|
|
1681
1716
|
if (e) {
|
|
1682
1717
|
let { username: t, password: n } = e, r = {
|
|
1683
1718
|
action: "get",
|
|
@@ -1688,10 +1723,10 @@ async function Q(e) {
|
|
|
1688
1723
|
noAutoAuthentication: !0
|
|
1689
1724
|
};
|
|
1690
1725
|
try {
|
|
1691
|
-
let { signal: e } =
|
|
1692
|
-
return t?.csrfToken ? (
|
|
1726
|
+
let { signal: e } = P(q), t = await N("api/v1/security.webtoken", r, { signal: e });
|
|
1727
|
+
return t?.csrfToken ? (Y(t.csrfToken), t.csrfToken) : null;
|
|
1693
1728
|
} catch (e) {
|
|
1694
|
-
throw
|
|
1729
|
+
throw C("Failed to get JWT", e), e;
|
|
1695
1730
|
}
|
|
1696
1731
|
} else {
|
|
1697
1732
|
let e = {
|
|
@@ -1704,68 +1739,70 @@ async function Q(e) {
|
|
|
1704
1739
|
let n = new Headers();
|
|
1705
1740
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${t}`);
|
|
1706
1741
|
try {
|
|
1707
|
-
let { signal: t } =
|
|
1742
|
+
let { signal: t } = P(q), r = await N("api/v1/security.webtoken", e, {
|
|
1708
1743
|
headers: n,
|
|
1709
1744
|
signal: t
|
|
1710
1745
|
});
|
|
1711
|
-
return r?.csrfToken ? (
|
|
1746
|
+
return r?.csrfToken ? (Y(r.csrfToken), r.csrfToken) : null;
|
|
1712
1747
|
} catch (e) {
|
|
1713
|
-
throw
|
|
1748
|
+
throw C("Failed to get JWT without credentials", e), e;
|
|
1714
1749
|
}
|
|
1715
1750
|
}
|
|
1716
1751
|
}
|
|
1717
1752
|
//#endregion
|
|
1718
1753
|
//#region src/authentication/tokens/get-token.ts
|
|
1719
|
-
var
|
|
1754
|
+
var Q = () => {
|
|
1720
1755
|
let e = l("sinequa-credentials");
|
|
1721
1756
|
if (e) try {
|
|
1722
1757
|
let t = JSON.parse(e).data?.csrfToken;
|
|
1723
1758
|
if (t) return t;
|
|
1724
1759
|
} catch (e) {
|
|
1725
|
-
|
|
1760
|
+
S("Failed to parse session storage credentials, falling back to local storage", e);
|
|
1726
1761
|
}
|
|
1727
1762
|
return s("csrfToken") || null;
|
|
1728
|
-
},
|
|
1763
|
+
}, $ = "sinequa-authenticated", yn = (e) => {
|
|
1764
|
+
e ? u($, "true") : d($);
|
|
1765
|
+
}, bn = () => l($) === "true", xn = async () => {
|
|
1729
1766
|
try {
|
|
1730
|
-
let { signal: e } =
|
|
1731
|
-
return await
|
|
1767
|
+
let { signal: e } = P(q);
|
|
1768
|
+
return await j("api/v1/principal", new URLSearchParams({ action: "get" }), {
|
|
1732
1769
|
signal: e,
|
|
1733
1770
|
redirect: "manual"
|
|
1734
|
-
}),
|
|
1771
|
+
}), x("Server auto-authenticated the user (OIDC)"), !0;
|
|
1735
1772
|
} catch {
|
|
1736
1773
|
return !1;
|
|
1737
1774
|
}
|
|
1738
|
-
},
|
|
1775
|
+
}, Sn = async (n) => {
|
|
1739
1776
|
if (n) {
|
|
1740
1777
|
let { username: t, password: r } = n;
|
|
1741
|
-
return !t || !r ? (
|
|
1778
|
+
return !t || !r ? (C("Credentials are required for authentication"), e(!1), !1) : Cn({
|
|
1742
1779
|
username: t,
|
|
1743
1780
|
password: r
|
|
1744
1781
|
});
|
|
1745
1782
|
}
|
|
1746
1783
|
let a = r.authMode ?? t.unknown();
|
|
1747
1784
|
if (a.kind === "credentials") return e(!1), !1;
|
|
1748
|
-
if (a.kind === "bearer") return
|
|
1749
|
-
if (
|
|
1785
|
+
if (a.kind === "bearer") return wn();
|
|
1786
|
+
if (Q()) return i({ isRedirectUrl: !1 }), d(J), e(!0), !0;
|
|
1750
1787
|
try {
|
|
1751
|
-
if (
|
|
1788
|
+
if (x("Checking for an existing session via CSRF token retrieval"), await X()) return x("User already authenticated (existing session / SSO)"), d(J), a.kind === "unknown" && i({ authMode: t.sso() }), e(!0), !0;
|
|
1752
1789
|
} catch {}
|
|
1753
1790
|
switch (a.kind) {
|
|
1754
|
-
case "oauth": return
|
|
1755
|
-
case "saml": return
|
|
1791
|
+
case "oauth": return x("Initiating OAuth authentication flow"), await _n(), e(!1), !1;
|
|
1792
|
+
case "saml": return x("Initiating SAML authentication flow"), await vn(), e(!1), !1;
|
|
1756
1793
|
case "sso": return e(!1), !1;
|
|
1757
|
-
default: return
|
|
1794
|
+
default: return x("No provider declared — probing for server-side auto-authentication (OIDC)"), await xn() ? (x("User auto-authenticated by the server (OIDC)"), d(J), i({ authMode: t.sso() }), await X().catch(() => {}), yn(!0), e(!0), !0) : (i({ authMode: t.credentials() }), e(!1), !1);
|
|
1758
1795
|
}
|
|
1759
1796
|
};
|
|
1760
|
-
async function
|
|
1761
|
-
|
|
1797
|
+
async function Cn(n) {
|
|
1798
|
+
x("Attempting authentication using credentials"), i({ authMode: t.credentials() });
|
|
1762
1799
|
let { userOverrideActive: a, userOverride: o } = r;
|
|
1763
1800
|
i({
|
|
1764
1801
|
userOverrideActive: !1,
|
|
1765
1802
|
userOverride: void 0
|
|
1766
1803
|
});
|
|
1767
1804
|
try {
|
|
1768
|
-
await
|
|
1805
|
+
await Z(n);
|
|
1769
1806
|
} catch (t) {
|
|
1770
1807
|
throw e(!1), t;
|
|
1771
1808
|
}
|
|
@@ -1774,41 +1811,41 @@ async function vn(n) {
|
|
|
1774
1811
|
userOverride: o
|
|
1775
1812
|
}), e(!0), !0;
|
|
1776
1813
|
}
|
|
1777
|
-
async function
|
|
1814
|
+
async function wn() {
|
|
1778
1815
|
try {
|
|
1779
|
-
if (
|
|
1816
|
+
if (x("Attempting authentication using bearer token"), await Z()) return e(!0), !0;
|
|
1780
1817
|
} catch (t) {
|
|
1781
|
-
throw
|
|
1818
|
+
throw C("Bearer authentication failed", t), e(!1), t;
|
|
1782
1819
|
}
|
|
1783
1820
|
return e(!1), !1;
|
|
1784
1821
|
}
|
|
1785
1822
|
//#endregion
|
|
1786
1823
|
//#region src/authentication/tokens/delete-web-token-cookie.ts
|
|
1787
|
-
var
|
|
1824
|
+
var Tn = async () => {
|
|
1788
1825
|
let e = new URLSearchParams({
|
|
1789
1826
|
action: "deleteWebTokenCookie",
|
|
1790
1827
|
noUserOverride: "true",
|
|
1791
1828
|
noAutoAuthentication: "true"
|
|
1792
|
-
}), { signal: t } =
|
|
1793
|
-
return
|
|
1829
|
+
}), { signal: t } = P(q);
|
|
1830
|
+
return j("api/v1/challenge", e, { signal: t });
|
|
1794
1831
|
};
|
|
1795
1832
|
//#endregion
|
|
1796
1833
|
//#region src/authentication/session/logout.ts
|
|
1797
|
-
async function
|
|
1834
|
+
async function En() {
|
|
1798
1835
|
let { userOverrideActive: e } = r;
|
|
1799
|
-
if (
|
|
1800
|
-
let { methodresult: e, logoutUrl: t } = await
|
|
1836
|
+
if (Dn(), !e) try {
|
|
1837
|
+
let { methodresult: e, logoutUrl: t } = await Tn();
|
|
1801
1838
|
if (e === "ok") return t;
|
|
1802
|
-
|
|
1839
|
+
C("logout failed");
|
|
1803
1840
|
} catch (e) {
|
|
1804
|
-
|
|
1841
|
+
C("logout failed", e);
|
|
1805
1842
|
}
|
|
1806
1843
|
}
|
|
1807
|
-
function
|
|
1808
|
-
c("csrfToken"), d("sinequa-credentials"), e(!1);
|
|
1844
|
+
function Dn() {
|
|
1845
|
+
c("csrfToken"), d("sinequa-credentials"), yn(!1), e(!1);
|
|
1809
1846
|
}
|
|
1810
1847
|
//#endregion
|
|
1811
1848
|
//#region src/authentication/session/user-authentication.ts
|
|
1812
|
-
var
|
|
1849
|
+
var On = () => !!Q() || bn();
|
|
1813
1850
|
//#endregion
|
|
1814
|
-
export {
|
|
1851
|
+
export { bt as $, Ne as $t, Xt as A, P as At, zt as B, D as Bt, sn as C, ae as Cn, L as Ct, nn as D, t as Dn, We as Dt, rn as E, i as En, Ge as Et, Gt as F, j as Ft, kt as G, Ie as Gt, At as H, E as Ht, Vt as I, Be as It, Ct as J, C as Jt, Ot as K, Le as Kt, Ht as L, A as Lt, K as M, N as Mt, Jt as N, Ve as Nt, Qt as O, n as On, Ue as Ot, qt as P, M as Pt, xt as Q, Pe as Qt, Ut as R, ze as Rt, cn as S, ne as Sn, R as St, tn as T, r as Tn, Ke as Tt, Rt as U, T as Ut, Bt as V, Re as Vt, Dt as W, w as Wt, Tt as X, S as Xt, wt as Y, x as Yt, St as Z, Fe as Zt, mn as _, p as _n, $e as _t, Sn as a, Me as an, ut as at, ln as b, re as bn, Je as bt, Z as c, h as cn, ot as ct, vn as d, Ce as dn, st as dt, m as en, G as et, _n as f, ye as fn, ft, fn as g, xe as gn, V as gt, hn as h, be as hn, B as ht, Tn as i, Ee as in, lt as it, Yt as j, He as jt, Zt as k, e as kn, F as kt, X as l, Te as ln, ct as lt, pn as m, f as mn, rt as mt, Dn as n, Ae as nn, gt as nt, xn as o, ke as on, it as ot, gn as p, Se as pn, nt as pt, Et as q, b as qt, En as r, je as rn, dt as rt, Q as s, De as sn, at as st, On as t, Oe as tn, ht as tt, Y as u, we as un, H as ut, dn as v, se as vn, z as vt, an as w, te as wn, I as wt, on as x, ie as xn, qe as xt, un as y, ee as yn, Ye as yt, Wt as z, O as zt };
|