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