anilink-api-wrapper 1.0.0 → 1.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 (64) hide show
  1. package/__tests__/anilist.test.ts +1 -1
  2. package/dist/apis/anilist/interfaces/CoverImage.js +9 -0
  3. package/dist/apis/anilist/interfaces/ExternalLink.js +8 -0
  4. package/dist/apis/anilist/interfaces/FuzzyDate.js +6 -0
  5. package/dist/apis/anilist/interfaces/Image.js +7 -0
  6. package/dist/apis/anilist/interfaces/MediaListEntry.js +7 -0
  7. package/dist/apis/anilist/interfaces/Name.js +9 -0
  8. package/dist/apis/anilist/interfaces/NextAiringEpisode.js +8 -0
  9. package/dist/apis/anilist/interfaces/Ranking.js +13 -0
  10. package/dist/apis/anilist/interfaces/ScoreDistribution.js +7 -0
  11. package/dist/apis/anilist/interfaces/StatusDistribution.js +7 -0
  12. package/dist/apis/anilist/interfaces/StreamingEpisode.js +9 -0
  13. package/dist/apis/anilist/interfaces/Tag.js +10 -0
  14. package/dist/apis/anilist/interfaces/Title.js +9 -0
  15. package/dist/apis/anilist/interfaces/Trailer.js +8 -0
  16. package/dist/apis/anilist/interfaces/UserStats.js +13 -0
  17. package/dist/apis/anilist/interfaces/responses/AiringSchedule.js +12 -0
  18. package/dist/apis/anilist/interfaces/responses/Character.js +28 -0
  19. package/dist/apis/anilist/interfaces/responses/Media.js +208 -0
  20. package/dist/apis/anilist/interfaces/responses/MediaList.js +30 -0
  21. package/dist/apis/anilist/interfaces/responses/MediaListCollectionResponse.js +39 -0
  22. package/dist/apis/anilist/interfaces/responses/MediaTrend.js +15 -0
  23. package/dist/apis/anilist/interfaces/responses/Staff.js +53 -0
  24. package/dist/apis/anilist/interfaces/responses/User.js +360 -0
  25. package/dist/apis/anilist/query/AiringSchedule.js +3 -115
  26. package/dist/apis/anilist/query/Character.js +2 -36
  27. package/dist/apis/anilist/query/Media.js +3 -200
  28. package/dist/apis/anilist/query/MediaList.js +2 -137
  29. package/dist/apis/anilist/query/MediaListCollection.js +2 -623
  30. package/dist/apis/anilist/query/MediaTrend.js +3 -117
  31. package/dist/apis/anilist/query/Staff.js +2 -75
  32. package/dist/apis/anilist/query/User.js +7 -532
  33. package/package.json +1 -1
  34. package/src/apis/anilist/interfaces/CoverImage.ts +10 -1
  35. package/src/apis/anilist/interfaces/ExternalLink.ts +9 -1
  36. package/src/apis/anilist/interfaces/FuzzyDate.ts +7 -1
  37. package/src/apis/anilist/interfaces/Image.ts +8 -1
  38. package/src/apis/anilist/interfaces/MediaListEntry.ts +8 -1
  39. package/src/apis/anilist/interfaces/Name.ts +9 -0
  40. package/src/apis/anilist/interfaces/NextAiringEpisode.ts +8 -0
  41. package/src/apis/anilist/interfaces/Ranking.ts +14 -1
  42. package/src/apis/anilist/interfaces/ScoreDistribution.ts +8 -1
  43. package/src/apis/anilist/interfaces/StatusDistribution.ts +8 -1
  44. package/src/apis/anilist/interfaces/StreamingEpisode.ts +10 -1
  45. package/src/apis/anilist/interfaces/Tag.ts +10 -0
  46. package/src/apis/anilist/interfaces/Title.ts +10 -1
  47. package/src/apis/anilist/interfaces/Trailer.ts +9 -1
  48. package/src/apis/anilist/interfaces/UserStats.ts +15 -1
  49. package/src/apis/anilist/interfaces/responses/AiringSchedule.ts +13 -1
  50. package/src/apis/anilist/interfaces/responses/Character.ts +29 -5
  51. package/src/apis/anilist/interfaces/responses/Media.ts +217 -13
  52. package/src/apis/anilist/interfaces/responses/MediaList.ts +31 -1
  53. package/src/apis/anilist/interfaces/responses/MediaListCollectionResponse.ts +40 -2
  54. package/src/apis/anilist/interfaces/responses/MediaTrend.ts +16 -1
  55. package/src/apis/anilist/interfaces/responses/Staff.ts +54 -5
  56. package/src/apis/anilist/interfaces/responses/User.ts +362 -2
  57. package/src/apis/anilist/query/AiringSchedule.ts +4 -116
  58. package/src/apis/anilist/query/Character.ts +2 -37
  59. package/src/apis/anilist/query/Media.ts +4 -201
  60. package/src/apis/anilist/query/MediaList.ts +2 -138
  61. package/src/apis/anilist/query/MediaListCollection.ts +4 -630
  62. package/src/apis/anilist/query/MediaTrend.ts +4 -119
  63. package/src/apis/anilist/query/Staff.ts +2 -76
  64. package/src/apis/anilist/query/User.ts +7 -533
