@burdenoff/fe-libs 2026.530.2 → 2026.530.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backendErrors.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/backendErrors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAAG,yBAAkC,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MA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d,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA0ND,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,0BAA+B,GACvC,mBAAmB,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,CAc9B;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
|
-
]);
|
|
41
|
-
function
|
|
40
|
+
]), a = new Set(["ExportTranslations", "exportTranslations"]), o = ["exportTranslations"];
|
|
41
|
+
function s(e) {
|
|
42
42
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function c(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 l(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 u(e) {
|
|
52
|
+
if (!s(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 (s(r)) {
|
|
59
59
|
let e = r.result;
|
|
60
|
-
if (
|
|
60
|
+
if (s(e) && Array.isArray(e.errors)) return e.errors;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let t =
|
|
63
|
+
function d(e) {
|
|
64
|
+
let t = u(e);
|
|
65
65
|
if (t && t.length > 0) return t[0];
|
|
66
|
-
if (
|
|
66
|
+
if (s(e) && ("message" in e || "extensions" in e)) return e;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function f(e) {
|
|
69
69
|
if (e) return e.userMessage ?? e.humanMessage ?? e.displayMessage;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function p(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 m(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 f(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 h(e, r, i, a) {
|
|
85
|
+
let o = f(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 && !p(s) ? s : e?.message && !p(e.message) ? e.message : i ?? t;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function g(e) {
|
|
93
93
|
if (!(!e || e.length === 0)) return e.map((e) => String(e)).join(".");
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function _(e, t = {}) {
|
|
96
96
|
if (e == null) return null;
|
|
97
|
-
let n =
|
|
97
|
+
let n = d(e), r = n?.extensions ?? void 0, i = e instanceof Error ? e.message : s(e) ? c(e, "message") : void 0, a = l(r?.code ?? r?.errorCode) ?? m(i ?? n?.message ?? ""), o = r?.serviceName, u = g(n?.path), f = r?.requestId ?? r?.correlationId ?? r?.traceId, p = h(n, a, t.fallbackMessage, i);
|
|
98
98
|
return {
|
|
99
|
-
message:
|
|
100
|
-
technicalMessage: r?.technicalMessage ?? (n?.message && n.message !==
|
|
101
|
-
code:
|
|
99
|
+
message: p,
|
|
100
|
+
technicalMessage: r?.technicalMessage ?? (n?.message && n.message !== p ? n.message : void 0) ?? (i && i !== p ? i : void 0),
|
|
101
|
+
code: a,
|
|
102
102
|
operationName: t.operationName,
|
|
103
|
-
serviceName:
|
|
104
|
-
path:
|
|
105
|
-
requestId:
|
|
103
|
+
serviceName: o,
|
|
104
|
+
path: u,
|
|
105
|
+
requestId: f,
|
|
106
106
|
extensions: r
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function v(e) {
|
|
110
|
+
return s(e) && typeof e.message == "string";
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return !e || e.code && i.has(e.code) ? !1 : e.message.trim().length > 0;
|
|
112
|
+
function y(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}.`)) ? !1 : e.message.trim().length > 0;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function b(t, n = {}) {
|
|
116
116
|
if (typeof window > "u" || t instanceof DOMException && t.name === "AbortError") return;
|
|
117
|
-
let r =
|
|
118
|
-
|
|
117
|
+
let r = v(t) ? t : _(t, n);
|
|
118
|
+
y(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, b as dispatchBackendErrorEvent, _ as extractBackendError, v as isBackendErrorDisplay, y as shouldToastBackendError };
|