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.
- package/dist/AniLink.js +10 -1
- package/dist/apis/anilist/interfaces/CoverImage.js +9 -0
- package/dist/apis/anilist/interfaces/ExternalLink.js +8 -0
- package/dist/apis/anilist/interfaces/FuzzyDate.js +6 -0
- package/dist/apis/anilist/interfaces/Image.js +7 -0
- package/dist/apis/anilist/interfaces/MediaListEntry.js +7 -0
- package/dist/apis/anilist/interfaces/Name.js +9 -0
- package/dist/apis/anilist/interfaces/NextAiringEpisode.js +8 -0
- package/dist/apis/anilist/interfaces/Ranking.js +13 -0
- package/dist/apis/anilist/interfaces/ScoreDistribution.js +7 -0
- package/dist/apis/anilist/interfaces/StatusDistribution.js +7 -0
- package/dist/apis/anilist/interfaces/StreamingEpisode.js +9 -0
- package/dist/apis/anilist/interfaces/Tag.js +12 -0
- package/dist/apis/anilist/interfaces/Title.js +9 -0
- package/dist/apis/anilist/interfaces/Trailer.js +8 -0
- package/dist/apis/anilist/interfaces/UserStats.js +13 -0
- package/dist/apis/anilist/interfaces/responses/AiringSchedule.js +12 -0
- package/dist/apis/anilist/interfaces/responses/Character.js +28 -0
- package/dist/apis/anilist/interfaces/responses/Media.js +208 -0
- package/dist/apis/anilist/interfaces/responses/MediaList.js +30 -0
- package/dist/apis/anilist/interfaces/responses/MediaListCollectionResponse.js +39 -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/MediaTrend.js +15 -0
- package/dist/apis/anilist/interfaces/responses/Staff.js +53 -0
- package/dist/apis/anilist/interfaces/responses/User.js +360 -0
- package/dist/apis/anilist/query/AiringSchedule.js +3 -115
- package/dist/apis/anilist/query/Character.js +2 -36
- package/dist/apis/anilist/query/GenreCollection.js +32 -0
- package/dist/apis/anilist/query/Media.js +3 -200
- package/dist/apis/anilist/query/MediaList.js +2 -137
- package/dist/apis/anilist/query/MediaListCollection.js +2 -623
- package/dist/apis/anilist/query/MediaTagCollection.js +35 -0
- package/dist/apis/anilist/query/MediaTrend.js +3 -117
- package/dist/apis/anilist/query/Staff.js +2 -75
- package/dist/apis/anilist/query/User.js +8 -546
- 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 -6
- package/src/apis/anilist/interfaces/Distribution.ts +0 -4
- package/src/apis/anilist/interfaces/ExternalLink.ts +0 -5
- package/src/apis/anilist/interfaces/Favoured.ts +0 -15
- package/src/apis/anilist/interfaces/FuzzyDate.ts +0 -5
- package/src/apis/anilist/interfaces/Image.ts +0 -4
- 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 -4
- 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 -8
- package/src/apis/anilist/interfaces/NextAiringEpisode.ts +0 -5
- package/src/apis/anilist/interfaces/Ranking.ts +0 -10
- package/src/apis/anilist/interfaces/ScoreDistribution.ts +0 -4
- 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 -4
- package/src/apis/anilist/interfaces/StreamingEpisode.ts +0 -6
- package/src/apis/anilist/interfaces/Studio.ts +0 -4
- package/src/apis/anilist/interfaces/Tag.ts +0 -10
- package/src/apis/anilist/interfaces/Title.ts +0 -6
- package/src/apis/anilist/interfaces/Trailer.ts +0 -5
- package/src/apis/anilist/interfaces/UserStats.ts +0 -25
- package/src/apis/anilist/interfaces/responses/AiringSchedule.ts +0 -10
- package/src/apis/anilist/interfaces/responses/Character.ts +0 -26
- package/src/apis/anilist/interfaces/responses/Media.ts +0 -118
- package/src/apis/anilist/interfaces/responses/MediaList.ts +0 -24
- package/src/apis/anilist/interfaces/responses/MediaListCollectionResponse.ts +0 -37
- package/src/apis/anilist/interfaces/responses/MediaTrend.ts +0 -13
- package/src/apis/anilist/interfaces/responses/Staff.ts +0 -53
- package/src/apis/anilist/interfaces/responses/User.ts +0 -72
- package/src/apis/anilist/mutation/UpdateUser.ts +0 -162
- package/src/apis/anilist/query/AiringSchedule.ts +0 -160
- package/src/apis/anilist/query/Character.ts +0 -75
- package/src/apis/anilist/query/Media.ts +0 -295
- package/src/apis/anilist/query/MediaList.ts +0 -192
- package/src/apis/anilist/query/MediaListCollection.ts +0 -673
- package/src/apis/anilist/query/MediaTrend.ts +0 -169
- package/src/apis/anilist/query/Staff.ts +0 -122
- package/src/apis/anilist/query/User.ts +0 -567
- package/src/base/APIWrapper.ts +0 -7
- package/src/base/RequestHandler.ts +0 -21
- package/tsconfig.json +0 -15
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { APIWrapper } from '../../../base/APIWrapper'
|
|
2
|
-
import { sendRequest } from '../../../base/RequestHandler'
|
|
3
|
-
import { MediaTrendResponse } from '../interfaces/responses/MediaTrend'
|
|
4
|
-
|
|
5
|
-
interface MediaTrendVariables {
|
|
6
|
-
mediaId?: number
|
|
7
|
-
date?: number
|
|
8
|
-
trending?: number
|
|
9
|
-
averageScore?: number
|
|
10
|
-
popularity?: number
|
|
11
|
-
episode?: number
|
|
12
|
-
releasing?: boolean
|
|
13
|
-
mediaId_not?: number
|
|
14
|
-
mediaId_in?: number[]
|
|
15
|
-
mediaId_not_in?: number[]
|
|
16
|
-
date_greater?: number
|
|
17
|
-
date_lesser?: number
|
|
18
|
-
trending_greater?: number
|
|
19
|
-
trending_lesser?: number
|
|
20
|
-
trending_not?: number
|
|
21
|
-
averageScore_greater?: number
|
|
22
|
-
averageScore_lesser?: number
|
|
23
|
-
averageScore_not?: number
|
|
24
|
-
popularity_greater?: number
|
|
25
|
-
popularity_lesser?: number
|
|
26
|
-
popularity_not?: number
|
|
27
|
-
episode_greater?: number
|
|
28
|
-
episode_lesser?: number
|
|
29
|
-
episode_not?: number
|
|
30
|
-
sort?: string[]
|
|
31
|
-
type?: 'ANIME' | 'MANGA'
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export class MediaTrendQuery extends APIWrapper {
|
|
35
|
-
private readonly authToken: string
|
|
36
|
-
|
|
37
|
-
constructor (authToken: string) {
|
|
38
|
-
super('https://graphql.anilist.co')
|
|
39
|
-
this.authToken = authToken
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async mediaTrend (variables?: MediaTrendVariables): Promise<MediaTrendResponse> {
|
|
43
|
-
const query = `
|
|
44
|
-
query ($mediaId: Int, $date: Int, $trending: Int, $averageScore: Int, $popularity: Int, $episode: Int, $releasing: Boolean, $mediaId_not: Int, $mediaId_in: [Int], $mediaId_not_in: [Int], $date_greater: Int, $date_lesser: Int, $trending_greater: Int, $trending_lesser: Int, $trending_not: Int, $averageScore_greater: Int, $averageScore_lesser: Int, $averageScore_not: Int, $popularity_greater: Int, $popularity_lesser: Int, $popularity_not: Int, $episode_greater: Int, $episode_lesser: Int, $episode_not: Int, $sort: [MediaTrendSort]) {
|
|
45
|
-
MediaTrend (mediaId: $mediaId, date: $date, trending: $trending, averageScore: $averageScore, popularity: $popularity, episode: $episode, releasing: $releasing, mediaId_not: $mediaId_not, mediaId_in: $mediaId_in, mediaId_not_in: $mediaId_not_in, date_greater: $date_greater, date_lesser: $date_lesser, trending_greater: $trending_greater, trending_lesser: $trending_lesser, trending_not: $trending_not, averageScore_greater: $averageScore_greater, averageScore_lesser: $averageScore_lesser, averageScore_not: $averageScore_not, popularity_greater: $popularity_greater, popularity_lesser: $popularity_lesser, popularity_not: $popularity_not, episode_greater: $episode_greater, episode_lesser: $episode_lesser, episode_not: $episode_not, sort: $sort) {
|
|
46
|
-
mediaId
|
|
47
|
-
date
|
|
48
|
-
trending
|
|
49
|
-
averageScore
|
|
50
|
-
popularity
|
|
51
|
-
inProgress
|
|
52
|
-
releasing
|
|
53
|
-
episode
|
|
54
|
-
media {
|
|
55
|
-
id
|
|
56
|
-
idMal
|
|
57
|
-
title {
|
|
58
|
-
romaji
|
|
59
|
-
english
|
|
60
|
-
native
|
|
61
|
-
userPreferred
|
|
62
|
-
}
|
|
63
|
-
type
|
|
64
|
-
format
|
|
65
|
-
status
|
|
66
|
-
description
|
|
67
|
-
startDate {
|
|
68
|
-
year
|
|
69
|
-
month
|
|
70
|
-
day
|
|
71
|
-
}
|
|
72
|
-
endDate {
|
|
73
|
-
year
|
|
74
|
-
month
|
|
75
|
-
day
|
|
76
|
-
}
|
|
77
|
-
season
|
|
78
|
-
seasonYear
|
|
79
|
-
seasonInt
|
|
80
|
-
${variables?.type === 'ANIME' ? 'episodes\nduration' : 'chapters\nvolumes'}
|
|
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
|
-
rank
|
|
111
|
-
isGeneralSpoiler
|
|
112
|
-
isMediaSpoiler
|
|
113
|
-
isAdult
|
|
114
|
-
}
|
|
115
|
-
isFavourite
|
|
116
|
-
isAdult
|
|
117
|
-
nextAiringEpisode {
|
|
118
|
-
airingAt
|
|
119
|
-
timeUntilAiring
|
|
120
|
-
episode
|
|
121
|
-
}
|
|
122
|
-
externalLinks {
|
|
123
|
-
id
|
|
124
|
-
url
|
|
125
|
-
site
|
|
126
|
-
}
|
|
127
|
-
streamingEpisodes {
|
|
128
|
-
title
|
|
129
|
-
thumbnail
|
|
130
|
-
url
|
|
131
|
-
site
|
|
132
|
-
}
|
|
133
|
-
rankings {
|
|
134
|
-
id
|
|
135
|
-
rank
|
|
136
|
-
type
|
|
137
|
-
format
|
|
138
|
-
year
|
|
139
|
-
season
|
|
140
|
-
allTime
|
|
141
|
-
context
|
|
142
|
-
}
|
|
143
|
-
mediaListEntry {
|
|
144
|
-
id
|
|
145
|
-
status
|
|
146
|
-
}
|
|
147
|
-
stats {
|
|
148
|
-
scoreDistribution {
|
|
149
|
-
score
|
|
150
|
-
amount
|
|
151
|
-
}
|
|
152
|
-
statusDistribution {
|
|
153
|
-
status
|
|
154
|
-
amount
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
siteUrl
|
|
158
|
-
autoCreateForumThread
|
|
159
|
-
isRecommendationBlocked
|
|
160
|
-
modNotes
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
`
|
|
165
|
-
|
|
166
|
-
const data = { query, variables }
|
|
167
|
-
return await sendRequest(this.baseURL, 'POST', data, this.authToken)
|
|
168
|
-
}
|
|
169
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { APIWrapper } from '../../../base/APIWrapper'
|
|
2
|
-
import { sendRequest } from '../../../base/RequestHandler'
|
|
3
|
-
import { StaffResponse } from '../interfaces/responses/Staff'
|
|
4
|
-
|
|
5
|
-
interface StaffVariables {
|
|
6
|
-
id?: number
|
|
7
|
-
isBirthday?: boolean
|
|
8
|
-
search?: string
|
|
9
|
-
id_not?: number
|
|
10
|
-
id_in?: number[]
|
|
11
|
-
id_not_in?: number[]
|
|
12
|
-
sort?: string[]
|
|
13
|
-
asHtml?: boolean
|
|
14
|
-
staffMediaSort?: string[]
|
|
15
|
-
staffMediaType?: string
|
|
16
|
-
staffMediaOnList?: boolean
|
|
17
|
-
staffMediaPage?: number
|
|
18
|
-
staffMediaPerPage?: number
|
|
19
|
-
charactersSort?: string[]
|
|
20
|
-
charactersPage?: number
|
|
21
|
-
charactersPerPage?: number
|
|
22
|
-
characterMediaSort?: string[]
|
|
23
|
-
characterMediaOnList?: boolean
|
|
24
|
-
characterMediaPage?: number
|
|
25
|
-
characterMediaPerPage?: number
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export class StaffQuery extends APIWrapper {
|
|
29
|
-
private readonly authToken: string
|
|
30
|
-
|
|
31
|
-
constructor (authToken: string) {
|
|
32
|
-
super('https://graphql.anilist.co')
|
|
33
|
-
this.authToken = authToken
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async staff (variables?: StaffVariables): Promise<StaffResponse> {
|
|
37
|
-
const query = `
|
|
38
|
-
query ($id: Int, $isBirthday: Boolean, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [StaffSort], $asHtml: Boolean, $staffMediaSort: [MediaSort], $staffMediaType: MediaType, $staffMediaOnList: Boolean, $staffMediaPage: Int, $staffMediaPerPage: Int, $charactersSort: [CharacterSort], $charactersPage: Int, $charactersPerPage: Int, $characterMediaSort: [MediaSort], $characterMediaOnList: Boolean, $characterMediaPage: Int, $characterMediaPerPage: Int) {
|
|
39
|
-
Staff (id: $id, isBirthday: $isBirthday, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) {
|
|
40
|
-
id
|
|
41
|
-
name {
|
|
42
|
-
first
|
|
43
|
-
last
|
|
44
|
-
full
|
|
45
|
-
native
|
|
46
|
-
alternative
|
|
47
|
-
userPreferred
|
|
48
|
-
}
|
|
49
|
-
languageV2
|
|
50
|
-
image {
|
|
51
|
-
large
|
|
52
|
-
medium
|
|
53
|
-
}
|
|
54
|
-
description(asHtml: $asHtml)
|
|
55
|
-
primaryOccupations
|
|
56
|
-
gender
|
|
57
|
-
dateOfBirth {
|
|
58
|
-
year
|
|
59
|
-
month
|
|
60
|
-
day
|
|
61
|
-
}
|
|
62
|
-
dateOfDeath {
|
|
63
|
-
year
|
|
64
|
-
month
|
|
65
|
-
day
|
|
66
|
-
}
|
|
67
|
-
age
|
|
68
|
-
yearsActive
|
|
69
|
-
homeTown
|
|
70
|
-
bloodType
|
|
71
|
-
isFavourite
|
|
72
|
-
isFavouriteBlocked
|
|
73
|
-
siteUrl
|
|
74
|
-
staffMedia (sort: $staffMediaSort, type: $staffMediaType, onList: $staffMediaOnList, page: $staffMediaPage, perPage: $staffMediaPerPage) {
|
|
75
|
-
nodes {
|
|
76
|
-
id
|
|
77
|
-
title {
|
|
78
|
-
romaji
|
|
79
|
-
english
|
|
80
|
-
native
|
|
81
|
-
userPreferred
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
characters (sort: $charactersSort, page: $charactersPage, perPage: $charactersPerPage) {
|
|
86
|
-
nodes {
|
|
87
|
-
id
|
|
88
|
-
name {
|
|
89
|
-
first
|
|
90
|
-
last
|
|
91
|
-
full
|
|
92
|
-
native
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
characterMedia (sort: $characterMediaSort, onList: $characterMediaOnList, page: $characterMediaPage, perPage: $characterMediaPerPage) {
|
|
97
|
-
nodes {
|
|
98
|
-
id
|
|
99
|
-
title {
|
|
100
|
-
romaji
|
|
101
|
-
english
|
|
102
|
-
native
|
|
103
|
-
userPreferred
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
submitter {
|
|
108
|
-
id
|
|
109
|
-
name
|
|
110
|
-
}
|
|
111
|
-
submissionStatus
|
|
112
|
-
submissionNotes
|
|
113
|
-
favourites
|
|
114
|
-
modNotes
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`
|
|
118
|
-
|
|
119
|
-
const data = { query, variables }
|
|
120
|
-
return await sendRequest(this.baseURL, 'POST', data, this.authToken)
|
|
121
|
-
}
|
|
122
|
-
}
|