@osdk/react 0.10.0-beta.13 → 0.10.0-beta.14

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 (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/browser/new/OsdkContext2.js +22 -2
  3. package/build/browser/new/OsdkContext2.js.map +1 -1
  4. package/build/browser/new/useOsdkAction.js +2 -6
  5. package/build/browser/new/useOsdkAction.js.map +1 -1
  6. package/build/browser/new/useOsdkFunctions.js +137 -0
  7. package/build/browser/new/useOsdkFunctions.js.map +1 -0
  8. package/build/browser/public/unstable-do-not-use.js +18 -0
  9. package/build/browser/public/unstable-do-not-use.js.map +1 -0
  10. package/build/cjs/chunk-2N32USW5.cjs +28 -0
  11. package/build/cjs/chunk-2N32USW5.cjs.map +1 -0
  12. package/build/cjs/chunk-R4FZ5MUH.cjs +34 -0
  13. package/build/cjs/chunk-R4FZ5MUH.cjs.map +1 -0
  14. package/build/cjs/{chunk-SVVMLSKN.cjs → chunk-ZUNR45SJ.cjs} +15 -4
  15. package/build/cjs/chunk-ZUNR45SJ.cjs.map +1 -0
  16. package/build/cjs/index.cjs +7 -6
  17. package/build/cjs/index.cjs.map +1 -1
  18. package/build/cjs/public/experimental/admin.cjs +11 -11
  19. package/build/cjs/public/experimental.cjs +30 -33
  20. package/build/cjs/public/experimental.cjs.map +1 -1
  21. package/build/cjs/public/experimental.d.cts +4 -120
  22. package/build/cjs/public/unstable-do-not-use.cjs +114 -0
  23. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
  24. package/build/cjs/public/unstable-do-not-use.d.cts +35 -0
  25. package/build/cjs/useOsdkFunction-B0s7lqgN.d.cts +121 -0
  26. package/build/esm/new/OsdkContext2.js +22 -2
  27. package/build/esm/new/OsdkContext2.js.map +1 -1
  28. package/build/esm/new/useOsdkAction.js +2 -6
  29. package/build/esm/new/useOsdkAction.js.map +1 -1
  30. package/build/esm/new/useOsdkFunctions.js +137 -0
  31. package/build/esm/new/useOsdkFunctions.js.map +1 -0
  32. package/build/esm/public/unstable-do-not-use.js +18 -0
  33. package/build/esm/public/unstable-do-not-use.js.map +1 -0
  34. package/build/types/new/OsdkContext2.d.ts +1 -0
  35. package/build/types/new/OsdkContext2.d.ts.map +1 -1
  36. package/build/types/new/useOsdkFunctions.d.ts +31 -0
  37. package/build/types/new/useOsdkFunctions.d.ts.map +1 -0
  38. package/build/types/public/unstable-do-not-use.d.ts +2 -0
  39. package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
  40. package/package.json +14 -5
  41. package/unstable-do-not-use.d.ts +17 -0
  42. package/build/cjs/chunk-OVBG5VXE.cjs +0 -50
  43. package/build/cjs/chunk-OVBG5VXE.cjs.map +0 -1
  44. package/build/cjs/chunk-SVVMLSKN.cjs.map +0 -1
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkOVBG5VXE_cjs = require('../chunk-OVBG5VXE.cjs');
4
- var chunkSVVMLSKN_cjs = require('../chunk-SVVMLSKN.cjs');
3
+ var chunkR4FZ5MUH_cjs = require('../chunk-R4FZ5MUH.cjs');
4
+ var chunk2N32USW5_cjs = require('../chunk-2N32USW5.cjs');
5
+ var chunkZUNR45SJ_cjs = require('../chunk-ZUNR45SJ.cjs');
5
6
  var unstableDoNotUse = require('@osdk/client/unstable-do-not-use');
6
7
  var React4 = require('react');
7
8
  var client = require('@osdk/client');
@@ -16,12 +17,12 @@ function OsdkProvider2({
16
17
  observableClient
17
18
  }) {
18
19
  observableClient = React4.useMemo(() => observableClient ?? unstableDoNotUse.createObservableClient(client), [client, observableClient]);
19
- return /* @__PURE__ */ React4__default.default.createElement(chunkSVVMLSKN_cjs.OsdkContext2.Provider, {
20
+ return /* @__PURE__ */ React4__default.default.createElement(chunkZUNR45SJ_cjs.OsdkContext2.Provider, {
20
21
  value: {
21
22
  client,
22
23
  observableClient
23
24
  }
24
- }, /* @__PURE__ */ React4__default.default.createElement(chunkOVBG5VXE_cjs.OsdkContext.Provider, {
25
+ }, /* @__PURE__ */ React4__default.default.createElement(chunk2N32USW5_cjs.OsdkContext.Provider, {
25
26
  value: {
26
27
  client
27
28
  }
@@ -32,7 +33,7 @@ var emptyMap = /* @__PURE__ */ new Map();
32
33
  function useLinks(objects, linkName, options = {}) {
33
34
  const {
34
35
  observableClient
35
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
36
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
36
37
  const {
37
38
  enabled = true,
38
39
  ...otherOptions
@@ -53,12 +54,12 @@ function useLinks(objects, linkName, options = {}) {
53
54
  getSnapShot
54
55
  } = React4__default.default.useMemo(() => {
55
56
  if (!enabled) {
56
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
57
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
57
58
  unsubscribe: () => {
58
59
  }
59
60
  }), `links ${linkName} for ${objectsKey} [DISABLED]`);
60
61
  }
61
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeLinks(objectsArray, linkName, {
62
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeLinks(objectsArray, linkName, {
62
63
  linkName,
63
64
  where: stableWhere,
64
65
  pageSize: otherOptions.pageSize,
@@ -85,7 +86,7 @@ var OBJECT_TYPE_PLACEHOLDER = "$__OBJECT__TYPE__PLACEHOLDER";
85
86
  function useObjectSet(baseObjectSet, options = {}) {
86
87
  const {
87
88
  observableClient
88
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
89
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
89
90
  const {
90
91
  enabled = true,
91
92
  streamUpdates,
@@ -115,13 +116,13 @@ function useObjectSet(baseObjectSet, options = {}) {
115
116
  getSnapShot
116
117
  } = React4__default.default.useMemo(() => {
117
118
  if (!enabled) {
118
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
119
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
119
120
  unsubscribe: () => {
120
121
  }
121
122
  }), process.env.NODE_ENV !== "production" ? `objectSet ${stableKey} [DISABLED]` : void 0);
122
123
  }
123
124
  const initialValue = objectTypeChanged ? void 0 : previousCompletedPayloadRef.current;
124
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => {
125
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => {
125
126
  const subscription = observableClient.observeObjectSet(baseObjectSet, {
126
127
  where: otherOptions.where,
127
128
  withProperties: otherOptions.withProperties,
@@ -177,7 +178,7 @@ function isPayloadCompleted(payload) {
177
178
  function useOsdkAction(actionDef) {
178
179
  const {
179
180
  observableClient
180
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
181
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
181
182
  const [error, setError] = React4__default.default.useState();
182
183
  const [data, setData] = React4__default.default.useState();
183
184
  const [isPending, setPending] = React4__default.default.useState(false);
@@ -244,9 +245,7 @@ function useOsdkAction(actionDef) {
244
245
  if (isPending) {
245
246
  return void 0;
246
247
  }
247
- if (abortControllerRef.current) {
248
- abortControllerRef.current.abort();
249
- }
248
+ abortControllerRef.current?.abort();
250
249
  const abortController = new AbortController();
251
250
  abortControllerRef.current = abortController;
252
251
  setValidating(true);
@@ -277,9 +276,7 @@ function useOsdkAction(actionDef) {
277
276
  }, [observableClient, actionDef, isPending]);
278
277
  React4__default.default.useEffect(() => {
279
278
  return () => {
280
- if (abortControllerRef.current) {
281
- abortControllerRef.current.abort();
282
- }
279
+ abortControllerRef.current?.abort();
283
280
  };
284
281
  }, []);
285
282
  return React4__default.default.useMemo(() => ({
@@ -304,7 +301,7 @@ function useOsdkAggregation(type, options) {
304
301
  const objectSet = "objectSet" in options ? options.objectSet : void 0;
305
302
  const {
306
303
  observableClient
307
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
304
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
308
305
  const canonWhere = observableClient.canonicalizeWhereClause(where);
309
306
  const stableCanonWhere = React4__default.default.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);
310
307
  const objectSetRef = React4__default.default.useRef(objectSet);
@@ -318,7 +315,7 @@ function useOsdkAggregation(type, options) {
318
315
  getSnapShot
319
316
  } = React4__default.default.useMemo(() => {
320
317
  if (objectSetKeyString && objectSetRef.current) {
321
- return chunkSVVMLSKN_cjs.makeExternalStoreAsync((observer) => observableClient.observeAggregation({
318
+ return chunkZUNR45SJ_cjs.makeExternalStoreAsync((observer) => observableClient.observeAggregation({
322
319
  type,
323
320
  objectSet: objectSetRef.current,
324
321
  where: stableCanonWhere,
@@ -328,7 +325,7 @@ function useOsdkAggregation(type, options) {
328
325
  dedupeInterval: dedupeIntervalMs ?? 2e3
329
326
  }, observer), process.env.NODE_ENV !== "production" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);
330
327
  }
331
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => (
328
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => (
332
329
  // eslint-disable-next-line @typescript-eslint/no-deprecated
333
330
  observableClient.observeAggregation({
334
331
  type,
@@ -362,7 +359,7 @@ function useOsdkAggregation(type, options) {
362
359
  function useOsdkFunction(queryDef, options = {}) {
363
360
  const {
364
361
  observableClient
365
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
362
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
366
363
  const {
367
364
  params,
368
365
  dependsOn,
@@ -384,12 +381,12 @@ function useOsdkFunction(queryDef, options = {}) {
384
381
  getSnapShot
385
382
  } = React4__default.default.useMemo(() => {
386
383
  if (!enabled) {
387
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
384
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
388
385
  unsubscribe: () => {
389
386
  }
390
387
  }), process.env.NODE_ENV !== "production" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);
391
388
  }
392
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeFunction(queryDef, paramsForApi, {
389
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeFunction(queryDef, paramsForApi, {
393
390
  dependsOn: stableDependsOn,
394
391
  dependsOnObjects: stableDependsOnObjects,
395
392
  dedupeInterval: dedupeIntervalMs ?? 2e3
@@ -413,7 +410,7 @@ function useOsdkFunction(queryDef, options = {}) {
413
410
  function useOsdkObject(...args) {
414
411
  const {
415
412
  observableClient
416
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
413
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
417
414
  const isInstanceSignature = "$objectType" in args[0];
418
415
  const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === "object" ? args[2] : void 0;
419
416
  const enabled = isInstanceSignature ? typeof args[1] === "boolean" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === "boolean" ? args[2] : true;
@@ -429,12 +426,12 @@ function useOsdkObject(...args) {
429
426
  getSnapShot
430
427
  } = React4__default.default.useMemo(() => {
431
428
  if (!enabled) {
432
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
429
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
433
430
  unsubscribe: () => {
434
431
  }
435
432
  }), `object ${apiNameString} ${primaryKey} [DISABLED]`);
436
433
  }
437
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeObject(typeOrApiName, primaryKey, {
434
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeObject(typeOrApiName, primaryKey, {
438
435
  mode,
439
436
  ...stableSelect ? {
440
437
  select: stableSelect
@@ -468,7 +465,7 @@ var EMPTY_WHERE2 = {};
468
465
  function useOsdkObjects(type, options) {
469
466
  const {
470
467
  observableClient
471
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
468
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
472
469
  const {
473
470
  pageSize,
474
471
  dedupeIntervalMs,
@@ -496,12 +493,12 @@ function useOsdkObjects(type, options) {
496
493
  getSnapShot
497
494
  } = React4__default.default.useMemo(() => {
498
495
  if (!enabled) {
499
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
496
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
500
497
  unsubscribe: () => {
501
498
  }
502
499
  }), process.env.NODE_ENV !== "production" ? `list ${type.apiName} [DISABLED]` : void 0);
503
500
  }
504
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeList({
501
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeList({
505
502
  type,
506
503
  rids: stableRids,
507
504
  where: stableCanonWhere,
@@ -579,13 +576,13 @@ function useDebouncedCallback(callback, delay) {
579
576
  });
580
577
  }
581
578
 
582
- Object.defineProperty(exports, "useOsdkClient", {
579
+ Object.defineProperty(exports, "useOsdkMetadata", {
583
580
  enumerable: true,
584
- get: function () { return chunkOVBG5VXE_cjs.useOsdkClient; }
581
+ get: function () { return chunkR4FZ5MUH_cjs.useOsdkMetadata; }
585
582
  });
586
- Object.defineProperty(exports, "useOsdkMetadata", {
583
+ Object.defineProperty(exports, "useOsdkClient", {
587
584
  enumerable: true,
588
- get: function () { return chunkOVBG5VXE_cjs.useOsdkMetadata; }
585
+ get: function () { return chunk2N32USW5_cjs.useOsdkClient; }
589
586
  });
590
587
  exports.OsdkProvider2 = OsdkProvider2;
591
588
  exports.useDebouncedCallback = useDebouncedCallback;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/new/OsdkProvider2.tsx","../../../src/new/useLinks.ts","../../../src/new/useObjectSet.tsx","../../../src/new/useOsdkAction.ts","../../../src/new/useOsdkAggregation.ts","../../../src/new/useOsdkFunction.ts","../../../src/new/useOsdkObject.ts","../../../src/new/useOsdkObjects.ts","../../../src/utils/useDebouncedCallback.ts"],"names":["useMemo","createObservableClient","React","OsdkContext2","OsdkContext","makeExternalStore","computeObjectSetCacheKey","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","getWireObjectSet","EMPTY_WHERE"],"mappings":";;;;;;;;;;;;AAoBO,SAAS,aAAc,CAAA;AAAA,EAC5B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAmB,gBAAA,GAAAA,cAAA,CAAQ,MAAM,gBAAoB,IAAAC,uCAAA,CAAuB,MAAM,CAAG,EAAA,CAAC,MAAQ,EAAA,gBAAgB,CAAC,CAAA;AAC/G,EAAoB,uBAAAC,uBAAA,CAAM,aAAc,CAAAC,8BAAA,CAAa,QAAU,EAAA;AAAA,IAC7D,KAAO,EAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA;AACF,GACc,kBAAAD,uBAAA,CAAM,aAAc,CAAAE,6BAAA,CAAY,QAAU,EAAA;AAAA,IACxD,KAAO,EAAA;AAAA,MACL;AAAA;AACF,GACF,EAAG,QAAQ,CAAC,CAAA;AACd;ACjBA,IAAM,UAAa,GAAA,MAAA,CAAO,MAAO,CAAA,EAAE,CAAA;AACnC,IAAM,QAAA,uBAAe,GAAI,EAAA;AAUlB,SAAS,QAAS,CAAA,OAAA,EAAS,QAAU,EAAA,OAAA,GAAU,EAAI,EAAA;AACxD,EAAM,MAAA;AAAA,IACJ;AAAA,GACF,GAAIF,uBAAM,CAAA,UAAA,CAAWC,8BAAY,CAAA;AACjC,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,IAAA;AAAA,IACV,GAAG;AAAA,GACD,GAAA,OAAA;AACJ,EAAA,MAAM,WAAcD,GAAAA,uBAAAA,CAAM,OAAQ,CAAA,MAAM,YAAa,CAAA,KAAA,EAAO,CAAC,IAAA,CAAK,SAAU,CAAA,YAAA,CAAa,KAAK,CAAC,CAAC,CAAA;AAChG,EAAA,MAAM,aAAgBA,GAAAA,u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A,GACF,EAAG,CAAC,MAAM,CAAC,CAAA;AACX,EAAO,OAAA,MAAA,CAAO,OAAO,iBAAmB,EAAA;AAAA,IACtC,MAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"experimental.cjs","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 { createObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React, { useMemo } from \"react\";\nimport { OsdkContext } from \"../OsdkContext.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function OsdkProvider2({\n children,\n client,\n observableClient\n}) {\n observableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);\n return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {\n value: {\n client,\n observableClient\n }\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: {\n client\n }\n }, children));\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst emptyArray = Object.freeze([]);\nconst emptyMap = new Map();\n\n/**\n * Hook to observe links from an object or array of objects.\n *\n * @param objects The source object(s) to observe links from\n * @param linkName The name of the link to observe\n * @param options Optional configuration for the link query\n * @returns UseLinksResult with links data and metadata\n */\nexport function useLinks(objects, linkName, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n ...otherOptions\n } = options;\n const stableWhere = React.useMemo(() => otherOptions.where, [JSON.stringify(otherOptions.where)]);\n const stableOrderBy = React.useMemo(() => otherOptions.orderBy, [JSON.stringify(otherOptions.orderBy)]);\n const stableSelect = React.useMemo(() => otherOptions.$select, [JSON.stringify(otherOptions.$select)]);\n const objectsKey = React.useMemo(() => {\n if (objects === undefined) return \"\";\n const arr = Array.isArray(objects) ? objects : [objects];\n return arr.map(obj => `${obj.$apiName}:${obj.$primaryKey}`).join(\",\");\n }, [objects]);\n\n // Convert single object to array for consistent handling\n const objectsArray = React.useMemo(() => {\n return objects === undefined ? emptyArray : Array.isArray(objects) ? objects : [objects];\n }, [objectsKey, objects]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `links ${linkName} for ${objectsKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeLinks(objectsArray, linkName, {\n linkName,\n where: stableWhere,\n pageSize: otherOptions.pageSize,\n orderBy: stableOrderBy,\n mode: otherOptions.mode,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), `links ${linkName} for ${objectsKey}`);\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, stableWhere, otherOptions.pageSize, stableOrderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, stableSelect]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => ({\n links: payload?.resolvedList,\n linkedObjectsBySourcePrimaryKey: payload?.linkedObjectsBySourcePrimaryKey ?? emptyMap,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: payload?.isOptimistic ?? false,\n error: payload?.error,\n fetchMore: payload?.hasMore ? payload?.fetchMore : undefined,\n hasMore: payload?.hasMore ?? false\n }), [payload, enabled]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst OBJECT_TYPE_PLACEHOLDER = \"$__OBJECT__TYPE__PLACEHOLDER\";\n/**\n * React hook for observing and interacting with OSDK object sets.\n *\n * @typeParam Q - The object type definition\n * @typeParam BaseRDPs - Derived properties that already exist on the input ObjectSet\n * @typeParam RDPs - New derived properties to be added via options.withProperties\n *\n * @param baseObjectSet - The ObjectSet to observe (may already have derived properties)\n * @param options - Options for filtering, sorting, and adding new derived properties\n * @returns Object set data with both existing and new derived properties\n */\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n streamUpdates,\n ...otherOptions\n } = options;\n\n // Track object type to detect when we switch to a different object type\n const objectTypeKey = enabled ? baseObjectSet.$objectSetInternals.def.apiName : OBJECT_TYPE_PLACEHOLDER;\n const previousObjectTypeRef = React.useRef(objectTypeKey);\n const previousCompletedPayloadRef = React.useRef();\n const objectTypeChanged = previousObjectTypeRef.current !== objectTypeKey;\n if (objectTypeChanged) {\n previousObjectTypeRef.current = objectTypeKey;\n previousCompletedPayloadRef.current = undefined;\n }\n\n // Compute a stable cache key for the ObjectSet and options\n // dedupeIntervalMs and enabled are excluded as they don't affect the data\n const stableKey = computeObjectSetCacheKey(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n select: otherOptions.$select\n });\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey} [DISABLED]` : void 0);\n }\n const initialValue = objectTypeChanged ? undefined : previousCompletedPayloadRef.current;\n return makeExternalStore(observer => {\n const subscription = observableClient.observeObjectSet(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n autoFetchMore: otherOptions.autoFetchMore,\n streamUpdates,\n select: otherOptions.$select\n }, observer);\n return subscription;\n }, process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey}` : void 0, initialValue);\n }, [enabled, observableClient, stableKey, streamUpdates, objectTypeChanged]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n if (payload && isPayloadCompleted(payload)) {\n previousCompletedPayloadRef.current = payload;\n }\n return React.useMemo(() => {\n const lastLoaded = isPayloadCompleted(payload) ? payload : previousCompletedPayloadRef.current;\n return {\n data: lastLoaded?.resolvedList,\n isLoading: !isPayloadCompleted(payload),\n error: lastLoaded && \"error\" in lastLoaded ? lastLoaded.error : undefined,\n fetchMore: payload?.hasMore ? payload.fetchMore : undefined,\n objectSet: payload?.objectSet || baseObjectSet,\n totalCount: lastLoaded?.totalCount\n };\n }, [payload, baseObjectSet]);\n}\nfunction isPayloadCompleted(payload) {\n if (payload != null && \"error\" in payload) {\n return true;\n }\n if (payload?.status == null) {\n return false;\n }\n switch (payload.status) {\n case \"loaded\":\n case \"error\":\n return true;\n case \"loading\":\n case \"init\":\n return false;\n default:\n payload.status;\n return false;\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ActionValidationError } from \"@osdk/client\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState();\n const [data, setData] = React.useState();\n const [isPending, setPending] = React.useState(false);\n const [isValidating, setValidating] = React.useState(false);\n const [validationResult, setValidationResult] = React.useState();\n const abortControllerRef = React.useRef(null);\n const applyAction = React.useCallback(async function applyAction(hookArgs) {\n try {\n // If validation is in progress, abort it\n if (isValidating && abortControllerRef.current) {\n abortControllerRef.current.abort();\n setValidating(false);\n }\n setPending(true);\n setError(undefined);\n if (Array.isArray(hookArgs)) {\n const updates = [];\n const args = hookArgs.map(a => {\n const {\n $optimisticUpdate,\n ...args\n } = a;\n if ($optimisticUpdate) {\n updates.push($optimisticUpdate);\n }\n return args;\n });\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: ctx => {\n for (const update of updates) {\n update?.(ctx);\n }\n }\n });\n setData(r);\n return r;\n } else {\n const {\n $optimisticUpdate,\n ...args\n } = hookArgs;\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate\n });\n setData(r);\n return r;\n }\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setPending(false);\n }\n }, [observableClient, actionDef, isValidating]);\n const validateAction = React.useCallback(async function validateAction(args) {\n try {\n // Check if action is being applied\n if (isPending) {\n return undefined;\n }\n\n // Abort any existing validation\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n // Create new AbortController\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n setValidating(true);\n setError(undefined);\n const result = await observableClient.validateAction(actionDef, args);\n\n // Check if aborted\n if (abortController.signal.aborted) {\n return undefined;\n }\n setValidationResult(result);\n return result;\n } catch (e) {\n // Check if it was aborted\n if (e instanceof Error && e.name === \"AbortError\") {\n return undefined;\n }\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setValidating(false);\n }\n }, [observableClient, actionDef, isPending]);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n return React.useMemo(() => ({\n applyAction,\n validateAction,\n error,\n data,\n isPending,\n isValidating,\n validationResult\n }), [applyAction, validateAction, error, data, isPending, isValidating, validationResult]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\n\n/**\n * React hook for performing aggregations on OSDK object sets.\n *\n * Executes server-side aggregations with groupBy and metric calculations on filtered object sets.\n * Supports runtime derived properties and where clauses.\n *\n * @param type - The object or interface type to aggregate\n * @param options - Aggregation configuration including where clause, aggregation spec, and optional derived properties\n * @returns Object containing aggregation results, loading state, error state, and refetch function\n *\n * @example\n * ```tsx\n * // Basic aggregation without ObjectSet\n * const { data, isLoading, error } = useOsdkAggregation(Employee, {\n * where: { department: \"Engineering\" },\n * aggregate: {\n * groupBy: { department: \"exact\" },\n * select: {\n * avgSalary: { $avg: \"salary\" },\n * count: { $count: {} }\n * }\n * }\n * });\n *\n * // With a pivoted ObjectSet\n * const pivotedSet = useMemo(() => $(Employee).pivotTo(\"primaryOffice\"), []);\n * const { data } = useOsdkAggregation(Office, {\n * objectSet: pivotedSet,\n * aggregate: { $select: { $count: \"unordered\" } }\n * });\n * ```\n */\n\nexport function useOsdkAggregation(type, options) {\n const {\n where = EMPTY_WHERE,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const canonWhere = observableClient.canonicalizeWhereClause(where);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n const objectSetKeyString = objectSet ? computeObjectSetCacheKey(objectSet) : undefined;\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableAggregate = React.useMemo(() => aggregate, [JSON.stringify(aggregate)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (objectSetKeyString && objectSetRef.current) {\n return makeExternalStoreAsync(observer => observableClient.observeAggregation({\n type: type,\n objectSet: objectSetRef.current,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }\n return makeExternalStore(observer =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation({\n type: type,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [observableClient, type.apiName, type.type, objectSetKeyString, stableCanonWhere, stableWithProperties, stableIntersectWith, stableAggregate, dedupeIntervalMs]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to execute aggregation\");\n }\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\" || payload?.status === \"init\" || !payload,\n error,\n refetch\n };\n }, [payload, refetch]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n/**\n * React hook for executing and observing OSDK functions.\n *\n * Provides automatic caching, deduplication, and reactive updates for function calls.\n * Functions are automatically re-fetched when dependencies change (configured via options).\n *\n * @param queryDef - The QueryDefinition to execute\n * @param options - Configuration options for the function call\n * @returns Object containing result, loading state, error, and refetch function\n *\n * @example Basic usage\n * ```tsx\n * const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {\n * params: { departmentId: \"engineering\" }\n * });\n * ```\n *\n * @example With dependency tracking\n * ```tsx\n * const { data, refetch } = useOsdkFunction(calculateMetrics, {\n * params: { startDate, endDate },\n * dependsOn: [Employee, Project],\n * });\n * ```\n *\n * @example With specific object dependencies\n * ```tsx\n * const { data } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee.$primaryKey },\n * dependsOnObjects: [employee],\n * });\n * ```\n */\nexport function useOsdkFunction(queryDef, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true\n } = options;\n const stableParams = React.useMemo(() => params, [JSON.stringify(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn, [JSON.stringify(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects, [JSON.stringify(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : {\n __objectSet: getWireObjectSet(item)\n }))]);\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)}` : void 0);\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(() => {\n void observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n return React.useMemo(() => {\n const error = payload?.error ?? (payload?.status === \"error\" ? new Error(\"Failed to execute function\") : undefined);\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch\n };\n }, [payload, refetch]);\n}","/*\n * Copyright 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 { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\n/**\n * @param obj an existing `Osdk.Instance` object to get metadata for.\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key with options.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param options Options including $select, enabled, and $loadPropertySecurityMetadata\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n\n // Check if first arg is an instance to discriminate signatures\n // TypeScript cannot narrow rest parameter unions with optional parameters,\n // so we must use type assertions after runtime discrimination\n const isInstanceSignature = \"$objectType\" in args[0];\n\n // Extract options object if provided (3rd arg is an object with $select or enabled)\n const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === \"object\" ? args[2] : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature ? typeof args[1] === \"boolean\" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === \"boolean\" ? args[2] : true;\n const selectArg = optionsArg?.$select;\n const loadPropertySecurityMetadata = optionsArg?.$loadPropertySecurityMetadata;\n const mode = isInstanceSignature ? \"offline\" : undefined;\n const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];\n const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];\n const apiNameString = typeof typeOrApiName === \"string\" ? typeOrApiName : typeOrApiName.apiName;\n const stableSelect = React.useMemo(() => selectArg, [JSON.stringify(selectArg)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `object ${apiNameString} ${primaryKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...(loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata\n } : {})\n }, observer), `object ${apiNameString} ${primaryKey}`);\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to load object\");\n }\n return {\n object: payload?.object,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate\n };\n }, [payload, enabled, forceUpdate]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\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 } = options ?? {};\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const stableOrderBy = React.useMemo(() => orderBy, [JSON.stringify(orderBy)]);\n const stableSelect = React.useMemo(() => $select, [JSON.stringify($select)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith ? {\n intersectWith: stableIntersectWith\n } : {}),\n ...(pivotTo ? {\n pivotTo\n } : {}),\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...($loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata\n } : {})\n }, observer), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : \"\"} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect, $loadPropertySecurityMetadata]);\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => {\n let error;\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 return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled ? listPayload?.status === \"loading\" || listPayload?.status === \"init\" || !listPayload : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount\n };\n }, [listPayload, enabled]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n/**\n * Creates a debounced version of a callback function.\n *\n * @param callback The function to debounce\n * @param delay The delay in milliseconds\n * @returns A debounced function with cancel() and flush() methods\n *\n * @example\n * ```tsx\n * const { applyAction } = useOsdkAction(editOffice);\n *\n * const debouncedSave = useDebouncedCallback(\n * async (name: string) => {\n * await applyAction({\n * Office: office,\n * name,\n * location: office.location!,\n * $optimisticUpdate: (ctx) => {\n * ctx.updateObject(office.$clone({ name }));\n * },\n * });\n * },\n * 1000\n * );\n *\n * <input onChange={(e) => debouncedSave(e.target.value)} />\n * ```\n */\nexport function useDebouncedCallback(callback, delay) {\n const timeoutRef = React.useRef();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef();\n callbackRef.current = callback;\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n const flush = React.useCallback(() => {\n if (timeoutRef.current && lastArgsRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n void callbackRef.current(...lastArgsRef.current);\n }\n }, []);\n const debouncedCallback = React.useCallback((...args) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n }, [delay, cancel]);\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n return Object.assign(debouncedCallback, {\n cancel,\n flush\n });\n}"]}
1
+ {"version":3,"sources":["../../../src/new/OsdkProvider2.tsx","../../../src/new/useLinks.ts","../../../src/new/useObjectSet.tsx","../../../src/new/useOsdkAction.ts","../../../src/new/useOsdkAggregation.ts","../../../src/new/useOsdkFunction.ts","../../../src/new/useOsdkObject.ts","../../../src/new/useOsdkObjects.ts","../../../src/utils/useDebouncedCallback.ts"],"names":["useMemo","createObservableClient","React","OsdkContext2","OsdkContext","makeExternalStore","computeObjectSetCacheKey","applyAction","args","ActionValidationError","validateAction","makeExternalStoreAsync","getWireObjectSet","EMPTY_WHERE"],"mappings":";;;;;;;;;;;;;AAoBO,SAAS,aAAc,CAAA;AAAA,EAC5B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAG,EAAA;AACD,EAAmB,gBAAA,GAAAA,cAAA,CAAQ,MAAM,gBAAoB,IAAAC,uCAAA,CAAuB,MAAM,CAAG,EAAA,CAAC,MAAQ,EAAA,gBAAgB,CAAC,CAAA;AAC/G,EAAoB,uBAAAC,uBAAA,CAAM,aAAc,CAAAC,8BAAA,CAAa,QAAU,EAAA;AAAA,IAC7D,KAAO,EAAA;AAAA,MACL,MAAA;AAAA,MACA;AAAA;AACF,GACc,kBAAAD,uBAAA,CAAM,aAAc,CAAAE,6BAAA,CAAY,QAAU,EAAA;AAAA,IACxD,KAAO,EAAA;AAAA,MACL;AAAA;AACF,GACF,EAAG,QAAQ,CAAC,CAAA;AACd;ACjBA,IAAM,UAAa,GAAA,MAAA,CAAO,MAAO,CAAA,EAAE,CAAA;AACnC,IAAM,QAAA,uBAAe,GAAI,EAAA;AAUlB,SAAS,QAAS,CAAA,OAAA,EAAS,QAAU,EAAA,OAAA,GAAU,EAAI,EAAA;AACxD,EAAM,MAAA;AAAA,IACJ;AAAA,GACF,GAAIF,uBAAM,CAAA,UAAA,CAAWC,8BAAY,CAAA;AACjC,EAAM,MAAA;AAAA,IACJ,OAAU,GAAA,IAAA;AAAA,IACV,GAAG;AAAA,GACD,GAAA,OAAA;AACJ,EAAA,MAAM,WAAcD,GAAAA,uBAAAA,CAAM,OAAQ,CAAA,MAAM,YAAa,CAAA,KAAA,EAAO,CAAC,IAAA,CAAK,SAAU,CAAA,YAAA,CAAa,KAAK,CAAC,CAAC,CAAA;AAChG,EAAA,MAAM,aAAgBA,GAAAA,uBAAAA,CAAM,OAAQ,CAAA,MAAM,YAAa,CAAA,OAAA,EAAS,CAAC,IAAA,CAAK,SAAU,CAA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Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createObservableClient } from \"@osdk/client/unstable-do-not-use\";\nimport React, { useMemo } from \"react\";\nimport { OsdkContext } from \"../OsdkContext.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function OsdkProvider2({\n children,\n client,\n observableClient\n}) {\n observableClient = useMemo(() => observableClient ?? createObservableClient(client), [client, observableClient]);\n return /*#__PURE__*/React.createElement(OsdkContext2.Provider, {\n value: {\n client,\n observableClient\n }\n }, /*#__PURE__*/React.createElement(OsdkContext.Provider, {\n value: {\n client\n }\n }, children));\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst emptyArray = Object.freeze([]);\nconst emptyMap = new Map();\n\n/**\n * Hook to observe links from an object or array of objects.\n *\n * @param objects The source object(s) to observe links from\n * @param linkName The name of the link to observe\n * @param options Optional configuration for the link query\n * @returns UseLinksResult with links data and metadata\n */\nexport function useLinks(objects, linkName, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n ...otherOptions\n } = options;\n const stableWhere = React.useMemo(() => otherOptions.where, [JSON.stringify(otherOptions.where)]);\n const stableOrderBy = React.useMemo(() => otherOptions.orderBy, [JSON.stringify(otherOptions.orderBy)]);\n const stableSelect = React.useMemo(() => otherOptions.$select, [JSON.stringify(otherOptions.$select)]);\n const objectsKey = React.useMemo(() => {\n if (objects === undefined) return \"\";\n const arr = Array.isArray(objects) ? objects : [objects];\n return arr.map(obj => `${obj.$apiName}:${obj.$primaryKey}`).join(\",\");\n }, [objects]);\n\n // Convert single object to array for consistent handling\n const objectsArray = React.useMemo(() => {\n return objects === undefined ? emptyArray : Array.isArray(objects) ? objects : [objects];\n }, [objectsKey, objects]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `links ${linkName} for ${objectsKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeLinks(objectsArray, linkName, {\n linkName,\n where: stableWhere,\n pageSize: otherOptions.pageSize,\n orderBy: stableOrderBy,\n mode: otherOptions.mode,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n ...(stableSelect ? {\n select: stableSelect\n } : {})\n }, observer), `links ${linkName} for ${objectsKey}`);\n }, [enabled, observableClient, objectsArray, objectsKey, linkName, stableWhere, otherOptions.pageSize, stableOrderBy, otherOptions.mode, otherOptions.dedupeIntervalMs, stableSelect]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => ({\n links: payload?.resolvedList,\n linkedObjectsBySourcePrimaryKey: payload?.linkedObjectsBySourcePrimaryKey ?? emptyMap,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: payload?.isOptimistic ?? false,\n error: payload?.error,\n fetchMore: payload?.hasMore ? payload?.fetchMore : undefined,\n hasMore: payload?.hasMore ?? false\n }), [payload, enabled]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst OBJECT_TYPE_PLACEHOLDER = \"$__OBJECT__TYPE__PLACEHOLDER\";\n/**\n * React hook for observing and interacting with OSDK object sets.\n *\n * @typeParam Q - The object type definition\n * @typeParam BaseRDPs - Derived properties that already exist on the input ObjectSet\n * @typeParam RDPs - New derived properties to be added via options.withProperties\n *\n * @param baseObjectSet - The ObjectSet to observe (may already have derived properties)\n * @param options - Options for filtering, sorting, and adding new derived properties\n * @returns Object set data with both existing and new derived properties\n */\nexport function useObjectSet(baseObjectSet, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n enabled = true,\n streamUpdates,\n ...otherOptions\n } = options;\n\n // Track object type to detect when we switch to a different object type\n const objectTypeKey = enabled ? baseObjectSet.$objectSetInternals.def.apiName : OBJECT_TYPE_PLACEHOLDER;\n const previousObjectTypeRef = React.useRef(objectTypeKey);\n const previousCompletedPayloadRef = React.useRef();\n const objectTypeChanged = previousObjectTypeRef.current !== objectTypeKey;\n if (objectTypeChanged) {\n previousObjectTypeRef.current = objectTypeKey;\n previousCompletedPayloadRef.current = undefined;\n }\n\n // Compute a stable cache key for the ObjectSet and options\n // dedupeIntervalMs and enabled are excluded as they don't affect the data\n const stableKey = computeObjectSetCacheKey(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n select: otherOptions.$select\n });\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey} [DISABLED]` : void 0);\n }\n const initialValue = objectTypeChanged ? undefined : previousCompletedPayloadRef.current;\n return makeExternalStore(observer => {\n const subscription = observableClient.observeObjectSet(baseObjectSet, {\n where: otherOptions.where,\n withProperties: otherOptions.withProperties,\n union: otherOptions.union,\n intersect: otherOptions.intersect,\n subtract: otherOptions.subtract,\n pivotTo: otherOptions.pivotTo,\n pageSize: otherOptions.pageSize,\n orderBy: otherOptions.orderBy,\n dedupeInterval: otherOptions.dedupeIntervalMs ?? 2_000,\n autoFetchMore: otherOptions.autoFetchMore,\n streamUpdates,\n select: otherOptions.$select\n }, observer);\n return subscription;\n }, process.env.NODE_ENV !== \"production\" ? `objectSet ${stableKey}` : void 0, initialValue);\n }, [enabled, observableClient, stableKey, streamUpdates, objectTypeChanged]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n if (payload && isPayloadCompleted(payload)) {\n previousCompletedPayloadRef.current = payload;\n }\n return React.useMemo(() => {\n const lastLoaded = isPayloadCompleted(payload) ? payload : previousCompletedPayloadRef.current;\n return {\n data: lastLoaded?.resolvedList,\n isLoading: !isPayloadCompleted(payload),\n error: lastLoaded && \"error\" in lastLoaded ? lastLoaded.error : undefined,\n fetchMore: payload?.hasMore ? payload.fetchMore : undefined,\n objectSet: payload?.objectSet || baseObjectSet,\n totalCount: lastLoaded?.totalCount\n };\n }, [payload, baseObjectSet]);\n}\nfunction isPayloadCompleted(payload) {\n if (payload != null && \"error\" in payload) {\n return true;\n }\n if (payload?.status == null) {\n return false;\n }\n switch (payload.status) {\n case \"loaded\":\n case \"error\":\n return true;\n case \"loading\":\n case \"init\":\n return false;\n default:\n payload.status;\n return false;\n }\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ActionValidationError } from \"@osdk/client\";\nimport React from \"react\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nexport function useOsdkAction(actionDef) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const [error, setError] = React.useState();\n const [data, setData] = React.useState();\n const [isPending, setPending] = React.useState(false);\n const [isValidating, setValidating] = React.useState(false);\n const [validationResult, setValidationResult] = React.useState();\n const abortControllerRef = React.useRef(null);\n const applyAction = React.useCallback(async function applyAction(hookArgs) {\n try {\n // If validation is in progress, abort it\n if (isValidating && abortControllerRef.current) {\n abortControllerRef.current.abort();\n setValidating(false);\n }\n setPending(true);\n setError(undefined);\n if (Array.isArray(hookArgs)) {\n const updates = [];\n const args = hookArgs.map(a => {\n const {\n $optimisticUpdate,\n ...args\n } = a;\n if ($optimisticUpdate) {\n updates.push($optimisticUpdate);\n }\n return args;\n });\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: ctx => {\n for (const update of updates) {\n update?.(ctx);\n }\n }\n });\n setData(r);\n return r;\n } else {\n const {\n $optimisticUpdate,\n ...args\n } = hookArgs;\n const r = await observableClient.applyAction(actionDef, args, {\n optimisticUpdate: $optimisticUpdate\n });\n setData(r);\n return r;\n }\n } catch (e) {\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setPending(false);\n }\n }, [observableClient, actionDef, isValidating]);\n const validateAction = React.useCallback(async function validateAction(args) {\n try {\n // Check if action is being applied\n if (isPending) {\n return undefined;\n }\n\n // Abort any existing validation\n abortControllerRef.current?.abort();\n\n // Create new AbortController\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n setValidating(true);\n setError(undefined);\n const result = await observableClient.validateAction(actionDef, args);\n\n // Check if aborted\n if (abortController.signal.aborted) {\n return undefined;\n }\n setValidationResult(result);\n return result;\n } catch (e) {\n // Check if it was aborted\n if (e instanceof Error && e.name === \"AbortError\") {\n return undefined;\n }\n if (e instanceof ActionValidationError) {\n setError({\n actionValidation: e\n });\n } else {\n setError({\n unknown: e\n });\n }\n throw e;\n } finally {\n setValidating(false);\n }\n }, [observableClient, actionDef, isPending]);\n\n // Cleanup on unmount\n React.useEffect(() => {\n return () => {\n abortControllerRef.current?.abort();\n };\n }, []);\n return React.useMemo(() => ({\n applyAction,\n validateAction,\n error,\n data,\n isPending,\n isValidating,\n validationResult\n }), [applyAction, validateAction, error, data, isPending, isValidating, validationResult]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { computeObjectSetCacheKey } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore, makeExternalStoreAsync } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\n\n/**\n * React hook for performing aggregations on OSDK object sets.\n *\n * Executes server-side aggregations with groupBy and metric calculations on filtered object sets.\n * Supports runtime derived properties and where clauses.\n *\n * @param type - The object or interface type to aggregate\n * @param options - Aggregation configuration including where clause, aggregation spec, and optional derived properties\n * @returns Object containing aggregation results, loading state, error state, and refetch function\n *\n * @example\n * ```tsx\n * // Basic aggregation without ObjectSet\n * const { data, isLoading, error } = useOsdkAggregation(Employee, {\n * where: { department: \"Engineering\" },\n * aggregate: {\n * groupBy: { department: \"exact\" },\n * select: {\n * avgSalary: { $avg: \"salary\" },\n * count: { $count: {} }\n * }\n * }\n * });\n *\n * // With a pivoted ObjectSet\n * const pivotedSet = useMemo(() => $(Employee).pivotTo(\"primaryOffice\"), []);\n * const { data } = useOsdkAggregation(Office, {\n * objectSet: pivotedSet,\n * aggregate: { $select: { $count: \"unordered\" } }\n * });\n * ```\n */\n\nexport function useOsdkAggregation(type, options) {\n const {\n where = EMPTY_WHERE,\n withProperties,\n intersectWith,\n aggregate,\n dedupeIntervalMs\n } = options;\n const objectSet = \"objectSet\" in options ? options.objectSet : undefined;\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const canonWhere = observableClient.canonicalizeWhereClause(where);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const objectSetRef = React.useRef(objectSet);\n objectSetRef.current = objectSet;\n const objectSetKeyString = objectSet ? computeObjectSetCacheKey(objectSet) : undefined;\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableAggregate = React.useMemo(() => aggregate, [JSON.stringify(aggregate)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (objectSetKeyString && objectSetRef.current) {\n return makeExternalStoreAsync(observer => observableClient.observeAggregation({\n type: type,\n objectSet: objectSetRef.current,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }\n return makeExternalStore(observer =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n observableClient.observeAggregation({\n type: type,\n where: stableCanonWhere,\n withProperties: stableWithProperties,\n intersectWith: stableIntersectWith,\n aggregate: stableAggregate,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `aggregation ${type.apiName} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [observableClient, type.apiName, type.type, objectSetKeyString, stableCanonWhere, stableWithProperties, stableIntersectWith, stableAggregate, dedupeIntervalMs]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(async () => {\n await observableClient.invalidateObjectType(type.apiName);\n }, [observableClient, type.apiName]);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to execute aggregation\");\n }\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\" || payload?.status === \"init\" || !payload,\n error,\n refetch\n };\n }, [payload, refetch]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getWireObjectSet } from \"@osdk/client/unstable-do-not-use\";\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n/**\n * React hook for executing and observing OSDK functions.\n *\n * Provides automatic caching, deduplication, and reactive updates for function calls.\n * Functions are automatically re-fetched when dependencies change (configured via options).\n *\n * @param queryDef - The QueryDefinition to execute\n * @param options - Configuration options for the function call\n * @returns Object containing result, loading state, error, and refetch function\n *\n * @example Basic usage\n * ```tsx\n * const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {\n * params: { departmentId: \"engineering\" }\n * });\n * ```\n *\n * @example With dependency tracking\n * ```tsx\n * const { data, refetch } = useOsdkFunction(calculateMetrics, {\n * params: { startDate, endDate },\n * dependsOn: [Employee, Project],\n * });\n * ```\n *\n * @example With specific object dependencies\n * ```tsx\n * const { data } = useOsdkFunction(getEmployeeReport, {\n * params: { employeeId: employee.$primaryKey },\n * dependsOnObjects: [employee],\n * });\n * ```\n */\nexport function useOsdkFunction(queryDef, options = {}) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n const {\n params,\n dependsOn,\n dependsOnObjects,\n dedupeIntervalMs,\n enabled = true\n } = options;\n const stableParams = React.useMemo(() => params, [JSON.stringify(params)]);\n const stableDependsOn = React.useMemo(() => dependsOn, [JSON.stringify(dependsOn?.map(d => typeof d === \"string\" ? d : d.apiName))]);\n const stableDependsOnObjects = React.useMemo(() => dependsOnObjects, [JSON.stringify(dependsOnObjects?.map(item => \"$apiName\" in item ? {\n $apiName: item.$apiName,\n $primaryKey: item.$primaryKey\n } : {\n __objectSet: getWireObjectSet(item)\n }))]);\n\n // Record<string, unknown> required as typing is figured out at runtime\n const paramsForApi = stableParams;\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeFunction(queryDef, paramsForApi, {\n dependsOn: stableDependsOn,\n dependsOnObjects: stableDependsOnObjects,\n dedupeInterval: dedupeIntervalMs ?? 2_000\n }, observer), process.env.NODE_ENV !== \"production\" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)}` : void 0);\n }, [observableClient, queryDef.apiName, queryDef.version, paramsForApi, stableDependsOn, stableDependsOnObjects, dedupeIntervalMs, enabled]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const refetch = React.useCallback(() => {\n void observableClient.invalidateFunction(queryDef, paramsForApi);\n }, [observableClient, queryDef, paramsForApi]);\n return React.useMemo(() => {\n const error = payload?.error ?? (payload?.status === \"error\" ? new Error(\"Failed to execute function\") : undefined);\n return {\n data: payload?.result,\n isLoading: payload?.status === \"loading\",\n error,\n lastUpdated: payload?.lastUpdated ?? 0,\n refetch\n };\n }, [payload, refetch]);\n}","/*\n * Copyright 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 { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\n\n/**\n * @param obj an existing `Osdk.Instance` object to get metadata for.\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param enabled Enable or disable the query (defaults to true)\n */\n\n/**\n * Loads an object or interface instance by type and primary key with options.\n *\n * @param type The object type or interface definition\n * @param primaryKey The primary key of the object\n * @param options Options including $select, enabled, and $loadPropertySecurityMetadata\n */\n\n/*\n Implementation of useOsdkObject\n */\nexport function useOsdkObject(...args) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\n\n // Check if first arg is an instance to discriminate signatures\n // TypeScript cannot narrow rest parameter unions with optional parameters,\n // so we must use type assertions after runtime discrimination\n const isInstanceSignature = \"$objectType\" in args[0];\n\n // Extract options object if provided (3rd arg is an object with $select or enabled)\n const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === \"object\" ? args[2] : undefined;\n\n // Extract enabled flag - 2nd param for instance signature, 3rd for type signature\n const enabled = isInstanceSignature ? typeof args[1] === \"boolean\" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === \"boolean\" ? args[2] : true;\n const selectArg = optionsArg?.$select;\n const loadPropertySecurityMetadata = optionsArg?.$loadPropertySecurityMetadata;\n const mode = isInstanceSignature ? \"offline\" : undefined;\n const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];\n const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];\n const apiNameString = typeof typeOrApiName === \"string\" ? typeOrApiName : typeOrApiName.apiName;\n const stableSelect = React.useMemo(() => selectArg, [JSON.stringify(selectArg)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), `object ${apiNameString} ${primaryKey} [DISABLED]`);\n }\n return makeExternalStore(observer => observableClient.observeObject(typeOrApiName, primaryKey, {\n mode,\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...(loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata: loadPropertySecurityMetadata\n } : {})\n }, observer), `object ${apiNameString} ${primaryKey}`);\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n const forceUpdate = React.useCallback(() => {\n throw new Error(\"not implemented\");\n }, []);\n return React.useMemo(() => {\n let error;\n if (payload && \"error\" in payload && payload.error) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(\"Failed to load object\");\n }\n return {\n object: payload?.object,\n isLoading: enabled ? payload?.status === \"loading\" || payload?.status === \"init\" || !payload : false,\n isOptimistic: !!payload?.isOptimistic,\n error,\n forceUpdate\n };\n }, [payload, enabled, forceUpdate]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { makeExternalStore } from \"./makeExternalStore.js\";\nimport { OsdkContext2 } from \"./OsdkContext2.js\";\nconst EMPTY_WHERE = {};\nexport function useOsdkObjects(type, options) {\n const {\n observableClient\n } = React.useContext(OsdkContext2);\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 } = options ?? {};\n const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE);\n const stableCanonWhere = React.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);\n const stableRids = React.useMemo(() => rids, [JSON.stringify(rids)]);\n const stableWithProperties = React.useMemo(() => withProperties, [JSON.stringify(withProperties)]);\n const stableIntersectWith = React.useMemo(() => intersectWith, [JSON.stringify(intersectWith)]);\n const stableOrderBy = React.useMemo(() => orderBy, [JSON.stringify(orderBy)]);\n const stableSelect = React.useMemo(() => $select, [JSON.stringify($select)]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} [DISABLED]` : void 0);\n }\n return makeExternalStore(observer => observableClient.observeList({\n type,\n rids: stableRids,\n where: stableCanonWhere,\n dedupeInterval: dedupeIntervalMs ?? 2_000,\n pageSize,\n orderBy: stableOrderBy,\n streamUpdates,\n withProperties: stableWithProperties,\n autoFetchMore,\n ...(stableIntersectWith ? {\n intersectWith: stableIntersectWith\n } : {}),\n ...(pivotTo ? {\n pivotTo\n } : {}),\n ...(stableSelect ? {\n select: stableSelect\n } : {}),\n ...($loadPropertySecurityMetadata ? {\n $loadPropertySecurityMetadata\n } : {})\n }, observer), process.env.NODE_ENV !== \"production\" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : \"\"} ${JSON.stringify(stableCanonWhere)}` : void 0);\n }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect, $loadPropertySecurityMetadata]);\n const listPayload = React.useSyncExternalStore(subscribe, getSnapShot);\n return React.useMemo(() => {\n let error;\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 return {\n fetchMore: listPayload?.hasMore ? listPayload.fetchMore : undefined,\n error,\n data: listPayload?.resolvedList,\n isLoading: enabled ? listPayload?.status === \"loading\" || listPayload?.status === \"init\" || !listPayload : false,\n isOptimistic: listPayload?.isOptimistic ?? false,\n totalCount: listPayload?.totalCount\n };\n }, [listPayload, enabled]);\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n/**\n * Creates a debounced version of a callback function.\n *\n * @param callback The function to debounce\n * @param delay The delay in milliseconds\n * @returns A debounced function with cancel() and flush() methods\n *\n * @example\n * ```tsx\n * const { applyAction } = useOsdkAction(editOffice);\n *\n * const debouncedSave = useDebouncedCallback(\n * async (name: string) => {\n * await applyAction({\n * Office: office,\n * name,\n * location: office.location!,\n * $optimisticUpdate: (ctx) => {\n * ctx.updateObject(office.$clone({ name }));\n * },\n * });\n * },\n * 1000\n * );\n *\n * <input onChange={(e) => debouncedSave(e.target.value)} />\n * ```\n */\nexport function useDebouncedCallback(callback, delay) {\n const timeoutRef = React.useRef();\n const callbackRef = React.useRef(callback);\n const lastArgsRef = React.useRef();\n callbackRef.current = callback;\n const cancel = React.useCallback(() => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n }\n }, []);\n const flush = React.useCallback(() => {\n if (timeoutRef.current && lastArgsRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = undefined;\n void callbackRef.current(...lastArgsRef.current);\n }\n }, []);\n const debouncedCallback = React.useCallback((...args) => {\n lastArgsRef.current = args;\n cancel();\n timeoutRef.current = setTimeout(() => {\n void callbackRef.current(...args);\n }, delay);\n }, [delay, cancel]);\n React.useEffect(() => {\n return () => {\n cancel();\n };\n }, [cancel]);\n return Object.assign(debouncedCallback, {\n cancel,\n flush\n });\n}"]}
@@ -1,7 +1,8 @@
1
1
  import { Client, Osdk, WhereClause, PropertyKeys, ActionDefinition, ActionEditResponse, ActionValidationError, ActionValidationResponse, ObjectTypeDefinition } from '@osdk/client';
2
- import { ObservableClient, ActionSignatureFromDef, QueryParameterType } from '@osdk/client/unstable-do-not-use';
2
+ import { ObservableClient, ActionSignatureFromDef } from '@osdk/client/unstable-do-not-use';
3
3
  import React from 'react';
4
- import { ObjectOrInterfaceDefinition, LinkNames, LinkedType, SimplePropertyDef, ObjectSet, WhereClause as WhereClause$1, DerivedProperty, PropertyKeys as PropertyKeys$1, Osdk as Osdk$1, AggregateOpts, AggregationsResults, QueryDefinition, CompileTimeMetadata, ObjectTypeDefinition as ObjectTypeDefinition$1, PrimaryKeyType } from '@osdk/api';
4
+ import { ObjectOrInterfaceDefinition, LinkNames, LinkedType, SimplePropertyDef, ObjectSet, WhereClause as WhereClause$1, DerivedProperty, PropertyKeys as PropertyKeys$1, Osdk as Osdk$1, AggregateOpts, AggregationsResults, PrimaryKeyType } from '@osdk/api';
5
+ export { U as UseOsdkFunctionOptions, a as UseOsdkFunctionResult, u as useOsdkFunction } from '../useOsdkFunction-B0s7lqgN.cjs';
5
6
  export { U as UseOsdkMetadataResult, u as useOsdkClient, a as useOsdkMetadata } from '../useOsdkMetadata-BElt3F5s.cjs';
6
7
 
7
8
  interface OsdkProviderOptions {
@@ -326,123 +327,6 @@ interface UseOsdkAggregationResult<T extends ObjectOrInterfaceDefinition, A exte
326
327
  declare function useOsdkAggregation<Q extends ObjectOrInterfaceDefinition, const A extends AggregateOpts<Q>, RDPs extends Record<string, SimplePropertyDef> = {}>(type: Q, options: UseOsdkAggregationOptions<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
327
328
  declare function useOsdkAggregation<Q extends ObjectTypeDefinition, const A extends AggregateOpts<Q>, RDPs extends Record<string, SimplePropertyDef> = {}>(type: Q, options: UseOsdkAggregationOptionsWithObjectSet<Q, A, RDPs>): UseOsdkAggregationResult<Q, A>;
328
329
 
329
- interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
330
- /**
331
- * Parameters to pass to the function.
332
- * Must include all required parameters; optional parameters can be omitted.
333
- */
334
- params?: CompileTimeMetadata<Q>["parameters"] extends Record<string, never> ? undefined : QueryParameterType<CompileTimeMetadata<Q>["parameters"]>;
335
- /**
336
- * Object types this function depends on.
337
- * When actions modify objects of these types, the function will automatically refetch.
338
- *
339
- * @example
340
- * ```tsx
341
- * // Refetch when any Employee object changes
342
- * { dependsOn: [Employee] }
343
- * ```
344
- */
345
- dependsOn?: Array<ObjectTypeDefinition$1 | string>;
346
- /**
347
- * Specific object instances or ObjectSets this function depends on.
348
- * When any of these specific objects change, the function will refetch.
349
- * More fine-grained than dependsOn for precise invalidation control.
350
- *
351
- * For ObjectSets, the object type is extracted asynchronously and changes
352
- * to any object of that type will trigger a refetch.
353
- *
354
- * @example
355
- * ```tsx
356
- * // Refetch when this specific employee changes
357
- * { dependsOnObjects: [employee] }
358
- *
359
- * // Refetch when any object in the ObjectSet's type changes
360
- * { dependsOnObjects: [employeeObjectSet] }
361
- * ```
362
- */
363
- dependsOnObjects?: Array<Osdk$1.Instance<ObjectTypeDefinition$1> | ObjectSet<ObjectTypeDefinition$1>>;
364
- /**
365
- * The number of milliseconds to dedupe identical function calls.
366
- * Two calls with the same function and params will share results
367
- * if the second call is within this interval of the first.
368
- * @default 2000
369
- */
370
- dedupeIntervalMs?: number;
371
- /**
372
- * Whether to enable the query. When false, the query will not execute.
373
- * Useful for:
374
- * - Dependent queries that need to wait for other data
375
- * - Conditional queries based on component state
376
- *
377
- * @default true
378
- * @example
379
- * // Dependent query - wait for required data
380
- * const { data: employee } = useOsdkObject(Employee, employeeId);
381
- * const { data: report } = useOsdkFunction(getEmployeeReport, {
382
- * params: { employeeId: employee?.$primaryKey },
383
- * enabled: !!employee
384
- * });
385
- */
386
- enabled?: boolean;
387
- }
388
- interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {
389
- /**
390
- * The function result, or undefined if not yet loaded or on error.
391
- */
392
- data: (CompileTimeMetadata<Q>["signature"] extends (...args: never[]) => infer R ? Awaited<R> : never) | undefined;
393
- /**
394
- * True while the function is executing.
395
- */
396
- isLoading: boolean;
397
- /**
398
- * Error if the function execution failed.
399
- */
400
- error: Error | undefined;
401
- /**
402
- * Timestamp (ms since epoch) of when the result was last fetched.
403
- */
404
- lastUpdated: number;
405
- /**
406
- * Manually refetch the function.
407
- * Useful for "pull to refresh" or retry patterns.
408
- */
409
- refetch: () => void;
410
- }
411
- /**
412
- * React hook for executing and observing OSDK functions.
413
- *
414
- * Provides automatic caching, deduplication, and reactive updates for function calls.
415
- * Functions are automatically re-fetched when dependencies change (configured via options).
416
- *
417
- * @param queryDef - The QueryDefinition to execute
418
- * @param options - Configuration options for the function call
419
- * @returns Object containing result, loading state, error, and refetch function
420
- *
421
- * @example Basic usage
422
- * ```tsx
423
- * const { data, isLoading, error } = useOsdkFunction(getEmployeeStats, {
424
- * params: { departmentId: "engineering" }
425
- * });
426
- * ```
427
- *
428
- * @example With dependency tracking
429
- * ```tsx
430
- * const { data, refetch } = useOsdkFunction(calculateMetrics, {
431
- * params: { startDate, endDate },
432
- * dependsOn: [Employee, Project],
433
- * });
434
- * ```
435
- *
436
- * @example With specific object dependencies
437
- * ```tsx
438
- * const { data } = useOsdkFunction(getEmployeeReport, {
439
- * params: { employeeId: employee.$primaryKey },
440
- * dependsOnObjects: [employee],
441
- * });
442
- * ```
443
- */
444
- declare function useOsdkFunction<Q extends QueryDefinition<unknown>>(queryDef: Q, options?: UseOsdkFunctionOptions<Q>): UseOsdkFunctionResult<Q>;
445
-
446
330
  interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {
447
331
  object: Osdk$1.Instance<Q> | undefined;
448
332
  isLoading: boolean;
@@ -654,4 +538,4 @@ interface DebouncedCallback<TArgs extends readonly unknown[]> {
654
538
  */
655
539
  declare function useDebouncedCallback<TArgs extends readonly unknown[]>(callback: (...args: TArgs) => void | Promise<void>, delay: number): DebouncedCallback<TArgs>;
656
540
 
657
- export { OsdkProvider2, type UseOsdkAggregationResult, type UseOsdkFunctionOptions, type UseOsdkFunctionResult, type UseOsdkListResult, type UseOsdkObjectsOptions, useDebouncedCallback, useLinks, useObjectSet, useOsdkAction, useOsdkAggregation, useOsdkFunction, useOsdkObject, useOsdkObjects };
541
+ export { OsdkProvider2, type UseOsdkAggregationResult, type UseOsdkListResult, type UseOsdkObjectsOptions, useDebouncedCallback, useLinks, useObjectSet, useOsdkAction, useOsdkAggregation, useOsdkObject, useOsdkObjects };