From 844eb117fb60d2ab0213f4dd1cb6ed03b8d5f7db Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 1 Feb 2026 06:52:44 +0000 Subject: [PATCH] Initial upload: DevDash CLI with TUI dashboard --- src/api/base.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/api/base.py diff --git a/src/api/base.py b/src/api/base.py new file mode 100644 index 0000000..49d231f --- /dev/null +++ b/src/api/base.py @@ -0,0 +1,32 @@ +import httpx +from abc import ABC, abstractmethod +from typing import Any, Dict, List, Optional + + +class APIClient(ABC): + def __init__(self, base_url: str, token: str): + self.base_url = base_url + self.token = token + self.headers = { + "Authorization": f"Bearer {token}", + "Accept": "application/json", + } + + @abstractmethod + async def get_pull_requests(self, owner: str, repo: str) -> List[Dict[str, Any]]: + pass + + @abstractmethod + async def get_issues(self, owner: str, repo: str) -> List[Dict[str, Any]]: + pass + + @abstractmethod + async def get_workflows(self, owner: str, repo: str) -> List[Dict[str, Any]]: + pass + + async def _request( + self, client: httpx.AsyncClient, method: str, url: str, **kwargs + ) -> httpx.Response: + response = await client.request(method, url, **kwargs) + response.raise_for_status() + return response