@osdk/react 0.10.0-beta.9 → 0.10.0

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 (94) hide show
  1. package/CHANGELOG.md +99 -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/platform-apis/admin/useCbacBanner.js +63 -0
  5. package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  6. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  7. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  8. package/build/browser/new/platform-apis/admin/useMarkingCategories.js +46 -0
  9. package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  10. package/build/browser/new/platform-apis/admin/useMarkings.js +46 -0
  11. package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -0
  12. package/build/browser/new/platform-apis/admin/useUserMarkings.js +50 -0
  13. package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  14. package/build/browser/new/useOsdkAction.js +3 -6
  15. package/build/browser/new/useOsdkAction.js.map +1 -1
  16. package/build/browser/new/useOsdkFunctions.js +137 -0
  17. package/build/browser/new/useOsdkFunctions.js.map +1 -0
  18. package/build/browser/new/useOsdkObject.js +6 -2
  19. package/build/browser/new/useOsdkObject.js.map +1 -1
  20. package/build/browser/new/useOsdkObjects.js +6 -2
  21. package/build/browser/new/useOsdkObjects.js.map +1 -1
  22. package/build/browser/public/experimental/admin.js +5 -0
  23. package/build/browser/public/experimental/admin.js.map +1 -1
  24. package/build/browser/public/unstable-do-not-use.js +18 -0
  25. package/build/browser/public/unstable-do-not-use.js.map +1 -0
  26. package/build/cjs/chunk-2N32USW5.cjs +28 -0
  27. package/build/cjs/chunk-2N32USW5.cjs.map +1 -0
  28. package/build/cjs/chunk-R4FZ5MUH.cjs +34 -0
  29. package/build/cjs/chunk-R4FZ5MUH.cjs.map +1 -0
  30. package/build/cjs/{chunk-SVVMLSKN.cjs → chunk-ZUNR45SJ.cjs} +15 -4
  31. package/build/cjs/chunk-ZUNR45SJ.cjs.map +1 -0
  32. package/build/cjs/index.cjs +7 -6
  33. package/build/cjs/index.cjs.map +1 -1
  34. package/build/cjs/public/experimental/admin.cjs +154 -7
  35. package/build/cjs/public/experimental/admin.cjs.map +1 -1
  36. package/build/cjs/public/experimental/admin.d.cts +159 -2
  37. package/build/cjs/public/experimental.cjs +42 -36
  38. package/build/cjs/public/experimental.cjs.map +1 -1
  39. package/build/cjs/public/experimental.d.cts +12 -121
  40. package/build/cjs/public/unstable-do-not-use.cjs +114 -0
  41. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
  42. package/build/cjs/public/unstable-do-not-use.d.cts +35 -0
  43. package/build/cjs/useOsdkFunction-B0s7lqgN.d.cts +121 -0
  44. package/build/esm/new/OsdkContext2.js +22 -2
  45. package/build/esm/new/OsdkContext2.js.map +1 -1
  46. package/build/esm/new/platform-apis/admin/useCbacBanner.js +63 -0
  47. package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  48. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  49. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  50. package/build/esm/new/platform-apis/admin/useMarkingCategories.js +46 -0
  51. package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  52. package/build/esm/new/platform-apis/admin/useMarkings.js +46 -0
  53. package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -0
  54. package/build/esm/new/platform-apis/admin/useUserMarkings.js +50 -0
  55. package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  56. package/build/esm/new/useOsdkAction.js +3 -6
  57. package/build/esm/new/useOsdkAction.js.map +1 -1
  58. package/build/esm/new/useOsdkFunctions.js +137 -0
  59. package/build/esm/new/useOsdkFunctions.js.map +1 -0
  60. package/build/esm/new/useOsdkObject.js +6 -2
  61. package/build/esm/new/useOsdkObject.js.map +1 -1
  62. package/build/esm/new/useOsdkObjects.js +6 -2
  63. package/build/esm/new/useOsdkObjects.js.map +1 -1
  64. package/build/esm/public/experimental/admin.js +5 -0
  65. package/build/esm/public/experimental/admin.js.map +1 -1
  66. package/build/esm/public/unstable-do-not-use.js +18 -0
  67. package/build/esm/public/unstable-do-not-use.js.map +1 -0
  68. package/build/types/new/OsdkContext2.d.ts +1 -0
  69. package/build/types/new/OsdkContext2.d.ts.map +1 -1
  70. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts +33 -0
  71. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -0
  72. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts +34 -0
  73. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -0
  74. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts +27 -0
  75. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -0
  76. package/build/types/new/platform-apis/admin/useMarkings.d.ts +27 -0
  77. package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -0
  78. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts +33 -0
  79. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -0
  80. package/build/types/new/useOsdkFunctions.d.ts +31 -0
  81. package/build/types/new/useOsdkFunctions.d.ts.map +1 -0
  82. package/build/types/new/useOsdkObject.d.ts +2 -1
  83. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  84. package/build/types/new/useOsdkObjects.d.ts +6 -0
  85. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  86. package/build/types/public/experimental/admin.d.ts +8 -0
  87. package/build/types/public/experimental/admin.d.ts.map +1 -1
  88. package/build/types/public/unstable-do-not-use.d.ts +2 -0
  89. package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
  90. package/package.json +19 -10
  91. package/unstable-do-not-use.d.ts +17 -0
  92. package/build/cjs/chunk-OVBG5VXE.cjs +0 -50
  93. package/build/cjs/chunk-OVBG5VXE.cjs.map +0 -1
  94. 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);
