@irfanshadikrishad/anilist 1.0.7 → 1.0.8
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 +232 -232
- package/bin/helpers/auth.d.ts +1 -1
- package/bin/helpers/auth.js +30 -30
- package/bin/helpers/fetcher.js +1 -1
- package/bin/helpers/lists.d.ts +1 -1
- package/bin/helpers/lists.js +13 -14
- package/bin/helpers/more.d.ts +1 -1
- package/bin/helpers/more.js +32 -6
- package/bin/helpers/mutations.d.ts +1 -1
- package/bin/helpers/mutations.js +32 -32
- package/bin/helpers/queries.d.ts +5 -3
- package/bin/helpers/queries.js +130 -120
- package/bin/helpers/types.d.ts +101 -1
- package/bin/helpers/types.js +26 -1
- package/bin/helpers/workers.d.ts +9 -1
- package/bin/helpers/workers.js +338 -13
- package/bin/index.js +1 -1
- package/package.json +5 -2
- package/CHANGELOG.md +0 -18
- package/CODE_OF_CONDUCT.md +0 -43
- package/CONTRIBUTING.md +0 -75
package/README.md
CHANGED
|
@@ -1,232 +1,232 @@
|
|
|
1
|
-
#### @irfanshadikrishad/anilist
|
|
2
|
-
|
|
3
|
-
Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.
|
|
4
|
-
|
|
5
|
-
#### How to install?
|
|
6
|
-
|
|
7
|
-
Make sure [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com) are already installed in your system.
|
|
8
|
-
Verify installation using
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node -v
|
|
12
|
-
npm -v
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
If you see the version then its installed. Otherwise install nodejs and npm should already be installed with nodejs.
|
|
16
|
-
Then install the package by running
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install -g @irfanshadikrishad/anilist
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This will install the package globally. And you have to use commands like
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
anilist tr -c 15
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
#### How to use?
|
|
29
|
-
|
|
30
|
-
Create an API client from [anilist developer setting](https://anilist.co/settings/developer) with an application name and redirect url as `https://anilist.co/api/v2/oauth/pin`. After creating the client you will get `Client ID` and `Client Secret` which is required in order to login from CLI.
|
|
31
|
-
|
|
32
|
-
To login:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
anilist login -i <client-id> -s <client-secret>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
|
|
39
|
-
|
|
40
|
-
#### CLI Commands Overview
|
|
41
|
-
|
|
42
|
-
| **Command** | **Options** | **Description** |
|
|
43
|
-
| ------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------ |
|
|
44
|
-
| **`login`** | `-i, --id` `-s, --secret` | Log in with your AniList credentials |
|
|
45
|
-
| **`logout`** | _None_ | Log out from your AniList account |
|
|
46
|
-
| **`me`** | _None_ | Display information about the logged-in user |
|
|
47
|
-
| **`-V, --version`** | _None_ | Display the current version of the CLI |
|
|
48
|
-
| **`-h, --help`** | _None_ | Display available commands and options |
|
|
49
|
-
| **`trending`** <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10) |
|
|
50
|
-
| **`popular`** <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10) |
|
|
51
|
-
| **`user`** | `<username>` | Get information about a specific AniList user |
|
|
52
|
-
| **`lists`** <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user |
|
|
53
|
-
| **`delete`** <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-ac, --activity` | Delete collections of anime, manga or activities |
|
|
54
|
-
| **`upcoming`** <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10) |
|
|
55
|
-
| **`anime`** | `<anime-id>` | Get anime details by Anime Id |
|
|
56
|
-
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
57
|
-
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
58
|
-
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list |
|
|
59
|
-
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list |
|
|
60
|
-
|
|
61
|
-
#### Command Breakdown:
|
|
62
|
-
|
|
63
|
-
#### `login`:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
anilist login -i <client-id> -s <client-secret>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
- **Options**:
|
|
70
|
-
- `-i, --id`: Specify AniList Client ID
|
|
71
|
-
- `-s, --secret`: Provide the AniList Client Secret
|
|
72
|
-
- **Usage**: Authenticate and log in to AniList using your ID and secret credentials.
|
|
73
|
-
|
|
74
|
-
#### `logout`:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
anilist logout
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
- **Description**: End the current session and log out from your AniList account.
|
|
81
|
-
|
|
82
|
-
#### `me`:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
anilist me
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
- **Description**: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
89
|
-
|
|
90
|
-
#### `-V, --version`:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
anilist -V
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
- **Description**: Quickly check which version of the CLI you are running.
|
|
97
|
-
|
|
98
|
-
#### `-h, --help`:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
anilist -h
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
- **Description**: List all available commands and their usage details for quick reference.
|
|
105
|
-
|
|
106
|
-
#### `trending` _(alias: `tr`)_:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
anilist tr -c 15
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
- **Options**:
|
|
113
|
-
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
114
|
-
- **Description**: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
115
|
-
|
|
116
|
-
#### `popular` _(alias: `plr`)_:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
anilist popular
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
- **Options**:
|
|
123
|
-
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
124
|
-
- **Description**: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
125
|
-
|
|
126
|
-
#### `upcoming` _(alias: `up`)_:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
anilist up -c 25
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
- **Options**:
|
|
133
|
-
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
134
|
-
- **Description**: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
135
|
-
|
|
136
|
-
#### `user`:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
anilist user <username>
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
- **Options**:
|
|
143
|
-
- `<username>`: Specify the AniList username to fetch.
|
|
144
|
-
- **Description**: Retrieve profile information about a specific AniList user.
|
|
145
|
-
|
|
146
|
-
#### `lists` _(alias: `ls`)_:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
anilist ls -a
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
- **Options**:
|
|
153
|
-
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
154
|
-
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
155
|
-
- **Description**: Get the anime or manga lists of the logged-in user.
|
|
156
|
-
|
|
157
|
-
#### `delete` _(alias: `del`)_:
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
anilist del -ac
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- **Options**:
|
|
164
|
-
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
165
|
-
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
166
|
-
- `-ac, --activity`: Delete all or any type of activities you want.
|
|
167
|
-
- **Description**: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
168
|
-
|
|
169
|
-
#### `anime`
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
anilist anime <anime-id>
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
- **Options**
|
|
176
|
-
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
177
|
-
- **Description**: Get anime details by anime Id.
|
|
178
|
-
|
|
179
|
-
#### `search` _(alias: `srch`/`find`)_:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
anilist search <query> -a -c 20
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
- **Options**:
|
|
186
|
-
- `<query>` : What you want to search (eg: naruto).
|
|
187
|
-
- `-a, --anime`: To get results of anime search.
|
|
188
|
-
- `-m, --manga`: To get results of manga search.
|
|
189
|
-
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
190
|
-
- **Description**: Get anime/manga search results
|
|
191
|
-
|
|
192
|
-
#### `status` _(alias: `write`/`post`)_:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
anilist write <status>
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
- **Options**:
|
|
199
|
-
- `<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.
|
|
200
|
-
- **Description**: Get anime/manga search results
|
|
201
|
-
|
|
202
|
-
#### `export` _(alias: `exp`)_:
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
anilist export -a
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
- **Options**:
|
|
209
|
-
- `-a, --anime`: To export anime list.
|
|
210
|
-
- `-m, --manga`: To export manga list.
|
|
211
|
-
- **Description**: Export anime or manga list
|
|
212
|
-
|
|
213
|
-
#### `import` _(alias: `imp`)_:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
anilist import -m
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
- **Options**:
|
|
220
|
-
- `-a, --anime`: To import anime list.
|
|
221
|
-
- `-m, --manga`: To import manga list.
|
|
222
|
-
- **Description**: Import anime or manga list
|
|
223
|
-
|
|
224
|
-
#### Security
|
|
225
|
-
|
|
226
|
-
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.
|
|
227
|
-
|
|
228
|
-
#### Contribution
|
|
229
|
-
|
|
230
|
-
Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
|
|
231
|
-
|
|
232
|
-
#### **_Thanks for visiting 💙_**
|
|
1
|
+
#### @irfanshadikrishad/anilist
|
|
2
|
+
|
|
3
|
+
Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.
|
|
4
|
+
|
|
5
|
+
#### How to install?
|
|
6
|
+
|
|
7
|
+
Make sure [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com) are already installed in your system.
|
|
8
|
+
Verify installation using
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
node -v
|
|
12
|
+
npm -v
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
If you see the version then its installed. Otherwise install nodejs and npm should already be installed with nodejs.
|
|
16
|
+
Then install the package by running
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @irfanshadikrishad/anilist
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will install the package globally. And you have to use commands like
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
anilist tr -c 15
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### How to use?
|
|
29
|
+
|
|
30
|
+
Create an API client from [anilist developer setting](https://anilist.co/settings/developer) with an application name and redirect url as `https://anilist.co/api/v2/oauth/pin`. After creating the client you will get `Client ID` and `Client Secret` which is required in order to login from CLI.
|
|
31
|
+
|
|
32
|
+
To login:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
anilist login -i <client-id> -s <client-secret>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
|
|
39
|
+
|
|
40
|
+
#### CLI Commands Overview
|
|
41
|
+
|
|
42
|
+
| **Command** | **Options** | **Description** |
|
|
43
|
+
| ------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------ |
|
|
44
|
+
| **`login`** | `-i, --id` `-s, --secret` | Log in with your AniList credentials |
|
|
45
|
+
| **`logout`** | _None_ | Log out from your AniList account |
|
|
46
|
+
| **`me`** | _None_ | Display information about the logged-in user |
|
|
47
|
+
| **`-V, --version`** | _None_ | Display the current version of the CLI |
|
|
48
|
+
| **`-h, --help`** | _None_ | Display available commands and options |
|
|
49
|
+
| **`trending`** <br> _(alias: `tr`)_ | `-c (default: 10)` | Fetch trending anime (default count is 10) |
|
|
50
|
+
| **`popular`** <br> _(alias: `plr`)_ | `-c (default: 10)` | Fetch popular anime (default count is 10) |
|
|
51
|
+
| **`user`** | `<username>` | Get information about a specific AniList user |
|
|
52
|
+
| **`lists`** <br> _(alias: `ls`)_ | `-a, --anime` <br> `-m, --manga` | Fetch anime or manga lists of the logged-in user |
|
|
53
|
+
| **`delete`** <br> _(alias: `del`)_ | `-a, --anime` <br> `-m, --manga` <br> `-ac, --activity` | Delete collections of anime, manga or activities |
|
|
54
|
+
| **`upcoming`** <br> _(alias:`up`)_ | `-c (default: 10)` | Fetch upcoming anime (default count is 10) |
|
|
55
|
+
| **`anime`** | `<anime-id>` | Get anime details by Anime Id |
|
|
56
|
+
| **`search`** <br> _(alias:`srch`/`find`)_ | `<query>` <br> `-a, --anime` <br> `-m, --manga` <br> `-c (default: 10)` | Get anime/manga search results |
|
|
57
|
+
| **`status`** <br> _(alias: `write`/`post`)_ | `<status>` | Write a status... (text/markdown/html) |
|
|
58
|
+
| **`export`** <br> _(alias: `exp`)_ | `-a, --anime` <br> `-m, --manga` | Export anime or manga list |
|
|
59
|
+
| **`import`** <br> _(alias: `imp`)_ | `-a, --anime` <br> `-m, --manga` | Import anime or manga list |
|
|
60
|
+
|
|
61
|
+
#### Command Breakdown:
|
|
62
|
+
|
|
63
|
+
#### `login`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
anilist login -i <client-id> -s <client-secret>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- **Options**:
|
|
70
|
+
- `-i, --id`: Specify AniList Client ID
|
|
71
|
+
- `-s, --secret`: Provide the AniList Client Secret
|
|
72
|
+
- **Usage**: Authenticate and log in to AniList using your ID and secret credentials.
|
|
73
|
+
|
|
74
|
+
#### `logout`:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
anilist logout
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- **Description**: End the current session and log out from your AniList account.
|
|
81
|
+
|
|
82
|
+
#### `me`:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
anilist me
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- **Description**: Retrieve and display information about the currently logged-in user, including stats and profile details.
|
|
89
|
+
|
|
90
|
+
#### `-V, --version`:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
anilist -V
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- **Description**: Quickly check which version of the CLI you are running.
|
|
97
|
+
|
|
98
|
+
#### `-h, --help`:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
anilist -h
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- **Description**: List all available commands and their usage details for quick reference.
|
|
105
|
+
|
|
106
|
+
#### `trending` _(alias: `tr`)_:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
anilist tr -c 15
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- **Options**:
|
|
113
|
+
- `-c (count)`: Specify how many trending anime to fetch (default: 10).
|
|
114
|
+
- **Description**: Fetch the current trending anime series, with the option to customize how many results to display.
|
|
115
|
+
|
|
116
|
+
#### `popular` _(alias: `plr`)_:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
anilist popular
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
- **Options**:
|
|
123
|
+
- `-c (count)`: Specify how many popular anime to fetch (default: 10).
|
|
124
|
+
- **Description**: Fetch the most popular anime series, with the option to customize how many results to display.
|
|
125
|
+
|
|
126
|
+
#### `upcoming` _(alias: `up`)_:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
anilist up -c 25
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- **Options**:
|
|
133
|
+
- `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
|
|
134
|
+
- **Description**: Fetch the upcoming anime series next season, with the option to customize how many results to display.
|
|
135
|
+
|
|
136
|
+
#### `user`:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
anilist user <username>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
- **Options**:
|
|
143
|
+
- `<username>`: Specify the AniList username to fetch.
|
|
144
|
+
- **Description**: Retrieve profile information about a specific AniList user.
|
|
145
|
+
|
|
146
|
+
#### `lists` _(alias: `ls`)_:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
anilist ls -a
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
- **Options**:
|
|
153
|
+
- `-a, --anime`: Fetch the authenticated user's anime list.
|
|
154
|
+
- `-m, --manga`: Fetch the authenticated user's manga list.
|
|
155
|
+
- **Description**: Get the anime or manga lists of the logged-in user.
|
|
156
|
+
|
|
157
|
+
#### `delete` _(alias: `del`)_:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
anilist del -ac
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- **Options**:
|
|
164
|
+
- `-a, --anime`: Delete your specific anime collection that you want.
|
|
165
|
+
- `-m, --manga`: Delete your specific manga collection that you want.
|
|
166
|
+
- `-ac, --activity`: Delete all or any type of activities you want.
|
|
167
|
+
- **Description**: Delete the entire anime or manga collection from the logged-in user's profile.
|
|
168
|
+
|
|
169
|
+
#### `anime`
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
anilist anime <anime-id>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
- **Options**
|
|
176
|
+
- `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
|
|
177
|
+
- **Description**: Get anime details by anime Id.
|
|
178
|
+
|
|
179
|
+
#### `search` _(alias: `srch`/`find`)_:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
anilist search <query> -a -c 20
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- **Options**:
|
|
186
|
+
- `<query>` : What you want to search (eg: naruto).
|
|
187
|
+
- `-a, --anime`: To get results of anime search.
|
|
188
|
+
- `-m, --manga`: To get results of manga search.
|
|
189
|
+
- `-c (count)`: Specify how many items to fetch (default: 10).
|
|
190
|
+
- **Description**: Get anime/manga search results
|
|
191
|
+
|
|
192
|
+
#### `status` _(alias: `write`/`post`)_:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
anilist write <status>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
- **Options**:
|
|
199
|
+
- `<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.
|
|
200
|
+
- **Description**: Get anime/manga search results
|
|
201
|
+
|
|
202
|
+
#### `export` _(alias: `exp`)_:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
anilist export -a
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
- **Options**:
|
|
209
|
+
- `-a, --anime`: To export anime list.
|
|
210
|
+
- `-m, --manga`: To export manga list.
|
|
211
|
+
- **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`.
|
|
212
|
+
|
|
213
|
+
#### `import` _(alias: `imp`)_:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
anilist import -m
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- **Options**:
|
|
220
|
+
- `-a, --anime`: To import anime list.
|
|
221
|
+
- `-m, --manga`: To import manga list.
|
|
222
|
+
- **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).
|
|
223
|
+
|
|
224
|
+
#### Security
|
|
225
|
+
|
|
226
|
+
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.
|
|
227
|
+
|
|
228
|
+
#### Contribution
|
|
229
|
+
|
|
230
|
+
Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
|
|
231
|
+
|
|
232
|
+
#### **_Thanks for visiting 💙_**
|
package/bin/helpers/auth.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ declare function isLoggedIn(): Promise<boolean>;
|
|
|
7
7
|
declare function logoutUser(): Promise<void>;
|
|
8
8
|
declare function currentUsersId(): Promise<any>;
|
|
9
9
|
declare function currentUsersName(): Promise<any>;
|
|
10
|
-
export {
|
|
10
|
+
export { anilistUserLogin, currentUserInfo, currentUsersId, currentUsersName, getAccessTokenFromUser, isLoggedIn, logoutUser, retriveAccessToken, storeAccessToken, };
|
package/bin/helpers/auth.js
CHANGED
|
@@ -8,14 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import fs from "fs";
|
|
11
|
-
import os from "os";
|
|
12
|
-
import path from "path";
|
|
13
11
|
import inquirer from "inquirer";
|
|
14
|
-
import open from "open";
|
|
15
12
|
import fetch from "node-fetch";
|
|
13
|
+
import open from "open";
|
|
14
|
+
import os from "os";
|
|
15
|
+
import path from "path";
|
|
16
|
+
import { fetcher } from "./fetcher.js";
|
|
16
17
|
import { currentUserQuery, userActivityQuery } from "./queries.js";
|
|
17
18
|
import { aniListEndpoint, getTitle, redirectUri } from "./workers.js";
|
|
18
|
-
import { fetcher } from "./fetcher.js";
|
|
19
19
|
const home_dir = os.homedir();
|
|
20
20
|
const save_path = path.join(home_dir, ".anilist_token");
|
|
21
21
|
function getAccessTokenFromUser() {
|
|
@@ -92,7 +92,7 @@ function currentUserInfo() {
|
|
|
92
92
|
if (yield isLoggedIn()) {
|
|
93
93
|
const headers = {
|
|
94
94
|
"Content-Type": "application/json",
|
|
95
|
-
Authorization: `Bearer ${yield retriveAccessToken()}`,
|
|
95
|
+
"Authorization": `Bearer ${yield retriveAccessToken()}`,
|
|
96
96
|
};
|
|
97
97
|
const request = yield fetch(aniListEndpoint, {
|
|
98
98
|
method: "POST",
|
|
@@ -108,28 +108,28 @@ function currentUserInfo() {
|
|
|
108
108
|
perPage: 10,
|
|
109
109
|
});
|
|
110
110
|
const activities = (_b = (_a = activiResponse === null || activiResponse === void 0 ? void 0 : activiResponse.data) === null || _a === void 0 ? void 0 : _a.Page) === null || _b === void 0 ? void 0 : _b.activities;
|
|
111
|
-
console.log(`
|
|
112
|
-
ID: ${user === null || user === void 0 ? void 0 : user.id}
|
|
113
|
-
Name: ${user === null || user === void 0 ? void 0 : user.name}
|
|
114
|
-
siteUrl: ${user === null || user === void 0 ? void 0 : user.siteUrl}
|
|
115
|
-
profileColor: ${(_c = user === null || user === void 0 ? void 0 : user.options) === null || _c === void 0 ? void 0 : _c.profileColor}
|
|
116
|
-
timeZone: ${(_d = user === null || user === void 0 ? void 0 : user.options) === null || _d === void 0 ? void 0 : _d.timezone}
|
|
117
|
-
activityMergeTime: ${(_e = user === null || user === void 0 ? void 0 : user.options) === null || _e === void 0 ? void 0 : _e.activityMergeTime}
|
|
118
|
-
donatorTier: ${user === null || user === void 0 ? void 0 : user.donatorTier}
|
|
119
|
-
donatorBadge: ${user === null || user === void 0 ? void 0 : user.donatorBadge}
|
|
120
|
-
unreadNotificationCount:${user === null || user === void 0 ? void 0 : user.unreadNotificationCount}
|
|
121
|
-
Account Created: ${new Date((user === null || user === void 0 ? void 0 : user.createdAt) * 1000).toUTCString()}
|
|
122
|
-
Account Updated: ${new Date((user === null || user === void 0 ? void 0 : user.updatedAt) * 1000).toUTCString()}
|
|
123
|
-
|
|
124
|
-
Statistics (Anime):
|
|
125
|
-
Count: ${(_g = (_f = user === null || user === void 0 ? void 0 : user.statistics) === null || _f === void 0 ? void 0 : _f.anime) === null || _g === void 0 ? void 0 : _g.count}
|
|
126
|
-
Mean Score: ${(_j = (_h = user === null || user === void 0 ? void 0 : user.statistics) === null || _h === void 0 ? void 0 : _h.anime) === null || _j === void 0 ? void 0 : _j.meanScore}
|
|
127
|
-
Minutes Watched: ${(_l = (_k = user === null || user === void 0 ? void 0 : user.statistics) === null || _k === void 0 ? void 0 : _k.anime) === null || _l === void 0 ? void 0 : _l.minutesWatched}
|
|
128
|
-
|
|
129
|
-
Statistics (Manga):
|
|
130
|
-
Count: ${(_o = (_m = user === null || user === void 0 ? void 0 : user.statistics) === null || _m === void 0 ? void 0 : _m.manga) === null || _o === void 0 ? void 0 : _o.count}
|
|
131
|
-
Chapters Read: ${(_q = (_p = user === null || user === void 0 ? void 0 : user.statistics) === null || _p === void 0 ? void 0 : _p.manga) === null || _q === void 0 ? void 0 : _q.chaptersRead}
|
|
132
|
-
Volumes Read: ${(_s = (_r = user === null || user === void 0 ? void 0 : user.statistics) === null || _r === void 0 ? void 0 : _r.manga) === null || _s === void 0 ? void 0 : _s.volumesRead}
|
|
111
|
+
console.log(`
|
|
112
|
+
ID: ${user === null || user === void 0 ? void 0 : user.id}
|
|
113
|
+
Name: ${user === null || user === void 0 ? void 0 : user.name}
|
|
114
|
+
siteUrl: ${user === null || user === void 0 ? void 0 : user.siteUrl}
|
|
115
|
+
profileColor: ${(_c = user === null || user === void 0 ? void 0 : user.options) === null || _c === void 0 ? void 0 : _c.profileColor}
|
|
116
|
+
timeZone: ${(_d = user === null || user === void 0 ? void 0 : user.options) === null || _d === void 0 ? void 0 : _d.timezone}
|
|
117
|
+
activityMergeTime: ${(_e = user === null || user === void 0 ? void 0 : user.options) === null || _e === void 0 ? void 0 : _e.activityMergeTime}
|
|
118
|
+
donatorTier: ${user === null || user === void 0 ? void 0 : user.donatorTier}
|
|
119
|
+
donatorBadge: ${user === null || user === void 0 ? void 0 : user.donatorBadge}
|
|
120
|
+
unreadNotificationCount:${user === null || user === void 0 ? void 0 : user.unreadNotificationCount}
|
|
121
|
+
Account Created: ${new Date((user === null || user === void 0 ? void 0 : user.createdAt) * 1000).toUTCString()}
|
|
122
|
+
Account Updated: ${new Date((user === null || user === void 0 ? void 0 : user.updatedAt) * 1000).toUTCString()}
|
|
123
|
+
|
|
124
|
+
Statistics (Anime):
|
|
125
|
+
Count: ${(_g = (_f = user === null || user === void 0 ? void 0 : user.statistics) === null || _f === void 0 ? void 0 : _f.anime) === null || _g === void 0 ? void 0 : _g.count}
|
|
126
|
+
Mean Score: ${(_j = (_h = user === null || user === void 0 ? void 0 : user.statistics) === null || _h === void 0 ? void 0 : _h.anime) === null || _j === void 0 ? void 0 : _j.meanScore}
|
|
127
|
+
Minutes Watched: ${(_l = (_k = user === null || user === void 0 ? void 0 : user.statistics) === null || _k === void 0 ? void 0 : _k.anime) === null || _l === void 0 ? void 0 : _l.minutesWatched}
|
|
128
|
+
|
|
129
|
+
Statistics (Manga):
|
|
130
|
+
Count: ${(_o = (_m = user === null || user === void 0 ? void 0 : user.statistics) === null || _m === void 0 ? void 0 : _m.manga) === null || _o === void 0 ? void 0 : _o.count}
|
|
131
|
+
Chapters Read: ${(_q = (_p = user === null || user === void 0 ? void 0 : user.statistics) === null || _p === void 0 ? void 0 : _p.manga) === null || _q === void 0 ? void 0 : _q.chaptersRead}
|
|
132
|
+
Volumes Read: ${(_s = (_r = user === null || user === void 0 ? void 0 : user.statistics) === null || _r === void 0 ? void 0 : _r.manga) === null || _s === void 0 ? void 0 : _s.volumesRead}
|
|
133
133
|
`);
|
|
134
134
|
console.log(`\nRecent Activities:`);
|
|
135
135
|
if (activities.length > 0) {
|
|
@@ -187,7 +187,7 @@ function currentUsersId() {
|
|
|
187
187
|
method: "POST",
|
|
188
188
|
headers: {
|
|
189
189
|
"Content-Type": "application/json",
|
|
190
|
-
Authorization: `Bearer ${yield retriveAccessToken()}`,
|
|
190
|
+
"Authorization": `Bearer ${yield retriveAccessToken()}`,
|
|
191
191
|
},
|
|
192
192
|
body: JSON.stringify({ query: currentUserQuery }),
|
|
193
193
|
});
|
|
@@ -211,7 +211,7 @@ function currentUsersName() {
|
|
|
211
211
|
method: "POST",
|
|
212
212
|
headers: {
|
|
213
213
|
"Content-Type": "application/json",
|
|
214
|
-
Authorization: `Bearer ${yield retriveAccessToken()}`,
|
|
214
|
+
"Authorization": `Bearer ${yield retriveAccessToken()}`,
|
|
215
215
|
},
|
|
216
216
|
body: JSON.stringify({ query: currentUserQuery }),
|
|
217
217
|
});
|
|
@@ -224,4 +224,4 @@ function currentUsersName() {
|
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
export {
|
|
227
|
+
export { anilistUserLogin, currentUserInfo, currentUsersId, currentUsersName, getAccessTokenFromUser, isLoggedIn, logoutUser, retriveAccessToken, storeAccessToken, };
|
package/bin/helpers/fetcher.js
CHANGED
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import fetch from "node-fetch";
|
|
11
|
-
import { aniListEndpoint } from "./workers.js";
|
|
12
11
|
import { isLoggedIn, retriveAccessToken } from "./auth.js";
|
|
12
|
+
import { aniListEndpoint } from "./workers.js";
|
|
13
13
|
/**
|
|
14
14
|
* Sends a GraphQL request to the AniList API.
|
|
15
15
|
*
|
package/bin/helpers/lists.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ declare function loggedInUsersMangaLists(): Promise<void>;
|
|
|
5
5
|
declare function deleteAnimeCollection(): Promise<void>;
|
|
6
6
|
declare function deleteMangaCollection(): Promise<void>;
|
|
7
7
|
declare function getUpcomingAnimes(count: number): Promise<void>;
|
|
8
|
-
export {
|
|
8
|
+
export { deleteAnimeCollection, deleteMangaCollection, getPopular, getTrending, getUpcomingAnimes, loggedInUsersAnimeLists, loggedInUsersMangaLists, };
|