@osdk/react 0.10.0-beta.9 → 0.10.0
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/CHANGELOG.md +99 -0
- package/build/browser/new/OsdkContext2.js +22 -2
- package/build/browser/new/OsdkContext2.js.map +1 -1
- package/build/browser/new/platform-apis/admin/useCbacBanner.js +63 -0
- package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -0
- package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
- package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
- package/build/browser/new/platform-apis/admin/useMarkingCategories.js +46 -0
- package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
- package/build/browser/new/platform-apis/admin/useMarkings.js +46 -0
- package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -0
- package/build/browser/new/platform-apis/admin/useUserMarkings.js +50 -0
- package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -0
- package/build/browser/new/useOsdkAction.js +3 -6
- package/build/browser/new/useOsdkAction.js.map +1 -1
- package/build/browser/new/useOsdkFunctions.js +137 -0
- package/build/browser/new/useOsdkFunctions.js.map +1 -0
- package/build/browser/new/useOsdkObject.js +6 -2
- package/build/browser/new/useOsdkObject.js.map +1 -1
- package/build/browser/new/useOsdkObjects.js +6 -2
- package/build/browser/new/useOsdkObjects.js.map +1 -1
- package/build/browser/public/experimental/admin.js +5 -0
- package/build/browser/public/experimental/admin.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +18 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -0
- package/build/cjs/chunk-2N32USW5.cjs +28 -0
- package/build/cjs/chunk-2N32USW5.cjs.map +1 -0
- package/build/cjs/chunk-R4FZ5MUH.cjs +34 -0
- package/build/cjs/chunk-R4FZ5MUH.cjs.map +1 -0
- package/build/cjs/{chunk-SVVMLSKN.cjs → chunk-ZUNR45SJ.cjs} +15 -4
- package/build/cjs/chunk-ZUNR45SJ.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/experimental/admin.cjs +154 -7
- package/build/cjs/public/experimental/admin.cjs.map +1 -1
- package/build/cjs/public/experimental/admin.d.cts +159 -2
- package/build/cjs/public/experimental.cjs +42 -36
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +12 -121
- package/build/cjs/public/unstable-do-not-use.cjs +114 -0
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
- package/build/cjs/public/unstable-do-not-use.d.cts +35 -0
- package/build/cjs/useOsdkFunction-B0s7lqgN.d.cts +121 -0
- package/build/esm/new/OsdkContext2.js +22 -2
- package/build/esm/new/OsdkContext2.js.map +1 -1
- package/build/esm/new/platform-apis/admin/useCbacBanner.js +63 -0
- package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
- package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useMarkingCategories.js +46 -0
- package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useMarkings.js +46 -0
- package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useUserMarkings.js +50 -0
- package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -0
- package/build/esm/new/useOsdkAction.js +3 -6
- package/build/esm/new/useOsdkAction.js.map +1 -1
- package/build/esm/new/useOsdkFunctions.js +137 -0
- package/build/esm/new/useOsdkFunctions.js.map +1 -0
- package/build/esm/new/useOsdkObject.js +6 -2
- package/build/esm/new/useOsdkObject.js.map +1 -1
- package/build/esm/new/useOsdkObjects.js +6 -2
- package/build/esm/new/useOsdkObjects.js.map +1 -1
- package/build/esm/public/experimental/admin.js +5 -0
- package/build/esm/public/experimental/admin.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +18 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -0
- package/build/types/new/OsdkContext2.d.ts +1 -0
- package/build/types/new/OsdkContext2.d.ts.map +1 -1
- package/build/types/new/platform-apis/admin/useCbacBanner.d.ts +33 -0
- package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts +34 -0
- package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts +27 -0
- package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useMarkings.d.ts +27 -0
- package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useUserMarkings.d.ts +33 -0
- package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -0
- package/build/types/new/useOsdkFunctions.d.ts +31 -0
- package/build/types/new/useOsdkFunctions.d.ts.map +1 -0
- package/build/types/new/useOsdkObject.d.ts +2 -1
- package/build/types/new/useOsdkObject.d.ts.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +6 -0
- package/build/types/new/useOsdkObjects.d.ts.map +1 -1
- package/build/types/public/experimental/admin.d.ts +8 -0
- package/build/types/public/experimental/admin.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +2 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
- package/package.json +19 -10
- package/unstable-do-not-use.d.ts +17 -0
- package/build/cjs/chunk-OVBG5VXE.cjs +0 -50
- package/build/cjs/chunk-OVBG5VXE.cjs.map +0 -1
- package/build/cjs/chunk-SVVMLSKN.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZUNR45SJ_cjs = require('../../chunk-ZUNR45SJ.cjs');
|
|
4
4
|
var foundry_admin = require('@osdk/foundry.admin');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
@@ -35,12 +35,12 @@ function usePlatformQuery({
|
|
|
35
35
|
getSnapShot
|
|
36
36
|
} = React__default.default.useMemo(() => {
|
|
37
37
|
if (!enabled) {
|
|
38
|
-
return
|
|
38
|
+
return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
|
|
39
39
|
unsubscribe: () => {
|
|
40
40
|
}
|
|
41
41
|
}), process.env.NODE_ENV !== "production" ? `${queryName} Query [DISABLED]` : void 0);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return chunkZUNR45SJ_cjs.makeExternalStore((observer) => {
|
|
44
44
|
observerRef.current = observer;
|
|
45
45
|
handleQuery();
|
|
46
46
|
return {
|
|
@@ -65,13 +65,90 @@ function usePlatformQuery({
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
// src/new/platform-apis/admin/
|
|
68
|
+
// src/new/platform-apis/admin/useCbacBanner.ts
|
|
69
|
+
function useCbacBanner({
|
|
70
|
+
markingIds,
|
|
71
|
+
enabled: externalEnabled = true
|
|
72
|
+
}) {
|
|
73
|
+
const {
|
|
74
|
+
client
|
|
75
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
76
|
+
const stableMarkingIds = React__default.default.useMemo(() => markingIds, [JSON.stringify(markingIds)]);
|
|
77
|
+
const enabled = stableMarkingIds.length > 0 && externalEnabled;
|
|
78
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
79
|
+
return foundry_admin.CbacBanners.get(client, {
|
|
80
|
+
markingIds: stableMarkingIds,
|
|
81
|
+
preview: true
|
|
82
|
+
});
|
|
83
|
+
}, [client, stableMarkingIds]);
|
|
84
|
+
const query = usePlatformQuery({
|
|
85
|
+
query: handleQuery,
|
|
86
|
+
enabled,
|
|
87
|
+
queryName: "cbac-banner"
|
|
88
|
+
});
|
|
89
|
+
const banner = React__default.default.useMemo(() => {
|
|
90
|
+
if (query.data == null) {
|
|
91
|
+
return void 0;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
classificationString: query.data.classificationString,
|
|
95
|
+
textColor: query.data.textColor,
|
|
96
|
+
backgroundColors: query.data.backgroundColors,
|
|
97
|
+
markingIds: query.data.markings
|
|
98
|
+
};
|
|
99
|
+
}, [query.data]);
|
|
100
|
+
return {
|
|
101
|
+
banner,
|
|
102
|
+
isLoading: query.isLoading,
|
|
103
|
+
error: query.error,
|
|
104
|
+
refetch: query.refetch
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function useCbacMarkingRestrictions({
|
|
108
|
+
markingIds,
|
|
109
|
+
enabled: externalEnabled = true
|
|
110
|
+
}) {
|
|
111
|
+
const {
|
|
112
|
+
client
|
|
113
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
114
|
+
const stableMarkingIds = React__default.default.useMemo(() => markingIds, [JSON.stringify(markingIds)]);
|
|
115
|
+
const enabled = stableMarkingIds.length > 0 && externalEnabled;
|
|
116
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
117
|
+
return foundry_admin.CbacMarkingRestrictionsObjects.get(client, {
|
|
118
|
+
markingIds: stableMarkingIds,
|
|
119
|
+
preview: true
|
|
120
|
+
});
|
|
121
|
+
}, [client, stableMarkingIds]);
|
|
122
|
+
const query = usePlatformQuery({
|
|
123
|
+
query: handleQuery,
|
|
124
|
+
enabled,
|
|
125
|
+
queryName: "cbac-marking-restrictions"
|
|
126
|
+
});
|
|
127
|
+
const restrictions = React__default.default.useMemo(() => {
|
|
128
|
+
if (query.data == null) {
|
|
129
|
+
return void 0;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
disallowedMarkings: query.data.disallowedMarkings.map(String),
|
|
133
|
+
impliedMarkings: query.data.impliedMarkings.map(String),
|
|
134
|
+
requiredMarkings: query.data.requiredMarkings.map((group) => group.map(String)),
|
|
135
|
+
userSatisfiesMarkings: query.data.userSatisfiesMarkings,
|
|
136
|
+
isValid: query.data.isValid
|
|
137
|
+
};
|
|
138
|
+
}, [query.data]);
|
|
139
|
+
return {
|
|
140
|
+
restrictions,
|
|
141
|
+
isLoading: query.isLoading,
|
|
142
|
+
error: query.error,
|
|
143
|
+
refetch: query.refetch
|
|
144
|
+
};
|
|
145
|
+
}
|
|
69
146
|
function useCurrentFoundryUser({
|
|
70
147
|
enabled = true
|
|
71
148
|
} = {}) {
|
|
72
149
|
const {
|
|
73
150
|
client
|
|
74
|
-
} = React__default.default.useContext(
|
|
151
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
75
152
|
const handleQuery = React__default.default.useCallback(() => foundry_admin.Users.getCurrent(client), [client]);
|
|
76
153
|
const query = usePlatformQuery({
|
|
77
154
|
query: handleQuery,
|
|
@@ -91,7 +168,7 @@ function useFoundryUser(userId, {
|
|
|
91
168
|
} = {}) {
|
|
92
169
|
const {
|
|
93
170
|
client
|
|
94
|
-
} = React__default.default.useContext(
|
|
171
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
95
172
|
const handleQuery = React__default.default.useCallback(() => {
|
|
96
173
|
return foundry_admin.Users.get(client, userId, {
|
|
97
174
|
status
|
|
@@ -117,7 +194,7 @@ function useFoundryUsersList({
|
|
|
117
194
|
} = {}) {
|
|
118
195
|
const {
|
|
119
196
|
client
|
|
120
|
-
} = React__default.default.useContext(
|
|
197
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
121
198
|
const handleQuery = React__default.default.useCallback(() => {
|
|
122
199
|
return foundry_admin.Users.list(client, {
|
|
123
200
|
include,
|
|
@@ -138,9 +215,79 @@ function useFoundryUsersList({
|
|
|
138
215
|
refetch: query.refetch
|
|
139
216
|
};
|
|
140
217
|
}
|
|
218
|
+
function useMarkingCategories({
|
|
219
|
+
enabled = true
|
|
220
|
+
} = {}) {
|
|
221
|
+
const {
|
|
222
|
+
client
|
|
223
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
224
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
225
|
+
return foundry_admin.MarkingCategories.list(client);
|
|
226
|
+
}, [client]);
|
|
227
|
+
const query = usePlatformQuery({
|
|
228
|
+
query: handleQuery,
|
|
229
|
+
enabled,
|
|
230
|
+
queryName: "marking-categories"
|
|
231
|
+
});
|
|
232
|
+
return {
|
|
233
|
+
categories: query.data?.data,
|
|
234
|
+
isLoading: query.isLoading,
|
|
235
|
+
error: query.error,
|
|
236
|
+
refetch: query.refetch
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function useMarkings({
|
|
240
|
+
enabled = true
|
|
241
|
+
} = {}) {
|
|
242
|
+
const {
|
|
243
|
+
client
|
|
244
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
245
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
246
|
+
return foundry_admin.Markings.list(client);
|
|
247
|
+
}, [client]);
|
|
248
|
+
const query = usePlatformQuery({
|
|
249
|
+
query: handleQuery,
|
|
250
|
+
enabled,
|
|
251
|
+
queryName: "markings"
|
|
252
|
+
});
|
|
253
|
+
return {
|
|
254
|
+
markings: query.data?.data,
|
|
255
|
+
isLoading: query.isLoading,
|
|
256
|
+
error: query.error,
|
|
257
|
+
refetch: query.refetch
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function useUserViewMarkings({
|
|
261
|
+
userId,
|
|
262
|
+
enabled = true
|
|
263
|
+
} = {}) {
|
|
264
|
+
const {
|
|
265
|
+
client
|
|
266
|
+
} = React__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
|
|
267
|
+
const handleQuery = React__default.default.useCallback(async () => {
|
|
268
|
+
const resolvedUserId = userId ?? (await foundry_admin.Users.getCurrent(client)).id;
|
|
269
|
+
return foundry_admin.Users.getMarkings(client, resolvedUserId);
|
|
270
|
+
}, [client, userId]);
|
|
271
|
+
const query = usePlatformQuery({
|
|
272
|
+
query: handleQuery,
|
|
273
|
+
enabled,
|
|
274
|
+
queryName: "user-view-markings"
|
|
275
|
+
});
|
|
276
|
+
return {
|
|
277
|
+
markingIds: query.data?.view,
|
|
278
|
+
isLoading: query.isLoading,
|
|
279
|
+
error: query.error,
|
|
280
|
+
refetch: query.refetch
|
|
281
|
+
};
|
|
282
|
+
}
|
|
141
283
|
|
|
284
|
+
exports.useCbacBanner = useCbacBanner;
|
|
285
|
+
exports.useCbacMarkingRestrictions = useCbacMarkingRestrictions;
|
|
142
286
|
exports.useCurrentFoundryUser = useCurrentFoundryUser;
|
|
143
287
|
exports.useFoundryUser = useFoundryUser;
|
|
144
288
|
exports.useFoundryUsersList = useFoundryUsersList;
|
|
289
|
+
exports.useMarkingCategories = useMarkingCategories;
|
|
290
|
+
exports.useMarkings = useMarkings;
|
|
291
|
+
exports.useUserViewMarkings = useUserViewMarkings;
|
|
145
292
|
//# sourceMappingURL=admin.cjs.map
|
|
146
293
|
//# sourceMappingURL=admin.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/usePlatformQuery.ts","../../../../src/new/platform-apis/admin/useCurrentFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUsersList.ts"],"names":["React","makeExternalStore","OsdkContext2","Users"],"mappings":";;;;;;;;;;AAkBO,SAAS,gBAAiB,CAAA;AAAA,EAC/B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAU,GAAA;AACZ,CAAG,EAAA;AACD,EAAM,MAAA,WAAA,GAAcA,uBAAM,MAAO,EAAA;AACjC,EAAM,MAAA,WAAA,GAAcA,sBAAM,CAAA,WAAA,CAAY,MAAM;AAC1C,IAAA,MAAM,WAAW,WAAY,CAAA,OAAA;AAC7B,IAAA,IAAI,YAAY,IAAM,EAAA;AACtB,IAAA,QAAA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IACjB,OAAO,KAAM,CAAA,KAAA;AAAA,IACb,SAAS,KAAM,CAAA;AAAA,GACjB;AACF","file":"admin.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"../new/makeExternalStore.js\";\nexport function usePlatformQuery({\n query,\n queryName,\n enabled = true\n}) {\n const observerRef = React.useRef();\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n observer.next({\n status: \"loading\",\n data: undefined\n });\n query().then(data => {\n observer.next({\n status: \"success\",\n data\n });\n }).catch(err => {\n observer.error(err);\n });\n }, [query]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `${queryName} Query [DISABLED]` : undefined);\n }\n return makeExternalStore(observer => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n }\n };\n }, queryName);\n }, [enabled, queryName, handleQuery]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n let error;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the currently signed in User.\n * @param options Options to control the query.\n */\nexport function useCurrentFoundryUser({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => Users.getCurrent(client), [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-current-user\"\n });\n return {\n currentUser: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the User with the specified id.\n * @param userId A Foundry User ID.\n * @param options Options to control the query.\n */\nexport function useFoundryUser(userId, {\n enabled = true,\n status = \"ACTIVE\"\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.get(client, userId, {\n status\n });\n }, [client, userId, status]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-user\"\n });\n return {\n user: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.\n * @param options Options to control the query.\n */\nexport function useFoundryUsersList({\n enabled = true,\n include = \"ACTIVE\",\n pageSize = 1000,\n pageToken\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.list(client, {\n include,\n pageSize,\n pageToken\n });\n }, [client, include, pageSize, pageToken]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-users-list\"\n });\n return {\n users: query.data?.data,\n nextPageToken: query.data?.nextPageToken,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/usePlatformQuery.ts","../../../../src/new/platform-apis/admin/useCbacBanner.ts","../../../../src/new/platform-apis/admin/useCbacMarkingRestrictions.ts","../../../../src/new/platform-apis/admin/useCurrentFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUser.ts","../../../../src/new/platform-apis/admin/useFoundryUsersList.ts","../../../../src/new/platform-apis/admin/useMarkingCategories.ts","../../../../src/new/platform-apis/admin/useMarkings.ts","../../../../src/new/platform-apis/admin/useUserMarkings.ts"],"names":["React","makeExternalStore","OsdkContext2","CbacBanners","CbacMarkingRestrictionsObjects","Users","MarkingCategories","Markings"],"mappings":";;;;;;;;;;AAkBO,SAAS,gBAAiB,CAAA;AAAA,EAC/B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAU,GAAA;AACZ,CAAG,EAAA;AACD,EAAM,MAAA,WAAA,GAAcA,uBAAM,MAAO,EAAA;AACjC,EAAM,MAAA,WAAA,GAAcA,sBAAM,CAAA,WAAA,CAAY,MAAM;AAC1C,IAAA,MAAM,WAAW,WAAY,CAAA,OAAA;AAC7B,IAAA,IAAI,YAAY,IAAM,EAAA;AACtB,IAAA,QAAA,CAAS,IAAK,CAAA;AAAA,MACZ,MAAQ,EAAA,SAAA;AAAA,MACR,IAAM,EAAA;AAAA,KACP,CAAA;AACD,IAAM,KAAA,EAAA,CAAE,KAAK,CAAQ,IAAA,KAAA;AACnB,MAAA,QAAA,CAAS,IAAK,CAAA;AAAA,QACZ,MAAQ,EAAA,SAAA;AAAA,QACR;AAAA,OACD,CAAA;AAAA,KACF,CAAE,CAAA,KAAA,CAAM,CAAO,GAAA,KAAA;AACd,MAAA,QAAA,CAAS,MAAM,GAAG,CAAA;AAAA,KACnB,CAAA;AAAA,GACH,EAAG,CAAC,KAAK,CAAC,CAAA;AACV,EAAM,MAAA;AAAA,IACJ,SAAA;AAAA,IACA;AAAA,GACF,GAAIA,sBAAM,CAAA,OAAA,CAAQ,MAAM;AACtB,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAOC,oCAAkB,OAAO;AAAA,QAC9B,aAAa,MAAM;AAAA;AAAC,OACtB,CAAA,EAAI,QAAQ,GAAI,CAAA,QAAA,KAAa,eAAe,CAAG,EAAA,SAAS,sBAAsB,MAAS,CAAA;AAAA;AAEzF,IAAA,OAAOA,oCAAkB,CAAY,QAAA,KAAA;AACnC,MAAA,WAAA,C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,MAAM,iBAAiB,MAAW,IAAA,CAAA,MAAMK,mBAAM,CAAA,UAAA,CAAW,MAAM,CAAG,EAAA,EAAA;AAClE,IAAOA,OAAAA,mBAAAA,CAAM,WAAY,CAAA,MAAA,EAAQ,cAAc,CAAA;AAAA,GAC9C,EAAA,CAAC,MAAQ,EAAA,MAAM,CAAC,CAAA;AACnB,EAAA,MAAM,QAAQ,gBAAiB,CAAA;AAAA,IAC7B,KAAO,EAAA,WAAA;AAAA,IACP,OAAA;AAAA,IACA,SAAW,EAAA;AAAA,GACZ,CAAA;AACD,EAAO,OAAA;AAAA,IACL,UAAA,EAAY,MAAM,IAAM,EAAA,IAAA;AAAA,IACxB,WAAW,KAAM,CAAA,SAAA;AAAA,IACjB,OAAO,KAAM,CAAA,KAAA;AAAA,IACb,SAAS,KAAM,CAAA;AAAA,GACjB;AACF","file":"admin.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"../new/makeExternalStore.js\";\nexport function usePlatformQuery({\n query,\n queryName,\n enabled = true\n}) {\n const observerRef = React.useRef();\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n observer.next({\n status: \"loading\",\n data: undefined\n });\n query().then(data => {\n observer.next({\n status: \"success\",\n data\n });\n }).catch(err => {\n observer.error(err);\n });\n }, [query]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `${queryName} Query [DISABLED]` : undefined);\n }\n return makeExternalStore(observer => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n }\n };\n }, queryName);\n }, [enabled, queryName, handleQuery]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n let error;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacBanners } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the CBAC banner data for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacBanner({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacBanners.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-banner\"\n });\n const banner = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n classificationString: query.data.classificationString,\n textColor: query.data.textColor,\n backgroundColors: query.data.backgroundColors,\n markingIds: query.data.markings\n };\n }, [query.data]);\n return {\n banner,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacMarkingRestrictionsObjects } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacMarkingRestrictions({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacMarkingRestrictionsObjects.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-marking-restrictions\"\n });\n const restrictions = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n disallowedMarkings: query.data.disallowedMarkings.map(String),\n impliedMarkings: query.data.impliedMarkings.map(String),\n requiredMarkings: query.data.requiredMarkings.map(group => group.map(String)),\n userSatisfiesMarkings: query.data.userSatisfiesMarkings,\n isValid: query.data.isValid\n };\n }, [query.data]);\n return {\n restrictions,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the currently signed in User.\n * @param options Options to control the query.\n */\nexport function useCurrentFoundryUser({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => Users.getCurrent(client), [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-current-user\"\n });\n return {\n currentUser: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get the User with the specified id.\n * @param userId A Foundry User ID.\n * @param options Options to control the query.\n */\nexport function useFoundryUser(userId, {\n enabled = true,\n status = \"ACTIVE\"\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.get(client, userId, {\n status\n });\n }, [client, userId, status]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-user\"\n });\n return {\n user: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.\n * @param options Options to control the query.\n */\nexport function useFoundryUsersList({\n enabled = true,\n include = \"ACTIVE\",\n pageSize = 1000,\n pageToken\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Users.list(client, {\n include,\n pageSize,\n pageToken\n });\n }, [client, include, pageSize, pageToken]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-users-list\"\n });\n return {\n users: query.data?.data,\n nextPageToken: query.data?.nextPageToken,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkingCategories } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * List all marking categories.\n * @param options Options to control the query.\n */\nexport function useMarkingCategories({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return MarkingCategories.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"marking-categories\"\n });\n return {\n categories: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Markings } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * List all markings.\n * @param options Options to control the query.\n */\nexport function useMarkings({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(() => {\n return Markings.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"markings\"\n });\n return {\n markings: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n/**\n * Get view-accessible markings for a user.\n * When `userId` is provided, fetches markings for that user.\n * When omitted, fetches markings for the current user.\n * @param options Options to control the query.\n */\nexport function useUserViewMarkings({\n userId,\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext2);\n const handleQuery = React.useCallback(async () => {\n const resolvedUserId = userId ?? (await Users.getCurrent(client)).id;\n return Users.getMarkings(client, resolvedUserId);\n }, [client, userId]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"user-view-markings\"\n });\n return {\n markingIds: query.data?.view,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}"]}
|
|
@@ -1,6 +1,75 @@
|
|
|
1
|
-
import { User, ListUsersResponse } from '@osdk/foundry.admin';
|
|
1
|
+
import { User, ListUsersResponse, MarkingCategory, Marking } from '@osdk/foundry.admin';
|
|
2
2
|
import { UserStatus } from '@osdk/foundry.core';
|
|
3
3
|
|
|
4
|
+
interface CbacBannerData {
|
|
5
|
+
classificationString: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
backgroundColors: string[];
|
|
8
|
+
markingIds: string[];
|
|
9
|
+
}
|
|
10
|
+
interface UseCbacBannerOptions {
|
|
11
|
+
markingIds: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Enable or disable the query.
|
|
14
|
+
*
|
|
15
|
+
* When `false`, the query will not automatically execute.
|
|
16
|
+
*
|
|
17
|
+
* This is useful for:
|
|
18
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
19
|
+
* - Dependent queries that need data from another query first
|
|
20
|
+
* - Conditional queries based on component state
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface UseCbacBannerResult {
|
|
27
|
+
banner: CbacBannerData | undefined;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
error: Error | undefined;
|
|
30
|
+
refetch: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the CBAC banner data for the given marking IDs.
|
|
34
|
+
* @param options Options to control the query.
|
|
35
|
+
*/
|
|
36
|
+
declare function useCbacBanner({ markingIds, enabled: externalEnabled }: UseCbacBannerOptions): UseCbacBannerResult;
|
|
37
|
+
|
|
38
|
+
interface CbacMarkingRestrictionsData {
|
|
39
|
+
disallowedMarkings: string[];
|
|
40
|
+
impliedMarkings: string[];
|
|
41
|
+
requiredMarkings: string[][];
|
|
42
|
+
userSatisfiesMarkings: boolean;
|
|
43
|
+
isValid: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface UseCbacMarkingRestrictionsOptions {
|
|
46
|
+
markingIds: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Enable or disable the query.
|
|
49
|
+
*
|
|
50
|
+
* When `false`, the query will not automatically execute.
|
|
51
|
+
*
|
|
52
|
+
* This is useful for:
|
|
53
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
54
|
+
* - Dependent queries that need data from another query first
|
|
55
|
+
* - Conditional queries based on component state
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface UseCbacMarkingRestrictionsResult {
|
|
62
|
+
restrictions: CbacMarkingRestrictionsData | undefined;
|
|
63
|
+
isLoading: boolean;
|
|
64
|
+
error: Error | undefined;
|
|
65
|
+
refetch: () => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.
|
|
69
|
+
* @param options Options to control the query.
|
|
70
|
+
*/
|
|
71
|
+
declare function useCbacMarkingRestrictions({ markingIds, enabled: externalEnabled }: UseCbacMarkingRestrictionsOptions): UseCbacMarkingRestrictionsResult;
|
|
72
|
+
|
|
4
73
|
interface UseCurrentFoundryUserOptions {
|
|
5
74
|
/**
|
|
6
75
|
* Enable or disable the query.
|
|
@@ -115,4 +184,92 @@ interface UseFoundryUsersListResult {
|
|
|
115
184
|
*/
|
|
116
185
|
declare function useFoundryUsersList({ enabled, include, pageSize, pageToken }?: UseFoundryUsersListOptions): UseFoundryUsersListResult;
|
|
117
186
|
|
|
118
|
-
|
|
187
|
+
interface UseMarkingCategoriesOptions {
|
|
188
|
+
/**
|
|
189
|
+
* Enable or disable the query.
|
|
190
|
+
*
|
|
191
|
+
* When `false`, the query will not automatically execute.
|
|
192
|
+
*
|
|
193
|
+
* This is useful for:
|
|
194
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
195
|
+
* - Dependent queries that need data from another query first
|
|
196
|
+
* - Conditional queries based on component state
|
|
197
|
+
*
|
|
198
|
+
* @default true
|
|
199
|
+
*/
|
|
200
|
+
enabled?: boolean;
|
|
201
|
+
}
|
|
202
|
+
interface UseMarkingCategoriesResult {
|
|
203
|
+
categories: MarkingCategory[] | undefined;
|
|
204
|
+
isLoading: boolean;
|
|
205
|
+
error: Error | undefined;
|
|
206
|
+
refetch: () => void;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* List all marking categories.
|
|
210
|
+
* @param options Options to control the query.
|
|
211
|
+
*/
|
|
212
|
+
declare function useMarkingCategories({ enabled }?: UseMarkingCategoriesOptions): UseMarkingCategoriesResult;
|
|
213
|
+
|
|
214
|
+
interface UseMarkingsOptions {
|
|
215
|
+
/**
|
|
216
|
+
* Enable or disable the query.
|
|
217
|
+
*
|
|
218
|
+
* When `false`, the query will not automatically execute.
|
|
219
|
+
*
|
|
220
|
+
* This is useful for:
|
|
221
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
222
|
+
* - Dependent queries that need data from another query first
|
|
223
|
+
* - Conditional queries based on component state
|
|
224
|
+
*
|
|
225
|
+
* @default true
|
|
226
|
+
*/
|
|
227
|
+
enabled?: boolean;
|
|
228
|
+
}
|
|
229
|
+
interface UseMarkingsResult {
|
|
230
|
+
markings: Marking[] | undefined;
|
|
231
|
+
isLoading: boolean;
|
|
232
|
+
error: Error | undefined;
|
|
233
|
+
refetch: () => void;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* List all markings.
|
|
237
|
+
* @param options Options to control the query.
|
|
238
|
+
*/
|
|
239
|
+
declare function useMarkings({ enabled }?: UseMarkingsOptions): UseMarkingsResult;
|
|
240
|
+
|
|
241
|
+
interface UseUserViewMarkingsOptions {
|
|
242
|
+
/**
|
|
243
|
+
* The user ID to fetch view markings for.
|
|
244
|
+
* When omitted, fetches markings for the current user.
|
|
245
|
+
*/
|
|
246
|
+
userId?: string;
|
|
247
|
+
/**
|
|
248
|
+
* Enable or disable the query.
|
|
249
|
+
*
|
|
250
|
+
* When `false`, the query will not automatically execute.
|
|
251
|
+
*
|
|
252
|
+
* This is useful for:
|
|
253
|
+
* - Lazy/on-demand queries that should wait for user interaction
|
|
254
|
+
* - Dependent queries that need data from another query first
|
|
255
|
+
* - Conditional queries based on component state
|
|
256
|
+
*
|
|
257
|
+
* @default true
|
|
258
|
+
*/
|
|
259
|
+
enabled?: boolean;
|
|
260
|
+
}
|
|
261
|
+
interface UseUserViewMarkingsResult {
|
|
262
|
+
markingIds: string[] | undefined;
|
|
263
|
+
isLoading: boolean;
|
|
264
|
+
error: Error | undefined;
|
|
265
|
+
refetch: () => void;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Get view-accessible markings for a user.
|
|
269
|
+
* When `userId` is provided, fetches markings for that user.
|
|
270
|
+
* When omitted, fetches markings for the current user.
|
|
271
|
+
* @param options Options to control the query.
|
|
272
|
+
*/
|
|
273
|
+
declare function useUserViewMarkings({ userId, enabled }?: UseUserViewMarkingsOptions): UseUserViewMarkingsResult;
|
|
274
|
+
|
|
275
|
+
export { type CbacBannerData, type CbacMarkingRestrictionsData, type UseCbacBannerOptions, type UseCbacBannerResult, type UseCbacMarkingRestrictionsOptions, type UseCbacMarkingRestrictionsResult, type UseUserViewMarkingsOptions, type UseUserViewMarkingsResult, useCbacBanner, useCbacMarkingRestrictions, useCurrentFoundryUser, useFoundryUser, useFoundryUsersList, useMarkingCategories, useMarkings, useUserViewMarkings };
|