@burdenoff/microfe-workspaces 2026.1029.2 → 2026.1108.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,97 +1,100 @@
1
1
  import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
2
2
  import { useWorkspacesEventEmitter as t } from "./useWorkspacesEventEmitter.js";
3
- import { safeTelemetryError as n } from "../utils/telemetryError.js";
4
- import { useMutation as r, useQueryClient as i } from "@tanstack/react-query";
5
- import { graphqlFetch as a } from "@burdenoff/fe-libs/shared/graphql";
3
+ import { captureRequestActor as n, pinnedFetch as r } from "../utils/pinnedRequest.js";
4
+ import { safeTelemetryError as i } from "../utils/telemetryError.js";
5
+ import { useMutation as a, useQueryClient as o } from "@tanstack/react-query";
6
6
  //#region src/hooks/useProjectMutations.ts
7
- var o = "\n mutation CreateProject($input: CreateProjectInput!) {\n createProject(input: $input) {\n id\n name\n key\n workspaceId\n creatorId\n status\n tags\n createdAt\n }\n }\n", s = "\n mutation UpdateProject($id: ID!, $input: UpdateProjectInput!) {\n updateProject(id: $id, input: $input) {\n id\n name\n key\n status\n config\n tags\n archived\n updatedAt\n }\n }\n", c = "\n mutation DeleteProject($id: ID!) {\n deleteProject(id: $id)\n }\n", l = "\n mutation ArchiveProject($id: ID!) {\n archiveProject(id: $id) {\n id\n archived\n updatedAt\n }\n }\n", u = "\n mutation UnarchiveProject($id: ID!) {\n unarchiveProject(id: $id) {\n id\n archived\n updatedAt\n }\n }\n", d = "\n mutation AssignProjectTag($input: AssignTagInput!) {\n assignTag(input: $input) {\n id\n tagId\n entityType\n entityId\n source\n assignedById\n createdAt\n validFrom\n validTo\n metadata\n }\n }\n", f = "\n query GetProjectTagAssignments($entityType: String!, $entityId: ID!) {\n getEntityTags(entityType: $entityType, entityId: $entityId) {\n id\n tagId\n }\n }\n", p = "\n mutation RemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }\n";
8
- function m(e) {
7
+ var s = "\n mutation CreateProject($input: CreateProjectInput!) {\n createProject(input: $input) {\n id\n name\n key\n workspaceId\n creatorId\n status\n tags\n createdAt\n }\n }\n", c = "\n mutation UpdateProject($id: ID!, $input: UpdateProjectInput!) {\n updateProject(id: $id, input: $input) {\n id\n name\n key\n status\n config\n tags\n archived\n updatedAt\n }\n }\n", l = "\n mutation DeleteProject($id: ID!) {\n deleteProject(id: $id)\n }\n", u = "\n mutation ArchiveProject($id: ID!) {\n archiveProject(id: $id) {\n id\n archived\n updatedAt\n }\n }\n", d = "\n mutation UnarchiveProject($id: ID!) {\n unarchiveProject(id: $id) {\n id\n archived\n updatedAt\n }\n }\n", f = "\n mutation AssignProjectTag($input: AssignTagInput!) {\n assignTag(input: $input) {\n id\n tagId\n entityType\n entityId\n source\n assignedById\n createdAt\n validFrom\n validTo\n metadata\n }\n }\n", p = "\n query GetProjectTagAssignments($entityType: String!, $entityId: ID!) {\n getEntityTags(entityType: $entityType, entityId: $entityId) {\n id\n tagId\n }\n }\n", m = "\n mutation RemoveTagAssignment($id: ID!) {\n removeTagAssignment(id: $id)\n }\n";
8
+ function h(e) {
9
9
  e.invalidateQueries({ queryKey: ["projects"] }), e.invalidateQueries({ queryKey: ["project"] }), e.invalidateQueries({ queryKey: ["myProjects"] }), e.invalidateQueries({ queryKey: ["dashboard", "projects"] });
10
10
  }
11
- var h = (s) => {
12
- let { authToken: c, onProjectCreate: l, workspaceId: u } = e(), d = i(), { emit: f } = t(), p = s || u;
13
- return r({
11
+ var g = (c) => {
12
+ let { authToken: l, currentUser: u, onProjectCreate: d, workspaceId: f } = e(), p = o(), { emit: m } = t(), g = c || f;
13
+ return a({
14
14
  mutationFn: async (e) => {
15
- let t = await a({
15
+ let t = await r(n({
16
+ authToken: l,
17
+ currentUser: u
18
+ }), {
16
19
  gateway: "workspace",
17
- authToken: c || void 0,
18
- query: o,
20
+ query: s,
19
21
  variables: { input: e },
20
- workspaceId: p || void 0,
21
- workspaceToken: !0
22
+ workspaceId: g || void 0
22
23
  });
23
24
  if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
24
25
  return t.data.createProject;
25
26
  },
26
27
  onSuccess: (e) => {
27
- m(d), f("project.created", {
28
+ h(p), m("project.created", {
28
29
  projectId: e.id,
29
30
  workspaceId: e.workspaceId,
30
31
  source: "microfe-workspaces"
31
- }), l && l(e);
32
+ }), d && d(e);
32
33
  },
33
34
  onError: (e) => {
34
- f("project.create_failed", {
35
- workspaceId: p || void 0,
35
+ m("project.create_failed", {
36
+ workspaceId: g || void 0,
36
37
  source: "microfe-workspaces",
37
- errorMessage: n(e)
38
+ errorMessage: i(e)
38
39
  });
39
40
  }
40
41
  });
41
- }, g = (o) => {
42
- let { authToken: c, workspaceId: l } = e(), u = i(), { emit: d } = t(), f = o || l;
43
- return r({
42
+ }, _ = (s) => {
43
+ let { authToken: l, currentUser: u, workspaceId: d } = e(), f = o(), { emit: p } = t(), m = s || d;
44
+ return a({
44
45
  mutationFn: async ({ id: e, input: t }) => {
45
- let n = await a({
46
+ let i = await r(n({
47
+ authToken: l,
48
+ currentUser: u
49
+ }), {
46
50
  gateway: "workspace",
47
- authToken: c || void 0,
48
- query: s,
51
+ query: c,
49
52
  variables: {
50
53
  id: e,
51
54
  input: t
52
55
  },
53
- workspaceId: f || void 0,
54
- workspaceToken: !0
56
+ workspaceId: m || void 0
55
57
  });
56
- if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
57
- return n.data.updateProject;
58
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "GraphQL error");
59
+ return i.data.updateProject;
58
60
  },
59
61
  onSuccess: (e) => {
60
- m(u), d("project.updated", {
62
+ h(f), p("project.updated", {
61
63
  projectId: e.id,
62
64
  workspaceId: e.workspaceId,
63
65
  source: "microfe-workspaces"
64
66
  });
65
67
  },
66
68
  onError: (e, t) => {
67
- d("project.update_failed", {
69
+ p("project.update_failed", {
68
70
  projectId: t?.id,
69
- workspaceId: f || void 0,
71
+ workspaceId: m || void 0,
70
72
  source: "microfe-workspaces",
71
- errorMessage: n(e)
73
+ errorMessage: i(e)
72
74
  });
73
75
  }
74
76
  });
75
- }, _ = (o) => {
76
- let { authToken: s, workspaceId: c } = e(), l = i(), { emit: u } = t(), f = o || c;
77
- return r({
77
+ }, v = (s) => {
78
+ let { authToken: c, currentUser: l, workspaceId: u } = e(), d = o(), { emit: p } = t(), m = s || u;
79
+ return a({
78
80
  mutationFn: async (e) => {
79
- let t = await a({
81
+ let t = await r(n({
82
+ authToken: c,
83
+ currentUser: l
84
+ }), {
80
85
  gateway: "workspace",
81
- authToken: s || void 0,
82
- query: d,
86
+ query: f,
83
87
  variables: { input: {
84
88
  tagId: e.tagId,
85
89
  entityType: "WORKSPACE_PROJECT",
86
90
  entityId: e.entityId,
87
91
  source: "MANUAL",
88
92
  context: {
89
- workspaceId: f,
93
+ workspaceId: m,
90
94
  projectId: e.entityId
91
95
  }
92
96
  } },
93
- workspaceId: f || void 0,
94
- workspaceToken: !0
97
+ workspaceId: m || void 0
95
98
  });
96
99
  if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
97
100
  if (!t.data?.assignTag) throw Error("GraphQL error");
@@ -110,161 +113,163 @@ var h = (s) => {
110
113
  };
111
114
  },
112
115
  onSuccess: (e, t) => {
113
- m(l), u("project.updated", {
116
+ h(d), p("project.updated", {
114
117
  projectId: t.entityId,
115
- workspaceId: f || void 0,
118
+ workspaceId: m || void 0,
116
119
  source: "microfe-workspaces"
117
120
  });
118
121
  },
119
122
  onError: (e, t) => {
120
- u("project.update_failed", {
123
+ p("project.update_failed", {
121
124
  projectId: t.entityId,
122
- workspaceId: f || void 0,
125
+ workspaceId: m || void 0,
123
126
  source: "microfe-workspaces",
124
- errorMessage: n(e)
127
+ errorMessage: i(e)
125
128
  });
126
129
  }
127
130
  });
128
- }, v = (o) => {
129
- let { authToken: s, workspaceId: c } = e(), l = i(), { emit: u } = t(), d = o || c;
130
- return r({
131
+ }, y = (s) => {
132
+ let { authToken: c, currentUser: l, workspaceId: u } = e(), d = o(), { emit: f } = t(), g = s || u;
133
+ return a({
131
134
  mutationFn: async (e) => {
132
- let t = e.assignmentId;
133
- if (!t) {
134
- let n = await a({
135
+ let t = n({
136
+ authToken: c,
137
+ currentUser: l
138
+ }), i = e.assignmentId;
139
+ if (!i) {
140
+ let n = await r(t, {
135
141
  gateway: "workspace",
136
- authToken: s || void 0,
137
- query: f,
142
+ query: p,
138
143
  variables: {
139
144
  entityType: "WORKSPACE_PROJECT",
140
145
  entityId: e.entityId
141
146
  },
142
- workspaceId: d || void 0,
143
- workspaceToken: !0
147
+ workspaceId: g || void 0
144
148
  });
145
149
  if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
146
- t = n.data?.getEntityTags.find((t) => t.tagId === e.tagId)?.id;
150
+ i = n.data?.getEntityTags.find((t) => t.tagId === e.tagId)?.id;
147
151
  }
148
- if (!t) return !1;
149
- let n = await a({
152
+ if (!i) return !1;
153
+ let a = await r(t, {
150
154
  gateway: "workspace",
151
- authToken: s || void 0,
152
- query: p,
153
- variables: { id: t },
154
- workspaceId: d || void 0,
155
- workspaceToken: !0
155
+ query: m,
156
+ variables: { id: i },
157
+ workspaceId: g || void 0
156
158
  });
157
- if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
158
- return n.data?.removeTagAssignment ?? !1;
159
+ if (a.errors?.length) throw Error(a.errors[0]?.message || "GraphQL error");
160
+ return a.data?.removeTagAssignment ?? !1;
159
161
  },
160
162
  onSuccess: (e, t) => {
161
- m(l), u("project.updated", {
163
+ h(d), f("project.updated", {
162
164
  projectId: t.entityId,
163
- workspaceId: d || void 0,
165
+ workspaceId: g || void 0,
164
166
  source: "microfe-workspaces"
165
167
  });
166
168
  },
167
169
  onError: (e, t) => {
168
- u("project.update_failed", {
170
+ f("project.update_failed", {
169
171
  projectId: t.entityId,
170
- workspaceId: d || void 0,
172
+ workspaceId: g || void 0,
171
173
  source: "microfe-workspaces",
172
- errorMessage: n(e)
174
+ errorMessage: i(e)
173
175
  });
174
176
  }
175
177
  });
176
- }, y = (o) => {
177
- let { authToken: s, workspaceId: l } = e(), u = i(), { emit: d } = t(), f = o || l;
178
- return r({
178
+ }, b = (s) => {
179
+ let { authToken: c, currentUser: u, workspaceId: d } = e(), f = o(), { emit: p } = t(), m = s || d;
180
+ return a({
179
181
  mutationFn: async (e) => {
180
- let t = await a({
182
+ let t = await r(n({
183
+ authToken: c,
184
+ currentUser: u
185
+ }), {
181
186
  gateway: "workspace",
182
- authToken: s || void 0,
183
- query: c,
187
+ query: l,
184
188
  variables: { id: e },
185
- workspaceId: f || void 0,
186
- workspaceToken: !0
189
+ workspaceId: m || void 0
187
190
  });
188
191
  if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
189
192
  return t.data.deleteProject;
190
193
  },
191
194
  onSuccess: (e, t) => {
192
- m(u), d("project.deleted", {
195
+ h(f), p("project.deleted", {
193
196
  projectId: t,
194
197
  source: "microfe-workspaces"
195
198
  });
196
199
  },
197
200
  onError: (e, t) => {
198
- d("project.delete_failed", {
201
+ p("project.delete_failed", {
199
202
  projectId: t,
200
- workspaceId: f || void 0,
203
+ workspaceId: m || void 0,
201
204
  source: "microfe-workspaces",
202
- errorMessage: n(e)
205
+ errorMessage: i(e)
203
206
  });
204
207
  }
205
208
  });
206
- }, b = (o) => {
207
- let { authToken: s, workspaceId: c } = e(), u = i(), { emit: d } = t(), f = o || c;
208
- return r({
209
+ }, x = (s) => {
210
+ let { authToken: c, currentUser: l, workspaceId: d } = e(), f = o(), { emit: p } = t(), m = s || d;
211
+ return a({
209
212
  mutationFn: async (e) => {
210
- let t = await a({
213
+ let t = await r(n({
214
+ authToken: c,
215
+ currentUser: l
216
+ }), {
211
217
  gateway: "workspace",
212
- authToken: s || void 0,
213
- query: l,
218
+ query: u,
214
219
  variables: { id: e },
215
- workspaceId: f || void 0,
216
- workspaceToken: !0
220
+ workspaceId: m || void 0
217
221
  });
218
222
  if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
219
223
  return t.data.archiveProject;
220
224
  },
221
225
  onSuccess: (e) => {
222
- m(u), d("project.archived", {
226
+ h(f), p("project.archived", {
223
227
  projectId: e.id,
224
228
  workspaceId: e.workspaceId,
225
229
  source: "microfe-workspaces"
226
230
  });
227
231
  },
228
232
  onError: (e, t) => {
229
- d("project.archive_failed", {
233
+ p("project.archive_failed", {
230
234
  projectId: t,
231
- workspaceId: f || void 0,
235
+ workspaceId: m || void 0,
232
236
  source: "microfe-workspaces",
233
- errorMessage: n(e)
237
+ errorMessage: i(e)
234
238
  });
235
239
  }
236
240
  });
237
- }, x = (o) => {
238
- let { authToken: s, workspaceId: c } = e(), l = i(), { emit: d } = t(), f = o || c;
239
- return r({
241
+ }, S = (s) => {
242
+ let { authToken: c, currentUser: l, workspaceId: u } = e(), f = o(), { emit: p } = t(), m = s || u;
243
+ return a({
240
244
  mutationFn: async (e) => {
241
- let t = await a({
245
+ let t = await r(n({
246
+ authToken: c,
247
+ currentUser: l
248
+ }), {
242
249
  gateway: "workspace",
243
- authToken: s || void 0,
244
- query: u,
250
+ query: d,
245
251
  variables: { id: e },
246
- workspaceId: f || void 0,
247
- workspaceToken: !0
252
+ workspaceId: m || void 0
248
253
  });
249
254
  if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
250
255
  return t.data.unarchiveProject;
251
256
  },
252
257
  onSuccess: (e) => {
253
- m(l), d("project.unarchived", {
258
+ h(f), p("project.unarchived", {
254
259
  projectId: e.id,
255
260
  workspaceId: e.workspaceId,
256
261
  source: "microfe-workspaces"
257
262
  });
258
263
  },
259
264
  onError: (e, t) => {
260
- d("project.unarchive_failed", {
265
+ p("project.unarchive_failed", {
261
266
  projectId: t,
262
- workspaceId: f || void 0,
267
+ workspaceId: m || void 0,
263
268
  source: "microfe-workspaces",
264
- errorMessage: n(e)
269
+ errorMessage: i(e)
265
270
  });
266
271
  }
267
272
  });
268
273
  };
269
274
  //#endregion
270
- export { b as useArchiveProject, h as useCreateProject, y as useDeleteProject, _ as useTagProject, x as useUnarchiveProject, v as useUntagProject, g as useUpdateProject };
275
+ export { x as useArchiveProject, g as useCreateProject, b as useDeleteProject, v as useTagProject, S as useUnarchiveProject, y as useUntagProject, _ as useUpdateProject };
@@ -2,182 +2,189 @@ import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
2
2
  import { DeleteWorkspaceDocument as t, UpdateWorkspaceDocument as n } from "../generated/wspace-operations.js";
3
3
  import { ActivateGlobalWorkspaceDocument as r, ArchiveGlobalWorkspaceDocument as i, UpdateGlobalWorkspaceDocument as a } from "../generated/global-operations.js";
4
4
  import { useWorkspacesEventEmitter as o } from "./useWorkspacesEventEmitter.js";
5
- import { safeTelemetryError as s } from "../utils/telemetryError.js";
6
- import { useMutation as c, useQueryClient as l } from "@tanstack/react-query";
7
- import { print as u } from "graphql";
8
- import { graphqlFetch as d } from "@burdenoff/fe-libs/shared/graphql";
5
+ import { captureRequestActor as s, pinnedFetch as c } from "../utils/pinnedRequest.js";
6
+ import { safeTelemetryError as l } from "../utils/telemetryError.js";
7
+ import { useMutation as u, useQueryClient as d } from "@tanstack/react-query";
8
+ import { print as f } from "graphql";
9
9
  //#region src/hooks/useWorkspaceMutations.ts
10
- var f = "\n mutation CreateGlobalWorkspace($input: CreateWorkspaceInput!) {\n createWorkspace(input: $input) {\n id\n name\n slug\n type\n status\n tenantId\n organizationId\n createdAt\n }\n }\n";
11
- function p(e, t) {
10
+ var p = "\n mutation CreateGlobalWorkspace($input: CreateWorkspaceInput!) {\n createWorkspace(input: $input) {\n id\n name\n slug\n type\n status\n tenantId\n organizationId\n createdAt\n }\n }\n";
11
+ function m(e, t) {
12
12
  e.invalidateQueries({ queryKey: ["workspaces"] }), t && (e.invalidateQueries({ queryKey: ["workspace", t] }), e.invalidateQueries({ queryKey: [
13
13
  "dashboard",
14
14
  "workspace",
15
15
  t
16
16
  ] })), e.invalidateQueries({ queryKey: ["myWorkspaces"] }), e.invalidateQueries({ queryKey: ["myTenants"] }), e.invalidateQueries({ queryKey: ["myOrganizations"] }), e.invalidateQueries({ queryKey: ["dashboard", "global"] });
17
17
  }
18
- var m = () => {
19
- let { authToken: t, onWorkspaceCreate: n } = e(), r = l(), { emit: i } = o();
20
- return c({
18
+ var h = () => {
19
+ let { authToken: t, currentUser: n, onWorkspaceCreate: r } = e(), i = d(), { emit: a } = o();
20
+ return u({
21
21
  mutationFn: async (e) => {
22
- let n = await d({
22
+ let r = await c(s({
23
+ authToken: t,
24
+ currentUser: n
25
+ }), {
23
26
  gateway: "global",
24
- authToken: t || void 0,
25
- query: f,
27
+ query: p,
26
28
  variables: { input: e }
27
29
  });
28
- if (n.errors?.length) throw Error(n.errors[0]?.message || "Failed to create workspace");
29
- return n.data.createWorkspace;
30
+ if (r.errors?.length) throw Error(r.errors[0]?.message || "Failed to create workspace");
31
+ return r.data.createWorkspace;
30
32
  },
31
33
  onSuccess: (e) => {
32
- p(r, e.id), i("workspace.created", {
34
+ m(i, e.id), a("workspace.created", {
33
35
  workspaceId: e.id,
34
36
  source: "microfe-workspaces"
35
- }), n && n(e);
37
+ }), r && r(e);
36
38
  },
37
39
  onError: (e) => {
38
- i("workspace.create_failed", {
40
+ a("workspace.create_failed", {
39
41
  source: "microfe-workspaces",
40
- errorMessage: s(e)
42
+ errorMessage: l(e)
41
43
  });
42
44
  }
43
45
  });
44
- }, h = () => {
45
- let { authToken: t } = e(), r = l(), { emit: i } = o();
46
- return c({
47
- mutationFn: async ({ id: e, input: r }) => {
48
- let { name: i, ...o } = r, s;
49
- if (i !== void 0) {
50
- let n = await d({
46
+ }, g = () => {
47
+ let { authToken: t, currentUser: r } = e(), i = d(), { emit: p } = o();
48
+ return u({
49
+ mutationFn: async ({ id: e, input: i }) => {
50
+ let o = s({
51
+ authToken: t,
52
+ currentUser: r
53
+ }), { name: l, ...u } = i, d;
54
+ if (l !== void 0) {
55
+ let t = await c(o, {
51
56
  gateway: "global",
52
- authToken: t || void 0,
53
- query: u(a),
57
+ query: f(a),
54
58
  variables: {
55
59
  id: e,
56
- input: { name: i }
60
+ input: { name: l }
57
61
  }
58
62
  });
59
- if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
60
- s = n.data.updateWorkspace;
63
+ if (t.errors?.length) throw Error(t.errors[0]?.message || "GraphQL error");
64
+ d = t.data.updateWorkspace;
61
65
  }
62
- if (!Object.values(o).some((e) => e !== void 0)) {
63
- if (!s) throw Error("No workspace changes were provided");
64
- return s;
66
+ if (!Object.values(u).some((e) => e !== void 0)) {
67
+ if (!d) throw Error("No workspace changes were provided");
68
+ return d;
65
69
  }
66
- let c = await d({
70
+ let p = await c(o, {
67
71
  gateway: "workspace",
68
- authToken: t || void 0,
69
- query: u(n),
72
+ query: f(n),
70
73
  variables: {
71
74
  id: e,
72
- input: o
73
- },
74
- workspaceToken: !0
75
+ input: u
76
+ }
75
77
  });
76
- if (c.errors?.length) throw Error(c.errors[0]?.message || "GraphQL error");
78
+ if (p.errors?.length) throw Error(p.errors[0]?.message || "GraphQL error");
77
79
  return {
78
- ...c.data.updateWorkspace,
79
- ...s ? { name: s.name } : {}
80
+ ...p.data.updateWorkspace,
81
+ ...d ? { name: d.name } : {}
80
82
  };
81
83
  },
82
84
  onSuccess: (e) => {
83
- r.setQueryData(["workspace", e.id], (t) => ({
85
+ i.setQueryData(["workspace", e.id], (t) => ({
84
86
  ...t,
85
87
  ...e
86
- })), p(r, e.id), i("workspace.updated", {
88
+ })), m(i, e.id), p("workspace.updated", {
87
89
  workspaceId: e.id,
88
90
  source: "microfe-workspaces"
89
91
  });
90
92
  },
91
93
  onError: (e, t) => {
92
- i("workspace.update_failed", {
94
+ p("workspace.update_failed", {
93
95
  workspaceId: t?.id,
94
96
  source: "microfe-workspaces",
95
- errorMessage: s(e)
97
+ errorMessage: l(e)
96
98
  });
97
99
  }
98
100
  });
99
- }, g = () => {
100
- let { authToken: n } = e(), r = l(), { emit: i } = o();
101
- return c({
101
+ }, _ = () => {
102
+ let { authToken: n, currentUser: r } = e(), i = d(), { emit: a } = o();
103
+ return u({
102
104
  mutationFn: async (e) => {
103
- let r = await d({
105
+ let i = await c(s({
106
+ authToken: n,
107
+ currentUser: r
108
+ }), {
104
109
  gateway: "workspace",
105
- authToken: n || void 0,
106
- query: u(t),
107
- variables: { id: e },
108
- workspaceToken: !0
110
+ query: f(t),
111
+ variables: { id: e }
109
112
  });
110
- if (r.errors?.length) throw Error(r.errors[0]?.message || "GraphQL error");
111
- return r.data.deleteWorkspace;
113
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "GraphQL error");
114
+ return i.data.deleteWorkspace;
112
115
  },
113
116
  onSuccess: (e, t) => {
114
- p(r, t), i("workspace.deleted", {
117
+ m(i, t), a("workspace.deleted", {
115
118
  workspaceId: t,
116
119
  source: "microfe-workspaces"
117
120
  });
118
121
  },
119
122
  onError: (e, t) => {
120
- i("workspace.delete_failed", {
123
+ a("workspace.delete_failed", {
121
124
  workspaceId: t,
122
125
  source: "microfe-workspaces",
123
- errorMessage: s(e)
126
+ errorMessage: l(e)
124
127
  });
125
128
  }
126
129
  });
127
- }, _ = () => {
128
- let { authToken: t } = e(), n = l(), { emit: r } = o();
129
- return c({
130
+ }, v = () => {
131
+ let { authToken: t, currentUser: n } = e(), r = d(), { emit: a } = o();
132
+ return u({
130
133
  mutationFn: async (e) => {
131
- let n = await d({
134
+ let r = await c(s({
135
+ authToken: t,
136
+ currentUser: n
137
+ }), {
132
138
  gateway: "global",
133
- authToken: t || void 0,
134
- query: u(i),
139
+ query: f(i),
135
140
  variables: { id: e }
136
141
  });
137
- if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
138
- return n.data.archiveWorkspace;
142
+ if (r.errors?.length) throw Error(r.errors[0]?.message || "GraphQL error");
143
+ return r.data.archiveWorkspace;
139
144
  },
140
145
  onSuccess: (e) => {
141
- p(n, e.id), r("workspace.archived", {
146
+ m(r, e.id), a("workspace.archived", {
142
147
  workspaceId: e.id,
143
148
  source: "microfe-workspaces"
144
149
  });
145
150
  },
146
151
  onError: (e, t) => {
147
- r("workspace.archive_failed", {
152
+ a("workspace.archive_failed", {
148
153
  workspaceId: t,
149
154
  source: "microfe-workspaces",
150
- errorMessage: s(e)
155
+ errorMessage: l(e)
151
156
  });
152
157
  }
153
158
  });
154
- }, v = () => {
155
- let { authToken: t } = e(), n = l(), { emit: i } = o();
156
- return c({
159
+ }, y = () => {
160
+ let { authToken: t, currentUser: n } = e(), i = d(), { emit: a } = o();
161
+ return u({
157
162
  mutationFn: async (e) => {
158
- let n = await d({
163
+ let i = await c(s({
164
+ authToken: t,
165
+ currentUser: n
166
+ }), {
159
167
  gateway: "global",
160
- authToken: t || void 0,
161
- query: u(r),
168
+ query: f(r),
162
169
  variables: { id: e }
163
170
  });
164
- if (n.errors?.length) throw Error(n.errors[0]?.message || "GraphQL error");
165
- return n.data.activateWorkspace;
171
+ if (i.errors?.length) throw Error(i.errors[0]?.message || "GraphQL error");
172
+ return i.data.activateWorkspace;
166
173
  },
167
174
  onSuccess: (e) => {
168
- p(n, e.id), i("workspace.reactivated", {
175
+ m(i, e.id), a("workspace.reactivated", {
169
176
  workspaceId: e.id,
170
177
  source: "microfe-workspaces"
171
178
  });
172
179
  },
173
180
  onError: (e, t) => {
174
- i("workspace.reactivate_failed", {
181
+ a("workspace.reactivate_failed", {
175
182
  workspaceId: t,
176
183
  source: "microfe-workspaces",
177
- errorMessage: s(e)
184
+ errorMessage: l(e)
178
185
  });
179
186
  }
180
187
  });
181
188
  };
182
189
  //#endregion
183
- export { _ as useArchiveWorkspace, m as useCreateWorkspace, g as useDeleteWorkspace, v as useReactivateWorkspace, h as useUpdateWorkspace };
190
+ export { v as useArchiveWorkspace, h as useCreateWorkspace, _ as useDeleteWorkspace, y as useReactivateWorkspace, g as useUpdateWorkspace };
@@ -128,6 +128,7 @@ function D({ navigate: d, authToken: f, currentUser: h, productId: D = "workspac
128
128
  onClick: $,
129
129
  disabled: X,
130
130
  className: "text-xs",
131
+ "aria-label": k("dashboard.refresh", "Refresh"),
131
132
  children: [X ? /* @__PURE__ */ _(p, { className: "size-3.5 sm:mr-1.5 animate-spin" }) : /* @__PURE__ */ _(m, { className: "size-3.5 sm:mr-1.5" }), /* @__PURE__ */ _("span", {
132
133
  className: "hidden sm:inline",
133
134
  children: k("dashboard.refresh", "Refresh")
@@ -137,6 +138,7 @@ function D({ navigate: d, authToken: f, currentUser: h, productId: D = "workspac
137
138
  size: "sm",
138
139
  onClick: () => A(!0),
139
140
  className: "text-xs",
141
+ "aria-label": k("dashboard.customize", "Customize"),
140
142
  children: [/* @__PURE__ */ _(ne, { className: "size-3.5 sm:mr-1.5" }), /* @__PURE__ */ _("span", {
141
143
  className: "hidden sm:inline",
142
144
  children: k("dashboard.customize", "Customize")