@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,304 @@
|
|
|
1
|
+
import { execSync, spawn } from 'node:child_process';
|
|
2
|
+
import http from 'node:http';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
7
|
+
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
8
|
+
|
|
9
|
+
import type { Command, OpencliSpecJson } from '@xyd-js/opencli';
|
|
10
|
+
|
|
11
|
+
import { opencli2go, writeProject } from '../../index';
|
|
12
|
+
import { buildLeafModel, type GoType } from '../../src/model';
|
|
13
|
+
|
|
14
|
+
// Reusable, self-contained end-to-end harness for opencli2go. An API's whole
|
|
15
|
+
// e2e is two calls (see e2e/openai.test.ts):
|
|
16
|
+
// recordE2E({ name, cliName, fixturesDir }) // (gated) write per-command recorded.json
|
|
17
|
+
// defineE2E({ name, cliName, fixturesDir }) // offline binding guard + real-CLI check
|
|
18
|
+
// The only inputs are the committed per-method fixtures (input.json = OpenCLI);
|
|
19
|
+
// the full CLI is assembled by merging them — no OpenAPI/upstream dependency.
|
|
20
|
+
|
|
21
|
+
export interface RecordedRequest {
|
|
22
|
+
method: string;
|
|
23
|
+
path: string;
|
|
24
|
+
query: string[];
|
|
25
|
+
contentType?: string;
|
|
26
|
+
bodyFields: string[];
|
|
27
|
+
auth: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RecordedFixture {
|
|
31
|
+
args: string[]; // full CLI invocation (command path + positionals + required flags)
|
|
32
|
+
request: RecordedRequest; // the request a correct CLI should send
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ApiConfig {
|
|
36
|
+
name: string;
|
|
37
|
+
cliName: string;
|
|
38
|
+
/** Per-method fixtures dir: <slug>/input.json (OpenCLI) [+ output.go, recorded.json]. */
|
|
39
|
+
fixturesDir: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const PLACEHOLDER = 'EXAMPLE';
|
|
43
|
+
|
|
44
|
+
export function hasGo(): boolean {
|
|
45
|
+
try {
|
|
46
|
+
execSync('go version', { stdio: 'ignore' });
|
|
47
|
+
return true;
|
|
48
|
+
} catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const fromOption = (from: string | undefined): string | undefined =>
|
|
54
|
+
from?.startsWith('option:') ? from.slice('option:'.length) : undefined;
|
|
55
|
+
|
|
56
|
+
/** Walk an OpenCLI spec down its first branch to the single leaf command. */
|
|
57
|
+
export function leafCommand(spec: OpencliSpecJson): { command: Command; path: string[] } | null {
|
|
58
|
+
let node = spec.commands?.[0];
|
|
59
|
+
const cp: string[] = [];
|
|
60
|
+
while (node) {
|
|
61
|
+
cp.push(node.name);
|
|
62
|
+
if (node.commands?.length) node = node.commands[0];
|
|
63
|
+
else return { command: node, path: cp };
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The CLI invocation + request a correct CLI should record, using required flags. */
|
|
69
|
+
// A typed flag (int/float) rejects a non-numeric placeholder at urfave's parse
|
|
70
|
+
// stage — so the value must match the emitted flag type. Reuse the generator's
|
|
71
|
+
// own type model so the placeholder never drifts from the generated flag.
|
|
72
|
+
function examplePlaceholder(goType: GoType | undefined): string {
|
|
73
|
+
return goType === 'int' || goType === 'float' ? '1' : PLACEHOLDER;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function exampleInvocation(leaf: { command: Command; path: string[] }): { args: string[]; setFlags: Set<string> } {
|
|
77
|
+
const goTypeByName = new Map(buildLeafModel(leaf.command).flags.map((f) => [f.flagName, f.goType]));
|
|
78
|
+
const positionals = (leaf.command.arguments || []).map(() => PLACEHOLDER);
|
|
79
|
+
const flagArgs: string[] = [];
|
|
80
|
+
const setFlags = new Set<string>();
|
|
81
|
+
for (const o of leaf.command.options || []) {
|
|
82
|
+
if (!o.required) continue;
|
|
83
|
+
setFlags.add(o.name);
|
|
84
|
+
flagArgs.push(`--${o.name}`);
|
|
85
|
+
if (o.arguments?.length) flagArgs.push(examplePlaceholder(goTypeByName.get(o.name)));
|
|
86
|
+
}
|
|
87
|
+
return { args: [...leaf.path, ...positionals, ...flagArgs], setFlags };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function expectedRequest(spec: OpencliSpecJson, command: Command, setFlags: Set<string>): RecordedRequest {
|
|
91
|
+
const x = (command['x-openapi'] || {}) as any;
|
|
92
|
+
const query: string[] = [];
|
|
93
|
+
const bodyFields: string[] = [];
|
|
94
|
+
for (const p of x.params || []) {
|
|
95
|
+
if (p.in === 'query') {
|
|
96
|
+
const opt = fromOption(p.from);
|
|
97
|
+
if (opt && setFlags.has(opt)) query.push(p.name);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (const bp of x.body?.properties || []) {
|
|
101
|
+
const opt = fromOption(bp.from);
|
|
102
|
+
if (opt && setFlags.has(opt)) bodyFields.push(bp.name);
|
|
103
|
+
}
|
|
104
|
+
const kind = spec['x-openapi']?.security?.[0]?.kind || x.security?.[0]?.kind || '';
|
|
105
|
+
const req: RecordedRequest = {
|
|
106
|
+
method: String(x.method || 'get').toLowerCase(),
|
|
107
|
+
path: x.path || '',
|
|
108
|
+
query: query.sort(),
|
|
109
|
+
bodyFields: bodyFields.sort(),
|
|
110
|
+
auth: kind.startsWith('apiKey') ? 'apikey' : kind || 'bearer',
|
|
111
|
+
};
|
|
112
|
+
// The generated runtime always assembles a JSON body (multipart is a known gap).
|
|
113
|
+
if (x.body) req.contentType = 'application/json';
|
|
114
|
+
return req;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Merge per-method OpenCLI docs (single branches) into one full OpenCLI doc. */
|
|
118
|
+
function mergeCommands(target: Command[], source: Command[]) {
|
|
119
|
+
for (const s of source) {
|
|
120
|
+
const existing = target.find((t) => t.name === s.name);
|
|
121
|
+
if (!existing) {
|
|
122
|
+
target.push(JSON.parse(JSON.stringify(s)));
|
|
123
|
+
} else if (existing.commands?.length && s.commands?.length) {
|
|
124
|
+
mergeCommands(existing.commands, s.commands);
|
|
125
|
+
} // leaf collision → keep the first (distinct operations shouldn't collide)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function loadPerMethod(fixturesDir: string): { slug: string; opencli: OpencliSpecJson; leaf: { command: Command; path: string[] } }[] {
|
|
130
|
+
if (!fs.existsSync(fixturesDir)) return [];
|
|
131
|
+
const out: { slug: string; opencli: OpencliSpecJson; leaf: { command: Command; path: string[] } }[] = [];
|
|
132
|
+
for (const slug of fs.readdirSync(fixturesDir).sort()) {
|
|
133
|
+
const inPath = path.join(fixturesDir, slug, 'input.json');
|
|
134
|
+
if (!fs.existsSync(inPath)) continue;
|
|
135
|
+
const opencli = JSON.parse(fs.readFileSync(inPath, 'utf8')) as OpencliSpecJson;
|
|
136
|
+
const leaf = leafCommand(opencli);
|
|
137
|
+
if (leaf?.command['x-openapi']) out.push({ slug, opencli, leaf });
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Assemble the full OpenCLI doc by merging the committed per-method docs. */
|
|
143
|
+
export function fullOpencli(fixturesDir: string, cliName: string): OpencliSpecJson {
|
|
144
|
+
const methods = loadPerMethod(fixturesDir);
|
|
145
|
+
const root: OpencliSpecJson = {
|
|
146
|
+
opencli: methods[0]?.opencli.opencli || '1.0.0',
|
|
147
|
+
info: methods[0]?.opencli.info || { title: cliName, version: '1.0.0' },
|
|
148
|
+
commands: [],
|
|
149
|
+
};
|
|
150
|
+
if (methods[0]?.opencli['x-openapi']) root['x-openapi'] = methods[0].opencli['x-openapi'];
|
|
151
|
+
for (const m of methods) mergeCommands(root.commands!, m.opencli.commands || []);
|
|
152
|
+
return root;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export class RecordingServer {
|
|
156
|
+
private server: http.Server;
|
|
157
|
+
port = 0;
|
|
158
|
+
last: { method: string; url: string; headers: http.IncomingHttpHeaders; body: string } | null = null;
|
|
159
|
+
|
|
160
|
+
constructor() {
|
|
161
|
+
this.server = http.createServer((req, res) => {
|
|
162
|
+
let body = '';
|
|
163
|
+
req.on('data', (c) => (body += c));
|
|
164
|
+
req.on('end', () => {
|
|
165
|
+
this.last = { method: req.method || '', url: req.url || '', headers: req.headers, body };
|
|
166
|
+
res.writeHead(200, { 'content-type': 'application/json' });
|
|
167
|
+
res.end('{"ok":true}');
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
start(): Promise<void> {
|
|
173
|
+
return new Promise((r) => this.server.listen(0, '127.0.0.1', () => { this.port = (this.server.address() as any).port; r(); }));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
stop() {
|
|
177
|
+
this.server.close();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function normalizeRecorded(raw: NonNullable<RecordingServer['last']>): RecordedRequest {
|
|
182
|
+
const [p, qs] = (raw.url || '').split('?');
|
|
183
|
+
const query = qs ? [...new URLSearchParams(qs).keys()].sort() : [];
|
|
184
|
+
let bodyFields: string[] = [];
|
|
185
|
+
try {
|
|
186
|
+
const parsed = raw.body ? JSON.parse(raw.body) : {};
|
|
187
|
+
if (parsed && typeof parsed === 'object') bodyFields = Object.keys(parsed).sort();
|
|
188
|
+
} catch {
|
|
189
|
+
/* non-JSON body */
|
|
190
|
+
}
|
|
191
|
+
const authHeader = (raw.headers.authorization as string) || '';
|
|
192
|
+
const auth = authHeader.startsWith('Bearer ') ? 'bearer' : authHeader ? 'apikey' : '';
|
|
193
|
+
return { method: (raw.method || '').toLowerCase(), path: p, query, bodyFields, auth, contentType: ((raw.headers['content-type'] as string) || '').split(';')[0] || undefined };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function diffRequest(actual: RecordedRequest, fixture: RecordedRequest): string[] {
|
|
197
|
+
const errs: string[] = [];
|
|
198
|
+
if (actual.method !== fixture.method) errs.push(`method ${actual.method} != ${fixture.method}`);
|
|
199
|
+
const re = new RegExp(`^${fixture.path.replace(/[.]/g, '\\.').replace(/\{[^}]+\}/g, '[^/]+')}$`);
|
|
200
|
+
if (!re.test(actual.path)) errs.push(`path ${actual.path} !~ ${fixture.path}`);
|
|
201
|
+
if (actual.query.join(',') !== fixture.query.join(',')) errs.push(`query [${actual.query}] != [${fixture.query}]`);
|
|
202
|
+
for (const f of fixture.bodyFields) if (!actual.bodyFields.includes(f)) errs.push(`body missing ${f}`);
|
|
203
|
+
if (actual.auth !== fixture.auth) errs.push(`auth ${actual.auth} != ${fixture.auth}`);
|
|
204
|
+
return errs;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async function buildCli(spec: OpencliSpecJson): Promise<{ binPath: string; tmpDir: string }> {
|
|
208
|
+
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'o2g-e2e-'));
|
|
209
|
+
await writeProject(opencli2go(spec), tmpDir);
|
|
210
|
+
execSync('go mod tidy', { cwd: tmpDir, stdio: 'pipe' });
|
|
211
|
+
execSync(`go build -o cli ./cmd/${spec.info?.title || 'cli'}`, { cwd: tmpDir, stdio: 'pipe' });
|
|
212
|
+
return { binPath: path.join(tmpDir, 'cli'), tmpDir };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function runAndRecord(binPath: string, args: string[], server: RecordingServer, env: NodeJS.ProcessEnv): Promise<RecordedRequest | null> {
|
|
216
|
+
return new Promise((resolve) => {
|
|
217
|
+
server.last = null;
|
|
218
|
+
const p = spawn(binPath, args, { stdio: ['ignore', 'ignore', 'ignore'], env });
|
|
219
|
+
const done = () => resolve(server.last ? normalizeRecorded(server.last) : null);
|
|
220
|
+
const t = setTimeout(() => { p.kill('SIGKILL'); done(); }, 8000);
|
|
221
|
+
p.on('exit', () => { clearTimeout(t); done(); });
|
|
222
|
+
p.on('error', () => { clearTimeout(t); done(); });
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** (Gated E2E_RECORD=1) Write per-command recorded.json (args + assumed-correct request). */
|
|
227
|
+
export function recordE2E(cfg: ApiConfig) {
|
|
228
|
+
if (process.env.E2E_RECORD !== '1') return;
|
|
229
|
+
describe(`${cfg.name} e2e: record fixtures`, () => {
|
|
230
|
+
it('write <command>/recorded.json', () => {
|
|
231
|
+
const methods = loadPerMethod(cfg.fixturesDir);
|
|
232
|
+
for (const m of methods) {
|
|
233
|
+
const { args, setFlags } = exampleInvocation(m.leaf);
|
|
234
|
+
const fixture: RecordedFixture = { args, request: expectedRequest(m.opencli, m.leaf.command, setFlags) };
|
|
235
|
+
fs.writeFileSync(path.join(cfg.fixturesDir, m.slug, 'recorded.json'), `${JSON.stringify(fixture, null, 2)}\n`);
|
|
236
|
+
}
|
|
237
|
+
expect(methods.length).toBeGreaterThan(100);
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Register the e2e tests for an API from its committed per-method fixtures. */
|
|
243
|
+
export function defineE2E(cfg: ApiConfig) {
|
|
244
|
+
if (process.env.E2E_RECORD === '1') return;
|
|
245
|
+
const methods = loadPerMethod(cfg.fixturesDir).filter((m) => fs.existsSync(path.join(cfg.fixturesDir, m.slug, 'recorded.json')));
|
|
246
|
+
const items = methods.map((m) => ({ ...m, fixture: JSON.parse(fs.readFileSync(path.join(cfg.fixturesDir, m.slug, 'recorded.json'), 'utf8')) as RecordedFixture }));
|
|
247
|
+
const E2E = process.env.E2E_CLI === '1';
|
|
248
|
+
const ENV = (port: number) => ({ ...process.env, [`${cfg.cliName.toUpperCase()}_BASE_URL`]: `http://127.0.0.1:${port}`, [`${cfg.cliName.toUpperCase()}_API_KEY`]: 'sk-e2e-test' });
|
|
249
|
+
|
|
250
|
+
// Offline guard (no Go): fixtures stay consistent with the OpenCLI binding.
|
|
251
|
+
describe.skipIf(!items.length)(`${cfg.name} e2e: recorded requests match the OpenCLI binding`, () => {
|
|
252
|
+
for (const m of items) {
|
|
253
|
+
it(`${m.leaf.path.join(' ')} → ${m.fixture.request.method.toUpperCase()} ${m.fixture.request.path}`, () => {
|
|
254
|
+
const { setFlags } = exampleInvocation(m.leaf);
|
|
255
|
+
expect(expectedRequest(m.opencli, m.leaf.command, setFlags)).toEqual(m.fixture.request);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Real-CLI check (gated; runs where Go binaries execute, e.g. CI).
|
|
261
|
+
if (E2E && items.length) {
|
|
262
|
+
describe(`${cfg.name} e2e: real CLI requests match fixtures`, () => {
|
|
263
|
+
const server = new RecordingServer();
|
|
264
|
+
let binPath = '';
|
|
265
|
+
let tmpDir = '';
|
|
266
|
+
let buildError: unknown = null;
|
|
267
|
+
let binaryRuns = false;
|
|
268
|
+
|
|
269
|
+
beforeAll(async () => {
|
|
270
|
+
await server.start();
|
|
271
|
+
if (!hasGo()) {
|
|
272
|
+
buildError = new Error('go toolchain not available');
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
try {
|
|
276
|
+
({ binPath, tmpDir } = await buildCli(fullOpencli(cfg.fixturesDir, cfg.cliName)));
|
|
277
|
+
} catch (e) {
|
|
278
|
+
buildError = e;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
binaryRuns = (await runAndRecord(binPath, items[0].fixture.args, server, ENV(server.port))) !== null;
|
|
282
|
+
}, 600000);
|
|
283
|
+
|
|
284
|
+
afterAll(() => {
|
|
285
|
+
server.stop();
|
|
286
|
+
if (tmpDir) fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('the whole CLI compiled', () => {
|
|
290
|
+
expect(buildError, `${buildError}`).toBeNull();
|
|
291
|
+
expect(fs.existsSync(binPath)).toBe(true);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
for (const m of items) {
|
|
295
|
+
it(`${m.leaf.path.join(' ')} → ${m.fixture.request.method.toUpperCase()} ${m.fixture.request.path}`, async (ctx) => {
|
|
296
|
+
if (!binaryRuns) return ctx.skip();
|
|
297
|
+
const actual = await runAndRecord(binPath, m.fixture.args, server, ENV(server.port));
|
|
298
|
+
expect(actual, `${m.slug} made no request`).not.toBeNull();
|
|
299
|
+
expect(diffRequest(actual!, m.fixture.request), m.slug).toEqual([]);
|
|
300
|
+
}, 15000);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
import { defineE2E, recordE2E } from './harness';
|
|
4
|
+
|
|
5
|
+
// OpenAI binding for the reusable e2e harness. Adding another API is this small:
|
|
6
|
+
// point at its per-method fixtures dir. The full CLI is assembled from the
|
|
7
|
+
// committed OpenCLI inputs — no OpenAPI/upstream dependency.
|
|
8
|
+
const openai = { name: 'openai', cliName: 'openai', fixturesDir: path.join(__dirname, '../../__fixtures__/-2.complex.openai') };
|
|
9
|
+
|
|
10
|
+
recordE2E(openai);
|
|
11
|
+
defineE2E(openai);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { GO_SMOKE, goBuildSmoke, testFixture } from './utils';
|
|
4
|
+
|
|
5
|
+
const tests = [
|
|
6
|
+
{ name: '1.basic', description: 'List + retrieve resource; bearer auth; path arg' },
|
|
7
|
+
{ name: '2.crud', description: 'CRUD with query flags + flattened JSON body; apiKey-header auth' },
|
|
8
|
+
{ name: '3.nested', description: 'Nested sub-resource, multiple path args, custom action' },
|
|
9
|
+
{ name: '4.body-flatten', description: 'Body flags: enum/array/number/bool/nested-json encodings' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
describe('opencli2go (golden Go output)', () => {
|
|
13
|
+
for (const t of tests) {
|
|
14
|
+
it(`[${t.name}]: ${t.description}`, () => {
|
|
15
|
+
testFixture(t.name);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Opt-in (O2G_GO_SMOKE=1 + Go toolchain + network): generated project compiles + vets.
|
|
21
|
+
describe.skipIf(!GO_SMOKE)('opencli2go (go build smoke)', () => {
|
|
22
|
+
for (const t of tests) {
|
|
23
|
+
it(`builds + vets [${t.name}]`, () => {
|
|
24
|
+
goBuildSmoke(t.name);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import { expect } from 'vitest';
|
|
7
|
+
|
|
8
|
+
import { opencli2go } from '../index';
|
|
9
|
+
import type { Opencli2GoOptions } from '../index';
|
|
10
|
+
|
|
11
|
+
// REGEN=1 regenerates the golden output/ trees instead of asserting.
|
|
12
|
+
const REGENERATE = process.env.REGEN === '1';
|
|
13
|
+
|
|
14
|
+
// O2G_GO_SMOKE=1 (and a Go toolchain + network) enables the go build/vet smoke.
|
|
15
|
+
export const GO_SMOKE = process.env.O2G_GO_SMOKE === '1' && hasGo();
|
|
16
|
+
|
|
17
|
+
function hasGo(): boolean {
|
|
18
|
+
try {
|
|
19
|
+
execSync('go version', { stdio: 'ignore' });
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function fixturePath(name: string): string {
|
|
27
|
+
return path.join(__dirname, '../__fixtures__', name);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readSpec(name: string) {
|
|
31
|
+
return JSON.parse(fs.readFileSync(path.join(fixturePath(name), 'input.json'), 'utf8'));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function listFiles(dir: string, base = dir): Record<string, string> {
|
|
35
|
+
const out: Record<string, string> = {};
|
|
36
|
+
if (!fs.existsSync(dir)) return out;
|
|
37
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
38
|
+
const full = path.join(dir, entry.name);
|
|
39
|
+
if (entry.isDirectory()) Object.assign(out, listFiles(full, base));
|
|
40
|
+
else out[path.relative(base, full).split(path.sep).join('/')] = fs.readFileSync(full, 'utf8');
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function writeTree(dir: string, files: Record<string, string>) {
|
|
46
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
47
|
+
for (const [rel, content] of Object.entries(files)) {
|
|
48
|
+
const full = path.join(dir, rel);
|
|
49
|
+
fs.mkdirSync(path.dirname(full), { recursive: true });
|
|
50
|
+
fs.writeFileSync(full, content);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Golden test: opencli2go(input.json) === the committed output/ file tree. */
|
|
55
|
+
export function testFixture(name: string, options?: Opencli2GoOptions) {
|
|
56
|
+
const files = opencli2go(readSpec(name), options);
|
|
57
|
+
const outDir = path.join(fixturePath(name), 'output');
|
|
58
|
+
|
|
59
|
+
if (REGENERATE) writeTree(outDir, files);
|
|
60
|
+
|
|
61
|
+
const expected = listFiles(outDir);
|
|
62
|
+
expect(Object.keys(files).sort()).toEqual(Object.keys(expected).sort());
|
|
63
|
+
for (const [rel, content] of Object.entries(files)) {
|
|
64
|
+
expect(content, `mismatch in ${name}/${rel}`).toEqual(expected[rel]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Optional: write the project to a temp dir and run `go mod tidy && go build && go vet`. */
|
|
69
|
+
export function goBuildSmoke(name: string, options?: Opencli2GoOptions) {
|
|
70
|
+
const files = opencli2go(readSpec(name), options);
|
|
71
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), `o2g-${name.replace(/\W/g, '')}-`));
|
|
72
|
+
try {
|
|
73
|
+
writeTree(dir, files);
|
|
74
|
+
execSync('go mod tidy', { cwd: dir, stdio: 'pipe' });
|
|
75
|
+
execSync('go build ./...', { cwd: dir, stdio: 'pipe' });
|
|
76
|
+
execSync('go vet ./...', { cwd: dir, stdio: 'pipe' });
|
|
77
|
+
} finally {
|
|
78
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
}
|
package/biome.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
|
|
3
|
+
"files": {
|
|
4
|
+
"ignore": ["dist/**", "node_modules/**", "__fixtures__/**"]
|
|
5
|
+
},
|
|
6
|
+
"organizeImports": { "enabled": true },
|
|
7
|
+
"formatter": {
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"indentWidth": 2,
|
|
10
|
+
"indentStyle": "space",
|
|
11
|
+
"lineWidth": 120
|
|
12
|
+
},
|
|
13
|
+
"javascript": {
|
|
14
|
+
"formatter": {
|
|
15
|
+
"quoteStyle": "single",
|
|
16
|
+
"semicolons": "asNeeded"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"linter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"rules": {
|
|
22
|
+
"recommended": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|