Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ const config: KnipConfig = {
},
'packages/registry-types': {
project: ['src/**/*.{js,ts}']
},
'packages/ingest-types': {
project: ['src/**/*.{js,ts}'],
entry: ['src/index.ts']
}
},
ignoreBinaries: ['python3', 'gh'],
ignoreBinaries: ['python3', 'gh', 'generate'],
ignoreDependencies: [
// Weird importmap things
'@iconify-json/lucide',
Expand All @@ -41,9 +45,12 @@ const config: KnipConfig = {
'@iconify/utils'
],
ignore: [
// Auto generated manager types
// Auto generated API types
'src/workbench/extensions/manager/types/generatedManagerTypes.ts',
'packages/registry-types/src/comfyRegistryTypes.ts',
'packages/ingest-types/src/types.gen.ts',
'packages/ingest-types/src/zod.gen.ts',
'packages/ingest-types/openapi-ts.config.ts',
// Used by a custom node (that should move off of this)
'src/scripts/ui/components/splitButton.ts',
// Used by stacked PR (feat/glsl-live-preview)
Expand Down
4 changes: 4 additions & 0 deletions packages/ingest-types/.gitignore
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
51 changes: 51 additions & 0 deletions packages/ingest-types/openapi-ts.config.ts
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.
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
}
]
})
26 changes: 26 additions & 0 deletions packages/ingest-types/package.json
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').replace(\\\"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"
]
}
}
Loading
Loading