@osdk/react 0.10.0-beta.1 → 0.10.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/AGENTS.md +46 -221
  2. package/CHANGELOG.md +132 -0
  3. package/build/browser/new/makeExternalStore.js +61 -0
  4. package/build/browser/new/makeExternalStore.js.map +1 -1
  5. package/build/browser/new/useLinks.js +11 -4
  6. package/build/browser/new/useLinks.js.map +1 -1
  7. package/build/browser/new/useObjectSet.js +42 -18
  8. package/build/browser/new/useObjectSet.js.map +1 -1
  9. package/build/browser/new/useOsdkAction.js +2 -2
  10. package/build/browser/new/useOsdkAction.js.map +1 -1
  11. package/build/browser/new/useOsdkAggregation.js +65 -27
  12. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  13. package/build/browser/new/useOsdkFunction.js +17 -12
  14. package/build/browser/new/useOsdkFunction.js.map +1 -1
  15. package/build/browser/new/useOsdkObject.js +44 -26
  16. package/build/browser/new/useOsdkObject.js.map +1 -1
  17. package/build/browser/new/useOsdkObjects.js +28 -19
  18. package/build/browser/new/useOsdkObjects.js.map +1 -1
  19. package/build/browser/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
  20. package/build/browser/public/experimental/admin.js.map +1 -0
  21. package/build/browser/public/experimental.js +0 -3
  22. package/build/browser/public/experimental.js.map +1 -1
  23. package/build/browser/useOsdkMetadata.js.map +1 -1
  24. package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
  25. package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
  26. package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
  27. package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
  28. package/build/cjs/index.cjs +4 -4
  29. package/build/cjs/index.d.cts +1 -1
  30. package/build/cjs/public/experimental/admin.cjs +146 -0
  31. package/build/cjs/public/experimental/admin.cjs.map +1 -0
  32. package/build/cjs/public/experimental/admin.d.cts +118 -0
  33. package/build/cjs/public/experimental.cjs +253 -492
  34. package/build/cjs/public/experimental.cjs.map +1 -1
  35. package/build/cjs/public/experimental.d.cts +106 -138
  36. package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
  37. package/build/esm/new/makeExternalStore.js +61 -0
  38. package/build/esm/new/makeExternalStore.js.map +1 -1
  39. package/build/esm/new/useLinks.js +11 -4
  40. package/build/esm/new/useLinks.js.map +1 -1
  41. package/build/esm/new/useObjectSet.js +42 -18
  42. package/build/esm/new/useObjectSet.js.map +1 -1
  43. package/build/esm/new/useOsdkAction.js +2 -2
  44. package/build/esm/new/useOsdkAction.js.map +1 -1
  45. package/build/esm/new/useOsdkAggregation.js +65 -27
  46. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  47. package/build/esm/new/useOsdkFunction.js +17 -12
  48. package/build/esm/new/useOsdkFunction.js.map +1 -1
  49. package/build/esm/new/useOsdkObject.js +44 -26
  50. package/build/esm/new/useOsdkObject.js.map +1 -1
  51. package/build/esm/new/useOsdkObjects.js +28 -19
  52. package/build/esm/new/useOsdkObjects.js.map +1 -1
  53. package/build/esm/{intellisense.test.helpers/useOsdkObjectsWithPivot.js → public/experimental/admin.js} +4 -19
  54. package/build/esm/public/experimental/admin.js.map +1 -0
  55. package/build/esm/public/experimental.js +0 -3
  56. package/build/esm/public/experimental.js.map +1 -1
  57. package/build/esm/useOsdkMetadata.js.map +1 -1
  58. package/build/types/new/makeExternalStore.d.ts +11 -0
  59. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  60. package/build/types/new/useLinks.d.ts +19 -0
  61. package/build/types/new/useLinks.d.ts.map +1 -1
  62. package/build/types/new/useObjectSet.d.ts +10 -4
  63. package/build/types/new/useObjectSet.d.ts.map +1 -1
  64. package/build/types/new/useOsdkAggregation.d.ts +41 -3
  65. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  66. package/build/types/new/useOsdkFunction.d.ts +11 -5
  67. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  68. package/build/types/new/useOsdkObject.d.ts +18 -7
  69. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  70. package/build/types/new/useOsdkObjects.d.ts +26 -2
  71. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  72. package/build/types/public/experimental/admin.d.ts +3 -0
  73. package/build/types/public/experimental/admin.d.ts.map +1 -0
  74. package/build/types/public/experimental.d.ts +0 -3
  75. package/build/types/public/experimental.d.ts.map +1 -1
  76. package/build/types/useOsdkMetadata.d.ts +5 -4
  77. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  78. package/docs/querying-data.md +19 -0
  79. package/{build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js → experimental/admin.d.ts} +1 -18
  80. package/package.json +29 -8
  81. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  82. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  83. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  84. package/build/browser/intellisense.test.js +0 -148
  85. package/build/browser/intellisense.test.js.map +0 -1
  86. package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
  87. package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
  88. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  89. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  90. package/build/esm/intellisense.test.js +0 -148
  91. package/build/esm/intellisense.test.js.map +0 -1
  92. package/build/types/intellisense.test.d.ts +0 -1
  93. package/build/types/intellisense.test.d.ts.map +0 -1
  94. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
  95. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
  96. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
  97. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
- import type { CompileTimeMetadata, ObjectTypeDefinition, Osdk, QueryDefinition } from "@osdk/api";
2
- import type { QueryParameterType, QueryReturnType } from "@osdk/client/unstable-do-not-use";
1
+ import type { CompileTimeMetadata, ObjectSet, ObjectTypeDefinition, Osdk, QueryDefinition } from "@osdk/api";
2
+ import type { QueryParameterType } from "@osdk/client/unstable-do-not-use";
3
3
  export interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
4
4
  /**
5
5
  * Parameters to pass to the function.
@@ -18,17 +18,23 @@ export interface UseOsdkFunctionOptions<Q extends QueryDefinition<unknown>> {
18
18
  */
19
19
  dependsOn?: Array<ObjectTypeDefinition | string>;