@@ -234,6 +235,7 @@ function useOsdkAction(actionDef) {
234
235
  unknown: e
235
236
  });
236
237
  }
238
+ throw e;
237
239
  } finally {
238
240
  setPending(false);
239
241
  }
@@ -243,9 +245,7 @@ function useOsdkAction(actionDef) {
243
245
  if (isPending) {
244
246
  return void 0;
245
247
  }
246
- if (abortControllerRef.current) {
247
- abortControllerRef.current.abort();
248
- }
248
+ abortControllerRef.current?.abort();
249
249
  const abortController = new AbortController();
250
250
  abortControllerRef.current = abortController;
251
251
  setValidating(true);
@@ -276,9 +276,7 @@ function useOsdkAction(actionDef) {
276
276
  }, [observableClient, actionDef, isPending]);
277
277
  React4__default.default.useEffect(() => {
278
278
  return () => {
279
- if (abortControllerRef.current) {
280
- abortControllerRef.current.abort();
281
- }
279
+ abortControllerRef.current?.abort();
282
280
  };
283
281
  }, []);
284
282
  return React4__default.default.useMemo(() => ({
@@ -303,7 +301,7 @@ function useOsdkAggregation(type, options) {
303
301
  const objectSet = "objectSet" in options ? options.objectSet : void 0;
304
302
  const {
305
303
  observableClient
306
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
304
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
307
305
  const canonWhere = observableClient.canonicalizeWhereClause(where);
308
306
  const stableCanonWhere = React4__default.default.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);
309
307
  const objectSetRef = React4__default.default.useRef(objectSet);
@@ -317,7 +315,7 @@ function useOsdkAggregation(type, options) {
317
315
  getSnapShot
318
316
  } = React4__default.default.useMemo(() => {
319
317
  if (objectSetKeyString && objectSetRef.current) {
320
- return chunkSVVMLSKN_cjs.makeExternalStoreAsync((observer) => observableClient.observeAggregation({
318
+ return chunkZUNR45SJ_cjs.makeExternalStoreAsync((observer) => observableClient.observeAggregation({
321
319
  type,
322
320
  objectSet: objectSetRef.current,
323
321
  where: stableCanonWhere,
@@ -327,7 +325,7 @@ function useOsdkAggregation(type, options) {
327
325
  dedupeInterval: dedupeIntervalMs ?? 2e3
328
326
  }, observer), process.env.NODE_ENV !== "production" ? `aggregation ${type.apiName} ${objectSetKeyString} ${JSON.stringify(stableCanonWhere)}` : void 0);
329
327
  }
330
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => (
328
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => (
331
329
  // eslint-disable-next-line @typescript-eslint/no-deprecated
332
330
  observableClient.observeAggregation({
333
331
  type,
@@ -361,7 +359,7 @@ function useOsdkAggregation(type, options) {
361
359
  function useOsdkFunction(queryDef, options = {}) {
362
360
  const {
363
361
  observableClient
364
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
362
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
365
363
  const {
366
364
  params,
367
365
  dependsOn,
@@ -383,12 +381,12 @@ function useOsdkFunction(queryDef, options = {}) {
383
381
  getSnapShot
384
382
  } = React4__default.default.useMemo(() => {
385
383
  if (!enabled) {
386
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
384
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
387
385
  unsubscribe: () => {
388
386
  }
389
387
  }), process.env.NODE_ENV !== "production" ? `function ${queryDef.apiName} ${JSON.stringify(stableParams)} [DISABLED]` : void 0);
390
388
  }
391
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeFunction(queryDef, paramsForApi, {
389
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeFunction(queryDef, paramsForApi, {
392
390
  dependsOn: stableDependsOn,
393
391
  dependsOnObjects: stableDependsOnObjects,
394
392
  dedupeInterval: dedupeIntervalMs ?? 2e3
@@ -412,11 +410,12 @@ function useOsdkFunction(queryDef, options = {}) {
412
410
  function useOsdkObject(...args) {
413
411
  const {
414
412
  observableClient
415
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
413
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
416
414
  const isInstanceSignature = "$objectType" in args[0];
417
415
  const optionsArg = !isInstanceSignature && args[2] != null && typeof args[2] === "object" ? args[2] : void 0;
418
416
  const enabled = isInstanceSignature ? typeof args[1] === "boolean" ? args[1] : true : optionsArg ? optionsArg.enabled ?? true : typeof args[2] === "boolean" ? args[2] : true;
419
417
  const selectArg = optionsArg?.$select;
418
+ const loadPropertySecurityMetadata = optionsArg?.$loadPropertySecurityMetadata;
420
419
  const mode = isInstanceSignature ? "offline" : void 0;
421
420
  const typeOrApiName = isInstanceSignature ? args[0].$objectType : args[0];
422
421
  const primaryKey = isInstanceSignature ? args[0].$primaryKey : args[1];
@@ -427,18 +426,21 @@ function useOsdkObject(...args) {
427
426
  getSnapShot
428
427
  } = React4__default.default.useMemo(() => {
429
428
  if (!enabled) {
430
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
429
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
431
430
  unsubscribe: () => {
432
431
  }
433
432
  }), `object ${apiNameString} ${primaryKey} [DISABLED]`);
434
433
  }
435
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeObject(typeOrApiName, primaryKey, {
434
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeObject(typeOrApiName, primaryKey, {
436
435
  mode,
437
436
  ...stableSelect ? {
438
437
  select: stableSelect
438
+ } : {},
439
+ ...loadPropertySecurityMetadata ? {
440
+ $loadPropertySecurityMetadata: loadPropertySecurityMetadata
439
441
  } : {}
440
442
  }, observer), `object ${apiNameString} ${primaryKey}`);
441
- }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect]);
443
+ }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect, loadPropertySecurityMetadata]);
442
444
  const payload = React4__default.default.useSyncExternalStore(subscribe, getSnapShot);
443
445
  const forceUpdate = React4__default.default.useCallback(() => {
444
446
  throw new Error("not implemented");
@@ -463,7 +465,7 @@ var EMPTY_WHERE2 = {};
463
465
  function useOsdkObjects(type, options) {
464
466
  const {
465
467
  observableClient
466
- } = React4__default.default.useContext(chunkSVVMLSKN_cjs.OsdkContext2);
468
+ } = React4__default.default.useContext(chunkZUNR45SJ_cjs.OsdkContext2);
467
469
  const {
468
470
  pageSize,
469
471
  dedupeIntervalMs,
@@ -476,7 +478,8 @@ function useOsdkObjects(type, options) {
476
478
  autoFetchMore,
477
479
  intersectWith,
478
480
  pivotTo,
479
- $select
481
+ $select,
482
+ $loadPropertySecurityMetadata
480
483
  } = options ?? {};
481
484
  const canonWhere = observableClient.canonicalizeWhereClause(where ?? EMPTY_WHERE2);
482
485
  const stableCanonWhere = React4__default.default.useMemo(() => canonWhere, [JSON.stringify(canonWhere)]);
@@ -490,12 +493,12 @@ function useOsdkObjects(type, options) {
490
493
  getSnapShot
491
494
  } = React4__default.default.useMemo(() => {
492
495
  if (!enabled) {
493
- return chunkSVVMLSKN_cjs.makeExternalStore(() => ({
496
+ return chunkZUNR45SJ_cjs.makeExternalStore(() => ({
494
497
  unsubscribe: () => {
495
498
  }
496
499
  }), process.env.NODE_ENV !== "production" ? `list ${type.apiName} [DISABLED]` : void 0);
497
500
  }
498
- return chunkSVVMLSKN_cjs.makeExternalStore((observer) => observableClient.observeList({
501
+ return chunkZUNR45SJ_cjs.makeExternalStore((observer) => observableClient.observeList({
499
502
  type,
500
503
  rids: stableRids,
501
504
  where: stableCanonWhere,
@@ -513,9 +516,12 @@ function useOsdkObjects(type, options) {
513
516
  } : {},
514
517
  ...stableSelect ? {
515
518
  select: stableSelect
519
+ } : {},
520
+ ...$loadPropertySecurityMetadata ? {
521
+ $loadPropertySecurityMetadata
516
522
  } : {}
517
523
  }, observer), process.env.NODE_ENV !== "production" ? `list ${type.apiName} ${stableRids ? `[${stableRids.length} rids]` : ""} ${JSON.stringify(stableCanonWhere)}` : void 0);
518
- }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect]);
524
+ }, [enabled, observableClient, type.apiName, type.type, stableRids, stableCanonWhere, dedupeIntervalMs, pageSize, stableOrderBy, streamUpdates, stableWithProperties, autoFetchMore, stableIntersectWith, pivotTo, stableSelect, $loadPropertySecurityMetadata]);
519
525
  const listPayload = React4__default.default.useSyncExternalStore(subscribe, getSnapShot);
520
526
  return React4__default.default.useMemo(() => {
521
527
  let error;
@@ -570,13 +576,13 @@ function useDebouncedCallback(callback, delay) {
570
576
  });
571
577
  }
572
578
 
573
- Object.defineProperty(exports, "useOsdkClient", {
579
+ Object.defineProperty(exports, "useOsdkMetadata", {
574
580
  enumerable: true,
575
- get: function () { return chunkOVBG5VXE_cjs.useOsdkClient; }
581
+ get: function () { return chunkR4FZ5MUH_cjs.useOsdkMetadata; }
576
582
  });
577
- Object.defineProperty(exports, "useOsdkMetadata", {
583
+ Object.defineProperty(exports, "useOsdkClient", {
578
584
  enumerable: true,
579
- get: function () { return chunkOVBG5VXE_cjs.useOsdkMetadata; }
585
+ get: function () { return chunk2N32USW5_cjs.useOsdkClient; }
580
586
  });
581
587
  exports.OsdkProvider2 = OsdkProvider2;
582
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,uBAAAA,CAAM,OAAQ,CAAA,MAAM,YAAa,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AA,CAAY,MAAM;AACrC,IAAA,IAAI,WAAW,OAAS,EAAA;AACtB,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAU,GAAA,MAAA;AAAA;AACvB,GACF,EAAG,EAAE,CAAA;AACL,EAAM,MAAA,KAAA,GAAQA,uBAAM,CAAA,WAAA,CAAY,MAAM;AACpC,IAAI,IAAA,UAAA,CAAW,OAAW,IAAA,WAAA,CAAY,OAAS,EAAA;AAC7C,MAAA,YAAA,CAAa,WAAW,OAAO,CAAA;AAC/B,MAAA,UAAA,CAAW,OAAU,GAAA,MAAA;AACrB,MAAA,KAAK,WAAY,CAAA,OAAA,CAAQ,GAAG,WAAA,CAAY,OAAO,CAAA;AAAA;AACjD,GACF,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,iBAAoBA,GAAAA,uBAAAA,CAAM,WAAY,CAAA,CAAA,GAAI,IAAS,KAAA;AACvD,IAAA,WAAA,CAAY,OAAU,GAAA,IAAA;AACtB,IAAO,MAAA,EAAA;AACP,IAAW,UAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AACpC,MAAK,KAAA,WAAA,CAAY,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,OAC/B,KAAK,CAAA;AAAA,GACP,EAAA,CAAC,KAAO,EAAA,MAAM,CAAC,CAAA;AAClB,EAAAA,uBAAAA,CAAM,UAAU,MAAM;AACpB,IAAA,OAAO,MAAM;AACX,MAAO,MAAA,EAAA;AAAA,KACT;AAAA,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 } 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 and enabled\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 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 }, observer), `object ${apiNameString} ${primaryKey}`);\n }, [enabled, observableClient, typeOrApiName, apiNameString, primaryKey, mode, stableSelect]);\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 } = 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 }, 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]);\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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,GAAG,WAAA,CAAY,OAAO,CAAA;AAAA;AACjD,GACF,EAAG,EAAE,CAAA;AACL,EAAA,MAAM,iBAAoBA,GAAAA,uBAAAA,CAAM,WAAY,CAAA,CAAA,GAAI,IAAS,KAAA;AACvD,IAAA,WAAA,CAAY,OAAU,GAAA,IAAA;AACtB,IAAO,MAAA,EAAA;AACP,IAAW,UAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AACpC,MAAK,KAAA,WAAA,CAAY,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,OAC/B,KAAK,CAAA;AAAA,GACP,EAAA,CAAC,KAAO,EAAA,MAAM,CAAC,CAAA;AAClB,EAAAA,uBAAAA,CAAM,UAAU,MAAM;AACpB,IAAA,OAAO,MAAM;AACX,MAAO,MAAA,EAAA;AAAA,KACT;AAAA,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 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}"]}