@burdenoff/fe-libs 2026.1019.3 → 2026.1021.1
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.
|
@@ -210,38 +210,39 @@ function W(e, t) {
|
|
|
210
210
|
let i = P(e), a = globalThis.fetch.bind(globalThis), o = window.location.origin, s = new Set([o, "https://gw-global.local.burdenoff.com"]), c = new Set([o, "https://gw-wspace.local.burdenoff.com"]), u = (e) => /(?:^|\/)global\/graphql$/.test(e) ? "/global/graphql" : /(?:^|\/)workspaces\/graphql$/.test(e) ? "/workspaces/graphql" : "", d = (e) => {
|
|
211
211
|
let t = new URL(e, window.location.origin), i = u(t.pathname);
|
|
212
212
|
return i === "/global/graphql" && s.has(t.origin) ? `${n}${i}${t.search}${t.hash}` : i === "/workspaces/graphql" && c.has(t.origin) ? `${r}${i}${t.search}${t.hash}` : e;
|
|
213
|
-
}, f = async (e) => {
|
|
214
|
-
let
|
|
215
|
-
if (i &&
|
|
216
|
-
if (!(e.method.toUpperCase() === "POST" && t)
|
|
217
|
-
let
|
|
218
|
-
if (!
|
|
219
|
-
let
|
|
220
|
-
if (V() &&
|
|
221
|
-
let e = b(), t =
|
|
222
|
-
if (t.every((e) => e && e.expiresAt > n)) return B(t.map((e) => e.value),
|
|
213
|
+
}, f = async (e, t = !1) => {
|
|
214
|
+
let n = /(?:^|\/)graphql$/.test(new URL(e.url).pathname);
|
|
215
|
+
if (i && n) return new Promise(() => void 0);
|
|
216
|
+
if (!(e.method.toUpperCase() === "POST" && n) || t || e.keepalive) return a(e);
|
|
217
|
+
let r = await e.clone().text(), o = H(e.clone()), s = z(r);
|
|
218
|
+
if (!s?.length) return a(e);
|
|
219
|
+
let c = r.trimStart().startsWith("["), u = s.map((e) => R(o, e));
|
|
220
|
+
if (V() && u.every(Boolean)) {
|
|
221
|
+
let e = b(), t = u.map((t) => e.get(t)), n = Date.now();
|
|
222
|
+
if (t.every((e) => e && e.expiresAt > n)) return B(t.map((e) => e.value), c);
|
|
223
223
|
}
|
|
224
|
-
let
|
|
225
|
-
if (!
|
|
224
|
+
let d = await a(e);
|
|
225
|
+
if (!d.ok || !u.some(Boolean) || !V()) return d;
|
|
226
226
|
try {
|
|
227
|
-
let e = await
|
|
227
|
+
let e = await d.clone().json(), t = Array.isArray(e) ? e : [e], n = b();
|
|
228
228
|
t.forEach((e, t) => {
|
|
229
|
-
let r =
|
|
229
|
+
let r = u[t];
|
|
230
230
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
231
231
|
value: e,
|
|
232
232
|
expiresAt: Date.now() + l
|
|
233
233
|
}));
|
|
234
234
|
});
|
|
235
235
|
} catch {}
|
|
236
|
-
return
|
|
236
|
+
return d;
|
|
237
237
|
}, p = a, m = ((e, t) => {
|
|
238
238
|
if (e == null) return a(e, t);
|
|
239
|
+
let n = t?.keepalive === !0;
|
|
239
240
|
if (e instanceof Request) {
|
|
240
|
-
let
|
|
241
|
-
return f(t ? new Request(
|
|
241
|
+
let r = d(e.url), i = new Request(r, e);
|
|
242
|
+
return f(t ? new Request(i, t) : i, n);
|
|
242
243
|
}
|
|
243
|
-
let
|
|
244
|
-
return f(new Request(d(
|
|
244
|
+
let r = typeof e == "string" ? e : e.toString();
|
|
245
|
+
return f(new Request(d(r), t), n);
|
|
245
246
|
});
|
|
246
247
|
p.preconnect && (m.preconnect = p.preconnect), globalThis.fetch = m;
|
|
247
248
|
}
|