@osdk/react 2.41.0 → 2.41.1-main-e39a72892d538f3130e2cd51cee05d83d11fa493

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 (142) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/browser/aip/chatStore.js.map +1 -1
  3. package/build/browser/aip/chatStream.js +1 -1
  4. package/build/browser/aip/chatStream.js.map +1 -1
  5. package/build/browser/aip/useChat.js +1 -1
  6. package/build/browser/aip/useChat.js.map +1 -1
  7. package/build/browser/new/OsdkContext.js.map +1 -1
  8. package/build/browser/new/OsdkProvider.js.map +1 -1
  9. package/build/browser/new/UserAgentContext.js.map +1 -1
  10. package/build/browser/new/core/stableSerialize.js.map +1 -1
  11. package/build/browser/new/core/useStableObjectSet.js.map +1 -1
  12. package/build/browser/new/createCompositeExternalStore.js +1 -1
  13. package/build/browser/new/createCompositeExternalStore.js.map +1 -1
  14. package/build/browser/new/hookUtils.js.map +1 -1
  15. package/build/browser/new/makeExternalStore.js +3 -3
  16. package/build/browser/new/makeExternalStore.js.map +1 -1
  17. package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -1
  18. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -1
  19. package/build/browser/new/platform-apis/admin/useCurrentFoundryUser.js.map +1 -1
  20. package/build/browser/new/platform-apis/admin/useFoundryUser.js.map +1 -1
  21. package/build/browser/new/platform-apis/admin/useFoundryUsersList.js.map +1 -1
  22. package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -1
  23. package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -1
  24. package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -1
  25. package/build/browser/new/shapes/derivedLinksStore.js.map +1 -1
  26. package/build/browser/new/shapes/types.js.map +1 -1
  27. package/build/browser/new/shapes/useShape.js.map +1 -1
  28. package/build/browser/new/shared/storeUtils.js.map +1 -1
  29. package/build/browser/new/useDevToolsClient.js.map +1 -1
  30. package/build/browser/new/useLinks.js.map +1 -1
  31. package/build/browser/new/useObjectSet.js.map +1 -1
  32. package/build/browser/new/useOsdkAction.js.map +1 -1
  33. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  34. package/build/browser/new/useOsdkFunction.js.map +1 -1
  35. package/build/browser/new/useOsdkFunctions.js.map +1 -1
  36. package/build/browser/new/useOsdkObject.js.map +1 -1
  37. package/build/browser/new/useOsdkObjects.js.map +1 -1
  38. package/build/browser/new/useRegisterUserAgent.js.map +1 -1
  39. package/build/browser/public/testing.js.map +1 -1
  40. package/build/browser/useObservableClient.js.map +1 -1
  41. package/build/browser/useOsdkClient.js.map +1 -1
  42. package/build/browser/useOsdkMetadata.js.map +1 -1
  43. package/build/browser/util/UserAgent.js +1 -1
  44. package/build/browser/util/UserAgent.js.map +1 -1
  45. package/build/browser/utils/useDebouncedCallback.js.map +1 -1
  46. package/build/browser/utils/usePlatformQuery.js.map +1 -1
  47. package/build/cjs/{chunk-SEFARM7Y.cjs → chunk-ICSJXGFL.cjs} +32 -32
  48. package/build/cjs/chunk-ICSJXGFL.cjs.map +1 -0
  49. package/build/cjs/{chunk-UKQGMTMG.cjs → chunk-O5ISVU2U.cjs} +5 -5
  50. package/build/cjs/chunk-O5ISVU2U.cjs.map +1 -0
  51. package/build/cjs/{chunk-HJHKH4B6.cjs → chunk-VQ4PS6U2.cjs} +7 -7
  52. package/build/cjs/{chunk-HJHKH4B6.cjs.map → chunk-VQ4PS6U2.cjs.map} +1 -1
  53. package/build/cjs/index.cjs +16 -16
  54. package/build/cjs/public/experimental/admin.cjs +10 -10
  55. package/build/cjs/public/experimental/aip.cjs +2 -2
  56. package/build/cjs/public/experimental/aip.cjs.map +1 -1
  57. package/build/cjs/public/experimental.cjs +17 -17
  58. package/build/cjs/public/experimental.d.cts +1 -1
  59. package/build/cjs/public/platform-apis.cjs +10 -10
  60. package/build/cjs/public/platform-apis.d.cts +7 -7
  61. package/build/esm/aip/chatStore.js.map +1 -1
  62. package/build/esm/aip/chatStream.js +1 -1
  63. package/build/esm/aip/chatStream.js.map +1 -1
  64. package/build/esm/aip/useChat.js +1 -1
  65. package/build/esm/aip/useChat.js.map +1 -1
  66. package/build/esm/new/OsdkContext.js.map +1 -1
  67. package/build/esm/new/OsdkProvider.js.map +1 -1
  68. package/build/esm/new/UserAgentContext.js.map +1 -1
  69. package/build/esm/new/core/stableSerialize.js.map +1 -1
  70. package/build/esm/new/core/useStableObjectSet.js.map +1 -1
  71. package/build/esm/new/createCompositeExternalStore.js +1 -1
  72. package/build/esm/new/createCompositeExternalStore.js.map +1 -1
  73. package/build/esm/new/hookUtils.js.map +1 -1
  74. package/build/esm/new/makeExternalStore.js +3 -3
  75. package/build/esm/new/makeExternalStore.js.map +1 -1
  76. package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -1
  77. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -1
  78. package/build/esm/new/platform-apis/admin/useCurrentFoundryUser.js.map +1 -1
  79. package/build/esm/new/platform-apis/admin/useFoundryUser.js.map +1 -1
  80. package/build/esm/new/platform-apis/admin/useFoundryUsersList.js.map +1 -1
  81. package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -1
  82. package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -1
  83. package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -1
  84. package/build/esm/new/shapes/derivedLinksStore.js.map +1 -1
  85. package/build/esm/new/shapes/types.js.map +1 -1
  86. package/build/esm/new/shapes/useShape.js.map +1 -1
  87. package/build/esm/new/shared/storeUtils.js.map +1 -1
  88. package/build/esm/new/useDevToolsClient.js.map +1 -1
  89. package/build/esm/new/useLinks.js.map +1 -1
  90. package/build/esm/new/useObjectSet.js.map +1 -1
  91. package/build/esm/new/useOsdkAction.js.map +1 -1
  92. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  93. package/build/esm/new/useOsdkFunction.js.map +1 -1
  94. package/build/esm/new/useOsdkFunctions.js.map +1 -1
  95. package/build/esm/new/useOsdkObject.js.map +1 -1
  96. package/build/esm/new/useOsdkObjects.js.map +1 -1
  97. package/build/esm/new/useRegisterUserAgent.js.map +1 -1
  98. package/build/esm/public/testing.js.map +1 -1
  99. package/build/esm/useObservableClient.js.map +1 -1
  100. package/build/esm/useOsdkClient.js.map +1 -1
  101. package/build/esm/useOsdkMetadata.js.map +1 -1
  102. package/build/esm/util/UserAgent.js +1 -1
  103. package/build/esm/util/UserAgent.js.map +1 -1
  104. package/build/esm/utils/useDebouncedCallback.js.map +1 -1
  105. package/build/esm/utils/usePlatformQuery.js.map +1 -1
  106. package/build/types/aip/chatStore.d.ts.map +1 -1
  107. package/build/types/aip/chatStream.d.ts.map +1 -1
  108. package/build/types/aip/useChat.d.ts.map +1 -1
  109. package/build/types/new/OsdkProvider.d.ts.map +1 -1
  110. package/build/types/new/core/stableSerialize.d.ts.map +1 -1
  111. package/build/types/new/core/useStableObjectSet.d.ts.map +1 -1
  112. package/build/types/new/createCompositeExternalStore.d.ts +1 -1
  113. package/build/types/new/createCompositeExternalStore.d.ts.map +1 -1
  114. package/build/types/new/makeExternalStore.d.ts +2 -2
  115. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  116. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -1
  117. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -1
  118. package/build/types/new/platform-apis/admin/useCurrentFoundryUser.d.ts.map +1 -1
  119. package/build/types/new/platform-apis/admin/useFoundryUser.d.ts.map +1 -1
  120. package/build/types/new/platform-apis/admin/useFoundryUsersList.d.ts.map +1 -1
  121. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -1
  122. package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -1
  123. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -1
  124. package/build/types/new/shapes/derivedLinksStore.d.ts.map +1 -1
  125. package/build/types/new/shapes/useShape.d.ts.map +1 -1
  126. package/build/types/new/useDevToolsClient.d.ts.map +1 -1
  127. package/build/types/new/useLinks.d.ts.map +1 -1
  128. package/build/types/new/useOsdkAction.d.ts.map +1 -1
  129. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  130. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  131. package/build/types/new/useOsdkFunctions.d.ts.map +1 -1
  132. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  133. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  134. package/build/types/new/useRegisterUserAgent.d.ts.map +1 -1
  135. package/build/types/public/testing.d.ts.map +1 -1
  136. package/build/types/useObservableClient.d.ts.map +1 -1
  137. package/build/types/useOsdkClient.d.ts.map +1 -1
  138. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  139. package/build/types/utils/usePlatformQuery.d.ts.map +1 -1
  140. package/package.json +9 -9
  141. package/build/cjs/chunk-SEFARM7Y.cjs.map +0 -1
  142. package/build/cjs/chunk-UKQGMTMG.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkAggregation.js","names":["getWireObjectSet","React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","makeExternalStoreAsync","OsdkContext","useOsdkAggregation","type","options","where","withProperties","intersectWith","aggregate","dedupeIntervalMs","enabled","objectSet","undefined","observableClient","useContext","canonOptions","canonicalizeOptions","objectSetKey","JSON","stringify","objectSetRef","useRef","current","subscribe","getSnapShot","useMemo","unsubscribe","hookType","objectType","apiName","currentObjectSet","observer","observeAggregation","dedupeInterval","payload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","data","result","isLoading","error"],"sources":["useOsdkAggregation.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 AggregateOpts,\n AggregationsResults,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport { getWireObjectSet, type ObjectTypeDefinition } from \"@osdk/client\";\nimport type { ObserveAggregationArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport {\n devToolsMetadata,\n makeExternalStore,\n makeExternalStoreAsync,\n} from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\ninterface UseOsdkAggregationBaseOptions<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Standard OSDK Where clause to filter objects before aggregation\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Define derived properties (RDPs) to be computed server-side.\n * The derived properties can be used in the where clause and aggregation groupBy/select.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * Intersect the main query with additional filtered object sets.\n * Each entry creates a separate object set with its own where clause,\n * and the final result is the intersection of all sets.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Aggregation options including groupBy and select\n */\n aggregate: A;\n\n /**\n * The number of milliseconds to wait after the last observed aggregation change.\n *\n * Two uses of `useOsdkAggregation` 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 aggregation.\n *\n * When `false`, the hook does not subscribe or fetch from the server and\n * reports `data: undefined`, `isLoading: false`, and `error: undefined`.\n * `refetch()` is also a no-op while disabled, so it will not invalidate the\n * object type or trigger network requests. Setting it back to `true`\n * re-subscribes and fetches.\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseOsdkAggregationOptions<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {}\n\nexport interface UseOsdkAggregationOptionsWithObjectSet<\n T extends ObjectTypeDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {\n /**\n * The ObjectSet to aggregate on. Enables aggregation on pivoted, filtered, or composed ObjectSets.\n */\n objectSet: ObjectSet<T>;\n}\n\nexport interface UseOsdkAggregationResult<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n> {\n data: AggregationsResults<T, A> | undefined;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\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 */\nexport function useOsdkAggregation<\n Q extends ObjectOrInterfaceDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkAggregationOptions<Q, A, RDPs>,\n): UseOsdkAggregationResult<Q, A>;\nexport function useOsdkAggregation<\n Q extends ObjectTypeDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>,\n): UseOsdkAggregationResult<Q, A>;\nexport function useOsdkAggregation<\n Q extends ObjectTypeDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options:\n | UseOsdkAggregationOptions<Q, A, RDPs>\n | UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>,\n): UseOsdkAggregationResult<Q, A> {\n const {\n where,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs,\n enabled = true,\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n\n const { observableClient } = React.useContext(OsdkContext);\n\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n aggregate,\n intersectWith,\n });\n\n const objectSetKey = objectSet\n ? JSON.stringify(getWireObjectSet(objectSet as ObjectSet<Q>))\n : undefined;\n\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveAggregationArgs<Q, A>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n }),\n );\n }\n\n const currentObjectSet = objectSetRef.current;\n if (currentObjectSet) {\n return makeExternalStoreAsync<ObserveAggregationArgs<Q, A>>(\n (observer) =>\n observableClient.observeAggregation(\n {\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 },\n observer,\n ),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate,\n }),\n );\n }\n return makeExternalStore<ObserveAggregationArgs<Q, A>>(\n (observer) =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation(\n {\n type,\n where: canonOptions.where,\n withProperties: canonOptions.withProperties,\n intersectWith: canonOptions.intersectWith,\n aggregate: canonOptions.aggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n },\n observer,\n ),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate,\n }),\n );\n },\n [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n objectSetKey,\n canonOptions.where,\n canonOptions.withProperties,\n canonOptions.intersectWith,\n canonOptions.aggregate,\n dedupeIntervalMs,\n ],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n if (!enabled) {\n return;\n }\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName, enabled]);\n\n return React.useMemo(() => ({\n data: payload?.result as AggregationsResults<Q, A> | undefined,\n isLoading: isPayloadLoading(payload, enabled),\n error: extractPayloadError(payload, \"Failed to execute aggregation\"),\n refetch,\n }), [payload, enabled, refetch]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,SAASA,gBAAgB,QAAmC,cAAc;AAE1E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,QACjB,wBAAwB;AAC/B,SAASC,WAAW,QAAQ,kBAAkB;;AAiF9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AoB,CAACZ,SAAS,EAAEC,WAAW,CAAC;EAElE,MAAMY,OAAO,GAAGzC,KAAK,CAAC0C,WAAW,CAAC,YAAY;IAC5C,IAAI,CAAC3B,OAAO,EAAE;MACZ;IACF;IACA,MAAMG,gBAAgB,CAACyB,oBAAoB,CAACnC,IAAI,CAAC0B,OAAO,CAAC;EAC3D,CAAC,EAAE,CAAChB,gBAAgB,EAAEV,IAAI,CAAC0B,OAAO,EAAEnB,OAAO,CAAC,CAAC;EAE7C,OAAOf,KAAK,CAAC8B,OAAO,CAAC,OAAO;IAC1Bc,IAAI,EAAEL,OAAO,EAAEM,MAA+C;IAC9DC,SAAS,EAAE5C,gBAAgB,CAACqC,OAAO,EAAExB,OAAO,CAAC;IAC7CgC,KAAK,EAAE9C,mBAAmB,CAACsC,OAAO,EAAE,+BAA+B,CAAC;IACpEE;EACF,CAAC,CAAC,EAAE,CAACF,OAAO,EAAExB,OAAO,EAAE0B,OAAO,CAAC,CAAC;AAClC","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkAggregation.js","names":["getWireObjectSet","React","extractPayloadError","isPayloadLoading","devToolsMetadata","makeExternalStore","makeExternalStoreAsync","OsdkContext","useOsdkAggregation","type","options","where","withProperties","intersectWith","aggregate","dedupeIntervalMs","enabled","objectSet","undefined","observableClient","useContext","canonOptions","canonicalizeOptions","objectSetKey","JSON","stringify","objectSetRef","useRef","current","subscribe","getSnapShot","useMemo","unsubscribe","hookType","objectType","apiName","currentObjectSet","observer","observeAggregation","dedupeInterval","payload","useSyncExternalStore","refetch","useCallback","invalidateObjectType","data","result","isLoading","error"],"sources":["useOsdkAggregation.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 AggregateOpts,\n AggregationsResults,\n DerivedProperty,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n SimplePropertyDef,\n WhereClause,\n} from \"@osdk/api\";\nimport { getWireObjectSet, type ObjectTypeDefinition } from \"@osdk/client\";\nimport type { ObserveAggregationArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\n\nimport { extractPayloadError, isPayloadLoading } from \"./hookUtils.js\";\nimport {\n devToolsMetadata,\n makeExternalStore,\n makeExternalStoreAsync,\n} from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\ninterface UseOsdkAggregationBaseOptions<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> {\n /**\n * Standard OSDK Where clause to filter objects before aggregation\n */\n where?: WhereClause<T, RDPs>;\n\n /**\n * Define derived properties (RDPs) to be computed server-side.\n * The derived properties can be used in the where clause and aggregation groupBy/select.\n */\n withProperties?: { [K in keyof RDPs]: DerivedProperty.Creator<T, RDPs[K]> };\n\n /**\n * Intersect the main query with additional filtered object sets.\n * Each entry creates a separate object set with its own where clause,\n * and the final result is the intersection of all sets.\n */\n intersectWith?: Array<{\n where: WhereClause<T, RDPs>;\n }>;\n\n /**\n * Aggregation options including groupBy and select\n */\n aggregate: A;\n\n /**\n * The number of milliseconds to wait after the last observed aggregation change.\n *\n * Two uses of `useOsdkAggregation` 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 aggregation.\n *\n * When `false`, the hook does not subscribe or fetch from the server and\n * reports `data: undefined`, `isLoading: false`, and `error: undefined`.\n * `refetch()` is also a no-op while disabled, so it will not invalidate the\n * object type or trigger network requests. Setting it back to `true`\n * re-subscribes and fetches.\n *\n * @default true\n */\n enabled?: boolean;\n}\n\nexport interface UseOsdkAggregationOptions<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {}\n\nexport interface UseOsdkAggregationOptionsWithObjectSet<\n T extends ObjectTypeDefinition,\n A extends AggregateOpts<T>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> extends UseOsdkAggregationBaseOptions<T, A, RDPs> {\n /**\n * The ObjectSet to aggregate on. Enables aggregation on pivoted, filtered, or composed ObjectSets.\n */\n objectSet: ObjectSet<T>;\n}\n\nexport interface UseOsdkAggregationResult<\n T extends ObjectOrInterfaceDefinition,\n A extends AggregateOpts<T>,\n> {\n data: AggregationsResults<T, A> | undefined;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\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 */\nexport function useOsdkAggregation<\n Q extends ObjectOrInterfaceDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkAggregationOptions<Q, A, RDPs>\n): UseOsdkAggregationResult<Q, A>;\nexport function useOsdkAggregation<\n Q extends ObjectTypeDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>\n): UseOsdkAggregationResult<Q, A>;\nexport function useOsdkAggregation<\n Q extends ObjectTypeDefinition,\n const A extends AggregateOpts<Q>,\n RDPs extends Record<string, SimplePropertyDef> = {},\n>(\n type: Q,\n options:\n | UseOsdkAggregationOptions<Q, A, RDPs>\n | UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>\n): UseOsdkAggregationResult<Q, A> {\n const {\n where,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs,\n enabled = true,\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n\n const { observableClient } = React.useContext(OsdkContext);\n\n const canonOptions = observableClient.canonicalizeOptions({\n where,\n withProperties,\n aggregate,\n intersectWith,\n });\n\n const objectSetKey = objectSet\n ? JSON.stringify(getWireObjectSet(objectSet as ObjectSet<Q>))\n : undefined;\n\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n\n const { subscribe, getSnapShot } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore<ObserveAggregationArgs<Q, A>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n })\n );\n }\n\n const currentObjectSet = objectSetRef.current;\n if (currentObjectSet) {\n return makeExternalStoreAsync<ObserveAggregationArgs<Q, A>>(\n (observer) =>\n observableClient.observeAggregation(\n {\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 },\n observer\n ),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate,\n })\n );\n }\n return makeExternalStore<ObserveAggregationArgs<Q, A>>(\n (observer) =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation(\n {\n type,\n where: canonOptions.where,\n withProperties: canonOptions.withProperties,\n intersectWith: canonOptions.intersectWith,\n aggregate: canonOptions.aggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n },\n observer\n ),\n devToolsMetadata({\n hookType: \"useOsdkAggregation\",\n objectType: type.apiName,\n where: canonOptions.where,\n aggregate: canonOptions.aggregate,\n })\n );\n }, [\n enabled,\n observableClient,\n type.apiName,\n type.type,\n objectSetKey,\n canonOptions.where,\n canonOptions.withProperties,\n canonOptions.intersectWith,\n canonOptions.aggregate,\n dedupeIntervalMs,\n ]);\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n if (!enabled) {\n return;\n }\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName, enabled]);\n\n return React.useMemo(\n () => ({\n data: payload?.result as AggregationsResults<Q, A> | undefined,\n isLoading: isPayloadLoading(payload, enabled),\n error: extractPayloadError(payload, \"Failed to execute aggregation\"),\n refetch,\n }),\n [payload, enabled, refetch]\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,SAASA,gBAAgB,QAAmC,cAAc;AAE1E,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,QACjB,wBAAwB;AAC/B,SAASC,WAAW,QAAQ,kBAAkB;;AAiF9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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C;EAElE,MAAMY,OAAO,GAAGzC,KAAK,CAAC0C,WAAW,CAAC,YAAY;IAC5C,IAAI,CAAC3B,OAAO,EAAE;MACZ;IACF;IACA,MAAMG,gBAAgB,CAACyB,oBAAoB,CAACnC,IAAI,CAAC0B,OAAO,CAAC;EAC3D,CAAC,EAAE,CAAChB,gBAAgB,EAAEV,IAAI,CAAC0B,OAAO,EAAEnB,OAAO,CAAC,CAAC;EAE7C,OAAOf,KAAK,CAAC8B,OAAO,CAClB,OAAO;IACLc,IAAI,EAAEL,OAAO,EAAEM,MAA+C;IAC9DC,SAAS,EAAE5C,gBAAgB,CAACqC,OAAO,EAAExB,OAAO,CAAC;IAC7CgC,KAAK,EAAE9C,mBAAmB,CAACsC,OAAO,EAAE,+BAA+B,CAAC;IACpEE;EACF,CAAC,CAAC,EACF,CAACF,OAAO,EAAExB,OAAO,EAAE0B,OAAO,CAC5B,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkFunction.js","names":["React","stableSerialize","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkFunction","queryDef","options","observableClient","useContext","params","dependsOn","dependsOnObjects","dedupeIntervalMs","enabled","stableParams","useMemo","stableDependsOn","map","d","apiName","stableDependsOnObjects","item","$apiName","$primaryKey","paramsForApi","subscribe","getSnapShot","unsubscribe","hookType","objectType","observer","observeFunction","dedupeInterval","version","payload","useSyncExternalStore","refetch","useCallback","invalidateFunction","error","status","Error","undefined","data","result","isLoading","lastUpdated"],"sources":["useOsdkFunction.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 CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n QueryDefinition,\n} from \"@osdk/api\";\nimport type {\n ObserveFunctionCallbackArgs,\n QueryParameterType,\n} from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {\n /**\n * Parameters to pass to the function.\n * Must include all required parameters; optional parameters can be omitted.\n */\n params?: CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\n /**\n * Object types this function depends on.\n * When actions modify objects of these types, the function will automatically refetch.\n *\n * @example\n * ```tsx\n * // Refetch when any Employee object changes\n * { dependsOn: [Employee] }\n * ```\n */\n dependsOn?: Array<ObjectTypeDefinition | string>;\n\n /**\n * Specific object instances or ObjectSets this function depends on.\n * When any of these specific objects change, the function will refetch.\n * More fine-grained than dependsOn for precise invalidation control.\n *\n * For ObjectSets, the object type is extracted asynchronously and changes\n * to any object of that type will trigger a refetch.\n *\n * @example\n * ```tsx\n * // Refetch when this specific employee changes\n * { dependsOnObjects: [employee] }\n *\n * // Refetch when any object in the ObjectSet's type changes\n * { dependsOnObjects: [employeeObjectSet] }\n * ```\n */\n dependsOnObjects?: Array<\n Osdk.Instance<ObjectTypeDefinition> | ObjectSet<ObjectTypeDefinition>\n >;\n\n /**\n * The number of milliseconds to dedupe identical function calls.\n * Two calls with the same function and params will share results\n * if the second call is within this interval of the first.\n * @default 2000\n */\n dedupeIntervalMs?: number;\n\n /**\n * Whether to enable the query. When false, the query will not execute.\n * Useful for:\n * - Dependent queries that need to wait for other data\n * - Conditional queries based on component state\n *\n * @default true\n * @example\n * // Dependent query - wait for required data\n * const { data: employee } = useOsdkObject(Employee, employeeId);\n * const { data: report } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee?.$primaryKey },\n * enabled: !!employee\n * });\n */\n enabled?: boolean;\n}\n\nexport interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {\n /**\n * The function result, or undefined if not yet loaded or on error.\n */\n data:\n | (CompileTimeMetadata<Q>[\"signature\"] extends (...args: never[]) => infer R\n ? Awaited<R>\n : never)\n | undefined;\n\n /**\n * True while the function is executing.\n */\n isLoading: boolean;\n\n /**\n * Error if the function execution failed.\n */\n error: Error | undefined;\n\n /**\n * Timestamp (ms since epoch) of when the result was last fetched.\n */\n lastUpdated: number;\n\n /**\n * Manually refetch the function.\n * Useful for \"pull to refresh\" or retry patterns.\n */\n refetch: () => Promise<void>;\n}\n\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<Q extends QueryDefinition<unknown>>(\n queryDef: Q,\n options: UseOsdkFunctionOptions<Q> = {},\n): UseOsdkFunctionResult<Q> {\n const { observableClient } = React.useContext(OsdkContext);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true,\n } = options;\n\n const stableParams = React.useMemo(\n () => params,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(params)],\n );\n const stableDependsOn = React.useMemo(\n () => dependsOn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(\n dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName),\n )],\n );\n const stableDependsOnObjects = React.useMemo(\n () => dependsOnObjects,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(\n dependsOnObjects?.map(item =>\n \"$apiName\" in item\n ? { $apiName: item.$apiName, $primaryKey: item.$primaryKey }\n : item\n ),\n )],\n );\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams as Record<string, unknown> | undefined;\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveFunctionCallbackArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName,\n }),\n );\n }\n return makeExternalStore<ObserveFunctionCallbackArgs<Q>>(\n (observer) =>\n observableClient.observeFunction(\n queryDef,\n paramsForApi,\n {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n },\n observer,\n ),\n devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName,\n }),\n );\n },\n [\n observableClient,\n queryDef.apiName,\n queryDef.version,\n paramsForApi,\n stableDependsOn,\n stableDependsOnObjects,\n dedupeIntervalMs,\n enabled,\n ],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n\n return React.useMemo(() => {\n const error = payload?.error\n ?? (payload?.status === \"error\"\n ? new Error(\"Failed to execute function\")\n : undefined);\n\n return {\n data: payload?.result as UseOsdkFunctionResult<Q>[\"data\"],\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch,\n };\n }, [payload, refetch]);\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,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;AAsG9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,QAAW,EACXC,OAAkC,GAAG,CAAC,CAAC,EACb;EAC1B,MAAM;IAAEC;EAAiB,CAAC,GAAGR,KAAK,CAACS,UAAU,CAACL,WAAW,CAAC;EAC1D,MAAM;IACJM,MAAM;IACNC,SAAS;IACTC,gBAAgB;IAChBC,gBAAgB;IAChBC,OAAO,GAAG;EACZ,CAAC,GAAGP,OAAO;EAEX,MAAMQ,YAAY,GAAGf,KAAK,CAACgB,OAAO,CAChC,MAAMN,MAAM;EACZ;EACA,CAACT,eAAe,CAACS,MAAM,CAAC,CAC1B,CAAC;EACD,MAAMO,eAAe,GAAGjB,KAAK,CAACgB,OAAO,CACnC,MAAML,SAAS;EACf;EACA,CAACV,eAAe,CACdU,SAAS,EAAEO,GAAG,CAACC,CAAC,IAAI,OAAOA,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAGA,CAAC,CAACC,OAAO,CAC3D,CAAC,CACH,CAAC;EACD,MAAMC,sBAAsB,GAAGrB,KAAK,CAACgB,OAAO,CAC1C,MAAMJ,gBAAgB;EACtB;EACA,CAACX,eAAe,CACdW,gBAAgB,EAAEM,GAAG,CAACI,IAAI,IACxB,UAAU,IAAIA,IAAI,GACd;IAAEC,QAAQ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AAEmB,YAAY,CAAC,CAAC;EAE9C,OAAOzB,KAAK,CAACgB,OAAO,CAAC,MAAM;IACzB,MAAMwB,KAAK,GAAGL,OAAO,EAAEK,KAAK,KACtBL,OAAO,EAAEM,MAAM,KAAK,OAAO,GAC3B,IAAIC,KAAK,CAAC,4BAA4B,CAAC,GACvCC,SAAS,CAAC;IAEhB,OAAO;MACLC,IAAI,EAAET,OAAO,EAAEU,MAA0C;MACzDC,SAAS,EAAEX,OAAO,EAAEM,MAAM,KAAK,SAAS;MACxCD,KAAK;MACLO,WAAW,EAAEZ,OAAO,EAAEY,WAAW,IAAI,CAAC;MACtCV;IACF,CAAC;EACH,CAAC,EAAE,CAACF,OAAO,EAAEE,OAAO,CAAC,CAAC;AACxB","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkFunction.js","names":["React","stableSerialize","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkFunction","queryDef","options","observableClient","useContext","params","dependsOn","dependsOnObjects","dedupeIntervalMs","enabled","stableParams","useMemo","stableDependsOn","map","d","apiName","stableDependsOnObjects","item","$apiName","$primaryKey","paramsForApi","subscribe","getSnapShot","unsubscribe","hookType","objectType","observer","observeFunction","dedupeInterval","version","payload","useSyncExternalStore","refetch","useCallback","invalidateFunction","error","status","Error","undefined","data","result","isLoading","lastUpdated"],"sources":["useOsdkFunction.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 CompileTimeMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n QueryDefinition,\n} from \"@osdk/api\";\nimport type {\n ObserveFunctionCallbackArgs,\n QueryParameterType,\n} from \"@osdk/client/observable\";\nimport React from \"react\";\n\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {\n /**\n * Parameters to pass to the function.\n * Must include all required parameters; optional parameters can be omitted.\n */\n params?: CompileTimeMetadata<Q>[\"parameters\"] extends Record<string, never>\n ? undefined\n : QueryParameterType<CompileTimeMetadata<Q>[\"parameters\"]>;\n\n /**\n * Object types this function depends on.\n * When actions modify objects of these types, the function will automatically refetch.\n *\n * @example\n * ```tsx\n * // Refetch when any Employee object changes\n * { dependsOn: [Employee] }\n * ```\n */\n dependsOn?: Array<ObjectTypeDefinition | string>;\n\n /**\n * Specific object instances or ObjectSets this function depends on.\n * When any of these specific objects change, the function will refetch.\n * More fine-grained than dependsOn for precise invalidation control.\n *\n * For ObjectSets, the object type is extracted asynchronously and changes\n * to any object of that type will trigger a refetch.\n *\n * @example\n * ```tsx\n * // Refetch when this specific employee changes\n * { dependsOnObjects: [employee] }\n *\n * // Refetch when any object in the ObjectSet's type changes\n * { dependsOnObjects: [employeeObjectSet] }\n * ```\n */\n dependsOnObjects?: Array<\n Osdk.Instance<ObjectTypeDefinition> | ObjectSet<ObjectTypeDefinition>\n >;\n\n /**\n * The number of milliseconds to dedupe identical function calls.\n * Two calls with the same function and params will share results\n * if the second call is within this interval of the first.\n * @default 2000\n */\n dedupeIntervalMs?: number;\n\n /**\n * Whether to enable the query. When false, the query will not execute.\n * Useful for:\n * - Dependent queries that need to wait for other data\n * - Conditional queries based on component state\n *\n * @default true\n * @example\n * // Dependent query - wait for required data\n * const { data: employee } = useOsdkObject(Employee, employeeId);\n * const { data: report } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee?.$primaryKey },\n * enabled: !!employee\n * });\n */\n enabled?: boolean;\n}\n\nexport interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {\n /**\n * The function result, or undefined if not yet loaded or on error.\n */\n data:\n | (CompileTimeMetadata<Q>[\"signature\"] extends (...args: never[]) => infer R\n ? Awaited<R>\n : never)\n | undefined;\n\n /**\n * True while the function is executing.\n */\n isLoading: boolean;\n\n /**\n * Error if the function execution failed.\n */\n error: Error | undefined;\n\n /**\n * Timestamp (ms since epoch) of when the result was last fetched.\n */\n lastUpdated: number;\n\n /**\n * Manually refetch the function.\n * Useful for \"pull to refresh\" or retry patterns.\n */\n refetch: () => Promise<void>;\n}\n\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<Q extends QueryDefinition<unknown>>(\n queryDef: Q,\n options: UseOsdkFunctionOptions<Q> = {}\n): UseOsdkFunctionResult<Q> {\n const { observableClient } = React.useContext(OsdkContext);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true,\n } = options;\n\n const stableParams = React.useMemo(\n () => params,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [stableSerialize(params)]\n );\n const stableDependsOn = React.useMemo(\n () => dependsOn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n stableSerialize(\n dependsOn?.map((d) => (typeof d === \"string\" ? d : d.apiName))\n ),\n ]\n );\n const stableDependsOnObjects = React.useMemo(\n () => dependsOnObjects,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n stableSerialize(\n dependsOnObjects?.map((item) =>\n \"$apiName\" in item\n ? { $apiName: item.$apiName, $primaryKey: item.$primaryKey }\n : item\n )\n ),\n ]\n );\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams as Record<string, unknown> | undefined;\n\n const { subscribe, getSnapShot } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore<ObserveFunctionCallbackArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName,\n })\n );\n }\n return makeExternalStore<ObserveFunctionCallbackArgs<Q>>(\n (observer) =>\n observableClient.observeFunction(\n queryDef,\n paramsForApi,\n {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n },\n observer\n ),\n devToolsMetadata({\n hookType: \"useOsdkFunction\",\n objectType: queryDef.apiName,\n })\n );\n }, [\n observableClient,\n queryDef.apiName,\n queryDef.version,\n paramsForApi,\n stableDependsOn,\n stableDependsOnObjects,\n dedupeIntervalMs,\n enabled,\n ]);\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n\n return React.useMemo(() => {\n const error =\n payload?.error ??\n (payload?.status === \"error\"\n ? new Error(\"Failed to execute function\")\n : undefined);\n\n return {\n data: payload?.result as UseOsdkFunctionResult<Q>[\"data\"],\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch,\n };\n }, [payload, refetch]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAO,EAAEK,KAAK,KACbL,OAAO,EAAEM,MAAM,KAAK,OAAO,GACxB,IAAIC,KAAK,CAAC,4BAA4B,CAAC,GACvCC,SAAS,CAAC;IAEhB,OAAO;MACLC,IAAI,EAAET,OAAO,EAAEU,MAA0C;MACzDC,SAAS,EAAEX,OAAO,EAAEM,MAAM,KAAK,SAAS;MACxCD,KAAK;MACLO,WAAW,EAAEZ,OAAO,EAAEY,WAAW,IAAI,CAAC;MACtCV;IACF,CAAC;EACH,CAAC,EAAE,CAACF,OAAO,EAAEE,OAAO,CAAC,CAAC;AACxB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkFunctions.js","names":["React","stableSerialize","createCompositeExternalStore","EMPTY_STORE","OsdkContext","useOsdkFunctions","queries","enabled","maxConcurrent","observableClient","useContext","stableQueriesKey","map","q","apiName","queryDefinition","options","stableQueries","useMemo","subscribe","getSnapshot","length","payloads","useSyncExternalStore","refetches","query","invalidateFunction","params","_","index","payload","error","status","Error","undefined","data","result","isLoading","lastUpdated","refetch"],"sources":["useOsdkFunctions.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { QueryDefinition } from \"@osdk/api\";\nimport React from \"react\";\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport {\n createCompositeExternalStore,\n EMPTY_STORE,\n} from \"./createCompositeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nimport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"./useOsdkFunction.js\";\n\nexport interface FunctionQueryParams<Q extends QueryDefinition<unknown>> {\n queryDefinition: Q;\n /**\n * Only allow params and enabled options at the query level,\n * other options are not yet supported in this batch context\n */\n options?: UseOsdkFunctionOptions<Q>;\n}\n\nexport interface UseOsdkFunctionsProps {\n /**\n * Array of query configurations to execute\n */\n queries: Array<FunctionQueryParams<QueryDefinition<unknown>>>;\n\n /**\n * Whether to enable all queries. When false, no queries will execute.\n * Individual query enabled states are also respected.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Maximum number of queries to execute concurrently.\n * When set, queries are subscribed in batches — the next query starts\n * only after a running one completes (status \"loaded\" or \"error\").\n * Useful for large payloads that may exceed server time limits.\n *\n * @default undefined (all queries run in parallel)\n */\n maxConcurrent?: number;\n}\n\nexport type UseOsdkFunctionsResult = Array<\n UseOsdkFunctionResult<QueryDefinition<unknown>>\n>;\n\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, enabled = true, maxConcurrent }: UseOsdkFunctionsProps,\n): UseOsdkFunctionsResult {\n const { observableClient } = React.useContext(OsdkContext);\n\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\n const { subscribe, getSnapshot } = React.useMemo(\n () =>\n !enabled || stableQueries.length === 0\n ? EMPTY_STORE\n : createCompositeExternalStore(\n stableQueries,\n observableClient,\n maxConcurrent,\n ),\n [enabled, maxConcurrent, observableClient, stableQueries],\n );\n\n const payloads = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const refetches = React.useMemo(\n () =>\n stableQueries.map((query) => async () => {\n await observableClient.invalidateFunction(\n query.queryDefinition,\n query.options?.params as Record<string, unknown> | undefined,\n );\n }),\n [stableQueries, observableClient],\n );\n\n return React.useMemo(\n () =>\n stableQueries.map((_, index): UseOsdkFunctionResult<\n QueryDefinition<unknown>\n > => {\n const payload = payloads[index];\n const error = payload?.error\n ?? (payload?.status === \"error\"\n ? new Error(\"Failed to execute function\")\n : undefined);\n\n return {\n data: payload?.result as UseOsdkFunctionResult<\n QueryDefinition<unknown>\n >[\"data\"],\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch: refetches[index],\n };\n }),\n [stableQueries, payloads, refetches],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SACEC,4BAA4B,EAC5BC,WAAW,QACN,mCAAmC;AAC1C,SAASC,WAAW,QAAQ,kBAAkB;AA2C9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9B;EAAEC,OAAO;EAAEC,OAAO,GAAG,IAAI;EAAEC;AAAqC,CAAC,EACzC;EACxB,MAAM;IAAEC;EAAiB,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACN,WAAW,CAAC;EAE1D,MAAMO,gBAAgB,GAAGV,eAAe,CAACK,OAAO,CAACM,GAAG,CAACC,CAAC,KAAK;IACzDC,OAAO,EAAED,CAAC,CAACE,eAAe,CAACD,OAAO;IAClC,GAAGD,CAAC,CAACG;EACP,CAAC,CAAC,CAAC,CAAC;;EAEJ;EACA,MAAMC,aAAa,GAAGjB,KAAK,CAACkB,OAAO,CAAC,MAAMZ,OAAO,EAAE,CAACK,gBAAgB,CAAC,CAAC;EAEtE,MAAM;IAAEQ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":3,"file":"useOsdkFunctions.js","names":["React","stableSerialize","createCompositeExternalStore","EMPTY_STORE","OsdkContext","useOsdkFunctions","queries","enabled","maxConcurrent","observableClient","useContext","stableQueriesKey","map","q","apiName","queryDefinition","options","stableQueries","useMemo","subscribe","getSnapshot","length","payloads","useSyncExternalStore","refetches","query","invalidateFunction","params","_","index","payload","error","status","Error","undefined","data","result","isLoading","lastUpdated","refetch"],"sources":["useOsdkFunctions.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { QueryDefinition } from \"@osdk/api\";\nimport React from \"react\";\n\nimport { stableSerialize } from \"./core/stableSerialize.js\";\nimport {\n createCompositeExternalStore,\n EMPTY_STORE,\n} from \"./createCompositeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nimport type {\n UseOsdkFunctionOptions,\n UseOsdkFunctionResult,\n} from \"./useOsdkFunction.js\";\n\nexport interface FunctionQueryParams<Q extends QueryDefinition<unknown>> {\n queryDefinition: Q;\n /**\n * Only allow params and enabled options at the query level,\n * other options are not yet supported in this batch context\n */\n options?: UseOsdkFunctionOptions<Q>;\n}\n\nexport interface UseOsdkFunctionsProps {\n /**\n * Array of query configurations to execute\n */\n queries: Array<FunctionQueryParams<QueryDefinition<unknown>>>;\n\n /**\n * Whether to enable all queries. When false, no queries will execute.\n * Individual query enabled states are also respected.\n * @default true\n */\n enabled?: boolean;\n\n /**\n * Maximum number of queries to execute concurrently.\n * When set, queries are subscribed in batches — the next query starts\n * only after a running one completes (status \"loaded\" or \"error\").\n * Useful for large payloads that may exceed server time limits.\n *\n * @default undefined (all queries run in parallel)\n */\n maxConcurrent?: number;\n}\n\nexport type UseOsdkFunctionsResult = Array<\n UseOsdkFunctionResult<QueryDefinition<unknown>>\n>;\n\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}: UseOsdkFunctionsProps): UseOsdkFunctionsResult {\n const { observableClient } = React.useContext(OsdkContext);\n\n const stableQueriesKey = stableSerialize(\n queries.map((q) => ({\n apiName: q.queryDefinition.apiName,\n ...q.options,\n }))\n );\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const stableQueries = React.useMemo(() => queries, [stableQueriesKey]);\n\n const { subscribe, getSnapshot } = React.useMemo(\n () =>\n !enabled || stableQueries.length === 0\n ? EMPTY_STORE\n : createCompositeExternalStore(\n stableQueries,\n observableClient,\n maxConcurrent\n ),\n [enabled, maxConcurrent, observableClient, stableQueries]\n );\n\n const payloads = React.useSyncExternalStore(subscribe, getSnapshot);\n\n const refetches = React.useMemo(\n () =>\n stableQueries.map((query) => async () => {\n await observableClient.invalidateFunction(\n query.queryDefinition,\n query.options?.params as Record<string, unknown> | undefined\n );\n }),\n [stableQueries, observableClient]\n );\n\n return React.useMemo(\n () =>\n stableQueries.map(\n (_, index): UseOsdkFunctionResult<QueryDefinition<unknown>> => {\n const payload = payloads[index];\n const error =\n payload?.error ??\n (payload?.status === \"error\"\n ? new Error(\"Failed to execute function\")\n : undefined);\n\n return {\n data: payload?.result as UseOsdkFunctionResult<\n QueryDefinition<unknown>\n >[\"data\"],\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch: refetches[index],\n };\n }\n ),\n [stableQueries, payloads, refetches]\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SACEC,4BAA4B,EAC5BC,WAAW,QACN,mCAAmC;AAC1C,SAASC,WAAW,QAAQ,kBAAkB;AA2C9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,OAAO;EACPC,OAAO,GAAG,IAAI;EACdC;AACqB,CAAC,EAA0B;EAChD,MAAM;IAAEC;EAAiB,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACN,WAAW,CAAC;EAE1D,MAAMO,gBAAgB,GAAGV,eAAe,CACtCK,OAAO,CAACM,GAAG,CAAEC,CAAC,KAAM;IAClBC,OAAO,EAAED,CAAC,CAACE,eAAe,CAACD,OAAO;IAClC,GAAGD,CAAC,CAACG;EACP,CAAC,CAAC,CACJ,CAAC;;EAED;EACA,MAAMC,aAAa,GAAGjB,KAAK,CAACkB,OAAO,CAAC,MAAMZ,OAAO,EAAE,CAACK,gBAAgB,CAAC,CAAC;EAEtE,MAAM;IAAEQ,SAAS;IAAEC;EAAY,CAAC,GAAGpB,KAAK,CAACkB,OAAO,CAC9C,MACE,CAACX,OAAO,IAAIU,aAAa,CAACI,MAAM,KAAK,CAAC,GAClClB,WAAW,GACXD,4BAA4B,CAC1Be,aAAa,EACbR,gBAAgB,EAChBD,aACF,CAAC,EACP,CAACD,OAAO,EAAEC,aAAa,EAAEC,gBAAgB,EAAEQ,aAAa,CAC1D,CAAC;EAED,MAAMK,QAAQ,GAAGtB,KAAK,CAACuB,oBAAoB,CAACJ,SAAS,EAAEC,WAAW,CAAC;EAEnE,MAAMI,SAAS,GAAGxB,KAAK,CAACkB,OAAO,CAC7B,MACED,aAAa,CAACL,GAAG,CAAEa,KAAK,IAAK,YAAY;IACvC,MAAMhB,gBAAgB,CAACiB,kBAAkB,CACvCD,KAAK,CAACV,eAAe,EACrBU,KAAK,CAACT,OAAO,EAAEW,MACjB,CAAC;EACH,CAAC,CAAC,EACJ,CAACV,aAAa,EAAER,gBAAgB,CAClC,CAAC;EAED,OAAOT,KAAK,CAACkB,OAAO,CAClB,MACED,aAAa,CAACL,GAAG,CACf,CAACgB,CAAC,EAAEC,KAAK,KAAsD;IAC7D,MAAMC,OAAO,GAAGR,QAAQ,CAACO,KAAK,CAAC;IAC/B,MAAME,KAAK,GACTD,OAAO,EAAEC,KAAK,KACbD,OAAO,EAAEE,MAAM,KAAK,OAAO,GACxB,IAAIC,KAAK,CAAC,4BAA4B,CAAC,GACvCC,SAAS,CAAC;IAEhB,OAAO;MACLC,IAAI,EAAEL,OAAO,EAAEM,MAEN;MACTC,SAAS,EAAEP,OAAO,EAAEE,MAAM,KAAK,SAAS;MACxCD,KAAK;MACLO,WAAW,EAAER,OAAO,EAAEQ,WAAW,IAAI,CAAC;MACtCC,OAAO,EAAEf,SAAS,CAACK,KAAK;IAC1B,CAAC;EACH,CACF,CAAC,EACH,CAACZ,aAAa,EAAEK,QAAQ,EAAEE,SAAS,CACrC,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkObject.js","names":["React","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObject","args","observableClient","useContext","isInstanceSignature","optionsArg","undefined","enabled","selectArg","$select","loadPropertySecurityMetadata","$loadPropertySecurityMetadata","includeAllBaseObjectProperties","$includeAllBaseObjectProperties","mode","typeOrApiName","$objectType","primaryKey","$primaryKey","apiNameString","apiName","stableSelect","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","String","observer","observeObject","select","payload","useSyncExternalStore","forceUpdate","useCallback","Error","error","status","object","isLoading","isOptimistic"],"sources":["useOsdkObject.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 ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n} from \"@osdk/api\";\nimport type { ObserveObjectCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkObjectResult<\n Q extends ObjectOrInterfaceDefinition,\n> {\n object: Osdk.Instance<Q, \"$allBaseProperties\"> | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n /**\n * Refers to whether the object is optimistic or not.\n */\n isOptimistic: boolean;\n forceUpdate: () => void;\n}\n\nexport interface UseOsdkObjectOptions<\n Q extends ObjectOrInterfaceDefinition,\n> {\n $select?: readonly PropertyKeys<Q>[];\n enabled?: boolean;\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\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 */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n obj: Osdk.Instance<Q>,\n enabled?: boolean,\n): UseOsdkObjectResult<Q>;\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 */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n enabled?: boolean,\n): UseOsdkObjectResult<Q>;\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 */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: UseOsdkObjectOptions<Q>,\n): UseOsdkObjectResult<Q>;\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject<\n Q extends ObjectOrInterfaceDefinition,\n>(\n ...args:\n | [obj: Osdk.Instance<Q>, enabled?: boolean]\n | [type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean]\n | [\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: UseOsdkObjectOptions<Q>,\n ]\n): UseOsdkObjectResult<Q> {\n const { observableClient } = 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\n && args[2] != null\n && typeof args[2] === \"object\"\n ? args[2]\n : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature\n ? (typeof args[1] === \"boolean\" ? args[1] : true)\n : optionsArg\n ? (optionsArg.enabled ?? true)\n : (typeof args[2] === \"boolean\" ? args[2] : true);\n\n const selectArg = optionsArg?.$select;\n const loadPropertySecurityMetadata = optionsArg\n ?.$loadPropertySecurityMetadata;\n const includeAllBaseObjectProperties = optionsArg\n ?.$includeAllBaseObjectProperties;\n\n const mode = isInstanceSignature ? \"offline\" : undefined;\n\n const typeOrApiName = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$objectType\n : (args[0] as Q);\n\n const primaryKey = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$primaryKey\n : (args[1] as PrimaryKeyType<Q>);\n\n const apiNameString = typeof typeOrApiName === \"string\"\n ? typeOrApiName\n : typeOrApiName.apiName;\n\n const stableSelect = React.useMemo(\n () => selectArg,\n [JSON.stringify(selectArg)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey),\n }),\n );\n }\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n (observer) =>\n observableClient.observeObject<Q>(\n typeOrApiName,\n primaryKey,\n {\n mode,\n $includeAllBaseObjectProperties: includeAllBaseObjectProperties,\n ...(stableSelect ? { select: stableSelect } : {}),\n ...(loadPropertySecurityMetadata\n ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata,\n }\n : {}),\n },\n observer,\n ),\n devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey),\n }),\n );\n },\n [\n enabled,\n observableClient,\n typeOrApiName,\n apiNameString,\n primaryKey,\n mode,\n stableSelect,\n loadPropertySecurityMetadata,\n includeAllBaseObjectProperties,\n ],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n\n return React.useMemo(() => {\n let error: Error | undefined;\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\n return {\n object: payload?.object,\n // Errors take precedence over loading state.\n isLoading: enabled && error == null\n ? (payload?.status === \"loading\" || payload?.status === \"init\"\n || !payload)\n : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate,\n };\n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,CAACb,UAAU;IAC/B,CAAC,CACH,CAAC;EACH,CAAC,EACD,CACEV,OAAO,EACPL,gBAAgB,EAChBa,aAAa,EACbI,aAAa,EACbF,UAAU,EACVH,IAAI,EACJO,YAAY,EACZX,4BAA4B,EAC5BE,8BAA8B,CAElC,CAAC;EAED,MAAMsB,OAAO,GAAGtC,KAAK,CAACuC,oBAAoB,CAACV,SAAS,EAAEC,WAAW,CAAC;EAElE,MAAMU,WAAW,GAAGxC,KAAK,CAACyC,WAAW,CAAC,MAAM;IAC1C,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO1C,KAAK,CAAC0B,OAAO,CAAC,MAAM;IACzB,IAAIiB,KAAwB;IAC5B,IAAIL,OAAO,IAAI,OAAO,IAAIA,OAAO,IAAIA,OAAO,CAACK,KAAK,EAAE;MAClDA,KAAK,GAAGL,OAAO,CAACK,KAAK;IACvB,CAAC,MAAM,IAAIL,OAAO,EAAEM,MAAM,KAAK,OAAO,EAAE;MACtCD,KAAK,GAAG,IAAID,KAAK,CAAC,uBAAuB,CAAC;IAC5C;IAEA,OAAO;MACLG,MAAM,EAAEP,OAAO,EAAEO,MAAM;MACvB;MACAC,SAAS,EAAEnC,OAAO,IAAIgC,KAAK,IAAI,IAAI,GAC9BL,OAAO,EAAEM,MAAM,KAAK,SAAS,IAAIN,OAAO,EAAEM,MAAM,KAAK,MAAM,IACzD,CAACN,OAAO,GACX,KAAK;MACTS,YAAY,EAAE,CAAC,CAACT,OAAO,EAAES,YAAY;MACrCJ,KAAK;MACLH;IACF,CAAC;EACH,CAAC,EAAE,CAACF,OAAO,EAAE3B,OAAO,EAAE6B,WAAW,CAAC,CAAC;AACrC","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkObject.js","names":["React","devToolsMetadata","makeExternalStore","OsdkContext","useOsdkObject","args","observableClient","useContext","isInstanceSignature","optionsArg","undefined","enabled","selectArg","$select","loadPropertySecurityMetadata","$loadPropertySecurityMetadata","includeAllBaseObjectProperties","$includeAllBaseObjectProperties","mode","typeOrApiName","$objectType","primaryKey","$primaryKey","apiNameString","apiName","stableSelect","useMemo","JSON","stringify","subscribe","getSnapShot","unsubscribe","hookType","objectType","String","observer","observeObject","select","payload","useSyncExternalStore","forceUpdate","useCallback","Error","error","status","object","isLoading","isOptimistic"],"sources":["useOsdkObject.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 ObjectOrInterfaceDefinition,\n Osdk,\n PrimaryKeyType,\n PropertyKeys,\n} from \"@osdk/api\";\nimport type { ObserveObjectCallbackArgs } from \"@osdk/client/observable\";\nimport React from \"react\";\n\nimport { devToolsMetadata, makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext } from \"./OsdkContext.js\";\n\nexport interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {\n object: Osdk.Instance<Q, \"$allBaseProperties\"> | undefined;\n isLoading: boolean;\n\n error: Error | undefined;\n\n /**\n * Refers to whether the object is optimistic or not.\n */\n isOptimistic: boolean;\n forceUpdate: () => void;\n}\n\nexport interface UseOsdkObjectOptions<Q extends ObjectOrInterfaceDefinition> {\n $select?: readonly PropertyKeys<Q>[];\n enabled?: boolean;\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\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 */\nexport function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(\n obj: Osdk.Instance<Q>,\n enabled?: boolean\n): UseOsdkObjectResult<Q>;\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 */\nexport function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n enabled?: boolean\n): UseOsdkObjectResult<Q>;\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 */\nexport function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: UseOsdkObjectOptions<Q>\n): UseOsdkObjectResult<Q>;\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(\n ...args:\n | [obj: Osdk.Instance<Q>, enabled?: boolean]\n | [type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean]\n | [\n type: Q,\n primaryKey: PrimaryKeyType<Q>,\n options?: UseOsdkObjectOptions<Q>,\n ]\n): UseOsdkObjectResult<Q> {\n const { observableClient } = 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 =\n !isInstanceSignature && args[2] != null && typeof args[2] === \"object\"\n ? args[2]\n : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature\n ? typeof args[1] === \"boolean\"\n ? args[1]\n : true\n : optionsArg\n ? (optionsArg.enabled ?? true)\n : typeof args[2] === \"boolean\"\n ? args[2]\n : true;\n\n const selectArg = optionsArg?.$select;\n const loadPropertySecurityMetadata =\n optionsArg?.$loadPropertySecurityMetadata;\n const includeAllBaseObjectProperties =\n optionsArg?.$includeAllBaseObjectProperties;\n\n const mode = isInstanceSignature ? \"offline\" : undefined;\n\n const typeOrApiName = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$objectType\n : (args[0] as Q);\n\n const primaryKey = isInstanceSignature\n ? (args[0] as Osdk.Instance<Q>).$primaryKey\n : (args[1] as PrimaryKeyType<Q>);\n\n const apiNameString =\n typeof typeOrApiName === \"string\" ? typeOrApiName : typeOrApiName.apiName;\n\n const stableSelect = React.useMemo(\n () => selectArg,\n [JSON.stringify(selectArg)]\n );\n\n const { subscribe, getSnapShot } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey),\n })\n );\n }\n return makeExternalStore<ObserveObjectCallbackArgs<Q>>(\n (observer) =>\n observableClient.observeObject<Q>(\n typeOrApiName,\n primaryKey,\n {\n mode,\n $includeAllBaseObjectProperties: includeAllBaseObjectProperties,\n ...(stableSelect ? { select: stableSelect } : {}),\n ...(loadPropertySecurityMetadata\n ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata,\n }\n : {}),\n },\n observer\n ),\n devToolsMetadata({\n hookType: \"useOsdkObject\",\n objectType: apiNameString,\n primaryKey: String(primaryKey),\n })\n );\n }, [\n enabled,\n observableClient,\n typeOrApiName,\n apiNameString,\n primaryKey,\n mode,\n stableSelect,\n loadPropertySecurityMetadata,\n includeAllBaseObjectProperties,\n ]);\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n\n return React.useMemo(() => {\n let error: Error | undefined;\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\n return {\n object: payload?.object,\n // Errors take precedence over loading state.\n isLoading:\n enabled && error == null\n ? payload?.status === \"loading\" ||\n payload?.status === \"init\" ||\n !payload\n : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate,\n };\n }, [payload, enabled, forceUpdate]);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;;AA2B9C;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAC3B,GAAGC,IAOE,EACmB;EACxB,MAAM;IAAEC;EAAiB,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACJ,WAAW,CAAC;;EAE1D;EACA;EACA;EACA,MAAMK,mBAAmB,GAAG,aAAa,IAAIH,IAAI,CAAC,CAAC,CAAC;;EAEpD;EACA,MAAMI,UAAU,GACd,CAACD,mBAAmB,IAAIH,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,OAAOA,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,GAClEA,IAAI,CAAC,CAAC,CAAC,GACPK,SAAS;;EAEf;EACA,MAAMC,OAAO,GAAGH,mBAAmB,GAC/B,OAAOH,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,GAC1BA,IAAI,CAAC,CAAC,CAAC,GACP,IAAI,GACNI,UAAU,GACPA,UAAU,CAACE,OAAO,IAAI,IAAI,GAC3B,OAAON,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,GAC1BA,IAAI,CAAC,CAAC,CAAC,GACP,IAAI;EAEZ,MAAMO,SAAS,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3B,OAAO,EAAE6B,WAAW,CAAC,CAAC;AACrC","ignoreList":[]}
@@ -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","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,QA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,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
+ {"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\";\n\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\" }\n ? { resolveToObjectType?: boolean }\n : { resolveToObjectType?: never };\n\nexport type UseOsdkObjectsOptions<\n T extends ObjectOrInterfaceDefinition,\n RDPs extends Record<string, SimplePropertyDef> = {},\n> = UseOsdkObjectsBaseOptions<T, RDPs> & 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?: UseOsdkObjectsOptions<Q, RDPs> & { 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 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(() => rids, [JSON.stringify(rids)]);\n\n const { subscribe, getSnapShot } = React.useMemo(() => {\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 {\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 },\n observer\n ),\n devToolsMetadata({\n hookType: \"useOsdkObjects\",\n objectType: type.apiName,\n where: canonOptions.where,\n orderBy: canonOptions.orderBy,\n pageSize,\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 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;AAEzB,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,gBAAgB;AACtE,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,wBAAwB;AAC5E,SAASC,WAAW,QAAQ,kBAAkB;;AAE9C;AACA;AACA;AACA;;AAqMA;AACA;;AAwBA;AACA;;AAoBA,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAwC,EAKqB;EAC7D,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,+BAA+B;IAC/BC;EACF,CAAC,GAAGjB,OAAO,IAAI,CAAC,CAAC;EAEjB,MAAMkB,YAAY,GAAGjB,gBAAgB,CAACkB,mBAAmB,CAAC;IACxDX,KAAK;IACLH,cAAc;IACdI,OAAO;IACPG,aAAa;IACbE;EACF,CAAC,CAAC;EAEF,MAAMM,UAAU,GAAG5B,KAAK,CAAC6B,OAAO,CAAC,MAAMd,IAAI,EAAE,CAACe,IAAI,CAACC,SAAS,CAAChB,IAAI,CAAC,CAAC,CAAC;EAEpE,MAAM;IAAEiB,SAAS;IAAEC;EAAY,CAAC,GAAGjC,KAAK,CAAC6B,OAAO,CAAC,MAAM;IACrD,IAAI,CAACf,OAAO,EAAE;MACZ,OAAOV,iBAAiB,CACtB,OAAO;QAAE8B,WAAW,EAAEA,CAAA,KAAM,CAAC;MAAE,CAAC,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AU,EACVF,YAAY,CAACV,KAAK,EAClBJ,gBAAgB,EAChBD,QAAQ,EACRe,YAAY,CAACT,OAAO,EACpBC,aAAa,EACbQ,YAAY,CAACb,cAAc,EAC3BM,aAAa,EACbO,YAAY,CAACN,aAAa,EAC1BC,OAAO,EACPK,YAAY,CAACJ,OAAO,EACpBC,6BAA6B,EAC7BC,+BAA+B,EAC/B,CAAC,CAACC,mBAAmB,CACtB,CAAC;EAEF,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":"useRegisterUserAgent.js","names":["React","useOnMount","UserAgentContext","useRegisterUserAgent","agent","addUserAgent","useContext"],"sources":["useRegisterUserAgent.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 React from \"react\";\nimport { useOnMount } from \"./core/useOnMount.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\n\nexport function useRegisterUserAgent(agent: string): void {\n const addUserAgent = React.useContext(UserAgentContext);\n useOnMount(() => {\n return addUserAgent(agent);\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,oBAAoBA,CAACC,KAAa,EAAQ;EACxD,MAAMC,YAAY,GAAGL,KAAK,CAACM,UAAU,CAACJ,gBAAgB,CAAC;EACvDD,UAAU,CAAC,MAAM;IACf,OAAOI,YAAY,CAACD,KAAK,CAAC;EAC5B,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"useRegisterUserAgent.js","names":["React","useOnMount","UserAgentContext","useRegisterUserAgent","agent","addUserAgent","useContext"],"sources":["useRegisterUserAgent.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 React from \"react\";\n\nimport { useOnMount } from \"./core/useOnMount.js\";\nimport { UserAgentContext } from \"./UserAgentContext.js\";\n\nexport function useRegisterUserAgent(agent: string): void {\n const addUserAgent = React.useContext(UserAgentContext);\n useOnMount(() => {\n return addUserAgent(agent);\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,oBAAoBA,CAACC,KAAa,EAAQ;EACxD,MAAMC,YAAY,GAAGL,KAAK,CAACM,UAAU,CAACJ,gBAAgB,CAAC;EACvDD,UAAU,CAAC,MAAM;IACf,OAAOI,YAAY,CAACD,KAAK,CAAC;EAC5B,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","names":["React","OsdkContext","FAKE_OBSERVABLE_CLIENT_MESSAGE","fakeObservableClient","Proxy","get","_target","prop","Symbol","toPrimitive","toStringTag","undefined","_args","Error","TestOsdkProvider","children","client","observableClient","value","useMemo","devtoolsEnabled","createElement","Provider"],"sources":["testing.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 { Client } from \"@osdk/client\";\nimport type { ObservableClient } from \"@osdk/client/observable\";\nimport * as React from \"react\";\nimport { OsdkContext } from \"../new/OsdkContext.js\";\n\nconst FAKE_OBSERVABLE_CLIENT_MESSAGE =\n \"fakeObservableClient method called in a test. This stub throws on any access — pass a real ObservableClient if your test exercises observable client behavior.\";\n\n/**\n * A Proxy-based ObservableClient stub for tests that wrap a hook in\n * <TestOsdkProvider> but do not exercise any observable client behavior.\n *\n * Any property access returns a function that throws, so accidental usage\n * fails loudly instead of silently returning `undefined`.\n */\nexport const fakeObservableClient: ObservableClient = new Proxy(\n {} as ObservableClient,\n {\n get(_target, prop) {\n if (prop === Symbol.toPrimitive || prop === Symbol.toStringTag) {\n return undefined;\n }\n return (..._args: unknown[]) => {\n throw new Error(FAKE_OBSERVABLE_CLIENT_MESSAGE);\n };\n },\n },\n);\n\n/**\n * A minimal provider for tests. Bypasses the production `OsdkProvider`'s\n * devtools and user-agent wiring and lets the caller inject both a `client`\n * and an `ObservableClient` directly.\n *\n * Production code should always use `<OsdkProvider client={...}>`, which\n * derives its `ObservableClient` from `client` so the two cannot diverge.\n */\nexport function TestOsdkProvider({\n children,\n client,\n observableClient,\n}: {\n children: React.ReactNode;\n client: Client;\n observableClient: ObservableClient;\n}): React.JSX.Element {\n const value = React.useMemo(\n () => ({ client, observableClient, devtoolsEnabled: false }),\n [client, observableClient],\n );\n return React.createElement(OsdkContext.Provider, { value }, children);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,MAAMC,8BAA8B,GAClC,gKAAgK;;AAElK;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAsC,GAAG,IAAIC,KAAK,CAC7D,CAAC,CAAC,EACF;EACEC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,IAAIA,IAAI,KAAKC,MAAM,CAACC,WAAW,IAAIF,IAAI,KAAKC,MAAM,CAACE,WAAW,EAAE;MAC9D,OAAOC,SAAS;IAClB;IACA,OAAO,CAAC,GAAGC,KAAgB,KAAK;MAC9B,MAAM,IAAIC,KAAK,CAACX,8BAA8B,CAAC;IACjD,CAAC;EACH;AACF,CACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,gBAAgBA,CAAC;EAC/BC,QAAQ;EACRC,MAAM;EACNC;AAKF,CAAC,EAAqB;EACpB,MAAMC,KAAK,GAAGlB,KAAK,CAACmB,OAAO,CACzB,OAAO;IAAEH,MAAM;IAAEC,gBAAgB;IAAEG,eAAe,EAAE;EAAM,CAAC,CAAC,EAC5D,CAACJ,MAAM,EAAEC,gBAAgB,CAC3B,CAAC;EACD,oBAAOjB,KAAK,CAACqB,aAAa,CAACpB,WAAW,CAACqB,QAAQ,EAAE;IAAEJ;EAAM,CAAC,EAAEH,QAAQ,CAAC;AACvE","ignoreList":[]}
1
+ {"version":3,"file":"testing.js","names":["React","OsdkContext","FAKE_OBSERVABLE_CLIENT_MESSAGE","fakeObservableClient","Proxy","get","_target","prop","Symbol","toPrimitive","toStringTag","undefined","_args","Error","TestOsdkProvider","children","client","observableClient","value","useMemo","devtoolsEnabled","createElement","Provider"],"sources":["testing.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 { Client } from \"@osdk/client\";\nimport type { ObservableClient } from \"@osdk/client/observable\";\nimport * as React from \"react\";\n\nimport { OsdkContext } from \"../new/OsdkContext.js\";\n\nconst FAKE_OBSERVABLE_CLIENT_MESSAGE =\n \"fakeObservableClient method called in a test. This stub throws on any access — pass a real ObservableClient if your test exercises observable client behavior.\";\n\n/**\n * A Proxy-based ObservableClient stub for tests that wrap a hook in\n * <TestOsdkProvider> but do not exercise any observable client behavior.\n *\n * Any property access returns a function that throws, so accidental usage\n * fails loudly instead of silently returning `undefined`.\n */\nexport const fakeObservableClient: ObservableClient = new Proxy(\n {} as ObservableClient,\n {\n get(_target, prop) {\n if (prop === Symbol.toPrimitive || prop === Symbol.toStringTag) {\n return undefined;\n }\n return (..._args: unknown[]) => {\n throw new Error(FAKE_OBSERVABLE_CLIENT_MESSAGE);\n };\n },\n }\n);\n\n/**\n * A minimal provider for tests. Bypasses the production `OsdkProvider`'s\n * devtools and user-agent wiring and lets the caller inject both a `client`\n * and an `ObservableClient` directly.\n *\n * Production code should always use `<OsdkProvider client={...}>`, which\n * derives its `ObservableClient` from `client` so the two cannot diverge.\n */\nexport function TestOsdkProvider({\n children,\n client,\n observableClient,\n}: {\n children: React.ReactNode;\n client: Client;\n observableClient: ObservableClient;\n}): React.JSX.Element {\n const value = React.useMemo(\n () => ({ client, observableClient, devtoolsEnabled: false }),\n [client, observableClient]\n );\n return React.createElement(OsdkContext.Provider, { value }, children);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,MAAMC,8BAA8B,GAClC,gKAAgK;;AAElK;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAsC,GAAG,IAAIC,KAAK,CAC7D,CAAC,CAAC,EACF;EACEC,GAAGA,CAACC,OAAO,EAAEC,IAAI,EAAE;IACjB,IAAIA,IAAI,KAAKC,MAAM,CAACC,WAAW,IAAIF,IAAI,KAAKC,MAAM,CAACE,WAAW,EAAE;MAC9D,OAAOC,SAAS;IAClB;IACA,OAAO,CAAC,GAAGC,KAAgB,KAAK;MAC9B,MAAM,IAAIC,KAAK,CAACX,8BAA8B,CAAC;IACjD,CAAC;EACH;AACF,CACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,gBAAgBA,CAAC;EAC/BC,QAAQ;EACRC,MAAM;EACNC;AAKF,CAAC,EAAqB;EACpB,MAAMC,KAAK,GAAGlB,KAAK,CAACmB,OAAO,CACzB,OAAO;IAAEH,MAAM;IAAEC,gBAAgB;IAAEG,eAAe,EAAE;EAAM,CAAC,CAAC,EAC5D,CAACJ,MAAM,EAAEC,gBAAgB,CAC3B,CAAC;EACD,oBAAOjB,KAAK,CAACqB,aAAa,CAACpB,WAAW,CAACqB,QAAQ,EAAE;IAAEJ;EAAM,CAAC,EAAEH,QAAQ,CAAC;AACvE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useObservableClient.js","names":["React","OsdkContext","useObservableClient","useContext","observableClient"],"sources":["useObservableClient.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 { ObservableClient } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport { OsdkContext } from \"./new/OsdkContext.js\";\n\n/**\n * Returns the `ObservableClient` that the surrounding `OsdkProvider` uses to\n * power the normalized cache. Reach for it when you need to invalidate cached\n * data for changes that bypass the action flow, for example an external system,\n * a background job, or a WebSocket update from another service.\n *\n * @example\n * ```tsx\n * function RefreshButton({ todo }: { todo: Todo.OsdkInstance }) {\n * const observableClient = useObservableClient();\n * return (\n * <button onClick={() => observableClient.invalidateObjects(todo)}>\n * Refresh\n * </button>\n * );\n * }\n * ```\n */\nexport function useObservableClient(): ObservableClient {\n return React.useContext(OsdkContext).observableClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,sBAAsB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAA,EAAqB;EACtD,OAAOF,KAAK,CAACG,UAAU,CAACF,WAAW,CAAC,CAACG,gBAAgB;AACvD","ignoreList":[]}
1
+ {"version":3,"file":"useObservableClient.js","names":["React","OsdkContext","useObservableClient","useContext","observableClient"],"sources":["useObservableClient.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 { ObservableClient } from \"@osdk/client/observable\";\nimport React from \"react\";\n\nimport { OsdkContext } from \"./new/OsdkContext.js\";\n\n/**\n * Returns the `ObservableClient` that the surrounding `OsdkProvider` uses to\n * power the normalized cache. Reach for it when you need to invalidate cached\n * data for changes that bypass the action flow, for example an external system,\n * a background job, or a WebSocket update from another service.\n *\n * @example\n * ```tsx\n * function RefreshButton({ todo }: { todo: Todo.OsdkInstance }) {\n * const observableClient = useObservableClient();\n * return (\n * <button onClick={() => observableClient.invalidateObjects(todo)}>\n * Refresh\n * </button>\n * );\n * }\n * ```\n */\nexport function useObservableClient(): ObservableClient {\n return React.useContext(OsdkContext).observableClient;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,sBAAsB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAA,EAAqB;EACtD,OAAOF,KAAK,CAACG,UAAU,CAACF,WAAW,CAAC,CAACG,gBAAgB;AACvD","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkClient.js","names":["React","OsdkContext","useOsdkClient","useContext","client"],"sources":["useOsdkClient.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 { Client } from \"@osdk/client\";\nimport React from \"react\";\nimport { OsdkContext } from \"./new/OsdkContext.js\";\n\nexport function useOsdkClient(): Client {\n return React.useContext(OsdkContext).client;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAO,SAASC,aAAaA,CAAA,EAAW;EACtC,OAAOF,KAAK,CAACG,UAAU,CAACF,WAAW,CAAC,CAACG,MAAM;AAC7C","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkClient.js","names":["React","OsdkContext","useOsdkClient","useContext","client"],"sources":["useOsdkClient.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 { Client } from \"@osdk/client\";\nimport React from \"react\";\n\nimport { OsdkContext } from \"./new/OsdkContext.js\";\n\nexport function useOsdkClient(): Client {\n return React.useContext(OsdkContext).client;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAO,SAASC,aAAaA,CAAA,EAAW;EACtC,OAAOF,KAAK,CAACG,UAAU,CAACF,WAAW,CAAC,CAACG,MAAM;AAC7C","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 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":[]}
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\";\n\nimport { useOsdkClient } from \"./useOsdkClient.js\";\n\ntype MetadataFetchableDefinition =\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>;\n\ntype MetadataFor<T extends MetadataFetchableDefinition> =\n T extends ObjectTypeDefinition\n ? ObjectMetadata\n : T extends InterfaceDefinition\n ? InterfaceMetadata\n : T extends ActionDefinition<any>\n ? 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<MetadataFor<T> | undefined>(\n undefined\n );\n const [error, setError] = React.useState<UseOsdkMetadataResult<T>[\"error\"]>();\n\n if (!metadata && !error) {\n client\n .fetchMetadata(type)\n .then((fetchedMetadata) => {\n setMetadata(fetchedMetadata as MetadataFor<T>);\n })\n .catch((error: unknown) => {\n const errorMessage =\n error instanceof Error ? error.message : 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;AAEzB,SAASC,aAAa,QAAQ,oBAAoB;AAqBlD,OAAO,SAASC,eAAeA,CAC7BC,IAAO,EACmB;EAC1B,MAAMC,MAAM,GAAGH,aAAa,CAAC,CAAC;EAC9B,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAC5CC,SACF,CAAC;EACD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGV,KAAK,CAACO,QAAQ,CAAoC,CAAC;EAE7E,IAAI,CAACF,QAAQ,IAAI,CAACI,KAAK,EAAE;IACvBL,MAAM,CACHO,aAAa,CAACR,IAAI,CAAC,CACnBS,IAAI,CAAEC,eAAe,IAAK;MACzBP,WAAW,CAACO,eAAiC,CAAC;IAChD,CAAC,CAAC,CACDC,KAAK,CAAEL,KAAc,IAAK;MACzB,MAAMM,YAAY,GAChBN,KAAK,YAAYO,KAAK,GAAGP,KAAK,CAACQ,OAAO,GAAGC,MAAM,CAACT,KAAK,CAAC;MACxDC,QAAQ,CAACK,YAAY,CAAC;IACxB,CAAC,CAAC;IACJ,OAAO;MAAEI,OAAO,EAAE;IAAK,CAAC;EAC1B;EAEA,OAAO;IAAEA,OAAO,EAAE,KAAK;IAAEd,QAAQ;IAAEI;EAAM,CAAC;AAC5C","ignoreList":[]}
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const REACT_USER_AGENT = `osdk-react/${"2.41.0"}`;
17
+ export const REACT_USER_AGENT = `osdk-react/${"2.41.1-main-e39a72892d538f3130e2cd51cee05d83d11fa493"}`;
18
18
  //# sourceMappingURL=UserAgent.js.map
@@ -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,wBAA2C","ignoreList":[]}
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 = `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,GAAG,sEAA2C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useDebouncedCallback.js","names":["React","useDebouncedCallback","callback","delay","timeoutRef","useRef","callbackRef","lastArgsRef","current","cancel","useCallback","clearTimeout","undefined","flush","debouncedCallback","args","setTimeout","useEffect","Object","assign"],"sources":["useDebouncedCallback.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 React from \"react\";\n\nexport interface DebouncedCallback<TArgs extends readonly unknown[]> {\n (...args: TArgs): void;\n cancel: () => void;\n flush: () => void;\n}\n\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<TArgs extends readonly unknown[]>(\n callback: (...args: TArgs) => void | Promise<void>,\n delay: number,\n): DebouncedCallback<TArgs> {\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef<TArgs>();\n\n callbackRef.current = callback;\n\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\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\n const debouncedCallback = React.useCallback(\n (...args: TArgs) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n },\n [delay, cancel],\n );\n\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n\n return Object.assign(debouncedCallback, { cancel, flush });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAQzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,QAAkD,EAClDC,KAAa,EACa;EAC1B,MAAMC,UAAU,GAAGJ,KAAK,CA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L,MAAM;IAAEI;EAAM,CAAC,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"file":"useDebouncedCallback.js","names":["React","useDebouncedCallback","callback","delay","timeoutRef","useRef","callbackRef","lastArgsRef","current","cancel","useCallback","clearTimeout","undefined","flush","debouncedCallback","args","setTimeout","useEffect","Object","assign"],"sources":["useDebouncedCallback.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 React from \"react\";\n\nexport interface DebouncedCallback<TArgs extends readonly unknown[]> {\n (...args: TArgs): void;\n cancel: () => void;\n flush: () => void;\n}\n\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<TArgs extends readonly unknown[]>(\n callback: (...args: TArgs) => void | Promise<void>,\n delay: number\n): DebouncedCallback<TArgs> {\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout>>();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef<TArgs>();\n\n callbackRef.current = callback;\n\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\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\n const debouncedCallback = React.useCallback(\n (...args: TArgs) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n },\n [delay, cancel]\n );\n\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n\n return Object.assign(debouncedCallback, { cancel, flush });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAQzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,QAAkD,EAClDC,KAAa,EACa;EAC1B,MAAMC,UAAU,GAAGJ,KAAK,CAACK,MAAM,CAAgC,CAAC;EAChE,MAAMC,WAAW,GAAGN,KAAK,CAACK,MAAM,CAACH,QAAQ,CAAC;EAC1C,MAAMK,WAAW,GAAGP,KAAK,CAACK,MAAM,CAAQ,CAAC;EAEzCC,WAAW,CAACE,OAAO,GAAGN,QAAQ;EAE9B,MAAMO,MAAM,GAAGT,KAAK,CAACU,WAAW,CAAC,MAAM;IACrC,IAAIN,UAAU,CAACI,OAAO,EAAE;MACtBG,YAAY,CAACP,UAAU,CAACI,OAAO,CAAC;MAChCJ,UAAU,CAACI,OAAO,GAAGI,SAAS;IAChC;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,KAAK,GAAGb,KAAK,CAACU,WAAW,CAAC,MAAM;IACpC,IAAIN,UAAU,CAACI,OAAO,IAAID,WAAW,CAACC,OAAO,EAAE;MAC7CG,YAAY,CAACP,UAAU,CAACI,OAAO,CAAC;MAChCJ,UAAU,CAACI,OAAO,GAAGI,SAAS;MAC9B,KAAKN,WAAW,CAACE,OAAO,CAAC,GAAGD,WAAW,CAACC,OAAO,CAAC;IAClD;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMM,iBAAiB,GAAGd,KAAK,CAACU,WAAW,CACzC,CAAC,GAAGK,IAAW,KAAK;IAClBR,WAAW,CAACC,OAAO,GAAGO,IAAI;IAC1BN,MAAM,CAAC,CAAC;IACRL,UAAU,CAACI,OAAO,GAAGQ,UAAU,CAAC,MAAM;MACpC,KAAKV,WAAW,CAACE,OAAO,CAAC,GAAGO,IAAI,CAAC;IACnC,CAAC,EAAEZ,KAAK,CAAC;EACX,CAAC,EACD,CAACA,KAAK,EAAEM,MAAM,CAChB,CAAC;EAEDT,KAAK,CAACiB,SAAS,CAAC,MAAM;IACpB,OAAO,MAAM;MACXR,MAAM,CAAC,CAAC;IACV,CAAC;EACH,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,OAAOS,MAAM,CAACC,MAAM,CAACL,iBAAiB,EAAE;IAAEL,MAAM;IAAEI;EAAM,CAAC,CAAC;AAC5D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"usePlatformQuery.js","names":["React","devToolsMetadata","makeExternalStore","usePlatformQuery","query","queryName","enabled","observerRef","useRef","handleQuery","useCallback","observer","current","next","status","data","undefined","then","catch","err","error","subscribe","getSnapShot","useMemo","unsubscribe","hookType","objectType","payload","useSyncExternalStore","Error","isLoading","refetch"],"sources":["usePlatformQuery.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 { Observer } from \"@osdk/client/observable\";\nimport React from \"react\";\nimport {\n devToolsMetadata,\n makeExternalStore,\n} from \"../new/makeExternalStore.js\";\n\nexport interface UseQueryOptions<T> {\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n * });\n */\n enabled?: boolean;\n queryName: string;\n query: () => Promise<T>;\n}\n\nexport interface QueryResult<T> {\n data: T | undefined;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => void;\n}\n\ninterface QueryPayload<T> {\n data: T | undefined;\n status: \"loading\" | \"success\" | \"error\";\n}\n\nexport function usePlatformQuery<T>(\n { query, queryName, enabled = true }: UseQueryOptions<T>,\n): QueryResult<T> {\n const observerRef = React.useRef<Observer<QueryPayload<T> | undefined>>();\n\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n\n observer.next({\n status: \"loading\",\n data: undefined,\n });\n\n query()\n .then((data) => {\n observer.next({\n status: \"success\",\n data,\n });\n })\n .catch((err: unknown) => {\n observer.error(err);\n });\n }, [query]);\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<QueryPayload<T>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName,\n }),\n );\n }\n\n return makeExternalStore<QueryPayload<T>>(\n (observer: Observer<QueryPayload<T> | undefined>) => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n },\n };\n },\n devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName,\n }),\n );\n },\n [enabled, queryName, handleQuery],\n );\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n\n return {\n data: payload?.data,\n isLoading: enabled ? (payload?.status === \"loading\" || !payload) : false,\n error,\n refetch: handleQuery,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,gBAAgB,EAChBC,iBAAiB,QACZ,6BAA6B;AAiCpC,OAAO,SAASC,gBAAgBA,CAC9B;EAAEC,KAAK;EAAEC,SAAS;EAAEC,OAAO,GAAG;AAAyB,CAAC,EACxC;EAChB,MAAMC,WAAW,GAAGP,KAAK,CAACQ,MAAM,CAAwC,CAAC;EAEzE,MAAMC,WAAW,GAAGT,KAAK,CAACU,WAAW,CAAC,MAAM;IAC1C,MAAMC,QAAQ,GAAGJ,WAAW,CAACK,OAAO;IACpC,IAAID,QAAQ,IAAI,IAAI,EAAE;IAEtBA,QAAQ,CAACE,IAAI,CAAC;MACZC,MAAM,EAAE,SAAS;MACjBC,IAAI,EAAEC;IACR,CAAC,CAAC;IAEFZ,KAAK,CAAC,CAAC,CACJa,IAAI,CAAEF,IAAI,IAAK;MACdJ,QAAQ,CAACE,IAAI,CAAC;QACZC,MAAM,EAAE,SAAS;QACjBC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC,CACDG,KAAK,CAAEC,GAAY,IAAK;MACvBR,QAAQ,CAACS,KAAK,CAACD,GAAG,CAAC;IACrB,CAAC,CAAC;EACN,CAAC,EAAE,CAACf,KAAK,CAAC,CAAC;EAEX,MAAM;IAAEiB,SAAS;IAAEC;EAAY,CAAC,GAAGtB,KAAK,CAACuB,OAAO,CAC9C,MAAM;IACJ,IAAI,CAACjB,OAAO,EAAE;MACZ,OAAOJ,iBAAiB,CACtB,OAAO;QAAEsB,WAAW,EAAEA,CAAA,KAAM,CAAC;MAAE,CAAC,CAAC,EACjCvB,gBAAgB,CAAC;QACfwB,QAAQ,EAAE,kBAAkB;QAC5BC,UAAU,EAAErB;MACd,CAAC,CACH,CAAC;IACH;IAEA,OAAOH,iBAAiB,CACrBS,QAA+C,IAAK;MACnDJ,WAAW,CAACK,OAAO,GAAGD,QAAQ;MAC9BF,WAAW,CAAC,CAAC;MACb,OAAO;QACLe,WAAW,EAAEA,CAAA,KAAM;UACjBjB,WAAW,CAACK,OAAO,GAAGI,SAAS;QACjC;MACF,CAAC;IACH,CAAC,EACDf,gBAAgB,CAAC;MACfwB,QAAQ,EAAE,kBAAkB;MAC5BC,UAAU,EAAErB;IACd,CAAC,CACH,CAAC;EACH,CAAC,EACD,CAACC,OAAO,EAAED,SAAS,EAAEI,WAAW,CAClC,CAAC;EAED,MAAMkB,OAAO,GAAG3B,KAAK,CAAC4B,oBAAoB,CAACP,SAAS,EAAEC,WAAW,CAAC;EAElE,IAAIF,KAAwB;EAC5B,IAAIO,OAAO,IAAI,OAAO,IAAIA,OAAO,IAAIA,OAAO,CAACP,KAAK,IAAI,IAAI,EAAE;IAC1DA,KAAK,GAAGO,OAAO,CAACP,KAAK;EACvB,CAAC,MAAM,IAAIO,OAAO,EAAEb,MAAM,KAAK,OAAO,EAAE;IACtCM,KAAK,GAAG,IAAIS,KAAK,CAAC,iCAAiCxB,SAAS,EAAE,CAAC;EACjE;EAEA,OAAO;IACLU,IAAI,EAAEY,OAAO,EAAEZ,IAAI;IACnBe,SAAS,EAAExB,OAAO,GAAIqB,OAAO,EAAEb,MAAM,KAAK,SAAS,IAAI,CAACa,OAAO,GAAI,KAAK;IACxEP,KAAK;IACLW,OAAO,EAAEtB;EACX,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"usePlatformQuery.js","names":["React","devToolsMetadata","makeExternalStore","usePlatformQuery","query","queryName","enabled","observerRef","useRef","handleQuery","useCallback","observer","current","next","status","data","undefined","then","catch","err","error","subscribe","getSnapShot","useMemo","unsubscribe","hookType","objectType","payload","useSyncExternalStore","Error","isLoading","refetch"],"sources":["usePlatformQuery.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 { Observer } from \"@osdk/client/observable\";\nimport React from \"react\";\n\nimport {\n devToolsMetadata,\n makeExternalStore,\n} from \"../new/makeExternalStore.js\";\n\nexport interface UseQueryOptions<T> {\n /**\n * Enable or disable the query.\n *\n * When `false`, the query will not automatically execute.\n *\n * This is useful for:\n * - Lazy/on-demand queries that should wait for user interaction\n * - Dependent queries that need data from another query first\n * - Conditional queries based on component state\n *\n * @default true\n * });\n */\n enabled?: boolean;\n queryName: string;\n query: () => Promise<T>;\n}\n\nexport interface QueryResult<T> {\n data: T | undefined;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => void;\n}\n\ninterface QueryPayload<T> {\n data: T | undefined;\n status: \"loading\" | \"success\" | \"error\";\n}\n\nexport function usePlatformQuery<T>({\n query,\n queryName,\n enabled = true,\n}: UseQueryOptions<T>): QueryResult<T> {\n const observerRef = React.useRef<Observer<QueryPayload<T> | undefined>>();\n\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n\n observer.next({\n status: \"loading\",\n data: undefined,\n });\n\n query()\n .then((data) => {\n observer.next({\n status: \"success\",\n data,\n });\n })\n .catch((err: unknown) => {\n observer.error(err);\n });\n }, [query]);\n\n const { subscribe, getSnapShot } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore<QueryPayload<T>>(\n () => ({ unsubscribe: () => {} }),\n devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName,\n })\n );\n }\n\n return makeExternalStore<QueryPayload<T>>(\n (observer: Observer<QueryPayload<T> | undefined>) => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n },\n };\n },\n devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName,\n })\n );\n }, [enabled, queryName, handleQuery]);\n\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACEC,gBAAgB,EAChBC,iBAAiB,QACZ,6BAA6B;AAiCpC,OAAO,SAASC,gBAAgBA,CAAI;EAClCC,KAAK;EACLC,SAAS;EACTC,OAAO,GAAG;AACQ,CAAC,EAAkB;EACrC,MAAMC,WAAW,GAAGP,KAAK,CAACQ,MAAM,CAAwC,CAAC;EAEzE,MAAMC,WAAW,GAAGT,KAAK,CAACU,WAAW,CAAC,MAAM;IAC1C,MAAMC,QAAQ,GAAGJ,WAAW,CAACK,OAAO;IACpC,IAAID,QAAQ,IAAI,IAAI,EAAE;IAEtBA,QAAQ,CAACE,IAAI,CAAC;MACZC,MAAM,EAAE,SAAS;MACjBC,IAAI,EAAEC;IACR,CAAC,CAAC;IAEFZ,KAAK,CAAC,CAAC,CACJa,IAAI,CAAEF,IAAI,IAAK;MACdJ,QAAQ,CAACE,IAAI,CAAC;QACZC,MAAM,EAAE,SAAS;QACjBC;MACF,CAAC,CAAC;IACJ,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,OAAO,EAAEZ,IAAI;IACnBe,SAAS,EAAExB,OAAO,GAAGqB,OAAO,EAAEb,MAAM,KAAK,SAAS,IAAI,CAACa,OAAO,GAAG,KAAK;IACtEP,KAAK;IACLW,OAAO,EAAEtB;EACX,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,iBAAiB,gBAAiB;AAEhD,YAAY,aAAa,UAAU,cAAc,cAAc;AAE/D,iBAAiB,UAAU;CACzB,UAAU,cAAc;CACxB,QAAQ;CACR,OAAO;AACR;AAED,iBAAiB,UAAU;CACzB,mBAAmB;;CAEnB,YAAYA;;CAEZ,WACEC,MAAM,cAAcC,MAAM,cAAc;;;;;;;CAQ1C,oBACED,MAAM,cAAcC,MAAM,cAAc;AAE3C;AAED,iBAAiB,uBAAuB;CACtC,kBAAkB,cAAc;;CAEhC;AACD;;;;;AAMD,OAAO,iBAAS,gBAAgBC,SAAS,yBAAyB","names":["notify: () => void","next: ChatState | ((prev: ChatState) => ChatState)","prev: ChatState","options: CreateChatStoreOptions"],"sources":["../../../src/aip/chatStore.ts"],"version":3,"file":"chatStore.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,iBAAiB,gBAAiB;AAEhD,YAAY,aAAa,UAAU,cAAc,cAAc;AAE/D,iBAAiB,UAAU;CACzB,UAAU,cAAc;CACxB,QAAQ;CACR,OAAO;AACR;AAED,iBAAiB,UAAU;CACzB,mBAAmB;;CAEnB,YAAYA;;CAEZ,WAAWC,MAAM,cAAcC,MAAM,cAAc;;;;;;;CAOnD,oBACED,MAAM,cAAcC,MAAM,cAAc;AAE3C;AAED,iBAAiB,uBAAuB;CACtC,kBAAkB,cAAc;;CAEhC;AACD;;;;;AAMD,OAAO,iBAAS,gBAAgBC,SAAS,yBAAyB","names":["notify: () => void","next: ChatState | ((prev: ChatState) => ChatState)","prev: ChatState","options: CreateChatStoreOptions"],"sources":["../../../src/aip/chatStore.ts"],"version":3,"file":"chatStore.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACO,oBAEA,gBACA,sBACA,gBAAiB;AACxB,YAAY,WAAW,OAAQ;AAC/B,cAAc,iBAAiB,gBAAiB;;;;;;AAOhD,iBAAiB,cAAc;CAC7B,OAAO;CACP,UAAU,MAAM,iBAAiB;CACjC,YAAY,MAAM;CAClB,YACMA,OAAO;EACT,SAAS;EACT,UAAU,cAAc;CACzB;CAEH,WAAWC,OAAO;AACnB;AAED,OAAO,iBAAe,cACpBC,KAAK,eACLC,WAAW,cAAc,YACzBC,gBACAC,MAAM,cAAc,YACpBC,SAAS,mBAAmB,uBAC3B;AAqBH,OAAO,iBAAe,YACpBJ,KAAK,eACLK,QAAQ,eAAe,iBACvBC,4BACAC,cAAc,kBACb","names":["event: {\n message: UIMessage;\n messages: ReadonlyArray<UIMessage>;\n }","error: Error","ctx: StreamContext","transport: ChatTransport<UIMessage>","chatId: string","seed: ReadonlyArray<UIMessage>","trigger: \"submit-message\" | \"regenerate-message\"","stream: ReadableStream<UIMessageChunk>","assistantMessageId: string","capturedCtrl: AbortController"],"sources":["../../../src/aip/chatStream.ts"],"version":3,"file":"chatStream.d.ts"}
1
+ {"mappings":"AAgBA,cACO,oBAEA,gBACA,sBACA,gBAAiB;AACxB,YAAY,WAAW,OAAQ;AAE/B,cAAc,iBAAiB,gBAAiB;;;;;;AAOhD,iBAAiB,cAAc;CAC7B,OAAO;CACP,UAAU,MAAM,iBAAiB;CACjC,YAAY,MAAM;CAClB,YACMA,OAAO;EACP,SAAS;EACT,UAAU,cAAc;CACzB;CAEL,WAAWC,OAAO;AACnB;AAED,OAAO,iBAAe,cACpBC,KAAK,eACLC,WAAW,cAAc,YACzBC,gBACAC,MAAM,cAAc,YACpBC,SAAS,mBAAmB,uBAC3B;AAqBH,OAAO,iBAAe,YACpBJ,KAAK,eACLK,QAAQ,eAAe,iBACvBC,4BACAC,cAAc,kBACb","names":["event: {\n message: UIMessage;\n messages: ReadonlyArray<UIMessage>;\n }","error: Error","ctx: StreamContext","transport: ChatTransport<UIMessage>","chatId: string","seed: ReadonlyArray<UIMessage>","trigger: \"submit-message\" | \"regenerate-message\"","stream: ReadableStream<UIMessageChunk>","assistantMessageId: string","capturedCtrl: AbortController"],"sources":["../../../src/aip/chatStream.ts"],"version":3,"file":"chatStream.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACO,oBAEA,oBAGA,iBACA,gBAAiB;AAExB,cACO,kBAGA,gBAAiB;AAOxB,cAAc,kBAAkB;;;;;;;AAQhC,iBAAiB,eAAe;;CAE9B,QAAQ;;CAGR;;CAGA;CACA;CACA;CACA;CACA;CACA,gBAAgB;CAChB;CACA,UAAU;;CAGV;;CAGA,WAAW,cAAc;;CAGzB,YAAY,cAAc;;;;;CAM1B;;CAGA,WAAWA,OAAO;;CAGlB,YAAYC,OAAO;EACjB,SAAS;EACT,UAAU,cAAc;CACzB;AACF;;AAGD,iBAAiB,cAAc;CAC7B;CACA,UAAU,cAAc;;CAExB,cACEC,UACI,cAAc,eACZC,MAAM,cAAc,eAAe,cAAc;CAGzD,QAAQ;CACR,OAAO;CAEP,cAAcC,SAAS,qBAAqB;CAC5C,aAAaC,UAAU;EAAE;CAAoB,MAAK;CAClD;;CAEA,oBAAoB;CACpB;AACD;;AAGD,YAAY,mBACR;CAAE;AAAc,IAChB;CAAE,MAAM;CAAQ,OAAO,UAAU;AAAU;;;;;;;;;;;;;AAc/C,OAAO,iBAAS,QAAQC,SAAS,iBAAiB","names":["error: Error","event: {\n message: UIMessage;\n messages: ReadonlyArray<UIMessage>;\n }","messages:\n | ReadonlyArray<UIMessage>\n | ((prev: ReadonlyArray<UIMessage>) => ReadonlyArray<UIMessage>)","prev: ReadonlyArray<UIMessage>","message: SendMessageInput","options?: { messageId?: string }","options: UseChatOptions"],"sources":["../../../src/aip/useChat.ts"],"version":3,"file":"useChat.d.ts"}
1
+ {"mappings":"AAgBA,cACO,oBAEA,oBAGA,iBACA,gBAAiB;AAGxB,cACO,kBAGA,gBAAiB;AAOxB,cAAc,kBAAkB;;;;;;;AAQhC,iBAAiB,eAAe;;CAE9B,QAAQ;;CAGR;;CAGA;CACA;CACA;CACA;CACA;CACA,gBAAgB;CAChB;CACA,UAAU;;CAGV;;CAGA,WAAW,cAAc;;CAGzB,YAAY,cAAc;;;;;CAM1B;;CAGA,WAAWA,OAAO;;CAGlB,YAAYC,OAAO;EACjB,SAAS;EACT,UAAU,cAAc;CACzB;AACF;;AAGD,iBAAiB,cAAc;CAC7B;CACA,UAAU,cAAc;;CAExB,cACEC,UACI,cAAc,eACZC,MAAM,cAAc,eAAe,cAAc;CAGzD,QAAQ;CACR,OAAO;CAEP,cAAcC,SAAS,qBAAqB;CAC5C,aAAaC,UAAU;EAAE;CAAoB,MAAK;CAClD;;CAEA,oBAAoB;CACpB;AACD;;AAGD,YAAY,mBACR;CAAE;AAAc,IAChB;CAAE,MAAM;CAAQ,OAAO,UAAU;AAAU;;;;;;;;;;;;;AAc/C,OAAO,iBAAS,QAAQC,SAAS,iBAAiB","names":["error: Error","event: {\n message: UIMessage;\n messages: ReadonlyArray<UIMessage>;\n }","messages:\n | ReadonlyArray<UIMessage>\n | ((prev: ReadonlyArray<UIMessage>) => ReadonlyArray<UIMessage>)","prev: ReadonlyArray<UIMessage>","message: SendMessageInput","options?: { messageId?: string }","options: UseChatOptions"],"sources":["../../../src/aip/useChat.ts"],"version":3,"file":"useChat.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAAc,+BAA+B,yBAA0B;AAEvE,OAAO,WAA6C,OAAQ;UAWlD,oBAAoB;CAC5B,UAAU,MAAM;CAChB,QAAQ;CACR;;;;;;;;;CASA,UAAU,wBAAwB;AACnC;AAED,OAAO,iBAAS,aAAa,EAC3B,UACA,QACA,gBACA,SACoB,EAAnB,sBAAsB,MAAM,IAAI","names":[],"sources":["../../../src/new/OsdkProvider.tsx"],"version":3,"file":"OsdkProvider.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,cAAc,cAAe;AAC3C,cAAc,+BAA+B,yBAA0B;AAEvE,OAAO,WAA6C,OAAQ;UAYlD,oBAAoB;CAC5B,UAAU,MAAM;CAChB,QAAQ;CACR;;;;;;;;;CASA,UAAU,wBAAwB;AACnC;AAED,OAAO,iBAAS,aAAa,EAC3B,UACA,QACA,gBACA,SACoB,EAAnB,sBAAsB,MAAM,IAAI","names":[],"sources":["../../../src/new/OsdkProvider.tsx"],"version":3,"file":"OsdkProvider.d.ts"}
@@ -1 +1 @@
1
- {"mappings":";;;;;AAuBA,OAAO,iBAAS,gBAAgBA;;;;;;;AAUhC,OAAO,iBAAS,wBACdC,cACAD","names":["value: unknown","_key: string"],"sources":["../../../../src/new/core/stableSerialize.ts"],"version":3,"file":"stableSerialize.d.ts"}
1
+ {"mappings":";;;;;AAuBA,OAAO,iBAAS,gBAAgBA;;;;;;;AAUhC,OAAO,iBAAS,wBAAwBC,cAAcD","names":["value: unknown","_key: string"],"sources":["../../../../src/new/core/stableSerialize.ts"],"version":3,"file":"stableSerialize.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,6BACA,WACA,yBACK,WAAY;;;;;;;AAUnB,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB;EAEjDA,WAAW,UAAU,GAAG,oBACvB,UAAU,GAAG","names":["objectSet: ObjectSet<Q, RDPs> | undefined"],"sources":["../../../../src/new/core/useStableObjectSet.ts"],"version":3,"file":"useStableObjectSet.d.ts"}
1
+ {"mappings":"AAgBA,cACE,6BACA,WACA,yBACK,WAAY;;;;;;;AAWnB,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB;EACjDA,WAAW,UAAU,GAAG,oBAAoB,UAAU,GAAG","names":["objectSet: ObjectSet<Q, RDPs> | undefined"],"sources":["../../../../src/new/core/useStableObjectSet.ts"],"version":3,"file":"useStableObjectSet.d.ts"}
@@ -16,7 +16,7 @@ export declare function createCompositeExternalStore(queries: Array<FunctionQuer
16
16
  getSnapshot: () => Array<Snapshot<FunctionPayload>>
17
17
  };
18
18
  export declare const EMPTY_STORE: {
19
- readonly subscribe: () => () => void
19
+ readonly subscribe: () => (() => void)
20
20
  readonly getSnapshot: () => Snapshot<FunctionPayload>[]
21
21
  };
22
22
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,uBAAuB,WAAY;AACjD,cACE,kBACA,mCACK,yBAA0B;AACjC,cAAc,gBAAgB,wBAAyB;AACvD,cAAc,2BAA2B,uBAAwB;KAE5D,kBAAkB,4BAA4B;;;;;;;;;AAUnD,OAAO,iBAAS,6BACdA,SAAS,MAAM,oBAAoB,4BACnCC,kBAAkB,kBAClBC,oCACC;CACD,YAAYC;CACZ,mBAAmB,MAAM,SAAS;AACnC;AAwGD,OAAO,cAAM;UACX;UACA,mBAAiB,SAAS","names":["queries: Array<FunctionQueryParams<QueryDefinition<unknown>>>","observableClient: ObservableClient","maxConcurrent: number | undefined","notifyUpdate: () => void"],"sources":["../../../src/new/createCompositeExternalStore.ts"],"version":3,"file":"createCompositeExternalStore.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,uBAAuB,WAAY;AACjD,cACE,kBACA,mCACK,yBAA0B;AAEjC,cAAc,gBAAgB,wBAAyB;AACvD,cAAc,2BAA2B,uBAAwB;KAE5D,kBAAkB,4BAA4B;;;;;;;;;AAUnD,OAAO,iBAAS,6BACdA,SAAS,MAAM,oBAAoB,4BACnCC,kBAAkB,kBAClBC,oCACC;CACD,YAAYC;CACZ,mBAAmB,MAAM,SAAS;AACnC;AAiGD,OAAO,cAAM;UACX;UACA,mBAAiB,SAAS","names":["queries: Array<FunctionQueryParams<QueryDefinition<unknown>>>","observableClient: ObservableClient","maxConcurrent: number | undefined","notifyUpdate: () => void"],"sources":["../../../src/new/createCompositeExternalStore.ts"],"version":3,"file":"createCompositeExternalStore.d.ts"}
@@ -14,9 +14,9 @@ export interface OsdkStoreMetadata {
14
14
  }
15
15
  export declare const devToolsMetadata: (meta: OsdkStoreMetadata) => OsdkStoreMetadata | undefined;
16
16
  export declare function useDevToolsMetadata(devtoolsEnabled: boolean, hookType: string, key: string): void;
17
- export type Snapshot<X> = X & {
17
+ export type Snapshot<X> = (X & {
18
18
  error?: Error
19
- } | (Partial<X> & {
19
+ }) | (Partial<X> & {
20
20
  error?: Error
21
21
  }) | undefined;
22
22
  export declare function makeExternalStore<X>(createObservation: (callback: Observer<X | undefined>) => Unsubscribable, _metadata?: OsdkStoreMetadata, initialValue?: Snapshot<X>): {
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,UAAU,sBAAsB,yBAA0B;AAOxE,OAAO,cAAMA;AAIb,iBAAiB,kBAAkB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,OAAO,cAAMC,mBACXC,MAAM,sBACH;AAIL,OAAO,iBAAS,oBACdC,0BACAC,kBACAC;AAcF,YAAY,SAAS,KACjB,IAAI;CAAE,QAAQ;AAAO,KACpB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCC,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,YAAY,mBACZC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B;;;;;;;;AA6CD,OAAO,iBAAS,uBAAuB,GACrCC,oBACEJ,UAAU,SAAS,mBAChB,QAAQ,iBACbC,YAAY,mBACZC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["OSDK_HOOK_METADATA: symbol","devToolsMetadata: (\n meta: OsdkStoreMetadata,\n) => OsdkStoreMetadata | undefined","meta: OsdkStoreMetadata","devtoolsEnabled: boolean","hookType: string","key: string","createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_metadata?: OsdkStoreMetadata","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"}
1
+ {"mappings":"AAgBA,cAAc,UAAU,sBAAsB,yBAA0B;AAOxE,OAAO,cAAMA;AAEb,iBAAiB,kBAAkB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAED,OAAO,cAAMC,mBACXC,MAAM,sBACH;AAIL,OAAO,iBAAS,oBACdC,0BACAC,kBACAC;AAgBF,YAAY,SAAS,MAChB,IAAI;CAAE,QAAQ;AAAO,MACrB,QAAQ,KAAK;CAAE,QAAQ;AAAO;AAGnC,OAAO,iBAAS,kBAAkB,GAChCC,oBAAoBC,UAAU,SAAS,mBAAmB,gBAC1DC,YAAY,mBACZC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B;;;;;;;;AA6CD,OAAO,iBAAS,uBAAuB,GACrCC,oBACEJ,UAAU,SAAS,mBAChB,QAAQ,iBACbC,YAAY,mBACZC,eAAe,SAAS,KACvB;CACD,YAAYC;CACZ,mBAAmB,SAAS;AAC7B","names":["OSDK_HOOK_METADATA: symbol","devToolsMetadata: (\n meta: OsdkStoreMetadata\n) => OsdkStoreMetadata | undefined","meta: OsdkStoreMetadata","devtoolsEnabled: boolean","hookType: string","key: string","createObservation: (callback: Observer<X | undefined>) => Unsubscribable","callback: Observer<X | undefined>","_metadata?: OsdkStoreMetadata","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"}
@@ -1 +1 @@
1
- {"mappings":"AAqBA,iBAAiB,eAAe;CAC9B;CACA;CACA;CACA;AACD;AAED,iBAAiB,qBAAqB;CACpC;;;;;;;;;;;;;CAaA;AACD;AAED,iBAAiB,oBAAoB;CACnC,QAAQ;CACR;CAEA,OAAO;CAEP;AACD;;;;;AAMD,OAAO,iBAAS,cACd,EAAE,YAAY,SAAS,iBAA8C,EAApB,uBAChD","names":[],"sources":["../../../../../src/new/platform-apis/admin/useCbacBanner.ts"],"version":3,"file":"useCbacBanner.d.ts"}
1
+ {"mappings":"AAsBA,iBAAiB,eAAe;CAC9B;CACA;CACA;CACA;AACD;AAED,iBAAiB,qBAAqB;CACpC;;;;;;;;;;;;;CAaA;AACD;AAED,iBAAiB,oBAAoB;CACnC,QAAQ;CACR;CAEA,OAAO;CAEP;AACD;;;;;AAMD,OAAO,iBAAS,cAAc,EAC5B,YACA,SAAS,iBACY,EAApB,uBAAuB","names":[],"sources":["../../../../../src/new/platform-apis/admin/useCbacBanner.ts"],"version":3,"file":"useCbacBanner.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAqBA,iBAAiB,4BAA4B;CAC3C;CACA;CACA;CACA;CACA;AACD;AAED,iBAAiB,kCAAkC;CACjD;;;;;;;;;;;;;CAaA;AACD;AAED,iBAAiB,iCAAiC;CAChD,cAAc;CACd;CAEA,OAAO;CAEP;AACD;;;;;AAMD,OAAO,iBAAS,2BACd,EAAE,YAAY,SAAS,iBACY,EAAjC,oCACD","names":[],"sources":["../../../../../src/new/platform-apis/admin/useCbacMarkingRestrictions.ts"],"version":3,"file":"useCbacMarkingRestrictions.d.ts"}
1
+ {"mappings":"AAsBA,iBAAiB,4BAA4B;CAC3C;CACA;CACA;CACA;CACA;AACD;AAED,iBAAiB,kCAAkC;CACjD;;;;;;;;;;;;;CAaA;AACD;AAED,iBAAiB,iCAAiC;CAChD,cAAc;CACd;CAEA,OAAO;CAEP;AACD;;;;;AAMD,OAAO,iBAAS,2BAA2B,EACzC,YACA,SAAS,iBACyB,EAAjC,oCAAoC","names":[],"sources":["../../../../../src/new/platform-apis/admin/useCbacMarkingRestrictions.ts"],"version":3,"file":"useCbacMarkingRestrictions.d.ts"}