@xyd-js/opencli2go 0.1.0-build.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (658) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__create/input.json +73 -0
  4. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__create/output.go +51 -0
  5. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__create/recorded.json +19 -0
  6. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__delete/input.json +61 -0
  7. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__delete/output.go +37 -0
  8. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__delete/recorded.json +15 -0
  9. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__list/input.json +97 -0
  10. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__list/output.go +59 -0
  11. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__list/recorded.json +14 -0
  12. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__retrieve/input.json +97 -0
  13. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__retrieve/output.go +59 -0
  14. package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__retrieve/recorded.json +14 -0
  15. package/__fixtures__/-2.complex.openai/admin__organization__audit-logs__list/input.json +254 -0
  16. package/__fixtures__/-2.complex.openai/admin__organization__audit-logs__list/output.go +104 -0
  17. package/__fixtures__/-2.complex.openai/admin__organization__audit-logs__list/recorded.json +14 -0
  18. package/__fixtures__/-2.complex.openai/admin__organization__certificates__activate/input.json +90 -0
  19. package/__fixtures__/-2.complex.openai/admin__organization__certificates__activate/output.go +59 -0
  20. package/__fixtures__/-2.complex.openai/admin__organization__certificates__activate/recorded.json +19 -0
  21. package/__fixtures__/-2.complex.openai/admin__organization__certificates__create/input.json +90 -0
  22. package/__fixtures__/-2.complex.openai/admin__organization__certificates__create/output.go +59 -0
  23. package/__fixtures__/-2.complex.openai/admin__organization__certificates__create/recorded.json +19 -0
  24. package/__fixtures__/-2.complex.openai/admin__organization__certificates__deactivate/input.json +90 -0
  25. package/__fixtures__/-2.complex.openai/admin__organization__certificates__deactivate/output.go +59 -0
  26. package/__fixtures__/-2.complex.openai/admin__organization__certificates__deactivate/recorded.json +19 -0
  27. package/__fixtures__/-2.complex.openai/admin__organization__certificates__delete/input.json +62 -0
  28. package/__fixtures__/-2.complex.openai/admin__organization__certificates__delete/output.go +37 -0
  29. package/__fixtures__/-2.complex.openai/admin__organization__certificates__delete/recorded.json +15 -0
  30. package/__fixtures__/-2.complex.openai/admin__organization__certificates__list/input.json +100 -0
  31. package/__fixtures__/-2.complex.openai/admin__organization__certificates__list/output.go +62 -0
  32. package/__fixtures__/-2.complex.openai/admin__organization__certificates__list/recorded.json +14 -0
  33. package/__fixtures__/-2.complex.openai/admin__organization__certificates__retrieve/input.json +100 -0
  34. package/__fixtures__/-2.complex.openai/admin__organization__certificates__retrieve/output.go +62 -0
  35. package/__fixtures__/-2.complex.openai/admin__organization__certificates__retrieve/recorded.json +14 -0
  36. package/__fixtures__/-2.complex.openai/admin__organization__certificates__update/input.json +90 -0
  37. package/__fixtures__/-2.complex.openai/admin__organization__certificates__update/output.go +59 -0
  38. package/__fixtures__/-2.complex.openai/admin__organization__certificates__update/recorded.json +19 -0
  39. package/__fixtures__/-2.complex.openai/admin__organization__groups__create/input.json +74 -0
  40. package/__fixtures__/-2.complex.openai/admin__organization__groups__create/output.go +52 -0
  41. package/__fixtures__/-2.complex.openai/admin__organization__groups__create/recorded.json +19 -0
  42. package/__fixtures__/-2.complex.openai/admin__organization__groups__delete/input.json +62 -0
  43. package/__fixtures__/-2.complex.openai/admin__organization__groups__delete/output.go +37 -0
  44. package/__fixtures__/-2.complex.openai/admin__organization__groups__delete/recorded.json +15 -0
  45. package/__fixtures__/-2.complex.openai/admin__organization__groups__list/input.json +100 -0
  46. package/__fixtures__/-2.complex.openai/admin__organization__groups__list/output.go +62 -0
  47. package/__fixtures__/-2.complex.openai/admin__organization__groups__list/recorded.json +14 -0
  48. package/__fixtures__/-2.complex.openai/admin__organization__groups__retrieve/input.json +100 -0
  49. package/__fixtures__/-2.complex.openai/admin__organization__groups__retrieve/output.go +62 -0
  50. package/__fixtures__/-2.complex.openai/admin__organization__groups__retrieve/recorded.json +14 -0
  51. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__create/input.json +94 -0
  52. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__create/output.go +59 -0
  53. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__create/recorded.json +21 -0
  54. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__delete/input.json +78 -0
  55. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__delete/output.go +43 -0
  56. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__delete/recorded.json +17 -0
  57. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__list/input.json +118 -0
  58. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__list/output.go +68 -0
  59. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__list/recorded.json +16 -0
  60. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__retrieve/input.json +118 -0
  61. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__retrieve/output.go +68 -0
  62. package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__retrieve/recorded.json +16 -0
  63. package/__fixtures__/-2.complex.openai/admin__organization__groups__update/input.json +74 -0
  64. package/__fixtures__/-2.complex.openai/admin__organization__groups__update/output.go +52 -0
  65. package/__fixtures__/-2.complex.openai/admin__organization__groups__update/recorded.json +19 -0
  66. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__create/input.json +94 -0
  67. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__create/output.go +59 -0
  68. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__create/recorded.json +21 -0
  69. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__delete/input.json +78 -0
  70. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__delete/output.go +43 -0
  71. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__delete/recorded.json +17 -0
  72. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__list/input.json +118 -0
  73. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__list/output.go +68 -0
  74. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__list/recorded.json +16 -0
  75. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__retrieve/input.json +118 -0
  76. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__retrieve/output.go +68 -0
  77. package/__fixtures__/-2.complex.openai/admin__organization__groups__users__retrieve/recorded.json +16 -0
  78. package/__fixtures__/-2.complex.openai/admin__organization__invites__create/input.json +115 -0
  79. package/__fixtures__/-2.complex.openai/admin__organization__invites__create/output.go +67 -0
  80. package/__fixtures__/-2.complex.openai/admin__organization__invites__create/recorded.json +22 -0
  81. package/__fixtures__/-2.complex.openai/admin__organization__invites__delete/input.json +62 -0
  82. package/__fixtures__/-2.complex.openai/admin__organization__invites__delete/output.go +37 -0
  83. package/__fixtures__/-2.complex.openai/admin__organization__invites__delete/recorded.json +15 -0
  84. package/__fixtures__/-2.complex.openai/admin__organization__invites__list/input.json +81 -0
  85. package/__fixtures__/-2.complex.openai/admin__organization__invites__list/output.go +55 -0
  86. package/__fixtures__/-2.complex.openai/admin__organization__invites__list/recorded.json +14 -0
  87. package/__fixtures__/-2.complex.openai/admin__organization__invites__retrieve/input.json +81 -0
  88. package/__fixtures__/-2.complex.openai/admin__organization__invites__retrieve/output.go +55 -0
  89. package/__fixtures__/-2.complex.openai/admin__organization__invites__retrieve/recorded.json +14 -0
  90. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__delete/input.json +78 -0
  91. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__delete/output.go +43 -0
  92. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__delete/recorded.json +17 -0
  93. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__list/input.json +99 -0
  94. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__list/output.go +61 -0
  95. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__list/recorded.json +16 -0
  96. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__retrieve/input.json +99 -0
  97. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__retrieve/output.go +61 -0
  98. package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__retrieve/recorded.json +16 -0
  99. package/__fixtures__/-2.complex.openai/admin__organization__projects__archive/input.json +106 -0
  100. package/__fixtures__/-2.complex.openai/admin__organization__projects__archive/output.go +76 -0
  101. package/__fixtures__/-2.complex.openai/admin__organization__projects__archive/recorded.json +19 -0
  102. package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__list/input.json +118 -0
  103. package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__list/output.go +68 -0
  104. package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__list/recorded.json +16 -0
  105. package/__fixtures__/-2.complex.openai/admin__organization__projects__create/input.json +106 -0
  106. package/__fixtures__/-2.complex.openai/admin__organization__projects__create/output.go +76 -0
  107. package/__fixtures__/-2.complex.openai/admin__organization__projects__create/recorded.json +19 -0
  108. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__create/input.json +112 -0
  109. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__create/output.go +67 -0
  110. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__create/recorded.json +24 -0
  111. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__delete/input.json +78 -0
  112. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__delete/output.go +43 -0
  113. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__delete/recorded.json +17 -0
  114. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__list/input.json +118 -0
  115. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__list/output.go +68 -0
  116. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__list/recorded.json +16 -0
  117. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__retrieve/input.json +118 -0
  118. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__retrieve/output.go +68 -0
  119. package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__retrieve/recorded.json +16 -0
  120. package/__fixtures__/-2.complex.openai/admin__organization__projects__list/input.json +91 -0
  121. package/__fixtures__/-2.complex.openai/admin__organization__projects__list/output.go +62 -0
  122. package/__fixtures__/-2.complex.openai/admin__organization__projects__list/recorded.json +14 -0
  123. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__list-rate-limits/input.json +114 -0
  124. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__list-rate-limits/output.go +68 -0
  125. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__list-rate-limits/recorded.json +16 -0
  126. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__update-rate-limit/input.json +183 -0
  127. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__update-rate-limit/output.go +94 -0
  128. package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__update-rate-limit/recorded.json +18 -0
  129. package/__fixtures__/-2.complex.openai/admin__organization__projects__retrieve/input.json +91 -0
  130. package/__fixtures__/-2.complex.openai/admin__organization__projects__retrieve/output.go +62 -0
  131. package/__fixtures__/-2.complex.openai/admin__organization__projects__retrieve/recorded.json +14 -0
  132. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__create/input.json +94 -0
  133. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__create/output.go +59 -0
  134. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__create/recorded.json +21 -0
  135. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__delete/input.json +78 -0
  136. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__delete/output.go +43 -0
  137. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__delete/recorded.json +17 -0
  138. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__list/input.json +99 -0
  139. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__list/output.go +61 -0
  140. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__list/recorded.json +16 -0
  141. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__retrieve/input.json +99 -0
  142. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__retrieve/output.go +61 -0
  143. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__retrieve/recorded.json +16 -0
  144. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__update/input.json +94 -0
  145. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__update/output.go +59 -0
  146. package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__update/recorded.json +21 -0
  147. package/__fixtures__/-2.complex.openai/admin__organization__projects__update/input.json +106 -0
  148. package/__fixtures__/-2.complex.openai/admin__organization__projects__update/output.go +76 -0
  149. package/__fixtures__/-2.complex.openai/admin__organization__projects__update/recorded.json +19 -0
  150. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__create/input.json +126 -0
  151. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__create/output.go +83 -0
  152. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__create/recorded.json +21 -0
  153. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__delete/input.json +78 -0
  154. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__delete/output.go +43 -0
  155. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__delete/recorded.json +17 -0
  156. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__list/input.json +99 -0
  157. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__list/output.go +61 -0
  158. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__list/recorded.json +16 -0
  159. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__retrieve/input.json +99 -0
  160. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__retrieve/output.go +61 -0
  161. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__retrieve/recorded.json +16 -0
  162. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__update/input.json +126 -0
  163. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__update/output.go +83 -0
  164. package/__fixtures__/-2.complex.openai/admin__organization__projects__users__update/recorded.json +21 -0
  165. package/__fixtures__/-2.complex.openai/admin__organization__roles__create/input.json +111 -0
  166. package/__fixtures__/-2.complex.openai/admin__organization__roles__create/output.go +72 -0
  167. package/__fixtures__/-2.complex.openai/admin__organization__roles__create/recorded.json +22 -0
  168. package/__fixtures__/-2.complex.openai/admin__organization__roles__delete/input.json +62 -0
  169. package/__fixtures__/-2.complex.openai/admin__organization__roles__delete/output.go +37 -0
  170. package/__fixtures__/-2.complex.openai/admin__organization__roles__delete/recorded.json +15 -0
  171. package/__fixtures__/-2.complex.openai/admin__organization__roles__list/input.json +100 -0
  172. package/__fixtures__/-2.complex.openai/admin__organization__roles__list/output.go +62 -0
  173. package/__fixtures__/-2.complex.openai/admin__organization__roles__list/recorded.json +14 -0
  174. package/__fixtures__/-2.complex.openai/admin__organization__roles__retrieve/input.json +100 -0
  175. package/__fixtures__/-2.complex.openai/admin__organization__roles__retrieve/output.go +62 -0
  176. package/__fixtures__/-2.complex.openai/admin__organization__roles__retrieve/recorded.json +14 -0
  177. package/__fixtures__/-2.complex.openai/admin__organization__roles__update/input.json +111 -0
  178. package/__fixtures__/-2.complex.openai/admin__organization__roles__update/output.go +72 -0
  179. package/__fixtures__/-2.complex.openai/admin__organization__roles__update/recorded.json +22 -0
  180. package/__fixtures__/-2.complex.openai/admin__organization__users__delete/input.json +62 -0
  181. package/__fixtures__/-2.complex.openai/admin__organization__users__delete/output.go +37 -0
  182. package/__fixtures__/-2.complex.openai/admin__organization__users__delete/recorded.json +15 -0
  183. package/__fixtures__/-2.complex.openai/admin__organization__users__list/input.json +99 -0
  184. package/__fixtures__/-2.complex.openai/admin__organization__users__list/output.go +62 -0
  185. package/__fixtures__/-2.complex.openai/admin__organization__users__list/recorded.json +14 -0
  186. package/__fixtures__/-2.complex.openai/admin__organization__users__retrieve/input.json +99 -0
  187. package/__fixtures__/-2.complex.openai/admin__organization__users__retrieve/output.go +62 -0
  188. package/__fixtures__/-2.complex.openai/admin__organization__users__retrieve/recorded.json +14 -0
  189. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__create/input.json +94 -0
  190. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__create/output.go +59 -0
  191. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__create/recorded.json +21 -0
  192. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__delete/input.json +78 -0
  193. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__delete/output.go +43 -0
  194. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__delete/recorded.json +17 -0
  195. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__list/input.json +118 -0
  196. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__list/output.go +68 -0
  197. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__list/recorded.json +16 -0
  198. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__retrieve/input.json +118 -0
  199. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__retrieve/output.go +68 -0
  200. package/__fixtures__/-2.complex.openai/admin__organization__users__roles__retrieve/recorded.json +16 -0
  201. package/__fixtures__/-2.complex.openai/admin__organization__users__update/input.json +135 -0
  202. package/__fixtures__/-2.complex.openai/admin__organization__users__update/output.go +94 -0
  203. package/__fixtures__/-2.complex.openai/admin__organization__users__update/recorded.json +16 -0
  204. package/__fixtures__/-2.complex.openai/audio__speech__create/input.json +186 -0
  205. package/__fixtures__/-2.complex.openai/audio__speech__create/output.go +106 -0
  206. package/__fixtures__/-2.complex.openai/audio__speech__create/recorded.json +25 -0
  207. package/__fixtures__/-2.complex.openai/audio__transcriptions__create/input.json +277 -0
  208. package/__fixtures__/-2.complex.openai/audio__transcriptions__create/output.go +143 -0
  209. package/__fixtures__/-2.complex.openai/audio__transcriptions__create/recorded.json +22 -0
  210. package/__fixtures__/-2.complex.openai/audio__translations__create/input.json +147 -0
  211. package/__fixtures__/-2.complex.openai/audio__translations__create/output.go +86 -0
  212. package/__fixtures__/-2.complex.openai/audio__translations__create/recorded.json +22 -0
  213. package/__fixtures__/-2.complex.openai/batches__cancel/input.json +149 -0
  214. package/__fixtures__/-2.complex.openai/batches__cancel/output.go +86 -0
  215. package/__fixtures__/-2.complex.openai/batches__cancel/recorded.json +24 -0
  216. package/__fixtures__/-2.complex.openai/batches__create/input.json +149 -0
  217. package/__fixtures__/-2.complex.openai/batches__create/output.go +86 -0
  218. package/__fixtures__/-2.complex.openai/batches__create/recorded.json +24 -0
  219. package/__fixtures__/-2.complex.openai/batches__list/input.json +76 -0
  220. package/__fixtures__/-2.complex.openai/batches__list/output.go +50 -0
  221. package/__fixtures__/-2.complex.openai/batches__list/recorded.json +13 -0
  222. package/__fixtures__/-2.complex.openai/batches__retrieve/input.json +76 -0
  223. package/__fixtures__/-2.complex.openai/batches__retrieve/output.go +50 -0
  224. package/__fixtures__/-2.complex.openai/batches__retrieve/recorded.json +13 -0
  225. package/__fixtures__/-2.complex.openai/beta__assistants__create/input.json +223 -0
  226. package/__fixtures__/-2.complex.openai/beta__assistants__create/output.go +158 -0
  227. package/__fixtures__/-2.complex.openai/beta__assistants__create/recorded.json +18 -0
  228. package/__fixtures__/-2.complex.openai/beta__assistants__delete/input.json +57 -0
  229. package/__fixtures__/-2.complex.openai/beta__assistants__delete/output.go +32 -0
  230. package/__fixtures__/-2.complex.openai/beta__assistants__delete/recorded.json +14 -0
  231. package/__fixtures__/-2.complex.openai/beta__assistants__list/input.json +110 -0
  232. package/__fixtures__/-2.complex.openai/beta__assistants__list/output.go +64 -0
  233. package/__fixtures__/-2.complex.openai/beta__assistants__list/recorded.json +13 -0
  234. package/__fixtures__/-2.complex.openai/beta__assistants__retrieve/input.json +110 -0
  235. package/__fixtures__/-2.complex.openai/beta__assistants__retrieve/output.go +64 -0
  236. package/__fixtures__/-2.complex.openai/beta__assistants__retrieve/recorded.json +13 -0
  237. package/__fixtures__/-2.complex.openai/beta__assistants__update/input.json +223 -0
  238. package/__fixtures__/-2.complex.openai/beta__assistants__update/output.go +158 -0
  239. package/__fixtures__/-2.complex.openai/beta__assistants__update/recorded.json +18 -0
  240. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__cancel/input.json +140 -0
  241. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__cancel/output.go +101 -0
  242. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__cancel/recorded.json +22 -0
  243. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__create/input.json +140 -0
  244. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__create/output.go +101 -0
  245. package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__create/recorded.json +22 -0
  246. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__delete/input.json +62 -0
  247. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__delete/output.go +37 -0
  248. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__delete/recorded.json +15 -0
  249. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list/input.json +65 -0
  250. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list/output.go +40 -0
  251. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list/recorded.json +15 -0
  252. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list-items/input.json +65 -0
  253. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list-items/output.go +40 -0
  254. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list-items/recorded.json +15 -0
  255. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__retrieve/input.json +65 -0
  256. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__retrieve/output.go +40 -0
  257. package/__fixtures__/-2.complex.openai/beta__chatkit__threads__retrieve/recorded.json +15 -0
  258. package/__fixtures__/-2.complex.openai/beta__threads__create/input.json +100 -0
  259. package/__fixtures__/-2.complex.openai/beta__threads__create/output.go +68 -0
  260. package/__fixtures__/-2.complex.openai/beta__threads__create/recorded.json +14 -0
  261. package/__fixtures__/-2.complex.openai/beta__threads__create-and-run/input.json +100 -0
  262. package/__fixtures__/-2.complex.openai/beta__threads__create-and-run/output.go +68 -0
  263. package/__fixtures__/-2.complex.openai/beta__threads__create-and-run/recorded.json +14 -0
  264. package/__fixtures__/-2.complex.openai/beta__threads__delete/input.json +57 -0
  265. package/__fixtures__/-2.complex.openai/beta__threads__delete/output.go +32 -0
  266. package/__fixtures__/-2.complex.openai/beta__threads__delete/recorded.json +14 -0
  267. package/__fixtures__/-2.complex.openai/beta__threads__messages__create/input.json +140 -0
  268. package/__fixtures__/-2.complex.openai/beta__threads__messages__create/output.go +88 -0
  269. package/__fixtures__/-2.complex.openai/beta__threads__messages__create/recorded.json +23 -0
  270. package/__fixtures__/-2.complex.openai/beta__threads__messages__delete/input.json +73 -0
  271. package/__fixtures__/-2.complex.openai/beta__threads__messages__delete/output.go +38 -0
  272. package/__fixtures__/-2.complex.openai/beta__threads__messages__delete/recorded.json +16 -0
  273. package/__fixtures__/-2.complex.openai/beta__threads__messages__list/input.json +143 -0
  274. package/__fixtures__/-2.complex.openai/beta__threads__messages__list/output.go +77 -0
  275. package/__fixtures__/-2.complex.openai/beta__threads__messages__list/recorded.json +15 -0
  276. package/__fixtures__/-2.complex.openai/beta__threads__messages__retrieve/input.json +143 -0
  277. package/__fixtures__/-2.complex.openai/beta__threads__messages__retrieve/output.go +77 -0
  278. package/__fixtures__/-2.complex.openai/beta__threads__messages__retrieve/recorded.json +15 -0
  279. package/__fixtures__/-2.complex.openai/beta__threads__messages__update/input.json +140 -0
  280. package/__fixtures__/-2.complex.openai/beta__threads__messages__update/output.go +88 -0
  281. package/__fixtures__/-2.complex.openai/beta__threads__messages__update/recorded.json +23 -0
  282. package/__fixtures__/-2.complex.openai/beta__threads__retrieve/input.json +60 -0
  283. package/__fixtures__/-2.complex.openai/beta__threads__retrieve/output.go +35 -0
  284. package/__fixtures__/-2.complex.openai/beta__threads__retrieve/recorded.json +14 -0
  285. package/__fixtures__/-2.complex.openai/beta__threads__runs__cancel/input.json +304 -0
  286. package/__fixtures__/-2.complex.openai/beta__threads__runs__cancel/output.go +189 -0
  287. package/__fixtures__/-2.complex.openai/beta__threads__runs__cancel/recorded.json +19 -0
  288. package/__fixtures__/-2.complex.openai/beta__threads__runs__create/input.json +304 -0
  289. package/__fixtures__/-2.complex.openai/beta__threads__runs__create/output.go +189 -0
  290. package/__fixtures__/-2.complex.openai/beta__threads__runs__create/recorded.json +19 -0
  291. package/__fixtures__/-2.complex.openai/beta__threads__runs__list/input.json +128 -0
  292. package/__fixtures__/-2.complex.openai/beta__threads__runs__list/output.go +70 -0
  293. package/__fixtures__/-2.complex.openai/beta__threads__runs__list/recorded.json +15 -0
  294. package/__fixtures__/-2.complex.openai/beta__threads__runs__retrieve/input.json +128 -0
  295. package/__fixtures__/-2.complex.openai/beta__threads__runs__retrieve/output.go +70 -0
  296. package/__fixtures__/-2.complex.openai/beta__threads__runs__retrieve/recorded.json +15 -0
  297. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__list/input.json +165 -0
  298. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__list/output.go +83 -0
  299. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__list/recorded.json +17 -0
  300. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__retrieve/input.json +165 -0
  301. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__retrieve/output.go +83 -0
  302. package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__retrieve/recorded.json +17 -0
  303. package/__fixtures__/-2.complex.openai/beta__threads__runs__submit-tool-outputs/input.json +304 -0
  304. package/__fixtures__/-2.complex.openai/beta__threads__runs__submit-tool-outputs/output.go +189 -0
  305. package/__fixtures__/-2.complex.openai/beta__threads__runs__submit-tool-outputs/recorded.json +19 -0
  306. package/__fixtures__/-2.complex.openai/beta__threads__runs__update/input.json +304 -0
  307. package/__fixtures__/-2.complex.openai/beta__threads__runs__update/output.go +189 -0
  308. package/__fixtures__/-2.complex.openai/beta__threads__runs__update/recorded.json +19 -0
  309. package/__fixtures__/-2.complex.openai/beta__threads__update/input.json +100 -0
  310. package/__fixtures__/-2.complex.openai/beta__threads__update/output.go +68 -0
  311. package/__fixtures__/-2.complex.openai/beta__threads__update/recorded.json +14 -0
  312. package/__fixtures__/-2.complex.openai/chat__completions__create/input.json +600 -0
  313. package/__fixtures__/-2.complex.openai/chat__completions__create/output.go +372 -0
  314. package/__fixtures__/-2.complex.openai/chat__completions__create/recorded.json +22 -0
  315. package/__fixtures__/-2.complex.openai/chat__completions__delete/input.json +62 -0
  316. package/__fixtures__/-2.complex.openai/chat__completions__delete/output.go +37 -0
  317. package/__fixtures__/-2.complex.openai/chat__completions__delete/recorded.json +15 -0
  318. package/__fixtures__/-2.complex.openai/chat__completions__list/input.json +130 -0
  319. package/__fixtures__/-2.complex.openai/chat__completions__list/output.go +76 -0
  320. package/__fixtures__/-2.complex.openai/chat__completions__list/recorded.json +14 -0
  321. package/__fixtures__/-2.complex.openai/chat__completions__messages__list/input.json +118 -0
  322. package/__fixtures__/-2.complex.openai/chat__completions__messages__list/output.go +68 -0
  323. package/__fixtures__/-2.complex.openai/chat__completions__messages__list/recorded.json +16 -0
  324. package/__fixtures__/-2.complex.openai/chat__completions__retrieve/input.json +130 -0
  325. package/__fixtures__/-2.complex.openai/chat__completions__retrieve/output.go +76 -0
  326. package/__fixtures__/-2.complex.openai/chat__completions__retrieve/recorded.json +14 -0
  327. package/__fixtures__/-2.complex.openai/chat__completions__update/input.json +600 -0
  328. package/__fixtures__/-2.complex.openai/chat__completions__update/output.go +372 -0
  329. package/__fixtures__/-2.complex.openai/chat__completions__update/recorded.json +22 -0
  330. package/__fixtures__/-2.complex.openai/completions__create/input.json +332 -0
  331. package/__fixtures__/-2.complex.openai/completions__create/output.go +191 -0
  332. package/__fixtures__/-2.complex.openai/completions__create/recorded.json +21 -0
  333. package/__fixtures__/-2.complex.openai/containers__create/input.json +161 -0
  334. package/__fixtures__/-2.complex.openai/containers__create/output.go +92 -0
  335. package/__fixtures__/-2.complex.openai/containers__create/recorded.json +18 -0
  336. package/__fixtures__/-2.complex.openai/containers__delete/input.json +57 -0
  337. package/__fixtures__/-2.complex.openai/containers__delete/output.go +32 -0
  338. package/__fixtures__/-2.complex.openai/containers__delete/recorded.json +14 -0
  339. package/__fixtures__/-2.complex.openai/containers__files__content__retrieve/input.json +76 -0
  340. package/__fixtures__/-2.complex.openai/containers__files__content__retrieve/output.go +43 -0
  341. package/__fixtures__/-2.complex.openai/containers__files__content__retrieve/recorded.json +17 -0
  342. package/__fixtures__/-2.complex.openai/containers__files__create/input.json +102 -0
  343. package/__fixtures__/-2.complex.openai/containers__files__create/output.go +60 -0
  344. package/__fixtures__/-2.complex.openai/containers__files__create/recorded.json +16 -0
  345. package/__fixtures__/-2.complex.openai/containers__files__delete/input.json +71 -0
  346. package/__fixtures__/-2.complex.openai/containers__files__delete/output.go +38 -0
  347. package/__fixtures__/-2.complex.openai/containers__files__delete/recorded.json +16 -0
  348. package/__fixtures__/-2.complex.openai/containers__files__list/input.json +112 -0
  349. package/__fixtures__/-2.complex.openai/containers__files__list/output.go +63 -0
  350. package/__fixtures__/-2.complex.openai/containers__files__list/recorded.json +15 -0
  351. package/__fixtures__/-2.complex.openai/containers__files__retrieve/input.json +112 -0
  352. package/__fixtures__/-2.complex.openai/containers__files__retrieve/output.go +63 -0
  353. package/__fixtures__/-2.complex.openai/containers__files__retrieve/recorded.json +15 -0
  354. package/__fixtures__/-2.complex.openai/containers__list/input.json +110 -0
  355. package/__fixtures__/-2.complex.openai/containers__list/output.go +64 -0
  356. package/__fixtures__/-2.complex.openai/containers__list/recorded.json +13 -0
  357. package/__fixtures__/-2.complex.openai/containers__retrieve/input.json +110 -0
  358. package/__fixtures__/-2.complex.openai/containers__retrieve/output.go +64 -0
  359. package/__fixtures__/-2.complex.openai/containers__retrieve/recorded.json +13 -0
  360. package/__fixtures__/-2.complex.openai/conversations__create/input.json +81 -0
  361. package/__fixtures__/-2.complex.openai/conversations__create/output.go +61 -0
  362. package/__fixtures__/-2.complex.openai/conversations__create/recorded.json +14 -0
  363. package/__fixtures__/-2.complex.openai/conversations__delete/input.json +57 -0
  364. package/__fixtures__/-2.complex.openai/conversations__delete/output.go +32 -0
  365. package/__fixtures__/-2.complex.openai/conversations__delete/recorded.json +14 -0
  366. package/__fixtures__/-2.complex.openai/conversations__items__create/input.json +120 -0
  367. package/__fixtures__/-2.complex.openai/conversations__items__create/output.go +64 -0
  368. package/__fixtures__/-2.complex.openai/conversations__items__create/recorded.json +20 -0
  369. package/__fixtures__/-2.complex.openai/conversations__items__delete/input.json +73 -0
  370. package/__fixtures__/-2.complex.openai/conversations__items__delete/output.go +38 -0
  371. package/__fixtures__/-2.complex.openai/conversations__items__delete/recorded.json +16 -0
  372. package/__fixtures__/-2.complex.openai/conversations__items__list/input.json +141 -0
  373. package/__fixtures__/-2.complex.openai/conversations__items__list/output.go +70 -0
  374. package/__fixtures__/-2.complex.openai/conversations__items__list/recorded.json +15 -0
  375. package/__fixtures__/-2.complex.openai/conversations__items__retrieve/input.json +141 -0
  376. package/__fixtures__/-2.complex.openai/conversations__items__retrieve/output.go +70 -0
  377. package/__fixtures__/-2.complex.openai/conversations__items__retrieve/recorded.json +15 -0
  378. package/__fixtures__/-2.complex.openai/conversations__retrieve/input.json +60 -0
  379. package/__fixtures__/-2.complex.openai/conversations__retrieve/output.go +35 -0
  380. package/__fixtures__/-2.complex.openai/conversations__retrieve/recorded.json +14 -0
  381. package/__fixtures__/-2.complex.openai/conversations__update/input.json +81 -0
  382. package/__fixtures__/-2.complex.openai/conversations__update/output.go +61 -0
  383. package/__fixtures__/-2.complex.openai/conversations__update/recorded.json +14 -0
  384. package/__fixtures__/-2.complex.openai/embeddings__create/input.json +139 -0
  385. package/__fixtures__/-2.complex.openai/embeddings__create/output.go +86 -0
  386. package/__fixtures__/-2.complex.openai/embeddings__create/recorded.json +21 -0
  387. package/__fixtures__/-2.complex.openai/files__content/input.json +110 -0
  388. package/__fixtures__/-2.complex.openai/files__content/output.go +64 -0
  389. package/__fixtures__/-2.complex.openai/files__content/recorded.json +13 -0
  390. package/__fixtures__/-2.complex.openai/files__create/input.json +111 -0
  391. package/__fixtures__/-2.complex.openai/files__create/output.go +67 -0
  392. package/__fixtures__/-2.complex.openai/files__create/recorded.json +21 -0
  393. package/__fixtures__/-2.complex.openai/files__delete/input.json +57 -0
  394. package/__fixtures__/-2.complex.openai/files__delete/output.go +32 -0
  395. package/__fixtures__/-2.complex.openai/files__delete/recorded.json +14 -0
  396. package/__fixtures__/-2.complex.openai/files__list/input.json +110 -0
  397. package/__fixtures__/-2.complex.openai/files__list/output.go +64 -0
  398. package/__fixtures__/-2.complex.openai/files__list/recorded.json +13 -0
  399. package/__fixtures__/-2.complex.openai/files__retrieve/input.json +110 -0
  400. package/__fixtures__/-2.complex.openai/files__retrieve/output.go +64 -0
  401. package/__fixtures__/-2.complex.openai/files__retrieve/recorded.json +13 -0
  402. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__create/input.json +97 -0
  403. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__create/output.go +59 -0
  404. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__create/recorded.json +21 -0
  405. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__delete/input.json +78 -0
  406. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__delete/output.go +43 -0
  407. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__delete/recorded.json +17 -0
  408. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__retrieve/input.json +133 -0
  409. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__retrieve/output.go +75 -0
  410. package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__retrieve/recorded.json +16 -0
  411. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__cancel/input.json +206 -0
  412. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__cancel/output.go +128 -0
  413. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__cancel/recorded.json +22 -0
  414. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__checkpoints__list/input.json +99 -0
  415. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__checkpoints__list/output.go +61 -0
  416. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__checkpoints__list/recorded.json +16 -0
  417. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__create/input.json +206 -0
  418. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__create/output.go +128 -0
  419. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__create/recorded.json +22 -0
  420. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list/input.json +98 -0
  421. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list/output.go +62 -0
  422. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list/recorded.json +14 -0
  423. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list-events/input.json +98 -0
  424. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list-events/output.go +62 -0
  425. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list-events/recorded.json +14 -0
  426. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__pause/input.json +206 -0
  427. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__pause/output.go +128 -0
  428. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__pause/recorded.json +22 -0
  429. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__resume/input.json +206 -0
  430. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__resume/output.go +128 -0
  431. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__resume/recorded.json +22 -0
  432. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__retrieve/input.json +98 -0
  433. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__retrieve/output.go +62 -0
  434. package/__fixtures__/-2.complex.openai/fine-tuning__jobs__retrieve/recorded.json +14 -0
  435. package/__fixtures__/-2.complex.openai/models__delete/input.json +57 -0
  436. package/__fixtures__/-2.complex.openai/models__delete/output.go +32 -0
  437. package/__fixtures__/-2.complex.openai/models__delete/recorded.json +14 -0
  438. package/__fixtures__/-2.complex.openai/models__list/input.json +42 -0
  439. package/__fixtures__/-2.complex.openai/models__list/output.go +30 -0
  440. package/__fixtures__/-2.complex.openai/models__list/recorded.json +13 -0
  441. package/__fixtures__/-2.complex.openai/models__retrieve/input.json +42 -0
  442. package/__fixtures__/-2.complex.openai/models__retrieve/output.go +30 -0
  443. package/__fixtures__/-2.complex.openai/models__retrieve/recorded.json +13 -0
  444. package/__fixtures__/-2.complex.openai/moderations__create/input.json +85 -0
  445. package/__fixtures__/-2.complex.openai/moderations__create/output.go +64 -0
  446. package/__fixtures__/-2.complex.openai/moderations__create/recorded.json +18 -0
  447. package/__fixtures__/-2.complex.openai/realtime__calls__accept/input.json +90 -0
  448. package/__fixtures__/-2.complex.openai/realtime__calls__accept/output.go +64 -0
  449. package/__fixtures__/-2.complex.openai/realtime__calls__accept/recorded.json +19 -0
  450. package/__fixtures__/-2.complex.openai/realtime__calls__hangup/input.json +90 -0
  451. package/__fixtures__/-2.complex.openai/realtime__calls__hangup/output.go +64 -0
  452. package/__fixtures__/-2.complex.openai/realtime__calls__hangup/recorded.json +19 -0
  453. package/__fixtures__/-2.complex.openai/realtime__calls__refer/input.json +90 -0
  454. package/__fixtures__/-2.complex.openai/realtime__calls__refer/output.go +64 -0
  455. package/__fixtures__/-2.complex.openai/realtime__calls__refer/recorded.json +19 -0
  456. package/__fixtures__/-2.complex.openai/realtime__calls__reject/input.json +90 -0
  457. package/__fixtures__/-2.complex.openai/realtime__calls__reject/output.go +64 -0
  458. package/__fixtures__/-2.complex.openai/realtime__calls__reject/recorded.json +19 -0
  459. package/__fixtures__/-2.complex.openai/realtime__client-secrets__create/input.json +88 -0
  460. package/__fixtures__/-2.complex.openai/realtime__client-secrets__create/output.go +68 -0
  461. package/__fixtures__/-2.complex.openai/realtime__client-secrets__create/recorded.json +15 -0
  462. package/__fixtures__/-2.complex.openai/responses__cancel/input.json +498 -0
  463. package/__fixtures__/-2.complex.openai/responses__cancel/output.go +342 -0
  464. package/__fixtures__/-2.complex.openai/responses__cancel/recorded.json +14 -0
  465. package/__fixtures__/-2.complex.openai/responses__compact/input.json +498 -0
  466. package/__fixtures__/-2.complex.openai/responses__compact/output.go +342 -0
  467. package/__fixtures__/-2.complex.openai/responses__compact/recorded.json +14 -0
  468. package/__fixtures__/-2.complex.openai/responses__create/input.json +498 -0
  469. package/__fixtures__/-2.complex.openai/responses__create/output.go +342 -0
  470. package/__fixtures__/-2.complex.openai/responses__create/recorded.json +14 -0
  471. package/__fixtures__/-2.complex.openai/responses__delete/input.json +57 -0
  472. package/__fixtures__/-2.complex.openai/responses__delete/output.go +32 -0
  473. package/__fixtures__/-2.complex.openai/responses__delete/recorded.json +14 -0
  474. package/__fixtures__/-2.complex.openai/responses__input-items__list/input.json +141 -0
  475. package/__fixtures__/-2.complex.openai/responses__input-items__list/output.go +70 -0
  476. package/__fixtures__/-2.complex.openai/responses__input-items__list/recorded.json +15 -0
  477. package/__fixtures__/-2.complex.openai/responses__input-tokens__count/input.json +226 -0
  478. package/__fixtures__/-2.complex.openai/responses__input-tokens__count/output.go +161 -0
  479. package/__fixtures__/-2.complex.openai/responses__input-tokens__count/recorded.json +15 -0
  480. package/__fixtures__/-2.complex.openai/responses__retrieve/input.json +125 -0
  481. package/__fixtures__/-2.complex.openai/responses__retrieve/output.go +68 -0
  482. package/__fixtures__/-2.complex.openai/responses__retrieve/recorded.json +14 -0
  483. package/__fixtures__/-2.complex.openai/skills__content__retrieve/input.json +62 -0
  484. package/__fixtures__/-2.complex.openai/skills__content__retrieve/output.go +37 -0
  485. package/__fixtures__/-2.complex.openai/skills__content__retrieve/recorded.json +15 -0
  486. package/__fixtures__/-2.complex.openai/skills__create/input.json +68 -0
  487. package/__fixtures__/-2.complex.openai/skills__create/output.go +51 -0
  488. package/__fixtures__/-2.complex.openai/skills__create/recorded.json +18 -0
  489. package/__fixtures__/-2.complex.openai/skills__delete/input.json +57 -0
  490. package/__fixtures__/-2.complex.openai/skills__delete/output.go +32 -0
  491. package/__fixtures__/-2.complex.openai/skills__delete/recorded.json +14 -0
  492. package/__fixtures__/-2.complex.openai/skills__list/input.json +95 -0
  493. package/__fixtures__/-2.complex.openai/skills__list/output.go +57 -0
  494. package/__fixtures__/-2.complex.openai/skills__list/recorded.json +13 -0
  495. package/__fixtures__/-2.complex.openai/skills__retrieve/input.json +95 -0
  496. package/__fixtures__/-2.complex.openai/skills__retrieve/output.go +57 -0
  497. package/__fixtures__/-2.complex.openai/skills__retrieve/recorded.json +13 -0
  498. package/__fixtures__/-2.complex.openai/skills__update/input.json +68 -0
  499. package/__fixtures__/-2.complex.openai/skills__update/output.go +51 -0
  500. package/__fixtures__/-2.complex.openai/skills__update/recorded.json +18 -0
  501. package/__fixtures__/-2.complex.openai/skills__versions__content__retrieve/input.json +78 -0
  502. package/__fixtures__/-2.complex.openai/skills__versions__content__retrieve/output.go +43 -0
  503. package/__fixtures__/-2.complex.openai/skills__versions__content__retrieve/recorded.json +17 -0
  504. package/__fixtures__/-2.complex.openai/skills__versions__create/input.json +99 -0
  505. package/__fixtures__/-2.complex.openai/skills__versions__create/output.go +65 -0
  506. package/__fixtures__/-2.complex.openai/skills__versions__create/recorded.json +20 -0
  507. package/__fixtures__/-2.complex.openai/skills__versions__delete/input.json +73 -0
  508. package/__fixtures__/-2.complex.openai/skills__versions__delete/output.go +38 -0
  509. package/__fixtures__/-2.complex.openai/skills__versions__delete/recorded.json +16 -0
  510. package/__fixtures__/-2.complex.openai/skills__versions__list/input.json +113 -0
  511. package/__fixtures__/-2.complex.openai/skills__versions__list/output.go +63 -0
  512. package/__fixtures__/-2.complex.openai/skills__versions__list/recorded.json +15 -0
  513. package/__fixtures__/-2.complex.openai/skills__versions__retrieve/input.json +113 -0
  514. package/__fixtures__/-2.complex.openai/skills__versions__retrieve/output.go +63 -0
  515. package/__fixtures__/-2.complex.openai/skills__versions__retrieve/recorded.json +15 -0
  516. package/__fixtures__/-2.complex.openai/uploads__cancel/input.json +145 -0
  517. package/__fixtures__/-2.complex.openai/uploads__cancel/output.go +83 -0
  518. package/__fixtures__/-2.complex.openai/uploads__cancel/recorded.json +27 -0
  519. package/__fixtures__/-2.complex.openai/uploads__complete/input.json +145 -0
  520. package/__fixtures__/-2.complex.openai/uploads__complete/output.go +83 -0
  521. package/__fixtures__/-2.complex.openai/uploads__complete/recorded.json +27 -0
  522. package/__fixtures__/-2.complex.openai/uploads__create/input.json +145 -0
  523. package/__fixtures__/-2.complex.openai/uploads__create/output.go +83 -0
  524. package/__fixtures__/-2.complex.openai/uploads__create/recorded.json +27 -0
  525. package/__fixtures__/-2.complex.openai/uploads__parts__create/input.json +89 -0
  526. package/__fixtures__/-2.complex.openai/uploads__parts__create/output.go +54 -0
  527. package/__fixtures__/-2.complex.openai/uploads__parts__create/recorded.json +20 -0
  528. package/__fixtures__/-2.complex.openai/vector-stores__create/input.json +149 -0
  529. package/__fixtures__/-2.complex.openai/vector-stores__create/output.go +95 -0
  530. package/__fixtures__/-2.complex.openai/vector-stores__create/recorded.json +14 -0
  531. package/__fixtures__/-2.complex.openai/vector-stores__delete/input.json +57 -0
  532. package/__fixtures__/-2.complex.openai/vector-stores__delete/output.go +32 -0
  533. package/__fixtures__/-2.complex.openai/vector-stores__delete/recorded.json +14 -0
  534. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__cancel/input.json +140 -0
  535. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__cancel/output.go +83 -0
  536. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__cancel/recorded.json +16 -0
  537. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__create/input.json +140 -0
  538. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__create/output.go +83 -0
  539. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__create/recorded.json +16 -0
  540. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__list-files/input.json +76 -0
  541. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__list-files/output.go +41 -0
  542. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__list-files/recorded.json +16 -0
  543. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__retrieve/input.json +76 -0
  544. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__retrieve/output.go +41 -0
  545. package/__fixtures__/-2.complex.openai/vector-stores__file-batches__retrieve/recorded.json +16 -0
  546. package/__fixtures__/-2.complex.openai/vector-stores__files__content/input.json +149 -0
  547. package/__fixtures__/-2.complex.openai/vector-stores__files__content/output.go +77 -0
  548. package/__fixtures__/-2.complex.openai/vector-stores__files__content/recorded.json +15 -0
  549. package/__fixtures__/-2.complex.openai/vector-stores__files__create/input.json +120 -0
  550. package/__fixtures__/-2.complex.openai/vector-stores__files__create/output.go +77 -0
  551. package/__fixtures__/-2.complex.openai/vector-stores__files__create/recorded.json +20 -0
  552. package/__fixtures__/-2.complex.openai/vector-stores__files__delete/input.json +73 -0
  553. package/__fixtures__/-2.complex.openai/vector-stores__files__delete/output.go +38 -0
  554. package/__fixtures__/-2.complex.openai/vector-stores__files__delete/recorded.json +16 -0
  555. package/__fixtures__/-2.complex.openai/vector-stores__files__list/input.json +149 -0
  556. package/__fixtures__/-2.complex.openai/vector-stores__files__list/output.go +77 -0
  557. package/__fixtures__/-2.complex.openai/vector-stores__files__list/recorded.json +15 -0
  558. package/__fixtures__/-2.complex.openai/vector-stores__files__retrieve/input.json +149 -0
  559. package/__fixtures__/-2.complex.openai/vector-stores__files__retrieve/output.go +77 -0
  560. package/__fixtures__/-2.complex.openai/vector-stores__files__retrieve/recorded.json +15 -0
  561. package/__fixtures__/-2.complex.openai/vector-stores__files__update/input.json +120 -0
  562. package/__fixtures__/-2.complex.openai/vector-stores__files__update/output.go +77 -0
  563. package/__fixtures__/-2.complex.openai/vector-stores__files__update/recorded.json +20 -0
  564. package/__fixtures__/-2.complex.openai/vector-stores__list/input.json +110 -0
  565. package/__fixtures__/-2.complex.openai/vector-stores__list/output.go +64 -0
  566. package/__fixtures__/-2.complex.openai/vector-stores__list/recorded.json +13 -0
  567. package/__fixtures__/-2.complex.openai/vector-stores__retrieve/input.json +110 -0
  568. package/__fixtures__/-2.complex.openai/vector-stores__retrieve/output.go +64 -0
  569. package/__fixtures__/-2.complex.openai/vector-stores__retrieve/recorded.json +13 -0
  570. package/__fixtures__/-2.complex.openai/vector-stores__search/input.json +149 -0
  571. package/__fixtures__/-2.complex.openai/vector-stores__search/output.go +95 -0
  572. package/__fixtures__/-2.complex.openai/vector-stores__search/recorded.json +14 -0
  573. package/__fixtures__/-2.complex.openai/vector-stores__update/input.json +149 -0
  574. package/__fixtures__/-2.complex.openai/vector-stores__update/output.go +95 -0
  575. package/__fixtures__/-2.complex.openai/vector-stores__update/recorded.json +14 -0
  576. package/__fixtures__/-2.complex.openai/videos__create/input.json +144 -0
  577. package/__fixtures__/-2.complex.openai/videos__create/output.go +85 -0
  578. package/__fixtures__/-2.complex.openai/videos__create/recorded.json +18 -0
  579. package/__fixtures__/-2.complex.openai/videos__create-character/input.json +144 -0
  580. package/__fixtures__/-2.complex.openai/videos__create-character/output.go +85 -0
  581. package/__fixtures__/-2.complex.openai/videos__create-character/recorded.json +18 -0
  582. package/__fixtures__/-2.complex.openai/videos__delete/input.json +57 -0
  583. package/__fixtures__/-2.complex.openai/videos__delete/output.go +32 -0
  584. package/__fixtures__/-2.complex.openai/videos__delete/recorded.json +14 -0
  585. package/__fixtures__/-2.complex.openai/videos__download-content/input.json +95 -0
  586. package/__fixtures__/-2.complex.openai/videos__download-content/output.go +57 -0
  587. package/__fixtures__/-2.complex.openai/videos__download-content/recorded.json +13 -0
  588. package/__fixtures__/-2.complex.openai/videos__edit/input.json +144 -0
  589. package/__fixtures__/-2.complex.openai/videos__edit/output.go +85 -0
  590. package/__fixtures__/-2.complex.openai/videos__edit/recorded.json +18 -0
  591. package/__fixtures__/-2.complex.openai/videos__extend/input.json +144 -0
  592. package/__fixtures__/-2.complex.openai/videos__extend/output.go +85 -0
  593. package/__fixtures__/-2.complex.openai/videos__extend/recorded.json +18 -0
  594. package/__fixtures__/-2.complex.openai/videos__get-character/input.json +95 -0
  595. package/__fixtures__/-2.complex.openai/videos__get-character/output.go +57 -0
  596. package/__fixtures__/-2.complex.openai/videos__get-character/recorded.json +13 -0
  597. package/__fixtures__/-2.complex.openai/videos__list/input.json +95 -0
  598. package/__fixtures__/-2.complex.openai/videos__list/output.go +57 -0
  599. package/__fixtures__/-2.complex.openai/videos__list/recorded.json +13 -0
  600. package/__fixtures__/-2.complex.openai/videos__remix/input.json +144 -0
  601. package/__fixtures__/-2.complex.openai/videos__remix/output.go +85 -0
  602. package/__fixtures__/-2.complex.openai/videos__remix/recorded.json +18 -0
  603. package/__fixtures__/-2.complex.openai/videos__retrieve/input.json +95 -0
  604. package/__fixtures__/-2.complex.openai/videos__retrieve/output.go +57 -0
  605. package/__fixtures__/-2.complex.openai/videos__retrieve/recorded.json +13 -0
  606. package/__fixtures__/1.basic/input.json +74 -0
  607. package/__fixtures__/1.basic/output/cmd/sample-api/main.go +24 -0
  608. package/__fixtures__/1.basic/output/go.mod +3 -0
  609. package/__fixtures__/1.basic/output/internal/runtime/config.go +23 -0
  610. package/__fixtures__/1.basic/output/internal/runtime/runtime.go +64 -0
  611. package/__fixtures__/1.basic/output/pkg/cmd/models.go +49 -0
  612. package/__fixtures__/2.crud/input.json +281 -0
  613. package/__fixtures__/2.crud/output/cmd/widgets-api/main.go +23 -0
  614. package/__fixtures__/2.crud/output/go.mod +3 -0
  615. package/__fixtures__/2.crud/output/internal/runtime/config.go +23 -0
  616. package/__fixtures__/2.crud/output/internal/runtime/runtime.go +64 -0
  617. package/__fixtures__/2.crud/output/pkg/cmd/widgets.go +178 -0
  618. package/__fixtures__/3.nested/input.json +196 -0
  619. package/__fixtures__/3.nested/output/cmd/stores-api/main.go +23 -0
  620. package/__fixtures__/3.nested/output/go.mod +3 -0
  621. package/__fixtures__/3.nested/output/internal/runtime/config.go +19 -0
  622. package/__fixtures__/3.nested/output/internal/runtime/runtime.go +64 -0
  623. package/__fixtures__/3.nested/output/pkg/cmd/stores.go +120 -0
  624. package/__fixtures__/4.body-flatten/input.json +153 -0
  625. package/__fixtures__/4.body-flatten/output/cmd/chat-api/main.go +23 -0
  626. package/__fixtures__/4.body-flatten/output/go.mod +3 -0
  627. package/__fixtures__/4.body-flatten/output/internal/runtime/config.go +23 -0
  628. package/__fixtures__/4.body-flatten/output/internal/runtime/runtime.go +64 -0
  629. package/__fixtures__/4.body-flatten/output/pkg/cmd/chat.go +90 -0
  630. package/__tests__/docs.test.ts +109 -0
  631. package/__tests__/e2e/harness.ts +304 -0
  632. package/__tests__/e2e/openai.test.ts +11 -0
  633. package/__tests__/opencli2go.test.ts +27 -0
  634. package/__tests__/utils.ts +80 -0
  635. package/biome.json +25 -0
  636. package/dist/index.cjs +630 -0
  637. package/dist/index.cjs.map +1 -0
  638. package/dist/index.d.cts +26 -0
  639. package/dist/index.d.ts +26 -0
  640. package/dist/index.js +592 -0
  641. package/dist/index.js.map +1 -0
  642. package/index.ts +1 -0
  643. package/package.json +27 -0
  644. package/src/command.ts +58 -0
  645. package/src/flags.ts +26 -0
  646. package/src/golit.ts +81 -0
  647. package/src/handler.ts +151 -0
  648. package/src/index.ts +3 -0
  649. package/src/main.ts +30 -0
  650. package/src/model.ts +147 -0
  651. package/src/naming.ts +44 -0
  652. package/src/project.ts +36 -0
  653. package/src/runtime.ts +134 -0
  654. package/src/types.ts +13 -0
  655. package/src/write.ts +10 -0
  656. package/tsconfig.json +18 -0
  657. package/tsup.config.ts +19 -0
  658. package/vitest.config.ts +8 -0
