@irfanshadikrishad/anilist 1.0.1-forbidden.2 → 1.0.1-forbidden.3
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 +373 -0
- package/LICENSE.md +382 -382
- package/README.md +255 -255
- package/bin/helpers/auth.d.ts +1 -1
- package/bin/helpers/auth.js +83 -59
- package/bin/helpers/lists.js +50 -26
- package/bin/helpers/mutations.js +35 -35
- package/bin/helpers/queries.js +169 -169
- package/bin/helpers/types.d.ts +70 -87
- package/bin/helpers/validation.d.ts +29 -0
- package/bin/helpers/validation.js +117 -0
- package/bin/helpers/workers.d.ts +14 -6
- package/bin/helpers/workers.js +145 -99
- package/package.json +84 -82
package/bin/helpers/queries.js
CHANGED
|
@@ -1,180 +1,180 @@
|
|
|
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
|
-
}
|
|
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 } startDate { day month year } 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 } startDate { day month year } 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
|
-
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
154
|
-
activities(userId: $userId, sort: ID_DESC) {
|
|
155
|
-
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
156
|
-
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
157
|
-
... on MessageActivity { messenger { name } id type isLiked message createdAt recipient { id name } }
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
150
|
+
const specificUserActivitiesQuery = `
|
|
151
|
+
query ($page: Int, $perPage: Int, $userId: Int) {
|
|
152
|
+
Page(page: $page, perPage: $perPage) {
|
|
153
|
+
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
154
|
+
activities(userId: $userId, sort: ID_DESC) {
|
|
155
|
+
... on TextActivity { id type isLiked createdAt user { id name } }
|
|
156
|
+
... on ListActivity { id type isLiked status progress media { title { userPreferred } } createdAt user { id name } }
|
|
157
|
+
... on MessageActivity { messenger { name } id type isLiked message createdAt recipient { id name } }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
161
|
`;
|
|
162
|
-
const userFollowingQuery = `query ($userId: Int!, $page: Int) {
|
|
163
|
-
Page (page: $page) {
|
|
164
|
-
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
165
|
-
following(userId: $userId, sort: [USERNAME]) { id name avatar { large medium } bannerImage isFollowing isFollower }
|
|
166
|
-
}
|
|
167
|
-
}
|
|
162
|
+
const userFollowingQuery = `query ($userId: Int!, $page: Int) {
|
|
163
|
+
Page (page: $page) {
|
|
164
|
+
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
165
|
+
following(userId: $userId, sort: [USERNAME]) { id name avatar { large medium } bannerImage isFollowing isFollower }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
168
|
`;
|
|
169
|
-
const userFollowersQuery = `query ($userId: Int!, $page: Int) {
|
|
170
|
-
Page (page: $page) {
|
|
171
|
-
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
172
|
-
followers(userId: $userId, sort: [USERNAME]) { id name avatar { large medium } bannerImage isFollowing isFollower }
|
|
173
|
-
}
|
|
174
|
-
}
|
|
169
|
+
const userFollowersQuery = `query ($userId: Int!, $page: Int) {
|
|
170
|
+
Page (page: $page) {
|
|
171
|
+
pageInfo { total perPage currentPage lastPage hasNextPage }
|
|
172
|
+
followers(userId: $userId, sort: [USERNAME]) { id name avatar { large medium } bannerImage isFollowing isFollower }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
175
|
`;
|
|
176
|
-
const toggleFollowMutation = `mutation ($userId: Int!) {
|
|
177
|
-
ToggleFollow(userId: $userId) { id name isFollower isFollowing }
|
|
178
|
-
}
|
|
176
|
+
const toggleFollowMutation = `mutation ($userId: Int!) {
|
|
177
|
+
ToggleFollow(userId: $userId) { id name isFollower isFollowing }
|
|
178
|
+
}
|
|
179
179
|
`;
|
|
180
180
|
export { activityAllQuery, activityAnimeListQuery, activityMangaListQuery, activityMediaList, activityMessageQuery, activityTextQuery, animeDetailsQuery, animeSearchQuery, currentUserAnimeList, currentUserMangaList, currentUserQuery, deleteMangaEntryMutation, deleteMediaEntryMutation, followingActivitiesQuery, globalActivitiesQuery, malIdToAnilistAnimeId, malIdToAnilistMangaId, mangaSearchQuery, popularQuery, specificUserActivitiesQuery, toggleFollowMutation, trendingQuery, upcomingAnimesQuery, userActivityQuery, userFollowersQuery, userFollowingQuery, userQuery, };
|
package/bin/helpers/types.d.ts
CHANGED
|
@@ -45,10 +45,7 @@ interface MalIdToAnilistIdResponse {
|
|
|
45
45
|
data?: {
|
|
46
46
|
Media: {
|
|
47
47
|
id: number;
|
|
48
|
-
title:
|
|
49
|
-
english?: string;
|
|
50
|
-
romaji?: string;
|
|
51
|
-
};
|
|
48
|
+
title: MediaTitle;
|
|
52
49
|
};
|
|
53
50
|
};
|
|
54
51
|
errors?: {
|
|
@@ -92,15 +89,13 @@ interface AnimeList {
|
|
|
92
89
|
}[];
|
|
93
90
|
}
|
|
94
91
|
interface MediaWithProgress {
|
|
95
|
-
malId
|
|
92
|
+
malId?: number;
|
|
96
93
|
progress: number;
|
|
97
94
|
status: string;
|
|
98
95
|
episodes?: number;
|
|
99
96
|
chapters?: number;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
romaji?: string;
|
|
103
|
-
};
|
|
97
|
+
format?: string;
|
|
98
|
+
title: MediaTitle;
|
|
104
99
|
}
|
|
105
100
|
interface MediaTitle {
|
|
106
101
|
english?: string;
|
|
@@ -150,10 +145,7 @@ interface List {
|
|
|
150
145
|
}
|
|
151
146
|
interface MediaList {
|
|
152
147
|
id(id: number | string): string;
|
|
153
|
-
title:
|
|
154
|
-
english?: string;
|
|
155
|
-
romaji?: string;
|
|
156
|
-
};
|
|
148
|
+
title: MediaTitle;
|
|
157
149
|
name: string;
|
|
158
150
|
entries: MediaListEntry[];
|
|
159
151
|
}
|
|
@@ -240,37 +232,13 @@ interface MediaListEntry {
|
|
|
240
232
|
episodes?: number;
|
|
241
233
|
siteUrl?: string;
|
|
242
234
|
chapters?: number;
|
|
235
|
+
format?: string;
|
|
243
236
|
};
|
|
244
237
|
progress?: number;
|
|
245
238
|
status?: string;
|
|
246
239
|
hiddenFromStatusLists?: boolean;
|
|
247
240
|
private?: boolean;
|
|
248
241
|
}
|
|
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
242
|
type UserActivitiesResponse = {
|
|
275
243
|
data?: {
|
|
276
244
|
Page: {
|
|
@@ -316,6 +284,17 @@ type UserResponse = {
|
|
|
316
284
|
message: string;
|
|
317
285
|
}[];
|
|
318
286
|
};
|
|
287
|
+
type User = {
|
|
288
|
+
id: number;
|
|
289
|
+
name: string;
|
|
290
|
+
avatar: {
|
|
291
|
+
large: string;
|
|
292
|
+
medium: string;
|
|
293
|
+
};
|
|
294
|
+
bannerImage: string;
|
|
295
|
+
isFollower: boolean;
|
|
296
|
+
isFollowing: boolean;
|
|
297
|
+
};
|
|
319
298
|
type UserFollower = {
|
|
320
299
|
data?: {
|
|
321
300
|
Page: {
|
|
@@ -333,17 +312,6 @@ type UserFollower = {
|
|
|
333
312
|
message: string;
|
|
334
313
|
}[];
|
|
335
314
|
};
|
|
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
315
|
type UserFollowing = {
|
|
348
316
|
data?: {
|
|
349
317
|
Page: {
|
|
@@ -378,43 +346,6 @@ type AnimeSearchResponse = {
|
|
|
378
346
|
message: string;
|
|
379
347
|
}[];
|
|
380
348
|
};
|
|
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
349
|
type ToggleFollowResponse = {
|
|
419
350
|
data?: {
|
|
420
351
|
ToggleFollow: {
|
|
@@ -449,4 +380,56 @@ type Activity = {
|
|
|
449
380
|
};
|
|
450
381
|
createdAt: number;
|
|
451
382
|
};
|
|
452
|
-
|
|
383
|
+
interface TheActivity {
|
|
384
|
+
type: string;
|
|
385
|
+
id: number;
|
|
386
|
+
message?: string;
|
|
387
|
+
createdAt: number;
|
|
388
|
+
recipient?: {
|
|
389
|
+
id: number;
|
|
390
|
+
name: string;
|
|
391
|
+
};
|
|
392
|
+
isLiked?: boolean;
|
|
393
|
+
user?: {
|
|
394
|
+
id?: number;
|
|
395
|
+
name?: string;
|
|
396
|
+
};
|
|
397
|
+
messenger?: {
|
|
398
|
+
name: string;
|
|
399
|
+
};
|
|
400
|
+
media?: {
|
|
401
|
+
title?: {
|
|
402
|
+
userPreferred: string;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
progress?: string | null;
|
|
406
|
+
status?: string;
|
|
407
|
+
}
|
|
408
|
+
type LikeActivityResponse = {
|
|
409
|
+
data?: {
|
|
410
|
+
ToggleLike: {
|
|
411
|
+
id: number;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
errors?: {
|
|
415
|
+
message: string;
|
|
416
|
+
}[];
|
|
417
|
+
};
|
|
418
|
+
type SpecificUserActivitiesResponse = {
|
|
419
|
+
data?: {
|
|
420
|
+
Page: {
|
|
421
|
+
pageInfo: {
|
|
422
|
+
total: number;
|
|
423
|
+
perPage: number;
|
|
424
|
+
currentPage: number;
|
|
425
|
+
lastPage: number;
|
|
426
|
+
hasNextPage: boolean;
|
|
427
|
+
};
|
|
428
|
+
activities: TheActivity[];
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
errors?: {
|
|
432
|
+
message: string;
|
|
433
|
+
}[];
|
|
434
|
+
};
|
|
435
|
+
export { Activity, AniListMediaStatus, AnimeDetails, AnimeList, AnimeSearchResponse, DateMonthYear, 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,29 @@
|
|
|
1
|
+
declare class Validate {
|
|
2
|
+
/**
|
|
3
|
+
* Validate importable JSON file
|
|
4
|
+
* @param data string
|
|
5
|
+
* @returns boolean
|
|
6
|
+
*/
|
|
7
|
+
static Import_JSON(data: {
|
|
8
|
+
id: number;
|
|
9
|
+
}[]): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Validate if MyAnimeList Anime XML file is valid or not
|
|
12
|
+
* @param xmlData string
|
|
13
|
+
* @returns boolean
|
|
14
|
+
*/
|
|
15
|
+
static Import_AnimeXML(xmlData: string): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Validate if MyAnimeList Anime XML file is valid or not
|
|
18
|
+
* @param xmlData string
|
|
19
|
+
* @returns boolean
|
|
20
|
+
*/
|
|
21
|
+
static Import_MangaXML(xmlData: string): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Validate AniDB json-large file
|
|
24
|
+
* @param file string of anidb json-large
|
|
25
|
+
* @returns boolean
|
|
26
|
+
*/
|
|
27
|
+
static Import_AniDBJSONLarge(file: string): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export { Validate };
|