refactor(web): migrate plugin console contracts (#38252)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Stephen Zhou
2026-07-01 15:34:52 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent 6eb9928df7
commit 37bcb60c26
21 changed files with 798 additions and 177 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Literal
from pydantic import BaseModel, Field, computed_field, model_validator
@@ -32,7 +32,9 @@ class MarketplacePluginDeclaration(BaseModel):
latest_package_identifier: str = Field(
..., description="Unique identifier for the latest package release of the plugin"
)
status: str = Field(..., description="Indicate the status of marketplace plugin, enum from `active` `deleted`")
status: Literal["active", "deleted"] = Field(
..., description="Indicate the status of marketplace plugin, enum from `active` `deleted`"
)
deprecated_reason: str = Field(
..., description="Not empty when status='deleted', indicates the reason why this plugin is deleted(deprecated)"
)
+2 -2
View File
@@ -16,7 +16,7 @@ import logging
import time
from collections.abc import Mapping, Sequence
from mimetypes import guess_type
from typing import Any, ClassVar
from typing import Any, ClassVar, Literal
from pydantic import BaseModel, TypeAdapter, ValidationError
from redis import RedisError
@@ -75,7 +75,7 @@ class PluginService:
plugin_id: str
version: str
unique_identifier: str
status: str
status: Literal["active", "deleted"]
deprecated_reason: str
alternative_plugin_id: str