@goast/kotlin 0.6.0 → 0.7.0-beta.2

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 (584) hide show
  1. package/README.md +0 -1
  2. package/dist/mod.d.ts +8 -0
  3. package/{esm → dist}/src/assets.d.ts +0 -1
  4. package/dist/src/assets.js +5 -0
  5. package/{esm → dist}/src/ast/_index.d.ts +28 -29
  6. package/{esm → dist}/src/ast/_index.js +2 -0
  7. package/dist/src/ast/index.d.ts +1 -0
  8. package/{esm → dist}/src/ast/node.d.ts +0 -1
  9. package/{script → dist}/src/ast/nodes/annotation.d.ts +5 -6
  10. package/{esm → dist}/src/ast/nodes/annotation.js +5 -21
  11. package/{esm → dist}/src/ast/nodes/argument.d.ts +5 -6
  12. package/{esm → dist}/src/ast/nodes/argument.js +3 -14
  13. package/{esm → dist}/src/ast/nodes/call.d.ts +5 -6
  14. package/{esm → dist}/src/ast/nodes/call.js +6 -23
  15. package/{esm → dist}/src/ast/nodes/class.d.ts +15 -16
  16. package/dist/src/ast/nodes/class.js +100 -0
  17. package/{esm → dist}/src/ast/nodes/collection-literal.d.ts +4 -5
  18. package/{esm → dist}/src/ast/nodes/collection-literal.js +2 -8
  19. package/{esm → dist}/src/ast/nodes/constructor.d.ts +8 -9
  20. package/{esm → dist}/src/ast/nodes/constructor.js +13 -44
  21. package/{esm → dist}/src/ast/nodes/doc-tag.d.ts +2 -3
  22. package/{esm → dist}/src/ast/nodes/doc-tag.js +5 -21
  23. package/{esm → dist}/src/ast/nodes/doc.d.ts +6 -7
  24. package/{esm → dist}/src/ast/nodes/doc.js +14 -20
  25. package/{script → dist}/src/ast/nodes/enum-value.d.ts +8 -9
  26. package/{esm → dist}/src/ast/nodes/enum-value.js +10 -37
  27. package/{script → dist}/src/ast/nodes/enum.d.ts +15 -16
  28. package/dist/src/ast/nodes/enum.js +86 -0
  29. package/{esm → dist}/src/ast/nodes/function.d.ts +9 -10
  30. package/dist/src/ast/nodes/function.js +120 -0
  31. package/{esm → dist}/src/ast/nodes/generic-parameter.d.ts +4 -5
  32. package/dist/src/ast/nodes/generic-parameter.js +27 -0
  33. package/{esm → dist}/src/ast/nodes/init-block.d.ts +3 -4
  34. package/{esm → dist}/src/ast/nodes/init-block.js +1 -6
  35. package/{esm → dist}/src/ast/nodes/interface.d.ts +13 -14
  36. package/dist/src/ast/nodes/interface.js +70 -0
  37. package/{esm → dist}/src/ast/nodes/lambda-type.d.ts +4 -5
  38. package/{esm → dist}/src/ast/nodes/lambda-type.js +7 -28
  39. package/{esm → dist}/src/ast/nodes/lambda.d.ts +3 -4
  40. package/{esm → dist}/src/ast/nodes/lambda.js +6 -22
  41. package/{script → dist}/src/ast/nodes/object.d.ts +7 -8
  42. package/dist/src/ast/nodes/object.js +60 -0
  43. package/{esm → dist}/src/ast/nodes/parameter.d.ts +7 -8
  44. package/dist/src/ast/nodes/parameter.js +63 -0
  45. package/{esm → dist}/src/ast/nodes/property.d.ts +10 -11
  46. package/dist/src/ast/nodes/property.js +144 -0
  47. package/{script → dist}/src/ast/nodes/reference.d.ts +5 -6
  48. package/{esm → dist}/src/ast/nodes/reference.js +19 -56
  49. package/{esm → dist}/src/ast/nodes/string.d.ts +3 -4
  50. package/{esm → dist}/src/ast/nodes/string.js +13 -45
  51. package/{esm → dist}/src/ast/nodes/types.d.ts +7 -8
  52. package/dist/src/ast/references/index.d.ts +10 -0
  53. package/{script → dist}/src/ast/references/jackson.d.ts +2 -3
  54. package/{script → dist}/src/ast/references/jakarta.d.ts +1 -2
  55. package/{esm → dist}/src/ast/references/java.d.ts +1 -2
  56. package/{esm → dist}/src/ast/references/kotlin.d.ts +1 -2
  57. package/{esm → dist}/src/ast/references/kotlinx.d.ts +1 -2
  58. package/{esm → dist}/src/ast/references/okhttp3.d.ts +1 -2
  59. package/{esm → dist}/src/ast/references/reactor.d.ts +1 -2
  60. package/{esm → dist}/src/ast/references/spring-reactive.d.ts +1 -2
  61. package/{script → dist}/src/ast/references/spring.d.ts +1 -2
  62. package/{script → dist}/src/ast/references/swagger.d.ts +1 -2
  63. package/{esm → dist}/src/ast/utils/get-kotlin-builder-options.d.ts +1 -2
  64. package/{esm → dist}/src/ast/utils/to-kt-node.d.ts +2 -3
  65. package/{esm → dist}/src/ast/utils/write-kt-annotations.d.ts +1 -2
  66. package/{esm → dist}/src/ast/utils/write-kt-annotations.js +1 -1
  67. package/{esm → dist}/src/ast/utils/write-kt-arguments.d.ts +1 -2
  68. package/{script → dist}/src/ast/utils/write-kt-enum-values.d.ts +1 -2
  69. package/{script → dist}/src/ast/utils/write-kt-generic-parameters.d.ts +1 -2
  70. package/{script → dist}/src/ast/utils/write-kt-members.d.ts +1 -2
  71. package/{esm → dist}/src/ast/utils/write-kt-members.js +1 -1
  72. package/{script → dist}/src/ast/utils/write-kt-node.d.ts +1 -2
  73. package/{esm → dist}/src/ast/utils/write-kt-node.js +1 -1
  74. package/{esm → dist}/src/ast/utils/write-kt-parameters.d.ts +1 -2
  75. package/{esm → dist}/src/common-results.d.ts +0 -1
  76. package/{script → dist}/src/config.d.ts +0 -1
  77. package/{esm → dist}/src/file-builder.d.ts +3 -4
  78. package/{esm → dist}/src/file-builder.js +4 -14
  79. package/{esm → dist}/src/generators/file-generator.d.ts +1 -2
  80. package/{esm → dist}/src/generators/file-generator.js +2 -2
  81. package/dist/src/generators/index.d.ts +5 -0
  82. package/{esm → dist}/src/generators/models/args.d.ts +0 -1
  83. package/dist/src/generators/models/index.d.ts +4 -0
  84. package/{esm → dist}/src/generators/models/model-generator.d.ts +5 -6
  85. package/{esm → dist}/src/generators/models/model-generator.js +40 -48
  86. package/{script → dist}/src/generators/models/models-generator.d.ts +2 -3
  87. package/{esm → dist}/src/generators/models/models-generator.js +2 -7
  88. package/{script → dist}/src/generators/models/models.d.ts +2 -3
  89. package/{esm → dist}/src/generators/services/okhttp3-clients/args.d.ts +2 -3
  90. package/dist/src/generators/services/okhttp3-clients/index.d.ts +4 -0
  91. package/{esm → dist}/src/generators/services/okhttp3-clients/models.d.ts +5 -6
  92. package/{script → dist}/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +6 -7
  93. package/{esm → dist}/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +36 -40
  94. package/{script → dist}/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts +3 -4
  95. package/{esm → dist}/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +7 -15
  96. package/{script → dist}/src/generators/services/okhttp3-clients/refs.d.ts +1 -2
  97. package/{esm → dist}/src/generators/services/spring-controllers/args.d.ts +2 -3
  98. package/dist/src/generators/services/spring-controllers/index.d.ts +4 -0
  99. package/{script → dist}/src/generators/services/spring-controllers/models.d.ts +4 -5
  100. package/dist/src/generators/services/spring-controllers/refs.d.ts +5 -0
  101. package/{script → dist}/src/generators/services/spring-controllers/spring-controller-generator.d.ts +7 -8
  102. package/{esm → dist}/src/generators/services/spring-controllers/spring-controller-generator.js +85 -159
  103. package/{script → dist}/src/generators/services/spring-controllers/spring-controllers-generator.d.ts +4 -5
  104. package/{esm → dist}/src/generators/services/spring-controllers/spring-controllers-generator.js +5 -12
  105. package/{esm → dist}/src/generators/services/spring-reactive-web-clients/args.d.ts +2 -3
  106. package/dist/src/generators/services/spring-reactive-web-clients/index.d.ts +4 -0
  107. package/{script → dist}/src/generators/services/spring-reactive-web-clients/models.d.ts +4 -5
  108. package/{script → dist}/src/generators/services/spring-reactive-web-clients/refs.d.ts +1 -2
  109. package/{script → dist}/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts +6 -7
  110. package/{esm → dist}/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +49 -56
  111. package/{script → dist}/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.d.ts +3 -4
  112. package/{esm → dist}/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.js +5 -12
  113. package/{esm → dist}/src/import-collection.d.ts +1 -2
  114. package/{esm → dist}/src/import-collection.js +2 -12
  115. package/{script → dist}/src/types.d.ts +0 -1
  116. package/{esm → dist}/src/utils.d.ts +0 -1
  117. package/{esm → dist}/src/utils.js +3 -5
  118. package/package.json +25 -14
  119. package/esm/mod.d.ts +0 -9
  120. package/esm/mod.d.ts.map +0 -1
  121. package/esm/package.json +0 -3
  122. package/esm/src/assets.d.ts.map +0 -1
  123. package/esm/src/assets.js +0 -6
  124. package/esm/src/ast/_index.d.ts.map +0 -1
  125. package/esm/src/ast/common.d.ts +0 -2
  126. package/esm/src/ast/common.d.ts.map +0 -1
  127. package/esm/src/ast/index.d.ts +0 -2
  128. package/esm/src/ast/index.d.ts.map +0 -1
  129. package/esm/src/ast/node.d.ts.map +0 -1
  130. package/esm/src/ast/nodes/annotation.d.ts +0 -25
  131. package/esm/src/ast/nodes/annotation.d.ts.map +0 -1
  132. package/esm/src/ast/nodes/argument.d.ts.map +0 -1
  133. package/esm/src/ast/nodes/call.d.ts.map +0 -1
  134. package/esm/src/ast/nodes/class.d.ts.map +0 -1
  135. package/esm/src/ast/nodes/class.js +0 -168
  136. package/esm/src/ast/nodes/collection-literal.d.ts.map +0 -1
  137. package/esm/src/ast/nodes/constructor.d.ts.map +0 -1
  138. package/esm/src/ast/nodes/doc-tag.d.ts.map +0 -1
  139. package/esm/src/ast/nodes/doc.d.ts.map +0 -1
  140. package/esm/src/ast/nodes/enum-value.d.ts +0 -32
  141. package/esm/src/ast/nodes/enum-value.d.ts.map +0 -1
  142. package/esm/src/ast/nodes/enum.d.ts +0 -47
  143. package/esm/src/ast/nodes/enum.d.ts.map +0 -1
  144. package/esm/src/ast/nodes/enum.js +0 -133
  145. package/esm/src/ast/nodes/function.d.ts.map +0 -1
  146. package/esm/src/ast/nodes/function.js +0 -217
  147. package/esm/src/ast/nodes/generic-parameter.d.ts.map +0 -1
  148. package/esm/src/ast/nodes/generic-parameter.js +0 -44
  149. package/esm/src/ast/nodes/init-block.d.ts.map +0 -1
  150. package/esm/src/ast/nodes/interface.d.ts.map +0 -1
  151. package/esm/src/ast/nodes/interface.js +0 -112
  152. package/esm/src/ast/nodes/lambda-type.d.ts.map +0 -1
  153. package/esm/src/ast/nodes/lambda.d.ts.map +0 -1
  154. package/esm/src/ast/nodes/object.d.ts +0 -36
  155. package/esm/src/ast/nodes/object.d.ts.map +0 -1
  156. package/esm/src/ast/nodes/object.js +0 -96
  157. package/esm/src/ast/nodes/parameter.d.ts.map +0 -1
  158. package/esm/src/ast/nodes/parameter.js +0 -114
  159. package/esm/src/ast/nodes/property.d.ts.map +0 -1
  160. package/esm/src/ast/nodes/property.js +0 -264
  161. package/esm/src/ast/nodes/reference.d.ts +0 -54
  162. package/esm/src/ast/nodes/reference.d.ts.map +0 -1
  163. package/esm/src/ast/nodes/string.d.ts.map +0 -1
  164. package/esm/src/ast/nodes/types.d.ts.map +0 -1
  165. package/esm/src/ast/references/index.d.ts +0 -11
  166. package/esm/src/ast/references/index.d.ts.map +0 -1
  167. package/esm/src/ast/references/jackson.d.ts +0 -26
  168. package/esm/src/ast/references/jackson.d.ts.map +0 -1
  169. package/esm/src/ast/references/jakarta.d.ts +0 -9
  170. package/esm/src/ast/references/jakarta.d.ts.map +0 -1
  171. package/esm/src/ast/references/java.d.ts.map +0 -1
  172. package/esm/src/ast/references/kotlin.d.ts.map +0 -1
  173. package/esm/src/ast/references/kotlinx.d.ts.map +0 -1
  174. package/esm/src/ast/references/okhttp3.d.ts.map +0 -1
  175. package/esm/src/ast/references/reactor.d.ts.map +0 -1
  176. package/esm/src/ast/references/spring-reactive.d.ts.map +0 -1
  177. package/esm/src/ast/references/spring.d.ts +0 -22
  178. package/esm/src/ast/references/spring.d.ts.map +0 -1
  179. package/esm/src/ast/references/swagger.d.ts +0 -9
  180. package/esm/src/ast/references/swagger.d.ts.map +0 -1
  181. package/esm/src/ast/utils/get-kotlin-builder-options.d.ts.map +0 -1
  182. package/esm/src/ast/utils/to-kt-node.d.ts.map +0 -1
  183. package/esm/src/ast/utils/write-kt-annotations.d.ts.map +0 -1
  184. package/esm/src/ast/utils/write-kt-arguments.d.ts.map +0 -1
  185. package/esm/src/ast/utils/write-kt-enum-values.d.ts +0 -4
  186. package/esm/src/ast/utils/write-kt-enum-values.d.ts.map +0 -1
  187. package/esm/src/ast/utils/write-kt-generic-parameters.d.ts +0 -4
  188. package/esm/src/ast/utils/write-kt-generic-parameters.d.ts.map +0 -1
  189. package/esm/src/ast/utils/write-kt-members.d.ts +0 -6
  190. package/esm/src/ast/utils/write-kt-members.d.ts.map +0 -1
  191. package/esm/src/ast/utils/write-kt-node.d.ts +0 -8
  192. package/esm/src/ast/utils/write-kt-node.d.ts.map +0 -1
  193. package/esm/src/ast/utils/write-kt-parameters.d.ts.map +0 -1
  194. package/esm/src/common-results.d.ts.map +0 -1
  195. package/esm/src/config.d.ts +0 -27
  196. package/esm/src/config.d.ts.map +0 -1
  197. package/esm/src/file-builder.d.ts.map +0 -1
  198. package/esm/src/generators/file-generator.d.ts.map +0 -1
  199. package/esm/src/generators/index.d.ts +0 -6
  200. package/esm/src/generators/index.d.ts.map +0 -1
  201. package/esm/src/generators/models/args.d.ts.map +0 -1
  202. package/esm/src/generators/models/index.d.ts +0 -5
  203. package/esm/src/generators/models/index.d.ts.map +0 -1
  204. package/esm/src/generators/models/model-generator.d.ts.map +0 -1
  205. package/esm/src/generators/models/models-generator.d.ts +0 -18
  206. package/esm/src/generators/models/models-generator.d.ts.map +0 -1
  207. package/esm/src/generators/models/models.d.ts +0 -61
  208. package/esm/src/generators/models/models.d.ts.map +0 -1
  209. package/esm/src/generators/services/okhttp3-clients/args.d.ts.map +0 -1
  210. package/esm/src/generators/services/okhttp3-clients/index.d.ts +0 -5
  211. package/esm/src/generators/services/okhttp3-clients/index.d.ts.map +0 -1
  212. package/esm/src/generators/services/okhttp3-clients/models.d.ts.map +0 -1
  213. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +0 -55
  214. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +0 -1
  215. package/esm/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts +0 -23
  216. package/esm/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +0 -1
  217. package/esm/src/generators/services/okhttp3-clients/refs.d.ts +0 -22
  218. package/esm/src/generators/services/okhttp3-clients/refs.d.ts.map +0 -1
  219. package/esm/src/generators/services/spring-controllers/args.d.ts.map +0 -1
  220. package/esm/src/generators/services/spring-controllers/index.d.ts +0 -5
  221. package/esm/src/generators/services/spring-controllers/index.d.ts.map +0 -1
  222. package/esm/src/generators/services/spring-controllers/models.d.ts +0 -38
  223. package/esm/src/generators/services/spring-controllers/models.d.ts.map +0 -1
  224. package/esm/src/generators/services/spring-controllers/refs.d.ts +0 -6
  225. package/esm/src/generators/services/spring-controllers/refs.d.ts.map +0 -1
  226. package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts +0 -58
  227. package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +0 -1
  228. package/esm/src/generators/services/spring-controllers/spring-controllers-generator.d.ts +0 -24
  229. package/esm/src/generators/services/spring-controllers/spring-controllers-generator.d.ts.map +0 -1
  230. package/esm/src/generators/services/spring-reactive-web-clients/args.d.ts.map +0 -1
  231. package/esm/src/generators/services/spring-reactive-web-clients/index.d.ts +0 -5
  232. package/esm/src/generators/services/spring-reactive-web-clients/index.d.ts.map +0 -1
  233. package/esm/src/generators/services/spring-reactive-web-clients/models.d.ts +0 -48
  234. package/esm/src/generators/services/spring-reactive-web-clients/models.d.ts.map +0 -1
  235. package/esm/src/generators/services/spring-reactive-web-clients/refs.d.ts +0 -5
  236. package/esm/src/generators/services/spring-reactive-web-clients/refs.d.ts.map +0 -1
  237. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts +0 -62
  238. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +0 -1
  239. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.d.ts +0 -23
  240. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.d.ts.map +0 -1
  241. package/esm/src/import-collection.d.ts.map +0 -1
  242. package/esm/src/types.d.ts +0 -8
  243. package/esm/src/types.d.ts.map +0 -1
  244. package/esm/src/utils.d.ts.map +0 -1
  245. package/script/mod.d.ts +0 -9
  246. package/script/mod.d.ts.map +0 -1
  247. package/script/mod.js +0 -11
  248. package/script/package.json +0 -3
  249. package/script/src/assets.d.ts +0 -3
  250. package/script/src/assets.d.ts.map +0 -1
  251. package/script/src/assets.js +0 -9
  252. package/script/src/ast/_index.d.ts +0 -29
  253. package/script/src/ast/_index.d.ts.map +0 -1
  254. package/script/src/ast/_index.js +0 -81
  255. package/script/src/ast/common.d.ts +0 -2
  256. package/script/src/ast/common.d.ts.map +0 -1
  257. package/script/src/ast/common.js +0 -2
  258. package/script/src/ast/index.d.ts +0 -2
  259. package/script/src/ast/index.d.ts.map +0 -1
  260. package/script/src/ast/index.js +0 -5
  261. package/script/src/ast/node.d.ts +0 -5
  262. package/script/src/ast/node.d.ts.map +0 -1
  263. package/script/src/ast/node.js +0 -10
  264. package/script/src/ast/nodes/annotation.d.ts.map +0 -1
  265. package/script/src/ast/nodes/annotation.js +0 -57
  266. package/script/src/ast/nodes/argument.d.ts +0 -23
  267. package/script/src/ast/nodes/argument.d.ts.map +0 -1
  268. package/script/src/ast/nodes/argument.js +0 -44
  269. package/script/src/ast/nodes/call.d.ts +0 -24
  270. package/script/src/ast/nodes/call.d.ts.map +0 -1
  271. package/script/src/ast/nodes/call.js +0 -65
  272. package/script/src/ast/nodes/class.d.ts +0 -56
  273. package/script/src/ast/nodes/class.d.ts.map +0 -1
  274. package/script/src/ast/nodes/class.js +0 -172
  275. package/script/src/ast/nodes/collection-literal.d.ts +0 -19
  276. package/script/src/ast/nodes/collection-literal.d.ts.map +0 -1
  277. package/script/src/ast/nodes/collection-literal.js +0 -30
  278. package/script/src/ast/nodes/constructor.d.ts +0 -36
  279. package/script/src/ast/nodes/constructor.d.ts.map +0 -1
  280. package/script/src/ast/nodes/constructor.js +0 -111
  281. package/script/src/ast/nodes/doc-tag.d.ts +0 -36
  282. package/script/src/ast/nodes/doc-tag.d.ts.map +0 -1
  283. package/script/src/ast/nodes/doc-tag.js +0 -78
  284. package/script/src/ast/nodes/doc.d.ts +0 -28
  285. package/script/src/ast/nodes/doc.d.ts.map +0 -1
  286. package/script/src/ast/nodes/doc.js +0 -67
  287. package/script/src/ast/nodes/enum-value.d.ts.map +0 -1
  288. package/script/src/ast/nodes/enum-value.js +0 -80
  289. package/script/src/ast/nodes/enum.d.ts.map +0 -1
  290. package/script/src/ast/nodes/enum.js +0 -137
  291. package/script/src/ast/nodes/function.d.ts +0 -60
  292. package/script/src/ast/nodes/function.d.ts.map +0 -1
  293. package/script/src/ast/nodes/function.js +0 -221
  294. package/script/src/ast/nodes/generic-parameter.d.ts +0 -23
  295. package/script/src/ast/nodes/generic-parameter.d.ts.map +0 -1
  296. package/script/src/ast/nodes/generic-parameter.js +0 -48
  297. package/script/src/ast/nodes/init-block.d.ts +0 -18
  298. package/script/src/ast/nodes/init-block.d.ts.map +0 -1
  299. package/script/src/ast/nodes/init-block.js +0 -25
  300. package/script/src/ast/nodes/interface.d.ts +0 -43
  301. package/script/src/ast/nodes/interface.d.ts.map +0 -1
  302. package/script/src/ast/nodes/interface.js +0 -116
  303. package/script/src/ast/nodes/lambda-type.d.ts +0 -25
  304. package/script/src/ast/nodes/lambda-type.d.ts.map +0 -1
  305. package/script/src/ast/nodes/lambda-type.js +0 -69
  306. package/script/src/ast/nodes/lambda.d.ts +0 -22
  307. package/script/src/ast/nodes/lambda.d.ts.map +0 -1
  308. package/script/src/ast/nodes/lambda.js +0 -59
  309. package/script/src/ast/nodes/object.d.ts.map +0 -1
  310. package/script/src/ast/nodes/object.js +0 -100
  311. package/script/src/ast/nodes/parameter.d.ts +0 -41
  312. package/script/src/ast/nodes/parameter.d.ts.map +0 -1
  313. package/script/src/ast/nodes/parameter.js +0 -118
  314. package/script/src/ast/nodes/property.d.ts +0 -79
  315. package/script/src/ast/nodes/property.d.ts.map +0 -1
  316. package/script/src/ast/nodes/property.js +0 -271
  317. package/script/src/ast/nodes/reference.d.ts.map +0 -1
  318. package/script/src/ast/nodes/reference.js +0 -120
  319. package/script/src/ast/nodes/string.d.ts +0 -32
  320. package/script/src/ast/nodes/string.d.ts.map +0 -1
  321. package/script/src/ast/nodes/string.js +0 -123
  322. package/script/src/ast/nodes/types.d.ts +0 -11
  323. package/script/src/ast/nodes/types.d.ts.map +0 -1
  324. package/script/src/ast/nodes/types.js +0 -2
  325. package/script/src/ast/references/index.d.ts +0 -11
  326. package/script/src/ast/references/index.d.ts.map +0 -1
  327. package/script/src/ast/references/index.js +0 -14
  328. package/script/src/ast/references/jackson.d.ts.map +0 -1
  329. package/script/src/ast/references/jackson.js +0 -41
  330. package/script/src/ast/references/jakarta.d.ts.map +0 -1
  331. package/script/src/ast/references/jakarta.js +0 -14
  332. package/script/src/ast/references/java.d.ts +0 -15
  333. package/script/src/ast/references/java.d.ts.map +0 -1
  334. package/script/src/ast/references/java.js +0 -22
  335. package/script/src/ast/references/kotlin.d.ts +0 -24
  336. package/script/src/ast/references/kotlin.d.ts.map +0 -1
  337. package/script/src/ast/references/kotlin.js +0 -29
  338. package/script/src/ast/references/kotlinx.d.ts +0 -5
  339. package/script/src/ast/references/kotlinx.d.ts.map +0 -1
  340. package/script/src/ast/references/kotlinx.js +0 -9
  341. package/script/src/ast/references/okhttp3.d.ts +0 -4
  342. package/script/src/ast/references/okhttp3.d.ts.map +0 -1
  343. package/script/src/ast/references/okhttp3.js +0 -7
  344. package/script/src/ast/references/reactor.d.ts +0 -4
  345. package/script/src/ast/references/reactor.d.ts.map +0 -1
  346. package/script/src/ast/references/reactor.js +0 -7
  347. package/script/src/ast/references/spring-reactive.d.ts +0 -10
  348. package/script/src/ast/references/spring-reactive.d.ts.map +0 -1
  349. package/script/src/ast/references/spring-reactive.js +0 -14
  350. package/script/src/ast/references/spring.d.ts.map +0 -1
  351. package/script/src/ast/references/spring.js +0 -34
  352. package/script/src/ast/references/swagger.d.ts.map +0 -1
  353. package/script/src/ast/references/swagger.js +0 -14
  354. package/script/src/ast/utils/get-kotlin-builder-options.d.ts +0 -4
  355. package/script/src/ast/utils/get-kotlin-builder-options.d.ts.map +0 -1
  356. package/script/src/ast/utils/get-kotlin-builder-options.js +0 -18
  357. package/script/src/ast/utils/to-kt-node.d.ts +0 -8
  358. package/script/src/ast/utils/to-kt-node.d.ts.map +0 -1
  359. package/script/src/ast/utils/to-kt-node.js +0 -21
  360. package/script/src/ast/utils/write-kt-annotations.d.ts +0 -6
  361. package/script/src/ast/utils/write-kt-annotations.d.ts.map +0 -1
  362. package/script/src/ast/utils/write-kt-annotations.js +0 -12
  363. package/script/src/ast/utils/write-kt-arguments.d.ts +0 -4
  364. package/script/src/ast/utils/write-kt-arguments.d.ts.map +0 -1
  365. package/script/src/ast/utils/write-kt-arguments.js +0 -32
  366. package/script/src/ast/utils/write-kt-enum-values.d.ts.map +0 -1
  367. package/script/src/ast/utils/write-kt-enum-values.js +0 -16
  368. package/script/src/ast/utils/write-kt-generic-parameters.d.ts.map +0 -1
  369. package/script/src/ast/utils/write-kt-generic-parameters.js +0 -11
  370. package/script/src/ast/utils/write-kt-members.d.ts.map +0 -1
  371. package/script/src/ast/utils/write-kt-members.js +0 -15
  372. package/script/src/ast/utils/write-kt-node.d.ts.map +0 -1
  373. package/script/src/ast/utils/write-kt-node.js +0 -23
  374. package/script/src/ast/utils/write-kt-parameters.d.ts +0 -4
  375. package/script/src/ast/utils/write-kt-parameters.d.ts.map +0 -1
  376. package/script/src/ast/utils/write-kt-parameters.js +0 -12
  377. package/script/src/common-results.d.ts +0 -5
  378. package/script/src/common-results.d.ts.map +0 -1
  379. package/script/src/common-results.js +0 -2
  380. package/script/src/config.d.ts.map +0 -1
  381. package/script/src/config.js +0 -26
  382. package/script/src/file-builder.d.ts +0 -23
  383. package/script/src/file-builder.d.ts.map +0 -1
  384. package/script/src/file-builder.js +0 -92
  385. package/script/src/generators/file-generator.d.ts +0 -29
  386. package/script/src/generators/file-generator.d.ts.map +0 -1
  387. package/script/src/generators/file-generator.js +0 -56
  388. package/script/src/generators/index.d.ts +0 -6
  389. package/script/src/generators/index.d.ts.map +0 -1
  390. package/script/src/generators/index.js +0 -8
  391. package/script/src/generators/models/args.d.ts +0 -111
  392. package/script/src/generators/models/args.d.ts.map +0 -1
  393. package/script/src/generators/models/args.js +0 -2
  394. package/script/src/generators/models/index.d.ts +0 -5
  395. package/script/src/generators/models/index.d.ts.map +0 -1
  396. package/script/src/generators/models/index.js +0 -8
  397. package/script/src/generators/models/model-generator.d.ts +0 -73
  398. package/script/src/generators/models/model-generator.d.ts.map +0 -1
  399. package/script/src/generators/models/model-generator.js +0 -645
  400. package/script/src/generators/models/models-generator.d.ts.map +0 -1
  401. package/script/src/generators/models/models-generator.js +0 -39
  402. package/script/src/generators/models/models.d.ts.map +0 -1
  403. package/script/src/generators/models/models.js +0 -14
  404. package/script/src/generators/services/okhttp3-clients/args.d.ts +0 -87
  405. package/script/src/generators/services/okhttp3-clients/args.d.ts.map +0 -1
  406. package/script/src/generators/services/okhttp3-clients/args.js +0 -2
  407. package/script/src/generators/services/okhttp3-clients/index.d.ts +0 -5
  408. package/script/src/generators/services/okhttp3-clients/index.d.ts.map +0 -1
  409. package/script/src/generators/services/okhttp3-clients/index.js +0 -8
  410. package/script/src/generators/services/okhttp3-clients/models.d.ts +0 -46
  411. package/script/src/generators/services/okhttp3-clients/models.d.ts.map +0 -1
  412. package/script/src/generators/services/okhttp3-clients/models.js +0 -12
  413. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +0 -1
  414. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +0 -441
  415. package/script/src/generators/services/okhttp3-clients/okhttp3-clients-generator.d.ts.map +0 -1
  416. package/script/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +0 -137
  417. package/script/src/generators/services/okhttp3-clients/refs.d.ts.map +0 -1
  418. package/script/src/generators/services/okhttp3-clients/refs.js +0 -35
  419. package/script/src/generators/services/spring-controllers/args.d.ts +0 -95
  420. package/script/src/generators/services/spring-controllers/args.d.ts.map +0 -1
  421. package/script/src/generators/services/spring-controllers/args.js +0 -2
  422. package/script/src/generators/services/spring-controllers/index.d.ts +0 -5
  423. package/script/src/generators/services/spring-controllers/index.d.ts.map +0 -1
  424. package/script/src/generators/services/spring-controllers/index.js +0 -8
  425. package/script/src/generators/services/spring-controllers/models.d.ts.map +0 -1
  426. package/script/src/generators/services/spring-controllers/models.js +0 -15
  427. package/script/src/generators/services/spring-controllers/refs.d.ts +0 -6
  428. package/script/src/generators/services/spring-controllers/refs.d.ts.map +0 -1
  429. package/script/src/generators/services/spring-controllers/refs.js +0 -12
  430. package/script/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +0 -1
  431. package/script/src/generators/services/spring-controllers/spring-controller-generator.js +0 -700
  432. package/script/src/generators/services/spring-controllers/spring-controllers-generator.d.ts.map +0 -1
  433. package/script/src/generators/services/spring-controllers/spring-controllers-generator.js +0 -80
  434. package/script/src/generators/services/spring-reactive-web-clients/args.d.ts +0 -115
  435. package/script/src/generators/services/spring-reactive-web-clients/args.d.ts.map +0 -1
  436. package/script/src/generators/services/spring-reactive-web-clients/args.js +0 -2
  437. package/script/src/generators/services/spring-reactive-web-clients/index.d.ts +0 -5
  438. package/script/src/generators/services/spring-reactive-web-clients/index.d.ts.map +0 -1
  439. package/script/src/generators/services/spring-reactive-web-clients/index.js +0 -8
  440. package/script/src/generators/services/spring-reactive-web-clients/models.d.ts.map +0 -1
  441. package/script/src/generators/services/spring-reactive-web-clients/models.js +0 -12
  442. package/script/src/generators/services/spring-reactive-web-clients/refs.d.ts.map +0 -1
  443. package/script/src/generators/services/spring-reactive-web-clients/refs.js +0 -11
  444. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +0 -1
  445. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +0 -453
  446. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.d.ts.map +0 -1
  447. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.js +0 -81
  448. package/script/src/import-collection.d.ts +0 -20
  449. package/script/src/import-collection.d.ts.map +0 -1
  450. package/script/src/import-collection.js +0 -90
  451. package/script/src/types.d.ts.map +0 -1
  452. package/script/src/types.js +0 -2
  453. package/script/src/utils.d.ts +0 -8
  454. package/script/src/utils.d.ts.map +0 -1
  455. package/script/src/utils.js +0 -54
  456. package/src/mod.ts +0 -8
  457. package/src/src/assets.ts +0 -9
  458. package/src/src/ast/_index.ts +0 -66
  459. package/src/src/ast/index.ts +0 -1
  460. package/src/src/ast/node.ts +0 -10
  461. package/src/src/ast/nodes/annotation.ts +0 -79
  462. package/src/src/ast/nodes/argument.ts +0 -62
  463. package/src/src/ast/nodes/call.ts +0 -75
  464. package/src/src/ast/nodes/class.ts +0 -178
  465. package/src/src/ast/nodes/collection-literal.ts +0 -49
  466. package/src/src/ast/nodes/constructor.ts +0 -126
  467. package/src/src/ast/nodes/doc-tag.ts +0 -138
  468. package/src/src/ast/nodes/doc.ts +0 -111
  469. package/src/src/ast/nodes/enum-value.ts +0 -100
  470. package/src/src/ast/nodes/enum.ts +0 -163
  471. package/src/src/ast/nodes/function.ts +0 -178
  472. package/src/src/ast/nodes/generic-parameter.ts +0 -54
  473. package/src/src/ast/nodes/init-block.ts +0 -38
  474. package/src/src/ast/nodes/interface.ts +0 -133
  475. package/src/src/ast/nodes/lambda-type.ts +0 -73
  476. package/src/src/ast/nodes/lambda.ts +0 -74
  477. package/src/src/ast/nodes/object.ts +0 -102
  478. package/src/src/ast/nodes/parameter.ts +0 -118
  479. package/src/src/ast/nodes/property.ts +0 -225
  480. package/src/src/ast/nodes/reference.ts +0 -178
  481. package/src/src/ast/nodes/string.ts +0 -114
  482. package/src/src/ast/nodes/types.ts +0 -23
  483. package/src/src/ast/references/index.ts +0 -10
  484. package/src/src/ast/references/jackson.ts +0 -70
  485. package/src/src/ast/references/jakarta.ts +0 -14
  486. package/src/src/ast/references/java.ts +0 -27
  487. package/src/src/ast/references/kotlin.ts +0 -41
  488. package/src/src/ast/references/kotlinx.ts +0 -14
  489. package/src/src/ast/references/okhttp3.ts +0 -5
  490. package/src/src/ast/references/reactor.ts +0 -5
  491. package/src/src/ast/references/spring-reactive.ts +0 -37
  492. package/src/src/ast/references/spring.ts +0 -86
  493. package/src/src/ast/references/swagger.ts +0 -23
  494. package/src/src/ast/utils/get-kotlin-builder-options.ts +0 -19
  495. package/src/src/ast/utils/to-kt-node.ts +0 -31
  496. package/src/src/ast/utils/write-kt-annotations.ts +0 -15
  497. package/src/src/ast/utils/write-kt-arguments.ts +0 -45
  498. package/src/src/ast/utils/write-kt-enum-values.ts +0 -27
  499. package/src/src/ast/utils/write-kt-generic-parameters.ts +0 -12
  500. package/src/src/ast/utils/write-kt-members.ts +0 -25
  501. package/src/src/ast/utils/write-kt-node.ts +0 -37
  502. package/src/src/ast/utils/write-kt-parameters.ts +0 -25
  503. package/src/src/common-results.ts +0 -4
  504. package/src/src/config.ts +0 -61
  505. package/src/src/file-builder.ts +0 -112
  506. package/src/src/generators/file-generator.ts +0 -71
  507. package/src/src/generators/index.ts +0 -5
  508. package/src/src/generators/models/args.ts +0 -142
  509. package/src/src/generators/models/index.ts +0 -4
  510. package/src/src/generators/models/model-generator.ts +0 -850
  511. package/src/src/generators/models/models-generator.ts +0 -65
  512. package/src/src/generators/models/models.ts +0 -95
  513. package/src/src/generators/services/okhttp3-clients/args.ts +0 -90
  514. package/src/src/generators/services/okhttp3-clients/index.ts +0 -4
  515. package/src/src/generators/services/okhttp3-clients/models.ts +0 -73
  516. package/src/src/generators/services/okhttp3-clients/okhttp3-client-generator.ts +0 -639
  517. package/src/src/generators/services/okhttp3-clients/okhttp3-clients-generator.ts +0 -190
  518. package/src/src/generators/services/okhttp3-clients/refs.ts +0 -59
  519. package/src/src/generators/services/spring-controllers/args.ts +0 -95
  520. package/src/src/generators/services/spring-controllers/index.ts +0 -4
  521. package/src/src/generators/services/spring-controllers/models.ts +0 -76
  522. package/src/src/generators/services/spring-controllers/refs.ts +0 -17
  523. package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +0 -1129
  524. package/src/src/generators/services/spring-controllers/spring-controllers-generator.ts +0 -140
  525. package/src/src/generators/services/spring-reactive-web-clients/args.ts +0 -114
  526. package/src/src/generators/services/spring-reactive-web-clients/index.ts +0 -4
  527. package/src/src/generators/services/spring-reactive-web-clients/models.ts +0 -78
  528. package/src/src/generators/services/spring-reactive-web-clients/refs.ts +0 -11
  529. package/src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.ts +0 -657
  530. package/src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.ts +0 -125
  531. package/src/src/import-collection.ts +0 -98
  532. package/src/src/types.ts +0 -3
  533. package/src/src/utils.ts +0 -55
  534. /package/{assets → dist/assets}/client/okhttp3/ApiAbstractions.kt +0 -0
  535. /package/{assets → dist/assets}/client/okhttp3/ApiClient.kt +0 -0
  536. /package/{assets → dist/assets}/client/okhttp3/ApiResponse.kt +0 -0
  537. /package/{assets → dist/assets}/client/okhttp3/Errors.kt +0 -0
  538. /package/{assets → dist/assets}/client/okhttp3/PartConfig.kt +0 -0
  539. /package/{assets → dist/assets}/client/okhttp3/RequestConfig.kt +0 -0
  540. /package/{assets → dist/assets}/client/okhttp3/RequestMethod.kt +0 -0
  541. /package/{assets → dist/assets}/client/okhttp3/ResponseExtensions.kt +0 -0
  542. /package/{assets → dist/assets}/client/spring-reactive-web-clients/ApiRequestFile.kt +0 -0
  543. /package/{esm → dist}/mod.js +0 -0
  544. /package/{src/src/ast/common.ts → dist/src/ast/common.d.ts} +0 -0
  545. /package/{esm → dist}/src/ast/common.js +0 -0
  546. /package/{esm → dist}/src/ast/index.js +0 -0
  547. /package/{esm → dist}/src/ast/node.js +0 -0
  548. /package/{esm → dist}/src/ast/nodes/types.js +0 -0
  549. /package/{esm → dist}/src/ast/references/index.js +0 -0
  550. /package/{esm → dist}/src/ast/references/jackson.js +0 -0
  551. /package/{esm → dist}/src/ast/references/jakarta.js +0 -0
  552. /package/{esm → dist}/src/ast/references/java.js +0 -0
  553. /package/{esm → dist}/src/ast/references/kotlin.js +0 -0
  554. /package/{esm → dist}/src/ast/references/kotlinx.js +0 -0
  555. /package/{esm → dist}/src/ast/references/okhttp3.js +0 -0
  556. /package/{esm → dist}/src/ast/references/reactor.js +0 -0
  557. /package/{esm → dist}/src/ast/references/spring-reactive.js +0 -0
  558. /package/{esm → dist}/src/ast/references/spring.js +0 -0
  559. /package/{esm → dist}/src/ast/references/swagger.js +0 -0
  560. /package/{esm → dist}/src/ast/utils/get-kotlin-builder-options.js +0 -0
  561. /package/{esm → dist}/src/ast/utils/to-kt-node.js +0 -0
  562. /package/{esm → dist}/src/ast/utils/write-kt-arguments.js +0 -0
  563. /package/{esm → dist}/src/ast/utils/write-kt-enum-values.js +0 -0
  564. /package/{esm → dist}/src/ast/utils/write-kt-generic-parameters.js +0 -0
  565. /package/{esm → dist}/src/ast/utils/write-kt-parameters.js +0 -0
  566. /package/{esm → dist}/src/common-results.js +0 -0
  567. /package/{esm → dist}/src/config.js +0 -0
  568. /package/{esm → dist}/src/generators/index.js +0 -0
  569. /package/{esm → dist}/src/generators/models/args.js +0 -0
  570. /package/{esm → dist}/src/generators/models/index.js +0 -0
  571. /package/{esm → dist}/src/generators/models/models.js +0 -0
  572. /package/{esm → dist}/src/generators/services/okhttp3-clients/args.js +0 -0
  573. /package/{esm → dist}/src/generators/services/okhttp3-clients/index.js +0 -0
  574. /package/{esm → dist}/src/generators/services/okhttp3-clients/models.js +0 -0
  575. /package/{esm → dist}/src/generators/services/okhttp3-clients/refs.js +0 -0
  576. /package/{esm → dist}/src/generators/services/spring-controllers/args.js +0 -0
  577. /package/{esm → dist}/src/generators/services/spring-controllers/index.js +0 -0
  578. /package/{esm → dist}/src/generators/services/spring-controllers/models.js +0 -0
  579. /package/{esm → dist}/src/generators/services/spring-controllers/refs.js +0 -0
  580. /package/{esm → dist}/src/generators/services/spring-reactive-web-clients/args.js +0 -0
  581. /package/{esm → dist}/src/generators/services/spring-reactive-web-clients/index.js +0 -0
  582. /package/{esm → dist}/src/generators/services/spring-reactive-web-clients/models.js +0 -0
  583. /package/{esm → dist}/src/generators/services/spring-reactive-web-clients/refs.js +0 -0
  584. /package/{esm → dist}/src/types.js +0 -0
