@irfanshadikrishad/anilist 1.3.3-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} +115 -124
- package/README.md +266 -243
- package/bin/helpers/auth.d.ts +13 -7
- package/bin/helpers/auth.js +255 -373
- package/bin/helpers/lists.d.ts +1 -0
- package/bin/helpers/lists.js +175 -127
- package/bin/helpers/mutations.d.ts +1 -2
- package/bin/helpers/mutations.js +1 -6
- package/bin/helpers/queries.d.ts +9 -10
- package/bin/helpers/queries.js +23 -40
- package/bin/helpers/truncate.d.ts +6 -0
- package/bin/helpers/truncate.js +9 -0
- package/bin/helpers/types.d.ts +119 -68
- package/bin/helpers/validation.d.ts +29 -0
- package/bin/helpers/validation.js +117 -0
- package/bin/helpers/workers.d.ts +15 -7
- package/bin/helpers/workers.js +67 -34
- package/bin/index.js +30 -6
- package/package.json +85 -81
package/bin/index.js
CHANGED
|
@@ -10,7 +10,7 @@ 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 { Auth } from "./helpers/auth.js";
|
|
13
|
+
import { Auth, Social } from "./helpers/auth.js";
|
|
14
14
|
import { AniList } from "./helpers/lists.js";
|
|
15
15
|
import { getCurrentPackageVersion } from "./helpers/workers.js";
|
|
16
16
|
const cli = new Command();
|
|
@@ -128,6 +128,13 @@ cli
|
|
|
128
128
|
console.error(`\nInvalid or missing ID (${id}). Please provide a valid numeric ID.`);
|
|
129
129
|
}
|
|
130
130
|
}));
|
|
131
|
+
cli
|
|
132
|
+
.command("manga <id>")
|
|
133
|
+
.description("Get manga details by their ID")
|
|
134
|
+
.option("-c, --count <number>", "Number of items to get", "10")
|
|
135
|
+
.action((id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
+
yield AniList.getMangaDetailsByID(id);
|
|
137
|
+
}));
|
|
131
138
|
cli
|
|
132
139
|
.command("search <query>")
|
|
133
140
|
.alias("srch")
|
|
@@ -204,10 +211,27 @@ cli
|
|
|
204
211
|
}
|
|
205
212
|
}));
|
|
206
213
|
cli
|
|
207
|
-
.command("
|
|
208
|
-
.alias("
|
|
209
|
-
.description("
|
|
210
|
-
.
|
|
211
|
-
|
|
214
|
+
.command("social")
|
|
215
|
+
.alias("sol")
|
|
216
|
+
.description("Automate your process")
|
|
217
|
+
.option("-f, --follow", "Follow the user whos following you.", false)
|
|
218
|
+
.option("-u, --unfollow", "Unfollow the user whos not following you.", false)
|
|
219
|
+
.action((_a) => __awaiter(void 0, [_a], void 0, function* ({ follow, unfollow }) {
|
|
220
|
+
if (!follow && !unfollow) {
|
|
221
|
+
console.error(`\nMust select an option, either --follow or --unfollow`);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
if (yield Auth.isLoggedIn()) {
|
|
225
|
+
if (follow) {
|
|
226
|
+
yield Social.follow();
|
|
227
|
+
}
|
|
228
|
+
else if (unfollow) {
|
|
229
|
+
yield Social.unfollow();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
console.error(`\nPlease login to use this feature.`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
212
236
|
}));
|
|
213
237
|
cli.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,81 +1,85 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@irfanshadikrishad/anilist",
|
|
3
|
-
"description": "Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts",
|
|
4
|
-
"author": "Irfan Shadik Rishad",
|
|
5
|
-
"version": "1.
|
|
6
|
-
"main": "./bin/index.js",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"types": "./bin/index.d.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"anilist": "./bin/index.js"
|
|
11
|
-
},
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "rm -rf ./bin && tsc",
|
|
17
|
-
"
|
|
18
|
-
"format": "prettier . --write",
|
|
19
|
-
"format:check": "prettier . --check",
|
|
20
|
-
"lint": "eslint ./dist",
|
|
21
|
-
"lint:fix": "eslint ./dist --fix",
|
|
22
|
-
"all": "npm run
|
|
23
|
-
"test": "jest ./tests"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"anilist",
|
|
27
|
-
"CLI",
|
|
28
|
-
"anime",
|
|
29
|
-
"manga",
|
|
30
|
-
"anime list",
|
|
31
|
-
"manga list",
|
|
32
|
-
"anime tracker",
|
|
33
|
-
"manga tracker",
|
|
34
|
-
"anilist API",
|
|
35
|
-
"anime progress",
|
|
36
|
-
"manga progress",
|
|
37
|
-
"media list",
|
|
38
|
-
"export anime",
|
|
39
|
-
"import anime",
|
|
40
|
-
"export manga",
|
|
41
|
-
"import manga",
|
|
42
|
-
"status tracker",
|
|
43
|
-
"watchlist",
|
|
44
|
-
"reading list",
|
|
45
|
-
"graphql"
|
|
46
|
-
],
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "https://github.com/irfanshadikrishad/anilist"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/irfanshadikrishad/anilist",
|
|
52
|
-
"bugs": {
|
|
53
|
-
"url": "https://github.com/irfanshadikrishad/anilist/issues"
|
|
54
|
-
},
|
|
55
|
-
"license": "MPL-2.0",
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@babel/preset-env": "^7.26.
|
|
58
|
-
"@eslint/js": "^9.
|
|
59
|
-
"@types/jest": "^29.5.14",
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/
|
|
62
|
-
"@
|
|
63
|
-
"eslint": "^
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"prettier
|
|
68
|
-
"
|
|
69
|
-
"ts-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@irfanshadikrishad/anilist",
|
|
3
|
+
"description": "Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts",
|
|
4
|
+
"author": "Irfan Shadik Rishad",
|
|
5
|
+
"version": "1.4.0",
|
|
6
|
+
"main": "./bin/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"types": "./bin/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"anilist": "./bin/index.js"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rm -rf ./bin && tsc",
|
|
17
|
+
"build:watch": "rm -rf ./bin && tsc -w",
|
|
18
|
+
"format": "prettier . --write",
|
|
19
|
+
"format:check": "prettier . --check",
|
|
20
|
+
"lint": "eslint ./dist",
|
|
21
|
+
"lint:fix": "eslint ./dist --fix",
|
|
22
|
+
"all": "npm run lint && npm run lint:fix && npm run format && npm test",
|
|
23
|
+
"test": "jest ./tests"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"anilist",
|
|
27
|
+
"CLI",
|
|
28
|
+
"anime",
|
|
29
|
+
"manga",
|
|
30
|
+
"anime list",
|
|
31
|
+
"manga list",
|
|
32
|
+
"anime tracker",
|
|
33
|
+
"manga tracker",
|
|
34
|
+
"anilist API",
|
|
35
|
+
"anime progress",
|
|
36
|
+
"manga progress",
|
|
37
|
+
"media list",
|
|
38
|
+
"export anime",
|
|
39
|
+
"import anime",
|
|
40
|
+
"export manga",
|
|
41
|
+
"import manga",
|
|
42
|
+
"status tracker",
|
|
43
|
+
"watchlist",
|
|
44
|
+
"reading list",
|
|
45
|
+
"graphql"
|
|
46
|
+
],
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/irfanshadikrishad/anilist"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/irfanshadikrishad/anilist",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/irfanshadikrishad/anilist/issues"
|
|
54
|
+
},
|
|
55
|
+
"license": "MPL-2.0",
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@babel/preset-env": "^7.26.9",
|
|
58
|
+
"@eslint/js": "^9.21.0",
|
|
59
|
+
"@types/jest": "^29.5.14",
|
|
60
|
+
"@types/node": "^22.13.5",
|
|
61
|
+
"@types/papaparse": "^5.3.15",
|
|
62
|
+
"@types/xml2js": "^0.4.14",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
64
|
+
"eslint": "^9.21.0",
|
|
65
|
+
"globals": "^16.0.0",
|
|
66
|
+
"jest": "^29.7.0",
|
|
67
|
+
"prettier": "^3.5.2",
|
|
68
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
69
|
+
"ts-jest": "^29.2.5",
|
|
70
|
+
"ts-node": "^10.9.2",
|
|
71
|
+
"typescript": "^5.7.3"
|
|
72
|
+
},
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"cli-truncate": "^4.0.0",
|
|
75
|
+
"commander": "^13.1.0",
|
|
76
|
+
"fast-xml-parser": "^5.0.6",
|
|
77
|
+
"inquirer": "^12.4.2",
|
|
78
|
+
"jsonrepair": "^3.12.0",
|
|
79
|
+
"node-fetch": "^3.3.2",
|
|
80
|
+
"open": "^10.1.0",
|
|
81
|
+
"papaparse": "^5.5.2",
|
|
82
|
+
"tiny-spinner": "^2.0.5",
|
|
83
|
+
"xml2js": "^0.6.2"
|
|
84
|
+
}
|
|
85
|
+
}
|