@burdenoff/fe-libs 2026.904.2 → 2026.904.3
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.
- package/dist/shared/config/authBridgeUrls.d.ts.map +1 -1
- package/dist/shared/config/authBridgeUrls.js +16 -15
- package/dist/shared/config/gatewayUrls.d.ts +29 -0
- package/dist/shared/config/gatewayUrls.d.ts.map +1 -1
- package/dist/shared/config/gatewayUrls.js +44 -20
- package/dist/shared/config/index.d.ts.map +1 -1
- package/dist/shared/native/capacitor.d.ts +49 -0
- package/dist/shared/native/capacitor.d.ts.map +1 -0
- package/dist/shared/native/capacitor.js +31 -0
- package/dist/shared/native/index.d.ts +2 -0
- package/dist/shared/native/index.d.ts.map +1 -1
- package/dist/shared/providers/shell/MultiGatewayProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/MultiGatewayProvider.js +101 -100
- package/dist/shared/utils/authCookie.d.ts.map +1 -1
- package/dist/shared/utils/authCookie.js +35 -34
- package/dist/shared/utils/gatewayFetchRewrite.d.ts.map +1 -1
- package/dist/shared/utils/gatewayFetchRewrite.js +95 -87
- package/dist/shared-config.js +9 -1
- package/dist/shared-native.js +23 -22
- package/dist/shared.js +124 -123
- package/package.json +2 -2
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isCapacitorNative as e } from "../native/capacitor.js";
|
|
2
|
+
import { ALL_PRODUCT_DOMAINS as t } from "../config/gatewayUrls.js";
|
|
2
3
|
//#region src/shared/utils/authCookie.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
4
|
+
var n = ["bf-sso", "bf-sso-profile"], r = "bf-sso-profile";
|
|
5
|
+
function i(e, t = window.location.origin) {
|
|
5
6
|
return encodeURIComponent(JSON.stringify({
|
|
6
7
|
id: e,
|
|
7
8
|
origin: t
|
|
8
9
|
}));
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function a(e) {
|
|
11
12
|
try {
|
|
12
13
|
let t = JSON.parse(decodeURIComponent(e));
|
|
13
14
|
return typeof t == "string" ? {
|
|
@@ -24,66 +25,66 @@ function i(e) {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function o() {
|
|
28
29
|
return typeof window > "u" ? null : window.location.hostname.endsWith(".local.burdenoff.com") ? ".local.burdenoff.com" : null;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function s() {
|
|
31
32
|
if (typeof window > "u") return [];
|
|
32
|
-
let e = window.location.hostname, t = [], n =
|
|
33
|
+
let e = window.location.hostname, t = [], n = o();
|
|
33
34
|
return n && t.push(n), e && !["localhost", "127.0.0.1"].includes(e) && t.push(e), Array.from(new Set(t));
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
if (typeof window > "u") return !1;
|
|
37
|
-
let
|
|
38
|
-
return
|
|
36
|
+
function c() {
|
|
37
|
+
if (typeof window > "u" || e()) return !1;
|
|
38
|
+
let t = window.location.hostname;
|
|
39
|
+
return t.endsWith(".local.burdenoff.com") || t === "localhost" || t === "127.0.0.1";
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function l(e = window.location.hostname) {
|
|
41
42
|
return e === "localhost" || e === "127.0.0.1" || e === "0.0.0.0" || e === "[::1]" || e === "::1" || e.endsWith(".localhost") || e.endsWith(".local.burdenoff.com");
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
if (!
|
|
44
|
+
function u(e) {
|
|
45
|
+
if (!e) return !1;
|
|
45
46
|
try {
|
|
46
|
-
let n = new URL(
|
|
47
|
+
let n = new URL(e);
|
|
47
48
|
if (!["https:", "http:"].includes(n.protocol) || n.protocol === "http:" && !["localhost", "127.0.0.1"].includes(n.hostname)) return !1;
|
|
48
49
|
if (n.hostname === "localhost" || n.hostname === "127.0.0.1" || n.hostname.endsWith(".local.burdenoff.com")) return !0;
|
|
49
|
-
for (let
|
|
50
|
+
for (let e of t) if (n.hostname === e || n.hostname === `app.${e}` || n.hostname === `alphaapp.${e}` || n.hostname === `admin.${e}` || n.hostname === `alphaadmin.${e}` || n.hostname === `www.${e}`) return !0;
|
|
50
51
|
return !1;
|
|
51
52
|
} catch {
|
|
52
53
|
return !1;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function d(e, t = window.location.origin) {
|
|
56
57
|
if (typeof document > "u") return;
|
|
57
|
-
|
|
58
|
-
let
|
|
59
|
-
for (let e of
|
|
58
|
+
p();
|
|
59
|
+
let r = o(), a = r ? `; domain=${r}` : "", s = window.location.protocol === "https:" ? "; secure" : "", c = i(e, t);
|
|
60
|
+
for (let e of n) document.cookie = `${e}=${c}${a}; path=/; samesite=lax${s}; max-age=86400`;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function f() {
|
|
62
63
|
if (typeof document > "u") return null;
|
|
63
|
-
for (let e of
|
|
64
|
+
for (let e of n) {
|
|
64
65
|
let t = document.cookie.match(RegExp(`(?:^|;\\s*)${e}=([^;]*)`));
|
|
65
66
|
if (!t) continue;
|
|
66
|
-
let n =
|
|
67
|
+
let n = a(t[1]);
|
|
67
68
|
if (n?.id) return n;
|
|
68
69
|
}
|
|
69
70
|
return null;
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!(typeof document > "u")) for (let e of
|
|
72
|
+
function p() {
|
|
73
|
+
if (!(typeof document > "u")) for (let e of n) {
|
|
73
74
|
document.cookie = `${e}=; path=/; max-age=0`;
|
|
74
|
-
for (let t of
|
|
75
|
+
for (let t of s()) document.cookie = `${e}=; path=/; domain=${t}; max-age=0`;
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
78
|
+
function m(e) {
|
|
79
|
+
d(e);
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function h() {
|
|
81
82
|
if (typeof document > "u") return null;
|
|
82
|
-
let e = document.cookie.match(RegExp(`(?:^|;\\s*)${
|
|
83
|
-
return e ?
|
|
83
|
+
let e = document.cookie.match(RegExp(`(?:^|;\\s*)${r}=([^;]*)`));
|
|
84
|
+
return e ? a(e[1])?.id ?? null : null;
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
86
|
+
function g() {
|
|
87
|
+
p();
|
|
87
88
|
}
|
|
88
89
|
//#endregion
|
|
89
|
-
export {
|
|
90
|
+
export { g as clearSSoCookie, p as clearShellSsoCookies, h as getSSoCookie, l as isLocalDevSsoHost, c as isSharedSsoCookieDomain, u as isTrustedSsoOrigin, f as readShellSsoCookie, m as setSSoCookie, d as setShellSsoCookies };
|
|
@@ -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;AAgHD,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAkPD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,kBAAkB,EAAE,EACpC,aAAa,CAAC,EAAE,YAAY,GAC3B,YAAY,CAiCd;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"}
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { isCapacitorNative as e } from "../native/capacitor.js";
|
|
2
|
+
import { getDesktopGatewayBases as t } from "../native/desktop.js";
|
|
3
|
+
import { ALL_PRODUCT_DOMAINS as n, resolveNativeDeployTarget as r } from "../config/gatewayUrls.js";
|
|
3
4
|
//#region src/shared/utils/gatewayFetchRewrite.ts
|
|
4
|
-
var
|
|
5
|
+
var i = {
|
|
5
6
|
globalBase: "https://graphql.burdenoff.com",
|
|
6
7
|
workspaceBase: "https://graphqlworkspaces.burdenoff.com"
|
|
7
8
|
};
|
|
8
|
-
function
|
|
9
|
+
function a(e) {
|
|
9
10
|
let t = `https://${e}`;
|
|
10
11
|
return {
|
|
11
12
|
globalBase: t,
|
|
12
13
|
workspaceBase: t
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
...
|
|
16
|
+
var o = [
|
|
17
|
+
...n.flatMap((e) => [{
|
|
17
18
|
hostname: `app.${e}`,
|
|
18
|
-
bases:
|
|
19
|
+
bases: i
|
|
19
20
|
}, {
|
|
20
21
|
hostname: `alphaapp.${e}`,
|
|
21
|
-
bases:
|
|
22
|
+
bases: a(`alphaapp.${e}`)
|
|
22
23
|
}]),
|
|
23
24
|
{
|
|
24
25
|
hostname: "admin.burdenoff.com",
|
|
25
|
-
bases:
|
|
26
|
+
bases: i
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
hostname: "alphaadmin.burdenoff.com",
|
|
29
|
-
bases:
|
|
30
|
+
bases: a("alphaadmin.burdenoff.com")
|
|
30
31
|
}
|
|
31
|
-
],
|
|
32
|
+
], s = {
|
|
33
|
+
globalBase: "https://alphagraphql.burdenoff.com",
|
|
34
|
+
workspaceBase: "https://alphagraphqlworkspaces.burdenoff.com"
|
|
35
|
+
}, c = {
|
|
32
36
|
globalBase: "https://gw-global.local.burdenoff.com",
|
|
33
37
|
workspaceBase: "https://gw-wspace.local.burdenoff.com"
|
|
34
|
-
},
|
|
38
|
+
}, l = 15e3, u = 1e4, d = {
|
|
35
39
|
global: "https://alphagraphql.burdenoff.com/__cf-access-prime",
|
|
36
40
|
workspace: "https://alphagraphqlworkspaces.burdenoff.com/__cf-access-prime"
|
|
37
|
-
},
|
|
41
|
+
}, f = ["global", "workspace"], p = "bf-alpha-api-access-primed", m = 1200 * 60 * 1e3, h = "bf-alpha-api-access-prime-attempted", g = 15e3, _ = new Set([
|
|
38
42
|
"/auth/oauth/callback",
|
|
39
43
|
"/auth/session-bridge",
|
|
40
44
|
"/auth/sso-callback",
|
|
@@ -42,11 +46,11 @@ var i = [
|
|
|
42
46
|
"/auth/sso-deposit",
|
|
43
47
|
"/auth/sso-relay",
|
|
44
48
|
"/auth/sso/callback"
|
|
45
|
-
]),
|
|
49
|
+
]), v = [
|
|
46
50
|
"traceparent",
|
|
47
51
|
"tracestate",
|
|
48
52
|
"baggage"
|
|
49
|
-
],
|
|
53
|
+
], y = [
|
|
50
54
|
"authorization",
|
|
51
55
|
"accept-language",
|
|
52
56
|
"x-org-id",
|
|
@@ -56,53 +60,53 @@ var i = [
|
|
|
56
60
|
"x-geo-currency",
|
|
57
61
|
"x-geo-timezone"
|
|
58
62
|
];
|
|
59
|
-
function
|
|
63
|
+
function b() {
|
|
60
64
|
let e = globalThis;
|
|
61
65
|
return e.__boffGraphQLResponseCache ||= /* @__PURE__ */ new Map(), e.__boffGraphQLResponseCache;
|
|
62
66
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
67
|
+
function x() {
|
|
68
|
+
b().clear();
|
|
65
69
|
}
|
|
66
|
-
function
|
|
67
|
-
return e === "alphaadmin.burdenoff.com" ||
|
|
70
|
+
function S(e) {
|
|
71
|
+
return e === "alphaadmin.burdenoff.com" || n.some((t) => e === `alphaapp.${t}`);
|
|
68
72
|
}
|
|
69
|
-
function
|
|
73
|
+
function C(e) {
|
|
70
74
|
try {
|
|
71
75
|
return new URL(e.globalBase).hostname === "alphagraphql.burdenoff.com" && new URL(e.workspaceBase).hostname === "alphagraphqlworkspaces.burdenoff.com";
|
|
72
76
|
} catch {
|
|
73
77
|
return !1;
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
|
-
var
|
|
77
|
-
function
|
|
80
|
+
var w = "cf_primed";
|
|
81
|
+
function T() {
|
|
78
82
|
try {
|
|
79
83
|
return globalThis.sessionStorage ?? null;
|
|
80
84
|
} catch {
|
|
81
85
|
return null;
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
|
-
function
|
|
85
|
-
return `${
|
|
88
|
+
function E(e) {
|
|
89
|
+
return `${p}-${e}-at`;
|
|
86
90
|
}
|
|
87
|
-
function
|
|
88
|
-
return `${
|
|
91
|
+
function D(e) {
|
|
92
|
+
return `${h}-${e}-at`;
|
|
89
93
|
}
|
|
90
|
-
function
|
|
94
|
+
function O(e) {
|
|
91
95
|
try {
|
|
92
|
-
return
|
|
96
|
+
return f.find((t) => e.getItem(D(t)) !== null) ?? null;
|
|
93
97
|
} catch {
|
|
94
98
|
return null;
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
|
-
function
|
|
98
|
-
let r = e.getItem(
|
|
99
|
-
return Number.isFinite(i) && n - i <
|
|
101
|
+
function k(e, t, n) {
|
|
102
|
+
let r = e.getItem(E(t)), i = r ? Number(r) : 0;
|
|
103
|
+
return Number.isFinite(i) && n - i < m;
|
|
100
104
|
}
|
|
101
|
-
function
|
|
102
|
-
let r = e.getItem(
|
|
103
|
-
return Number.isFinite(i) && n - i <
|
|
105
|
+
function A(e, t, n) {
|
|
106
|
+
let r = e.getItem(D(t)), i = r ? Number(r) : 0;
|
|
107
|
+
return Number.isFinite(i) && n - i < g;
|
|
104
108
|
}
|
|
105
|
-
function
|
|
109
|
+
function j() {
|
|
106
110
|
try {
|
|
107
111
|
let e = new URL(window.location.href || window.location.origin);
|
|
108
112
|
return e.hash = "", e.toString();
|
|
@@ -110,38 +114,38 @@ function O() {
|
|
|
110
114
|
return window.location.origin;
|
|
111
115
|
}
|
|
112
116
|
}
|
|
113
|
-
function
|
|
114
|
-
return window.location.hash ? !0 :
|
|
117
|
+
function M() {
|
|
118
|
+
return window.location.hash ? !0 : _.has(window.location.pathname);
|
|
115
119
|
}
|
|
116
|
-
function
|
|
120
|
+
function N(e, t) {
|
|
117
121
|
let n;
|
|
118
122
|
try {
|
|
119
123
|
n = new URL(window.location.href);
|
|
120
124
|
} catch {
|
|
121
125
|
return null;
|
|
122
126
|
}
|
|
123
|
-
let r = n.searchParams.get(
|
|
127
|
+
let r = n.searchParams.get(w), i = r === "global" ? "global" : r === "workspace" ? "workspace" : r === "1" ? O(e) ?? "global" : null;
|
|
124
128
|
if (!i) return null;
|
|
125
|
-
n.searchParams.delete(
|
|
129
|
+
n.searchParams.delete(w);
|
|
126
130
|
try {
|
|
127
|
-
e.setItem(
|
|
131
|
+
e.setItem(E(i), String(t)), e.removeItem(D(i));
|
|
128
132
|
} catch {}
|
|
129
133
|
return window.history.replaceState(window.history.state, "", n.toString()), i;
|
|
130
134
|
}
|
|
131
|
-
function
|
|
132
|
-
if (typeof window > "u" || !
|
|
133
|
-
let t =
|
|
135
|
+
function P(e) {
|
|
136
|
+
if (typeof window > "u" || !C(e) || !S(window.location.hostname.toLowerCase())) return !1;
|
|
137
|
+
let t = T();
|
|
134
138
|
if (!t) return !1;
|
|
135
139
|
let n = Date.now();
|
|
136
|
-
if (
|
|
137
|
-
let r =
|
|
138
|
-
if (!r ||
|
|
140
|
+
if (N(t, n), M()) return !1;
|
|
141
|
+
let r = f.find((e) => !k(t, e, n));
|
|
142
|
+
if (!r || A(t, r, n)) return !1;
|
|
139
143
|
try {
|
|
140
|
-
t.setItem(
|
|
144
|
+
t.setItem(D(r), String(n));
|
|
141
145
|
} catch {}
|
|
142
|
-
let i = new URL(
|
|
143
|
-
r === "workspace" && i.searchParams.set(
|
|
144
|
-
let a = new URL(
|
|
146
|
+
let i = new URL(j());
|
|
147
|
+
r === "workspace" && i.searchParams.set(w, r);
|
|
148
|
+
let a = new URL(d[r]);
|
|
145
149
|
a.searchParams.set("returnTo", i.toString());
|
|
146
150
|
try {
|
|
147
151
|
return window.location.replace(a.toString()), !0;
|
|
@@ -149,25 +153,25 @@ function j(e) {
|
|
|
149
153
|
return !1;
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
|
-
function
|
|
156
|
+
function F(e) {
|
|
153
157
|
return typeof e.query == "string" ? /\bquery\b/.test(e.query) && !/\bmutation\b|\bsubscription\b/.test(e.query) : !1;
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function I(e) {
|
|
156
160
|
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;
|
|
157
161
|
}
|
|
158
|
-
function
|
|
159
|
-
return Object.fromEntries(
|
|
162
|
+
function L(e) {
|
|
163
|
+
return Object.fromEntries(y.map((t) => [t, e.get(t) ?? ""]));
|
|
160
164
|
}
|
|
161
|
-
function
|
|
162
|
-
let n =
|
|
163
|
-
return !n || !
|
|
165
|
+
function R(e, t) {
|
|
166
|
+
let n = I(t);
|
|
167
|
+
return !n || !F(t) ? null : JSON.stringify({
|
|
164
168
|
url: e.url,
|
|
165
|
-
headers:
|
|
169
|
+
headers: L(e.headers),
|
|
166
170
|
operationName: n,
|
|
167
171
|
variables: t.variables ?? null
|
|
168
172
|
});
|
|
169
173
|
}
|
|
170
|
-
function
|
|
174
|
+
function z(e) {
|
|
171
175
|
try {
|
|
172
176
|
let t = JSON.parse(e);
|
|
173
177
|
return Array.isArray(t) ? t : t && typeof t == "object" ? [t] : null;
|
|
@@ -175,53 +179,57 @@ function I(e) {
|
|
|
175
179
|
return null;
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
|
-
function
|
|
182
|
+
function B(e, t) {
|
|
179
183
|
return new Response(JSON.stringify(t ? e : e[0]), {
|
|
180
184
|
status: 200,
|
|
181
185
|
headers: { "content-type": "application/json" }
|
|
182
186
|
});
|
|
183
187
|
}
|
|
184
|
-
function
|
|
185
|
-
return typeof performance < "u" && performance.now() <
|
|
188
|
+
function V() {
|
|
189
|
+
return typeof performance < "u" && performance.now() < u;
|
|
186
190
|
}
|
|
187
|
-
function
|
|
191
|
+
function H(e) {
|
|
188
192
|
let t = new Headers(e.headers), n = !1;
|
|
189
|
-
for (let e of
|
|
193
|
+
for (let e of v) t.has(e) && (t.delete(e), n = !0);
|
|
190
194
|
return n ? new Request(e, { headers: t }) : e;
|
|
191
195
|
}
|
|
192
|
-
function
|
|
193
|
-
let
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
function U(n, a) {
|
|
197
|
+
let l = t();
|
|
198
|
+
if (l) return l;
|
|
199
|
+
if (e()) {
|
|
200
|
+
let e = r();
|
|
201
|
+
return e === "local" ? a ?? c : e === "alpha" ? s : i;
|
|
202
|
+
}
|
|
203
|
+
let u = window.location.hostname.toLowerCase(), d = [...o, ...n ?? []];
|
|
204
|
+
for (let e of d) if (u === e.hostname) return e.bases;
|
|
205
|
+
return a ?? c;
|
|
198
206
|
}
|
|
199
|
-
function
|
|
207
|
+
function W(e, t) {
|
|
200
208
|
let { globalBase: n, workspaceBase: r } = e;
|
|
201
209
|
if (!n || !r) return;
|
|
202
|
-
let i =
|
|
210
|
+
let i = P(e), a = 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) => {
|
|
203
211
|
let t = new URL(e, window.location.origin), i = u(t.pathname);
|
|
204
|
-
return i === "/global/graphql" &&
|
|
212
|
+
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;
|
|
205
213
|
}, f = async (e) => {
|
|
206
214
|
let t = /(?:^|\/)graphql$/.test(new URL(e.url).pathname);
|
|
207
215
|
if (i && t) return new Promise(() => void 0);
|
|
208
216
|
if (!(e.method.toUpperCase() === "POST" && t)) return a(e);
|
|
209
|
-
let n = await e.clone().text(), r =
|
|
210
|
-
if (!
|
|
211
|
-
let
|
|
212
|
-
if (
|
|
213
|
-
let e =
|
|
214
|
-
if (t.every((e) => e && e.expiresAt > n)) return
|
|
217
|
+
let n = await e.clone().text(), r = H(e.clone()), o = z(n);
|
|
218
|
+
if (!o?.length) return a(e);
|
|
219
|
+
let s = n.trimStart().startsWith("["), c = o.map((e) => R(r, e));
|
|
220
|
+
if (V() && c.every(Boolean)) {
|
|
221
|
+
let e = b(), t = c.map((t) => e.get(t)), n = Date.now();
|
|
222
|
+
if (t.every((e) => e && e.expiresAt > n)) return B(t.map((e) => e.value), s);
|
|
215
223
|
}
|
|
216
224
|
let u = await a(e);
|
|
217
|
-
if (!u.ok || !
|
|
225
|
+
if (!u.ok || !c.some(Boolean) || !V()) return u;
|
|
218
226
|
try {
|
|
219
|
-
let e = await u.clone().json(), t = Array.isArray(e) ? e : [e], n =
|
|
227
|
+
let e = await u.clone().json(), t = Array.isArray(e) ? e : [e], n = b();
|
|
220
228
|
t.forEach((e, t) => {
|
|
221
|
-
let r =
|
|
229
|
+
let r = c[t];
|
|
222
230
|
r && (e && typeof e == "object" && "errors" in e && Array.isArray(e.errors) || n.set(r, {
|
|
223
231
|
value: e,
|
|
224
|
-
expiresAt: Date.now() +
|
|
232
|
+
expiresAt: Date.now() + l
|
|
225
233
|
}));
|
|
226
234
|
});
|
|
227
235
|
} catch {}
|
|
@@ -237,7 +245,7 @@ function V(e, t) {
|
|
|
237
245
|
});
|
|
238
246
|
p.preconnect && (m.preconnect = p.preconnect), globalThis.fetch = m;
|
|
239
247
|
}
|
|
240
|
-
function
|
|
248
|
+
function G(e = "VITE_VERBOSE_CONSOLE") {
|
|
241
249
|
({
|
|
242
250
|
BASE_URL: "/",
|
|
243
251
|
DEV: !1,
|
|
@@ -247,4 +255,4 @@ function H(e = "VITE_VERBOSE_CONSOLE") {
|
|
|
247
255
|
})?.[e] !== "true" && (console.log = () => {}, console.info = () => {}, console.debug = () => {});
|
|
248
256
|
}
|
|
249
257
|
//#endregion
|
|
250
|
-
export {
|
|
258
|
+
export { x as clearGatewayGraphQLResponseCache, W as installGatewayFetchRewrite, U as resolveGatewayBases, G as suppressConsole };
|
package/dist/shared-config.js
CHANGED
|
@@ -24,8 +24,16 @@ function g(e) {
|
|
|
24
24
|
return m[e];
|
|
25
25
|
}
|
|
26
26
|
function _(e, t) {
|
|
27
|
-
let n = m[t], r = e || n.defaultBaseUrl;
|
|
27
|
+
let n = m[t], r = e || v(t) || n.defaultBaseUrl;
|
|
28
28
|
return `${r.endsWith("/") ? r.slice(0, -1) : r}${n.graphql}`;
|
|
29
29
|
}
|
|
30
|
+
function v(t) {
|
|
31
|
+
try {
|
|
32
|
+
let n = e();
|
|
33
|
+
return t === "workspace" ? n.workspaceBaseUrl : n.globalBaseUrl;
|
|
34
|
+
} catch {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
30
38
|
//#endregion
|
|
31
39
|
export { s as COMMON_SHELL_LESS_ROUTES, p as DEFAULT_PAGE_SIZE, c as DEFAULT_SHELL_CONFIG, m as GATEWAYS, r as PRODUCTS, i as PRODUCT_URLS, g as getGatewayConfig, _ as getGatewayUrl, h as getGraphQLEndpoint, a as getProductUrl, o as getProductsWithUrls, l as getShellConfig, u as isShellLessRoute, t as resolveAuthBridgeConfig, e as resolveGatewayUrls, n as resolveShellAuthBridgeConfig, d as shouldShowBreadcrumb, f as shouldShowSidebar };
|
package/dist/shared-native.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
import { getCapacitorPlatform as e, isCapacitorNative as t } from "./shared/native/capacitor.js";
|
|
2
|
+
import { DESKTOP_UPDATE_UNSUPPORTED as n, DESKTOP_WINDOW_STATE_DEFAULT as r, bootDesktopShell as i, desktopCheckForUpdates as a, desktopDeepLinkToPath as o, desktopInstallUpdate as s, desktopNotify as c, desktopOpenExternal as l, desktopSetBadgeCount as u, desktopSetLocale as d, desktopSetTheme as f, desktopSetTrayQuickActions as p, getDesktopAuthBridgeConfig as m, getDesktopBridge as h, getDesktopGatewayBases as g, getDesktopGatewayUrls as _, getDesktopRuntimeConfig as v, getDesktopUpdateState as y, getDesktopWindowState as b, getLegacyDesktopRuntime as x, installDesktopDeepLinkHandler as S, installDesktopNavigateHandler as C, isDesktop as w, onDesktopUpdateState as T, onDesktopWindowState as E, registerDesktopNavigator as D } from "./shared/native/desktop.js";
|
|
3
|
+
import { getNativeBridge as O } from "./shared/native/bridge.js";
|
|
4
|
+
import { getPlatform as k, isAndroid as A, isElectron as j, isIOS as M, isInstalledApp as N, isNative as P, isStandalonePWA as F, isWeb as I, isWebBrowser as L } from "./shared/native/platform.js";
|
|
5
|
+
import { nativeActionSheet as R, nativeConfirm as z, nativeCopyText as B, nativeImpact as V, nativeNotify as H, nativeOpenUrl as U, nativeSelection as W, nativeShare as G, nativeToast as K } from "./shared/native/consumers.js";
|
|
6
|
+
import { SafeAreaView as q } from "./shared/native/SafeAreaView.js";
|
|
7
|
+
import { readInitialNetworkStatus as J, reduceNetworkStatus as Y, useNetworkStatus as X } from "./shared/native/hooks/useNetworkStatus.js";
|
|
8
|
+
import { PULL_TO_REFRESH_THRESHOLD as Z, computePullOffset as Q, computePullProgress as $, usePullToRefresh as ee } from "./shared/native/hooks/usePullToRefresh.js";
|
|
9
|
+
import { useNativePlatform as te } from "./shared/native/hooks/useNativePlatform.js";
|
|
10
|
+
import { useSafeArea as ne } from "./shared/native/hooks/useSafeArea.js";
|
|
11
|
+
import { useNativeKeyboard as re } from "./shared/native/hooks/useNativeKeyboard.js";
|
|
12
|
+
import { useAppState as ie } from "./shared/native/hooks/useAppState.js";
|
|
13
|
+
import { useDeviceInfo as ae } from "./shared/native/hooks/useDeviceInfo.js";
|
|
14
|
+
import { useHaptics as oe } from "./shared/native/hooks/useHaptics.js";
|
|
15
|
+
import { useStatusBar as se } from "./shared/native/hooks/useStatusBar.js";
|
|
16
|
+
import { resolveActionSheetOutcome as ce, useActionSheet as le } from "./shared/native/hooks/useActionSheet.js";
|
|
17
|
+
import { useDesktop as ue } from "./shared/native/hooks/useDesktop.js";
|
|
18
|
+
import { useDesktopUpdateState as de } from "./shared/native/hooks/useDesktopUpdateState.js";
|
|
19
|
+
import { useDesktopWindowState as fe } from "./shared/native/hooks/useDesktopWindowState.js";
|
|
19
20
|
import "./shared/native/hooks/index.js";
|
|
20
|
-
import { acknowledgeNativePurchase as
|
|
21
|
-
import { getNativeEntryRoutes as
|
|
22
|
-
import { getPushOptInController as
|
|
23
|
-
export {
|
|
21
|
+
import { acknowledgeNativePurchase as pe, getNativeProducts as me, getNativePurchases as he, installNativeIAP as ge, isNativeIAPAvailable as _e, purchaseNativeProduct as ve, restoreNativePurchases as ye } from "./shared/native/purchases.js";
|
|
22
|
+
import { getNativeEntryRoutes as be, shouldShowNativeWelcome as xe } from "./shared/native/entry.js";
|
|
23
|
+
import { getPushOptInController as Se, registerPushOptInController as Ce } from "./shared/native/push-optin.js";
|
|
24
|
+
export { n as DESKTOP_UPDATE_UNSUPPORTED, r as DESKTOP_WINDOW_STATE_DEFAULT, Z as PULL_TO_REFRESH_THRESHOLD, q as SafeAreaView, pe as acknowledgeNativePurchase, i as bootDesktopShell, Q as computePullOffset, $ as computePullProgress, a as desktopCheckForUpdates, o as desktopDeepLinkToPath, s as desktopInstallUpdate, c as desktopNotify, l as desktopOpenExternal, u as desktopSetBadgeCount, d as desktopSetLocale, f as desktopSetTheme, p as desktopSetTrayQuickActions, e as getCapacitorPlatform, m as getDesktopAuthBridgeConfig, h as getDesktopBridge, g as getDesktopGatewayBases, _ as getDesktopGatewayUrls, v as getDesktopRuntimeConfig, y as getDesktopUpdateState, b as getDesktopWindowState, x as getLegacyDesktopRuntime, O as getNativeBridge, be as getNativeEntryRoutes, me as getNativeProducts, he as getNativePurchases, k as getPlatform, Se as getPushOptInController, S as installDesktopDeepLinkHandler, C as installDesktopNavigateHandler, ge as installNativeIAP, A as isAndroid, t as isCapacitorNative, w as isDesktop, j as isElectron, M as isIOS, N as isInstalledApp, P as isNative, _e as isNativeIAPAvailable, F as isStandalonePWA, I as isWeb, L as isWebBrowser, R as nativeActionSheet, z as nativeConfirm, B as nativeCopyText, V as nativeImpact, H as nativeNotify, U as nativeOpenUrl, W as nativeSelection, G as nativeShare, K as nativeToast, T as onDesktopUpdateState, E as onDesktopWindowState, ve as purchaseNativeProduct, J as readInitialNetworkStatus, Y as reduceNetworkStatus, D as registerDesktopNavigator, Ce as registerPushOptInController, ce as resolveActionSheetOutcome, ye as restoreNativePurchases, xe as shouldShowNativeWelcome, le as useActionSheet, ie as useAppState, ue as useDesktop, de as useDesktopUpdateState, fe as useDesktopWindowState, ae as useDeviceInfo, oe as useHaptics, re as useNativeKeyboard, te as useNativePlatform, X as useNetworkStatus, ee as usePullToRefresh, ne as useSafeArea, se as useStatusBar };
|