feat: add minimum dify version requirement to plugins (#18022)

This commit is contained in:
Yeuoly
2025-04-14 20:09:22 +08:00
committed by GitHub
parent 9f8947f1dd
commit 2134a76517
11 changed files with 111 additions and 4 deletions

View File

@@ -309,6 +309,22 @@ class PluginService:
],
)
@staticmethod
def fetch_marketplace_pkg(
tenant_id: str, plugin_unique_identifier: str, verify_signature: bool = False
) -> PluginDeclaration:
"""
Fetch marketplace package
"""
manager = PluginInstallationManager()
try:
declaration = manager.fetch_plugin_manifest(tenant_id, plugin_unique_identifier)
except Exception:
pkg = download_plugin_pkg(plugin_unique_identifier)
declaration = manager.upload_pkg(tenant_id, pkg, verify_signature).manifest
return declaration
@staticmethod
def install_from_marketplace_pkg(
tenant_id: str, plugin_unique_identifiers: Sequence[str], verify_signature: bool = False