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