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