-
Notifications
You must be signed in to change notification settings - Fork 523
feat: add Ingest API codegen with Zod schema generation #9932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+7,797
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c65a1ff
feat: add Ingest API codegen with @hey-api/openapi-ts and Zod
dante01yoon c8990c3
chore: configure knip to ignore generated ingest-types
dante01yoon 750c4a2
[automated] Apply ESLint and Oxfmt fixes
actions-user 2b0ada1
Merge branch 'main' into feat/ingest-api-codegen
dante01yoon 71f07f9
fix: use push model for Ingest API codegen CI
dante01yoon f107a42
chore: remove pull-based ingest codegen workflow
dante01yoon 33d3f09
fix: address PR review feedback for ingest-types
dante01yoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # OpenAPI spec is fetched from cloud repo during CI | ||
| openapi.yaml | ||
| # Crash logs | ||
| openapi-ts-error-*.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { defineConfig } from '@hey-api/openapi-ts' | ||
|
|
||
| export default defineConfig({ | ||
| input: './openapi.yaml', | ||
| output: { | ||
| path: './src', | ||
| clean: true | ||
| }, | ||
| parser: { | ||
| filters: { | ||
| operations: { | ||
| // Exclude endpoints that overlap with ComfyUI Python backend. | ||
| // These are shared between local and cloud, with separate Zod | ||
| // schemas already maintained in src/schemas/apiSchema.ts. | ||
dante01yoon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| exclude: [ | ||
| '/^GET \\/api\\/prompt$/', | ||
| '/^POST \\/api\\/prompt$/', | ||
| '/^GET \\/api\\/queue$/', | ||
| '/^POST \\/api\\/queue$/', | ||
| '/^GET \\/api\\/history$/', | ||
| '/^POST \\/api\\/history$/', | ||
| '/^GET \\/api\\/history_v2/', | ||
| '/^GET \\/api\\/object_info$/', | ||
| '/^GET \\/api\\/features$/', | ||
| '/^GET \\/api\\/settings$/', | ||
| '/^POST \\/api\\/settings$/', | ||
| '/^GET \\/api\\/system_stats$/', | ||
| '/^(GET|POST) \\/api\\/interrupt$/', | ||
| '/^POST \\/api\\/upload\\//', | ||
| '/^GET \\/api\\/view$/', | ||
| '/^GET \\/api\\/jobs/', | ||
| '/\\/api\\/userdata/', | ||
| // Webhooks are server-to-server, not called by frontend | ||
| '/\\/api\\/webhooks\\//', | ||
| // Internal analytics endpoint | ||
| '/\\/api\\/internal\\//' | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| plugins: [ | ||
| '@hey-api/typescript', | ||
| { | ||
| name: 'zod', | ||
| compatibilityVersion: 3, | ||
| definitions: true, | ||
| requests: true, | ||
| responses: true | ||
| } | ||
| ] | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "name": "@comfyorg/ingest-types", | ||
| "version": "1.0.0", | ||
| "description": "Comfy Cloud Ingest API TypeScript types and Zod schemas", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": "./src/index.ts", | ||
| "./zod": "./src/zod.gen.ts" | ||
| }, | ||
| "scripts": { | ||
| "generate": "openapi-ts && node -e \"const fs=require('fs'); ['src/zod.gen.ts'].forEach(f => fs.writeFileSync(f, fs.readFileSync(f,'utf8').replaceAll(\\\"from 'zod/v3'\\\", \\\"from 'zod'\\\")));\"" | ||
| }, | ||
| "dependencies": { | ||
| "zod": "catalog:" | ||
| }, | ||
| "devDependencies": { | ||
| "@hey-api/openapi-ts": "0.93.0" | ||
| }, | ||
| "packageManager": "pnpm@10.17.1", | ||
| "nx": { | ||
| "tags": [ | ||
| "scope:shared", | ||
| "type:types" | ||
| ] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.