@burdenoff/microfe-export 2026.1023.2 → 2026.1107.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.
@@ -206,4 +206,6 @@ export declare function useDeleteExportTemplate(): {
206
206
  isPending: boolean;
207
207
  error: import('@apollo/client').ErrorLike | null;
208
208
  };
209
+ /** Organization scope is independent of workspace grants; this is a UX hint only. */
210
+ export declare function useOrganizationExportPermission(organizationId: string | undefined): boolean;
209
211
  //# sourceMappingURL=useExportQueries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExportQueries.d.ts","sourceRoot":"","sources":["../../../src/export/hooks/useExportQueries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAyBL,KAAK,+BAA+B,EAEpC,KAAK,iBAAiB,EAItB,KAAK,mBAAmB,EAExB,KAAK,wBAAwB,EAI9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,eAAe,IAAI,kBAAkB,EAIrC,KAAK,oBAAoB,IAAI,uBAAuB,EACpD,KAAK,qBAAqB,IAAI,wBAAwB,EACvD,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,WAAW,EACX,cAAc,EACd,qBAAqB,EAErB,YAAY,EACZ,QAAQ,EACT,MAAM,UAAU,CAAC;AAwOlB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GA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AAC;;;;EAyB5D;AAED,qFAAqF;AACrF,wBAAgB,+BAA+B,CAC7C,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,OAAO,CAqBT"}
@@ -1,134 +1,137 @@
1
1
  import { useExport as e } from "../providers/ExportProvider.js";
