diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2355e2b..736e1f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,10 +29,6 @@ jobs: restore-keys: | ${{ runner.os }}-poetry- - - name: Update lock file - run: | - poetry lock - - name: Install dependencies run: | poetry install diff --git a/AniLinkPy/apis/anilist/anilist.py b/AniLinkPy/apis/anilist/anilist.py index c2c23cb..1df014e 100644 --- a/AniLinkPy/apis/anilist/anilist.py +++ b/AniLinkPy/apis/anilist/anilist.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.custom import CustomRequest from AniLinkPy.apis.anilist.mutation.mutation import Mutation @@ -27,7 +27,9 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.mutation = Mutation() self.custom_query = CustomRequest(auth_token) - def custom(self, query: str, variables: dict) -> dict: + def custom( + self, query: str, variables: Union[Dict[str, Union[str, int, bool]]] + ) -> dict: """ This method is used to send a custom Query or Mutation. diff --git a/AniLinkPy/apis/anilist/custom.py b/AniLinkPy/apis/anilist/custom.py index a73b251..033b907 100644 --- a/AniLinkPy/apis/anilist/custom.py +++ b/AniLinkPy/apis/anilist/custom.py @@ -1,4 +1,4 @@ -from typing import Optional, Union +from typing import Dict, Optional, Union from AniLinkPy.base.RequestHandler import send_request @@ -22,7 +22,11 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def custom(self, query: str, variables: Optional[dict] = None) -> dict: + def custom( + self, + query: str, + variables: Optional[Union[Dict[str, Union[str, int, bool]]]] = None, + ) -> dict: """ This method is used to send a custom Query. diff --git a/AniLinkPy/apis/anilist/query/media.py b/AniLinkPy/apis/anilist/query/media.py index f22ee49..0e349e7 100644 --- a/AniLinkPy/apis/anilist/query/media.py +++ b/AniLinkPy/apis/anilist/query/media.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.schemas.query.media_with_relations_schema import ( MEDIAWITHRELATIONSSCHEMA, @@ -25,7 +25,7 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def media(self, variables: dict) -> dict: + def media(self, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict: """ This method is used to send a media Query. diff --git a/AniLinkPy/apis/anilist/query/page/activities.py b/AniLinkPy/apis/anilist/query/page/activities.py index 9cb7e8c..0218f08 100644 --- a/AniLinkPy/apis/anilist/query/page/activities.py +++ b/AniLinkPy/apis/anilist/query/page/activities.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.schemas.activity_schema import ACTIVITYWITHREPLIESSCHEMA from AniLinkPy.base.RequestHandler import send_request @@ -23,7 +23,7 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def activities(self, variables: dict) -> dict: + def activities(self, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict: """ This method is used to send an activities Query. @@ -40,7 +40,7 @@ def activities(self, variables: dict) -> dict: query = f""" query ($page: Int, $perPage: Int, $id: Int, $userId: Int, $messengerId: Int, $mediaId: Int, $type: ActivityType, $isFollowing: Boolean, $hasReplies: Boolean, $hasRepliesOrTypeText: Boolean, $createdAt: - Int, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $userId_not: Int, $userId_in: [Int], $userId_not_in: + Int, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $userId_not: Int, $userId_in: [Int], $userId_not_in: [ Int], $messengerId_not: Int, $messengerId_in: [Int], $messengerId_not_in: [Int], $mediaId_not: Int, $mediaId_in: [Int], $mediaId_not_in: [Int], $type_not: ActivityType, $type_in: [ActivityType], $type_not_in: [ActivityType], $createdAt_greater: Int, $sort: [ActivitySort], $asHtml: Boolean) {{ Page (page: $page, diff --git a/AniLinkPy/apis/anilist/query/page/activity_replies.py b/AniLinkPy/apis/anilist/query/page/activity_replies.py index 8c083bc..63b0dfa 100644 --- a/AniLinkPy/apis/anilist/query/page/activity_replies.py +++ b/AniLinkPy/apis/anilist/query/page/activity_replies.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.schemas.activity_schema import ACTIVITYREPLYSCHEMA from AniLinkPy.base.RequestHandler import send_request @@ -23,7 +23,9 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def activityReplies(self, variables: dict) -> dict: + def activityReplies( + self, variables: Union[Dict[str, Union[str, int, bool]]] + ) -> dict: """ This method is used to send an ActivityReplies Query. diff --git a/AniLinkPy/apis/anilist/query/page/airing_schedules.py b/AniLinkPy/apis/anilist/query/page/airing_schedules.py index f42cb2c..3eec592 100644 --- a/AniLinkPy/apis/anilist/query/page/airing_schedules.py +++ b/AniLinkPy/apis/anilist/query/page/airing_schedules.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.schemas.query.airing_schedule_schema import ( AIRINGSCHEDULESCHEMA, @@ -25,7 +25,9 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def airingSchedules(self, variables: dict) -> dict: + def airingSchedules( + self, variables: Union[Dict[str, Union[str, int, bool]]] + ) -> dict: """ This method is used to send an airingSchedules Query. diff --git a/AniLinkPy/apis/anilist/query/page/page.py b/AniLinkPy/apis/anilist/query/page/page.py index 18d0b71..38b84f4 100644 --- a/AniLinkPy/apis/anilist/query/page/page.py +++ b/AniLinkPy/apis/anilist/query/page/page.py @@ -2,7 +2,7 @@ This module contains the Page class which represents a Page in the AniLink API. """ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.query.page.activities import ActivitiesQuery from AniLinkPy.apis.anilist.query.page.activity_replies import ActivityRepliesQuery @@ -25,7 +25,9 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.activity_replies_query = ActivityRepliesQuery(auth_token) self.airing_schedules_query = AiringSchedulesQuery(auth_token) - def activities(self, variables: Union[dict, None] = None) -> dict: + def activities( + self, variables: Union[Dict[str, Union[str, int, bool]], None] = None + ) -> dict: """ This method is used to get activities. @@ -39,7 +41,9 @@ def activities(self, variables: Union[dict, None] = None) -> dict: variables = {} return self.activities_query.activities(variables) - def activityReplies(self, variables: Union[dict, None] = None) -> dict: + def activityReplies( + self, variables: Union[Dict[str, Union[str, int, bool]], None] = None + ) -> dict: """ This method is used to get activity_replies. @@ -53,7 +57,9 @@ def activityReplies(self, variables: Union[dict, None] = None) -> dict: variables = {} return self.activity_replies_query.activityReplies(variables) - def airingSchedules(self, variables: Union[dict, None] = None) -> dict: + def airingSchedules( + self, variables: Union[Dict[str, Union[str, int, bool]], None] = None + ) -> dict: """ This method is used to get airing_schedules. diff --git a/AniLinkPy/apis/anilist/query/query.py b/AniLinkPy/apis/anilist/query/query.py index ad35ad4..93f0733 100644 --- a/AniLinkPy/apis/anilist/query/query.py +++ b/AniLinkPy/apis/anilist/query/query.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.query.media import MediaQuery from AniLinkPy.apis.anilist.query.page.page import Page @@ -25,7 +25,7 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.user_query = UserQuery(auth_token) self.media_query = MediaQuery(auth_token) - def user(self, variables: dict) -> dict: + def user(self, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict: """ This method is used to get a user. @@ -37,7 +37,7 @@ def user(self, variables: dict) -> dict: """ return self.user_query.user(variables) - def media(self, variables: dict) -> dict: + def media(self, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict: """ This method is used to get a media. diff --git a/AniLinkPy/apis/anilist/query/user.py b/AniLinkPy/apis/anilist/query/user.py index 7f8db39..f73398d 100644 --- a/AniLinkPy/apis/anilist/query/user.py +++ b/AniLinkPy/apis/anilist/query/user.py @@ -1,4 +1,4 @@ -from typing import Union +from typing import Dict, Union from AniLinkPy.apis.anilist.schemas.query.user_schema import USERSCHEMA from AniLinkPy.base.RequestHandler import send_request @@ -23,7 +23,7 @@ def __init__(self, auth_token: Union[str, None]) -> None: self.base_url = "https://graphql.anilist.co" self.auth_token = auth_token - def user(self, variables: dict) -> dict: + def user(self, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict: """ This method is used to send a user Query.