anilink-api-wrapper 1.0.0 → 1.2.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 (92) hide show
  1. package/dist/AniLink.js +10 -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 +12 -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/MediaTag.js +2 -0
  23. package/dist/apis/anilist/interfaces/responses/MediaTagCollection.js +2 -0
  24. package/dist/apis/anilist/interfaces/responses/MediaTrend.js +15 -0
  25. package/dist/apis/anilist/interfaces/responses/Staff.js +53 -0
  26. package/dist/apis/anilist/interfaces/responses/User.js +360 -0
  27. package/dist/apis/anilist/query/AiringSchedule.js +3 -115
  28. package/dist/apis/anilist/query/Character.js +2 -36
  29. package/dist/apis/anilist/query/GenreCollection.js +32 -0
  30. package/dist/apis/anilist/query/Media.js +3 -200
  31. package/dist/apis/anilist/query/MediaList.js +2 -137
  32. package/dist/apis/anilist/query/MediaListCollection.js +2 -623
  33. package/dist/apis/anilist/query/MediaTagCollection.js +35 -0
  34. package/dist/apis/anilist/query/MediaTrend.js +3 -117
  35. package/dist/apis/anilist/query/Staff.js +2 -75
  36. package/dist/apis/anilist/query/User.js +8 -546
  37. package/dist/apis/anilist/query/Viewer.js +35 -0
  38. package/package.json +3 -2
  39. package/.eslintignore +0 -1
  40. package/.github/workflows/code_quality.yml +0 -32
  41. package/.github/workflows/codeql.yml +0 -33
  42. package/.github/workflows/test.yml +0 -30
  43. package/__tests__/anilist.test.ts +0 -268
  44. package/babel.config.js +0 -6
  45. package/jest.config.js +0 -11
  46. package/src/AniLink.ts +0 -80
  47. package/src/apis/anilist/interfaces/ActivityHistory.ts +0 -5
  48. package/src/apis/anilist/interfaces/CoverImage.ts +0 -6
  49. package/src/apis/anilist/interfaces/Distribution.ts +0 -4
  50. package/src/apis/anilist/interfaces/ExternalLink.ts +0 -5
  51. package/src/apis/anilist/interfaces/Favoured.ts +0 -15
  52. package/src/apis/anilist/interfaces/FuzzyDate.ts +0 -5
  53. package/src/apis/anilist/interfaces/Image.ts +0 -4
  54. package/src/apis/anilist/interfaces/ListScores.ts +0 -4
  55. package/src/apis/anilist/interfaces/Media.ts +0 -59
  56. package/src/apis/anilist/interfaces/MediaListEntry.ts +0 -4
  57. package/src/apis/anilist/interfaces/MediaStatistics.ts +0 -23
  58. package/src/apis/anilist/interfaces/MediaStats.ts +0 -7
  59. package/src/apis/anilist/interfaces/Name.ts +0 -8
  60. package/src/apis/anilist/interfaces/NextAiringEpisode.ts +0 -5
  61. package/src/apis/anilist/interfaces/Ranking.ts +0 -10
  62. package/src/apis/anilist/interfaces/ScoreDistribution.ts +0 -4
  63. package/src/apis/anilist/interfaces/Staff.ts +0 -6
  64. package/src/apis/anilist/interfaces/Stat.ts +0 -24
  65. package/src/apis/anilist/interfaces/Statistics.ts +0 -6
  66. package/src/apis/anilist/interfaces/StatusDistribution.ts +0 -4
  67. package/src/apis/anilist/interfaces/StreamingEpisode.ts +0 -6
  68. package/src/apis/anilist/interfaces/Studio.ts +0 -4
  69. package/src/apis/anilist/interfaces/Tag.ts +0 -10
  70. package/src/apis/anilist/interfaces/Title.ts +0 -6
  71. package/src/apis/anilist/interfaces/Trailer.ts +0 -5
  72. package/src/apis/anilist/interfaces/UserStats.ts +0 -25
  73. package/src/apis/anilist/interfaces/responses/AiringSchedule.ts +0 -10
  74. package/src/apis/anilist/interfaces/responses/Character.ts +0 -26
  75. package/src/apis/anilist/interfaces/responses/Media.ts +0 -118
  76. package/src/apis/anilist/interfaces/responses/MediaList.ts +0 -24
  77. package/src/apis/anilist/interfaces/responses/MediaListCollectionResponse.ts +0 -37
  78. package/src/apis/anilist/interfaces/responses/MediaTrend.ts +0 -13
  79. package/src/apis/anilist/interfaces/responses/Staff.ts +0 -53
  80. package/src/apis/anilist/interfaces/responses/User.ts +0 -72
  81. package/src/apis/anilist/mutation/UpdateUser.ts +0 -162
  82. package/src/apis/anilist/query/AiringSchedule.ts +0 -160
  83. package/src/apis/anilist/query/Character.ts +0 -75
  84. package/src/apis/anilist/query/Media.ts +0 -295
  85. package/src/apis/anilist/query/MediaList.ts +0 -192
  86. package/src/apis/anilist/query/MediaListCollection.ts +0 -673
  87. package/src/apis/anilist/query/MediaTrend.ts +0 -169
  88. package/src/apis/anilist/query/Staff.ts +0 -122
  89. package/src/apis/anilist/query/User.ts +0 -567
  90. package/src/base/APIWrapper.ts +0 -7
  91. package/src/base/RequestHandler.ts +0 -21
  92. package/tsconfig.json +0 -15
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MediaQuery = void 0;
13
13
  const APIWrapper_1 = require("../../../base/APIWrapper");
