@irfanshadikrishad/anilist 1.0.8 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import fetch from "node-fetch";
11
- import { isLoggedIn, retriveAccessToken } from "./auth.js";
11
+ import { Auth } from "./auth.js";
12
12
  import { aniListEndpoint } from "./workers.js";
13
13
  /**
14
14
  * Sends a GraphQL request to the AniList API.
@@ -27,8 +27,8 @@ function fetcher(query, variables) {
27
27
  const headers = {
28
28
  "content-type": "application/json",
29
29
  };
30
- if (yield isLoggedIn()) {
31
- headers["Authorization"] = `Bearer ${yield retriveAccessToken()}`;
30
+ if (yield Auth.isLoggedIn()) {
31
+ headers["Authorization"] = `Bearer ${yield Auth.RetriveAccessToken()}`;
32
32
  }
33
33
  const request = yield fetch(aniListEndpoint, {
34
34
  method: "POST",
@@ -1,8 +1,22 @@
1
- declare function getTrending(count: number): Promise<void>;
2
- declare function getPopular(count: number): Promise<void>;
3
- declare function loggedInUsersAnimeLists(): Promise<void>;
4
- declare function loggedInUsersMangaLists(): Promise<void>;
5
- declare function deleteAnimeCollection(): Promise<void>;
6
- declare function deleteMangaCollection(): Promise<void>;
7
- declare function getUpcomingAnimes(count: number): Promise<void>;
8
- export { deleteAnimeCollection, deleteMangaCollection, getPopular, getTrending, getUpcomingAnimes, loggedInUsersAnimeLists, loggedInUsersMangaLists, };
1
+ declare class AniList {
2
+ static importAnime(): Promise<void>;
3
+ static importManga(): Promise<void>;
4
+ static exportAnime(): Promise<void>;
5
+ static exportManga(): Promise<void>;
6
+ static MyAnime(): Promise<void>;
7
+ static MyManga(): Promise<void>;
8
+ static getTrendingAnime(count: number): Promise<void>;
9
+ static getPopularAnime(count: number): Promise<void>;
10
+ static getUpcomingAnime(count: number): Promise<void>;
11
+ static getUserByUsername(username: string): Promise<void>;
12
+ static getAnimeDetailsByID(anilistID: number): Promise<void>;
13
+ static searchAnime(search: string, count: number): Promise<void>;
14
+ static searchManga(search: string, count: number): Promise<void>;
15
+ }
16
+ declare class MyAnimeList {
17
+ static importAnime(): Promise<void>;
18
+ static importManga(): Promise<void>;
19
+ static exportAnime(): Promise<void>;
20
+ static exportManga(): Promise<void>;
21
+ }
22
+ export { AniList, MyAnimeList };