mirror of
https://github.com/jmagar/unraid-mcp
synced 2026-04-21 13:37:53 +00:00
fix(ci): ruff format _docker.py and test_generate_unraid_api_reference.py
This commit is contained in:
parent
09232adad5
commit
c2d7f05e5d
2 changed files with 34 additions and 7 deletions
|
|
@ -3,7 +3,9 @@ from __future__ import annotations
|
|||
from scripts.generate_unraid_api_reference import _build_changes_markdown
|
||||
|
||||
|
||||
def _type_ref(name: str | None = None, *, kind: str = "OBJECT", of_type: dict | None = None) -> dict:
|
||||
def _type_ref(
|
||||
name: str | None = None, *, kind: str = "OBJECT", of_type: dict | None = None
|
||||
) -> dict:
|
||||
return {"kind": kind, "name": name, "ofType": of_type}
|
||||
|
||||
|
||||
|
|
@ -41,9 +43,36 @@ def _schema(
|
|||
extra_types: list[dict] | None = None,
|
||||
) -> dict:
|
||||
types = [
|
||||
{"kind": "OBJECT", "name": "Query", "description": None, "fields": query_fields, "inputFields": None, "interfaces": [], "enumValues": None, "possibleTypes": None},
|
||||
{"kind": "OBJECT", "name": "Mutation", "description": None, "fields": mutation_fields or [], "inputFields": None, "interfaces": [], "enumValues": None, "possibleTypes": None},
|
||||
{"kind": "OBJECT", "name": "Subscription", "description": None, "fields": subscription_fields or [], "inputFields": None, "interfaces": [], "enumValues": None, "possibleTypes": None},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Query",
|
||||
"description": None,
|
||||
"fields": query_fields,
|
||||
"inputFields": None,
|
||||
"interfaces": [],
|
||||
"enumValues": None,
|
||||
"possibleTypes": None,
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Mutation",
|
||||
"description": None,
|
||||
"fields": mutation_fields or [],
|
||||
"inputFields": None,
|
||||
"interfaces": [],
|
||||
"enumValues": None,
|
||||
"possibleTypes": None,
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Subscription",
|
||||
"description": None,
|
||||
"fields": subscription_fields or [],
|
||||
"inputFields": None,
|
||||
"interfaces": [],
|
||||
"enumValues": None,
|
||||
"possibleTypes": None,
|
||||
},
|
||||
]
|
||||
if extra_types:
|
||||
types.extend(extra_types)
|
||||
|
|
|
|||
|
|
@ -24,9 +24,7 @@ _DOCKER_QUERIES: dict[str, str] = {
|
|||
}
|
||||
|
||||
# Internal query used only for container ID resolution — not a public subaction.
|
||||
_DOCKER_RESOLVE_QUERY = (
|
||||
"query ResolveContainerID { docker { containers { id names } } }"
|
||||
)
|
||||
_DOCKER_RESOLVE_QUERY = "query ResolveContainerID { docker { containers { id names } } }"
|
||||
|
||||
_DOCKER_MUTATIONS: dict[str, str] = {
|
||||
"start": "mutation StartContainer($id: PrefixedID!) { docker { start(id: $id) { id names state status } } }",
|
||||
|
|
|
|||
Loading…
Reference in a new issue