289dfc8230
Check Cross-Plugin Imports / check (push) Has been cancelled
ERSTES Modul ueber die Phase-Q-Plugin-Architektur: Registrierung komplett ueber das Plugin-Manifest (page_routes + menu_items) — routes/index.tsx und Sidebar.tsx wurden NICHT angefasst. Der Komponenten-Map-Generator wired den lazy import automatisch (38 Komponenten). Backend existierte vollstaendig (listings mit search/tags/pagination, listing-detail, install mit Ed25519-Signatur-Verify, verify, categories; marketplace:read/admin + require_admin fuer Install), Frontend hatte 0% Abdeckung. - api/marketplace.ts: TanStack-Hooks (useMarketplaceListings mit search/tags/pagination, useMarketplaceListing, useMarketplaceCategories, useInstallFromMarketplace, useVerifyMarketplacePlugin) - pages/Marketplace.tsx: Suche, Tag-Filter-Chips, Listing-Karten (Name, Version, Author, Beschreibung, Tags, Download-Counter, Verified-Badge, Preis/Kostenlos), Install mit Confirm (Admin-only via is_system_admin), Signatur-Verify, Ergebnis-Banner, Pagination — No-Access-Card ohne marketplace:read - Manifest: page_route /marketplace + menu_item (Store-Icon, order 85, permission marketplace:read) - i18n marketplace.* + nav.marketplace de/en Verifikation: Vitest 10/10 (Rendering, No-Access, Empty/Error, Karten, Search+Tags, Admin-Gating, Install-Flow mit+ohne Confirm, Verify-Flow) · tsc exit 0 · production build exit 0 · Backend-Regressionen (route-order, m5-miniapps) 10/10 · compileall sauber · Manifest-Check: page_route + menu_item korrekt.
73 lines
2.3 KiB
Python
73 lines
2.3 KiB
Python
"""Marketplace plugin — browse, search, verify, and install plugins from the marketplace."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
from app.plugins.base import BasePlugin
|
|
from app.plugins.manifest import FrontendMenuItem, FrontendPageRoute, PluginManifest, PluginRouteDef
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class MarketplacePlugin(BasePlugin):
|
|
"""Marketplace plugin for browsing, searching, verifying, and installing plugins."""
|
|
|
|
manifest = PluginManifest(
|
|
name="marketplace",
|
|
version="1.0.0",
|
|
display_name="Plugin Marketplace",
|
|
description="Browse, search, verify, and install plugins from the marketplace.",
|
|
dependencies=[],
|
|
routes=[
|
|
PluginRouteDef(
|
|
path="/api/v1/marketplace",
|
|
module="app.plugins.builtins.marketplace.routes",
|
|
router_attr="router",
|
|
),
|
|
],
|
|
events=[],
|
|
migrations=["0001_initial.sql"],
|
|
permissions=["marketplace:read", "marketplace:admin"],
|
|
# UI-Backlog Modul 5 (2026-09-13): marketplace browse/install page,
|
|
# registered via the manifest (Phase Q pattern).
|
|
menu_items=[
|
|
FrontendMenuItem(
|
|
label_key="nav.marketplace",
|
|
label="Marketplace",
|
|
path="/marketplace",
|
|
icon="Store",
|
|
order=85,
|
|
permission="marketplace:read",
|
|
),
|
|
],
|
|
page_routes=[
|
|
FrontendPageRoute(
|
|
path="/marketplace",
|
|
component="@/pages/Marketplace",
|
|
protected=True,
|
|
permission="marketplace:read",
|
|
),
|
|
],
|
|
settings_pages=[],
|
|
detail_tabs=[],
|
|
author="LeoCRM",
|
|
min_app_version="1.0.0",
|
|
hooks=[],
|
|
contract_version="1.0.0",
|
|
)
|
|
|
|
async def on_activate(
|
|
self, db, service_container, event_bus
|
|
) -> None:
|
|
"""Activate marketplace plugin."""
|
|
await super().on_activate(db, service_container, event_bus)
|
|
logger.info("Marketplace plugin activated")
|
|
|
|
async def on_deactivate(
|
|
self, db, service_container, event_bus
|
|
) -> None:
|
|
"""Deactivate marketplace plugin."""
|
|
await super().on_deactivate(db, service_container, event_bus)
|
|
logger.info("Marketplace plugin deactivated")
|