@burdenoff/microfe-workspaces 2026.1120.1 → 2026.1123.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.
Files changed (56) hide show
  1. package/dist/WorkspacesRoot.js +39 -31
  2. package/dist/WorkspacesRoutes.js +91 -59
  3. package/dist/components/ProjectCard.js +48 -47
  4. package/dist/constants/navigationV2.d.ts +5 -0
  5. package/dist/constants/navigationV2.js +2 -2
  6. package/dist/generated/global-operations.d.ts +11 -1
  7. package/dist/generated/global-types.d.ts +9866 -574
  8. package/dist/generated/wspace-operations.d.ts +631 -2
  9. package/dist/generated/wspace-operations.js +5428 -1376
  10. package/dist/generated/wspace-types.d.ts +200319 -48046
  11. package/dist/generated/wspace-types.js +19 -0
  12. package/dist/hooks/useCollaboration.d.ts +143 -0
  13. package/dist/hooks/useCollaboration.js +119 -0
  14. package/dist/hooks/useCollaborationMutations.d.ts +177 -0
  15. package/dist/hooks/useCollaborationMutations.js +126 -0
  16. package/dist/hooks/v2/useWorkspacePagesV2Data.d.ts +89 -0
  17. package/dist/hooks/v2/useWorkspacePagesV2Data.js +211 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/node_modules/sonner/dist/index.js +167 -0
  20. package/dist/pages/CollaborationConsolePage.d.ts +1 -0
  21. package/dist/pages/CollaborationConsolePage.js +1059 -0
  22. package/dist/pages/MembersListPage.js +101 -100
  23. package/dist/pages/ProjectMembersPage.js +116 -115
  24. package/dist/pages/ProjectsListPage.js +233 -232
  25. package/dist/pages/WorkspacesListPage.js +79 -68
  26. package/dist/pages/v2/ActivityPage.d.ts +1 -0
  27. package/dist/pages/v2/ActivityPage.js +150 -0
  28. package/dist/pages/v2/InvitePeopleDialog.d.ts +11 -0
  29. package/dist/pages/v2/InvitePeopleDialog.js +208 -0
  30. package/dist/pages/v2/InvitedTab.d.ts +9 -0
  31. package/dist/pages/v2/InvitedTab.js +223 -0
  32. package/dist/pages/v2/MembersPage.d.ts +1 -0
  33. package/dist/pages/v2/MembersPage.js +120 -0
  34. package/dist/pages/v2/PeopleTab.d.ts +20 -0
  35. package/dist/pages/v2/PeopleTab.js +253 -0
  36. package/dist/pages/v2/ProjectsPage.d.ts +1 -0
  37. package/dist/pages/v2/ProjectsPage.js +242 -0
  38. package/dist/pages/v2/WorkspacesPage.d.ts +3 -0
  39. package/dist/pages/v2/WorkspacesPage.js +247 -0
  40. package/dist/pages/v2/activitySentences.d.ts +50 -0
  41. package/dist/pages/v2/activitySentences.js +288 -0
  42. package/dist/pages/v2/inviteEmails.d.ts +12 -0
  43. package/dist/pages/v2/inviteEmails.js +18 -0
  44. package/dist/pages/v2/memberRows.d.ts +54 -0
  45. package/dist/pages/v2/memberRows.js +51 -0
  46. package/dist/pages/v2/projectRows.d.ts +10 -0
  47. package/dist/pages/v2/projectRows.js +10 -0
  48. package/dist/pages/v2/relativeTime.d.ts +6 -0
  49. package/dist/pages/v2/relativeTime.js +30 -0
  50. package/dist/store/workspacesStore.d.ts +2 -1
  51. package/dist/store/workspacesStore.js +1 -1
  52. package/dist/translations/en.d.ts +436 -0
  53. package/dist/translations/en.js +436 -0
  54. package/dist/types/index.d.ts +19 -0
  55. package/dist/utils/nativeBridge.js +1 -1
  56. package/package.json +3 -3
