@burdenoff/fe-libs 2026.715.3 → 2026.715.5
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;AAkPD;;;;;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,CA6HN;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,53 @@ 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) {
|
|
85
|
+
try {
|
|
86
|
+
return c.find((t) => e.getItem(C(t)) !== null) ?? null;
|
|
87
|
+
} catch {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function T(e, t, n) {
|
|
92
|
+
let r = e.getItem(S(t)), i = r ? Number(r) : 0;
|
|
93
|
+
return Number.isFinite(i) && n - i < u;
|
|
78
94
|
}
|
|
79
|
-
function
|
|
80
|
-
let
|
|
81
|
-
return Number.isFinite(
|
|
95
|
+
function E(e, t, n) {
|
|
96
|
+
let r = e.getItem(C(t)), i = r ? Number(r) : 0;
|
|
97
|
+
return Number.isFinite(i) && n - i < f;
|
|
82
98
|
}
|
|
83
|
-
function
|
|
99
|
+
function D() {
|
|
84
100
|
try {
|
|
85
101
|
let e = new URL(window.location.href || window.location.origin);
|
|
86
102
|
return e.hash = "", e.toString();
|
|
@@ -88,54 +104,64 @@ function C() {
|
|
|
88
104
|
return window.location.origin;
|
|
89
105
|
}
|
|
90
106
|
}
|
|
91
|
-
function
|
|
92
|
-
return window.location.hash ? !0 :
|
|
107
|
+
function O() {
|
|
108
|
+
return window.location.hash ? !0 : p.has(window.location.pathname);
|
|
93
109
|
}
|
|
94
|
-
function
|
|
110
|
+
function k(e, t) {
|
|
95
111
|
let n;
|
|
96
112
|
try {
|
|
97
113
|
n = new URL(window.location.href);
|
|
98
114
|
} catch {
|
|
99
|
-
return
|
|
115
|
+
return null;
|
|
100
116
|
}
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
let r = n.searchParams.get(b), i = r === "global" ? "global" : r === "workspace" ? "workspace" : r === "1" ? w(e) ?? "global" : null;
|
|
118
|
+
if (!i) return null;
|
|
119
|
+
n.searchParams.delete(b);
|
|
103
120
|
try {
|
|
104
|
-
e.setItem(
|
|
121
|
+
e.setItem(S(i), String(t)), e.removeItem(C(i));
|
|
105
122
|
} catch {}
|
|
106
|
-
return window.history.replaceState(window.history.state, "", n.toString()),
|
|
123
|
+
return window.history.replaceState(window.history.state, "", n.toString()), i;
|
|
107
124
|
}
|
|
108
|
-
function
|
|
109
|
-
if (typeof window > "u" || !
|
|
110
|
-
let t =
|
|
111
|
-
if (!t) return;
|
|
125
|
+
function A(e) {
|
|
126
|
+
if (typeof window > "u" || !y(e) || !v(window.location.hostname.toLowerCase())) return !1;
|
|
127
|
+
let t = x();
|
|
128
|
+
if (!t) return !1;
|
|
112
129
|
let n = Date.now();
|
|
113
|
-
if (
|
|
130
|
+
if (k(t, n), O()) return !1;
|
|
131
|
+
let r = c.find((e) => !T(t, e, n));
|
|
132
|
+
if (!r || E(t, r, n)) return !1;
|
|
114
133
|
try {
|
|
115
|
-
t.setItem(
|
|
134
|
+
t.setItem(C(r), String(n));
|
|
116
135
|
} catch {}
|
|
117
|
-
let
|
|
118
|
-
i.searchParams.set(
|
|
136
|
+
let i = new URL(D());
|
|
137
|
+
r === "workspace" && i.searchParams.set(b, r);
|
|
138
|
+
let a = new URL(s[r]);
|
|
139
|
+
a.searchParams.set("returnTo", i.toString());
|
|
140
|
+
try {
|
|
141
|
+
return window.location.replace(a.toString()), !0;
|
|
142
|
+
} catch {
|
|
143
|
+
return !1;
|
|
144
|
+
}
|
|
119
145
|
}
|
|
120
|
-
function
|
|
146
|
+
function j(e) {
|
|
121
147
|
return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
|
|
122
148
|
}
|
|
123
|
-
function
|
|
149
|
+
function M(e) {
|
|
124
150
|
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
151
|
}
|
|
126
|
-
function
|
|
127
|
-
return Object.fromEntries(
|
|
152
|
+
function N(e) {
|
|
153
|
+
return Object.fromEntries(h.map((t) => [t, e.get(t) ?? ""]));
|
|
128
154
|
}
|
|
129
|
-
function
|
|
130
|
-
let n =
|
|
131
|
-
return !n || !
|
|
155
|
+
function P(e, t) {
|
|
156
|
+
let n = M(t);
|
|
157
|
+
return !n || !j(t) ? null : JSON.stringify({
|
|
132
158
|
url: e.url,
|
|
133
|
-
headers:
|
|
159
|
+
headers: N(e.headers),
|
|
134
160
|
operationName: n,
|
|
135
161
|
variables: t.variables ?? null
|
|
136
162
|
});
|
|
137
163
|
}
|
|
138
|
-
function
|
|
164
|
+
function F(e) {
|
|
139
165
|
try {
|
|
140
166
|
let t = JSON.parse(e);
|
|
141
167
|
return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
|
|
@@ -143,66 +169,67 @@ function j(e) {
|
|
|
143
169
|
return null;
|
|
144
170
|
}
|
|
145
171
|
}
|
|
146
|
-
function
|
|
172
|
+
function I(e, t) {
|
|
147
173
|
return new Response(JSON.stringify(t ? e : e[0]), {
|
|
148
174
|
status: 200,
|
|
149
175
|
headers: { "content-type": "application/json" }
|
|
150
176
|
});
|
|
151
177
|
}
|
|
152
|
-
function
|
|
178
|
+
function L() {
|
|
153
179
|
return typeof performance < "u" && performance.now() < o;
|
|
154
180
|
}
|
|
155
|
-
function
|
|
181
|
+
function R(e) {
|
|
156
182
|
let t = new Headers(e.headers), n = !1;
|
|
157
|
-
for (let e of
|
|
183
|
+
for (let e of m) t.has(e) && (t.delete(e), n = !0);
|
|
158
184
|
return n ? new Request(e, { headers: t }) : e;
|
|
159
185
|
}
|
|
160
|
-
function
|
|
186
|
+
function z(e, t) {
|
|
161
187
|
let n = window.location.hostname.toLowerCase(), a = [...r, ...e ?? []];
|
|
162
188
|
for (let e of a) if (n === e.hostname) return e.bases;
|
|
163
189
|
return t ?? i;
|
|
164
190
|
}
|
|
165
|
-
function
|
|
191
|
+
function B(e, t) {
|
|
166
192
|
let { globalBase: n, workspaceBase: r } = e;
|
|
167
193
|
if (!n || !r) return;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
194
|
+
let i = A(e), o = globalThis.fetch.bind(globalThis), s = window.location.origin, c = new Set([s, "https://gw-global.local.burdenoff.com"]), l = new Set([s, "https://gw-wspace.local.burdenoff.com"]), u = (e) => /(?:^|\/)global\/graphql$/.test(e) ? "/global/graphql" : /(?:^|\/)workspaces\/graphql$/.test(e) ? "/workspaces/graphql" : "", d = (e) => {
|
|
195
|
+
let t = new URL(e, window.location.origin), i = u(t.pathname);
|
|
196
|
+
return i === "/global/graphql" && c.has(t.origin) ? `${n}${i}${t.search}${t.hash}` : i === "/workspaces/graphql" && l.has(t.origin) ? `${r}${i}${t.search}${t.hash}` : e;
|
|
197
|
+
}, f = async (e) => {
|
|
198
|
+
let t = /(?:^|\/)graphql$/.test(new URL(e.url).pathname);
|
|
199
|
+
if (i && t) return new Promise(() => void 0);
|
|
200
|
+
if (!(e.method.toUpperCase() === "POST" && t)) return o(e);
|
|
201
|
+
let n = await e.clone().text(), r = R(e.clone()), s = F(n);
|
|
202
|
+
if (!s?.length) return o(e);
|
|
203
|
+
let c = n.trimStart().startsWith("["), l = s.map((e) => P(r, e));
|
|
204
|
+
if (L() && l.every(Boolean)) {
|
|
205
|
+
let e = g(), t = l.map((t) => e.get(t)), n = Date.now();
|
|
206
|
+
if (t.every((e) => e && e.expiresAt > n)) return I(t.map((e) => e.value), c);
|
|
180
207
|
}
|
|
181
|
-
let
|
|
182
|
-
if (!
|
|
208
|
+
let u = await o(e);
|
|
209
|
+
if (!u.ok || !l.some(Boolean) || !L()) return u;
|
|
183
210
|
try {
|
|
184
|
-
let e = await
|
|
211
|
+
let e = await u.clone().json(), t = Array.isArray(e) ? e : [e], n = g();
|
|
185
212
|
t.forEach((e, t) => {
|
|
186
|
-
let r =
|
|
213
|
+
let r = l[t];
|
|
187
214
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
188
215
|
value: e,
|
|
189
216
|
expiresAt: Date.now() + a
|
|
190
217
|
}));
|
|
191
218
|
});
|
|
192
219
|
} catch {}
|
|
193
|
-
return
|
|
194
|
-
},
|
|
195
|
-
if (e == null) return
|
|
220
|
+
return u;
|
|
221
|
+
}, p = o, m = ((e, t) => {
|
|
222
|
+
if (e == null) return o(e, t);
|
|
196
223
|
if (e instanceof Request) {
|
|
197
|
-
let n =
|
|
198
|
-
return
|
|
224
|
+
let n = d(e.url), r = new Request(n, e);
|
|
225
|
+
return f(t ? new Request(r, t) : r);
|
|
199
226
|
}
|
|
200
227
|
let n = typeof e == "string" ? e : e.toString();
|
|
201
|
-
return
|
|
228
|
+
return f(new Request(d(n), t));
|
|
202
229
|
});
|
|
203
|
-
|
|
230
|
+
p.preconnect && (m.preconnect = p.preconnect), globalThis.fetch = m;
|
|
204
231
|
}
|
|
205
|
-
function
|
|
232
|
+
function V(e = "VITE_VERBOSE_CONSOLE") {
|
|
206
233
|
({
|
|
207
234
|
BASE_URL: "/",
|
|
208
235
|
DEV: !1,
|
|
@@ -212,4 +239,4 @@ function L(e = "VITE_VERBOSE_CONSOLE") {
|
|
|
212
239
|
})?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
|
|
213
240
|
}
|
|
214
241
|
//#endregion
|
|
215
|
-
export {
|
|
242
|
+
export { _ as clearGatewayGraphQLResponseCache, B as installGatewayFetchRewrite, z as resolveGatewayBases, V as suppressConsole };
|