@@ -1,6 +1,12 @@
1
- import { Image } from '../Image'
1
+ import { Image, ImageSchema } from '../Image'
2
2
  import { Statistics } from '../Statistics'
3
- import { UserStats } from '../UserStats'
3
+ import { UserStats, UserAnimeStatsSchema, UserMangaStatsSchema } from '../UserStats'
4
+ import { TitleSchema } from '../Title'
5
+ import { NameSchema } from '../Name'
6
+
7
+ import { CoverImageSchema } from '../CoverImage'
8
+
9
+ import { TagSchema } from '../Tag'
4
10
 
5
11
  export interface UserResponse {
6
12
  id: number
@@ -70,3 +76,357 @@ export interface UserResponse {
70
76
  updatedAt: number
71
77
  }>
72
78
  }
79
+
80
+ export const UserSchema = `
81
+ id
82
+ name
83
+ about(asHtml: $isHTML)
84
+ avatar {
85
+ large
86
+ medium
87
+ }
88
+ bannerImage
89
+ isFollowing
90
+ isFollower
91
+ isBlocked
92
+ bans
93
+ options {
94
+ titleLanguage
95
+ displayAdultContent
96
+ airingNotifications
97
+ profileColor
98
+ notificationOptions {
99
+ type
100
+ enabled
101
+ }
102
+ timezone
103
+ activityMergeTime
104
+ staffNameLanguage
105
+ restrictMessagesToFollowing
106
+ disabledListActivity {
107
+ disabled
108
+ type
109
+ }
110
+ }
111
+ mediaListOptions {
112
+ scoreFormat
113
+ rowOrder
114
+ animeList {
115
+ sectionOrder
116
+ splitCompletedSectionByFormat
117
+ customLists
118
+ advancedScoring
119
+ advancedScoringEnabled
120
+ }
121
+ mangaList {
122
+ sectionOrder
123
+ splitCompletedSectionByFormat
124
+ customLists
125
+ advancedScoring
126
+ advancedScoringEnabled
127
+ }
128
+ }
129
+ favourites {
130
+ anime (perPage: 50) {
131
+ edges {
132
+ node {
133
+ id
134
+ ${TitleSchema}
135
+ }
136
+ }
137
+ nodes {
138
+ id
139
+ ${TitleSchema}
140
+ }
141
+ }
142
+ manga (perPage: 50) {
143
+ edges {
144
+ node {
145
+ id
146
+ ${TitleSchema}
147
+ }
148
+ }
149
+ nodes {
150
+ id
151
+ ${TitleSchema}
152
+ }
153
+ }
154
+ characters (perPage: 50) {
155
+ edges {
156
+ id
157
+ role
158
+ name
159
+ voiceActors {
160
+ id
161
+ ${NameSchema}
162
+ ${ImageSchema}
163
+ }
164
+ media {
165
+ id
166
+ ${TitleSchema}
167
+ ${CoverImageSchema}
168
+ }
169
+ favouriteOrder
170
+ node {
171
+ id
172
+ ${NameSchema}
173
+ ${ImageSchema}
174
+ }
175
+ }
176
+ }
177
+ staff (perPage: 50) {
178
+ edges {
179
+ id
180
+ role
181
+ favouriteOrder
182
+ node {
183
+ id
184
+ ${NameSchema}
185
+ ${ImageSchema}
186
+ }
187
+ }
188
+ }
189
+ studios (perPage: 50) {
190
+ edges {
191
+ id
192
+ isMain
193
+ favouriteOrder
194
+ node {
195
+ id
196
+ name
197
+ isAnimationStudio
198
+ siteUrl
199
+ }
200
+ }
201
+ }
202
+ }
203
+ statistics {
204
+ anime {
205
+ count
206
+ meanScore
207
+ standardDeviation
208
+ minutesWatched
209
+ episodesWatched
210
+ formats (limit: $animeStatLimit, sort: $animeStatSort) {
211
+ ${UserAnimeStatsSchema}
212
+ format
213
+ }
214
+ statuses (limit: $animeStatLimit, sort: $animeStatSort) {
215
+ ${UserAnimeStatsSchema}
216
+ status
217
+ }
218
+ scores (limit: $animeStatLimit, sort: $animeStatSort) {
219
+ ${UserAnimeStatsSchema}
220
+ score
221
+ }
222
+ lengths (limit: $animeStatLimit, sort: $animeStatSort) {
223
+ ${UserAnimeStatsSchema}
224
+ length
225
+ }
226
+ releaseYears (limit: $animeStatLimit, sort: $animeStatSort) {
227
+ ${UserAnimeStatsSchema}
228
+ releaseYear
229
+ }
230
+ startYears (limit: $animeStatLimit, sort: $animeStatSort) {
231
+ ${UserAnimeStatsSchema}
232
+ startYear
233
+ }
234
+ genres (limit: $animeStatLimit, sort: $animeStatSort) {
235
+ ${UserAnimeStatsSchema}
236
+ genre
237
+ }
238
+ tags (limit: $animeStatLimit, sort: $animeStatSort) {
239
+ ${UserAnimeStatsSchema}
240
+ tag {
241
+ ${TagSchema}
242
+ }
243
+ }
244
+ countries (limit: $animeStatLimit, sort: $animeStatSort) {
245
+ ${UserAnimeStatsSchema}
246
+ country
247
+ }
248
+ voiceActors (limit: $animeStatLimit, sort: $animeStatSort) {
249
+ ${UserAnimeStatsSchema}
250
+ voiceActor {
251
+ id
252
+ ${NameSchema}
253
+ }
254
+ characterIds
255
+ }
256
+ staff (limit: $animeStatLimit, sort: $animeStatSort) {
257
+ ${UserAnimeStatsSchema}
258
+ staff {
259
+ id
260
+ ${NameSchema}
261
+ }
262
+ }
263
+ studios (limit: $animeStatLimit, sort: $animeStatSort) {
264
+ ${UserAnimeStatsSchema}
265
+ studio {
266
+ id
267
+ name
268
+ }
269
+ }
270
+ }
271
+ manga {
272
+ count
273
+ meanScore
274
+ standardDeviation
275
+ chaptersRead
276
+ volumesRead
277
+ formats (limit: $mangaStatLimit, sort: $mangaStatSort) {
278
+ ${UserMangaStatsSchema}
279
+ format
280
+ }
281
+ statuses (limit: $mangaStatLimit, sort: $mangaStatSort) {
282
+ ${UserMangaStatsSchema}
283
+ status
284
+ }
285
+ scores (limit: $mangaStatLimit, sort: $mangaStatSort) {
286
+ ${UserMangaStatsSchema}
287
+ score
288
+ }
289
+ lengths (limit: $mangaStatLimit, sort: $mangaStatSort) {
290
+ ${UserMangaStatsSchema}
291
+ length
292
+ }
293
+ releaseYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
294
+ ${UserMangaStatsSchema}
295
+ releaseYear
296
+ }
297
+ startYears (limit: $mangaStatLimit, sort: $mangaStatSort) {
298
+ ${UserMangaStatsSchema}
299
+ startYear
300
+ }
301
+ genres (limit: $mangaStatLimit, sort: $mangaStatSort) {
302
+ ${UserMangaStatsSchema}
303
+ genre
304
+ }
305
+ tags (limit: $mangaStatLimit, sort: $mangaStatSort) {
306
+ ${UserMangaStatsSchema}
307
+ tag {
308
+ ${TagSchema}
309
+ }
310
+ }
311
+ countries (limit: $mangaStatLimit, sort: $mangaStatSort) {
312
+ ${UserMangaStatsSchema}
313
+ country
314
+ }
315
+ staff (limit: $mangaStatLimit, sort: $mangaStatSort) {
316
+ ${UserMangaStatsSchema}
317
+ staff {
318
+ id
319
+ ${NameSchema}
320
+ }
321
+ }
322
+ studios (limit: $mangaStatLimit, sort: $mangaStatSort) {
323
+ ${UserMangaStatsSchema}
324
+ studio {
325
+ id
326
+ name
327
+ }
328
+ }
329
+ }
330
+ }
331
+ stats {
332
+ watchedTime
333
+ chaptersRead
334
+ activityHistory {
335
+ date
336
+ amount
337
+ level
338
+ }
339
+ animeStatusDistribution {
340
+ status
341
+ amount
342
+ }
343
+ mangaStatusDistribution {
344
+ status
345
+ amount
346
+ }
347
+ animeScoreDistribution {
348
+ score
349
+ amount
350
+ }
351
+ mangaScoreDistribution {
352
+ score
353
+ amount
354
+ }
355
+ animeListScores {
356
+ meanScore
357
+ standardDeviation
358
+ }
359
+ mangaListScores {
360
+ meanScore
361
+ standardDeviation
362
+ }
363
+ favouredGenresOverview {
364
+ genre
365
+ amount
366
+ meanScore
367
+ timeWatched
368
+ }
369
+ favouredGenres {
370
+ genre
371
+ amount
372
+ meanScore
373
+ timeWatched
374
+ }
375
+ favouredTags {
376
+ tag {
377
+ ${TagSchema}
378
+ }
379
+ amount
380
+ meanScore
381
+ timeWatched
382
+ }
383
+ favouredActors {
384
+ staff {
385
+ id
386
+ ${NameSchema}
387
+ }
388
+ amount
389
+ meanScore
390
+ timeWatched
391
+ }
392
+ favouredStaff {
393
+ staff {
394
+ id
395
+ ${NameSchema}
396
+ }
397
+ amount
398
+ meanScore
399
+ timeWatched
400
+ }
401
+ favouredStudios {
402
+ studio {
403
+ id
404
+ name
405
+ }
406
+ amount
407
+ meanScore
408
+ timeWatched
409
+ }
410
+ favouredYears {
411
+ year
412
+ amount
413
+ meanScore
414
+ }
415
+ favouredFormats {
416
+ format
417
+ amount
418
+ }
419
+ }
420
+ unreadNotificationCount
421
+ siteUrl
422
+ donatorTier
423
+ donatorBadge
424
+ moderatorRoles
425
+ createdAt
426
+ updatedAt
427
+ previousNames {
428
+ name
429
+ createdAt
430
+ updatedAt
431
+ }
432
+ `
@@ -1,6 +1,6 @@
1
1
  import { APIWrapper } from '../../../base/APIWrapper'
