@osdk/react 0.8.0-beta.1 → 0.8.0-beta.3

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 (71) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js +35 -0
  3. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +1 -0
  4. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +34 -0
  5. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +1 -0
  6. package/build/browser/intellisense.test.js +148 -0
  7. package/build/browser/intellisense.test.js.map +1 -0
  8. package/build/browser/new/types.js +2 -0
  9. package/build/browser/new/types.js.map +1 -0
  10. package/build/browser/new/useLinks.js +14 -5
  11. package/build/browser/new/useLinks.js.map +1 -1
  12. package/build/browser/new/useObjectSet.js +31 -19
  13. package/build/browser/new/useObjectSet.js.map +1 -1
  14. package/build/browser/new/useOsdkAggregation.js +83 -0
  15. package/build/browser/new/useOsdkAggregation.js.map +1 -0
  16. package/build/browser/new/useOsdkObject.js +23 -6
  17. package/build/browser/new/useOsdkObject.js.map +1 -1
  18. package/build/browser/new/useOsdkObjects.js +38 -15
  19. package/build/browser/new/useOsdkObjects.js.map +1 -1
  20. package/build/browser/public/experimental.js +2 -0
  21. package/build/browser/public/experimental.js.map +1 -1
  22. package/build/browser/utils/useDebouncedCallback.js +81 -0
  23. package/build/browser/utils/useDebouncedCallback.js.map +1 -0
  24. package/build/cjs/public/experimental.cjs +177 -44
  25. package/build/cjs/public/experimental.cjs.map +1 -1
  26. package/build/cjs/public/experimental.d.cts +225 -19
  27. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js +35 -0
  28. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +1 -0
  29. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js +34 -0
  30. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +1 -0
  31. package/build/esm/intellisense.test.js +148 -0
  32. package/build/esm/intellisense.test.js.map +1 -0
  33. package/build/esm/new/types.js +2 -0
  34. package/build/esm/new/types.js.map +1 -0
  35. package/build/esm/new/useLinks.js +14 -5
  36. package/build/esm/new/useLinks.js.map +1 -1
  37. package/build/esm/new/useObjectSet.js +31 -19
  38. package/build/esm/new/useObjectSet.js.map +1 -1
  39. package/build/esm/new/useOsdkAggregation.js +83 -0
  40. package/build/esm/new/useOsdkAggregation.js.map +1 -0
  41. package/build/esm/new/useOsdkObject.js +23 -6
  42. package/build/esm/new/useOsdkObject.js.map +1 -1
  43. package/build/esm/new/useOsdkObjects.js +38 -15
  44. package/build/esm/new/useOsdkObjects.js.map +1 -1
  45. package/build/esm/public/experimental.js +2 -0
  46. package/build/esm/public/experimental.js.map +1 -1
  47. package/build/esm/utils/useDebouncedCallback.js +81 -0
  48. package/build/esm/utils/useDebouncedCallback.js.map +1 -0
  49. package/build/types/intellisense.test.d.ts +1 -0
  50. package/build/types/intellisense.test.d.ts.map +1 -0
  51. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +1 -0
  52. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +1 -0
  53. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +1 -0
  54. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +1 -0
  55. package/build/types/new/types.d.ts +5 -0
  56. package/build/types/new/types.d.ts.map +1 -0
  57. package/build/types/new/useLinks.d.ts +20 -0
  58. package/build/types/new/useLinks.d.ts.map +1 -1
  59. package/build/types/new/useObjectSet.d.ts +38 -4
  60. package/build/types/new/useObjectSet.d.ts.map +1 -1
  61. package/build/types/new/useOsdkAggregation.d.ts +67 -0
  62. package/build/types/new/useOsdkAggregation.d.ts.map +1 -0
  63. package/build/types/new/useOsdkObject.d.ts +4 -2
  64. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  65. package/build/types/new/useOsdkObjects.d.ts +77 -11
  66. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  67. package/build/types/public/experimental.d.ts +3 -0
  68. package/build/types/public/experimental.d.ts.map +1 -1
  69. package/build/types/utils/useDebouncedCallback.d.ts +34 -0
  70. package/build/types/utils/useDebouncedCallback.d.ts.map +1 -0
  71. package/package.json +10 -4
@@ -17,13 +17,19 @@
17
17
  import React from "react";
18
18
  import { makeExternalStore } from "./makeExternalStore.js";
19
19
  import { OsdkContext2 } from "./OsdkContext2.js";
