anilink-api-wrapper 1.29.2 → 2.1.0

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 (142) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +71 -241
  3. package/dist/AniLink.d.ts +12329 -0
  4. package/dist/AniLink.mjs +7298 -0
  5. package/dist/anilist.d.ts +1 -0
  6. package/dist/anilist.mjs +5 -0
  7. package/dist/mal.d.ts +1 -0
  8. package/dist/mal.mjs +5 -0
  9. package/package.json +121 -46
  10. package/dist/AniLink.js +0 -248
  11. package/dist/apis/anilist/Custom.js +0 -42
  12. package/dist/apis/anilist/interfaces/Activity.js +0 -436
  13. package/dist/apis/anilist/interfaces/Basic.js +0 -33
  14. package/dist/apis/anilist/interfaces/CoverImage.js +0 -15
  15. package/dist/apis/anilist/interfaces/Distribution.js +0 -23
  16. package/dist/apis/anilist/interfaces/ExternalLink.js +0 -14
  17. package/dist/apis/anilist/interfaces/Favoured.js +0 -2
  18. package/dist/apis/anilist/interfaces/FuzzyDate.js +0 -12
  19. package/dist/apis/anilist/interfaces/Image.js +0 -13
  20. package/dist/apis/anilist/interfaces/ListScores.js +0 -2
  21. package/dist/apis/anilist/interfaces/Media.js +0 -13
  22. package/dist/apis/anilist/interfaces/Name.js +0 -15
  23. package/dist/apis/anilist/interfaces/NextAiringEpisode.js +0 -14
  24. package/dist/apis/anilist/interfaces/Notification.js +0 -25
  25. package/dist/apis/anilist/interfaces/Ranking.js +0 -19
  26. package/dist/apis/anilist/interfaces/SiteTrend.js +0 -33
  27. package/dist/apis/anilist/interfaces/Staff.js +0 -2
  28. package/dist/apis/anilist/interfaces/Stat.js +0 -2
  29. package/dist/apis/anilist/interfaces/Statistics.js +0 -2
  30. package/dist/apis/anilist/interfaces/StreamingEpisode.js +0 -15
  31. package/dist/apis/anilist/interfaces/Studio.js +0 -2
  32. package/dist/apis/anilist/interfaces/Tag.js +0 -18
  33. package/dist/apis/anilist/interfaces/Title.js +0 -15
  34. package/dist/apis/anilist/interfaces/Trailer.js +0 -14
  35. package/dist/apis/anilist/interfaces/UserStats.js +0 -23
  36. package/dist/apis/anilist/interfaces/responses/mutation/Favourites.js +0 -83
  37. package/dist/apis/anilist/interfaces/responses/query/AiringSchedule.js +0 -18
  38. package/dist/apis/anilist/interfaces/responses/query/AniChartUser.js +0 -2
  39. package/dist/apis/anilist/interfaces/responses/query/Character.js +0 -34
  40. package/dist/apis/anilist/interfaces/responses/query/ExternalLinkSourceCollection.js +0 -2
  41. package/dist/apis/anilist/interfaces/responses/query/Media.js +0 -217
  42. package/dist/apis/anilist/interfaces/responses/query/MediaList.js +0 -36
  43. package/dist/apis/anilist/interfaces/responses/query/MediaListCollectionResponse.js +0 -49
  44. package/dist/apis/anilist/interfaces/responses/query/MediaTagCollection.js +0 -2
  45. package/dist/apis/anilist/interfaces/responses/query/MediaTrend.js +0 -21
  46. package/dist/apis/anilist/interfaces/responses/query/Notification.js +0 -166
  47. package/dist/apis/anilist/interfaces/responses/query/Recommendation.js +0 -23
  48. package/dist/apis/anilist/interfaces/responses/query/Review.js +0 -30
  49. package/dist/apis/anilist/interfaces/responses/query/SiteStatistics.js +0 -31
  50. package/dist/apis/anilist/interfaces/responses/query/Staff.js +0 -59
  51. package/dist/apis/anilist/interfaces/responses/query/Studio.js +0 -60
  52. package/dist/apis/anilist/interfaces/responses/query/Thread.js +0 -44
  53. package/dist/apis/anilist/interfaces/responses/query/ThreadComment.js +0 -31
  54. package/dist/apis/anilist/interfaces/responses/query/User.js +0 -366
  55. package/dist/apis/anilist/mutation/DeleteActivity.js +0 -61
  56. package/dist/apis/anilist/mutation/DeleteActivityReply.js +0 -61
  57. package/dist/apis/anilist/mutation/DeleteCustomList.js +0 -63
  58. package/dist/apis/anilist/mutation/DeleteMediaListEntry.js +0 -61
  59. package/dist/apis/anilist/mutation/DeleteReview.js +0 -61
  60. package/dist/apis/anilist/mutation/DeleteThread.js +0 -61
  61. package/dist/apis/anilist/mutation/DeleteThreadComment.js +0 -61
  62. package/dist/apis/anilist/mutation/SaveActivityReply.js +0 -66
  63. package/dist/apis/anilist/mutation/SaveListActivity.js +0 -64
  64. package/dist/apis/anilist/mutation/SaveMediaListEntry.js +0 -97
  65. package/dist/apis/anilist/mutation/SaveMessageActivity.js +0 -68
  66. package/dist/apis/anilist/mutation/SaveRecommendation.js +0 -66
  67. package/dist/apis/anilist/mutation/SaveReview.js +0 -68
  68. package/dist/apis/anilist/mutation/SaveTextActivity.js +0 -65
  69. package/dist/apis/anilist/mutation/SaveThread.js +0 -69
  70. package/dist/apis/anilist/mutation/SaveThreadComment.js +0 -67
  71. package/dist/apis/anilist/mutation/ToggleActivityPin.js +0 -64
  72. package/dist/apis/anilist/mutation/ToggleActivitySubscription.js +0 -64
  73. package/dist/apis/anilist/mutation/ToggleFavourite.js +0 -66
  74. package/dist/apis/anilist/mutation/ToggleFollow.js +0 -62
  75. package/dist/apis/anilist/mutation/ToggleLike.js +0 -64
  76. package/dist/apis/anilist/mutation/ToggleLikeV2.js +0 -64
  77. package/dist/apis/anilist/mutation/ToggleThreadSubscription.js +0 -64
  78. package/dist/apis/anilist/mutation/UpdateAniChartHighlights.js +0 -58
  79. package/dist/apis/anilist/mutation/UpdateAniChartSettings.js +0 -58
  80. package/dist/apis/anilist/mutation/UpdateFavouriteOrder.js +0 -73
  81. package/dist/apis/anilist/mutation/UpdateMediaListEntries.js +0 -93
  82. package/dist/apis/anilist/mutation/UpdateUser.js +0 -127
  83. package/dist/apis/anilist/query/Activity.js +0 -86
  84. package/dist/apis/anilist/query/ActivityReply.js +0 -60
  85. package/dist/apis/anilist/query/AiringSchedule.js +0 -78
  86. package/dist/apis/anilist/query/AniChartUser.js +0 -56
  87. package/dist/apis/anilist/query/Character.js +0 -70
  88. package/dist/apis/anilist/query/ExternalLinkSourceCollection.js +0 -68
  89. package/dist/apis/anilist/query/Follower.js +0 -64
  90. package/dist/apis/anilist/query/Following.js +0 -64
  91. package/dist/apis/anilist/query/GenreCollection.js +0 -46
  92. package/dist/apis/anilist/query/Markdown.js +0 -57
  93. package/dist/apis/anilist/query/Media.js +0 -134
  94. package/dist/apis/anilist/query/MediaList.js +0 -90
  95. package/dist/apis/anilist/query/MediaListCollection.js +0 -76
  96. package/dist/apis/anilist/query/MediaTagCollection.js +0 -57
  97. package/dist/apis/anilist/query/MediaTrend.js +0 -84
  98. package/dist/apis/anilist/query/Notification.js +0 -65
  99. package/dist/apis/anilist/query/Recommendation.js +0 -68
  100. package/dist/apis/anilist/query/Review.js +0 -64
  101. package/dist/apis/anilist/query/SiteStatistics.js +0 -78
  102. package/dist/apis/anilist/query/Staff.js +0 -79
  103. package/dist/apis/anilist/query/Studio.js +0 -82
  104. package/dist/apis/anilist/query/Thread.js +0 -68
  105. package/dist/apis/anilist/query/ThreadComment.js +0 -63
  106. package/dist/apis/anilist/query/User.js +0 -68
  107. package/dist/apis/anilist/query/Viewer.js +0 -65
  108. package/dist/apis/anilist/query/page/Activities.js +0 -97
  109. package/dist/apis/anilist/query/page/ActivityReplies.js +0 -71
  110. package/dist/apis/anilist/query/page/AiringSchedules.js +0 -89
  111. package/dist/apis/anilist/query/page/Characters.js +0 -81
  112. package/dist/apis/anilist/query/page/Followers.js +0 -75
  113. package/dist/apis/anilist/query/page/Followings.js +0 -75
  114. package/dist/apis/anilist/query/page/Likes.js +0 -71
  115. package/dist/apis/anilist/query/page/MediaLists.js +0 -101
  116. package/dist/apis/anilist/query/page/MediaTrends.js +0 -95
  117. package/dist/apis/anilist/query/page/Medias.js +0 -143
  118. package/dist/apis/anilist/query/page/Notifications.js +0 -73
  119. package/dist/apis/anilist/query/page/Recommendations.js +0 -79
  120. package/dist/apis/anilist/query/page/Reviews.js +0 -75
  121. package/dist/apis/anilist/query/page/Staffs.js +0 -90
  122. package/dist/apis/anilist/query/page/Studios.js +0 -93
  123. package/dist/apis/anilist/query/page/ThreadCommments.js +0 -74
  124. package/dist/apis/anilist/query/page/Threads.js +0 -79
  125. package/dist/apis/anilist/query/page/Users.js +0 -79
  126. package/dist/apis/anilist/types/ActivityType.js +0 -14
  127. package/dist/apis/anilist/types/DisabledListActivity.js +0 -11
  128. package/dist/apis/anilist/types/Format.js +0 -30
  129. package/dist/apis/anilist/types/FuzzyDate.js +0 -12
  130. package/dist/apis/anilist/types/MediaListOptions.js +0 -16
  131. package/dist/apis/anilist/types/NotificationOptions.js +0 -29
  132. package/dist/apis/anilist/types/RecommendationRating.js +0 -12
  133. package/dist/apis/anilist/types/Season.js +0 -13
  134. package/dist/apis/anilist/types/Sort.js +0 -265
  135. package/dist/apis/anilist/types/Source.js +0 -25
  136. package/dist/apis/anilist/types/Status.js +0 -26
  137. package/dist/apis/anilist/types/Type.js +0 -44
  138. package/dist/apis/anilist/types/UserStaffNameLanguage.js +0 -15
  139. package/dist/apis/anilist/types/UserTitleLanguage.js +0 -15
  140. package/dist/base/APIWrapper.js +0 -17
  141. package/dist/base/RequestHandler.js +0 -48
  142. package/dist/base/ValidateVariables.js +0 -125