@@ -55,15 +55,13 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
55
55
  classKind: parameters.length === 0 ? null : 'data',
56
56
  implements: inheritedSchemas.map((schema) => this.getType(ctx, { schema, nullable: false })),
57
57
  primaryConstructor: kt.constructor(parameters.map((property) => this.getClassParameter(ctx, { ...args, inheritedSchemas, parameters, property }))),
58
- members: [
59
- ...(schema.additionalProperties !== undefined && schema.additionalProperties !== false
60
- ? [
61
- this.getAdditionalPropertiesProperty(ctx, { schema }),
62
- this.getAdditionalPropertiesSetter(ctx, { schema }),
63
- this.getAdditionalPropertiesGetter(ctx, { schema }),
64
- ]
65
- : []),
66
- ],
58
+ members: schema.additionalProperties !== undefined && schema.additionalProperties !== false
59
+ ? [
60
+ this.getAdditionalPropertiesProperty(ctx, { schema }),
61
+ this.getAdditionalPropertiesSetter(ctx, { schema }),
62
+ this.getAdditionalPropertiesGetter(ctx, { schema }),
63
+ ]
64
+ : [],
67
65
  });
68
66
  }
69
67
  getInterface(ctx, args) {
@@ -80,15 +78,14 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
80
78
  });
