@sinequa/atomic 2.7.0 → 2.8.0
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/README.md +83 -67
- package/dist/atomic.cjs +1 -1
- package/dist/atomic.js +1 -2
- package/dist/authentication/constants.d.ts.map +1 -1
- package/dist/authentication/events/auth-events.d.ts +25 -0
- package/dist/authentication/events/auth-events.d.ts.map +1 -1
- package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -1
- package/dist/authentication/events/index.d.ts +1 -1
- package/dist/authentication/events/index.d.ts.map +1 -1
- package/dist/authentication/index.d.ts +1 -1
- package/dist/authentication/index.d.ts.map +1 -1
- package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
- package/dist/authentication/providers/redirect-to-identity-provider.d.ts.map +1 -1
- package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
- package/dist/authentication/session/auth-mode-marker.d.ts.map +1 -1
- package/dist/authentication/session/auth-state.d.ts.map +1 -1
- package/dist/authentication/session/has-session.d.ts.map +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/authentication/session/logout.d.ts.map +1 -1
- package/dist/authentication/session/redirect-guard.d.ts.map +1 -1
- package/dist/authentication/session/session-lost-latch.d.ts +32 -0
- package/dist/authentication/session/session-lost-latch.d.ts.map +1 -0
- package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -1
- package/dist/authentication/session/user-authentication.d.ts.map +1 -1
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
- package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -1
- package/dist/authentication/tokens/get-token.d.ts.map +1 -1
- package/dist/authentication/tokens/set-token.d.ts.map +1 -1
- package/dist/client/atomic-context.d.ts.map +1 -1
- package/dist/client/create-api.d.ts.map +1 -1
- package/dist/client/create-atomic-client.d.ts.map +1 -1
- package/dist/client/http-adapter.d.ts.map +1 -1
- package/dist/configurations/auth-mode.d.ts.map +1 -1
- package/dist/configurations/global.config.d.ts.map +1 -1
- package/dist/configurations/index.d.ts +1 -1
- package/dist/configurations/index.d.ts.map +1 -1
- package/dist/helpers/column-resolver.d.ts.map +1 -1
- package/dist/helpers/columns.d.ts.map +1 -1
- package/dist/helpers/filters.d.ts.map +1 -1
- package/dist/helpers/metadata.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/polyfills/storage.d.ts.map +1 -1
- package/dist/spfx/index.cjs +1 -1
- package/dist/spfx/index.js +1 -2
- package/dist/{src-BowomHL9.js → src-C-nHTU3y.js} +684 -619
- package/dist/src-DMsETv6_.cjs +1 -0
- package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
- package/dist/types/config/EngineTypeModifier.d.ts.map +1 -1
- package/dist/types/config/QueryPrecision.d.ts.map +1 -1
- package/dist/types/document-upload/upload-status.d.ts.map +1 -1
- package/dist/types/filters/Filter.d.ts.map +1 -1
- package/dist/types/search/index.d.ts +1 -1
- package/dist/types/search/index.d.ts.map +1 -1
- package/dist/utils/aggregations.d.ts.map +1 -1
- package/dist/utils/bisect.d.ts.map +1 -1
- package/dist/utils/concepts.d.ts.map +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/is-not-input-event.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/query-params.d.ts.map +1 -1
- package/dist/utils/utilities.d.ts.map +1 -1
- package/dist/web-api/helpers/aad-http-client-manager.d.ts.map +1 -1
- package/dist/web-api/helpers/create-headers.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/get.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/methods/send-request.d.ts +5 -0
- package/dist/web-api/helpers/methods/send-request.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/build-request-url.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/create-timeout-controller.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-aggregation.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-audit.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-dataset.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-labels.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-preview.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-principal.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query-export.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query-intent.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-query.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-security-principal.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-similar-documents.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-sponsored-links.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-suggest.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-text-chunk.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-user-settings.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-document-upload-container.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-document-upload-status.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-version.d.ts.map +1 -1
- package/package.json +24 -34
- package/dist/src-BS1kfBgv.cjs +0 -1
|
@@ -118,15 +118,11 @@ function ie(e) {
|
|
|
118
118
|
}
|
|
119
119
|
function ae(e, t) {
|
|
120
120
|
let { useCredentials: n, useSSO: r, useSAML: i, authMode: a, ...o } = t;
|
|
121
|
-
|
|
122
|
-
e.authMode = a;
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
(n !== void 0 || r !== void 0 || i !== void 0) && (e.authMode = re({
|
|
121
|
+
Object.assign(e, o), a === void 0 ? (n !== void 0 || r !== void 0 || i !== void 0) && (e.authMode = re({
|
|
126
122
|
useCredentials: n,
|
|
127
123
|
useSSO: r,
|
|
128
124
|
useSAML: i
|
|
129
|
-
}, e));
|
|
125
|
+
}, e)) : e.authMode = a;
|
|
130
126
|
}
|
|
131
127
|
//#endregion
|
|
132
128
|
//#region src/configurations/auth-options.ts
|
|
@@ -250,21 +246,51 @@ function b(e, t) {
|
|
|
250
246
|
ae(e.config, t);
|
|
251
247
|
}
|
|
252
248
|
//#endregion
|
|
253
|
-
//#region src/authentication/session/
|
|
254
|
-
var ge = /* @__PURE__ */ new
|
|
249
|
+
//#region src/authentication/session/session-lost-latch.ts
|
|
250
|
+
var ge = /* @__PURE__ */ new WeakMap();
|
|
251
|
+
function x(e) {
|
|
252
|
+
let t = ge.get(e);
|
|
253
|
+
return t || (t = {
|
|
254
|
+
epoch: 0,
|
|
255
|
+
claimed: !1,
|
|
256
|
+
claimedAt: 0,
|
|
257
|
+
establishedAt: 0
|
|
258
|
+
}, ge.set(e, t)), t;
|
|
259
|
+
}
|
|
255
260
|
function _e(e) {
|
|
256
|
-
|
|
261
|
+
return x(e).epoch;
|
|
257
262
|
}
|
|
258
|
-
function ve(e) {
|
|
259
|
-
|
|
263
|
+
function ve(e, t) {
|
|
264
|
+
let n = x(e);
|
|
265
|
+
return n.claimed || t < n.establishedAt ? !1 : (n.claimed = !0, n.claimedAt = ++n.epoch, !0);
|
|
260
266
|
}
|
|
261
267
|
function ye(e) {
|
|
262
|
-
|
|
268
|
+
let t = x(e);
|
|
269
|
+
t.claimed = !1, t.establishedAt = ++t.epoch;
|
|
270
|
+
}
|
|
271
|
+
function be(e, t) {
|
|
272
|
+
x(e).establishedAt <= t && ye(e);
|
|
273
|
+
}
|
|
274
|
+
function xe(e, t) {
|
|
275
|
+
let n = x(e);
|
|
276
|
+
n.claimed && t >= n.claimedAt && (n.claimed = !1);
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/authentication/session/signed-out-guard.ts
|
|
280
|
+
var Se = /* @__PURE__ */ new WeakSet();
|
|
281
|
+
function Ce(e) {
|
|
282
|
+
Se.add(e);
|
|
283
|
+
}
|
|
284
|
+
function we(e) {
|
|
285
|
+
return Se.has(e);
|
|
286
|
+
}
|
|
287
|
+
function Te(e) {
|
|
288
|
+
Se.delete(e);
|
|
263
289
|
}
|
|
264
290
|
//#endregion
|
|
265
291
|
//#region src/authentication/events/emit-authenticated-event.ts
|
|
266
|
-
function
|
|
267
|
-
if (t && ye(e), e.events.emit("authenticated", { authenticated: t }), typeof CustomEvent > "u") return;
|
|
292
|
+
function S(e, t) {
|
|
293
|
+
if (t && (Te(e), ye(e)), e.events.emit("authenticated", { authenticated: t }), typeof CustomEvent > "u") return;
|
|
268
294
|
let n = new CustomEvent("authenticated", {
|
|
269
295
|
bubbles: !0,
|
|
270
296
|
cancelable: !1,
|
|
@@ -272,67 +298,67 @@ function x(e, t) {
|
|
|
272
298
|
});
|
|
273
299
|
typeof document < "u" ? document.dispatchEvent(n) : typeof dispatchEvent < "u" && dispatchEvent(n);
|
|
274
300
|
}
|
|
275
|
-
function
|
|
276
|
-
|
|
301
|
+
function Ee(e) {
|
|
302
|
+
S(g, e);
|
|
277
303
|
}
|
|
278
|
-
var
|
|
304
|
+
var C = (e) => e.config.auth?.timeoutMs ?? 1e4, w = {
|
|
279
305
|
credentials: "sinequa-credentials",
|
|
280
306
|
legacyCsrfToken: "csrfToken",
|
|
281
307
|
authenticated: "sinequa-authenticated",
|
|
282
308
|
lastAuthMode: "sinequa-last-auth-mode"
|
|
283
|
-
},
|
|
284
|
-
let t = v(e, "session").get(y(e,
|
|
309
|
+
}, T = "sinequa-auth-redirect-attempt", E = (e) => {
|
|
310
|
+
let t = v(e, "session").get(y(e, w.credentials));
|
|
285
311
|
if (t) try {
|
|
286
312
|
let e = JSON.parse(t).data?.csrfToken;
|
|
287
313
|
if (typeof e == "string" && e) return e;
|
|
288
314
|
} catch (t) {
|
|
289
315
|
_(e).warn("Failed to parse session storage credentials, falling back to local storage", t);
|
|
290
316
|
}
|
|
291
|
-
return v(e, "local").get(y(e,
|
|
292
|
-
},
|
|
317
|
+
return v(e, "local").get(y(e, w.legacyCsrfToken)) || null;
|
|
318
|
+
}, De = () => E(g);
|
|
293
319
|
//#endregion
|
|
294
320
|
//#region src/web-api/helpers/create-headers.ts
|
|
295
|
-
function
|
|
296
|
-
let n =
|
|
321
|
+
function D(e, t) {
|
|
322
|
+
let n = E(e), r = new Headers(t);
|
|
297
323
|
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), n && r.append("Sinequa-csrf-token", n);
|
|
298
324
|
let { userOverride: i, userOverrideActive: a } = e.config, o = p(e.config);
|
|
299
325
|
return o && !e.resolveHttpAdapter() && r.append("Authorization", `Bearer ${o}`), i && a && (r.append("sinequa-override-user", i.username), r.append("sinequa-override-domain", i.domain)), r;
|
|
300
326
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
327
|
+
function Oe(e) {
|
|
328
|
+
return D(g, e);
|
|
303
329
|
}
|
|
304
330
|
//#endregion
|
|
305
331
|
//#region src/web-api/helpers/utils/build-request-url.ts
|
|
306
|
-
function
|
|
332
|
+
function O(e, t, n) {
|
|
307
333
|
let r = t.startsWith("plugin") ? `api/v1/${t}` : t, i = n ? `?${new URLSearchParams(n)}` : "", { backendUrl: a } = e.config;
|
|
308
334
|
return a ? `${a}/${r}${i}` : `${r}${i}`;
|
|
309
335
|
}
|
|
310
336
|
//#endregion
|
|
311
337
|
//#region src/web-api/helpers/errors/api-error.ts
|
|
312
|
-
var
|
|
338
|
+
var k = class extends Error {
|
|
313
339
|
status;
|
|
314
340
|
constructor(e, t) {
|
|
315
341
|
super(e), Object.setPrototypeOf(this, new.target.prototype), this.name = "ApiError", this.status = t;
|
|
316
342
|
}
|
|
317
|
-
},
|
|
343
|
+
}, A = class extends k {
|
|
318
344
|
constructor(e = "Unauthorized access") {
|
|
319
345
|
super(e, 401), this.name = "UnauthorizedError";
|
|
320
346
|
}
|
|
321
|
-
},
|
|
322
|
-
v(e, "session").set(y(e,
|
|
323
|
-
},
|
|
347
|
+
}, j = (e, t) => {
|
|
348
|
+
v(e, "session").set(y(e, w.credentials), JSON.stringify({ data: { csrfToken: t } })), e.events.emit("tokenRefreshed", { token: t });
|
|
349
|
+
}, ke = (e) => j(g, e), Ae = class extends k {
|
|
324
350
|
constructor(e = "Server error") {
|
|
325
351
|
super(e, 500), this.name = "ServerError";
|
|
326
352
|
}
|
|
327
353
|
};
|
|
328
354
|
//#endregion
|
|
329
355
|
//#region src/web-api/helpers/handle-response.ts
|
|
330
|
-
async function
|
|
331
|
-
return
|
|
356
|
+
async function je(e, t = "json") {
|
|
357
|
+
return M(g, e, t);
|
|
332
358
|
}
|
|
333
|
-
async function
|
|
359
|
+
async function M(e, t, n = "json", r = t.url ?? "") {
|
|
334
360
|
let i = t.headers.get("sinequa-jwt-refresh");
|
|
335
|
-
if (i !== null &&
|
|
361
|
+
if (i !== null && j(e, i), t.status >= 200 && t.status < 300) {
|
|
336
362
|
if (n === "response") return t;
|
|
337
363
|
let e = t.headers.get("content-length");
|
|
338
364
|
if (t.status === 204 || e === "0") return;
|
|
@@ -353,7 +379,7 @@ async function Ee(e, t, n = "json", r = t.url ?? "") {
|
|
|
353
379
|
endpoint: t.url ?? "",
|
|
354
380
|
error: n
|
|
355
381
|
});
|
|
356
|
-
let i = new
|
|
382
|
+
let i = new A(n.errorMessage ?? n.message ?? "Unauthorized... User override failed.");
|
|
357
383
|
throw e.events.emit("requestFailed", {
|
|
358
384
|
endpoint: r,
|
|
359
385
|
status: 401,
|
|
@@ -363,11 +389,11 @@ async function Ee(e, t, n = "json", r = t.url ?? "") {
|
|
|
363
389
|
error: i
|
|
364
390
|
}), i;
|
|
365
391
|
}
|
|
366
|
-
return await
|
|
392
|
+
return await Me(e, t, 401, r);
|
|
367
393
|
}
|
|
368
|
-
return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await
|
|
394
|
+
return t.status === 500 ? (_(e).error("Server error occurred", { endpoint: r }), await Me(e, t, 500, r)) : (_(e).warn(`Unexpected response status: ${t.status}`, { endpoint: r }), await Me(e, t, t.status, r));
|
|
369
395
|
}
|
|
370
|
-
async function
|
|
396
|
+
async function Me(e, t, n, r) {
|
|
371
397
|
let i = "";
|
|
372
398
|
try {
|
|
373
399
|
i = await t.text() ?? "";
|
|
@@ -380,111 +406,147 @@ async function De(e, t, n, r) {
|
|
|
380
406
|
errorCodeText: e.errorCodeText
|
|
381
407
|
};
|
|
382
408
|
} catch {}
|
|
383
|
-
let s = n === 401 ? new
|
|
409
|
+
let s = n === 401 ? new A(a) : n === 500 ? new Ae(a) : new k(a ?? `Request failed with status ${n}`, n);
|
|
384
410
|
throw o && (s.cause = o), e.events.emit("requestFailed", {
|
|
385
411
|
endpoint: r,
|
|
386
412
|
status: n,
|
|
387
413
|
error: s
|
|
388
|
-
}), s instanceof
|
|
414
|
+
}), s instanceof A && e.events.emit("unauthorized", {
|
|
389
415
|
endpoint: r,
|
|
390
416
|
error: s
|
|
391
417
|
}), s;
|
|
392
418
|
}
|
|
393
419
|
//#endregion
|
|
394
420
|
//#region src/web-api/helpers/utils/resolve-no-auto-authentication.ts
|
|
395
|
-
function
|
|
421
|
+
function N(e) {
|
|
396
422
|
return e.config.authMode?.kind !== "sso";
|
|
397
423
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
424
|
+
function Ne() {
|
|
425
|
+
return N(g);
|
|
400
426
|
}
|
|
401
427
|
//#endregion
|
|
402
428
|
//#region src/web-api/helpers/methods/send-request.ts
|
|
403
|
-
var
|
|
404
|
-
function
|
|
405
|
-
let r =
|
|
429
|
+
var Pe = /* @__PURE__ */ new WeakMap();
|
|
430
|
+
function Fe(e, t, n) {
|
|
431
|
+
let r = Pe.get(e);
|
|
406
432
|
if (r) return r;
|
|
407
|
-
if (
|
|
433
|
+
if (we(e)) return _(e).debug(`Skipping session recovery for ${t}: the user signed out`), Promise.resolve({
|
|
434
|
+
outcome: "signedOut",
|
|
435
|
+
mark: -1
|
|
436
|
+
});
|
|
408
437
|
let i = e.config.auth?.recoverFromUnauthorized;
|
|
409
|
-
if (!i) return Promise.resolve(
|
|
410
|
-
|
|
438
|
+
if (!i) return Promise.resolve({
|
|
439
|
+
outcome: "noHook",
|
|
440
|
+
mark: -1
|
|
441
|
+
});
|
|
442
|
+
let a = _e(e), o = Promise.resolve().then(() => i({
|
|
411
443
|
endpoint: t,
|
|
412
444
|
error: n
|
|
413
|
-
})).
|
|
414
|
-
|
|
445
|
+
})).then((t) => t ? (be(e, a), {
|
|
446
|
+
outcome: "recovered",
|
|
447
|
+
mark: a
|
|
448
|
+
}) : {
|
|
449
|
+
outcome: "refused",
|
|
450
|
+
mark: a
|
|
451
|
+
}).catch((t) => (_(e).debug("Session recovery failed", t), {
|
|
452
|
+
outcome: "refused",
|
|
453
|
+
mark: a
|
|
454
|
+
})).finally(() => Pe.delete(e));
|
|
455
|
+
return Pe.set(e, o), o;
|
|
456
|
+
}
|
|
457
|
+
function Ie(e, t, n, r, i, a) {
|
|
458
|
+
return we(e) || a?.aborted || ve(e, i) && e.events.emit("sessionLost", {
|
|
459
|
+
endpoint: t,
|
|
460
|
+
error: n,
|
|
461
|
+
reason: r
|
|
462
|
+
}), n;
|
|
415
463
|
}
|
|
416
|
-
async function
|
|
464
|
+
async function Le(e, t, n, r, i) {
|
|
465
|
+
let a = await Re(e, t, n, r);
|
|
466
|
+
return xe(e, i), a;
|
|
467
|
+
}
|
|
468
|
+
async function Re(e, t, n, r) {
|
|
417
469
|
let i = e.resolveHttpAdapter();
|
|
418
|
-
return i ?
|
|
470
|
+
return i ? M(e, await i.fetch(t, {
|
|
419
471
|
...n,
|
|
420
472
|
signal: r?.signal
|
|
421
|
-
}), r?.responseType, t) :
|
|
473
|
+
}), r?.responseType, t) : M(e, await me(e)(t, {
|
|
422
474
|
...n,
|
|
423
475
|
credentials: he(e),
|
|
424
476
|
signal: r?.signal,
|
|
425
477
|
redirect: r?.redirect
|
|
426
478
|
}), r?.responseType, t);
|
|
427
479
|
}
|
|
428
|
-
async function
|
|
480
|
+
async function P(e, t, n, r) {
|
|
481
|
+
let i = _e(e);
|
|
429
482
|
try {
|
|
430
|
-
return await
|
|
431
|
-
} catch (
|
|
432
|
-
if (!(
|
|
483
|
+
return await Le(e, t, n, r, i);
|
|
484
|
+
} catch (a) {
|
|
485
|
+
if (!(a instanceof A) || r?.noRecovery) throw a;
|
|
486
|
+
let o = await Fe(e, t, a), { outcome: s } = o;
|
|
487
|
+
if (s === "signedOut") throw a;
|
|
488
|
+
if (s !== "recovered") throw Ie(e, t, a, s, Math.max(i, o.mark), r?.signal);
|
|
433
489
|
_(e).debug("Session recovered — replaying the request once");
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
490
|
+
let c = new Headers(n.headers), l = E(e);
|
|
491
|
+
l && c.set("Sinequa-csrf-token", l);
|
|
492
|
+
let u = _e(e);
|
|
493
|
+
try {
|
|
494
|
+
return await Le(e, t, {
|
|
495
|
+
...n,
|
|
496
|
+
headers: c
|
|
497
|
+
}, r, u);
|
|
498
|
+
} catch (n) {
|
|
499
|
+
throw n instanceof A ? Ie(e, t, n, "replayUnauthorized", u, r?.signal) : n;
|
|
500
|
+
}
|
|
439
501
|
}
|
|
440
502
|
}
|
|
441
|
-
function
|
|
503
|
+
function ze() {
|
|
442
504
|
return typeof navigator > "u" ? void 0 : navigator.language;
|
|
443
505
|
}
|
|
444
|
-
function
|
|
506
|
+
function F(e, t, n) {
|
|
445
507
|
let { uiLanguage: r } = e.config;
|
|
446
508
|
return JSON.stringify({
|
|
447
509
|
app: e.config.app,
|
|
448
510
|
...t,
|
|
449
|
-
locale: t.locale || r ||
|
|
511
|
+
locale: t.locale || r || ze(),
|
|
450
512
|
...r ? { "ui-language": r } : {},
|
|
451
513
|
noUserOverride: !e.config.userOverrideActive,
|
|
452
|
-
noAutoAuthentication: n?.noAutoAuthentication ??
|
|
514
|
+
noAutoAuthentication: n?.noAutoAuthentication ?? N(e)
|
|
453
515
|
});
|
|
454
516
|
}
|
|
455
517
|
//#endregion
|
|
456
518
|
//#region src/web-api/helpers/methods/post.ts
|
|
457
|
-
async function
|
|
458
|
-
let i =
|
|
519
|
+
async function I(e, t, n, r) {
|
|
520
|
+
let i = D(e, r?.headers);
|
|
459
521
|
i.has("Content-Type") || i.set("Content-Type", "application/json");
|
|
460
|
-
let a =
|
|
522
|
+
let a = O(e, t);
|
|
461
523
|
_(e).debug(`Making POST request to: ${a}`);
|
|
462
524
|
try {
|
|
463
|
-
return await
|
|
525
|
+
return await P(e, a, {
|
|
464
526
|
method: "POST",
|
|
465
527
|
headers: i,
|
|
466
|
-
body:
|
|
528
|
+
body: F(e, n, r)
|
|
467
529
|
}, r);
|
|
468
530
|
} catch (t) {
|
|
469
531
|
throw _(e).error("Error making POST request:", t), t;
|
|
470
532
|
}
|
|
471
533
|
}
|
|
472
|
-
async function
|
|
473
|
-
return
|
|
534
|
+
async function Be(e, t, n) {
|
|
535
|
+
return I(g, e, t, n);
|
|
474
536
|
}
|
|
475
537
|
//#endregion
|
|
476
538
|
//#region src/web-api/helpers/errors/timeout-error.ts
|
|
477
|
-
var
|
|
539
|
+
var Ve = class extends k {
|
|
478
540
|
constructor(e = "Request timed out") {
|
|
479
541
|
super(e, 408), this.name = "TimeoutError";
|
|
480
542
|
}
|
|
481
543
|
};
|
|
482
544
|
//#endregion
|
|
483
545
|
//#region src/web-api/helpers/utils/create-timeout-controller.ts
|
|
484
|
-
function
|
|
546
|
+
function L(e) {
|
|
485
547
|
let t = new AbortController(), { signal: n } = t;
|
|
486
548
|
return e && setTimeout(() => {
|
|
487
|
-
n.aborted || t.abort(new
|
|
549
|
+
n.aborted || t.abort(new Ve(`Request timed out after ${e}ms`));
|
|
488
550
|
}, e), {
|
|
489
551
|
controller: t,
|
|
490
552
|
signal: n
|
|
@@ -492,7 +554,7 @@ function F(e) {
|
|
|
492
554
|
}
|
|
493
555
|
//#endregion
|
|
494
556
|
//#region src/authentication/providers/redirect-to-identity-provider.ts
|
|
495
|
-
var
|
|
557
|
+
var He = {
|
|
496
558
|
oauth: {
|
|
497
559
|
label: "OAuth",
|
|
498
560
|
endpoint: "api/v1/security.oauth",
|
|
@@ -504,8 +566,8 @@ var Fe = {
|
|
|
504
566
|
action: "getresponse"
|
|
505
567
|
}
|
|
506
568
|
};
|
|
507
|
-
async function
|
|
508
|
-
let { label: r, endpoint: i, action: a } =
|
|
569
|
+
async function Ue(e, { kind: t, provider: n }) {
|
|
570
|
+
let { label: r, endpoint: i, action: a } = He[t], o = typeof window < "u", s = v(e, "session"), c = y(e, T);
|
|
509
571
|
if (o && s.get(c)) throw Error(`${r} sign-in with provider "${n}" did not establish a session — its callback is likely not authorized for this application.`);
|
|
510
572
|
let l = {
|
|
511
573
|
action: a,
|
|
@@ -514,8 +576,8 @@ async function Ie(e, { kind: t, provider: n }) {
|
|
|
514
576
|
originalUrl: typeof window > "u" ? "http://localhost" : window.location.href
|
|
515
577
|
}, u;
|
|
516
578
|
try {
|
|
517
|
-
let { signal: t } =
|
|
518
|
-
u = await
|
|
579
|
+
let { signal: t } = L(C(e));
|
|
580
|
+
u = await I(e, i, l, { signal: t });
|
|
519
581
|
} catch (t) {
|
|
520
582
|
throw _(e).error(`Failed to authenticate with ${r}`, t), t;
|
|
521
583
|
}
|
|
@@ -525,24 +587,24 @@ async function Ie(e, { kind: t, provider: n }) {
|
|
|
525
587
|
}
|
|
526
588
|
//#endregion
|
|
527
589
|
//#region src/authentication/providers/oauth-authentication.ts
|
|
528
|
-
var
|
|
590
|
+
var We = async (e) => {
|
|
529
591
|
let t = ee(e.config);
|
|
530
592
|
if (!t) throw Error("No OAuth provider configured: set `authMode: AuthMode.oauth(provider)`, or the `autoOAuthProvider` key.");
|
|
531
|
-
return
|
|
593
|
+
return Ue(e, {
|
|
532
594
|
kind: "oauth",
|
|
533
595
|
provider: t
|
|
534
596
|
});
|
|
535
|
-
},
|
|
597
|
+
}, Ge = () => We(g), Ke = async (e) => {
|
|
536
598
|
let t = te(e.config);
|
|
537
599
|
if (!t) throw Error("No SAML provider configured: set `authMode: AuthMode.saml(provider)`, or the `autoSAMLProvider` key.");
|
|
538
|
-
return
|
|
600
|
+
return Ue(e, {
|
|
539
601
|
kind: "saml",
|
|
540
602
|
provider: t
|
|
541
603
|
});
|
|
542
|
-
},
|
|
604
|
+
}, qe = () => Ke(g);
|
|
543
605
|
//#endregion
|
|
544
606
|
//#region src/authentication/session/detect-auth-mode.ts
|
|
545
|
-
function
|
|
607
|
+
function Je(e, t) {
|
|
546
608
|
if (e.authMode && e.authMode.kind !== "unknown") return e.authMode;
|
|
547
609
|
if (e.bearerToken) return f.bearer(e.bearerToken);
|
|
548
610
|
let n = e.autoOAuthProvider || t?.autoOAuthProvider;
|
|
@@ -552,13 +614,13 @@ function Ve(e, t) {
|
|
|
552
614
|
}
|
|
553
615
|
//#endregion
|
|
554
616
|
//#region src/web-api/helpers/methods/get.ts
|
|
555
|
-
async function
|
|
556
|
-
let i =
|
|
617
|
+
async function R(e, t, n, r) {
|
|
618
|
+
let i = D(e, r?.headers), a = n;
|
|
557
619
|
r?.noAutoAuthentication !== void 0 && (a = new URLSearchParams(n), a.set("noAutoAuthentication", String(r.noAutoAuthentication)));
|
|
558
|
-
let o =
|
|
620
|
+
let o = O(e, t, a);
|
|
559
621
|
_(e).debug(`Making GET request to: ${o}`);
|
|
560
622
|
try {
|
|
561
|
-
return await
|
|
623
|
+
return await P(e, o, {
|
|
562
624
|
method: "GET",
|
|
563
625
|
headers: i
|
|
564
626
|
}, r);
|
|
@@ -566,49 +628,49 @@ async function I(e, t, n, r) {
|
|
|
566
628
|
throw _(e).error("Error making GET request:", t), t;
|
|
567
629
|
}
|
|
568
630
|
}
|
|
569
|
-
async function
|
|
570
|
-
return
|
|
631
|
+
async function Ye(e, t, n) {
|
|
632
|
+
return R(g, e, t, n);
|
|
571
633
|
}
|
|
572
634
|
//#endregion
|
|
573
635
|
//#region src/authentication/tokens/get-csrf-token.ts
|
|
574
|
-
var
|
|
636
|
+
var Xe = async (e) => {
|
|
575
637
|
let t;
|
|
576
638
|
try {
|
|
577
|
-
let { signal: n } =
|
|
578
|
-
t = await
|
|
639
|
+
let { signal: n } = L(C(e));
|
|
640
|
+
t = await R(e, "api/v1/challenge?action=getCsrfToken&suppressErrors=true", void 0, {
|
|
579
641
|
signal: n,
|
|
580
642
|
noRecovery: !0
|
|
581
643
|
});
|
|
582
644
|
} catch (t) {
|
|
583
645
|
throw _(e).warn("CSRF token fetch failed", t), t;
|
|
584
646
|
}
|
|
585
|
-
return t?.csrfToken ? (
|
|
586
|
-
},
|
|
647
|
+
return t?.csrfToken ? (j(e, t.csrfToken), t.csrfToken) : null;
|
|
648
|
+
}, Ze = () => Xe(g);
|
|
587
649
|
//#endregion
|
|
588
650
|
//#region src/authentication/session/has-session.ts
|
|
589
|
-
async function
|
|
590
|
-
if (
|
|
651
|
+
async function Qe(e) {
|
|
652
|
+
if (E(e)) return _(e).info("Existing session (stored token)"), $e(e), !0;
|
|
591
653
|
try {
|
|
592
|
-
return _(e).info("Checking for an existing session via CSRF token retrieval"), await
|
|
654
|
+
return _(e).info("Checking for an existing session via CSRF token retrieval"), await Xe(e) !== null && ($e(e), !0);
|
|
593
655
|
} catch (t) {
|
|
594
656
|
return _(e).debug("CSRF session probe failed — treated as no existing session", t), !1;
|
|
595
657
|
}
|
|
596
658
|
}
|
|
597
|
-
function
|
|
598
|
-
v(e, "session").remove(y(e,
|
|
659
|
+
function $e(e) {
|
|
660
|
+
v(e, "session").remove(y(e, T));
|
|
599
661
|
}
|
|
600
|
-
var
|
|
662
|
+
var et = () => Qe(g);
|
|
601
663
|
//#endregion
|
|
602
664
|
//#region src/helpers/ts-helper.ts
|
|
603
|
-
function
|
|
665
|
+
function tt(e) {
|
|
604
666
|
throw Error(`Unexpected value: ${JSON.stringify(e)}`);
|
|
605
667
|
}
|
|
606
668
|
//#endregion
|
|
607
669
|
//#region src/authentication/tokens/get-jwt-token.ts
|
|
608
|
-
async function
|
|
670
|
+
async function nt(e, t, n) {
|
|
609
671
|
if (t) {
|
|
610
672
|
let { username: n, password: r } = t;
|
|
611
|
-
return
|
|
673
|
+
return at(e, {
|
|
612
674
|
action: "get",
|
|
613
675
|
tokenInCookie: !0,
|
|
614
676
|
user: n,
|
|
@@ -616,48 +678,48 @@ async function Ye(e, t, n) {
|
|
|
616
678
|
}, !0, "Failed to get JWT");
|
|
617
679
|
}
|
|
618
680
|
if (!p(e.config)) throw Error("A bearer token is required for credential-less authentication: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
|
|
619
|
-
return
|
|
681
|
+
return at(e, {
|
|
620
682
|
action: "get",
|
|
621
683
|
tokenInCookie: !0
|
|
622
684
|
}, !1, "Failed to get JWT without credentials", n?.recoverable);
|
|
623
685
|
}
|
|
624
|
-
async function
|
|
625
|
-
return
|
|
686
|
+
async function rt(e) {
|
|
687
|
+
return nt(g, e);
|
|
626
688
|
}
|
|
627
|
-
var
|
|
628
|
-
async function
|
|
689
|
+
var it = rt;
|
|
690
|
+
async function at(e, t, n, r, i = !1) {
|
|
629
691
|
try {
|
|
630
|
-
let { signal: r } =
|
|
692
|
+
let { signal: r } = L(C(e)), i = await I(e, "api/v1/security.webtoken", t, {
|
|
631
693
|
signal: r,
|
|
632
694
|
noAutoAuthentication: n,
|
|
633
695
|
noRecovery: !0
|
|
634
696
|
});
|
|
635
|
-
return i?.csrfToken ? (
|
|
697
|
+
return i?.csrfToken ? (j(e, i.csrfToken), i.csrfToken) : null;
|
|
636
698
|
} catch (t) {
|
|
637
699
|
throw _(e)[i ? "debug" : "error"](r, t), t;
|
|
638
700
|
}
|
|
639
701
|
}
|
|
640
702
|
//#endregion
|
|
641
703
|
//#region src/authentication/session/auth-mode-marker.ts
|
|
642
|
-
var
|
|
704
|
+
var ot = (e) => ({
|
|
643
705
|
storage: v(e, "local"),
|
|
644
|
-
key: y(e,
|
|
645
|
-
}),
|
|
646
|
-
let { storage: t, key: n } =
|
|
706
|
+
key: y(e, w.lastAuthMode)
|
|
707
|
+
}), st = (e) => {
|
|
708
|
+
let { storage: t, key: n } = ot(e);
|
|
647
709
|
t.set(n, "credentials");
|
|
648
|
-
},
|
|
649
|
-
let { storage: t, key: n } =
|
|
710
|
+
}, ct = (e) => {
|
|
711
|
+
let { storage: t, key: n } = ot(e);
|
|
650
712
|
return t.get(n) === "credentials";
|
|
651
|
-
},
|
|
652
|
-
let { storage: t, key: n } =
|
|
713
|
+
}, lt = (e) => {
|
|
714
|
+
let { storage: t, key: n } = ot(e);
|
|
653
715
|
t.remove(n);
|
|
654
|
-
},
|
|
655
|
-
let n = v(e, "session"), r = y(e,
|
|
716
|
+
}, ut = (e, t) => {
|
|
717
|
+
let n = v(e, "session"), r = y(e, w.authenticated);
|
|
656
718
|
t ? n.set(r, "true") : n.remove(r);
|
|
657
|
-
},
|
|
719
|
+
}, dt = (e) => v(e, "session").get(y(e, w.authenticated)) === "true", ft = "api/v1/principal", pt = async (e) => {
|
|
658
720
|
try {
|
|
659
|
-
let { signal: t } =
|
|
660
|
-
return await
|
|
721
|
+
let { signal: t } = L(C(e));
|
|
722
|
+
return await R(e, e.config.auth?.probeEndpoint ?? ft, new URLSearchParams({ action: "get" }), {
|
|
661
723
|
signal: t,
|
|
662
724
|
redirect: "manual",
|
|
663
725
|
noRecovery: !0
|
|
@@ -665,113 +727,113 @@ var $e = (e) => ({
|
|
|
665
727
|
} catch (t) {
|
|
666
728
|
return _(e).debug("Protected-endpoint probe failed — not authenticated", t), !1;
|
|
667
729
|
}
|
|
668
|
-
},
|
|
669
|
-
if (v(e, "session").remove(y(e,
|
|
670
|
-
let t =
|
|
730
|
+
}, mt = () => pt(g), ht = (e) => e.resolveHttpAdapter() ? f.sso() : ct(e) ? f.credentials() : f.sso(), gt = (e, t) => {
|
|
731
|
+
if (v(e, "session").remove(y(e, T)), t.kind === "unknown") {
|
|
732
|
+
let t = ht(e);
|
|
671
733
|
_(e).info(`Ambiguous auth mode resolved to "${t.kind}"`), b(e, { authMode: t });
|
|
672
734
|
}
|
|
673
|
-
return
|
|
674
|
-
},
|
|
735
|
+
return S(e, !0), !0;
|
|
736
|
+
}, _t = async (e) => await pt(e) ? (_(e).info("User authenticated by the server (ambient SSO / OIDC)"), await Xe(e).catch((t) => _(e).debug("Best-effort CSRF refresh after auto-authentication failed", t)), ut(e, !0), !0) : !1, vt = async (e, t) => {
|
|
675
737
|
if (t) {
|
|
676
738
|
let { username: n, password: r } = t;
|
|
677
|
-
return !n || !r ? (_(e).error("Credentials are required for authentication"),
|
|
739
|
+
return !n || !r ? (_(e).error("Credentials are required for authentication"), S(e, !1), !1) : bt(e, {
|
|
678
740
|
username: n,
|
|
679
741
|
password: r
|
|
680
742
|
});
|
|
681
743
|
}
|
|
682
744
|
let n = e.config.authMode ?? f.unknown();
|
|
683
|
-
if (n.kind === "bearer") return
|
|
684
|
-
if (await
|
|
745
|
+
if (n.kind === "bearer") return xt(e, n);
|
|
746
|
+
if (await Qe(e)) return _(e).info("User already authenticated (existing session)"), gt(e, n);
|
|
685
747
|
switch (n.kind) {
|
|
686
|
-
case "credentials": return
|
|
687
|
-
case "oauth": return _(e).info("Initiating OAuth authentication flow"), await
|
|
688
|
-
case "saml": return _(e).info("Initiating SAML authentication flow"), await
|
|
689
|
-
case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await
|
|
748
|
+
case "credentials": return S(e, !1), !1;
|
|
749
|
+
case "oauth": return _(e).info("Initiating OAuth authentication flow"), await We(e), S(e, !1), !1;
|
|
750
|
+
case "saml": return _(e).info("Initiating SAML authentication flow"), await Ke(e), S(e, !1), !1;
|
|
751
|
+
case "sso": return _(e).info("Letting the server authenticate the request (ambient SSO)"), await _t(e) ? gt(e, n) : (S(e, !1), !1);
|
|
690
752
|
case "unknown":
|
|
691
|
-
if (_(e).info("No provider declared — probing for server-side auto-authentication"), await
|
|
753
|
+
if (_(e).info("No provider declared — probing for server-side auto-authentication"), await _t(e)) {
|
|
692
754
|
let t = f.sso();
|
|
693
|
-
return b(e, { authMode: t }),
|
|
755
|
+
return b(e, { authMode: t }), gt(e, t);
|
|
694
756
|
}
|
|
695
|
-
return _(e).info("No provider, no session and no server-side authentication — falling back to the credentials form"), b(e, { authMode: f.credentials() }),
|
|
696
|
-
default: return
|
|
757
|
+
return _(e).info("No provider, no session and no server-side authentication — falling back to the credentials form"), b(e, { authMode: f.credentials() }), S(e, !1), !1;
|
|
758
|
+
default: return tt(n);
|
|
697
759
|
}
|
|
698
|
-
},
|
|
699
|
-
async function
|
|
700
|
-
_(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }),
|
|
760
|
+
}, yt = (e) => vt(g, e);
|
|
761
|
+
async function bt(e, t) {
|
|
762
|
+
_(e).info("Attempting authentication using credentials"), b(e, { authMode: f.credentials() }), st(e);
|
|
701
763
|
let { userOverrideActive: n, userOverride: r } = e.config;
|
|
702
764
|
b(e, {
|
|
703
765
|
userOverrideActive: !1,
|
|
704
766
|
userOverride: void 0
|
|
705
767
|
});
|
|
706
768
|
try {
|
|
707
|
-
await
|
|
769
|
+
await nt(e, t);
|
|
708
770
|
} catch (t) {
|
|
709
|
-
throw
|
|
771
|
+
throw S(e, !1), t;
|
|
710
772
|
} finally {
|
|
711
773
|
b(e, {
|
|
712
774
|
userOverrideActive: n,
|
|
713
775
|
userOverride: r
|
|
714
776
|
});
|
|
715
777
|
}
|
|
716
|
-
return
|
|
778
|
+
return S(e, !0), !0;
|
|
717
779
|
}
|
|
718
|
-
async function
|
|
719
|
-
if (_(e).info("Attempting authentication using bearer token"), !p(e.config)) throw
|
|
780
|
+
async function xt(e, t) {
|
|
781
|
+
if (_(e).info("Attempting authentication using bearer token"), !p(e.config)) throw S(e, !1), Error("Bearer mode requires a token: set `authMode: AuthMode.bearer(token)`, or the legacy `bearerToken` key.");
|
|
720
782
|
if (t.sessionCookie !== !1) try {
|
|
721
|
-
if (await
|
|
783
|
+
if (await nt(e, void 0, { recoverable: !0 })) return _(e).info("Bearer token exchanged for a server session"), S(e, !0), !0;
|
|
722
784
|
} catch (t) {
|
|
723
785
|
_(e).info("The server refused to exchange the bearer token for a session — continuing with the token alone. Requests this library issues stay authenticated, but what the browser loads by itself (document previews and their sub-resources, thumbnails, /xdownload links) cannot be. Allow the `webtoken` JSON method for this access token to get a session cookie, or set `AuthMode.bearer(token, { sessionCookie: false })` to stop asking.", t);
|
|
724
786
|
}
|
|
725
|
-
if (!await
|
|
726
|
-
return
|
|
787
|
+
if (!await pt(e)) throw S(e, !1), Error("The server refused the configured bearer token: it may be expired or revoked, or its JSON method rules may not allow the probe endpoint (see `auth.probeEndpoint`).");
|
|
788
|
+
return ut(e, !0), S(e, !0), !0;
|
|
727
789
|
}
|
|
728
790
|
//#endregion
|
|
729
791
|
//#region src/authentication/tokens/delete-web-token-cookie.ts
|
|
730
|
-
var
|
|
792
|
+
var St = async (e) => {
|
|
731
793
|
let t = new URLSearchParams({
|
|
732
794
|
action: "deleteWebTokenCookie",
|
|
733
795
|
noUserOverride: "true"
|
|
734
|
-
}), { signal: n } =
|
|
735
|
-
return
|
|
796
|
+
}), { signal: n } = L(C(e));
|
|
797
|
+
return R(e, "api/v1/challenge", t, {
|
|
736
798
|
signal: n,
|
|
737
799
|
noAutoAuthentication: !0,
|
|
738
800
|
noRecovery: !0
|
|
739
801
|
});
|
|
740
|
-
},
|
|
802
|
+
}, Ct = () => St(g);
|
|
741
803
|
//#endregion
|
|
742
804
|
//#region src/authentication/session/logout.ts
|
|
743
|
-
async function
|
|
805
|
+
async function wt(e) {
|
|
744
806
|
let { userOverrideActive: t } = e.config;
|
|
745
|
-
if (
|
|
746
|
-
let { methodresult: t, logoutUrl: n } = await
|
|
807
|
+
if (Et(e), lt(e), v(e, "session").remove(y(e, T)), Ce(e), e.events.emit("loggedOut", {}), !t) try {
|
|
808
|
+
let { methodresult: t, logoutUrl: n } = await St(e);
|
|
747
809
|
if (t === "ok") return n;
|
|
748
810
|
_(e).error("logout failed");
|
|
749
811
|
} catch (t) {
|
|
750
812
|
_(e).error("logout failed", t);
|
|
751
813
|
}
|
|
752
814
|
}
|
|
753
|
-
async function
|
|
754
|
-
return
|
|
815
|
+
async function Tt() {
|
|
816
|
+
return wt(g);
|
|
755
817
|
}
|
|
756
|
-
function
|
|
757
|
-
v(e, "local").remove(y(e,
|
|
818
|
+
function Et(e) {
|
|
819
|
+
v(e, "local").remove(y(e, w.legacyCsrfToken)), v(e, "session").remove(y(e, w.credentials)), ut(e, !1), S(e, !1);
|
|
758
820
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
821
|
+
function Dt() {
|
|
822
|
+
Et(g);
|
|
761
823
|
}
|
|
762
824
|
//#endregion
|
|
763
825
|
//#region src/authentication/session/redirect-guard.ts
|
|
764
|
-
function
|
|
765
|
-
return v(e, "session").get(y(e,
|
|
826
|
+
function Ot(e) {
|
|
827
|
+
return v(e, "session").get(y(e, T)) !== null;
|
|
766
828
|
}
|
|
767
|
-
var
|
|
829
|
+
var kt = () => Ot(g), At = (e) => !!E(e) || dt(e), jt = () => At(g);
|
|
768
830
|
//#endregion
|
|
769
831
|
//#region src/web-api/helpers/methods/del.ts
|
|
770
|
-
async function
|
|
771
|
-
let i =
|
|
772
|
-
r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o =
|
|
832
|
+
async function z(e, t, n, r) {
|
|
833
|
+
let i = D(e, r?.headers), a = O(e, t, n), o;
|
|
834
|
+
r?.body && (i.has("Content-Type") || i.set("Content-Type", "application/json"), o = F(e, r.body, r)), _(e).debug(`Making DELETE request to: ${a}`);
|
|
773
835
|
try {
|
|
774
|
-
return await
|
|
836
|
+
return await P(e, a, {
|
|
775
837
|
method: "DELETE",
|
|
776
838
|
headers: i,
|
|
777
839
|
body: o
|
|
@@ -780,63 +842,63 @@ async function L(e, t, n, r) {
|
|
|
780
842
|
throw _(e).error("Error making DELETE request:", t), t;
|
|
781
843
|
}
|
|
782
844
|
}
|
|
783
|
-
async function
|
|
784
|
-
return
|
|
845
|
+
async function Mt(e, t, n) {
|
|
846
|
+
return z(g, e, t, n);
|
|
785
847
|
}
|
|
786
848
|
//#endregion
|
|
787
849
|
//#region src/web-api/helpers/methods/patch.ts
|
|
788
|
-
async function
|
|
789
|
-
let i =
|
|
850
|
+
async function B(e, t, n, r) {
|
|
851
|
+
let i = D(e, r?.headers);
|
|
790
852
|
i.append("content-type", "application/json");
|
|
791
|
-
let a =
|
|
853
|
+
let a = O(e, t);
|
|
792
854
|
_(e).debug(`Making PATCH request to: ${a}`);
|
|
793
855
|
try {
|
|
794
|
-
return await
|
|
856
|
+
return await P(e, a, {
|
|
795
857
|
method: "PATCH",
|
|
796
858
|
headers: i,
|
|
797
|
-
body:
|
|
859
|
+
body: F(e, n, r)
|
|
798
860
|
}, r);
|
|
799
861
|
} catch (t) {
|
|
800
862
|
throw _(e).error("Error making PATCH request:", t), t;
|
|
801
863
|
}
|
|
802
864
|
}
|
|
803
|
-
async function
|
|
804
|
-
return
|
|
865
|
+
async function Nt(e, t, n) {
|
|
866
|
+
return B(g, e, t, n);
|
|
805
867
|
}
|
|
806
868
|
//#endregion
|
|
807
869
|
//#region src/web-api/helpers/methods/put.ts
|
|
808
|
-
async function
|
|
809
|
-
let i =
|
|
870
|
+
async function V(e, t, n, r) {
|
|
871
|
+
let i = D(e, r?.headers);
|
|
810
872
|
i.has("Content-Type") || i.set("Content-Type", "application/json");
|
|
811
|
-
let a =
|
|
873
|
+
let a = O(e, t);
|
|
812
874
|
_(e).debug(`Making PUT request to: ${a}`);
|
|
813
875
|
try {
|
|
814
|
-
return await
|
|
876
|
+
return await P(e, a, {
|
|
815
877
|
method: "PUT",
|
|
816
878
|
headers: i,
|
|
817
|
-
body:
|
|
879
|
+
body: F(e, n, r)
|
|
818
880
|
}, r);
|
|
819
881
|
} catch (t) {
|
|
820
882
|
throw _(e).error("Error making PUT request:", t), t;
|
|
821
883
|
}
|
|
822
884
|
}
|
|
823
|
-
async function
|
|
824
|
-
return
|
|
885
|
+
async function Pt(e, t, n) {
|
|
886
|
+
return V(g, e, t, n);
|
|
825
887
|
}
|
|
826
888
|
//#endregion
|
|
827
889
|
//#region src/web-api/v1/fetch-app.ts
|
|
828
|
-
async function
|
|
890
|
+
async function Ft(e, t = g) {
|
|
829
891
|
let n = e || t.config.app;
|
|
830
|
-
return
|
|
892
|
+
return R(t, "api/v1/app", new URLSearchParams({ app: n || "" }));
|
|
831
893
|
}
|
|
832
|
-
async function
|
|
894
|
+
async function It(e = g) {
|
|
833
895
|
let { app: t } = e.config;
|
|
834
|
-
return
|
|
896
|
+
return R(e, "api/v1/app", new URLSearchParams({
|
|
835
897
|
app: t || "",
|
|
836
898
|
preLogin: "true"
|
|
837
899
|
}));
|
|
838
900
|
}
|
|
839
|
-
function
|
|
901
|
+
function Lt(e = g) {
|
|
840
902
|
let { backendUrl: t, app: n } = e.config;
|
|
841
903
|
if (typeof window < "u") {
|
|
842
904
|
if (t ||= window.location.origin, !n) {
|
|
@@ -853,33 +915,33 @@ function At(e = g) {
|
|
|
853
915
|
autoOAuthProvider: void 0,
|
|
854
916
|
autoSAMLProvider: void 0,
|
|
855
917
|
bearerToken: void 0
|
|
856
|
-
}), Promise.resolve({})) :
|
|
857
|
-
authMode:
|
|
918
|
+
}), Promise.resolve({})) : It(e).then((t) => (b(e, {
|
|
919
|
+
authMode: Je(e.config, t),
|
|
858
920
|
autoOAuthProvider: e.config.autoOAuthProvider || t.autoOAuthProvider,
|
|
859
921
|
autoSAMLProvider: e.config.autoSAMLProvider || t.autoSAMLProvider
|
|
860
922
|
}), t)).catch((t) => {
|
|
861
923
|
throw _(e).error("atomic:fetchAppPreLogin error", t), t;
|
|
862
924
|
});
|
|
863
925
|
}
|
|
864
|
-
var
|
|
865
|
-
function
|
|
926
|
+
var Rt = Lt, zt = 10;
|
|
927
|
+
function Bt(e, t) {
|
|
866
928
|
let n = t?.aggregations;
|
|
867
929
|
if (!n || Array.isArray(n)) return;
|
|
868
930
|
let r = n[e]?.count;
|
|
869
931
|
return typeof r == "number" ? r : void 0;
|
|
870
932
|
}
|
|
871
|
-
function
|
|
872
|
-
let r =
|
|
933
|
+
function Vt(e, t, n) {
|
|
934
|
+
let r = Bt(e, t);
|
|
873
935
|
if (r !== void 0) return r;
|
|
874
936
|
let i = n?.[e];
|
|
875
937
|
return typeof i == "number" ? i : 10;
|
|
876
938
|
}
|
|
877
|
-
function
|
|
939
|
+
function Ht(e, t) {
|
|
878
940
|
return e.isDistribution || e.isTree || !e.items ? !1 : e.items.length > t;
|
|
879
941
|
}
|
|
880
942
|
//#endregion
|
|
881
943
|
//#region src/helpers/column-resolver.ts
|
|
882
|
-
function
|
|
944
|
+
function Ut(e, t, n) {
|
|
883
945
|
if (!e || !t) return;
|
|
884
946
|
if (n) {
|
|
885
947
|
let r = Object.keys(t.queries).find((e) => e === n?.toLowerCase()), i;
|
|
@@ -894,93 +956,93 @@ function It(e, t, n) {
|
|
|
894
956
|
}
|
|
895
957
|
//#endregion
|
|
896
958
|
//#region src/types/audit/AuditEventType.ts
|
|
897
|
-
var
|
|
959
|
+
var H = /* @__PURE__ */ function(e) {
|
|
898
960
|
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;
|
|
899
|
-
}({}),
|
|
961
|
+
}({}), U = /* @__PURE__ */ function(e) {
|
|
900
962
|
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;
|
|
901
|
-
}({}),
|
|
963
|
+
}({}), W = /* @__PURE__ */ function(e) {
|
|
902
964
|
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;
|
|
903
|
-
}({}),
|
|
965
|
+
}({}), Wt = "1.0", Gt = /* @__PURE__ */ function(e) {
|
|
904
966
|
return e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e;
|
|
905
|
-
}({}),
|
|
967
|
+
}({}), Kt = /* @__PURE__ */ function(e) {
|
|
906
968
|
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;
|
|
907
969
|
}({});
|
|
908
970
|
//#endregion
|
|
909
971
|
//#region src/helpers/columns.ts
|
|
910
|
-
function
|
|
911
|
-
if (!e) return
|
|
972
|
+
function qt(e) {
|
|
973
|
+
if (!e) return U.none;
|
|
912
974
|
switch (e.toLocaleLowerCase()) {
|
|
913
975
|
case "bool":
|
|
914
|
-
case "boolean": return
|
|
915
|
-
case "date": return
|
|
916
|
-
case "datetime": return
|
|
917
|
-
case "time": return
|
|
918
|
-
case "unsigned": return
|
|
919
|
-
case "integer": return
|
|
920
|
-
case "float": return
|
|
921
|
-
case "double": return
|
|
922
|
-
case "dates": return
|
|
923
|
-
case "datetimes": return
|
|
924
|
-
case "times": return
|
|
925
|
-
case "varchar": return
|
|
926
|
-
case "binary": return
|
|
927
|
-
case "string": return
|
|
928
|
-
case "csv": return
|
|
929
|
-
default: return
|
|
976
|
+
case "boolean": return U.bool;
|
|
977
|
+
case "date": return U.date;
|
|
978
|
+
case "datetime": return U.dateTime;
|
|
979
|
+
case "time": return U.time;
|
|
980
|
+
case "unsigned": return U.unsigned;
|
|
981
|
+
case "integer": return U.integer;
|
|
982
|
+
case "float": return U.float;
|
|
983
|
+
case "double": return U.double;
|
|
984
|
+
case "dates": return U.dates;
|
|
985
|
+
case "datetimes": return U.dateTimes;
|
|
986
|
+
case "times": return U.times;
|
|
987
|
+
case "varchar": return U.varchar;
|
|
988
|
+
case "binary": return U.binary;
|
|
989
|
+
case "string": return U.string;
|
|
990
|
+
case "csv": return U.csv;
|
|
991
|
+
default: return U.none;
|
|
930
992
|
}
|
|
931
993
|
}
|
|
932
|
-
function
|
|
994
|
+
function Jt(e) {
|
|
933
995
|
switch (e) {
|
|
934
|
-
case "a": return
|
|
935
|
-
case "c": return
|
|
936
|
-
case "d": return
|
|
937
|
-
case "e": return
|
|
938
|
-
case "i": return
|
|
939
|
-
case "l": return
|
|
940
|
-
case "n": return
|
|
941
|
-
case "t": return
|
|
942
|
-
case "x": return
|
|
943
|
-
case "z": return
|
|
944
|
-
default: return
|
|
996
|
+
case "a": return W.a;
|
|
997
|
+
case "c": return W.c;
|
|
998
|
+
case "d": return W.d;
|
|
999
|
+
case "e": return W.e;
|
|
1000
|
+
case "i": return W.i;
|
|
1001
|
+
case "l": return W.l;
|
|
1002
|
+
case "n": return W.n;
|
|
1003
|
+
case "t": return W.t;
|
|
1004
|
+
case "x": return W.x;
|
|
1005
|
+
case "z": return W.z;
|
|
1006
|
+
default: return W.none;
|
|
945
1007
|
}
|
|
946
1008
|
}
|
|
947
|
-
function
|
|
948
|
-
let t =
|
|
949
|
-
if (e) for (let n of e) t |=
|
|
1009
|
+
function Yt(e) {
|
|
1010
|
+
let t = W.none;
|
|
1011
|
+
if (e) for (let n of e) t |= Jt(n);
|
|
950
1012
|
return t;
|
|
951
1013
|
}
|
|
952
|
-
function
|
|
1014
|
+
function G(e, t, n, r) {
|
|
953
1015
|
return {
|
|
954
1016
|
name: e,
|
|
955
1017
|
type: t,
|
|
956
1018
|
typeModifier: n,
|
|
957
|
-
eType:
|
|
958
|
-
eTypeModifier:
|
|
1019
|
+
eType: qt(t),
|
|
1020
|
+
eTypeModifier: Yt(n || ""),
|
|
959
1021
|
aliases: r
|
|
960
1022
|
};
|
|
961
1023
|
}
|
|
962
|
-
var
|
|
963
|
-
id:
|
|
964
|
-
text:
|
|
965
|
-
documentlanguages:
|
|
966
|
-
databasealias:
|
|
967
|
-
globalrelevance:
|
|
968
|
-
matchingpartnames:
|
|
969
|
-
matchlocations:
|
|
970
|
-
matchlocationsperpartname:
|
|
971
|
-
extracts:
|
|
972
|
-
extractsperpartname:
|
|
973
|
-
extractslocations:
|
|
974
|
-
documentweight:
|
|
975
|
-
groupcount:
|
|
976
|
-
accesslists:
|
|
1024
|
+
var Xt = {
|
|
1025
|
+
id: G("id", "string"),
|
|
1026
|
+
text: G("text", "varchar"),
|
|
1027
|
+
documentlanguages: G("documentlanguages", "csv", "ci", ["language"]),
|
|
1028
|
+
databasealias: G("databasealias", "varchar"),
|
|
1029
|
+
globalrelevance: G("globalrelevance", "double"),
|
|
1030
|
+
matchingpartnames: G("matchingpartnames", "csv"),
|
|
1031
|
+
matchlocations: G("matchlocations", "csv"),
|
|
1032
|
+
matchlocationsperpartname: G("matchlocationsperpartname", "varchar"),
|
|
1033
|
+
extracts: G("extracts", "csv"),
|
|
1034
|
+
extractsperpartname: G("extractsperpartname", "varchar"),
|
|
1035
|
+
extractslocations: G("extractslocations", "csv"),
|
|
1036
|
+
documentweight: G("documentweight", "varchar"),
|
|
1037
|
+
groupcount: G("groupcount", "integer"),
|
|
1038
|
+
accesslists: G("accesslists", "varchar", void 0, ["accessLists"])
|
|
977
1039
|
};
|
|
978
1040
|
//#endregion
|
|
979
1041
|
//#region src/helpers/filters.ts
|
|
980
|
-
function
|
|
1042
|
+
function Zt(e) {
|
|
981
1043
|
return e.filter((e) => !!e);
|
|
982
1044
|
}
|
|
983
|
-
var
|
|
1045
|
+
var K = {
|
|
984
1046
|
eq: (e, t) => ({
|
|
985
1047
|
field: e,
|
|
986
1048
|
operator: "eq",
|
|
@@ -1051,44 +1113,44 @@ var W = {
|
|
|
1051
1113
|
if (!n) return;
|
|
1052
1114
|
let r = n.split(" AND ").map((e) => e.trim()).filter(Boolean).map((t) => {
|
|
1053
1115
|
let n = t.substring(t.search(/\s/) + 1).trim();
|
|
1054
|
-
return t.startsWith(">=") ?
|
|
1116
|
+
return t.startsWith(">=") ? K.gte(e, n) : t.startsWith(">") ? K.gt(e, n) : t.startsWith("<=") ? K.lte(e, n) : K.lt(e, n);
|
|
1055
1117
|
});
|
|
1056
|
-
return
|
|
1118
|
+
return K.and(...r);
|
|
1057
1119
|
},
|
|
1058
|
-
and: (...e) =>
|
|
1059
|
-
or: (...e) =>
|
|
1120
|
+
and: (...e) => Qt("and", e),
|
|
1121
|
+
or: (...e) => Qt("or", e),
|
|
1060
1122
|
not: (...e) => {
|
|
1061
|
-
let t =
|
|
1123
|
+
let t = Zt(e);
|
|
1062
1124
|
return t.length ? {
|
|
1063
1125
|
operator: "not",
|
|
1064
1126
|
filters: t
|
|
1065
1127
|
} : void 0;
|
|
1066
1128
|
}
|
|
1067
1129
|
};
|
|
1068
|
-
function
|
|
1069
|
-
let n =
|
|
1130
|
+
function Qt(e, t) {
|
|
1131
|
+
let n = Zt(t);
|
|
1070
1132
|
if (n.length !== 0) return n.length === 1 ? n[0] : {
|
|
1071
1133
|
operator: e,
|
|
1072
1134
|
filters: n
|
|
1073
1135
|
};
|
|
1074
1136
|
}
|
|
1075
|
-
function
|
|
1137
|
+
function $t(e) {
|
|
1076
1138
|
if (!e) return;
|
|
1077
1139
|
let { operator: t, field: n } = e;
|
|
1078
1140
|
switch (t) {
|
|
1079
1141
|
case "and":
|
|
1080
1142
|
case "or": {
|
|
1081
|
-
let n = (e.filters ?? []).map((e) =>
|
|
1082
|
-
return t === "and" ?
|
|
1143
|
+
let n = (e.filters ?? []).map((e) => $t(e));
|
|
1144
|
+
return t === "and" ? K.and(...n) : K.or(...n);
|
|
1083
1145
|
}
|
|
1084
1146
|
case "not": {
|
|
1085
|
-
let t = (e.filters ?? []).map((e) =>
|
|
1086
|
-
return
|
|
1147
|
+
let t = (e.filters ?? []).map((e) => $t(e));
|
|
1148
|
+
return K.not(...t);
|
|
1087
1149
|
}
|
|
1088
|
-
case "in": return n && e.values?.length ?
|
|
1089
|
-
case "between": return n && e.start !== void 0 && e.end !== void 0 ?
|
|
1090
|
-
case "null": return n ?
|
|
1091
|
-
case "notnull": return n ?
|
|
1150
|
+
case "in": return n && e.values?.length ? K.in(n, e.values) : void 0;
|
|
1151
|
+
case "between": return n && e.start !== void 0 && e.end !== void 0 ? K.between(n, e.start, e.end) : void 0;
|
|
1152
|
+
case "null": return n ? K.isNull(n) : void 0;
|
|
1153
|
+
case "notnull": return n ? K.isNotNull(n) : void 0;
|
|
1092
1154
|
case "eq":
|
|
1093
1155
|
case "neq":
|
|
1094
1156
|
case "gt":
|
|
@@ -1097,12 +1159,12 @@ function Kt(e) {
|
|
|
1097
1159
|
case "lte":
|
|
1098
1160
|
case "like":
|
|
1099
1161
|
case "contains":
|
|
1100
|
-
case "regex": return n && e.value !== void 0 ?
|
|
1101
|
-
case void 0: return n && e.value !== void 0 ?
|
|
1162
|
+
case "regex": return n && e.value !== void 0 ? K[t](n, e.value) : void 0;
|
|
1163
|
+
case void 0: return n && e.value !== void 0 ? K.eq(n, e.value) : void 0;
|
|
1102
1164
|
default: return;
|
|
1103
1165
|
}
|
|
1104
1166
|
}
|
|
1105
|
-
function
|
|
1167
|
+
function en(e) {
|
|
1106
1168
|
let t = [];
|
|
1107
1169
|
function n(e) {
|
|
1108
1170
|
for (let r of e) r.value ? (t.push(r.value), r.display && t.push(r.display)) : r.values && t.push(...r.values), r.filters && n(r.filters);
|
|
@@ -1111,14 +1173,14 @@ function qt(e) {
|
|
|
1111
1173
|
}
|
|
1112
1174
|
//#endregion
|
|
1113
1175
|
//#region src/helpers/metadata.ts
|
|
1114
|
-
function
|
|
1176
|
+
function tn(e, t) {
|
|
1115
1177
|
let n = e[t];
|
|
1116
1178
|
return n === void 0 ? [] : (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n) ? n.map((e) => {
|
|
1117
1179
|
if (typeof e == "string") return e.trim();
|
|
1118
1180
|
if (typeof e == "object" && e && "display" in e) return e.display.trim();
|
|
1119
1181
|
}).filter((e) => e !== void 0) : [String(n).trim()]);
|
|
1120
1182
|
}
|
|
1121
|
-
function
|
|
1183
|
+
function nn(e, t) {
|
|
1122
1184
|
let n = e[t];
|
|
1123
1185
|
if (n === void 0) return [];
|
|
1124
1186
|
if (typeof n == "string" && (n = String(n).split(",")), Array.isArray(n)) return n.map((e) => {
|
|
@@ -1142,7 +1204,7 @@ function Yt(e, t) {
|
|
|
1142
1204
|
}
|
|
1143
1205
|
//#endregion
|
|
1144
1206
|
//#region src/helpers/pagination.ts
|
|
1145
|
-
function
|
|
1207
|
+
function rn(e) {
|
|
1146
1208
|
let { page: t, pageSize: n, rowCount: r } = e;
|
|
1147
1209
|
return t === void 0 || !n || r === void 0 ? {
|
|
1148
1210
|
nextPage: void 0,
|
|
@@ -1154,35 +1216,35 @@ function Xt(e) {
|
|
|
1154
1216
|
}
|
|
1155
1217
|
//#endregion
|
|
1156
1218
|
//#region src/helpers/utils.ts
|
|
1157
|
-
function
|
|
1219
|
+
function q(e) {
|
|
1158
1220
|
return typeof e == "object" && !!e;
|
|
1159
1221
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1222
|
+
function an(e) {
|
|
1223
|
+
return q(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
1162
1224
|
}
|
|
1163
|
-
function
|
|
1164
|
-
return
|
|
1225
|
+
function on(e) {
|
|
1226
|
+
return q(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
1165
1227
|
}
|
|
1166
|
-
function
|
|
1228
|
+
function sn(e) {
|
|
1167
1229
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
1168
1230
|
}
|
|
1169
|
-
function
|
|
1231
|
+
function cn(e) {
|
|
1170
1232
|
return typeof e == "string";
|
|
1171
1233
|
}
|
|
1172
|
-
function
|
|
1173
|
-
return (
|
|
1234
|
+
function ln(e) {
|
|
1235
|
+
return (q(e) || Array.isArray(e)) && !an(e) && !on(e) && !cn(e);
|
|
1174
1236
|
}
|
|
1175
|
-
function
|
|
1237
|
+
function un(e) {
|
|
1176
1238
|
return e ? (e.getHours() * 60 * 60 + e.getMinutes() * 60 + e.getSeconds()) * 1e3 + e.getMilliseconds() : 0;
|
|
1177
1239
|
}
|
|
1178
|
-
function
|
|
1240
|
+
function dn(e = !0) {
|
|
1179
1241
|
let t = Date.now();
|
|
1180
1242
|
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (e) => {
|
|
1181
1243
|
let n = (t + Math.random() * 16) % 16 | 0;
|
|
1182
1244
|
return t = Math.floor(t / 16), (e === "x" ? n : n & 3 | 8).toString(16);
|
|
1183
1245
|
});
|
|
1184
1246
|
}
|
|
1185
|
-
function
|
|
1247
|
+
function fn(e) {
|
|
1186
1248
|
if (!e) return "``";
|
|
1187
1249
|
if (e = String(e), e.search(/[\\`]/) === -1) return `\`${e}\``;
|
|
1188
1250
|
let t = ["`"];
|
|
@@ -1192,13 +1254,13 @@ function an(e) {
|
|
|
1192
1254
|
}
|
|
1193
1255
|
return t.push("`"), t.join("");
|
|
1194
1256
|
}
|
|
1195
|
-
async function
|
|
1257
|
+
async function pn(e) {
|
|
1196
1258
|
let t = globalThis.crypto?.subtle;
|
|
1197
1259
|
if (typeof t?.digest != "function") throw Error("sha512 requires the Web Crypto API, and `crypto.subtle` is unavailable here. That usually means an insecure context: it is exposed over HTTPS and on localhost, but not over plain HTTP. Serve the application over HTTPS.");
|
|
1198
1260
|
let n = await t.digest("SHA-512", new TextEncoder().encode(e));
|
|
1199
1261
|
return Array.from(new Uint8Array(n), (e) => e.toString(16).padStart(2, "0")).join("");
|
|
1200
1262
|
}
|
|
1201
|
-
function
|
|
1263
|
+
function mn(e, t = 0) {
|
|
1202
1264
|
let n = 3735928559 ^ t, r = 1103547991 ^ t;
|
|
1203
1265
|
for (let t = 0; t < e.length; t++) {
|
|
1204
1266
|
let i = e.charCodeAt(t);
|
|
@@ -1208,52 +1270,52 @@ function sn(e, t = 0) {
|
|
|
1208
1270
|
}
|
|
1209
1271
|
//#endregion
|
|
1210
1272
|
//#region src/web-api/v1/fetch-audit.ts
|
|
1211
|
-
var
|
|
1212
|
-
function
|
|
1213
|
-
let n =
|
|
1214
|
-
n && (
|
|
1273
|
+
var hn, gn;
|
|
1274
|
+
function J(e, t = !0) {
|
|
1275
|
+
let n = _n(e.$auditRecord);
|
|
1276
|
+
n && (vn(n), t && yn(n)), e.$auditRecord = n;
|
|
1215
1277
|
}
|
|
1216
|
-
function
|
|
1278
|
+
function _n(e) {
|
|
1217
1279
|
if (!e) return;
|
|
1218
1280
|
let t;
|
|
1219
1281
|
if (Array.isArray(e)) t = e;
|
|
1220
|
-
else if (
|
|
1282
|
+
else if (q(e)) {
|
|
1221
1283
|
let n = e;
|
|
1222
1284
|
if (n.auditEvents || n.mlAuditEvents) return n;
|
|
1223
1285
|
t = [e];
|
|
1224
1286
|
}
|
|
1225
1287
|
return { auditEvents: t };
|
|
1226
1288
|
}
|
|
1227
|
-
function
|
|
1228
|
-
let t =
|
|
1289
|
+
function vn(e) {
|
|
1290
|
+
let t = bn();
|
|
1229
1291
|
return e.auditEvents?.forEach((e) => {
|
|
1230
1292
|
e.detail ||= {}, e.detail.sessionid = t;
|
|
1231
1293
|
}), e;
|
|
1232
1294
|
}
|
|
1233
|
-
function
|
|
1295
|
+
function yn(e) {
|
|
1234
1296
|
let t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
1235
1297
|
return e?.auditEvents?.forEach((e) => {
|
|
1236
1298
|
e.detail ||= {}, e.detail.url = t;
|
|
1237
1299
|
}), e;
|
|
1238
1300
|
}
|
|
1239
|
-
function
|
|
1240
|
-
return (!
|
|
1301
|
+
function bn() {
|
|
1302
|
+
return (!hn || xn()) && (hn = dn()), gn = /* @__PURE__ */ new Date(), hn;
|
|
1241
1303
|
}
|
|
1242
|
-
function
|
|
1243
|
-
return Date.now() -
|
|
1304
|
+
function xn() {
|
|
1305
|
+
return Date.now() - gn.getTime() > 6e5;
|
|
1244
1306
|
}
|
|
1245
|
-
async function
|
|
1307
|
+
async function Sn(e, t = !0, n = g) {
|
|
1246
1308
|
let r = {
|
|
1247
|
-
event:
|
|
1309
|
+
event: H.None,
|
|
1248
1310
|
$auditRecord: e
|
|
1249
1311
|
};
|
|
1250
|
-
return
|
|
1312
|
+
return J(r, t), I(n, "api/v1/audit.notify", r, { noRecovery: !0 });
|
|
1251
1313
|
}
|
|
1252
|
-
var
|
|
1314
|
+
var Cn = { notify: Sn };
|
|
1253
1315
|
//#endregion
|
|
1254
1316
|
//#region src/web-api/v1/fetch-aggregation.ts
|
|
1255
|
-
async function
|
|
1256
|
-
let a = r ??
|
|
1317
|
+
async function wn(e, t, n, r, i = g) {
|
|
1318
|
+
let a = r ?? Vt(e.name, t, i.config.aggregationCounts), o = e.items?.length || 0, s = {
|
|
1257
1319
|
query: {
|
|
1258
1320
|
...t,
|
|
1259
1321
|
action: "aggregate",
|
|
@@ -1264,32 +1326,32 @@ async function _n(e, t, n, r, i = g) {
|
|
|
1264
1326
|
},
|
|
1265
1327
|
...n ? { $auditRecord: { auditEvents: [n] } } : {}
|
|
1266
1328
|
};
|
|
1267
|
-
|
|
1268
|
-
let c = (await
|
|
1269
|
-
return c.$hasMore =
|
|
1329
|
+
J(s);
|
|
1330
|
+
let c = (await I(i, "api/v1/query", s)).aggregations[0];
|
|
1331
|
+
return c.$hasMore = Ht(c, a), c.items = [...e.items ?? [], ...c.items ?? []], Promise.resolve(c);
|
|
1270
1332
|
}
|
|
1271
1333
|
//#endregion
|
|
1272
1334
|
//#region src/web-api/v1/fetch-dataset.ts
|
|
1273
|
-
async function
|
|
1274
|
-
let i = await
|
|
1335
|
+
async function Tn(e, t, n = {}, r = g) {
|
|
1336
|
+
let i = await I(r, `api/v1/search.dataset/${e}/${t}`, { parameters: n }), a = t[0].toLowerCase() + t.slice(1), o = i.datasets[a];
|
|
1275
1337
|
if ("errorCode" in o && "errorMessage" in o) throw Error(o.errorMessage);
|
|
1276
1338
|
return o;
|
|
1277
1339
|
}
|
|
1278
|
-
async function
|
|
1340
|
+
async function En(e, t, n = g) {
|
|
1279
1341
|
let r = `api/v1/search.dataset/${e}`, { parameters: i = {}, datasets: a = [] } = t;
|
|
1280
|
-
return (await
|
|
1342
|
+
return (await I(n, r, {
|
|
1281
1343
|
parameters: i,
|
|
1282
1344
|
datasets: a
|
|
1283
1345
|
})).datasets;
|
|
1284
1346
|
}
|
|
1285
|
-
async function
|
|
1286
|
-
return await
|
|
1347
|
+
async function Dn(e, t = g) {
|
|
1348
|
+
return await R(t, `api/v1/search.dataset/${e}`);
|
|
1287
1349
|
}
|
|
1288
1350
|
//#endregion
|
|
1289
1351
|
//#region src/web-api/v1/fetch-labels.ts
|
|
1290
|
-
async function
|
|
1352
|
+
async function On(e, t = !0, n, r = g) {
|
|
1291
1353
|
try {
|
|
1292
|
-
return (await
|
|
1354
|
+
return (await I(r, "api/v1/labels", {
|
|
1293
1355
|
action: "list",
|
|
1294
1356
|
q: e,
|
|
1295
1357
|
public: t,
|
|
@@ -1300,10 +1362,10 @@ async function xn(e, t = !0, n, r = g) {
|
|
|
1300
1362
|
throw l("Error in fetchLabels", e), e;
|
|
1301
1363
|
}
|
|
1302
1364
|
}
|
|
1303
|
-
async function
|
|
1365
|
+
async function kn(e = g) {
|
|
1304
1366
|
try {
|
|
1305
1367
|
let { app: t = "" } = e.config;
|
|
1306
|
-
return await
|
|
1368
|
+
return await R(e, "api/v1/labels", new URLSearchParams({
|
|
1307
1369
|
app: t,
|
|
1308
1370
|
action: "getUserRights"
|
|
1309
1371
|
}));
|
|
@@ -1311,7 +1373,7 @@ async function Sn(e = g) {
|
|
|
1311
1373
|
throw l("Error in getUserRights", e), e;
|
|
1312
1374
|
}
|
|
1313
1375
|
}
|
|
1314
|
-
async function
|
|
1376
|
+
async function An(e, t, n = !0, r = g) {
|
|
1315
1377
|
try {
|
|
1316
1378
|
let i = {
|
|
1317
1379
|
action: "add",
|
|
@@ -1320,7 +1382,7 @@ async function Cn(e, t, n = !0, r = g) {
|
|
|
1320
1382
|
public: n,
|
|
1321
1383
|
$auditRecord: {
|
|
1322
1384
|
auditEvents: [{
|
|
1323
|
-
type:
|
|
1385
|
+
type: H.Label_AddDoc,
|
|
1324
1386
|
detail: {
|
|
1325
1387
|
public: n,
|
|
1326
1388
|
label: e ? e.toString() : null,
|
|
@@ -1333,12 +1395,12 @@ async function Cn(e, t, n = !0, r = g) {
|
|
|
1333
1395
|
}]
|
|
1334
1396
|
}
|
|
1335
1397
|
};
|
|
1336
|
-
return
|
|
1398
|
+
return J(i), await I(r, "api/v1/labels", i);
|
|
1337
1399
|
} catch (e) {
|
|
1338
1400
|
throw l("Error in add", e), e;
|
|
1339
1401
|
}
|
|
1340
1402
|
}
|
|
1341
|
-
async function
|
|
1403
|
+
async function jn(e, t, n = !0, r = g) {
|
|
1342
1404
|
try {
|
|
1343
1405
|
let i = {
|
|
1344
1406
|
action: "remove",
|
|
@@ -1347,7 +1409,7 @@ async function wn(e, t, n = !0, r = g) {
|
|
|
1347
1409
|
public: n,
|
|
1348
1410
|
$auditRecord: {
|
|
1349
1411
|
auditEvents: [{
|
|
1350
|
-
type:
|
|
1412
|
+
type: H.Label_RemoveDoc,
|
|
1351
1413
|
detail: {
|
|
1352
1414
|
public: n,
|
|
1353
1415
|
label: e ? e.toString() : null,
|
|
@@ -1360,12 +1422,12 @@ async function wn(e, t, n = !0, r = g) {
|
|
|
1360
1422
|
}]
|
|
1361
1423
|
}
|
|
1362
1424
|
};
|
|
1363
|
-
return
|
|
1425
|
+
return J(i), await I(r, "api/v1/labels", i);
|
|
1364
1426
|
} catch (e) {
|
|
1365
1427
|
throw l("Error in remove", e), e;
|
|
1366
1428
|
}
|
|
1367
1429
|
}
|
|
1368
|
-
async function
|
|
1430
|
+
async function Mn(e, t, n = !0, r = g) {
|
|
1369
1431
|
try {
|
|
1370
1432
|
let i = {
|
|
1371
1433
|
action: "rename",
|
|
@@ -1373,7 +1435,7 @@ async function Tn(e, t, n = !0, r = g) {
|
|
|
1373
1435
|
newLabel: t,
|
|
1374
1436
|
public: n,
|
|
1375
1437
|
$auditRecord: { auditEvents: [{
|
|
1376
|
-
type:
|
|
1438
|
+
type: H.Label_Rename,
|
|
1377
1439
|
detail: {
|
|
1378
1440
|
public: n,
|
|
1379
1441
|
oldlabel: e ? e.toString() : null,
|
|
@@ -1381,31 +1443,31 @@ async function Tn(e, t, n = !0, r = g) {
|
|
|
1381
1443
|
}
|
|
1382
1444
|
}] }
|
|
1383
1445
|
};
|
|
1384
|
-
return
|
|
1446
|
+
return J(i), await I(r, "api/v1/labels", i);
|
|
1385
1447
|
} catch (e) {
|
|
1386
1448
|
throw l("Error in rename", e), e;
|
|
1387
1449
|
}
|
|
1388
1450
|
}
|
|
1389
|
-
async function
|
|
1451
|
+
async function Nn(e, t = !0, n = g) {
|
|
1390
1452
|
try {
|
|
1391
1453
|
let r = {
|
|
1392
1454
|
action: "delete",
|
|
1393
1455
|
labels: e,
|
|
1394
1456
|
public: t,
|
|
1395
1457
|
$auditRecord: { auditEvents: [{
|
|
1396
|
-
type:
|
|
1458
|
+
type: H.Label_Delete,
|
|
1397
1459
|
detail: {
|
|
1398
1460
|
public: t,
|
|
1399
1461
|
label: e ? e.toString() : null
|
|
1400
1462
|
}
|
|
1401
1463
|
}] }
|
|
1402
1464
|
};
|
|
1403
|
-
return
|
|
1465
|
+
return J(r), await I(n, "api/v1/labels", r);
|
|
1404
1466
|
} catch (e) {
|
|
1405
1467
|
throw l("Error in deleteLabels", e), e;
|
|
1406
1468
|
}
|
|
1407
1469
|
}
|
|
1408
|
-
async function
|
|
1470
|
+
async function Pn(e, t, n = !0, r = g) {
|
|
1409
1471
|
try {
|
|
1410
1472
|
let i = {
|
|
1411
1473
|
action: "bulkAdd",
|
|
@@ -1413,7 +1475,7 @@ async function Dn(e, t, n = !0, r = g) {
|
|
|
1413
1475
|
query: t,
|
|
1414
1476
|
public: n,
|
|
1415
1477
|
$auditRecord: { auditEvents: [{
|
|
1416
|
-
type:
|
|
1478
|
+
type: H.Label_Add,
|
|
1417
1479
|
detail: {
|
|
1418
1480
|
public: n,
|
|
1419
1481
|
label: e ? e.toString() : null,
|
|
@@ -1421,12 +1483,12 @@ async function Dn(e, t, n = !0, r = g) {
|
|
|
1421
1483
|
}
|
|
1422
1484
|
}] }
|
|
1423
1485
|
};
|
|
1424
|
-
return
|
|
1486
|
+
return J(i), await I(r, "api/v1/labels", i);
|
|
1425
1487
|
} catch (e) {
|
|
1426
1488
|
throw l("Error in bulkAdd", e), e;
|
|
1427
1489
|
}
|
|
1428
1490
|
}
|
|
1429
|
-
async function
|
|
1491
|
+
async function Fn(e, t, n = !0, r = g) {
|
|
1430
1492
|
try {
|
|
1431
1493
|
let i = {
|
|
1432
1494
|
action: "bulkRemove",
|
|
@@ -1434,7 +1496,7 @@ async function On(e, t, n = !0, r = g) {
|
|
|
1434
1496
|
query: t,
|
|
1435
1497
|
public: n,
|
|
1436
1498
|
$auditRecord: { auditEvents: [{
|
|
1437
|
-
type:
|
|
1499
|
+
type: H.Label_Delete,
|
|
1438
1500
|
detail: {
|
|
1439
1501
|
public: n,
|
|
1440
1502
|
label: e ? e.toString() : null,
|
|
@@ -1442,30 +1504,30 @@ async function On(e, t, n = !0, r = g) {
|
|
|
1442
1504
|
}
|
|
1443
1505
|
}] }
|
|
1444
1506
|
};
|
|
1445
|
-
return
|
|
1507
|
+
return J(i), await I(r, "api/v1/labels", i);
|
|
1446
1508
|
} catch (e) {
|
|
1447
1509
|
throw l("Error in bulkRemove", e), e;
|
|
1448
1510
|
}
|
|
1449
1511
|
}
|
|
1450
|
-
var
|
|
1451
|
-
getUserRights:
|
|
1452
|
-
add:
|
|
1453
|
-
remove:
|
|
1454
|
-
rename:
|
|
1455
|
-
delete:
|
|
1456
|
-
bulkAdd:
|
|
1457
|
-
bulkRemove:
|
|
1512
|
+
var Y = {
|
|
1513
|
+
getUserRights: kn,
|
|
1514
|
+
add: An,
|
|
1515
|
+
remove: jn,
|
|
1516
|
+
rename: Mn,
|
|
1517
|
+
delete: Nn,
|
|
1518
|
+
bulkAdd: Pn,
|
|
1519
|
+
bulkRemove: Fn
|
|
1458
1520
|
};
|
|
1459
1521
|
//#endregion
|
|
1460
1522
|
//#region src/web-api/v1/fetch-preview.ts
|
|
1461
|
-
async function
|
|
1462
|
-
if (typeof window > "u") return
|
|
1523
|
+
async function In(e, t, n = g) {
|
|
1524
|
+
if (typeof window > "u") return I(n, "api/v1/preview", {
|
|
1463
1525
|
action: "get",
|
|
1464
1526
|
id: e,
|
|
1465
1527
|
query: t
|
|
1466
1528
|
});
|
|
1467
1529
|
let r = `${window.location.origin}${window.location.pathname}`;
|
|
1468
|
-
return
|
|
1530
|
+
return I(n, "api/v1/preview", {
|
|
1469
1531
|
action: "get",
|
|
1470
1532
|
id: e,
|
|
1471
1533
|
query: {
|
|
@@ -1475,66 +1537,66 @@ async function kn(e, t, n = g) {
|
|
|
1475
1537
|
browserUrl: r
|
|
1476
1538
|
});
|
|
1477
1539
|
}
|
|
1478
|
-
async function
|
|
1479
|
-
return
|
|
1540
|
+
async function Ln(e, t = g) {
|
|
1541
|
+
return P(t, /^[a-z][a-z0-9+.-]*:\/\//i.test(e) ? e : O(t, e.replace(/^\//, "")), {
|
|
1480
1542
|
method: "GET",
|
|
1481
|
-
headers:
|
|
1543
|
+
headers: D(t)
|
|
1482
1544
|
}, { responseType: "text" });
|
|
1483
1545
|
}
|
|
1484
1546
|
//#endregion
|
|
1485
1547
|
//#region src/web-api/v1/fetch-principal.ts
|
|
1486
|
-
async function
|
|
1487
|
-
return
|
|
1488
|
-
noAutoAuthentication:
|
|
1548
|
+
async function Rn(e, t = g) {
|
|
1549
|
+
return R(t, "api/v1/principal", new URLSearchParams({ action: "get" }), {
|
|
1550
|
+
noAutoAuthentication: N(t),
|
|
1489
1551
|
...e
|
|
1490
1552
|
});
|
|
1491
1553
|
}
|
|
1492
|
-
async function
|
|
1554
|
+
async function zn(e, t = g) {
|
|
1493
1555
|
let n = new URLSearchParams();
|
|
1494
1556
|
return Object.entries(e).forEach(([e, t]) => {
|
|
1495
1557
|
t !== void 0 && n.append(e, String(t));
|
|
1496
|
-
}),
|
|
1558
|
+
}), R(t, "api/v1/principal/list", n, { noAutoAuthentication: N(t) });
|
|
1497
1559
|
}
|
|
1498
|
-
async function
|
|
1499
|
-
return e ?
|
|
1560
|
+
async function Bn(e, t = g) {
|
|
1561
|
+
return e ? R(t, "api/v1/principal", new URLSearchParams({
|
|
1500
1562
|
action: "userid",
|
|
1501
1563
|
userid: e
|
|
1502
|
-
}), { noAutoAuthentication:
|
|
1564
|
+
}), { noAutoAuthentication: N(t) }) : Promise.reject(/* @__PURE__ */ Error("userid is required"));
|
|
1503
1565
|
}
|
|
1504
|
-
async function
|
|
1505
|
-
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) :
|
|
1566
|
+
async function Vn(e, t = g) {
|
|
1567
|
+
return e.length === 0 ? Promise.reject(/* @__PURE__ */ Error("userids is required")) : R(t, "api/v1/principal/userids", new URLSearchParams({ userids: [...e].join(",") }), { noAutoAuthentication: N(t) });
|
|
1506
1568
|
}
|
|
1507
|
-
var
|
|
1508
|
-
get:
|
|
1509
|
-
list:
|
|
1510
|
-
userid:
|
|
1511
|
-
userids:
|
|
1569
|
+
var Hn = { principal: {
|
|
1570
|
+
get: Rn,
|
|
1571
|
+
list: zn,
|
|
1572
|
+
userid: Bn,
|
|
1573
|
+
userids: Vn
|
|
1512
1574
|
} };
|
|
1513
1575
|
//#endregion
|
|
1514
1576
|
//#region src/web-api/v1/fetch-query.ts
|
|
1515
|
-
function
|
|
1577
|
+
function Un(e, t, n) {
|
|
1516
1578
|
let r = n.config.aggregationCounts;
|
|
1517
1579
|
e.aggregations?.forEach((e) => {
|
|
1518
|
-
e.$hasMore =
|
|
1580
|
+
e.$hasMore = Ht(e, Vt(e.name, t, r)), e.isTree && Kn(e);
|
|
1519
1581
|
});
|
|
1520
1582
|
}
|
|
1521
|
-
async function
|
|
1522
|
-
let i = await
|
|
1583
|
+
async function Wn(e, t, n, r = g) {
|
|
1584
|
+
let i = await I(r, "api/v1/query", {
|
|
1523
1585
|
query: e,
|
|
1524
1586
|
$auditRecord: t,
|
|
1525
1587
|
queryIntentData: n
|
|
1526
1588
|
});
|
|
1527
|
-
|
|
1589
|
+
Un(i, e, r), i.records?.map((e) => Object.assign(e, {
|
|
1528
1590
|
value: e.title,
|
|
1529
1591
|
type: "default"
|
|
1530
1592
|
}));
|
|
1531
1593
|
let a = {
|
|
1532
1594
|
...i,
|
|
1533
|
-
...
|
|
1595
|
+
...rn(i)
|
|
1534
1596
|
};
|
|
1535
1597
|
return Promise.resolve(a);
|
|
1536
1598
|
}
|
|
1537
|
-
async function
|
|
1599
|
+
async function Gn(e, t, n, r = g) {
|
|
1538
1600
|
let { app: i = "" } = r.config, a = {
|
|
1539
1601
|
methods: [],
|
|
1540
1602
|
mode: t,
|
|
@@ -1546,9 +1608,9 @@ async function Rn(e, t, n, r = g) {
|
|
|
1546
1608
|
app: i,
|
|
1547
1609
|
query: t
|
|
1548
1610
|
});
|
|
1549
|
-
let o = await
|
|
1611
|
+
let o = await I(r, "api/v1/multi", a);
|
|
1550
1612
|
o.results.forEach((t, n) => {
|
|
1551
|
-
|
|
1613
|
+
Un(t, e[n], r);
|
|
1552
1614
|
}), o.results.forEach((e) => {
|
|
1553
1615
|
e.records?.map((e) => Object.assign(e, {
|
|
1554
1616
|
value: e.title,
|
|
@@ -1557,23 +1619,23 @@ async function Rn(e, t, n, r = g) {
|
|
|
1557
1619
|
});
|
|
1558
1620
|
let s = o.results.map((e) => ({
|
|
1559
1621
|
...e,
|
|
1560
|
-
...
|
|
1622
|
+
...rn(e)
|
|
1561
1623
|
}));
|
|
1562
1624
|
return Promise.resolve(s);
|
|
1563
1625
|
}
|
|
1564
|
-
function
|
|
1626
|
+
function Kn(e, t = "", n = 0) {
|
|
1565
1627
|
let r = [];
|
|
1566
1628
|
return e.items && e.items.forEach((e) => {
|
|
1567
1629
|
let i = t ? `${t}/${e.value}` : e.value, a = n + 1;
|
|
1568
1630
|
r.push({
|
|
1569
1631
|
path: i,
|
|
1570
1632
|
level: a
|
|
1571
|
-
}), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(
|
|
1633
|
+
}), e.$path = i, e.$level = a, e.hasChildren ? r = r.concat(Kn(e, i, a)) : e.hasChildren = !1;
|
|
1572
1634
|
}), r;
|
|
1573
1635
|
}
|
|
1574
1636
|
//#endregion
|
|
1575
1637
|
//#region src/web-api/v1/fetch-query-export.ts
|
|
1576
|
-
async function
|
|
1638
|
+
async function qn({ model: e, appName: t, query: n, article: r }, i = g) {
|
|
1577
1639
|
let { webservice: a, format: o, maxcount: s, exportedColumns: c, export: l } = e, u = {
|
|
1578
1640
|
app: t,
|
|
1579
1641
|
webservice: a,
|
|
@@ -1587,24 +1649,24 @@ async function Bn({ model: e, appName: t, query: n, article: r }, i = g) {
|
|
|
1587
1649
|
detail: { resultid: r ? r.id : void 0 }
|
|
1588
1650
|
}] }
|
|
1589
1651
|
};
|
|
1590
|
-
return
|
|
1652
|
+
return J(u), await I(i, "api/v1/search.queryexport", u, { responseType: "blob" });
|
|
1591
1653
|
}
|
|
1592
1654
|
//#endregion
|
|
1593
1655
|
//#region src/web-api/v1/fetch-query-intent.ts
|
|
1594
|
-
async function
|
|
1595
|
-
return (await
|
|
1656
|
+
async function Jn(e, t = g) {
|
|
1657
|
+
return (await I(t, "api/v1/queryintent", { query: e }))?.intents;
|
|
1596
1658
|
}
|
|
1597
1659
|
//#endregion
|
|
1598
1660
|
//#region src/web-api/v1/fetch-security-principal.ts
|
|
1599
|
-
var
|
|
1600
|
-
function
|
|
1601
|
-
return
|
|
1661
|
+
var Yn = "api/v1/security.principal";
|
|
1662
|
+
function Xn(e, t, n = g) {
|
|
1663
|
+
return I(n, Yn, {
|
|
1602
1664
|
action: "list",
|
|
1603
1665
|
...e
|
|
1604
1666
|
}, { signal: t });
|
|
1605
1667
|
}
|
|
1606
|
-
async function
|
|
1607
|
-
return e.length ? (await
|
|
1668
|
+
async function Zn(e, t = g) {
|
|
1669
|
+
return e.length ? (await I(t, Yn, {
|
|
1608
1670
|
action: "userids",
|
|
1609
1671
|
userids: e,
|
|
1610
1672
|
limit: e.length
|
|
@@ -1612,16 +1674,16 @@ async function Wn(e, t = g) {
|
|
|
1612
1674
|
}
|
|
1613
1675
|
//#endregion
|
|
1614
1676
|
//#region src/web-api/v1/fetch-similar-documents.ts
|
|
1615
|
-
async function
|
|
1616
|
-
return (await
|
|
1677
|
+
async function Qn(e, t, n, r = g) {
|
|
1678
|
+
return (await I(r, "api/v1/similardocuments", {
|
|
1617
1679
|
sourceDocumentId: e,
|
|
1618
1680
|
query: { name: t }
|
|
1619
1681
|
}, { signal: n })).data;
|
|
1620
1682
|
}
|
|
1621
1683
|
//#endregion
|
|
1622
1684
|
//#region src/web-api/v1/fetch-sponsored-links.ts
|
|
1623
|
-
async function
|
|
1624
|
-
return (await
|
|
1685
|
+
async function $n(e, t, n = g) {
|
|
1686
|
+
return (await I(n, "api/v1/query.links", {
|
|
1625
1687
|
webservice: e,
|
|
1626
1688
|
query: t
|
|
1627
1689
|
}))?.links?.map((e) => ({
|
|
@@ -1631,9 +1693,9 @@ async function Kn(e, t, n = g) {
|
|
|
1631
1693
|
}
|
|
1632
1694
|
//#endregion
|
|
1633
1695
|
//#region src/utils/to-sql.ts
|
|
1634
|
-
function
|
|
1696
|
+
function er(e, t) {
|
|
1635
1697
|
if (typeof e == "number") return `${e}`;
|
|
1636
|
-
if (
|
|
1698
|
+
if (sn(e)) return t ? `'${tr(e)}'` : tr(e);
|
|
1637
1699
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
1638
1700
|
if (e === null) return "null";
|
|
1639
1701
|
if (Array.isArray(e)) {
|
|
@@ -1644,10 +1706,10 @@ function qn(e, t) {
|
|
|
1644
1706
|
}
|
|
1645
1707
|
return t ? `'${e}'` : e;
|
|
1646
1708
|
}
|
|
1647
|
-
function
|
|
1709
|
+
function tr(e) {
|
|
1648
1710
|
if (!e) return "";
|
|
1649
1711
|
try {
|
|
1650
|
-
return
|
|
1712
|
+
return un(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
|
|
1651
1713
|
year: "numeric",
|
|
1652
1714
|
month: "2-digit",
|
|
1653
1715
|
day: "2-digit"
|
|
@@ -1663,7 +1725,7 @@ function Jn(e) {
|
|
|
1663
1725
|
}
|
|
1664
1726
|
//#endregion
|
|
1665
1727
|
//#region src/web-api/v1/fetch-suggest.ts
|
|
1666
|
-
async function
|
|
1728
|
+
async function nr(e, t, n, r, i, a = g) {
|
|
1667
1729
|
let { app: o } = a.config, s = {
|
|
1668
1730
|
app: o || "",
|
|
1669
1731
|
suggestQuery: e,
|
|
@@ -1673,14 +1735,14 @@ async function Yn(e, t, n, r, i, a = g) {
|
|
|
1673
1735
|
showSource: i
|
|
1674
1736
|
};
|
|
1675
1737
|
try {
|
|
1676
|
-
return (await
|
|
1738
|
+
return (await I(a, "api/v1/search.suggest", s)).suggests;
|
|
1677
1739
|
} catch (e) {
|
|
1678
1740
|
throw console.error("Error fetching suggestions:", e), e;
|
|
1679
1741
|
}
|
|
1680
1742
|
}
|
|
1681
|
-
async function
|
|
1743
|
+
async function rr(e, t, n, r, i = g) {
|
|
1682
1744
|
let { app: a } = i.config;
|
|
1683
|
-
return (await
|
|
1745
|
+
return (await I(i, "api/v1/suggestquery", {
|
|
1684
1746
|
app: a || "",
|
|
1685
1747
|
suggestQuery: e,
|
|
1686
1748
|
text: t,
|
|
@@ -1688,22 +1750,22 @@ async function Xn(e, t, n, r, i = g) {
|
|
|
1688
1750
|
kinds: r
|
|
1689
1751
|
})).suggests;
|
|
1690
1752
|
}
|
|
1691
|
-
async function
|
|
1753
|
+
async function ir(e, t, n, r = g) {
|
|
1692
1754
|
if (!t) return Promise.resolve([]);
|
|
1693
|
-
let { app: i } = r.config, a = await
|
|
1755
|
+
let { app: i } = r.config, a = await I(r, "api/v1/suggestfield", {
|
|
1694
1756
|
app: i || "",
|
|
1695
1757
|
text: e,
|
|
1696
1758
|
fields: t,
|
|
1697
1759
|
query: n
|
|
1698
1760
|
});
|
|
1699
1761
|
return a.suggests.forEach((e) => {
|
|
1700
|
-
e.display =
|
|
1762
|
+
e.display = er(e.display);
|
|
1701
1763
|
}), a.suggests;
|
|
1702
1764
|
}
|
|
1703
1765
|
//#endregion
|
|
1704
1766
|
//#region src/web-api/v1/fetch-text-chunk.ts
|
|
1705
|
-
async function
|
|
1706
|
-
return
|
|
1767
|
+
async function ar(e, t, n, r, i, a, o = g) {
|
|
1768
|
+
return I(o, "api/v1/doc.textchunks", {
|
|
1707
1769
|
id: e,
|
|
1708
1770
|
textChunks: t,
|
|
1709
1771
|
highlights: n,
|
|
@@ -1714,252 +1776,252 @@ async function Qn(e, t, n, r, i, a, o = g) {
|
|
|
1714
1776
|
}
|
|
1715
1777
|
//#endregion
|
|
1716
1778
|
//#region src/web-api/v1/fetch-user-settings.ts
|
|
1717
|
-
async function
|
|
1779
|
+
async function or(e = g) {
|
|
1718
1780
|
let { app: t } = e.config;
|
|
1719
|
-
return
|
|
1781
|
+
return R(e, "api/v1/usersettings", new URLSearchParams({
|
|
1720
1782
|
app: t || "",
|
|
1721
1783
|
action: "load"
|
|
1722
1784
|
}));
|
|
1723
1785
|
}
|
|
1724
|
-
async function
|
|
1786
|
+
async function sr(e, t, n = g) {
|
|
1725
1787
|
let r = {
|
|
1726
1788
|
action: "save",
|
|
1727
1789
|
userSettings: e,
|
|
1728
1790
|
$auditRecord: { auditEvents: [t] }
|
|
1729
1791
|
};
|
|
1730
|
-
return
|
|
1792
|
+
return J(r), I(n, "api/v1/usersettings", r);
|
|
1731
1793
|
}
|
|
1732
|
-
async function
|
|
1794
|
+
async function cr(e, t, n = g) {
|
|
1733
1795
|
let r = {
|
|
1734
1796
|
action: "patch",
|
|
1735
1797
|
userSettings: e,
|
|
1736
1798
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1737
1799
|
};
|
|
1738
|
-
return
|
|
1800
|
+
return J(r), I(n, "api/v1/usersettings", r);
|
|
1739
1801
|
}
|
|
1740
|
-
async function
|
|
1741
|
-
return
|
|
1802
|
+
async function lr(e = g) {
|
|
1803
|
+
return sr({}, { type: "UserSettings_Reset" }, e);
|
|
1742
1804
|
}
|
|
1743
1805
|
//#endregion
|
|
1744
1806
|
//#region src/web-api/v2/fetch-change-password.ts
|
|
1745
|
-
async function
|
|
1746
|
-
return
|
|
1807
|
+
async function ur(e, t, n = g) {
|
|
1808
|
+
return I(n, "api/v2/security/password/change", {
|
|
1747
1809
|
newPassword: e,
|
|
1748
1810
|
currentPassword: t
|
|
1749
1811
|
});
|
|
1750
1812
|
}
|
|
1751
1813
|
//#endregion
|
|
1752
1814
|
//#region src/web-api/v2/fetch-document-upload-container.ts
|
|
1753
|
-
var
|
|
1754
|
-
function
|
|
1815
|
+
var X = "api/v2/document-upload/container";
|
|
1816
|
+
function dr(e) {
|
|
1755
1817
|
let t = new URLSearchParams();
|
|
1756
1818
|
return e.page !== void 0 && t.set("pageNumber", String(e.page)), e.pageSize !== void 0 && t.set("pageSize", String(e.pageSize)), t;
|
|
1757
1819
|
}
|
|
1758
|
-
function
|
|
1820
|
+
function fr(e) {
|
|
1759
1821
|
let { pageNumber: t, ...n } = e;
|
|
1760
1822
|
return {
|
|
1761
1823
|
...n,
|
|
1762
1824
|
page: t
|
|
1763
1825
|
};
|
|
1764
1826
|
}
|
|
1765
|
-
async function
|
|
1766
|
-
return
|
|
1827
|
+
async function pr(e = {}, t = g) {
|
|
1828
|
+
return fr(await R(t, X, dr(e)));
|
|
1767
1829
|
}
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1830
|
+
function mr(e, t = g) {
|
|
1831
|
+
return R(t, `${X}/${encodeURIComponent(e)}`);
|
|
1770
1832
|
}
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
1833
|
+
function hr(e, t = g) {
|
|
1834
|
+
return I(t, X, e);
|
|
1773
1835
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return
|
|
1836
|
+
function gr(e, t, n = g) {
|
|
1837
|
+
return V(n, `${X}/${encodeURIComponent(e)}`, t);
|
|
1776
1838
|
}
|
|
1777
|
-
async function
|
|
1778
|
-
let n = (await
|
|
1839
|
+
async function _r(e, t = g) {
|
|
1840
|
+
let n = (await z(t, "api/v2/document-upload/containers", void 0, { body: { containerIds: e } }))?.failed ?? [], r = new Set(n.map((e) => e.containerId));
|
|
1779
1841
|
return {
|
|
1780
1842
|
succeeded: e.filter((e) => !r.has(e)),
|
|
1781
1843
|
failed: n
|
|
1782
1844
|
};
|
|
1783
1845
|
}
|
|
1784
|
-
async function
|
|
1785
|
-
return
|
|
1846
|
+
async function vr(e, t, n, r = g) {
|
|
1847
|
+
return fr(await R(r, `${X}/${encodeURIComponent(e)}/documents`, dr(t ?? {}), n));
|
|
1786
1848
|
}
|
|
1787
|
-
async function
|
|
1788
|
-
return (await
|
|
1849
|
+
async function yr(e, t, n = g) {
|
|
1850
|
+
return (await I(n, `${X}/${encodeURIComponent(e)}/documents`, { documents: t })).documents;
|
|
1789
1851
|
}
|
|
1790
|
-
function
|
|
1791
|
-
return
|
|
1852
|
+
function br(e, t, n = g) {
|
|
1853
|
+
return z(n, `${X}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
|
|
1792
1854
|
}
|
|
1793
1855
|
//#endregion
|
|
1794
1856
|
//#region src/web-api/v2/fetch-document-upload-status.ts
|
|
1795
|
-
async function
|
|
1857
|
+
async function xr(e, t, n = g) {
|
|
1796
1858
|
let r = new URLSearchParams();
|
|
1797
|
-
return e?.containerId !== void 0 && r.set("containerId", e.containerId), e?.initiatedBy !== void 0 && r.set("initiatedBy", e.initiatedBy), e?.skip !== void 0 && r.set("skip", String(e.skip)), e?.take !== void 0 && r.set("take", String(e.take)),
|
|
1859
|
+
return e?.containerId !== void 0 && r.set("containerId", e.containerId), e?.initiatedBy !== void 0 && r.set("initiatedBy", e.initiatedBy), e?.skip !== void 0 && r.set("skip", String(e.skip)), e?.take !== void 0 && r.set("take", String(e.take)), R(n, "api/v2/document-upload/status", r, t);
|
|
1798
1860
|
}
|
|
1799
1861
|
//#endregion
|
|
1800
1862
|
//#region src/web-api/v2/fetch-forgot-password.ts
|
|
1801
|
-
function
|
|
1863
|
+
function Sr() {
|
|
1802
1864
|
return typeof window > "u" ? void 0 : `${window.location.origin}/login?mode=changepassword`;
|
|
1803
1865
|
}
|
|
1804
|
-
async function
|
|
1805
|
-
let r = t ??
|
|
1866
|
+
async function Cr(e, t, n = g) {
|
|
1867
|
+
let r = t ?? Sr();
|
|
1806
1868
|
if (!r) throw Error("fetchSendPasswordResetEmail needs a changePasswordRedirectUrl outside a browser: there is no page origin to derive it from. Pass the URL the reset email should link to.");
|
|
1807
|
-
return
|
|
1869
|
+
return I(n, "api/v2/security/password/ask-reset-email", {
|
|
1808
1870
|
changePasswordRedirectUrl: r,
|
|
1809
1871
|
userName: e
|
|
1810
1872
|
});
|
|
1811
1873
|
}
|
|
1812
1874
|
//#endregion
|
|
1813
1875
|
//#region src/web-api/v2/fetch-user-profile.ts
|
|
1814
|
-
async function
|
|
1815
|
-
return await
|
|
1876
|
+
async function wr(e, t = g) {
|
|
1877
|
+
return await R(t, `api/v2/user-profile/${e}`);
|
|
1816
1878
|
}
|
|
1817
|
-
async function
|
|
1818
|
-
return await
|
|
1879
|
+
async function Tr(e, t = g) {
|
|
1880
|
+
return await I(t, "api/v2/user-profile", e);
|
|
1819
1881
|
}
|
|
1820
|
-
async function
|
|
1821
|
-
return await
|
|
1882
|
+
async function Er(e, t, n, r = g) {
|
|
1883
|
+
return await B(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`, e);
|
|
1822
1884
|
}
|
|
1823
|
-
async function
|
|
1824
|
-
return (await
|
|
1885
|
+
async function Dr(e, t, n, r = g) {
|
|
1886
|
+
return (await z(r, `api/v2/user-profile/${e.data?.id}/${t}/${n}`)).success === !0;
|
|
1825
1887
|
}
|
|
1826
1888
|
//#endregion
|
|
1827
1889
|
//#region src/web-api/v2/fetch-version.ts
|
|
1828
|
-
async function
|
|
1829
|
-
return await
|
|
1890
|
+
async function Or(e = g) {
|
|
1891
|
+
return await R(e, "api/v2/version");
|
|
1830
1892
|
}
|
|
1831
1893
|
//#endregion
|
|
1832
1894
|
//#region src/client/create-api.ts
|
|
1833
|
-
var
|
|
1895
|
+
var Z = (e, t) => (...n) => {
|
|
1834
1896
|
let r = Array(Math.max(0, e.length - n.length)).fill(void 0);
|
|
1835
1897
|
return e(...n, ...r, t);
|
|
1836
1898
|
};
|
|
1837
|
-
function
|
|
1899
|
+
function kr(e) {
|
|
1838
1900
|
return {
|
|
1839
1901
|
app: {
|
|
1840
|
-
get:
|
|
1841
|
-
preLogin:
|
|
1902
|
+
get: Z(Ft, e),
|
|
1903
|
+
preLogin: Z(It, e)
|
|
1842
1904
|
},
|
|
1843
1905
|
principal: {
|
|
1844
|
-
get:
|
|
1845
|
-
list:
|
|
1846
|
-
userid:
|
|
1847
|
-
userids:
|
|
1848
|
-
search:
|
|
1849
|
-
byIds:
|
|
1906
|
+
get: Z(Rn, e),
|
|
1907
|
+
list: Z(zn, e),
|
|
1908
|
+
userid: Z(Bn, e),
|
|
1909
|
+
userids: Z(Vn, e),
|
|
1910
|
+
search: Z(Xn, e),
|
|
1911
|
+
byIds: Z(Zn, e)
|
|
1850
1912
|
},
|
|
1851
1913
|
query: {
|
|
1852
|
-
search:
|
|
1853
|
-
bulk:
|
|
1854
|
-
intent:
|
|
1855
|
-
export:
|
|
1856
|
-
aggregate:
|
|
1857
|
-
sponsoredLinks:
|
|
1858
|
-
similarDocuments:
|
|
1914
|
+
search: Z(Wn, e),
|
|
1915
|
+
bulk: Z(Gn, e),
|
|
1916
|
+
intent: Z(Jn, e),
|
|
1917
|
+
export: Z(qn, e),
|
|
1918
|
+
aggregate: Z(wn, e),
|
|
1919
|
+
sponsoredLinks: Z($n, e),
|
|
1920
|
+
similarDocuments: Z(Qn, e)
|
|
1859
1921
|
},
|
|
1860
1922
|
suggest: {
|
|
1861
|
-
get:
|
|
1862
|
-
query:
|
|
1863
|
-
field:
|
|
1923
|
+
get: Z(nr, e),
|
|
1924
|
+
query: Z(rr, e),
|
|
1925
|
+
field: Z(ir, e)
|
|
1864
1926
|
},
|
|
1865
1927
|
preview: {
|
|
1866
|
-
get:
|
|
1867
|
-
textChunks:
|
|
1928
|
+
get: Z(In, e),
|
|
1929
|
+
textChunks: Z(ar, e)
|
|
1868
1930
|
},
|
|
1869
1931
|
labels: {
|
|
1870
|
-
get:
|
|
1871
|
-
rights: Y
|
|
1872
|
-
add: Y
|
|
1873
|
-
remove: Y
|
|
1874
|
-
rename: Y
|
|
1875
|
-
delete: Y
|
|
1876
|
-
bulkAdd: Y
|
|
1877
|
-
bulkRemove: Y
|
|
1932
|
+
get: Z(On, e),
|
|
1933
|
+
rights: Z(Y.getUserRights, e),
|
|
1934
|
+
add: Z(Y.add, e),
|
|
1935
|
+
remove: Z(Y.remove, e),
|
|
1936
|
+
rename: Z(Y.rename, e),
|
|
1937
|
+
delete: Z(Y.delete, e),
|
|
1938
|
+
bulkAdd: Z(Y.bulkAdd, e),
|
|
1939
|
+
bulkRemove: Z(Y.bulkRemove, e)
|
|
1878
1940
|
},
|
|
1879
1941
|
dataset: {
|
|
1880
|
-
get:
|
|
1881
|
-
getMany:
|
|
1882
|
-
list:
|
|
1942
|
+
get: Z(Tn, e),
|
|
1943
|
+
getMany: Z(En, e),
|
|
1944
|
+
list: Z(Dn, e)
|
|
1883
1945
|
},
|
|
1884
1946
|
userSettings: {
|
|
1885
|
-
get:
|
|
1886
|
-
save:
|
|
1887
|
-
patch:
|
|
1888
|
-
reset:
|
|
1947
|
+
get: Z(or, e),
|
|
1948
|
+
save: Z(sr, e),
|
|
1949
|
+
patch: Z(cr, e),
|
|
1950
|
+
reset: Z(lr, e)
|
|
1889
1951
|
},
|
|
1890
1952
|
userProfile: {
|
|
1891
|
-
get:
|
|
1892
|
-
create:
|
|
1893
|
-
patch:
|
|
1894
|
-
deleteProperty:
|
|
1953
|
+
get: Z(wr, e),
|
|
1954
|
+
create: Z(Tr, e),
|
|
1955
|
+
patch: Z(Er, e),
|
|
1956
|
+
deleteProperty: Z(Dr, e)
|
|
1895
1957
|
},
|
|
1896
1958
|
containers: {
|
|
1897
|
-
list:
|
|
1898
|
-
get:
|
|
1899
|
-
create:
|
|
1900
|
-
update:
|
|
1901
|
-
delete:
|
|
1902
|
-
listDocuments:
|
|
1903
|
-
addDocuments:
|
|
1904
|
-
deleteDocuments:
|
|
1905
|
-
uploadStatus:
|
|
1959
|
+
list: Z(pr, e),
|
|
1960
|
+
get: Z(mr, e),
|
|
1961
|
+
create: Z(hr, e),
|
|
1962
|
+
update: Z(gr, e),
|
|
1963
|
+
delete: Z(_r, e),
|
|
1964
|
+
listDocuments: Z(vr, e),
|
|
1965
|
+
addDocuments: Z(yr, e),
|
|
1966
|
+
deleteDocuments: Z(br, e),
|
|
1967
|
+
uploadStatus: Z(xr, e)
|
|
1906
1968
|
},
|
|
1907
1969
|
password: {
|
|
1908
|
-
change:
|
|
1909
|
-
sendResetEmail:
|
|
1970
|
+
change: Z(ur, e),
|
|
1971
|
+
sendResetEmail: Z(Cr, e)
|
|
1910
1972
|
},
|
|
1911
|
-
version:
|
|
1973
|
+
version: Z(Or, e)
|
|
1912
1974
|
};
|
|
1913
1975
|
}
|
|
1914
1976
|
//#endregion
|
|
1915
1977
|
//#region src/client/create-atomic-client.ts
|
|
1916
|
-
function
|
|
1978
|
+
function Ar(e) {
|
|
1917
1979
|
return {
|
|
1918
1980
|
config: e.config,
|
|
1919
1981
|
storagePrefix: e.storagePrefix,
|
|
1920
1982
|
configure: (t) => b(e, t),
|
|
1921
|
-
initializeConfig: () =>
|
|
1983
|
+
initializeConfig: () => Lt(e),
|
|
1922
1984
|
auth: {
|
|
1923
|
-
login: (t) =>
|
|
1924
|
-
logout: () =>
|
|
1925
|
-
isAuthenticated: () =>
|
|
1926
|
-
hasSession: () =>
|
|
1927
|
-
isRedirectPending: () =>
|
|
1928
|
-
clearSession: () =>
|
|
1929
|
-
getToken: () =>
|
|
1930
|
-
setToken: (t) =>
|
|
1985
|
+
login: (t) => vt(e, t),
|
|
1986
|
+
logout: () => wt(e),
|
|
1987
|
+
isAuthenticated: () => At(e),
|
|
1988
|
+
hasSession: () => Qe(e),
|
|
1989
|
+
isRedirectPending: () => Ot(e),
|
|
1990
|
+
clearSession: () => Et(e),
|
|
1991
|
+
getToken: () => E(e),
|
|
1992
|
+
setToken: (t) => j(e, t),
|
|
1931
1993
|
on: (t, n) => e.events.on(t, n)
|
|
1932
1994
|
},
|
|
1933
1995
|
http: {
|
|
1934
|
-
get: (t, n, r) =>
|
|
1935
|
-
post: (t, n, r) =>
|
|
1936
|
-
put: (t, n, r) =>
|
|
1937
|
-
patch: (t, n, r) =>
|
|
1938
|
-
del: (t, n, r) =>
|
|
1996
|
+
get: (t, n, r) => R(e, t, n, r),
|
|
1997
|
+
post: (t, n, r) => I(e, t, n, r),
|
|
1998
|
+
put: (t, n, r) => V(e, t, n, r),
|
|
1999
|
+
patch: (t, n, r) => B(e, t, n, r),
|
|
2000
|
+
del: (t, n, r) => z(e, t, n, r)
|
|
1939
2001
|
},
|
|
1940
|
-
api:
|
|
2002
|
+
api: kr(e),
|
|
1941
2003
|
context: e
|
|
1942
2004
|
};
|
|
1943
2005
|
}
|
|
1944
|
-
function
|
|
2006
|
+
function jr(e) {
|
|
1945
2007
|
let { httpAdapter: t, storagePrefix: n, ...r } = e, i = pe({
|
|
1946
2008
|
config: {},
|
|
1947
2009
|
storagePrefix: n,
|
|
1948
2010
|
httpAdapter: t
|
|
1949
2011
|
});
|
|
1950
|
-
return b(i, r),
|
|
2012
|
+
return b(i, r), Ar(i);
|
|
1951
2013
|
}
|
|
1952
|
-
var
|
|
1953
|
-
function
|
|
1954
|
-
return
|
|
2014
|
+
var Mr = Ar(g);
|
|
2015
|
+
function Nr() {
|
|
2016
|
+
return Mr;
|
|
1955
2017
|
}
|
|
1956
2018
|
//#endregion
|
|
1957
2019
|
//#region src/utils/aggregations.ts
|
|
1958
|
-
var
|
|
1959
|
-
function
|
|
2020
|
+
var Pr = /.*:\(?([><=\d\-.AND ]+)\)?/;
|
|
2021
|
+
function Fr(e, t) {
|
|
1960
2022
|
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((n, r) => {
|
|
1961
2023
|
if (!r.value || r.value === "") return n;
|
|
1962
|
-
let i =
|
|
2024
|
+
let i = Ir(r, e.column);
|
|
1963
2025
|
return n.push({
|
|
1964
2026
|
operator: i.operator,
|
|
1965
2027
|
value: i.value,
|
|
@@ -1970,15 +2032,18 @@ function Or(e, t) {
|
|
|
1970
2032
|
}), n;
|
|
1971
2033
|
}, []);
|
|
1972
2034
|
}
|
|
1973
|
-
function
|
|
1974
|
-
let n = t, r = e.value.match(
|
|
2035
|
+
function Ir(e, t) {
|
|
2036
|
+
let n = t, r = e.value.match(Pr);
|
|
1975
2037
|
if (r?.[1]) {
|
|
1976
|
-
let t = (r?.[1].split(" AND ")).map((t) =>
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2038
|
+
let t = (r?.[1].split(" AND ")).map((t) => {
|
|
2039
|
+
let r = t.indexOf(">=") === -1 ? "lt" : "gte", i = t.substring(t.indexOf(" ") + 1);
|
|
2040
|
+
return {
|
|
2041
|
+
field: n,
|
|
2042
|
+
operator: r,
|
|
2043
|
+
value: i,
|
|
2044
|
+
display: e.display || e.value
|
|
2045
|
+
};
|
|
2046
|
+
});
|
|
1982
2047
|
if (t.length === 2) return {
|
|
1983
2048
|
field: n,
|
|
1984
2049
|
operator: "and",
|
|
@@ -1999,26 +2064,26 @@ function kr(e, t) {
|
|
|
1999
2064
|
display: e.display
|
|
2000
2065
|
};
|
|
2001
2066
|
}
|
|
2002
|
-
function
|
|
2067
|
+
function Lr(e, t, n) {
|
|
2003
2068
|
return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
|
|
2004
2069
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return e.items &&= e.items.map((e) =>
|
|
2070
|
+
function Rr(e) {
|
|
2071
|
+
return e.items &&= e.items.map((e) => Rr(e)), e.items?.some((e) => e.$selected || e.$opened) && (e.$opened = !0), e;
|
|
2007
2072
|
}
|
|
2008
|
-
function
|
|
2073
|
+
function zr(e, t) {
|
|
2009
2074
|
let n = [];
|
|
2010
2075
|
if (e.length > 0) {
|
|
2011
2076
|
let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp(`\\b${i}`, "i");
|
|
2012
2077
|
e.forEach((e) => {
|
|
2013
2078
|
if (e.display.length > 1) {
|
|
2014
2079
|
let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
|
|
2015
|
-
|
|
2080
|
+
Br(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
|
|
2016
2081
|
}
|
|
2017
2082
|
});
|
|
2018
2083
|
}
|
|
2019
2084
|
return n;
|
|
2020
2085
|
}
|
|
2021
|
-
function
|
|
2086
|
+
function Br(e, t, n, r, i, a, o) {
|
|
2022
2087
|
let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
|
|
2023
2088
|
if (!l) {
|
|
2024
2089
|
let u = c.replace(/^\/|\/$/g, "");
|
|
@@ -2032,11 +2097,11 @@ function Nr(e, t, n, r, i, a, o) {
|
|
|
2032
2097
|
$path: u
|
|
2033
2098
|
}, t.set(c, l), e.push(l);
|
|
2034
2099
|
}
|
|
2035
|
-
c.length < r.length && (l.hasChildren = !0,
|
|
2100
|
+
c.length < r.length && (l.hasChildren = !0, Br(l.items, t, c, r, i, a + 1, o));
|
|
2036
2101
|
}
|
|
2037
2102
|
//#endregion
|
|
2038
2103
|
//#region src/utils/bisect.ts
|
|
2039
|
-
function
|
|
2104
|
+
function Vr(e, t) {
|
|
2040
2105
|
return e.reduce((e, n) => (t(n) ? e.true.push(n) : e.false.push(n), e), {
|
|
2041
2106
|
true: [],
|
|
2042
2107
|
false: []
|
|
@@ -2044,34 +2109,34 @@ function Pr(e, t) {
|
|
|
2044
2109
|
}
|
|
2045
2110
|
//#endregion
|
|
2046
2111
|
//#region src/utils/concepts.ts
|
|
2047
|
-
var
|
|
2048
|
-
function
|
|
2112
|
+
var Hr = /(([+-])?\(([^)]+)\))|(([+-])?\[([^\]]+)\])|(([+-])?"([^"]+)")|(([+-])?\/([^/]+)\/)|(([+-])?(\S+))/g, Ur = 2, Wr = 3, Gr = 5, Kr = 6, qr = 8, Jr = 9, Yr = 11, Xr = 12, Zr = 14, Qr = 15;
|
|
2113
|
+
function Q(e) {
|
|
2049
2114
|
if (!e) return [];
|
|
2050
|
-
let t = [], n = e.matchAll(
|
|
2051
|
-
for (let e of n) e[
|
|
2115
|
+
let t = [], n = e.matchAll(Hr);
|
|
2116
|
+
for (let e of n) e[Wr] ? t.push({
|
|
2052
2117
|
type: "group",
|
|
2053
|
-
value: e[
|
|
2054
|
-
op: e[
|
|
2055
|
-
}) : e[
|
|
2118
|
+
value: e[Wr],
|
|
2119
|
+
op: e[Ur]
|
|
2120
|
+
}) : e[Kr] ? t.push({
|
|
2056
2121
|
type: "adjacent",
|
|
2057
|
-
value: e[
|
|
2058
|
-
op: e[
|
|
2059
|
-
}) : e[
|
|
2122
|
+
value: e[Kr],
|
|
2123
|
+
op: e[Gr]
|
|
2124
|
+
}) : e[Jr] ? t.push({
|
|
2060
2125
|
type: "exact",
|
|
2061
|
-
value: e[
|
|
2062
|
-
op: e[
|
|
2063
|
-
}) : e[
|
|
2126
|
+
value: e[Jr],
|
|
2127
|
+
op: e[qr]
|
|
2128
|
+
}) : e[Xr] ? t.push({
|
|
2064
2129
|
type: "regex",
|
|
2065
|
-
value: e[
|
|
2066
|
-
op: e[
|
|
2067
|
-
}) : e[
|
|
2130
|
+
value: e[Xr],
|
|
2131
|
+
op: e[Yr]
|
|
2132
|
+
}) : e[Qr] && t.push({
|
|
2068
2133
|
type: "token",
|
|
2069
|
-
value: e[
|
|
2070
|
-
op: e[
|
|
2134
|
+
value: e[Qr],
|
|
2135
|
+
op: e[Zr]
|
|
2071
2136
|
});
|
|
2072
2137
|
return t;
|
|
2073
2138
|
}
|
|
2074
|
-
function
|
|
2139
|
+
function $r(e) {
|
|
2075
2140
|
return e.map((e) => {
|
|
2076
2141
|
let t = e.op || "";
|
|
2077
2142
|
switch (e.type) {
|
|
@@ -2084,39 +2149,39 @@ function Z(e) {
|
|
|
2084
2149
|
}
|
|
2085
2150
|
}).join(" ");
|
|
2086
2151
|
}
|
|
2087
|
-
function
|
|
2088
|
-
let r =
|
|
2152
|
+
function ei(e, t, n) {
|
|
2153
|
+
let r = Q(e);
|
|
2089
2154
|
for (let e of t) r.push({
|
|
2090
2155
|
type: "adjacent",
|
|
2091
2156
|
value: e,
|
|
2092
2157
|
op: n
|
|
2093
2158
|
});
|
|
2094
|
-
return
|
|
2159
|
+
return $r(r);
|
|
2095
2160
|
}
|
|
2096
|
-
function
|
|
2097
|
-
let n =
|
|
2098
|
-
return r === -1 ? t : (n.splice(r, 1),
|
|
2161
|
+
function ti(e, t) {
|
|
2162
|
+
let n = Q(t), r = n.findIndex((t) => t.value === e);
|
|
2163
|
+
return r === -1 ? t : (n.splice(r, 1), $r(n));
|
|
2099
2164
|
}
|
|
2100
|
-
function
|
|
2101
|
-
return
|
|
2165
|
+
function ni(e) {
|
|
2166
|
+
return $r(Q(e).filter((e) => e.type !== "adjacent"));
|
|
2102
2167
|
}
|
|
2103
|
-
function
|
|
2104
|
-
return
|
|
2168
|
+
function ri(e) {
|
|
2169
|
+
return Q(e).filter((e) => e.type === "adjacent").map((e) => e.value);
|
|
2105
2170
|
}
|
|
2106
2171
|
//#endregion
|
|
2107
2172
|
//#region src/utils/date.ts
|
|
2108
|
-
function
|
|
2109
|
-
let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } =
|
|
2173
|
+
function ii(e, t, n) {
|
|
2174
|
+
let r = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: i, unit: a, isFuture: o } = oi(t, n);
|
|
2110
2175
|
return r.format(i * (o ? 1 : -1), a);
|
|
2111
2176
|
}
|
|
2112
|
-
var
|
|
2177
|
+
var ai = [
|
|
2113
2178
|
["year", 365],
|
|
2114
2179
|
["month", 30],
|
|
2115
2180
|
["week", 7],
|
|
2116
2181
|
["day", 1]
|
|
2117
2182
|
];
|
|
2118
|
-
function
|
|
2119
|
-
let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime()), a = Math.floor(i /
|
|
2183
|
+
function oi(e, t) {
|
|
2184
|
+
let n = new Date(e), r = t ? new Date(t) : /* @__PURE__ */ new Date(), i = Math.abs(r.getTime() - n.getTime()), a = Math.floor(i / 864e5), [o, s] = ai.find(([, e]) => a >= e) ?? ["day", 1];
|
|
2120
2185
|
return {
|
|
2121
2186
|
offset: Math.floor(a / s),
|
|
2122
2187
|
unit: o,
|
|
@@ -2125,13 +2190,13 @@ function Qr(e, t) {
|
|
|
2125
2190
|
}
|
|
2126
2191
|
//#endregion
|
|
2127
2192
|
//#region src/utils/is-not-input-event.ts
|
|
2128
|
-
function
|
|
2193
|
+
function si(e) {
|
|
2129
2194
|
let t = e.target;
|
|
2130
2195
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
2131
2196
|
}
|
|
2132
2197
|
//#endregion
|
|
2133
2198
|
//#region src/utils/notification.ts
|
|
2134
|
-
function
|
|
2199
|
+
function ci(e) {
|
|
2135
2200
|
let t = new CustomEvent("notification", {
|
|
2136
2201
|
bubbles: !0,
|
|
2137
2202
|
cancelable: !1,
|
|
@@ -2139,30 +2204,30 @@ function Q(e) {
|
|
|
2139
2204
|
});
|
|
2140
2205
|
dispatchEvent(t);
|
|
2141
2206
|
}
|
|
2142
|
-
var
|
|
2207
|
+
var li = {
|
|
2143
2208
|
success: (e, t) => {
|
|
2144
|
-
|
|
2209
|
+
ci({
|
|
2145
2210
|
type: "success",
|
|
2146
2211
|
message: e,
|
|
2147
2212
|
options: t
|
|
2148
2213
|
});
|
|
2149
2214
|
},
|
|
2150
2215
|
info: (e, t) => {
|
|
2151
|
-
|
|
2216
|
+
ci({
|
|
2152
2217
|
type: "info",
|
|
2153
2218
|
message: e,
|
|
2154
2219
|
options: t
|
|
2155
2220
|
});
|
|
2156
2221
|
},
|
|
2157
2222
|
warning: (e, t) => {
|
|
2158
|
-
|
|
2223
|
+
ci({
|
|
2159
2224
|
type: "warning",
|
|
2160
2225
|
message: e,
|
|
2161
2226
|
options: t
|
|
2162
2227
|
});
|
|
2163
2228
|
},
|
|
2164
2229
|
error: (e, t) => {
|
|
2165
|
-
|
|
2230
|
+
ci({
|
|
2166
2231
|
type: "error",
|
|
2167
2232
|
message: e,
|
|
2168
2233
|
options: t
|
|
@@ -2171,13 +2236,13 @@ var ei = {
|
|
|
2171
2236
|
};
|
|
2172
2237
|
//#endregion
|
|
2173
2238
|
//#region src/utils/query-params.ts
|
|
2174
|
-
function
|
|
2239
|
+
function ui(e) {
|
|
2175
2240
|
if (e === void 0) return;
|
|
2176
2241
|
let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = $(e), [c] = e.split("?");
|
|
2177
2242
|
return {
|
|
2178
2243
|
path: c,
|
|
2179
2244
|
text: t,
|
|
2180
|
-
filters: n ?
|
|
2245
|
+
filters: n ? pi(n) : void 0,
|
|
2181
2246
|
page: r ? parseInt(r, 10) : void 0,
|
|
2182
2247
|
sort: i,
|
|
2183
2248
|
tab: a,
|
|
@@ -2185,17 +2250,17 @@ function ti(e) {
|
|
|
2185
2250
|
basket: s
|
|
2186
2251
|
};
|
|
2187
2252
|
}
|
|
2188
|
-
function
|
|
2253
|
+
function di(e) {
|
|
2189
2254
|
if (!e) return "";
|
|
2190
2255
|
let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
|
|
2191
2256
|
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() || "";
|
|
2192
2257
|
}
|
|
2193
|
-
function
|
|
2258
|
+
function fi(e) {
|
|
2194
2259
|
if (e === void 0) return [];
|
|
2195
2260
|
let { f: t } = $(e);
|
|
2196
|
-
return
|
|
2261
|
+
return pi(t);
|
|
2197
2262
|
}
|
|
2198
|
-
function
|
|
2263
|
+
function pi(e) {
|
|
2199
2264
|
let t = decodeURIComponent(e);
|
|
2200
2265
|
try {
|
|
2201
2266
|
return JSON.parse(t ?? "[]");
|
|
@@ -2209,41 +2274,41 @@ function $(e) {
|
|
|
2209
2274
|
let n = new URLSearchParams(t);
|
|
2210
2275
|
return Object.fromEntries(n);
|
|
2211
2276
|
}
|
|
2212
|
-
function
|
|
2277
|
+
function mi(e) {
|
|
2213
2278
|
let { q: t = "" } = $(e);
|
|
2214
2279
|
return t;
|
|
2215
2280
|
}
|
|
2216
|
-
function
|
|
2281
|
+
function hi(e) {
|
|
2217
2282
|
let { id: t } = $(e);
|
|
2218
2283
|
return t === void 0 ? void 0 : decodeURIComponent(t);
|
|
2219
2284
|
}
|
|
2220
|
-
function
|
|
2285
|
+
function gi(e) {
|
|
2221
2286
|
let { p: t = "0" } = $(e);
|
|
2222
2287
|
return parseInt(t, 10);
|
|
2223
2288
|
}
|
|
2224
|
-
function
|
|
2289
|
+
function _i(e) {
|
|
2225
2290
|
let { t } = $(e);
|
|
2226
2291
|
return t;
|
|
2227
2292
|
}
|
|
2228
2293
|
//#endregion
|
|
2229
2294
|
//#region src/utils/syslang.ts
|
|
2230
|
-
function
|
|
2295
|
+
function vi(e, t) {
|
|
2231
2296
|
if (!e) return e;
|
|
2232
2297
|
let n = 0, r = e.length, i = 0;
|
|
2233
2298
|
if (e[i] === "[") {
|
|
2234
2299
|
for (; i < r && /[0-9]/.test(e[i]);) i++;
|
|
2235
2300
|
e[i] === "]" && (n = i + 1);
|
|
2236
2301
|
}
|
|
2237
|
-
let a =
|
|
2302
|
+
let a = yi(e, n, !1);
|
|
2238
2303
|
if (!a) return e;
|
|
2239
2304
|
let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
|
|
2240
2305
|
for (; c;) if (o === c.lang1 && s === c.lang2) {
|
|
2241
|
-
let t =
|
|
2306
|
+
let t = yi(e, c.end + 4, !0);
|
|
2242
2307
|
return e.substring(t.start, t.end);
|
|
2243
|
-
} else c =
|
|
2308
|
+
} else c = yi(e, c.end + 4, !1);
|
|
2244
2309
|
return e.substring(a.start, a.end) || e;
|
|
2245
2310
|
}
|
|
2246
|
-
function
|
|
2311
|
+
function yi(e, t, n) {
|
|
2247
2312
|
for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
|
|
2248
2313
|
start: t,
|
|
2249
2314
|
end: n,
|
|
@@ -2259,7 +2324,7 @@ function ui(e, t, n) {
|
|
|
2259
2324
|
}
|
|
2260
2325
|
//#endregion
|
|
2261
2326
|
//#region src/utils/utilities.ts
|
|
2262
|
-
function
|
|
2327
|
+
function bi(e, t) {
|
|
2263
2328
|
let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
|
|
2264
2329
|
return [
|
|
2265
2330
|
a,
|
|
@@ -2269,32 +2334,32 @@ function di(e, t) {
|
|
|
2269
2334
|
}
|
|
2270
2335
|
//#endregion
|
|
2271
2336
|
//#region src/web-api/helpers/utils/date-utils.ts
|
|
2272
|
-
function
|
|
2337
|
+
function xi(e) {
|
|
2273
2338
|
if (!e) return;
|
|
2274
2339
|
let t = new Date(e);
|
|
2275
2340
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
2276
2341
|
}
|
|
2277
|
-
function
|
|
2278
|
-
let t =
|
|
2342
|
+
function Si(e) {
|
|
2343
|
+
let t = xi(e);
|
|
2279
2344
|
return !!t && t.getTime() <= Date.now();
|
|
2280
2345
|
}
|
|
2281
|
-
function
|
|
2282
|
-
let n =
|
|
2346
|
+
function Ci(e, t = 7) {
|
|
2347
|
+
let n = xi(e);
|
|
2283
2348
|
if (!n) return !1;
|
|
2284
2349
|
let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
|
|
2285
2350
|
return a > r && a <= i;
|
|
2286
2351
|
}
|
|
2287
2352
|
//#endregion
|
|
2288
2353
|
//#region src/web-api/helpers/utils/with-retry.ts
|
|
2289
|
-
async function
|
|
2354
|
+
async function wi(e, t = 0, n = 1e3) {
|
|
2290
2355
|
let r;
|
|
2291
2356
|
for (let i = 0; i <= t; i++) try {
|
|
2292
2357
|
return await e();
|
|
2293
2358
|
} catch (e) {
|
|
2294
|
-
if (r = e, e instanceof
|
|
2359
|
+
if (r = e, e instanceof k && e.status >= 400 && e.status < 500 && e.status !== 429 || e instanceof DOMException && e.name === "AbortError") throw e;
|
|
2295
2360
|
i < t && (c(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
|
|
2296
2361
|
}
|
|
2297
2362
|
throw r;
|
|
2298
2363
|
}
|
|
2299
2364
|
//#endregion
|
|
2300
|
-
export {
|
|
2365
|
+
export { cr as $, ae as $n, Wt as $t, Ir as A, R as An, vn as At, Cr as B, je as Bn, q as Bt, ti as C, mt as Cn, Y as Ct, Pr as D, et as Dn, wn as Dt, Vr as E, tt as En, En as Et, Or as F, Ve as Fn, mn as Ft, _r as G, k as Gn, nn as Gt, yr as H, Ae as Hn, pn as Ht, Tr as I, Be as In, an as It, pr as J, De as Jn, $t as Jt, mr as K, Oe as Kn, K as Kt, Dr as L, I as Ln, on as Lt, Fr as M, qe as Mn, fn as Mt, jr as N, Ge as Nn, un as Nt, Lr as O, Ze as On, Cn as Ot, Nr as P, L as Pn, dn as Pt, or as Q, ue as Qn, Gt as Qt, wr as R, Ne as Rn, sn as Rt, Q as S, yt as Sn, On as St, $r as T, rt as Tn, Dn as Tt, hr as U, ke as Un, rn as Ut, xr as V, M as Vn, cn as Vt, br as W, A as Wn, tn as Wt, ur as X, de as Xn, G as Xt, gr as Y, Ee as Yn, Xt as Yt, lr as Z, h as Zn, Kt as Zt, si as _, jt as _n, zn as _t, bi as a, Ht as an, p as ar, er as at, ei as b, Tt as bn, In as bt, fi as c, Ft as cn, r as cr, Zn as ct, ui as d, Pt as dn, l as dr, qn as dt, W as en, m as er, sr as et, _i as f, V as fn, s as fr, Kn as ft, li as g, z as gn, Rn as gt, $ as h, Mt as hn, Hn as ht, xi as i, zt as in, re as ir, rr as it, zr as j, Je as jn, yn as jt, Rr as k, Ye as kn, J as kt, hi as l, It as ln, d as lr, Xn as lt, di as m, B as mn, n as mr, Wn as mt, Ci as n, H as nn, f as nr, nr as nt, vi as o, Vt as on, ee as or, $n as ot, mi as p, Nt as pn, c as pr, Gn as pt, vr as q, D as qn, en as qt, Si as r, Ut as rn, ne as rr, ir as rt, pi as s, Rt as sn, te as sr, Qn as st, wi as t, U as tn, ie as tr, ar as tt, gi as u, Lt as un, o as ur, Jn as ut, oi as v, kt as vn, Bn as vt, ni as w, it as wn, Tn as wt, ri as x, Ct as xn, Ln as xt, ii as y, Dt as yn, Vn as yt, Er as z, N as zn, ln as zt };
|