@@ -1,366 +0,0 @@
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
- /**
11
- * `UserSchema` is a constant representing the GraphQL schema for a user query.
12
- * It includes the user's id, name, about, avatar, bannerImage, isFollowing status, isFollower status, isBlocked status, bans, options, mediaListOptions, favourites, statistics, stats, unreadNotificationCount, siteUrl, donatorTier, donatorBadge, moderatorRoles, createdAt, updatedAt, and previousNames.
13
- */
14
- exports.UserSchema = `
15
- id
16
- name
17
- about(asHtml: $asHtml)
18
- avatar {
19
- large
20
- medium
21
- }
22
- bannerImage
23
- isFollowing
24
- isFollower
25
- isBlocked
26
- bans
27
- options {
28
- titleLanguage
29
- displayAdultContent
30
- airingNotifications
31
- profileColor
32
- notificationOptions {
33
- type
34
- enabled
35
- }
36
- timezone
37
- activityMergeTime
38
- staffNameLanguage
39
- restrictMessagesToFollowing
40
- disabledListActivity {
41
- disabled
42
- type
43
- }
44
- }
45
- mediaListOptions {
46
- scoreFormat
47
- rowOrder
48
- animeList {
49
- sectionOrder
50
- splitCompletedSectionByFormat
51
- customLists
52
- advancedScoring
53
- advancedScoringEnabled
54
- }
55
- mangaList {
56
- sectionOrder
57
- splitCompletedSectionByFormat
58
- customLists
59
- advancedScoring
60
- advancedScoringEnabled
61
- }
62
- }
63
- favourites {
64
- anime (perPage: 50) {
65
- edges {
66
- node {
67
- id
68
- ${Title_1.TitleSchema}
69
- }
70
- }
71
- nodes {
72
- id
73
- ${Title_1.TitleSchema}
74
- }
75
- }
76
- manga (perPage: 50) {
77
- edges {
78
- node {
79
- id
80
- ${Title_1.TitleSchema}
81
- }
82
- }
83
- nodes {
84
- id
85
- ${Title_1.TitleSchema}
86
- }
87
- }
88
- characters (perPage: 50) {
89
- edges {
90
- id
91
- role
92
- name
93
- voiceActors {
94
- id
95
- ${Name_1.NameSchema}
96
- ${Image_1.ImageSchema}
97
- }
98
- media {
99
- id
100
- ${Title_1.TitleSchema}
101
- ${CoverImage_1.CoverImageSchema}
102
- }
103
- favouriteOrder
104
- node {
105
- id
106
- ${Name_1.NameSchema}
107
- ${Image_1.ImageSchema}
108
- }
109
- }
110
- }
111
- staff (perPage: 50) {
112
- edges {
113
- id
114
- role
115
- favouriteOrder
116
- node {
117
- id
118
- ${Name_1.NameSchema}
119
- ${Image_1.ImageSchema}
120
- }
121
- }
122
- }
123
- studios (perPage: 50) {
124
- edges {
125
- id
126
- isMain
127
- favouriteOrder
128
- node {
129
- id
130
- name
131
- isAnimationStudio
132
- siteUrl
133
- }
134
- }
135
- }
136
- }
137
- statistics {
138
- anime {
139
- count
140
- meanScore
141
- standardDeviation
142
- minutesWatched
143
- episodesWatched
144
- formats (limit: $animeStatLimit, sort: $animeStatSort) {
145
- ${UserStats_1.UserAnimeStatsSchema}
146
- format
147
- }
148
- statuses (limit: $animeStatLimit, sort: $animeStatSort) {
149
- ${UserStats_1.UserAnimeStatsSchema}
150
- status
151
- }
152
- scores (limit: $animeStatLimit, sort: $animeStatSort) {
153
- ${UserStats_1.UserAnimeStatsSchema}
154
- score
155
- }
156
- lengths (limit: $animeStatLimit, sort: $animeStatSort) {
157
- ${UserStats_1.UserAnimeStatsSchema}
158
- length
159
- }
160
- releaseYears (limit: $animeStatLimit, sort: $animeStatSort) {
161
- ${UserStats_1.UserAnimeStatsSchema}
162
- releaseYear
163
- }
164
- startYears (limit: $animeStatLimit, sort: $animeStatSort) {
165
- ${UserStats_1.UserAnimeStatsSchema}
166
- startYear
167
- }
168
- genres (limit: $animeStatLimit, sort: $animeStatSort) {
169
- ${UserStats_1.UserAnimeStatsSchema}
170
- genre
171
- }
172
- tags (limit: $animeStatLimit, sort: $animeStatSort) {
173
- ${UserStats_1.UserAnimeStatsSchema}
174
- tag {
175
- ${Tag_1.TagSchema}
176
- }
177
- }
178
- countries (limit: $animeStatLimit, sort: $animeStatSort) {
179
- ${UserStats_1.UserAnimeStatsSchema}
180
- country
181
- }
182
- voiceActors (limit: $animeStatLimit, sort: $animeStatSort) {
183
- ${UserStats_1.UserAnimeStatsSchema}
184
- voiceActor {
185
- id
186
- ${Name_1.NameSchema}
187
- }
188
- characterIds
189
- }
190
- staff (limit: $animeStatLimit, sort: $animeStatSort) {
191
- ${UserStats_1.UserAnimeStatsSchema}
192
- staff {
193
- id
194
- ${Name_1.NameSchema}
195
- }
196
- }
197
- studios (limit: $animeStatLimit, sort: $animeStatSort) {
198
- ${UserStats_1.UserAnimeStatsSchema}
199
- studio {
200
- id
201
- name
202
- }
203
- }
204
- }
205
- manga {
206
- count
207
- meanScore
208
- standardDeviation
209
- chaptersRead
210
- volumesRead
211
- formats (limit: $mangaStatLimit, sort: $mangaStatSort) {
212
- ${UserStats_1.UserMangaStatsSchema}
213
- format
214
- }
215
- statuses (limit: $mangaStatLimit, sort: $mangaStatSort) {
216
- ${UserStats_1.UserMangaStatsSchema}
217
- status
218
- }
219
- scores (limit: $mangaStatLimit, sort: $mangaStatSort) {
220
- ${UserStats_1.UserMangaStatsSchema}
221
- score
222
- }
223
- lengths (limit: $mangaStatLimit, sort: $mangaStatSort) {
224
- ${UserStats_1.UserMangaStatsSchema}
225
- length
226
- }
227
- releaseYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
228
- ${UserStats_1.UserMangaStatsSchema}
229
- releaseYear
230
- }
231
- startYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
232
- ${UserStats_1.UserMangaStatsSchema}
233
- startYear
234
- }
235
- genres (limit: $mangaStatLimit, sort: $mangaStatSort) {
236
- ${UserStats_1.UserMangaStatsSchema}
237
- genre
238
- }
239
- tags (limit: $mangaStatLimit, sort: $mangaStatSort) {
240
- ${UserStats_1.UserMangaStatsSchema}
241
- tag {
242
- ${Tag_1.TagSchema}
243
- }
244
- }
245
- countries (limit: $mangaStatLimit, sort: $mangaStatSort) {
246
- ${UserStats_1.UserMangaStatsSchema}
247
- country
248
- }
249
- staff (limit: $mangaStatLimit, sort: $mangaStatSort) {
250
- ${UserStats_1.UserMangaStatsSchema}
251
- staff {
252
- id
253
- ${Name_1.NameSchema}
254
- }
255
- }
256
- studios (limit: $mangaStatLimit, sort: $mangaStatSort) {
257
- ${UserStats_1.UserMangaStatsSchema}
258
- studio {
259
- id
260
- name
261
- }
262
- }
263
- }
264
- }
265
- stats {
266
- watchedTime
267
- chaptersRead
268
- activityHistory {
269
- date
270
- amount
271
- level
272
- }
273
- animeStatusDistribution {
274
- status
275
- amount
276
- }
277
- mangaStatusDistribution {
278
- status
279
- amount
280
- }
281
- animeScoreDistribution {
282
- score
283
- amount
284
- }
285
- mangaScoreDistribution {
286
- score
287
- amount
288
- }
289
- animeListScores {
290
- meanScore
291
- standardDeviation
292
- }
293
- mangaListScores {
294
- meanScore
295
- standardDeviation
296
- }
297
- favouredGenresOverview {
298
- genre
299
- amount
300
- meanScore
301
- timeWatched
302
- }
303
- favouredGenres {
304
- genre
305
- amount
306
- meanScore
307
- timeWatched
308
- }
309
- favouredTags {
310
- tag {
311
- ${Tag_1.TagSchema}
312
- }
313
- amount
314
- meanScore
315
- timeWatched
316
- }
317
- favouredActors {
318
- staff {
319
- id
320
- ${Name_1.NameSchema}
321
- }
322
- amount
323
- meanScore
324
- timeWatched
325
- }
326
- favouredStaff {
327
- staff {
328
- id
329
- ${Name_1.NameSchema}
330
- }
331
- amount
332
- meanScore
333
- timeWatched
334
- }
335
- favouredStudios {
336
- studio {
337
- id
338
- name
339
- }
340
- amount
341
- meanScore
342
- timeWatched
343
- }
344
- favouredYears {
345
- year
346
- amount
347
- meanScore
348
- }
349
- favouredFormats {
350
- format
351
- amount
352
- }
353
- }
354
- unreadNotificationCount
355
- siteUrl
356
- donatorTier
357
- donatorBadge
358
- moderatorRoles
359
- createdAt
360
- updatedAt
361
- previousNames {
362
- name
363
- createdAt
364
- updatedAt
365
- }
366
- `;
@@ -1,61 +0,0 @@
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.DeleteActivityMutation = void 0;
13
- const APIWrapper_1 = require("../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../base/RequestHandler");
15
- const ValidateVariables_1 = require("../../../base/ValidateVariables");
16
- /**
17
- * `DeleteActivityMutation` is a class representing a mutation to delete a activity.
18
- * It includes a method to delete an activity
19
- */
20
- class DeleteActivityMutation extends APIWrapper_1.APIWrapper {
21
- /**
22
- * Constructs a new `DeleteActivityMutation` instance.
23
- *
24
- * @param authToken - The authentication token.
25
- */
26
- constructor(authToken) {
27
- super('https://graphql.anilist.co');
28
- this.authToken = authToken;
29
- }
30
- /**
31
- * `deleteActivity` is a method that sends a mutation request to delete a activity.
32
- *
33
- * @param variables - An object of type `DeleteActivityVariables` representing the variables for the mutation.
34
- * @returns A Promise that resolves to the response from the mutation request.
35
- * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
36
- * */
37
- deleteActivity(variables) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- if (!this.authToken) {
40
- throw new Error('DeleteActivityMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
41
- }
42
- if (!variables.id) {
43
- throw new Error('id variable is required');
44
- }
45
- const variableTypeMappings = {
46
- id: 'number'
47
- };
48
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
49
- const mutation = `
50
- mutation ($id: Int) {
51
- DeleteActivity(id: $id) {
52
- deleted
53
- }
54
- }
55
- `;
56
- const data = { query: mutation, variables };
57
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
58
- });
59
- }
60
- }
61
- exports.DeleteActivityMutation = DeleteActivityMutation;
@@ -1,61 +0,0 @@
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.DeleteActivityReplyMutation = void 0;
13
- const APIWrapper_1 = require("../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../base/RequestHandler");
15
- const ValidateVariables_1 = require("../../../base/ValidateVariables");
16
- /**
17
- * `DeleteActivityReplyMutation` is a class representing a mutation to delete an activity reply.
18
- * It includes a method to delete an activity
19
- */
20
- class DeleteActivityReplyMutation extends APIWrapper_1.APIWrapper {
21
- /**
22
- * Constructs a new `DeleteActivityReplyMutation` instance.
23
- *
24
- * @param authToken - The authentication token.
25
- */
26
- constructor(authToken) {
27
- super('https://graphql.anilist.co');
28
- this.authToken = authToken;
29
- }
30
- /**
31
- * `DeleteActivityReply` is a method that sends a mutation request to delete an activity reply.
32
- *
33
- * @param variables - An object of type `DeleteActivityReplyVariables` representing the variables for the mutation.
34
- * @returns A Promise that resolves to the response from the mutation request.
35
- * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
36
- * */
37
- deleteActivityReply(variables) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- if (!this.authToken) {
40
- throw new Error('DeleteActivityReplyMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
41
- }
42
- if (!variables.id) {
43
- throw new Error('id variable is required');
44
- }
45
- const variableTypeMappings = {
46
- id: 'number'
47
- };
48
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
49
- const mutation = `
50
- mutation ($id: Int) {
51
- DeleteActivityReply (id: $id) {
52
- deleted
53
- }
54
- }
55
- `;
56
- const data = { query: mutation, variables };
57
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
58
- });
59
- }
60
- }
61
- exports.DeleteActivityReplyMutation = DeleteActivityReplyMutation;
@@ -1,63 +0,0 @@
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.DeleteCustomListMutation = void 0;
13
- const APIWrapper_1 = require("../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../base/RequestHandler");
15
- const ValidateVariables_1 = require("../../../base/ValidateVariables");
16
- const Type_1 = require("../types/Type");
17
- /**
18
- * `DeleteCustomListMutation` is a class representing a mutation to delete a custom list.
19
- * It includes a method to delete a custom list
20
- */
21
- class DeleteCustomListMutation extends APIWrapper_1.APIWrapper {
22
- /**
23
- * Constructs a new `DeleteCustomListMutation` instance.
24
- *
25
- * @param authToken - The authentication token.
26
- */
27
- constructor(authToken) {
28
- super('https://graphql.anilist.co');
29
- this.authToken = authToken;
30
- }
31
- /**
32
- * `deleteCustomList` is a method that sends a mutation request to delete a custom list.
33
- *
34
- * @param variables - An object of type `DeleteCustomListVariables` representing the variables for the mutation.
35
- * @returns A Promise that resolves to the response from the mutation request.
36
- * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
37
- * */
38
- deleteCustomList(variables) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!this.authToken) {
41
- throw new Error('DeleteCustomListMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
42
- }
43
- if (!variables.customList || !variables.type) {
44
- throw new Error('customList & type variables are required');
45
- }
46
- const variableTypeMappings = {
47
- customList: 'string',
48
- type: Type_1.MediaTypeMappings
49
- };
50
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
51
- const mutation = `
52
- mutation ($customList: String, $type: MediaType) {
53
- DeleteCustomList(customList: $customList, type: $type) {
54
- deleted
55
- }
56
- }
57
- `;
58
- const data = { query: mutation, variables };
59
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
60
- });
61
- }
62
- }
63
- exports.DeleteCustomListMutation = DeleteCustomListMutation;
@@ -1,61 +0,0 @@
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.DeleteMediaListEntryMutation = void 0;
13
- const APIWrapper_1 = require("../../../base/APIWrapper");
14
- const RequestHandler_1 = require("../../../base/RequestHandler");
15
- const ValidateVariables_1 = require("../../../base/ValidateVariables");
16
- /**
17
- * `DeleteMediaListEntryMutation` is a class representing a mutation to delete a media list entry.
18
- * It includes a method to delete a media list entry.
19
- */
20
- class DeleteMediaListEntryMutation extends APIWrapper_1.APIWrapper {
21
- /**
22
- * Constructs a new `DeleteMediaListEntryMutation` instance.
23
- *
24
- * @param authToken - The authentication token.
25
- */
26
- constructor(authToken) {
27
- super('https://graphql.anilist.co');
28
- this.authToken = authToken;
29
- }
30
- /**
31
- * `deleteMediaListEntry` is a method that sends a mutation request to delete a media list entry.
32
- *
33
- * @param variables - An object of type `DeleteMediaListEntryVariables` representing the variables for the mutation.
34
- * @returns A Promise that resolves to the response from the mutation request.
35
- * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
36
- * */
37
- deleteMediaListEntry(variables) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- if (!this.authToken) {
40
- throw new Error('DeleteMediaListEntryMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
41
- }
42
- if (!variables.id) {
43
- throw new Error('id variable is required');
44
- }
45
- const variableTypeMappings = {
46
- id: 'number'
47
- };
48
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
49
- const mutation = `
50
- mutation ($id: Int) {
51
- DeleteMediaListEntry(id: $id) {
52
- deleted
53
- }
54
- }
55
- `;
56
- const data = { query: mutation, variables };
57
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
58
- });
59
- }
60
- }
61
- exports.DeleteMediaListEntryMutation = DeleteMediaListEntryMutation;
@@ -1,61 +0,0 @@
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.DeleteReviewMutation = void 0;
13
- const RequestHandler_1 = require("../../../base/RequestHandler");
14
- const ValidateVariables_1 = require("../../../base/ValidateVariables");
15
- const APIWrapper_1 = require("../../../base/APIWrapper");
16
- /**
17
- * `DeleteReviewMutation` is a class representing a mutation to delete a review.
18
- * It includes a method to delete a review.
19
- */
20
- class DeleteReviewMutation extends APIWrapper_1.APIWrapper {
21
- /**
22
- * Constructs a new `DeleteReviewMutation` instance.
23
- *
24
- * @param authToken - The authentication token.
25
- */
26
- constructor(authToken) {
27
- super('https://graphql.anilist.co');
28
- this.authToken = authToken;
29
- }
30
- /**
31
- * `deleteReview` is a method that sends a mutation request to delete a review.
32
- *
33
- * @param variables - An object of type `DeleteReviewVariables` representing the variables for the mutation.
34
- * @returns A Promise that resolves to the response from the mutation request.
35
- * @throws Will throw an error if the mutation request fails or if the provided variables do not pass the validation checks.
36
- */
37
- deleteReview(variables) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- if (!this.authToken) {
40
- throw new Error('DeleteReviewMutation requires an authentication token. Create a new instance of AniLink and pass the token as an argument.');
41
- }
42
- if (!variables.id) {
43
- throw new Error('id variable is required');
44
- }
45
- const variableTypeMappings = {
46
- id: 'number'
47
- };
48
- (0, ValidateVariables_1.validateVariables)(variables, variableTypeMappings);
49
- const mutation = `
50
- mutation ($id: Int) {
51
- DeleteReview(id: $id) {
52
- deleted
53
- }
54
- }
55
- `;
56
- const data = { query: mutation, variables };
57
- return yield (0, RequestHandler_1.sendRequest)(this.baseURL, 'POST', data, this.authToken);
58
- });
59
- }
60
- }
61
- exports.DeleteReviewMutation = DeleteReviewMutation;