@osdk/generator 2.1.0-beta.9 → 2.1.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 (499) hide show
  1. package/CHANGELOG.md +350 -0
  2. package/build/browser/GenerateContext/EnhanceCommon.js +0 -15
  3. package/build/browser/GenerateContext/EnhanceCommon.js.map +1 -1
  4. package/build/browser/GenerateContext/EnhancedAction.js +1 -1
  5. package/build/browser/GenerateContext/EnhancedAction.js.map +1 -1
  6. package/build/browser/GenerateContext/EnhancedBase.js +2 -7
  7. package/build/browser/GenerateContext/EnhancedBase.js.map +1 -1
  8. package/build/browser/GenerateContext/EnhancedInterfaceType.js +1 -1
  9. package/build/browser/GenerateContext/EnhancedInterfaceType.js.map +1 -1
  10. package/build/browser/GenerateContext/EnhancedObjectType.js +2 -2
  11. package/build/browser/GenerateContext/EnhancedObjectType.js.map +1 -1
  12. package/build/browser/GenerateContext/EnhancedOntologyDefinition.js +1 -8
  13. package/build/browser/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
  14. package/build/browser/GenerateContext/EnhancedQuery.js +2 -2
  15. package/build/browser/GenerateContext/EnhancedQuery.js.map +1 -1
  16. package/build/browser/GenerateContext/EnhancedSharedPropertyType.js +1 -1
  17. package/build/browser/GenerateContext/EnhancedSharedPropertyType.js.map +1 -1
  18. package/build/browser/GenerateContext/ForeignType.js +1 -1
  19. package/build/browser/GenerateContext/ForeignType.js.map +1 -1
  20. package/build/browser/GenerateContext/GenerateContext.js +0 -15
  21. package/build/browser/GenerateContext/GenerateContext.js.map +1 -1
  22. package/build/browser/GenerateContext/enhanceOntology.js +1 -0
  23. package/build/browser/GenerateContext/enhanceOntology.js.map +1 -1
  24. package/build/browser/MinimalFs.js +0 -15
  25. package/build/browser/MinimalFs.js.map +1 -1
  26. package/build/browser/WireOntologyDefinition.js +0 -15
  27. package/build/browser/WireOntologyDefinition.js.map +1 -1
  28. package/build/browser/generateClientSdkPackage.js +5 -3
  29. package/build/browser/generateClientSdkPackage.js.map +1 -1
  30. package/build/browser/generateClientSdkPackage.test.js +1 -0
  31. package/build/browser/generateClientSdkPackage.test.js.map +1 -1
  32. package/build/browser/index.js +1 -0
  33. package/build/browser/index.js.map +1 -1
  34. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js +1 -0
  35. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -1
  36. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js +1 -0
  37. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -1
  38. package/build/browser/shared/getObjectImports.js +1 -0
  39. package/build/browser/shared/getObjectImports.js.map +1 -1
  40. package/build/browser/shared/getObjectTypeApiNamesFromQuery.js +1 -0
  41. package/build/browser/shared/getObjectTypeApiNamesFromQuery.js.map +1 -1
  42. package/build/browser/shared/getObjectTypesFromQueryDataType.js +1 -0
  43. package/build/browser/shared/getObjectTypesFromQueryDataType.js.map +1 -1
  44. package/build/browser/shared/propertyJsdoc.js +1 -0
  45. package/build/browser/shared/propertyJsdoc.js.map +1 -1
  46. package/build/browser/shared/sanitizeMetadata.js +9 -0
  47. package/build/browser/shared/sanitizeMetadata.js.map +1 -1
  48. package/build/browser/shared/sanitizeMetadata.test.js +1 -0
  49. package/build/browser/shared/sanitizeMetadata.test.js.map +1 -1
  50. package/build/browser/util/InMemoryFs.js +1 -0
  51. package/build/browser/util/InMemoryFs.js.map +1 -1
  52. package/build/browser/util/commaSeparatedIdentifiers.js +1 -0
  53. package/build/browser/util/commaSeparatedIdentifiers.js.map +1 -1
  54. package/build/browser/util/commaSeparatedTypeIdentifiers.js +1 -0
  55. package/build/browser/util/commaSeparatedTypeIdentifiers.js.map +1 -1
  56. package/build/browser/util/deleteUndefineds.js +1 -0
  57. package/build/browser/util/deleteUndefineds.js.map +1 -1
  58. package/build/browser/util/reservedKeywords.js +1 -0
  59. package/build/browser/util/reservedKeywords.js.map +1 -1
  60. package/build/browser/util/stringUnionFrom.js +1 -0
  61. package/build/browser/util/stringUnionFrom.js.map +1 -1
  62. package/build/browser/util/stringify.js +16 -0
  63. package/build/browser/util/stringify.js.map +1 -1
  64. package/build/browser/util/test/TodoWireOntology.js +24 -5
  65. package/build/browser/util/test/TodoWireOntology.js.map +1 -1
  66. package/build/browser/util/test/compileThis.js +1 -0
  67. package/build/browser/util/test/compileThis.js.map +1 -1
  68. package/build/browser/util/test/createMockMinimalFiles.js +1 -0
  69. package/build/browser/util/test/createMockMinimalFiles.js.map +1 -1
  70. package/build/browser/util/test/formatTs.js +1 -0
  71. package/build/browser/util/test/formatTs.js.map +1 -1
  72. package/build/browser/util/verifyOutDir.js +1 -0
  73. package/build/browser/util/verifyOutDir.js.map +1 -1
  74. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +4 -1
  75. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  76. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +10 -1
  77. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  78. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +4 -1
  79. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  80. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +672 -628
  81. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  82. package/build/browser/v2.0/generateMetadata.js +4 -1
  83. package/build/browser/v2.0/generateMetadata.js.map +1 -1
  84. package/build/browser/v2.0/generatePerActionDataFiles.js +30 -8
  85. package/build/browser/v2.0/generatePerActionDataFiles.js.map +1 -1
  86. package/build/browser/v2.0/generatePerActionDataFiles.test.js +1 -0
  87. package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +1 -1
  88. package/build/browser/v2.0/generatePerInterfaceDataFiles.js +2 -0
  89. package/build/browser/v2.0/generatePerInterfaceDataFiles.js.map +1 -1
  90. package/build/browser/v2.0/generatePerObjectDataFiles.js +1 -0
  91. package/build/browser/v2.0/generatePerObjectDataFiles.js.map +1 -1
  92. package/build/browser/v2.0/generatePerQueryDataFiles.js +10 -4
  93. package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
  94. package/build/browser/v2.0/generatePerQueryDataFiles.test.js +2 -0
  95. package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  96. package/build/browser/v2.0/generateRootIndexTsFile.js +3 -1
  97. package/build/browser/v2.0/generateRootIndexTsFile.js.map +1 -1
  98. package/build/browser/v2.0/getDescriptionIfPresent.js +1 -0
  99. package/build/browser/v2.0/getDescriptionIfPresent.js.map +1 -1
  100. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +13 -4
  101. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
  102. package/build/browser/validateWireOntologyAssumptions.js +1 -0
  103. package/build/browser/validateWireOntologyAssumptions.js.map +1 -1
  104. package/build/cjs/chunk-XOCES5YA.cjs +978 -0
  105. package/build/cjs/chunk-XOCES5YA.cjs.map +1 -0
  106. package/build/cjs/index.cjs +1392 -0
  107. package/build/cjs/index.cjs.map +1 -0
  108. package/build/cjs/index.d.cts +31 -0
  109. package/build/cjs/prompt-YMFYYBNJ.cjs +860 -0
  110. package/build/cjs/prompt-YMFYYBNJ.cjs.map +1 -0
  111. package/build/esm/GenerateContext/EnhanceCommon.js +0 -15
  112. package/build/esm/GenerateContext/EnhanceCommon.js.map +1 -1
  113. package/build/esm/GenerateContext/EnhancedAction.js +1 -1
  114. package/build/esm/GenerateContext/EnhancedAction.js.map +1 -1
  115. package/build/esm/GenerateContext/EnhancedBase.js +2 -7
  116. package/build/esm/GenerateContext/EnhancedBase.js.map +1 -1
  117. package/build/esm/GenerateContext/EnhancedInterfaceType.js +1 -1
  118. package/build/esm/GenerateContext/EnhancedInterfaceType.js.map +1 -1
  119. package/build/esm/GenerateContext/EnhancedObjectType.js +2 -2
  120. package/build/esm/GenerateContext/EnhancedObjectType.js.map +1 -1
  121. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js +1 -8
  122. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
  123. package/build/esm/GenerateContext/EnhancedQuery.js +2 -2
  124. package/build/esm/GenerateContext/EnhancedQuery.js.map +1 -1
  125. package/build/esm/GenerateContext/EnhancedSharedPropertyType.js +1 -1
  126. package/build/esm/GenerateContext/EnhancedSharedPropertyType.js.map +1 -1
  127. package/build/esm/GenerateContext/ForeignType.js +1 -1
  128. package/build/esm/GenerateContext/ForeignType.js.map +1 -1
  129. package/build/esm/GenerateContext/GenerateContext.js +0 -15
  130. package/build/esm/GenerateContext/GenerateContext.js.map +1 -1
  131. package/build/esm/GenerateContext/enhanceOntology.js +1 -0
  132. package/build/esm/GenerateContext/enhanceOntology.js.map +1 -1
  133. package/build/esm/MinimalFs.js +0 -15
  134. package/build/esm/MinimalFs.js.map +1 -1
  135. package/build/esm/WireOntologyDefinition.js +0 -15
  136. package/build/esm/WireOntologyDefinition.js.map +1 -1
  137. package/build/esm/generateClientSdkPackage.js +5 -3
  138. package/build/esm/generateClientSdkPackage.js.map +1 -1
  139. package/build/esm/generateClientSdkPackage.test.js +1 -0
  140. package/build/esm/generateClientSdkPackage.test.js.map +1 -1
  141. package/build/esm/index.js +1 -0
  142. package/build/esm/index.js.map +1 -1
  143. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js +1 -0
  144. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -1
  145. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +1 -0
  146. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -1
  147. package/build/esm/shared/getObjectImports.js +1 -0
  148. package/build/esm/shared/getObjectImports.js.map +1 -1
  149. package/build/esm/shared/getObjectTypeApiNamesFromQuery.js +1 -0
  150. package/build/esm/shared/getObjectTypeApiNamesFromQuery.js.map +1 -1
  151. package/build/esm/shared/getObjectTypesFromQueryDataType.js +1 -0
  152. package/build/esm/shared/getObjectTypesFromQueryDataType.js.map +1 -1
  153. package/build/esm/shared/propertyJsdoc.js +1 -0
  154. package/build/esm/shared/propertyJsdoc.js.map +1 -1
  155. package/build/esm/shared/sanitizeMetadata.js +9 -0
  156. package/build/esm/shared/sanitizeMetadata.js.map +1 -1
  157. package/build/esm/shared/sanitizeMetadata.test.js +1 -0
  158. package/build/esm/shared/sanitizeMetadata.test.js.map +1 -1
  159. package/build/esm/util/InMemoryFs.js +1 -0
  160. package/build/esm/util/InMemoryFs.js.map +1 -1
  161. package/build/esm/util/commaSeparatedIdentifiers.js +1 -0
  162. package/build/esm/util/commaSeparatedIdentifiers.js.map +1 -1
  163. package/build/esm/util/commaSeparatedTypeIdentifiers.js +1 -0
  164. package/build/esm/util/commaSeparatedTypeIdentifiers.js.map +1 -1
  165. package/build/esm/util/deleteUndefineds.js +1 -0
  166. package/build/esm/util/deleteUndefineds.js.map +1 -1
  167. package/build/esm/util/reservedKeywords.js +1 -0
  168. package/build/esm/util/reservedKeywords.js.map +1 -1
  169. package/build/esm/util/stringUnionFrom.js +1 -0
  170. package/build/esm/util/stringUnionFrom.js.map +1 -1
  171. package/build/esm/util/stringify.js +16 -0
  172. package/build/esm/util/stringify.js.map +1 -1
  173. package/build/esm/util/test/TodoWireOntology.js +24 -5
  174. package/build/esm/util/test/TodoWireOntology.js.map +1 -1
  175. package/build/esm/util/test/compileThis.js +1 -0
  176. package/build/esm/util/test/compileThis.js.map +1 -1
  177. package/build/esm/util/test/createMockMinimalFiles.js +1 -0
  178. package/build/esm/util/test/createMockMinimalFiles.js.map +1 -1
  179. package/build/esm/util/test/formatTs.js +1 -0
  180. package/build/esm/util/test/formatTs.js.map +1 -1
  181. package/build/esm/util/verifyOutDir.js +1 -0
  182. package/build/esm/util/verifyOutDir.js.map +1 -1
  183. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +4 -1
  184. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  185. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +10 -1
  186. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  187. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +4 -1
  188. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  189. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +672 -628
  190. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  191. package/build/esm/v2.0/generateMetadata.js +4 -1
  192. package/build/esm/v2.0/generateMetadata.js.map +1 -1
  193. package/build/esm/v2.0/generatePerActionDataFiles.js +30 -8
  194. package/build/esm/v2.0/generatePerActionDataFiles.js.map +1 -1
  195. package/build/esm/v2.0/generatePerActionDataFiles.test.js +1 -0
  196. package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +1 -1
  197. package/build/esm/v2.0/generatePerInterfaceDataFiles.js +2 -0
  198. package/build/esm/v2.0/generatePerInterfaceDataFiles.js.map +1 -1
  199. package/build/esm/v2.0/generatePerObjectDataFiles.js +1 -0
  200. package/build/esm/v2.0/generatePerObjectDataFiles.js.map +1 -1
  201. package/build/esm/v2.0/generatePerQueryDataFiles.js +10 -4
  202. package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
  203. package/build/esm/v2.0/generatePerQueryDataFiles.test.js +2 -0
  204. package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  205. package/build/esm/v2.0/generateRootIndexTsFile.js +3 -1
  206. package/build/esm/v2.0/generateRootIndexTsFile.js.map +1 -1
  207. package/build/esm/v2.0/getDescriptionIfPresent.js +1 -0
  208. package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -1
  209. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +13 -4
  210. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
  211. package/build/esm/validateWireOntologyAssumptions.js +1 -0
  212. package/build/esm/validateWireOntologyAssumptions.js.map +1 -1
  213. package/build/types/GenerateContext/EnhanceCommon.d.ts +6 -0
  214. package/build/types/GenerateContext/EnhanceCommon.d.ts.map +1 -0
  215. package/build/types/GenerateContext/EnhancedAction.d.ts +13 -0
  216. package/build/types/GenerateContext/EnhancedAction.d.ts.map +1 -0
  217. package/build/types/GenerateContext/EnhancedBase.d.ts +20 -0
  218. package/build/types/GenerateContext/EnhancedBase.d.ts.map +1 -0
  219. package/build/types/GenerateContext/EnhancedInterfaceType.d.ts +12 -0
  220. package/build/types/GenerateContext/EnhancedInterfaceType.d.ts.map +1 -0
  221. package/build/types/GenerateContext/EnhancedObjectType.d.ts +11 -0
  222. package/build/types/GenerateContext/EnhancedObjectType.d.ts.map +1 -0
  223. package/build/types/GenerateContext/EnhancedOntologyDefinition.d.ts +28 -0
  224. package/build/types/GenerateContext/EnhancedOntologyDefinition.d.ts.map +1 -0
  225. package/build/types/GenerateContext/EnhancedQuery.d.ts +13 -0
  226. package/build/types/GenerateContext/EnhancedQuery.d.ts.map +1 -0
  227. package/build/types/GenerateContext/EnhancedSharedPropertyType.d.ts +7 -0
  228. package/build/types/GenerateContext/EnhancedSharedPropertyType.d.ts.map +1 -0
  229. package/build/types/GenerateContext/ForeignType.d.ts +8 -0
  230. package/build/types/GenerateContext/ForeignType.d.ts.map +1 -0
  231. package/build/types/GenerateContext/GenerateContext.d.ts +13 -0
  232. package/build/types/GenerateContext/GenerateContext.d.ts.map +1 -0
  233. package/build/types/GenerateContext/enhanceOntology.d.ts +9 -0
  234. package/build/types/GenerateContext/enhanceOntology.d.ts.map +1 -0
  235. package/build/types/MinimalFs.d.ts +9 -0
  236. package/build/types/MinimalFs.d.ts.map +1 -0
  237. package/build/types/WireOntologyDefinition.d.ts +2 -0
  238. package/build/types/WireOntologyDefinition.d.ts.map +1 -0
  239. package/build/types/generateClientSdkPackage.d.ts +33 -0
  240. package/build/types/generateClientSdkPackage.d.ts.map +1 -0
  241. package/build/types/generateClientSdkPackage.test.d.ts +1 -0
  242. package/build/types/generateClientSdkPackage.test.d.ts.map +1 -0
  243. package/build/types/index.d.ts +4 -0
  244. package/build/types/index.d.ts.map +1 -0
  245. package/build/{browser → types}/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -1
  246. package/build/types/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +1 -0
  247. package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +1 -0
  248. package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +1 -0
  249. package/build/{browser → types}/shared/getObjectImports.d.ts +2 -2
  250. package/build/types/shared/getObjectImports.d.ts.map +1 -0
  251. package/build/{browser → types}/shared/getObjectTypeApiNamesFromQuery.d.ts +1 -2
  252. package/build/types/shared/getObjectTypeApiNamesFromQuery.d.ts.map +1 -0
  253. package/build/types/shared/getObjectTypesFromQueryDataType.d.ts +2 -0
  254. package/build/types/shared/getObjectTypesFromQueryDataType.d.ts.map +1 -0
  255. package/build/{browser → types}/shared/propertyJsdoc.d.ts +2 -3
  256. package/build/types/shared/propertyJsdoc.d.ts.map +1 -0
  257. package/build/types/shared/sanitizeMetadata.d.ts +1 -0
  258. package/build/types/shared/sanitizeMetadata.d.ts.map +1 -0
  259. package/build/types/shared/sanitizeMetadata.test.d.ts +1 -0
  260. package/build/types/shared/sanitizeMetadata.test.d.ts.map +1 -0
  261. package/build/{browser → types}/util/InMemoryFs.d.ts +2 -3
  262. package/build/types/util/InMemoryFs.d.ts.map +1 -0
  263. package/build/{browser → types}/util/commaSeparatedIdentifiers.d.ts +0 -1
  264. package/build/types/util/commaSeparatedIdentifiers.d.ts.map +1 -0
  265. package/build/{browser → types}/util/commaSeparatedTypeIdentifiers.d.ts +0 -1
  266. package/build/types/util/commaSeparatedTypeIdentifiers.d.ts.map +1 -0
  267. package/build/{browser → types}/util/deleteUndefineds.d.ts +0 -1
  268. package/build/types/util/deleteUndefineds.d.ts.map +1 -0
  269. package/build/{browser → types}/util/reservedKeywords.d.ts +0 -1
  270. package/build/types/util/reservedKeywords.d.ts.map +1 -0
  271. package/build/{browser → types}/util/stringUnionFrom.d.ts +0 -1
  272. package/build/types/util/stringUnionFrom.d.ts.map +1 -0
  273. package/build/types/util/stringify.d.ts +20 -0
  274. package/build/types/util/stringify.d.ts.map +1 -0
  275. package/build/types/util/test/TodoWireOntology.d.ts +2 -0
  276. package/build/types/util/test/TodoWireOntology.d.ts.map +1 -0
  277. package/build/{browser → types}/util/test/compileThis.d.ts +0 -1
  278. package/build/types/util/test/compileThis.d.ts.map +1 -0
  279. package/build/types/util/test/createMockMinimalFiles.d.ts +12 -0
  280. package/build/types/util/test/createMockMinimalFiles.d.ts.map +1 -0
  281. package/build/{browser → types}/util/test/formatTs.d.ts +0 -1
  282. package/build/types/util/test/formatTs.d.ts.map +1 -0
  283. package/build/types/util/verifyOutDir.d.ts +8 -0
  284. package/build/types/util/verifyOutDir.d.ts.map +1 -0
  285. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +1 -0
  286. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +1 -0
  287. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +1 -0
  288. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +1 -0
  289. package/build/{esm → types}/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -1
  290. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +1 -0
  291. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +1 -0
  292. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +1 -0
  293. package/build/{browser → types}/v2.0/generateMetadata.d.ts +0 -1
  294. package/build/types/v2.0/generateMetadata.d.ts.map +1 -0
  295. package/build/types/v2.0/generatePerActionDataFiles.d.ts +2 -0
  296. package/build/types/v2.0/generatePerActionDataFiles.d.ts.map +1 -0
  297. package/build/types/v2.0/generatePerActionDataFiles.test.d.ts +1 -0
  298. package/build/types/v2.0/generatePerActionDataFiles.test.d.ts.map +1 -0
  299. package/build/types/v2.0/generatePerInterfaceDataFiles.d.ts +1 -0
  300. package/build/types/v2.0/generatePerInterfaceDataFiles.d.ts.map +1 -0
  301. package/build/{esm → types}/v2.0/generatePerObjectDataFiles.d.ts +0 -1
  302. package/build/types/v2.0/generatePerObjectDataFiles.d.ts.map +1 -0
  303. package/build/{browser → types}/v2.0/generatePerQueryDataFiles.d.ts +2 -3
  304. package/build/types/v2.0/generatePerQueryDataFiles.d.ts.map +1 -0
  305. package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts +1 -0
  306. package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts.map +1 -0
  307. package/build/{esm → types}/v2.0/generateRootIndexTsFile.d.ts +0 -1
  308. package/build/types/v2.0/generateRootIndexTsFile.d.ts.map +1 -0
  309. package/build/{browser → types}/v2.0/getDescriptionIfPresent.d.ts +0 -1
  310. package/build/types/v2.0/getDescriptionIfPresent.d.ts.map +1 -0
  311. package/build/{browser → types}/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +4 -6
  312. package/build/types/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -0
  313. package/build/{browser → types}/validateWireOntologyAssumptions.d.ts +0 -1
  314. package/build/types/validateWireOntologyAssumptions.d.ts.map +1 -0
  315. package/package.json +26 -12
  316. package/build/browser/GenerateContext/EnhanceCommon.d.ts +0 -7
  317. package/build/browser/GenerateContext/EnhanceCommon.d.ts.map +0 -1
  318. package/build/browser/GenerateContext/EnhancedAction.d.ts +0 -14
  319. package/build/browser/GenerateContext/EnhancedAction.d.ts.map +0 -1
  320. package/build/browser/GenerateContext/EnhancedBase.d.ts +0 -21
  321. package/build/browser/GenerateContext/EnhancedBase.d.ts.map +0 -1
  322. package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
  323. package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
  324. package/build/browser/GenerateContext/EnhancedObjectType.d.ts +0 -12
  325. package/build/browser/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
  326. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -27
  327. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
  328. package/build/browser/GenerateContext/EnhancedQuery.d.ts +0 -14
  329. package/build/browser/GenerateContext/EnhancedQuery.d.ts.map +0 -1
  330. package/build/browser/GenerateContext/EnhancedSharedPropertyType.d.ts +0 -8
  331. package/build/browser/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
  332. package/build/browser/GenerateContext/ForeignType.d.ts +0 -9
  333. package/build/browser/GenerateContext/ForeignType.d.ts.map +0 -1
  334. package/build/browser/GenerateContext/GenerateContext.d.ts +0 -14
  335. package/build/browser/GenerateContext/GenerateContext.d.ts.map +0 -1
  336. package/build/browser/GenerateContext/enhanceOntology.d.ts +0 -10
  337. package/build/browser/GenerateContext/enhanceOntology.d.ts.map +0 -1
  338. package/build/browser/MinimalFs.d.ts +0 -10
  339. package/build/browser/MinimalFs.d.ts.map +0 -1
  340. package/build/browser/WireOntologyDefinition.d.ts +0 -4
  341. package/build/browser/WireOntologyDefinition.d.ts.map +0 -1
  342. package/build/browser/generateClientSdkPackage.d.ts +0 -47
  343. package/build/browser/generateClientSdkPackage.d.ts.map +0 -1
  344. package/build/browser/generateClientSdkPackage.test.d.ts +0 -2
  345. package/build/browser/generateClientSdkPackage.test.d.ts.map +0 -1
  346. package/build/browser/index.d.ts +0 -5
  347. package/build/browser/index.d.ts.map +0 -1
  348. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
  349. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
  350. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
  351. package/build/browser/shared/getObjectImports.d.ts.map +0 -1
  352. package/build/browser/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
  353. package/build/browser/shared/getObjectTypesFromQueryDataType.d.ts +0 -3
  354. package/build/browser/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
  355. package/build/browser/shared/propertyJsdoc.d.ts.map +0 -1
  356. package/build/browser/shared/sanitizeMetadata.d.ts +0 -2
  357. package/build/browser/shared/sanitizeMetadata.d.ts.map +0 -1
  358. package/build/browser/shared/sanitizeMetadata.test.d.ts +0 -2
  359. package/build/browser/shared/sanitizeMetadata.test.d.ts.map +0 -1
  360. package/build/browser/util/InMemoryFs.d.ts.map +0 -1
  361. package/build/browser/util/commaSeparatedIdentifiers.d.ts.map +0 -1
  362. package/build/browser/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
  363. package/build/browser/util/deleteUndefineds.d.ts.map +0 -1
  364. package/build/browser/util/reservedKeywords.d.ts.map +0 -1
  365. package/build/browser/util/stringUnionFrom.d.ts.map +0 -1
  366. package/build/browser/util/stringify.d.ts +0 -20
  367. package/build/browser/util/stringify.d.ts.map +0 -1
  368. package/build/browser/util/test/TodoWireOntology.d.ts +0 -217
  369. package/build/browser/util/test/TodoWireOntology.d.ts.map +0 -1
  370. package/build/browser/util/test/compileThis.d.ts.map +0 -1
  371. package/build/browser/util/test/createMockMinimalFiles.d.ts +0 -13
  372. package/build/browser/util/test/createMockMinimalFiles.d.ts.map +0 -1
  373. package/build/browser/util/test/formatTs.d.ts.map +0 -1
  374. package/build/browser/util/verifyOutDir.d.ts +0 -9
  375. package/build/browser/util/verifyOutDir.d.ts.map +0 -1
  376. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
  377. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
  378. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
  379. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
  380. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -4
  381. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
  382. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
  383. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
  384. package/build/browser/v2.0/generateMetadata.d.ts.map +0 -1
  385. package/build/browser/v2.0/generatePerActionDataFiles.d.ts +0 -3
  386. package/build/browser/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
  387. package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
  388. package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
  389. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
  390. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
  391. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts +0 -3
  392. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
  393. package/build/browser/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
  394. package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
  395. package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
  396. package/build/browser/v2.0/generateRootIndexTsFile.d.ts +0 -3
  397. package/build/browser/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
  398. package/build/browser/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
  399. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
  400. package/build/browser/validateWireOntologyAssumptions.d.ts.map +0 -1
  401. package/build/esm/GenerateContext/EnhanceCommon.d.ts +0 -7
  402. package/build/esm/GenerateContext/EnhanceCommon.d.ts.map +0 -1
  403. package/build/esm/GenerateContext/EnhancedAction.d.ts +0 -14
  404. package/build/esm/GenerateContext/EnhancedAction.d.ts.map +0 -1
  405. package/build/esm/GenerateContext/EnhancedBase.d.ts +0 -21
  406. package/build/esm/GenerateContext/EnhancedBase.d.ts.map +0 -1
  407. package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
  408. package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
  409. package/build/esm/GenerateContext/EnhancedObjectType.d.ts +0 -12
  410. package/build/esm/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
  411. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -27
  412. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
  413. package/build/esm/GenerateContext/EnhancedQuery.d.ts +0 -14
  414. package/build/esm/GenerateContext/EnhancedQuery.d.ts.map +0 -1
  415. package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts +0 -8
  416. package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
  417. package/build/esm/GenerateContext/ForeignType.d.ts +0 -9
  418. package/build/esm/GenerateContext/ForeignType.d.ts.map +0 -1
  419. package/build/esm/GenerateContext/GenerateContext.d.ts +0 -14
  420. package/build/esm/GenerateContext/GenerateContext.d.ts.map +0 -1
  421. package/build/esm/GenerateContext/enhanceOntology.d.ts +0 -10
  422. package/build/esm/GenerateContext/enhanceOntology.d.ts.map +0 -1
  423. package/build/esm/MinimalFs.d.ts +0 -10
  424. package/build/esm/MinimalFs.d.ts.map +0 -1
  425. package/build/esm/WireOntologyDefinition.d.ts +0 -4
  426. package/build/esm/WireOntologyDefinition.d.ts.map +0 -1
  427. package/build/esm/generateClientSdkPackage.d.ts +0 -47
  428. package/build/esm/generateClientSdkPackage.d.ts.map +0 -1
  429. package/build/esm/generateClientSdkPackage.test.d.ts +0 -2
  430. package/build/esm/generateClientSdkPackage.test.d.ts.map +0 -1
  431. package/build/esm/index.d.ts +0 -5
  432. package/build/esm/index.d.ts.map +0 -1
  433. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -2
  434. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
  435. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
  436. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
  437. package/build/esm/shared/getObjectImports.d.ts +0 -4
  438. package/build/esm/shared/getObjectImports.d.ts.map +0 -1
  439. package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts +0 -4
  440. package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
  441. package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts +0 -3
  442. package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
  443. package/build/esm/shared/propertyJsdoc.d.ts +0 -6
  444. package/build/esm/shared/propertyJsdoc.d.ts.map +0 -1
  445. package/build/esm/shared/sanitizeMetadata.d.ts +0 -2
  446. package/build/esm/shared/sanitizeMetadata.d.ts.map +0 -1
  447. package/build/esm/shared/sanitizeMetadata.test.d.ts +0 -2
  448. package/build/esm/shared/sanitizeMetadata.test.d.ts.map +0 -1
  449. package/build/esm/util/InMemoryFs.d.ts +0 -7
  450. package/build/esm/util/InMemoryFs.d.ts.map +0 -1
  451. package/build/esm/util/commaSeparatedIdentifiers.d.ts +0 -2
  452. package/build/esm/util/commaSeparatedIdentifiers.d.ts.map +0 -1
  453. package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts +0 -2
  454. package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
  455. package/build/esm/util/deleteUndefineds.d.ts +0 -2
  456. package/build/esm/util/deleteUndefineds.d.ts.map +0 -1
  457. package/build/esm/util/reservedKeywords.d.ts +0 -2
  458. package/build/esm/util/reservedKeywords.d.ts.map +0 -1
  459. package/build/esm/util/stringUnionFrom.d.ts +0 -2
  460. package/build/esm/util/stringUnionFrom.d.ts.map +0 -1
  461. package/build/esm/util/stringify.d.ts +0 -20
  462. package/build/esm/util/stringify.d.ts.map +0 -1
  463. package/build/esm/util/test/TodoWireOntology.d.ts +0 -217
  464. package/build/esm/util/test/TodoWireOntology.d.ts.map +0 -1
  465. package/build/esm/util/test/compileThis.d.ts +0 -3
  466. package/build/esm/util/test/compileThis.d.ts.map +0 -1
  467. package/build/esm/util/test/createMockMinimalFiles.d.ts +0 -13
  468. package/build/esm/util/test/createMockMinimalFiles.d.ts.map +0 -1
  469. package/build/esm/util/test/formatTs.d.ts +0 -2
  470. package/build/esm/util/test/formatTs.d.ts.map +0 -1
  471. package/build/esm/util/verifyOutDir.d.ts +0 -9
  472. package/build/esm/util/verifyOutDir.d.ts.map +0 -1
  473. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
  474. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
  475. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
  476. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
  477. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
  478. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
  479. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
  480. package/build/esm/v2.0/generateMetadata.d.ts +0 -3
  481. package/build/esm/v2.0/generateMetadata.d.ts.map +0 -1
  482. package/build/esm/v2.0/generatePerActionDataFiles.d.ts +0 -3
  483. package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
  484. package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
  485. package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
  486. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
  487. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
  488. package/build/esm/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
  489. package/build/esm/v2.0/generatePerQueryDataFiles.d.ts +0 -9
  490. package/build/esm/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
  491. package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
  492. package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
  493. package/build/esm/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
  494. package/build/esm/v2.0/getDescriptionIfPresent.d.ts +0 -2
  495. package/build/esm/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
  496. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +0 -12
  497. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
  498. package/build/esm/validateWireOntologyAssumptions.d.ts +0 -3
  499. package/build/esm/validateWireOntologyAssumptions.d.ts.map +0 -1
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export function deleteUndefineds(obj) {
17
18
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deleteUndefineds.js","names":["deleteUndefineds","obj","Object","fromEntries","entries","filter","value","undefined"],"sources":["deleteUndefineds.js"],"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 */\nexport function deleteUndefineds(obj) {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAACC,GAAG,EAAE;EAClC,OAAOC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACH,GAAG,CAAC,CAACI,MAAM,CAAC,CAAC,GAAGC,KAAK,CAAC,KAAKA,KAAK,KAAKC,SAAS,CAAC,CAAC;AAC7F","ignoreList":[]}
1
+ {"version":3,"file":"deleteUndefineds.js","names":["deleteUndefineds","obj","Object","fromEntries","entries","filter","value","undefined"],"sources":["deleteUndefineds.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\nexport function deleteUndefineds<T extends Record<string, any>>(obj: T): T {\n return Object.fromEntries(\n Object.entries(obj).filter(([, value]) => value !== undefined),\n ) as T;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,gBAAgBA,CAAgCC,GAAM,EAAK;EACzE,OAAOC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,GAAG,CAAC,CAACI,MAAM,CAAC,CAAC,GAAGC,KAAK,CAAC,KAAKA,KAAK,KAAKC,SAAS,CAC/D,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  // This must match the reservedKeywords definition in packages/legacy-client
17
18
  const reservedKeywords = new Set(["break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "import", "in", "instanceof", "new", "null", "return", "super", "switch", "this", "throw", "true", "try", "typeof", "var", "void", "while", "with", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"]);
18
19
  export function isReservedKeyword(name) {
@@ -1 +1 @@
1
- {"version":3,"file":"reservedKeywords.js","names":["reservedKeywords","Set","isReservedKeyword","name","has"],"sources":["reservedKeywords.js"],"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// This must match the reservedKeywords definition in packages/legacy-client\nconst reservedKeywords = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"class\",\n \"const\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"delete\",\n \"do\",\n \"else\",\n \"enum\",\n \"export\",\n \"extends\",\n \"false\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"import\",\n \"in\",\n \"instanceof\",\n \"new\",\n \"null\",\n \"return\",\n \"super\",\n \"switch\",\n \"this\",\n \"throw\",\n \"true\",\n \"try\",\n \"typeof\",\n \"var\",\n \"void\",\n \"while\",\n \"with\",\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n]);\nexport function isReservedKeyword(name) {\n return reservedKeywords.has(name);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,gBAAgB,GAAG,IAAIC,GAAG,CAAC,CAC7B,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACV,CAAC;AACF,OAAO,SAASC,iBAAiBA,CAACC,IAAI,EAAE;EACpC,OAAOH,gBAAgB,CAACI,GAAG,CAACD,IAAI,CAAC;AACrC","ignoreList":[]}
1
+ {"version":3,"file":"reservedKeywords.js","names":["reservedKeywords","Set","isReservedKeyword","name","has"],"sources":["reservedKeywords.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\n// This must match the reservedKeywords definition in packages/legacy-client\nconst reservedKeywords = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"class\",\n \"const\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"delete\",\n \"do\",\n \"else\",\n \"enum\",\n \"export\",\n \"extends\",\n \"false\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"import\",\n \"in\",\n \"instanceof\",\n \"new\",\n \"null\",\n \"return\",\n \"super\",\n \"switch\",\n \"this\",\n \"throw\",\n \"true\",\n \"try\",\n \"typeof\",\n \"var\",\n \"void\",\n \"while\",\n \"with\",\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n]);\n\nexport function isReservedKeyword(name: string): boolean {\n return reservedKeywords.has(name);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,gBAAgB,GAAG,IAAIC,GAAG,CAAC,CAC/B,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR,CAAC;AAEF,OAAO,SAASC,iBAAiBA,CAACC,IAAY,EAAW;EACvD,OAAOH,gBAAgB,CAACI,GAAG,CAACD,IAAI,CAAC;AACnC","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export function stringUnionFrom(values) {
17
18
  if (values.length === 0) {
18
19
  return "never";
@@ -1 +1 @@
1
- {"version":3,"file":"stringUnionFrom.js","names":["stringUnionFrom","values","length","map","v","join"],"sources":["stringUnionFrom.js"],"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 */\nexport function stringUnionFrom(values) {\n if (values.length === 0) {\n return \"never\";\n }\n else {\n return values.map(v => `\"${v}\"`).join(\"|\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAACC,MAAM,EAAE;EACpC,IAAIA,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;IACrB,OAAO,OAAO;EAClB,CAAC,MACI;IACD,OAAOD,MAAM,CAACE,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC9C;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"stringUnionFrom.js","names":["stringUnionFrom","values","length","map","v","join"],"sources":["stringUnionFrom.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\nexport function stringUnionFrom(values: ReadonlyArray<string>): string {\n if (values.length === 0) {\n return \"never\";\n } else {\n return values.map(v => `\"${v}\"`).join(\"|\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,eAAeA,CAACC,MAA6B,EAAU;EACrE,IAAIA,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;IACvB,OAAO,OAAO;EAChB,CAAC,MAAM;IACL,OAAOD,MAAM,CAACE,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC5C;AACF","ignoreList":[]}
@@ -13,6 +13,22 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
17
+ /**
18
+ * A function for changing the stringified key/value pairs of an object.
19
+ *
20
+ * @param value The value of the key/value pair.
21
+ * @param defaultValueFormatter The function that would be called if this customizer wasn't used
22
+ * @param key The key of the key/value pair.
23
+ * @param defaultKeyFormatter The function that would be called if this customizer wasn't used
24
+ *
25
+ * @returns A string, a tuple of strings, or undefined.
26
+ * If a string is returned, it will be used as the value of the key/value pair.
27
+ * If a tuple of strings is returned, the first string will be used as the key of the key/value pair
28
+ * and the second string will be used as the value of the key/value pair.
29
+ * If undefined is returned, the pair will be removed
30
+ */
31
+
16
32
  const defaultCustomizer = (value, defaultValueFormatter, key, defaultKeyFormatter) => {
17
33
  return [defaultKeyFormatter(key), defaultValueFormatter(value)];
18
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stringify.js","names":["defaultCustomizer","value","defaultValueFormatter","key","defaultKeyFormatter","stringify","obj","customizer","separator","JSON","entries","sortedKeys","Object","keys","sort","a","b","localeCompare","res","push","join"],"sources":["stringify.js"],"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 */\nconst defaultCustomizer = (value, defaultValueFormatter, key, defaultKeyFormatter) => {\n return [defaultKeyFormatter(key), defaultValueFormatter(value)];\n};\nexport function stringify(obj, customizer = {}, separator = \",\\n\") {\n const defaultKeyFormatter = (key) => `${JSON.stringify(key)}`;\n const entries = [];\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n for (const key of sortedKeys) {\n const value = obj[key];\n const res = (customizer[key] ?? customizer[\"*\"] ?? defaultCustomizer)(value, (value) => JSON.stringify(value, null, 2), key, defaultKeyFormatter);\n if (res) {\n if (typeof res === \"string\") {\n entries.push(`${defaultKeyFormatter(key)}: ${res}`);\n }\n else {\n entries.push(`${res[0]}: ${res[1]}`);\n }\n }\n }\n return entries.join(separator);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,qBAAqB,EAAEC,GAAG,EAAEC,mBAAmB,KAAK;EAClF,OAAO,CAACA,mBAAmB,CAACD,GAAG,CAAC,EAAED,qBAAqB,CAACD,KAAK,CAAC,CAAC;AACnE,CAAC;AACD,OAAO,SAASI,SAASA,CAACC,GAAG,EAAEC,UAAU,GAAG,CAAC,CAAC,EAAEC,SAAS,GAAG,KAAK,EAAE;EAC/D,MAAMJ,mBAAmB,GAAID,GAAG,IAAK,GAAGM,IAAI,CAACJ,SAAS,CAACF,GAAG,CAAC,EAAE;EAC7D,MAAMO,OAAO,GAAG,EAAE;EAClB,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACP,GAAG,CAAC,CAACQ,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CAAC,CAAC;EACtE,KAAK,MAAMb,GAAG,IAAIQ,UAAU,EAAE;IAC1B,MAAMV,KAAK,GAAGK,GAAG,CAACH,GAAG,CAAC;IACtB,MAAMe,GAAG,GAAG,CAACX,UAAU,CAACJ,GAAG,CAAC,IAAII,UAAU,CAAC,GAAG,CAAC,IAAIP,iBAAiB,EAAEC,KAAK,EAAGA,KAAK,IAAKQ,IAAI,CAACJ,SAAS,CAACJ,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAEE,GAAG,EAAEC,mBAAmB,CAAC;IACjJ,IAAIc,GAAG,EAAE;MACL,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;QACzBR,OAAO,CAACS,IAAI,CAAC,GAAGf,mBAAmB,CAACD,GAAG,CAAC,KAAKe,GAAG,EAAE,CAAC;MACvD,CAAC,MACI;QACDR,OAAO,CAACS,IAAI,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,KAAKA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;MACxC;IACJ;EACJ;EACA,OAAOR,OAAO,CAACU,IAAI,CAACZ,SAAS,CAAC;AAClC","ignoreList":[]}
1
+ {"version":3,"file":"stringify.js","names":["defaultCustomizer","value","defaultValueFormatter","key","defaultKeyFormatter","stringify","obj","customizer","separator","JSON","entries","sortedKeys","Object","keys","sort","a","b","localeCompare","res","push","join"],"sources":["stringify.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\n/**\n * A function for changing the stringified key/value pairs of an object.\n *\n * @param value The value of the key/value pair.\n * @param defaultValueFormatter The function that would be called if this customizer wasn't used\n * @param key The key of the key/value pair.\n * @param defaultKeyFormatter The function that would be called if this customizer wasn't used\n *\n * @returns A string, a tuple of strings, or undefined.\n * If a string is returned, it will be used as the value of the key/value pair.\n * If a tuple of strings is returned, the first string will be used as the key of the key/value pair\n * and the second string will be used as the value of the key/value pair.\n * If undefined is returned, the pair will be removed\n */\ntype Customizer<K extends string | symbol | number, V extends {}> = (\n value: V,\n defaultValueFormatter: (value: any) => string,\n key: K extends \"*\" ? string : K,\n defaultKeyFormatter: (key: string) => string,\n) => [string, string] | string | undefined;\nconst defaultCustomizer: Customizer<string, any> = (\n value,\n defaultValueFormatter,\n key,\n defaultKeyFormatter,\n) => {\n return [defaultKeyFormatter(key), defaultValueFormatter(value)];\n};\n\nexport function stringify<T extends Record<string, any>>(\n obj: T,\n customizer: {\n [K in keyof T | \"*\"]?: Customizer<K, T[K]>;\n } = {},\n separator = \",\\n\",\n): string {\n const defaultKeyFormatter = (key: string) => `${JSON.stringify(key)}`;\n const entries: Array<string> = [];\n\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n\n for (const key of sortedKeys) {\n const value = obj[key];\n const res =\n (customizer[key as keyof T] ?? customizer[\"*\"] ?? defaultCustomizer)(\n value,\n (value) => JSON.stringify(value, null, 2),\n key as any,\n defaultKeyFormatter,\n );\n\n if (res) {\n if (typeof res === \"string\") {\n entries.push(`${defaultKeyFormatter(key)}: ${res}`);\n } else {\n entries.push(`${res[0]}: ${res[1]}`);\n }\n }\n }\n return entries.join(separator);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA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ACF;EACF;EACA,OAAOR,OAAO,CAACU,IAAI,CAACZ,SAAS,CAAC;AAChC","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export const TodoWireOntology = {
17
18
  ontology: {
18
19
  rid: "ridHere",
@@ -85,19 +86,22 @@ export const TodoWireOntology = {
85
86
  id: {
86
87
  dataType: {
87
88
  type: "integer"
88
- }
89
+ },
90
+ rid: "rid"
89
91
  },
90
92
  body: {
91
93
  dataType: {
92
94
  type: "string"
93
95
  },
94
96
  description: "The text of the todo",
95
- displayName: "Body"
97
+ displayName: "Body",
98
+ rid: "rid"
96
99
  },
97
100
  complete: {
98
101
  dataType: {
99
102
  type: "boolean"
100
- }
103
+ },
104
+ rid: "rid"
101
105
  }
102
106
  },
103
107
  status: "ACTIVE",
@@ -139,7 +143,8 @@ export const TodoWireOntology = {
139
143
  email: {
140
144
  dataType: {
141
145
  type: "string"
142
- }
146
+ },
147
+ rid: "rid"
143
148
  }
144
149
  },
145
150
  rid: "ridForPerson",
@@ -214,7 +219,21 @@ export const TodoWireOntology = {
214
219
  rid: "idk",
215
220
  displayName: "Sum Interface",
216
221
  extendsInterfaces: [],
217
- links: {}
222
+ links: {},
223
+ implementedByObjectTypes: [],
224
+ allProperties: {
225
+ "SomeProperty": {
226
+ apiName: "SomeProperty",
227
+ description: "Some property",
228
+ displayName: "Sum Property",
229
+ dataType: {
230
+ type: "string"
231
+ },
232
+ rid: "idk2"
233
+ }
234
+ },
235
+ allExtendsInterfaces: [],
236
+ allLinks: {}
218
237
  }
219
238
  },
220
239
  sharedPropertyTypes: {
@@ -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","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","sharedPropertyTypes","SomeProperty"],"sources":["TodoWireOntology.js"],"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 */\nexport const TodoWireOntology = {\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 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 description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\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 },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\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 },\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 },\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: \"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: \"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 },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\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};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG;EAC5BC,QAAQ,EAAE;IACNC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACjB,CAAC;EACDC,WAAW,EAAE;IACT,mBAAmB,EAAE;MACjBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACRC,MAAM,EAAE;UACJH,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACNC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACvB,CAAC;UACDC,QAAQ,EAAE;QACd;MACJ,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,EAAE,CAAC;QACLJ,IAAI,EAAE,cAAc;QACpBE,iBAAiB,EAAE;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":"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","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","implementedByObjectTypes","allProperties","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty"],"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 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 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 },\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 },\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 },\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 },\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: \"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: \"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 },\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 },\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} 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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EAAE,eAAe;MACxBE,WAAW,EAAE,gBAAgB;MAC7BoB,UAAU,EAAE;QACV,cAAc,EAAE;UACdtB,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACRC,IAAI,EAAE;UACR,CAAC;UACDR,GAAG,EAAE;QACP;MACF,CAAC;MACDA,GAAG,EAAE,KAAK;MACVE,WAAW,EAAE,eAAe;MAC5ByC,iBAAiB,EAAE,EAAE;MACrBC,KAAK,EAAE,CAAC,CAAC;MACTC,wBAAwB,EAAE,EAAE;MAC5BC,aAAa,EAAE;QACb,cAAc,EAAE;UACd7C,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACRC,IAAI,EAAE;UACR,CAAC;UACDR,GAAG,EAAE;QACP;MACF,CAAC;MACD+C,oBAAoB,EAAE,EAAE;MACxBC,QAAQ,EAAE,CAAC;IACb;EACF,CAAC;EACDC,mBAAmB,EAAE;IACnBC,YAAY,EAAE;MACZjD,OAAO,EAAE,cAAc;MACvBE,WAAW,EAAE,eAAe;MAC5BD,WAAW,EAAE,cAAc;MAC3BK,QAAQ,EAAE;QACRC,IAAI,EAAE;MACR,CAAC;MACDR,GAAG,EAAE;IACP;EACF;AACF,CAA2C","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import * as ts from "typescript";
17
18
  export function compileThis(files, basePath) {
18
19
  const compilerOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"compileThis.js","names":["ts","compileThis","files","basePath","compilerOptions","noEmit","target","ScriptTarget","ES2020","host","createCompilerHost","originalReadFile","readFile","filename","startsWith","writeFile","Error","program","createProgram","options","rootNames","getPreEmitDiagnostics"],"sources":["compileThis.js"],"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 */\nimport * as ts from \"typescript\";\nexport function compileThis(files, basePath) {\n const compilerOptions = {\n noEmit: true,\n target: ts.ScriptTarget.ES2020,\n };\n const host = ts.createCompilerHost(compilerOptions);\n const originalReadFile = host.readFile;\n host.readFile = (filename) => {\n if (filename.startsWith(basePath)) {\n return files[filename];\n }\n else {\n return originalReadFile(filename);\n }\n };\n host.writeFile = () => {\n throw new Error(\"File writes not allowed\");\n };\n const program = ts.createProgram({\n options: compilerOptions,\n host,\n rootNames: [\"/foo/index.ts\"],\n });\n return ts.getPreEmitDiagnostics(program);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAChC,OAAO,SAASC,WAAWA,CAACC,KAAK,EAAEC,QAAQ,EAAE;EACzC,MAAMC,eAAe,GAAG;IACpBC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAEN,EAAE,CAACO,YAAY,CAACC;EAC5B,CAAC;EACD,MAAMC,IAAI,GAAGT,EAAE,CAACU,kBAAkB,CAACN,eAAe,CAAC;EACnD,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,QAAQ;EACtCH,IAAI,CAACG,QAAQ,GAAIC,QAAQ,IAAK;IAC1B,IAAIA,QAAQ,CAACC,UAAU,CAACX,QAAQ,CAAC,EAAE;MAC/B,OAAOD,KAAK,CAACW,QAAQ,CAAC;IAC1B,CAAC,MACI;MACD,OAAOF,gBAAgB,CAACE,QAAQ,CAAC;IACrC;EACJ,CAAC;EACDJ,IAAI,CAACM,SAAS,GAAG,MAAM;IACnB,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC9C,CAAC;EACD,MAAMC,OAAO,GAAGjB,EAAE,CAACkB,aAAa,CAAC;IAC7BC,OAAO,EAAEf,eAAe;IACxBK,IAAI;IACJW,SAAS,EAAE,CAAC,eAAe;EAC/B,CAAC,CAAC;EACF,OAAOpB,EAAE,CAACqB,qBAAqB,CAACJ,OAAO,CAAC;AAC5C","ignoreList":[]}
1
+ {"version":3,"file":"compileThis.js","names":["ts","compileThis","files","basePath","compilerOptions","noEmit","target","ScriptTarget","ES2020","host","createCompilerHost","originalReadFile","readFile","filename","startsWith","writeFile","Error","program","createProgram","options","rootNames","getPreEmitDiagnostics"],"sources":["compileThis.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 * as ts from \"typescript\";\n\nexport function compileThis(\n files: Record<string, string>,\n basePath: string,\n): readonly ts.Diagnostic[] {\n const compilerOptions: ts.CompilerOptions = {\n noEmit: true,\n target: ts.ScriptTarget.ES2020,\n };\n\n const host = ts.createCompilerHost(compilerOptions);\n const originalReadFile = host.readFile;\n host.readFile = (filename) => {\n if (filename.startsWith(basePath)) {\n return files[filename];\n } else {\n return originalReadFile(filename);\n }\n };\n host.writeFile = () => {\n throw new Error(\"File writes not allowed\");\n };\n\n const program = ts.createProgram({\n options: compilerOptions,\n host,\n rootNames: [\"/foo/index.ts\"],\n });\n\n return ts.getPreEmitDiagnostics(program);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAEhC,OAAO,SAASC,WAAWA,CACzBC,KAA6B,EAC7BC,QAAgB,EACU;EAC1B,MAAMC,eAAmC,GAAG;IAC1CC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAEN,EAAE,CAACO,YAAY,CAACC;EAC1B,CAAC;EAED,MAAMC,IAAI,GAAGT,EAAE,CAACU,kBAAkB,CAACN,eAAe,CAAC;EACnD,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,QAAQ;EACtCH,IAAI,CAACG,QAAQ,GAAIC,QAAQ,IAAK;IAC5B,IAAIA,QAAQ,CAACC,UAAU,CAACX,QAAQ,CAAC,EAAE;MACjC,OAAOD,KAAK,CAACW,QAAQ,CAAC;IACxB,CAAC,MAAM;MACL,OAAOF,gBAAgB,CAACE,QAAQ,CAAC;IACnC;EACF,CAAC;EACDJ,IAAI,CAACM,SAAS,GAAG,MAAM;IACrB,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C,CAAC;EAED,MAAMC,OAAO,GAAGjB,EAAE,CAACkB,aAAa,CAAC;IAC/BC,OAAO,EAAEf,eAAe;IACxBK,IAAI;IACJW,SAAS,EAAE,CAAC,eAAe;EAC7B,CAAC,CAAC;EAEF,OAAOpB,EAAE,CAACqB,qBAAqB,CAACJ,OAAO,CAAC;AAC1C","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { vi } from "vitest";
17
18
  export function createMockMinimalFiles() {
18
19
  const writeFile = vi.fn(() => Promise.resolve());
@@ -1 +1 @@
1
- {"version":3,"file":"createMockMinimalFiles.js","names":["vi","createMockMinimalFiles","writeFile","fn","Promise","resolve","getFiles","Object","fromEntries","mock","calls","readdir","minimalFiles","mkdir","dumpFilesToConsole","path","contents","entries","console","group","log","groupEnd"],"sources":["createMockMinimalFiles.js"],"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 */\nimport { vi } from \"vitest\";\nexport function createMockMinimalFiles() {\n const writeFile = vi.fn(() => Promise.resolve());\n const getFiles = () => Object.fromEntries(writeFile.mock.calls);\n const readdir = vi.fn(() => Promise.resolve([]));\n return {\n minimalFiles: {\n writeFile: writeFile,\n mkdir: () => Promise.resolve(),\n readdir: readdir,\n },\n getFiles,\n dumpFilesToConsole: () => {\n for (const [path, contents] of Object.entries(getFiles())) {\n console.group(path);\n console.log(contents);\n console.groupEnd();\n }\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,QAAQ;AAC3B,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACrC,MAAMC,SAAS,GAAGF,EAAE,CAACG,EAAE,CAAC,MAAMC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;EAChD,MAAMC,QAAQ,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACN,SAAS,CAACO,IAAI,CAACC,KAAK,CAAC;EAC/D,MAAMC,OAAO,GAAGX,EAAE,CAACG,EAAE,CAAC,MAAMC,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC,CAAC;EAChD,OAAO;IACHO,YAAY,EAAE;MACVV,SAAS,EAAEA,SAAS;MACpBW,KAAK,EAAEA,CAAA,KAAMT,OAAO,CAACC,OAAO,CAAC,CAAC;MAC9BM,OAAO,EAAEA;IACb,CAAC;IACDL,QAAQ;IACRQ,kBAAkB,EAAEA,CAAA,KAAM;MACtB,KAAK,MAAM,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIT,MAAM,CAACU,OAAO,CAACX,QAAQ,CAAC,CAAC,CAAC,EAAE;QACvDY,OAAO,CAACC,KAAK,CAACJ,IAAI,CAAC;QACnBG,OAAO,CAACE,GAAG,CAACJ,QAAQ,CAAC;QACrBE,OAAO,CAACG,QAAQ,CAAC,CAAC;MACtB;IACJ;EACJ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"createMockMinimalFiles.js","names":["vi","createMockMinimalFiles","writeFile","fn","Promise","resolve","getFiles","Object","fromEntries","mock","calls","readdir","minimalFiles","mkdir","dumpFilesToConsole","path","contents","entries","console","group","log","groupEnd"],"sources":["createMockMinimalFiles.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 { vi } from \"vitest\";\nimport type { ReaddirFn, WriteFileFn } from \"../../MinimalFs.js\";\n\nexport function createMockMinimalFiles(): {\n minimalFiles: {\n writeFile: WriteFileFn;\n mkdir: () => Promise<void>;\n readdir: ReaddirFn;\n };\n getFiles: () => {\n [k: string]: string;\n };\n dumpFilesToConsole: () => void;\n} {\n const writeFile = vi.fn<WriteFileFn>(\n () => Promise.resolve(),\n );\n const getFiles = () => Object.fromEntries(writeFile.mock.calls);\n\n const readdir = vi.fn<ReaddirFn>(\n () => Promise.resolve([]),\n );\n\n return {\n minimalFiles: {\n writeFile: writeFile as WriteFileFn,\n mkdir: () => Promise.resolve(),\n readdir: readdir as ReaddirFn,\n },\n getFiles,\n dumpFilesToConsole: () => {\n for (const [path, contents] of Object.entries(getFiles())) {\n console.group(path);\n console.log(contents);\n console.groupEnd();\n }\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,QAAQ;AAG3B,OAAO,SAASC,sBAAsBA,CAAA,EAUpC;EACA,MAAMC,SAAS,GAAGF,EAAE,CAACG,EAAE,CACrB,MAAMC,OAAO,CAACC,OAAO,CAAC,CACxB,CAAC;EACD,MAAMC,QAAQ,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACN,SAAS,CAACO,IAAI,CAACC,KAAK,CAAC;EAE/D,MAAMC,OAAO,GAAGX,EAAE,CAACG,EAAE,CACnB,MAAMC,OAAO,CAACC,OAAO,CAAC,EAAE,CAC1B,CAAC;EAED,OAAO;IACLO,YAAY,EAAE;MACZV,SAAS,EAAEA,SAAwB;MACnCW,KAAK,EAAEA,CAAA,KAAMT,OAAO,CAACC,OAAO,CAAC,CAAC;MAC9BM,OAAO,EAAEA;IACX,CAAC;IACDL,QAAQ;IACRQ,kBAAkB,EAAEA,CAAA,KAAM;MACxB,KAAK,MAAM,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIT,MAAM,CAACU,OAAO,CAACX,QAAQ,CAAC,CAAC,CAAC,EAAE;QACzDY,OAAO,CAACC,KAAK,CAACJ,IAAI,CAAC;QACnBG,OAAO,CAACE,GAAG,CAACJ,QAAQ,CAAC;QACrBE,OAAO,CAACG,QAAQ,CAAC,CAAC;MACpB;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { format } from "prettier";
17
18
  export function formatTs(contents) {
18
19
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"formatTs.js","names":["format","formatTs","contents","parser","singleQuote","trailingComma","tabWidth","printWidth","e","console","error","log"],"sources":["formatTs.js"],"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 */\nimport { format } from \"prettier\";\nexport function formatTs(contents) {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120,\n });\n }\n catch (e) {\n console.error(\"Failed to format file\", e);\n console.log(contents);\n return contents;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,UAAU;AACjC,OAAO,SAASC,QAAQA,CAACC,QAAQ,EAAE;EAC/B,IAAI;IACA,OAAOF,MAAM,CAACE,QAAQ,EAAE;MACpBC,MAAM,EAAE,YAAY;MACpBC,WAAW,EAAE,IAAI;MACjBC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,CAAC;MACXC,UAAU,EAAE;IAChB,CAAC,CAAC;EACN,CAAC,CACD,OAAOC,CAAC,EAAE;IACNC,OAAO,CAACC,KAAK,CAAC,uBAAuB,EAAEF,CAAC,CAAC;IACzCC,OAAO,CAACE,GAAG,CAACT,QAAQ,CAAC;IACrB,OAAOA,QAAQ;EACnB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"formatTs.js","names":["format","formatTs","contents","parser","singleQuote","trailingComma","tabWidth","printWidth","e","console","error","log"],"sources":["formatTs.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 { format } from \"prettier\";\n\nexport function formatTs(contents: string): string | Promise<string> {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120,\n });\n } catch (e) {\n console.error(\"Failed to format file\", e);\n console.log(contents);\n return contents;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,UAAU;AAEjC,OAAO,SAASC,QAAQA,CAACC,QAAgB,EAA4B;EACnE,IAAI;IACF,OAAOF,MAAM,CAACE,QAAQ,EAAE;MACtBC,MAAM,EAAE,YAAY;MACpBC,WAAW,EAAE,IAAI;MACjBC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,CAAC;MACXC,UAAU,EAAE;IACd,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVC,OAAO,CAACC,KAAK,CAAC,uBAAuB,EAAEF,CAAC,CAAC;IACzCC,OAAO,CAACE,GAAG,CAACT,QAAQ,CAAC;IACrB,OAAOA,QAAQ;EACjB;AACF","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  /**
17
18
  * Verify that the target outDir does not yet exist OR is empty.
18
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"verifyOutDir.js","names":["verifyOutDir","outDir","fs","contents","readdir","length","Error","e","code"],"sources":["verifyOutDir.js"],"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/**\n * Verify that the target outDir does not yet exist OR is empty.\n *\n * Re-generating an ontology on top of itself is not supported and may leave old\n * files around or refuse to update files with new contents in some cases.\n */\nexport async function verifyOutDir(outDir, fs) {\n // if outDir exists and is not empty, we cannot proceed with the generation\n try {\n const contents = await fs.readdir(outDir);\n if (contents.length !== 0) {\n throw new Error(`outDir ${outDir} is not empty, please delete its contents and try again`);\n }\n }\n catch (e) {\n if (e.code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n }\n else {\n throw e;\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeA,YAAYA,CAACC,MAAM,EAAEC,EAAE,EAAE;EAC3C;EACA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMD,EAAE,CAACE,OAAO,CAACH,MAAM,CAAC;IACzC,IAAIE,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACvB,MAAM,IAAIC,KAAK,CAAC,UAAUL,MAAM,yDAAyD,CAAC;IAC9F;EACJ,CAAC,CACD,OAAOM,CAAC,EAAE;IACN,MAAIA,CAAC,CAACC,IAAI,KAAK,QAAQ,GAGlB;MACD,MAAMD,CAAC;IACX,CAAC,CAJG;EAKR;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"verifyOutDir.js","names":["verifyOutDir","outDir","fs","contents","readdir","length","Error","e","code"],"sources":["verifyOutDir.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 { MinimalFs } from \"../MinimalFs.js\";\n\n/**\n * Verify that the target outDir does not yet exist OR is empty.\n *\n * Re-generating an ontology on top of itself is not supported and may leave old\n * files around or refuse to update files with new contents in some cases.\n */\nexport async function verifyOutDir(\n outDir: string,\n fs: MinimalFs,\n): Promise<void> {\n // if outDir exists and is not empty, we cannot proceed with the generation\n try {\n const contents = await fs.readdir(outDir);\n if (contents.length !== 0) {\n throw new Error(\n `outDir ${outDir} is not empty, please delete its contents and try again`,\n );\n }\n } catch (e) {\n if ((e as { code: string }).code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n } else {\n throw e;\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeA,YAAYA,CAChCC,MAAc,EACdC,EAAa,EACE;EACf;EACA,IAAI;IACF,MAAMC,QAAQ,GAAG,MAAMD,EAAE,CAACE,OAAO,CAACH,MAAM,CAAC;IACzC,IAAIE,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACzB,MAAM,IAAIC,KAAK,CACb,UAAUL,MAAM,yDAClB,CAAC;IACH;EACF,CAAC,CAAC,OAAOM,CAAC,EAAE;IACV,MAAKA,CAAC,CAAsBC,IAAI,KAAK,QAAQ,GAEtC;MACL,MAAMD,CAAC;IACT,CAAC,CAHC;EAIJ;AACF","ignoreList":[]}
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "@osdk/generator-converters";
18
+ import consola from "consola";
17
19
  import fastDeepEqual from "fast-deep-equal";
18
20
  import invariant from "tiny-invariant";
19
21
  import { extractNamespace } from "../GenerateContext/EnhancedBase.js";
@@ -21,6 +23,7 @@ import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.
21
23
  import { deleteUndefineds } from "../util/deleteUndefineds.js";
22
24
  import { stringify } from "../util/stringify.js";
23
25
  import { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps } from "./wireObjectTypeV2ToSdkObjectConstV2.js";
26
+
24
27
  /** @internal */
25
28
  export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {
26
29
  const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));
@@ -28,7 +31,7 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ont
28
31
  const parents = definition.implements?.map(p => {
29
32
  const parent = ontology.requireInterfaceType(p, true);
30
33
  if (parent instanceof EnhancedInterfaceType) {
31
- const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));
34
+ const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2, consola));
32
35
  return it;
33
36
  }
34
37
  }) ?? [];
@@ -1 +1 @@
1
- {"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","fastDeepEqual","invariant","extractNamespace","EnhancedInterfaceType","deleteUndefineds","stringify","createDefinition","createObjectSet","createOsdkObject","createPropertyKeys","createProps","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","interfaceDef","ontology","v2","forInternalUse","definition","raw","objectDefIdentifier","getDefinitionIdentifier","parents","implements","map","p","parent","requireInterfaceType","it","mergedProperties","properties","apiName","Object","keys","process","env","NODE_ENV","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","ids","apiNamespace","badProperties","filter","length","Error","fullApiName","join","links","linkTarget","requireObjectType","targetType","getImportedDefinitionIdentifier","multiplicity"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js"],"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 */\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps, } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {\n const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));\n return it;\n }\n }) ?? [];\n const mergedProperties = { ...definition.properties };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n invariant(fastDeepEqual(definition.properties[apiName], parent.properties[apiName]), `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`);\n }\n else if (mergedProperties[apiName] != null) {\n invariant(fastDeepEqual(mergedProperties[apiName], parent.properties[apiName]), `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`);\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n definition.properties = mergedProperties;\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n const ids = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName => extractNamespace(apiName)[0] == null);\n if (badProperties.length > 0) {\n throw new Error(`Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${badProperties.join(\", \")}`);\n }\n }\n function getV2Types(forInternalUse = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${Object.keys(definition.links).length === 0\n ? `export type ${osdkObjectLinksIdentifier} = {};`\n : `\n export interface ${osdkObjectLinksIdentifier} {\n${stringify(definition.links, {\n \"*\": (definition) => {\n const linkTarget = ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(v2);\n return `${definition.multiplicity\n ? `${linkTarget}[\"objectSet\"]`\n : `SingleLinkAccessor<${linkTarget}>`}\n `;\n },\n })}\n }\n `}\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mDAAmD,QAAQ,4BAA4B;AAChG,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,gBAAgB,QAAQ,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AW,CAACE,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC;AACtD;AACA;AACA,QAAQL,eAAe,CAACK,YAAY,EAAE8B,GAAG,CAAC;AAC1C;AACA,QAAQlC,gBAAgB,CAACI,YAAY,EAAE,cAAc,EAAE8B,GAAG,CAAC;AAC3D;AACA;AACA;AACA,MAAMpC,gBAAgB,CAACM,YAAY,EAAEC,QAAQ,EAAED,YAAY,CAACwB,YAAY,EAAEM,GAAG,CAAC;AAC9E;AACA,CAAC;EACG,CAAC,CAMiB3B,cAAc,CAAC,GAAG,EAAE;AAC1C;AACA,mBAAmBH,YAAY,CAACwB,YAAY,KAAKxB,YAAY,CAACwB,YAAY;AAC1E;AACA,kBAAkBxB,YAAY,CAACoC,WAAW;AAC1C;AACA,UAAU;AACV","ignoreList":[]}
1
+ {"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","consola","fastDeepEqual","invariant","extractNamespace","EnhancedInterfaceType","deleteUndefineds","stringify","createDefinition","createObjectSet","createOsdkObject","createPropertyKeys","createProps","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","interfaceDef","ontology","v2","forInternalUse","definition","raw","objectDefIdentifier","getDefinitionIdentifier","parents","implements","map","p","parent","requireInterfaceType","it","mergedProperties","properties","apiName","Object","keys","process","env","NODE_ENV","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","ids","apiNamespace","badProperties","filter","length","Error","fullApiName","join","links","linkTarget","requireObjectType","targetType","getImportedDefinitionIdentifier","multiplicity"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport consola from \"consola\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport type { EnhancedOntologyDefinition } from \"../GenerateContext/EnhancedOntologyDefinition.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport type { Identifiers } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\nimport {\n createDefinition,\n createObjectSet,\n createOsdkObject,\n createPropertyKeys,\n createProps,\n} from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n interfaceDef: EnhancedInterfaceType,\n ontology: EnhancedOntologyDefinition,\n v2: boolean = false,\n forInternalUse: boolean = false,\n) {\n const definition = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceDef.raw,\n v2,\n ),\n );\n\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n parent.raw,\n v2,\n consola,\n ),\n );\n return it;\n }\n }) ?? [];\n\n const mergedProperties = { ...definition.properties };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n invariant(\n fastDeepEqual(\n definition.properties[apiName],\n parent.properties[apiName],\n ),\n `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`,\n );\n } else if (mergedProperties[apiName] != null) {\n invariant(\n fastDeepEqual(\n mergedProperties[apiName],\n parent.properties[apiName],\n ),\n `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`,\n );\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n\n definition.properties = mergedProperties;\n\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier =\n `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n\n const ids: Identifiers = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName =>\n extractNamespace(apiName)[0] == null\n );\n if (badProperties.length > 0) {\n throw new Error(\n `Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${\n badProperties.join(\", \")\n }`,\n );\n }\n }\n\n function getV2Types(forInternalUse: boolean = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${\n Object.keys(definition.links).length === 0\n ? `export type ${osdkObjectLinksIdentifier} = {};`\n : `\n export interface ${osdkObjectLinksIdentifier} {\n${\n stringify(definition.links, {\n \"*\": (definition) => {\n const linkTarget = ontology.requireObjectType(\n definition.targetType,\n )\n .getImportedDefinitionIdentifier(v2);\n\n return `${\n definition.multiplicity\n ? `${linkTarget}[\"objectSet\"]`\n : `SingleLinkAccessor<${linkTarget}>`\n }\n `;\n },\n })\n }\n }\n `\n }\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports: string[] = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mDAAmD,QAAQ,4BAA4B;AAChG,OAAOC,OAAO,MAAM,SAAS;AAC7B,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,qBAAqB,QAAQ,6CAA6C;AAEnF,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAEhD,SACEC,gBAAgB,E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B,CAACI,YAAY,EAAE,cAAc,EAAE8B,GAAG,CAAC;AAC3D;AACA;AACA;AACA,MAAMpC,gBAAgB,CAACM,YAAY,EAAEC,QAAQ,EAAED,YAAY,CAACwB,YAAY,EAAEM,GAAG,CAAC;AAC9E;AACA,CAAC;EACC,CAAC,CAOmB3B,cAAc,CAAC,GAAG,EAAE;AAC1C;AACA,mBAAmBH,YAAY,CAACwB,YAAY,KAAKxB,YAAY,CAACwB,YAAY;AAC1E;AACA,kBAAkBxB,YAAY,CAACoC,WAAW;AAC1C;AACA,UAAU;AACV","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { format } from "prettier";
17
18
  import { describe, expect, it } from "vitest";
18
19
  import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.js";
@@ -39,7 +40,11 @@ function simpleInterface(apiName, spts, parents, metadataLevel = 2) {
39
40
  description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,
40
41
  extendsInterfaces: parents,
41
42
  links: {},
42
- properties
43
+ properties,
44
+ implementedByObjectTypes: [],
45
+ allExtendsInterfaces: parents,
46
+ allLinks: {},
47
+ allProperties: properties
43
48
  };
44
49
  }
45
50
  function simpleOntology(apiName, interfaces) {
@@ -66,6 +71,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
66
71
  importExt: ""
67
72
  });
68
73
  expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(true);
74
+
69
75
  // type guard for below
70
76
  if (ontology.interfaceTypes.Bar instanceof ForeignType) {
71
77
  throw new Error("Expected Bar to be an EnhancedInterfaceType");
@@ -117,6 +123,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
117
123
  strictProps: Bar.StrictProps;
118
124
  apiName: "Bar";
119
125
  displayName: "Bar";
126
+ implementedBy: [];
120
127
  implements: [];
121
128
  links: {};
122
129
  properties: {
@@ -192,6 +199,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
192
199
  apiName: "Foo";
193
200
  description: "Foo interface desc";
194
201
  displayName: "Foo interface dn";
202
+ implementedBy: [];
195
203
  implements: ["Parent"];
196
204
  links: {};
197
205
  properties: {
@@ -269,6 +277,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
269
277
  apiName: "Foo";
270
278
  description: "Foo interface desc";
271
279
  displayName: "Foo interface dn";
280
+ implementedBy: [];
272
281
  implements: ["Parent"];
273
282
  links: {};
274
283
  properties: {
@@ -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","properties","Object","fromEntries","map","spt","extendsInterfaces","links","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js"],"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 */\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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\nfunction simpleSpt(apiName, metadataLevel = 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 };\n}\nfunction simpleInterface(apiName, spts, parents, metadataLevel = 2) {\n const properties = Object.fromEntries(spts.map(spt => [spt.apiName, spt]));\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 };\n}\nfunction simpleOntology(apiName, interfaces) {\n const interfaceTypes = Object\n .fromEntries(interfaces.map(i => [i.apiName, i]));\n const sharedPropertyTypes = Object\n .fromEntries(interfaces.flatMap(i => Object.entries(i.properties)));\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 };\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 expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(true);\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Bar, ontology, true, true), {\n parser: \"typescript\",\n printWidth: 100,\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\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 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 displayName: \"Bar\";\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 it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n });\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {\n parser: \"typescript\",\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\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 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 implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\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(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n });\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {\n parser: \"typescript\",\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\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 readonly bar: $PropType[\"integer\"] | undefined;\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 implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,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;AAC/D,SAASC,8CAA8C,QAAQ,mDAAmD;AAClH,SAASC,SAASA,CAACC,OAAO,EAAEC,aAAa,GAAG,CAAC,EAAE;EAC3C,OAAO;IACHD,OAAO;IACPE,QAAQ,EAAE;MACNC,IAAI,EAAE;IACV,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;EACnE,CAAC;AACL;AACA,SAASC,eAAeA,CAACR,OAAO,EAAES,IAAI,EAAEC,OAAO,EAAET,aAAa,GAAG,CAAC,EAAE;EAChE,MAAMU,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACJ,IAAI,CAACK,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,CAACf,OAAO,EAAEe,GAAG,CAAC,CAAC,CAAC;EAC1E,OAAO;IACHf,OAAO;IACPI,GAAG,EAAE,GAAGJ,OAAO,KAAK;IACpBK,WAAW,EAAEJ,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,eAAe,GAAGA,OAAO;IACrEM,WAAW,EAAEL,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,iBAAiB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ACA;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;EACF,CAAC,CAAC;AACN,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","properties","Object","fromEntries","map","spt","extendsInterfaces","links","implementedByObjectTypes","allExtendsInterfaces","allLinks","allProperties","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo"],"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) {\n const properties = Object.fromEntries(spts.map(spt => [spt.apiName, spt]));\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 } 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 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 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 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 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 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 * 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 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 readonly bar: $PropType[\"integer\"] | undefined;\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 * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\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"],"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,C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AC;IAC/B,MAAM4C,MAAM,GAAG5C,SAAS,CAAC,KAAK,CAAC;IAE/B,MAAMgC,QAAQ,GAAGnC,eAAe,CAC9B;MACEqC,SAAS,EAAEX,cAAc,CAAC,UAAU,EAAE,CACpCd,eAAe,CAAC,KAAK,EAAE,CAACkC,MAAM,EAAEC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EACpDnC,eAAe,CAAC,QAAQ,EAAE,CAACmC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxC,CAAC;MACFT,SAAS,EAAE;IACb,CACF,CAAC;IAED,MAAMI,aAAa,GAAG,MAAM/C,MAAM,CAChCO,8CAA8C,CAC5CiC,QAAQ,CAACP,cAAc,CAACoB,GAAG,EAC3Bb,QAAQ,EACR,IAAI,EACJ,IACF,CAAC,EACD;MACEQ,MAAM,EAAE;IACV,CACF,CAAC;IACD9C,MAAM,CAAC6C,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,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}