@burdenoff/fe-libs 2026.706.2 → 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,35 +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
|
-
|
|
67
|
+
var y = "cf_primed";
|
|
68
|
+
function b() {
|
|
68
69
|
try {
|
|
69
70
|
return globalThis.sessionStorage ?? null;
|
|
70
71
|
} catch {
|
|
71
72
|
return null;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function x(e, t) {
|
|
75
76
|
let n = e.getItem(c), r = n ? Number(n) : 0;
|
|
76
77
|
return Number.isFinite(r) && t - r < l;
|
|
77
78
|
}
|
|
78
|
-
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() {
|
|
79
84
|
try {
|
|
80
85
|
let e = new URL(window.location.href || window.location.origin);
|
|
81
86
|
return e.hash = "", e.toString();
|
|
@@ -83,42 +88,54 @@ function y() {
|
|
|
83
88
|
return window.location.origin;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
function
|
|
87
|
-
return window.location.hash ? !0 :
|
|
91
|
+
function w() {
|
|
92
|
+
return window.location.hash ? !0 : f.has(window.location.pathname);
|
|
88
93
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
let t = _();
|
|
92
|
-
if (!t) return;
|
|
93
|
-
let n = Date.now();
|
|
94
|
-
if (v(t, n)) return;
|
|
94
|
+
function T(e, t) {
|
|
95
|
+
let n;
|
|
95
96
|
try {
|
|
96
|
-
|
|
97
|
+
n = new URL(window.location.href);
|
|
97
98
|
} catch {
|
|
98
|
-
return;
|
|
99
|
+
return !1;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
if (!n.searchParams.has(y)) return !1;
|
|
102
|
+
n.searchParams.delete(y);
|
|
103
|
+
try {
|
|
104
|
+
e.setItem(c, String(t)), e.removeItem(u);
|
|
105
|
+
} catch {}
|
|
106
|
+
return window.history.replaceState(window.history.state, "", n.toString()), !0;
|
|
107
|
+
}
|
|
108
|
+
function E(e) {
|
|
109
|
+
if (typeof window > "u" || !v(e) || !_(window.location.hostname.toLowerCase())) return;
|
|
110
|
+
let t = b();
|
|
111
|
+
if (!t) return;
|
|
112
|
+
let n = Date.now();
|
|
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);
|
|
101
118
|
i.searchParams.set("returnTo", r), window.location.replace(i.toString());
|
|
102
119
|
}
|
|
103
|
-
function
|
|
120
|
+
function D(e) {
|
|
104
121
|
return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
|
|
105
122
|
}
|
|
106
|
-
function
|
|
123
|
+
function O(e) {
|
|
107
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;
|
|
108
125
|
}
|
|
109
|
-
function
|
|
110
|
-
return Object.fromEntries(
|
|
126
|
+
function k(e) {
|
|
127
|
+
return Object.fromEntries(m.map((t) => [t, e.get(t) ?? ""]));
|
|
111
128
|
}
|
|
112
|
-
function
|
|
113
|
-
let n =
|
|
114
|
-
return !n || !
|
|
129
|
+
function A(e, t) {
|
|
130
|
+
let n = O(t);
|
|
131
|
+
return !n || !D(t) ? null : JSON.stringify({
|
|
115
132
|
url: e.url,
|
|
116
|
-
headers:
|
|
133
|
+
headers: k(e.headers),
|
|
117
134
|
operationName: n,
|
|
118
135
|
variables: t.variables ?? null
|
|
119
136
|
});
|
|
120
137
|
}
|
|
121
|
-
function
|
|
138
|
+
function j(e) {
|
|
122
139
|
try {
|
|
123
140
|
let t = JSON.parse(e);
|
|
124
141
|
return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
|
|
@@ -126,45 +143,45 @@ function E(e) {
|
|
|
126
143
|
return null;
|
|
127
144
|
}
|
|
128
145
|
}
|
|
129
|
-
function
|
|
146
|
+
function M(e, t) {
|
|
130
147
|
return new Response(JSON.stringify(t ? e : e[0]), {
|
|
131
148
|
status: 200,
|
|
132
149
|
headers: { "content-type": "application/json" }
|
|
133
150
|
});
|
|
134
151
|
}
|
|
135
|
-
function
|
|
152
|
+
function N() {
|
|
136
153
|
return typeof performance < "u" && performance.now() < o;
|
|
137
154
|
}
|
|
138
|
-
function
|
|
155
|
+
function P(e) {
|
|
139
156
|
let t = new Headers(e.headers), n = !1;
|
|
140
|
-
for (let e of
|
|
157
|
+
for (let e of p) t.has(e) && (t.delete(e), n = !0);
|
|
141
158
|
return n ? new Request(e, { headers: t }) : e;
|
|
142
159
|
}
|
|
143
|
-
function
|
|
160
|
+
function F(e, t) {
|
|
144
161
|
let n = window.location.hostname.toLowerCase(), a = [...r, ...e ?? []];
|
|
145
162
|
for (let e of a) if (n === e.hostname) return e.bases;
|
|
146
163
|
return t ?? i;
|
|
147
164
|
}
|
|
148
|
-
function
|
|
165
|
+
function I(e, t) {
|
|
149
166
|
let { globalBase: n, workspaceBase: r } = e;
|
|
150
167
|
if (!n || !r) return;
|
|
151
|
-
|
|
168
|
+
E(e);
|
|
152
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) => {
|
|
153
170
|
let t = new URL(e, window.location.origin), i = l(t.pathname);
|
|
154
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;
|
|
155
172
|
}, d = async (e) => {
|
|
156
173
|
if (!(e.method.toUpperCase() === "POST" && /(?:^|\/)graphql$/.test(new URL(e.url).pathname))) return i(e);
|
|
157
|
-
let t = await e.clone().text(), n =
|
|
174
|
+
let t = await e.clone().text(), n = P(e.clone()), r = j(t);
|
|
158
175
|
if (!r?.length) return i(e);
|
|
159
|
-
let o = t.trimStart().startsWith("["), s = r.map((e) =>
|
|
160
|
-
if (
|
|
161
|
-
let e =
|
|
162
|
-
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);
|
|
163
180
|
}
|
|
164
181
|
let c = await i(e);
|
|
165
|
-
if (!c.ok || !s.some(Boolean) || !
|
|
182
|
+
if (!c.ok || !s.some(Boolean) || !N()) return c;
|
|
166
183
|
try {
|
|
167
|
-
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();
|
|
168
185
|
t.forEach((e, t) => {
|
|
169
186
|
let r = s[t];
|
|
170
187
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
@@ -174,7 +191,7 @@ function j(e, t) {
|
|
|
174
191
|
});
|
|
175
192
|
} catch {}
|
|
176
193
|
return c;
|
|
177
|
-
}, f = i,
|
|
194
|
+
}, f = i, p = ((e, t) => {
|
|
178
195
|
if (e == null) return i(e, t);
|
|
179
196
|
if (e instanceof Request) {
|
|
180
197
|
let n = u(e.url), r = new Request(n, e);
|
|
@@ -183,9 +200,9 @@ function j(e, t) {
|
|
|
183
200
|
let n = typeof e == "string" ? e : e.toString();
|
|
184
201
|
return d(new Request(u(n), t));
|
|
185
202
|
});
|
|
186
|
-
f.preconnect && (
|
|
203
|
+
f.preconnect && (p.preconnect = f.preconnect), globalThis.fetch = p;
|
|
187
204
|
}
|
|
188
|
-
function
|
|
205
|
+
function L(e = "VITE_VERBOSE_CONSOLE") {
|
|
189
206
|
({
|
|
190
207
|
BASE_URL: "/",
|
|
191
208
|
DEV: !1,
|
|
@@ -195,4 +212,4 @@ function M(e = "VITE_VERBOSE_CONSOLE") {
|
|
|
195
212
|
})?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
|
|
196
213
|
}
|
|
197
214
|
//#endregion
|
|
198
|
-
export {
|
|
215
|
+
export { g as clearGatewayGraphQLResponseCache, I as installGatewayFetchRewrite, F as resolveGatewayBases, L as suppressConsole };
|