@irfanshadikrishad/anilist 1.0.0 → 1.0.1-forbidden.2

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 CHANGED
@@ -1,6 +1,10 @@
1
- #### AniList
1
+ #### @irfanshadikrishad/anilist
2
2
 
3
- Unofficial Anilist CLI
3
+ Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.
4
+
5
+ ![NPM Version](https://img.shields.io/npm/v/%40irfanshadikrishad%2Fanilist?style=for-the-badge&color=%23adc178)
6
+ ![NPM Downloads](https://img.shields.io/npm/dw/%40irfanshadikrishad%2Fanilist?style=for-the-badge&color=%23eaac8b)
7
+ ![NPM License](https://img.shields.io/npm/l/%40irfanshadikrishad%2Fanilist?style=for-the-badge&color=%23f2d0a4)
4
8
 
5
9
  #### How to install?
6
10
 
@@ -35,82 +39,217 @@ To login:
35
39
  anilist login -i <client-id> -s <client-secret>
36
40
  ```
37
41
 
38
- here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
42
+ > [!NOTE]
43
+ > here `<client-id>` and `<client-secret>` should be replaced by the ones that you recieved from the developer setting.
39
44
 
40
45
  #### CLI Commands Overview
41
46
 
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`** | `-un (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` | Delete collections of anime or manga |
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 |
54
66
 
55
67
  #### Command Breakdown:
56
68
 
57
- ### `login`:
69
+ #### `login`:
70
+
71
+ ```bash
72
+ anilist login -i <client-id> -s <client-secret>
73
+ ```
58
74
 
59
75
  - **Options**:
60
76
  - `-i, --id`: Specify AniList Client ID
61
77
  - `-s, --secret`: Provide the AniList Client Secret
62
78
  - **Usage**: Authenticate and log in to AniList using your ID and secret credentials.
63
79
 
64
- ### `logout`:
80
+ #### `logout`:
81
+
82
+ ```bash
83
+ anilist logout
84
+ ```
65
85
 
66
86
  - **Description**: End the current session and log out from your AniList account.
67
87
 
68
- ### `me`:
88
+ #### `me`:
89
+
90
+ ```bash
91
+ anilist me
92
+ ```
69
93
 
70
94
  - **Description**: Retrieve and display information about the currently logged-in user, including stats and profile details.
71
95
 
72
- ### `-V, --version`:
96
+ #### `-V, --version`:
97
+
98
+ ```bash
99
+ anilist -V
100
+ ```
73
101
 
74
102
  - **Description**: Quickly check which version of the CLI you are running.
75
103
 
76
- ### `-h, --help`:
104
+ #### `-h, --help`:
105
+
106
+ ```bash
107
+ anilist -h
108
+ ```
77
109
 
78
110
  - **Description**: List all available commands and their usage details for quick reference.
79
111
 
80
- ### `trending` _(alias: `tr`)_:
112
+ #### `trending` _(alias: `tr`)_:
113
+
114
+ ```bash
115
+ anilist tr -c 15
116
+ ```
81
117
 
82
118
  - **Options**:
83
119
  - `-c (count)`: Specify how many trending anime to fetch (default: 10).
84
120
  - **Description**: Fetch the current trending anime series, with the option to customize how many results to display.
85
121
 
86
- ### `popular` _(alias: `plr`)_:
122
+ #### `popular` _(alias: `plr`)_:
123
+
124
+ ```bash
125
+ anilist popular
126
+ ```
87
127
 
88
128
  - **Options**:
89
129
  - `-c (count)`: Specify how many popular anime to fetch (default: 10).
90
130
  - **Description**: Fetch the most popular anime series, with the option to customize how many results to display.
91
131
 
92
- ### `user`:
132
+ #### `upcoming` _(alias: `up`)_:
133
+
134
+ ```bash
135
+ anilist up -c 25
136
+ ```
93
137
 
94
138
  - **Options**:
95
- - `-un (username)`: Specify the AniList username to fetch.
139
+ - `-c (count)`: Specify how many upcoming anime to fetch (default: 10).
140
+ - **Description**: Fetch the upcoming anime series next season, with the option to customize how many results to display.
141
+
142
+ #### `user`:
143
+
144
+ ```bash
145
+ anilist user <username>
146
+ ```
147
+
148
+ - **Options**:
149
+ - `<username>`: Specify the AniList username to fetch.
96
150
  - **Description**: Retrieve profile information about a specific AniList user.
97
151
 
98
- ### `lists` _(alias: `ls`)_:
152
+ #### `lists` _(alias: `ls`)_:
153
+
154
+ ```bash
155
+ anilist ls -a
156
+ ```
99
157
 
100
158
  - **Options**:
101
159
  - `-a, --anime`: Fetch the authenticated user's anime list.
102
160
  - `-m, --manga`: Fetch the authenticated user's manga list.
103
161
  - **Description**: Get the anime or manga lists of the logged-in user.
104
162
 
105
- ### `delete` _(alias: `del`)_:
163
+ #### `delete` _(alias: `del`)_:
164
+
165
+ ```bash
166
+ anilist del -ac
167
+ ```
106
168
 
107
169
  - **Options**:
108
170
  - `-a, --anime`: Delete your specific anime collection that you want.
109
171
  - `-m, --manga`: Delete your specific manga collection that you want.
172
+ - `-ac, --activity`: Delete all or any type of activities you want.
110
173
  - **Description**: Delete the entire anime or manga collection from the logged-in user's profile.
111
174
 
175
+ #### `anime`
176
+
177
+ ```bash
178
+ anilist anime <anime-id>
179
+ ```
180
+
181
+ - **Options**
182
+ - `<anime-id>` _(eg: 21)_ : Id of the anime you want to get details of.
183
+ - **Description**: Get anime details by anime Id.
184
+
185
+ #### `search` _(alias: `srch`/`find`)_:
186
+
187
+ ```bash
188
+ anilist search <query> -a -c 20
189
+ ```
190
+
191
+ - **Options**:
192
+ - `<query>` : What you want to search (eg: naruto).
193
+ - `-a, --anime`: To get results of anime search.
194
+ - `-m, --manga`: To get results of manga search.
195
+ - `-c (count)`: Specify how many items to fetch (default: 10).
196
+ - **Description**: Get anime/manga search results
197
+
198
+ #### `status` _(alias: `write`/`post`)_:
199
+
200
+ ```bash
201
+ anilist write <status>
202
+ ```
203
+
204
+ - **Options**:
205
+ - `<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.
206
+ - **Description**: Get anime/manga search results
207
+
208
+ #### `export` _(alias: `exp`)_:
209
+
210
+ ```bash
211
+ anilist export -a
212
+ ```
213
+
214
+ - **Options**:
215
+ - `-a, --anime`: To export anime list.
216
+ - `-m, --manga`: To export manga list.
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`.
218
+
219
+ #### `import` _(alias: `imp`)_:
220
+
221
+ ```bash
222
+ anilist import -m
223
+ ```
224
+
225
+ - **Options**:
226
+ - `-a, --anime`: To import anime list.
227
+ - `-m, --manga`: To import manga list.
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.
232
+
233
+ > [!IMPORTANT]
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.
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
+
112
247
  #### Security
113
248
 
114
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.
115
250
 
251
+ #### Contribution
252
+
253
+ Want to contribute to the project? Check out complete guideline [here](CONTRIBUTING.md).
254
+
116
255
  #### **_Thanks for visiting 💙_**
@@ -1,9 +1,67 @@
1
- declare function getAccessTokenFromUser(): Promise<any>;
2
- declare function storeAccessToken(token: string): Promise<void>;
3
- declare function retriveAccessToken(): Promise<string>;
4
- declare function anilistUserLogin(cID: number, cSECRET: string): Promise<void>;
5
- declare function currentUserInfo(): Promise<void>;
6
- declare function isLoggedIn(): Promise<Boolean>;
7
- declare function logoutUser(): Promise<void>;
8
- declare function currentUsersId(): Promise<any>;
9
- export { getAccessTokenFromUser, storeAccessToken, retriveAccessToken, anilistUserLogin, currentUserInfo, isLoggedIn, logoutUser, currentUsersId, };
1
+ import { MediaTitle } from "./types.js";
2
+ declare class Auth {
3
+ /**
4
+ * Get access-token from user
5
+ */
6
+ static GetAccessToken(): Promise<string | null>;
7
+ static StoreAccessToken(token: string): Promise<void>;
8
+ static RetriveAccessToken(): Promise<string | null>;
9
+ static Login(clientId: number, clientSecret: string): Promise<void>;
10
+ static Myself(): Promise<{
11
+ id: number;
12
+ name: string;
13
+ siteUrl: string;
14
+ options: {
15
+ profileColor: string;
16
+ timezone: string;
17
+ activityMergeTime: string;
18
+ };
19
+ donatorTier: string;
20
+ donatorBadge: string;
21
+ unreadNotificationCount: number;
22
+ createdAt: number;
23
+ updatedAt: number;
24
+ statistics: {
25
+ anime: {
26
+ count: number;
27
+ meanScore: string;
28
+ minutesWatched: string;
29
+ episodesWatched: number;
30
+ };
31
+ manga: {
32
+ count: number;
33
+ meanScore: string;
34
+ chaptersRead: number;
35
+ volumesRead: number;
36
+ };
37
+ };
38
+ }>;
39
+ static isLoggedIn(): Promise<boolean>;
40
+ static Logout(): Promise<void>;
41
+ static MyUserId(): Promise<number>;
42
+ static MyUserName(): Promise<string>;
43
+ static DeleteMyActivities(): Promise<void>;
44
+ static DeleteMyAnimeList(): Promise<void>;
45
+ static DeleteAnimeById(id: number, title?: MediaTitle): Promise<void>;
46
+ static DeleteMyMangaList(): Promise<void>;
47
+ static DeleteMangaById(id: number, title?: MediaTitle): Promise<void>;
48
+ static Write(status: string): Promise<void>;
49
+ static callAnimeImporter(): Promise<void>;
50
+ static callMangaImporter(): Promise<void>;
51
+ private static LikeFollowing;
52
+ private static Like;
53
+ private static LikeSpecificUser;
54
+ static LikeFollowingActivityV2(perPage: number): Promise<void>;
55
+ static AutoLike(): Promise<void>;
56
+ }
57
+ declare class Social {
58
+ /**
59
+ * Follow the users that follows you
60
+ */
61
+ static follow(): Promise<void>;
62
+ /**
63
+ * Unfollow the users thats not following you
64
+ */
65
+ static unfollow(): Promise<void>;
66
+ }
67
+ export { Auth, Social };