Skip to content

Commit

Permalink
Generate only relevant api routes for the client in SDKs (#542)
Browse files Browse the repository at this point in the history
# Description

No need to generate to generate for endpoints not relevant to the SDKs
(e.g. admin endpoints)
  • Loading branch information
jakubno authored Jan 17, 2025
2 parents 238887b + 594bb17 commit fae8d02
Show file tree
Hide file tree
Showing 29 changed files with 662 additions and 1,297 deletions.
2 changes: 1 addition & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dev": "tsup --watch",
"example": "tsx example.mts",
"test": "vitest run",
"generate": "openapi-typescript ../../spec/openapi.yml -x api_key --support-array-length --alphabetize --output src/api/schema.gen.ts",
"generate": "python ./../../spec/remove_extra_tags.py sandboxes templates && openapi-typescript ../../spec/openapi_generated.yml -x api_key --support-array-length --alphabetize --output src/api/schema.gen.ts",
"generate-envd-api": "openapi-typescript ../../spec/envd/envd.yaml -x api_key --support-array-length --alphabetize --output src/envd/schema.gen.ts",
"generate-ref": "./scripts/generate_sdk_ref.sh",
"check-deps": "knip",
Expand Down
151 changes: 124 additions & 27 deletions packages/js-sdk/src/api/schema.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/python-sdk/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
generate-api:
openapi-python-client generate --output-path e2b/api/api --overwrite --path ../../spec/openapi.yml
python ./../../spec/remove_extra_tags.py sandboxes
openapi-python-client generate --output-path e2b/api/api --overwrite --path ../../spec/openapi_generated.yml
rm -rf e2b/api/client
mv e2b/api/api/e2b_api_client e2b/api/client
rm -rf e2b/api/api

init:
pip install openapi-python-client
pip install openapi-python-client
Empty file.
137 changes: 0 additions & 137 deletions packages/python-sdk/e2b/api/client/api/auth/get_teams.py

This file was deleted.

Empty file.
Loading

0 comments on commit fae8d02

Please sign in to comment.