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
@@ -3,4 +3,13 @@ export interface StreamingEpisode {
3
3
  thumbnail: string
4
4
  url: string
5
5
  site: string
6
- }
6
+ }
7
+
8
+ export const StreamingEpisodeSchema = `
9
+ streamingEpisodes {
10
+ title
11
+ thumbnail
12
+ url
13
+ site
14
+ }
15
+ `
@@ -8,3 +8,13 @@ export interface Tag {
8
8
  isMediaSpoiler: boolean
9
9
  isAdult: boolean
10
10
  }
11
+
12
+ export const TagSchema = `
13
+ id
14
+ name
15
+ description
16
+ rank
17
+ isGeneralSpoiler
18
+ isMediaSpoiler
19
+ isAdult
20
+ `
@@ -3,4 +3,13 @@ export interface Title {
3
3
  english: string
4
4
  native: string
5
5
  userPreferred: string
6
- }
6
+ }
7
+
8
+ export const TitleSchema = `
9
+ title {
10
+ romaji
11
+ english
12
+ native
13
+ userPreferred
14
+ }
15
+ `
@@ -2,4 +2,12 @@ export interface Trailer {
2
2
  id: string
3
3
  site: string
4
4
  thumbnail: string
5
- }
5
+ }
6
+
7
+ export const TrailerSchema = `
8
+ trailer {
9
+ id
10
+ site
11
+ thumbnail
12
+ }
13
+ `
@@ -22,4 +22,18 @@ export interface UserStats {
22
22
  favouredStudios: Favoured[]
23
23
  favouredYears: Favoured[]
24
24
  favouredFormats: Favoured[]
25
- }
25
+ }
26
+
27
+ export const UserAnimeStatsSchema = `
28
+ count
29
+ meanScore
30
+ minutesWatched
31
+ mediaIds
32
+ `
33
+
34
+ export const UserMangaStatsSchema = `
35
+ count
36
+ meanScore
37
+ chaptersRead
38
+ mediaIds
39
+ `
@@ -1,4 +1,5 @@
1
1
  import { Media } from '../Media'
2
+ import { MediaSchema } from './Media'
2
3
 
3
4
  export interface AiringScheduleResponse {
4
5
  id: number
@@ -7,4 +8,15 @@ export interface AiringScheduleResponse {
7
8
  episode: number
8
9
  mediaId: number
9
10
  media: Media
10
- }
11
+ }
12
+
13
+ export const AiringScheduleSchema = `
14
+ id
15
+ airingAt
16
+ timeUntilAiring
17
+ episode
18
+ mediaId
19
+ media {
20
+ ${MediaSchema}
21
+ }
22
+ `
@@ -1,7 +1,7 @@
1
- import { FuzzyDate } from '../FuzzyDate'
2
- import { Name } from '../Name'
3
- import { Image } from '../Image'
4
- import { Title } from '../Title'
1
+ import { FuzzyDate, FuzzyDateSchema } from '../FuzzyDate'
2
+ import { Name, NameSchema } from '../Name'
3
+ import { Image, ImageSchema } from '../Image'
4
+ import { Title, TitleSchema } from '../Title'
5
5
 
6
6
  export interface CharacterResponse {
7
7
  id: number
@@ -23,4 +23,28 @@ export interface CharacterResponse {
23
23
  }
24
24
  favourites: number
25
25
  modNotes: string
26
- }
26
+ }
27
+
28
+ export const CharacterSchema = `
29
+ id
30
+ ${NameSchema}
31
+ ${ImageSchema}
32
+ description(asHtml: $asHtml)
33
+ gender
34
+ dateOfBirth {
35
+ ${FuzzyDateSchema}
36
+ }
37
+ age
38
+ bloodType
39
+ isFavourite
40
+ isFavouriteBlocked
41
+ siteUrl
42
+ media(sort: $mediaSort, onList: $mediaOnList, page: $mediaPage, perPage: $mediaPerPage) {
43
+ nodes {
44
+ id
45
+ ${TitleSchema}
46
+ }
47
+ }
48
+ favourites
49
+ modNotes
50
+ `
@@ -1,16 +1,18 @@
1
- import { Title } from '../Title'
2
- import { FuzzyDate } from '../FuzzyDate'
3
- import { Trailer } from '../Trailer'
4
- import { CoverImage } from '../CoverImage'
5
- import { Tag } from '../Tag'
6
- import { NextAiringEpisode } from '../NextAiringEpisode'
7
- import { ExternalLink } from '../ExternalLink'
8
- import { StreamingEpisode } from '../StreamingEpisode'
9
- import { Ranking } from '../Ranking'
1
+ import { Title, TitleSchema } from '../Title'
2
+ import { FuzzyDate, FuzzyDateSchema } from '../FuzzyDate'
3
+ import { Trailer, TrailerSchema } from '../Trailer'
4
+ import { CoverImage, CoverImageSchema } from '../CoverImage'
5
+ import { Tag, TagSchema } from '../Tag'
6
+ import { NextAiringEpisode, NextAiringEpisodeSchema } from '../NextAiringEpisode'
7
+ import { ExternalLink, ExternalLinkSchema } from '../ExternalLink'
8
+ import { StreamingEpisode, StreamingEpisodeSchema } from '../StreamingEpisode'
9
+ import { Ranking, RankingSchema } from '../Ranking'
10
10
  import { MediaStats } from '../MediaStats'
