Initial upload: DevDash CLI with TUI dashboard
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-01 06:52:44 +00:00
parent 910620914c
commit 844eb117fb

32
src/api/base.py Normal file
View File

@@ -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