81
79
  }
82
80
  getEnum(ctx, args) {
83
- var _a, _b, _c;
84
81
  const { schema } = args;
85
82
  const name = this.getDeclarationTypeName(ctx, { schema });
86
83
  // One set of names for both generation sites below, so the constant and its `when` branch agree.
87
84
  const valueNames = this.toEnumValueNames(ctx, schema.enum);
88
- return kt.enum(name, (_b = (_a = schema.enum) === null || _a === void 0 ? void 0 : _a.map((x, i) => kt.enumValue(valueNames[i], {
85
+ return kt.enum(name, schema.enum?.map((x, i) => kt.enumValue(valueNames[i], {
89
86
  annotations: [kt.annotation(kt.refs.jackson.jsonProperty(), [kt.argument(kt.string(String(x)))])],
90
87
  arguments: [kt.argument(kt.string(String(x)))],
91
- }))) !== null && _b !== void 0 ? _b : [], {
88
+ })) ?? [], {
92
89
  doc: kt.doc(this.getSchemaDocDescription(ctx, { schema })),
93
90
  annotations: [schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null],
94
91
  primaryConstructor: kt.constructor([
@@ -102,9 +99,11 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
102
99
  parameters: [kt.parameter('value', kt.refs.string())],
103
100
  returnType: kt.reference(name, null, { nullable: true }),
104
101
  singleExpression: true,
105
- body: !((_c = schema.enum) === null || _c === void 0 ? void 0 : _c.length) ? 'null' : s `\nwhen(value) {${s.indent `${appendValueGroup([
106
- schema.enum.map((x, i) => s `\n${kt.string(String(x))} -> ${valueNames[i]}`),
107
- ])}
102
+ body: !schema.enum?.length
103
+ ? 'null'
104
+ : s `\nwhen(value) {${s.indent `${appendValueGroup([
105
+ schema.enum.map((x, i) => s `\n${kt.string(String(x))} -> ${valueNames[i]}`),
106
+ ])}
108
107
  else -> null`}
109
108
  }`,
110
109
  }),
@@ -113,8 +112,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
113
112
  });
114
113
  }
115
114
  getSchemaDocDescription(ctx, args) {
116
- var _a;
117
- const docSegments = [(_a = args.schema.description) === null || _a === void 0 ? void 0 : _a.trim()];
115
+ const docSegments = [args.schema.description?.trim()];
118
116
  if (ctx.config.includeSourceInDocs) {
119
117
  docSegments.push(getSourceDocLine(args.schema));
120
118
  }
@@ -126,14 +124,14 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
126
124
  const nonNullSchema = schema.oneOf.find((x) => x.kind !== 'null');
127
125
  if (nonNullSchema) {
128
126
  schema = nonNullSchema;
129
- nullable !== null && nullable !== void 0 ? nullable : (nullable = true);
127
+ nullable ??= true;
130
128
  }
131
129
  }
132
130
  const generatedType = this.getGeneratedType(ctx, { schema, nullable });
133
131
  if (generatedType) {
134
132
  return generatedType;
135
133
  }
136
- nullable !== null && nullable !== void 0 ? nullable : (nullable = schema.nullable);
134
+ nullable ??= schema.nullable;
137
135
  switch (schema.kind) {
138
136
  case 'boolean':
139
137
  return kt.refs.boolean({ nullable });
@@ -183,11 +181,10 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
183
181
  }
184
182
  }
185
183
  getGeneratedType(ctx, args) {
186
- var _a;
187
184
  const schema = getSchemaReference(args.schema, DEFAULT_IGNORED_SCHEMA_PROPERTIES);
188
185
  if (this.shouldGenerateTypeDeclaration(ctx, { schema })) {
189
186
  return kt.reference(this.getDeclarationTypeName(ctx, { schema }), this.getPackageName(ctx, { schema }), {
190
- nullable: (_a = args.nullable) !== null && _a !== void 0 ? _a : schema.nullable,
187
+ nullable: args.nullable ?? schema.nullable,
191
188
  });
192
189
  }
193
190
  return null;
@@ -232,10 +229,9 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
232
229
  }
233
230
  // #region Members
234
231
  getClassParameter(ctx, args) {
235
- var _a;
236
232
  const { schema, inheritedSchemas, property } = args;
237
233
  return kt.parameter.class(toCasing(property.name, ctx.config.propertyNameCasing), this.getType(ctx, { schema: property.schema, nullable: schema.required.has(property.name) ? undefined : true }), {
238
- description: (_a = property.schema.description) === null || _a === void 0 ? void 0 : _a.trim(),
234
+ description: property.schema.description?.trim(),
239
235
  annotations: [
240
236
  ...this.getJakartaValidationAnnotations(ctx, { schema, property }),
241
237
  this.getSwaggerSchemaAnnotation(ctx, { schema, property }),
@@ -329,9 +325,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
329
325
  getJacksonJsonClassDescriptionAnnotation(ctx, args) {
330
326
  const { schema } = args;
331
327
  return ctx.config.addJacksonAnnotations && schema.description
332
- ? kt.annotation(kt.refs.jackson.jsonClassDescription(), [
333
- kt.argument(kt.string(schema.description)),
334
- ])
328
+ ? kt.annotation(kt.refs.jackson.jsonClassDescription(), [kt.argument(kt.string(schema.description))])
335
329
  : null;
336
330
  }
337
331
  getJacksonJsonPropertyAnnotation(ctx, args) {
@@ -346,9 +340,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
346
340
  getJacksonJsonPropertyDescriptionAnnotation(ctx, args) {
347
341
  const { property } = args;
348
342
  return ctx.config.addJacksonAnnotations && property.schema.description
349
- ? kt.annotation(kt.refs.jackson.jsonPropertyDescription(), [
350
- kt.argument(kt.string(property.schema.description)),
351
- ])
343
+ ? kt.annotation(kt.refs.jackson.jsonPropertyDescription(), [kt.argument(kt.string(property.schema.description))])
352
344
  : null;
353
345
  }
354
346
  getJacksonJsonIncludeAnnotation(ctx, args) {
@@ -424,9 +416,7 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
424
416
  // #endregion
425
417
  getPackageName(ctx, args) {
426
418
  const { schema } = args;
427
- const packageSuffix = typeof ctx.config.packageSuffix === 'string'
428
- ? ctx.config.packageSuffix
429
- : ctx.config.packageSuffix(schema);
419
+ const packageSuffix = typeof ctx.config.packageSuffix === 'string' ? ctx.config.packageSuffix : ctx.config.packageSuffix(schema);
430
420
  return ctx.config.packageName + packageSuffix;
431
421
  }
432
422
  shouldGenerateTypeDeclaration(ctx, args) {
@@ -458,11 +448,16 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
458
448
  // legal and leaves the base with no properties of its own.
459
449
  const isDiscriminatedBase = schema.kind === 'object' && schema.discriminator !== undefined;
460
450
  // Schemas representable by a simple Map type do not need its own type declaration
461
- if (!isDiscriminatedBase && schema.kind === 'object' && schema.properties.size === 0 && schema.additionalProperties) {
451
+ if (!isDiscriminatedBase &&
452
+ schema.kind === 'object' &&
453
+ schema.properties.size === 0 &&
454
+ schema.additionalProperties) {
462
455
  return false;
463
456
  }
464
- if (!isDiscriminatedBase && schema.kind === 'object' &&
465
- ctx.config.emptyObjectTypeBehavior === 'use-any' && schema.properties.size === 0) {
457
+ if (!isDiscriminatedBase &&
458
+ schema.kind === 'object' &&
459
+ ctx.config.emptyObjectTypeBehavior === 'use-any' &&
460
+ schema.properties.size === 0) {
466
461
  return false;
467
462
  }
468
463
  // Dynamically generated schemas do not have its own type declaration
@@ -484,13 +479,12 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
484
479
  .filter((item, index, self) => self.indexOf(item) === index);
485
480
  }
486
481
  getClassProperties(ctx, args) {
487
- var _a;
488
482
  const { schema } = args;
489
483
  const inheritedSchemas = this.getInheritedSchemas(ctx, { schema });
490
484
  const properties = [];
491
485
  const appendedProperties = [];
492
486
  for (const property of schema.properties.values()) {
493
- const discriminator = (_a = inheritedSchemas.find((x) => { var _a; return ((_a = x.discriminator) === null || _a === void 0 ? void 0 : _a.propertyName) === property.name; })) === null || _a === void 0 ? void 0 : _a.discriminator;
487
+ const discriminator = inheritedSchemas.find((x) => x.discriminator?.propertyName === property.name)?.discriminator;
494
488
  if (discriminator) {
495
489
  const schemaMappings = Object.entries(discriminator.mapping).filter(([_, v]) => v.id === schema.id);
496
490
  if (schemaMappings.length === 1) {
@@ -520,11 +514,10 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
520
514
  let { schema } = args;
521
515
  schema = this.normalizeDiscriminatedBases(ctx, { schema });
522
516
  if (schema.kind === 'oneOf') {
523
- schema = ctx.config.oneOfBehavior === 'treat-as-any-of'
524
- // deno-lint-ignore no-explicit-any
525
- ? { ...schema, kind: 'combined', anyOf: schema.oneOf, allOf: [], oneOf: undefined }
526
- // deno-lint-ignore no-explicit-any
527
- : { ...schema, kind: 'combined', allOf: schema.oneOf, anyOf: [], oneOf: undefined };
517
+ schema =
518
+ ctx.config.oneOfBehavior === 'treat-as-any-of'
519
+ ? { ...schema, kind: 'combined', anyOf: schema.oneOf, allOf: [], oneOf: undefined }
520
+ : { ...schema, kind: 'combined', allOf: schema.oneOf, anyOf: [], oneOf: undefined };
528
521
  ctx.schema = schema;
529
522
  }
530
523
  if (schema.kind === 'object' || schema.kind === 'combined') {
@@ -583,7 +576,6 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
583
576
  return schema;
584
577
  }
585
578
  // Registered before descending, so a branch composing back to one of its own ancestors terminates.
586
- // deno-lint-ignore no-explicit-any
587
579
  const copy = { ...schema };
588
580
  rewritten.set(schema, copy);
589
581
  if (isBase) {
@@ -603,9 +595,9 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
603
595
  if (isDiscriminatedBase(schema))
604
596
  return true;
605
597
  const contains = (x) => containsDiscriminatedBase(x, visited);
606
- return branches(schema, 'allOf').some(contains) ||
598
+ return (branches(schema, 'allOf').some(contains) ||
607
599
  branches(schema, 'anyOf').some(contains) ||
608
- branches(schema, 'oneOf').some(contains);
600
+ branches(schema, 'oneOf').some(contains));
609
601
  }
610
602
  function isDiscriminatedBase(schema) {
611
603
  return schema.kind === 'oneOf' && schema.discriminator !== undefined;
@@ -615,9 +607,8 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
615
607
  * `oneOf: undefined` behind when it rewrites a `oneOf` holder, so a keyword can be present with no value.
616
608
  */
617
609
  function branches(schema, keyword) {
618
- var _a;
619
610
  const values = schema;
620
- return (_a = values[keyword]) !== null && _a !== void 0 ? _a : [];
611
+ return values[keyword] ?? [];
621
612
  }
622
613
  }
623
614
  hasProperty(ctx, args) {
@@ -635,7 +626,8 @@ export class DefaultKotlinModelGenerator extends KotlinFileGenerator {
635
626
  // Only an undiscriminated `oneOf` composes into the schema that references it, matching which `oneOf`
636
627
  // branches `resolveAnyOfAndAllOf` merges. A discriminated one lists subtypes, whose properties are not
637
628
  // the referencing schema's, so an inherited property never comes from there.
638
- ('oneOf' in schema && !schema.discriminator &&
629
+ ('oneOf' in schema &&
630
+ !schema.discriminator &&
639
631
  schema.oneOf.some((schema) => this.hasProperty(ctx, { schema, propertyName, visited }))));
640
632
  }
641
633
  }
@@ -1,6 +1,6 @@
1
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';
2
+ import { type KotlinModelGenerator } from './model-generator.ts';
3
+ import { type KotlinModelGeneratorOutput, type KotlinModelsGeneratorConfig, type KotlinModelsGeneratorContext, type KotlinModelsGeneratorInput, type KotlinModelsGeneratorOutput } from './models.ts';
4
4
  type Input = KotlinModelsGeneratorInput;
5
5
  type Output = KotlinModelsGeneratorOutput;
6
6
  type Config = KotlinModelsGeneratorConfig;
@@ -15,4 +15,3 @@ export declare class KotlinModelsGenerator extends OpenApiSchemasGenerationProvi
15
15
  protected addSchemaResult(ctx: Context, schema: ApiSchema, result: SchemaOutput): void;
16
16
  }
17
17
  export {};
18
- //# sourceMappingURL=models-generator.d.ts.map
@@ -2,15 +2,10 @@ import { Factory, OpenApiSchemasGenerationProviderBase, } from '@goast/core';
2
2
  import { DefaultKotlinModelGenerator } from './model-generator.js';
3
3
  import { defaultKotlinModelsGeneratorConfig, } from './models.js';
4
4
  export class KotlinModelsGenerator extends OpenApiSchemasGenerationProviderBase {
5
+ _modelGeneratorFactory;
5
6
  constructor(modelGeneratorFactory) {
6
7
  super();
7
- Object.defineProperty(this, "_modelGeneratorFactory", {
8
- enumerable: true,
9
- configurable: true,
10
- writable: true,
11
- value: void 0
12
- });
13
- this._modelGeneratorFactory = modelGeneratorFactory !== null && modelGeneratorFactory !== void 0 ? modelGeneratorFactory : Factory.fromValue(new DefaultKotlinModelGenerator());
8
+ this._modelGeneratorFactory = modelGeneratorFactory ?? Factory.fromValue(new DefaultKotlinModelGenerator());
14
9
  }
15
10
  initResult() {
16
11
  return {
@@ -1,6 +1,6 @@
1
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';
2
+ import type { kt } from '../../ast/index.ts';
3
+ import { type KotlinGeneratorConfig } from '../../config.ts';
4
4
  export type KotlinModelsGeneratorConfig = KotlinGeneratorConfig & {
5
5
  /**
6
6
  * The package name for generated models.
@@ -58,4 +58,3 @@ export type KotlinModelsGeneratorContext = OpenApiSchemasGenerationProviderConte
58
58
  export type KotlinModelGeneratorContext = KotlinModelsGeneratorContext & {
59
59
  schema: ApiSchema;
60
60
  };
61
- //# sourceMappingURL=models.d.ts.map
@@ -1,6 +1,6 @@
1
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';
2
+ import type { kt } from '../../../ast/index.ts';
3
+ import type { ApiParameterWithMultipartInfo } from '../../../types.ts';
4
4
  export type GetClientFileContent = object;
5
5
  export type GetClientClass = object;
6
6
  export type GetClientCompanionObject = object;
@@ -84,4 +84,3 @@ export type GetFilePath = {
84
84
  packageName: string;
85
85
  };
86
86
  export type GetApiClientName = object;
87
- //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * as DefaultKotlinOkHttp3GeneratorArgs from './args.ts';
2
+ export * from './models.ts';
3
+ export * from './okhttp3-client-generator.ts';
4
+ export * from './okhttp3-clients-generator.ts';
@@ -1,9 +1,9 @@
1
1
  import type { ApiEndpoint, ApiService, AppendValue, DefaultGenerationProviderConfig, OpenApiServicesGenerationProviderContext } from '@goast/core';
2
- import type { KotlinImport } from '../../../common-results.js';
3
- import { type KotlinGeneratorConfig } from '../../../config.js';
4
- import type { KotlinFileBuilder } from '../../../file-builder.js';
5
- import type { KotlinModelsGeneratorOutput } from '../../models/index.js';
6
- import type { getReferenceFactories } from './refs.js';
2
+ import type { KotlinImport } from '../../../common-results.ts';
3
+ import { type KotlinGeneratorConfig } from '../../../config.ts';
4
+ import type { KotlinFileBuilder } from '../../../file-builder.ts';
5
+ import type { KotlinModelsGeneratorOutput } from '../../models/index.ts';
6
+ import type { getReferenceFactories } from './refs.ts';
7
7
  export type KotlinOkHttp3ClientsGeneratorConfig = KotlinGeneratorConfig & {
8
8
  packageName: string;
9
9
  packageSuffix: string | ((service?: ApiService) => string);
@@ -43,4 +43,3 @@ export type KotlinOkHttp3ClientsGeneratorContext = OpenApiServicesGenerationProv
43
43
  export type KotlinOkHttp3ClientGeneratorContext = KotlinOkHttp3ClientsGeneratorContext & {
44
44
  service: ApiService;
45
45
  };
46
- //# sourceMappingURL=models.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import { type ApiSchema, type AppendValueGroup, type BasicAppendValue, type MaybePromise, SourceBuilder } from '@goast/core';
2
- import { kt } from '../../../ast/index.js';
3
- import { KotlinFileBuilder } from '../../../file-builder.js';
4
- import type { ApiParameterWithMultipartInfo } from '../../../types.js';
5
- import { KotlinFileGenerator } from '../../file-generator.js';
6
- import type { DefaultKotlinOkHttp3GeneratorArgs as Args } from './index.js';
7
- import type { KotlinOkHttp3ClientGeneratorContext, KotlinOkHttp3ClientGeneratorOutput } from './models.js';
2
+ import { kt } from '../../../ast/index.ts';
3
+ import { KotlinFileBuilder } from '../../../file-builder.ts';
4
+ import type { ApiParameterWithMultipartInfo } from '../../../types.ts';
5
+ import { KotlinFileGenerator } from '../../file-generator.ts';
6
+ import type { DefaultKotlinOkHttp3GeneratorArgs as Args } from './index.ts';
7
+ import type { KotlinOkHttp3ClientGeneratorContext, KotlinOkHttp3ClientGeneratorOutput } from './models.ts';
8
8
  type Context = KotlinOkHttp3ClientGeneratorContext;
9
9
  type Output = KotlinOkHttp3ClientGeneratorOutput;
10
10
  type Builder = KotlinFileBuilder;
@@ -52,4 +52,3 @@ export declare class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator<C
52
52
  private createApiParameter;
53
53
  }
54
54
  export {};
55
- //# sourceMappingURL=okhttp3-client-generator.d.ts.map
@@ -202,19 +202,17 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
202
202
  });
203
203
  }
204
204
  getEndpointClientRequestConfigMethodBody(ctx, args) {
205
- var _a, _b, _c;
206
205
  const { endpoint, parameters } = args;
207
206
  const queryParameters = parameters.filter((x) => x.target === 'query');
208
207
  const headerParameters = parameters.filter((x) => x.target === 'header');
209
208
  const result = appendValueGroup([], '\n');
210
209
  if (endpoint.requestBody) {
211
- if (((_a = endpoint.requestBody.content[0]) === null || _a === void 0 ? void 0 : _a.type) === 'multipart/form-data') {
210
+ if (endpoint.requestBody.content[0]?.type === 'multipart/form-data') {
212
211
  const partConfigs = parameters
213
212
  .filter((x) => x.multipart)
214
213
  .map((param) => {
215
- var _a, _b;
216
214
  const paramName = toCasing(param.name, ctx.config.parameterNameCasing);
217
- return s `"${(_b = (_a = param.multipart) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : ''}" to ${ctx.refs.partConfig.infer()}(body = ${paramName})`;
215
+ return s `"${param.multipart?.name ?? ''}" to ${ctx.refs.partConfig.infer()}(body = ${paramName})`;
218
216
  });
219
217
  result.values.push(s `val localVariableBody = ${kt.call(kt.refs.mapOf([kt.refs.string(), ctx.refs.partConfig(['*'])]), partConfigs)}`);
220
218
  }
@@ -223,20 +221,24 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
223
221
  result.values.push(`val localVariableBody = ${bodyParamName}`);
224
222
  }
225
223
  }
226
- result.values.push(s `val localVariableQuery: ${ctx.refs.multiValueMap()} = ${kt.call([kt.refs.mutableMapOf([kt.refs.string(), kt.refs.list([kt.refs.string()])])], [])}${queryParameters.length === 0 ? '' : s.indent `
224
+ result.values.push(s `val localVariableQuery: ${ctx.refs.multiValueMap()} = ${kt.call([kt.refs.mutableMapOf([kt.refs.string(), kt.refs.list([kt.refs.string()])])], [])}${queryParameters.length === 0
225
+ ? ''
226
+ : s.indent `
227
227
  .apply {${s.indent `
228
228
  ${appendValueGroup(queryParameters.map((param) => {
229
- const paramName = toCasing(param.name, ctx.config.parameterNameCasing);
230
- const toString = this.getParameterToString(ctx, { endpoint, parameter: param });
231
- const put = s `put(${kt.string(param.name)}, listOf(${paramName}${toString}))`;
232
- return param.required ? put : s `if (${paramName} != null) {${s.indent `
229
+ const paramName = toCasing(param.name, ctx.config.parameterNameCasing);
230
+ const toString = this.getParameterToString(ctx, { endpoint, parameter: param });
231
+ const put = s `put(${kt.string(param.name)}, listOf(${paramName}${toString}))`;
232
+ return param.required
233
+ ? put
234
+ : s `if (${paramName} != null) {${s.indent `
233
235
  ${put}`}
234
236
  }`;
235
- }), '\n')}`}
237
+ }), '\n')}`}
236
238
  }`}`);
237
239
  result.values.push('val localVariableHeaders: MutableMap<String, String> = mutableMapOf()');
238
- if (((_b = endpoint.requestBody) === null || _b === void 0 ? void 0 : _b.content[0]) !== undefined) {
239
- result.values.push(`localVariableHeaders["Content-Type"] = "${(_c = endpoint.requestBody) === null || _c === void 0 ? void 0 : _c.content[0].type}"`);
240
+ if (endpoint.requestBody?.content[0] !== undefined) {
241
+ result.values.push(`localVariableHeaders["Content-Type"] = "${endpoint.requestBody?.content[0].type}"`);
240
242
  }
241
243
  for (const header of headerParameters) {
242
244
  const paramName = toCasing(header.name, ctx.config.parameterNameCasing);
@@ -256,9 +258,8 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
256
258
  return result;
257
259
  }
258
260
  getParameterToString(ctx, args) {
259
- var _a;
260
261
  const { parameter } = args;
261
- if (((_a = parameter.schema) === null || _a === void 0 ? void 0 : _a.kind) === 'array') {
262
+ if (parameter.schema?.kind === 'array') {
262
263
  const itemEnumSchema = getArrayItemStringEnumSchema(parameter.schema);
263
264
  const itemEnumType = itemEnumSchema && this.getSchemaType(ctx, { schema: itemEnumSchema });
264
265
  return itemEnumType ? s `.joinToString(",", transform = ${itemEnumType}::value)` : '.joinToString(",")';
@@ -282,9 +283,8 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
282
283
  ];
283
284
  }
284
285
  getParameterType(ctx, args) {
285
- var _a;
286
286
  const { parameter } = args;
287
- if ((_a = parameter.multipart) === null || _a === void 0 ? void 0 : _a.isFile) {
287
+ if (parameter.multipart?.isFile) {
288
288
  return kt.refs.java.file();
289
289
  }
290
290
  return this.getTypeUsage(ctx, {
@@ -293,39 +293,36 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
293
293
  });
294
294
  }
295
295
  getRequestBodyType(ctx, args) {
296
- var _a;
297
296
  const { endpoint } = args;
298
- const content = (_a = endpoint.requestBody) === null || _a === void 0 ? void 0 : _a.content[0];
299
- return (content === null || content === void 0 ? void 0 : content.type) === 'multipart/form-data'
297
+ const content = endpoint.requestBody?.content[0];
298
+ return content?.type === 'multipart/form-data'
300
299
  ? kt.refs.map([kt.refs.string(), ctx.refs.partConfig(['*'])])
301
- : this.getTypeUsage(ctx, { schema: content === null || content === void 0 ? void 0 : content.schema, fallback: kt.refs.unit() });
300
+ : this.getTypeUsage(ctx, { schema: content?.schema, fallback: kt.refs.unit() });
302
301
  }
303
302
  getParameterDefaultValue(ctx, args) {
304
303
  const { schema } = args.parameter;
305
304
  if (args.parameter.required) {
306
305
  return null;
307
306
  }
308
- if (getStringEnumSchema(schema) && (schema === null || schema === void 0 ? void 0 : schema.default)) {
307
+ if (getStringEnumSchema(schema) && schema?.default) {
309
308
  return s `${this.getTypeUsage(ctx, { schema, nullable: false })}.${this.toEnumValueName(ctx, schema.enum, schema.default)}`;
310
309
  }
311
310
  const itemEnumSchema = getArrayItemStringEnumSchema(schema);
312
- if (itemEnumSchema && Array.isArray(schema === null || schema === void 0 ? void 0 : schema.default)) {
311
+ if (itemEnumSchema && Array.isArray(schema?.default)) {
313
312
  const itemType = this.getTypeUsage(ctx, { schema: itemEnumSchema, nullable: false });
314
313
  return kt.call(kt.refs.listOf.infer(), schema.default.map((x) => s `${itemType}.${this.toEnumValueName(ctx, itemEnumSchema.enum, x)}`));
315
314
  }
316
- return kt.toNode(schema === null || schema === void 0 ? void 0 : schema.default);
315
+ return kt.toNode(schema?.default);
317
316
  }
318
317
  getTypeUsage(ctx, args) {
319
318
  const { schema, nullable, fallback } = args;
320
319
  const type = this.getSchemaType(ctx, { schema });
321
320
  return type
322
- ? createOverwriteProxy(type, { nullable: nullable !== null && nullable !== void 0 ? nullable : type.nullable })
323
- : (fallback !== null && fallback !== void 0 ? fallback : kt.refs.any({ nullable }));
321
+ ? createOverwriteProxy(type, { nullable: nullable ?? type.nullable })
322
+ : (fallback ?? kt.refs.any({ nullable }));
324
323
  }
325
324
  getPackageName(ctx, _args) {
326
- const packageSuffix = typeof ctx.config.packageSuffix === 'string'
327
- ? ctx.config.packageSuffix
328
- : ctx.config.packageSuffix(ctx.service);
325
+ const packageSuffix = typeof ctx.config.packageSuffix === 'string' ? ctx.config.packageSuffix : ctx.config.packageSuffix(ctx.service);
329
326
  return ctx.config.packageName + packageSuffix;
330
327
  }
331
328
  getPathWithInterpolation(ctx, args) {
@@ -334,21 +331,23 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
334
331
  endpoint.parameters
335
332
  .filter((x) => x.target === 'path')
336
333
  .forEach((parameter) => {
337
- path = path.replace(`{${parameter.name}}`, `\${encodeURIComponent(${toCasing(parameter.name, 'camel')}${this.getParameterToString(ctx, { endpoint, parameter })})}`);
334
+ path = path.replace(`{${parameter.name}}`, `\${encodeURIComponent(${toCasing(parameter.name, 'camel')}${this.getParameterToString(ctx, {
335
+ endpoint,
336
+ parameter,
337
+ })})}`);
338
338
  });
339
339
  return path;
340
340
  }
341
341
  getResponseSchema(_ctx, args) {
342
- var _a, _b;
343
342
  const { endpoint } = args;
344
- return (_b = (_a = endpoint.responses.find((x) => !x.statusCode || (x.statusCode >= 200 && x.statusCode < 300))) === null || _a === void 0 ? void 0 : _a.contentOptions[0]) === null || _b === void 0 ? void 0 : _b.schema;
343
+ return endpoint.responses.find((x) => !x.statusCode || (x.statusCode >= 200 && x.statusCode < 300))
344
+ ?.contentOptions[0]?.schema;
345
345
  }
346
346
  getSchemaType(ctx, args) {
347
347
  const { schema } = args;
348
348
  return schema && ctx.input.kotlin.models[schema.id].type;
349
349
  }
350
350
  getAllParameters(ctx, args) {
351
- var _a, _b;
352
351
  const { endpoint } = args;
353
352
  const parameters = endpoint.parameters.filter((parameter) => parameter.target === 'query' || parameter.target === 'path' || parameter.target === 'header');
354
353
  if (endpoint.requestBody) {
@@ -356,8 +355,8 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
356
355
  let schema = content.schema;
357
356
  if (content.type === 'multipart/form-data') {
358
357
  if (schema && schema.kind === 'object') {
359
- schema = (_a = resolveAnyOfAndAllOf(schema, true)) !== null && _a !== void 0 ? _a : schema;
360
- const properties = (_b = schema.properties) !== null && _b !== void 0 ? _b : {};
358
+ schema = resolveAnyOfAndAllOf(schema, true) ?? schema;
359
+ const properties = schema.properties ?? {};
361
360
  for (const [name, property] of properties.entries()) {
362
361
  parameters.push(Object.assign(this.createApiParameter({
363
362
  id: `multipart-${name}`,
@@ -389,23 +388,20 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
389
388
  return parameters.sort((a, b) => (a.required === b.required ? 0 : a.required ? -1 : 1));
390
389
  }
391
390
  getRequestBodyParamName(ctx, args) {
392
- var _a;
393
391
  const { endpoint } = args;
394
- const schema = (_a = endpoint.requestBody) === null || _a === void 0 ? void 0 : _a.content[0].schema;
392
+ const schema = endpoint.requestBody?.content[0].schema;
395
393
  const schemaInfo = this.getSchemaType(ctx, { schema });
396
394
  return toCasing(schemaInfo && schemaInfo.name !== 'Any' ? SourceBuilder.build((b) => kt.reference.write(b, schemaInfo)) : 'body', ctx.config.parameterNameCasing);
397
395
  }
398
396
  getEndpointDocDescription(ctx, args) {
399
- var _a;
400
- const docSegments = [(_a = args.endpoint.description) === null || _a === void 0 ? void 0 : _a.trim()];
397
+ const docSegments = [args.endpoint.description?.trim()];
401
398
  if (ctx.config.includeSourceInDocs) {
402
399
  docSegments.push(getSourceDocLine(args.endpoint));
403
400
  }
404
401
  return docSegments.filter(notNullish).join('\n\n');
405
402
  }
406
403
  getBasePath(ctx, _args) {
407
- var _a, _b, _c, _d, _e, _f;
408
- return modifyString((_f = (_e = (_d = (_c = ((_a = ctx.service.$src) !== null && _a !== void 0 ? _a : (_b = ctx.service.endpoints[0]) === null || _b === void 0 ? void 0 : _b.$src)) === null || _c === void 0 ? void 0 : _c.document.servers) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.url) !== null && _f !== void 0 ? _f : '/', ctx.config.basePath, ctx.service);
404
+ return modifyString((ctx.service.$src ?? ctx.service.endpoints[0]?.$src)?.document.servers?.[0]?.url ?? '/', ctx.config.basePath, ctx.service);
409
405
  }
410
406
  getEndpointPath(ctx, args) {
411
407
  const { endpoint } = args;
@@ -1,7 +1,7 @@
1
1
  import { type ApiService, Factory, type MaybePromise, type OpenApiGeneratorContext, OpenApiServicesGenerationProviderBase } from '@goast/core';
2
- import type { KotlinServicesGeneratorInput } from '../spring-controllers/index.js';
3
- import { type KotlinOkHttp3ClientGeneratorOutput, type KotlinOkHttp3ClientsGeneratorConfig, type KotlinOkHttp3ClientsGeneratorContext, type KotlinOkHttp3ClientsGeneratorInput, type KotlinOkHttp3ClientsGeneratorOutput } from './models.js';
4
- import { type KotlinOkHttp3Generator } from './okhttp3-client-generator.js';
2
+ import type { KotlinServicesGeneratorInput } from '../spring-controllers/index.ts';
3
+ import { type KotlinOkHttp3ClientGeneratorOutput, type KotlinOkHttp3ClientsGeneratorConfig, type KotlinOkHttp3ClientsGeneratorContext, type KotlinOkHttp3ClientsGeneratorInput, type KotlinOkHttp3ClientsGeneratorOutput } from './models.ts';
4
+ import { type KotlinOkHttp3Generator } from './okhttp3-client-generator.ts';
5
5
  type Input = KotlinOkHttp3ClientsGeneratorInput;
6
6
  type Output = KotlinOkHttp3ClientsGeneratorOutput;
7
7
  type Config = KotlinOkHttp3ClientsGeneratorConfig;
@@ -20,4 +20,3 @@ export declare class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenera
20
20
  private copyInfrastructureFiles;
21
21
  }
22
22
  export {};
23
- //# sourceMappingURL=okhttp3-clients-generator.d.ts.map
@@ -7,15 +7,10 @@ import { defaultKotlinOkHttp3ClientsGeneratorConfig, } from './models.js';
7
7
  import { DefaultKotlinOkHttp3Generator } from './okhttp3-client-generator.js';
8
8
  import { getReferenceFactories } from './refs.js';
9
9
  export class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenerationProviderBase {
10
+ _serviceGeneratorFactory;
10
11
  constructor(serviceGeneratorFactory) {
11
12
  super();
12
- Object.defineProperty(this, "_serviceGeneratorFactory", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: void 0
17
- });
18
- this._serviceGeneratorFactory = serviceGeneratorFactory !== null && serviceGeneratorFactory !== void 0 ? serviceGeneratorFactory : Factory.fromValue(new DefaultKotlinOkHttp3Generator());
13
+ this._serviceGeneratorFactory = serviceGeneratorFactory ?? Factory.fromValue(new DefaultKotlinOkHttp3Generator());
19
14
  }
20
15
  async generateAdditionalFiles(ctx) {
21
16
  await this.copyInfrastructureFiles(ctx);
@@ -78,8 +73,7 @@ export class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenerationProv
78
73
  const sourcePath = `client/okhttp3/${file}`;
79
74
  const targetPath = resolve(targetDir, file);
80
75
  console.log(`Copying asset file "${sourcePath}" to "${targetPath}"`);
81
- let fileContent = (await getAssetFileContent(sourcePath))
82
- .replace(/@PACKAGE_NAME@/g, ctx.infrastructurePackageName);
76
+ let fileContent = (await getAssetFileContent(sourcePath)).replace(/@PACKAGE_NAME@/g, ctx.infrastructurePackageName);
83
77
  if (file === 'ApiClient.kt') {
84
78
  // This order is positional and must agree with the delegate call's own argument order —
85
79
  // `getClientDelegateArguments` in okhttp3-client-generator.ts is the other side of that agreement.
@@ -95,14 +89,14 @@ export class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenerationProv
95
89
  writeGeneratedFile(ctx.config, targetPath, fileContent);
96
90
  }
97
91
  if (ctx.config.serializer === 'static' ||
98
- typeof ctx.config.serializer === 'object' && ctx.config.serializer.mode === 'static') {
92
+ (typeof ctx.config.serializer === 'object' && ctx.config.serializer.mode === 'static')) {
99
93
  const filePath = resolve(targetDir, 'Serializer.kt');
100
94
  console.log(`Generating Serializer to ${filePath}...`);
101
95
  const springBootVersion = ctx.config.springBootVersion;
102
96
  const jsonIncludeMember = toCasing(ctx.config.serializerJsonInclude, 'snake');
103
97
  const defaultFactory = springBootVersion === 4
104
- // Jackson 3's ObjectMapper is immutable; configuration moved to the (Kotlin) mapper builder.
105
- ? s `${kt.refs.jackson.jacksonMapperBuilder(springBootVersion)}()${s.indent `
98
+ ? // Jackson 3's ObjectMapper is immutable; configuration moved to the (Kotlin) mapper builder.
99
+ s `${kt.refs.jackson.jacksonMapperBuilder(springBootVersion)}()${s.indent `
106
100
  .findAndAddModules()
107
101
  .changeDefaultPropertyInclusion { it.withValueInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}).withContentInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}) }
108
102
  .configure(${kt.refs.jackson.dateTimeFeature()}.WRITE_DATES_AS_TIMESTAMPS, false)
@@ -113,9 +107,7 @@ export class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenerationProv
113
107
  .setSerializationInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember})
114
108
  .configure(${kt.refs.jackson.serializationFeature(springBootVersion)}.WRITE_DATES_AS_TIMESTAMPS, false)
115
109
  .configure(${kt.refs.jackson.deserializationFeature(springBootVersion)}.FAIL_ON_UNKNOWN_PROPERTIES, false)`}`;
116
- const factory = typeof ctx.config.serializer === 'object'
117
- ? ctx.config.serializer.factory
118
- : defaultFactory;
110
+ const factory = typeof ctx.config.serializer === 'object' ? ctx.config.serializer.factory : defaultFactory;
119
111
  const builder = new KotlinFileBuilder(ctx.infrastructurePackageName, ctx.config);
120
112
  builder.append(kt.object({
121
113
  name: 'Serializer',
@@ -1,4 +1,4 @@
1
- import { kt } from '../../../ast/index.js';
1
+ import { kt } from '../../../ast/index.ts';
2
2
  export declare function getReferenceFactories(infrastructurePackageName: string): {
3
3
  multiValueMap: kt.ReferenceFactory;
4
4
  collectionDelimiter: kt.ReferenceFactory;
@@ -19,4 +19,3 @@ export declare function getReferenceFactories(infrastructurePackageName: string)
19
19
  requestMethod: kt.ReferenceFactory;
20
20
  serializer: kt.ReferenceFactory;
21
21
  };
22
- //# sourceMappingURL=refs.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { ApiEndpoint, ApiResponse, ApiSchema, SourceBuilder } from '@goast/core';
2
- import type { kt } from '../../../ast/index.js';
3
- import type { ApiParameterWithMultipartInfo } from '../../../types.js';
2
+ import type { kt } from '../../../ast/index.ts';
3
+ import type { ApiParameterWithMultipartInfo } from '../../../types.ts';
4
4
  export type GenerateApiResponseEntitiesFile = {
5
5
  dirPath: string;
6
6
  packageName: string;
@@ -92,4 +92,3 @@ export type GetApiControllerName = object;
92
92
  export type GetAllParameters = {
93
93
  endpoint: ApiEndpoint;
94
94
  };
95
- //# sourceMappingURL=args.d.ts.map