@osdk/react 0.9.3 → 0.10.0-beta.10

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.
Files changed (103) hide show
  1. package/AGENTS.md +46 -221
  2. package/CHANGELOG.md +109 -51
  3. package/build/browser/new/makeExternalStore.js +61 -0
  4. package/build/browser/new/makeExternalStore.js.map +1 -1
  5. package/build/browser/new/useLinks.js +11 -4
  6. package/build/browser/new/useLinks.js.map +1 -1
  7. package/build/browser/new/useObjectSet.js +6 -3
  8. package/build/browser/new/useObjectSet.js.map +1 -1
  9. package/build/browser/new/useOsdkAction.js +2 -2
  10. package/build/browser/new/useOsdkAction.js.map +1 -1
  11. package/build/browser/new/useOsdkAggregation.js +65 -27
  12. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  13. package/build/browser/new/useOsdkFunction.js +17 -12
  14. package/build/browser/new/useOsdkFunction.js.map +1 -1
  15. package/build/browser/new/useOsdkObject.js +36 -17
  16. package/build/browser/new/useOsdkObject.js.map +1 -1
  17. package/build/browser/new/useOsdkObjects.js +28 -19
  18. package/build/browser/new/useOsdkObjects.js.map +1 -1
  19. package/build/browser/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
  20. package/build/browser/public/experimental/admin.js.map +1 -0
  21. package/build/browser/public/experimental.js +0 -3
  22. package/build/browser/public/experimental.js.map +1 -1
  23. package/build/browser/useOsdkMetadata.js.map +1 -1
  24. package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
  25. package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
  26. package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
  27. package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
  28. package/build/cjs/index.cjs +4 -4
  29. package/build/cjs/index.d.cts +1 -1
  30. package/build/cjs/public/experimental/admin.cjs +146 -0
  31. package/build/cjs/public/experimental/admin.cjs.map +1 -0
  32. package/build/cjs/public/experimental/admin.d.cts +118 -0
  33. package/build/cjs/public/experimental.cjs +217 -478
  34. package/build/cjs/public/experimental.cjs.map +1 -1
  35. package/build/cjs/public/experimental.d.cts +88 -127
  36. package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
  37. package/build/esm/new/makeExternalStore.js +61 -0
  38. package/build/esm/new/makeExternalStore.js.map +1 -1
  39. package/build/esm/new/useLinks.js +11 -4
  40. package/build/esm/new/useLinks.js.map +1 -1
  41. package/build/esm/new/useObjectSet.js +6 -3
  42. package/build/esm/new/useObjectSet.js.map +1 -1
  43. package/build/esm/new/useOsdkAction.js +2 -2
  44. package/build/esm/new/useOsdkAction.js.map +1 -1
  45. package/build/esm/new/useOsdkAggregation.js +65 -27
  46. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  47. package/build/esm/new/useOsdkFunction.js +17 -12
  48. package/build/esm/new/useOsdkFunction.js.map +1 -1
  49. package/build/esm/new/useOsdkObject.js +36 -17
  50. package/build/esm/new/useOsdkObject.js.map +1 -1
  51. package/build/esm/new/useOsdkObjects.js +28 -19
  52. package/build/esm/new/useOsdkObjects.js.map +1 -1
  53. package/build/esm/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
  54. package/build/esm/public/experimental/admin.js.map +1 -0
  55. package/build/esm/public/experimental.js +0 -3
  56. package/build/esm/public/experimental.js.map +1 -1
  57. package/build/esm/useOsdkMetadata.js.map +1 -1
  58. package/build/types/new/makeExternalStore.d.ts +11 -0
  59. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  60. package/build/types/new/useLinks.d.ts +19 -0
  61. package/build/types/new/useLinks.d.ts.map +1 -1
  62. package/build/types/new/useObjectSet.d.ts +6 -0
  63. package/build/types/new/useObjectSet.d.ts.map +1 -1
  64. package/build/types/new/useOsdkAggregation.d.ts +41 -3
  65. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  66. package/build/types/new/useOsdkFunction.d.ts +11 -5
  67. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  68. package/build/types/new/useOsdkObject.d.ts +12 -1
  69. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  70. package/build/types/new/useOsdkObjects.d.ts +10 -0
  71. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  72. package/build/types/public/experimental/admin.d.ts +3 -0
  73. package/build/types/public/experimental/admin.d.ts.map +1 -0
  74. package/build/types/public/experimental.d.ts +0 -3
  75. package/build/types/public/experimental.d.ts.map +1 -1
  76. package/build/types/useOsdkMetadata.d.ts +5 -4
  77. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  78. package/docs/querying-data.md +19 -0
  79. package/{build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js → experimental/admin.d.ts} +1 -18
  80. package/package.json +29 -8
  81. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  82. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  83. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  84. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithRids.js +0 -37
  85. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithRids.js.map +0 -1
  86. package/build/browser/intellisense.test.js +0 -172
  87. package/build/browser/intellisense.test.js.map +0 -1
  88. package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
  89. package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
  90. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  91. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  92. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithRids.js +0 -37
  93. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithRids.js.map +0 -1
  94. package/build/esm/intellisense.test.js +0 -172
  95. package/build/esm/intellisense.test.js.map +0 -1
  96. package/build/types/intellisense.test.d.ts +0 -1
  97. package/build/types/intellisense.test.d.ts.map +0 -1
  98. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
  99. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
  100. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
  101. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
  102. package/build/types/intellisense.test.helpers/useOsdkObjectsWithRids.d.ts +0 -1
  103. package/build/types/intellisense.test.helpers/useOsdkObjectsWithRids.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","canonWhere","canonicalizeWhereClause","stableRids","useMemo","JSON","stringify","stableWithProperties","stableIntersectWith","stableOrderBy","subscribe","getSnapShot","unsubscribe","process","env","NODE_ENV","apiName","observer","observeList","dedupeInterval","length","listPayload","useSyncExternalStore","error","status","Error","fetchMore","hasMore","undefined","data","resolvedList","isLoading","isOptimistic","totalCount"],"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 Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.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 * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] })\n *\n * @example\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 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 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 streamUpdates?: 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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L; rids: readonly string[] },\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> & { pivotTo: L },\n): UseOsdkListResult<LinkedType<Q, L>>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] },\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?: UseOsdkObjectsOptions<Q, RDPs>,\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(OsdkContext2);\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 } = options ?? {};\n\n const canonWhere = observableClient.canonicalizeWhereClause<\n Q,\n RDPs\n >(where ?? {});\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const stableWithProperties = React.useMemo(\n () => withProperties,\n [JSON.stringify(withProperties)],\n );\n\n const stableIntersectWith = React.useMemo(\n () => intersectWith,\n [JSON.stringify(intersectWith)],\n );\n\n const stableOrderBy = React.useMemo(\n () => orderBy,\n [JSON.stringify(orderBy)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n () => ({ unsubscribe: () => {} }),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} [DISABLED]`\n : void 0,\n );\n }\n\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n (observer) =>\n observableClient.observeList({\n type,\n rids: stableRids,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith\n ? { intersectWith: stableIntersectWith }\n : {}),\n ...(pivotTo ? { pivotTo } : {}),\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${\n stableRids ? `[${stableRids.length} rids]` : \"\"\n } ${JSON.stringify(canonWhere)}`\n : void 0,\n );\n },\n [\n enabled,\n observableClient,\n type,\n stableRids,\n canonWhere,\n dedupeIntervalMs,\n pageSize,\n stableOrderBy,\n streamUpdates,\n stableWithProperties,\n autoFetchMore,\n stableIntersectWith,\n pivotTo,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled\n ? (listPayload?.status === \"loading\" || listPayload?.status === \"init\"\n || !listPayload)\n : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AAqLhD,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAM1C;EACE,MAAM;IAAEC;EAAiB,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACL,YAAY,CAAC;EAE3D,MAAM;IACJM,QAAQ;IACRC,gBAAgB;IAChBC,cAAc;IACdC,OAAO,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4B,WAAW,EAAEG,MAAM,KAAK,SAAS,IAAIH,WAAW,EAAEG,MAAM,KAAK,MAAM,IACjE,CAACH,WAAW,GACf,KAAK;IACTW,YAAY,EAAEX,WAAW,EAAEW,YAAY,IAAI,KAAK;IAChDC,UAAU,EAAEZ,WAAW,EAAEY;EAC3B,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","EMPTY_WHERE","useOsdkObjects","type","options","observableClient","useContext","pageSize","dedupeIntervalMs","withProperties","enabled","rids","where","orderBy","streamUpdates","autoFetchMore","intersectWith","pivotTo","$select","canonWhere","canonicalizeWhereClause","stableCanonWhere","useMemo","JSON","stringify","stableRids","stableWithProperties","stableIntersectWith","stableOrderBy","stableSelect","subscribe","getSnapShot","unsubscribe","process","env","NODE_ENV","apiName","observer","observeList","dedupeInterval","select","length","listPayload","useSyncExternalStore","error","status","Error","fetchMore","hasMore","undefined","data","resolvedList","isLoading","isOptimistic","totalCount"],"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 Osdk,\n PropertyKeys,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsCallbackArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.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 * // Fetch specific objects by RID\n * useOsdkObjects(Employee, { rids: ['ri.foo.123', 'ri.foo.456'] })\n *\n * @example\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 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 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 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 * // Only fetch name and status properties\n * useOsdkObjects(Employee, { $select: [\"name\", \"status\"] })\n */\n $select?: readonly PropertyKeys<T>[];\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\nconst EMPTY_WHERE = {};\n\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L; rids: readonly string[] },\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> & { pivotTo: L },\n): UseOsdkListResult<LinkedType<Q, L>>;\n\nexport function useOsdkObjects<\n Q extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] },\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?: UseOsdkObjectsOptions<Q, RDPs>,\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(OsdkContext2);\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 } = options ?? {};\n\n const canonWhere = observableClient.canonicalizeWhereClause<\n Q,\n RDPs\n >(where ?? EMPTY_WHERE);\n\n const stableCanonWhere = React.useMemo(\n () => canonWhere,\n [JSON.stringify(canonWhere)],\n );\n\n const stableRids = React.useMemo(\n () => rids,\n [JSON.stringify(rids)],\n );\n\n const stableWithProperties = React.useMemo(\n () => withProperties,\n [JSON.stringify(withProperties)],\n );\n\n const stableIntersectWith = React.useMemo(\n () => intersectWith,\n [JSON.stringify(intersectWith)],\n );\n\n const stableOrderBy = React.useMemo(\n () => orderBy,\n [JSON.stringify(orderBy)],\n );\n\n const stableSelect = React.useMemo(\n () => $select,\n [JSON.stringify($select)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n () => ({ unsubscribe: () => {} }),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} [DISABLED]`\n : void 0,\n );\n }\n\n return makeExternalStore<\n ObserveObjectsCallbackArgs<Q, RDPs>\n >(\n (observer) =>\n observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith\n ? { intersectWith: stableIntersectWith }\n : {}),\n ...(pivotTo ? { pivotTo } : {}),\n ...(stableSelect ? { select: stableSelect } : {}),\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${\n stableRids ? `[${stableRids.length} rids]` : \"\"\n } ${JSON.stringify(stableCanonWhere)}`\n : void 0,\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n stableRids,\n stableCanonWhere,\n dedupeIntervalMs,\n pageSize,\n stableOrderBy,\n streamUpdates,\n stableWithProperties,\n autoFetchMore,\n stableIntersectWith,\n pivotTo,\n stableSelect,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n return React.useMemo(() => {\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled\n ? (listPayload?.status === \"loading\" || listPayload?.status === \"init\"\n || !listPayload)\n : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount,\n };\n }, [listPayload, enabled]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,EACD,CACEX,OAAO,EACPL,gBAAgB,EAChBF,IAAI,CAACiC,OAAO,EACZjC,IAAI,CAACA,IAAI,EACTsB,UAAU,EACVJ,gBAAgB,EAChBb,gBAAgB,EAChBD,QAAQ,EACRqB,aAAa,EACbd,aAAa,EACbY,oBAAoB,EACpBX,aAAa,EACbY,mBAAmB,EACnBV,OAAO,EACPY,YAAY,CAEhB,CAAC;EAED,MAAMa,WAAW,GAAG5C,KAAK,CAAC6C,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EAEtE,OAAOjC,KAAK,CAACwB,OAAO,CAAC,MAAM;IACzB,IAAIsB,KAAwB;IAC5B,IAAIF,WAAW,IAAI,OAAO,IAAIA,WAAW,IAAIA,WAAW,CAACE,KAAK,EAAE;MAC9DA,KAAK,GAAGF,WAAW,CAACE,KAAK;IAC3B,CAAC,MAAM,IAAIF,WAAW,EAAEG,MAAM,KAAK,OAAO,EAAE;MAC1CD,KAAK,GAAG,IAAIE,KAAK,CAAC,wBAAwB,CAAC;IAC7C;IAEA,OAAO;MACLC,SAAS,EAAEL,WAAW,EAAEM,OAAO,GAAGN,WAAW,CAACK,SAAS,GAAGE,SAAS;MACnEL,KAAK;MACLM,IAAI,EAAER,WAAW,EAAES,YAAY;MAC/BC,SAAS,EAAE1C,OAAO,GACbgC,WAAW,EAAEG,MAAM,KAAK,SAAS,IAAIH,WAAW,EAAEG,MAAM,KAAK,MAAM,IACjE,CAACH,WAAW,GACf,KAAK;MACTW,YAAY,EAAEX,WAAW,EAAEW,YAAY,IAAI,KAAK;MAChDC,UAAU,EAAEZ,WAAW,EAAEY;IAC3B,CAAC;EACH,CAAC,EAAE,CAACZ,WAAW,EAAEhC,OAAO,CAAC,CAAC;AAC5B","ignoreList":[]}
