@irfanshadikrishad/anilist 1.0.7 → 1.0.9

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/bin/index.js CHANGED
@@ -10,14 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  import { Command } from "commander";
12
12
  import process from "process";
13
- import { anilistUserLogin, currentUserInfo, isLoggedIn, logoutUser, } from "./helpers/auth.js";
14
- import { deleteAnimeCollection, deleteMangaCollection, getPopular, getTrending, getUpcomingAnimes, loggedInUsersAnimeLists, loggedInUsersMangaLists, } from "./helpers/lists.js";
15
- import { deleteUserActivities, exportAnimeList, exportMangaList, getAnimeDetailsByID, getAnimeSearchResults, getMangaSearchResults, getUserInfoByUsername, importAnimeList, importMangaList, writeTextActivity, } from "./helpers/more.js";
13
+ import { Auth } from "./helpers/auth.js";
14
+ import { AniList } from "./helpers/lists.js";
16
15
  const cli = new Command();
17
16
  cli
18
17
  .name("anilist")
19
18
  .description("Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts.")
20
- .version("1.0.7");
19
+ .version("1.0.9");
21
20
  cli
22
21
  .command("login")
23
22
  .description("Login with AniList")
@@ -25,7 +24,7 @@ cli
25
24
  .requiredOption("-s, --secret <string>", null)
26
25
  .action((_a) => __awaiter(void 0, [_a], void 0, function* ({ id, secret }) {
27
26
  if (id && secret) {
28
- yield anilistUserLogin(id, secret);
27
+ yield Auth.Login(id, secret);
29
28
  }
30
29
  else {
31
30
  console.log("\nMust provide both ClientId and ClientSecret!");
@@ -35,7 +34,7 @@ cli
35
34
  .command("me")
36
35
  .description("Get details of the logged in user")
37
36
  .action(() => __awaiter(void 0, void 0, void 0, function* () {
38
- yield currentUserInfo();
37
+ yield Auth.Myself();
39
38
  }));
40
39
  cli
41
40
  .command("trending")
@@ -43,7 +42,7 @@ cli
43
42
  .description("Get the trending list from AniList")
44
43
  .option("-c, --count <number>", "Number of list items to get", "10")
45
44
  .action((_a) => __awaiter(void 0, [_a], void 0, function* ({ count }) {
46
- yield getTrending(Number(count));
45
+ yield AniList.getTrendingAnime(Number(count));
47
46
  }));
48
47
  cli
49
48
  .command("popular")
@@ -51,19 +50,19 @@ cli
51
50
  .description("Get the popular list from AniList")
52
51
  .option("-c, --count <number>", "Number of list items to get", "10")
53
52
  .action((_a) => __awaiter(void 0, [_a], void 0, function* ({ count }) {
54
- yield getPopular(Number(count));
53
+ yield AniList.getPopularAnime(Number(count));
55
54
  }));
56
55
  cli
57
56
  .command("user <username>")
58
57
  .description("Get user information")
59
58
  .action((username) => __awaiter(void 0, void 0, void 0, function* () {
60
- yield getUserInfoByUsername(username);
59
+ yield AniList.getUserByUsername(username);
61
60
  }));
62
61
  cli
63
62
  .command("logout")
64
63
  .description("Log out the current user.")
65
64
  .action(() => __awaiter(void 0, void 0, void 0, function* () {
66
- yield logoutUser();
65
+ yield Auth.Logout();
67
66
  }));
68
67
  cli
69
68
  .command("lists")
@@ -76,10 +75,10 @@ cli
76
75
  console.error(`\nMust select an option, either --anime or --manga`);
77
76
  }
78
77
  else if (anime) {
79
- yield loggedInUsersAnimeLists();
78
+ yield AniList.MyAnime();
80
79
  }
81
80
  else if (manga) {
82
- yield loggedInUsersMangaLists();
81
+ yield AniList.MyManga();
83
82
  }
84
83
  }));
85
84
  cli
@@ -100,13 +99,13 @@ cli
100
99
  process.exit(1);
101
100
  }
102
101
  if (anime) {
103
- yield deleteAnimeCollection();
102
+ yield Auth.DeleteMyAnimeList();
104
103
  }
105
104
  else if (manga) {
106
- yield deleteMangaCollection();
105
+ yield Auth.DeleteMyMangaList();
107
106
  }
108
107
  else if (activity) {
109
- yield deleteUserActivities();
108
+ yield Auth.DeleteMyActivities();
110
109
  }
111
110
  }));
112
111
  cli
@@ -115,14 +114,14 @@ cli
115
114
  .description("Anime that will be released in upcoming season")
116
115
  .option("-c, --count <number>", "Number of items to get", "10")
117
116
  .action((_a) => __awaiter(void 0, [_a], void 0, function* ({ count }) {
118
- yield getUpcomingAnimes(Number(count));
117
+ yield AniList.getUpcomingAnime(Number(count));
119
118
  }));
