@irfanshadikrishad/anilist 1.3.2-forbidden.1 → 1.4.0
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/{LICENSE.md → LICENSE} +373 -382
- package/README.md +79 -53
- package/bin/helpers/auth.d.ts +13 -7
- package/bin/helpers/auth.js +297 -399
- package/bin/helpers/lists.d.ts +5 -1
- package/bin/helpers/lists.js +276 -127
- package/bin/helpers/mutations.d.ts +1 -2
- package/bin/helpers/mutations.js +32 -37
- package/bin/helpers/queries.d.ts +10 -9
- package/bin/helpers/queries.js +151 -154
- package/bin/helpers/truncate.d.ts +6 -0
- package/bin/helpers/truncate.js +9 -0
- package/bin/helpers/types.d.ts +206 -36
- package/bin/helpers/validation.d.ts +29 -0
- package/bin/helpers/validation.js +117 -0
- package/bin/helpers/workers.d.ts +19 -10
- package/bin/helpers/workers.js +157 -93
- package/bin/index.js +30 -6
- package/package.json +22 -17
package/README.md
CHANGED
|
@@ -35,33 +35,35 @@ Create an API client from [anilist developer setting](https://anilist.co/setting
|
|
|
35
35
|
|
|
36
36
|
To login:
|
|
37
37
|
|
|
38
|
-
```
|
|
38
|
+
```bash
|
|
39
39
|
anilist login -i <client-id> -s <client-secret>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
> [!NOTE]
|
|
43
|
-
> here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
|
|
43
|
+
> here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting. Also don't include `<>`, this only indicates need-to-be-replaced data.
|
|
44
44
|
|
|
45
45
|
#### CLI Commands Overview
|
|
46
46
|
|
|
47
|
-
| **Command**
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
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
|
+
| `manga` | `<manga-id>` | Get manga details by Manga ID |
|
|
62
|
+
| `search` <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
63
|
+
| `status` <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
64
|
+
| `export` <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list in JSON, CSV or XML (MyAnimeList/AniDB) |
|
|
65
|
+
| `import` <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list from exported JSON, MyAnimeList (XML) or AniDB (json-large) |
|
|
66
|
+
| `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
67
|
|
|
66
68
|
#### Command Breakdown:
|
|
67
69
|
|
|
@@ -71,10 +73,10 @@ anilist login -i <client-id> -s <client-secret>
|
|
|
71
73
|
anilist login -i <client-id> -s <client-secret>
|
|
72
74
|
```
|
|
73
75
|
|
|
74
|
-
-
|
|
76
|
+
- Options:
|
|
75
77
|
- `-i, --id`: Specify AniList Client ID
|
|
76
78
|
- `-s, --secret`: Provide the AniList Client Secret
|
|
77
|
-
-
|
|
79
|
+
- Usage: Authenticate and log in to AniList using your ID and secret credentials.
|
|
78
80
|
|
|
79
81
|
#### `logout`:
|
|
80
82
|
|
|
@@ -82,15 +84,15 @@ anilist login -i <client-id> -s <client-secret>
|
|
|
82
84
|
anilist logout
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
-
|
|
87
|
+
- Description: End the current session and log out from your AniList account.
|
|
86
88
|
|
|
87
|
-
#### `
|
|
89
|
+
#### `whoami`:
|
|
88
90
|
|
|
89
91
|
```bash
|
|
90
|
-
anilist
|
|
92
|
+
anilist whoami
|
|
91
93
|
```
|
|
92
94
|
|
|
93
|
-
-
|
|
95
|
+
- Description: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
94
96
|
|
|
95
97
|
#### `-V, --version`:
|
|
96
98
|
|
|
@@ -98,7 +100,7 @@ anilist me
|
|
|
98
100
|
anilist -V
|
|
99
101
|
```
|
|
100
102
|
|
|
101
|
-
-
|
|
103
|
+
- Description: Quickly check which version of the CLI you are running.
|
|
102
104
|
|
|
103
105
|
#### `-h, --help`:
|
|
104
106
|
|
|
@@ -106,7 +108,7 @@ anilist -V
|
|
|
106
108
|
anilist -h
|
|
107
109
|
```
|
|
108
110
|
|
|
109
|
-
-
|
|
111
|
+
- Description: List all available commands and their usage details for quick reference.
|
|
110
112
|
|
|
111
113
|
#### `trending` _(alias: `tr`)_:
|
|
112
114
|
|
|
@@ -114,9 +116,9 @@ anilist -h
|
|
|
114
116
|
anilist tr -c 15
|
|
115
117
|
```
|
|
116
118
|
|
|
117
|
-
-
|
|
119
|
+
- Options:
|
|
118
120
|
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
119
|
-
-
|
|
121
|
+
- Description: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
120
122
|
|
|
121
123
|
#### `popular` _(alias: `plr`)_:
|
|
122
124
|
|
|
@@ -124,9 +126,9 @@ anilist tr -c 15
|
|
|
124
126
|
anilist popular
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
-
|
|
129
|
+
- Options:
|
|
128
130
|
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
129
|
-
-
|
|
131
|
+
- Description: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
130
132
|
|
|
131
133
|
#### `upcoming` _(alias: `up`)_:
|
|
132
134
|
|
|
@@ -134,9 +136,9 @@ anilist popular
|
|
|
134
136
|
anilist up -c 25
|
|
135
137
|
```
|
|
136
138
|
|
|
137
|
-
-
|
|
139
|
+
- Options:
|
|
138
140
|
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
139
|
-
-
|
|
141
|
+
- Description: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
140
142
|
|
|
141
143
|
#### `user`:
|
|
142
144
|
|
|
@@ -144,9 +146,9 @@ anilist up -c 25
|
|
|
144
146
|
anilist user <username>
|
|
145
147
|
```
|
|
146
148
|
|
|
147
|
-
-
|
|
149
|
+
- Options:
|
|
148
150
|
- `<username>`: Specify the AniList username to fetch.
|
|
149
|
-
-
|
|
151
|
+
- Description: Retrieve profile information about a specific AniList user.
|
|
150
152
|
|
|
151
153
|
#### `lists` _(alias: `ls`)_:
|
|
152
154
|
|
|
@@ -154,22 +156,22 @@ anilist user <username>
|
|
|
154
156
|
anilist ls -a
|
|
155
157
|
```
|
|
156
158
|
|
|
157
|
-
-
|
|
159
|
+
- Options:
|
|
158
160
|
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
159
161
|
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
160
|
-
-
|
|
162
|
+
- Description: Get the anime or manga lists of the logged-in user.
|
|
161
163
|
|
|
162
164
|
#### `delete` _(alias: `del`)_:
|
|
163
165
|
|
|
164
166
|
```bash
|
|
165
|
-
anilist del -
|
|
167
|
+
anilist del -s,
|
|
166
168
|
```
|
|
167
169
|
|
|
168
|
-
-
|
|
170
|
+
- Options:
|
|
169
171
|
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
170
172
|
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
171
|
-
- `-
|
|
172
|
-
-
|
|
173
|
+
- `-s,, --activity`: Delete all or any type of activities you want.
|
|
174
|
+
- Description: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
173
175
|
|
|
174
176
|
#### `anime`
|
|
175
177
|
|
|
@@ -177,9 +179,19 @@ anilist del -ac
|
|
|
177
179
|
anilist anime <anime-id>
|
|
178
180
|
```
|
|
179
181
|
|
|
180
|
-
-
|
|
182
|
+
- Options
|
|
181
183
|
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
182
|
-
-
|
|
184
|
+
- Description: Get anime details by anime Id.
|
|
185
|
+
|
|
186
|
+
#### `manga`
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
anilist manga <manga-id>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- Options
|
|
193
|
+
- `<anime-id>` _(eg: 21)_ : Id of the manga you want to get details of.
|
|
194
|
+
- Description: Get manga details by manga Id.
|
|
183
195
|
|
|
184
196
|
#### `search` _(alias: `srch`/`find`)_:
|
|
185
197
|
|
|
@@ -187,12 +199,12 @@ anilist anime <anime-id>
|
|
|
187
199
|
anilist search <query> -a -c 20
|
|
188
200
|
```
|
|
189
201
|
|
|
190
|
-
-
|
|
202
|
+
- Options:
|
|
191
203
|
- `<query>` : What you want to search (eg: naruto).
|
|
192
204
|
- `-a, --anime`: To get results of anime search.
|
|
193
205
|
- `-m, --manga`: To get results of manga search.
|
|
194
206
|
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
195
|
-
-
|
|
207
|
+
- Description: Get anime/manga search results
|
|
196
208
|
|
|
197
209
|
#### `status` _(alias: `write`/`post`)_:
|
|
198
210
|
|
|
@@ -200,9 +212,9 @@ anilist search <query> -a -c 20
|
|
|
200
212
|
anilist write <status>
|
|
201
213
|
```
|
|
202
214
|
|
|
203
|
-
-
|
|
215
|
+
- Options:
|
|
204
216
|
- `<status>` : This is what you want to write, It can be HTML, Markdown and/or Text. But wrap it with quotation mark (") else it might get cut-off.
|
|
205
|
-
-
|
|
217
|
+
- Description: Get anime/manga search results
|
|
206
218
|
|
|
207
219
|
#### `export` _(alias: `exp`)_:
|
|
208
220
|
|
|
@@ -210,10 +222,10 @@ anilist write <status>
|
|
|
210
222
|
anilist export -a
|
|
211
223
|
```
|
|
212
224
|
|
|
213
|
-
-
|
|
225
|
+
- Options:
|
|
214
226
|
- `-a, --anime`: To export anime list.
|
|
215
227
|
- `-m, --manga`: To export manga list.
|
|
216
|
-
-
|
|
228
|
+
- 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
229
|
|
|
218
230
|
#### `import` _(alias: `imp`)_:
|
|
219
231
|
|
|
@@ -221,14 +233,28 @@ anilist export -a
|
|
|
221
233
|
anilist import -m
|
|
222
234
|
```
|
|
223
235
|
|
|
224
|
-
-
|
|
236
|
+
- Options:
|
|
225
237
|
- `-a, --anime`: To import anime list.
|
|
226
238
|
- `-m, --manga`: To import manga list.
|
|
227
|
-
-
|
|
239
|
+
- 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).
|
|
240
|
+
|
|
241
|
+
> [!NOTE]
|
|
242
|
+
> 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
243
|
|
|
229
244
|
> [!IMPORTANT]
|
|
230
245
|
> 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
246
|
|
|
247
|
+
#### `social` _(alias: `sol`)_:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
anilist sol -f
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- Options:
|
|
254
|
+
- `-f, --follow`: To follow users who follows you automatically.
|
|
255
|
+
- `-u, --unfollow`: To unfollow users who doesn't follow you back.
|
|
256
|
+
- Description: It follows users who follows you or unfollow users who doesn't follow you back at ease.
|
|
257
|
+
|
|
232
258
|
#### Security
|
|
233
259
|
|
|
234
260
|
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.
|
|
@@ -237,4 +263,4 @@ Since you are creating your own API client for login no else else can get your c
|
|
|
237
263
|
|
|
238
264
|
Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
|
|
239
265
|
|
|
240
|
-
####
|
|
266
|
+
#### _Thanks for visiting 💙_
|
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;
|
|
@@ -48,9 +48,15 @@ declare class Auth {
|
|
|
48
48
|
static Write(status: string): Promise<void>;
|
|
49
49
|
static callAnimeImporter(): Promise<void>;
|
|
50
50
|
static callMangaImporter(): Promise<void>;
|
|
51
|
-
private static LikeFollowing;
|
|
52
|
-
private static Like;
|
|
53
|
-
private static LikeSpecificUser;
|
|
54
|
-
static AutoLike(): Promise<void>;
|
|
55
51
|
}
|
|
56
|
-
|
|
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 };
|