2
2
  import { sendRequest } from '../../../base/RequestHandler'
3
- import { AiringScheduleResponse } from '../interfaces/responses/AiringSchedule'
3
+ import { AiringScheduleResponse, AiringScheduleSchema } from '../interfaces/responses/AiringSchedule'
4
4
 
5
5
  interface AiringScheduleVariables {
6
6
  id?: number
@@ -22,6 +22,7 @@ interface AiringScheduleVariables {
22
22
  airingAt_greater?: number
23
23
  airingAt_lesser?: number
24
24
  sort?: string[]
25
+ asHtml?: boolean
25
26
  }
26
27
 
27
28
  export class AiringScheduleQuery extends APIWrapper {
@@ -34,122 +35,9 @@ export class AiringScheduleQuery extends APIWrapper {
34
35
 
35
36
  async airingSchedule (variables?: AiringScheduleVariables): Promise<AiringScheduleResponse> {
36
37
  const query = `
37
- query ($id: Int, $mediaId: Int, $episode: Int, $airingAt: Int, $notYetAired: Boolean, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $mediaId_not: Int, $mediaId_in: [Int], $mediaId_not_in: [Int], $episode_not: Int, $episode_in: [Int], $episode_not_in: [Int], $episode_greater: Int, $episode_lesser: Int, $airingAt_greater: Int, $airingAt_lesser: Int, $sort: [AiringSort]) {
38
+ query ($id: Int, $mediaId: Int, $episode: Int, $airingAt: Int, $notYetAired: Boolean, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $mediaId_not: Int, $mediaId_in: [Int], $mediaId_not_in: [Int], $episode_not: Int, $episode_in: [Int], $episode_not_in: [Int], $episode_greater: Int, $episode_lesser: Int, $airingAt_greater: Int, $airingAt_lesser: Int, $sort: [AiringSort], $asHtml: Boolean) {
38
39
  AiringSchedule (id: $id, mediaId: $mediaId, episode: $episode, airingAt: $airingAt, notYetAired: $notYetAired, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, mediaId_not: $mediaId_not, mediaId_in: $mediaId_in, mediaId_not_in: $mediaId_not_in, episode_not: $episode_not, episode_in: $episode_in, episode_not_in: $episode_not_in, episode_greater: $episode_greater, episode_lesser: $episode_lesser, airingAt_greater: $airingAt_greater, airingAt_lesser: $airingAt_lesser, sort: $sort) {
39
- id
40
- airingAt
41
- timeUntilAiring
42
- episode
43
- mediaId
44
- media {
45
- id
46
- idMal
47
- title {
48
- romaji
49
- english
50
- native
51
- userPreferred
52
- }
53
- type
54
- format
55
- status
56
- description
57
- startDate {
58
- year
59
- month
60
- day
61
- }
62
- endDate {
63
- year
64
- month
65
- day
66
- }
67
- season
68
- seasonYear
69
- seasonInt
70
- episodes
71
- duration
72
- countryOfOrigin
73
- isLicensed
74
- source
75
- hashtag
76
- trailer {
77
- id
78
- site
79
- thumbnail
80
- }
81
- updatedAt
82
- coverImage {
83
- extraLarge
84
- large
85
- medium
86
- color
87
- }
88
- bannerImage
89
- genres
90
- synonyms
91
- averageScore
92
- meanScore
93
- popularity
94
- isLocked
95
- trending
96
- favourites
97
- tags {
98
- id
99
- name
100
- description
101
- rank
102
- isGeneralSpoiler
103
- isMediaSpoiler
104
- isAdult
105
- }
106
- isFavourite
107
- isAdult
108
- nextAiringEpisode {
109
- airingAt
110
- timeUntilAiring
111
- episode
112
- }
113
- externalLinks {
114
- id
115
- url
116
- site
117
- }
118
- streamingEpisodes {
119
- title
120
- thumbnail
121
- url
122
- site
123
- }
124
- rankings {
125
- id
126
- rank
127
- type
128
- format
129
- year
130
- season
131
- allTime
132
- context
133
- }
134
- mediaListEntry {
135
- id
136
- status
137
- }
138
- stats {
139
- scoreDistribution {
140
- score
141
- amount
142
- }
143
- statusDistribution {
144
- status
145
- amount
146
- }
147
- }
148
- siteUrl
149
- autoCreateForumThread
150
- isRecommendationBlocked
151
- modNotes
152
- }
40
+ ${AiringScheduleSchema}
153
41
  }
154
42
  }
155
43
  `
@@ -1,6 +1,6 @@
1
1
  import { APIWrapper } from '../../../base/APIWrapper'
2
2
  import { sendRequest } from '../../../base/RequestHandler'
3
- import { CharacterResponse } from '../interfaces/responses/Character'
3
+ import { CharacterResponse, CharacterSchema } from '../interfaces/responses/Character'
4
4
 
5
5
  interface CharacterVariables {
6
6
  id?: number
@@ -29,42 +29,7 @@ export class CharacterQuery extends APIWrapper {
29
29
  const query = `
30
30
  query ($id: Int, $isBirthday: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [CharacterSort], $asHtml: Boolean, $mediaSort: [MediaSort], $mediaOnList: Boolean, $mediaPage: Int, $mediaPerPage: Int) {
31
31
  Character (id: $id, isBirthday: $isBirthday, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
32
- id
33
- name {
34
- first
35
- last
36
- full
37
- native
38
- }
39
- image {
40
- large
41
- medium
42
- }
43
- description(asHtml: $asHtml)
44
- gender
45
- dateOfBirth {
46
- year
47
- month
48
- day
49
- }
50
- age
51
- bloodType
52
- isFavourite
53
- isFavouriteBlocked
54
- siteUrl
55
- media(sort: $mediaSort, onList: $mediaOnList, page: $mediaPage, perPage: $mediaPerPage) {
56
- nodes {
57
- id
58
- title {
59
- romaji
60
- english
61
- native
62
- userPreferred
63
- }
64
- }
65
- }
66
- favourites
67
- modNotes
32
+ ${CharacterSchema}
68
33
  }
69
34
  }
70
35
  `