11
- import { MediaListEntry } from '../MediaListEntry'
12
- import { Name } from '../Name'
13
- import { Image } from '../Image'
11
+ import { MediaListEntry, MediaListEntrySchema } from '../MediaListEntry'
12
+ import { Name, NameSchema } from '../Name'
13
+ import { Image, ImageSchema } from '../Image'
14
+ import { StatusDistributionSchema } from '../StatusDistribution'
15
+ import { ScoreDistributionSchema } from '../ScoreDistribution'
14
16
 
15
17
  export interface MediaResponse {
16
18
  id: number
@@ -48,10 +50,17 @@ export interface MediaResponse {
48
50
  tags: Tag[]
49
51
  relations: {
50
52
  edges: Array<{
53
+ id: number
51
54
  relationType: string
55
+ isMainStudio: boolean
56
+ characterRole: string
57
+ characterName: string
58
+ roleNotes: string
59
+ dubGroup: string
60
+ staffRole: string
52
61
  node: {
53
62
  id: number
54
- title: Title
63
+ title: FuzzyDate
55
64
  }
56
65
  }>
57
66
  }
@@ -116,3 +125,198 @@ export interface MediaResponse {
116
125
  isRecommendationBlocked: boolean
117
126
  modNotes: string
118
127
  }
128
+
129
+ export const MediaWithRelationsSchema = `
130
+ id
131
+ idMal
132
+ ${TitleSchema}
133
+ type
134
+ format
135
+ status
136
+ description (asHtml: $asHtml)
137
+ startDate {
138
+ ${FuzzyDateSchema}
139
+ }
140
+ endDate {
141
+ ${FuzzyDateSchema}
142
+ }
143
+ season
144
+ seasonYear
145
+ seasonInt
146
+ episodes
147
+ duration
148
+ chapters
149
+ volumes
150
+ countryOfOrigin
151
+ isLicensed
152
+ source
153
+ hashtag
154
+ ${TrailerSchema}
155
+ updatedAt
156
+ ${CoverImageSchema}
157
+ bannerImage
158
+ genres
159
+ synonyms
160
+ averageScore
161
+ meanScore
162
+ popularity
163
+ isLocked
164
+ trending
165
+ favourites
166
+ tags {
167
+ ${TagSchema}
168
+ }
169
+ relations {
170
+ edges {
171
+ id
172
+ relationType
173
+ isMainStudio
174
+ characters {
175
+ id
176
+ ${NameSchema}
177
+ ${ImageSchema}
178
+ description (asHtml: $asHtml)
179
+ gender
180
+ dateOfBirth {
181
+ ${FuzzyDateSchema}
182
+ }
183
+ age
184
+ bloodType
185
+ isFavourite
186
+ isFavouriteBlocked
187
+ siteUrl
188
+ favourites
189
+ modNotes
190
+ }
191
+ characterRole
192
+ characterName
193
+ roleNotes
194
+ dubGroup
195
+ staffRole
196
+ node {
197
+ id
198
+ ${TitleSchema}
199
+ }
200
+ }
201
+ }
202
+ characters {
203
+ edges {
204
+ id
205
+ role
206
+ name
207
+ voiceActors {
208
+ id
209
+ ${NameSchema}
210
+ ${ImageSchema}
211
+ }
212
+ media {
213
+ id
214
+ ${TitleSchema}
215
+ ${CoverImageSchema}
216
+ }
217
+ favouriteOrder
218
+ node {
219
+ id
220
+ ${NameSchema}
221
+ ${ImageSchema}
222
+ }
223
+ }
224
+ }
225
+ staff {
226
+ edges {
227
+ id
228
+ role
229
+ favouriteOrder
230
+ node {
231
+ id
232
+ ${NameSchema}
233
+ ${ImageSchema}
234
+ }
235
+ }
236
+ }
237
+ studios {
238
+ edges {
239
+ id
240
+ isMain
241
+ favouriteOrder
242
+ node {
243
+ id
244
+ name
245
+ isAnimationStudio
246
+ siteUrl
247
+ }
248
+ }
249
+ }
250
+ isFavourite
251
+ isAdult
252
+ ${NextAiringEpisodeSchema}
253
+ ${ExternalLinkSchema}
254
+ ${StreamingEpisodeSchema}
255
+ ${RankingSchema}
256
+ ${MediaListEntrySchema}
257
+ stats {
258
+ ${StatusDistributionSchema}
259
+ ${ScoreDistributionSchema}
260
+ }
261
+ siteUrl
262
+ autoCreateForumThread
263
+ isRecommendationBlocked
264
+ modNotes
265
+ `
266
+
267
+ export const MediaSchema = `
268
+ id
269
+ idMal
270
+ ${TitleSchema}
271
+ type
272
+ format
273
+ status
274
+ description (asHtml: $asHtml)
275
+ startDate {
276
+ ${FuzzyDateSchema}
277
+ }
278
+ endDate {
279
+ ${FuzzyDateSchema}
280
+ }
281
+ season
282
+ seasonYear
283
+ seasonInt
284
+ episodes
285
+ duration
286
+ chapters
287
+ volumes
288
+ countryOfOrigin
289
+ isLicensed
290
+ source
291
+ hashtag
292
+ ${TrailerSchema}
293
+ updatedAt
294
+ ${CoverImageSchema}
295
+ bannerImage
296
+ genres
297
+ synonyms
298
+ averageScore
299
+ meanScore
300
+ popularity
301
+ isLocked
302
+ trending
303
+ favourites
304
+ tags {
305
+ ${TagSchema}
306
+ }
307
+ isFavourite
308
+ isAdult
309
+ ${NextAiringEpisodeSchema}
310
+ ${ExternalLinkSchema}
311
+ ${StreamingEpisodeSchema}
312
+ ${RankingSchema}
313
+ ${MediaListEntrySchema}
314
+ stats {
315
+ ${StatusDistributionSchema}
316
+ ${ScoreDistributionSchema}
317
+ }
318
+ siteUrl
319
+ autoCreateForumThread
320
+ isRecommendationBlocked
321
+ modNotes
322
+ `
@@ -1,4 +1,6 @@
1
1
  import { Media } from '../Media'
2
+ import { FuzzyDateSchema } from '../FuzzyDate'
3
+ import { MediaSchema } from './Media'
2
4
 
3
5
  export interface MediaListResponse {
4
6
  id: number
@@ -21,4 +23,32 @@ export interface MediaListResponse {
21
23
  createdAt: number
22
24
  media: Media
23
25
  user: any
24
- }
26
+ }
27
+
28
+ export const MediaListSchema = `
29
+ id
30
+ userId
31
+ mediaId
32
+ status
33
+ score (format: $ScoreFormat)
34
+ progress
35
+ progressVolumes
36
+ repeat
37
+ priority
38
+ private
39
+ notes
40
+ hiddenFromStatusLists
41
+ customLists (asArray: $asArray)
42
+ advancedScores
43
+ startedAt {
44
+ ${FuzzyDateSchema}
45
+ }
46
+ completedAt {
47
+ ${FuzzyDateSchema}
48
+ }
49
+ updatedAt
50
+ createdAt
51
+ media {
52
+ ${MediaSchema}
53
+ }
54
+ `
@@ -1,4 +1,4 @@
1
- import { FuzzyDate } from '../FuzzyDate'
1
+ import { FuzzyDate, FuzzyDateSchema } from '../FuzzyDate'
2
2
  import { Media } from '../Media'
3
3
  import { UserResponse } from './User'
4
4
 
@@ -34,4 +34,42 @@ export interface MediaListCollectionResponse {
34
34
  user: UserResponse
35
35
  hasNextChunk: boolean
36
36
  }
37
- }
37
+ }
38
+
39
+ export const MediaListCollectionQuerySchema = `
40
+ query ($userId: Int, $userName: String, $type: MediaType, $status: MediaListStatus, $notes: String, $startedAt: FuzzyDateInt, $completedAt: FuzzyDateInt, $forceSingleCompletedList: Boolean, $chunk: Int, $perChunk: Int, $status_in: [MediaListStatus], $status_not_in: [MediaListStatus], $status_not: MediaListStatus, $notes_like: String, $startedAt_greater: FuzzyDateInt, $startedAt_lesser: FuzzyDateInt, $startedAt_like: String, $completedAt_greater: FuzzyDateInt, $completedAt_lesser: FuzzyDateInt, $completedAt_like: String, $sort: [MediaListSort], $scoreFormat: ScoreFormat, $asArray: Boolean) {
41
+ MediaListCollection (userId: $userId, userName: $userName, type: $type, status: $status, notes: $notes, startedAt: $startedAt, completedAt: $completedAt, forceSingleCompletedList: $forceSingleCompletedList, chunk: $chunk, perChunk: $perChunk, status_in: $status_in, status_not_in: $status_not_in, status_not: $status_not, notes_like: $notes_like, startedAt_greater: $startedAt_greater, startedAt_lesser: $startedAt_lesser, startedAt_like: $startedAt_like, completedAt_greater: $completedAt_greater, completedAt_lesser: $completedAt_lesser, completedAt_like: $completedAt_like, sort: $sort) {
42
+ lists {
43
+ entries {
44
+ id
45
+ userId
46
+ mediaId
47
+ status
48
+ score (format: $scoreFormat)
49
+ progress
50
+ progressVolumes
51
+ repeat
52
+ priority
53
+ private
54
+ notes
55
+ hiddenFromStatusLists
56
+ customLists (asArray: $asArray)
57
+ advancedScores
58
+ startedAt {
59
+ ${FuzzyDateSchema}
60
+ }
61
+ completedAt {
62
+ ${FuzzyDateSchema}
63
+ }
64
+ updatedAt
65
+ createdAt
66
+ }
67
+ name
68
+ isCustomList
69
+ isSplitCompletedList
70
+ status
71
+ }
72
+ hasNextChunk
73
+ }
74
+ }
75
+ `
@@ -1,4 +1,5 @@
1
1
  import { Media } from '../Media'
