mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-19 01:13:56 +00:00
feat: API Fixes and Adjustments (#23)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1273f9224b
commit
b18097e030
@@ -17,7 +17,7 @@ from sanic_ext import openapi
|
||||
|
||||
from api.backends.github import Github, GithubRepository
|
||||
from api.models.github import *
|
||||
from api.models.compat import ToolsResponseModel
|
||||
from api.models.compat import ToolsResponseModel, ContributorsResponseModel
|
||||
from config import compat_repositories, owner
|
||||
|
||||
github: Blueprint = Blueprint("old")
|
||||
@@ -59,3 +59,29 @@ async def tools(request: Request) -> JSONResponse:
|
||||
}
|
||||
|
||||
return json(data, status=200)
|
||||
|
||||
|
||||
@github.get("/contributors")
|
||||
@openapi.definition(
|
||||
summary="Get organization-wise contributors.", response=[ContributorsResponseModel]
|
||||
)
|
||||
async def contributors(request: Request) -> JSONResponse:
|
||||
"""
|
||||
Retrieve a list of releases for a Github repository.
|
||||
|
||||
**Returns:**
|
||||
- JSONResponse: A Sanic JSONResponse object containing the list of releases.
|
||||
|
||||
**Raises:**
|
||||
- HTTPException: If there is an error retrieving the releases.
|
||||
"""
|
||||
|
||||
data: dict[str, list] = {
|
||||
"repositories": await github_backend.compat_get_contributors(
|
||||
repositories=[
|
||||
GithubRepository(owner=owner, name=repo) for repo in compat_repositories
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
return json(data, status=200)
|
||||
|
||||
Reference in New Issue
Block a user