package/dist/index.js ADDED
@@ -0,0 +1,592 @@
1
+ // src/golit.ts
2
+ var TAB = " ";
3
+ var pad = (n) => TAB.repeat(n);
4
+ var lit = (s) => () => s;
5
+ var goStr = (s) => () => JSON.stringify(s);
6
+ var goBool = (b) => () => String(b);
7
+ function goStruct(type, fields, pointer = false) {
8
+ return (indent) => {
9
+ const head = `${pointer ? "&" : ""}${type}{`;
10
+ if (fields.length === 0) return `${head}}`;
11
+ let out = `${head}
12
+ `;
13
+ for (const [k, v] of fields) {
14
+ out += `${pad(indent + 1)}${k}: ${v(indent + 1)},
15
+ `;
16
+ }
17
+ out += `${pad(indent)}}`;
18
+ return out;
19
+ };
20
+ }
21
+ function goSlice(elemType, elems) {
22
+ return (indent) => {
23
+ if (elems.length === 0) return `[]${elemType}{}`;
24
+ let out = `[]${elemType}{
25
+ `;
26
+ for (const e of elems) {
27
+ out += `${pad(indent + 1)}${e(indent + 1)},
28
+ `;
29
+ }
30
+ out += `${pad(indent)}}`;
31
+ return out;
32
+ };
33
+ }
34
+ var Imports = class {
35
+ constructor() {
36
+ this.paths = /* @__PURE__ */ new Set();
37
+ }
38
+ add(...importPaths) {
39
+ for (const p of importPaths) this.paths.add(p);
40
+ return this;
41
+ }
42
+ get size() {
43
+ return this.paths.size;
44
+ }
45
+ render() {
46
+ if (this.paths.size === 0) return "";
47
+ const all = [...this.paths];
48
+ const std = all.filter((p) => !p.split("/")[0].includes(".")).sort();
49
+ const ext = all.filter((p) => p.split("/")[0].includes(".")).sort();
50
+ const groups = [std, ext].filter((g) => g.length > 0);
51
+ const block = groups.map((g) => g.map((p) => `${TAB}${JSON.stringify(p)}`).join("\n")).join("\n\n");
52
+ return `import (
53
+ ${block}
54
+ )`;
55
+ }
56
+ };
57
+ function goFile(pkg, imports, decls) {
58
+ const parts = [`package ${pkg}`];
59
+ if (imports.size > 0) parts.push(imports.render());
60
+ parts.push(...decls);
61
+ return `${parts.join("\n\n")}
62
+ `;
63
+ }
64
+
65
+ // src/flags.ts
66
+ var FLAG_TYPE = {
67
+ bool: "BoolFlag",
68
+ int: "IntFlag",
69
+ float: "FloatFlag",
70
+ slice: "StringSliceFlag",
71
+ string: "StringFlag",
72
+ json: "StringFlag",
73
+ file: "StringFlag"
74
+ };
75
+ function renderFlag(f) {
76
+ const type = `cli.${FLAG_TYPE[f.goType]}`;
77
+ const fields = [["Name", goStr(f.flagName)]];
78
+ if (f.aliases.length) fields.push(["Aliases", goSlice("string", f.aliases.map(goStr))]);
79
+ if (f.description) fields.push(["Usage", goStr(f.description)]);
80
+ if (f.required) fields.push(["Required", goBool(true)]);
81
+ if (f.hidden) fields.push(["Hidden", goBool(true)]);
82
+ return goStruct(type, fields, true);
83
+ }
84
+ function renderFlags(flags) {
85
+ return flags.map(renderFlag);
86
+ }
87
+
88
+ // src/naming.ts
89
+ function splitWords(input) {
90
+ return input.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_\-./]+/).map((w) => w.trim().toLowerCase()).filter(Boolean);
91
+ }
92
+ function pascalCase(input) {
93
+ return splitWords(input).map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
94
+ }
95
+ function goVar(input) {
96
+ const pascal = pascalCase(input);
97
+ if (!pascal) return "arg";
98
+ let name = pascal.charAt(0).toLowerCase() + pascal.slice(1);
99
+ name = name.replace(/Id\b/g, "ID").replace(/Url\b/g, "URL").replace(/Api\b/g, "API");
100
+ if (GO_KEYWORDS.has(name)) name = `${name}_`;
101
+ return name;
102
+ }
103
+ function slug(input) {
104
+ return splitWords(input).join("-").replace(/[^a-z0-9-]/g, "");
105
+ }
106
+ function screamingSnakeCase(input) {
107
+ return splitWords(input).join("_").toUpperCase().replace(/[^A-Z0-9_]/g, "");
108
+ }
109
+ var GO_KEYWORDS = /* @__PURE__ */ new Set([
110
+ "break",
111
+ "case",
112
+ "chan",
113
+ "const",
114
+ "continue",
115
+ "default",
116
+ "defer",
117
+ "else",
118
+ "fallthrough",
119
+ "for",
120
+ "func",
121
+ "go",
122
+ "goto",
123
+ "if",
124
+ "import",
125
+ "interface",
126
+ "map",
127
+ "package",
128
+ "range",
129
+ "return",
130
+ "select",
131
+ "struct",
132
+ "switch",
133
+ "type",
134
+ "var"
135
+ ]);
136
+
137
+ // src/model.ts
138
+ function fromToken(from, kind) {
139
+ if (!from) return void 0;
140
+ const [k, ...rest] = from.split(":");
141
+ return k === kind ? rest.join(":") : void 0;
142
+ }
143
+ function encodingToGoType(encoding) {
144
+ switch (encoding) {
145
+ case "integer":
146
+ return "int";
147
+ case "number":
148
+ return "float";
149
+ case "boolean":
150
+ return "bool";
151
+ case "array":
152
+ return "slice";
153
+ case "json":
154
+ return "json";
155
+ case "file":
156
+ return "file";
157
+ case "string":
158
+ return "string";
159
+ default:
160
+ return void 0;
161
+ }
162
+ }
163
+ function optionGoType(opt, encoding) {
164
+ if (!opt.arguments || opt.arguments.length === 0) return "bool";
165
+ const fromEncoding = encodingToGoType(encoding);
166
+ if (fromEncoding) return fromEncoding;
167
+ const arg = opt.arguments[0];
168
+ if (arg.arity) return "slice";
169
+ switch (arg.name) {
170
+ case "integer":
171
+ return "int";
172
+ case "number":
173
+ return "float";
174
+ case "boolean":
175
+ return "bool";
176
+ case "json":
177
+ return "json";
178
+ default:
179
+ return "string";
180
+ }
181
+ }
182
+ function buildLeafModel(command) {
183
+ var _a;
184
+ const x = command["x-openapi"];
185
+ const params = x.params || [];
186
+ const body = x.body;
187
+ const pathArgs = (command.arguments || []).map((arg, idx) => {
188
+ const param = params.find((p) => p.in === "path" && fromToken(p.from, "argument") === arg.name);
189
+ return { goVar: goVar(arg.name), wireName: (param == null ? void 0 : param.name) ?? arg.name, idx };
190
+ });
191
+ const bodyPropByOption = /* @__PURE__ */ new Map();
192
+ const bodyWireByOption = /* @__PURE__ */ new Map();
193
+ for (const prop of (body == null ? void 0 : body.properties) || []) {
194
+ const flag = fromToken(prop.from, "option");
195
+ if (flag) {
196
+ bodyPropByOption.set(flag, prop.encoding || "string");
197
+ bodyWireByOption.set(flag, prop.name);
198
+ }
199
+ }
200
+ const flags = [];
201
+ for (const opt of command.options || []) {
202
+ const paramEntry = params.find((p) => fromToken(p.from, "option") === opt.name && p.in !== "path");
203
+ let location;
204
+ let wireName;
205
+ let encoding;
206
+ if (paramEntry) {
207
+ location = paramEntry.in;
208
+ wireName = paramEntry.name;
209
+ } else if (bodyPropByOption.has(opt.name)) {
210
+ location = "body";
211
+ wireName = bodyWireByOption.get(opt.name) ?? opt.name;
212
+ encoding = bodyPropByOption.get(opt.name);
213
+ } else {
214
+ location = "query";
215
+ wireName = opt.name;
216
+ }
217
+ flags.push({
218
+ flagName: opt.name,
219
+ wireName,
220
+ location,
221
+ goType: optionGoType(opt, encoding),
222
+ required: opt.required === true,
223
+ hidden: opt.hidden === true,
224
+ aliases: opt.aliases || [],
225
+ description: opt.description
226
+ });
227
+ }
228
+ const bodyStyle = body == null ? void 0 : body.style;
229
+ const bodyJsonOption = bodyStyle === "json" ? fromToken(body == null ? void 0 : body.from, "option") ?? ((_a = flags.find((f) => f.location === "body")) == null ? void 0 : _a.flagName) : void 0;
230
+ const hasBody = !!body && (bodyStyle === "json" || flags.some((f) => f.location === "body"));
231
+ return {
232
+ method: (x.method || "get").toUpperCase(),
233
+ path: x.path,
234
+ pathArgs,
235
+ flags,
236
+ hasBody,
237
+ bodyStyle,
238
+ bodyJsonOption
239
+ };
240
+ }
241
+
242
+ // src/handler.ts
243
+ var CLI = "github.com/urfave/cli/v3";
244
+ var q = (s) => JSON.stringify(s);
245
+ function readExpr(flagName, t) {
246
+ switch (t) {
247
+ case "bool":
248
+ return `cmd.Bool(${q(flagName)})`;
249
+ case "int":
250
+ return `cmd.Int(${q(flagName)})`;
251
+ case "float":
252
+ return `cmd.Float(${q(flagName)})`;
253
+ case "slice":
254
+ return `cmd.StringSlice(${q(flagName)})`;
255
+ default:
256
+ return `cmd.String(${q(flagName)})`;
257
+ }
258
+ }
259
+ function pathExpr(model, imports) {
260
+ const segs = model.path.split(/(\{[^}]+\})/).filter((s) => s !== "");
261
+ const parts = [];
262
+ let lit2 = "";
263
+ for (const seg of segs) {
264
+ const m = seg.match(/^\{(.+)\}$/);
265
+ if (m) {
266
+ if (lit2) {
267
+ parts.push(q(lit2));
268
+ lit2 = "";
269
+ }
270
+ const a = model.pathArgs.find((p) => p.wireName === m[1]);
271
+ parts.push(`url.PathEscape(${a ? a.goVar : '""'})`);
272
+ imports.add("net/url");
273
+ } else {
274
+ lit2 += seg;
275
+ }
276
+ }
277
+ if (lit2) parts.push(q(lit2));
278
+ return parts.length ? parts.join(" + ") : '""';
279
+ }
280
+ function renderHandler(pathNames, command, module, imports) {
281
+ const model = buildLeafModel(command);
282
+ const name = `handle${pathNames.map(pascalCase).join("")}`;
283
+ imports.add("context", CLI, `${module}/internal/runtime`);
284
+ const lines = [];
285
+ const push = (s = "") => lines.push(s);
286
+ const pe = pathExpr(model, imports);
287
+ for (const a of model.pathArgs) {
288
+ if (pe.includes(`url.PathEscape(${a.goVar})`)) push(`${a.goVar} := cmd.Args().Get(${a.idx})`);
289
+ }
290
+ push(`path := ${pe}`);
291
+ const queryFlags = model.flags.filter((f) => f.location === "query");
292
+ if (queryFlags.length) {
293
+ imports.add("net/url");
294
+ push("query := url.Values{}");
295
+ for (const f of queryFlags) {
296
+ const read = readExpr(f.flagName, f.goType);
297
+ let val = read;
298
+ if (f.goType !== "string") {
299
+ val = `fmt.Sprint(${read})`;
300
+ imports.add("fmt");
301
+ }
302
+ push(`if cmd.IsSet(${q(f.flagName)}) {`);
303
+ push(` query.Set(${q(f.wireName)}, ${val})`);
304
+ push("}");
305
+ }
306
+ }
307
+ const headerFlags = model.flags.filter((f) => f.location === "header" || f.location === "cookie");
308
+ if (headerFlags.length) {
309
+ imports.add("net/http");
310
+ push("headers := http.Header{}");
311
+ for (const f of headerFlags) {
312
+ const read = readExpr(f.flagName, f.goType);
313
+ let val = read;
314
+ if (f.goType !== "string") {
315
+ val = `fmt.Sprint(${read})`;
316
+ imports.add("fmt");
317
+ }
318
+ push(`if cmd.IsSet(${q(f.flagName)}) {`);
319
+ push(` headers.Set(${q(f.wireName)}, ${val})`);
320
+ push("}");
321
+ }
322
+ }
323
+ if (model.hasBody) {
324
+ imports.add("encoding/json");
325
+ if (model.bodyStyle === "json" && model.bodyJsonOption) {
326
+ push("var bodyBytes []byte");
327
+ push(`if cmd.IsSet(${q(model.bodyJsonOption)}) {`);
328
+ push(` bodyBytes = []byte(cmd.String(${q(model.bodyJsonOption)}))`);
329
+ push("}");
330
+ } else {
331
+ push("body := map[string]any{}");
332
+ for (const f of model.flags.filter((x) => x.location === "body")) {
333
+ push(`if cmd.IsSet(${q(f.flagName)}) {`);
334
+ if (f.goType === "json") {
335
+ push(` raw := cmd.String(${q(f.flagName)})`);
336
+ push(" var v any");
337
+ push(" if err := json.Unmarshal([]byte(raw), &v); err != nil {");
338
+ push(" v = raw");
339
+ push(" }");
340
+ push(` body[${q(f.wireName)}] = v`);
341
+ } else {
342
+ push(` body[${q(f.wireName)}] = ${readExpr(f.flagName, f.goType)}`);
343
+ }
344
+ push("}");
345
+ }
346
+ push("bodyBytes, err := json.Marshal(body)");
347
+ push("if err != nil {");
348
+ push(" return err");
349
+ push("}");
350
+ }
351
+ }
352
+ push("req := runtime.Request{");
353
+ push(` Method: ${q(model.method)},`);
354
+ push(" Path: path,");
355
+ if (queryFlags.length) push(" Query: query,");
356
+ if (headerFlags.length) push(" Headers: headers,");
357
+ if (model.hasBody) push(" Body: bodyBytes,");
358
+ push("}");
359
+ push("return runtime.Do(ctx, req)");
360
+ const body = lines.map((l) => ` ${l}`).join("\n");
361
+ const code = `func ${name}(ctx context.Context, cmd *cli.Command) error {
362
+ ${body}
363
+ }`;
364
+ return { name, code };
365
+ }
366
+
367
+ // src/command.ts
368
+ var CLI2 = "github.com/urfave/cli/v3";
369
+ function renderCommand(command, pathNames, module, imports, handlers) {
370
+ var _a, _b;
371
+ imports.add(CLI2);
372
+ const fields = [["Name", goStr(command.name)]];
373
+ if ((_a = command.aliases) == null ? void 0 : _a.length) fields.push(["Aliases", goSlice("string", command.aliases.map(goStr))]);
374
+ if (command.description) fields.push(["Usage", goStr(command.description)]);
375
+ if (command.hidden) fields.push(["Hidden", goBool(true)]);
376
+ if ((_b = command.commands) == null ? void 0 : _b.length) {
377
+ const subs = command.commands.map(
378
+ (sub) => renderCommand(sub, [...pathNames, sub.name], module, imports, handlers)
379
+ );
380
+ fields.push(["Commands", goSlice("*cli.Command", subs)]);
381
+ } else if (command["x-openapi"]) {
382
+ const flags = renderFlags(buildLeafModel(command).flags);
383
+ if (flags.length) fields.push(["Flags", goSlice("cli.Flag", flags)]);
384
+ const handler = renderHandler(pathNames, command, module, imports);
385
+ fields.push(["Action", lit(handler.name)]);
386
+ handlers.push(handler.code);
387
+ }
388
+ return goStruct("cli.Command", fields, true);
389
+ }
390
+ function renderResourceFile(topCommand, module) {
391
+ const imports = new Imports();
392
+ const handlers = [];
393
+ const struct = renderCommand(topCommand, [topCommand.name], module, imports, handlers);
394
+ const ctorName = `New${pascalCase(topCommand.name)}Command`;
395
+ const ctor = `func ${ctorName}() *cli.Command {
396
+ return ${struct(1)}
397
+ }`;
398
+ const content = goFile("cmd", imports, [ctor, ...handlers]);
399
+ const fileBase = splitWords(topCommand.name).join("") || "command";
400
+ return { path: `pkg/cmd/${fileBase}.go`, content, constructor: ctorName };
401
+ }
402
+
403
+ // src/main.ts
404
+ var CLI3 = "github.com/urfave/cli/v3";
405
+ function renderMain(spec, binName, module, constructors) {
406
+ var _a, _b, _c;
407
+ const imports = new Imports().add("context", "log", "os", CLI3, `${module}/pkg/cmd`);
408
+ const fields = [["Name", goStr(binName)]];
409
+ const usage = ((_a = spec.info) == null ? void 0 : _a.summary) || ((_b = spec.info) == null ? void 0 : _b.description);
410
+ if (usage) fields.push(["Usage", goStr(usage)]);
411
+ if ((_c = spec.info) == null ? void 0 : _c.version) fields.push(["Version", goStr(spec.info.version)]);
412
+ fields.push(["Commands", goSlice("*cli.Command", constructors.map((c) => lit(`cmd.${c}()`)))]);
413
+ const app = goStruct("cli.Command", fields, true);
414
+ const body = ` app := ${app(1)}
415
+ if err := app.Run(context.Background(), os.Args); err != nil {
416
+ log.Fatal(err)
417
+ }`;
418
+ const fn = `func main() {
419
+ ${body}
420
+ }`;
421
+ return goFile("main", imports, [fn]);
422
+ }
423
+
424
+ // src/runtime.ts
425
+ function runtimeGo() {
426
+ return `package runtime
427
+
428
+ import (
429
+ "bytes"
430
+ "context"
431
+ "fmt"
432
+ "io"
433
+ "net/http"
434
+ "net/url"
435
+ "strings"
436
+ )
437
+
438
+ // Request is a generic API request assembled by a generated command handler.
439
+ type Request struct {
440
+ Method string
441
+ Path string
442
+ Query url.Values
443
+ Headers http.Header
444
+ Body []byte
445
+ }
446
+
447
+ // Do executes the request against the configured base URL (applying auth) and
448
+ // prints the response body to stdout.
449
+ func Do(ctx context.Context, req Request) error {
450
+ endpoint := strings.TrimRight(BaseURL(), "/") + req.Path
451
+ if len(req.Query) > 0 {
452
+ endpoint += "?" + req.Query.Encode()
453
+ }
454
+
455
+ var body io.Reader
456
+ if len(req.Body) > 0 {
457
+ body = bytes.NewReader(req.Body)
458
+ }
459
+
460
+ httpReq, err := http.NewRequestWithContext(ctx, req.Method, endpoint, body)
461
+ if err != nil {
462
+ return err
463
+ }
464
+ for key, values := range req.Headers {
465
+ for _, value := range values {
466
+ httpReq.Header.Add(key, value)
467
+ }
468
+ }
469
+ if len(req.Body) > 0 && httpReq.Header.Get("Content-Type") == "" {
470
+ httpReq.Header.Set("Content-Type", "application/json")
471
+ }
472
+ applyAuth(httpReq)
473
+
474
+ resp, err := http.DefaultClient.Do(httpReq)
475
+ if err != nil {
476
+ return err
477
+ }
478
+ defer resp.Body.Close()
479
+
480
+ out, err := io.ReadAll(resp.Body)
481
+ if err != nil {
482
+ return err
483
+ }
484
+ fmt.Println(string(out))
485
+ if resp.StatusCode >= 400 {
486
+ return fmt.Errorf("request failed: %s", resp.Status)
487
+ }
488
+ return nil
489
+ }
490
+ `;
491
+ }
492
+ function authBlock(scheme) {
493
+ const env = scheme.envVar || "API_KEY";
494
+ const name = scheme.name || "";
495
+ switch (scheme.kind) {
496
+ case "bearer":
497
+ return ` if v := os.Getenv(${JSON.stringify(env)}); v != "" {
498
+ req.Header.Set("Authorization", "Bearer "+v)
499
+ }`;
500
+ case "apiKey-header":
501
+ return ` if v := os.Getenv(${JSON.stringify(env)}); v != "" {
502
+ req.Header.Set(${JSON.stringify(name)}, v)
503
+ }`;
504
+ case "apiKey-query":
505
+ return ` if v := os.Getenv(${JSON.stringify(env)}); v != "" {
506
+ q := req.URL.Query()
507
+ q.Set(${JSON.stringify(name)}, v)
508
+ req.URL.RawQuery = q.Encode()
509
+ }`;
510
+ case "apiKey-cookie":
511
+ return ` if v := os.Getenv(${JSON.stringify(env)}); v != "" {
512
+ req.AddCookie(&http.Cookie{Name: ${JSON.stringify(name)}, Value: v})
513
+ }`;
514
+ case "basic":
515
+ return ` user := os.Getenv(${JSON.stringify(`${env}_USERNAME`)})
516
+ pass := os.Getenv(${JSON.stringify(`${env}_PASSWORD`)})
517
+ if user != "" || pass != "" {
518
+ req.SetBasicAuth(user, pass)
519
+ }`;
520
+ default:
521
+ return null;
522
+ }
523
+ }
524
+ function configGo(spec, binName, baseURL) {
525
+ var _a;
526
+ const prefix = screamingSnakeCase(binName);
527
+ const security = ((_a = spec["x-openapi"]) == null ? void 0 : _a.security) || [];
528
+ const blocks = security.map(authBlock).filter((b) => b !== null);
529
+ const authBody = blocks.length ? `
530
+ ${blocks.join("\n")}
531
+ ` : "";
532
+ return `package runtime
533
+
534
+ import (
535
+ "net/http"
536
+ "os"
537
+ )
538
+
539
+ const defaultBaseURL = ${JSON.stringify(baseURL)}
540
+
541
+ // BaseURL returns the API base URL, overridable via ${prefix}_BASE_URL.
542
+ func BaseURL() string {
543
+ if v := os.Getenv(${JSON.stringify(`${prefix}_BASE_URL`)}); v != "" {
544
+ return v
545
+ }
546
+ return defaultBaseURL
547
+ }
548
+
549
+ // applyAuth attaches credentials read from the environment to the request.
550
+ func applyAuth(req *http.Request) {${authBody}}
551
+ `;
552
+ }
553
+
554
+ // src/project.ts
555
+ function opencli2go(spec, options = {}) {
556
+ var _a, _b, _c;
557
+ const binName = options.binName ?? (slug(((_a = spec.info) == null ? void 0 : _a.title) || "cli") || "cli");
558
+ const module = options.modulePath ?? `example.com/${binName}`;
559
+ const goVersion = options.goVersion ?? "1.22";
560
+ const baseURL = options.baseURL ?? ((_c = (_b = spec["x-openapi"]) == null ? void 0 : _b.servers) == null ? void 0 : _c[0]) ?? "";
561
+ const files = {};
562
+ files["go.mod"] = `module ${module}
563
+
564
+ go ${goVersion}
565
+ `;
566
+ const constructors = [];
567
+ for (const top of spec.commands || []) {
568
+ const resource = renderResourceFile(top, module);
569
+ files[resource.path] = resource.content;
570
+ constructors.push(resource.constructor);
571
+ }
572
+ files[`cmd/${binName}/main.go`] = renderMain(spec, binName, module, constructors);
573
+ files["internal/runtime/runtime.go"] = runtimeGo();
574
+ files["internal/runtime/config.go"] = configGo(spec, binName, baseURL);
575
+ return files;
576
+ }
577
+
578
+ // src/write.ts
579
+ async function writeProject(files, outDir) {
580
+ const fs = await import("fs/promises");
581
+ const path = await import("path");
582
+ for (const [rel, content] of Object.entries(files)) {
583
+ const full = path.join(outDir, rel);
584
+ await fs.mkdir(path.dirname(full), { recursive: true });
585
+ await fs.writeFile(full, content, "utf8");
586
+ }
587
+ }
588
+ export {
589
+ opencli2go,
590
+ writeProject
591
+ };
592
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/golit.ts","../src/flags.ts","../src/naming.ts","../src/model.ts","../src/handler.ts","../src/command.ts","../src/main.ts","../src/runtime.ts","../src/project.ts","../src/write.ts"],"sourcesContent":["// Tiny Go-source string helpers (fern's CLI-generator style): just enough to\n// render struct/slice literals with correct indentation — not a full AST.\n\nconst TAB = '\\t';\nconst pad = (n: number) => TAB.repeat(n);\n\n/** A value renderer: its first line is emitted inline; nested lines indent to `indent`. */\nexport type GoVal = (indent: number) => string;\n\n/** A pre-rendered scalar (identifier, number, bool, expression). */\nexport const lit = (s: string): GoVal => () => s;\n\n/** A Go double-quoted string literal (JSON escaping is valid Go for our content). */\nexport const goStr = (s: string): GoVal => () => JSON.stringify(s);\n\nexport const goBool = (b: boolean): GoVal => () => String(b);\nexport const goInt = (n: number): GoVal => () => String(n);\n\n/** A struct literal: `Type{ Field: value, ... }` (prefix `&` when pointer). */\nexport function goStruct(type: string, fields: [string, GoVal][], pointer = false): GoVal {\n return (indent: number) => {\n const head = `${pointer ? '&' : ''}${type}{`;\n if (fields.length === 0) return `${head}}`;\n let out = `${head}\\n`;\n for (const [k, v] of fields) {\n out += `${pad(indent + 1)}${k}: ${v(indent + 1)},\\n`;\n }\n out += `${pad(indent)}}`;\n return out;\n };\n}\n\n/** A slice literal: `[]Elem{ a, b, ... }`. */\nexport function goSlice(elemType: string, elems: GoVal[]): GoVal {\n return (indent: number) => {\n if (elems.length === 0) return `[]${elemType}{}`;\n let out = `[]${elemType}{\\n`;\n for (const e of elems) {\n out += `${pad(indent + 1)}${e(indent + 1)},\\n`;\n }\n out += `${pad(indent)}}`;\n return out;\n };\n}\n\n/** Render a top-level declaration value (indent 0). */\nexport function render(v: GoVal): string {\n return v(0);\n}\n\n/** Tracks the import paths a file needs. Qualifiers are implied by the emitted code. */\nexport class Imports {\n private paths = new Set<string>();\n\n add(...importPaths: string[]): this {\n for (const p of importPaths) this.paths.add(p);\n return this;\n }\n\n get size(): number {\n return this.paths.size;\n }\n\n render(): string {\n if (this.paths.size === 0) return '';\n const all = [...this.paths];\n const std = all.filter((p) => !p.split('/')[0].includes('.')).sort();\n const ext = all.filter((p) => p.split('/')[0].includes('.')).sort();\n const groups = [std, ext].filter((g) => g.length > 0);\n const block = groups.map((g) => g.map((p) => `${TAB}${JSON.stringify(p)}`).join('\\n')).join('\\n\\n');\n return `import (\\n${block}\\n)`;\n }\n}\n\n/** Assemble a complete Go file: package clause + imports + declarations. */\nexport function goFile(pkg: string, imports: Imports, decls: string[]): string {\n const parts = [`package ${pkg}`];\n if (imports.size > 0) parts.push(imports.render());\n parts.push(...decls);\n return `${parts.join('\\n\\n')}\\n`;\n}\n","import { goBool, goSlice, goStr, goStruct, type GoVal } from './golit';\nimport type { FlagModel, GoType } from './model';\n\nconst FLAG_TYPE: Record<GoType, string> = {\n bool: 'BoolFlag',\n int: 'IntFlag',\n float: 'FloatFlag',\n slice: 'StringSliceFlag',\n string: 'StringFlag',\n json: 'StringFlag',\n file: 'StringFlag',\n};\n\nexport function renderFlag(f: FlagModel): GoVal {\n const type = `cli.${FLAG_TYPE[f.goType]}`;\n const fields: [string, GoVal][] = [['Name', goStr(f.flagName)]];\n if (f.aliases.length) fields.push(['Aliases', goSlice('string', f.aliases.map(goStr))]);\n if (f.description) fields.push(['Usage', goStr(f.description)]);\n if (f.required) fields.push(['Required', goBool(true)]);\n if (f.hidden) fields.push(['Hidden', goBool(true)]);\n return goStruct(type, fields, true);\n}\n\nexport function renderFlags(flags: FlagModel[]): GoVal[] {\n return flags.map(renderFlag);\n}\n","/** Split an identifier (camel/snake/kebab/space) into lowercase words. */\nexport function splitWords(input: string): string[] {\n return input\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .split(/[\\s_\\-./]+/)\n .map((w) => w.trim().toLowerCase())\n .filter(Boolean);\n}\n\n/** PascalCase, e.g. \"chat-completions\" → \"ChatCompletions\". */\nexport function pascalCase(input: string): string {\n return splitWords(input)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join('');\n}\n\n/** lowerCamelCase Go variable name, e.g. \"store-id\" → \"storeID\". */\nexport function goVar(input: string): string {\n const pascal = pascalCase(input);\n if (!pascal) return 'arg';\n let name = pascal.charAt(0).toLowerCase() + pascal.slice(1);\n // Common Go initialism cleanup for ergonomics.\n name = name.replace(/Id\\b/g, 'ID').replace(/Url\\b/g, 'URL').replace(/Api\\b/g, 'API');\n // Avoid Go keywords.\n if (GO_KEYWORDS.has(name)) name = `${name}_`;\n return name;\n}\n\n/** Slug for a binary / module name. */\nexport function slug(input: string): string {\n return splitWords(input).join('-').replace(/[^a-z0-9-]/g, '');\n}\n\n/** SCREAMING_SNAKE_CASE env-var prefix. */\nexport function screamingSnakeCase(input: string): string {\n return splitWords(input).join('_').toUpperCase().replace(/[^A-Z0-9_]/g, '');\n}\n\nconst GO_KEYWORDS = new Set([\n 'break', 'case', 'chan', 'const', 'continue', 'default', 'defer', 'else', 'fallthrough',\n 'for', 'func', 'go', 'goto', 'if', 'import', 'interface', 'map', 'package', 'range',\n 'return', 'select', 'struct', 'switch', 'type', 'var',\n]);\n","import type { Command, Option, XOpenApiCommand } from '@xyd-js/opencli';\n\nimport { goVar } from './naming';\n\nexport type GoType = 'string' | 'int' | 'float' | 'bool' | 'slice' | 'json' | 'file';\n\nexport interface PathArg {\n goVar: string;\n wireName: string;\n idx: number;\n}\n\nexport interface FlagModel {\n flagName: string;\n wireName: string;\n location: 'query' | 'header' | 'cookie' | 'body';\n goType: GoType;\n required: boolean;\n hidden: boolean;\n aliases: string[];\n description?: string;\n}\n\nexport interface LeafModel {\n method: string; // uppercase HTTP method\n path: string;\n pathArgs: PathArg[];\n flags: FlagModel[];\n hasBody: boolean;\n bodyStyle?: string; // 'flatten' | 'json' | 'multipart'\n bodyJsonOption?: string; // flag name when the whole body is one JSON option (style=json)\n}\n\nfunction fromToken(from: string | undefined, kind: 'option' | 'argument'): string | undefined {\n if (!from) return undefined;\n const [k, ...rest] = from.split(':');\n return k === kind ? rest.join(':') : undefined;\n}\n\nfunction encodingToGoType(encoding: string | undefined): GoType | undefined {\n switch (encoding) {\n case 'integer':\n return 'int';\n case 'number':\n return 'float';\n case 'boolean':\n return 'bool';\n case 'array':\n return 'slice';\n case 'json':\n return 'json';\n case 'file':\n return 'file';\n case 'string':\n return 'string';\n default:\n return undefined;\n }\n}\n\nfunction optionGoType(opt: Option, encoding?: string): GoType {\n if (!opt.arguments || opt.arguments.length === 0) return 'bool';\n const fromEncoding = encodingToGoType(encoding);\n if (fromEncoding) return fromEncoding;\n const arg = opt.arguments[0];\n if (arg.arity) return 'slice';\n switch (arg.name) {\n case 'integer':\n return 'int';\n case 'number':\n return 'float';\n case 'boolean':\n return 'bool';\n case 'json':\n return 'json';\n default:\n return 'string';\n }\n}\n\n/** Build the normalized request model for a leaf command from its x-openapi binding. */\nexport function buildLeafModel(command: Command): LeafModel {\n const x = command['x-openapi'] as XOpenApiCommand;\n const params = x.params || [];\n const body = x.body;\n\n const pathArgs: PathArg[] = (command.arguments || []).map((arg, idx) => {\n const param = params.find((p) => p.in === 'path' && fromToken(p.from, 'argument') === arg.name);\n return { goVar: goVar(arg.name), wireName: param?.name ?? arg.name, idx };\n });\n\n const bodyPropByOption = new Map<string, string>(); // flagName -> encoding\n const bodyWireByOption = new Map<string, string>(); // flagName -> wire name\n for (const prop of body?.properties || []) {\n const flag = fromToken(prop.from, 'option');\n if (flag) {\n bodyPropByOption.set(flag, prop.encoding || 'string');\n bodyWireByOption.set(flag, prop.name);\n }\n }\n\n const flags: FlagModel[] = [];\n for (const opt of command.options || []) {\n const paramEntry = params.find((p) => fromToken(p.from, 'option') === opt.name && p.in !== 'path');\n let location: FlagModel['location'];\n let wireName: string;\n let encoding: string | undefined;\n\n if (paramEntry) {\n location = paramEntry.in as FlagModel['location'];\n wireName = paramEntry.name;\n } else if (bodyPropByOption.has(opt.name)) {\n location = 'body';\n wireName = bodyWireByOption.get(opt.name) ?? opt.name;\n encoding = bodyPropByOption.get(opt.name);\n } else {\n location = 'query';\n wireName = opt.name;\n }\n\n flags.push({\n flagName: opt.name,\n wireName,\n location,\n goType: optionGoType(opt, encoding),\n required: opt.required === true,\n hidden: opt.hidden === true,\n aliases: opt.aliases || [],\n description: opt.description,\n });\n }\n\n const bodyStyle = body?.style;\n const bodyJsonOption =\n bodyStyle === 'json' ? fromToken(body?.from, 'option') ?? flags.find((f) => f.location === 'body')?.flagName : undefined;\n const hasBody = !!body && (bodyStyle === 'json' || flags.some((f) => f.location === 'body'));\n\n return {\n method: (x.method || 'get').toUpperCase(),\n path: x.path,\n pathArgs,\n flags,\n hasBody,\n bodyStyle,\n bodyJsonOption,\n };\n}\n","import type { Command } from '@xyd-js/opencli';\n\nimport type { Imports } from './golit';\nimport { buildLeafModel, type GoType, type LeafModel } from './model';\nimport { pascalCase } from './naming';\n\nconst CLI = 'github.com/urfave/cli/v3';\nconst q = (s: string) => JSON.stringify(s);\n\nfunction readExpr(flagName: string, t: GoType): string {\n switch (t) {\n case 'bool':\n return `cmd.Bool(${q(flagName)})`;\n case 'int':\n return `cmd.Int(${q(flagName)})`;\n case 'float':\n return `cmd.Float(${q(flagName)})`;\n case 'slice':\n return `cmd.StringSlice(${q(flagName)})`;\n default:\n return `cmd.String(${q(flagName)})`; // string | json | file\n }\n}\n\nfunction pathExpr(model: LeafModel, imports: Imports): string {\n const segs = model.path.split(/(\\{[^}]+\\})/).filter((s) => s !== '');\n const parts: string[] = [];\n let lit = '';\n for (const seg of segs) {\n const m = seg.match(/^\\{(.+)\\}$/);\n if (m) {\n if (lit) {\n parts.push(q(lit));\n lit = '';\n }\n const a = model.pathArgs.find((p) => p.wireName === m[1]);\n parts.push(`url.PathEscape(${a ? a.goVar : '\"\"'})`);\n imports.add('net/url');\n } else {\n lit += seg;\n }\n }\n if (lit) parts.push(q(lit));\n return parts.length ? parts.join(' + ') : '\"\"';\n}\n\n/** Render the handler func for a leaf command from its x-openapi binding. */\nexport function renderHandler(\n pathNames: string[],\n command: Command,\n module: string,\n imports: Imports,\n): { name: string; code: string } {\n const model = buildLeafModel(command);\n const name = `handle${pathNames.map(pascalCase).join('')}`;\n imports.add('context', CLI, `${module}/internal/runtime`);\n\n const lines: string[] = [];\n const push = (s = '') => lines.push(s);\n\n // Path params (positional args) — only declare the ones the path actually uses.\n const pe = pathExpr(model, imports);\n for (const a of model.pathArgs) {\n if (pe.includes(`url.PathEscape(${a.goVar})`)) push(`${a.goVar} := cmd.Args().Get(${a.idx})`);\n }\n push(`path := ${pe}`);\n\n // Query params.\n const queryFlags = model.flags.filter((f) => f.location === 'query');\n if (queryFlags.length) {\n imports.add('net/url');\n push('query := url.Values{}');\n for (const f of queryFlags) {\n const read = readExpr(f.flagName, f.goType);\n let val = read;\n if (f.goType !== 'string') {\n val = `fmt.Sprint(${read})`;\n imports.add('fmt');\n }\n push(`if cmd.IsSet(${q(f.flagName)}) {`);\n push(`\\tquery.Set(${q(f.wireName)}, ${val})`);\n push('}');\n }\n }\n\n // Header / cookie params.\n const headerFlags = model.flags.filter((f) => f.location === 'header' || f.location === 'cookie');\n if (headerFlags.length) {\n imports.add('net/http');\n push('headers := http.Header{}');\n for (const f of headerFlags) {\n const read = readExpr(f.flagName, f.goType);\n let val = read;\n if (f.goType !== 'string') {\n val = `fmt.Sprint(${read})`;\n imports.add('fmt');\n }\n push(`if cmd.IsSet(${q(f.flagName)}) {`);\n push(`\\theaders.Set(${q(f.wireName)}, ${val})`);\n push('}');\n }\n }\n\n // Body.\n if (model.hasBody) {\n imports.add('encoding/json');\n if (model.bodyStyle === 'json' && model.bodyJsonOption) {\n push('var bodyBytes []byte');\n push(`if cmd.IsSet(${q(model.bodyJsonOption)}) {`);\n push(`\\tbodyBytes = []byte(cmd.String(${q(model.bodyJsonOption)}))`);\n push('}');\n } else {\n push('body := map[string]any{}');\n for (const f of model.flags.filter((x) => x.location === 'body')) {\n push(`if cmd.IsSet(${q(f.flagName)}) {`);\n if (f.goType === 'json') {\n // Accept either JSON (objects/arrays) or a bare scalar: a string|object\n // union field is commonly given a plain value, and an unparseable value\n // must not abort the whole request.\n push(`\\traw := cmd.String(${q(f.flagName)})`);\n push('\\tvar v any');\n push('\\tif err := json.Unmarshal([]byte(raw), &v); err != nil {');\n push('\\t\\tv = raw');\n push('\\t}');\n push(`\\tbody[${q(f.wireName)}] = v`);\n } else {\n push(`\\tbody[${q(f.wireName)}] = ${readExpr(f.flagName, f.goType)}`);\n }\n push('}');\n }\n push('bodyBytes, err := json.Marshal(body)');\n push('if err != nil {');\n push('\\treturn err');\n push('}');\n }\n }\n\n // Assemble the request.\n push('req := runtime.Request{');\n push(`\\tMethod: ${q(model.method)},`);\n push('\\tPath: path,');\n if (queryFlags.length) push('\\tQuery: query,');\n if (headerFlags.length) push('\\tHeaders: headers,');\n if (model.hasBody) push('\\tBody: bodyBytes,');\n push('}');\n push('return runtime.Do(ctx, req)');\n\n const body = lines.map((l) => `\\t${l}`).join('\\n');\n const code = `func ${name}(ctx context.Context, cmd *cli.Command) error {\\n${body}\\n}`;\n return { name, code };\n}\n","import type { Command } from '@xyd-js/opencli';\n\nimport { Imports, goBool, goFile, goSlice, goStr, goStruct, lit, type GoVal } from './golit';\nimport { renderFlags } from './flags';\nimport { renderHandler } from './handler';\nimport { buildLeafModel } from './model';\nimport { pascalCase, splitWords } from './naming';\n\nconst CLI = 'github.com/urfave/cli/v3';\n\nfunction renderCommand(\n command: Command,\n pathNames: string[],\n module: string,\n imports: Imports,\n handlers: string[],\n): GoVal {\n imports.add(CLI);\n const fields: [string, GoVal][] = [['Name', goStr(command.name)]];\n if (command.aliases?.length) fields.push(['Aliases', goSlice('string', command.aliases.map(goStr))]);\n if (command.description) fields.push(['Usage', goStr(command.description)]);\n if (command.hidden) fields.push(['Hidden', goBool(true)]);\n\n if (command.commands?.length) {\n const subs = command.commands.map((sub) =>\n renderCommand(sub, [...pathNames, sub.name], module, imports, handlers),\n );\n fields.push(['Commands', goSlice('*cli.Command', subs)]);\n } else if (command['x-openapi']) {\n const flags = renderFlags(buildLeafModel(command).flags);\n if (flags.length) fields.push(['Flags', goSlice('cli.Flag', flags)]);\n const handler = renderHandler(pathNames, command, module, imports);\n fields.push(['Action', lit(handler.name)]);\n handlers.push(handler.code);\n }\n\n return goStruct('cli.Command', fields, true);\n}\n\nexport interface ResourceFile {\n path: string;\n content: string;\n constructor: string;\n}\n\n/** Render one `pkg/cmd/<resource>.go` file for a top-level command + its subtree. */\nexport function renderResourceFile(topCommand: Command, module: string): ResourceFile {\n const imports = new Imports();\n const handlers: string[] = [];\n const struct = renderCommand(topCommand, [topCommand.name], module, imports, handlers);\n\n const ctorName = `New${pascalCase(topCommand.name)}Command`;\n const ctor = `func ${ctorName}() *cli.Command {\\n\\treturn ${struct(1)}\\n}`;\n const content = goFile('cmd', imports, [ctor, ...handlers]);\n\n const fileBase = splitWords(topCommand.name).join('') || 'command';\n return { path: `pkg/cmd/${fileBase}.go`, content, constructor: ctorName };\n}\n","import type { OpencliSpecJson } from '@xyd-js/opencli';\n\nimport { Imports, goFile, goSlice, goStr, goStruct, lit, type GoVal } from './golit';\n\nconst CLI = 'github.com/urfave/cli/v3';\n\n/** Render `cmd/<bin>/main.go`. */\nexport function renderMain(\n spec: OpencliSpecJson,\n binName: string,\n module: string,\n constructors: string[],\n): string {\n const imports = new Imports().add('context', 'log', 'os', CLI, `${module}/pkg/cmd`);\n\n const fields: [string, GoVal][] = [['Name', goStr(binName)]];\n const usage = spec.info?.summary || spec.info?.description;\n if (usage) fields.push(['Usage', goStr(usage)]);\n if (spec.info?.version) fields.push(['Version', goStr(spec.info.version)]);\n fields.push(['Commands', goSlice('*cli.Command', constructors.map((c) => lit(`cmd.${c}()`)))]);\n\n const app = goStruct('cli.Command', fields, true);\n const body = `\\tapp := ${app(1)}\n\\tif err := app.Run(context.Background(), os.Args); err != nil {\n\\t\\tlog.Fatal(err)\n\\t}`;\n const fn = `func main() {\\n${body}\\n}`;\n\n return goFile('main', imports, [fn]);\n}\n","import type { OpencliSpecJson, XOpenApiSecurity } from '@xyd-js/opencli';\n\nimport { screamingSnakeCase } from './naming';\n\n/** Static, generic HTTP runtime copied verbatim into every generated project. */\nexport function runtimeGo(): string {\n return `package runtime\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// Request is a generic API request assembled by a generated command handler.\ntype Request struct {\n\tMethod string\n\tPath string\n\tQuery url.Values\n\tHeaders http.Header\n\tBody []byte\n}\n\n// Do executes the request against the configured base URL (applying auth) and\n// prints the response body to stdout.\nfunc Do(ctx context.Context, req Request) error {\n\tendpoint := strings.TrimRight(BaseURL(), \"/\") + req.Path\n\tif len(req.Query) > 0 {\n\t\tendpoint += \"?\" + req.Query.Encode()\n\t}\n\n\tvar body io.Reader\n\tif len(req.Body) > 0 {\n\t\tbody = bytes.NewReader(req.Body)\n\t}\n\n\thttpReq, err := http.NewRequestWithContext(ctx, req.Method, endpoint, body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor key, values := range req.Headers {\n\t\tfor _, value := range values {\n\t\t\thttpReq.Header.Add(key, value)\n\t\t}\n\t}\n\tif len(req.Body) > 0 && httpReq.Header.Get(\"Content-Type\") == \"\" {\n\t\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\t}\n\tapplyAuth(httpReq)\n\n\tresp, err := http.DefaultClient.Do(httpReq)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tout, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Println(string(out))\n\tif resp.StatusCode >= 400 {\n\t\treturn fmt.Errorf(\"request failed: %s\", resp.Status)\n\t}\n\treturn nil\n}\n`;\n}\n\nfunction authBlock(scheme: XOpenApiSecurity): string | null {\n const env = scheme.envVar || 'API_KEY';\n const name = scheme.name || '';\n switch (scheme.kind) {\n case 'bearer':\n return `\tif v := os.Getenv(${JSON.stringify(env)}); v != \"\" {\n\t\treq.Header.Set(\"Authorization\", \"Bearer \"+v)\n\t}`;\n case 'apiKey-header':\n return `\tif v := os.Getenv(${JSON.stringify(env)}); v != \"\" {\n\t\treq.Header.Set(${JSON.stringify(name)}, v)\n\t}`;\n case 'apiKey-query':\n return `\tif v := os.Getenv(${JSON.stringify(env)}); v != \"\" {\n\t\tq := req.URL.Query()\n\t\tq.Set(${JSON.stringify(name)}, v)\n\t\treq.URL.RawQuery = q.Encode()\n\t}`;\n case 'apiKey-cookie':\n return `\tif v := os.Getenv(${JSON.stringify(env)}); v != \"\" {\n\t\treq.AddCookie(&http.Cookie{Name: ${JSON.stringify(name)}, Value: v})\n\t}`;\n case 'basic':\n return `\tuser := os.Getenv(${JSON.stringify(`${env}_USERNAME`)})\n\tpass := os.Getenv(${JSON.stringify(`${env}_PASSWORD`)})\n\tif user != \"\" || pass != \"\" {\n\t\treq.SetBasicAuth(user, pass)\n\t}`;\n default:\n return null;\n }\n}\n\n/** Generated config: the base URL + auth, derived from the spec's root x-openapi. */\nexport function configGo(spec: OpencliSpecJson, binName: string, baseURL: string): string {\n const prefix = screamingSnakeCase(binName);\n const security = spec['x-openapi']?.security || [];\n const blocks = security.map(authBlock).filter((b): b is string => b !== null);\n const authBody = blocks.length ? `\\n${blocks.join('\\n')}\\n` : '';\n\n return `package runtime\n\nimport (\n\t\"net/http\"\n\t\"os\"\n)\n\nconst defaultBaseURL = ${JSON.stringify(baseURL)}\n\n// BaseURL returns the API base URL, overridable via ${prefix}_BASE_URL.\nfunc BaseURL() string {\n\tif v := os.Getenv(${JSON.stringify(`${prefix}_BASE_URL`)}); v != \"\" {\n\t\treturn v\n\t}\n\treturn defaultBaseURL\n}\n\n// applyAuth attaches credentials read from the environment to the request.\nfunc applyAuth(req *http.Request) {${authBody}}\n`;\n}\n","import type { OpencliSpecJson } from '@xyd-js/opencli';\n\nimport { renderResourceFile } from './command';\nimport { renderMain } from './main';\nimport { slug } from './naming';\nimport { configGo, runtimeGo } from './runtime';\nimport type { Opencli2GoOptions } from './types';\n\n/**\n * Generate a buildable Go CLI project (urfave/cli v3) from an OpenCLI document.\n * Pure: returns a virtual file map `{ relativePath: contents }`.\n */\nexport function opencli2go(spec: OpencliSpecJson, options: Opencli2GoOptions = {}): Record<string, string> {\n const binName = options.binName ?? (slug(spec.info?.title || 'cli') || 'cli');\n const module = options.modulePath ?? `example.com/${binName}`;\n const goVersion = options.goVersion ?? '1.22';\n const baseURL = options.baseURL ?? spec['x-openapi']?.servers?.[0] ?? '';\n\n const files: Record<string, string> = {};\n\n files['go.mod'] = `module ${module}\\n\\ngo ${goVersion}\\n`;\n\n const constructors: string[] = [];\n for (const top of spec.commands || []) {\n const resource = renderResourceFile(top, module);\n files[resource.path] = resource.content;\n constructors.push(resource.constructor);\n }\n\n files[`cmd/${binName}/main.go`] = renderMain(spec, binName, module, constructors);\n\n files['internal/runtime/runtime.go'] = runtimeGo();\n files['internal/runtime/config.go'] = configGo(spec, binName, baseURL);\n\n return files;\n}\n","/** Write a generated file map to disk (the only fs-touching entry point). */\nexport async function writeProject(files: Record<string, string>, outDir: string): Promise<void> {\n const fs = await import('node:fs/promises');\n const path = await import('node:path');\n for (const [rel, content] of Object.entries(files)) {\n const full = path.join(outDir, rel);\n await fs.mkdir(path.dirname(full), { recursive: true });\n await fs.writeFile(full, content, 'utf8');\n }\n}\n"],"mappings":";AAGA,IAAM,MAAM;AACZ,IAAM,MAAM,CAAC,MAAc,IAAI,OAAO,CAAC;AAMhC,IAAM,MAAM,CAAC,MAAqB,MAAM;AAGxC,IAAM,QAAQ,CAAC,MAAqB,MAAM,KAAK,UAAU,CAAC;AAE1D,IAAM,SAAS,CAAC,MAAsB,MAAM,OAAO,CAAC;AAIpD,SAAS,SAAS,MAAc,QAA2B,UAAU,OAAc;AACxF,SAAO,CAAC,WAAmB;AACzB,UAAM,OAAO,GAAG,UAAU,MAAM,EAAE,GAAG,IAAI;AACzC,QAAI,OAAO,WAAW,EAAG,QAAO,GAAG,IAAI;AACvC,QAAI,MAAM,GAAG,IAAI;AAAA;AACjB,eAAW,CAAC,GAAG,CAAC,KAAK,QAAQ;AAC3B,aAAO,GAAG,IAAI,S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