@irfanshadikrishad/anilist 1.3.2-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} +373 -382
- package/README.md +79 -53
- package/bin/helpers/auth.d.ts +13 -7
- package/bin/helpers/auth.js +297 -399
- package/bin/helpers/lists.d.ts +5 -1
- package/bin/helpers/lists.js +276 -127
- package/bin/helpers/mutations.d.ts +1 -2
- package/bin/helpers/mutations.js +32 -37
- package/bin/helpers/queries.d.ts +10 -9
- package/bin/helpers/queries.js +151 -154
- package/bin/helpers/truncate.d.ts +6 -0
- package/bin/helpers/truncate.js +9 -0
- package/bin/helpers/types.d.ts +206 -36
- package/bin/helpers/validation.d.ts +29 -0
- package/bin/helpers/validation.js +117 -0
- package/bin/helpers/workers.d.ts +19 -10
- package/bin/helpers/workers.js +157 -93
- package/bin/index.js +30 -6
- package/package.json +22 -17
package/bin/helpers/workers.js
CHANGED
|
@@ -7,16 +7,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
10
21
|
import fs from "fs";
|
|
11
22
|
import { readdir, writeFile } from "fs/promises";
|
|
12
23
|
import inquirer from "inquirer";
|
|
13
|
-
import { parse } from "json2csv";
|
|
14
24
|
import { createRequire } from "module";
|
|
15
25
|
import open from "open";
|
|
16
26
|
import { homedir } from "os";
|
|
27
|
+
import Papa from "papaparse";
|
|
17
28
|
import { join } from "path";
|
|
18
29
|
import process from "process";
|
|
19
30
|
import { Auth } from "./auth.js";
|
|
31
|
+
import { fetcher } from "./fetcher.js";
|
|
32
|
+
import { animeSearchQuery } from "./queries.js";
|
|
20
33
|
import { MALAnimeStatus, MALMangaStatus, } from "./types.js";
|
|
21
34
|
const aniListEndpoint = `https://graphql.anilist.co`;
|
|
22
35
|
const redirectUri = "https://anilist.co/api/v2/oauth/pin";
|
|
@@ -95,13 +108,13 @@ function getFormattedDate() {
|
|
|
95
108
|
/**
|
|
96
109
|
* Export JSON as JSON
|
|
97
110
|
* @param js0n
|
|
98
|
-
* @param dataType (eg: anime
|
|
111
|
+
* @param dataType (eg: anime|manga)
|
|
99
112
|
*/
|
|
100
113
|
function saveJSONasJSON(js0n, dataType) {
|
|
101
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
115
|
try {
|
|
103
116
|
const jsonData = JSON.stringify(js0n, null, 2);
|
|
104
|
-
const path =
|
|
117
|
+
const path = yield saveToPath(dataType, ".json");
|
|
105
118
|
yield writeFile(path, jsonData, "utf8");
|
|
106
119
|
console.log(`\nSaved as JSON successfully.`);
|
|
107
120
|
open(getDownloadFolderPath());
|
|
@@ -114,13 +127,17 @@ function saveJSONasJSON(js0n, dataType) {
|
|
|
114
127
|
/**
|
|
115
128
|
* Export JSON as CSV
|
|
116
129
|
* @param js0n
|
|
117
|
-
* @param dataType (eg: anime
|
|
130
|
+
* @param dataType (eg: anime|manga)
|
|
118
131
|
*/
|
|
119
132
|
function saveJSONasCSV(js0n, dataType) {
|
|
120
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
134
|
try {
|
|
122
|
-
const
|
|
123
|
-
|
|
135
|
+
const js0n_WTAS = js0n.map((_a) => {
|
|
136
|
+
var { title } = _a, rest = __rest(_a, ["title"]);
|
|
137
|
+
return (Object.assign(Object.assign({}, rest), { title: getTitle(title) }));
|
|
138
|
+
});
|
|
139
|
+
const csvData = Papa.unparse(js0n_WTAS);
|
|
140
|
+
const path = yield saveToPath(dataType, ".csv");
|
|
124
141
|
yield writeFile(path, csvData, "utf8");
|
|
125
142
|
console.log(`\nSaved as CSV successfully.`);
|
|
126
143
|
open(getDownloadFolderPath());
|
|
@@ -130,6 +147,20 @@ function saveJSONasCSV(js0n, dataType) {
|
|
|
130
147
|
}
|
|
131
148
|
});
|
|
132
149
|
}
|
|
150
|
+
function saveJSONasXML(js0n, data_type) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
try {
|
|
153
|
+
const xmlContent = data_type === 0 ? createAnimeListXML(js0n) : createMangaListXML(js0n);
|
|
154
|
+
const path = yield saveToPath(data_type === 0 ? "anime" : "manga", ".xml");
|
|
155
|
+
yield writeFile(path, yield xmlContent, "utf8");
|
|
156
|
+
console.log(`\nGenerated XML for MyAnimeList.`);
|
|
157
|
+
open(getDownloadFolderPath());
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
console.error(`Error saving XML data:`, error);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
133
164
|
function listFilesInDownloadFolder() {
|
|
134
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
166
|
const downloadFolderPath = getDownloadFolderPath();
|
|
@@ -160,59 +191,60 @@ function selectFile(fileType) {
|
|
|
160
191
|
return answers.fileName;
|
|
161
192
|
}
|
|
162
193
|
else {
|
|
163
|
-
|
|
194
|
+
console.error(`\nNo importable ${fileType} file(s) found in download folder.`);
|
|
195
|
+
return null;
|
|
164
196
|
}
|
|
165
197
|
}
|
|
166
198
|
catch (error) {
|
|
167
199
|
console.error("\nError selecting file:", error);
|
|
168
|
-
|
|
200
|
+
return null;
|
|
169
201
|
}
|
|
170
202
|
});
|
|
171
203
|
}
|
|
172
|
-
function createAnimeXML(malId, progress, status, episodes, title) {
|
|
173
|
-
return `
|
|
174
|
-
<anime>
|
|
175
|
-
<series_animedb_id>${malId}</series_animedb_id>
|
|
176
|
-
<series_title><![CDATA[${title}]]></series_title>
|
|
177
|
-
<series_type
|
|
178
|
-
<series_episodes>${episodes}</series_episodes>
|
|
179
|
-
<my_id>0</my_id>
|
|
180
|
-
<my_watched_episodes>${progress}</my_watched_episodes>
|
|
181
|
-
<my_start_date>0000-00-00</my_start_date>
|
|
182
|
-
<my_finish_date>0000-00-00</my_finish_date>
|
|
183
|
-
<my_score>0</my_score>
|
|
184
|
-
<my_storage_value>0.00</my_storage_value>
|
|
185
|
-
<my_status>${status}</my_status>
|
|
186
|
-
<my_comments><![CDATA[]]></my_comments>
|
|
187
|
-
<my_times_watched>0</my_times_watched>
|
|
188
|
-
<my_rewatch_value></my_rewatch_value>
|
|
189
|
-
<my_priority>LOW</my_priority>
|
|
190
|
-
<my_tags><![CDATA[]]></my_tags>
|
|
191
|
-
<my_rewatching>0</my_rewatching>
|
|
192
|
-
<my_rewatching_ep>0</my_rewatching_ep>
|
|
193
|
-
<my_discuss>0</my_discuss>
|
|
194
|
-
<my_sns>default</my_sns>
|
|
195
|
-
<update_on_import>1</update_on_import>
|
|
204
|
+
function createAnimeXML(malId, progress, status, episodes, title, format) {
|
|
205
|
+
return `
|
|
206
|
+
<anime>
|
|
207
|
+
<series_animedb_id>${malId}</series_animedb_id>
|
|
208
|
+
<series_title><![CDATA[${title}]]></series_title>
|
|
209
|
+
<series_type>${format}</series_type>
|
|
210
|
+
<series_episodes>${episodes}</series_episodes>
|
|
211
|
+
<my_id>0</my_id>
|
|
212
|
+
<my_watched_episodes>${progress}</my_watched_episodes>
|
|
213
|
+
<my_start_date>0000-00-00</my_start_date>
|
|
214
|
+
<my_finish_date>0000-00-00</my_finish_date>
|
|
215
|
+
<my_score>0</my_score>
|
|
216
|
+
<my_storage_value>0.00</my_storage_value>
|
|
217
|
+
<my_status>${status}</my_status>
|
|
218
|
+
<my_comments><![CDATA[]]></my_comments>
|
|
219
|
+
<my_times_watched>0</my_times_watched>
|
|
220
|
+
<my_rewatch_value></my_rewatch_value>
|
|
221
|
+
<my_priority>LOW</my_priority>
|
|
222
|
+
<my_tags><![CDATA[]]></my_tags>
|
|
223
|
+
<my_rewatching>0</my_rewatching>
|
|
224
|
+
<my_rewatching_ep>0</my_rewatching_ep>
|
|
225
|
+
<my_discuss>0</my_discuss>
|
|
226
|
+
<my_sns>default</my_sns>
|
|
227
|
+
<update_on_import>1</update_on_import>
|
|
196
228
|
</anime>`;
|
|
197
229
|
}
|
|
198
230
|
function createMangaXML(malId, progress, status, chapters, title) {
|
|
199
|
-
return `
|
|
200
|
-
<manga>
|
|
201
|
-
<manga_mangadb_id>${malId}</manga_mangadb_id>
|
|
202
|
-
<manga_title><![CDATA[${title ? title : "unknown"}]]></manga_title>
|
|
203
|
-
<manga_volumes>0</manga_volumes>
|
|
204
|
-
<manga_chapters>${chapters ? chapters : 0}</manga_chapters>
|
|
205
|
-
<my_id>0</my_id>
|
|
206
|
-
<my_read_chapters>${progress}</my_read_chapters>
|
|
207
|
-
<my_start_date>0000-00-00</my_start_date>
|
|
208
|
-
<my_finish_date>0000-00-00</my_finish_date>
|
|
209
|
-
<my_score>0</my_score>
|
|
210
|
-
<my_status>${status}</my_status>
|
|
211
|
-
<my_reread_value></my_reread_value>
|
|
212
|
-
<my_priority>LOW</my_priority>
|
|
213
|
-
<my_rereading>0</my_rereading>
|
|
214
|
-
<my_discuss>0</my_discuss>
|
|
215
|
-
<update_on_import>1</update_on_import>
|
|
231
|
+
return `
|
|
232
|
+
<manga>
|
|
233
|
+
<manga_mangadb_id>${malId}</manga_mangadb_id>
|
|
234
|
+
<manga_title><![CDATA[${title ? title : "unknown"}]]></manga_title>
|
|
235
|
+
<manga_volumes>0</manga_volumes>
|
|
236
|
+
<manga_chapters>${chapters ? chapters : 0}</manga_chapters>
|
|
237
|
+
<my_id>0</my_id>
|
|
238
|
+
<my_read_chapters>${progress}</my_read_chapters>
|
|
239
|
+
<my_start_date>0000-00-00</my_start_date>
|
|
240
|
+
<my_finish_date>0000-00-00</my_finish_date>
|
|
241
|
+
<my_score>0</my_score>
|
|
242
|
+
<my_status>${status}</my_status>
|
|
243
|
+
<my_reread_value></my_reread_value>
|
|
244
|
+
<my_priority>LOW</my_priority>
|
|
245
|
+
<my_rereading>0</my_rereading>
|
|
246
|
+
<my_discuss>0</my_discuss>
|
|
247
|
+
<update_on_import>1</update_on_import>
|
|
216
248
|
</manga>`;
|
|
217
249
|
}
|
|
218
250
|
function createAnimeListXML(mediaWithProgress) {
|
|
@@ -224,27 +256,31 @@ function createAnimeListXML(mediaWithProgress) {
|
|
|
224
256
|
PAUSED: MALAnimeStatus.ON_HOLD,
|
|
225
257
|
DROPPED: MALAnimeStatus.DROPPED,
|
|
226
258
|
};
|
|
227
|
-
|
|
259
|
+
// Filter out anime without malId
|
|
260
|
+
const filteredMedia = mediaWithProgress.filter((anime) => anime.malId);
|
|
261
|
+
const xmlEntries = filteredMedia.map((anime) => {
|
|
262
|
+
console.log(anime);
|
|
228
263
|
const malId = anime.malId;
|
|
229
264
|
const progress = anime.progress;
|
|
230
265
|
const episodes = anime.episodes;
|
|
231
266
|
const title = getTitle(anime.title);
|
|
232
267
|
const status = statusMap[anime.status];
|
|
233
|
-
|
|
268
|
+
const format = anime.format ? anime.format : "";
|
|
269
|
+
return createAnimeXML(malId, progress, status, episodes, title, format);
|
|
234
270
|
});
|
|
235
|
-
return `<myanimelist>
|
|
236
|
-
<myinfo>
|
|
237
|
-
<user_id/>
|
|
238
|
-
<user_name>${yield Auth.MyUserName()}</user_name>
|
|
239
|
-
<user_export_type>1</user_export_type>
|
|
240
|
-
<user_total_anime>0</user_total_anime>
|
|
241
|
-
<user_total_watching>0</user_total_watching>
|
|
242
|
-
<user_total_completed>0</user_total_completed>
|
|
243
|
-
<user_total_onhold>0</user_total_onhold>
|
|
244
|
-
<user_total_dropped>0</user_total_dropped>
|
|
245
|
-
<user_total_plantowatch>0</user_total_plantowatch>
|
|
246
|
-
</myinfo>
|
|
247
|
-
\n${xmlEntries.join("\n")}\n
|
|
271
|
+
return `<myanimelist>
|
|
272
|
+
<myinfo>
|
|
273
|
+
<user_id/>
|
|
274
|
+
<user_name>${yield Auth.MyUserName()}</user_name>
|
|
275
|
+
<user_export_type>1</user_export_type>
|
|
276
|
+
<user_total_anime>0</user_total_anime>
|
|
277
|
+
<user_total_watching>0</user_total_watching>
|
|
278
|
+
<user_total_completed>0</user_total_completed>
|
|
279
|
+
<user_total_onhold>0</user_total_onhold>
|
|
280
|
+
<user_total_dropped>0</user_total_dropped>
|
|
281
|
+
<user_total_plantowatch>0</user_total_plantowatch>
|
|
282
|
+
</myinfo>
|
|
283
|
+
\n${xmlEntries.join("\n")}\n
|
|
248
284
|
</myanimelist>`;
|
|
249
285
|
});
|
|
250
286
|
}
|
|
@@ -257,7 +293,9 @@ function createMangaListXML(mediaWithProgress) {
|
|
|
257
293
|
PAUSED: MALMangaStatus.ON_HOLD,
|
|
258
294
|
DROPPED: MALMangaStatus.DROPPED,
|
|
259
295
|
};
|
|
260
|
-
|
|
296
|
+
// Filter out manga without malId
|
|
297
|
+
const filteredMedia = mediaWithProgress.filter((manga) => manga.malId);
|
|
298
|
+
const xmlEntries = filteredMedia.map((manga) => {
|
|
261
299
|
const malId = manga.malId;
|
|
262
300
|
const progress = manga.progress;
|
|
263
301
|
const chapters = manga.chapters;
|
|
@@ -265,19 +303,19 @@ function createMangaListXML(mediaWithProgress) {
|
|
|
265
303
|
const status = statusMap[manga.status];
|
|
266
304
|
return createMangaXML(malId, progress, status, chapters, title);
|
|
267
305
|
});
|
|
268
|
-
return `<myanimelist>
|
|
269
|
-
<myinfo>
|
|
270
|
-
<user_id/>
|
|
271
|
-
<user_name>${yield Auth.MyUserName()}</user_name>
|
|
272
|
-
<user_export_type>2</user_export_type>
|
|
273
|
-
<user_total_manga>5</user_total_manga>
|
|
274
|
-
<user_total_reading>1</user_total_reading>
|
|
275
|
-
<user_total_completed>1</user_total_completed>
|
|
276
|
-
<user_total_onhold>1</user_total_onhold>
|
|
277
|
-
<user_total_dropped>1</user_total_dropped>
|
|
278
|
-
<user_total_plantoread>1</user_total_plantoread>
|
|
279
|
-
</myinfo>
|
|
280
|
-
\n${xmlEntries.join("\n")}\n
|
|
306
|
+
return `<myanimelist>
|
|
307
|
+
<myinfo>
|
|
308
|
+
<user_id/>
|
|
309
|
+
<user_name>${yield Auth.MyUserName()}</user_name>
|
|
310
|
+
<user_export_type>2</user_export_type>
|
|
311
|
+
<user_total_manga>5</user_total_manga>
|
|
312
|
+
<user_total_reading>1</user_total_reading>
|
|
313
|
+
<user_total_completed>1</user_total_completed>
|
|
314
|
+
<user_total_onhold>1</user_total_onhold>
|
|
315
|
+
<user_total_dropped>1</user_total_dropped>
|
|
316
|
+
<user_total_plantoread>1</user_total_plantoread>
|
|
317
|
+
</myinfo>
|
|
318
|
+
\n${xmlEntries.join("\n")}\n
|
|
281
319
|
</myanimelist>`;
|
|
282
320
|
});
|
|
283
321
|
}
|
|
@@ -314,24 +352,50 @@ function timestampToTimeAgo(timestamp) {
|
|
|
314
352
|
return `${years} year${years === 1 ? "" : "s"} ago`;
|
|
315
353
|
}
|
|
316
354
|
}
|
|
317
|
-
function
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
355
|
+
const anidbToanilistMapper = (romanjiName, year, englishName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
356
|
+
const fetchAnime = (search) => __awaiter(void 0, void 0, void 0, function* () {
|
|
357
|
+
var _a;
|
|
358
|
+
try {
|
|
359
|
+
const response = yield fetcher(animeSearchQuery, {
|
|
360
|
+
search,
|
|
361
|
+
perPage: 50,
|
|
362
|
+
});
|
|
363
|
+
return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.Page.media) || [];
|
|
325
364
|
}
|
|
326
|
-
|
|
327
|
-
|
|
365
|
+
catch (error) {
|
|
366
|
+
console.error("Error fetching AniList data:", error);
|
|
367
|
+
return [];
|
|
328
368
|
}
|
|
369
|
+
});
|
|
370
|
+
// Search using romanjiName first
|
|
371
|
+
let results = yield fetchAnime(romanjiName);
|
|
372
|
+
// If no results, fallback to englishName
|
|
373
|
+
if (!results.length && englishName) {
|
|
374
|
+
results = yield fetchAnime(englishName);
|
|
329
375
|
}
|
|
330
|
-
|
|
331
|
-
|
|
376
|
+
// Match using year
|
|
377
|
+
for (const anime of results) {
|
|
378
|
+
if (anime.startDate.year === year) {
|
|
379
|
+
return anime.id;
|
|
380
|
+
}
|
|
332
381
|
}
|
|
333
|
-
|
|
334
|
-
|
|
382
|
+
return null;
|
|
383
|
+
});
|
|
384
|
+
/**
|
|
385
|
+
* Extract the save file path
|
|
386
|
+
* @param data_type - anime|manga
|
|
387
|
+
* @param file_format - save format (eg: .json|.csv)
|
|
388
|
+
* @returns string of file path
|
|
389
|
+
*/
|
|
390
|
+
function saveToPath(data_type, file_format) {
|
|
391
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
392
|
+
return join(getDownloadFolderPath(), `${yield Auth.MyUserName()}@irfanshadikrishad-anilist-${data_type}-${getFormattedDate()}.${file_format}`);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function simpleDateFormat(date) {
|
|
396
|
+
if (!date.day && !date.month && !date.year) {
|
|
397
|
+
return `null`;
|
|
335
398
|
}
|
|
399
|
+
return `${date === null || date === void 0 ? void 0 : date.day}/${date === null || date === void 0 ? void 0 : date.month}/${date === null || date === void 0 ? void 0 : date.year}`;
|
|
336
400
|
}
|
|
337
|
-
export {
|
|
401
|
+
export { anidbToanilistMapper, aniListEndpoint, createAnimeListXML, createAnimeXML, createMangaListXML, createMangaXML, formatDateObject, getCurrentPackageVersion, getDownloadFolderPath, getFormattedDate, getNextSeasonAndYear, getTitle, redirectUri, removeHtmlAndMarkdown, saveJSONasCSV, saveJSONasJSON, saveJSONasXML, saveToPath, selectFile, simpleDateFormat, timestampToTimeAgo, };
|
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
|
@@ -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.
|
|
5
|
+
"version": "1.4.0",
|
|
6
6
|
"main": "./bin/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "./bin/index.d.ts",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "rm -rf ./bin && tsc",
|
|
17
|
-
"
|
|
17
|
+
"build:watch": "rm -rf ./bin && tsc -w",
|
|
18
18
|
"format": "prettier . --write",
|
|
19
19
|
"format:check": "prettier . --check",
|
|
20
20
|
"lint": "eslint ./dist",
|
|
21
21
|
"lint:fix": "eslint ./dist --fix",
|
|
22
|
-
"all": "npm run
|
|
22
|
+
"all": "npm run lint && npm run lint:fix && npm run format && npm test",
|
|
23
23
|
"test": "jest ./tests"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
@@ -54,27 +54,32 @@
|
|
|
54
54
|
},
|
|
55
55
|
"license": "MPL-2.0",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@
|
|
57
|
+
"@babel/preset-env": "^7.26.9",
|
|
58
|
+
"@eslint/js": "^9.21.0",
|
|
58
59
|
"@types/jest": "^29.5.14",
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/
|
|
61
|
-
"
|
|
62
|
-
"
|
|
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",
|
|
63
66
|
"jest": "^29.7.0",
|
|
64
|
-
"prettier": "^3.
|
|
67
|
+
"prettier": "^3.5.2",
|
|
65
68
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
66
69
|
"ts-jest": "^29.2.5",
|
|
67
70
|
"ts-node": "^10.9.2",
|
|
68
|
-
"typescript": "^5.7.3"
|
|
69
|
-
"@babel/preset-env": "^7.26.0",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^8.19.1"
|
|
71
|
+
"typescript": "^5.7.3"
|
|
71
72
|
},
|
|
72
73
|
"dependencies": {
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
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",
|
|
77
79
|
"node-fetch": "^3.3.2",
|
|
78
|
-
"open": "^10.1.0"
|
|
80
|
+
"open": "^10.1.0",
|
|
81
|
+
"papaparse": "^5.5.2",
|
|
82
|
+
"tiny-spinner": "^2.0.5",
|
|
83
|
+
"xml2js": "^0.6.2"
|
|
79
84
|
}
|
|
80
85
|
}
|