@burdenoff/fe-libs 2026.1003.4 → 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.
- package/dist/shared/graphql/client.d.ts.map +1 -1
- package/dist/shared/graphql/client.js +153 -140
- package/dist/shared/providers/AppShellProvider.d.ts +2 -0
- package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.js +154 -147
- package/dist/shared/providers/shell/MultiGatewayProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/MultiGatewayProvider.js +6 -0
- package/dist/shared/tours/TourPermissionsBoundary.d.ts +7 -0
- package/dist/shared/tours/TourPermissionsBoundary.d.ts.map +1 -0
- package/dist/shared/tours/TourPermissionsBoundary.js +17 -0
- package/dist/shared/tours/TourPlayerProvider.d.ts +1 -1
- package/dist/shared/tours/TourPlayerProvider.d.ts.map +1 -1
- package/dist/shared/tours/TourPlayerProvider.js +52 -51
- package/dist/shared/tours/TourTrigger.js +30 -26
- package/dist/shared/tours/ToursContext.d.ts +4 -1
- package/dist/shared/tours/ToursContext.d.ts.map +1 -1
- package/dist/shared/tours/ToursContext.js +100 -80
- package/dist/shared/tours/permissions.d.ts +9 -0
- package/dist/shared/tours/permissions.d.ts.map +1 -0
- package/dist/shared/tours/permissions.js +7 -0
- package/dist/shared/tours/progress.d.ts +6 -1
- package/dist/shared/tours/progress.d.ts.map +1 -1
- package/dist/shared/tours/progress.js +11 -1
- package/dist/shared/tours/routeCatalog.d.ts.map +1 -1
- package/dist/shared/tours/routeCatalog.js +51 -0
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.d.ts +2 -0
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.d.ts.map +1 -1
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +32 -31
- package/dist/shared/tours/tourTrigger/MobileTourSheet.d.ts +2 -0
- package/dist/shared/tours/tourTrigger/MobileTourSheet.d.ts.map +1 -1
- package/dist/shared/tours/tourTrigger/MobileTourSheet.js +42 -41
- package/dist/shared/tours/tourTrigger/TourLoadError.d.ts +4 -0
- package/dist/shared/tours/tourTrigger/TourLoadError.d.ts.map +1 -0
- package/dist/shared/tours/tourTrigger/TourLoadError.js +21 -0
- package/dist/shared/tours/toursContext/gql.d.ts.map +1 -1
- package/dist/shared/tours/toursContext/gql.js +2 -0
- package/dist/shared/tours/toursContext/progressWriteQueue.d.ts +6 -0
- package/dist/shared/tours/toursContext/progressWriteQueue.d.ts.map +1 -0
- package/dist/shared/tours/toursContext/progressWriteQueue.js +19 -0
- package/dist/shared/tours/toursContext/useTourMutations.d.ts.map +1 -1
- package/dist/shared/tours/toursContext/useTourMutations.js +155 -73
- package/dist/shared/tours/types.d.ts +4 -0
- package/dist/shared/tours/types.d.ts.map +1 -1
- package/dist/shared/tours/useTourPlayer.d.ts +1 -0
- package/dist/shared/tours/useTourPlayer.d.ts.map +1 -1
- package/dist/shared/tours/useTourPlayer.js +152 -141
- package/dist/shared-tours.js +9 -9
- package/dist/shared.js +9 -9
- package/package.json +2 -2
|
@@ -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;
|
|
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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AC;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"}
|
|
@@ -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
|
|
11
|
-
import { getMainDefinition as
|
|
12
|
-
import { print as
|
|
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
|
-
},
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
let e = Math.min(
|
|
25
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
36
|
-
function
|
|
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
|
|
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
|
|
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 =
|
|
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" &&
|
|
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
|
|
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
|
|
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
|
|
63
|
-
let t =
|
|
62
|
+
function se(e) {
|
|
63
|
+
let t = g(e);
|
|
64
64
|
return t.kind === "OperationDefinition" && t.operation === "mutation";
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ce(e) {
|
|
67
67
|
let t = e.errors;
|
|
68
68
|
return Array.isArray(t) && t.length > 0;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
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
|
|
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
|
|
84
|
-
return new
|
|
85
|
-
let a = r.getContext(), o = { 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
|
-
...
|
|
94
|
-
}, o,
|
|
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
|
|
107
|
-
let { gateway: s, baseUrl:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
},
|
|
118
|
-
uri:
|
|
119
|
-
batchMax:
|
|
120
|
-
batchInterval:
|
|
121
|
-
}),
|
|
122
|
-
let n = t.headers ?? {}, r = typeof
|
|
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
|
-
}),
|
|
128
|
-
let n = t.headers ?? {}, r = typeof
|
|
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
|
-
}),
|
|
134
|
-
let n = t.headers ?? {}, r = typeof
|
|
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
|
-
}),
|
|
142
|
-
let n = t.headers ?? {}, r = typeof
|
|
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
|
-
}),
|
|
148
|
-
let n = t.headers ?? {}, r = typeof
|
|
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
|
-
}),
|
|
155
|
-
let n = t.headers ?? {}, r = (typeof
|
|
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
|
-
}),
|
|
161
|
-
let n = t.headers ?? {}, r = (typeof
|
|
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
|
-
}),
|
|
167
|
-
let n = t.headers ?? {}, r = typeof
|
|
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,
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
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
|
-
...
|
|
195
|
-
...
|
|
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:
|
|
217
|
+
max: ue,
|
|
205
218
|
retryIf: (e) => {
|
|
206
|
-
if (
|
|
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
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
let t = Math.max(0, Math.ceil((
|
|
215
|
-
return
|
|
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
|
|
232
|
+
return new h((n) => {
|
|
220
233
|
let r = t(e).subscribe({
|
|
221
234
|
next: (e) => {
|
|
222
|
-
|
|
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)
|
|
244
|
-
a &&
|
|
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 &&
|
|
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
|
|
273
|
+
} else return P?.(), r.error(e), () => {};
|
|
261
274
|
X = !0;
|
|
262
275
|
try {
|
|
263
|
-
let i = await
|
|
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),
|
|
281
|
+
} else return Q(!1), P?.(), r.error(e), () => {};
|
|
269
282
|
} catch {
|
|
270
|
-
return X = !1, Q(!1),
|
|
283
|
+
return X = !1, Q(!1), P?.(), r.error(e), () => {};
|
|
271
284
|
}
|
|
272
285
|
})();
|
|
273
286
|
});
|
|
274
|
-
a &&
|
|
287
|
+
a && P?.(), S();
|
|
275
288
|
} else {
|
|
276
|
-
if (
|
|
277
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
|
296
|
-
let n =
|
|
297
|
-
return new
|
|
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),
|
|
313
|
+
if (i.next(t), ce(t) || (n && o(), !r)) return;
|
|
301
314
|
let a = e.operationName || "anonymous mutation";
|
|
302
|
-
|
|
315
|
+
R ? Promise.resolve(R({
|
|
303
316
|
gateway: s,
|
|
304
317
|
operationName: a
|
|
305
318
|
})).catch((e) => {
|
|
306
|
-
|
|
319
|
+
z && console.warn("[GraphQL] Mutation refresh callback failed:", {
|
|
307
320
|
gateway: s,
|
|
308
321
|
operationName: a,
|
|
309
322
|
error: e
|
|
310
323
|
});
|
|
311
|
-
}) :
|
|
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
|
-
}), $ =
|
|
337
|
+
}), $ = te([
|
|
325
338
|
ve,
|
|
326
339
|
ye,
|
|
327
340
|
be,
|
|
328
341
|
xe,
|
|
329
|
-
|
|
342
|
+
G,
|
|
330
343
|
_e,
|
|
331
|
-
q,
|
|
332
344
|
J,
|
|
333
|
-
|
|
345
|
+
me,
|
|
334
346
|
he,
|
|
335
347
|
ge,
|
|
336
|
-
|
|
348
|
+
Y,
|
|
337
349
|
K,
|
|
338
|
-
|
|
339
|
-
|
|
350
|
+
q,
|
|
351
|
+
ne(({ query: e }) => {
|
|
352
|
+
let t = g(e);
|
|
340
353
|
return t.kind === "OperationDefinition" && t.operation === "subscription";
|
|
341
|
-
}, new
|
|
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
|
-
})),
|
|
356
|
+
})), W)
|
|
344
357
|
]);
|
|
345
|
-
if (
|
|
346
|
-
let e =
|
|
347
|
-
t && ($ =
|
|
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
|
-
|
|
365
|
+
G,
|
|
353
366
|
_e,
|
|
354
|
-
q,
|
|
355
367
|
J,
|
|
356
|
-
|
|
368
|
+
me,
|
|
357
369
|
he,
|
|
358
370
|
ge,
|
|
359
|
-
|
|
371
|
+
Y,
|
|
360
372
|
K,
|
|
361
|
-
|
|
362
|
-
|
|
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:
|
|
368
|
-
}),
|
|
380
|
+
debug: z
|
|
381
|
+
}), W)
|
|
369
382
|
]));
|
|
370
383
|
}
|
|
371
|
-
let Se = new
|
|
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
|
|
419
|
+
return B = new p({
|
|
407
420
|
link: $,
|
|
408
|
-
cache:
|
|
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
|
-
}),
|
|
433
|
+
}), B;
|
|
421
434
|
}
|
|
422
|
-
var
|
|
423
|
-
function
|
|
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
|
-
|
|
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
|
-
}),
|
|
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("
|
|
454
|
+
if (!k) throw Error("Workspace client not initialized. Call initializeAppClients first.");
|
|
446
455
|
return k;
|
|
447
456
|
}
|
|
448
457
|
function N() {
|
|
449
|
-
|
|
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 {
|
|
465
|
+
export { O as createGraphQLClient, N as getGlobalClient, M as getWorkspaceClient, j as initializeAppClients, P as resetAppClients };
|
|
@@ -77,6 +77,8 @@ export interface AppShellConfig {
|
|
|
77
77
|
* for any path the shell does not want to name, and the default applies.
|
|
78
78
|
*/
|
|
79
79
|
tourPageIdFromPath?: (pathname: string) => string | undefined;
|
|
80
|
+
/** Resolve workspace RBAC above the tour runtime for permission-targeted tours. */
|
|
81
|
+
enableWorkspaceTourPermissions?: boolean;
|
|
80
82
|
}
|
|
81
83
|
export interface AppShellObservabilityConfig {
|
|
82
84
|
enabled?: boolean;
|
|
@@ -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;
|
|
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,CAAC;AAc/B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EASL,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AA4BnB,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gDAAgD;IAChD,MAA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