@@ -14,22 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // WARNING!
18
- // WARNING!
19
- // This file is used for tests that check intellisense. Editing this file by hand will likely
20
- // break tests that have hard coded line numbers and line offsets.
21
-
22
- import { Employee } from "@osdk/client.test.ontology";
23
- import { useOsdkObjects } from "@osdk/react/experimental";
24
- function TestComponent() {
25
- const {
26
- data
27
- } = useOsdkObjects(Employee, {
28
- pivotTo: "lead"
29
- });
30
-
31
- // Line 31: Check that data has the correct pivoted type
32
- data?.[0];
33
- return null;
34
- }
35
- //# sourceMappingURL=useOsdkObjectsWithPivot.js.map
17
+ export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
18
+ export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
19
+ export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
20
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.js","names":["useCurrentFoundryUser","useFoundryUser","useFoundryUsersList"],"sources":["admin.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { useCurrentFoundryUser } from \"../../new/platform-apis/admin/useCurrentFoundryUser.js\";\nexport { useFoundryUser } from \"../../new/platform-apis/admin/useFoundryUser.js\";\nexport { useFoundryUsersList } from \"../../new/platform-apis/admin/useFoundryUsersList.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,qBAAqB,QAAQ,wDAAwD;AAC9F,SAASC,cAAc,QAAQ,iDAAiD;AAChF,SAASC,mBAAmB,QAAQ,sDAAsD","ignoreList":[]}
@@ -15,9 +15,6 @@
15
15
  */
