@sinequa/atomic 0.0.124 → 0.0.134
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 +762 -629
- 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/api-endpoints.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.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/types/user-profile/user-profile.d.ts +31 -0
- package/dist/types/user-profile/user-profile.d.ts.map +1 -0
- 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/patch.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 +5 -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/v1/fetch-principal.d.ts +55 -0
- package/dist/web-api/v1/fetch-principal.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/dist/web-api/v2/fetch-user-profile.d.ts +50 -0
- package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/atomic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var le = Object.defineProperty;
|
|
2
|
+
var ue = (e, t, r) => t in e ? le(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Y = (e, t, r) => ue(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
function _(e) {
|
|
5
5
|
const t = new CustomEvent("authenticated", {
|
|
6
6
|
bubbles: !0,
|
|
7
7
|
cancelable: !1,
|
|
@@ -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 de 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 V extends b {
|
|
43
|
+
constructor(t = "Unauthorized access") {
|
|
44
|
+
super(t, 401), this.name = "UnauthorizedError";
|
|
318
45
|
}
|
|
319
46
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
47
|
+
const fe = /.*\:\(?([><=\d\-\.AND ]+)\)?/;
|
|
48
|
+
function ct(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 = he(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 he(e, t) {
|
|
64
|
+
const r = t, n = e.value.match(fe);
|
|
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 it(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 me(e) {
|
|
83
|
+
return e.items && (e.items = e.items.map((t) => me(t))), e.items && e.items.some((t) => t.$selected || t.$opened) && (e.$opened = !0), e;
|
|
357
84
|
}
|
|
358
|
-
function
|
|
85
|
+
function lt(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,15 +112,15 @@ 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 ut(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 we = /(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g, _e = 2, Z = 3, ge = 5, E = 6, Se = 8, T = 9, pe = 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(we);
|
|
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[ge] }) : n[T] ? t.push({ type: "exact", value: n[T], op: n[Se] }) : n[ee] ? t.push({ type: "regex", value: n[ee], op: n[pe] }) : n[te] && t.push({ type: "token", value: n[te], op: n[ke] });
|
|
397
124
|
return t;
|
|
398
125
|
}
|
|
399
126
|
function G(e) {
|
|
@@ -413,28 +140,28 @@ function G(e) {
|
|
|
413
140
|
}
|
|
414
141
|
}).join(" ");
|
|
415
142
|
}
|
|
416
|
-
function
|
|
417
|
-
let n =
|
|
143
|
+
function dt(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
147
|
return G(n);
|
|
421
148
|
}
|
|
422
|
-
function
|
|
423
|
-
const r =
|
|
149
|
+
function ft(e, t) {
|
|
150
|
+
const r = I(t), n = r.findIndex((a) => a.value === e);
|
|
424
151
|
return n !== -1 ? (r.splice(n, 1), t = G(r)) : t;
|
|
425
152
|
}
|
|
426
|
-
function
|
|
427
|
-
const t =
|
|
153
|
+
function ht(e) {
|
|
154
|
+
const t = I(e).filter((r) => r.type !== "adjacent");
|
|
428
155
|
return G(t);
|
|
429
156
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
157
|
+
function mt(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 wt(e, t, r) {
|
|
161
|
+
const n = new Intl.RelativeTimeFormat(e, { numeric: "auto" }), { offset: a, unit: s, isFuture: i } = ve(t, r);
|
|
435
162
|
return n.format(a * (i ? 1 : -1), s);
|
|
436
163
|
}
|
|
437
|
-
function
|
|
164
|
+
function ve(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 _t(e) {
|
|
446
173
|
const t = e.target;
|
|
447
174
|
return t && t.nodeName !== "INPUT" && t.nodeName !== "TEXTAREA";
|
|
448
175
|
}
|
|
449
|
-
function
|
|
176
|
+
function gt(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 St(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 pt(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 kt(e) {
|
|
217
|
+
const { q: t = "" } = R(e);
|
|
491
218
|
return t;
|
|
492
219
|
}
|
|
493
|
-
function
|
|
494
|
-
const { id: t } =
|
|
220
|
+
function vt(e) {
|
|
221
|
+
const { id: t } = R(e);
|
|
495
222
|
return decodeURIComponent(t);
|
|
496
223
|
}
|
|
497
|
-
function
|
|
498
|
-
const { p: t = "0" } =
|
|
224
|
+
function bt(e) {
|
|
225
|
+
const { p: t = "0" } = R(e);
|
|
499
226
|
return parseInt(t, 10);
|
|
500
227
|
}
|
|
501
|
-
function
|
|
502
|
-
const { t } =
|
|
228
|
+
function Ct(e) {
|
|
229
|
+
const { t } = R(e);
|
|
503
230
|
return t;
|
|
504
231
|
}
|
|
505
|
-
function
|
|
232
|
+
function Rt(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 xt(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 Pt = {
|
|
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 U = {
|
|
318
|
+
level: 1,
|
|
319
|
+
enableConsoleOutput: !0
|
|
320
|
+
};
|
|
321
|
+
function Lt(e) {
|
|
322
|
+
U = { ...U, ...e };
|
|
323
|
+
}
|
|
324
|
+
function D(e, t, r) {
|
|
325
|
+
if (e < U.level) return;
|
|
326
|
+
const a = `${`[${ae[e]}]`} ${t}`;
|
|
327
|
+
if (U.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 p(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 && $(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 V("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 V() : 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 V(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 yt(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 S(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,74 +433,320 @@ 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 be(e, t, r) {
|
|
437
|
+
const n = L(r == null ? void 0 : r.headers);
|
|
438
|
+
n.append("content-type", "application/json");
|
|
439
|
+
const { app: a, backendUrl: s } = d, i = {
|
|
632
440
|
app: a,
|
|
633
441
|
...t,
|
|
634
442
|
locale: t.locale || navigator.language,
|
|
635
443
|
noUserOverride: !0,
|
|
636
444
|
noAutoAuthentication: !0
|
|
637
|
-
}, o = `${s}/${e}`;
|
|
638
|
-
|
|
445
|
+
}, o = s ? `${s}/${e}` : `${e}`;
|
|
446
|
+
x(`Making PATCH request to: ${o}`);
|
|
639
447
|
try {
|
|
640
448
|
const c = await fetch(o, {
|
|
641
|
-
method: "
|
|
449
|
+
method: "PATCH",
|
|
642
450
|
headers: n,
|
|
643
451
|
credentials: "include",
|
|
644
452
|
body: JSON.stringify(i)
|
|
645
453
|
});
|
|
646
454
|
return C(c, r == null ? void 0 : r.responseType);
|
|
647
455
|
} catch (c) {
|
|
648
|
-
throw h("Error making
|
|
456
|
+
throw h("Error making PATCH request:", c), c;
|
|
649
457
|
}
|
|
650
458
|
}
|
|
651
|
-
async function
|
|
652
|
-
const n =
|
|
653
|
-
|
|
459
|
+
async function u(e, t, r) {
|
|
460
|
+
const n = L(r == null ? void 0 : r.headers), { app: a, backendUrl: s } = d;
|
|
461
|
+
n.has("Content-Type") || n.set("Content-Type", "application/json");
|
|
462
|
+
const i = {
|
|
463
|
+
app: a,
|
|
464
|
+
...t,
|
|
465
|
+
locale: t.locale || navigator.language,
|
|
466
|
+
noUserOverride: !0,
|
|
467
|
+
noAutoAuthentication: !0
|
|
468
|
+
};
|
|
469
|
+
e.startsWith("plugin") && (e = `api/v1/${e}`);
|
|
470
|
+
const o = s ? `${s}/${e}` : `${e}`;
|
|
471
|
+
x(`Making POST request to: ${o}`);
|
|
654
472
|
try {
|
|
655
|
-
const
|
|
656
|
-
method: "
|
|
473
|
+
const c = await fetch(o, {
|
|
474
|
+
method: "POST",
|
|
475
|
+
headers: n,
|
|
657
476
|
credentials: "include",
|
|
658
|
-
|
|
477
|
+
body: JSON.stringify(i),
|
|
478
|
+
signal: r == null ? void 0 : r.signal
|
|
659
479
|
});
|
|
660
|
-
return C(
|
|
661
|
-
} catch (
|
|
662
|
-
throw h("Error making
|
|
480
|
+
return C(c, r == null ? void 0 : r.responseType);
|
|
481
|
+
} catch (c) {
|
|
482
|
+
throw h("Error making POST request:", c), c;
|
|
663
483
|
}
|
|
664
484
|
}
|
|
665
|
-
async function
|
|
666
|
-
const n =
|
|
485
|
+
async function Ot(e, t, r) {
|
|
486
|
+
const n = L(r == null ? void 0 : r.headers), { app: a, backendUrl: s } = d, i = {
|
|
667
487
|
app: a,
|
|
668
488
|
...t,
|
|
669
489
|
locale: t.locale || navigator.language,
|
|
670
490
|
noUserOverride: !0,
|
|
671
491
|
noAutoAuthentication: !0
|
|
672
|
-
}, o =
|
|
673
|
-
|
|
492
|
+
}, o = `${s}/${e}`;
|
|
493
|
+
x(`Making PUT request to: ${o}`);
|
|
674
494
|
try {
|
|
675
495
|
const c = await fetch(o, {
|
|
676
|
-
method: "
|
|
496
|
+
method: "PUT",
|
|
677
497
|
headers: n,
|
|
678
498
|
credentials: "include",
|
|
679
499
|
body: JSON.stringify(i)
|
|
680
500
|
});
|
|
681
501
|
return C(c, r == null ? void 0 : r.responseType);
|
|
682
502
|
} catch (c) {
|
|
683
|
-
throw h("Error making
|
|
503
|
+
throw h("Error making PUT request:", c), c;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function Ut(e) {
|
|
507
|
+
const t = new AbortController(), { signal: r } = t;
|
|
508
|
+
return e && setTimeout(() => {
|
|
509
|
+
r.aborted || t.abort(new de(`Request timed out after ${e}ms`));
|
|
510
|
+
}, e), { controller: t, signal: r };
|
|
511
|
+
}
|
|
512
|
+
function se(e) {
|
|
513
|
+
if (!e) return;
|
|
514
|
+
const t = new Date(e);
|
|
515
|
+
return Number.isNaN(t.getTime()) ? void 0 : t;
|
|
516
|
+
}
|
|
517
|
+
function $t(e) {
|
|
518
|
+
const t = se(e);
|
|
519
|
+
return !!t && t.getTime() <= Date.now();
|
|
520
|
+
}
|
|
521
|
+
function It(e, t = 7) {
|
|
522
|
+
const r = se(e);
|
|
523
|
+
if (!r) return !1;
|
|
524
|
+
const n = Date.now(), a = n + t * 24 * 60 * 60 * 1e3, s = r.getTime();
|
|
525
|
+
return s > n && s <= a;
|
|
526
|
+
}
|
|
527
|
+
async function Dt(e, t = 0, r = 1e3) {
|
|
528
|
+
let n;
|
|
529
|
+
for (let a = 0; a <= t; a++)
|
|
530
|
+
try {
|
|
531
|
+
return await e();
|
|
532
|
+
} catch (s) {
|
|
533
|
+
if (n = s, s instanceof b && s.status >= 400 && s.status < 500 && s.status !== 429 || s instanceof DOMException && s.name === "AbortError")
|
|
534
|
+
throw s;
|
|
535
|
+
a < t && (P(`Retrying request (${a + 1}/${t})`, { error: s }), await new Promise((i) => setTimeout(i, r)));
|
|
536
|
+
}
|
|
537
|
+
throw n;
|
|
538
|
+
}
|
|
539
|
+
function At(e, t, r) {
|
|
540
|
+
var s, i, o, c;
|
|
541
|
+
if (!e || !t) return;
|
|
542
|
+
if (r) {
|
|
543
|
+
const l = Object.keys(t.queries).find((F) => F === (r == null ? void 0 : r.toLowerCase()));
|
|
544
|
+
let f;
|
|
545
|
+
l && (f = t.queries[l]);
|
|
546
|
+
const N = (i = ((s = f == null ? void 0 : f.columnsInfo) == null ? void 0 : s.columns) || []) == null ? void 0 : i.find((F) => {
|
|
547
|
+
var X, M;
|
|
548
|
+
return (M = (X = F.aliases) == null ? void 0 : X.split(",")) == null ? void 0 : M.includes(e);
|
|
549
|
+
});
|
|
550
|
+
if (N) return N.name;
|
|
551
|
+
}
|
|
552
|
+
const n = (c = (o = t.indexes) == null ? void 0 : o._) == null ? void 0 : c.columns, a = Object.entries(n).find((l) => {
|
|
553
|
+
var f;
|
|
554
|
+
return (f = l[1].aliases) == null ? void 0 : f.includes(e);
|
|
555
|
+
});
|
|
556
|
+
if (a) return a[0];
|
|
557
|
+
}
|
|
558
|
+
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 || {});
|
|
559
|
+
const Nt = "1.0";
|
|
560
|
+
var Ce = /* @__PURE__ */ ((e) => (e[e.Original = 0] = "Original", e[e.Corrected = 1] = "Corrected", e))(Ce || {}), Re = /* @__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))(Re || {});
|
|
561
|
+
function xe(e) {
|
|
562
|
+
if (!e)
|
|
563
|
+
return m.none;
|
|
564
|
+
switch (e.toLocaleLowerCase()) {
|
|
565
|
+
case "bool":
|
|
566
|
+
case "boolean":
|
|
567
|
+
return m.bool;
|
|
568
|
+
case "date":
|
|
569
|
+
return m.date;
|
|
570
|
+
case "datetime":
|
|
571
|
+
return m.dateTime;
|
|
572
|
+
case "time":
|
|
573
|
+
return m.time;
|
|
574
|
+
case "unsigned":
|
|
575
|
+
return m.unsigned;
|
|
576
|
+
case "integer":
|
|
577
|
+
return m.integer;
|
|
578
|
+
case "float":
|
|
579
|
+
return m.float;
|
|
580
|
+
case "double":
|
|
581
|
+
return m.double;
|
|
582
|
+
case "dates":
|
|
583
|
+
return m.dates;
|
|
584
|
+
case "datetimes":
|
|
585
|
+
return m.dateTimes;
|
|
586
|
+
case "times":
|
|
587
|
+
return m.times;
|
|
588
|
+
case "varchar":
|
|
589
|
+
return m.varchar;
|
|
590
|
+
case "binary":
|
|
591
|
+
return m.binary;
|
|
592
|
+
case "string":
|
|
593
|
+
return m.string;
|
|
594
|
+
case "csv":
|
|
595
|
+
return m.csv;
|
|
596
|
+
default:
|
|
597
|
+
return m.none;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function Pe(e) {
|
|
601
|
+
switch (e) {
|
|
602
|
+
case "a":
|
|
603
|
+
return g.a;
|
|
604
|
+
case "c":
|
|
605
|
+
return g.c;
|
|
606
|
+
case "d":
|
|
607
|
+
return g.d;
|
|
608
|
+
case "e":
|
|
609
|
+
return g.e;
|
|
610
|
+
case "i":
|
|
611
|
+
return g.i;
|
|
612
|
+
case "l":
|
|
613
|
+
return g.l;
|
|
614
|
+
case "n":
|
|
615
|
+
return g.n;
|
|
616
|
+
case "t":
|
|
617
|
+
return g.t;
|
|
618
|
+
case "x":
|
|
619
|
+
return g.x;
|
|
620
|
+
case "z":
|
|
621
|
+
return g.z;
|
|
622
|
+
default:
|
|
623
|
+
return g.none;
|
|
684
624
|
}
|
|
685
625
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
626
|
+
function Le(e) {
|
|
627
|
+
let t = g.none;
|
|
628
|
+
if (e)
|
|
629
|
+
for (const r of e)
|
|
630
|
+
t |= Pe(r);
|
|
631
|
+
return t;
|
|
632
|
+
}
|
|
633
|
+
function w(e, t, r, n) {
|
|
634
|
+
const a = xe(t), s = Le(r || "");
|
|
635
|
+
return {
|
|
636
|
+
name: e,
|
|
637
|
+
type: t,
|
|
638
|
+
typeModifier: r,
|
|
639
|
+
eType: a,
|
|
640
|
+
eTypeModifier: s,
|
|
641
|
+
aliases: n
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const Ft = {
|
|
645
|
+
id: w("id", "string"),
|
|
646
|
+
text: w("text", "varchar"),
|
|
647
|
+
documentlanguages: w("documentlanguages", "csv", "ci", ["language"]),
|
|
648
|
+
databasealias: w("databasealias", "varchar"),
|
|
649
|
+
globalrelevance: w("globalrelevance", "double"),
|
|
650
|
+
matchingpartnames: w("matchingpartnames", "csv"),
|
|
651
|
+
matchlocations: w("matchlocations", "csv"),
|
|
652
|
+
matchlocationsperpartname: w("matchlocationsperpartname", "varchar"),
|
|
653
|
+
// json
|
|
654
|
+
extracts: w("extracts", "csv"),
|
|
655
|
+
extractsperpartname: w("extractsperpartname", "varchar"),
|
|
656
|
+
// json
|
|
657
|
+
extractslocations: w("extractslocations", "csv"),
|
|
658
|
+
documentweight: w("documentweight", "varchar"),
|
|
659
|
+
groupcount: w("groupcount", "integer"),
|
|
660
|
+
accesslists: w("accesslists", "varchar", void 0, ["accessLists"])
|
|
661
|
+
// json
|
|
662
|
+
};
|
|
663
|
+
function Bt(e, t) {
|
|
664
|
+
let r = e[t];
|
|
665
|
+
return r === void 0 ? [] : (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r) ? r.map((n) => {
|
|
666
|
+
if (typeof n == "string") return n.trim();
|
|
667
|
+
if (typeof n == "object" && n !== null && "display" in n)
|
|
668
|
+
return n.display.trim();
|
|
669
|
+
}).filter((n) => n !== void 0) : [String(r).trim()]);
|
|
670
|
+
}
|
|
671
|
+
function qt(e, t) {
|
|
672
|
+
let r = e[t];
|
|
673
|
+
if (r === void 0) return [];
|
|
674
|
+
if (typeof r == "string" && (r = String(r).split(",")), Array.isArray(r))
|
|
675
|
+
return r.map((a) => {
|
|
676
|
+
if (typeof a == "string")
|
|
677
|
+
return { display: a.trim(), value: a.trim() };
|
|
678
|
+
if (typeof a == "object" && a !== null && "display" in a) {
|
|
679
|
+
const s = a.display.trim(), i = "value" in a ? String(a.value).trim() : s;
|
|
680
|
+
return { display: s, value: i };
|
|
681
|
+
}
|
|
682
|
+
}).filter(
|
|
683
|
+
(a) => a !== void 0
|
|
684
|
+
);
|
|
685
|
+
const n = String(r).trim();
|
|
686
|
+
return [{ display: n, value: n }];
|
|
687
|
+
}
|
|
688
|
+
function A(e) {
|
|
689
|
+
return e !== null && typeof e == "object";
|
|
690
|
+
}
|
|
691
|
+
function ye(e) {
|
|
692
|
+
return A(e) && Object.prototype.toString.call(e) === "[object ArrayBuffer]";
|
|
693
|
+
}
|
|
694
|
+
function Oe(e) {
|
|
695
|
+
return A(e) && Object.prototype.toString.call(e) === "[object Blob]";
|
|
690
696
|
}
|
|
691
|
-
function
|
|
697
|
+
function Ue(e) {
|
|
698
|
+
return typeof e == "string";
|
|
699
|
+
}
|
|
700
|
+
function Qt(e) {
|
|
701
|
+
return (A(e) || Array.isArray(e)) && !ye(e) && !Oe(e) && !Ue(e);
|
|
702
|
+
}
|
|
703
|
+
function $e(e = !0) {
|
|
704
|
+
let t = Date.now();
|
|
705
|
+
return (e ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, (n) => {
|
|
706
|
+
const a = (t + Math.random() * 16) % 16 | 0;
|
|
707
|
+
return t = Math.floor(t / 16), (n === "x" ? a : a & 3 | 8).toString(16);
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
function jt(e) {
|
|
711
|
+
if (!e)
|
|
712
|
+
return "``";
|
|
713
|
+
if (e = String(e), e.search(/[\\`]/) === -1)
|
|
714
|
+
return "`" + e + "`";
|
|
715
|
+
const t = ["`"];
|
|
716
|
+
for (let r = 0, n = e.length; r < n; r++) {
|
|
717
|
+
const a = e[r];
|
|
718
|
+
(a === "\\" || a === "`") && t.push("\\"), t.push(a);
|
|
719
|
+
}
|
|
720
|
+
return t.push("`"), t.join("");
|
|
721
|
+
}
|
|
722
|
+
function Vt(e) {
|
|
723
|
+
if (typeof crypto < "u" && crypto.subtle && typeof crypto.subtle.digest == "function")
|
|
724
|
+
try {
|
|
725
|
+
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)));
|
|
726
|
+
} catch {
|
|
727
|
+
return Promise.resolve(Q(e));
|
|
728
|
+
}
|
|
729
|
+
return Promise.resolve(Q(e));
|
|
730
|
+
}
|
|
731
|
+
function Q(e) {
|
|
732
|
+
let n = 2166136261;
|
|
733
|
+
for (let f = 0; f < e.length; f++)
|
|
734
|
+
n ^= e.charCodeAt(f), n = n * 16777619 >>> 0;
|
|
735
|
+
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;
|
|
736
|
+
return (c + c + c + c).substring(0, 128);
|
|
737
|
+
}
|
|
738
|
+
let j, oe;
|
|
739
|
+
function y(e, t = !0) {
|
|
740
|
+
let r = Ie(e.$auditRecord);
|
|
741
|
+
r && (De(r), t && Ae(r)), e.$auditRecord = r;
|
|
742
|
+
}
|
|
743
|
+
function Ie(e) {
|
|
692
744
|
if (!e)
|
|
693
745
|
return;
|
|
694
746
|
let t;
|
|
695
747
|
if (Array.isArray(e))
|
|
696
748
|
t = e;
|
|
697
|
-
else if (
|
|
749
|
+
else if (A(e)) {
|
|
698
750
|
const r = e;
|
|
699
751
|
if (r.auditEvents || r.mlAuditEvents)
|
|
700
752
|
return r;
|
|
@@ -702,97 +754,105 @@ function $e(e) {
|
|
|
702
754
|
}
|
|
703
755
|
return { auditEvents: t };
|
|
704
756
|
}
|
|
705
|
-
function
|
|
757
|
+
function De(e) {
|
|
706
758
|
var r;
|
|
707
|
-
const t =
|
|
759
|
+
const t = Ne();
|
|
708
760
|
return (r = e.auditEvents) == null || r.forEach((n) => {
|
|
709
761
|
n.detail || (n.detail = {}), n.detail.sessionid = t;
|
|
710
762
|
}), e;
|
|
711
763
|
}
|
|
712
|
-
function
|
|
764
|
+
function Ae(e) {
|
|
713
765
|
var r;
|
|
714
766
|
const t = typeof window < "u" ? decodeURIComponent(window.location.href) : "http://localhost";
|
|
715
767
|
return (r = e == null ? void 0 : e.auditEvents) == null || r.forEach((n) => {
|
|
716
768
|
n.detail || (n.detail = {}), n.detail.url = t;
|
|
717
769
|
}), e;
|
|
718
770
|
}
|
|
719
|
-
function
|
|
720
|
-
return (!
|
|
771
|
+
function Ne() {
|
|
772
|
+
return (!j || Fe()) && (j = $e()), oe = /* @__PURE__ */ new Date(), j;
|
|
721
773
|
}
|
|
722
|
-
function
|
|
723
|
-
return (/* @__PURE__ */ new Date()).getTime() -
|
|
774
|
+
function Fe() {
|
|
775
|
+
return (/* @__PURE__ */ new Date()).getTime() - oe.getTime() > 10 * 60 * 1e3;
|
|
724
776
|
}
|
|
725
|
-
async function
|
|
777
|
+
async function Be(e, t = !0) {
|
|
726
778
|
const r = {
|
|
727
779
|
event: v.None,
|
|
728
780
|
$auditRecord: e
|
|
729
781
|
};
|
|
730
|
-
return
|
|
782
|
+
return y(r, t), u("api/v1/audit.notify", r);
|
|
731
783
|
}
|
|
732
|
-
const
|
|
733
|
-
async function
|
|
784
|
+
const Gt = { notify: Be };
|
|
785
|
+
async function zt(e, t, r) {
|
|
734
786
|
var f;
|
|
735
787
|
const n = ((f = e.items) == null ? void 0 : f.length) || 0, a = 10, s = {
|
|
736
788
|
query: { ...t, action: "aggregate", aggregations: { [e.name]: { skip: n, count: a } } },
|
|
737
789
|
$auditRecord: { auditEvents: [r] }
|
|
738
790
|
};
|
|
739
|
-
|
|
791
|
+
y(s);
|
|
740
792
|
const i = await u("api/v1/query", s), o = await C(i), { aggregations: c } = o, l = c[0];
|
|
741
793
|
return l.$hasMore = l.items.length > a, l.items = [...e.items, ...l.items], Promise.resolve(l);
|
|
742
794
|
}
|
|
743
|
-
async function
|
|
795
|
+
async function Ht() {
|
|
744
796
|
const { app: e } = d, t = new URLSearchParams({ app: e || "" });
|
|
745
|
-
return
|
|
797
|
+
return S("api/v1/app", t);
|
|
746
798
|
}
|
|
747
|
-
async function
|
|
799
|
+
async function qe() {
|
|
748
800
|
const { app: e } = d, t = new URLSearchParams({
|
|
749
801
|
app: e || "",
|
|
750
802
|
preLogin: "true"
|
|
751
803
|
});
|
|
752
|
-
return
|
|
804
|
+
return S("api/v1/app", t);
|
|
753
805
|
}
|
|
754
|
-
function
|
|
755
|
-
let { backendUrl: e, app: t } = d;
|
|
806
|
+
function Jt() {
|
|
807
|
+
let { backendUrl: e, app: t, useCredentials: r } = d;
|
|
756
808
|
if (typeof window < "u") {
|
|
757
809
|
if (e || (e = window.location.origin), !t) {
|
|
758
|
-
const
|
|
810
|
+
const n = window.location.pathname.match(
|
|
759
811
|
/\/app(?:-debug)?\/([^/#]+)/
|
|
760
812
|
);
|
|
761
|
-
|
|
813
|
+
n && (t = n[1]);
|
|
762
814
|
}
|
|
763
|
-
|
|
815
|
+
k({
|
|
764
816
|
...d,
|
|
765
817
|
backendUrl: e,
|
|
766
818
|
app: t
|
|
767
819
|
});
|
|
768
820
|
}
|
|
769
|
-
return
|
|
770
|
-
|
|
771
|
-
|
|
821
|
+
return r ? (k({
|
|
822
|
+
...d,
|
|
823
|
+
useCredentials: !0,
|
|
824
|
+
useSSO: !1,
|
|
825
|
+
autoOAuthProvider: void 0,
|
|
826
|
+
autoSAMLProvider: void 0,
|
|
827
|
+
bearerToken: void 0,
|
|
828
|
+
useSAML: void 0
|
|
829
|
+
}), Promise.resolve({})) : qe().then((n) => {
|
|
830
|
+
const { autoOAuthProvider: a, autoSAMLProvider: s } = d, i = !a && !n.autoOAuthProvider && !s && !n.autoSAMLProvider;
|
|
831
|
+
return k({
|
|
772
832
|
...d,
|
|
773
|
-
autoOAuthProvider:
|
|
774
|
-
autoSAMLProvider:
|
|
775
|
-
useCredentials:
|
|
776
|
-
useSSO:
|
|
777
|
-
}),
|
|
778
|
-
}).catch((
|
|
779
|
-
throw h("atomic:fetchAppPreLogin error",
|
|
833
|
+
autoOAuthProvider: a || n.autoOAuthProvider,
|
|
834
|
+
autoSAMLProvider: s || n.autoSAMLProvider,
|
|
835
|
+
useCredentials: i,
|
|
836
|
+
useSSO: i
|
|
837
|
+
}), n;
|
|
838
|
+
}).catch((n) => {
|
|
839
|
+
throw h("atomic:fetchAppPreLogin error", n), n;
|
|
780
840
|
});
|
|
781
841
|
}
|
|
782
|
-
async function
|
|
842
|
+
async function Wt(e, t, r = {}) {
|
|
783
843
|
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
844
|
if ("errorCode" in i && "errorMessage" in i)
|
|
785
845
|
throw new Error(i.errorMessage);
|
|
786
846
|
return i;
|
|
787
847
|
}
|
|
788
|
-
async function
|
|
848
|
+
async function Xt(e, t) {
|
|
789
849
|
const r = `api/v1/search.dataset/${e}`, { parameters: n = {}, datasets: a = [] } = t;
|
|
790
850
|
return (await u(r, { parameters: n, datasets: a })).datasets;
|
|
791
851
|
}
|
|
792
|
-
async function
|
|
793
|
-
return await
|
|
852
|
+
async function Mt(e) {
|
|
853
|
+
return await S(`api/v1/search.dataset/${e}`);
|
|
794
854
|
}
|
|
795
|
-
async function
|
|
855
|
+
async function Yt(e, t = !0, r) {
|
|
796
856
|
try {
|
|
797
857
|
return (await u("api/v1/labels", {
|
|
798
858
|
action: "list",
|
|
@@ -805,18 +865,18 @@ async function jt(e, t = !0, r) {
|
|
|
805
865
|
throw h("Error in fetchLabels", n), n;
|
|
806
866
|
}
|
|
807
867
|
}
|
|
808
|
-
async function
|
|
868
|
+
async function Qe() {
|
|
809
869
|
try {
|
|
810
870
|
const { app: e = "" } = d, t = new URLSearchParams({
|
|
811
871
|
app: e,
|
|
812
872
|
action: "getUserRights"
|
|
813
873
|
});
|
|
814
|
-
return
|
|
874
|
+
return S("api/v1/labels", t);
|
|
815
875
|
} catch (e) {
|
|
816
876
|
throw h("Error in getUserRights", e), e;
|
|
817
877
|
}
|
|
818
878
|
}
|
|
819
|
-
async function
|
|
879
|
+
async function je(e, t, r = !0) {
|
|
820
880
|
try {
|
|
821
881
|
const n = {
|
|
822
882
|
action: "add",
|
|
@@ -847,7 +907,7 @@ async function Be(e, t, r = !0) {
|
|
|
847
907
|
throw h("Error in add", n), n;
|
|
848
908
|
}
|
|
849
909
|
}
|
|
850
|
-
async function
|
|
910
|
+
async function Ve(e, t, r = !0) {
|
|
851
911
|
try {
|
|
852
912
|
const n = {
|
|
853
913
|
action: "remove",
|
|
@@ -878,7 +938,7 @@ async function qe(e, t, r = !0) {
|
|
|
878
938
|
throw h("Error in remove", n), n;
|
|
879
939
|
}
|
|
880
940
|
}
|
|
881
|
-
async function
|
|
941
|
+
async function Ge(e, t, r = !0) {
|
|
882
942
|
try {
|
|
883
943
|
const n = {
|
|
884
944
|
action: "rename",
|
|
@@ -899,7 +959,7 @@ async function Qe(e, t, r = !0) {
|
|
|
899
959
|
throw h("Error in rename", n), n;
|
|
900
960
|
}
|
|
901
961
|
}
|
|
902
|
-
async function
|
|
962
|
+
async function ze(e, t = !0) {
|
|
903
963
|
try {
|
|
904
964
|
const r = {
|
|
905
965
|
action: "delete",
|
|
@@ -918,7 +978,7 @@ async function Ge(e, t = !0) {
|
|
|
918
978
|
throw h("Error in deleteLabels", r), r;
|
|
919
979
|
}
|
|
920
980
|
}
|
|
921
|
-
async function
|
|
981
|
+
async function He(e, t, r = !0) {
|
|
922
982
|
try {
|
|
923
983
|
const n = {
|
|
924
984
|
action: "bulkAdd",
|
|
@@ -939,7 +999,7 @@ async function Ve(e, t, r = !0) {
|
|
|
939
999
|
throw h("Error in bulkAdd", n), n;
|
|
940
1000
|
}
|
|
941
1001
|
}
|
|
942
|
-
async function
|
|
1002
|
+
async function Je(e, t, r = !0) {
|
|
943
1003
|
try {
|
|
944
1004
|
const n = {
|
|
945
1005
|
action: "bulkRemove",
|
|
@@ -960,16 +1020,16 @@ async function je(e, t, r = !0) {
|
|
|
960
1020
|
throw h("Error in bulkRemove", n), n;
|
|
961
1021
|
}
|
|
962
1022
|
}
|
|
963
|
-
const
|
|
964
|
-
getUserRights:
|
|
965
|
-
add:
|
|
966
|
-
remove:
|
|
967
|
-
rename:
|
|
968
|
-
delete:
|
|
969
|
-
bulkAdd:
|
|
970
|
-
bulkRemove:
|
|
1023
|
+
const Kt = {
|
|
1024
|
+
getUserRights: Qe,
|
|
1025
|
+
add: je,
|
|
1026
|
+
remove: Ve,
|
|
1027
|
+
rename: Ge,
|
|
1028
|
+
delete: ze,
|
|
1029
|
+
bulkAdd: He,
|
|
1030
|
+
bulkRemove: Je
|
|
971
1031
|
};
|
|
972
|
-
async function
|
|
1032
|
+
async function Zt(e, t) {
|
|
973
1033
|
if (typeof window > "u")
|
|
974
1034
|
return u("api/v1/preview", {
|
|
975
1035
|
action: "get",
|
|
@@ -984,7 +1044,7 @@ async function Ht(e, t) {
|
|
|
984
1044
|
browserUrl: r
|
|
985
1045
|
});
|
|
986
1046
|
}
|
|
987
|
-
async function
|
|
1047
|
+
async function Et(e) {
|
|
988
1048
|
const t = new Headers();
|
|
989
1049
|
t.append("content-type", "text");
|
|
990
1050
|
const r = await fetch(
|
|
@@ -996,15 +1056,50 @@ async function Jt(e) {
|
|
|
996
1056
|
);
|
|
997
1057
|
C(r);
|
|
998
1058
|
}
|
|
999
|
-
async function
|
|
1059
|
+
async function ce() {
|
|
1000
1060
|
const e = new URLSearchParams({
|
|
1001
1061
|
action: "get",
|
|
1002
1062
|
noAutoAuthentication: "true"
|
|
1003
1063
|
});
|
|
1004
|
-
return
|
|
1064
|
+
return S("api/v1/principal", e);
|
|
1005
1065
|
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1066
|
+
async function We(e) {
|
|
1067
|
+
const t = {
|
|
1068
|
+
noAutoAuthentication: "true",
|
|
1069
|
+
...e
|
|
1070
|
+
}, r = new URLSearchParams();
|
|
1071
|
+
return Object.entries(t).forEach(([n, a]) => {
|
|
1072
|
+
a !== void 0 && r.append(n, String(a));
|
|
1073
|
+
}), S("api/v1/principal/list", r);
|
|
1074
|
+
}
|
|
1075
|
+
async function Xe(e) {
|
|
1076
|
+
if (!e)
|
|
1077
|
+
return Promise.reject(new Error("userid is required"));
|
|
1078
|
+
const t = new URLSearchParams({
|
|
1079
|
+
action: "userid",
|
|
1080
|
+
noAutoAuthentication: "true",
|
|
1081
|
+
userid: e
|
|
1082
|
+
});
|
|
1083
|
+
return S("api/v1/principal", t);
|
|
1084
|
+
}
|
|
1085
|
+
async function Me(e) {
|
|
1086
|
+
if (e.length === 0)
|
|
1087
|
+
return Promise.reject(new Error("userids is required"));
|
|
1088
|
+
const t = new URLSearchParams({
|
|
1089
|
+
noAutoAuthentication: "true",
|
|
1090
|
+
userids: [...e].join(",")
|
|
1091
|
+
});
|
|
1092
|
+
return S("api/v1/principal/userids", t);
|
|
1093
|
+
}
|
|
1094
|
+
const Tt = {
|
|
1095
|
+
principal: {
|
|
1096
|
+
get: ce,
|
|
1097
|
+
list: We,
|
|
1098
|
+
userid: Xe,
|
|
1099
|
+
userids: Me
|
|
1100
|
+
}
|
|
1101
|
+
}, ie = 11;
|
|
1102
|
+
async function er(e, t, r) {
|
|
1008
1103
|
var i;
|
|
1009
1104
|
const a = await u("api/v1/query", {
|
|
1010
1105
|
query: e,
|
|
@@ -1012,12 +1107,12 @@ async function Wt(e, t, r) {
|
|
|
1012
1107
|
queryIntentData: r
|
|
1013
1108
|
});
|
|
1014
1109
|
a.aggregations.forEach((o) => {
|
|
1015
|
-
o.$hasMore = !1, !o.isDistribution && !o.isTree && o.items && (o.$hasMore = o.items.length ===
|
|
1110
|
+
o.$hasMore = !1, !o.isDistribution && !o.isTree && o.items && (o.$hasMore = o.items.length === ie), o.isTree && o.items && z(o);
|
|
1016
1111
|
}), (i = a.records) == null || i.map((o) => Object.assign(o, { value: o.title, type: "default" }));
|
|
1017
1112
|
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
1113
|
return Promise.resolve(s);
|
|
1019
1114
|
}
|
|
1020
|
-
async function
|
|
1115
|
+
async function tr(e, t, r) {
|
|
1021
1116
|
const { app: n = "" } = d, a = {
|
|
1022
1117
|
methods: [],
|
|
1023
1118
|
mode: t,
|
|
@@ -1033,7 +1128,7 @@ async function Xt(e, t, r) {
|
|
|
1033
1128
|
const s = await u("api/v1/multi", a);
|
|
1034
1129
|
s.results.forEach((o) => {
|
|
1035
1130
|
o.aggregations.forEach((c) => {
|
|
1036
|
-
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length ===
|
|
1131
|
+
c.$hasMore = !1, !c.isDistribution && !c.isTree && c.items && (c.$hasMore = c.items.length === ie), c.isTree && z(c);
|
|
1037
1132
|
});
|
|
1038
1133
|
}), s.results.forEach((o) => {
|
|
1039
1134
|
var c;
|
|
@@ -1042,20 +1137,14 @@ async function Xt(e, t, r) {
|
|
|
1042
1137
|
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
1138
|
return Promise.resolve(i);
|
|
1044
1139
|
}
|
|
1045
|
-
function
|
|
1140
|
+
function z(e, t = "", r = 0) {
|
|
1046
1141
|
let n = [];
|
|
1047
1142
|
return e.items && e.items.forEach((a) => {
|
|
1048
1143
|
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(
|
|
1144
|
+
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
1145
|
}), n;
|
|
1051
1146
|
}
|
|
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 }) {
|
|
1147
|
+
async function rr({ model: e, appName: t, query: r, article: n }) {
|
|
1059
1148
|
const { webservice: a, format: s, maxcount: i, exportedColumns: o, export: c } = e, l = {
|
|
1060
1149
|
app: t,
|
|
1061
1150
|
webservice: a,
|
|
@@ -1073,9 +1162,15 @@ async function Yt({ model: e, appName: t, query: r, article: n }) {
|
|
|
1073
1162
|
}]
|
|
1074
1163
|
}
|
|
1075
1164
|
};
|
|
1076
|
-
return
|
|
1165
|
+
return y(l), await u("api/v1/search.queryexport", l, { responseType: "blob" });
|
|
1077
1166
|
}
|
|
1078
|
-
async function
|
|
1167
|
+
async function nr(e) {
|
|
1168
|
+
const r = await u("api/v1/queryintent", {
|
|
1169
|
+
query: e
|
|
1170
|
+
});
|
|
1171
|
+
return r == null ? void 0 : r.intents;
|
|
1172
|
+
}
|
|
1173
|
+
async function ar(e, t, r) {
|
|
1079
1174
|
return (await u(
|
|
1080
1175
|
"api/v1/similardocuments",
|
|
1081
1176
|
{
|
|
@@ -1087,7 +1182,7 @@ async function Kt(e, t, r) {
|
|
|
1087
1182
|
{ signal: r }
|
|
1088
1183
|
)).data;
|
|
1089
1184
|
}
|
|
1090
|
-
async function
|
|
1185
|
+
async function sr(e, t) {
|
|
1091
1186
|
var a;
|
|
1092
1187
|
const n = await u("api/v1/query.links", {
|
|
1093
1188
|
webservice: e,
|
|
@@ -1095,7 +1190,7 @@ async function Zt(e, t) {
|
|
|
1095
1190
|
});
|
|
1096
1191
|
return (a = n == null ? void 0 : n.links) == null ? void 0 : a.map((s) => ({ ...s, query: t }));
|
|
1097
1192
|
}
|
|
1098
|
-
async function
|
|
1193
|
+
async function or(e, t, r, n, a) {
|
|
1099
1194
|
const { app: s } = d, i = {
|
|
1100
1195
|
app: s || "",
|
|
1101
1196
|
suggestQuery: e,
|
|
@@ -1110,7 +1205,7 @@ async function Et(e, t, r, n, a) {
|
|
|
1110
1205
|
throw console.error("Error fetching suggestions:", o), o;
|
|
1111
1206
|
}
|
|
1112
1207
|
}
|
|
1113
|
-
async function
|
|
1208
|
+
async function cr(e, t, r, n) {
|
|
1114
1209
|
const { app: a } = d;
|
|
1115
1210
|
return (await u("api/v1/suggestquery", {
|
|
1116
1211
|
app: a || "",
|
|
@@ -1120,7 +1215,7 @@ async function Tt(e, t, r, n) {
|
|
|
1120
1215
|
kinds: n
|
|
1121
1216
|
})).suggests;
|
|
1122
1217
|
}
|
|
1123
|
-
async function
|
|
1218
|
+
async function ir(e, t) {
|
|
1124
1219
|
if (!t) return Promise.resolve([]);
|
|
1125
1220
|
const { app: r } = d;
|
|
1126
1221
|
return (await u("api/v1/suggestfield", {
|
|
@@ -1130,7 +1225,7 @@ async function er(e, t) {
|
|
|
1130
1225
|
fields: t
|
|
1131
1226
|
})).suggests;
|
|
1132
1227
|
}
|
|
1133
|
-
async function
|
|
1228
|
+
async function lr(e, t, r, n, a, s) {
|
|
1134
1229
|
return u("api/v1/doc.textchunks", {
|
|
1135
1230
|
id: e,
|
|
1136
1231
|
textChunks: t,
|
|
@@ -1140,36 +1235,59 @@ async function tr(e, t, r, n, a, s) {
|
|
|
1140
1235
|
rightSentencesCount: s
|
|
1141
1236
|
});
|
|
1142
1237
|
}
|
|
1143
|
-
async function
|
|
1238
|
+
async function ur() {
|
|
1144
1239
|
const { app: e } = d, t = new URLSearchParams({
|
|
1145
1240
|
app: e || "",
|
|
1146
1241
|
action: "load"
|
|
1147
1242
|
});
|
|
1148
|
-
return
|
|
1243
|
+
return S("api/v1/usersettings", t);
|
|
1149
1244
|
}
|
|
1150
|
-
async function
|
|
1245
|
+
async function Ye(e, t) {
|
|
1151
1246
|
const r = {
|
|
1152
1247
|
action: "save",
|
|
1153
1248
|
userSettings: e,
|
|
1154
1249
|
$auditRecord: { auditEvents: [t] }
|
|
1155
1250
|
};
|
|
1156
|
-
return
|
|
1251
|
+
return y(r), u("api/v1/usersettings", r);
|
|
1157
1252
|
}
|
|
1158
|
-
async function
|
|
1253
|
+
async function dr(e, t) {
|
|
1159
1254
|
const n = {
|
|
1160
1255
|
action: "patch",
|
|
1161
1256
|
userSettings: e,
|
|
1162
1257
|
$auditRecord: t ? { auditEvents: [t] } : void 0
|
|
1163
1258
|
};
|
|
1164
|
-
return
|
|
1259
|
+
return y(n), u("api/v1/usersettings", n);
|
|
1260
|
+
}
|
|
1261
|
+
async function fr() {
|
|
1262
|
+
return Ye({}, { type: "UserSettings_Reset" });
|
|
1263
|
+
}
|
|
1264
|
+
async function hr(e, t) {
|
|
1265
|
+
return u("api/v2/security/password/change", { newPassword: e, currentPassword: t });
|
|
1266
|
+
}
|
|
1267
|
+
async function mr(e) {
|
|
1268
|
+
const t = "api/v2/security/password/ask-reset-email", n = {
|
|
1269
|
+
changePasswordRedirectUrl: `${window.location.origin}/login?mode=changepassword`,
|
|
1270
|
+
userName: e
|
|
1271
|
+
};
|
|
1272
|
+
return u(t, n);
|
|
1273
|
+
}
|
|
1274
|
+
async function wr(e) {
|
|
1275
|
+
return await S(`api/v2/user-profile/${e}`);
|
|
1165
1276
|
}
|
|
1166
|
-
async function
|
|
1167
|
-
return
|
|
1277
|
+
async function _r(e) {
|
|
1278
|
+
return await u("api/v2/user-profile", e);
|
|
1279
|
+
}
|
|
1280
|
+
async function gr(e, t, r) {
|
|
1281
|
+
var a;
|
|
1282
|
+
return await be(
|
|
1283
|
+
`api/v2/user-profile/${(a = e.data) == null ? void 0 : a.id}/${t}/${r}`,
|
|
1284
|
+
e
|
|
1285
|
+
);
|
|
1168
1286
|
}
|
|
1169
|
-
async function
|
|
1170
|
-
return await
|
|
1287
|
+
async function Sr() {
|
|
1288
|
+
return await S("api/v2/version");
|
|
1171
1289
|
}
|
|
1172
|
-
const
|
|
1290
|
+
const Ke = async () => {
|
|
1173
1291
|
const { autoOAuthProvider: e } = d;
|
|
1174
1292
|
if (typeof window > "u")
|
|
1175
1293
|
return u("security.oauth", {
|
|
@@ -1193,7 +1311,7 @@ const Je = async () => {
|
|
|
1193
1311
|
} catch (r) {
|
|
1194
1312
|
throw console.error("Failed to authenticate with OAuth", r), r;
|
|
1195
1313
|
}
|
|
1196
|
-
},
|
|
1314
|
+
}, Ze = async () => {
|
|
1197
1315
|
const { autoSAMLProvider: e } = d;
|
|
1198
1316
|
if (typeof window > "u")
|
|
1199
1317
|
return u("security.saml", {
|
|
@@ -1217,7 +1335,7 @@ const Je = async () => {
|
|
|
1217
1335
|
} catch (r) {
|
|
1218
1336
|
throw console.error("Failed to authenticate with SAML", r), r;
|
|
1219
1337
|
}
|
|
1220
|
-
},
|
|
1338
|
+
}, H = {
|
|
1221
1339
|
store: {},
|
|
1222
1340
|
getItem(e) {
|
|
1223
1341
|
return this.store[e] ?? null;
|
|
@@ -1231,36 +1349,36 @@ const Je = async () => {
|
|
|
1231
1349
|
clear() {
|
|
1232
1350
|
this.store = {};
|
|
1233
1351
|
}
|
|
1234
|
-
},
|
|
1235
|
-
function
|
|
1236
|
-
return typeof window > "u" || !window.localStorage ?
|
|
1352
|
+
}, J = H;
|
|
1353
|
+
function Ee(e) {
|
|
1354
|
+
return typeof window > "u" || !window.localStorage ? H.getItem(e) : window.localStorage.getItem(e);
|
|
1237
1355
|
}
|
|
1238
|
-
function
|
|
1239
|
-
typeof window > "u" || !window.localStorage ?
|
|
1356
|
+
function Te(e) {
|
|
1357
|
+
typeof window > "u" || !window.localStorage ? H.removeItem(e) : window.localStorage.removeItem(e);
|
|
1240
1358
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return typeof window > "u" || !window.sessionStorage ?
|
|
1359
|
+
function et(e) {
|
|
1360
|
+
return typeof window > "u" || !window.sessionStorage ? J.getItem(e) : window.sessionStorage.getItem(e);
|
|
1243
1361
|
}
|
|
1244
|
-
function
|
|
1245
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1362
|
+
function tt(e, t) {
|
|
1363
|
+
typeof window > "u" || !window.sessionStorage ? J.setItem(e, t) : window.sessionStorage.setItem(e, t);
|
|
1246
1364
|
}
|
|
1247
|
-
function
|
|
1248
|
-
typeof window > "u" || !window.sessionStorage ?
|
|
1365
|
+
function rt(e) {
|
|
1366
|
+
typeof window > "u" || !window.sessionStorage ? J.removeItem(e) : window.sessionStorage.removeItem(e);
|
|
1249
1367
|
}
|
|
1250
|
-
const
|
|
1368
|
+
const $ = (e) => tt(
|
|
1251
1369
|
"sinequa-credentials",
|
|
1252
1370
|
JSON.stringify({ data: { csrfToken: e } })
|
|
1253
|
-
),
|
|
1371
|
+
), nt = async () => {
|
|
1254
1372
|
try {
|
|
1255
|
-
const e = await
|
|
1373
|
+
const e = await S(
|
|
1256
1374
|
"api/v1/challenge?action=getCsrfToken&suppressErrors=true"
|
|
1257
1375
|
);
|
|
1258
|
-
return e != null && e.csrfToken ? (
|
|
1376
|
+
return e != null && e.csrfToken ? ($(e.csrfToken), e.csrfToken) : null;
|
|
1259
1377
|
} catch (e) {
|
|
1260
1378
|
throw h("Failed to get CSRF token", e), e;
|
|
1261
1379
|
}
|
|
1262
1380
|
};
|
|
1263
|
-
async function
|
|
1381
|
+
async function at(e) {
|
|
1264
1382
|
if (e) {
|
|
1265
1383
|
const { username: t, password: r } = e, n = {
|
|
1266
1384
|
action: "get",
|
|
@@ -1275,7 +1393,7 @@ async function Te(e) {
|
|
|
1275
1393
|
"api/v1/security.webtoken",
|
|
1276
1394
|
n
|
|
1277
1395
|
);
|
|
1278
|
-
return a != null && a.csrfToken ? (
|
|
1396
|
+
return a != null && a.csrfToken ? ($(a.csrfToken), a.csrfToken) : null;
|
|
1279
1397
|
} catch (a) {
|
|
1280
1398
|
throw console.error("Failed to get JWT", a), a;
|
|
1281
1399
|
}
|
|
@@ -1299,30 +1417,30 @@ async function Te(e) {
|
|
|
1299
1417
|
t,
|
|
1300
1418
|
{ headers: n }
|
|
1301
1419
|
);
|
|
1302
|
-
return a.csrfToken ? (
|
|
1420
|
+
return a.csrfToken ? ($(a.csrfToken), a.csrfToken) : null;
|
|
1303
1421
|
} catch (a) {
|
|
1304
1422
|
throw console.error("Failed to get JWT without credentials", a), a;
|
|
1305
1423
|
}
|
|
1306
1424
|
}
|
|
1307
1425
|
}
|
|
1308
|
-
const
|
|
1426
|
+
const W = () => {
|
|
1309
1427
|
var r;
|
|
1310
|
-
const e =
|
|
1428
|
+
const e = et("sinequa-credentials");
|
|
1311
1429
|
if (e)
|
|
1312
1430
|
try {
|
|
1313
1431
|
const a = (r = JSON.parse(e).data) == null ? void 0 : r.csrfToken;
|
|
1314
1432
|
if (a !== void 0) return a;
|
|
1315
1433
|
} catch {
|
|
1316
1434
|
}
|
|
1317
|
-
const t =
|
|
1435
|
+
const t = Ee("csrfToken");
|
|
1318
1436
|
return t !== null ? t : null;
|
|
1319
|
-
},
|
|
1437
|
+
}, pr = async (e) => {
|
|
1320
1438
|
if (e)
|
|
1321
|
-
|
|
1439
|
+
p("Attempting authentication using credentials"), k({ useCredentials: !0, useSSO: !1 });
|
|
1322
1440
|
else {
|
|
1323
1441
|
let o = null;
|
|
1324
1442
|
try {
|
|
1325
|
-
|
|
1443
|
+
p("Attempting to retrieve CSRF token from the backend"), o = await nt(), x("CSRF token retrieval result", o ? "success" : "failed");
|
|
1326
1444
|
} catch (c) {
|
|
1327
1445
|
h("Failed to retrieve CSRF token", c);
|
|
1328
1446
|
}
|
|
@@ -1330,162 +1448,177 @@ const H = () => {
|
|
|
1330
1448
|
if (o === null) {
|
|
1331
1449
|
const { autoOAuthProvider: c, autoSAMLProvider: l, useSAML: f } = d;
|
|
1332
1450
|
if (c && !f)
|
|
1333
|
-
return
|
|
1451
|
+
return p("Initiating OAuth authentication flow"), await Ke(), P("OAuth authentication flow did not redirect as expected"), _(!1), !1;
|
|
1334
1452
|
if (l)
|
|
1335
|
-
return
|
|
1336
|
-
|
|
1453
|
+
return p("Initiating SAML authentication flow"), await Ze(), P("SAML authentication flow did not redirect as expected"), _(!1), !1;
|
|
1454
|
+
p(
|
|
1337
1455
|
"No direct authentication method available, will try SSO then credentials"
|
|
1338
|
-
),
|
|
1456
|
+
), k({ useCredentials: !0, useSSO: !0 });
|
|
1339
1457
|
} else
|
|
1340
|
-
return
|
|
1458
|
+
return p("User authenticated via existing token"), _(!0), !0;
|
|
1341
1459
|
} catch (c) {
|
|
1342
|
-
throw h("Unexpected error during authentication", c),
|
|
1460
|
+
throw h("Unexpected error during authentication", c), _(!1), c;
|
|
1343
1461
|
}
|
|
1344
1462
|
}
|
|
1345
1463
|
if (d.useCredentials && d.useSSO)
|
|
1346
1464
|
try {
|
|
1347
|
-
if (
|
|
1348
|
-
return
|
|
1465
|
+
if (p("Checking if user is authenticated via SSO"), await ce())
|
|
1466
|
+
return p("User authenticated using SSO"), k({ useCredentials: !1, useSSO: !0 }), _(!0), !0;
|
|
1349
1467
|
} catch (o) {
|
|
1350
1468
|
if ((o == null ? void 0 : o.status) === 401)
|
|
1351
|
-
return
|
|
1352
|
-
throw h("SSO authentication failed with unexpected error", o),
|
|
1469
|
+
return p("SSO authentication failed with 401, falling back to credentials"), k({ useCredentials: !0, useSSO: !1 }), !1;
|
|
1470
|
+
throw h("SSO authentication failed with unexpected error", o), _(!1), h;
|
|
1353
1471
|
}
|
|
1354
|
-
const { useSSO: r } = d, n =
|
|
1472
|
+
const { useSSO: r } = d, n = W();
|
|
1355
1473
|
if (n && n !== null || r)
|
|
1356
|
-
return
|
|
1474
|
+
return p("user already authenticated", n), k({ isRedirectUrl: !1 }), _(!0), !0;
|
|
1357
1475
|
const { useCredentials: a } = d, { username: s, password: i } = e || {};
|
|
1358
1476
|
if (a && !s && !i)
|
|
1359
|
-
return h("Credentials are required for authentication"),
|
|
1477
|
+
return h("Credentials are required for authentication"), _(!1), !1;
|
|
1360
1478
|
if (s && i)
|
|
1361
1479
|
try {
|
|
1362
|
-
|
|
1480
|
+
p("authentication using credentials..."), k({ useCredentials: !0, useSSO: !1 });
|
|
1481
|
+
const { userOverrideActive: o, useroverride: c } = d;
|
|
1482
|
+
return k({ userOverrideActive: !1, useroverride: void 0 }), await at({ username: s, password: i }), k({ userOverrideActive: o, useroverride: c }), _(!0), !0;
|
|
1363
1483
|
} catch (o) {
|
|
1364
|
-
throw
|
|
1484
|
+
throw _(!1), o;
|
|
1365
1485
|
}
|
|
1366
|
-
return
|
|
1486
|
+
return _(!1), h(
|
|
1367
1487
|
"No authentication method available. Please provide credentials or configure OAuth/SAML."
|
|
1368
1488
|
), !1;
|
|
1369
|
-
},
|
|
1489
|
+
}, st = async () => {
|
|
1370
1490
|
const e = new URLSearchParams({
|
|
1371
1491
|
action: "deleteWebTokenCookie",
|
|
1372
1492
|
noUserOverride: "true",
|
|
1373
1493
|
noAutoAuthentication: "true"
|
|
1374
1494
|
});
|
|
1375
|
-
return
|
|
1376
|
-
},
|
|
1495
|
+
return S("api/v1/challenge", e);
|
|
1496
|
+
}, kr = async () => {
|
|
1377
1497
|
const { useCredentials: e, userOverrideActive: t } = d;
|
|
1378
|
-
|
|
1379
|
-
},
|
|
1498
|
+
Te("csrfToken"), rt("sinequa-credentials"), e && !t ? (await st()).methodresult === "ok" ? _(!1) : console.error("logout failed") : _(!1);
|
|
1499
|
+
}, vr = () => !!W();
|
|
1380
1500
|
export {
|
|
1381
|
-
|
|
1382
|
-
|
|
1501
|
+
Tt as API,
|
|
1502
|
+
b as ApiError,
|
|
1503
|
+
Gt as Audit,
|
|
1383
1504
|
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
|
-
|
|
1409
|
-
|
|
1505
|
+
Ce as DidYouMeanKind,
|
|
1506
|
+
m as EngineType,
|
|
1507
|
+
g as EngineTypeModifier,
|
|
1508
|
+
ae as LogLevel,
|
|
1509
|
+
Nt as MINIMUM_COMPATIBLE_SERVER_API_VERSION,
|
|
1510
|
+
Re as RFMDisplay,
|
|
1511
|
+
K as ServerError,
|
|
1512
|
+
de as TimeoutError,
|
|
1513
|
+
V as UnauthorizedError,
|
|
1514
|
+
y as addAuditAdditionalInfo,
|
|
1515
|
+
dt as addConcepts,
|
|
1516
|
+
De as addSessionId,
|
|
1517
|
+
Ae as addUrl,
|
|
1518
|
+
fe as aggItemRegex,
|
|
1519
|
+
it as aggregationItemStrictCompare,
|
|
1520
|
+
Jt as appInitializerFn,
|
|
1521
|
+
ut as bisect,
|
|
1522
|
+
z as buildPathsAndLevels,
|
|
1523
|
+
Lt as configureLogger,
|
|
1524
|
+
L as createHeaders,
|
|
1525
|
+
Ut as createTimeoutController,
|
|
1526
|
+
_r as createUserProfile,
|
|
1527
|
+
x as debug,
|
|
1528
|
+
yt as del,
|
|
1529
|
+
fr as deleteUserSettings,
|
|
1530
|
+
st as deleteWebTokenCookie,
|
|
1531
|
+
_ as emitAuthenticatedEvent,
|
|
1410
1532
|
h as error,
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
Ft as
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
sr as
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1533
|
+
jt as escapeExpr,
|
|
1534
|
+
It as expiresSoon,
|
|
1535
|
+
Ft as extraColumns,
|
|
1536
|
+
zt as fetchAggregation,
|
|
1537
|
+
Ht as fetchApp,
|
|
1538
|
+
qe as fetchAppPreLogin,
|
|
1539
|
+
tr as fetchBulkQuery,
|
|
1540
|
+
hr as fetchChangePassword,
|
|
1541
|
+
Wt as fetchDataset,
|
|
1542
|
+
Mt as fetchDatasetList,
|
|
1543
|
+
Xt as fetchDatasets,
|
|
1544
|
+
Yt as fetchLabels,
|
|
1545
|
+
Zt as fetchPreview,
|
|
1546
|
+
Et as fetchPreviewUrl,
|
|
1547
|
+
ce as fetchPrincipal,
|
|
1548
|
+
We as fetchPrincipalList,
|
|
1549
|
+
Xe as fetchPrincipalUserid,
|
|
1550
|
+
Me as fetchPrincipalUserids,
|
|
1551
|
+
er as fetchQuery,
|
|
1552
|
+
rr as fetchQueryExport,
|
|
1553
|
+
nr as fetchQueryIntent,
|
|
1554
|
+
mr as fetchSendPasswordResetEmail,
|
|
1555
|
+
ar as fetchSimilarDocuments,
|
|
1556
|
+
sr as fetchSponsoredLinks,
|
|
1557
|
+
or as fetchSuggest,
|
|
1558
|
+
ir as fetchSuggestField,
|
|
1559
|
+
cr as fetchSuggestQuery,
|
|
1560
|
+
lr as fetchTextChunks,
|
|
1561
|
+
wr as fetchUserProfile,
|
|
1562
|
+
ur as fetchUserSettings,
|
|
1563
|
+
Sr as fetchVersion,
|
|
1564
|
+
S as get,
|
|
1565
|
+
mt as getConcepts,
|
|
1566
|
+
nt as getCsrfToken,
|
|
1438
1567
|
ne as getFiltersFromURI,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1568
|
+
pt as getFiltersFromUrl,
|
|
1569
|
+
xt as getHelpIndexUrl,
|
|
1570
|
+
vt as getIdFromUrl,
|
|
1571
|
+
at as getJWToken,
|
|
1572
|
+
Bt as getMetadata,
|
|
1573
|
+
qt as getMetadataWithValues,
|
|
1574
|
+
ve as getOffsetFromDates,
|
|
1575
|
+
bt as getQueryPageFromUrl,
|
|
1576
|
+
gt as getQueryParamsFromUrl,
|
|
1577
|
+
Ct as getQueryTabFromUrl,
|
|
1578
|
+
kt as getQueryTextFromUrl,
|
|
1579
|
+
wt as getRelativeDate,
|
|
1580
|
+
W as getToken,
|
|
1581
|
+
St as getUrlParamsFromQueryParams,
|
|
1452
1582
|
d as globalConfig,
|
|
1453
|
-
|
|
1583
|
+
$e as guid,
|
|
1454
1584
|
C as handleResponse,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1585
|
+
p as info,
|
|
1586
|
+
ye as isArrayBuffer,
|
|
1587
|
+
vr as isAuthenticated,
|
|
1588
|
+
Oe as isBlob,
|
|
1589
|
+
$t as isExpired,
|
|
1590
|
+
Qt as isJsonable,
|
|
1591
|
+
_t as isNotInputEvent,
|
|
1592
|
+
A as isObject,
|
|
1593
|
+
Ue as isString,
|
|
1594
|
+
Kt as labels,
|
|
1595
|
+
pr as login,
|
|
1596
|
+
kr as logout,
|
|
1597
|
+
w as makeColumn,
|
|
1598
|
+
Pt as notify,
|
|
1599
|
+
me as openParentNodes,
|
|
1600
|
+
I as parseText,
|
|
1601
|
+
he as parseValueAndOperatorFromItem,
|
|
1602
|
+
be as patch,
|
|
1603
|
+
gr as patchUserProfile,
|
|
1604
|
+
dr as patchUserSettings,
|
|
1473
1605
|
u as post,
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1606
|
+
Ot as put,
|
|
1607
|
+
R as queryParamsFromUrl,
|
|
1608
|
+
ft as removeConcept,
|
|
1609
|
+
ht as removeConcepts,
|
|
1610
|
+
At as resolveToColumnName,
|
|
1479
1611
|
G as rewriteText,
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1612
|
+
Ye as saveUserSettings,
|
|
1613
|
+
k as setGlobalConfig,
|
|
1614
|
+
$ as setToken,
|
|
1615
|
+
Vt as sha512,
|
|
1616
|
+
lt as suggestionsToTreeAggregationNodes,
|
|
1617
|
+
Rt as sysLang,
|
|
1618
|
+
se as toDate,
|
|
1619
|
+
ct as translateAggregationToDateOptions,
|
|
1620
|
+
Ke as tryOAuthAuthentication,
|
|
1621
|
+
Ze as trySAMLAuthentication,
|
|
1622
|
+
P as warn,
|
|
1623
|
+
Dt as withRetry
|
|
1491
1624
|
};
|