@osdk/react 2.21.1-main-b0de21be6aaebd0dbe37efad412932940f4d1a5e → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -6
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-R5UXL5ZO.cjs → chunk-32NABBD6.cjs} +3 -3
- package/build/cjs/chunk-32NABBD6.cjs.map +1 -0
- package/build/cjs/index.cjs +15 -15
- package/build/cjs/public/experimental.cjs +16 -16
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/package.json +6 -6
- package/build/cjs/chunk-R5UXL5ZO.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
# @osdkkit/react
|
|
2
2
|
|
|
3
|
-
## 2.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- @osdk/api@2.21.1-main-b0de21be6aaebd0dbe37efad412932940f4d1a5e
|
|
8
|
-
- @osdk/client@2.21.1-main-b0de21be6aaebd0dbe37efad412932940f4d1a5e
|
|
3
|
+
## 2.22.0
|
|
9
4
|
|
|
10
5
|
## 2.21.0
|
|
11
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["REACT_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT: string =\n `osdk-react/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,gBAAwB,GACnC,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["REACT_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT: string =\n `osdk-react/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,gBAAwB,GACnC,wBAA2C","ignoreList":[]}
|
|
@@ -17,7 +17,7 @@ function useStableObjectSet(objectSet) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// src/util/UserAgent.ts
|
|
20
|
-
var REACT_USER_AGENT = `osdk-react/${"2.
|
|
20
|
+
var REACT_USER_AGENT = `osdk-react/${"2.22.0"}`;
|
|
21
21
|
function useDevToolsClient(baseClient, enabled) {
|
|
22
22
|
const stateRef = React5.useRef(null);
|
|
23
23
|
const prev = stateRef.current;
|
|
@@ -874,5 +874,5 @@ exports.useOsdkObject = useOsdkObject;
|
|
|
874
874
|
exports.useOsdkObjects = useOsdkObjects;
|
|
875
875
|
exports.useRegisterUserAgent = useRegisterUserAgent;
|
|
876
876
|
exports.useStableObjectSet = useStableObjectSet;
|
|
877
|
-
//# sourceMappingURL=chunk-
|
|
878
|
-
//# sourceMappingURL=chunk-
|
|
877
|
+
//# sourceMappingURL=chunk-32NABBD6.cjs.map
|
|
878
|
+
//# sourceMappingURL=chunk-32NABBD6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/new/core/useStableObjectSet.ts","../../src/util/UserAgent.ts","../../src/new/useDevToolsClient.ts","../../src/new/UserAgentContext.ts","../../src/new/OsdkProvider.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/createCompositeExternalStore.ts","../../src/new/getStableQueriesKey.ts","../../src/new/useOsdkFunctions.ts","../../src/new/useOsdkObject.ts","../../src/new/useOsdkObjects.ts","../../src/new/core/useOnMount.ts","../../src/new/useRegisterUserAgent.ts","../../src/useOsdkClient.ts","../../src/useOsdkMetadata.ts","../../src/utils/useDebouncedCallback.ts"],"names":["getWireObjectSet","useMemo","useRef","getRegisteredDevTools","React","useCallback","createObservableClient","OsdkContext","makeExternalStore","devToolsMetadata","useDevToolsMetadata","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","isObjectSet","useEffect","error"],"mappings":";;;;;;;;;;;;;AAyBO,SAAS,mBAAmB,SAAA,EAAW;AAC5C,EAAA,MAAM,UAAU,SAAA,GAAY,IAAA,CAAK,UAAUA,uBAAA,CAAiB,SAAS,CAAC,CAAA,GAAI,MAAA;AAE1E,EAAA,OAAOC,cAAA,CAAQ,MAAM,SAAA,EAAW,CAAC,OAAO,CAAC,CAAA;AAC3C;;;ACbO,IAAM,gBAAA,GAAmB,cAAc,QAA2B,CAAA,CAAA;ACElE,SAAS,iBAAA,CAAkB,YAAY,OAAA,EAAS;AACrD,EAAA,MAAM,QAAA,GAAWC,cAAO,IAAI,CAAA;AAC5B,EAAA,MAAM,OAAO,QAAA,CAAS,OAAA;AACtB,EAA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AA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAA,GAAU,MAAA;AAAA,IACvB;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,KAAA,GAAQA,uBAAAA,CAAM,WAAA,CAAY,MAAM;AACpC,IAAA,IAAI,UAAA,CAAW,OAAA,IAAW,WAAA,CAAY,OAAA,EAAS;AAC7C,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAA,GAAU,MAAA;AACrB,MAAA,KAAK,WAAA,CAAY,OAAA,CAAQ,GAAG,WAAA,CAAY,OAAO,CAAA;AAAA,IACjD;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,iBAAA,GAAoBA,uBAAAA,CAAM,WAAA,CAAY,CAAA,GAAI,IAAA,KAAS;AACvD,IAAA,WAAA,CAAY,OAAA,GAAU,IAAA;AACtB,IAAA,MAAA,EAAO;AACP,IAAA,UAAA,CAAW,OAAA,GAAU,WAAW,MAAM;AACpC,MAAA,KAAK,WAAA,CAAY,OAAA,CAAQ,GAAG,IAAI,CAAA;AAAA,IAClC,GAAG,KAAK,CAAA;AAAA,EACV,CAAA,EAAG,CAAC,KAAA,EAAO,MAAM,CAAC,CAAA;AAClB,EAAAA,uBAAAA,CAAM,UAAU,MAAM;AACpB,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,EAAO;AAAA,IACT,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AACX,EAAA,OAAO,MAAA,CAAO,OAAO,iBAAA,EAAmB;AAAA,IACtC,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"chunk-32NABBD6.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 { getWireObjectSet } from \"@osdk/client\";\nimport { useMemo } from \"react\";\n\n/**\n * Returns a referentially stable ObjectSet that only changes when the\n * wire representation changes. This uses `getWireObjectSet` which includes\n * composed operations (where, union, intersect, etc.) in the serialized\n * form, unlike plain `JSON.stringify(objectSet)` which may not capture them.\n */\nexport function useStableObjectSet(objectSet) {\n const wireKey = objectSet ? JSON.stringify(getWireObjectSet(objectSet)) : undefined;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objectSet, [wireKey]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT = `osdk-react/${process.env.PACKAGE_VERSION}`;","/*\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 { useMemo, useRef } from \"react\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nexport function useDevToolsClient(baseClient, enabled) {\n const stateRef = useRef(null);\n const prev = stateRef.current;\n let wrappedClient;\n if (!enabled) {\n stateRef.current = null;\n wrappedClient = baseClient;\n } else {\n const devTools = getRegisteredDevTools();\n if (devTools == null) {\n stateRef.current = null;\n wrappedClient = baseClient;\n } else if (prev != null && prev.base === baseClient && prev.devTools === devTools) {\n wrappedClient = prev.monitored;\n } else {\n const monitored = devTools.wrapClient(baseClient);\n stateRef.current = {\n base: baseClient,\n monitored,\n devTools\n };\n wrappedClient = monitored;\n }\n }\n const currentState = stateRef.current;\n const wrapChildren = useMemo(() => currentState != null ? children => currentState.devTools.wrapChildren(children, currentState.monitored) : null, [currentState]);\n return {\n client: wrappedClient,\n wrapChildren\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 React from \"react\";\nexport const UserAgentContext = /*#__PURE__*/React.createContext(() => () => {});","/*\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/observable\";\nimport React, { useCallback, useMemo, useRef } from \"react\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nimport { REACT_USER_AGENT } from \"../util/UserAgent.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nimport { useDevToolsClient } from \"./useDevToolsClient.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\nconst __DEV__ = typeof process === \"undefined\" || process.env.NODE_ENV !== \"production\";\nexport function OsdkProvider({\n children,\n client,\n enableDevTools\n}) {\n const devtoolsEnabled = __DEV__ && (enableDevTools ?? getRegisteredDevTools() != null);\n const userAgentsRef = useRef(new Set([REACT_USER_AGENT]));\n const addUserAgent = useCallback(agent => {\n userAgentsRef.current.add(agent);\n return () => {\n userAgentsRef.current.delete(agent);\n };\n }, []);\n const baseObservableClient = useMemo(() => createObservableClient(client, () => [...userAgentsRef.current]), [client]);\n const {\n client: devToolsClient,\n wrapChildren\n } = useDevToolsClient(baseObservableClient, devtoolsEnabled);\n const content = wrapChildren?.(children) ?? children;\n const contextValue = useMemo(() => ({\n client,\n observableClient: devToolsClient,\n devtoolsEnabled\n }), [client, devToolsClient, devtoolsEnabled]);\n return /*#__PURE__*/React.createElement(UserAgentContext.Provider, {\n value: addUserAgent\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: contextValue\n }, content));\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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\n const {\n enabled = true,\n $includeAllBaseObjectProperties,\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 }), devToolsMetadata({\n hookType: \"useLinks\",\n sourceObjectType: objectsArray[0]?.$apiName,\n linkName\n }));\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 $includeAllBaseObjectProperties,\n ...(canonOptions.$select ? {\n select: canonOptions.$select\n } : {})\n }, observer), devToolsMetadata({\n hookType: \"useLinks\",\n sourceObjectType: objectsArray[0]?.$apiName,\n linkName\n }));\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, canonOptions.where, otherOptions.pageSize, canonOptions.orderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, canonOptions.$select, $includeAllBaseObjectProperties]);\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\";\nimport React from \"react\";\nimport { extractPayloadError } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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 */\n// pivotTo overload: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\n\n// Non-pivotTo overload: pivotTo is forbidden to prevent fallthrough.\n\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 // TODO: Is it expected to only clear the previousCompletedPayloadRef when the object type changes?\n // What if the same object type is queried with different filters, should we also clear the cache?\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 }), devToolsMetadata({\n hookType: \"useObjectSet\",\n objectType: objectTypeKey\n }));\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 }, devToolsMetadata({\n hookType: \"useObjectSet\",\n objectType: objectTypeKey\n }), 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 { useDevToolsMetadata } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient,\n devtoolsEnabled\n } = React.useContext(OsdkContext);\n useDevToolsMetadata(devtoolsEnabled, \"useOsdkAction\", actionDef.apiName);\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\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\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), devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate\n }));\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), devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate\n }));\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\";\nimport React from \"react\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\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 }), devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName\n }));\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName\n }));\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await 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 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\n/**\n * Creates a composite external store that manages N function subscriptions\n * through a single `useSyncExternalStore` interface.\n *\n * Unlike `makeExternalStore` (which wraps a single Observer), this manages\n * N observers funneled into one snapshot array. Supports optional concurrency\n * limiting via `maxConcurrent` to stagger subscriptions.\n */\nexport function createCompositeExternalStore(queries, observableClient, maxConcurrent) {\n // Mutable snapshot array — replaced (never mutated in place) on each\n // observer callback so that useSyncExternalStore sees a new reference.\n let current = queries.map(() => undefined);\n const updateSlot = (index, value) => {\n const next = [...current];\n next[index] = value;\n current = next;\n };\n function observeQuery(query, index, notifyUpdate, onSettled) {\n const {\n params,\n dedupeIntervalMs,\n dependsOn,\n dependsOnObjects\n } = query.options ?? {};\n return observableClient.observeFunction(query.queryDefinition, params, {\n dependsOn,\n dependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, {\n next: payload => {\n updateSlot(index, payload);\n notifyUpdate();\n if (payload?.status === \"loaded\" || payload?.status === \"error\") {\n onSettled();\n }\n },\n error: error => {\n updateSlot(index, {\n ...(current[index] ?? {}),\n error: error instanceof Error ? error : new Error(String(error))\n });\n notifyUpdate();\n onSettled();\n },\n complete: () => {}\n });\n }\n function getEnabledIndices() {\n return queries.map((q, i) => q.options?.enabled !== false ? i : -1).filter(i => i !== -1);\n }\n function subscribe(notifyUpdate) {\n const subscriptions = [];\n const enabledIndices = getEnabledIndices();\n const subscribeAt = queueIdx => {\n if (queueIdx >= enabledIndices.length) return;\n const index = enabledIndices[queueIdx];\n const onSettled = maxConcurrent != null ? () => subscribeAt(queueIdx + maxConcurrent) : () => {};\n subscriptions.push(observeQuery(queries[index], index, notifyUpdate, onSettled));\n };\n\n // When staggering, only start the first `maxConcurrent` queries.\n // Each calls subscribeAt(queueIdx + maxConcurrent) when it settles,\n // creating a sliding window of concurrent subscriptions.\n const initialCount = maxConcurrent != null ? Math.min(maxConcurrent, enabledIndices.length) : enabledIndices.length;\n for (let i = 0; i < initialCount; i++) {\n subscribeAt(i);\n }\n return () => subscriptions.forEach(sub => sub.unsubscribe());\n }\n return {\n getSnapshot: () => current,\n subscribe\n };\n}\nconst EMPTY_SNAPSHOTS = [];\nexport const EMPTY_STORE = {\n subscribe: () => () => {},\n getSnapshot: () => EMPTY_SNAPSHOTS\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getWireObjectSet, isObjectSet } from \"@osdk/client\";\n/**\n * Builds a stable string key for an array of function queries.\n *\n * Uses a JSON.stringify replacer to substitute any ObjectSet with its wire representation,\n * so composed operations (where/union/intersect) participate in the key\n * - plain JSON.stringify would not capture them.\n */\nexport function getStableQueriesKey(queries) {\n return JSON.stringify(queries.map(q => ({\n apiName: q.queryDefinition.apiName,\n ...q.options\n })), (_key, value) => isObjectSet(value) ? getWireObjectSet(value) : value);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createCompositeExternalStore, EMPTY_STORE } from \"./createCompositeExternalStore.js\";\nimport { getStableQueriesKey } from \"./getStableQueriesKey.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n/**\n * React hook for executing multiple OSDK function queries in parallel.\n *\n * This hook executes multiple function queries with individual configurations,\n * with automatic caching and deduplication via the ObservableClient.\n * Results are returned in the same order as the input queries.\n *\n * Queries with identical function+params share cached results through the\n * Store layer, avoiding duplicate network requests across components.\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 maxConcurrent\n}) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\n const stableQueriesKey = getStableQueriesKey(queries);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableQueries = React.useMemo(() => queries, [stableQueriesKey]);\n const {\n subscribe,\n getSnapshot\n } = React.useMemo(() => !enabled || stableQueries.length === 0 ? EMPTY_STORE : createCompositeExternalStore(stableQueries, observableClient, maxConcurrent), [enabled, maxConcurrent, observableClient, stableQueries]);\n const payloads = React.useSyncExternalStore(subscribe, getSnapshot);\n const refetches = React.useMemo(() => stableQueries.map(query => async () => {\n await observableClient.invalidateFunction(query.queryDefinition, query.options?.params);\n }), [stableQueries, observableClient]);\n return React.useMemo(() => stableQueries.map((_, index) => {\n const payload = payloads[index];\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: refetches[index]\n };\n }), [stableQueries, payloads, refetches]);\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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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, $loadPropertySecurityMetadata,\n * and $includeAllBaseObjectProperties\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 includeAllBaseObjectProperties = optionsArg?.$includeAllBaseObjectProperties;\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 }), devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey)\n }));\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n $includeAllBaseObjectProperties: includeAllBaseObjectProperties,\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...(loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata\n } : {})\n }, observer), devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey)\n }));\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata, includeAllBaseObjectProperties]);\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 // Errors take precedence over loading state.\n isLoading: enabled && error == null ? 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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\n\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 $includeAllBaseObjectProperties\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 }), devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName\n }));\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 $includeAllBaseObjectProperties,\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), devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize\n }));\n }, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties]);\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 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 { useEffect } from \"react\";\n\n/**\n * Runs an effect exactly once on mount. The callback's return value\n * is used as the cleanup function, just like `useEffect`.\n *\n * This is a semantic wrapper around `useEffect(() => …, [])` that\n * makes the intent explicit and avoids needing an eslint-disable\n * for `react-hooks/exhaustive-deps`.\n */\nexport function useOnMount(effect) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, []);\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 { useOnMount } from \"./core/useOnMount.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\nexport function useRegisterUserAgent(agent) {\n const addUserAgent = React.useContext(UserAgentContext);\n useOnMount(() => {\n return addUserAgent(agent);\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { OsdkContext } from \"./new/OsdkContext.js\";\nexport function useOsdkClient() {\n return React.useContext(OsdkContext).client;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\nexport function useOsdkMetadata(type) {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState(undefined);\n const [error, setError] = React.useState();\n if (!metadata && !error) {\n client.fetchMetadata(type).then(fetchedMetadata => {\n setMetadata(fetchedMetadata);\n }).catch(error => {\n const errorMessage = error instanceof Error ? error.message : String(error);\n setError(errorMessage);\n });\n return {\n loading: true\n };\n }\n return {\n loading: false,\n metadata,\n error\n };\n}","/*\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}"]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk32NABBD6_cjs = require('./chunk-32NABBD6.cjs');
|
|
4
4
|
var chunkOGP2DK2V_cjs = require('./chunk-OGP2DK2V.cjs');
|
|
5
5
|
require('./chunk-UKQGMTMG.cjs');
|
|
6
6
|
var chunkDO3NFBKN_cjs = require('./chunk-DO3NFBKN.cjs');
|
|
@@ -16,59 +16,59 @@ function useObservableClient() {
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "OsdkProvider", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk32NABBD6_cjs.OsdkProvider; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "useDebouncedCallback", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk32NABBD6_cjs.useDebouncedCallback; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "useLinks", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk32NABBD6_cjs.useLinks; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "useObjectSet", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk32NABBD6_cjs.useObjectSet; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "useOsdkAction", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkAction; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "useOsdkAggregation", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkAggregation; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "useOsdkClient", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkClient; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "useOsdkFunction", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkFunction; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "useOsdkFunctions", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkFunctions; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "useOsdkMetadata", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkMetadata; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "useOsdkObject", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkObject; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "useOsdkObjects", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkObjects; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "useRegisterUserAgent", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk32NABBD6_cjs.useRegisterUserAgent; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "useStableObjectSet", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk32NABBD6_cjs.useStableObjectSet; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "getRegisteredDevTools", {
|
|
74
74
|
enumerable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk32NABBD6_cjs = require('../chunk-32NABBD6.cjs');
|
|
4
4
|
var chunkOGP2DK2V_cjs = require('../chunk-OGP2DK2V.cjs');
|
|
5
5
|
require('../chunk-UKQGMTMG.cjs');
|
|
6
6
|
require('../chunk-DO3NFBKN.cjs');
|
|
@@ -9,63 +9,63 @@ require('../chunk-DO3NFBKN.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "OsdkProvider2", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunk32NABBD6_cjs.OsdkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "useDebouncedCallback", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk32NABBD6_cjs.useDebouncedCallback; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "useLinks", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk32NABBD6_cjs.useLinks; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "useObjectSet", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk32NABBD6_cjs.useObjectSet; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "useOsdkAction", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkAction; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useOsdkAggregation", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkAggregation; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "useOsdkClient", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkClient; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "useOsdkClient2", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkClient; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "useOsdkFunction", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkFunction; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "useOsdkFunctions", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkFunctions; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "useOsdkMetadata", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkMetadata; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "useOsdkObject", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkObject; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "useOsdkObjects", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunk32NABBD6_cjs.useOsdkObjects; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "useRegisterUserAgent", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunk32NABBD6_cjs.useRegisterUserAgent; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "useStableObjectSet", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunk32NABBD6_cjs.useStableObjectSet; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "getRegisteredDevTools", {
|
|
71
71
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["REACT_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT: string =\n `osdk-react/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,gBAAwB,GACnC,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["REACT_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT: string =\n `osdk-react/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,gBAAwB,GACnC,wBAA2C","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
"fast-deep-equal": "^3.1.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@osdk/api": "^2.15.0
|
|
88
|
-
"@osdk/client": "^2.15.0
|
|
87
|
+
"@osdk/api": "^2.15.0",
|
|
88
|
+
"@osdk/client": "^2.15.0",
|
|
89
89
|
"@osdk/foundry.admin": "*",
|
|
90
90
|
"@osdk/foundry.core": "*",
|
|
91
91
|
"@types/react": "^17 || ^18 || ^19",
|
|
@@ -120,9 +120,9 @@
|
|
|
120
120
|
"tiny-invariant": "^1.3.3",
|
|
121
121
|
"typescript": "~5.5.4",
|
|
122
122
|
"@osdk/aip-core": "0.4.0",
|
|
123
|
-
"@osdk/api": "2.
|
|
124
|
-
"@osdk/client": "2.
|
|
125
|
-
"@osdk/client
|
|
123
|
+
"@osdk/api": "2.22.0",
|
|
124
|
+
"@osdk/client.test.ontology": "2.22.0",
|
|
125
|
+
"@osdk/client": "2.22.0",
|
|
126
126
|
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
127
127
|
"@osdk/monorepo.tsconfig": "~0.7.0"
|
|
128
128
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/new/core/useStableObjectSet.ts","../../src/util/UserAgent.ts","../../src/new/useDevToolsClient.ts","../../src/new/UserAgentContext.ts","../../src/new/OsdkProvider.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/createCompositeExternalStore.ts","../../src/new/getStableQueriesKey.ts","../../src/new/useOsdkFunctions.ts","../../src/new/useOsdkObject.ts","../../src/new/useOsdkObjects.ts","../../src/new/core/useOnMount.ts","../../src/new/useRegisterUserAgent.ts","../../src/useOsdkClient.ts","../../src/useOsdkMetadata.ts","../../src/utils/useDebouncedCallback.ts"],"names":["getWireObjectSet","useMemo","useRef","getRegisteredDevTools","React","useCallback","createObservableClient","OsdkContext","makeExternalStore","devToolsMetadata","useDevToolsMetadata","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","isObjectSet","useEffect","error"],"mappings":";;;;;;;;;;;;;AAyBO,SAAS,mBAAmB,SAAA,EAAW;AAC5C,EAAA,MAAM,UAAU,SAAA,GAAY,IAAA,CAAK,UAAUA,uBAAA,CAAiB,SAAS,CAAC,CAAA,GAAI,MAAA;AAE1E,EAAA,OAAOC,cAAA,CAAQ,MAAM,SAAA,EAAW,CAAC,OAAO,CAAC,CAAA;AAC3C;;;ACbO,IAAM,gB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AAA;AACH","file":"chunk-R5UXL5ZO.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 { getWireObjectSet } from \"@osdk/client\";\nimport { useMemo } from \"react\";\n\n/**\n * Returns a referentially stable ObjectSet that only changes when the\n * wire representation changes. This uses `getWireObjectSet` which includes\n * composed operations (where, union, intersect, etc.) in the serialized\n * form, unlike plain `JSON.stringify(objectSet)` which may not capture them.\n */\nexport function useStableObjectSet(objectSet) {\n const wireKey = objectSet ? JSON.stringify(getWireObjectSet(objectSet)) : undefined;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objectSet, [wireKey]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const REACT_USER_AGENT = `osdk-react/${process.env.PACKAGE_VERSION}`;","/*\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 { useMemo, useRef } from \"react\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nexport function useDevToolsClient(baseClient, enabled) {\n const stateRef = useRef(null);\n const prev = stateRef.current;\n let wrappedClient;\n if (!enabled) {\n stateRef.current = null;\n wrappedClient = baseClient;\n } else {\n const devTools = getRegisteredDevTools();\n if (devTools == null) {\n stateRef.current = null;\n wrappedClient = baseClient;\n } else if (prev != null && prev.base === baseClient && prev.devTools === devTools) {\n wrappedClient = prev.monitored;\n } else {\n const monitored = devTools.wrapClient(baseClient);\n stateRef.current = {\n base: baseClient,\n monitored,\n devTools\n };\n wrappedClient = monitored;\n }\n }\n const currentState = stateRef.current;\n const wrapChildren = useMemo(() => currentState != null ? children => currentState.devTools.wrapChildren(children, currentState.monitored) : null, [currentState]);\n return {\n client: wrappedClient,\n wrapChildren\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 React from \"react\";\nexport const UserAgentContext = /*#__PURE__*/React.createContext(() => () => {});","/*\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/observable\";\nimport React, { useCallback, useMemo, useRef } from \"react\";\nimport { getRegisteredDevTools } from \"../public/devtools-registry.js\";\nimport { REACT_USER_AGENT } from \"../util/UserAgent.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nimport { useDevToolsClient } from \"./useDevToolsClient.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\nconst __DEV__ = typeof process === \"undefined\" || process.env.NODE_ENV !== \"production\";\nexport function OsdkProvider({\n children,\n client,\n enableDevTools\n}) {\n const devtoolsEnabled = __DEV__ && (enableDevTools ?? getRegisteredDevTools() != null);\n const userAgentsRef = useRef(new Set([REACT_USER_AGENT]));\n const addUserAgent = useCallback(agent => {\n userAgentsRef.current.add(agent);\n return () => {\n userAgentsRef.current.delete(agent);\n };\n }, []);\n const baseObservableClient = useMemo(() => createObservableClient(client, () => [...userAgentsRef.current]), [client]);\n const {\n client: devToolsClient,\n wrapChildren\n } = useDevToolsClient(baseObservableClient, devtoolsEnabled);\n const content = wrapChildren?.(children) ?? children;\n const contextValue = useMemo(() => ({\n client,\n observableClient: devToolsClient,\n devtoolsEnabled\n }), [client, devToolsClient, devtoolsEnabled]);\n return /*#__PURE__*/React.createElement(UserAgentContext.Provider, {\n value: addUserAgent\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: contextValue\n }, content));\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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\n const {\n enabled = true,\n $includeAllBaseObjectProperties,\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 }), devToolsMetadata({\n hookType: \"useLinks\",\n sourceObjectType: objectsArray[0]?.$apiName,\n linkName\n }));\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 $includeAllBaseObjectProperties,\n ...(canonOptions.$select ? {\n select: canonOptions.$select\n } : {})\n }, observer), devToolsMetadata({\n hookType: \"useLinks\",\n sourceObjectType: objectsArray[0]?.$apiName,\n linkName\n }));\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, canonOptions.where, otherOptions.pageSize, canonOptions.orderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, canonOptions.$select, $includeAllBaseObjectProperties]);\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\";\nimport React from \"react\";\nimport { extractPayloadError } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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 */\n// pivotTo overload: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\n\n// Non-pivotTo overload: pivotTo is forbidden to prevent fallthrough.\n\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 // TODO: Is it expected to only clear the previousCompletedPayloadRef when the object type changes?\n // What if the same object type is queried with different filters, should we also clear the cache?\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 }), devToolsMetadata({\n hookType: \"useObjectSet\",\n objectType: objectTypeKey\n }));\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 }, devToolsMetadata({\n hookType: \"useObjectSet\",\n objectType: objectTypeKey\n }), 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 { useDevToolsMetadata } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient,\n devtoolsEnabled\n } = React.useContext(OsdkContext);\n useDevToolsMetadata(devtoolsEnabled, \"useOsdkAction\", actionDef.apiName);\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\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\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), devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate\n }));\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), devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate\n }));\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\";\nimport React from \"react\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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(OsdkContext);\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 }), devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName\n }));\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName\n }));\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await 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 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\n/**\n * Creates a composite external store that manages N function subscriptions\n * through a single `useSyncExternalStore` interface.\n *\n * Unlike `makeExternalStore` (which wraps a single Observer), this manages\n * N observers funneled into one snapshot array. Supports optional concurrency\n * limiting via `maxConcurrent` to stagger subscriptions.\n */\nexport function createCompositeExternalStore(queries, observableClient, maxConcurrent) {\n // Mutable snapshot array — replaced (never mutated in place) on each\n // observer callback so that useSyncExternalStore sees a new reference.\n let current = queries.map(() => undefined);\n const updateSlot = (index, value) => {\n const next = [...current];\n next[index] = value;\n current = next;\n };\n function observeQuery(query, index, notifyUpdate, onSettled) {\n const {\n params,\n dedupeIntervalMs,\n dependsOn,\n dependsOnObjects\n } = query.options ?? {};\n return observableClient.observeFunction(query.queryDefinition, params, {\n dependsOn,\n dependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, {\n next: payload => {\n updateSlot(index, payload);\n notifyUpdate();\n if (payload?.status === \"loaded\" || payload?.status === \"error\") {\n onSettled();\n }\n },\n error: error => {\n updateSlot(index, {\n ...(current[index] ?? {}),\n error: error instanceof Error ? error : new Error(String(error))\n });\n notifyUpdate();\n onSettled();\n },\n complete: () => {}\n });\n }\n function getEnabledIndices() {\n return queries.map((q, i) => q.options?.enabled !== false ? i : -1).filter(i => i !== -1);\n }\n function subscribe(notifyUpdate) {\n const subscriptions = [];\n const enabledIndices = getEnabledIndices();\n const subscribeAt = queueIdx => {\n if (queueIdx >= enabledIndices.length) return;\n const index = enabledIndices[queueIdx];\n const onSettled = maxConcurrent != null ? () => subscribeAt(queueIdx + maxConcurrent) : () => {};\n subscriptions.push(observeQuery(queries[index], index, notifyUpdate, onSettled));\n };\n\n // When staggering, only start the first `maxConcurrent` queries.\n // Each calls subscribeAt(queueIdx + maxConcurrent) when it settles,\n // creating a sliding window of concurrent subscriptions.\n const initialCount = maxConcurrent != null ? Math.min(maxConcurrent, enabledIndices.length) : enabledIndices.length;\n for (let i = 0; i < initialCount; i++) {\n subscribeAt(i);\n }\n return () => subscriptions.forEach(sub => sub.unsubscribe());\n }\n return {\n getSnapshot: () => current,\n subscribe\n };\n}\nconst EMPTY_SNAPSHOTS = [];\nexport const EMPTY_STORE = {\n subscribe: () => () => {},\n getSnapshot: () => EMPTY_SNAPSHOTS\n};","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getWireObjectSet, isObjectSet } from \"@osdk/client\";\n/**\n * Builds a stable string key for an array of function queries.\n *\n * Uses a JSON.stringify replacer to substitute any ObjectSet with its wire representation,\n * so composed operations (where/union/intersect) participate in the key\n * - plain JSON.stringify would not capture them.\n */\nexport function getStableQueriesKey(queries) {\n return JSON.stringify(queries.map(q => ({\n apiName: q.queryDefinition.apiName,\n ...q.options\n })), (_key, value) => isObjectSet(value) ? getWireObjectSet(value) : value);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { createCompositeExternalStore, EMPTY_STORE } from \"./createCompositeExternalStore.js\";\nimport { getStableQueriesKey } from \"./getStableQueriesKey.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n/**\n * React hook for executing multiple OSDK function queries in parallel.\n *\n * This hook executes multiple function queries with individual configurations,\n * with automatic caching and deduplication via the ObservableClient.\n * Results are returned in the same order as the input queries.\n *\n * Queries with identical function+params share cached results through the\n * Store layer, avoiding duplicate network requests across components.\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 maxConcurrent\n}) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\n const stableQueriesKey = getStableQueriesKey(queries);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableQueries = React.useMemo(() => queries, [stableQueriesKey]);\n const {\n subscribe,\n getSnapshot\n } = React.useMemo(() => !enabled || stableQueries.length === 0 ? EMPTY_STORE : createCompositeExternalStore(stableQueries, observableClient, maxConcurrent), [enabled, maxConcurrent, observableClient, stableQueries]);\n const payloads = React.useSyncExternalStore(subscribe, getSnapshot);\n const refetches = React.useMemo(() => stableQueries.map(query => async () => {\n await observableClient.invalidateFunction(query.queryDefinition, query.options?.params);\n }), [stableQueries, observableClient]);\n return React.useMemo(() => stableQueries.map((_, index) => {\n const payload = payloads[index];\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: refetches[index]\n };\n }), [stableQueries, payloads, refetches]);\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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.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, $loadPropertySecurityMetadata,\n * and $includeAllBaseObjectProperties\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 includeAllBaseObjectProperties = optionsArg?.$includeAllBaseObjectProperties;\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 }), devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey)\n }));\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n $includeAllBaseObjectProperties: includeAllBaseObjectProperties,\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...(loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata\n } : {})\n }, observer), devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey)\n }));\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata, includeAllBaseObjectProperties]);\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 // Errors take precedence over loading state.\n isLoading: enabled && error == null ? 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 { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\n\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext);\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 $includeAllBaseObjectProperties\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 }), devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName\n }));\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 $includeAllBaseObjectProperties,\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), devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize\n }));\n }, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties]);\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 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 { useEffect } from \"react\";\n\n/**\n * Runs an effect exactly once on mount. The callback's return value\n * is used as the cleanup function, just like `useEffect`.\n *\n * This is a semantic wrapper around `useEffect(() => …, [])` that\n * makes the intent explicit and avoids needing an eslint-disable\n * for `react-hooks/exhaustive-deps`.\n */\nexport function useOnMount(effect) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(effect, []);\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 { useOnMount } from \"./core/useOnMount.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\nexport function useRegisterUserAgent(agent) {\n const addUserAgent = React.useContext(UserAgentContext);\n useOnMount(() => {\n return addUserAgent(agent);\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { OsdkContext } from \"./new/OsdkContext.js\";\nexport function useOsdkClient() {\n return React.useContext(OsdkContext).client;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\nexport function useOsdkMetadata(type) {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState(undefined);\n const [error, setError] = React.useState();\n if (!metadata && !error) {\n client.fetchMetadata(type).then(fetchedMetadata => {\n setMetadata(fetchedMetadata);\n }).catch(error => {\n const errorMessage = error instanceof Error ? error.message : String(error);\n setError(errorMessage);\n });\n return {\n loading: true\n };\n }\n return {\n loading: false,\n metadata,\n error\n };\n}","/*\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}"]}
|