@osdk/generator 2.6.0-beta.9 → 2.6.0-rc.14

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 (24) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/build/browser/util/test/TodoWireOntology.js +3 -0
  3. package/build/browser/util/test/TodoWireOntology.js.map +1 -1
  4. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +3 -1
  5. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  6. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +5 -7
  7. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  8. package/build/browser/v2.0/generateMetadata.js +0 -3
  9. package/build/browser/v2.0/generateMetadata.js.map +1 -1
  10. package/build/browser/v2.0/generatePerQueryDataFiles.test.js +0 -3
  11. package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  12. package/build/cjs/index.cjs +0 -3
  13. package/build/cjs/index.cjs.map +1 -1
  14. package/build/esm/util/test/TodoWireOntology.js +3 -0
  15. package/build/esm/util/test/TodoWireOntology.js.map +1 -1
  16. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +3 -1
  17. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  18. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +5 -7
  19. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  20. package/build/esm/v2.0/generateMetadata.js +0 -3
  21. package/build/esm/v2.0/generateMetadata.js.map +1 -1
  22. package/build/esm/v2.0/generatePerQueryDataFiles.test.js +0 -3
  23. package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  24. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # @osdk/generator
2
2
 
3
+ ## 2.6.0-rc.14
4
+
5
+ ### Patch Changes
6
+
7
+ - b313525: bump osdk
8
+ - af4f3bf: Remove the following features for RC:
9
+ - Property formatting
10
+ - Branching
11
+ - Constant RDPs
12
+
13
+ - Updated dependencies [b313525]
14
+ - Updated dependencies [af4f3bf]
15
+ - @osdk/generator-converters@2.6.0-rc.14
16
+ - @osdk/api@2.6.0-rc.14
17
+
18
+ ## 2.6.0-beta.13
19
+
20
+ ### Minor Changes
21
+
22
+ - 84f0eef: Bumping OSDK apis
23
+ - 486ef7e: Deprecate multiplicity in query params/outputs
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [84f0eef]
28
+ - Updated dependencies [486ef7e]
29
+ - Updated dependencies [ea077c6]
30
+ - @osdk/generator-converters@2.6.0-beta.13
31
+ - @osdk/api@2.6.0-beta.13
32
+
33
+ ## 2.6.0-beta.12
34
+
35
+ ### Patch Changes
36
+
37
+ - @osdk/api@2.6.0-beta.12
38
+ - @osdk/generator-converters@2.6.0-beta.12
39
+
40
+ ## 2.6.0-beta.11
41
+
42
+ ### Patch Changes
43
+
44
+ - @osdk/api@2.6.0-beta.11
45
+ - @osdk/generator-converters@2.6.0-beta.11
46
+
47
+ ## 2.6.0-beta.10
48
+
49
+ ### Minor Changes
50
+
51
+ - 3fbb596: Pipe through transactionId to endpoints that load data via object sets
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [3fbb596]
56
+ - @osdk/generator-converters@2.6.0-beta.10
57
+ - @osdk/api@2.6.0-beta.10
58
+
3
59
  ## 2.6.0-beta.9
4
60
 
5
61
  ### Patch Changes
@@ -84,6 +140,65 @@
84
140
  - @osdk/api@2.5.0-beta.15
85
141
  - @osdk/generator-converters@2.5.0-beta.15
86
142
 
