@burdenoff/microfe-export 2026.1124.2 → 2026.1125.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 (38) hide show
  1. package/dist/export/ExportRoutes.js +62 -57
  2. package/dist/export/ExportRoutes.js.map +1 -1
  3. package/dist/export/components/ConfirmDestructiveDialog.js +18 -14
  4. package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -1
  5. package/dist/export/components/DownloadStatus.js +14 -10
  6. package/dist/export/components/DownloadStatus.js.map +1 -1
  7. package/dist/export/components/ExportProgressBar.d.ts +3 -1
  8. package/dist/export/components/ExportProgressBar.js +23 -11
  9. package/dist/export/components/ExportProgressBar.js.map +1 -1
  10. package/dist/export/components/loadingSystem.d.ts +64 -0
  11. package/dist/export/components/loadingSystem.js +49 -0
  12. package/dist/export/components/loadingSystem.js.map +1 -0
  13. package/dist/export/hooks/exportBackgroundTask.d.ts +18 -0
  14. package/dist/export/hooks/exportBackgroundTask.js +46 -0
  15. package/dist/export/hooks/exportBackgroundTask.js.map +1 -0
  16. package/dist/export/hooks/useExportQueries.js +140 -124
  17. package/dist/export/hooks/useExportQueries.js.map +1 -1
  18. package/dist/export/pages/CreateExportPage.js +29 -27
  19. package/dist/export/pages/CreateExportPage.js.map +1 -1
  20. package/dist/export/pages/ExportDashboardPage.js +114 -113
  21. package/dist/export/pages/ExportDashboardPage.js.map +1 -1
  22. package/dist/export/pages/ExportDetailPage.js +104 -98
  23. package/dist/export/pages/ExportDetailPage.js.map +1 -1
  24. package/dist/export/pages/ExportHistoryPage.js +150 -149
  25. package/dist/export/pages/ExportHistoryPage.js.map +1 -1
  26. package/dist/export/pages/ExportTemplatesPage.js +156 -154
  27. package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
  28. package/dist/export/pages/TemplateDetailPage.js +142 -136
  29. package/dist/export/pages/TemplateDetailPage.js.map +1 -1
  30. package/dist/export/pages/v2/DownloadDetailPage.js +108 -103
  31. package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -1
  32. package/dist/export/pages/v2/DownloadsPage.js +153 -152
  33. package/dist/export/pages/v2/DownloadsPage.js.map +1 -1
  34. package/dist/export/pages/v2/NewDownloadPage.js +142 -138
  35. package/dist/export/pages/v2/NewDownloadPage.js.map +1 -1
  36. package/dist/export/workspace-v2/DownloadCells.js +32 -20
  37. package/dist/export/workspace-v2/DownloadCells.js.map +1 -1
  38. package/package.json +2 -2
@@ -1,111 +1,115 @@
1
1
  import { CancelExportJobDocument as e, CreateExportJobDocument as t, CreateExportTemplateDocument as n, DeleteExportJobDocument as r, DeleteExportTemplateDocument as i, ExportJobProgressDocument as a, ExportOrganizationPermissionDocument as o, GetAvailableExportEntitiesDocument as s, GetExportJobDocument as c, GetExportTemplateDocument as l, ListExportJobsDocument as u, ListExportTemplatesDocument as d, RetryExportJobDocument as f, UpdateExportTemplateDocument as p } from "../../generated/wspace-operations.js";
2
2
  import { ExportFormat as m, ExportJobStatus as h, ExportScope as g } from "../../generated/wspace-types.js";
3
3
  import { useExport as _ } from "../providers/ExportProvider.js";
4
- import { emitExportEvent as v } from "../utils/events.js";
5
- import { useCallback as y, useEffect as b, useRef as x, useState as S } from "react";
6
- import { useMutation as C, useQuery as w, useSubscription as T } from "@apollo/client/react";
4
+ import { joinPath as v } from "../utils/paths.js";
5
+ import { followExportInBackground as y } from "./exportBackgroundTask.js";
6
+ import { useTr as b } from "./useTr.js";
7
+ import { emitExportEvent as x } from "../utils/events.js";
8
+ import { useCallback as S, useEffect as C, useRef as w, useState as T } from "react";
9
+ import { useApolloClient as E, useMutation as D, useQuery as O, useSubscription as k } from "@apollo/client/react";
10
+ import { useLoadingSystem as A } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
7
11
  // src/export/hooks/useExportQueries.ts
