@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.
Files changed (107) hide show
  1. package/dist/export/hooks/useExportQueries.d.ts +12 -12
  2. package/dist/export/hooks/useExportQueries.js +149 -155
  3. package/dist/export/hooks/useExportQueries.js.map +1 -1
  4. package/dist/export/providers/ExportProvider.js +37 -37
  5. package/dist/export/utils/cn.js +2 -2
  6. package/dist/export/workspace-v2/NewDownloadDialog.js +1 -1
  7. package/dist/export/workspace-v2/NewDownloadDialog.js.map +1 -1
  8. package/dist/export/workspace-v2/SetupsList.js +0 -1
  9. package/dist/export/workspace-v2/SetupsList.js.map +1 -1
  10. package/dist/export/workspace-v2/useExportAccess.d.ts +2 -2
  11. package/dist/export/workspace-v2/useExportAccess.js.map +1 -1
  12. package/dist/generated/wspace-operations.d.ts +0 -42
  13. package/dist/generated/wspace-operations.js +6 -16
  14. package/dist/generated/wspace-operations.js.map +1 -1
  15. package/dist/index.js +0 -1
  16. package/package.json +4 -1
  17. package/dist/export/index.js +0 -5
  18. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
  19. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
  20. package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
  21. package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
  22. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
  23. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
  24. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
  25. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
  26. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
  27. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
  28. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
  29. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
  30. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
  31. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
  32. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
  33. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
  34. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
  35. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
  36. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
  37. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
  38. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
  39. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
  40. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
  41. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
  42. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
  43. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
  44. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
  45. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
  46. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
  47. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
  48. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
  49. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
  50. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
  51. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
  52. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
  53. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
  54. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
  55. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
  56. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
  57. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
  58. package/dist/node_modules/@apollo/client/version.js +0 -5
  59. package/dist/node_modules/@apollo/client/version.js.map +0 -1
  60. package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
  61. package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
  62. package/dist/node_modules/@wry/trie/lib/index.js +0 -52
  63. package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
  64. package/dist/node_modules/clsx/dist/clsx.js +0 -19
  65. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  66. package/dist/node_modules/graphql-ws/dist/client.js +0 -279
  67. package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
  68. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
  69. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
  70. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
  71. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
  72. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
  73. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
  74. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
  75. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
  76. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
  77. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
  78. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
  79. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
  80. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
  81. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
  82. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
  83. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
  84. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
  85. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
  86. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
  87. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
  88. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
  89. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
  90. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
  91. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
  92. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
  93. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
  94. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
  95. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
  96. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
  97. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
  98. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
  99. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
  100. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
  101. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
  102. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
  103. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
  104. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1778
  105. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  106. package/dist/node_modules/tslib/tslib.es6.js +0 -51
  107. 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
