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