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

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 (129) hide show
  1. package/AGENTS.md +46 -221
  2. package/CHANGELOG.md +147 -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/platform-apis/admin/useCbacBanner.js +63 -0
  6. package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  7. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  8. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  9. package/build/browser/new/platform-apis/admin/useMarkingCategories.js +46 -0
  10. package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  11. package/build/browser/new/platform-apis/admin/useMarkings.js +46 -0
  12. package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -0
  13. package/build/browser/new/platform-apis/admin/useUserMarkings.js +50 -0
  14. package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  15. package/build/browser/new/useLinks.js +11 -4
  16. package/build/browser/new/useLinks.js.map +1 -1
  17. package/build/browser/new/useObjectSet.js +42 -18
  18. package/build/browser/new/useObjectSet.js.map +1 -1
  19. package/build/browser/new/useOsdkAction.js +2 -2
  20. package/build/browser/new/useOsdkAction.js.map +1 -1
  21. package/build/browser/new/useOsdkAggregation.js +65 -27
  22. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  23. package/build/browser/new/useOsdkFunction.js +17 -12
  24. package/build/browser/new/useOsdkFunction.js.map +1 -1
  25. package/build/browser/new/useOsdkObject.js +48 -26
  26. package/build/browser/new/useOsdkObject.js.map +1 -1
  27. package/build/browser/new/useOsdkObjects.js +32 -19
  28. package/build/browser/new/useOsdkObjects.js.map +1 -1
  29. package/build/browser/public/experimental/admin.js +25 -0
  30. package/build/browser/public/experimental/admin.js.map +1 -0
  31. package/build/browser/public/experimental.js +0 -3
  32. package/build/browser/public/experimental.js.map +1 -1
  33. package/build/browser/useOsdkMetadata.js.map +1 -1
  34. package/build/cjs/{chunk-V32JHU3O.cjs → chunk-OVBG5VXE.cjs} +3 -8
  35. package/build/cjs/chunk-OVBG5VXE.cjs.map +1 -0
  36. package/build/cjs/chunk-SVVMLSKN.cjs +111 -0
  37. package/build/cjs/chunk-SVVMLSKN.cjs.map +1 -0
  38. package/build/cjs/index.cjs +4 -4
  39. package/build/cjs/index.d.cts +1 -1
  40. package/build/cjs/public/experimental/admin.cjs +293 -0
  41. package/build/cjs/public/experimental/admin.cjs.map +1 -0
  42. package/build/cjs/public/experimental/admin.d.cts +275 -0
  43. package/build/cjs/public/experimental.cjs +261 -492
  44. package/build/cjs/public/experimental.cjs.map +1 -1
  45. package/build/cjs/public/experimental.d.cts +113 -138
  46. package/build/cjs/useOsdkMetadata-BElt3F5s.d.cts +15 -0
  47. package/build/esm/new/makeExternalStore.js +61 -0
  48. package/build/esm/new/makeExternalStore.js.map +1 -1
  49. package/build/esm/new/platform-apis/admin/useCbacBanner.js +63 -0
  50. package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -0
  51. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js +64 -0
  52. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -0
  53. package/build/esm/new/platform-apis/admin/useMarkingCategories.js +46 -0
  54. package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -0
  55. package/build/esm/new/platform-apis/admin/useMarkings.js +46 -0
  56. package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -0
  57. package/build/esm/new/platform-apis/admin/useUserMarkings.js +50 -0
  58. package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -0
  59. package/build/esm/new/useLinks.js +11 -4
  60. package/build/esm/new/useLinks.js.map +1 -1
  61. package/build/esm/new/useObjectSet.js +42 -18
  62. package/build/esm/new/useObjectSet.js.map +1 -1
  63. package/build/esm/new/useOsdkAction.js +2 -2
  64. package/build/esm/new/useOsdkAction.js.map +1 -1
  65. package/build/esm/new/useOsdkAggregation.js +65 -27
  66. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  67. package/build/esm/new/useOsdkFunction.js +17 -12
  68. package/build/esm/new/useOsdkFunction.js.map +1 -1
  69. package/build/esm/new/useOsdkObject.js +48 -26
  70. package/build/esm/new/useOsdkObject.js.map +1 -1
  71. package/build/esm/new/useOsdkObjects.js +32 -19
  72. package/build/esm/new/useOsdkObjects.js.map +1 -1
  73. package/build/esm/public/experimental/admin.js +25 -0
  74. package/build/esm/public/experimental/admin.js.map +1 -0
  75. package/build/esm/public/experimental.js +0 -3
  76. package/build/esm/public/experimental.js.map +1 -1
  77. package/build/esm/useOsdkMetadata.js.map +1 -1
  78. package/build/types/new/makeExternalStore.d.ts +11 -0
  79. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  80. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts +33 -0
  81. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -0
  82. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts +34 -0
  83. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -0
  84. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts +27 -0
  85. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -0
  86. package/build/types/new/platform-apis/admin/useMarkings.d.ts +27 -0
  87. package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -0
  88. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts +33 -0
  89. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -0
  90. package/build/types/new/useLinks.d.ts +19 -0
  91. package/build/types/new/useLinks.d.ts.map +1 -1
  92. package/build/types/new/useObjectSet.d.ts +10 -4
  93. package/build/types/new/useObjectSet.d.ts.map +1 -1
  94. package/build/types/new/useOsdkAggregation.d.ts +41 -3
  95. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  96. package/build/types/new/useOsdkFunction.d.ts +11 -5
  97. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  98. package/build/types/new/useOsdkObject.d.ts +19 -7
  99. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  100. package/build/types/new/useOsdkObjects.d.ts +32 -2
  101. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  102. package/build/types/public/experimental/admin.d.ts +11 -0
  103. package/build/types/public/experimental/admin.d.ts.map +1 -0
  104. package/build/types/public/experimental.d.ts +0 -3
  105. package/build/types/public/experimental.d.ts.map +1 -1
  106. package/build/types/useOsdkMetadata.d.ts +5 -4
  107. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  108. package/docs/querying-data.md +19 -0
  109. package/{build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js → experimental/admin.d.ts} +1 -19
  110. package/package.json +28 -7
  111. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  112. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  113. package/build/browser/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  114. package/build/browser/intellisense.test.js +0 -148
  115. package/build/browser/intellisense.test.js.map +0 -1
  116. package/build/cjs/chunk-V32JHU3O.cjs.map +0 -1
  117. package/build/cjs/useOsdkMetadata-DFZhnhGZ.d.cts +0 -14
  118. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js +0 -35
  119. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithPivot.js.map +0 -1
  120. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js +0 -34
  121. package/build/esm/intellisense.test.helpers/useOsdkObjectsWithProperties.js.map +0 -1
  122. package/build/esm/intellisense.test.js +0 -148
  123. package/build/esm/intellisense.test.js.map +0 -1
  124. package/build/types/intellisense.test.d.ts +0 -1
  125. package/build/types/intellisense.test.d.ts.map +0 -1
  126. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts +0 -1
  127. package/build/types/intellisense.test.helpers/useOsdkObjectsWithPivot.d.ts.map +0 -1
  128. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts +0 -1
  129. package/build/types/intellisense.test.helpers/useOsdkObjectsWithProperties.d.ts.map +0 -1
