@burdenoff/fe-libs 2026.601.13 → 2026.601.14

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":"client.d.ts","sourceRoot":"","sources":["../../../src/shared/graphql/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,aAAa,EAId,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAiB,KAAK,OAAO,EAAY,MAAM,WAAW,CAAC;AAqDlE;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAkBD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI,CAAC;IACT,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,oFAAoF;IACpF,WAAW,CA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,CAAC;IAC1E,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AA6FD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,gBAonB/D;AASD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA0BlE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAKjD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAK9C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
@@ -2,28 +2,28 @@ import { GATEWAYS as e, getGatewayUrl as t } from "../../shared-config.js";
2
2
  import { validateGatewayBaseUrl as n } from "./security.js";
3
3
  import { isWorkspaceTokenValidForContext as r } from "./workspaceToken.js";
4
4
  import { dispatchBackendErrorEvent as i, markConnectionHealthy as a } from "../utils/backendErrors.js";
5
- import { enqueueGraphQLFetch as o } from "./fetch.js";
6
- import { SSELink as s } from "./links/sse-link.js";
7
- import { onError as c } from "@apollo/client/link/error";
8
- import { RetryLink as l } from "@apollo/client/link/retry";
9
- import { setContext as u } from "@apollo/client/link/context";
10
- import { ApolloClient as ee, ApolloLink as d, InMemoryCache as te, Observable as f, from as p, split as ne } from "@apollo/client/core";
11
- import { getMainDefinition as m } from "@apollo/client/utilities";
12
- import { print as h } from "graphql";
5
+ import { clearGraphqlFetchResponseCache as o, enqueueGraphQLFetch as s } from "./fetch.js";
6
+ import { SSELink as c } from "./links/sse-link.js";
7
+ import { onError as l } from "@apollo/client/link/error";
8
+ import { RetryLink as u } from "@apollo/client/link/retry";
9
+ import { setContext as d } from "@apollo/client/link/context";
10
+ import { ApolloClient as ee, ApolloLink as f, InMemoryCache as te, Observable as p, from as m, split as ne } from "@apollo/client/core";
11
+ import { getMainDefinition as h } from "@apollo/client/utilities";
12
+ import { print as g } from "graphql";
13
13
  //#region src/shared/graphql/client.ts
14
- var g = {
14
+ var _ = {
15
15
  consecutiveFailures: 0,
16
16
  lastFailureTime: 0,
17
17
  isOpen: !1
18
- }, _ = 5, v = 3e4;
18
+ }, v = 5, y = 3e4;
19
19
  function re() {
20
- return g.consecutiveFailures++, g.lastFailureTime = Date.now(), g.consecutiveFailures >= _ && (g.isOpen = !0), g.isOpen;
21
- }
22
- function y() {
23
- g.consecutiveFailures = 0, g.isOpen = !1, a();
20
+ return _.consecutiveFailures++, _.lastFailureTime = Date.now(), _.consecutiveFailures >= v && (_.isOpen = !0), _.isOpen;
24
21
  }
25
22
  function ie() {
26
- return g.isOpen ? Date.now() - g.lastFailureTime > v ? (g.isOpen = !1, g.consecutiveFailures = 0, !1) : !0 : !1;
23
+ _.consecutiveFailures = 0, _.isOpen = !1, a();
24
+ }
25
+ function b() {
26
+ return _.isOpen ? Date.now() - _.lastFailureTime > y ? (_.isOpen = !1, _.consecutiveFailures = 0, !1) : !0 : !1;
27
27
  }
