Skip to content

Commit fcb3731

Browse files
committed
Add Sandbox API reference and automated spec sync
- Add Sandbox API OpenAPI spec with filesystem and process endpoints - Filter REST API spec to only include user-facing endpoints (ApiKeyAuth) - Remove admin/internal endpoints (Supabase-only, AccessToken-only) - Add sync script to fetch and transform specs from infra repo - Add GitHub Actions workflow for scheduled sync every 6 hours - Fix OpenAPI 3.0 compatibility issues in generated specs
1 parent 1277c7b commit fcb3731

7 files changed

Lines changed: 4675 additions & 1 deletion

File tree

.github/workflows/sync-openapi.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Sync OpenAPI Specs
2+
3+
on:
4+
# Run every 6 hours
5+
schedule:
6+
- cron: '0 */6 * * *'
7+
# Allow manual trigger
8+
workflow_dispatch:
9+
# Re-run if sync script changes
10+
push:
11+
branches: [main]
12+
paths:
13+
- 'scripts/sync-openapi.js'
14+
15+
jobs:
16+
sync:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
30+
- name: Install dependencies
31+
run: npm install
32+
33+
- name: Setup buf (for proto generation)
34+
uses: bufbuild/buf-setup-action@v1
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Install protoc-gen-connect-openapi
39+
run: |
40+
go install github.com/sudorandom/protoc-gen-connect-openapi@latest
41+
echo "$HOME/go/bin" >> $GITHUB_PATH
42+
43+
- name: Sync OpenAPI specs
44+
run: node scripts/sync-openapi.js
45+
46+
- name: Validate specs
47+
run: |
48+
npx mintlify openapi-check openapi-public.yml
49+
npx mintlify openapi-check openapi-sandbox.yml
50+
51+
- name: Commit and push changes
52+
run: |
53+
git config user.name "github-actions[bot]"
54+
git config user.email "github-actions[bot]@users.noreply.github.com"
55+
git add openapi-public.yml openapi-sandbox.yml
56+
if git diff --staged --quiet; then
57+
echo "No changes to commit"
58+
else
59+
git commit -m "chore: sync OpenAPI specs from infra"
60+
git push
61+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
22
.DS_Store
3+
node_modules/
4+
package-lock.json

docs.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,17 @@
217217
"anchor": "REST API",
218218
"icon": "code",
219219
"openapi": {
220-
"source": "https://raw.githubusercontent.com/e2b-dev/infra/main/spec/openapi.yml",
220+
"source": "openapi-public.yml",
221221
"directory": "docs/api-reference"
222222
}
223+
},
224+
{
225+
"anchor": "Sandbox API",
226+
"icon": "server",
227+
"openapi": {
228+
"source": "openapi-sandbox.yml",
229+
"directory": "docs/sandbox-api"
230+
}
223231
}
224232
],
225233
"global": {}

0 commit comments

Comments
 (0)