@irfanshadikrishad/anilist 1.0.0-forbidden.5 → 1.0.0-forbidden.6

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.
@@ -19,6 +19,7 @@ import { fetcher } from "./fetcher.js";
19
19
  import { AniDB, AniList, MyAnimeList } from "./lists.js";
20
20
  import { deleteActivityMutation, likeActivityMutation, saveTextActivityMutation, } from "./mutations.js";
21
21
  import { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, deleteMangaEntryMutation, deleteMediaEntryMutation, followingActivitiesQuery, globalActivitiesQuery, specificUserActivitiesQuery, toggleFollowMutation, userActivityQuery, userFollowersQuery, userFollowingQuery, userQuery, } from "./queries.js";
22
+ import { responsiveOutput } from "./truncate.js";
22
23
  import { activityBy, aniListEndpoint, getTitle, redirectUri, timestampToTimeAgo, } from "./workers.js";
23
24
  const home_dir = os.homedir();
24
25
  const save_path = path.join(home_dir, ".anilist_token");
@@ -152,38 +153,38 @@ class Auth {
152
153
  });
153
154
  const followersCount = ((_e = (_d = (_c = req_followers === null || req_followers === void 0 ? void 0 : req_followers.data) === null || _c === void 0 ? void 0 : _c.Page) === null || _d === void 0 ? void 0 : _d.pageInfo) === null || _e === void 0 ? void 0 : _e.total) || 0;
154
155
  const followingCount = ((_h = (_g = (_f = req_following === null || req_following === void 0 ? void 0 : req_following.data) === null || _f === void 0 ? void 0 : _f.Page) === null || _g === void 0 ? void 0 : _g.pageInfo) === null || _h === void 0 ? void 0 : _h.total) || 0;
