@sinequa/atomic 2.0.5 → 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/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-D4e623or.js → src-xJ8mp2hN.js} +440 -410
- package/package.json +1 -1
- package/dist/src-B54_W-0n.cjs +0 -1
|
@@ -166,13 +166,13 @@ function ae(e, t) {
|
|
|
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 f(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[
|
|
211
|
+
value: e[fe],
|
|
212
|
+
op: e[de]
|
|
213
|
+
}) : e[me] ? t.push({
|
|
214
214
|
type: "exact",
|
|
215
|
-
value: e[
|
|
216
|
-
op: e[
|
|
217
|
-
}) : e[
|
|
215
|
+
value: e[me],
|
|
216
|
+
op: e[pe]
|
|
217
|
+
}) : e[ge] ? t.push({
|
|
218
218
|
type: "regex",
|
|
219
|
-
value: e[
|
|
220
|
-
op: e[
|
|
221
|
-
}) : e[
|
|
219
|
+
value: e[ge],
|
|
220
|
+
op: e[he]
|
|
221
|
+
}) : e[ve] && t.push({
|
|
222
222
|
type: "token",
|
|
223
|
-
value: e[
|
|
224
|
-
op: e[
|
|
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 m(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 =
|
|
252
|
-
}
|
|
253
|
-
function be(e) {
|
|
254
|
-
return m(p(e).filter((e) => e.type !== "adjacent"));
|
|
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));
|
|
255
252
|
}
|
|
256
253
|
function xe(e) {
|
|
257
|
-
return p(e).filter((e) => e.type
|
|
254
|
+
return p(f(e).filter((e) => e.type !== "adjacent"));
|
|
255
|
+
}
|
|
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 Ce(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 Te(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 h(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 _(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 Ne(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 v(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,21 +443,21 @@ function b(e, t, n) {
|
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
+
function b(e, t) {
|
|
447
|
+
y(0, e, t);
|
|
448
|
+
}
|
|
446
449
|
function x(e, t) {
|
|
447
|
-
|
|
450
|
+
y(1, e, t);
|
|
448
451
|
}
|
|
449
452
|
function S(e, t) {
|
|
450
|
-
|
|
453
|
+
y(2, e, t);
|
|
451
454
|
}
|
|
452
455
|
function C(e, t) {
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
function w(e, t) {
|
|
456
|
-
b(3, e, t);
|
|
456
|
+
y(3, e, t);
|
|
457
457
|
}
|
|
458
458
|
//#endregion
|
|
459
459
|
//#region src/web-api/helpers/create-headers.ts
|
|
460
|
-
function
|
|
460
|
+
function w(e) {
|
|
461
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;
|
|
@@ -465,27 +465,27 @@ function T(e) {
|
|
|
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
490
|
if (n !== null && Y(n), e.status === 200) switch (t) {
|
|
491
491
|
case "arraybuffer": return await e.arrayBuffer();
|
|
@@ -499,32 +499,32 @@ async function k(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 j = 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,71 +585,71 @@ async function M(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
592
|
//#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
|
|
593
|
-
function
|
|
593
|
+
function M() {
|
|
594
594
|
return r.authMode?.kind !== "sso";
|
|
595
595
|
}
|
|
596
596
|
//#endregion
|
|
597
597
|
//#region src/web-api/helpers/methods/patch.ts
|
|
598
|
-
async function
|
|
599
|
-
let i =
|
|
598
|
+
async function Ve(e, t, n) {
|
|
599
|
+
let i = w(n?.headers);
|
|
600
600
|
i.append("content-type", "application/json");
|
|
601
601
|
let { app: a, backendUrl: o } = r, s = {
|
|
602
602
|
app: a,
|
|
603
603
|
...t,
|
|
604
604
|
locale: t.locale || navigator.language,
|
|
605
605
|
noUserOverride: !0,
|
|
606
|
-
noAutoAuthentication:
|
|
606
|
+
noAutoAuthentication: M()
|
|
607
607
|
}, c = o ? `${o}/${e}` : `${e}`;
|
|
608
|
-
|
|
608
|
+
b(`Making PATCH request to: ${c}`);
|
|
609
609
|
try {
|
|
610
|
-
if (
|
|
611
|
-
let e =
|
|
612
|
-
return
|
|
610
|
+
if (A.isInitialized()) {
|
|
611
|
+
let e = A.getClient();
|
|
612
|
+
return O(await e.fetch(c, e.constructor.configurations.v1, {
|
|
613
613
|
method: "PATCH",
|
|
614
614
|
headers: i,
|
|
615
615
|
body: JSON.stringify(s)
|
|
616
616
|
}), n?.responseType);
|
|
617
617
|
}
|
|
618
|
-
return
|
|
618
|
+
return O(await fetch(c, {
|
|
619
619
|
method: "PATCH",
|
|
620
620
|
headers: i,
|
|
621
621
|
credentials: "include",
|
|
622
622
|
body: JSON.stringify(s)
|
|
623
623
|
}), n?.responseType);
|
|
624
624
|
} catch (e) {
|
|
625
|
-
throw
|
|
625
|
+
throw C("Error making PATCH request:", e), e;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
//#endregion
|
|
629
629
|
//#region src/web-api/helpers/methods/post.ts
|
|
630
|
-
async function
|
|
631
|
-
let i =
|
|
630
|
+
async function N(e, t, n) {
|
|
631
|
+
let i = w(n?.headers), { app: a, backendUrl: o } = r;
|
|
632
632
|
i.has("Content-Type") || i.set("Content-Type", "application/json");
|
|
633
633
|
let s = {
|
|
634
634
|
app: a,
|
|
635
635
|
...t,
|
|
636
636
|
locale: t.locale || navigator.language,
|
|
637
637
|
noUserOverride: !0,
|
|
638
|
-
noAutoAuthentication:
|
|
638
|
+
noAutoAuthentication: M()
|
|
639
639
|
};
|
|
640
640
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
641
641
|
let c = o ? `${o}/${e}` : `${e}`;
|
|
642
|
-
|
|
642
|
+
b(`Making POST request to: ${c}`);
|
|
643
643
|
try {
|
|
644
|
-
if (
|
|
645
|
-
let e =
|
|
646
|
-
return
|
|
644
|
+
if (A.isInitialized()) {
|
|
645
|
+
let e = A.getClient();
|
|
646
|
+
return O(await e.post(c, e.constructor.configurations.v1, {
|
|
647
647
|
headers: i,
|
|
648
648
|
body: JSON.stringify(s),
|
|
649
649
|
signal: n?.signal
|
|
650
650
|
}), n?.responseType);
|
|
651
651
|
}
|
|
652
|
-
return
|
|
652
|
+
return O(await fetch(c, {
|
|
653
653
|
method: "POST",
|
|
654
654
|
headers: i,
|
|
655
655
|
credentials: "include",
|
|
@@ -657,45 +657,45 @@ async function P(e, t, n) {
|
|
|
657
657
|
signal: n?.signal
|
|
658
658
|
}), n?.responseType);
|
|
659
659
|
} catch (e) {
|
|
660
|
-
throw
|
|
660
|
+
throw C("Error making POST request:", e), e;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
//#endregion
|
|
664
664
|
//#region src/web-api/helpers/methods/put.ts
|
|
665
|
-
async function
|
|
666
|
-
let i =
|
|
665
|
+
async function He(e, t, n) {
|
|
666
|
+
let i = w(n?.headers), { app: a, backendUrl: o } = r, s = {
|
|
667
667
|
app: a,
|
|
668
668
|
...t,
|
|
669
669
|
locale: t.locale || navigator.language,
|
|
670
670
|
noUserOverride: !0,
|
|
671
|
-
noAutoAuthentication:
|
|
671
|
+
noAutoAuthentication: M()
|
|
672
672
|
}, c = `${o}/${e}`;
|
|
673
|
-
|
|
673
|
+
b(`Making PUT request to: ${c}`);
|
|
674
674
|
try {
|
|
675
|
-
if (
|
|
676
|
-
let e =
|
|
677
|
-
return
|
|
675
|
+
if (A.isInitialized()) {
|
|
676
|
+
let e = A.getClient();
|
|
677
|
+
return O(await e.fetch(c, e.constructor.configurations.v1, {
|
|
678
678
|
method: "PUT",
|
|
679
679
|
headers: i,
|
|
680
680
|
body: JSON.stringify(s)
|
|
681
681
|
}), n?.responseType);
|
|
682
682
|
}
|
|
683
|
-
return
|
|
683
|
+
return O(await fetch(c, {
|
|
684
684
|
method: "PUT",
|
|
685
685
|
headers: i,
|
|
686
686
|
credentials: "include",
|
|
687
687
|
body: JSON.stringify(s)
|
|
688
688
|
}), n?.responseType);
|
|
689
689
|
} catch (e) {
|
|
690
|
-
throw
|
|
690
|
+
throw C("Error making PUT request:", e), e;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
//#endregion
|
|
694
694
|
//#region src/web-api/helpers/utils/create-timeout-controller.ts
|
|
695
|
-
function
|
|
695
|
+
function P(e) {
|
|
696
696
|
let t = new AbortController(), { signal: n } = t;
|
|
697
697
|
return e && setTimeout(() => {
|
|
698
|
-
n.aborted || t.abort(new
|
|
698
|
+
n.aborted || t.abort(new Re(`Request timed out after ${e}ms`));
|
|
699
699
|
}, e), {
|
|
700
700
|
controller: t,
|
|
701
701
|
signal: n
|
|
@@ -703,36 +703,36 @@ function F(e) {
|
|
|
703
703
|
}
|
|
704
704
|
//#endregion
|
|
705
705
|
//#region src/web-api/helpers/utils/date-utils..ts
|
|
706
|
-
function
|
|
706
|
+
function F(e) {
|
|
707
707
|
if (!e) return;
|
|
708
708
|
let t = new Date(e);
|
|
709
709
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
let t =
|
|
711
|
+
function Ue(e) {
|
|
712
|
+
let t = F(e);
|
|
713
713
|
return !!t && t.getTime() <= Date.now();
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
let n =
|
|
715
|
+
function We(e, t = 7) {
|
|
716
|
+
let n = F(e);
|
|
717
717
|
if (!n) return !1;
|
|
718
718
|
let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
|
|
719
719
|
return a > r && a <= i;
|
|
720
720
|
}
|
|
721
721
|
//#endregion
|
|
722
722
|
//#region src/web-api/helpers/utils/with-retry.ts
|
|
723
|
-
async function
|
|
723
|
+
async function Ge(e, t = 0, n = 1e3) {
|
|
724
724
|
let r;
|
|
725
725
|
for (let i = 0; i <= t; i++) try {
|
|
726
726
|
return await e();
|
|
727
727
|
} catch (e) {
|
|
728
|
-
if (r = e, e instanceof
|
|
729
|
-
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)));
|
|
730
730
|
}
|
|
731
731
|
throw r;
|
|
732
732
|
}
|
|
733
733
|
//#endregion
|
|
734
734
|
//#region src/helpers/column-resolver.ts
|
|
735
|
-
function
|
|
735
|
+
function Ke(e, t, n) {
|
|
736
736
|
if (!e || !t) return;
|
|
737
737
|
if (n) {
|
|
738
738
|
let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
|
|
@@ -745,93 +745,93 @@ function Ge(e, t, n) {
|
|
|
745
745
|
}
|
|
746
746
|
//#endregion
|
|
747
747
|
//#region src/types/audit/AuditEventType.ts
|
|
748
|
-
var
|
|
748
|
+
var I = /* @__PURE__ */ function(e) {
|
|
749
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;
|
|
750
|
-
}({}),
|
|
750
|
+
}({}), L = /* @__PURE__ */ function(e) {
|
|
751
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;
|
|
752
|
-
}({}),
|
|
752
|
+
}({}), R = /* @__PURE__ */ function(e) {
|
|
753
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;
|
|
754
|
-
}({}),
|
|
754
|
+
}({}), qe = "1.0", Je = /* @__PURE__ */ function(e) {
|
|
755
755
|
return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
|
|
756
|
-
}({}),
|
|
756
|
+
}({}), Ye = /* @__PURE__ */ function(e) {
|
|
757
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;
|
|
758
758
|
}({});
|
|
759
759
|
//#endregion
|
|
760
760
|
//#region src/helpers/columns.ts
|
|
761
|
-
function
|
|
762
|
-
if (!e) return
|
|
761
|
+
function Xe(e) {
|
|
762
|
+
if (!e) return L.none;
|
|
763
763
|
switch (e.toLocaleLowerCase()) {
|
|
764
764
|
case "bool":
|
|
765
|
-
case "boolean": return
|
|
766
|
-
case "date": return
|
|
767
|
-
case "datetime": return
|
|
768
|
-
case "time": return
|
|
769
|
-
case "unsigned": return
|
|
770
|
-
case "integer": return
|
|
771
|
-
case "float": return
|
|
772
|
-
case "double": return
|
|
773
|
-
case "dates": return
|
|
774
|
-
case "datetimes": return
|
|
775
|
-
case "times": return
|
|
776
|
-
case "varchar": return
|
|
777
|
-
case "binary": return
|
|
778
|
-
case "string": return
|
|
779
|
-
case "csv": return
|
|
780
|
-
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;
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function Ze(e) {
|
|
784
784
|
switch (e) {
|
|
785
|
-
case "a": return
|
|
786
|
-
case "c": return
|
|
787
|
-
case "d": return
|
|
788
|
-
case "e": return
|
|
789
|
-
case "i": return
|
|
790
|
-
case "l": return
|
|
791
|
-
case "n": return
|
|
792
|
-
case "t": return
|
|
793
|
-
case "x": return
|
|
794
|
-
case "z": return
|
|
795
|
-
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;
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
let t =
|
|
800
|
-
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);
|
|
801
801
|
return t;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function z(e, t, n, r) {
|
|
804
804
|
return {
|
|
805
805
|
name: e,
|
|
806
806
|
type: t,
|
|
807
807
|
typeModifier: n,
|
|
808
|
-
eType:
|
|
809
|
-
eTypeModifier:
|
|
808
|
+
eType: Xe(t),
|
|
809
|
+
eTypeModifier: Qe(n || ""),
|
|
810
810
|
aliases: r
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
|
-
var
|
|
814
|
-
id:
|
|
815
|
-
text:
|
|
816
|
-
documentlanguages:
|
|
817
|
-
databasealias:
|
|
818
|
-
globalrelevance:
|
|
819
|
-
matchingpartnames:
|
|
820
|
-
matchlocations:
|
|
821
|
-
matchlocationsperpartname:
|
|
822
|
-
extracts:
|
|
823
|
-
extractsperpartname:
|
|
824
|
-
extractslocations:
|
|
825
|
-
documentweight:
|
|
826
|
-
groupcount:
|
|
827
|
-
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"])
|
|
828
828
|
};
|
|
829
829
|
//#endregion
|
|
830
830
|
//#region src/helpers/filters.ts
|
|
831
|
-
function
|
|
831
|
+
function et(e) {
|
|
832
832
|
return e.filter((e) => !!e);
|
|
833
833
|
}
|
|
834
|
-
var
|
|
834
|
+
var B = {
|
|
835
835
|
eq: (e, t) => ({
|
|
836
836
|
field: e,
|
|
837
837
|
operator: "eq",
|
|
@@ -899,7 +899,7 @@ var et = {
|
|
|
899
899
|
and: (...e) => tt("and", e),
|
|
900
900
|
or: (...e) => tt("or", e),
|
|
901
901
|
not: (...e) => {
|
|
902
|
-
let t =
|
|
902
|
+
let t = et(e);
|
|
903
903
|
return t.length ? {
|
|
904
904
|
operator: "not",
|
|
905
905
|
filters: t
|
|
@@ -907,12 +907,42 @@ var et = {
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
function tt(e, t) {
|
|
910
|
-
let n =
|
|
910
|
+
let n = et(t);
|
|
911
911
|
if (n.length !== 0) return n.length === 1 ? n[0] : {
|
|
912
912
|
operator: e,
|
|
913
913
|
filters: n
|
|
914
914
|
};
|
|
915
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
|
+
}
|
|
916
946
|
//#endregion
|
|
917
947
|
//#region src/helpers/metadata.ts
|
|
918
948
|
function nt(e, t) {
|
|
@@ -946,14 +976,14 @@ function rt(e, t) {
|
|
|
946
976
|
}
|
|
947
977
|
//#endregion
|
|
948
978
|
//#region src/helpers/utils.ts
|
|
949
|
-
function
|
|
979
|
+
function H(e) {
|
|
950
980
|
return typeof e == "object" && !!e;
|
|
951
981
|
}
|
|
952
982
|
function it(e) {
|
|
953
|
-
return
|
|
983
|
+
return H(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
954
984
|
}
|
|
955
985
|
function at(e) {
|
|
956
|
-
return
|
|
986
|
+
return H(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
957
987
|
}
|
|
958
988
|
function ot(e) {
|
|
959
989
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
@@ -962,19 +992,19 @@ function st(e) {
|
|
|
962
992
|
return typeof e == "string";
|
|
963
993
|
}
|
|
964
994
|
function ct(e) {
|
|
965
|
-
return (
|
|
995
|
+
return (H(e) || Array.isArray(e)) && !it(e) && !at(e) && !st(e);
|
|
966
996
|
}
|
|
967
997
|
function lt(e) {
|
|
968
998
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
969
999
|
}
|
|
970
|
-
function
|
|
1000
|
+
function ut(e = !0) {
|
|
971
1001
|
let t = Date.now();
|
|
972
1002
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
|
|
973
1003
|
let n = (t + Math.random() * 16) % 16 | 0;
|
|
974
1004
|
return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
|
|
975
1005
|
});
|
|
976
1006
|
}
|
|
977
|
-
function
|
|
1007
|
+
function dt(e) {
|
|
978
1008
|
if (!e) return "``";
|
|
979
1009
|
if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
|
|
980
1010
|
let t = ["`"];
|
|
@@ -984,7 +1014,7 @@ function ut(e) {
|
|
|
984
1014
|
}
|
|
985
1015
|
return t.push("`"), t.join("");
|
|
986
1016
|
}
|
|
987
|
-
function
|
|
1017
|
+
function ft(e) {
|
|
988
1018
|
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function") try {
|
|
989
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)));
|
|
990
1020
|
} catch {
|
|
@@ -1000,51 +1030,51 @@ function U(e) {
|
|
|
1000
1030
|
}
|
|
1001
1031
|
//#endregion
|
|
1002
1032
|
//#region src/web-api/v1/fetch-audit.ts
|
|
1003
|
-
var W,
|
|
1033
|
+
var W, pt;
|
|
1004
1034
|
function G(e, t = !0) {
|
|
1005
|
-
let n =
|
|
1006
|
-
n && (
|
|
1035
|
+
let n = mt(e.$auditRecord);
|
|
1036
|
+
n && (ht(n), t && gt(n)), e.$auditRecord = n;
|
|
1007
1037
|
}
|
|
1008
|
-
function
|
|
1038
|
+
function mt(e) {
|
|
1009
1039
|
if (!e) return;
|
|
1010
1040
|
let t;
|
|
1011
1041
|
if (Array.isArray(e)) t = e;
|
|
1012
|
-
else if (
|
|
1042
|
+
else if (H(e)) {
|
|
1013
1043
|
let n = e;
|
|
1014
1044
|
if (n.auditEvents || n.mlAuditEvents) return n;
|
|
1015
1045
|
t = [e];
|
|
1016
1046
|
}
|
|
1017
1047
|
return { auditEvents: t };
|
|
1018
1048
|
}
|
|
1019
|
-
function
|
|
1020
|
-
let t =
|
|
1049
|
+
function ht(e) {
|
|
1050
|
+
let t = _t();
|
|
1021
1051
|
return e.auditEvents?.forEach((e) => {
|
|
1022
1052
|
e.detail ||= {}, e.detail.sessionid = t;
|
|
1023
1053
|
}), e;
|
|
1024
1054
|
}
|
|
1025
|
-
function
|
|
1055
|
+
function gt(e) {
|
|
1026
1056
|
let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
1027
1057
|
return e?.auditEvents?.forEach((e) => {
|
|
1028
1058
|
e.detail ||= {}, e.detail.url = t;
|
|
1029
1059
|
}), e;
|
|
1030
1060
|
}
|
|
1031
|
-
function gt() {
|
|
1032
|
-
return (!W || _t()) && (W = H()), ft = /* @__PURE__ */ new Date(), W;
|
|
1033
|
-
}
|
|
1034
1061
|
function _t() {
|
|
1035
|
-
return (
|
|
1062
|
+
return (!W || vt()) && (W = ut()), pt = /* @__PURE__ */ new Date(), W;
|
|
1063
|
+
}
|
|
1064
|
+
function vt() {
|
|
1065
|
+
return (/* @__PURE__ */ new Date()).getTime() - pt.getTime() > 600 * 1e3;
|
|
1036
1066
|
}
|
|
1037
|
-
async function
|
|
1067
|
+
async function yt(e, t = !0) {
|
|
1038
1068
|
let n = {
|
|
1039
|
-
event:
|
|
1069
|
+
event: I.None,
|
|
1040
1070
|
$auditRecord: e
|
|
1041
1071
|
};
|
|
1042
|
-
return G(n, t),
|
|
1072
|
+
return G(n, t), N("api/v1/audit.notify", n);
|
|
1043
1073
|
}
|
|
1044
|
-
var
|
|
1074
|
+
var bt = { notify: yt };
|
|
1045
1075
|
//#endregion
|
|
1046
1076
|
//#region src/web-api/v1/fetch-aggregation.ts
|
|
1047
|
-
async function
|
|
1077
|
+
async function xt(e, t, n) {
|
|
1048
1078
|
let r = e.items?.length || 0, i = {
|
|
1049
1079
|
query: {
|
|
1050
1080
|
...t,
|
|
@@ -1057,12 +1087,12 @@ async function bt(e, t, n) {
|
|
|
1057
1087
|
$auditRecord: { auditEvents: [n] }
|
|
1058
1088
|
};
|
|
1059
1089
|
G(i);
|
|
1060
|
-
let { aggregations: a } = await
|
|
1090
|
+
let { aggregations: a } = await O(await N("api/v1/query", i)), o = a[0];
|
|
1061
1091
|
return o.$hasMore = o.items.length > 10, o.items = [...e.items, ...o.items], Promise.resolve(o);
|
|
1062
1092
|
}
|
|
1063
1093
|
//#endregion
|
|
1064
1094
|
//#region src/authentication/session/detect-auth-mode.ts
|
|
1065
|
-
function
|
|
1095
|
+
function St(e, n) {
|
|
1066
1096
|
if (e.authMode?.kind === "credentials") return t.credentials();
|
|
1067
1097
|
if (e.bearerToken) return t.bearer(e.bearerToken);
|
|
1068
1098
|
let r = e.autoOAuthProvider || n?.autoOAuthProvider;
|
|
@@ -1072,18 +1102,18 @@ function xt(e, n) {
|
|
|
1072
1102
|
}
|
|
1073
1103
|
//#endregion
|
|
1074
1104
|
//#region src/web-api/v1/fetch-app.ts
|
|
1075
|
-
async function
|
|
1105
|
+
async function Ct(e) {
|
|
1076
1106
|
let t = e || r.app;
|
|
1077
|
-
return
|
|
1107
|
+
return j("api/v1/app", new URLSearchParams({ app: t || "" }));
|
|
1078
1108
|
}
|
|
1079
|
-
async function
|
|
1109
|
+
async function wt() {
|
|
1080
1110
|
let { app: e } = r;
|
|
1081
|
-
return
|
|
1111
|
+
return j("api/v1/app", new URLSearchParams({
|
|
1082
1112
|
app: e || "",
|
|
1083
1113
|
preLogin: "true"
|
|
1084
1114
|
}));
|
|
1085
1115
|
}
|
|
1086
|
-
function
|
|
1116
|
+
function Tt() {
|
|
1087
1117
|
let { backendUrl: e, app: n } = r;
|
|
1088
1118
|
if (typeof window < "u") {
|
|
1089
1119
|
if (e ||= window.location.origin, !n) {
|
|
@@ -1100,37 +1130,37 @@ function wt() {
|
|
|
1100
1130
|
autoOAuthProvider: void 0,
|
|
1101
1131
|
autoSAMLProvider: void 0,
|
|
1102
1132
|
bearerToken: void 0
|
|
1103
|
-
}), Promise.resolve({})) :
|
|
1104
|
-
authMode:
|
|
1133
|
+
}), Promise.resolve({})) : wt().then((e) => (i({
|
|
1134
|
+
authMode: St(r, e),
|
|
1105
1135
|
autoOAuthProvider: r.autoOAuthProvider || e.autoOAuthProvider,
|
|
1106
1136
|
autoSAMLProvider: r.autoSAMLProvider || e.autoSAMLProvider
|
|
1107
1137
|
}), e)).catch((e) => {
|
|
1108
|
-
throw
|
|
1138
|
+
throw C("atomic:fetchAppPreLogin error", e), e;
|
|
1109
1139
|
});
|
|
1110
1140
|
}
|
|
1111
|
-
var
|
|
1141
|
+
var Et = Tt;
|
|
1112
1142
|
//#endregion
|
|
1113
1143
|
//#region src/web-api/v1/fetch-dataset.ts
|
|
1114
|
-
async function
|
|
1115
|
-
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];
|
|
1116
1146
|
if ("errorCode" in a && "errorMessage" in a) throw Error(a.errorMessage);
|
|
1117
1147
|
return a;
|
|
1118
1148
|
}
|
|
1119
|
-
async function
|
|
1149
|
+
async function Ot(e, t) {
|
|
1120
1150
|
let n = `api/v1/search.dataset/${e}`, { parameters: r = {}, datasets: i = [] } = t;
|
|
1121
|
-
return (await
|
|
1151
|
+
return (await N(n, {
|
|
1122
1152
|
parameters: r,
|
|
1123
1153
|
datasets: i
|
|
1124
1154
|
})).datasets;
|
|
1125
1155
|
}
|
|
1126
|
-
async function
|
|
1127
|
-
return await
|
|
1156
|
+
async function kt(e) {
|
|
1157
|
+
return await j(`api/v1/search.dataset/${e}`);
|
|
1128
1158
|
}
|
|
1129
1159
|
//#endregion
|
|
1130
1160
|
//#region src/web-api/v1/fetch-labels.ts
|
|
1131
|
-
async function
|
|
1161
|
+
async function At(e, t = !0, n) {
|
|
1132
1162
|
try {
|
|
1133
|
-
return (await
|
|
1163
|
+
return (await N("api/v1/labels", {
|
|
1134
1164
|
action: "list",
|
|
1135
1165
|
q: e,
|
|
1136
1166
|
public: t,
|
|
@@ -1138,30 +1168,30 @@ async function kt(e, t = !0, n) {
|
|
|
1138
1168
|
localize: !1
|
|
1139
1169
|
})).labels;
|
|
1140
1170
|
} catch (e) {
|
|
1141
|
-
throw
|
|
1171
|
+
throw C("Error in fetchLabels", e), e;
|
|
1142
1172
|
}
|
|
1143
1173
|
}
|
|
1144
|
-
async function
|
|
1174
|
+
async function jt() {
|
|
1145
1175
|
try {
|
|
1146
1176
|
let { app: e = "" } = r;
|
|
1147
|
-
return
|
|
1177
|
+
return j("api/v1/labels", new URLSearchParams({
|
|
1148
1178
|
app: e,
|
|
1149
1179
|
action: "getUserRights"
|
|
1150
1180
|
}));
|
|
1151
1181
|
} catch (e) {
|
|
1152
|
-
throw
|
|
1182
|
+
throw C("Error in getUserRights", e), e;
|
|
1153
1183
|
}
|
|
1154
1184
|
}
|
|
1155
|
-
async function
|
|
1185
|
+
async function Mt(e, t, n = !0) {
|
|
1156
1186
|
try {
|
|
1157
|
-
return
|
|
1187
|
+
return N("api/v1/labels", {
|
|
1158
1188
|
action: "add",
|
|
1159
1189
|
labels: e,
|
|
1160
1190
|
ids: t,
|
|
1161
1191
|
public: n,
|
|
1162
1192
|
$auditRecord: {
|
|
1163
1193
|
auditEvents: [{
|
|
1164
|
-
type:
|
|
1194
|
+
type: I.Label_AddDoc,
|
|
1165
1195
|
detail: {
|
|
1166
1196
|
public: n,
|
|
1167
1197
|
label: e ? e.toString() : null,
|
|
@@ -1175,19 +1205,19 @@ async function jt(e, t, n = !0) {
|
|
|
1175
1205
|
}
|
|
1176
1206
|
});
|
|
1177
1207
|
} catch (e) {
|
|
1178
|
-
throw
|
|
1208
|
+
throw C("Error in add", e), e;
|
|
1179
1209
|
}
|
|
1180
1210
|
}
|
|
1181
|
-
async function
|
|
1211
|
+
async function Nt(e, t, n = !0) {
|
|
1182
1212
|
try {
|
|
1183
|
-
return
|
|
1213
|
+
return N("api/v1/labels", {
|
|
1184
1214
|
action: "remove",
|
|
1185
1215
|
labels: e,
|
|
1186
1216
|
ids: t,
|
|
1187
1217
|
public: n,
|
|
1188
1218
|
$auditRecord: {
|
|
1189
1219
|
auditEvents: [{
|
|
1190
|
-
type:
|
|
1220
|
+
type: I.Label_RemoveDoc,
|
|
1191
1221
|
detail: {
|
|
1192
1222
|
public: n,
|
|
1193
1223
|
label: e ? e.toString() : null,
|
|
@@ -1201,18 +1231,18 @@ async function Mt(e, t, n = !0) {
|
|
|
1201
1231
|
}
|
|
1202
1232
|
});
|
|
1203
1233
|
} catch (e) {
|
|
1204
|
-
throw
|
|
1234
|
+
throw C("Error in remove", e), e;
|
|
1205
1235
|
}
|
|
1206
1236
|
}
|
|
1207
|
-
async function
|
|
1237
|
+
async function Pt(e, t, n = !0) {
|
|
1208
1238
|
try {
|
|
1209
|
-
return
|
|
1239
|
+
return N("api/v1/labels", {
|
|
1210
1240
|
action: "rename",
|
|
1211
1241
|
labels: e,
|
|
1212
1242
|
newLabel: t,
|
|
1213
1243
|
public: n,
|
|
1214
1244
|
auditEvents: {
|
|
1215
|
-
type:
|
|
1245
|
+
type: I.Label_Rename,
|
|
1216
1246
|
detail: {
|
|
1217
1247
|
public: n,
|
|
1218
1248
|
oldlabel: e ? e.toString() : null,
|
|
@@ -1221,17 +1251,17 @@ async function Nt(e, t, n = !0) {
|
|
|
1221
1251
|
}
|
|
1222
1252
|
});
|
|
1223
1253
|
} catch (e) {
|
|
1224
|
-
throw
|
|
1254
|
+
throw C("Error in rename", e), e;
|
|
1225
1255
|
}
|
|
1226
1256
|
}
|
|
1227
|
-
async function
|
|
1257
|
+
async function Ft(e, t = !0) {
|
|
1228
1258
|
try {
|
|
1229
|
-
return
|
|
1259
|
+
return N("api/v1/labels", {
|
|
1230
1260
|
action: "delete",
|
|
1231
1261
|
labels: e,
|
|
1232
1262
|
public: t,
|
|
1233
1263
|
auditEvents: {
|
|
1234
|
-
type:
|
|
1264
|
+
type: I.Label_Delete,
|
|
1235
1265
|
detail: {
|
|
1236
1266
|
public: t,
|
|
1237
1267
|
label: e ? e.toString() : null
|
|
@@ -1239,18 +1269,18 @@ async function Pt(e, t = !0) {
|
|
|
1239
1269
|
}
|
|
1240
1270
|
});
|
|
1241
1271
|
} catch (e) {
|
|
1242
|
-
throw
|
|
1272
|
+
throw C("Error in deleteLabels", e), e;
|
|
1243
1273
|
}
|
|
1244
1274
|
}
|
|
1245
|
-
async function
|
|
1275
|
+
async function It(e, t, n = !0) {
|
|
1246
1276
|
try {
|
|
1247
|
-
return
|
|
1277
|
+
return N("api/v1/labels", {
|
|
1248
1278
|
action: "bulkAdd",
|
|
1249
1279
|
labels: e,
|
|
1250
1280
|
query: t,
|
|
1251
1281
|
public: n,
|
|
1252
1282
|
auditEvents: {
|
|
1253
|
-
type:
|
|
1283
|
+
type: I.Label_Add,
|
|
1254
1284
|
detail: {
|
|
1255
1285
|
public: n,
|
|
1256
1286
|
label: e ? e.toString() : null,
|
|
@@ -1259,18 +1289,18 @@ async function Ft(e, t, n = !0) {
|
|
|
1259
1289
|
}
|
|
1260
1290
|
});
|
|
1261
1291
|
} catch (e) {
|
|
1262
|
-
throw
|
|
1292
|
+
throw C("Error in bulkAdd", e), e;
|
|
1263
1293
|
}
|
|
1264
1294
|
}
|
|
1265
|
-
async function
|
|
1295
|
+
async function Lt(e, t, n = !0) {
|
|
1266
1296
|
try {
|
|
1267
|
-
return
|
|
1297
|
+
return N("api/v1/labels", {
|
|
1268
1298
|
action: "bulkRemove",
|
|
1269
1299
|
labels: e,
|
|
1270
1300
|
query: t,
|
|
1271
1301
|
public: n,
|
|
1272
1302
|
auditEvents: {
|
|
1273
|
-
type:
|
|
1303
|
+
type: I.Label_Delete,
|
|
1274
1304
|
detail: {
|
|
1275
1305
|
public: n,
|
|
1276
1306
|
label: e ? e.toString() : null,
|
|
@@ -1279,28 +1309,28 @@ async function It(e, t, n = !0) {
|
|
|
1279
1309
|
}
|
|
1280
1310
|
});
|
|
1281
1311
|
} catch (e) {
|
|
1282
|
-
throw
|
|
1312
|
+
throw C("Error in bulkRemove", e), e;
|
|
1283
1313
|
}
|
|
1284
1314
|
}
|
|
1285
|
-
var
|
|
1286
|
-
getUserRights:
|
|
1287
|
-
add:
|
|
1288
|
-
remove:
|
|
1289
|
-
rename:
|
|
1290
|
-
delete:
|
|
1291
|
-
bulkAdd:
|
|
1292
|
-
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
|
|
1293
1323
|
};
|
|
1294
1324
|
//#endregion
|
|
1295
1325
|
//#region src/web-api/v1/fetch-preview.ts
|
|
1296
|
-
async function
|
|
1297
|
-
if (typeof window > "u") return
|
|
1326
|
+
async function zt(e, t) {
|
|
1327
|
+
if (typeof window > "u") return N("api/v1/preview", {
|
|
1298
1328
|
action: "get",
|
|
1299
1329
|
id: e,
|
|
1300
1330
|
query: t
|
|
1301
1331
|
});
|
|
1302
1332
|
let n = `${window.location.origin}${window.location.pathname}`;
|
|
1303
|
-
return
|
|
1333
|
+
return N("api/v1/preview", {
|
|
1304
1334
|
action: "get",
|
|
1305
1335
|
id: e,
|
|
1306
1336
|
query: {
|
|
@@ -1310,57 +1340,57 @@ async function Rt(e, t) {
|
|
|
1310
1340
|
browserUrl: n
|
|
1311
1341
|
});
|
|
1312
1342
|
}
|
|
1313
|
-
async function
|
|
1343
|
+
async function Bt(e) {
|
|
1314
1344
|
let t = new Headers();
|
|
1315
|
-
t.append("content-type", "text"),
|
|
1345
|
+
t.append("content-type", "text"), O(await fetch(e, {
|
|
1316
1346
|
method: "GET",
|
|
1317
1347
|
headers: t
|
|
1318
1348
|
}));
|
|
1319
1349
|
}
|
|
1320
1350
|
//#endregion
|
|
1321
1351
|
//#region src/web-api/v1/fetch-principal.ts
|
|
1322
|
-
async function
|
|
1323
|
-
return
|
|
1352
|
+
async function Vt() {
|
|
1353
|
+
return j("api/v1/principal", new URLSearchParams({
|
|
1324
1354
|
action: "get",
|
|
1325
|
-
noAutoAuthentication: String(
|
|
1355
|
+
noAutoAuthentication: String(M())
|
|
1326
1356
|
}));
|
|
1327
1357
|
}
|
|
1328
|
-
async function
|
|
1358
|
+
async function Ht(e) {
|
|
1329
1359
|
let t = {
|
|
1330
|
-
noAutoAuthentication: String(
|
|
1360
|
+
noAutoAuthentication: String(M()),
|
|
1331
1361
|
...e
|
|
1332
1362
|
}, n = new URLSearchParams();
|
|
1333
1363
|
return Object.entries(t).forEach(([e, t]) => {
|
|
1334
1364
|
t !== void 0 && n.append(e, String(t));
|
|
1335
|
-
}),
|
|
1365
|
+
}), j("api/v1/principal/list", n);
|
|
1336
1366
|
}
|
|
1337
|
-
async function
|
|
1338
|
-
return e ?
|
|
1367
|
+
async function Ut(e) {
|
|
1368
|
+
return e ? j("api/v1/principal", new URLSearchParams({
|
|
1339
1369
|
action: "userid",
|
|
1340
|
-
noAutoAuthentication: String(
|
|
1370
|
+
noAutoAuthentication: String(M()),
|
|
1341
1371
|
userid: e
|
|
1342
1372
|
})) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
|
|
1343
1373
|
}
|
|
1344
|
-
async function
|
|
1345
|
-
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) :
|
|
1346
|
-
noAutoAuthentication: String(
|
|
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()),
|
|
1347
1377
|
userids: [...e].join(",")
|
|
1348
1378
|
}));
|
|
1349
1379
|
}
|
|
1350
|
-
var
|
|
1351
|
-
get:
|
|
1352
|
-
list:
|
|
1353
|
-
userid:
|
|
1354
|
-
userids:
|
|
1355
|
-
} },
|
|
1356
|
-
async function
|
|
1357
|
-
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", {
|
|
1358
1388
|
query: e,
|
|
1359
1389
|
$auditRecord: t,
|
|
1360
1390
|
queryIntentData: n
|
|
1361
1391
|
});
|
|
1362
1392
|
r.aggregations.forEach((e) => {
|
|
1363
|
-
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);
|
|
1364
1394
|
}), r.records?.map((e) => Object.assign(e, {
|
|
1365
1395
|
value: e.title,
|
|
1366
1396
|
type: "default"
|
|
@@ -1372,7 +1402,7 @@ async function Kt(e, t, n) {
|
|
|
1372
1402
|
};
|
|
1373
1403
|
return Promise.resolve(i);
|
|
1374
1404
|
}
|
|
1375
|
-
async function
|
|
1405
|
+
async function Jt(e, t, n) {
|
|
1376
1406
|
let { app: i = "" } = r, a = {
|
|
1377
1407
|
methods: [],
|
|
1378
1408
|
mode: t,
|
|
@@ -1384,10 +1414,10 @@ async function qt(e, t, n) {
|
|
|
1384
1414
|
app: i,
|
|
1385
1415
|
query: t
|
|
1386
1416
|
});
|
|
1387
|
-
let o = await
|
|
1417
|
+
let o = await N("api/v1/multi", a);
|
|
1388
1418
|
o.results.forEach((e) => {
|
|
1389
1419
|
e.aggregations.forEach((e) => {
|
|
1390
|
-
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);
|
|
1391
1421
|
});
|
|
1392
1422
|
}), o.results.forEach((e) => e.records?.map((e) => Object.assign(e, {
|
|
1393
1423
|
value: e.title,
|
|
@@ -1412,7 +1442,7 @@ function K(e, t = "", n = 0) {
|
|
|
1412
1442
|
}
|
|
1413
1443
|
//#endregion
|
|
1414
1444
|
//#region src/web-api/v1/fetch-query-export.ts
|
|
1415
|
-
async function
|
|
1445
|
+
async function Yt({ model: e, appName: t, query: n, article: r }) {
|
|
1416
1446
|
let { webservice: i, format: a, maxcount: o, exportedColumns: s, export: c } = e, l = {
|
|
1417
1447
|
app: t,
|
|
1418
1448
|
webservice: i,
|
|
@@ -1426,25 +1456,25 @@ async function Jt({ model: e, appName: t, query: n, article: r }) {
|
|
|
1426
1456
|
detail: { resultid: r ? r.id : void 0 }
|
|
1427
1457
|
}] }
|
|
1428
1458
|
};
|
|
1429
|
-
return G(l), await
|
|
1459
|
+
return G(l), await N("api/v1/search.queryexport", l, { responseType: "blob" });
|
|
1430
1460
|
}
|
|
1431
1461
|
//#endregion
|
|
1432
1462
|
//#region src/web-api/v1/fetch-query-intent.ts
|
|
1433
|
-
async function
|
|
1434
|
-
return (await
|
|
1463
|
+
async function Xt(e) {
|
|
1464
|
+
return (await N("api/v1/queryintent", { query: e }))?.intents;
|
|
1435
1465
|
}
|
|
1436
1466
|
//#endregion
|
|
1437
1467
|
//#region src/web-api/v1/fetch-similar-documents.ts
|
|
1438
|
-
async function
|
|
1439
|
-
return (await
|
|
1468
|
+
async function Zt(e, t, n) {
|
|
1469
|
+
return (await N("api/v1/similardocuments", {
|
|
1440
1470
|
sourceDocumentId: e,
|
|
1441
1471
|
query: { name: t }
|
|
1442
1472
|
}, { signal: n })).data;
|
|
1443
1473
|
}
|
|
1444
1474
|
//#endregion
|
|
1445
1475
|
//#region src/web-api/v1/fetch-sponsored-links.ts
|
|
1446
|
-
async function
|
|
1447
|
-
return (await
|
|
1476
|
+
async function Qt(e, t) {
|
|
1477
|
+
return (await N("api/v1/query.links", {
|
|
1448
1478
|
webservice: e,
|
|
1449
1479
|
query: t
|
|
1450
1480
|
}))?.links?.map((e) => ({
|
|
@@ -1454,9 +1484,9 @@ async function Zt(e, t) {
|
|
|
1454
1484
|
}
|
|
1455
1485
|
//#endregion
|
|
1456
1486
|
//#region src/utils/to-sql.ts
|
|
1457
|
-
function
|
|
1487
|
+
function $t(e, t) {
|
|
1458
1488
|
if (typeof e == "number") return `${e}`;
|
|
1459
|
-
if (ot(e)) return t ? `'${
|
|
1489
|
+
if (ot(e)) return t ? `'${en(e)}'` : en(e);
|
|
1460
1490
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
1461
1491
|
if (e === null) return "null";
|
|
1462
1492
|
if (Array.isArray(e)) {
|
|
@@ -1467,7 +1497,7 @@ function Qt(e, t) {
|
|
|
1467
1497
|
}
|
|
1468
1498
|
return t ? `'${e}'` : e;
|
|
1469
1499
|
}
|
|
1470
|
-
function
|
|
1500
|
+
function en(e) {
|
|
1471
1501
|
if (!e) return "";
|
|
1472
1502
|
try {
|
|
1473
1503
|
return lt(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
|
|
@@ -1486,7 +1516,7 @@ function $t(e) {
|
|
|
1486
1516
|
}
|
|
1487
1517
|
//#endregion
|
|
1488
1518
|
//#region src/web-api/v1/fetch-suggest.ts
|
|
1489
|
-
async function
|
|
1519
|
+
async function tn(e, t, n, i, a) {
|
|
1490
1520
|
let { app: o } = r, s = {
|
|
1491
1521
|
app: o || "",
|
|
1492
1522
|
suggestQuery: e,
|
|
@@ -1496,14 +1526,14 @@ async function en(e, t, n, i, a) {
|
|
|
1496
1526
|
showSource: a
|
|
1497
1527
|
};
|
|
1498
1528
|
try {
|
|
1499
|
-
return (await
|
|
1529
|
+
return (await N("api/v1/search.suggest", s)).suggests;
|
|
1500
1530
|
} catch (e) {
|
|
1501
1531
|
throw console.error("Error fetching suggestions:", e), e;
|
|
1502
1532
|
}
|
|
1503
1533
|
}
|
|
1504
|
-
async function
|
|
1534
|
+
async function nn(e, t, n, i) {
|
|
1505
1535
|
let { app: a } = r;
|
|
1506
|
-
return (await
|
|
1536
|
+
return (await N("api/v1/suggestquery", {
|
|
1507
1537
|
app: a || "",
|
|
1508
1538
|
suggestQuery: e,
|
|
1509
1539
|
text: t,
|
|
@@ -1511,22 +1541,22 @@ async function tn(e, t, n, i) {
|
|
|
1511
1541
|
kinds: i
|
|
1512
1542
|
})).suggests;
|
|
1513
1543
|
}
|
|
1514
|
-
async function
|
|
1544
|
+
async function rn(e, t, n) {
|
|
1515
1545
|
if (!t) return Promise.resolve([]);
|
|
1516
|
-
let { app: i } = r, a = await
|
|
1546
|
+
let { app: i } = r, a = await N("api/v1/suggestfield", {
|
|
1517
1547
|
app: i || "",
|
|
1518
1548
|
text: e,
|
|
1519
1549
|
fields: t,
|
|
1520
1550
|
query: n
|
|
1521
1551
|
});
|
|
1522
1552
|
return a.suggests.forEach((e) => {
|
|
1523
|
-
e.display =
|
|
1553
|
+
e.display = $t(e.display);
|
|
1524
1554
|
}), a.suggests;
|
|
1525
1555
|
}
|
|
1526
1556
|
//#endregion
|
|
1527
1557
|
//#region src/web-api/v1/fetch-text-chunk.ts
|
|
1528
|
-
async function
|
|
1529
|
-
return
|
|
1558
|
+
async function an(e, t, n, r, i, a) {
|
|
1559
|
+
return N("api/v1/doc.textchunks", {
|
|
1530
1560
|
id: e,
|
|
1531
1561
|
textChunks: t,
|
|
1532
1562
|
highlights: n,
|
|
@@ -1537,86 +1567,86 @@ async function rn(e, t, n, r, i, a) {
|
|
|
1537
1567
|
}
|
|
1538
1568
|
//#endregion
|
|
1539
1569
|
//#region src/web-api/v1/fetch-user-settings.ts
|
|
1540
|
-
async function
|
|
1570
|
+
async function on() {
|
|
1541
1571
|
let { app: e } = r;
|
|
1542
|
-
return
|
|
1572
|
+
return j("api/v1/usersettings", new URLSearchParams({
|
|
1543
1573
|
app: e || "",
|
|
1544
1574
|
action: "load"
|
|
1545
1575
|
}));
|
|
1546
1576
|
}
|
|
1547
|
-
async function
|
|
1577
|
+
async function sn(e, t) {
|
|
1548
1578
|
let n = {
|
|
1549
1579
|
action: "save",
|
|
1550
1580
|
userSettings: e,
|
|
1551
1581
|
$auditRecord: { auditEvents: [t] }
|
|
1552
1582
|
};
|
|
1553
|
-
return G(n),
|
|
1583
|
+
return G(n), N("api/v1/usersettings", n);
|
|
1554
1584
|
}
|
|
1555
|
-
async function
|
|
1585
|
+
async function cn(e, t) {
|
|
1556
1586
|
let n = {
|
|
1557
1587
|
action: "patch",
|
|
1558
1588
|
userSettings: e,
|
|
1559
1589
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1560
1590
|
};
|
|
1561
|
-
return G(n),
|
|
1591
|
+
return G(n), N("api/v1/usersettings", n);
|
|
1562
1592
|
}
|
|
1563
|
-
async function
|
|
1564
|
-
return
|
|
1593
|
+
async function ln() {
|
|
1594
|
+
return sn({}, { type: "UserSettings_Reset" });
|
|
1565
1595
|
}
|
|
1566
1596
|
//#endregion
|
|
1567
1597
|
//#region src/web-api/v2/fetch-change-password.ts
|
|
1568
|
-
async function
|
|
1569
|
-
return
|
|
1598
|
+
async function un(e, t) {
|
|
1599
|
+
return N("api/v2/security/password/change", {
|
|
1570
1600
|
newPassword: e,
|
|
1571
1601
|
currentPassword: t
|
|
1572
1602
|
});
|
|
1573
1603
|
}
|
|
1574
1604
|
//#endregion
|
|
1575
1605
|
//#region src/web-api/v2/fetch-forgot-password.ts
|
|
1576
|
-
async function
|
|
1577
|
-
return
|
|
1606
|
+
async function dn(e) {
|
|
1607
|
+
return N("api/v2/security/password/ask-reset-email", {
|
|
1578
1608
|
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1579
1609
|
userName: e
|
|
1580
1610
|
});
|
|
1581
1611
|
}
|
|
1582
1612
|
//#endregion
|
|
1583
1613
|
//#region src/web-api/v2/fetch-user-profile.ts
|
|
1584
|
-
async function dn(e) {
|
|
1585
|
-
return await M(`api/v2/user-profile/${e}`);
|
|
1586
|
-
}
|
|
1587
1614
|
async function fn(e) {
|
|
1588
|
-
return await
|
|
1615
|
+
return await j(`api/v2/user-profile/${e}`);
|
|
1589
1616
|
}
|
|
1590
|
-
async function pn(e
|
|
1591
|
-
return await
|
|
1617
|
+
async function pn(e) {
|
|
1618
|
+
return await N("api/v2/user-profile", e);
|
|
1592
1619
|
}
|
|
1593
1620
|
async function mn(e, t, n) {
|
|
1621
|
+
return await Ve(`api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
|
|
1622
|
+
}
|
|
1623
|
+
async function hn(e, t, n) {
|
|
1594
1624
|
try {
|
|
1595
|
-
return (await
|
|
1625
|
+
return (await Be(`api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
|
|
1596
1626
|
} catch {
|
|
1597
1627
|
return !1;
|
|
1598
1628
|
}
|
|
1599
1629
|
}
|
|
1600
1630
|
//#endregion
|
|
1601
1631
|
//#region src/web-api/v2/fetch-version.ts
|
|
1602
|
-
async function
|
|
1603
|
-
return await
|
|
1632
|
+
async function gn() {
|
|
1633
|
+
return await j("api/v2/version");
|
|
1604
1634
|
}
|
|
1605
1635
|
//#endregion
|
|
1606
1636
|
//#region src/authentication/constants.ts
|
|
1607
|
-
var q = 1e4, J = "sinequa-auth-redirect-attempt",
|
|
1637
|
+
var q = 1e4, J = "sinequa-auth-redirect-attempt", _n = async () => {
|
|
1608
1638
|
let { autoOAuthProvider: e } = r;
|
|
1609
1639
|
if (!e) throw Error("autoOAuthProvider is not configured in globalConfig");
|
|
1610
1640
|
if (typeof window > "u") try {
|
|
1611
|
-
let { signal: t } =
|
|
1612
|
-
return await
|
|
1641
|
+
let { signal: t } = P(q);
|
|
1642
|
+
return await N("security.oauth", {
|
|
1613
1643
|
action: "getcode",
|
|
1614
1644
|
provider: e,
|
|
1615
1645
|
tokenInCookie: !0,
|
|
1616
1646
|
originalUrl: "http://localhost"
|
|
1617
1647
|
}, { signal: t });
|
|
1618
1648
|
} catch (e) {
|
|
1619
|
-
throw
|
|
1649
|
+
throw C("Failed to authenticate with OAuth", e), e;
|
|
1620
1650
|
}
|
|
1621
1651
|
let t = {
|
|
1622
1652
|
action: "getcode",
|
|
@@ -1625,7 +1655,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
|
|
|
1625
1655
|
originalUrl: window.location.href
|
|
1626
1656
|
};
|
|
1627
1657
|
try {
|
|
1628
|
-
let { signal: n } =
|
|
1658
|
+
let { signal: n } = P(q), r = await N("api/v1/security.oauth", t, { signal: n });
|
|
1629
1659
|
if (r.redirectUrl) {
|
|
1630
1660
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1631
1661
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1635,21 +1665,21 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
|
|
|
1635
1665
|
}
|
|
1636
1666
|
return r;
|
|
1637
1667
|
} catch (e) {
|
|
1638
|
-
throw
|
|
1668
|
+
throw C("Failed to authenticate with OAuth", e), e;
|
|
1639
1669
|
}
|
|
1640
|
-
},
|
|
1670
|
+
}, vn = async () => {
|
|
1641
1671
|
let { autoSAMLProvider: e } = r;
|
|
1642
1672
|
if (!e) throw Error("autoSAMLProvider is not configured in globalConfig");
|
|
1643
1673
|
if (typeof window > "u") try {
|
|
1644
|
-
let { signal: t } =
|
|
1645
|
-
return await
|
|
1674
|
+
let { signal: t } = P(q);
|
|
1675
|
+
return await N("security.saml", {
|
|
1646
1676
|
action: "getresponse",
|
|
1647
1677
|
provider: e,
|
|
1648
1678
|
tokenInCookie: !0,
|
|
1649
1679
|
originalUrl: "http://localhost"
|
|
1650
1680
|
}, { signal: t });
|
|
1651
1681
|
} catch (e) {
|
|
1652
|
-
throw
|
|
1682
|
+
throw C("Failed to authenticate with SAML", e), e;
|
|
1653
1683
|
}
|
|
1654
1684
|
let t = {
|
|
1655
1685
|
action: "getresponse",
|
|
@@ -1658,7 +1688,7 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
|
|
|
1658
1688
|
originalUrl: window.location.href
|
|
1659
1689
|
};
|
|
1660
1690
|
try {
|
|
1661
|
-
let { signal: n } =
|
|
1691
|
+
let { signal: n } = P(q), r = await N("api/v1/security.saml", t, { signal: n });
|
|
1662
1692
|
if (r.redirectUrl) {
|
|
1663
1693
|
let t = new URL(r.redirectUrl, window.location.origin);
|
|
1664
1694
|
if (t.protocol === "https:" || t.protocol === "http:") {
|
|
@@ -1668,15 +1698,15 @@ var q = 1e4, J = "sinequa-auth-redirect-attempt", gn = async () => {
|
|
|
1668
1698
|
}
|
|
1669
1699
|
return r;
|
|
1670
1700
|
} catch (e) {
|
|
1671
|
-
throw
|
|
1701
|
+
throw C("Failed to authenticate with SAML", e), e;
|
|
1672
1702
|
}
|
|
1673
1703
|
}, Y = (e) => u("sinequa-credentials", JSON.stringify({ data: { csrfToken: e } })), X = async () => {
|
|
1674
1704
|
let e;
|
|
1675
1705
|
try {
|
|
1676
|
-
let { signal: t } =
|
|
1677
|
-
e = await
|
|
1706
|
+
let { signal: t } = P(q);
|
|
1707
|
+
e = await j("api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, { signal: t });
|
|
1678
1708
|
} catch (e) {
|
|
1679
|
-
throw
|
|
1709
|
+
throw S("CSRF token fetch failed", e), e;
|
|
1680
1710
|
}
|
|
1681
1711
|
return e?.csrfToken ? (Y(e.csrfToken), e.csrfToken) : null;
|
|
1682
1712
|
};
|
|
@@ -1693,10 +1723,10 @@ async function Z(e) {
|
|
|
1693
1723
|
noAutoAuthentication: !0
|
|
1694
1724
|
};
|
|
1695
1725
|
try {
|
|
1696
|
-
let { signal: e } =
|
|
1726
|
+
let { signal: e } = P(q), t = await N("api/v1/security.webtoken", r, { signal: e });
|
|
1697
1727
|
return t?.csrfToken ? (Y(t.csrfToken), t.csrfToken) : null;
|
|
1698
1728
|
} catch (e) {
|
|
1699
|
-
throw
|
|
1729
|
+
throw C("Failed to get JWT", e), e;
|
|
1700
1730
|
}
|
|
1701
1731
|
} else {
|
|
1702
1732
|
let e = {
|
|
@@ -1709,13 +1739,13 @@ async function Z(e) {
|
|
|
1709
1739
|
let n = new Headers();
|
|
1710
1740
|
n.append("Sinequa-Force-Camel-Case", "true"), n.append("accept", "application/json"), n.append("Content-Type", "application/json"), n.append("Authorization", `Bearer ${t}`);
|
|
1711
1741
|
try {
|
|
1712
|
-
let { signal: t } =
|
|
1742
|
+
let { signal: t } = P(q), r = await N("api/v1/security.webtoken", e, {
|
|
1713
1743
|
headers: n,
|
|
1714
1744
|
signal: t
|
|
1715
1745
|
});
|
|
1716
1746
|
return r?.csrfToken ? (Y(r.csrfToken), r.csrfToken) : null;
|
|
1717
1747
|
} catch (e) {
|
|
1718
|
-
throw
|
|
1748
|
+
throw C("Failed to get JWT without credentials", e), e;
|
|
1719
1749
|
}
|
|
1720
1750
|
}
|
|
1721
1751
|
}
|
|
@@ -1727,45 +1757,45 @@ var Q = () => {
|
|
|
1727
1757
|
let t = JSON.parse(e).data?.csrfToken;
|
|
1728
1758
|
if (t) return t;
|
|
1729
1759
|
} catch (e) {
|
|
1730
|
-
|
|
1760
|
+
S("Failed to parse session storage credentials, falling back to local storage", e);
|
|
1731
1761
|
}
|
|
1732
1762
|
return s("csrfToken") || null;
|
|
1733
|
-
}, $ = "sinequa-authenticated",
|
|
1763
|
+
}, $ = "sinequa-authenticated", yn = (e) => {
|
|
1734
1764
|
e ? u($, "true") : d($);
|
|
1735
|
-
},
|
|
1765
|
+
}, bn = () => l($) === "true", xn = async () => {
|
|
1736
1766
|
try {
|
|
1737
|
-
let { signal: e } =
|
|
1738
|
-
return await
|
|
1767
|
+
let { signal: e } = P(q);
|
|
1768
|
+
return await j("api/v1/principal", new URLSearchParams({ action: "get" }), {
|
|
1739
1769
|
signal: e,
|
|
1740
1770
|
redirect: "manual"
|
|
1741
|
-
}),
|
|
1771
|
+
}), x("Server auto-authenticated the user (OIDC)"), !0;
|
|
1742
1772
|
} catch {
|
|
1743
1773
|
return !1;
|
|
1744
1774
|
}
|
|
1745
|
-
},
|
|
1775
|
+
}, Sn = async (n) => {
|
|
1746
1776
|
if (n) {
|
|
1747
1777
|
let { username: t, password: r } = n;
|
|
1748
|
-
return !t || !r ? (
|
|
1778
|
+
return !t || !r ? (C("Credentials are required for authentication"), e(!1), !1) : Cn({
|
|
1749
1779
|
username: t,
|
|
1750
1780
|
password: r
|
|
1751
1781
|
});
|
|
1752
1782
|
}
|
|
1753
1783
|
let a = r.authMode ?? t.unknown();
|
|
1754
1784
|
if (a.kind === "credentials") return e(!1), !1;
|
|
1755
|
-
if (a.kind === "bearer") return
|
|
1785
|
+
if (a.kind === "bearer") return wn();
|
|
1756
1786
|
if (Q()) return i({ isRedirectUrl: !1 }), d(J), e(!0), !0;
|
|
1757
1787
|
try {
|
|
1758
|
-
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;
|
|
1759
1789
|
} catch {}
|
|
1760
1790
|
switch (a.kind) {
|
|
1761
|
-
case "oauth": return
|
|
1762
|
-
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;
|
|
1763
1793
|
case "sso": return e(!1), !1;
|
|
1764
|
-
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);
|
|
1765
1795
|
}
|
|
1766
1796
|
};
|
|
1767
|
-
async function
|
|
1768
|
-
|
|
1797
|
+
async function Cn(n) {
|
|
1798
|
+
x("Attempting authentication using credentials"), i({ authMode: t.credentials() });
|
|
1769
1799
|
let { userOverrideActive: a, userOverride: o } = r;
|
|
1770
1800
|
i({
|
|
1771
1801
|
userOverrideActive: !1,
|
|
@@ -1781,41 +1811,41 @@ async function Sn(n) {
|
|
|
1781
1811
|
userOverride: o
|
|
1782
1812
|
}), e(!0), !0;
|
|
1783
1813
|
}
|
|
1784
|
-
async function
|
|
1814
|
+
async function wn() {
|
|
1785
1815
|
try {
|
|
1786
|
-
if (
|
|
1816
|
+
if (x("Attempting authentication using bearer token"), await Z()) return e(!0), !0;
|
|
1787
1817
|
} catch (t) {
|
|
1788
|
-
throw
|
|
1818
|
+
throw C("Bearer authentication failed", t), e(!1), t;
|
|
1789
1819
|
}
|
|
1790
1820
|
return e(!1), !1;
|
|
1791
1821
|
}
|
|
1792
1822
|
//#endregion
|
|
1793
1823
|
//#region src/authentication/tokens/delete-web-token-cookie.ts
|
|
1794
|
-
var
|
|
1824
|
+
var Tn = async () => {
|
|
1795
1825
|
let e = new URLSearchParams({
|
|
1796
1826
|
action: "deleteWebTokenCookie",
|
|
1797
1827
|
noUserOverride: "true",
|
|
1798
1828
|
noAutoAuthentication: "true"
|
|
1799
|
-
}), { signal: t } =
|
|
1800
|
-
return
|
|
1829
|
+
}), { signal: t } = P(q);
|
|
1830
|
+
return j("api/v1/challenge", e, { signal: t });
|
|
1801
1831
|
};
|
|
1802
1832
|
//#endregion
|
|
1803
1833
|
//#region src/authentication/session/logout.ts
|
|
1804
|
-
async function
|
|
1834
|
+
async function En() {
|
|
1805
1835
|
let { userOverrideActive: e } = r;
|
|
1806
|
-
if (
|
|
1807
|
-
let { methodresult: e, logoutUrl: t } = await
|
|
1836
|
+
if (Dn(), !e) try {
|
|
1837
|
+
let { methodresult: e, logoutUrl: t } = await Tn();
|
|
1808
1838
|
if (e === "ok") return t;
|
|
1809
|
-
|
|
1839
|
+
C("logout failed");
|
|
1810
1840
|
} catch (e) {
|
|
1811
|
-
|
|
1841
|
+
C("logout failed", e);
|
|
1812
1842
|
}
|
|
1813
1843
|
}
|
|
1814
|
-
function
|
|
1815
|
-
c("csrfToken"), d("sinequa-credentials"),
|
|
1844
|
+
function Dn() {
|
|
1845
|
+
c("csrfToken"), d("sinequa-credentials"), yn(!1), e(!1);
|
|
1816
1846
|
}
|
|
1817
1847
|
//#endregion
|
|
1818
1848
|
//#region src/authentication/session/user-authentication.ts
|
|
1819
|
-
var
|
|
1849
|
+
var On = () => !!Q() || bn();
|
|
1820
1850
|
//#endregion
|
|
1821
|
-
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 };
|