@burdenoff/fe-libs 2026.1004.1 → 2026.1004.2

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;AA4ElE;;;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,CA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;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAStC"}
@@ -7,82 +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 p, ApolloLink as m, InMemoryCache as ee, Observable as h, from as te, 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
17
  isOpen: !1,
18
18
  openCount: 0,
19
19
  nextRetryTime: 0
20
- }, v = 20, y = 5e3, b = 3e4;
21
- function ie() {
22
- if (_.consecutiveFailures++, _.lastFailureTime = Date.now(), !_.isOpen && _.consecutiveFailures >= v) {
23
- _.isOpen = !0, _.openCount++;
24
- let e = Math.min(y * 2 ** (_.openCount - 1), b);
25
- _.nextRetryTime = Date.now() + e;
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
26
  }
27
- return _.isOpen;
28
- }
29
- function x() {
30
- _.consecutiveFailures = 0, _.isOpen = !1, _.openCount = 0, _.nextRetryTime = 0, a();
27
+ return v.isOpen;
31
28
  }
32
29
  function S() {
33
- return !(!_.isOpen || Date.now() >= _.nextRetryTime);
30
+ v.consecutiveFailures = 0, v.isOpen = !1, v.openCount = 0, v.nextRetryTime = 0, a();
31
+ }
32
+ function C() {
33
+ return !(!v.isOpen || Date.now() >= v.nextRetryTime);
34
34
  }
35
- var C = /(?:\b40[13]\b|status code 40[13]|unauthori[sz]ed|unauthenticated|forbidden|invalid email or password)/i;
36
- function w(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) {
37
37
  return typeof e == "number" && Number.isInteger(e) ? e : typeof e == "string" && /^\d{3}$/.test(e) ? Number(e) : null;
38
38
  }
