@osdk/react 2.27.0 → 2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4
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 +12 -0
- package/build/browser/new/useOsdkObjects.js +11 -2
- package/build/browser/new/useOsdkObjects.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-SWMHWQRM.cjs → chunk-534G5DES.cjs} +9 -5
- package/build/cjs/chunk-534G5DES.cjs.map +1 -0
- package/build/cjs/index.cjs +15 -15
- package/build/cjs/public/experimental.cjs +16 -16
- package/build/cjs/public/experimental.d.cts +13 -1
- package/build/esm/new/useOsdkObjects.js +11 -2
- package/build/esm/new/useOsdkObjects.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/new/useOsdkObjects.d.ts +17 -1
- package/build/types/new/useOsdkObjects.d.ts.map +1 -1
- package/package.json +6 -6
- package/build/cjs/chunk-SWMHWQRM.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @osdkkit/react
|
|
2
2
|
|
|
3
|
+
## 2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a5066b5: add resolveToObjectType option to useOsdkObjects so interface queries return full concrete object-type instances
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [a5066b5]
|
|
12
|
+
- @osdk/client@2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4
|
|
13
|
+
- @osdk/api@2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4
|
|
14
|
+
|
|
3
15
|
## 2.27.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -19,6 +19,11 @@ import { extractPayloadError, isPayloadLoading } from "./hookUtils.js";
|
|
|
19
19
|
import { devToolsMetadata, makeExternalStore } from "./makeExternalStore.js";
|
|
20
20
|
import { OsdkContext } from "./OsdkContext.js";
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Restricts `resolveToObjectType` to interface queries only.
|
|
24
|
+
* Object-type queries cannot pass this option.
|
|
25
|
+
*/
|
|
26
|
+
|
|
22
27
|
// pivotTo overloads: streamUpdates is forbidden (the server does not support
|
|
23
28
|
// websocket subscriptions for link-traversal queries).
|
|
24
29
|
|
|
@@ -43,7 +48,8 @@ export function useOsdkObjects(type, options) {
|
|
|
43
48
|
pivotTo,
|
|
44
49
|
$select,
|
|
45
50
|
$loadPropertySecurityMetadata,
|
|
46
|
-
$includeAllBaseObjectProperties
|
|
51
|
+
$includeAllBaseObjectProperties,
|
|
52
|
+
resolveToObjectType
|
|
47
53
|
} = options ?? {};
|
|
48
54
|
const canonOptions = observableClient.canonicalizeOptions({
|
|
49
55
|
where,
|
|
@@ -87,6 +93,9 @@ export function useOsdkObjects(type, options) {
|
|
|
87
93
|
} : {}),
|
|
88
94
|
...($loadPropertySecurityMetadata ? {
|
|
89
95
|
$loadPropertySecurityMetadata
|
|
96
|
+
} : {}),
|
|
97
|
+
...(resolveToObjectType ? {
|
|
98
|
+
resolveToObjectType: true
|
|
90
99
|
} : {})
|
|
91
100
|
}, observer), devToolsMetadata({
|
|
92
101
|
hookType: "useOsdkObjects",
|
|
@@ -95,7 +104,7 @@ export function useOsdkObjects(type, options) {
|
|
|
95
104
|
orderBy: canonOptions.orderBy,
|
|
96
105
|
pageSize
|
|
97
106
|
}));
|
|
98
|
-
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties]);
|
|
107
|
+
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties, !!resolveToObjectType]);
|
|
99
108
|
const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);
|
|
100
109
|
const refetch = React.useCallback(async () => {
|
|
101
110
|
await observableClient.invalidateObjectType(type.apiName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkObjects.js","names":["React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","$loadPropertySecurityMetadata","$includeAllBaseObjectProperties","canonOptions","canonicalizeOptions","stableRids","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","apiName","observer","observeList","dedupeInterval","select","listPayload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","fetchMore","hasMore","undefined","error","data","resolvedList","isLoading","isOptimistic","totalCount","objectSet"],"sources":["useOsdkObjects.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\nimport type {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] });\n * ```\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' },\n * });\n * ```\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n *\n * Cannot be combined with `streamUpdates`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n /**\n * Enable streaming updates via websocket subscription.\n *\n * Cannot be combined with `pivotTo`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n streamUpdates?: boolean;\n\n /**\n * Restrict which properties are returned for each object.\n * When provided, only the specified properties will be fetched,\n * reducing payload sizes for list views.\n *\n * @example\n * ```tsx\n * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] });\n * ```\n */\n $select?: readonly PropertyKeys<T>[];\n\n /**\n * When true, loads per-property security metadata (marking requirements)\n * alongside each object. The returned objects will have `$propertySecurities`\n * populated with conjunctive/disjunctive marking requirements per property.\n */\n $loadPropertySecurityMetadata?: boolean;\n\n /**\n * When true, includes all properties of the underlying concrete object type\n * for interface queries. Has no effect for non-interface queries.\n */\n $includeAllBaseObjectProperties?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n EXTRA_OPTIONS extends never | \"$rid\" = never,\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<\n T,\n \"$allBaseProperties\" | EXTRA_OPTIONS,\n PropertyKeys<T>,\n RDPs\n >[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n\n hasMore: boolean;\n\n objectSet: ObjectSet<T, RDPs> | undefined;\n\n refetch: () => Promise<void>;\n}\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n rids: readonly string[];\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}>;\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & {\n rids: readonly string[];\n pivotTo?: never;\n },\n): UseOsdkListResult<Q, RDPs, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?:\n & UseOsdkObjectsOptions<Q, RDPs>\n & { pivotTo?: never },\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<Q, RDPs, \"$rid\">\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}, \"$rid\">\n{\n const { observableClient } = React.useContext(OsdkContext);\n\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\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n orderBy,\n intersectWith,\n $select,\n });\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n }),\n );\n }\n\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n (observer) =>\n observableClient.observeList<Q, RDPs>({\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 ? { pivotTo } : {}),\n ...(canonOptions.$select ? { select: canonOptions.$select } : {}),\n ...($loadPropertySecurityMetadata\n ? { $loadPropertySecurityMetadata }\n : {}),\n }, observer),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize,\n }),\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n canonOptions.where,\n dedupeIntervalMs,\n pageSize,\n canonOptions.orderBy,\n streamUpdates,\n canonOptions.withProperties,\n autoFetchMore,\n canonOptions.intersectWith,\n pivotTo,\n canonOptions.$select,\n $loadPropertySecurityMetadata,\n $includeAllBaseObjectProperties,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n\n return React.useMemo<UseOsdkListResult<Q, RDPs>>(\n () => ({\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 }),\n [listPayload, enabled, refetch],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;;AA4L9C;AACA;;AAwBA;AACA;;AAsBA,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAM1C;EACE,MAAM;IAAEC;EAAiB,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACL,WAAW,CAAC;EAE1D,MAAM;IACJM,QAAQ;IACRC,gBAAgB;IAChBC,cAAc;IACdC,OAAO,GAAG,IAAI;IACdC,IAAI;IACJC,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,aAAa;IACbC,aAAa;IACbC,OAAO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,EAAElD,gBAAgB,CAACuC,WAAW,EAAE3B,OAAO,CAAC;IACjDuC,YAAY,EAAEZ,WAAW,EAAEY,YAAY,IAAI,KAAK;IAChDC,UAAU,EAAEb,WAAW,EAAEa,UAAU;IACnCP,OAAO,EAAEN,WAAW,EAAEM,OAAO,IAAI,KAAK;IACtCQ,SAAS,EAAEd,WAAW,EAAEc,SAAS;IACjCZ;EACF,CAAC,CAAC,EACF,CAACF,WAAW,EAAE3B,OAAO,EAAE6B,OAAO,CAChC,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useOsdkObjects.js","names":["React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","$loadPropertySecurityMetadata","$includeAllBaseObjectProperties","resolveToObjectType","canonOptions","canonicalizeOptions","stableRids","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","apiName","observer","observeList","dedupeInterval","select","listPayload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","fetchMore","hasMore","undefined","error","data","resolvedList","isLoading","isOptimistic","totalCount","objectSet"],"sources":["useOsdkObjects.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\nimport type {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\n/**\n * Restricts `resolveToObjectType` to interface queries only.\n * Object-type queries cannot pass this option.\n */\nexport type ResolveToObjectTypeOption<T extends ObjectOrInterfaceDefinition> =\n T extends { type: \"interface\" } ? { resolveToObjectType?: boolean }\n : { resolveToObjectType?: never };\n\nexport type UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> =\n & UseOsdkObjectsBaseOptions<T, RDPs>\n & ResolveToObjectTypeOption<T>;\n\ninterface UseOsdkObjectsBaseOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] });\n * ```\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' },\n * });\n * ```\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n *\n * Cannot be combined with `streamUpdates`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n /**\n * Enable streaming updates via websocket subscription.\n *\n * Cannot be combined with `pivotTo`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n streamUpdates?: boolean;\n\n /**\n * Restrict which properties are returned for each object.\n * When provided, only the specified properties will be fetched,\n * reducing payload sizes for list views.\n *\n * @example\n * ```tsx\n * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] });\n * ```\n */\n $select?: readonly PropertyKeys<T>[];\n\n /**\n * When true, loads per-property security metadata (marking requirements)\n * alongside each object. The returned objects will have `$propertySecurities`\n * populated with conjunctive/disjunctive marking requirements per property.\n */\n $loadPropertySecurityMetadata?: boolean;\n\n /**\n * When true, includes all properties of the underlying concrete object type\n * for interface queries. Has no effect for non-interface queries.\n */\n $includeAllBaseObjectProperties?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n EXTRA_OPTIONS extends never | \"$rid\" = never,\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<\n T,\n \"$allBaseProperties\" | EXTRA_OPTIONS,\n PropertyKeys<T>,\n RDPs\n >[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n\n hasMore: boolean;\n\n objectSet: ObjectSet<T, RDPs> | undefined;\n\n refetch: () => Promise<void>;\n}\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n rids: readonly string[];\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}>;\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & {\n rids: readonly string[];\n pivotTo?: never;\n },\n): UseOsdkListResult<Q, RDPs, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?:\n & UseOsdkObjectsOptions<Q, RDPs>\n & { pivotTo?: never },\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<Q, RDPs, \"$rid\">\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}, \"$rid\">\n{\n const { observableClient } = React.useContext(OsdkContext);\n\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 resolveToObjectType,\n } = options ?? {};\n\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n orderBy,\n intersectWith,\n $select,\n });\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n }),\n );\n }\n\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n (observer) =>\n observableClient.observeList<Q, RDPs>({\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 ? { pivotTo } : {}),\n ...(canonOptions.$select ? { select: canonOptions.$select } : {}),\n ...($loadPropertySecurityMetadata\n ? { $loadPropertySecurityMetadata }\n : {}),\n ...(resolveToObjectType ? { resolveToObjectType: true } : {}),\n }, observer),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize,\n }),\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n canonOptions.where,\n dedupeIntervalMs,\n pageSize,\n canonOptions.orderBy,\n streamUpdates,\n canonOptions.withProperties,\n autoFetchMore,\n canonOptions.intersectWith,\n pivotTo,\n canonOptions.$select,\n $loadPropertySecurityMetadata,\n $includeAllBaseObjectProperties,\n !!resolveToObjectType,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n\n return React.useMemo<UseOsdkListResult<Q, RDPs>>(\n () => ({\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 }),\n [listPayload, enabled, refetch],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SAASC,gBAAg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AmB,CAEzB,CAAC;EAED,MAAMiB,WAAW,GAAG1C,KAAK,CAAC2C,oBAAoB,CAACX,SAAS,EAAEC,WAAW,CAAC;EAEtE,MAAMW,OAAO,GAAG5C,KAAK,CAAC6C,WAAW,CAAC,YAAY;IAC5C,MAAMpC,gBAAgB,CAACqC,oBAAoB,CAACvC,IAAI,CAAC8B,OAAO,CAAC;EAC3D,CAAC,EAAE,CAAC5B,gBAAgB,EAAEF,IAAI,CAAC8B,OAAO,CAAC,CAAC;EAEpC,OAAOrC,KAAK,CAAC6B,OAAO,CAClB,OAAO;IACLkB,SAAS,EAAEL,WAAW,EAAEM,OAAO,GAAGN,WAAW,CAACK,SAAS,GAAGE,SAAS;IACnEC,KAAK,EAAEjD,mBAAmB,CAACyC,WAAW,EAAE,wBAAwB,CAAC;IACjES,IAAI,EAAET,WAAW,EAAEU,YAAY;IAC/BC,SAAS,EAAEnD,gBAAgB,CAACwC,WAAW,EAAE5B,OAAO,CAAC;IACjDwC,YAAY,EAAEZ,WAAW,EAAEY,YAAY,IAAI,KAAK;IAChDC,UAAU,EAAEb,WAAW,EAAEa,UAAU;IACnCP,OAAO,EAAEN,WAAW,EAAEM,OAAO,IAAI,KAAK;IACtCQ,SAAS,EAAEd,WAAW,EAAEc,SAAS;IACjCZ;EACF,CAAC,CAAC,EACF,CAACF,WAAW,EAAE5B,OAAO,EAAE8B,OAAO,CAChC,CAAC;AACH","ignoreList":[]}
|
|
@@ -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,sEAA2C","ignoreList":[]}
|
|
@@ -29,7 +29,7 @@ function useStableObjectSet(objectSet) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// src/util/UserAgent.ts
|
|
32
|
-
var REACT_USER_AGENT = `osdk-react/${"2.
|
|
32
|
+
var REACT_USER_AGENT = `osdk-react/${"2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4"}`;
|
|
33
33
|
function useDevToolsClient(baseClient, enabled) {
|
|
34
34
|
const stateRef = React5.useRef(null);
|
|
35
35
|
const prev = stateRef.current;
|
|
@@ -738,7 +738,8 @@ function useOsdkObjects(type, options) {
|
|
|
738
738
|
pivotTo,
|
|
739
739
|
$select,
|
|
740
740
|
$loadPropertySecurityMetadata,
|
|
741
|
-
$includeAllBaseObjectProperties
|
|
741
|
+
$includeAllBaseObjectProperties,
|
|
742
|
+
resolveToObjectType
|
|
742
743
|
} = options ?? {};
|
|
743
744
|
const canonOptions = observableClient.canonicalizeOptions({
|
|
744
745
|
where,
|
|
@@ -783,6 +784,9 @@ function useOsdkObjects(type, options) {
|
|
|
783
784
|
} : {},
|
|
784
785
|
...$loadPropertySecurityMetadata ? {
|
|
785
786
|
$loadPropertySecurityMetadata
|
|
787
|
+
} : {},
|
|
788
|
+
...resolveToObjectType ? {
|
|
789
|
+
resolveToObjectType: true
|
|
786
790
|
} : {}
|
|
787
791
|
}, observer), chunkUKQGMTMG_cjs.devToolsMetadata({
|
|
788
792
|
hookType: "useOsdkObjects",
|
|
@@ -791,7 +795,7 @@ function useOsdkObjects(type, options) {
|
|
|
791
795
|
orderBy: canonOptions.orderBy,
|
|
792
796
|
pageSize
|
|
793
797
|
}));
|
|
794
|
-
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties]);
|
|
798
|
+
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties, !!resolveToObjectType]);
|
|
795
799
|
const listPayload = React5__default.default.useSyncExternalStore(subscribe, getSnapShot);
|
|
796
800
|
const refetch = React5__default.default.useCallback(async () => {
|
|
797
801
|
await observableClient.invalidateObjectType(type.apiName);
|
|
@@ -893,5 +897,5 @@ exports.useOsdkObject = useOsdkObject;
|
|
|
893
897
|
exports.useOsdkObjects = useOsdkObjects;
|
|
894
898
|
exports.useRegisterUserAgent = useRegisterUserAgent;
|
|
895
899
|
exports.useStableObjectSet = useStableObjectSet;
|
|
896
|
-
//# sourceMappingURL=chunk-
|
|
897
|
-
//# sourceMappingURL=chunk-
|
|
900
|
+
//# sourceMappingURL=chunk-534G5DES.cjs.map
|
|
901
|
+
//# sourceMappingURL=chunk-534G5DES.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/new/core/stableSerialize.ts","../../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/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":["isObjectSet","getWireObjectSet","useMemo","useRef","getRegisteredDevTools","React","useCallback","createObservableClient","OsdkContext","makeExternalStore","devToolsMetadata","useDevToolsMetadata","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","useEffect","error"],"mappings":";;;;;;;;;;;;;AAuBO,SAAS,gBAAgB,KAAA,EAAO;AACrC,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,EAAO,uBAAuB,CAAA;AACtD;AAQO,SAAS,uBAAA,CAAwB,MAAM,KAAA,EAAO;AACnD,EAAA,IAAI,SAAS,IAAA,IAAQ,OAAO,UAAU,QAAA,IAAYA,kBAAA,CAAY,KAAK,CAAA,EAAG;AACpE,IAAA,OAAO;AAAA,MACL,WAAA,EAAaC,wBAAiB,KAAK;AAAA,KACrC;AAAA,EACF;AACA,EAAA,OAAO,KAAA;AACT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AA,EAAmB;AAAA,IACtC,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"chunk-534G5DES.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, isObjectSet } from \"@osdk/client\";\n\n/**\n * Serialize a value to a stable string for React.useMemo dependency arrays.\n * Uses {@link stableSerializeReplacer} so OSDK `ObjectSet`s normalize to a\n * discriminative wire form before stringification.\n */\nexport function stableSerialize(value) {\n return JSON.stringify(value, stableSerializeReplacer);\n}\n\n/**\n * `JSON.stringify` replacer that normalizes OSDK `ObjectSet` instances to\n * their wire-form definition (via `getWireObjectSet`) wrapped in\n * `{ __objectSet: ... }`, so composed operations (`.where`, `.union`,\n * `.intersect`, ...) participate in the key.\n */\nexport function stableSerializeReplacer(_key, value) {\n if (value != null && typeof value === \"object\" && isObjectSet(value)) {\n return {\n __objectSet: getWireObjectSet(value)\n };\n }\n return 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 { useMemo } from \"react\";\nimport { stableSerialize } from \"./stableSerialize.js\";\n\n/**\n * Returns a referentially stable ObjectSet that only changes when the\n * wire representation changes. This uses {@link stableSerialize} which\n * includes composed operations (where, union, intersect, etc.) in the\n * serialized form\n */\nexport function useStableObjectSet(objectSet) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objectSet, [stableSerialize(objectSet)]);\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 React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\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,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : item))]);\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 React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport { createCompositeExternalStore, EMPTY_STORE } from \"./createCompositeExternalStore.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 = stableSerialize(queries.map(q => ({\n apiName: q.queryDefinition.apiName,\n ...q.options\n })));\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/**\n * Restricts `resolveToObjectType` to interface queries only.\n * Object-type queries cannot pass this option.\n */\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 resolveToObjectType\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 ...(resolveToObjectType ? {\n resolveToObjectType: true\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, !!resolveToObjectType]);\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 chunk534G5DES_cjs = require('./chunk-534G5DES.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 chunk534G5DES_cjs.OsdkProvider; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "useDebouncedCallback", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk534G5DES_cjs.useDebouncedCallback; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "useLinks", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk534G5DES_cjs.useLinks; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "useObjectSet", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk534G5DES_cjs.useObjectSet; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "useOsdkAction", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunk534G5DES_cjs.useOsdkAction; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "useOsdkAggregation", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk534G5DES_cjs.useOsdkAggregation; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "useOsdkClient", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk534G5DES_cjs.useOsdkClient; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "useOsdkFunction", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk534G5DES_cjs.useOsdkFunction; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "useOsdkFunctions", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk534G5DES_cjs.useOsdkFunctions; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "useOsdkMetadata", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk534G5DES_cjs.useOsdkMetadata; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "useOsdkObject", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk534G5DES_cjs.useOsdkObject; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "useOsdkObjects", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk534G5DES_cjs.useOsdkObjects; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "useRegisterUserAgent", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk534G5DES_cjs.useRegisterUserAgent; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "useStableObjectSet", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk534G5DES_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 chunk534G5DES_cjs = require('../chunk-534G5DES.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 chunk534G5DES_cjs.OsdkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "useDebouncedCallback", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk534G5DES_cjs.useDebouncedCallback; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "useLinks", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunk534G5DES_cjs.useLinks; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "useObjectSet", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunk534G5DES_cjs.useObjectSet; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "useOsdkAction", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunk534G5DES_cjs.useOsdkAction; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "useOsdkAggregation", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunk534G5DES_cjs.useOsdkAggregation; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "useOsdkClient", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunk534G5DES_cjs.useOsdkClient; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "useOsdkClient2", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk534G5DES_cjs.useOsdkClient; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "useOsdkFunction", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunk534G5DES_cjs.useOsdkFunction; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "useOsdkFunctions", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunk534G5DES_cjs.useOsdkFunctions; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "useOsdkMetadata", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk534G5DES_cjs.useOsdkMetadata; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "useOsdkObject", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunk534G5DES_cjs.useOsdkObject; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "useOsdkObjects", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunk534G5DES_cjs.useOsdkObjects; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "useRegisterUserAgent", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunk534G5DES_cjs.useRegisterUserAgent; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "useStableObjectSet", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunk534G5DES_cjs.useStableObjectSet; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "getRegisteredDevTools", {
|
|
71
71
|
enumerable: true,
|
|
@@ -564,7 +564,19 @@ declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, p
|
|
|
564
564
|
*/
|
|
565
565
|
declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, options?: UseOsdkObjectOptions<Q>): UseOsdkObjectResult<Q>;
|
|
566
566
|
|
|
567
|
-
|
|
567
|
+
/**
|
|
568
|
+
* Restricts `resolveToObjectType` to interface queries only.
|
|
569
|
+
* Object-type queries cannot pass this option.
|
|
570
|
+
*/
|
|
571
|
+
type ResolveToObjectTypeOption<T extends ObjectOrInterfaceDefinition> = T extends {
|
|
572
|
+
type: "interface";
|
|
573
|
+
} ? {
|
|
574
|
+
resolveToObjectType?: boolean;
|
|
575
|
+
} : {
|
|
576
|
+
resolveToObjectType?: never;
|
|
577
|
+
};
|
|
578
|
+
type UseOsdkObjectsOptions<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> = UseOsdkObjectsBaseOptions<T, RDPs> & ResolveToObjectTypeOption<T>;
|
|
579
|
+
interface UseOsdkObjectsBaseOptions<T extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
568
580
|
/**
|
|
569
581
|
* Fetch objects by their RIDs (Resource Identifiers).
|
|
570
582
|
* When provided, starts with a static objectset containing these RIDs.
|
|
@@ -19,6 +19,11 @@ import { extractPayloadError, isPayloadLoading } from "./hookUtils.js";
|
|
|
19
19
|
import { devToolsMetadata, makeExternalStore } from "./makeExternalStore.js";
|
|
20
20
|
import { OsdkContext } from "./OsdkContext.js";
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Restricts `resolveToObjectType` to interface queries only.
|
|
24
|
+
* Object-type queries cannot pass this option.
|
|
25
|
+
*/
|
|
26
|
+
|
|
22
27
|
// pivotTo overloads: streamUpdates is forbidden (the server does not support
|
|
23
28
|
// websocket subscriptions for link-traversal queries).
|
|
24
29
|
|
|
@@ -43,7 +48,8 @@ export function useOsdkObjects(type, options) {
|
|
|
43
48
|
pivotTo,
|
|
44
49
|
$select,
|
|
45
50
|
$loadPropertySecurityMetadata,
|
|
46
|
-
$includeAllBaseObjectProperties
|
|
51
|
+
$includeAllBaseObjectProperties,
|
|
52
|
+
resolveToObjectType
|
|
47
53
|
} = options ?? {};
|
|
48
54
|
const canonOptions = observableClient.canonicalizeOptions({
|
|
49
55
|
where,
|
|
@@ -87,6 +93,9 @@ export function useOsdkObjects(type, options) {
|
|
|
87
93
|
} : {}),
|
|
88
94
|
...($loadPropertySecurityMetadata ? {
|
|
89
95
|
$loadPropertySecurityMetadata
|
|
96
|
+
} : {}),
|
|
97
|
+
...(resolveToObjectType ? {
|
|
98
|
+
resolveToObjectType: true
|
|
90
99
|
} : {})
|
|
91
100
|
}, observer), devToolsMetadata({
|
|
92
101
|
hookType: "useOsdkObjects",
|
|
@@ -95,7 +104,7 @@ export function useOsdkObjects(type, options) {
|
|
|
95
104
|
orderBy: canonOptions.orderBy,
|
|
96
105
|
pageSize
|
|
97
106
|
}));
|
|
98
|
-
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties]);
|
|
107
|
+
}, [enabled, observableClient, type.apiName, type.type, stableRids, canonOptions.where, dedupeIntervalMs, pageSize, canonOptions.orderBy, streamUpdates, canonOptions.withProperties, autoFetchMore, canonOptions.intersectWith, pivotTo, canonOptions.$select, $loadPropertySecurityMetadata, $includeAllBaseObjectProperties, !!resolveToObjectType]);
|
|
99
108
|
const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);
|
|
100
109
|
const refetch = React.useCallback(async () => {
|
|
101
110
|
await observableClient.invalidateObjectType(type.apiName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOsdkObjects.js","names":["React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","$loadPropertySecurityMetadata","$includeAllBaseObjectProperties","canonOptions","canonicalizeOptions","stableRids","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","apiName","observer","observeList","dedupeInterval","select","listPayload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","fetchMore","hasMore","undefined","error","data","resolvedList","isLoading","isOptimistic","totalCount","objectSet"],"sources":["useOsdkObjects.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\nimport type {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] });\n * ```\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' },\n * });\n * ```\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n *\n * Cannot be combined with `streamUpdates`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n /**\n * Enable streaming updates via websocket subscription.\n *\n * Cannot be combined with `pivotTo`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n streamUpdates?: boolean;\n\n /**\n * Restrict which properties are returned for each object.\n * When provided, only the specified properties will be fetched,\n * reducing payload sizes for list views.\n *\n * @example\n * ```tsx\n * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] });\n * ```\n */\n $select?: readonly PropertyKeys<T>[];\n\n /**\n * When true, loads per-property security metadata (marking requirements)\n * alongside each object. The returned objects will have `$propertySecurities`\n * populated with conjunctive/disjunctive marking requirements per property.\n */\n $loadPropertySecurityMetadata?: boolean;\n\n /**\n * When true, includes all properties of the underlying concrete object type\n * for interface queries. Has no effect for non-interface queries.\n */\n $includeAllBaseObjectProperties?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n EXTRA_OPTIONS extends never | \"$rid\" = never,\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<\n T,\n \"$allBaseProperties\" | EXTRA_OPTIONS,\n PropertyKeys<T>,\n RDPs\n >[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n\n hasMore: boolean;\n\n objectSet: ObjectSet<T, RDPs> | undefined;\n\n refetch: () => Promise<void>;\n}\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n rids: readonly string[];\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}>;\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & {\n rids: readonly string[];\n pivotTo?: never;\n },\n): UseOsdkListResult<Q, RDPs, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?:\n & UseOsdkObjectsOptions<Q, RDPs>\n & { pivotTo?: never },\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<Q, RDPs, \"$rid\">\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}, \"$rid\">\n{\n const { observableClient } = React.useContext(OsdkContext);\n\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\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n orderBy,\n intersectWith,\n $select,\n });\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n }),\n );\n }\n\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n (observer) =>\n observableClient.observeList<Q, RDPs>({\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 ? { pivotTo } : {}),\n ...(canonOptions.$select ? { select: canonOptions.$select } : {}),\n ...($loadPropertySecurityMetadata\n ? { $loadPropertySecurityMetadata }\n : {}),\n }, observer),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize,\n }),\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n canonOptions.where,\n dedupeIntervalMs,\n pageSize,\n canonOptions.orderBy,\n streamUpdates,\n canonOptions.withProperties,\n autoFetchMore,\n canonOptions.intersectWith,\n pivotTo,\n canonOptions.$select,\n $loadPropertySecurityMetadata,\n $includeAllBaseObjectProperties,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n\n return React.useMemo<UseOsdkListResult<Q, RDPs>>(\n () => ({\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 }),\n [listPayload, enabled, refetch],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;;AA4L9C;AACA;;AAwBA;AACA;;AAsBA,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAM1C;EACE,MAAM;IAAEC;EAAiB,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACL,WAAW,CAAC;EAE1D,MAAM;IACJM,QAAQ;IACRC,gBAAgB;IAChBC,cAAc;IACdC,OAAO,GAAG,IAAI;IACdC,IAAI;IACJC,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,aAAa;IACbC,aAAa;IACbC,OAAO;IACPC,OAAO;IACPC,6BAA6B;IAC7BC;EACF,CAAC,GAAGhB,OAAO,IAAI,CAAC,CAAC;EAEjB,MAAMiB,YAAY,GAAGhB,gBAAgB,CAACiB,mBAAmB,CAAC;IACxDV,KAAK;IACLH,cAAc;IACdI,OAAO;IACPG,aAAa;IACbE;EACF,CAAC,CAAC;EAEF,MAAMK,UAAU,GAAG3B,KAAK,CAAC4B,OAAO,CAC9B,MAAMb,IAAI,EACV,CAACc,IAAI,CAACC,SAAS,CAACf,IAAI,CAAC,CACvB,CAAC;EAED,MAAM;IAAEgB,SAAS;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dkObjects.js","names":["React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","$loadPropertySecurityMetadata","$includeAllBaseObjectProperties","resolveToObjectType","canonOptions","canonicalizeOptions","stableRids","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","apiName","observer","observeList","dedupeInterval","select","listPayload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","fetchMore","hasMore","undefined","error","data","resolvedList","isLoading","isOptimistic","totalCount","objectSet"],"sources":["useOsdkObjects.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\nimport type {\n DerivedProperty,\n LinkedType,\n LinkNames,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\n/**\n * Restricts `resolveToObjectType` to interface queries only.\n * Object-type queries cannot pass this option.\n */\nexport type ResolveToObjectTypeOption<T extends ObjectOrInterfaceDefinition> =\n T extends { type: \"interface\" } ? { resolveToObjectType?: boolean }\n : { resolveToObjectType?: never };\n\nexport type UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> =\n & UseOsdkObjectsBaseOptions<T, RDPs>\n & ResolveToObjectTypeOption<T>;\n\ninterface UseOsdkObjectsBaseOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Fetch objects by their RIDs (Resource Identifiers).\n * When provided, starts with a static objectset containing these RIDs.\n * Can be combined with `where` to filter the RID set, and with `orderBy` to sort results.\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] });\n * ```\n *\n * @example\n * ```tsx\n * // Fetch specific objects by RID, filtered by status\n * useOsdkObjects(Employee, {\n * rids: ['ri.foo.123', 'ri.foo.456', 'ri.foo.789'],\n * where: { status: 'active' },\n * });\n * ```\n */\n rids?: readonly string[];\n\n /**\n * Standard OSDK Where clause with RDP support.\n * When used with `rids`, filters the RID set.\n * When used alone, filters all objects of the type.\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Sort results by one or more properties.\n */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /**\n * Define derived properties (RDPs) to be computed server-side and attached to each object.\n * These properties will be available on the returned objects alongside their regular properties.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the same parameters will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute. It will still\n * return any cached data, but will not fetch from the server.\n *\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Intersect the results with additional object sets.\n * Each element defines a where clause for an object set to intersect with.\n * The final result will only include objects that match ALL conditions.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n *\n * Cannot be combined with `streamUpdates`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n */\n autoFetchMore?: boolean | number;\n\n /**\n * Enable streaming updates via websocket subscription.\n *\n * Cannot be combined with `pivotTo`. The server does not support\n * websocket subscriptions for link-traversal queries.\n */\n streamUpdates?: boolean;\n\n /**\n * Restrict which properties are returned for each object.\n * When provided, only the specified properties will be fetched,\n * reducing payload sizes for list views.\n *\n * @example\n * ```tsx\n * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] });\n * ```\n */\n $select?: readonly PropertyKeys<T>[];\n\n /**\n * When true, loads per-property security metadata (marking requirements)\n * alongside each object. The returned objects will have `$propertySecurities`\n * populated with conjunctive/disjunctive marking requirements per property.\n */\n $loadPropertySecurityMetadata?: boolean;\n\n /**\n * When true, includes all properties of the underlying concrete object type\n * for interface queries. Has no effect for non-interface queries.\n */\n $includeAllBaseObjectProperties?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n EXTRA_OPTIONS extends never | \"$rid\" = never,\n> {\n /**\n * Function to fetch more pages (undefined if no more pages)\n */\n fetchMore: (() => Promise<void>) | undefined;\n\n /**\n * The fetched data with derived properties\n */\n data:\n | Osdk.Instance<\n T,\n \"$allBaseProperties\" | EXTRA_OPTIONS,\n PropertyKeys<T>,\n RDPs\n >[]\n | undefined;\n\n /**\n * Whether data is currently being loaded\n */\n isLoading: boolean;\n\n /**\n * Any error that occurred during fetching\n */\n error: Error | undefined;\n\n /**\n * Refers to whether the ordered list of objects (only considering the $primaryKey)\n * is optimistic or not.\n *\n * If you need to know if the contents of the list are optimistic you can\n * do that on a per object basis with useOsdkObject\n */\n isOptimistic: boolean;\n\n /**\n * The total count of objects matching the query (if available from the API)\n */\n totalCount?: string;\n\n hasMore: boolean;\n\n objectSet: ObjectSet<T, RDPs> | undefined;\n\n refetch: () => Promise<void>;\n}\n\n// pivotTo overloads: streamUpdates is forbidden (the server does not support\n// websocket subscriptions for link-traversal queries).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n rids: readonly string[];\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n streamUpdates?: never;\n },\n): UseOsdkListResult<LinkedType<Q, L>, {}>;\n\n// Non-pivotTo overloads: pivotTo is forbidden to prevent fallthrough from the\n// pivotTo overloads above (which would give the wrong return type).\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & {\n rids: readonly string[];\n pivotTo?: never;\n },\n): UseOsdkListResult<Q, RDPs, \"$rid\">;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?:\n & UseOsdkObjectsOptions<Q, RDPs>\n & { pivotTo?: never },\n): UseOsdkListResult<Q, RDPs>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, RDPs>,\n):\n | UseOsdkListResult<Q, RDPs>\n | UseOsdkListResult<Q, RDPs, \"$rid\">\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}>\n | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>, {}, \"$rid\">\n{\n const { observableClient } = React.useContext(OsdkContext);\n\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 resolveToObjectType,\n } = options ?? {};\n\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n orderBy,\n intersectWith,\n $select,\n });\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n }),\n );\n }\n\n return makeExternalStore<ObserveObjectsCallbackArgs<Q, RDPs>>(\n (observer) =>\n observableClient.observeList<Q, RDPs>({\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 ? { pivotTo } : {}),\n ...(canonOptions.$select ? { select: canonOptions.$select } : {}),\n ...($loadPropertySecurityMetadata\n ? { $loadPropertySecurityMetadata }\n : {}),\n ...(resolveToObjectType ? { resolveToObjectType: true } : {}),\n }, observer),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize,\n }),\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n canonOptions.where,\n dedupeIntervalMs,\n pageSize,\n canonOptions.orderBy,\n streamUpdates,\n canonOptions.withProperties,\n autoFetchMore,\n canonOptions.intersectWith,\n pivotTo,\n canonOptions.$select,\n $loadPropertySecurityMetadata,\n $includeAllBaseObjectProperties,\n !!resolveToObjectType,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n\n return React.useMemo<UseOsdkListResult<Q, RDPs>>(\n () => ({\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 }),\n [listPayload, enabled, refetch],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA;;AAsMA;AACA;;AAwBA;AACA;;AAsBA,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAM1C;EACE,MAAM;IAAEC;EAAiB,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACL,WAAW,CAAC;EAE1D,MAAM;IACJM,QAAQ;IACRC,gBAAgB;IAChBC,cAAc;IACdC,OAAO,GAAG,IAAI;IACdC,IAAI;IACJC,KAAK;IACLC,O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,SAAS,EAAEL,WAAW,EAAEM,OAAO,GAAGN,WAAW,CAACK,SAAS,GAAGE,SAAS;IACnEC,KAAK,EAAEjD,mBAAmB,CAACyC,WAAW,EAAE,wBAAwB,CAAC;IACjES,IAAI,EAAET,WAAW,EAAEU,YAAY;IAC/BC,SAAS,EAAEnD,gBAAgB,CAACwC,WAAW,EAAE5B,OAAO,CAAC;IACjDwC,YAAY,EAAEZ,WAAW,EAAEY,YAAY,IAAI,KAAK;IAChDC,UAAU,EAAEb,WAAW,EAAEa,UAAU;IACnCP,OAAO,EAAEN,WAAW,EAAEM,OAAO,IAAI,KAAK;IACtCQ,SAAS,EAAEd,WAAW,EAAEc,SAAS;IACjCZ;EACF,CAAC,CAAC,EACF,CAACF,WAAW,EAAE5B,OAAO,EAAE8B,OAAO,CAChC,CAAC;AACH","ignoreList":[]}
|
|
@@ -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,sEAA2C","ignoreList":[]}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import type { DerivedProperty, LinkedType, LinkNames, ObjectOrInterfaceDefinition, ObjectSet, Osdk, PropertyKeys, SimplePropertyDef, WhereClause } from "@osdk/api";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Restricts `resolveToObjectType` to interface queries only.
|
|
4
|
+
* Object-type queries cannot pass this option.
|
|
5
|
+
*/
|
|
6
|
+
export type ResolveToObjectTypeOption<T extends ObjectOrInterfaceDefinition> = T extends {
|
|
7
|
+
type: "interface"
|
|
8
|
+
} ? {
|
|
9
|
+
resolveToObjectType?: boolean
|
|
10
|
+
} : {
|
|
11
|
+
resolveToObjectType?: never
|
|
12
|
+
};
|
|
13
|
+
export type UseOsdkObjectsOptions<
|
|
14
|
+
T extends ObjectOrInterfaceDefinition,
|
|
15
|
+
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
16
|
+
> = UseOsdkObjectsBaseOptions<T, RDPs> & ResolveToObjectTypeOption<T>;
|
|
17
|
+
interface UseOsdkObjectsBaseOptions<
|
|
3
18
|
T extends ObjectOrInterfaceDefinition,
|
|
4
19
|
RDPs extends Record<string, SimplePropertyDef> = {}
|
|
5
20
|
> {
|
|
@@ -181,3 +196,4 @@ export declare function useOsdkObjects<
|
|
|
181
196
|
>(type: Q, options?: UseOsdkObjectsOptions<Q, RDPs> & {
|
|
182
197
|
pivotTo?: never
|
|
183
198
|
}): UseOsdkListResult<Q, RDPs>;
|
|
199
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,WACA,MACA,cACA,mBACA,mBACK,WAAY;
|
|
1
|
+
{"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,WACA,MACA,cACA,mBACA,mBACK,WAAY;;;;;AAWnB,YAAY,0BAA0B,UAAU,+BAC9C,UAAU;CAAE,MAAM;AAAa,IAAG;CAAE;AAA+B,IAC/D;CAAE;AAA6B;AAErC,YAAY;CACV,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;IAEjD,0BAA0B,GAAG,QAC7B,0BAA0B;UAEpB;CACR,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;;;;;;;;;CAqBA;;;;;;CAOA,QAAQ,YAAY,GAAG;;;;CAKvB,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;CAMA,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;;;;CAQtE;;;;;;;;;CAUA;;;;;;CAOA,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG;CACvB;;;;;;;;CASD,UAAU,UAAU;;;;;;;;;;CAWpB;;;;;;;CAQA;;;;;;;;;;;;CAaA,mBAAmB,aAAa;;;;;;CAOhC;;;;;CAMA;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,8BAA8B;EAC9B;;;;CAIA,kBAAkB;;;;CAKlB,MACI,KAAK,SACL,GACA,uBAAuB,eACvB,aAAa,IACb;;;;CAOJ;;;;CAKA,OAAO;;;;;;;;CASP;;;;CAKA;CAEA;CAEA,WAAW,UAAU,GAAG;CAExB,eAAe;AAChB;AAID,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,MAAM,GACNC,SAAS,sBAAsB,GAAG,CAAE,KAAI;CACtC,SAAS;CACT;CACA;AACD,IACA,kBAAkB,WAAW,GAAG,IAAI,CAAE,GAAE;AAE3C,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBD,MAAM,GACNE,SAAS,sBAAsB,GAAG,CAAE,KAAI;CACtC,SAAS;CACT;AACD,IACA,kBAAkB,WAAW,GAAG,IAAI,CAAE;AAIzC,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDF,MAAM,GACNG,SAAS,sBAAsB,GAAG,QAAQ;CACxC;CACA;AACD,IACA,kBAAkB,GAAG,MAAM;AAE9B,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDH,MAAM,GACNI,UACI,sBAAsB,GAAG,QACzB;CAAE;AAAiB,IACtB,kBAAkB,GAAG","names":["type: Q","options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n rids: readonly string[];\n streamUpdates?: never;\n }","options: UseOsdkObjectsOptions<Q, {}> & {\n pivotTo: L;\n streamUpdates?: never;\n }","options: UseOsdkObjectsOptions<Q, RDPs> & {\n rids: readonly string[];\n pivotTo?: never;\n }","options?:\n & UseOsdkObjectsOptions<Q, RDPs>\n & { pivotTo?: never }"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"fast-deep-equal": "^3.1.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@osdk/api": "^2.15.0",
|
|
79
|
-
"@osdk/client": "^2.15.0",
|
|
78
|
+
"@osdk/api": "^2.15.0 || >=2.28.0-beta.0",
|
|
79
|
+
"@osdk/client": "^2.15.0 || >=2.28.0-beta.0",
|
|
80
80
|
"@osdk/foundry.admin": "*",
|
|
81
81
|
"@osdk/foundry.core": "*",
|
|
82
82
|
"@types/react": "^17 || ^18 || ^19",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"react": "^18.3.1",
|
|
107
107
|
"tiny-invariant": "^1.3.3",
|
|
108
108
|
"typescript": "~5.5.4",
|
|
109
|
-
"@osdk/api": "2.
|
|
110
|
-
"@osdk/client
|
|
109
|
+
"@osdk/api": "2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4",
|
|
110
|
+
"@osdk/client": "2.28.0-main-a5066b5822179d54731c738017fc477dbfee32b4",
|
|
111
|
+
"@osdk/client.test.ontology": "2.27.1-main-a5066b5822179d54731c738017fc477dbfee32b4",
|
|
111
112
|
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
112
|
-
"@osdk/client": "2.27.0",
|
|
113
113
|
"@osdk/monorepo.tsconfig": "~0.7.0"
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/new/core/stableSerialize.ts","../../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/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":["isObjectSet","getWireObjectSet","useMemo","useRef","getRegisteredDevTools","React","useCallback","createObservableClient","OsdkContext","makeExternalStore","devToolsMetadata","useDevToolsMetadata","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","useEffect","error"],"mappings":";;;;;;;;;;;;;AAuBO,SAAS,gBAAgB,KAAA,EAAO;AACrC,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAA,EAAO,uBAAuB,CAAA;AACtD;AAQO,SAAS,uBAAA,CAAwB,MAAM,KAAA,EAAO;AACnD,EAAA,IAAI,SAAS,IAAA,IAAQ,OAAO,UAAU,QAAA,IAAYA,kBAAA,CAAY,KAAK,CAAA,EAAG;AACpE,IAAA,OAAO;AAAA,MACL,WAAA,EAAaC,wBAAiB,KAAK;AAAA,KACrC;AAAA,EACF;AACA,EAAA,OAAO,KAAA;AACT;;;ACfO,SAAS,mBAAmB,SAAA,EAAW;AAE5C,EAAA,OAAOC,eAAQ,MAAM,SAAA,EAAW,CAAC,eAAA,CAAgB,SAAS,CAAC,CAAC,CAAA;AAC9D;;;ACZO,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,EAAA,IAAI,aAAA;AACJ,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AACnB,IAAA,aAAA,GAAgB,UAAA;AAAA,EAClB,CAAA,MAAO;AACL,IAAA,MAAM,WAAWC,uCAAA,EAAsB;AACvC,IAAA,IAAI,YAAY,IAAA,EAAM;AACpB,MAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AACnB,MAAA,aAAA,GAAgB,UAAA;AAAA,IA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AAI,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-SWMHWQRM.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, isObjectSet } from \"@osdk/client\";\n\n/**\n * Serialize a value to a stable string for React.useMemo dependency arrays.\n * Uses {@link stableSerializeReplacer} so OSDK `ObjectSet`s normalize to a\n * discriminative wire form before stringification.\n */\nexport function stableSerialize(value) {\n return JSON.stringify(value, stableSerializeReplacer);\n}\n\n/**\n * `JSON.stringify` replacer that normalizes OSDK `ObjectSet` instances to\n * their wire-form definition (via `getWireObjectSet`) wrapped in\n * `{ __objectSet: ... }`, so composed operations (`.where`, `.union`,\n * `.intersect`, ...) participate in the key.\n */\nexport function stableSerializeReplacer(_key, value) {\n if (value != null && typeof value === \"object\" && isObjectSet(value)) {\n return {\n __objectSet: getWireObjectSet(value)\n };\n }\n return 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 { useMemo } from \"react\";\nimport { stableSerialize } from \"./stableSerialize.js\";\n\n/**\n * Returns a referentially stable ObjectSet that only changes when the\n * wire representation changes. This uses {@link stableSerialize} which\n * includes composed operations (where, union, intersect, etc.) in the\n * serialized form\n */\nexport function useStableObjectSet(objectSet) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => objectSet, [stableSerialize(objectSet)]);\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 React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\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,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : item))]);\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 React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport { createCompositeExternalStore, EMPTY_STORE } from \"./createCompositeExternalStore.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 = stableSerialize(queries.map(q => ({\n apiName: q.queryDefinition.apiName,\n ...q.options\n })));\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}"]}
|