From d0c6a7fa6306c2be5b459e9c424294599065c1b3 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 26 Oct 2025 04:19:43 +0000 Subject: [PATCH] feat(api): add url field to services endpoint response --- unshackle/core/api/routes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/unshackle/core/api/routes.py b/unshackle/core/api/routes.py index 5445c87..36b458c 100644 --- a/unshackle/core/api/routes.py +++ b/unshackle/core/api/routes.py @@ -109,9 +109,14 @@ async def services(request: web.Request) -> web.Response: title_regex: type: string nullable: true + url: + type: string + nullable: true + description: Service URL from short_help help: type: string nullable: true + description: Full service documentation '500': description: Server error """ @@ -120,7 +125,7 @@ async def services(request: web.Request) -> web.Response: services_info = [] for tag in service_tags: - service_data = {"tag": tag, "aliases": [], "geofence": [], "title_regex": None, "help": None} + service_data = {"tag": tag, "aliases": [], "geofence": [], "title_regex": None, "url": None, "help": None} try: service_module = Services.load(tag) @@ -134,6 +139,9 @@ async def services(request: web.Request) -> web.Response: if hasattr(service_module, "TITLE_RE"): service_data["title_regex"] = service_module.TITLE_RE + if hasattr(service_module, "cli") and hasattr(service_module.cli, "short_help"): + service_data["url"] = service_module.cli.short_help + if service_module.__doc__: service_data["help"] = service_module.__doc__.strip()