@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../index.ts","../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":["export * from './src';\n","// 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,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,SAAS,CAAC,CAA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AW;AACrC,aAAW,CAAC,KAAK,OAAO,KAAK,OAAO,QAAQ,KAAK,GAAG;AAClD,UAAM,OAAO,KAAK,KAAK,QAAQ,GAAG;AAClC,UAAM,GAAG,MAAM,KAAK,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;AACtD,UAAM,GAAG,UAAU,MAAM,SAAS,MAAM;AAAA,EAC1C;AACF;","names":["lit","module","CLI","module","CLI","module","module"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OpencliSpecJson } from '@xyd-js/opencli';
|
|
2
|
+
|
|
3
|
+
interface Opencli2GoOptions {
|
|
4
|
+
/** Go module path for the generated project. Default: `example.com/<binName>`. */
|
|
5
|
+
modulePath?: string;
|
|
6
|
+
/** Binary name (the `cmd/<binName>` dir + root command name). Default: slug(info.title). */
|
|
7
|
+
binName?: string;
|
|
8
|
+
/** `go` directive in go.mod. Default: "1.22". */
|
|
9
|
+
goVersion?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Default API base URL baked into the generated runtime (overridable at runtime
|
|
12
|
+
* via `<ENVPREFIX>_BASE_URL`). Default: the first `x-openapi.servers` entry.
|
|
13
|
+
*/
|
|
14
|
+
baseURL?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generate a buildable Go CLI project (urfave/cli v3) from an OpenCLI document.
|
|
19
|
+
* Pure: returns a virtual file map `{ relativePath: contents }`.
|
|
20
|
+
*/
|
|
21
|
+
declare function opencli2go(spec: OpencliSpecJson, options?: Opencli2GoOptions): Record<string, string>;
|
|
22
|
+
|
|
23
|
+
/** Write a generated file map to disk (the only fs-touching entry point). */
|
|
24
|
+
declare function writeProject(files: Record<string, string>, outDir: string): Promise<void>;
|
|
25
|
+
|
|
26
|
+
export { type Opencli2GoOptions, opencli2go, writeProject };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OpencliSpecJson } from '@xyd-js/opencli';
|
|
2
|
+
|
|
3
|
+
interface Opencli2GoOptions {
|
|
4
|
+
/** Go module path for the generated project. Default: `example.com/<binName>`. */
|
|
5
|
+
modulePath?: string;
|
|
6
|
+
/** Binary name (the `cmd/<binName>` dir + root command name). Default: slug(info.title). */
|
|
7
|
+
binName?: string;
|
|
8
|
+
/** `go` directive in go.mod. Default: "1.22". */
|
|
9
|
+
goVersion?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Default API base URL baked into the generated runtime (overridable at runtime
|
|
12
|
+
* via `<ENVPREFIX>_BASE_URL`). Default: the first `x-openapi.servers` entry.
|
|
13
|
+
*/
|
|
14
|
+
baseURL?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generate a buildable Go CLI project (urfave/cli v3) from an OpenCLI document.
|
|
19
|
+
* Pure: returns a virtual file map `{ relativePath: contents }`.
|
|
20
|
+
*/
|
|
21
|
+
declare function opencli2go(spec: OpencliSpecJson, options?: Opencli2GoOptions): Record<string, string>;
|
|
22
|
+
|
|
23
|
+
/** Write a generated file map to disk (the only fs-touching entry point). */
|
|
24
|
+
declare function writeProject(files: Record<string, string>, outDir: string): Promise<void>;
|
|
25
|
+
|
|
26
|
+
export { type Opencli2GoOptions, opencli2go, writeProject };
|