@burdenoff/microfe-export 2026.1023.2 → 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.
- package/dist/export/hooks/useExportQueries.d.ts +4 -2
- package/dist/export/hooks/useExportQueries.d.ts.map +1 -1
- package/dist/export/hooks/useExportQueries.js +176 -164
- 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 +190 -190
- 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 +174 -173
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/providers/ExportProvider.d.ts.map +1 -1
- package/dist/export/providers/ExportProvider.js +68 -63
- package/dist/export/providers/ExportProvider.js.map +1 -1
- package/dist/export/types/index.d.ts +3 -0
- package/dist/export/types/index.d.ts.map +1 -1
- package/dist/export/utils/exportAuthority.d.ts +18 -0
- package/dist/export/utils/exportAuthority.d.ts.map +1 -0
- package/dist/export/utils/exportAuthority.js +52 -0
- package/dist/export/utils/exportAuthority.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +70 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +41 -6
- package/dist/generated/wspace-operations.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(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;
|
|
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,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C,OAAO,CAqBT"}
|
|
@@ -1,135 +1,139 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
9
|
+
function w(e) {
|
|
9
10
|
return e ?? void 0;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
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
|
|
17
|
-
return
|
|
17
|
+
function E(e) {
|
|
18
|
+
return T(e) ?? 0;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function D(e) {
|
|
20
21
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function O(e) {
|
|
23
24
|
return {
|
|
24
25
|
hasNextPage: e.hasNextPage,
|
|
25
26
|
hasPreviousPage: e.hasPreviousPage,
|
|
26
|
-
startCursor:
|
|
27
|
-
endCursor:
|
|
27
|
+
startCursor: w(e.startCursor),
|
|
28
|
+
endCursor: w(e.endCursor)
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function k(e) {
|
|
31
32
|
return {
|
|
32
33
|
id: e.id,
|
|
33
|
-
jobId:
|
|
34
|
+
jobId: w(e.jobId),
|
|
34
35
|
partNumber: e.partNumber,
|
|
35
36
|
fileName: e.fileName,
|
|
36
|
-
sizeBytes:
|
|
37
|
+
sizeBytes: E(e.sizeBytes),
|
|
37
38
|
entityTypes: e.entityTypes,
|
|
38
|
-
downloadUrl:
|
|
39
|
-
downloadExpiresAt:
|
|
40
|
-
checksum:
|
|
41
|
-
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
|
|
45
|
+
function A(e) {
|
|
45
46
|
return {
|
|
46
47
|
id: e.id,
|
|
47
48
|
name: e.name,
|
|
48
|
-
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:
|
|
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:
|
|
58
|
-
processedEntities:
|
|
59
|
-
totalSizeBytes:
|
|
60
|
-
parts: e.parts?.map(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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:
|
|
69
|
-
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
|
|
78
|
+
function j(e) {
|
|
75
79
|
return {
|
|
76
80
|
id: e.id,
|
|
77
81
|
name: e.name,
|
|
78
|
-
description:
|
|
82
|
+
description: w(e.description),
|
|
79
83
|
entityTypes: e.entityTypes,
|
|
80
84
|
format: e.format,
|
|
81
|
-
filters:
|
|
85
|
+
filters: D(e.entityFilters),
|
|
82
86
|
isDefault: e.isDefault,
|
|
83
87
|
createdBy: e.createdBy,
|
|
84
|
-
workspaceId:
|
|
88
|
+
workspaceId: w(e.workspaceId),
|
|
85
89
|
createdAt: e.createdAt,
|
|
86
90
|
updatedAt: e.updatedAt
|
|
87
91
|
};
|
|
88
92
|
}
|
|
89
|
-
function
|
|
93
|
+
function M(e) {
|
|
90
94
|
return {
|
|
91
95
|
entityType: e.entityType,
|
|
92
96
|
displayName: e.displayName,
|
|
93
|
-
description:
|
|
94
|
-
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
|
|
101
|
-
if (e === "CSV") return
|
|
102
|
-
if (e === "JSON") return
|
|
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
|
|
109
|
+
function P(e) {
|
|
106
110
|
switch (e) {
|
|
107
|
-
case "CANCELLED": return
|
|
108
|
-
case "COMPLETED": return
|
|
109
|
-
case "CREATED": return
|
|
110
|
-
case "DELETED": return
|
|
111
|
-
case "EXPIRED": return
|
|
112
|
-
case "FAILED": return
|
|
113
|
-
case "QUEUED": return
|
|
114
|
-
case "RUNNING": return
|
|
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
|
|
122
|
+
function F(e) {
|
|
119
123
|
switch (e) {
|
|
120
|
-
case "INDIVIDUAL": return
|
|
121
|
-
case "WORKSPACE_ADMIN": return
|
|
122
|
-
case "ORG_ADMIN": return
|
|
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
|
|
127
|
-
let { workspaceId: r } =
|
|
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:
|
|
130
|
-
status:
|
|
131
|
-
format:
|
|
132
|
-
search:
|
|
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) =>
|
|
144
|
+
data: i?.listExportJobs.edges.map((e) => A(e.node)) ?? [],
|
|
141
145
|
totalCount: i?.listExportJobs.totalCount ?? 0,
|
|
142
|
-
pageInfo: i?.listExportJobs.pageInfo ?
|
|
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
|
|
149
|
-
let { workspaceId: n } =
|
|
152
|
+
function L(e) {
|
|
153
|
+
let { workspaceId: n } = t(), { data: r, loading: i, error: a, refetch: o } = S(u, {
|
|
150
154
|
variables: {
|
|
151
|
-
id:
|
|
155
|
+
id: e ?? "",
|
|
152
156
|
context: { workspaceId: n }
|
|
153
157
|
},
|
|
154
|
-
skip: !
|
|
158
|
+
skip: !e || !n
|
|
155
159
|
});
|
|
156
160
|
return {
|
|
157
|
-
data: r?.getExportJob ?
|
|
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
|
|
164
|
-
let { data: t, loading: n, error: r } =
|
|
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 ?
|
|
173
|
+
data: t?.exportJobProgress ? A(t.exportJobProgress) : null,
|
|
170
174
|
isLoading: n,
|
|
171
175
|
error: r ?? null
|
|
172
176
|
};
|
|
173
177
|
}
|
|
174
|
-
function
|
|
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
|
|
181
|
-
let { workspaceId: n } =
|
|
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) =>
|
|
188
|
-
!r || !u?.pageInfo.hasNextPage || await
|
|
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:
|
|
200
|
+
updateQuery: z
|
|
197
201
|
});
|
|
198
|
-
}, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h =
|
|
199
|
-
return
|
|
200
|
-
a || !r || !p || !m || h.current !== m && (h.current = m,
|
|
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:
|
|
212
|
+
updateQuery: z
|
|
209
213
|
}));
|
|
210
214
|
}, [
|
|
211
215
|
a,
|
|
212
216
|
r,
|
|
213
217
|
p,
|
|
214
218
|
m,
|
|
215
|
-
|
|
219
|
+
c
|
|
216
220
|
]), {
|
|
217
221
|
data: d,
|
|
218
222
|
totalCount: u?.totalCount ?? 0,
|
|
219
|
-
pageInfo: u?.pageInfo ?
|
|
223
|
+
pageInfo: u?.pageInfo ? O(u.pageInfo) : null,
|
|
220
224
|
loadMore: f,
|
|
221
225
|
error: o ?? null,
|
|
222
226
|
isLoading: a,
|
|
223
|
-
refetch:
|
|
227
|
+
refetch: s
|
|
224
228
|
};
|
|
225
229
|
}
|
|
226
|
-
function
|
|
227
|
-
let { workspaceId: n } =
|
|
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) =>
|
|
239
|
+
data: l?.edges.map((e) => j(e.node)) ?? [],
|
|
236
240
|
totalCount: l?.totalCount ?? 0,
|
|
237
|
-
pageInfo: l?.pageInfo ?
|
|
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
|
|
259
|
-
let { workspaceId: n } =
|
|
262
|
+
function H(e) {
|
|
263
|
+
let { workspaceId: n } = t(), { data: r, loading: i, error: a } = S(d, {
|
|
260
264
|
variables: {
|
|
261
|
-
id:
|
|
265
|
+
id: e ?? "",
|
|
262
266
|
context: { workspaceId: n }
|
|
263
267
|
},
|
|
264
|
-
skip: !
|
|
268
|
+
skip: !e || !n
|
|
265
269
|
});
|
|
266
270
|
return {
|
|
267
|
-
data: r?.getExportTemplate ?
|
|
271
|
+
data: r?.getExportTemplate ? j(r.getExportTemplate) : null,
|
|
268
272
|
isLoading: i,
|
|
269
273
|
error: a ?? null
|
|
270
274
|
};
|
|
271
275
|
}
|
|
272
|
-
function
|
|
273
|
-
let
|
|
274
|
-
let { filters:
|
|
275
|
-
...
|
|
276
|
-
exportScope:
|
|
277
|
-
format:
|
|
278
|
-
entityFilters:
|
|
279
|
-
}, s = await
|
|
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:
|
|
282
|
-
input:
|
|
285
|
+
context: { workspaceId: a },
|
|
286
|
+
input: r
|
|
283
287
|
},
|
|
284
288
|
refetchQueries: [{
|
|
285
|
-
query:
|
|
286
|
-
variables: { context: { workspaceId:
|
|
289
|
+
query: f,
|
|
290
|
+
variables: { context: { workspaceId: a } }
|
|
287
291
|
}]
|
|
288
292
|
});
|
|
289
|
-
if (!s.data) throw
|
|
290
|
-
return
|
|
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:
|
|
294
|
-
mutate:
|
|
295
|
-
mutateAsync:
|
|
296
|
-
loading:
|
|
297
|
-
isPending:
|
|
298
|
-
error:
|
|
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
|
|
302
|
-
let
|
|
303
|
-
let
|
|
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:
|
|
309
|
+
id: t,
|
|
306
310
|
context: { workspaceId: r }
|
|
307
311
|
},
|
|
308
312
|
refetchQueries: [{
|
|
309
|
-
query:
|
|
313
|
+
query: f,
|
|
310
314
|
variables: { context: { workspaceId: r } }
|
|
311
315
|
}]
|
|
312
316
|
});
|
|
313
|
-
if (!
|
|
317
|
+
if (!n.data) throw v(e, "export.api.failed", {
|
|
314
318
|
operation: "cancelExportJob",
|
|
315
|
-
jobId:
|
|
319
|
+
jobId: t
|
|
316
320
|
}), Error("Failed to cancel export job");
|
|
317
|
-
return
|
|
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
|
|
329
|
-
let
|
|
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:
|
|
335
|
+
id: t,
|
|
332
336
|
context: { workspaceId: n }
|
|
333
337
|
},
|
|
334
338
|
refetchQueries: [{
|
|
335
|
-
query:
|
|
339
|
+
query: f,
|
|
336
340
|
variables: { context: { workspaceId: n } }
|
|
337
341
|
}]
|
|
338
|
-
}),
|
|
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:
|
|
344
|
-
isPending:
|
|
347
|
+
loading: i,
|
|
348
|
+
isPending: i,
|
|
345
349
|
error: o ?? null
|
|
346
350
|
};
|
|
347
351
|
}
|
|
348
|
-
function
|
|
349
|
-
let
|
|
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
|
|
356
|
+
let t = await a({
|
|
353
357
|
variables: {
|
|
354
358
|
id: e,
|
|
355
|
-
context: { workspaceId:
|
|
359
|
+
context: { workspaceId: i }
|
|
356
360
|
},
|
|
357
361
|
refetchQueries: [{
|
|
358
|
-
query:
|
|
359
|
-
variables: { context: { workspaceId:
|
|
362
|
+
query: f,
|
|
363
|
+
variables: { context: { workspaceId: i } }
|
|
360
364
|
}]
|
|
361
365
|
});
|
|
362
|
-
if (!
|
|
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
|
|
370
|
+
return v(r, "export.job.retried", {
|
|
367
371
|
originalJobId: e,
|
|
368
|
-
jobId:
|
|
369
|
-
}),
|
|
372
|
+
jobId: t.data.retryExportJob.id
|
|
373
|
+
}), A(t.data.retryExportJob);
|
|
370
374
|
},
|
|
371
|
-
loading:
|
|
372
|
-
isPending:
|
|
373
|
-
error:
|
|
375
|
+
loading: o,
|
|
376
|
+
isPending: o,
|
|
377
|
+
error: s ?? null
|
|
374
378
|
};
|
|
375
379
|
}
|
|
376
|
-
function
|
|
377
|
-
let
|
|
380
|
+
function q() {
|
|
381
|
+
let e = t(), { workspaceId: n } = e, [r, { loading: a, error: o }] = x(i);
|
|
378
382
|
return {
|
|
379
|
-
createTemplate: async (
|
|
380
|
-
let
|
|
381
|
-
...
|
|
382
|
-
format:
|
|
383
|
-
}, a = await
|
|
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:
|
|
390
|
+
input: i
|
|
387
391
|
},
|
|
388
392
|
refetchQueries: [{
|
|
389
|
-
query:
|
|
393
|
+
query: p,
|
|
390
394
|
variables: { context: { workspaceId: n } }
|
|
391
395
|
}]
|
|
392
396
|
});
|
|
393
|
-
if (!a.data) throw
|
|
394
|
-
return
|
|
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
|
|
402
|
-
let
|
|
405
|
+
function J() {
|
|
406
|
+
let e = t(), { workspaceId: n } = e, [r, { loading: i, error: a }] = x(o);
|
|
403
407
|
return {
|
|
404
|
-
deleteTemplate: async (
|
|
408
|
+
deleteTemplate: async (t) => (await r({
|
|
405
409
|
variables: {
|
|
406
|
-
id:
|
|
410
|
+
id: t,
|
|
407
411
|
context: { workspaceId: n }
|
|
408
412
|
},
|
|
409
413
|
refetchQueries: [{
|
|
410
|
-
query:
|
|
414
|
+
query: p,
|
|
411
415
|
variables: { context: { workspaceId: n } }
|
|
412
416
|
}]
|
|
413
|
-
}),
|
|
417
|
+
}), v(e, "export.template.deleted", { templateId: t }), !0),
|
|
414
418
|
loading: i,
|
|
415
419
|
isPending: i,
|
|
416
|
-
error:
|
|
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 {
|
|
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
|