@goast/kotlin 0.3.13 → 0.4.0-beta2

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 (452) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -5
  3. package/assets/client/okhttp3/ApiAbstractions.kt +30 -30
  4. package/assets/client/okhttp3/ApiClient.kt +249 -249
  5. package/assets/client/okhttp3/ApiResponse.kt +43 -43
  6. package/assets/client/okhttp3/Errors.kt +21 -21
  7. package/assets/client/okhttp3/PartConfig.kt +11 -11
  8. package/assets/client/okhttp3/RequestConfig.kt +18 -18
  9. package/assets/client/okhttp3/RequestMethod.kt +8 -8
  10. package/assets/client/okhttp3/ResponseExtensions.kt +24 -24
  11. package/assets/client/okhttp3/Serializer.kt +14 -14
  12. package/esm/index.d.ts +9 -0
  13. package/esm/index.d.ts.map +1 -0
  14. package/esm/lib/assets.d.ts +3 -0
  15. package/esm/lib/assets.d.ts.map +1 -0
  16. package/esm/lib/assets.js +6 -0
  17. package/esm/lib/ast/_index.d.ts +29 -0
  18. package/esm/lib/ast/_index.d.ts.map +1 -0
  19. package/esm/lib/ast/_index.js +2 -3
  20. package/{types → esm}/lib/ast/common.d.ts +1 -0
  21. package/esm/lib/ast/common.d.ts.map +1 -0
  22. package/esm/lib/ast/index.d.ts +2 -0
  23. package/esm/lib/ast/index.d.ts.map +1 -0
  24. package/esm/lib/ast/index.js +1 -2
  25. package/{types → esm}/lib/ast/node.d.ts +2 -1
  26. package/esm/lib/ast/node.d.ts.map +1 -0
  27. package/esm/lib/ast/node.js +1 -1
  28. package/{types → esm}/lib/ast/nodes/annotation.d.ts +6 -5
  29. package/esm/lib/ast/nodes/annotation.d.ts.map +1 -0
  30. package/esm/lib/ast/nodes/annotation.js +19 -1
  31. package/{types → esm}/lib/ast/nodes/argument.d.ts +5 -4
  32. package/esm/lib/ast/nodes/argument.d.ts.map +1 -0
  33. package/esm/lib/ast/nodes/argument.js +12 -0
  34. package/{types → esm}/lib/ast/nodes/call.d.ts +6 -5
  35. package/esm/lib/ast/nodes/call.d.ts.map +1 -0
  36. package/esm/lib/ast/nodes/call.js +19 -1
  37. package/{types → esm}/lib/ast/nodes/class.d.ts +16 -15
  38. package/esm/lib/ast/nodes/class.d.ts.map +1 -0
  39. package/esm/lib/ast/nodes/class.js +79 -1
  40. package/{types → esm}/lib/ast/nodes/collection-literal.d.ts +5 -4
  41. package/esm/lib/ast/nodes/collection-literal.d.ts.map +1 -0
  42. package/esm/lib/ast/nodes/collection-literal.js +7 -1
  43. package/{types → esm}/lib/ast/nodes/constructor.d.ts +9 -8
  44. package/esm/lib/ast/nodes/constructor.d.ts.map +1 -0
  45. package/esm/lib/ast/nodes/constructor.js +37 -1
  46. package/{types → esm}/lib/ast/nodes/doc-tag.d.ts +4 -3
  47. package/esm/lib/ast/nodes/doc-tag.d.ts.map +1 -0
  48. package/esm/lib/ast/nodes/doc-tag.js +19 -1
  49. package/{types → esm}/lib/ast/nodes/doc.d.ts +7 -6
  50. package/esm/lib/ast/nodes/doc.d.ts.map +1 -0
  51. package/esm/lib/ast/nodes/doc.js +13 -1
  52. package/{types → esm}/lib/ast/nodes/enum-value.d.ts +9 -8
  53. package/esm/lib/ast/nodes/enum-value.d.ts.map +1 -0
  54. package/esm/lib/ast/nodes/enum-value.js +31 -1
  55. package/{types → esm}/lib/ast/nodes/enum.d.ts +16 -15
  56. package/esm/lib/ast/nodes/enum.d.ts.map +1 -0
  57. package/esm/lib/ast/nodes/enum.js +55 -1
  58. package/{types → esm}/lib/ast/nodes/function.d.ts +10 -9
  59. package/esm/lib/ast/nodes/function.d.ts.map +1 -0
  60. package/esm/lib/ast/nodes/function.js +115 -1
  61. package/{types → esm}/lib/ast/nodes/generic-parameter.d.ts +5 -4
  62. package/esm/lib/ast/nodes/generic-parameter.d.ts.map +1 -0
  63. package/esm/lib/ast/nodes/generic-parameter.js +18 -0
  64. package/{types → esm}/lib/ast/nodes/init-block.d.ts +4 -3
  65. package/esm/lib/ast/nodes/init-block.d.ts.map +1 -0
  66. package/esm/lib/ast/nodes/init-block.js +6 -0
  67. package/{types → esm}/lib/ast/nodes/interface.d.ts +14 -13
  68. package/esm/lib/ast/nodes/interface.d.ts.map +1 -0
  69. package/esm/lib/ast/nodes/interface.js +49 -1
  70. package/{types → esm}/lib/ast/nodes/lambda-type.d.ts +5 -4
  71. package/esm/lib/ast/nodes/lambda-type.d.ts.map +1 -0
  72. package/esm/lib/ast/nodes/lambda-type.js +19 -1
  73. package/{types → esm}/lib/ast/nodes/lambda.d.ts +4 -3
  74. package/esm/lib/ast/nodes/lambda.d.ts.map +1 -0
  75. package/esm/lib/ast/nodes/lambda.js +19 -1
  76. package/{types → esm}/lib/ast/nodes/object.d.ts +9 -8
  77. package/esm/lib/ast/nodes/object.d.ts.map +1 -0
  78. package/esm/lib/ast/nodes/object.js +43 -1
  79. package/{types → esm}/lib/ast/nodes/parameter.d.ts +7 -6
  80. package/esm/lib/ast/nodes/parameter.d.ts.map +1 -0
  81. package/esm/lib/ast/nodes/parameter.js +62 -1
  82. package/{types → esm}/lib/ast/nodes/property.d.ts +9 -8
  83. package/esm/lib/ast/nodes/property.d.ts.map +1 -0
  84. package/esm/lib/ast/nodes/property.js +133 -3
  85. package/{types → esm}/lib/ast/nodes/reference.d.ts +6 -5
  86. package/esm/lib/ast/nodes/reference.d.ts.map +1 -0
  87. package/esm/lib/ast/nodes/reference.js +48 -7
  88. package/{types → esm}/lib/ast/nodes/string.d.ts +4 -3
  89. package/esm/lib/ast/nodes/string.d.ts.map +1 -0
  90. package/esm/lib/ast/nodes/string.js +37 -1
  91. package/esm/lib/ast/nodes/types.d.ts +11 -0
  92. package/esm/lib/ast/nodes/types.d.ts.map +1 -0
  93. package/esm/lib/ast/references/index.d.ts +9 -0
  94. package/esm/lib/ast/references/index.d.ts.map +1 -0
  95. package/esm/lib/ast/references/index.js +7 -14
  96. package/esm/lib/ast/references/jackson.d.ts +92 -0
  97. package/esm/lib/ast/references/jackson.d.ts.map +1 -0
  98. package/esm/lib/ast/references/jakarta.d.ts +40 -0
  99. package/esm/lib/ast/references/jakarta.d.ts.map +1 -0
  100. package/esm/lib/ast/references/java.d.ts +95 -0
  101. package/esm/lib/ast/references/java.d.ts.map +1 -0
  102. package/esm/lib/ast/references/kotlin.d.ts +301 -0
  103. package/esm/lib/ast/references/kotlin.d.ts.map +1 -0
  104. package/esm/lib/ast/references/okhttp3.d.ts +27 -0
  105. package/esm/lib/ast/references/okhttp3.d.ts.map +1 -0
  106. package/esm/lib/ast/references/reactor.d.ts +33 -0
  107. package/esm/lib/ast/references/reactor.d.ts.map +1 -0
  108. package/esm/lib/ast/references/spring.d.ts +173 -0
  109. package/esm/lib/ast/references/spring.d.ts.map +1 -0
  110. package/esm/lib/ast/references/swagger.d.ts +53 -0
  111. package/esm/lib/ast/references/swagger.d.ts.map +1 -0
  112. package/esm/lib/ast/utils/get-kotlin-builder-options.d.ts +4 -0
  113. package/esm/lib/ast/utils/get-kotlin-builder-options.d.ts.map +1 -0
  114. package/esm/lib/ast/utils/get-kotlin-builder-options.js +1 -1
  115. package/{types → esm}/lib/ast/utils/to-kt-node.d.ts +4 -3
  116. package/esm/lib/ast/utils/to-kt-node.d.ts.map +1 -0
  117. package/{types → esm}/lib/ast/utils/write-kt-annotations.d.ts +3 -2
  118. package/esm/lib/ast/utils/write-kt-annotations.d.ts.map +1 -0
  119. package/esm/lib/ast/utils/write-kt-annotations.js +1 -1
  120. package/esm/lib/ast/utils/write-kt-arguments.d.ts +4 -0
  121. package/esm/lib/ast/utils/write-kt-arguments.d.ts.map +1 -0
  122. package/esm/lib/ast/utils/write-kt-arguments.js +1 -1
  123. package/esm/lib/ast/utils/write-kt-enum-values.d.ts +4 -0
  124. package/esm/lib/ast/utils/write-kt-enum-values.d.ts.map +1 -0
  125. package/esm/lib/ast/utils/write-kt-enum-values.js +1 -1
  126. package/esm/lib/ast/utils/write-kt-generic-parameters.d.ts +4 -0
  127. package/esm/lib/ast/utils/write-kt-generic-parameters.d.ts.map +1 -0
  128. package/esm/lib/ast/utils/write-kt-generic-parameters.js +1 -1
  129. package/{types → esm}/lib/ast/utils/write-kt-members.d.ts +3 -2
  130. package/esm/lib/ast/utils/write-kt-members.d.ts.map +1 -0
  131. package/esm/lib/ast/utils/write-kt-members.js +1 -1
  132. package/{types → esm}/lib/ast/utils/write-kt-node.d.ts +3 -2
  133. package/esm/lib/ast/utils/write-kt-node.d.ts.map +1 -0
  134. package/esm/lib/ast/utils/write-kt-node.js +1 -1
  135. package/esm/lib/ast/utils/write-kt-parameters.d.ts +4 -0
  136. package/esm/lib/ast/utils/write-kt-parameters.d.ts.map +1 -0
  137. package/esm/lib/ast/utils/write-kt-parameters.js +1 -1
  138. package/{types → esm}/lib/common-results.d.ts +1 -0
  139. package/esm/lib/common-results.d.ts.map +1 -0
  140. package/{types → esm}/lib/config.d.ts +2 -1
  141. package/esm/lib/config.d.ts.map +1 -0
  142. package/{types → esm}/lib/file-builder.d.ts +5 -4
  143. package/esm/lib/file-builder.d.ts.map +1 -0
  144. package/esm/lib/file-builder.js +13 -2
  145. package/esm/lib/generators/file-generator.d.ts +9 -0
  146. package/esm/lib/generators/file-generator.d.ts.map +1 -0
  147. package/esm/lib/generators/file-generator.js +2 -2
  148. package/esm/lib/generators/index.d.ts +5 -0
  149. package/esm/lib/generators/index.d.ts.map +1 -0
  150. package/{types → esm}/lib/generators/models/args.d.ts +3 -2
  151. package/esm/lib/generators/models/args.d.ts.map +1 -0
  152. package/esm/lib/generators/models/index.d.ts +5 -0
  153. package/esm/lib/generators/models/index.d.ts.map +1 -0
  154. package/esm/lib/generators/models/index.js +1 -2
  155. package/{types → esm}/lib/generators/models/model-generator.d.ts +12 -11
  156. package/esm/lib/generators/models/model-generator.d.ts.map +1 -0
  157. package/esm/lib/generators/models/model-generator.js +12 -10
  158. package/{types → esm}/lib/generators/models/models-generator.d.ts +5 -4
  159. package/esm/lib/generators/models/models-generator.d.ts.map +1 -0
  160. package/esm/lib/generators/models/models-generator.js +7 -1
  161. package/{types → esm}/lib/generators/models/models.d.ts +4 -3
  162. package/esm/lib/generators/models/models.d.ts.map +1 -0
  163. package/{types → esm}/lib/generators/services/okhttp3-clients/args.d.ts +11 -10
  164. package/esm/lib/generators/services/okhttp3-clients/args.d.ts.map +1 -0
  165. package/esm/lib/generators/services/okhttp3-clients/index.d.ts +5 -0
  166. package/esm/lib/generators/services/okhttp3-clients/index.d.ts.map +1 -0
  167. package/esm/lib/generators/services/okhttp3-clients/index.js +1 -2
  168. package/{types → esm}/lib/generators/services/okhttp3-clients/models.d.ts +6 -5
  169. package/esm/lib/generators/services/okhttp3-clients/models.d.ts.map +1 -0
  170. package/{types → esm}/lib/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +19 -18
  171. package/esm/lib/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -0
  172. package/esm/lib/generators/services/okhttp3-clients/okhttp3-client-generator.js +21 -25
  173. package/{types → esm}/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts +7 -6
  174. package/esm/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +1 -0
  175. package/esm/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.js +29 -14
  176. package/esm/lib/generators/services/okhttp3-clients/refs.d.ts +252 -0
  177. package/esm/lib/generators/services/okhttp3-clients/refs.d.ts.map +1 -0
  178. package/{types → esm}/lib/generators/services/spring-controllers/args.d.ts +9 -8
  179. package/esm/lib/generators/services/spring-controllers/args.d.ts.map +1 -0
  180. package/esm/lib/generators/services/spring-controllers/index.d.ts +5 -0
  181. package/esm/lib/generators/services/spring-controllers/index.d.ts.map +1 -0
  182. package/esm/lib/generators/services/spring-controllers/index.js +1 -2
  183. package/{types → esm}/lib/generators/services/spring-controllers/models.d.ts +5 -4
  184. package/esm/lib/generators/services/spring-controllers/models.d.ts.map +1 -0
  185. package/{types → esm}/lib/generators/services/spring-controllers/spring-controller-generator.d.ts +16 -15
  186. package/esm/lib/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -0
  187. package/esm/lib/generators/services/spring-controllers/spring-controller-generator.js +9 -8
  188. package/{types → esm}/lib/generators/services/spring-controllers/spring-controllers-generator.d.ts +5 -4
  189. package/esm/lib/generators/services/spring-controllers/spring-controllers-generator.d.ts.map +1 -0
  190. package/esm/lib/generators/services/spring-controllers/spring-controllers-generator.js +9 -4
  191. package/{types → esm}/lib/import-collection.d.ts +3 -2
  192. package/esm/lib/import-collection.d.ts.map +1 -0
  193. package/esm/lib/import-collection.js +13 -2
  194. package/{types → esm}/lib/types.d.ts +2 -1
  195. package/esm/lib/types.d.ts.map +1 -0
  196. package/{types → esm}/lib/utils.d.ts +2 -1
  197. package/esm/lib/utils.d.ts.map +1 -0
  198. package/esm/package.json +3 -0
  199. package/package.json +22 -30
  200. package/script/index.d.ts +9 -0
  201. package/script/index.d.ts.map +1 -0
  202. package/script/index.js +11 -0
  203. package/script/lib/assets.d.ts +3 -0
  204. package/script/lib/assets.d.ts.map +1 -0
  205. package/script/lib/assets.js +9 -0
  206. package/script/lib/ast/_index.d.ts +29 -0
  207. package/script/lib/ast/_index.d.ts.map +1 -0
  208. package/script/lib/ast/_index.js +81 -0
  209. package/script/lib/ast/common.d.ts +2 -0
  210. package/script/lib/ast/common.d.ts.map +1 -0
  211. package/script/lib/ast/index.d.ts +2 -0
  212. package/script/lib/ast/index.d.ts.map +1 -0
  213. package/{cjs → script}/lib/ast/index.js +1 -1
  214. package/script/lib/ast/node.d.ts +5 -0
  215. package/script/lib/ast/node.d.ts.map +1 -0
  216. package/script/lib/ast/nodes/annotation.d.ts +24 -0
  217. package/script/lib/ast/nodes/annotation.d.ts.map +1 -0
  218. package/{cjs → script}/lib/ast/nodes/annotation.js +26 -8
  219. package/script/lib/ast/nodes/argument.d.ts +21 -0
  220. package/script/lib/ast/nodes/argument.d.ts.map +1 -0
  221. package/{cjs → script}/lib/ast/nodes/argument.js +18 -6
  222. package/script/lib/ast/nodes/call.d.ts +23 -0
  223. package/script/lib/ast/nodes/call.d.ts.map +1 -0
  224. package/script/lib/ast/nodes/call.js +55 -0
  225. package/script/lib/ast/nodes/class.d.ts +55 -0
  226. package/script/lib/ast/nodes/class.d.ts.map +1 -0
  227. package/{cjs → script}/lib/ast/nodes/class.js +96 -18
  228. package/script/lib/ast/nodes/collection-literal.d.ts +18 -0
  229. package/script/lib/ast/nodes/collection-literal.d.ts.map +1 -0
  230. package/{cjs → script}/lib/ast/nodes/collection-literal.js +11 -5
  231. package/script/lib/ast/nodes/constructor.d.ts +35 -0
  232. package/script/lib/ast/nodes/constructor.d.ts.map +1 -0
  233. package/{cjs → script}/lib/ast/nodes/constructor.js +48 -12
  234. package/script/lib/ast/nodes/doc-tag.d.ts +35 -0
  235. package/script/lib/ast/nodes/doc-tag.d.ts.map +1 -0
  236. package/{cjs → script}/lib/ast/nodes/doc-tag.js +24 -6
  237. package/script/lib/ast/nodes/doc.d.ts +27 -0
  238. package/script/lib/ast/nodes/doc.d.ts.map +1 -0
  239. package/{cjs → script}/lib/ast/nodes/doc.js +26 -14
  240. package/script/lib/ast/nodes/enum-value.d.ts +31 -0
  241. package/script/lib/ast/nodes/enum-value.d.ts.map +1 -0
  242. package/{cjs → script}/lib/ast/nodes/enum-value.js +40 -10
  243. package/script/lib/ast/nodes/enum.d.ts +46 -0
  244. package/script/lib/ast/nodes/enum.d.ts.map +1 -0
  245. package/{cjs → script}/lib/ast/nodes/enum.js +69 -15
  246. package/script/lib/ast/nodes/function.d.ts +59 -0
  247. package/script/lib/ast/nodes/function.d.ts.map +1 -0
  248. package/{cjs → script}/lib/ast/nodes/function.js +129 -15
  249. package/script/lib/ast/nodes/generic-parameter.d.ts +22 -0
  250. package/script/lib/ast/nodes/generic-parameter.d.ts.map +1 -0
  251. package/{cjs → script}/lib/ast/nodes/generic-parameter.js +24 -6
  252. package/script/lib/ast/nodes/init-block.d.ts +17 -0
  253. package/script/lib/ast/nodes/init-block.d.ts.map +1 -0
  254. package/{cjs → script}/lib/ast/nodes/init-block.js +10 -4
  255. package/script/lib/ast/nodes/interface.d.ts +42 -0
  256. package/script/lib/ast/nodes/interface.d.ts.map +1 -0
  257. package/{cjs → script}/lib/ast/nodes/interface.js +61 -13
  258. package/script/lib/ast/nodes/lambda-type.d.ts +22 -0
  259. package/script/lib/ast/nodes/lambda-type.d.ts.map +1 -0
  260. package/{cjs → script}/lib/ast/nodes/lambda-type.js +27 -9
  261. package/script/lib/ast/nodes/lambda.d.ts +21 -0
  262. package/script/lib/ast/nodes/lambda.d.ts.map +1 -0
  263. package/{cjs → script}/lib/ast/nodes/lambda.js +23 -5
  264. package/script/lib/ast/nodes/object.d.ts +35 -0
  265. package/script/lib/ast/nodes/object.d.ts.map +1 -0
  266. package/{cjs → script}/lib/ast/nodes/object.js +52 -10
  267. package/script/lib/ast/nodes/parameter.d.ts +39 -0
  268. package/script/lib/ast/nodes/parameter.d.ts.map +1 -0
  269. package/{cjs → script}/lib/ast/nodes/parameter.js +70 -9
  270. package/script/lib/ast/nodes/property.d.ts +76 -0
  271. package/script/lib/ast/nodes/property.d.ts.map +1 -0
  272. package/{cjs → script}/lib/ast/nodes/property.js +145 -15
  273. package/script/lib/ast/nodes/reference.d.ts +48 -0
  274. package/script/lib/ast/nodes/reference.d.ts.map +1 -0
  275. package/{cjs → script}/lib/ast/nodes/reference.js +55 -14
  276. package/script/lib/ast/nodes/string.d.ts +31 -0
  277. package/script/lib/ast/nodes/string.d.ts.map +1 -0
  278. package/{cjs → script}/lib/ast/nodes/string.js +42 -6
  279. package/script/lib/ast/nodes/types.d.ts +11 -0
  280. package/script/lib/ast/nodes/types.d.ts.map +1 -0
  281. package/script/lib/ast/references/index.d.ts +9 -0
  282. package/script/lib/ast/references/index.d.ts.map +1 -0
  283. package/script/lib/ast/references/index.js +12 -0
  284. package/script/lib/ast/references/jackson.d.ts +92 -0
  285. package/script/lib/ast/references/jackson.d.ts.map +1 -0
  286. package/script/lib/ast/references/jackson.js +12 -0
  287. package/script/lib/ast/references/jakarta.d.ts +40 -0
  288. package/script/lib/ast/references/jakarta.d.ts.map +1 -0
  289. package/script/lib/ast/references/jakarta.js +10 -0
  290. package/script/lib/ast/references/java.d.ts +95 -0
  291. package/script/lib/ast/references/java.d.ts.map +1 -0
  292. package/script/lib/ast/references/java.js +15 -0
  293. package/script/lib/ast/references/kotlin.d.ts +301 -0
  294. package/script/lib/ast/references/kotlin.d.ts.map +1 -0
  295. package/script/lib/ast/references/kotlin.js +28 -0
  296. package/script/lib/ast/references/okhttp3.d.ts +27 -0
  297. package/script/lib/ast/references/okhttp3.d.ts.map +1 -0
  298. package/script/lib/ast/references/okhttp3.js +7 -0
  299. package/script/lib/ast/references/reactor.d.ts +33 -0
  300. package/script/lib/ast/references/reactor.d.ts.map +1 -0
  301. package/script/lib/ast/references/reactor.js +7 -0
  302. package/script/lib/ast/references/spring.d.ts +173 -0
  303. package/script/lib/ast/references/spring.d.ts.map +1 -0
  304. package/script/lib/ast/references/spring.js +24 -0
  305. package/script/lib/ast/references/swagger.d.ts +53 -0
  306. package/script/lib/ast/references/swagger.d.ts.map +1 -0
  307. package/script/lib/ast/references/swagger.js +11 -0
  308. package/script/lib/ast/utils/get-kotlin-builder-options.d.ts +4 -0
  309. package/script/lib/ast/utils/get-kotlin-builder-options.d.ts.map +1 -0
  310. package/{cjs → script}/lib/ast/utils/get-kotlin-builder-options.js +4 -4
  311. package/script/lib/ast/utils/to-kt-node.d.ts +8 -0
  312. package/script/lib/ast/utils/to-kt-node.d.ts.map +1 -0
  313. package/script/lib/ast/utils/to-kt-node.js +21 -0
  314. package/script/lib/ast/utils/write-kt-annotations.d.ts +6 -0
  315. package/script/lib/ast/utils/write-kt-annotations.d.ts.map +1 -0
  316. package/{cjs → script}/lib/ast/utils/write-kt-annotations.js +2 -2
  317. package/script/lib/ast/utils/write-kt-arguments.d.ts +4 -0
  318. package/script/lib/ast/utils/write-kt-arguments.d.ts.map +1 -0
  319. package/{cjs → script}/lib/ast/utils/write-kt-arguments.js +6 -6
  320. package/script/lib/ast/utils/write-kt-enum-values.d.ts +4 -0
  321. package/script/lib/ast/utils/write-kt-enum-values.d.ts.map +1 -0
  322. package/{cjs → script}/lib/ast/utils/write-kt-enum-values.js +2 -2
  323. package/script/lib/ast/utils/write-kt-generic-parameters.d.ts +4 -0
  324. package/script/lib/ast/utils/write-kt-generic-parameters.d.ts.map +1 -0
  325. package/{cjs → script}/lib/ast/utils/write-kt-generic-parameters.js +2 -2
  326. package/script/lib/ast/utils/write-kt-members.d.ts +6 -0
  327. package/script/lib/ast/utils/write-kt-members.d.ts.map +1 -0
  328. package/{cjs → script}/lib/ast/utils/write-kt-members.js +5 -5
  329. package/script/lib/ast/utils/write-kt-node.d.ts +8 -0
  330. package/script/lib/ast/utils/write-kt-node.d.ts.map +1 -0
  331. package/{cjs → script}/lib/ast/utils/write-kt-node.js +2 -2
  332. package/script/lib/ast/utils/write-kt-parameters.d.ts +4 -0
  333. package/script/lib/ast/utils/write-kt-parameters.d.ts.map +1 -0
  334. package/{cjs → script}/lib/ast/utils/write-kt-parameters.js +2 -2
  335. package/script/lib/common-results.d.ts +5 -0
  336. package/script/lib/common-results.d.ts.map +1 -0
  337. package/script/lib/config.d.ts +11 -0
  338. package/script/lib/config.d.ts.map +1 -0
  339. package/script/lib/file-builder.d.ts +22 -0
  340. package/script/lib/file-builder.d.ts.map +1 -0
  341. package/{cjs → script}/lib/file-builder.js +18 -7
  342. package/script/lib/generators/file-generator.d.ts +9 -0
  343. package/script/lib/generators/file-generator.d.ts.map +1 -0
  344. package/script/lib/generators/file-generator.js +17 -0
  345. package/script/lib/generators/index.d.ts +5 -0
  346. package/script/lib/generators/index.d.ts.map +1 -0
  347. package/script/lib/generators/index.js +7 -0
  348. package/script/lib/generators/models/args.d.ts +100 -0
  349. package/script/lib/generators/models/args.d.ts.map +1 -0
  350. package/script/lib/generators/models/index.d.ts +5 -0
  351. package/script/lib/generators/models/index.d.ts.map +1 -0
  352. package/{cjs → script}/lib/generators/models/index.js +4 -4
  353. package/script/lib/generators/models/model-generator.d.ts +48 -0
  354. package/script/lib/generators/models/model-generator.d.ts.map +1 -0
  355. package/{cjs → script}/lib/generators/models/model-generator.js +87 -85
  356. package/script/lib/generators/models/models-generator.d.ts +18 -0
  357. package/script/lib/generators/models/models-generator.d.ts.map +1 -0
  358. package/{cjs → script}/lib/generators/models/models-generator.js +10 -4
  359. package/script/lib/generators/models/models.d.ts +61 -0
  360. package/script/lib/generators/models/models.d.ts.map +1 -0
  361. package/{cjs → script}/lib/generators/models/models.js +2 -2
  362. package/script/lib/generators/services/okhttp3-clients/args.d.ts +76 -0
  363. package/script/lib/generators/services/okhttp3-clients/args.d.ts.map +1 -0
  364. package/script/lib/generators/services/okhttp3-clients/index.d.ts +5 -0
  365. package/script/lib/generators/services/okhttp3-clients/index.d.ts.map +1 -0
  366. package/{cjs → script}/lib/generators/services/okhttp3-clients/index.js +4 -4
  367. package/script/lib/generators/services/okhttp3-clients/models.d.ts +33 -0
  368. package/script/lib/generators/services/okhttp3-clients/models.d.ts.map +1 -0
  369. package/{cjs → script}/lib/generators/services/okhttp3-clients/models.js +2 -2
  370. package/script/lib/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +44 -0
  371. package/script/lib/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -0
  372. package/{cjs → script}/lib/generators/services/okhttp3-clients/okhttp3-client-generator.js +96 -100
  373. package/script/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts +23 -0
  374. package/script/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +1 -0
  375. package/{cjs → script}/lib/generators/services/okhttp3-clients/okhttp3-clients-generator.js +35 -20
  376. package/script/lib/generators/services/okhttp3-clients/refs.d.ts +252 -0
  377. package/script/lib/generators/services/okhttp3-clients/refs.d.ts.map +1 -0
  378. package/script/lib/generators/services/okhttp3-clients/refs.js +33 -0
  379. package/script/lib/generators/services/spring-controllers/args.d.ts +72 -0
  380. package/script/lib/generators/services/spring-controllers/args.d.ts.map +1 -0
  381. package/script/lib/generators/services/spring-controllers/index.d.ts +5 -0
  382. package/script/lib/generators/services/spring-controllers/index.d.ts.map +1 -0
  383. package/script/lib/generators/services/spring-controllers/index.js +8 -0
  384. package/script/lib/generators/services/spring-controllers/models.d.ts +31 -0
  385. package/script/lib/generators/services/spring-controllers/models.d.ts.map +1 -0
  386. package/{cjs → script}/lib/generators/services/spring-controllers/models.js +2 -2
  387. package/script/lib/generators/services/spring-controllers/spring-controller-generator.d.ts +54 -0
  388. package/script/lib/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -0
  389. package/{cjs → script}/lib/generators/services/spring-controllers/spring-controller-generator.js +88 -87
  390. package/script/lib/generators/services/spring-controllers/spring-controllers-generator.d.ts +18 -0
  391. package/script/lib/generators/services/spring-controllers/spring-controllers-generator.d.ts.map +1 -0
  392. package/{cjs → script}/lib/generators/services/spring-controllers/spring-controllers-generator.js +10 -5
  393. package/script/lib/import-collection.d.ts +20 -0
  394. package/script/lib/import-collection.d.ts.map +1 -0
  395. package/{cjs → script}/lib/import-collection.js +14 -3
  396. package/script/lib/types.d.ts +8 -0
  397. package/script/lib/types.d.ts.map +1 -0
  398. package/script/lib/utils.d.ts +5 -0
  399. package/script/lib/utils.d.ts.map +1 -0
  400. package/script/package.json +3 -0
  401. package/cjs/index.js +0 -11
  402. package/cjs/lib/ast/_index.js +0 -81
  403. package/cjs/lib/ast/nodes/call.js +0 -37
  404. package/cjs/lib/ast/references/index.js +0 -12
  405. package/cjs/lib/ast/references/jackson.js +0 -12
  406. package/cjs/lib/ast/references/jakarta.js +0 -10
  407. package/cjs/lib/ast/references/java.js +0 -15
  408. package/cjs/lib/ast/references/kotlin.js +0 -28
  409. package/cjs/lib/ast/references/okhttp3.js +0 -7
  410. package/cjs/lib/ast/references/reactor.js +0 -7
  411. package/cjs/lib/ast/references/spring.js +0 -24
  412. package/cjs/lib/ast/references/swagger.js +0 -11
  413. package/cjs/lib/ast/utils/to-kt-node.js +0 -21
  414. package/cjs/lib/generators/file-generator.js +0 -17
  415. package/cjs/lib/generators/index.js +0 -7
  416. package/cjs/lib/generators/services/okhttp3-clients/refs.js +0 -33
  417. package/cjs/lib/generators/services/spring-controllers/index.js +0 -8
  418. package/cjs/package.json +0 -1
  419. package/types/index.d.ts +0 -8
  420. package/types/lib/ast/_index.d.ts +0 -28
  421. package/types/lib/ast/index.d.ts +0 -1
  422. package/types/lib/ast/nodes/types.d.ts +0 -10
  423. package/types/lib/ast/references/index.d.ts +0 -8
  424. package/types/lib/ast/references/jackson.d.ts +0 -91
  425. package/types/lib/ast/references/jakarta.d.ts +0 -39
  426. package/types/lib/ast/references/java.d.ts +0 -94
  427. package/types/lib/ast/references/kotlin.d.ts +0 -300
  428. package/types/lib/ast/references/okhttp3.d.ts +0 -26
  429. package/types/lib/ast/references/reactor.d.ts +0 -32
  430. package/types/lib/ast/references/spring.d.ts +0 -172
  431. package/types/lib/ast/references/swagger.d.ts +0 -52
  432. package/types/lib/ast/utils/get-kotlin-builder-options.d.ts +0 -3
  433. package/types/lib/ast/utils/write-kt-arguments.d.ts +0 -3
  434. package/types/lib/ast/utils/write-kt-enum-values.d.ts +0 -3
  435. package/types/lib/ast/utils/write-kt-generic-parameters.d.ts +0 -3
  436. package/types/lib/ast/utils/write-kt-parameters.d.ts +0 -3
  437. package/types/lib/generators/file-generator.d.ts +0 -8
  438. package/types/lib/generators/index.d.ts +0 -4
  439. package/types/lib/generators/models/index.d.ts +0 -4
  440. package/types/lib/generators/services/okhttp3-clients/index.d.ts +0 -4
  441. package/types/lib/generators/services/okhttp3-clients/refs.d.ts +0 -251
  442. package/types/lib/generators/services/spring-controllers/index.d.ts +0 -4
  443. /package/{cjs → script}/lib/ast/common.js +0 -0
  444. /package/{cjs → script}/lib/ast/node.js +0 -0
  445. /package/{cjs → script}/lib/ast/nodes/types.js +0 -0
  446. /package/{cjs → script}/lib/common-results.js +0 -0
  447. /package/{cjs → script}/lib/config.js +0 -0
  448. /package/{cjs → script}/lib/generators/models/args.js +0 -0
  449. /package/{cjs → script}/lib/generators/services/okhttp3-clients/args.js +0 -0
  450. /package/{cjs → script}/lib/generators/services/spring-controllers/args.js +0 -0
  451. /package/{cjs → script}/lib/types.js +0 -0
  452. /package/{cjs → script}/lib/utils.js +0 -0
