@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;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;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 = "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,46 @@ 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, 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 S(e, t) {
80
- let n = e.getItem(u), r = n ? Number(n) : 0;
81
- return Number.isFinite(r) && t - r < d;
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 C() {
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 w() {
92
- return window.location.hash ? !0 : f.has(window.location.pathname);
100
+ function D() {
101
+ return window.location.hash ? !0 : p.has(window.location.pathname);
93
102
  }
94
- function T(e, t) {
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 !1;
108
+ return null;
100
109
  }
101
- if (!n.searchParams.has(y)) return !1;
102
- n.searchParams.delete(y);
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(c, String(t)), e.removeItem(u);
114
+ e.setItem(S(i), String(t)), e.removeItem(C(i));
105
115
  } catch {}
106
- return window.history.replaceState(window.history.state, "", n.toString()), !0;
116
+ return window.history.replaceState(window.history.state, "", n.toString()), i;
107
117
  }
108
- function E(e) {
109
- if (typeof window > "u" || !v(e) || !_(window.location.hostname.toLowerCase())) return;
110
- let t = b();
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 (T(t, n) || w() || x(t, n) || S(t, n)) return;
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(u, String(n));
127
+ t.setItem(C(r), String(n));
116
128
  } catch {}
117
- let r = C(), i = new URL(s);
118
- i.searchParams.set("returnTo", r), window.location.replace(i.toString());
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 D(e) {
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 O(e) {
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 k(e) {
127
- return Object.fromEntries(m.map((t) => [t, e.get(t) ?? ""]));
140
+ function M(e) {
141
+ return Object.fromEntries(h.map((t) => [t, e.get(t) ?? ""]));
128
142
  }
129
- function A(e, t) {
130
- let n = O(t);
131
- return !n || !D(t) ? null : JSON.stringify({
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: k(e.headers),
147
+ headers: M(e.headers),
134
148
  operationName: n,
135
149
  variables: t.variables ?? null
136
150
  });
137
151
  }
138
- function j(e) {
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 M(e, t) {
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 N() {
166
+ function I() {
153
167
  return typeof performance < "u" && performance.now() < o;
154
168
  }
155
- function P(e) {
169
+ function L(e) {
156
170
  let t = new Headers(e.headers), n = !1;
157
- for (let e of p) t.has(e) && (t.delete(e), n = !0);
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 F(e, t) {
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 I(e, t) {
179
+ function z(e, t) {
166
180
  let { globalBase: n, workspaceBase: r } = e;
167
181
  if (!n || !r) return;
168
- E(e);
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 = P(e.clone()), r = j(t);
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) => 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);
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) || !N()) return c;
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 = h();
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 L(e = "VITE_VERBOSE_CONSOLE") {
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 { g as clearGatewayGraphQLResponseCache, I as installGatewayFetchRewrite, F as resolveGatewayBases, L as suppressConsole };
229
+ export { _ as clearGatewayGraphQLResponseCache, z as installGatewayFetchRewrite, R as resolveGatewayBases, B 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.4",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {