@burdenoff/microfe-export 2026.1125.1 → 2026.1127.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 +12 -12
- package/dist/export/hooks/useExportQueries.js +149 -155
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/providers/ExportProvider.js +37 -37
- package/dist/export/utils/cn.js +2 -2
- package/dist/export/workspace-v2/NewDownloadDialog.js +1 -1
- package/dist/export/workspace-v2/NewDownloadDialog.js.map +1 -1
- package/dist/export/workspace-v2/SetupsList.js +0 -1
- package/dist/export/workspace-v2/SetupsList.js.map +1 -1
- package/dist/export/workspace-v2/useExportAccess.d.ts +2 -2
- package/dist/export/workspace-v2/useExportAccess.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +0 -42
- package/dist/generated/wspace-operations.js +6 -16
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/index.js +0 -1
- package/package.json +4 -1
- package/dist/export/index.js +0 -5
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
- package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/version.js +0 -5
- package/dist/node_modules/@apollo/client/version.js.map +0 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
- package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
- package/dist/node_modules/@wry/trie/lib/index.js +0 -52
- package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
- package/dist/node_modules/clsx/dist/clsx.js +0 -19
- package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/client.js +0 -279
- package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1778
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
- package/dist/node_modules/tslib/tslib.es6.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -273,16 +273,16 @@ export declare function useDeleteExportTemplate(): {
|
|
|
273
273
|
isPending: boolean;
|
|
274
274
|
error: import('@apollo/client').ErrorLike | null;
|
|
275
275
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
export declare function useOrganizationExportPermission(
|
|
276
|
+
/**
|
|
277
|
+
* Whether the person may download the whole organization: no, for everyone, and nothing is
|
|
278
|
+
* asked (BOFF-16327). The organization option stays locked, as it always was in practice.
|
|
279
|
+
*
|
|
280
|
+
* This used to ask the workspace access service (`myPermissions` with the organization's id).
|
|
281
|
+
* That service answers only for the person's own workspace, so every member got a 403 in the
|
|
282
|
+
* console on each visit, and its catalog has no organization export grant at all, so no one,
|
|
283
|
+
* admins included, could get a yes. The grant (`export:organization_admin`) belongs to Global
|
|
284
|
+
* RBAC (BOFF-8579). When organization downloads are checked there, ask Global RBAC's
|
|
285
|
+
* `myPermissions` (a self query: the person's own grants, in any scope).
|
|
286
|
+
*/
|
|
287
|
+
export declare function useOrganizationExportPermission(_organizationId: string | undefined): boolean;
|
|
288
288
|
export {};
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
import { CancelExportJobDocument as e, CreateExportJobDocument as t, CreateExportTemplateDocument as n, DeleteExportJobDocument as r, DeleteExportTemplateDocument as i, ExportJobProgressDocument as a,
|
|
2
|
-
import { ExportFormat as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import { joinPath as
|
|
5
|
-
import { followExportInBackground as
|
|
6
|
-
import { useTr as
|
|
7
|
-
import { emitExportEvent as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { useApolloClient as
|
|
10
|
-
import { useLoadingSystem as
|
|
1
|
+
import { CancelExportJobDocument as e, CreateExportJobDocument as t, CreateExportTemplateDocument as n, DeleteExportJobDocument as r, DeleteExportTemplateDocument as i, ExportJobProgressDocument as a, GetAvailableExportEntitiesDocument as o, GetExportJobDocument as s, GetExportTemplateDocument as c, ListExportJobsDocument as l, ListExportTemplatesDocument as u, RetryExportJobDocument as d, UpdateExportTemplateDocument as f } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { ExportFormat as p, ExportJobStatus as m, ExportScope as h } from "../../generated/wspace-types.js";
|
|
3
|
+
import { useExport as g } from "../providers/ExportProvider.js";
|
|
4
|
+
import { joinPath as _ } from "../utils/paths.js";
|
|
5
|
+
import { followExportInBackground as v } from "./exportBackgroundTask.js";
|
|
6
|
+
import { useTr as y } from "./useTr.js";
|
|
7
|
+
import { emitExportEvent as b } from "../utils/events.js";
|
|
8
|
+
import { useCallback as x, useEffect as S, useRef as C, useState as w } from "react";
|
|
9
|
+
import { useApolloClient as T, useMutation as E, useQuery as D, useSubscription as O } from "@apollo/client/react";
|
|
10
|
+
import { useLoadingSystem as k } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
|
|
11
11
|
// src/export/hooks/useExportQueries.ts
|
|
12
|
-
function
|
|
12
|
+
function A(e) {
|
|
13
13
|
return e ?? void 0;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function j(e) {
|
|
16
16
|
if (e == null) return;
|
|
17
17
|
let t = typeof e == "number" ? e : Number(e);
|
|
18
18
|
return Number.isFinite(t) ? t : void 0;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function M(e) {
|
|
21
|
+
return j(e) ?? 0;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function N(e) {
|
|
24
24
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function P(e) {
|
|
27
27
|
return {
|
|
28
28
|
hasNextPage: e.hasNextPage,
|
|
29
29
|
hasPreviousPage: e.hasPreviousPage,
|
|
30
|
-
startCursor:
|
|
31
|
-
endCursor:
|
|
30
|
+
startCursor: A(e.startCursor),
|
|
31
|
+
endCursor: A(e.endCursor)
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function F(e) {
|
|
35
35
|
return {
|
|
36
36
|
id: e.id,
|
|
37
|
-
jobId:
|
|
37
|
+
jobId: A(e.jobId),
|
|
38
38
|
partNumber: e.partNumber,
|
|
39
39
|
fileName: e.fileName,
|
|
40
|
-
sizeBytes:
|
|
40
|
+
sizeBytes: M(e.sizeBytes),
|
|
41
41
|
entityTypes: e.entityTypes,
|
|
42
|
-
downloadUrl:
|
|
43
|
-
downloadExpiresAt:
|
|
44
|
-
checksum:
|
|
45
|
-
createdAt:
|
|
42
|
+
downloadUrl: A(e.downloadUrl),
|
|
43
|
+
downloadExpiresAt: A(e.downloadExpiresAt),
|
|
44
|
+
checksum: A(e.checksum),
|
|
45
|
+
createdAt: A(e.createdAt)
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function I(e) {
|
|
49
49
|
return {
|
|
50
50
|
id: e.id,
|
|
51
51
|
name: e.name,
|
|
52
|
-
description:
|
|
52
|
+
description: A(e.description),
|
|
53
53
|
status: e.status,
|
|
54
54
|
progress: e.progress,
|
|
55
55
|
exportScope: e.exportScope ? e.exportScope : void 0,
|
|
56
|
-
organizationId:
|
|
56
|
+
organizationId: A(e.organizationId),
|
|
57
57
|
targetWorkspaceIds: e.targetWorkspaceIds ?? void 0,
|
|
58
58
|
entityTypes: e.entityTypes,
|
|
59
59
|
format: e.format,
|
|
60
60
|
archiveFormat: e.archiveFormat ?? "ZIP",
|
|
61
|
-
totalEntities:
|
|
62
|
-
processedEntities:
|
|
63
|
-
totalSizeBytes:
|
|
64
|
-
parts: e.parts?.map(
|
|
65
|
-
archiveFileId:
|
|
66
|
-
downloadUrl:
|
|
67
|
-
downloadExpiresAt:
|
|
68
|
-
templateId:
|
|
69
|
-
filters:
|
|
70
|
-
errorMessage:
|
|
71
|
-
startedAt:
|
|
72
|
-
completedAt:
|
|
73
|
-
expiresAt:
|
|
61
|
+
totalEntities: j(e.totalEntities),
|
|
62
|
+
processedEntities: j(e.processedEntities),
|
|
63
|
+
totalSizeBytes: j(e.totalSizeBytes),
|
|
64
|
+
parts: e.parts?.map(F) ?? [],
|
|
65
|
+
archiveFileId: A(e.archiveFileId),
|
|
66
|
+
downloadUrl: A(e.downloadUrl),
|
|
67
|
+
downloadExpiresAt: A(e.downloadExpiresAt),
|
|
68
|
+
templateId: A(e.templateId),
|
|
69
|
+
filters: N(e.entityFilters),
|
|
70
|
+
errorMessage: A(e.errorMessage),
|
|
71
|
+
startedAt: A(e.startedAt),
|
|
72
|
+
completedAt: A(e.completedAt),
|
|
73
|
+
expiresAt: A(e.expiresAt),
|
|
74
74
|
createdBy: e.createdBy,
|
|
75
|
-
temporalWorkflowId:
|
|
76
|
-
workspaceId:
|
|
75
|
+
temporalWorkflowId: A(e.temporalWorkflowId),
|
|
76
|
+
workspaceId: A(e.workspaceId),
|
|
77
77
|
createdAt: e.createdAt,
|
|
78
78
|
updatedAt: e.updatedAt
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function L(e) {
|
|
82
82
|
return {
|
|
83
83
|
id: e.id,
|
|
84
84
|
name: e.name,
|
|
85
|
-
description:
|
|
85
|
+
description: A(e.description),
|
|
86
86
|
entityTypes: e.entityTypes,
|
|
87
87
|
format: e.format,
|
|
88
|
-
filters:
|
|
88
|
+
filters: N(e.entityFilters),
|
|
89
89
|
isDefault: e.isDefault,
|
|
90
90
|
createdBy: e.createdBy,
|
|
91
|
-
workspaceId:
|
|
91
|
+
workspaceId: A(e.workspaceId),
|
|
92
92
|
createdAt: e.createdAt,
|
|
93
93
|
updatedAt: e.updatedAt
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function R(e) {
|
|
97
97
|
return {
|
|
98
98
|
entityType: e.entityType,
|
|
99
99
|
displayName: e.displayName,
|
|
100
|
-
description:
|
|
101
|
-
estimatedSize:
|
|
100
|
+
description: A(e.description),
|
|
101
|
+
estimatedSize: A(e.estimatedSize),
|
|
102
102
|
supportsDateRange: e.supportsDateRange,
|
|
103
103
|
supportsMediaExport: e.supportsMediaExport,
|
|
104
104
|
enabled: e.enabled
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
if (e === "CSV") return
|
|
109
|
-
if (e === "JSON") return
|
|
107
|
+
function z(e) {
|
|
108
|
+
if (e === "CSV") return p.Csv;
|
|
109
|
+
if (e === "JSON") return p.Json;
|
|
110
110
|
throw Error(`Unsupported export format: ${e}`);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function B(e) {
|
|
113
113
|
switch (e) {
|
|
114
|
-
case "CANCELLED": return
|
|
115
|
-
case "COMPLETED": return
|
|
116
|
-
case "CREATED": return
|
|
117
|
-
case "DELETED": return
|
|
118
|
-
case "EXPIRED": return
|
|
119
|
-
case "FAILED": return
|
|
120
|
-
case "QUEUED": return
|
|
121
|
-
case "RUNNING": return
|
|
114
|
+
case "CANCELLED": return m.Cancelled;
|
|
115
|
+
case "COMPLETED": return m.Completed;
|
|
116
|
+
case "CREATED": return m.Created;
|
|
117
|
+
case "DELETED": return m.Deleted;
|
|
118
|
+
case "EXPIRED": return m.Expired;
|
|
119
|
+
case "FAILED": return m.Failed;
|
|
120
|
+
case "QUEUED": return m.Queued;
|
|
121
|
+
case "RUNNING": return m.Running;
|
|
122
122
|
default: throw Error(`Unsupported export status: ${e}`);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function V(e) {
|
|
126
126
|
switch (e) {
|
|
127
|
-
case "INDIVIDUAL": return
|
|
128
|
-
case "WORKSPACE_ADMIN": return
|
|
129
|
-
case "ORG_ADMIN": return
|
|
127
|
+
case "INDIVIDUAL": return h.Individual;
|
|
128
|
+
case "WORKSPACE_ADMIN": return h.WorkspaceAdmin;
|
|
129
|
+
case "ORG_ADMIN": return h.OrgAdmin;
|
|
130
130
|
default: throw Error(`Unsupported export scope: ${e}`);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
let { workspaceId: n } =
|
|
135
|
-
status: e.status && e.status !== "all" ? [
|
|
136
|
-
format: e.format && e.format !== "all" ?
|
|
133
|
+
function H(e, t) {
|
|
134
|
+
let { workspaceId: n } = g(), r = e && n ? {
|
|
135
|
+
status: e.status && e.status !== "all" ? [B(e.status)] : void 0,
|
|
136
|
+
format: e.format && e.format !== "all" ? z(e.format) : void 0,
|
|
137
137
|
search: e.search ?? void 0
|
|
138
|
-
} : void 0, { data: i, loading: a, error: o, refetch: s } =
|
|
138
|
+
} : void 0, { data: i, loading: a, error: o, refetch: s } = D(l, {
|
|
139
139
|
variables: {
|
|
140
140
|
filter: r,
|
|
141
141
|
pagination: t,
|
|
@@ -144,16 +144,16 @@ function U(e, t) {
|
|
|
144
144
|
skip: !n
|
|
145
145
|
});
|
|
146
146
|
return {
|
|
147
|
-
data: i?.listExportJobs.edges.map((e) =>
|
|
147
|
+
data: i?.listExportJobs.edges.map((e) => I(e.node)) ?? [],
|
|
148
148
|
totalCount: i?.listExportJobs.totalCount ?? 0,
|
|
149
|
-
pageInfo: i?.listExportJobs.pageInfo ?
|
|
149
|
+
pageInfo: i?.listExportJobs.pageInfo ? P(i.listExportJobs.pageInfo) : null,
|
|
150
150
|
isLoading: a,
|
|
151
151
|
error: o ?? null,
|
|
152
152
|
refetch: s
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
let { workspaceId: t } =
|
|
155
|
+
function U(e) {
|
|
156
|
+
let { workspaceId: t } = g(), { data: n, loading: r, error: i, refetch: a } = D(s, {
|
|
157
157
|
variables: {
|
|
158
158
|
id: e ?? "",
|
|
159
159
|
context: { workspaceId: t }
|
|
@@ -161,41 +161,41 @@ function W(e) {
|
|
|
161
161
|
skip: !e || !t
|
|
162
162
|
});
|
|
163
163
|
return {
|
|
164
|
-
data: n?.getExportJob ?
|
|
164
|
+
data: n?.getExportJob ? I(n.getExportJob) : null,
|
|
165
165
|
isLoading: r,
|
|
166
166
|
error: i ?? null,
|
|
167
167
|
refetch: a
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
let { data: t, loading: n, error: r } =
|
|
170
|
+
function W(e) {
|
|
171
|
+
let { data: t, loading: n, error: r } = O(a, {
|
|
172
172
|
variables: { jobId: e ?? "" },
|
|
173
173
|
skip: !e
|
|
174
174
|
});
|
|
175
175
|
return {
|
|
176
|
-
data: t?.exportJobProgress ?
|
|
176
|
+
data: t?.exportJobProgress ? I(t.exportJobProgress) : null,
|
|
177
177
|
isLoading: n,
|
|
178
178
|
error: r ?? null
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function G(e) {
|
|
182
182
|
let t = /* @__PURE__ */ new Set();
|
|
183
183
|
return e.filter((e) => !t.has(e.entityType) && (t.add(e.entityType), !0));
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function K(e, { fetchMoreResult: t }) {
|
|
186
186
|
return t ? { getAvailableExportEntities: {
|
|
187
187
|
...t.getAvailableExportEntities,
|
|
188
188
|
edges: [...e.getAvailableExportEntities.edges, ...t.getAvailableExportEntities.edges]
|
|
189
189
|
} } : e;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
let { workspaceId: n } =
|
|
191
|
+
function q(e, t = {}) {
|
|
192
|
+
let { workspaceId: n } = g(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: s, refetch: c, fetchMore: l } = D(o, {
|
|
193
193
|
variables: {
|
|
194
194
|
context: { workspaceId: r },
|
|
195
195
|
pagination: { first: 100 }
|
|
196
196
|
},
|
|
197
197
|
skip: !r
|
|
198
|
-
}), u = i?.getAvailableExportEntities, d =
|
|
198
|
+
}), u = i?.getAvailableExportEntities, d = G(u?.edges.map((e) => R(e.node)) ?? []), f = async () => {
|
|
199
199
|
r && u?.pageInfo.hasNextPage && await l({
|
|
200
200
|
variables: {
|
|
201
201
|
context: { workspaceId: r },
|
|
@@ -204,11 +204,11 @@ function J(e, t = {}) {
|
|
|
204
204
|
after: u.pageInfo.endCursor
|
|
205
205
|
}
|
|
206
206
|
},
|
|
207
|
-
updateQuery:
|
|
207
|
+
updateQuery: K
|
|
208
208
|
});
|
|
209
|
-
}, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`,
|
|
210
|
-
|
|
211
|
-
!a && r && p && m &&
|
|
209
|
+
}, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`, _ = C(null), [v, y] = w(null);
|
|
210
|
+
S(() => {
|
|
211
|
+
!a && r && p && m && _.current !== h && (_.current = h, l({
|
|
212
212
|
variables: {
|
|
213
213
|
context: { workspaceId: r },
|
|
214
214
|
pagination: {
|
|
@@ -216,7 +216,7 @@ function J(e, t = {}) {
|
|
|
216
216
|
after: m
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
updateQuery:
|
|
219
|
+
updateQuery: K
|
|
220
220
|
}).catch((e) => {
|
|
221
221
|
y({
|
|
222
222
|
page: h,
|
|
@@ -231,15 +231,15 @@ function J(e, t = {}) {
|
|
|
231
231
|
l,
|
|
232
232
|
h
|
|
233
233
|
]);
|
|
234
|
-
let b =
|
|
235
|
-
|
|
234
|
+
let b = x(() => {
|
|
235
|
+
_.current = null, y(null), c().catch(() => void 0);
|
|
236
236
|
}, [c]);
|
|
237
237
|
return {
|
|
238
238
|
data: d,
|
|
239
239
|
totalCount: u?.totalCount ?? 0,
|
|
240
|
-
pageInfo: u?.pageInfo ?
|
|
240
|
+
pageInfo: u?.pageInfo ? P(u.pageInfo) : null,
|
|
241
241
|
loadMore: f,
|
|
242
|
-
error:
|
|
242
|
+
error: s ?? null,
|
|
243
243
|
isLoading: a,
|
|
244
244
|
refetch: c,
|
|
245
245
|
complete: !!u && !p,
|
|
@@ -247,8 +247,8 @@ function J(e, t = {}) {
|
|
|
247
247
|
retryAll: b
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
let { workspaceId: t } =
|
|
250
|
+
function J(e) {
|
|
251
|
+
let { workspaceId: t } = g(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = D(u, {
|
|
252
252
|
variables: {
|
|
253
253
|
context: { workspaceId: n },
|
|
254
254
|
pagination: { first: 50 }
|
|
@@ -256,9 +256,9 @@ function Y(e) {
|
|
|
256
256
|
skip: !n
|
|
257
257
|
}), c = r?.listExportTemplates;
|
|
258
258
|
return {
|
|
259
|
-
data: c?.edges.map((e) =>
|
|
259
|
+
data: c?.edges.map((e) => L(e.node)) ?? [],
|
|
260
260
|
totalCount: c?.totalCount ?? 0,
|
|
261
|
-
pageInfo: c?.pageInfo ?
|
|
261
|
+
pageInfo: c?.pageInfo ? P(c.pageInfo) : null,
|
|
262
262
|
loadMore: async () => {
|
|
263
263
|
n && c?.pageInfo.hasNextPage && await s({
|
|
264
264
|
variables: {
|
|
@@ -279,8 +279,8 @@ function Y(e) {
|
|
|
279
279
|
refetch: o
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
let { workspaceId: t } =
|
|
282
|
+
function Y(e) {
|
|
283
|
+
let { workspaceId: t } = g(), { data: n, loading: r, error: i } = D(c, {
|
|
284
284
|
variables: {
|
|
285
285
|
id: e ?? "",
|
|
286
286
|
context: { workspaceId: t }
|
|
@@ -288,69 +288,69 @@ function X(e) {
|
|
|
288
288
|
skip: !e || !t
|
|
289
289
|
});
|
|
290
290
|
return {
|
|
291
|
-
data: n?.getExportTemplate ?
|
|
291
|
+
data: n?.getExportTemplate ? L(n.getExportTemplate) : null,
|
|
292
292
|
isLoading: r,
|
|
293
293
|
error: i ?? null
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
let e =
|
|
298
|
-
let { filters: s, ...c } = t,
|
|
296
|
+
function X() {
|
|
297
|
+
let e = g(), { workspaceId: n } = e, r = T(), i = y(), a = k(), [o, { loading: s, error: c }] = E(t), u = async (t) => {
|
|
298
|
+
let { filters: s, ...c } = t, u = {
|
|
299
299
|
...c,
|
|
300
|
-
exportScope: c.exportScope ?
|
|
301
|
-
format:
|
|
300
|
+
exportScope: c.exportScope ? V(c.exportScope) : void 0,
|
|
301
|
+
format: z(c.format),
|
|
302
302
|
entityFilters: s
|
|
303
303
|
}, d = await o({
|
|
304
304
|
variables: {
|
|
305
305
|
context: { workspaceId: n },
|
|
306
|
-
input:
|
|
306
|
+
input: u
|
|
307
307
|
},
|
|
308
308
|
refetchQueries: [{
|
|
309
|
-
query:
|
|
309
|
+
query: l,
|
|
310
310
|
variables: { context: { workspaceId: n } }
|
|
311
311
|
}]
|
|
312
312
|
});
|
|
313
|
-
if (!d.data) throw
|
|
314
|
-
|
|
315
|
-
let f =
|
|
313
|
+
if (!d.data) throw b(e, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
|
|
314
|
+
b(e, "export.job.created", { jobId: d.data.createExportJob.id });
|
|
315
|
+
let f = I(d.data.createExportJob);
|
|
316
316
|
if (a) {
|
|
317
317
|
let { basePath: t = "/", navigate: n } = e;
|
|
318
|
-
|
|
318
|
+
v({
|
|
319
319
|
client: r,
|
|
320
320
|
job: f,
|
|
321
321
|
readyMessage: `${f.name} · ${i("export.v2.state.ready", "Ready")}`,
|
|
322
322
|
openLabel: i("export.v2.row.open", "Open"),
|
|
323
|
-
onOpen: () => n?.(
|
|
323
|
+
onOpen: () => n?.(_(t, f.id))
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
return f;
|
|
327
327
|
};
|
|
328
328
|
return {
|
|
329
|
-
createJob:
|
|
330
|
-
mutate:
|
|
331
|
-
mutateAsync:
|
|
329
|
+
createJob: u,
|
|
330
|
+
mutate: u,
|
|
331
|
+
mutateAsync: u,
|
|
332
332
|
loading: s,
|
|
333
333
|
isPending: s,
|
|
334
334
|
error: c ?? null
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
let t =
|
|
337
|
+
function Z() {
|
|
338
|
+
let t = g(), { workspaceId: n } = t, [r, { loading: i, error: a }] = E(e), o = async (e) => {
|
|
339
339
|
let i = await r({
|
|
340
340
|
variables: {
|
|
341
341
|
id: e,
|
|
342
342
|
context: { workspaceId: n }
|
|
343
343
|
},
|
|
344
344
|
refetchQueries: [{
|
|
345
|
-
query:
|
|
345
|
+
query: l,
|
|
346
346
|
variables: { context: { workspaceId: n } }
|
|
347
347
|
}]
|
|
348
348
|
});
|
|
349
|
-
if (!i.data) throw
|
|
349
|
+
if (!i.data) throw b(t, "export.api.failed", {
|
|
350
350
|
operation: "cancelExportJob",
|
|
351
351
|
jobId: e
|
|
352
352
|
}), Error("Failed to cancel export job");
|
|
353
|
-
return
|
|
353
|
+
return b(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
|
|
354
354
|
};
|
|
355
355
|
return {
|
|
356
356
|
cancelJob: o,
|
|
@@ -361,17 +361,17 @@ function Q() {
|
|
|
361
361
|
error: a ?? null
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
let e =
|
|
364
|
+
function Q() {
|
|
365
|
+
let e = g(), { workspaceId: t } = e, [n, { loading: i, error: a }] = E(r), o = async (r) => (await n({
|
|
366
366
|
variables: {
|
|
367
367
|
id: r,
|
|
368
368
|
context: { workspaceId: t }
|
|
369
369
|
},
|
|
370
370
|
refetchQueries: [{
|
|
371
|
-
query:
|
|
371
|
+
query: l,
|
|
372
372
|
variables: { context: { workspaceId: t } }
|
|
373
373
|
}]
|
|
374
|
-
}),
|
|
374
|
+
}), b(e, "export.job.deleted", { jobId: r }), !0);
|
|
375
375
|
return {
|
|
376
376
|
deleteJob: o,
|
|
377
377
|
mutate: o,
|
|
@@ -381,8 +381,8 @@ function $() {
|
|
|
381
381
|
error: a ?? null
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
let e =
|
|
384
|
+
function $() {
|
|
385
|
+
let e = g(), { workspaceId: t } = e, [n, { loading: r, error: i }] = E(d);
|
|
386
386
|
return {
|
|
387
387
|
retryJob: async (r) => {
|
|
388
388
|
let i = await n({
|
|
@@ -391,51 +391,51 @@ function ee() {
|
|
|
391
391
|
context: { workspaceId: t }
|
|
392
392
|
},
|
|
393
393
|
refetchQueries: [{
|
|
394
|
-
query:
|
|
394
|
+
query: l,
|
|
395
395
|
variables: { context: { workspaceId: t } }
|
|
396
396
|
}]
|
|
397
397
|
});
|
|
398
|
-
if (!i.data) throw
|
|
398
|
+
if (!i.data) throw b(e, "export.api.failed", {
|
|
399
399
|
operation: "retryExportJob",
|
|
400
400
|
jobId: r
|
|
401
401
|
}), Error("Failed to retry export job");
|
|
402
|
-
return
|
|
402
|
+
return b(e, "export.job.retried", {
|
|
403
403
|
originalJobId: r,
|
|
404
404
|
jobId: i.data.retryExportJob.id
|
|
405
|
-
}),
|
|
405
|
+
}), I(i.data.retryExportJob);
|
|
406
406
|
},
|
|
407
407
|
loading: r,
|
|
408
408
|
isPending: r,
|
|
409
409
|
error: i ?? null
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
let e =
|
|
412
|
+
function ee() {
|
|
413
|
+
let e = g(), { workspaceId: t } = e, [r, { loading: i, error: a }] = E(n);
|
|
414
414
|
return {
|
|
415
415
|
createTemplate: async (n) => {
|
|
416
416
|
let i = {
|
|
417
417
|
...n,
|
|
418
|
-
format:
|
|
418
|
+
format: z(n.format)
|
|
419
419
|
}, a = await r({
|
|
420
420
|
variables: {
|
|
421
421
|
context: { workspaceId: t },
|
|
422
422
|
input: i
|
|
423
423
|
},
|
|
424
424
|
refetchQueries: [{
|
|
425
|
-
query:
|
|
425
|
+
query: u,
|
|
426
426
|
variables: { context: { workspaceId: t } }
|
|
427
427
|
}]
|
|
428
428
|
});
|
|
429
|
-
if (!a.data) throw
|
|
430
|
-
return
|
|
429
|
+
if (!a.data) throw b(e, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
|
|
430
|
+
return b(e, "export.template.created", { templateId: a.data.createExportTemplate.id }), L(a.data.createExportTemplate);
|
|
431
431
|
},
|
|
432
432
|
loading: i,
|
|
433
433
|
isPending: i,
|
|
434
434
|
error: a ?? null
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
let e =
|
|
437
|
+
function te() {
|
|
438
|
+
let e = g(), { workspaceId: t } = e, [n, { loading: r, error: i }] = E(f);
|
|
439
439
|
return {
|
|
440
440
|
updateTemplate: async (r, i) => {
|
|
441
441
|
let a = await n({
|
|
@@ -444,24 +444,24 @@ function ne() {
|
|
|
444
444
|
id: r,
|
|
445
445
|
input: {
|
|
446
446
|
...i,
|
|
447
|
-
format:
|
|
447
|
+
format: z(i.format)
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
450
|
refetchQueries: [{
|
|
451
|
-
query:
|
|
451
|
+
query: u,
|
|
452
452
|
variables: { context: { workspaceId: t } }
|
|
453
453
|
}]
|
|
454
454
|
});
|
|
455
|
-
if (!a.data) throw
|
|
456
|
-
return
|
|
455
|
+
if (!a.data) throw b(e, "export.api.failed", { operation: "updateExportTemplate" }), Error("Failed to update export template");
|
|
456
|
+
return L(a.data.updateExportTemplate);
|
|
457
457
|
},
|
|
458
458
|
loading: r,
|
|
459
459
|
isPending: r,
|
|
460
460
|
error: i ?? null
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
let e =
|
|
463
|
+
function ne() {
|
|
464
|
+
let e = g(), { workspaceId: t } = e, [n, { loading: r, error: a }] = E(i);
|
|
465
465
|
return {
|
|
466
466
|
deleteTemplate: async (r) => (await n({
|
|
467
467
|
variables: {
|
|
@@ -469,24 +469,18 @@ function re() {
|
|
|
469
469
|
context: { workspaceId: t }
|
|
470
470
|
},
|
|
471
471
|
refetchQueries: [{
|
|
472
|
-
query:
|
|
472
|
+
query: u,
|
|
473
473
|
variables: { context: { workspaceId: t } }
|
|
474
474
|
}]
|
|
475
|
-
}),
|
|
475
|
+
}), b(e, "export.template.deleted", { templateId: r }), !0),
|
|
476
476
|
loading: r,
|
|
477
477
|
isPending: r,
|
|
478
478
|
error: a ?? null
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
483
|
-
variables: { scopeId: e ?? "" },
|
|
484
|
-
skip: !e,
|
|
485
|
-
fetchPolicy: "network-only",
|
|
486
|
-
context: t.quiet ? { suppressGlobalErrorEvent: !0 } : void 0
|
|
487
|
-
});
|
|
488
|
-
return !!e && !!n && !r && !i && n?.myPermissions.scopeId === e && n.myPermissions.permissions.some((e) => e.resourceType === "export" && e.allowedActions.includes("organization_admin"));
|
|
481
|
+
function re(e) {
|
|
482
|
+
return !1;
|
|
489
483
|
}
|
|
490
|
-
export {
|
|
484
|
+
export { I as mapJob, L as mapTemplate, G as uniqueByEntityType, q as useAvailableEntities, Z as useCancelExportJob, X as useCreateExportJob, ee as useCreateExportTemplate, Q as useDeleteExportJob, ne as useDeleteExportTemplate, U as useExportJob, W as useExportJobProgress, H as useExportJobs, Y as useExportTemplate, J as useExportTemplates, re as useOrganizationExportPermission, $ as useRetryExportJob, te as useUpdateExportTemplate };
|
|
491
485
|
|
|
492
486
|
//# sourceMappingURL=useExportQueries.js.map
|