fix files description in api

This commit is contained in:
bymyself 2025-06-17 10:36:52 -07:00
parent 65f0764338
commit 32e003965a
2 changed files with 77 additions and 52 deletions

View File

@ -31,8 +31,8 @@ from .generated_models import (
ComfyUIVersionInfo, ComfyUIVersionInfo,
# Other models # Other models
Kind, OperationType,
StatusStr, OperationResult,
ManagerPackInfo, ManagerPackInfo,
ManagerPackInstalled, ManagerPackInstalled,
SelectedVersion, SelectedVersion,
@ -59,8 +59,6 @@ from .generated_models import (
HistoryResponse, HistoryResponse,
HistoryListResponse, HistoryListResponse,
InstallType, InstallType,
OperationType,
Result,
) )
__all__ = [ __all__ = [
@ -86,8 +84,8 @@ __all__ = [
"ComfyUIVersionInfo", "ComfyUIVersionInfo",
# Other models # Other models
"Kind", "OperationType",
"StatusStr", "OperationResult",
"ManagerPackInfo", "ManagerPackInfo",
"ManagerPackInstalled", "ManagerPackInstalled",
"SelectedVersion", "SelectedVersion",
@ -114,6 +112,4 @@ __all__ = [
"HistoryResponse", "HistoryResponse",
"HistoryListResponse", "HistoryListResponse",
"InstallType", "InstallType",
"OperationType",
"Result",
] ]

View File

@ -1,6 +1,6 @@
# generated by datamodel-codegen: # generated by datamodel-codegen:
# filename: openapi.yaml # filename: openapi.yaml
# timestamp: 2025-06-14T01:44:21+00:00 # timestamp: 2025-06-17T17:32:47+00:00
from __future__ import annotations from __future__ import annotations
@ -8,10 +8,14 @@ from datetime import datetime
from enum import Enum from enum import Enum
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, Field, RootModel from pydantic import BaseModel, Field
class Kind(str, Enum): class OperationType(Enum):
"""
Type of operation or task being performed
"""
install = 'install' install = 'install'
uninstall = 'uninstall' uninstall = 'uninstall'
update = 'update' update = 'update'
@ -23,19 +27,29 @@ class Kind(str, Enum):
install_model = 'install-model' install_model = 'install-model'
class StatusStr(str, Enum): class OperationResult(Enum):
"""
Result status of an operation (failed/error and skipped/skip are aliases)
"""
success = 'success' success = 'success'
failed = 'failed'
skipped = 'skipped'
error = 'error' error = 'error'
skip = 'skip' skip = 'skip'
class TaskExecutionStatus(BaseModel): class TaskExecutionStatus(BaseModel):
status_str: StatusStr = Field(..., description='Overall task execution status') status_str: OperationResult
completed: bool = Field(..., description='Whether the task completed') completed: bool = Field(..., description='Whether the task completed')
messages: List[str] = Field(..., description='Additional status messages') messages: List[str] = Field(..., description='Additional status messages')
class ManagerMessageName(str, Enum): class ManagerMessageName(Enum):
"""
WebSocket message type constants for manager events
"""
cm_task_completed = 'cm-task-completed' cm_task_completed = 'cm-task-completed'
cm_task_started = 'cm-task-started' cm_task_started = 'cm-task-started'
cm_queue_status = 'cm-queue-status' cm_queue_status = 'cm-queue-status'
@ -65,12 +79,20 @@ class ManagerPackInstalled(BaseModel):
enabled: bool = Field(..., description='Whether the pack is enabled') enabled: bool = Field(..., description='Whether the pack is enabled')
class SelectedVersion(str, Enum): class SelectedVersion(Enum):
"""
Version selection for pack installation
"""
latest = 'latest' latest = 'latest'
nightly = 'nightly' nightly = 'nightly'
class ManagerChannel(str, Enum): class ManagerChannel(Enum):
"""
Channel for pack sources
"""
default = 'default' default = 'default'
recent = 'recent' recent = 'recent'
legacy = 'legacy' legacy = 'legacy'
@ -79,13 +101,21 @@ class ManagerChannel(str, Enum):
tutorial = 'tutorial' tutorial = 'tutorial'
class ManagerDatabaseSource(str, Enum): class ManagerDatabaseSource(Enum):
"""
Source for pack information
"""
remote = 'remote' remote = 'remote'
local = 'local' local = 'local'
cache = 'cache' cache = 'cache'
class ManagerPackState(str, Enum): class ManagerPackState(Enum):
"""
Current state of a pack
"""
installed = 'installed' installed = 'installed'
disabled = 'disabled' disabled = 'disabled'
not_installed = 'not_installed' not_installed = 'not_installed'
@ -93,13 +123,21 @@ class ManagerPackState(str, Enum):
needs_update = 'needs_update' needs_update = 'needs_update'
class ManagerPackInstallType(str, Enum): class ManagerPackInstallType(Enum):
"""
Type of installation used for the pack
"""
git_clone = 'git-clone' git_clone = 'git-clone'
copy = 'copy' copy = 'copy'
cnr = 'cnr' cnr = 'cnr'
class UpdateState(Enum): class UpdateState(Enum):
"""
Update availability status
"""
false = 'false' false = 'false'
true = 'true' true = 'true'
@ -108,7 +146,10 @@ class ManagerPack(ManagerPackInfo):
author: Optional[str] = Field( author: Optional[str] = Field(
None, description="Pack author name or 'Unclaimed' if added via GitHub crawl" None, description="Pack author name or 'Unclaimed' if added via GitHub crawl"
) )
files: Optional[List[str]] = Field(None, description='Files included in the pack') files: Optional[List[str]] = Field(
None,
description='Repository URLs for installation (typically contains one GitHub URL)',
)
reference: Optional[str] = Field( reference: Optional[str] = Field(
None, description='The type of installation reference' None, description='The type of installation reference'
) )
@ -210,10 +251,8 @@ class ManagerMappings1(BaseModel):
title_aux: Optional[str] = Field(None, description='The display name of the pack') title_aux: Optional[str] = Field(None, description='The display name of the pack')
class ManagerMappings( class ManagerMappings(BaseModel):
RootModel[Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]]] __root__: Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]] = Field(
):
root: Optional[Dict[str, List[Union[List[str], ManagerMappings1]]]] = Field(
None, description='Tuple of [node_names, metadata]' None, description='Tuple of [node_names, metadata]'
) )
@ -228,7 +267,11 @@ class ModelMetadata(BaseModel):
ui_id: Optional[str] = Field(None, description='ID for UI reference') ui_id: Optional[str] = Field(None, description='ID for UI reference')
class InstallType(str, Enum): class InstallType(Enum):
"""
Installation method
"""
git = 'git' git = 'git'
copy = 'copy' copy = 'copy'
pip = 'pip' pip = 'pip'
@ -251,16 +294,20 @@ class NodePackageMetadata(BaseModel):
mode: Optional[str] = Field(None, description='Source mode') mode: Optional[str] = Field(None, description='Source mode')
class SnapshotItem(RootModel[str]): class SnapshotItem(BaseModel):
root: str = Field(..., description='Name of the snapshot') __root__: str = Field(..., description='Name of the snapshot')
class Error(BaseModel): class Error(BaseModel):
error: str = Field(..., description='Error message') error: str = Field(..., description='Error message')
class InstalledPacksResponse(RootModel[Optional[Dict[str, ManagerPackInstalled]]]): class InstalledPacksResponse(BaseModel):
root: Optional[Dict[str, ManagerPackInstalled]] = None """
Map of pack names to their installation info
"""
__root__: Optional[Dict[str, ManagerPackInstalled]] = None
class HistoryListResponse(BaseModel): class HistoryListResponse(BaseModel):
@ -307,32 +354,16 @@ class ComfyUIVersionInfo(BaseModel):
) )
class OperationType(str, Enum):
install = 'install'
update = 'update'
uninstall = 'uninstall'
fix = 'fix'
disable = 'disable'
enable = 'enable'
install_model = 'install-model'
class Result(str, Enum):
success = 'success'
failed = 'failed'
skipped = 'skipped'
class BatchOperation(BaseModel): class BatchOperation(BaseModel):
operation_id: str = Field(..., description='Unique operation identifier') operation_id: str = Field(..., description='Unique operation identifier')
operation_type: OperationType = Field(..., description='Type of operation') operation_type: OperationType
target: str = Field( target: str = Field(
..., description='Target of the operation (node name, model name, etc.)' ..., description='Target of the operation (node name, model name, etc.)'
) )
target_version: Optional[str] = Field( target_version: Optional[str] = Field(
None, description='Target version for the operation' None, description='Target version for the operation'
) )
result: Result = Field(..., description='Operation result') result: OperationResult
error_message: Optional[str] = Field( error_message: Optional[str] = Field(
None, description='Error message if operation failed' None, description='Error message if operation failed'
) )
@ -400,7 +431,7 @@ class BatchExecutionRecord(BaseModel):
class QueueTaskItem(BaseModel): class QueueTaskItem(BaseModel):
ui_id: str = Field(..., description='Unique identifier for the task') ui_id: str = Field(..., description='Unique identifier for the task')
client_id: str = Field(..., description='Client identifier that initiated the task') client_id: str = Field(..., description='Client identifier that initiated the task')
kind: Kind = Field(..., description='Type of task being performed') kind: OperationType
params: Union[ params: Union[
InstallPackParams, InstallPackParams,
UpdatePackParams, UpdatePackParams,
@ -462,10 +493,8 @@ class MessageTaskFailed(BaseModel):
state: TaskStateMessage state: TaskStateMessage
class MessageUpdate( class MessageUpdate(BaseModel):
RootModel[Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed]] __root__: Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed] = Field(
):
root: Union[MessageTaskDone, MessageTaskStarted, MessageTaskFailed] = Field(
..., description='Union type for all possible WebSocket message updates' ..., description='Union type for all possible WebSocket message updates'
) )