@burdenoff/microfe-export 2026.1123.1 → 2026.1124.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/export/ExportRoutes.js +23 -22
  2. package/dist/export/ExportRoutes.js.map +1 -1
  3. package/dist/export/hooks/useExportQueries.d.ts +89 -1
  4. package/dist/export/hooks/useExportQueries.js +167 -127
  5. package/dist/export/hooks/useExportQueries.js.map +1 -1
  6. package/dist/export/workspace-v2/DownloadCells.d.ts +29 -0
  7. package/dist/export/workspace-v2/DownloadCells.js +105 -0
  8. package/dist/export/workspace-v2/DownloadCells.js.map +1 -0
  9. package/dist/export/workspace-v2/DownloadsList.d.ts +13 -0
  10. package/dist/export/workspace-v2/DownloadsList.js +208 -0
  11. package/dist/export/workspace-v2/DownloadsList.js.map +1 -0
  12. package/dist/export/workspace-v2/DownloadsPage.d.ts +1 -0
  13. package/dist/export/workspace-v2/DownloadsPage.js +114 -0
  14. package/dist/export/workspace-v2/DownloadsPage.js.map +1 -0
  15. package/dist/export/workspace-v2/ExportV2Routes.d.ts +1 -0
  16. package/dist/export/workspace-v2/ExportV2Routes.js +68 -0
  17. package/dist/export/workspace-v2/ExportV2Routes.js.map +1 -0
  18. package/dist/export/workspace-v2/NewDownloadDialog.d.ts +10 -0
  19. package/dist/export/workspace-v2/NewDownloadDialog.js +432 -0
  20. package/dist/export/workspace-v2/NewDownloadDialog.js.map +1 -0
  21. package/dist/export/workspace-v2/SetupsList.d.ts +13 -0
  22. package/dist/export/workspace-v2/SetupsList.js +132 -0
  23. package/dist/export/workspace-v2/SetupsList.js.map +1 -0
  24. package/dist/export/workspace-v2/downloadsModel.d.ts +108 -0
  25. package/dist/export/workspace-v2/downloadsModel.js +138 -0
  26. package/dist/export/workspace-v2/downloadsModel.js.map +1 -0
  27. package/dist/export/workspace-v2/newDownloadModel.d.ts +48 -0
  28. package/dist/export/workspace-v2/newDownloadModel.js +76 -0
  29. package/dist/export/workspace-v2/newDownloadModel.js.map +1 -0
  30. package/dist/export/workspace-v2/useDownloadActions.d.ts +20 -0
  31. package/dist/export/workspace-v2/useDownloadActions.js +127 -0
  32. package/dist/export/workspace-v2/useDownloadActions.js.map +1 -0
  33. package/dist/export/workspace-v2/useDownloadsData.d.ts +57 -0
  34. package/dist/export/workspace-v2/useDownloadsData.js +186 -0
  35. package/dist/export/workspace-v2/useDownloadsData.js.map +1 -0
  36. package/dist/export/workspace-v2/useDownloadsPage.d.ts +22 -0
  37. package/dist/export/workspace-v2/useDownloadsPage.js +45 -0
  38. package/dist/export/workspace-v2/useDownloadsPage.js.map +1 -0
  39. package/dist/export/workspace-v2/useExportAccess.d.ts +21 -0
  40. package/dist/export/workspace-v2/useExportAccess.js +16 -0
  41. package/dist/export/workspace-v2/useExportAccess.js.map +1 -0
  42. package/dist/export/workspace-v2/useListClock.d.ts +4 -0
  43. package/dist/export/workspace-v2/useListClock.js +20 -0
  44. package/dist/export/workspace-v2/useListClock.js.map +1 -0
  45. package/dist/export/workspace-v2/useOfferedKinds.d.ts +19 -0
  46. package/dist/export/workspace-v2/useOfferedKinds.js +30 -0
  47. package/dist/export/workspace-v2/useOfferedKinds.js.map +1 -0
  48. package/dist/export/workspace-v2/useOnceAtATime.d.ts +7 -0
  49. package/dist/export/workspace-v2/useOnceAtATime.js +17 -0
  50. package/dist/export/workspace-v2/useOnceAtATime.js.map +1 -0
  51. package/dist/generated/global-types.d.ts +9901 -584
  52. package/dist/generated/wspace-operations.js +9 -11
  53. package/dist/generated/wspace-operations.js.map +1 -1
  54. package/dist/generated/wspace-types.d.ts +195315 -42067
  55. package/dist/generated/wspace-types.js +5 -1
  56. package/dist/generated/wspace-types.js.map +1 -1
  57. package/dist/translations/en.d.ts +190 -0
  58. package/dist/translations/en.js +191 -1
  59. package/dist/translations/en.js.map +1 -1
  60. package/package.json +11 -3
