Skip to content

Commit fae58b2

Browse files
committed
feat: update plugin declaration for deprecation fields
1 parent 3cfba9e commit fae58b2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

api/core/plugin/entities/marketplace.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ class MarketplacePluginDeclaration(BaseModel):
3232
latest_package_identifier: str = Field(
3333
..., description="Unique identifier for the latest package release of the plugin"
3434
)
35+
status: str = Field(
36+
..., description="Indicate the status of marketplace plugin, enum from `active` `deleted`"
37+
)
38+
deprecated_reason: str = Field(
39+
..., description="Not empty when status='deleted', indicates the reason why this plugin is deleted(deprecated)"
40+
)
41+
alternative_plugin_id: str = Field(
42+
..., description="Optional, indicates the alternative plugin for user to switch to"
43+
)
44+
3545

3646
@model_validator(mode="before")
3747
@classmethod

api/services/plugin/plugin_service.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class LatestPluginCache(BaseModel):
3838
plugin_id: str
3939
version: str
4040
unique_identifier: str
41+
status: str
42+
deprecated_reason: str
43+
alternative_plugin_id: str
4144

4245
REDIS_KEY_PREFIX = "plugin_service:latest_plugin:"
4346
REDIS_TTL = 60 * 5 # 5 minutes
@@ -71,6 +74,9 @@ def fetch_latest_plugin_version(plugin_ids: Sequence[str]) -> Mapping[str, Optio
7174
plugin_id=plugin_id,
7275
version=manifest.latest_version,
7376
unique_identifier=manifest.latest_package_identifier,
77+
status=manifest.status,
78+
deprecated_reason=manifest.deprecated_reason,
79+
alternative_plugin_id=manifest.alternative_plugin_id,
7480
)
7581

7682
# Store in Redis

0 commit comments

Comments
 (0)