@burdenoff/fe-libs 2026.1011.1 → 2026.1011.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/fetch.d.ts +6 -0
- package/dist/shared/graphql/fetch.js +114 -104
- package/dist/shared/graphql/index.d.ts +1 -0
- package/dist/shared/graphql/prepareWorkspaceRequest.d.ts +15 -0
- package/dist/shared/graphql/prepareWorkspaceRequest.js +56 -0
- package/dist/shared/graphql/workspaceToken.d.ts +1 -0
- package/dist/shared/graphql/workspaceToken.js +1 -0
- package/dist/shared-graphql.js +4 -3
- package/dist/shared.js +112 -111
- package/package.json +2 -2
|
@@ -148,6 +148,12 @@ export declare function ensureWorkspaceToken(options: {
|
|
|
148
148
|
*/
|
|
149
149
|
signal?: AbortSignal;
|
|
150
150
|
currentQuery: string;
|
|
151
|
+
/** Optional predispatch facade guard; legacy caller behavior remains unchanged. */
|
|
152
|
+
issuanceGuard?: {
|
|
153
|
+
identityKey: string;
|
|
154
|
+
isCurrent(): boolean;
|
|
155
|
+
accepts(token: string, workspaceId: string): boolean;
|
|
156
|
+
};
|
|
151
157
|
}): Promise<string | null>;
|
|
152
158
|
/** Resolve full gateway GraphQL URL */
|
|
153
159
|
export declare function resolveGatewayUrl(gateway: Gateway, baseUrl?: string): string;
|
|
@@ -35,7 +35,7 @@ function x() {
|
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function S() {
|
|
39
39
|
try {
|
|
40
40
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
41
41
|
if (!e) return !1;
|
|
@@ -45,7 +45,7 @@ function ee() {
|
|
|
45
45
|
return !1;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function C(e) {
|
|
49
49
|
try {
|
|
50
50
|
let [, t] = e.split(".");
|
|
51
51
|
if (!t || typeof globalThis.atob != "function") return null;
|
|
@@ -55,11 +55,11 @@ function S(e) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
58
|
+
function ee(e) {
|
|
59
|
+
let t = C(e)?.exp;
|
|
60
60
|
return typeof t == "number" ? t * 1e3 <= Date.now() + 3e4 : !1;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function te() {
|
|
63
63
|
try {
|
|
64
64
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
65
65
|
if (e) {
|
|
@@ -72,7 +72,7 @@ function w() {
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function w() {
|
|
76
76
|
try {
|
|
77
77
|
let e = sessionStorage.getItem("bf-active-profile");
|
|
78
78
|
if (e) {
|
|
@@ -84,41 +84,41 @@ function T() {
|
|
|
84
84
|
return "en";
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function T() {
|
|
88
88
|
return s("workspace");
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function E() {
|
|
91
91
|
return s("organization");
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function D() {
|
|
94
94
|
return s("tenant");
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function O() {
|
|
97
97
|
return s("project");
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function k() {
|
|
100
100
|
try {
|
|
101
101
|
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("org");
|
|
102
102
|
} catch {
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function A(e) {
|
|
107
107
|
return {
|
|
108
|
-
workspaceId: typeof e.workspaceId == "string" ? e.workspaceId :
|
|
109
|
-
organizationId: typeof e.organizationId == "string" ? e.organizationId :
|
|
110
|
-
tenantId: typeof e.tenantId == "string" ? e.tenantId :
|
|
111
|
-
projectId: typeof e.projectId == "string" ? e.projectId :
|
|
108
|
+
workspaceId: typeof e.workspaceId == "string" ? e.workspaceId : T() || void 0,
|
|
109
|
+
organizationId: typeof e.organizationId == "string" ? e.organizationId : E() || k() || void 0,
|
|
110
|
+
tenantId: typeof e.tenantId == "string" ? e.tenantId : D() || void 0,
|
|
111
|
+
projectId: typeof e.projectId == "string" ? e.projectId : O() || void 0
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function j(e, t, n) {
|
|
115
115
|
try {
|
|
116
116
|
let r = a() ?? x();
|
|
117
117
|
if (!r) return;
|
|
118
118
|
o(r, t), sessionStorage.setItem("burdenoff-active-context-workspace", e), n && sessionStorage.setItem("burdenoff-active-context-organization", n);
|
|
119
119
|
} catch {}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function M(e, t, n) {
|
|
122
122
|
return t ? t.aborted ? Promise.resolve(n) : new Promise((r) => {
|
|
123
123
|
let i = () => r(n);
|
|
124
124
|
t.addEventListener("abort", i, { once: !0 }), e.then(r, () => r(n)).finally(() => {
|
|
@@ -126,20 +126,29 @@ function N(e, t, n) {
|
|
|
126
126
|
});
|
|
127
127
|
}) : e;
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
130
|
-
let { url: t, authToken: n, workspaceId: r, organizationId: i, projectId: a, locale: o, signal: s, currentQuery: c } = e;
|
|
131
|
-
if (!n || c.includes("issueWorkspaceToken")) return null;
|
|
132
|
-
let
|
|
133
|
-
if (!
|
|
134
|
-
let
|
|
135
|
-
if (
|
|
136
|
-
workspaceId:
|
|
137
|
-
organizationId:
|
|
129
|
+
async function N(e) {
|
|
130
|
+
let { url: t, authToken: n, workspaceId: r, organizationId: i, projectId: a, locale: o, signal: s, currentQuery: c, issuanceGuard: l } = e;
|
|
131
|
+
if (!n || c.includes("issueWorkspaceToken") || l && !l.isCurrent()) return null;
|
|
132
|
+
let u = r || T();
|
|
133
|
+
if (!u) return null;
|
|
134
|
+
let d = b(), p = T(), m = i || E() || k();
|
|
135
|
+
if (d && p === u && f(d, {
|
|
136
|
+
workspaceId: u,
|
|
137
|
+
organizationId: m,
|
|
138
138
|
projectId: a
|
|
139
|
-
})) return
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
}) && (!l || l.accepts(d, u))) return d;
|
|
140
|
+
let h = JSON.stringify([
|
|
141
|
+
m ?? "",
|
|
142
|
+
u,
|
|
143
|
+
a ?? "",
|
|
144
|
+
l ? [
|
|
145
|
+
t,
|
|
146
|
+
n,
|
|
147
|
+
l.identityKey
|
|
148
|
+
] : null
|
|
149
|
+
]), g = v.get(h);
|
|
150
|
+
if (g) return M(g, s, null);
|
|
151
|
+
let y = fetch(t, {
|
|
143
152
|
method: "POST",
|
|
144
153
|
headers: {
|
|
145
154
|
"Content-Type": "application/json",
|
|
@@ -150,55 +159,56 @@ async function P(e) {
|
|
|
150
159
|
body: JSON.stringify({
|
|
151
160
|
query: _,
|
|
152
161
|
variables: { input: {
|
|
153
|
-
workspaceId:
|
|
154
|
-
...
|
|
162
|
+
workspaceId: u,
|
|
163
|
+
...m ? { organizationId: m } : {},
|
|
155
164
|
...a ? { projectId: a } : {}
|
|
156
165
|
} }
|
|
157
166
|
})
|
|
158
167
|
}).then(async (e) => {
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
if (l && !e.ok) return null;
|
|
169
|
+
let t = await e.json(), n = t.data?.issueWorkspaceToken;
|
|
170
|
+
return l && (t.errors !== void 0 && (!Array.isArray(t.errors) || t.errors.length !== 0) || n?.success !== !0 || typeof n.token != "string" || n.token.length === 0 || n.workspaceId !== u) ? null : n?.success && n.token ? l && (!l.isCurrent() || !l.accepts(n.token, n.workspaceId || u)) ? null : (j(n.workspaceId || u, n.token, m ?? void 0), n.token) : null;
|
|
161
171
|
}).catch(() => null).finally(() => {
|
|
162
|
-
v.delete(
|
|
172
|
+
v.delete(h);
|
|
163
173
|
});
|
|
164
|
-
return v.set(
|
|
174
|
+
return v.set(h, y), M(y, s, null);
|
|
165
175
|
}
|
|
166
|
-
function
|
|
176
|
+
function P(e, n) {
|
|
167
177
|
let i = r[e], a = t(), o = e === "global" ? a.globalBaseUrl : a.workspaceBaseUrl, s = n || o;
|
|
168
178
|
return `${s.endsWith("/") ? s.slice(0, -1) : s}${i.graphql}`;
|
|
169
179
|
}
|
|
170
|
-
function
|
|
180
|
+
function F(e) {
|
|
171
181
|
return e.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
172
182
|
}
|
|
173
|
-
function
|
|
174
|
-
if (e?.aborted) throw
|
|
183
|
+
function I(e) {
|
|
184
|
+
if (e?.aborted) throw F(e);
|
|
175
185
|
}
|
|
176
|
-
function
|
|
186
|
+
function L() {
|
|
177
187
|
return globalThis;
|
|
178
188
|
}
|
|
179
|
-
function
|
|
180
|
-
let e =
|
|
189
|
+
function R() {
|
|
190
|
+
let e = L();
|
|
181
191
|
return e.__graphqlFetchQueues ||= /* @__PURE__ */ new Map(), e.__graphqlFetchQueues;
|
|
182
192
|
}
|
|
183
|
-
function
|
|
184
|
-
let e =
|
|
193
|
+
function z() {
|
|
194
|
+
let e = L();
|
|
185
195
|
return e.__graphqlFetchResponseCache ||= /* @__PURE__ */ new Map(), e.__graphqlFetchResponseCache;
|
|
186
196
|
}
|
|
187
|
-
function
|
|
188
|
-
let e =
|
|
197
|
+
function B() {
|
|
198
|
+
let e = L();
|
|
189
199
|
return e.__graphqlFetchPendingResponses ||= /* @__PURE__ */ new Map(), e.__graphqlFetchPendingResponses;
|
|
190
200
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
201
|
+
function V() {
|
|
202
|
+
z().clear(), B().clear(), n();
|
|
193
203
|
}
|
|
194
|
-
var
|
|
204
|
+
var H = 10, ne = 600, U = 100, re = 1e4, W = 15e3, ie = new Set([
|
|
195
205
|
"traceparent",
|
|
196
206
|
"tracestate",
|
|
197
207
|
"baggage"
|
|
198
208
|
]), G = "Apollo-Require-Preflight";
|
|
199
209
|
function ae() {
|
|
200
210
|
if (typeof performance > "u") return U;
|
|
201
|
-
let e =
|
|
211
|
+
let e = L();
|
|
202
212
|
return e.__graphqlFetchBurstStartedAt ??= performance.now(), performance.now() - e.__graphqlFetchBurstStartedAt < re ? ne : U;
|
|
203
213
|
}
|
|
204
214
|
function oe(e) {
|
|
@@ -258,7 +268,7 @@ async function X(e, t, n) {
|
|
|
258
268
|
...r.keepalive ? { keepalive: !0 } : {}
|
|
259
269
|
}), i = await Y(n);
|
|
260
270
|
if (!n.ok && !q(i)) throw Error(J(n));
|
|
261
|
-
r.cacheKey && !q(i) &&
|
|
271
|
+
r.cacheKey && !q(i) && z().set(r.cacheKey, {
|
|
262
272
|
value: i,
|
|
263
273
|
expiresAt: Date.now() + W
|
|
264
274
|
}), r.resolve(i);
|
|
@@ -278,7 +288,7 @@ async function X(e, t, n) {
|
|
|
278
288
|
if (!i.ok && !q(a)) throw Error(J(i));
|
|
279
289
|
if (Array.isArray(a)) a.forEach((e, t) => {
|
|
280
290
|
let r = n[t];
|
|
281
|
-
r && (r.cacheKey && !q(e) &&
|
|
291
|
+
r && (r.cacheKey && !q(e) && z().set(r.cacheKey, {
|
|
282
292
|
value: e,
|
|
283
293
|
expiresAt: Date.now() + W
|
|
284
294
|
}), r.resolve(e));
|
|
@@ -292,15 +302,15 @@ async function X(e, t, n) {
|
|
|
292
302
|
}
|
|
293
303
|
}
|
|
294
304
|
function Z(e, t, n, r, i) {
|
|
295
|
-
let a = ce(t), o = i?.keepalive === !0, s = o ? 1 : Math.max(1, i?.batchMax ??
|
|
296
|
-
if (r?.aborted) return Promise.reject(
|
|
305
|
+
let a = ce(t), o = i?.keepalive === !0, s = o ? 1 : Math.max(1, i?.batchMax ?? H), c = Math.max(0, i?.batchInterval ?? ae()), l = `${e}|${JSON.stringify(a)}`, u = oe(n) ? `${l}|${JSON.stringify(se(n))}` : void 0;
|
|
306
|
+
if (r?.aborted) return Promise.reject(F(r));
|
|
297
307
|
if (u) {
|
|
298
|
-
let e =
|
|
308
|
+
let e = z(), t = e.get(u);
|
|
299
309
|
if (t) {
|
|
300
310
|
if (t.expiresAt > Date.now()) return Promise.resolve(t.value);
|
|
301
311
|
e.delete(u);
|
|
302
312
|
}
|
|
303
|
-
let n =
|
|
313
|
+
let n = B().get(u);
|
|
304
314
|
if (n) return n;
|
|
305
315
|
}
|
|
306
316
|
let d = new Promise((t, i) => {
|
|
@@ -315,7 +325,7 @@ function Z(e, t, n, r, i) {
|
|
|
315
325
|
}]);
|
|
316
326
|
return;
|
|
317
327
|
}
|
|
318
|
-
let d =
|
|
328
|
+
let d = R(), f = d.get(l);
|
|
319
329
|
f || (f = {
|
|
320
330
|
requests: [],
|
|
321
331
|
timer: null,
|
|
@@ -330,82 +340,82 @@ function Z(e, t, n, r, i) {
|
|
|
330
340
|
cacheKey: u
|
|
331
341
|
};
|
|
332
342
|
if (f.requests.push(p), r && r.addEventListener("abort", () => {
|
|
333
|
-
let e =
|
|
334
|
-
e && t >= 0 && (e.requests.splice(t, 1), e.requests.length === 0 && (e.timer && clearTimeout(e.timer),
|
|
343
|
+
let e = R().get(l), t = e ? e.requests.indexOf(p) : -1;
|
|
344
|
+
e && t >= 0 && (e.requests.splice(t, 1), e.requests.length === 0 && (e.timer && clearTimeout(e.timer), R().delete(l))), i(F(r));
|
|
335
345
|
}, { once: !0 }), f.requests.length >= f.batchMax) {
|
|
336
346
|
Q(e, a, l);
|
|
337
347
|
return;
|
|
338
348
|
}
|
|
339
349
|
f.timer ||= setTimeout(() => Q(e, a, l), f.batchInterval);
|
|
340
350
|
});
|
|
341
|
-
return u && !r && (
|
|
342
|
-
|
|
351
|
+
return u && !r && (B().set(u, d), d.finally(() => {
|
|
352
|
+
B().delete(u);
|
|
343
353
|
}).catch(() => {})), d;
|
|
344
354
|
}
|
|
345
355
|
function Q(e, t, n) {
|
|
346
|
-
let r =
|
|
356
|
+
let r = R(), i = r.get(n);
|
|
347
357
|
i && (r.delete(n), i.timer &&= (clearTimeout(i.timer), null), X(e, t, i.requests));
|
|
348
358
|
}
|
|
349
359
|
async function $(e) {
|
|
350
|
-
let { gateway: n, query: r, variables: i, operationName: a, authToken: o, workspaceToken: s, workspaceId: c, organizationId: u, tenantId: h, projectId: _, locale: v, baseUrl: x, extraHeaders:
|
|
351
|
-
|
|
352
|
-
let
|
|
353
|
-
if (!
|
|
360
|
+
let { gateway: n, query: r, variables: i, operationName: a, authToken: o, workspaceToken: s, workspaceId: c, organizationId: u, tenantId: h, projectId: _, locale: v, baseUrl: x, extraHeaders: C, signal: T, suppressGlobalErrorEvent: E, keepalive: O } = e;
|
|
361
|
+
I(T);
|
|
362
|
+
let k = d(P(n, x)), j = o && !ee(o) ? o : y();
|
|
363
|
+
if (!j && !e.skipAuthRetry && typeof window < "u" && !window.location.pathname.startsWith("/auth/") && S()) {
|
|
354
364
|
let e = await import("../utils/authErrorHandling.js");
|
|
355
365
|
await e.attemptTokenRefresh({
|
|
356
366
|
globalBaseUrl: n === "global" && x ? x : t().globalBaseUrl,
|
|
357
367
|
...e.getSharedTokenRefreshRefs()
|
|
358
|
-
}) ?
|
|
368
|
+
}) ? j = y() : g({
|
|
359
369
|
operationName: a,
|
|
360
370
|
gateway: n
|
|
361
|
-
}),
|
|
371
|
+
}), I(T);
|
|
362
372
|
}
|
|
363
|
-
let
|
|
373
|
+
let M = v ?? w(), F = A({
|
|
364
374
|
workspaceId: c,
|
|
365
375
|
organizationId: u,
|
|
366
376
|
tenantId: h,
|
|
367
377
|
projectId: _
|
|
368
|
-
}),
|
|
378
|
+
}), L = {
|
|
369
379
|
"Content-Type": "application/json",
|
|
370
380
|
[G]: "true"
|
|
371
381
|
};
|
|
372
|
-
|
|
373
|
-
let
|
|
374
|
-
if (
|
|
382
|
+
j && (L.Authorization = `Bearer ${j}`), M && (L["Accept-Language"] = M);
|
|
383
|
+
let R = te();
|
|
384
|
+
if (R?.country && (L["X-Geo-Country"] = R.country), R?.currency && (L["X-Geo-Currency"] = R.currency), R?.timezone && (L["X-Geo-Timezone"] = R.timezone), n === "workspace" ? s !== !1 : s) {
|
|
375
385
|
let e = typeof s == "string" ? s : b();
|
|
376
|
-
e && !f(e,
|
|
377
|
-
url:
|
|
378
|
-
authToken:
|
|
379
|
-
workspaceId:
|
|
380
|
-
organizationId:
|
|
381
|
-
projectId:
|
|
382
|
-
locale:
|
|
383
|
-
signal:
|
|
386
|
+
e && !f(e, F) && (e = null), !e && (s === !0 || n === "workspace" && s === void 0 || typeof s == "string") && (e = await N({
|
|
387
|
+
url: k,
|
|
388
|
+
authToken: j,
|
|
389
|
+
workspaceId: F.workspaceId,
|
|
390
|
+
organizationId: F.organizationId,
|
|
391
|
+
projectId: F.projectId,
|
|
392
|
+
locale: M,
|
|
393
|
+
signal: T,
|
|
384
394
|
currentQuery: r
|
|
385
|
-
}),
|
|
395
|
+
}), I(T)), e && (L["X-Workspace-Authorization"] = `Bearer ${e}`);
|
|
386
396
|
}
|
|
387
397
|
if (n === "workspace" || c) {
|
|
388
|
-
let e =
|
|
389
|
-
e && (
|
|
398
|
+
let e = F.workspaceId;
|
|
399
|
+
e && (L["x-workspace-id"] = e);
|
|
390
400
|
}
|
|
391
401
|
if (n === "global" || u) {
|
|
392
|
-
let e =
|
|
393
|
-
e && (
|
|
402
|
+
let e = F.organizationId;
|
|
403
|
+
e && (L["x-org-id"] = e);
|
|
394
404
|
}
|
|
395
405
|
if (h) {
|
|
396
|
-
let e = typeof h == "string" ? h :
|
|
397
|
-
e && (
|
|
406
|
+
let e = typeof h == "string" ? h : D();
|
|
407
|
+
e && (L["x-tenant-id"] = e);
|
|
398
408
|
}
|
|
399
409
|
if (n === "workspace" || _) {
|
|
400
|
-
let e =
|
|
401
|
-
e && (
|
|
410
|
+
let e = F.projectId;
|
|
411
|
+
e && (L["x-project-id"] = e);
|
|
402
412
|
}
|
|
403
|
-
let
|
|
404
|
-
|
|
405
|
-
let
|
|
406
|
-
i && (
|
|
407
|
-
let
|
|
408
|
-
if (e.skipAuthRetry || !
|
|
413
|
+
let z = l(C);
|
|
414
|
+
z && Object.assign(L, z);
|
|
415
|
+
let B = { query: r };
|
|
416
|
+
i && (B.variables = i), a && (B.operationName = a);
|
|
417
|
+
let V = async (r) => {
|
|
418
|
+
if (e.skipAuthRetry || !j || typeof window > "u" || !r?.length) return null;
|
|
409
419
|
let i = await import("../utils/authErrorHandling.js");
|
|
410
420
|
return i.hasAuthGraphQLErrors(r) ? await i.attemptTokenRefresh({
|
|
411
421
|
globalBaseUrl: n === "global" && x ? x : t().globalBaseUrl,
|
|
@@ -421,24 +431,24 @@ async function $(e) {
|
|
|
421
431
|
}), null) : null;
|
|
422
432
|
};
|
|
423
433
|
try {
|
|
424
|
-
let e = await Z(
|
|
434
|
+
let e = await Z(k, L, B, T, O ? { keepalive: !0 } : void 0);
|
|
425
435
|
if (m(), e.errors?.length) {
|
|
426
|
-
let t = await
|
|
436
|
+
let t = await V(e.errors);
|
|
427
437
|
if (t) return t;
|
|
428
|
-
|
|
438
|
+
E || p({ errors: e.errors }, { operationName: a });
|
|
429
439
|
}
|
|
430
440
|
return e;
|
|
431
441
|
} catch (e) {
|
|
432
442
|
let t = e.errors;
|
|
433
443
|
if (t?.length) {
|
|
434
|
-
let e = await
|
|
444
|
+
let e = await V(t);
|
|
435
445
|
if (e) return e;
|
|
436
446
|
}
|
|
437
|
-
throw
|
|
447
|
+
throw E || p(e, {
|
|
438
448
|
operationName: a,
|
|
439
449
|
fallbackMessage: "We could not reach the server. Please check your connection and try again."
|
|
440
450
|
}), e;
|
|
441
451
|
}
|
|
442
452
|
}
|
|
443
453
|
//#endregion
|
|
444
|
-
export { h as SESSION_EXPIRED_EVENT,
|
|
454
|
+
export { h as SESSION_EXPIRED_EVENT, V as clearGraphqlFetchResponseCache, Z as enqueueGraphQLFetch, N as ensureWorkspaceToken, y as getStoredAuthToken, w as getStoredLocale, E as getStoredOrganizationId, O as getStoredProjectId, D as getStoredTenantId, T as getStoredWorkspaceId, b as getStoredWorkspaceToken, $ as graphqlFetch, P as resolveGatewayUrl };
|
|
@@ -8,3 +8,4 @@ export { WsLink, type WsLinkOptions } from './links/ws-link';
|
|
|
8
8
|
export { ApolloClient, InMemoryCache, type NormalizedCacheObject } from '@apollo/client/core';
|
|
9
9
|
export { ApolloProvider, useQuery, useMutation, useLazyQuery, useSubscription, useApolloClient, } from '@apollo/client/react';
|
|
10
10
|
export { gql } from '@apollo/client/core';
|
|
11
|
+
export { prepareWorkspaceRequest, type WorkspaceRequestIntent } from './prepareWorkspaceRequest';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface WorkspaceRequestIntent {
|
|
2
|
+
url: string;
|
|
3
|
+
authToken: string;
|
|
4
|
+
actorId: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
tenantId?: string;
|
|
7
|
+
workspaceToken?: string;
|
|
8
|
+
currentQuery: string;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
/** Immutable authority check for transports that must not replay mutations. */
|
|
12
|
+
export declare function prepareWorkspaceRequest(intent: WorkspaceRequestIntent): Promise<{
|
|
13
|
+
workspaceToken: string;
|
|
14
|
+
assertCurrent(): void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getActiveProfileId as e, getActiveUser as t } from "../providers/shell/ProfileStorageManager.js";
|
|
2
|
+
import { validateGatewayBaseUrl as n } from "./security.js";
|
|
3
|
+
import { getWorkspaceTokenPayload as r, isWorkspaceTokenValidForContext as i } from "./workspaceToken.js";
|
|
4
|
+
import { ensureWorkspaceToken as a, getStoredAuthToken as o, getStoredOrganizationId as s, getStoredProjectId as c, getStoredTenantId as l, getStoredWorkspaceId as u, getStoredWorkspaceToken as d } from "./fetch.js";
|
|
5
|
+
//#region src/shared/graphql/prepareWorkspaceRequest.ts
|
|
6
|
+
async function f(f) {
|
|
7
|
+
let p = {
|
|
8
|
+
...f,
|
|
9
|
+
url: n(f.url)
|
|
10
|
+
};
|
|
11
|
+
if (p.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
|
|
12
|
+
let m = () => ({
|
|
13
|
+
profileId: e(),
|
|
14
|
+
authToken: o(),
|
|
15
|
+
actorId: t()?.id,
|
|
16
|
+
workspaceId: u(),
|
|
17
|
+
organizationId: s(),
|
|
18
|
+
tenantId: l(),
|
|
19
|
+
projectId: c()
|
|
20
|
+
}), h = m(), g = JSON.stringify(h), _ = () => JSON.stringify(m()) === g, v = () => {
|
|
21
|
+
if (!_()) throw Error("The active account or workspace changed. Review the action again.");
|
|
22
|
+
};
|
|
23
|
+
if (!h.profileId || !p.authToken || !p.actorId || !p.workspaceId || h.authToken !== p.authToken || h.actorId !== p.actorId || h.workspaceId !== p.workspaceId || (h.tenantId ?? void 0) !== p.tenantId) throw Error("The active account or workspace changed. Review the action again.");
|
|
24
|
+
let y = {
|
|
25
|
+
workspaceId: p.workspaceId,
|
|
26
|
+
organizationId: h.organizationId,
|
|
27
|
+
tenantId: h.tenantId,
|
|
28
|
+
projectId: h.projectId
|
|
29
|
+
}, b = (e, t) => {
|
|
30
|
+
let n = r(e);
|
|
31
|
+
return t === p.workspaceId && n !== null && n.tokenType === "WORKSPACE_ACCESS" && n.sub === p.actorId && typeof n.exp == "number" && Number.isFinite(n.exp) && n.exp * 1e3 > Date.now() + 3e4 && n.workspaceId === y.workspaceId && (n.organizationId ?? null) === y.organizationId && (n.tenantId ?? null) === y.tenantId && (n.projectId ?? null) === y.projectId && i(e, y);
|
|
32
|
+
}, x = d(), S = x && b(x, p.workspaceId) ? x : p.workspaceToken;
|
|
33
|
+
if ((!S || !b(S, p.workspaceId)) && (v(), S = await a({
|
|
34
|
+
url: p.url,
|
|
35
|
+
authToken: p.authToken,
|
|
36
|
+
workspaceId: p.workspaceId,
|
|
37
|
+
organizationId: h.organizationId ?? void 0,
|
|
38
|
+
projectId: h.projectId ?? void 0,
|
|
39
|
+
signal: p.signal,
|
|
40
|
+
currentQuery: p.currentQuery,
|
|
41
|
+
issuanceGuard: {
|
|
42
|
+
identityKey: g,
|
|
43
|
+
isCurrent: _,
|
|
44
|
+
accepts: b
|
|
45
|
+
}
|
|
46
|
+
}) ?? void 0), v(), !S || !b(S, p.workspaceId)) throw Error("Unable to renew workspace authority. No action was sent.");
|
|
47
|
+
let C = S;
|
|
48
|
+
return {
|
|
49
|
+
workspaceToken: C,
|
|
50
|
+
assertCurrent: () => {
|
|
51
|
+
if (v(), !b(C, p.workspaceId)) throw Error("Workspace authority expired. Review the action again.");
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { f as prepareWorkspaceRequest };
|
package/dist/shared-graphql.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createGraphQLClient as f, getGlobalClient as p, getWorkspaceClient as m
|
|
|
5
5
|
import { GatewayProvider as _, useGateway as v, useGatewayClient as y, useSafeGateway as b, useSafeGatewayClient as x } from "./shared/graphql/GatewayContext.js";
|
|
6
6
|
import { useHasAuthToken as S } from "./shared/graphql/useHasAuthToken.js";
|
|
7
7
|
import { WsLink as C } from "./shared/graphql/links/ws-link.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { prepareWorkspaceRequest as w } from "./shared/graphql/prepareWorkspaceRequest.js";
|
|
9
|
+
import { ApolloClient as T, InMemoryCache as E, gql as D } from "@apollo/client/core";
|
|
10
|
+
import { ApolloProvider as O, useApolloClient as k, useLazyQuery as A, useMutation as j, useQuery as M, useSubscription as N } from "@apollo/client/react";
|
|
11
|
+
export { T as ApolloClient, O as ApolloProvider, _ as GatewayProvider, E as InMemoryCache, d as SSELink, C as WsLink, n as clearGraphqlFetchResponseCache, f as createGraphQLClient, p as getGlobalClient, r as getStoredAuthToken, i as getStoredLocale, a as getStoredOrganizationId, o as getStoredProjectId, s as getStoredWorkspaceId, c as getStoredWorkspaceToken, m as getWorkspaceClient, e as getWorkspaceTokenPayload, D as gql, l as graphqlFetch, h as initializeAppClients, t as isWorkspaceTokenValidForContext, w as prepareWorkspaceRequest, g as resetAppClients, u as resolveGatewayUrl, k as useApolloClient, v as useGateway, y as useGatewayClient, S as useHasAuthToken, A as useLazyQuery, j as useMutation, M as useQuery, b as useSafeGateway, x as useSafeGatewayClient, N as useSubscription };
|
package/dist/shared.js
CHANGED
|
@@ -21,121 +21,122 @@ import { createGraphQLClient as ot, getGlobalClient as st, getWorkspaceClient as
|
|
|
21
21
|
import { GatewayProvider as dt, useGateway as ft, useGatewayClient as pt, useSafeGateway as mt, useSafeGatewayClient as ht } from "./shared/graphql/GatewayContext.js";
|
|
22
22
|
import { useHasAuthToken as gt } from "./shared/graphql/useHasAuthToken.js";
|
|
23
23
|
import { WsLink as _t } from "./shared/graphql/links/ws-link.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
24
|
+
import { prepareWorkspaceRequest as vt } from "./shared/graphql/prepareWorkspaceRequest.js";
|
|
25
|
+
import { ApolloClient as yt, ApolloProvider as bt, InMemoryCache as xt, gql as St, useApolloClient as Ct, useLazyQuery as wt, useMutation as Tt, useQuery as Et, useSubscription as Dt } from "./shared-graphql.js";
|
|
26
|
+
import { attemptTokenRefresh as Ot, clearAuthSessionStorage as kt, hasAuthGraphQLErrors as At, isAuthGraphQLError as jt, isAuthNetworkError as Mt, redirectToLogin as Nt } from "./shared/utils/authErrorHandling.js";
|
|
27
|
+
import { clearSSoCookie as Pt, clearShellSsoCookies as Ft, getSSoCookie as It, isSharedSsoCookieDomain as Lt, isTrustedSsoOrigin as Rt, readShellSsoCookie as zt, setSSoCookie as Bt, setShellSsoCookies as Vt } from "./shared/utils/authCookie.js";
|
|
28
|
+
import { getNativeBridge as Ht } from "./shared/native/bridge.js";
|
|
29
|
+
import { getPlatform as Ut, isAndroid as Wt, isElectron as Gt, isIOS as Kt, isInstalledApp as qt, isNative as Jt, isStandalonePWA as Yt, isWeb as Xt, isWebBrowser as Zt } from "./shared/native/platform.js";
|
|
30
|
+
import { SSORedirectSpinner as Qt, checkRemoteSLO as $t, checkSLO as en, clearLocalAuthState as tn, getSSORedirectUrl as nn } from "./shared/components/SSORedirectGuard.js";
|
|
31
|
+
import { SSO_DEPOSITED_PARAM as rn, beginSsoNavigation as an, buildSsoDepositUrl as on, clearSsoDepositState as sn, clearSsoNavigation as cn, consumeSsoDepositMarker as ln, isSsoNavigationPending as un, markSsoDepositDone as dn, markSsoDepositPending as fn, mintSsoSessionTokens as pn, readSsoDepositState as mn, shouldAttemptSsoDeposit as hn } from "./shared/utils/ssoDeposit.js";
|
|
32
|
+
import { AppInitializer as gn, useRegistryHelpers as _n, useShellNavigate as vn } from "./shared/utils/appHelpers.js";
|
|
33
|
+
import { LogLevel as yn } from "./shared/logger/types.js";
|
|
34
|
+
import { Logger as bn } from "./shared/logger/Logger.js";
|
|
35
|
+
import { LogManager as xn, logManager as Sn } from "./shared/logger/LogManager.js";
|
|
36
|
+
import { ConsoleTransport as Cn } from "./shared/logger/ConsoleTransport.js";
|
|
37
|
+
import { clearUserContext as wn, initializeLogger as Tn, setUserContext as En } from "./shared/utils/loggerInit.js";
|
|
38
|
+
import { createProfileScopedStorage as Dn, getProfileScopedKey as On } from "./shared/utils/profileScopedStorage.js";
|
|
39
|
+
import { QUOTA_EXHAUSTED_CODE as kn, RESOURCE_CAP_EXCEEDED_CODE as An, STORAGE_QUOTA_EXCEEDED_CODE as jn, UPGRADE_ERROR_CODES as Mn, buildQuotaExhaustedMessage as Nn, extractQuotaExhaustedExtensions as Pn, extractUpgradeErrorExtensions as Fn, isQuotaExhaustedError as In, isUpgradeError as Ln } from "./shared/utils/quotaErrors.js";
|
|
40
|
+
import { INLINE_ENCODE as Rn, downscaleImage as zn, selectInlineBase64 as Bn } from "./shared/utils/imageDownscale.js";
|
|
41
|
+
import { cn as Vn } from "./shared-utils.js";
|
|
42
|
+
import { nativeActionSheet as Hn, nativeConfirm as Un, nativeCopyText as Wn, nativeImpact as Gn, nativeNotify as Kn, nativeOpenUrl as qn, nativeSelection as Jn, nativeShare as Yn, nativeToast as Xn } from "./shared/native/consumers.js";
|
|
43
|
+
import { SafeAreaView as Zn } from "./shared/native/SafeAreaView.js";
|
|
44
|
+
import { readInitialNetworkStatus as Qn, reduceNetworkStatus as $n, useNetworkStatus as er } from "./shared/native/hooks/useNetworkStatus.js";
|
|
45
|
+
import { PULL_TO_REFRESH_THRESHOLD as tr, computePullOffset as nr, computePullProgress as rr, usePullToRefresh as ir } from "./shared/native/hooks/usePullToRefresh.js";
|
|
46
|
+
import { useReturnFocus as ar } from "./shared/hooks/useReturnFocus.js";
|
|
47
|
+
import { ActorIdentity as or } from "./shared/actors/ActorIdentity.js";
|
|
48
|
+
import { buildActorFallback as sr, useActorProfiles as cr } from "./shared/actors/useActorProfiles.js";
|
|
49
|
+
import { ErrorBoundary as lr } from "./shared/components/ErrorBoundary.js";
|
|
50
|
+
import { RequireAuth as ur, RequireGuest as dr } from "./shared/components/RequireAuth.js";
|
|
51
|
+
import { PermissionButton as fr, PermissionGate as pr, PermissionLink as mr } from "./shared/components/PermissionGate.js";
|
|
52
|
+
import { AccessDenied as hr, PermissionDenied as gr } from "./shared/components/AccessDenied.js";
|
|
53
|
+
import { ErrorFallback as _r } from "./shared/components/ErrorFallback.js";
|
|
54
|
+
import { LoadingFallback as vr, PageLoadingFallback as yr, SectionLoadingFallback as br } from "./shared/components/LoadingFallback.js";
|
|
55
|
+
import { MicrofrontendErrorBoundary as xr } from "./shared/components/MicrofrontendErrorBoundary.js";
|
|
56
|
+
import { ConditionalShell as Sr } from "./shared/components/ConditionalShell.js";
|
|
57
|
+
import { usePWA as Cr } from "./shared/hooks/usePWA.js";
|
|
58
|
+
import { PWAInstallBanner as wr } from "./shared/components/PWAInstallBanner.js";
|
|
59
|
+
import { ErrorBoundary as Tr } from "./shared/components/AppErrorBoundary.js";
|
|
60
|
+
import { FeatureFlagProvider as Er, useFeatureFlags as Dr } from "./shared/feature-flags/FeatureFlagProvider.js";
|
|
61
|
+
import { useFeatureFlag as Or, useFeatureFlagDetails as kr, useFeatureFlagValue as Ar } from "./shared/feature-flags/useFeatureFlag.js";
|
|
62
|
+
import { FeatureGate as jr } from "./shared/feature-flags/FeatureGate.js";
|
|
62
63
|
import "./shared-feature-flags.js";
|
|
63
|
-
import { ContextConversationWidget as
|
|
64
|
-
import { detectPlatform as
|
|
65
|
-
import { KeyboardHelpDialogWrapper as
|
|
66
|
-
import { QuotaMeter as
|
|
67
|
-
import { UPGRADE_PROMPT_EVENT as
|
|
68
|
-
import { UpgradeInlineBanner as
|
|
69
|
-
import { useVoiceInput as
|
|
70
|
-
import { ASSISTANT_WIDGET_TOGGLE_EVENT as
|
|
71
|
-
import { Markdown as
|
|
72
|
-
import { useNativePlatform as
|
|
73
|
-
import { useSafeArea as
|
|
74
|
-
import { useNativeKeyboard as
|
|
75
|
-
import { useAppState as
|
|
76
|
-
import { useDeviceInfo as
|
|
77
|
-
import { useHaptics as
|
|
78
|
-
import { useStatusBar as
|
|
79
|
-
import { resolveActionSheetOutcome as
|
|
80
|
-
import { useDesktop as
|
|
81
|
-
import { useDesktopUpdateState as
|
|
82
|
-
import { useDesktopWindowState as
|
|
83
|
-
import { DesktopUpdateToast as
|
|
64
|
+
import { ContextConversationWidget as Mr } from "./shared/components/ContextConversationWidget.js";
|
|
65
|
+
import { detectPlatform as Nr, formatKeyCombo as Pr, getDisplayKeysForPlatform as Fr, getShortcutLabel as Ir, isMac as Lr, isMobileDevice as Rr, isTabletDevice as zr, matchesKeyCombo as Br, normalizeKey as Vr, normalizePlatformCombo as Hr, parseKeyCombo as Ur, shouldEnableKeyboardShortcuts as Wr, shouldIgnoreShortcut as Gr } from "./shared/keyboard/utils.js";
|
|
66
|
+
import { KeyboardHelpDialogWrapper as Kr } from "./shared/components/KeyboardHelpDialogWrapper.js";
|
|
67
|
+
import { QuotaMeter as qr } from "./shared/components/QuotaMeter.js";
|
|
68
|
+
import { UPGRADE_PROMPT_EVENT as Jr, UpgradePromptModal as Yr, dispatchUpgradePrompt as Xr } from "./shared/components/UpgradePromptModal.js";
|
|
69
|
+
import { UpgradeInlineBanner as Zr } from "./shared/components/UpgradeInlineBanner.js";
|
|
70
|
+
import { useVoiceInput as Qr } from "./shared/components/assistantWidget/useVoiceInput.js";
|
|
71
|
+
import { ASSISTANT_WIDGET_TOGGLE_EVENT as $r, AssistantWidget as ei } from "./shared/components/assistantWidget/AssistantWidget.js";
|
|
72
|
+
import { Markdown as ti } from "./shared/components/Markdown.js";
|
|
73
|
+
import { useNativePlatform as ni } from "./shared/native/hooks/useNativePlatform.js";
|
|
74
|
+
import { useSafeArea as ri } from "./shared/native/hooks/useSafeArea.js";
|
|
75
|
+
import { useNativeKeyboard as ii } from "./shared/native/hooks/useNativeKeyboard.js";
|
|
76
|
+
import { useAppState as ai } from "./shared/native/hooks/useAppState.js";
|
|
77
|
+
import { useDeviceInfo as oi } from "./shared/native/hooks/useDeviceInfo.js";
|
|
78
|
+
import { useHaptics as si } from "./shared/native/hooks/useHaptics.js";
|
|
79
|
+
import { useStatusBar as ci } from "./shared/native/hooks/useStatusBar.js";
|
|
80
|
+
import { resolveActionSheetOutcome as li, useActionSheet as ui } from "./shared/native/hooks/useActionSheet.js";
|
|
81
|
+
import { useDesktop as di } from "./shared/native/hooks/useDesktop.js";
|
|
82
|
+
import { useDesktopUpdateState as fi } from "./shared/native/hooks/useDesktopUpdateState.js";
|
|
83
|
+
import { useDesktopWindowState as pi } from "./shared/native/hooks/useDesktopWindowState.js";
|
|
84
|
+
import { DesktopUpdateToast as mi } from "./shared/components/DesktopUpdateToast.js";
|
|
84
85
|
import "./shared-components.js";
|
|
85
|
-
import { DevtoolsSink as
|
|
86
|
-
import { BroadcastChannelSink as
|
|
87
|
-
import { BackendAuditSink as
|
|
88
|
-
import { AnalyticsConsentBanner as
|
|
89
|
-
import { OtelBrowserSink as
|
|
90
|
-
import { EventBusProvider as
|
|
91
|
-
import { useDebounce as
|
|
92
|
-
import { useThrottle as
|
|
93
|
-
import { BREAKPOINTS as
|
|
94
|
-
import { useOnClickOutside as
|
|
95
|
-
import { useKeyPress as
|
|
96
|
-
import { useExclusiveMenu as
|
|
97
|
-
import { useLocalStorage as
|
|
98
|
-
import { useSessionStorage as
|
|
99
|
-
import { usePrevious as
|
|
100
|
-
import { useConditionalToggle as
|
|
101
|
-
import { usePagination as
|
|
102
|
-
import { useAsync as
|
|
103
|
-
import { MODIFIER_KEYS as
|
|
104
|
-
import { useKeyboardShortcuts as
|
|
105
|
-
import { useHotkeys as
|
|
106
|
-
import { useShortcutHelp as
|
|
107
|
-
import { GLOBAL_SHORTCUT_CATEGORIES as
|
|
108
|
-
import { useLogger as
|
|
109
|
-
import { useHasAnimated as
|
|
110
|
-
import { useReferralAttribution as
|
|
111
|
-
import { useRecordProductVisit as
|
|
112
|
-
import { PUSH_DEVICE_ID_STORAGE_KEY as
|
|
113
|
-
import { usePushDeviceRegistration as
|
|
114
|
-
import { QUOTA_EXHAUSTED_EVENT as
|
|
115
|
-
import { PLAN_USAGE_SNAPSHOT_EVENT as
|
|
116
|
-
import { appendContextToPath as
|
|
117
|
-
import { UNSAVED_CHANGE_LABEL_MAX as
|
|
118
|
-
import { MicrofrontendContext as
|
|
119
|
-
import { withTourProgressStatus as
|
|
120
|
-
import { detectDeviceType as
|
|
121
|
-
import { useTourPlayer as
|
|
122
|
-
import { TourSpotlight as
|
|
123
|
-
import { TourTooltip as
|
|
124
|
-
import { TourPlayerProvider as
|
|
125
|
-
import { TourPlayer as
|
|
126
|
-
import { getTourContextRank as
|
|
127
|
-
import { ToursProvider as
|
|
128
|
-
import { TourInitializer as
|
|
129
|
-
import { AppShellProvider as
|
|
130
|
-
import { MicrofrontendProvider as
|
|
131
|
-
import { TourTrigger as
|
|
86
|
+
import { DevtoolsSink as hi } from "./shared/events/sinks/DevtoolsSink.js";
|
|
87
|
+
import { BroadcastChannelSink as gi } from "./shared/events/sinks/BroadcastChannelSink.js";
|
|
88
|
+
import { BackendAuditSink as _i } from "./shared/events/sinks/BackendAuditSink.js";
|
|
89
|
+
import { AnalyticsConsentBanner as vi, RybbitSink as yi, readAnalyticsConsent as bi, readAnalyticsConsentChoice as xi, setAnalyticsConsent as Si } from "./shared/events/sinks/RybbitSink.js";
|
|
90
|
+
import { OtelBrowserSink as Ci } from "./shared/events/sinks/OtelBrowserSink.js";
|
|
91
|
+
import { EventBusProvider as wi, createEventBus as Ti, useEvent as Ei, useEventBus as Di, useEventEmitter as Oi } from "./shared-events.js";
|
|
92
|
+
import { useDebounce as ki } from "./shared/hooks/useDebounce.js";
|
|
93
|
+
import { useThrottle as Ai } from "./shared/hooks/useThrottle.js";
|
|
94
|
+
import { BREAKPOINTS as ji, useBreakpoint as Mi, useMobileBreakpoint as Ni } from "./shared/hooks/useBreakpoint.js";
|
|
95
|
+
import { useOnClickOutside as Pi, useOnClickOutsideWithRef as Fi } from "./shared/hooks/useOnClickOutside.js";
|
|
96
|
+
import { useKeyPress as Ii, useKeyboardShortcut as Li } from "./shared/hooks/useKeyPress.js";
|
|
97
|
+
import { useExclusiveMenu as Ri } from "./shared/hooks/useExclusiveMenu.js";
|
|
98
|
+
import { useLocalStorage as zi } from "./shared/hooks/useLocalStorage.js";
|
|
99
|
+
import { useSessionStorage as Bi } from "./shared/hooks/useSessionStorage.js";
|
|
100
|
+
import { usePrevious as Vi, usePreviousDistinct as Hi, usePreviousHistory as Ui } from "./shared/hooks/usePrevious.js";
|
|
101
|
+
import { useConditionalToggle as Wi, useToggle as Gi, useToggleObject as Ki } from "./shared/hooks/useToggle.js";
|
|
102
|
+
import { usePagination as qi } from "./shared/hooks/usePagination.js";
|
|
103
|
+
import { useAsync as Ji, useAsyncImmediate as Yi } from "./shared/hooks/useAsync.js";
|
|
104
|
+
import { MODIFIER_KEYS as Xi, PLATFORM_TYPES as Zi } from "./shared/keyboard/types.js";
|
|
105
|
+
import { useKeyboardShortcuts as Qi } from "./shared/keyboard/useKeyboardShortcuts.js";
|
|
106
|
+
import { useHotkeys as $i } from "./shared/keyboard/useHotkeys.js";
|
|
107
|
+
import { useShortcutHelp as ea } from "./shared/keyboard/useShortcutHelp.js";
|
|
108
|
+
import { GLOBAL_SHORTCUT_CATEGORIES as ta, createGlobalShortcuts as na, getGlobalShortcutsByCategory as ra, mergeShortcuts as ia } from "./shared/keyboard/globalShortcuts.js";
|
|
109
|
+
import { useLogger as aa } from "./shared/logger/useLogger.js";
|
|
110
|
+
import { useHasAnimated as oa } from "./shared/hooks/useHasAnimated.js";
|
|
111
|
+
import { useReferralAttribution as sa } from "./shared/hooks/useReferralAttribution.js";
|
|
112
|
+
import { useRecordProductVisit as ca } from "./shared/hooks/useRecordProductVisit.js";
|
|
113
|
+
import { PUSH_DEVICE_ID_STORAGE_KEY as la, getOrCreatePushDeviceId as ua, registerPushDevice as da, unregisterPushDevice as fa } from "./shared/native/push-registration.js";
|
|
114
|
+
import { usePushDeviceRegistration as pa } from "./shared/hooks/usePushDeviceRegistration.js";
|
|
115
|
+
import { QUOTA_EXHAUSTED_EVENT as ma, dispatchQuotaExhausted as ha, useQuotaErrorToast as ga } from "./shared/hooks/useQuotaErrorToast.js";
|
|
116
|
+
import { PLAN_USAGE_SNAPSHOT_EVENT as _a, publishPlanUsageSnapshot as va, useUpgradePrompt as ya } from "./shared/hooks/useUpgradePrompt.js";
|
|
117
|
+
import { appendContextToPath as ba, useCurrentContextSearchParams as xa } from "./shared/hooks/useCurrentContextSearchParams.js";
|
|
118
|
+
import { UNSAVED_CHANGE_LABEL_MAX as Sa, listUnsavedChanges as Ca, registerUnsavedChange as wa, unsavedChangesBlocking as Ta, useUnsavedChanges as Ea } from "./shared/navigation/unsavedChanges.js";
|
|
119
|
+
import { MicrofrontendContext as Da, useMicrofrontendContext as Oa } from "./shared-hooks.js";
|
|
120
|
+
import { withTourProgressStatus as ka } from "./shared/tours/progress.js";
|
|
121
|
+
import { detectDeviceType as Aa, getResponsiveSelector as ja } from "./shared/tours/types.js";
|
|
122
|
+
import { useTourPlayer as Ma } from "./shared/tours/useTourPlayer.js";
|
|
123
|
+
import { TourSpotlight as Na } from "./shared/tours/TourSpotlight.js";
|
|
124
|
+
import { TourTooltip as Pa } from "./shared/tours/TourTooltip.js";
|
|
125
|
+
import { TourPlayerProvider as Fa, useIsTourPlaying as Ia, useStartTour as La, useStopTour as Ra, useTourPlayerContext as za } from "./shared/tours/TourPlayerProvider.js";
|
|
126
|
+
import { TourPlayer as Ba, TourTriggerButton as Va, usePlayTour as Ha } from "./shared/tours/TourPlayer.js";
|
|
127
|
+
import { getTourContextRank as Ua, getTourRouteCatalog as Wa, getTourRouteModules as Ga, getTourRoutePages as Ka, isTourVisibleForContext as qa, normalizeTourPath as Ja, registerTourRouteCatalog as Ya, resolveTourTargetPath as Xa } from "./shared/tours/routeCatalog.js";
|
|
128
|
+
import { ToursProvider as Za, useAutoStartTour as Qa, useSafeToursContext as $a, useTours as eo, useToursContext as to } from "./shared/tours/ToursContext.js";
|
|
129
|
+
import { TourInitializer as no } from "./shared/tours/TourInitializer.js";
|
|
130
|
+
import { AppShellProvider as ro, resolveAppShellObservabilityConfig as io } from "./shared/providers/AppShellProvider.js";
|
|
131
|
+
import { MicrofrontendProvider as ao } from "./shared-providers.js";
|
|
132
|
+
import { TourTrigger as oo } from "./shared/tours/TourTrigger.js";
|
|
132
133
|
import "./shared-tours.js";
|
|
133
|
-
import { acknowledgeNativePurchase as
|
|
134
|
-
import { getNativeEntryRoutes as
|
|
135
|
-
import { getPushOptInController as
|
|
134
|
+
import { acknowledgeNativePurchase as so, getNativeProducts as co, getNativePurchases as lo, installNativeIAP as uo, isNativeIAPAvailable as fo, purchaseNativeProduct as po, restoreNativePurchases as mo } from "./shared/native/purchases.js";
|
|
135
|
+
import { getNativeEntryRoutes as ho, shouldShowNativeWelcome as go } from "./shared/native/entry.js";
|
|
136
|
+
import { getPushOptInController as _o, registerPushOptInController as vo } from "./shared/native/push-optin.js";
|
|
136
137
|
import "./shared-native.js";
|
|
137
138
|
import "./shared/actors/index.js";
|
|
138
139
|
//#region src/shared/index.ts
|
|
139
|
-
var
|
|
140
|
+
var yo = "1.0.0";
|
|
140
141
|
//#endregion
|
|
141
|
-
export {
|
|
142
|
+
export { $r as ASSISTANT_WIDGET_TOGGLE_EVENT, hr as AccessDenied, or as ActorIdentity, vi as AnalyticsConsentBanner, yt as ApolloClient, bt as ApolloProvider, Tr as AppErrorBoundary, gn as AppInitializer, ro as AppShellProvider, ei as AssistantWidget, Ve as BACKEND_ERROR_EVENT, Se as BOTMANOR_PRODUCT_SLUG, ji as BREAKPOINTS, _i as BackendAuditSink, gi as BroadcastChannelSink, Oe as COMMON_SHELL_LESS_ROUTES, He as CONNECTION_STATUS_EVENT, Sr as ConditionalShell, Cn as ConsoleTransport, Mr as ContextConversationWidget, Pe as DEFAULT_PAGE_SIZE, ke as DEFAULT_SHELL_CONFIG, R as DESKTOP_UPDATE_UNSUPPORTED, z as DESKTOP_WINDOW_STATE_DEFAULT, mi as DesktopUpdateToast, hi as DevtoolsSink, lr as ErrorBoundary, _r as ErrorFallback, wi as EventBusProvider, yo as FE_SHARED_VERSION, Er as FeatureFlagProvider, jr as FeatureGate, Fe as GATEWAYS, ta as GLOBAL_SHORTCUT_CATEGORIES, dt as GatewayProvider, Rn as INLINE_ENCODE, xt as InMemoryCache, Kr as KeyboardHelpDialogWrapper, vr as LoadingFallback, yn as LogLevel, xn as LogManager, bn as Logger, Xi as MODIFIER_KEYS, ti as Markdown, Da as MicrofrontendContext, xr as MicrofrontendErrorBoundary, ao as MicrofrontendProvider, Ci as OtelBrowserSink, _a as PLAN_USAGE_SNAPSHOT_EVENT, Zi as PLATFORM_TYPES, Ce as PRODUCTS, ge as PRODUCT_SLUG_EMIT, _e as PRODUCT_SLUG_RENAMES, we as PRODUCT_URLS, tr as PULL_TO_REFRESH_THRESHOLD, la as PUSH_DEVICE_ID_STORAGE_KEY, wr as PWAInstallBanner, yr as PageLoadingFallback, fr as PermissionButton, gr as PermissionDenied, pr as PermissionGate, mr as PermissionLink, kn as QUOTA_EXHAUSTED_CODE, ma as QUOTA_EXHAUSTED_EVENT, qr as QuotaMeter, An as RESOURCE_CAP_EXCEEDED_CODE, ur as RequireAuth, dr as RequireGuest, yi as RybbitSink, at as SSELink, Qt as SSORedirectSpinner, rn as SSO_DEPOSITED_PARAM, jn as STORAGE_QUOTA_EXCEEDED_CODE, Zn as SafeAreaView, br as SectionLoadingFallback, no as TourInitializer, Ba as TourPlayer, Fa as TourPlayerProvider, Na as TourSpotlight, Pa as TourTooltip, oo as TourTrigger, Va as TourTriggerButton, Za as ToursProvider, Sa as UNSAVED_CHANGE_LABEL_MAX, Mn as UPGRADE_ERROR_CODES, Jr as UPGRADE_PROMPT_EVENT, Zr as UpgradeInlineBanner, Yr as UpgradePromptModal, _t as WsLink, so as acknowledgeNativePurchase, r as alertTokens, ba as appendContextToPath, Ot as attemptTokenRefresh, an as beginSsoNavigation, B as bootDesktopShell, sr as buildActorFallback, Nn as buildQuotaExhaustedMessage, on as buildSsoDepositUrl, m as capitalizeFirst, h as capitalizeWords, i as categoryTokens, $t as checkRemoteSLO, en as checkSLO, kt as clearAuthSessionStorage, Xe as clearGraphqlFetchResponseCache, tn as clearLocalAuthState, Pt as clearSSoCookie, Ft as clearShellSsoCookies, sn as clearSsoDepositState, cn as clearSsoNavigation, wn as clearUserContext, Vn as cn, nr as computePullOffset, rr as computePullProgress, ln as consumeSsoDepositMarker, n as createApolloClient, Ti as createEventBus, na as createGlobalShortcuts, ot as createGraphQLClient, Dn as createProfileScopedStorage, V as desktopCheckForUpdates, H as desktopDeepLinkToPath, U as desktopInstallUpdate, W as desktopNotify, G as desktopOpenExternal, K as desktopSetBadgeCount, q as desktopSetLocale, J as desktopSetTheme, Y as desktopSetTrayQuickActions, Aa as detectDeviceType, Nr as detectPlatform, Ue as dispatchBackendErrorEvent, ha as dispatchQuotaExhausted, Xr as dispatchUpgradePrompt, zn as downscaleImage, ve as emitProductSlug, We as extractBackendError, Pn as extractQuotaExhaustedExtensions, Fn as extractUpgradeErrorExtensions, Te as findProductConfig, g as formatBytes, _ as formatCompactNumber, v as formatCurrency, y as formatCurrencyCompact, b as formatDate, x as formatDateTime, S as formatDuration, Pr as formatKeyCombo, C as formatList, w as formatNumber, T as formatOrdinal, E as formatPercentage, D as formatRelativeTime, O as formatTime, a as getAlertTokens, I as getCapacitorPlatform, o as getCategoryTokens, X as getDesktopAuthBridgeConfig, Z as getDesktopBridge, Q as getDesktopGatewayBases, $ as getDesktopGatewayUrls, ee as getDesktopRuntimeConfig, te as getDesktopUpdateState, ne as getDesktopWindowState, Fr as getDisplayKeysForPlatform, Ie as getGatewayConfig, Le as getGatewayUrl, st as getGlobalClient, ra as getGlobalShortcutsByCategory, Re as getGraphQLEndpoint, re as getLegacyDesktopRuntime, Ht as getNativeBridge, ho as getNativeEntryRoutes, co as getNativeProducts, lo as getNativePurchases, ua as getOrCreatePushDeviceId, Ut as getPlatform, Ee as getProductUrl, De as getProductsWithUrls, On as getProfileScopedKey, s as getProgressTokens, _o as getPushOptInController, ja as getResponsiveSelector, nn as getSSORedirectUrl, It as getSSoCookie, Ae as getShellConfig, Ir as getShortcutLabel, c as getStatusBadgeTokens, l as getStatusTokens, Ze as getStoredAuthToken, Qe as getStoredLocale, $e as getStoredOrganizationId, et as getStoredProjectId, tt as getStoredWorkspaceId, nt as getStoredWorkspaceToken, Ua as getTourContextRank, Wa as getTourRouteCatalog, Ga as getTourRouteModules, Ka as getTourRoutePages, u as getTrendTokens, ct as getWorkspaceClient, ze as getWorkspaceTokenPayload, St as gql, rt as graphqlFetch, At as hasAuthGraphQLErrors, lt as initializeAppClients, Tn as initializeLogger, ie as installDesktopDeepLinkHandler, ae as installDesktopNavigateHandler, de as installGatewayFetchRewrite, uo as installNativeIAP, Ge as isAbortError, Wt as isAndroid, jt as isAuthGraphQLError, Mt as isAuthNetworkError, Ke as isBackendErrorDisplay, L as isCapacitorNative, P as isChunkLoadError, oe as isDesktop, Gt as isElectron, Kt as isIOS, qt as isInstalledApp, Lr as isMac, Rr as isMobileDevice, Jt as isNative, fo as isNativeIAPAvailable, In as isQuotaExhaustedError, ye as isSameProductSlug, Lt as isSharedSsoCookieDomain, je as isShellLessRoute, un as isSsoNavigationPending, Yt as isStandalonePWA, zr as isTabletDevice, qa as isTourVisibleForContext, qe as isTransportError, Rt as isTrustedSsoOrigin, Ln as isUpgradeError, Xt as isWeb, Zt as isWebBrowser, Be as isWorkspaceTokenValidForContext, F as lazyWithRetry, be as legacyProductSlug, Ca as listUnsavedChanges, Sn as logManager, Je as markConnectionHealthy, dn as markSsoDepositDone, fn as markSsoDepositPending, Br as matchesKeyCombo, ia as mergeShortcuts, pn as mintSsoSessionTokens, Hn as nativeActionSheet, Un as nativeConfirm, Wn as nativeCopyText, Gn as nativeImpact, Kn as nativeNotify, qn as nativeOpenUrl, Jn as nativeSelection, Yn as nativeShare, Xn as nativeToast, Vr as normalizeKey, Hr as normalizePlatformCombo, xe as normalizeProductSlug, Ja as normalizeTourPath, se as onDesktopUpdateState, ce as onDesktopWindowState, Ur as parseKeyCombo, k as pluralize, vt as prepareWorkspaceRequest, d as progressTokens, va as publishPlanUsageSnapshot, po as purchaseNativeProduct, bi as readAnalyticsConsent, xi as readAnalyticsConsentChoice, Qn as readInitialNetworkStatus, zt as readShellSsoCookie, mn as readSsoDepositState, Nt as redirectToLogin, $n as reduceNetworkStatus, le as registerDesktopNavigator, da as registerPushDevice, vo as registerPushOptInController, Ya as registerTourRouteCatalog, wa as registerUnsavedChange, ut as resetAppClients, li as resolveActionSheetOutcome, io as resolveAppShellObservabilityConfig, me as resolveAuthBridgeConfig, fe as resolveGatewayBases, it as resolveGatewayUrl, ue as resolveGatewayUrls, he as resolveShellAuthBridgeConfig, Xa as resolveTourTargetPath, mo as restoreNativePurchases, Bn as selectInlineBase64, Si as setAnalyticsConsent, Bt as setSSoCookie, Vt as setShellSsoCookies, En as setUserContext, hn as shouldAttemptSsoDeposit, Wr as shouldEnableKeyboardShortcuts, Gr as shouldIgnoreShortcut, Me as shouldShowBreadcrumb, go as shouldShowNativeWelcome, Ne as shouldShowSidebar, Ye as shouldToastBackendError, A as slugify, f as statusTokens, pe as suppressConsole, j as toCamelCase, M as toPascalCase, p as trendTokens, N as truncateText, fa as unregisterPushDevice, Ta as unsavedChangesBlocking, ui as useActionSheet, cr as useActorProfiles, Ct as useApolloClient, ai as useAppState, Ji as useAsync, Yi as useAsyncImmediate, Qa as useAutoStartTour, Mi as useBreakpoint, Wi as useConditionalToggle, e as useCopyToClipboard, xa as useCurrentContextSearchParams, ki as useDebounce, di as useDesktop, fi as useDesktopUpdateState, pi as useDesktopWindowState, oi as useDeviceInfo, Ei as useEvent, Di as useEventBus, Oi as useEventEmitter, Ri as useExclusiveMenu, Or as useFeatureFlag, kr as useFeatureFlagDetails, Ar as useFeatureFlagValue, Dr as useFeatureFlags, ft as useGateway, pt as useGatewayClient, si as useHaptics, oa as useHasAnimated, gt as useHasAuthToken, $i as useHotkeys, Ia as useIsTourPlaying, Ii as useKeyPress, Li as useKeyboardShortcut, Qi as useKeyboardShortcuts, wt as useLazyQuery, zi as useLocalStorage, aa as useLogger, t as useMediaQuery, Oa as useMicrofrontendContext, Ni as useMobileBreakpoint, Tt as useMutation, ii as useNativeKeyboard, ni as useNativePlatform, er as useNetworkStatus, Pi as useOnClickOutside, Fi as useOnClickOutsideWithRef, Cr as usePWA, qi as usePagination, Ha as usePlayTour, Vi as usePrevious, Hi as usePreviousDistinct, Ui as usePreviousHistory, ir as usePullToRefresh, pa as usePushDeviceRegistration, Et as useQuery, ga as useQuotaErrorToast, ca as useRecordProductVisit, sa as useReferralAttribution, _n as useRegistryHelpers, ar as useReturnFocus, ri as useSafeArea, mt as useSafeGateway, ht as useSafeGatewayClient, $a as useSafeToursContext, Bi as useSessionStorage, vn as useShellNavigate, ea as useShortcutHelp, La as useStartTour, ci as useStatusBar, Ra as useStopTour, Dt as useSubscription, Ai as useThrottle, Gi as useToggle, Ki as useToggleObject, Ma as useTourPlayer, za as useTourPlayerContext, eo as useTours, to as useToursContext, Ea as useUnsavedChanges, ya as useUpgradePrompt, Qr as useVoiceInput, ka as withTourProgressStatus };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/fe-libs",
|
|
3
|
-
"version": "2026.1011.
|
|
3
|
+
"version": "2026.1011.2",
|
|
4
4
|
"description": "Burdenoff frontend primitives and domain libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"test:package-css-exports": "node scripts/validate-package-css-exports.mjs",
|
|
315
315
|
"verify:package": "node scripts/verify-package-contents.mjs",
|
|
316
316
|
"test:handsfree-browser": "node scripts/handsfree-browser-run.mjs",
|
|
317
|
-
"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/client.test.ts src/shared/utils/apollo.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 scripts/__tests__ 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/I18nProvider.client.test.tsx src/shared/providers/shell/translationStore.test.ts src/shared/providers/shell/translationLayers.test.ts src/shared/providers/shell/directionMode.test.ts src/shared/providers/shell/authProvider/ssoRelay.test.ts 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__",
|
|
317
|
+
"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/prepareWorkspaceRequest.test.ts src/shared/graphql/client.test.ts src/shared/utils/apollo.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 scripts/__tests__ 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/I18nProvider.client.test.tsx src/shared/providers/shell/translationStore.test.ts src/shared/providers/shell/translationLayers.test.ts src/shared/providers/shell/directionMode.test.ts src/shared/providers/shell/authProvider/ssoRelay.test.ts 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__",
|
|
318
318
|
"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 && bun run verify:package'",
|
|
319
319
|
"switch:status": "bun scripts/deps-mode.ts status",
|
|
320
320
|
"switch:remote": "bun scripts/deps-mode.ts remote",
|