143
+ ## 2.5.2
144
+
145
+ ### Patch Changes
146
+
147
+ - @osdk/api@2.5.2
148
+ - @osdk/generator-converters@2.5.2
149
+
150
+ ## 2.5.1
151
+
152
+ ### Patch Changes
153
+
154
+ - 099b4d8: Fix nested array query param type handling
155
+ - Updated dependencies [099b4d8]
156
+ - @osdk/generator-converters@2.5.1
157
+ - @osdk/api@2.5.1
158
+
159
+ ## 2.5.0
160
+
161
+ ### Patch Changes
162
+
163
+ - 322c5bc: Simulated release
164
+ - 4b4a458: Allow exporting rid for object types
165
+ - 7cdab1d: Update platform sdk dependencies
166
+ - a00d2ed: Update Platform SDK dependencies
167
+ - d29cdfb: Fixes query generation with disallowed javascript identifiers.
168
+ - a6f49e9: experimentalDoNotUseMetadata -> internalDoNotUseMetadata
169
+ - 7bdac45: Update Platform SDK dependency
170
+ - a96d89e: Update Platform SDK dependencies
171
+ - 78be29f: mark deprecated properties with JSDoc for interface types
172
+ - 7bdac45: Support value type enum generation for strings and booleans
173
+ - cbcf2ad: Add branching support
174
+ - 4248b80: Temporarily remove NullValue type from codegen
175
+ - Updated dependencies [322c5bc]
176
+ - Updated dependencies [322c5bc]
177
+ - Updated dependencies [7160276]
178
+ - Updated dependencies [7cdab1d]
179
+ - Updated dependencies [a00d2ed]
180
+ - Updated dependencies [7bdac45]
181
+ - Updated dependencies [37eb75b]
182
+ - Updated dependencies [7b97128]
183
+ - Updated dependencies [76905f5]
184
+ - Updated dependencies [a96d89e]
185
+ - Updated dependencies [7bdac45]
186
+ - Updated dependencies [20962bc]
187
+ - Updated dependencies [cbcf2ad]
188
+ - Updated dependencies [052a96b]
189
+ - Updated dependencies [ca1fabe]
190
+ - Updated dependencies [e48be06]
191
+ - @osdk/api@2.5.0
192
+ - @osdk/generator-converters@2.5.0
193
+
194
+ ## 2.5.0-rc.15
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [37eb75b]
199
+ - @osdk/api@2.5.0-rc.15
200
+ - @osdk/generator-converters@2.5.0-rc.15
201
+
87
202
  ## 2.5.0-beta.14
88
203
 
89
204
  ### Minor Changes
@@ -135,6 +135,7 @@ export const TodoWireOntology = {
135
135
  properties: {
136
136
  "SomeProperty": "body"
137
137
  },
138
+ propertiesV2: {},
138
139
  links: {}
139
140
  }
140
141
  },
@@ -232,6 +233,7 @@ export const TodoWireOntology = {
232
233
  required: false
233
234
  }
234
235
  },
236
+ propertiesV2: {},
235
237
  rid: "idk",
236
238
  displayName: "Sum Interface",
237
239
  extendsInterfaces: [],
@@ -249,6 +251,7 @@ export const TodoWireOntology = {
249
251
  required: false
250
252
  }
251
253
  },
254
+ allPropertiesV2: {},
252
255
  allExtendsInterfaces: [],
253
256
  allLinks: {}
