@irfanshadikrishad/anilist 1.0.0 → 1.0.1-forbidden.2

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.
@@ -0,0 +1,452 @@
1
+ interface DeleteMangaResponse {
2
+ data?: {
3
+ DeleteMediaListEntry?: {
4
+ deleted?: boolean;
5
+ };
6
+ };
7
+ errors?: {
8
+ message: string;
9
+ }[];
10
+ }
11
+ declare enum AniListMediaStatus {
12
+ CURRENT = "CURRENT",
13
+ PLANNING = "PLANNING",
14
+ COMPLETED = "COMPLETED",
15
+ DROPPED = "DROPPED",
16
+ PAUSED = "PAUSED",
17
+ REPEATING = "REPEATING"
18
+ }
19
+ interface MALAnimeXML {
20
+ series_animedb_id: number;
21
+ series_title: string;
22
+ series_type: string;
23
+ series_episodes: number;
24
+ my_id: number;
25
+ my_watched_episodes: number;
26
+ my_start_date: string;
27
+ my_finish_date: string;
28
+ my_rated: string;
29
+ my_score: number;
30
+ my_storage: string;
31
+ my_storage_value: number;
32
+ my_status: string;
33
+ my_comments: string;
34
+ my_times_watched: number;
35
+ my_rewatch_value: string;
36
+ my_priority: string;
37
+ my_tags: string;
38
+ my_rewatching: number;
39
+ my_rewatching_ep: number;
40
+ my_discuss: number;
41
+ my_sns: string;
42
+ update_on_import: number;
43
+ }
44
+ interface MalIdToAnilistIdResponse {
45
+ data?: {
46
+ Media: {
47
+ id: number;
48
+ title: {
49
+ english?: string;
50
+ romaji?: string;
51
+ };
52
+ };
53
+ };
54
+ errors?: {
55
+ message: string;
56
+ }[];
57
+ }
58
+ interface saveAnimeWithProgressResponse {
59
+ data?: {
60
+ SaveMediaListEntry: {
61
+ id: number;
62
+ progress: number;
63
+ hiddenFromStatusLists: boolean;
64
+ };
65
+ };
66
+ errors?: {
67
+ message: string;
68
+ }[];
69
+ }
70
+ declare enum MALAnimeStatus {
71
+ ON_HOLD = "On-Hold",
72
+ DROPPED = "Dropped",
73
+ COMPLETED = "Completed",
74
+ WATCHING = "Watching",
75
+ PLAN_TO_WATCH = "Plan to Watch"
76
+ }
77
+ declare enum MALMangaStatus {
78
+ ON_HOLD = "On-Hold",
79
+ DROPPED = "Dropped",
80
+ COMPLETED = "Completed",
81
+ READING = "Reading",
82
+ PLAN_TO_READ = "Plan to Read"
83
+ }
84
+ interface AnimeList {
85
+ data?: {
86
+ MediaListCollection: {
87
+ lists: MediaList[];
88
+ };
89
+ };
90
+ errors?: {
91
+ message: string;
92
+ }[];
93
+ }
94
+ interface MediaWithProgress {
95
+ malId: number;
96
+ progress: number;
97
+ status: string;
98
+ episodes?: number;
99
+ chapters?: number;
100
+ title: {
101
+ english?: string;
102
+ romaji?: string;
103
+ };
104
+ }
105
+ interface MediaTitle {
106
+ english?: string;
107
+ romaji?: string;
108
+ native?: string;
109
+ userPreferred?: string;
110
+ }
111
+ interface Media {
112
+ id: number;
113
+ idMal?: number;
114
+ title: MediaTitle;
115
+ chapters?: number;
116
+ }
117
+ interface MediaEntry {
118
+ media: Media;
119
+ private: boolean;
120
+ progress: number;
121
+ status: string;
122
+ hiddenFromStatusLists: boolean;
123
+ }
124
+ interface SaveTextActivityResponse {
125
+ data?: {
126
+ SaveTextActivity: {
127
+ id: number;
128
+ userId: number;
129
+ text: string;
130
+ createdAt: number;
131
+ };
132
+ };
133
+ errors?: {
134
+ message: string;
135
+ }[];
136
+ }
137
+ interface MediaListCollectionResponse {
138
+ data?: {
139
+ MediaListCollection: {
140
+ lists: MediaList[];
141
+ };
142
+ };
143
+ errors?: {
144
+ message: string;
145
+ }[];
146
+ }
147
+ interface List {
148
+ name: string;
149
+ entries: MediaEntry[];
150
+ }
151
+ interface MediaList {
152
+ id(id: number | string): string;
153
+ title: {
154
+ english?: string;
155
+ romaji?: string;
156
+ };
157
+ name: string;
158
+ entries: MediaListEntry[];
159
+ }
160
+ interface Myself {
161
+ data?: {
162
+ Viewer: {
163
+ id: number;
164
+ name: string;
165
+ siteUrl: string;
166
+ options: {
167
+ profileColor: string;
168
+ timezone: string;
169
+ activityMergeTime: string;
170
+ };
171
+ donatorTier: string;
172
+ donatorBadge: string;
173
+ unreadNotificationCount: number;
174
+ createdAt: number;
175
+ updatedAt: number;
176
+ statistics: {
177
+ anime: {
178
+ count: number;
179
+ meanScore: string;
180
+ minutesWatched: string;
181
+ episodesWatched: number;
182
+ };
183
+ manga: {
184
+ count: number;
185
+ meanScore: string;
186
+ chaptersRead: number;
187
+ volumesRead: number;
188
+ };
189
+ };
190
+ };
191
+ };
192
+ errors?: {
193
+ message: string;
194
+ }[];
195
+ }
196
+ interface DateMonthYear {
197
+ day?: number;
198
+ month?: number;
199
+ year?: number;
200
+ }
201
+ interface AnimeDetails {
202
+ data?: {
203
+ Media: {
204
+ id: number;
205
+ title: MediaTitle;
206
+ description: string;
207
+ duration: string;
208
+ startDate: DateMonthYear;
209
+ endDate: DateMonthYear;
210
+ countryOfOrigin: string;
211
+ isAdult: boolean;
212
+ status: string;
213
+ season: string;
214
+ format: string;
215
+ genres: [string];
216
+ siteUrl: string;
217
+ };
218
+ };
219
+ errors?: {
220
+ message: string;
221
+ }[];
222
+ }
223
+ interface SaveMediaListEntryResponse {
224
+ data?: {
225
+ SaveMediaListEntry: {
226
+ id: number;
227
+ status: string;
228
+ };
229
+ };
230
+ errors?: {
231
+ message: string;
232
+ }[];
233
+ }
234
+ interface MediaListEntry {
235
+ id?: number;
236
+ media: {
237
+ id?: number;
238
+ idMal?: number;
239
+ title?: MediaTitle;
240
+ episodes?: number;
241
+ siteUrl?: string;
242
+ chapters?: number;
243
+ };
244
+ progress?: number;
245
+ status?: string;
246
+ hiddenFromStatusLists?: boolean;
247
+ private?: boolean;
248
+ }
249
+ interface TheActivity {
250
+ type: string;
251
+ id: number;
252
+ message?: string;
253
+ createdAt: number;
254
+ recipient?: {
255
+ id: number;
256
+ name: string;
257
+ };
258
+ isLiked?: boolean;
259
+ user?: {
260
+ id?: number;
261
+ name?: string;
262
+ };
263
+ messenger?: {
264
+ name: string;
265
+ };
266
+ media?: {
267
+ title?: {
268
+ userPreferred: string;
269
+ };
270
+ };
271
+ progress?: string | null;
272
+ status?: string;
273
+ }
274
+ type UserActivitiesResponse = {
275
+ data?: {
276
+ Page: {
277
+ activities: Activity[];
278
+ };
279
+ };
280
+ errors?: {
281
+ message: string;
282
+ }[];
283
+ };
284
+ type UserResponse = {
285
+ data?: {
286
+ User: {
287
+ id: number;
288
+ name: string;
289
+ siteUrl: string;
290
+ donatorTier: string;
291
+ donatorBadge: string;
292
+ createdAt: number;
293
+ updatedAt: number;
294
+ isBlocked: boolean;
295
+ isFollower: boolean;
296
+ isFollowing: boolean;
297
+ options: {
298
+ profileColor: string;
299
+ timezone: string;
300
+ };
301
+ statistics: {
302
+ anime: {
303
+ count: number;
304
+ episodesWatched: number;
305
+ minutesWatched: number;
306
+ };
307
+ manga: {
308
+ count: number;
309
+ chaptersRead: number;
310
+ volumesRead: number;
311
+ };
312
+ };
313
+ };
314
+ };
315
+ errors?: {
316
+ message: string;
317
+ }[];
318
+ };
319
+ type UserFollower = {
320
+ data?: {
321
+ Page: {
322
+ pageInfo: {
323
+ total: number;
324
+ perPage: number;
325
+ currentPage: number;
326
+ lastPage: number;
327
+ hasNextPage: boolean;
328
+ };
329
+ followers: User[];
330
+ };
331
+ };
332
+ errors?: {
333
+ message: string;
334
+ }[];
335
+ };
336
+ type User = {
337
+ id: number;
338
+ name: string;
339
+ avatar: {
340
+ large: string;
341
+ medium: string;
342
+ };
343
+ bannerImage: string;
344
+ isFollower: boolean;
345
+ isFollowing: boolean;
346
+ };
347
+ type UserFollowing = {
348
+ data?: {
349
+ Page: {
350
+ pageInfo: {
351
+ total: number;
352
+ perPage: number;
353
+ currentPage: number;
354
+ lastPage: number;
355
+ hasNextPage: boolean;
356
+ };
357
+ following: User[];
358
+ };
359
+ };
360
+ errors?: {
361
+ message: string;
362
+ }[];
363
+ };
364
+ type AnimeSearchResponse = {
365
+ data?: {
366
+ Page: {
367
+ media: {
368
+ id: number;
369
+ title: MediaTitle;
370
+ startDate: DateMonthYear;
371
+ episodes: number;
372
+ status: string;
373
+ description: string;
374
+ }[];
375
+ };
376
+ };
377
+ errors?: {
378
+ message: string;
379
+ }[];
380
+ };
381
+ type LikeActivityResponse = {
382
+ data?: {
383
+ ToggleLike: {
384
+ id: number;
385
+ };
386
+ };
387
+ errors?: {
388
+ message: string;
389
+ }[];
390
+ };
391
+ type SpecificUserActivitiesResponse = {
392
+ data?: {
393
+ Page: {
394
+ pageInfo: {
395
+ total: number;
396
+ perPage: number;
397
+ currentPage: number;
398
+ lastPage: number;
399
+ hasNextPage: boolean;
400
+ };
401
+ activities: TheActivity[];
402
+ };
403
+ };
404
+ errors?: {
405
+ message: string;
406
+ }[];
407
+ };
408
+ type DeleteActivityResponse = {
409
+ data?: {
410
+ DeleteMediaListEntry: {
411
+ deleted: boolean;
412
+ };
413
+ };
414
+ errors?: {
415
+ message: string;
416
+ }[];
417
+ };
418
+ type ToggleFollowResponse = {
419
+ data?: {
420
+ ToggleFollow: {
421
+ id: number;
422
+ name: string;
423
+ isFollower: boolean;
424
+ isFollowing: boolean;
425
+ };
426
+ };
427
+ errors?: {
428
+ message: string;
429
+ }[];
430
+ };
431
+ type DeleteMediaListResponse = {
432
+ data?: {
433
+ DeleteMediaListEntry: {
434
+ deleted: boolean;
435
+ };
436
+ };
437
+ errors?: {
438
+ message: string;
439
+ }[];
440
+ };
441
+ type Activity = {
442
+ id: number;
443
+ type: string;
444
+ status: string;
445
+ progress: number | null;
446
+ media: {
447
+ id?: number;
448
+ title: MediaTitle;
449
+ };
450
+ createdAt: number;
451
+ };
452
+ export { Activity, AniListMediaStatus, AnimeDetails, AnimeList, AnimeSearchResponse, DateMonthYear, DeleteActivityResponse, DeleteMangaResponse, DeleteMediaListResponse, LikeActivityResponse, List, MALAnimeStatus, MALAnimeXML, MALMangaStatus, MalIdToAnilistIdResponse, MediaEntry, MediaList, MediaListCollectionResponse, MediaListEntry, MediaTitle, MediaWithProgress, Myself, SaveMediaListEntryResponse, SaveTextActivityResponse, SpecificUserActivitiesResponse, TheActivity, ToggleFollowResponse, User, UserActivitiesResponse, UserFollower, UserFollowing, UserResponse, saveAnimeWithProgressResponse, };
@@ -0,0 +1,26 @@
1
+ var AniListMediaStatus;
2
+ (function (AniListMediaStatus) {
3
+ AniListMediaStatus["CURRENT"] = "CURRENT";
4
+ AniListMediaStatus["PLANNING"] = "PLANNING";
5
+ AniListMediaStatus["COMPLETED"] = "COMPLETED";
6
+ AniListMediaStatus["DROPPED"] = "DROPPED";
7
+ AniListMediaStatus["PAUSED"] = "PAUSED";
8
+ AniListMediaStatus["REPEATING"] = "REPEATING";
9
+ })(AniListMediaStatus || (AniListMediaStatus = {}));
10
+ var MALAnimeStatus;
11
+ (function (MALAnimeStatus) {
12
+ MALAnimeStatus["ON_HOLD"] = "On-Hold";
13
+ MALAnimeStatus["DROPPED"] = "Dropped";
14
+ MALAnimeStatus["COMPLETED"] = "Completed";
15
+ MALAnimeStatus["WATCHING"] = "Watching";
16
+ MALAnimeStatus["PLAN_TO_WATCH"] = "Plan to Watch";
17
+ })(MALAnimeStatus || (MALAnimeStatus = {}));
18
+ var MALMangaStatus;
19
+ (function (MALMangaStatus) {
20
+ MALMangaStatus["ON_HOLD"] = "On-Hold";
21
+ MALMangaStatus["DROPPED"] = "Dropped";
22
+ MALMangaStatus["COMPLETED"] = "Completed";
23
+ MALMangaStatus["READING"] = "Reading";
24
+ MALMangaStatus["PLAN_TO_READ"] = "Plan to Read";
25
+ })(MALMangaStatus || (MALMangaStatus = {}));
26
+ export { AniListMediaStatus, MALAnimeStatus, MALMangaStatus, };
@@ -1,7 +1,41 @@
1
+ import { MALAnimeStatus, MALMangaStatus, MediaWithProgress, TheActivity } from "./types.js";
1
2
  declare const aniListEndpoint = "https://graphql.anilist.co";
