@osdk/unit-testing 0.0.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/build/browser/api/MockClient.js +2 -0
  3. package/build/browser/api/MockClient.js.map +1 -0
  4. package/build/browser/api/MockOsdkObjectOptions.js +2 -0
  5. package/build/browser/api/MockOsdkObjectOptions.js.map +1 -0
  6. package/build/browser/api/StubBuilders.js +2 -0
  7. package/build/browser/api/StubBuilders.js.map +1 -0
  8. package/build/browser/api/StubClient.js +2 -0
  9. package/build/browser/api/StubClient.js.map +1 -0
  10. package/build/browser/api/index.js +2 -0
  11. package/build/browser/api/index.js.map +1 -0
  12. package/build/browser/example-function-tests/basicAggregate/basicAggregate.js +49 -0
  13. package/build/browser/example-function-tests/basicAggregate/basicAggregate.js.map +1 -0
  14. package/build/browser/example-function-tests/basicFetchPage/basicFetchPage.js +29 -0
  15. package/build/browser/example-function-tests/basicFetchPage/basicFetchPage.js.map +1 -0
  16. package/build/browser/example-function-tests/basicQuery/basicQuery.js +27 -0
  17. package/build/browser/example-function-tests/basicQuery/basicQuery.js.map +1 -0
  18. package/build/browser/example-function-tests/objectAsInput/objectAsInput.js +26 -0
  19. package/build/browser/example-function-tests/objectAsInput/objectAsInput.js.map +1 -0
  20. package/build/browser/example-function-tests/objectSetAsInput/objectSetAsInput.js +29 -0
  21. package/build/browser/example-function-tests/objectSetAsInput/objectSetAsInput.js.map +1 -0
  22. package/build/browser/example-function-tests/objectWithLinks/objectWithLinks.js +43 -0
  23. package/build/browser/example-function-tests/objectWithLinks/objectWithLinks.js.map +1 -0
  24. package/build/browser/example-function-tests/ontologyEdits/ontologyEdits.js +37 -0
  25. package/build/browser/example-function-tests/ontologyEdits/ontologyEdits.js.map +1 -0
  26. package/build/browser/example-function-tests/platformApiWithMsw/platformApiWithMsw.js +25 -0
  27. package/build/browser/example-function-tests/platformApiWithMsw/platformApiWithMsw.js.map +1 -0
  28. package/build/browser/example-function-tests/queryWithArrayParams/queryWithArrayParams.js +27 -0
  29. package/build/browser/example-function-tests/queryWithArrayParams/queryWithArrayParams.js.map +1 -0
  30. package/build/browser/index.js +21 -0
  31. package/build/browser/index.js.map +1 -0
  32. package/build/browser/mock/createMockAttachment.js +31 -0
  33. package/build/browser/mock/createMockAttachment.js.map +1 -0
  34. package/build/browser/mock/createMockClient.js +142 -0
  35. package/build/browser/mock/createMockClient.js.map +1 -0
  36. package/build/browser/mock/createMockObjectSet.js +36 -0
  37. package/build/browser/mock/createMockObjectSet.js.map +1 -0
  38. package/build/browser/mock/createMockObjectSetWithResolver.js +122 -0
  39. package/build/browser/mock/createMockObjectSetWithResolver.js.map +1 -0
  40. package/build/browser/mock/createMockOsdkObject.js +235 -0
  41. package/build/browser/mock/createMockOsdkObject.js.map +1 -0
  42. package/build/browser/public/experimental.js +21 -0
  43. package/build/browser/public/experimental.js.map +1 -0
  44. package/build/cjs/chunk-SEUQK2F4.cjs +445 -0
  45. package/build/cjs/chunk-SEUQK2F4.cjs.map +1 -0
  46. package/build/cjs/index.cjs +24 -0
  47. package/build/cjs/index.cjs.map +1 -0
  48. package/build/cjs/index.d.cts +99 -0
  49. package/build/cjs/public/experimental.cjs +24 -0
  50. package/build/cjs/public/experimental.cjs.map +1 -0
  51. package/build/cjs/public/experimental.d.cts +3 -0
  52. package/build/esm/api/MockClient.js +2 -0
  53. package/build/esm/api/MockClient.js.map +1 -0
  54. package/build/esm/api/MockOsdkObjectOptions.js +2 -0
  55. package/build/esm/api/MockOsdkObjectOptions.js.map +1 -0
  56. package/build/esm/api/StubBuilders.js +2 -0
  57. package/build/esm/api/StubBuilders.js.map +1 -0
  58. package/build/esm/api/StubClient.js +2 -0
  59. package/build/esm/api/StubClient.js.map +1 -0
  60. package/build/esm/api/index.js +2 -0
  61. package/build/esm/api/index.js.map +1 -0
  62. package/build/esm/example-function-tests/basicAggregate/basicAggregate.js +49 -0
  63. package/build/esm/example-function-tests/basicAggregate/basicAggregate.js.map +1 -0
  64. package/build/esm/example-function-tests/basicFetchPage/basicFetchPage.js +29 -0
  65. package/build/esm/example-function-tests/basicFetchPage/basicFetchPage.js.map +1 -0
  66. package/build/esm/example-function-tests/basicQuery/basicQuery.js +27 -0
  67. package/build/esm/example-function-tests/basicQuery/basicQuery.js.map +1 -0
  68. package/build/esm/example-function-tests/objectAsInput/objectAsInput.js +26 -0
  69. package/build/esm/example-function-tests/objectAsInput/objectAsInput.js.map +1 -0
  70. package/build/esm/example-function-tests/objectSetAsInput/objectSetAsInput.js +29 -0
  71. package/build/esm/example-function-tests/objectSetAsInput/objectSetAsInput.js.map +1 -0
  72. package/build/esm/example-function-tests/objectWithLinks/objectWithLinks.js +43 -0
  73. package/build/esm/example-function-tests/objectWithLinks/objectWithLinks.js.map +1 -0
  74. package/build/esm/example-function-tests/ontologyEdits/ontologyEdits.js +37 -0
  75. package/build/esm/example-function-tests/ontologyEdits/ontologyEdits.js.map +1 -0
  76. package/build/esm/example-function-tests/platformApiWithMsw/platformApiWithMsw.js +25 -0
  77. package/build/esm/example-function-tests/platformApiWithMsw/platformApiWithMsw.js.map +1 -0
  78. package/build/esm/example-function-tests/queryWithArrayParams/queryWithArrayParams.js +27 -0
  79. package/build/esm/example-function-tests/queryWithArrayParams/queryWithArrayParams.js.map +1 -0
  80. package/build/esm/index.js +21 -0
  81. package/build/esm/index.js.map +1 -0
  82. package/build/esm/mock/createMockAttachment.js +31 -0
  83. package/build/esm/mock/createMockAttachment.js.map +1 -0
  84. package/build/esm/mock/createMockClient.js +142 -0
  85. package/build/esm/mock/createMockClient.js.map +1 -0
  86. package/build/esm/mock/createMockObjectSet.js +36 -0
  87. package/build/esm/mock/createMockObjectSet.js.map +1 -0
  88. package/build/esm/mock/createMockObjectSetWithResolver.js +122 -0
  89. package/build/esm/mock/createMockObjectSetWithResolver.js.map +1 -0
  90. package/build/esm/mock/createMockOsdkObject.js +235 -0
  91. package/build/esm/mock/createMockOsdkObject.js.map +1 -0
  92. package/build/esm/public/experimental.js +21 -0
  93. package/build/esm/public/experimental.js.map +1 -0
  94. package/build/types/api/MockClient.d.ts +21 -0
  95. package/build/types/api/MockClient.d.ts.map +1 -0
  96. package/build/types/api/MockOsdkObjectOptions.d.ts +14 -0
  97. package/build/types/api/MockOsdkObjectOptions.d.ts.map +1 -0
  98. package/build/types/api/StubBuilders.d.ts +28 -0
  99. package/build/types/api/StubBuilders.d.ts.map +1 -0
  100. package/build/types/api/StubClient.d.ts +5 -0
  101. package/build/types/api/StubClient.d.ts.map +1 -0
  102. package/build/types/api/index.d.ts +4 -0
  103. package/build/types/api/index.d.ts.map +1 -0
  104. package/build/types/example-function-tests/basicAggregate/basicAggregate.d.ts +3 -0
  105. package/build/types/example-function-tests/basicAggregate/basicAggregate.d.ts.map +1 -0
  106. package/build/types/example-function-tests/basicFetchPage/basicFetchPage.d.ts +4 -0
  107. package/build/types/example-function-tests/basicFetchPage/basicFetchPage.d.ts.map +1 -0
  108. package/build/types/example-function-tests/basicQuery/basicQuery.d.ts +3 -0
  109. package/build/types/example-function-tests/basicQuery/basicQuery.d.ts.map +1 -0
  110. package/build/types/example-function-tests/objectAsInput/objectAsInput.d.ts +3 -0
  111. package/build/types/example-function-tests/objectAsInput/objectAsInput.d.ts.map +1 -0
  112. package/build/types/example-function-tests/objectSetAsInput/objectSetAsInput.d.ts +4 -0
  113. package/build/types/example-function-tests/objectSetAsInput/objectSetAsInput.d.ts.map +1 -0
  114. package/build/types/example-function-tests/objectWithLinks/objectWithLinks.d.ts +7 -0
  115. package/build/types/example-function-tests/objectWithLinks/objectWithLinks.d.ts.map +1 -0
  116. package/build/types/example-function-tests/ontologyEdits/ontologyEdits.d.ts +7 -0
  117. package/build/types/example-function-tests/ontologyEdits/ontologyEdits.d.ts.map +1 -0
  118. package/build/types/example-function-tests/platformApiWithMsw/platformApiWithMsw.d.ts +2 -0
  119. package/build/types/example-function-tests/platformApiWithMsw/platformApiWithMsw.d.ts.map +1 -0
  120. package/build/types/example-function-tests/queryWithArrayParams/queryWithArrayParams.d.ts +2 -0
  121. package/build/types/example-function-tests/queryWithArrayParams/queryWithArrayParams.d.ts.map +1 -0
  122. package/build/types/index.d.ts +5 -0
  123. package/build/types/index.d.ts.map +1 -0
  124. package/build/types/mock/createMockAttachment.d.ts +2 -0
  125. package/build/types/mock/createMockAttachment.d.ts.map +1 -0
  126. package/build/types/mock/createMockClient.d.ts +2 -0
  127. package/build/types/mock/createMockClient.d.ts.map +1 -0
  128. package/build/types/mock/createMockObjectSet.d.ts +9 -0
  129. package/build/types/mock/createMockObjectSet.d.ts.map +1 -0
  130. package/build/types/mock/createMockObjectSetWithResolver.d.ts +10 -0
  131. package/build/types/mock/createMockObjectSetWithResolver.d.ts.map +1 -0
  132. package/build/types/mock/createMockOsdkObject.d.ts +32 -0
  133. package/build/types/mock/createMockOsdkObject.d.ts.map +1 -0
  134. package/build/types/public/experimental.d.ts +5 -0
  135. package/build/types/public/experimental.d.ts.map +1 -0
  136. package/experimental.d.ts +17 -0
  137. package/package.json +92 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,237 @@
1
+ # @osdk/unit-testing
2
+
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 56c5630: Drop redundant `--config $(find-up dprint.json)` from `lint`, `fix-lint`, and `format` scripts. dprint already auto-discovers `dprint.json` by walking up from cwd; the substitution was a no-op anyway since `find-up` is an npm package, not a CLI. Also fix the `uploadMediaOntologyEdits` documentation example so its `// @ts-ignore` survives dprint reformatting (the broken `format` step had been masking this).
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [56c5630]
12
+ - Updated dependencies [17d7ba2]
13
+ - @osdk/api@2.16.0
14
+ - @osdk/client@2.16.0
15
+ - @osdk/functions@1.9.0
16
+
17
+ ## 0.8.0
18
+
19
+ ### Minor Changes
20
+
21
+ - d1a7d90: Accessing a link that wasn't configured on a `createMockOsdkObject` mock no longer silently returns `undefined`. The accessor now exists, and its `fetchOne()` rejects / `fetchOneWithErrors()` resolves with a descriptive error naming the link, object type, and primary key.
22
+ - 9a06a62: Move user-facing types (`MockClient`, `StubClient`, `StubBuilderFor`, `FetchPageStubBuilder`, `FetchOneStubBuilder`, `AggregateStubBuilder`, `QueryStubBuilder`, `MockOsdkObjectOptions`) to dedicated files under `src/api/`. No public API changes.
23
+ - 9a06a62: Fix `StubBuilderFor<T>` so `fetchOneWithErrors` / `fetchPageWithErrors` / `asyncIter` resolve to the correct stub builders instead of falling through to `AggregateStubBuilder`. Allow `Error` as a single-link stub value in `createMockOsdkObject` so link `fetchOne` rejects and `fetchOneWithErrors` returns `{ error }` (previously wrapped the Error in `{ value: ... }`, making `isOk` always true).
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [f12977d]
28
+ - Updated dependencies [eb36e21]
29
+ - Updated dependencies [d892397]
30
+ - Updated dependencies [c5a6047]
31
+ - Updated dependencies [45be476]
32
+ - Updated dependencies [2c51525]
33
+ - Updated dependencies [20e9678]
34
+ - @osdk/client@2.14.0
35
+ - @osdk/functions@1.8.0
36
+ - @osdk/api@2.14.0
37
+
38
+ ## 0.7.0
39
+
40
+ ### Minor Changes
41
+
42
+ - 9e9d948: `deepEqual` (used to match stub args in `when` / `whenQuery`) now recognizes Vitest/Jest asymmetric matchers (`expect.any(...)`, `expect.anything()`, `expect.stringContaining(...)`, `expect.objectContaining(...)`, etc.). Previously matchers were compared by raw object shape and silently never matched.
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [19b7913]
47
+ - Updated dependencies [01fbb74]
48
+ - Updated dependencies [91f34a9]
49
+ - Updated dependencies [df1a4f8]
50
+ - Updated dependencies [46a00bc]
51
+ - Updated dependencies [267f324]
52
+ - @osdk/client@2.12.0
53
+ - @osdk/api@2.12.0
54
+
55
+ ## 0.6.0
56
+
57
+ ### Minor Changes
58
+
59
+ - 8e4472c: Add `thenThrow(error)` to `whenQuery(...)` stub builder. Lets tests explicitly configure a query's `executeFunction` to reject with a specific error, instead of only being able to exercise the implicit "no stub registered" error path.
60
+
61
+ ## 0.5.0
62
+
63
+ ### Minor Changes
64
+
65
+ - 40fb8c1: Attach a `SharedClientContext` to the mock client so Foundry Platform API helpers (e.g. `Users.getCurrent(client)`) don't crash inside `foundryPlatformFetch` on an undefined `baseUrl` before a request is made. Callers mock the HTTP layer themselves (MSW, `vi.spyOn(globalThis, "fetch")`, etc.).
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [58248f8]
70
+ - Updated dependencies [e456da5]
71
+ - @osdk/client@2.11.0
72
+ - @osdk/api@2.11.0
73
+
74
+ ## 0.4.0
75
+
76
+ ### Minor Changes
77
+
78
+ - 29ab35a: Use workspace:^ for peer dependencies to prevent changesets from propagating major bumps when a peer dep receives a minor version change. The internal codegen (`osdk-unstable-typescript generate --internal`) now emits `workspace:^` for peer deps while keeping `workspace:~` for regular/dev deps.
79
+ - f01a8f4: improvements(build): significant reduction in build task graphs
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [29ab35a]
84
+ - Updated dependencies [0fb9c8a]
85
+ - Updated dependencies [f01a8f4]
86
+ - Updated dependencies [f34a1ce]
87
+ - Updated dependencies [7e7f70b]
88
+ - @osdk/client@2.10.0
89
+ - @osdk/functions@1.7.0
90
+ - @osdk/api@2.10.0
91
+
92
+ ## 0.3.0
93
+
94
+ ### Minor Changes
95
+
96
+ - c08d97b: Rework mock client stubbing API: rename whenObjectSet to when, add standalone createMockObjectSet with whenObjectSet for registering stubs on object sets directly, and support ObjectSet as many-link value in createMockOsdkObject
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [f8b9f12]
101
+ - Updated dependencies [bcf359f]
102
+ - Updated dependencies [0b349bd]
103
+ - Updated dependencies [12f9b36]
104
+ - Updated dependencies [cbc8e9c]
105
+ - Updated dependencies [9171453]
106
+ - Updated dependencies [e8d14a0]
107
+ - Updated dependencies [51ccca8]
108
+ - Updated dependencies [fb85818]
109
+ - Updated dependencies [ec06b26]
110
+ - Updated dependencies [2394ca7]
111
+ - @osdk/client@2.9.0
112
+ - @osdk/api@2.9.0
113
+
114
+ ## 0.2.0
115
+
116
+ ### Minor Changes
117
+
118
+ - 0b3ce80: Query Stubbing and Exports
119
+ - 0df859a: Read primaryKeyApiName from object type const instead of options, move links into options, and add createMockAttachment helper
120
+ - 48e1409: Add basic utils for OSDK Testing
121
+ - 35f2f1a: Add Media inputs/outputs for Queries
122
+ - 68d0bef: Basic object set mocking
123
+
124
+ ### Patch Changes
125
+
126
+ - Updated dependencies [322c5bc]
127
+ - Updated dependencies [322c5bc]
128
+ - Updated dependencies [776ae8a]
129
+ - Updated dependencies [c40444b]
130
+ - Updated dependencies [4bb9769]
131
+ - Updated dependencies [09e5659]
132
+ - Updated dependencies [7538b79]
133
+ - Updated dependencies [abb0e0f]
134
+ - Updated dependencies [fceb4ce]
135
+ - Updated dependencies [520398c]
136
+ - Updated dependencies [73e617e]
137
+ - Updated dependencies [cbfa135]
138
+ - Updated dependencies [c8384de]
139
+ - Updated dependencies [f294f5a]
140
+ - Updated dependencies [dfc8019]
141
+ - Updated dependencies [599426b]
142
+ - Updated dependencies [e64bf0b]
143
+ - Updated dependencies [27a5902]
144
+ - Updated dependencies [0a0d7cb]
145
+ - Updated dependencies [f4604c2]
146
+ - Updated dependencies [642be5f]
147
+ - Updated dependencies [baba327]
148
+ - Updated dependencies [8825f8c]
149
+ - Updated dependencies [2b01323]
150
+ - Updated dependencies [8c60682]
151
+ - Updated dependencies [dda14be]
152
+ - Updated dependencies [ffc6efe]
153
+ - Updated dependencies [2855223]
154
+ - Updated dependencies [15e1686]
155
+ - Updated dependencies [26cec61]
156
+ - Updated dependencies [0df859a]
157
+ - Updated dependencies [d1ad4d1]
158
+ - Updated dependencies [0d174a2]
159
+ - Updated dependencies [d284bf2]
160
+ - Updated dependencies [4ef6adc]
161
+ - Updated dependencies [2ebe62c]
162
+ - Updated dependencies [60b5ffb]
163
+ - Updated dependencies [abb0e0f]
164
+ - Updated dependencies [8c30908]
165
+ - Updated dependencies [4cd7389]
166
+ - Updated dependencies [4a856cb]
167
+ - Updated dependencies [92e7297]
168
+ - Updated dependencies [b68cebd]
169
+ - Updated dependencies [35f2f1a]
170
+ - Updated dependencies [c9d954d]
171
+ - Updated dependencies [34a5ad2]
172
+ - Updated dependencies [044eb80]
173
+ - Updated dependencies [9d234b9]
174
+ - Updated dependencies [f5f95e2]
175
+ - Updated dependencies [46f0a47]
176
+ - Updated dependencies [4470c0d]
177
+ - Updated dependencies [d80c234]
178
+ - Updated dependencies [61e33ab]
179
+ - Updated dependencies [71e28ef]
180
+ - Updated dependencies [5848e3c]
181
+ - @osdk/api@2.8.0
182
+ - @osdk/client@2.8.0
183
+ - @osdk/functions@1.6.0
184
+
185
+ ## 0.2.0-beta.4
186
+
187
+ ### Minor Changes
188
+
189
+ - 0df859a: Read primaryKeyApiName from object type const instead of options, move links into options, and add createMockAttachment helper
190
+
191
+ ### Patch Changes
192
+
193
+ - Updated dependencies [0df859a]
194
+ - @osdk/api@2.8.0-beta.25
195
+ - @osdk/client@2.8.0-beta.25
196
+
197
+ ## 0.2.0-beta.3
198
+
199
+ ### Minor Changes
200
+
201
+ - 35f2f1a: Add Media inputs/outputs for Queries
202
+
203
+ ### Patch Changes
204
+
205
+ - Updated dependencies [e64bf0b]
206
+ - Updated dependencies [baba327]
207
+ - Updated dependencies [d1ad4d1]
208
+ - Updated dependencies [35f2f1a]
209
+ - Updated dependencies [71e28ef]
210
+ - @osdk/client@2.8.0-beta.14
211
+ - @osdk/api@2.8.0-beta.14
212
+ - @osdk/functions@1.6.0-beta.3
213
+
214
+ ## 0.2.0-beta.2
215
+
216
+ ### Minor Changes
217
+
218
+ - 0b3ce80: Query Stubbing and Exports
219
+
220
+ ## 0.2.0-beta.1
221
+
222
+ ### Minor Changes
223
+
224
+ - 48e1409: Add basic utils for OSDK Testing
225
+
226
+ ## 0.2.0-beta.0
227
+
228
+ ### Minor Changes
229
+
230
+ - 68d0bef: Basic object set mocking
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies [0a0d7cb]
235
+ - @osdk/functions@1.6.0-beta.2
236
+ - @osdk/api@2.8.0-beta.8
237
+ - @osdk/client@2.8.0-beta.8
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MockClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockClient.js","names":[],"sources":["MockClient.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n QueryDefinition,\n} from \"@osdk/api\";\nimport type { Client } from \"@osdk/client\";\nimport type { QueryStubBuilder, StubBuilderFor } from \"./StubBuilders.js\";\nimport type { StubClient } from \"./StubClient.js\";\n\ntype QueryReturnTypeFromDef<Q extends QueryDefinition> = ReturnType<\n CompileTimeMetadata<Q>[\"signature\"]\n> extends Promise<infer R> ? R : never;\n\ntype QueryParamsFromDef<Q extends QueryDefinition> =\n Parameters<CompileTimeMetadata<Q>[\"signature\"]> extends [infer P] ? P\n : undefined;\n\nexport type StubPatternCallback<T> = (client: StubClient) => T;\n\nexport type ObjectSetStubCallback<Q extends ObjectOrInterfaceDefinition, T> = (\n os: ObjectSet<Q>,\n) => T;\n\nexport interface MockClient extends Client {\n when<T>(callback: StubPatternCallback<T>): StubBuilderFor<T>;\n whenObjectSet<Q extends ObjectOrInterfaceDefinition, T>(\n objectSet: ObjectSet<Q>,\n callback: ObjectSetStubCallback<Q, T>,\n ): StubBuilderFor<T>;\n whenQuery<Q extends QueryDefinition>(\n query: Q,\n params?: QueryParamsFromDef<Q>,\n ): QueryStubBuilder<QueryReturnTypeFromDef<Q>>;\n clearStubs(): void;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MockOsdkObjectOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockOsdkObjectOptions.js","names":[],"sources":["MockOsdkObjectOptions.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n LinkedType,\n LinkNames,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n} from \"@osdk/api\";\n\ntype LinkStubs<Q extends ObjectTypeDefinition> = {\n [LINK_NAME in LinkNames<Q>]?:\n CompileTimeMetadata<Q>[\"links\"][LINK_NAME][\"multiplicity\"] extends true ?\n | Array<Osdk.Instance<LinkedType<Q, LINK_NAME>>>\n | ObjectSet<LinkedType<Q, LINK_NAME>>\n : Osdk.Instance<LinkedType<Q, LINK_NAME>> | Error;\n};\n\n/**\n * Options for customizing mock object creation.\n */\nexport interface MockOsdkObjectOptions<\n Q extends ObjectTypeDefinition = ObjectTypeDefinition,\n> {\n /** Objects linked to this object by API name */\n links?: LinkStubs<Q>;\n /** The API name of the title property (optional, required for $title) */\n titlePropertyApiName?: string;\n /** Override the generated $rid */\n $rid?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StubBuilders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StubBuilders.js","names":[],"sources":["StubBuilders.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { PageResult } from \"@osdk/api\";\n\nexport interface FetchPageStubBuilder<T> {\n thenReturnObjects(objects: T[]): void;\n}\n\nexport interface FetchOneStubBuilder<T> {\n thenReturnObject(object: T): void;\n}\n\nexport interface AggregateStubBuilder<T> {\n thenReturnAggregation(result: T): void;\n}\n\nexport interface QueryStubBuilder<T> {\n thenReturn(result: T): void;\n thenThrow(error: Error): void;\n}\n\ntype IsOsdkObject<T> = T extends { $apiName: string } ? true : false;\n\nexport type StubBuilderFor<T> = T extends Promise<infer R> ? StubBuilderFor<R>\n : T extends AsyncIterableIterator<infer U> ? FetchPageStubBuilder<U>\n : T extends PageResult<infer U> ? FetchPageStubBuilder<U>\n : T extends { value: PageResult<infer U>; error?: never }\n ? FetchPageStubBuilder<U>\n : T extends { value: infer U; error?: never }\n ? (IsOsdkObject<U> extends true ? FetchOneStubBuilder<U>\n : AggregateStubBuilder<U>)\n : T extends { error: Error; value?: never } ? never\n : IsOsdkObject<T> extends true ? FetchOneStubBuilder<T>\n : AggregateStubBuilder<T>;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StubClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StubClient.js","names":[],"sources":["StubClient.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceDefinition,\n ObjectSet,\n ObjectTypeDefinition,\n} from \"@osdk/api\";\n\nexport type StubClient = {\n <Q extends ObjectTypeDefinition>(o: Q): ObjectSet<Q>;\n <Q extends InterfaceDefinition>(o: Q): ObjectSet<Q>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { MockClient } from \"./MockClient.js\";\nexport type { MockOsdkObjectOptions } from \"./MockOsdkObjectOptions.js\";\nexport type {\n AggregateStubBuilder,\n FetchOneStubBuilder,\n FetchPageStubBuilder,\n QueryStubBuilder,\n StubBuilderFor,\n} from \"./StubBuilders.js\";\nexport type { StubClient } from \"./StubClient.js\";\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright 2026 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 { Employee } from "@osdk/client.test.ontology";
18
+ export async function basicAggregate(client) {
19
+ const aggregation = await client(Employee).where({
20
+ employeeId: {
21
+ "$eq": 5
22
+ }
23
+ }).aggregate({
24
+ $select: {
25
+ "employeeLocation:exactDistinct": "asc"
26
+ }
27
+ });
28
+ if (aggregation.employeeLocation.exactDistinct !== 3) {
29
+ throw new Error(`Unexpected aggregation result: ${JSON.stringify(aggregation)}`);
30
+ }
31
+ const aggregation2 = await client(Employee).where({
32
+ employeeId: {
33
+ "$eq": 5
34
+ }
35
+ }).aggregate({
36
+ $select: {
37
+ "employeeId:max": "unordered",
38
+ "fullName:approximateDistinct": "unordered"
39
+ },
40
+ $groupBy: {
41
+ employeeId: "exact"
42
+ }
43
+ });
44
+ if (aggregation2[0].$group.employeeId !== 5 || aggregation2[0].employeeId.max !== 5 || aggregation2[0].fullName.approximateDistinct !== 1) {
45
+ throw new Error(`Unexpected aggregation result: ${JSON.stringify(aggregation2)}`);
46
+ }
47
+ return 1;
48
+ }
49
+ //# sourceMappingURL=basicAggregate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicAggregate.js","names":["Employee","basicAggregate","client","aggregation","where","employeeId","aggregate","$select","employeeLocation","exactDistinct","Error","JSON","stringify","aggregation2","$groupBy","$group","max","fullName","approximateDistinct"],"sources":["basicAggregate.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Client } from \"@osdk/client\";\nimport { Employee } from \"@osdk/client.test.ontology\";\nimport type { Integer } from \"@osdk/functions\";\n\nexport async function basicAggregate(\n client: Client,\n): Promise<Integer> {\n const aggregation = await client(Employee).where({ employeeId: { \"$eq\": 5 } })\n .aggregate({ $select: { \"employeeLocation:exactDistinct\": \"asc\" } });\n if (aggregation.employeeLocation.exactDistinct !== 3) {\n throw new Error(\n `Unexpected aggregation result: ${JSON.stringify(aggregation)}`,\n );\n }\n\n const aggregation2 = await client(Employee).where({\n employeeId: { \"$eq\": 5 },\n })\n .aggregate({\n $select: {\n \"employeeId:max\": \"unordered\",\n \"fullName:approximateDistinct\": \"unordered\",\n },\n $groupBy: { employeeId: \"exact\" },\n });\n\n if (\n aggregation2[0].$group.employeeId !== 5\n || aggregation2[0].employeeId.max !== 5\n || aggregation2[0].fullName.approximateDistinct !== 1\n ) {\n throw new Error(\n `Unexpected aggregation result: ${JSON.stringify(aggregation2)}`,\n );\n }\n\n return 1;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,QAAQ,4BAA4B;AAGrD,OAAO,eAAeC,cAAcA,CAClCC,MAAc,EACI;EAClB,MAAMC,WAAW,GAAG,MAAMD,MAAM,CAACF,QAAQ,CAAC,CAACI,KAAK,CAAC;IAAEC,UAAU,EAAE;MAAE,KAAK,EAAE;IAAE;EAAE,CAAC,CAAC,CAC3EC,SAAS,CAAC;IAAEC,OAAO,EAAE;MAAE,gCAAgC,EAAE;IAAM;EAAE,CAAC,CAAC;EACtE,IAAIJ,WAAW,CAACK,gBAAgB,CAACC,aAAa,KAAK,CAAC,EAAE;IACpD,MAAM,IAAIC,KAAK,CACb,kCAAkCC,IAAI,CAACC,SAAS,CAACT,WAAW,CAAC,EAC/D,CAAC;EACH;EAEA,MAAMU,YAAY,GAAG,MAAMX,MAAM,CAACF,QAAQ,CAAC,CAACI,KAAK,CAAC;IAChDC,UAAU,EAAE;MAAE,KAAK,EAAE;IAAE;EACzB,CAAC,CAAC,CACCC,SAAS,CAAC;IACTC,OAAO,EAAE;MACP,gBAAgB,EAAE,WAAW;MAC7B,8BAA8B,EAAE;IAClC,CAAC;IACDO,QAAQ,EAAE;MAAET,UAAU,EAAE;IAAQ;EAClC,CAAC,CAAC;EAEJ,IACEQ,YAAY,CAAC,CAAC,CAAC,CAACE,MAAM,CAACV,UAAU,KAAK,CAAC,IACpCQ,YAAY,CAAC,CAAC,CAAC,CAACR,UAAU,CAACW,GAAG,KAAK,CAAC,IACpCH,YAAY,CAAC,CAAC,CAAC,CAACI,QAAQ,CAACC,mBAAmB,KAAK,CAAC,EACrD;IACA,MAAM,IAAIR,KAAK,CACb,kCAAkCC,IAAI,CAACC,SAAS,CAACC,YAAY,CAAC,EAChE,CAAC;EACH;EAEA,OAAO,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2026 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 { Employee } from "@osdk/client.test.ontology";
18
+ export async function basicFetchPage(client) {
19
+ const objects = await client(Employee).fetchPage();
20
+ const object = objects.data[0];
21
+ if (object == null) {
22
+ throw new Error("No objects returned");
23
+ }
24
+ if (object.employeeId !== 1 || object.fullName !== "John") {
25
+ throw new Error(`Unexpected object returned: ${JSON.stringify(object)}`);
26
+ }
27
+ return object;
28
+ }
29
+ //# sourceMappingURL=basicFetchPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicFetchPage.js","names":["Employee","basicFetchPage","client","objects","fetchPage","object","data","Error","employeeId","fullName","JSON","stringify"],"sources":["basicFetchPage.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Osdk } from \"@osdk/api\";\nimport type { Client } from \"@osdk/client\";\nimport { Employee } from \"@osdk/client.test.ontology\";\n\nexport async function basicFetchPage(\n client: Client,\n): Promise<Osdk.Instance<Employee>> {\n const objects = await client(Employee).fetchPage();\n const object = objects.data[0];\n if (object == null) {\n throw new Error(\"No objects returned\");\n }\n if (object.employeeId !== 1 || object.fullName !== \"John\") {\n throw new Error(`Unexpected object returned: ${JSON.stringify(object)}`);\n }\n return object;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,QAAQ,4BAA4B;AAErD,OAAO,eAAeC,cAAcA,CAClCC,MAAc,EACoB;EAClC,MAAMC,OAAO,GAAG,MAAMD,MAAM,CAACF,QAAQ,CAAC,CAACI,SAAS,CAAC,CAAC;EAClD,MAAMC,MAAM,GAAGF,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC;EAC9B,IAAID,MAAM,IAAI,IAAI,EAAE;IAClB,MAAM,IAAIE,KAAK,CAAC,qBAAqB,CAAC;EACxC;EACA,IAAIF,MAAM,CAACG,UAAU,KAAK,CAAC,IAAIH,MAAM,CAACI,QAAQ,KAAK,MAAM,EAAE;IACzD,MAAM,IAAIF,KAAK,CAAC,+BAA+BG,IAAI,CAACC,SAAS,CAACN,MAAM,CAAC,EAAE,CAAC;EAC1E;EACA,OAAOA,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright 2026 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 { addOne } from "@osdk/client.test.ontology";
18
+ export async function basicQuery(client, n) {
19
+ const result = await client(addOne).executeFunction({
20
+ n
21
+ });
22
+ if (result !== n + 1) {
23
+ throw new Error(`Expected ${n + 1}, but got ${result}`);
24
+ }
25
+ return result;
26
+ }
27
+ //# sourceMappingURL=basicQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicQuery.js","names":["addOne","basicQuery","client","n","result","executeFunction","Error"],"sources":["basicQuery.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Client } from \"@osdk/client\";\nimport { addOne } from \"@osdk/client.test.ontology\";\nimport type { Integer } from \"@osdk/functions\";\n\nexport async function basicQuery(\n client: Client,\n n: Integer,\n): Promise<Integer> {\n const result = await client(addOne).executeFunction({ n });\n if (result !== n + 1) {\n throw new Error(`Expected ${n + 1}, but got ${result}`);\n }\n return result;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,MAAM,QAAQ,4BAA4B;AAGnD,OAAO,eAAeC,UAAUA,CAC9BC,MAAc,EACdC,CAAU,EACQ;EAClB,MAAMC,MAAM,GAAG,MAAMF,MAAM,CAACF,MAAM,CAAC,CAACK,eAAe,CAAC;IAAEF;EAAE,CAAC,CAAC;EAC1D,IAAIC,MAAM,KAAKD,CAAC,GAAG,CAAC,EAAE;IACpB,MAAM,IAAIG,KAAK,CAAC,YAAYH,CAAC,GAAG,CAAC,aAAaC,MAAM,EAAE,CAAC;EACzD;EACA,OAAOA,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright 2026 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
+ export function objectAsInput(object) {
18
+ if (object.$apiName !== "Employee") {
19
+ throw new Error(`Expected object of type Employee, but got ${object.$apiName}`);
20
+ }
21
+ if (object.employeeId == null) {
22
+ throw new Error(`Expected object to have employeeId property, but it was missing`);
23
+ }
24
+ return object;
25
+ }
26
+ //# sourceMappingURL=objectAsInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectAsInput.js","names":["objectAsInput","object","$apiName","Error","employeeId"],"sources":["objectAsInput.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Osdk } from \"@osdk/api\";\nimport type { Employee } from \"@osdk/client.test.ontology\";\n\nexport function objectAsInput(\n object: Osdk.Instance<Employee>,\n): Osdk.Instance<Employee> {\n if (object.$apiName !== \"Employee\") {\n throw new Error(\n `Expected object of type Employee, but got ${object.$apiName}`,\n );\n }\n if (object.employeeId == null) {\n throw new Error(\n `Expected object to have employeeId property, but it was missing`,\n );\n }\n return object;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,aAAaA,CAC3BC,MAA+B,EACN;EACzB,IAAIA,MAAM,CAACC,QAAQ,KAAK,UAAU,EAAE;IAClC,MAAM,IAAIC,KAAK,CACb,6CAA6CF,MAAM,CAACC,QAAQ,EAC9D,CAAC;EACH;EACA,IAAID,MAAM,CAACG,UAAU,IAAI,IAAI,EAAE;IAC7B,MAAM,IAAID,KAAK,CACb,iEACF,CAAC;EACH;EACA,OAAOF,MAAM;AACf","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2026 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
+ export async function getEmployeeNames(employees) {
18
+ const page = await employees.fetchPage();
19
+ return page.data.map(emp => emp.fullName ?? "Unknown");
20
+ }
21
+ export async function countEmployees(employees) {
22
+ const result = await employees.aggregate({
23
+ $select: {
24
+ $count: "unordered"
25
+ }
26
+ });
27
+ return result.$count;
28
+ }
29
+ //# sourceMappingURL=objectSetAsInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectSetAsInput.js","names":["getEmployeeNames","employees","page","fetchPage","data","map","emp","fullName","countEmployees","result","aggregate","$select","$count"],"sources":["objectSetAsInput.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { ObjectSet } from \"@osdk/api\";\nimport type { Employee } from \"@osdk/client.test.ontology\";\n\nexport async function getEmployeeNames(\n employees: ObjectSet<Employee>,\n): Promise<string[]> {\n const page = await employees.fetchPage();\n return page.data.map((emp) => emp.fullName ?? \"Unknown\");\n}\n\nexport async function countEmployees(\n employees: ObjectSet<Employee>,\n): Promise<number> {\n const result = await employees.aggregate({\n $select: { $count: \"unordered\" },\n });\n return result.$count;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,eAAeA,gBAAgBA,CACpCC,SAA8B,EACX;EACnB,MAAMC,IAAI,GAAG,MAAMD,SAAS,CAACE,SAAS,CAAC,CAAC;EACxC,OAAOD,IAAI,CAACE,IAAI,CAACC,GAAG,CAAEC,GAAG,IAAKA,GAAG,CAACC,QAAQ,IAAI,SAAS,CAAC;AAC1D;AAEA,OAAO,eAAeC,cAAcA,CAClCP,SAA8B,EACb;EACjB,MAAMQ,MAAM,GAAG,MAAMR,SAAS,CAACS,SAAS,CAAC;IACvCC,OAAO,EAAE;MAAEC,MAAM,EAAE;IAAY;EACjC,CAAC,CAAC;EACF,OAAOH,MAAM,CAACG,MAAM;AACtB","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Copyright 2026 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
+ export async function getEmployeeOfficeName(employee) {
18
+ const office = await employee.$link.officeLink.fetchOne();
19
+ return office.name;
20
+ }
21
+ export async function getEmployeePeepNames(employee) {
22
+ const page = await employee.$link.peeps.fetchPage();
23
+ return page.data.map(peep => peep.fullName ?? "Unknown");
24
+ }
25
+ export async function countEmployeePeeps(employee) {
26
+ let count = 0;
27
+ for await (const _peep of employee.$link.peeps.asyncIter()) {
28
+ count++;
29
+ }
30
+ return count;
31
+ }
32
+ export async function getSpecificPeep(employee, peepId) {
33
+ return employee.$link.peeps.fetchOne(peepId);
34
+ }
35
+ export async function countPeepsViaAggregate(employee) {
36
+ const result = await employee.$link.peeps.aggregate({
37
+ $select: {
38
+ $count: "unordered"
39
+ }
40
+ });
41
+ return result.$count;
42
+ }
43
+ //# sourceMappingURL=objectWithLinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectWithLinks.js","names":["getEmployeeOfficeName","employee","office","$link","officeLink","fetchOne","name","getEmployeePeepNames","page","peeps","fetchPage","data","map","peep","fullName","countEmployeePeeps","count","_peep","asyncIter","getSpecificPeep","peepId","countPeepsViaAggregate","result","aggregate","$select","$count"],"sources":["objectWithLinks.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Osdk } from \"@osdk/api\";\nimport type { Employee } from \"@osdk/client.test.ontology\";\n\nexport async function getEmployeeOfficeName(\n employee: Osdk.Instance<Employee>,\n): Promise<string | undefined> {\n const office = await employee.$link.officeLink.fetchOne();\n return office.name;\n}\n\nexport async function getEmployeePeepNames(\n employee: Osdk.Instance<Employee>,\n): Promise<string[]> {\n const page = await employee.$link.peeps.fetchPage();\n return page.data.map((peep) => peep.fullName ?? \"Unknown\");\n}\n\nexport async function countEmployeePeeps(\n employee: Osdk.Instance<Employee>,\n): Promise<number> {\n let count = 0;\n for await (const _peep of employee.$link.peeps.asyncIter()) {\n count++;\n }\n return count;\n}\n\nexport async function getSpecificPeep(\n employee: Osdk.Instance<Employee>,\n peepId: number,\n): Promise<Osdk.Instance<Employee>> {\n return employee.$link.peeps.fetchOne(peepId);\n}\n\nexport async function countPeepsViaAggregate(\n employee: Osdk.Instance<Employee>,\n): Promise<number> {\n const result = await employee.$link.peeps.aggregate({\n $select: { $count: \"unordered\" },\n });\n return result.$count;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,eAAeA,qBAAqBA,CACzCC,QAAiC,EACJ;EAC7B,MAAMC,MAAM,GAAG,MAAMD,QAAQ,CAACE,KAAK,CAACC,UAAU,CAACC,QAAQ,CAAC,CAAC;EACzD,OAAOH,MAAM,CAACI,IAAI;AACpB;AAEA,OAAO,eAAeC,oBAAoBA,CACxCN,QAAiC,EACd;EACnB,MAAMO,IAAI,GAAG,MAAMP,QAAQ,CAACE,KAAK,CAACM,KAAK,CAACC,SAAS,CAAC,CAAC;EACnD,OAAOF,IAAI,CAACG,IAAI,CAACC,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACC,QAAQ,IAAI,SAAS,CAAC;AAC5D;AAEA,OAAO,eAAeC,kBAAkBA,CACtCd,QAAiC,EAChB;EACjB,IAAIe,KAAK,GAAG,CAAC;EACb,WAAW,MAAMC,KAAK,IAAIhB,QAAQ,CAACE,KAAK,CAACM,KAAK,CAACS,SAAS,CAAC,CAAC,EAAE;IAC1DF,KAAK,EAAE;EACT;EACA,OAAOA,KAAK;AACd;AAEA,OAAO,eAAeG,eAAeA,CACnClB,QAAiC,EACjCmB,MAAc,EACoB;EAClC,OAAOnB,QAAQ,CAACE,KAAK,CAACM,KAAK,CAACJ,QAAQ,CAACe,MAAM,CAAC;AAC9C;AAEA,OAAO,eAAeC,sBAAsBA,CAC1CpB,QAAiC,EAChB;EACjB,MAAMqB,MAAM,GAAG,MAAMrB,QAAQ,CAACE,KAAK,CAACM,KAAK,CAACc,SAAS,CAAC;IAClDC,OAAO,EAAE;MAAEC,MAAM,EAAE;IAAY;EACjC,CAAC,CAAC;EACF,OAAOH,MAAM,CAACG,MAAM;AACtB","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Copyright 2026 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 { Employee, FooInterface } from "@osdk/client.test.ontology";
18
+ import { createEditBatch } from "@osdk/functions";
19
+ export function ontologyEdits(client, object) {
20
+ const editBatch = createEditBatch(client);
21
+ editBatch.create(Employee, {
22
+ employeeId: 1,
23
+ fullName: "John Doe"
24
+ });
25
+ editBatch.update(object, {
26
+ favoriteRestaurants: ["McDonald's"]
27
+ });
28
+ editBatch.delete(object);
29
+ editBatch.link(object, "peeps", object);
30
+ editBatch.unlink(object, "peeps", object);
31
+ editBatch.create(FooInterface, {
32
+ $objectType: "Employee",
33
+ fooIdp: "bar"
34
+ });
35
+ return editBatch.getEdits();
36
+ }
37
+ //# sourceMappingURL=ontologyEdits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ontologyEdits.js","names":["Employee","FooInterface","createEditBatch","ontologyEdits","client","object","editBatch","create","employeeId","fullName","update","favoriteRestaurants","delete","link","unlink","$objectType","fooIdp","getEdits"],"sources":["ontologyEdits.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Client, Osdk } from \"@osdk/client\";\nimport type { $Interfaces } from \"@osdk/client.test.ontology\";\nimport { Employee, FooInterface } from \"@osdk/client.test.ontology\";\nimport { createEditBatch, type Edits } from \"@osdk/functions\";\n\ntype edits =\n | Edits.Object<Employee>\n | Edits.Link<Employee, \"peeps\">\n | Edits.Interface<$Interfaces.FooInterface>;\nexport function ontologyEdits(\n client: Client,\n object: Osdk.Instance<Employee>,\n): edits[] {\n const editBatch = createEditBatch<edits>(client);\n editBatch.create(Employee, { employeeId: 1, fullName: \"John Doe\" });\n\n editBatch.update(object, { favoriteRestaurants: [\"McDonald's\"] });\n\n editBatch.delete(object);\n\n editBatch.link(object, \"peeps\", object);\n editBatch.unlink(object, \"peeps\", object);\n\n editBatch.create(FooInterface, { $objectType: \"Employee\", fooIdp: \"bar\" });\n return editBatch.getEdits();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,EAAEC,YAAY,QAAQ,4BAA4B;AACnE,SAASC,eAAe,QAAoB,iBAAiB;AAM7D,OAAO,SAASC,aAAaA,CAC3BC,MAAc,EACdC,MAA+B,EACtB;EACT,MAAMC,SAAS,GAAGJ,eAAe,CAAQE,MAAM,CAAC;EAChDE,SAAS,CAACC,MAAM,CAACP,QAAQ,EAAE;IAAEQ,UAAU,EAAE,CAAC;IAAEC,QAAQ,EAAE;EAAW,CAAC,CAAC;EAEnEH,SAAS,CAACI,MAAM,CAACL,MAAM,EAAE;IAAEM,mBAAmB,EAAE,CAAC,YAAY;EAAE,CAAC,CAAC;EAEjEL,SAAS,CAACM,MAAM,CAACP,MAAM,CAAC;EAExBC,SAAS,CAACO,IAAI,CAACR,MAAM,EAAE,OAAO,EAAEA,MAAM,CAAC;EACvCC,SAAS,CAACQ,MAAM,CAACT,MAAM,EAAE,OAAO,EAAEA,MAAM,CAAC;EAEzCC,SAAS,CAACC,MAAM,CAACN,YAAY,EAAE;IAAEc,WAAW,EAAE,UAAU;IAAEC,MAAM,EAAE;EAAM,CAAC,CAAC;EAC1E,OAAOV,SAAS,CAACW,QAAQ,CAAC,CAAC;AAC7B","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2026 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 { Users } from "@osdk/foundry.admin";
18
+ export async function requireAdminUser(client) {
19
+ const user = await Users.getCurrent(client);
20
+ if (!user.username.endsWith("@admin")) {
21
+ throw new Error(`User ${user.username} is not an admin`);
22
+ }
23
+ return user.username;
24
+ }
25
+ //# sourceMappingURL=platformApiWithMsw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformApiWithMsw.js","names":["Users","requireAdminUser","client","user","getCurrent","username","endsWith","Error"],"sources":["platformApiWithMsw.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { Client } from \"@osdk/client\";\nimport { Users } from \"@osdk/foundry.admin\";\n\nexport async function requireAdminUser(\n client: Client,\n): Promise<string> {\n const user = await Users.getCurrent(client);\n if (!user.username.endsWith(\"@admin\")) {\n throw new Error(`User ${user.username} is not an admin`);\n }\n return user.username;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,KAAK,QAAQ,qBAAqB;AAE3C,OAAO,eAAeC,gBAAgBA,CACpCC,MAAc,EACG;EACjB,MAAMC,IAAI,GAAG,MAAMH,KAAK,CAACI,UAAU,CAACF,MAAM,CAAC;EAC3C,IAAI,CAACC,IAAI,CAACE,QAAQ,CAACC,QAAQ,CAAC,QAAQ,CAAC,EAAE;IACrC,MAAM,IAAIC,KAAK,CAAC,QAAQJ,IAAI,CAACE,QAAQ,kBAAkB,CAAC;EAC1D;EACA,OAAOF,IAAI,CAACE,QAAQ;AACtB","ignoreList":[]}