254
257
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","valueTypeApiName","body","complete","array","subType","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","links","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","implementedByObjectTypes","allProperties","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty","valueTypes","emailValueType","fieldType","constraints","options","arrayValueType","valueConstraint","uniqueValues"],"sources":["TodoWireOntology.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n valueTypeApiName: \"numericValueType\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n array: {\n dataType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n valueTypeApiName: \"arrayValueType\",\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n links: {},\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n valueTypeApiName: \"emailValueType\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"1.1.0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"3.2.0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n valueTypes: {\n emailValueType: {\n apiName: \"emailValueType\",\n description: \"A value type for email addresses\",\n displayName: \"Email Value Type\",\n rid: \"ridForEmailValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"string\",\n },\n constraints: [{\n type: \"enum\",\n options: [\"osdk@palantir.com\", \"foundry@palantir.com\"],\n }],\n },\n arrayValueType: {\n apiName: \"arrayValueType\",\n description: \"A value type for arrays of strings\",\n displayName: \"Array Value Type\",\n rid: \"ridForArrayValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n constraints: [{\n type: \"array\",\n valueConstraint: { type: \"enum\", options: [\"a\", \"b\", \"c\"] },\n uniqueValues: false,\n }],\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,E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,EAAE,OAAO;MAChBa,SAAS,EAAE;QACThD,IAAI,EAAE;MACR,CAAC;MACDiD,WAAW,EAAE,CAAC;QACZjD,IAAI,EAAE,MAAM;QACZkD,OAAO,EAAE,CAAC,mBAAmB,EAAE,sBAAsB;MACvD,CAAC;IACH,CAAC;IACDC,cAAc,EAAE;MACd1D,OAAO,EAAE,gBAAgB;MACzBE,WAAW,EAAE,oCAAoC;MACjDD,WAAW,EAAE,kBAAkB;MAC/BF,GAAG,EAAE,sBAAsB;MAC3B2C,OAAO,EAAE,OAAO;MAChBa,SAAS,EAAE;QACThD,IAAI,EAAE,OAAO;QACbqB,OAAO,EAAE;UACPrB,IAAI,EAAE;QACR;MACF,CAAC;MACDiD,WAAW,EAAE,CAAC;QACZjD,IAAI,EAAE,OAAO;QACboD,eAAe,EAAE;UAAEpD,IAAI,EAAE,MAAM;UAAEkD,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;QAAE,CAAC;QAC3DG,YAAY,EAAE;MAChB,CAAC;IACH;EACF;AACF,CAA2C","ignoreList":[]}
1
+ {"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","valueTypeApiName","body","complete","array","subType","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","propertiesV2","links","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","implementedByObjectTypes","allProperties","allPropertiesV2","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty","valueTypes","emailValueType","fieldType","constraints","options","arrayValueType","valueConstraint","uniqueValues"],"sources":["TodoWireOntology.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n valueTypeApiName: \"numericValueType\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n array: {\n dataType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n valueTypeApiName: \"arrayValueType\",\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n propertiesV2: {},\n links: {},\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n valueTypeApiName: \"emailValueType\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"1.1.0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"3.2.0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n propertiesV2: {},\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n allPropertiesV2: {},\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n valueTypes: {\n emailValueType: {\n apiName: \"emailValueType\",\n description: \"A value type for email addresses\",\n displayName: \"Email Value Type\",\n rid: \"ridForEmailValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"string\",\n },\n constraints: [{\n type: \"enum\",\n options: [\"osdk@palantir.com\", \"foundry@palantir.com\"],\n }],\n },\n arrayValueType: {\n apiName: \"arrayValueType\",\n description: \"A value type for arrays of strings\",\n displayName: \"Array Value Type\",\n rid: \"ridForArrayValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n constraints: [{\n type: \"array\",\n valueConstraint: { type: \"enum\", options: [\"a\", \"b\", \"c\"] },\n uniqueValues: false,\n }],\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,EAAE;MACnBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNJ,WAAW,EAAE,mBAAmB;UAChCC,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACRC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACrB,CAAC;UACDC,QAAQ,EAAE;QACZ;MACF,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,EAAE,CAAC;QACXJ,IAAI,EAAE,cAAc;QACpBE,iBAAiB,EAAE;MACrB,CAAC,CAAC;MACFG,MAAM,EAAE;IACV,CAAC;IACD,aAAa,EAAE;MACbZ,OAAO,EAAE,aAAa;MACtBE,WAAW,EAAE,8CAA8C;MAC3DE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNJ,WAAW,EAAE,aAAa;UAC1BC,WAAW,EAAE,uBAAuB;UACpC,UAAU,EAAE;YACV,MAAM,EAAE,OAAO;YAEf,SAAS,EAAE;cACT,MAAM,EAAE,QAAQ;cAChB,eAAe,EAAE,MAAM;cACvB,mBAAmB,EAAE;YACvB;UACF,CAAC;UACDQ,QAAQ,EAAE;QACZ;MACF,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,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44
44
  extendsInterfaces: parents,
45
45
  links: {},
46
46
  properties,
47
+ propertiesV2: {},
47
48
  implementedByObjectTypes,
48
49
  allExtendsInterfaces: parents,
49
50
  allLinks: {},
50
- allProperties: properties
51
+ allProperties: properties,
52
+ allPropertiesV2: {}
51
53
  };
52
54
  }