2
3
  declare const redirectUri = "https://anilist.co/api/v2/oauth/pin";
3
4
  declare function getTitle(title: {
4
5
  english?: string;
5
6
  romaji?: string;
6
7
  }): string;
7
- export { aniListEndpoint, redirectUri, getTitle };
8
+ declare function formatDateObject(dateObj: {
9
+ day?: number;
10
+ month?: number;
11
+ year?: number;
12
+ } | null): string;
13
+ declare function getNextSeasonAndYear(): {
14
+ nextSeason: string;
15
+ nextYear: number;
16
+ };
17
+ declare function removeHtmlAndMarkdown(input: string): string;
18
+ declare function getDownloadFolderPath(): string;
19
+ declare function getFormattedDate(): string;
20
+ /**
21
+ * Export JSON as JSON
22
+ * @param js0n
23
+ * @param dataType (eg: anime/manga)
24
+ */
25
+ declare function saveJSONasJSON(js0n: object, dataType: string): Promise<void>;
26
+ /**
27
+ * Export JSON as CSV
28
+ * @param js0n
29
+ * @param dataType (eg: anime/manga)
30
+ */
31
+ declare function saveJSONasCSV(js0n: object, dataType: string): Promise<void>;
32
+ declare function selectFile(fileType: string): Promise<string>;
33
+ declare function createAnimeXML(malId: number, progress: number, status: MALAnimeStatus, episodes: number, title: string): string;
34
+ declare function createMangaXML(malId: number, progress: number, status: MALMangaStatus, chapters: number, title: string): string;
35
+ declare function createAnimeListXML(mediaWithProgress: MediaWithProgress[]): Promise<string>;
36
+ declare function createMangaListXML(mediaWithProgress: MediaWithProgress[]): Promise<string>;
37
+ declare function getCurrentPackageVersion(): string | null;
38
+ declare function timestampToTimeAgo(timestamp: number): string;
39
+ declare function activityBy(activity: TheActivity): string;
40
+ declare const anidbToanilistMapper: (romanjiName: string, year: number, englishName?: string) => Promise<number | null>;
41
+ export { activityBy, anidbToanilistMapper, aniListEndpoint, createAnimeListXML, createAnimeXML, createMangaListXML, createMangaXML, formatDateObject, getCurrentPackageVersion, getDownloadFolderPath, getFormattedDate, getNextSeasonAndYear, getTitle, redirectUri, removeHtmlAndMarkdown, saveJSONasCSV, saveJSONasJSON, selectFile, timestampToTimeAgo, };