@burdenoff/fe-libs 2026.707.2 → 2026.709.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.
@@ -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;AAWD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuB3D;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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AEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
@@ -7,75 +7,82 @@ import { SSELink as l } from "./links/sse-link.js";
7
7
  import { onError as u } from "@apollo/client/link/error";
8
8
  import { RetryLink as d } from "@apollo/client/link/retry";
9
9
  import { setContext as f } from "@apollo/client/link/context";
10
- import { ApolloClient as ee, ApolloLink as p, InMemoryCache as te, Observable as m, from as ne, split as re } from "@apollo/client/core";
11
- import { getMainDefinition as h } from "@apollo/client/utilities";
12
- import { print as g } from "graphql";
10
+ import { ApolloClient as ee, ApolloLink as p, InMemoryCache as te, Observable as m, from as h, split as ne } from "@apollo/client/core";
11
+ import { getMainDefinition as g } from "@apollo/client/utilities";
12
+ import { print as _ } from "graphql";
13
13
  //#region src/shared/graphql/client.ts
14
- var _ = {
14
+ var v = {
15
15
  consecutiveFailures: 0,
16
16
  lastFailureTime: 0,
17
- isOpen: !1
18
- }, v = 5, y = 3e4;
19
- function ie() {
20
- return _.consecutiveFailures++, _.lastFailureTime = Date.now(), _.consecutiveFailures >= v && (_.isOpen = !0), _.isOpen;
17
+ isOpen: !1,
18
+ openCount: 0,
19
+ nextRetryTime: 0
20
+ }, y = 20, b = 5e3, x = 3e4;
21
+ function re() {
22
+ if (v.consecutiveFailures++, v.lastFailureTime = Date.now(), !v.isOpen && v.consecutiveFailures >= y) {
23
+ v.isOpen = !0, v.openCount++;
24
+ let e = Math.min(b * 2 ** (v.openCount - 1), x);
25
+ v.nextRetryTime = Date.now() + e;
26
+ }
27
+ return v.isOpen;
21
28
  }
22
- function b() {
23
- _.consecutiveFailures = 0, _.isOpen = !1, a();
29
+ function S() {
30
+ v.consecutiveFailures = 0, v.isOpen = !1, v.openCount = 0, v.nextRetryTime = 0, a();
24
31
  }
25
- function x() {
26
- return _.isOpen ? Date.now() - _.lastFailureTime > y ? (_.isOpen = !1, _.consecutiveFailures = 0, !1) : !0 : !1;
32
+ function C() {
33
+ return !(!v.isOpen || Date.now() >= v.nextRetryTime);
27
34
  }
28
- var S = /(?:\b40[13]\b|status code 40[13]|unauthori[sz]ed|unauthenticated|forbidden|invalid email or password)/i;
29
- function C(e) {
35
+ var w = /(?:\b40[13]\b|status code 40[13]|unauthori[sz]ed|unauthenticated|forbidden|invalid email or password)/i;
36
+ function T(e) {
30
37
  return typeof e == "number" && Number.isInteger(e) ? e : typeof e == "string" && /^\d{3}$/.test(e) ? Number(e) : null;
31
38
  }
32
- function ae(e) {
39
+ function ie(e) {
33
40
  let t = /* @__PURE__ */ new Set(), n = (e, r) => {
34
41
  if (r > 3 || e == null || t.has(e)) return !1;
35
- if (typeof e == "string") return S.test(e);
42
+ if (typeof e == "string") return w.test(e);
36
43
  if (typeof e != "object") return !1;
37
44
  t.add(e);
38
- let i = e, a = C(i.status) ?? C(i.statusCode) ?? C(i.response?.status);
45
+ let i = e, a = T(i.status) ?? T(i.statusCode) ?? T(i.response?.status);
39
46
  if (a === 401 || a === 403) return !0;
40
47
  let o = i.message;
41
- return typeof o == "string" && S.test(o) ? !0 : n(i.cause, r + 1);
48
+ return typeof o == "string" && w.test(o) ? !0 : n(i.cause, r + 1);
42
49
  };
43
50
  return n(e, 0);
44
51
  }
45
- function oe(e) {
52
+ function ae(e) {
46
53
  if (!e || typeof e != "object") return null;
47
54
  let t = e, n = t.workspaceId || t.input?.workspaceId;
48
55
  return typeof n == "string" && n.trim() ? n : null;
49
56
  }
50
- function se(e) {
57
+ function oe(e) {
51
58
  if (!e || typeof e != "object") return null;
52
59
  let t = e.projectId;
53
60
  return typeof t == "string" && t.trim() ? t : null;
54
61
  }
55
- function ce(e) {
56
- let t = h(e);
62
+ function se(e) {
63
+ let t = g(e);
57
64
  return t.kind === "OperationDefinition" && t.operation === "mutation";
58
65
  }
59
- function le(e) {
66
+ function ce(e) {
60
67
  let t = e.errors;
61
68
  return Array.isArray(t) && t.length > 0;
62
69
  }
63
- function w(e) {
70
+ function E(e) {
64
71
  let t = e.headers;
65
72
  if (!t || typeof t != "object" || Array.isArray(t)) return {};
66
73
  let n = {};
67
74
  for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
68
75
  return n;
69
76
  }
70
- function T(e) {
77
+ function D(e) {
71
78
  let t = e.fetchOptions;
72
79
  if (!t || typeof t != "object" || !("signal" in t)) return;
73
80
  let n = t.signal;
74
81
  return n instanceof AbortSignal ? n : void 0;
75
82
  }
76
- function ue({ uri: e, batchMax: t, batchInterval: n }) {
83
+ function le({ uri: e, batchMax: t, batchInterval: n }) {
77
84
  return new p((r) => new m((i) => {
78
- let a = r.getContext(), o = { query: g(r.query) };
85
+ let a = r.getContext(), o = { query: _(r.query) };
79
86
  r.operationName && (o.operationName = r.operationName);
80
87
  let c = r.variables ?? {}, l = r.extensions ?? {};
81
88
  Object.keys(c).length > 0 && (o.variables = c), Object.keys(l).length > 0 && (o.extensions = l);
@@ -83,8 +90,8 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
83
90
  return s(e, {
84
91
  "content-type": "application/json",
85
92
  "Apollo-Require-Preflight": "true",
86
- ...w(a)
87
- }, o, T(a), {
93
+ ...E(a)
94
+ }, o, D(a), {
88
95
  batchMax: t,
89
96
  batchInterval: n
90
97
  }).then((e) => {
@@ -96,84 +103,84 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
96
103
  };
97
104
  }));
98
105
  }
99
- function E(a) {
100
- let { gateway: s, baseUrl: g, authToken: v, workspaceToken: y, locale: S, geography: C, organizationId: w, productId: T, productSlug: E, workspaceId: D, projectId: O, tenantId: k, cache: A, enableSubscriptions: j = !1, sseUrl: M, onAuthError: N, onRefreshToken: P, onNetworkError: F, onNetworkStatusChange: I, onMutationSuccess: L, maxRetryAttempts: de = 3, batchMax: fe = 10, batchInterval: pe, debug: R = !1 } = a, z = null, B = null, me = (e) => {
101
- B ||= setTimeout(() => {
102
- B = null, z && z.refetchQueries({ include: "active" }).catch((t) => {
103
- R && console.warn("[GraphQL] Active query refresh failed after mutation:", {
106
+ function O(a) {
107
+ let { gateway: s, baseUrl: _, authToken: y, workspaceToken: b, locale: x, geography: w, organizationId: T, productId: E, productSlug: D, workspaceId: O, projectId: k, tenantId: A, cache: ue, enableSubscriptions: de = !1, sseUrl: fe, onAuthError: j, onRefreshToken: M, onNetworkError: N, onNetworkStatusChange: P, onMutationSuccess: F, maxRetryAttempts: pe = 3, batchMax: me = 10, batchInterval: he, debug: I = !1 } = a, L = null, R = null, ge = (e) => {
108
+ R ||= setTimeout(() => {
109
+ R = null, L && L.refetchQueries({ include: "active" }).catch((t) => {
110
+ I && console.warn("[GraphQL] Active query refresh failed after mutation:", {
104
111
  gateway: s,
105
112
  operationName: e,
106
113
  error: t
107
114
  });
108
115
  });
109
116
  }, 0);
110
- }, he = e[s], V = n(t(g, s)), H = ue({
111
- uri: V,
112
- batchMax: fe,
113
- batchInterval: pe
114
- }), U = f((e, t) => {
115
- let n = t.headers ?? {}, r = typeof v == "function" ? v() : v;
117
+ }, z = e[s], B = n(t(_, s)), V = le({
118
+ uri: B,
119
+ batchMax: me,
120
+ batchInterval: he
121
+ }), H = f((e, t) => {
122
+ let n = t.headers ?? {}, r = typeof y == "function" ? y() : y;
116
123
  return { headers: {
117
124
  ...n,
118
125
  ...r ? { authorization: `Bearer ${r}` } : {}
119
126
  } };
120
- }), W = f((e, t) => {
121
- let n = t.headers ?? {}, r = typeof S == "function" ? S() : S;
127
+ }), U = f((e, t) => {
128
+ let n = t.headers ?? {}, r = typeof x == "function" ? x() : x;
122
129
  return { headers: {
123
130
  ...n,
124
131
  ...r ? { "accept-language": r } : {}
125
132
  } };
126
- }), G = f((e, t) => {
127
- let n = t.headers ?? {}, r = typeof C == "function" ? C() : null;
133
+ }), W = f((e, t) => {
134
+ let n = t.headers ?? {}, r = typeof w == "function" ? w() : null;
128
135
  return { headers: {
129
136
  ...n,
130
137
  ...r?.country ? { "x-geo-country": r.country } : {},
131
138
  ...r?.currency ? { "x-geo-currency": r.currency } : {},
132
139
  ...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
133
140
  } };
134
- }), K = f((e, t) => {
135
- let n = t.headers ?? {}, r = typeof w == "function" ? w() : w;
141
+ }), G = f((e, t) => {
142
+ let n = t.headers ?? {}, r = typeof T == "function" ? T() : T;
136
143
  return { headers: {
137
144
  ...n,
138
145
  ...r ? { "x-org-id": r } : {}
139
146
  } };
140
- }), q = f((e, t) => {
141
- let n = t.headers ?? {}, r = typeof T == "function" ? T() : T, i = typeof E == "function" ? E() : E;
147
+ }), K = f((e, t) => {
148
+ let n = t.headers ?? {}, r = typeof E == "function" ? E() : E, i = typeof D == "function" ? D() : D;
142
149
  return { headers: {
143
150
  ...n,
144
151
  ...r ? { "x-product-id": r } : {},
145
152
  ...i ? { "x-product-slug": i } : {}
146
153
  } };
147
- }), J = f((e, t) => {
148
- let n = t.headers ?? {}, r = (typeof D == "function" ? D() : D) || oe(e.variables);
154
+ }), q = f((e, t) => {
155
+ let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || ae(e.variables);
149
156
  return { headers: {
150
157
  ...n,
151
158
  ...r ? { "x-workspace-id": r } : {}
152
159
  } };
153
- }), ge = f((e, t) => {
154
- let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || se(e.variables);
160
+ }), J = f((e, t) => {
161
+ let n = t.headers ?? {}, r = (typeof k == "function" ? k() : k) || oe(e.variables);
155
162
  return { headers: {
156
163
  ...n,
157
164
  ...r ? { "x-project-id": r } : {}
158
165
  } };
159
- }), _e = f((e, t) => {
160
- let n = t.headers ?? {}, r = typeof k == "function" ? k() : k;
166
+ }), Y = f((e, t) => {
167
+ let n = t.headers ?? {}, r = typeof A == "function" ? A() : A;
161
168
  return { headers: {
162
169
  ...n,
163
170
  ...r ? { "x-tenant-id": r } : {}
164
171
  } };
165
- }), Y = f(async (e, t) => {
166
- let n = t.headers ?? {}, i = typeof y == "function" ? y() : y, a = typeof D == "function" ? D() : D, o = typeof w == "function" ? w() : w, l = typeof k == "function" ? k() : k, u = typeof O == "function" ? O() : O, d = r(i, {
172
+ }), _e = f(async (e, t) => {
173
+ let n = t.headers ?? {}, i = typeof b == "function" ? b() : b, a = typeof O == "function" ? O() : O, o = typeof T == "function" ? T() : T, l = typeof A == "function" ? A() : A, u = typeof k == "function" ? k() : k, d = r(i, {
167
174
  workspaceId: a,
168
175
  organizationId: o,
169
176
  tenantId: l,
170
177
  projectId: u
171
178
  }) ? i : null;
172
179
  if (!d && s === "workspace") try {
173
- let t = typeof v == "function" ? v() : v;
180
+ let t = typeof y == "function" ? y() : y;
174
181
  if (t) {
175
182
  let n = await Promise.race([c({
176
- url: V,
183
+ url: B,
177
184
  authToken: t,
178
185
  workspaceId: a ?? void 0,
179
186
  organizationId: o ?? void 0,
@@ -194,25 +201,25 @@ function E(a) {
194
201
  jitter: !0
195
202
  },
196
203
  attempts: {
197
- max: de,
204
+ max: pe,
198
205
  retryIf: (e) => {
199
- if (x() || !e) return !1;
206
+ if (C() || !e) return !1;
200
207
  let t = e.message?.toLowerCase?.() ?? "";
201
208
  return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
202
209
  }
203
210
  }
204
211
  }), ye = new p((e, t) => {
205
- if (x()) {
206
- R && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
207
- let t = /* @__PURE__ */ Error("Network circuit breaker is open — backend appears unreachable. Retrying in 30 seconds.");
208
- return F?.(t), new m((e) => {
209
- e.error(t);
212
+ if (C()) {
213
+ I && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
214
+ let t = Math.max(0, Math.ceil((v.nextRetryTime - Date.now()) / 1e3)), n = /* @__PURE__ */ Error(`Network circuit breaker is open — backend appears unreachable. Retrying in ${t} seconds.`);
215
+ return N?.(n), new m((e) => {
216
+ e.error(n);
210
217
  });
211
218
  }
212
219
  return new m((n) => {
213
220
  let r = t(e).subscribe({
214
221
  next: (e) => {
215
- b(), _.consecutiveFailures === 0 && I?.(!1), n.next(e);
222
+ S(), v.consecutiveFailures === 0 && P?.(!1), n.next(e);
216
223
  },
217
224
  error: (e) => {
218
225
  n.error(e);
@@ -233,7 +240,7 @@ function E(a) {
233
240
  let r = e.errors;
234
241
  if (r) {
235
242
  let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
236
- for (let e of r) R && console.error("[GraphQL Error]:", e.message);
243
+ for (let e of r) I && console.error("[GraphQL Error]:", e.message);
237
244
  i({ errors: r }, { operationName: t.operationName });
238
245
  let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
239
246
  for (let e of r) {
@@ -243,65 +250,65 @@ function E(a) {
243
250
  break;
244
251
  }
245
252
  }
246
- if (a && P) return new m((r) => {
253
+ if (a && M) return new m((r) => {
247
254
  (async () => {
248
255
  if (X) if (await new Promise((e) => {
249
256
  Z.push({ resolve: e });
250
257
  })) {
251
258
  let e = n(t).subscribe(r);
252
259
  return () => e.unsubscribe();
253
- } else return N?.(), r.error(e), () => {};
260
+ } else return j?.(), r.error(e), () => {};
254
261
  X = !0;
255
262
  try {
256
- let i = await P();
263
+ let i = await M();
257
264
  if (X = !1, i) {
258
265
  Q(!0);
259
266
  let e = n(t).subscribe(r);
260
267
  return () => e.unsubscribe();
261
- } else return Q(!1), N?.(), r.error(e), () => {};
268
+ } else return Q(!1), j?.(), r.error(e), () => {};
262
269
  } catch {
263
- return X = !1, Q(!1), N?.(), r.error(e), () => {};
270
+ return X = !1, Q(!1), j?.(), r.error(e), () => {};
264
271
  }
265
272
  })();
266
273
  });
267
- a && N?.(), b();
274
+ a && j?.(), S();
268
275
  } else {
269
- if (R && console.error("[Network Error]:", e), ae(e)) {
270
- b(), e instanceof Error && i(e, {
276
+ if (I && console.error("[Network Error]:", e), ie(e)) {
277
+ S(), e instanceof Error && i(e, {
271
278
  operationName: t.operationName,
272
279
  fallbackMessage: "Your session is no longer valid. Please sign in again."
273
280
  });
274
281
  return;
275
282
  }
276
- if (ie() && I?.(!0), e instanceof Error) F?.(e), i(e, {
283
+ if (re() && P?.(!0), e instanceof Error) N?.(e), i(e, {
277
284
  operationName: t.operationName,
278
285
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
279
286
  });
280
287
  else {
281
288
  let n = Error(String(e));
282
- F?.(n), i(n, {
289
+ N?.(n), i(n, {
283
290
  operationName: t.operationName,
284
291
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
285
292
  });
286
293
  }
287
294
  }
288
295
  }), xe = new p((e, t) => {
289
- let n = ce(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
296
+ let n = se(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
290
297
  return new m((i) => {
291
298
  let a = t(e).subscribe({
292
299
  next: (t) => {
293
- if (i.next(t), le(t) || (n && o(), !r)) return;
300
+ if (i.next(t), ce(t) || (n && o(), !r)) return;
294
301
  let a = e.operationName || "anonymous mutation";
295
- L ? Promise.resolve(L({
302
+ F ? Promise.resolve(F({
296
303
  gateway: s,
297
304
  operationName: a
298
305
  })).catch((e) => {
299
- R && console.warn("[GraphQL] Mutation refresh callback failed:", {
306
+ I && console.warn("[GraphQL] Mutation refresh callback failed:", {
300
307
  gateway: s,
301
308
  operationName: a,
302
309
  error: e
303
310
  });
304
- }) : me(a);
311
+ }) : ge(a);
305
312
  },
306
313
  error: (e) => {
307
314
  i.error(e);
@@ -314,46 +321,46 @@ function E(a) {
314
321
  a.unsubscribe();
315
322
  };
316
323
  });
317
- }), $ = ne([
324
+ }), $ = h([
318
325
  ve,
319
326
  ye,
320
327
  be,
321
328
  xe,
322
- U,
323
- Y,
329
+ H,
330
+ _e,
331
+ G,
324
332
  K,
325
333
  q,
326
334
  J,
327
- ge,
328
- _e,
335
+ Y,
336
+ U,
329
337
  W,
330
- G,
331
- H
338
+ V
332
339
  ]);
333
- if (j) {
334
- let e = M || n(g || he.defaultBaseUrl) + he.sse;
335
- e && ($ = ne([
340
+ if (de) {
341
+ let e = fe || n(_ || z.defaultBaseUrl) + z.sse;
342
+ e && ($ = h([
336
343
  ve,
337
344
  ye,
338
345
  be,
339
346
  xe,
340
- U,
341
- Y,
347
+ H,
348
+ _e,
349
+ G,
342
350
  K,
343
351
  q,
344
352
  J,
345
- ge,
346
- _e,
353
+ Y,
354
+ U,
347
355
  W,
348
- G,
349
- re(({ query: e }) => {
350
- let t = h(e);
356
+ ne(({ query: e }) => {
357
+ let t = g(e);
351
358
  return t.kind === "OperationDefinition" && t.operation === "subscription";
352
359
  }, new l({
353
360
  url: e,
354
361
  headers: {},
355
- debug: R
356
- }), H)
362
+ debug: I
363
+ }), V)
357
364
  ]));
358
365
  }
359
366
  let Se = new te({ typePolicies: {
@@ -391,9 +398,9 @@ function E(a) {
391
398
  VibecontrolsAgent: { keyFields: ["id"] },
392
399
  Query: { fields: { vibes: { keyArgs: ["filter"] } } }
393
400
  } });
394
- return z = new ee({
401
+ return L = new ee({
395
402
  link: $,
396
- cache: A ?? Se,
403
+ cache: ue ?? Se,
397
404
  defaultOptions: {
398
405
  watchQuery: {
399
406
  fetchPolicy: "cache-and-network",
@@ -405,19 +412,19 @@ function E(a) {
405
412
  },
406
413
  mutate: { errorPolicy: "all" }
407
414
  }
408
- }), z;
415
+ }), L;
409
416
  }
410
- var D = null, O = null;
411
- function k(e) {
417
+ var k = null, A = null;
418
+ function ue(e) {
412
419
  let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
413
- D = E({
420
+ k = O({
414
421
  gateway: "workspace",
415
422
  baseUrl: t,
416
423
  authToken: r,
417
424
  enableSubscriptions: i,
418
425
  onAuthError: a,
419
426
  debug: o
420
- }), O = E({
427
+ }), A = O({
421
428
  gateway: "global",
422
429
  baseUrl: n,
423
430
  authToken: r,
@@ -425,16 +432,16 @@ function k(e) {
425
432
  debug: o
426
433
  });
427
434
  }
428
- function A() {
429
- if (!D) throw Error("Workspace client not initialized. Call initializeAppClients first.");
430
- return D;
435
+ function de() {
436
+ if (!k) throw Error("Workspace client not initialized. Call initializeAppClients first.");
437
+ return k;
431
438
  }
432
- function j() {
433
- if (!O) throw Error("Global client not initialized. Call initializeAppClients first.");
434
- return O;
439
+ function fe() {
440
+ if (!A) throw Error("Global client not initialized. Call initializeAppClients first.");
441
+ return A;
435
442
  }
436
- function M() {
437
- D &&= (D.clearStore(), null), O &&= (O.clearStore(), null);
443
+ function j() {
444
+ k &&= (k.clearStore(), null), A &&= (A.clearStore(), null);
438
445
  }
439
446
  //#endregion
440
- export { E as createGraphQLClient, j as getGlobalClient, A as getWorkspaceClient, k as initializeAppClients, M as resetAppClients };
447
+ export { O as createGraphQLClient, fe as getGlobalClient, de as getWorkspaceClient, ue as initializeAppClients, j as resetAppClients };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.707.2",
3
+ "version": "2026.709.1",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {