@xyd-js/openapi2opencli 0.0.0-canary-4287eee-20260630010340
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/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__create/input.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__admin-api-keys__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__audit-logs__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__audit-logs__list/input.json +54 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__activate/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__activate/input.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__create/input.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__deactivate/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__deactivate/input.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__certificates__update/input.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__data-retention__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__data-retention__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__data-retention__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__data-retention__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__create/input.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__roles__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__update/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__update/input.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__groups__users__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__create/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__list/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__invites__retrieve/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__api-keys__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__archive/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__archive/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__activate/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__activate/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__deactivate/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__deactivate/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__certificates__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__create/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__data-retention__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__data-retention__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__data-retention__update/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__data-retention__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__create/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__create/input.json +22 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__create/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__create/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__delete/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__list/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__list/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__retrieve/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__groups__roles__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__hosted-tool-permissions__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__hosted-tool-permissions__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__hosted-tool-permissions__update/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__hosted-tool-permissions__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__delete/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__update/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__model-permissions__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__list-rate-limits/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__list-rate-limits/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__update-rate-limit/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__rate-limits__update-rate-limit/input.json +31 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__create/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__create/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__list/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__update/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__roles__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__update/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__service-accounts__update/input.json +21 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__create/expected.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__create/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__list/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__update/expected.json +20 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__spend-alerts__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__update/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__create/input.json +23 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__create/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__create/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__delete/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__list/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__list/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__retrieve/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__roles__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__update/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__projects__users__update/input.json +23 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__create/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__roles__update/input.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__create/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__create/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__delete/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__list/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__retrieve/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__update/expected.json +18 -0
- package/__fixtures__/-2.complex.openai/admin__organization__spend-alerts__update/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__audio-speeches/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__audio-speeches/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__audio-transcriptions/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__audio-transcriptions/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__code-interpreter-sessions/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__code-interpreter-sessions/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__completions/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__completions/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__costs/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__costs/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__embeddings/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__embeddings/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__file-search-calls/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__file-search-calls/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__images/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__images/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__moderations/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__moderations/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__vector-stores/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__vector-stores/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__web-search-calls/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__usage__web-search-calls/input.json +3 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__delete/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__list/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__retrieve/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__roles__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/admin__organization__users__update/input.json +24 -0
- package/__fixtures__/-2.complex.openai/audio__speech__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/audio__speech__create/input.json +22 -0
- package/__fixtures__/-2.complex.openai/audio__transcriptions__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/audio__transcriptions__create/input.json +27 -0
- package/__fixtures__/-2.complex.openai/audio__translations__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/audio__translations__create/input.json +19 -0
- package/__fixtures__/-2.complex.openai/batches__cancel/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/batches__cancel/input.json +20 -0
- package/__fixtures__/-2.complex.openai/batches__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/batches__create/input.json +20 -0
- package/__fixtures__/-2.complex.openai/batches__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/batches__list/input.json +19 -0
- package/__fixtures__/-2.complex.openai/batches__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/batches__retrieve/input.json +19 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__create/input.json +26 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__delete/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__list/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__update/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__assistants__update/input.json +26 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__cancel/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__cancel/input.json +20 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__sessions__create/input.json +20 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list-items/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__list-items/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__chatkit__threads__retrieve/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__threads__create/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/beta__threads__create/input.json +18 -0
- package/__fixtures__/-2.complex.openai/beta__threads__create-and-run/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__threads__create-and-run/input.json +18 -0
- package/__fixtures__/-2.complex.openai/beta__threads__delete/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__threads__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__create/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__create/input.json +25 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__delete/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__list/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__list/input.json +39 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__retrieve/input.json +39 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__update/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__messages__update/input.json +25 -0
- package/__fixtures__/-2.complex.openai/beta__threads__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__threads__retrieve/input.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__cancel/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__cancel/input.json +31 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__create/input.json +31 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__list/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__list/input.json +34 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__retrieve/input.json +34 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__list/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__list/input.json +44 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__retrieve/expected.json +17 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__steps__retrieve/input.json +44 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__submit-tool-outputs/expected.json +16 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__submit-tool-outputs/input.json +31 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__update/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/beta__threads__runs__update/input.json +31 -0
- package/__fixtures__/-2.complex.openai/beta__threads__update/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/beta__threads__update/input.json +18 -0
- package/__fixtures__/-2.complex.openai/chat__completions__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/chat__completions__create/input.json +13 -0
- package/__fixtures__/-2.complex.openai/chat__completions__delete/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/chat__completions__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/chat__completions__list/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/chat__completions__list/input.json +34 -0
- package/__fixtures__/-2.complex.openai/chat__completions__messages__list/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/chat__completions__messages__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/chat__completions__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/chat__completions__retrieve/input.json +34 -0
- package/__fixtures__/-2.complex.openai/chat__completions__update/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/chat__completions__update/input.json +13 -0
- package/__fixtures__/-2.complex.openai/completions__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/completions__create/input.json +33 -0
- package/__fixtures__/-2.complex.openai/containers__create/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/containers__create/input.json +20 -0
- package/__fixtures__/-2.complex.openai/containers__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/containers__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/containers__files__content__retrieve/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/containers__files__content__retrieve/input.json +19 -0
- package/__fixtures__/-2.complex.openai/containers__files__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/containers__files__create/input.json +22 -0
- package/__fixtures__/-2.complex.openai/containers__files__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/containers__files__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/containers__files__list/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/containers__files__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/containers__files__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/containers__files__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/containers__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/containers__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/containers__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/containers__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/conversations__create/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/conversations__create/input.json +16 -0
- package/__fixtures__/-2.complex.openai/conversations__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/conversations__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/conversations__items__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/conversations__items__create/input.json +26 -0
- package/__fixtures__/-2.complex.openai/conversations__items__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/conversations__items__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/conversations__items__list/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/conversations__items__list/input.json +34 -0
- package/__fixtures__/-2.complex.openai/conversations__items__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/conversations__items__retrieve/input.json +34 -0
- package/__fixtures__/-2.complex.openai/conversations__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/conversations__retrieve/input.json +14 -0
- package/__fixtures__/-2.complex.openai/conversations__update/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/conversations__update/input.json +16 -0
- package/__fixtures__/-2.complex.openai/embeddings__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/embeddings__create/input.json +19 -0
- package/__fixtures__/-2.complex.openai/files__content/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/files__content/input.json +29 -0
- package/__fixtures__/-2.complex.openai/files__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/files__create/input.json +18 -0
- package/__fixtures__/-2.complex.openai/files__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/files__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/files__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/files__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/files__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/files__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__alpha__graders__run/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__alpha__graders__run/input.json +3 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__alpha__graders__validate/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__alpha__graders__validate/input.json +3 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__delete/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__checkpoints__permissions__retrieve/input.json +34 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__cancel/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__cancel/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__checkpoints__list/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__checkpoints__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__create/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list-events/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__list-events/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__pause/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__pause/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__resume/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__resume/input.json +24 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/fine-tuning__jobs__retrieve/input.json +24 -0
- package/__fixtures__/-2.complex.openai/images__create-variation/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/images__create-variation/input.json +3 -0
- package/__fixtures__/-2.complex.openai/images__edit/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/images__edit/input.json +3 -0
- package/__fixtures__/-2.complex.openai/images__generate/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/images__generate/input.json +3 -0
- package/__fixtures__/-2.complex.openai/models__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/models__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/models__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/models__list/input.json +8 -0
- package/__fixtures__/-2.complex.openai/models__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/models__retrieve/input.json +8 -0
- package/__fixtures__/-2.complex.openai/moderations__create/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/moderations__create/input.json +16 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__accept/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__accept/input.json +16 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__hangup/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__hangup/input.json +16 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__refer/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__refer/input.json +16 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__reject/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/realtime__calls__reject/input.json +16 -0
- package/__fixtures__/-2.complex.openai/realtime__client-secrets__create/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/realtime__client-secrets__create/input.json +16 -0
- package/__fixtures__/-2.complex.openai/responses__cancel/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/responses__cancel/input.json +13 -0
- package/__fixtures__/-2.complex.openai/responses__compact/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/responses__compact/input.json +13 -0
- package/__fixtures__/-2.complex.openai/responses__create/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/responses__create/input.json +13 -0
- package/__fixtures__/-2.complex.openai/responses__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/responses__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/responses__input-items__list/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/responses__input-items__list/input.json +34 -0
- package/__fixtures__/-2.complex.openai/responses__input-tokens__count/expected.json +11 -0
- package/__fixtures__/-2.complex.openai/responses__input-tokens__count/input.json +26 -0
- package/__fixtures__/-2.complex.openai/responses__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/responses__retrieve/input.json +34 -0
- package/__fixtures__/-2.complex.openai/skills__content__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__content__retrieve/input.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__create/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/skills__create/input.json +14 -0
- package/__fixtures__/-2.complex.openai/skills__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/skills__delete/input.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/skills__list/input.json +23 -0
- package/__fixtures__/-2.complex.openai/skills__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/skills__retrieve/input.json +23 -0
- package/__fixtures__/-2.complex.openai/skills__update/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__update/input.json +14 -0
- package/__fixtures__/-2.complex.openai/skills__versions__content__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/skills__versions__content__retrieve/input.json +18 -0
- package/__fixtures__/-2.complex.openai/skills__versions__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__versions__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/skills__versions__delete/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__versions__delete/input.json +18 -0
- package/__fixtures__/-2.complex.openai/skills__versions__list/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__versions__list/input.json +28 -0
- package/__fixtures__/-2.complex.openai/skills__versions__retrieve/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/skills__versions__retrieve/input.json +28 -0
- package/__fixtures__/-2.complex.openai/uploads__cancel/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/uploads__cancel/input.json +20 -0
- package/__fixtures__/-2.complex.openai/uploads__complete/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/uploads__complete/input.json +20 -0
- package/__fixtures__/-2.complex.openai/uploads__create/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/uploads__create/input.json +20 -0
- package/__fixtures__/-2.complex.openai/uploads__parts__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/uploads__parts__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/vector-stores__create/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/vector-stores__create/input.json +21 -0
- package/__fixtures__/-2.complex.openai/vector-stores__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/vector-stores__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__cancel/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__cancel/input.json +25 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__create/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__create/input.json +25 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__list-files/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__list-files/input.json +19 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__file-batches__retrieve/input.json +19 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__content/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__content/input.json +39 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__create/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__create/input.json +24 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__delete/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__delete/input.json +19 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__list/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__list/input.json +39 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__retrieve/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__retrieve/input.json +39 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__update/expected.json +15 -0
- package/__fixtures__/-2.complex.openai/vector-stores__files__update/input.json +24 -0
- package/__fixtures__/-2.complex.openai/vector-stores__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/vector-stores__list/input.json +29 -0
- package/__fixtures__/-2.complex.openai/vector-stores__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/vector-stores__retrieve/input.json +29 -0
- package/__fixtures__/-2.complex.openai/vector-stores__search/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/vector-stores__search/input.json +21 -0
- package/__fixtures__/-2.complex.openai/vector-stores__update/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/vector-stores__update/input.json +21 -0
- package/__fixtures__/-2.complex.openai/videos__create/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/videos__create/input.json +20 -0
- package/__fixtures__/-2.complex.openai/videos__create-character/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/videos__create-character/input.json +20 -0
- package/__fixtures__/-2.complex.openai/videos__delete/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/videos__delete/input.json +14 -0
- package/__fixtures__/-2.complex.openai/videos__download-content/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/videos__download-content/input.json +24 -0
- package/__fixtures__/-2.complex.openai/videos__edit/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/videos__edit/input.json +20 -0
- package/__fixtures__/-2.complex.openai/videos__extend/expected.json +14 -0
- package/__fixtures__/-2.complex.openai/videos__extend/input.json +20 -0
- package/__fixtures__/-2.complex.openai/videos__get-character/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/videos__get-character/input.json +24 -0
- package/__fixtures__/-2.complex.openai/videos__list/expected.json +10 -0
- package/__fixtures__/-2.complex.openai/videos__list/input.json +24 -0
- package/__fixtures__/-2.complex.openai/videos__remix/expected.json +13 -0
- package/__fixtures__/-2.complex.openai/videos__remix/input.json +20 -0
- package/__fixtures__/-2.complex.openai/videos__retrieve/expected.json +12 -0
- package/__fixtures__/-2.complex.openai/videos__retrieve/input.json +24 -0
- package/__fixtures__/1.basic/input.yaml +48 -0
- package/__fixtures__/1.basic/output.json +74 -0
- package/__fixtures__/2.crud/input.yaml +113 -0
- package/__fixtures__/2.crud/output.json +281 -0
- package/__fixtures__/3.nested/input.yaml +84 -0
- package/__fixtures__/3.nested/output.json +196 -0
- package/__fixtures__/4.body-flatten/input.yaml +61 -0
- package/__fixtures__/4.body-flatten/output.json +153 -0
- package/__tests__/conformance.test.ts +99 -0
- package/__tests__/docs-oracle.test.ts +237 -0
- package/__tests__/openapi2opencli.test.ts +31 -0
- package/__tests__/utils.ts +41 -0
- package/biome.json +25 -0
- package/index.ts +1 -0
- package/oracle/README.md +41 -0
- package/oracle/coverage.floor.json +4 -0
- package/oracle/docs-allowlist.json +201 -0
- package/oracle/docs-coverage.floor.json +4 -0
- package/oracle/docs-methods.json +3744 -0
- package/oracle/docsOracle.ts +152 -0
- package/oracle/openai-openapi.yaml +81040 -0
- package/oracle/parseOpenaiCli.ts +205 -0
- package/oracle/pins.json +6 -0
- package/oracle/surface.json +5844 -0
- package/package.json +27 -0
- package/src/action.ts +118 -0
- package/src/body.ts +132 -0
- package/src/command.ts +66 -0
- package/src/index.ts +12 -0
- package/src/naming.ts +40 -0
- package/src/openapi2opencli.ts +106 -0
- package/src/parameters.ts +108 -0
- package/src/schema.ts +110 -0
- package/src/security.ts +43 -0
- package/src/surface.ts +165 -0
- package/src/tree.ts +78 -0
- package/src/types.ts +86 -0
- package/src/unique.ts +11 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +19 -0
- package/vitest.config.ts +8 -0
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyd-js/openapi2opencli",
|
|
3
|
+
"version": "0.0.0-canary-4287eee-20260630010340",
|
|
4
|
+
"description": "Convert an OpenAPI 3.x document into an OpenCLI document (with the x-openapi request binding) consumable by the opencli2* code generators",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"openapi-types": "^12.1.3",
|
|
9
|
+
"@xyd-js/opencli": "0.1.0-build.0",
|
|
10
|
+
"@xyd-js/openapi": "0.0.0-canary-4287eee-20260630010340"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@types/node": "^20.9.0",
|
|
14
|
+
"rimraf": "^3.0.2",
|
|
15
|
+
"tsup": "^8.3.0",
|
|
16
|
+
"typescript": "^5.6.2",
|
|
17
|
+
"vitest": "^2.1.1"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"prebuild": "pnpm clean",
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"test": "vitest",
|
|
24
|
+
"ci:test": "vitest run",
|
|
25
|
+
"format": "bunx biome check --write src"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/action.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
|
|
3
|
+
import { kebabCase, splitWords } from './naming';
|
|
4
|
+
import type { OpenApi2OpenCliOptions, VerbMap } from './types';
|
|
5
|
+
import { DEFAULT_CUSTOM_ACTION_VERBS } from './types';
|
|
6
|
+
|
|
7
|
+
export interface PathSegment {
|
|
8
|
+
kind: 'static' | 'param';
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Parse `/chat/completions/{completion_id}` into ordered segments. */
|
|
13
|
+
export function parsePath(path: string): PathSegment[] {
|
|
14
|
+
return path
|
|
15
|
+
.split('/')
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.map((seg) => {
|
|
18
|
+
const m = seg.match(/^\{(.+)\}$/);
|
|
19
|
+
return m ? { kind: 'param' as const, value: m[1] } : { kind: 'static' as const, value: seg };
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DerivedTarget {
|
|
24
|
+
/** kebab-cased resource command path, e.g. ["chat","completions"] */
|
|
25
|
+
resourcePath: string[];
|
|
26
|
+
/** kebab-cased leaf action, e.g. "create" / "retrieve" / "cancel" */
|
|
27
|
+
action: string;
|
|
28
|
+
/** optional aliases for the leaf command, e.g. ["get"] for retrieve */
|
|
29
|
+
aliases: string[];
|
|
30
|
+
/** wire names of path parameters in order (positional arguments) */
|
|
31
|
+
pathParamNames: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DEFAULT_VERBS: Required<VerbMap> = {
|
|
35
|
+
listCollection: 'list',
|
|
36
|
+
getItem: 'retrieve',
|
|
37
|
+
createCollection: 'create',
|
|
38
|
+
updateItem: 'update',
|
|
39
|
+
deleteItem: 'delete',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function leadingVerb(operationId?: string): string | undefined {
|
|
43
|
+
if (!operationId) return undefined;
|
|
44
|
+
return splitWords(operationId)[0];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Derive the command-tree placement of an operation from its method + path
|
|
49
|
+
* (the default "path" grouping). See the mapping table in the package README.
|
|
50
|
+
*/
|
|
51
|
+
export function deriveTarget(
|
|
52
|
+
method: string,
|
|
53
|
+
path: string,
|
|
54
|
+
operation: OpenAPIV3.OperationObject,
|
|
55
|
+
options: OpenApi2OpenCliOptions,
|
|
56
|
+
): DerivedTarget {
|
|
57
|
+
const verbs: Required<VerbMap> = { ...DEFAULT_VERBS, ...(options.verbMap || {}) };
|
|
58
|
+
const customVerbs = new Set(
|
|
59
|
+
(options.customActionVerbs ?? DEFAULT_CUSTOM_ACTION_VERBS).map((v) => v.toLowerCase()),
|
|
60
|
+
);
|
|
61
|
+
const actionAliases = options.actionAliases !== false;
|
|
62
|
+
|
|
63
|
+
const segments = parsePath(path);
|
|
64
|
+
const staticSegs = segments.filter((s) => s.kind === 'static').map((s) => s.value);
|
|
65
|
+
const pathParamNames = segments.filter((s) => s.kind === 'param').map((s) => s.value);
|
|
66
|
+
const hasParams = pathParamNames.length > 0;
|
|
67
|
+
const last = segments[segments.length - 1];
|
|
68
|
+
const m = method.toLowerCase();
|
|
69
|
+
|
|
70
|
+
let resourceSegs: string[];
|
|
71
|
+
let action: string;
|
|
72
|
+
const aliases: string[] = [];
|
|
73
|
+
|
|
74
|
+
if (last && last.kind === 'param') {
|
|
75
|
+
// Item operation: /resource/{id}
|
|
76
|
+
resourceSegs = staticSegs;
|
|
77
|
+
if (m === 'get') {
|
|
78
|
+
action = verbs.getItem;
|
|
79
|
+
if (actionAliases && action === 'retrieve') aliases.push('get');
|
|
80
|
+
} else if (m === 'put' || m === 'patch') {
|
|
81
|
+
action = verbs.updateItem;
|
|
82
|
+
} else if (m === 'delete') {
|
|
83
|
+
action = verbs.deleteItem;
|
|
84
|
+
} else {
|
|
85
|
+
// POST on an item — uncommon; prefer the operationId verb.
|
|
86
|
+
action = leadingVerb(operation.operationId) || verbs.createCollection;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
// Last segment is static.
|
|
90
|
+
const lastStatic = staticSegs[staticSegs.length - 1];
|
|
91
|
+
const isCustomAction = hasParams && lastStatic && customVerbs.has(lastStatic.toLowerCase());
|
|
92
|
+
|
|
93
|
+
if (isCustomAction) {
|
|
94
|
+
action = kebabCase(lastStatic);
|
|
95
|
+
resourceSegs = staticSegs.slice(0, -1);
|
|
96
|
+
} else {
|
|
97
|
+
resourceSegs = staticSegs;
|
|
98
|
+
if (m === 'get') {
|
|
99
|
+
action = verbs.listCollection;
|
|
100
|
+
} else if (m === 'post') {
|
|
101
|
+
action = verbs.createCollection;
|
|
102
|
+
} else if (m === 'put' || m === 'patch') {
|
|
103
|
+
action = verbs.updateItem;
|
|
104
|
+
} else if (m === 'delete') {
|
|
105
|
+
action = verbs.deleteItem;
|
|
106
|
+
} else {
|
|
107
|
+
action = leadingVerb(operation.operationId) || m;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
resourcePath: resourceSegs.map(kebabCase),
|
|
114
|
+
action: kebabCase(action),
|
|
115
|
+
aliases,
|
|
116
|
+
pathParamNames,
|
|
117
|
+
};
|
|
118
|
+
}
|
package/src/body.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { Argument, Option, XOpenApiBody, XOpenApiBodyProp } from '@xyd-js/opencli';
|
|
3
|
+
|
|
4
|
+
import { camelCase, kebabCase } from './naming';
|
|
5
|
+
import {
|
|
6
|
+
arrayItems,
|
|
7
|
+
getEnum,
|
|
8
|
+
isArray,
|
|
9
|
+
isBinary,
|
|
10
|
+
isBoolean,
|
|
11
|
+
isObjectSchema,
|
|
12
|
+
resolveObjectSchema,
|
|
13
|
+
scalarType,
|
|
14
|
+
type Schema,
|
|
15
|
+
} from './schema';
|
|
16
|
+
import { uniqueName } from './unique';
|
|
17
|
+
import type { FlagCase, OpenApi2OpenCliOptions } from './types';
|
|
18
|
+
|
|
19
|
+
export interface BodyMapResult {
|
|
20
|
+
options: Option[];
|
|
21
|
+
xBody?: XOpenApiBody;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function flagName(wire: string, flagCase: FlagCase | undefined): string {
|
|
25
|
+
return flagCase === 'camel' ? camelCase(wire) : kebabCase(wire);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Pick the content type to drive the body mapping. */
|
|
29
|
+
function pickContent(
|
|
30
|
+
content: { [media: string]: OpenAPIV3.MediaTypeObject } | undefined,
|
|
31
|
+
): { mediaType: string; schema?: Schema } | undefined {
|
|
32
|
+
if (!content) return undefined;
|
|
33
|
+
const keys = Object.keys(content);
|
|
34
|
+
if (keys.length === 0) return undefined;
|
|
35
|
+
const prefer = ['application/json', 'multipart/form-data', 'application/x-www-form-urlencoded'];
|
|
36
|
+
const chosen = prefer.find((k) => keys.includes(k)) || keys[0];
|
|
37
|
+
return { mediaType: chosen, schema: content[chosen]?.schema as Schema | undefined };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Encoding hint a generator uses to serialize a CLI value into a body field. */
|
|
41
|
+
function encodingFor(schema: Schema | undefined): XOpenApiBodyProp['encoding'] {
|
|
42
|
+
if (isBinary(schema)) return 'file';
|
|
43
|
+
if (isArray(schema)) return 'array';
|
|
44
|
+
const t = scalarType(schema);
|
|
45
|
+
if (t) return t as XOpenApiBodyProp['encoding'];
|
|
46
|
+
return 'json'; // nested object / oneOf / anyOf → JSON string
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function valueArgument(schema: Schema | undefined): Argument {
|
|
50
|
+
if (isBinary(schema)) return { name: 'path' };
|
|
51
|
+
const isArr = isArray(schema);
|
|
52
|
+
const label = isArr
|
|
53
|
+
? scalarType(arrayItems(schema)) || (isObjectSchema(arrayItems(schema)) ? 'json' : 'value')
|
|
54
|
+
: scalarType(schema) || (isObjectSchema(schema) ? 'json' : 'value');
|
|
55
|
+
const arg: Argument = { name: label };
|
|
56
|
+
const enumValues = getEnum(isArr ? arrayItems(schema) : schema);
|
|
57
|
+
if (enumValues) arg.acceptedValues = enumValues;
|
|
58
|
+
if (isArr) arg.arity = { minimum: 0 };
|
|
59
|
+
return arg;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Map an operation's request body to OpenCLI options + the `x-openapi.body`
|
|
64
|
+
* binding. With the default hybrid strategy, top-level scalars/scalar-arrays
|
|
65
|
+
* flatten into flags and nested objects/compositions collapse to a JSON-string
|
|
66
|
+
* flag named after the property.
|
|
67
|
+
*/
|
|
68
|
+
export function mapRequestBody(
|
|
69
|
+
requestBody: OpenAPIV3.RequestBodyObject | undefined,
|
|
70
|
+
usedFlagNames: Set<string>,
|
|
71
|
+
options: OpenApi2OpenCliOptions,
|
|
72
|
+
): BodyMapResult {
|
|
73
|
+
if (!requestBody || !requestBody.content) return { options: [] };
|
|
74
|
+
|
|
75
|
+
const picked = pickContent(requestBody.content);
|
|
76
|
+
if (!picked) return { options: [] };
|
|
77
|
+
|
|
78
|
+
const { mediaType, schema } = picked;
|
|
79
|
+
const isMultipart = mediaType === 'multipart/form-data' || mediaType === 'application/x-www-form-urlencoded';
|
|
80
|
+
const bodyRequired = requestBody.required === true;
|
|
81
|
+
|
|
82
|
+
// Whole-body JSON flag (explicit "json" strategy or a non-object body).
|
|
83
|
+
const resolved = resolveObjectSchema(schema);
|
|
84
|
+
const useSingleJson = options.bodyStrategy === 'json' || (!resolved.object && !isMultipart);
|
|
85
|
+
|
|
86
|
+
if (useSingleJson) {
|
|
87
|
+
const name = uniqueName('body', usedFlagNames);
|
|
88
|
+
const opt: Option = {
|
|
89
|
+
name,
|
|
90
|
+
required: bodyRequired,
|
|
91
|
+
group: 'body',
|
|
92
|
+
description: requestBody.description || 'Request body as a JSON string',
|
|
93
|
+
arguments: [{ name: 'json' }],
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
options: [opt],
|
|
97
|
+
xBody: { style: 'json', contentType: mediaType, from: `option:${name}`, properties: [] },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const object = resolved.object;
|
|
102
|
+
if (!object || !object.properties) {
|
|
103
|
+
return { options: [], xBody: { style: 'json', contentType: mediaType, properties: [] } };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const requiredSet = new Set<string>(Array.isArray(object.required) ? object.required : []);
|
|
107
|
+
const opts: Option[] = [];
|
|
108
|
+
const props: XOpenApiBodyProp[] = [];
|
|
109
|
+
|
|
110
|
+
for (const [wire, rawSchema] of Object.entries(object.properties)) {
|
|
111
|
+
// Skip internal markers injected by the dereferencer (e.g. __UNSAFE_refPath).
|
|
112
|
+
if (wire.startsWith('__')) continue;
|
|
113
|
+
const propSchema = rawSchema as Schema;
|
|
114
|
+
const name = uniqueName(flagName(wire, options.flagCase), usedFlagNames);
|
|
115
|
+
const required = requiredSet.has(wire);
|
|
116
|
+
|
|
117
|
+
const opt: Option = { name, group: 'body' };
|
|
118
|
+
if (required) opt.required = true;
|
|
119
|
+
if (propSchema.description) opt.description = propSchema.description;
|
|
120
|
+
if (!isBoolean(propSchema)) opt.arguments = [valueArgument(propSchema)];
|
|
121
|
+
opts.push(opt);
|
|
122
|
+
|
|
123
|
+
const prop: XOpenApiBodyProp = { name: wire, from: `option:${name}`, jsonPath: wire, encoding: encodingFor(propSchema) };
|
|
124
|
+
if (required) prop.required = true;
|
|
125
|
+
props.push(prop);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
options: opts,
|
|
130
|
+
xBody: { style: isMultipart ? 'multipart' : 'flatten', contentType: mediaType, properties: props },
|
|
131
|
+
};
|
|
132
|
+
}
|
package/src/command.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { Command, XOpenApiCommand } from '@xyd-js/opencli';
|
|
3
|
+
|
|
4
|
+
import { deriveTarget } from './action';
|
|
5
|
+
import { mapParameters } from './parameters';
|
|
6
|
+
import { mapRequestBody } from './body';
|
|
7
|
+
import type { OpenApi2OpenCliOptions } from './types';
|
|
8
|
+
|
|
9
|
+
/** Merge path-item parameters with operation parameters (operation wins on name+in). */
|
|
10
|
+
function mergeParameters(
|
|
11
|
+
pathItemParams: OpenAPIV3.ParameterObject[],
|
|
12
|
+
operationParams: (OpenAPIV3.ParameterObject | OpenAPIV3.ReferenceObject)[] | undefined,
|
|
13
|
+
): OpenAPIV3.ParameterObject[] {
|
|
14
|
+
const byKey = new Map<string, OpenAPIV3.ParameterObject>();
|
|
15
|
+
const add = (p: OpenAPIV3.ParameterObject) => {
|
|
16
|
+
if (p && typeof p === 'object' && 'name' in p && 'in' in p) byKey.set(`${p.in}:${p.name}`, p);
|
|
17
|
+
};
|
|
18
|
+
for (const p of pathItemParams) add(p);
|
|
19
|
+
for (const p of (operationParams || []) as OpenAPIV3.ParameterObject[]) add(p);
|
|
20
|
+
return [...byKey.values()];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface BuiltLeaf {
|
|
24
|
+
resourcePath: string[];
|
|
25
|
+
command: Command;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Build a single leaf command (+ its resource placement) from one operation. */
|
|
29
|
+
export function buildLeafCommand(
|
|
30
|
+
method: string,
|
|
31
|
+
path: string,
|
|
32
|
+
operation: OpenAPIV3.OperationObject,
|
|
33
|
+
pathItemParams: OpenAPIV3.ParameterObject[],
|
|
34
|
+
options: OpenApi2OpenCliOptions,
|
|
35
|
+
): BuiltLeaf {
|
|
36
|
+
const target = deriveTarget(method, path, operation, options);
|
|
37
|
+
const allParams = mergeParameters(pathItemParams, operation.parameters);
|
|
38
|
+
|
|
39
|
+
const usedFlagNames = new Set<string>();
|
|
40
|
+
const params = mapParameters(allParams, target.pathParamNames, usedFlagNames, options);
|
|
41
|
+
const body = mapRequestBody(
|
|
42
|
+
operation.requestBody as OpenAPIV3.RequestBodyObject | undefined,
|
|
43
|
+
usedFlagNames,
|
|
44
|
+
options,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const command: Command = { name: target.action };
|
|
48
|
+
if (target.aliases.length) command.aliases = target.aliases;
|
|
49
|
+
|
|
50
|
+
const description = operation.summary || operation.description;
|
|
51
|
+
if (description) command.description = description;
|
|
52
|
+
|
|
53
|
+
if (params.arguments.length) command.arguments = params.arguments;
|
|
54
|
+
|
|
55
|
+
const allOptions = [...params.options, ...body.options];
|
|
56
|
+
if (allOptions.length) command.options = allOptions;
|
|
57
|
+
|
|
58
|
+
const xOpenapi: XOpenApiCommand = { method: method.toLowerCase(), path };
|
|
59
|
+
if (operation.operationId) xOpenapi.operationId = operation.operationId;
|
|
60
|
+
if (body.xBody?.contentType) xOpenapi.contentType = body.xBody.contentType;
|
|
61
|
+
if (params.xParams.length) xOpenapi.params = params.xParams;
|
|
62
|
+
if (body.xBody) xOpenapi.body = body.xBody;
|
|
63
|
+
command['x-openapi'] = xOpenapi;
|
|
64
|
+
|
|
65
|
+
return { resourcePath: target.resourcePath, command };
|
|
66
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { openapi2opencli, openapi2opencliFromSource } from './openapi2opencli';
|
|
2
|
+
export type {
|
|
3
|
+
OpenApi2OpenCliOptions,
|
|
4
|
+
VerbMap,
|
|
5
|
+
Grouping,
|
|
6
|
+
BodyStrategy,
|
|
7
|
+
FlagCase,
|
|
8
|
+
} from './types';
|
|
9
|
+
export { DEFAULT_CUSTOM_ACTION_VERBS } from './types';
|
|
10
|
+
|
|
11
|
+
export { opencliToSurface, diffSurfaces } from './surface';
|
|
12
|
+
export type { CliSurface, SurfaceCommand, SurfaceFlag, FlagKind, SurfaceDiff, Allowlist } from './surface';
|
package/src/naming.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split an identifier (camelCase, snake_case, kebab-case, space separated)
|
|
3
|
+
* into lowercase words.
|
|
4
|
+
*/
|
|
5
|
+
export function splitWords(input: string): string[] {
|
|
6
|
+
return input
|
|
7
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2') // camelCase boundary
|
|
8
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2') // ACRONYMBoundary
|
|
9
|
+
.split(/[\s_\-./]+/)
|
|
10
|
+
.map((w) => w.trim().toLowerCase())
|
|
11
|
+
.filter(Boolean);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** kebab-case a wire name (e.g. `completionId` → `completion-id`, `max_tokens` → `max-tokens`). */
|
|
15
|
+
export function kebabCase(input: string): string {
|
|
16
|
+
return splitWords(input).join('-');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** camelCase a wire name. */
|
|
20
|
+
export function camelCase(input: string): string {
|
|
21
|
+
const words = splitWords(input);
|
|
22
|
+
return words
|
|
23
|
+
.map((w, i) => (i === 0 ? w : w.charAt(0).toUpperCase() + w.slice(1)))
|
|
24
|
+
.join('');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** SCREAMING_SNAKE_CASE (used for env var names). */
|
|
28
|
+
export function screamingSnakeCase(input: string): string {
|
|
29
|
+
return splitWords(input).join('_').toUpperCase();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Slugify a free-form title into a CLI binary name (lowercase, dash separated,
|
|
34
|
+
* alnum only). e.g. "OpenAI API" → "openai-api".
|
|
35
|
+
*/
|
|
36
|
+
export function slug(input: string): string {
|
|
37
|
+
return splitWords(input)
|
|
38
|
+
.join('-')
|
|
39
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
40
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { CliInfo, Contact, License, OpencliSpecJson, XOpenApiRoot } from '@xyd-js/opencli';
|
|
3
|
+
import { deferencedOpenAPI } from '@xyd-js/openapi';
|
|
4
|
+
|
|
5
|
+
import { buildLeafCommand } from './command';
|
|
6
|
+
import { slug } from './naming';
|
|
7
|
+
import { securitySchemesToXOpenApi } from './security';
|
|
8
|
+
import { CommandTree } from './tree';
|
|
9
|
+
import type { OpenApi2OpenCliOptions } from './types';
|
|
10
|
+
|
|
11
|
+
// Mirrors SUPPORTED_HTTP_METHODS in @xyd-js/openapi (kept local to avoid a
|
|
12
|
+
// brittle value import across the dist boundary).
|
|
13
|
+
const DEFAULT_HTTP_METHODS: string[] = ['get', 'put', 'patch', 'post', 'delete'];
|
|
14
|
+
|
|
15
|
+
function buildInfo(doc: OpenAPIV3.Document, cliName: string, version: string): CliInfo {
|
|
16
|
+
const info: CliInfo = { title: cliName, version };
|
|
17
|
+
const src = doc.info;
|
|
18
|
+
if (src?.description) info.description = src.description;
|
|
19
|
+
if ((src as { summary?: string })?.summary) info.summary = (src as { summary?: string }).summary;
|
|
20
|
+
|
|
21
|
+
if (src?.contact) {
|
|
22
|
+
const contact: Contact = {};
|
|
23
|
+
if (src.contact.name) contact.name = src.contact.name;
|
|
24
|
+
if (src.contact.url) contact.url = src.contact.url;
|
|
25
|
+
if (src.contact.email) contact.email = src.contact.email;
|
|
26
|
+
if (Object.keys(contact).length) info.contact = contact;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (src?.license) {
|
|
30
|
+
const license: License = {};
|
|
31
|
+
if (src.license.name) license.name = src.license.name;
|
|
32
|
+
if ((src.license as { identifier?: string }).identifier)
|
|
33
|
+
license.identifier = (src.license as { identifier?: string }).identifier;
|
|
34
|
+
if (src.license.url) license.url = src.license.url;
|
|
35
|
+
if (Object.keys(license).length) info.license = license;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return info;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function buildXOpenApiRoot(doc: OpenAPIV3.Document, cliName: string, options: OpenApi2OpenCliOptions): XOpenApiRoot | undefined {
|
|
42
|
+
const servers = (doc.servers || []).map((s) => s.url).filter(Boolean);
|
|
43
|
+
const security = securitySchemesToXOpenApi(doc, cliName, options.authEnvVar);
|
|
44
|
+
|
|
45
|
+
const root: XOpenApiRoot = {};
|
|
46
|
+
if (servers.length) root.servers = servers;
|
|
47
|
+
if (security.length) root.security = security;
|
|
48
|
+
return Object.keys(root).length ? root : undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Convert a (dereferenced) OpenAPI 3.x document into an OpenCLI document,
|
|
53
|
+
* embedding the `x-openapi` request binding on the root and on every command.
|
|
54
|
+
*
|
|
55
|
+
* Pure and synchronous — pass an already-dereferenced document
|
|
56
|
+
* (see {@link openapi2opencliFromSource} for the file/URL convenience).
|
|
57
|
+
*/
|
|
58
|
+
export function openapi2opencli(doc: OpenAPIV3.Document, options: OpenApi2OpenCliOptions = {}): OpencliSpecJson {
|
|
59
|
+
const cliName = options.cliName ?? (slug(doc.info?.title || 'cli') || 'cli');
|
|
60
|
+
const version = options.version ?? doc.info?.version ?? '0.0.0';
|
|
61
|
+
const methods = (options.includeMethods ?? DEFAULT_HTTP_METHODS).map((m) => m.toLowerCase());
|
|
62
|
+
|
|
63
|
+
const spec: OpencliSpecJson = {
|
|
64
|
+
opencli: '1.0.0',
|
|
65
|
+
info: buildInfo(doc, cliName, version),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const xRoot = buildXOpenApiRoot(doc, cliName, options);
|
|
69
|
+
if (xRoot) spec['x-openapi'] = xRoot;
|
|
70
|
+
|
|
71
|
+
const tree = new CommandTree();
|
|
72
|
+
const paths = doc.paths || {};
|
|
73
|
+
|
|
74
|
+
for (const [path, pathItem] of Object.entries(paths)) {
|
|
75
|
+
if (!pathItem) continue;
|
|
76
|
+
if (options.includePaths && !options.includePaths.some((p) => path.startsWith(p))) continue;
|
|
77
|
+
|
|
78
|
+
const pathItemParams = ((pathItem as OpenAPIV3.PathItemObject).parameters || []) as OpenAPIV3.ParameterObject[];
|
|
79
|
+
|
|
80
|
+
for (const method of methods) {
|
|
81
|
+
const operation = (pathItem as Record<string, unknown>)[method] as OpenAPIV3.OperationObject | undefined;
|
|
82
|
+
if (!operation || typeof operation !== 'object') continue;
|
|
83
|
+
|
|
84
|
+
const { resourcePath, command } = buildLeafCommand(method, path, operation, pathItemParams, options);
|
|
85
|
+
tree.insert(resourcePath, command);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const commands = tree.emit();
|
|
90
|
+
if (commands.length) spec.commands = commands;
|
|
91
|
+
|
|
92
|
+
return spec;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Read + dereference an OpenAPI spec from a file path or URL (via @xyd-js/openapi)
|
|
97
|
+
* then convert it to an OpenCLI document.
|
|
98
|
+
*/
|
|
99
|
+
export async function openapi2opencliFromSource(
|
|
100
|
+
source: string,
|
|
101
|
+
options: OpenApi2OpenCliOptions = {},
|
|
102
|
+
): Promise<OpencliSpecJson> {
|
|
103
|
+
const doc = await deferencedOpenAPI(source);
|
|
104
|
+
if (!doc) throw new Error(`Failed to load OpenAPI spec from ${source}`);
|
|
105
|
+
return openapi2opencli(doc, options);
|
|
106
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type { Argument, Option, XOpenApiParam } from '@xyd-js/opencli';
|
|
3
|
+
|
|
4
|
+
import { camelCase, kebabCase } from './naming';
|
|
5
|
+
import { arrayItems, getEnum, isArray, isBoolean, isObjectSchema, scalarType, type Schema } from './schema';
|
|
6
|
+
import { uniqueName } from './unique';
|
|
7
|
+
import type { FlagCase, OpenApi2OpenCliOptions } from './types';
|
|
8
|
+
|
|
9
|
+
/** Header parameters handled by the security layer — never surfaced as flags. */
|
|
10
|
+
const AUTH_HEADERS = new Set(['authorization', 'x-api-key', 'api-key', 'openai-organization', 'openai-project']);
|
|
11
|
+
|
|
12
|
+
export interface ParamMapResult {
|
|
13
|
+
arguments: Argument[];
|
|
14
|
+
options: Option[];
|
|
15
|
+
xParams: XOpenApiParam[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function flagName(wire: string, flagCase: FlagCase | undefined): string {
|
|
19
|
+
return flagCase === 'camel' ? camelCase(wire) : kebabCase(wire);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** A human-friendly value-argument label for an option (`--limit <integer>`). */
|
|
23
|
+
function valueLabel(schema: Schema | undefined): string {
|
|
24
|
+
if (isArray(schema)) {
|
|
25
|
+
const item = arrayItems(schema);
|
|
26
|
+
return scalarType(item) || (isObjectSchema(item) ? 'json' : 'value');
|
|
27
|
+
}
|
|
28
|
+
return scalarType(schema) || (isObjectSchema(schema) ? 'json' : 'value');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Build the value Argument attached to a value-taking option. */
|
|
32
|
+
function valueArgument(schema: Schema | undefined): Argument {
|
|
33
|
+
const arg: Argument = { name: valueLabel(schema) };
|
|
34
|
+
const enumValues = getEnum(isArray(schema) ? arrayItems(schema) : schema);
|
|
35
|
+
if (enumValues) arg.acceptedValues = enumValues;
|
|
36
|
+
if (isArray(schema)) {
|
|
37
|
+
// unbounded variadic: minimum 0, no maximum
|
|
38
|
+
arg.arity = { minimum: 0 };
|
|
39
|
+
}
|
|
40
|
+
return arg;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Map an operation's parameters (path/query/header/cookie) to OpenCLI arguments
|
|
45
|
+
* and options, recording the HTTP binding in `xParams`.
|
|
46
|
+
*
|
|
47
|
+
* @param params merged path-item + operation parameters (already dereferenced)
|
|
48
|
+
* @param pathParamOrder wire names of path params in path order (positional ordering)
|
|
49
|
+
* @param usedFlagNames shared flag-name allocator (also used by the body mapper)
|
|
50
|
+
*/
|
|
51
|
+
export function mapParameters(
|
|
52
|
+
params: OpenAPIV3.ParameterObject[],
|
|
53
|
+
pathParamOrder: string[],
|
|
54
|
+
usedFlagNames: Set<string>,
|
|
55
|
+
options: OpenApi2OpenCliOptions,
|
|
56
|
+
): ParamMapResult {
|
|
57
|
+
const result: ParamMapResult = { arguments: [], options: [], xParams: [] };
|
|
58
|
+
const byName = new Map<string, OpenAPIV3.ParameterObject>();
|
|
59
|
+
for (const p of params) {
|
|
60
|
+
if (p && p.in === 'path') byName.set(p.name, p);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Path params → positional arguments, in path order.
|
|
64
|
+
for (const wire of pathParamOrder) {
|
|
65
|
+
const p = byName.get(wire);
|
|
66
|
+
const schema = p?.schema as Schema | undefined;
|
|
67
|
+
const argName = kebabCase(wire);
|
|
68
|
+
const arg: Argument = { name: argName, required: true };
|
|
69
|
+
if (p?.description) arg.description = p.description;
|
|
70
|
+
const enumValues = getEnum(schema);
|
|
71
|
+
if (enumValues) arg.acceptedValues = enumValues;
|
|
72
|
+
result.arguments.push(arg);
|
|
73
|
+
result.xParams.push({ in: 'path', name: wire, from: `argument:${argName}`, required: true });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Query / header / cookie params → options.
|
|
77
|
+
for (const p of params) {
|
|
78
|
+
if (!p || p.in === 'path') continue;
|
|
79
|
+
if (p.in === 'header' || p.in === 'cookie') {
|
|
80
|
+
if (!options.includeHeaders) continue;
|
|
81
|
+
if (AUTH_HEADERS.has(p.name.toLowerCase())) continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const schema = p.schema as Schema | undefined;
|
|
85
|
+
const name = uniqueName(flagName(p.name, options.flagCase), usedFlagNames);
|
|
86
|
+
|
|
87
|
+
const opt: Option = { name };
|
|
88
|
+
if (p.required) opt.required = true;
|
|
89
|
+
if (p.description) opt.description = p.description;
|
|
90
|
+
if (p.in !== 'query') opt.group = p.in; // 'query' is the default group; only annotate others
|
|
91
|
+
else opt.group = 'query';
|
|
92
|
+
if (p.in === 'header' || p.in === 'cookie') opt.hidden = true;
|
|
93
|
+
|
|
94
|
+
// boolean → flag with no value; everything else takes a value
|
|
95
|
+
if (!isBoolean(schema)) {
|
|
96
|
+
opt.arguments = [valueArgument(schema)];
|
|
97
|
+
}
|
|
98
|
+
result.options.push(opt);
|
|
99
|
+
|
|
100
|
+
const xParam: XOpenApiParam = { in: p.in, name: p.name, from: `option:${name}` };
|
|
101
|
+
if (p.required) xParam.required = true;
|
|
102
|
+
if (typeof (p as { explode?: boolean }).explode === 'boolean') xParam.explode = (p as { explode?: boolean }).explode;
|
|
103
|
+
if (typeof (p as { style?: string }).style === 'string') xParam.style = (p as { style?: string }).style;
|
|
104
|
+
result.xParams.push(xParam);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return result;
|
|
108
|
+
}
|