@irfanshadikrishad/anilist 1.9.10 → 1.10.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/.husky/commit-msg +1 -0
- package/README.md +4 -0
- package/bin/helpers/auth.js +24 -22
- package/commitlint.config.js +1 -0
- package/logger.config.json +3 -0
- package/package.json +20 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no -- commitlint --edit $1
|
package/README.md
CHANGED
|
@@ -25,6 +25,10 @@ npm install -g @irfanshadikrishad/anilist
|
|
|
25
25
|
|
|
26
26
|
This will install the package globally. And you have to use commands like
|
|
27
27
|
|
|
28
|
+
> [!IMPORTANT]
|
|
29
|
+
> Recommended to use the `forbidden` version for additional options and latest updates:
|
|
30
|
+
> `npm i -g @irfanshadikrishad/anilist@forbidden`
|
|
31
|
+
|
|
28
32
|
```bash
|
|
29
33
|
anilist tr -c 15
|
|
30
34
|
```
|
package/bin/helpers/auth.js
CHANGED
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Cipher } from '@irfanshadikrishad/cipher';
|
|
11
|
+
import { Logger } from '@irfanshadikrishad/logger';
|
|
11
12
|
import fs from 'fs';
|
|
12
13
|
import inquirer from 'inquirer';
|
|
13
14
|
import open from 'open';
|
|
@@ -21,6 +22,7 @@ import { deleteActivityMutation, deleteMangaEntryMutation, deleteMediaEntryMutat
|
|
|
21
22
|
import { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, userActivityQuery, userFollowersQuery, userFollowingQuery, } from './queries.js';
|
|
22
23
|
import { responsiveOutput } from './truncate.js';
|
|
23
24
|
import { aniListEndpoint, getTitle, redirectUri, timestampToTimeAgo, } from './workers.js';
|
|
25
|
+
const log = Logger.child('auth');
|
|
24
26
|
const home_dir = os.homedir();
|
|
25
27
|
const save_path = path.join(home_dir, '.anilist_tok3n');
|
|
26
28
|
const spinner = new Spinner();
|
|
@@ -40,13 +42,13 @@ class Auth {
|
|
|
40
42
|
},
|
|
41
43
|
]);
|
|
42
44
|
if (!token) {
|
|
43
|
-
|
|
45
|
+
log.WARN('No token entered. Please try again.');
|
|
44
46
|
return null;
|
|
45
47
|
}
|
|
46
48
|
return token;
|
|
47
49
|
}
|
|
48
50
|
catch (error) {
|
|
49
|
-
|
|
51
|
+
log.ERROR(`An error occurred while getting the access token: ${error.message}`);
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
54
|
});
|
|
@@ -55,13 +57,13 @@ class Auth {
|
|
|
55
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
58
|
try {
|
|
57
59
|
if (!token) {
|
|
58
|
-
|
|
60
|
+
log.WARN('No token provided. Nothing to store.');
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
fs.writeFileSync(save_path, vigenere.encrypt(token), { encoding: 'utf8' });
|
|
62
64
|
}
|
|
63
65
|
catch (error) {
|
|
64
|
-
|
|
66
|
+
log.ERROR(`Error storing access token: ${error.message}`);
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
}
|
|
@@ -76,7 +78,7 @@ class Auth {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
catch (error) {
|
|
79
|
-
|
|
81
|
+
log.ERROR(`Error retrieving access token. ${error.message}`);
|
|
80
82
|
return null;
|
|
81
83
|
}
|
|
82
84
|
});
|
|
@@ -191,17 +193,17 @@ Statistics (Manga):
|
|
|
191
193
|
return user;
|
|
192
194
|
}
|
|
193
195
|
else {
|
|
194
|
-
|
|
196
|
+
log.ERROR(`Something went wrong. Please log in again. ${(_5 = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _5 === void 0 ? void 0 : _5.message}`);
|
|
195
197
|
return null;
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
else {
|
|
199
|
-
|
|
201
|
+
log.ERROR(`Please login first to use this feature.`);
|
|
200
202
|
return null;
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
205
|
catch (error) {
|
|
204
|
-
|
|
206
|
+
log.ERROR(`Error from Myself. ${error.message}`);
|
|
205
207
|
}
|
|
206
208
|
});
|
|
207
209
|
}
|
|
@@ -212,7 +214,7 @@ Statistics (Manga):
|
|
|
212
214
|
return token !== null;
|
|
213
215
|
}
|
|
214
216
|
catch (error) {
|
|
215
|
-
|
|
217
|
+
log.ERROR(`Error checking login status: ${error.message}`);
|
|
216
218
|
return false;
|
|
217
219
|
}
|
|
218
220
|
});
|
|
@@ -487,15 +489,15 @@ Statistics (Manga):
|
|
|
487
489
|
}
|
|
488
490
|
}
|
|
489
491
|
else {
|
|
490
|
-
|
|
492
|
+
log.ERROR('\nNo entries found.');
|
|
491
493
|
}
|
|
492
494
|
}
|
|
493
495
|
else {
|
|
494
|
-
|
|
496
|
+
log.ERROR(`\nNo manga(s) found in any list.`);
|
|
495
497
|
}
|
|
496
498
|
}
|
|
497
499
|
catch (error) {
|
|
498
|
-
|
|
500
|
+
log.ERROR(`\nError deleting manga. ${error.message}`);
|
|
499
501
|
}
|
|
500
502
|
});
|
|
501
503
|
}
|
|
@@ -510,11 +512,11 @@ Statistics (Manga):
|
|
|
510
512
|
console.log(`del ${statusMessage} ${deleted ? '✔' : '✘'}`);
|
|
511
513
|
}
|
|
512
514
|
else {
|
|
513
|
-
|
|
515
|
+
log.ERROR(`Error deleting manga. ${(_d = (_c = response === null || response === void 0 ? void 0 : response.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.message}`);
|
|
514
516
|
}
|
|
515
517
|
}
|
|
516
518
|
catch (error) {
|
|
517
|
-
|
|
519
|
+
log.ERROR(`Error deleting manga. ${id} ${error instanceof Error ? error.message : error}`);
|
|
518
520
|
}
|
|
519
521
|
});
|
|
520
522
|
}
|
|
@@ -529,7 +531,7 @@ Statistics (Manga):
|
|
|
529
531
|
status: status,
|
|
530
532
|
});
|
|
531
533
|
if (!(response === null || response === void 0 ? void 0 : response.data)) {
|
|
532
|
-
|
|
534
|
+
log.ERROR(`\nSomething went wrong.`);
|
|
533
535
|
return;
|
|
534
536
|
}
|
|
535
537
|
if (response.data.SaveTextActivity.id) {
|
|
@@ -537,7 +539,7 @@ Statistics (Manga):
|
|
|
537
539
|
}
|
|
538
540
|
}
|
|
539
541
|
catch (error) {
|
|
540
|
-
|
|
542
|
+
log.ERROR(`\n${error.message}`);
|
|
541
543
|
}
|
|
542
544
|
});
|
|
543
545
|
}
|
|
@@ -573,7 +575,7 @@ Statistics (Manga):
|
|
|
573
575
|
}
|
|
574
576
|
}
|
|
575
577
|
catch (error) {
|
|
576
|
-
|
|
578
|
+
log.ERROR(`\n${error.message}`);
|
|
577
579
|
}
|
|
578
580
|
});
|
|
579
581
|
}
|
|
@@ -605,7 +607,7 @@ Statistics (Manga):
|
|
|
605
607
|
}
|
|
606
608
|
}
|
|
607
609
|
catch (error) {
|
|
608
|
-
|
|
610
|
+
log.ERROR(`\n${error.message}`);
|
|
609
611
|
}
|
|
610
612
|
});
|
|
611
613
|
}
|
|
@@ -660,13 +662,13 @@ class Social {
|
|
|
660
662
|
}
|
|
661
663
|
}
|
|
662
664
|
catch (error) {
|
|
663
|
-
|
|
665
|
+
log.ERROR(`automate_follow_toggle_follow: ${error.message}`);
|
|
664
666
|
}
|
|
665
667
|
}
|
|
666
668
|
console.log(`\n${colorize.Green('✔')} Followed back ${followedBack} users.`);
|
|
667
669
|
}
|
|
668
670
|
catch (error) {
|
|
669
|
-
|
|
671
|
+
log.ERROR(`\nautomate_follow ${error.message}`);
|
|
670
672
|
}
|
|
671
673
|
});
|
|
672
674
|
}
|
|
@@ -719,13 +721,13 @@ class Social {
|
|
|
719
721
|
}
|
|
720
722
|
}
|
|
721
723
|
catch (error) {
|
|
722
|
-
|
|
724
|
+
log.ERROR(`unfollow_toggle_follow. ${error.message}`);
|
|
723
725
|
}
|
|
724
726
|
}
|
|
725
727
|
console.log(`\nTotal Unfollowed: ${unfollowedUsers} of ${nfmCount} users.`);
|
|
726
728
|
}
|
|
727
729
|
catch (error) {
|
|
728
|
-
|
|
730
|
+
log.ERROR(`\nautomate_unfollow: ${error.message}`);
|
|
729
731
|
}
|
|
730
732
|
});
|
|
731
733
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { extends: ['@commitlint/config-conventional'] }
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irfanshadikrishad/anilist",
|
|
3
3
|
"description": "Minimalist unofficial AniList CLI for Anime and Manga Enthusiasts",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"author": "Irfan Shadik Rishad",
|
|
4
|
+
"version": "1.10.0",
|
|
5
|
+
"author": "Irfan Shadik Rishad <hello@irfanshadikrishad.dev> (https://www.irfanshadikrishad.dev)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"all": "npm run build && npm run lint && npm run lint:fix && npm run format && npm test",
|
|
@@ -63,34 +63,37 @@
|
|
|
63
63
|
},
|
|
64
64
|
"prettier": "@irfanshadikrishad/prettier",
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@irfanshadikrishad/cipher": "^1.7.
|
|
67
|
-
"
|
|
68
|
-
"
|
|
66
|
+
"@irfanshadikrishad/cipher": "^1.7.2",
|
|
67
|
+
"@irfanshadikrishad/logger": "^0.2.1",
|
|
68
|
+
"chalk": "^6.0.1",
|
|
69
|
+
"cli-truncate": "^6.2.0",
|
|
69
70
|
"commander": "^14.0.3",
|
|
70
|
-
"fast-xml-parser": "^5.
|
|
71
|
+
"fast-xml-parser": "^5.12.1",
|
|
71
72
|
"inquirer": "^13.4.3",
|
|
72
73
|
"jsonrepair": "^3.15.0",
|
|
73
74
|
"open": "^11.0.4",
|
|
74
|
-
"papaparse": "^5.7.
|
|
75
|
+
"papaparse": "^5.7.1",
|
|
75
76
|
"tiny-spinner": "^2.0.5"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
|
-
"@babel/preset-env": "^7.29.
|
|
79
|
+
"@babel/preset-env": "^7.29.14",
|
|
80
|
+
"@commitlint/cli": "^21.2.4",
|
|
81
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
79
82
|
"@eslint/js": "^10.0.1",
|
|
80
|
-
"@irfanshadikrishad/prettier": "^1.3.
|
|
83
|
+
"@irfanshadikrishad/prettier": "^1.3.9",
|
|
81
84
|
"@types/jest": "^30.0.0",
|
|
82
|
-
"@types/node": "^25.9.
|
|
85
|
+
"@types/node": "^25.9.12",
|
|
83
86
|
"@types/papaparse": "^5.5.2",
|
|
84
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
85
|
-
"@typescript-eslint/parser": "^8.
|
|
86
|
-
"eslint": "^10.
|
|
87
|
-
"globals": "^17.
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^8.74.0",
|
|
88
|
+
"@typescript-eslint/parser": "^8.74.0",
|
|
89
|
+
"eslint": "^10.15.0",
|
|
90
|
+
"globals": "^17.14.0",
|
|
88
91
|
"husky": "^9.1.7",
|
|
89
92
|
"jest": "^30.5.2",
|
|
90
|
-
"lint-staged": "^17.
|
|
91
|
-
"prettier": "^3.
|
|
93
|
+
"lint-staged": "^17.6.2",
|
|
94
|
+
"prettier": "^3.10.1",
|
|
92
95
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
93
|
-
"ts-jest": "^29.4.
|
|
96
|
+
"ts-jest": "^29.4.15",
|
|
94
97
|
"ts-node": "^10.9.2",
|
|
95
98
|
"typescript": "^6.0.3"
|
|
96
99
|
},
|