@burdenoff/microfe-workspaces 2026.1109.1 → 2026.1110.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkspacesRoot.js +10 -9
- package/dist/WorkspacesRoutes.js +1 -2
- package/dist/components/CreateProjectDialog.js +22 -22
- package/dist/components/CreateWorkspaceDialog.js +8 -9
- package/dist/components/InviteMemberDialog.js +18 -23
- package/dist/components/MemberListItem.js +16 -17
- package/dist/components/ProjectCard.js +14 -15
- package/dist/components/ProjectMemberPickerDialog.js +92 -93
- package/dist/components/RenameProjectDialog.js +12 -17
- package/dist/components/WorkspaceCard.js +6 -7
- package/dist/components/WorkspaceContextPathSync.js +4 -5
- package/dist/components/WorkspacesErrorBoundary.js +6 -11
- package/dist/components/index.js +8 -7
- package/dist/components/tags/ProjectTagsWidget.js +56 -57
- package/dist/components/tags/WorkspaceTagsEditor.js +2 -3
- package/dist/constants/permissions.js +1 -2
- package/dist/generated/global-operations.js +1 -2
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/hooks/index.js +9 -8
- package/dist/hooks/useMemberMutations.js +165 -166
- package/dist/hooks/useOpenWorkspace.js +1 -2
- package/dist/hooks/useOrgsWithPermission.js +2 -3
- package/dist/hooks/usePendingInvitations.d.ts +1 -1
- package/dist/hooks/usePendingInvitations.js +2 -3
- package/dist/hooks/useProjectMemberMutations.js +23 -24
- package/dist/hooks/useProjectMembers.d.ts +2 -2
- package/dist/hooks/useProjectMembers.js +2 -3
- package/dist/hooks/useProjectMutations.js +68 -69
- package/dist/hooks/useProjects.d.ts +3 -3
- package/dist/hooks/useProjects.js +5 -6
- package/dist/hooks/useScopedNavigation.js +1 -2
- package/dist/hooks/useTenants.d.ts +2 -2
- package/dist/hooks/useTenants.js +3 -4
- package/dist/hooks/useTr.js +1 -2
- package/dist/hooks/useWorkspaceActivity.d.ts +1 -1
- package/dist/hooks/useWorkspaceActivity.js +2 -3
- package/dist/hooks/useWorkspaceMembers.d.ts +5 -5
- package/dist/hooks/useWorkspaceMembers.js +7 -8
- package/dist/hooks/useWorkspaceMutations.js +70 -71
- package/dist/hooks/useWorkspacePermissions.js +1 -2
- package/dist/hooks/useWorkspaceRoles.d.ts +1 -1
- package/dist/hooks/useWorkspaceRoles.js +3 -4
- package/dist/hooks/useWorkspaces.d.ts +3 -3
- package/dist/hooks/useWorkspaces.js +4 -5
- package/dist/hooks/useWorkspacesEventEmitter.js +1 -2
- package/dist/hooks/useWorkspacesPageView.js +1 -2
- package/dist/index.js +15 -15
- package/dist/pages/ActivityListPage.js +28 -29
- package/dist/pages/CreateWorkspacePage.js +137 -138
- package/dist/pages/InviteAcceptancePage.js +65 -66
- package/dist/pages/MembersListPage.js +203 -204
- package/dist/pages/PendingInvitesPage.js +63 -64
- package/dist/pages/ProjectDetailPage.js +71 -72
- package/dist/pages/ProjectMembersPage.js +116 -117
- package/dist/pages/ProjectsListPage.js +62 -67
- package/dist/pages/WorkspaceDetailPage.js +153 -154
- package/dist/pages/WorkspaceInvitePage.js +88 -92
- package/dist/pages/WorkspaceSettingsPage.js +32 -33
- package/dist/pages/WorkspacesListPage.js +40 -41
- package/dist/pages/dashboard/DashboardCustomizer.js +98 -94
- package/dist/pages/dashboard/DashboardGrid.js +1 -2
- package/dist/pages/dashboard/DashboardPage.js +12 -13
- package/dist/pages/dashboard/WidgetWrapper.js +3 -3
- package/dist/pages/dashboard/config.js +3 -4
- package/dist/pages/dashboard/hooks/useDashboardData.d.ts +5 -5
- package/dist/pages/dashboard/hooks/useDashboardData.js +9 -10
- package/dist/pages/dashboard/hooks/useDashboardPreferences.js +7 -8
- package/dist/pages/dashboard/reorder.js +11 -14
- package/dist/pages/dashboard/widgets/AgentsWidget.js +13 -14
- package/dist/pages/dashboard/widgets/GroupsWidget.js +9 -10
- package/dist/pages/dashboard/widgets/MembersWidget.js +10 -11
- package/dist/pages/dashboard/widgets/ProjectsWidget.js +11 -12
- package/dist/pages/dashboard/widgets/QuickActionsWidget.js +28 -29
- package/dist/pages/dashboard/widgets/RecentActivityWidget.js +22 -23
- package/dist/pages/dashboard/widgets/SessionsWidget.js +28 -29
- package/dist/pages/dashboard/widgets/StorageWidget.js +19 -20
- package/dist/pages/dashboard/widgets/TagCloudWidget.js +9 -10
- package/dist/pages/dashboard/widgets/TipsWidget.js +5 -6
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +17 -18
- package/dist/pages/dashboard/widgets/VibesWidget.js +13 -14
- package/dist/pages/dashboard/widgets/WelcomeWidget.js +11 -12
- package/dist/pages/dashboard/widgets/WorkflowRunsWidget.js +16 -17
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +11 -12
- package/dist/pages/dashboard/widgets/WorkflowsOverviewWidget.js +17 -18
- package/dist/pages/dashboard/widgets/WorkspacesWidget.js +7 -8
- package/dist/pages/dashboard/widgets/tipsCatalog.js +1 -2
- package/dist/providers/WorkspacesProvider.js +1 -2
- package/dist/store/workspacesStore.d.ts +1 -1
- package/dist/store/workspacesStore.js +1 -2
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.js +1 -2
- package/dist/utils/formatters.js +1 -2
- package/dist/utils/i18n.js +1 -2
- package/dist/utils/invitationDisplay.js +1 -2
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/pinnedRequest.js +2 -3
- package/dist/utils/projectTags.js +2 -3
- package/dist/utils/slug.js +1 -2
- package/dist/utils/telemetryError.js +13 -16
- package/dist/utils/tokenHelpers.js +1 -2
- package/dist/utils/workspaceBulkInviteCsv.js +3 -8
- package/package.json +72 -55
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { captureRequestActor as e, pinnedFetch as t } from "../utils/pinnedRequest.js";
|
|
2
|
+
import { useWorkspacesContext as n } from "../providers/WorkspacesProvider.js";
|
|
3
|
+
import { AcceptInvitationDocument as r, AddWorkspaceMemberDocument as i, BulkCreateInvitationsDocument as a, CancelInvitationDocument as o, CreateInvitationDocument as s, DeleteInvitationDocument as c, RejectInvitationDocument as l, RemoveUserFromWorkspaceDocument as u, RemoveWorkspaceMemberDocument as d, ResendInvitationDocument as f, UpdateInvitationDocument as p } from "../generated/wspace-operations.js";
|
|
4
|
+
import { useWorkspacesEventEmitter as m } from "./useWorkspacesEventEmitter.js";
|
|
5
5
|
import { safeTelemetryError as h } from "../utils/telemetryError.js";
|
|
6
6
|
import { useMutation as g, useQueryClient as _ } from "@tanstack/react-query";
|
|
7
7
|
import { print as v } from "graphql";
|
|
8
|
-
|
|
8
|
+
// src/hooks/useMemberMutations.ts
|
|
9
9
|
function y(e, t) {
|
|
10
10
|
e.invalidateQueries({ queryKey: ["workspaceMembers"] }), e.invalidateQueries({ queryKey: ["workspaceMembersInfinite"] }), e.invalidateQueries({ queryKey: ["userWorkspaces"] }), e.invalidateQueries({ queryKey: ["myWorkspaces"] }), e.invalidateQueries({ queryKey: ["dashboard", "global"] }), t && (e.invalidateQueries({ queryKey: ["workspaceMembers", t] }), e.invalidateQueries({ queryKey: ["workspaceMembersInfinite", t] }), e.invalidateQueries({ queryKey: [
|
|
11
11
|
"dashboard",
|
|
@@ -17,23 +17,23 @@ function b(e, t, n, r = !1) {
|
|
|
17
17
|
t && r && e.setQueriesData({ queryKey: ["myPendingInvitations"] }, (e) => Array.isArray(e) ? e.filter((e) => e.id !== t) : e), e.invalidateQueries({ queryKey: ["workspaceInvitations"] }), e.invalidateQueries({ queryKey: ["myPendingInvitations"] }), t && e.invalidateQueries({ queryKey: ["invitation", t] }), n && e.invalidateQueries({ queryKey: ["workspaceInvitations", n] });
|
|
18
18
|
}
|
|
19
19
|
var x = () => {
|
|
20
|
-
let { authToken:
|
|
20
|
+
let { authToken: r, currentUser: a, workspaceId: o } = n(), s = _(), { emit: c } = m();
|
|
21
21
|
return g({
|
|
22
|
-
mutationFn: async (
|
|
23
|
-
let
|
|
24
|
-
authToken:
|
|
25
|
-
currentUser:
|
|
26
|
-
}), {
|
|
22
|
+
mutationFn: async (n) => {
|
|
23
|
+
let s = e({
|
|
24
|
+
authToken: r,
|
|
25
|
+
currentUser: a
|
|
26
|
+
}), c = await t(s, {
|
|
27
27
|
gateway: "workspace",
|
|
28
|
-
query: v(
|
|
29
|
-
variables: { input:
|
|
30
|
-
workspaceId:
|
|
28
|
+
query: v(i),
|
|
29
|
+
variables: { input: n },
|
|
30
|
+
workspaceId: o || void 0
|
|
31
31
|
});
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
32
|
+
if (c.errors?.length) throw Error(c.errors[0]?.message || "GraphQL error");
|
|
33
|
+
return c.data.addWorkspaceMember;
|
|
34
34
|
},
|
|
35
35
|
onSuccess: (e) => {
|
|
36
|
-
y(
|
|
36
|
+
y(s, e.workspaceId), c("workspace-member.added", {
|
|
37
37
|
memberId: e.id,
|
|
38
38
|
workspaceId: e.workspaceId,
|
|
39
39
|
userId: e.userId,
|
|
@@ -41,324 +41,323 @@ var x = () => {
|
|
|
41
41
|
});
|
|
42
42
|
},
|
|
43
43
|
onError: (e, t) => {
|
|
44
|
-
|
|
45
|
-
workspaceId:
|
|
44
|
+
c("workspace-member.add_failed", {
|
|
45
|
+
workspaceId: o || void 0,
|
|
46
46
|
userId: t?.userId,
|
|
47
47
|
source: "microfe-workspaces",
|
|
48
48
|
errorMessage: h(e)
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
}, S = (
|
|
53
|
-
let { authToken:
|
|
52
|
+
}, S = (r) => {
|
|
53
|
+
let { authToken: i, currentUser: a, workspaceId: o } = n(), s = _(), { emit: c } = m(), l = r || o;
|
|
54
54
|
return g({
|
|
55
|
-
mutationFn: async (
|
|
56
|
-
let
|
|
57
|
-
authToken:
|
|
58
|
-
currentUser:
|
|
59
|
-
}), {
|
|
55
|
+
mutationFn: async (n) => {
|
|
56
|
+
let r = e({
|
|
57
|
+
authToken: i,
|
|
58
|
+
currentUser: a
|
|
59
|
+
}), o = await t(r, {
|
|
60
60
|
gateway: "workspace",
|
|
61
|
-
query: v(
|
|
62
|
-
variables: { id:
|
|
63
|
-
workspaceId:
|
|
61
|
+
query: v(d),
|
|
62
|
+
variables: { id: n },
|
|
63
|
+
workspaceId: l || void 0
|
|
64
64
|
});
|
|
65
|
-
if (
|
|
66
|
-
return
|
|
65
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "GraphQL error");
|
|
66
|
+
return o.data.removeWorkspaceMember;
|
|
67
67
|
},
|
|
68
68
|
onSuccess: (e, t) => {
|
|
69
|
-
y(
|
|
69
|
+
y(s, l), c("workspace-member.removed", {
|
|
70
70
|
memberId: t,
|
|
71
71
|
source: "microfe-workspaces"
|
|
72
72
|
});
|
|
73
73
|
},
|
|
74
74
|
onError: (e, t) => {
|
|
75
|
-
|
|
75
|
+
c("workspace-member.remove_failed", {
|
|
76
76
|
memberId: t,
|
|
77
|
-
workspaceId:
|
|
77
|
+
workspaceId: l || void 0,
|
|
78
78
|
source: "microfe-workspaces",
|
|
79
79
|
errorMessage: h(e)
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}, C = (
|
|
84
|
-
let { authToken:
|
|
83
|
+
}, C = (r) => {
|
|
84
|
+
let { authToken: i, currentUser: a, workspaceId: o } = n(), s = _(), { emit: c } = m(), l = r || o;
|
|
85
85
|
return g({
|
|
86
|
-
mutationFn: async (
|
|
87
|
-
let
|
|
88
|
-
authToken:
|
|
89
|
-
currentUser:
|
|
90
|
-
}), {
|
|
86
|
+
mutationFn: async (n) => {
|
|
87
|
+
let r = e({
|
|
88
|
+
authToken: i,
|
|
89
|
+
currentUser: a
|
|
90
|
+
}), o = await t(r, {
|
|
91
91
|
gateway: "workspace",
|
|
92
|
-
query: v(
|
|
93
|
-
variables: { userId:
|
|
94
|
-
workspaceId:
|
|
92
|
+
query: v(u),
|
|
93
|
+
variables: { userId: n },
|
|
94
|
+
workspaceId: l || void 0
|
|
95
95
|
});
|
|
96
|
-
if (
|
|
97
|
-
return
|
|
96
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "GraphQL error");
|
|
97
|
+
return o.data.removeUserFromWorkspace;
|
|
98
98
|
},
|
|
99
99
|
onSuccess: (e, t) => {
|
|
100
|
-
y(
|
|
100
|
+
y(s, l), s.invalidateQueries({ queryKey: ["userWorkspaces", t] }), c("workspace-member.removed", {
|
|
101
101
|
userId: t,
|
|
102
102
|
source: "microfe-workspaces"
|
|
103
103
|
});
|
|
104
104
|
},
|
|
105
105
|
onError: (e, t) => {
|
|
106
|
-
|
|
106
|
+
c("workspace-member.remove_failed", {
|
|
107
107
|
userId: t,
|
|
108
|
-
workspaceId:
|
|
108
|
+
workspaceId: l || void 0,
|
|
109
109
|
source: "microfe-workspaces",
|
|
110
110
|
errorMessage: h(e)
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
-
}, w = (
|
|
115
|
-
let { authToken:
|
|
114
|
+
}, w = (r) => {
|
|
115
|
+
let { authToken: i, currentUser: a, workspaceId: o } = n(), c = _(), { emit: l } = m(), u = r || o;
|
|
116
116
|
return g({
|
|
117
|
-
mutationFn: async (
|
|
118
|
-
let
|
|
119
|
-
authToken:
|
|
120
|
-
currentUser:
|
|
121
|
-
}), {
|
|
117
|
+
mutationFn: async (n) => {
|
|
118
|
+
let r = e({
|
|
119
|
+
authToken: i,
|
|
120
|
+
currentUser: a
|
|
121
|
+
}), o = await t(r, {
|
|
122
122
|
gateway: "workspace",
|
|
123
|
-
query: v(
|
|
124
|
-
variables: { input:
|
|
125
|
-
workspaceId:
|
|
123
|
+
query: v(s),
|
|
124
|
+
variables: { input: n },
|
|
125
|
+
workspaceId: n.workspaceId || u || void 0
|
|
126
126
|
});
|
|
127
|
-
if (
|
|
128
|
-
return
|
|
127
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "GraphQL error");
|
|
128
|
+
return o.data.createInvitation;
|
|
129
129
|
},
|
|
130
130
|
onSuccess: (e) => {
|
|
131
|
-
let t = e.workspaceId ??
|
|
132
|
-
b(
|
|
131
|
+
let t = e.workspaceId ?? u;
|
|
132
|
+
b(c, e.id, t), l("workspace-invitation.created", {
|
|
133
133
|
invitationId: e.id,
|
|
134
134
|
workspaceId: e.workspaceId,
|
|
135
135
|
source: "microfe-workspaces"
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
138
|
onError: (e, t) => {
|
|
139
|
-
|
|
140
|
-
workspaceId: t?.workspaceId ||
|
|
139
|
+
l("workspace-invitation.create_failed", {
|
|
140
|
+
workspaceId: t?.workspaceId || u || void 0,
|
|
141
141
|
source: "microfe-workspaces",
|
|
142
142
|
errorMessage: h(e)
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
}, T = () => {
|
|
147
|
-
let { authToken:
|
|
147
|
+
let { authToken: r, currentUser: i, workspaceId: a } = n(), o = _(), { emit: s } = m();
|
|
148
148
|
return g({
|
|
149
|
-
mutationFn: async ({ id:
|
|
150
|
-
let
|
|
151
|
-
authToken:
|
|
152
|
-
currentUser:
|
|
153
|
-
}), {
|
|
149
|
+
mutationFn: async ({ id: n, input: o }) => {
|
|
150
|
+
let s = e({
|
|
151
|
+
authToken: r,
|
|
152
|
+
currentUser: i
|
|
153
|
+
}), c = await t(s, {
|
|
154
154
|
gateway: "workspace",
|
|
155
|
-
query: v(
|
|
155
|
+
query: v(p),
|
|
156
156
|
variables: {
|
|
157
|
-
id:
|
|
158
|
-
input:
|
|
157
|
+
id: n,
|
|
158
|
+
input: o
|
|
159
159
|
},
|
|
160
|
-
workspaceId:
|
|
160
|
+
workspaceId: a || void 0
|
|
161
161
|
});
|
|
162
|
-
if (
|
|
163
|
-
return
|
|
162
|
+
if (c.errors?.length) throw Error(c.errors[0]?.message || "GraphQL error");
|
|
163
|
+
return c.data.updateInvitation;
|
|
164
164
|
},
|
|
165
165
|
onSuccess: (e) => {
|
|
166
|
-
b(
|
|
166
|
+
b(o, e.id, e.workspaceId), s("workspace-invitation.updated", {
|
|
167
167
|
invitationId: e.id,
|
|
168
168
|
workspaceId: e.workspaceId,
|
|
169
169
|
source: "microfe-workspaces"
|
|
170
170
|
});
|
|
171
171
|
},
|
|
172
172
|
onError: (e, t) => {
|
|
173
|
-
|
|
173
|
+
s("workspace-invitation.update_failed", {
|
|
174
174
|
invitationId: t?.id,
|
|
175
|
-
workspaceId:
|
|
175
|
+
workspaceId: a || void 0,
|
|
176
176
|
source: "microfe-workspaces",
|
|
177
177
|
errorMessage: h(e)
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
}, E = () => {
|
|
182
|
-
let { authToken:
|
|
182
|
+
let { authToken: i, currentUser: a, workspaceId: o } = n(), s = _(), { emit: c } = m();
|
|
183
183
|
return g({
|
|
184
|
-
mutationFn: async (
|
|
185
|
-
let
|
|
186
|
-
authToken:
|
|
187
|
-
currentUser:
|
|
188
|
-
}), {
|
|
184
|
+
mutationFn: async (n) => {
|
|
185
|
+
let s = e({
|
|
186
|
+
authToken: i,
|
|
187
|
+
currentUser: a
|
|
188
|
+
}), c = await t(s, {
|
|
189
189
|
gateway: "workspace",
|
|
190
|
-
query: v(
|
|
191
|
-
variables: { id:
|
|
192
|
-
workspaceId:
|
|
190
|
+
query: v(r),
|
|
191
|
+
variables: { id: n },
|
|
192
|
+
workspaceId: o || void 0
|
|
193
193
|
});
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
194
|
+
if (c.errors?.length) throw Error(c.errors[0]?.message || "GraphQL error");
|
|
195
|
+
return c.data.acceptInvitation;
|
|
196
196
|
},
|
|
197
197
|
onSuccess: (e) => {
|
|
198
|
-
b(
|
|
198
|
+
b(s, e.id, e.workspaceId, !0), y(s, e.workspaceId), c("workspace-invitation.accepted", {
|
|
199
199
|
invitationId: e.id,
|
|
200
200
|
workspaceId: e.workspaceId,
|
|
201
201
|
source: "microfe-workspaces"
|
|
202
202
|
});
|
|
203
203
|
},
|
|
204
204
|
onError: (e, t) => {
|
|
205
|
-
|
|
205
|
+
c("workspace-invitation.accept_failed", {
|
|
206
206
|
invitationId: t,
|
|
207
|
-
workspaceId:
|
|
207
|
+
workspaceId: o || void 0,
|
|
208
208
|
source: "microfe-workspaces",
|
|
209
209
|
errorMessage: h(e)
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
}, D = () => {
|
|
214
|
-
let { authToken:
|
|
214
|
+
let { authToken: r, currentUser: i, workspaceId: a } = n(), o = _(), { emit: s } = m();
|
|
215
215
|
return g({
|
|
216
|
-
mutationFn: async (
|
|
217
|
-
let
|
|
218
|
-
authToken:
|
|
219
|
-
currentUser:
|
|
220
|
-
}), {
|
|
216
|
+
mutationFn: async (n) => {
|
|
217
|
+
let o = e({
|
|
218
|
+
authToken: r,
|
|
219
|
+
currentUser: i
|
|
220
|
+
}), s = await t(o, {
|
|
221
221
|
gateway: "workspace",
|
|
222
|
-
query: v(
|
|
223
|
-
variables: { id:
|
|
224
|
-
workspaceId:
|
|
222
|
+
query: v(l),
|
|
223
|
+
variables: { id: n },
|
|
224
|
+
workspaceId: a || void 0
|
|
225
225
|
});
|
|
226
|
-
if (
|
|
227
|
-
return
|
|
226
|
+
if (s.errors?.length) throw Error(s.errors[0]?.message || "GraphQL error");
|
|
227
|
+
return s.data.rejectInvitation;
|
|
228
228
|
},
|
|
229
229
|
onSuccess: (e) => {
|
|
230
|
-
b(
|
|
230
|
+
b(o, e.id, e.workspaceId, !0), s("workspace-invitation.rejected", {
|
|
231
231
|
invitationId: e.id,
|
|
232
232
|
workspaceId: e.workspaceId,
|
|
233
233
|
source: "microfe-workspaces"
|
|
234
234
|
});
|
|
235
235
|
},
|
|
236
236
|
onError: (e, t) => {
|
|
237
|
-
|
|
237
|
+
s("workspace-invitation.reject_failed", {
|
|
238
238
|
invitationId: t,
|
|
239
|
-
workspaceId:
|
|
239
|
+
workspaceId: a || void 0,
|
|
240
240
|
source: "microfe-workspaces",
|
|
241
241
|
errorMessage: h(e)
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
|
-
}, O = (
|
|
246
|
-
let { authToken:
|
|
245
|
+
}, O = (r) => {
|
|
246
|
+
let { authToken: i, currentUser: a, workspaceId: s } = n(), c = _(), { emit: l } = m(), u = r || s;
|
|
247
247
|
return g({
|
|
248
|
-
mutationFn: async (
|
|
249
|
-
let
|
|
250
|
-
authToken:
|
|
251
|
-
currentUser:
|
|
252
|
-
}), {
|
|
248
|
+
mutationFn: async (n) => {
|
|
249
|
+
let r = e({
|
|
250
|
+
authToken: i,
|
|
251
|
+
currentUser: a
|
|
252
|
+
}), s = await t(r, {
|
|
253
253
|
gateway: "workspace",
|
|
254
|
-
query: v(
|
|
255
|
-
variables: { id:
|
|
256
|
-
workspaceId:
|
|
254
|
+
query: v(o),
|
|
255
|
+
variables: { id: n },
|
|
256
|
+
workspaceId: u || void 0
|
|
257
257
|
});
|
|
258
|
-
if (
|
|
259
|
-
return
|
|
258
|
+
if (s.errors?.length) throw Error(s.errors[0]?.message || "GraphQL error");
|
|
259
|
+
return s.data.cancelInvitation;
|
|
260
260
|
},
|
|
261
261
|
onSuccess: (e) => {
|
|
262
|
-
b(
|
|
262
|
+
b(c, e.id, e.workspaceId ?? u, !0), l("workspace-invitation.cancelled", {
|
|
263
263
|
invitationId: e.id,
|
|
264
264
|
workspaceId: e.workspaceId,
|
|
265
265
|
source: "microfe-workspaces"
|
|
266
266
|
});
|
|
267
267
|
},
|
|
268
268
|
onError: (e, t) => {
|
|
269
|
-
|
|
269
|
+
l("workspace-invitation.cancel_failed", {
|
|
270
270
|
invitationId: t,
|
|
271
|
-
workspaceId:
|
|
271
|
+
workspaceId: u || void 0,
|
|
272
272
|
source: "microfe-workspaces",
|
|
273
273
|
errorMessage: h(e)
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
|
-
}, k = (
|
|
278
|
-
let { authToken:
|
|
277
|
+
}, k = (r) => {
|
|
278
|
+
let { authToken: i, currentUser: a, workspaceId: o } = n(), s = _(), { emit: c } = m(), l = r || o;
|
|
279
279
|
return g({
|
|
280
|
-
mutationFn: async (
|
|
281
|
-
let
|
|
282
|
-
authToken:
|
|
283
|
-
currentUser:
|
|
284
|
-
}), {
|
|
280
|
+
mutationFn: async (n) => {
|
|
281
|
+
let r = e({
|
|
282
|
+
authToken: i,
|
|
283
|
+
currentUser: a
|
|
284
|
+
}), o = await t(r, {
|
|
285
285
|
gateway: "workspace",
|
|
286
|
-
query: v(
|
|
287
|
-
variables: { id:
|
|
288
|
-
workspaceId:
|
|
286
|
+
query: v(f),
|
|
287
|
+
variables: { id: n },
|
|
288
|
+
workspaceId: l || void 0
|
|
289
289
|
});
|
|
290
|
-
if (
|
|
291
|
-
return
|
|
290
|
+
if (o.errors?.length) throw Error(o.errors[0]?.message || "GraphQL error");
|
|
291
|
+
return o.data.resendInvitation;
|
|
292
292
|
},
|
|
293
293
|
onSuccess: (e) => {
|
|
294
|
-
b(
|
|
294
|
+
b(s, e.id, e.workspaceId ?? l), c("workspace-invitation.resent", {
|
|
295
295
|
invitationId: e.id,
|
|
296
296
|
workspaceId: e.workspaceId,
|
|
297
297
|
source: "microfe-workspaces"
|
|
298
298
|
});
|
|
299
299
|
},
|
|
300
300
|
onError: (e, t) => {
|
|
301
|
-
|
|
301
|
+
c("workspace-invitation.resend_failed", {
|
|
302
302
|
invitationId: t,
|
|
303
|
-
workspaceId:
|
|
303
|
+
workspaceId: l || void 0,
|
|
304
304
|
source: "microfe-workspaces",
|
|
305
305
|
errorMessage: h(e)
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
}, A = () => {
|
|
310
|
-
let { authToken:
|
|
310
|
+
let { authToken: r, currentUser: i, workspaceId: a } = n(), o = _(), { emit: s } = m();
|
|
311
311
|
return g({
|
|
312
|
-
mutationFn: async (
|
|
313
|
-
let
|
|
314
|
-
authToken:
|
|
315
|
-
currentUser:
|
|
316
|
-
}), {
|
|
312
|
+
mutationFn: async (n) => {
|
|
313
|
+
let o = e({
|
|
314
|
+
authToken: r,
|
|
315
|
+
currentUser: i
|
|
316
|
+
}), s = await t(o, {
|
|
317
317
|
gateway: "workspace",
|
|
318
|
-
query: v(
|
|
319
|
-
variables: { id:
|
|
320
|
-
workspaceId:
|
|
318
|
+
query: v(c),
|
|
319
|
+
variables: { id: n },
|
|
320
|
+
workspaceId: a || void 0
|
|
321
321
|
});
|
|
322
|
-
if (
|
|
323
|
-
return
|
|
322
|
+
if (s.errors?.length) throw Error(s.errors[0]?.message || "GraphQL error");
|
|
323
|
+
return s.data.deleteInvitation;
|
|
324
324
|
},
|
|
325
325
|
onSuccess: (e, t) => {
|
|
326
|
-
b(
|
|
326
|
+
b(o, t, a, !0), s("workspace-invitation.deleted", {
|
|
327
327
|
invitationId: t,
|
|
328
328
|
source: "microfe-workspaces"
|
|
329
329
|
});
|
|
330
330
|
},
|
|
331
331
|
onError: (e, t) => {
|
|
332
|
-
|
|
332
|
+
s("workspace-invitation.delete_failed", {
|
|
333
333
|
invitationId: t,
|
|
334
|
-
workspaceId:
|
|
334
|
+
workspaceId: a || void 0,
|
|
335
335
|
source: "microfe-workspaces",
|
|
336
336
|
errorMessage: h(e)
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
}, j = () => {
|
|
341
|
-
let { authToken:
|
|
341
|
+
let { authToken: r, currentUser: i, workspaceId: o } = n(), s = _();
|
|
342
342
|
return g({
|
|
343
|
-
mutationFn: async (
|
|
344
|
-
let
|
|
345
|
-
authToken:
|
|
346
|
-
currentUser:
|
|
347
|
-
}), {
|
|
343
|
+
mutationFn: async (n) => {
|
|
344
|
+
let s = e({
|
|
345
|
+
authToken: r,
|
|
346
|
+
currentUser: i
|
|
347
|
+
}), c = await t(s, {
|
|
348
348
|
gateway: "workspace",
|
|
349
|
-
query: v(
|
|
350
|
-
variables: { inputs:
|
|
351
|
-
workspaceId:
|
|
349
|
+
query: v(a),
|
|
350
|
+
variables: { inputs: n },
|
|
351
|
+
workspaceId: n[0]?.workspaceId || o || void 0
|
|
352
352
|
});
|
|
353
|
-
if (
|
|
354
|
-
return
|
|
353
|
+
if (c.errors?.length) throw Error(c.errors[0]?.message || "GraphQL error");
|
|
354
|
+
return c.data.bulkCreateInvitations;
|
|
355
355
|
},
|
|
356
356
|
onSuccess: (e) => {
|
|
357
|
-
|
|
357
|
+
s.invalidateQueries({ queryKey: ["workspaceInvitations"] }), s.invalidateQueries({ queryKey: ["myPendingInvitations"] });
|
|
358
358
|
let t = new Set(e.map((e) => e.workspaceId).filter(Boolean));
|
|
359
|
-
for (let e of t)
|
|
359
|
+
for (let e of t) s.invalidateQueries({ queryKey: ["workspaceInvitations", e] });
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
};
|
|
363
|
-
//#endregion
|
|
364
363
|
export { E as useAcceptInvitation, x as useAddWorkspaceMember, j as useBulkCreateInvitations, O as useCancelInvitation, w as useCreateInvitation, A as useDeleteInvitation, D as useRejectInvitation, C as useRemoveUserFromWorkspace, S as useRemoveWorkspaceMember, k as useResendInvitation, T as useUpdateInvitation };
|
|
@@ -3,7 +3,7 @@ import { useScopedNavigation as t } from "./useScopedNavigation.js";
|
|
|
3
3
|
import { useCallback as n } from "react";
|
|
4
4
|
import { useActiveContext as r } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
5
|
import { useNavigate as i } from "react-router";
|
|
6
|
-
|
|
6
|
+
// src/hooks/useOpenWorkspace.ts
|
|
7
7
|
function a(e, t) {
|
|
8
8
|
let n = t.organizationId ?? t.orgId;
|
|
9
9
|
n && e.setOrganization(n), e.setWorkspace(t.id), e.setProject(null), typeof t.tenantId == "string" && e.setTenant(t.tenantId);
|
|
@@ -27,5 +27,4 @@ function o() {
|
|
|
27
27
|
c
|
|
28
28
|
]);
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { a as commitWorkspaceSelection, o as useOpenWorkspace };
|
|
@@ -3,7 +3,7 @@ import { useMemo as t } from "react";
|
|
|
3
3
|
import { useAuth as n } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
4
4
|
import { useQuery as r } from "@tanstack/react-query";
|
|
5
5
|
import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
|
-
|
|
6
|
+
// src/hooks/useOrgsWithPermission.ts
|
|
7
7
|
var a = 50, o = "\n query CheckRbacPermissions($inputs: [PermissionCheckInput!]!) {\n checkPermissions(inputs: $inputs) {\n allowed\n }\n }\n";
|
|
8
8
|
function s(s, c, l) {
|
|
9
9
|
let { user: u } = n(), { authToken: d } = e(), f = u?.id ?? "", p = !!(f && s.length > 0), m = t(() => s.join(","), [s]), h = t(() => m ? m.split(",") : [], [m]), { data: g, isLoading: _, error: v } = r({
|
|
@@ -35,7 +35,7 @@ function s(s, c, l) {
|
|
|
35
35
|
return t.data?.checkPermissions ?? [];
|
|
36
36
|
}))).flat();
|
|
37
37
|
},
|
|
38
|
-
staleTime:
|
|
38
|
+
staleTime: 6e4
|
|
39
39
|
});
|
|
40
40
|
return {
|
|
41
41
|
allowedIds: t(() => {
|
|
@@ -49,5 +49,4 @@ function s(s, c, l) {
|
|
|
49
49
|
isError: p && !!v
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
export { s as useOrgsWithPermission };
|
|
@@ -4,4 +4,4 @@ import { WorkspaceInvitation } from '../types';
|
|
|
4
4
|
* Kept in its own module so route-level consumers do not depend on the larger
|
|
5
5
|
* workspace-members hook module just to render the invites surfaces.
|
|
6
6
|
*/
|
|
7
|
-
export declare const useMyPendingInvitations: (email?: string) => import('@tanstack/react-query').UseQueryResult<
|
|
7
|
+
export declare const useMyPendingInvitations: (email?: string) => import('@tanstack/react-query').UseQueryResult<WorkspaceInvitation[], Error>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
2
|
import { useQuery as t } from "@tanstack/react-query";
|
|
3
3
|
import { graphqlFetch as n } from "@burdenoff/fe-libs/shared/graphql";
|
|
4
|
-
|
|
4
|
+
// src/hooks/usePendingInvitations.ts
|
|
5
5
|
var r = "\n query GetMyPendingInvitations {\n myPendingInvitations {\n id\n email\n status\n roleIds\n workspaceId\n invitedById\n expiresAt\n createdAt\n projectId\n invitedUserId\n updatedAt\n deletedAt\n context {\n type\n metadata\n }\n }\n }\n", i = (i) => {
|
|
6
6
|
let { authToken: a } = e();
|
|
7
7
|
return t({
|
|
@@ -17,8 +17,7 @@ var r = "\n query GetMyPendingInvitations {\n myPendingInvitations {\n
|
|
|
17
17
|
return e.data?.myPendingInvitations ?? [];
|
|
18
18
|
},
|
|
19
19
|
enabled: !!i,
|
|
20
|
-
staleTime:
|
|
20
|
+
staleTime: 6e4
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { i as useMyPendingInvitations };
|