@burdenoff/microfe-export 2026.1107.1 → 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.
@@ -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(scope?: ExportScope): {
137
+ export declare function useCreateExportJob(): {
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(scope?: ExportScope): {
185
+ export declare function useRetryExportJob(): {
186
186
  retryJob: (id: string) => Promise<ExportJob>;
187
187
  loading: boolean;
188
188
  isPending: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useExportQueries.d.ts","sourceRoot":"","sources":["../../../src/export/hooks/useExportQueries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EA4BL,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;AA8OlB;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CA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AkB;oBAQH,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;iBAAzB,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;sBAAzB,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;;;;EAyBvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB;mBAQH,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,139 +1,138 @@
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";
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, 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";
8
7
  //#region src/export/hooks/useExportQueries.ts
9
- function w(e) {
8
+ function C(e) {
10
9
  return e ?? void 0;
11
10
  }
12
- function T(e) {
11
+ function w(e) {
13
12
  if (e == null) return;
14
13
  let t = typeof e == "number" ? e : Number(e);
15
14
  return Number.isFinite(t) ? t : void 0;
16
15
  }
17
- function E(e) {
18
- return T(e) ?? 0;
16
+ function T(e) {
17
+ return w(e) ?? 0;
19
18
  }
20
- function D(e) {
19
+ function E(e) {
21
20
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
22
21
  }
23
- function O(e) {
22
+ function D(e) {
24
23
  return {
25
24
  hasNextPage: e.hasNextPage,
26
25
  hasPreviousPage: e.hasPreviousPage,
27
- startCursor: w(e.startCursor),
28
- endCursor: w(e.endCursor)
26
+ startCursor: C(e.startCursor),
27
+ endCursor: C(e.endCursor)
29
28
  };
30
29
  }
31
- function k(e) {
30
+ function O(e) {
32
31
  return {
33
32
  id: e.id,
34
- jobId: w(e.jobId),
33
+ jobId: C(e.jobId),
35
34
  partNumber: e.partNumber,
36
35
  fileName: e.fileName,
37
- sizeBytes: E(e.sizeBytes),
36
+ sizeBytes: T(e.sizeBytes),
38
37
  entityTypes: e.entityTypes,
39
- downloadUrl: w(e.downloadUrl),
40
- downloadExpiresAt: w(e.downloadExpiresAt),
41
- checksum: w(e.checksum),
42
- createdAt: w(e.createdAt)
38
+ downloadUrl: C(e.downloadUrl),
39
+ downloadExpiresAt: C(e.downloadExpiresAt),
40
+ checksum: C(e.checksum),
41
+ createdAt: C(e.createdAt)
43
42
  };
44
43
  }
45
- function A(e) {
44
+ function k(e) {
46
45
  return {
47
46
  id: e.id,
48
47
  name: e.name,
49
- description: w(e.description),
48
+ description: C(e.description),
50
49
  status: e.status,
51
50
  progress: e.progress,
52
51
  exportScope: e.exportScope ? e.exportScope : void 0,
53
- organizationId: w(e.organizationId),
52
+ organizationId: C(e.organizationId),
54
53
  targetWorkspaceIds: e.targetWorkspaceIds ?? void 0,
55
54
  entityTypes: e.entityTypes,
56
55
  format: e.format,
57
56
  archiveFormat: e.archiveFormat ?? "ZIP",
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),
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),
71
70
  createdBy: e.createdBy,
72
- temporalWorkflowId: w(e.temporalWorkflowId),
73
- workspaceId: w(e.workspaceId),
71
+ temporalWorkflowId: C(e.temporalWorkflowId),
72
+ workspaceId: C(e.workspaceId),
74
73
  createdAt: e.createdAt,
75
74
  updatedAt: e.updatedAt
76
75
  };
77
76
  }
78
- function j(e) {
77
+ function A(e) {
79
78
  return {
80
79
  id: e.id,
81
80
  name: e.name,
82
- description: w(e.description),
81
+ description: C(e.description),
83
82
  entityTypes: e.entityTypes,
84
83
  format: e.format,
85
- filters: D(e.entityFilters),
84
+ filters: E(e.entityFilters),
86
85
  isDefault: e.isDefault,
87
86
  createdBy: e.createdBy,
88
- workspaceId: w(e.workspaceId),
87
+ workspaceId: C(e.workspaceId),
89
88
  createdAt: e.createdAt,
90
89
  updatedAt: e.updatedAt
91
90
  };
92
91
  }
93
- function M(e) {
92
+ function j(e) {
94
93
  return {
95
94
  entityType: e.entityType,
96
95
  displayName: e.displayName,
97
- description: w(e.description),
98
- estimatedSize: w(e.estimatedSize),
96
+ description: C(e.description),
97
+ estimatedSize: C(e.estimatedSize),
99
98
  supportsDateRange: e.supportsDateRange,
100
99
  supportsMediaExport: e.supportsMediaExport,
101
100
  enabled: e.enabled
102
101
  };
103
102
  }
104
- function N(e) {
105
- if (e === "CSV") return h.Csv;
106
- if (e === "JSON") return h.Json;
103
+ function M(e) {
104
+ if (e === "CSV") return m.Csv;
105
+ if (e === "JSON") return m.Json;
107
106
  throw Error(`Unsupported export format: ${e}`);
108
107
  }
109
- function P(e) {
108
+ function N(e) {
110
109
  switch (e) {
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;
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;
119
118
  default: throw Error(`Unsupported export status: ${e}`);
120
119
  }
121
120
  }
122
- function F(e) {
121
+ function P(e) {
123
122
  switch (e) {
124
- case "INDIVIDUAL": return _.Individual;
125
- case "WORKSPACE_ADMIN": return _.WorkspaceAdmin;
126
- case "ORG_ADMIN": return _.OrgAdmin;
123
+ case "INDIVIDUAL": return g.Individual;
124
+ case "WORKSPACE_ADMIN": return g.WorkspaceAdmin;
125
+ case "ORG_ADMIN": return g.OrgAdmin;
127
126
  default: throw Error(`Unsupported export scope: ${e}`);
128
127
  }
129
128
  }
130
- function I(e, n) {
131
- let { workspaceId: r } = t(), { data: i, loading: a, error: o, refetch: s } = S(f, {
129
+ function F(t, n) {
130
+ let { workspaceId: r } = e(), { data: i, loading: a, error: o, refetch: s } = x(d, {
132
131
  variables: {
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
132
+ filter: t && r ? {
133
+ status: t.status && t.status !== "all" ? [N(t.status)] : void 0,
134
+ format: t.format && t.format !== "all" ? M(t.format) : void 0,
135
+ search: t.search ?? void 0
137
136
  } : void 0,
138
137
  pagination: n,
139
138
  context: { workspaceId: r }
@@ -141,55 +140,55 @@ function I(e, n) {
141
140
  skip: !r
142
141
  });
143
142
  return {
144
- data: i?.listExportJobs.edges.map((e) => A(e.node)) ?? [],
143
+ data: i?.listExportJobs.edges.map((e) => k(e.node)) ?? [],
145
144
  totalCount: i?.listExportJobs.totalCount ?? 0,
146
- pageInfo: i?.listExportJobs.pageInfo ? O(i.listExportJobs.pageInfo) : null,
145
+ pageInfo: i?.listExportJobs.pageInfo ? D(i.listExportJobs.pageInfo) : null,
147
146
  isLoading: a,
148
147
  error: o ?? null,
149
148
  refetch: s
150
149
  };
151
150
  }
152
- function L(e) {
153
- let { workspaceId: n } = t(), { data: r, loading: i, error: a, refetch: o } = S(u, {
151
+ function I(t) {
152
+ let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = x(l, {
154
153
  variables: {
155
- id: e ?? "",
154
+ id: t ?? "",
156
155
  context: { workspaceId: n }
157
156
  },
158
- skip: !e || !n
157
+ skip: !t || !n
159
158
  });
160
159
  return {
161
- data: r?.getExportJob ? A(r.getExportJob) : null,
160
+ data: r?.getExportJob ? k(r.getExportJob) : null,
162
161
  isLoading: i,
163
162
  error: a ?? null,
164
163
  refetch: o
165
164
  };
166
165
  }
167
- function R(e) {
168
- let { data: t, loading: n, error: r } = C(s, {
166
+ function L(e) {
167
+ let { data: t, loading: n, error: r } = S(o, {
169
168
  variables: { jobId: e ?? "" },
170
169
  skip: !e
171
170
  });
172
171
  return {
173
- data: t?.exportJobProgress ? A(t.exportJobProgress) : null,
172
+ data: t?.exportJobProgress ? k(t.exportJobProgress) : null,
174
173
  isLoading: n,
175
174
  error: r ?? null
176
175
  };
177
176
  }
178
- function z(e, { fetchMoreResult: t }) {
177
+ function R(e, { fetchMoreResult: t }) {
179
178
  return t ? { getAvailableExportEntities: {
180
179
  ...t.getAvailableExportEntities,
181
180
  edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
182
181
  } } : e;
183
182
  }
184
- function B(e) {
185
- let { workspaceId: n } = t(), r = e ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: c } = S(l, {
183
+ function z(t) {
184
+ let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: l } = x(c, {
186
185
  variables: {
187
186
  context: { workspaceId: r },
188
187
  pagination: { first: 100 }
189
188
  },
190
189
  skip: !r
191
- }), u = i?.getAvailableExportEntities, d = u?.edges.map((e) => M(e.node)) ?? [], f = async () => {
192
- !r || !u?.pageInfo.hasNextPage || await c({
190
+ }), u = i?.getAvailableExportEntities, d = u?.edges.map((e) => j(e.node)) ?? [], f = async () => {
191
+ !r || !u?.pageInfo.hasNextPage || await l({
193
192
  variables: {
194
193
  context: { workspaceId: r },
195
194
  pagination: {
@@ -197,11 +196,11 @@ function B(e) {
197
196
  after: u.pageInfo.endCursor
198
197
  }
199
198
  },
200
- updateQuery: z
199
+ updateQuery: R
201
200
  });
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
+ }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = y(null);
202
+ return v(() => {
203
+ a || !r || !p || !m || h.current !== m && (h.current = m, l({
205
204
  variables: {
206
205
  context: { workspaceId: r },
207
206
  pagination: {
@@ -209,26 +208,26 @@ function B(e) {
209
208
  after: m
210
209
  }
211
210
  },
212
- updateQuery: z
211
+ updateQuery: R
213
212
  }));
214
213
  }, [
215
214
  a,
216
215
  r,
217
216
  p,
218
217
  m,
219
- c
218
+ l
220
219
  ]), {
221
220
  data: d,
222
221
  totalCount: u?.totalCount ?? 0,
223
- pageInfo: u?.pageInfo ? O(u.pageInfo) : null,
222
+ pageInfo: u?.pageInfo ? D(u.pageInfo) : null,
224
223
  loadMore: f,
225
224
  error: o ?? null,
226
225
  isLoading: a,
227
226
  refetch: s
228
227
  };
229
228
  }
230
- function V(e) {
231
- let { workspaceId: n } = t(), r = e ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: c } = S(p, {
229
+ function B(t) {
230
+ let { workspaceId: n } = e(), r = t ?? n, { data: i, loading: a, error: o, refetch: s, fetchMore: c } = x(f, {
232
231
  variables: {
233
232
  context: { workspaceId: r },
234
233
  pagination: { first: 50 }
@@ -236,9 +235,9 @@ function V(e) {
236
235
  skip: !r
237
236
  }), l = i?.listExportTemplates;
238
237
  return {
239
- data: l?.edges.map((e) => j(e.node)) ?? [],
238
+ data: l?.edges.map((e) => A(e.node)) ?? [],
240
239
  totalCount: l?.totalCount ?? 0,
241
- pageInfo: l?.pageInfo ? O(l.pageInfo) : null,
240
+ pageInfo: l?.pageInfo ? D(l.pageInfo) : null,
242
241
  loadMore: async () => {
243
242
  !r || !l?.pageInfo.hasNextPage || await c({
244
243
  variables: {
@@ -259,66 +258,66 @@ function V(e) {
259
258
  refetch: s
260
259
  };
261
260
  }
262
- function H(e) {
263
- let { workspaceId: n } = t(), { data: r, loading: i, error: a } = S(d, {
261
+ function V(t) {
262
+ let { workspaceId: n } = e(), { data: r, loading: i, error: a } = x(u, {
264
263
  variables: {
265
- id: e ?? "",
264
+ id: t ?? "",
266
265
  context: { workspaceId: n }
267
266
  },
268
- skip: !e || !n
267
+ skip: !t || !n
269
268
  });
270
269
  return {
271
- data: r?.getExportTemplate ? j(r.getExportTemplate) : null,
270
+ data: r?.getExportTemplate ? A(r.getExportTemplate) : null,
272
271
  isLoading: i,
273
272
  error: a ?? null
274
273
  };
275
274
  }
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({
275
+ function H() {
276
+ let t = e(), { workspaceId: r } = t, [i, { loading: a, error: o }] = b(n), s = async (e) => {
277
+ let { filters: n, ...a } = e, o = {
278
+ ...a,
279
+ exportScope: a.exportScope ? P(a.exportScope) : void 0,
280
+ format: M(a.format),
281
+ entityFilters: n
282
+ }, s = await i({
284
283
  variables: {
285
- context: { workspaceId: a },
286
- input: r
284
+ context: { workspaceId: r },
285
+ input: o
287
286
  },
288
287
  refetchQueries: [{
289
- query: f,
290
- variables: { context: { workspaceId: a } }
288
+ query: d,
289
+ variables: { context: { workspaceId: r } }
291
290
  }]
292
291
  });
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);
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);
295
294
  };
296
295
  return {
297
- createJob: l,
298
- mutate: l,
299
- mutateAsync: l,
300
- loading: s,
301
- isPending: s,
302
- error: c ?? null
296
+ createJob: s,
297
+ mutate: s,
298
+ mutateAsync: s,
299
+ loading: a,
300
+ isPending: a,
301
+ error: o ?? null
303
302
  };
304
303
  }
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
+ function U() {
305
+ let n = e(), { workspaceId: r } = n, [i, { loading: a, error: o }] = b(t), s = async (e) => {
306
+ let t = await i({
308
307
  variables: {
309
- id: t,
308
+ id: e,
310
309
  context: { workspaceId: r }
311
310
  },
312
311
  refetchQueries: [{
313
- query: f,
312
+ query: d,
314
313
  variables: { context: { workspaceId: r } }
315
314
  }]
316
315
  });
317
- if (!n.data) throw v(e, "export.api.failed", {
316
+ if (!t.data) throw _(n, "export.api.failed", {
318
317
  operation: "cancelExportJob",
319
- jobId: t
318
+ jobId: e
320
319
  }), Error("Failed to cancel export job");
321
- return v(e, "export.job.cancelled", { jobId: t }), n.data.cancelExportJob;
320
+ return _(n, "export.job.cancelled", { jobId: e }), t.data.cancelExportJob;
322
321
  };
323
322
  return {
324
323
  cancelJob: s,
@@ -329,99 +328,99 @@ function W() {
329
328
  error: o ?? null
330
329
  };
331
330
  }
332
- function G() {
333
- let e = t(), { workspaceId: n } = e, [r, { loading: i, error: o }] = x(a), s = async (t) => (await r({
331
+ function W() {
332
+ let t = e(), { workspaceId: n } = t, [r, { loading: a, error: o }] = b(i), s = async (e) => (await r({
334
333
  variables: {
335
- id: t,
334
+ id: e,
336
335
  context: { workspaceId: n }
337
336
  },
338
337
  refetchQueries: [{
339
- query: f,
338
+ query: d,
340
339
  variables: { context: { workspaceId: n } }
341
340
  }]
342
- }), v(e, "export.job.deleted", { jobId: t }), !0);
341
+ }), _(t, "export.job.deleted", { jobId: e }), !0);
343
342
  return {
344
343
  deleteJob: s,
345
344
  mutate: s,
346
345
  mutateAsync: s,
347
- loading: i,
348
- isPending: i,
346
+ loading: a,
347
+ isPending: a,
349
348
  error: o ?? null
350
349
  };
351
350
  }
352
- function K(n = "INDIVIDUAL") {
353
- let r = t(), { workspaceId: i } = r, [a, { loading: o, error: s }] = x(e(m, n, "retry"));
351
+ function G() {
352
+ let t = e(), { workspaceId: n } = t, [r, { loading: i, error: a }] = b(p);
354
353
  return {
355
354
  retryJob: async (e) => {
356
- let t = await a({
355
+ let i = await r({
357
356
  variables: {
358
357
  id: e,
359
- context: { workspaceId: i }
358
+ context: { workspaceId: n }
360
359
  },
361
360
  refetchQueries: [{
362
- query: f,
363
- variables: { context: { workspaceId: i } }
361
+ query: d,
362
+ variables: { context: { workspaceId: n } }
364
363
  }]
365
364
  });
366
- if (!t.data) throw v(r, "export.api.failed", {
365
+ if (!i.data) throw _(t, "export.api.failed", {
367
366
  operation: "retryExportJob",
368
367
  jobId: e
369
368
  }), Error("Failed to retry export job");
370
- return v(r, "export.job.retried", {
369
+ return _(t, "export.job.retried", {
371
370
  originalJobId: e,
372
- jobId: t.data.retryExportJob.id
373
- }), A(t.data.retryExportJob);
371
+ jobId: i.data.retryExportJob.id
372
+ }), k(i.data.retryExportJob);
374
373
  },
375
- loading: o,
376
- isPending: o,
377
- error: s ?? null
374
+ loading: i,
375
+ isPending: i,
376
+ error: a ?? null
378
377
  };
379
378
  }
380
- function q() {
381
- let e = t(), { workspaceId: n } = e, [r, { loading: a, error: o }] = x(i);
379
+ function K() {
380
+ let t = e(), { workspaceId: n } = t, [i, { loading: a, error: o }] = b(r);
382
381
  return {
383
- createTemplate: async (t) => {
384
- let i = {
385
- ...t,
386
- format: N(t.format)
387
- }, a = await r({
382
+ createTemplate: async (e) => {
383
+ let r = {
384
+ ...e,
385
+ format: M(e.format)
386
+ }, a = await i({
388
387
  variables: {
389
388
  context: { workspaceId: n },
390
- input: i
389
+ input: r
391
390
  },
392
391
  refetchQueries: [{
393
- query: p,
392
+ query: f,
394
393
  variables: { context: { workspaceId: n } }
395
394
  }]
396
395
  });
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);
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);
399
398
  },
400
399
  loading: a,
401
400
  isPending: a,
402
401
  error: o ?? null
403
402
  };
404
403
  }
405
- function J() {
406
- let e = t(), { workspaceId: n } = e, [r, { loading: i, error: a }] = x(o);
404
+ function q() {
405
+ let t = e(), { workspaceId: n } = t, [r, { loading: i, error: o }] = b(a);
407
406
  return {
408
- deleteTemplate: async (t) => (await r({
407
+ deleteTemplate: async (e) => (await r({
409
408
  variables: {
410
- id: t,
409
+ id: e,
411
410
  context: { workspaceId: n }
412
411
  },
413
412
  refetchQueries: [{
414
- query: p,
413
+ query: f,
415
414
  variables: { context: { workspaceId: n } }
416
415
  }]
417
- }), v(e, "export.template.deleted", { templateId: t }), !0),
416
+ }), _(t, "export.template.deleted", { templateId: e }), !0),
418
417
  loading: i,
419
418
  isPending: i,
420
- error: a ?? null
419
+ error: o ?? null
421
420
  };
422
421
  }
423
- function Y(e) {
424
- let { data: t, loading: n, error: r } = S(c, {
422
+ function J(e) {
423
+ let { data: t, loading: n, error: r } = x(s, {
425
424
  variables: { scopeId: e ?? "" },
426
425
  skip: !e,
427
426
  fetchPolicy: "network-only"
@@ -429,6 +428,6 @@ function Y(e) {
429
428
  return !!e && !!t && !n && !r && t?.myPermissions.scopeId === e && t.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
430
429
  }
431
430
  //#endregion
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 };
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 };
433
432
 
434
433
  //# sourceMappingURL=useExportQueries.js.map