2
- import { CancelExportJobDocument as t, CreateExportJobDocument as n, CreateExportTemplateDocument as r, DeleteExportJobDocument as i, DeleteExportTemplateDocument as a, ExportJobProgressDocument 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";
3
- import { ExportFormat as p, ExportJobStatus as m, ExportScope as h } from "../../generated/wspace-types.js";
4
- import { emitExportEvent as g } from "../utils/events.js";
5
- import { useEffect as _, useRef as v } from "react";
6
- import { useMutation as y, useQuery as b, useSubscription as x } from "@apollo/client/react";
2
+ import { CancelExportJobDocument as t, CreateExportJobDocument as n, CreateExportTemplateDocument as r, DeleteExportJobDocument as i, DeleteExportTemplateDocument as a, ExportJobProgressDocument as o, ExportOrganizationPermissionDocument as s, GetAvailableExportEntitiesDocument as c, GetExportJobDocument as l, GetExportTemplateDocument as u, ListExportJobsDocument as d, ListExportTemplatesDocument as f, RetryExportJobDocument as p } from "../../generated/wspace-operations.js";
3
+ import { ExportFormat as m, ExportJobStatus as h, ExportScope as g } from "../../generated/wspace-types.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";
7
7
  //#region src/export/hooks/useExportQueries.ts
8
- function S(e) {
8
+ function C(e) {
9
9
  return e ?? void 0;
10
10
  }
11
- function C(e) {
11
+ function w(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 w(e) {
17
- return C(e) ?? 0;
18
- }
19
16
  function T(e) {
20
- return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
17
+ return w(e) ?? 0;
21
18
  }
22
19
  function E(e) {
20
+ return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
21
+ }
22
+ function D(e) {
23
23
  return {
24
24
  hasNextPage: e.hasNextPage,
25
25
  hasPreviousPage: e.hasPreviousPage,
26
- startCursor: S(e.startCursor),
27
- endCursor: S(e.endCursor)
26
+ startCursor: C(e.startCursor),
27
+ endCursor: C(e.endCursor)
28
28
  };
29
29
  }
30
- function D(e) {
30
+ function O(e) {
31
31
  return {
32
32
  id: e.id,
33
- jobId: S(e.jobId),
33
+ jobId: C(e.jobId),
34
34
  partNumber: e.partNumber,
35
35
  fileName: e.fileName,
36
- sizeBytes: w(e.sizeBytes),
36
+ sizeBytes: T(e.sizeBytes),
37
37
  entityTypes: e.entityTypes,
38
- downloadUrl: S(e.downloadUrl),
39
- downloadExpiresAt: S(e.downloadExpiresAt),
40
- checksum: S(e.checksum),
41
- createdAt: S(e.createdAt)
38
+ downloadUrl: C(e.downloadUrl),
39
+ downloadExpiresAt: C(e.downloadExpiresAt),
40
+ checksum: C(e.checksum),
41
+ createdAt: C(e.createdAt)
42
42
  };
43
43
  }
44
- function O(e) {
44
+ function k(e) {
45
45
  return {
46
46
  id: e.id,
47
47
  name: e.name,
48
- description: S(e.description),
48
+ description: C(e.description),
49
49
  status: e.status,
50
50
  progress: e.progress,
51
51
  exportScope: e.exportScope ? e.exportScope : void 0,
52
- organizationId: S(e.organizationId),
52
+ organizationId: C(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: C(e.totalEntities),
58
- processedEntities: C(e.processedEntities),
59
- totalSizeBytes: C(e.totalSizeBytes),
60
- parts: e.parts?.map(D) ?? [],
61
- templateId: S(e.templateId),
62
- filters: T(e.entityFilters),
63
- errorMessage: S(e.errorMessage),
64
- startedAt: S(e.startedAt),
65
- completedAt: S(e.completedAt),
66
- expiresAt: S(e.expiresAt),
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),
67
70
  createdBy: e.createdBy,
68
- temporalWorkflowId: S(e.temporalWorkflowId),
69
- workspaceId: S(e.workspaceId),
71
+ temporalWorkflowId: C(e.temporalWorkflowId),
72
+ workspaceId: C(e.workspaceId),
70
73
  createdAt: e.createdAt,
71
74
  updatedAt: e.updatedAt
72
75
  };
73
76
  }
74
- function k(e) {
77
+ function A(e) {
75
78
  return {
76
79
  id: e.id,
77
80
  name: e.name,
78
- description: S(e.description),
81
+ description: C(e.description),
79
82
  entityTypes: e.entityTypes,
80
83
  format: e.format,
81
- filters: T(e.entityFilters),
84
+ filters: E(e.entityFilters),
82
85
  isDefault: e.isDefault,
83
86
  createdBy: e.createdBy,
84
- workspaceId: S(e.workspaceId),
87
+ workspaceId: C(e.workspaceId),
85
88
  createdAt: e.createdAt,
86
89
  updatedAt: e.updatedAt
87
90
  };
88
91
  }
89
- function A(e) {
92
+ function j(e) {
90
93
  return {
91
94
  entityType: e.entityType,
92
95
  displayName: e.displayName,
93
- description: S(e.description),
94
- estimatedSize: S(e.estimatedSize),
96
+ description: C(e.description),
97
+ estimatedSize: C(e.estimatedSize),
95
98
  supportsDateRange: e.supportsDateRange,
96
99
  supportsMediaExport: e.supportsMediaExport,
97
100
  enabled: e.enabled
98
101
  };
99
102
  }
100
- function j(e) {
101
- if (e === "CSV") return p.Csv;
102
- if (e === "JSON") return p.Json;
103
+ function M(e) {
104
+ if (e === "CSV") return m.Csv;
105
+ if (e === "JSON") return m.Json;
103
106
  throw Error(`Unsupported export format: ${e}`);
104
107
  }
105
- function M(e) {
108
+ function N(e) {
106
109
  switch (e) {
107
- case "CANCELLED": return m.Cancelled;
108
- case "COMPLETED": return m.Completed;
109
- case "CREATED": return m.Created;
110
- case "DELETED": return m.Deleted;
111
- case "EXPIRED": return m.Expired;
112
- case "FAILED": return m.Failed;
113
- case "QUEUED": return m.Queued;
114
- 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;
115
118
  default: throw Error(`Unsupported export status: ${e}`);
116
119
  }
117
120
  }
118
- function N(e) {
121
+ function P(e) {
119
122
  switch (e) {
120
- case "INDIVIDUAL": return h.Individual;
121
- case "WORKSPACE_ADMIN": return h.WorkspaceAdmin;
122
- 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;
123
126
  default: throw Error(`Unsupported export scope: ${e}`);
124
127
  }
125
128
  }
126
- function P(t, n) {
127
- let { workspaceId: r } = e(), { data: i, loading: a, error: o, refetch: s } = b(u, {
129
+ function F(t, n) {
130
+ let { workspaceId: r } = e(), { data: i, loading: a, error: o, refetch: s } = x(d, {
128
131
  variables: {
129
132
  filter: t && r ? {
130
- status: t.status && t.status !== "all" ? [M(t.status)] : void 0,
131
- format: t.format && t.format !== "all" ? j(t.format) : void 0,
133
+ status: t.status && t.status !== "all" ? [N(t.status)] : void 0,
134
+ format: t.format && t.format !== "all" ? M(t.format) : void 0,
132
135
  search: t.search ?? void 0
133
136
  } : void 0,
134
137
  pagination: n,
@@ -137,16 +140,16 @@ function P(t, n) {
137
140
  skip: !r
138
141
  });
139
142
  return {
140
- data: i?.listExportJobs.edges.map((e) => O(e.node)) ?? [],
143
+ data: i?.listExportJobs.edges.map((e) => k(e.node)) ?? [],
141
144
  totalCount: i?.listExportJobs.totalCount ?? 0,
142
- pageInfo: i?.listExportJobs.pageInfo ? E(i.listExportJobs.pageInfo) : null,
145
+ pageInfo: i?.listExportJobs.pageInfo ? D(i.listExportJobs.pageInfo) : null,
143
146
  isLoading: a,
144
147
  error: o ?? null,
145
148
  refetch: s
146
149
  };
147
150
  }
148
- function F(t) {
149
- let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = b(c, {
151
+ function I(t) {
152
+ let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = x(l, {
150
153
  variables: {
151
154
  id: t ?? "",
152
155
  context: { workspaceId: n }
@@ -154,37 +157,37 @@ function F(t) {
154
157
  skip: !t || !n
155
158
  });
156
159
  return {
157
- data: r?.getExportJob ? O(r.getExportJob) : null,
160
+ data: r?.getExportJob ? k(r.getExportJob) : null,
158
161
  isLoading: i,
159
162
  error: a ?? null,
160
163
  refetch: o
161
164
  };
162
165
  }
163
- function I(e) {
164
- let { data: t, loading: n, error: r } = x(o, {
166
+ function L(e) {
167
+ let { data: t, loading: n, error: r } = S(o, {
165
168
  variables: { jobId: e ?? "" },
166
169
  skip: !e
167
170
  });
168
171
  return {
169
- data: t?.exportJobProgress ? O(t.exportJobProgress) : null,
172
+ data: t?.exportJobProgress ? k(t.exportJobProgress) : null,
170
173
  isLoading: n,
171
174
  error: r ?? null
172
175
  };
173
176
  }
174
- function L(e, { fetchMoreResult: t }) {
177
+ function R(e, { fetchMoreResult: t }) {
175
178
  return t ? { getAvailableExportEntities: {
176
179
  ...t.getAvailableExportEntities,
177
180
  edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
178
181
  } } : e;
179
182
  }
180
- function R(t) {
181
- let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = b(s, {
183
+ function z(t) {
184
+ let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: l } = x(c, {
182
185
  variables: {
183
186
  context: { workspaceId: r },
184
187
  pagination: { first: 100 }
185
188
  },
186
189
  skip: !r
187
- }), u = i?.getAvailableExportEntities, d = u?.edges.map((e) => A(e.node)) ?? [], f = async () => {
190
+ }), u = i?.getAvailableExportEntities, d = u?.edges.map((e) => j(e.node)) ?? [], f = async () => {
188
191
  !r || !u?.pageInfo.hasNextPage || await l({
189
192
  variables: {
190
193
  context: { workspaceId: r },
@@ -193,10 +196,10 @@ function R(t) {
193
196
  after: u.pageInfo.endCursor
194
197
  }
195
198
  },
196
- updateQuery: L
199
+ updateQuery: R
197
200
  });
198
- }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = v(null);
199
- return _(() => {
201
+ }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = y(null);
202
+ return v(() => {
200
203
  a || !r || !p || !m || h.current !== m && (h.current = m, l({
201
204
  variables: {
202
205
  context: { workspaceId: r },
@@ -205,7 +208,7 @@ function R(t) {
205
208
  after: m
206
209
  }
207
210
  },
208
- updateQuery: L
211
+ updateQuery: R
209
212
  }));
210
213
  }, [
211
214
  a,
@@ -216,15 +219,15 @@ function R(t) {
216
219
  ]), {
217
220
  data: d,
218
221
  totalCount: u?.totalCount ?? 0,
219
- pageInfo: u?.pageInfo ? E(u.pageInfo) : null,
222
+ pageInfo: u?.pageInfo ? D(u.pageInfo) : null,
220
223
  loadMore: f,
221
224
  error: o ?? null,
222
225
  isLoading: a,
223
- refetch: c
226
+ refetch: s
224
227
  };
225
228
  }
226
- function z(t) {
227
- let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: c } = b(d, {
229
+ function B(t) {
230
+ let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: c } = x(f, {
228
231
  variables: {
229
232
  context: { workspaceId: r },
230
233
  pagination: { first: 50 }
@@ -232,9 +235,9 @@ function z(t) {
232
235
  skip: !r
233
236
  }), l = i?.listExportTemplates;
234
237
  return {
235
- data: l?.edges.map((e) => k(e.node)) ?? [],
238
+ data: l?.edges.map((e) => A(e.node)) ?? [],
236
239
  totalCount: l?.totalCount ?? 0,
237
- pageInfo: l?.pageInfo ? E(l.pageInfo) : null,
240
+ pageInfo: l?.pageInfo ? D(l.pageInfo) : null,
238
241
  loadMore: async () => {
239
242
  !r || !l?.pageInfo.hasNextPage || await c({
240
243
  variables: {
@@ -255,8 +258,8 @@ function z(t) {
255
258
  refetch: s
256
259
  };
257
260
  }
258
- function B(t) {
259
- let { workspaceId: n } = e(), { data: r, loading: i, error: a } = b(l, {
261
+ function V(t) {
262
+ let { workspaceId: n } = e(), { data: r, loading: i, error: a } = x(u, {
260
263
  variables: {
261
264
  id: t ?? "",
262
265
  context: { workspaceId: n }
@@ -264,17 +267,17 @@ function B(t) {
264
267
  skip: !t || !n
265
268
  });
266
269
  return {
267
- data: r?.getExportTemplate ? k(r.getExportTemplate) : null,
270
+ data: r?.getExportTemplate ? A(r.getExportTemplate) : null,
268
271
  isLoading: i,
269
272
  error: a ?? null
270
273
  };
271
274
  }
272
- function V() {
273
- let t = e(), { workspaceId: r } = t, [i, { loading: a, error: o }] = y(n), s = async (e) => {
275
+ function H() {
276
+ let t = e(), { workspaceId: r } = t, [i, { loading: a, error: o }] = b(n), s = async (e) => {
274
277
  let { filters: n, ...a } = e, o = {
275
278
  ...a,
276
- exportScope: a.exportScope ? N(a.exportScope) : void 0,
277
- format: j(a.format),
279
+ exportScope: a.exportScope ? P(a.exportScope) : void 0,
280
+ format: M(a.format),
278
281
  entityFilters: n
279
282
  }, s = await i({
280
283
  variables: {
@@ -282,12 +285,12 @@ function V() {
282
285
  input: o
283
286
  },
284
287
  refetchQueries: [{
285
- query: u,
288
+ query: d,
286
289
  variables: { context: { workspaceId: r } }
287
290
  }]
288
291
  });
289
- if (!s.data) throw g(t, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
290
- return g(t, "export.job.created", { jobId: s.data.createExportJob.id }), O(s.data.createExportJob);
292
+ if (!s.data) throw _(t, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
293
+ return _(t, "export.job.created", { jobId: s.data.createExportJob.id }), k(s.data.createExportJob);
291
294
  };
292
295
  return {
293
296
  createJob: s,
@@ -298,23 +301,23 @@ function V() {
298
301
  error: o ?? null
299
302
  };
300
303
  }
301
- function H() {
302
- let n = e(), { workspaceId: r } = n, [i, { loading: a, error: o }] = y(t), s = async (e) => {
304
+ function U() {
305
+ let n = e(), { workspaceId: r } = n, [i, { loading: a, error: o }] = b(t), s = async (e) => {
303
306
  let t = await i({
304
307
  variables: {
305
308
  id: e,
306
309
  context: { workspaceId: r }
307
310
  },
308
311
  refetchQueries: [{
309
- query: u,
312
+ query: d,
310
313
  variables: { context: { workspaceId: r } }
311
314
  }]
312
315
  });
313
- if (!t.data) throw g(n, "export.api.failed", {
316
+ if (!t.data) throw _(n, "export.api.failed", {
314
317
  operation: "cancelExportJob",
315
318
  jobId: e
316
319
  }), Error("Failed to cancel export job");
317
- return g(n, "export.job.cancelled", { jobId: e }), t.data.cancelExportJob;
320
+ return _(n, "export.job.cancelled", { jobId: e }), t.data.cancelExportJob;
318
321
  };
319
322
  return {
320
323
  cancelJob: s,
@@ -325,17 +328,17 @@ function H() {
325
328
  error: o ?? null
326
329
  };
327
330
  }
328
- function U() {
329
- let t = e(), { workspaceId: n } = t, [r, { loading: a, error: o }] = y(i), s = async (e) => (await r({
331
+ function W() {
332
+ let t = e(), { workspaceId: n } = t, [r, { loading: a, error: o }] = b(i), s = async (e) => (await r({
330
333
  variables: {
331
334
  id: e,
332
335
  context: { workspaceId: n }
333
336
  },
334
337
  refetchQueries: [{
335
- query: u,
338
+ query: d,
336
339
  variables: { context: { workspaceId: n } }
337
340
  }]
338
- }), g(t, "export.job.deleted", { jobId: e }), !0);
341
+ }), _(t, "export.job.deleted", { jobId: e }), !0);
339
342
  return {
340
343
  deleteJob: s,
341
344
  mutate: s,
@@ -345,8 +348,8 @@ function U() {
345
348
  error: o ?? null
346
349
  };
347
350
  }
348
- function W() {
349
- let t = e(), { workspaceId: n } = t, [r, { loading: i, error: a }] = y(f);
351
+ function G() {
352
+ let t = e(), { workspaceId: n } = t, [r, { loading: i, error: a }] = b(p);
350
353
  return {
351
354
  retryJob: async (e) => {
352
355
  let i = await r({
@@ -355,51 +358,51 @@ function W() {
355
358
  context: { workspaceId: n }
356
359
  },
357
360
  refetchQueries: [{
358
- query: u,
361
+ query: d,
359
362
  variables: { context: { workspaceId: n } }
360
363
  }]
361
364
  });
362
- if (!i.data) throw g(t, "export.api.failed", {
365
+ if (!i.data) throw _(t, "export.api.failed", {
363
366
  operation: "retryExportJob",
364
367
  jobId: e
365
368
  }), Error("Failed to retry export job");
366
- return g(t, "export.job.retried", {
369
+ return _(t, "export.job.retried", {
367
370
  originalJobId: e,
368
371
  jobId: i.data.retryExportJob.id
369
- }), O(i.data.retryExportJob);
372
+ }), k(i.data.retryExportJob);
370
373
  },
371
374
  loading: i,
372
375
  isPending: i,
373
376
  error: a ?? null
374
377
  };
375
378
  }
376
- function G() {
377
- let t = e(), { workspaceId: n } = t, [i, { loading: a, error: o }] = y(r);
379
+ function K() {
380
+ let t = e(), { workspaceId: n } = t, [i, { loading: a, error: o }] = b(r);
378
381
  return {
379
382
  createTemplate: async (e) => {
380
383
  let r = {
381
384
  ...e,
382
- format: j(e.format)
385
+ format: M(e.format)
383
386
  }, a = await i({
384
387
  variables: {
385
388
  context: { workspaceId: n },
386
389
  input: r
387
390
  },
388
391
  refetchQueries: [{
389
- query: d,
392
+ query: f,
390
393
  variables: { context: { workspaceId: n } }
391
394
  }]
392
395
  });
393
- if (!a.data) throw g(t, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
394
- return g(t, "export.template.created", { templateId: a.data.createExportTemplate.id }), k(a.data.createExportTemplate);
396
+ if (!a.data) throw _(t, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
397
+ return _(t, "export.template.created", { templateId: a.data.createExportTemplate.id }), A(a.data.createExportTemplate);
395
398
  },
396
399
  loading: a,
397
400
  isPending: a,
398
401
  error: o ?? null
399
402
  };
400
403
  }
401
- function K() {
402
- let t = e(), { workspaceId: n } = t, [r, { loading: i, error: o }] = y(a);
404
+ function q() {
405
+ let t = e(), { workspaceId: n } = t, [r, { loading: i, error: o }] = b(a);
403
406
  return {
404
407
  deleteTemplate: async (e) => (await r({
405
408
  variables: {
@@ -407,16 +410,24 @@ function K() {
407
410
  context: { workspaceId: n }
408
411
  },
409
412
  refetchQueries: [{
410
- query: d,
413
+ query: f,
411
414
  variables: { context: { workspaceId: n } }
412
415
  }]
413
- }), g(t, "export.template.deleted", { templateId: e }), !0),
416
+ }), _(t, "export.template.deleted", { templateId: e }), !0),
414
417
  loading: i,
415
418
  isPending: i,
416
419
  error: o ?? null
417
420
  };
418
421
  }
422
+ function J(e) {
423
+ let { data: t, loading: n, error: r } = x(s, {
424
+ variables: { scopeId: e ?? "" },
425
+ skip: !e,
426
+ fetchPolicy: "network-only"
427
+ });
428
+ return !!e && !!t && !n && !r && t?.myPermissions.scopeId === e && t.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
429
+ }
419
430
  //#endregion
420
- export { R as useAvailableEntities, H as useCancelExportJob, V as useCreateExportJob, G as useCreateExportTemplate, U as useDeleteExportJob, K as useDeleteExportTemplate, F as useExportJob, I as useExportJobProgress, P as useExportJobs, B as useExportTemplate, z as useExportTemplates, W as useRetryExportJob };
431
+ export { z as useAvailableEntities, U as useCancelExportJob, H as useCreateExportJob, K as useCreateExportTemplate, W as useDeleteExportJob, q as useDeleteExportTemplate, I as useExportJob, L as useExportJobProgress, F as useExportJobs, V as useExportTemplate, B as useExportTemplates, J as useOrganizationExportPermission, G as useRetryExportJob };
421
432
 
422
433
  //# sourceMappingURL=useExportQueries.js.map