mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
Add comprehensive demo showing API changelog generation across two versions (v1.29.0 → v1.30.2): - Mock TypeScript definitions for both versions - Generated JSON snapshots showing structured API surface - Generated changelog with breaking changes, additions, and modifications - Detailed README explaining the system and benefits The demo showcases: ✨ Detection of breaking changes (queuePrompt → queuePromptAsync) ✨ Tracking of new additions (ExtensionMetadata interface, WorkflowId type) ✨ Identification of modifications (NodeDef enhancements, NodeStatus enum extensions) This demonstrates the automated system that will run on every release to document API changes for extension developers. Also exclude demo-snapshots directory from ESLint checking. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
1.8 KiB
TypeScript
93 lines
1.8 KiB
TypeScript
/**
|
|
* Mock TypeScript definitions representing v1.30.2 API surface
|
|
* This represents the public API with several breaking changes and additions
|
|
*/
|
|
|
|
export interface ComfyApi {
|
|
/**
|
|
* Get API URL for backend calls
|
|
*/
|
|
apiURL(path: string): string
|
|
|
|
/**
|
|
* Get file URL for static resources
|
|
*/
|
|
fileURL(path: string): string
|
|
|
|
/**
|
|
* Queue a prompt for execution (async version)
|
|
*/
|
|
queuePromptAsync(
|
|
prompt: object,
|
|
options?: { priority?: number }
|
|
): Promise<{ prompt_id: string; number: number }>
|
|
|
|
/**
|
|
* Cancel a queued prompt
|
|
*/
|
|
cancelPrompt(prompt_id: string): Promise<void>
|
|
|
|
/**
|
|
* Interrupt current execution
|
|
*/
|
|
interrupt(): Promise<void>
|
|
|
|
/**
|
|
* Get queue status
|
|
*/
|
|
getQueueStatus(): Promise<{ queue_running: any[]; queue_pending: any[] }>
|
|
}
|
|
|
|
export interface NodeDef {
|
|
name: string
|
|
category: string
|
|
display_name?: string
|
|
description?: string
|
|
python_module: string
|
|
input: {
|
|
required?: Record<string, any>
|
|
optional?: Record<string, any>
|
|
}
|
|
output: string[]
|
|
output_name: string[]
|
|
}
|
|
|
|
export enum NodeStatus {
|
|
IDLE = 'idle',
|
|
QUEUED = 'queued',
|
|
RUNNING = 'running',
|
|
ERROR = 'error',
|
|
COMPLETED = 'completed'
|
|
}
|
|
|
|
export interface WorkflowMetadata {
|
|
title?: string
|
|
description?: string
|
|
author?: string
|
|
version?: string
|
|
tags?: string[]
|
|
thumbnail?: string
|
|
}
|
|
|
|
export interface ExtensionMetadata {
|
|
id: string
|
|
name: string
|
|
version: string
|
|
description?: string
|
|
}
|
|
|
|
export class WorkflowManager {
|
|
workflows: Map<string, object>
|
|
cache: Map<string, object>
|
|
|
|
constructor()
|
|
|
|
loadWorkflow(id: string): Promise<object>
|
|
saveWorkflow(id: string, data: object): Promise<void>
|
|
deleteWorkflow(id: string): Promise<void>
|
|
searchWorkflows(query: string): Promise<object[]>
|
|
}
|
|
|
|
export type NodeId = string
|
|
export type WorkflowId = string
|