@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,64 @@
|
|
|
1
|
+
package runtime
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"bytes"
|
|
5
|
+
"context"
|
|
6
|
+
"fmt"
|
|
7
|
+
"io"
|
|
8
|
+
"net/http"
|
|
9
|
+
"net/url"
|
|
10
|
+
"strings"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
// Request is a generic API request assembled by a generated command handler.
|
|
14
|
+
type Request struct {
|
|
15
|
+
Method string
|
|
16
|
+
Path string
|
|
17
|
+
Query url.Values
|
|
18
|
+
Headers http.Header
|
|
19
|
+
Body []byte
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Do executes the request against the configured base URL (applying auth) and
|
|
23
|
+
// prints the response body to stdout.
|
|
24
|
+
func Do(ctx context.Context, req Request) error {
|
|
25
|
+
endpoint := strings.TrimRight(BaseURL(), "/") + req.Path
|
|
26
|
+
if len(req.Query) > 0 {
|
|
27
|
+
endpoint += "?" + req.Query.Encode()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var body io.Reader
|
|
31
|
+
if len(req.Body) > 0 {
|
|
32
|
+
body = bytes.NewReader(req.Body)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
httpReq, err := http.NewRequestWithContext(ctx, req.Method, endpoint, body)
|
|
36
|
+
if err != nil {
|
|
37
|
+
return err
|
|
38
|
+
}
|
|
39
|
+
for key, values := range req.Headers {
|
|
40
|
+
for _, value := range values {
|
|
41
|
+
httpReq.Header.Add(key, value)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if len(req.Body) > 0 && httpReq.Header.Get("Content-Type") == "" {
|
|
45
|
+
httpReq.Header.Set("Content-Type", "application/json")
|
|
46
|
+
}
|
|
47
|
+
applyAuth(httpReq)
|
|
48
|
+
|
|
49
|
+
resp, err := http.DefaultClient.Do(httpReq)
|
|
50
|
+
if err != nil {
|
|
51
|
+
return err
|
|
52
|
+
}
|
|
53
|
+
defer resp.Body.Close()
|
|
54
|
+
|
|
55
|
+
out, err := io.ReadAll(resp.Body)
|
|
56
|
+
if err != nil {
|
|
57
|
+
return err
|
|
58
|
+
}
|
|
59
|
+
fmt.Println(string(out))
|
|
60
|
+
if resp.StatusCode >= 400 {
|
|
61
|
+
return fmt.Errorf("request failed: %s", resp.Status)
|
|
62
|
+
}
|
|
63
|
+
return nil
|
|
64
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
package cmd
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"encoding/json"
|
|
6
|
+
"fmt"
|
|
7
|
+
"net/url"
|
|
8
|
+
|
|
9
|
+
"example.com/widgets-api/internal/runtime"
|
|
10
|
+
"github.com/urfave/cli/v3"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func NewWidgetsCommand() *cli.Command {
|
|
14
|
+
return &cli.Command{
|
|
15
|
+
Name: "widgets",
|
|
16
|
+
Commands: []*cli.Command{
|
|
17
|
+
&cli.Command{
|
|
18
|
+
Name: "list",
|
|
19
|
+
Usage: "List all widgets.",
|
|
20
|
+
Flags: []cli.Flag{
|
|
21
|
+
&cli.IntFlag{
|
|
22
|
+
Name: "limit",
|
|
23
|
+
Usage: "Maximum number of widgets to return.",
|
|
24
|
+
},
|
|
25
|
+
&cli.StringFlag{
|
|
26
|
+
Name: "status",
|
|
27
|
+
Usage: "Filter by status.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
Action: handleWidgetsList,
|
|
31
|
+
},
|
|
32
|
+
&cli.Command{
|
|
33
|
+
Name: "create",
|
|
34
|
+
Usage: "Create a widget.",
|
|
35
|
+
Flags: []cli.Flag{
|
|
36
|
+
&cli.StringFlag{
|
|
37
|
+
Name: "name",
|
|
38
|
+
Usage: "The widget name.",
|
|
39
|
+
Required: true,
|
|
40
|
+
},
|
|
41
|
+
&cli.StringFlag{
|
|
42
|
+
Name: "color",
|
|
43
|
+
},
|
|
44
|
+
&cli.StringSliceFlag{
|
|
45
|
+
Name: "tags",
|
|
46
|
+
},
|
|
47
|
+
&cli.BoolFlag{
|
|
48
|
+
Name: "enabled",
|
|
49
|
+
},
|
|
50
|
+
&cli.StringFlag{
|
|
51
|
+
Name: "config",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
Action: handleWidgetsCreate,
|
|
55
|
+
},
|
|
56
|
+
&cli.Command{
|
|
57
|
+
Name: "retrieve",
|
|
58
|
+
Aliases: []string{
|
|
59
|
+
"get",
|
|
60
|
+
},
|
|
61
|
+
Usage: "Retrieve a widget.",
|
|
62
|
+
Action: handleWidgetsRetrieve,
|
|
63
|
+
},
|
|
64
|
+
&cli.Command{
|
|
65
|
+
Name: "update",
|
|
66
|
+
Usage: "Update a widget.",
|
|
67
|
+
Flags: []cli.Flag{
|
|
68
|
+
&cli.StringFlag{
|
|
69
|
+
Name: "name",
|
|
70
|
+
},
|
|
71
|
+
&cli.BoolFlag{
|
|
72
|
+
Name: "enabled",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
Action: handleWidgetsUpdate,
|
|
76
|
+
},
|
|
77
|
+
&cli.Command{
|
|
78
|
+
Name: "delete",
|
|
79
|
+
Usage: "Delete a widget.",
|
|
80
|
+
Action: handleWidgetsDelete,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
func handleWidgetsList(ctx context.Context, cmd *cli.Command) error {
|
|
87
|
+
path := "/widgets"
|
|
88
|
+
query := url.Values{}
|
|
89
|
+
if cmd.IsSet("limit") {
|
|
90
|
+
query.Set("limit", fmt.Sprint(cmd.Int("limit")))
|
|
91
|
+
}
|
|
92
|
+
if cmd.IsSet("status") {
|
|
93
|
+
query.Set("status", cmd.String("status"))
|
|
94
|
+
}
|
|
95
|
+
req := runtime.Request{
|
|
96
|
+
Method: "GET",
|
|
97
|
+
Path: path,
|
|
98
|
+
Query: query,
|
|
99
|
+
}
|
|
100
|
+
return runtime.Do(ctx, req)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
func handleWidgetsCreate(ctx context.Context, cmd *cli.Command) error {
|
|
104
|
+
path := "/widgets"
|
|
105
|
+
body := map[string]any{}
|
|
106
|
+
if cmd.IsSet("name") {
|
|
107
|
+
body["name"] = cmd.String("name")
|
|
108
|
+
}
|
|
109
|
+
if cmd.IsSet("color") {
|
|
110
|
+
body["color"] = cmd.String("color")
|
|
111
|
+
}
|
|
112
|
+
if cmd.IsSet("tags") {
|
|
113
|
+
body["tags"] = cmd.StringSlice("tags")
|
|
114
|
+
}
|
|
115
|
+
if cmd.IsSet("enabled") {
|
|
116
|
+
body["enabled"] = cmd.Bool("enabled")
|
|
117
|
+
}
|
|
118
|
+
if cmd.IsSet("config") {
|
|
119
|
+
raw := cmd.String("config")
|
|
120
|
+
var v any
|
|
121
|
+
if err := json.Unmarshal([]byte(raw), &v); err != nil {
|
|
122
|
+
v = raw
|
|
123
|
+
}
|
|
124
|
+
body["config"] = v
|
|
125
|
+
}
|
|
126
|
+
bodyBytes, err := json.Marshal(body)
|
|
127
|
+
if err != nil {
|
|
128
|
+
return err
|
|
129
|
+
}
|
|
130
|
+
req := runtime.Request{
|
|
131
|
+
Method: "POST",
|
|
132
|
+
Path: path,
|
|
133
|
+
Body: bodyBytes,
|
|
134
|
+
}
|
|
135
|
+
return runtime.Do(ctx, req)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
func handleWidgetsRetrieve(ctx context.Context, cmd *cli.Command) error {
|
|
139
|
+
widgetID := cmd.Args().Get(0)
|
|
140
|
+
path := "/widgets/" + url.PathEscape(widgetID)
|
|
141
|
+
req := runtime.Request{
|
|
142
|
+
Method: "GET",
|
|
143
|
+
Path: path,
|
|
144
|
+
}
|
|
145
|
+
return runtime.Do(ctx, req)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
func handleWidgetsUpdate(ctx context.Context, cmd *cli.Command) error {
|
|
149
|
+
widgetID := cmd.Args().Get(0)
|
|
150
|
+
path := "/widgets/" + url.PathEscape(widgetID)
|
|
151
|
+
body := map[string]any{}
|
|
152
|
+
if cmd.IsSet("name") {
|
|
153
|
+
body["name"] = cmd.String("name")
|
|
154
|
+
}
|
|
155
|
+
if cmd.IsSet("enabled") {
|
|
156
|
+
body["enabled"] = cmd.Bool("enabled")
|
|
157
|
+
}
|
|
158
|
+
bodyBytes, err := json.Marshal(body)
|
|
159
|
+
if err != nil {
|
|
160
|
+
return err
|
|
161
|
+
}
|
|
162
|
+
req := runtime.Request{
|
|
163
|
+
Method: "PATCH",
|
|
164
|
+
Path: path,
|
|
165
|
+
Body: bodyBytes,
|
|
166
|
+
}
|
|
167
|
+
return runtime.Do(ctx, req)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
func handleWidgetsDelete(ctx context.Context, cmd *cli.Command) error {
|
|
171
|
+
widgetID := cmd.Args().Get(0)
|
|
172
|
+
path := "/widgets/" + url.PathEscape(widgetID)
|
|
173
|
+
req := runtime.Request{
|
|
174
|
+
Method: "DELETE",
|
|
175
|
+
Path: path,
|
|
176
|
+
}
|
|
177
|
+
return runtime.Do(ctx, req)
|
|
178
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"opencli": "1.0.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "stores-api",
|
|
5
|
+
"version": "1.0.0"
|
|
6
|
+
},
|
|
7
|
+
"x-openapi": {
|
|
8
|
+
"servers": [
|
|
9
|
+
"https://api.stores.test/v2"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"commands": [
|
|
13
|
+
{
|
|
14
|
+
"name": "stores",
|
|
15
|
+
"commands": [
|
|
16
|
+
{
|
|
17
|
+
"name": "items",
|
|
18
|
+
"commands": [
|
|
19
|
+
{
|
|
20
|
+
"name": "list",
|
|
21
|
+
"description": "List items in a store.",
|
|
22
|
+
"arguments": [
|
|
23
|
+
{
|
|
24
|
+
"name": "store-id",
|
|
25
|
+
"required": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"options": [
|
|
29
|
+
{
|
|
30
|
+
"name": "limit",
|
|
31
|
+
"group": "query",
|
|
32
|
+
"arguments": [
|
|
33
|
+
{
|
|
34
|
+
"name": "integer"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"x-openapi": {
|
|
40
|
+
"method": "get",
|
|
41
|
+
"path": "/stores/{store_id}/items",
|
|
42
|
+
"operationId": "listStoreItems",
|
|
43
|
+
"params": [
|
|
44
|
+
{
|
|
45
|
+
"in": "path",
|
|
46
|
+
"name": "store_id",
|
|
47
|
+
"from": "argument:store-id",
|
|
48
|
+
"required": true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"in": "query",
|
|
52
|
+
"name": "limit",
|
|
53
|
+
"from": "option:limit"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "create",
|
|
60
|
+
"description": "Create an item in a store.",
|
|
61
|
+
"arguments": [
|
|
62
|
+
{
|
|
63
|
+
"name": "store-id",
|
|
64
|
+
"required": true
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"options": [
|
|
68
|
+
{
|
|
69
|
+
"name": "sku",
|
|
70
|
+
"group": "body",
|
|
71
|
+
"required": true,
|
|
72
|
+
"arguments": [
|
|
73
|
+
{
|
|
74
|
+
"name": "string"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "quantity",
|
|
80
|
+
"group": "body",
|
|
81
|
+
"arguments": [
|
|
82
|
+
{
|
|
83
|
+
"name": "integer"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"x-openapi": {
|
|
89
|
+
"method": "post",
|
|
90
|
+
"path": "/stores/{store_id}/items",
|
|
91
|
+
"operationId": "createStoreItem",
|
|
92
|
+
"contentType": "application/json",
|
|
93
|
+
"params": [
|
|
94
|
+
{
|
|
95
|
+
"in": "path",
|
|
96
|
+
"name": "store_id",
|
|
97
|
+
"from": "argument:store-id",
|
|
98
|
+
"required": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"body": {
|
|
102
|
+
"style": "flatten",
|
|
103
|
+
"contentType": "application/json",
|
|
104
|
+
"properties": [
|
|
105
|
+
{
|
|
106
|
+
"name": "sku",
|
|
107
|
+
"from": "option:sku",
|
|
108
|
+
"jsonPath": "sku",
|
|
109
|
+
"encoding": "string",
|
|
110
|
+
"required": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "quantity",
|
|
114
|
+
"from": "option:quantity",
|
|
115
|
+
"jsonPath": "quantity",
|
|
116
|
+
"encoding": "integer"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "retrieve",
|
|
124
|
+
"aliases": [
|
|
125
|
+
"get"
|
|
126
|
+
],
|
|
127
|
+
"description": "Retrieve a store item.",
|
|
128
|
+
"arguments": [
|
|
129
|
+
{
|
|
130
|
+
"name": "store-id",
|
|
131
|
+
"required": true
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "item-id",
|
|
135
|
+
"required": true
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"x-openapi": {
|
|
139
|
+
"method": "get",
|
|
140
|
+
"path": "/stores/{store_id}/items/{item_id}",
|
|
141
|
+
"operationId": "retrieveStoreItem",
|
|
142
|
+
"params": [
|
|
143
|
+
{
|
|
144
|
+
"in": "path",
|
|
145
|
+
"name": "store_id",
|
|
146
|
+
"from": "argument:store-id",
|
|
147
|
+
"required": true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"in": "path",
|
|
151
|
+
"name": "item_id",
|
|
152
|
+
"from": "argument:item-id",
|
|
153
|
+
"required": true
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "archive",
|
|
160
|
+
"description": "Archive a store item.",
|
|
161
|
+
"arguments": [
|
|
162
|
+
{
|
|
163
|
+
"name": "store-id",
|
|
164
|
+
"required": true
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "item-id",
|
|
168
|
+
"required": true
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"x-openapi": {
|
|
172
|
+
"method": "post",
|
|
173
|
+
"path": "/stores/{store_id}/items/{item_id}/archive",
|
|
174
|
+
"operationId": "archiveStoreItem",
|
|
175
|
+
"params": [
|
|
176
|
+
{
|
|
177
|
+
"in": "path",
|
|
178
|
+
"name": "store_id",
|
|
179
|
+
"from": "argument:store-id",
|
|
180
|
+
"required": true
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"in": "path",
|
|
184
|
+
"name": "item_id",
|
|
185
|
+
"from": "argument:item-id",
|
|
186
|
+
"required": true
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"log"
|
|
6
|
+
"os"
|
|
7
|
+
|
|
8
|
+
"example.com/stores-api/pkg/cmd"
|
|
9
|
+
"github.com/urfave/cli/v3"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
func main() {
|
|
13
|
+
app := &cli.Command{
|
|
14
|
+
Name: "stores-api",
|
|
15
|
+
Version: "1.0.0",
|
|
16
|
+
Commands: []*cli.Command{
|
|
17
|
+
cmd.NewStoresCommand(),
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
if err := app.Run(context.Background(), os.Args); err != nil {
|
|
21
|
+
log.Fatal(err)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package runtime
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"net/http"
|
|
5
|
+
"os"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
const defaultBaseURL = "https://api.stores.test/v2"
|
|
9
|
+
|
|
10
|
+
// BaseURL returns the API base URL, overridable via STORES_API_BASE_URL.
|
|
11
|
+
func BaseURL() string {
|
|
12
|
+
if v := os.Getenv("STORES_API_BASE_URL"); v != "" {
|
|
13
|
+
return v
|
|
14
|
+
}
|
|
15
|
+
return defaultBaseURL
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// applyAuth attaches credentials read from the environment to the request.
|
|
19
|
+
func applyAuth(req *http.Request) {}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
package runtime
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"bytes"
|
|
5
|
+
"context"
|
|
6
|
+
"fmt"
|
|
7
|
+
"io"
|
|
8
|
+
"net/http"
|
|
9
|
+
"net/url"
|
|
10
|
+
"strings"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
// Request is a generic API request assembled by a generated command handler.
|
|
14
|
+
type Request struct {
|
|
15
|
+
Method string
|
|
16
|
+
Path string
|
|
17
|
+
Query url.Values
|
|
18
|
+
Headers http.Header
|
|
19
|
+
Body []byte
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Do executes the request against the configured base URL (applying auth) and
|
|
23
|
+
// prints the response body to stdout.
|
|
24
|
+
func Do(ctx context.Context, req Request) error {
|
|
25
|
+
endpoint := strings.TrimRight(BaseURL(), "/") + req.Path
|
|
26
|
+
if len(req.Query) > 0 {
|
|
27
|
+
endpoint += "?" + req.Query.Encode()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var body io.Reader
|
|
31
|
+
if len(req.Body) > 0 {
|
|
32
|
+
body = bytes.NewReader(req.Body)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
httpReq, err := http.NewRequestWithContext(ctx, req.Method, endpoint, body)
|
|
36
|
+
if err != nil {
|
|
37
|
+
return err
|
|
38
|
+
}
|
|
39
|
+
for key, values := range req.Headers {
|
|
40
|
+
for _, value := range values {
|
|
41
|
+
httpReq.Header.Add(key, value)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if len(req.Body) > 0 && httpReq.Header.Get("Content-Type") == "" {
|
|
45
|
+
httpReq.Header.Set("Content-Type", "application/json")
|
|
46
|
+
}
|
|
47
|
+
applyAuth(httpReq)
|
|
48
|
+
|
|
49
|
+
resp, err := http.DefaultClient.Do(httpReq)
|
|
50
|
+
if err != nil {
|
|
51
|
+
return err
|
|
52
|
+
}
|
|
53
|
+
defer resp.Body.Close()
|
|
54
|
+
|
|
55
|
+
out, err := io.ReadAll(resp.Body)
|
|
56
|
+
if err != nil {
|
|
57
|
+
return err
|
|
58
|
+
}
|
|
59
|
+
fmt.Println(string(out))
|
|
60
|
+
if resp.StatusCode >= 400 {
|
|
61
|
+
return fmt.Errorf("request failed: %s", resp.Status)
|
|
62
|
+
}
|
|
63
|
+
return nil
|
|
64
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
package cmd
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"encoding/json"
|
|
6
|
+
"fmt"
|
|
7
|
+
"net/url"
|
|
8
|
+
|
|
9
|
+
"example.com/stores-api/internal/runtime"
|
|
10
|
+
"github.com/urfave/cli/v3"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func NewStoresCommand() *cli.Command {
|
|
14
|
+
return &cli.Command{
|
|
15
|
+
Name: "stores",
|
|
16
|
+
Commands: []*cli.Command{
|
|
17
|
+
&cli.Command{
|
|
18
|
+
Name: "items",
|
|
19
|
+
Commands: []*cli.Command{
|
|
20
|
+
&cli.Command{
|
|
21
|
+
Name: "list",
|
|
22
|
+
Usage: "List items in a store.",
|
|
23
|
+
Flags: []cli.Flag{
|
|
24
|
+
&cli.IntFlag{
|
|
25
|
+
Name: "limit",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
Action: handleStoresItemsList,
|
|
29
|
+
},
|
|
30
|
+
&cli.Command{
|
|
31
|
+
Name: "create",
|
|
32
|
+
Usage: "Create an item in a store.",
|
|
33
|
+
Flags: []cli.Flag{
|
|
34
|
+
&cli.StringFlag{
|
|
35
|
+
Name: "sku",
|
|
36
|
+
Required: true,
|
|
37
|
+
},
|
|
38
|
+
&cli.IntFlag{
|
|
39
|
+
Name: "quantity",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
Action: handleStoresItemsCreate,
|
|
43
|
+
},
|
|
44
|
+
&cli.Command{
|
|
45
|
+
Name: "retrieve",
|
|
46
|
+
Aliases: []string{
|
|
47
|
+
"get",
|
|
48
|
+
},
|
|
49
|
+
Usage: "Retrieve a store item.",
|
|
50
|
+
Action: handleStoresItemsRetrieve,
|
|
51
|
+
},
|
|
52
|
+
&cli.Command{
|
|
53
|
+
Name: "archive",
|
|
54
|
+
Usage: "Archive a store item.",
|
|
55
|
+
Action: handleStoresItemsArchive,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
func handleStoresItemsList(ctx context.Context, cmd *cli.Command) error {
|
|
64
|
+
storeID := cmd.Args().Get(0)
|
|
65
|
+
path := "/stores/" + url.PathEscape(storeID) + "/items"
|
|
66
|
+
query := url.Values{}
|
|
67
|
+
if cmd.IsSet("limit") {
|
|
68
|
+
query.Set("limit", fmt.Sprint(cmd.Int("limit")))
|
|
69
|
+
}
|
|
70
|
+
req := runtime.Request{
|
|
71
|
+
Method: "GET",
|
|
72
|
+
Path: path,
|
|
73
|
+
Query: query,
|
|
74
|
+
}
|
|
75
|
+
return runtime.Do(ctx, req)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
func handleStoresItemsCreate(ctx context.Context, cmd *cli.Command) error {
|
|
79
|
+
storeID := cmd.Args().Get(0)
|
|
80
|
+
path := "/stores/" + url.PathEscape(storeID) + "/items"
|
|
81
|
+
body := map[string]any{}
|
|
82
|
+
if cmd.IsSet("sku") {
|
|
83
|
+
body["sku"] = cmd.String("sku")
|
|
84
|
+
}
|
|
85
|
+
if cmd.IsSet("quantity") {
|
|
86
|
+
body["quantity"] = cmd.Int("quantity")
|
|
87
|
+
}
|
|
88
|
+
bodyBytes, err := json.Marshal(body)
|
|
89
|
+
if err != nil {
|
|
90
|
+
return err
|
|
91
|
+
}
|
|
92
|
+
req := runtime.Request{
|
|
93
|
+
Method: "POST",
|
|
94
|
+
Path: path,
|
|
95
|
+
Body: bodyBytes,
|
|
96
|
+
}
|
|
97
|
+
return runtime.Do(ctx, req)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
func handleStoresItemsRetrieve(ctx context.Context, cmd *cli.Command) error {
|
|
101
|
+
storeID := cmd.Args().Get(0)
|
|
102
|
+
itemID := cmd.Args().Get(1)
|
|
103
|
+
path := "/stores/" + url.PathEscape(storeID) + "/items/" + url.PathEscape(itemID)
|
|
104
|
+
req := runtime.Request{
|
|
105
|
+
Method: "GET",
|
|
106
|
+
Path: path,
|
|
107
|
+
}
|
|
108
|
+
return runtime.Do(ctx, req)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
func handleStoresItemsArchive(ctx context.Context, cmd *cli.Command) error {
|
|
112
|
+
storeID := cmd.Args().Get(0)
|
|
113
|
+
itemID := cmd.Args().Get(1)
|
|
114
|
+
path := "/stores/" + url.PathEscape(storeID) + "/items/" + url.PathEscape(itemID) + "/archive"
|
|
115
|
+
req := runtime.Request{
|
|
116
|
+
Method: "POST",
|
|
117
|
+
Path: path,
|
|
118
|
+
}
|
|
119
|
+
return runtime.Do(ctx, req)
|
|
120
|
+
}
|