155
- console.log(`
156
- ID: ${user === null || user === void 0 ? void 0 : user.id}
157
- Name: ${user === null || user === void 0 ? void 0 : user.name}
158
- siteUrl: ${user === null || user === void 0 ? void 0 : user.siteUrl}
159
- profileColor: ${(_j = user === null || user === void 0 ? void 0 : user.options) === null || _j === void 0 ? void 0 : _j.profileColor}
160
- timeZone: ${(_k = user === null || user === void 0 ? void 0 : user.options) === null || _k === void 0 ? void 0 : _k.timezone}
161
- activityMergeTime: ${(_l = user === null || user === void 0 ? void 0 : user.options) === null || _l === void 0 ? void 0 : _l.activityMergeTime}
162
- donatorTier: ${user === null || user === void 0 ? void 0 : user.donatorTier}
163
- donatorBadge: ${user === null || user === void 0 ? void 0 : user.donatorBadge}
164
- unreadNotificationCount:${user === null || user === void 0 ? void 0 : user.unreadNotificationCount}
165
- Account Created: ${new Date((user === null || user === void 0 ? void 0 : user.createdAt) * 1000).toUTCString()}
166
- Account Updated: ${new Date((user === null || user === void 0 ? void 0 : user.updatedAt) * 1000).toUTCString()}
167
-
168
- Followers: ${followersCount}
169
- Following: ${followingCount}
170
-
171
- Statistics (Anime):
172
- Count: ${(_o = (_m = user === null || user === void 0 ? void 0 : user.statistics) === null || _m === void 0 ? void 0 : _m.anime) === null || _o === void 0 ? void 0 : _o.count}
173
- Mean Score: ${(_q = (_p = user === null || user === void 0 ? void 0 : user.statistics) === null || _p === void 0 ? void 0 : _p.anime) === null || _q === void 0 ? void 0 : _q.meanScore}
174
- Minutes Watched: ${(_s = (_r = user === null || user === void 0 ? void 0 : user.statistics) === null || _r === void 0 ? void 0 : _r.anime) === null || _s === void 0 ? void 0 : _s.minutesWatched}
175
- Episodes Watched: ${(_u = (_t = user === null || user === void 0 ? void 0 : user.statistics) === null || _t === void 0 ? void 0 : _t.anime) === null || _u === void 0 ? void 0 : _u.episodesWatched}
176
-
177
- Statistics (Manga):
178
- Count: ${(_w = (_v = user === null || user === void 0 ? void 0 : user.statistics) === null || _v === void 0 ? void 0 : _v.manga) === null || _w === void 0 ? void 0 : _w.count}
179
- Mean Score: ${(_y = (_x = user === null || user === void 0 ? void 0 : user.statistics) === null || _x === void 0 ? void 0 : _x.manga) === null || _y === void 0 ? void 0 : _y.meanScore}
180
- Chapters Read: ${(_0 = (_z = user === null || user === void 0 ? void 0 : user.statistics) === null || _z === void 0 ? void 0 : _z.manga) === null || _0 === void 0 ? void 0 : _0.chaptersRead}
181
- Volumes Read: ${(_2 = (_1 = user === null || user === void 0 ? void 0 : user.statistics) === null || _1 === void 0 ? void 0 : _1.manga) === null || _2 === void 0 ? void 0 : _2.volumesRead}
156
+ console.log(`
157
+ ID: ${user === null || user === void 0 ? void 0 : user.id}
158
+ Name: ${user === null || user === void 0 ? void 0 : user.name}
159
+ siteUrl: ${user === null || user === void 0 ? void 0 : user.siteUrl}
160
+ profileColor: ${(_j = user === null || user === void 0 ? void 0 : user.options) === null || _j === void 0 ? void 0 : _j.profileColor}
161
+ timeZone: ${(_k = user === null || user === void 0 ? void 0 : user.options) === null || _k === void 0 ? void 0 : _k.timezone}
162
+ activityMergeTime: ${(_l = user === null || user === void 0 ? void 0 : user.options) === null || _l === void 0 ? void 0 : _l.activityMergeTime}
163
+ donatorTier: ${user === null || user === void 0 ? void 0 : user.donatorTier}
164
+ donatorBadge: ${user === null || user === void 0 ? void 0 : user.donatorBadge}
165
+ unreadNotificationCount:${user === null || user === void 0 ? void 0 : user.unreadNotificationCount}
166
+ Account Created: ${new Date((user === null || user === void 0 ? void 0 : user.createdAt) * 1000).toUTCString()}
167
+ Account Updated: ${new Date((user === null || user === void 0 ? void 0 : user.updatedAt) * 1000).toUTCString()}
168
+
169
+ Followers: ${followersCount}
170
+ Following: ${followingCount}
171
+
172
+ Statistics (Anime):
173
+ Count: ${(_o = (_m = user === null || user === void 0 ? void 0 : user.statistics) === null || _m === void 0 ? void 0 : _m.anime) === null || _o === void 0 ? void 0 : _o.count}
174
+ Mean Score: ${(_q = (_p = user === null || user === void 0 ? void 0 : user.statistics) === null || _p === void 0 ? void 0 : _p.anime) === null || _q === void 0 ? void 0 : _q.meanScore}
175
+ Minutes Watched: ${(_s = (_r = user === null || user === void 0 ? void 0 : user.statistics) === null || _r === void 0 ? void 0 : _r.anime) === null || _s === void 0 ? void 0 : _s.minutesWatched}
176
+ Episodes Watched: ${(_u = (_t = user === null || user === void 0 ? void 0 : user.statistics) === null || _t === void 0 ? void 0 : _t.anime) === null || _u === void 0 ? void 0 : _u.episodesWatched}
177
+
178
+ Statistics (Manga):
179
+ Count: ${(_w = (_v = user === null || user === void 0 ? void 0 : user.statistics) === null || _v === void 0 ? void 0 : _v.manga) === null || _w === void 0 ? void 0 : _w.count}
180
+ Mean Score: ${(_y = (_x = user === null || user === void 0 ? void 0 : user.statistics) === null || _x === void 0 ? void 0 : _x.manga) === null || _y === void 0 ? void 0 : _y.meanScore}
181
+ Chapters Read: ${(_0 = (_z = user === null || user === void 0 ? void 0 : user.statistics) === null || _z === void 0 ? void 0 : _z.manga) === null || _0 === void 0 ? void 0 : _0.chaptersRead}
182
+ Volumes Read: ${(_2 = (_1 = user === null || user === void 0 ? void 0 : user.statistics) === null || _1 === void 0 ? void 0 : _1.manga) === null || _2 === void 0 ? void 0 : _2.volumesRead}
182
183
  `);
183
184
  console.log(`\nRecent Activities:`);
184
185
  if (activities.length > 0) {
185
186
  activities.map(({ status, progress, media, createdAt }) => {
186
- console.log(`${timestampToTimeAgo(createdAt)}\t${status} ${progress ? `${progress} of ` : ""}${getTitle(media === null || media === void 0 ? void 0 : media.title)}`);
187
+ responsiveOutput(`${timestampToTimeAgo(createdAt)}\t${status} ${progress ? `${progress} of ` : ""}${getTitle(media === null || media === void 0 ? void 0 : media.title)}`);
187
188
  });
188
189
  }
189
190
  return user;
@@ -596,14 +597,14 @@ Statistics (Manga):
596
597
  if (like === null || like === void 0 ? void 0 : like.data) {
597
598
  likedCount++;
598
599
  }
599
- console.info(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
600
+ responsiveOutput(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
600
601
  }
601
602
  catch (error) {
602
603
  console.error(`Activity possibly deleted. ${error.message}`);
603
604
  }
604
605
  }
605
606
  else {
606
- console.log(`🔵 ${activityBy(activ)}`);
607
+ responsiveOutput(`"🔵" ${activityBy(activ, likedCount)}`);
607
608
  }
608
609
  // avoiding rate-limit
609
610
  yield new Promise((resolve) => {
@@ -655,14 +656,14 @@ Statistics (Manga):
655
656
  });
656
657
  // const ToggleLike = like?.data?.ToggleLike
657
658
  likedCount++;
658
- console.info(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
659
+ responsiveOutput(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
659
660
  }
660
661
  catch (error) {
661
662
  console.error(`Activity possibly deleted. ${error.message}`);
662
663
  }
663
664
  }
664
665
  else {
665
- console.log(`🔵 ${activityBy(activ)}`);
666
+ responsiveOutput(`🔵 ${activityBy(activ, likedCount)}`);
666
667
  }
667
668
  // avoiding rate-limit
668
669
  yield new Promise((resolve) => {
@@ -722,14 +723,14 @@ Statistics (Manga):
722
723
  activityId: activ.id,
723
724
  });
724
725
  likedCount++;
725
- console.info(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
726
+ responsiveOutput(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, likedCount)}`);
726
727
  }