20
20
  /**
21
- * Specific object instances this function depends on.
21
+ * Specific object instances or ObjectSets this function depends on.
22
22
  * When any of these specific objects change, the function will refetch.
23
23
  * More fine-grained than dependsOn for precise invalidation control.
24
24
  *
25
+ * For ObjectSets, the object type is extracted asynchronously and changes
26
+ * to any object of that type will trigger a refetch.
27
+ *
25
28
  * @example
26
29
  * ```tsx
27
30
  * // Refetch when this specific employee changes
28
31
  * { dependsOnObjects: [employee] }
32
+ *
33
+ * // Refetch when any object in the ObjectSet's type changes
34
+ * { dependsOnObjects: [employeeObjectSet] }
29
35
  * ```
30
36
  */
31
- dependsOnObjects?: Array<Osdk.Instance<ObjectTypeDefinition>>;
37
+ dependsOnObjects?: Array<Osdk.Instance<ObjectTypeDefinition> | ObjectSet<ObjectTypeDefinition>>;
32
38
  /**
33
39
  * The number of milliseconds to dedupe identical function calls.
34
40
  * Two calls with the same function and params will share results
@@ -57,7 +63,7 @@ export interface UseOsdkFunctionResult<Q extends QueryDefinition<unknown>> {
57
63
  /**
58
64
  * The function result, or undefined if not yet loaded or on error.
59
65
  */
