@sinequa/atomic 0.0.124 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -36
- package/dist/atomic.js +694 -618
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/helpers/metadata.d.ts +32 -0
- package/dist/helpers/metadata.d.ts.map +1 -1
- package/dist/types/aggregations/AggregationItem.d.ts +4 -0
- package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
- package/dist/types/principal/Principal.d.ts +2 -0
- package/dist/types/principal/Principal.d.ts.map +1 -1
- package/dist/utils/notification.d.ts +6 -1
- package/dist/utils/notification.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts +1 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/dist/web-api/helpers/index.d.ts +9 -8
- package/dist/web-api/helpers/index.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/date-utils..d.ts +14 -0
- package/dist/web-api/helpers/utils/date-utils..d.ts.map +1 -0
- package/dist/web-api/index.d.ts +4 -2
- package/dist/web-api/index.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts +12 -2
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts +11 -0
- package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/atomic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var le = (e, t, r) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Y = (e, t, r) => le(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
function w(e) {
|
|
5
5
|
const t = new CustomEvent("authenticated", {
|
|
6
6
|
bubbles: !0,
|
|
@@ -13,316 +13,43 @@ const d = {
|
|
|
13
13
|
loginPath: "/login",
|
|
14
14
|
createRoutes: !1
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function k(e) {
|
|
17
17
|
Object.assign(d, e);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let f;
|
|
25
|
-
l && (f = t.queries[l]);
|
|
26
|
-
const N = (i = ((s = f == null ? void 0 : f.columnsInfo) == null ? void 0 : s.columns) || []) == null ? void 0 : i.find((F) => {
|
|
27
|
-
var J, W;
|
|
28
|
-
return (W = (J = F.aliases) == null ? void 0 : J.split(",")) == null ? void 0 : W.includes(e);
|
|
29
|
-
});
|
|
30
|
-
if (N) return N.name;
|
|
31
|
-
}
|
|
32
|
-
const n = (c = (o = t.indexes) == null ? void 0 : o._) == null ? void 0 : c.columns, a = Object.entries(n).find((l) => {
|
|
33
|
-
var f;
|
|
34
|
-
return (f = l[1].aliases) == null ? void 0 : f.includes(e);
|
|
35
|
-
});
|
|
36
|
-
if (a) return a[0];
|
|
37
|
-
}
|
|
38
|
-
var v = /* @__PURE__ */ ((e) => (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))(v || {}), _ = /* @__PURE__ */ ((e) => (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))(_ || {}), S = /* @__PURE__ */ ((e) => (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))(S || {});
|
|
39
|
-
const nt = "1.0";
|
|
40
|
-
var ie = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(ie || {}), le = /* @__PURE__ */ ((e) => (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))(le || {});
|
|
41
|
-
function ue(e) {
|
|
42
|
-
if (!e)
|
|
43
|
-
return _.none;
|
|
44
|
-
switch (e.toLocaleLowerCase()) {
|
|
45
|
-
case "bool":
|
|
46
|
-
case "boolean":
|
|
47
|
-
return _.bool;
|
|
48
|
-
case "date":
|
|
49
|
-
return _.date;
|
|
50
|
-
case "datetime":
|
|
51
|
-
return _.dateTime;
|
|
52
|
-
case "time":
|
|
53
|
-
return _.time;
|
|
54
|
-
case "unsigned":
|
|
55
|
-
return _.unsigned;
|
|
56
|
-
case "integer":
|
|
57
|
-
return _.integer;
|
|
58
|
-
case "float":
|
|
59
|
-
return _.float;
|
|
60
|
-
case "double":
|
|
61
|
-
return _.double;
|
|
62
|
-
case "dates":
|
|
63
|
-
return _.dates;
|
|
64
|
-
case "datetimes":
|
|
65
|
-
return _.dateTimes;
|
|
66
|
-
case "times":
|
|
67
|
-
return _.times;
|
|
68
|
-
case "varchar":
|
|
69
|
-
return _.varchar;
|
|
70
|
-
case "binary":
|
|
71
|
-
return _.binary;
|
|
72
|
-
case "string":
|
|
73
|
-
return _.string;
|
|
74
|
-
case "csv":
|
|
75
|
-
return _.csv;
|
|
76
|
-
default:
|
|
77
|
-
return _.none;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function de(e) {
|
|
81
|
-
switch (e) {
|
|
82
|
-
case "a":
|
|
83
|
-
return S.a;
|
|
84
|
-
case "c":
|
|
85
|
-
return S.c;
|
|
86
|
-
case "d":
|
|
87
|
-
return S.d;
|
|
88
|
-
case "e":
|
|
89
|
-
return S.e;
|
|
90
|
-
case "i":
|
|
91
|
-
return S.i;
|
|
92
|
-
case "l":
|
|
93
|
-
return S.l;
|
|
94
|
-
case "n":
|
|
95
|
-
return S.n;
|
|
96
|
-
case "t":
|
|
97
|
-
return S.t;
|
|
98
|
-
case "x":
|
|
99
|
-
return S.x;
|
|
100
|
-
case "z":
|
|
101
|
-
return S.z;
|
|
102
|
-
default:
|
|
103
|
-
return S.none;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function fe(e) {
|
|
107
|
-
let t = S.none;
|
|
108
|
-
if (e)
|
|
109
|
-
for (const r of e)
|
|
110
|
-
t |= de(r);
|
|
111
|
-
return t;
|
|
112
|
-
}
|
|
113
|
-
function m(e, t, r, n) {
|
|
114
|
-
const a = ue(t), s = fe(r || "");
|
|
115
|
-
return {
|
|
116
|
-
name: e,
|
|
117
|
-
type: t,
|
|
118
|
-
typeModifier: r,
|
|
119
|
-
eType: a,
|
|
120
|
-
eTypeModifier: s,
|
|
121
|
-
aliases: n
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
const at = {
|
|
125
|
-
id: m("id", "string"),
|
|
126
|
-
text: m("text", "varchar"),
|
|
127
|
-
documentlanguages: m("documentlanguages", "csv", "ci", ["language"]),
|
|
128
|
-
databasealias: m("databasealias", "varchar"),
|
|
129
|
-
globalrelevance: m("globalrelevance", "double"),
|
|
130
|
-
matchingpartnames: m("matchingpartnames", "csv"),
|
|
131
|
-
matchlocations: m("matchlocations", "csv"),
|
|
132
|
-
matchlocationsperpartname: m("matchlocationsperpartname", "varchar"),
|
|
133
|
-
// json
|
|
134
|
-
extracts: m("extracts", "csv"),
|
|
135
|
-
extractsperpartname: m("extractsperpartname", "varchar"),
|
|
136
|
-
// json
|
|
137
|
-
extractslocations: m("extractslocations", "csv"),
|
|
138
|
-
documentweight: m("documentweight", "varchar"),
|
|
139
|
-
groupcount: m("groupcount", "integer"),
|
|
140
|
-
accesslists: m("accesslists", "varchar", void 0, ["accessLists"])
|
|
141
|
-
// json
|
|
142
|
-
};
|
|
143
|
-
function st(e, t) {
|
|
144
|
-
const r = e[t];
|
|
145
|
-
return r === void 0 ? [] : Array.isArray(r) ? r.map((n) => {
|
|
146
|
-
if (typeof n == "string")
|
|
147
|
-
return n;
|
|
148
|
-
if (typeof n == "object" && n !== null && "display" in n)
|
|
149
|
-
return n.display;
|
|
150
|
-
}).filter((n) => n !== void 0) : [String(r)];
|
|
151
|
-
}
|
|
152
|
-
function I(e) {
|
|
153
|
-
return e !== null && typeof e == "object";
|
|
154
|
-
}
|
|
155
|
-
function he(e) {
|
|
156
|
-
return I(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
157
|
-
}
|
|
158
|
-
function _e(e) {
|
|
159
|
-
return I(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
160
|
-
}
|
|
161
|
-
function me(e) {
|
|
162
|
-
return typeof e == "string";
|
|
163
|
-
}
|
|
164
|
-
function ot(e) {
|
|
165
|
-
return (I(e) || Array.isArray(e)) && !he(e) && !_e(e) && !me(e);
|
|
166
|
-
}
|
|
167
|
-
function we(e = !0) {
|
|
168
|
-
let t = Date.now();
|
|
169
|
-
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
170
|
-
const a = (t + Math.random() * 16) % 16 | 0;
|
|
171
|
-
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
function ct(e) {
|
|
175
|
-
if (!e)
|
|
176
|
-
return "``";
|
|
177
|
-
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
178
|
-
return "`" + e + "`";
|
|
179
|
-
const t = ["`"];
|
|
180
|
-
for (let r = 0, n = e.length; r < n; r++) {
|
|
181
|
-
const a = e[r];
|
|
182
|
-
(a === "\\" || a === "`") && t.push("\\"), t.push(a);
|
|
183
|
-
}
|
|
184
|
-
return t.push("`"), t.join("");
|
|
185
|
-
}
|
|
186
|
-
function it(e) {
|
|
187
|
-
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
188
|
-
try {
|
|
189
|
-
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then((t) => Array.prototype.map.call(new Uint8Array(t), (r) => ("00" + r.toString(16)).slice(-2)).join("")).catch(() => Promise.resolve(B(e)));
|
|
190
|
-
} catch {
|
|
191
|
-
return Promise.resolve(B(e));
|
|
192
|
-
}
|
|
193
|
-
return Promise.resolve(B(e));
|
|
194
|
-
}
|
|
195
|
-
function B(e) {
|
|
196
|
-
let n = 2166136261;
|
|
197
|
-
for (let f = 0; f < e.length; f++)
|
|
198
|
-
n ^= e.charCodeAt(f), n = n * 16777619 >>> 0;
|
|
199
|
-
const a = n.toString(16).padStart(8, "0"), s = ((n ^ 2863311530) >>> 0).toString(16).padStart(8, "0"), i = ((n ^ 1431655765) >>> 0).toString(16).padStart(8, "0"), o = ((n ^ 3435973836) >>> 0).toString(16).padStart(8, "0"), c = a + s + i + o;
|
|
200
|
-
return (c + c + c + c).substring(0, 128);
|
|
19
|
+
function L(e) {
|
|
20
|
+
const t = W(), r = new Headers(e);
|
|
21
|
+
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
22
|
+
const { userOverride: n, userOverrideActive: a, bearerToken: s } = d;
|
|
23
|
+
return s && r.append("Authorization", `Bearer ${s}`), n && a && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
201
24
|
}
|
|
202
|
-
class
|
|
25
|
+
class b extends Error {
|
|
203
26
|
constructor(r, n) {
|
|
204
27
|
super(r);
|
|
205
|
-
|
|
28
|
+
Y(this, "status");
|
|
206
29
|
this.name = "ApiError", this.status = n;
|
|
207
30
|
}
|
|
208
31
|
}
|
|
209
|
-
class
|
|
210
|
-
constructor(t = "Unauthorized access") {
|
|
211
|
-
super(t, 401), this.name = "UnauthorizedError";
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
class Se extends p {
|
|
32
|
+
class K extends b {
|
|
215
33
|
constructor(t = "Server error") {
|
|
216
34
|
super(t, 500), this.name = "ServerError";
|
|
217
35
|
}
|
|
218
36
|
}
|
|
219
|
-
class
|
|
37
|
+
class ue extends b {
|
|
220
38
|
constructor(t = "Request timed out") {
|
|
221
39
|
super(t, 408), this.name = "TimeoutError";
|
|
222
40
|
}
|
|
223
41
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
r.aborted || t.abort(new ge(`Request timed out after ${e}ms`));
|
|
228
|
-
}, e), { controller: t, signal: r };
|
|
229
|
-
}
|
|
230
|
-
var te = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(te || {});
|
|
231
|
-
let y = {
|
|
232
|
-
level: 1,
|
|
233
|
-
enableConsoleOutput: !0
|
|
234
|
-
};
|
|
235
|
-
function ut(e) {
|
|
236
|
-
y = { ...y, ...e };
|
|
237
|
-
}
|
|
238
|
-
function D(e, t, r) {
|
|
239
|
-
if (e < y.level) return;
|
|
240
|
-
const a = `${`[${te[e]}]`} ${t}`;
|
|
241
|
-
if (y.enableConsoleOutput)
|
|
242
|
-
switch (e) {
|
|
243
|
-
case 0:
|
|
244
|
-
console.debug(a, r || "");
|
|
245
|
-
break;
|
|
246
|
-
case 1:
|
|
247
|
-
console.info(a, r || "");
|
|
248
|
-
break;
|
|
249
|
-
case 2:
|
|
250
|
-
console.warn(a, r || "");
|
|
251
|
-
break;
|
|
252
|
-
case 3:
|
|
253
|
-
console.error(a, r || "");
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
function R(e, t) {
|
|
258
|
-
D(0, e, t);
|
|
259
|
-
}
|
|
260
|
-
function g(e, t) {
|
|
261
|
-
D(1, e, t);
|
|
262
|
-
}
|
|
263
|
-
function L(e, t) {
|
|
264
|
-
D(2, e, t);
|
|
265
|
-
}
|
|
266
|
-
function h(e, t) {
|
|
267
|
-
D(3, e, t);
|
|
268
|
-
}
|
|
269
|
-
async function dt(e, t = 0, r = 1e3) {
|
|
270
|
-
let n;
|
|
271
|
-
for (let a = 0; a <= t; a++)
|
|
272
|
-
try {
|
|
273
|
-
return await e();
|
|
274
|
-
} catch (s) {
|
|
275
|
-
if (n = s, s instanceof p && s.status >= 400 && s.status < 500 && s.status !== 429 || s instanceof DOMException && s.name === "AbortError")
|
|
276
|
-
throw s;
|
|
277
|
-
a < t && (L(`Retrying request (${a + 1}/${t})`, { error: s }), await new Promise((i) => setTimeout(i, r)));
|
|
278
|
-
}
|
|
279
|
-
throw n;
|
|
280
|
-
}
|
|
281
|
-
function P(e) {
|
|
282
|
-
const t = H(), r = new Headers(e);
|
|
283
|
-
r.append("Sinequa-Force-Camel-Case", "true"), r.append("accept", "application/json"), t && r.append("Sinequa-csrf-token", t);
|
|
284
|
-
const { userOverride: n, userOverrideActive: a, bearerToken: s } = d;
|
|
285
|
-
return s && r.append("Authorization", `Bearer ${s}`), n && a && (r.append("sinequa-override-user", n.username), r.append("sinequa-override-domain", n.domain)), r;
|
|
286
|
-
}
|
|
287
|
-
async function C(e, t = "json") {
|
|
288
|
-
const r = e.headers.get("sinequa-jwt-refresh");
|
|
289
|
-
if (r !== null && U(r), e.status === 200)
|
|
290
|
-
switch (t) {
|
|
291
|
-
case "arraybuffer":
|
|
292
|
-
return await e.arrayBuffer();
|
|
293
|
-
case "blob":
|
|
294
|
-
return await e.blob();
|
|
295
|
-
case "text":
|
|
296
|
-
return await e.text();
|
|
297
|
-
case "json":
|
|
298
|
-
default:
|
|
299
|
-
return await e.json();
|
|
300
|
-
}
|
|
301
|
-
if (e.status === 401) {
|
|
302
|
-
if (d.userOverrideActive)
|
|
303
|
-
throw d.userOverrideActive = !1, L("Unauthorized access attempt with user override", { endpoint: e.url }), new ee("Unauthorized... User override failed.");
|
|
304
|
-
await M(e, 401);
|
|
305
|
-
}
|
|
306
|
-
throw e.status === 500 && (h("Server error occurred", { endpoint: e.url }), await M(e, 500)), L(`Unexpected response status: ${e.status}`, { endpoint: e.url }), new p(`Request failed with status ${e.status}`, e.status);
|
|
307
|
-
}
|
|
308
|
-
async function M(e, t) {
|
|
309
|
-
var r;
|
|
310
|
-
try {
|
|
311
|
-
const { done: n, value: a } = await ((r = e.body) == null ? void 0 : r.getReader().read()) || { done: !0, value: void 0 };
|
|
312
|
-
if (n || !a)
|
|
313
|
-
throw new p(`Request failed with status ${t}`, t);
|
|
314
|
-
const s = JSON.parse(new TextDecoder().decode(a));
|
|
315
|
-
throw s.status = t, s;
|
|
316
|
-
} catch (n) {
|
|
317
|
-
throw n instanceof p ? n : t === 401 ? new ee() : t === 500 ? new Se() : new p(`Request failed with status ${t}`, t);
|
|
42
|
+
class G extends b {
|
|
43
|
+
constructor(t = "Unauthorized access") {
|
|
44
|
+
super(t, 401), this.name = "UnauthorizedError";
|
|
318
45
|
}
|
|
319
46
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
47
|
+
const de = /.*\:\(?([><=\d\-\.AND ]+)\)?/;
|
|
48
|
+
function nt(e, t) {
|
|
322
49
|
var a;
|
|
323
50
|
return !(e != null && e.items) || ((a = e == null ? void 0 : e.items) == null ? void 0 : a.length) === 0 ? [] : e.items.reduce((s, i) => {
|
|
324
51
|
if (!i.value || i.value === "") return s;
|
|
325
|
-
const o =
|
|
52
|
+
const o = fe(i, e.column);
|
|
326
53
|
return s.push({
|
|
327
54
|
operator: o.operator,
|
|
328
55
|
value: o.value,
|
|
@@ -333,8 +60,8 @@ function ft(e, t) {
|
|
|
333
60
|
}), s;
|
|
334
61
|
}, []);
|
|
335
62
|
}
|
|
336
|
-
function
|
|
337
|
-
const r = t, n = e.value.match(
|
|
63
|
+
function fe(e, t) {
|
|
64
|
+
const r = t, n = e.value.match(de);
|
|
338
65
|
if (n != null && n[1]) {
|
|
339
66
|
const s = (n == null ? void 0 : n[1].split(" AND ")).map((i) => {
|
|
340
67
|
const o = i.indexOf(">=") !== -1 ? "gte" : "lt";
|
|
@@ -349,13 +76,13 @@ function be(e, t) {
|
|
|
349
76
|
}
|
|
350
77
|
return { field: r, operator: "eq", value: e.value, display: e.display };
|
|
351
78
|
}
|
|
352
|
-
function
|
|
79
|
+
function at(e, t, r) {
|
|
353
80
|
return e.valuesAreExpressions ? t.display === r.display : t.value === r.value;
|
|
354
81
|
}
|
|
355
|
-
function
|
|
356
|
-
return e.items && (e.items = e.items.map((t) =>
|
|
82
|
+
function he(e) {
|
|
83
|
+
return e.items && (e.items = e.items.map((t) => he(t))), e.items && e.items.some((t) => t.$selected || t.$opened) && (e.$opened = !0), e;
|
|
357
84
|
}
|
|
358
|
-
function
|
|
85
|
+
function st(e, t) {
|
|
359
86
|
const r = [];
|
|
360
87
|
if (e.length > 0) {
|
|
361
88
|
const n = /* @__PURE__ */ new Map(), s = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""), i = new RegExp("\\b" + s, "i");
|
|
@@ -385,18 +112,18 @@ function re(e, t, r, n, a, s, i) {
|
|
|
385
112
|
}
|
|
386
113
|
c.length < n.length && (l.hasChildren = !0, re(l.items, t, c, n, a, s + 1, i));
|
|
387
114
|
}
|
|
388
|
-
function
|
|
115
|
+
function ot(e, t) {
|
|
389
116
|
return e.reduce((r, n) => (t(n) ? r.true.push(n) : r.false.push(n), r), { true: [], false: [] });
|
|
390
117
|
}
|
|
391
|
-
const
|
|
392
|
-
function
|
|
118
|
+
const me = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, _e = 2, Z = 3, we = 5, E = 6, ge = 8, T = 9, Se = 11, ee = 12, ke = 14, te = 15;
|
|
119
|
+
function I(e) {
|
|
393
120
|
if (!e) return [];
|
|
394
|
-
const t = [], r = e.matchAll(
|
|
121
|
+
const t = [], r = e.matchAll(me);
|
|
395
122
|
for (let n of r)
|
|
396
|
-
n[
|
|
123
|
+
n[Z] ? t.push({ type: "group", value: n[Z], op: n[_e] }) : n[E] ? t.push({ type: "adjacent", value: n[E], op: n[we] }) : n[T] ? t.push({ type: "exact", value: n[T], op: n[ge] }) : n[ee] ? t.push({ type: "regex", value: n[ee], op: n[Se] }) : n[te] && t.push({ type: "token", value: n[te], op: n[ke] });
|
|
397
124
|
return t;
|
|
398
125
|
}
|
|
399
|
-
function
|
|
126
|
+
function j(e) {
|
|
400
127
|
return e.map((t) => {
|
|
401
128
|
const r = t.op || "";
|
|
402
129
|
switch (t.type) {
|
|
@@ -413,28 +140,28 @@ function G(e) {
|
|
|
413
140
|
}
|
|
414
141
|
}).join(" ");
|
|
415
142
|
}
|
|
416
|
-
function
|
|
417
|
-
let n =
|
|
143
|
+
function ct(e, t, r) {
|
|
144
|
+
let n = I(e);
|
|
418
145
|
for (let a of t)
|
|
419
146
|
n.push({ type: "adjacent", value: a, op: r });
|
|
420
|
-
return
|
|
147
|
+
return j(n);
|
|
421
148
|
}
|
|
422
|
-
function
|
|
423
|
-
const r =
|
|
424
|
-
return n !== -1 ? (r.splice(n, 1), t =
|
|
149
|
+
function it(e, t) {
|
|
150
|
+
const r = I(t), n = r.findIndex((a) => a.value === e);
|
|
151
|
+
return n !== -1 ? (r.splice(n, 1), t = j(r)) : t;
|
|
425
152
|
}
|
|
426
|
-
function
|
|
427
|
-
const t =
|
|
428
|
-
return
|
|
153
|
+
function lt(e) {
|
|
154
|
+
const t = I(e).filter((r) => r.type !== "adjacent");
|
|
155
|
+
return j(t);
|
|
429
156
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
157
|
+
function ut(e) {
|
|
158
|
+
return I(e).filter((t) => t.type === "adjacent").map((t) => t.value);
|
|
432
159
|
}
|
|
433
|
-
function
|
|
434
|
-
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: s, isFuture: i } =
|
|
160
|
+
function dt(e, t, r) {
|
|
161
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: s, isFuture: i } = pe(t, r);
|
|
435
162
|
return n.format(a * (i ? 1 : -1), s);
|
|
436
163
|
}
|
|
437
|
-
function
|
|
164
|
+
function pe(e, t) {
|
|
438
165
|
const r = new Date(e), n = t ? new Date(t) : /* @__PURE__ */ new Date(), a = Math.abs(n.getTime() - r.getTime());
|
|
439
166
|
return {
|
|
440
167
|
offset: Math.floor(a / (1e3 * 60 * 60 * 24)),
|
|
@@ -442,13 +169,13 @@ function Oe(e, t) {
|
|
|
442
169
|
isFuture: r > n
|
|
443
170
|
};
|
|
444
171
|
}
|
|
445
|
-
function
|
|
172
|
+
function ft(e) {
|
|
446
173
|
const t = e.target;
|
|
447
174
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
448
175
|
}
|
|
449
|
-
function
|
|
176
|
+
function ht(e) {
|
|
450
177
|
if (e === void 0) return;
|
|
451
|
-
const { q: t, f: r, p: n, s: a, t: s, n: i, b: o } =
|
|
178
|
+
const { q: t, f: r, p: n, s: a, t: s, n: i, b: o } = R(e), [c] = e.split("?");
|
|
452
179
|
return {
|
|
453
180
|
path: c,
|
|
454
181
|
text: t,
|
|
@@ -460,16 +187,16 @@ function vt(e) {
|
|
|
460
187
|
basket: o
|
|
461
188
|
};
|
|
462
189
|
}
|
|
463
|
-
function
|
|
190
|
+
function mt(e) {
|
|
464
191
|
if (!e) return "";
|
|
465
192
|
const { text: t, filters: r, page: n, sort: a, tab: s, name: i, basket: o } = e, c = {};
|
|
466
193
|
t && (c.q = t), r && (c.f = JSON.stringify(r)), n && (c.p = n.toString()), a && (c.s = a), s && (c.t = s), i && (c.n = i), o && (c.b = o);
|
|
467
194
|
const l = new URLSearchParams(c).toString();
|
|
468
195
|
return l || "";
|
|
469
196
|
}
|
|
470
|
-
function
|
|
197
|
+
function _t(e) {
|
|
471
198
|
if (e === void 0) return [];
|
|
472
|
-
const { f: t } =
|
|
199
|
+
const { f: t } = R(e);
|
|
473
200
|
return ne(t);
|
|
474
201
|
}
|
|
475
202
|
function ne(e) {
|
|
@@ -480,29 +207,29 @@ function ne(e) {
|
|
|
480
207
|
return console.error(`Error parsing filters from URI: ${e}`), [];
|
|
481
208
|
}
|
|
482
209
|
}
|
|
483
|
-
function
|
|
210
|
+
function R(e) {
|
|
484
211
|
const t = e.split("?")[1];
|
|
485
212
|
if (t === void 0) return {};
|
|
486
213
|
const r = new URLSearchParams(t);
|
|
487
214
|
return Object.fromEntries(r);
|
|
488
215
|
}
|
|
489
|
-
function
|
|
490
|
-
const { q: t = "" } =
|
|
216
|
+
function wt(e) {
|
|
217
|
+
const { q: t = "" } = R(e);
|
|
491
218
|
return t;
|
|
492
219
|
}
|
|
493
|
-
function
|
|
494
|
-
const { id: t } =
|
|
220
|
+
function gt(e) {
|
|
221
|
+
const { id: t } = R(e);
|
|
495
222
|
return decodeURIComponent(t);
|
|
496
223
|
}
|
|
497
|
-
function
|
|
498
|
-
const { p: t = "0" } =
|
|
224
|
+
function St(e) {
|
|
225
|
+
const { p: t = "0" } = R(e);
|
|
499
226
|
return parseInt(t, 10);
|
|
500
227
|
}
|
|
501
|
-
function
|
|
502
|
-
const { t } =
|
|
228
|
+
function kt(e) {
|
|
229
|
+
const { t } = R(e);
|
|
503
230
|
return t;
|
|
504
231
|
}
|
|
505
|
-
function
|
|
232
|
+
function pt(e, t) {
|
|
506
233
|
if (!e)
|
|
507
234
|
return e;
|
|
508
235
|
let r = 0;
|
|
@@ -513,21 +240,21 @@ function $t(e, t) {
|
|
|
513
240
|
a++;
|
|
514
241
|
e[a] === "]" && (r = a + 1);
|
|
515
242
|
}
|
|
516
|
-
const s =
|
|
243
|
+
const s = B(e, r, !1);
|
|
517
244
|
if (!s)
|
|
518
245
|
return e;
|
|
519
246
|
const i = t.charCodeAt(0), o = t.charCodeAt(1);
|
|
520
247
|
let c = s;
|
|
521
248
|
for (; c; )
|
|
522
249
|
if (i === c.lang1 && o === c.lang2) {
|
|
523
|
-
const f =
|
|
250
|
+
const f = B(e, c.end + 4, !0);
|
|
524
251
|
return e.substring(f.start, f.end);
|
|
525
252
|
} else
|
|
526
|
-
c =
|
|
253
|
+
c = B(e, c.end + 4, !1);
|
|
527
254
|
const l = e.substring(s.start, s.end);
|
|
528
255
|
return l || e;
|
|
529
256
|
}
|
|
530
|
-
function
|
|
257
|
+
function B(e, t, r) {
|
|
531
258
|
for (let n = t, a = e.length - 3; n < a; n++)
|
|
532
259
|
if (e[n] === "[" && e[n + 3] === "]")
|
|
533
260
|
return {
|
|
@@ -544,11 +271,11 @@ function q(e, t, r) {
|
|
|
544
271
|
lang2: -1
|
|
545
272
|
};
|
|
546
273
|
}
|
|
547
|
-
function
|
|
274
|
+
function vt(e, t) {
|
|
548
275
|
const { useLocale: r, useLocaleAsPrefix: n, indexFile: a, path: s, folder: i } = t, o = r ? `${e}/` : null, c = n ? `${e}.${a}` : a ?? "";
|
|
549
276
|
return [s, i, `${o || ""}${c}`].filter((l) => l !== void 0).join("/");
|
|
550
277
|
}
|
|
551
|
-
function
|
|
278
|
+
function O(e) {
|
|
552
279
|
const t = new CustomEvent("notification", {
|
|
553
280
|
bubbles: !0,
|
|
554
281
|
cancelable: !1,
|
|
@@ -556,65 +283,144 @@ function $(e) {
|
|
|
556
283
|
});
|
|
557
284
|
dispatchEvent(t);
|
|
558
285
|
}
|
|
559
|
-
const
|
|
286
|
+
const bt = {
|
|
560
287
|
success: (e, t) => {
|
|
561
|
-
|
|
288
|
+
O({
|
|
562
289
|
type: "success",
|
|
563
290
|
message: e,
|
|
564
291
|
options: t
|
|
565
292
|
});
|
|
566
293
|
},
|
|
567
294
|
info: (e, t) => {
|
|
568
|
-
|
|
295
|
+
O({
|
|
569
296
|
type: "info",
|
|
570
297
|
message: e,
|
|
571
298
|
options: t
|
|
572
299
|
});
|
|
573
300
|
},
|
|
574
301
|
warning: (e, t) => {
|
|
575
|
-
|
|
302
|
+
O({
|
|
576
303
|
type: "warning",
|
|
577
304
|
message: e,
|
|
578
305
|
options: t
|
|
579
306
|
});
|
|
580
307
|
},
|
|
581
308
|
error: (e, t) => {
|
|
582
|
-
|
|
309
|
+
O({
|
|
583
310
|
type: "error",
|
|
584
311
|
message: e,
|
|
585
312
|
options: t
|
|
586
313
|
});
|
|
587
314
|
}
|
|
588
315
|
};
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
316
|
+
var ae = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e[e.NONE = 4] = "NONE", e))(ae || {});
|
|
317
|
+
let $ = {
|
|
318
|
+
level: 1,
|
|
319
|
+
enableConsoleOutput: !0
|
|
320
|
+
};
|
|
321
|
+
function Ct(e) {
|
|
322
|
+
$ = { ...$, ...e };
|
|
323
|
+
}
|
|
324
|
+
function D(e, t, r) {
|
|
325
|
+
if (e < $.level) return;
|
|
326
|
+
const a = `${`[${ae[e]}]`} ${t}`;
|
|
327
|
+
if ($.enableConsoleOutput)
|
|
328
|
+
switch (e) {
|
|
329
|
+
case 0:
|
|
330
|
+
console.debug(a, r || "");
|
|
331
|
+
break;
|
|
332
|
+
case 1:
|
|
333
|
+
console.info(a, r || "");
|
|
334
|
+
break;
|
|
335
|
+
case 2:
|
|
336
|
+
console.warn(a, r || "");
|
|
337
|
+
break;
|
|
338
|
+
case 3:
|
|
339
|
+
console.error(a, r || "");
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function x(e, t) {
|
|
344
|
+
D(0, e, t);
|
|
345
|
+
}
|
|
346
|
+
function S(e, t) {
|
|
347
|
+
D(1, e, t);
|
|
348
|
+
}
|
|
349
|
+
function P(e, t) {
|
|
350
|
+
D(2, e, t);
|
|
351
|
+
}
|
|
352
|
+
function h(e, t) {
|
|
353
|
+
D(3, e, t);
|
|
354
|
+
}
|
|
355
|
+
async function C(e, t = "json") {
|
|
356
|
+
const r = e.headers.get("sinequa-jwt-refresh");
|
|
357
|
+
if (r !== null && U(r), e.status === 200)
|
|
358
|
+
switch (t) {
|
|
359
|
+
case "arraybuffer":
|
|
360
|
+
return await e.arrayBuffer();
|
|
361
|
+
case "blob":
|
|
362
|
+
return await e.blob();
|
|
363
|
+
case "text":
|
|
364
|
+
return await e.text();
|
|
365
|
+
default:
|
|
366
|
+
return await e.json();
|
|
367
|
+
}
|
|
368
|
+
if (e.status === 401) {
|
|
369
|
+
if (d.userOverrideActive)
|
|
370
|
+
throw P("Unauthorized access attempt with user override", {
|
|
371
|
+
endpoint: e.url
|
|
372
|
+
}), new G("Unauthorized... User override failed.");
|
|
373
|
+
return await q(e, 401);
|
|
374
|
+
}
|
|
375
|
+
return e.status === 500 ? (h("Server error occurred", { endpoint: e.url }), await q(e, 500)) : (P(`Unexpected response status: ${e.status}`, {
|
|
376
|
+
endpoint: e.url
|
|
377
|
+
}), await q(e, e.status));
|
|
378
|
+
}
|
|
379
|
+
async function q(e, t) {
|
|
380
|
+
var r;
|
|
600
381
|
try {
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
382
|
+
const { done: n, value: a } = await ((r = e.body) == null ? void 0 : r.getReader().read()) || {
|
|
383
|
+
done: !0,
|
|
384
|
+
value: void 0
|
|
385
|
+
};
|
|
386
|
+
if (n || !a)
|
|
387
|
+
throw t === 401 ? new G() : t === 500 ? new K() : new b(`Request failed with status ${t}`, t);
|
|
388
|
+
const s = JSON.parse(new TextDecoder().decode(a));
|
|
389
|
+
throw new Error(
|
|
390
|
+
s.errorMessage || s.message || `Request failed with status ${t}`,
|
|
391
|
+
{
|
|
392
|
+
cause: {
|
|
393
|
+
errorCode: s.errorCode,
|
|
394
|
+
errorCodeTest: s.errorCodeTest
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
} catch (n) {
|
|
399
|
+
throw n instanceof b ? n : t === 401 ? new G(n.message) : t === 500 ? new K(n.message) : new b(
|
|
400
|
+
n.message ?? `Request failed with status ${t}`,
|
|
401
|
+
t
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
async function Rt(e, t, r) {
|
|
406
|
+
const n = L(r == null ? void 0 : r.headers), { backendUrl: a } = d, s = t ? `?${new URLSearchParams(t)}` : "", i = a ? `${a}/${e}${s}` : `${e}${s}`;
|
|
407
|
+
x(`Making DELETE request to: ${i}`);
|
|
408
|
+
try {
|
|
409
|
+
const o = await fetch(i, {
|
|
410
|
+
method: "DELETE",
|
|
604
411
|
credentials: "include",
|
|
605
|
-
|
|
606
|
-
signal: r == null ? void 0 : r.signal
|
|
412
|
+
headers: n
|
|
607
413
|
});
|
|
608
|
-
return C(
|
|
609
|
-
} catch (
|
|
610
|
-
throw h("Error making
|
|
414
|
+
return C(o, r == null ? void 0 : r.responseType);
|
|
415
|
+
} catch (o) {
|
|
416
|
+
throw h("Error making DELETE request:", o), o;
|
|
611
417
|
}
|
|
612
418
|
}
|
|
613
|
-
async function
|
|
614
|
-
const n =
|
|
419
|
+
async function p(e, t, r) {
|
|
420
|
+
const n = L(r == null ? void 0 : r.headers), { backendUrl: a } = d, s = t ? `?${new URLSearchParams(t)}` : "";
|
|
615
421
|
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
616
422
|
const i = a ? `${a}/${e}${s}` : `${e}${s}`;
|
|
617
|
-
|
|
423
|
+
x(`Making GET request to: ${i}`);
|
|
618
424
|
try {
|
|
619
425
|
const o = await fetch(i, {
|
|
620
426
|
method: "GET",
|
|
@@ -627,66 +433,310 @@ async function k(e, t, r) {
|
|
|
627
433
|
throw h("Error making GET request:", o), o;
|
|
628
434
|
}
|
|
629
435
|
}
|
|
630
|
-
async function
|
|
631
|
-
const n =
|
|
436
|
+
async function xt(e, t, r) {
|
|
437
|
+
const n = L(r == null ? void 0 : r.headers), { app: a, backendUrl: s } = d, i = {
|
|
632
438
|
app: a,
|
|
633
439
|
...t,
|
|
634
440
|
locale: t.locale || navigator.language,
|
|
635
441
|
noUserOverride: !0,
|
|
636
442
|
noAutoAuthentication: !0
|
|
637
|
-
}, o = `${s}/${e}`;
|
|
638
|
-
|
|
443
|
+
}, o = s ? `${s}/${e}` : `${e}`;
|
|
444
|
+
x(`Making PATCH request to: ${o}`);
|
|
639
445
|
try {
|
|
640
446
|
const c = await fetch(o, {
|
|
641
|
-
method: "
|
|
447
|
+
method: "PATCH",
|
|
642
448
|
headers: n,
|
|
643
449
|
credentials: "include",
|
|
644
450
|
body: JSON.stringify(i)
|
|
645
451
|
});
|
|
646
452
|
return C(c, r == null ? void 0 : r.responseType);
|
|
647
453
|
} catch (c) {
|
|
648
|
-
throw h("Error making
|
|
454
|
+
throw h("Error making PATCH request:", c), c;
|
|
649
455
|
}
|
|
650
456
|
}
|
|
651
|
-
async function
|
|
652
|
-
const n =
|
|
653
|
-
|
|
457
|
+
async function u(e, t, r) {
|
|
458
|
+
const n = L(r == null ? void 0 : r.headers), { app: a, backendUrl: s } = d;
|
|
459
|
+
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
460
|
+
const i = {
|
|
461
|
+
app: a,
|
|
462
|
+
...t,
|
|
463
|
+
locale: t.locale || navigator.language,
|
|
464
|
+
noUserOverride: !0,
|
|
465
|
+
noAutoAuthentication: !0
|
|
466
|
+
};
|
|
467
|
+
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
468
|
+
const o = s ? `${s}/${e}` : `${e}`;
|
|
469
|
+
x(`Making POST request to: ${o}`);
|
|
654
470
|
try {
|
|
655
|
-
const
|
|
656
|
-
method: "
|
|
471
|
+
const c = await fetch(o, {
|
|
472
|
+
method: "POST",
|
|
473
|
+
headers: n,
|
|
657
474
|
credentials: "include",
|
|
658
|
-
|
|
475
|
+
body: JSON.stringify(i),
|
|
476
|
+
signal: r == null ? void 0 : r.signal
|
|
659
477
|
});
|
|
660
|
-
return C(
|
|
661
|
-
} catch (
|
|
662
|
-
throw h("Error making
|
|
478
|
+
return C(c, r == null ? void 0 : r.responseType);
|
|
479
|
+
} catch (c) {
|
|
480
|
+
throw h("Error making POST request:", c), c;
|
|
663
481
|
}
|
|
664
482
|
}
|
|
665
|
-
async function
|
|
666
|
-
const n =
|
|
483
|
+
async function Pt(e, t, r) {
|
|
484
|
+
const n = L(r == null ? void 0 : r.headers), { app: a, backendUrl: s } = d, i = {
|
|
667
485
|
app: a,
|
|
668
486
|
...t,
|
|
669
487
|
locale: t.locale || navigator.language,
|
|
670
488
|
noUserOverride: !0,
|
|
671
489
|
noAutoAuthentication: !0
|
|
672
|
-
}, o =
|
|
673
|
-
|
|
490
|
+
}, o = `${s}/${e}`;
|
|
491
|
+
x(`Making PUT request to: ${o}`);
|
|
674
492
|
try {
|
|
675
493
|
const c = await fetch(o, {
|
|
676
|
-
method: "
|
|
494
|
+
method: "PUT",
|
|
677
495
|
headers: n,
|
|
678
496
|
credentials: "include",
|
|
679
497
|
body: JSON.stringify(i)
|
|
680
498
|
});
|
|
681
499
|
return C(c, r == null ? void 0 : r.responseType);
|
|
682
500
|
} catch (c) {
|
|
683
|
-
throw h("Error making
|
|
501
|
+
throw h("Error making PUT request:", c), c;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function Lt(e) {
|
|
505
|
+
const t = new AbortController(), { signal: r } = t;
|
|
506
|
+
return e && setTimeout(() => {
|
|
507
|
+
r.aborted || t.abort(new ue(`Request timed out after ${e}ms`));
|
|
508
|
+
}, e), { controller: t, signal: r };
|
|
509
|
+
}
|
|
510
|
+
function se(e) {
|
|
511
|
+
if (!e) return;
|
|
512
|
+
const t = new Date(e);
|
|
513
|
+
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
514
|
+
}
|
|
515
|
+
function yt(e) {
|
|
516
|
+
const t = se(e);
|
|
517
|
+
return !!t && t.getTime() <= Date.now();
|
|
518
|
+
}
|
|
519
|
+
function Ot(e, t = 7) {
|
|
520
|
+
const r = se(e);
|
|
521
|
+
if (!r) return !1;
|
|
522
|
+
const n = Date.now(), a = n + t * 24 * 60 * 60 * 1e3, s = r.getTime();
|
|
523
|
+
return s > n && s <= a;
|
|
524
|
+
}
|
|
525
|
+
async function $t(e, t = 0, r = 1e3) {
|
|
526
|
+
let n;
|
|
527
|
+
for (let a = 0; a <= t; a++)
|
|
528
|
+
try {
|
|
529
|
+
return await e();
|
|
530
|
+
} catch (s) {
|
|
531
|
+
if (n = s, s instanceof b && s.status >= 400 && s.status < 500 && s.status !== 429 || s instanceof DOMException && s.name === "AbortError")
|
|
532
|
+
throw s;
|
|
533
|
+
a < t && (P(`Retrying request (${a + 1}/${t})`, { error: s }), await new Promise((i) => setTimeout(i, r)));
|
|
534
|
+
}
|
|
535
|
+
throw n;
|
|
536
|
+
}
|
|
537
|
+
function Ut(e, t, r) {
|
|
538
|
+
var s, i, o, c;
|
|
539
|
+
if (!e || !t) return;
|
|
540
|
+
if (r) {
|
|
541
|
+
const l = Object.keys(t.queries).find((F) => F === (r == null ? void 0 : r.toLowerCase()));
|
|
542
|
+
let f;
|
|
543
|
+
l && (f = t.queries[l]);
|
|
544
|
+
const N = (i = ((s = f == null ? void 0 : f.columnsInfo) == null ? void 0 : s.columns) || []) == null ? void 0 : i.find((F) => {
|
|
545
|
+
var X, M;
|
|
546
|
+
return (M = (X = F.aliases) == null ? void 0 : X.split(",")) == null ? void 0 : M.includes(e);
|
|
547
|
+
});
|
|
548
|
+
if (N) return N.name;
|
|
684
549
|
}
|
|
550
|
+
const n = (c = (o = t.indexes) == null ? void 0 : o._) == null ? void 0 : c.columns, a = Object.entries(n).find((l) => {
|
|
551
|
+
var f;
|
|
552
|
+
return (f = l[1].aliases) == null ? void 0 : f.includes(e);
|
|
553
|
+
});
|
|
554
|
+
if (a) return a[0];
|
|
685
555
|
}
|
|
686
|
-
|
|
687
|
-
|
|
556
|
+
var v = /* @__PURE__ */ ((e) => (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))(v || {}), m = /* @__PURE__ */ ((e) => (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))(m || {}), g = /* @__PURE__ */ ((e) => (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))(g || {});
|
|
557
|
+
const It = "1.0";
|
|
558
|
+
var ve = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(ve || {}), be = /* @__PURE__ */ ((e) => (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))(be || {});
|
|
559
|
+
function Ce(e) {
|
|
560
|
+
if (!e)
|
|
561
|
+
return m.none;
|
|
562
|
+
switch (e.toLocaleLowerCase()) {
|
|
563
|
+
case "bool":
|
|
564
|
+
case "boolean":
|
|
565
|
+
return m.bool;
|
|
566
|
+
case "date":
|
|
567
|
+
return m.date;
|
|
568
|
+
case "datetime":
|
|
569
|
+
return m.dateTime;
|
|
570
|
+
case "time":
|
|
571
|
+
return m.time;
|
|
572
|
+
case "unsigned":
|
|
573
|
+
return m.unsigned;
|
|
574
|
+
case "integer":
|
|
575
|
+
return m.integer;
|
|
576
|
+
case "float":
|
|
577
|
+
return m.float;
|
|
578
|
+
case "double":
|
|
579
|
+
return m.double;
|
|
580
|
+
case "dates":
|
|
581
|
+
return m.dates;
|
|
582
|
+
case "datetimes":
|
|
583
|
+
return m.dateTimes;
|
|
584
|
+
case "times":
|
|
585
|
+
return m.times;
|
|
586
|
+
case "varchar":
|
|
587
|
+
return m.varchar;
|
|
588
|
+
case "binary":
|
|
589
|
+
return m.binary;
|
|
590
|
+
case "string":
|
|
591
|
+
return m.string;
|
|
592
|
+
case "csv":
|
|
593
|
+
return m.csv;
|
|
594
|
+
default:
|
|
595
|
+
return m.none;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function Re(e) {
|
|
599
|
+
switch (e) {
|
|
600
|
+
case "a":
|
|
601
|
+
return g.a;
|
|
602
|
+
case "c":
|
|
603
|
+
return g.c;
|
|
604
|
+
case "d":
|
|
605
|
+
return g.d;
|
|
606
|
+
case "e":
|
|
607
|
+
return g.e;
|
|
608
|
+
case "i":
|
|
609
|
+
return g.i;
|
|
610
|
+
case "l":
|
|
611
|
+
return g.l;
|
|
612
|
+
case "n":
|
|
613
|
+
return g.n;
|
|
614
|
+
case "t":
|
|
615
|
+
return g.t;
|
|
616
|
+
case "x":
|
|
617
|
+
return g.x;
|
|
618
|
+
case "z":
|
|
619
|
+
return g.z;
|
|
620
|
+
default:
|
|
621
|
+
return g.none;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function xe(e) {
|
|
625
|
+
let t = g.none;
|
|
626
|
+
if (e)
|
|
627
|
+
for (const r of e)
|
|
628
|
+
t |= Re(r);
|
|
629
|
+
return t;
|
|
630
|
+
}
|
|
631
|
+
function _(e, t, r, n) {
|
|
632
|
+
const a = Ce(t), s = xe(r || "");
|
|
633
|
+
return {
|
|
634
|
+
name: e,
|
|
635
|
+
type: t,
|
|
636
|
+
typeModifier: r,
|
|
637
|
+
eType: a,
|
|
638
|
+
eTypeModifier: s,
|
|
639
|
+
aliases: n
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
const Dt = {
|
|
643
|
+
id: _("id", "string"),
|
|
644
|
+
text: _("text", "varchar"),
|
|
645
|
+
documentlanguages: _("documentlanguages", "csv", "ci", ["language"]),
|
|
646
|
+
databasealias: _("databasealias", "varchar"),
|
|
647
|
+
globalrelevance: _("globalrelevance", "double"),
|
|
648
|
+
matchingpartnames: _("matchingpartnames", "csv"),
|
|
649
|
+
matchlocations: _("matchlocations", "csv"),
|
|
650
|
+
matchlocationsperpartname: _("matchlocationsperpartname", "varchar"),
|
|
651
|
+
// json
|
|
652
|
+
extracts: _("extracts", "csv"),
|
|
653
|
+
extractsperpartname: _("extractsperpartname", "varchar"),
|
|
654
|
+
// json
|
|
655
|
+
extractslocations: _("extractslocations", "csv"),
|
|
656
|
+
documentweight: _("documentweight", "varchar"),
|
|
657
|
+
groupcount: _("groupcount", "integer"),
|
|
658
|
+
accesslists: _("accesslists", "varchar", void 0, ["accessLists"])
|
|
659
|
+
// json
|
|
660
|
+
};
|
|
661
|
+
function At(e, t) {
|
|
662
|
+
let r = e[t];
|
|
663
|
+
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
664
|
+
if (typeof n == "string") return n.trim();
|
|
665
|
+
if (typeof n == "object" && n !== null && "display" in n)
|
|
666
|
+
return n.display.trim();
|
|
667
|
+
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
668
|
+
}
|
|
669
|
+
function Nt(e, t) {
|
|
670
|
+
let r = e[t];
|
|
671
|
+
if (r === void 0) return [];
|
|
672
|
+
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
673
|
+
return r.map((a) => {
|
|
674
|
+
if (typeof a == "string")
|
|
675
|
+
return { display: a.trim(), value: a.trim() };
|
|
676
|
+
if (typeof a == "object" && a !== null && "display" in a) {
|
|
677
|
+
const s = a.display.trim(), i = "value" in a ? String(a.value).trim() : s;
|
|
678
|
+
return { display: s, value: i };
|
|
679
|
+
}
|
|
680
|
+
}).filter(
|
|
681
|
+
(a) => a !== void 0
|
|
682
|
+
);
|
|
683
|
+
const n = String(r).trim();
|
|
684
|
+
return [{ display: n, value: n }];
|
|
685
|
+
}
|
|
686
|
+
function A(e) {
|
|
687
|
+
return e !== null && typeof e == "object";
|
|
688
|
+
}
|
|
689
|
+
function Pe(e) {
|
|
690
|
+
return A(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
691
|
+
}
|
|
692
|
+
function Le(e) {
|
|
693
|
+
return A(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
694
|
+
}
|
|
695
|
+
function ye(e) {
|
|
696
|
+
return typeof e == "string";
|
|
697
|
+
}
|
|
698
|
+
function Ft(e) {
|
|
699
|
+
return (A(e) || Array.isArray(e)) && !Pe(e) && !Le(e) && !ye(e);
|
|
700
|
+
}
|
|
701
|
+
function Oe(e = !0) {
|
|
702
|
+
let t = Date.now();
|
|
703
|
+
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
704
|
+
const a = (t + Math.random() * 16) % 16 | 0;
|
|
705
|
+
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
function Bt(e) {
|
|
709
|
+
if (!e)
|
|
710
|
+
return "``";
|
|
711
|
+
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
712
|
+
return "`" + e + "`";
|
|
713
|
+
const t = ["`"];
|
|
714
|
+
for (let r = 0, n = e.length; r < n; r++) {
|
|
715
|
+
const a = e[r];
|
|
716
|
+
(a === "\\" || a === "`") && t.push("\\"), t.push(a);
|
|
717
|
+
}
|
|
718
|
+
return t.push("`"), t.join("");
|
|
719
|
+
}
|
|
720
|
+
function qt(e) {
|
|
721
|
+
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
722
|
+
try {
|
|
723
|
+
return crypto.subtle.digest("SHA-512", new TextEncoder().encode(e)).then((t) => Array.prototype.map.call(new Uint8Array(t), (r) => ("00" + r.toString(16)).slice(-2)).join("")).catch(() => Promise.resolve(Q(e)));
|
|
724
|
+
} catch {
|
|
725
|
+
return Promise.resolve(Q(e));
|
|
726
|
+
}
|
|
727
|
+
return Promise.resolve(Q(e));
|
|
728
|
+
}
|
|
729
|
+
function Q(e) {
|
|
730
|
+
let n = 2166136261;
|
|
731
|
+
for (let f = 0; f < e.length; f++)
|
|
732
|
+
n ^= e.charCodeAt(f), n = n * 16777619 >>> 0;
|
|
733
|
+
const a = n.toString(16).padStart(8, "0"), s = ((n ^ 2863311530) >>> 0).toString(16).padStart(8, "0"), i = ((n ^ 1431655765) >>> 0).toString(16).padStart(8, "0"), o = ((n ^ 3435973836) >>> 0).toString(16).padStart(8, "0"), c = a + s + i + o;
|
|
734
|
+
return (c + c + c + c).substring(0, 128);
|
|
735
|
+
}
|
|
736
|
+
let V, oe;
|
|
737
|
+
function y(e, t = !0) {
|
|
688
738
|
let r = $e(e.$auditRecord);
|
|
689
|
-
r && (
|
|
739
|
+
r && (Ue(r), t && Ie(r)), e.$auditRecord = r;
|
|
690
740
|
}
|
|
691
741
|
function $e(e) {
|
|
692
742
|
if (!e)
|
|
@@ -694,7 +744,7 @@ function $e(e) {
|
|
|
694
744
|
let t;
|
|
695
745
|
if (Array.isArray(e))
|
|
696
746
|
t = e;
|
|
697
|
-
else if (
|
|
747
|
+
else if (A(e)) {
|
|
698
748
|
const r = e;
|
|
699
749
|
if (r.auditEvents || r.mlAuditEvents)
|
|
700
750
|
return r;
|
|
@@ -702,97 +752,105 @@ function $e(e) {
|
|
|
702
752
|
}
|
|
703
753
|
return { auditEvents: t };
|
|
704
754
|
}
|
|
705
|
-
function
|
|
755
|
+
function Ue(e) {
|
|
706
756
|
var r;
|
|
707
|
-
const t =
|
|
757
|
+
const t = De();
|
|
708
758
|
return (r = e.auditEvents) == null || r.forEach((n) => {
|
|
709
759
|
n.detail || (n.detail = {}), n.detail.sessionid = t;
|
|
710
760
|
}), e;
|
|
711
761
|
}
|
|
712
|
-
function
|
|
762
|
+
function Ie(e) {
|
|
713
763
|
var r;
|
|
714
764
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
715
765
|
return (r = e == null ? void 0 : e.auditEvents) == null || r.forEach((n) => {
|
|
716
766
|
n.detail || (n.detail = {}), n.detail.url = t;
|
|
717
767
|
}), e;
|
|
718
768
|
}
|
|
719
|
-
function Ie() {
|
|
720
|
-
return (!Q || De()) && (Q = we()), ae = /* @__PURE__ */ new Date(), Q;
|
|
721
|
-
}
|
|
722
769
|
function De() {
|
|
723
|
-
return (
|
|
770
|
+
return (!V || Ae()) && (V = Oe()), oe = /* @__PURE__ */ new Date(), V;
|
|
724
771
|
}
|
|
725
|
-
|
|
772
|
+
function Ae() {
|
|
773
|
+
return (/* @__PURE__ */ new Date()).getTime() - oe.getTime() > 10 * 60 * 1e3;
|
|
774
|
+
}
|
|
775
|
+
async function Ne(e, t = !0) {
|
|
726
776
|
const r = {
|
|
727
777
|
event: v.None,
|
|
728
778
|
$auditRecord: e
|
|
729
779
|
};
|
|
730
|
-
return
|
|
780
|
+
return y(r, t), u("api/v1/audit.notify", r);
|
|
731
781
|
}
|
|
732
|
-
const
|
|
733
|
-
async function
|
|
782
|
+
const Qt = { notify: Ne };
|
|
783
|
+
async function Vt(e, t, r) {
|
|
734
784
|
var f;
|
|
735
785
|
const n = ((f = e.items) == null ? void 0 : f.length) || 0, a = 10, s = {
|
|
736
786
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: a } } },
|
|
737
787
|
$auditRecord: { auditEvents: [r] }
|
|
738
788
|
};
|
|
739
|
-
|
|
789
|
+
y(s);
|
|
740
790
|
const i = await u("api/v1/query", s), o = await C(i), { aggregations: c } = o, l = c[0];
|
|
741
791
|
return l.$hasMore = l.items.length > a, l.items = [...e.items, ...l.items], Promise.resolve(l);
|
|
742
792
|
}
|
|
743
|
-
async function
|
|
793
|
+
async function Gt() {
|
|
744
794
|
const { app: e } = d, t = new URLSearchParams({ app: e || "" });
|
|
745
|
-
return
|
|
795
|
+
return p("api/v1/app", t);
|
|
746
796
|
}
|
|
747
|
-
async function
|
|
797
|
+
async function Fe() {
|
|
748
798
|
const { app: e } = d, t = new URLSearchParams({
|
|
749
799
|
app: e || "",
|
|
750
800
|
preLogin: "true"
|
|
751
801
|
});
|
|
752
|
-
return
|
|
802
|
+
return p("api/v1/app", t);
|
|
753
803
|
}
|
|
754
|
-
function
|
|
755
|
-
let { backendUrl: e, app: t } = d;
|
|
804
|
+
function jt() {
|
|
805
|
+
let { backendUrl: e, app: t, useCredentials: r } = d;
|
|
756
806
|
if (typeof window < "u") {
|
|
757
807
|
if (e || (e = window.location.origin), !t) {
|
|
758
|
-
const
|
|
808
|
+
const n = window.location.pathname.match(
|
|
759
809
|
/\/app(?:-debug)?\/([^/#]+)/
|
|
760
810
|
);
|
|
761
|
-
|
|
811
|
+
n && (t = n[1]);
|
|
762
812
|
}
|
|
763
|
-
|
|
813
|
+
k({
|
|
764
814
|
...d,
|
|
765
815
|
backendUrl: e,
|
|
766
816
|
app: t
|
|
767
817
|
});
|
|
768
818
|
}
|
|
769
|
-
return
|
|
770
|
-
|
|
771
|
-
|
|
819
|
+
return r ? (k({
|
|
820
|
+
...d,
|
|
821
|
+
useCredentials: !0,
|
|
822
|
+
useSSO: !1,
|
|
823
|
+
autoOAuthProvider: void 0,
|
|
824
|
+
autoSAMLProvider: void 0,
|
|
825
|
+
bearerToken: void 0,
|
|
826
|
+
useSAML: void 0
|
|
827
|
+
}), Promise.resolve({})) : Fe().then((n) => {
|
|
828
|
+
const { autoOAuthProvider: a, autoSAMLProvider: s } = d, i = !a && !n.autoOAuthProvider && !s && !n.autoSAMLProvider;
|
|
829
|
+
return k({
|
|
772
830
|
...d,
|
|
773
|
-
autoOAuthProvider:
|
|
774
|
-
autoSAMLProvider:
|
|
775
|
-
useCredentials:
|
|
776
|
-
useSSO:
|
|
777
|
-
}),
|
|
778
|
-
}).catch((
|
|
779
|
-
throw h("atomic:fetchAppPreLogin error",
|
|
831
|
+
autoOAuthProvider: a || n.autoOAuthProvider,
|
|
832
|
+
autoSAMLProvider: s || n.autoSAMLProvider,
|
|
833
|
+
useCredentials: i,
|
|
834
|
+
useSSO: i
|
|
835
|
+
}), n;
|
|
836
|
+
}).catch((n) => {
|
|
837
|
+
throw h("atomic:fetchAppPreLogin error", n), n;
|
|
780
838
|
});
|
|
781
839
|
}
|
|
782
|
-
async function
|
|
840
|
+
async function zt(e, t, r = {}) {
|
|
783
841
|
const n = `api/v1/search.dataset/${e}/${t}`, a = await u(n, { parameters: r }), s = t[0].toLowerCase() + t.slice(1), i = a.datasets[s];
|
|
784
842
|
if ("errorCode" in i && "errorMessage" in i)
|
|
785
843
|
throw new Error(i.errorMessage);
|
|
786
844
|
return i;
|
|
787
845
|
}
|
|
788
|
-
async function
|
|
846
|
+
async function Ht(e, t) {
|
|
789
847
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: a = [] } = t;
|
|
790
848
|
return (await u(r, { parameters: n, datasets: a })).datasets;
|
|
791
849
|
}
|
|
792
|
-
async function
|
|
793
|
-
return await
|
|
850
|
+
async function Jt(e) {
|
|
851
|
+
return await p(`api/v1/search.dataset/${e}`);
|
|
794
852
|
}
|
|
795
|
-
async function
|
|
853
|
+
async function Wt(e, t = !0, r) {
|
|
796
854
|
try {
|
|
797
855
|
return (await u("api/v1/labels", {
|
|
798
856
|
action: "list",
|
|
@@ -805,18 +863,18 @@ async function jt(e, t = !0, r) {
|
|
|
805
863
|
throw h("Error in fetchLabels", n), n;
|
|
806
864
|
}
|
|
807
865
|
}
|
|
808
|
-
async function
|
|
866
|
+
async function Be() {
|
|
809
867
|
try {
|
|
810
868
|
const { app: e = "" } = d, t = new URLSearchParams({
|
|
811
869
|
app: e,
|
|
812
870
|
action: "getUserRights"
|
|
813
871
|
});
|
|
814
|
-
return
|
|
872
|
+
return p("api/v1/labels", t);
|
|
815
873
|
} catch (e) {
|
|
816
874
|
throw h("Error in getUserRights", e), e;
|
|
817
875
|
}
|
|
818
876
|
}
|
|
819
|
-
async function
|
|
877
|
+
async function qe(e, t, r = !0) {
|
|
820
878
|
try {
|
|
821
879
|
const n = {
|
|
822
880
|
action: "add",
|
|
@@ -847,7 +905,7 @@ async function Be(e, t, r = !0) {
|
|
|
847
905
|
throw h("Error in add", n), n;
|
|
848
906
|
}
|
|
849
907
|
}
|
|
850
|
-
async function
|
|
908
|
+
async function Qe(e, t, r = !0) {
|
|
851
909
|
try {
|
|
852
910
|
const n = {
|
|
853
911
|
action: "remove",
|
|
@@ -878,7 +936,7 @@ async function qe(e, t, r = !0) {
|
|
|
878
936
|
throw h("Error in remove", n), n;
|
|
879
937
|
}
|
|
880
938
|
}
|
|
881
|
-
async function
|
|
939
|
+
async function Ve(e, t, r = !0) {
|
|
882
940
|
try {
|
|
883
941
|
const n = {
|
|
884
942
|
action: "rename",
|
|
@@ -918,7 +976,7 @@ async function Ge(e, t = !0) {
|
|
|
918
976
|
throw h("Error in deleteLabels", r), r;
|
|
919
977
|
}
|
|
920
978
|
}
|
|
921
|
-
async function
|
|
979
|
+
async function je(e, t, r = !0) {
|
|
922
980
|
try {
|
|
923
981
|
const n = {
|
|
924
982
|
action: "bulkAdd",
|
|
@@ -939,7 +997,7 @@ async function Ve(e, t, r = !0) {
|
|
|
939
997
|
throw h("Error in bulkAdd", n), n;
|
|
940
998
|
}
|
|
941
999
|
}
|
|
942
|
-
async function
|
|
1000
|
+
async function ze(e, t, r = !0) {
|
|
943
1001
|
try {
|
|
944
1002
|
const n = {
|
|
945
1003
|
action: "bulkRemove",
|
|
@@ -960,16 +1018,16 @@ async function je(e, t, r = !0) {
|
|
|
960
1018
|
throw h("Error in bulkRemove", n), n;
|
|
961
1019
|
}
|
|
962
1020
|
}
|
|
963
|
-
const
|
|
964
|
-
getUserRights:
|
|
965
|
-
add:
|
|
966
|
-
remove:
|
|
967
|
-
rename:
|
|
1021
|
+
const Xt = {
|
|
1022
|
+
getUserRights: Be,
|
|
1023
|
+
add: qe,
|
|
1024
|
+
remove: Qe,
|
|
1025
|
+
rename: Ve,
|
|
968
1026
|
delete: Ge,
|
|
969
|
-
bulkAdd:
|
|
970
|
-
bulkRemove:
|
|
1027
|
+
bulkAdd: je,
|
|
1028
|
+
bulkRemove: ze
|
|
971
1029
|
};
|
|
972
|
-
async function
|
|
1030
|
+
async function Mt(e, t) {
|
|
973
1031
|
if (typeof window > "u")
|
|
974
1032
|
return u("api/v1/preview", {
|
|
975
1033
|
action: "get",
|
|
@@ -984,7 +1042,7 @@ async function Ht(e, t) {
|
|
|
984
1042
|
browserUrl: r
|
|
985
1043
|
});
|
|
986
1044
|
}
|
|
987
|
-
async function
|
|
1045
|
+
async function Yt(e) {
|
|
988
1046
|
const t = new Headers();
|
|
989
1047
|
t.append("content-type", "text");
|
|
990
1048
|
const r = await fetch(
|
|
@@ -996,15 +1054,15 @@ async function Jt(e) {
|
|
|
996
1054
|
);
|
|
997
1055
|
C(r);
|
|
998
1056
|
}
|
|
999
|
-
async function
|
|
1057
|
+
async function He() {
|
|
1000
1058
|
const e = new URLSearchParams({
|
|
1001
1059
|
action: "get",
|
|
1002
1060
|
noAutoAuthentication: "true"
|
|
1003
1061
|
});
|
|
1004
|
-
return
|
|
1062
|
+
return p("api/v1/principal", e);
|
|
1005
1063
|
}
|
|
1006
|
-
const
|
|
1007
|
-
async function
|
|
1064
|
+
const ce = 11;
|
|
1065
|
+
async function Kt(e, t, r) {
|
|
1008
1066
|
var i;
|
|
1009
1067
|
const a = await u("api/v1/query", {
|
|
1010
1068
|
query: e,
|
|
@@ -1012,12 +1070,12 @@ async function Wt(e, t, r) {
|
|
|
1012
1070
|
queryIntentData: r
|
|
1013
1071
|
});
|
|
1014
1072
|
a.aggregations.forEach((o) => {
|
|
1015
|
-
o.$hasMore = !1, !o.isDistribution && !o.isTree && o.items && (o.$hasMore = o.items.length ===
|
|
1073
|
+
o.$hasMore = !1, !o.isDistribution && !o.isTree && o.items && (o.$hasMore = o.items.length === ce), o.isTree && o.items && z(o);
|
|
1016
1074
|
}), (i = a.records) == null || i.map((o) => Object.assign(o, { value: o.title, type: "default" }));
|
|
1017
1075
|
const s = { ...a, nextPage: a.page < Math.ceil(a.rowCount / a.pageSize) ? a.page + 1 : void 0, previousPage: a.page > 1 ? a.page - 1 : void 0 };
|
|
1018
1076
|
return Promise.resolve(s);
|
|
1019
1077
|
}
|
|
1020
|
-
async function
|
|
1078
|
+
async function Zt(e, t, r) {
|
|
1021
1079
|
const { app: n = "" } = d, a = {
|
|
1022
1080
|
methods: [],
|
|
1023
1081
|
mode: t,
|
|
@@ -1033,7 +1091,7 @@ async function Xt(e, t, r) {
|
|
|
1033
1091
|
const s = await u("api/v1/multi", a);
|
|
1034
1092
|
s.results.forEach((o) => {
|
|
1035
1093
|
o.aggregations.forEach((c) => {
|
|
1036
|
-
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length ===
|
|
1094
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === ce), c.isTree && z(c);
|
|
1037
1095
|
});
|
|
1038
1096
|
}), s.results.forEach((o) => {
|
|
1039
1097
|
var c;
|
|
@@ -1042,20 +1100,14 @@ async function Xt(e, t, r) {
|
|
|
1042
1100
|
const i = s.results.map((o) => ({ ...o, nextPage: o.page < Math.ceil(o.rowCount / o.pageSize) ? o.page + 1 : void 0, previousPage: o.page > 1 ? o.page - 1 : void 0 }));
|
|
1043
1101
|
return Promise.resolve(i);
|
|
1044
1102
|
}
|
|
1045
|
-
function
|
|
1103
|
+
function z(e, t = "", r = 0) {
|
|
1046
1104
|
let n = [];
|
|
1047
1105
|
return e.items && e.items.forEach((a) => {
|
|
1048
1106
|
let s = t ? `${t}/${a.value}` : a.value, i = r + 1;
|
|
1049
|
-
n.push({ path: s, level: i }), a.$path = s, a.$level = i, a.hasChildren ? n = n.concat(
|
|
1107
|
+
n.push({ path: s, level: i }), a.$path = s, a.$level = i, a.hasChildren ? n = n.concat(z(a, s, i)) : a.hasChildren = !1;
|
|
1050
1108
|
}), n;
|
|
1051
1109
|
}
|
|
1052
|
-
async function
|
|
1053
|
-
const r = await u("api/v1/queryintent", {
|
|
1054
|
-
query: e
|
|
1055
|
-
});
|
|
1056
|
-
return r == null ? void 0 : r.intents;
|
|
1057
|
-
}
|
|
1058
|
-
async function Yt({ model: e, appName: t, query: r, article: n }) {
|
|
1110
|
+
async function Et({ model: e, appName: t, query: r, article: n }) {
|
|
1059
1111
|
const { webservice: a, format: s, maxcount: i, exportedColumns: o, export: c } = e, l = {
|
|
1060
1112
|
app: t,
|
|
1061
1113
|
webservice: a,
|
|
@@ -1073,9 +1125,15 @@ async function Yt({ model: e, appName: t, query: r, article: n }) {
|
|
|
1073
1125
|
}]
|
|
1074
1126
|
}
|
|
1075
1127
|
};
|
|
1076
|
-
return
|
|
1128
|
+
return y(l), await u("api/v1/search.queryexport", l, { responseType: "blob" });
|
|
1077
1129
|
}
|
|
1078
|
-
async function
|
|
1130
|
+
async function Tt(e) {
|
|
1131
|
+
const r = await u("api/v1/queryintent", {
|
|
1132
|
+
query: e
|
|
1133
|
+
});
|
|
1134
|
+
return r == null ? void 0 : r.intents;
|
|
1135
|
+
}
|
|
1136
|
+
async function er(e, t, r) {
|
|
1079
1137
|
return (await u(
|
|
1080
1138
|
"api/v1/similardocuments",
|
|
1081
1139
|
{
|
|
@@ -1087,7 +1145,7 @@ async function Kt(e, t, r) {
|
|
|
1087
1145
|
{ signal: r }
|
|
1088
1146
|
)).data;
|
|
1089
1147
|
}
|
|
1090
|
-
async function
|
|
1148
|
+
async function tr(e, t) {
|
|
1091
1149
|
var a;
|
|
1092
1150
|
const n = await u("api/v1/query.links", {
|
|
1093
1151
|
webservice: e,
|
|
@@ -1095,7 +1153,7 @@ async function Zt(e, t) {
|
|
|
1095
1153
|
});
|
|
1096
1154
|
return (a = n == null ? void 0 : n.links) == null ? void 0 : a.map((s) => ({ ...s, query: t }));
|
|
1097
1155
|
}
|
|
1098
|
-
async function
|
|
1156
|
+
async function rr(e, t, r, n, a) {
|
|
1099
1157
|
const { app: s } = d, i = {
|
|
1100
1158
|
app: s || "",
|
|
1101
1159
|
suggestQuery: e,
|
|
@@ -1110,7 +1168,7 @@ async function Et(e, t, r, n, a) {
|
|
|
1110
1168
|
throw console.error("Error fetching suggestions:", o), o;
|
|
1111
1169
|
}
|
|
1112
1170
|
}
|
|
1113
|
-
async function
|
|
1171
|
+
async function nr(e, t, r, n) {
|
|
1114
1172
|
const { app: a } = d;
|
|
1115
1173
|
return (await u("api/v1/suggestquery", {
|
|
1116
1174
|
app: a || "",
|
|
@@ -1120,7 +1178,7 @@ async function Tt(e, t, r, n) {
|
|
|
1120
1178
|
kinds: n
|
|
1121
1179
|
})).suggests;
|
|
1122
1180
|
}
|
|
1123
|
-
async function
|
|
1181
|
+
async function ar(e, t) {
|
|
1124
1182
|
if (!t) return Promise.resolve([]);
|
|
1125
1183
|
const { app: r } = d;
|
|
1126
1184
|
return (await u("api/v1/suggestfield", {
|
|
@@ -1130,7 +1188,7 @@ async function er(e, t) {
|
|
|
1130
1188
|
fields: t
|
|
1131
1189
|
})).suggests;
|
|
1132
1190
|
}
|
|
1133
|
-
async function
|
|
1191
|
+
async function sr(e, t, r, n, a, s) {
|
|
1134
1192
|
return u("api/v1/doc.textchunks", {
|
|
1135
1193
|
id: e,
|
|
1136
1194
|
textChunks: t,
|
|
@@ -1140,36 +1198,46 @@ async function tr(e, t, r, n, a, s) {
|
|
|
1140
1198
|
rightSentencesCount: s
|
|
1141
1199
|
});
|
|
1142
1200
|
}
|
|
1143
|
-
async function
|
|
1201
|
+
async function or() {
|
|
1144
1202
|
const { app: e } = d, t = new URLSearchParams({
|
|
1145
1203
|
app: e || "",
|
|
1146
1204
|
action: "load"
|
|
1147
1205
|
});
|
|
1148
|
-
return
|
|
1206
|
+
return p("api/v1/usersettings", t);
|
|
1149
1207
|
}
|
|
1150
|
-
async function
|
|
1208
|
+
async function Je(e, t) {
|
|
1151
1209
|
const r = {
|
|
1152
1210
|
action: "save",
|
|
1153
1211
|
userSettings: e,
|
|
1154
1212
|
$auditRecord: { auditEvents: [t] }
|
|
1155
1213
|
};
|
|
1156
|
-
return
|
|
1214
|
+
return y(r), u("api/v1/usersettings", r);
|
|
1157
1215
|
}
|
|
1158
|
-
async function
|
|
1216
|
+
async function cr(e, t) {
|
|
1159
1217
|
const n = {
|
|
1160
1218
|
action: "patch",
|
|
1161
1219
|
userSettings: e,
|
|
1162
1220
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1163
1221
|
};
|
|
1164
|
-
return
|
|
1222
|
+
return y(n), u("api/v1/usersettings", n);
|
|
1165
1223
|
}
|
|
1166
|
-
async function
|
|
1167
|
-
return
|
|
1224
|
+
async function ir() {
|
|
1225
|
+
return Je({}, { type: "UserSettings_Reset" });
|
|
1168
1226
|
}
|
|
1169
|
-
async function
|
|
1170
|
-
return
|
|
1227
|
+
async function lr(e, t) {
|
|
1228
|
+
return u("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1229
|
+
}
|
|
1230
|
+
async function ur(e) {
|
|
1231
|
+
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1232
|
+
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1233
|
+
userName: e
|
|
1234
|
+
};
|
|
1235
|
+
return u(t, n);
|
|
1171
1236
|
}
|
|
1172
|
-
|
|
1237
|
+
async function dr() {
|
|
1238
|
+
return await p("api/v2/version");
|
|
1239
|
+
}
|
|
1240
|
+
const We = async () => {
|
|
1173
1241
|
const { autoOAuthProvider: e } = d;
|
|
1174
1242
|
if (typeof window > "u")
|
|
1175
1243
|
return u("security.oauth", {
|
|
@@ -1193,7 +1261,7 @@ const Je = async () => {
|
|
|
1193
1261
|
} catch (r) {
|
|
1194
1262
|
throw console.error("Failed to authenticate with OAuth", r), r;
|
|
1195
1263
|
}
|
|
1196
|
-
},
|
|
1264
|
+
}, Xe = async () => {
|
|
1197
1265
|
const { autoSAMLProvider: e } = d;
|
|
1198
1266
|
if (typeof window > "u")
|
|
1199
1267
|
return u("security.saml", {
|
|
@@ -1217,7 +1285,7 @@ const Je = async () => {
|
|
|
1217
1285
|
} catch (r) {
|
|
1218
1286
|
throw console.error("Failed to authenticate with SAML", r), r;
|
|
1219
1287
|
}
|
|
1220
|
-
},
|
|
1288
|
+
}, H = {
|
|
1221
1289
|
store: {},
|
|
1222
1290
|
getItem(e) {
|
|
1223
1291
|
return this.store[e] ?? null;
|
|
@@ -1231,28 +1299,28 @@ const Je = async () => {
|
|
|
1231
1299
|
clear() {
|
|
1232
1300
|
this.store = {};
|
|
1233
1301
|
}
|
|
1234
|
-
},
|
|
1235
|
-
function Xe(e) {
|
|
1236
|
-
return typeof window > "u" || !window.localStorage ? j.getItem(e) : window.localStorage.getItem(e);
|
|
1237
|
-
}
|
|
1302
|
+
}, J = H;
|
|
1238
1303
|
function Me(e) {
|
|
1239
|
-
typeof window > "u" || !window.localStorage ?
|
|
1304
|
+
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1240
1305
|
}
|
|
1241
1306
|
function Ye(e) {
|
|
1242
|
-
|
|
1307
|
+
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1308
|
+
}
|
|
1309
|
+
function Ke(e) {
|
|
1310
|
+
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
1243
1311
|
}
|
|
1244
|
-
function
|
|
1245
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1312
|
+
function Ze(e, t) {
|
|
1313
|
+
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1246
1314
|
}
|
|
1247
|
-
function
|
|
1248
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1315
|
+
function Ee(e) {
|
|
1316
|
+
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1249
1317
|
}
|
|
1250
|
-
const U = (e) =>
|
|
1318
|
+
const U = (e) => Ze(
|
|
1251
1319
|
"sinequa-credentials",
|
|
1252
1320
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1253
|
-
),
|
|
1321
|
+
), Te = async () => {
|
|
1254
1322
|
try {
|
|
1255
|
-
const e = await
|
|
1323
|
+
const e = await p(
|
|
1256
1324
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true"
|
|
1257
1325
|
);
|
|
1258
1326
|
return e != null && e.csrfToken ? (U(e.csrfToken), e.csrfToken) : null;
|
|
@@ -1260,7 +1328,7 @@ const U = (e) => Ke(
|
|
|
1260
1328
|
throw h("Failed to get CSRF token", e), e;
|
|
1261
1329
|
}
|
|
1262
1330
|
};
|
|
1263
|
-
async function
|
|
1331
|
+
async function et(e) {
|
|
1264
1332
|
if (e) {
|
|
1265
1333
|
const { username: t, password: r } = e, n = {
|
|
1266
1334
|
action: "get",
|
|
@@ -1305,24 +1373,24 @@ async function Te(e) {
|
|
|
1305
1373
|
}
|
|
1306
1374
|
}
|
|
1307
1375
|
}
|
|
1308
|
-
const
|
|
1376
|
+
const W = () => {
|
|
1309
1377
|
var r;
|
|
1310
|
-
const e =
|
|
1378
|
+
const e = Ke("sinequa-credentials");
|
|
1311
1379
|
if (e)
|
|
1312
1380
|
try {
|
|
1313
1381
|
const a = (r = JSON.parse(e).data) == null ? void 0 : r.csrfToken;
|
|
1314
1382
|
if (a !== void 0) return a;
|
|
1315
1383
|
} catch {
|
|
1316
1384
|
}
|
|
1317
|
-
const t =
|
|
1385
|
+
const t = Me("csrfToken");
|
|
1318
1386
|
return t !== null ? t : null;
|
|
1319
|
-
},
|
|
1387
|
+
}, fr = async (e) => {
|
|
1320
1388
|
if (e)
|
|
1321
|
-
|
|
1389
|
+
S("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1322
1390
|
else {
|
|
1323
1391
|
let o = null;
|
|
1324
1392
|
try {
|
|
1325
|
-
|
|
1393
|
+
S("Attempting to retrieve CSRF token from the backend"), o = await Te(), x("CSRF token retrieval result", o ? "success" : "failed");
|
|
1326
1394
|
} catch (c) {
|
|
1327
1395
|
h("Failed to retrieve CSRF token", c);
|
|
1328
1396
|
}
|
|
@@ -1330,162 +1398,170 @@ const H = () => {
|
|
|
1330
1398
|
if (o === null) {
|
|
1331
1399
|
const { autoOAuthProvider: c, autoSAMLProvider: l, useSAML: f } = d;
|
|
1332
1400
|
if (c && !f)
|
|
1333
|
-
return
|
|
1401
|
+
return S("Initiating OAuth authentication flow"), await We(), P("OAuth authentication flow did not redirect as expected"), w(!1), !1;
|
|
1334
1402
|
if (l)
|
|
1335
|
-
return
|
|
1336
|
-
|
|
1403
|
+
return S("Initiating SAML authentication flow"), await Xe(), P("SAML authentication flow did not redirect as expected"), w(!1), !1;
|
|
1404
|
+
S(
|
|
1337
1405
|
"No direct authentication method available, will try SSO then credentials"
|
|
1338
|
-
),
|
|
1406
|
+
), k({ useCredentials: !0, useSSO: !0 });
|
|
1339
1407
|
} else
|
|
1340
|
-
return
|
|
1408
|
+
return S("User authenticated via existing token"), w(!0), !0;
|
|
1341
1409
|
} catch (c) {
|
|
1342
1410
|
throw h("Unexpected error during authentication", c), w(!1), c;
|
|
1343
1411
|
}
|
|
1344
1412
|
}
|
|
1345
1413
|
if (d.useCredentials && d.useSSO)
|
|
1346
1414
|
try {
|
|
1347
|
-
if (
|
|
1348
|
-
return
|
|
1415
|
+
if (S("Checking if user is authenticated via SSO"), await He())
|
|
1416
|
+
return S("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }), w(!0), !0;
|
|
1349
1417
|
} catch (o) {
|
|
1350
1418
|
if ((o == null ? void 0 : o.status) === 401)
|
|
1351
|
-
return
|
|
1419
|
+
return S("SSO authentication failed with 401, falling back to credentials"), k({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1352
1420
|
throw h("SSO authentication failed with unexpected error", o), w(!1), h;
|
|
1353
1421
|
}
|
|
1354
|
-
const { useSSO: r } = d, n =
|
|
1422
|
+
const { useSSO: r } = d, n = W();
|
|
1355
1423
|
if (n && n !== null || r)
|
|
1356
|
-
return
|
|
1424
|
+
return S("user already authenticated", n), k({ isRedirectUrl: !1 }), w(!0), !0;
|
|
1357
1425
|
const { useCredentials: a } = d, { username: s, password: i } = e || {};
|
|
1358
1426
|
if (a && !s && !i)
|
|
1359
1427
|
return h("Credentials are required for authentication"), w(!1), !1;
|
|
1360
1428
|
if (s && i)
|
|
1361
1429
|
try {
|
|
1362
|
-
|
|
1430
|
+
S("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1431
|
+
const { userOverrideActive: o, useroverride: c } = d;
|
|
1432
|
+
return k({ userOverrideActive: !1, useroverride: void 0 }), await et({ username: s, password: i }), k({ userOverrideActive: o, useroverride: c }), w(!0), !0;
|
|
1363
1433
|
} catch (o) {
|
|
1364
1434
|
throw w(!1), o;
|
|
1365
1435
|
}
|
|
1366
1436
|
return w(!1), h(
|
|
1367
1437
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1368
1438
|
), !1;
|
|
1369
|
-
},
|
|
1439
|
+
}, tt = async () => {
|
|
1370
1440
|
const e = new URLSearchParams({
|
|
1371
1441
|
action: "deleteWebTokenCookie",
|
|
1372
1442
|
noUserOverride: "true",
|
|
1373
1443
|
noAutoAuthentication: "true"
|
|
1374
1444
|
});
|
|
1375
|
-
return
|
|
1376
|
-
},
|
|
1445
|
+
return p("api/v1/challenge", e);
|
|
1446
|
+
}, hr = async () => {
|
|
1377
1447
|
const { useCredentials: e, userOverrideActive: t } = d;
|
|
1378
|
-
|
|
1379
|
-
},
|
|
1448
|
+
Ye("csrfToken"), Ee("sinequa-credentials"), e && !t ? (await tt()).methodresult === "ok" ? w(!1) : console.error("logout failed") : w(!1);
|
|
1449
|
+
}, mr = () => !!W();
|
|
1380
1450
|
export {
|
|
1381
|
-
|
|
1382
|
-
|
|
1451
|
+
b as ApiError,
|
|
1452
|
+
Qt as Audit,
|
|
1383
1453
|
v as AuditEventType,
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1454
|
+
ve as DidYouMeanKind,
|
|
1455
|
+
m as EngineType,
|
|
1456
|
+
g as EngineTypeModifier,
|
|
1457
|
+
ae as LogLevel,
|
|
1458
|
+
It as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1459
|
+
be as RFMDisplay,
|
|
1460
|
+
K as ServerError,
|
|
1461
|
+
ue as TimeoutError,
|
|
1462
|
+
G as UnauthorizedError,
|
|
1463
|
+
y as addAuditAdditionalInfo,
|
|
1464
|
+
ct as addConcepts,
|
|
1465
|
+
Ue as addSessionId,
|
|
1466
|
+
Ie as addUrl,
|
|
1467
|
+
de as aggItemRegex,
|
|
1468
|
+
at as aggregationItemStrictCompare,
|
|
1469
|
+
jt as appInitializerFn,
|
|
1470
|
+
ot as bisect,
|
|
1471
|
+
z as buildPathsAndLevels,
|
|
1472
|
+
Ct as configureLogger,
|
|
1473
|
+
L as createHeaders,
|
|
1474
|
+
Lt as createTimeoutController,
|
|
1475
|
+
x as debug,
|
|
1476
|
+
Rt as del,
|
|
1477
|
+
ir as deleteUserSettings,
|
|
1478
|
+
tt as deleteWebTokenCookie,
|
|
1409
1479
|
w as emitAuthenticatedEvent,
|
|
1410
1480
|
h as error,
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
Ht as
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
er as
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1481
|
+
Bt as escapeExpr,
|
|
1482
|
+
Ot as expiresSoon,
|
|
1483
|
+
Dt as extraColumns,
|
|
1484
|
+
Vt as fetchAggregation,
|
|
1485
|
+
Gt as fetchApp,
|
|
1486
|
+
Fe as fetchAppPreLogin,
|
|
1487
|
+
Zt as fetchBulkQuery,
|
|
1488
|
+
lr as fetchChangePassword,
|
|
1489
|
+
zt as fetchDataset,
|
|
1490
|
+
Jt as fetchDatasetList,
|
|
1491
|
+
Ht as fetchDatasets,
|
|
1492
|
+
Wt as fetchLabels,
|
|
1493
|
+
Mt as fetchPreview,
|
|
1494
|
+
Yt as fetchPreviewUrl,
|
|
1495
|
+
He as fetchPrincipal,
|
|
1496
|
+
Kt as fetchQuery,
|
|
1497
|
+
Et as fetchQueryExport,
|
|
1498
|
+
Tt as fetchQueryIntent,
|
|
1499
|
+
ur as fetchSendPasswordResetEmail,
|
|
1500
|
+
er as fetchSimilarDocuments,
|
|
1501
|
+
tr as fetchSponsoredLinks,
|
|
1502
|
+
rr as fetchSuggest,
|
|
1503
|
+
ar as fetchSuggestField,
|
|
1504
|
+
nr as fetchSuggestQuery,
|
|
1505
|
+
sr as fetchTextChunks,
|
|
1506
|
+
or as fetchUserSettings,
|
|
1507
|
+
dr as fetchVersion,
|
|
1508
|
+
p as get,
|
|
1509
|
+
ut as getConcepts,
|
|
1510
|
+
Te as getCsrfToken,
|
|
1438
1511
|
ne as getFiltersFromURI,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1512
|
+
_t as getFiltersFromUrl,
|
|
1513
|
+
vt as getHelpIndexUrl,
|
|
1514
|
+
gt as getIdFromUrl,
|
|
1515
|
+
et as getJWToken,
|
|
1516
|
+
At as getMetadata,
|
|
1517
|
+
Nt as getMetadataWithValues,
|
|
1518
|
+
pe as getOffsetFromDates,
|
|
1519
|
+
St as getQueryPageFromUrl,
|
|
1520
|
+
ht as getQueryParamsFromUrl,
|
|
1521
|
+
kt as getQueryTabFromUrl,
|
|
1522
|
+
wt as getQueryTextFromUrl,
|
|
1523
|
+
dt as getRelativeDate,
|
|
1524
|
+
W as getToken,
|
|
1525
|
+
mt as getUrlParamsFromQueryParams,
|
|
1452
1526
|
d as globalConfig,
|
|
1453
|
-
|
|
1527
|
+
Oe as guid,
|
|
1454
1528
|
C as handleResponse,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1529
|
+
S as info,
|
|
1530
|
+
Pe as isArrayBuffer,
|
|
1531
|
+
mr as isAuthenticated,
|
|
1532
|
+
Le as isBlob,
|
|
1533
|
+
yt as isExpired,
|
|
1534
|
+
Ft as isJsonable,
|
|
1535
|
+
ft as isNotInputEvent,
|
|
1536
|
+
A as isObject,
|
|
1537
|
+
ye as isString,
|
|
1538
|
+
Xt as labels,
|
|
1539
|
+
fr as login,
|
|
1540
|
+
hr as logout,
|
|
1541
|
+
_ as makeColumn,
|
|
1542
|
+
bt as notify,
|
|
1543
|
+
he as openParentNodes,
|
|
1544
|
+
I as parseText,
|
|
1545
|
+
fe as parseValueAndOperatorFromItem,
|
|
1546
|
+
xt as patch,
|
|
1547
|
+
cr as patchUserSettings,
|
|
1473
1548
|
u as post,
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1549
|
+
Pt as put,
|
|
1550
|
+
R as queryParamsFromUrl,
|
|
1551
|
+
it as removeConcept,
|
|
1552
|
+
lt as removeConcepts,
|
|
1553
|
+
Ut as resolveToColumnName,
|
|
1554
|
+
j as rewriteText,
|
|
1555
|
+
Je as saveUserSettings,
|
|
1556
|
+
k as setGlobalConfig,
|
|
1482
1557
|
U as setToken,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
We as
|
|
1489
|
-
|
|
1490
|
-
|
|
1558
|
+
qt as sha512,
|
|
1559
|
+
st as suggestionsToTreeAggregationNodes,
|
|
1560
|
+
pt as sysLang,
|
|
1561
|
+
se as toDate,
|
|
1562
|
+
nt as translateAggregationToDateOptions,
|
|
1563
|
+
We as tryOAuthAuthentication,
|
|
1564
|
+
Xe as trySAMLAuthentication,
|
|
1565
|
+
P as warn,
|
|
1566
|
+
$t as withRetry
|
|
1491
1567
|
};
|