16
16
 
17
17
  export { OsdkProvider2 } from "../new/OsdkProvider2.js";
18
- export { useCurrentFoundryUser } from "../new/platform-apis/admin/useCurrentFoundryUser.js";
19
- export { useFoundryUser } from "../new/platform-apis/admin/useFoundryUser.js";
20
- export { useFoundryUsersList } from "../new/platform-apis/admin/useFoundryUsersList.js";
21
18
  export { useLinks } from "../new/useLinks.js";
22
19
  export { useObjectSet } from "../new/useObjectSet.js";
23
20
  export { useOsdkAction } from "../new/useOsdkAction.js";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["OsdkProvider2","useCurrentFoundryUser","useFoundryUser","useFoundryUsersList","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useCurrentFoundryUser } from \"../new/platform-apis/admin/useCurrentFoundryUser.js\";\nexport { useFoundryUser } from \"../new/platform-apis/admin/useFoundryUser.js\";\nexport { useFoundryUsersList } from \"../new/platform-apis/admin/useFoundryUsersList.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,qBAAqB,QAAQ,qDAAqD;AAC3F,SAASC,cAAc,QAAQ,8CAA8C;AAC7E,SAASC,mBAAmB,QAAQ,mDAAmD;AACvF,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkFunction","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"../new/useOsdkFunction.js\";\nexport { useOsdkFunction } from \"../new/useOsdkFunction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type {\n UseOsdkListResult,\n UseOsdkObjectsOptions,\n} from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AAKjE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,aAAa,QAAQ,yBAAyB;AAKvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFor<T extends ObjectOrInterfaceDefinition> = T extends\n InterfaceDefinition ? InterfaceMetadata\n : T extends ObjectTypeDefinition ? ObjectMetadata\n : never;\n\nexport interface UseOsdkMetadataResult<T extends ObjectOrInterfaceDefinition> {\n loading: boolean;\n metadata?: MetadataFor<T>;\n error?: string;\n}\n\nexport function useOsdkMetadata<T extends ObjectOrInterfaceDefinition>(\n type: T,\n): UseOsdkMetadataResult<T> {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState<\n MetadataFor<T> | undefined\n >(undefined);\n const [error, setError] = React.useState<UseOsdkMetadataResult<T>[\"error\"]>();\n\n if (!metadata && !error) {\n client.fetchMetadata(type).then((fetchedMetadata) => {\n setMetadata(fetchedMetadata as MetadataFor<T>);\n }).catch((error: unknown) => {\n const errorMessage = error instanceof Error\n ? error.message\n : String(error);\n setError(errorMessage);\n });\n return { loading: true };\n }\n\n return { loading: false, metadata, error };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,oBAAoB;AAalD,OAAO,SAASC,eAAeA,CAC7BC,IAAO,EACmB;EAC1B,MAAMC,MAAM,GAAGH,aAAa,CAAC,CAAC;EAC9B,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAE5CC,SAAS,CAAC;EACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGV,KAAK,CAACO,QAAQ,CAAoC,CAAC;EAE7E,IAAI,CAACF,QAAQ,IAAI,CAACI,KAAK,EAAE;IACvBL,MAAM,CAACO,aAAa,CAACR,IAAI,CAAC,CAACS,IAAI,CAAEC,eAAe,IAAK;MACnDP,WAAW,CAACO,eAAiC,CAAC;IAChD,CAAC,CAAC,CAACC,KAAK,CAAEL,KAAc,IAAK;MAC3B,MAAMM,YAAY,GAAGN,KAAK,YAAYO,KAAK,GACvCP,KAAK,CAACQ,OAAO,GACbC,MAAM,CAACT,KAAK,CAAC;MACjBC,QAAQ,CAACK,YAAY,CAAC;IACxB,CAAC,CAAC;IACF,OAAO;MAAEI,OAAO,EAAE;IAAK,CAAC;EAC1B;EAEA,OAAO;IAAEA,OAAO,EAAE,KAAK;IAAEd,QAAQ;IAAEI;EAAM,CAAC;AAC5C","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkMetadata.js","names":["React","useOsdkClient","useOsdkMetadata","type","client","metadata","setMetadata","useState","undefined","error","setError","fetchMetadata","then","fetchedMetadata","catch","errorMessage","Error","message","String","loading"],"sources":["useOsdkMetadata.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\nimport React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFetchableDefinition =\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>;\n\ntype MetadataFor<T extends MetadataFetchableDefinition> = T extends\n ObjectTypeDefinition ? ObjectMetadata\n : T extends InterfaceDefinition ? InterfaceMetadata\n : T extends ActionDefinition<any> ? ActionMetadata\n : never;\n\nexport interface UseOsdkMetadataResult<T extends MetadataFetchableDefinition> {\n loading: boolean;\n metadata?: MetadataFor<T>;\n error?: string;\n}\n\nexport function useOsdkMetadata<T extends MetadataFetchableDefinition>(\n type: T,\n): UseOsdkMetadataResult<T> {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState<\n MetadataFor<T> | undefined\n >(undefined);\n const [error, setError] = React.useState<UseOsdkMetadataResult<T>[\"error\"]>();\n\n if (!metadata && !error) {\n client.fetchMetadata(type).then((fetchedMetadata) => {\n setMetadata(fetchedMetadata as MetadataFor<T>);\n }).catch((error: unknown) => {\n const errorMessage = error instanceof Error\n ? error.message\n : String(error);\n setError(errorMessage);\n });\n return { loading: true };\n }\n\n return { loading: false, metadata, error };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,oBAAoB;AAkBlD,OAAO,SAASC,eAAeA,CAC7BC,IAAO,EACmB;EAC1B,MAAMC,MAAM,GAAGH,aAAa,CAAC,CAAC;EAC9B,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAE5CC,SAAS,CAAC;EACZ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGV,KAAK,CAACO,QAAQ,CAAoC,CAAC;EAE7E,IAAI,CAACF,QAAQ,IAAI,CAACI,KAAK,EAAE;IACvBL,MAAM,CAACO,aAAa,CAACR,IAAI,CAAC,CAACS,IAAI,CAAEC,eAAe,IAAK;MACnDP,WAAW,CAACO,eAAiC,CAAC;IAChD,CAAC,CAAC,CAACC,KAAK,CAAEL,KAAc,IAAK;MAC3B,MAAMM,YAAY,GAAGN,KAAK,YAAYO,KAAK,GACvCP,KAAK,CAACQ,OAAO,GACbC,MAAM,CAACT,KAAK,CAAC;MACjBC,QAAQ,CAACK,YAAY,CAAC;IACxB,CAAC,CAAC;IACF,OAAO;MAAEI,OAAO,EAAE;IAAK,CAAC;EAC1B;EAEA,OAAO;IAAEA,OAAO,EAAE,KAAK;IAAEd,QAAQ;IAAEI;EAAM,CAAC;AAC5C","ignoreList":[]}
@@ -8,3 +8,14 @@ export declare function makeExternalStore<X>(createObservation: (callback: Obser
8
8
  subscribe: (notifyUpdate: () => void) => () => void
9
9
  getSnapShot: () => Snapshot<X>
10
10
  };
11
+ /**
12
+ * Like makeExternalStore but for async subscription creation.
13
+ *
14
+ * Uses an isActive flag to handle race conditions:
15
+ * If cleanup runs before promise resolves, the stale subscription is
16
+ * immediately unsubscribed when it eventually resolves
17
+ */
18
+ export declare function makeExternalStoreAsync<X>(createObservation: (callback: Observer<X | undefined>) => Promise<Unsubscribable>, _name?: string, initialValue?: Snapshot<X>): {
19
+ subscribe: (notifyUpdate: () => void) => () => void
20
+ getSnapShot: () => Snapshot<X>
21
+ };
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,UACA,sBACK,kCAAmC;AAE1C,YAAY,SAAS,KACjB,IAAI;CAAE,QAAQ;AAAO,KACpB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_name?: string","initialValue?: Snapshot<X>","notifyUpdate: () => void"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
1
+ {"mappings":"AAgBA,cACE,UACA,sBACK,kCAAmC;AAE1C,YAAY,SAAS,KACjB,IAAI;CAAE,QAAQ;AAAO,KACpB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCA,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B;;;;;;;;AAyCD,OAAO,iBAAS,uBAAuB,GACrCC,oBACEJ,UAAU,SAAS,mBAChB,QAAQ,iBACbC,gBACAC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_name?: string","initialValue?: Snapshot<X>","notifyUpdate: () => void","createObservation: (\n callback: Observer<X | undefined>,\n ) => Promise<Unsubscribable>"],"sources":["../../../src/new/makeExternalStore.ts"],"version":3,"file":"makeExternalStore.d.ts"}
@@ -12,6 +12,12 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
12
12
  /** Sorting options for the linked objects */
13
13
  orderBy?: { [K in PropertyKeys<T>]? : "asc" | "desc" };
14
14
  /**
15
+ * Restrict which properties are returned for each linked object.
16
+ * When provided, only the specified properties will be fetched,
17
+ * reducing payload sizes for list views.
18
+ */
19
+ $select?: readonly PropertyKeys<T>[];
20
+ /**
15
21
  * The mode to use for fetching data.
16
22
  * - undefined: Fetch data if not already in cache
17
23
  * - "force": Always fetch fresh data
@@ -19,6 +25,13 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
19
25
  */
20
26
  mode?: "force" | "offline";
21
27
  /**
28
+ * The number of milliseconds to wait after the last observed link change.
29
+ *
30
+ * Two uses of `useLinks` with the same parameters will only trigger one
31
+ * network request if the second is within `dedupeIntervalMs`.
32
+ */
33
+ dedupeIntervalMs?: number;
34
+ /**
22
35
  * Enable or disable the query.
23
36
  *
24
37
  * When `false`, the query will not automatically execute. It will still
@@ -41,6 +54,12 @@ export interface UseLinksOptions<T extends ObjectOrInterfaceDefinition> {
41
54
  }
42
55
  export interface UseLinksResult<Q extends ObjectOrInterfaceDefinition> {
43
56
  links: Osdk.Instance<Q>[] | undefined;
57
+ /**
58
+ * Maps each source object's primary key to its linked object instances.
59
+ * Useful when observing links from multiple source objects to determine
60
+ * which source links to which targets.
61
+ */
62
+ linkedObjectsBySourcePrimaryKey: ReadonlyMap<string | number, ReadonlyArray<Osdk.Instance<Q>>>;
44
63
  isLoading: boolean;
45
64
  error: Error | undefined;
46
65
  /**
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,YACA,WACA,mCACK,WAAY;AACnB,cAAc,MAAM,cAAc,mBAAmB,cAAe;AAMpE,iBAAiB,gBACf,UAAU,6BACV;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;CASnC,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;CAqBjB;AACD;AAED,iBAAiB,eACf,UAAU,6BACV;CACA,OAAO,KAAK,SAAS;CACrB;CACA,OAAO;;;;CAKP;;;;CAKA,kBAAkB;;;;CAKlB;AACD;;;;;;;;;AAYD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,SAAS,iBAChDC,UAAU,GACVC,UAAS,gBAAgB,WAAW,GAAG,MACtC,eAAe,WAAW,GAAG","names":["objects: Osdk.Instance<T> | Array<Osdk.Instance<T>> | undefined","linkName: L","options: UseLinksOptions<LinkedType<T, L>>"],"sources":["../../../src/new/useLinks.ts"],"version":3,"file":"useLinks.d.ts"}
1
+ {"mappings":"AAgBA,cACE,YACA,WACA,mCACK,WAAY;AACnB,cAAc,MAAM,cAAc,mBAAmB,cAAe;AAMpE,iBAAiB,gBACf,UAAU,6BACV;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;CAQnC,mBAAmB,aAAa;;;;;;;CAQhC,OAAO,UAAU;;;;;;;CAQjB;;;;;;;;;;;;;;;;;;;;CAqBA;AACD;AAED,iBAAiB,eACf,UAAU,6BACV;CACA,OAAO,KAAK,SAAS;;;;;;CAOrB,iCAAiC,6BAE/B,cAAc,KAAK,SAAS;CAG9B;CACA,OAAO;;;;CAKP;;;;CAKA,kBAAkB;;;;CAKlB;AACD;;;;;;;;;AAaD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,SAAS,iBAChDC,UAAU,GACVC,UAAS,gBAAgB,WAAW,GAAG,MACtC,eAAe,WAAW,GAAG","names":["objects: Osdk.Instance<T> | Array<Osdk.Instance<T>> | undefined","linkName: L","options: UseLinksOptions<LinkedType<T, L>>"],"sources":["../../../src/new/useLinks.ts"],"version":3,"file":"useLinks.d.ts"}
@@ -56,6 +56,12 @@ export interface UseObjectSetOptions<
56
56
  */
57
57
  streamUpdates?: boolean;
58
58
  /**
59
+ * Restrict which properties are returned for each object.
60
+ * When provided, only the specified properties will be fetched,
61
+ * reducing payload sizes for list views.
62
+ */
63
+ $select?: readonly PropertyKeys<Q>[];
64
+ /**
59
65
  * Enable or disable the query.
60
66
  *
61
67
  * When `false`, the query will not automatically execute. It will still
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,iBACA,WACA,6BACA,WACA,MACA,cACA,mBACA,mBACK,WAAY;AAUnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;CAKvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,QAAQ,UAAU;;;;CAKlB,YAAY,UAAU;;;;CAKtB,WAAW,UAAU;;;;CAKrB,UAAU,UAAU;;;;CAKpB;;;;CAKA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;;;;CASA;;;;;;;;CASA;;;;;;;;;;;;;;;;;;;;CAqBA;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;CAKP,kBAAkB;;;;CAKlB,WAAW,UAAU,GAAG;;;;CAKxB;AACD;;;;;;;;;;;;AAmBD,OAAO,iBAAS;CACd,UAAU;CACV,iBAAiB,eAAe;CAChC,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,eAAe,UAAU,GAAG,WAC5BC,UAAS,oBAAoB,GAAG,QAC/B,mBAAmB,GAAG","names":["baseObjectSet: ObjectSet<Q, BaseRDPs>","options: UseObjectSetOptions<Q, RDPs>"],"sources":["../../../src/new/useObjectSet.tsx"],"version":3,"file":"useObjectSet.d.ts"}
1
+ {"mappings":"AAgBA,cACE,iBACA,WACA,6BACA,WACA,MACA,cACA,mBACA,mBACK,WAAY;AAUnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;CAKvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,QAAQ,UAAU;;;;CAKlB,YAAY,UAAU;;;;CAKtB,WAAW,UAAU;;;;CAKrB,UAAU,UAAU;;;;CAKpB;;;;CAKA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;;;;CASA;;;;;;;;CASA;;;;;;CAOA,mBAAmB,aAAa;;;;;;;;;;;;;;;;;;;;CAqBhC;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;CAKP,kBAAkB;;;;CAKlB,WAAW,UAAU,GAAG;;;;CAKxB;AACD;;;;;;;;;;;;AAoBD,OAAO,iBAAS;CACd,UAAU;CACV,iBAAiB,eAAe;CAChC,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,eAAe,UAAU,GAAG,WAC5BC,UAAS,oBAAoB,GAAG,QAC/B,mBAAmB,GAAG","names":["baseObjectSet: ObjectSet<Q, BaseRDPs>","options: UseObjectSetOptions<Q, RDPs>"],"sources":["../../../src/new/useObjectSet.tsx"],"version":3,"file":"useObjectSet.d.ts"}
@@ -1,5 +1,6 @@
1
- import type { AggregateOpts, AggregationsResults, DerivedProperty, ObjectOrInterfaceDefinition, SimplePropertyDef, WhereClause } from "@osdk/api";
2
- export interface UseOsdkAggregationOptions<
1
+ import type { AggregateOpts, AggregationsResults, DerivedProperty, ObjectOrInterfaceDefinition, ObjectSet, SimplePropertyDef, WhereClause } from "@osdk/api";
2
+ import type { ObjectTypeDefinition } from "@osdk/client";
3
+ interface UseOsdkAggregationBaseOptions<
3
4
  T extends ObjectOrInterfaceDefinition,
4
5
  A extends AggregateOpts<T>,
5
6
  RDPs extends Record<string, SimplePropertyDef> = {}
@@ -14,6 +15,14 @@ export interface UseOsdkAggregationOptions<
14
15
  */
15
16
  withProperties?: { [K in keyof RDPs] : DerivedProperty.Creator<T, RDPs[K]> };
16
17
  /**
18
+ * Intersect the main query with additional filtered object sets.
19
+ * Each entry creates a separate object set with its own where clause,
20
+ * and the final result is the intersection of all sets.
21
+ */
22
+ intersectWith?: Array<{
23
+ where: WhereClause<T, RDPs>
24
+ }>;
25
+ /**
17
26
  * Aggregation options including groupBy and select
18
27
  */
19
28
  aggregate: A;
@@ -25,6 +34,21 @@ export interface UseOsdkAggregationOptions<
25
34
  */
26
35
  dedupeIntervalMs?: number;
27
36
  }