727
728
  catch (error) {
728
729
  console.error(`Activity possibly deleted. ${error.message}`);
729
730
  }
730
731
  }
731
732
  else {
732
- console.log(`🔵 ${activityBy(activ)}`);
733
+ responsiveOutput(`🔵 ${activityBy(activ, likedCount)}`);
733
734
  }
734
735
  // Avoiding rate limit
735
736
  yield new Promise((resolve) => {
@@ -808,7 +809,7 @@ Statistics (Manga):
808
809
  const like = yield fetcher(likeActivityMutation, {
809
810
  activityId: activ.id,
810
811
  });
811
- console.info(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, i + 1)}`);
812
+ responsiveOutput(`${(like === null || like === void 0 ? void 0 : like.data) ? "✅" : "❌"} ${activityBy(activ, i + 1)}`);
812
813
  if (like === null || like === void 0 ? void 0 : like.data) {
813
814
  liked++;
814
815
  }
@@ -818,7 +819,7 @@ Statistics (Manga):
818
819
  }
819
820
  }
820
821
  else {
821
- console.log(`🔵 ${activityBy(activ, i + 1)}`);
822
+ responsiveOutput(`🔵 ${activityBy(activ, i + 1)}`);
822
823
  }
823
824
  // Avoid rate-limiting
824
825
  yield new Promise((resolve) => setTimeout(resolve, 1200));
@@ -16,6 +16,7 @@ import { Auth } from "./auth.js";
16
16
  import { fetcher } from "./fetcher.js";
17
17
  import { addAnimeToListMutation, addMangaToListMutation, saveAnimeWithProgressMutation, saveMangaWithProgressMutation, } from "./mutations.js";
18
18
  import { animeDetailsQuery, animeSearchQuery, currentUserAnimeList, currentUserMangaList, malIdToAnilistAnimeId, malIdToAnilistMangaId, mangaDetailsQuery, mangaSearchQuery, popularQuery, trendingQuery, upcomingAnimesQuery, userActivityQuery, userFollowersQuery, userFollowingQuery, userQuery, } from "./queries.js";
19
+ import { responsiveOutput } from "./truncate.js";
19
20
  import { AniListMediaStatus, } from "./types.js";
20
21
  import { Validate } from "./validation.js";
21
22
  import { anidbToanilistMapper, formatDateObject, getDownloadFolderPath, getNextSeasonAndYear, getTitle, removeHtmlAndMarkdown, saveJSONasCSV, saveJSONasJSON, saveJSONasXML, selectFile, simpleDateFormat, timestampToTimeAgo, } from "./workers.js";
@@ -661,7 +662,7 @@ class AniList {
661
662
  if (activities.length > 0) {
662
663
  console.log(`\nRecent Activities:`);
663
664
  activities.forEach(({ status, progress, media, createdAt }) => {
664
- console.log(`${timestampToTimeAgo(createdAt)}\t${status} ${progress ? `${progress} of ` : ""}${getTitle(media === null || media === void 0 ? void 0 : media.title)}`);
665
+ responsiveOutput(`${timestampToTimeAgo(createdAt)}\t${status} ${progress ? `${progress} of ` : ""}${getTitle(media === null || media === void 0 ? void 0 : media.title)}`);
665
666
  });
666
667
  }
667
668
  else {
@@ -1119,7 +1120,7 @@ class AniDB {
1119
1120
  const entryId = (_b = (_a = saveResponse === null || saveResponse === void 0 ? void 0 : saveResponse.data) === null || _a === void 0 ? void 0 : _a.SaveMediaListEntry) === null || _b === void 0 ? void 0 : _b.id;
1120
1121
  if (entryId) {
1121
1122
  count++;
1122
- console.log(`[${count}]\t${entryId} ✅\t${anidbId}\t${anilistId}\t(${ownEpisodes}/${totalEpisodes})\t${status}–>${getStatus(status, ownEpisodes)}`);
1123
+ responsiveOutput(`[${count}]\t${entryId} ✅\t${anidbId}\t${anilistId}\t(${ownEpisodes}/${totalEpisodes})\t${status}–>${getStatus(status, ownEpisodes)}`);
1123
1124
  }
1124
1125
  // Rate limit each API call to avoid server overload
1125
1126
  // await new Promise((resolve) => setTimeout(resolve, 1100))
@@ -1136,9 +1137,9 @@ class AniDB {
1136
1137
  });
1137
1138
  }
1138
1139
  }
1139
- console.log(`\nAccuracy: ${(((animeList.length - missed.length) / animeList.length) * 100).toFixed(2)}%\tTotal Processed: ${iteration}\tMissed: ${missed.length}`);
1140
+ responsiveOutput(`\nAccuracy: ${(((animeList.length - missed.length) / animeList.length) * 100).toFixed(2)}%\tTotal Processed: ${iteration}\tMissed: ${missed.length}`);
1140
1141
  if (missed.length > 0) {
1141
- console.log(`Exporting missed entries to JSON file, Please add them manually.`);
1142
+ responsiveOutput(`Exporting missed entries to JSON file, Please add them manually.`);
1142
1143
  yield saveJSONasJSON(missed, "anidb-missed");
1143
1144
  }
1144
1145
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Truncate text (No line break)
3
+ * @param str - Long text to trancate
4
+ */
5
+ declare function responsiveOutput(str: string): void;
6
+ export { responsiveOutput };
@@ -0,0 +1,10 @@
1
+ import cliTruncate from "cli-truncate";
2
+ import process from "process";
3
+ /**
4
+ * Truncate text (No line break)
5
+ * @param str - Long text to trancate
6
+ */
7
+ function responsiveOutput(str) {
8
+ console.log(cliTruncate(str, process.stdout.columns - 5));
9
+ }
10
+ export { responsiveOutput };
@@ -202,49 +202,49 @@ function selectFile(fileType) {
202
202
  });
203
203
  }
204
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>
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>
228
228
  </anime>`;
229
229
  }
