@burdenoff/fe-libs 2026.627.3 → 2026.628.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatewayFetchRewrite.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/gatewayFetchRewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"gatewayFetchRewrite.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/gatewayFetchRewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;CACrB;AAgFD,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AA2ID;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,kBAAkB,EAAE,EACpC,aAAa,CAAC,EAAE,YAAY,GAC3B,YAAY,CAad;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAET;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,CAAC,EAAE,0BAA0B,GACpC,IAAI,CAuHN;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAyB,GAAG,IAAI,CAQtE"}
|
|
@@ -6,23 +6,38 @@ var t = {
|
|
|
6
6
|
}, n = {
|
|
7
7
|
globalBase: "https://alphagraphql.burdenoff.com",
|
|
8
8
|
workspaceBase: "https://alphagraphqlworkspaces.burdenoff.com"
|
|
9
|
-
}, r = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
}, r = [
|
|
10
|
+
...e.flatMap((e) => [{
|
|
11
|
+
hostname: `app.${e}`,
|
|
12
|
+
bases: t
|
|
13
|
+
}, {
|
|
14
|
+
hostname: `alphaapp.${e}`,
|
|
15
|
+
bases: n
|
|
16
|
+
}]),
|
|
17
|
+
{
|
|
18
|
+
hostname: "admin.burdenoff.com",
|
|
19
|
+
bases: t
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
hostname: "alphaadmin.burdenoff.com",
|
|
23
|
+
bases: n
|
|
24
|
+
}
|
|
25
|
+
], i = {
|
|
19
26
|
globalBase: "https://gw-global.local.burdenoff.com",
|
|
20
27
|
workspaceBase: "https://gw-wspace.local.burdenoff.com"
|
|
21
|
-
}, a = 15e3, o = 1e4, s = [
|
|
28
|
+
}, a = 15e3, o = 1e4, s = "https://alphagraphql.burdenoff.com/__cf-access-prime", c = "bf-alpha-api-access-primed-at", l = 1200 * 60 * 1e3, u = new Set([
|
|
29
|
+
"/auth/oauth/callback",
|
|
30
|
+
"/auth/session-bridge",
|
|
31
|
+
"/auth/sso-callback",
|
|
32
|
+
"/auth/sso-clear",
|
|
33
|
+
"/auth/sso-deposit",
|
|
34
|
+
"/auth/sso-relay",
|
|
35
|
+
"/auth/sso/callback"
|
|
36
|
+
]), d = [
|
|
22
37
|
"traceparent",
|
|
23
38
|
"tracestate",
|
|
24
39
|
"baggage"
|
|
25
|
-
],
|
|
40
|
+
], f = [
|
|
26
41
|
"authorization",
|
|
27
42
|
"accept-language",
|
|
28
43
|
"x-org-id",
|
|
@@ -32,32 +47,78 @@ var t = {
|
|
|
32
47
|
"x-geo-currency",
|
|
33
48
|
"x-geo-timezone"
|
|
34
49
|
];
|
|
35
|
-
function
|
|
50
|
+
function p() {
|
|
36
51
|
let e = globalThis;
|
|
37
52
|
return e.__boffGraphQLResponseCache ||= /* @__PURE__ */ new Map(), e.__boffGraphQLResponseCache;
|
|
38
53
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
54
|
+
function m() {
|
|
55
|
+
p().clear();
|
|
56
|
+
}
|
|
57
|
+
function h(t) {
|
|
58
|
+
return t === "alphaadmin.burdenoff.com" || e.some((e) => t === `alphaapp.${e}`);
|
|
59
|
+
}
|
|
60
|
+
function g(e) {
|
|
61
|
+
try {
|
|
62
|
+
return new URL(e.globalBase).hostname === "alphagraphql.burdenoff.com" && new URL(e.workspaceBase).hostname === "alphagraphqlworkspaces.burdenoff.com";
|
|
63
|
+
} catch {
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function _() {
|
|
68
|
+
try {
|
|
69
|
+
return globalThis.sessionStorage ?? null;
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
41
73
|
}
|
|
42
|
-
function
|
|
74
|
+
function v(e, t) {
|
|
75
|
+
let n = e.getItem(c), r = n ? Number(n) : 0;
|
|
76
|
+
return Number.isFinite(r) && t - r < l;
|
|
77
|
+
}
|
|
78
|
+
function y() {
|
|
79
|
+
try {
|
|
80
|
+
let e = new URL(window.location.href || window.location.origin);
|
|
81
|
+
return e.hash = "", e.toString();
|
|
82
|
+
} catch {
|
|
83
|
+
return window.location.origin;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function b() {
|
|
87
|
+
return window.location.hash ? !0 : u.has(window.location.pathname);
|
|
88
|
+
}
|
|
89
|
+
function x(e) {
|
|
90
|
+
if (typeof window > "u" || !g(e) || !h(window.location.hostname.toLowerCase()) || b()) return;
|
|
91
|
+
let t = _();
|
|
92
|
+
if (!t) return;
|
|
93
|
+
let n = Date.now();
|
|
94
|
+
if (v(t, n)) return;
|
|
95
|
+
try {
|
|
96
|
+
t.setItem(c, String(n));
|
|
97
|
+
} catch {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let r = y(), i = new URL(s);
|
|
101
|
+
i.searchParams.set("returnTo", r), window.location.replace(i.toString());
|
|
102
|
+
}
|
|
103
|
+
function S(e) {
|
|
43
104
|
return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
|
|
44
105
|
}
|
|
45
|
-
function
|
|
106
|
+
function C(e) {
|
|
46
107
|
return typeof e.operationName == "string" && e.operationName ? e.operationName : typeof e.query == "string" ? e.query.match(/(?:query|mutation|subscription)\s+([A-Za-z0-9_]+)/)?.[1] ?? null : null;
|
|
47
108
|
}
|
|
48
|
-
function
|
|
49
|
-
return Object.fromEntries(
|
|
109
|
+
function w(e) {
|
|
110
|
+
return Object.fromEntries(f.map((t) => [t, e.get(t) ?? ""]));
|
|
50
111
|
}
|
|
51
|
-
function
|
|
52
|
-
let n =
|
|
53
|
-
return !n || !
|
|
112
|
+
function T(e, t) {
|
|
113
|
+
let n = C(t);
|
|
114
|
+
return !n || !S(t) ? null : JSON.stringify({
|
|
54
115
|
url: e.url,
|
|
55
|
-
headers:
|
|
116
|
+
headers: w(e.headers),
|
|
56
117
|
operationName: n,
|
|
57
118
|
variables: t.variables ?? null
|
|
58
119
|
});
|
|
59
120
|
}
|
|
60
|
-
function
|
|
121
|
+
function E(e) {
|
|
61
122
|
try {
|
|
62
123
|
let t = JSON.parse(e);
|
|
63
124
|
return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
|
|
@@ -65,44 +126,45 @@ function h(e) {
|
|
|
65
126
|
return null;
|
|
66
127
|
}
|
|
67
128
|
}
|
|
68
|
-
function
|
|
129
|
+
function D(e, t) {
|
|
69
130
|
return new Response(JSON.stringify(t ? e : e[0]), {
|
|
70
131
|
status: 200,
|
|
71
132
|
headers: { "content-type": "application/json" }
|
|
72
133
|
});
|
|
73
134
|
}
|
|
74
|
-
function
|
|
135
|
+
function O() {
|
|
75
136
|
return typeof performance < "u" && performance.now() < o;
|
|
76
137
|
}
|
|
77
|
-
function
|
|
138
|
+
function k(e) {
|
|
78
139
|
let t = new Headers(e.headers), n = !1;
|
|
79
|
-
for (let e of
|
|
140
|
+
for (let e of d) t.has(e) && (t.delete(e), n = !0);
|
|
80
141
|
return n ? new Request(e, { headers: t }) : e;
|
|
81
142
|
}
|
|
82
|
-
function
|
|
143
|
+
function A(e, t) {
|
|
83
144
|
let n = window.location.hostname.toLowerCase(), a = [...r, ...e ?? []];
|
|
84
145
|
for (let e of a) if (n === e.hostname) return e.bases;
|
|
85
146
|
return t ?? i;
|
|
86
147
|
}
|
|
87
|
-
function
|
|
148
|
+
function j(e, t) {
|
|
88
149
|
let { globalBase: n, workspaceBase: r } = e;
|
|
89
150
|
if (!n || !r) return;
|
|
90
|
-
|
|
91
|
-
|
|
151
|
+
x(e);
|
|
152
|
+
let i = globalThis.fetch.bind(globalThis), o = window.location.origin, s = new Set([o, "https://gw-global.local.burdenoff.com"]), c = new Set([o, "https://gw-wspace.local.burdenoff.com"]), l = (e) => /(?:^|\/)global\/graphql$/.test(e) ? "/global/graphql" : /(?:^|\/)workspaces\/graphql$/.test(e) ? "/workspaces/graphql" : "", u = (e) => {
|
|
153
|
+
let t = new URL(e, window.location.origin), i = l(t.pathname);
|
|
92
154
|
return i === "/global/graphql" && s.has(t.origin) ? `${n}${i}${t.search}${t.hash}` : i === "/workspaces/graphql" && c.has(t.origin) ? `${r}${i}${t.search}${t.hash}` : e;
|
|
93
|
-
},
|
|
155
|
+
}, d = async (e) => {
|
|
94
156
|
if (!(e.method.toUpperCase() === "POST" && /(?:^|\/)graphql$/.test(new URL(e.url).pathname))) return i(e);
|
|
95
|
-
let t = await e.clone().text(), n =
|
|
157
|
+
let t = await e.clone().text(), n = k(e.clone()), r = E(t);
|
|
96
158
|
if (!r?.length) return i(e);
|
|
97
|
-
let o = t.trimStart().startsWith("["), s = r.map((e) =>
|
|
98
|
-
if (
|
|
99
|
-
let e =
|
|
100
|
-
if (t.every((e) => e && e.expiresAt > n)) return
|
|
159
|
+
let o = t.trimStart().startsWith("["), s = r.map((e) => T(n, e));
|
|
160
|
+
if (O() && s.every(Boolean)) {
|
|
161
|
+
let e = p(), t = s.map((t) => e.get(t)), n = Date.now();
|
|
162
|
+
if (t.every((e) => e && e.expiresAt > n)) return D(t.map((e) => e.value), o);
|
|
101
163
|
}
|
|
102
164
|
let c = await i(e);
|
|
103
|
-
if (!c.ok || !s.some(Boolean) || !
|
|
165
|
+
if (!c.ok || !s.some(Boolean) || !O()) return c;
|
|
104
166
|
try {
|
|
105
|
-
let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n =
|
|
167
|
+
let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n = p();
|
|
106
168
|
t.forEach((e, t) => {
|
|
107
169
|
let r = s[t];
|
|
108
170
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
@@ -112,18 +174,18 @@ function b(e, t) {
|
|
|
112
174
|
});
|
|
113
175
|
} catch {}
|
|
114
176
|
return c;
|
|
115
|
-
},
|
|
177
|
+
}, f = i, m = ((e, t) => {
|
|
116
178
|
if (e == null) return i(e, t);
|
|
117
179
|
if (e instanceof Request) {
|
|
118
|
-
let n =
|
|
119
|
-
return
|
|
180
|
+
let n = u(e.url), r = new Request(n, e);
|
|
181
|
+
return d(t ? new Request(r, t) : r);
|
|
120
182
|
}
|
|
121
183
|
let n = typeof e == "string" ? e : e.toString();
|
|
122
|
-
return
|
|
184
|
+
return d(new Request(u(n), t));
|
|
123
185
|
});
|
|
124
|
-
|
|
186
|
+
f.preconnect && (m.preconnect = f.preconnect), globalThis.fetch = m;
|
|
125
187
|
}
|
|
126
|
-
function
|
|
188
|
+
function M(e = "VITE_VERBOSE_CONSOLE") {
|
|
127
189
|
({
|
|
128
190
|
BASE_URL: "/",
|
|
129
191
|
DEV: !1,
|
|
@@ -133,4 +195,4 @@ function x(e = "VITE_VERBOSE_CONSOLE") {
|
|
|
133
195
|
})?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
|
|
134
196
|
}
|
|
135
197
|
//#endregion
|
|
136
|
-
export {
|
|
198
|
+
export { m as clearGatewayGraphQLResponseCache, j as installGatewayFetchRewrite, A as resolveGatewayBases, M as suppressConsole };
|