- export interface OrganizationExportPermissionOptions {
277
- /**
278
- * Keep a refusal out of the app's backend-error toast. The access service
279
- * answers `myPermissions` only for the person's own workspace scope (super
280
- * admins and services excepted), so asking about the organization is
281
- * refused for most people: that refusal is the expected "no", not a failure
282
- * to show them.
283
- */
284
- quiet?: boolean;
285
- }
286
- /** Organization scope is independent of workspace grants; this is a UX hint only. */
287
- export declare function useOrganizationExportPermission(organizationId: string | undefined, options?: OrganizationExportPermissionOptions): boolean;
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, ExportOrganizationPermissionDocument as o, GetAvailableExportEntitiesDocument as s, GetExportJobDocument as c, GetExportTemplateDocument as l, ListExportJobsDocument as u, ListExportTemplatesDocument as d, RetryExportJobDocument as f, UpdateExportTemplateDocument as p } from "../../generated/wspace-operations.js";
2
- import { ExportFormat as m, ExportJobStatus as h, ExportScope as g } from "../../generated/wspace-types.js";
3
- import { useExport as _ } from "../providers/ExportProvider.js";
4
- import { joinPath as v } from "../utils/paths.js";
5
- import { followExportInBackground as y } from "./exportBackgroundTask.js";
6
- import { useTr as b } from "./useTr.js";
7
- import { emitExportEvent as x } from "../utils/events.js";
8
- import { useCallback as S, useEffect as C, useRef as w, useState as T } from "react";
9
- import { useApolloClient as E, useMutation as D, useQuery as O, useSubscription as k } from "@apollo/client/react";
10
- import { useLoadingSystem as A } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
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 j(e) {
12
+ function A(e) {
13
13
  return e ?? void 0;
14
14
  }
15
- function M(e) {
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 N(e) {
21
- return M(e) ?? 0;
20
+ function M(e) {
21
+ return j(e) ?? 0;
22
22
  }
23
- function P(e) {
23
+ function N(e) {
24
24
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
25
25
  }
26
- function F(e) {
26
+ function P(e) {
27
27
  return {
28
28
  hasNextPage: e.hasNextPage,
29
29
  hasPreviousPage: e.hasPreviousPage,
30
- startCursor: j(e.startCursor),
31
- endCursor: j(e.endCursor)
30
+ startCursor: A(e.startCursor),
31
+ endCursor: A(e.endCursor)
32
32
  };
33
33
  }
34
- function I(e) {
34
+ function F(e) {
35
35
  return {
36
36
  id: e.id,
37
- jobId: j(e.jobId),
37
+ jobId: A(e.jobId),
38
38
  partNumber: e.partNumber,
39
39
  fileName: e.fileName,
40
- sizeBytes: N(e.sizeBytes),
40
+ sizeBytes: M(e.sizeBytes),
41
41
  entityTypes: e.entityTypes,
42
- downloadUrl: j(e.downloadUrl),
43
- downloadExpiresAt: j(e.downloadExpiresAt),
44
- checksum: j(e.checksum),
45
- createdAt: j(e.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 L(e) {
48
+ function I(e) {
49
49
  return {
50
50
  id: e.id,
51
51
  name: e.name,
52
- description: j(e.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: j(e.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: M(e.totalEntities),
62
- processedEntities: M(e.processedEntities),
63
- totalSizeBytes: M(e.totalSizeBytes),
64
- parts: e.parts?.map(I) ?? [],
65
- archiveFileId: j(e.archiveFileId),
66
- downloadUrl: j(e.downloadUrl),
67
- downloadExpiresAt: j(e.downloadExpiresAt),
68
- templateId: j(e.templateId),
69
- filters: P(e.entityFilters),
70
- errorMessage: j(e.errorMessage),
71
- startedAt: j(e.startedAt),
72
- completedAt: j(e.completedAt),
73
- expiresAt: j(e.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: j(e.temporalWorkflowId),
76
- workspaceId: j(e.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 R(e) {
81
+ function L(e) {
82
82
  return {
83
83
  id: e.id,
84
84
  name: e.name,
85
- description: j(e.description),
85
+ description: A(e.description),
86
86
  entityTypes: e.entityTypes,
87
87
  format: e.format,
88
- filters: P(e.entityFilters),
88
+ filters: N(e.entityFilters),
89
89
  isDefault: e.isDefault,
90
90
  createdBy: e.createdBy,
91
- workspaceId: j(e.workspaceId),
91
+ workspaceId: A(e.workspaceId),
92
92
  createdAt: e.createdAt,
93
93
  updatedAt: e.updatedAt
94
94
  };
95
95
  }
96
- function z(e) {
96
+ function R(e) {
97
97
  return {
98
98
  entityType: e.entityType,
99
99
  displayName: e.displayName,
100
- description: j(e.description),
101
- estimatedSize: j(e.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 B(e) {
108
- if (e === "CSV") return m.Csv;
109
- if (e === "JSON") return m.Json;
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 V(e) {
112
+ function B(e) {
113
113
  switch (e) {
114
- case "CANCELLED": return h.Cancelled;
115
- case "COMPLETED": return h.Completed;
116
- case "CREATED": return h.Created;
117
- case "DELETED": return h.Deleted;
118
- case "EXPIRED": return h.Expired;
119
- case "FAILED": return h.Failed;
120
- case "QUEUED": return h.Queued;
121
- case "RUNNING": return h.Running;
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 H(e) {
125
+ function V(e) {
126
126
  switch (e) {
127
- case "INDIVIDUAL": return g.Individual;
128
- case "WORKSPACE_ADMIN": return g.WorkspaceAdmin;
129
- case "ORG_ADMIN": return g.OrgAdmin;
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 U(e, t) {
134
- let { workspaceId: n } = _(), r = e && n ? {
135
- status: e.status && e.status !== "all" ? [V(e.status)] : void 0,
136
- format: e.format && e.format !== "all" ? B(e.format) : void 0,
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 } = O(u, {
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) => L(e.node)) ?? [],
147
+ data: i?.listExportJobs.edges.map((e) => I(e.node)) ?? [],
148
148
  totalCount: i?.listExportJobs.totalCount ?? 0,
149
- pageInfo: i?.listExportJobs.pageInfo ? F(i.listExportJobs.pageInfo) : null,
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 W(e) {
156
- let { workspaceId: t } = _(), { data: n, loading: r, error: i, refetch: a } = O(c, {
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 ? L(n.getExportJob) : null,
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 G(e) {
171
- let { data: t, loading: n, error: r } = k(a, {
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 ? L(t.exportJobProgress) : null,
176
+ data: t?.exportJobProgress ? I(t.exportJobProgress) : null,
177
177
  isLoading: n,
178
178
  error: r ?? null
179
179
  };
180
180
  }
181
- function K(e) {
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 q(e, { fetchMoreResult: t }) {
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 J(e, t = {}) {
192
- let { workspaceId: n } = _(), r = t.skip ? void 0 : e ?? n, { data: i, loading: a, error: o, refetch: c, fetchMore: l } = O(s, {
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 = K(u?.edges.map((e) => z(e.node)) ?? []), f = async () => {
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: q
207
+ updateQuery: K
208
208
  });
209
- }, p = u?.pageInfo.hasNextPage ?? !1, m = u?.pageInfo.endCursor ?? null, h = `${r ?? ""}|${m ?? ""}`, g = w(null), [v, y] = T(null);
210
- C(() => {
211
- !a && r && p && m && g.current !== h && (g.current = h, l({
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: q
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 = S(() => {
235
- g.current = null, y(null), c().catch(() => void 0);
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 ? F(u.pageInfo) : null,
240
+ pageInfo: u?.pageInfo ? P(u.pageInfo) : null,
241
241
  loadMore: f,
242
- error: o ?? null,
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 Y(e) {
251
- let { workspaceId: t } = _(), n = e ?? t, { data: r, loading: i, error: a, refetch: o, fetchMore: s } = O(d, {
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) => R(e.node)) ?? [],
259
+ data: c?.edges.map((e) => L(e.node)) ?? [],
260
260
  totalCount: c?.totalCount ?? 0,
261
- pageInfo: c?.pageInfo ? F(c.pageInfo) : null,
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 X(e) {
283
- let { workspaceId: t } = _(), { data: n, loading: r, error: i } = O(l, {
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 ? R(n.getExportTemplate) : null,
291
+ data: n?.getExportTemplate ? L(n.getExportTemplate) : null,
292
292
  isLoading: r,
293
293
  error: i ?? null
294
294
  };
295
295
  }
296
- function Z() {
297
- let e = _(), { workspaceId: n } = e, r = E(), i = b(), a = A(), [o, { loading: s, error: c }] = D(t), l = async (t) => {
298
- let { filters: s, ...c } = t, l = {
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 ? H(c.exportScope) : void 0,
301
- format: B(c.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: l
306
+ input: u
307
307
  },
308
308
  refetchQueries: [{
309
- query: u,
309
+ query: l,
310
310
  variables: { context: { workspaceId: n } }
311
311
  }]
312
312
  });
313
- if (!d.data) throw x(e, "export.api.failed", { operation: "createExportJob" }), Error("Failed to create export job");
314
- x(e, "export.job.created", { jobId: d.data.createExportJob.id });
315
- let f = L(d.data.createExportJob);
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
- y({
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?.(v(t, f.id))
323
+ onOpen: () => n?.(_(t, f.id))
324
324
  });
325
325
  }
326
326
  return f;
327
327
  };
328
328
  return {
329
- createJob: l,
330
- mutate: l,
331
- mutateAsync: l,
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 Q() {
338
- let t = _(), { workspaceId: n } = t, [r, { loading: i, error: a }] = D(e), o = async (e) => {
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: u,
345
+ query: l,
346
346
  variables: { context: { workspaceId: n } }
347
347
  }]
348
348
  });
349
- if (!i.data) throw x(t, "export.api.failed", {
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 x(t, "export.job.cancelled", { jobId: e }), i.data.cancelExportJob;
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 = _(), { workspaceId: t } = e, [n, { loading: i, error: a }] = D(r), o = async (r) => (await n({
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: u,
371
+ query: l,
372
372
  variables: { context: { workspaceId: t } }
373
373
  }]
374
- }), x(e, "export.job.deleted", { jobId: r }), !0);
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 ee() {
385
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = D(f);
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: u,
394
+ query: l,
395
395
  variables: { context: { workspaceId: t } }
396
396
  }]
397
397
  });
398
- if (!i.data) throw x(e, "export.api.failed", {
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 x(e, "export.job.retried", {
402
+ return b(e, "export.job.retried", {
403
403
  originalJobId: r,
404
404
  jobId: i.data.retryExportJob.id
405
- }), L(i.data.retryExportJob);
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 te() {
413
- let e = _(), { workspaceId: t } = e, [r, { loading: i, error: a }] = D(n);
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: B(n.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: d,
425
+ query: u,
426
426
  variables: { context: { workspaceId: t } }
427
427
  }]
428
428
  });
429
- if (!a.data) throw x(e, "export.api.failed", { operation: "createExportTemplate" }), Error("Failed to create export template");
430
- return x(e, "export.template.created", { templateId: a.data.createExportTemplate.id }), R(a.data.createExportTemplate);
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 ne() {
438
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: i }] = D(p);
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: B(i.format)
447
+ format: z(i.format)
448
448
  }
449
449
  },
450
450
  refetchQueries: [{
451
- query: d,
451
+ query: u,
452
452
  variables: { context: { workspaceId: t } }
453
453
  }]
454
454
  });
455
- if (!a.data) throw x(e, "export.api.failed", { operation: "updateExportTemplate" }), Error("Failed to update export template");
456
- return R(a.data.updateExportTemplate);
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 re() {
464
- let e = _(), { workspaceId: t } = e, [n, { loading: r, error: a }] = D(i);
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: d,
472
+ query: u,
473
473
  variables: { context: { workspaceId: t } }
474
474
  }]
475
- }), x(e, "export.template.deleted", { templateId: r }), !0),
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 ie(e, t = {}) {
482
- let { data: n, loading: r, error: i } = O(o, {
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 { L as mapJob, R as mapTemplate, K as uniqueByEntityType, J as useAvailableEntities, Q as useCancelExportJob, Z as useCreateExportJob, te as useCreateExportTemplate, $ as useDeleteExportJob, re as useDeleteExportTemplate, W as useExportJob, G as useExportJobProgress, U as useExportJobs, X as useExportTemplate, Y as useExportTemplates, ie as useOrganizationExportPermission, ee as useRetryExportJob, ne as useUpdateExportTemplate };
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