@irfanshadikrishad/anilist 1.2.4 → 1.2.6
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.
- package/README.md +35 -20
- package/bin/helpers/auth.d.ts +13 -3
- package/bin/helpers/auth.js +297 -199
- package/bin/helpers/lists.d.ts +4 -1
- package/bin/helpers/lists.js +211 -114
- package/bin/helpers/queries.d.ts +5 -2
- package/bin/helpers/queries.js +20 -2
- package/bin/helpers/types.d.ts +179 -4
- package/bin/helpers/workers.d.ts +5 -4
- package/bin/helpers/workers.js +33 -2
- package/bin/index.js +25 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -44,24 +44,25 @@ anilist login -i <client-id> -s <client-secret>
|
|
|
44
44
|
|
|
45
45
|
#### CLI Commands Overview
|
|
46
46
|
|
|
47
|
-
| **Command** | **Options** | **Description**
|
|
48
|
-
| ------------------------------------------- | ----------------------------------------------------------------------- |
|
|
49
|
-
| **`login`** | `-i, --id` `-s, --secret` | Log in with your AniList credentials
|
|
50
|
-
| **`logout`** | _None_ | Log out from your AniList account
|
|
51
|
-
| **`whoami`** | _None_ | Display information about the logged-in user
|
|
52
|
-
| **`-V, --version`** | _None_ | Display the current version of the CLI
|
|
53
|
-
| **`-h, --help`** | _None_ | Display available commands and options
|
|
54
|
-
| **`trending`** <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10)
|
|
55
|
-
| **`popular`** <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10)
|
|
56
|
-
| **`user`** | `<username>` | Get information about a specific AniList user
|
|
57
|
-
| **`lists`** <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user
|
|
58
|
-
| **`delete`** <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-s, --activity` | Delete collections of anime, manga or activities
|
|
59
|
-
| **`upcoming`** <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10)
|
|
60
|
-
| **`anime`** | `<anime-id>` | Get anime details by Anime Id
|
|
61
|
-
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results
|
|
62
|
-
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html)
|
|
63
|
-
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList)
|
|
64
|
-
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON
|
|
47
|
+
| **Command** | **Options** | **Description** |
|
|
48
|
+
| ------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
49
|
+
| **`login`** | `-i, --id` `-s, --secret` | Log in with your AniList credentials |
|
|
50
|
+
| **`logout`** | _None_ | Log out from your AniList account |
|
|
51
|
+
| **`whoami`** | _None_ | Display information about the logged-in user |
|
|
52
|
+
| **`-V, --version`** | _None_ | Display the current version of the CLI |
|
|
53
|
+
| **`-h, --help`** | _None_ | Display available commands and options |
|
|
54
|
+
| **`trending`** <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10) |
|
|
55
|
+
| **`popular`** <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10) |
|
|
56
|
+
| **`user`** | `<username>` | Get information about a specific AniList user |
|
|
57
|
+
| **`lists`** <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user |
|
|
58
|
+
| **`delete`** <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-s, --activity` | Delete collections of anime, manga or activities |
|
|
59
|
+
| **`upcoming`** <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10) |
|
|
60
|
+
| **`anime`** | `<anime-id>` | Get anime details by Anime Id |
|
|
61
|
+
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
62
|
+
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
63
|
+
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList/AniDB) |
|
|
64
|
+
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON, MyAnimeList (XML) or AniDB (json-large) |
|
|
65
|
+
| \*\*`social` <br> _(alias: `sol`)_ | `-f, --follow` <br> `-u, --unfollow` | Follow users who follows you or Unfollow who doesn't follow you back with a simple command |
|
|
65
66
|
|
|
66
67
|
#### Command Breakdown:
|
|
67
68
|
|
|
@@ -213,7 +214,7 @@ anilist export -a
|
|
|
213
214
|
- **Options**:
|
|
214
215
|
- `-a, --anime`: To export anime list.
|
|
215
216
|
- `-m, --manga`: To export manga list.
|
|
216
|
-
- **Description**: Export anime or manga list. For `XML (MyAnimeList)` file, to import it on MyAnimeList, go [here](https://myanimelist.net/import.php) and choose `MyAnimeList Import`.
|
|
217
|
+
- **Description**: Export anime or manga list. For `XML (MyAnimeList/AniDB)` file, to import it on MyAnimeList, go [here](https://myanimelist.net/import.php) and choose `MyAnimeList Import` for `AniDB` go [here](https://anidb.net/user/import) and select `MyAnimeList.net - XML anime list export`.
|
|
217
218
|
|
|
218
219
|
#### `import` _(alias: `imp`)_:
|
|
219
220
|
|
|
@@ -224,11 +225,25 @@ anilist import -m
|
|
|
224
225
|
- **Options**:
|
|
225
226
|
- `-a, --anime`: To import anime list.
|
|
226
227
|
- `-m, --manga`: To import manga list.
|
|
227
|
-
- **Description**: Import anime or manga list. If you want to import anime/manga list from MyAnimeList
|
|
228
|
+
- **Description**: Import anime or manga list. If you want to import anime/manga list from `MyAnimeList`, export the XML from [here](https://myanimelist.net/panel.php?go=export), for exporting list from `AniDB` go [here](https://anidb.net/user/export).
|
|
229
|
+
|
|
230
|
+
> [!NOTE]
|
|
231
|
+
> If you have exported from `AniDB`, you will have to unzip it, and there should be a file named `mylist.json`, copy and paste it in your systems download folder, and select it from import option.
|
|
228
232
|
|
|
229
233
|
> [!IMPORTANT]
|
|
230
234
|
> If you are importing from a file, place the file in the system specific download folder, And the exported file will also be exported there as well.
|
|
231
235
|
|
|
236
|
+
#### `social` _(alias: `sol`)_:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
anilist sol -f
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
- **Options**:
|
|
243
|
+
- `-f, --follow`: To follow users who follows you automatically.
|
|
244
|
+
- `-u, --unfollow`: To unfollow users who doesn't follow you back.
|
|
245
|
+
- **Description**: It follows users who follows you or unfollow users who doesn't follow you back at ease.
|
|
246
|
+
|
|
232
247
|
#### Security
|
|
233
248
|
|
|
234
249
|
Since you are creating your own API client for login no else else can get your credentials and the generated access token will be stored in your own system. So, As long as you don't share your device (in case you do, just logout) you are safe.
|
package/bin/helpers/auth.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ declare class Auth {
|
|
|
3
3
|
/**
|
|
4
4
|
* Get access-token from user
|
|
5
5
|
*/
|
|
6
|
-
static GetAccessToken(): Promise<string>;
|
|
6
|
+
static GetAccessToken(): Promise<string | null>;
|
|
7
7
|
static StoreAccessToken(token: string): Promise<void>;
|
|
8
|
-
static RetriveAccessToken(): Promise<string>;
|
|
8
|
+
static RetriveAccessToken(): Promise<string | null>;
|
|
9
9
|
static Login(clientId: number, clientSecret: string): Promise<void>;
|
|
10
10
|
static Myself(): Promise<{
|
|
11
11
|
id: number;
|
|
@@ -49,4 +49,14 @@ declare class Auth {
|
|
|
49
49
|
static callAnimeImporter(): Promise<void>;
|
|
50
50
|
static callMangaImporter(): Promise<void>;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
declare class Social {
|
|
53
|
+
/**
|
|
54
|
+
* Follow the users that follows you
|
|
55
|
+
*/
|
|
56
|
+
static follow(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Unfollow the users thats not following you
|
|
59
|
+
*/
|
|
60
|
+
static unfollow(): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export { Auth, Social };
|