230
230
  function createMangaXML(malId, progress, status, chapters, title) {
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>
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>
248
248
  </manga>`;
249
249
  }
250
250
  function createAnimeListXML(mediaWithProgress) {
@@ -267,19 +267,19 @@ function createAnimeListXML(mediaWithProgress) {
267
267
  const format = anime.format ? anime.format : "";
268
268
  return createAnimeXML(malId, progress, status, episodes, title, format);
269
269
  });
270
- return `<myanimelist>
271
- <myinfo>
272
- <user_id/>
273
- <user_name>${yield Auth.MyUserName()}</user_name>
274
- <user_export_type>1</user_export_type>
275
- <user_total_anime>0</user_total_anime>
276
- <user_total_watching>0</user_total_watching>
277
- <user_total_completed>0</user_total_completed>
278
- <user_total_onhold>0</user_total_onhold>
279
- <user_total_dropped>0</user_total_dropped>
280
- <user_total_plantowatch>0</user_total_plantowatch>
281
- </myinfo>
282
- \n${xmlEntries.join("\n")}\n
270
+ return `<myanimelist>
271
+ <myinfo>
272
+ <user_id/>
273
+ <user_name>${yield Auth.MyUserName()}</user_name>
274
+ <user_export_type>1</user_export_type>
275
+ <user_total_anime>0</user_total_anime>
276
+ <user_total_watching>0</user_total_watching>
277
+ <user_total_completed>0</user_total_completed>
278
+ <user_total_onhold>0</user_total_onhold>
279
+ <user_total_dropped>0</user_total_dropped>
280
+ <user_total_plantowatch>0</user_total_plantowatch>
281
+ </myinfo>
282
+ \n${xmlEntries.join("\n")}\n
283
283
  </myanimelist>`;
284
284
  });
