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