@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.
- package/dist/export/hooks/useExportQueries.d.ts +2 -2
- package/dist/export/hooks/useExportQueries.d.ts.map +1 -1
- package/dist/export/hooks/useExportQueries.js +168 -169
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/pages/CreateExportPage.d.ts.map +1 -1
- package/dist/export/pages/CreateExportPage.js +230 -230
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.d.ts.map +1 -1
- package/dist/export/pages/ExportDetailPage.js +35 -35
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/utils/exportAuthority.d.ts +1 -4
- package/dist/export/utils/exportAuthority.d.ts.map +1 -1
- package/dist/export/utils/exportAuthority.js +4 -28
- package/dist/export/utils/exportAuthority.js.map +1 -1
- 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(): {
|
|
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(): {
|
|
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;
|
|
1
|
+
{"version":3,"file":"useExportQueries.d.ts","sourceRoot":"","sources":["../../../src/export/hooks/useExportQueries.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,139 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
8
|
+
function C(e) {
|
|
10
9
|
return e ?? void 0;
|
|
11
10
|
}
|
|
12
|
-
function
|
|
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
|
|
18
|
-
return
|
|
16
|
+
function T(e) {
|
|
17
|
+
return w(e) ?? 0;
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function E(e) {
|
|
21
20
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function D(e) {
|
|
24
23
|
return {
|
|
25
24
|
hasNextPage: e.hasNextPage,
|
|
26
25
|
hasPreviousPage: e.hasPreviousPage,
|
|
27
|
-
startCursor:
|
|
28
|
-
endCursor:
|
|
26
|
+
startCursor: C(e.startCursor),
|
|
27
|
+
endCursor: C(e.endCursor)
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
function
|
|
30
|
+
function O(e) {
|
|
32
31
|
return {
|
|
33
32
|
id: e.id,
|
|
34
|
-
jobId:
|
|
33
|
+
jobId: C(e.jobId),
|
|
35
34
|
partNumber: e.partNumber,
|
|
36
35
|
fileName: e.fileName,
|
|
37
|
-
sizeBytes:
|
|
36
|
+
sizeBytes: T(e.sizeBytes),
|
|
38
37
|
entityTypes: e.entityTypes,
|
|
39
|
-
downloadUrl:
|
|
40
|
-
downloadExpiresAt:
|
|
41
|
-
checksum:
|
|
42
|
-
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
|
|
44
|
+
function k(e) {
|
|
46
45
|
return {
|
|
47
46
|
id: e.id,
|
|
48
47
|
name: e.name,
|
|
49
|
-
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:
|
|
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:
|
|
59
|
-
processedEntities:
|
|
60
|
-
totalSizeBytes:
|
|
61
|
-
parts: e.parts?.map(
|
|
62
|
-
archiveFileId:
|
|
63
|
-
downloadUrl:
|
|
64
|
-
downloadExpiresAt:
|
|
65
|
-
templateId:
|
|
66
|
-
filters:
|
|
67
|
-
errorMessage:
|
|
68
|
-
startedAt:
|
|
69
|
-
completedAt:
|
|
70
|
-
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:
|
|
73
|
-
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
|
|
77
|
+
function A(e) {
|
|
79
78
|
return {
|
|
80
79
|
id: e.id,
|
|
81
80
|
name: e.name,
|
|
82
|
-
description:
|
|
81
|
+
description: C(e.description),
|
|
83
82
|
entityTypes: e.entityTypes,
|
|
84
83
|
format: e.format,
|
|
85
|
-
filters:
|
|
84
|
+
filters: E(e.entityFilters),
|
|
86
85
|
isDefault: e.isDefault,
|
|
87
86
|
createdBy: e.createdBy,
|
|
88
|
-
workspaceId:
|
|
87
|
+
workspaceId: C(e.workspaceId),
|
|
89
88
|
createdAt: e.createdAt,
|
|
90
89
|
updatedAt: e.updatedAt
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
|
-
function
|
|
92
|
+
function j(e) {
|
|
94
93
|
return {
|
|
95
94
|
entityType: e.entityType,
|
|
96
95
|
displayName: e.displayName,
|
|
97
|
-
description:
|
|
98
|
-
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
|
|
105
|
-
if (e === "CSV") return
|
|
106
|
-
if (e === "JSON") return
|
|
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
|
|
108
|
+
function N(e) {
|
|
110
109
|
switch (e) {
|
|
111
|
-
case "CANCELLED": return
|
|
112
|
-
case "COMPLETED": return
|
|
113
|
-
case "CREATED": return
|
|
114
|
-
case "DELETED": return
|
|
115
|
-
case "EXPIRED": return
|
|
116
|
-
case "FAILED": return
|
|
117
|
-
case "QUEUED": return
|
|
118
|
-
case "RUNNING": return
|
|
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
|
|
121
|
+
function P(e) {
|
|
123
122
|
switch (e) {
|
|
124
|
-
case "INDIVIDUAL": return
|
|
125
|
-
case "WORKSPACE_ADMIN": return
|
|
126
|
-
case "ORG_ADMIN": return
|
|
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
|
|
131
|
-
let { workspaceId: r } =
|
|
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:
|
|
134
|
-
status:
|
|
135
|
-
format:
|
|
136
|
-
search:
|
|
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) =>
|
|
143
|
+
data: i?.listExportJobs.edges.map((e) => k(e.node)) ?? [],
|
|
145
144
|
totalCount: i?.listExportJobs.totalCount ?? 0,
|
|
146
|
-
pageInfo: i?.listExportJobs.pageInfo ?
|
|
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
|
|
153
|
-
let { workspaceId: n } =
|
|
151
|
+
function I(t) {
|
|
152
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = x(l, {
|
|
154
153
|
variables: {
|
|
155
|
-
id:
|
|
154
|
+
id: t ?? "",
|
|
156
155
|
context: { workspaceId: n }
|
|
157
156
|
},
|
|
158
|
-
skip: !
|
|
157
|
+
skip: !t || !n
|
|
159
158
|
});
|
|
160
159
|
return {
|
|
161
|
-
data: r?.getExportJob ?
|
|
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
|
|
168
|
-
let { data: t, loading: n, error: r } =
|
|
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 ?
|
|
172
|
+
data: t?.exportJobProgress ? k(t.exportJobProgress) : null,
|
|
174
173
|
isLoading: n,
|
|
175
174
|
error: r ?? null
|
|
176
175
|
};
|
|
177
176
|
}
|
|
178
|
-
function
|
|
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
|
|
185
|
-
let { workspaceId: n } =
|
|
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) =>
|
|
192
|
-
!r || !u?.pageInfo.hasNextPage || await
|
|
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:
|
|
199
|
+
updateQuery: R
|
|
201
200
|
});
|
|
202
|
-
}, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h =
|
|
203
|
-
return
|
|
204
|
-
a || !r || !p || !m || h.current !== m && (h.current = m,
|
|
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:
|
|
211
|
+
updateQuery: R
|
|
213
212
|
}));
|
|
214
213
|
}, [
|
|
215
214
|
a,
|
|
216
215
|
r,
|
|
217
216
|
p,
|
|
218
217
|
m,
|
|
219
|
-
|
|
218
|
+
l
|
|
220
219
|
]), {
|
|
221
220
|
data: d,
|
|
222
221
|
totalCount: u?.totalCount ?? 0,
|
|
223
|
-
pageInfo: u?.pageInfo ?
|
|
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
|
|
231
|
-
let { workspaceId: n } =
|
|
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) =>
|
|
238
|
+
data: l?.edges.map((e) => A(e.node)) ?? [],
|
|
240
239
|
totalCount: l?.totalCount ?? 0,
|
|
241
|
-
pageInfo: l?.pageInfo ?
|
|
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
|
|
263
|
-
let { workspaceId: n } =
|
|
261
|
+
function V(t) {
|
|
262
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a } = x(u, {
|
|
264
263
|
variables: {
|
|
265
|
-
id:
|
|
264
|
+
id: t ?? "",
|
|
266
265
|
context: { workspaceId: n }
|
|
267
266
|
},
|
|
268
|
-
skip: !
|
|
267
|
+
skip: !t || !n
|
|
269
268
|
});
|
|
270
269
|
return {
|
|
271
|
-
data: r?.getExportTemplate ?
|
|
270
|
+
data: r?.getExportTemplate ? A(r.getExportTemplate) : null,
|
|
272
271
|
isLoading: i,
|
|
273
272
|
error: a ?? null
|
|
274
273
|
};
|
|
275
274
|
}
|
|
276
|
-
function
|
|
277
|
-
let
|
|
278
|
-
let { filters:
|
|
279
|
-
...
|
|
280
|
-
exportScope:
|
|
281
|
-
format:
|
|
282
|
-
entityFilters:
|
|
283
|
-
}, s = await
|
|
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:
|
|
286
|
-
input:
|
|
284
|
+
context: { workspaceId: r },
|
|
285
|
+
input: o
|
|
287
286
|
},
|
|
288
287
|
refetchQueries: [{
|
|
289
|
-
query:
|
|
290
|
-
variables: { context: { workspaceId:
|
|
288
|
+
query: d,
|
|
289
|
+
variables: { context: { workspaceId: r } }
|
|
291
290
|
}]
|
|
292
291
|
});
|
|
293
|
-
if (!s.data) throw
|
|
294
|
-
return
|
|
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:
|
|
298
|
-
mutate:
|
|
299
|
-
mutateAsync:
|
|
300
|
-
loading:
|
|
301
|
-
isPending:
|
|
302
|
-
error:
|
|
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
|
|
306
|
-
let
|
|
307
|
-
let
|
|
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:
|
|
308
|
+
id: e,
|
|
310
309
|
context: { workspaceId: r }
|
|
311
310
|
},
|
|
312
311
|
refetchQueries: [{
|
|
313
|
-
query:
|
|
312
|
+
query: d,
|
|
314
313
|
variables: { context: { workspaceId: r } }
|
|
315
314
|
}]
|
|
316
315
|
});
|
|
317
|
-
if (!
|
|
316
|
+
if (!t.data) throw _(n, "export.api.failed", {
|
|
318
317
|
operation: "cancelExportJob",
|
|
319
|
-
jobId:
|
|
318
|
+
jobId: e
|
|
320
319
|
}), Error("Failed to cancel export job");
|
|
321
|
-
return
|
|
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
|
|
333
|
-
let
|
|
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:
|
|
334
|
+
id: e,
|
|
336
335
|
context: { workspaceId: n }
|
|
337
336
|
},
|
|
338
337
|
refetchQueries: [{
|
|
339
|
-
query:
|
|
338
|
+
query: d,
|
|
340
339
|
variables: { context: { workspaceId: n } }
|
|
341
340
|
}]
|
|
342
|
-
}),
|
|
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:
|
|
348
|
-
isPending:
|
|
346
|
+
loading: a,
|
|
347
|
+
isPending: a,
|
|
349
348
|
error: o ?? null
|
|
350
349
|
};
|
|
351
350
|
}
|
|
352
|
-
function
|
|
353
|
-
let
|
|
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
|
|
355
|
+
let i = await r({
|
|
357
356
|
variables: {
|
|
358
357
|
id: e,
|
|
359
|
-
context: { workspaceId:
|
|
358
|
+
context: { workspaceId: n }
|
|
360
359
|
},
|
|
361
360
|
refetchQueries: [{
|
|
362
|
-
query:
|
|
363
|
-
variables: { context: { workspaceId:
|
|
361
|
+
query: d,
|
|
362
|
+
variables: { context: { workspaceId: n } }
|
|
364
363
|
}]
|
|
365
364
|
});
|
|
366
|
-
if (!
|
|
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
|
|
369
|
+
return _(t, "export.job.retried", {
|
|
371
370
|
originalJobId: e,
|
|
372
|
-
jobId:
|
|
373
|
-
}),
|
|
371
|
+
jobId: i.data.retryExportJob.id
|
|
372
|
+
}), k(i.data.retryExportJob);
|
|
374
373
|
},
|
|
375
|
-
loading:
|
|
376
|
-
isPending:
|
|
377
|
-
error:
|
|
374
|
+
loading: i,
|
|
375
|
+
isPending: i,
|
|
376
|
+
error: a ?? null
|
|
378
377
|
};
|
|
379
378
|
}
|
|
380
|
-
function
|
|
381
|
-
let
|
|
379
|
+
function K() {
|
|
380
|
+
let t = e(), { workspaceId: n } = t, [i, { loading: a, error: o }] = b(r);
|
|
382
381
|
return {
|
|
383
|
-
createTemplate: async (
|
|
384
|
-
let
|
|
385
|
-
...
|
|
386
|
-
format:
|
|
387
|
-
}, a = await
|
|
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:
|
|
389
|
+
input: r
|
|
391
390
|
},
|
|
392
391
|
refetchQueries: [{
|
|
393
|
-
query:
|
|
392
|
+
query: f,
|
|
394
393
|
variables: { context: { workspaceId: n } }
|
|
395
394
|
}]
|
|
396
395
|
});
|
|
397
|
-
if (!a.data) throw
|
|
398
|
-
return
|
|
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
|
|
406
|
-
let
|
|
404
|
+
function q() {
|
|
405
|
+
let t = e(), { workspaceId: n } = t, [r, { loading: i, error: o }] = b(a);
|
|
407
406
|
return {
|
|
408
|
-
deleteTemplate: async (
|
|
407
|
+
deleteTemplate: async (e) => (await r({
|
|
409
408
|
variables: {
|
|
410
|
-
id:
|
|
409
|
+
id: e,
|
|
411
410
|
context: { workspaceId: n }
|
|
412
411
|
},
|
|
413
412
|
refetchQueries: [{
|
|
414
|
-
query:
|
|
413
|
+
query: f,
|
|
415
414
|
variables: { context: { workspaceId: n } }
|
|
416
415
|
}]
|
|
417
|
-
}),
|
|
416
|
+
}), _(t, "export.template.deleted", { templateId: e }), !0),
|
|
418
417
|
loading: i,
|
|
419
418
|
isPending: i,
|
|
420
|
-
error:
|
|
419
|
+
error: o ?? null
|
|
421
420
|
};
|
|
422
421
|
}
|
|
423
|
-
function
|
|
424
|
-
let { data: t, loading: n, error: r } =
|
|
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 {
|
|
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
|