@@ -2,33 +2,32 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultKotlinModelGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
- /* eslint-disable unused-imports/no-unused-vars */
6
- const path_1 = require("path");
5
+ const node_path_1 = require("node:path");
7
6
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
7
  const core_1 = require("@goast/core");
9
- const ast_1 = require("../../ast");
10
- const file_builder_1 = require("../../file-builder");
11
- const file_generator_1 = require("../file-generator");
12
- class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
8
+ const index_js_1 = require("../../ast/index.js");
9
+ const file_builder_js_1 = require("../../file-builder.js");
10
+ const file_generator_js_1 = require("../file-generator.js");
11
+ class DefaultKotlinModelGenerator extends file_generator_js_1.KotlinFileGenerator {
13
12
  generate(ctx) {
14
13
  if (/\/(anyOf|allOf)(\/[0-9]+)?$/.test(ctx.schema.$src.path)) {
15
14
  // Do not generate types that are only used for anyOf and/or allOf
16
- return { type: ast_1.kt.refs.any({ nullable: true }) };
15
+ return { type: index_js_1.kt.refs.any({ nullable: true }) };
17
16
  }
18
17
  if (this.shouldGenerateTypeDeclaration(ctx, { schema: ctx.schema })) {
19
18
  const typeName = this.getDeclarationTypeName(ctx, { schema: ctx.schema });
20
19
  const packageName = this.getPackageName(ctx, { schema: ctx.schema });
21
20
  const filePath = `${ctx.config.outputDir}/${packageName.replace(/\./g, '/')}/${typeName}.kt`;
22
21
  console.log(`Generating model ${packageName}.${typeName} to ${filePath}...`);
23
- fs_extra_1.default.ensureDirSync((0, path_1.dirname)(filePath));
24
- fs_extra_1.default.writeFileSync(filePath, new file_builder_1.KotlinFileBuilder(packageName, ctx.config).append(this.getFileContent(ctx, {})).toString());
25
- return { type: ast_1.kt.reference(typeName, packageName) };
22
+ fs_extra_1.default.ensureDirSync((0, node_path_1.dirname)(filePath));
23
+ fs_extra_1.default.writeFileSync(filePath, new file_builder_js_1.KotlinFileBuilder(packageName, ctx.config).append(this.getFileContent(ctx, {})).toString());
24
+ return { type: index_js_1.kt.reference(typeName, packageName) };
26
25
  }
27
26
  else {
28
27
  return { type: this.getType(ctx, { schema: ctx.schema }) };
29
28
  }
30
29
  }
31
- getFileContent(ctx, args) {
30
+ getFileContent(ctx, _args) {
32
31
  return (0, core_1.appendValueGroup)([this.getSchemaDeclaration(ctx, { schema: this.normalizeSchema(ctx, { schema: ctx.schema }) })], '\n\n');
33
32
  }
34
33
  getSchemaDeclaration(ctx, args) {
@@ -46,12 +45,12 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
46
45
  const { schema } = args;
47
46
  const inheritedSchemas = this.getInheritedSchemas(ctx, { schema });
48
47
  const parameters = this.getClassProperties(ctx, { schema });
49
- return ast_1.kt.class(this.getDeclarationTypeName(ctx, { schema }), {
50
- doc: ast_1.kt.doc((_a = schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
51
- annotations: [schema.deprecated ? ast_1.kt.annotation(ast_1.kt.refs.deprecated(), [ast_1.kt.argument(ast_1.kt.string(''))]) : null],
48
+ return index_js_1.kt.class(this.getDeclarationTypeName(ctx, { schema }), {
49
+ doc: index_js_1.kt.doc((_a = schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
50
+ annotations: [schema.deprecated ? index_js_1.kt.annotation(index_js_1.kt.refs.deprecated(), [index_js_1.kt.argument(index_js_1.kt.string(''))]) : null],
52
51
  classKind: parameters.length === 0 ? null : 'data',
53
52
  implements: inheritedSchemas.map((schema) => this.getType(ctx, { schema })),
54
- primaryConstructor: ast_1.kt.constructor(parameters.map((property) => this.getClassParameter(ctx, { ...args, inheritedSchemas, parameters, property }))),
53
+ primaryConstructor: index_js_1.kt.constructor(parameters.map((property) => this.getClassParameter(ctx, { ...args, inheritedSchemas, parameters, property }))),
55
54
  members: [
56
55
  ...(schema.additionalProperties !== undefined && schema.additionalProperties !== false
57
56
  ? [
@@ -66,12 +65,12 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
66
65
  getInterface(ctx, args) {
67
66
  var _a;
68
67
  const { schema } = args;
69
- return ast_1.kt.interface(this.getDeclarationTypeName(ctx, { schema }), {
70
- doc: ast_1.kt.doc((_a = schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
68
+ return index_js_1.kt.interface(this.getDeclarationTypeName(ctx, { schema }), {
69
+ doc: index_js_1.kt.doc((_a = schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
71
70
  annotations: [
72
71
  this.getJacksonJsonTypeInfoAnnotation(ctx, { schema }),
73
72
  this.getJacksonJsonSubTypesAnnotation(ctx, { schema }),
74
- schema.deprecated ? ast_1.kt.annotation(ast_1.kt.refs.deprecated(), [ast_1.kt.argument(ast_1.kt.string(''))]) : null,
73
+ schema.deprecated ? index_js_1.kt.annotation(index_js_1.kt.refs.deprecated(), [index_js_1.kt.argument(index_js_1.kt.string(''))]) : null,
75
74
  ].filter(core_1.notNullish),
76
75
  members: this.sortProperties(ctx, { schema, properties: schema.properties.values() }).map((property) => this.getInterfaceProperty(ctx, { schema, property })),
77
76
  });
@@ -79,14 +78,14 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
79
78
  getEnum(ctx, args) {
80
79
  var _a, _b, _c;
81
80
  const { schema } = args;
82
- return ast_1.kt.enum(this.getDeclarationTypeName(ctx, { schema }), (_b = (_a = schema.enum) === null || _a === void 0 ? void 0 : _a.map((x) => ast_1.kt.enumValue((0, core_1.toCasing)(String(x), ctx.config.enumValueNameCasing), {
83
- annotations: [ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonProperty(), [ast_1.kt.argument(ast_1.kt.string(String(x)))])],
84
- arguments: [ast_1.kt.argument(ast_1.kt.string(String(x)))],
81
+ return index_js_1.kt.enum(this.getDeclarationTypeName(ctx, { schema }), (_b = (_a = schema.enum) === null || _a === void 0 ? void 0 : _a.map((x) => index_js_1.kt.enumValue((0, core_1.toCasing)(String(x), ctx.config.enumValueNameCasing), {
82
+ annotations: [index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonProperty(), [index_js_1.kt.argument(index_js_1.kt.string(String(x)))])],
83
+ arguments: [index_js_1.kt.argument(index_js_1.kt.string(String(x)))],
85
84
  }))) !== null && _b !== void 0 ? _b : [], {
86
- doc: ast_1.kt.doc((_c = schema.description) === null || _c === void 0 ? void 0 : _c.trim()),
87
- annotations: [schema.deprecated ? ast_1.kt.annotation(ast_1.kt.refs.deprecated(), [ast_1.kt.argument(ast_1.kt.string(''))]) : null],
88
- primaryConstructor: ast_1.kt.constructor([
89
- ast_1.kt.parameter.class((0, core_1.toCasing)('value', ctx.config.propertyNameCasing), ast_1.kt.refs.string(), {
85
+ doc: index_js_1.kt.doc((_c = schema.description) === null || _c === void 0 ? void 0 : _c.trim()),
86
+ annotations: [schema.deprecated ? index_js_1.kt.annotation(index_js_1.kt.refs.deprecated(), [index_js_1.kt.argument(index_js_1.kt.string(''))]) : null],
87
+ primaryConstructor: index_js_1.kt.constructor([
88
+ index_js_1.kt.parameter.class((0, core_1.toCasing)('value', ctx.config.propertyNameCasing), index_js_1.kt.refs.string(), {
90
89
  property: 'readonly',
91
90
  }),
92
91
  ]),
@@ -102,47 +101,47 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
102
101
  const nullable = (_a = args.nullable) !== null && _a !== void 0 ? _a : schema.nullable;
103
102
  switch (schema.kind) {
104
103
  case 'boolean':
105
- return ast_1.kt.refs.boolean({ nullable });
104
+ return index_js_1.kt.refs.boolean({ nullable });
106
105
  case 'integer':
107
106
  case 'number':
108
107
  switch (schema.format) {
109
108
  case 'int32':
110
- return ast_1.kt.refs.int({ nullable });
109
+ return index_js_1.kt.refs.int({ nullable });
111
110
  case 'int64':
112
- return ast_1.kt.refs.long({ nullable });
111
+ return index_js_1.kt.refs.long({ nullable });
113
112
  case 'float':
114
- return ast_1.kt.refs.float({ nullable });
113
+ return index_js_1.kt.refs.float({ nullable });
115
114
  case 'double':
116
- return ast_1.kt.refs.double({ nullable });
115
+ return index_js_1.kt.refs.double({ nullable });
117
116
  default:
118
- return schema.kind === 'integer' ? ast_1.kt.refs.int({ nullable }) : ast_1.kt.refs.double({ nullable });
117
+ return schema.kind === 'integer' ? index_js_1.kt.refs.int({ nullable }) : index_js_1.kt.refs.double({ nullable });
119
118
  }
120
119
  case 'string':
121
120
  switch (schema.format) {
122
121
  case 'date-time':
123
- return ast_1.kt.refs.java.offsetDateTime({ nullable });
122
+ return index_js_1.kt.refs.java.offsetDateTime({ nullable });
124
123
  default:
125
- return ast_1.kt.refs.string({ nullable });
124
+ return index_js_1.kt.refs.string({ nullable });
126
125
  }
127
126
  case 'null':
128
- return ast_1.kt.refs.nothing({ nullable });
127
+ return index_js_1.kt.refs.nothing({ nullable });
129
128
  case 'unknown':
130
- return ast_1.kt.refs.any({ nullable });
129
+ return index_js_1.kt.refs.any({ nullable });
131
130
  case 'array':
132
- return ast_1.kt.refs.list([schema.items ? this.getType(ctx, { schema: schema.items }) : ast_1.kt.refs.any({ nullable: true })], { nullable });
131
+ return index_js_1.kt.refs.list([schema.items ? this.getType(ctx, { schema: schema.items }) : index_js_1.kt.refs.any({ nullable: true })], { nullable });
133
132
  case 'object':
134
133
  return schema.properties.size === 0 && schema.additionalProperties
135
- ? ast_1.kt.refs.map([ast_1.kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })], { nullable })
136
- : ast_1.kt.refs.any({ nullable });
134
+ ? index_js_1.kt.refs.map([index_js_1.kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })], { nullable })
135
+ : index_js_1.kt.refs.any({ nullable });
137
136
  default:
138
- return ast_1.kt.refs.any({ nullable });
137
+ return index_js_1.kt.refs.any({ nullable });
139
138
  }
140
139
  }
141
140
  getGeneratedType(ctx, args) {
142
141
  var _a;
143
142
  const schema = (0, core_1.getSchemaReference)(args.schema, ['description']);
144
143
  if (this.shouldGenerateTypeDeclaration(ctx, { schema })) {
145
- return ast_1.kt.reference(this.getDeclarationTypeName(ctx, { schema }), this.getPackageName(ctx, { schema }), {
144
+ return index_js_1.kt.reference(this.getDeclarationTypeName(ctx, { schema }), this.getPackageName(ctx, { schema }), {
146
145
  nullable: (_a = args.nullable) !== null && _a !== void 0 ? _a : schema.nullable,
147
146
  });
148
147
  }
@@ -152,7 +151,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
152
151
  const { schema } = args;
153
152
  return typeof schema.additionalProperties === 'object'
154
153
  ? this.getType(ctx, { schema: schema.additionalProperties })
155
- : ast_1.kt.refs.any({ nullable: true });
154
+ : index_js_1.kt.refs.any({ nullable: true });
156
155
  }
157
156
  getDefaultValue(ctx, args) {
158
157
  const { schema } = args;
@@ -168,10 +167,10 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
168
167
  return String(schema.default);
169
168
  case 'string':
170
169
  return schema.enum && schema.enum.length > 0
171
- ? ast_1.kt.call([this.getType(ctx, { schema }), (0, core_1.toCasing)(String(schema.default), ctx.config.enumValueNameCasing)])
172
- : ast_1.kt.string(String(schema.default));
170
+ ? index_js_1.kt.call([this.getType(ctx, { schema }), (0, core_1.toCasing)(String(schema.default), ctx.config.enumValueNameCasing)])
171
+ : index_js_1.kt.string(String(schema.default));
173
172
  case 'array':
174
- return ast_1.kt.call(ast_1.kt.refs.listOf.infer(), Array.isArray(schema.default) ? schema.default.map((x) => ast_1.kt.toNode(x)) : []);
173
+ return index_js_1.kt.call(index_js_1.kt.refs.listOf.infer(), Array.isArray(schema.default) ? schema.default.map((x) => index_js_1.kt.toNode(x)) : []);
175
174
  default:
176
175
  return 'null';
177
176
  }
@@ -181,7 +180,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
181
180
  getClassParameter(ctx, args) {
182
181
  var _a;
183
182
  const { schema, inheritedSchemas, property } = args;
184
- return ast_1.kt.parameter.class((0, core_1.toCasing)(property.name, ctx.config.propertyNameCasing), this.getType(ctx, { schema: property.schema, nullable: schema.required.has(property.name) ? undefined : true }), {
183
+ return index_js_1.kt.parameter.class((0, core_1.toCasing)(property.name, ctx.config.propertyNameCasing), this.getType(ctx, { schema: property.schema, nullable: schema.required.has(property.name) ? undefined : true }), {
185
184
  description: (_a = property.schema.description) === null || _a === void 0 ? void 0 : _a.trim(),
186
185
  annotations: [
187
186
  this.getJakartaPatternAnnotation(ctx, { schema, property }),
@@ -189,7 +188,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
189
188
  this.getSwaggerSchemaAnnotation(ctx, { schema, property }),
190
189
  this.getJacksonJsonPropertyAnnotation(ctx, { schema, property }),
191
190
  (0, core_1.modify)(this.getJacksonJsonIncludeAnnotation(ctx, { schema, property }), (x) => (x.target = 'get')),
192
- property.schema.deprecated ? ast_1.kt.annotation(ast_1.kt.refs.deprecated(), [ast_1.kt.argument(ast_1.kt.string(''))]) : null,
191
+ property.schema.deprecated ? index_js_1.kt.annotation(index_js_1.kt.refs.deprecated(), [index_js_1.kt.argument(index_js_1.kt.string(''))]) : null,
193
192
  ].filter(core_1.notNullish),
194
193
  override: inheritedSchemas.some((schema) => this.hasProperty(ctx, { schema, propertyName: property.name })),
195
194
  property: 'readonly',
@@ -201,12 +200,12 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
201
200
  getInterfaceProperty(ctx, args) {
202
201
  var _a;
203
202
  const { schema, property } = args;
204
- return ast_1.kt.property((0, core_1.toCasing)(property.name, ctx.config.propertyNameCasing), {
205
- doc: ast_1.kt.doc((_a = property.schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
203
+ return index_js_1.kt.property((0, core_1.toCasing)(property.name, ctx.config.propertyNameCasing), {
204
+ doc: index_js_1.kt.doc((_a = property.schema.description) === null || _a === void 0 ? void 0 : _a.trim()),
206
205
  annotations: (0, core_1.modifyEach)([
207
206
  this.getJacksonJsonPropertyAnnotation(ctx, { schema, property }),
208
207
  this.getJacksonJsonIncludeAnnotation(ctx, { schema, property }),
209
- property.schema.deprecated ? ast_1.kt.annotation(ast_1.kt.refs.deprecated(), [ast_1.kt.argument(ast_1.kt.string(''))]) : null,
208
+ property.schema.deprecated ? index_js_1.kt.annotation(index_js_1.kt.refs.deprecated(), [index_js_1.kt.argument(index_js_1.kt.string(''))]) : null,
210
209
  ].filter(core_1.notNullish), (x) => (x.target = 'get')),
211
210
  type: this.getType(ctx, {
212
211
  schema: property.schema,
@@ -216,9 +215,9 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
216
215
  }
217
216
  getAdditionalPropertiesProperty(ctx, args) {
218
217
  const { schema } = args;
219
- return ast_1.kt.property((0, core_1.toCasing)('additionalProperties', ctx.config.propertyNameCasing), {
220
- annotations: [ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonIgnore())],
221
- type: ast_1.kt.reference('MutableMap', null, {
218
+ return index_js_1.kt.property((0, core_1.toCasing)('additionalProperties', ctx.config.propertyNameCasing), {
219
+ annotations: [index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonIgnore())],
220
+ type: index_js_1.kt.reference('MutableMap', null, {
222
221
  generics: ['String', this.getAdditionalPropertiesType(ctx, { schema })],
223
222
  }),
224
223
  default: 'mutableMapOf()',
@@ -226,20 +225,20 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
226
225
  }
227
226
  getAdditionalPropertiesSetter(ctx, args) {
228
227
  const { schema } = args;
229
- return ast_1.kt.function((0, core_1.toCasing)('set', ctx.config.functionNameCasing), {
230
- annotations: [ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonAnySetter())],
228
+ return index_js_1.kt.function((0, core_1.toCasing)('set', ctx.config.functionNameCasing), {
229
+ annotations: [index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonAnySetter())],
231
230
  parameters: [
232
- ast_1.kt.parameter((0, core_1.toCasing)('name', ctx.config.parameterNameCasing), 'String'),
233
- ast_1.kt.parameter((0, core_1.toCasing)('value', ctx.config.parameterNameCasing), this.getAdditionalPropertiesType(ctx, { schema })),
231
+ index_js_1.kt.parameter((0, core_1.toCasing)('name', ctx.config.parameterNameCasing), 'String'),
232
+ index_js_1.kt.parameter((0, core_1.toCasing)('value', ctx.config.parameterNameCasing), this.getAdditionalPropertiesType(ctx, { schema })),
234
233
  ],
235
234
  body: `this.${(0, core_1.toCasing)('additionalProperties', ctx.config.propertyNameCasing)}[name] = value`,
236
235
  });
237
236
  }
238
237
  getAdditionalPropertiesGetter(ctx, args) {
239
238
  const { schema } = args;
240
- return ast_1.kt.function((0, core_1.toCasing)('getMap', ctx.config.functionNameCasing), {
241
- annotations: [ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonAnyGetter())],
242
- returnType: ast_1.kt.refs.map([ast_1.kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })]),
239
+ return index_js_1.kt.function((0, core_1.toCasing)('getMap', ctx.config.functionNameCasing), {
240
+ annotations: [index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonAnyGetter())],
241
+ returnType: index_js_1.kt.refs.map([index_js_1.kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })]),
243
242
  body: `return this.${(0, core_1.toCasing)('additionalProperties', ctx.config.propertyNameCasing)}`,
244
243
  });
245
244
  }
@@ -248,13 +247,13 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
248
247
  getJacksonJsonTypeInfoAnnotation(ctx, args) {
249
248
  const { schema } = args;
250
249
  return ctx.config.addJacksonAnnotations && schema.discriminator
251
- ? ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonTypeInfo(), [
252
- ast_1.kt.argument.named('use', 'JsonTypeInfo.Id.NAME'),
253
- ast_1.kt.argument.named('include', 'properties' in schema && schema.properties.has(schema.discriminator.propertyName)
250
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonTypeInfo(), [
251
+ index_js_1.kt.argument.named('use', 'JsonTypeInfo.Id.NAME'),
252
+ index_js_1.kt.argument.named('include', 'properties' in schema && schema.properties.has(schema.discriminator.propertyName)
254
253
  ? 'JsonTypeInfo.As.EXISTING_PROPERTY'
255
254
  : 'JsonTypeInfo.As.PROPERTY'),
256
- ast_1.kt.argument.named('property', ast_1.kt.string(schema.discriminator.propertyName)),
257
- ast_1.kt.argument.named('visible', 'true'),
255
+ index_js_1.kt.argument.named('property', index_js_1.kt.string(schema.discriminator.propertyName)),
256
+ index_js_1.kt.argument.named('visible', 'true'),
258
257
  ])
259
258
  : null;
260
259
  }
@@ -264,33 +263,33 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
264
263
  return null;
265
264
  const entries = Object.entries(schema.discriminator.mapping);
266
265
  return entries.length > 0
267
- ? ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonSubTypes(), entries.map(([value, schema]) => ast_1.kt.argument(ast_1.kt.call([ast_1.kt.refs.jackson.jsonSubTypes(), 'Type'], [
268
- ast_1.kt.argument.named('value', (0, core_1.modify)(this.getType(ctx, { schema }), (x) => (x.classReference = true))),
269
- ast_1.kt.argument.named('name', ast_1.kt.string(value)),
266
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonSubTypes(), entries.map(([value, schema]) => index_js_1.kt.argument(index_js_1.kt.call([index_js_1.kt.refs.jackson.jsonSubTypes(), 'Type'], [
267
+ index_js_1.kt.argument.named('value', (0, core_1.modify)(this.getType(ctx, { schema }), (x) => (x.classReference = true))),
268
+ index_js_1.kt.argument.named('name', index_js_1.kt.string(value)),
270
269
  ]))))
271
270
  : null;
272
271
  }
273
272
  getJacksonJsonPropertyAnnotation(ctx, args) {
274
273
  const { schema, property } = args;
275
274
  return ctx.config.addJacksonAnnotations
276
- ? ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonProperty(), [
277
- ast_1.kt.argument(ast_1.kt.string(property.name)),
278
- schema.required.has(property.name) ? ast_1.kt.argument.named('required', 'true') : null,
275
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonProperty(), [
276
+ index_js_1.kt.argument(index_js_1.kt.string(property.name)),
277
+ schema.required.has(property.name) ? index_js_1.kt.argument.named('required', 'true') : null,
279
278
  ])
280
279
  : null;
281
280
  }
282
281
  getJacksonJsonIncludeAnnotation(ctx, args) {
283
282
  const { property } = args;
284
283
  return ctx.config.addJacksonAnnotations && property.schema.custom['exclude-when-null'] === true
285
- ? ast_1.kt.annotation(ast_1.kt.refs.jackson.jsonInclude(), [
286
- ast_1.kt.argument(ast_1.kt.call([ast_1.kt.refs.jackson.jsonInclude(), 'Include', 'NON_NULL'])),
284
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jackson.jsonInclude(), [
285
+ index_js_1.kt.argument(index_js_1.kt.call([index_js_1.kt.refs.jackson.jsonInclude(), 'Include', 'NON_NULL'])),
287
286
  ])
288
287
  : null;
289
288
  }
290
289
  getJakartaPatternAnnotation(ctx, args) {
291
290
  const { property } = args;
292
291
  return ctx.config.addJakartaValidationAnnotations && property.schema.kind === 'string' && property.schema.pattern
293
- ? ast_1.kt.annotation(ast_1.kt.refs.jakarta.pattern(), [ast_1.kt.argument.named('regexp', ast_1.kt.string(property.schema.pattern))], {
292
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jakarta.pattern(), [index_js_1.kt.argument.named('regexp', index_js_1.kt.string(property.schema.pattern))], {
294
293
  target: 'get',
295
294
  })
296
295
  : null;
@@ -299,28 +298,30 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
299
298
  const { property } = args;
300
299
  return ctx.config.addJakartaValidationAnnotations &&
301
300
  this.shouldGenerateTypeDeclaration(ctx, { schema: property.schema })
302
- ? ast_1.kt.annotation(ast_1.kt.refs.jakarta.valid(), [], { target: 'field' })
301
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.jakarta.valid(), [], { target: 'field' })
303
302
  : null;
304
303
  }
305
304
  getSwaggerSchemaAnnotation(ctx, args) {
306
305
  const { schema, property } = args;
307
306
  return ctx.config.addSwaggerAnnotations
308
- ? ast_1.kt.annotation(ast_1.kt.refs.swagger.schema(), [
307
+ ? index_js_1.kt.annotation(index_js_1.kt.refs.swagger.schema(), [
309
308
  property.schema.example !== undefined
310
- ? ast_1.kt.argument.named('example', ast_1.kt.string(String(property.schema.example)))
309
+ ? index_js_1.kt.argument.named('example', index_js_1.kt.string(String(property.schema.example)))
311
310
  : null,
312
- schema.required.has(property.name) ? ast_1.kt.argument.named('required', 'true') : null,
311
+ schema.required.has(property.name) ? index_js_1.kt.argument.named('required', 'true') : null,
313
312
  property.schema.description !== undefined
314
- ? ast_1.kt.argument.named('description', ast_1.kt.string(property.schema.description))
313
+ ? index_js_1.kt.argument.named('description', index_js_1.kt.string(property.schema.description))
315
314
  : null,
316
- property.schema.deprecated ? ast_1.kt.argument.named('deprecated', ast_1.kt.toNode(property.schema.deprecated)) : null,
315
+ property.schema.deprecated ? index_js_1.kt.argument.named('deprecated', index_js_1.kt.toNode(property.schema.deprecated)) : null,
317
316
  ])
318
317
  : null;
319
318
  }
320
319
  // #endregion
321
320
  getPackageName(ctx, args) {
322
321
  const { schema } = args;
323
- const packageSuffix = typeof ctx.config.packageSuffix === 'string' ? ctx.config.packageSuffix : ctx.config.packageSuffix(schema);
322
+ const packageSuffix = typeof ctx.config.packageSuffix === 'string'
323
+ ? ctx.config.packageSuffix
324
+ : ctx.config.packageSuffix(schema);
324
325
  return ctx.config.packageName + packageSuffix;
325
326
  }
326
327
  shouldGenerateTypeDeclaration(ctx, args) {
@@ -392,7 +393,7 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
392
393
  }
393
394
  return [...this.sortProperties(ctx, { schema, properties }), ...appendedProperties];
394
395
  }
395
- sortProperties(ctx, args) {
396
+ sortProperties(_ctx, args) {
396
397
  return [...args.properties].sort((a, b) => classify(a) - classify(b));
397
398
  function classify(p) {
398
399
  if (p.schema.default !== undefined)
@@ -405,10 +406,11 @@ class DefaultKotlinModelGenerator extends file_generator_1.KotlinFileGenerator {
405
406
  normalizeSchema(ctx, args) {
406
407
  let { schema } = args;
407
408
  if (schema.kind === 'oneOf') {
408
- schema =
409
- ctx.config.oneOfBehavior === 'treat-as-any-of'
410
- ? { ...schema, kind: 'combined', anyOf: schema.oneOf, allOf: [], oneOf: undefined }
411
- : { ...schema, kind: 'combined', allOf: schema.oneOf, anyOf: [], oneOf: undefined };
409
+ schema = ctx.config.oneOfBehavior === 'treat-as-any-of'
410
+ // deno-lint-ignore no-explicit-any
411
+ ? { ...schema, kind: 'combined', anyOf: schema.oneOf, allOf: [], oneOf: undefined }
412
+ // deno-lint-ignore no-explicit-any
413
+ : { ...schema, kind: 'combined', allOf: schema.oneOf, anyOf: [], oneOf: undefined };
412
414
  ctx.schema = schema;
413
415
  }
414
416
  if (schema.kind === 'object' || schema.kind === 'combined') {
@@ -0,0 +1,18 @@
1
+ import { type ApiSchema, Factory, type MaybePromise, type OpenApiGeneratorContext, OpenApiSchemasGenerationProviderBase } from '@goast/core';
2
+ import { type KotlinModelGenerator } from './model-generator.js';
3
+ import { type KotlinModelGeneratorOutput, type KotlinModelsGeneratorConfig, type KotlinModelsGeneratorContext, type KotlinModelsGeneratorInput, type KotlinModelsGeneratorOutput } from './models.js';
4
+ type Input = KotlinModelsGeneratorInput;
5
+ type Output = KotlinModelsGeneratorOutput;
6
+ type Config = KotlinModelsGeneratorConfig;
7
+ type SchemaOutput = KotlinModelGeneratorOutput;
8
+ type Context = KotlinModelsGeneratorContext;
9
+ export declare class KotlinModelsGenerator extends OpenApiSchemasGenerationProviderBase<Input, Output, Config, SchemaOutput, Context> {
10
+ private readonly _modelGeneratorFactory;
11
+ constructor(modelGeneratorFactory?: Factory<KotlinModelGenerator, []>);
12
+ protected initResult(): Output;
13
+ protected buildContext(context: OpenApiGeneratorContext<KotlinModelsGeneratorInput>, config?: Partial<Config> | undefined): Context;
14
+ protected generateSchema(ctx: Context, schema: ApiSchema): MaybePromise<SchemaOutput>;
15
+ protected addSchemaResult(ctx: Context, schema: ApiSchema, result: SchemaOutput): void;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=models-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models-generator.d.ts","sourceRoot":"","sources":["../../../../src/lib/generators/models/models-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,oCAAoC,EACrC,MAAM,aAAa,CAAC;AAErB,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EACjC,MAAM,aAAa,CAAC;AAErB,KAAK,KAAK,GAAG,0BAA0B,CAAC;AACxC,KAAK,MAAM,GAAG,2BAA2B,CAAC;AAC1C,KAAK,MAAM,GAAG,2BAA2B,CAAC;AAC1C,KAAK,YAAY,GAAG,0BAA0B,CAAC;AAC/C,KAAK,OAAO,GAAG,4BAA4B,CAAC;AAE5C,qBAAa,qBAAsB,SAAQ,oCAAoC,CAC7E,KAAK,EACL,MAAM,EACN,MAAM,EACN,YAAY,EACZ,OAAO,CACR;IACC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAoC;gBAE/D,qBAAqB,CAAC,EAAE,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;cAKlD,UAAU,IAAI,MAAM;cAQpB,YAAY,CAC7B,OAAO,EAAE,uBAAuB,CAAC,0BAA0B,CAAC,EAC5D,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,GACnC,OAAO;cAIS,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC;cAQ3E,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI;CAGhG"}
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KotlinModelsGenerator = void 0;
4
4
  const core_1 = require("@goast/core");
5
- const model_generator_1 = require("./model-generator");
6
- const models_1 = require("./models");
5
+ const model_generator_js_1 = require("./model-generator.js");
6
+ const models_js_1 = require("./models.js");
7
7
  class KotlinModelsGenerator extends core_1.OpenApiSchemasGenerationProviderBase {
8
8
  constructor(modelGeneratorFactory) {
9
9
  super();
10
- this._modelGeneratorFactory = modelGeneratorFactory !== null && modelGeneratorFactory !== void 0 ? modelGeneratorFactory : core_1.Factory.fromValue(new model_generator_1.DefaultKotlinModelGenerator());
10
+ Object.defineProperty(this, "_modelGeneratorFactory", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: void 0
15
+ });
16
+ this._modelGeneratorFactory = modelGeneratorFactory !== null && modelGeneratorFactory !== void 0 ? modelGeneratorFactory : core_1.Factory.fromValue(new model_generator_js_1.DefaultKotlinModelGenerator());
11
17
  }
12
18
  initResult() {
13
19
  return {
@@ -17,7 +23,7 @@ class KotlinModelsGenerator extends core_1.OpenApiSchemasGenerationProviderBase
17
23
  };
18
24
  }
19
25
  buildContext(context, config) {
20
- return this.getProviderContext(context, config, models_1.defaultKotlinModelsGeneratorConfig);
26
+ return this.getProviderContext(context, config, models_js_1.defaultKotlinModelsGeneratorConfig);
21
27
  }
22
28
  generateSchema(ctx, schema) {
23
29
  const modelGenerator = this._modelGeneratorFactory.create();
@@ -0,0 +1,61 @@
1
+ import type { ApiSchema, DefaultGenerationProviderConfig, OpenApiSchemasGenerationProviderContext, SourceBuilder } from '@goast/core';
2
+ import type { kt } from '../../ast/index.js';
3
+ import { type KotlinGeneratorConfig } from '../../config.js';
4
+ export type KotlinModelsGeneratorConfig = KotlinGeneratorConfig & {
5
+ /**
6
+ * The package name for generated models.
7
+ * @default 'com.openapi.generated'
8
+ */
9
+ packageName: string;
10
+ /**
11
+ * The suffix to append to the package name for generated models.
12
+ * @default '.model'
13
+ */
14
+ packageSuffix: string | ((schema: ApiSchema) => string);
15
+ /**
16
+ * Determines how `oneOf` schemas should be treated.
17
+ * - `treat-as-any-of`: Treat `oneOf` schemas as `anyOf` schemas.
18
+ * - `treat-as-all-of`: Treat `oneOf` schemas as `allOf` schemas.
19
+ * @default 'treat-as-any-of'
20
+ */
21
+ oneOfBehavior: 'treat-as-any-of' | 'treat-as-all-of';
22
+ /**
23
+ * Determines how schemas of type `object` without properties should be treated.
24
+ * - `use-any`: Generate `Any` type for empty object schemas.
25
+ * - `generate-empty-class`: Generate an empty class for empty object schemas.
26
+ * @default 'generate-empty-class'
27
+ */
28
+ emptyObjectTypeBehavior: 'use-any' | 'generate-empty-class';
29
+ /**
30
+ * Whether to add Jackson annotations to generated models.
31
+ * @default true
32
+ */
33
+ addJacksonAnnotations: boolean;
34
+ /**
35
+ * Whether to add Jakarta Validation annotations to generated models.
36
+ * @default true
37
+ */
38
+ addJakartaValidationAnnotations: boolean;
39
+ /**
40
+ * Whether to add Swagger annotations to generated models.
41
+ * @default true
42
+ */
43
+ addSwaggerAnnotations: boolean;
44
+ };
45
+ export declare const defaultKotlinModelsGeneratorConfig: DefaultGenerationProviderConfig<KotlinModelsGeneratorConfig>;
46
+ export type KotlinModelsGeneratorInput = {};
47
+ export type KotlinModelsGeneratorOutput = {
48
+ kotlin: {
49
+ models: {
50
+ [schemaId: string]: KotlinModelGeneratorOutput;
51
+ };
52
+ };
53
+ };
54
+ export type KotlinModelGeneratorOutput = {
55
+ type: kt.Reference<SourceBuilder>;
56
+ };
57
+ export type KotlinModelsGeneratorContext = OpenApiSchemasGenerationProviderContext<KotlinModelsGeneratorInput, KotlinModelsGeneratorOutput, KotlinModelsGeneratorConfig, KotlinModelGeneratorOutput>;
58
+ export type KotlinModelGeneratorContext = KotlinModelsGeneratorContext & {
59
+ schema: ApiSchema;
60
+ };
61
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/lib/generators/models/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,uCAAuC,EACvC,aAAa,EACd,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE3F,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,GAAG;IAChE;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;IAExD;;;;;OAKG;IACH,aAAa,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;IAErD;;;;;OAKG;IACH,uBAAuB,EAAE,SAAS,GAAG,sBAAsB,CAAC;IAE5D;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,+BAA+B,EAAE,OAAO,CAAC;IAEzC;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,+BAA+B,CAAC,2BAA2B,CAY3G,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE5C,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,CAAC;SAChD,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IAAE,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,4BAA4B,GAAG,uCAAuC,CAChF,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,CAC3B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,4BAA4B,GAAG;IACvE,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultKotlinModelsGeneratorConfig = void 0;
4
- const config_1 = require("../../config");
4
+ const config_js_1 = require("../../config.js");
5
5
  exports.defaultKotlinModelsGeneratorConfig = {
6
- ...config_1.defaultKotlinGeneratorConfig,
6
+ ...config_js_1.defaultKotlinGeneratorConfig,
7
7
  packageName: 'com.openapi.generated',
8
8
  packageSuffix: '.model',
9
9
  oneOfBehavior: 'treat-as-any-of',
@@ -0,0 +1,76 @@
1
+ import type { ApiEndpoint, ApiParameter, ApiSchema, SourceBuilder } from '@goast/core';
2
+ import type { kt } from '../../../ast/index.js';
3
+ import type { ApiParameterWithMultipartInfo } from '../../../types.js';
4
+ export type GetClientFileContent = object;
5
+ export type GetClientClass = object;
6
+ export type GetClientCompanionObject = object;
7
+ export type GetEndpointClientMembers = {
8
+ endpoint: ApiEndpoint;
9
+ parameters: ApiParameter[];
10
+ };
11
+ export type GetEndpointClientMethod = {
12
+ endpoint: ApiEndpoint;
13
+ parameters: ApiParameter[];
14
+ responseSchema: ApiSchema | undefined;
15
+ };
16
+ export type GetEndpointClientMethodBody = {
17
+ endpoint: ApiEndpoint;
18
+ parameters: ApiParameter[];
19
+ responseSchema: ApiSchema | undefined;
20
+ };
21
+ export type GetEndpointClientHttpInfoMethod = {
22
+ endpoint: ApiEndpoint;
23
+ parameters: ApiParameter[];
24
+ responseSchema: ApiSchema | undefined;
25
+ };
26
+ export type GetEndpointClientHttpInfoMethodBody = {
27
+ endpoint: ApiEndpoint;
28
+ parameters: ApiParameter[];
29
+ responseSchema: ApiSchema | undefined;
30
+ };
31
+ export type GetEndpointClientRequestConfigMethod = {
32
+ endpoint: ApiEndpoint;
33
+ parameters: ApiParameter[];
34
+ };
35
+ export type GetEndpointClientRequestConfigMethodBody = {
36
+ endpoint: ApiEndpoint;
37
+ parameters: ApiParameterWithMultipartInfo[];
38
+ };
39
+ export type GetAdditionalClientMembers = object;
40
+ export type GetParameterType = {
41
+ endpoint: ApiEndpoint;
42
+ parameter: ApiParameterWithMultipartInfo;
43
+ };
44
+ export type GetRequestBodyType = {
45
+ endpoint: ApiEndpoint;
46
+ };
47
+ export type GetTypeUsage<TBuilder extends SourceBuilder> = {
48
+ schema: ApiSchema | undefined;
49
+ nullable?: boolean;
50
+ fallback?: kt.Type<TBuilder>;
51
+ };
52
+ export type GetPackageName = object;
53
+ export type GetPathWithInterpolation = {
54
+ endpoint: ApiEndpoint;
55
+ };
56
+ export type GetResponseSchema = {
57
+ endpoint: ApiEndpoint;
58
+ };
59
+ export type GetSchemaType = {
60
+ schema: ApiSchema | undefined;
61
+ };
62
+ export type GetAllParameters = {
63
+ endpoint: ApiEndpoint;
64
+ };
65
+ export type GetRequestBodyParamName = {
66
+ endpoint: ApiEndpoint;
67
+ };
68
+ export type GetBasePath = object;
69
+ export type GetEndpointPath = {
70
+ endpoint: ApiEndpoint;
71
+ };
72
+ export type GetFilePath = {
73
+ packageName: string;
74
+ };
75
+ export type GetApiClientName = object;
76
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../../../../src/lib/generators/services/okhttp3-clients/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,wBAAwB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC;AAE7F,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,6BAA6B,EAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,6BAA6B,CAAA;CAAE,CAAC;AAEnG,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,aAAa,IAAI;IACzD,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,MAAM,MAAM,wBAAwB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './models.js';
2
+ export * from './okhttp3-client-generator.js';
3
+ export * from './okhttp3-clients-generator.js';
4
+ export * as DefaultKotlinOkHttp3GeneratorArgs from './args.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/generators/services/okhttp3-clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,OAAO,KAAK,iCAAiC,MAAM,WAAW,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultKotlinOkHttp3GeneratorArgs = void 0;
4
4
  const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./models"), exports);
6
- tslib_1.__exportStar(require("./okhttp3-client-generator"), exports);
7
- tslib_1.__exportStar(require("./okhttp3-clients-generator"), exports);
8
- exports.DefaultKotlinOkHttp3GeneratorArgs = tslib_1.__importStar(require("./args"));
5
+ tslib_1.__exportStar(require("./models.js"), exports);
6
+ tslib_1.__exportStar(require("./okhttp3-client-generator.js"), exports);
7
+ tslib_1.__exportStar(require("./okhttp3-clients-generator.js"), exports);
8
+ exports.DefaultKotlinOkHttp3GeneratorArgs = tslib_1.__importStar(require("./args.js"));