@burdenoff/fe-libs 2026.627.3 → 2026.628.1

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;AAmED,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAkED;;;;;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,CAqHN;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;AAgFD,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AA2ID;;;;;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"}
@@ -6,23 +6,38 @@ var t = {
6
6
  }, n = {
7
7
  globalBase: "https://alphagraphql.burdenoff.com",
8
8
  workspaceBase: "https://alphagraphqlworkspaces.burdenoff.com"
9
- }, r = [...e.flatMap((e) => [{
10
- hostname: `app.${e}`,
11
- bases: t
12
- }, {
13
- hostname: `alphaapp.${e}`,
14
- bases: n
15
- }]), {
16
- hostname: "admin.burdenoff.com",
17
- bases: t
18
- }], i = {
9
+ }, r = [
10
+ ...e.flatMap((e) => [{
11
+ hostname: `app.${e}`,
12
+ bases: t
13
+ }, {
14
+ hostname: `alphaapp.${e}`,
15
+ bases: n
16
+ }]),
17
+ {
18
+ hostname: "admin.burdenoff.com",
19
+ bases: t
20
+ },
21
+ {
22
+ hostname: "alphaadmin.burdenoff.com",
23
+ bases: n
24
+ }
25
+ ], i = {
19
26
  globalBase: "https://gw-global.local.burdenoff.com",
20
27
  workspaceBase: "https://gw-wspace.local.burdenoff.com"
21
- }, a = 15e3, o = 1e4, s = [
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([
29
+ "/auth/oauth/callback",
30
+ "/auth/session-bridge",
31
+ "/auth/sso-callback",
32
+ "/auth/sso-clear",
33
+ "/auth/sso-deposit",
34
+ "/auth/sso-relay",
35
+ "/auth/sso/callback"
36
+ ]), d = [
22
37
  "traceparent",
23
38
  "tracestate",
24
39
  "baggage"
25
- ], c = [
40
+ ], f = [
26
41
  "authorization",
27
42
  "accept-language",
28
43
  "x-org-id",
@@ -32,32 +47,78 @@ var t = {
32
47
  "x-geo-currency",
33
48
  "x-geo-timezone"
34
49
  ];
35
- function l() {
50
+ function p() {
36
51
  let e = globalThis;
37
52
  return e.__boffGraphQLResponseCache ||= /* @__PURE__ */ new Map(), e.__boffGraphQLResponseCache;
38
53
  }
39
- function u() {
40
- l().clear();
54
+ function m() {
55
+ p().clear();
56
+ }
57
+ function h(t) {
58
+ return t === "alphaadmin.burdenoff.com" || e.some((e) => t === `alphaapp.${e}`);
59
+ }
60
+ function g(e) {
61
+ try {
62
+ return new URL(e.globalBase).hostname === "alphagraphql.burdenoff.com" && new URL(e.workspaceBase).hostname === "alphagraphqlworkspaces.burdenoff.com";
63
+ } catch {
64
+ return !1;
65
+ }
66
+ }
67
+ function _() {
68
+ try {
69
+ return globalThis.sessionStorage ?? null;
70
+ } catch {
71
+ return null;
72
+ }
41
73
  }
42
- function d(e) {
74
+ function v(e, t) {
75
+ let n = e.getItem(c), r = n ? Number(n) : 0;
76
+ return Number.isFinite(r) && t - r < l;
77
+ }
78
+ function y() {
79
+ try {
80
+ let e = new URL(window.location.href || window.location.origin);
81
+ return e.hash = "", e.toString();
82
+ } catch {
83
+ return window.location.origin;
84
+ }
85
+ }
86
+ function b() {
87
+ return window.location.hash ? !0 : u.has(window.location.pathname);
88
+ }
89
+ function x(e) {
90
+ if (typeof window > "u" || !g(e) || !h(window.location.hostname.toLowerCase()) || b()) return;
91
+ let t = _();
92
+ if (!t) return;
93
+ let n = Date.now();
94
+ if (v(t, n)) return;
95
+ try {
96
+ t.setItem(c, String(n));
97
+ } catch {
98
+ return;
99
+ }
100
+ let r = y(), i = new URL(s);
101
+ i.searchParams.set("returnTo", r), window.location.replace(i.toString());
102
+ }
103
+ function S(e) {
43
104
  return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
44
105
  }
45
- function f(e) {
106
+ function C(e) {
46
107
  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;
47
108
  }
48
- function p(e) {
49
- return Object.fromEntries(c.map((t) => [t, e.get(t) ?? ""]));
109
+ function w(e) {
110
+ return Object.fromEntries(f.map((t) => [t, e.get(t) ?? ""]));
50
111
  }
51
- function m(e, t) {
52
- let n = f(t);
53
- return !n || !d(t) ? null : JSON.stringify({
112
+ function T(e, t) {
113
+ let n = C(t);
114
+ return !n || !S(t) ? null : JSON.stringify({
54
115
  url: e.url,
55
- headers: p(e.headers),
116
+ headers: w(e.headers),
56
117
  operationName: n,
57
118
  variables: t.variables ?? null
58
119
  });
59
120
  }
60
- function h(e) {
121
+ function E(e) {
61
122
  try {
62
123
  let t = JSON.parse(e);
63
124
  return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
@@ -65,44 +126,45 @@ function h(e) {
65
126
  return null;
66
127
  }
67
128
  }
68
- function g(e, t) {
129
+ function D(e, t) {
69
130
  return new Response(JSON.stringify(t ? e : e[0]), {
70
131
  status: 200,
71
132
  headers: { "content-type": "application/json" }
72
133
  });
73
134
  }
74
- function _() {
135
+ function O() {
75
136
  return typeof performance < "u" && performance.now() < o;
76
137
  }
77
- function v(e) {
138
+ function k(e) {
78
139
  let t = new Headers(e.headers), n = !1;
79
- for (let e of s) t.has(e) && (t.delete(e), n = !0);
140
+ for (let e of d) t.has(e) && (t.delete(e), n = !0);
80
141
  return n ? new Request(e, { headers: t }) : e;
81
142
  }
82
- function y(e, t) {
143
+ function A(e, t) {
83
144
  let n = window.location.hostname.toLowerCase(), a = [...r, ...e ?? []];
84
145
  for (let e of a) if (n === e.hostname) return e.bases;
85
146
  return t ?? i;
86
147
  }
87
- function b(e, t) {
148
+ function j(e, t) {
88
149
  let { globalBase: n, workspaceBase: r } = e;
89
150
  if (!n || !r) return;
90
- 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"]), u = (e) => /(?:^|\/)global\/graphql$/.test(e) ? "/global/graphql" : /(?:^|\/)workspaces\/graphql$/.test(e) ? "/workspaces/graphql" : "", d = (e) => {
91
- let t = new URL(e, window.location.origin), i = u(t.pathname);
151
+ x(e);
152
+ 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
+ let t = new URL(e, window.location.origin), i = l(t.pathname);
92
154
  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;
93
- }, f = async (e) => {
155
+ }, d = async (e) => {
94
156
  if (!(e.method.toUpperCase() === "POST" && /(?:^|\/)graphql$/.test(new URL(e.url).pathname))) return i(e);
95
- let t = await e.clone().text(), n = v(e.clone()), r = h(t);
157
+ let t = await e.clone().text(), n = k(e.clone()), r = E(t);
96
158
  if (!r?.length) return i(e);
97
- let o = t.trimStart().startsWith("["), s = r.map((e) => m(n, e));
98
- if (_() && s.every(Boolean)) {
99
- let e = l(), t = s.map((t) => e.get(t)), n = Date.now();
100
- if (t.every((e) => e && e.expiresAt > n)) return g(t.map((e) => e.value), o);
159
+ let o = t.trimStart().startsWith("["), s = r.map((e) => T(n, e));
160
+ if (O() && s.every(Boolean)) {
161
+ let e = p(), t = s.map((t) => e.get(t)), n = Date.now();
162
+ if (t.every((e) => e && e.expiresAt > n)) return D(t.map((e) => e.value), o);
101
163
  }
102
164
  let c = await i(e);
103
- if (!c.ok || !s.some(Boolean) || !_()) return c;
165
+ if (!c.ok || !s.some(Boolean) || !O()) return c;
104
166
  try {
105
- let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n = l();
167
+ let e = await c.clone().json(), t = Array.isArray(e) ? e : [e], n = p();
106
168
  t.forEach((e, t) => {
107
169
  let r = s[t];
108
170
  r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
@@ -112,18 +174,18 @@ function b(e, t) {
112
174
  });
113
175
  } catch {}
114
176
  return c;
115
- }, p = i, y = ((e, t) => {
177
+ }, f = i, m = ((e, t) => {
116
178
  if (e == null) return i(e, t);
117
179
  if (e instanceof Request) {
118
- let n = d(e.url), r = new Request(n, e);
119
- return f(t ? new Request(r, t) : r);
180
+ let n = u(e.url), r = new Request(n, e);
181
+ return d(t ? new Request(r, t) : r);
120
182
  }
121
183
  let n = typeof e == "string" ? e : e.toString();
122
- return f(new Request(d(n), t));
184
+ return d(new Request(u(n), t));
123
185
  });
124
- p.preconnect && (y.preconnect = p.preconnect), globalThis.fetch = y;
186
+ f.preconnect && (m.preconnect = f.preconnect), globalThis.fetch = m;
125
187
  }
126
- function x(e = "VITE_VERBOSE_CONSOLE") {
188
+ function M(e = "VITE_VERBOSE_CONSOLE") {
127
189
  ({
128
190
  BASE_URL: "/",
129
191
  DEV: !1,
@@ -133,4 +195,4 @@ function x(e = "VITE_VERBOSE_CONSOLE") {
133
195
  })?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
134
196
  }
135
197
  //#endregion
136
- export { u as clearGatewayGraphQLResponseCache, b as installGatewayFetchRewrite, y as resolveGatewayBases, x as suppressConsole };
198
+ export { m as clearGatewayGraphQLResponseCache, j as installGatewayFetchRewrite, A as resolveGatewayBases, M as suppressConsole };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.627.3",
3
+ "version": "2026.628.1",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {