@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
@@ -0,0 +1,235 @@
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 invariant from "tiny-invariant";
18
+ import { isMockObjectSet } from "./createMockObjectSet.js";
19
+
20
+ // TODO: Add support for RDPs
21
+
22
+ function createSingleLinkStub(linked) {
23
+ if (linked instanceof Error) {
24
+ return {
25
+ fetchOne: () => Promise.reject(linked),
26
+ fetchOneWithErrors: () => Promise.resolve({
27
+ error: linked
28
+ })
29
+ };
30
+ }
31
+ return {
32
+ fetchOne: () => Promise.resolve(linked),
33
+ fetchOneWithErrors: () => Promise.resolve({
34
+ value: linked
35
+ })
36
+ };
37
+ }
38
+ function createMissingLinkStub(linkName, objectApiName, primaryKey) {
39
+ const makeError = () => new Error(`Link "${linkName}" was not configured on mock ${objectApiName} ` + `object with primary key ${primaryKey}. ` + `Pass it via the \`links\` option on createMockOsdkObject, or ` + `pass an Error instance to simulate a link failure.`);
40
+ return {
41
+ fetchOne: () => Promise.reject(makeError()),
42
+ fetchOneWithErrors: () => Promise.resolve({
43
+ error: makeError()
44
+ }),
45
+ fetchPage: () => Promise.reject(makeError()),
46
+ asyncIter: () => {
47
+ throw makeError();
48
+ },
49
+ aggregate: () => {
50
+ throw makeError();
51
+ }
52
+ };
53
+ }
54
+ function createManyLinkStub(linkedObjects) {
55
+ return {
56
+ fetchOne: primaryKey => {
57
+ if (linkedObjects.length > 0 && linkedObjects[0].$primaryKey == null) {
58
+ process.env.NODE_ENV !== "production" ? invariant(false, `fetchOne requires primaryKeyApiName to be set on linked objects`) : invariant(false);
59
+ }
60
+ const found = linkedObjects.find(obj => obj.$primaryKey === primaryKey);
61
+ !(found != null) ? process.env.NODE_ENV !== "production" ? invariant(false, `fetchOne could not find object with primary key ${String(primaryKey)}`) : invariant(false) : void 0;
62
+ return Promise.resolve(found);
63
+ },
64
+ fetchPage: () => Promise.resolve({
65
+ data: linkedObjects,
66
+ nextPageToken: undefined
67
+ }),
68
+ asyncIter: () => {
69
+ let index = 0;
70
+ return {
71
+ [Symbol.asyncIterator]() {
72
+ return this;
73
+ },
74
+ async next() {
75
+ if (index < linkedObjects.length) {
76
+ return {
77
+ value: linkedObjects[index++],
78
+ done: false
79
+ };
80
+ }
81
+ return {
82
+ value: undefined,
83
+ done: true
84
+ };
85
+ }
86
+ };
87
+ },
88
+ aggregate: () => {
89
+ process.env.NODE_ENV !== "production" ? invariant(false, `aggregate is not supported on mock link stubs.`) : invariant(false);
90
+ }
91
+ };
92
+ }
93
+
94
+ /**
95
+ * Creates a mock OSDK object for testing purposes.
96
+ *
97
+ * The mock object has the same shape as a real OSDK object including:
98
+ * - $apiName, $objectType, $primaryKey, $title, $rid
99
+ * - All provided properties
100
+ * - Stub implementations that throw errors for unsupported operations
101
+ *
102
+ * Note: The primary key property must be included in the provided properties.
103
+ * The primary key API name is read from the object type definition's
104
+ * `primaryKeyApiName` field (set on generated object consts).
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const employee = createMockOsdkObject(
109
+ * Employee,
110
+ * { employeeId: 1, fullName: "John Doe" },
111
+ * { titlePropertyApiName: "fullName" },
112
+ * );
113
+ *
114
+ * expect(employee.$primaryKey).toBe(1);
115
+ * expect(employee.$title).toBe("John Doe");
116
+ * ```
117
+ *
118
+ * @param objectType - The object type definition (e.g., Employee)
119
+ * @param properties - The properties for the mock object
120
+ * @param options - Configuration including links, titlePropertyApiName, and $rid
121
+ * @returns A frozen mock OSDK object
122
+ */
123
+ export function createMockOsdkObject(objectType, properties, options = {}) {
124
+ const {
125
+ links,
126
+ titlePropertyApiName
127
+ } = options;
128
+ const primaryKeyApiName = objectType.primaryKeyApiName;
129
+ !(primaryKeyApiName != null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Object type "${objectType.apiName}" does not have a primaryKeyApiName defined. ` + `Ensure you are using a generated object type constant that includes primaryKeyApiName.`) : invariant(false) : void 0;
130
+ if (properties == null) {
131
+ properties = {};
132
+ }
133
+ !(primaryKeyApiName in properties) ? process.env.NODE_ENV !== "production" ? invariant(false, `Primary key property "${primaryKeyApiName}" must be provided in properties for ${objectType.apiName}. ` + `Include "${primaryKeyApiName}" in the properties argument.`) : invariant(false) : void 0;
134
+ if (titlePropertyApiName != null) {
135
+ !(titlePropertyApiName in properties) ? process.env.NODE_ENV !== "production" ? invariant(false, `titlePropertyApiName "${titlePropertyApiName}" was specified but not found in properties for ${objectType.apiName}`) : invariant(false) : void 0;
136
+ }
137
+ const $primaryKey = properties[primaryKeyApiName];
138
+ const $title = titlePropertyApiName != null ? properties[titlePropertyApiName] : undefined;
139
+ const $rid = options.$rid ?? `ri.mock.main.object.${objectType.apiName}.${String($primaryKey)}`;
140
+ const mockObject = {
141
+ $apiName: objectType.apiName,
142
+ $objectType: objectType.apiName,
143
+ ...properties
144
+ };
145
+ Object.defineProperty(mockObject, "$primaryKey", {
146
+ get() {
147
+ return $primaryKey;
148
+ },
149
+ enumerable: true
150
+ });
151
+ Object.defineProperty(mockObject, "$title", {
152
+ get() {
153
+ return $title;
154
+ },
155
+ enumerable: true
156
+ });
157
+
158
+ // Define $rid
159
+ Object.defineProperty(mockObject, "$rid", {
160
+ get() {
161
+ return $rid;
162
+ },
163
+ enumerable: true
164
+ });
165
+ Object.defineProperty(mockObject, "$objectSpecifier", {
166
+ get() {
167
+ return `${objectType.apiName}:${String($primaryKey)}`;
168
+ },
169
+ enumerable: true
170
+ });
171
+ Object.defineProperty(mockObject, "$link", {
172
+ get() {
173
+ const linkAccessors = {};
174
+ for (const [linkName, linkValue] of Object.entries(links ?? {})) {
175
+ if (linkValue == null) {
176
+ continue;
177
+ }
178
+ if (isMockObjectSet(linkValue)) {
179
+ linkAccessors[linkName] = linkValue;
180
+ } else if (Array.isArray(linkValue)) {
181
+ linkAccessors[linkName] = createManyLinkStub(linkValue);
182
+ } else {
183
+ linkAccessors[linkName] = createSingleLinkStub(linkValue);
184
+ }
185
+ }
186
+ return new Proxy(linkAccessors, {
187
+ get(target, prop) {
188
+ if (typeof prop === "symbol" || prop in target) {
189
+ return target[prop];
190
+ }
191
+ return createMissingLinkStub(prop, objectType.apiName, String($primaryKey));
192
+ }
193
+ });
194
+ },
195
+ enumerable: true
196
+ });
197
+ Object.defineProperty(mockObject, "$as", {
198
+ value: function () {
199
+ process.env.NODE_ENV !== "production" ? invariant(false, `$as is not supported on mock objects.`) : invariant(false);
200
+ },
201
+ enumerable: false
202
+ });
203
+ Object.defineProperty(mockObject, "$clone", {
204
+ value: function (updates) {
205
+ if (updates == null) {
206
+ return createMockOsdkObject(objectType, {
207
+ ...properties
208
+ }, options);
209
+ }
210
+ if (primaryKeyApiName in updates) {
211
+ !(updates[primaryKeyApiName] === $primaryKey) ? process.env.NODE_ENV !== "production" ? invariant(false, `Cannot update ${objectType.apiName} object with differing primary key values`) : invariant(false) : void 0;
212
+ }
213
+ const newProperties = {
214
+ ...properties,
215
+ ...updates
216
+ };
217
+ return createMockOsdkObject(objectType, newProperties, options);
218
+ },
219
+ enumerable: false
220
+ });
221
+ Object.defineProperty(mockObject, "$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata", {
222
+ get() {
223
+ process.env.NODE_ENV !== "production" ? invariant(false, `$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata is not supported on mock objects.`) : invariant(false);
224
+ },
225
+ enumerable: false
226
+ });
227
+ Object.defineProperty(mockObject, "$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue", {
228
+ value: function () {
229
+ process.env.NODE_ENV !== "production" ? invariant(false, `$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue is not supported on mock objects.`) : invariant(false);
230
+ },
231
+ enumerable: false
232
+ });
233
+ return Object.freeze(mockObject);
234
+ }
235
+ //# sourceMappingURL=createMockOsdkObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMockOsdkObject.js","names":["invariant","isMockObjectSet","createSingleLinkStub","linked","Error","fetchOne","Promise","reject","fetchOneWithErrors","resolve","error","value","createMissingLinkStub","linkName","objectApiName","primaryKey","makeError","fetchPage","asyncIter","aggregate","createManyLinkStub","linkedObjects","length","$primaryKey","process","env","NODE_ENV","found","find","obj","String","data","nextPageToken","undefined","index","Symbol","asyncIterator","next","done","createMockOsdkObject","objectType","properties","options","links","titlePropertyApiName","primaryKeyApiName","apiName","$title","$rid","mockObject","$apiName","$objectType","Object","defineProperty","get","enumerable","linkAccessors","linkValue","entries","Array","isArray","Proxy","target","prop","updates","newProperties","freeze"],"sources":["createMockOsdkObject.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 ObjectTypeDefinition,\n Osdk,\n Result,\n} from \"@osdk/api\";\nimport invariant from \"tiny-invariant\";\nimport type { MockOsdkObjectOptions } from \"../api/MockOsdkObjectOptions.js\";\nimport { isMockObjectSet } from \"./createMockObjectSet.js\";\n\n// TODO: Add support for RDPs\n\nfunction createSingleLinkStub<T extends ObjectTypeDefinition>(\n linked: Osdk.Instance<T> | Error,\n): {\n fetchOne: () => Promise<Osdk.Instance<T>>;\n fetchOneWithErrors: () => Promise<Result<Osdk.Instance<T>>>;\n} {\n if (linked instanceof Error) {\n return {\n fetchOne: () => Promise.reject(linked),\n fetchOneWithErrors: () => Promise.resolve({ error: linked }),\n };\n }\n return {\n fetchOne: () => Promise.resolve(linked),\n fetchOneWithErrors: () => Promise.resolve({ value: linked }),\n };\n}\n\nfunction createMissingLinkStub(\n linkName: string,\n objectApiName: string,\n primaryKey: string,\n): {\n fetchOne: () => Promise<never>;\n fetchOneWithErrors: () => Promise<{ error: Error; value?: never }>;\n fetchPage: () => Promise<never>;\n asyncIter: () => never;\n aggregate: () => never;\n} {\n const makeError = () =>\n new Error(\n `Link \"${linkName}\" was not configured on mock ${objectApiName} `\n + `object with primary key ${primaryKey}. `\n + `Pass it via the \\`links\\` option on createMockOsdkObject, or `\n + `pass an Error instance to simulate a link failure.`,\n );\n return {\n fetchOne: () => Promise.reject(makeError()),\n fetchOneWithErrors: () => Promise.resolve({ error: makeError() }),\n fetchPage: () => Promise.reject(makeError()),\n asyncIter: () => {\n throw makeError();\n },\n aggregate: () => {\n throw makeError();\n },\n };\n}\n\nfunction createManyLinkStub<T extends ObjectTypeDefinition>(\n linkedObjects: Array<Osdk.Instance<T>>,\n): {\n fetchOne: (primaryKey: unknown) => Promise<Osdk.Instance<T> | undefined>;\n fetchPage: () => Promise<\n { data: Array<Osdk.Instance<T>>; nextPageToken: undefined }\n >;\n asyncIter: () => AsyncIterableIterator<Osdk.Instance<T>>;\n aggregate: () => never;\n} {\n return {\n fetchOne: (primaryKey: unknown) => {\n if (linkedObjects.length > 0 && linkedObjects[0].$primaryKey == null) {\n invariant(\n false,\n `fetchOne requires primaryKeyApiName to be set on linked objects`,\n );\n }\n const found = linkedObjects.find((obj) => obj.$primaryKey === primaryKey);\n invariant(\n found != null,\n `fetchOne could not find object with primary key ${String(primaryKey)}`,\n );\n return Promise.resolve(found);\n },\n fetchPage: () =>\n Promise.resolve({ data: linkedObjects, nextPageToken: undefined }),\n asyncIter: () => {\n let index = 0;\n return {\n [Symbol.asyncIterator]() {\n return this;\n },\n async next() {\n if (index < linkedObjects.length) {\n return { value: linkedObjects[index++], done: false as const };\n }\n return { value: undefined, done: true as const };\n },\n };\n },\n aggregate: () => {\n invariant(false, `aggregate is not supported on mock link stubs.`);\n },\n };\n}\n\n/**\n * Creates a mock OSDK object for testing purposes.\n *\n * The mock object has the same shape as a real OSDK object including:\n * - $apiName, $objectType, $primaryKey, $title, $rid\n * - All provided properties\n * - Stub implementations that throw errors for unsupported operations\n *\n * Note: The primary key property must be included in the provided properties.\n * The primary key API name is read from the object type definition's\n * `primaryKeyApiName` field (set on generated object consts).\n *\n * @example\n * ```typescript\n * const employee = createMockOsdkObject(\n * Employee,\n * { employeeId: 1, fullName: \"John Doe\" },\n * { titlePropertyApiName: \"fullName\" },\n * );\n *\n * expect(employee.$primaryKey).toBe(1);\n * expect(employee.$title).toBe(\"John Doe\");\n * ```\n *\n * @param objectType - The object type definition (e.g., Employee)\n * @param properties - The properties for the mock object\n * @param options - Configuration including links, titlePropertyApiName, and $rid\n * @returns A frozen mock OSDK object\n */\nexport function createMockOsdkObject<\n Q extends ObjectTypeDefinition,\n>(\n objectType: Q,\n properties?: Partial<CompileTimeMetadata<Q>[\"props\"]>,\n options: MockOsdkObjectOptions<Q> = {},\n): Osdk.Instance<Q> {\n const {\n links,\n titlePropertyApiName,\n } = options;\n\n const primaryKeyApiName = objectType.primaryKeyApiName;\n\n invariant(\n primaryKeyApiName != null,\n `Object type \"${objectType.apiName}\" does not have a primaryKeyApiName defined. `\n + `Ensure you are using a generated object type constant that includes primaryKeyApiName.`,\n );\n\n if (properties == null) {\n properties = {};\n }\n\n invariant(\n primaryKeyApiName in properties,\n `Primary key property \"${primaryKeyApiName}\" must be provided in properties for ${objectType.apiName}. `\n + `Include \"${primaryKeyApiName}\" in the properties argument.`,\n );\n\n if (titlePropertyApiName != null) {\n invariant(\n titlePropertyApiName in properties,\n `titlePropertyApiName \"${titlePropertyApiName}\" was specified but not found in properties for ${objectType.apiName}`,\n );\n }\n\n const $primaryKey = properties[primaryKeyApiName as keyof typeof properties];\n\n const $title = titlePropertyApiName != null\n ? properties[titlePropertyApiName as keyof typeof properties] as\n | string\n | undefined\n : undefined;\n\n const $rid = options.$rid\n ?? `ri.mock.main.object.${objectType.apiName}.${String($primaryKey)}`;\n\n const mockObject: Record<string, unknown> = {\n $apiName: objectType.apiName,\n $objectType: objectType.apiName,\n ...properties,\n };\n\n Object.defineProperty(mockObject, \"$primaryKey\", {\n get() {\n return $primaryKey;\n },\n enumerable: true,\n });\n\n Object.defineProperty(mockObject, \"$title\", {\n get() {\n return $title;\n },\n enumerable: true,\n });\n\n // Define $rid\n Object.defineProperty(mockObject, \"$rid\", {\n get() {\n return $rid;\n },\n enumerable: true,\n });\n\n Object.defineProperty(mockObject, \"$objectSpecifier\", {\n get() {\n return `${objectType.apiName}:${String($primaryKey)}`;\n },\n enumerable: true,\n });\n\n Object.defineProperty(mockObject, \"$link\", {\n get() {\n const linkAccessors: Record<string, unknown> = {};\n for (const [linkName, linkValue] of Object.entries(links ?? {})) {\n if (linkValue == null) {\n continue;\n }\n if (isMockObjectSet(linkValue)) {\n linkAccessors[linkName] = linkValue;\n } else if (Array.isArray(linkValue)) {\n linkAccessors[linkName] = createManyLinkStub(\n linkValue as Array<Osdk.Instance<ObjectTypeDefinition>>,\n );\n } else {\n linkAccessors[linkName] = createSingleLinkStub(\n linkValue as Osdk.Instance<ObjectTypeDefinition> | Error,\n );\n }\n }\n return new Proxy(linkAccessors, {\n get(target, prop) {\n if (typeof prop === \"symbol\" || prop in target) {\n return target[prop as string];\n }\n return createMissingLinkStub(\n prop,\n objectType.apiName,\n String($primaryKey),\n );\n },\n });\n },\n enumerable: true,\n });\n\n Object.defineProperty(mockObject, \"$as\", {\n value: function $as(): never {\n invariant(false, `$as is not supported on mock objects.`);\n },\n enumerable: false,\n });\n\n Object.defineProperty(mockObject, \"$clone\", {\n value: function $clone(\n updates?: Partial<CompileTimeMetadata<Q>[\"props\"]>,\n ): Osdk.Instance<Q, \"$rid\"> {\n if (updates == null) {\n return createMockOsdkObject(\n objectType,\n { ...properties },\n options,\n ) as any;\n }\n\n if (primaryKeyApiName in updates) {\n invariant(\n updates[primaryKeyApiName as keyof typeof updates] === $primaryKey,\n `Cannot update ${objectType.apiName} object with differing primary key values`,\n );\n }\n\n const newProperties = { ...properties, ...updates };\n return createMockOsdkObject(\n objectType,\n newProperties,\n options,\n ) as any;\n },\n enumerable: false,\n });\n\n Object.defineProperty(\n mockObject,\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata\",\n {\n get(): never {\n invariant(\n false,\n `$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata is not supported on mock objects.`,\n );\n },\n enumerable: false,\n },\n );\n\n Object.defineProperty(\n mockObject,\n \"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue\",\n {\n value:\n function $__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue(): never {\n invariant(\n false,\n `$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue is not supported on mock objects.`,\n );\n },\n enumerable: false,\n },\n );\n\n return Object.freeze(mockObject) as unknown as any;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AAEtC,SAASC,eAAe,QAAQ,0BAA0B;;AAE1D;;AAEA,SAASC,oBAAoBA,CAC3BC,MAAgC,EAIhC;EACA,IAAIA,MAAM,YAAYC,KAAK,EAAE;IAC3B,OAAO;MACLC,QAAQ,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM,CAACJ,MAAM,CAAC;MACtCK,kBAAkB,EAAEA,CAAA,KAAMF,OAAO,CAACG,OAAO,CAAC;QAAEC,KAAK,EAAEP;MAAO,CAAC;IAC7D,CAAC;EACH;EACA,OAAO;IACLE,QAAQ,EAAEA,CAAA,KAAMC,OAAO,CAACG,OAAO,CAACN,MAAM,CAAC;IACvCK,kBAAkB,EAAEA,CAAA,KAAMF,OAAO,CAACG,OAAO,CAAC;MAAEE,KAAK,EAAER;IAAO,CAAC;EAC7D,CAAC;AACH;AAEA,SAASS,qBAAqBA,CAC5BC,QAAgB,EAChBC,aAAqB,EACrBC,UAAkB,EAOlB;EACA,MAAMC,SAAS,GAAGA,CAAA,KAChB,IAAIZ,KAAK,CACP,SAASS,QAAQ,gCAAgCC,aAAa,GAAG,GAC7D,2BAA2BC,UAAU,IAAI,GACzC,+DAA+D,GAC/D,oDACN,CAAC;EACH,OAAO;IACLV,QAAQ,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM,CAACS,SAAS,CAAC,CAAC,CAAC;IAC3CR,kBAAkB,EAAEA,CAAA,KAAMF,OAAO,CAACG,OAAO,CAAC;MAAEC,KAAK,EAAEM,SAAS,CAAC;IAAE,CAAC,CAAC;IACjEC,SAAS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AAE;QACnB,OAAOzB,oBAAoB,CACzBC,UAAU,EACV;UAAE,GAAGC;QAAW,CAAC,EACjBC,OACF,CAAC;MACH;MAEA,IAAIG,iBAAiB,IAAImB,OAAO,EAAE;QAChC,EACEA,OAAO,CAACnB,iBAAiB,CAAyB,KAAKtB,WAAW,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADpE1B,SAAS,QAEP,iBAAiBwC,UAAU,CAACM,OAAO,2CAA2C,IAFhF9C,SAAS;MAIX;MAEA,MAAMiE,aAAa,GAAG;QAAE,GAAGxB,UAAU;QAAE,GAAGuB;MAAQ,CAAC;MACnD,OAAOzB,oBAAoB,CACzBC,UAAU,EACVyB,aAAa,EACbvB,OACF,CAAC;IACH,CAAC;IACDa,UAAU,EAAE;EACd,CAAC,CAAC;EAEFH,MAAM,CAACC,cAAc,CACnBJ,UAAU,EACV,8CAA8C,EAC9C;IACEK,GAAGA,CAAA,EAAU;MACX9B,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAA1B,SAAS,QAEP,gFAAgF,IAFlFA,SAAS;IAIX,CAAC;IACDuD,UAAU,EAAE;EACd,CACF,CAAC;EAEDH,MAAM,CAACC,cAAc,CACnBJ,UAAU,EACV,uDAAuD,EACvD;IACEtC,KAAK,EACH,SAAAA,CAAA,EAAwE;MACtEa,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAA1B,SAAS,QAEP,yFAAyF,IAF3FA,SAAS;IAIX,CAAC;IACHuD,UAAU,EAAE;EACd,CACF,CAAC;EAED,OAAOH,MAAM,CAACc,MAAM,CAACjB,UAAU,CAAC;AAClC","ignoreList":[]}
@@ -0,0 +1,21 @@
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 { createMockAttachment } from "../mock/createMockAttachment.js";
18
+ export { createMockClient } from "../mock/createMockClient.js";
19
+ export { createMockObjectSet } from "../mock/createMockObjectSet.js";
20
+ export { createMockOsdkObject } from "../mock/createMockOsdkObject.js";
21
+ //# sourceMappingURL=experimental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental.js","names":["createMockAttachment","createMockClient","createMockObjectSet","createMockOsdkObject"],"sources":["experimental.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 {\n AggregateStubBuilder,\n FetchOneStubBuilder,\n FetchPageStubBuilder,\n QueryStubBuilder,\n StubBuilderFor,\n} from \"../api/index.js\";\nexport { createMockAttachment } from \"../mock/createMockAttachment.js\";\nexport { createMockClient } from \"../mock/createMockClient.js\";\nexport { createMockObjectSet } from \"../mock/createMockObjectSet.js\";\nexport { createMockOsdkObject } from \"../mock/createMockOsdkObject.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,oBAAoB,QAAQ,iCAAiC","ignoreList":[]}