@sinequa/atomic 2.6.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 +4 -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-DWffZxoZ.js → src-C-nHTU3y.js} +704 -609
- package/dist/src-DMsETv6_.cjs +1 -0
- package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
- package/dist/types/api-endpoints.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts.map +1 -1
- package/dist/types/config/EngineTypeModifier.d.ts.map +1 -1
- package/dist/types/config/QueryPrecision.d.ts.map +1 -1
- package/dist/types/document-upload/index.d.ts +1 -0
- package/dist/types/document-upload/index.d.ts.map +1 -1
- package/dist/types/document-upload/upload-status.d.ts +56 -0
- package/dist/types/document-upload/upload-status.d.ts.map +1 -0
- 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/types/security-principal/security-principal.d.ts +6 -0
- package/dist/types/security-principal/security-principal.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/index.d.ts +1 -0
- package/dist/web-api/index.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 +18 -2
- 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 +17 -2
- 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 +23 -0
- package/dist/web-api/v2/fetch-document-upload-status.d.ts.map +1 -0
- 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-C_FBvs_m.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,30 +1649,41 @@ 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
|
-
|
|
1600
|
-
|
|
1661
|
+
var Yn = "api/v1/security.principal";
|
|
1662
|
+
function Xn(e, t, n = g) {
|
|
1663
|
+
return I(n, Yn, {
|
|
1664
|
+
action: "list",
|
|
1665
|
+
...e
|
|
1666
|
+
}, { signal: t });
|
|
1667
|
+
}
|
|
1668
|
+
async function Zn(e, t = g) {
|
|
1669
|
+
return e.length ? (await I(t, Yn, {
|
|
1670
|
+
action: "userids",
|
|
1671
|
+
userids: e,
|
|
1672
|
+
limit: e.length
|
|
1673
|
+
}))?.principals ?? [] : [];
|
|
1601
1674
|
}
|
|
1602
1675
|
//#endregion
|
|
1603
1676
|
//#region src/web-api/v1/fetch-similar-documents.ts
|
|
1604
|
-
async function
|
|
1605
|
-
return (await
|
|
1677
|
+
async function Qn(e, t, n, r = g) {
|
|
1678
|
+
return (await I(r, "api/v1/similardocuments", {
|
|
1606
1679
|
sourceDocumentId: e,
|
|
1607
1680
|
query: { name: t }
|
|
1608
1681
|
}, { signal: n })).data;
|
|
1609
1682
|
}
|
|
1610
1683
|
//#endregion
|
|
1611
1684
|
//#region src/web-api/v1/fetch-sponsored-links.ts
|
|
1612
|
-
async function
|
|
1613
|
-
return (await
|
|
1685
|
+
async function $n(e, t, n = g) {
|
|
1686
|
+
return (await I(n, "api/v1/query.links", {
|
|
1614
1687
|
webservice: e,
|
|
1615
1688
|
query: t
|
|
1616
1689
|
}))?.links?.map((e) => ({
|
|
@@ -1620,9 +1693,9 @@ async function Wn(e, t, n = g) {
|
|
|
1620
1693
|
}
|
|
1621
1694
|
//#endregion
|
|
1622
1695
|
//#region src/utils/to-sql.ts
|
|
1623
|
-
function
|
|
1696
|
+
function er(e, t) {
|
|
1624
1697
|
if (typeof e == "number") return `${e}`;
|
|
1625
|
-
if (
|
|
1698
|
+
if (sn(e)) return t ? `'${tr(e)}'` : tr(e);
|
|
1626
1699
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
1627
1700
|
if (e === null) return "null";
|
|
1628
1701
|
if (Array.isArray(e)) {
|
|
@@ -1633,10 +1706,10 @@ function Gn(e, t) {
|
|
|
1633
1706
|
}
|
|
1634
1707
|
return t ? `'${e}'` : e;
|
|
1635
1708
|
}
|
|
1636
|
-
function
|
|
1709
|
+
function tr(e) {
|
|
1637
1710
|
if (!e) return "";
|
|
1638
1711
|
try {
|
|
1639
|
-
return
|
|
1712
|
+
return un(e) === 0 ? new Intl.DateTimeFormat("en-CA", {
|
|
1640
1713
|
year: "numeric",
|
|
1641
1714
|
month: "2-digit",
|
|
1642
1715
|
day: "2-digit"
|
|
@@ -1652,7 +1725,7 @@ function Kn(e) {
|
|
|
1652
1725
|
}
|
|
1653
1726
|
//#endregion
|
|
1654
1727
|
//#region src/web-api/v1/fetch-suggest.ts
|
|
1655
|
-
async function
|
|
1728
|
+
async function nr(e, t, n, r, i, a = g) {
|
|
1656
1729
|
let { app: o } = a.config, s = {
|
|
1657
1730
|
app: o || "",
|
|
1658
1731
|
suggestQuery: e,
|
|
@@ -1662,14 +1735,14 @@ async function qn(e, t, n, r, i, a = g) {
|
|
|
1662
1735
|
showSource: i
|
|
1663
1736
|
};
|
|
1664
1737
|
try {
|
|
1665
|
-
return (await
|
|
1738
|
+
return (await I(a, "api/v1/search.suggest", s)).suggests;
|
|
1666
1739
|
} catch (e) {
|
|
1667
1740
|
throw console.error("Error fetching suggestions:", e), e;
|
|
1668
1741
|
}
|
|
1669
1742
|
}
|
|
1670
|
-
async function
|
|
1743
|
+
async function rr(e, t, n, r, i = g) {
|
|
1671
1744
|
let { app: a } = i.config;
|
|
1672
|
-
return (await
|
|
1745
|
+
return (await I(i, "api/v1/suggestquery", {
|
|
1673
1746
|
app: a || "",
|
|
1674
1747
|
suggestQuery: e,
|
|
1675
1748
|
text: t,
|
|
@@ -1677,22 +1750,22 @@ async function Jn(e, t, n, r, i = g) {
|
|
|
1677
1750
|
kinds: r
|
|
1678
1751
|
})).suggests;
|
|
1679
1752
|
}
|
|
1680
|
-
async function
|
|
1753
|
+
async function ir(e, t, n, r = g) {
|
|
1681
1754
|
if (!t) return Promise.resolve([]);
|
|
1682
|
-
let { app: i } = r.config, a = await
|
|
1755
|
+
let { app: i } = r.config, a = await I(r, "api/v1/suggestfield", {
|
|
1683
1756
|
app: i || "",
|
|
1684
1757
|
text: e,
|
|
1685
1758
|
fields: t,
|
|
1686
1759
|
query: n
|
|
1687
1760
|
});
|
|
1688
1761
|
return a.suggests.forEach((e) => {
|
|
1689
|
-
e.display =
|
|
1762
|
+
e.display = er(e.display);
|
|
1690
1763
|
}), a.suggests;
|
|
1691
1764
|
}
|
|
1692
1765
|
//#endregion
|
|
1693
1766
|
//#region src/web-api/v1/fetch-text-chunk.ts
|
|
1694
|
-
async function
|
|
1695
|
-
return
|
|
1767
|
+
async function ar(e, t, n, r, i, a, o = g) {
|
|
1768
|
+
return I(o, "api/v1/doc.textchunks", {
|
|
1696
1769
|
id: e,
|
|
1697
1770
|
textChunks: t,
|
|
1698
1771
|
highlights: n,
|
|
@@ -1703,233 +1776,252 @@ async function Xn(e, t, n, r, i, a, o = g) {
|
|
|
1703
1776
|
}
|
|
1704
1777
|
//#endregion
|
|
1705
1778
|
//#region src/web-api/v1/fetch-user-settings.ts
|
|
1706
|
-
async function
|
|
1779
|
+
async function or(e = g) {
|
|
1707
1780
|
let { app: t } = e.config;
|
|
1708
|
-
return
|
|
1781
|
+
return R(e, "api/v1/usersettings", new URLSearchParams({
|
|
1709
1782
|
app: t || "",
|
|
1710
1783
|
action: "load"
|
|
1711
1784
|
}));
|
|
1712
1785
|
}
|
|
1713
|
-
async function
|
|
1786
|
+
async function sr(e, t, n = g) {
|
|
1714
1787
|
let r = {
|
|
1715
1788
|
action: "save",
|
|
1716
1789
|
userSettings: e,
|
|
1717
1790
|
$auditRecord: { auditEvents: [t] }
|
|
1718
1791
|
};
|
|
1719
|
-
return
|
|
1792
|
+
return J(r), I(n, "api/v1/usersettings", r);
|
|
1720
1793
|
}
|
|
1721
|
-
async function
|
|
1794
|
+
async function cr(e, t, n = g) {
|
|
1722
1795
|
let r = {
|
|
1723
1796
|
action: "patch",
|
|
1724
1797
|
userSettings: e,
|
|
1725
1798
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1726
1799
|
};
|
|
1727
|
-
return
|
|
1800
|
+
return J(r), I(n, "api/v1/usersettings", r);
|
|
1728
1801
|
}
|
|
1729
|
-
async function
|
|
1730
|
-
return
|
|
1802
|
+
async function lr(e = g) {
|
|
1803
|
+
return sr({}, { type: "UserSettings_Reset" }, e);
|
|
1731
1804
|
}
|
|
1732
1805
|
//#endregion
|
|
1733
1806
|
//#region src/web-api/v2/fetch-change-password.ts
|
|
1734
|
-
async function
|
|
1735
|
-
return
|
|
1807
|
+
async function ur(e, t, n = g) {
|
|
1808
|
+
return I(n, "api/v2/security/password/change", {
|
|
1736
1809
|
newPassword: e,
|
|
1737
1810
|
currentPassword: t
|
|
1738
1811
|
});
|
|
1739
1812
|
}
|
|
1740
1813
|
//#endregion
|
|
1741
1814
|
//#region src/web-api/v2/fetch-document-upload-container.ts
|
|
1742
|
-
var
|
|
1743
|
-
function
|
|
1815
|
+
var X = "api/v2/document-upload/container";
|
|
1816
|
+
function dr(e) {
|
|
1744
1817
|
let t = new URLSearchParams();
|
|
1745
|
-
return e.page !== void 0 && t.set("
|
|
1818
|
+
return e.page !== void 0 && t.set("pageNumber", String(e.page)), e.pageSize !== void 0 && t.set("pageSize", String(e.pageSize)), t;
|
|
1819
|
+
}
|
|
1820
|
+
function fr(e) {
|
|
1821
|
+
let { pageNumber: t, ...n } = e;
|
|
1822
|
+
return {
|
|
1823
|
+
...n,
|
|
1824
|
+
page: t
|
|
1825
|
+
};
|
|
1746
1826
|
}
|
|
1747
|
-
function
|
|
1748
|
-
return
|
|
1827
|
+
async function pr(e = {}, t = g) {
|
|
1828
|
+
return fr(await R(t, X, dr(e)));
|
|
1749
1829
|
}
|
|
1750
|
-
function
|
|
1751
|
-
return
|
|
1830
|
+
function mr(e, t = g) {
|
|
1831
|
+
return R(t, `${X}/${encodeURIComponent(e)}`);
|
|
1752
1832
|
}
|
|
1753
|
-
function
|
|
1754
|
-
return
|
|
1833
|
+
function hr(e, t = g) {
|
|
1834
|
+
return I(t, X, e);
|
|
1755
1835
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return
|
|
1836
|
+
function gr(e, t, n = g) {
|
|
1837
|
+
return V(n, `${X}/${encodeURIComponent(e)}`, t);
|
|
1758
1838
|
}
|
|
1759
|
-
async function
|
|
1760
|
-
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));
|
|
1761
1841
|
return {
|
|
1762
1842
|
succeeded: e.filter((e) => !r.has(e)),
|
|
1763
1843
|
failed: n
|
|
1764
1844
|
};
|
|
1765
1845
|
}
|
|
1766
|
-
function
|
|
1767
|
-
return
|
|
1846
|
+
async function vr(e, t, n, r = g) {
|
|
1847
|
+
return fr(await R(r, `${X}/${encodeURIComponent(e)}/documents`, dr(t ?? {}), n));
|
|
1848
|
+
}
|
|
1849
|
+
async function yr(e, t, n = g) {
|
|
1850
|
+
return (await I(n, `${X}/${encodeURIComponent(e)}/documents`, { documents: t })).documents;
|
|
1768
1851
|
}
|
|
1769
|
-
function
|
|
1770
|
-
return
|
|
1852
|
+
function br(e, t, n = g) {
|
|
1853
|
+
return z(n, `${X}/${encodeURIComponent(e)}/documents`, void 0, { body: { fileIds: t } });
|
|
1854
|
+
}
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region src/web-api/v2/fetch-document-upload-status.ts
|
|
1857
|
+
async function xr(e, t, n = g) {
|
|
1858
|
+
let r = new URLSearchParams();
|
|
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);
|
|
1771
1860
|
}
|
|
1772
1861
|
//#endregion
|
|
1773
1862
|
//#region src/web-api/v2/fetch-forgot-password.ts
|
|
1774
|
-
function
|
|
1863
|
+
function Sr() {
|
|
1775
1864
|
return typeof window > "u" ? void 0 : `${window.location.origin}/login?mode=changepassword`;
|
|
1776
1865
|
}
|
|
1777
|
-
async function
|
|
1778
|
-
let r = t ??
|
|
1866
|
+
async function Cr(e, t, n = g) {
|
|
1867
|
+
let r = t ?? Sr();
|
|
1779
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.");
|
|
1780
|
-
return
|
|
1869
|
+
return I(n, "api/v2/security/password/ask-reset-email", {
|
|
1781
1870
|
changePasswordRedirectUrl: r,
|
|
1782
1871
|
userName: e
|
|
1783
1872
|
});
|
|
1784
1873
|
}
|
|
1785
1874
|
//#endregion
|
|
1786
1875
|
//#region src/web-api/v2/fetch-user-profile.ts
|
|
1787
|
-
async function
|
|
1788
|
-
return await
|
|
1876
|
+
async function wr(e, t = g) {
|
|
1877
|
+
return await R(t, `api/v2/user-profile/${e}`);
|
|
1789
1878
|
}
|
|
1790
|
-
async function
|
|
1791
|
-
return await
|
|
1879
|
+
async function Tr(e, t = g) {
|
|
1880
|
+
return await I(t, "api/v2/user-profile", e);
|
|
1792
1881
|
}
|
|
1793
|
-
async function
|
|
1794
|
-
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);
|
|
1795
1884
|
}
|
|
1796
|
-
async function
|
|
1797
|
-
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;
|
|
1798
1887
|
}
|
|
1799
1888
|
//#endregion
|
|
1800
1889
|
//#region src/web-api/v2/fetch-version.ts
|
|
1801
|
-
async function
|
|
1802
|
-
return await
|
|
1890
|
+
async function Or(e = g) {
|
|
1891
|
+
return await R(e, "api/v2/version");
|
|
1803
1892
|
}
|
|
1804
1893
|
//#endregion
|
|
1805
1894
|
//#region src/client/create-api.ts
|
|
1806
|
-
var
|
|
1895
|
+
var Z = (e, t) => (...n) => {
|
|
1807
1896
|
let r = Array(Math.max(0, e.length - n.length)).fill(void 0);
|
|
1808
1897
|
return e(...n, ...r, t);
|
|
1809
1898
|
};
|
|
1810
|
-
function
|
|
1899
|
+
function kr(e) {
|
|
1811
1900
|
return {
|
|
1812
1901
|
app: {
|
|
1813
|
-
get:
|
|
1814
|
-
preLogin:
|
|
1902
|
+
get: Z(Ft, e),
|
|
1903
|
+
preLogin: Z(It, e)
|
|
1815
1904
|
},
|
|
1816
1905
|
principal: {
|
|
1817
|
-
get:
|
|
1818
|
-
list:
|
|
1819
|
-
userid:
|
|
1820
|
-
userids:
|
|
1821
|
-
search:
|
|
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)
|
|
1822
1912
|
},
|
|
1823
1913
|
query: {
|
|
1824
|
-
search:
|
|
1825
|
-
bulk:
|
|
1826
|
-
intent:
|
|
1827
|
-
export:
|
|
1828
|
-
aggregate:
|
|
1829
|
-
sponsoredLinks:
|
|
1830
|
-
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)
|
|
1831
1921
|
},
|
|
1832
1922
|
suggest: {
|
|
1833
|
-
get:
|
|
1834
|
-
query:
|
|
1835
|
-
field:
|
|
1923
|
+
get: Z(nr, e),
|
|
1924
|
+
query: Z(rr, e),
|
|
1925
|
+
field: Z(ir, e)
|
|
1836
1926
|
},
|
|
1837
1927
|
preview: {
|
|
1838
|
-
get:
|
|
1839
|
-
textChunks:
|
|
1928
|
+
get: Z(In, e),
|
|
1929
|
+
textChunks: Z(ar, e)
|
|
1840
1930
|
},
|
|
1841
1931
|
labels: {
|
|
1842
|
-
get:
|
|
1843
|
-
rights: Y
|
|
1844
|
-
add: Y
|
|
1845
|
-
remove: Y
|
|
1846
|
-
rename: Y
|
|
1847
|
-
delete: Y
|
|
1848
|
-
bulkAdd: Y
|
|
1849
|
-
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)
|
|
1850
1940
|
},
|
|
1851
1941
|
dataset: {
|
|
1852
|
-
get:
|
|
1853
|
-
getMany:
|
|
1854
|
-
list:
|
|
1942
|
+
get: Z(Tn, e),
|
|
1943
|
+
getMany: Z(En, e),
|
|
1944
|
+
list: Z(Dn, e)
|
|
1855
1945
|
},
|
|
1856
1946
|
userSettings: {
|
|
1857
|
-
get:
|
|
1858
|
-
save:
|
|
1859
|
-
patch:
|
|
1860
|
-
reset:
|
|
1947
|
+
get: Z(or, e),
|
|
1948
|
+
save: Z(sr, e),
|
|
1949
|
+
patch: Z(cr, e),
|
|
1950
|
+
reset: Z(lr, e)
|
|
1861
1951
|
},
|
|
1862
1952
|
userProfile: {
|
|
1863
|
-
get:
|
|
1864
|
-
create:
|
|
1865
|
-
patch:
|
|
1866
|
-
deleteProperty:
|
|
1953
|
+
get: Z(wr, e),
|
|
1954
|
+
create: Z(Tr, e),
|
|
1955
|
+
patch: Z(Er, e),
|
|
1956
|
+
deleteProperty: Z(Dr, e)
|
|
1867
1957
|
},
|
|
1868
1958
|
containers: {
|
|
1869
|
-
list:
|
|
1870
|
-
get:
|
|
1871
|
-
create:
|
|
1872
|
-
update:
|
|
1873
|
-
delete:
|
|
1874
|
-
listDocuments:
|
|
1875
|
-
|
|
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)
|
|
1876
1968
|
},
|
|
1877
1969
|
password: {
|
|
1878
|
-
change:
|
|
1879
|
-
sendResetEmail:
|
|
1970
|
+
change: Z(ur, e),
|
|
1971
|
+
sendResetEmail: Z(Cr, e)
|
|
1880
1972
|
},
|
|
1881
|
-
version:
|
|
1973
|
+
version: Z(Or, e)
|
|
1882
1974
|
};
|
|
1883
1975
|
}
|
|
1884
1976
|
//#endregion
|
|
1885
1977
|
//#region src/client/create-atomic-client.ts
|
|
1886
|
-
function
|
|
1978
|
+
function Ar(e) {
|
|
1887
1979
|
return {
|
|
1888
1980
|
config: e.config,
|
|
1889
1981
|
storagePrefix: e.storagePrefix,
|
|
1890
1982
|
configure: (t) => b(e, t),
|
|
1891
|
-
initializeConfig: () =>
|
|
1983
|
+
initializeConfig: () => Lt(e),
|
|
1892
1984
|
auth: {
|
|
1893
|
-
login: (t) =>
|
|
1894
|
-
logout: () =>
|
|
1895
|
-
isAuthenticated: () =>
|
|
1896
|
-
hasSession: () =>
|
|
1897
|
-
isRedirectPending: () =>
|
|
1898
|
-
clearSession: () =>
|
|
1899
|
-
getToken: () =>
|
|
1900
|
-
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),
|
|
1901
1993
|
on: (t, n) => e.events.on(t, n)
|
|
1902
1994
|
},
|
|
1903
1995
|
http: {
|
|
1904
|
-
get: (t, n, r) =>
|
|
1905
|
-
post: (t, n, r) =>
|
|
1906
|
-
put: (t, n, r) =>
|
|
1907
|
-
patch: (t, n, r) =>
|
|
1908
|
-
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)
|
|
1909
2001
|
},
|
|
1910
|
-
api:
|
|
2002
|
+
api: kr(e),
|
|
1911
2003
|
context: e
|
|
1912
2004
|
};
|
|
1913
2005
|
}
|
|
1914
|
-
function
|
|
2006
|
+
function jr(e) {
|
|
1915
2007
|
let { httpAdapter: t, storagePrefix: n, ...r } = e, i = pe({
|
|
1916
2008
|
config: {},
|
|
1917
2009
|
storagePrefix: n,
|
|
1918
2010
|
httpAdapter: t
|
|
1919
2011
|
});
|
|
1920
|
-
return b(i, r),
|
|
2012
|
+
return b(i, r), Ar(i);
|
|
1921
2013
|
}
|
|
1922
|
-
var
|
|
1923
|
-
function
|
|
1924
|
-
return
|
|
2014
|
+
var Mr = Ar(g);
|
|
2015
|
+
function Nr() {
|
|
2016
|
+
return Mr;
|
|
1925
2017
|
}
|
|
1926
2018
|
//#endregion
|
|
1927
2019
|
//#region src/utils/aggregations.ts
|
|
1928
|
-
var
|
|
1929
|
-
function
|
|
2020
|
+
var Pr = /.*:\(?([><=\d\-.AND ]+)\)?/;
|
|
2021
|
+
function Fr(e, t) {
|
|
1930
2022
|
return !e?.items || e?.items?.length === 0 ? [] : e.items.reduce((n, r) => {
|
|
1931
2023
|
if (!r.value || r.value === "") return n;
|
|
1932
|
-
let i =
|
|
2024
|
+
let i = Ir(r, e.column);
|
|
1933
2025
|
return n.push({
|
|
1934
2026
|
operator: i.operator,
|
|
1935
2027
|
value: i.value,
|
|
@@ -1940,15 +2032,18 @@ function Cr(e, t) {
|
|
|
1940
2032
|
}), n;
|
|
1941
2033
|
}, []);
|
|
1942
2034
|
}
|
|
1943
|
-
function
|
|
1944
|
-
let n = t, r = e.value.match(
|
|
2035
|
+
function Ir(e, t) {
|
|
2036
|
+
let n = t, r = e.value.match(Pr);
|
|
1945
2037
|
if (r?.[1]) {
|
|
1946
|
-
let t = (r?.[1].split(" AND ")).map((t) =>
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
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
|
+
});
|
|
1952
2047
|
if (t.length === 2) return {
|
|
1953
2048
|
field: n,
|
|
1954
2049
|
operator: "and",
|
|
@@ -1969,26 +2064,26 @@ function wr(e, t) {
|
|
|
1969
2064
|
display: e.display
|
|
1970
2065
|
};
|
|
1971
2066
|
}
|
|
1972
|
-
function
|
|
2067
|
+
function Lr(e, t, n) {
|
|
1973
2068
|
return e.valuesAreExpressions ? t.display === n.display : t.value === n.value;
|
|
1974
2069
|
}
|
|
1975
|
-
function
|
|
1976
|
-
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;
|
|
1977
2072
|
}
|
|
1978
|
-
function
|
|
2073
|
+
function zr(e, t) {
|
|
1979
2074
|
let n = [];
|
|
1980
2075
|
if (e.length > 0) {
|
|
1981
2076
|
let r = /* @__PURE__ */ new Map(), i = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), a = RegExp(`\\b${i}`, "i");
|
|
1982
2077
|
e.forEach((e) => {
|
|
1983
2078
|
if (e.display.length > 1) {
|
|
1984
2079
|
let i = e.display.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), o = a.exec(i);
|
|
1985
|
-
|
|
2080
|
+
Br(n, r, "/", e.display, +(e.frequency || 0), 1, (o?.index || 0) + t.length);
|
|
1986
2081
|
}
|
|
1987
2082
|
});
|
|
1988
2083
|
}
|
|
1989
2084
|
return n;
|
|
1990
2085
|
}
|
|
1991
|
-
function
|
|
2086
|
+
function Br(e, t, n, r, i, a, o) {
|
|
1992
2087
|
let s = r.indexOf("/", n.length), c = r.substring(0, s + 1), l = t.get(c);
|
|
1993
2088
|
if (!l) {
|
|
1994
2089
|
let u = c.replace(/^\/|\/$/g, "");
|
|
@@ -2002,11 +2097,11 @@ function Or(e, t, n, r, i, a, o) {
|
|
|
2002
2097
|
$path: u
|
|
2003
2098
|
}, t.set(c, l), e.push(l);
|
|
2004
2099
|
}
|
|
2005
|
-
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));
|
|
2006
2101
|
}
|
|
2007
2102
|
//#endregion
|
|
2008
2103
|
//#region src/utils/bisect.ts
|
|
2009
|
-
function
|
|
2104
|
+
function Vr(e, t) {
|
|
2010
2105
|
return e.reduce((e, n) => (t(n) ? e.true.push(n) : e.false.push(n), e), {
|
|
2011
2106
|
true: [],
|
|
2012
2107
|
false: []
|
|
@@ -2014,34 +2109,34 @@ function kr(e, t) {
|
|
|
2014
2109
|
}
|
|
2015
2110
|
//#endregion
|
|
2016
2111
|
//#region src/utils/concepts.ts
|
|
2017
|
-
var
|
|
2018
|
-
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) {
|
|
2019
2114
|
if (!e) return [];
|
|
2020
|
-
let t = [], n = e.matchAll(
|
|
2021
|
-
for (let e of n) e[
|
|
2115
|
+
let t = [], n = e.matchAll(Hr);
|
|
2116
|
+
for (let e of n) e[Wr] ? t.push({
|
|
2022
2117
|
type: "group",
|
|
2023
|
-
value: e[
|
|
2024
|
-
op: e[
|
|
2025
|
-
}) : e[
|
|
2118
|
+
value: e[Wr],
|
|
2119
|
+
op: e[Ur]
|
|
2120
|
+
}) : e[Kr] ? t.push({
|
|
2026
2121
|
type: "adjacent",
|
|
2027
|
-
value: e[
|
|
2028
|
-
op: e[
|
|
2029
|
-
}) : e[
|
|
2122
|
+
value: e[Kr],
|
|
2123
|
+
op: e[Gr]
|
|
2124
|
+
}) : e[Jr] ? t.push({
|
|
2030
2125
|
type: "exact",
|
|
2031
|
-
value: e[
|
|
2032
|
-
op: e[
|
|
2033
|
-
}) : e[
|
|
2126
|
+
value: e[Jr],
|
|
2127
|
+
op: e[qr]
|
|
2128
|
+
}) : e[Xr] ? t.push({
|
|
2034
2129
|
type: "regex",
|
|
2035
|
-
value: e[
|
|
2036
|
-
op: e[
|
|
2037
|
-
}) : e[
|
|
2130
|
+
value: e[Xr],
|
|
2131
|
+
op: e[Yr]
|
|
2132
|
+
}) : e[Qr] && t.push({
|
|
2038
2133
|
type: "token",
|
|
2039
|
-
value: e[
|
|
2040
|
-
op: e[
|
|
2134
|
+
value: e[Qr],
|
|
2135
|
+
op: e[Zr]
|
|
2041
2136
|
});
|
|
2042
2137
|
return t;
|
|
2043
2138
|
}
|
|
2044
|
-
function
|
|
2139
|
+
function $r(e) {
|
|
2045
2140
|
return e.map((e) => {
|
|
2046
2141
|
let t = e.op || "";
|
|
2047
2142
|
switch (e.type) {
|
|
@@ -2054,39 +2149,39 @@ function Z(e) {
|
|
|
2054
2149
|
}
|
|
2055
2150
|
}).join(" ");
|
|
2056
2151
|
}
|
|
2057
|
-
function
|
|
2058
|
-
let r =
|
|
2152
|
+
function ei(e, t, n) {
|
|
2153
|
+
let r = Q(e);
|
|
2059
2154
|
for (let e of t) r.push({
|
|
2060
2155
|
type: "adjacent",
|
|
2061
2156
|
value: e,
|
|
2062
2157
|
op: n
|
|
2063
2158
|
});
|
|
2064
|
-
return
|
|
2159
|
+
return $r(r);
|
|
2065
2160
|
}
|
|
2066
|
-
function
|
|
2067
|
-
let n =
|
|
2068
|
-
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));
|
|
2069
2164
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return
|
|
2165
|
+
function ni(e) {
|
|
2166
|
+
return $r(Q(e).filter((e) => e.type !== "adjacent"));
|
|
2072
2167
|
}
|
|
2073
|
-
function
|
|
2074
|
-
return
|
|
2168
|
+
function ri(e) {
|
|
2169
|
+
return Q(e).filter((e) => e.type === "adjacent").map((e) => e.value);
|
|
2075
2170
|
}
|
|
2076
2171
|
//#endregion
|
|
2077
2172
|
//#region src/utils/date.ts
|
|
2078
|
-
function
|
|
2079
|
-
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);
|
|
2080
2175
|
return r.format(i * (o ? 1 : -1), a);
|
|
2081
2176
|
}
|
|
2082
|
-
var
|
|
2177
|
+
var ai = [
|
|
2083
2178
|
["year", 365],
|
|
2084
2179
|
["month", 30],
|
|
2085
2180
|
["week", 7],
|
|
2086
2181
|
["day", 1]
|
|
2087
2182
|
];
|
|
2088
|
-
function
|
|
2089
|
-
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];
|
|
2090
2185
|
return {
|
|
2091
2186
|
offset: Math.floor(a / s),
|
|
2092
2187
|
unit: o,
|
|
@@ -2095,13 +2190,13 @@ function qr(e, t) {
|
|
|
2095
2190
|
}
|
|
2096
2191
|
//#endregion
|
|
2097
2192
|
//#region src/utils/is-not-input-event.ts
|
|
2098
|
-
function
|
|
2193
|
+
function si(e) {
|
|
2099
2194
|
let t = e.target;
|
|
2100
2195
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
2101
2196
|
}
|
|
2102
2197
|
//#endregion
|
|
2103
2198
|
//#region src/utils/notification.ts
|
|
2104
|
-
function
|
|
2199
|
+
function ci(e) {
|
|
2105
2200
|
let t = new CustomEvent("notification", {
|
|
2106
2201
|
bubbles: !0,
|
|
2107
2202
|
cancelable: !1,
|
|
@@ -2109,30 +2204,30 @@ function Q(e) {
|
|
|
2109
2204
|
});
|
|
2110
2205
|
dispatchEvent(t);
|
|
2111
2206
|
}
|
|
2112
|
-
var
|
|
2207
|
+
var li = {
|
|
2113
2208
|
success: (e, t) => {
|
|
2114
|
-
|
|
2209
|
+
ci({
|
|
2115
2210
|
type: "success",
|
|
2116
2211
|
message: e,
|
|
2117
2212
|
options: t
|
|
2118
2213
|
});
|
|
2119
2214
|
},
|
|
2120
2215
|
info: (e, t) => {
|
|
2121
|
-
|
|
2216
|
+
ci({
|
|
2122
2217
|
type: "info",
|
|
2123
2218
|
message: e,
|
|
2124
2219
|
options: t
|
|
2125
2220
|
});
|
|
2126
2221
|
},
|
|
2127
2222
|
warning: (e, t) => {
|
|
2128
|
-
|
|
2223
|
+
ci({
|
|
2129
2224
|
type: "warning",
|
|
2130
2225
|
message: e,
|
|
2131
2226
|
options: t
|
|
2132
2227
|
});
|
|
2133
2228
|
},
|
|
2134
2229
|
error: (e, t) => {
|
|
2135
|
-
|
|
2230
|
+
ci({
|
|
2136
2231
|
type: "error",
|
|
2137
2232
|
message: e,
|
|
2138
2233
|
options: t
|
|
@@ -2141,13 +2236,13 @@ var Yr = {
|
|
|
2141
2236
|
};
|
|
2142
2237
|
//#endregion
|
|
2143
2238
|
//#region src/utils/query-params.ts
|
|
2144
|
-
function
|
|
2239
|
+
function ui(e) {
|
|
2145
2240
|
if (e === void 0) return;
|
|
2146
2241
|
let { q: t, f: n, p: r, s: i, t: a, n: o, b: s } = $(e), [c] = e.split("?");
|
|
2147
2242
|
return {
|
|
2148
2243
|
path: c,
|
|
2149
2244
|
text: t,
|
|
2150
|
-
filters: n ?
|
|
2245
|
+
filters: n ? pi(n) : void 0,
|
|
2151
2246
|
page: r ? parseInt(r, 10) : void 0,
|
|
2152
2247
|
sort: i,
|
|
2153
2248
|
tab: a,
|
|
@@ -2155,17 +2250,17 @@ function Xr(e) {
|
|
|
2155
2250
|
basket: s
|
|
2156
2251
|
};
|
|
2157
2252
|
}
|
|
2158
|
-
function
|
|
2253
|
+
function di(e) {
|
|
2159
2254
|
if (!e) return "";
|
|
2160
2255
|
let { text: t, filters: n, page: r, sort: i, tab: a, name: o, basket: s } = e, c = {};
|
|
2161
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() || "";
|
|
2162
2257
|
}
|
|
2163
|
-
function
|
|
2258
|
+
function fi(e) {
|
|
2164
2259
|
if (e === void 0) return [];
|
|
2165
2260
|
let { f: t } = $(e);
|
|
2166
|
-
return
|
|
2261
|
+
return pi(t);
|
|
2167
2262
|
}
|
|
2168
|
-
function
|
|
2263
|
+
function pi(e) {
|
|
2169
2264
|
let t = decodeURIComponent(e);
|
|
2170
2265
|
try {
|
|
2171
2266
|
return JSON.parse(t ?? "[]");
|
|
@@ -2179,41 +2274,41 @@ function $(e) {
|
|
|
2179
2274
|
let n = new URLSearchParams(t);
|
|
2180
2275
|
return Object.fromEntries(n);
|
|
2181
2276
|
}
|
|
2182
|
-
function
|
|
2277
|
+
function mi(e) {
|
|
2183
2278
|
let { q: t = "" } = $(e);
|
|
2184
2279
|
return t;
|
|
2185
2280
|
}
|
|
2186
|
-
function
|
|
2281
|
+
function hi(e) {
|
|
2187
2282
|
let { id: t } = $(e);
|
|
2188
2283
|
return t === void 0 ? void 0 : decodeURIComponent(t);
|
|
2189
2284
|
}
|
|
2190
|
-
function
|
|
2285
|
+
function gi(e) {
|
|
2191
2286
|
let { p: t = "0" } = $(e);
|
|
2192
2287
|
return parseInt(t, 10);
|
|
2193
2288
|
}
|
|
2194
|
-
function
|
|
2289
|
+
function _i(e) {
|
|
2195
2290
|
let { t } = $(e);
|
|
2196
2291
|
return t;
|
|
2197
2292
|
}
|
|
2198
2293
|
//#endregion
|
|
2199
2294
|
//#region src/utils/syslang.ts
|
|
2200
|
-
function
|
|
2295
|
+
function vi(e, t) {
|
|
2201
2296
|
if (!e) return e;
|
|
2202
2297
|
let n = 0, r = e.length, i = 0;
|
|
2203
2298
|
if (e[i] === "[") {
|
|
2204
2299
|
for (; i < r && /[0-9]/.test(e[i]);) i++;
|
|
2205
2300
|
e[i] === "]" && (n = i + 1);
|
|
2206
2301
|
}
|
|
2207
|
-
let a =
|
|
2302
|
+
let a = yi(e, n, !1);
|
|
2208
2303
|
if (!a) return e;
|
|
2209
2304
|
let o = t.charCodeAt(0), s = t.charCodeAt(1), c = a;
|
|
2210
2305
|
for (; c;) if (o === c.lang1 && s === c.lang2) {
|
|
2211
|
-
let t =
|
|
2306
|
+
let t = yi(e, c.end + 4, !0);
|
|
2212
2307
|
return e.substring(t.start, t.end);
|
|
2213
|
-
} else c =
|
|
2308
|
+
} else c = yi(e, c.end + 4, !1);
|
|
2214
2309
|
return e.substring(a.start, a.end) || e;
|
|
2215
2310
|
}
|
|
2216
|
-
function
|
|
2311
|
+
function yi(e, t, n) {
|
|
2217
2312
|
for (let n = t, r = e.length - 3; n < r; n++) if (e[n] === "[" && e[n + 3] === "]") return {
|
|
2218
2313
|
start: t,
|
|
2219
2314
|
end: n,
|
|
@@ -2229,7 +2324,7 @@ function ai(e, t, n) {
|
|
|
2229
2324
|
}
|
|
2230
2325
|
//#endregion
|
|
2231
2326
|
//#region src/utils/utilities.ts
|
|
2232
|
-
function
|
|
2327
|
+
function bi(e, t) {
|
|
2233
2328
|
let { useLocale: n, useLocaleAsPrefix: r, indexFile: i, path: a, folder: o } = t, s = n ? `${e}/` : null, c = r ? `${e}.${i}` : i ?? "";
|
|
2234
2329
|
return [
|
|
2235
2330
|
a,
|
|
@@ -2239,32 +2334,32 @@ function oi(e, t) {
|
|
|
2239
2334
|
}
|
|
2240
2335
|
//#endregion
|
|
2241
2336
|
//#region src/web-api/helpers/utils/date-utils.ts
|
|
2242
|
-
function
|
|
2337
|
+
function xi(e) {
|
|
2243
2338
|
if (!e) return;
|
|
2244
2339
|
let t = new Date(e);
|
|
2245
2340
|
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
2246
2341
|
}
|
|
2247
|
-
function
|
|
2248
|
-
let t =
|
|
2342
|
+
function Si(e) {
|
|
2343
|
+
let t = xi(e);
|
|
2249
2344
|
return !!t && t.getTime() <= Date.now();
|
|
2250
2345
|
}
|
|
2251
|
-
function
|
|
2252
|
-
let n =
|
|
2346
|
+
function Ci(e, t = 7) {
|
|
2347
|
+
let n = xi(e);
|
|
2253
2348
|
if (!n) return !1;
|
|
2254
2349
|
let r = Date.now(), i = r + t * 24 * 60 * 60 * 1e3, a = n.getTime();
|
|
2255
2350
|
return a > r && a <= i;
|
|
2256
2351
|
}
|
|
2257
2352
|
//#endregion
|
|
2258
2353
|
//#region src/web-api/helpers/utils/with-retry.ts
|
|
2259
|
-
async function
|
|
2354
|
+
async function wi(e, t = 0, n = 1e3) {
|
|
2260
2355
|
let r;
|
|
2261
2356
|
for (let i = 0; i <= t; i++) try {
|
|
2262
2357
|
return await e();
|
|
2263
2358
|
} catch (e) {
|
|
2264
|
-
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;
|
|
2265
2360
|
i < t && (c(`Retrying request (${i + 1}/${t})`, { error: e }), await new Promise((e) => setTimeout(e, n)));
|
|
2266
2361
|
}
|
|
2267
2362
|
throw r;
|
|
2268
2363
|
}
|
|
2269
2364
|
//#endregion
|
|
2270
|
-
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 };
|