37
+ export interface UseOsdkAggregationOptions<
38
+ T extends ObjectOrInterfaceDefinition,
39
+ A extends AggregateOpts<T>,
40
+ RDPs extends Record<string, SimplePropertyDef> = {}
41
+ > extends UseOsdkAggregationBaseOptions<T, A, RDPs> {}
42
+ export interface UseOsdkAggregationOptionsWithObjectSet<
43
+ T extends ObjectTypeDefinition,
44
+ A extends AggregateOpts<T>,
45
+ RDPs extends Record<string, SimplePropertyDef> = {}
46
+ > extends UseOsdkAggregationBaseOptions<T, A, RDPs> {
47
+ /**
48
+ * The ObjectSet to aggregate on. Enables aggregation on pivoted, filtered, or composed ObjectSets.
49
+ */
50
+ objectSet: ObjectSet<T>;
51
+ }
28
52
  export interface UseOsdkAggregationResult<
29
53
  T extends ObjectOrInterfaceDefinition,
30
54
  A extends AggregateOpts<T>
@@ -46,6 +70,7 @@ export interface UseOsdkAggregationResult<
46
70
  *
47
71
  * @example
48
72
  * ```tsx
73
+ * // Basic aggregation without ObjectSet
49
74
  * const { data, isLoading, error } = useOsdkAggregation(Employee, {
50
75
  * where: { department: "Engineering" },
51
76
  * aggregate: {
@@ -56,10 +81,23 @@ export interface UseOsdkAggregationResult<
56
81
  * }
57
82
  * }
58
83
  * });
84
+ *
85
+ * // With a pivoted ObjectSet
86
+ * const pivotedSet = useMemo(() => $(Employee).pivotTo("primaryOffice"), []);
87
+ * const { data } = useOsdkAggregation(Office, {
88
+ * objectSet: pivotedSet,
89
+ * aggregate: { $select: { $count: "unordered" } }
90
+ * });
59
91
  * ```