28
28
  function ae(e) {
29
29
  if (!e || typeof e != "object") return null;
@@ -36,37 +36,37 @@ function oe(e) {
36
36
  return typeof t == "string" && t.trim() ? t : null;
37
37
  }
38
38
  function se(e) {
39
- let t = m(e);
39
+ let t = h(e);
40
40
  return t.kind === "OperationDefinition" && t.operation === "mutation";
41
41
  }
42
42
  function ce(e) {
43
43
  let t = e.errors;
44
44
  return Array.isArray(t) && t.length > 0;
45
45
  }
46
- function b(e) {
46
+ function x(e) {
47
47
  let t = e.headers;
48
48
  if (!t || typeof t != "object" || Array.isArray(t)) return {};
49
49
  let n = {};
50
50
  for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
51
51
  return n;
52
52
  }
53
- function x(e) {
53
+ function S(e) {
54
54
  let t = e.fetchOptions;
55
55
  if (!t || typeof t != "object" || !("signal" in t)) return;
56
56
  let n = t.signal;
57
57
  return n instanceof AbortSignal ? n : void 0;
58
58
  }
59
59
  function le({ uri: e, batchMax: t, batchInterval: n }) {
60
- return new d((r) => new f((i) => {
61
- let a = r.getContext(), s = { query: h(r.query) };
62
- r.operationName && (s.operationName = r.operationName);
60
+ return new f((r) => new p((i) => {
61
+ let a = r.getContext(), o = { query: g(r.query) };
62
+ r.operationName && (o.operationName = r.operationName);
63
63
  let c = r.variables ?? {}, l = r.extensions ?? {};
64
- Object.keys(c).length > 0 && (s.variables = c), Object.keys(l).length > 0 && (s.extensions = l);
64
+ Object.keys(c).length > 0 && (o.variables = c), Object.keys(l).length > 0 && (o.extensions = l);
65
65
  let u = !1;
66
- return o(e, {
66
+ return s(e, {
67
67
  "content-type": "application/json",
68
- ...b(a)
69
- }, s, x(a), {
68
+ ...x(a)
69
+ }, o, S(a), {
70
70
  batchMax: t,
71
71
  batchInterval: n
72
72
  }).then((e) => {
@@ -78,83 +78,83 @@ function le({ uri: e, batchMax: t, batchInterval: n }) {
78
78
  };
79
79
  }));
80
80
  }
81
- function S(a) {
82
- let { gateway: o, baseUrl: h, authToken: _, workspaceToken: v, locale: b, geography: x, organizationId: S, productId: C, workspaceId: w, projectId: T, tenantId: E, cache: D, enableSubscriptions: O = !1, sseUrl: ue, onAuthError: k, onRefreshToken: A, onNetworkError: j, onNetworkStatusChange: M, onMutationSuccess: N, maxRetryAttempts: de = 3, batchMax: fe = 10, batchInterval: pe, debug: P = !1 } = a, F = null, I = null, me = (e) => {
83
- I ||= setTimeout(() => {
84
- I = null, F && F.refetchQueries({ include: "active" }).catch((t) => {
85
- P && console.warn("[GraphQL] Active query refresh failed after mutation:", {
86
- gateway: o,
81
+ function C(a) {
82
+ let { gateway: s, baseUrl: g, authToken: v, workspaceToken: y, locale: x, geography: S, organizationId: C, productId: w, workspaceId: T, projectId: E, tenantId: D, cache: O, enableSubscriptions: k = !1, sseUrl: ue, onAuthError: A, onRefreshToken: j, onNetworkError: M, onNetworkStatusChange: N, onMutationSuccess: P, maxRetryAttempts: de = 3, batchMax: fe = 10, batchInterval: pe, debug: F = !1 } = a, I = null, L = null, me = (e) => {
83
+ L ||= setTimeout(() => {
84
+ L = null, I && I.refetchQueries({ include: "active" }).catch((t) => {
85
+ F && console.warn("[GraphQL] Active query refresh failed after mutation:", {
86
+ gateway: s,
87
87
  operationName: e,
88
88
  error: t
89
89
  });
90
90
  });
91
91
  }, 0);
92
- }, L = e[o], R = le({
93
- uri: n(t(h, o)),
92
+ }, R = e[s], z = le({
93
+ uri: n(t(g, s)),
94
94
  batchMax: fe,
95
95
  batchInterval: pe
96
- }), z = u((e, t) => {
97
- let n = t.headers ?? {}, r = typeof _ == "function" ? _() : _;
96
+ }), B = d((e, t) => {
97
+ let n = t.headers ?? {}, r = typeof v == "function" ? v() : v;
98
98
  return { headers: {
99
99
  ...n,
100
100
  ...r ? { authorization: `Bearer ${r}` } : {}
101
101
  } };
102
- }), B = u((e, t) => {
103
- let n = t.headers ?? {}, r = typeof b == "function" ? b() : b;
102
+ }), V = d((e, t) => {
103
+ let n = t.headers ?? {}, r = typeof x == "function" ? x() : x;
104
104
  return { headers: {
105
105
  ...n,
106
106
  ...r ? { "accept-language": r } : {}
107
107
  } };
108
- }), V = u((e, t) => {
109
- let n = t.headers ?? {}, r = typeof x == "function" ? x() : null;
108
+ }), H = d((e, t) => {
109
+ let n = t.headers ?? {}, r = typeof S == "function" ? S() : null;
110
110
  return { headers: {
111
111
  ...n,
112
112
  ...r?.country ? { "x-geo-country": r.country } : {},
113
113
  ...r?.currency ? { "x-geo-currency": r.currency } : {},
114
114
  ...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
115
115
  } };
116
- }), H = u((e, t) => {
117
- let n = t.headers ?? {}, r = typeof S == "function" ? S() : S;
116
+ }), U = d((e, t) => {
117
+ let n = t.headers ?? {}, r = typeof C == "function" ? C() : C;
118
118
  return { headers: {
119
119
  ...n,
120
120
  ...r ? { "x-org-id": r } : {}
121
121
  } };
122
- }), U = u((e, t) => {
123
- let n = t.headers ?? {}, r = typeof C == "function" ? C() : C;
122
+ }), W = d((e, t) => {
123
+ let n = t.headers ?? {}, r = typeof w == "function" ? w() : w;
124
124
  return { headers: {
125
125
  ...n,
126
126
  ...r ? { "x-product-id": r } : {}
127
127
  } };
128
- }), W = u((e, t) => {
129
- let n = t.headers ?? {}, r = (typeof w == "function" ? w() : w) || ae(e.variables);
128
+ }), G = d((e, t) => {
129
+ let n = t.headers ?? {}, r = (typeof T == "function" ? T() : T) || ae(e.variables);
130
130
  return { headers: {
131
131
  ...n,
132
132
  ...r ? { "x-workspace-id": r } : {}
133
133
  } };
134
- }), G = u((e, t) => {
135
- let n = t.headers ?? {}, r = (typeof T == "function" ? T() : T) || oe(e.variables);
134
+ }), K = d((e, t) => {
135
+ let n = t.headers ?? {}, r = (typeof E == "function" ? E() : E) || oe(e.variables);
136
136
  return { headers: {
137
137
  ...n,
138
138
  ...r ? { "x-project-id": r } : {}
139
139
  } };
140
- }), K = u((e, t) => {
141
- let n = t.headers ?? {}, r = typeof E == "function" ? E() : E;
140
+ }), q = d((e, t) => {
141
+ let n = t.headers ?? {}, r = typeof D == "function" ? D() : D;
142
142
  return { headers: {
143
143
  ...n,
144
144
  ...r ? { "x-tenant-id": r } : {}
145
145
  } };
146
- }), q = u((e, t) => {
147
- let n = t.headers ?? {}, i = typeof v == "function" ? v() : v, a = r(i, {
148
- workspaceId: typeof w == "function" ? w() : w,
149
- organizationId: typeof S == "function" ? S() : S,
150
- tenantId: typeof E == "function" ? E() : E,
151
- projectId: typeof T == "function" ? T() : T
146
+ }), J = d((e, t) => {
147
+ let n = t.headers ?? {}, i = typeof y == "function" ? y() : y, a = r(i, {
148
+ workspaceId: typeof T == "function" ? T() : T,
149
+ organizationId: typeof C == "function" ? C() : C,
150
+ tenantId: typeof D == "function" ? D() : D,
151
+ projectId: typeof E == "function" ? E() : E
152
152
  }) ? i : null;
153
153
  return { headers: {
154
154
  ...n,
155
155
  ...a ? { "x-workspace-authorization": `Bearer ${a}` } : {}
156
156
  } };
157
- }), J = new l({
157
+ }), Y = new u({
158
158
  delay: {
159
159
  initial: 1e3,
160
160
  max: 8e3,
@@ -163,23 +163,23 @@ function S(a) {
163
163
  attempts: {
164
164
  max: de,
165
165
  retryIf: (e) => {
166
- if (ie() || !e) return !1;
166
+ if (b() || !e) return !1;
167
167
  let t = e.message?.toLowerCase?.() ?? "";
168
168
  return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
169
169
  }
170
170
  }
171
- }), Y = new d((e, t) => {
172
- if (ie()) {
173
- P && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
171
+ }), he = new f((e, t) => {
172
+ if (b()) {
173
+ F && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
174
174
  let t = /* @__PURE__ */ Error("Network circuit breaker is open — backend appears unreachable. Retrying in 30 seconds.");
175
- return j?.(t), new f((e) => {
175
+ return M?.(t), new p((e) => {
176
176
  e.error(t);
177
177
  });
178
178
  }
179
- return new f((n) => {
179
+ return new p((n) => {
180
180
  let r = t(e).subscribe({
181
181
  next: (e) => {
182
- y(), g.consecutiveFailures === 0 && M?.(!1), n.next(e);
182
+ ie(), _.consecutiveFailures === 0 && N?.(!1), n.next(e);
183
183
  },
184
184
  error: (e) => {
185
185
  n.error(e);
@@ -196,11 +196,11 @@ function S(a) {
196
196
  function Q(e) {
197
197
  Z.forEach(({ resolve: t }) => t(e)), Z = [];
198
198
  }
199
- let he = c(({ error: e, operation: t, forward: n }) => {
199
+ let ge = l(({ error: e, operation: t, forward: n }) => {
200
200
  let r = e.errors;
201
201
  if (r) {
202
202
  let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
203
- for (let e of r) P && console.error("[GraphQL Error]:", e.message);
203
+ for (let e of r) F && console.error("[GraphQL Error]:", e.message);
204
204
  i({ errors: r }, { operationName: t.operationName });
205
205
  let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
206
206
  for (let e of r) {
@@ -210,111 +210,111 @@ function S(a) {
210
210
  break;
211
211
  }
212
212
  }
213
- if (a && A) return new f((r) => {
213
+ if (a && j) return new p((r) => {
214
214
  (async () => {
215
215
  if (X) if (await new Promise((e) => {
216
216
  Z.push({ resolve: e });
217
217
  })) {
218
218
  let e = n(t).subscribe(r);
219
219
  return () => e.unsubscribe();
220
- } else return k?.(), r.error(e), () => {};
220
+ } else return A?.(), r.error(e), () => {};
221
221
  X = !0;
222
222
  try {
223
- let i = await A();
223
+ let i = await j();
224
224
  if (X = !1, i) {
225
225
  Q(!0);
226
226
  let e = n(t).subscribe(r);
227
227
  return () => e.unsubscribe();
228
- } else return Q(!1), k?.(), r.error(e), () => {};
228
+ } else return Q(!1), A?.(), r.error(e), () => {};
229
229
  } catch {
230
- return X = !1, Q(!1), k?.(), r.error(e), () => {};
230
+ return X = !1, Q(!1), A?.(), r.error(e), () => {};
231
231
  }
232
232
  })();
233
233
  });
234
- a && k?.(), y();
235
- } else if (P && console.error("[Network Error]:", e), re() && M?.(!0), e instanceof Error) j?.(e), i(e, {
234
+ a && A?.(), ie();
235
+ } else if (F && console.error("[Network Error]:", e), re() && N?.(!0), e instanceof Error) M?.(e), i(e, {
236
236
  operationName: t.operationName,
237
237
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
238
238
  });
239
239
  else {
240
240
  let n = Error(String(e));
241
- j?.(n), i(n, {
241
+ M?.(n), i(n, {
242
242
  operationName: t.operationName,
243
243
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
244
244
  });
245
245
  }
246
- }), ge = new d((e, t) => {
247
- let n = se(e.query) && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
248
- return new f((r) => {
249
- let i = t(e).subscribe({
246
+ }), _e = new f((e, t) => {
247
+ let n = se(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
248
+ return new p((i) => {
249
+ let a = t(e).subscribe({
250
250
  next: (t) => {
251
- if (r.next(t), !n || ce(t)) return;
252
- let i = e.operationName || "anonymous mutation";
253
- N ? Promise.resolve(N({
254
- gateway: o,
255
- operationName: i
251
+ if (i.next(t), ce(t) || (n && o(), !r)) return;
252
+ let a = e.operationName || "anonymous mutation";
253
+ P ? Promise.resolve(P({
254
+ gateway: s,
255
+ operationName: a
256
256
  })).catch((e) => {
257
- P && console.warn("[GraphQL] Mutation refresh callback failed:", {
258
- gateway: o,
259
- operationName: i,
257
+ F && console.warn("[GraphQL] Mutation refresh callback failed:", {
258
+ gateway: s,
259
+ operationName: a,
260
260
  error: e
261
261
  });
262
- }) : me(i);
262
+ }) : me(a);
263
263
  },
264
264
  error: (e) => {
265
- r.error(e);
265
+ i.error(e);
266
266
  },
267
267
  complete: () => {
268
- r.complete();
268
+ i.complete();
269
269
  }
270
270
  });
271
271
  return () => {
272
- i.unsubscribe();
272
+ a.unsubscribe();
273
273
  };
274
274
  });
275
- }), $ = p([
276
- J,
275
+ }), $ = m([
277
276
  Y,
278
277
  he,
279
278
  ge,
280
- z,
281
- q,
282
- H,
279
+ _e,
280
+ B,
281
+ J,
283
282
  U,
284
283
  W,
285
284
  G,
286
285
  K,
287
- B,
286
+ q,
288
287
  V,
289
- R
288
+ H,
289
+ z
290
290
  ]);
291
- if (O) {
292
- let e = ue || n(h || L.defaultBaseUrl) + L.sse;
293
- e && ($ = p([
294
- J,
291
+ if (k) {
292
+ let e = ue || n(g || R.defaultBaseUrl) + R.sse;
293
+ e && ($ = m([
295
294
  Y,
296
295
  he,
297
296
  ge,
298
- z,
299
- q,
300
- H,
297
+ _e,
298
+ B,
299
+ J,
301
300
  U,
302
301
  W,
303
302
  G,
304
303
  K,
305
- B,
304
+ q,
306
305
  V,
306
+ H,
307
307
  ne(({ query: e }) => {
308
- let t = m(e);
308
+ let t = h(e);
309
309
  return t.kind === "OperationDefinition" && t.operation === "subscription";
310
- }, new s({
310
+ }, new c({
311
311
  url: e,
312
312
  headers: {},
313
- debug: P
314
- }), R)
313
+ debug: F
314
+ }), z)
315
315
  ]));
316
316
  }
317
- let _e = new te({ typePolicies: {
317
+ let ve = new te({ typePolicies: {
318
318
  File: { keyFields: ["id"] },
319
319
  Folder: { keyFields: ["id"] },
320
320
  Tag: { keyFields: ["id"] },
@@ -349,9 +349,9 @@ function S(a) {
349
349
  VibecontrolsAgent: { keyFields: ["id"] },
350
350
  Query: { fields: { vibes: { keyArgs: ["filter"] } } }
351
351
  } });
352
- return F = new ee({
352
+ return I = new ee({
353
353
  link: $,
354
- cache: D ?? _e,
354
+ cache: O ?? ve,
355
355
  defaultOptions: {
356
356
  watchQuery: {
357
357
  fetchPolicy: "cache-and-network",
@@ -363,19 +363,19 @@ function S(a) {
363
363
  },
364
364
  mutate: { errorPolicy: "all" }
365
365
  }
366
- }), F;
366
+ }), I;
367
367
  }
368
- var C = null, w = null;
369
- function T(e) {
368
+ var w = null, T = null;
369
+ function E(e) {
370
370
  let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
371
- C = S({
371
+ w = C({
372
372
  gateway: "workspace",
373
373
  baseUrl: t,
374
374
  authToken: r,
375
375
  enableSubscriptions: i,
376
376
  onAuthError: a,
377
377
  debug: o
378
- }), w = S({
378
+ }), T = C({
379
379
  gateway: "global",
380
380
  baseUrl: n,
381
381
  authToken: r,
@@ -383,16 +383,16 @@ function T(e) {
383
383
  debug: o
384
384
  });
385
385
  }
386
- function E() {
387
- if (!C) throw Error("Workspace client not initialized. Call initializeAppClients first.");
388
- return C;
389
- }
390
386
  function D() {
391
- if (!w) throw Error("Global client not initialized. Call initializeAppClients first.");
387
+ if (!w) throw Error("Workspace client not initialized. Call initializeAppClients first.");
392
388
  return w;
393
389
  }
394
390
  function O() {
395
- C &&= (C.clearStore(), null), w &&= (w.clearStore(), null);
391
+ if (!T) throw Error("Global client not initialized. Call initializeAppClients first.");
392
+ return T;
393
+ }
394
+ function k() {
395
+ w &&= (w.clearStore(), null), T &&= (T.clearStore(), null);
396
396
  }
397
397
  //#endregion
398
- export { S as createGraphQLClient, D as getGlobalClient, E as getWorkspaceClient, T as initializeAppClients, O as resetAppClients };
398
+ export { C as createGraphQLClient, O as getGlobalClient, D as getWorkspaceClient, E as initializeAppClients, k as resetAppClients };
@@ -106,6 +106,29 @@ export interface EnqueueGraphQLFetchOptions {
106
106
  batchMax?: number;
107
107
  batchInterval?: number;
108
108
  }
109
+ /**
110
+ * Drop the short-lived GraphQL read caches so the next read of any operation
111
+ * hits the network.
112
+ *
113
+ * `enqueueGraphQLFetch` keeps two read-side maps so a page-load burst of
114
+ * identical reads coalesces into one request:
115
+ * - `__graphqlFetchResponseCache` — RESOLVED responses, kept for
116
+ * `RECENT_QUERY_CACHE_TTL_MS`.
117
+ * - `__graphqlFetchPendingResponses` — IN-FLIGHT promises, deduped by key.
118
+ *
119
+ * Both would otherwise serve a STALE result to a refetch issued right after a
120
+ * mutation (same operationName + variables): the resolved cache returns the
121
+ * pre-mutation response directly, and the pending map can coalesce the refetch
122
+ * onto a read that was already on the wire before the write committed. Either
123
+ * one makes created/updated/deleted rows invisible until a full page reload.
124
+ * Callers that perform a write clear both so every follow-up read is fresh.
125
+ *
126
+ * Clearing `__graphqlFetchPendingResponses` only stops FUTURE callers from
127
+ * coalescing onto those in-flight requests — it does not abort them. The
128
+ * original awaiters still hold their promise references and resolve normally,
129
+ * and the `.finally` cleanup deletes a key that is already gone (a safe no-op).
130
+ */
131
+ export declare function clearGraphqlFetchResponseCache(): void;
109
132
  export declare function enqueueGraphQLFetch(url: string, headers: Record<string, string>, body: Record<string, unknown>, signal?: AbortSignal, options?: EnqueueGraphQLFetchOptions): Promise<unknown>;
110
133
  /**
111
134
  * Make a GraphQL request with automatic auth + locale headers.
@@ -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;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;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AM,EAAE,MAAM,CAAC,EAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,OAAO,CAAC,CAyElB;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,YAAY,CAAC,CAAC,GAAG,OAAO,EAC5C,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CA8I7B"}
@@ -159,51 +159,54 @@ function P() {
159
159
  let e = j();
160
160
  return e.__graphqlFetchPendingResponses ||= /* @__PURE__ */ new Map(), e.__graphqlFetchPendingResponses;
161
161
  }
162
- var F = 10, I = 600, L = 100, R = 1e4, z = 15e3, B = new Set([
162
+ function F() {
163
+ N().clear(), P().clear();
164
+ }
165
+ var I = 10, L = 600, R = 100, z = 1e4, B = 15e3, V = new Set([
163
166
  "traceparent",
164
167
  "tracestate",
165
168
  "baggage"
166
169
  ]);
167
- function V() {
168
- if (typeof performance > "u") return L;
170
+ function H() {
171
+ if (typeof performance > "u") return R;
169
172
  let e = j();
170
- return e.__graphqlFetchBurstStartedAt ??= performance.now(), performance.now() - e.__graphqlFetchBurstStartedAt < R ? I : L;
173
+ return e.__graphqlFetchBurstStartedAt ??= performance.now(), performance.now() - e.__graphqlFetchBurstStartedAt < z ? L : R;
171
174
  }
172
- function H(e) {
175
+ function U(e) {
173
176
  return typeof e.query == "string" ? /^\s*query\b/.test(e.query) : !1;
174
177
  }
175
- function U(e) {
178
+ function W(e) {
176
179
  return typeof e.operationName == "string" && e.operationName.length > 0 ? {
177
180
  operationName: e.operationName,
178
181
  variables: e.variables ?? null
179
182
  } : e;
180
183
  }
181
- function W(e) {
184
+ function G(e) {
182
185
  let t = /* @__PURE__ */ new Map();
183
186
  for (let [n, r] of Object.entries(e)) {
184
187
  let e = n.toLowerCase();
185
- B.has(e) || t.set(e, r);
188
+ V.has(e) || t.set(e, r);
186
189
  }
187
190
  return Object.fromEntries(Array.from(t.entries()).sort(([e], [t]) => e.localeCompare(t)));
188
191
  }
189
- function G(t) {
192
+ function K(t) {
190
193
  let n = e();
191
194
  return {
192
195
  ...t,
193
196
  traceparent: n.traceparent
194
197
  };
195
198
  }
196
- function K(e) {
197
- return J(e) && Array.isArray(e.errors);
198
- }
199
199
  function q(e) {
200
+ return Y(e) && Array.isArray(e.errors);
201
+ }
202
+ function J(e) {
200
203
  let t = e.status;
201
204
  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.";
202
205
  }
203
- function J(e) {
206
+ function Y(e) {
204
207
  return typeof e == "object" && !!e && !Array.isArray(e);
205
208
  }
206
- async function Y(e) {
209
+ async function X(e) {
207
210
  let t = await e.text();
208
211
  if (!t) return null;
209
212
  try {
@@ -212,21 +215,21 @@ async function Y(e) {
212
215
  return t;
213
216
  }
214
217
  }
215
- async function X(e, t, n) {
218
+ async function Z(e, t, n) {
216
219
  if (n.length === 1) {
217
220
  let r = n[0];
218
221
  try {
219
222
  let n = await fetch(e, {
220
223
  method: "POST",
221
- headers: G(t),
224
+ headers: K(t),
222
225
  credentials: "include",
223
226
  body: JSON.stringify(r.body),
224
227
  signal: r.signal
225
- }), i = await Y(n);
226
- if (!n.ok && !K(i)) throw Error(q(n));
228
+ }), i = await X(n);
229
+ if (!n.ok && !q(i)) throw Error(J(n));
227
230
  r.cacheKey && N().set(r.cacheKey, {
228
231
  value: i,
229
- expiresAt: Date.now() + z
232
+ expiresAt: Date.now() + B
230
233
  }), r.resolve(i);
231
234
  } catch (e) {
232
235
  r.reject(e);
@@ -237,29 +240,29 @@ async function X(e, t, n) {
237
240
  try {
238
241
  let i = await fetch(e, {
239
242
  method: "POST",
240
- headers: G(t),
243
+ headers: K(t),
241
244
  credentials: "include",
242
245
  body: JSON.stringify(r)
243
- }), a = await Y(i);
244
- if (!i.ok && !K(a)) throw Error(q(i));
246
+ }), a = await X(i);
247
+ if (!i.ok && !q(a)) throw Error(J(i));
245
248
  Array.isArray(a) ? a.forEach((e, t) => {
246
249
  let r = n[t];
247
250
  r && (r.cacheKey && N().set(r.cacheKey, {
248
251
  value: e,
249
- expiresAt: Date.now() + z
252
+ expiresAt: Date.now() + B
250
253
  }), r.resolve(e));
251
254
  }) : n.forEach((e) => {
252
255
  e.cacheKey && N().set(e.cacheKey, {
253
256
  value: a,
254
- expiresAt: Date.now() + z
257
+ expiresAt: Date.now() + B
255
258
  }), e.resolve(a);
256
259
  });
257
260
  } catch (e) {
258
261
  n.forEach((t) => t.reject(e));
259
262
  }
260
263
  }
261
- function Z(e, t, n, r, i) {
262
- let a = W(t), o = Math.max(1, i?.batchMax ?? F), s = Math.max(0, i?.batchInterval ?? V()), c = `${e}|${JSON.stringify(a)}`, l = H(n) ? `${c}|${JSON.stringify(U(n))}` : void 0;
264
+ function Q(e, t, n, r, i) {
265
+ let a = G(t), o = Math.max(1, i?.batchMax ?? I), s = Math.max(0, i?.batchInterval ?? H()), c = `${e}|${JSON.stringify(a)}`, l = U(n) ? `${c}|${JSON.stringify(W(n))}` : void 0;
263
266
  if (l) {
264
267
  let e = N(), t = e.get(l);
265
268
  if (t) {
@@ -271,7 +274,7 @@ function Z(e, t, n, r, i) {
271
274
  }
272
275
  let u = new Promise((t, i) => {
273
276
  if (o <= 1) {
274
- X(e, a, [{
277
+ Z(e, a, [{
275
278
  body: n,
276
279
  resolve: t,
277
280
  reject: i,
@@ -293,20 +296,20 @@ function Z(e, t, n, r, i) {
293
296
  signal: r,
294
297
  cacheKey: l
295
298
  }), d.requests.length >= d.batchMax) {
296
- Q(e, a, c);
299
+ $(e, a, c);
297
300
  return;
298
301
  }
299
- d.timer ||= setTimeout(() => Q(e, a, c), d.batchInterval);
302
+ d.timer ||= setTimeout(() => $(e, a, c), d.batchInterval);
300
303
  });
301
304
  return l && (P().set(l, u), u.finally(() => {
302
305
  P().delete(l);
303
306
  }).catch(() => {})), u;
304
307
  }
305
- function Q(e, t, n) {
308
+ function $(e, t, n) {
306
309
  let r = M(), i = r.get(n);
307
- i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), X(e, t, i.requests));
310
+ i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), Z(e, t, i.requests));
308
311
  }
309
- async function $(e) {
312
+ async function ee(e) {
310
313
  let { gateway: t, query: n, variables: r, operationName: i, authToken: a, workspaceToken: o, workspaceId: c, organizationId: p, tenantId: m, projectId: _, locale: v, baseUrl: S, extraHeaders: C, signal: T, suppressGlobalErrorEvent: E } = e, O = l(A(t, S)), j = a && !y(a) ? a : h(), M = v ?? x(), N = D({
311
314
  workspaceId: c,
312
315
  organizationId: p,
@@ -349,7 +352,7 @@ async function $(e) {
349
352
  let L = { query: n };
350
353
  r && (L.variables = r), i && (L.operationName = i);
351
354
  try {
352
- let e = await Z(O, P, L, T);
355
+ let e = await Q(O, P, L, T);
353
356
  return f(), e.errors?.length && !E && d({ errors: e.errors }, { operationName: i }), e;
354
357
  } catch (e) {
355
358
  throw E || d(e, {
@@ -359,4 +362,4 @@ async function $(e) {
359
362
  }
360
363
  }
361
364
  //#endregion
362
- export { Z as enqueueGraphQLFetch, h as getStoredAuthToken, x as getStoredLocale, C as getStoredOrganizationId, T as getStoredProjectId, S as getStoredWorkspaceId, g as getStoredWorkspaceToken, $ as graphqlFetch, A as resolveGatewayUrl };
365
+ export { F as clearGraphqlFetchResponseCache, Q as enqueueGraphQLFetch, h as getStoredAuthToken, x as getStoredLocale, C as getStoredOrganizationId, T as getStoredProjectId, S as getStoredWorkspaceId, g as getStoredWorkspaceToken, ee as graphqlFetch, A as resolveGatewayUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.601.13",
3
+ "version": "2026.601.14",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {