gateway/modules/serviceCenter/registry.py
2026-03-06 14:03:18 +01:00

108 lines
4.2 KiB
Python

# Copyright (c) 2025 Patrick Motsch
# All rights reserved.
"""
Service Center Registry.
Service definitions, dependency graph, and RBAC object keys.
"""
from typing import Dict, List, Any
# Core services: internal building blocks, no RBAC, never requested by features
CORE_SERVICES: Dict[str, Dict[str, Any]] = {
"utils": {
"module": "modules.serviceCenter.core.serviceUtils.mainServiceUtils",
"class": "UtilsService",
"dependencies": [],
},
"security": {
"module": "modules.serviceCenter.core.serviceSecurity.mainServiceSecurity",
"class": "SecurityService",
"dependencies": [],
},
"streaming": {
"module": "modules.serviceCenter.core.serviceStreaming.mainServiceStreaming",
"class": "StreamingService",
"dependencies": [],
},
}
# Importable services: feature-facing, RBAC-protected
IMPORTABLE_SERVICES: Dict[str, Dict[str, Any]] = {
"ticket": {
"module": "modules.serviceCenter.services.serviceTicket.mainServiceTicket",
"class": "TicketService",
"dependencies": [],
"objectKey": "service.ticket",
"label": {"en": "Ticket System", "de": "Ticket-System", "fr": "Système de tickets"},
},
"messaging": {
"module": "modules.serviceCenter.services.serviceMessaging.mainServiceMessaging",
"class": "MessagingService",
"dependencies": [],
"objectKey": "service.messaging",
"label": {"en": "Messaging", "de": "Nachrichten", "fr": "Messagerie"},
},
"billing": {
"module": "modules.serviceCenter.services.serviceBilling.mainServiceBilling",
"class": "BillingService",
"dependencies": [],
"objectKey": "service.billing",
"label": {"en": "Billing", "de": "Abrechnung", "fr": "Facturation"},
},
"sharepoint": {
"module": "modules.serviceCenter.services.serviceSharepoint.mainServiceSharepoint",
"class": "SharepointService",
"dependencies": ["security"],
"objectKey": "service.sharepoint",
"label": {"en": "SharePoint", "de": "SharePoint", "fr": "SharePoint"},
},
"chat": {
"module": "modules.serviceCenter.services.serviceChat.mainServiceChat",
"class": "ChatService",
"dependencies": ["utils"],
"objectKey": "service.chat",
"label": {"en": "Chat", "de": "Chat", "fr": "Chat"},
},
"extraction": {
"module": "modules.serviceCenter.services.serviceExtraction.mainServiceExtraction",
"class": "ExtractionService",
"dependencies": ["chat", "utils"],
"objectKey": "service.extraction",
"label": {"en": "Extraction", "de": "Extraktion", "fr": "Extraction"},
},
"generation": {
"module": "modules.serviceCenter.services.serviceGeneration.mainServiceGeneration",
"class": "GenerationService",
"dependencies": ["utils", "chat"],
"objectKey": "service.generation",
"label": {"en": "Generation", "de": "Generierung", "fr": "Génération"},
},
"ai": {
"module": "modules.serviceCenter.services.serviceAi.mainServiceAi",
"class": "AiService",
"dependencies": ["chat", "utils", "extraction", "billing"],
"objectKey": "service.ai",
"label": {"en": "AI", "de": "KI", "fr": "IA"},
},
"web": {
"module": "modules.serviceCenter.services.serviceWeb.mainServiceWeb",
"class": "WebService",
"dependencies": ["ai", "chat", "utils"],
"objectKey": "service.web",
"label": {"en": "Web Research", "de": "Web-Recherche", "fr": "Recherche Web"},
},
"neutralization": {
"module": "modules.serviceCenter.services.serviceNeutralization.mainServiceNeutralization",
"class": "NeutralizationService",
"dependencies": ["extraction", "generation"],
"objectKey": "service.neutralization",
"label": {"en": "Neutralization", "de": "Neutralisierung", "fr": "Neutralisation"},
},
}
# RBAC objects for service-level access control (for catalog registration)
SERVICE_RBAC_OBJECTS: List[Dict[str, Any]] = [
{"objectKey": s["objectKey"], "label": s["label"]}
for s in IMPORTABLE_SERVICES.values()
if "objectKey" in s
]