120
119
  cli
121
120
  .command("anime <id>")
122
121
  .description("Get anime details by their ID")
123
122
  .action((id) => __awaiter(void 0, void 0, void 0, function* () {
124
123
  if (id && !Number.isNaN(Number(id))) {
125
- yield getAnimeDetailsByID(Number(id));
124
+ yield AniList.getAnimeDetailsByID(Number(id));
126
125
  }
127
126
  else {
128
127
  console.error(`\nInvalid or missing ID (${id}). Please provide a valid numeric ID.`);
@@ -142,10 +141,10 @@ cli
142
141
  }
143
142
  else {
144
143
  if (anime) {
145
- yield getAnimeSearchResults(query, Number(count));
144
+ yield AniList.searchAnime(query, Number(count));
146
145
  }
147
146
  else if (manga) {
148
- yield getMangaSearchResults(query, Number(count));
147
+ yield AniList.searchManga(query, Number(count));
149
148
  }
150
149
  else {
151
150
  console.error(`\nMust select an option, either --anime or --manga`);
@@ -158,7 +157,7 @@ cli
158
157
  .alias("write")
159
158
  .description("Write a status...")
160
159
  .action((status) => __awaiter(void 0, void 0, void 0, function* () {
161
- yield writeTextActivity(status);
160
+ yield Auth.Write(status);
162
161
  }));
163
162
  cli
164
163
  .command("export")
@@ -172,10 +171,10 @@ cli
172
171
  }
173
172
  else {
174
173
  if (anime) {
175
- yield exportAnimeList();
174
+ yield AniList.exportAnime();
176
175
  }
177
176
  else if (manga) {
178
- yield exportMangaList();
177
+ yield AniList.exportManga();
179
178
  }
180
179
  }
181
180
  }));
@@ -190,12 +189,12 @@ cli
190
189
  console.error(`\nMust select an option, either --anime or --manga`);
191
190
  }
