anilink-api-wrapper 1.1.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/Tag.js +2 -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/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/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
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
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface Tag {
|
|
2
|
-
id: number
|
|
3
|
-
name: string
|
|
4
|
-
description: string
|
|
5
|
-
category: string
|
|
6
|
-
rank: number
|
|
7
|
-
isGeneralSpoiler: boolean
|
|
8
|
-
isMediaSpoiler: boolean
|
|
9
|
-
isAdult: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const TagSchema = `
|
|
13
|
-
id
|
|
14
|
-
name
|
|
15
|
-
description
|
|
16
|
-
rank
|
|
17
|
-
isGeneralSpoiler
|
|
18
|
-
isMediaSpoiler
|
|
19
|
-
isAdult
|
|
20
|
-
`
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ActivityHistory } from './ActivityHistory'
|
|
2
|
-
import { Distribution } from './Distribution'
|
|
3
|
-
import { ScoreDistribution } from './ScoreDistribution'
|
|
4
|
-
import { ListScores } from './ListScores'
|
|
5
|
-
import { Favoured } from './Favoured'
|
|
6
|
-
|
|
7
|
-
export interface UserStats {
|
|
8
|
-
watchedTime: number
|
|
9
|
-
chaptersRead: number
|
|
10
|
-
activityHistory: ActivityHistory[]
|
|
11
|
-
animeStatusDistribution: Distribution[]
|
|
12
|
-
mangaStatusDistribution: Distribution[]
|
|
13
|
-
animeScoreDistribution: ScoreDistribution[]
|
|
14
|
-
mangaScoreDistribution: ScoreDistribution[]
|
|
15
|
-
animeListScores: ListScores
|
|
16
|
-
mangaListScores: ListScores
|
|
17
|
-
favouredGenresOverview: Favoured[]
|
|
18
|
-
favouredGenres: Favoured[]
|
|
19
|
-
favouredTags: Favoured[]
|
|
20
|
-
favouredActors: Favoured[]
|
|
21
|
-
favouredStaff: Favoured[]
|
|
22
|
-
favouredStudios: Favoured[]
|
|
23
|
-
favouredYears: Favoured[]
|
|
24
|
-
favouredFormats: Favoured[]
|
|
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,22 +0,0 @@
|
|
|
1
|
-
import { Media } from '../Media'
|
|
2
|
-
import { MediaSchema } from './Media'
|
|
3
|
-
|
|
4
|
-
export interface AiringScheduleResponse {
|
|
5
|
-
id: number
|
|
6
|
-
airingAt: number
|
|
7
|
-
timeUntilAiring: number
|
|
8
|
-
episode: number
|
|
9
|
-
mediaId: number
|
|
10
|
-
media: Media
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const AiringScheduleSchema = `
|
|
14
|
-
id
|
|
15
|
-
airingAt
|
|
16
|
-
timeUntilAiring
|
|
17
|
-
episode
|
|
18
|
-
mediaId
|
|
19
|
-
media {
|
|
20
|
-
${MediaSchema}
|
|
21
|
-
}
|
|
22
|
-
`
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
|
|
6
|
-
export interface CharacterResponse {
|
|
7
|
-
id: number
|
|
8
|
-
name: Name
|
|
9
|
-
image: Image
|
|
10
|
-
description: string
|
|
11
|
-
gender: string
|
|
12
|
-
dateOfBirth: FuzzyDate
|
|
13
|
-
age: string
|
|
14
|
-
bloodType: string
|
|
15
|
-
isFavourite: boolean
|
|
16
|
-
isFavouriteBlocked: boolean
|
|
17
|
-
siteUrl: string
|
|
18
|
-
media: {
|
|
19
|
-
nodes: Array<{
|
|
20
|
-
id: number
|
|
21
|
-
title: Title
|
|
22
|
-
}>
|
|
23
|
-
}
|
|
24
|
-
favourites: number
|
|
25
|
-
modNotes: string
|
|
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
|
-
`
|