@burdenoff/fe-libs 2026.530.3 → 2026.530.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/graphql/fetch.d.ts.map +1 -1
- package/dist/shared/graphql/fetch.js +20 -16
- package/dist/shared/providers/shell/ProfileI18nBridge.d.ts.map +1 -1
- package/dist/shared/providers/shell/ProfileI18nBridge.js +1 -0
- package/dist/shared/utils/backendErrors.d.ts.map +1 -1
- package/dist/shared/utils/backendErrors.js +30 -30
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBnD,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAA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AAC,CAAC,CAAC,CAAC,CAiI7B"}
|
|
@@ -188,12 +188,16 @@ function U(t) {
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
function W(e) {
|
|
191
|
-
return
|
|
191
|
+
return K(e) && Array.isArray(e.errors);
|
|
192
192
|
}
|
|
193
193
|
function G(e) {
|
|
194
|
+
let t = e.status;
|
|
195
|
+
return t === 401 ? "Invalid email or password." : t === 403 ? "You do not have permission to do that." : t === 404 ? "We could not find what you were looking for." : t === 408 || t === 504 ? "The server took too long to respond. Please try again." : t === 429 ? "Too many requests. Please wait a moment and try again." : t >= 500 && t < 600 ? "The server is having trouble right now. Please try again in a moment." : t >= 400 && t < 500 ? "The request could not be processed. Please refresh and try again." : "We could not reach the server. Please check your connection and try again.";
|
|
196
|
+
}
|
|
197
|
+
function K(e) {
|
|
194
198
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
195
199
|
}
|
|
196
|
-
async function
|
|
200
|
+
async function q(e) {
|
|
197
201
|
let t = await e.text();
|
|
198
202
|
if (!t) return null;
|
|
199
203
|
try {
|
|
@@ -202,7 +206,7 @@ async function K(e) {
|
|
|
202
206
|
return t;
|
|
203
207
|
}
|
|
204
208
|
}
|
|
205
|
-
async function
|
|
209
|
+
async function J(e, t, n) {
|
|
206
210
|
if (n.length === 1) {
|
|
207
211
|
let r = n[0];
|
|
208
212
|
try {
|
|
@@ -212,8 +216,8 @@ async function q(e, t, n) {
|
|
|
212
216
|
credentials: "include",
|
|
213
217
|
body: JSON.stringify(r.body),
|
|
214
218
|
signal: r.signal
|
|
215
|
-
}), i = await
|
|
216
|
-
if (!n.ok && !W(i)) throw Error(
|
|
219
|
+
}), i = await q(n);
|
|
220
|
+
if (!n.ok && !W(i)) throw Error(G(n));
|
|
217
221
|
r.cacheKey && j().set(r.cacheKey, {
|
|
218
222
|
value: i,
|
|
219
223
|
expiresAt: Date.now() + L
|
|
@@ -230,8 +234,8 @@ async function q(e, t, n) {
|
|
|
230
234
|
headers: U(t),
|
|
231
235
|
credentials: "include",
|
|
232
236
|
body: JSON.stringify(r)
|
|
233
|
-
}), a = await
|
|
234
|
-
if (!i.ok && !W(a)) throw Error(
|
|
237
|
+
}), a = await q(i);
|
|
238
|
+
if (!i.ok && !W(a)) throw Error(G(i));
|
|
235
239
|
Array.isArray(a) ? a.forEach((e, t) => {
|
|
236
240
|
let r = n[t];
|
|
237
241
|
r && (r.cacheKey && j().set(r.cacheKey, {
|
|
@@ -248,7 +252,7 @@ async function q(e, t, n) {
|
|
|
248
252
|
n.forEach((t) => t.reject(e));
|
|
249
253
|
}
|
|
250
254
|
}
|
|
251
|
-
function
|
|
255
|
+
function Y(e, t, n, r, i) {
|
|
252
256
|
let a = H(t), o = Math.max(1, i?.batchMax ?? N), s = Math.max(0, i?.batchInterval ?? z()), c = `${e}|${JSON.stringify(a)}`, l = B(n) ? `${c}|${JSON.stringify(V(n))}` : void 0;
|
|
253
257
|
if (l) {
|
|
254
258
|
let e = j(), t = e.get(l);
|
|
@@ -261,7 +265,7 @@ function J(e, t, n, r, i) {
|
|
|
261
265
|
}
|
|
262
266
|
let u = new Promise((t, i) => {
|
|
263
267
|
if (o <= 1) {
|
|
264
|
-
|
|
268
|
+
J(e, a, [{
|
|
265
269
|
body: n,
|
|
266
270
|
resolve: t,
|
|
267
271
|
reject: i,
|
|
@@ -283,20 +287,20 @@ function J(e, t, n, r, i) {
|
|
|
283
287
|
signal: r,
|
|
284
288
|
cacheKey: l
|
|
285
289
|
}), d.requests.length >= d.batchMax) {
|
|
286
|
-
|
|
290
|
+
X(e, a, c);
|
|
287
291
|
return;
|
|
288
292
|
}
|
|
289
|
-
d.timer ||= setTimeout(() =>
|
|
293
|
+
d.timer ||= setTimeout(() => X(e, a, c), d.batchInterval);
|
|
290
294
|
});
|
|
291
295
|
return l && (M().set(l, u), u.finally(() => {
|
|
292
296
|
M().delete(l);
|
|
293
297
|
}).catch(() => {})), u;
|
|
294
298
|
}
|
|
295
|
-
function
|
|
299
|
+
function X(e, t, n) {
|
|
296
300
|
let r = A(), i = r.get(n);
|
|
297
|
-
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null),
|
|
301
|
+
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), J(e, t, i.requests));
|
|
298
302
|
}
|
|
299
|
-
async function
|
|
303
|
+
async function Z(e) {
|
|
300
304
|
let { gateway: t, query: n, variables: r, operationName: i, authToken: a, workspaceToken: o, workspaceId: c, organizationId: f, tenantId: p, locale: g, baseUrl: _, extraHeaders: x, signal: S } = e, w = l(O(t, _)), E = a && !v(a) ? a : m(), k = g ?? b(), A = T({
|
|
301
305
|
workspaceId: c,
|
|
302
306
|
organizationId: f,
|
|
@@ -333,7 +337,7 @@ async function X(e) {
|
|
|
333
337
|
let P = { query: n };
|
|
334
338
|
r && (P.variables = r), i && (P.operationName = i);
|
|
335
339
|
try {
|
|
336
|
-
let e = await
|
|
340
|
+
let e = await Y(w, j, P, S);
|
|
337
341
|
return e.errors?.length && d({ errors: e.errors }, { operationName: i }), e;
|
|
338
342
|
} catch (e) {
|
|
339
343
|
throw d(e, {
|
|
@@ -343,4 +347,4 @@ async function X(e) {
|
|
|
343
347
|
}
|
|
344
348
|
}
|
|
345
349
|
//#endregion
|
|
346
|
-
export {
|
|
350
|
+
export { Y as enqueueGraphQLFetch, m as getStoredAuthToken, b as getStoredLocale, S as getStoredOrganizationId, x as getStoredWorkspaceId, h as getStoredWorkspaceToken, Z as graphqlFetch, O as resolveGatewayUrl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileI18nBridge.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/ProfileI18nBridge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAYxB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC7D,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,aAAa,EACb,aAAoB,EACpB,oBAAoB,EACpB,mBAA2B,GAC5B,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"ProfileI18nBridge.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/ProfileI18nBridge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7D,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAYxB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,kFAAkF;IAClF,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC7D,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,aAAa,EACb,aAAoB,EACpB,oBAAoB,EACpB,mBAA2B,GAC5B,EAAE,sBAAsB,2CA4FxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backendErrors.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/backendErrors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAAG,yB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AAmB,GAAG,IAAI,CAyC5B;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAE9B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAChC,KAAK,IAAI,mBAAmB,CAsB9B;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,0BAA+B,GACvC,IAAI,CAcN"}
|
|
@@ -37,41 +37,41 @@ var e = "burdenoff:backend-error", t = "Something went wrong. Please try again."
|
|
|
37
37
|
"RESOURCE_CAP_EXCEEDED",
|
|
38
38
|
"STORAGE_QUOTA_EXCEEDED",
|
|
39
39
|
"QUOTA_EXHAUSTED"
|
|
40
|
-
]), a = new Set(["ExportTranslations", "exportTranslations"]), o = ["exportTranslations"];
|
|
41
|
-
function
|
|
40
|
+
]), a = new Set(["ExportTranslations", "exportTranslations"]), o = ["exportTranslations"], s = ["No translation keys found for the specified criteria"];
|
|
41
|
+
function c(e) {
|
|
42
42
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function l(e, t) {
|
|
45
45
|
let n = e[t];
|
|
46
46
|
return typeof n == "string" && n.trim().length > 0 ? n : void 0;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function u(e) {
|
|
49
49
|
if (!(typeof e != "string" || e.trim().length === 0)) return e.trim().replace(/[\s-]+/g, "_").toUpperCase();
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
if (!
|
|
51
|
+
function d(e) {
|
|
52
|
+
if (!c(e)) return;
|
|
53
53
|
let t = e.errors;
|
|
54
54
|
if (Array.isArray(t)) return t;
|
|
55
55
|
let n = e.graphQLErrors;
|
|
56
56
|
if (Array.isArray(n)) return n;
|
|
57
57
|
let r = e.networkError;
|
|
58
|
-
if (
|
|
58
|
+
if (c(r)) {
|
|
59
59
|
let e = r.result;
|
|
60
|
-
if (
|
|
60
|
+
if (c(e) && Array.isArray(e.errors)) return e.errors;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let t =
|
|
63
|
+
function f(e) {
|
|
64
|
+
let t = d(e);
|
|
65
65
|
if (t && t.length > 0) return t[0];
|
|
66
|
-
if (
|
|
66
|
+
if (c(e) && ("message" in e || "extensions" in e)) return e;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function p(e) {
|
|
69
69
|
if (e) return e.userMessage ?? e.humanMessage ?? e.displayMessage;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function m(e) {
|
|
72
72
|
return e.length > 220 || e.includes("\n") || r.some((t) => t.test(e)) || /\b(prisma|sql|constraint|undefined|null|ECONN[A-Z_]*|ETIMEDOUT|ENOTFOUND)\b/i.test(e) || /failed to fetch|network error|graphql fetch failed/i.test(e) || /Cannot (read|set|find|access|query)/i.test(e);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function h(e) {
|
|
75
75
|
if (r.some((t) => t.test(e))) return "BAD_USER_INPUT";
|
|
76
76
|
let t = e.toLowerCase();
|
|
77
77
|
if (t.includes("unauthenticated") || t.includes("unauthorized")) return "UNAUTHENTICATED";
|
|
@@ -81,41 +81,41 @@ function m(e) {
|
|
|
81
81
|
if (t.includes("quota") || t.includes("limit reached")) return "QUOTA_EXCEEDED";
|
|
82
82
|
if (t.includes("required") || t.includes("invalid") || t.includes("missing")) return "BAD_USER_INPUT";
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
let o =
|
|
84
|
+
function g(e, r, i, a) {
|
|
85
|
+
let o = p(e?.extensions ?? void 0);
|
|
86
86
|
if (o) return o;
|
|
87
87
|
if (r && n[r]) return n[r];
|
|
88
88
|
if (i) return i;
|
|
89
89
|
let s = e ? void 0 : a;
|
|
90
|
-
return s && !
|
|
90
|
+
return s && !m(s) ? s : e?.message && !m(e.message) ? e.message : i ?? t;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function _(e) {
|
|
93
93
|
if (!(!e || e.length === 0)) return e.map((e) => String(e)).join(".");
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function v(e, t = {}) {
|
|
96
96
|
if (e == null) return null;
|
|
97
|
-
let n =
|
|
97
|
+
let n = f(e), r = n?.extensions ?? void 0, i = e instanceof Error ? e.message : c(e) ? l(e, "message") : void 0, a = u(r?.code ?? r?.errorCode) ?? h(i ?? n?.message ?? ""), o = r?.serviceName, s = _(n?.path), d = r?.requestId ?? r?.correlationId ?? r?.traceId, p = g(n, a, t.fallbackMessage, i);
|
|
98
98
|
return {
|
|
99
99
|
message: p,
|
|
100
100
|
technicalMessage: r?.technicalMessage ?? (n?.message && n.message !== p ? n.message : void 0) ?? (i && i !== p ? i : void 0),
|
|
101
101
|
code: a,
|
|
102
102
|
operationName: t.operationName,
|
|
103
103
|
serviceName: o,
|
|
104
|
-
path:
|
|
105
|
-
requestId:
|
|
104
|
+
path: s,
|
|
105
|
+
requestId: d,
|
|
106
106
|
extensions: r
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function v(e) {
|
|
110
|
-
return s(e) && typeof e.message == "string";
|
|
111
|
-
}
|
|
112
109
|
function y(e) {
|
|
113
|
-
return
|
|
110
|
+
return c(e) && typeof e.message == "string";
|
|
111
|
+
}
|
|
112
|
+
function b(e) {
|
|
113
|
+
return !e || e.code && i.has(e.code) || e.operationName && a.has(e.operationName) || e.path && o.some((t) => e.path === t || e.path?.startsWith(`${t}.`)) || e.technicalMessage && s.some((t) => e.technicalMessage.includes(t)) ? !1 : e.message.trim().length > 0;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function x(t, n = {}) {
|
|
116
116
|
if (typeof window > "u" || t instanceof DOMException && t.name === "AbortError") return;
|
|
117
|
-
let r =
|
|
118
|
-
|
|
117
|
+
let r = y(t) ? t : v(t, n);
|
|
118
|
+
b(r) && window.dispatchEvent(new CustomEvent(e, { detail: r }));
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
|
-
export { e as BACKEND_ERROR_EVENT,
|
|
121
|
+
export { e as BACKEND_ERROR_EVENT, x as dispatchBackendErrorEvent, v as extractBackendError, y as isBackendErrorDisplay, b as shouldToastBackendError };
|