192
191
  else {
193
- if (yield isLoggedIn()) {
192
+ if (yield Auth.isLoggedIn()) {
194
193
  if (anime) {
195
- yield importAnimeList();
194
+ yield Auth.callAnimeImporter();
196
195
  }
197
196
  else if (manga) {
198
- yield importMangaList();
197
+ yield Auth.callMangaImporter();
199
198
  }
200
199
  }
201
200
  else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@irfanshadikrishad/anilist",
3
3
  "description": "Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts",
4
4
  "author": "Irfan Shadik Rishad",
5
- "version": "1.0.7",
5
+ "version": "1.0.9",
6
6
  "main": "./bin/index.js",
7
7
  "type": "module",
8
8
  "types": "./bin/index.d.ts",
@@ -15,8 +15,10 @@
15
15
  "scripts": {
16
16
  "build": "rm -rf ./bin && tsc -w",
17
17
  "format": "prettier . --write",
18
+ "format:check": "prettier . --check",
18
19
  "lint": "eslint ./dist",
19
- "lint:fix": "eslint ./dist --fix"
20
+ "lint:fix": "eslint ./dist --fix",
21
+ "all": "npm run lint && npm run lint:fix && npm run format"
20
22
  },
21
23
  "keywords": [
22
24
  "anilist",
@@ -52,15 +54,17 @@
52
54
  "devDependencies": {
53
55
  "@eslint/js": "^9.13.0",
54
56
  "@types/json2csv": "^5.0.7",
55
- "@types/node": "^22.7.7",
57
+ "@types/node": "^22.7.9",
56
58
  "eslint": "^9.13.0",
57
59
  "globals": "^15.11.0",
58
60
  "prettier": "^3.3.3",
61
+ "prettier-plugin-organize-imports": "^4.1.0",
59
62
  "typescript": "^5.6.3",
60
63
  "typescript-eslint": "^8.11.0"
61
64
  },
62
65
  "dependencies": {
63
66
  "commander": "^12.1.0",
67
+ "fast-xml-parser": "^4.5.0",
64
68
  "inquirer": "^12.0.0",
65
69
  "json2csv": "^6.0.0-alpha.2",
66
70
  "node-fetch": "^3.3.2",
package/CHANGELOG.md DELETED
@@ -1,18 +0,0 @@
1
- #### Changelog
2
-
3
- #### v1.0.7
4
-
5
- - Optimization
6
- - Implemented linting
7
- - Implemented preetier
8
- - Implemented github-actions
9
- - No limit on delete command (previously only 50 could be deleted per-command)
10
-
11
- #### v1.0.6
12
-
13
- - Users can import/export the anime or manga list
14
-
15
- #### v1.0.4 - v1.0.5
16
-
17
- - Better error handling
18
- - Write command for writing status
@@ -1,43 +0,0 @@
1
- #### Contributor Covenant Code of Conduct
2
-
3
- #### Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- #### Our Standards
8
-
9
- Examples of behavior that contributes to creating a positive environment include:
10
-
11
- - Using welcoming and inclusive language
12
- - Being respectful of differing viewpoints and experiences
13
- - Gracefully accepting constructive criticism
14
- - Focusing on what is best for the community
15
- - Showing empathy towards other community members
16
-
17
- Examples of unacceptable behavior by participants include:
18
-
19
- - The use of sexualized language or imagery and unwelcome sexual attention or advances
20
- - Trolling, insulting/derogatory comments, and personal or political attacks
21
- - Public or private harassment
22
- - Publishing others' private information, such as a physical or electronic address, without explicit permission
23
- - Other conduct which could reasonably be considered inappropriate in a professional setting
24
-
25
- #### Our Responsibilities
26
-
27
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
-
29
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that do not align with this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project.
30
-
31
- #### Scope
32
-
33
- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
34
-
35
- #### Enforcement
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [discord](https://discordid.netlify.app/?id=1119275731021725707). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
38
-
39
- The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
40
-
41
- #### Attribution
42
-
43
- This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4.
package/CONTRIBUTING.md DELETED
@@ -1,75 +0,0 @@
1
- #### Contribution Guidelines
2
-
3
- Thank you for considering contributing to **@irfanshadikrishad/anilist**! We welcome contributions from everyone and appreciate your interest in improving the project. Please follow the guidelines below to ensure a smooth contribution process.
4
-
5
- #### How to Contribute?
6
-
7
- #### 1. Fork the Repository
8
-
9
- 1. Click the "Fork" button in the top right corner of the repository page.
10
- 2. Clone your forked repository to your local machine:
11
- ```bash
12
- git clone https://github.com/your-username/anilist.git
13
- ```
14
- 3. Navigate to the project directory:
15
- ```bash
16
- cd anilist
17
- ```
18
- 4. Set Up the Development Environment
19
-
20
- 1. Install the required dependencies:
21
-
22
- ```bash
23
- npm install
24
- ```
25
-
26
- 5. Create a New Branch
27
- Create a new branch for your feature or bug fix:
28
- ```bash
29
- git checkout -b feature/my-new-feature
30
- ```
31
- or
32
- ```bash
33
- git checkout -b fix/my-bug-fix
34
- ```
35
- 6. Make Your Changes
36
- Make your changes in the codebase. Ensure your code adheres to the project's coding standards and style guide.
37
- 7. Test Your Changes
38
- Run the tests to ensure everything works as expected:
39
- ```bash
40
- npm test
41
- ```
42
- Add new tests if you’re introducing new functionality.
43
- 8. Commit Your Changes
44
- Commit your changes with a clear and descriptive commit message:
45
- ```bash
46
- git commit -m "feature: [describe the feature]"
47
- ```
48
- or for bug fixes:
49
- ```bash
50
- git commit -m "fix: [describe the bug fix]"
51
- ```
52
- 9. Push to Your Fork
53
- Push your changes to your forked repository:
54
- ```bash
55
- git push origin feature/my-new-feature
56
- ```
57
- 10. Create a Pull Request
58
- 1. Go to the original repository where you want to submit your changes.
59
- 2. Click on the "New Pull Request" button.
60
- 3. Select your branch from the dropdown and submit the pull request.
61
- 4. Provide a clear description of the changes you made and why they are needed.
62
-
63
- #### Code of Conduct
64
-
65
- By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). We expect everyone to be respectful and considerate in their interactions.
66
-
67
- #### Additional Notes
68
-
69
- - Issues: If you encounter any issues or have feature requests, please open an issue in the repository.
70
- - Documentation: Ensure to update the documentation for any new features or changes you introduce.
71
- - Formatting: Use a linter (like ESLint) to maintain code quality. Run `npm run lint` to check your code.
72
-
73
- #### Thank You!
74
-
75
- Your contributions help make @irfanshadikrishad/anilist a better tool for everyone. We appreciate your time and effort in making this project great!
@@ -1,11 +0,0 @@
1
- declare function getUserInfoByUsername(username: string): Promise<void>;
2
- declare function getAnimeDetailsByID(anilistID: number): Promise<void>;
3
- declare function getAnimeSearchResults(search: string, count: number): Promise<void>;
4
- declare function getMangaSearchResults(search: string, count: number): Promise<void>;
5
- declare function deleteUserActivities(): Promise<void>;
6
- declare function writeTextActivity(status: string): Promise<void>;
7
- declare function exportAnimeList(): Promise<void>;
8
- declare function exportMangaList(): Promise<void>;
9
- declare function importAnimeList(): Promise<void>;
10
- declare function importMangaList(): Promise<void>;
11
- export { getUserInfoByUsername, getAnimeDetailsByID, getAnimeSearchResults, getMangaSearchResults, deleteUserActivities, writeTextActivity, exportAnimeList, exportMangaList, importAnimeList, importMangaList, };