anilink-api-wrapper 1.1.0 → 1.3.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.
- package/dist/AniLink.js +13 -1
- package/dist/apis/anilist/interfaces/Activity.js +19 -0
- package/dist/apis/anilist/interfaces/ActivityNotification.js +17 -0
- package/dist/apis/anilist/interfaces/BasicComment.js +8 -0
- package/dist/apis/anilist/interfaces/BasicThread.js +9 -0
- package/dist/apis/anilist/interfaces/BasicUser.js +10 -0
- package/dist/apis/anilist/interfaces/Tag.js +2 -0
- package/dist/apis/anilist/interfaces/ThreadNotification.js +23 -0
- package/dist/apis/anilist/interfaces/responses/MediaTag.js +2 -0
- package/dist/apis/anilist/interfaces/responses/MediaTagCollection.js +2 -0
- package/dist/apis/anilist/interfaces/responses/Notification.js +170 -0
- package/dist/apis/anilist/interfaces/responses/User.js +3 -3
- package/dist/apis/anilist/query/GenreCollection.js +32 -0
- package/dist/apis/anilist/query/MediaTagCollection.js +35 -0
- package/dist/apis/anilist/query/Notification.js +35 -0
- package/dist/apis/anilist/query/User.js +2 -15
- package/dist/apis/anilist/query/Viewer.js +35 -0
- package/package.json +3 -2
- package/.eslintignore +0 -1
- package/.github/workflows/code_quality.yml +0 -32
- package/.github/workflows/codeql.yml +0 -33
- package/.github/workflows/test.yml +0 -30
- package/__tests__/anilist.test.ts +0 -268
- package/babel.config.js +0 -6
- package/jest.config.js +0 -11
- package/src/AniLink.ts +0 -80
- package/src/apis/anilist/interfaces/ActivityHistory.ts +0 -5
- package/src/apis/anilist/interfaces/CoverImage.ts +0 -15
- package/src/apis/anilist/interfaces/Distribution.ts +0 -4
- package/src/apis/anilist/interfaces/ExternalLink.ts +0 -13
- package/src/apis/anilist/interfaces/Favoured.ts +0 -15
- package/src/apis/anilist/interfaces/FuzzyDate.ts +0 -11
- package/src/apis/anilist/interfaces/Image.ts +0 -11
- package/src/apis/anilist/interfaces/ListScores.ts +0 -4
- package/src/apis/anilist/interfaces/Media.ts +0 -59
- package/src/apis/anilist/interfaces/MediaListEntry.ts +0 -11
- package/src/apis/anilist/interfaces/MediaStatistics.ts +0 -23
- package/src/apis/anilist/interfaces/MediaStats.ts +0 -7
- package/src/apis/anilist/interfaces/Name.ts +0 -17
- package/src/apis/anilist/interfaces/NextAiringEpisode.ts +0 -13
- package/src/apis/anilist/interfaces/Ranking.ts +0 -23
- package/src/apis/anilist/interfaces/ScoreDistribution.ts +0 -11
- package/src/apis/anilist/interfaces/Staff.ts +0 -6
- package/src/apis/anilist/interfaces/Stat.ts +0 -24
- package/src/apis/anilist/interfaces/Statistics.ts +0 -6
- package/src/apis/anilist/interfaces/StatusDistribution.ts +0 -11
- package/src/apis/anilist/interfaces/StreamingEpisode.ts +0 -15
- package/src/apis/anilist/interfaces/Studio.ts +0 -4
- package/src/apis/anilist/interfaces/Tag.ts +0 -20
- package/src/apis/anilist/interfaces/Title.ts +0 -15
- package/src/apis/anilist/interfaces/Trailer.ts +0 -13
- package/src/apis/anilist/interfaces/UserStats.ts +0 -39
- package/src/apis/anilist/interfaces/responses/AiringSchedule.ts +0 -22
- package/src/apis/anilist/interfaces/responses/Character.ts +0 -50
- package/src/apis/anilist/interfaces/responses/Media.ts +0 -322
- package/src/apis/anilist/interfaces/responses/MediaList.ts +0 -54
- package/src/apis/anilist/interfaces/responses/MediaListCollectionResponse.ts +0 -75
- package/src/apis/anilist/interfaces/responses/MediaTrend.ts +0 -28
- package/src/apis/anilist/interfaces/responses/Staff.ts +0 -102
- package/src/apis/anilist/interfaces/responses/User.ts +0 -432
- package/src/apis/anilist/mutation/UpdateUser.ts +0 -162
- package/src/apis/anilist/query/AiringSchedule.ts +0 -48
- package/src/apis/anilist/query/Character.ts +0 -40
- package/src/apis/anilist/query/Media.ts +0 -98
- package/src/apis/anilist/query/MediaList.ts +0 -56
- package/src/apis/anilist/query/MediaListCollection.ts +0 -47
- package/src/apis/anilist/query/MediaTrend.ts +0 -54
- package/src/apis/anilist/query/Staff.ts +0 -48
- package/src/apis/anilist/query/User.ts +0 -41
- package/src/base/APIWrapper.ts +0 -7
- package/src/base/RequestHandler.ts +0 -21
- package/tsconfig.json +0 -15
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
require('dotenv').config()
|
|
2
|
-
import AniLink from '../dist/AniLink.js'
|
|
3
|
-
// import AniLink from '../src/AniLink'
|
|
4
|
-
|
|
5
|
-
async function handleRateLimit(apiCall: () => Promise<any>, retryAfter = 60) {
|
|
6
|
-
try {
|
|
7
|
-
return await apiCall();
|
|
8
|
-
} catch (error: any) {
|
|
9
|
-
if (error.response && error.response.status === 429) {
|
|
10
|
-
console.log('Rate limit exceeded, waiting for 1 minute before retrying...');
|
|
11
|
-
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
|
|
12
|
-
console.log('Retrying...');
|
|
13
|
-
return handleRateLimit(apiCall, retryAfter);
|
|
14
|
-
} else {
|
|
15
|
-
throw error;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
describe('Anilist API Query', () => {
|
|
21
|
-
let aniLink: AniLink
|
|
22
|
-
|
|
23
|
-
beforeAll(() => {
|
|
24
|
-
const token = process.env.ANILIST_TOKEN
|
|
25
|
-
aniLink = new AniLink(token)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
test('user query', async () => {
|
|
29
|
-
try {
|
|
30
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.user({ id: 542244, isHTML: true }))
|
|
31
|
-
console.log(response)
|
|
32
|
-
expect(response).toBeDefined()
|
|
33
|
-
} catch (error: any) {
|
|
34
|
-
if (error.response.data) {
|
|
35
|
-
throw error.response.data
|
|
36
|
-
} else {
|
|
37
|
-
throw error.response
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
test('user query should handle errors', async () => {
|
|
43
|
-
try {
|
|
44
|
-
await handleRateLimit(() => aniLink.anilist.query.user({ id: 'invalid', isHTML: false }))
|
|
45
|
-
} catch (error: any) {
|
|
46
|
-
expect(error).toBeDefined()
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
test('media query', async () => {
|
|
51
|
-
try {
|
|
52
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.media({ id: 1, type: 'ANIME' }))
|
|
53
|
-
console.log(response)
|
|
54
|
-
expect(response).toBeDefined()
|
|
55
|
-
} catch (error: any) {
|
|
56
|
-
if (error.response.data) {
|
|
57
|
-
throw error.response.data
|
|
58
|
-
} else {
|
|
59
|
-
throw error.response
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
test('media query should handle errors', async () => {
|
|
65
|
-
try {
|
|
66
|
-
await handleRateLimit(() => aniLink.anilist.query.media({ id: 'invalid', type: 'ANIME' }))
|
|
67
|
-
} catch (error: any) {
|
|
68
|
-
expect(error).toBeDefined()
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
test('media trend query', async () => {
|
|
73
|
-
try {
|
|
74
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.mediaTrend({ mediaId: 1, type: 'ANIME' }))
|
|
75
|
-
console.log(response)
|
|
76
|
-
expect(response).toBeDefined()
|
|
77
|
-
} catch (error: any) {
|
|
78
|
-
if (error.response.data) {
|
|
79
|
-
throw error.response.data
|
|
80
|
-
} else {
|
|
81
|
-
throw error.response
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
test('media trend query should handle errors', async () => {
|
|
87
|
-
try {
|
|
88
|
-
await handleRateLimit(() => aniLink.anilist.query.mediaTrend({ mediaId: 'invalid', type: 'ANIME' }))
|
|
89
|
-
} catch (error: any) {
|
|
90
|
-
expect(error).toBeDefined()
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
test('airing schedule query should return a response', async () => {
|
|
95
|
-
try {
|
|
96
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.airingSchedule({ mediaId: 130590 })) // id needs to be an airing anime
|
|
97
|
-
console.log(response)
|
|
98
|
-
expect(response).toBeDefined()
|
|
99
|
-
} catch (error: any) {
|
|
100
|
-
if (error.response.data) {
|
|
101
|
-
throw error.response.data
|
|
102
|
-
} else {
|
|
103
|
-
throw error.response
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
test('airing schedule query should handle errors', async () => {
|
|
109
|
-
try {
|
|
110
|
-
await handleRateLimit(() => aniLink.anilist.query.airingSchedule({ mediaId: 'invalid' }))
|
|
111
|
-
} catch (error) {
|
|
112
|
-
expect(error).toBeDefined()
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
test('character query should return a response', async () => {
|
|
117
|
-
try {
|
|
118
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.character({ id: 1, asHtml: true, mediaSort: ['POPULARITY_DESC'], mediaType: 'ANIME', mediaOnList: true, mediaPage: 1, mediaPerPage: 10 }))
|
|
119
|
-
console.log(response)
|
|
120
|
-
expect(response).toBeDefined()
|
|
121
|
-
} catch (error: any) {
|
|
122
|
-
if (error.response.data) {
|
|
123
|
-
throw error.response.data
|
|
124
|
-
} else {
|
|
125
|
-
throw error.response
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
test('character query should handle errors', async () => {
|
|
131
|
-
try {
|
|
132
|
-
await handleRateLimit(() => aniLink.anilist.query.character({ id: 'invalid', asHtml: true, mediaSort: ['POPULARITY_DESC'], mediaOnList: true, mediaPage: 1, mediaPerPage: 10 }))
|
|
133
|
-
} catch (error) {
|
|
134
|
-
expect(error).toBeDefined()
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
test('staff query should return a response', async () => {
|
|
139
|
-
try {
|
|
140
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.staff({
|
|
141
|
-
id: 132186,
|
|
142
|
-
asHtml: true,
|
|
143
|
-
staffMediaSort: ['POPULARITY_DESC'],
|
|
144
|
-
staffMediaType: 'ANIME',
|
|
145
|
-
staffMediaOnList: true,
|
|
146
|
-
staffMediaPage: 1,
|
|
147
|
-
staffMediaPerPage: 10,
|
|
148
|
-
charactersSort: ['ID'],
|
|
149
|
-
charactersPage: 1,
|
|
150
|
-
charactersPerPage: 10,
|
|
151
|
-
characterMediaSort: ['POPULARITY_DESC'],
|
|
152
|
-
characterMediaOnList: true,
|
|
153
|
-
characterMediaPage: 1,
|
|
154
|
-
characterMediaPerPage: 10
|
|
155
|
-
}))
|
|
156
|
-
console.log(response)
|
|
157
|
-
expect(response).toBeDefined()
|
|
158
|
-
} catch (error: any) {
|
|
159
|
-
if (error.response.data) {
|
|
160
|
-
throw error.response.data
|
|
161
|
-
} else {
|
|
162
|
-
throw error.response
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
test('staff query should handle errors', async () => {
|
|
168
|
-
try {
|
|
169
|
-
await handleRateLimit(() => aniLink.anilist.query.staff({
|
|
170
|
-
id: 'invalid'
|
|
171
|
-
}))
|
|
172
|
-
} catch (error) {
|
|
173
|
-
expect(error).toBeDefined()
|
|
174
|
-
}
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
test('media list query should return a response', async () => {
|
|
178
|
-
try {
|
|
179
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.mediaList({ userId: 542244 }))
|
|
180
|
-
console.log(response)
|
|
181
|
-
expect(response).toBeDefined()
|
|
182
|
-
} catch (error: any) {
|
|
183
|
-
if (error.response.data) {
|
|
184
|
-
throw error.response.data
|
|
185
|
-
} else {
|
|
186
|
-
throw error.response
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
test('media list query should handle errors', async () => {
|
|
192
|
-
try {
|
|
193
|
-
await handleRateLimit(() => aniLink.anilist.query.mediaList({ userId: 'invalid' }))
|
|
194
|
-
} catch (error) {
|
|
195
|
-
expect(error).toBeDefined()
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
test('media list collection query should return a response', async () => {
|
|
200
|
-
try {
|
|
201
|
-
const response = await handleRateLimit(() => aniLink.anilist.query.mediaListCollection({
|
|
202
|
-
userId: 542244,
|
|
203
|
-
type: 'ANIME',
|
|
204
|
-
status: 'COMPLETED',
|
|
205
|
-
chunk: 1,
|
|
206
|
-
perChunk: 10000
|
|
207
|
-
}))
|
|
208
|
-
console.log(response)
|
|
209
|
-
expect(response).toBeDefined()
|
|
210
|
-
} catch (error: any) {
|
|
211
|
-
if (error.response.data) {
|
|
212
|
-
throw error.response.data
|
|
213
|
-
} else {
|
|
214
|
-
throw error.response
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
test('media list collection query should handle errors', async () => {
|
|
220
|
-
try {
|
|
221
|
-
await handleRateLimit(() => aniLink.anilist.query.mediaListCollection({
|
|
222
|
-
userId: 'invalid'
|
|
223
|
-
}))
|
|
224
|
-
} catch (error) {
|
|
225
|
-
expect(error).toBeDefined()
|
|
226
|
-
}
|
|
227
|
-
})
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
describe('Anilist API Mutation', () => {
|
|
231
|
-
let aniLink: AniLink
|
|
232
|
-
|
|
233
|
-
beforeAll(() => {
|
|
234
|
-
const token = process.env.ANILIST_TOKEN
|
|
235
|
-
aniLink = new AniLink(token)
|
|
236
|
-
})
|
|
237
|
-
|
|
238
|
-
test('update user', async () => {
|
|
239
|
-
try {
|
|
240
|
-
const response = await handleRateLimit(() => aniLink.anilist.mutation.updateUser({
|
|
241
|
-
about: 'New about text',
|
|
242
|
-
titleLanguage: 'ENGLISH',
|
|
243
|
-
displayAdultContent: true,
|
|
244
|
-
airingNotifications: true,
|
|
245
|
-
scoreFormat: 'POINT_10',
|
|
246
|
-
rowOrder: 'title',
|
|
247
|
-
profileColor: 'blue',
|
|
248
|
-
donatorBadge: 'Supporter',
|
|
249
|
-
notificationOptions: [{ type: 'AIRING', enabled: true }],
|
|
250
|
-
timezone: '-06:00',
|
|
251
|
-
activityMergeTime: 30,
|
|
252
|
-
animeListOptions: { sectionOrder: ['title'], customLists: [], advancedScoring: [], advancedScoringEnabled: false },
|
|
253
|
-
mangaListOptions: { sectionOrder: ['title'], customLists: [], advancedScoring: [], advancedScoringEnabled: false },
|
|
254
|
-
staffNameLanguage: 'ROMAJI',
|
|
255
|
-
restrictMessagesToFollowing: false,
|
|
256
|
-
disabledListActivity: [{ type: 'CURRENT', disabled: false }]
|
|
257
|
-
}))
|
|
258
|
-
console.log(response)
|
|
259
|
-
expect(response).toBeDefined()
|
|
260
|
-
} catch (error: any) {
|
|
261
|
-
if (error.response.data) {
|
|
262
|
-
throw error.response.data
|
|
263
|
-
} else {
|
|
264
|
-
throw error.response
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
})
|
|
268
|
-
})
|
package/babel.config.js
DELETED
package/jest.config.js
DELETED
package/src/AniLink.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { UserQuery } from './apis/anilist/query/User'
|
|
2
|
-
import { MediaQuery } from './apis/anilist/query/Media'
|
|
3
|
-
import { MediaTrendQuery } from './apis/anilist/query/MediaTrend'
|
|
4
|
-
import { AiringScheduleQuery } from './apis/anilist/query/AiringSchedule'
|
|
5
|
-
import { CharacterQuery } from './apis/anilist/query/Character'
|
|
6
|
-
import { MediaListQuery } from './apis/anilist/query/MediaList'
|
|
7
|
-
import { StaffQuery } from './apis/anilist/query/Staff'
|
|
8
|
-
import { MediaListCollectionQuery } from './apis/anilist/query/MediaListCollection'
|
|
9
|
-
import {
|
|
10
|
-
ListActivityOptionInput,
|
|
11
|
-
MediaListOptionsInput,
|
|
12
|
-
NotificationOptionInput,
|
|
13
|
-
ScoreFormat,
|
|
14
|
-
UpdateUserMutation,
|
|
15
|
-
UserTitleLanguage
|
|
16
|
-
} from './apis/anilist/mutation/UpdateUser'
|
|
17
|
-
|
|
18
|
-
class AniLink {
|
|
19
|
-
public anilist: {
|
|
20
|
-
query: {
|
|
21
|
-
user: () => Promise<any>
|
|
22
|
-
media: () => Promise<any>
|
|
23
|
-
mediaTrend: () => Promise<any>
|
|
24
|
-
airingSchedule: () => Promise<any>
|
|
25
|
-
character: () => Promise<any>
|
|
26
|
-
staff: () => Promise<any>
|
|
27
|
-
mediaList: () => Promise<any>
|
|
28
|
-
mediaListCollection: () => Promise<any>
|
|
29
|
-
}
|
|
30
|
-
mutation: {
|
|
31
|
-
updateUser: (variables: {
|
|
32
|
-
about?: string
|
|
33
|
-
titleLanguage?: UserTitleLanguage
|
|
34
|
-
displayAdultContent?: boolean
|
|
35
|
-
airingNotifications?: boolean
|
|
36
|
-
scoreFormat?: ScoreFormat
|
|
37
|
-
rowOrder?: string
|
|
38
|
-
profileColor?: string
|
|
39
|
-
donatorBadge?: string
|
|
40
|
-
notificationOptions?: NotificationOptionInput[]
|
|
41
|
-
timezone?: string
|
|
42
|
-
activityMergeTime?: number
|
|
43
|
-
animeListOptions?: MediaListOptionsInput
|
|
44
|
-
mangaListOptions?: MediaListOptionsInput
|
|
45
|
-
staffNameLanguage?: UserTitleLanguage
|
|
46
|
-
restrictMessagesToFollowing?: boolean
|
|
47
|
-
disabledListActivity?: ListActivityOptionInput[]
|
|
48
|
-
}) => Promise<any>
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
constructor (authToken: string) {
|
|
53
|
-
const userQueryInstance = new UserQuery(authToken)
|
|
54
|
-
const mediaQueryInstance = new MediaQuery(authToken)
|
|
55
|
-
const mediaTrendQueryInstance = new MediaTrendQuery(authToken)
|
|
56
|
-
const airingScheduleQueryInstance = new AiringScheduleQuery(authToken)
|
|
57
|
-
const characterQueryInstance = new CharacterQuery(authToken)
|
|
58
|
-
const staffQueryInstance = new StaffQuery(authToken)
|
|
59
|
-
const mediaListQueryInstance = new MediaListQuery(authToken)
|
|
60
|
-
const mediaListCollectionQueryInstance = new MediaListCollectionQuery(authToken)
|
|
61
|
-
const updateUserMutationInstance = new UpdateUserMutation(authToken)
|
|
62
|
-
this.anilist = {
|
|
63
|
-
query: {
|
|
64
|
-
user: userQueryInstance.user.bind(userQueryInstance),
|
|
65
|
-
media: mediaQueryInstance.media.bind(mediaQueryInstance),
|
|
66
|
-
mediaTrend: mediaTrendQueryInstance.mediaTrend.bind(mediaTrendQueryInstance),
|
|
67
|
-
airingSchedule: airingScheduleQueryInstance.airingSchedule.bind(airingScheduleQueryInstance),
|
|
68
|
-
character: characterQueryInstance.character.bind(characterQueryInstance),
|
|
69
|
-
staff: staffQueryInstance.staff.bind(staffQueryInstance),
|
|
70
|
-
mediaList: mediaListQueryInstance.mediaList.bind(mediaListQueryInstance),
|
|
71
|
-
mediaListCollection: mediaListCollectionQueryInstance.mediaListCollection.bind(mediaListQueryInstance)
|
|
72
|
-
},
|
|
73
|
-
mutation: {
|
|
74
|
-
updateUser: updateUserMutationInstance.updateUser.bind(updateUserMutationInstance)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
module.exports = AniLink
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Tag } from './Tag'
|
|
2
|
-
import { Staff } from './Staff'
|
|
3
|
-
import { Studio } from './Studio'
|
|
4
|
-
|
|
5
|
-
export interface Favoured {
|
|
6
|
-
genre?: string
|
|
7
|
-
amount: number
|
|
8
|
-
meanScore: number
|
|
9
|
-
timeWatched: number
|
|
10
|
-
tag?: Tag
|
|
11
|
-
staff?: Staff
|
|
12
|
-
studio?: Studio
|
|
13
|
-
year?: number
|
|
14
|
-
format?: string
|
|
15
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
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'
|
|
10
|
-
import { MediaStats } from './MediaStats'
|
|
11
|
-
import { MediaListEntry } from './MediaListEntry'
|
|
12
|
-
|
|
13
|
-
export interface Media {
|
|
14
|
-
id: number
|
|
15
|
-
idMal: number
|
|
16
|
-
title: Title
|
|
17
|
-
type: string
|
|
18
|
-
format: string
|
|
19
|
-
status: string
|
|
20
|
-
description: string
|
|
21
|
-
startDate: FuzzyDate
|
|
22
|
-
endDate: FuzzyDate
|
|
23
|
-
season: string
|
|
24
|
-
seasonYear: number
|
|
25
|
-
seasonInt: number
|
|
26
|
-
episodes?: number
|
|
27
|
-
duration?: number
|
|
28
|
-
chapters?: number
|
|
29
|
-
volumes?: number
|
|
30
|
-
countryOfOrigin: string
|
|
31
|
-
isLicensed: boolean
|
|
32
|
-
source: string
|
|
33
|
-
hashtag: string
|
|
34
|
-
trailer: Trailer
|
|
35
|
-
updatedAt: number
|
|
36
|
-
coverImage: CoverImage
|
|
37
|
-
bannerImage: string
|
|
38
|
-
genres: string[]
|
|
39
|
-
synonyms: string[]
|
|
40
|
-
averageScore: number
|
|
41
|
-
meanScore: number
|
|
42
|
-
popularity: number
|
|
43
|
-
isLocked: boolean
|
|
44
|
-
trending: number
|
|
45
|
-
favourites: number
|
|
46
|
-
tags: Tag[]
|
|
47
|
-
isFavourite: boolean
|
|
48
|
-
isAdult: boolean
|
|
49
|
-
nextAiringEpisode: NextAiringEpisode
|
|
50
|
-
externalLinks: ExternalLink[]
|
|
51
|
-
streamingEpisodes: StreamingEpisode[]
|
|
52
|
-
rankings: Ranking[]
|
|
53
|
-
mediaListEntry: MediaListEntry
|
|
54
|
-
stats: MediaStats
|
|
55
|
-
siteUrl: string
|
|
56
|
-
autoCreateForumThread: boolean
|
|
57
|
-
isRecommendationBlocked: boolean
|
|
58
|
-
modNotes: string
|
|
59
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Stat } from './Stat'
|
|
2
|
-
|
|
3
|
-
export interface MediaStatistics {
|
|
4
|
-
count: number
|
|
5
|
-
meanScore: number
|
|
6
|
-
standardDeviation: number
|
|
7
|
-
minutesWatched?: number
|
|
8
|
-
episodesWatched?: number
|
|
9
|
-
chaptersRead?: number
|
|
10
|
-
volumesRead?: number
|
|
11
|
-
formats: Stat[]
|
|
12
|
-
statuses: Stat[]
|
|
13
|
-
scores: Stat[]
|
|
14
|
-
lengths: Stat[]
|
|
15
|
-
releaseYears: Stat[]
|
|
16
|
-
startYears: Stat[]
|
|
17
|
-
genres: Stat[]
|
|
18
|
-
tags: Stat[]
|
|
19
|
-
countries: Stat[]
|
|
20
|
-
voiceActors?: Stat[]
|
|
21
|
-
staff: Stat[]
|
|
22
|
-
studios: Stat[]
|
|
23
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Ranking {
|
|
2
|
-
id: number
|
|
3
|
-
rank: number
|
|
4
|
-
type: string
|
|
5
|
-
format: string
|
|
6
|
-
year: number
|
|
7
|
-
season: string
|
|
8
|
-
allTime: boolean
|
|
9
|
-
context: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const RankingSchema = `
|
|
13
|
-
rankings {
|
|
14
|
-
id
|
|
15
|
-
rank
|
|
16
|
-
type
|
|
17
|
-
format
|
|
18
|
-
year
|
|
19
|
-
season
|
|
20
|
-
allTime
|
|
21
|
-
context
|
|
22
|
-
}
|
|
23
|
-
`
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Tag } from './Tag'
|
|
2
|
-
import { Staff } from './Staff'
|
|
3
|
-
import { Studio } from './Studio'
|
|
4
|
-
|
|
5
|
-
export interface Stat {
|
|
6
|
-
count: number
|
|
7
|
-
meanScore: number
|
|
8
|
-
minutesWatched?: number
|
|
9
|
-
chaptersRead?: number
|
|
10
|
-
mediaIds: number[]
|
|
11
|
-
format?: string
|
|
12
|
-
status?: string
|
|
13
|
-
score?: number
|
|
14
|
-
length?: number
|
|
15
|
-
releaseYear?: number
|
|
16
|
-
startYear?: number
|
|
17
|
-
genre?: string
|
|
18
|
-
tag?: Tag
|
|
19
|
-
country?: string
|
|
20
|
-
voiceActor?: Staff
|
|
21
|
-
characterIds?: number[]
|
|
22
|
-
staff?: Staff
|
|
23
|
-
studio?: Studio
|
|
24
|
-
}
|