285
285
  }
@@ -302,19 +302,19 @@ function createMangaListXML(mediaWithProgress) {
302
302
  const status = statusMap[manga.status];
303
303
  return createMangaXML(malId, progress, status, chapters, title);
304
304
  });
305
- return `<myanimelist>
306
- <myinfo>
307
- <user_id/>
308
- <user_name>${yield Auth.MyUserName()}</user_name>
309
- <user_export_type>2</user_export_type>
310
- <user_total_manga>5</user_total_manga>
311
- <user_total_reading>1</user_total_reading>
312
- <user_total_completed>1</user_total_completed>
313
- <user_total_onhold>1</user_total_onhold>
314
- <user_total_dropped>1</user_total_dropped>
315
- <user_total_plantoread>1</user_total_plantoread>
316
- </myinfo>
317
- \n${xmlEntries.join("\n")}\n
305
+ return `<myanimelist>
306
+ <myinfo>
307
+ <user_id/>
308
+ <user_name>${yield Auth.MyUserName()}</user_name>
309
+ <user_export_type>2</user_export_type>
310
+ <user_total_manga>5</user_total_manga>
311
+ <user_total_reading>1</user_total_reading>
312
+ <user_total_completed>1</user_total_completed>
313
+ <user_total_onhold>1</user_total_onhold>
314
+ <user_total_dropped>1</user_total_dropped>
315
+ <user_total_plantoread>1</user_total_plantoread>
316
+ </myinfo>
317
+ \n${xmlEntries.join("\n")}\n
318
318
  </myanimelist>`;
319
319
  });
320
320
  }
@@ -382,22 +382,23 @@ const anidbToanilistMapper = (romanjiName, year, englishName) => __awaiter(void
382
382
  });
383
383
  function activityBy(activity, count) {
384
384
  var _a, _b, _c, _d;
385
+ const countStr = `[${count ? count : "?"}]`.padEnd(6);
385
386
  if ((_a = activity === null || activity === void 0 ? void 0 : activity.messenger) === null || _a === void 0 ? void 0 : _a.name) {
386
- return `[${count ? count : "?"}]\t${activity.messenger.name} >> messaged ${activity.recipient.name}`;
387
+ return `${countStr}${activity.messenger.name} >> messaged ${activity.recipient.name}`;
387
388
  }
388
389
  else if ((_c = (_b = activity === null || activity === void 0 ? void 0 : activity.media) === null || _b === void 0 ? void 0 : _b.title) === null || _c === void 0 ? void 0 : _c.userPreferred) {
389
390
  if (activity.progress) {
390
- return `[${count ? count : "?"}]\t${activity.user.name} >> ${activity.status} ${activity.progress} of ${activity.media.title.userPreferred}`;
391
+ return `${countStr}${activity.user.name} >> ${activity.status} ${activity.progress} of ${activity.media.title.userPreferred}`;
391
392
  }
392
393
  else {
393
- return `[${count ? count : "?"}]\t${activity.user.name} >> ${activity.status} ${activity.media.title.userPreferred}`;
394
+ return `${countStr}${activity.user.name} >> ${activity.status} ${activity.media.title.userPreferred}`;
394
395
  }
395
396
  }
396
397
  else if ((_d = activity === null || activity === void 0 ? void 0 : activity.user) === null || _d === void 0 ? void 0 : _d.name) {
397
- return `[${count ? count : "?"}]\t${activity.user.name}`;
398
+ return `${countStr}${activity.user.name}`;
398
399
  }
399
400
  else {
400
- return `[${count ? count : "?"} ???`;
401
+ return `${countStr}???`;
401
402
  }
402
403
  }
403
404
  /**
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.0-forbidden.5",
5
+ "version": "1.0.0-forbidden.6",
6
6
  "main": "./bin/index.js",
7
7
  "type": "module",
8
8
  "types": "./bin/index.d.ts",
@@ -71,6 +71,7 @@
71
71
  "typescript": "^5.7.3"
72
72
  },
73
73
  "dependencies": {
74
+ "cli-truncate": "^4.0.0",
74
75
  "commander": "^13.1.0",
75
76
  "fast-xml-parser": "^5.0.6",
76
77
  "inquirer": "^12.4.2",