53
55
  function simpleOntology(apiName, interfaces) {
@@ -1 +1 @@
1
- {"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["format","describe","expect","it","EnhancedInterfaceType","enhanceOntology","ForeignType","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","simpleSpt","apiName","metadataLevel","dataType","type","rid","displayName","description","undefined","simpleInterface","spts","parents","implementedByObjectTypes","properties","Object","fromEntries","map","spt","required","extendsInterfaces","links","allExtendsInterfaces","allLinks","allProperties","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","valueTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo","Child","implementsMatch","match","not","toBeNull","implementsStr","toContain"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts"],"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 type {\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/foundry.ontologies\";\nimport { format } from \"prettier\";\nimport { describe, expect, it } from \"vitest\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\nfunction simpleSpt<T extends string>(apiName: T, metadataLevel: 0 | 1 | 2 = 2) {\n return {\n apiName,\n dataType: {\n type: \"integer\",\n },\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} property desc` : undefined,\n } as const satisfies SharedPropertyType;\n}\n\nfunction simpleInterface<T extends string, Q extends SharedPropertyType>(\n apiName: T,\n spts: Q[],\n parents: string[],\n metadataLevel: 0 | 1 | 2 = 2,\n implementedByObjectTypes: string[] = [],\n) {\n const properties = Object.fromEntries(\n spts.map(spt => [spt.apiName, { ...spt, required: true }]),\n );\n\n return {\n apiName,\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,\n extendsInterfaces: parents,\n links: {},\n properties,\n implementedByObjectTypes,\n allExtendsInterfaces: parents,\n allLinks: {},\n allProperties: properties,\n } as const satisfies InterfaceType;\n}\n\nfunction simpleOntology<I extends InterfaceType>(\n apiName: string,\n interfaces: I[],\n) {\n const interfaceTypes: Record<I[\"apiName\"], I> = Object\n .fromEntries(\n interfaces.map(i => [i.apiName, i]),\n ) as Record<string, I>;\n\n const sharedPropertyTypes: Record<string, I[\"properties\"][string]> = Object\n .fromEntries(\n interfaces.flatMap(i => Object.entries(i.properties)),\n ) as Record<string, I[\"properties\"][string]>;\n\n return {\n actionTypes: {},\n interfaceTypes,\n objectTypes: {},\n ontology: {\n apiName,\n description: `${apiName} ontology desc`,\n displayName: `${apiName} ontology dn`,\n rid: `${apiName} ontology rid`,\n },\n queryTypes: {},\n sharedPropertyTypes,\n valueTypes: {},\n } as const satisfies WireOntologyDefinition;\n}\n\ndescribe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {\n it(\"Does not say (inherited) on properties locally defined\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]),\n importExt: \"\",\n });\n\n expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(\n true,\n );\n\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Bar,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n printWidth: 100,\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Bar = {};\n\n export namespace Bar {\n export type PropertyKeys = \"bar\";\n\n export interface Props {\n /**\n * (no ontology metadata)\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk.Instance<Bar, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Bar extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Bar\";\n __DefinitionMetadata?: {\n objectSet: Bar.ObjectSet;\n props: Bar.Props;\n linksType: OsdkObjectLinks$Bar;\n strictProps: Bar.StrictProps;\n apiName: \"Bar\";\n description: undefined;\n displayName: \"Bar\";\n implementedBy: [];\n implements: [];\n links: {};\n properties: {\n /**\n * (no ontology metadata)\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"BarRid\";\n type: \"interface\";\n };\n }\n\n export const Bar: Bar = {\n type: \"interface\",\n apiName: \"Bar\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\" | \"bar\";\n\n export interface Props {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n it(\"Generates map for implementedBy\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"], 2, [\"childrenObject\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [\"childrenObject\"];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"sorts the implements array for stable output\", async () => {\n // Test with multiple parent interfaces in non-alphabetical order\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Child\", [simpleSpt(\"child\")], [\n \"ParentZ\",\n \"ParentA\",\n \"ParentC\",\n ]),\n simpleInterface(\"ParentZ\", [simpleSpt(\"z\")], []),\n simpleInterface(\"ParentA\", [simpleSpt(\"a\")], []),\n simpleInterface(\"ParentC\", [simpleSpt(\"c\")], []),\n ]),\n importExt: \"\",\n });\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Child as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n\n // Extract the implements array from the generated code\n const implementsMatch = formattedCode.match(/implements:\\s*\\[([^\\]]+)\\]/s);\n expect(implementsMatch).not.toBeNull();\n\n if (implementsMatch) {\n const implementsStr = implementsMatch[1];\n // Check that the array is sorted alphabetically\n expect(implementsStr).toContain(\"\\\"ParentA\\\", \\\"ParentC\\\", \\\"ParentZ\\\"\");\n }\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,qBAAqB,QAAQ,6CAA6C;AACnF,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,WAAW,QAAQ,mCAAmC;AAE/D,SAASC,8CAA8C,QAAQ,mDAAmD;AAElH,SAASC,SAASA,CAAmBC,OAAU,EAAEC,aAAwB,GAAG,CAAC,EAAE;EAC7E,OAAO;IACLD,OAAO;IACPE,QAAQ,EAAE;MACRC,IAAI,EAAE;IACR,CAAC;IACDC,GAAG,EAAE,GAAGJ,OAAO,KAAK;IACpBK,WAAW,EAAEJ,aAAa,IAAI,CAAC,G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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFjD,EAAE,CAAC,yCAAyC,EAAE,YAAY;IACxD,MAAMkD,MAAM,GAAG7C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAM8C,MAAM,GAAG9C,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMiC,QAAQ,GAAGpC,eAAe,CAC9B;MACEuC,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCf,eAAe,CAAC,KAAK,EAAE,CAACoC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAC5CpC,eAAe,CAAC,QAAQ,EAAE,CAACqC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MAEFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMjD,MAAM,CAChCO,8CAA8C,CAC5CkC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDhD,MAAM,CAAC+C,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFjD,EAAE,CAAC,kCAAkC,EAAE,YAAY;IACjD,MAAMkD,MAAM,GAAG7C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAM8C,MAAM,GAAG9C,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMiC,QAAQ,GAAGpC,eAAe,CAC9B;MACEuC,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCf,eAAe,CAAC,KAAK,EAAE,CAACoC,MAAM,EAAEC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EACpDrC,eAAe,CAAC,QAAQ,EAAE,CAACqC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MACFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMjD,MAAM,CAChCO,8CAA8C,CAC5CkC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDhD,MAAM,CAAC+C,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EACFjD,EAAE,CAAC,iCAAiC,EAAE,YAAY;IAChD,MAAMkD,MAA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EAAE,CAC7C,SAAS,EACT,SAAS,EACT,SAAS,CACV,CAAC,EACFS,eAAe,CAAC,SAAS,EAAE,CAACT,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAChDS,eAAe,CAAC,SAAS,EAAE,CAACT,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAChDS,eAAe,CAAC,SAAS,EAAE,CAACT,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CACjD,CAAC;MACFqC,SAAS,EAAE;IACb,CAAC,CAAC;IAEF,MAAMI,aAAa,GAAG,MAAMjD,MAAM,CAChCO,8CAA8C,CAC5CkC,QAAQ,CAACP,cAAc,CAACsB,KAAK,EAC7Bf,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;;IAED;IACA,MAAMO,eAAe,GAAGR,aAAa,CAACS,KAAK,CAAC,6BAA6B,CAAC;IAC1ExD,MAAM,CAACuD,eAAe,CAAC,CAACE,GAAG,CAACC,QAAQ,CAAC,CAAC;IAEtC,IAAIH,eAAe,EAAE;MACnB,MAAMI,aAAa,GAAGJ,eAAe,CAAC,CAAC,CAAC;MACxC;MACAvD,MAAM,CAAC2D,aAAa,CAAC,CAACC,SAAS,CAAC,uCAAuC,CAAC;IAC1E;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["format","describe","expect","it","EnhancedInterfaceType","enhanceOntology","ForeignType","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","simpleSpt","apiName","metadataLevel","dataType","type","rid","displayName","description","undefined","simpleInterface","spts","parents","implementedByObjectTypes","properties","Object","fromEntries","map","spt","required","extendsInterfaces","links","propertiesV2","allExtendsInterfaces","allLinks","allProperties","allPropertiesV2","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","valueTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo","Child","implementsMatch","match","not","toBeNull","implementsStr","toContain"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts"],"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 type {\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/foundry.ontologies\";\nimport { format } from \"prettier\";\nimport { describe, expect, it } from \"vitest\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\nfunction simpleSpt<T extends string>(apiName: T, metadataLevel: 0 | 1 | 2 = 2) {\n return {\n apiName,\n dataType: {\n type: \"integer\",\n },\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} property desc` : undefined,\n } as const satisfies SharedPropertyType;\n}\n\nfunction simpleInterface<T extends string, Q extends SharedPropertyType>(\n apiName: T,\n spts: Q[],\n parents: string[],\n metadataLevel: 0 | 1 | 2 = 2,\n implementedByObjectTypes: string[] = [],\n) {\n const properties = Object.fromEntries(\n spts.map(spt => [spt.apiName, { ...spt, required: true }]),\n );\n\n return {\n apiName,\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,\n extendsInterfaces: parents,\n links: {},\n properties,\n propertiesV2: {},\n implementedByObjectTypes,\n allExtendsInterfaces: parents,\n allLinks: {},\n allProperties: properties,\n allPropertiesV2: {},\n } as const satisfies InterfaceType;\n}\n\nfunction simpleOntology<I extends InterfaceType>(\n apiName: string,\n interfaces: I[],\n) {\n const interfaceTypes: Record<I[\"apiName\"], I> = Object\n .fromEntries(\n interfaces.map(i => [i.apiName, i]),\n ) as Record<string, I>;\n\n const sharedPropertyTypes: Record<string, I[\"properties\"][string]> = Object\n .fromEntries(\n interfaces.flatMap(i => Object.entries(i.properties)),\n ) as Record<string, I[\"properties\"][string]>;\n\n return {\n actionTypes: {},\n interfaceTypes,\n objectTypes: {},\n ontology: {\n apiName,\n description: `${apiName} ontology desc`,\n displayName: `${apiName} ontology dn`,\n rid: `${apiName} ontology rid`,\n },\n queryTypes: {},\n sharedPropertyTypes,\n valueTypes: {},\n } as const satisfies WireOntologyDefinition;\n}\n\ndescribe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {\n it(\"Does not say (inherited) on properties locally defined\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]),\n importExt: \"\",\n });\n\n expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(\n true,\n );\n\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Bar,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n printWidth: 100,\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Bar = {};\n\n export namespace Bar {\n export type PropertyKeys = \"bar\";\n\n export interface Props {\n /**\n * (no ontology metadata)\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk.Instance<Bar, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Bar extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Bar\";\n __DefinitionMetadata?: {\n objectSet: Bar.ObjectSet;\n props: Bar.Props;\n linksType: OsdkObjectLinks$Bar;\n strictProps: Bar.StrictProps;\n apiName: \"Bar\";\n description: undefined;\n displayName: \"Bar\";\n implementedBy: [];\n implements: [];\n links: {};\n properties: {\n /**\n * (no ontology metadata)\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"BarRid\";\n type: \"interface\";\n };\n }\n\n export const Bar: Bar = {\n type: \"interface\",\n apiName: \"Bar\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\" | \"bar\";\n\n export interface Props {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n readonly bar: $PropType[\"integer\"] | undefined;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n *\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n it(\"Generates map for implementedBy\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"], 2, [\"childrenObject\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n InterfaceMetadata as $InterfaceMetadata,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [\"childrenObject\"];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n *\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"sorts the implements array for stable output\", async () => {\n // Test with multiple parent interfaces in non-alphabetical order\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Child\", [simpleSpt(\"child\")], [\n \"ParentZ\",\n \"ParentA\",\n \"ParentC\",\n ]),\n simpleInterface(\"ParentZ\", [simpleSpt(\"z\")], []),\n simpleInterface(\"ParentA\", [simpleSpt(\"a\")], []),\n simpleInterface(\"ParentC\", [simpleSpt(\"c\")], []),\n ]),\n importExt: \"\",\n });\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Child as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n\n // Extract the implements array from the generated code\n const implementsMatch = formattedCode.match(/implements:\\s*\\[([^\\]]+)\\]/s);\n expect(implementsMatch).not.toBeNull();\n\n if (implementsMatch) {\n const implementsStr = implementsMatch[1];\n // Check that the array is sorted alphabetically\n expect(implementsStr).toContain(\"\\\"ParentA\\\", \\\"ParentC\\\", \\\"ParentZ\\\"\");\n }\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,qBAAqB,QAAQ,6CAA6C;AACnF,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,WAAW,QAAQ,mCAAmC;AAE/D,SAASC,8CAA8C,QAAQ,mDAAmD;AAElH,SAASC,SAASA,CAAmBC,OAAU,EAAEC,aAAwB,GAAG,CAAC,EAAE;EAC7E,OAAO;IACLD,OAAO;IACPE,QAAQ,EAAE;MACRC,IAAI,EAAE;IACR,CAAC;IACDC,GAAG,EAAE,GAAGJ,OAAO,KAAK;IACpBK,WAAW,EAAEJ,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,cAAc,GAAGA,OAAO;IACpEM,WAAW,EAAEL,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,gBAAgB,GAAGO;EACjE,CAAC;AACH;AAEA,SAASC,eAAeA,CACtBR,OAAU,EACVS,IAAS,EACTC,OAAiB,EACjBT,aAAwB,GAAG,CAAC,EAC5BU,wBAAkC,GAAG,EAAE,EACvC;EACA,MAAMC,UAAU,GAAGC,MAAM,CAACC,WAAW,CACnCL,IAAI,CAACM,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,CAAChB,OAAO,EAAE;IAAE,GAAGgB,GAAG;IAAEC,QAAQ,EAAE;EAAK,CAAC,CAAC,CAC3D,CAAC;EAED,OAAO;IACLjB,OAAO;IACPI,GAAG,EAAE,GAAGJ,OAAO,KAAK;IACpBK,WAAW,EAAEJ,aAAa,IAAI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,CAAC;MACFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMnD,MAAM,CAChCO,8CAA8C,CAC5CoC,QAAQ,CAACP,cAAc,CAACqB,GAAG,EAC3Bd,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;IACDlD,MAAM,CAACiD,aAAa,CAAC,CAACG,qBAAqB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EACFnD,EAAE,CAAC,iCAAiC,EAAE,YAAY;IAChD,MAAMoD,MAAM,GAAG/C,SAAS,CAAC,KAAK,CAAC;IAC/B,MAAMgD,MAAM,GAAGhD,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMmC,QAAQ,GAAGtC,eAAe,CAC9B;MACEyC,SAAS,EAAEZ,cAAc,CAAC,UAAU,EAAE,CACpCjB,eAAe,CAAC,KAAK,EAAE,CAACsC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,EACnEtC,eAAe,CAAC,QAAQ,EAAE,CAACuC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MAEFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAMnD,MAAM,CAChCO,8C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Q,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACES,MAAM,EAAE;IACV,CACF,CAAC;;IAED;IACA,MAAMO,eAAe,GAAGR,aAAa,CAACS,KAAK,CAAC,6BAA6B,CAAC;IAC1E1D,MAAM,CAACyD,eAAe,CAAC,CAACE,GAAG,CAACC,QAAQ,CAAC,CAAC;IAEtC,IAAIH,eAAe,EAAE;MACnB,MAAMI,aAAa,GAAGJ,eAAe,CAAC,CAAC,CAAC;MACxC;MACAzD,MAAM,CAAC6D,aAAa,CAAC,CAACC,SAAS,CAAC,uCAAuC,CAAC;IAC1E;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -199,6 +199,7 @@ const referencedOntology = {
199
199
  required: true
200
200
  }
201
201
  },
202
+ propertiesV2: {},
202
203
  implementedByObjectTypes: [],
203
204
  links: {},
204
205
  allExtendsInterfaces: [],
@@ -222,7 +223,8 @@ const referencedOntology = {
222
223
  rid: "idk",
223
224
  required: true
224
225
  }
225
- }
226
+ },
227
+ allPropertiesV2: {}
226
228
  }
227
229
  },
228
230
  "sharedPropertyTypes": {
@@ -235,9 +237,6 @@ const referencedOntology = {
235
237
  rid: "idk"
236
238
  }
237
239
  },
238
- "branch": {
239
- rid: "someRidHere"
240
- },
241
240
  valueTypes: {}
242
241
  };
243
242
  const referencingOntology = {
@@ -283,7 +282,8 @@ const referencingOntology = {
283
282
  links: {},
284
283
  properties: {
285
284
  "com.example.dep.spt": "body"
286
- }
285
+ },
286
+ propertiesV2: {}
287
287
  }
288
288
  },
289
289
  linkTypes: [],
@@ -2359,8 +2359,6 @@ describe("generator", () => {
2359
2359
  export const $osdkMetadata = { extraUserAgent: '' };
2360
2360
 
2361
2361
  export const $ontologyRid = 'ri.ontology.main.ontology.dep';
2362
-
2363
- export const $branch = 'someRidHere';
2364
2362
  ",
2365
2363
  "/foo/index.ts": "export {} from './ontology/actions.js';
2366
2364
  export * as $Actions from './ontology/actions.js';