@osdk/react 0.10.0-beta.1 → 0.10.0-beta.11
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/AGENTS.md +46 -221
- package/CHANGELOG.md +147 -0
- package/build/browser/new/makeExternalStore.js +61 -0
- package/build/browser/new/makeExternalStore.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/useLinks.js +11 -4
- package/build/browser/new/useLinks.js.map +1 -1
- package/build/browser/new/useObjectSet.js +42 -18
- package/build/browser/new/useObjectSet.js.map +1 -1
- package/build/browser/new/useOsdkAction.js +2 -2
- package/build/browser/new/useOsdkAction.js.map +1 -1
- package/build/browser/new/useOsdkAggregation.js +65 -27
- package/build/browser/new/useOsdkAggregation.js.map +1 -1
- package/build/browser/new/useOsdkFunction.js +17 -12
- package/build/browser/new/useOsdkFunction.js.map +1 -1
- package/build/browser/new/useOsdkObject.js +48 -26
- package/build/browser/new/useOsdkObject.js.map +1 -1
- package/build/browser/new/useOsdkObjects.js +32 -19
- package/build/browser/new/useOsdkObjects.js.map +1 -1
- package/build/browser/public/experimental/admin.js +25 -0
- package/build/browser/public/experimental/admin.js.map +1 -0
- package/build/browser/public/experimental.js +0 -3
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/useOsdkMetadata.js.map +1 -1
- package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
- package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
- package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
- package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
- package/build/cjs/index.cjs +4 -4
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/experimental/admin.cjs +293 -0
- package/build/cjs/public/experimental/admin.cjs.map +1 -0
- package/build/cjs/public/experimental/admin.d.cts +275 -0
- package/build/cjs/public/experimental.cjs +261 -492
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +113 -138
- package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
- package/build/esm/new/makeExternalStore.js +61 -0
- package/build/esm/new/makeExternalStore.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/useLinks.js +11 -4
- package/build/esm/new/useLinks.js.map +1 -1
- package/build/esm/new/useObjectSet.js +42 -18
- package/build/esm/new/useObjectSet.js.map +1 -1
- package/build/esm/new/useOsdkAction.js +2 -2
- package/build/esm/new/useOsdkAction.js.map +1 -1
- package/build/esm/new/useOsdkAggregation.js +65 -27
- package/build/esm/new/useOsdkAggregation.js.map +1 -1
- package/build/esm/new/useOsdkFunction.js +17 -12
- package/build/esm/new/useOsdkFunction.js.map +1 -1
- package/build/esm/new/useOsdkObject.js +48 -26
- package/build/esm/new/useOsdkObject.js.map +1 -1
- package/build/esm/new/useOsdkObjects.js +32 -19
- package/build/esm/new/useOsdkObjects.js.map +1 -1
- package/build/esm/public/experimental/admin.js +25 -0
- package/build/esm/public/experimental/admin.js.map +1 -0
- package/build/esm/public/experimental.js +0 -3
- package/build/esm/public/experimental.js.map +1 -1
- package/build/esm/useOsdkMetadata.js.map +1 -1
- package/build/types/new/makeExternalStore.d.ts +11 -0
- package/build/types/new/makeExternalStore.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/useLinks.d.ts +19 -0
- package/build/types/new/useLinks.d.ts.map +1 -1
- package/build/types/new/useObjectSet.d.ts +10 -4
- package/build/types/new/useObjectSet.d.ts.map +1 -1
- package/build/types/new/useOsdkAggregation.d.ts +41 -3
- package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
- package/build/types/new/useOsdkFunction.d.ts +11 -5
- package/build/types/new/useOsdkFunction.d.ts.map +1 -1
- package/build/types/new/useOsdkObject.d.ts +19 -7
- package/build/types/new/useOsdkObject.d.ts.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +32 -2
- package/build/types/new/useOsdkObjects.d.ts.map +1 -1
- package/build/types/public/experimental/admin.d.ts +11 -0
- package/build/types/public/experimental/admin.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +0 -3
- package/build/types/public/experimental.d.ts.map +1 -1
- package/build/types/useOsdkMetadata.d.ts +5 -4
- package/build/types/useOsdkMetadata.d.ts.map +1 -1
- package/docs/querying-data.md +19 -0
- package/{build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js → experimental/admin.d.ts} +1 -19
- package/package.json +28 -7
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
- package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
- package/build/browser/intellisense.test.js +0 -148
- package/build/browser/intellisense.test.js.map +0 -1
- package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
- package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js +0 -35
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
- package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
- package/build/esm/intellisense.test.js +0 -148
- package/build/esm/intellisense.test.js.map +0 -1
- package/build/types/intellisense.test.d.ts +0 -1
- package/build/types/intellisense.test.d.ts.map +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
- package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { useCbacBanner } from "../../new/platform-apis/admin/useCbacBanner.js";
|
|
18
|
+
export { useCbacMarkingRestrictions } from "../../new/platform-apis/admin/useCbacMarkingRestrictions.js";
|
|
19
|
+
export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
|
|
20
|
+
export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
|
|
21
|
+
export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
|
|
22
|
+
export { useMarkingCategories } from "../../new/platform-apis/admin/useMarkingCategories.js";
|
|
23
|
+
export { useMarkings } from "../../new/platform-apis/admin/useMarkings.js";
|
|
24
|
+
export { useUserViewMarkings } from "../../new/platform-apis/admin/useUserMarkings.js";
|
|
25
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","names":["useCbacBanner","useCbacMarkingRestrictions","useCurrentFoundryUser","useFoundryUser","useFoundryUsersList","useMarkingCategories","useMarkings","useUserViewMarkings"],"sources":["admin.ts"],"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\nexport { useCbacBanner } from \"../../new/platform-apis/admin/useCbacBanner.js\";\nexport type {\n CbacBannerData,\n UseCbacBannerOptions,\n UseCbacBannerResult,\n} from \"../../new/platform-apis/admin/useCbacBanner.js\";\nexport { useCbacMarkingRestrictions } from \"../../new/platform-apis/admin/useCbacMarkingRestrictions.js\";\nexport type {\n CbacMarkingRestrictionsData,\n UseCbacMarkingRestrictionsOptions,\n UseCbacMarkingRestrictionsResult,\n} from \"../../new/platform-apis/admin/useCbacMarkingRestrictions.js\";\nexport { useCurrentFoundryUser } from \"../../new/platform-apis/admin/useCurrentFoundryUser.js\";\nexport { useFoundryUser } from \"../../new/platform-apis/admin/useFoundryUser.js\";\nexport { useFoundryUsersList } from \"../../new/platform-apis/admin/useFoundryUsersList.js\";\nexport { useMarkingCategories } from \"../../new/platform-apis/admin/useMarkingCategories.js\";\nexport { useMarkings } from \"../../new/platform-apis/admin/useMarkings.js\";\nexport { useUserViewMarkings } from \"../../new/platform-apis/admin/useUserMarkings.js\";\nexport type {\n UseUserViewMarkingsOptions,\n UseUserViewMarkingsResult,\n} from \"../../new/platform-apis/admin/useUserMarkings.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,gDAAgD;AAM9E,SAASC,0BAA0B,QAAQ,6DAA6D;AAMxG,SAASC,qBAAqB,QAAQ,wDAAwD;AAC9F,SAASC,cAAc,QAAQ,iDAAiD;AAChF,SAASC,mBAAmB,QAAQ,sDAAsD;AAC1F,SAASC,oBAAoB,QAAQ,uDAAuD;AAC5F,SAASC,WAAW,QAAQ,8CAA8C;AAC1E,SAASC,mBAAmB,QAAQ,kDAAkD","ignoreList":[]}
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export { OsdkProvider2 } from "../new/OsdkProvider2.js";
|
|
18
|
-
export { useCurrentFoundryUser } from "../new/platform-apis/admin/useCurrentFoundryUser.js";
|
|
19
|
-
export { useFoundryUser } from "../new/platform-apis/admin/useFoundryUser.js";
|
|
20
|
-
export { useFoundryUsersList } from "../new/platform-apis/admin/useFoundryUsersList.js";
|
|
21
18
|
export { useLinks } from "../new/useLinks.js";
|
|
22
19
|
export { useObjectSet } from "../new/useObjectSet.js";
|
|
23
20
|
export { useOsdkAction } from "../new/useOsdkAction.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","names":["OsdkProvider2","
|
|
1
|
+
{"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback"],"sources":["experimental.ts"],"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\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 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 type {\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFor<T extends
|
|
1
|
+
{"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 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 type {\n ActionDefinition,\n ActionMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFetchableDefinition =\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>;\n\ntype MetadataFor<T extends MetadataFetchableDefinition> = T extends\n ObjectTypeDefinition ? ObjectMetadata\n : T extends InterfaceDefinition ? InterfaceMetadata\n : T extends ActionDefinition<any> ? ActionMetadata\n : never;\n\nexport interface UseOsdkMetadataResult<T extends MetadataFetchableDefinition> {\n loading: boolean;\n metadata?: MetadataFor<T>;\n error?: string;\n}\n\nexport function useOsdkMetadata<T extends MetadataFetchableDefinition>(\n type: T,\n): UseOsdkMetadataResult<T> {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState<\n MetadataFor<T> | undefined\n >(undefined);\n const [error, setError] = React.useState<UseOsdkMetadataResult<T>[\"error\"]>();\n\n if (!metadata && !error) {\n client.fetchMetadata(type).then((fetchedMetadata) => {\n setMetadata(fetchedMetadata as MetadataFor<T>);\n }).catch((error: unknown) => {\n const errorMessage = error instanceof Error\n ? error.message\n : String(error);\n setError(errorMessage);\n });\n return { loading: true };\n }\n\n return { loading: false, metadata, error };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,oBAAoB;AAkBlD,OAAO,SAASC,eAAeA,CAC7BC,IAAO,EACmB;EAC1B,MAAMC,MAAM,GAAGH,aAAa,CAAC,CAAC;EAC9B,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAE5CC,SAAS,CAAC;EACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGV,KAAK,CAACO,QAAQ,CAAoC,CAAC;EAE7E,IAAI,CAACF,QAAQ,IAAI,CAACI,KAAK,EAAE;IACvBL,MAAM,CAACO,aAAa,CAACR,IAAI,CAAC,CAACS,IAAI,CAAEC,eAAe,IAAK;MACnDP,WAAW,CAACO,eAAiC,CAAC;IAChD,CAAC,CAAC,CAACC,KAAK,CAAEL,KAAc,IAAK;MAC3B,MAAMM,YAAY,GAAGN,KAAK,YAAYO,KAAK,GACvCP,KAAK,CAACQ,OAAO,GACbC,MAAM,CAACT,KAAK,CAAC;MACjBC,QAAQ,CAACK,YAAY,CAAC;IACxB,CAAC,CAAC;IACF,OAAO;MAAEI,OAAO,EAAE;IAAK,CAAC;EAC1B;EAEA,OAAO;IAAEA,OAAO,EAAE,KAAK;IAAEd,QAAQ;IAAEI;EAAM,CAAC;AAC5C","ignoreList":[]}
|
|
@@ -6,11 +6,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
6
6
|
|
|
7
7
|
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
9
|
+
// src/useOsdkClient.ts
|
|
14
10
|
function fakeClientFn(..._args) {
|
|
15
11
|
throw new Error("This is not a real client. Did you forget to <OsdkContext.Provider>?");
|
|
16
12
|
}
|
|
@@ -48,8 +44,7 @@ function useOsdkMetadata(type) {
|
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
exports.OsdkContext = OsdkContext;
|
|
51
|
-
exports.__export = __export;
|
|
52
47
|
exports.useOsdkClient = useOsdkClient;
|
|
53
48
|
exports.useOsdkMetadata = useOsdkMetadata;
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-OVBG5VXE.cjs.map
|
|
50
|
+
//# sourceMappingURL=chunk-OVBG5VXE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/OsdkContext.ts","../../src/useOsdkClient.ts","../../src/useOsdkMetadata.ts"],"names":["React","error"],"mappings":";;;;;;;;;AAiBA,SAAS,gBAAgB,KAAO,EAAA;AAC9B,EAAM,MAAA,IAAI,MAAM,sEAAsE,CAAA;AACxF;AACA,IAAM,UAAA,GAAa,MAAO,CAAA,MAAA,CAAO,YAAc,EAAA;AAAA,EAC7C,aAAe,EAAA;AACjB,CAAC,CAAA;AACY,IAAA,WAAA,2CAAiC,aAAc,CAAA;AAAA,EAC1D,MAAQ,EAAA;AACV,CAAC;;;ACPM,SAAS,aAAgB,GAAA;AAC9B,EAAOA,OAAAA,uBAAAA,CAAM,UAAW,CAAA,WAAW,CAAE,CAAA,MAAA;AACvC;ACFO,SAAS,gBAAgB,IAAM,EAAA;AACpC,EAAA,MAAM,SAAS,aAAc,EAAA;AAC7B,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAIA,GAAAA,uBAAAA,CAAM,SAAS,MAAS,CAAA;AACxD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,wBAAM,QAAS,EAAA;AACzC,EAAI,IAAA,CAAC,QAAY,IAAA,CAAC,KAAO,EAAA;AACvB,IAAA,MAAA,CAAO,aAAc,CAAA,IAAI,CAAE,CAAA,IAAA,CAAK,CAAmB,eAAA,KAAA;AACjD,MAAA,WAAA,CAAY,eAAe,CAAA;AAAA,KAC5B,CAAA,CAAE,KAAM,CAAA,CAAAC,MAAS,KAAA;AAChB,MAAA,MAAM,eAAeA,MAAiB,YAAA,KAAA,GAAQA,MAAM,CAAA,OAAA,GAAU,OAAOA,MAAK,CAAA;AAC1E,MAAA,QAAA,CAAS,YAAY,CAAA;AAAA,KACtB,CAAA;AACD,IAAO,OAAA;AAAA,MACL,OAAS,EAAA;AAAA,KACX;AAAA;AAEF,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,KAAA;AAAA,IACT,QAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-OVBG5VXE.cjs","sourcesContent":["/*\n * Copyright 2024 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\";\nfunction fakeClientFn(..._args) {\n throw new Error(\"This is not a real client. Did you forget to <OsdkContext.Provider>?\");\n}\nconst fakeClient = Object.assign(fakeClientFn, {\n fetchMetadata: fakeClientFn\n});\nexport const OsdkContext = /*#__PURE__*/React.createContext({\n client: fakeClient\n});","/*\n * Copyright 2024 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 { OsdkContext } from \"./OsdkContext.js\";\nexport function useOsdkClient() {\n return React.useContext(OsdkContext).client;\n}","/*\n * Copyright 2024 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 { useOsdkClient } from \"./useOsdkClient.js\";\nexport function useOsdkMetadata(type) {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState(undefined);\n const [error, setError] = React.useState();\n if (!metadata && !error) {\n client.fetchMetadata(type).then(fetchedMetadata => {\n setMetadata(fetchedMetadata);\n }).catch(error => {\n const errorMessage = error instanceof Error ? error.message : String(error);\n setError(errorMessage);\n });\n return {\n loading: true\n };\n }\n return {\n loading: false,\n metadata,\n error\n };\n}"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
8
|
+
|
|
9
|
+
// src/new/OsdkContext2.ts
|
|
10
|
+
function fakeClientFn(..._args) {
|
|
11
|
+
throw new Error("This is not a real client. Did you forget to <OsdkContext.Provider>?");
|
|
12
|
+
}
|
|
13
|
+
var fakeClient = Object.assign(fakeClientFn, {
|
|
14
|
+
fetchMetadata: fakeClientFn
|
|
15
|
+
});
|
|
16
|
+
var OsdkContext2 = /* @__PURE__ */ React__default.default.createContext({
|
|
17
|
+
client: fakeClient,
|
|
18
|
+
observableClient: void 0
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// src/new/makeExternalStore.ts
|
|
22
|
+
function makeExternalStore(createObservation, _name, initialValue) {
|
|
23
|
+
let lastResult = initialValue;
|
|
24
|
+
function getSnapShot() {
|
|
25
|
+
return lastResult;
|
|
26
|
+
}
|
|
27
|
+
function subscribe(notifyUpdate) {
|
|
28
|
+
const obs = createObservation({
|
|
29
|
+
next: (payload) => {
|
|
30
|
+
lastResult = payload;
|
|
31
|
+
notifyUpdate();
|
|
32
|
+
},
|
|
33
|
+
error: (error) => {
|
|
34
|
+
lastResult = {
|
|
35
|
+
...lastResult ?? {},
|
|
36
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
37
|
+
};
|
|
38
|
+
notifyUpdate();
|
|
39
|
+
},
|
|
40
|
+
complete: () => {
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return () => {
|
|
44
|
+
obs.unsubscribe();
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
subscribe,
|
|
49
|
+
getSnapShot
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function makeExternalStoreAsync(createObservation, _name, initialValue) {
|
|
53
|
+
let lastResult = initialValue;
|
|
54
|
+
function getSnapShot() {
|
|
55
|
+
return lastResult;
|
|
56
|
+
}
|
|
57
|
+
function subscribe(notifyUpdate) {
|
|
58
|
+
let isActive = true;
|
|
59
|
+
let currentSubscription;
|
|
60
|
+
const subscriptionPromise = createObservation({
|
|
61
|
+
next: (payload) => {
|
|
62
|
+
if (isActive) {
|
|
63
|
+
lastResult = payload;
|
|
64
|
+
notifyUpdate();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
error: (error) => {
|
|
68
|
+
if (isActive) {
|
|
69
|
+
lastResult = {
|
|
70
|
+
...lastResult ?? {},
|
|
71
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
72
|
+
};
|
|
73
|
+
notifyUpdate();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
complete: () => {
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
subscriptionPromise.then((sub) => {
|
|
80
|
+
if (isActive) {
|
|
81
|
+
currentSubscription = sub;
|
|
82
|
+
} else {
|
|
83
|
+
sub.unsubscribe();
|
|
84
|
+
}
|
|
85
|
+
}).catch((error) => {
|
|
86
|
+
if (isActive) {
|
|
87
|
+
lastResult = {
|
|
88
|
+
...lastResult ?? {},
|
|
89
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
90
|
+
};
|
|
91
|
+
notifyUpdate();
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
isActive = false;
|
|
96
|
+
if (currentSubscription) {
|
|
97
|
+
currentSubscription.unsubscribe();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
subscribe,
|
|
103
|
+
getSnapShot
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
exports.OsdkContext2 = OsdkContext2;
|
|
108
|
+
exports.makeExternalStore = makeExternalStore;
|
|
109
|
+
exports.makeExternalStoreAsync = makeExternalStoreAsync;
|
|
110
|
+
//# sourceMappingURL=chunk-SVVMLSKN.cjs.map
|
|
111
|
+
//# sourceMappingURL=chunk-SVVMLSKN.cjs.map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ACvB,QAAA,mBAAA,CAAoB,WAAY,EAAA;AAAA;AAClC,KACF;AAAA;AAEF,EAAO,OAAA;AAAA,IACL,SAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-SVVMLSKN.cjs","sourcesContent":["/*\n * Copyright 2024 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\";\nfunction fakeClientFn(..._args) {\n throw new Error(\"This is not a real client. Did you forget to <OsdkContext.Provider>?\");\n}\nconst fakeClient = Object.assign(fakeClientFn, {\n fetchMetadata: fakeClientFn\n});\nexport const OsdkContext2 = /*#__PURE__*/React.createContext({\n client: fakeClient,\n observableClient: undefined\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\nexport function makeExternalStore(createObservation, _name, initialValue) {\n let lastResult = initialValue;\n function getSnapShot() {\n return lastResult;\n }\n function subscribe(notifyUpdate) {\n const obs = createObservation({\n next: payload => {\n lastResult = payload;\n notifyUpdate();\n },\n error: error => {\n lastResult = {\n ...(lastResult ?? {}),\n error: error instanceof Error ? error : new Error(String(error))\n };\n notifyUpdate();\n },\n complete: () => {}\n });\n return () => {\n obs.unsubscribe();\n };\n }\n return {\n subscribe,\n getSnapShot\n };\n}\n\n/**\n * Like makeExternalStore but for async subscription creation.\n *\n * Uses an isActive flag to handle race conditions:\n * If cleanup runs before promise resolves, the stale subscription is\n * immediately unsubscribed when it eventually resolves\n */\nexport function makeExternalStoreAsync(createObservation, _name, initialValue) {\n let lastResult = initialValue;\n function getSnapShot() {\n return lastResult;\n }\n function subscribe(notifyUpdate) {\n let isActive = true;\n let currentSubscription;\n const subscriptionPromise = createObservation({\n next: payload => {\n if (isActive) {\n lastResult = payload;\n notifyUpdate();\n }\n },\n error: error => {\n if (isActive) {\n lastResult = {\n ...(lastResult ?? {}),\n error: error instanceof Error ? error : new Error(String(error))\n };\n notifyUpdate();\n }\n },\n complete: () => {}\n });\n subscriptionPromise.then(sub => {\n if (isActive) {\n currentSubscription = sub;\n } else {\n sub.unsubscribe();\n }\n }).catch(error => {\n if (isActive) {\n lastResult = {\n ...(lastResult ?? {}),\n error: error instanceof Error ? error : new Error(String(error))\n };\n notifyUpdate();\n }\n });\n return () => {\n isActive = false;\n if (currentSubscription) {\n currentSubscription.unsubscribe();\n }\n };\n }\n return {\n subscribe,\n getSnapShot\n };\n}"]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOVBG5VXE_cjs = require('./chunk-OVBG5VXE.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
6
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -11,7 +11,7 @@ function OsdkProvider({
|
|
|
11
11
|
children,
|
|
12
12
|
client
|
|
13
13
|
}) {
|
|
14
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
14
|
+
return /* @__PURE__ */ React__default.default.createElement(chunkOVBG5VXE_cjs.OsdkContext.Provider, {
|
|
15
15
|
value: {
|
|
16
16
|
client
|
|
17
17
|
}
|
|
@@ -20,11 +20,11 @@ function OsdkProvider({
|
|
|
20
20
|
|
|
21
21
|
Object.defineProperty(exports, "useOsdkClient", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkOVBG5VXE_cjs.useOsdkClient; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "useOsdkMetadata", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkOVBG5VXE_cjs.useOsdkMetadata; }
|
|
28
28
|
});
|
|
29
29
|
exports.OsdkProvider = OsdkProvider;
|
|
30
30
|
//# sourceMappingURL=index.cjs.map
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from '@osdk/client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export { u as useOsdkClient, a as useOsdkMetadata } from './useOsdkMetadata-
|
|
3
|
+
export { u as useOsdkClient, a as useOsdkMetadata } from './useOsdkMetadata-BElt3F5s.cjs';
|
|
4
4
|
import '@osdk/api';
|
|
5
5
|
|
|
6
6
|
declare function OsdkProvider({ children, client, }: {
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkSVVMLSKN_cjs = require('../../chunk-SVVMLSKN.cjs');
|
|
4
|
+
var foundry_admin = require('@osdk/foundry.admin');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
+
|
|
11
|
+
function usePlatformQuery({
|
|
12
|
+
query,
|
|
13
|
+
queryName,
|
|
14
|
+
enabled = true
|
|
15
|
+
}) {
|
|
16
|
+
const observerRef = React__default.default.useRef();
|
|
17
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
18
|
+
const observer = observerRef.current;
|
|
19
|
+
if (observer == null) return;
|
|
20
|
+
observer.next({
|
|
21
|
+
status: "loading",
|
|
22
|
+
data: void 0
|
|
23
|
+
});
|
|
24
|
+
query().then((data) => {
|
|
25
|
+
observer.next({
|
|
26
|
+
status: "success",
|
|
27
|
+
data
|
|
28
|
+
});
|
|
29
|
+
}).catch((err) => {
|
|
30
|
+
observer.error(err);
|
|
31
|
+
});
|
|
32
|
+
}, [query]);
|
|
33
|
+
const {
|
|
34
|
+
subscribe,
|
|
35
|
+
getSnapShot
|
|
36
|
+
} = React__default.default.useMemo(() => {
|
|
37
|
+
if (!enabled) {
|
|
38
|
+
return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
|
|
39
|
+
unsubscribe: () => {
|
|
40
|
+
}
|
|
41
|
+
}), process.env.NODE_ENV !== "production" ? `${queryName} Query [DISABLED]` : void 0);
|
|
42
|
+
}
|
|
43
|
+
return chunkSVVMLSKN_cjs.makeExternalStore((observer) => {
|
|
44
|
+
observerRef.current = observer;
|
|
45
|
+
handleQuery();
|
|
46
|
+
return {
|
|
47
|
+
unsubscribe: () => {
|
|
48
|
+
observerRef.current = void 0;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}, queryName);
|
|
52
|
+
}, [enabled, queryName, handleQuery]);
|
|
53
|
+
const payload = React__default.default.useSyncExternalStore(subscribe, getSnapShot);
|
|
54
|
+
let error;
|
|
55
|
+
if (payload && "error" in payload && payload.error != null) {
|
|
56
|
+
error = payload.error;
|
|
57
|
+
} else if (payload?.status === "error") {
|
|
58
|
+
error = new Error(`Failed to query platform API: ${queryName}`);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
data: payload?.data,
|
|
62
|
+
isLoading: enabled ? payload?.status === "loading" || !payload : false,
|
|
63
|
+
error,
|
|
64
|
+
refetch: handleQuery
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
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(chunkSVVMLSKN_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(chunkSVVMLSKN_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
|
+
}
|
|
146
|
+
function useCurrentFoundryUser({
|
|
147
|
+
enabled = true
|
|
148
|
+
} = {}) {
|
|
149
|
+
const {
|
|
150
|
+
client
|
|
151
|
+
} = React__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
|
|
152
|
+
const handleQuery = React__default.default.useCallback(() => foundry_admin.Users.getCurrent(client), [client]);
|
|
153
|
+
const query = usePlatformQuery({
|
|
154
|
+
query: handleQuery,
|
|
155
|
+
enabled,
|
|
156
|
+
queryName: "foundry-current-user"
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
currentUser: query.data,
|
|
160
|
+
isLoading: query.isLoading,
|
|
161
|
+
error: query.error,
|
|
162
|
+
refetch: query.refetch
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function useFoundryUser(userId, {
|
|
166
|
+
enabled = true,
|
|
167
|
+
status = "ACTIVE"
|
|
168
|
+
} = {}) {
|
|
169
|
+
const {
|
|
170
|
+
client
|
|
171
|
+
} = React__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
|
|
172
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
173
|
+
return foundry_admin.Users.get(client, userId, {
|
|
174
|
+
status
|
|
175
|
+
});
|
|
176
|
+
}, [client, userId, status]);
|
|
177
|
+
const query = usePlatformQuery({
|
|
178
|
+
query: handleQuery,
|
|
179
|
+
enabled,
|
|
180
|
+
queryName: "foundry-user"
|
|
181
|
+
});
|
|
182
|
+
return {
|
|
183
|
+
user: query.data,
|
|
184
|
+
isLoading: query.isLoading,
|
|
185
|
+
error: query.error,
|
|
186
|
+
refetch: query.refetch
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function useFoundryUsersList({
|
|
190
|
+
enabled = true,
|
|
191
|
+
include = "ACTIVE",
|
|
192
|
+
pageSize = 1e3,
|
|
193
|
+
pageToken
|
|
194
|
+
} = {}) {
|
|
195
|
+
const {
|
|
196
|
+
client
|
|
197
|
+
} = React__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
|
|
198
|
+
const handleQuery = React__default.default.useCallback(() => {
|
|
199
|
+
return foundry_admin.Users.list(client, {
|
|
200
|
+
include,
|
|
201
|
+
pageSize,
|
|
202
|
+
pageToken
|
|
203
|
+
});
|
|
204
|
+
}, [client, include, pageSize, pageToken]);
|
|
205
|
+
const query = usePlatformQuery({
|
|
206
|
+
query: handleQuery,
|
|
207
|
+
enabled,
|
|
208
|
+
queryName: "foundry-users-list"
|
|
209
|
+
});
|
|
210
|
+
return {
|
|
211
|
+
users: query.data?.data,
|
|
212
|
+
nextPageToken: query.data?.nextPageToken,
|
|
213
|
+
isLoading: query.isLoading,
|
|
214
|
+
error: query.error,
|
|
215
|
+
refetch: query.refetch
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function useMarkingCategories({
|
|
219
|
+
enabled = true
|
|
220
|
+
} = {}) {
|
|
221
|
+
const {
|
|
222
|
+
client
|
|
223
|
+
} = React__default.default.useContext(chunkSVVMLSKN_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(chunkSVVMLSKN_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(chunkSVVMLSKN_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
|
+
}
|
|
283
|
+
|
|
284
|
+
exports.useCbacBanner = useCbacBanner;
|
|
285
|
+
exports.useCbacMarkingRestrictions = useCbacMarkingRestrictions;
|
|
286
|
+
exports.useCurrentFoundryUser = useCurrentFoundryUser;
|
|
287
|
+
exports.useFoundryUser = useFoundryUser;
|
|
288
|
+
exports.useFoundryUsersList = useFoundryUsersList;
|
|
289
|
+
exports.useMarkingCategories = useMarkingCategories;
|
|
290
|
+
exports.useMarkings = useMarkings;
|
|
291
|
+
exports.useUserViewMarkings = useUserViewMarkings;
|
|
292
|
+
//# sourceMappingURL=admin.cjs.map
|
|
293
|
+
//# sourceMappingURL=admin.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,gBAA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,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}"]}
|