anilink-api-wrapper 1.16.0 → 1.17.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.
Files changed (65) hide show
  1. package/dist/AniLink.js +41 -35
  2. package/dist/apis/anilist/interfaces/Notification.js +2 -0
  3. package/dist/apis/anilist/interfaces/Stats.js +1 -1
  4. package/dist/apis/anilist/interfaces/responses/MediaTag.js +1 -1
  5. package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +14 -0
  6. package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +2 -0
  7. package/dist/apis/anilist/interfaces/responses/query/Character.js +30 -0
  8. package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +2 -0
  9. package/dist/apis/anilist/interfaces/responses/query/Media.js +210 -0
  10. package/dist/apis/anilist/interfaces/responses/query/MediaList.js +32 -0
  11. package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +41 -0
  12. package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +2 -0
  13. package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +17 -0
  14. package/dist/apis/anilist/interfaces/responses/query/Notification.js +164 -0
  15. package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +19 -0
  16. package/dist/apis/anilist/interfaces/responses/query/Review.js +26 -0
  17. package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +27 -0
  18. package/dist/apis/anilist/interfaces/responses/query/Staff.js +55 -0
  19. package/dist/apis/anilist/interfaces/responses/query/Studio.js +56 -0
  20. package/dist/apis/anilist/interfaces/responses/query/Thread.js +40 -0
  21. package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +27 -0
  22. package/dist/apis/anilist/interfaces/responses/query/User.js +362 -0
  23. package/dist/apis/anilist/mutation/SaveMediaListEntry.js +53 -0
  24. package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +51 -0
  25. package/dist/apis/anilist/mutation/UpdateUser.js +52 -52
  26. package/dist/apis/anilist/query/AiringSchedule.js +1 -1
  27. package/dist/apis/anilist/query/Character.js +1 -1
  28. package/dist/apis/anilist/query/Follower.js +1 -1
  29. package/dist/apis/anilist/query/Following.js +1 -1
  30. package/dist/apis/anilist/query/Like.js +46 -21
  31. package/dist/apis/anilist/query/Media.js +1 -1
  32. package/dist/apis/anilist/query/MediaList.js +1 -1
  33. package/dist/apis/anilist/query/MediaListCollection.js +1 -1
  34. package/dist/apis/anilist/query/MediaTrend.js +1 -1
  35. package/dist/apis/anilist/query/Notification.js +1 -1
  36. package/dist/apis/anilist/query/Recommendation.js +1 -1
  37. package/dist/apis/anilist/query/Review.js +1 -1
  38. package/dist/apis/anilist/query/SiteStatistics.js +1 -1
  39. package/dist/apis/anilist/query/Staff.js +1 -1
  40. package/dist/apis/anilist/query/Studio.js +1 -1
  41. package/dist/apis/anilist/query/Thread.js +1 -1
  42. package/dist/apis/anilist/query/ThreadComment.js +1 -1
  43. package/dist/apis/anilist/query/User.js +1 -1
  44. package/dist/apis/anilist/query/Viewer.js +1 -1
  45. package/dist/apis/anilist/query/page/AiringSchedules.js +1 -1
  46. package/dist/apis/anilist/query/page/Characters.js +1 -1
  47. package/dist/apis/anilist/query/page/Followers.js +1 -1
  48. package/dist/apis/anilist/query/page/Followings.js +1 -1
  49. package/dist/apis/anilist/query/page/MediaLists.js +1 -1
  50. package/dist/apis/anilist/query/page/MediaTrends.js +1 -1
  51. package/dist/apis/anilist/query/page/Medias.js +1 -1
  52. package/dist/apis/anilist/query/page/Notifications.js +1 -1
  53. package/dist/apis/anilist/query/page/Recommendations.js +1 -1
  54. package/dist/apis/anilist/query/page/Reviews.js +1 -1
  55. package/dist/apis/anilist/query/page/Staffs.js +1 -1
  56. package/dist/apis/anilist/query/page/Studios.js +1 -1
  57. package/dist/apis/anilist/query/page/ThreadCommments.js +1 -1
  58. package/dist/apis/anilist/query/page/Threads.js +1 -1
  59. package/dist/apis/anilist/query/page/Users.js +1 -1
  60. package/dist/apis/anilist/types/MediaListStatus.js +2 -0
  61. package/dist/apis/anilist/types/ScoreFormat.js +2 -0
  62. package/dist/apis/anilist/types/UserStaffNameLanguage.js +2 -0
  63. package/dist/apis/anilist/types/UserTitleLanguage.js +2 -0
  64. package/dist/base/RequestHandler.js +26 -7
  65. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReviewSchema = void 0;
