@burdenoff/fe-libs 2026.1112.5 → 2026.1112.6
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.
|
@@ -7,7 +7,8 @@ import { Gateway } from '../config';
|
|
|
7
7
|
* response nor joins an identical in-flight read, and its fresh result is
|
|
8
8
|
* stored, so later cacheable reads of the same operation see the new data.
|
|
9
9
|
* Apollo `network-only` / `no-cache` reads and `refetch()` use this
|
|
10
|
-
* (BOFF-7932).
|
|
10
|
+
* (BOFF-7932). The browser fetch runs with `cache: 'reload'`, which also
|
|
11
|
+
* keeps the gateway rewrite's page-load cache from answering it (BOFF-10386).
|
|
11
12
|
* - `'no-store'`: always send the read to the network and keep it out of the
|
|
12
13
|
* cache entirely (no replay, no join, no store); the browser fetch also runs
|
|
13
14
|
* with `cache: 'no-store'`. For authoritative reconciliation reads whose
|
|
@@ -291,7 +291,10 @@ async function Z(e) {
|
|
|
291
291
|
return t;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
|
|
294
|
+
function Q(e) {
|
|
295
|
+
return e.some((e) => e.responseCache === "no-store") ? { cache: "no-store" } : e.some((e) => e.responseCache === "reload") ? { cache: "reload" } : {};
|
|
296
|
+
}
|
|
297
|
+
async function he(e, t, n) {
|
|
295
298
|
if (n.length === 1) {
|
|
296
299
|
let r = n[0];
|
|
297
300
|
try {
|
|
@@ -301,7 +304,7 @@ async function Q(e, t, n) {
|
|
|
301
304
|
credentials: "include",
|
|
302
305
|
body: JSON.stringify(r.body),
|
|
303
306
|
signal: r.signal,
|
|
304
|
-
...r
|
|
307
|
+
...Q([r]),
|
|
305
308
|
...r.keepalive ? { keepalive: !0 } : {}
|
|
306
309
|
}), i = await Z(n);
|
|
307
310
|
if (!n.ok && !J(i)) throw Error(Y(n));
|
|
@@ -318,7 +321,7 @@ async function Q(e, t, n) {
|
|
|
318
321
|
headers: q(t),
|
|
319
322
|
credentials: "include",
|
|
320
323
|
body: JSON.stringify(r),
|
|
321
|
-
...n
|
|
324
|
+
...Q(n)
|
|
322
325
|
}), a = await Z(i);
|
|
323
326
|
if (!i.ok && !me(a, n) && !J(a)) throw Error(Y(i));
|
|
324
327
|
if (Array.isArray(a)) a.forEach((e, t) => {
|
|
@@ -333,7 +336,7 @@ async function Q(e, t, n) {
|
|
|
333
336
|
n.forEach((t) => t.reject(e));
|
|
334
337
|
}
|
|
335
338
|
}
|
|
336
|
-
function
|
|
339
|
+
function ge(e, t, n, r, i) {
|
|
337
340
|
let a = pe(t), o = i?.keepalive === !0, s = o ? 1 : Math.max(1, i?.batchMax ?? ae), c = Math.max(0, i?.batchInterval ?? ue()), l = `${e}|${JSON.stringify(a)}`, u = i?.responseCache !== "no-store" && de(n) ? `${l}|${JSON.stringify(fe(n))}` : void 0;
|
|
338
341
|
if (r?.aborted) return Promise.reject(I(r));
|
|
339
342
|
if (u && i?.responseCache !== "reload") {
|
|
@@ -350,7 +353,7 @@ function he(e, t, n, r, i) {
|
|
|
350
353
|
}
|
|
351
354
|
let d = new Promise((t, d) => {
|
|
352
355
|
if (s <= 1) {
|
|
353
|
-
|
|
356
|
+
he(e, a, [{
|
|
354
357
|
body: n,
|
|
355
358
|
resolve: t,
|
|
356
359
|
reject: d,
|
|
@@ -379,7 +382,7 @@ function he(e, t, n, r, i) {
|
|
|
379
382
|
p.requests.push(m), r && r.addEventListener("abort", () => {
|
|
380
383
|
let e = z().get(l), t = e ? e.requests.indexOf(m) : -1;
|
|
381
384
|
e && t >= 0 && (e.requests.splice(t, 1), e.requests.length === 0 && (e.timer && clearTimeout(e.timer), z().delete(l))), d(I(r));
|
|
382
|
-
}, { once: !0 }), p.requests.length >= p.batchMax ?
|
|
385
|
+
}, { once: !0 }), p.requests.length >= p.batchMax ? _e(e, a, l) : p.timer || (p.timer = setTimeout(() => _e(e, a, l), p.batchInterval));
|
|
383
386
|
});
|
|
384
387
|
if (u && !r) {
|
|
385
388
|
let e = V();
|
|
@@ -389,9 +392,9 @@ function he(e, t, n, r, i) {
|
|
|
389
392
|
}
|
|
390
393
|
return d;
|
|
391
394
|
}
|
|
392
|
-
function
|
|
395
|
+
function _e(e, t, n) {
|
|
393
396
|
let r = z(), i = r.get(n);
|
|
394
|
-
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null),
|
|
397
|
+
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), he(e, t, i.requests));
|
|
395
398
|
}
|
|
396
399
|
async function $(e) {
|
|
397
400
|
let { gateway: n, query: r, variables: i, operationName: a, authToken: o, workspaceToken: c, workspaceId: d, organizationId: f, tenantId: h, projectId: g, locale: v, baseUrl: y, extraHeaders: S, signal: C, suppressGlobalErrorEvent: E, keepalive: D, batch: k } = e;
|
|
@@ -480,7 +483,7 @@ async function $(e) {
|
|
|
480
483
|
}), null) : null;
|
|
481
484
|
};
|
|
482
485
|
try {
|
|
483
|
-
let t =
|
|
486
|
+
let t = ge(A, R, V, C, {
|
|
484
487
|
...D ? { keepalive: !0 } : {},
|
|
485
488
|
...k === !1 ? { batchMax: 1 } : {},
|
|
486
489
|
responseCache: e.responseCache
|
|
@@ -503,10 +506,10 @@ async function $(e) {
|
|
|
503
506
|
}), e;
|
|
504
507
|
}
|
|
505
508
|
}
|
|
506
|
-
function
|
|
509
|
+
function ve(e) {
|
|
507
510
|
return $({
|
|
508
511
|
...e,
|
|
509
512
|
authTokenMode: "pinned"
|
|
510
513
|
});
|
|
511
514
|
}
|
|
512
|
-
export { g as SESSION_EXPIRED_EVENT, re as clearGraphqlFetchResponseCache,
|
|
515
|
+
export { g as SESSION_EXPIRED_EVENT, re as clearGraphqlFetchResponseCache, ge as enqueueGraphQLFetch, P as ensureWorkspaceToken, ie as evictGraphqlFetchResponses, b as getStoredAuthToken, te as getStoredGeography, T as getStoredLocale, D as getStoredOrganizationId, k as getStoredProjectId, O as getStoredTenantId, E as getStoredWorkspaceId, x as getStoredWorkspaceToken, $ as graphqlFetch, ve as graphqlFetchPinned, U as isGraphqlFetchCacheHit, F as resolveGatewayUrl };
|
|
@@ -217,7 +217,7 @@ function W(e, t) {
|
|
|
217
217
|
let r = await e.clone().text(), o = H(e.clone()), s = z(r);
|
|
218
218
|
if (!s?.length) return a(e);
|
|
219
219
|
let c = r.trimStart().startsWith("["), u = s.map((e) => R(o, e));
|
|
220
|
-
if (V() && u.every(Boolean)) {
|
|
220
|
+
if (e.cache !== "reload" && e.cache !== "no-cache" && V() && u.every(Boolean)) {
|
|
221
221
|
let e = b(), t = u.map((t) => e.get(t)), n = Date.now();
|
|
222
222
|
if (t.every((e) => e && e.expiresAt > n)) return B(t.map((e) => e.value), c);
|
|
223
223
|
}
|