@osdk/react 0.10.0-beta.9 → 0.10.1-main-20260406220320
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 +109 -0
- package/build/browser/new/OsdkContext2.js +22 -2
- package/build/browser/new/OsdkContext2.js.map +1 -1
- package/build/browser/new/hookUtils.js +32 -0
- package/build/browser/new/hookUtils.js.map +1 -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/useLinks.js +13 -10
- package/build/browser/new/useLinks.js.map +1 -1
- package/build/browser/new/useObjectSet.js +45 -26
- package/build/browser/new/useObjectSet.js.map +1 -1
- package/build/browser/new/useOsdkAction.js +3 -6
- package/build/browser/new/useOsdkAction.js.map +1 -1
- package/build/browser/new/useOsdkAggregation.js +32 -38
- package/build/browser/new/useOsdkAggregation.js.map +1 -1
- package/build/browser/new/useOsdkFunctions.js +137 -0
- package/build/browser/new/useOsdkFunctions.js.map +1 -0
- package/build/browser/new/useOsdkObject.js +6 -2
- package/build/browser/new/useOsdkObject.js.map +1 -1
- package/build/browser/new/useOsdkObjects.js +36 -33
- package/build/browser/new/useOsdkObjects.js.map +1 -1
- package/build/browser/public/experimental/admin.js +5 -0
- package/build/browser/public/experimental/admin.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +18 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -0
- package/build/cjs/chunk-2N32USW5.cjs +28 -0
- package/build/cjs/chunk-2N32USW5.cjs.map +1 -0
- package/build/cjs/chunk-R4FZ5MUH.cjs +34 -0
- package/build/cjs/chunk-R4FZ5MUH.cjs.map +1 -0
- package/build/cjs/{chunk-SVVMLSKN.cjs → chunk-ZUNR45SJ.cjs} +15 -4
- package/build/cjs/chunk-ZUNR45SJ.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/experimental/admin.cjs +154 -7
- package/build/cjs/public/experimental/admin.cjs.map +1 -1
- package/build/cjs/public/experimental/admin.d.cts +159 -2
- package/build/cjs/public/experimental.cjs +170 -135
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.d.cts +21 -124
- package/build/cjs/public/unstable-do-not-use.cjs +114 -0
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
- package/build/cjs/public/unstable-do-not-use.d.cts +35 -0
- package/build/cjs/useOsdkFunction-B0s7lqgN.d.cts +121 -0
- package/build/esm/new/OsdkContext2.js +22 -2
- package/build/esm/new/OsdkContext2.js.map +1 -1
- package/build/esm/new/hookUtils.js +32 -0
- package/build/esm/new/hookUtils.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useCbacBanner.js +63 -0
- package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
- package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useMarkingCategories.js +46 -0
- package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useMarkings.js +46 -0
- package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -0
- package/build/esm/new/platform-apis/admin/useUserMarkings.js +50 -0
- package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -0
- package/build/esm/new/useLinks.js +13 -10
- package/build/esm/new/useLinks.js.map +1 -1
- package/build/esm/new/useObjectSet.js +45 -26
- package/build/esm/new/useObjectSet.js.map +1 -1
- package/build/esm/new/useOsdkAction.js +3 -6
- package/build/esm/new/useOsdkAction.js.map +1 -1
- package/build/esm/new/useOsdkAggregation.js +32 -38
- package/build/esm/new/useOsdkAggregation.js.map +1 -1
- package/build/esm/new/useOsdkFunctions.js +137 -0
- package/build/esm/new/useOsdkFunctions.js.map +1 -0
- package/build/esm/new/useOsdkObject.js +6 -2
- package/build/esm/new/useOsdkObject.js.map +1 -1
- package/build/esm/new/useOsdkObjects.js +36 -33
- package/build/esm/new/useOsdkObjects.js.map +1 -1
- package/build/esm/public/experimental/admin.js +5 -0
- package/build/esm/public/experimental/admin.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +18 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -0
- package/build/types/new/OsdkContext2.d.ts +1 -0
- package/build/types/new/OsdkContext2.d.ts.map +1 -1
- package/build/types/new/hookUtils.d.ts +7 -0
- package/build/types/new/hookUtils.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useCbacBanner.d.ts +33 -0
- package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts +34 -0
- package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts +27 -0
- package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useMarkings.d.ts +27 -0
- package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -0
- package/build/types/new/platform-apis/admin/useUserMarkings.d.ts +33 -0
- package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -0
- package/build/types/new/useLinks.d.ts.map +1 -1
- package/build/types/new/useObjectSet.d.ts +5 -2
- package/build/types/new/useObjectSet.d.ts.map +1 -1
- package/build/types/new/useOsdkAggregation.d.ts +1 -1
- package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
- package/build/types/new/useOsdkFunctions.d.ts +31 -0
- package/build/types/new/useOsdkFunctions.d.ts.map +1 -0
- package/build/types/new/useOsdkObject.d.ts +2 -1
- package/build/types/new/useOsdkObject.d.ts.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +10 -1
- package/build/types/new/useOsdkObjects.d.ts.map +1 -1
- package/build/types/public/experimental/admin.d.ts +8 -0
- package/build/types/public/experimental/admin.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +2 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
- package/package.json +19 -10
- package/unstable-do-not-use.d.ts +17 -0
- package/build/cjs/chunk-OVBG5VXE.cjs +0 -50
- package/build/cjs/chunk-OVBG5VXE.cjs.map +0 -1
- package/build/cjs/chunk-SVVMLSKN.cjs.map +0 -1
|
@@ -1 +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,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A,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/hookUtils.ts","../../../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","getWireObjectSet","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync"],"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;;;ACpBO,SAAS,mBAAA,CAAoB,SAAS,eAAiB,EAAA;AAC5D,EAAA,IAAI,OAAW,IAAA,OAAA,IAAW,OAAW,IAAA,OAAA,CAAQ,KAAO,EAAA;AAClD,IAAA,OAAO,OAAQ,CAAA,KAAA;AAAA;AAEjB,EAAI,IAAA,OAAA,EAAS,WAAW,OAAS,EAAA;AAC/B,IAAO,OAAA,IAAI,MAAM,eAAe,CAAA;AAAA;AAElC,EAAO,OAAA,MAAA;AACT;AACO,SAAS,gBAAA,CAA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/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 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\nexport function extractPayloadError(payload, fallbackMessage) {\n if (payload && \"error\" in payload && payload.error) {\n return payload.error;\n }\n if (payload?.status === \"error\") {\n return new Error(fallbackMessage);\n }\n return undefined;\n}\nexport function isPayloadLoading(payload, enabled) {\n if (!enabled) {\n return false;\n }\n return payload?.status === \"loading\" || payload?.status === \"init\" || !payload;\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 { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\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 canonOptions = observableClient.canonicalizeOptions({\n where: otherOptions.where,\n orderBy: otherOptions.orderBy,\n $select: otherOptions.$select\n });\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: canonOptions.where,\n pageSize: otherOptions.pageSize,\n orderBy: canonOptions.orderBy,\n mode: otherOptions.mode,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n ...(canonOptions.$select ? {\n select: canonOptions.$select\n } : {})\n }, observer), `links ${linkName} for ${objectsKey}`);\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, canonOptions.where, otherOptions.pageSize, canonOptions.orderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, canonOptions.$select]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => ({\n links: payload?.resolvedList,\n linkedObjectsBySourcePrimaryKey: payload?.linkedObjectsBySourcePrimaryKey ?? emptyMap,\n isLoading: isPayloadLoading(payload, enabled),\n isOptimistic: payload?.isOptimistic ?? false,\n error: extractPayloadError(payload, \"Failed to load links\"),\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 { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { extractPayloadError } from \"./hookUtils.js\";\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: enabledOption = true,\n streamUpdates,\n ...otherOptions\n } = options;\n const enabled = enabledOption && baseObjectSet != null;\n\n // Track object type to detect when we switch to a different object type\n const objectTypeKey = enabled && baseObjectSet ? 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 // canonicalizeOptions stabilizes complex query identity options.\n // pageSize is a view level concern (handled per subscriber, not part of\n // query identity), and pivotTo is a plain string that does not need\n // stabilization.\n const canonOptions = observableClient.canonicalizeOptions({\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n orderBy: otherOptions.orderBy,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n $select: otherOptions.$select\n });\n const objectSetKey = baseObjectSet ? JSON.stringify(getWireObjectSet(baseObjectSet)) : undefined;\n const baseObjectSetRef = React.useRef(baseObjectSet);\n baseObjectSetRef.current = baseObjectSet;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `objectSet [DISABLED]` : void 0);\n }\n const initialValue = objectTypeChanged ? undefined : previousCompletedPayloadRef.current;\n return makeExternalStore(observer => {\n if (!baseObjectSetRef.current) {\n return {\n unsubscribe: () => {}\n };\n }\n const subscription = observableClient.observeObjectSet(baseObjectSetRef.current, {\n where: canonOptions.where,\n withProperties: canonOptions.withProperties,\n union: canonOptions.union,\n intersect: canonOptions.intersect,\n subtract: canonOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: canonOptions.orderBy,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n autoFetchMore: otherOptions.autoFetchMore,\n streamUpdates,\n select: canonOptions.$select\n }, observer);\n return subscription;\n }, process.env.NODE_ENV !== \"production\" ? `objectSet ${objectTypeKey}` : void 0, initialValue);\n }, [enabled, observableClient, objectSetKey, canonOptions.where, canonOptions.withProperties, canonOptions.orderBy, canonOptions.union, canonOptions.intersect, canonOptions.subtract, canonOptions.$select, otherOptions.pivotTo, otherOptions.pageSize, otherOptions.autoFetchMore, otherOptions.dedupeIntervalMs, streamUpdates, objectTypeKey]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n if (payload && isPayloadCompleted(payload)) {\n previousCompletedPayloadRef.current = payload;\n }\n const typeApiName = baseObjectSet?.$objectSetInternals.def.apiName;\n const refetch = React.useCallback(async () => {\n if (typeApiName) {\n await observableClient.invalidateObjectType(typeApiName);\n }\n }, [observableClient, typeApiName]);\n return React.useMemo(() => {\n const lastLoaded = isPayloadCompleted(payload) ? payload : previousCompletedPayloadRef.current;\n return {\n data: lastLoaded?.resolvedList,\n isLoading: enabled ? !isPayloadCompleted(payload) : false,\n error: extractPayloadError(lastLoaded, \"Failed to load object set\"),\n isOptimistic: payload?.isOptimistic ?? false,\n fetchMore: payload?.hasMore ? payload.fetchMore : undefined,\n hasMore: payload?.hasMore ?? false,\n objectSet: lastLoaded?.objectSet,\n totalCount: lastLoaded?.totalCount,\n refetch\n };\n }, [payload, refetch, enabled]);\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 throw e;\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 abortControllerRef.current?.abort();\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 abortControllerRef.current?.abort();\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 { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\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,\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 canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n aggregate,\n intersectWith\n });\n const objectSetKey = objectSet ? JSON.stringify(getWireObjectSet(objectSet)) : undefined;\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n const currentObjectSet = objectSetRef.current;\n if (currentObjectSet) {\n return makeExternalStoreAsync(observer => observableClient.observeAggregation({\n type,\n objectSet: currentObjectSet,\n where: canonOptions.where,\n withProperties: canonOptions.withProperties,\n intersectWith: canonOptions.intersectWith,\n aggregate: canonOptions.aggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(canonOptions.where)}` : void 0);\n }\n return makeExternalStore(observer =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation({\n type,\n where: canonOptions.where,\n withProperties: canonOptions.withProperties,\n intersectWith: canonOptions.intersectWith,\n aggregate: canonOptions.aggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(canonOptions.where)}` : void 0);\n }, [observableClient, type.apiName, type.type, objectSetKey, canonOptions.where, canonOptions.withProperties, canonOptions.intersectWith, canonOptions.aggregate, 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 data: payload?.result,\n isLoading: isPayloadLoading(payload, true),\n error: extractPayloadError(payload, \"Failed to execute aggregation\"),\n refetch\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 { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\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 canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n orderBy,\n intersectWith,\n $select\n });\n const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);\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: canonOptions.where,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: canonOptions.orderBy,\n streamUpdates,\n withProperties: canonOptions.withProperties,\n autoFetchMore,\n ...(canonOptions.intersectWith ? {\n intersectWith: canonOptions.intersectWith\n } : {}),\n ...(pivotTo ? {\n pivotTo\n } : {}),\n ...(canonOptions.$select ? {\n select: canonOptions.$select\n } : {}),\n ...($loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata\n } : {})\n }, observer), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : \"\"} ${JSON.stringify(canonOptions.where)}` : void 0);\n }, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata]);\n const listPayload = 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 fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error: extractPayloadError(listPayload, \"Failed to load objects\"),\n data: listPayload?.resolvedList,\n isLoading: isPayloadLoading(listPayload, enabled),\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount,\n hasMore: listPayload?.hasMore ?? false,\n objectSet: listPayload?.objectSet,\n refetch\n }), [listPayload, enabled, 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\";\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,7 +1,8 @@
|
|
|
1
1
|
import { Client, Osdk, WhereClause, PropertyKeys, ActionDefinition, ActionEditResponse, ActionValidationError, ActionValidationResponse, ObjectTypeDefinition } from '@osdk/client';
|
|
2
|
-
import { ObservableClient, ActionSignatureFromDef
|
|
2
|
+
import { ObservableClient, ActionSignatureFromDef } from '@osdk/client/unstable-do-not-use';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { ObjectOrInterfaceDefinition, LinkNames, LinkedType, SimplePropertyDef, ObjectSet, WhereClause as WhereClause$1, DerivedProperty, PropertyKeys as PropertyKeys$1, Osdk as Osdk$1, AggregateOpts, AggregationsResults,
|
|
4
|
+
import { ObjectOrInterfaceDefinition, LinkNames, LinkedType, SimplePropertyDef, ObjectSet, WhereClause as WhereClause$1, DerivedProperty, PropertyKeys as PropertyKeys$1, Osdk as Osdk$1, AggregateOpts, AggregationsResults, PrimaryKeyType } from '@osdk/api';
|
|
5
|
+
export { U as UseOsdkFunctionOptions, a as UseOsdkFunctionResult, u as useOsdkFunction } from '../useOsdkFunction-B0s7lqgN.cjs';
|
|
5
6
|
export { U as UseOsdkMetadataResult, u as useOsdkClient, a as useOsdkMetadata } from '../useOsdkMetadata-BElt3F5s.cjs';
|
|
6
7
|
|
|
7
8
|
interface OsdkProviderOptions {
|
|
@@ -195,18 +196,21 @@ interface UseObjectSetResult<Q extends ObjectOrInterfaceDefinition, RDPs extends
|
|
|
195
196
|
* Any error that occurred during fetching
|
|
196
197
|
*/
|
|
197
198
|
error: Error | undefined;
|
|
199
|
+
isOptimistic: boolean;
|
|
198
200
|
/**
|
|
199
201
|
* Function to fetch more pages (undefined if no more pages)
|
|
200
202
|
*/
|
|
201
203
|
fetchMore: (() => Promise<void>) | undefined;
|
|
204
|
+
hasMore: boolean;
|
|
202
205
|
/**
|
|
203
206
|
* The final ObjectSet after all transformations
|
|
204
207
|
*/
|
|
205
|
-
objectSet: ObjectSet<Q, RDPs
|
|
208
|
+
objectSet: ObjectSet<Q, RDPs> | undefined;
|
|
206
209
|
/**
|
|
207
210
|
* The total count of objects matching the query (if available from the API)
|
|
208
211
|
*/
|
|
209
212
|
totalCount?: string;
|
|
213
|
+
refetch: () => Promise<void>;
|
|
210
214
|
}
|
|
211
215
|
/**
|
|
212
216
|
* React hook for observing and interacting with OSDK object sets.
|
|
@@ -219,7 +223,7 @@ interface UseObjectSetResult<Q extends ObjectOrInterfaceDefinition, RDPs extends
|
|
|
219
223
|
* @param options - Options for filtering, sorting, and adding new derived properties
|
|
220
224
|
* @returns Object set data with both existing and new derived properties
|
|
221
225
|
*/
|
|
222
|
-
declare function useObjectSet<Q extends ObjectOrInterfaceDefinition, BaseRDPs extends Record<string, SimplePropertyDef> = never, RDPs extends Record<string, SimplePropertyDef> = {}>(baseObjectSet: ObjectSet<Q, BaseRDPs
|
|
226
|
+
declare function useObjectSet<Q extends ObjectOrInterfaceDefinition, BaseRDPs extends Record<string, SimplePropertyDef> = never, RDPs extends Record<string, SimplePropertyDef> = {}>(baseObjectSet: ObjectSet<Q, BaseRDPs> | undefined, options?: UseObjectSetOptions<Q, RDPs>): UseObjectSetResult<Q, RDPs>;
|
|
223
227
|
|
|
224
228
|
type ApplyActionParams<Q extends ActionDefinition<any>> = Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0] & {
|
|
225
229
|
[K in keyof ObservableClient.ApplyActionOptions as `$${K}`]: ObservableClient.ApplyActionOptions[K];
|
|
@@ -289,7 +293,7 @@ interface UseOsdkAggregationResult<T extends ObjectOrInterfaceDefinition, A exte
|
|
|
289
293
|
data: AggregationsResults<T, A> | undefined;
|
|
290
294
|
isLoading: boolean;
|
|
291
295
|
error: Error | undefined;
|
|
292
|
-
refetch: () => void
|
|
296
|
+
refetch: () => Promise<void>;
|
|
293
297
|
}
|
|
294
298
|
/**
|
|
295
299
|
* React hook for performing aggregations on OSDK object sets.
|
|
@@ -326,123 +330,6 @@ interface UseOsdkAggregationResult<T extends ObjectOrInterfaceDefinition, A exte
|
|
|
326
330
|
declare function useOsdkAggregation<Q extends ObjectOrInterfaceDefinition, const A extends AggregateOpts<Q>, RDPs extends Record<string, SimplePropertyDef> = {}>(type: Q, options: UseOsdkAggregationOptions<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
|
|
327
331
|
declare function useOsdkAggregation<Q extends ObjectTypeDefinition, const A extends AggregateOpts<Q>, RDPs extends Record<string, SimplePropertyDef> = {}>(type: Q, options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
|
|
328
332
|
|
|
329
|
-
interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
|
|
330
|
-
/**
|
|
331
|
-
* Parameters to pass to the function.
|
|
332
|
-
* Must include all required parameters; optional parameters can be omitted.
|
|
333
|
-
*/
|
|
334
|
-
params?: CompileTimeMetadata<Q>["parameters"] extends Record<string, never> ? undefined : QueryParameterType<CompileTimeMetadata<Q>["parameters"]>;
|
|
335
|
-
/**
|
|
336
|
-
* Object types this function depends on.
|
|
337
|
-
* When actions modify objects of these types, the function will automatically refetch.
|
|
338
|
-
*
|
|
339
|
-
* @example
|
|
340
|
-
* ```tsx
|
|
341
|
-
* // Refetch when any Employee object changes
|
|
342
|
-
* { dependsOn: [Employee] }
|
|
343
|
-
* ```
|
|
344
|
-
*/
|
|
345
|
-
dependsOn?: Array<ObjectTypeDefinition$1 | string>;
|
|
346
|
-
/**
|
|
347
|
-
* Specific object instances or ObjectSets this function depends on.
|
|
348
|
-
* When any of these specific objects change, the function will refetch.
|
|
349
|
-
* More fine-grained than dependsOn for precise invalidation control.
|
|
350
|
-
*
|
|
351
|
-
* For ObjectSets, the object type is extracted asynchronously and changes
|
|
352
|
-
* to any object of that type will trigger a refetch.
|
|
353
|
-
*
|
|
354
|
-
* @example
|
|
355
|
-
* ```tsx
|
|
356
|
-
* // Refetch when this specific employee changes
|
|
357
|
-
* { dependsOnObjects: [employee] }
|
|
358
|
-
*
|
|
359
|
-
* // Refetch when any object in the ObjectSet's type changes
|
|
360
|
-
* { dependsOnObjects: [employeeObjectSet] }
|
|
361
|
-
* ```
|
|
362
|
-
*/
|
|
363
|
-
dependsOnObjects?: Array<Osdk$1.Instance<ObjectTypeDefinition$1> | ObjectSet<ObjectTypeDefinition$1>>;
|
|
364
|
-
/**
|
|
365
|
-
* The number of milliseconds to dedupe identical function calls.
|
|
366
|
-
* Two calls with the same function and params will share results
|
|
367
|
-
* if the second call is within this interval of the first.
|
|
368
|
-
* @default 2000
|
|
369
|
-
*/
|
|
370
|
-
dedupeIntervalMs?: number;
|
|
371
|
-
/**
|
|
372
|
-
* Whether to enable the query. When false, the query will not execute.
|
|
373
|
-
* Useful for:
|
|
374
|
-
* - Dependent queries that need to wait for other data
|
|
375
|
-
* - Conditional queries based on component state
|
|
376
|
-
*
|
|
377
|
-
* @default true
|
|
378
|
-
* @example
|
|
379
|
-
* // Dependent query - wait for required data
|
|
380
|
-
* const { data: employee } = useOsdkObject(Employee, employeeId);
|
|
381
|
-
* const { data: report } = useOsdkFunction(getEmployeeReport, {
|
|
382
|
-
* params: { employeeId: employee?.$primaryKey },
|
|
383
|
-
* enabled: !!employee
|
|
384
|
-
* });
|
|
385
|
-
*/
|
|
386
|
-
enabled?: boolean;
|
|
387
|
-
}
|
|
388
|
-
interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {
|
|
389
|
-
/**
|
|
390
|
-
* The function result, or undefined if not yet loaded or on error.
|
|
391
|
-
*/
|
|
392
|
-
data: (CompileTimeMetadata<Q>["signature"] extends (...args: never[]) => infer R ? Awaited<R> : never) | undefined;
|
|
393
|
-
/**
|
|
394
|
-
* True while the function is executing.
|
|
395
|
-
*/
|
|
396
|
-
isLoading: boolean;
|
|
397
|
-
/**
|
|
398
|
-
* Error if the function execution failed.
|
|
399
|
-
*/
|
|
400
|
-
error: Error | undefined;
|
|
401
|
-
/**
|
|
402
|
-
* Timestamp (ms since epoch) of when the result was last fetched.
|
|
403
|
-
*/
|
|
404
|
-
lastUpdated: number;
|
|
405
|
-
/**
|
|
406
|
-
* Manually refetch the function.
|
|
407
|
-
* Useful for "pull to refresh" or retry patterns.
|
|
408
|
-
*/
|
|
409
|
-
refetch: () => void;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* React hook for executing and observing OSDK functions.
|
|
413
|
-
*
|
|
414
|
-
* Provides automatic caching, deduplication, and reactive updates for function calls.
|
|
415
|
-
* Functions are automatically re-fetched when dependencies change (configured via options).
|
|
416
|
-
*
|
|
417
|
-
* @param queryDef - The QueryDefinition to execute
|
|
418
|
-
* @param options - Configuration options for the function call
|
|
419
|
-
* @returns Object containing result, loading state, error, and refetch function
|
|
420
|
-
*
|
|
421
|
-
* @example Basic usage
|
|
422
|
-
* ```tsx
|
|
423
|
-
* const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {
|
|
424
|
-
* params: { departmentId: "engineering" }
|
|
425
|
-
* });
|
|
426
|
-
* ```
|
|
427
|
-
*
|
|
428
|
-
* @example With dependency tracking
|
|
429
|
-
* ```tsx
|
|
430
|
-
* const { data, refetch } = useOsdkFunction(calculateMetrics, {
|
|
431
|
-
* params: { startDate, endDate },
|
|
432
|
-
* dependsOn: [Employee, Project],
|
|
433
|
-
* });
|
|
434
|
-
* ```
|
|
435
|
-
*
|
|
436
|
-
* @example With specific object dependencies
|
|
437
|
-
* ```tsx
|
|
438
|
-
* const { data } = useOsdkFunction(getEmployeeReport, {
|
|
439
|
-
* params: { employeeId: employee.$primaryKey },
|
|
440
|
-
* dependsOnObjects: [employee],
|
|
441
|
-
* });
|
|
442
|
-
* ```
|
|
443
|
-
*/
|
|
444
|
-
declare function useOsdkFunction<Q extends QueryDefinition<unknown>>(queryDef: Q, options?: UseOsdkFunctionOptions<Q>): UseOsdkFunctionResult<Q>;
|
|
445
|
-
|
|
446
333
|
interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {
|
|
447
334
|
object: Osdk$1.Instance<Q> | undefined;
|
|
448
335
|
isLoading: boolean;
|
|
@@ -471,11 +358,12 @@ declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, p
|
|
|
471
358
|
*
|
|
472
359
|
* @param type The object type or interface definition
|
|
473
360
|
* @param primaryKey The primary key of the object
|
|
474
|
-
* @param options Options including $select and
|
|
361
|
+
* @param options Options including $select, enabled, and $loadPropertySecurityMetadata
|
|
475
362
|
*/
|
|
476
363
|
declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, options?: {
|
|
477
364
|
$select?: readonly PropertyKeys$1<Q>[];
|
|
478
365
|
enabled?: boolean;
|
|
366
|
+
$loadPropertySecurityMetadata?: boolean;
|
|
479
367
|
}): UseOsdkObjectResult<Q>;
|
|
480
368
|
|
|
481
369
|
interface UseOsdkObjectsOptions<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
@@ -569,6 +457,12 @@ interface UseOsdkObjectsOptions<T extends ObjectOrInterfaceDefinition, RDPs exte
|
|
|
569
457
|
* useOsdkObjects(Employee, { $select: ["name", "status"] })
|
|
570
458
|
*/
|
|
571
459
|
$select?: readonly PropertyKeys$1<T>[];
|
|
460
|
+
/**
|
|
461
|
+
* When true, loads per-property security metadata (marking requirements)
|
|
462
|
+
* alongside each object. The returned objects will have `$propertySecurities`
|
|
463
|
+
* populated with conjunctive/disjunctive marking requirements per property.
|
|
464
|
+
*/
|
|
465
|
+
$loadPropertySecurityMetadata?: boolean;
|
|
572
466
|
}
|
|
573
467
|
interface UseOsdkListResult<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}, EXTRA_OPTIONS extends never | "$rid" = never> {
|
|
574
468
|
/**
|
|
@@ -599,6 +493,9 @@ interface UseOsdkListResult<T extends ObjectOrInterfaceDefinition, RDPs extends
|
|
|
599
493
|
* The total count of objects matching the query (if available from the API)
|
|
600
494
|
*/
|
|
601
495
|
totalCount?: string;
|
|
496
|
+
hasMore: boolean;
|
|
497
|
+
objectSet: ObjectSet<T, RDPs> | undefined;
|
|
498
|
+
refetch: () => Promise<void>;
|
|
602
499
|
}
|
|
603
500
|
declare function useOsdkObjects<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>>(type: Q, options: UseOsdkObjectsOptions<Q> & {
|
|
604
501
|
pivotTo: L;
|
|
@@ -647,4 +544,4 @@ interface DebouncedCallback<TArgs extends readonly unknown[]> {
|
|
|
647
544
|
*/
|
|
648
545
|
declare function useDebouncedCallback<TArgs extends readonly unknown[]>(callback: (...args: TArgs) => void | Promise<void>, delay: number): DebouncedCallback<TArgs>;
|
|
649
546
|
|
|
650
|
-
export { OsdkProvider2, type UseOsdkAggregationResult, type
|
|
547
|
+
export { OsdkProvider2, type UseOsdkAggregationResult, type UseOsdkListResult, type UseOsdkObjectsOptions, useDebouncedCallback, useLinks, useObjectSet, useOsdkAction, useOsdkAggregation, useOsdkObject, useOsdkObjects };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk2N32USW5_cjs = require('../chunk-2N32USW5.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
9
|
+
|
|
10
|
+
function useOsdkFunctions({
|
|
11
|
+
queries,
|
|
12
|
+
enabled = true
|
|
13
|
+
}) {
|
|
14
|
+
const client = chunk2N32USW5_cjs.useOsdkClient();
|
|
15
|
+
const [results, setResults] = React__default.default.useState(() => queries.map(() => ({
|
|
16
|
+
data: void 0,
|
|
17
|
+
isLoading: false,
|
|
18
|
+
error: void 0,
|
|
19
|
+
lastUpdated: 0
|
|
20
|
+
})));
|
|
21
|
+
const abortControllerRef = React__default.default.useRef(null);
|
|
22
|
+
React__default.default.useEffect(() => {
|
|
23
|
+
if (!enabled || queries.length === 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
abortControllerRef.current?.abort();
|
|
27
|
+
const abortController = new AbortController();
|
|
28
|
+
abortControllerRef.current = abortController;
|
|
29
|
+
const executeQueries = async () => {
|
|
30
|
+
setResults((prev) => queries.map((_, index) => ({
|
|
31
|
+
data: prev[index]?.data,
|
|
32
|
+
// Preserving existing data
|
|
33
|
+
isLoading: queries[index].options?.enabled !== false,
|
|
34
|
+
error: void 0,
|
|
35
|
+
lastUpdated: prev[index]?.lastUpdated || 0
|
|
36
|
+
})));
|
|
37
|
+
for await (const queryResult of executeQueriesGenerator(queries, client)) {
|
|
38
|
+
const {
|
|
39
|
+
index,
|
|
40
|
+
result,
|
|
41
|
+
error
|
|
42
|
+
} = queryResult;
|
|
43
|
+
if (abortController.signal.aborted) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
setResults((prev) => {
|
|
47
|
+
if (abortController.signal.aborted) {
|
|
48
|
+
return prev;
|
|
49
|
+
}
|
|
50
|
+
const newResults = [...prev];
|
|
51
|
+
newResults[index] = {
|
|
52
|
+
data: result,
|
|
53
|
+
isLoading: false,
|
|
54
|
+
error: error instanceof Error ? error : error ? new Error(typeof error === "string" ? error : JSON.stringify(error)) : void 0,
|
|
55
|
+
lastUpdated: Date.now()
|
|
56
|
+
};
|
|
57
|
+
return newResults;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
void executeQueries();
|
|
62
|
+
return () => {
|
|
63
|
+
abortController.abort();
|
|
64
|
+
};
|
|
65
|
+
}, [enabled, client, queries]);
|
|
66
|
+
return results;
|
|
67
|
+
}
|
|
68
|
+
async function* executeQueriesGenerator(queries, client) {
|
|
69
|
+
const queryPromises = queries.map((query, index) => createQueryPromise(query, index, client));
|
|
70
|
+
const pendingPromises = [...queryPromises];
|
|
71
|
+
while (pendingPromises.length > 0) {
|
|
72
|
+
const raceResult = await Promise.race(pendingPromises.map((promise, idx) => promise.then((result) => ({
|
|
73
|
+
result,
|
|
74
|
+
idx
|
|
75
|
+
}))));
|
|
76
|
+
yield raceResult.result;
|
|
77
|
+
void pendingPromises.splice(raceResult.idx, 1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
var createQueryPromise = async (query, index, client) => {
|
|
81
|
+
if (query.options?.enabled === false) {
|
|
82
|
+
return {
|
|
83
|
+
index,
|
|
84
|
+
result: void 0,
|
|
85
|
+
error: void 0
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const queryClient = client(query.queryDefinition);
|
|
89
|
+
if ("executeFunction" in queryClient && typeof queryClient.executeFunction === "function") {
|
|
90
|
+
try {
|
|
91
|
+
const result = await queryClient.executeFunction(query.options?.params);
|
|
92
|
+
return {
|
|
93
|
+
index,
|
|
94
|
+
result,
|
|
95
|
+
error: null
|
|
96
|
+
};
|
|
97
|
+
} catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
index,
|
|
100
|
+
result: void 0,
|
|
101
|
+
error
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
index,
|
|
107
|
+
result: void 0,
|
|
108
|
+
error: new Error("Invalid query client: executeFunction method not found")
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.useOsdkFunctions = useOsdkFunctions;
|
|
113
|
+
//# sourceMappingURL=unstable-do-not-use.cjs.map
|
|
114
|
+
//# sourceMappingURL=unstable-do-not-use.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/new/useOsdkFunctions.ts"],"names":["useOsdkClient","React"],"mappings":";;;;;;;;;AAyBO,SAAS,gBAAiB,CAAA;AAAA,EAC/B,OAAA;AAAA,EACA,OAAU,GAAA;AACZ,CAAG,EAAA;AACD,EAAA,MAAM,SAASA,+BAAc,EAAA;AAC7B,EAAM,MAAA,CAAC,SAAS,UAAU,CAAA,GAAIC,uBAAM,QAAS,CAAA,MAAM,OAAQ,CAAA,GAAA,CAAI,OAAO;AAAA,IACpE,IAAM,EAAA,MAAA;AAAA,IACN,SAAW,EAAA,KAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,IACP,WAAa,EAAA;AAAA,IACb,CAAC,CAAA;AACH,EAAM,MAAA,kBAAA,GAAqBA,sBAAM,CAAA,MAAA,CAAO,IAAI,CAAA;AAC5C,EAAAA,sBAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IAAI,CAAC,OAAA,IAAW,OAAQ,CAAA,MAAA,KAAW,CAAG,EAAA;AACpC,MAAA;AAAA;AAIF,IAAA,kBAAA,CAAmB,SAAS,KAAM,EAAA;AAClC,IAAM,MAAA,eAAA,GAAkB,IAAI,eAAgB,EAAA;AAC5C,IAAA,kBAAA,CAAmB,OAAU,GAAA,eAAA;AAC7B,IAAA,MAAM,iBAAiB,YAAY;AAEjC,MAAA,UAAA,CAAW,CAAQ,IAAA,KAAA,OAAA,CAAQ,GAAI,CAAA,CAAC,GAAG,KAAW,MAAA;AAAA,QAC5C,IAAA,EAAM,IAAK,CAAA,KAAK,CAAG,EAAA,IAAA;AAAA;AAAA,QAEnB,SAAW,EAAA,OAAA,CAA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AAA;AAAA,QACR;AAAA,OACF;AAAA;AACF;AAEF,EAAO,OAAA;AAAA,IACL,KAAA;AAAA,IACA,MAAQ,EAAA,MAAA;AAAA,IACR,KAAA,EAAO,IAAI,KAAA,CAAM,wDAAwD;AAAA,GAC3E;AACF,CAAA","file":"unstable-do-not-use.cjs","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 React from \"react\";\nimport { useOsdkClient } from \"../useOsdkClient.js\";\n/**\n * React hook for executing multiple OSDK function queries in parallel.\n * Results are returned in the same order as the input queries.\n *\n * @param options - Configuration options containing the queries to execute\n * @returns Array of results in the same order as input queries, each with the same shape as useOsdkFunction\n */\nexport function useOsdkFunctions({\n queries,\n enabled = true\n}) {\n const client = useOsdkClient();\n const [results, setResults] = React.useState(() => queries.map(() => ({\n data: undefined,\n isLoading: false,\n error: undefined,\n lastUpdated: 0\n })));\n const abortControllerRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled || queries.length === 0) {\n return;\n }\n\n // Cancel previous requests\n abortControllerRef.current?.abort();\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n const executeQueries = async () => {\n // Initialize loading state for all queries\n setResults(prev => queries.map((_, index) => ({\n data: prev[index]?.data,\n // Preserving existing data\n isLoading: queries[index].options?.enabled !== false,\n error: undefined,\n lastUpdated: prev[index]?.lastUpdated || 0\n })));\n for await (const queryResult of executeQueriesGenerator(queries, client)) {\n const {\n index,\n result,\n error\n } = queryResult;\n if (abortController.signal.aborted) {\n break;\n }\n setResults(prev => {\n if (abortController.signal.aborted) {\n return prev;\n }\n const newResults = [...prev];\n newResults[index] = {\n data: result,\n isLoading: false,\n error: error instanceof Error ? error : error ? new Error(typeof error === \"string\" ? error : JSON.stringify(error)) : undefined,\n lastUpdated: Date.now()\n };\n return newResults;\n });\n }\n };\n void executeQueries();\n return () => {\n abortController.abort();\n };\n }, [enabled, client, queries]);\n return results;\n}\n/**\n * Generator function that executes queries and yields results as they complete\n */\nasync function* executeQueriesGenerator(queries, client) {\n const queryPromises = queries.map((query, index) => createQueryPromise(query, index, client));\n const pendingPromises = [...queryPromises];\n\n // Yield results as they complete using Promise.race\n while (pendingPromises.length > 0) {\n const raceResult = await Promise.race(pendingPromises.map((promise, idx) => promise.then(result => ({\n result,\n idx\n }))));\n yield raceResult.result;\n\n // Remove the completed promise from the pending list\n void pendingPromises.splice(raceResult.idx, 1);\n }\n}\nconst createQueryPromise = async (query, index, client) => {\n // Skip disabled queries\n if (query.options?.enabled === false) {\n return {\n index,\n result: undefined,\n error: undefined\n };\n }\n const queryClient = client(query.queryDefinition);\n if (\"executeFunction\" in queryClient && typeof queryClient.executeFunction === \"function\") {\n try {\n const result = await queryClient.executeFunction(query.options?.params);\n return {\n index,\n result,\n error: null\n };\n } catch (error) {\n return {\n index,\n result: undefined,\n error\n };\n }\n }\n return {\n index,\n result: undefined,\n error: new Error(\"Invalid query client: executeFunction method not found\")\n };\n};"]}
|