8
- function E(e) {
12
+ function j(e) {
9
13
  return e ?? void 0;
10
14
  }
11
- function D(e) {
15
+ function M(e) {
12
16
  if (e == null) return;
13
17
  let t = typeof e == "number" ? e : Number(e);
14
18
  return Number.isFinite(t) ? t : void 0;
15
19
  }
16
- function O(e) {
17
- return D(e) ?? 0;
20
+ function N(e) {
21
+ return M(e) ?? 0;
18
22
  }
19
- function k(e) {
23
+ function P(e) {
20
24
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
21
25
  }
22
- function A(e) {
26
+ function F(e) {
23
27
  return {
24
28
  hasNextPage: e.hasNextPage,
25
29
  hasPreviousPage: e.hasPreviousPage,
26
- startCursor: E(e.startCursor),
27
- endCursor: E(e.endCursor)
30
+ startCursor: j(e.startCursor),
31
+ endCursor: j(e.endCursor)
28
32
  };
29
33
  }
30
- function j(e) {
34
+ function I(e) {
31
35
  return {
32
36
  id: e.id,
33
- jobId: E(e.jobId),
37
+ jobId: j(e.jobId),
34
38
  partNumber: e.partNumber,
35
39
  fileName: e.fileName,
36
- sizeBytes: O(e.sizeBytes),
40
+ sizeBytes: N(e.sizeBytes),
37
41
  entityTypes: e.entityTypes,
38
- downloadUrl: E(e.downloadUrl),
39
- downloadExpiresAt: E(e.downloadExpiresAt),
40
- checksum: E(e.checksum),
41
- createdAt: E(e.createdAt)
42
+ downloadUrl: j(e.downloadUrl),
43
+ downloadExpiresAt: j(e.downloadExpiresAt),
44
+ checksum: j(e.checksum),
45
+ createdAt: j(e.createdAt)
42
46
  };
43
47
  }
44
- function M(e) {
48
+ function L(e) {
45
49
  return {
46
50
  id: e.id,
47
51
  name: e.name,
48
- description: E(e.description),
52
+ description: j(e.description),
49
53
  status: e.status,
50
54
  progress: e.progress,
51
55
  exportScope: e.exportScope ? e.exportScope : void 0,
52
- organizationId: E(e.organizationId),
56
+ organizationId: j(e.organizationId),
53
57
  targetWorkspaceIds: e.targetWorkspaceIds ?? void 0,
54
58
  entityTypes: e.entityTypes,
55
59
  format: e.format,
56
60
  archiveFormat: e.archiveFormat ?? "ZIP",
57
- totalEntities: D(e.totalEntities),
58
- processedEntities: D(e.processedEntities),
59
- totalSizeBytes: D(e.totalSizeBytes),
60
- parts: e.parts?.map(j) ?? [],
61
- archiveFileId: E(e.archiveFileId),
62
- downloadUrl: E(e.downloadUrl),
63
- downloadExpiresAt: E(e.downloadExpiresAt),
64
- templateId: E(e.templateId),
65
- filters: k(e.entityFilters),
66
- errorMessage: E(e.errorMessage),
67
- startedAt: E(e.startedAt),
68
- completedAt: E(e.completedAt),
69
- expiresAt: E(e.expiresAt),
61
+ totalEntities: M(e.totalEntities),
62
+ processedEntities: M(e.processedEntities),
63
+ totalSizeBytes: M(e.totalSizeBytes),
64
+ parts: e.parts?.map(I) ?? [],
65
+ archiveFileId: j(e.archiveFileId),
66
+ downloadUrl: j(e.downloadUrl),
67
+ downloadExpiresAt: j(e.downloadExpiresAt),
68
+ templateId: j(e.templateId),
69
+ filters: P(e.entityFilters),
70
+ errorMessage: j(e.errorMessage),
71
+ startedAt: j(e.startedAt),
72
+ completedAt: j(e.completedAt),
73
+ expiresAt: j(e.expiresAt),
70
74
  createdBy: e.createdBy,
71
- temporalWorkflowId: E(e.temporalWorkflowId),
72
- workspaceId: E(e.workspaceId),
75
+ temporalWorkflowId: j(e.temporalWorkflowId),
76
+ workspaceId: j(e.workspaceId),
73
77
  createdAt: e.createdAt,
74
78
  updatedAt: e.updatedAt
75
79
  };
76
80
  }
77
- function N(e) {
81
+ function R(e) {
78
82
  return {
79
83
  id: e.id,
80
84
  name: e.name,
81
- description: E(e.description),
85
+ description: j(e.description),
82
86
  entityTypes: e.entityTypes,
83
87
  format: e.format,
84
- filters: k(e.entityFilters),
88
+ filters: P(e.entityFilters),
85
89
  isDefault: e.isDefault,
86
90
  createdBy: e.createdBy,
87
- workspaceId: E(e.workspaceId),
91
+ workspaceId: j(e.workspaceId),
88
92
  createdAt: e.createdAt,
89
93
  updatedAt: e.updatedAt
90
94
  };
91
95
  }
92
- function P(e) {
96
+ function z(e) {
93
97
  return {
94
98
  entityType: e.entityType,
95
99
  displayName: e.displayName,
96
- description: E(e.description),
97
- estimatedSize: E(e.estimatedSize),
100
+ description: j(e.description),
101
+ estimatedSize: j(e.estimatedSize),
98
102
  supportsDateRange: e.supportsDateRange,
99
103
  supportsMediaExport: e.supportsMediaExport,
100
104
  enabled: e.enabled
101
105
  };
102
106
  }
103
- function F(e) {
107
+ function B(e) {
104
108
  if (e === "CSV") return m.Csv;
105
109
  if (e === "JSON") return m.Json;
106
110
  throw Error(`Unsupported export format: ${e}`);
107
111
  }
108
- function I(e) {
112
+ function V(e) {
109
113
  switch (e) {
110
114
  case "CANCELLED": return h.Cancelled;
111
115
  case "COMPLETED": return h.Completed;
@@ -118,7 +122,7 @@ function I(e) {
118
122
  default: throw Error(`Unsupported export status: ${e}`);
119
123
  }
120
124
  }
121
- function L(e) {
125
+ function H(e) {
122
126
  switch (e) {
123
127
  case "INDIVIDUAL": return g.Individual;
124
128
  case "WORKSPACE_ADMIN": return g.WorkspaceAdmin;
@@ -126,12 +130,12 @@ function L(e) {
126
130
  default: throw Error(`Unsupported export scope: ${e}`);
127
131
  }
128
132
  }
129
- function R(e, t) {
133
+ function U(e, t) {
130
134
  let { workspaceId: n } = _(), r = e && n ? {
131
- status: e.status && e.status !== "all" ? [I(e.status)] : void 0,
132
- format: e.format && e.format !== "all" ? F(e.format) : void 0,
135
+ status: e.status && e.status !== "all" ? [V(e.status)] : void 0,
136
+ format: e.format && e.format !== "all" ? B(e.format) : void 0,
133
137
  search: e.search ?? void 0
134
- } : void 0, { data: i, loading: a, error: o, refetch: s } = w(u, {
138
+ } : void 0, { data: i, loading: a, error: o, refetch: s } = O(u, {
135
139
  variables: {
136
140
  filter: r,
137
141
  pagination: t,
@@ -140,16 +144,16 @@ function R(e, t) {
140
144
  skip: !n
141
145
  });
142
146
  return {
143
- data: i?.listExportJobs.edges.map((e) => M(e.node)) ?? [],
147
+ data: i?.listExportJobs.edges.map((e) => L(e.node)) ?? [],
144
148
  totalCount: i?.listExportJobs.totalCount ?? 0,
145
- pageInfo: i?.listExportJobs.pageInfo ? A(i.listExportJobs.pageInfo) : null,
149
+ pageInfo: i?.listExportJobs.pageInfo ? F(i.listExportJobs.pageInfo) : null,
146
150
  isLoading: a,
147
151
  error: o ?? null,
148
152
  refetch: s
149
153
  };
150
154
  }
151
- function z(e) {
152
- let { workspaceId: t } = _(), { data: n, loading: r, error: i, refetch: a } = w(c, {
155
+ function W(e) {
156
+ let { workspaceId: t } = _(), { data: n, loading: r, error: i, refetch: a } = O(c, {
153
157
  variables: {
154
158
  id: e ?? "",
155
159
  context: { workspaceId: t }
@@ -157,41 +161,41 @@ function z(e) {
157
161
  skip: !e || !t
158
162
  });
159
163
  return {
160
- data: n?.getExportJob ? M(n.getExportJob) : null,
164
+ data: n?.getExportJob ? L(n.getExportJob) : null,
161
165
  isLoading: r,
162
166
  error: i ?? null,
163
167
  refetch: a
164
168
  };
165
169
  }
166
- function B(e) {
167
- let { data: t, loading: n, error: r } = T(a, {
170
+ function G(e) {
171
+ let { data: t, loading: n, error: r } = k(a, {
168
172
  variables: { jobId: e ?? "" },
169
173
  skip: !e
170
174
  });
171
175
  return {
172
- data: t?.exportJobProgress ? M(t.exportJobProgress) : null,
176
+ data: t?.exportJobProgress ? L(t.exportJobProgress) : null,
173
177
  isLoading: n,
174
178
  error: r ?? null
175
179
  };
176
180
  }
177
- function V(e) {
181
+ function K(e) {
178
182
  let t = /* @__PURE__ */ new Set();
179
183
  return e.filter((e) => !t.has(e.entityType) && (t.add(e.entityType), !0));
180
184
  }
181
- function H(e, { fetchMoreResult: t }) {
185
+ function q(e, { fetchMoreResult: t }) {
182
186
  return t ? { getAvailableExportEntities: {
183
187
  ...t.getAvailableExportEntities,
184
188
  edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
185
189
  } } : e;
186
190
  }
187
- function U(e, t = {}) {
188
- let { workspaceId: n } = _(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = w(s, {
191
+ function J(e, t = {}) {
192
+ let { workspaceId: n } = _(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = O(s, {
189
193
  variables: {
190
194
  context: { workspaceId: r },
191
195
  pagination: { first: 100 }
192
196
  },
193
197
  skip: !r
194
- }), u = i?.getAvailableExportEntities, d = V(u?.edges.map((e) => P(e.node)) ?? []), f = async () => {
198
+ }), u = i?.getAvailableExportEntities, d = K(u?.edges.map((e) => z(e.node)) ?? []), f = async () => {
195
199
  r && u?.pageInfo.hasNextPage && await l({
196
200
  variables: {
197
201
  context: { workspaceId: r },
@@ -200,10 +204,10 @@ function U(e, t = {}) {
200
204
  after: u.pageInfo.endCursor
201
205
  }
202
206
  },
203
- updateQuery: H
207
+ updateQuery: q
204
208
  });
205
- }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`, g = x(null), [v, C] = S(null);
206
- b(() => {
209
+ }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`, g = w(null), [v, y] = T(null);
210
+ C(() => {
207
211
  !a && r && p && m && g.current !== h && (g.current = h, l({
208
212
  variables: {
209
213
  context: { workspaceId: r },
@@ -212,9 +216,9 @@ function U(e, t = {}) {
212
216
  after: m
213
217
  }
214
218
  },
215
- updateQuery: H
219
+ updateQuery: q
216
220
  }).catch((e) => {
217
- C({
221
+ y({
218
222
  page: h,
219
223
  error: e instanceof Error ? e : Error(String(e))
220
224
  });
@@ -227,24 +231,24 @@ function U(e, t = {}) {
227
231
  l,
228
232
  h
229
233
  ]);
230
- let T = y(() => {
231
- g.current = null, C(null), c().catch(() => void 0);
234
+ let b = S(() => {
235
+ g.current = null, y(null), c().catch(() => void 0);
232
236
  }, [c]);
233
237
  return {
234
238
  data: d,
235
239
  totalCount: u?.totalCount ?? 0,
236
- pageInfo: u?.pageInfo ? A(u.pageInfo) : null,
240
+ pageInfo: u?.pageInfo ? F(u.pageInfo) : null,
237
241
  loadMore: f,
238
242
  error: o ?? null,
239
243
  isLoading: a,
240
244
  refetch: c,
241
245
  complete: !!u && !p,
242
246
  moreError: v?.page === h ? v.error : null,
243
- retryAll: T
247
+ retryAll: b
244
248
  };
245
249
  }
246
- function W(e) {
247
- let { workspaceId: t } = _(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = w(d, {
250
+ function Y(e) {
251
+ let { workspaceId: t } = _(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = O(d, {
248
252
  variables: {
249
253
  context: { workspaceId: n },
250
254
  pagination: { first: 50 }
@@ -252,9 +256,9 @@ function W(e) {
252
256
  skip: !n
253
257
  }), c = r?.listExportTemplates;
254
258
  return {
255
- data: c?.edges.map((e) => N(e.node)) ?? [],
259
+ data: c?.edges.map((e) => R(e.node)) ?? [],
256
260
  totalCount: c?.totalCount ?? 0,
257
- pageInfo: c?.pageInfo ? A(c.pageInfo) : null,
261
+ pageInfo: c?.pageInfo ? F(c.pageInfo) : null,
258
262
  loadMore: async () => {
259
263
  n && c?.pageInfo.hasNextPage && await s({
260
264
  variables: {
@@ -275,8 +279,8 @@ function W(e) {
275
279
  refetch: o
276
280
  };
277
281
  }
278
- function G(e) {
279
- let { workspaceId: t } = _(), { data: n, loading: r, error: i } = w(l, {
282
+ function X(e) {
283
+ let { workspaceId: t } = _(), { data: n, loading: r, error: i } = O(l, {
280
284
  variables: {
281
285
  id: e ?? "",
282
286
  context: { workspaceId: t }
@@ -284,42 +288,54 @@ function G(e) {
284
288
  skip: !e || !t
285
289
  });
286
290
  return {
287
- data: n?.getExportTemplate ? N(n.getExportTemplate) : null,
291
+ data: n?.getExportTemplate ? R(n.getExportTemplate) : null,
288
292
  isLoading: r,
289
293
  error: i ?? null
290
294
  };
291
295
  }
292
- function K() {
293
- let e = _(), { workspaceId: n } = e, [r, { loading: i, error: a }] = C(t), o = async (t) => {
294
- let { filters: i, ...a } = t, o = {
295
- ...a,
296
- exportScope: a.exportScope ? L(a.exportScope) : void 0,
297
- format: F(a.format),
298
- entityFilters: i
299
- }, s = await r({
296
+ function Z() {
297
+ let e = _(), { workspaceId: n } = e, r = E(), i = b(), a = A(), [o, { loading: s, error: c }] = D(t), l = async (t) => {
298
+ let { filters: s, ...c } = t, l = {
299
+ ...c,
300
+ exportScope: c.exportScope ? H(c.exportScope) : void 0,
301
+ format: B(c.format),
302
+ entityFilters: s
303
+ }, d = await o({
300
304
  variables: {
301
305
  context: { workspaceId: n },
302
- input: o
306
+ input: l
303
307
  },
304
308
  refetchQueries: [{
305
309
  query: u,
306
310
  variables: { context: { workspaceId: n } }
307
311
  }]
308
312
  });
309
- if (!s.data) throw v(e, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
310
- return v(e, "export.job.created", { jobId: s.data.createExportJob.id }), M(s.data.createExportJob);
313
+ if (!d.data) throw x(e, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
314
+ x(e, "export.job.created", { jobId: d.data.createExportJob.id });
315
+ let f = L(d.data.createExportJob);
316
+ if (a) {
317
+ let { basePath: t = "/", navigate: n } = e;
318
+ y({
319
+ client: r,
320
+ job: f,
321
+ readyMessage: `${f.name} · ${i("export.v2.state.ready", "Ready")}`,
322
+ openLabel: i("export.v2.row.open", "Open"),
323
+ onOpen: () => n?.(v(t, f.id))
324
+ });
325
+ }
326
+ return f;
311
327
  };
312
328
  return {
313
- createJob: o,
314
- mutate: o,
315
- mutateAsync: o,
316
- loading: i,
317
- isPending: i,
318
- error: a ?? null
329
+ createJob: l,
330
+ mutate: l,
331
+ mutateAsync: l,
332
+ loading: s,
333
+ isPending: s,
334
+ error: c ?? null
319
335
  };
320
336
  }
321
- function q() {
322
- let t = _(), { workspaceId: n } = t, [r, { loading: i, error: a }] = C(e), o = async (e) => {
337
+ function Q() {
338
+ let t = _(), { workspaceId: n } = t, [r, { loading: i, error: a }] = D(e), o = async (e) => {
323
339
  let i = await r({
324
340
  variables: {
325
341
  id: e,
@@ -330,11 +346,11 @@ function q() {
330
346
  variables: { context: { workspaceId: n } }
331
347
  }]
332
348
  });
333
- if (!i.data) throw v(t, "export.api.failed", {
349
+ if (!i.data) throw x(t, "export.api.failed", {
334
350
  operation: "cancelExportJob",
335
351
  jobId: e
336
352
  }), Error("Failed to cancel export job");
337
- return v(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
353
+ return x(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
338
354
  };
339
355
  return {
340
356
  cancelJob: o,
@@ -345,8 +361,8 @@ function q() {
345
361
  error: a ?? null
346
362
  };
347
363
  }
348
- function J() {
349
- let e = _(), { workspaceId: t } = e, [n, { loading: i, error: a }] = C(r), o = async (r) => (await n({
364
+ function $() {
365
+ let e = _(), { workspaceId: t } = e, [n, { loading: i, error: a }] = D(r), o = async (r) => (await n({
350
366
  variables: {
351
367
  id: r,
352
368
  context: { workspaceId: t }
@@ -355,7 +371,7 @@ function J() {
355
371
  query: u,
356
372
  variables: { context: { workspaceId: t } }
357
373
  }]
358
- }), v(e, "export.job.deleted", { jobId: r }), !0);
374
+ }), x(e, "export.job.deleted", { jobId: r }), !0);
359
375
  return {
360
376
  deleteJob: o,
361
377
  mutate: o,
@@ -365,8 +381,8 @@ function J() {
365
381
  error: a ?? null
366
382
  };
367
383
  }
368
- function Y() {
369
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = C(f);
384
+ function ee() {
385
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = D(f);
370
386
  return {
371
387
  retryJob: async (r) => {
372
388
  let i = await n({
@@ -379,27 +395,27 @@ function Y() {
379
395
  variables: { context: { workspaceId: t } }
380
396
  }]
381
397
  });
382
- if (!i.data) throw v(e, "export.api.failed", {
398
+ if (!i.data) throw x(e, "export.api.failed", {
383
399
  operation: "retryExportJob",
384
400
  jobId: r
385
401
  }), Error("Failed to retry export job");
386
- return v(e, "export.job.retried", {
402
+ return x(e, "export.job.retried", {
387
403
  originalJobId: r,
388
404
  jobId: i.data.retryExportJob.id
389
- }), M(i.data.retryExportJob);
405
+ }), L(i.data.retryExportJob);
390
406
  },
391
407
  loading: r,
392
408
  isPending: r,
393
409
  error: i ?? null
394
410
  };
395
411
  }
396
- function X() {
397
- let e = _(), { workspaceId: t } = e, [r, { loading: i, error: a }] = C(n);
412
+ function te() {
413
+ let e = _(), { workspaceId: t } = e, [r, { loading: i, error: a }] = D(n);
398
414
  return {
399
415
  createTemplate: async (n) => {
400
416
  let i = {
401
417
  ...n,
402
- format: F(n.format)
418
+ format: B(n.format)
403
419
  }, a = await r({
404
420
  variables: {
405
421
  context: { workspaceId: t },
@@ -410,16 +426,16 @@ function X() {
410
426
  variables: { context: { workspaceId: t } }
411
427
  }]
412
428
  });
413
- if (!a.data) throw v(e, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
414
- return v(e, "export.template.created", { templateId: a.data.createExportTemplate.id }), N(a.data.createExportTemplate);
429
+ if (!a.data) throw x(e, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
430
+ return x(e, "export.template.created", { templateId: a.data.createExportTemplate.id }), R(a.data.createExportTemplate);
415
431
  },
416
432
  loading: i,
417
433
  isPending: i,
418
434
  error: a ?? null
419
435
  };
420
436
  }
421
- function Z() {
422
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = C(p);
437
+ function ne() {
438
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = D(p);
423
439
  return {
424
440
  updateTemplate: async (r, i) => {
425
441
  let a = await n({
@@ -428,7 +444,7 @@ function Z() {
428
444
  id: r,
429
445
  input: {
430
446
  ...i,
431
- format: F(i.format)
447
+ format: B(i.format)
432
448
  }
433
449
  },
434
450
  refetchQueries: [{
@@ -436,16 +452,16 @@ function Z() {
436
452
  variables: { context: { workspaceId: t } }
437
453
  }]
438
454
  });
439
- if (!a.data) throw v(e, "export.api.failed", { operation: "updateExportTemplate" }), Error("Failed to update export template");
440
- return N(a.data.updateExportTemplate);
455
+ if (!a.data) throw x(e, "export.api.failed", { operation: "updateExportTemplate" }), Error("Failed to update export template");
456
+ return R(a.data.updateExportTemplate);
441
457
  },
442
458
  loading: r,
443
459
  isPending: r,
444
460
  error: i ?? null
445
461
  };
446
462
  }
447
- function Q() {
448
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: a }] = C(i);
463
+ function re() {
464
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: a }] = D(i);
449
465
  return {
450
466
  deleteTemplate: async (r) => (await n({
451
467
  variables: {
@@ -456,14 +472,14 @@ function Q() {
456
472
  query: d,
457
473
  variables: { context: { workspaceId: t } }
458
474
  }]
459
- }), v(e, "export.template.deleted", { templateId: r }), !0),
475
+ }), x(e, "export.template.deleted", { templateId: r }), !0),
460
476
  loading: r,
461
477
  isPending: r,
462
478
  error: a ?? null
463
479
  };
464
480
  }
465
- function $(e, t = {}) {
466
- let { data: n, loading: r, error: i } = w(o, {
481
+ function ie(e, t = {}) {
482
+ let { data: n, loading: r, error: i } = O(o, {
467
483
  variables: { scopeId: e ?? "" },
468
484
  skip: !e,
469
485
  fetchPolicy: "network-only",
@@ -471,6 +487,6 @@ function $(e, t = {}) {
471
487
  });
472
488
  return !!e && !!n && !r && !i && n?.myPermissions.scopeId === e && n.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
473
489
  }
474
- export { M as mapJob, N as mapTemplate, V as uniqueByEntityType, U as useAvailableEntities, q as useCancelExportJob, K as useCreateExportJob, X as useCreateExportTemplate, J as useDeleteExportJob, Q as useDeleteExportTemplate, z as useExportJob, B as useExportJobProgress, R as useExportJobs, G as useExportTemplate, W as useExportTemplates, $ as useOrganizationExportPermission, Y as useRetryExportJob, Z as useUpdateExportTemplate };
490
+ export { L as mapJob, R as mapTemplate, K as uniqueByEntityType, J as useAvailableEntities, Q as useCancelExportJob, Z as useCreateExportJob, te as useCreateExportTemplate, $ as useDeleteExportJob, re as useDeleteExportTemplate, W as useExportJob, G as useExportJobProgress, U as useExportJobs, X as useExportTemplate, Y as useExportTemplates, ie as useOrganizationExportPermission, ee as useRetryExportJob, ne as useUpdateExportTemplate };
475
491
 
476
492
  //# sourceMappingURL=useExportQueries.js.map