Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Route volume-api generation through redocly filtering (#1731)

devin-ai-integration[bot]29794d0d56dd
diff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.json
index f1199c3af..b329e95c2 100644
--- a/packages/js-sdk/package.json
+++ b/packages/js-sdk/package.json
@@ -32,7 +32,7 @@
"generate:api": "redocly bundle js-sdk --config ../../redocly.yaml -o ../../spec/openapi_generated.js-sdk.yml && openapi-typescript ../../spec/openapi_generated.js-sdk.yml -x api_key --array-length --alphabetize --default-non-nullable false --output src/api/schema.gen.ts",
"generate:envd": "cd ../../spec/envd && buf generate --template buf-js.gen.yaml\n",
"generate:envd-api": "redocly bundle envd --config ../../redocly.yaml -o ../../spec/openapi_generated.envd.yml && openapi-typescript ../../spec/openapi_generated.envd.yml -x api_key --array-length --alphabetize --output src/envd/schema.gen.ts",
- "generate:volume-api": "openapi-typescript ../../spec/openapi-volumecontent.yml -x api_key --array-length --alphabetize --output src/volume/schema.gen.ts",
+ "generate:volume-api": "redocly bundle volume --config ../../redocly.yaml -o ../../spec/openapi_generated.volume.yml && openapi-typescript ../../spec/openapi_generated.volume.yml -x api_key --array-length --alphabetize --output src/volume/schema.gen.ts",
"generate:mcp": "json2ts -i ./../../spec/mcp-server.json -o src/sandbox/mcp.d.ts --unreachableDefinitions --style.singleQuote --no-style.semi",
"check-deps": "knip",
"playwright:install": "playwright install chromium",
diff --git a/packages/js-sdk/src/volume/schema.gen.ts b/packages/js-sdk/src/volume/schema.gen.ts
index 6ebbd78c3..e71245eb9 100644
--- a/packages/js-sdk/src/volume/schema.gen.ts
+++ b/packages/js-sdk/src/volume/schema.gen.ts
@@ -347,33 +347,6 @@ export interface components {
};
};
responses: {
- /** @description Bad request */
- 400: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
- /** @description Authentication error */
- 401: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
- /** @description Forbidden */
- 403: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
/** @description Not found */
404: {
headers: {
@@ -383,15 +356,6 @@ export interface components {
"application/json": components["schemas"]["Error"];
};
};
- /** @description Conflict */
- 409: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": components["schemas"]["Error"];
- };
- };
/** @description Server error */
500: {
headers: {
diff --git a/packages/python-sdk/Makefile b/packages/python-sdk/Makefile
index d25138bad..3ea7978e7 100644
--- a/packages/python-sdk/Makefile
+++ b/packages/python-sdk/Makefile
@@ -9,7 +9,8 @@ generate-api:
ruff format .
generate-volume-api:
- openapi-python-client generate --output-path $(ROOT_DIR)/packages/python-sdk/e2b/volume/api --overwrite --path $(ROOT_DIR)/spec/openapi-volumecontent.yml
+ redocly bundle volume --config $(ROOT_DIR)/redocly.yaml -o $(ROOT_DIR)/spec/openapi_generated.volume.yml
+ openapi-python-client generate --output-path $(ROOT_DIR)/packages/python-sdk/e2b/volume/api --overwrite --path $(ROOT_DIR)/spec/openapi_generated.volume.yml
rm -rf e2b/volume/client
mv e2b/volume/api/e2b_api_client e2b/volume/client
rm -rf e2b/volume/api
diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.toml
index 4267bd7e4..55ee1f86e 100644
--- a/packages/python-sdk/pyproject.toml
+++ b/packages/python-sdk/pyproject.toml
@@ -42,9 +42,9 @@ dev = [
# Tools for local code generation (`make init` && `uv run make generate-*`).
# Pins mirror codegen.Dockerfile so local output matches CI. `generate-api`
-# additionally needs @redocly/cli on the PATH (pinned as a js-sdk
-# devDependency and in codegen.Dockerfile — keep the versions in sync) and
-# `generate-envd` needs `buf`.
+# and `generate-volume-api` additionally need @redocly/cli on the PATH
+# (pinned as a js-sdk devDependency and in codegen.Dockerfile — keep the
+# versions in sync) and `generate-envd` needs `buf`.
codegen = [
"black==26.3.1",
"e2b-openapi-python-client==0.26.2",
diff --git a/redocly.yaml b/redocly.yaml
index b34a690e6..480d3ad5f 100644
--- a/redocly.yaml
+++ b/redocly.yaml
@@ -11,10 +11,11 @@
# still references a dropped schema loses that media-type entry rather
# than keeping a dangling $ref.
#
-# The envd api filters the synced envd spec (spec/envd/envd.yaml) the same
-# way: operations the upstream spec marks `x-internal: true` belong to the
+# The envd and volume apis filter the synced envd and volume-content specs
+# (spec/envd/envd.yaml, spec/openapi-volumecontent.yml) the same way:
+# operations the upstream specs mark `x-internal: true` belong to the
# orchestrator's control plane, not to SDKs, so they are dropped before the
-# js-sdk envd schema is generated. remove-unused-components then drops the
+# SDK schemas are generated. remove-unused-components then drops the
# component schemas only those operations referenced.
apis:
js-sdk:
@@ -46,3 +47,10 @@ apis:
property: x-internal
value: [true]
remove-unused-components: on
+ volume:
+ root: spec/openapi-volumecontent.yml
+ decorators:
+ filter-out:
+ property: x-internal
+ value: [true]
+ remove-unused-components: on