03dd477899
Check Cross-Plugin Imports / check (push) Has been cancelled
- Scope-Deklarationen: tasks only_mine, kommunikation conversation_ids, wiki category_ids (NEUE contracts.py), report_generator template_ids, automation agent_ids (module_key agents), tags tag_ids, unified_search entity_types dynamisch aus Provider-Registry - Core-Beiträge: navigation default_route (Startseite) + dashboard widget_app_ids (Widget-TYP-Angebot, Layout bleibt Phase M) - Backend-Filter (additive UND): /tasks (only_mine), /comm/conversations, /wiki/articles+/categories (Subtree), /reports/print-templates, /agents, /tags, /search GET+POST (entity_types-Schnitt), /miniapps?host=dashboard - apply_entity_type_scope-Helper (requested ∧ scope) - Frontend: WorkspaceSwitcher default_route-Navigation, Sidebar workspace-menu_order-Sortierung, workspaceStore moduleMenuOrder() - Tests: 18/18 Deklarationen + 11/11 Filter (TDD), Frontend 2/2 + Store 18/18, tsc clean, Build OK - Regression 64 passed (4 Kombi-Failures = Suite-Isolation, solo-bewiesen); Checker 0; Ruff = Vorbestand (Stash-bewiesen)
56 lines
1.6 KiB
Python
56 lines
1.6 KiB
Python
"""Wiki plugin contract — public interface for cross-plugin access (N4).
|
|
|
|
Created for the Phase N workspace_scopes contribution (the wiki previously
|
|
had no contract module — N4 needs one for the scope registry, mirroring the
|
|
contacts/dms/mail/calendar pattern from N1).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.plugins.builtins.contracts import get_contract_registry
|
|
|
|
|
|
class WikiContract:
|
|
"""Public contract for the wiki plugin."""
|
|
|
|
contract_name = "wiki"
|
|
|
|
# ─── Workspace Scopes contribution (Phase N4) ───
|
|
|
|
@staticmethod
|
|
def workspace_scopes() -> list[dict]:
|
|
"""Scope-Dimensionen des wiki-Moduls: Kategorien-Teilmengen (N4)."""
|
|
return [
|
|
{
|
|
"module_key": "wiki",
|
|
"dimensions": [
|
|
{
|
|
"key": "category_ids",
|
|
"label": "Wiki-Kategorien",
|
|
"control": "multiselect",
|
|
"options": [],
|
|
"value_source": {
|
|
"endpoint": "/api/v1/wiki/categories",
|
|
"items_path": "items",
|
|
"value_key": "id",
|
|
"label_key": "name",
|
|
},
|
|
},
|
|
],
|
|
}
|
|
]
|
|
|
|
@classmethod
|
|
def get_function(cls, name: str):
|
|
"""Return a callable exposed by this contract, or None if absent."""
|
|
return getattr(cls, name, None)
|
|
|
|
|
|
# ─── self-registration ───
|
|
|
|
_contract = WikiContract()
|
|
get_contract_registry().register("wiki", _contract)
|
|
|
|
|
|
__all__ = ["WikiContract"]
|