@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;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"}
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 = "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([
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
- ]), p = [
39
+ ]), m = [
37
40
  "traceparent",
38
41
  "tracestate",
39
42
  "baggage"
40
- ], m = [
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 h() {
53
+ function g() {
51
54
  let e = globalThis;
52
55
  return e.__boffGraphQLResponseCache ||= /* @__PURE__ */ new Map(), e.__boffGraphQLResponseCache;
53
56
  }
54
- function g() {
55
- h().clear();
57
+ function _() {
58
+ g().clear();
56
59
  }
57
- function _(t) {
60
+ function v(t) {
58
61
  return t === "alphaadmin.burdenoff.com" || e.some((e) => t === `alphaapp.${e}`);
59
62
  }
60
- function v(e) {
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 y = "cf_primed";
68
- function b() {
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 x(e, t) {
76
- let n = e.getItem(c), r = n ? Number(n) : 0;
77
- return Number.isFinite(r) && t - r < l;
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 S(e, t) {
80
- let n = e.getItem(u), r = n ? Number(n) : 0;
81
- return Number.isFinite(r) && t - r < d;
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 C() {
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 w() {
92
- return window.location.hash ? !0 : f.has(window.location.pathname);
107
+ function O() {
108
+ return window.location.hash ? !0 : p.has(window.location.pathname);
93
109
  }
94
- function T(e, t) {
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 !1;
115
+ return null;
100
116
  }
101
- if (!n.searchParams.has(y)) return !1;
102
- n.searchParams.delete(y);
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(c, String(t)), e.removeItem(u);
121
+ e.setItem(S(i), String(t)), e.removeItem(C(i));
105
122
  } catch {}
106
- return window.history.replaceState(window.history.state, "", n.toString()), !0;
123
+ return window.history.replaceState(window.history.state, "", n.toString()), i;
107
124
  }
108
- function E(e) {
109
- if (typeof window > "u" || !v(e) || !_(window.location.hostname.toLowerCase())) return;
110
- let t = b();
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 (T(t, n) || w() || x(t, n) || S(t, n)) return;
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(u, String(n));
134
+ t.setItem(C(r), String(n));
116
135
  } catch {}
117
- let r = C(), i = new URL(s);
118
- i.searchParams.set("returnTo", r), window.location.replace(i.toString());
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 D(e) {
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 O(e) {
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 k(e) {
127
- return Object.fromEntries(m.map((t) => [t, e.get(t) ?? ""]));
152
+ function N(e) {
153
+ return Object.fromEntries(h.map((t) => [t, e.get(t) ?? ""]));
128
154
  }
129
- function A(e, t) {
130
- let n = O(t);
131
- return !n || !D(t) ? null : JSON.stringify({
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: k(e.headers),
159
+ headers: N(e.headers),
134
160
  operationName: n,
135
161
  variables: t.variables ?? null
136
162
  });
137
163
  }
138
- function j(e) {
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 M(e, t) {
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 N() {
178
+ function L() {
153
179
  return typeof performance < "u" && performance.now() < o;
154
180
  }
155
- function P(e) {
181
+ function R(e) {
156
182
  let t = new Headers(e.headers), n = !1;
157
- for (let e of p) t.has(e) && (t.delete(e), n = !0);
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 F(e, t) {
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 I(e, t) {
191
+ function B(e, t) {
166
192
  let { globalBase: n, workspaceBase: r } = e;
167
193
  if (!n || !r) return;
168
- E(e);
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) => {
170
- let t = new URL(e, window.location.origin), i = l(t.pathname);
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;
172
- }, d = async (e) => {
173
- if (!(e.method.toUpperCase() === "POST" && /(?:^|\/)graphql$/.test(new URL(e.url).pathname))) return i(e);
174
- let t = await e.clone().text(), n = P(e.clone()), r = j(t);
175
- if (!r?.length) return i(e);
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);
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 c = await i(e);
182
- if (!c.ok || !s.some(Boolean) || !N()) return c;
208
+ let u = await o(e);
209
+ if (!u.ok || !l.some(Boolean) || !L()) return u;
183
210
  try {
184
- let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n = h();
211
+ let e = await u.clone().json(), t = Array.isArray(e) ? e : [e], n = g();
185
212
  t.forEach((e, t) => {
186
- let r = s[t];
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 c;
194
- }, f = i, p = ((e, t) => {
195
- if (e == null) return i(e, t);
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 = u(e.url), r = new Request(n, e);
198
- return d(t ? new Request(r, t) : r);
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 d(new Request(u(n), t));
228
+ return f(new Request(d(n), t));
202
229
  });
203
- f.preconnect && (p.preconnect = f.preconnect), globalThis.fetch = p;
230
+ p.preconnect && (m.preconnect = p.preconnect), globalThis.fetch = m;
204
231
  }
205
- function L(e = "VITE_VERBOSE_CONSOLE") {
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 { g as clearGatewayGraphQLResponseCache, I as installGatewayFetchRewrite, F as resolveGatewayBases, L as suppressConsole };
242
+ export { _ as clearGatewayGraphQLResponseCache, B as installGatewayFetchRewrite, z as resolveGatewayBases, V as suppressConsole };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.715.3",
3
+ "version": "2026.715.5",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {