@osdk/generator 2.1.0-beta.23 → 2.1.0-beta.24

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 (438) hide show
  1. package/CHANGELOG.md +15 -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 +1 -1
  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 +1 -1
  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 +2 -0
  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 +1 -0
  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 +2 -0
  75. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  76. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +5 -0
  77. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  78. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +3 -0
  79. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  80. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +11 -0
  81. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  82. package/build/browser/v2.0/generateMetadata.js +3 -0
  83. package/build/browser/v2.0/generateMetadata.js.map +1 -1
  84. package/build/browser/v2.0/generatePerActionDataFiles.js +23 -5
  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 +1 -0
  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 +1 -0
  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 +2 -0
  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/index.cjs +1384 -0
  105. package/build/cjs/index.cjs.map +1 -0
  106. package/build/cjs/index.d.cts +31 -0
  107. package/build/esm/GenerateContext/EnhanceCommon.js +0 -15
  108. package/build/esm/GenerateContext/EnhanceCommon.js.map +1 -1
  109. package/build/esm/GenerateContext/EnhancedAction.js +1 -1
  110. package/build/esm/GenerateContext/EnhancedAction.js.map +1 -1
  111. package/build/esm/GenerateContext/EnhancedBase.js +2 -7
  112. package/build/esm/GenerateContext/EnhancedBase.js.map +1 -1
  113. package/build/esm/GenerateContext/EnhancedInterfaceType.js +1 -1
  114. package/build/esm/GenerateContext/EnhancedInterfaceType.js.map +1 -1
  115. package/build/esm/GenerateContext/EnhancedObjectType.js +1 -1
  116. package/build/esm/GenerateContext/EnhancedObjectType.js.map +1 -1
  117. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js +1 -8
  118. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
  119. package/build/esm/GenerateContext/EnhancedQuery.js +1 -1
  120. package/build/esm/GenerateContext/EnhancedQuery.js.map +1 -1
  121. package/build/esm/GenerateContext/EnhancedSharedPropertyType.js +1 -1
  122. package/build/esm/GenerateContext/EnhancedSharedPropertyType.js.map +1 -1
  123. package/build/esm/GenerateContext/ForeignType.js +1 -1
  124. package/build/esm/GenerateContext/ForeignType.js.map +1 -1
  125. package/build/esm/GenerateContext/GenerateContext.js +0 -15
  126. package/build/esm/GenerateContext/GenerateContext.js.map +1 -1
  127. package/build/esm/GenerateContext/enhanceOntology.js +1 -0
  128. package/build/esm/GenerateContext/enhanceOntology.js.map +1 -1
  129. package/build/esm/MinimalFs.js +0 -15
  130. package/build/esm/MinimalFs.js.map +1 -1
  131. package/build/esm/WireOntologyDefinition.js +0 -15
  132. package/build/esm/WireOntologyDefinition.js.map +1 -1
  133. package/build/esm/generateClientSdkPackage.js +2 -0
  134. package/build/esm/generateClientSdkPackage.js.map +1 -1
  135. package/build/esm/generateClientSdkPackage.test.js +1 -0
  136. package/build/esm/generateClientSdkPackage.test.js.map +1 -1
  137. package/build/esm/index.js +1 -0
  138. package/build/esm/index.js.map +1 -1
  139. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js +1 -0
  140. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -1
  141. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +1 -0
  142. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -1
  143. package/build/esm/shared/getObjectImports.js +1 -0
  144. package/build/esm/shared/getObjectImports.js.map +1 -1
  145. package/build/esm/shared/getObjectTypeApiNamesFromQuery.js +1 -0
  146. package/build/esm/shared/getObjectTypeApiNamesFromQuery.js.map +1 -1
  147. package/build/esm/shared/getObjectTypesFromQueryDataType.js +1 -0
  148. package/build/esm/shared/getObjectTypesFromQueryDataType.js.map +1 -1
  149. package/build/esm/shared/propertyJsdoc.js +1 -0
  150. package/build/esm/shared/propertyJsdoc.js.map +1 -1
  151. package/build/esm/shared/sanitizeMetadata.js +9 -0
  152. package/build/esm/shared/sanitizeMetadata.js.map +1 -1
  153. package/build/esm/shared/sanitizeMetadata.test.js +1 -0
  154. package/build/esm/shared/sanitizeMetadata.test.js.map +1 -1
  155. package/build/esm/util/InMemoryFs.js +1 -0
  156. package/build/esm/util/InMemoryFs.js.map +1 -1
  157. package/build/esm/util/commaSeparatedIdentifiers.js +1 -0
  158. package/build/esm/util/commaSeparatedIdentifiers.js.map +1 -1
  159. package/build/esm/util/commaSeparatedTypeIdentifiers.js +1 -0
  160. package/build/esm/util/commaSeparatedTypeIdentifiers.js.map +1 -1
  161. package/build/esm/util/deleteUndefineds.js +1 -0
  162. package/build/esm/util/deleteUndefineds.js.map +1 -1
  163. package/build/esm/util/reservedKeywords.js +1 -0
  164. package/build/esm/util/reservedKeywords.js.map +1 -1
  165. package/build/esm/util/stringUnionFrom.js +1 -0
  166. package/build/esm/util/stringUnionFrom.js.map +1 -1
  167. package/build/esm/util/stringify.js +16 -0
  168. package/build/esm/util/stringify.js.map +1 -1
  169. package/build/esm/util/test/TodoWireOntology.js +1 -0
  170. package/build/esm/util/test/TodoWireOntology.js.map +1 -1
  171. package/build/esm/util/test/compileThis.js +1 -0
  172. package/build/esm/util/test/compileThis.js.map +1 -1
  173. package/build/esm/util/test/createMockMinimalFiles.js +1 -0
  174. package/build/esm/util/test/createMockMinimalFiles.js.map +1 -1
  175. package/build/esm/util/test/formatTs.js +1 -0
  176. package/build/esm/util/test/formatTs.js.map +1 -1
  177. package/build/esm/util/verifyOutDir.js +1 -0
  178. package/build/esm/util/verifyOutDir.js.map +1 -1
  179. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +2 -0
  180. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  181. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +5 -0
  182. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  183. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +3 -0
  184. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  185. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +11 -0
  186. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  187. package/build/esm/v2.0/generateMetadata.js +3 -0
  188. package/build/esm/v2.0/generateMetadata.js.map +1 -1
  189. package/build/esm/v2.0/generatePerActionDataFiles.js +23 -5
  190. package/build/esm/v2.0/generatePerActionDataFiles.js.map +1 -1
  191. package/build/esm/v2.0/generatePerActionDataFiles.test.js +1 -0
  192. package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +1 -1
  193. package/build/esm/v2.0/generatePerInterfaceDataFiles.js +2 -0
  194. package/build/esm/v2.0/generatePerInterfaceDataFiles.js.map +1 -1
  195. package/build/esm/v2.0/generatePerObjectDataFiles.js +1 -0
  196. package/build/esm/v2.0/generatePerObjectDataFiles.js.map +1 -1
  197. package/build/esm/v2.0/generatePerQueryDataFiles.js +1 -0
  198. package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
  199. package/build/esm/v2.0/generatePerQueryDataFiles.test.js +2 -0
  200. package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  201. package/build/esm/v2.0/generateRootIndexTsFile.js +1 -0
  202. package/build/esm/v2.0/generateRootIndexTsFile.js.map +1 -1
  203. package/build/esm/v2.0/getDescriptionIfPresent.js +1 -0
  204. package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -1
  205. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +2 -0
  206. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
  207. package/build/esm/validateWireOntologyAssumptions.js +1 -0
  208. package/build/esm/validateWireOntologyAssumptions.js.map +1 -1
  209. package/build/types/GenerateContext/EnhanceCommon.d.ts +6 -0
  210. package/build/types/GenerateContext/EnhancedAction.d.ts +13 -0
  211. package/build/types/GenerateContext/EnhancedBase.d.ts +20 -0
  212. package/build/types/GenerateContext/EnhancedInterfaceType.d.ts +12 -0
  213. package/build/{esm → types}/GenerateContext/EnhancedObjectType.d.ts +5 -6
  214. package/build/types/GenerateContext/EnhancedOntologyDefinition.d.ts +28 -0
  215. package/build/types/GenerateContext/EnhancedQuery.d.ts +13 -0
  216. package/build/{browser → types}/GenerateContext/EnhancedSharedPropertyType.d.ts +2 -3
  217. package/build/types/GenerateContext/ForeignType.d.ts +8 -0
  218. package/build/types/GenerateContext/GenerateContext.d.ts +13 -0
  219. package/build/types/GenerateContext/enhanceOntology.d.ts +9 -0
  220. package/build/types/MinimalFs.d.ts +7 -0
  221. package/build/{browser → types}/WireOntologyDefinition.d.ts +1 -3
  222. package/build/{browser → types}/generateClientSdkPackage.d.ts +23 -26
  223. package/build/types/generateClientSdkPackage.test.d.ts +1 -0
  224. package/build/types/index.d.ts +4 -0
  225. package/build/{browser → types}/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -1
  226. package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +1 -0
  227. package/build/{browser → types}/shared/getObjectImports.d.ts +2 -2
  228. package/build/{browser → types}/shared/getObjectTypeApiNamesFromQuery.d.ts +0 -1
  229. package/build/{browser → types}/shared/getObjectTypesFromQueryDataType.d.ts +0 -1
  230. package/build/{browser → types}/shared/propertyJsdoc.d.ts +2 -3
  231. package/build/types/shared/sanitizeMetadata.d.ts +1 -0
  232. package/build/types/shared/sanitizeMetadata.test.d.ts +1 -0
  233. package/build/{browser → types}/util/InMemoryFs.d.ts +2 -3
  234. package/build/{browser → types}/util/commaSeparatedIdentifiers.d.ts +0 -1
  235. package/build/{browser → types}/util/commaSeparatedTypeIdentifiers.d.ts +0 -1
  236. package/build/{browser → types}/util/deleteUndefineds.d.ts +0 -1
  237. package/build/{browser → types}/util/reservedKeywords.d.ts +0 -1
  238. package/build/{browser → types}/util/stringUnionFrom.d.ts +0 -1
  239. package/build/types/util/stringify.d.ts +20 -0
  240. package/build/{browser → types}/util/test/TodoWireOntology.d.ts +0 -1
  241. package/build/{browser → types}/util/test/compileThis.d.ts +0 -1
  242. package/build/types/util/test/createMockMinimalFiles.d.ts +10 -0
  243. package/build/{browser → types}/util/test/formatTs.d.ts +0 -1
  244. package/build/types/util/verifyOutDir.d.ts +8 -0
  245. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +1 -0
  246. package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +1 -0
  247. package/build/{esm → types}/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -1
  248. package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +1 -0
  249. package/build/{browser → types}/v2.0/generateMetadata.d.ts +0 -1
  250. package/build/types/v2.0/generatePerActionDataFiles.d.ts +2 -0
  251. package/build/types/v2.0/generatePerActionDataFiles.test.d.ts +1 -0
  252. package/build/types/v2.0/generatePerInterfaceDataFiles.d.ts +1 -0
  253. package/build/{esm → types}/v2.0/generatePerObjectDataFiles.d.ts +0 -1
  254. package/build/{browser → types}/v2.0/generatePerQueryDataFiles.d.ts +2 -5
  255. package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts +1 -0
  256. package/build/{esm → types}/v2.0/generateRootIndexTsFile.d.ts +0 -1
  257. package/build/{browser → types}/v2.0/getDescriptionIfPresent.d.ts +0 -1
  258. package/build/{browser → types}/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +4 -6
  259. package/build/{browser → types}/validateWireOntologyAssumptions.d.ts +0 -1
  260. package/package.json +22 -9
  261. package/build/browser/GenerateContext/EnhanceCommon.d.ts +0 -7
  262. package/build/browser/GenerateContext/EnhanceCommon.d.ts.map +0 -1
  263. package/build/browser/GenerateContext/EnhancedAction.d.ts +0 -14
  264. package/build/browser/GenerateContext/EnhancedAction.d.ts.map +0 -1
  265. package/build/browser/GenerateContext/EnhancedBase.d.ts +0 -21
  266. package/build/browser/GenerateContext/EnhancedBase.d.ts.map +0 -1
  267. package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
  268. package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
  269. package/build/browser/GenerateContext/EnhancedObjectType.d.ts +0 -12
  270. package/build/browser/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
  271. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -29
  272. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
  273. package/build/browser/GenerateContext/EnhancedQuery.d.ts +0 -14
  274. package/build/browser/GenerateContext/EnhancedQuery.d.ts.map +0 -1
  275. package/build/browser/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
  276. package/build/browser/GenerateContext/ForeignType.d.ts +0 -9
  277. package/build/browser/GenerateContext/ForeignType.d.ts.map +0 -1
  278. package/build/browser/GenerateContext/GenerateContext.d.ts +0 -14
  279. package/build/browser/GenerateContext/GenerateContext.d.ts.map +0 -1
  280. package/build/browser/GenerateContext/enhanceOntology.d.ts +0 -10
  281. package/build/browser/GenerateContext/enhanceOntology.d.ts.map +0 -1
  282. package/build/browser/MinimalFs.d.ts +0 -10
  283. package/build/browser/MinimalFs.d.ts.map +0 -1
  284. package/build/browser/WireOntologyDefinition.d.ts.map +0 -1
  285. package/build/browser/generateClientSdkPackage.d.ts.map +0 -1
  286. package/build/browser/generateClientSdkPackage.test.d.ts +0 -2
  287. package/build/browser/generateClientSdkPackage.test.d.ts.map +0 -1
  288. package/build/browser/index.d.ts +0 -5
  289. package/build/browser/index.d.ts.map +0 -1
  290. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
  291. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
  292. package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
  293. package/build/browser/shared/getObjectImports.d.ts.map +0 -1
  294. package/build/browser/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
  295. package/build/browser/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
  296. package/build/browser/shared/propertyJsdoc.d.ts.map +0 -1
  297. package/build/browser/shared/sanitizeMetadata.d.ts +0 -2
  298. package/build/browser/shared/sanitizeMetadata.d.ts.map +0 -1
  299. package/build/browser/shared/sanitizeMetadata.test.d.ts +0 -2
  300. package/build/browser/shared/sanitizeMetadata.test.d.ts.map +0 -1
  301. package/build/browser/util/InMemoryFs.d.ts.map +0 -1
  302. package/build/browser/util/commaSeparatedIdentifiers.d.ts.map +0 -1
  303. package/build/browser/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
  304. package/build/browser/util/deleteUndefineds.d.ts.map +0 -1
  305. package/build/browser/util/reservedKeywords.d.ts.map +0 -1
  306. package/build/browser/util/stringUnionFrom.d.ts.map +0 -1
  307. package/build/browser/util/stringify.d.ts +0 -20
  308. package/build/browser/util/stringify.d.ts.map +0 -1
  309. package/build/browser/util/test/TodoWireOntology.d.ts.map +0 -1
  310. package/build/browser/util/test/compileThis.d.ts.map +0 -1
  311. package/build/browser/util/test/createMockMinimalFiles.d.ts +0 -13
  312. package/build/browser/util/test/createMockMinimalFiles.d.ts.map +0 -1
  313. package/build/browser/util/test/formatTs.d.ts.map +0 -1
  314. package/build/browser/util/verifyOutDir.d.ts +0 -9
  315. package/build/browser/util/verifyOutDir.d.ts.map +0 -1
  316. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
  317. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
  318. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
  319. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
  320. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -4
  321. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
  322. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
  323. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
  324. package/build/browser/v2.0/generateMetadata.d.ts.map +0 -1
  325. package/build/browser/v2.0/generatePerActionDataFiles.d.ts +0 -3
  326. package/build/browser/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
  327. package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
  328. package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
  329. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
  330. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
  331. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts +0 -3
  332. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
  333. package/build/browser/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
  334. package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
  335. package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
  336. package/build/browser/v2.0/generateRootIndexTsFile.d.ts +0 -3
  337. package/build/browser/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
  338. package/build/browser/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
  339. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
  340. package/build/browser/validateWireOntologyAssumptions.d.ts.map +0 -1
  341. package/build/esm/GenerateContext/EnhanceCommon.d.ts +0 -7
  342. package/build/esm/GenerateContext/EnhanceCommon.d.ts.map +0 -1
  343. package/build/esm/GenerateContext/EnhancedAction.d.ts +0 -14
  344. package/build/esm/GenerateContext/EnhancedAction.d.ts.map +0 -1
  345. package/build/esm/GenerateContext/EnhancedBase.d.ts +0 -21
  346. package/build/esm/GenerateContext/EnhancedBase.d.ts.map +0 -1
  347. package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
  348. package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
  349. package/build/esm/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
  350. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -29
  351. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
  352. package/build/esm/GenerateContext/EnhancedQuery.d.ts +0 -14
  353. package/build/esm/GenerateContext/EnhancedQuery.d.ts.map +0 -1
  354. package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts +0 -8
  355. package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
  356. package/build/esm/GenerateContext/ForeignType.d.ts +0 -9
  357. package/build/esm/GenerateContext/ForeignType.d.ts.map +0 -1
  358. package/build/esm/GenerateContext/GenerateContext.d.ts +0 -14
  359. package/build/esm/GenerateContext/GenerateContext.d.ts.map +0 -1
  360. package/build/esm/GenerateContext/enhanceOntology.d.ts +0 -10
  361. package/build/esm/GenerateContext/enhanceOntology.d.ts.map +0 -1
  362. package/build/esm/MinimalFs.d.ts +0 -10
  363. package/build/esm/MinimalFs.d.ts.map +0 -1
  364. package/build/esm/WireOntologyDefinition.d.ts +0 -4
  365. package/build/esm/WireOntologyDefinition.d.ts.map +0 -1
  366. package/build/esm/generateClientSdkPackage.d.ts +0 -34
  367. package/build/esm/generateClientSdkPackage.d.ts.map +0 -1
  368. package/build/esm/generateClientSdkPackage.test.d.ts +0 -2
  369. package/build/esm/generateClientSdkPackage.test.d.ts.map +0 -1
  370. package/build/esm/index.d.ts +0 -5
  371. package/build/esm/index.d.ts.map +0 -1
  372. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -2
  373. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
  374. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
  375. package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
  376. package/build/esm/shared/getObjectImports.d.ts +0 -4
  377. package/build/esm/shared/getObjectImports.d.ts.map +0 -1
  378. package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts +0 -4
  379. package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
  380. package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts +0 -3
  381. package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
  382. package/build/esm/shared/propertyJsdoc.d.ts +0 -6
  383. package/build/esm/shared/propertyJsdoc.d.ts.map +0 -1
  384. package/build/esm/shared/sanitizeMetadata.d.ts +0 -2
  385. package/build/esm/shared/sanitizeMetadata.d.ts.map +0 -1
  386. package/build/esm/shared/sanitizeMetadata.test.d.ts +0 -2
  387. package/build/esm/shared/sanitizeMetadata.test.d.ts.map +0 -1
  388. package/build/esm/util/InMemoryFs.d.ts +0 -7
  389. package/build/esm/util/InMemoryFs.d.ts.map +0 -1
  390. package/build/esm/util/commaSeparatedIdentifiers.d.ts +0 -2
  391. package/build/esm/util/commaSeparatedIdentifiers.d.ts.map +0 -1
  392. package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts +0 -2
  393. package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
  394. package/build/esm/util/deleteUndefineds.d.ts +0 -2
  395. package/build/esm/util/deleteUndefineds.d.ts.map +0 -1
  396. package/build/esm/util/reservedKeywords.d.ts +0 -2
  397. package/build/esm/util/reservedKeywords.d.ts.map +0 -1
  398. package/build/esm/util/stringUnionFrom.d.ts +0 -2
  399. package/build/esm/util/stringUnionFrom.d.ts.map +0 -1
  400. package/build/esm/util/stringify.d.ts +0 -20
  401. package/build/esm/util/stringify.d.ts.map +0 -1
  402. package/build/esm/util/test/TodoWireOntology.d.ts +0 -3
  403. package/build/esm/util/test/TodoWireOntology.d.ts.map +0 -1
  404. package/build/esm/util/test/compileThis.d.ts +0 -3
  405. package/build/esm/util/test/compileThis.d.ts.map +0 -1
  406. package/build/esm/util/test/createMockMinimalFiles.d.ts +0 -13
  407. package/build/esm/util/test/createMockMinimalFiles.d.ts.map +0 -1
  408. package/build/esm/util/test/formatTs.d.ts +0 -2
  409. package/build/esm/util/test/formatTs.d.ts.map +0 -1
  410. package/build/esm/util/verifyOutDir.d.ts +0 -9
  411. package/build/esm/util/verifyOutDir.d.ts.map +0 -1
  412. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
  413. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
  414. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
  415. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
  416. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
  417. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
  418. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
  419. package/build/esm/v2.0/generateMetadata.d.ts +0 -3
  420. package/build/esm/v2.0/generateMetadata.d.ts.map +0 -1
  421. package/build/esm/v2.0/generatePerActionDataFiles.d.ts +0 -3
  422. package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
  423. package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
  424. package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
  425. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
  426. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
  427. package/build/esm/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
  428. package/build/esm/v2.0/generatePerQueryDataFiles.d.ts +0 -9
  429. package/build/esm/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
  430. package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
  431. package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
  432. package/build/esm/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
  433. package/build/esm/v2.0/getDescriptionIfPresent.d.ts +0 -2
  434. package/build/esm/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
  435. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +0 -12
  436. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
  437. package/build/esm/validateWireOntologyAssumptions.d.ts +0 -3
  438. package/build/esm/validateWireOntologyAssumptions.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getDescriptionIfPresent.js","names":["getDescriptionIfPresent","description","includeNewline"],"sources":["getDescriptionIfPresent.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 getDescriptionIfPresent(description, includeNewline) {\n if (description) {\n return `/**\n * ${description}\n */${includeNewline ? \"\\n\" : \"\"}`;\n }\n return \"\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,uBAAuBA,CAACC,WAAW,EAAEC,cAAc,EAAE;EACjE,IAAID,WAAW,EAAE;IACb,OAAO;AACf,KAAKA,WAAW;AAChB,KAAKC,cAAc,GAAG,IAAI,GAAG,EAAE,EAAE;EAC7B;EACA,OAAO,EAAE;AACb","ignoreList":[]}