@@ -0,0 +1,19 @@
1
+ // src/generated/wspace-types.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.ClientDirect = "CLIENT_DIRECT", e.Consolidated = "CONSOLIDATED", e.Split = "SPLIT", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e.ManageMembers = "MANAGE_MEMBERS", e.ManageProjects = "MANAGE_PROJECTS", e.ManageShares = "MANAGE_SHARES", e.ViewBillingSummary = "VIEW_BILLING_SUMMARY", e.ViewOverview = "VIEW_OVERVIEW", e;
6
+ }({}), n = /* @__PURE__ */ function(e) {
7
+ return e.All = "ALL", e.Client = "CLIENT", e.Msp = "MSP", e;
8
+ }({}), r = /* @__PURE__ */ function(e) {
9
+ return e.Active = "ACTIVE", e.Pending = "PENDING", e.Revoked = "REVOKED", e.Suspended = "SUSPENDED", e;
10
+ }({}), i = /* @__PURE__ */ function(e) {
11
+ return e.Admin = "ADMIN", e.Collaborate = "COLLABORATE", e.ReadOnly = "READ_ONLY", e;
12
+ }({}), a = /* @__PURE__ */ function(e) {
13
+ return e.All = "ALL", e.Inbound = "INBOUND", e.Outbound = "OUTBOUND", e;
14
+ }({}), o = /* @__PURE__ */ function(e) {
15
+ return e.Channel = "CHANNEL", e.Mentions = "MENTIONS", e.Project = "PROJECT", e;
16
+ }({}), s = /* @__PURE__ */ function(e) {
17
+ return e.Active = "ACTIVE", e.Expired = "EXPIRED", e.Pending = "PENDING", e.Revoked = "REVOKED", e;
18
+ }({});
19
+ export { e as MspBillingMode, t as MspDelegatedScope, n as MspLinkRole, r as MspOrgLinkStatus, i as WorkspaceShareAccessLevel, a as WorkspaceShareDirection, o as WorkspaceShareResourceType, s as WorkspaceShareStatus };
@@ -0,0 +1,143 @@
1
+ import { GetCrossWorkspaceOverviewQuery, GetMspOrgLinksQuery, GetMspOrganizationSummaryQuery, GetWorkspaceSharesQuery } from '../generated/wspace-operations';
2
+ import { MspLinkRole, MspOrgLinkStatus, WorkspaceShareDirection, WorkspaceShareStatus } from '../generated/wspace-types';
3
+ export type CrossWorkspaceOverviewData = GetCrossWorkspaceOverviewQuery['crossWorkspaceOverview'];
4
+ export type CrossWorkspaceOrgSummaryData = CrossWorkspaceOverviewData['organizations'][number];
5
+ export type WorkspaceShareItem = GetWorkspaceSharesQuery['workspaceShares']['items'][number];
6
+ export type MspOrgLinkItem = GetMspOrgLinksQuery['mspOrgLinks']['items'][number];
7
+ export type MspOrganizationSummaryData = GetMspOrganizationSummaryQuery['mspOrganizationSummary'];
8
+ export declare function useCrossWorkspaceOverview(): import('@tanstack/react-query').UseQueryResult<{
9
+ totals: {
10
+ organizationCount: number;
11
+ managedOrganizationCount: number;
12
+ workspaceCount: number;
13
+ activeWorkspaceCount: number;
14
+ totalActiveSeats: number;
15
+ totalProjects: number;
16
+ activeShareCount: number;
17
+ };
18
+ organizations: Array<{
19
+ orgId: string;
20
+ orgName: string;
21
+ tenantId: string;
22
+ managedByMsp: boolean;
23
+ mspLinkId: string | null;
24
+ mspLinkStatus: import('../generated/wspace-operations').MspOrgLinkStatus | null;
25
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
26
+ workspaceCount: number;
27
+ activeWorkspaceCount: number;
28
+ totalMemberCount: number;
29
+ totalProjectCount: number;
30
+ activeShareCount: number;
31
+ billingSummary: {
32
+ totalWorkspaces: number;
33
+ activeWorkspaces: number;
34
+ totalActiveSeats: number;
35
+ totalProjects: number;
36
+ totalResources: number;
37
+ subscribedProductCount: number;
38
+ billingMode: import('../generated/wspace-operations').MspBillingMode | null;
39
+ monthlySeatBudget: number | null;
40
+ seatUtilizationPercent: number | null;
41
+ };
42
+ workspaces: Array<{
43
+ id: string;
44
+ name: string;
45
+ status: import('../generated/wspace-operations').WorkspaceStatus;
46
+ orgId: string;
47
+ tenantId: string;
48
+ memberCount: number;
49
+ projectCount: number;
50
+ resourceCount: number;
51
+ subscribedProductCount: number;
52
+ activeShareCount: number;
53
+ managedViaMsp: boolean;
54
+ mspLinkId: string | null;
55
+ createdAt: string;
56
+ }>;
57
+ }>;
58
+ }, Error>;
59
+ export declare function useWorkspaceShares(workspaceId: string | undefined, direction?: WorkspaceShareDirection, status?: WorkspaceShareStatus): import('@tanstack/react-query').UseQueryResult<{
60
+ totalCount: number;
61
+ items: Array<{
62
+ id: string;
63
+ workspaceId: string;
64
+ sourceWorkspaceName: string | null;
65
+ sourceOrgId: string;
66
+ targetWorkspaceId: string;
67
+ targetWorkspaceName: string | null;
68
+ targetOrgId: string;
69
+ resourceType: import('../generated/wspace-operations').WorkspaceShareResourceType;
70
+ resourceId: string;
71
+ resourceName: string;
72
+ accessLevel: import('../generated/wspace-operations').WorkspaceShareAccessLevel;
73
+ status: import('../generated/wspace-operations').WorkspaceShareStatus;
74
+ consentScope: string;
75
+ consentGrantedBy: string | null;
76
+ consentGrantedAt: string | null;
77
+ expiresAt: string | null;
78
+ revokedAt: string | null;
79
+ revokedBy: string | null;
80
+ revocationReason: string | null;
81
+ createdAt: string;
82
+ updatedAt: string;
83
+ createdBy: string;
84
+ }>;
85
+ }, Error>;
86
+ export declare function useMspOrgLinks(workspaceId: string | undefined, role?: MspLinkRole, status?: MspOrgLinkStatus): import('@tanstack/react-query').UseQueryResult<{
87
+ totalCount: number;
88
+ items: Array<{
89
+ id: string;
90
+ workspaceId: string;
91
+ mspOrgId: string;
92
+ clientOrgId: string;
93
+ clientOrgName: string;
94
+ clientWorkspaceId: string | null;
95
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
96
+ status: import('../generated/wspace-operations').MspOrgLinkStatus;
97
+ billingMode: import('../generated/wspace-operations').MspBillingMode;
98
+ monthlySeatBudget: number | null;
99
+ consentGrantedBy: string | null;
100
+ consentGrantedAt: string | null;
101
+ expiresAt: string | null;
102
+ revokedAt: string | null;
103
+ revokedBy: string | null;
104
+ notes: string | null;
105
+ createdAt: string;
106
+ updatedAt: string;
107
+ createdBy: string;
108
+ }>;
109
+ }, Error>;
110
+ export declare function useMspOrganizationSummary(workspaceId: string | undefined, targetOrgId: string | null): import('@tanstack/react-query').UseQueryResult<{
111
+ orgId: string;
112
+ orgName: string;
113
+ managedViaMsp: boolean;
114
+ mspLinkId: string | null;
115
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
116
+ activeSharesCount: number;
117
+ billingSummary: {
118
+ totalWorkspaces: number;
119
+ activeWorkspaces: number;
120
+ totalActiveSeats: number;
121
+ totalProjects: number;
122
+ totalResources: number;
123
+ subscribedProductCount: number;
124
+ billingMode: import('../generated/wspace-operations').MspBillingMode | null;
125
+ monthlySeatBudget: number | null;
126
+ seatUtilizationPercent: number | null;
127
+ };
128
+ workspaces: Array<{
129
+ id: string;
130
+ name: string;
131
+ status: import('../generated/wspace-operations').WorkspaceStatus;
132
+ orgId: string;
133
+ tenantId: string;
134
+ memberCount: number;
135
+ projectCount: number;
136
+ resourceCount: number;
137
+ subscribedProductCount: number;
138
+ activeShareCount: number;
139
+ managedViaMsp: boolean;
140
+ mspLinkId: string | null;
141
+ createdAt: string;
142
+ }>;
143
+ }, Error>;
@@ -0,0 +1,119 @@
1
+ import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
2
+ import { GetCrossWorkspaceOverviewDocument as t, GetMspOrgLinksDocument as n, GetMspOrganizationSummaryDocument as r, GetWorkspaceSharesDocument as i } from "../generated/wspace-operations.js";
3
+ import { MspLinkRole as a, WorkspaceShareDirection as o } from "../generated/wspace-types.js";
4
+ import { useQuery as s } from "@tanstack/react-query";
5
+ import { print as c } from "graphql";
6
+ import { graphqlFetch as l } from "@burdenoff/fe-libs/shared/graphql";
7
+ // src/hooks/useCollaboration.ts
8
+ function u() {
9
+ let { authToken: n } = e();
10
+ return s({
11
+ queryKey: ["crossWorkspaceOverview"],
12
+ queryFn: async () => {
13
+ let e = await l({
14
+ gateway: "workspace",
15
+ authToken: n || void 0,
16
+ workspaceToken: !0,
17
+ query: c(t)
18
+ });
19
+ if (e.errors?.length) throw Error(e.errors[0]?.message || "Failed to load cross-workspace overview");
20
+ if (!e.data?.crossWorkspaceOverview) throw Error("Cross-workspace overview returned empty response");
21
+ return e.data.crossWorkspaceOverview;
22
+ },
23
+ staleTime: 6e4,
24
+ retry: 1
25
+ });
26
+ }
27
+ function d(t, n = o.All, r) {
28
+ let { authToken: a } = e();
29
+ return s({
30
+ queryKey: [
31
+ "workspaceShares",
32
+ t,
33
+ n,
34
+ r
35
+ ],
36
+ queryFn: async () => {
37
+ let e = await l({
38
+ gateway: "workspace",
39
+ authToken: a || void 0,
40
+ workspaceToken: !0,
41
+ query: c(i),
42
+ variables: {
43
+ workspaceId: t,
44
+ direction: n,
45
+ status: r
46
+ }
47
+ });
48
+ if (e.errors?.length) throw Error(e.errors[0]?.message || "Failed to load workspace shares");
49
+ return e.data?.workspaceShares ?? {
50
+ items: [],
51
+ totalCount: 0
52
+ };
53
+ },
54
+ enabled: !!t,
55
+ staleTime: 3e4,
56
+ retry: 1
57
+ });
58
+ }
59
+ function f(t, r = a.All, i) {
60
+ let { authToken: o } = e();
61
+ return s({
62
+ queryKey: [
63
+ "mspOrgLinks",
64
+ t,
65
+ r,
66
+ i
67
+ ],
68
+ queryFn: async () => {
69
+ let e = await l({
70
+ gateway: "workspace",
71
+ authToken: o || void 0,
72
+ workspaceToken: !0,
73
+ query: c(n),
74
+ variables: {
75
+ workspaceId: t,
76
+ role: r,
77
+ status: i
78
+ }
79
+ });
80
+ if (e.errors?.length) throw Error(e.errors[0]?.message || "Failed to load MSP organization links");
81
+ return e.data?.mspOrgLinks ?? {
82
+ items: [],
83
+ totalCount: 0
84
+ };
85
+ },
86
+ enabled: !!t,
87
+ staleTime: 3e4,
88
+ retry: 1
89
+ });
90
+ }
91
+ function p(t, n) {
92
+ let { authToken: i } = e();
93
+ return s({
94
+ queryKey: [
95
+ "mspOrganizationSummary",
96
+ t,
97
+ n
98
+ ],
99
+ queryFn: async () => {
100
+ let e = await l({
101
+ gateway: "workspace",
102
+ authToken: i || void 0,
103
+ workspaceToken: !0,
104
+ query: c(r),
105
+ variables: {
106
+ workspaceId: t,
107
+ targetOrgId: n
108
+ }
109
+ });
110
+ if (e.errors?.length) throw Error(e.errors[0]?.message || "Failed to load organization summary");
111
+ if (!e.data?.mspOrganizationSummary) throw Error("Organization summary unavailable");
112
+ return e.data.mspOrganizationSummary;
113
+ },
114
+ enabled: !!(t && n),
115
+ staleTime: 3e4,
116
+ retry: 1
117
+ });
118
+ }
119
+ export { u as useCrossWorkspaceOverview, f as useMspOrgLinks, p as useMspOrganizationSummary, d as useWorkspaceShares };
@@ -0,0 +1,177 @@
1
+ import { CreateMspOrgLinkInput, CreateWorkspaceShareInput, UpdateMspOrgLinkInput } from '../generated/wspace-types';
2
+ /**
3
+ * Actor-bound mutations for Cross-Workspace Shares & MSP Multi-Org Links (BOFF-4425).
4
+ * Every mutation captures the acting account via `captureRequestActor` and dispatches
5
+ * through `pinnedFetch` so an in-flight profile switch can never misattribute a consent grant.
6
+ */
7
+ export declare function useCollaborationMutations(): {
8
+ createShare: import('@tanstack/react-query').UseMutationResult<{
9
+ id: string;
10
+ workspaceId: string;
11
+ sourceWorkspaceName: string | null;
12
+ sourceOrgId: string;
13
+ targetWorkspaceId: string;
14
+ targetWorkspaceName: string | null;
15
+ targetOrgId: string;
16
+ resourceType: import('../generated/wspace-operations').WorkspaceShareResourceType;
17
+ resourceId: string;
18
+ resourceName: string;
19
+ accessLevel: import('../generated/wspace-operations').WorkspaceShareAccessLevel;
20
+ status: import('../generated/wspace-operations').WorkspaceShareStatus;
21
+ consentScope: string;
22
+ consentGrantedBy: string | null;
23
+ consentGrantedAt: string | null;
24
+ expiresAt: string | null;
25
+ revokedAt: string | null;
26
+ revokedBy: string | null;
27
+ revocationReason: string | null;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ createdBy: string;
31
+ }, Error, CreateWorkspaceShareInput, unknown>;
32
+ acceptShare: import('@tanstack/react-query').UseMutationResult<{
33
+ id: string;
34
+ workspaceId: string;
35
+ sourceWorkspaceName: string | null;
36
+ sourceOrgId: string;
37
+ targetWorkspaceId: string;
38
+ targetWorkspaceName: string | null;
39
+ targetOrgId: string;
40
+ resourceType: import('../generated/wspace-operations').WorkspaceShareResourceType;
41
+ resourceId: string;
42
+ resourceName: string;
43
+ accessLevel: import('../generated/wspace-operations').WorkspaceShareAccessLevel;
44
+ status: import('../generated/wspace-operations').WorkspaceShareStatus;
45
+ consentScope: string;
46
+ consentGrantedBy: string | null;
47
+ consentGrantedAt: string | null;
48
+ expiresAt: string | null;
49
+ revokedAt: string | null;
50
+ revokedBy: string | null;
51
+ revocationReason: string | null;
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ createdBy: string;
55
+ }, Error, {
56
+ workspaceId: string;
57
+ shareId: string;
58
+ }, unknown>;
59
+ revokeShare: import('@tanstack/react-query').UseMutationResult<{
60
+ id: string;
61
+ workspaceId: string;
62
+ sourceWorkspaceName: string | null;
63
+ sourceOrgId: string;
64
+ targetWorkspaceId: string;
65
+ targetWorkspaceName: string | null;
66
+ targetOrgId: string;
67
+ resourceType: import('../generated/wspace-operations').WorkspaceShareResourceType;
68
+ resourceId: string;
69
+ resourceName: string;
70
+ accessLevel: import('../generated/wspace-operations').WorkspaceShareAccessLevel;
71
+ status: import('../generated/wspace-operations').WorkspaceShareStatus;
72
+ consentScope: string;
73
+ consentGrantedBy: string | null;
74
+ consentGrantedAt: string | null;
75
+ expiresAt: string | null;
76
+ revokedAt: string | null;
77
+ revokedBy: string | null;
78
+ revocationReason: string | null;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ createdBy: string;
82
+ }, Error, {
83
+ workspaceId: string;
84
+ shareId: string;
85
+ reason?: string;
86
+ }, unknown>;
87
+ createMspLink: import('@tanstack/react-query').UseMutationResult<{
88
+ id: string;
89
+ workspaceId: string;
90
+ mspOrgId: string;
91
+ clientOrgId: string;
92
+ clientOrgName: string;
93
+ clientWorkspaceId: string | null;
94
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
95
+ status: import('../generated/wspace-operations').MspOrgLinkStatus;
96
+ billingMode: import('../generated/wspace-operations').MspBillingMode;
97
+ monthlySeatBudget: number | null;
98
+ consentGrantedBy: string | null;
99
+ consentGrantedAt: string | null;
100
+ expiresAt: string | null;
101
+ revokedAt: string | null;
102
+ revokedBy: string | null;
103
+ notes: string | null;
104
+ createdAt: string;
105
+ updatedAt: string;
106
+ createdBy: string;
107
+ }, Error, CreateMspOrgLinkInput, unknown>;
108
+ approveMspLink: import('@tanstack/react-query').UseMutationResult<{
109
+ id: string;
110
+ workspaceId: string;
111
+ mspOrgId: string;
112
+ clientOrgId: string;
113
+ clientOrgName: string;
114
+ clientWorkspaceId: string | null;
115
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
116
+ status: import('../generated/wspace-operations').MspOrgLinkStatus;
117
+ billingMode: import('../generated/wspace-operations').MspBillingMode;
118
+ monthlySeatBudget: number | null;
119
+ consentGrantedBy: string | null;
120
+ consentGrantedAt: string | null;
121
+ expiresAt: string | null;
122
+ revokedAt: string | null;
123
+ revokedBy: string | null;
124
+ notes: string | null;
125
+ createdAt: string;
126
+ updatedAt: string;
127
+ createdBy: string;
128
+ }, Error, {
129
+ workspaceId: string;
130
+ linkId: string;
131
+ }, unknown>;
132
+ updateMspLink: import('@tanstack/react-query').UseMutationResult<{
133
+ id: string;
134
+ workspaceId: string;
135
+ mspOrgId: string;
136
+ clientOrgId: string;
137
+ clientOrgName: string;
138
+ clientWorkspaceId: string | null;
139
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
140
+ status: import('../generated/wspace-operations').MspOrgLinkStatus;
141
+ billingMode: import('../generated/wspace-operations').MspBillingMode;
142
+ monthlySeatBudget: number | null;
143
+ consentGrantedBy: string | null;
144
+ consentGrantedAt: string | null;
145
+ expiresAt: string | null;
146
+ revokedAt: string | null;
147
+ revokedBy: string | null;
148
+ notes: string | null;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ createdBy: string;
152
+ }, Error, UpdateMspOrgLinkInput, unknown>;
153
+ revokeMspLink: import('@tanstack/react-query').UseMutationResult<{
154
+ id: string;
155
+ workspaceId: string;
156
+ mspOrgId: string;
157
+ clientOrgId: string;
158
+ clientOrgName: string;
159
+ clientWorkspaceId: string | null;
160
+ delegatedScopes: Array<import('../generated/wspace-operations').MspDelegatedScope>;
161
+ status: import('../generated/wspace-operations').MspOrgLinkStatus;
162
+ billingMode: import('../generated/wspace-operations').MspBillingMode;
163
+ monthlySeatBudget: number | null;
164
+ consentGrantedBy: string | null;
165
+ consentGrantedAt: string | null;
166
+ expiresAt: string | null;
167
+ revokedAt: string | null;
168
+ revokedBy: string | null;
169
+ notes: string | null;
170
+ createdAt: string;
171
+ updatedAt: string;
172
+ createdBy: string;
173
+ }, Error, {
174
+ workspaceId: string;
175
+ linkId: string;
176
+ }, unknown>;
177
+ };
@@ -0,0 +1,126 @@
1
+ import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
2
+ import { captureRequestActor as t, pinnedFetch as n } from "../utils/pinnedRequest.js";
3
+ import { AcceptWorkspaceShareDocument as r, ApproveMspOrgLinkDocument as i, CreateMspOrgLinkDocument as a, CreateWorkspaceShareDocument as o, RevokeMspOrgLinkDocument as s, RevokeWorkspaceShareDocument as c, UpdateMspOrgLinkDocument as l } from "../generated/wspace-operations.js";
4
+ import { useMutation as u, useQueryClient as d } from "@tanstack/react-query";
5
+ import { print as f } from "graphql";
6
+ // src/hooks/useCollaborationMutations.ts
7
+ function p() {
8
+ let { authToken: p, currentUser: m } = e(), h = d(), g = () => {
9
+ h.invalidateQueries({ queryKey: ["crossWorkspaceOverview"] }), h.invalidateQueries({ queryKey: ["workspaceShares"] }), h.invalidateQueries({ queryKey: ["mspOrgLinks"] }), h.invalidateQueries({ queryKey: ["mspOrganizationSummary"] });
10
+ };
11
+ return {
12
+ createShare: u({
13
+ mutationFn: async (e) => {
14
+ let r = t({
15
+ authToken: p,
16
+ currentUser: m
17
+ }), i = await n(r, {
18
+ gateway: "workspace",
19
+ workspaceId: e.workspaceId,
20
+ query: f(o),
21
+ variables: { input: e }
22
+ });
23
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "Failed to create share");
24
+ return i.data.createWorkspaceShare;
25
+ },
26
+ onSuccess: g
27
+ }),
28
+ acceptShare: u({
29
+ mutationFn: async (e) => {
30
+ let i = t({
31
+ authToken: p,
32
+ currentUser: m
33
+ }), a = await n(i, {
34
+ gateway: "workspace",
35
+ workspaceId: e.workspaceId,
36
+ query: f(r),
37
+ variables: e
38
+ });
39
+ if (a.errors?.length) throw Error(a.errors[0]?.message || "Failed to accept share");
40
+ return a.data.acceptWorkspaceShare;
41
+ },
42
+ onSuccess: g
43
+ }),
44
+ revokeShare: u({
45
+ mutationFn: async (e) => {
46
+ let r = t({
47
+ authToken: p,
48
+ currentUser: m
49
+ }), i = await n(r, {
50
+ gateway: "workspace",
51
+ workspaceId: e.workspaceId,
52
+ query: f(c),
53
+ variables: e
54
+ });
55
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "Failed to revoke share");
56
+ return i.data.revokeWorkspaceShare;
57
+ },
58
+ onSuccess: g
59
+ }),
60
+ createMspLink: u({
61
+ mutationFn: async (e) => {
62
+ let r = t({
63
+ authToken: p,
64
+ currentUser: m
65
+ }), i = await n(r, {
66
+ gateway: "workspace",
67
+ workspaceId: e.workspaceId,
68
+ query: f(a),
69
+ variables: { input: e }
70
+ });
71
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "Failed to create MSP link");
72
+ return i.data.createMspOrgLink;
73
+ },
74
+ onSuccess: g
75
+ }),
76
+ approveMspLink: u({
77
+ mutationFn: async (e) => {
78
+ let r = t({
79
+ authToken: p,
80
+ currentUser: m
81
+ }), a = await n(r, {
82
+ gateway: "workspace",
83
+ workspaceId: e.workspaceId,
84
+ query: f(i),
85
+ variables: e
86
+ });
87
+ if (a.errors?.length) throw Error(a.errors[0]?.message || "Failed to approve MSP link");
88
+ return a.data.approveMspOrgLink;
89
+ },
90
+ onSuccess: g
91
+ }),
92
+ updateMspLink: u({
93
+ mutationFn: async (e) => {
94
+ let r = t({
95
+ authToken: p,
96
+ currentUser: m
97
+ }), i = await n(r, {
98
+ gateway: "workspace",
99
+ workspaceId: e.workspaceId,
100
+ query: f(l),
101
+ variables: { input: e }
102
+ });
103
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "Failed to update MSP link");
104
+ return i.data.updateMspOrgLink;
105
+ },
106
+ onSuccess: g
107
+ }),
108
+ revokeMspLink: u({
109
+ mutationFn: async (e) => {
110
+ let r = t({
111
+ authToken: p,
112
+ currentUser: m
113
+ }), i = await n(r, {
114
+ gateway: "workspace",
115
+ workspaceId: e.workspaceId,
116
+ query: f(s),
117
+ variables: e
118
+ });
119
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "Failed to revoke MSP link");
120
+ return i.data.revokeMspOrgLink;
121
+ },
122
+ onSuccess: g
123
+ })
124
+ };
125
+ }
126
+ export { p as useCollaborationMutations };
@@ -0,0 +1,89 @@
1
+ import { GetMyProjectsWithDetailsQuery, GetWorkspaceActivityLogQuery, GetWorkspaceInvitationsWithEmailStatusQuery, GetWorkspaceMembersWithStatusQuery } from '../../generated/wspace-operations';
2
+ import { Workspace } from '../../types';
3
+ /** Items per request when a list is read whole (the services' own ceiling). */
4
+ export declare const READ_ALL_PAGE_SIZE = 100;
5
+ /** A list longer than this many pages is cut there (10,000 items) rather than read forever. */
6
+ export declare const READ_ALL_MAX_PAGES = 100;
7
+ export interface PageOfItems<T> {
8
+ items: T[];
9
+ hasMore: boolean;
10
+ }
11
+ /** Reads every page of a list, in order, until the server says there is no more. */
12
+ export declare function readAllPages<T>(readPage: (offset: number, limit: number) => Promise<PageOfItems<T>>, pageSize?: number, maxPages?: number): Promise<T[]>;
13
+ export type MemberWithStatus = GetWorkspaceMembersWithStatusQuery['workspaceMembers']['items'][number];
14
+ /** Every member of the workspace, with their status and membership role. */
15
+ export declare function useAllWorkspaceMembers(workspaceId: string | undefined): import('@tanstack/react-query').UseQueryResult<{
16
+ role: string;
17
+ status: string;
18
+ id: string;
19
+ workspaceId: string;
20
+ userId: string;
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ context: {
24
+ type: string | null;
25
+ metadata: Record<string, unknown> | null;
26
+ } | null;
27
+ }[], Error>;
28
+ export type InvitationWithEmailStatus = GetWorkspaceInvitationsWithEmailStatusQuery['workspaceInvitations']['items'][number];
29
+ /** Every invitation the workspace sent (the page keeps the waiting, expired and bounced ones). */
30
+ export declare function useAllWorkspaceInvitations(workspaceId: string | undefined, enabled?: boolean): import('@tanstack/react-query').UseQueryResult<{
31
+ emailStatus: import('../../generated/wspace-operations').InvitationEmailStatus | null;
32
+ emailErrorCode: string | null;
33
+ emailLastAttemptAt: string | null;
34
+ projectId: string | null;
35
+ invitedUserId: string | null;
36
+ updatedAt: string;
37
+ deletedAt: string | null;
38
+ id: string;
39
+ email: string;
40
+ status: import('../../generated/wspace-operations').InviteStatus;
41
+ roleIds: Array<string>;
42
+ workspaceId: string | null;
43
+ invitedById: string | null;
44
+ expiresAt: string | null;
45
+ createdAt: string;
46
+ context: {
47
+ type: string | null;
48
+ metadata: Record<string, unknown> | null;
49
+ } | null;
50
+ }[], Error>;
51
+ /**
52
+ * The roles each person holds here, by name (People & access's names), keyed by their id. It
53
+ * may be refused to people who cannot read access: the page then shows the membership role.
54
+ */
55
+ export declare function useWorkspaceActorRoles(workspaceId: string | undefined): import('@tanstack/react-query').UseQueryResult<Record<string, string[]>, Error>;
56
+ /** Every workspace the person belongs to: read only while a search narrows the list. */
57
+ export declare function useAllMyWorkspaces(enabled: boolean): import('@tanstack/react-query').UseQueryResult<Workspace[], Error>;
58
+ export type ActivityLogRow = GetWorkspaceActivityLogQuery['getWorkspaceActivities'][number];
59
+ /** The workspace's newest events (`ACTIVITY_WINDOW` of them), every actor's. */
60
+ export declare function useWorkspaceActivityLog(workspaceId: string | undefined): import('@tanstack/react-query').UseQueryResult<{
61
+ id: string;
62
+ action: string;
63
+ category: import('../../generated/wspace-operations').ActivityCategory | null;
64
+ resourceType: string | null;
65
+ resourceId: string | null;
66
+ userId: string;
67
+ targetUserId: string | null;
68
+ description: string | null;
69
+ details: Record<string, unknown> | null;
70
+ timestamp: string;
71
+ }[], Error>;
72
+ export type ProjectWithDetails = GetMyProjectsWithDetailsQuery['myProjects']['items'][number];
73
+ /**
74
+ * Every project the person is in (the membership-scoped list the old page reads), with each
75
+ * one's description and creator, in the active workspace's context.
76
+ */
77
+ export declare function useMyProjectsWithDetails(): import('@tanstack/react-query').UseQueryResult<{
78
+ description: string | null;
79
+ creatorId: string;
80
+ id: string;
81
+ name: string;
82
+ key: string;
83
+ workspaceId: string;
84
+ status: import('../../generated/wspace-operations').ProjectStatus;
85
+ tags: Record<string, unknown>;
86
+ archived: boolean;
87
+ createdAt: string;
88
+ updatedAt: string;
89
+ }[], Error>;