@@ -0,0 +1,11 @@
1
+ export { useCbacBanner } from "../../new/platform-apis/admin/useCbacBanner.js";
2
+ export type { CbacBannerData, UseCbacBannerOptions, UseCbacBannerResult } from "../../new/platform-apis/admin/useCbacBanner.js";
3
+ export { useCbacMarkingRestrictions } from "../../new/platform-apis/admin/useCbacMarkingRestrictions.js";
4
+ export type { CbacMarkingRestrictionsData, UseCbacMarkingRestrictionsOptions, UseCbacMarkingRestrictionsResult } from "../../new/platform-apis/admin/useCbacMarkingRestrictions.js";
5
+ export { useCurrentFoundryUser } from "../../new/platform-apis/admin/useCurrentFoundryUser.js";
6
+ export { useFoundryUser } from "../../new/platform-apis/admin/useFoundryUser.js";
7
+ export { useFoundryUsersList } from "../../new/platform-apis/admin/useFoundryUsersList.js";
8
+ export { useMarkingCategories } from "../../new/platform-apis/admin/useMarkingCategories.js";
9
+ export { useMarkings } from "../../new/platform-apis/admin/useMarkings.js";
10
+ export { useUserViewMarkings } from "../../new/platform-apis/admin/useUserMarkings.js";
11
+ export type { UseUserViewMarkingsOptions, UseUserViewMarkingsResult } from "../../new/platform-apis/admin/useUserMarkings.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,cACE,gBACA,sBACA,2BACK;AACP,SAAS,kCAAkC;AAC3C,cACE,6BACA,mCACA,wCACK;AACP,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,2BAA2B;AACpC,cACE,4BACA,iCACK","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,22 +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
- pivotTo: "lead"
29
- });
30
-
31
- // Line 31: Check that data has the correct pivoted type
32
- data?.[0];
33
- return null;
34
- }
35
- //# sourceMappingURL=useOsdkObjectsWithPivot.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.11",
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.54.0",
66
+ "@osdk/foundry.core": "2.54.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",
79
+ "@osdk/api": "2.8.0-beta.26",
80
+ "@osdk/client": "2.8.0-beta.26",
62
81
  "@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"
82
+ "@osdk/monorepo.tsconfig": "~0.7.0-beta.1",
83
+ "@osdk/client.test.ontology": "2.8.0-beta.26"
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,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A,MAAM,SAAS,aAAc,EAAA;AAC7B,EAAA,MAAM,CAAC,QAAU,EAAA,WAAW,CAAIA,GAAAA,uBAAAA,CAAM,SAAS,MAAS,CAAA;AACxD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,wBAAM,QAAS,EAAA;AACzC,EAAI,IAAA,CAAC,QAAY,IAAA,CAAC,KAAO,EAAA;AACvB,IAAA,MAAA,CAAO,aAAc,CAAA,IAAI,CAAE,CAAA,IAAA,CAAK,CAAmB,eAAA,KAAA;AACjD,MAAA,WAAA,CAAY,eAAe,CAAA;AAAA,KAC5B,CAAA,CAAE,KAAM,CAAA,CAAAC,MAAS,KAAA;AAChB,MAAA,MAAM,eAAeA,MAAiB,YAAA,KAAA,GAAQA,MAAM,CAAA,OAAA,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,35 +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
- pivotTo: "lead"
29
- });
30
-
31
- // Line 31: Check that data has the correct pivoted type
32
- data?.[0];
33
- return null;
34
- }
35
- //# sourceMappingURL=useOsdkObjectsWithPivot.js.map
@@ -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":[]}