@burdenoff/microfe-bigconsole 2026.1119.10 → 2026.1121.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/bigconsole/components/explore/queryAccess/GrantsPanel.d.ts +10 -0
- package/dist/bigconsole/components/explore/queryAccess/GrantsPanel.js +470 -0
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.d.ts +5 -0
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.js +228 -0
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessEntry.d.ts +5 -0
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessEntry.js +39 -0
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.d.ts +11 -0
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.js +279 -0
- package/dist/bigconsole/components/explore/queryAccess/shared.d.ts +16 -0
- package/dist/bigconsole/components/explore/queryAccess/shared.js +26 -0
- package/dist/bigconsole/hooks/useQueryAccess.d.ts +50 -0
- package/dist/bigconsole/hooks/useQueryAccess.js +255 -0
- package/dist/bigconsole/pages/DataSinksPage.js +547 -542
- package/dist/bigconsole/utils/queryAccess.d.ts +169 -0
- package/dist/bigconsole/utils/queryAccess.js +345 -0
- package/dist/generated/wspace-operations.d.ts +177 -0
- package/dist/generated/wspace-operations.js +944 -78
- package/dist/generated/wspace-types.d.ts +2346 -13
- package/dist/generated/wspace-types.js +9 -7
- package/package.json +1 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { BigConsoleShareMemberIdentitiesDocument as e, BigConsoleShareMembersDocument as t, GetDataSinkDataDocument as n, ListDataSinksDocument as r, QueryAccessGrantsDocument as i, QueryAccessRegisterRelationDocument as a, QueryAccessRelationsDocument as o, QueryAccessRemoveRelationDocument as s, QueryAccessRevokeGrantDocument as c, QueryAccessSetGrantDocument as l } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { BigConsoleQueryFieldAccess as u } from "../../generated/wspace-types.js";
|
|
3
|
+
import { useApolloClient as d } from "@apollo/client/react";
|
|
4
|
+
import { useMutation as f, useQuery as p, useQueryClient as m } from "@tanstack/react-query";
|
|
5
|
+
// src/bigconsole/hooks/useQueryAccess.ts
|
|
6
|
+
function h(e) {
|
|
7
|
+
return e === "REDACT" ? u.Redact : u.Read;
|
|
8
|
+
}
|
|
9
|
+
var g = 20, _ = 100, v = 50;
|
|
10
|
+
function y(e) {
|
|
11
|
+
return {
|
|
12
|
+
requiredWorkspaceAuth: !0,
|
|
13
|
+
requiredWorkspaceId: e,
|
|
14
|
+
queryDeduplication: !1
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var b = {
|
|
18
|
+
all: (e) => [
|
|
19
|
+
"bigconsole",
|
|
20
|
+
"query-access",
|
|
21
|
+
e
|
|
22
|
+
],
|
|
23
|
+
relations: (e) => [
|
|
24
|
+
"bigconsole",
|
|
25
|
+
"query-access",
|
|
26
|
+
e,
|
|
27
|
+
"relations"
|
|
28
|
+
],
|
|
29
|
+
grants: (e, t) => [
|
|
30
|
+
"bigconsole",
|
|
31
|
+
"query-access",
|
|
32
|
+
e,
|
|
33
|
+
"grants",
|
|
34
|
+
t
|
|
35
|
+
],
|
|
36
|
+
sinks: (e) => [
|
|
37
|
+
"bigconsole",
|
|
38
|
+
"query-access",
|
|
39
|
+
e,
|
|
40
|
+
"sinks"
|
|
41
|
+
],
|
|
42
|
+
members: (e) => [
|
|
43
|
+
"bigconsole",
|
|
44
|
+
"query-access",
|
|
45
|
+
e,
|
|
46
|
+
"members"
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
async function x(e, t) {
|
|
50
|
+
let n = await e.query({
|
|
51
|
+
query: o,
|
|
52
|
+
fetchPolicy: "no-cache",
|
|
53
|
+
errorPolicy: "none",
|
|
54
|
+
context: y(t)
|
|
55
|
+
});
|
|
56
|
+
if (!n.data) throw Error("The query relations could not be loaded.");
|
|
57
|
+
return n.data.bigconsoleQueryRelations;
|
|
58
|
+
}
|
|
59
|
+
async function S(e, t, n) {
|
|
60
|
+
let r = await e.query({
|
|
61
|
+
query: i,
|
|
62
|
+
variables: { dataSinkId: n },
|
|
63
|
+
fetchPolicy: "no-cache",
|
|
64
|
+
errorPolicy: "none",
|
|
65
|
+
context: y(t)
|
|
66
|
+
});
|
|
67
|
+
if (!r.data) throw Error("The query grants could not be loaded.");
|
|
68
|
+
return r.data.bigconsoleQueryGrants;
|
|
69
|
+
}
|
|
70
|
+
async function C(e, t) {
|
|
71
|
+
let n = [], i;
|
|
72
|
+
for (let a = 0; a < g; a += 1) {
|
|
73
|
+
let a = (await e.query({
|
|
74
|
+
query: r,
|
|
75
|
+
variables: {
|
|
76
|
+
first: _,
|
|
77
|
+
after: i ?? void 0
|
|
78
|
+
},
|
|
79
|
+
fetchPolicy: "no-cache",
|
|
80
|
+
errorPolicy: "none",
|
|
81
|
+
context: y(t)
|
|
82
|
+
})).data?.listDataSinks;
|
|
83
|
+
if (!a) throw Error("The data sinks could not be loaded.");
|
|
84
|
+
for (let e of a.edges) e.node.deletedAt || n.push({
|
|
85
|
+
id: e.node.id,
|
|
86
|
+
name: e.node.name ?? e.node.key ?? e.node.id,
|
|
87
|
+
key: e.node.key
|
|
88
|
+
});
|
|
89
|
+
if (!a.pageInfo.hasNextPage || !a.pageInfo.endCursor) break;
|
|
90
|
+
i = a.pageInfo.endCursor;
|
|
91
|
+
}
|
|
92
|
+
return n;
|
|
93
|
+
}
|
|
94
|
+
async function w(n, r) {
|
|
95
|
+
let i = y(r), a = [];
|
|
96
|
+
for (let e = 0; e < g; e += 1) {
|
|
97
|
+
let o = (await n.query({
|
|
98
|
+
query: t,
|
|
99
|
+
variables: {
|
|
100
|
+
workspaceId: r,
|
|
101
|
+
offset: e * _
|
|
102
|
+
},
|
|
103
|
+
fetchPolicy: "no-cache",
|
|
104
|
+
errorPolicy: "none",
|
|
105
|
+
context: i
|
|
106
|
+
})).data?.workspaceMembers;
|
|
107
|
+
if (!o) throw Error("The workspace members could not be loaded.");
|
|
108
|
+
for (let e of o.items) e.workspaceId === r && e.status.toLowerCase() === "active" && a.push(e.userId);
|
|
109
|
+
if (!o.hasMore) break;
|
|
110
|
+
}
|
|
111
|
+
let o = [...new Set(a)], s = /* @__PURE__ */ new Map();
|
|
112
|
+
for (let t = 0; t < o.length; t += v) {
|
|
113
|
+
let a = await n.query({
|
|
114
|
+
query: e,
|
|
115
|
+
variables: {
|
|
116
|
+
workspaceId: r,
|
|
117
|
+
userIds: o.slice(t, t + v)
|
|
118
|
+
},
|
|
119
|
+
fetchPolicy: "no-cache",
|
|
120
|
+
errorPolicy: "none",
|
|
121
|
+
context: i
|
|
122
|
+
});
|
|
123
|
+
for (let e of a.data?.workspaceMemberIdentities ?? []) s.set(e.userId, {
|
|
124
|
+
displayName: e.displayName,
|
|
125
|
+
...e.email ? { email: e.email } : {}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return o.map((e) => {
|
|
129
|
+
let t = s.get(e);
|
|
130
|
+
return {
|
|
131
|
+
userId: e,
|
|
132
|
+
displayName: t?.displayName || e,
|
|
133
|
+
...t?.email ? { email: t.email } : {}
|
|
134
|
+
};
|
|
135
|
+
}).sort((e, t) => e.displayName.localeCompare(t.displayName));
|
|
136
|
+
}
|
|
137
|
+
async function T(e, t, r) {
|
|
138
|
+
let i = (await e.query({
|
|
139
|
+
query: n,
|
|
140
|
+
variables: {
|
|
141
|
+
id: r,
|
|
142
|
+
limit: 50,
|
|
143
|
+
offset: 0
|
|
144
|
+
},
|
|
145
|
+
fetchPolicy: "no-cache",
|
|
146
|
+
errorPolicy: "none",
|
|
147
|
+
context: y(t)
|
|
148
|
+
})).data?.getDataSinkData;
|
|
149
|
+
if (!i) throw Error("The data sink sample could not be loaded.");
|
|
150
|
+
return i.raw ?? i.extracted ?? null;
|
|
151
|
+
}
|
|
152
|
+
function E(e) {
|
|
153
|
+
let t = d();
|
|
154
|
+
return p({
|
|
155
|
+
queryKey: b.relations(e),
|
|
156
|
+
queryFn: () => x(t, e),
|
|
157
|
+
retry: !1
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function D(e) {
|
|
161
|
+
let t = d();
|
|
162
|
+
return p({
|
|
163
|
+
queryKey: b.sinks(e),
|
|
164
|
+
queryFn: () => C(t, e),
|
|
165
|
+
retry: !1
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function O(e, t) {
|
|
169
|
+
let n = d();
|
|
170
|
+
return p({
|
|
171
|
+
queryKey: b.grants(e, t ?? ""),
|
|
172
|
+
queryFn: () => S(n, e, t ?? ""),
|
|
173
|
+
enabled: !!t,
|
|
174
|
+
retry: !1
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function k(e, t) {
|
|
178
|
+
let n = d();
|
|
179
|
+
return p({
|
|
180
|
+
queryKey: b.members(e),
|
|
181
|
+
queryFn: () => w(n, e),
|
|
182
|
+
enabled: t,
|
|
183
|
+
staleTime: 6e4,
|
|
184
|
+
retry: !1
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function A(e) {
|
|
188
|
+
let t = d(), n = m(), r = y(e), i = (t) => Promise.all([n.invalidateQueries({ queryKey: b.relations(e) }), t ? n.invalidateQueries({ queryKey: b.grants(e, t) }) : Promise.resolve()]);
|
|
189
|
+
return {
|
|
190
|
+
register: f({
|
|
191
|
+
mutationFn: async ({ dataSinkId: e, input: n }) => {
|
|
192
|
+
let i = await t.mutate({
|
|
193
|
+
mutation: a,
|
|
194
|
+
variables: {
|
|
195
|
+
dataSinkId: e,
|
|
196
|
+
input: n
|
|
197
|
+
},
|
|
198
|
+
fetchPolicy: "no-cache",
|
|
199
|
+
errorPolicy: "none",
|
|
200
|
+
context: r
|
|
201
|
+
});
|
|
202
|
+
if (!i.data) throw Error("The relation could not be saved.");
|
|
203
|
+
return i.data.bigconsoleRegisterQueryRelation;
|
|
204
|
+
},
|
|
205
|
+
onSettled: (e, t, n) => i(n.dataSinkId)
|
|
206
|
+
}),
|
|
207
|
+
remove: f({
|
|
208
|
+
mutationFn: async ({ dataSinkId: e }) => (await t.mutate({
|
|
209
|
+
mutation: s,
|
|
210
|
+
variables: { dataSinkId: e },
|
|
211
|
+
fetchPolicy: "no-cache",
|
|
212
|
+
errorPolicy: "none",
|
|
213
|
+
context: r
|
|
214
|
+
})).data?.bigconsoleRemoveQueryRelation ?? !1,
|
|
215
|
+
onSettled: (e, t, n) => i(n.dataSinkId)
|
|
216
|
+
}),
|
|
217
|
+
setGrant: f({
|
|
218
|
+
mutationFn: async ({ dataSinkId: e, input: n }) => {
|
|
219
|
+
let i = await t.mutate({
|
|
220
|
+
mutation: l,
|
|
221
|
+
variables: {
|
|
222
|
+
dataSinkId: e,
|
|
223
|
+
input: {
|
|
224
|
+
...n,
|
|
225
|
+
fields: n.fields.map((e) => ({
|
|
226
|
+
fieldId: e.fieldId,
|
|
227
|
+
access: h(e.access)
|
|
228
|
+
}))
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
fetchPolicy: "no-cache",
|
|
232
|
+
errorPolicy: "none",
|
|
233
|
+
context: r
|
|
234
|
+
});
|
|
235
|
+
if (!i.data) throw Error("The grant could not be saved.");
|
|
236
|
+
return i.data.bigconsoleSetQueryGrant;
|
|
237
|
+
},
|
|
238
|
+
onSettled: (e, t, n) => i(n.dataSinkId)
|
|
239
|
+
}),
|
|
240
|
+
revokeGrant: f({
|
|
241
|
+
mutationFn: async ({ dataSinkId: e, actorId: n }) => (await t.mutate({
|
|
242
|
+
mutation: c,
|
|
243
|
+
variables: {
|
|
244
|
+
dataSinkId: e,
|
|
245
|
+
actorId: n
|
|
246
|
+
},
|
|
247
|
+
fetchPolicy: "no-cache",
|
|
248
|
+
errorPolicy: "none",
|
|
249
|
+
context: r
|
|
250
|
+
})).data?.bigconsoleRevokeQueryGrant ?? !1,
|
|
251
|
+
onSettled: (e, t, n) => i(n.dataSinkId)
|
|
252
|
+
})
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
export { h as apiFieldAccess, S as loadGrants, w as loadMembers, x as loadRelations, T as loadSinkSample, C as loadSinks, b as queryAccessKeys, A as useQueryAccessMutations, D as useQueryAccessSinks, O as useQueryGrants, E as useQueryRelations, k as useWorkspaceMemberDirectory };
|