4
+ const BasicUser_1 = require("../../BasicUser");
5
+ const Media_1 = require("./Media");
6
+ exports.ReviewSchema = `
7
+ id
8
+ mediaId
9
+ userId
10
+ mediaType
11
+ summary
12
+ body (asHtml: $asHtml)
13
+ rating
14
+ ratingAmount
15
+ score
16
+ private
17
+ siteUrl
18
+ createdAt
19
+ updatedAt
20
+ user {
21
+ ${BasicUser_1.BasicUserSchema}
22
+ }
23
+ media {
24
+ ${Media_1.MediaSchema}
25
+ }
26
+ `;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SiteStatisticsSchema = void 0;
4
+ const SiteTrendConnection_1 = require("../../SiteTrendConnection");
5
+ exports.SiteStatisticsSchema = `
6
+ users (sort: $usersSort, page: $usersPage, perPage: $usersPerPage) {
7
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
8
+ }
9
+ anime (sort: $animeSort, page: $animePage, perPage: $animePerPage) {
10
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
11
+ }
12
+ manga (sort: $mangaSort, page: $mangaPage, perPage: $mangaPerPage) {
13
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
14
+ }
15
+ characters (sort: $charactersSort, page: $charactersPage, perPage: $charactersPerPage) {
16
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
17
+ }
18
+ staff (sort: $staffSort, page: $staffPage, perPage: $staffPerPage) {
19
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
20
+ }
21
+ studios (sort: $studiosSort, page: $studiosPage, perPage: $studiosPerPage) {
22
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
23
+ }
24
+ reviews (sort: $reviewsSort, page: $reviewsPage, perPage: $reviewsPerPage) {
25
+ ${SiteTrendConnection_1.SiteTrendConnectionSchema}
26
+ }
27
+ `;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StaffSchema = void 0;
4
+ const Name_1 = require("../../Name");
5
+ const Image_1 = require("../../Image");
6
+ const FuzzyDate_1 = require("../../FuzzyDate");
7
+ const Title_1 = require("../../Title");
8
+ exports.StaffSchema = `
9
+ id
10
+ ${Name_1.NameSchema}
11
+ languageV2
12
+ ${Image_1.ImageSchema}
13
+ description(asHtml: $asHtml)
14
+ primaryOccupations
15
+ gender
16
+ dateOfBirth {
17
+ ${FuzzyDate_1.FuzzyDateSchema}
18
+ }
19
+ dateOfDeath {
20
+ ${FuzzyDate_1.FuzzyDateSchema}
21
+ }
22
+ age
23
+ yearsActive
24
+ homeTown
25
+ bloodType
26
+ isFavourite
27
+ isFavouriteBlocked
28
+ siteUrl
29
+ staffMedia (sort: $staffMediaSort, type: $staffMediaType, onList: $staffMediaOnList, page: $staffMediaPage, perPage: $staffMediaPerPage) {
30
+ nodes {
31
+ id
32
+ ${Title_1.TitleSchema}
33
+ }
34
+ }
35
+ characters (sort: $charactersSort, page: $charactersPage, perPage: $charactersPerPage) {
36
+ nodes {
37
+ id
38
+ ${Name_1.NameSchema}
39
+ }
40
+ }
41
+ characterMedia (sort: $characterMediaSort, onList: $characterMediaOnList, page: $characterMediaPage, perPage: $characterMediaPerPage) {
42
+ nodes {
43
+ id
44
+ ${Title_1.TitleSchema}
45
+ }
46
+ }
47
+ submitter {
48
+ id
49
+ name
50
+ }
51
+ submissionStatus
52
+ submissionNotes
53
+ favourites
54
+ modNotes
55
+ `;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StudioSchema = void 0;
4
+ const Character_1 = require("./Character");
5
+ const Staff_1 = require("./Staff");
6
+ const Media_1 = require("./Media");
7
+ const Name_1 = require("../../Name");
8
+ const Image_1 = require("../../Image");
9
+ exports.StudioSchema = `
10
+ id
11
+ name
12
+ isAnimationStudio
13
+ media (sort: $mediaSort, isMain: $mediaIsMain onList: $mediaOnList, page: $mediaPage, perPage: $mediaPerPage) {
14
+ edges {
15
+ id
16
+ relationType
17
+ isMainStudio
18
+ characters {
19
+ ${Character_1.CharacterSchema}
20
+ }
21
+ characterRole
22
+ characterName
23
+ roleNotes
24
+ dubGroup
25
+ voiceActors {
26
+ ${Staff_1.StaffSchema}
27
+ }
28
+ voiceActorRoles {
29
+ voiceActor {
30
+ id
31
+ ${Name_1.NameSchema}
32
+ ${Image_1.ImageSchema}
33
+ }
34
+ roleNotes
35
+ dubGroup
36
+ }
37
+ favouriteOrder
38
+ node {
39
+ ${Media_1.MediaSchema}
40
+ }
41
+ }
42
+ nodes {
43
+ ${Media_1.MediaSchema}
44
+ }
45
+ pageInfo {
46
+ total
47
+ perPage
48
+ currentPage
49
+ lastPage
50
+ hasNextPage
51
+ }
52
+ }
53
+ siteUrl
54
+ isFavourite
55
+ favourites
56
+ `;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThreadSchema = void 0;
4
+ const Media_1 = require("./Media");
5
+ const BasicUser_1 = require("../../BasicUser");
6
+ exports.ThreadSchema = `
7
+ id
8
+ title
9
+ body (asHtml: $asHtml)
10
+ userId
11
+ replyUserId
12
+ replyCommentId
13
+ replyCount
14
+ viewCount
15
+ isLocked
16
+ isSticky
17
+ isSubscribed
18
+ likeCount
19
+ isLiked
20
+ repliedAt
21
+ createdAt
22
+ updatedAt
23
+ user {
24
+ ${BasicUser_1.BasicUserSchema}
25
+ }
26
+ replyUser {
27
+ ${BasicUser_1.BasicUserSchema}
28
+ }
29
+ likes {
30
+ ${BasicUser_1.BasicUserSchema}
31
+ }
32
+ siteUrl
33
+ categories {
34
+ id
35
+ name
36
+ }
37
+ mediaCategories {
38
+ ${Media_1.MediaSchema}
39
+ }
40
+ `;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThreadCommentSchema = void 0;
4
+ const Thread_1 = require("./Thread");
5
+ const BasicUser_1 = require("../../BasicUser");
6
+ exports.ThreadCommentSchema = `
7
+ id
8
+ userId
9
+ threadId
10
+ comment (asHtml: $asHtml)
11
+ likeCount
12
+ isLiked
13
+ siteUrl
14
+ createdAt
15
+ updatedAt
16
+ thread {
17
+ ${Thread_1.ThreadSchema}
18
+ }
19
+ user {
20
+ ${BasicUser_1.BasicUserSchema}
21
+ }
22
+ likes {
23
+ ${BasicUser_1.BasicUserSchema}
24
+ }
25
+ childComments
26
+ isLocked
27
+ `;
@@ -0,0 +1,362 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserSchema = void 0;
4
+ const Image_1 = require("../../Image");
5
+ const UserStats_1 = require("../../UserStats");
6
+ const Title_1 = require("../../Title");
7
+ const Name_1 = require("../../Name");
8
+ const CoverImage_1 = require("../../CoverImage");
9
+ const Tag_1 = require("../../Tag");
10
+ exports.UserSchema = `
11
+ id
12
+ name
13
+ about(asHtml: $asHtml)
14
+ avatar {
15
+ large
16
+ medium
17
+ }
18
+ bannerImage
19
+ isFollowing
20
+ isFollower
21
+ isBlocked
22
+ bans
23
+ options {
24
+ titleLanguage
25
+ displayAdultContent
26
+ airingNotifications
27
+ profileColor
28
+ notificationOptions {
29
+ type
30
+ enabled
31
+ }
32
+ timezone
33
+ activityMergeTime
34
+ staffNameLanguage
35
+ restrictMessagesToFollowing
36
+ disabledListActivity {
37
+ disabled
38
+ type
39
+ }
40
+ }
41
+ mediaListOptions {
42
+ scoreFormat
43
+ rowOrder
44
+ animeList {
45
+ sectionOrder
46
+ splitCompletedSectionByFormat
47
+ customLists
48
+ advancedScoring
49
+ advancedScoringEnabled
50
+ }
51
+ mangaList {
52
+ sectionOrder
53
+ splitCompletedSectionByFormat
54
+ customLists
55
+ advancedScoring
56
+ advancedScoringEnabled
57
+ }
58
+ }
59
+ favourites {
60
+ anime (perPage: 50) {
61
+ edges {
62
+ node {
63
+ id
64
+ ${Title_1.TitleSchema}
65
+ }
66
+ }
67
+ nodes {
68
+ id
69
+ ${Title_1.TitleSchema}
70
+ }
71
+ }
72
+ manga (perPage: 50) {
73
+ edges {
74
+ node {
75
+ id
76
+ ${Title_1.TitleSchema}
77
+ }
78
+ }
79
+ nodes {
80
+ id
81
+ ${Title_1.TitleSchema}
82
+ }
83
+ }
84
+ characters (perPage: 50) {
85
+ edges {
86
+ id
87
+ role
88
+ name
89
+ voiceActors {
90
+ id
91
+ ${Name_1.NameSchema}
92
+ ${Image_1.ImageSchema}
93
+ }
94
+ media {
95
+ id
96
+ ${Title_1.TitleSchema}
97
+ ${CoverImage_1.CoverImageSchema}
98
+ }
99
+ favouriteOrder
100
+ node {
101
+ id
102
+ ${Name_1.NameSchema}
103
+ ${Image_1.ImageSchema}
104
+ }
105
+ }
106
+ }
107
+ staff (perPage: 50) {
108
+ edges {
109
+ id
110
+ role
111
+ favouriteOrder
112
+ node {
113
+ id
114
+ ${Name_1.NameSchema}
115
+ ${Image_1.ImageSchema}
116
+ }
117
+ }
118
+ }
119
+ studios (perPage: 50) {
120
+ edges {
121
+ id
122
+ isMain
123
+ favouriteOrder
124
+ node {
125
+ id
126
+ name
127
+ isAnimationStudio
128
+ siteUrl
129
+ }
130
+ }
131
+ }
132
+ }
133
+ statistics {
134
+ anime {
135
+ count
136
+ meanScore
137
+ standardDeviation
138
+ minutesWatched
139
+ episodesWatched
140
+ formats (limit: $animeStatLimit, sort: $animeStatSort) {
141
+ ${UserStats_1.UserAnimeStatsSchema}
142
+ format
143
+ }
144
+ statuses (limit: $animeStatLimit, sort: $animeStatSort) {
145
+ ${UserStats_1.UserAnimeStatsSchema}
146
+ status
147
+ }
148
+ scores (limit: $animeStatLimit, sort: $animeStatSort) {
149
+ ${UserStats_1.UserAnimeStatsSchema}
150
+ score
151
+ }
152
+ lengths (limit: $animeStatLimit, sort: $animeStatSort) {
153
+ ${UserStats_1.UserAnimeStatsSchema}
154
+ length
155
+ }
156
+ releaseYears (limit: $animeStatLimit, sort: $animeStatSort) {
157
+ ${UserStats_1.UserAnimeStatsSchema}
158
+ releaseYear
159
+ }
160
+ startYears (limit: $animeStatLimit, sort: $animeStatSort) {
161
+ ${UserStats_1.UserAnimeStatsSchema}
162
+ startYear
163
+ }
164
+ genres (limit: $animeStatLimit, sort: $animeStatSort) {
165
+ ${UserStats_1.UserAnimeStatsSchema}
166
+ genre
167
+ }
168
+ tags (limit: $animeStatLimit, sort: $animeStatSort) {
169
+ ${UserStats_1.UserAnimeStatsSchema}
170
+ tag {
171
+ ${Tag_1.TagSchema}
172
+ }
173
+ }
174
+ countries (limit: $animeStatLimit, sort: $animeStatSort) {
175
+ ${UserStats_1.UserAnimeStatsSchema}
176
+ country
177
+ }
178
+ voiceActors (limit: $animeStatLimit, sort: $animeStatSort) {
179
+ ${UserStats_1.UserAnimeStatsSchema}
180
+ voiceActor {
181
+ id
182
+ ${Name_1.NameSchema}
183
+ }
184
+ characterIds
185
+ }
186
+ staff (limit: $animeStatLimit, sort: $animeStatSort) {
187
+ ${UserStats_1.UserAnimeStatsSchema}
188
+ staff {
189
+ id
190
+ ${Name_1.NameSchema}
191
+ }
192
+ }
193
+ studios (limit: $animeStatLimit, sort: $animeStatSort) {
194
+ ${UserStats_1.UserAnimeStatsSchema}
195
+ studio {
196
+ id
197
+ name
198
+ }
199
+ }
200
+ }
201
+ manga {
202
+ count
203
+ meanScore
204
+ standardDeviation
205
+ chaptersRead
206
+ volumesRead
207
+ formats (limit: $mangaStatLimit, sort: $mangaStatSort) {
208
+ ${UserStats_1.UserMangaStatsSchema}
209
+ format
210
+ }
211
+ statuses (limit: $mangaStatLimit, sort: $mangaStatSort) {
212
+ ${UserStats_1.UserMangaStatsSchema}
213
+ status
214
+ }
215
+ scores (limit: $mangaStatLimit, sort: $mangaStatSort) {
216
+ ${UserStats_1.UserMangaStatsSchema}
217
+ score
218
+ }
219
+ lengths (limit: $mangaStatLimit, sort: $mangaStatSort) {
220
+ ${UserStats_1.UserMangaStatsSchema}
221
+ length
222
+ }
223
+ releaseYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
224
+ ${UserStats_1.UserMangaStatsSchema}
225
+ releaseYear
226
+ }
227
+ startYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
228
+ ${UserStats_1.UserMangaStatsSchema}
229
+ startYear
230
+ }
231
+ genres (limit: $mangaStatLimit, sort: $mangaStatSort) {
232
+ ${UserStats_1.UserMangaStatsSchema}
233
+ genre
234
+ }
235
+ tags (limit: $mangaStatLimit, sort: $mangaStatSort) {
236
+ ${UserStats_1.UserMangaStatsSchema}
237
+ tag {
238
+ ${Tag_1.TagSchema}
239
+ }
240
+ }
241
+ countries (limit: $mangaStatLimit, sort: $mangaStatSort) {
242
+ ${UserStats_1.UserMangaStatsSchema}
243
+ country
244
+ }
245
+ staff (limit: $mangaStatLimit, sort: $mangaStatSort) {
246
+ ${UserStats_1.UserMangaStatsSchema}
247
+ staff {
248
+ id
249
+ ${Name_1.NameSchema}
250
+ }
251
+ }
252
+ studios (limit: $mangaStatLimit, sort: $mangaStatSort) {
253
+ ${UserStats_1.UserMangaStatsSchema}
254
+ studio {
255
+ id
256
+ name
257
+ }
258
+ }
259
+ }
260
+ }
261
+ stats {
262
+ watchedTime
263
+ chaptersRead
264
+ activityHistory {
265
+ date
266
+ amount
267
+ level
268
+ }
269
+ animeStatusDistribution {
270
+ status
271
+ amount
272
+ }
273
+ mangaStatusDistribution {
274
+ status
275
+ amount
276
+ }
277
+ animeScoreDistribution {
278
+ score
279
+ amount
280
+ }
281
+ mangaScoreDistribution {
282
+ score
283
+ amount
284
+ }
285
+ animeListScores {
286
+ meanScore
287
+ standardDeviation
288
+ }
289
+ mangaListScores {
290
+ meanScore
291
+ standardDeviation
292
+ }
293
+ favouredGenresOverview {
294
+ genre
295
+ amount
296
+ meanScore
297
+ timeWatched
298
+ }
299
+ favouredGenres {
300
+ genre
301
+ amount
302
+ meanScore
303
+ timeWatched
304
+ }
305
+ favouredTags {
306
+ tag {
307
+ ${Tag_1.TagSchema}
308
+ }
309
+ amount
310
+ meanScore
311
+ timeWatched
312
+ }
313
+ favouredActors {
314
+ staff {
315
+ id
316
+ ${Name_1.NameSchema}
317
+ }
318
+ amount
319
+ meanScore
320
+ timeWatched
321
+ }
322
+ favouredStaff {
323
+ staff {
324
+ id
325
+ ${Name_1.NameSchema}
326
+ }
327
+ amount
328
+ meanScore
329
+ timeWatched
330
+ }
331
+ favouredStudios {
332
+ studio {
333
+ id
334
+ name
335
+ }
336
+ amount
337
+ meanScore
338
+ timeWatched
339
+ }
340
+ favouredYears {
341
+ year
342
+ amount
343
+ meanScore
344
+ }
345
+ favouredFormats {
346
+ format
347
+ amount
348
+ }
349
+ }
350
+ unreadNotificationCount
351
+ siteUrl
352
+ donatorTier
353
+ donatorBadge
354
+ moderatorRoles
355
+ createdAt
356
+ updatedAt
357
+ previousNames {
358
+ name
359
+ createdAt
360
+ updatedAt
361
+ }
362
+ `;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SaveMediaListEntryMutation = void 0;
13
+ const APIWrapper_1 = require("../../../base/APIWrapper");
14
+ const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const FuzzyDate_1 = require("../interfaces/FuzzyDate");
16
+ class SaveMediaListEntryMutation extends APIWrapper_1.APIWrapper {
17
+ constructor(authToken) {
18
+ super('https://graphql.anilist.co');
19
+ this.authToken = authToken;
20
+ }
21
+ saveMediaListEntry(variables) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const mutation = `
24
+ mutation ($id: Int, $mediaId: Int, $status: MediaListStatus, $score: Float, $scoreRaw: Int, $progress: Int, $progressVolumes: Int, $repeat: Int, $priority: Int, $private: Boolean, $notes: String, $hiddenFromStatusLists: Boolean, $customLists: [String], $advancedScores: [Float], $startedAt: FuzzyDateInput, $completedAt: FuzzyDateInput) {
25
+ SaveMediaListEntry(id: $id, mediaId: $mediaId, status: $status, score: $score, scoreRaw: $scoreRaw, progress: $progress, progressVolumes: $progressVolumes, repeat: $repeat, priority: $priority, private: $private, notes: $notes, hiddenFromStatusLists: $hiddenFromStatusLists, customLists: $customLists, advancedScores: $advancedScores, startedAt: $startedAt, completedAt: $completedAt) {
26
+ id
27
+ mediaId
28
+ status
29
+ score
30
+ progress
31
+ progressVolumes
32
+ repeat
33
+ priority
34
+ private
35
+ notes
36
+ hiddenFromStatusLists
37
+ customLists
38
+ advancedScores
39
+ startedAt {
40
+ ${FuzzyDate_1.FuzzyDateSchema}
41
+ }
42
+ completedAt {
43
+ ${FuzzyDate_1.FuzzyDateSchema}
44
+ }
45
+ }
46
+ }
47
+ `;
48
+ const data = { query: mutation, variables };
49
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
50
+ });
51
+ }
52
+ }
53
+ exports.SaveMediaListEntryMutation = SaveMediaListEntryMutation;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpdateMediaListEntriesMutation = void 0;
13
+ const APIWrapper_1 = require("../../../base/APIWrapper");
14
+ const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const FuzzyDate_1 = require("../interfaces/FuzzyDate");
16
+ class UpdateMediaListEntriesMutation extends APIWrapper_1.APIWrapper {
17
+ constructor(authToken) {
18
+ super('https://graphql.anilist.co');
19
+ this.authToken = authToken;
20
+ }
21
+ updateMediaListEntries(variables) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const mutation = `
24
+ mutation ($status: MediaListStatus, $score: Float, $scoreRaw: Int, $progress: Int, $progressVolumes: Int, $repeat: Int, $priority: Int, $private: Boolean, $notes: String, $hiddenFromStatusLists: Boolean, $advancedScores: [Float], $startedAt: FuzzyDateInput, $completedAt: FuzzyDateInput, $ids: [Int]) {
25
+ UpdateMediaListEntries(status: $status, score: $score, scoreRaw: $scoreRaw, progress: $progress, progressVolumes: $progressVolumes, repeat: $repeat, priority: $priority, private: $private, notes: $notes, hiddenFromStatusLists: $hiddenFromStatusLists, advancedScores: $advancedScores, startedAt: $startedAt, completedAt: $completedAt, ids: $ids) {
26
+ id
27
+ status
28
+ score
29
+ progress
30
+ progressVolumes
31
+ repeat
32
+ priority
33
+ private
34
+ notes
35
+ hiddenFromStatusLists
36
+ advancedScores
37
+ startedAt {
38
+ ${FuzzyDate_1.FuzzyDateSchema}
39
+ }
40
+ completedAt {
41
+ ${FuzzyDate_1.FuzzyDateSchema}
42
+ }
43
+ }
44
+ }
45
+ `;
46
+ const data = { query: mutation, variables };
47
+ return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
48
+ });
49
+ }
50
+ }
51
+ exports.UpdateMediaListEntriesMutation = UpdateMediaListEntriesMutation;