20
- export function useOsdkObjects(type, {
21
- pageSize,
22
- orderBy,
23
- dedupeIntervalMs,
24
- where = {},
25
- streamUpdates
26
- } = {}) {
20
+ export function useOsdkObjects(type, options) {
21
+ const {
22
+ pageSize,
23
+ orderBy,
24
+ dedupeIntervalMs,
25
+ where = {},
26
+ streamUpdates,
27
+ withProperties,
28
+ autoFetchMore,
29
+ intersectWith,
30
+ pivotTo,
31
+ enabled = true
32
+ } = options ?? {};
27
33
  const {
28
34
  observableClient
29
35
  } = React.useContext(OsdkContext2);
@@ -33,17 +39,34 @@ export function useOsdkObjects(type, {
33
39
  the ObservableClient anyway.
34
40
  */
35
41
  const canonWhere = observableClient.canonicalizeWhereClause(where ?? {});
42
+ const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);
43
+ const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);
36
44
  const {
37
45
  subscribe,
38
46
  getSnapShot
39
- } = React.useMemo(() => makeExternalStore(observer => observableClient.observeList({
40
- type,
41
- where: canonWhere,
42
- dedupeInterval: dedupeIntervalMs ?? 2_000,
43
- pageSize,
44
- orderBy,
45
- streamUpdates
46
- }, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${JSON.stringify(canonWhere)}` : void 0), [observableClient, type, canonWhere, dedupeIntervalMs]);
47
+ } = React.useMemo(() => {
48
+ if (!enabled) {
49
+ return makeExternalStore(() => ({
50
+ unsubscribe: () => {}
51
+ }), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${JSON.stringify(canonWhere)} [DISABLED]` : void 0);
52
+ }
53
+ return makeExternalStore(observer => observableClient.observeList({
54
+ type,
55
+ where: canonWhere,
56
+ dedupeInterval: dedupeIntervalMs ?? 2_000,
57
+ pageSize,
58
+ orderBy,
59
+ streamUpdates,
60
+ withProperties: stableWithProperties,
61
+ autoFetchMore,
62
+ ...(stableIntersectWith ? {
63
+ intersectWith: stableIntersectWith
64
+ } : {}),
65
+ ...(pivotTo ? {
66
+ pivotTo
67
+ } : {})
68
+ }, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${JSON.stringify(canonWhere)}` : void 0);
69
+ }, [enabled, observableClient, type, canonWhere, dedupeIntervalMs, pageSize, orderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo]);
47
70
  const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);
48
71
  let error;
49
72
  if (listPayload && "error" in listPayload && listPayload.error) {
@@ -1 +1 @@
1
- {"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObjects","type","pageSize","orderBy","dedupeIntervalMs","where","streamUpdates","observableClient","useContext","canonWhere","canonicalizeWhereClause","subscribe","getSnapShot","useMemo","observer","observeList","dedupeInterval","process","env","NODE_ENV","apiName","JSON","stringify","listPayload","useSyncExternalStore","error","status","Error","fetchMore","data","resolvedList","isLoading","isOptimistic"],"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 InterfaceDefinition,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n WhereClause,\n} from \"@osdk/client\";\nimport type { ObserveObjectsArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectTypeDefinition | InterfaceDefinition,\n> {\n /**\n * Standard OSDK Where\n */\n where?: WhereClause<T>;\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /** */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\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 // autoFetchMore?: boolean | number;\n\n /**\n * Upon a list being revalidated, this option determines how the component\n * will be re-rendered with the data.\n *\n * An example to help understand the options:\n *\n * Suppose pageSize is 10 and we have called `fetchMore()` twice. The list is\n * now 30 items long.\n *\n * Upon revalidation, we get the first 10 items of the list. The options behave\n * as follows:\n *\n * - `\"in-place\"`: The first 10 items of the list are replaced with the new 10\n * items. The list is now 30 items long, but only the first 10 items are valid.\n * - `\"wait\"`: The old list is returned until after the next 20 items are loaded\n * (which will happen automatically). The list is now 30 items long.\n * - `\"reset\"`: The entire list is replaced with the new 10 items. The list is\n * now 10 items long.\n */\n // invalidationMode?: \"in-place\" | \"wait\" | \"reset\";\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the where clause will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n /**\n * If provided, the list will be considered this length for the purposes of\n * `invalidationMode` when using the `wait` option. If not provided,\n * the internal expectedLength will be determined by the number of times\n * `fetchMore` has been called.\n */\n // expectedLength?: number | undefined;\n\n streamUpdates?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectTypeDefinition | InterfaceDefinition,\n> {\n fetchMore: (() => Promise<unknown>) | undefined;\n data: Osdk.Instance<T>[] | undefined;\n isLoading: boolean;\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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectTypeDefinition | InterfaceDefinition,\n>(\n type: Q,\n {\n pageSize,\n orderBy,\n dedupeIntervalMs,\n where = {},\n streamUpdates,\n }: UseOsdkObjectsOptions<Q> = {},\n): UseOsdkListResult<Q> {\n const { observableClient } = React.useContext(OsdkContext2);\n\n /* We want the canonical where clause so that the use of `React.useMemo`\n is stable. No real added cost as we canonicalize internal to\n the ObservableClient anyway.\n */\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? {});\n\n const { subscribe, getSnapShot } = React.useMemo(\n () =>\n makeExternalStore<ObserveObjectsArgs<Q>>(\n (observer) =>\n observableClient.observeList({\n type,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy,\n streamUpdates,\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${JSON.stringify(canonWhere)}`\n : void 0,\n ),\n [observableClient, type, canonWhere, dedupeIntervalMs],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.fetchMore,\n error,\n data: listPayload?.resolvedList as Osdk.Instance<Q>[],\n isLoading: listPayload?.status === \"loading\",\n isOptimistic: listPayload?.isOptimistic ?? false,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AA2FhD,OAAO,SAASC,cAAcA,CAG5BC,IAAO,EACP;EACEC,QAAQ;EACRC,OAAO;EACPC,gBAAgB;EAChBC,KAAK,GAAG,CAAC,CAAC;EACVC;AACwB,CAAC,GAAG,CAAC,CAAC,EACV;EACtB,MAAM;IAAEC;EAAiB,CAAC,GAAGV,KAAK,CAACW,UAAU,CAACT,YAAY,CAAC;;EAE3D;AACF;AACA;AACA;EACE,MAAMU,UAAU,GAAGF,gBAAgB,CAACG,uBAAuB,CAACL,KAAK,IAAI,CAAC,CAAC,CAAC;EAExE,MAAM;IAAEM,SAAS;IAAEC;EAAY,CAAC,GAAGf,KAAK,CAACgB,OAAO,CAC9C,MACEf,iBAAiB,CACdgB,QAAQ,IACPP,gBAAgB,CAACQ,WAAW,CAAC;IAC3Bd,IAAI;IACJI,KAAK,EAAEI,UAAU;IACjBO,cAAc,EAAEZ,gBAAgB,IAAI,KAAK;IACzCF,QAAQ;IACRC,OAAO;IACPG;EACF,CAAC,EAAEQ,QAAQ,CAAC,EACdG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQlB,IAAI,CAACmB,OAAO,IAAIC,IAAI,CAACC,SAAS,CAACb,UAAU,CAAC,EAAE,GACpD,KAAK,CACX,CAAC,EACH,CAACF,gBAAgB,EAAEN,IAAI,EAAEQ,UAAU,EAAEL,gBAAgB,CACvD,CAAC;EAED,MAAMmB,WAAW,GAAG1B,KAAK,CAAC2B,oBAAoB,CAACb,SAAS,EAAEC,WAAW,CAAC;EAEtE,IAAIa,KAAwB;EAC5B,IAAIF,WAAW,IAAI,OAAO,IAAIA,WAAW,IAAIA,WAAW,CAACE,KAAK,EAAE;IAC9DA,KAAK,GAAGF,WAAW,CAACE,KAAK;EAC3B,CAAC,MAAM,IAAIF,WAAW,EAAEG,MAAM,KAAK,OAAO,EAAE;IAC1CD,KAAK,GAAG,IAAIE,KAAK,CAAC,wBAAwB,CAAC;EAC7C;EAEA,OAAO;IACLC,SAAS,EAAEL,WAAW,EAAEK,SAAS;IACjCH,KAAK;IACLI,IAAI,EAAEN,WAAW,EAAEO,YAAkC;IACrDC,SAAS,EAAER,WAAW,EAAEG,MAAM,KAAK,SAAS;IAC5CM,YAAY,EAAET,WAAW,EAAES,YAAY,IAAI;EAC7C,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"useOsdkObjects.js","names":["React","makeExternalStore","OsdkContext2","useOsdkObjects","type","options","pageSize","orderBy","dedupeIntervalMs","where","streamUpdates","withProperties","autoFetchMore","intersectWith","pivotTo","enabled","observableClient","useContext","canonWhere","canonicalizeWhereClause","stableWithProperties","useMemo","JSON","stringify","stableIntersectWith","subscribe","getSnapShot","unsubscribe","process","env","NODE_ENV","apiName","observer","observeList","dedupeInterval","listPayload","useSyncExternalStore","error","status","Error","fetchMore","data","resolvedList","isLoading","isOptimistic"],"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 InterfaceDefinition,\n LinkedType,\n LinkNames,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n WhereClause,\n} from \"@osdk/api\";\nimport type { ObserveObjectsArgs } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nimport type { InferRdpTypes } from \"./types.js\";\n\nexport interface UseOsdkObjectsOptions<\n T extends ObjectTypeDefinition | InterfaceDefinition,\n WithProps extends DerivedProperty.Clause<T> | undefined = undefined,\n> {\n /**\n * Standard OSDK Where with RDP support\n */\n where?: WhereClause<T, InferRdpTypes<T, WithProps>>;\n\n /**\n * The preferred page size for the list.\n */\n pageSize?: number;\n\n /** */\n orderBy?: {\n [K in PropertyKeys<T>]?: \"asc\" | \"desc\";\n };\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?: WithProps;\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, InferRdpTypes<T, WithProps>>;\n }>;\n\n /**\n * Pivot to related objects through a link.\n * This changes the return type from T to the linked object type.\n */\n pivotTo?: LinkNames<T>;\n\n /**\n * Causes the list to automatically fetch more as soon as the previous page\n * has been loaded. If a number is provided, it will continue to automatically\n * fetch more until the list is at least that long.\n *\n * - `true`: Fetch all available pages automatically\n * - `number`: Fetch pages until at least this many items are loaded\n * - `undefined` (default): Only fetch the first page, user must call fetchMore()\n *\n * Note: When using `autoFetchMore: true` with large datasets, the initial\n * load may take significant time. Consider using a specific number instead\n * or implementing virtual scrolling.\n *\n * @example\n * // Fetch all todos at once\n * const { data } = useOsdkObjects(Todo, { autoFetchMore: true })\n *\n * @example\n * // Fetch at least 100 todos (with 25 per page, fetches 4 pages)\n * const { data } = useOsdkObjects(Todo, {\n * autoFetchMore: 100,\n * pageSize: 25\n * })\n */\n autoFetchMore?: boolean | number;\n\n /**\n * Upon a list being revalidated, this option determines how the component\n * will be re-rendered with the data.\n *\n * An example to help understand the options:\n *\n * Suppose pageSize is 10 and we have called `fetchMore()` twice. The list is\n * now 30 items long.\n *\n * Upon revalidation, we get the first 10 items of the list. The options behave\n * as follows:\n *\n * - `\"in-place\"`: The first 10 items of the list are replaced with the new 10\n * items. The list is now 30 items long, but only the first 10 items are valid.\n * - `\"wait\"`: The old list is returned until after the next 20 items are loaded\n * (which will happen automatically). The list is now 30 items long.\n * - `\"reset\"`: The entire list is replaced with the new 10 items. The list is\n * now 10 items long.\n */\n // invalidationMode?: \"in-place\" | \"wait\" | \"reset\";\n\n /**\n * The number of milliseconds to wait after the last observed list change.\n *\n * Two uses of `useOsdkObjects` with the where clause will only trigger one\n * network request if the second is within `dedupeIntervalMs`.\n */\n dedupeIntervalMs?: number;\n\n streamUpdates?: boolean;\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 * 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 * @example\n * // Dependent query - wait for parent data\n * const { data: employee } = useOsdkObject(Employee, employeeId);\n * const { data: reports } = useOsdkObjects(Employee, {\n * where: { managerId: employee?.id },\n * enabled: !!employee\n * });\n */\n enabled?: boolean;\n}\n\nexport interface UseOsdkListResult<\n T extends ObjectTypeDefinition | InterfaceDefinition,\n> {\n fetchMore: (() => Promise<void>) | undefined;\n data: Osdk.Instance<T>[] | undefined;\n isLoading: boolean;\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\ndeclare const process: {\n env: {\n NODE_ENV: \"development\" | \"production\";\n };\n};\n\nexport function useOsdkObjects<\n Q extends ObjectTypeDefinition,\n L extends LinkNames<Q>,\n>(\n type: Q,\n options: UseOsdkObjectsOptions<Q> & { pivotTo: L },\n): UseOsdkListResult<LinkedType<Q, L>>;\n\nexport function useOsdkObjects<\n Q extends ObjectTypeDefinition | InterfaceDefinition,\n WP extends DerivedProperty.Clause<Q> | undefined,\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, WP>,\n): UseOsdkListResult<Q>;\n\nexport function useOsdkObjects<\n Q extends ObjectTypeDefinition | InterfaceDefinition,\n WP extends DerivedProperty.Clause<Q> | undefined,\n>(\n type: Q,\n options?: UseOsdkObjectsOptions<Q, WP>,\n): UseOsdkListResult<Q> | UseOsdkListResult<LinkedType<Q, LinkNames<Q>>> {\n const {\n pageSize,\n orderBy,\n dedupeIntervalMs,\n where = {},\n streamUpdates,\n withProperties,\n autoFetchMore,\n intersectWith,\n pivotTo,\n enabled = true,\n } = options ?? {};\n const { observableClient } = React.useContext(OsdkContext2);\n\n /* We want the canonical where clause so that the use of `React.useMemo`\n is stable. No real added cost as we canonicalize internal to\n the ObservableClient anyway.\n */\n const canonWhere = observableClient.canonicalizeWhereClause<Q>(where ?? {});\n\n const stableWithProperties = React.useMemo(\n () => withProperties,\n [JSON.stringify(withProperties)],\n );\n\n const stableIntersectWith = React.useMemo(\n () => intersectWith,\n [JSON.stringify(intersectWith)],\n );\n\n const { subscribe, getSnapShot } = React.useMemo(\n () => {\n if (!enabled) {\n return makeExternalStore<ObserveObjectsArgs<Q>>(\n () => ({ unsubscribe: () => {} }),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${JSON.stringify(canonWhere)} [DISABLED]`\n : void 0,\n );\n }\n return makeExternalStore<ObserveObjectsArgs<Q>>(\n (observer) =>\n observableClient.observeList({\n type,\n where: canonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith\n ? { intersectWith: stableIntersectWith }\n : {}),\n ...(pivotTo ? { pivotTo } : {}),\n }, observer),\n process.env.NODE_ENV !== \"production\"\n ? `list ${type.apiName} ${JSON.stringify(canonWhere)}`\n : void 0,\n );\n },\n [\n enabled,\n observableClient,\n type,\n canonWhere,\n dedupeIntervalMs,\n pageSize,\n orderBy,\n streamUpdates,\n stableWithProperties,\n autoFetchMore,\n stableIntersectWith,\n pivotTo,\n ],\n );\n\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n\n let error: Error | undefined;\n if (listPayload && \"error\" in listPayload && listPayload.error) {\n error = listPayload.error;\n } else if (listPayload?.status === \"error\") {\n error = new Error(\"Failed to load objects\");\n }\n\n return {\n fetchMore: listPayload?.fetchMore,\n error,\n data: listPayload?.resolvedList,\n isLoading: listPayload?.status === \"loading\",\n isOptimistic: listPayload?.isOptimistic ?? false,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,YAAY,QAAQ,mBAAmB;AAoKhD,OAAO,SAASC,cAAcA,CAI5BC,IAAO,EACPC,OAAsC,EACiC;EACvE,MAAM;IACJC,QAAQ;IACRC,OAAO;IACPC,gBAAgB;IAChBC,KAAK,GAAG,CAAC,CAAC;IACVC,aAAa;IACbC,cAAc;IACdC,aAAa;IACbC,aAAa;IACbC,OAAO;IACPC,OAAO,GAAG;EACZ,CAAC,GAAGV,OAAO,IAAI,CAAC,CAAC;EACjB,MAAM;IAAEW;EAAiB,CAAC,GAAGhB,KAAK,CAACiB,UAAU,CAACf,YAAY,CAAC;;EAE3D;AACF;AACA;AACA;EACE,MAAMgB,UAAU,GAAGF,gBAAgB,CAACG,uBAAuB,CAAIV,KAAK,IAAI,CAAC,CAAC,CAAC;EAE3E,MAAMW,oBAAoB,GAAGpB,KAAK,CAACqB,OAAO,CACxC,MAAMV,cAAc,EACpB,CAACW,IAAI,CAACC,SAAS,CAACZ,cAAc,CAAC,CACjC,CAAC;EAED,MAAMa,mBAAmB,GAAGxB,KAAK,CAACqB,OAAO,CACvC,MAAMR,aAAa,EACnB,CAACS,IAAI,CAACC,SAAS,CAACV,aAAa,CAAC,CAChC,CAAC;EAED,MAAM;IAAEY,SAAS;IAAEC;EAAY,CAAC,GAAG1B,KAAK,CAACqB,OAAO,CAC9C,MAAM;IACJ,IAAI,CAACN,OAAO,EAAE;MACZ,OAAOd,iBAAiB,CACtB,OAAO;QAAE0B,WAAW,EAAEA,CAAA,KAAM,CAAC;MAAE,CAAC,CAAC,EACjCC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQ1B,IAAI,CAAC2B,OAAO,IAAIT,IAAI,CAACC,SAAS,CAACL,UAAU,CAAC,aAAa,GAC/D,KAAK,CACX,CAAC;IACH;IACA,OAAOjB,iBAAiB,CACrB+B,QAAQ,IACPhB,gBAAgB,CAACiB,WAAW,CAAC;MAC3B7B,IAAI;MACJK,KAAK,EAAES,UAAU;MACjBgB,cAAc,EAAE1B,gBAAgB,IAAI,KAAK;MACzCF,QAAQ;MACRC,OAAO;MACPG,aAAa;MACbC,cAAc,EAAES,oBAAoB;MACpCR,aAAa;MACb,IAAIY,mBAAmB,GACnB;QAAEX,aAAa,EAAEW;MAAoB,CAAC,GACtC,CAAC,CAAC,CAAC;MACP,IAAIV,OAAO,GAAG;QAAEA;MAAQ,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,EAAEkB,QAAQ,CAAC,EACdJ,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GACjC,QAAQ1B,IAAI,CAAC2B,OAAO,IAAIT,IAAI,CAACC,SAAS,CAACL,UAAU,CAAC,EAAE,GACpD,KAAK,CACX,CAAC;EACH,CAAC,EACD,CACEH,OAAO,EACPC,gBAAgB,EAChBZ,IAAI,EACJc,UAAU,EACVV,gBAAgB,EAChBF,QAAQ,EACRC,OAAO,EACPG,aAAa,EACbU,oBAAoB,EACpBR,aAAa,EACbY,mBAAmB,EACnBV,OAAO,CAEX,CAAC;EAED,MAAMqB,WAAW,GAAGnC,KAAK,CAACoC,oBAAoB,CAACX,SAAS,EAAEC,WAAW,CAAC;EAEtE,IAAIW,KAAwB;EAC5B,IAAIF,WAAW,IAAI,OAAO,IAAIA,WAAW,IAAIA,WAAW,CAACE,KAAK,EAAE;IAC9DA,KAAK,GAAGF,WAAW,CAACE,KAAK;EAC3B,CAAC,MAAM,IAAIF,WAAW,EAAEG,MAAM,KAAK,OAAO,EAAE;IAC1CD,KAAK,GAAG,IAAIE,KAAK,CAAC,wBAAwB,CAAC;EAC7C;EAEA,OAAO;IACLC,SAAS,EAAEL,WAAW,EAAEK,SAAS;IACjCH,KAAK;IACLI,IAAI,EAAEN,WAAW,EAAEO,YAAY;IAC/BC,SAAS,EAAER,WAAW,EAAEG,MAAM,KAAK,SAAS;IAC5CM,YAAY,EAAET,WAAW,EAAES,YAAY,IAAI;EAC7C,CAAC;AACH","ignoreList":[]}
@@ -18,8 +18,10 @@ export { OsdkProvider2 } from "../new/OsdkProvider2.js";
18
18
  export { useLinks } from "../new/useLinks.js";
19
19
  export { useObjectSet } from "../new/useObjectSet.js";
20
20
  export { useOsdkAction } from "../new/useOsdkAction.js";
21
+ export { useOsdkAggregation } from "../new/useOsdkAggregation.js";
21
22
  export { useOsdkObject } from "../new/useOsdkObject.js";
22
23
  export { useOsdkObjects } from "../new/useOsdkObjects.js";
23
24
  export { useOsdkClient } from "../useOsdkClient.js";
24
25
  export { useOsdkMetadata } from "../useOsdkMetadata.js";
26
+ export { useDebouncedCallback } from "../utils/useDebouncedCallback.js";
25
27
  //# sourceMappingURL=experimental.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type { UseOsdkListResult } from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AACvD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["OsdkProvider2","useLinks","useObjectSet","useOsdkAction","useOsdkAggregation","useOsdkObject","useOsdkObjects","useOsdkClient","useOsdkMetadata","useDebouncedCallback"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OsdkProvider2 } from \"../new/OsdkProvider2.js\";\nexport { useLinks } from \"../new/useLinks.js\";\nexport { useObjectSet } from \"../new/useObjectSet.js\";\nexport { useOsdkAction } from \"../new/useOsdkAction.js\";\nexport type { UseOsdkAggregationResult } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkAggregation } from \"../new/useOsdkAggregation.js\";\nexport { useOsdkObject } from \"../new/useOsdkObject.js\";\nexport type { UseOsdkListResult } from \"../new/useOsdkObjects.js\";\nexport { useOsdkObjects } from \"../new/useOsdkObjects.js\";\nexport { useOsdkClient } from \"../useOsdkClient.js\";\nexport { useOsdkMetadata } from \"../useOsdkMetadata.js\";\nexport type { UseOsdkMetadataResult } from \"../useOsdkMetadata.js\";\nexport { useDebouncedCallback } from \"../utils/useDebouncedCallback.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,yBAAyB;AACvD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,aAAa,QAAQ,yBAAyB;AAEvD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,aAAa,QAAQ,qBAAqB;AACnD,SAASC,eAAe,QAAQ,uBAAuB;AAEvD,SAASC,oBAAoB,QAAQ,kCAAkC","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from "react";
18
+ /**
19
+ * Creates a debounced version of a callback function.
20
+ *
21
+ * @param callback The function to debounce
22
+ * @param delay The delay in milliseconds
23
+ * @returns A debounced function with cancel() and flush() methods
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * const { applyAction } = useOsdkAction(editOffice);
28
+ *
29
+ * const debouncedSave = useDebouncedCallback(
30
+ * async (name: string) => {
31
+ * await applyAction({
32
+ * Office: office,
33
+ * name,
34
+ * location: office.location!,
35
+ * $optimisticUpdate: (ctx) => {
36
+ * ctx.updateObject(office.$clone({ name }));
37
+ * },
38
+ * });
39
+ * },
40
+ * 1000
41
+ * );
42
+ *
43
+ * <input onChange={(e) => debouncedSave(e.target.value)} />
44
+ * ```
45
+ */
46
+ export function useDebouncedCallback(callback, delay) {
47
+ const timeoutRef = React.useRef();
48
+ const callbackRef = React.useRef(callback);
49
+ const lastArgsRef = React.useRef();
50
+ callbackRef.current = callback;
51
+ const cancel = React.useCallback(() => {
52
+ if (timeoutRef.current) {
53
+ clearTimeout(timeoutRef.current);
54
+ timeoutRef.current = undefined;
55
+ }
56
+ }, []);
57
+ const flush = React.useCallback(() => {
58
+ if (timeoutRef.current && lastArgsRef.current) {
59
+ clearTimeout(timeoutRef.current);
60
+ timeoutRef.current = undefined;
61
+ void callbackRef.current(...lastArgsRef.current);
62
+ }
63
+ }, []);
64
+ const debouncedCallback = React.useCallback((...args) => {
65
+ lastArgsRef.current = args;
66
+ cancel();
67
+ timeoutRef.current = setTimeout(() => {
68
+ void callbackRef.current(...args);
69
+ }, delay);
70
+ }, [delay, cancel]);
71
+ React.useEffect(() => {
72
+ return () => {
73
+ cancel();
74
+ };
75
+ }, [cancel]);
76
+ return Object.assign(debouncedCallback, {
77
+ cancel,
78
+ flush
79
+ });
80
+ }
81
+ //# sourceMappingURL=useDebouncedCallback.js.map
@@ -0,0 +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,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":[]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../src/intellisense.test.ts"],"version":3,"file":"intellisense.test.d.ts"}
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/intellisense.test.helpers/useOsdkObjectsWithPivot.ts"],"version":3,"file":"useOsdkObjectsWithPivot.d.ts"}
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/intellisense.test.helpers/useOsdkObjectsWithProperties.ts"],"version":3,"file":"useOsdkObjectsWithProperties.d.ts"}
@@ -0,0 +1,5 @@
1
+ import type { DerivedProperty, InterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
2
+ export type InferRdpTypes<
3
+ Q extends ObjectTypeDefinition | InterfaceDefinition,
4
+ WP extends DerivedProperty.Clause<Q> | undefined
5
+ > = WP extends DerivedProperty.Clause<Q> ? { [K in keyof WP] : WP[K] extends DerivedProperty.Creator<Q, infer T> ? T : never } : {};
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cACE,iBACA,qBACA,4BACK,WAAY;AAEnB,YAAY;CACV,UAAU,uBAAuB;CACjC,WAAW,gBAAgB,OAAO;IAChC,WAAW,gBAAgB,OAAO,QACjC,WAAW,MAAK,GAAG,WAAW,gBAAgB,QAAQ,SAAS,KAAK,cAGrE,CAAE","names":[],"sources":["../../../src/new/types.ts"],"version":3,"file":"types.d.ts"}
@@ -18,6 +18,26 @@ export interface UseLinksOptions<T extends ObjectTypeDefinition | InterfaceDefin
18
18
  * - "offline": Only use cached data, don't make network requests
19
19
  */
20
20
  mode?: "force" | "offline";
21
+ /**
22
+ * Enable or disable the query.
23
+ *
24
+ * When `false`, the query will not automatically execute. It will still
25
+ * return any cached data, but will not fetch from the server.
26
+ *
27
+ * This is useful for:
28
+ * - Lazy/on-demand queries that should wait for user interaction
29
+ * - Dependent queries that need data from another query first
30
+ * - Conditional queries based on component state
31
+ *
32
+ * @default true
33
+ * @example
34
+ * // Dependent query - wait for employee data
35
+ * const { object: employee } = useOsdkObject(Employee, employeeId);
36
+ * const { links: reports } = useLinks(employee, "reports", {
37
+ * enabled: !!employee
38
+ * });
39
+ */
40
+ enabled?: boolean;
21
41
  }
22
42
  export interface UseLinksResult<Q extends ObjectTypeDefinition | InterfaceDefinition> {
23
43
  links: Osdk.Instance<Q>[] | undefined;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,YAAY,iBAAiB,WAAY;AACvD,cACE,qBACA,sBACA,MACA,cACA,mBACK,cAAe;AAMtB,iBAAiB,gBACf,UAAU,uBAAuB,qBACjC;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;CASnC,OAAO,UAAU;AAClB;AAED,iBAAiB,eACf,UAAU,uBAAuB,qBACjC;CACA,OAAO,KAAK,SAAS;CACrB;CACA,OAAO;;;;CAKP;;;;CAKA,kBAAkB;;;;CAKlB;AACD;;;;;;;;;AAYD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,SAAS,iBAChDC,UAAU,GACVC,UAAS,gBAAgB,WAAW,GAAG,MACtC,eAAe,WAAW,GAAG","names":["objects: Osdk.Instance<T> | Array<Osdk.Instance<T>> | undefined","linkName: L","options: UseLinksOptions<LinkedType<T, L>>"],"sources":["../../../src/new/useLinks.ts"],"version":3,"file":"useLinks.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,YAAY,iBAAiB,WAAY;AACvD,cACE,qBACA,sBACA,MACA,cACA,mBACK,cAAe;AAMtB,iBAAiB,gBACf,UAAU,uBAAuB,qBACjC;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;CASnC,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;CAqBjB;AACD;AAED,iBAAiB,eACf,UAAU,uBAAuB,qBACjC;CACA,OAAO,KAAK,SAAS;CACrB;CACA,OAAO;;;;CAKP;;;;CAKA,kBAAkB;;;;CAKlB;AACD;;;;;;;;;AAYD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,SAAS,iBAChDC,UAAU,GACVC,UAAS,gBAAgB,WAAW,GAAG,MACtC,eAAe,WAAW,GAAG","names":["objects: Osdk.Instance<T> | Array<Osdk.Instance<T>> | undefined","linkName: L","options: UseLinksOptions<LinkedType<T, L>>"],"sources":["../../../src/new/useLinks.ts"],"version":3,"file":"useLinks.d.ts"}
@@ -1,5 +1,4 @@
1
- import type { DerivedProperty, LinkNames, ObjectSet, ObjectTypeDefinition, Osdk, PropertyKeys, WhereClause, WirePropertyTypes } from "@osdk/api";
2
- type SimplePropertyDef = WirePropertyTypes | undefined | Array<WirePropertyTypes>;
1
+ import type { DerivedProperty, LinkNames, ObjectSet, ObjectTypeDefinition, Osdk, PropertyKeys, SimplePropertyDef, WhereClause } from "@osdk/api";
3
2
  export interface UseObjectSetOptions<
4
3
  Q extends ObjectTypeDefinition,
5
4
  RDPs extends Record<string, SimplePropertyDef> = {}
@@ -7,7 +6,7 @@ export interface UseObjectSetOptions<
7
6
  /**
8
7
  * Where clause for filtering
9
8
  */
10
- where?: WhereClause<Q>;
9
+ where?: WhereClause<Q, RDPs>;
11
10
  /**
12
11
  * Derived properties to add to the object set
13
12
  */
@@ -40,6 +39,42 @@ export interface UseObjectSetOptions<
40
39
  * Minimum time between fetch requests in milliseconds (defaults to 2000ms)
41
40
  */
42
41
  dedupeIntervalMs?: number;
42
+ /**
43
+ * Automatically fetch additional pages on initial load.
44
+ *
45
+ * - `true`: Fetch all available pages automatically
46
+ * - `number`: Fetch pages until at least this many items are loaded
47
+ * - `undefined` (default): Only fetch the first page, user must call fetchMore()
48
+ */
49
+ autoFetchMore?: boolean | number;
50
+ /**
51
+ * Enable streaming updates via websocket subscription.
52
+ * When true, the object set will automatically update when matching objects are
53
+ * added, updated, or removed.
54
+ *
55
+ * @default false
56
+ */
57
+ streamUpdates?: boolean;
58
+ /**
59
+ * Enable or disable the query.
60
+ *
61
+ * When `false`, the query will not automatically execute. It will still
62
+ * return any cached data, but will not fetch from the server.
63
+ *
64
+ * This is useful for:
65
+ * - Lazy/on-demand queries that should wait for user interaction
66
+ * - Dependent queries that need data from another query first
67
+ * - Conditional queries based on component state
68
+ *
69
+ * @default true
70
+ * @example
71
+ * // Dependent query - wait for filter selection
72
+ * const { data: filteredObjects } = useObjectSet(MyObject.all(), {
73
+ * where: { status: selectedStatus },
74
+ * enabled: !!selectedStatus
75
+ * });
76
+ */
77
+ enabled?: boolean;
43
78
  }
44
79
  export interface UseObjectSetResult<
45
80
  Q extends ObjectTypeDefinition,
@@ -82,4 +117,3 @@ export declare function useObjectSet<
82
117
  BaseRDPs extends Record<string, SimplePropertyDef> = never,
83
118
  RDPs extends Record<string, SimplePropertyDef> = {}
84
119
  >(baseObjectSet: ObjectSet<Q, BaseRDPs>, options?: UseObjectSetOptions<Q, RDPs>): UseObjectSetResult<Q, RDPs>;
85
- export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,iBACA,WACA,WACA,sBACA,MACA,cACA,aACA,yBACK,WAAY;KAUd,oBACD,gCAEA,MAAM;AAEV,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY;;;;CAKpB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,QAAQ,UAAU;;;;CAKlB,YAAY,UAAU;;;;CAKtB,WAAW,UAAU;;;;CAKrB,UAAU,UAAU;;;;CAKpB;;;;CAKA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;CAKP,kBAAkB;;;;CAKlB,WAAW,UAAU,GAAG;AACzB;;;;;;;;;;;;AAmBD,OAAO,iBAAS;CACd,UAAU;CACV,iBAAiB,eAAe;CAChC,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,eAAe,UAAU,GAAG,WAC5BC,UAAS,oBAAoB,GAAG,QAC/B,mBAAmB,GAAG","names":["baseObjectSet: ObjectSet<Q, BaseRDPs>","options: UseObjectSetOptions<Q, RDPs>"],"sources":["../../../src/new/useObjectSet.tsx"],"version":3,"file":"useObjectSet.d.ts"}
1
+ {"mappings":"AAgBA,cACE,iBACA,WACA,WACA,sBACA,MACA,cACA,mBACA,mBACK,WAAY;AAUnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,QAAQ,YAAY,GAAG;;;;CAKvB,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;CAKtE,QAAQ,UAAU;;;;CAKlB,YAAY,UAAU;;;;CAKtB,WAAW,UAAU;;;;CAKrB,UAAU,UAAU;;;;CAKpB;;;;CAKA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;;;;CASA;;;;;;;;CASA;;;;;;;;;;;;;;;;;;;;CAqBA;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;CAKP,kBAAkB;;;;CAKlB,WAAW,UAAU,GAAG;AACzB;;;;;;;;;;;;AAmBD,OAAO,iBAAS;CACd,UAAU;CACV,iBAAiB,eAAe;CAChC,aAAa,eAAe,qBAAqB,CAAE;EAEnDA,eAAe,UAAU,GAAG,WAC5BC,UAAS,oBAAoB,GAAG,QAC/B,mBAAmB,GAAG","names":["baseObjectSet: ObjectSet<Q, BaseRDPs>","options: UseObjectSetOptions<Q, RDPs>"],"sources":["../../../src/new/useObjectSet.tsx"],"version":3,"file":"useObjectSet.d.ts"}
@@ -0,0 +1,67 @@
1
+ import type { AggregateOpts, AggregationsResults, DerivedProperty, WhereClause } from "@osdk/api";
2
+ import type { ObjectTypeDefinition } from "@osdk/client";
3
+ import type { InferRdpTypes } from "./types.js";
4
+ export interface UseOsdkAggregationOptions<
5
+ T extends ObjectTypeDefinition,
6
+ A extends AggregateOpts<T>,
7
+ WithProps extends DerivedProperty.Clause<T> | undefined = undefined
8
+ > {
9
+ /**
10
+ * Standard OSDK Where clause to filter objects before aggregation
11
+ */
12
+ where?: WhereClause<T, InferRdpTypes<T, WithProps>>;
13
+ /**
14
+ * Define derived properties (RDPs) to be computed server-side.
15
+ * The derived properties can be used in the where clause and aggregation groupBy/select.
16
+ */
17
+ withProperties?: WithProps;
18
+ /**
19
+ * Aggregation options including groupBy and select
20
+ */
21
+ aggregate: A;
22
+ /**
23
+ * The number of milliseconds to wait after the last observed aggregation change.
24
+ *
25
+ * Two uses of `useOsdkAggregation` with the same parameters will only trigger one
26
+ * network request if the second is within `dedupeIntervalMs`.
27
+ */
28
+ dedupeIntervalMs?: number;
29
+ }
30
+ export interface UseOsdkAggregationResult<
31
+ T extends ObjectTypeDefinition,
32
+ A extends AggregateOpts<T>
33
+ > {
34
+ data: AggregationsResults<T, A> | undefined;
35
+ isLoading: boolean;
36
+ error: Error | undefined;
37
+ refetch: () => void;
38
+ }
39
+ /**
40
+ * React hook for performing aggregations on OSDK object sets.
41
+ *
42
+ * Executes server-side aggregations with groupBy and metric calculations on filtered object sets.
43
+ * Supports runtime derived properties and where clauses.
44
+ *
45
+ * @param type - The object or interface type to aggregate
46
+ * @param options - Aggregation configuration including where clause, aggregation spec, and optional derived properties
47
+ * @returns Object containing aggregation results, loading state, error state, and refetch function
48
+ *
49
+ * @example
50
+ * ```tsx
51
+ * const { data, isLoading, error } = useOsdkAggregation(Employee, {
52
+ * where: { department: "Engineering" },
53
+ * aggregate: {
54
+ * groupBy: { department: "exact" },
55
+ * select: {
56
+ * avgSalary: { $avg: "salary" },
57
+ * count: { $count: {} }
58
+ * }
59
+ * }
60
+ * });
61
+ * ```
62
+ */
63
+ export declare function useOsdkAggregation<
64
+ Q extends ObjectTypeDefinition,
65
+ A extends AggregateOpts<Q>,
66
+ WP extends DerivedProperty.Clause<Q> | undefined = undefined
67
+ >(type: Q, { where, withProperties, aggregate, dedupeIntervalMs }: UseOsdkAggregationOptions<Q, A, WP>): UseOsdkAggregationResult<Q, A>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cACE,eACA,qBACA,iBACA,mBACK,WAAY;AACnB,cAAc,4BAA4B,cAAe;AAKzD,cAAc,qBAAqB,YAAa;AAEhD,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;CACxB,kBAAkB,gBAAgB,OAAO;EACzC;;;;CAIA,QAAQ,YAAY,GAAG,cAAc,GAAG;;;;;CAMxC,iBAAiB;;;;CAKjB,WAAW;;;;;;;CAQX;AACD;AAED,iBAAiB;CACf,UAAU;CACV,UAAU,cAAc;EACxB;CACA,MAAM,oBAAoB,GAAG;CAC7B;CACA,OAAO;CACP;AACD;;;;;;;;;;;;;;;;;;;;;;;;;AAgCD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,cAAc;CACxB,WAAW,gBAAgB,OAAO;EAElCA,MAAM,GACN,EACE,OACA,gBACA,WACA,kBACoC,EAAnC,0BAA0B,GAAG,GAAG,MAClC,yBAAyB,GAAG","names":["type: Q"],"sources":["../../../src/new/useOsdkAggregation.ts"],"version":3,"file":"useOsdkAggregation.d.ts"}
@@ -11,12 +11,14 @@ export interface UseOsdkObjectResult<Q extends ObjectTypeDefinition> {
11
11
  }
12
12
  /**
13
13
  * @param obj an existing `Osdk.Instance` object to get metadata for.
14
+ * @param enabled Enable or disable the query (defaults to true)
14
15
  */
15
- export declare function useOsdkObject<Q extends ObjectTypeDefinition>(obj: Osdk.Instance<Q>): UseOsdkObjectResult<Q>;
16
+ export declare function useOsdkObject<Q extends ObjectTypeDefinition>(obj: Osdk.Instance<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
16
17
  /**
17
18
  * Loads an object by type and primary key.
18
19
  *
19
20
  * @param type
20
21
  * @param primaryKey
22
+ * @param enabled Enable or disable the query (defaults to true)
21
23
  */
22
- export declare function useOsdkObject<Q extends ObjectTypeDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>): UseOsdkObjectResult<Q>;
24
+ export declare function useOsdkObject<Q extends ObjectTypeDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,sBAAsB,MAAM,sBAAsB,WAAY;AAM5E,iBAAiB,oBAAoB,UAAU,sBAAsB;CACnE,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;AAKD,OAAO,iBAAS,cAAc,UAAU,sBACtCA,KAAK,KAAK,SAAS,KAClB,oBAAoB;;;;;;;AAOvB,OAAO,iBAAS,cAAc,UAAU,sBACtCC,MAAM,GACNC,YAAY,eAAe,KAC1B,oBAAoB","names":["obj: Osdk.Instance<Q>","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,sBAAsB,MAAM,sBAAsB,WAAY;AAM5E,iBAAiB,oBAAoB,UAAU,sBAAsB;CACnE,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;;AAMD,OAAO,iBAAS,cAAc,UAAU,sBACtCA,KAAK,KAAK,SAAS,IACnBC,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cAAc,UAAU,sBACtCC,MAAM,GACNC,YAAY,eAAe,IAC3BF,oBACC,oBAAoB","names":["obj: Osdk.Instance<Q>","enabled?: boolean","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
@@ -1,9 +1,13 @@
1
- import type { InterfaceDefinition, ObjectTypeDefinition, Osdk, PropertyKeys, WhereClause } from "@osdk/client";
2
- export interface UseOsdkObjectsOptions<T extends ObjectTypeDefinition | InterfaceDefinition> {
1
+ import type { DerivedProperty, InterfaceDefinition, LinkedType, LinkNames, ObjectTypeDefinition, Osdk, PropertyKeys, WhereClause } from "@osdk/api";
2
+ import type { InferRdpTypes } from "./types.js";
3
+ export interface UseOsdkObjectsOptions<
4
+ T extends ObjectTypeDefinition | InterfaceDefinition,
5
+ WithProps extends DerivedProperty.Clause<T> | undefined = undefined
6
+ > {
3
7
  /**
4
- * Standard OSDK Where
8
+ * Standard OSDK Where with RDP support
5
9
  */
6
- where?: WhereClause<T>;
10
+ where?: WhereClause<T, InferRdpTypes<T, WithProps>>;
7
11
  /**
8
12
  * The preferred page size for the list.
9
13
  */
@@ -11,10 +15,48 @@ export interface UseOsdkObjectsOptions<T extends ObjectTypeDefinition | Interfac
11
15
  /** */
12
16
  orderBy?: { [K in PropertyKeys<T>]? : "asc" | "desc" };
13
17
  /**
18
+ * Define derived properties (RDPs) to be computed server-side and attached to each object.
19
+ * These properties will be available on the returned objects alongside their regular properties.
20
+ */
21
+ withProperties?: WithProps;
22
+ /**
23
+ * Intersect the results with additional object sets.
24
+ * Each element defines a where clause for an object set to intersect with.
25
+ * The final result will only include objects that match ALL conditions.
26
+ */
27
+ intersectWith?: Array<{
28
+ where: WhereClause<T, InferRdpTypes<T, WithProps>>
29
+ }>;
30
+ /**
31
+ * Pivot to related objects through a link.
32
+ * This changes the return type from T to the linked object type.
33
+ */
34
+ pivotTo?: LinkNames<T>;
35
+ /**
14
36
  * Causes the list to automatically fetch more as soon as the previous page
15
37
  * has been loaded. If a number is provided, it will continue to automatically
16
38
  * fetch more until the list is at least that long.
39
+ *
40
+ * - `true`: Fetch all available pages automatically
41
+ * - `number`: Fetch pages until at least this many items are loaded
42
+ * - `undefined` (default): Only fetch the first page, user must call fetchMore()
43
+ *
44
+ * Note: When using `autoFetchMore: true` with large datasets, the initial
45
+ * load may take significant time. Consider using a specific number instead
46
+ * or implementing virtual scrolling.
47
+ *
48
+ * @example
49
+ * // Fetch all todos at once
50
+ * const { data } = useOsdkObjects(Todo, { autoFetchMore: true })
51
+ *
52
+ * @example
53
+ * // Fetch at least 100 todos (with 25 per page, fetches 4 pages)
54
+ * const { data } = useOsdkObjects(Todo, {
55
+ * autoFetchMore: 100,
56
+ * pageSize: 25
57
+ * })
17
58
  */
59
+ autoFetchMore?: boolean | number;
18
60
  /**
19
61
  * Upon a list being revalidated, this option determines how the component
20
62
  * will be re-rendered with the data.
@@ -41,16 +83,31 @@ export interface UseOsdkObjectsOptions<T extends ObjectTypeDefinition | Interfac
41
83
  * network request if the second is within `dedupeIntervalMs`.
42
84
  */
43
85
  dedupeIntervalMs?: number;
86
+ streamUpdates?: boolean;
44
87
  /**
45
- * If provided, the list will be considered this length for the purposes of
46
- * `invalidationMode` when using the `wait` option. If not provided,
47
- * the internal expectedLength will be determined by the number of times
48
- * `fetchMore` has been called.
88
+ * Enable or disable the query.
89
+ *
90
+ * When `false`, the query will not automatically execute. It will still
91
+ * return any cached data, but will not fetch from the server.
92
+ *
93
+ * This is useful for:
94
+ * - Lazy/on-demand queries that should wait for user interaction
95
+ * - Dependent queries that need data from another query first
96
+ * - Conditional queries based on component state
97
+ *
98
+ * @default true
99
+ * @example
100
+ * // Dependent query - wait for parent data
101
+ * const { data: employee } = useOsdkObject(Employee, employeeId);
102
+ * const { data: reports } = useOsdkObjects(Employee, {
103
+ * where: { managerId: employee?.id },
104
+ * enabled: !!employee
105
+ * });
49
106
  */
50
- streamUpdates?: boolean;
107
+ enabled?: boolean;
51
108
  }
52
109
  export interface UseOsdkListResult<T extends ObjectTypeDefinition | InterfaceDefinition> {
53
- fetchMore: (() => Promise<unknown>) | undefined;
110
+ fetchMore: (() => Promise<void>) | undefined;
54
111
  data: Osdk.Instance<T>[] | undefined;
55
112
  isLoading: boolean;
56
113
  error: Error | undefined;
@@ -63,4 +120,13 @@ export interface UseOsdkListResult<T extends ObjectTypeDefinition | InterfaceDef
63
120
  */
64
121
  isOptimistic: boolean;
65
122
  }
66
- export declare function useOsdkObjects<Q extends ObjectTypeDefinition | InterfaceDefinition>(type: Q, { pageSize, orderBy, dedupeIntervalMs, where, streamUpdates }?: UseOsdkObjectsOptions<Q>): UseOsdkListResult<Q>;
123
+ export declare function useOsdkObjects<
124
+ Q extends ObjectTypeDefinition,
125
+ L extends LinkNames<Q>
126
+ >(type: Q, options: UseOsdkObjectsOptions<Q> & {
127
+ pivotTo: L
128
+ }): UseOsdkListResult<LinkedType<Q, L>>;
129
+ export declare function useOsdkObjects<
130
+ Q extends ObjectTypeDefinition | InterfaceDefinition,
131
+ WP extends DerivedProperty.Clause<Q> | undefined
132
+ >(type: Q, options?: UseOsdkObjectsOptions<Q, WP>): UseOsdkListResult<Q>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBACA,sBACA,MACA,cACA,mBACK,cAAe;AAMtB,iBAAiB,sBACf,UAAU,uBAAuB,qBACjC;;;;CAIA,QAAQ,YAAY;;;;CAKpB;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnC;;;;;;;CAUA;AACD;AAED,iBAAiB,kBACf,UAAU,uBAAuB,qBACjC;CACA,kBAAkB;CAClB,MAAM,KAAK,SAAS;CACpB;CACA,OAAO;;;;;;;;CASP;AACD;AAQD,OAAO,iBAAS,eACd,UAAU,uBAAuB,qBAEjCA,MAAM,GACN,EACE,UACA,SACA,kBACA,OACA,eACyB,GAAxB,sBAAsB,KACxB,kBAAkB","names":["type: Q"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
1
+ {"mappings":"AAgBA,cACE,iBACA,qBACA,YACA,WACA,sBACA,MACA,cACA,mBACK,WAAY;AAKnB,cAAc,qBAAqB,YAAa;AAEhD,iBAAiB;CACf,UAAU,uBAAuB;CACjC,kBAAkB,gBAAgB,OAAO;EACzC;;;;CAIA,QAAQ,YAAY,GAAG,cAAc,GAAG;;;;CAKxC;;CAGA,aACG,KAAK,aAAa,OAAM,QAAQ;;;;;CAOnC,iBAAiB;;;;;;CAOjB,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG,cAAc,GAAG;CACxC;;;;;CAMD,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpB;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BA;CAEA;;;;;;;;;;;;;;;;;;;;;CAsBA;AACD;AAED,iBAAiB,kBACf,UAAU,uBAAuB,qBACjC;CACA,kBAAkB;CAClB,MAAM,KAAK,SAAS;CACpB;CAEA,OAAO;;;;;;;;CASP;AACD;AAQD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,MAAM,GACNC,SAAS,sBAAsB,KAAK;CAAE,SAAS;AAAG,IACjD,kBAAkB,WAAW,GAAG;AAEnC,OAAO,iBAAS;CACd,UAAU,uBAAuB;CACjC,WAAW,gBAAgB,OAAO;EAElCD,MAAM,GACNE,UAAU,sBAAsB,GAAG,MAClC,kBAAkB","names":["type: Q","options: UseOsdkObjectsOptions<Q> & { pivotTo: L }","options?: UseOsdkObjectsOptions<Q, WP>"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
@@ -2,9 +2,12 @@ export { OsdkProvider2 } from "../new/OsdkProvider2.js";
2
2
  export { useLinks } from "../new/useLinks.js";
3
3
  export { useObjectSet } from "../new/useObjectSet.js";
4
4
  export { useOsdkAction } from "../new/useOsdkAction.js";
5
+ export type { UseOsdkAggregationResult } from "../new/useOsdkAggregation.js";
6
+ export { useOsdkAggregation } from "../new/useOsdkAggregation.js";
5
7
  export { useOsdkObject } from "../new/useOsdkObject.js";
6
8
  export type { UseOsdkListResult } from "../new/useOsdkObjects.js";
7
9
  export { useOsdkObjects } from "../new/useOsdkObjects.js";
8
10
  export { useOsdkClient } from "../useOsdkClient.js";
9
11
  export { useOsdkMetadata } from "../useOsdkMetadata.js";
10
12
  export type { UseOsdkMetadataResult } from "../useOsdkMetadata.js";
13
+ export { useDebouncedCallback } from "../utils/useDebouncedCallback.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,cAAc,yBAAyB;AACvC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,cAAc,gCAAgC;AAC9C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,cAAc,yBAAyB;AACvC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B;AAC3C,SAAS,4BAA4B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}