39
- function ae(e) {
39
+ function ie(e) {
40
40
  let t = /* @__PURE__ */ new Set(), n = (e, r) => {
41
41
  if (r > 3 || e == null || t.has(e)) return !1;
42
- if (typeof e == "string") return C.test(e);
42
+ if (typeof e == "string") return w.test(e);
43
43
  if (typeof e != "object") return !1;
44
44
  t.add(e);
45
- let i = e, a = w(i.status) ?? w(i.statusCode) ?? w(i.response?.status);
45
+ let i = e, a = T(i.status) ?? T(i.statusCode) ?? T(i.response?.status);
46
46
  if (a === 401 || a === 403) return !0;
47
47
  let o = i.message;
48
- return typeof o == "string" && C.test(o) ? !0 : n(i.cause, r + 1);
48
+ return typeof o == "string" && w.test(o) ? !0 : n(i.cause, r + 1);
49
49
  };
50
50
  return n(e, 0);
51
51
  }
52
- function oe(e) {
52
+ function ae(e) {
53
53
  if (!e || typeof e != "object") return null;
54
54
  let t = e, n = t.workspaceId || t.input?.workspaceId;
55
55
  return typeof n == "string" && n.trim() ? n : null;
56
56
  }
57
- function se(e) {
57
+ function oe(e) {
58
58
  if (!e || typeof e != "object") return null;
59
59
  let t = e.projectId;
60
60
  return typeof t == "string" && t.trim() ? t : null;
61
61
  }
62
- function ce(e) {
63
- let t = h(e);
62
+ function se(e) {
63
+ let t = g(e);
64
64
  return t.kind === "OperationDefinition" && t.operation === "mutation";
65
65
  }
66
- function le(e) {
66
+ function ce(e) {
67
67
  let t = e.errors;
68
68
  return Array.isArray(t) && t.length > 0;
69
69
  }
70
- function T(e) {
70
+ function E(e) {
71
71
  let t = e.headers;
72
72
  if (!t || typeof t != "object" || Array.isArray(t)) return {};
73
73
  let n = {};
74
74
  for (let [e, r] of Object.entries(t)) typeof r == "string" && (n[e] = r);
75
75
  return n;
76
76
  }
77
- function E(e) {
77
+ function D(e) {
78
78
  let t = e.fetchOptions;
79
79
  if (!t || typeof t != "object" || !("signal" in t)) return;
80
80
  let n = t.signal;
81
81
  return n instanceof AbortSignal ? n : void 0;
82
82
  }
83
- function ue({ uri: e, batchMax: t, batchInterval: n }) {
84
- return new p((r) => new m((i) => {
85
- let a = r.getContext(), o = { query: g(r.query) };
83
+ function le({ uri: e, batchMax: t, batchInterval: n }) {
84
+ return new m((r) => new h((i) => {
85
+ let a = r.getContext(), o = { query: _(r.query) };
86
86
  r.operationName && (o.operationName = r.operationName);
87
87
  let c = r.variables ?? {}, l = r.extensions ?? {};
88
88
  Object.keys(c).length > 0 && (o.variables = c), Object.keys(l).length > 0 && (o.extensions = l);
@@ -90,8 +90,8 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
90
90
  return s(e, {
91
91
  "content-type": "application/json",
92
92
  "Apollo-Require-Preflight": "true",
93
- ...T(a)
94
- }, o, E(a), {
93
+ ...E(a)
94
+ }, o, D(a), {
95
95
  batchMax: t,
96
96
  batchInterval: n
97
97
  }).then((e) => {
@@ -103,96 +103,109 @@ function ue({ uri: e, batchMax: t, batchInterval: n }) {
103
103
  };
104
104
  }));
105
105
  }
106
- function D(a) {
107
- let { gateway: s, baseUrl: g, authToken: v, workspaceToken: y, locale: b, 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) => {
108
- B ||= setTimeout(() => {
109
- B = null, z && z.refetchQueries({ include: "active" }).catch((t) => {
110
- 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: j, enableSubscriptions: M = !1, sseUrl: N, onAuthError: P, onRefreshToken: F, onNetworkError: I, onNetworkStatusChange: L, onMutationSuccess: R, maxRetryAttempts: ue = 3, batchMax: de = 10, batchInterval: fe, debug: z = !1 } = a, B = null, V = null, pe = (e) => {
108
+ V ||= setTimeout(() => {
109
+ V = null, B && B.refetchQueries({ include: "active" }).catch((t) => {
110
+ z && console.warn("[GraphQL] Active query refresh failed after mutation:", {
111
111
  gateway: s,
112
112
  operationName: e,
113
113
  error: t
114
114
  });
115
115
  });
116
116
  }, 0);
117
- }, V = e[s], H = n(t(g, s)), U = ue({
118
- uri: H,
119
- batchMax: fe,
120
- batchInterval: pe
121
- }), W = f((e, t) => {
122
- let n = t.headers ?? {}, r = typeof v == "function" ? v() : v;
117
+ }, H = e[s], U = n(t(_, s)), W = le({
118
+ uri: U,
119
+ batchMax: de,
120
+ batchInterval: fe
121
+ }), G = f((e, t) => {
122
+ let n = t.headers ?? {}, r = typeof y == "function" ? y() : y;
123
123
  return { headers: {
124
124
  ...n,
125
125
  ...r ? { authorization: `Bearer ${r}` } : {}
126
126
  } };
127
- }), G = f((e, t) => {
128
- let n = t.headers ?? {}, r = typeof b == "function" ? b() : b;
127
+ }), K = f((e, t) => {
128
+ let n = t.headers ?? {}, r = typeof x == "function" ? x() : x;
129
129
  return { headers: {
130
130
  ...n,
131
131
  ...r ? { "accept-language": r } : {}
132
132
  } };
133
- }), K = f((e, t) => {
134
- let n = t.headers ?? {}, r = typeof C == "function" ? C() : null;
133
+ }), q = f((e, t) => {
134
+ let n = t.headers ?? {}, r = typeof w == "function" ? w() : null;
135
135
  return { headers: {
136
136
  ...n,
137
137
  ...r?.country ? { "x-geo-country": r.country } : {},
138
138
  ...r?.currency ? { "x-geo-currency": r.currency } : {},
139
139
  ...r?.timezone ? { "x-geo-timezone": r.timezone } : {}
140
140
  } };
141
- }), q = f((e, t) => {
142
- let n = t.headers ?? {}, r = typeof w == "function" ? w() : w;
141
+ }), J = f((e, t) => {
142
+ let n = t.headers ?? {}, r = typeof T == "function" ? T() : T;
143
143
  return { headers: {
144
144
  ...n,
145
145
  ...r ? { "x-org-id": r } : {}
146
146
  } };
147
- }), J = f((e, t) => {
148
- let n = t.headers ?? {}, r = typeof T == "function" ? T() : T, i = typeof E == "function" ? E() : E;
147
+ }), me = f((e, t) => {
148
+ let n = t.headers ?? {}, r = typeof E == "function" ? E() : E, i = typeof D == "function" ? D() : D;
149
149
  return { headers: {
150
150
  ...n,
151
151
  ...r ? { "x-product-id": r } : {},
152
152
  ...i ? { "x-product-slug": i } : {}
153
153
  } };
154
- }), Y = f((e, t) => {
155
- let n = t.headers ?? {}, r = (typeof D == "function" ? D() : D) || oe(e.variables);
154
+ }), he = f((e, t) => {
155
+ let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || ae(e.variables);
156
156
  return { headers: {
157
157
  ...n,
158
158
  ...r ? { "x-workspace-id": r } : {}
159
159
  } };
160
- }), he = f((e, t) => {
161
- let n = t.headers ?? {}, r = (typeof O == "function" ? O() : O) || se(e.variables);
160
+ }), ge = f((e, t) => {
161
+ let n = t.headers ?? {}, r = (typeof k == "function" ? k() : k) || oe(e.variables);
162
162
  return { headers: {
163
163
  ...n,
164
164
  ...r ? { "x-project-id": r } : {}
165
165
  } };
166
- }), ge = f((e, t) => {
167
- 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;
168
168
  return { headers: {
169
169
  ...n,
170
170
  ...r ? { "x-tenant-id": r } : {}
171
171
  } };
172
- }), _e = f(async (e, t) => {
173
- 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, {
174
- workspaceId: a,
175
- organizationId: o,
176
- tenantId: l,
177
- projectId: u
178
- }) ? i : null;
179
- if (!d && s === "workspace") try {
180
- let t = typeof v == "function" ? v() : v;
181
- if (t) {
182
- let n = await Promise.race([c({
183
- url: H,
184
- authToken: t,
185
- workspaceId: a ?? void 0,
186
- organizationId: o ?? void 0,
187
- projectId: u ?? void 0,
172
+ }), _e = f(async (e, n) => {
173
+ let i = n.headers ?? {}, a = n.requiredWorkspaceAuth === !0;
174
+ if (s === "global" && !a) return { headers: i };
175
+ let o = typeof y == "function" ? y() : y, l = typeof b == "function" ? b() : b, u = typeof O == "function" ? O() : O, d = typeof T == "function" ? T() : T, f = typeof A == "function" ? A() : A, p = typeof k == "function" ? k() : k, m = r(l, {
176
+ workspaceId: u,
177
+ organizationId: d,
178
+ tenantId: f,
179
+ projectId: p
180
+ }) ? l : null;
181
+ if (a && n.requiredWorkspaceId && n.requiredWorkspaceId !== u) throw Error("The active workspace changed; retry the request");
182
+ if (a && !u) throw Error("Workspace authentication requires an active workspace");
183
+ if (!m && (s === "workspace" || a)) try {
184
+ let n = typeof y == "function" ? y() : y;
185
+ if (n) {
186
+ let i = await Promise.race([c({
187
+ url: s === "workspace" ? U : t(void 0, "workspace"),
188
+ authToken: n,
189
+ workspaceId: u ?? void 0,
190
+ organizationId: d ?? void 0,
191
+ projectId: p ?? void 0,
188
192
  currentQuery: e.operationName ?? ""
189
193
  }), new Promise((e) => setTimeout(() => e(null), 4e3))]);
190
- n && (d = n);
194
+ r(i, {
195
+ workspaceId: u,
196
+ organizationId: d,
197
+ tenantId: f,
198
+ projectId: p
199
+ }) && (m = i);
191
200
  }
192
201
  } catch {}
202
+ if (a) {
203
+ if (!m) throw Error("Workspace authentication is unavailable; retry the request");
204
+ if (o !== (typeof y == "function" ? y() : y) || u !== (typeof O == "function" ? O() : O) || d !== (typeof T == "function" ? T() : T) || p !== (typeof k == "function" ? k() : k) || f !== (typeof A == "function" ? A() : A)) throw Error("The active workspace changed; retry the request");
205
+ }
193
206
  return { headers: {
194
- ...n,
195
- ...d ? { "x-workspace-authorization": `Bearer ${d}` } : {}
207
+ ...i,
208
+ ...m ? { "x-workspace-authorization": `Bearer ${m}` } : {}
196
209
  } };
197
210
  }), ve = new d({
198
211
  delay: {
@@ -201,25 +214,25 @@ function D(a) {
201
214
  jitter: !0
202
215
  },
203
216
  attempts: {
204
- max: de,
217
+ max: ue,
205
218
  retryIf: (e) => {
206
- if (S() || !e) return !1;
219
+ if (C() || !e) return !1;
207
220
  let t = e.message?.toLowerCase?.() ?? "";
208
221
  return !(t.includes("401") || t.includes("403") || t.includes("unauthorized") || t.includes("forbidden") || t.includes("unauthenticated"));
209
222
  }
210
223
  }
211
- }), ye = new p((e, t) => {
212
- if (S()) {
213
- R && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
214
- let t = Math.max(0, Math.ceil((_.nextRetryTime - Date.now()) / 1e3)), n = /* @__PURE__ */ Error(`Network circuit breaker is open — backend appears unreachable. Retrying in ${t} seconds.`);
215
- return F?.(n), new m((e) => {
224
+ }), ye = new m((e, t) => {
225
+ if (C()) {
226
+ z && console.warn("[CircuitBreaker] Circuit is open, blocking request:", e.operationName);
227
+ 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.`);
228
+ return I?.(n), new h((e) => {
216
229
  e.error(n);
217
230
  });
218
231
  }
219
- return new m((n) => {
232
+ return new h((n) => {
220
233
  let r = t(e).subscribe({
221
234
  next: (e) => {
222
- x(), _.consecutiveFailures === 0 && I?.(!1), n.next(e);
235
+ S(), v.consecutiveFailures === 0 && L?.(!1), n.next(e);
223
236
  },
224
237
  error: (e) => {
225
238
  n.error(e);
@@ -240,8 +253,8 @@ function D(a) {
240
253
  let r = e.errors;
241
254
  if (r) {
242
255
  let a = r.some((e) => e.extensions?.code === "UNAUTHENTICATED" || e.message.includes("Unauthorized") || e.message.includes("Unauthenticated"));
243
- for (let e of r) R && console.error("[GraphQL Error]:", e.message);
244
- a && P || i({ errors: r }, { operationName: t.operationName });
256
+ for (let e of r) z && console.error("[GraphQL Error]:", e.message);
257
+ a && F || i({ errors: r }, { operationName: t.operationName });
245
258
  let o = new Set(["STORAGE_QUOTA_EXCEEDED", "RESOURCE_CAP_EXCEEDED"]);
246
259
  for (let e of r) {
247
260
  let t = e.extensions?.code;
@@ -250,65 +263,65 @@ function D(a) {
250
263
  break;
251
264
  }
252
265
  }
253
- if (a && P) return new m((r) => {
266
+ if (a && F) return new h((r) => {
254
267
  (async () => {
255
268
  if (X) if (await new Promise((e) => {
256
269
  Z.push({ resolve: e });
257
270
  })) {
258
271
  let e = n(t).subscribe(r);
259
272
  return () => e.unsubscribe();
260
- } else return N?.(), r.error(e), () => {};
273
+ } else return P?.(), r.error(e), () => {};
261
274
  X = !0;
262
275
  try {
263
- let i = await P();
276
+ let i = await F();
264
277
  if (X = !1, i) {
265
278
  Q(!0);
266
279
  let e = n(t).subscribe(r);
267
280
  return () => e.unsubscribe();
268
- } else return Q(!1), N?.(), r.error(e), () => {};
281
+ } else return Q(!1), P?.(), r.error(e), () => {};
269
282
  } catch {
270
- return X = !1, Q(!1), N?.(), r.error(e), () => {};
283
+ return X = !1, Q(!1), P?.(), r.error(e), () => {};
271
284
  }
272
285
  })();
273
286
  });
274
- a && N?.(), x();
287
+ a && P?.(), S();
275
288
  } else {
276
- if (R && console.error("[Network Error]:", e), ae(e)) {
277
- x(), e instanceof Error && i(e, {
289
+ if (z && console.error("[Network Error]:", e), ie(e)) {
290
+ S(), e instanceof Error && i(e, {
278
291
  operationName: t.operationName,
279
292
  fallbackMessage: "Your session is no longer valid. Please sign in again."
280
293
  });
281
294
  return;
282
295
  }
283
- if (ie() && I?.(!0), e instanceof Error) F?.(e), i(e, {
296
+ if (re() && L?.(!0), e instanceof Error) I?.(e), i(e, {
284
297
  operationName: t.operationName,
285
298
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
286
299
  });
287
300
  else {
288
301
  let n = Error(String(e));
289
- F?.(n), i(n, {
302
+ I?.(n), i(n, {
290
303
  operationName: t.operationName,
291
304
  fallbackMessage: "We could not reach the server. Please check your connection and try again."
292
305
  });
293
306
  }
294
307
  }
295
- }), xe = new p((e, t) => {
296
- let n = ce(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
297
- return new m((i) => {
308
+ }), xe = new m((e, t) => {
309
+ let n = se(e.query), r = n && e.getContext().autoRefreshAfterMutation !== !1 && e.getContext().skipMutationAutoRefresh !== !0;
310
+ return new h((i) => {
298
311
  let a = t(e).subscribe({
299
312
  next: (t) => {
300
- if (i.next(t), le(t) || (n && o(), !r)) return;
313
+ if (i.next(t), ce(t) || (n && o(), !r)) return;
301
314
  let a = e.operationName || "anonymous mutation";
302
- L ? Promise.resolve(L({
315
+ R ? Promise.resolve(R({
303
316
  gateway: s,
304
317
  operationName: a
305
318
  })).catch((e) => {
306
- R && console.warn("[GraphQL] Mutation refresh callback failed:", {
319
+ z && console.warn("[GraphQL] Mutation refresh callback failed:", {
307
320
  gateway: s,
308
321
  operationName: a,
309
322
  error: e
310
323
  });
311
- }) : me(a);
324
+ }) : pe(a);
312
325
  },
313
326
  error: (e) => {
314
327
  i.error(e);
@@ -321,54 +334,54 @@ function D(a) {
321
334
  a.unsubscribe();
322
335
  };
323
336
  });
324
- }), $ = ne([
337
+ }), $ = te([
325
338
  ve,
326
339
  ye,
327
340
  be,
328
341
  xe,
329
- W,
342
+ G,
330
343
  _e,
331
- q,
332
344
  J,
333
- Y,
345
+ me,
334
346
  he,
335
347
  ge,
336
- G,
348
+ Y,
337
349
  K,
338
- re(({ query: e }) => {
339
- let t = h(e);
350
+ q,
351
+ ne(({ query: e }) => {
352
+ let t = g(e);
340
353
  return t.kind === "OperationDefinition" && t.operation === "subscription";
341
- }, new p((e) => new m((t) => {
354
+ }, new m((e) => new h((t) => {
342
355
  t.error(/* @__PURE__ */ Error(`[graphql] Refusing to send subscription "${e.operationName ?? "anonymous"}" over the batched HTTP transport — this gateway client was created without enableSubscriptions/SSE. Enable subscriptions on this client so it routes over SSE.`));
343
- })), U)
356
+ })), W)
344
357
  ]);
345
- if (j) {
346
- let e = V.sse, t = M || (e ? n(g || V.defaultBaseUrl) + e : void 0);
347
- t && ($ = ne([
358
+ if (M) {
359
+ let e = H.sse, t = N || (e ? n(_ || H.defaultBaseUrl) + e : void 0);
360
+ t && ($ = te([
348
361
  ve,
349
362
  ye,
350
363
  be,
351
364
  xe,
352
- W,
365
+ G,
353
366
  _e,
354
- q,
355
367
  J,
356
- Y,
368
+ me,
357
369
  he,
358
370
  ge,
359
- G,
371
+ Y,
360
372
  K,
361
- re(({ query: e }) => {
362
- let t = h(e);
373
+ q,
374
+ ne(({ query: e }) => {
375
+ let t = g(e);
363
376
  return t.kind === "OperationDefinition" && t.operation === "subscription";
364
377
  }, new l({
365
378
  url: t,
366
379
  headers: {},
367
- debug: R
368
- }), U)
380
+ debug: z
381
+ }), W)
369
382
  ]));
370
383
  }
371
- let Se = new te({ typePolicies: {
384
+ let Se = new ee({ typePolicies: {
372
385
  File: { keyFields: ["id"] },
373
386
  Folder: { keyFields: ["id"] },
374
387
  Tag: { keyFields: ["id"] },
@@ -403,9 +416,9 @@ function D(a) {
403
416
  VibecontrolsAgent: { keyFields: ["id"] },
404
417
  Query: { fields: { vibes: { keyArgs: ["filter"] } } }
405
418
  } });
406
- return z = new ee({
419
+ return B = new p({
407
420
  link: $,
408
- cache: A ?? Se,
421
+ cache: j ?? Se,
409
422
  defaultOptions: {
410
423
  watchQuery: {
411
424
  fetchPolicy: "cache-and-network",
@@ -417,19 +430,19 @@ function D(a) {
417
430
  },
418
431
  mutate: { errorPolicy: "all" }
419
432
  }
420
- }), z;
433
+ }), B;
421
434
  }
422
- var O = null, k = null;
423
- function A(e) {
435
+ var k = null, A = null;
436
+ function j(e) {
424
437
  let { workspaceBaseUrl: t, globalBaseUrl: n, authToken: r, enableSubscriptions: i = !1, onAuthError: a, debug: o = !1 } = e;
425
- O = D({
438
+ k = O({
426
439
  gateway: "workspace",
427
440
  baseUrl: t,
428
441
  authToken: r,
429
442
  enableSubscriptions: i,
430
443
  onAuthError: a,
431
444
  debug: o
432
- }), k = D({
445
+ }), A = O({
433
446
  gateway: "global",
434
447
  baseUrl: n,
435
448
  authToken: r,
@@ -437,16 +450,16 @@ function A(e) {
437
450
  debug: o
438
451
  });
439
452
  }
440
- function j() {
441
- if (!O) throw Error("Workspace client not initialized. Call initializeAppClients first.");
442
- return O;
443
- }
444
453
  function M() {
445
- if (!k) throw Error("Global client not initialized. Call initializeAppClients first.");
454
+ if (!k) throw Error("Workspace client not initialized. Call initializeAppClients first.");
446
455
  return k;
447
456
  }
448
457
  function N() {
449
- O &&= (O.clearStore(), null), k &&= (k.clearStore(), null);
458
+ if (!A) throw Error("Global client not initialized. Call initializeAppClients first.");
459
+ return A;
460
+ }
461
+ function P() {
462
+ k &&= (k.clearStore(), null), A &&= (A.clearStore(), null);
450
463
  }
451
464
  //#endregion
452
- export { D as createGraphQLClient, M as getGlobalClient, j as getWorkspaceClient, A as initializeAppClients, N as resetAppClients };
465
+ export { O as createGraphQLClient, N as getGlobalClient, M as getWorkspaceClient, j as initializeAppClients, P as resetAppClients };
@@ -1 +1 @@
1
- {"version":3,"file":"AppShellProvider.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/AppShellProvider.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAcf,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,uBAAuB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,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,qBAAqB,2CAiW3F"}
@@ -272,6 +272,7 @@ function ke({ children: e, i18nProductId: t, fallbackTranslations: n, defaultBra
272
272
  children: /* @__PURE__ */ q(I, {
273
273
  enabled: p && !h,
274
274
  children: /* @__PURE__ */ q(R, {
275
+ requireWorkspace: p,
275
276
  disabled: h,
276
277
  getPageIdFromPath: f,
277
278
  children: /* @__PURE__ */ J(we, {
@@ -1 +1 @@
1
- {"version":3,"file":"MultiGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/MultiGatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAMzE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACrC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,yCAAyC;IACzC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAA4B,EAC5B,KAAa,EACb,mBAA2B,EAC3B,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CAoS3B"}
1
+ {"version":3,"file":"MultiGatewayProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/MultiGatewayProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhF,OAAO,EAAuB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAMzE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACrC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,yCAAyC;IACzC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAA4B,EAC5B,KAAa,EACb,mBAA2B,EAC3B,WAAW,EACX,cAAc,EACd,cAAc,GACf,EAAE,yBAAyB,2CA0S3B"}
@@ -78,6 +78,9 @@ function d({ children: d, workspaceBaseUrl: f, globalBaseUrl: p, organizationId:
78
78
  gateway: "global",
79
79
  baseUrl: p,
80
80
  authToken: S,
81
+ workspaceToken: C,
82
+ workspaceId: j,
83
+ projectId: M,
81
84
  organizationId: m,
82
85
  productSlug: h,
83
86
  locale: k,
@@ -91,6 +94,9 @@ function d({ children: d, workspaceBaseUrl: f, globalBaseUrl: p, organizationId:
91
94
  }), [
92
95
  p,
93
96
  S,
97
+ C,
98
+ j,
99
+ M,
94
100
  m,
95
101
  h,
96
102
  k,
@@ -24,8 +24,10 @@ export interface ToursProviderProps {
24
24
  getPageIdFromPath?: (pathname: string) => string | undefined;
25
25
  /** Disable automatic tour bootstrap for the current route tree */
26
26
  disabled?: boolean;
27
+ /** Wait for workspace selection before loading workspace-scoped progress. */
28
+ requireWorkspace?: boolean;
27
29
  }
28
- export declare function ToursProvider({ children, defaultPageId, getPageIdFromPath, disabled, }: ToursProviderProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function ToursProvider({ children, defaultPageId, getPageIdFromPath, disabled, requireWorkspace, }: ToursProviderProps): import("react/jsx-runtime").JSX.Element;
29
31
  export declare function useToursContext(): ToursContextValue;
30
32
  export declare function useSafeToursContext(): ToursContextValue;
31
33
  export declare function useTours(): {
@@ -1 +1 @@
1
- {"version":3,"file":"ToursContext.d.ts","sourceRoot":"","sources":["../../../src/shared/tours/ToursContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAOpC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAC;I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CAC5B;AAID,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7D,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAsB,EACtB,iBAAiB,EACjB,QAAgB,EAChB,gBAAwB,GACzB,EAAE,kBAAkB,2CAsVpB;AAED,wBAAgB,eAAe,IAAI,iBAAiB,CAMnD;AAED,wBAAgB,mBAAmB,IAAI,iBAAiB,CAmBvD;AAED,wBAAgB,QAAQ;;;;mBA3ZP,IAAI;4BAET,MAAM,UACN,SAAS,GAAG,WAAW,GAAG,SAAS,WAClC,MAAM,KACZ,OAAO,CAAC,IAAI,CAAC;EA+ZnB;AAED,wBAAgB,gBAAgB,IAAI,IAAI,GAAG,IAAI,CAG9C"}
@@ -14,164 +14,181 @@ import { normalizeDeviceType as ee } from "./toursContext/session.js";
14
14
  import { deriveRouteContext as te } from "./toursContext/route.js";
15
15
  import { useIdleReady as ne } from "./toursContext/useIdleReady.js";
16
16
  import { useTourMutations as re } from "./toursContext/useTourMutations.js";
17
- import { createContext as ie, use as f, useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
17
+ import { createContext as f, use as p, useCallback as m, useEffect as h, useLayoutEffect as ie, useMemo as g, useRef as _, useState as v } from "react";
18
18
  import { jsx as ae } from "react/jsx-runtime";
19
19
  import { useLocation as oe } from "react-router";
20
20
  //#region src/shared/tours/ToursContext.tsx
21
- var v = ie(null);
22
- function y({ children: ie, defaultPageId: f = "home", getPageIdFromPath: y, disabled: b = !1 }) {
23
- let x = oe(), S = e("global"), { workspaceId: C } = r(), { user: w } = n(), T = i(), { productSlug: E } = t(), D = a("ToursContext"), O = C ?? void 0, k = b || x.pathname.startsWith("/devportal"), { moduleId: A, pageId: j } = h(() => te(x.pathname, E, f, y), [
24
- f,
25
- y,
26
- x.pathname,
27
- E
28
- ]), [M, N] = _([]), [P, F] = _(!1), [I, L] = _(null), R = ne(), z = g([]), se = g(0), B = g(/* @__PURE__ */ new Map()), V = g(void 0), H = g(!1), U = g(!0), W = g(0), G = g(!0);
29
- m(() => (U.current = !0, () => {
30
- U.current = !1;
21
+ var y = f(null);
22
+ function b({ children: f, defaultPageId: p = "home", getPageIdFromPath: b, disabled: x = !1, requireWorkspace: S = !1 }) {
23
+ let C = oe(), w = e("global"), { workspaceId: se } = r(), { user: T } = n(), E = i(), { productSlug: D } = t(), O = a("ToursContext"), k = se ?? void 0, A = x || S && !k || C.pathname.startsWith("/devportal"), { moduleId: j, pageId: M } = g(() => te(C.pathname, D, p, b), [
24
+ p,
25
+ b,
26
+ C.pathname,
27
+ D
28
+ ]), [N, P] = v([]), [F, I] = v(!1), [L, R] = v(null), z = ne(), B = _([]), ce = _(0), V = _(/* @__PURE__ */ new Map()), H = _(void 0), U = _(!1), W = _(!0), G = _(0), K = _(!0);
29
+ h(() => (W.current = !0, () => {
30
+ W.current = !1;
31
31
  }), []);
32
- let K = p(async (e = !1) => {
33
- if (!R && !e) return;
34
- if (k) {
35
- U.current && (N([]), F(!1), L(null));
32
+ let q = m(async (e = !1) => {
33
+ if (!z && !e) return;
34
+ if (A) {
35
+ W.current && (P([]), I(!1), R(null));
36
36
  return;
37
37
  }
38
- if (!S) return;
39
- let t = D.child("fetch", {
40
- productSlug: E,
41
- workspaceId: O,
42
- moduleId: A,
43
- pageId: j
38
+ if (!w) return;
39
+ let t = O.child("fetch", {
40
+ productSlug: D,
41
+ workspaceId: k,
42
+ moduleId: j,
43
+ pageId: M
44
44
  }), n = ee(), r = [
45
- E,
46
- A ?? "",
45
+ D,
47
46
  j ?? "",
48
- O,
47
+ M ?? "",
48
+ k,
49
49
  n,
50
- w?.id ?? "anonymous"
50
+ T?.id ?? "anonymous"
51
51
  ].join("::");
52
- if (!e && H.current && V.current === r) return;
53
- U.current && (F(!0), L(null));
54
- let i = ++W.current;
52
+ if (!e && U.current && H.current === r) return;
53
+ W.current && (I(!0), R(null));
54
+ let i = ++G.current;
55
55
  try {
56
56
  let e = { context: {
57
- productId: E,
58
- moduleId: A,
59
- pageId: j,
60
- workspaceId: O,
57
+ productId: D,
58
+ moduleId: j,
59
+ pageId: M,
60
+ workspaceId: k,
61
61
  deviceType: n
62
- } }, a = "network-only", o, s = G.current ? c : l;
62
+ } }, a = "network-only", o, s = K.current ? c : l;
63
63
  try {
64
- o = await S.query({
64
+ o = await w.query({
65
65
  query: s,
66
66
  variables: e,
67
67
  fetchPolicy: a,
68
- errorPolicy: "none"
68
+ errorPolicy: "none",
69
+ context: {
70
+ queryDeduplication: !1,
71
+ requiredWorkspaceAuth: !!k,
72
+ requiredWorkspaceId: k
73
+ }
69
74
  });
70
75
  let n = o.errors;
71
- s === c && n?.some((e) => u(e)) && (G.current = !1, t.warn("[ToursContext] Gateway returned a Tour.myProgress validation error — falling back to query without progress chips until the backend field is published."), o = await S.query({
76
+ s === c && n?.some((e) => u(e)) && (K.current = !1, t.warn("[ToursContext] Gateway returned a Tour.myProgress validation error — falling back to query without progress chips until the backend field is published."), o = await w.query({
72
77
  query: l,
73
78
  variables: e,
74
79
  fetchPolicy: a,
75
- errorPolicy: "none"
80
+ errorPolicy: "none",
81
+ context: {
82
+ queryDeduplication: !1,
83
+ requiredWorkspaceAuth: !!k,
84
+ requiredWorkspaceId: k
85
+ }
76
86
  }));
77
87
  } catch (n) {
78
- if (s === c && u(n)) G.current = !1, t.warn("[ToursContext] Gateway does not expose Tour.myProgress yet — falling back to query without progress chips until the backend field is published."), o = await S.query({
88
+ if (s === c && u(n)) K.current = !1, t.warn("[ToursContext] Gateway does not expose Tour.myProgress yet — falling back to query without progress chips until the backend field is published."), o = await w.query({
79
89
  query: l,
80
90
  variables: e,
81
91
  fetchPolicy: a,
82
- errorPolicy: "none"
92
+ errorPolicy: "none",
93
+ context: {
94
+ queryDeduplication: !1,
95
+ requiredWorkspaceAuth: !!k,
96
+ requiredWorkspaceId: k
97
+ }
83
98
  });
84
99
  else throw n;
85
100
  }
86
101
  let d = (o.data?.toursForContext ?? []).filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t);
87
- U.current && i === W.current && (N(d), V.current = r, H.current = !0);
102
+ W.current && i === G.current && (P(d), H.current = r, U.current = !0);
88
103
  } catch (e) {
89
- if (!U.current || i !== W.current || d(e)) return;
104
+ if (!W.current || i !== G.current || d(e)) return;
90
105
  let n = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch tours");
91
- t.error("Failed to fetch tours for context", n), L(n), N([]);
106
+ t.error("Failed to fetch tours for context", n), R(n), P([]);
92
107
  } finally {
93
- U.current && i === W.current && F(!1);
108
+ W.current && i === G.current && I(!1);
94
109
  }
95
110
  }, [
96
- R,
97
- k,
98
- S,
99
- D,
111
+ z,
100
112
  A,
101
- j,
102
- E,
113
+ w,
103
114
  O,
104
- w?.id
105
- ]), q = `${w?.id ?? ""}:${O ?? ""}`, [ce, le] = _(q);
106
- ce !== q && (le(q), N([]), F(!0), L(null), z.current = [], H.current = !1, V.current = void 0, W.current += 1, B.current.clear()), m(() => {
107
- K();
108
- }, [K]), m(() => {
109
- z.current = M;
110
- }, [M]);
111
- let J = p(() => {
112
- K(!0);
113
- }, [K]), Y = h(() => M.filter((e) => o(e, T)), [M, T]), X = h(() => Y.filter((e) => e.isActive && e.steps?.length > 0 && s(e, {
114
- productId: E,
115
- moduleId: A,
116
- pageId: j
115
+ j,
116
+ M,
117
+ D,
118
+ k,
119
+ T?.id
120
+ ]), J = `${T?.id ?? ""}:${k ?? ""}`, [le, ue] = v(J);
121
+ le !== J && (ue(J), P([]), I(!0), R(null)), ie(() => (B.current = [], U.current = !1, H.current = void 0, G.current += 1, V.current.clear(), () => {
122
+ G.current += 1;
123
+ }), [J]), h(() => {
124
+ q();
125
+ }, [q]), h(() => {
126
+ B.current = N;
127
+ }, [N]);
128
+ let Y = m(() => {
129
+ q(!0);
130
+ }, [q]), X = g(() => N.filter((e) => o(e, E)), [N, E]), Z = g(() => X.filter((e) => e.isActive && e.steps?.length > 0 && s(e, {
131
+ productId: D,
132
+ moduleId: j,
133
+ pageId: M
117
134
  })).sort((e, t) => (t.priority ?? 0) - (e.priority ?? 0)), [
118
- Y,
119
- A,
135
+ X,
120
136
  j,
121
- E
122
- ]), Z = h(() => R ? X.find((e) => e.triggerType === "AUTO_FIRST_VISIT" || e.triggerType === "AUTO_ALWAYS") ?? null : null, [X, R]), { trackProgress: Q, recordStepCompletion: $, trackEvent: ue } = re({
123
- globalClient: S,
124
- userId: w?.id,
125
- productSlug: E,
126
- moduleId: A,
127
- pageId: j,
128
- workspaceId: O,
129
- setAllTours: N,
130
- allToursRef: z,
131
- progressMutationVersionRef: se,
132
- latestProgressMutationByTourRef: B
133
- }), de = h(() => ({
134
- progressScopeKey: `${w?.id ?? ""}:${O ?? ""}`,
135
- tours: Y,
136
- pageTours: X,
137
- loading: P,
138
- error: I,
139
- refetch: J,
140
- trackProgress: Q,
141
- recordStepCompletion: $,
142
- trackEvent: ue,
143
- autoStartTour: Z,
144
- productId: E,
145
- moduleId: A,
146
- pageId: j
137
+ M,
138
+ D
139
+ ]), Q = g(() => z ? Z.find((e) => e.triggerType === "AUTO_FIRST_VISIT" || e.triggerType === "AUTO_ALWAYS") ?? null : null, [Z, z]), { trackProgress: $, recordStepCompletion: de, trackEvent: fe } = re({
140
+ globalClient: w,
141
+ userId: T?.id,
142
+ productSlug: D,
143
+ moduleId: j,
144
+ pageId: M,
145
+ workspaceId: k,
146
+ setAllTours: P,
147
+ allToursRef: B,
148
+ progressMutationVersionRef: ce,
149
+ latestProgressMutationByTourRef: V
150
+ }), pe = g(() => ({
151
+ progressScopeKey: `${T?.id ?? ""}:${k ?? ""}`,
152
+ tours: X,
153
+ pageTours: Z,
154
+ loading: F,
155
+ error: L,
156
+ refetch: Y,
157
+ trackProgress: $,
158
+ recordStepCompletion: de,
159
+ trackEvent: fe,
160
+ autoStartTour: Q,
161
+ productId: D,
162
+ moduleId: j,
163
+ pageId: M
147
164
  }), [
148
- Y,
149
- w?.id,
150
- O,
151
- Z,
152
- I,
153
- P,
154
- A,
155
- j,
156
165
  X,
157
- E,
158
- $,
159
- J,
160
- ue,
161
- Q
166
+ T?.id,
167
+ k,
168
+ Q,
169
+ L,
170
+ F,
171
+ j,
172
+ M,
173
+ Z,
174
+ D,
175
+ de,
176
+ Y,
177
+ fe,
178
+ $
162
179
  ]);
163
- return /* @__PURE__ */ ae(v.Provider, {
164
- value: de,
165
- children: ie
180
+ return /* @__PURE__ */ ae(y.Provider, {
181
+ value: pe,
182
+ children: f
166
183
  });
167
184
  }
168
- function b() {
169
- let e = f(v);
185
+ function x() {
186
+ let e = p(y);
170
187
  if (!e) throw Error("useToursContext must be used within a ToursProvider");
171
188
  return e;
172
189
  }
173
- function x() {
174
- return f(v) || {
190
+ function S() {
191
+ return p(y) || {
175
192
  tours: [],
176
193
  pageTours: [],
177
194
  loading: !1,
@@ -186,8 +203,8 @@ function x() {
186
203
  pageId: void 0
187
204
  };
188
205
  }
189
- function S() {
190
- let e = b();
206
+ function C() {
207
+ let e = x();
191
208
  return {
192
209
  tours: e.pageTours,
193
210
  loading: e.loading,
@@ -196,8 +213,8 @@ function S() {
196
213
  trackProgress: e.trackProgress
197
214
  };
198
215
  }
199
- function C() {
200
- return b().autoStartTour;
216
+ function w() {
217
+ return x().autoStartTour;
201
218
  }
202
219
  //#endregion
203
- export { y as ToursProvider, C as useAutoStartTour, x as useSafeToursContext, S as useTours, b as useToursContext };
220
+ export { b as ToursProvider, w as useAutoStartTour, S as useSafeToursContext, C as useTours, x as useToursContext };
@@ -0,0 +1,6 @@
1
+ /** Keep read/modify/write progress mutations ordered independently for each tour. */
2
+ export declare function createTourProgressWriteQueue(): {
3
+ clear: () => void;
4
+ enqueue(tourId: string, isCurrent: () => boolean, write: () => Promise<void>): Promise<void>;
5
+ };
6
+ //# sourceMappingURL=progressWriteQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressWriteQueue.d.ts","sourceRoot":"","sources":["../../../../src/shared/tours/toursContext/progressWriteQueue.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,wBAAgB,4BAA4B;;oBAIxB,MAAM,aAAa,MAAM,OAAO,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC;EAgB/E"}
@@ -0,0 +1,19 @@
1
+ //#region src/shared/tours/toursContext/progressWriteQueue.ts
2
+ function e() {
3
+ let e = /* @__PURE__ */ new Map();
4
+ return {
5
+ clear: () => e.clear(),
6
+ enqueue(t, n, r) {
7
+ let i = (e.get(t) ?? Promise.resolve()).catch(() => void 0).then(async () => {
8
+ n() && await r();
9
+ });
10
+ e.set(t, i);
11
+ let a = () => {
12
+ e.get(t) === i && e.delete(t);
13
+ };
14
+ return i.then(a, a), i;
15
+ }
16
+ };
17
+ }
18
+ //#endregion
19
+ export { e as createTourProgressWriteQueue };
@@ -1 +1 @@
1
- {"version":3,"file":"useTourMutations.d.ts","sourceRoot":"","sources":["../../../../src/shared/tours/toursContext/useTourMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAKrC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,WAAW,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;IACtC,0BAA0B,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrD,+BAA+B,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACxE;AAED,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,gBAAgB,GAChB,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,MAAM,EACN,WAAW,EACX,QAAQ,EACR,MAAM,EACN,WAAW,EACX,WAAW,EACX,WAAW,EACX,0BAA0B,EAC1B,+BAA+B,GAChC,EAAE,oBAAoB;4BAYJ,MAAM,UAAU,SAAS,GAAG,WAAW,GAAG,SAAS,YAAY,MAAM;mCAsFrE,MAAM,UAAU,MAAM;4BA2CnB,cAAc,UAAU,MAAM,YAAY,iBAAiB;EAuChF"}
1
+ {"version":3,"file":"useTourMutations.d.ts","sourceRoot":"","sources":["../../../../src/shared/tours/toursContext/useTourMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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AAc,UAAU,MAAM,YAAY,iBAAiB;EA4ChF"}
@@ -1,92 +1,130 @@
1
1
  import { withTourProgressStatus as e } from "../progress.js";
2
2
  import { COMPLETE_STEP as t, COMPLETE_TOUR as n, SKIP_TOUR as r, START_TOUR as i, TRACK_TOUR_EVENT as a } from "./gql.js";
3
3
  import { getOrCreateTourSessionId as o, normalizeDeviceType as s } from "./session.js";
4
- import { useCallback as c, useRef as l } from "react";
4
+ import { createTourProgressWriteQueue as c } from "./progressWriteQueue.js";
5
+ import { useCallback as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
5
6
  //#region src/shared/tours/toursContext/useTourMutations.ts
6
- function u({ globalClient: u, userId: d, productSlug: f, moduleId: p, pageId: m, workspaceId: h, setAllTours: g, allToursRef: _, progressMutationVersionRef: v, latestProgressMutationByTourRef: y }) {
7
- let b = `${d ?? ""}:${h ?? ""}`, x = l({
8
- key: b,
7
+ function p({ globalClient: p, userId: m, productSlug: h, moduleId: g, pageId: _, workspaceId: v, setAllTours: y, allToursRef: b, progressMutationVersionRef: x, latestProgressMutationByTourRef: S }) {
8
+ let C = `${m ?? ""}:${v ?? ""}`, [w, T] = f({
9
+ key: C,
9
10
  epoch: 0
10
- }), S = l(/* @__PURE__ */ new Map());
11
- x.current.key !== b && (x.current = {
12
- key: b,
13
- epoch: x.current.epoch + 1
14
- }, S.current.clear());
15
- let C = x.current.epoch;
11
+ });
12
+ w.key !== C && T({
13
+ key: C,
14
+ epoch: w.epoch + 1
15
+ });
16
+ let E = d(null), [D] = f(c), O = d(/* @__PURE__ */ new Map()), k = w.epoch;
17
+ u(() => (E.current = k, O.current.clear(), D.clear(), () => {
18
+ E.current = null;
19
+ }), [k, D]);
20
+ let A = l((e, t) => {
21
+ let n = O.current.get(e) ?? 0;
22
+ return D.enqueue(e, () => E.current === k && (O.current.get(e) ?? 0) === n, t);
23
+ }, [k, D]);
16
24
  return {
17
- trackProgress: c(async (t, a, o) => {
18
- if (!u || !d || x.current.epoch !== C) return;
19
- let c = a === "started" ? "IN_PROGRESS" : a === "completed" ? "COMPLETED" : "SKIPPED", l = _.current.find((e) => e.id === t)?.myProgress;
25
+ trackProgress: l(async (t, a, o) => {
26
+ if (!p || !m || E.current !== k) return;
27
+ let c = a === "started" ? "IN_PROGRESS" : a === "completed" ? "COMPLETED" : "SKIPPED", l = b.current.find((e) => e.id === t)?.myProgress;
20
28
  if (a === "started" && l?.status === "IN_PROGRESS") return;
21
- a === "started" && S.current.set(t, (S.current.get(t) ?? 0) + 1);
22
- let f = v.current + 1;
23
- v.current = f, y.current.set(t, f), g((n) => {
29
+ a === "started" && O.current.set(t, (O.current.get(t) ?? 0) + 1);
30
+ let u = x.current + 1;
31
+ x.current = u, S.current.set(t, u), y((n) => {
24
32
  let r = e(n, t, c);
25
- return _.current = r, r;
33
+ return b.current = r, r;
26
34
  });
27
35
  try {
28
36
  if (a === "started") {
29
- await u.mutate({
30
- mutation: i,
31
- variables: {
32
- tourId: t,
33
- userId: d,
34
- deviceType: s()
35
- }
37
+ await A(t, async () => {
38
+ await p.mutate({
39
+ errorPolicy: "none",
40
+ context: {
41
+ requiredWorkspaceAuth: !!v,
42
+ requiredWorkspaceId: v
43
+ },
44
+ mutation: i,
45
+ variables: {
46
+ tourId: t,
47
+ userId: m,
48
+ deviceType: s()
49
+ }
50
+ });
36
51
  });
37
52
  return;
38
53
  }
39
54
  if (a === "completed") {
40
- await u.mutate({
41
- mutation: n,
55
+ await A(t, async () => {
56
+ await p.mutate({
57
+ errorPolicy: "none",
58
+ context: {
59
+ requiredWorkspaceAuth: !!v,
60
+ requiredWorkspaceId: v
61
+ },
62
+ mutation: n,
63
+ variables: {
64
+ tourId: t,
65
+ userId: m
66
+ }
67
+ });
68
+ });
69
+ return;
70
+ }
71
+ await A(t, async () => {
72
+ await p.mutate({
73
+ errorPolicy: "none",
74
+ context: {
75
+ requiredWorkspaceAuth: !!v,
76
+ requiredWorkspaceId: v
77
+ },
78
+ mutation: r,
42
79
  variables: {
43
80
  tourId: t,
44
- userId: d
81
+ userId: m
45
82
  }
46
83
  });
47
- return;
48
- }
49
- await u.mutate({
50
- mutation: r,
51
- variables: {
52
- tourId: t,
53
- userId: d
54
- }
55
84
  });
56
85
  } catch {
57
- if (x.current.epoch !== C || y.current.get(t) !== f) return;
58
- g((e) => {
86
+ if (E.current !== k || S.current.get(t) !== u) return;
87
+ y((e) => {
59
88
  let n = e.map((e) => e.id === t ? {
60
89
  ...e,
61
90
  myProgress: l
62
91
  } : e);
63
- return _.current = n, n;
92
+ return b.current = n, n;
64
93
  });
65
94
  } finally {
66
- x.current.epoch === C && y.current.get(t) === f && y.current.delete(t);
95
+ E.current === k && S.current.get(t) === u && S.current.delete(t);
67
96
  }
68
97
  }, [
69
- u,
70
- d,
71
- g,
72
- _,
73
- v,
98
+ p,
99
+ m,
74
100
  y,
75
- C
101
+ b,
102
+ x,
103
+ S,
104
+ k,
105
+ v,
106
+ A
76
107
  ]),
77
- recordStepCompletion: c(async (e, n) => {
78
- if (!u || !d || !n || x.current.epoch !== C) return;
79
- let r = S.current.get(e) ?? 0;
108
+ recordStepCompletion: l(async (e, n) => {
109
+ if (!p || !m || !n || E.current !== k) return;
110
+ let r = O.current.get(e) ?? 0;
80
111
  try {
81
- if (await u.mutate({
82
- mutation: t,
83
- variables: {
84
- tourId: e,
85
- stepId: n,
86
- userId: d
87
- }
88
- }), x.current.epoch !== C || (S.current.get(e) ?? 0) !== r) return;
89
- g((t) => {
112
+ if (await A(e, async () => {
113
+ await p.mutate({
114
+ errorPolicy: "none",
115
+ context: {
116
+ requiredWorkspaceAuth: !!v,
117
+ requiredWorkspaceId: v
118
+ },
119
+ mutation: t,
120
+ variables: {
121
+ tourId: e,
122
+ stepId: n,
123
+ userId: m
124
+ }
125
+ });
126
+ }), E.current !== k || (O.current.get(e) ?? 0) !== r) return;
127
+ y((t) => {
90
128
  let r = t.map((t) => {
91
129
  if (t.id !== e || !t.myProgress) return t;
92
130
  let r = t.myProgress.completedSteps, i = Array.isArray(r) ? r.filter((e) => typeof e == "string") : [];
@@ -99,48 +137,55 @@ function u({ globalClient: u, userId: d, productSlug: f, moduleId: p, pageId: m,
99
137
  }
100
138
  };
101
139
  });
102
- return _.current = r, r;
140
+ return b.current = r, r;
103
141
  });
104
142
  } catch {}
105
143
  }, [
106
- u,
107
- d,
108
- g,
109
- _,
110
- C
144
+ p,
145
+ m,
146
+ y,
147
+ b,
148
+ k,
149
+ v,
150
+ A
111
151
  ]),
112
- trackEvent: c(async (e, t, n) => {
113
- if (!(!u || !d || x.current.epoch !== C)) try {
114
- await u.mutate({
152
+ trackEvent: l(async (e, t, n) => {
153
+ if (!(!p || !m || E.current !== k)) try {
154
+ await p.mutate({
155
+ errorPolicy: "none",
156
+ context: {
157
+ requiredWorkspaceAuth: !!v,
158
+ requiredWorkspaceId: v
159
+ },
115
160
  mutation: a,
116
161
  variables: { input: {
117
162
  tourId: t,
118
- userId: d,
163
+ userId: m,
119
164
  sessionId: o(),
120
165
  eventType: e,
121
166
  stepId: n?.stepId,
122
167
  stepOrder: n?.stepOrder,
123
- productId: f,
124
- moduleId: p,
125
- pageId: m,
168
+ productId: h,
169
+ moduleId: g,
170
+ pageId: _,
126
171
  deviceType: s(),
127
172
  userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
128
173
  duration: n?.duration,
129
174
  metadata: n?.metadata,
130
- context: h ? { workspaceId: h } : void 0
175
+ context: v ? { workspaceId: v } : void 0
131
176
  } }
132
177
  });
133
178
  } catch {}
134
179
  }, [
135
- u,
136
180
  p,
137
- m,
138
- f,
139
- d,
181
+ g,
182
+ _,
140
183
  h,
141
- C
184
+ m,
185
+ v,
186
+ k
142
187
  ])
143
188
  };
144
189
  }
145
190
  //#endregion
146
- export { u as useTourMutations };
191
+ export { p as useTourMutations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.1004.1",
3
+ "version": "2026.1004.2",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "bin": {
@@ -311,7 +311,7 @@
311
311
  "format": "prettier --config shared/config/prettier.config.mjs --write \"src/**/*.{ts,tsx}\" \"!src/config/*.config.ts\"",
312
312
  "type:check": "bash scripts/build-limits.sh tsc --noEmit",
313
313
  "test:package-css-exports": "node scripts/validate-package-css-exports.mjs",
314
- "test": "bun test scripts/graphql-schema-drift/__tests__ scripts/a11y-audit/__tests__ src/credentials src/connections src/storage src/shared/assistant src/shared/components src/shared/graphql/links/sse-link.test.ts src/shared/graphql/fetch.test.ts src/shared/config/gatewayUrls.test.ts src/shared/config/authBridgeUrls.test.ts src/shared/config/gatewayFallback.test.ts src/shared/config/products.test.ts src/shared/config/productSlug.test.ts src/shared/hooks/shell/useProducts.test.ts src/shared/providers/shell/brandAttribute.test.ts src/chrome/ProductSwitcher.test.ts src/shared/utils/gatewayFetchRewrite.test.ts src/shared/utils/authCookie.test.ts src/shared/providers/AppShellProvider.test.ts src/shared/providers/shell/interpolate.test.ts src/shared/providers/shell/resolveTranslation.test.ts src/shared/providers/shell/I18nProvider.render.test.tsx src/shared/providers/shell/personaSurfaceRemote.test.ts src/shared/providers/shell/workspaceSwitch.client.test.tsx src/shared/events/sinks/RybbitSink.test.ts src/shell-native src/shared/native src/shared/navigation src/shared/tours src/chrome/__tests__ src/ui/__tests__",
314
+ "test": "bun test scripts/graphql-schema-drift/__tests__ scripts/a11y-audit/__tests__ src/credentials src/connections src/storage src/shared/assistant src/shared/components src/shared/graphql/links/sse-link.test.ts src/shared/graphql/fetch.test.ts src/shared/graphql/tourWorkspaceAuth.test.ts src/shared/config/gatewayUrls.test.ts src/shared/config/authBridgeUrls.test.ts src/shared/config/gatewayFallback.test.ts src/shared/config/products.test.ts src/shared/config/productSlug.test.ts src/shared/hooks/shell/useProducts.test.ts src/shared/providers/shell/brandAttribute.test.ts src/chrome/ProductSwitcher.test.ts src/shared/utils/gatewayFetchRewrite.test.ts src/shared/utils/authCookie.test.ts src/shared/providers/AppShellProvider.test.ts src/shared/providers/shell/interpolate.test.ts src/shared/providers/shell/resolveTranslation.test.ts src/shared/providers/shell/I18nProvider.render.test.tsx src/shared/providers/shell/personaSurfaceRemote.test.ts src/shared/providers/shell/workspaceSwitch.client.test.tsx src/shared/events/sinks/RybbitSink.test.ts src/shell-native src/shared/native src/shared/navigation src/shared/tours src/chrome/__tests__ src/ui/__tests__",
315
315
  "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run lint:sanity && bun run format && bun run type:check && bun run test && bun run build'",
316
316
  "switch:status": "bun scripts/deps-mode.ts status",
317
317
  "switch:remote": "bun scripts/deps-mode.ts remote",