1
+ {"version":3,"file":"getDescriptionIfPresent.js","names":["getDescriptionIfPresent","description","includeNewline"],"sources":["getDescriptionIfPresent.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 getDescriptionIfPresent(\n description?: string,\n includeNewline?: boolean,\n): string {\n if (description) {\n return `/**\n * ${description}\n */${includeNewline ? \"\\n\" : \"\"}`;\n }\n return \"\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,uBAAuBA,CACrCC,WAAoB,EACpBC,cAAwB,EAChB;EACR,IAAID,WAAW,EAAE;IACf,OAAO;AACX,KAAKA,WAAW;AAChB,KAAKC,cAAc,GAAG,IAAI,GAAG,EAAE,EAAE;EAC/B;EACA,OAAO,EAAE;AACX","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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from "@osdk/generator-converters";
17
18
  import { EnhancedObjectType } from "../GenerateContext/EnhancedObjectType.js";
18
19
  import { ForeignType } from "../GenerateContext/ForeignType.js";
@@ -20,6 +21,7 @@ import { getObjectImports } from "../shared/getObjectImports.js";
20
21
  import { propertyJsdoc } from "../shared/propertyJsdoc.js";
21
22
  import { deleteUndefineds } from "../util/deleteUndefineds.js";
22
23
  import { stringify } from "../util/stringify.js";
24
+
23
25
  /** @internal */
24
26
  export function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {
25
27
  ontology,
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.js","names":["wireObjectTypeFullMetadataToSdkObjectMetadata","EnhancedObjectType","ForeignType","getObjectImports","propertyJsdoc","deleteUndefineds","stringify","wireObjectTypeV2ToSdkObjectConstV2","wireObject","ontology","forInternalUse","currentFilePath","object","requireObjectType","objectType","apiName","Error","uniqueLinkTargetTypes","Set","linkTypes","map","a","objectTypeApiName","definition","raw","objectDefIdentifier","getDefinitionIdentifier","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","identifiers","imports","createPropertyKeys","createLinks","createProps","createObjectSet","createOsdkObject","createDefinition","fullApiName","identifier","getCleanedUpDefinition","maybeStripNamespace","type","q","apiNamespace","startsWith","slice","length","strict","properties","*","propertyDefinition","_","remapStructType","JSON","multiplicity","nullable","primaryKeyApiName","links","targetType","getImportedDefinitionIdentifier","Object","keys","key","linkTarget","join","structType","output","entries","value"],"sources":["wireObjectTypeV2ToSdkObjectConstV2.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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { propertyJsdoc } from \"../shared/propertyJsdoc.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(wireObject, { ontology, forInternalUse }, currentFilePath) {\n const object = ontology.requireObjectType(wireObject.objectType.apiName, true);\n if (object instanceof ForeignType) {\n throw new Error(\"Should not be generating types for an external type\");\n }\n const uniqueLinkTargetTypes = new Set(wireObject.linkTypes.map(a => ontology.requireObjectType(a.objectTypeApiName, false)));\n const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(object.raw, true));\n const objectDefIdentifier = object.getDefinitionIdentifier(true);\n const objectSetIdentifier = `${object.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${object.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${object.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${object.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `${object.shortApiName}.Links`;\n const osdkObjectIdentifier = `${object.shortApiName}.OsdkObject`;\n const identifiers = {\n objectDefIdentifier: `${object.shortApiName}`,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n function getV2Types(object, forInternalUse = false) {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type {\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n OsdkObject as $OsdkObject,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n\n\n export namespace ${object.shortApiName} {\n\n ${createPropertyKeys(object)}\n\n\n ${createLinks(ontology, object, \"Links\")}\n\n ${createProps(object, \"Props\", false)}\n ${createProps(object, \"StrictProps\", true)}\n\n ${createObjectSet(object, identifiers)}\n \n ${createOsdkObject(object, \"OsdkInstance\", identifiers)}\n } \n\n\n\n ${createDefinition(object, ontology, object.shortApiName, identifiers)}\n `;\n }\n const imports = getObjectImports(uniqueLinkTargetTypes, definition.apiName, currentFilePath, true);\n return `${imports}${getV2Types(object, forInternalUse)}\n\n export const ${object.shortApiName}: ${objectDefIdentifier}\n = {\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\",\n apiName: \"${object.fullApiName}\",\n osdkMetadata: $osdkMetadata, \n };`;\n}\nexport function createOsdkObject(object, identifier, { osdkObjectPropsIdentifier, objectDefIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > \n = $Osdk.Instance<\n ${objectDefIdentifier}, \n OPTIONS,\n K\n >;\n \n\n /** @deprecated use ${identifier} */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > = ${identifier}<OPTIONS, K>;\n ;\n `;\n}\nexport function createObjectSet(object, { objectDefIdentifier, objectSetIdentifier, propertyKeysIdentifier, osdkObjectIdentifier, }) {\n return `\nexport interface ObjectSet extends \n$ObjectSet<${objectDefIdentifier},\n\n${objectSetIdentifier}\n>\n{\n\n}\n`;\n}\nfunction maybeStripNamespace(type, q) {\n if (type.apiNamespace && q.startsWith(`${type.apiNamespace}.`)) {\n return q.slice(type.apiNamespace.length + 1);\n }\n else {\n return q;\n }\n}\nexport function createProps(type, identifier, strict) {\n if (identifier === \"StrictProps\") {\n return `export type StrictProps = Props`;\n }\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [\n `readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`,\n (typeof propertyDefinition.type === \"object\"\n ? `${remapStructType(propertyDefinition.type)}`\n : `$PropType[${JSON.stringify(propertyDefinition.type)}]`)\n + `${propertyDefinition.multiplicity ? \"[]\" : \"\"}${propertyDefinition.nullable\n || (!strict\n && !(definition.type === \"object\"\n && definition.primaryKeyApiName === apiName))\n ? `| undefined`\n : \"\"}`,\n ];\n },\n })}\n }`;\n}\nexport function createDefinition(object, ontology, identifier, { objectDefIdentifier, objectSetIdentifier, osdkObjectPropsIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${object instanceof EnhancedObjectType\n ? `$ObjectTypeDefinition`\n : `$InterfaceDefinition`} {\n osdkMetadata: typeof $osdkMetadata;\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\";\n apiName: \"${object.fullApiName}\";\n __DefinitionMetadata?: {\n objectSet: ${objectSetIdentifier};\n props: ${osdkObjectPropsIdentifier};\n linksType: ${osdkObjectLinksIdentifier};\n strictProps: ${osdkObjectStrictPropsIdentifier};\n ${stringify(definition, {\n links: (_value) => `{\n ${stringify(definition.links, {\n \"*\": (definition) => `$ObjectMetadata.Link<${ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(true)}, ${definition.multiplicity}>`,\n })}\n }`,\n properties: (_value) => (`{\n ${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => [\n `${propertyJsdoc(propertyDefinition, { apiName })}\"${maybeStripNamespace(object, apiName)}\"`,\n `$PropertyDef<${JSON.stringify(propertyDefinition.type)}, \"${propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"}\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`,\n ],\n })}\n }`),\n })}\n } \n}\n `;\n}\nexport function createLinks(ontology, object, identifier) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n ${Object.keys(definition.links).length === 0\n ? `export type ${identifier} = {};`\n : `\n export interface ${identifier} {\n${stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(true);\n return [\n `readonly ${key}`,\n `${definition.multiplicity\n ? `${linkTarget}.ObjectSet`\n : `$SingleLinkAccessor<${linkTarget}>`}\n `,\n ];\n },\n })}\n }\n `}`;\n}\nexport function createPropertyKeys(type) {\n const properties = Object.keys(type.getCleanedUpDefinition(true).properties);\n return `export type PropertyKeys = ${properties.length === 0\n ? \"never\"\n : properties.map((a) => maybeStripNamespace(type, a)).map(a => `\"${a}\"`).join(\"|\")};`;\n}\nfunction remapStructType(structType) {\n let output = `{`;\n Object.entries(structType).map(([key, value]) => output += `${key}:$PropType[${JSON.stringify(value)}]|undefined;`);\n output += \"}\";\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,6CAA6C,QAAQ,4BAA4B;AAC1F,SAASC,kBAAkB,QAAQ,0CAA0C;AAC7E,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAChD;AACA,OAAO,SAASC,kCAAkCA,CAACC,UAAU,EAAE;EAAEC,QAAQ;EAAEC;AAAe,CAAC,EAAEC,eAAe,EAAE;EAC1G,MAAMC,MAAM,GAAGH,QAAQ,CAACI,iBAAiB,CAACL,UAAU,CAACM,UAAU,CAACC,OAAO,EA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AAM,CAACC,IAAI,CAACpB,IAAI,CAACF,sBAAsB,CAAC,IAAI,CAAC,CAACS,UAAU,CAAC;EAC5E,OAAO,8BAA8BA,UAAU,CAACF,MAAM,KAAK,CAAC,GACtD,OAAO,GACPE,UAAU,CAACjC,GAAG,CAAEC,CAAC,IAAKwB,mBAAmB,CAACC,IAAI,EAAEzB,CAAC,CAAC,CAAC,CAACD,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAACgD,IAAI,CAAC,GAAG,CAAC,GAAG;AAC7F;AACA,SAASZ,eAAeA,CAACa,UAAU,EAAE;EACjC,IAAIC,MAAM,GAAG,GAAG;EAChBN,MAAM,CAACO,OAAO,CAACF,UAAU,CAAC,CAAClD,GAAG,CAAC,CAAC,CAAC+C,GAAG,EAAEM,KAAK,CAAC,KAAKF,MAAM,IAAI,GAAGJ,GAAG,cAAcT,IAAI,CAACpD,SAAS,CAACmE,KAAK,CAAC,cAAc,CAAC;EACnHF,MAAM,IAAI,GAAG;EACb,OAAOA,MAAM;AACjB","ignoreList":[]}
1
+ {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.js","names":["wireObjectTypeFullMetadataToSdkObjectMetadata","EnhancedObjectType","ForeignType","getObjectImports","propertyJsdoc","deleteUndefineds","stringify","wireObjectTypeV2ToSdkObjectConstV2","wireObject","ontology","forInternalUse","currentFilePath","object","requireObjectType","objectType","apiName","Error","uniqueLinkTargetTypes","Set","linkTypes","map","a","objectTypeApiName","definition","raw","objectDefIdentifier","getDefinitionIdentifier","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","identifiers","imports","createPropertyKeys","createLinks","createProps","createObjectSet","createOsdkObject","createDefinition","fullApiName","identifier","getCleanedUpDefinition","maybeStripNamespace","type","q","apiNamespace","startsWith","slice","length","strict","properties","*","propertyDefinition","_","remapStructType","JSON","multiplicity","nullable","primaryKeyApiName","links","targetType","getImportedDefinitionIdentifier","Object","keys","key","linkTarget","join","structType","output","entries","value"],"sources":["wireObjectTypeV2ToSdkObjectConstV2.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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport type { ObjectTypeFullMetadata } from \"@osdk/internal.foundry.core\";\nimport type { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport type { EnhancedOntologyDefinition } from \"../GenerateContext/EnhancedOntologyDefinition.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { propertyJsdoc } from \"../shared/propertyJsdoc.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\n\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(\n wireObject: ObjectTypeFullMetadata,\n { ontology, forInternalUse }: Pick<\n GenerateContext,\n \"ontology\" | \"forInternalUse\"\n >,\n currentFilePath: string,\n) {\n const object = ontology.requireObjectType(\n wireObject.objectType.apiName,\n true,\n );\n if (object instanceof ForeignType) {\n throw new Error(\"Should not be generating types for an external type\");\n }\n const uniqueLinkTargetTypes = new Set(\n wireObject.linkTypes.map(a =>\n ontology.requireObjectType(a.objectTypeApiName, false)\n ),\n );\n\n const definition = deleteUndefineds(\n wireObjectTypeFullMetadataToSdkObjectMetadata(\n object.raw,\n true,\n ),\n );\n\n const objectDefIdentifier = object.getDefinitionIdentifier(true);\n\n const objectSetIdentifier = `${object.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${object.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${object.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${object.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `${object.shortApiName}.Links`;\n const osdkObjectIdentifier = `${object.shortApiName}.OsdkObject`;\n\n const identifiers: Identifiers = {\n objectDefIdentifier: `${object.shortApiName}`,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n\n function getV2Types(\n object: EnhancedObjectType,\n forInternalUse: boolean = false,\n ) {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type {\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n OsdkObject as $OsdkObject,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n\n\n export namespace ${object.shortApiName} {\n\n ${createPropertyKeys(object)}\n\n\n ${createLinks(ontology, object, \"Links\")}\n\n ${createProps(object, \"Props\", false)}\n ${createProps(object, \"StrictProps\", true)}\n\n ${createObjectSet(object, identifiers)}\n \n ${createOsdkObject(object, \"OsdkInstance\", identifiers)}\n } \n\n\n\n ${createDefinition(object, ontology, object.shortApiName, identifiers)}\n `;\n }\n\n const imports = getObjectImports(\n uniqueLinkTargetTypes,\n definition.apiName,\n currentFilePath,\n true,\n );\n\n return `${imports}${getV2Types(object, forInternalUse)}\n\n export const ${object.shortApiName}: ${objectDefIdentifier}\n = {\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\",\n apiName: \"${object.fullApiName}\",\n osdkMetadata: $osdkMetadata, \n };`;\n}\n\nexport interface Identifiers extends\n Record<\n | \"osdkObjectIdentifier\"\n | \"propertyKeysIdentifier\"\n | \"osdkObjectPropsIdentifier\"\n | \"objectDefIdentifier\"\n | \"osdkObjectLinksIdentifier\"\n | \"osdkObjectStrictPropsIdentifier\"\n | \"objectSetIdentifier\",\n string\n >\n{}\n\nexport function createOsdkObject(\n object: EnhancedObjectType | EnhancedInterfaceType,\n identifier: string,\n {\n osdkObjectPropsIdentifier,\n objectDefIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier,\n }: Identifiers,\n) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > \n = $Osdk.Instance<\n ${objectDefIdentifier}, \n OPTIONS,\n K\n >;\n \n\n /** @deprecated use ${identifier} */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > = ${identifier}<OPTIONS, K>;\n ;\n `;\n}\n\nexport function createObjectSet(\n object: EnhancedObjectType | EnhancedInterfaceType,\n {\n objectDefIdentifier,\n objectSetIdentifier,\n propertyKeysIdentifier,\n osdkObjectIdentifier,\n }: Identifiers,\n) {\n return `\nexport interface ObjectSet extends \n$ObjectSet<${objectDefIdentifier},\n\n${objectSetIdentifier}\n>\n{\n\n}\n`;\n}\n\nfunction maybeStripNamespace(\n type: EnhancedInterfaceType | EnhancedObjectType,\n q: string,\n) {\n if (\n type.apiNamespace && q.startsWith(`${type.apiNamespace}.`)\n ) {\n return q.slice(type.apiNamespace.length + 1);\n } else {\n return q;\n }\n}\n\nexport function createProps(\n type: EnhancedInterfaceType | EnhancedObjectType,\n identifier: string,\n strict: boolean,\n): string {\n if (identifier === \"StrictProps\") {\n return `export type StrictProps = Props`;\n }\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${\n stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [\n `readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`,\n (typeof propertyDefinition.type === \"object\"\n ? `${remapStructType(propertyDefinition.type)}`\n : `$PropType[${JSON.stringify(propertyDefinition.type)}]`)\n + `${propertyDefinition.multiplicity ? \"[]\" : \"\"}${\n propertyDefinition.nullable\n || (!strict\n && !(definition.type === \"object\"\n && definition.primaryKeyApiName === apiName))\n ? `| undefined`\n : \"\"\n }`,\n ] as [string, string];\n },\n })\n }\n }`;\n}\n\nexport function createDefinition(\n object: EnhancedObjectType | EnhancedInterfaceType,\n ontology: EnhancedOntologyDefinition,\n identifier: string,\n {\n objectDefIdentifier,\n objectSetIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier,\n }: Identifiers,\n) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${\n object instanceof EnhancedObjectType\n ? `$ObjectTypeDefinition`\n : `$InterfaceDefinition`\n } {\n osdkMetadata: typeof $osdkMetadata;\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\";\n apiName: \"${object.fullApiName}\";\n __DefinitionMetadata?: {\n objectSet: ${objectSetIdentifier};\n props: ${osdkObjectPropsIdentifier};\n linksType: ${osdkObjectLinksIdentifier};\n strictProps: ${osdkObjectStrictPropsIdentifier};\n ${\n stringify(definition, {\n links: (_value) =>\n `{\n ${\n stringify(definition.links, {\n \"*\": (definition) =>\n `$ObjectMetadata.Link<${\n ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(true)\n }, ${definition.multiplicity}>`,\n })\n }\n }`,\n properties: (_value) => (`{\n ${\n stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) =>\n [\n `${propertyJsdoc(propertyDefinition, { apiName })}\"${\n maybeStripNamespace(object, apiName)\n }\"`,\n `$PropertyDef<${JSON.stringify(propertyDefinition.type)}, \"${\n propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"\n }\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`,\n ] as [string, string],\n })\n }\n }`),\n })\n }\n } \n}\n `;\n}\n\nexport function createLinks(\n ontology: EnhancedOntologyDefinition,\n object: EnhancedObjectType | EnhancedInterfaceType,\n identifier: string,\n) {\n const definition = object.getCleanedUpDefinition(true);\n\n return `\n ${\n Object.keys(definition.links).length === 0\n ? `export type ${identifier} = {};`\n : `\n export interface ${identifier} {\n${\n stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(\n definition.targetType,\n )\n .getImportedDefinitionIdentifier(true);\n\n return [\n `readonly ${key}`,\n `${\n definition.multiplicity\n ? `${linkTarget}.ObjectSet`\n : `$SingleLinkAccessor<${linkTarget}>`\n }\n `,\n ];\n },\n })\n }\n }\n `\n }`;\n}\n\nexport function createPropertyKeys(\n type: EnhancedObjectType | EnhancedInterfaceType,\n) {\n const properties = Object.keys(type.getCleanedUpDefinition(true).properties);\n return `export type PropertyKeys = ${\n properties.length === 0\n ? \"never\"\n : properties.map(\n (a) => maybeStripNamespace(type, a),\n ).map(a => `\"${a}\"`).join(\"|\")\n };`;\n}\n\nfunction remapStructType(structType: Record<string, any>): string {\n let output = `{`;\n Object.entries(structType).map(([key, value]) =>\n output += `${key}:$PropType[${JSON.stringify(value)}]|undefined;`\n );\n output += \"}\";\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,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UAAU,EAAEiC,CAAC,EAAEW,GAAG,KAAK;MAC3B,MAAMC,UAAU,GAAG3D,QAAQ,CAACI,iBAAiB,CAC3CU,UAAU,CAACwC,UACb,CAAC,CACEC,+BAA+B,CAAC,IAAI,CAAC;MAExC,OAAO,CACL,YAAYG,GAAG,EAAE,EACjB,GACE5C,UAAU,CAACoC,YAAY,GACnB,GAAGS,UAAU,YAAY,GACzB,uBAAuBA,UAAU,GAAG;AACxD,WACW,CACE;IACH;EACF,CAAC,CAAC;AACV;AACA,KACK,EACD;AACJ;AAEA,OAAO,SAAShC,kBAAkBA,CAChCU,IAAgD,EAChD;EACA,MAAMO,UAAU,GAAGY,MAAM,CAACC,IAAI,CAACpB,IAAI,CAACF,sBAAsB,CAAC,IAAI,CAAC,CAACS,UAAU,CAAC;EAC5E,OAAO,8BACLA,UAAU,CAACF,MAAM,KAAK,CAAC,GACnB,OAAO,GACPE,UAAU,CAACjC,GAAG,CACbC,CAAC,IAAKwB,mBAAmB,CAACC,IAAI,EAAEzB,CAAC,CACpC,CAAC,CAACD,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAACgD,IAAI,CAAC,GAAG,CAAC,GAC/B;AACL;AAEA,SAASZ,eAAeA,CAACa,UAA+B,EAAU;EAChE,IAAIC,MAAM,GAAG,GAAG;EAChBN,MAAM,CAACO,OAAO,CAACF,UAAU,CAAC,CAAClD,GAAG,CAAC,CAAC,CAAC+C,GAAG,EAAEM,KAAK,CAAC,KAC1CF,MAAM,IAAI,GAAGJ,GAAG,cAAcT,IAAI,CAACpD,SAAS,CAACmE,KAAK,CAAC,cACrD,CAAC;EACDF,MAAM,IAAI,GAAG;EACb,OAAOA,MAAM;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
  import invariant from "tiny-invariant";
17
18
  export function validateWireOntologyAssumptions(ontology) {
18
19
  invariantNotStartWithDollarSign(ontology.ontology.apiName);
@@ -1 +1 @@
1
- {"version":3,"file":"validateWireOntologyAssumptions.js","names":["invariant","validateWireOntologyAssumptions","ontology","invariantNotStartWithDollarSign","apiName","objectKey","objectType","Object","entries","objectTypes","invariantMapKeyMatchesApiName","propertyKey","propertyType","properties","key","value","process","env","NODE_ENV","startsWith"],"sources":["validateWireOntologyAssumptions.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 invariant from \"tiny-invariant\";\nexport function validateWireOntologyAssumptions(ontology) {\n invariantNotStartWithDollarSign(ontology.ontology.apiName);\n for (const [objectKey, objectType] of Object.entries(ontology.objectTypes)) {\n invariantMapKeyMatchesApiName(objectKey, objectType.objectType);\n invariantNotStartWithDollarSign(objectType.objectType.apiName);\n for (const [propertyKey, propertyType] of Object.entries(objectType.objectType.properties)) {\n invariantNotStartWithDollarSign(propertyKey);\n }\n }\n}\nfunction invariantMapKeyMatchesApiName(key, value) {\n invariant(key === value.apiName, \"Key in the map should be the same as the apiName.\");\n}\nfunction invariantNotStartWithDollarSign(value) {\n invariant(!value.startsWith(\"$\"), \"apiName should not start with $\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,OAAO,SAASC,+BAA+BA,CAACC,QAAQ,EAAE;EACtDC,+BAA+B,CAACD,QAAQ,CAACA,QAAQ,CAACE,OAAO,CAAC;EAC1D,KAAK,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,QAAQ,CAACO,WAAW,CAAC,EAAE;IACxEC,6BAA6B,CAACL,SAAS,EAAEC,UAAU,CAACA,UAAU,CAAC;IAC/DH,+BAA+B,CAACG,UAAU,CAACA,UAAU,CAACF,OAAO,CAAC;IAC9D,KAAK,MAAM,CAACO,WAAW,EAAEC,YAAY,CAAC,IAAIL,MAAM,CAACC,OAAO,CAACF,UAAU,CAACA,UAAU,CAACO,UAAU,CAAC,EAAE;MACxFV,+BAA+B,CAACQ,WAAW,CAAC;IAChD;EACJ;AACJ;AACA,SAASD,6BAA6BA,CAACI,GAAG,EAAEC,KAAK,EAAE;EAC/C,EAAUD,GAAG,KAAKC,KAAK,CAACX,OAAO,IAAAY,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA/BlB,SAAS,QAAwB,mDAAmD,IAApFA,SAAS;AACb;AACA,SAASG,+BAA+BA,CAACY,KAAK,EAAE;EAC5C,CAAU,CAACA,KAAK,CAACI,UAAU,CAAC,GAAG,CAAC,GAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAhClB,SAAS,QAAyB,iCAAiC,IAAnEA,SAAS;AACb","ignoreList":[]}
1
+ {"version":3,"file":"validateWireOntologyAssumptions.js","names":["invariant","validateWireOntologyAssumptions","ontology","invariantNotStartWithDollarSign","apiName","objectKey","objectType","Object","entries","objectTypes","invariantMapKeyMatchesApiName","propertyKey","propertyType","properties","key","value","process","env","NODE_ENV","startsWith"],"sources":["validateWireOntologyAssumptions.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 invariant from \"tiny-invariant\";\nimport type { WireOntologyDefinition } from \"./WireOntologyDefinition.js\";\n\nexport function validateWireOntologyAssumptions(\n ontology: WireOntologyDefinition,\n): void {\n invariantNotStartWithDollarSign(ontology.ontology.apiName);\n\n for (const [objectKey, objectType] of Object.entries(ontology.objectTypes)) {\n invariantMapKeyMatchesApiName(objectKey, objectType.objectType);\n invariantNotStartWithDollarSign(objectType.objectType.apiName);\n\n for (\n const [propertyKey, propertyType] of Object.entries(\n objectType.objectType.properties,\n )\n ) {\n invariantNotStartWithDollarSign(propertyKey);\n }\n }\n}\n\nfunction invariantMapKeyMatchesApiName(\n key: string,\n value: { apiName: string },\n) {\n invariant(\n key === value.apiName,\n \"Key in the map should be the same as the apiName.\",\n );\n}\nfunction invariantNotStartWithDollarSign(value: string) {\n invariant(\n !value.startsWith(\"$\"),\n \"apiName should not start with $\",\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC,OAAO,SAASC,+BAA+BA,CAC7CC,QAAgC,EAC1B;EACNC,+BAA+B,CAACD,QAAQ,CAACA,QAAQ,CAACE,OAAO,CAAC;EAE1D,KAAK,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,QAAQ,CAACO,WAAW,CAAC,EAAE;IAC1EC,6BAA6B,CAACL,SAAS,EAAEC,UAAU,CAACA,UAAU,CAAC;IAC/DH,+BAA+B,CAACG,UAAU,CAACA,UAAU,CAACF,OAAO,CAAC;IAE9D,KACE,MAAM,CAACO,WAAW,EAAEC,YAAY,CAAC,IAAIL,MAAM,CAACC,OAAO,CACjDF,UAAU,CAACA,UAAU,CAACO,UACxB,CAAC,EACD;MACAV,+BAA+B,CAACQ,WAAW,CAAC;IAC9C;EACF;AACF;AAEA,SAASD,6BAA6BA,CACpCI,GAAW,EACXC,KAA0B,EAC1B;EACA,EACED,GAAG,KAAKC,KAAK,CAACX,OAAO,IAAAY,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADvBlB,SAAS,QAEP,mDAAmD,IAFrDA,SAAS;AAIX;AACA,SAASG,+BAA+BA,CAACY,KAAa,EAAE;EACtD,CACE,CAACA,KAAK,CAACI,UAAU,CAAC,GAAG,CAAC,GAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADxBlB,SAAS,QAEP,iCAAiC,IAFnCA,SAAS;AAIX","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ import type { EnhancedOntologyDefinition } from "./EnhancedOntologyDefinition.js";
2
+ export interface EnhanceCommon {
3
+ importExt: string;
4
+ /** DO NOT USE THIS IN THE CONSTRUCTOR(S) */
5
+ enhancedOntology: EnhancedOntologyDefinition;
6
+ }
@@ -0,0 +1,13 @@
1
+ import type { ActionTypeV2, LogicRule } from "@osdk/internal.foundry.core";
2
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
3
+ import { EnhancedBase } from "./EnhancedBase.js";
4
+ export declare class EnhancedAction extends EnhancedBase<ActionTypeV2> {
5
+ raw: ActionTypeV2;
6
+ constructor(common: EnhanceCommon, raw: ActionTypeV2);
7
+ get description(): string | undefined;
8
+ get parameters(): ActionTypeV2["parameters"];
9
+ get operations(): LogicRule[];
10
+ get paramsIdentifier(): string;
11
+ get definitionIdentifier(): string;
12
+ get definitionParamsIdentifier(): string;
13
+ }
@@ -0,0 +1,20 @@
1
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
2
+ export declare abstract class AbstractImportable {
3
+ protected _common: EnhanceCommon;
4
+ shortApiName: string;
5
+ fullApiName: string;
6
+ apiNamespace: string | undefined;
7
+ /**
8
+ * Either a path relative to the ourDir (e.g. "./ontology/objects/foo.js") or a normal
9
+ * module import (e.g. "@something/foo")/
10
+ */
11
+ importPath: string;
12
+ uniqueImportName: string;
13
+ constructor(common: EnhanceCommon, fullApiName: string, basePath: string, isLocal?: boolean);
14
+ getImportPathRelTo: (filePath: string) => string;
15
+ }
16
+ export declare abstract class EnhancedBase<T> extends AbstractImportable {
17
+ raw: T;
18
+ constructor(common: EnhanceCommon, raw: T, fullApiName: string, basePath: string);
19
+ }
20
+ export declare function extractNamespace(fqApiName: string): [string | undefined, string];
@@ -0,0 +1,12 @@
1
+ import type { InterfaceMetadata } from "@osdk/api";
2
+ import type { InterfaceType } from "@osdk/internal.foundry.core";
3
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
4
+ import { EnhancedBase } from "./EnhancedBase.js";
5
+ export declare class EnhancedInterfaceType extends EnhancedBase<InterfaceType> {
6
+ raw: InterfaceType;
7
+ constructor(common: EnhanceCommon, raw: InterfaceType);
8
+ getDefinitionIdentifier(v2: boolean): string;
9
+ getImportedDefinitionIdentifier(v2: boolean): string;
10
+ get properties(): InterfaceType["properties"];
11
+ getCleanedUpDefinition(v2: boolean): InterfaceMetadata;
12
+ }
@@ -3,10 +3,9 @@ import type { ObjectTypeFullMetadata } from "@osdk/internal.foundry.core";
3
3
  import type { EnhanceCommon } from "./EnhanceCommon.js";
4
4
  import { EnhancedBase } from "./EnhancedBase.js";
5
5
  export declare class EnhancedObjectType extends EnhancedBase<ObjectTypeFullMetadata> {
6
- raw: ObjectTypeFullMetadata;
7
- constructor(common: EnhanceCommon, raw: ObjectTypeFullMetadata);
8
- getDefinitionIdentifier(v2: boolean): string;
9
- getImportedDefinitionIdentifier(v2: boolean): string;
10
- getCleanedUpDefinition(v2: boolean): ObjectMetadata;
6
+ raw: ObjectTypeFullMetadata;
7
+ constructor(common: EnhanceCommon, raw: ObjectTypeFullMetadata);
8
+ getDefinitionIdentifier(v2: boolean): string;
9
+ getImportedDefinitionIdentifier(v2: boolean): string;
10
+ getCleanedUpDefinition(v2: boolean): ObjectMetadata;
11
11
  }
12
- //# sourceMappingURL=EnhancedObjectType.d.ts.map
@@ -0,0 +1,28 @@
1
+ import type { OntologyV2 } from "@osdk/internal.foundry.core";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition.js";
3
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
4
+ import { EnhancedAction } from "./EnhancedAction.js";
5
+ import { EnhancedInterfaceType } from "./EnhancedInterfaceType.js";
6
+ import { EnhancedObjectType } from "./EnhancedObjectType.js";
7
+ import { EnhancedQuery } from "./EnhancedQuery.js";
8
+ import { EnhancedSharedPropertyType } from "./EnhancedSharedPropertyType.js";
9
+ import { ForeignType } from "./ForeignType.js";
10
+ type RequiredType<K extends "objectTypes" | "actionTypes" | "interfaceTypes" | "queryTypes" | "sharedPropertyTypes"> = <L extends boolean = false>(fullApiName: string, localOnly?: L) => L extends true ? EnhancedOntologyDefinition[K][string] : ForeignType;
11
+ export declare class EnhancedOntologyDefinition {
12
+ #private;
13
+ ontology: OntologyV2;
14
+ objectTypes: Record<string, EnhancedObjectType | ForeignType>;
15
+ actionTypes: Record<string, EnhancedAction>;
16
+ queryTypes: Record<string, EnhancedQuery>;
17
+ interfaceTypes: Record<string, EnhancedInterfaceType | ForeignType>;
18
+ sharedPropertyTypes: Record<string, EnhancedSharedPropertyType | ForeignType>;
19
+ raw: WireOntologyDefinition;
20
+ common: EnhanceCommon;
21
+ constructor(raw: WireOntologyDefinition, importExt: string, externalObjects?: Map<string, string>, externalInterfaces?: Map<string, string>, externalSpts?: Map<string, string>);
22
+ requireObjectType: RequiredType<"objectTypes">;
23
+ requireInterfaceType: RequiredType<"interfaceTypes">;
24
+ requireActionType: RequiredType<"actionTypes">;
25
+ requireQueryType: RequiredType<"queryTypes">;
26
+ requireSharedPropertyType: RequiredType<"sharedPropertyTypes">;
27
+ }
28
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { QueryDataType, QueryTypeV2 } from "@osdk/internal.foundry.core";
2
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
3
+ import { EnhancedBase } from "./EnhancedBase.js";
4
+ export declare class EnhancedQuery extends EnhancedBase<QueryTypeV2> {
5
+ raw: QueryTypeV2;
6
+ constructor(common: EnhanceCommon, raw: QueryTypeV2);
7
+ get description(): string | undefined;
8
+ get parameters(): QueryTypeV2["parameters"];
9
+ get output(): QueryDataType;
10
+ get paramsIdentifier(): string;
11
+ get definitionIdentifier(): string;
12
+ get definitionParamsIdentifier(): string;
13
+ }
@@ -2,7 +2,6 @@ import type { SharedPropertyType } from "@osdk/internal.foundry.core";
2
2
  import type { EnhanceCommon } from "./EnhanceCommon.js";
3
3
  import { EnhancedBase } from "./EnhancedBase.js";
4
4
  export declare class EnhancedSharedPropertyType extends EnhancedBase<SharedPropertyType> {
5
- raw: SharedPropertyType;
6
- constructor(common: EnhanceCommon, raw: SharedPropertyType);
5
+ raw: SharedPropertyType;
6
+ constructor(common: EnhanceCommon, raw: SharedPropertyType);
7
7
  }
8
- //# sourceMappingURL=EnhancedSharedPropertyType.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { EnhanceCommon } from "./EnhanceCommon.js";
2
+ import { AbstractImportable } from "./EnhancedBase.js";
3
+ export declare class ForeignType extends AbstractImportable {
4
+ _common: EnhanceCommon;
5
+ constructor(_common: EnhanceCommon, apiNamespace: string | undefined, shortApiName: string, destinationPackage: string);
6
+ getImportedDefinitionIdentifier(v2: boolean): string;
7
+ getDefinitionIdentifier(v2: boolean): string;
8
+ }
@@ -0,0 +1,13 @@
1
+ import type { MinimalFs } from "../MinimalFs.js";
2
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition.js";
3
+ import type { EnhancedOntologyDefinition } from "./EnhancedOntologyDefinition.js";
4
+ export interface GenerateContext {
5
+ sanitizedOntology: WireOntologyDefinition;
6
+ ontology: EnhancedOntologyDefinition;
7
+ importExt?: string;
8
+ fs: MinimalFs;
9
+ outDir: string;
10
+ ontologyApiNamespace?: string | undefined;
11
+ apiNamespacePackageMap?: Map<string, string>;
12
+ forInternalUse?: boolean;
13
+ }
@@ -0,0 +1,9 @@
1
+ import type { WireOntologyDefinition } from "../WireOntologyDefinition.js";
2
+ import { EnhancedOntologyDefinition } from "./EnhancedOntologyDefinition.js";
3
+ export declare function enhanceOntology({ sanitized, importExt, externalObjects, externalInterfaces, externalSpts }: {
4
+ sanitized: WireOntologyDefinition;
5
+ externalObjects?: Map<string, string>;
6
+ externalInterfaces?: Map<string, string>;
7
+ externalSpts?: Map<string, string>;
8
+ importExt: string;
9
+ }): EnhancedOntologyDefinition;
@@ -0,0 +1,7 @@
1
+ export interface MinimalFs {
2
+ mkdir: (path: string, options?: { recursive: boolean }) => Promise<void>;
3
+ writeFile: WriteFileFn;
4
+ readdir: ReaddirFn;
5
+ }
6
+ export type WriteFileFn = (path: string, contents: string) => Promise<void>;
7
+ export type ReaddirFn = (path: string) => Promise<string[]>;
@@ -1,4 +1,2 @@
1
1
  import type * as gateway from "@osdk/internal.foundry.core";
2
- export interface WireOntologyDefinition extends gateway.OntologyFullMetadata {
3
- }
4
- //# sourceMappingURL=WireOntologyDefinition.d.ts.map
2
+ export interface WireOntologyDefinition extends gateway.OntologyFullMetadata {}
@@ -2,33 +2,30 @@ import type { MinimalFs } from "./MinimalFs.js";
2
2
  import type { WireOntologyDefinition } from "./WireOntologyDefinition.js";
3
3
  export declare function generateClientSdkPackage(packageName: string, packageVersion: string, sdkVersion: "1.1" | "2.0", baseOutDir: string, ontology: WireOntologyDefinition, minimalFs: MinimalFs, dependencyVersions: DependencyVersions, cliVersion: string, externalObjects?: Map<string, string>, externalInterfaces?: Map<string, string>): Promise<void>;
4
4
  export interface DependencyVersions {
5
- typescriptVersion: string;
6
- tslibVersion: string;
7
- areTheTypesWrongVersion: string;
8
- osdkApiVersion: string;
9
- osdkClientVersion: string;
5
+ typescriptVersion: string;
6
+ tslibVersion: string;
7
+ areTheTypesWrongVersion: string;
8
+ osdkApiVersion: string;
9
+ osdkClientVersion: string;
10
10
  }
11
- export declare function getExpectedDependencies({ osdkApiVersion, osdkClientVersion, }: DependencyVersions): {
12
- devDependencies: Record<string, string>;
13
- peerDependencies: Record<string, string>;
11
+ export declare function getExpectedDependencies({ osdkApiVersion, osdkClientVersion }: DependencyVersions): {
12
+ devDependencies: Record<string, string>;
13
+ peerDependencies: Record<string, string>;
14
14
  };
15
15
  export declare function getPackageJsonContents(name: string, version: string, dependencyVersions: DependencyVersions): {
16
- files: string[];
17
- devDependencies: Record<string, string>;
18
- peerDependencies: Record<string, string>;
19
- name: string;
20
- version: string;
21
- main: string;
22
- module: string;
23
- exports: {
24
- ".": {
25
- import: string;
26
- require: string;
27
- };
28
- };
29
- scripts: {
30
- prepack: string;
31
- check: string;
32
- };
16
+ files: string[];
17
+ devDependencies: Record<string, string>;
18
+ peerDependencies: Record<string, string>;
19
+ name: string;
20
+ version: string;
21
+ main: string;
22
+ module: string;
23
+ exports: { ".": {
24
+ import: string;
25
+ require: string;
26
+ } };
27
+ scripts: {
28
+ prepack: string;
29
+ check: string;
30
+ };
33
31
  };
34
- //# sourceMappingURL=generateClientSdkPackage.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export { generateClientSdkPackage as __UNSTABLE_generateClientSdkPackage, getExpectedDependencies } from "./generateClientSdkPackage.js";
2
+ export type { MinimalFs } from "./MinimalFs.js";
3
+ export { generateClientSdkVersionTwoPointZero } from "./v2.0/generateClientSdkVersionTwoPointZero.js";
4
+ export type { WireOntologyDefinition } from "./WireOntologyDefinition.js";
@@ -1,2 +1 @@
1
1
  export declare function startsWithApiNamespace(name: string, ontologyApiNamespace: string | undefined): boolean;
2
- //# sourceMappingURL=startsWithApiNamespace.d.ts.map
@@ -1,4 +1,4 @@
1
+ import type { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.js";
1
2
  import type { EnhancedObjectType } from "../GenerateContext/EnhancedObjectType.js";
2
3
  import type { ForeignType } from "../GenerateContext/ForeignType.js";
3
- export declare function getObjectImports(objects: Set<EnhancedObjectType | ForeignType>, curApiName: string | undefined, currentFilePath: string, v2: boolean): string;
4
- //# sourceMappingURL=getObjectImports.d.ts.map
4
+ export declare function getObjectImports(objects: Set<EnhancedObjectType | ForeignType | EnhancedInterfaceType>, curApiName: string | undefined, currentFilePath: string, v2: boolean): string;
@@ -1,4 +1,3 @@
1
1
  import type { QueryTypeV2 } from "@osdk/internal.foundry.core";
2
2
  import type { EnhancedQuery } from "../GenerateContext/EnhancedQuery.js";
3
3
  export declare function getObjectTypeApiNamesFromQuery(query: QueryTypeV2 | EnhancedQuery): string[];
4
- //# sourceMappingURL=getObjectTypeApiNamesFromQuery.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { QueryDataType } from "@osdk/internal.foundry.core";
2
2
  export declare function getObjectTypesFromQueryDataType(dataType: QueryDataType, types: Set<string>): void;
3
- //# sourceMappingURL=getObjectTypesFromQueryDataType.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import type { ObjectMetadata } from "@osdk/api";
2
2
  export declare function propertyJsdoc(property: ObjectMetadata.Property, { isInherited, apiName }: {
3
- isInherited?: boolean;
4
- apiName: string;
3
+ isInherited?: boolean;
4
+ apiName: string;
5
5
  }): string;
6
- //# sourceMappingURL=propertyJsdoc.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { type MinimalFs } from "../MinimalFs.js";
2
2
  export interface InMemoryFs extends MinimalFs {
3
- getFiles(): Record<string, string>;
4
- getFile(path: string): string;
3
+ getFiles(): Record<string, string>;
4
+ getFile(path: string): string;
5
5
  }
6
6
  export declare function createInMemoryFs(): InMemoryFs;
7
- //# sourceMappingURL=InMemoryFs.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function commaSeparatedIdentifiers(identifiers: ReadonlyArray<string>, alternateNames?: ReadonlyMap<string, string>): string;
2
- //# sourceMappingURL=commaSeparatedIdentifiers.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function commaSeparatedTypeIdentifiers(identifiers: ReadonlyArray<string>, altNames?: ReadonlyMap<string, string>): string;
2
- //# sourceMappingURL=commaSeparatedTypeIdentifiers.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function deleteUndefineds<T extends Record<string, any>>(obj: T): T;
2
- //# sourceMappingURL=deleteUndefineds.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function isReservedKeyword(name: string): boolean;
2
- //# sourceMappingURL=reservedKeywords.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function stringUnionFrom(values: ReadonlyArray<string>): string;
2
- //# sourceMappingURL=stringUnionFrom.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A function for changing the stringified key/value pairs of an object.
3
+ *
4
+ * @param value The value of the key/value pair.
5
+ * @param defaultValueFormatter The function that would be called if this customizer wasn't used
6
+ * @param key The key of the key/value pair.
7
+ * @param defaultKeyFormatter The function that would be called if this customizer wasn't used
8
+ *
9
+ * @returns A string, a tuple of strings, or undefined.
10
+ * If a string is returned, it will be used as the value of the key/value pair.
11
+ * If a tuple of strings is returned, the first string will be used as the key of the key/value pair
12
+ * and the second string will be used as the value of the key/value pair.
13
+ * If undefined is returned, the pair will be removed
14
+ */
15
+ type Customizer<
16
+ K extends string | symbol | number,
17
+ V extends {}
18
+ > = (value: V, defaultValueFormatter: (value: any) => string, key: K extends "*" ? string : K, defaultKeyFormatter: (key: string) => string) => [string, string] | string | undefined;
19
+ export declare function stringify<T extends Record<string, any>>(obj: T, customizer?: { [K in keyof T | "*"]? : Customizer<K, T[K]> }, separator?: string): string;
20
+ export {};
@@ -1,3 +1,2 @@
1
1
  import type { WireOntologyDefinition } from "../../WireOntologyDefinition.js";
2
2
  export declare const TodoWireOntology: WireOntologyDefinition;
3
- //# sourceMappingURL=TodoWireOntology.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import * as ts from "typescript";
2
2
  export declare function compileThis(files: Record<string, string>, basePath: string): readonly ts.Diagnostic[];
3
- //# sourceMappingURL=compileThis.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { ReaddirFn, WriteFileFn } from "../../MinimalFs.js";
2
+ export declare function createMockMinimalFiles(): {
3
+ minimalFiles: {
4
+ writeFile: WriteFileFn;
5
+ mkdir: () => Promise<void>;
6
+ readdir: ReaddirFn;
7
+ };
8
+ getFiles: () => { [k: string]: string };
9
+ dumpFilesToConsole: () => void;
10
+ };
@@ -1,2 +1 @@
1
1
  export declare function formatTs(contents: string): string | Promise<string>;
2
- //# sourceMappingURL=formatTs.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { MinimalFs } from "../MinimalFs.js";
2
+ /**
3
+ * Verify that the target outDir does not yet exist OR is empty.
4
+ *
5
+ * Re-generating an ontology on top of itself is not supported and may leave old
6
+ * files around or refuse to update files with new contents in some cases.
7
+ */
8
+ export declare function verifyOutDir(outDir: string, fs: MinimalFs): Promise<void>;
@@ -1,4 +1,3 @@
1
1
  import type { MinimalFs } from "../MinimalFs.js";
2
2
  import type { WireOntologyDefinition } from "../WireOntologyDefinition.js";
3
3
  export declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, userAgent: string, fs: MinimalFs, outDir: string, packageType?: "module" | "commonjs", externalObjects?: Map<string, string>, externalInterfaces?: Map<string, string>, externalSpts?: Map<string, string>, forInternalUse?: boolean): Promise<void>;
4
- //# sourceMappingURL=generateClientSdkVersionTwoPointZero.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
2
  export declare function generateOntologyMetadataFile({ fs, outDir, ontology, ontologyApiNamespace }: GenerateContext, userAgent: string): Promise<void>;
3
- //# sourceMappingURL=generateMetadata.d.ts.map
@@ -0,0 +1,2 @@
1
+ import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
+ export declare function generatePerActionDataFiles({ sanitizedOntology: ontology, fs, outDir: rootOutDir, importExt, ontology: enhancedOntology, forInternalUse }: Pick<GenerateContext, "sanitizedOntology" | "fs" | "outDir" | "importExt" | "ontology" | "forInternalUse">): Promise<void>;
@@ -1,3 +1,2 @@
1
1
  import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
2
  export declare function generatePerObjectDataFiles(ctx: GenerateContext): Promise<void>;
3
- //# sourceMappingURL=generatePerObjectDataFiles.d.ts.map
@@ -1,9 +1,6 @@
1
1
  import type { QueryParameterDefinition } from "@osdk/api";
2
2
  import type { EnhancedOntologyDefinition } from "../GenerateContext/EnhancedOntologyDefinition.js";
3
3
  import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
4
- export declare function generatePerQueryDataFilesV2({ fs, outDir: rootOutDir, ontology, importExt, forInternalUse, }: Pick<GenerateContext, "fs" | "outDir" | "importExt" | "ontology" | "forInternalUse">, v2: boolean): Promise<void>;
5
- export declare function queryParamJsDoc(param: QueryParameterDefinition<any>, { apiName }: {
6
- apiName: string;
7
- }): string;
4
+ export declare function generatePerQueryDataFilesV2({ fs, outDir: rootOutDir, ontology, importExt, forInternalUse }: Pick<GenerateContext, "fs" | "outDir" | "importExt" | "ontology" | "forInternalUse">, v2: boolean): Promise<void>;
5
+ export declare function queryParamJsDoc(param: QueryParameterDefinition<any>, { apiName }: { apiName: string }): string;
8
6
  export declare function getQueryParamType(enhancedOntology: EnhancedOntologyDefinition, input: QueryParameterDefinition, type: "Param" | "Result"): string;
9
- //# sourceMappingURL=generatePerQueryDataFiles.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
2
  export declare function generateRootIndexTsFile({ fs, outDir, importExt, ontologyApiNamespace, ontology }: GenerateContext): Promise<void>;
3
- //# sourceMappingURL=generateRootIndexTsFile.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function getDescriptionIfPresent(description?: string, includeNewline?: boolean): string;
2
- //# sourceMappingURL=getDescriptionIfPresent.d.ts.map