@burdenoff/fe-libs 2026.717.6 → 2026.718.2
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/providers/shell/ActiveContextProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/ActiveContextProvider.js +30 -29
- package/dist/shared/providers/shell/AuthProvider.d.ts +3 -1
- package/dist/shared/providers/shell/AuthProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/AuthProvider.js +87 -86
- package/dist/shared/providers/shell/authProvider/useAuthActions.d.ts +16 -1
- package/dist/shared/providers/shell/authProvider/useAuthActions.d.ts.map +1 -1
- package/dist/shared/providers/shell/authProvider/useAuthActions.js +8 -7
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.d.ts +3 -1
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.d.ts.map +1 -1
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +1 -1
- package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.d.ts +14 -0
- package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.d.ts.map +1 -0
- package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.js +52 -0
- package/dist/shared/utils/index.d.ts +2 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/ssoDeposit.d.ts +92 -0
- package/dist/shared/utils/ssoDeposit.d.ts.map +1 -0
- package/dist/shared/utils/ssoDeposit.js +118 -0
- package/dist/shared-utils.js +10 -9
- package/dist/shared.js +92 -91
- package/dist/utils/index.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveContextProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/ActiveContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ActiveContextProvider.d.ts","sourceRoot":"","sources":["../../../../src/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kB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,wBAAwB;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB;IACtB,SAAS,CAAC,EAAE;QACV,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAiCD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,qBAA4B,EAC5B,kBAAyB,EACzB,gBAAuB,EACvB,eAAsB,EACtB,UAAuC,EACvC,SAAiB,EACjB,SAA6C,GAC9C,EAAE,0BAA0B,2CAkS5B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,uBAM/B"}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { getProfileContext as e, resolveActiveProfileId as t, setProfileContext as n } from "./ProfileStorageManager.js";
|
|
2
2
|
import { ACTIVE_CONTEXT_STORAGE_KEY as r, DEFAULT_ACTIVE_CONTEXT_URL_PARAMS as i, clearActiveContextStorage as a, getUrlParam as o, readActiveContextStorageValue as s, writeActiveContextFallback as c, writeActiveContextStorageValue as l } from "./ActiveContextStorage.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { isSsoNavigationPending as u } from "../../utils/ssoDeposit.js";
|
|
4
|
+
import { createContext as d, use as f, useCallback as p, useEffect as m, useMemo as h, useState as g } from "react";
|
|
5
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
5
6
|
//#region src/shared/providers/shell/ActiveContextProvider.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
if (typeof window > "u") return;
|
|
7
|
+
var v = d(null);
|
|
8
|
+
function y(e) {
|
|
9
|
+
if (typeof window > "u" || u() || window.location.pathname.startsWith("/auth/")) return;
|
|
9
10
|
let t = new URL(window.location.href);
|
|
10
11
|
Object.entries(e).forEach(([e, n]) => {
|
|
11
12
|
n ? t.searchParams.set(e, n) : t.searchParams.delete(e);
|
|
12
13
|
}), window.history.replaceState({}, "", t.toString());
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let [T, E] =
|
|
15
|
+
function b({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: f = null, defaultProjectId: b = null, defaultTenantId: x = null, storageKey: S = r, syncToUrl: C = !1, urlParams: w = i }) {
|
|
16
|
+
let [T, E] = g(() => {
|
|
16
17
|
if (typeof window > "u") return d;
|
|
17
18
|
if (C) {
|
|
18
19
|
let e = o(w.organization);
|
|
19
20
|
if (e) return e;
|
|
20
21
|
}
|
|
21
22
|
return s("organization", S) || d;
|
|
22
|
-
}), [D, O] =
|
|
23
|
-
if (typeof window > "u") return
|
|
23
|
+
}), [D, O] = g(() => {
|
|
24
|
+
if (typeof window > "u") return f;
|
|
24
25
|
if (C) {
|
|
25
26
|
let e = o(w.workspace);
|
|
26
27
|
if (e) return e;
|
|
27
28
|
}
|
|
28
|
-
let r = s("workspace", S) ||
|
|
29
|
+
let r = s("workspace", S) || f;
|
|
29
30
|
if (r) {
|
|
30
31
|
let i = t();
|
|
31
32
|
if (i) {
|
|
@@ -37,14 +38,14 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
return r;
|
|
40
|
-
}), [k, A] =
|
|
41
|
+
}), [k, A] = g(() => {
|
|
41
42
|
if (typeof window > "u") return b;
|
|
42
43
|
if (C) {
|
|
43
44
|
let e = o(w.project);
|
|
44
45
|
if (e) return e;
|
|
45
46
|
}
|
|
46
47
|
return s("project", S) || b;
|
|
47
|
-
}), [j, M] =
|
|
48
|
+
}), [j, M] = g(() => {
|
|
48
49
|
if (typeof window > "u") return x;
|
|
49
50
|
if (C) {
|
|
50
51
|
let e = o(w.tenant);
|
|
@@ -52,7 +53,7 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
52
53
|
}
|
|
53
54
|
return s("tenant", S) || x;
|
|
54
55
|
});
|
|
55
|
-
|
|
56
|
+
m(() => {
|
|
56
57
|
l("organization", T, S), l("workspace", D, S), l("project", k, S), l("tenant", j, S);
|
|
57
58
|
}, [
|
|
58
59
|
T,
|
|
@@ -60,7 +61,7 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
60
61
|
k,
|
|
61
62
|
j,
|
|
62
63
|
S
|
|
63
|
-
]),
|
|
64
|
+
]), m(() => {
|
|
64
65
|
let r = t();
|
|
65
66
|
if (!r) return;
|
|
66
67
|
let i = e(r), a = {
|
|
@@ -76,8 +77,8 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
76
77
|
D,
|
|
77
78
|
k,
|
|
78
79
|
j
|
|
79
|
-
]),
|
|
80
|
-
C &&
|
|
80
|
+
]), m(() => {
|
|
81
|
+
C && y({
|
|
81
82
|
[w.organization]: T,
|
|
82
83
|
[w.workspace]: D,
|
|
83
84
|
[w.project]: k,
|
|
@@ -90,7 +91,7 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
90
91
|
j,
|
|
91
92
|
C,
|
|
92
93
|
w
|
|
93
|
-
]),
|
|
94
|
+
]), m(() => {
|
|
94
95
|
if (!C) return;
|
|
95
96
|
let e = () => {
|
|
96
97
|
let e = o(w.organization), t = o(w.workspace), n = o(w.project), r = o(w.tenant);
|
|
@@ -105,14 +106,14 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
105
106
|
k,
|
|
106
107
|
j
|
|
107
108
|
]);
|
|
108
|
-
let N =
|
|
109
|
+
let N = p((r) => {
|
|
109
110
|
E(r);
|
|
110
111
|
let i = t();
|
|
111
112
|
i && n(i, {
|
|
112
113
|
...e(i),
|
|
113
114
|
organizationId: r
|
|
114
115
|
}), typeof window < "u" && window.dispatchEvent(new CustomEvent("burdenoff:organization-changed", { detail: { organizationId: r } }));
|
|
115
|
-
}, []), P =
|
|
116
|
+
}, []), P = p((r, i) => {
|
|
116
117
|
let a = {
|
|
117
118
|
organization: "organizationId",
|
|
118
119
|
workspace: "workspaceId",
|
|
@@ -125,24 +126,24 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
125
126
|
...e(o),
|
|
126
127
|
[a[r]]: i
|
|
127
128
|
}) : typeof window < "u" && c(r, i, S);
|
|
128
|
-
}, [S]), F =
|
|
129
|
+
}, [S]), F = p((e) => {
|
|
129
130
|
O(e), P("workspace", e), typeof window < "u" && window.dispatchEvent(new CustomEvent("burdenoff:workspace-changed", { detail: { workspaceId: e } }));
|
|
130
|
-
}, [P]), I =
|
|
131
|
+
}, [P]), I = p((e) => {
|
|
131
132
|
A(e), P("project", e), typeof window < "u" && window.dispatchEvent(new CustomEvent("burdenoff:project-changed", { detail: { projectId: e } }));
|
|
132
|
-
}, [P]), L =
|
|
133
|
+
}, [P]), L = p((e) => {
|
|
133
134
|
M(e), P("tenant", e);
|
|
134
|
-
}, [P]), R =
|
|
135
|
+
}, [P]), R = p((e) => {
|
|
135
136
|
e.organizationId !== void 0 && N(e.organizationId), e.workspaceId !== void 0 && F(e.workspaceId), e.projectId !== void 0 && I(e.projectId), e.tenantId !== void 0 && L(e.tenantId);
|
|
136
137
|
}, [
|
|
137
138
|
N,
|
|
138
139
|
F,
|
|
139
140
|
I,
|
|
140
141
|
L
|
|
141
|
-
]), z =
|
|
142
|
+
]), z = p(() => {
|
|
142
143
|
E(null), O(null), A(null), M(null), a(S);
|
|
143
144
|
let e = t();
|
|
144
145
|
e && n(e, {});
|
|
145
|
-
}, [S]), B =
|
|
146
|
+
}, [S]), B = h(() => ({
|
|
146
147
|
organizationId: T,
|
|
147
148
|
workspaceId: D,
|
|
148
149
|
projectId: k,
|
|
@@ -167,15 +168,15 @@ function y({ children: u, defaultOrganizationId: d = null, defaultWorkspaceId: y
|
|
|
167
168
|
z,
|
|
168
169
|
C
|
|
169
170
|
]);
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ _(v.Provider, {
|
|
171
172
|
value: B,
|
|
172
173
|
children: u
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
-
let e =
|
|
176
|
+
function x() {
|
|
177
|
+
let e = f(v);
|
|
177
178
|
if (!e) throw Error("useActiveContext must be used within an ActiveContextProvider");
|
|
178
179
|
return e;
|
|
179
180
|
}
|
|
180
181
|
//#endregion
|
|
181
|
-
export {
|
|
182
|
+
export { b as ActiveContextProvider, x as useActiveContext };
|
|
@@ -17,7 +17,9 @@ export interface AuthContextValue {
|
|
|
17
17
|
isAuthenticated: boolean;
|
|
18
18
|
isLoading: boolean;
|
|
19
19
|
login: (user: ProfileUser, accessToken: string, refreshToken?: string) => void;
|
|
20
|
-
logout: (
|
|
20
|
+
logout: (options?: {
|
|
21
|
+
authoritative?: boolean;
|
|
22
|
+
}) => void;
|
|
21
23
|
updateUser: (user: Partial<ProfileUser>) => void;
|
|
22
24
|
refreshAccessToken: () => Promise<void>;
|
|
23
25
|
hasPermission: (permission: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthProvider.d.ts","sourceRoot":"","sources":["../../../../src/shared/providers/shell/AuthProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAOjB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthProvider.d.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B,QAAQ,EACR,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,aAAa,GACd,EAAE,iBAAiB,2CAuMnB;AAED,wBAAgB,OAAO,qBAMtB"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { getActiveProfileId as e, getProfileTokens as t, getProfileUser as n, getProfileWorkspaceToken as r, getProfiles as i, resolveActiveProfileId as
|
|
2
|
-
import { readShellSsoCookie as
|
|
3
|
-
import { useBridgeInitialization as
|
|
4
|
-
import { useTokenExpiryTimer as
|
|
5
|
-
import { useStorageSync as
|
|
6
|
-
import { useRemoteSLO as
|
|
7
|
-
import { useAuthActions as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { getActiveProfileId as e, getProfileTokens as t, getProfileUser as n, getProfileWorkspaceToken as r, getProfiles as i, resolveActiveProfileId as a } from "./ProfileStorageManager.js";
|
|
2
|
+
import { readShellSsoCookie as o } from "../../utils/authCookie.js";
|
|
3
|
+
import { useBridgeInitialization as ee } from "./authProvider/useBridgeInitialization.js";
|
|
4
|
+
import { useTokenExpiryTimer as te } from "./authProvider/useTokenExpiryTimer.js";
|
|
5
|
+
import { useStorageSync as s } from "./authProvider/useStorageSync.js";
|
|
6
|
+
import { useRemoteSLO as c } from "./authProvider/useRemoteSLO.js";
|
|
7
|
+
import { useAuthActions as l } from "./authProvider/useAuthActions.js";
|
|
8
|
+
import { useSsoDepositBootGuard as u } from "./authProvider/useSsoDepositBootGuard.js";
|
|
9
|
+
import { createContext as d, use as f, useCallback as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
10
11
|
//#region src/shared/providers/shell/AuthProvider.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
let e =
|
|
12
|
+
var v = d(null);
|
|
13
|
+
function y({ children: d, onTokenExpired: f, onSessionExpiringSoon: y, onRefreshToken: b, bridgeUrl: x, bridgeAllowedOrigins: S, bridgeDebug: C, onBridgeReady: w }) {
|
|
14
|
+
let T = h(!1), [E, D] = g(() => a()), [O, k] = g(() => E ? n(E) : null), [A, j] = g(() => E ? t(E) : null), [M, N] = g(() => E ? r(E) : null), [P, F] = g(() => {
|
|
15
|
+
if (E && n(E)) return !1;
|
|
16
|
+
if (x) try {
|
|
17
|
+
let e = o()?.id ?? null;
|
|
17
18
|
if (e && localStorage.getItem(`bf-p-${e}-tokens`)) return !1;
|
|
18
19
|
} catch {}
|
|
19
|
-
return !!
|
|
20
|
-
}), [
|
|
20
|
+
return !!x;
|
|
21
|
+
}), [I, ne] = g(!1), [L, re] = g(null), [R, z] = g(() => i().map((e) => ({
|
|
21
22
|
id: e.id,
|
|
22
23
|
email: e.email,
|
|
23
24
|
name: e.name,
|
|
24
25
|
avatar: e.avatar,
|
|
25
|
-
isActive: e.id ===
|
|
26
|
+
isActive: e.id === E,
|
|
26
27
|
lastLogin: e.lastLogin
|
|
27
|
-
}))), B =
|
|
28
|
+
}))), B = p(() => {
|
|
28
29
|
z([]);
|
|
29
|
-
}, []), V =
|
|
30
|
+
}, []), V = p(() => {
|
|
30
31
|
let t = e();
|
|
31
32
|
z(i().map((e) => ({
|
|
32
33
|
id: e.id,
|
|
@@ -37,117 +38,117 @@ function v({ children: u, onTokenExpired: d, onSessionExpiringSoon: v, onRefresh
|
|
|
37
38
|
lastLogin: e.lastLogin
|
|
38
39
|
})));
|
|
39
40
|
}, []);
|
|
40
|
-
|
|
41
|
-
bridgeUrl:
|
|
42
|
-
bridgeAllowedOrigins:
|
|
43
|
-
bridgeDebug:
|
|
44
|
-
onBridgeReady:
|
|
45
|
-
bridgeSyncInProgress:
|
|
46
|
-
setIsLoading:
|
|
47
|
-
setActiveId:
|
|
48
|
-
setUser:
|
|
49
|
-
setTokens:
|
|
50
|
-
setWorkspaceTokenLocal:
|
|
41
|
+
ee({
|
|
42
|
+
bridgeUrl: x,
|
|
43
|
+
bridgeAllowedOrigins: S,
|
|
44
|
+
bridgeDebug: C,
|
|
45
|
+
onBridgeReady: w,
|
|
46
|
+
bridgeSyncInProgress: T,
|
|
47
|
+
setIsLoading: F,
|
|
48
|
+
setActiveId: D,
|
|
49
|
+
setUser: k,
|
|
50
|
+
setTokens: j,
|
|
51
|
+
setWorkspaceTokenLocal: N,
|
|
51
52
|
clearAccounts: B,
|
|
52
53
|
refreshAccounts: V
|
|
53
54
|
});
|
|
54
|
-
let { login: H, logout: U, logoutAll: W, updateUser: G, refreshAccessToken: K, hasPermission: q, setWorkspaceToken: J, setMfaState: Y, switchAccount: X, addAccount: Z, removeAccount: Q } =
|
|
55
|
-
user:
|
|
56
|
-
tokens:
|
|
57
|
-
activeId:
|
|
58
|
-
bridgeSyncInProgress:
|
|
59
|
-
onRefreshToken:
|
|
60
|
-
onTokenExpired:
|
|
61
|
-
setActiveId:
|
|
62
|
-
setUser:
|
|
63
|
-
setTokens:
|
|
64
|
-
setWorkspaceTokenLocal:
|
|
65
|
-
setMfaRequiredState:
|
|
66
|
-
setMfaChallengeIdState:
|
|
67
|
-
setIsLoading:
|
|
55
|
+
let { login: H, logout: U, logoutAll: W, updateUser: G, refreshAccessToken: K, hasPermission: q, setWorkspaceToken: J, setMfaState: Y, switchAccount: X, addAccount: Z, removeAccount: Q } = l({
|
|
56
|
+
user: O,
|
|
57
|
+
tokens: A,
|
|
58
|
+
activeId: E,
|
|
59
|
+
bridgeSyncInProgress: T,
|
|
60
|
+
onRefreshToken: b,
|
|
61
|
+
onTokenExpired: f,
|
|
62
|
+
setActiveId: D,
|
|
63
|
+
setUser: k,
|
|
64
|
+
setTokens: j,
|
|
65
|
+
setWorkspaceTokenLocal: N,
|
|
66
|
+
setMfaRequiredState: ne,
|
|
67
|
+
setMfaChallengeIdState: re,
|
|
68
|
+
setIsLoading: F,
|
|
68
69
|
clearAccounts: B,
|
|
69
70
|
refreshAccounts: V
|
|
70
71
|
});
|
|
71
|
-
|
|
72
|
-
tokens:
|
|
73
|
-
onRefreshToken:
|
|
74
|
-
onTokenExpired:
|
|
75
|
-
onSessionExpiringSoon:
|
|
72
|
+
te({
|
|
73
|
+
tokens: A,
|
|
74
|
+
onRefreshToken: b,
|
|
75
|
+
onTokenExpired: f,
|
|
76
|
+
onSessionExpiringSoon: y,
|
|
76
77
|
refreshAccessToken: K
|
|
77
|
-
}),
|
|
78
|
-
user:
|
|
79
|
-
tokens:
|
|
80
|
-
workspaceToken:
|
|
81
|
-
activeId:
|
|
82
|
-
setUser:
|
|
83
|
-
setTokens:
|
|
84
|
-
setWorkspaceTokenLocal:
|
|
85
|
-
setActiveId:
|
|
78
|
+
}), s({
|
|
79
|
+
user: O,
|
|
80
|
+
tokens: A,
|
|
81
|
+
workspaceToken: M,
|
|
82
|
+
activeId: E,
|
|
83
|
+
setUser: k,
|
|
84
|
+
setTokens: j,
|
|
85
|
+
setWorkspaceTokenLocal: N,
|
|
86
|
+
setActiveId: D,
|
|
86
87
|
clearAccounts: B,
|
|
87
88
|
refreshAccounts: V
|
|
88
|
-
}),
|
|
89
|
-
tokens:
|
|
90
|
-
bridgeUrl:
|
|
89
|
+
}), u(), c({
|
|
90
|
+
tokens: A,
|
|
91
|
+
bridgeUrl: x,
|
|
91
92
|
logout: U,
|
|
92
|
-
setActiveId:
|
|
93
|
-
setUser:
|
|
94
|
-
setTokens:
|
|
95
|
-
setWorkspaceTokenLocal:
|
|
93
|
+
setActiveId: D,
|
|
94
|
+
setUser: k,
|
|
95
|
+
setTokens: j,
|
|
96
|
+
setWorkspaceTokenLocal: N,
|
|
96
97
|
clearAccounts: B
|
|
97
98
|
});
|
|
98
|
-
let $ =
|
|
99
|
-
user:
|
|
100
|
-
tokens:
|
|
99
|
+
let $ = m(() => !!O && !!A, [O, A]), ie = m(() => ({
|
|
100
|
+
user: O,
|
|
101
|
+
tokens: A,
|
|
101
102
|
isAuthenticated: $,
|
|
102
|
-
isLoading:
|
|
103
|
+
isLoading: P,
|
|
103
104
|
login: H,
|
|
104
105
|
logout: U,
|
|
105
106
|
updateUser: G,
|
|
106
107
|
refreshAccessToken: K,
|
|
107
108
|
hasPermission: q,
|
|
108
109
|
setWorkspaceToken: J,
|
|
109
|
-
workspaceToken:
|
|
110
|
-
mfaRequired:
|
|
110
|
+
workspaceToken: M,
|
|
111
|
+
mfaRequired: I,
|
|
111
112
|
mfaChallengeId: L,
|
|
112
113
|
setMfaState: Y,
|
|
113
|
-
activeProfileId:
|
|
114
|
+
activeProfileId: E,
|
|
114
115
|
accounts: R,
|
|
115
116
|
switchAccount: X,
|
|
116
117
|
addAccount: Z,
|
|
117
118
|
removeAccount: Q,
|
|
118
119
|
logoutAll: W,
|
|
119
|
-
currentUser:
|
|
120
|
+
currentUser: O
|
|
120
121
|
}), [
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
O,
|
|
123
|
+
A,
|
|
123
124
|
$,
|
|
124
|
-
|
|
125
|
+
P,
|
|
125
126
|
H,
|
|
126
127
|
U,
|
|
127
128
|
G,
|
|
128
129
|
K,
|
|
129
130
|
q,
|
|
130
131
|
J,
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
M,
|
|
133
|
+
I,
|
|
133
134
|
L,
|
|
134
135
|
Y,
|
|
135
|
-
|
|
136
|
+
E,
|
|
136
137
|
R,
|
|
137
138
|
X,
|
|
138
139
|
Z,
|
|
139
140
|
Q,
|
|
140
141
|
W
|
|
141
142
|
]);
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
value:
|
|
144
|
-
children:
|
|
143
|
+
return /* @__PURE__ */ _(v.Provider, {
|
|
144
|
+
value: ie,
|
|
145
|
+
children: d
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
let e =
|
|
148
|
+
function b() {
|
|
149
|
+
let e = f(v);
|
|
149
150
|
if (!e) throw Error("useAuth must be used within an AuthProvider");
|
|
150
151
|
return e;
|
|
151
152
|
}
|
|
152
153
|
//#endregion
|
|
153
|
-
export {
|
|
154
|
+
export { y as AuthProvider, b as useAuth };
|
|
@@ -21,9 +21,24 @@ export interface AuthActionsDeps {
|
|
|
21
21
|
clearAccounts: () => void;
|
|
22
22
|
refreshAccounts: () => void;
|
|
23
23
|
}
|
|
24
|
+
export interface LogoutOptions {
|
|
25
|
+
/**
|
|
26
|
+
* `true` (default) = an EXPLICIT user sign-out: revoke ALL server-side
|
|
27
|
+
* sessions (authoritative single-logout) and detour through the bridge
|
|
28
|
+
* host's /auth/sso-clear so its stored session is wiped too.
|
|
29
|
+
*
|
|
30
|
+
* `false` = a failure-driven local logout (expired session, failed token
|
|
31
|
+
* refresh, remote-SLO detection). Only THIS origin's state is cleared.
|
|
32
|
+
* BOFF-4463: these paths used to fire the authoritative signOut mutation,
|
|
33
|
+
* so one shell holding a stale relayed token would revoke the user's
|
|
34
|
+
* sessions platform-wide and cascade-logout every product within the 90s
|
|
35
|
+
* remote-SLO poll.
|
|
36
|
+
*/
|
|
37
|
+
authoritative?: boolean;
|
|
38
|
+
}
|
|
24
39
|
export interface AuthActions {
|
|
25
40
|
login: (user: ProfileUser, accessToken: string, refreshToken?: string) => void;
|
|
26
|
-
logout: () => void;
|
|
41
|
+
logout: (options?: LogoutOptions) => void;
|
|
27
42
|
logoutAll: () => void;
|
|
28
43
|
updateUser: (updates: Partial<ProfileUser>) => void;
|
|
29
44
|
refreshAccessToken: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthActions.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/shell/authProvider/useAuthActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAchB,MAAM,0BAA0B,CAAC;AAqClC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,oBAAoB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChD,cAAc,EACV,CAAC,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC,GACH,SAAS,CAAC;IACd,cAAc,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,sBAAsB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/E,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"useAuthActions.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/shell/authProvider/useAuthActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,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
j
|
|
55
|
-
]), I = y(() => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
]), I = y((e) => {
|
|
56
|
+
let t = e?.authoritative !== !1;
|
|
57
|
+
t && !C.current && b(x?.accessToken ?? (S ? n(S)?.accessToken : void 0)), S && c(S);
|
|
58
|
+
let a = l();
|
|
59
|
+
a ? (E(a), D(r(a)), O(n(a)), k(i(a))) : (E(null), D(null), O(null), k(null)), A(!1), j(null), P();
|
|
59
60
|
try {
|
|
60
61
|
m();
|
|
61
62
|
} catch {}
|
|
62
63
|
C.current || g()?.notifyLogout();
|
|
63
|
-
let
|
|
64
|
-
|
|
64
|
+
let o = t ? _() : null;
|
|
65
|
+
o && !C.current && window.location.replace(o);
|
|
65
66
|
}, [
|
|
66
67
|
S,
|
|
67
68
|
x,
|
|
@@ -108,7 +109,7 @@ function x({ user: e, tokens: x, activeId: S, bridgeSyncInProgress: C, onRefresh
|
|
|
108
109
|
expiresAt: i.expiresAt
|
|
109
110
|
});
|
|
110
111
|
} catch (e) {
|
|
111
|
-
console.error("Failed to refresh token:", e), x?.expiresAt && x.expiresAt - Date.now() > 0 || (I(), T?.());
|
|
112
|
+
console.error("Failed to refresh token:", e), x?.expiresAt && x.expiresAt - Date.now() > 0 || (I({ authoritative: !1 }), T?.());
|
|
112
113
|
} finally {
|
|
113
114
|
M(!1);
|
|
114
115
|
}
|
|
@@ -2,7 +2,9 @@ import { ProfileUser, AuthTokens } from '../ProfileStorageManager';
|
|
|
2
2
|
export interface RemoteSLODeps {
|
|
3
3
|
tokens: AuthTokens | null;
|
|
4
4
|
bridgeUrl: string | undefined;
|
|
5
|
-
logout: (
|
|
5
|
+
logout: (options?: {
|
|
6
|
+
authoritative?: boolean;
|
|
7
|
+
}) => void;
|
|
6
8
|
setActiveId: (id: string | null) => void;
|
|
7
9
|
setUser: (user: ProfileUser | null) => void;
|
|
8
10
|
setTokens: (tokens: AuthTokens | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRemoteSLO.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/shell/authProvider/useRemoteSLO.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK7E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"useRemoteSLO.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/shell/authProvider/useRemoteSLO.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK7E,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,sBAAsB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,SAAS,EACT,MAAM,EACN,WAAW,EACX,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,aAAa,GACd,EAAE,aAAa,GAAG,IAAI,CA0DtB"}
|
|
@@ -13,7 +13,7 @@ function a({ tokens: a, bridgeUrl: o, logout: s, setActiveId: c, setUser: l, set
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
if (t()) return;
|
|
16
|
-
await n(`${e().globalBaseUrl}/global/graphql`, a.accessToken) && s();
|
|
16
|
+
await n(`${e().globalBaseUrl}/global/graphql`, a.accessToken) && s({ authoritative: !1 });
|
|
17
17
|
} catch {}
|
|
18
18
|
};
|
|
19
19
|
document.addEventListener("visibilitychange", i);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boot-time SSO deposit safety net (BOFF-4463).
|
|
3
|
+
*
|
|
4
|
+
* Guarantees the central bridge host eventually receives this origin's
|
|
5
|
+
* session even when the post-login deposit hop was cancelled by a competing
|
|
6
|
+
* navigation, and heals sessions created while the deposit flow was broken:
|
|
7
|
+
* on app boot, if this profile has no recent successful deposit, mint a
|
|
8
|
+
* dedicated token lineage for the bridge (mintSsoSession) and perform the
|
|
9
|
+
* top-level deposit round-trip. Bounded by attempt caps + cooldowns in
|
|
10
|
+
* shouldAttemptSsoDeposit, and a marker param on the bounce-back records
|
|
11
|
+
* success.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSsoDepositBootGuard(): void;
|
|
14
|
+
//# sourceMappingURL=useSsoDepositBootGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSsoDepositBootGuard.d.ts","sourceRoot":"","sources":["../../../../../src/shared/providers/shell/authProvider/useSsoDepositBootGuard.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CA4E7C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { resolveGatewayUrls as e } from "../../../config/gatewayUrls.js";
|
|
2
|
+
import { resolveAuthBridgeConfig as t } from "../../../config/authBridgeUrls.js";
|
|
3
|
+
import { resolveActiveProfileId as n } from "../ProfileStorageManager.js";
|
|
4
|
+
import { isLocalDevSsoHost as r, isSharedSsoCookieDomain as i } from "../../../utils/authCookie.js";
|
|
5
|
+
import { beginSsoNavigation as a, buildSsoDepositUrl as o, consumeSsoDepositMarker as s, markSsoDepositPending as c, mintSsoSessionTokens as l, shouldAttemptSsoDeposit as u } from "../../../utils/ssoDeposit.js";
|
|
6
|
+
import { useEffect as d } from "react";
|
|
7
|
+
//#region src/shared/providers/shell/authProvider/useSsoDepositBootGuard.ts
|
|
8
|
+
var f = 2500;
|
|
9
|
+
function p() {
|
|
10
|
+
if (typeof window > "u") return !1;
|
|
11
|
+
try {
|
|
12
|
+
let e = window.Capacitor;
|
|
13
|
+
if (typeof e?.isNativePlatform == "function" && e.isNativePlatform()) return !0;
|
|
14
|
+
} catch {}
|
|
15
|
+
return typeof navigator < "u" && /Electron/i.test(navigator.userAgent || "");
|
|
16
|
+
}
|
|
17
|
+
function m() {
|
|
18
|
+
d(() => {
|
|
19
|
+
if (typeof window > "u") return;
|
|
20
|
+
let d = n();
|
|
21
|
+
if (s(d) || !d || p() || r() || i() || window.location.pathname.startsWith("/auth/")) return;
|
|
22
|
+
let m;
|
|
23
|
+
try {
|
|
24
|
+
let e = t();
|
|
25
|
+
m = new URL(e.url).origin;
|
|
26
|
+
} catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (m === window.location.origin || !u(d)) return;
|
|
30
|
+
let h = setTimeout(async () => {
|
|
31
|
+
try {
|
|
32
|
+
if (n() !== d || window.location.pathname.startsWith("/auth/")) return;
|
|
33
|
+
let t = localStorage.getItem(`bf-p-${d}-tokens`), r = localStorage.getItem(`bf-p-${d}-user`);
|
|
34
|
+
if (!t || !r) return;
|
|
35
|
+
let i = JSON.parse(t);
|
|
36
|
+
if (!(i.accessToken && typeof i.expiresAt == "number" && i.expiresAt - Date.now() > 6e4) || !i.refreshToken) return;
|
|
37
|
+
c(d);
|
|
38
|
+
let { globalBaseUrl: s } = e(), { tokens: u } = await l(`${s}/global/graphql`, i.refreshToken);
|
|
39
|
+
if (!u) return;
|
|
40
|
+
a(), window.location.replace(o(m, window.location.href, {
|
|
41
|
+
profileId: d,
|
|
42
|
+
tokens: JSON.stringify(u),
|
|
43
|
+
user: r,
|
|
44
|
+
profiles: localStorage.getItem("bf-profiles")
|
|
45
|
+
}));
|
|
46
|
+
} catch {}
|
|
47
|
+
}, f);
|
|
48
|
+
return () => clearTimeout(h);
|
|
49
|
+
}, []);
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { m as useSsoDepositBootGuard };
|
|
@@ -22,6 +22,8 @@ export { initializeLogger, setUserContext, clearUserContext } from './loggerInit
|
|
|
22
22
|
export type { InitLoggerOptions } from './loggerInit';
|
|
23
23
|
export { setSSoCookie, getSSoCookie, clearSSoCookie, setShellSsoCookies, readShellSsoCookie, clearShellSsoCookies, isSharedSsoCookieDomain, isTrustedSsoOrigin, } from './authCookie';
|
|
24
24
|
export type { ShellSsoCookieData } from './authCookie';
|
|
25
|
+
export { SSO_DEPOSITED_PARAM, beginSsoNavigation, isSsoNavigationPending, clearSsoNavigation, readSsoDepositState, markSsoDepositPending, markSsoDepositDone, clearSsoDepositState, shouldAttemptSsoDeposit, mintSsoSessionTokens, buildSsoDepositUrl, consumeSsoDepositMarker, } from './ssoDeposit';
|
|
26
|
+
export type { MintedSsoTokens, MintSsoSessionResult, SsoDepositPayload, SsoDepositState, } from './ssoDeposit';
|
|
25
27
|
export { createProfileScopedStorage, getProfileScopedKey } from './profileScopedStorage';
|
|
26
28
|
export { QUOTA_EXHAUSTED_CODE, RESOURCE_CAP_EXCEEDED_CODE, STORAGE_QUOTA_EXCEEDED_CODE, UPGRADE_ERROR_CODES, isQuotaExhaustedError, isUpgradeError, extractUpgradeErrorExtensions, extractQuotaExhaustedExtensions, buildQuotaExhaustedMessage, } from './quotaErrors';
|
|
27
29
|
export type { QuotaExhaustedExtensions, UpgradeErrorCode, UpgradeErrorExtensions, } from './quotaErrors';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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AAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClF,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGzF,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,6BAA6B,EAC7B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-product SSO deposit helpers (BOFF-4463).
|
|
3
|
+
*
|
|
4
|
+
* The deposit hop is a TOP-LEVEL navigation from a product origin to the
|
|
5
|
+
* central bridge host (`app.burdenoff.com/auth/sso-deposit#sso=...`) so the
|
|
6
|
+
* bridge's first-party localStorage receives the session that later powers
|
|
7
|
+
* `/auth/sso-relay` for every other product. Two failure modes this module
|
|
8
|
+
* addresses:
|
|
9
|
+
*
|
|
10
|
+
* 1. The deposit navigation is provisional for a few hundred ms; ANY
|
|
11
|
+
* same-document navigation fired by post-login React effects (URL param
|
|
12
|
+
* sync via history.replaceState, router redirects) cancels it
|
|
13
|
+
* (net::ERR_ABORTED) and the bridge silently never gets the session.
|
|
14
|
+
* → `beginSsoNavigation()` marks a pending cross-document SSO navigation so
|
|
15
|
+
* known same-document navigators (ActiveContextProvider URL sync) hold off,
|
|
16
|
+
* and callers can schedule a retry.
|
|
17
|
+
*
|
|
18
|
+
* 2. Tokens copied verbatim to other origins share ONE rotating refresh-token
|
|
19
|
+
* lineage — the first origin to refresh revokes the token every other copy
|
|
20
|
+
* holds. → `mintSsoSessionTokens()` calls the public `mintSsoSession`
|
|
21
|
+
* mutation to obtain a dedicated lineage for the bridge/target origin.
|
|
22
|
+
*/
|
|
23
|
+
/** Query param the deposit initiator embeds in returnTo; its presence on boot
|
|
24
|
+
* proves the deposit hop committed and bounced back. */
|
|
25
|
+
export declare const SSO_DEPOSITED_PARAM = "bf_sso_deposited";
|
|
26
|
+
/** Mark that a cross-document SSO navigation (deposit/relay hop) was just
|
|
27
|
+
* initiated. Same-document navigators should stay quiet until it commits. */
|
|
28
|
+
export declare function beginSsoNavigation(): void;
|
|
29
|
+
export declare function isSsoNavigationPending(): boolean;
|
|
30
|
+
export declare function clearSsoNavigation(): void;
|
|
31
|
+
export interface SsoDepositState {
|
|
32
|
+
profileId: string;
|
|
33
|
+
status: 'pending' | 'done';
|
|
34
|
+
at: number;
|
|
35
|
+
attempts: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function readSsoDepositState(): SsoDepositState | null;
|
|
38
|
+
export declare function writeSsoDepositState(state: SsoDepositState): void;
|
|
39
|
+
export declare function markSsoDepositPending(profileId: string): void;
|
|
40
|
+
export declare function markSsoDepositDone(profileId: string): void;
|
|
41
|
+
export declare function clearSsoDepositState(): void;
|
|
42
|
+
/**
|
|
43
|
+
* True when the app should attempt (or re-attempt) the deposit hop for this
|
|
44
|
+
* profile: nothing recorded yet (legacy session that never deposited), a
|
|
45
|
+
* pending attempt that evidently never committed, or a stale `done` record
|
|
46
|
+
* past its trust window. Bounded by attempt count + cooldown so a persistently
|
|
47
|
+
* failing bridge can never turn into a redirect loop.
|
|
48
|
+
*/
|
|
49
|
+
export declare function shouldAttemptSsoDeposit(profileId: string): boolean;
|
|
50
|
+
export interface MintedSsoTokens {
|
|
51
|
+
accessToken: string;
|
|
52
|
+
refreshToken: string;
|
|
53
|
+
expiresAt: number;
|
|
54
|
+
}
|
|
55
|
+
export interface MintSsoSessionResult {
|
|
56
|
+
tokens: MintedSsoTokens | null;
|
|
57
|
+
/**
|
|
58
|
+
* True when the server EXPLICITLY rejected the source refresh token /
|
|
59
|
+
* session (revoked, rotated away, user inactive). Distinguishes a dead
|
|
60
|
+
* session (caller should treat the stored pair as unusable) from the
|
|
61
|
+
* mutation merely being unreachable (rollout gap, network) where a legacy
|
|
62
|
+
* fallback is still reasonable.
|
|
63
|
+
*/
|
|
64
|
+
denied: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Mint a dedicated refresh-token lineage for another origin (bridge host or
|
|
68
|
+
* relay target) from this origin's valid refresh token.
|
|
69
|
+
*/
|
|
70
|
+
export declare function mintSsoSessionTokens(globalGraphqlUrl: string, refreshToken: string, options?: {
|
|
71
|
+
timeoutMs?: number;
|
|
72
|
+
}): Promise<MintSsoSessionResult>;
|
|
73
|
+
export interface SsoDepositPayload {
|
|
74
|
+
profileId: string;
|
|
75
|
+
tokens: string;
|
|
76
|
+
user: string;
|
|
77
|
+
profiles: string | null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build the full deposit URL: bridge-host /auth/sso-deposit with the payload in
|
|
81
|
+
* the fragment (never sent to servers) and the deposit-committed marker param
|
|
82
|
+
* embedded in returnTo so the bounce-back proves completion.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildSsoDepositUrl(bridgeOrigin: string, returnTo: string, payload: SsoDepositPayload): string;
|
|
85
|
+
/**
|
|
86
|
+
* On boot: if the URL carries the deposit-committed marker, record success and
|
|
87
|
+
* strip the param (via history.replaceState — safe, no SSO navigation is
|
|
88
|
+
* pending during a fresh boot with the marker present).
|
|
89
|
+
* Returns true when the marker was found.
|
|
90
|
+
*/
|
|
91
|
+
export declare function consumeSsoDepositMarker(profileId: string | null): boolean;
|
|
92
|
+
//# sourceMappingURL=ssoDeposit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssoDeposit.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/ssoDeposit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;yDACyD;AACzD,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAWtD;8EAC8E;AAC9E,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAShD;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,mBAAmB,IAAI,eAAe,GAAG,IAAI,CAiB5D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAMjE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAI7D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CASlE;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAoBD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAoD/B;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAazE"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
//#region src/shared/utils/ssoDeposit.ts
|
|
2
|
+
var e = 15e3, t = "bf-sso-deposit-state", n = "bf_sso_deposited", r = 3, i = 600 * 1e3, a = 1440 * 60 * 1e3, o = null;
|
|
3
|
+
function s() {
|
|
4
|
+
o = Date.now();
|
|
5
|
+
}
|
|
6
|
+
function c() {
|
|
7
|
+
return o === null ? !1 : Date.now() - o > e ? (o = null, !1) : !0;
|
|
8
|
+
}
|
|
9
|
+
function l() {
|
|
10
|
+
o = null;
|
|
11
|
+
}
|
|
12
|
+
function u() {
|
|
13
|
+
try {
|
|
14
|
+
let e = localStorage.getItem(t);
|
|
15
|
+
if (!e) return null;
|
|
16
|
+
let n = JSON.parse(e);
|
|
17
|
+
return typeof n.profileId != "string" || n.status !== "pending" && n.status !== "done" || typeof n.at != "number" || typeof n.attempts != "number" ? null : n;
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function d(e) {
|
|
23
|
+
try {
|
|
24
|
+
localStorage.setItem(t, JSON.stringify(e));
|
|
25
|
+
} catch {}
|
|
26
|
+
}
|
|
27
|
+
function f(e) {
|
|
28
|
+
let t = u(), n = t?.profileId === e ? t.attempts + 1 : 1;
|
|
29
|
+
d({
|
|
30
|
+
profileId: e,
|
|
31
|
+
status: "pending",
|
|
32
|
+
at: Date.now(),
|
|
33
|
+
attempts: n
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function p(e) {
|
|
37
|
+
d({
|
|
38
|
+
profileId: e,
|
|
39
|
+
status: "done",
|
|
40
|
+
at: Date.now(),
|
|
41
|
+
attempts: 0
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function m() {
|
|
45
|
+
try {
|
|
46
|
+
localStorage.removeItem(t);
|
|
47
|
+
} catch {}
|
|
48
|
+
}
|
|
49
|
+
function h(e) {
|
|
50
|
+
let t = u();
|
|
51
|
+
return !t || t.profileId !== e ? !0 : t.status === "done" ? Date.now() - t.at > a : t.attempts >= r ? !1 : Date.now() - t.at > i;
|
|
52
|
+
}
|
|
53
|
+
var g = new Set([
|
|
54
|
+
"UNAUTHENTICATED",
|
|
55
|
+
"INVALID_REFRESH_TOKEN",
|
|
56
|
+
"REFRESH_TOKEN_EXPIRED",
|
|
57
|
+
"INVALID_TOKEN",
|
|
58
|
+
"SESSION_REVOKED",
|
|
59
|
+
"FORBIDDEN",
|
|
60
|
+
"NOT_FOUND"
|
|
61
|
+
]), _ = "mutation MintSsoSession($token: String!) { mintSsoSession(token: $token) { accessToken refreshToken expiresIn } }";
|
|
62
|
+
async function v(e, t, n) {
|
|
63
|
+
try {
|
|
64
|
+
let r = new AbortController(), i = setTimeout(() => r.abort(), n?.timeoutMs ?? 6e3);
|
|
65
|
+
try {
|
|
66
|
+
let n = await fetch(e, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers: { "content-type": "application/json" },
|
|
69
|
+
body: JSON.stringify({
|
|
70
|
+
query: _,
|
|
71
|
+
variables: { token: t }
|
|
72
|
+
}),
|
|
73
|
+
signal: r.signal
|
|
74
|
+
});
|
|
75
|
+
if (!n.ok) return {
|
|
76
|
+
tokens: null,
|
|
77
|
+
denied: n.status === 401
|
|
78
|
+
};
|
|
79
|
+
let i = await n.json(), a = i.data?.mintSsoSession;
|
|
80
|
+
if (!a?.accessToken || !a.refreshToken) return {
|
|
81
|
+
tokens: null,
|
|
82
|
+
denied: (i.errors ?? []).some((e) => g.has(e?.extensions?.code ?? ""))
|
|
83
|
+
};
|
|
84
|
+
let o = typeof a.expiresIn == "number" && a.expiresIn > 0 ? a.expiresIn * 1e3 : 1440 * 60 * 1e3;
|
|
85
|
+
return {
|
|
86
|
+
tokens: {
|
|
87
|
+
accessToken: a.accessToken,
|
|
88
|
+
refreshToken: a.refreshToken,
|
|
89
|
+
expiresAt: Date.now() + o
|
|
90
|
+
},
|
|
91
|
+
denied: !1
|
|
92
|
+
};
|
|
93
|
+
} finally {
|
|
94
|
+
clearTimeout(i);
|
|
95
|
+
}
|
|
96
|
+
} catch {
|
|
97
|
+
return {
|
|
98
|
+
tokens: null,
|
|
99
|
+
denied: !1
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function y(e, t, r) {
|
|
104
|
+
let i = new URL(t);
|
|
105
|
+
i.searchParams.set(n, "1");
|
|
106
|
+
let a = new URL("/auth/sso-deposit", e);
|
|
107
|
+
return a.searchParams.set("returnTo", i.href), `${a.href}#sso=${btoa(JSON.stringify(r))}`;
|
|
108
|
+
}
|
|
109
|
+
function b(e) {
|
|
110
|
+
try {
|
|
111
|
+
let t = new URL(window.location.href);
|
|
112
|
+
return t.searchParams.get("bf_sso_deposited") === "1" ? (e && p(e), t.searchParams.delete(n), window.history.replaceState(window.history.state, "", t.toString()), !0) : !1;
|
|
113
|
+
} catch {
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { n as SSO_DEPOSITED_PARAM, s as beginSsoNavigation, y as buildSsoDepositUrl, m as clearSsoDepositState, l as clearSsoNavigation, b as consumeSsoDepositMarker, c as isSsoNavigationPending, p as markSsoDepositDone, f as markSsoDepositPending, v as mintSsoSessionTokens, u as readSsoDepositState, h as shouldAttemptSsoDeposit };
|
package/dist/shared-utils.js
CHANGED
|
@@ -6,15 +6,16 @@ import { installGatewayFetchRewrite as P, resolveGatewayBases as F, suppressCons
|
|
|
6
6
|
import { BACKEND_ERROR_EVENT as L, CONNECTION_STATUS_EVENT as R, dispatchBackendErrorEvent as z, extractBackendError as B, isAbortError as V, isBackendErrorDisplay as H, isTransportError as U, markConnectionHealthy as W, shouldToastBackendError as G } from "./shared/utils/backendErrors.js";
|
|
7
7
|
import { attemptTokenRefresh as K, clearAuthSessionStorage as q, hasAuthGraphQLErrors as J, isAuthGraphQLError as Y, isAuthNetworkError as X, redirectToLogin as Z } from "./shared/utils/authErrorHandling.js";
|
|
8
8
|
import { clearSSoCookie as Q, clearShellSsoCookies as $, getSSoCookie as ee, isSharedSsoCookieDomain as te, isTrustedSsoOrigin as ne, readShellSsoCookie as re, setSSoCookie as ie, setShellSsoCookies as ae } from "./shared/utils/authCookie.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { SSO_DEPOSITED_PARAM as oe, beginSsoNavigation as se, buildSsoDepositUrl as ce, clearSsoDepositState as le, clearSsoNavigation as ue, consumeSsoDepositMarker as de, isSsoNavigationPending as fe, markSsoDepositDone as pe, markSsoDepositPending as me, mintSsoSessionTokens as he, readSsoDepositState as ge, shouldAttemptSsoDeposit as _e } from "./shared/utils/ssoDeposit.js";
|
|
10
|
+
import { AppInitializer as ve, useRegistryHelpers as ye, useShellNavigate as be } from "./shared/utils/appHelpers.js";
|
|
11
|
+
import { clearUserContext as xe, initializeLogger as Se, setUserContext as Ce } from "./shared/utils/loggerInit.js";
|
|
12
|
+
import { createProfileScopedStorage as we, getProfileScopedKey as Te } from "./shared/utils/profileScopedStorage.js";
|
|
13
|
+
import { QUOTA_EXHAUSTED_CODE as Ee, RESOURCE_CAP_EXCEEDED_CODE as De, STORAGE_QUOTA_EXCEEDED_CODE as Oe, UPGRADE_ERROR_CODES as ke, buildQuotaExhaustedMessage as Ae, extractQuotaExhaustedExtensions as je, extractUpgradeErrorExtensions as Me, isQuotaExhaustedError as Ne, isUpgradeError as Pe } from "./shared/utils/quotaErrors.js";
|
|
14
|
+
import { clsx as Fe } from "clsx";
|
|
15
|
+
import { twMerge as Ie } from "tailwind-merge";
|
|
15
16
|
//#region src/shared/utils/index.ts
|
|
16
|
-
function
|
|
17
|
-
return
|
|
17
|
+
function Le(...e) {
|
|
18
|
+
return Ie(Fe(e));
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
|
-
export {
|
|
21
|
+
export { ve as AppInitializer, L as BACKEND_ERROR_EVENT, R as CONNECTION_STATUS_EVENT, Ee as QUOTA_EXHAUSTED_CODE, De as RESOURCE_CAP_EXCEEDED_CODE, oe as SSO_DEPOSITED_PARAM, Oe as STORAGE_QUOTA_EXCEEDED_CODE, ke as UPGRADE_ERROR_CODES, t as alertTokens, K as attemptTokenRefresh, se as beginSsoNavigation, Ae as buildQuotaExhaustedMessage, ce as buildSsoDepositUrl, f as capitalizeFirst, p as capitalizeWords, n as categoryTokens, q as clearAuthSessionStorage, Q as clearSSoCookie, $ as clearShellSsoCookies, le as clearSsoDepositState, ue as clearSsoNavigation, xe as clearUserContext, Le as cn, de as consumeSsoDepositMarker, e as createApolloClient, we as createProfileScopedStorage, z as dispatchBackendErrorEvent, B as extractBackendError, je as extractQuotaExhaustedExtensions, Me as extractUpgradeErrorExtensions, m as formatBytes, h as formatCompactNumber, g as formatCurrency, _ as formatCurrencyCompact, v as formatDate, y as formatDateTime, b as formatDuration, x as formatList, S as formatNumber, C as formatOrdinal, w as formatPercentage, T as formatRelativeTime, E as formatTime, r as getAlertTokens, i as getCategoryTokens, Te as getProfileScopedKey, a as getProgressTokens, ee as getSSoCookie, o as getStatusBadgeTokens, s as getStatusTokens, c as getTrendTokens, J as hasAuthGraphQLErrors, Se as initializeLogger, P as installGatewayFetchRewrite, V as isAbortError, Y as isAuthGraphQLError, X as isAuthNetworkError, H as isBackendErrorDisplay, M as isChunkLoadError, Ne as isQuotaExhaustedError, te as isSharedSsoCookieDomain, fe as isSsoNavigationPending, U as isTransportError, ne as isTrustedSsoOrigin, Pe as isUpgradeError, N as lazyWithRetry, W as markConnectionHealthy, pe as markSsoDepositDone, me as markSsoDepositPending, he as mintSsoSessionTokens, D as pluralize, l as progressTokens, re as readShellSsoCookie, ge as readSsoDepositState, Z as redirectToLogin, F as resolveGatewayBases, ie as setSSoCookie, ae as setShellSsoCookies, Ce as setUserContext, _e as shouldAttemptSsoDeposit, G as shouldToastBackendError, O as slugify, u as statusTokens, I as suppressConsole, k as toCamelCase, A as toPascalCase, d as trendTokens, j as truncateText, ye as useRegistryHelpers, be as useShellNavigate };
|
package/dist/shared.js
CHANGED
|
@@ -21,101 +21,102 @@ import { ApolloClient as Pe, ApolloProvider as Fe, InMemoryCache as Ie, gql as L
|
|
|
21
21
|
import { attemptTokenRefresh as Ue, clearAuthSessionStorage as We, hasAuthGraphQLErrors as Ge, isAuthGraphQLError as Ke, isAuthNetworkError as qe, redirectToLogin as Je } from "./shared/utils/authErrorHandling.js";
|
|
22
22
|
import { clearSSoCookie as Ye, clearShellSsoCookies as Xe, getSSoCookie as Ze, isSharedSsoCookieDomain as Qe, isTrustedSsoOrigin as $e, readShellSsoCookie as et, setSSoCookie as tt, setShellSsoCookies as nt } from "./shared/utils/authCookie.js";
|
|
23
23
|
import { SSORedirectSpinner as rt, checkRemoteSLO as it, checkSLO as at, clearLocalAuthState as ot, getSSORedirectUrl as st } from "./shared/components/SSORedirectGuard.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
24
|
+
import { SSO_DEPOSITED_PARAM as ct, beginSsoNavigation as lt, buildSsoDepositUrl as ut, clearSsoDepositState as dt, clearSsoNavigation as ft, consumeSsoDepositMarker as pt, isSsoNavigationPending as mt, markSsoDepositDone as ht, markSsoDepositPending as gt, mintSsoSessionTokens as _t, readSsoDepositState as vt, shouldAttemptSsoDeposit as yt } from "./shared/utils/ssoDeposit.js";
|
|
25
|
+
import { AppInitializer as bt, useRegistryHelpers as xt, useShellNavigate as St } from "./shared/utils/appHelpers.js";
|
|
26
|
+
import { LogLevel as Ct } from "./shared/logger/types.js";
|
|
27
|
+
import { Logger as wt } from "./shared/logger/Logger.js";
|
|
28
|
+
import { LogManager as Tt, logManager as Et } from "./shared/logger/LogManager.js";
|
|
29
|
+
import { ConsoleTransport as Dt } from "./shared/logger/ConsoleTransport.js";
|
|
30
|
+
import { clearUserContext as Ot, initializeLogger as kt, setUserContext as At } from "./shared/utils/loggerInit.js";
|
|
31
|
+
import { createProfileScopedStorage as jt, getProfileScopedKey as Mt } from "./shared/utils/profileScopedStorage.js";
|
|
32
|
+
import { QUOTA_EXHAUSTED_CODE as Nt, RESOURCE_CAP_EXCEEDED_CODE as Pt, STORAGE_QUOTA_EXCEEDED_CODE as Ft, UPGRADE_ERROR_CODES as It, buildQuotaExhaustedMessage as Lt, extractQuotaExhaustedExtensions as Rt, extractUpgradeErrorExtensions as zt, isQuotaExhaustedError as Bt, isUpgradeError as Vt } from "./shared/utils/quotaErrors.js";
|
|
33
|
+
import { cn as Ht } from "./shared-utils.js";
|
|
34
|
+
import { ActorIdentity as Ut } from "./shared/actors/ActorIdentity.js";
|
|
35
|
+
import { buildActorFallback as Wt, useActorProfiles as Gt } from "./shared/actors/useActorProfiles.js";
|
|
36
|
+
import { ErrorBoundary as Kt } from "./shared/components/ErrorBoundary.js";
|
|
37
|
+
import { RequireAuth as qt, RequireGuest as Jt } from "./shared/components/RequireAuth.js";
|
|
38
|
+
import { PermissionButton as Yt, PermissionGate as Xt, PermissionLink as Zt } from "./shared/components/PermissionGate.js";
|
|
39
|
+
import { AccessDenied as Qt, PermissionDenied as $t } from "./shared/components/AccessDenied.js";
|
|
40
|
+
import { ErrorFallback as en } from "./shared/components/ErrorFallback.js";
|
|
41
|
+
import { LoadingFallback as tn, PageLoadingFallback as nn, SectionLoadingFallback as rn } from "./shared/components/LoadingFallback.js";
|
|
42
|
+
import { MicrofrontendErrorBoundary as an } from "./shared/components/MicrofrontendErrorBoundary.js";
|
|
43
|
+
import { ConditionalShell as on } from "./shared/components/ConditionalShell.js";
|
|
44
|
+
import { usePWA as sn } from "./shared/hooks/usePWA.js";
|
|
45
|
+
import { PWAInstallBanner as cn } from "./shared/components/PWAInstallBanner.js";
|
|
46
|
+
import { ErrorBoundary as ln } from "./shared/components/AppErrorBoundary.js";
|
|
47
|
+
import { FeatureFlagProvider as un, useFeatureFlags as dn } from "./shared/feature-flags/FeatureFlagProvider.js";
|
|
48
|
+
import { useFeatureFlag as fn, useFeatureFlagDetails as pn, useFeatureFlagValue as mn } from "./shared/feature-flags/useFeatureFlag.js";
|
|
49
|
+
import { FeatureGate as hn } from "./shared/feature-flags/FeatureGate.js";
|
|
49
50
|
import "./shared-feature-flags.js";
|
|
50
|
-
import { ContextConversationWidget as
|
|
51
|
-
import { detectPlatform as
|
|
52
|
-
import { KeyboardHelpDialogWrapper as
|
|
53
|
-
import { QuotaMeter as
|
|
54
|
-
import { UPGRADE_PROMPT_EVENT as
|
|
55
|
-
import { UpgradeInlineBanner as
|
|
56
|
-
import { useVoiceInput as
|
|
57
|
-
import { ASSISTANT_WIDGET_TOGGLE_EVENT as
|
|
51
|
+
import { ContextConversationWidget as gn } from "./shared/components/ContextConversationWidget.js";
|
|
52
|
+
import { detectPlatform as _n, formatKeyCombo as vn, getDisplayKeysForPlatform as yn, getShortcutLabel as bn, isMac as xn, isMobileDevice as Sn, isTabletDevice as Cn, matchesKeyCombo as wn, normalizeKey as Tn, normalizePlatformCombo as En, parseKeyCombo as Dn, shouldEnableKeyboardShortcuts as On, shouldIgnoreShortcut as kn } from "./shared/keyboard/utils.js";
|
|
53
|
+
import { KeyboardHelpDialogWrapper as An } from "./shared/components/KeyboardHelpDialogWrapper.js";
|
|
54
|
+
import { QuotaMeter as jn } from "./shared/components/QuotaMeter.js";
|
|
55
|
+
import { UPGRADE_PROMPT_EVENT as Mn, UpgradePromptModal as Nn, dispatchUpgradePrompt as Pn } from "./shared/components/UpgradePromptModal.js";
|
|
56
|
+
import { UpgradeInlineBanner as Fn } from "./shared/components/UpgradeInlineBanner.js";
|
|
57
|
+
import { useVoiceInput as In } from "./shared/components/assistantWidget/useVoiceInput.js";
|
|
58
|
+
import { ASSISTANT_WIDGET_TOGGLE_EVENT as Ln, AssistantWidget as Rn } from "./shared/components/assistantWidget/AssistantWidget.js";
|
|
58
59
|
import "./shared-components.js";
|
|
59
|
-
import { DevtoolsSink as
|
|
60
|
-
import { BroadcastChannelSink as
|
|
61
|
-
import { BackendAuditSink as
|
|
62
|
-
import { RybbitSink as
|
|
63
|
-
import { OtelBrowserSink as
|
|
64
|
-
import { EventBusProvider as
|
|
65
|
-
import { useDebounce as
|
|
66
|
-
import { useThrottle as
|
|
67
|
-
import { BREAKPOINTS as
|
|
68
|
-
import { useOnClickOutside as
|
|
69
|
-
import { useKeyPress as
|
|
70
|
-
import { useExclusiveMenu as
|
|
71
|
-
import { useLocalStorage as
|
|
72
|
-
import { useSessionStorage as
|
|
73
|
-
import { usePrevious as
|
|
74
|
-
import { useConditionalToggle as
|
|
75
|
-
import { usePagination as
|
|
76
|
-
import { useAsync as
|
|
77
|
-
import { MODIFIER_KEYS as
|
|
78
|
-
import { useKeyboardShortcuts as
|
|
79
|
-
import { useHotkeys as
|
|
80
|
-
import { useShortcutHelp as
|
|
81
|
-
import { GLOBAL_SHORTCUT_CATEGORIES as
|
|
82
|
-
import { useLogger as
|
|
83
|
-
import { useHasAnimated as
|
|
84
|
-
import { useReferralAttribution as
|
|
85
|
-
import { useRecordProductVisit as
|
|
86
|
-
import { QUOTA_EXHAUSTED_EVENT as
|
|
87
|
-
import { PLAN_USAGE_SNAPSHOT_EVENT as
|
|
88
|
-
import { appendContextToPath as
|
|
89
|
-
import { MicrofrontendContext as
|
|
90
|
-
import { detectDeviceType as
|
|
91
|
-
import { useTourPlayer as
|
|
92
|
-
import { TourSpotlight as
|
|
93
|
-
import { TourTooltip as
|
|
94
|
-
import { TourPlayerProvider as
|
|
95
|
-
import { TourPlayer as
|
|
96
|
-
import { getTourContextRank as
|
|
97
|
-
import { withTourProgressStatus as
|
|
98
|
-
import { ToursProvider as
|
|
99
|
-
import { TourInitializer as
|
|
100
|
-
import { AppShellProvider as
|
|
101
|
-
import { MicrofrontendProvider as
|
|
102
|
-
import { TourTrigger as
|
|
60
|
+
import { DevtoolsSink as zn } from "./shared/events/sinks/DevtoolsSink.js";
|
|
61
|
+
import { BroadcastChannelSink as Bn } from "./shared/events/sinks/BroadcastChannelSink.js";
|
|
62
|
+
import { BackendAuditSink as Vn } from "./shared/events/sinks/BackendAuditSink.js";
|
|
63
|
+
import { RybbitSink as Hn } from "./shared/events/sinks/RybbitSink.js";
|
|
64
|
+
import { OtelBrowserSink as Un } from "./shared/events/sinks/OtelBrowserSink.js";
|
|
65
|
+
import { EventBusProvider as Wn, createEventBus as Gn, useEvent as Kn, useEventBus as qn, useEventEmitter as Jn } from "./shared-events.js";
|
|
66
|
+
import { useDebounce as Yn } from "./shared/hooks/useDebounce.js";
|
|
67
|
+
import { useThrottle as Xn } from "./shared/hooks/useThrottle.js";
|
|
68
|
+
import { BREAKPOINTS as Zn, useBreakpoint as Qn, useMobileBreakpoint as $n } from "./shared/hooks/useBreakpoint.js";
|
|
69
|
+
import { useOnClickOutside as er, useOnClickOutsideWithRef as tr } from "./shared/hooks/useOnClickOutside.js";
|
|
70
|
+
import { useKeyPress as nr, useKeyboardShortcut as rr } from "./shared/hooks/useKeyPress.js";
|
|
71
|
+
import { useExclusiveMenu as ir } from "./shared/hooks/useExclusiveMenu.js";
|
|
72
|
+
import { useLocalStorage as ar } from "./shared/hooks/useLocalStorage.js";
|
|
73
|
+
import { useSessionStorage as or } from "./shared/hooks/useSessionStorage.js";
|
|
74
|
+
import { usePrevious as sr, usePreviousDistinct as cr, usePreviousHistory as lr } from "./shared/hooks/usePrevious.js";
|
|
75
|
+
import { useConditionalToggle as ur, useToggle as dr, useToggleObject as fr } from "./shared/hooks/useToggle.js";
|
|
76
|
+
import { usePagination as pr } from "./shared/hooks/usePagination.js";
|
|
77
|
+
import { useAsync as mr, useAsyncImmediate as hr } from "./shared/hooks/useAsync.js";
|
|
78
|
+
import { MODIFIER_KEYS as gr, PLATFORM_TYPES as _r } from "./shared/keyboard/types.js";
|
|
79
|
+
import { useKeyboardShortcuts as vr } from "./shared/keyboard/useKeyboardShortcuts.js";
|
|
80
|
+
import { useHotkeys as yr } from "./shared/keyboard/useHotkeys.js";
|
|
81
|
+
import { useShortcutHelp as br } from "./shared/keyboard/useShortcutHelp.js";
|
|
82
|
+
import { GLOBAL_SHORTCUT_CATEGORIES as xr, createGlobalShortcuts as Sr, getGlobalShortcutsByCategory as Cr, mergeShortcuts as wr } from "./shared/keyboard/globalShortcuts.js";
|
|
83
|
+
import { useLogger as Tr } from "./shared/logger/useLogger.js";
|
|
84
|
+
import { useHasAnimated as Er } from "./shared/hooks/useHasAnimated.js";
|
|
85
|
+
import { useReferralAttribution as Dr } from "./shared/hooks/useReferralAttribution.js";
|
|
86
|
+
import { useRecordProductVisit as Or } from "./shared/hooks/useRecordProductVisit.js";
|
|
87
|
+
import { QUOTA_EXHAUSTED_EVENT as kr, dispatchQuotaExhausted as Ar, useQuotaErrorToast as jr } from "./shared/hooks/useQuotaErrorToast.js";
|
|
88
|
+
import { PLAN_USAGE_SNAPSHOT_EVENT as Mr, publishPlanUsageSnapshot as Nr, useUpgradePrompt as Pr } from "./shared/hooks/useUpgradePrompt.js";
|
|
89
|
+
import { appendContextToPath as Fr, useCurrentContextSearchParams as Ir } from "./shared/hooks/useCurrentContextSearchParams.js";
|
|
90
|
+
import { MicrofrontendContext as Lr, useMicrofrontendContext as Rr } from "./shared-hooks.js";
|
|
91
|
+
import { detectDeviceType as zr, getResponsiveSelector as Br } from "./shared/tours/types.js";
|
|
92
|
+
import { useTourPlayer as Vr } from "./shared/tours/useTourPlayer.js";
|
|
93
|
+
import { TourSpotlight as Hr } from "./shared/tours/TourSpotlight.js";
|
|
94
|
+
import { TourTooltip as Ur } from "./shared/tours/TourTooltip.js";
|
|
95
|
+
import { TourPlayerProvider as Wr, useIsTourPlaying as Gr, useStartTour as Kr, useStopTour as qr, useTourPlayerContext as Jr } from "./shared/tours/TourPlayerProvider.js";
|
|
96
|
+
import { TourPlayer as Yr, TourTriggerButton as Xr, usePlayTour as Zr } from "./shared/tours/TourPlayer.js";
|
|
97
|
+
import { getTourContextRank as Qr, getTourRouteCatalog as $r, getTourRouteModules as ei, getTourRoutePages as ti, isTourVisibleForContext as ni, normalizeTourPath as ri, registerTourRouteCatalog as ii, resolveTourTargetPath as ai } from "./shared/tours/routeCatalog.js";
|
|
98
|
+
import { withTourProgressStatus as oi } from "./shared/tours/progress.js";
|
|
99
|
+
import { ToursProvider as si, useAutoStartTour as ci, useSafeToursContext as li, useTours as ui, useToursContext as di } from "./shared/tours/ToursContext.js";
|
|
100
|
+
import { TourInitializer as fi } from "./shared/tours/TourInitializer.js";
|
|
101
|
+
import { AppShellProvider as pi, resolveAppShellObservabilityConfig as mi } from "./shared/providers/AppShellProvider.js";
|
|
102
|
+
import { MicrofrontendProvider as hi } from "./shared-providers.js";
|
|
103
|
+
import { TourTrigger as gi } from "./shared/tours/TourTrigger.js";
|
|
103
104
|
import "./shared-tours.js";
|
|
104
|
-
import { getNativeBridge as
|
|
105
|
-
import { getPlatform as
|
|
106
|
-
import { nativeConfirm as
|
|
107
|
-
import { SafeAreaView as
|
|
108
|
-
import { useNativePlatform as
|
|
109
|
-
import { useSafeArea as
|
|
110
|
-
import { useNativeKeyboard as
|
|
111
|
-
import { useAppState as
|
|
112
|
-
import { useDeviceInfo as
|
|
113
|
-
import { useHaptics as
|
|
114
|
-
import { useStatusBar as
|
|
115
|
-
import { acknowledgeNativePurchase as
|
|
105
|
+
import { getNativeBridge as _i } from "./shared/native/bridge.js";
|
|
106
|
+
import { getPlatform as vi, isAndroid as yi, isElectron as bi, isIOS as xi, isInstalledApp as Si, isNative as Ci, isStandalonePWA as wi, isWeb as Ti, isWebBrowser as Ei } from "./shared/native/platform.js";
|
|
107
|
+
import { nativeConfirm as Di, nativeCopyText as Oi, nativeImpact as ki, nativeNotify as Ai, nativeOpenUrl as ji, nativeShare as Mi, nativeToast as Ni } from "./shared/native/consumers.js";
|
|
108
|
+
import { SafeAreaView as Pi } from "./shared/native/SafeAreaView.js";
|
|
109
|
+
import { useNativePlatform as Fi } from "./shared/native/hooks/useNativePlatform.js";
|
|
110
|
+
import { useSafeArea as Ii } from "./shared/native/hooks/useSafeArea.js";
|
|
111
|
+
import { useNativeKeyboard as Li } from "./shared/native/hooks/useNativeKeyboard.js";
|
|
112
|
+
import { useAppState as Ri } from "./shared/native/hooks/useAppState.js";
|
|
113
|
+
import { useDeviceInfo as zi } from "./shared/native/hooks/useDeviceInfo.js";
|
|
114
|
+
import { useHaptics as Bi } from "./shared/native/hooks/useHaptics.js";
|
|
115
|
+
import { useStatusBar as Vi } from "./shared/native/hooks/useStatusBar.js";
|
|
116
|
+
import { acknowledgeNativePurchase as Hi, getNativeProducts as Ui, getNativePurchases as Wi, installNativeIAP as Gi, isNativeIAPAvailable as Ki, purchaseNativeProduct as qi, restoreNativePurchases as Ji } from "./shared/native/purchases.js";
|
|
116
117
|
import "./shared-native.js";
|
|
117
118
|
import "./shared/actors/index.js";
|
|
118
119
|
//#region src/shared/index.ts
|
|
119
|
-
var
|
|
120
|
+
var Yi = "1.0.0";
|
|
120
121
|
//#endregion
|
|
121
|
-
export {
|
|
122
|
+
export { Ln as ASSISTANT_WIDGET_TOGGLE_EVENT, Qt as AccessDenied, Ut as ActorIdentity, Pe as ApolloClient, Fe as ApolloProvider, ln as AppErrorBoundary, bt as AppInitializer, pi as AppShellProvider, Rn as AssistantWidget, ie as BACKEND_ERROR_EVENT, Zn as BREAKPOINTS, Vn as BackendAuditSink, Bn as BroadcastChannelSink, G as COMMON_SHELL_LESS_ROUTES, ae as CONNECTION_STATUS_EVENT, on as ConditionalShell, Dt as ConsoleTransport, gn as ContextConversationWidget, Z as DEFAULT_PAGE_SIZE, K as DEFAULT_SHELL_CONFIG, zn as DevtoolsSink, Kt as ErrorBoundary, en as ErrorFallback, Wn as EventBusProvider, Yi as FE_SHARED_VERSION, un as FeatureFlagProvider, hn as FeatureGate, Q as GATEWAYS, xr as GLOBAL_SHORTCUT_CATEGORIES, Oe as GatewayProvider, Ie as InMemoryCache, An as KeyboardHelpDialogWrapper, tn as LoadingFallback, Ct as LogLevel, Tt as LogManager, wt as Logger, gr as MODIFIER_KEYS, Lr as MicrofrontendContext, an as MicrofrontendErrorBoundary, hi as MicrofrontendProvider, Un as OtelBrowserSink, Mr as PLAN_USAGE_SNAPSHOT_EVENT, _r as PLATFORM_TYPES, V as PRODUCTS, H as PRODUCT_URLS, cn as PWAInstallBanner, nn as PageLoadingFallback, Yt as PermissionButton, $t as PermissionDenied, Xt as PermissionGate, Zt as PermissionLink, Nt as QUOTA_EXHAUSTED_CODE, kr as QUOTA_EXHAUSTED_EVENT, jn as QuotaMeter, Pt as RESOURCE_CAP_EXCEEDED_CODE, qt as RequireAuth, Jt as RequireGuest, Hn as RybbitSink, Se as SSELink, rt as SSORedirectSpinner, ct as SSO_DEPOSITED_PARAM, Ft as STORAGE_QUOTA_EXCEEDED_CODE, Pi as SafeAreaView, rn as SectionLoadingFallback, fi as TourInitializer, Yr as TourPlayer, Wr as TourPlayerProvider, Hr as TourSpotlight, Ur as TourTooltip, gi as TourTrigger, Xr as TourTriggerButton, si as ToursProvider, It as UPGRADE_ERROR_CODES, Mn as UPGRADE_PROMPT_EVENT, Fn as UpgradeInlineBanner, Nn as UpgradePromptModal, Ne as WsLink, Hi as acknowledgeNativePurchase, r as alertTokens, Fr as appendContextToPath, Ue as attemptTokenRefresh, lt as beginSsoNavigation, Wt as buildActorFallback, Lt as buildQuotaExhaustedMessage, ut as buildSsoDepositUrl, m as capitalizeFirst, h as capitalizeWords, i as categoryTokens, it as checkRemoteSLO, at as checkSLO, We as clearAuthSessionStorage, pe as clearGraphqlFetchResponseCache, ot as clearLocalAuthState, Ye as clearSSoCookie, Xe as clearShellSsoCookies, dt as clearSsoDepositState, ft as clearSsoNavigation, Ot as clearUserContext, Ht as cn, pt as consumeSsoDepositMarker, n as createApolloClient, Gn as createEventBus, Sr as createGlobalShortcuts, Ce as createGraphQLClient, jt as createProfileScopedStorage, zr as detectDeviceType, _n as detectPlatform, oe as dispatchBackendErrorEvent, Ar as dispatchQuotaExhausted, Pn as dispatchUpgradePrompt, se as extractBackendError, Rt as extractQuotaExhaustedExtensions, zt as extractUpgradeErrorExtensions, g as formatBytes, _ as formatCompactNumber, v as formatCurrency, y as formatCurrencyCompact, b as formatDate, x as formatDateTime, S as formatDuration, vn as formatKeyCombo, C as formatList, w as formatNumber, T as formatOrdinal, E as formatPercentage, D as formatRelativeTime, O as formatTime, a as getAlertTokens, o as getCategoryTokens, yn as getDisplayKeysForPlatform, $ as getGatewayConfig, ee as getGatewayUrl, we as getGlobalClient, Cr as getGlobalShortcutsByCategory, te as getGraphQLEndpoint, _i as getNativeBridge, Ui as getNativeProducts, Wi as getNativePurchases, vi as getPlatform, U as getProductUrl, W as getProductsWithUrls, Mt as getProfileScopedKey, s as getProgressTokens, Br as getResponsiveSelector, st as getSSORedirectUrl, Ze as getSSoCookie, q as getShellConfig, bn as getShortcutLabel, c as getStatusBadgeTokens, l as getStatusTokens, me as getStoredAuthToken, he as getStoredLocale, ge as getStoredOrganizationId, _e as getStoredProjectId, ve as getStoredWorkspaceId, ye as getStoredWorkspaceToken, Qr as getTourContextRank, $r as getTourRouteCatalog, ei as getTourRouteModules, ti as getTourRoutePages, u as getTrendTokens, Te as getWorkspaceClient, ne as getWorkspaceTokenPayload, Le as gql, be as graphqlFetch, Ge as hasAuthGraphQLErrors, Ee as initializeAppClients, kt as initializeLogger, L as installGatewayFetchRewrite, Gi as installNativeIAP, ce as isAbortError, yi as isAndroid, Ke as isAuthGraphQLError, qe as isAuthNetworkError, le as isBackendErrorDisplay, P as isChunkLoadError, bi as isElectron, xi as isIOS, Si as isInstalledApp, xn as isMac, Sn as isMobileDevice, Ci as isNative, Ki as isNativeIAPAvailable, Bt as isQuotaExhaustedError, Qe as isSharedSsoCookieDomain, J as isShellLessRoute, mt as isSsoNavigationPending, wi as isStandalonePWA, Cn as isTabletDevice, ni as isTourVisibleForContext, ue as isTransportError, $e as isTrustedSsoOrigin, Vt as isUpgradeError, Ti as isWeb, Ei as isWebBrowser, re as isWorkspaceTokenValidForContext, F as lazyWithRetry, Et as logManager, de as markConnectionHealthy, ht as markSsoDepositDone, gt as markSsoDepositPending, wn as matchesKeyCombo, wr as mergeShortcuts, _t as mintSsoSessionTokens, Di as nativeConfirm, Oi as nativeCopyText, ki as nativeImpact, Ai as nativeNotify, ji as nativeOpenUrl, Mi as nativeShare, Ni as nativeToast, Tn as normalizeKey, En as normalizePlatformCombo, ri as normalizeTourPath, Dn as parseKeyCombo, k as pluralize, d as progressTokens, Nr as publishPlanUsageSnapshot, qi as purchaseNativeProduct, et as readShellSsoCookie, vt as readSsoDepositState, Je as redirectToLogin, ii as registerTourRouteCatalog, De as resetAppClients, mi as resolveAppShellObservabilityConfig, B as resolveAuthBridgeConfig, R as resolveGatewayBases, xe as resolveGatewayUrl, I as resolveGatewayUrls, ai as resolveTourTargetPath, Ji as restoreNativePurchases, tt as setSSoCookie, nt as setShellSsoCookies, At as setUserContext, yt as shouldAttemptSsoDeposit, On as shouldEnableKeyboardShortcuts, kn as shouldIgnoreShortcut, Y as shouldShowBreadcrumb, X as shouldShowSidebar, fe as shouldToastBackendError, A as slugify, f as statusTokens, z as suppressConsole, j as toCamelCase, M as toPascalCase, p as trendTokens, N as truncateText, Gt as useActorProfiles, Re as useApolloClient, Ri as useAppState, mr as useAsync, hr as useAsyncImmediate, ci as useAutoStartTour, Qn as useBreakpoint, ur as useConditionalToggle, e as useCopyToClipboard, Ir as useCurrentContextSearchParams, Yn as useDebounce, zi as useDeviceInfo, Kn as useEvent, qn as useEventBus, Jn as useEventEmitter, ir as useExclusiveMenu, fn as useFeatureFlag, pn as useFeatureFlagDetails, mn as useFeatureFlagValue, dn as useFeatureFlags, ke as useGateway, Ae as useGatewayClient, Bi as useHaptics, Er as useHasAnimated, yr as useHotkeys, Gr as useIsTourPlaying, nr as useKeyPress, rr as useKeyboardShortcut, vr as useKeyboardShortcuts, ze as useLazyQuery, ar as useLocalStorage, Tr as useLogger, t as useMediaQuery, Rr as useMicrofrontendContext, $n as useMobileBreakpoint, Be as useMutation, Li as useNativeKeyboard, Fi as useNativePlatform, er as useOnClickOutside, tr as useOnClickOutsideWithRef, sn as usePWA, pr as usePagination, Zr as usePlayTour, sr as usePrevious, cr as usePreviousDistinct, lr as usePreviousHistory, Ve as useQuery, jr as useQuotaErrorToast, Or as useRecordProductVisit, Dr as useReferralAttribution, xt as useRegistryHelpers, Ii as useSafeArea, je as useSafeGateway, Me as useSafeGatewayClient, li as useSafeToursContext, or as useSessionStorage, St as useShellNavigate, br as useShortcutHelp, Kr as useStartTour, Vi as useStatusBar, qr as useStopTour, He as useSubscription, Xn as useThrottle, dr as useToggle, fr as useToggleObject, Vr as useTourPlayer, Jr as useTourPlayerContext, ui as useTours, di as useToursContext, Pr as useUpgradePrompt, In as useVoiceInput, oi as withTourProgressStatus };
|
package/dist/utils/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import "../shared/utils/gatewayFetchRewrite.js";
|
|
|
6
6
|
import "../shared/utils/backendErrors.js";
|
|
7
7
|
import "../shared/utils/authErrorHandling.js";
|
|
8
8
|
import "../shared/utils/authCookie.js";
|
|
9
|
+
import "../shared/utils/ssoDeposit.js";
|
|
9
10
|
import "../shared/utils/appHelpers.js";
|
|
10
11
|
import "../shared/utils/loggerInit.js";
|
|
11
12
|
import "../shared/utils/profileScopedStorage.js";
|