60
92
  */
61
93
  export declare function useOsdkAggregation<
62
94
  Q extends ObjectOrInterfaceDefinition,
63
95
  const A extends AggregateOpts<Q>,
64
96
  RDPs extends Record<string, SimplePropertyDef> = {}
65
- >(type: Q, { where, withProperties, aggregate, dedupeIntervalMs }: UseOsdkAggregationOptions<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
97
+ >(type: Q, options: UseOsdkAggregationOptions<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
98
+ export declare function useOsdkAggregation<
99
+ Q extends ObjectTypeDefinition,
100
+ const A extends AggregateOpts<Q>,
101
+ RDPs extends Record<string, SimplePropertyDef> = {}
102
+ >(type: Q, options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
103
+ export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,eACA,qBACA,iBACA,6BACA,mBACA,mBACK,WAAY;AAMnB,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;;CAMvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,WAAW;;;;;;;CAQX;AACD;AAED,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;EACxB;CACA,MAAM,oBAAoB,GAAG;CAC7B;CACA,OAAO;CACP;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AAgCD,OAAO,iBAAS;CACd,UAAU;OACJ,UAAU,cAAc;CAC9B,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,MAAM,GACN,EACE,OACA,gBACA,WACA,kBACsC,EAArC,0BAA0B,GAAG,GAAG,QAClC,yBAAyB,GAAG","names":["type: Q"],"sources":["../../../src/new/useOsdkAggregation.ts"],"version":3,"file":"useOsdkAggregation.d.ts"}
1
+ {"mappings":"AAgBA,cACE,eACA,qBACA,iBACA,6BACA,WACA,mBACA,mBACK,WAAY;AACnB,cAAc,4BAA4B,cAAe;UAU/C;CACR,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;;CAMvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;;;CAOtE,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG;CACvB;;;;CAKD,WAAW;;;;;;;CAQX;AACD;AAED,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;UAC3C,8BAA8B,GAAG,GAAG,MAAM,CAAE;AAEtD,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,aAAa,eAAe,qBAAqB,CAAE;UAC3C,8BAA8B,GAAG,GAAG,MAAM;;;;CAIlD,WAAW,UAAU;AACtB;AAID,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;EACxB;CACA,MAAM,oBAAoB,GAAG;CAC7B;CACA,OAAO;CACP;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCD,OAAO,iBAAS;CACd,UAAU;OACJ,UAAU,cAAc;CAC9B,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,MAAM,GACNC,SAAS,0BAA0B,GAAG,GAAG,QACxC,yBAAyB,GAAG;AAC/B,OAAO,iBAAS;CACd,UAAU;OACJ,UAAU,cAAc;CAC9B,aAAa,eAAe,qBAAqB,CAAE;EAEnDD,MAAM,GACNE,SAAS,uCAAuC,GAAG,GAAG,QACrD,yBAAyB,GAAG","names":["type: Q","options: UseOsdkAggregationOptions<Q, A, RDPs>","options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>"],"sources":["../../../src/new/useOsdkAggregation.ts"],"version":3,"file":"useOsdkAggregation.d.ts"}
@@ -1,5 +1,5 @@
1
- import type { CompileTimeMetadata, ObjectTypeDefinition, Osdk, QueryDefinition } from "@osdk/api";
2
- import type { QueryParameterType, QueryReturnType } from "@osdk/client/unstable-do-not-use";
1
+ import type { CompileTimeMetadata, ObjectSet, ObjectTypeDefinition, Osdk, QueryDefinition } from "@osdk/api";
2
+ import type { QueryParameterType } from "@osdk/client/unstable-do-not-use";
3
3
  export interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
4
4
  /**
5
5
  * Parameters to pass to the function.
@@ -18,17 +18,23 @@ export interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
18
18
  */
19
19
  dependsOn?: Array<ObjectTypeDefinition | string>;
20
20
  /**
21
- * Specific object instances this function depends on.
21
+ * Specific object instances or ObjectSets this function depends on.
22
22
  * When any of these specific objects change, the function will refetch.
23
23
  * More fine-grained than dependsOn for precise invalidation control.
24
24
  *
25
+ * For ObjectSets, the object type is extracted asynchronously and changes
26
+ * to any object of that type will trigger a refetch.
27
+ *
25
28
  * @example
26
29
  * ```tsx
27
30
  * // Refetch when this specific employee changes
28
31
  * { dependsOnObjects: [employee] }
32
+ *
33
+ * // Refetch when any object in the ObjectSet's type changes
34
+ * { dependsOnObjects: [employeeObjectSet] }
29
35
  * ```
30
36
  */
31
- dependsOnObjects?: Array<Osdk.Instance<ObjectTypeDefinition>>;
37
+ dependsOnObjects?: Array<Osdk.Instance<ObjectTypeDefinition> | ObjectSet<ObjectTypeDefinition>>;
32
38
  /**
33
39
  * The number of milliseconds to dedupe identical function calls.
34
40
  * Two calls with the same function and params will share results
@@ -57,7 +63,7 @@ export interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {
57
63
  /**
58
64
  * The function result, or undefined if not yet loaded or on error.
59
65
  */
60
- data: QueryReturnType<CompileTimeMetadata<Q>["output"]> | undefined;
66
+ data: (CompileTimeMetadata<Q>["signature"] extends (...args: never[]) => infer R ? Awaited<R> : never) | undefined;
61
67
  /**
62
68
  * True while the function is executing.
63
69
  */
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBACA,sBACA,MACA,uBACK,WAAY;AACnB,cAEE,oBACA,uBACK,kCAAmC;AAK1C,iBAAiB,uBAAuB,UAAU,0BAA0B;;;;;CAK1E,SAAS,oBAAoB,GAAG,sBAAsB,oCAElD,mBAAmB,oBAAoB,GAAG;;;;;;;;;;;CAY9C,YAAY,MAAM;;;;;;;;;;;;CAalB,mBAAmB,MAAM,KAAK,SAAS;;;;;;;CAQvC;;;;;;;;;;;;;;;;CAiBA;AACD;AAED,iBAAiB,sBAAsB,UAAU,0BAA0B;;;;CAIzE,MAAM,gBAAgB,oBAAoB,GAAG;;;;CAK7C;;;;CAKA,OAAO;;;;CAKP;;;;;CAMA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCD,OAAO,iBAAS,gBAAgB,UAAU,0BACxCA,UAAU,GACVC,UAAS,uBAAuB,KAC/B,sBAAsB","names":["queryDef: Q","options: UseOsdkFunctionOptions<Q>"],"sources":["../../../src/new/useOsdkFunction.ts"],"version":3,"file":"useOsdkFunction.d.ts"}
1
+ {"mappings":"AAgBA,cACE,qBACA,WACA,sBACA,MACA,uBACK,WAAY;AACnB,cAEE,0BACK,kCAAmC;AAM1C,iBAAiB,uBAAuB,UAAU,0BAA0B;;;;;CAK1E,SAAS,oBAAoB,GAAG,sBAAsB,oCAElD,mBAAmB,oBAAoB,GAAG;;;;;;;;;;;CAY9C,YAAY,MAAM;;;;;;;;;;;;;;;;;;CAmBlB,mBAAmB,MACjB,KAAK,SAAS,wBAAwB,UAAU;;;;;;;CASlD;;;;;;;;;;;;;;;;CAiBA;AACD;AAED,iBAAiB,sBAAsB,UAAU,0BAA0B;;;;CAIzE,OACK,oBAAoB,GAAG,sBAAsB,GAAG,wBAAwB,IACvE,QAAQ;;;;CAOd;;;;CAKA,OAAO;;;;CAKP;;;;;CAMA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCD,OAAO,iBAAS,gBAAgB,UAAU,0BACxCA,UAAU,GACVC,UAAS,uBAAuB,KAC/B,sBAAsB","names":["queryDef: Q","options: UseOsdkFunctionOptions<Q>"],"sources":["../../../src/new/useOsdkFunction.ts"],"version":3,"file":"useOsdkFunction.d.ts"}
@@ -1,4 +1,4 @@
1
- import type { ObjectOrInterfaceDefinition, Osdk, PrimaryKeyType } from "@osdk/api";
1
+ import type { ObjectOrInterfaceDefinition, Osdk, PrimaryKeyType, PropertyKeys } from "@osdk/api";
2
2
  export interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {
3
3
  object: Osdk.Instance<Q> | undefined;
4
4
  isLoading: boolean;
@@ -22,3 +22,14 @@ export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(obj
22
22
  * @param enabled Enable or disable the query (defaults to true)
23
23
  */
24
24
  export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
25
+ /**
26
+ * Loads an object or interface instance by type and primary key with options.
27
+ *
28
+ * @param type The object type or interface definition
29
+ * @param primaryKey The primary key of the object
30
+ * @param options Options including $select and enabled
31
+ */
32
+ export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, options?: {
33
+ $select?: readonly PropertyKeys<Q>[]
34
+ enabled?: boolean
35
+ }): UseOsdkObjectResult<Q>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,6BACA,MACA,sBACK,WAAY;AAMnB,iBAAiB,oBACf,UAAU,6BACV;CACA,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;;AAMD,OAAO,iBAAS,cACd,UAAU,6BAEVA,KAAK,KAAK,SAAS,IACnBC,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cACd,UAAU,6BAEVC,MAAM,GACNC,YAAY,eAAe,IAC3BF,oBACC,oBAAoB","names":["obj: Osdk.Instance<Q>","enabled?: boolean","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
1
+ {"mappings":"AAgBA,cACE,6BACA,MACA,gBACA,oBACK,WAAY;AAMnB,iBAAiB,oBACf,UAAU,6BACV;CACA,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;;AAMD,OAAO,iBAAS,cACd,UAAU,6BAEVA,KAAK,KAAK,SAAS,IACnBC,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cACd,UAAU,6BAEVC,MAAM,GACNC,YAAY,eAAe,IAC3BF,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cACd,UAAU,6BAEVC,MAAM,GACNC,YAAY,eAAe,IAC3BC,UAAU;CAAE,mBAAmB,aAAa;CAAM;AAAmB,IACpE,oBAAoB","names":["obj: Osdk.Instance<Q>","enabled?: boolean","type: Q","primaryKey: PrimaryKeyType<Q>","options?: { $select?: readonly PropertyKeys<Q>[]; enabled?: boolean }"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
@@ -79,6 +79,16 @@ export interface UseOsdkObjectsOptions<
79
79
  */
80
80
  autoFetchMore?: boolean | number;
81
81
  streamUpdates?: boolean;
82
+ /**
83
+ * Restrict which properties are returned for each object.
84
+ * When provided, only the specified properties will be fetched,
85
+ * reducing payload sizes for list views.
86
+ *
87
+ * @example
88
+ * // Only fetch name and status properties
89
+ * useOsdkObjects(Employee, { $select: ["name", "status"] })
90
+ */
91
+ $select?: readonly PropertyKeys<T>[];
82
92
  }
83
93
  export interface UseOsdkListResult<
84
94
  T extends ObjectOrInterfaceDefinition,
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,MACA,cACA,mBACA,mBACK,WAAY;AAMnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;;;;;CAiBA;;;;;;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;;;;;CAMD,UAAU,UAAU;;;;;;;;;;CAWpB;CAEA;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;AACD;AAQD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,MAAM,GACNC,SAAS,sBAAsB,KAAK;CAAE,SAAS;CAAG;AAAyB,IAC1E,kBAAkB,WAAW,GAAG,IAAI,CAAE,GAAE;AAE3C,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBD,MAAM,GACNE,SAAS,sBAAsB,KAAK;CAAE,SAAS;AAAG,IACjD,kBAAkB,WAAW,GAAG;AAEnC,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDF,MAAM,GACNG,SAAS,sBAAsB,GAAG,QAAQ;CAAE;AAAyB,IACpE,kBAAkB,GAAG,MAAM;AAE9B,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDH,MAAM,GACNI,UAAU,sBAAsB,GAAG,QAClC,kBAAkB,GAAG","names":["type: Q","options: UseOsdkObjectsOptions<Q> & { pivotTo: L; rids: readonly string[] }","options: UseOsdkObjectsOptions<Q> & { pivotTo: L }","options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] }","options?: UseOsdkObjectsOptions<Q, RDPs>"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
1
+ {"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,MACA,cACA,mBACA,mBACK,WAAY;AA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: UseOsdkObjectsOptions<Q> & { pivotTo: L }","options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] }","options?: UseOsdkObjectsOptions<Q, RDPs>"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
@@ -0,0 +1,3 @@
1
+ export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
2
+ export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
3
+ export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B","names":[],"sources":["../../../../src/public/experimental/admin.ts"],"version":3,"file":"admin.d.ts"}
@@ -1,7 +1,4 @@
1
1
  export { OsdkProvider2 } from "../new/OsdkProvider2.js";
2
- export { useCurrentFoundryUser } from "../new/platform-apis/admin/useCurrentFoundryUser.js";
3
- export { useFoundryUser } from "../new/platform-apis/admin/useFoundryUser.js";
4
- export { useFoundryUsersList } from "../new/platform-apis/admin/useFoundryUsersList.js";
5
2
  export { useLinks } from "../new/useLinks.js";
6
3
  export { useObjectSet } from "../new/useObjectSet.js";
7
4
  export { useOsdkAction } from "../new/useOsdkAction.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,cAAc,gCAAgC;AAC9C,SAAS,0BAA0B;AACnC,cACE,wBACA,6BACK;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,cACE,mBACA,6BACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B;AAC3C,SAAS,4BAA4B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,cAAc,gCAAgC;AAC9C,SAAS,0BAA0B;AACnC,cACE,wBACA,6BACK;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,cACE,mBACA,6BACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B;AAC3C,SAAS,4BAA4B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
@@ -1,9 +1,10 @@
1
- import type { InterfaceDefinition, InterfaceMetadata, ObjectMetadata, ObjectOrInterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
2
- type MetadataFor<T extends ObjectOrInterfaceDefinition> = T extends InterfaceDefinition ? InterfaceMetadata : T extends ObjectTypeDefinition ? ObjectMetadata : never;
3
- export interface UseOsdkMetadataResult<T extends ObjectOrInterfaceDefinition> {
1
+ import type { ActionDefinition, ActionMetadata, InterfaceDefinition, InterfaceMetadata, ObjectMetadata, ObjectOrInterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
2
+ type MetadataFetchableDefinition = ObjectOrInterfaceDefinition | ActionDefinition<any>;
3
+ type MetadataFor<T extends MetadataFetchableDefinition> = T extends ObjectTypeDefinition ? ObjectMetadata : T extends InterfaceDefinition ? InterfaceMetadata : T extends ActionDefinition<any> ? ActionMetadata : never;
4
+ export interface UseOsdkMetadataResult<T extends MetadataFetchableDefinition> {
4
5
  loading: boolean;
5
6
  metadata?: MetadataFor<T>;
6
7
  error?: string;
7
8
  }
8
- export declare function useOsdkMetadata<T extends ObjectOrInterfaceDefinition>(type: T): UseOsdkMetadataResult<T>;
9
+ export declare function useOsdkMetadata<T extends MetadataFetchableDefinition>(type: T): UseOsdkMetadataResult<T>;
9
10
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBACA,mBACA,gBACA,6BACA,4BACK,WAAY;KAId,YAAY,UAAU,+BAA+B,UACxD,sBAAsB,oBACpB,UAAU,uBAAuB;AAGrC,iBAAiB,sBAAsB,UAAU,6BAA6B;CAC5E;CACA,WAAW,YAAY;CACvB;AACD;AAED,OAAO,iBAAS,gBAAgB,UAAU,6BACxCA,MAAM,IACL,sBAAsB","names":["type: T"],"sources":["../../src/useOsdkMetadata.ts"],"version":3,"file":"useOsdkMetadata.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,gBACA,qBACA,mBACA,gBACA,6BACA,4BACK,WAAY;KAId,8BACD,8BACA;KAEC,YAAY,UAAU,+BAA+B,UACxD,uBAAuB,iBACrB,UAAU,sBAAsB,oBAChC,UAAU,wBAAwB;AAGtC,iBAAiB,sBAAsB,UAAU,6BAA6B;CAC5E;CACA,WAAW,YAAY;CACvB;AACD;AAED,OAAO,iBAAS,gBAAgB,UAAU,6BACxCA,MAAM,IACL,sBAAsB","names":["type: T"],"sources":["../../src/useOsdkMetadata.ts"],"version":3,"file":"useOsdkMetadata.d.ts"}
@@ -560,12 +560,31 @@ function OptionalReportsList({ employee }: { employee: Employee.OsdkInstance })
560
560
  }
561
561
  ```
562
562
 
563
+ ### Controlling Re-fetch Behavior
564
+
565
+ By default, `useLinks` deduplicates network requests within a 2-second window. You can customize this with `dedupeIntervalMs`:
566
+
567
+ ```tsx
568
+ const { links } = useLinks(employee, "reports", {
569
+ dedupeIntervalMs: 10000, // don't re-fetch within 10 seconds
570
+ });
571
+ ```
572
+
573
+ To prevent re-fetching entirely on remount and only refresh when the server data is invalidated (e.g. after an action), use `Infinity`:
574
+
575
+ ```tsx
576
+ const { links } = useLinks(employee, "reports", {
577
+ dedupeIntervalMs: Infinity,
578
+ });
579
+ ```
580
+
563
581
  ### Options
564
582
 
565
583
  - `where` - Filter linked objects
566
584
  - `pageSize` - Number of links per page
567
585
  - `orderBy` - Sort order for linked objects
568
586
  - `mode` - Fetch mode: `"force"` (always fetch), `"offline"` (cache only), or undefined (default)
587
+ - `dedupeIntervalMs` - Minimum time between re-fetches (default: 2000ms)
569
588
  - `enabled` - Enable/disable the query (default: true)
570
589
 
571
590
  ### Return Values
@@ -14,21 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // WARNING!
18
- // WARNING!
19
- // This file is used for tests that check intellisense. Editing this file by hand will likely
20
- // break tests that have hard coded line numbers and line offsets.
21
-
22
- import { Employee } from "@osdk/client.test.ontology";
23
- import { useOsdkObjects } from "@osdk/react/experimental";
24
- function TestComponent() {
25
- const {
26
- data
27
- } = useOsdkObjects(Employee, {
28
- withProperties: {
29
- constantValue: employee => employee.selectProperty("class")
30
- }
31
- });
32
- return null;
33
- }
34
- //# sourceMappingURL=useOsdkObjectsWithProperties.js.map
17
+ export * from "../build/cjs/public/experimental/admin.cjs";