mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-20 01:43:57 +00:00
feat: add member gpg keys
This commit is contained in:
@@ -102,13 +102,14 @@ class Contributor(dict):
|
||||
html_url: str,
|
||||
contributions: Optional[int] = None,
|
||||
bio: Optional[str] = None,
|
||||
keys: Optional[str] = None,
|
||||
):
|
||||
match contributions, bio:
|
||||
case None, None:
|
||||
match contributions, bio, keys:
|
||||
case None, None, None:
|
||||
dict.__init__(
|
||||
self, login=login, avatar_url=avatar_url, html_url=html_url, bio=bio
|
||||
self, login=login, avatar_url=avatar_url, html_url=html_url, bio=bio, keys=keys
|
||||
)
|
||||
case int(_), None:
|
||||
case int(_), None, None:
|
||||
dict.__init__(
|
||||
self,
|
||||
login=login,
|
||||
@@ -116,7 +117,7 @@ class Contributor(dict):
|
||||
html_url=html_url,
|
||||
contributions=contributions,
|
||||
)
|
||||
case None, str(_):
|
||||
case None, str(_), None:
|
||||
dict.__init__(
|
||||
self,
|
||||
login=login,
|
||||
@@ -124,7 +125,7 @@ class Contributor(dict):
|
||||
html_url=html_url,
|
||||
bio=bio,
|
||||
)
|
||||
case int(_), str(_):
|
||||
case int(_), str(_), str(_):
|
||||
dict.__init__(
|
||||
self,
|
||||
login=login,
|
||||
@@ -132,6 +133,16 @@ class Contributor(dict):
|
||||
html_url=html_url,
|
||||
contributions=contributions,
|
||||
bio=bio,
|
||||
keys=keys,
|
||||
)
|
||||
case None, str(_), str(_):
|
||||
dict.__init__(
|
||||
self,
|
||||
login=login,
|
||||
avatar_url=avatar_url,
|
||||
html_url=html_url,
|
||||
bio=bio,
|
||||
keys=keys,
|
||||
)
|
||||
case _:
|
||||
raise ValueError("Invalid arguments")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import asyncio
|
||||
import os
|
||||
from operator import eq
|
||||
from typing import Optional
|
||||
from typing import Any, Optional
|
||||
|
||||
import ujson
|
||||
from aiohttp import ClientResponse
|
||||
@@ -107,6 +107,11 @@ class Github(Backend):
|
||||
contributor,
|
||||
)
|
||||
|
||||
if team_view:
|
||||
filter_contributor[
|
||||
"keys"
|
||||
] = f"{base_url.replace('api.', '')}/{filter_contributor['login']}.gpg"
|
||||
|
||||
return Contributor(**filter_contributor)
|
||||
|
||||
@staticmethod
|
||||
@@ -372,7 +377,7 @@ class Github(Backend):
|
||||
list[dict[str, str]]: A JSON object containing the contributors.
|
||||
"""
|
||||
|
||||
def transform(data: dict, repository: GithubRepository) -> list:
|
||||
def transform(data: dict, repository: GithubRepository) -> dict[str, Any]:
|
||||
"""Transforms a dictionary from the input list into a list of dictionaries with the desired structure.
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user