2
+ import { MediaSchema } from './Media'
2
3
 
3
4
  export interface MediaTrendResponse {
4
5
  mediaId: number
@@ -10,4 +11,18 @@ export interface MediaTrendResponse {
10
11
  releasing: boolean
11
12
  episode: number
12
13
  media: Media
13
- }
14
+ }
15
+
16
+ export const MediaTrendSchema = `
17
+ mediaId
18
+ date
19
+ trending
20
+ averageScore
21
+ popularity
22
+ inProgress
23
+ releasing
24
+ episode
25
+ media {
26
+ ${MediaSchema}
27
+ }
28
+ `
@@ -1,7 +1,7 @@
1
- import { Name } from '../Name'
2
- import { Image } from '../Image'
3
- import { FuzzyDate } from '../FuzzyDate'
4
- import { Title } from '../Title'
1
+ import { Name, NameSchema } from '../Name'
2
+ import { Image, ImageSchema } from '../Image'
3
+ import { FuzzyDate, FuzzyDateSchema } from '../FuzzyDate'
4
+ import { Title, TitleSchema } from '../Title'
5
5
 
6
6
  export interface StaffResponse {
7
7
  id: number
@@ -50,4 +50,53 @@ export interface StaffResponse {
50
50
  submissionNotes: string
51
51
  favourites: number
52
52
  modNotes: string
53
- }
53
+ }
54
+
55
+ export const StaffSchema = `
56
+ id
57
+ ${NameSchema}
58
+ languageV2
59
+ ${ImageSchema}
60
+ description(asHtml: $asHtml)
61
+ primaryOccupations
62
+ gender
63
+ dateOfBirth {
64
+ ${FuzzyDateSchema}
65
+ }
66
+ dateOfDeath {
67
+ ${FuzzyDateSchema}
68
+ }
69
+ age
70
+ yearsActive
71
+ homeTown
72
+ bloodType
73
+ isFavourite
74
+ isFavouriteBlocked
75
+ siteUrl
76
+ staffMedia (sort: $staffMediaSort, type: $staffMediaType, onList: $staffMediaOnList, page: $staffMediaPage, perPage: $staffMediaPerPage) {
77
+ nodes {
78
+ id
79
+ ${TitleSchema}
80
+ }
81
+ }
82
+ characters (sort: $charactersSort, page: $charactersPage, perPage: $charactersPerPage) {
83
+ nodes {
84
+ id
85
+ ${NameSchema}
86
+ }
87
+ }
88
+ characterMedia (sort: $characterMediaSort, onList: $characterMediaOnList, page: $characterMediaPage, perPage: $characterMediaPerPage) {
89
+ nodes {
90
+ id
91
+ ${TitleSchema}
92
+ }
93
+ }
94
+ submitter {
95
+ id
96
+ name
97
+ }
98
+ submissionStatus
99
+ submissionNotes
100
+ favourites
101
+ modNotes
102
+ `