@irfanshadikrishad/anilist 1.2.0-forbidden.1 → 1.2.3-forbidden.1
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 +382 -382
- package/README.md +240 -245
- package/bin/helpers/auth.d.ts +35 -6
- package/bin/helpers/auth.js +56 -78
- package/bin/helpers/fetcher.d.ts +1 -1
- package/bin/helpers/lists.d.ts +1 -1
- package/bin/helpers/lists.js +72 -134
- package/bin/helpers/mutations.js +35 -35
- package/bin/helpers/queries.d.ts +2 -2
- package/bin/helpers/queries.js +153 -153
- package/bin/helpers/types.d.ts +136 -8
- package/bin/helpers/workers.d.ts +4 -2
- package/bin/helpers/workers.js +100 -68
- package/bin/index.js +2 -2
- package/package.json +80 -80
- package/assets/binance.jpg +0 -0
package/bin/helpers/queries.js
CHANGED
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
const currentUserQuery = `{
|
|
2
|
-
Viewer {
|
|
3
|
-
id name about bans siteUrl options { profileColor timezone activityMergeTime }
|
|
4
|
-
donatorTier donatorBadge createdAt updatedAt unreadNotificationCount previousNames { name createdAt updatedAt }
|
|
5
|
-
moderatorRoles favourites { anime { nodes { id title { romaji english } } } manga { nodes { id title { romaji english } } } }
|
|
6
|
-
statistics { anime { count meanScore minutesWatched } manga { count chaptersRead volumesRead } }
|
|
7
|
-
mediaListOptions { scoreFormat rowOrder animeList { sectionOrder } mangaList { sectionOrder } }
|
|
8
|
-
}
|
|
9
|
-
}`;
|
|
10
|
-
const trendingQuery = `query ($page: Int, $perPage: Int) {
|
|
11
|
-
Page(page: $page, perPage: $perPage) {
|
|
12
|
-
media(sort: TRENDING_DESC, type: ANIME) { id title { romaji english } }
|
|
13
|
-
}
|
|
14
|
-
}`;
|
|
15
|
-
const popularQuery = `query ($page: Int, $perPage: Int) {
|
|
16
|
-
Page(page: $page, perPage: $perPage) {
|
|
17
|
-
media(sort: POPULARITY_DESC, type: ANIME) { id title { romaji english } }
|
|
18
|
-
}
|
|
19
|
-
}`;
|
|
20
|
-
const userQuery = `query ($username: String) {
|
|
21
|
-
User(name: $username) {
|
|
22
|
-
id name siteUrl donatorTier donatorBadge createdAt updatedAt previousNames { name createdAt updatedAt }
|
|
23
|
-
isBlocked isFollower isFollowing options { profileColor timezone activityMergeTime }
|
|
24
|
-
statistics { anime { count episodesWatched minutesWatched } manga { count chaptersRead volumesRead } }
|
|
25
|
-
}
|
|
26
|
-
}`;
|
|
27
|
-
const currentUserAnimeList = `query ($id: Int) {
|
|
28
|
-
MediaListCollection(userId: $id, type: ANIME) {
|
|
29
|
-
lists { name entries { id progress hiddenFromStatusLists status media { id idMal title { romaji english } status episodes siteUrl } } }
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
const currentUserQuery = `{
|
|
2
|
+
Viewer {
|
|
3
|
+
id name about bans siteUrl options { profileColor timezone activityMergeTime }
|
|
4
|
+
donatorTier donatorBadge createdAt updatedAt unreadNotificationCount previousNames { name createdAt updatedAt }
|
|
5
|
+
moderatorRoles favourites { anime { nodes { id title { romaji english } } } manga { nodes { id title { romaji english } } } }
|
|
6
|
+
statistics { anime { count meanScore minutesWatched episodesWatched } manga { count chaptersRead volumesRead meanScore } }
|
|
7
|
+
mediaListOptions { scoreFormat rowOrder animeList { sectionOrder } mangaList { sectionOrder } }
|
|
8
|
+
}
|
|
9
|
+
}`;
|
|
10
|
+
const trendingQuery = `query ($page: Int, $perPage: Int) {
|
|
11
|
+
Page(page: $page, perPage: $perPage) {
|
|
12
|
+
media(sort: TRENDING_DESC, type: ANIME) { id title { romaji english } }
|
|
13
|
+
}
|
|
14
|
+
}`;
|
|
15
|
+
const popularQuery = `query ($page: Int, $perPage: Int) {
|
|
16
|
+
Page(page: $page, perPage: $perPage) {
|
|
17
|
+
media(sort: POPULARITY_DESC, type: ANIME) { id title { romaji english } }
|
|
18
|
+
}
|
|
19
|
+
}`;
|
|
20
|
+
const userQuery = `query ($username: String) {
|
|
21
|
+
User(name: $username) {
|
|
22
|
+
id name siteUrl donatorTier donatorBadge createdAt updatedAt previousNames { name createdAt updatedAt }
|
|
23
|
+
isBlocked isFollower isFollowing options { profileColor timezone activityMergeTime }
|
|
24
|
+
statistics { anime { count episodesWatched minutesWatched } manga { count chaptersRead volumesRead } }
|
|
25
|
+
}
|
|
26
|
+
}`;
|
|
27
|
+
const currentUserAnimeList = `query ($id: Int) {
|
|
28
|
+
MediaListCollection(userId: $id, type: ANIME) {
|
|
29
|
+
lists { name entries { id progress hiddenFromStatusLists status media { id idMal title { romaji english } status episodes siteUrl } } }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
32
|
`;
|
|
33
|
-
const currentUserMangaList = `query ($id: Int) {
|
|
34
|
-
MediaListCollection(userId: $id, type: MANGA) {
|
|
35
|
-
lists { name entries { id progress hiddenFromStatusLists private status media { id idMal title { romaji english } status chapters } } }
|
|
36
|
-
}
|
|
37
|
-
}
|
|
33
|
+
const currentUserMangaList = `query ($id: Int) {
|
|
34
|
+
MediaListCollection(userId: $id, type: MANGA) {
|
|
35
|
+
lists { name entries { id progress hiddenFromStatusLists private status media { id idMal title { romaji english } status chapters } } }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
38
|
`;
|
|
39
|
-
const deleteMediaEntryMutation = `mutation($id: Int!) {
|
|
40
|
-
DeleteMediaListEntry(id: $id) { deleted }
|
|
41
|
-
}`;
|
|
42
|
-
const deleteMangaEntryMutation = `mutation($id: Int) {
|
|
43
|
-
DeleteMediaListEntry(id: $id) { deleted }
|
|
44
|
-
}`;
|
|
45
|
-
const upcomingAnimesQuery = `query GetNextSeasonAnime($nextSeason: MediaSeason, $nextYear: Int, $perPage: Int) {
|
|
46
|
-
Page(perPage: $perPage) {
|
|
47
|
-
media(season: $nextSeason, seasonYear: $nextYear, type: ANIME, sort: POPULARITY_DESC) {
|
|
48
|
-
id title { romaji english native userPreferred } season seasonYear startDate { year month day }
|
|
49
|
-
episodes description genres
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}`;
|
|
53
|
-
const animeDetailsQuery = `query ($id: Int) {
|
|
54
|
-
Media(id: $id) {
|
|
55
|
-
id idMal title { romaji english native userPreferred } episodes nextAiringEpisode { id }
|
|
56
|
-
duration startDate { year month day } endDate { year month day } countryOfOrigin description isAdult status season format genres siteUrl
|
|
57
|
-
stats { scoreDistribution { score amount } statusDistribution { status amount } }
|
|
58
|
-
}
|
|
59
|
-
}`;
|
|
60
|
-
const userActivityQuery = `query ($id: Int, $page: Int, $perPage: Int) {
|
|
61
|
-
Page(page: $page, perPage: $perPage) {
|
|
62
|
-
activities(userId: $id, type_in: [ANIME_LIST, MANGA_LIST], sort: ID_DESC) {
|
|
63
|
-
... on ListActivity { id status progress createdAt media { id title { romaji english } } }
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}`;
|
|
67
|
-
const animeSearchQuery = `query ($search: String, $perPage: Int) {
|
|
68
|
-
Page(perPage: $perPage) {
|
|
69
|
-
media(search: $search, type: ANIME) { id title { romaji english native userPreferred } episodes status description }
|
|
70
|
-
}
|
|
71
|
-
}`;
|
|
72
|
-
const mangaSearchQuery = `query ($search: String, $perPage: Int) {
|
|
73
|
-
Page(perPage: $perPage) {
|
|
74
|
-
media(search: $search, type: MANGA) { id title { romaji english native userPreferred } chapters status description }
|
|
75
|
-
}
|
|
76
|
-
}`;
|
|
77
|
-
const activityTextQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
78
|
-
Page(page: $page, perPage: $perPage) {
|
|
79
|
-
activities(userId: $userId, type: TEXT, sort: ID_DESC) {
|
|
80
|
-
... on TextActivity { id type text createdAt user { id name } }
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}`;
|
|
84
|
-
const activityAnimeListQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
85
|
-
Page(page: $page, perPage: $perPage) {
|
|
86
|
-
activities(userId: $userId, type: ANIME_LIST, sort: ID_DESC) {
|
|
87
|
-
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}`;
|
|
91
|
-
const activityMangaListQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
92
|
-
Page(page: $page, perPage: $perPage) {
|
|
93
|
-
activities(userId: $userId, type: MANGA_LIST, sort: ID_DESC) {
|
|
94
|
-
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}`;
|
|
98
|
-
const activityMessageQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
99
|
-
Page(page: $page, perPage: $perPage) {
|
|
100
|
-
activities(userId: $userId, type: MESSAGE, sort: ID_DESC) {
|
|
101
|
-
... on MessageActivity { id type message recipient { id name } createdAt }
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}`;
|
|
105
|
-
const activityAllQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
106
|
-
Page(page: $page, perPage: $perPage) {
|
|
107
|
-
activities(userId: $userId, sort: ID_DESC) {
|
|
108
|
-
... on TextActivity { id type text createdAt user { id name } }
|
|
109
|
-
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
110
|
-
... on MessageActivity { id type message recipient { id name } createdAt }
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}`;
|
|
114
|
-
const activityMediaList = `query ($userId: Int, $page: Int, $perPage: Int, $type: ActivityType) {
|
|
115
|
-
Page(page: $page, perPage: $perPage) {
|
|
116
|
-
pageInfo { total currentPage lastPage hasNextPage perPage }
|
|
117
|
-
activities(userId: $userId, type: $type, sort: ID_DESC) {
|
|
118
|
-
... on ListActivity { id type status progress media { id title { romaji english native } format } createdAt }
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}`;
|
|
122
|
-
const malIdToAnilistAnimeId = `query ($malId: Int) {
|
|
123
|
-
Media(idMal: $malId, type: ANIME) { id title { romaji english } } }
|
|
39
|
+
const deleteMediaEntryMutation = `mutation($id: Int!) {
|
|
40
|
+
DeleteMediaListEntry(id: $id) { deleted }
|
|
41
|
+
}`;
|
|
42
|
+
const deleteMangaEntryMutation = `mutation($id: Int) {
|
|
43
|
+
DeleteMediaListEntry(id: $id) { deleted }
|
|
44
|
+
}`;
|
|
45
|
+
const upcomingAnimesQuery = `query GetNextSeasonAnime($nextSeason: MediaSeason, $nextYear: Int, $perPage: Int) {
|
|
46
|
+
Page(perPage: $perPage) {
|
|
47
|
+
media(season: $nextSeason, seasonYear: $nextYear, type: ANIME, sort: POPULARITY_DESC) {
|
|
48
|
+
id title { romaji english native userPreferred } season seasonYear startDate { year month day }
|
|
49
|
+
episodes description genres
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}`;
|
|
53
|
+
const animeDetailsQuery = `query ($id: Int) {
|
|
54
|
+
Media(id: $id) {
|
|
55
|
+
id idMal title { romaji english native userPreferred } episodes nextAiringEpisode { id }
|
|
56
|
+
duration startDate { year month day } endDate { year month day } countryOfOrigin description isAdult status season format genres siteUrl
|
|
57
|
+
stats { scoreDistribution { score amount } statusDistribution { status amount } }
|
|
58
|
+
}
|
|
59
|
+
}`;
|
|
60
|
+
const userActivityQuery = `query ($id: Int, $page: Int, $perPage: Int) {
|
|
61
|
+
Page(page: $page, perPage: $perPage) {
|
|
62
|
+
activities(userId: $id, type_in: [ANIME_LIST, MANGA_LIST], sort: ID_DESC) {
|
|
63
|
+
... on ListActivity { id status progress createdAt media { id title { romaji english } } }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}`;
|
|
67
|
+
const animeSearchQuery = `query ($search: String, $perPage: Int) {
|
|
68
|
+
Page(perPage: $perPage) {
|
|
69
|
+
media(search: $search, type: ANIME) { id title { romaji english native userPreferred } episodes status description }
|
|
70
|
+
}
|
|
71
|
+
}`;
|
|
72
|
+
const mangaSearchQuery = `query ($search: String, $perPage: Int) {
|
|
73
|
+
Page(perPage: $perPage) {
|
|
74
|
+
media(search: $search, type: MANGA) { id title { romaji english native userPreferred } chapters status description }
|
|
75
|
+
}
|
|
76
|
+
}`;
|
|
77
|
+
const activityTextQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
78
|
+
Page(page: $page, perPage: $perPage) {
|
|
79
|
+
activities(userId: $userId, type: TEXT, sort: ID_DESC) {
|
|
80
|
+
... on TextActivity { id type text createdAt user { id name } }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}`;
|
|
84
|
+
const activityAnimeListQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
85
|
+
Page(page: $page, perPage: $perPage) {
|
|
86
|
+
activities(userId: $userId, type: ANIME_LIST, sort: ID_DESC) {
|
|
87
|
+
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}`;
|
|
91
|
+
const activityMangaListQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
92
|
+
Page(page: $page, perPage: $perPage) {
|
|
93
|
+
activities(userId: $userId, type: MANGA_LIST, sort: ID_DESC) {
|
|
94
|
+
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}`;
|
|
98
|
+
const activityMessageQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
99
|
+
Page(page: $page, perPage: $perPage) {
|
|
100
|
+
activities(userId: $userId, type: MESSAGE, sort: ID_DESC) {
|
|
101
|
+
... on MessageActivity { id type message recipient { id name } createdAt }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}`;
|
|
105
|
+
const activityAllQuery = `query ($userId: Int, $page: Int, $perPage: Int) {
|
|
106
|
+
Page(page: $page, perPage: $perPage) {
|
|
107
|
+
activities(userId: $userId, sort: ID_DESC) {
|
|
108
|
+
... on TextActivity { id type text createdAt user { id name } }
|
|
109
|
+
... on ListActivity { id type status progress createdAt media { id title { romaji english native } } }
|
|
110
|
+
... on MessageActivity { id type message recipient { id name } createdAt }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}`;
|
|
114
|
+
const activityMediaList = `query ($userId: Int, $page: Int, $perPage: Int, $type: ActivityType) {
|
|
115
|
+
Page(page: $page, perPage: $perPage) {
|
|
116
|
+
pageInfo { total currentPage lastPage hasNextPage perPage }
|
|
117
|
+
activities(userId: $userId, type: $type, sort: ID_DESC) {
|
|
118
|
+
... on ListActivity { id type status progress media { id title { romaji english native } format } createdAt }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}`;
|
|
122
|
+
const malIdToAnilistAnimeId = `query ($malId: Int) {
|
|
123
|
+
Media(idMal: $malId, type: ANIME) { id title { romaji english } } }
|
|
124
124
|
`;
|
|
125
|
-
const malIdToAnilistMangaId = `query ($malId: Int) {
|
|
126
|
-
Media(idMal: $malId, type: MANGA) { id title { romaji english } } }
|
|
125
|
+
const malIdToAnilistMangaId = `query ($malId: Int) {
|
|
126
|
+
Media(idMal: $malId, type: MANGA) { id title { romaji english } } }
|
|
127
127
|
`;
|
|
128
|
-
const followingActivitiesQuery = `
|
|
129
|
-
query ($page: Int, $perPage: Int) {
|
|
130
|
-
Page(page: $page, perPage: $perPage) {
|
|
131
|
-
activities(isFollowing: true, sort: ID_DESC) {
|
|
132
|
-
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
133
|
-
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
134
|
-
... on MessageActivity { id type isLiked message createdAt recipient { id name } }
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
128
|
+
const followingActivitiesQuery = `
|
|
129
|
+
query ($page: Int, $perPage: Int) {
|
|
130
|
+
Page(page: $page, perPage: $perPage) {
|
|
131
|
+
activities(isFollowing: true, sort: ID_DESC) {
|
|
132
|
+
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
133
|
+
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
134
|
+
... on MessageActivity { id type isLiked message createdAt recipient { id name } }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
138
|
`;
|
|
139
|
-
const globalActivitiesQuery = `
|
|
140
|
-
query ($page: Int, $perPage: Int) {
|
|
141
|
-
Page(page: $page, perPage: $perPage) {
|
|
142
|
-
activities(sort: ID_DESC) {
|
|
143
|
-
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
144
|
-
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
145
|
-
... on MessageActivity { id type isLiked message createdAt recipient { id name } }
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
139
|
+
const globalActivitiesQuery = `
|
|
140
|
+
query ($page: Int, $perPage: Int) {
|
|
141
|
+
Page(page: $page, perPage: $perPage) {
|
|
142
|
+
activities(sort: ID_DESC) {
|
|
143
|
+
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
144
|
+
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
145
|
+
... on MessageActivity { id type isLiked message createdAt recipient { id name } }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
149
|
`;
|
|
150
|
-
const specificUserActivitiesQuery = `
|
|
151
|
-
query ($page: Int, $perPage: Int, $userId: Int) {
|
|
152
|
-
Page(page: $page, perPage: $perPage) {
|
|
153
|
-
activities(userId: $userId, sort: ID_DESC) {
|
|
154
|
-
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
155
|
-
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
156
|
-
... on MessageActivity { id type isLiked message createdAt recipient { id name } }
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
150
|
+
const specificUserActivitiesQuery = `
|
|
151
|
+
query ($page: Int, $perPage: Int, $userId: Int) {
|
|
152
|
+
Page(page: $page, perPage: $perPage) {
|
|
153
|
+
activities(userId: $userId, sort: ID_DESC) {
|
|
154
|
+
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
155
|
+
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
156
|
+
... on MessageActivity { messenger { name } id type isLiked message createdAt recipient { id name } }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
160
|
`;
|
|
161
161
|
export { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, animeDetailsQuery, animeSearchQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, deleteMangaEntryMutation, deleteMediaEntryMutation, followingActivitiesQuery, globalActivitiesQuery, malIdToAnilistAnimeId, malIdToAnilistMangaId, mangaSearchQuery, popularQuery, specificUserActivitiesQuery, trendingQuery, upcomingAnimesQuery, userActivityQuery, userQuery, };
|
package/bin/helpers/types.d.ts
CHANGED
|
@@ -84,13 +84,7 @@ declare enum MALMangaStatus {
|
|
|
84
84
|
interface AnimeList {
|
|
85
85
|
data?: {
|
|
86
86
|
MediaListCollection: {
|
|
87
|
-
lists:
|
|
88
|
-
name: string;
|
|
89
|
-
entries: {
|
|
90
|
-
id: number;
|
|
91
|
-
progress: number;
|
|
92
|
-
}[];
|
|
93
|
-
}[];
|
|
87
|
+
lists: MediaList[];
|
|
94
88
|
};
|
|
95
89
|
};
|
|
96
90
|
errors?: {
|
|
@@ -108,4 +102,138 @@ interface MediaWithProgress {
|
|
|
108
102
|
romaji?: string;
|
|
109
103
|
};
|
|
110
104
|
}
|
|
111
|
-
|
|
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 List {
|
|
125
|
+
name: string;
|
|
126
|
+
entries: MediaEntry[];
|
|
127
|
+
}
|
|
128
|
+
interface MediaList {
|
|
129
|
+
id(id: number | string): string;
|
|
130
|
+
title: {
|
|
131
|
+
english?: string;
|
|
132
|
+
romaji?: string;
|
|
133
|
+
};
|
|
134
|
+
name: string;
|
|
135
|
+
entries: MediaListEntry[];
|
|
136
|
+
}
|
|
137
|
+
interface Myself {
|
|
138
|
+
data?: {
|
|
139
|
+
Viewer: {
|
|
140
|
+
id: number;
|
|
141
|
+
name: string;
|
|
142
|
+
siteUrl: string;
|
|
143
|
+
options: {
|
|
144
|
+
profileColor: string;
|
|
145
|
+
timezone: string;
|
|
146
|
+
activityMergeTime: string;
|
|
147
|
+
};
|
|
148
|
+
donatorTier: string;
|
|
149
|
+
donatorBadge: string;
|
|
150
|
+
unreadNotificationCount: number;
|
|
151
|
+
createdAt: number;
|
|
152
|
+
updatedAt: number;
|
|
153
|
+
statistics: {
|
|
154
|
+
anime: {
|
|
155
|
+
count: number;
|
|
156
|
+
meanScore: string;
|
|
157
|
+
minutesWatched: string;
|
|
158
|
+
episodesWatched: number;
|
|
159
|
+
};
|
|
160
|
+
manga: {
|
|
161
|
+
count: number;
|
|
162
|
+
meanScore: string;
|
|
163
|
+
chaptersRead: number;
|
|
164
|
+
volumesRead: number;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
errors?: {
|
|
170
|
+
message: string;
|
|
171
|
+
}[];
|
|
172
|
+
}
|
|
173
|
+
interface DateMonthYear {
|
|
174
|
+
day?: string;
|
|
175
|
+
month?: string;
|
|
176
|
+
year?: string;
|
|
177
|
+
}
|
|
178
|
+
interface AnimeDetails {
|
|
179
|
+
data?: {
|
|
180
|
+
Media: {
|
|
181
|
+
id: number;
|
|
182
|
+
title: MediaTitle;
|
|
183
|
+
description: string;
|
|
184
|
+
duration: string;
|
|
185
|
+
startDate: DateMonthYear;
|
|
186
|
+
endDate: DateMonthYear;
|
|
187
|
+
countryOfOrigin: string;
|
|
188
|
+
isAdult: boolean;
|
|
189
|
+
status: string;
|
|
190
|
+
season: string;
|
|
191
|
+
format: string;
|
|
192
|
+
genres: [string];
|
|
193
|
+
siteUrl: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
errors?: {
|
|
197
|
+
message: string;
|
|
198
|
+
}[];
|
|
199
|
+
}
|
|
200
|
+
interface MediaListEntry {
|
|
201
|
+
id?: number;
|
|
202
|
+
media: {
|
|
203
|
+
id?: number;
|
|
204
|
+
idMal?: number;
|
|
205
|
+
title?: MediaTitle;
|
|
206
|
+
episodes?: number;
|
|
207
|
+
siteUrl?: string;
|
|
208
|
+
chapters?: number;
|
|
209
|
+
};
|
|
210
|
+
progress?: number;
|
|
211
|
+
status?: string;
|
|
212
|
+
hiddenFromStatusLists?: boolean;
|
|
213
|
+
private?: boolean;
|
|
214
|
+
}
|
|
215
|
+
interface TheActivity {
|
|
216
|
+
type: string;
|
|
217
|
+
id: number;
|
|
218
|
+
message?: string;
|
|
219
|
+
createdAt: number;
|
|
220
|
+
recipient?: {
|
|
221
|
+
id: number;
|
|
222
|
+
name: string;
|
|
223
|
+
};
|
|
224
|
+
isLiked?: boolean;
|
|
225
|
+
user?: {
|
|
226
|
+
id?: number;
|
|
227
|
+
name?: string;
|
|
228
|
+
};
|
|
229
|
+
messenger?: {
|
|
230
|
+
name: string;
|
|
231
|
+
};
|
|
232
|
+
media?: {
|
|
233
|
+
title?: {
|
|
234
|
+
userPreferred: string;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
progress: string | null;
|
|
238
|
+
}
|
|
239
|
+
export { AniListMediaStatus, AnimeDetails, AnimeList, DateMonthYear, DeleteMangaResponse, List, MALAnimeStatus, MALAnimeXML, MALMangaStatus, MalIdToAnilistIdResponse, MediaEntry, MediaList, MediaListEntry, MediaTitle, MediaWithProgress, Myself, TheActivity, saveAnimeWithProgressResponse, };
|
package/bin/helpers/workers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MALAnimeStatus, MALMangaStatus, MediaWithProgress } from "./types.js";
|
|
1
|
+
import { MALAnimeStatus, MALMangaStatus, MediaWithProgress, TheActivity } from "./types.js";
|
|
2
2
|
declare const aniListEndpoint = "https://graphql.anilist.co";
|
|
3
3
|
declare const redirectUri = "https://anilist.co/api/v2/oauth/pin";
|
|
4
4
|
declare function getTitle(title: {
|
|
@@ -35,4 +35,6 @@ declare function createMangaXML(malId: number, progress: number, status: MALMang
|
|
|
35
35
|
declare function createAnimeListXML(mediaWithProgress: MediaWithProgress[]): Promise<string>;
|
|
36
36
|
declare function createMangaListXML(mediaWithProgress: MediaWithProgress[]): Promise<string>;
|
|
37
37
|
declare function getCurrentPackageVersion(): string | null;
|
|
38
|
-
|
|
38
|
+
declare function timestampToTimeAgo(timestamp: number): string;
|
|
39
|
+
declare function activityBy(activity: TheActivity): string;
|
|
40
|
+
export { activityBy, aniListEndpoint, createAnimeListXML, createAnimeXML, createMangaListXML, createMangaXML, formatDateObject, getCurrentPackageVersion, getDownloadFolderPath, getFormattedDate, getNextSeasonAndYear, getTitle, redirectUri, removeHtmlAndMarkdown, saveJSONasCSV, saveJSONasJSON, selectFile, timestampToTimeAgo, };
|