@burdenoff/fe-libs 2026.715.3 → 2026.715.4
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;AAgGD,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AA2ND;;;;;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"}
|
|
@@ -25,7 +25,10 @@ var t = {
|
|
|
25
25
|
], i = {
|
|
26
26
|
globalBase: "https://gw-global.local.burdenoff.com",
|
|
27
27
|
workspaceBase: "https://gw-wspace.local.burdenoff.com"
|
|
28
|
-
}, a = 15e3, o = 1e4, s =
|
|
28
|
+
}, a = 15e3, o = 1e4, s = {
|
|
29
|
+
global: "https://alphagraphql.burdenoff.com/__cf-access-prime",
|
|
30
|
+
workspace: "https://alphagraphqlworkspaces.burdenoff.com/__cf-access-prime"
|
|
31
|
+
}, c = ["global", "workspace"], l = "bf-alpha-api-access-primed", u = 1200 * 60 * 1e3, d = "bf-alpha-api-access-prime-attempted", f = 15e3, p = new Set([
|
|
29
32
|
"/auth/oauth/callback",
|
|
30
33
|
"/auth/session-bridge",
|
|
31
34
|
"/auth/sso-callback",
|
|
@@ -33,11 +36,11 @@ var t = {
|
|
|
33
36
|
"/auth/sso-deposit",
|
|
34
37
|
"/auth/sso-relay",
|
|
35
38
|
"/auth/sso/callback"
|
|
36
|
-
]),
|
|
39
|
+
]), m = [
|
|
37
40
|
"traceparent",
|
|
38
41
|
"tracestate",
|
|
39
42
|
"baggage"
|
|
40
|
-
],
|
|
43
|
+
], h = [
|
|
41
44
|
"authorization",
|
|
42
45
|
"accept-language",
|
|
43
46
|
"x-org-id",
|
|
@@ -47,40 +50,46 @@ var t = {
|
|
|
47
50
|
"x-geo-currency",
|
|
48
51
|
"x-geo-timezone"
|
|
49
52
|
];
|
|
50
|
-
function
|
|
53
|
+
function g() {
|
|
51
54
|
let e = globalThis;
|
|
52
55
|
return e.__boffGraphQLResponseCache ||= /* @__PURE__ */ new Map(), e.__boffGraphQLResponseCache;
|
|
53
56
|
}
|
|
54
|
-
function
|
|
55
|
-
|
|
57
|
+
function _() {
|
|
58
|
+
g().clear();
|
|
56
59
|
}
|
|
57
|
-
function
|
|
60
|
+
function v(t) {
|
|
58
61
|
return t === "alphaadmin.burdenoff.com" || e.some((e) => t === `alphaapp.${e}`);
|
|
59
62
|
}
|
|
60
|
-
function
|
|
63
|
+
function y(e) {
|
|
61
64
|
try {
|
|
62
65
|
return new URL(e.globalBase).hostname === "alphagraphql.burdenoff.com" && new URL(e.workspaceBase).hostname === "alphagraphqlworkspaces.burdenoff.com";
|
|
63
66
|
} catch {
|
|
64
67
|
return !1;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
70
|
+
var b = "cf_primed";
|
|
71
|
+
function x() {
|
|
69
72
|
try {
|
|
70
73
|
return globalThis.sessionStorage ?? null;
|
|
71
74
|
} catch {
|
|
72
75
|
return null;
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
function S(e) {
|
|
79
|
+
return `${l}-${e}-at`;
|
|
80
|
+
}
|
|
81
|
+
function C(e) {
|
|
82
|
+
return `${d}-${e}-at`;
|
|
83
|
+
}
|
|
84
|
+
function w(e, t, n) {
|
|
85
|
+
let r = e.getItem(S(t)), i = r ? Number(r) : 0;
|
|
86
|
+
return Number.isFinite(i) && n - i < u;
|
|
78
87
|
}
|
|
79
|
-
function
|
|
80
|
-
let
|
|
81
|
-
return Number.isFinite(
|
|
88
|
+
function T(e, t, n) {
|
|
89
|
+
let r = e.getItem(C(t)), i = r ? Number(r) : 0;
|
|
90
|
+
return Number.isFinite(i) && n - i < f;
|
|
82
91
|
}
|
|
83
|
-
function
|
|
92
|
+
function E() {
|
|
84
93
|
try {
|
|
85
94
|
let e = new URL(window.location.href || window.location.origin);
|
|
86
95
|
return e.hash = "", e.toString();
|
|
@@ -88,54 +97,59 @@ function C() {
|
|
|
88
97
|
return window.location.origin;
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
|
-
function
|
|
92
|
-
return window.location.hash ? !0 :
|
|
100
|
+
function D() {
|
|
101
|
+
return window.location.hash ? !0 : p.has(window.location.pathname);
|
|
93
102
|
}
|
|
94
|
-
function
|
|
103
|
+
function O(e, t) {
|
|
95
104
|
let n;
|
|
96
105
|
try {
|
|
97
106
|
n = new URL(window.location.href);
|
|
98
107
|
} catch {
|
|
99
|
-
return
|
|
108
|
+
return null;
|
|
100
109
|
}
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
let r = n.searchParams.get(b), i = r === "1" || r === "global" ? "global" : r === "workspace" ? "workspace" : null;
|
|
111
|
+
if (!i) return null;
|
|
112
|
+
n.searchParams.delete(b);
|
|
103
113
|
try {
|
|
104
|
-
e.setItem(
|
|
114
|
+
e.setItem(S(i), String(t)), e.removeItem(C(i));
|
|
105
115
|
} catch {}
|
|
106
|
-
return window.history.replaceState(window.history.state, "", n.toString()),
|
|
116
|
+
return window.history.replaceState(window.history.state, "", n.toString()), i;
|
|
107
117
|
}
|
|
108
|
-
function
|
|
109
|
-
if (typeof window > "u" || !
|
|
110
|
-
let t =
|
|
118
|
+
function k(e) {
|
|
119
|
+
if (typeof window > "u" || !y(e) || !v(window.location.hostname.toLowerCase())) return;
|
|
120
|
+
let t = x();
|
|
111
121
|
if (!t) return;
|
|
112
122
|
let n = Date.now();
|
|
113
|
-
if (
|
|
123
|
+
if (O(t, n), D()) return;
|
|
124
|
+
let r = c.find((e) => !w(t, e, n));
|
|
125
|
+
if (!r || T(t, r, n)) return;
|
|
114
126
|
try {
|
|
115
|
-
t.setItem(
|
|
127
|
+
t.setItem(C(r), String(n));
|
|
116
128
|
} catch {}
|
|
117
|
-
let
|
|
118
|
-
i.searchParams.set(
|
|
129
|
+
let i = new URL(E());
|
|
130
|
+
r === "workspace" && i.searchParams.set(b, r);
|
|
131
|
+
let a = new URL(s[r]);
|
|
132
|
+
a.searchParams.set("returnTo", i.toString()), window.location.replace(a.toString());
|
|
119
133
|
}
|
|
120
|
-
function
|
|
134
|
+
function A(e) {
|
|
121
135
|
return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
|
|
122
136
|
}
|
|
123
|
-
function
|
|
137
|
+
function j(e) {
|
|
124
138
|
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;
|
|
125
139
|
}
|
|
126
|
-
function
|
|
127
|
-
return Object.fromEntries(
|
|
140
|
+
function M(e) {
|
|
141
|
+
return Object.fromEntries(h.map((t) => [t, e.get(t) ?? ""]));
|
|
128
142
|
}
|
|
129
|
-
function
|
|
130
|
-
let n =
|
|
131
|
-
return !n || !
|
|
143
|
+
function N(e, t) {
|
|
144
|
+
let n = j(t);
|
|
145
|
+
return !n || !A(t) ? null : JSON.stringify({
|
|
132
146
|
url: e.url,
|
|
133
|
-
headers:
|
|
147
|
+
headers: M(e.headers),
|
|
134
148
|
operationName: n,
|
|
135
149
|
variables: t.variables ?? null
|
|
136
150
|
});
|
|
137
151
|
}
|
|
138
|
-
function
|
|
152
|
+
function P(e) {
|
|
139
153
|
try {
|
|
140
154
|
let t = JSON.parse(e);
|
|
141
155
|
return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
|
|
@@ -143,45 +157,45 @@ function j(e) {
|
|
|
143
157
|
return null;
|
|
144
158
|
}
|
|
145
159
|
}
|
|
146
|
-
function
|
|
160
|
+
function F(e, t) {
|
|
147
161
|
return new Response(JSON.stringify(t ? e : e[0]), {
|
|
148
162
|
status: 200,
|
|
149
163
|
headers: { "content-type": "application/json" }
|
|
150
164
|
});
|
|
151
165
|
}
|
|
152
|
-
function
|
|
166
|
+
function I() {
|
|
153
167
|
return typeof performance < "u" && performance.now() < o;
|
|
154
168
|
}
|
|
155
|
-
function
|
|
169
|
+
function L(e) {
|
|
156
170
|
let t = new Headers(e.headers), n = !1;
|
|
157
|
-
for (let e of
|
|
171
|
+
for (let e of m) t.has(e) && (t.delete(e), n = !0);
|
|
158
172
|
return n ? new Request(e, { headers: t }) : e;
|
|
159
173
|
}
|
|
160
|
-
function
|
|
174
|
+
function R(e, t) {
|
|
161
175
|
let n = window.location.hostname.toLowerCase(), a = [...r, ...e ?? []];
|
|
162
176
|
for (let e of a) if (n === e.hostname) return e.bases;
|
|
163
177
|
return t ?? i;
|
|
164
178
|
}
|
|
165
|
-
function
|
|
179
|
+
function z(e, t) {
|
|
166
180
|
let { globalBase: n, workspaceBase: r } = e;
|
|
167
181
|
if (!n || !r) return;
|
|
168
|
-
|
|
182
|
+
k(e);
|
|
169
183
|
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) => {
|
|
170
184
|
let t = new URL(e, window.location.origin), i = l(t.pathname);
|
|
171
185
|
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;
|
|
172
186
|
}, d = async (e) => {
|
|
173
187
|
if (!(e.method.toUpperCase() === "POST" && /(?:^|\/)graphql$/.test(new URL(e.url).pathname))) return i(e);
|
|
174
|
-
let t = await e.clone().text(), n =
|
|
188
|
+
let t = await e.clone().text(), n = L(e.clone()), r = P(t);
|
|
175
189
|
if (!r?.length) return i(e);
|
|
176
|
-
let o = t.trimStart().startsWith("["), s = r.map((e) =>
|
|
177
|
-
if (
|
|
178
|
-
let e =
|
|
179
|
-
if (t.every((e) => e && e.expiresAt > n)) return
|
|
190
|
+
let o = t.trimStart().startsWith("["), s = r.map((e) => N(n, e));
|
|
191
|
+
if (I() && s.every(Boolean)) {
|
|
192
|
+
let e = g(), t = s.map((t) => e.get(t)), n = Date.now();
|
|
193
|
+
if (t.every((e) => e && e.expiresAt > n)) return F(t.map((e) => e.value), o);
|
|
180
194
|
}
|
|
181
195
|
let c = await i(e);
|
|
182
|
-
if (!c.ok || !s.some(Boolean) || !
|
|
196
|
+
if (!c.ok || !s.some(Boolean) || !I()) return c;
|
|
183
197
|
try {
|
|
184
|
-
let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n =
|
|
198
|
+
let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n = g();
|
|
185
199
|
t.forEach((e, t) => {
|
|
186
200
|
let r = s[t];
|
|
187
201
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
@@ -202,7 +216,7 @@ function I(e, t) {
|
|
|
202
216
|
});
|
|
203
217
|
f.preconnect && (p.preconnect = f.preconnect), globalThis.fetch = p;
|
|
204
218
|
}
|
|
205
|
-
function
|
|
219
|
+
function B(e = "VITE_VERBOSE_CONSOLE") {
|
|
206
220
|
({
|
|
207
221
|
BASE_URL: "/",
|
|
208
222
|
DEV: !1,
|
|
@@ -212,4 +226,4 @@ function L(e = "VITE_VERBOSE_CONSOLE") {
|
|
|
212
226
|
})?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
|
|
213
227
|
}
|
|
214
228
|
//#endregion
|
|
215
|
-
export {
|
|
229
|
+
export { _ as clearGatewayGraphQLResponseCache, z as installGatewayFetchRewrite, R as resolveGatewayBases, B as suppressConsole };
|