@sinequa/atomic 2.0.4 → 2.0.5
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/spfx/index.cjs +1 -1
- package/dist/spfx/index.js +2 -2
- package/dist/src-B54_W-0n.cjs +1 -0
- package/dist/{src-BW4JX9K-.js → src-D4e623or.js} +431 -424
- 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
|
+
f(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 f(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,7 +186,7 @@ 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, f(l.items, t, c, r, i, a + 1, o));
|
|
190
190
|
}
|
|
191
191
|
//#endregion
|
|
192
192
|
//#region src/utils/bisect.ts
|
|
@@ -198,8 +198,8 @@ function oe(e, t) {
|
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
200
|
//#region src/utils/concepts.ts
|
|
201
|
-
var se = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, ce = 2, le = 3, ue = 5, de = 6, fe = 8,
|
|
202
|
-
function
|
|
201
|
+
var se = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, ce = 2, le = 3, ue = 5, de = 6, fe = 8, pe = 9, me = 11, he = 12, ge = 14, _e = 15;
|
|
202
|
+
function p(e) {
|
|
203
203
|
if (!e) return [];
|
|
204
204
|
let t = [], n = e.matchAll(se);
|
|
205
205
|
for (let e of n) e[le] ? t.push({
|
|
@@ -210,22 +210,22 @@ function m(e) {
|
|
|
210
210
|
type: "adjacent",
|
|
211
211
|
value: e[de],
|
|
212
212
|
op: e[ue]
|
|
213
|
-
}) : e[
|
|
213
|
+
}) : e[pe] ? t.push({
|
|
214
214
|
type: "exact",
|
|
215
|
-
value: e[
|
|
215
|
+
value: e[pe],
|
|
216
216
|
op: e[fe]
|
|
217
|
-
}) : e[
|
|
217
|
+
}) : e[he] ? t.push({
|
|
218
218
|
type: "regex",
|
|
219
|
-
value: e[
|
|
220
|
-
op: e[
|
|
221
|
-
}) : e[
|
|
219
|
+
value: e[he],
|
|
220
|
+
op: e[me]
|
|
221
|
+
}) : e[_e] && t.push({
|
|
222
222
|
type: "token",
|
|
223
|
-
value: e[
|
|
224
|
-
op: e[
|
|
223
|
+
value: e[_e],
|
|
224
|
+
op: e[ge]
|
|
225
225
|
});
|
|
226
226
|
return t;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function m(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 ve(e, t, n) {
|
|
241
|
+
let r = p(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 m(r);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
let n =
|
|
251
|
-
return r === -1 ? t : (n.splice(r, 1), t =
|
|
252
|
-
}
|
|
253
|
-
function ye(e) {
|
|
254
|
-
return h(m(e).filter((e) => e.type !== "adjacent"));
|
|
249
|
+
function ye(e, t) {
|
|
250
|
+
let n = p(t), r = n.findIndex((t) => t.value === e);
|
|
251
|
+
return r === -1 ? t : (n.splice(r, 1), t = m(n));
|
|
255
252
|
}
|
|
256
253
|
function be(e) {
|
|
257
|
-
return m(e).filter((e) => e.type
|
|
254
|
+
return m(p(e).filter((e) => e.type !== "adjacent"));
|
|
255
|
+
}
|
|
256
|
+
function xe(e) {
|
|
257
|
+
return p(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 Se(e, t, n) {
|
|
262
|
+
let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = Ce(t, n);
|
|
263
263
|
return r.format(i * (o ? 1 : -1), a);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Ce(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 we(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 Te(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 } = g(e), [c] = e.split("?");
|
|
284
284
|
return {
|
|
285
285
|
path: c,
|
|
286
286
|
text: t,
|
|
287
|
-
filters: n ?
|
|
287
|
+
filters: n ? h(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 Ee(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 De(e) {
|
|
301
301
|
if (e === void 0) return [];
|
|
302
|
-
let { f: t } =
|
|
303
|
-
return
|
|
302
|
+
let { f: t } = g(e);
|
|
303
|
+
return h(t);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function h(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 g(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 Oe(e) {
|
|
320
|
+
let { q: t = "" } = g(e);
|
|
321
321
|
return t;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
let { id: t } =
|
|
323
|
+
function ke(e) {
|
|
324
|
+
let { id: t } = g(e);
|
|
325
325
|
return decodeURIComponent(t);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let { p: t = "0" } =
|
|
327
|
+
function Ae(e) {
|
|
328
|
+
let { p: t = "0" } = g(e);
|
|
329
329
|
return parseInt(t, 10);
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
let { t } =
|
|
331
|
+
function je(e) {
|
|
332
|
+
let { t } = g(e);
|
|
333
333
|
return t;
|
|
334
334
|
}
|
|
335
335
|
//#endregion
|
|
336
336
|
//#region src/utils/syslang.ts
|
|
337
|
-
function
|
|
337
|
+
function Me(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 = _(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 = _(e, c.end + 4, !0);
|
|
349
349
|
return e.substring(t.start, t.end);
|
|
350
|
-
} else c =
|
|
350
|
+
} else c = _(e, c.end + 4, !1);
|
|
351
351
|
return e.substring(a.start, a.end) || e;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function _(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 Ne(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 v(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 Pe = {
|
|
388
388
|
success: (e, t) => {
|
|
389
|
-
|
|
389
|
+
v({
|
|
390
390
|
type: "success",
|
|
391
391
|
message: e,
|
|
392
392
|
options: t
|
|
393
393
|
});
|
|
394
394
|
},
|
|
395
395
|
info: (e, t) => {
|
|
396
|
-
|
|
396
|
+
v({
|
|
397
397
|
type: "info",
|
|
398
398
|
message: e,
|
|
399
399
|
options: t
|
|
400
400
|
});
|
|
401
401
|
},
|
|
402
402
|
warning: (e, t) => {
|
|
403
|
-
|
|
403
|
+
v({
|
|
404
404
|
type: "warning",
|
|
405
405
|
message: e,
|
|
406
406
|
options: t
|
|
407
407
|
});
|
|
408
408
|
},
|
|
409
409
|
error: (e, t) => {
|
|
410
|
-
|
|
410
|
+
v({
|
|
411
411
|
type: "error",
|
|
412
412
|
message: e,
|
|
413
413
|
options: t
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
},
|
|
416
|
+
}, Fe = /* @__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
|
+
}({}), y = {
|
|
419
419
|
level: 1,
|
|
420
420
|
enableConsoleOutput: !0
|
|
421
421
|
};
|
|
422
|
-
function
|
|
423
|
-
|
|
424
|
-
...
|
|
422
|
+
function Ie(e) {
|
|
423
|
+
y = {
|
|
424
|
+
...y,
|
|
425
425
|
...e
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
if (e <
|
|
430
|
-
let r = `${`[${
|
|
431
|
-
if (
|
|
428
|
+
function b(e, t, n) {
|
|
429
|
+
if (e < y.level) return;
|
|
430
|
+
let r = `${`[${Fe[e]}]`} ${t}`;
|
|
431
|
+
if (y.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 x(e, t) {
|
|
447
|
+
b(0, e, t);
|
|
448
|
+
}
|
|
446
449
|
function S(e, t) {
|
|
447
|
-
|
|
450
|
+
b(1, e, t);
|
|
448
451
|
}
|
|
449
452
|
function C(e, t) {
|
|
450
|
-
|
|
453
|
+
b(2, e, t);
|
|
451
454
|
}
|
|
452
455
|
function w(e, t) {
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
function T(e, t) {
|
|
456
|
-
x(3, e, t);
|
|
456
|
+
b(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 T(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 E = 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
|
+
}, D = class extends E {
|
|
474
474
|
constructor(e = "Server error") {
|
|
475
475
|
super(e, 500), this.name = "ServerError";
|
|
476
476
|
}
|
|
477
|
-
},
|
|
477
|
+
}, Le = class extends E {
|
|
478
478
|
constructor(e = "Request timed out") {
|
|
479
479
|
super(e, 408), this.name = "TimeoutError";
|
|
480
480
|
}
|
|
481
|
-
},
|
|
481
|
+
}, O = class extends E {
|
|
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 k(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 C("Unauthorized access attempt with user override", {
|
|
503
503
|
endpoint: e.url ?? "",
|
|
504
504
|
error: t
|
|
505
|
-
}), new
|
|
505
|
+
}), new O(t.errorMessage ?? t.message ?? "Unauthorized... User override failed.");
|
|
506
506
|
}
|
|
507
|
-
return await
|
|
507
|
+
return await A(e, 401);
|
|
508
508
|
}
|
|
509
|
-
return e.status === 500 ? (
|
|
509
|
+
return e.status === 500 ? (w("Server error occurred", { endpoint: e.url ?? "" }), await A(e, 500)) : (C(`Unexpected response status: ${e.status}`, { endpoint: e.url ?? "" }), await A(e, e.status));
|
|
510
510
|
}
|
|
511
|
-
async function
|
|
511
|
+
async function A(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 O() : t === 500 ? new D() : new E(`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 E ? e : t === 401 ? new O(e.message) : t === 500 ? new D(e.message) : new E(e.message ?? `Request failed with status ${t}`, t);
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
var
|
|
527
|
+
var j = 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 Re(e) {
|
|
541
|
+
j.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 ze(e, t, n) {
|
|
546
|
+
let i = T(n?.headers), { backendUrl: a } = r, o = t ? `?${new URLSearchParams(t)}` : "", s = a ? `${a}/${e}${o}` : `${e}${o}`;
|
|
547
|
+
x(`Making DELETE request to: ${s}`);
|
|
548
548
|
try {
|
|
549
|
-
if (
|
|
550
|
-
let e =
|
|
551
|
-
return
|
|
549
|
+
if (j.isInitialized()) {
|
|
550
|
+
let e = j.getClient();
|
|
551
|
+
return k(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 k(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 w("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 M(e, t, n) {
|
|
568
|
+
let i = T(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
|
+
x(`Making GET request to: ${s}`);
|
|
572
572
|
try {
|
|
573
|
-
if (
|
|
574
|
-
let e =
|
|
575
|
-
return
|
|
573
|
+
if (j.isInitialized()) {
|
|
574
|
+
let e = j.getClient();
|
|
575
|
+
return k(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 k(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 w("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 N() {
|
|
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 Be(e, t, n) {
|
|
599
|
+
let i = T(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: N()
|
|
602
607
|
}, c = o ? `${o}/${e}` : `${e}`;
|
|
603
|
-
|
|
608
|
+
x(`Making PATCH request to: ${c}`);
|
|
604
609
|
try {
|
|
605
|
-
if (
|
|
606
|
-
let e =
|
|
607
|
-
return
|
|
610
|
+
if (j.isInitialized()) {
|
|
611
|
+
let e = j.getClient();
|
|
612
|
+
return k(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 k(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 w("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 P(e, t, n) {
|
|
631
|
+
let i = T(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: N()
|
|
634
639
|
};
|
|
635
640
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
636
641
|
let c = o ? `${o}/${e}` : `${e}`;
|
|
637
|
-
|
|
642
|
+
x(`Making POST request to: ${c}`);
|
|
638
643
|
try {
|
|
639
|
-
if (
|
|
640
|
-
let e =
|
|
641
|
-
return
|
|
644
|
+
if (j.isInitialized()) {
|
|
645
|
+
let e = j.getClient();
|
|
646
|
+
return k(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 k(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 w("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 Ve(e, t, n) {
|
|
666
|
+
let i = T(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: N()
|
|
667
672
|
}, c = `${o}/${e}`;
|
|
668
|
-
|
|
673
|
+
x(`Making PUT request to: ${c}`);
|
|
669
674
|
try {
|
|
670
|
-
if (
|
|
671
|
-
let e =
|
|
672
|
-
return
|
|
675
|
+
if (j.isInitialized()) {
|
|
676
|
+
let e = j.getClient();
|
|
677
|
+
return k(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 k(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 w("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 F(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 Le(`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 I(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 He(e) {
|
|
712
|
+
let t = I(e);
|
|
708
713
|
return !!t && t.getTime() <= Date.now();
|
|
709
714
|
}
|
|
710
|
-
function
|
|
711
|
-
let n =
|
|
715
|
+
function Ue(e, t = 7) {
|
|
716
|
+
let n = I(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 We(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 E && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
|
|
729
|
+
i < t && (C(`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 Ge(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 L = /* @__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
|
+
}({}), R = /* @__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
|
+
}({}), z = /* @__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
|
+
}({}), Ke = "1.0", qe = /* @__PURE__ */ function(e) {
|
|
750
755
|
return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
|
|
751
|
-
}({}),
|
|
756
|
+
}({}), Je = /* @__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 Ye(e) {
|
|
762
|
+
if (!e) return R.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 R.bool;
|
|
766
|
+
case "date": return R.date;
|
|
767
|
+
case "datetime": return R.dateTime;
|
|
768
|
+
case "time": return R.time;
|
|
769
|
+
case "unsigned": return R.unsigned;
|
|
770
|
+
case "integer": return R.integer;
|
|
771
|
+
case "float": return R.float;
|
|
772
|
+
case "double": return R.double;
|
|
773
|
+
case "dates": return R.dates;
|
|
774
|
+
case "datetimes": return R.dateTimes;
|
|
775
|
+
case "times": return R.times;
|
|
776
|
+
case "varchar": return R.varchar;
|
|
777
|
+
case "binary": return R.binary;
|
|
778
|
+
case "string": return R.string;
|
|
779
|
+
case "csv": return R.csv;
|
|
780
|
+
default: return R.none;
|
|
776
781
|
}
|
|
777
782
|
}
|
|
778
|
-
function
|
|
783
|
+
function Xe(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 z.a;
|
|
786
|
+
case "c": return z.c;
|
|
787
|
+
case "d": return z.d;
|
|
788
|
+
case "e": return z.e;
|
|
789
|
+
case "i": return z.i;
|
|
790
|
+
case "l": return z.l;
|
|
791
|
+
case "n": return z.n;
|
|
792
|
+
case "t": return z.t;
|
|
793
|
+
case "x": return z.x;
|
|
794
|
+
case "z": return z.z;
|
|
795
|
+
default: return z.none;
|
|
791
796
|
}
|
|
792
797
|
}
|
|
793
|
-
function
|
|
794
|
-
let t =
|
|
795
|
-
if (e) for (let n of e) t |=
|
|
798
|
+
function Ze(e) {
|
|
799
|
+
let t = z.none;
|
|
800
|
+
if (e) for (let n of e) t |= Xe(n);
|
|
796
801
|
return t;
|
|
797
802
|
}
|
|
798
|
-
function
|
|
803
|
+
function B(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: Ye(t),
|
|
809
|
+
eTypeModifier: Ze(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 Qe = {
|
|
814
|
+
id: B("id", "string"),
|
|
815
|
+
text: B("text", "varchar"),
|
|
816
|
+
documentlanguages: B("documentlanguages", "csv", "ci", ["language"]),
|
|
817
|
+
databasealias: B("databasealias", "varchar"),
|
|
818
|
+
globalrelevance: B("globalrelevance", "double"),
|
|
819
|
+
matchingpartnames: B("matchingpartnames", "csv"),
|
|
820
|
+
matchlocations: B("matchlocations", "csv"),
|
|
821
|
+
matchlocationsperpartname: B("matchlocationsperpartname", "varchar"),
|
|
822
|
+
extracts: B("extracts", "csv"),
|
|
823
|
+
extractsperpartname: B("extractsperpartname", "varchar"),
|
|
824
|
+
extractslocations: B("extractslocations", "csv"),
|
|
825
|
+
documentweight: B("documentweight", "varchar"),
|
|
826
|
+
groupcount: B("groupcount", "integer"),
|
|
827
|
+
accesslists: B("accesslists", "varchar", void 0, ["accessLists"])
|
|
823
828
|
};
|
|
824
829
|
//#endregion
|
|
825
830
|
//#region src/helpers/filters.ts
|
|
826
|
-
function
|
|
831
|
+
function $e(e) {
|
|
827
832
|
return e.filter((e) => !!e);
|
|
828
833
|
}
|
|
829
|
-
var
|
|
834
|
+
var et = {
|
|
830
835
|
eq: (e, t) => ({
|
|
831
836
|
field: e,
|
|
832
837
|
operator: "eq",
|
|
@@ -891,18 +896,18 @@ 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 = $e(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 = $e(t);
|
|
906
911
|
if (n.length !== 0) return n.length === 1 ? n[0] : {
|
|
907
912
|
operator: e,
|
|
908
913
|
filters: n
|
|
@@ -910,14 +915,14 @@ function $e(e, t) {
|
|
|
910
915
|
}
|
|
911
916
|
//#endregion
|
|
912
917
|
//#region src/helpers/metadata.ts
|
|
913
|
-
function
|
|
918
|
+
function nt(e, t) {
|
|
914
919
|
let n = e[t];
|
|
915
920
|
return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
|
|
916
921
|
if (typeof e == "string") return e.trim();
|
|
917
922
|
if (typeof e == "object" && e && "display" in e) return e.display.trim();
|
|
918
923
|
}).filter((e) => e !== void 0) : [String(n).trim()]);
|
|
919
924
|
}
|
|
920
|
-
function
|
|
925
|
+
function rt(e, t) {
|
|
921
926
|
let n = e[t];
|
|
922
927
|
if (n === void 0) return [];
|
|
923
928
|
if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
|
|
@@ -941,35 +946,35 @@ function tt(e, t) {
|
|
|
941
946
|
}
|
|
942
947
|
//#endregion
|
|
943
948
|
//#region src/helpers/utils.ts
|
|
944
|
-
function
|
|
949
|
+
function V(e) {
|
|
945
950
|
return typeof e == "object" && !!e;
|
|
946
951
|
}
|
|
947
|
-
function nt(e) {
|
|
948
|
-
return H(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
949
|
-
}
|
|
950
|
-
function rt(e) {
|
|
951
|
-
return H(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
952
|
-
}
|
|
953
952
|
function it(e) {
|
|
954
|
-
return Object.prototype.toString.call(e) === "[object
|
|
953
|
+
return V(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
955
954
|
}
|
|
956
955
|
function at(e) {
|
|
957
|
-
return
|
|
956
|
+
return V(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
958
957
|
}
|
|
959
958
|
function ot(e) {
|
|
960
|
-
return
|
|
959
|
+
return Object.prototype.toString.call(e) === "[object Date]";
|
|
961
960
|
}
|
|
962
961
|
function st(e) {
|
|
962
|
+
return typeof e == "string";
|
|
963
|
+
}
|
|
964
|
+
function ct(e) {
|
|
965
|
+
return (V(e) || Array.isArray(e)) && !it(e) && !at(e) && !st(e);
|
|
966
|
+
}
|
|
967
|
+
function lt(e) {
|
|
963
968
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
964
969
|
}
|
|
965
|
-
function
|
|
970
|
+
function H(e = !0) {
|
|
966
971
|
let t = Date.now();
|
|
967
972
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
|
|
968
973
|
let n = (t + Math.random() * 16) % 16 | 0;
|
|
969
974
|
return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
|
|
970
975
|
});
|
|
971
976
|
}
|
|
972
|
-
function
|
|
977
|
+
function ut(e) {
|
|
973
978
|
if (!e) return "``";
|
|
974
979
|
if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
|
|
975
980
|
let t = ["`"];
|
|
@@ -979,7 +984,7 @@ function lt(e) {
|
|
|
979
984
|
}
|
|
980
985
|
return t.push("`"), t.join("");
|
|
981
986
|
}
|
|
982
|
-
function
|
|
987
|
+
function dt(e) {
|
|
983
988
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function") try {
|
|
984
989
|
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
990
|
} catch {
|
|
@@ -995,51 +1000,51 @@ function U(e) {
|
|
|
995
1000
|
}
|
|
996
1001
|
//#endregion
|
|
997
1002
|
//#region src/web-api/v1/fetch-audit.ts
|
|
998
|
-
var W,
|
|
1003
|
+
var W, ft;
|
|
999
1004
|
function G(e, t = !0) {
|
|
1000
|
-
let n =
|
|
1001
|
-
n && (
|
|
1005
|
+
let n = pt(e.$auditRecord);
|
|
1006
|
+
n && (mt(n), t && ht(n)), e.$auditRecord = n;
|
|
1002
1007
|
}
|
|
1003
|
-
function
|
|
1008
|
+
function pt(e) {
|
|
1004
1009
|
if (!e) return;
|
|
1005
1010
|
let t;
|
|
1006
1011
|
if (Array.isArray(e)) t = e;
|
|
1007
|
-
else if (
|
|
1012
|
+
else if (V(e)) {
|
|
1008
1013
|
let n = e;
|
|
1009
1014
|
if (n.auditEvents || n.mlAuditEvents) return n;
|
|
1010
1015
|
t = [e];
|
|
1011
1016
|
}
|
|
1012
1017
|
return { auditEvents: t };
|
|
1013
1018
|
}
|
|
1014
|
-
function
|
|
1015
|
-
let t =
|
|
1019
|
+
function mt(e) {
|
|
1020
|
+
let t = gt();
|
|
1016
1021
|
return e.auditEvents?.forEach((e) => {
|
|
1017
1022
|
e.detail ||= {}, e.detail.sessionid = t;
|
|
1018
1023
|
}), e;
|
|
1019
1024
|
}
|
|
1020
|
-
function
|
|
1025
|
+
function ht(e) {
|
|
1021
1026
|
let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
1022
1027
|
return e?.auditEvents?.forEach((e) => {
|
|
1023
1028
|
e.detail ||= {}, e.detail.url = t;
|
|
1024
1029
|
}), e;
|
|
1025
1030
|
}
|
|
1026
|
-
function ht() {
|
|
1027
|
-
return (!W || gt()) && (W = ct()), dt = /* @__PURE__ */ new Date(), W;
|
|
1028
|
-
}
|
|
1029
1031
|
function gt() {
|
|
1030
|
-
return (
|
|
1032
|
+
return (!W || _t()) && (W = H()), ft = /* @__PURE__ */ new Date(), W;
|
|
1031
1033
|
}
|
|
1032
|
-
|
|
1034
|
+
function _t() {
|
|
1035
|
+
return (/* @__PURE__ */ new Date()).getTime() - ft.getTime() > 600 * 1e3;
|
|
1036
|
+
}
|
|
1037
|
+
async function vt(e, t = !0) {
|
|
1033
1038
|
let n = {
|
|
1034
|
-
event:
|
|
1039
|
+
event: L.None,
|
|
1035
1040
|
$auditRecord: e
|
|
1036
1041
|
};
|
|
1037
|
-
return G(n, t),
|
|
1042
|
+
return G(n, t), P("api/v1/audit.notify", n);
|
|
1038
1043
|
}
|
|
1039
|
-
var
|
|
1044
|
+
var yt = { notify: vt };
|
|
1040
1045
|
//#endregion
|
|
1041
1046
|
//#region src/web-api/v1/fetch-aggregation.ts
|
|
1042
|
-
async function
|
|
1047
|
+
async function bt(e, t, n) {
|
|
1043
1048
|
let r = e.items?.length || 0, i = {
|
|
1044
1049
|
query: {
|
|
1045
1050
|
...t,
|
|
@@ -1052,12 +1057,12 @@ async function yt(e, t, n) {
|
|
|
1052
1057
|
$auditRecord: { auditEvents: [n] }
|
|
1053
1058
|
};
|
|
1054
1059
|
G(i);
|
|
1055
|
-
let { aggregations: a } = await
|
|
1060
|
+
let { aggregations: a } = await k(await P("api/v1/query", i)), o = a[0];
|
|
1056
1061
|
return o.$hasMore = o.items.length > 10, o.items = [...e.items, ...o.items], Promise.resolve(o);
|
|
1057
1062
|
}
|
|
1058
1063
|
//#endregion
|
|
1059
1064
|
//#region src/authentication/session/detect-auth-mode.ts
|
|
1060
|
-
function
|
|
1065
|
+
function xt(e, n) {
|
|
1061
1066
|
if (e.authMode?.kind === "credentials") return t.credentials();
|
|
1062
1067
|
if (e.bearerToken) return t.bearer(e.bearerToken);
|
|
1063
1068
|
let r = e.autoOAuthProvider || n?.autoOAuthProvider;
|
|
@@ -1067,18 +1072,18 @@ function bt(e, n) {
|
|
|
1067
1072
|
}
|
|
1068
1073
|
//#endregion
|
|
1069
1074
|
//#region src/web-api/v1/fetch-app.ts
|
|
1070
|
-
async function
|
|
1075
|
+
async function St(e) {
|
|
1071
1076
|
let t = e || r.app;
|
|
1072
|
-
return
|
|
1077
|
+
return M("api/v1/app", new URLSearchParams({ app: t || "" }));
|
|
1073
1078
|
}
|
|
1074
|
-
async function
|
|
1079
|
+
async function Ct() {
|
|
1075
1080
|
let { app: e } = r;
|
|
1076
|
-
return
|
|
1081
|
+
return M("api/v1/app", new URLSearchParams({
|
|
1077
1082
|
app: e || "",
|
|
1078
1083
|
preLogin: "true"
|
|
1079
1084
|
}));
|
|
1080
1085
|
}
|
|
1081
|
-
function
|
|
1086
|
+
function wt() {
|
|
1082
1087
|
let { backendUrl: e, app: n } = r;
|
|
1083
1088
|
if (typeof window < "u") {
|
|
1084
1089
|
if (e ||= window.location.origin, !n) {
|
|
@@ -1095,37 +1100,37 @@ function Ct() {
|
|
|
1095
1100
|
autoOAuthProvider: void 0,
|
|
1096
1101
|
autoSAMLProvider: void 0,
|
|
1097
1102
|
bearerToken: void 0
|
|
1098
|
-
}), Promise.resolve({})) :
|
|
1099
|
-
authMode:
|
|
1103
|
+
}), Promise.resolve({})) : Ct().then((e) => (i({
|
|
1104
|
+
authMode: xt(r, e),
|
|
1100
1105
|
autoOAuthProvider: r.autoOAuthProvider || e.autoOAuthProvider,
|
|
1101
1106
|
autoSAMLProvider: r.autoSAMLProvider || e.autoSAMLProvider
|
|
1102
1107
|
}), e)).catch((e) => {
|
|
1103
|
-
throw
|
|
1108
|
+
throw w("atomic:fetchAppPreLogin error", e), e;
|
|
1104
1109
|
});
|
|
1105
1110
|
}
|
|
1106
|
-
var
|
|
1111
|
+
var Tt = wt;
|
|
1107
1112
|
//#endregion
|
|
1108
1113
|
//#region src/web-api/v1/fetch-dataset.ts
|
|
1109
|
-
async function
|
|
1110
|
-
let r = await
|
|
1114
|
+
async function Et(e, t, n = {}) {
|
|
1115
|
+
let r = await P(`api/v1/search.dataset/${e}/${t}`, { parameters: n }), i = t[0].toLowerCase() + t.slice(1), a = r.datasets[i];
|
|
1111
1116
|
if ("errorCode" in a && "errorMessage" in a) throw Error(a.errorMessage);
|
|
1112
1117
|
return a;
|
|
1113
1118
|
}
|
|
1114
|
-
async function
|
|
1119
|
+
async function Dt(e, t) {
|
|
1115
1120
|
let n = `api/v1/search.dataset/${e}`, { parameters: r = {}, datasets: i = [] } = t;
|
|
1116
|
-
return (await
|
|
1121
|
+
return (await P(n, {
|
|
1117
1122
|
parameters: r,
|
|
1118
1123
|
datasets: i
|
|
1119
1124
|
})).datasets;
|
|
1120
1125
|
}
|
|
1121
|
-
async function
|
|
1122
|
-
return await
|
|
1126
|
+
async function Ot(e) {
|
|
1127
|
+
return await M(`api/v1/search.dataset/${e}`);
|
|
1123
1128
|
}
|
|
1124
1129
|
//#endregion
|
|
1125
1130
|
//#region src/web-api/v1/fetch-labels.ts
|
|
1126
|
-
async function
|
|
1131
|
+
async function kt(e, t = !0, n) {
|
|
1127
1132
|
try {
|
|
1128
|
-
return (await
|
|
1133
|
+
return (await P("api/v1/labels", {
|
|
1129
1134
|
action: "list",
|
|
1130
1135
|
q: e,
|
|
1131
1136
|
public: t,
|
|
@@ -1133,30 +1138,30 @@ async function Ot(e, t = !0, n) {
|
|
|
1133
1138
|
localize: !1
|
|
1134
1139
|
})).labels;
|
|
1135
1140
|
} catch (e) {
|
|
1136
|
-
throw
|
|
1141
|
+
throw w("Error in fetchLabels", e), e;
|
|
1137
1142
|
}
|
|
1138
1143
|
}
|
|
1139
|
-
async function
|
|
1144
|
+
async function At() {
|
|
1140
1145
|
try {
|
|
1141
1146
|
let { app: e = "" } = r;
|
|
1142
|
-
return
|
|
1147
|
+
return M("api/v1/labels", new URLSearchParams({
|
|
1143
1148
|
app: e,
|
|
1144
1149
|
action: "getUserRights"
|
|
1145
1150
|
}));
|
|
1146
1151
|
} catch (e) {
|
|
1147
|
-
throw
|
|
1152
|
+
throw w("Error in getUserRights", e), e;
|
|
1148
1153
|
}
|
|
1149
1154
|
}
|
|
1150
|
-
async function
|
|
1155
|
+
async function jt(e, t, n = !0) {
|
|
1151
1156
|
try {
|
|
1152
|
-
return
|
|
1157
|
+
return P("api/v1/labels", {
|
|
1153
1158
|
action: "add",
|
|
1154
1159
|
labels: e,
|
|
1155
1160
|
ids: t,
|
|
1156
1161
|
public: n,
|
|
1157
1162
|
$auditRecord: {
|
|
1158
1163
|
auditEvents: [{
|
|
1159
|
-
type:
|
|
1164
|
+
type: L.Label_AddDoc,
|
|
1160
1165
|
detail: {
|
|
1161
1166
|
public: n,
|
|
1162
1167
|
label: e ? e.toString() : null,
|
|
@@ -1170,19 +1175,19 @@ async function At(e, t, n = !0) {
|
|
|
1170
1175
|
}
|
|
1171
1176
|
});
|
|
1172
1177
|
} catch (e) {
|
|
1173
|
-
throw
|
|
1178
|
+
throw w("Error in add", e), e;
|
|
1174
1179
|
}
|
|
1175
1180
|
}
|
|
1176
|
-
async function
|
|
1181
|
+
async function Mt(e, t, n = !0) {
|
|
1177
1182
|
try {
|
|
1178
|
-
return
|
|
1183
|
+
return P("api/v1/labels", {
|
|
1179
1184
|
action: "remove",
|
|
1180
1185
|
labels: e,
|
|
1181
1186
|
ids: t,
|
|
1182
1187
|
public: n,
|
|
1183
1188
|
$auditRecord: {
|
|
1184
1189
|
auditEvents: [{
|
|
1185
|
-
type:
|
|
1190
|
+
type: L.Label_RemoveDoc,
|
|
1186
1191
|
detail: {
|
|
1187
1192
|
public: n,
|
|
1188
1193
|
label: e ? e.toString() : null,
|
|
@@ -1196,18 +1201,18 @@ async function jt(e, t, n = !0) {
|
|
|
1196
1201
|
}
|
|
1197
1202
|
});
|
|
1198
1203
|
} catch (e) {
|
|
1199
|
-
throw
|
|
1204
|
+
throw w("Error in remove", e), e;
|
|
1200
1205
|
}
|
|
1201
1206
|
}
|
|
1202
|
-
async function
|
|
1207
|
+
async function Nt(e, t, n = !0) {
|
|
1203
1208
|
try {
|
|
1204
|
-
return
|
|
1209
|
+
return P("api/v1/labels", {
|
|
1205
1210
|
action: "rename",
|
|
1206
1211
|
labels: e,
|
|
1207
1212
|
newLabel: t,
|
|
1208
1213
|
public: n,
|
|
1209
1214
|
auditEvents: {
|
|
1210
|
-
type:
|
|
1215
|
+
type: L.Label_Rename,
|
|
1211
1216
|
detail: {
|
|
1212
1217
|
public: n,
|
|
1213
1218
|
oldlabel: e ? e.toString() : null,
|
|
@@ -1216,17 +1221,17 @@ async function Mt(e, t, n = !0) {
|
|
|
1216
1221
|
}
|
|
1217
1222
|
});
|
|
1218
1223
|
} catch (e) {
|
|
1219
|
-
throw
|
|
1224
|
+
throw w("Error in rename", e), e;
|
|
1220
1225
|
}
|
|
1221
1226
|
}
|
|
1222
|
-
async function
|
|
1227
|
+
async function Pt(e, t = !0) {
|
|
1223
1228
|
try {
|
|
1224
|
-
return
|
|
1229
|
+
return P("api/v1/labels", {
|
|
1225
1230
|
action: "delete",
|
|
1226
1231
|
labels: e,
|
|
1227
1232
|
public: t,
|
|
1228
1233
|
auditEvents: {
|
|
1229
|
-
type:
|
|
1234
|
+
type: L.Label_Delete,
|
|
1230
1235
|
detail: {
|
|
1231
1236
|
public: t,
|
|
1232
1237
|
label: e ? e.toString() : null
|
|
@@ -1234,18 +1239,18 @@ async function Nt(e, t = !0) {
|
|
|
1234
1239
|
}
|
|
1235
1240
|
});
|
|
1236
1241
|
} catch (e) {
|
|
1237
|
-
throw
|
|
1242
|
+
throw w("Error in deleteLabels", e), e;
|
|
1238
1243
|
}
|
|
1239
1244
|
}
|
|
1240
|
-
async function
|
|
1245
|
+
async function Ft(e, t, n = !0) {
|
|
1241
1246
|
try {
|
|
1242
|
-
return
|
|
1247
|
+
return P("api/v1/labels", {
|
|
1243
1248
|
action: "bulkAdd",
|
|
1244
1249
|
labels: e,
|
|
1245
1250
|
query: t,
|
|
1246
1251
|
public: n,
|
|
1247
1252
|
auditEvents: {
|
|
1248
|
-
type:
|
|
1253
|
+
type: L.Label_Add,
|
|
1249
1254
|
detail: {
|
|
1250
1255
|
public: n,
|
|
1251
1256
|
label: e ? e.toString() : null,
|
|
@@ -1254,18 +1259,18 @@ async function Pt(e, t, n = !0) {
|
|
|
1254
1259
|
}
|
|
1255
1260
|
});
|
|
1256
1261
|
} catch (e) {
|
|
1257
|
-
throw
|
|
1262
|
+
throw w("Error in bulkAdd", e), e;
|
|
1258
1263
|
}
|
|
1259
1264
|
}
|
|
1260
|
-
async function
|
|
1265
|
+
async function It(e, t, n = !0) {
|
|
1261
1266
|
try {
|
|
1262
|
-
return
|
|
1267
|
+
return P("api/v1/labels", {
|
|
1263
1268
|
action: "bulkRemove",
|
|
1264
1269
|
labels: e,
|
|
1265
1270
|
query: t,
|
|
1266
1271
|
public: n,
|
|
1267
1272
|
auditEvents: {
|
|
1268
|
-
type:
|
|
1273
|
+
type: L.Label_Delete,
|
|
1269
1274
|
detail: {
|
|
1270
1275
|
public: n,
|
|
1271
1276
|
label: e ? e.toString() : null,
|
|
@@ -1274,28 +1279,28 @@ async function Ft(e, t, n = !0) {
|
|
|
1274
1279
|
}
|
|
1275
1280
|
});
|
|
1276
1281
|
} catch (e) {
|
|
1277
|
-
throw
|
|
1282
|
+
throw w("Error in bulkRemove", e), e;
|
|
1278
1283
|
}
|
|
1279
1284
|
}
|
|
1280
|
-
var
|
|
1281
|
-
getUserRights:
|
|
1282
|
-
add:
|
|
1283
|
-
remove:
|
|
1284
|
-
rename:
|
|
1285
|
-
delete:
|
|
1286
|
-
bulkAdd:
|
|
1287
|
-
bulkRemove:
|
|
1285
|
+
var Lt = {
|
|
1286
|
+
getUserRights: At,
|
|
1287
|
+
add: jt,
|
|
1288
|
+
remove: Mt,
|
|
1289
|
+
rename: Nt,
|
|
1290
|
+
delete: Pt,
|
|
1291
|
+
bulkAdd: Ft,
|
|
1292
|
+
bulkRemove: It
|
|
1288
1293
|
};
|
|
1289
1294
|
//#endregion
|
|
1290
1295
|
//#region src/web-api/v1/fetch-preview.ts
|
|
1291
|
-
async function
|
|
1292
|
-
if (typeof window > "u") return
|
|
1296
|
+
async function Rt(e, t) {
|
|
1297
|
+
if (typeof window > "u") return P("api/v1/preview", {
|
|
1293
1298
|
action: "get",
|
|
1294
1299
|
id: e,
|
|
1295
1300
|
query: t
|
|
1296
1301
|
});
|
|
1297
1302
|
let n = `${window.location.origin}${window.location.pathname}`;
|
|
1298
|
-
return
|
|
1303
|
+
return P("api/v1/preview", {
|
|
1299
1304
|
action: "get",
|
|
1300
1305
|
id: e,
|
|
1301
1306
|
query: {
|
|
@@ -1305,57 +1310,57 @@ async function Lt(e, t) {
|
|
|
1305
1310
|
browserUrl: n
|
|
1306
1311
|
});
|
|
1307
1312
|
}
|
|
1308
|
-
async function
|
|
1313
|
+
async function zt(e) {
|
|
1309
1314
|
let t = new Headers();
|
|
1310
|
-
t.append("content-type", "text"),
|
|
1315
|
+
t.append("content-type", "text"), k(await fetch(e, {
|
|
1311
1316
|
method: "GET",
|
|
1312
1317
|
headers: t
|
|
1313
1318
|
}));
|
|
1314
1319
|
}
|
|
1315
1320
|
//#endregion
|
|
1316
1321
|
//#region src/web-api/v1/fetch-principal.ts
|
|
1317
|
-
async function
|
|
1318
|
-
return
|
|
1322
|
+
async function Bt() {
|
|
1323
|
+
return M("api/v1/principal", new URLSearchParams({
|
|
1319
1324
|
action: "get",
|
|
1320
|
-
noAutoAuthentication:
|
|
1325
|
+
noAutoAuthentication: String(N())
|
|
1321
1326
|
}));
|
|
1322
1327
|
}
|
|
1323
|
-
async function
|
|
1328
|
+
async function Vt(e) {
|
|
1324
1329
|
let t = {
|
|
1325
|
-
noAutoAuthentication:
|
|
1330
|
+
noAutoAuthentication: String(N()),
|
|
1326
1331
|
...e
|
|
1327
1332
|
}, n = new URLSearchParams();
|
|
1328
1333
|
return Object.entries(t).forEach(([e, t]) => {
|
|
1329
1334
|
t !== void 0 && n.append(e, String(t));
|
|
1330
|
-
}),
|
|
1335
|
+
}), M("api/v1/principal/list", n);
|
|
1331
1336
|
}
|
|
1332
|
-
async function
|
|
1333
|
-
return e ?
|
|
1337
|
+
async function Ht(e) {
|
|
1338
|
+
return e ? M("api/v1/principal", new URLSearchParams({
|
|
1334
1339
|
action: "userid",
|
|
1335
|
-
noAutoAuthentication:
|
|
1340
|
+
noAutoAuthentication: String(N()),
|
|
1336
1341
|
userid: e
|
|
1337
1342
|
})) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
|
|
1338
1343
|
}
|
|
1339
|
-
async function
|
|
1340
|
-
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) :
|
|
1341
|
-
noAutoAuthentication:
|
|
1344
|
+
async function Ut(e) {
|
|
1345
|
+
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : M("api/v1/principal/userids", new URLSearchParams({
|
|
1346
|
+
noAutoAuthentication: String(N()),
|
|
1342
1347
|
userids: [...e].join(",")
|
|
1343
1348
|
}));
|
|
1344
1349
|
}
|
|
1345
|
-
var
|
|
1346
|
-
get:
|
|
1347
|
-
list:
|
|
1348
|
-
userid:
|
|
1349
|
-
userids:
|
|
1350
|
-
} },
|
|
1351
|
-
async function
|
|
1352
|
-
let r = await
|
|
1350
|
+
var Wt = { principal: {
|
|
1351
|
+
get: Bt,
|
|
1352
|
+
list: Vt,
|
|
1353
|
+
userid: Ht,
|
|
1354
|
+
userids: Ut
|
|
1355
|
+
} }, Gt = 11;
|
|
1356
|
+
async function Kt(e, t, n) {
|
|
1357
|
+
let r = await P("api/v1/query", {
|
|
1353
1358
|
query: e,
|
|
1354
1359
|
$auditRecord: t,
|
|
1355
1360
|
queryIntentData: n
|
|
1356
1361
|
});
|
|
1357
1362
|
r.aggregations.forEach((e) => {
|
|
1358
|
-
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length ===
|
|
1363
|
+
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Gt), e.isTree && e.items && K(e);
|
|
1359
1364
|
}), r.records?.map((e) => Object.assign(e, {
|
|
1360
1365
|
value: e.title,
|
|
1361
1366
|
type: "default"
|
|
@@ -1367,7 +1372,7 @@ async function Gt(e, t, n) {
|
|
|
1367
1372
|
};
|
|
1368
1373
|
return Promise.resolve(i);
|
|
1369
1374
|
}
|
|
1370
|
-
async function
|
|
1375
|
+
async function qt(e, t, n) {
|
|
1371
1376
|
let { app: i = "" } = r, a = {
|
|
1372
1377
|
methods: [],
|
|
1373
1378
|
mode: t,
|
|
@@ -1379,10 +1384,10 @@ async function Kt(e, t, n) {
|
|
|
1379
1384
|
app: i,
|
|
1380
1385
|
query: t
|
|
1381
1386
|
});
|
|
1382
|
-
let o = await
|
|
1387
|
+
let o = await P("api/v1/multi", a);
|
|
1383
1388
|
o.results.forEach((e) => {
|
|
1384
1389
|
e.aggregations.forEach((e) => {
|
|
1385
|
-
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length ===
|
|
1390
|
+
e.$hasMore = !1, !e.isDistribution && !e.isTree && e.items && (e.$hasMore = e.items.length === Gt), e.isTree && K(e);
|
|
1386
1391
|
});
|
|
1387
1392
|
}), o.results.forEach((e) => e.records?.map((e) => Object.assign(e, {
|
|
1388
1393
|
value: e.title,
|
|
@@ -1407,7 +1412,7 @@ function K(e, t = "", n = 0) {
|
|
|
1407
1412
|
}
|
|
1408
1413
|
//#endregion
|
|
1409
1414
|
//#region src/web-api/v1/fetch-query-export.ts
|
|
1410
|
-
async function
|
|
1415
|
+
async function Jt({ model: e, appName: t, query: n, article: r }) {
|
|
1411
1416
|
let { webservice: i, format: a, maxcount: o, exportedColumns: s, export: c } = e, l = {
|
|
1412
1417
|
app: t,
|
|
1413
1418
|
webservice: i,
|
|
@@ -1421,25 +1426,25 @@ async function qt({ model: e, appName: t, query: n, article: r }) {
|
|
|
1421
1426
|
detail: { resultid: r ? r.id : void 0 }
|
|
1422
1427
|
}] }
|
|
1423
1428
|
};
|
|
1424
|
-
return G(l), await
|
|
1429
|
+
return G(l), await P("api/v1/search.queryexport", l, { responseType: "blob" });
|
|
1425
1430
|
}
|
|
1426
1431
|
//#endregion
|
|
1427
1432
|
//#region src/web-api/v1/fetch-query-intent.ts
|
|
1428
|
-
async function
|
|
1429
|
-
return (await
|
|
1433
|
+
async function Yt(e) {
|
|
1434
|
+
return (await P("api/v1/queryintent", { query: e }))?.intents;
|
|
1430
1435
|
}
|
|
1431
1436
|
//#endregion
|
|
1432
1437
|
//#region src/web-api/v1/fetch-similar-documents.ts
|
|
1433
|
-
async function
|
|
1434
|
-
return (await
|
|
1438
|
+
async function Xt(e, t, n) {
|
|
1439
|
+
return (await P("api/v1/similardocuments", {
|
|
1435
1440
|
sourceDocumentId: e,
|
|
1436
1441
|
query: { name: t }
|
|
1437
1442
|
}, { signal: n })).data;
|
|
1438
1443
|
}
|
|
1439
1444
|
//#endregion
|
|
1440
1445
|
//#region src/web-api/v1/fetch-sponsored-links.ts
|
|
1441
|
-
async function
|
|
1442
|
-
return (await
|
|
1446
|
+
async function Zt(e, t) {
|
|
1447
|
+
return (await P("api/v1/query.links", {
|
|
1443
1448
|
webservice: e,
|
|
1444
1449
|
query: t
|
|
1445
1450
|
}))?.links?.map((e) => ({
|
|
@@ -1449,9 +1454,9 @@ async function Xt(e, t) {
|
|
|
1449
1454
|
}
|
|
1450
1455
|
//#endregion
|
|
1451
1456
|
//#region src/utils/to-sql.ts
|
|
1452
|
-
function
|
|
1457
|
+
function Qt(e, t) {
|
|
1453
1458
|
if (typeof e == "number") return `${e}`;
|
|
1454
|
-
if (
|
|
1459
|
+
if (ot(e)) return t ? `'${$t(e)}'` : $t(e);
|
|
1455
1460
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
1456
1461
|
if (e === null) return "null";
|
|
1457
1462
|
if (Array.isArray(e)) {
|
|
@@ -1462,10 +1467,10 @@ function Zt(e, t) {
|
|
|
1462
1467
|
}
|
|
1463
1468
|
return t ? `'${e}'` : e;
|
|
1464
1469
|
}
|
|
1465
|
-
function
|
|
1470
|
+
function $t(e) {
|
|
1466
1471
|
if (!e) return "";
|
|
1467
1472
|
try {
|
|
1468
|
-
return
|
|
1473
|
+
return lt(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
|
|
1469
1474
|
year: "numeric",
|
|
1470
1475
|
month: "2-digit",
|
|
1471
1476
|
day: "2-digit"
|
|
@@ -1481,7 +1486,7 @@ function Qt(e) {
|
|
|
1481
1486
|
}
|
|
1482
1487
|
//#endregion
|
|
1483
1488
|
//#region src/web-api/v1/fetch-suggest.ts
|
|
1484
|
-
async function
|
|
1489
|
+
async function en(e, t, n, i, a) {
|
|
1485
1490
|
let { app: o } = r, s = {
|
|
1486
1491
|
app: o || "",
|
|
1487
1492
|
suggestQuery: e,
|
|
@@ -1491,14 +1496,14 @@ async function $t(e, t, n, i, a) {
|
|
|
1491
1496
|
showSource: a
|
|
1492
1497
|
};
|
|
1493
1498
|
try {
|
|
1494
|
-
return (await
|
|
1499
|
+
return (await P("api/v1/search.suggest", s)).suggests;
|
|
1495
1500
|
} catch (e) {
|
|
1496
1501
|
throw console.error("Error fetching suggestions:", e), e;
|
|
1497
1502
|
}
|
|
1498
1503
|
}
|
|
1499
|
-
async function
|
|
1504
|
+
async function tn(e, t, n, i) {
|
|
1500
1505
|
let { app: a } = r;
|
|
1501
|
-
return (await
|
|
1506
|
+
return (await P("api/v1/suggestquery", {
|
|
1502
1507
|
app: a || "",
|
|
1503
1508
|
suggestQuery: e,
|
|
1504
1509
|
text: t,
|
|
@@ -1506,22 +1511,22 @@ async function en(e, t, n, i) {
|
|
|
1506
1511
|
kinds: i
|
|
1507
1512
|
})).suggests;
|
|
1508
1513
|
}
|
|
1509
|
-
async function
|
|
1514
|
+
async function nn(e, t, n) {
|
|
1510
1515
|
if (!t) return Promise.resolve([]);
|
|
1511
|
-
let { app: i } = r, a = await
|
|
1516
|
+
let { app: i } = r, a = await P("api/v1/suggestfield", {
|
|
1512
1517
|
app: i || "",
|
|
1513
1518
|
text: e,
|
|
1514
1519
|
fields: t,
|
|
1515
1520
|
query: n
|
|
1516
1521
|
});
|
|
1517
1522
|
return a.suggests.forEach((e) => {
|
|
1518
|
-
e.display =
|
|
1523
|
+
e.display = Qt(e.display);
|
|
1519
1524
|
}), a.suggests;
|
|
1520
1525
|
}
|
|
1521
1526
|
//#endregion
|
|
1522
1527
|
//#region src/web-api/v1/fetch-text-chunk.ts
|
|
1523
|
-
async function
|
|
1524
|
-
return
|
|
1528
|
+
async function rn(e, t, n, r, i, a) {
|
|
1529
|
+
return P("api/v1/doc.textchunks", {
|
|
1525
1530
|
id: e,
|
|
1526
1531
|
textChunks: t,
|
|
1527
1532
|
highlights: n,
|
|
@@ -1532,86 +1537,86 @@ async function nn(e, t, n, r, i, a) {
|
|
|
1532
1537
|
}
|
|
1533
1538
|
//#endregion
|
|
1534
1539
|
//#region src/web-api/v1/fetch-user-settings.ts
|
|
1535
|
-
async function
|
|
1540
|
+
async function an() {
|
|
1536
1541
|
let { app: e } = r;
|
|
1537
|
-
return
|
|
1542
|
+
return M("api/v1/usersettings", new URLSearchParams({
|
|
1538
1543
|
app: e || "",
|
|
1539
1544
|
action: "load"
|
|
1540
1545
|
}));
|
|
1541
1546
|
}
|
|
1542
|
-
async function
|
|
1547
|
+
async function on(e, t) {
|
|
1543
1548
|
let n = {
|
|
1544
1549
|
action: "save",
|
|
1545
1550
|
userSettings: e,
|
|
1546
1551
|
$auditRecord: { auditEvents: [t] }
|
|
1547
1552
|
};
|
|
1548
|
-
return G(n),
|
|
1553
|
+
return G(n), P("api/v1/usersettings", n);
|
|
1549
1554
|
}
|
|
1550
|
-
async function
|
|
1555
|
+
async function sn(e, t) {
|
|
1551
1556
|
let n = {
|
|
1552
1557
|
action: "patch",
|
|
1553
1558
|
userSettings: e,
|
|
1554
1559
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1555
1560
|
};
|
|
1556
|
-
return G(n),
|
|
1561
|
+
return G(n), P("api/v1/usersettings", n);
|
|
1557
1562
|
}
|
|
1558
|
-
async function
|
|
1559
|
-
return
|
|
1563
|
+
async function cn() {
|
|
1564
|
+
return on({}, { type: "UserSettings_Reset" });
|
|
1560
1565
|
}
|
|
1561
1566
|
//#endregion
|
|
1562
1567
|
//#region src/web-api/v2/fetch-change-password.ts
|
|
1563
|
-
async function
|
|
1564
|
-
return
|
|
1568
|
+
async function ln(e, t) {
|
|
1569
|
+
return P("api/v2/security/password/change", {
|
|
1565
1570
|
newPassword: e,
|
|
1566
1571
|
currentPassword: t
|
|
1567
1572
|
});
|
|
1568
1573
|
}
|
|
1569
1574
|
//#endregion
|
|
1570
1575
|
//#region src/web-api/v2/fetch-forgot-password.ts
|
|
1571
|
-
async function
|
|
1572
|
-
return
|
|
1576
|
+
async function un(e) {
|
|
1577
|
+
return P("api/v2/security/password/ask-reset-email", {
|
|
1573
1578
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1574
1579
|
userName: e
|
|
1575
1580
|
});
|
|
1576
1581
|
}
|
|
1577
1582
|
//#endregion
|
|
1578
1583
|
//#region src/web-api/v2/fetch-user-profile.ts
|
|
1579
|
-
async function un(e) {
|
|
1580
|
-
return await P(`api/v2/user-profile/${e}`);
|
|
1581
|
-
}
|
|
1582
1584
|
async function dn(e) {
|
|
1583
|
-
return await
|
|
1585
|
+
return await M(`api/v2/user-profile/${e}`);
|
|
1584
1586
|
}
|
|
1585
|
-
async function fn(e
|
|
1586
|
-
return await
|
|
1587
|
+
async function fn(e) {
|
|
1588
|
+
return await P("api/v2/user-profile", e);
|
|
1587
1589
|
}
|
|
1588
1590
|
async function pn(e, t, n) {
|
|
1591
|
+
return await Be(`api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
|
|
1592
|
+
}
|
|
1593
|
+
async function mn(e, t, n) {
|
|
1589
1594
|
try {
|
|
1590
|
-
return (await
|
|
1595
|
+
return (await ze(`api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
|
|
1591
1596
|
} catch {
|
|
1592
1597
|
return !1;
|
|
1593
1598
|
}
|
|
1594
1599
|
}
|
|
1595
1600
|
//#endregion
|
|
1596
1601
|
//#region src/web-api/v2/fetch-version.ts
|
|
1597
|
-
async function
|
|
1598
|
-
return await
|
|
1602
|
+
async function hn() {
|
|
1603
|
+
return await M("api/v2/version");
|
|
1599
1604
|
}
|
|
1600
1605
|
//#endregion
|
|
1601
1606
|
//#region src/authentication/constants.ts
|
|
1602
|
-
var q = 1e4, J = "sinequa-auth-redirect-attempt",
|
|
1607
|
+
var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
|
|
1603
1608
|
let { autoOAuthProvider: e } = r;
|
|
1604
1609
|
if (!e) throw Error("autoOAuthProvider is not configured in globalConfig");
|
|
1605
1610
|
if (typeof window > "u") try {
|
|
1606
|
-
let { signal: t } =
|
|
1607
|
-
return await
|
|
1611
|
+
let { signal: t } = F(q);
|
|
1612
|
+
return await P("security.oauth", {
|
|
1608
1613
|
action: "getcode",
|
|
1609
1614
|
provider: e,
|
|
1610
1615
|
tokenInCookie: !0,
|
|
1611
1616
|
originalUrl: "http://localhost"
|
|
1612
1617
|
}, { signal: t });
|
|
1613
1618
|
} catch (e) {
|
|
1614
|
-
throw
|
|
1619
|
+
throw w("Failed to authenticate with OAuth", e), e;
|
|
1615
1620
|
}
|
|
1616
1621
|
let t = {
|
|
1617
1622
|
action: "getcode",
|
|
@@ -1620,7 +1625,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1620
1625
|
originalUrl: window.location.href
|
|
1621
1626
|
};
|
|
1622
1627
|
try {
|
|
1623
|
-
let { signal: n } =
|
|
1628
|
+
let { signal: n } = F(q), r = await P("api/v1/security.oauth", t, { signal: n });
|
|
1624
1629
|
if (r.redirectUrl) {
|
|
1625
1630
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1626
1631
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1630,21 +1635,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1630
1635
|
}
|
|
1631
1636
|
return r;
|
|
1632
1637
|
} catch (e) {
|
|
1633
|
-
throw
|
|
1638
|
+
throw w("Failed to authenticate with OAuth", e), e;
|
|
1634
1639
|
}
|
|
1635
|
-
},
|
|
1640
|
+
}, _n = async () => {
|
|
1636
1641
|
let { autoSAMLProvider: e } = r;
|
|
1637
1642
|
if (!e) throw Error("autoSAMLProvider is not configured in globalConfig");
|
|
1638
1643
|
if (typeof window > "u") try {
|
|
1639
|
-
let { signal: t } =
|
|
1640
|
-
return await
|
|
1644
|
+
let { signal: t } = F(q);
|
|
1645
|
+
return await P("security.saml", {
|
|
1641
1646
|
action: "getresponse",
|
|
1642
1647
|
provider: e,
|
|
1643
1648
|
tokenInCookie: !0,
|
|
1644
1649
|
originalUrl: "http://localhost"
|
|
1645
1650
|
}, { signal: t });
|
|
1646
1651
|
} catch (e) {
|
|
1647
|
-
throw
|
|
1652
|
+
throw w("Failed to authenticate with SAML", e), e;
|
|
1648
1653
|
}
|
|
1649
1654
|
let t = {
|
|
1650
1655
|
action: "getresponse",
|
|
@@ -1653,7 +1658,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1653
1658
|
originalUrl: window.location.href
|
|
1654
1659
|
};
|
|
1655
1660
|
try {
|
|
1656
|
-
let { signal: n } =
|
|
1661
|
+
let { signal: n } = F(q), r = await P("api/v1/security.saml", t, { signal: n });
|
|
1657
1662
|
if (r.redirectUrl) {
|
|
1658
1663
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1659
1664
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1663,21 +1668,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", Y = async () => {
|
|
|
1663
1668
|
}
|
|
1664
1669
|
return r;
|
|
1665
1670
|
} catch (e) {
|
|
1666
|
-
throw
|
|
1671
|
+
throw w("Failed to authenticate with SAML", e), e;
|
|
1667
1672
|
}
|
|
1668
|
-
},
|
|
1673
|
+
}, Y = (e) => u("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), X = async () => {
|
|
1669
1674
|
let e;
|
|
1670
1675
|
try {
|
|
1671
|
-
let { signal: t } =
|
|
1672
|
-
e = await
|
|
1676
|
+
let { signal: t } = F(q);
|
|
1677
|
+
e = await M("api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, { signal: t });
|
|
1673
1678
|
} catch (e) {
|
|
1674
|
-
throw
|
|
1679
|
+
throw C("CSRF token fetch failed", e), e;
|
|
1675
1680
|
}
|
|
1676
|
-
return e?.csrfToken ? (
|
|
1681
|
+
return e?.csrfToken ? (Y(e.csrfToken), e.csrfToken) : null;
|
|
1677
1682
|
};
|
|
1678
1683
|
//#endregion
|
|
1679
1684
|
//#region src/authentication/tokens/get-jwt-token.ts
|
|
1680
|
-
async function
|
|
1685
|
+
async function Z(e) {
|
|
1681
1686
|
if (e) {
|
|
1682
1687
|
let { username: t, password: n } = e, r = {
|
|
1683
1688
|
action: "get",
|
|
@@ -1688,10 +1693,10 @@ async function Q(e) {
|
|
|
1688
1693
|
noAutoAuthentication: !0
|
|
1689
1694
|
};
|
|
1690
1695
|
try {
|
|
1691
|
-
let { signal: e } =
|
|
1692
|
-
return t?.csrfToken ? (
|
|
1696
|
+
let { signal: e } = F(q), t = await P("api/v1/security.webtoken", r, { signal: e });
|
|
1697
|
+
return t?.csrfToken ? (Y(t.csrfToken), t.csrfToken) : null;
|
|
1693
1698
|
} catch (e) {
|
|
1694
|
-
throw
|
|
1699
|
+
throw w("Failed to get JWT", e), e;
|
|
1695
1700
|
}
|
|
1696
1701
|
} else {
|
|
1697
1702
|
let e = {
|
|
@@ -1704,68 +1709,70 @@ async function Q(e) {
|
|
|
1704
1709
|
let n = new Headers();
|
|
1705
1710
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${t}`);
|
|
1706
1711
|
try {
|
|
1707
|
-
let { signal: t } =
|
|
1712
|
+
let { signal: t } = F(q), r = await P("api/v1/security.webtoken", e, {
|
|
1708
1713
|
headers: n,
|
|
1709
1714
|
signal: t
|
|
1710
1715
|
});
|
|
1711
|
-
return r?.csrfToken ? (
|
|
1716
|
+
return r?.csrfToken ? (Y(r.csrfToken), r.csrfToken) : null;
|
|
1712
1717
|
} catch (e) {
|
|
1713
|
-
throw
|
|
1718
|
+
throw w("Failed to get JWT without credentials", e), e;
|
|
1714
1719
|
}
|
|
1715
1720
|
}
|
|
1716
1721
|
}
|
|
1717
1722
|
//#endregion
|
|
1718
1723
|
//#region src/authentication/tokens/get-token.ts
|
|
1719
|
-
var
|
|
1724
|
+
var Q = () => {
|
|
1720
1725
|
let e = l("sinequa-credentials");
|
|
1721
1726
|
if (e) try {
|
|
1722
1727
|
let t = JSON.parse(e).data?.csrfToken;
|
|
1723
1728
|
if (t) return t;
|
|
1724
1729
|
} catch (e) {
|
|
1725
|
-
|
|
1730
|
+
C("Failed to parse session storage credentials, falling back to local storage", e);
|
|
1726
1731
|
}
|
|
1727
1732
|
return s("csrfToken") || null;
|
|
1728
|
-
},
|
|
1733
|
+
}, $ = "sinequa-authenticated", vn = (e) => {
|
|
1734
|
+
e ? u($, "true") : d($);
|
|
1735
|
+
}, yn = () => l($) === "true", bn = async () => {
|
|
1729
1736
|
try {
|
|
1730
|
-
let { signal: e } =
|
|
1731
|
-
return await
|
|
1737
|
+
let { signal: e } = F(q);
|
|
1738
|
+
return await M("api/v1/principal", new URLSearchParams({ action: "get" }), {
|
|
1732
1739
|
signal: e,
|
|
1733
1740
|
redirect: "manual"
|
|
1734
|
-
}),
|
|
1741
|
+
}), S("Server auto-authenticated the user (OIDC)"), !0;
|
|
1735
1742
|
} catch {
|
|
1736
1743
|
return !1;
|
|
1737
1744
|
}
|
|
1738
|
-
},
|
|
1745
|
+
}, xn = async (n) => {
|
|
1739
1746
|
if (n) {
|
|
1740
1747
|
let { username: t, password: r } = n;
|
|
1741
|
-
return !t || !r ? (
|
|
1748
|
+
return !t || !r ? (w("Credentials are required for authentication"), e(!1), !1) : Sn({
|
|
1742
1749
|
username: t,
|
|
1743
1750
|
password: r
|
|
1744
1751
|
});
|
|
1745
1752
|
}
|
|
1746
1753
|
let a = r.authMode ?? t.unknown();
|
|
1747
1754
|
if (a.kind === "credentials") return e(!1), !1;
|
|
1748
|
-
if (a.kind === "bearer") return
|
|
1749
|
-
if (
|
|
1755
|
+
if (a.kind === "bearer") return Cn();
|
|
1756
|
+
if (Q()) return i({ isRedirectUrl: !1 }), d(J), e(!0), !0;
|
|
1750
1757
|
try {
|
|
1751
|
-
if (
|
|
1758
|
+
if (S("Checking for an existing session via CSRF token retrieval"), await X()) return S("User already authenticated (existing session / SSO)"), d(J), a.kind === "unknown" && i({ authMode: t.sso() }), e(!0), !0;
|
|
1752
1759
|
} catch {}
|
|
1753
1760
|
switch (a.kind) {
|
|
1754
|
-
case "oauth": return
|
|
1755
|
-
case "saml": return
|
|
1761
|
+
case "oauth": return S("Initiating OAuth authentication flow"), await gn(), e(!1), !1;
|
|
1762
|
+
case "saml": return S("Initiating SAML authentication flow"), await _n(), e(!1), !1;
|
|
1756
1763
|
case "sso": return e(!1), !1;
|
|
1757
|
-
default: return
|
|
1764
|
+
default: return S("No provider declared — probing for server-side auto-authentication (OIDC)"), await bn() ? (S("User auto-authenticated by the server (OIDC)"), d(J), i({ authMode: t.sso() }), await X().catch(() => {}), vn(!0), e(!0), !0) : (i({ authMode: t.credentials() }), e(!1), !1);
|
|
1758
1765
|
}
|
|
1759
1766
|
};
|
|
1760
|
-
async function
|
|
1761
|
-
|
|
1767
|
+
async function Sn(n) {
|
|
1768
|
+
S("Attempting authentication using credentials"), i({ authMode: t.credentials() });
|
|
1762
1769
|
let { userOverrideActive: a, userOverride: o } = r;
|
|
1763
1770
|
i({
|
|
1764
1771
|
userOverrideActive: !1,
|
|
1765
1772
|
userOverride: void 0
|
|
1766
1773
|
});
|
|
1767
1774
|
try {
|
|
1768
|
-
await
|
|
1775
|
+
await Z(n);
|
|
1769
1776
|
} catch (t) {
|
|
1770
1777
|
throw e(!1), t;
|
|
1771
1778
|
}
|
|
@@ -1774,41 +1781,41 @@ async function vn(n) {
|
|
|
1774
1781
|
userOverride: o
|
|
1775
1782
|
}), e(!0), !0;
|
|
1776
1783
|
}
|
|
1777
|
-
async function
|
|
1784
|
+
async function Cn() {
|
|
1778
1785
|
try {
|
|
1779
|
-
if (
|
|
1786
|
+
if (S("Attempting authentication using bearer token"), await Z()) return e(!0), !0;
|
|
1780
1787
|
} catch (t) {
|
|
1781
|
-
throw
|
|
1788
|
+
throw w("Bearer authentication failed", t), e(!1), t;
|
|
1782
1789
|
}
|
|
1783
1790
|
return e(!1), !1;
|
|
1784
1791
|
}
|
|
1785
1792
|
//#endregion
|
|
1786
1793
|
//#region src/authentication/tokens/delete-web-token-cookie.ts
|
|
1787
|
-
var
|
|
1794
|
+
var wn = async () => {
|
|
1788
1795
|
let e = new URLSearchParams({
|
|
1789
1796
|
action: "deleteWebTokenCookie",
|
|
1790
1797
|
noUserOverride: "true",
|
|
1791
1798
|
noAutoAuthentication: "true"
|
|
1792
|
-
}), { signal: t } =
|
|
1793
|
-
return
|
|
1799
|
+
}), { signal: t } = F(q);
|
|
1800
|
+
return M("api/v1/challenge", e, { signal: t });
|
|
1794
1801
|
};
|
|
1795
1802
|
//#endregion
|
|
1796
1803
|
//#region src/authentication/session/logout.ts
|
|
1797
|
-
async function
|
|
1804
|
+
async function Tn() {
|
|
1798
1805
|
let { userOverrideActive: e } = r;
|
|
1799
|
-
if (
|
|
1800
|
-
let { methodresult: e, logoutUrl: t } = await
|
|
1806
|
+
if (En(), !e) try {
|
|
1807
|
+
let { methodresult: e, logoutUrl: t } = await wn();
|
|
1801
1808
|
if (e === "ok") return t;
|
|
1802
|
-
|
|
1809
|
+
w("logout failed");
|
|
1803
1810
|
} catch (e) {
|
|
1804
|
-
|
|
1811
|
+
w("logout failed", e);
|
|
1805
1812
|
}
|
|
1806
1813
|
}
|
|
1807
|
-
function
|
|
1808
|
-
c("csrfToken"), d("sinequa-credentials"), e(!1);
|
|
1814
|
+
function En() {
|
|
1815
|
+
c("csrfToken"), d("sinequa-credentials"), vn(!1), e(!1);
|
|
1809
1816
|
}
|
|
1810
1817
|
//#endregion
|
|
1811
1818
|
//#region src/authentication/session/user-authentication.ts
|
|
1812
|
-
var
|
|
1819
|
+
var Dn = () => !!Q() || yn();
|
|
1813
1820
|
//#endregion
|
|
1814
|
-
export {
|
|
1821
|
+
export { yt as $, h as $t, Yt as A, Ve as At, Rt as B, Le as Bt, on as C, te as Cn, L as Ct, tn as D, n as Dn, He as Dt, nn as E, t as En, Ue as Et, Wt as F, ze as Ft, Ot as G, Ie as Gt, kt as H, E as Ht, Bt as I, j as It, St as J, S as Jt, Dt as K, x as Kt, Vt as L, Re as Lt, K as M, Be as Mt, qt as N, N as Nt, Zt as O, e as On, I as Ot, Kt as P, M as Pt, bt as Q, Me as Qt, Ht as R, k as Rt, sn as S, ae as Sn, R as St, en as T, i as Tn, We as Tt, Lt as U, T as Ut, zt as V, D as Vt, Et as W, Fe as Wt, wt as X, Pe as Xt, Ct as Y, C as Yt, xt as Z, Ne as Zt, pn as _, oe as _n, B as _t, xn as a, Oe as an, H as at, cn as b, ie as bn, Ke as bt, Z as c, we as cn, ot as ct, _n as d, ve as dn, st as dt, De as en, G as et, gn as f, xe as fn, dt as ft, dn as g, m as gn, Qe as gt, mn as h, be as hn, et as ht, wn as i, je as in, lt as it, Jt as j, P as jt, Xt as k, F as kt, X as l, Ce as ln, ct as lt, fn as m, ye as mn, rt as mt, En as n, Ae as nn, ht as nt, bn as o, Ee as on, it as ot, hn as p, p as pn, nt as pt, Tt as q, w as qt, Tn as r, Te as rn, ut as rt, Q as s, g as sn, at as st, Dn as t, ke as tn, mt as tt, Y as u, Se as un, V as ut, un as v, ee as vn, Je as vt, rn as w, r as wn, Ge as wt, an as x, ne as xn, z as xt, ln as y, re as yn, qe as yt, Ut as z, O as zt };
|