@@ -1,137 +1,137 @@
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 } from "../../generated/wspace-operations.js";
2
- import { ExportFormat as p, ExportJobStatus as m, ExportScope as h } from "../../generated/wspace-types.js";
3
- import { useExport as g } from "../providers/ExportProvider.js";
4
- import { emitExportEvent as _ } from "../utils/events.js";
5
- import { useEffect as v, useRef as y } from "react";
6
- import { useMutation as b, useQuery as x, useSubscription as S } from "@apollo/client/react";
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
+ import { ExportFormat as m, ExportJobStatus as h, ExportScope as g } from "../../generated/wspace-types.js";
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";
7
7
  // src/export/hooks/useExportQueries.ts
8
- function C(e) {
8
+ function E(e) {
9
9
  return e ?? void 0;
10
10
  }
11
- function w(e) {
11
+ function D(e) {
12
12
  if (e == null) return;
13
13
  let t = typeof e == "number" ? e : Number(e);
14
14
  return Number.isFinite(t) ? t : void 0;
15
15
  }
16
- function T(e) {
17
- return w(e) ?? 0;
16
+ function O(e) {
17
+ return D(e) ?? 0;
18
18
  }
19
- function E(e) {
19
+ function k(e) {
20
20
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
21
21
  }
22
- function D(e) {
22
+ function A(e) {
23
23
  return {
24
24
  hasNextPage: e.hasNextPage,
25
25
  hasPreviousPage: e.hasPreviousPage,
26
- startCursor: C(e.startCursor),
27
- endCursor: C(e.endCursor)
26
+ startCursor: E(e.startCursor),
27
+ endCursor: E(e.endCursor)
28
28
  };
29
29
  }
30
- function O(e) {
30
+ function j(e) {
31
31
  return {
32
32
  id: e.id,
33
- jobId: C(e.jobId),
33
+ jobId: E(e.jobId),
34
34
  partNumber: e.partNumber,
35
35
  fileName: e.fileName,
36
- sizeBytes: T(e.sizeBytes),
36
+ sizeBytes: O(e.sizeBytes),
37
37
  entityTypes: e.entityTypes,
38
- downloadUrl: C(e.downloadUrl),
39
- downloadExpiresAt: C(e.downloadExpiresAt),
40
- checksum: C(e.checksum),
41
- createdAt: C(e.createdAt)
38
+ downloadUrl: E(e.downloadUrl),
39
+ downloadExpiresAt: E(e.downloadExpiresAt),
40
+ checksum: E(e.checksum),
41
+ createdAt: E(e.createdAt)
42
42
  };
43
43
  }
44
- function k(e) {
44
+ function M(e) {
45
45
  return {
46
46
  id: e.id,
47
47
  name: e.name,
48
- description: C(e.description),
48
+ description: E(e.description),
49
49
  status: e.status,
50
50
  progress: e.progress,
51
51
  exportScope: e.exportScope ? e.exportScope : void 0,
52
- organizationId: C(e.organizationId),
52
+ organizationId: E(e.organizationId),
53
53
  targetWorkspaceIds: e.targetWorkspaceIds ?? void 0,
54
54
  entityTypes: e.entityTypes,
55
55
  format: e.format,
56
56
  archiveFormat: e.archiveFormat ?? "ZIP",
57
- totalEntities: w(e.totalEntities),
58
- processedEntities: w(e.processedEntities),
59
- totalSizeBytes: w(e.totalSizeBytes),
60
- parts: e.parts?.map(O) ?? [],
61
- archiveFileId: C(e.archiveFileId),
62
- downloadUrl: C(e.downloadUrl),
63
- downloadExpiresAt: C(e.downloadExpiresAt),
64
- templateId: C(e.templateId),
65
- filters: E(e.entityFilters),
66
- errorMessage: C(e.errorMessage),
67
- startedAt: C(e.startedAt),
68
- completedAt: C(e.completedAt),
69
- expiresAt: C(e.expiresAt),
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),
70
70
  createdBy: e.createdBy,
71
- temporalWorkflowId: C(e.temporalWorkflowId),
72
- workspaceId: C(e.workspaceId),
71
+ temporalWorkflowId: E(e.temporalWorkflowId),
72
+ workspaceId: E(e.workspaceId),
73
73
  createdAt: e.createdAt,
74
74
  updatedAt: e.updatedAt
75
75
  };
76
76
  }
77
- function A(e) {
77
+ function N(e) {
78
78
  return {
79
79
  id: e.id,
80
80
  name: e.name,
81
- description: C(e.description),
81
+ description: E(e.description),
82
82
  entityTypes: e.entityTypes,
83
83
  format: e.format,
84
- filters: E(e.entityFilters),
84
+ filters: k(e.entityFilters),
85
85
  isDefault: e.isDefault,
86
86
  createdBy: e.createdBy,
87
- workspaceId: C(e.workspaceId),
87
+ workspaceId: E(e.workspaceId),
88
88
  createdAt: e.createdAt,
89
89
  updatedAt: e.updatedAt
90
90
  };
91
91
  }
92
- function j(e) {
92
+ function P(e) {
93
93
  return {
94
94
  entityType: e.entityType,
95
95
  displayName: e.displayName,
96
- description: C(e.description),
97
- estimatedSize: C(e.estimatedSize),
96
+ description: E(e.description),
97
+ estimatedSize: E(e.estimatedSize),
98
98
  supportsDateRange: e.supportsDateRange,
99
99
  supportsMediaExport: e.supportsMediaExport,
100
100
  enabled: e.enabled
101
101
  };
102
102
  }
103
- function M(e) {
104
- if (e === "CSV") return p.Csv;
105
- if (e === "JSON") return p.Json;
103
+ function F(e) {
104
+ if (e === "CSV") return m.Csv;
105
+ if (e === "JSON") return m.Json;
106
106
  throw Error(`Unsupported export format: ${e}`);
107
107
  }
108
- function N(e) {
108
+ function I(e) {
109
109
  switch (e) {
110
- case "CANCELLED": return m.Cancelled;
111
- case "COMPLETED": return m.Completed;
112
- case "CREATED": return m.Created;
113
- case "DELETED": return m.Deleted;
114
- case "EXPIRED": return m.Expired;
115
- case "FAILED": return m.Failed;
116
- case "QUEUED": return m.Queued;
117
- case "RUNNING": return m.Running;
110
+ case "CANCELLED": return h.Cancelled;
111
+ case "COMPLETED": return h.Completed;
112
+ case "CREATED": return h.Created;
113
+ case "DELETED": return h.Deleted;
114
+ case "EXPIRED": return h.Expired;
115
+ case "FAILED": return h.Failed;
116
+ case "QUEUED": return h.Queued;
117
+ case "RUNNING": return h.Running;
118
118
  default: throw Error(`Unsupported export status: ${e}`);
119
119
  }
120
120
  }
121
- function P(e) {
121
+ function L(e) {
122
122
  switch (e) {
123
- case "INDIVIDUAL": return h.Individual;
124
- case "WORKSPACE_ADMIN": return h.WorkspaceAdmin;
125
- case "ORG_ADMIN": return h.OrgAdmin;
123
+ case "INDIVIDUAL": return g.Individual;
124
+ case "WORKSPACE_ADMIN": return g.WorkspaceAdmin;
125
+ case "ORG_ADMIN": return g.OrgAdmin;
126
126
  default: throw Error(`Unsupported export scope: ${e}`);
127
127
  }
128
128
  }
129
- function F(e, t) {
130
- let { workspaceId: n } = g(), r = e && n ? {
131
- status: e.status && e.status !== "all" ? [N(e.status)] : void 0,
132
- format: e.format && e.format !== "all" ? M(e.format) : void 0,
129
+ function R(e, t) {
130
+ 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,
133
133
  search: e.search ?? void 0
134
- } : void 0, { data: i, loading: a, error: o, refetch: s } = x(u, {
134
+ } : void 0, { data: i, loading: a, error: o, refetch: s } = w(u, {
135
135
  variables: {
136
136
  filter: r,
137
137
  pagination: t,
@@ -140,16 +140,16 @@ function F(e, t) {
140
140
  skip: !n
141
141
  });
142
142
  return {
143
- data: i?.listExportJobs.edges.map((e) => k(e.node)) ?? [],
143
+ data: i?.listExportJobs.edges.map((e) => M(e.node)) ?? [],
144
144
  totalCount: i?.listExportJobs.totalCount ?? 0,
145
- pageInfo: i?.listExportJobs.pageInfo ? D(i.listExportJobs.pageInfo) : null,
145
+ pageInfo: i?.listExportJobs.pageInfo ? A(i.listExportJobs.pageInfo) : null,
146
146
  isLoading: a,
147
147
  error: o ?? null,
148
148
  refetch: s
149
149
  };
150
150
  }
151
- function I(e) {
152
- let { workspaceId: t } = g(), { data: n, loading: r, error: i, refetch: a } = x(c, {
151
+ function z(e) {
152
+ let { workspaceId: t } = _(), { data: n, loading: r, error: i, refetch: a } = w(c, {
153
153
  variables: {
154
154
  id: e ?? "",
155
155
  context: { workspaceId: t }
@@ -157,41 +157,41 @@ function I(e) {
157
157
  skip: !e || !t
158
158
  });
159
159
  return {
160
- data: n?.getExportJob ? k(n.getExportJob) : null,
160
+ data: n?.getExportJob ? M(n.getExportJob) : null,
161
161
  isLoading: r,
162
162
  error: i ?? null,
163
163
  refetch: a
164
164
  };
165
165
  }
166
- function L(e) {
167
- let { data: t, loading: n, error: r } = S(a, {
166
+ function B(e) {
167
+ let { data: t, loading: n, error: r } = T(a, {
168
168
  variables: { jobId: e ?? "" },
169
169
  skip: !e
170
170
  });
171
171
  return {
172
- data: t?.exportJobProgress ? k(t.exportJobProgress) : null,
172
+ data: t?.exportJobProgress ? M(t.exportJobProgress) : null,
173
173
  isLoading: n,
174
174
  error: r ?? null
175
175
  };
176
176
  }
177
- function R(e) {
177
+ function V(e) {
178
178
  let t = /* @__PURE__ */ new Set();
179
179
  return e.filter((e) => !t.has(e.entityType) && (t.add(e.entityType), !0));
180
180
  }
181
- function z(e, { fetchMoreResult: t }) {
181
+ function H(e, { fetchMoreResult: t }) {
182
182
  return t ? { getAvailableExportEntities: {
183
183
  ...t.getAvailableExportEntities,
184
184
  edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
185
185
  } } : e;
186
186
  }
187
- function B(e, t = {}) {
188
- let { workspaceId: n } = g(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = x(s, {
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, {
189
189
  variables: {
190
190
  context: { workspaceId: r },
191
191
  pagination: { first: 100 }
192
192
  },
193
193
  skip: !r
194
- }), u = i?.getAvailableExportEntities, d = R(u?.edges.map((e) => j(e.node)) ?? []), f = async () => {
194
+ }), u = i?.getAvailableExportEntities, d = V(u?.edges.map((e) => P(e.node)) ?? []), f = async () => {
195
195
  r && u?.pageInfo.hasNextPage && await l({
196
196
  variables: {
197
197
  context: { workspaceId: r },
@@ -200,11 +200,11 @@ function B(e, t = {}) {
200
200
  after: u.pageInfo.endCursor
201
201
  }
202
202
  },
203
- updateQuery: z
203
+ updateQuery: H
204
204
  });
205
- }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = y(null);
206
- return v(() => {
207
- !a && r && p && m && h.current !== m && (h.current = m, l({
205
+ }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`, g = x(null), [v, C] = S(null);
206
+ b(() => {
207
+ !a && r && p && m && g.current !== h && (g.current = h, l({
208
208
  variables: {
209
209
  context: { workspaceId: r },
210
210
  pagination: {
@@ -212,26 +212,39 @@ function B(e, t = {}) {
212
212
  after: m
213
213
  }
214
214
  },
215
- updateQuery: z
215
+ updateQuery: H
216
+ }).catch((e) => {
217
+ C({
218
+ page: h,
219
+ error: e instanceof Error ? e : Error(String(e))
220
+ });
216
221
  }));
217
222
  }, [
218
223
  a,
219
224
  r,
220
225
  p,
221
226
  m,
222
- l
223
- ]), {
227
+ l,
228
+ h
229
+ ]);
230
+ let T = y(() => {
231
+ g.current = null, C(null), c().catch(() => void 0);
232
+ }, [c]);
233
+ return {
224
234
  data: d,
225
235
  totalCount: u?.totalCount ?? 0,
226
- pageInfo: u?.pageInfo ? D(u.pageInfo) : null,
236
+ pageInfo: u?.pageInfo ? A(u.pageInfo) : null,
227
237
  loadMore: f,
228
238
  error: o ?? null,
229
239
  isLoading: a,
230
- refetch: c
240
+ refetch: c,
241
+ complete: !!u && !p,
242
+ moreError: v?.page === h ? v.error : null,
243
+ retryAll: T
231
244
  };
232
245
  }
233
- function V(e) {
234
- let { workspaceId: t } = g(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = x(d, {
246
+ function W(e) {
247
+ let { workspaceId: t } = _(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = w(d, {
235
248
  variables: {
236
249
  context: { workspaceId: n },
237
250
  pagination: { first: 50 }
@@ -239,9 +252,9 @@ function V(e) {
239
252
  skip: !n
240
253
  }), c = r?.listExportTemplates;
241
254
  return {
242
- data: c?.edges.map((e) => A(e.node)) ?? [],
255
+ data: c?.edges.map((e) => N(e.node)) ?? [],
243
256
  totalCount: c?.totalCount ?? 0,
244
- pageInfo: c?.pageInfo ? D(c.pageInfo) : null,
257
+ pageInfo: c?.pageInfo ? A(c.pageInfo) : null,
245
258
  loadMore: async () => {
246
259
  n && c?.pageInfo.hasNextPage && await s({
247
260
  variables: {
@@ -262,8 +275,8 @@ function V(e) {
262
275
  refetch: o
263
276
  };
264
277
  }
265
- function H(e) {
266
- let { workspaceId: t } = g(), { data: n, loading: r, error: i } = x(l, {
278
+ function G(e) {
279
+ let { workspaceId: t } = _(), { data: n, loading: r, error: i } = w(l, {
267
280
  variables: {
268
281
  id: e ?? "",
269
282
  context: { workspaceId: t }
@@ -271,17 +284,17 @@ function H(e) {
271
284
  skip: !e || !t
272
285
  });
273
286
  return {
274
- data: n?.getExportTemplate ? A(n.getExportTemplate) : null,
287
+ data: n?.getExportTemplate ? N(n.getExportTemplate) : null,
275
288
  isLoading: r,
276
289
  error: i ?? null
277
290
  };
278
291
  }
279
- function U() {
280
- let e = g(), { workspaceId: n } = e, [r, { loading: i, error: a }] = b(t), o = async (t) => {
292
+ function K() {
293
+ let e = _(), { workspaceId: n } = e, [r, { loading: i, error: a }] = C(t), o = async (t) => {
281
294
  let { filters: i, ...a } = t, o = {
282
295
  ...a,
283
- exportScope: a.exportScope ? P(a.exportScope) : void 0,
284
- format: M(a.format),
296
+ exportScope: a.exportScope ? L(a.exportScope) : void 0,
297
+ format: F(a.format),
285
298
  entityFilters: i
286
299
  }, s = await r({
287
300
  variables: {
@@ -293,8 +306,8 @@ function U() {
293
306
  variables: { context: { workspaceId: n } }
294
307
  }]
295
308
  });
296
- if (!s.data) throw _(e, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
297
- return _(e, "export.job.created", { jobId: s.data.createExportJob.id }), k(s.data.createExportJob);
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);
298
311
  };
299
312
  return {
300
313
  createJob: o,
@@ -305,8 +318,8 @@ function U() {
305
318
  error: a ?? null
306
319
  };
307
320
  }
308
- function W() {
309
- let t = g(), { workspaceId: n } = t, [r, { loading: i, error: a }] = b(e), o = async (e) => {
321
+ function q() {
322
+ let t = _(), { workspaceId: n } = t, [r, { loading: i, error: a }] = C(e), o = async (e) => {
310
323
  let i = await r({
311
324
  variables: {
312
325
  id: e,
@@ -317,11 +330,11 @@ function W() {
317
330
  variables: { context: { workspaceId: n } }
318
331
  }]
319
332
  });
320
- if (!i.data) throw _(t, "export.api.failed", {
333
+ if (!i.data) throw v(t, "export.api.failed", {
321
334
  operation: "cancelExportJob",
322
335
  jobId: e
323
336
  }), Error("Failed to cancel export job");
324
- return _(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
337
+ return v(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
325
338
  };
326
339
  return {
327
340
  cancelJob: o,
@@ -332,8 +345,8 @@ function W() {
332
345
  error: a ?? null
333
346
  };
334
347
  }
335
- function G() {
336
- let e = g(), { workspaceId: t } = e, [n, { loading: i, error: a }] = b(r), o = async (r) => (await n({
348
+ function J() {
349
+ let e = _(), { workspaceId: t } = e, [n, { loading: i, error: a }] = C(r), o = async (r) => (await n({
337
350
  variables: {
338
351
  id: r,
339
352
  context: { workspaceId: t }
@@ -342,7 +355,7 @@ function G() {
342
355
  query: u,
343
356
  variables: { context: { workspaceId: t } }
344
357
  }]
345
- }), _(e, "export.job.deleted", { jobId: r }), !0);
358
+ }), v(e, "export.job.deleted", { jobId: r }), !0);
346
359
  return {
347
360
  deleteJob: o,
348
361
  mutate: o,
@@ -352,8 +365,8 @@ function G() {
352
365
  error: a ?? null
353
366
  };
354
367
  }
355
- function K() {
356
- let e = g(), { workspaceId: t } = e, [n, { loading: r, error: i }] = b(f);
368
+ function Y() {
369
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = C(f);
357
370
  return {
358
371
  retryJob: async (r) => {
359
372
  let i = await n({
@@ -366,27 +379,27 @@ function K() {
366
379
  variables: { context: { workspaceId: t } }
367
380
  }]
368
381
  });
369
- if (!i.data) throw _(e, "export.api.failed", {
382
+ if (!i.data) throw v(e, "export.api.failed", {
370
383
  operation: "retryExportJob",
371
384
  jobId: r
372
385
  }), Error("Failed to retry export job");
373
- return _(e, "export.job.retried", {
386
+ return v(e, "export.job.retried", {
374
387
  originalJobId: r,
375
388
  jobId: i.data.retryExportJob.id
376
- }), k(i.data.retryExportJob);
389
+ }), M(i.data.retryExportJob);
377
390
  },
378
391
  loading: r,
379
392
  isPending: r,
380
393
  error: i ?? null
381
394
  };
382
395
  }
383
- function q() {
384
- let e = g(), { workspaceId: t } = e, [r, { loading: i, error: a }] = b(n);
396
+ function X() {
397
+ let e = _(), { workspaceId: t } = e, [r, { loading: i, error: a }] = C(n);
385
398
  return {
386
399
  createTemplate: async (n) => {
387
400
  let i = {
388
401
  ...n,
389
- format: M(n.format)
402
+ format: F(n.format)
390
403
  }, a = await r({
391
404
  variables: {
392
405
  context: { workspaceId: t },
@@ -397,16 +410,42 @@ function q() {
397
410
  variables: { context: { workspaceId: t } }
398
411
  }]
399
412
  });
400
- if (!a.data) throw _(e, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
401
- return _(e, "export.template.created", { templateId: a.data.createExportTemplate.id }), A(a.data.createExportTemplate);
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);
402
415
  },
403
416
  loading: i,
404
417
  isPending: i,
405
418
  error: a ?? null
406
419
  };
407
420
  }
408
- function J() {
409
- let e = g(), { workspaceId: t } = e, [n, { loading: r, error: a }] = b(i);
421
+ function Z() {
422
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = C(p);
423
+ return {
424
+ updateTemplate: async (r, i) => {
425
+ let a = await n({
426
+ variables: {
427
+ context: { workspaceId: t },
428
+ id: r,
429
+ input: {
430
+ ...i,
431
+ format: F(i.format)
432
+ }
433
+ },
434
+ refetchQueries: [{
435
+ query: d,
436
+ variables: { context: { workspaceId: t } }
437
+ }]
438
+ });
439
+ if (!a.data) throw v(e, "export.api.failed", { operation: "updateExportTemplate" }), Error("Failed to update export template");
440
+ return N(a.data.updateExportTemplate);
441
+ },
442
+ loading: r,
443
+ isPending: r,
444
+ error: i ?? null
445
+ };
446
+ }
447
+ function Q() {
448
+ let e = _(), { workspaceId: t } = e, [n, { loading: r, error: a }] = C(i);
410
449
  return {
411
450
  deleteTemplate: async (r) => (await n({
412
451
  variables: {
@@ -417,20 +456,21 @@ function J() {
417
456
  query: d,
418
457
  variables: { context: { workspaceId: t } }
419
458
  }]
420
- }), _(e, "export.template.deleted", { templateId: r }), !0),
459
+ }), v(e, "export.template.deleted", { templateId: r }), !0),
421
460
  loading: r,
422
461
  isPending: r,
423
462
  error: a ?? null
424
463
  };
425
464
  }
426
- function Y(e) {
427
- let { data: t, loading: n, error: r } = x(o, {
465
+ function $(e, t = {}) {
466
+ let { data: n, loading: r, error: i } = w(o, {
428
467
  variables: { scopeId: e ?? "" },
429
468
  skip: !e,
430
- fetchPolicy: "network-only"
469
+ fetchPolicy: "network-only",
470
+ context: t.quiet ? { suppressGlobalErrorEvent: !0 } : void 0
431
471
  });
432
- return !!e && !!t && !n && !r && t?.myPermissions.scopeId === e && t.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
472
+ return !!e && !!n && !r && !i && n?.myPermissions.scopeId === e && n.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
433
473
  }
434
- export { R as uniqueByEntityType, B as useAvailableEntities, W as useCancelExportJob, U as useCreateExportJob, q as useCreateExportTemplate, G as useDeleteExportJob, J as useDeleteExportTemplate, I as useExportJob, L as useExportJobProgress, F as useExportJobs, H as useExportTemplate, V as useExportTemplates, Y as useOrganizationExportPermission, K as useRetryExportJob };
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 };
435
475
 
436
476
  //# sourceMappingURL=useExportQueries.js.map