14
14
  const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const Media_1 = require("../interfaces/responses/Media");
15
16
  class MediaQuery extends APIWrapper_1.APIWrapper {
16
17
  constructor(authToken) {
17
18
  super('https://graphql.anilist.co');
@@ -20,207 +21,9 @@ class MediaQuery extends APIWrapper_1.APIWrapper {
20
21
  media(variables) {
21
22
  return __awaiter(this, void 0, void 0, function* () {
22
23
  const query = `
23
- query ($id: Int, $idMal: Int, $startDate: FuzzyDateInt, $endDate: FuzzyDateInt, $season: MediaSeason, $seasonYear: Int, $type: MediaType, $format: MediaFormat, $status: MediaStatus, $episodes: Int, $duration: Int, $chapters: Int, $volumes: Int, $isAdult: Boolean, $genre: String, $tag: String, $minimumTagRank: Int, $tagCategory: String, $onList: Boolean, $licensedBy: String, $licensedById: Int, $averageScore: Int, $popularity: Int, $source: MediaSource, $countryOfOrigin: CountryCode, $isLicensed: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $idMal_not: Int, $idMal_in: [Int], $idMal_not_in: [Int], $startDate_greater: FuzzyDateInt, $startDate_lesser: FuzzyDateInt, $startDate_like: String, $endDate_greater: FuzzyDateInt, $endDate_lesser: FuzzyDateInt, $endDate_like: String, $format_in: [MediaFormat], $format_not: MediaFormat, $format_not_in: [MediaFormat], $status_in: [MediaStatus], $status_not: MediaStatus, $status_not_in: [MediaStatus], $episodes_greater: Int, $episodes_lesser: Int, $duration_greater: Int, $duration_lesser: Int, $chapters_greater: Int, $chapters_lesser: Int, $volumes_greater: Int, $volumes_lesser: Int, $genre_in: [String], $genre_not_in: [String], $tag_in: [String], $tag_not_in: [String], $tagCategory_in: [String], $tagCategory_not_in: [String], $licensedBy_in: [String], $licensedById_in: [Int], $averageScore_not: Int, $averageScore_greater: Int, $averageScore_lesser: Int, $popularity_not: Int, $popularity_greater: Int, $popularity_lesser: Int, $source_in: [MediaSource], $sort: [MediaSort]) {
24
+ query ($id: Int, $idMal: Int, $startDate: FuzzyDateInt, $endDate: FuzzyDateInt, $season: MediaSeason, $seasonYear: Int, $type: MediaType, $format: MediaFormat, $status: MediaStatus, $episodes: Int, $duration: Int, $chapters: Int, $volumes: Int, $isAdult: Boolean, $genre: String, $tag: String, $minimumTagRank: Int, $tagCategory: String, $onList: Boolean, $licensedBy: String, $licensedById: Int, $averageScore: Int, $popularity: Int, $source: MediaSource, $countryOfOrigin: CountryCode, $isLicensed: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $idMal_not: Int, $idMal_in: [Int], $idMal_not_in: [Int], $startDate_greater: FuzzyDateInt, $startDate_lesser: FuzzyDateInt, $startDate_like: String, $endDate_greater: FuzzyDateInt, $endDate_lesser: FuzzyDateInt, $endDate_like: String, $format_in: [MediaFormat], $format_not: MediaFormat, $format_not_in: [MediaFormat], $status_in: [MediaStatus], $status_not: MediaStatus, $status_not_in: [MediaStatus], $episodes_greater: Int, $episodes_lesser: Int, $duration_greater: Int, $duration_lesser: Int, $chapters_greater: Int, $chapters_lesser: Int, $volumes_greater: Int, $volumes_lesser: Int, $genre_in: [String], $genre_not_in: [String], $tag_in: [String], $tag_not_in: [String], $tagCategory_in: [String], $tagCategory_not_in: [String], $licensedBy_in: [String], $licensedById_in: [Int], $averageScore_not: Int, $averageScore_greater: Int, $averageScore_lesser: Int, $popularity_not: Int, $popularity_greater: Int, $popularity_lesser: Int, $source_in: [MediaSource], $sort: [MediaSort], $asHtml: Boolean) {
24
25
  Media (id: $id, idMal: $idMal, startDate: $startDate, endDate: $endDate, season: $season, seasonYear: $seasonYear, type: $type, format: $format, status: $status, episodes: $episodes, duration: $duration, chapters: $chapters, volumes: $volumes, isAdult: $isAdult, genre: $genre, tag: $tag, minimumTagRank: $minimumTagRank, tagCategory: $tagCategory, onList: $onList, licensedBy: $licensedBy, licensedById: $licensedById, averageScore: $averageScore, popularity: $popularity, source: $source, countryOfOrigin: $countryOfOrigin, isLicensed: $isLicensed, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, idMal_not: $idMal_not, idMal_in: $idMal_in, idMal_not_in: $idMal_not_in, startDate_greater: $startDate_greater, startDate_lesser: $startDate_lesser, startDate_like: $startDate_like, endDate_greater: $endDate_greater, endDate_lesser: $endDate_lesser, endDate_like: $endDate_like, format_in: $format_in, format_not: $format_not, format_not_in: $format_not_in, status_in: $status_in, status_not: $status_not, status_not_in: $status_not_in, episodes_greater: $episodes_greater, episodes_lesser: $episodes_lesser, duration_greater: $duration_greater, duration_lesser: $duration_lesser, chapters_greater: $chapters_greater, chapters_lesser: $chapters_lesser, volumes_greater: $volumes_greater, volumes_lesser: $volumes_lesser, genre_in: $genre_in, genre_not_in: $genre_not_in, tag_in: $tag_in, tag_not_in: $tag_not_in, tagCategory_in: $tagCategory_in, tagCategory_not_in: $tagCategory_not_in, licensedBy_in: $licensedBy_in, licensedById_in: $licensedById_in, averageScore_not: $averageScore_not, averageScore_greater: $averageScore_greater, averageScore_lesser: $averageScore_lesser, popularity_not: $popularity_not, popularity_greater: $popularity_greater, popularity_lesser: $popularity_lesser, source_in: $source_in, sort: $sort) {
25
- id
26
- idMal
27
- title {
28
- romaji
29
- english
30
- native
31
- userPreferred
32
- }
33
- type
34
- format
35
- status
36
- description
37
- startDate {
38
- year
39
- month
40
- day
41
- }
42
- endDate {
43
- year
44
- month
45
- day
46
- }
47
- season
48
- seasonYear
49
- seasonInt
50
- ${(variables === null || variables === void 0 ? void 0 : variables.type) === 'ANIME' ? 'episodes\nduration' : 'chapters\nvolumes'}
51
- countryOfOrigin
52
- isLicensed
53
- source
54
- hashtag
55
- trailer {
56
- id
57
- site
58
- thumbnail
59
- }
60
- updatedAt
61
- coverImage {
62
- extraLarge
63
- large
64
- medium
65
- color
66
- }
67
- bannerImage
68
- genres
69
- synonyms
70
- averageScore
71
- meanScore
72
- popularity
73
- isLocked
74
- trending
75
- favourites
76
- tags {
77
- id
78
- name
79
- description
80
- rank
81
- isGeneralSpoiler
82
- isMediaSpoiler
83
- isAdult
84
- }
85
- relations {
86
- edges {
87
- relationType
88
- node {
89
- id
90
- title {
91
- romaji
92
- english
93
- native
94
- userPreferred
95
- }
96
- }
97
- }
98
- }
99
- characters {
100
- edges {
101
- id
102
- role
103
- name
104
- voiceActors {
105
- id
106
- name {
107
- first
108
- last
109
- full
110
- native
111
- }
112
- image {
113
- large
114
- }
115
- }
116
- media {
117
- id
118
- title {
119
- romaji
120
- english
121
- native
122
- userPreferred
123
- }
124
- coverImage {
125
- extraLarge
126
- large
127
- medium
128
- color
129
- }
130
- }
131
- favouriteOrder
132
- node {
133
- id
134
- name {
135
- first
136
- last
137
- full
138
- native
139
- }
140
- image {
141
- large
142
- }
143
- }
144
- }
145
- }
146
- staff {
147
- edges {
148
- id
149
- role
150
- favouriteOrder
151
- node {
152
- id
153
- name {
154
- first
155
- last
156
- full
157
- native
158
- }
159
- image {
160
- large
161
- }
162
- }
163
- }
164
- }
165
- studios {
166
- edges {
167
- id
168
- isMain
169
- favouriteOrder
170
- node {
171
- id
172
- name
173
- isAnimationStudio
174
- siteUrl
175
- }
176
- }
177
- }
178
- isFavourite
179
- isAdult
180
- nextAiringEpisode {
181
- airingAt
182
- timeUntilAiring
183
- episode
184
- }
185
- externalLinks {
186
- id
187
- url
188
- site
189
- }
190
- streamingEpisodes {
191
- title
192
- thumbnail
193
- url
194
- site
195
- }
196
- rankings {
197
- id
198
- rank
199
- type
200
- format
201
- year
202
- season
203
- allTime
204
- context
205
- }
206
- mediaListEntry {
207
- id
208
- status
209
- }
210
- stats {
211
- scoreDistribution {
212
- score
213
- amount
214
- }
215
- statusDistribution {
216
- status
217
- amount
218
- }
219
- }
220
- siteUrl
221
- autoCreateForumThread
222
- isRecommendationBlocked
223
- modNotes
26
+ ${Media_1.MediaWithRelationsSchema}
224
27
  }
225
28
  }
226
29
  `;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MediaListQuery = void 0;
13
13
  const APIWrapper_1 = require("../../../base/APIWrapper");
14
14
  const RequestHandler_1 = require("../../../base/RequestHandler");
15
+ const MediaList_1 = require("../interfaces/responses/MediaList");
15
16
  class MediaListQuery extends APIWrapper_1.APIWrapper {
16
17
  constructor(authToken) {
17
18
  super('https://graphql.anilist.co');
@@ -22,143 +23,7 @@ class MediaListQuery extends APIWrapper_1.APIWrapper {
22
23
  const query = `
23
24
  query ($id: Int, $userId: Int, $userName: String, $type: MediaType, $status: MediaListStatus, $mediaId: Int, $isFollowing: Boolean, $notes: String, $startedAt: FuzzyDateInt, $completedAt: FuzzyDateInt, $compareWithAuthList: Boolean, $userId_in: [Int], $status_in: [MediaListStatus], $status_not_in: [MediaListStatus], $status_not: MediaListStatus, $mediaId_in: [Int], $mediaId_not_in: [Int], $notes_like: String, $startedAt_greater: FuzzyDateInt, $startedAt_lesser: FuzzyDateInt, $startedAt_like: String, $completedAt_greater: FuzzyDateInt, $completedAt_lesser: FuzzyDateInt, $completedAt_like: String, $ScoreFormat: ScoreFormat, $asArray: Boolean, $asHtml: Boolean) {
24
25
  MediaList (id: $id, userId: $userId, userName: $userName, type: $type, status: $status, mediaId: $mediaId, isFollowing: $isFollowing, notes: $notes, startedAt: $startedAt, completedAt: $completedAt, compareWithAuthList: $compareWithAuthList, userId_in: $userId_in, status_in: $status_in, status_not_in: $status_not_in, status_not: $status_not, mediaId_in: $mediaId_in, mediaId_not_in: $mediaId_not_in, 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) {
25
- id
26
- userId
27
- mediaId
28
- status
29
- score (format: $ScoreFormat)
30
- progress
31
- progressVolumes
32
- repeat
33
- priority
34
- private
35
- notes
36
- hiddenFromStatusLists
37
- customLists (asArray: $asArray)
38
- advancedScores
39
- startedAt {
40
- year
41
- month
42
- day
43
- }
44
- completedAt {
45
- year
46
- month
47
- day
48
- }
49
- updatedAt
50
- createdAt
51
- media {
52
- id
53
- idMal
54
- title {
55
- romaji
56
- english
57
- native
58
- userPreferred
59
- }
60
- type
61
- format
62
- status
63
- description (asHtml: $asHtml)
64
- startDate {
65
- year
66
- month
67
- day
68
- }
69
- endDate {
70
- year
71
- month
72
- day
73
- }
74
- season
75
- seasonYear
76
- seasonInt
77
- episodes
78
- duration
79
- chapters
80
- volumes
81
- countryOfOrigin
82
- isLicensed
83
- source
84
- hashtag
85
- trailer {
86
- id
87
- site
88
- thumbnail
89
- }
90
- updatedAt
91
- coverImage {
92
- extraLarge
93
- large
94
- medium
95
- color
96
- }
97
- bannerImage
98
- genres
99
- synonyms
100
- averageScore
101
- meanScore
102
- popularity
103
- isLocked
104
- trending
105
- favourites
106
- tags {
107
- id
108
- name
109
- description
110
- category
111
- rank
112
- isGeneralSpoiler
113
- isMediaSpoiler
114
- isAdult
115
- }
116
- isFavourite
117
- isFavouriteBlocked
118
- isAdult
119
- nextAiringEpisode {
120
- id
121
- airingAt
122
- timeUntilAiring
123
- episode
124
- }
125
- externalLinks {
126
- id
127
- url
128
- site
129
- }
130
- streamingEpisodes {
131
- title
132
- thumbnail
133
- url
134
- site
135
- }
136
- rankings {
137
- id
138
- rank
139
- type
140
- format
141
- year
142
- season
143
- allTime
144
- context
145
- }
146
- stats {
147
- scoreDistribution {
148
- score
149
- amount
150
- }
151
- statusDistribution {
152
- status
153
- amount
154
- }
155
- }
156
- siteUrl
157
- autoCreateForumThread
158
- isRecommendationBlocked
159
- isReviewBlocked
160
- modNotes
161
- }
26
+ ${MediaList_1.MediaListSchema}
162
27
  }
163
28
  }
164
29
  `;