@osdk/react 0.10.0-beta.10 → 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/CHANGELOG.md +15 -0
- 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/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/cjs/public/experimental/admin.cjs +148 -1
- 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 +11 -3
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +8 -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/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/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/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/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/new/OsdkProvider2.tsx","../../../src/new/useLinks.ts","../../../src/new/useObjectSet.tsx","../../../src/new/useOsdkAction.ts","../../../src/new/useOsdkAggregation.ts","../../../src/new/useOsdkFunction.ts","../../../src/new/useOsdkObject.ts","../../../src/new/useOsdkObjects.ts","../../../src/utils/useDebouncedCallback.ts"],"names":["useMemo","createObservableClient","React","OsdkContext2","OsdkContext","makeExternalStore","computeObjectSetCacheKey","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","getWireObjectSet","EMPTY_WHERE"],"mappings":";;;;;;;;;;;;AAoBO,SAAS,aAAc,CAAA;AAAA,EAC5B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAmB,gBAAA,GAAAA,cAAA,CAAQ,MAAM,gBAAoB,IAAAC,uCAAA,CAAuB,MAAM,CAAG,EAAA,CAAC,MAAQ,EAAA,gBAAgB,CAAC,CAAA;AAC/G,EAAoB,uBAAAC,uBAAA,CAAM,aAAc,CAAAC,8BAAA,CAAa,QAAU,EAAA;AAAA,IAC7D,KAAO,EAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA;AACF,GACc,kBAAAD,uBAAA,CAAM,aAAc,CAAAE,6BAAA,CAAY,QAAU,EAAA;AAAA,IACxD,KAAO,EAAA;AAAA,MACL;AAAA;AACF,GACF,EAAG,QAAQ,CAAC,CAAA;AACd;ACjBA,IAAM,UAAa,GAAA,MAAA,CAAO,MAAO,CAAA,EAAE,CAAA;AACnC,IAAM,QAAA,uBAAe,GAAI,EAAA;AAUlB,SAAS,QAAS,CAAA,OAAA,EAAS,QAAU,EAAA,OAAA,GAAU,EAAI,EAAA;AACxD,EAAM,MAAA;AAAA,IACJ;AAAA,GACF,GAAIF,uBAAM,CAAA,UAAA,CAAWC,8BAAY,CAAA;AACjC,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,IAAA;AAAA,IACV,GAAG;AAAA,GACD,GAAA,OAAA;AACJ,EAAA,MAAM,WAAcD,GAAAA,uBAAAA,CAAM,OAAQ,CAAA,MAAM,YAAa,CAAA,KAAA,EAAO,CAAC,IAAA,CAAK,SAAU,CAAA,YAAA,CAAa,KAAK,CAAC,CAAC,CAAA;AAChG,EAAA,MAAM,aAAgBA,GAAAA,uBAAA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MAAA,MAAA,GAASA,uBAAM,CAAA,WAAA,CAAY,MAAM;AACrC,IAAA,IAAI,WAAW,OAAS,EAAA;AACtB,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAU,GAAA,MAAA;AAAA;AACvB,GACF,EAAG,EAAE,CAAA;AACL,EAAM,MAAA,KAAA,GAAQA,uBAAM,CAAA,WAAA,CAAY,MAAM;AACpC,IAAI,IAAA,UAAA,CAAW,OAAW,IAAA,WAAA,CAAY,OAAS,EAAA;AAC7C,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAU,GAAA,MAAA;AACrB,MAAA,KAAK,WAAY,CAAA,OAAA,CAAQ,GAAG,WAAA,CAAY,OAAO,CAAA;AAAA;AACjD,GACF,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,iBAAoBA,GAAAA,uBAAAA,CAAM,WAAY,CAAA,CAAA,GAAI,IAAS,KAAA;AACvD,IAAA,WAAA,CAAY,OAAU,GAAA,IAAA;AACtB,IAAO,MAAA,EAAA;AACP,IAAW,UAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AACpC,MAAK,KAAA,WAAA,CAAY,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,OAC/B,KAAK,CAAA;AAAA,GACP,EAAA,CAAC,KAAO,EAAA,MAAM,CAAC,CAAA;AAClB,EAAAA,uBAAAA,CAAM,UAAU,MAAM;AACpB,IAAA,OAAO,MAAM;AACX,MAAO,MAAA,EAAA;AAAA,KACT;AAAA,GACF,EAAG,CAAC,MAAM,CAAC,CAAA;AACX,EAAO,OAAA,MAAA,CAAO,OAAO,iBAAmB,EAAA;AAAA,IACtC,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"experimental.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 { createObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React, { useMemo } from \"react\";\nimport { OsdkContext } from \"../OsdkContext.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function OsdkProvider2({\n children,\n client,\n observableClient\n}) {\n observableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);\n return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {\n value: {\n client,\n observableClient\n }\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: {\n client\n }\n }, children));\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst emptyArray = Object.freeze([]);\nconst emptyMap = new Map();\n\n/**\n * Hook to observe links from an object or array of objects.\n *\n * @param objects The source object(s) to observe links from\n * @param linkName The name of the link to observe\n * @param options Optional configuration for the link query\n * @returns UseLinksResult with links data and metadata\n */\nexport function useLinks(objects, linkName, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n ...otherOptions\n } = options;\n const stableWhere = React.useMemo(() => otherOptions.where, [JSON.stringify(otherOptions.where)]);\n const stableOrderBy = React.useMemo(() => otherOptions.orderBy, [JSON.stringify(otherOptions.orderBy)]);\n const stableSelect = React.useMemo(() => otherOptions.$select, [JSON.stringify(otherOptions.$select)]);\n const objectsKey = React.useMemo(() => {\n if (objects === undefined) return \"\";\n const arr = Array.isArray(objects) ? objects : [objects];\n return arr.map(obj => `${obj.$apiName}:${obj.$primaryKey}`).join(\",\");\n }, [objects]);\n\n // Convert single object to array for consistent handling\n const objectsArray = React.useMemo(() => {\n return objects === undefined ? emptyArray : Array.isArray(objects) ? objects : [objects];\n }, [objectsKey, objects]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `links ${linkName} for ${objectsKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeLinks(objectsArray, linkName, {\n linkName,\n where: stableWhere,\n pageSize: otherOptions.pageSize,\n orderBy: stableOrderBy,\n mode: otherOptions.mode,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), `links ${linkName} for ${objectsKey}`);\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, stableWhere, otherOptions.pageSize, stableOrderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, stableSelect]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => ({\n links: payload?.resolvedList,\n linkedObjectsBySourcePrimaryKey: payload?.linkedObjectsBySourcePrimaryKey ?? emptyMap,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: payload?.isOptimistic ?? false,\n error: payload?.error,\n fetchMore: payload?.hasMore ? payload?.fetchMore : undefined,\n hasMore: payload?.hasMore ?? false\n }), [payload, enabled]);\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 { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst OBJECT_TYPE_PLACEHOLDER = \"$__OBJECT__TYPE__PLACEHOLDER\";\n/**\n * React hook for observing and interacting with OSDK object sets.\n *\n * @typeParam Q - The object type definition\n * @typeParam BaseRDPs - Derived properties that already exist on the input ObjectSet\n * @typeParam RDPs - New derived properties to be added via options.withProperties\n *\n * @param baseObjectSet - The ObjectSet to observe (may already have derived properties)\n * @param options - Options for filtering, sorting, and adding new derived properties\n * @returns Object set data with both existing and new derived properties\n */\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n streamUpdates,\n ...otherOptions\n } = options;\n\n // Track object type to detect when we switch to a different object type\n const objectTypeKey = enabled ? baseObjectSet.$objectSetInternals.def.apiName : OBJECT_TYPE_PLACEHOLDER;\n const previousObjectTypeRef = React.useRef(objectTypeKey);\n const previousCompletedPayloadRef = React.useRef();\n const objectTypeChanged = previousObjectTypeRef.current !== objectTypeKey;\n if (objectTypeChanged) {\n previousObjectTypeRef.current = objectTypeKey;\n previousCompletedPayloadRef.current = undefined;\n }\n\n // Compute a stable cache key for the ObjectSet and options\n // dedupeIntervalMs and enabled are excluded as they don't affect the data\n const stableKey = computeObjectSetCacheKey(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n select: otherOptions.$select\n });\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey} [DISABLED]` : void 0);\n }\n const initialValue = objectTypeChanged ? undefined : previousCompletedPayloadRef.current;\n return makeExternalStore(observer => {\n const subscription = observableClient.observeObjectSet(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n autoFetchMore: otherOptions.autoFetchMore,\n streamUpdates,\n select: otherOptions.$select\n }, observer);\n return subscription;\n }, process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey}` : void 0, initialValue);\n }, [enabled, observableClient, stableKey, streamUpdates, objectTypeChanged]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n if (payload && isPayloadCompleted(payload)) {\n previousCompletedPayloadRef.current = payload;\n }\n return React.useMemo(() => {\n const lastLoaded = isPayloadCompleted(payload) ? payload : previousCompletedPayloadRef.current;\n return {\n data: lastLoaded?.resolvedList,\n isLoading: !isPayloadCompleted(payload),\n error: lastLoaded && \"error\" in lastLoaded ? lastLoaded.error : undefined,\n fetchMore: payload?.hasMore ? payload.fetchMore : undefined,\n objectSet: payload?.objectSet || baseObjectSet,\n totalCount: lastLoaded?.totalCount\n };\n }, [payload, baseObjectSet]);\n}\nfunction isPayloadCompleted(payload) {\n if (payload != null && \"error\" in payload) {\n return true;\n }\n if (payload?.status == null) {\n return false;\n }\n switch (payload.status) {\n case \"loaded\":\n case \"error\":\n return true;\n case \"loading\":\n case \"init\":\n return false;\n default:\n payload.status;\n return false;\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 { ActionValidationError } from \"@osdk/client\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState();\n const [data, setData] = React.useState();\n const [isPending, setPending] = React.useState(false);\n const [isValidating, setValidating] = React.useState(false);\n const [validationResult, setValidationResult] = React.useState();\n const abortControllerRef = React.useRef(null);\n const applyAction = React.useCallback(async function applyAction(hookArgs) {\n try {\n // If validation is in progress, abort it\n if (isValidating && abortControllerRef.current) {\n abortControllerRef.current.abort();\n setValidating(false);\n }\n setPending(true);\n setError(undefined);\n if (Array.isArray(hookArgs)) {\n const updates = [];\n const args = hookArgs.map(a => {\n const {\n $optimisticUpdate,\n ...args\n } = a;\n if ($optimisticUpdate) {\n updates.push($optimisticUpdate);\n }\n return args;\n });\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: ctx => {\n for (const update of updates) {\n update?.(ctx);\n }\n }\n });\n setData(r);\n return r;\n } else {\n const {\n $optimisticUpdate,\n ...args\n } = hookArgs;\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate\n });\n setData(r);\n return r;\n }\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n } finally {\n setPending(false);\n }\n }, [observableClient, actionDef, isValidating]);\n const validateAction = React.useCallback(async function validateAction(args) {\n try {\n // Check if action is being applied\n if (isPending) {\n return undefined;\n }\n\n // Abort any existing validation\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n // Create new AbortController\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n setValidating(true);\n setError(undefined);\n const result = await observableClient.validateAction(actionDef, args);\n\n // Check if aborted\n if (abortController.signal.aborted) {\n return undefined;\n }\n setValidationResult(result);\n return result;\n } catch (e) {\n // Check if it was aborted\n if (e instanceof Error && e.name === \"AbortError\") {\n return undefined;\n }\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setValidating(false);\n }\n }, [observableClient, actionDef, isPending]);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n return React.useMemo(() => ({\n applyAction,\n validateAction,\n error,\n data,\n isPending,\n isValidating,\n validationResult\n }), [applyAction, validateAction, error, data, isPending, isValidating, validationResult]);\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 { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\n\n/**\n * React hook for performing aggregations on OSDK object sets.\n *\n * Executes server-side aggregations with groupBy and metric calculations on filtered object sets.\n * Supports runtime derived properties and where clauses.\n *\n * @param type - The object or interface type to aggregate\n * @param options - Aggregation configuration including where clause, aggregation spec, and optional derived properties\n * @returns Object containing aggregation results, loading state, error state, and refetch function\n *\n * @example\n * ```tsx\n * // Basic aggregation without ObjectSet\n * const { data, isLoading, error } = useOsdkAggregation(Employee, {\n * where: { department: \"Engineering\" },\n * aggregate: {\n * groupBy: { department: \"exact\" },\n * select: {\n * avgSalary: { $avg: \"salary\" },\n * count: { $count: {} }\n * }\n * }\n * });\n *\n * // With a pivoted ObjectSet\n * const pivotedSet = useMemo(() => $(Employee).pivotTo(\"primaryOffice\"), []);\n * const { data } = useOsdkAggregation(Office, {\n * objectSet: pivotedSet,\n * aggregate: { $select: { $count: \"unordered\" } }\n * });\n * ```\n */\n\nexport function useOsdkAggregation(type, options) {\n const {\n where = EMPTY_WHERE,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const canonWhere = observableClient.canonicalizeWhereClause(where);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n const objectSetKeyString = objectSet ? computeObjectSetCacheKey(objectSet) : undefined;\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableAggregate = React.useMemo(() => aggregate, [JSON.stringify(aggregate)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (objectSetKeyString && objectSetRef.current) {\n return makeExternalStoreAsync(observer => observableClient.observeAggregation({\n type: type,\n objectSet: objectSetRef.current,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }\n return makeExternalStore(observer =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation({\n type: type,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [observableClient, type.apiName, type.type, objectSetKeyString, stableCanonWhere, stableWithProperties, stableIntersectWith, stableAggregate, dedupeIntervalMs]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to execute aggregation\");\n }\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\" || payload?.status === \"init\" || !payload,\n error,\n refetch\n };\n }, [payload, refetch]);\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 { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n/**\n * React hook for executing and observing OSDK functions.\n *\n * Provides automatic caching, deduplication, and reactive updates for function calls.\n * Functions are automatically re-fetched when dependencies change (configured via options).\n *\n * @param queryDef - The QueryDefinition to execute\n * @param options - Configuration options for the function call\n * @returns Object containing result, loading state, error, and refetch function\n *\n * @example Basic usage\n * ```tsx\n * const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {\n * params: { departmentId: \"engineering\" }\n * });\n * ```\n *\n * @example With dependency tracking\n * ```tsx\n * const { data, refetch } = useOsdkFunction(calculateMetrics, {\n * params: { startDate, endDate },\n * dependsOn: [Employee, Project],\n * });\n * ```\n *\n * @example With specific object dependencies\n * ```tsx\n * const { data } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee.$primaryKey },\n * dependsOnObjects: [employee],\n * });\n * ```\n */\nexport function useOsdkFunction(queryDef, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true\n } = options;\n const stableParams = React.useMemo(() => params, [JSON.stringify(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn, [JSON.stringify(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects, [JSON.stringify(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : {\n __objectSet: getWireObjectSet(item)\n }))]);\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)}` : void 0);\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(() => {\n void observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n return React.useMemo(() => {\n const error = payload?.error ?? (payload?.status === \"error\" ? new Error(\"Failed to execute function\") : undefined);\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch\n };\n }, [payload, refetch]);\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\n/**\n * @param obj an existing `Osdk.Instance` object to get metadata for.\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key with options.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param options Options including $select and enabled\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n\n // Check if first arg is an instance to discriminate signatures\n // TypeScript cannot narrow rest parameter unions with optional parameters,\n // so we must use type assertions after runtime discrimination\n const isInstanceSignature = \"$objectType\" in args[0];\n\n // Extract options object if provided (3rd arg is an object with $select or enabled)\n const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === \"object\" ? args[2] : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature ? typeof args[1] === \"boolean\" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === \"boolean\" ? args[2] : true;\n const selectArg = optionsArg?.$select;\n const mode = isInstanceSignature ? \"offline\" : undefined;\n const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];\n const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];\n const apiNameString = typeof typeOrApiName === \"string\" ? typeOrApiName : typeOrApiName.apiName;\n const stableSelect = React.useMemo(() => selectArg, [JSON.stringify(selectArg)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `object ${apiNameString} ${primaryKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), `object ${apiNameString} ${primaryKey}`);\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to load object\");\n }\n return {\n object: payload?.object,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate\n };\n }, [payload, enabled, forceUpdate]);\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n pageSize,\n dedupeIntervalMs,\n withProperties,\n enabled = true,\n rids,\n where,\n orderBy,\n streamUpdates,\n autoFetchMore,\n intersectWith,\n pivotTo,\n $select\n } = options ?? {};\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const stableOrderBy = React.useMemo(() => orderBy, [JSON.stringify(orderBy)]);\n const stableSelect = React.useMemo(() => $select, [JSON.stringify($select)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith ? {\n intersectWith: stableIntersectWith\n } : {}),\n ...(pivotTo ? {\n pivotTo\n } : {}),\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : \"\"} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect]);\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => {\n let error;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled ? listPayload?.status === \"loading\" || listPayload?.status === \"init\" || !listPayload : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount\n };\n }, [listPayload, enabled]);\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 React from \"react\";\n/**\n * Creates a debounced version of a callback function.\n *\n * @param callback The function to debounce\n * @param delay The delay in milliseconds\n * @returns A debounced function with cancel() and flush() methods\n *\n * @example\n * ```tsx\n * const { applyAction } = useOsdkAction(editOffice);\n *\n * const debouncedSave = useDebouncedCallback(\n * async (name: string) => {\n * await applyAction({\n * Office: office,\n * name,\n * location: office.location!,\n * $optimisticUpdate: (ctx) => {\n * ctx.updateObject(office.$clone({ name }));\n * },\n * });\n * },\n * 1000\n * );\n *\n * <input onChange={(e) => debouncedSave(e.target.value)} />\n * ```\n */\nexport function useDebouncedCallback(callback, delay) {\n const timeoutRef = React.useRef();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef();\n callbackRef.current = callback;\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n const flush = React.useCallback(() => {\n if (timeoutRef.current && lastArgsRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n void callbackRef.current(...lastArgsRef.current);\n }\n }, []);\n const debouncedCallback = React.useCallback((...args) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n }, [delay, cancel]);\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n return Object.assign(debouncedCallback, {\n cancel,\n flush\n });\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/new/OsdkProvider2.tsx","../../../src/new/useLinks.ts","../../../src/new/useObjectSet.tsx","../../../src/new/useOsdkAction.ts","../../../src/new/useOsdkAggregation.ts","../../../src/new/useOsdkFunction.ts","../../../src/new/useOsdkObject.ts","../../../src/new/useOsdkObjects.ts","../../../src/utils/useDebouncedCallback.ts"],"names":["useMemo","createObservableClient","React","OsdkContext2","OsdkContext","makeExternalStore","computeObjectSetCacheKey","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","getWireObjectSet","EMPTY_WHERE"],"mappings":";;;;;;;;;;;;AAoBO,SAAS,aAAc,CAAA;AAAA,EAC5B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAmB,gBAAA,GAAAA,cAAA,CAAQ,MAAM,gBAAoB,IAAAC,uCAAA,CAAuB,MAAM,CAAG,EAAA,CAAC,MAAQ,EAAA,gBAAgB,CAAC,CAAA;AAC/G,EAAoB,uBAAAC,uBAAA,CAAM,aAAc,CAAAC,8BAAA,CAAa,QAAU,EAAA;AAAA,IAC7D,KAAO,EAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA;AACF,GACc,kBAAAD,uBAAA,CAAM,aAAc,CAAAE,6BAAA,C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Aa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAU,GAAA,MAAA;AACrB,MAAA,KAAK,WAAY,CAAA,OAAA,CAAQ,GAAG,WAAA,CAAY,OAAO,CAAA;AAAA;AACjD,GACF,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,iBAAoBA,GAAAA,uBAAAA,CAAM,WAAY,CAAA,CAAA,GAAI,IAAS,KAAA;AACvD,IAAA,WAAA,CAAY,OAAU,GAAA,IAAA;AACtB,IAAO,MAAA,EAAA;AACP,IAAW,UAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AACpC,MAAK,KAAA,WAAA,CAAY,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,OAC/B,KAAK,CAAA;AAAA,GACP,EAAA,CAAC,KAAO,EAAA,MAAM,CAAC,CAAA;AAClB,EAAAA,uBAAAA,CAAM,UAAU,MAAM;AACpB,IAAA,OAAO,MAAM;AACX,MAAO,MAAA,EAAA;AAAA,KACT;AAAA,GACF,EAAG,CAAC,MAAM,CAAC,CAAA;AACX,EAAO,OAAA,MAAA,CAAO,OAAO,iBAAmB,EAAA;AAAA,IACtC,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"experimental.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 { createObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React, { useMemo } from \"react\";\nimport { OsdkContext } from \"../OsdkContext.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function OsdkProvider2({\n children,\n client,\n observableClient\n}) {\n observableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);\n return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {\n value: {\n client,\n observableClient\n }\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: {\n client\n }\n }, children));\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst emptyArray = Object.freeze([]);\nconst emptyMap = new Map();\n\n/**\n * Hook to observe links from an object or array of objects.\n *\n * @param objects The source object(s) to observe links from\n * @param linkName The name of the link to observe\n * @param options Optional configuration for the link query\n * @returns UseLinksResult with links data and metadata\n */\nexport function useLinks(objects, linkName, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n ...otherOptions\n } = options;\n const stableWhere = React.useMemo(() => otherOptions.where, [JSON.stringify(otherOptions.where)]);\n const stableOrderBy = React.useMemo(() => otherOptions.orderBy, [JSON.stringify(otherOptions.orderBy)]);\n const stableSelect = React.useMemo(() => otherOptions.$select, [JSON.stringify(otherOptions.$select)]);\n const objectsKey = React.useMemo(() => {\n if (objects === undefined) return \"\";\n const arr = Array.isArray(objects) ? objects : [objects];\n return arr.map(obj => `${obj.$apiName}:${obj.$primaryKey}`).join(\",\");\n }, [objects]);\n\n // Convert single object to array for consistent handling\n const objectsArray = React.useMemo(() => {\n return objects === undefined ? emptyArray : Array.isArray(objects) ? objects : [objects];\n }, [objectsKey, objects]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `links ${linkName} for ${objectsKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeLinks(objectsArray, linkName, {\n linkName,\n where: stableWhere,\n pageSize: otherOptions.pageSize,\n orderBy: stableOrderBy,\n mode: otherOptions.mode,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), `links ${linkName} for ${objectsKey}`);\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, stableWhere, otherOptions.pageSize, stableOrderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, stableSelect]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => ({\n links: payload?.resolvedList,\n linkedObjectsBySourcePrimaryKey: payload?.linkedObjectsBySourcePrimaryKey ?? emptyMap,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: payload?.isOptimistic ?? false,\n error: payload?.error,\n fetchMore: payload?.hasMore ? payload?.fetchMore : undefined,\n hasMore: payload?.hasMore ?? false\n }), [payload, enabled]);\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 { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst OBJECT_TYPE_PLACEHOLDER = \"$__OBJECT__TYPE__PLACEHOLDER\";\n/**\n * React hook for observing and interacting with OSDK object sets.\n *\n * @typeParam Q - The object type definition\n * @typeParam BaseRDPs - Derived properties that already exist on the input ObjectSet\n * @typeParam RDPs - New derived properties to be added via options.withProperties\n *\n * @param baseObjectSet - The ObjectSet to observe (may already have derived properties)\n * @param options - Options for filtering, sorting, and adding new derived properties\n * @returns Object set data with both existing and new derived properties\n */\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n streamUpdates,\n ...otherOptions\n } = options;\n\n // Track object type to detect when we switch to a different object type\n const objectTypeKey = enabled ? baseObjectSet.$objectSetInternals.def.apiName : OBJECT_TYPE_PLACEHOLDER;\n const previousObjectTypeRef = React.useRef(objectTypeKey);\n const previousCompletedPayloadRef = React.useRef();\n const objectTypeChanged = previousObjectTypeRef.current !== objectTypeKey;\n if (objectTypeChanged) {\n previousObjectTypeRef.current = objectTypeKey;\n previousCompletedPayloadRef.current = undefined;\n }\n\n // Compute a stable cache key for the ObjectSet and options\n // dedupeIntervalMs and enabled are excluded as they don't affect the data\n const stableKey = computeObjectSetCacheKey(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n select: otherOptions.$select\n });\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey} [DISABLED]` : void 0);\n }\n const initialValue = objectTypeChanged ? undefined : previousCompletedPayloadRef.current;\n return makeExternalStore(observer => {\n const subscription = observableClient.observeObjectSet(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n autoFetchMore: otherOptions.autoFetchMore,\n streamUpdates,\n select: otherOptions.$select\n }, observer);\n return subscription;\n }, process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey}` : void 0, initialValue);\n }, [enabled, observableClient, stableKey, streamUpdates, objectTypeChanged]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n if (payload && isPayloadCompleted(payload)) {\n previousCompletedPayloadRef.current = payload;\n }\n return React.useMemo(() => {\n const lastLoaded = isPayloadCompleted(payload) ? payload : previousCompletedPayloadRef.current;\n return {\n data: lastLoaded?.resolvedList,\n isLoading: !isPayloadCompleted(payload),\n error: lastLoaded && \"error\" in lastLoaded ? lastLoaded.error : undefined,\n fetchMore: payload?.hasMore ? payload.fetchMore : undefined,\n objectSet: payload?.objectSet || baseObjectSet,\n totalCount: lastLoaded?.totalCount\n };\n }, [payload, baseObjectSet]);\n}\nfunction isPayloadCompleted(payload) {\n if (payload != null && \"error\" in payload) {\n return true;\n }\n if (payload?.status == null) {\n return false;\n }\n switch (payload.status) {\n case \"loaded\":\n case \"error\":\n return true;\n case \"loading\":\n case \"init\":\n return false;\n default:\n payload.status;\n return false;\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 { ActionValidationError } from \"@osdk/client\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState();\n const [data, setData] = React.useState();\n const [isPending, setPending] = React.useState(false);\n const [isValidating, setValidating] = React.useState(false);\n const [validationResult, setValidationResult] = React.useState();\n const abortControllerRef = React.useRef(null);\n const applyAction = React.useCallback(async function applyAction(hookArgs) {\n try {\n // If validation is in progress, abort it\n if (isValidating && abortControllerRef.current) {\n abortControllerRef.current.abort();\n setValidating(false);\n }\n setPending(true);\n setError(undefined);\n if (Array.isArray(hookArgs)) {\n const updates = [];\n const args = hookArgs.map(a => {\n const {\n $optimisticUpdate,\n ...args\n } = a;\n if ($optimisticUpdate) {\n updates.push($optimisticUpdate);\n }\n return args;\n });\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: ctx => {\n for (const update of updates) {\n update?.(ctx);\n }\n }\n });\n setData(r);\n return r;\n } else {\n const {\n $optimisticUpdate,\n ...args\n } = hookArgs;\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate\n });\n setData(r);\n return r;\n }\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n } finally {\n setPending(false);\n }\n }, [observableClient, actionDef, isValidating]);\n const validateAction = React.useCallback(async function validateAction(args) {\n try {\n // Check if action is being applied\n if (isPending) {\n return undefined;\n }\n\n // Abort any existing validation\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n // Create new AbortController\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n setValidating(true);\n setError(undefined);\n const result = await observableClient.validateAction(actionDef, args);\n\n // Check if aborted\n if (abortController.signal.aborted) {\n return undefined;\n }\n setValidationResult(result);\n return result;\n } catch (e) {\n // Check if it was aborted\n if (e instanceof Error && e.name === \"AbortError\") {\n return undefined;\n }\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setValidating(false);\n }\n }, [observableClient, actionDef, isPending]);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n return React.useMemo(() => ({\n applyAction,\n validateAction,\n error,\n data,\n isPending,\n isValidating,\n validationResult\n }), [applyAction, validateAction, error, data, isPending, isValidating, validationResult]);\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 { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\n\n/**\n * React hook for performing aggregations on OSDK object sets.\n *\n * Executes server-side aggregations with groupBy and metric calculations on filtered object sets.\n * Supports runtime derived properties and where clauses.\n *\n * @param type - The object or interface type to aggregate\n * @param options - Aggregation configuration including where clause, aggregation spec, and optional derived properties\n * @returns Object containing aggregation results, loading state, error state, and refetch function\n *\n * @example\n * ```tsx\n * // Basic aggregation without ObjectSet\n * const { data, isLoading, error } = useOsdkAggregation(Employee, {\n * where: { department: \"Engineering\" },\n * aggregate: {\n * groupBy: { department: \"exact\" },\n * select: {\n * avgSalary: { $avg: \"salary\" },\n * count: { $count: {} }\n * }\n * }\n * });\n *\n * // With a pivoted ObjectSet\n * const pivotedSet = useMemo(() => $(Employee).pivotTo(\"primaryOffice\"), []);\n * const { data } = useOsdkAggregation(Office, {\n * objectSet: pivotedSet,\n * aggregate: { $select: { $count: \"unordered\" } }\n * });\n * ```\n */\n\nexport function useOsdkAggregation(type, options) {\n const {\n where = EMPTY_WHERE,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const canonWhere = observableClient.canonicalizeWhereClause(where);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n const objectSetKeyString = objectSet ? computeObjectSetCacheKey(objectSet) : undefined;\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableAggregate = React.useMemo(() => aggregate, [JSON.stringify(aggregate)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (objectSetKeyString && objectSetRef.current) {\n return makeExternalStoreAsync(observer => observableClient.observeAggregation({\n type: type,\n objectSet: objectSetRef.current,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }\n return makeExternalStore(observer =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation({\n type: type,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [observableClient, type.apiName, type.type, objectSetKeyString, stableCanonWhere, stableWithProperties, stableIntersectWith, stableAggregate, dedupeIntervalMs]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to execute aggregation\");\n }\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\" || payload?.status === \"init\" || !payload,\n error,\n refetch\n };\n }, [payload, refetch]);\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 { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n/**\n * React hook for executing and observing OSDK functions.\n *\n * Provides automatic caching, deduplication, and reactive updates for function calls.\n * Functions are automatically re-fetched when dependencies change (configured via options).\n *\n * @param queryDef - The QueryDefinition to execute\n * @param options - Configuration options for the function call\n * @returns Object containing result, loading state, error, and refetch function\n *\n * @example Basic usage\n * ```tsx\n * const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {\n * params: { departmentId: \"engineering\" }\n * });\n * ```\n *\n * @example With dependency tracking\n * ```tsx\n * const { data, refetch } = useOsdkFunction(calculateMetrics, {\n * params: { startDate, endDate },\n * dependsOn: [Employee, Project],\n * });\n * ```\n *\n * @example With specific object dependencies\n * ```tsx\n * const { data } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee.$primaryKey },\n * dependsOnObjects: [employee],\n * });\n * ```\n */\nexport function useOsdkFunction(queryDef, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true\n } = options;\n const stableParams = React.useMemo(() => params, [JSON.stringify(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn, [JSON.stringify(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects, [JSON.stringify(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : {\n __objectSet: getWireObjectSet(item)\n }))]);\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)}` : void 0);\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(() => {\n void observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n return React.useMemo(() => {\n const error = payload?.error ?? (payload?.status === \"error\" ? new Error(\"Failed to execute function\") : undefined);\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch\n };\n }, [payload, refetch]);\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\n/**\n * @param obj an existing `Osdk.Instance` object to get metadata for.\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key with options.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param options Options including $select, enabled, and $loadPropertySecurityMetadata\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n\n // Check if first arg is an instance to discriminate signatures\n // TypeScript cannot narrow rest parameter unions with optional parameters,\n // so we must use type assertions after runtime discrimination\n const isInstanceSignature = \"$objectType\" in args[0];\n\n // Extract options object if provided (3rd arg is an object with $select or enabled)\n const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === \"object\" ? args[2] : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature ? typeof args[1] === \"boolean\" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === \"boolean\" ? args[2] : true;\n const selectArg = optionsArg?.$select;\n const loadPropertySecurityMetadata = optionsArg?.$loadPropertySecurityMetadata;\n const mode = isInstanceSignature ? \"offline\" : undefined;\n const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];\n const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];\n const apiNameString = typeof typeOrApiName === \"string\" ? typeOrApiName : typeOrApiName.apiName;\n const stableSelect = React.useMemo(() => selectArg, [JSON.stringify(selectArg)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `object ${apiNameString} ${primaryKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...(loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata\n } : {})\n }, observer), `object ${apiNameString} ${primaryKey}`);\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to load object\");\n }\n return {\n object: payload?.object,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate\n };\n }, [payload, enabled, forceUpdate]);\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 React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n pageSize,\n dedupeIntervalMs,\n withProperties,\n enabled = true,\n rids,\n where,\n orderBy,\n streamUpdates,\n autoFetchMore,\n intersectWith,\n pivotTo,\n $select,\n $loadPropertySecurityMetadata\n } = options ?? {};\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const stableOrderBy = React.useMemo(() => orderBy, [JSON.stringify(orderBy)]);\n const stableSelect = React.useMemo(() => $select, [JSON.stringify($select)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith ? {\n intersectWith: stableIntersectWith\n } : {}),\n ...(pivotTo ? {\n pivotTo\n } : {}),\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...($loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata\n } : {})\n }, observer), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : \"\"} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect, $loadPropertySecurityMetadata]);\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => {\n let error;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled ? listPayload?.status === \"loading\" || listPayload?.status === \"init\" || !listPayload : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount\n };\n }, [listPayload, enabled]);\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 React from \"react\";\n/**\n * Creates a debounced version of a callback function.\n *\n * @param callback The function to debounce\n * @param delay The delay in milliseconds\n * @returns A debounced function with cancel() and flush() methods\n *\n * @example\n * ```tsx\n * const { applyAction } = useOsdkAction(editOffice);\n *\n * const debouncedSave = useDebouncedCallback(\n * async (name: string) => {\n * await applyAction({\n * Office: office,\n * name,\n * location: office.location!,\n * $optimisticUpdate: (ctx) => {\n * ctx.updateObject(office.$clone({ name }));\n * },\n * });\n * },\n * 1000\n * );\n *\n * <input onChange={(e) => debouncedSave(e.target.value)} />\n * ```\n */\nexport function useDebouncedCallback(callback, delay) {\n const timeoutRef = React.useRef();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef();\n callbackRef.current = callback;\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n const flush = React.useCallback(() => {\n if (timeoutRef.current && lastArgsRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n void callbackRef.current(...lastArgsRef.current);\n }\n }, []);\n const debouncedCallback = React.useCallback((...args) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n }, [delay, cancel]);\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n return Object.assign(debouncedCallback, {\n cancel,\n flush\n });\n}"]}
|
|
@@ -471,11 +471,12 @@ declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, p
|
|
|
471
471
|
*
|
|
472
472
|
* @param type The object type or interface definition
|
|
473
473
|
* @param primaryKey The primary key of the object
|
|
474
|
-
* @param options Options including $select and
|
|
474
|
+
* @param options Options including $select, enabled, and $loadPropertySecurityMetadata
|
|
475
475
|
*/
|
|
476
476
|
declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, options?: {
|
|
477
477
|
$select?: readonly PropertyKeys$1<Q>[];
|
|
478
478
|
enabled?: boolean;
|
|
479
|
+
$loadPropertySecurityMetadata?: boolean;
|
|
479
480
|
}): UseOsdkObjectResult<Q>;
|
|
480
481
|
|
|
481
482
|
interface UseOsdkObjectsOptions<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
@@ -569,6 +570,12 @@ interface UseOsdkObjectsOptions<T extends ObjectOrInterfaceDefinition, RDPs exte
|
|
|
569
570
|
* useOsdkObjects(Employee, { $select: ["name", "status"] })
|
|
570
571
|
*/
|
|
571
572
|
$select?: readonly PropertyKeys$1<T>[];
|
|
573
|
+
/**
|
|
574
|
+
* When true, loads per-property security metadata (marking requirements)
|
|
575
|
+
* alongside each object. The returned objects will have `$propertySecurities`
|
|
576
|
+
* populated with conjunctive/disjunctive marking requirements per property.
|
|
577
|
+
*/
|
|
578
|
+
$loadPropertySecurityMetadata?: boolean;
|
|
572
579
|
}
|
|
573
580
|
interface UseOsdkListResult<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}, EXTRA_OPTIONS extends never | "$rid" = never> {
|
|
574
581
|
/**
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
import { CbacBanners } from "@osdk/foundry.admin";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { usePlatformQuery } from "../../../utils/usePlatformQuery.js";
|
|
20
|
+
import { OsdkContext2 } from "../../OsdkContext2.js";
|
|
21
|
+
/**
|
|
22
|
+
* Get the CBAC banner data for the given marking IDs.
|
|
23
|
+
* @param options Options to control the query.
|
|
24
|
+
*/
|
|
25
|
+
export function useCbacBanner({
|
|
26
|
+
markingIds,
|
|
27
|
+
enabled: externalEnabled = true
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
client
|
|
31
|
+
} = React.useContext(OsdkContext2);
|
|
32
|
+
const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);
|
|
33
|
+
const enabled = stableMarkingIds.length > 0 && externalEnabled;
|
|
34
|
+
const handleQuery = React.useCallback(() => {
|
|
35
|
+
return CbacBanners.get(client, {
|
|
36
|
+
markingIds: stableMarkingIds,
|
|
37
|
+
preview: true
|
|
38
|
+
});
|
|
39
|
+
}, [client, stableMarkingIds]);
|
|
40
|
+
const query = usePlatformQuery({
|
|
41
|
+
query: handleQuery,
|
|
42
|
+
enabled,
|
|
43
|
+
queryName: "cbac-banner"
|
|
44
|
+
});
|
|
45
|
+
const banner = React.useMemo(() => {
|
|
46
|
+
if (query.data == null) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
classificationString: query.data.classificationString,
|
|
51
|
+
textColor: query.data.textColor,
|
|
52
|
+
backgroundColors: query.data.backgroundColors,
|
|
53
|
+
markingIds: query.data.markings
|
|
54
|
+
};
|
|
55
|
+
}, [query.data]);
|
|
56
|
+
return {
|
|
57
|
+
banner,
|
|
58
|
+
isLoading: query.isLoading,
|
|
59
|
+
error: query.error,
|
|
60
|
+
refetch: query.refetch
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=useCbacBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCbacBanner.js","names":["CbacBanners","React","usePlatformQuery","OsdkContext2","useCbacBanner","markingIds","enabled","externalEnabled","client","useContext","stableMarkingIds","useMemo","JSON","stringify","length","handleQuery","useCallback","get","preview","query","queryName","banner","data","undefined","classificationString","textColor","backgroundColors","markings","isLoading","error","refetch"],"sources":["useCbacBanner.ts"],"sourcesContent":["/*\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\nexport interface CbacBannerData {\n classificationString: string;\n textColor: string;\n backgroundColors: string[];\n markingIds: string[];\n}\n\nexport interface UseCbacBannerOptions {\n markingIds: string[];\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseCbacBannerResult {\n banner: CbacBannerData | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n refetch: () => void;\n}\n\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, enabled: externalEnabled = true }: UseCbacBannerOptions,\n): UseCbacBannerResult {\n const { client } = React.useContext(OsdkContext2);\n\n const stableMarkingIds = React.useMemo(\n () => markingIds,\n [JSON.stringify(markingIds)],\n );\n\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n\n const handleQuery = React.useCallback(() => {\n return CbacBanners.get(client, {\n markingIds: stableMarkingIds,\n preview: true,\n });\n }, [client, stableMarkingIds]);\n\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-banner\",\n });\n\n const banner = React.useMemo((): CbacBannerData | undefined => {\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\n return {\n banner,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,qBAAqB;AACjD,OAAOC,KAAK,MAAM,OAAO;AACzB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,CAAC;EAEhB,OAAO;IACLD,MAAM;IACNO,SAAS,EAAET,KAAK,CAACS,SAAS;IAC1BC,KAAK,EAAEV,KAAK,CAACU,KAAK;IAClBC,OAAO,EAAEX,KAAK,CAACW;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
import { CbacMarkingRestrictionsObjects } from "@osdk/foundry.admin";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { usePlatformQuery } from "../../../utils/usePlatformQuery.js";
|
|
20
|
+
import { OsdkContext2 } from "../../OsdkContext2.js";
|
|
21
|
+
/**
|
|
22
|
+
* Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.
|
|
23
|
+
* @param options Options to control the query.
|
|
24
|
+
*/
|
|
25
|
+
export function useCbacMarkingRestrictions({
|
|
26
|
+
markingIds,
|
|
27
|
+
enabled: externalEnabled = true
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
client
|
|
31
|
+
} = React.useContext(OsdkContext2);
|
|
32
|
+
const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);
|
|
33
|
+
const enabled = stableMarkingIds.length > 0 && externalEnabled;
|
|
34
|
+
const handleQuery = React.useCallback(() => {
|
|
35
|
+
return CbacMarkingRestrictionsObjects.get(client, {
|
|
36
|
+
markingIds: stableMarkingIds,
|
|
37
|
+
preview: true
|
|
38
|
+
});
|
|
39
|
+
}, [client, stableMarkingIds]);
|
|
40
|
+
const query = usePlatformQuery({
|
|
41
|
+
query: handleQuery,
|
|
42
|
+
enabled,
|
|
43
|
+
queryName: "cbac-marking-restrictions"
|
|
44
|
+
});
|
|
45
|
+
const restrictions = React.useMemo(() => {
|
|
46
|
+
if (query.data == null) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
disallowedMarkings: query.data.disallowedMarkings.map(String),
|
|
51
|
+
impliedMarkings: query.data.impliedMarkings.map(String),
|
|
52
|
+
requiredMarkings: query.data.requiredMarkings.map(group => group.map(String)),
|
|
53
|
+
userSatisfiesMarkings: query.data.userSatisfiesMarkings,
|
|
54
|
+
isValid: query.data.isValid
|
|
55
|
+
};
|
|
56
|
+
}, [query.data]);
|
|
57
|
+
return {
|
|
58
|
+
restrictions,
|
|
59
|
+
isLoading: query.isLoading,
|
|
60
|
+
error: query.error,
|
|
61
|
+
refetch: query.refetch
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=useCbacMarkingRestrictions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCbacMarkingRestrictions.js","names":["CbacMarkingRestrictionsObjects","React","usePlatformQuery","OsdkContext2","useCbacMarkingRestrictions","markingIds","enabled","externalEnabled","client","useContext","stableMarkingIds","useMemo","JSON","stringify","length","handleQuery","useCallback","get","preview","query","queryName","restrictions","data","undefined","disallowedMarkings","map","String","impliedMarkings","requiredMarkings","group","userSatisfiesMarkings","isValid","isLoading","error","refetch"],"sources":["useCbacMarkingRestrictions.ts"],"sourcesContent":["/*\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\nexport interface CbacMarkingRestrictionsData {\n disallowedMarkings: string[];\n impliedMarkings: string[];\n requiredMarkings: string[][];\n userSatisfiesMarkings: boolean;\n isValid: boolean;\n}\n\nexport interface UseCbacMarkingRestrictionsOptions {\n markingIds: string[];\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseCbacMarkingRestrictionsResult {\n restrictions: CbacMarkingRestrictionsData | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n refetch: () => void;\n}\n\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, enabled: externalEnabled = true }:\n UseCbacMarkingRestrictionsOptions,\n): UseCbacMarkingRestrictionsResult {\n const { client } = React.useContext(OsdkContext2);\n\n const stableMarkingIds = React.useMemo(\n () => markingIds,\n [JSON.stringify(markingIds)],\n );\n\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n\n const handleQuery = React.useCallback(() => {\n return CbacMarkingRestrictionsObjects.get(client, {\n markingIds: stableMarkingIds,\n preview: true,\n });\n }, [client, stableMarkingIds]);\n\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-marking-restrictions\",\n });\n\n const restrictions = React.useMemo(\n (): CbacMarkingRestrictionsData | undefined => {\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 =>\n group.map(String)\n ),\n userSatisfiesMarkings: query.data.userSatisfiesMarkings,\n isValid: query.data.isValid,\n };\n },\n [query.data],\n );\n\n return {\n restrictions,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,8BAA8B,QAAQ,qBAAqB;AACpE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,YAAY,QAAQ,uBAAuB;AAoCpD;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CACxC;EAAEC,UAAU;EAAEC,OAAO,EAAEC,eAAe,GAAG;AACP,CAAC,EACD;EAClC,MAAM;IAAEC;EAAO,CAAC,GAAGP,KAAK,CAACQ,UAAU,CAACN,YAAY,CAAC;EAEjD,MAAMO,gBAAgB,GAAGT,KAAK,CAACU,OAAO,CACpC,MAAMN,UAAU,EAChB,CAACO,IAAI,CAACC,SAAS,CAACR,UAAU,CAAC,CAC7B,CAAC;EAED,MAAMC,OAAO,GAAGI,gBAAgB,CAACI,MAAM,GAAG,CAAC,IAAIP,eAAe;EAE9D,MAAMQ,WAAW,GAAGd,KAAK,CAACe,WAAW,CAAC,MAAM;IAC1C,OAAOhB,8BAA8B,CAACiB,GAAG,CAACT,MAAM,EAAE;MAChDH,UAAU,EAAEK,gBAAgB;MAC5BQ,OAAO,EAAE;IACX,CAAC,CAAC;EACJ,CAAC,EAAE,CAACV,MAAM,EAAEE,gBAAgB,CAAC,CAAC;EAE9B,MAAMS,KAAK,GAAGjB,gBAAgB,CAAC;IAC7BiB,KAAK,EAAEJ,WAAW;IAClBT,OAAO;IACPc,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,MAAMC,YAAY,GAAGpB,KAAK,CAACU,OAAO,CAChC,MAA+C;IAC7C,IAAIQ,KAAK,CAACG,IAAI,IAAI,IAAI,EAAE;MACtB,OAAOC,SAAS;IAClB;IACA,OAAO;MACLC,kBAAkB,EAAEL,KAAK,CAACG,IAAI,CAACE,kBAAkB,CAACC,GAAG,CAACC,MAAM,CAAC;MAC7DC,eAAe,EAAER,KAAK,CAACG,IAAI,CAACK,eAAe,CAACF,GAAG,CAACC,MAAM,CAAC;MACvDE,gBAAgB,EAAET,KAAK,CAACG,IAAI,CAACM,gBAAgB,CAACH,GAAG,CAACI,KAAK,IACrDA,KAAK,CAACJ,GAAG,CAACC,MAAM,CAClB,CAAC;MACDI,qBAAqB,EAAEX,KAAK,CAACG,IAAI,CAACQ,qBAAqB;MACvDC,OAAO,EAAEZ,KAAK,CAACG,IAAI,CAACS;IACtB,CAAC;EACH,CAAC,EACD,CAACZ,KAAK,CAACG,IAAI,CACb,CAAC;EAED,OAAO;IACLD,YAAY;IACZW,SAAS,EAAEb,KAAK,CAACa,SAAS;IAC1BC,KAAK,EAAEd,KAAK,CAACc,KAAK;IAClBC,OAAO,EAAEf,KAAK,CAACe;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
import { MarkingCategories } from "@osdk/foundry.admin";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { usePlatformQuery } from "../../../utils/usePlatformQuery.js";
|
|
20
|
+
import { OsdkContext2 } from "../../OsdkContext2.js";
|
|
21
|
+
/**
|
|
22
|
+
* List all marking categories.
|
|
23
|
+
* @param options Options to control the query.
|
|
24
|
+
*/
|
|
25
|
+
export function useMarkingCategories({
|
|
26
|
+
enabled = true
|
|
27
|
+
} = {}) {
|
|
28
|
+
const {
|
|
29
|
+
client
|
|
30
|
+
} = React.useContext(OsdkContext2);
|
|
31
|
+
const handleQuery = React.useCallback(() => {
|
|
32
|
+
return MarkingCategories.list(client);
|
|
33
|
+
}, [client]);
|
|
34
|
+
const query = usePlatformQuery({
|
|
35
|
+
query: handleQuery,
|
|
36
|
+
enabled,
|
|
37
|
+
queryName: "marking-categories"
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
categories: query.data?.data,
|
|
41
|
+
isLoading: query.isLoading,
|
|
42
|
+
error: query.error,
|
|
43
|
+
refetch: query.refetch
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useMarkingCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkingCategories.js","names":["MarkingCategories","React","usePlatformQuery","OsdkContext2","useMarkingCategories","enabled","client","useContext","handleQuery","useCallback","list","query","queryName","categories","data","isLoading","error","refetch"],"sources":["useMarkingCategories.ts"],"sourcesContent":["/*\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 type { MarkingCategory } from \"@osdk/foundry.admin\";\nimport { MarkingCategories } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n\nexport interface UseMarkingCategoriesOptions {\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseMarkingCategoriesResult {\n categories: MarkingCategory[] | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n refetch: () => void;\n}\n\n/**\n * List all marking categories.\n * @param options Options to control the query.\n */\nexport function useMarkingCategories(\n { enabled = true }: UseMarkingCategoriesOptions = {},\n): UseMarkingCategoriesResult {\n const { client } = React.useContext(OsdkContext2);\n\n const handleQuery = React.useCallback(() => {\n return MarkingCategories.list(client);\n }, [client]);\n\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"marking-categories\",\n });\n\n return {\n categories: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,qBAAqB;AACvD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,YAAY,QAAQ,uBAAuB;AA2BpD;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClC;EAAEC,OAAO,GAAG;AAAkC,CAAC,GAAG,CAAC,CAAC,EACxB;EAC5B,MAAM;IAAEC;EAAO,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACJ,YAAY,CAAC;EAEjD,MAAMK,WAAW,GAAGP,KAAK,CAACQ,WAAW,CAAC,MAAM;IAC1C,OAAOT,iBAAiB,CAACU,IAAI,CAACJ,MAAM,CAAC;EACvC,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMK,KAAK,GAAGT,gBAAgB,CAAC;IAC7BS,KAAK,EAAEH,WAAW;IAClBH,OAAO;IACPO,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,OAAO;IACLC,UAAU,EAAEF,KAAK,CAACG,IAAI,EAAEA,IAAI;IAC5BC,SAAS,EAAEJ,KAAK,CAACI,SAAS;IAC1BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,OAAO,EAAEN,KAAK,CAACM;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
import { Markings } from "@osdk/foundry.admin";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { usePlatformQuery } from "../../../utils/usePlatformQuery.js";
|
|
20
|
+
import { OsdkContext2 } from "../../OsdkContext2.js";
|
|
21
|
+
/**
|
|
22
|
+
* List all markings.
|
|
23
|
+
* @param options Options to control the query.
|
|
24
|
+
*/
|
|
25
|
+
export function useMarkings({
|
|
26
|
+
enabled = true
|
|
27
|
+
} = {}) {
|
|
28
|
+
const {
|
|
29
|
+
client
|
|
30
|
+
} = React.useContext(OsdkContext2);
|
|
31
|
+
const handleQuery = React.useCallback(() => {
|
|
32
|
+
return Markings.list(client);
|
|
33
|
+
}, [client]);
|
|
34
|
+
const query = usePlatformQuery({
|
|
35
|
+
query: handleQuery,
|
|
36
|
+
enabled,
|
|
37
|
+
queryName: "markings"
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
markings: query.data?.data,
|
|
41
|
+
isLoading: query.isLoading,
|
|
42
|
+
error: query.error,
|
|
43
|
+
refetch: query.refetch
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useMarkings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkings.js","names":["Markings","React","usePlatformQuery","OsdkContext2","useMarkings","enabled","client","useContext","handleQuery","useCallback","list","query","queryName","markings","data","isLoading","error","refetch"],"sources":["useMarkings.ts"],"sourcesContent":["/*\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 type { Marking } from \"@osdk/foundry.admin\";\nimport { Markings } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext2 } from \"../../OsdkContext2.js\";\n\nexport interface UseMarkingsOptions {\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseMarkingsResult {\n markings: Marking[] | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n refetch: () => void;\n}\n\n/**\n * List all markings.\n * @param options Options to control the query.\n */\nexport function useMarkings(\n { enabled = true }: UseMarkingsOptions = {},\n): UseMarkingsResult {\n const { client } = React.useContext(OsdkContext2);\n\n const handleQuery = React.useCallback(() => {\n return Markings.list(client);\n }, [client]);\n\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"markings\",\n });\n\n return {\n markings: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,qBAAqB;AAC9C,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,YAAY,QAAQ,uBAAuB;AA2BpD;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CACzB;EAAEC,OAAO,GAAG;AAAyB,CAAC,GAAG,CAAC,CAAC,EACxB;EACnB,MAAM;IAAEC;EAAO,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACJ,YAAY,CAAC;EAEjD,MAAMK,WAAW,GAAGP,KAAK,CAACQ,WAAW,CAAC,MAAM;IAC1C,OAAOT,QAAQ,CAACU,IAAI,CAACJ,MAAM,CAAC;EAC9B,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMK,KAAK,GAAGT,gBAAgB,CAAC;IAC7BS,KAAK,EAAEH,WAAW;IAClBH,OAAO;IACPO,SAAS,EAAE;EACb,CAAC,CAAC;EAEF,OAAO;IACLC,QAAQ,EAAEF,KAAK,CAACG,IAAI,EAAEA,IAAI;IAC1BC,SAAS,EAAEJ,KAAK,CAACI,SAAS;IAC1BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,OAAO,EAAEN,KAAK,CAACM;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
import { Users } from "@osdk/foundry.admin";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { usePlatformQuery } from "../../../utils/usePlatformQuery.js";
|
|
20
|
+
import { OsdkContext2 } from "../../OsdkContext2.js";
|
|
21
|
+
/**
|
|
22
|
+
* Get view-accessible markings for a user.
|
|
23
|
+
* When `userId` is provided, fetches markings for that user.
|
|
24
|
+
* When omitted, fetches markings for the current user.
|
|
25
|
+
* @param options Options to control the query.
|
|
26
|
+
*/
|
|
27
|
+
export function useUserViewMarkings({
|
|
28
|
+
userId,
|
|
29
|
+
enabled = true
|
|
30
|
+
} = {}) {
|
|
31
|
+
const {
|
|
32
|
+
client
|
|
33
|
+
} = React.useContext(OsdkContext2);
|
|
34
|
+
const handleQuery = React.useCallback(async () => {
|
|
35
|
+
const resolvedUserId = userId ?? (await Users.getCurrent(client)).id;
|
|
36
|
+
return Users.getMarkings(client, resolvedUserId);
|
|
37
|
+
}, [client, userId]);
|
|
38
|
+
const query = usePlatformQuery({
|
|
39
|
+
query: handleQuery,
|
|
40
|
+
enabled,
|
|
41
|
+
queryName: "user-view-markings"
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
markingIds: query.data?.view,
|
|
45
|
+
isLoading: query.isLoading,
|
|
46
|
+
error: query.error,
|
|
47
|
+
refetch: query.refetch
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useUserMarkings.js.map
|