60
- data: QueryReturnType<CompileTimeMetadata<Q>["output"]> | undefined;
66
+ data: (CompileTimeMetadata<Q>["signature"] extends (...args: never[]) => infer R ? Awaited<R> : never) | undefined;
61
67
  /**
62
68
  * True while the function is executing.
63
69
  */
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBACA,sBACA,MACA,uBACK,WAAY;AACnB,cAEE,oBACA,uBACK,kCAAmC;AAK1C,iBAAiB,uBAAuB,UAAU,0BAA0B;;;;;CAK1E,SAAS,oBAAoB,GAAG,sBAAsB,oCAElD,mBAAmB,oBAAoB,GAAG;;;;;;;;;;;CAY9C,YAAY,MAAM;;;;;;;;;;;;CAalB,mBAAmB,MAAM,KAAK,SAAS;;;;;;;CAQvC;;;;;;;;;;;;;;;;CAiBA;AACD;AAED,iBAAiB,sBAAsB,UAAU,0BAA0B;;;;CAIzE,MAAM,gBAAgB,oBAAoB,GAAG;;;;CAK7C;;;;CAKA,OAAO;;;;CAKP;;;;;CAMA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCD,OAAO,iBAAS,gBAAgB,UAAU,0BACxCA,UAAU,GACVC,UAAS,uBAAuB,KAC/B,sBAAsB","names":["queryDef: Q","options: UseOsdkFunctionOptions<Q>"],"sources":["../../../src/new/useOsdkFunction.ts"],"version":3,"file":"useOsdkFunction.d.ts"}
1
+ {"mappings":"AAgBA,cACE,qBACA,WACA,sBACA,MACA,uBACK,WAAY;AACnB,cAEE,0BACK,kCAAmC;AAM1C,iBAAiB,uBAAuB,UAAU,0BAA0B;;;;;CAK1E,SAAS,oBAAoB,GAAG,sBAAsB,oCAElD,mBAAmB,oBAAoB,GAAG;;;;;;;;;;;CAY9C,YAAY,MAAM;;;;;;;;;;;;;;;;;;CAmBlB,mBAAmB,MACjB,KAAK,SAAS,wBAAwB,UAAU;;;;;;;CASlD;;;;;;;;;;;;;;;;CAiBA;AACD;AAED,iBAAiB,sBAAsB,UAAU,0BAA0B;;;;CAIzE,OACK,oBAAoB,GAAG,sBAAsB,GAAG,wBAAwB,IACvE,QAAQ;;;;CAOd;;;;CAKA,OAAO;;;;CAKP;;;;;CAMA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCD,OAAO,iBAAS,gBAAgB,UAAU,0BACxCA,UAAU,GACVC,UAAS,uBAAuB,KAC/B,sBAAsB","names":["queryDef: Q","options: UseOsdkFunctionOptions<Q>"],"sources":["../../../src/new/useOsdkFunction.ts"],"version":3,"file":"useOsdkFunction.d.ts"}
@@ -1,5 +1,5 @@
1
- import type { ObjectTypeDefinition, Osdk, PrimaryKeyType } from "@osdk/api";
2
- export interface UseOsdkObjectResult<Q extends ObjectTypeDefinition> {
1
+ import type { ObjectOrInterfaceDefinition, Osdk, PrimaryKeyType, PropertyKeys } from "@osdk/api";
2
+ export interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {
3
3
  object: Osdk.Instance<Q> | undefined;
4
4
  isLoading: boolean;
5
5
  error: Error | undefined;
@@ -13,12 +13,23 @@ export interface UseOsdkObjectResult<Q extends ObjectTypeDefinition> {
13
13
  * @param obj an existing `Osdk.Instance` object to get metadata for.
14
14
  * @param enabled Enable or disable the query (defaults to true)
15
15
  */
16
- export declare function useOsdkObject<Q extends ObjectTypeDefinition>(obj: Osdk.Instance<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
16
+ export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(obj: Osdk.Instance<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
17
17
  /**
18
- * Loads an object by type and primary key.
18
+ * Loads an object or interface instance by type and primary key.
19
19
  *
20
- * @param type
21
- * @param primaryKey
20
+ * @param type The object type or interface definition
21
+ * @param primaryKey The primary key of the object
22
22
  * @param enabled Enable or disable the query (defaults to true)
23
23
  */
24
- export declare function useOsdkObject<Q extends ObjectTypeDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
24
+ export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, enabled?: boolean): UseOsdkObjectResult<Q>;
25
+ /**
26
+ * Loads an object or interface instance by type and primary key with options.
27
+ *
28
+ * @param type The object type or interface definition
29
+ * @param primaryKey The primary key of the object
30
+ * @param options Options including $select and enabled
31
+ */
32
+ export declare function useOsdkObject<Q extends ObjectOrInterfaceDefinition>(type: Q, primaryKey: PrimaryKeyType<Q>, options?: {
33
+ $select?: readonly PropertyKeys<Q>[]
34
+ enabled?: boolean
35
+ }): UseOsdkObjectResult<Q>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,sBAAsB,MAAM,sBAAsB,WAAY;AAM5E,iBAAiB,oBAAoB,UAAU,sBAAsB;CACnE,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;;AAMD,OAAO,iBAAS,cAAc,UAAU,sBACtCA,KAAK,KAAK,SAAS,IACnBC,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cAAc,UAAU,sBACtCC,MAAM,GACNC,YAAY,eAAe,IAC3BF,oBACC,oBAAoB","names":["obj: Osdk.Instance<Q>","enabled?: boolean","type: Q","primaryKey: PrimaryKeyType<Q>"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
1
+ {"mappings":"AAgBA,cACE,6BACA,MACA,gBACA,oBACK,WAAY;AAMnB,iBAAiB,oBACf,UAAU,6BACV;CACA,QAAQ,KAAK,SAAS;CACtB;CAEA,OAAO;;;;CAKP;CACA;AACD;;;;;AAMD,OAAO,iBAAS,cACd,UAAU,6BAEVA,KAAK,KAAK,SAAS,IACnBC,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cACd,UAAU,6BAEVC,MAAM,GACNC,YAAY,eAAe,IAC3BF,oBACC,oBAAoB;;;;;;;;AAQvB,OAAO,iBAAS,cACd,UAAU,6BAEVC,MAAM,GACNC,YAAY,eAAe,IAC3BC,UAAU;CAAE,mBAAmB,aAAa;CAAM;AAAmB,IACpE,oBAAoB","names":["obj: Osdk.Instance<Q>","enabled?: boolean","type: Q","primaryKey: PrimaryKeyType<Q>","options?: { $select?: readonly PropertyKeys<Q>[]; enabled?: boolean }"],"sources":["../../../src/new/useOsdkObject.ts"],"version":3,"file":"useOsdkObject.d.ts"}
@@ -79,10 +79,21 @@ export interface UseOsdkObjectsOptions<
79
79
  */
80
80
  autoFetchMore?: boolean | number;
81
81
  streamUpdates?: boolean;
82
+ /**
83
+ * Restrict which properties are returned for each object.
84
+ * When provided, only the specified properties will be fetched,
85
+ * reducing payload sizes for list views.
86
+ *
87
+ * @example
88
+ * // Only fetch name and status properties
89
+ * useOsdkObjects(Employee, { $select: ["name", "status"] })
90
+ */
91
+ $select?: readonly PropertyKeys<T>[];
82
92
  }
83
93
  export interface UseOsdkListResult<
84
94
  T extends ObjectOrInterfaceDefinition,
85
- RDPs extends Record<string, SimplePropertyDef> = {}
95
+ RDPs extends Record<string, SimplePropertyDef> = {},
96
+ EXTRA_OPTIONS extends never | "$rid" = never
86
97
  > {
87
98
  /**
88
99
  * Function to fetch more pages (undefined if no more pages)
@@ -91,7 +102,7 @@ export interface UseOsdkListResult<
91
102
  /**
92
103
  * The fetched data with derived properties
93
104
  */
94
- data: Osdk.Instance<T, "$allBaseProperties", PropertyKeys<T>, RDPs>[] | undefined;
105
+ data: Osdk.Instance<T, "$allBaseProperties" | EXTRA_OPTIONS, PropertyKeys<T>, RDPs>[] | undefined;
95
106
  /**
96
107
  * Whether data is currently being loaded
97
108
  */
@@ -113,12 +124,25 @@ export interface UseOsdkListResult<
113
124
  */
114
125
  totalCount?: string;
115
126
  }
127
+ export declare function useOsdkObjects<
128
+ Q extends ObjectOrInterfaceDefinition,
129
+ L extends LinkNames<Q>
130
+ >(type: Q, options: UseOsdkObjectsOptions<Q> & {
131
+ pivotTo: L
132
+ rids: readonly string[]
133
+ }): UseOsdkListResult<LinkedType<Q, L>, {}, "$rid">;
116
134
  export declare function useOsdkObjects<
117
135
  Q extends ObjectOrInterfaceDefinition,
118
136
  L extends LinkNames<Q>
119
137
  >(type: Q, options: UseOsdkObjectsOptions<Q> & {
120
138
  pivotTo: L
121
139
  }): UseOsdkListResult<LinkedType<Q, L>>;
140
+ export declare function useOsdkObjects<
141
+ Q extends ObjectOrInterfaceDefinition,
142
+ RDPs extends Record<string, SimplePropertyDef> = {}
143
+ >(type: Q, options: UseOsdkObjectsOptions<Q, RDPs> & {
144
+ rids: readonly string[]
145
+ }): UseOsdkListResult<Q, RDPs, "$rid">;
122
146
  export declare function useOsdkObjects<
123
147
  Q extends ObjectOrInterfaceDefinition,
124
148
  RDPs extends Record<string, SimplePropertyDef> = {}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,MACA,cACA,mBACA,mBACK,WAAY;AAMnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;;;;;CAiBA;;;;;;CAOA,QAAQ,YAAY,GAAG;;;;CAKvB,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;CAMA,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;;;;CAQtE;;;;;;;;;CAUA;;;;;;CAOA,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG;CACvB;;;;;CAMD,UAAU,UAAU;;;;;;;;;;CAWpB;CAEA;AACD;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;CAIA,kBAAkB;;;;CAKlB,MACI,KAAK,SAAS,GAAG,sBAAsB,aAAa,IAAI;;;;CAM5D;;;;CAKA,OAAO;;;;;;;;CASP;;;;CAKA;AACD;AAQD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,MAAM,GACNC,SAAS,sBAAsB,KAAK;CAAE,SAAS;AAAG,IACjD,kBAAkB,WAAW,GAAG;AAEnC,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDD,MAAM,GACNE,UAAU,sBAAsB,GAAG,QAClC,kBAAkB,GAAG","names":["type: Q","options: UseOsdkObjectsOptions<Q> & { pivotTo: L }","options?: UseOsdkObjectsOptions<Q, RDPs>"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
1
+ {"mappings":"AAgBA,cACE,iBACA,YACA,WACA,6BACA,MACA,cACA,mBACA,mBACK,WAAY;AAMnB,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EACnD;;;;;;;;;;;;;;;;;CAiBA;;;;;;CAOA,QAAQ,YAAY,GAAG;;;;CAKvB,aACG,KAAK,aAAa,OAAM,QAAQ;;;;CAMnC;;;;;CAMA,oBAAoB,WAAW,QAAO,gBAAgB,QAAQ,GAAG,KAAK;;;;;;;CAQtE;;;;;;;;;CAUA;;;;;;CAOA,gBAAgB,MAAM;EACpB,OAAO,YAAY,GAAG;CACvB;;;;;CAMD,UAAU,UAAU;;;;;;;;;;CAWpB;CAEA;;;;;;;;;;CAWA,mBAAmB,aAAa;AACjC;AAED,iBAAiB;CACf,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;CACnD,8BAA8B;EAC9B;;;;CAIA,kBAAkB;;;;CAKlB,MACI,KAAK,SACL,GACA,uBAAuB,eACvB,aAAa,IACb;;;;CAOJ;;;;CAKA,OAAO;;;;;;;;CASP;;;;CAKA;AACD;AAUD,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBA,MAAM,GACNC,SAAS,sBAAsB,KAAK;CAAE,SAAS;CAAG;AAAyB,IAC1E,kBAAkB,WAAW,GAAG,IAAI,CAAE,GAAE;AAE3C,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,UAAU;EAEpBD,MAAM,GACNE,SAAS,sBAAsB,KAAK;CAAE,SAAS;AAAG,IACjD,kBAAkB,WAAW,GAAG;AAEnC,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDF,MAAM,GACNG,SAAS,sBAAsB,GAAG,QAAQ;CAAE;AAAyB,IACpE,kBAAkB,GAAG,MAAM;AAE9B,OAAO,iBAAS;CACd,UAAU;CACV,aAAa,eAAe,qBAAqB,CAAE;EAEnDH,MAAM,GACNI,UAAU,sBAAsB,GAAG,QAClC,kBAAkB,GAAG","names":["type: Q","options: UseOsdkObjectsOptions<Q> & { pivotTo: L; rids: readonly string[] }","options: UseOsdkObjectsOptions<Q> & { pivotTo: L }","options: UseOsdkObjectsOptions<Q, RDPs> & { rids: readonly string[] }","options?: UseOsdkObjectsOptions<Q, RDPs>"],"sources":["../../../src/new/useOsdkObjects.ts"],"version":3,"file":"useOsdkObjects.d.ts"}
@@ -0,0 +1,3 @@
1
+ export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
2
+ export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
3
+ export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B","names":[],"sources":["../../../../src/public/experimental/admin.ts"],"version":3,"file":"admin.d.ts"}
@@ -1,7 +1,4 @@
1
1
  export { OsdkProvider2 } from "../new/OsdkProvider2.js";
2
- export { useCurrentFoundryUser } from "../new/platform-apis/admin/useCurrentFoundryUser.js";
3
- export { useFoundryUser } from "../new/platform-apis/admin/useFoundryUser.js";
4
- export { useFoundryUsersList } from "../new/platform-apis/admin/useFoundryUsersList.js";
5
2
  export { useLinks } from "../new/useLinks.js";
6
3
  export { useObjectSet } from "../new/useObjectSet.js";
7
4
  export { useOsdkAction } from "../new/useOsdkAction.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,cAAc,gCAAgC;AAC9C,SAAS,0BAA0B;AACnC,cACE,wBACA,6BACK;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,cACE,mBACA,6BACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B;AAC3C,SAAS,4BAA4B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,cAAc,gCAAgC;AAC9C,SAAS,0BAA0B;AACnC,cACE,wBACA,6BACK;AACP,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,cACE,mBACA,6BACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,cAAc,6BAA6B;AAC3C,SAAS,4BAA4B","names":[],"sources":["../../../src/public/experimental.ts"],"version":3,"file":"experimental.d.ts"}
@@ -1,9 +1,10 @@
1
- import type { InterfaceDefinition, InterfaceMetadata, ObjectMetadata, ObjectOrInterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
2
- type MetadataFor<T extends ObjectOrInterfaceDefinition> = T extends InterfaceDefinition ? InterfaceMetadata : T extends ObjectTypeDefinition ? ObjectMetadata : never;
3
- export interface UseOsdkMetadataResult<T extends ObjectOrInterfaceDefinition> {
1
+ import type { ActionDefinition, ActionMetadata, InterfaceDefinition, InterfaceMetadata, ObjectMetadata, ObjectOrInterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
2
+ type MetadataFetchableDefinition = ObjectOrInterfaceDefinition | ActionDefinition<any>;
3
+ type MetadataFor<T extends MetadataFetchableDefinition> = T extends ObjectTypeDefinition ? ObjectMetadata : T extends InterfaceDefinition ? InterfaceMetadata : T extends ActionDefinition<any> ? ActionMetadata : never;
4
+ export interface UseOsdkMetadataResult<T extends MetadataFetchableDefinition> {
4
5
  loading: boolean;
5
6
  metadata?: MetadataFor<T>;
6
7
  error?: string;
7
8
  }
8
- export declare function useOsdkMetadata<T extends ObjectOrInterfaceDefinition>(type: T): UseOsdkMetadataResult<T>;
9
+ export declare function useOsdkMetadata<T extends MetadataFetchableDefinition>(type: T): UseOsdkMetadataResult<T>;
9
10
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBACA,mBACA,gBACA,6BACA,4BACK,WAAY;KAId,YAAY,UAAU,+BAA+B,UACxD,sBAAsB,oBACpB,UAAU,uBAAuB;AAGrC,iBAAiB,sBAAsB,UAAU,6BAA6B;CAC5E;CACA,WAAW,YAAY;CACvB;AACD;AAED,OAAO,iBAAS,gBAAgB,UAAU,6BACxCA,MAAM,IACL,sBAAsB","names":["type: T"],"sources":["../../src/useOsdkMetadata.ts"],"version":3,"file":"useOsdkMetadata.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,gBACA,qBACA,mBACA,gBACA,6BACA,4BACK,WAAY;KAId,8BACD,8BACA;KAEC,YAAY,UAAU,+BAA+B,UACxD,uBAAuB,iBACrB,UAAU,sBAAsB,oBAChC,UAAU,wBAAwB;AAGtC,iBAAiB,sBAAsB,UAAU,6BAA6B;CAC5E;CACA,WAAW,YAAY;CACvB;AACD;AAED,OAAO,iBAAS,gBAAgB,UAAU,6BACxCA,MAAM,IACL,sBAAsB","names":["type: T"],"sources":["../../src/useOsdkMetadata.ts"],"version":3,"file":"useOsdkMetadata.d.ts"}
@@ -560,12 +560,31 @@ function OptionalReportsList({ employee }: { employee: Employee.OsdkInstance })
560
560
  }
561
561
  ```
562
562
 
563
+ ### Controlling Re-fetch Behavior
564
+
565
+ By default, `useLinks` deduplicates network requests within a 2-second window. You can customize this with `dedupeIntervalMs`:
566
+
567
+ ```tsx
568
+ const { links } = useLinks(employee, "reports", {
569
+ dedupeIntervalMs: 10000, // don't re-fetch within 10 seconds
570
+ });
571
+ ```
572
+
573
+ To prevent re-fetching entirely on remount and only refresh when the server data is invalidated (e.g. after an action), use `Infinity`:
574
+
575
+ ```tsx
576
+ const { links } = useLinks(employee, "reports", {
577
+ dedupeIntervalMs: Infinity,
578
+ });
579
+ ```
580
+
563
581
  ### Options
564
582
 
565
583
  - `where` - Filter linked objects
566
584
  - `pageSize` - Number of links per page
567
585
  - `orderBy` - Sort order for linked objects
568
586
  - `mode` - Fetch mode: `"force"` (always fetch), `"offline"` (cache only), or undefined (default)
587
+ - `dedupeIntervalMs` - Minimum time between re-fetches (default: 2000ms)
569
588
  - `enabled` - Enable/disable the query (default: true)
570
589
 
571
590
  ### Return Values
@@ -14,21 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // WARNING!
18
- // WARNING!
19
- // This file is used for tests that check intellisense. Editing this file by hand will likely
20
- // break tests that have hard coded line numbers and line offsets.
21
-
22
- import { Employee } from "@osdk/client.test.ontology";
23
- import { useOsdkObjects } from "@osdk/react/experimental";
24
- function TestComponent() {
25
- const {
26
- data
27
- } = useOsdkObjects(Employee, {
28
- withProperties: {
29
- constantValue: employee => employee.constant.integer(42)
30
- }
31
- });
32
- return null;
33
- }
34
- //# sourceMappingURL=useOsdkObjectsWithProperties.js.map
17
+ export * from "../build/cjs/public/experimental/admin.cjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/react",
3
- "version": "0.10.0-beta.1",
3
+ "version": "0.10.0-beta.10",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,6 +25,15 @@
25
25
  "require": "./build/cjs/public/experimental.cjs",
26
26
  "default": "./build/browser/public/experimental.js"
27
27
  },
28
+ "./experimental/admin": {
29
+ "browser": "./build/browser/public/experimental/admin.js",
30
+ "import": {
31
+ "types": "./build/types/public/experimental/admin.d.ts",
32
+ "default": "./build/esm/public/experimental/admin.js"
33
+ },
34
+ "require": "./build/cjs/public/experimental/admin.cjs",
35
+ "default": "./build/browser/public/experimental/admin.js"
36
+ },
28
37
  "./*": {
29
38
  "browser": "./build/browser/public/*.js",
30
39
  "import": {
@@ -38,13 +47,23 @@
38
47
  "peerDependencies": {
39
48
  "@osdk/api": "*",
40
49
  "@osdk/client": "*",
50
+ "@osdk/foundry.admin": "*",
51
+ "@osdk/foundry.core": "*",
41
52
  "@types/react": "^17 || ^18 || ^19",
42
53
  "react": "^17 || ^18 || ^19",
43
54
  "react-dom": "^17 || ^18 || ^19"
44
55
  },
56
+ "peerDependenciesMeta": {
57
+ "@osdk/foundry.admin": {
58
+ "optional": true
59
+ },
60
+ "@osdk/foundry.core": {
61
+ "optional": true
62
+ }
63
+ },
45
64
  "devDependencies": {
46
- "@osdk/foundry.admin": "2.45.0",
47
- "@osdk/foundry.core": "2.45.0",
65
+ "@osdk/foundry.admin": "2.50.0",
66
+ "@osdk/foundry.core": "2.50.0",
48
67
  "@testing-library/react": "^16.3.0",
49
68
  "@types/react": "^18.3.24",
50
69
  "find-up": "^8.0.0",
@@ -57,11 +76,11 @@
57
76
  "react": "^18.3.1",
58
77
  "tiny-invariant": "^1.3.3",
59
78
  "typescript": "~5.5.4",
60
- "@osdk/api": "2.8.0-beta.1",
61
- "@osdk/client": "2.8.0-beta.1",
62
- "@osdk/monorepo.api-extractor": "~0.7.0-beta.1",
63
- "@osdk/client.test.ontology": "2.8.0-beta.1",
64
- "@osdk/monorepo.tsconfig": "~0.7.0-beta.1"
79
+ "@osdk/api": "2.8.0-beta.22",
80
+ "@osdk/client": "2.8.0-beta.22",
81
+ "@osdk/client.test.ontology": "2.8.0-beta.22",
82
+ "@osdk/monorepo.tsconfig": "~0.7.0-beta.1",
83
+ "@osdk/monorepo.api-extractor": "~0.7.0-beta.1"
65
84
  },
66
85
  "publishConfig": {
67
86
  "access": "public"
@@ -69,6 +88,7 @@
69
88
  "files": [
70
89
  "AGENTS.md",
71
90
  "docs",
91
+ "experimental",
72
92
  "build/cjs",
73
93
  "build/esm",
74
94
  "build/browser",
@@ -81,6 +101,7 @@
81
101
  "main": "./build/cjs/index.cjs",
82
102
  "module": "./build/esm/index.js",
83
103
  "types": "./build/cjs/index.d.cts",
104
+ "sideEffects": false,
84
105
  "type": "module",
85
106
  "scripts": {
86
107
  "apiDocs": "npx typedoc ",
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkObjectsWithPivot.js","names":["Employee","useOsdkObjects","TestComponent","data","pivotTo"],"sources":["useOsdkObjectsWithPivot.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// WARNING!\n// WARNING!\n// This file is used for tests that check intellisense. Editing this file by hand will likely\n// break tests that have hard coded line numbers and line offsets.\n\nimport { Employee } from \"@osdk/client.test.ontology\";\nimport { useOsdkObjects } from \"@osdk/react/experimental\";\n\ndeclare const MyComponent: () => void;\n\nfunction TestComponent() {\n const { data } = useOsdkObjects(Employee, {\n pivotTo: \"lead\",\n });\n\n // Line 31: Check that data has the correct pivoted type\n const firstItem = data?.[0];\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AAIzD,SAASC,aAAaA,CAAA,EAAG;EACvB,MAAM;IAAEC;EAAK,CAAC,GAAGF,cAAc,CAACD,QAAQ,EAAE;IACxCI,OAAO,EAAE;EACX,CAAC,CAAC;;EAEF;EACkBD,IAAI,GAAG,CAAC,CAAC;EAE3B,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- // WARNING!
18
- // WARNING!
19
- // This file is used for tests that check intellisense. Editing this file by hand will likely
20
- // break tests that have hard coded line numbers and line offsets.
21
-
22
- import { Employee } from "@osdk/client.test.ontology";
23
- import { useOsdkObjects } from "@osdk/react/experimental";
24
- function TestComponent() {
25
- const {
26
- data
27
- } = useOsdkObjects(Employee, {
28
- withProperties: {
29
- constantValue: employee => employee.constant.integer(42)
30
- }
31
- });
32
- return null;
33
- }
34
- //# sourceMappingURL=useOsdkObjectsWithProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkObjectsWithProperties.js","names":["Employee","useOsdkObjects","TestComponent","data","withProperties","constantValue","employee","constant","integer"],"sources":["useOsdkObjectsWithProperties.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// WARNING!\n// WARNING!\n// This file is used for tests that check intellisense. Editing this file by hand will likely\n// break tests that have hard coded line numbers and line offsets.\n\nimport type { DerivedProperty } from \"@osdk/api\";\nimport { Employee } from \"@osdk/client.test.ontology\";\nimport { useOsdkObjects } from \"@osdk/react/experimental\";\n\nfunction TestComponent() {\n const withProps: DerivedProperty.Clause<typeof Employee> = {\n constantValue: (employee) => employee.constant.integer(42),\n };\n\n const { data } = useOsdkObjects(Employee, {\n withProperties: withProps,\n });\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,aAAaA,CAAA,EAAG;EAKvB,MAAM;IAAEC;EAAK,CAAC,GAAGF,cAAc,CAACD,QAAQ,EAAE;IACxCI,cAAc,EAL2C;MACzDC,aAAa,EAAGC,QAAQ,IAAKA,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,EAAE;IAC3D;EAIA,CAAC,CAAC;EAEF,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1,148 +0,0 @@
1
- /*
2
- * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { startTsServer } from "@osdk/client/internal-node";
18
- import { findUpSync } from "find-up";
19
- import * as path from "node:path";
20
- import invariant from "tiny-invariant";
21
- import * as ts from "typescript";
22
- import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
23
-
24
- // it needs to be hoisted because its referenced from our mocked WebSocket
25
- // which must be hoisted to work
26
- const rootLogger = await vi.hoisted(async () => {
27
- const pino = (await import("pino")).pino;
28
- const pinoPretty = await import("pino-pretty");
29
- const {
30
- EventEmitter
31
- } = await import("node:events");
32
- return Promise.resolve(pino({
33
- level: "info"
34
- }, pinoPretty.build({
35
- sync: true,
36
- timestampKey: undefined,
37
- errorLikeObjectKeys: ["error", "err", "exception"],
38
- errorProps: "stack,cause,properties",
39
- ignore: "time,hostname,pid",
40
- destination: new class extends EventEmitter {
41
- write(a) {
42
- // remove trailing newline since console.log adds one
43
- if (a.at(-1) === "\n") a = a.slice(0, -1);
44
-
45
- // This lets the test framework aggregate the logs per test, whereas direct to stdout does not
46
- console.log(a);
47
- }
48
- }()
49
- })));
50
- });
51
-
52
- /**
53
- * @vitest-environment node
54
- * @vitest-pool forks
55
- */
56
- describe("intellisense", () => {
57
- let packagesDir;
58
- let reactPackagePath;
59
- beforeAll(() => {
60
- const reactPackageJson = findUpSync("package.json", {
61
- cwd: import.meta.dirname
62
- });
63
- console.log({
64
- reactPackageJson
65
- });
66
- !(reactPackageJson != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
67
- packagesDir = path.join(path.dirname(reactPackageJson), "..");
68
- reactPackagePath = path.join(packagesDir, "react");
69
- });
70
- let tsServer;
71
- let intellisenseFilePath;
72
- beforeEach(async a => {
73
- intellisenseFilePath = path.join(reactPackagePath, "src", "intellisense.test.helpers", `${a.task.name}.ts`);
74
- console.log(intellisenseFilePath);
75
- expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();
76
- try {
77
- tsServer = await startTsServer(rootLogger);
78
- await tsServer.sendOpenRequest({
79
- file: intellisenseFilePath
80
- });
81
- } catch (error) {
82
- if (tsServer) {
83
- try {
84
- tsServer.stop();
85
- } catch {
86
- // Ignore cleanup errors
87
- }
88
- tsServer = undefined;
89
- }
90
- throw error;
91
- }
92
- });
93
- afterEach(() => {
94
- if (tsServer) {
95
- tsServer.stop();
96
- tsServer = undefined;
97
- }
98
- });
99
- it("useOsdkObjectsWithPivot", {
100
- timeout: 40_000
101
- }, async () => {
102
- expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();
103
- !tsServer ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
104
- const {
105
- resp
106
- } = await tsServer.sendCompletionsRequest({
107
- file: intellisenseFilePath,
108
- line: 29,
109
- offset: 15,
110
- triggerKind: ts.CompletionTriggerKind.Invoked
111
- });
112
- const completions = resp.body?.entries.map(e => e.name) ?? [];
113
- expect(completions).toContain("lead");
114
- const {
115
- resp: typeResp
116
- } = await tsServer.sendQuickInfoRequest({
117
- file: intellisenseFilePath,
118
- line: 33,
119
- offset: 10
120
- });
121
- expect(typeResp.body?.displayString).toBeDefined();
122
- expect(typeResp.body?.displayString).toContain("Employee");
123
- });
124
- it("useOsdkObjectsWithProperties", {
125
- timeout: 40_000
126
- }, async () => {
127
- expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();
128
- !tsServer ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
129
- const {
130
- resp
131
- } = await tsServer.sendQuickInfoRequest({
132
- file: intellisenseFilePath,
133
- line: 27,
134
- offset: 10
135
- });
136
- expect(resp.body?.displayString).toContain("DerivedProperty.Clause");
137
- const {
138
- resp: dataResp
139
- } = await tsServer.sendQuickInfoRequest({
140
- file: intellisenseFilePath,
141
- line: 31,
142
- offset: 11
143
- });
144
- expect(dataResp.body?.displayString).toBeDefined();
145
- expect(dataResp.body?.displayString).toContain("Osdk.Instance<Employee");
146
- });
147
- });
148
- //# sourceMappingURL=intellisense.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intellisense.test.js","names":["startTsServer","findUpSync","path","invariant","ts","afterEach","beforeAll","beforeEach","describe","expect","it","vi","rootLogger","hoisted","pino","pinoPretty","EventEmitter","Promise","resolve","level","build","sync","timestampKey","undefined","errorLikeObjectKeys","errorProps","ignore","destination","write","a","at","slice","console","log","packagesDir","reactPackagePath","reactPackageJson","cwd","import","meta","dirname","process","env","NODE_ENV","join","tsServer","intellisenseFilePath","task","name","sys","fileExists","toBeTruthy","sendOpenRequest","file","error","stop","timeout","resp","sendCompletionsRequest","line","offset","triggerKind","CompletionTriggerKind","Invoked","completions","body","entries","map","e","toContain","typeResp","sendQuickInfoRequest","displayString","toBeDefined","dataResp"],"sources":["intellisense.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport type { TsServer } from \"@osdk/client/internal-node\";\nimport { startTsServer } from \"@osdk/client/internal-node\";\nimport { findUpSync } from \"find-up\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport * as ts from \"typescript\";\nimport {\n afterEach,\n beforeAll,\n beforeEach,\n describe,\n expect,\n it,\n vi,\n} from \"vitest\";\n\n// it needs to be hoisted because its referenced from our mocked WebSocket\n// which must be hoisted to work\nconst rootLogger = await vi.hoisted(async (): Promise<Logger> => {\n const pino = (await import(\"pino\")).pino;\n const pinoPretty = await import(\"pino-pretty\");\n const { EventEmitter } = await import(\"node:events\");\n class PinoConsoleLogDestination extends EventEmitter {\n write(a: string) {\n // remove trailing newline since console.log adds one\n if (a.at(-1) === \"\\n\") a = a.slice(0, -1);\n\n // This lets the test framework aggregate the logs per test, whereas direct to stdout does not\n console.log(a);\n }\n }\n return Promise.resolve(pino(\n { level: \"info\" },\n (pinoPretty.build)({\n sync: true,\n timestampKey: undefined,\n errorLikeObjectKeys: [\"error\", \"err\", \"exception\"],\n errorProps: \"stack,cause,properties\",\n ignore: \"time,hostname,pid\",\n destination: new PinoConsoleLogDestination(),\n }),\n ));\n});\n\n/**\n * @vitest-environment node\n * @vitest-pool forks\n */\ndescribe(\"intellisense\", () => {\n let packagesDir: string;\n let reactPackagePath: string;\n\n beforeAll(() => {\n const reactPackageJson = findUpSync(\"package.json\", {\n cwd: import.meta.dirname,\n });\n console.log({ reactPackageJson });\n invariant(reactPackageJson != null);\n packagesDir = path.join(\n path.dirname(reactPackageJson),\n \"..\",\n );\n\n reactPackagePath = path.join(packagesDir, \"react\");\n });\n\n let tsServer: TsServer | undefined;\n let intellisenseFilePath: string;\n\n beforeEach(async (a) => {\n intellisenseFilePath = path.join(\n reactPackagePath,\n \"src\",\n \"intellisense.test.helpers\",\n `${a.task.name}.ts`,\n );\n\n console.log(intellisenseFilePath);\n\n expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();\n\n try {\n tsServer = await startTsServer(rootLogger);\n await tsServer.sendOpenRequest({ file: intellisenseFilePath });\n } catch (error) {\n if (tsServer) {\n try {\n tsServer.stop();\n } catch {\n // Ignore cleanup errors\n }\n tsServer = undefined;\n }\n throw error;\n }\n });\n\n afterEach(() => {\n if (tsServer) {\n tsServer.stop();\n tsServer = undefined;\n }\n });\n\n it(\"useOsdkObjectsWithPivot\", { timeout: 40_000 }, async () => {\n expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();\n invariant(tsServer);\n\n const { resp } = await tsServer.sendCompletionsRequest({\n file: intellisenseFilePath,\n line: 29,\n offset: 15,\n triggerKind: ts.CompletionTriggerKind.Invoked,\n });\n\n const completions = resp.body?.entries.map(e => e.name) ?? [];\n expect(completions).toContain(\"lead\");\n\n const { resp: typeResp } = await tsServer.sendQuickInfoRequest({\n file: intellisenseFilePath,\n line: 33,\n offset: 10,\n });\n\n expect(typeResp.body?.displayString).toBeDefined();\n expect(typeResp.body?.displayString).toContain(\"Employee\");\n });\n\n it(\"useOsdkObjectsWithProperties\", { timeout: 40_000 }, async () => {\n expect(ts.sys.fileExists(intellisenseFilePath)).toBeTruthy();\n invariant(tsServer);\n\n const { resp } = await tsServer.sendQuickInfoRequest({\n file: intellisenseFilePath,\n line: 27,\n offset: 10,\n });\n\n expect(resp.body?.displayString).toContain(\"DerivedProperty.Clause\");\n\n const { resp: dataResp } = await tsServer.sendQuickInfoRequest({\n file: intellisenseFilePath,\n line: 31,\n offset: 11,\n });\n\n expect(dataResp.body?.displayString).toBeDefined();\n expect(dataResp.body?.displayString).toContain(\"Osdk.Instance<Employee\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,UAAU,QAAQ,SAAS;AACpC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAO,KAAKC,EAAE,MAAM,YAAY;AAChC,SACEC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,MAAM,EACNC,EAAE,EACFC,EAAE,QACG,QAAQ;;AAEf;AACA;AACA,MAAMC,UAAU,GAAG,MAAMD,EAAE,CAACE,OAAO,CAAC,YAA6B;EAC/D,MAAMC,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAEA,IAAI;EACxC,MAAMC,UAAU,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;EAC9C,MAAM;IAAEC;EAAa,CAAC,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;EAUpD,OAAOC,OAAO,CAACC,OAAO,CAACJ,IAAI,CACzB;IAAEK,KAAK,EAAE;EAAO,CAAC,EAChBJ,UAAU,CAACK,KAAK,CAAE;IACjBC,IAAI,EAAE,IAAI;IACVC,YAAY,EAAEC,SAAS;IACvBC,mBAAmB,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC;IAClDC,UAAU,EAAE,wBAA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A,GAAU,OAAOA,MAAK,CAAA;AAC1E,MAAA,QAAA,CAAS,YAAY,CAAA;AAAA,KACtB,CAAA;AACD,IAAO,OAAA;AAAA,MACL,OAAS,EAAA;AAAA,KACX;AAAA;AAEF,EAAO,OAAA;AAAA,IACL,OAAS,EAAA,KAAA;AAAA,IACT,QAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-V32JHU3O.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 React from \"react\";\nfunction fakeClientFn(..._args) {\n throw new Error(\"This is not a real client. Did you forget to <OsdkContext.Provider>?\");\n}\nconst fakeClient = Object.assign(fakeClientFn, {\n fetchMetadata: fakeClientFn\n});\nexport const OsdkContext = /*#__PURE__*/React.createContext({\n client: fakeClient\n});","/*\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 React from \"react\";\nimport { OsdkContext } from \"./OsdkContext.js\";\nexport function useOsdkClient() {\n return React.useContext(OsdkContext).client;\n}","/*\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 React from \"react\";\nimport { useOsdkClient } from \"./useOsdkClient.js\";\nexport function useOsdkMetadata(type) {\n const client = useOsdkClient();\n const [metadata, setMetadata] = React.useState(undefined);\n const [error, setError] = React.useState();\n if (!metadata && !error) {\n client.fetchMetadata(type).then(fetchedMetadata => {\n setMetadata(fetchedMetadata);\n }).catch(error => {\n const errorMessage = error instanceof Error ? error.message : String(error);\n setError(errorMessage);\n });\n return {\n loading: true\n };\n }\n return {\n loading: false,\n metadata,\n error\n };\n}"]}
@@ -1,14 +0,0 @@
1
- import { Client } from '@osdk/client';
2
- import { ObjectOrInterfaceDefinition, InterfaceDefinition, InterfaceMetadata, ObjectTypeDefinition, ObjectMetadata } from '@osdk/api';
3
-
4
- declare function useOsdkClient(): Client;
5
-
6
- type MetadataFor<T extends ObjectOrInterfaceDefinition> = T extends InterfaceDefinition ? InterfaceMetadata : T extends ObjectTypeDefinition ? ObjectMetadata : never;
7
- interface UseOsdkMetadataResult<T extends ObjectOrInterfaceDefinition> {
8
- loading: boolean;
9
- metadata?: MetadataFor<T>;
10
- error?: string;
11
- }
12
- declare function useOsdkMetadata<T extends ObjectOrInterfaceDefinition>(type: T): UseOsdkMetadataResult<T>;
13
-
14
- export { type UseOsdkMetadataResult as U, useOsdkMetadata as a, useOsdkClient as u };
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkObjectsWithPivot.js","names":["Employee","useOsdkObjects","TestComponent","data","pivotTo"],"sources":["useOsdkObjectsWithPivot.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// WARNING!\n// WARNING!\n// This file is used for tests that check intellisense. Editing this file by hand will likely\n// break tests that have hard coded line numbers and line offsets.\n\nimport { Employee } from \"@osdk/client.test.ontology\";\nimport { useOsdkObjects } from \"@osdk/react/experimental\";\n\ndeclare const MyComponent: () => void;\n\nfunction TestComponent() {\n const { data } = useOsdkObjects(Employee, {\n pivotTo: \"lead\",\n });\n\n // Line 31: Check that data has the correct pivoted type\n const firstItem = data?.[0];\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AAIzD,SAASC,aAAaA,CAAA,EAAG;EACvB,MAAM;IAAEC;EAAK,CAAC,GAAGF,cAAc,CAACD,QAAQ,EAAE;IACxCI,OAAO,EAAE;EACX,CAAC,CAAC;;EAEF;EACkBD,IAAI,GAAG,CAAC,CAAC;EAE3B,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOsdkObjectsWithProperties.js","names":["Employee","useOsdkObjects","TestComponent","data","withProperties","constantValue","employee","constant","integer"],"sources":["useOsdkObjectsWithProperties.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// WARNING!\n// WARNING!\n// This file is used for tests that check intellisense. Editing this file by hand will likely\n// break tests that have hard coded line numbers and line offsets.\n\nimport type { DerivedProperty } from \"@osdk/api\";\nimport { Employee } from \"@osdk/client.test.ontology\";\nimport { useOsdkObjects } from \"@osdk/react/experimental\";\n\nfunction TestComponent() {\n const withProps: DerivedProperty.Clause<typeof Employee> = {\n constantValue: (employee) => employee.constant.integer(42),\n };\n\n const { data } = useOsdkObjects(Employee, {\n withProperties: withProps,\n });\n\n return null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,aAAaA,CAAA,EAAG;EAKvB,MAAM;IAAEC;EAAK,CAAC,GAAGF,cAAc,CAACD,QAAQ,EAAE;IACxCI,cAAc,EAL2C;MACzDC,aAAa,EAAGC,QAAQ,IAAKA,QAAQ,CAACC,QAAQ,CAACC,OAAO,CAAC,EAAE;IAC3D;EAIA,CAAC,CAAC;EAEF,OAAO,IAAI;AACb","ignoreList":[]}