parent
25336320ce
commit
06224623ef
121
src/anilist.ts
121
src/anilist.ts
|
@ -16,6 +16,7 @@ import {
|
|||
RecommendationArguments,
|
||||
RecommendationSort,
|
||||
ReviewArguments,
|
||||
SiteStatisticsArguments,
|
||||
StaffArguments,
|
||||
StaffLanguage,
|
||||
StaffSort,
|
||||
|
@ -370,6 +371,57 @@ const UserAvatar = (query: ReturnType<typeof updateOperation>[], level: number)
|
|||
return this
|
||||
},
|
||||
})
|
||||
const SiteStatistics = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
withUsers(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "users", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withAnime(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "anime", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withManga(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "manga", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withCharacters(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "characters", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withStaff(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "staff", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withStudios(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "studios", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withReviews(args: AtLeastOne<SiteStatisticsArguments>, fn: Fn<typeof SiteTrendConnection>) {
|
||||
query[0] = query[0].set({ subField: "reviews", level, hasSubField: true, variables: args })
|
||||
let tmpQuery
|
||||
fn(SiteTrendConnection({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
})
|
||||
const ExternalLinkSourceCollection = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
/** The id of the external link */
|
||||
withId() {
|
||||
|
@ -2065,6 +2117,58 @@ const RecommendationConnection = ({ query, level }: Fields<typeof updateOperatio
|
|||
return this
|
||||
},
|
||||
})
|
||||
|
||||
const SiteTrend = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
/** The day the data was recorded (timestamp) */
|
||||
withDate() {
|
||||
query[0] = query[0].set({ subField: "date", level })
|
||||
return this
|
||||
},
|
||||
|
||||
withCount() {
|
||||
query[0] = query[0].set({ subField: "count", level })
|
||||
return this
|
||||
},
|
||||
/** The change from yesterday */
|
||||
withChange() {
|
||||
query[0] = query[0].set({ subField: "change", level })
|
||||
return this
|
||||
},
|
||||
})
|
||||
const SiteTrendEdge = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
withNode(fn: Fn<typeof SiteTrend>) {
|
||||
query[0] = query[0].set({ subField: "node", level, hasSubField: true })
|
||||
let tmpQuery
|
||||
fn(SiteTrend({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
})
|
||||
const SiteTrendConnection = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
withEdges(fn: Fn<typeof SiteTrendEdge>) {
|
||||
query[0] = query[0].set({ subField: "edges", level, hasSubField: true })
|
||||
let tmpQuery
|
||||
fn(SiteTrendEdge({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
withNodes(fn: Fn<typeof SiteTrend>) {
|
||||
query[0] = query[0].set({ subField: "nodes", level, hasSubField: true })
|
||||
let tmpQuery
|
||||
fn(SiteTrend({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
/** The pagination information */
|
||||
withPageInfo(fn: Fn<typeof PageInfo>) {
|
||||
query[0] = query[0].set({ subField: "pageInfo", level, hasSubField: true })
|
||||
let tmpQuery
|
||||
fn(PageInfo({ query: tmpQuery = [query[0]], level: level + 1 }))
|
||||
query[0] = tmpQuery[0]
|
||||
return this
|
||||
},
|
||||
})
|
||||
|
||||
const Character = ({ query, level }: Fields<typeof updateOperation>) => ({
|
||||
/** The id of the character */
|
||||
withId() {
|
||||
|
@ -2870,8 +2974,21 @@ export const Client = function (auth?: { token: string }) {
|
|||
throw "To be Implemented"
|
||||
},
|
||||
/** Site statistics query */
|
||||
SiteStatistics() {
|
||||
throw "To be Implemented"
|
||||
SiteStatistics(
|
||||
fn?: (fields: ReturnType<typeof SiteStatistics>) => void,
|
||||
) {
|
||||
operation = operation.set({
|
||||
subField: "SiteStatistics",
|
||||
hasSubField: true,
|
||||
level: 1,
|
||||
})
|
||||
if (!fn) operation = operation.set({ subField: "id", level: 2 })
|
||||
else {
|
||||
let tmpQuery
|
||||
fn(SiteStatistics({ query: tmpQuery = [operation], level: 2 }))
|
||||
operation = tmpQuery[0]
|
||||
}
|
||||
return this
|
||||
},
|
||||
/** ExternalLinkSource collection query */
|
||||
ExternalLinkSourceCollection(
|
||||
|
|
|
@ -705,3 +705,726 @@ export enum CharacterSort {
|
|||
RELEVANCE = "RELEVANCE",
|
||||
}
|
||||
|
||||
export type SiteStatisticsArguments = {
|
||||
sort: SiteTrendSort[]
|
||||
/** The page */
|
||||
page: Int
|
||||
/** The amount of entries per page, max 25 */
|
||||
perPage: Int
|
||||
}
|
||||
enum SiteTrendSort {
|
||||
DATE = "DATE",
|
||||
DATE_DESC = "DATE_DESC",
|
||||
COUNT = "COUNT",
|
||||
COUNT_DESC = "COUNT_DESC",
|
||||
CHANGE = "CHANGE",
|
||||
CHANGE_DESC = "CHANGE_DESC",
|
||||
}
|
||||
|
||||
type UserPreviousName = {
|
||||
/** A previous name of the user. */
|
||||
name: String | null
|
||||
/** When the user first changed from this name. */
|
||||
createdAt: Int | null
|
||||
/** When the user most recently changed from this name. */
|
||||
updatedAt: Int | null
|
||||
}
|
||||
enum ModRole {
|
||||
/** An AniList administrator */
|
||||
ADMIN = "ADMIN",
|
||||
/** A head developer of AniList */
|
||||
LEAD_DEVELOPER = "LEAD_DEVELOPER",
|
||||
/** An AniList developer */
|
||||
DEVELOPER = "DEVELOPER",
|
||||
/** A lead community moderator */
|
||||
LEAD_COMMUNITY = "LEAD_COMMUNITY",
|
||||
/** A community moderator */
|
||||
COMMUNITY = "COMMUNITY",
|
||||
/** A discord community moderator */
|
||||
DISCORD_COMMUNITY = "DISCORD_COMMUNITY",
|
||||
/** A lead anime data moderator */
|
||||
LEAD_ANIME_DATA = "LEAD_ANIME_DATA",
|
||||
/** An anime data moderator */
|
||||
ANIME_DATA = "ANIME_DATA",
|
||||
/** A lead manga data moderator */
|
||||
LEAD_MANGA_DATA = "LEAD_MANGA_DATA",
|
||||
/** A manga data moderator */
|
||||
MANGA_DATA = "MANGA_DATA",
|
||||
/** A lead social media moderator */
|
||||
LEAD_SOCIAL_MEDIA = "LEAD_SOCIAL_MEDIA",
|
||||
/** A social media moderator */
|
||||
SOCIAL_MEDIA = "SOCIAL_MEDIA",
|
||||
/** A retired moderator */
|
||||
RETIRED = "RETIRED",
|
||||
}
|
||||
type UserStatistics = {
|
||||
count: Int
|
||||
meanScore: Float
|
||||
standardDeviation: Float
|
||||
minutesWatched: Int
|
||||
episodesWatched: Int
|
||||
chaptersRead: Int
|
||||
volumesRead: Int
|
||||
formats: null
|
||||
statuses: null
|
||||
scores: null
|
||||
lengths: null
|
||||
releaseYears: null
|
||||
startYears: null
|
||||
genres: null
|
||||
tags: null
|
||||
countries: null
|
||||
voiceActors: null
|
||||
staff: null
|
||||
studios: null
|
||||
}
|
||||
type UserStatisticTypes = {
|
||||
anime: UserStatistics | null
|
||||
manga: UserStatistics | null
|
||||
}
|
||||
type Favourites = {
|
||||
/** Favourite anime */
|
||||
anime: null
|
||||
/** Favourite manga */
|
||||
manga: null
|
||||
/** Favourite characters */
|
||||
characters: null
|
||||
/** Favourite staff */
|
||||
staff: null
|
||||
/** Favourite studios */
|
||||
studios: null
|
||||
}
|
||||
type MediaListTypeOptions = {
|
||||
/** The order each list should be displayed in */
|
||||
sectionOrder: String[] | null
|
||||
/** If the completed sections of the list should be separated by format */
|
||||
splitCompletedSectionByFormat: Boolean | null
|
||||
/** The names of the user's custom lists */
|
||||
customLists: String[] | null
|
||||
/** The names of the user's advanced scoring sections */
|
||||
advancedScoring: String[] | null
|
||||
/** If advanced scoring is enabled */
|
||||
advancedScoringEnabled: Boolean | null
|
||||
}
|
||||
type MediaListOptions = {
|
||||
/** The score format the user is using for media lists */
|
||||
scoreFormat: ScoreFormat | null
|
||||
/** The default order list rows should be displayed in */
|
||||
rowOrder: String | null
|
||||
/** The user's anime list options */
|
||||
animeList: MediaListTypeOptions | null
|
||||
/** The user's manga list options */
|
||||
mangaList: MediaListTypeOptions | null
|
||||
}
|
||||
enum UserTitleLanguage {
|
||||
/** The romanization of the native language title */
|
||||
ROMAJI = "ROMAJI",
|
||||
/** The official english title */
|
||||
ENGLISH = "ENGLISH",
|
||||
/** Official title in it's native language */
|
||||
NATIVE = "NATIVE",
|
||||
/** The romanization of the native language title, stylised by media creator */
|
||||
ROMAJI_STYLISED = "ROMAJI_STYLISED",
|
||||
/** The official english title, stylised by media creator */
|
||||
ENGLISH_STYLISED = "ENGLISH_STYLISED",
|
||||
/** Official title in it's native language, stylised by media creator */
|
||||
NATIVE_STYLISED = "NATIVE_STYLISED",
|
||||
}
|
||||
enum NotificationType {
|
||||
/** A user has sent you message */
|
||||
ACTIVITY_MESSAGE = "ACTIVITY_MESSAGE",
|
||||
/** A user has replied to your activity */
|
||||
ACTIVITY_REPLY = "ACTIVITY_REPLY",
|
||||
/** A user has followed you */
|
||||
FOLLOWING = "FOLLOWING",
|
||||
/** A user has mentioned you in their activity */
|
||||
ACTIVITY_MENTION = "ACTIVITY_MENTION",
|
||||
/** A user has mentioned you in a forum comment */
|
||||
THREAD_COMMENT_MENTION = "THREAD_COMMENT_MENTION",
|
||||
/** A user has commented in one of your subscribed forum threads */
|
||||
THREAD_SUBSCRIBED = "THREAD_SUBSCRIBED",
|
||||
/** A user has replied to your forum comment */
|
||||
THREAD_COMMENT_REPLY = "THREAD_COMMENT_REPLY",
|
||||
/** An anime you are currently watching has aired */
|
||||
AIRING = "AIRING",
|
||||
/** A user has liked your activity */
|
||||
ACTIVITY_LIKE = "ACTIVITY_LIKE",
|
||||
/** A user has liked your activity reply */
|
||||
ACTIVITY_REPLY_LIKE = "ACTIVITY_REPLY_LIKE",
|
||||
/** A user has liked your forum thread */
|
||||
THREAD_LIKE = "THREAD_LIKE",
|
||||
/** A user has liked your forum comment */
|
||||
THREAD_COMMENT_LIKE = "THREAD_COMMENT_LIKE",
|
||||
/** A user has replied to activity you have also replied to */
|
||||
ACTIVITY_REPLY_SUBSCRIBED = "ACTIVITY_REPLY_SUBSCRIBED",
|
||||
/** A new anime or manga has been added to the site where its related media is on the user's list */
|
||||
RELATED_MEDIA_ADDITION = "RELATED_MEDIA_ADDITION",
|
||||
/** An anime or manga has had a data change that affects how a user may track it in their lists */
|
||||
MEDIA_DATA_CHANGE = "MEDIA_DATA_CHANGE",
|
||||
/** Anime or manga entries on the user's list have been merged into a single entry */
|
||||
MEDIA_MERGE = "MEDIA_MERGE",
|
||||
/** An anime or manga on the user's list has been deleted from the site */
|
||||
MEDIA_DELETION = "MEDIA_DELETION",
|
||||
}
|
||||
type NotificationOption = {
|
||||
/** The type of notification */
|
||||
type: NotificationType | null
|
||||
/** Whether this type of notification is enabled */
|
||||
enabled: Boolean | null
|
||||
}
|
||||
enum UserStaffNameLanguage {
|
||||
/** The romanization of the staff or character's native name, with western name ordering */
|
||||
ROMAJI_WESTERN = "ROMAJI_WESTERN",
|
||||
/** The romanization of the staff or character's native name */
|
||||
ROMAJI = "ROMAJI",
|
||||
/** The staff or character's name in their native language */
|
||||
NATIVE = "NATIVE",
|
||||
}
|
||||
type ListActivityOption = {
|
||||
disabled: Boolean | null
|
||||
type: MediaListStatus | null
|
||||
}
|
||||
type UserOptions = {
|
||||
/** The language the user wants to see media titles in */
|
||||
titleLanguage: UserTitleLanguage | null
|
||||
/** Whether the user has enabled viewing of 18+ content */
|
||||
displayAdultContent: Boolean | null
|
||||
/** Whether the user receives notifications when a show they are watching aires */
|
||||
airingNotifications: Boolean | null
|
||||
/** Profile highlight color (blue, purple, pink, orange, red, green, gray) */
|
||||
profileColor: String | null
|
||||
/** Notification options */
|
||||
notificationOptions: NotificationOption[] | null
|
||||
/** The user's timezone offset (Auth user only) */
|
||||
timezone: String | null
|
||||
/** Minutes between activity for them to be merged together. 0 is Never, Above 2 weeks (20160 mins) is Always. */
|
||||
activityMergeTime: Int | null
|
||||
/** The language the user wants to see staff and character names in */
|
||||
staffNameLanguage: UserStaffNameLanguage | null
|
||||
/** Whether the user only allow messages from users they follow */
|
||||
restrictMessagesToFollowing: Boolean | null
|
||||
/** The list activity types the user has disabled from being created from list updates */
|
||||
disabledListActivity: ListActivityOption[] | null
|
||||
}
|
||||
type UserAvatar = {
|
||||
/** The avatar of user at its largest size */
|
||||
large: String
|
||||
/** The avatar of user at medium size */
|
||||
medium: String
|
||||
}
|
||||
type User = {
|
||||
/** The id of the user */
|
||||
id: Int
|
||||
/** The name of the user */
|
||||
name: String
|
||||
/** The bio written by user (Markdown) */
|
||||
about: String | null
|
||||
/** The user's avatar images */
|
||||
avatar: UserAvatar | null
|
||||
/** The user's banner images */
|
||||
bannerImage: String | null
|
||||
/** If the authenticated user if following this user */
|
||||
isFollowing: Boolean | null
|
||||
/** If this user if following the authenticated user */
|
||||
isFollower: Boolean | null
|
||||
/** If the user is blocked by the authenticated user */
|
||||
isBlocked: Boolean | null
|
||||
bans: Json
|
||||
/** The user's general options */
|
||||
options: UserOptions | null
|
||||
/** The user's media list options */
|
||||
mediaListOptions: MediaListOptions | null
|
||||
/** The users favourites */
|
||||
favourites: Favourites | null
|
||||
/** The users anime & manga list statistics */
|
||||
statistics: UserStatisticTypes | null
|
||||
/** The number of unread notifications the user has */
|
||||
unreadNotificationCount: Int | null
|
||||
/** The url for the user page on the AniList website */
|
||||
siteUrl: String | null
|
||||
/** The donation tier of the user */
|
||||
donatorTier: Int | null
|
||||
/** Custom donation badge text */
|
||||
donatorBadge: String | null
|
||||
/** The user's moderator roles if they are a site moderator */
|
||||
moderatorRoles: ModRole[] | null
|
||||
/** When the user's account was created. (Does not exist for accounts created before 2020) */
|
||||
createdAt: Int | null
|
||||
/** When the user's data was last updated */
|
||||
updatedAt: Int | null
|
||||
/** The user's previously used names. */
|
||||
previousNames: UserPreviousName[] | null
|
||||
}
|
||||
type ThreadCategory = {
|
||||
/** The id of the category */
|
||||
id: Int
|
||||
/** The name of the category */
|
||||
name: String
|
||||
}
|
||||
type MediaTitle = {
|
||||
/** The romanization of the native language title */
|
||||
romaji: String | null
|
||||
/** The official english title */
|
||||
english: String | null
|
||||
/** Official title in it's native language */
|
||||
native: String | null
|
||||
/** The currently authenticated users preferred title language. Default romaji for non-authenticated */
|
||||
userPreferred: String | null
|
||||
}
|
||||
export enum MediaType {
|
||||
/** Japanese Anime */
|
||||
ANIME = "ANIME",
|
||||
/** Asian comic */
|
||||
MANGA = "MANGA",
|
||||
}
|
||||
enum MediaFormat {
|
||||
/** Anime broadcast on television */
|
||||
TV = "TV",
|
||||
/** Anime which are under 15 minutes in length and broadcast on television */
|
||||
TV_SHORT = "TV_SHORT",
|
||||
/** Anime movies with a theatrical release */
|
||||
MOVIE = "MOVIE",
|
||||
/** Special episodes that have been included in DVD/Blu-ray releases, picture dramas, pilots, etc */
|
||||
SPECIAL = "SPECIAL",
|
||||
/** (Original Video Animation) Anime that have been released directly on DVD/Blu-ray without originally going through a theatrical release or television broadcast */
|
||||
OVA = "OVA",
|
||||
/** (Original Net Animation) Anime that have been originally released online or are only available through streaming services. */
|
||||
ONA = "ONA",
|
||||
/** Short anime released as a music video */
|
||||
MUSIC = "MUSIC",
|
||||
/** Professionally published manga with more than one chapter */
|
||||
MANGA = "MANGA",
|
||||
/** Written books released as a series of light novels */
|
||||
NOVEL = "NOVEL",
|
||||
/** Manga with just one chapter */
|
||||
ONE_SHOT = "ONE_SHOT",
|
||||
}
|
||||
enum MediaStatus {
|
||||
/** Has completed and is no longer being released */
|
||||
FINISHED = "FINISHED",
|
||||
/** Currently releasing */
|
||||
RELEASING = "RELEASING",
|
||||
/** To be released at a later date */
|
||||
NOT_YET_RELEASED = "NOT_YET_RELEASED",
|
||||
/** Ended before the work could be finished */
|
||||
CANCELLED = "CANCELLED",
|
||||
/** Version 2 only. Is currently paused from releasing and will resume at a later date */
|
||||
HIATUS = "HIATUS",
|
||||
}
|
||||
type FuzzyDate = {
|
||||
/** Numeric Year (2017) */
|
||||
year: Int | null
|
||||
/** Numeric Month (3) */
|
||||
month: Int | null
|
||||
/** Numeric Day (24) */
|
||||
day: Int | null
|
||||
}
|
||||
enum MediaSeason {
|
||||
/** Months December to February */
|
||||
WINTER = "WINTER",
|
||||
/** Months March to May */
|
||||
SPRING = "SPRING",
|
||||
/** Months June to August */
|
||||
SUMMER = "SUMMER",
|
||||
/** Months September to November */
|
||||
FALL = "FALL",
|
||||
}
|
||||
type CountryCode = string
|
||||
enum MediaSource {
|
||||
/** An original production not based of another work */
|
||||
ORIGINAL = "ORIGINAL",
|
||||
/** Asian comic book */
|
||||
MANGA = "MANGA",
|
||||
/** Written work published in volumes */
|
||||
LIGHT_NOVEL = "LIGHT_NOVEL",
|
||||
/** Video game driven primary by text and narrative */
|
||||
VISUAL_NOVEL = "VISUAL_NOVEL",
|
||||
/** Video game */
|
||||
VIDEO_GAME = "VIDEO_GAME",
|
||||
/** Other */
|
||||
OTHER = "OTHER",
|
||||
/** Version 2+ only. Written works not published in volumes */
|
||||
NOVEL = "NOVEL",
|
||||
/** Version 2+ only. Self-published works */
|
||||
DOUJINSHI = "DOUJINSHI",
|
||||
/** Version 2+ only. Japanese Anime */
|
||||
ANIME = "ANIME",
|
||||
/** Version 3 only. Written works published online */
|
||||
WEB_NOVEL = "WEB_NOVEL",
|
||||
/** Version 3 only. Live action media such as movies or TV show */
|
||||
LIVE_ACTION = "LIVE_ACTION",
|
||||
/** Version 3 only. Games excluding video games */
|
||||
GAME = "GAME",
|
||||
/** Version 3 only. Comics excluding manga */
|
||||
COMIC = "COMIC",
|
||||
/** Version 3 only. Multimedia project */
|
||||
MULTIMEDIA_PROJECT = "MULTIMEDIA_PROJECT",
|
||||
/** Version 3 only. Picture book */
|
||||
PICTURE_BOOK = "PICTURE_BOOK",
|
||||
}
|
||||
type MediaTrailer = {
|
||||
/** The trailer video id */
|
||||
id: String | null
|
||||
/** The site the video is hosted by (Currently either youtube or dailymotion) */
|
||||
site: String | null
|
||||
/** The url for the thumbnail image of the video */
|
||||
thumbnail: String | null
|
||||
}
|
||||
type MediaCoverImage = {
|
||||
/** The cover image url of the media at its largest size. If this size isn't available, large will be provided instead. */
|
||||
extraLarge: String | null
|
||||
/** The cover image url of the media at a large size */
|
||||
large: String | null
|
||||
/** The cover image url of the media at medium size */
|
||||
medium: String | null
|
||||
/** Average #hex color of cover image */
|
||||
color: String | null
|
||||
}
|
||||
type MediaTag = {
|
||||
/** The id of the tag */
|
||||
id: Int
|
||||
/** The name of the tag */
|
||||
name: String
|
||||
/** A general description of the tag */
|
||||
description: String | null
|
||||
/** The categories of tags this tag belongs to */
|
||||
category: String | null
|
||||
/** The relevance ranking of the tag out of the 100 for this media */
|
||||
rank: Int | null
|
||||
/** If the tag could be a spoiler for any media */
|
||||
isGeneralSpoiler: Boolean | null
|
||||
/** If the tag is a spoiler for this media */
|
||||
isMediaSpoiler: Boolean | null
|
||||
/** If the tag is only for adult 18+ media */
|
||||
isAdult: Boolean | null
|
||||
/** The user who submitted the tag */
|
||||
userId: Int | null
|
||||
}
|
||||
type AiringSchedule = {
|
||||
/** The id of the airing schedule item */
|
||||
id: Int
|
||||
/** The time the episode airs at */
|
||||
airingAt: Int
|
||||
/** Seconds until episode starts airing */
|
||||
timeUntilAiring: Int
|
||||
/** The airing episode number */
|
||||
episode: Int
|
||||
/** The associate media id of the airing episode */
|
||||
mediaId: Int
|
||||
/** The associate media of the airing episode */
|
||||
media: Media | null
|
||||
}
|
||||
enum ExternalLinkType {
|
||||
INFO = "INFO",
|
||||
STREAMING = "STREAMING",
|
||||
SOCIAL = "SOCIAL",
|
||||
}
|
||||
type MediaExternalLink = {
|
||||
/** The id of the external link */
|
||||
id: Int
|
||||
/** The url of the external link or base url of link source */
|
||||
url: String | null
|
||||
/** The links website site name */
|
||||
site: String
|
||||
/** The links website site id */
|
||||
siteId: Int | null
|
||||
type: ExternalLinkType
|
||||
/** Language the site content is in. See Staff language field for values. */
|
||||
language: String | null
|
||||
color: String
|
||||
/** The icon image url of the site. Not available for all links. Transparent PNG 64x64 */
|
||||
icon: String | null
|
||||
notes: String | null
|
||||
isDisabled: Boolean | null
|
||||
}
|
||||
type MediaStreamingEpisode = {
|
||||
/** Title of the episode */
|
||||
title: String | null
|
||||
/** Url of episode image thumbnail */
|
||||
thumbnail: String | null
|
||||
/** The url of the episode */
|
||||
url: String | null
|
||||
/** The site location of the streaming episodes */
|
||||
site: String | null
|
||||
}
|
||||
enum MediaRankType {
|
||||
/** Ranking is based on the media's ratings/score */
|
||||
RATED = "RATED",
|
||||
/** Ranking is based on the media's popularity */
|
||||
POPULAR = "POPULAR",
|
||||
}
|
||||
type MediaRank = {
|
||||
/** The id of the rank */
|
||||
id: Int
|
||||
/** The numerical rank of the media */
|
||||
rank: Int
|
||||
/** The type of ranking */
|
||||
type: MediaRankType
|
||||
/** The format the media is ranked within */
|
||||
format: MediaFormat
|
||||
/** The year the media is ranked within */
|
||||
year: Int | null
|
||||
/** The season the media is ranked within */
|
||||
season: MediaSeason | null
|
||||
/** If the ranking is based on all time instead of a season/year */
|
||||
allTime: Boolean | null
|
||||
/** String that gives context to the ranking type and time span */
|
||||
context: String
|
||||
}
|
||||
type MediaList = {
|
||||
/** The id of the list entry */
|
||||
id: Int
|
||||
/** The id of the user owner of the list entry */
|
||||
userId: Int
|
||||
/** The id of the media */
|
||||
mediaId: Int
|
||||
/** The watching/reading status */
|
||||
status: MediaListStatus | null
|
||||
/** The score of the entry */
|
||||
score: Float | null
|
||||
/** The amount of episodes/chapters consumed by the user */
|
||||
progress: Int | null
|
||||
/** The amount of volumes read by the user */
|
||||
progressVolumes: Int | null
|
||||
/** The amount of times the user has rewatched/read the media */
|
||||
repeat: Int | null
|
||||
/** Priority of planning */
|
||||
priority: Int | null
|
||||
/** If the entry should only be visible to authenticated user */
|
||||
private: Boolean | null
|
||||
/** Text notes */
|
||||
notes: String | null
|
||||
/** If the entry shown be hidden from non-custom lists */
|
||||
hiddenFromStatusLists: Boolean | null
|
||||
/** Map of booleans for which custom lists the entry are in */
|
||||
customLists: Json | null
|
||||
/** Map of advanced scores with name keys */
|
||||
advancedScores: Json | null
|
||||
/** When the entry was started by the user */
|
||||
startedAt: FuzzyDate | null
|
||||
/** When the entry was completed by the user */
|
||||
completedAt: FuzzyDate | null
|
||||
/** When the entry data was last updated */
|
||||
updatedAt: Int | null
|
||||
/** When the entry data was created */
|
||||
createdAt: Int | null
|
||||
/** Anime or Manga */
|
||||
media: Media | null
|
||||
user: User | null
|
||||
}
|
||||
enum MediaListStatus {
|
||||
/** Currently watching/reading */
|
||||
CURRENT = "CURRENT",
|
||||
/** Planning to watch/read */
|
||||
PLANNING = "PLANNING",
|
||||
/** Finished watching/reading */
|
||||
COMPLETED = "COMPLETED",
|
||||
/** Stopped watching/reading before completing */
|
||||
DROPPED = "DROPPED",
|
||||
/** Paused watching/reading */
|
||||
PAUSED = "PAUSED",
|
||||
/** Re-watching/reading */
|
||||
REPEATING = "REPEATING",
|
||||
}
|
||||
type ScoreDistribution = {
|
||||
score: number
|
||||
/** The amount of list entries with this score */
|
||||
amount: number
|
||||
}
|
||||
type StatusDistribution = {
|
||||
/** The day the activity took place (Unix timestamp) */
|
||||
status: MediaListStatus
|
||||
/** The amount of entries with this status */
|
||||
amount: Int
|
||||
}
|
||||
type MediaStats = {
|
||||
scoreDistribution: ScoreDistribution[]
|
||||
statusDistribution: StatusDistribution[]
|
||||
}
|
||||
type Media = {
|
||||
/** The id of the media */
|
||||
id: number
|
||||
/** The mal id of the media */
|
||||
idMal: number | null
|
||||
/** The official titles of the media in various languages */
|
||||
title: MediaTitle | null
|
||||
/** The type of the media; anime or manga */
|
||||
type: MediaType | null
|
||||
/** The format the media was released in */
|
||||
format: MediaFormat | null
|
||||
/** The current releasing status of the media */
|
||||
status: MediaStatus | null
|
||||
/** Short description of the media's story and characters */
|
||||
description: string | null
|
||||
/** The first official release date of the media */
|
||||
startDate: FuzzyDate | null
|
||||
/** The last official release date of the media */
|
||||
endDate: FuzzyDate | null
|
||||
/** The season the media was initially released in */
|
||||
season: MediaSeason | null
|
||||
/** The season year the media was initially released in */
|
||||
seasonYear: number | null
|
||||
/** The year & season the media was initially released in */
|
||||
seasonInt: number | null
|
||||
/** The amount of episodes the anime has when complete */
|
||||
episodes: number | null
|
||||
/** The general length of each anime episode in minutes */
|
||||
duration: number | null
|
||||
/** The amount of chapters the manga has when complete */
|
||||
chapters: number | null
|
||||
/** The amount of volumes the manga has when complete */
|
||||
volumes: number | null
|
||||
/** Where the media was created. (ISO 3166-1 alpha-2) */
|
||||
countryOfOrigin: CountryCode | null
|
||||
/** If the media is officially licensed or a self-published doujin release */
|
||||
isLicensed: boolean | null
|
||||
/** Source type the media was adapted from. */
|
||||
source: MediaSource | null
|
||||
/** Official Twitter hashtags for the media */
|
||||
hashtag: string | null
|
||||
/** Media trailer or advertisement */
|
||||
trailer: MediaTrailer | null
|
||||
/** When the media's data was last updated */
|
||||
updatedAt: number | null
|
||||
/** The cover images of the media */
|
||||
coverImage: MediaCoverImage | null
|
||||
/** The banner image of the media */
|
||||
bannerImage: string | null
|
||||
/** The genres of the media */
|
||||
genres: string[] | null
|
||||
/** Alternative titles of the media */
|
||||
synonyms: string[] | null
|
||||
/** A weighted average score of all the user's scores of the media */
|
||||
averageScore: number | null
|
||||
/** Mean score of all the user's scores of the media */
|
||||
meanScore: number | null
|
||||
/** The number of users with the media on their list */
|
||||
popularity: number | null
|
||||
/** Locked media may not be added to lists our favorited. This may be due to the entry pending for deletion or other reasons. */
|
||||
isLocked: boolean | null
|
||||
/** The amount of related activity in the past hour */
|
||||
trending: number | null
|
||||
/** The amount of user's who have favourited the media */
|
||||
favourites: number | null
|
||||
/** List of tags that describes elements and themes of the media */
|
||||
tags: MediaTag[] | null
|
||||
/** Other media in the same or connecting franchise */
|
||||
relations: null
|
||||
/** The characters in the media */
|
||||
characters: null
|
||||
/** The staff who produced the media */
|
||||
staff: null
|
||||
/** The companies who produced the media */
|
||||
studios: null
|
||||
/** If the media is marked as favourite by the current authenticated user */
|
||||
isFavourite: boolean
|
||||
/** If the media is blocked from being added to favourites */
|
||||
isFavouriteBlocked: boolean
|
||||
/** If the media is intended only for 18+ adult audiences */
|
||||
isAdult: boolean | null
|
||||
/** The media's next episode airing schedule */
|
||||
nextAiringEpisode: AiringSchedule | null
|
||||
/** The media's entire airing schedule */
|
||||
airingSchedule: null
|
||||
/** The media's daily trend stats */
|
||||
trends: null
|
||||
/** External links to another site related to the media */
|
||||
externalLinks: MediaExternalLink[] | null
|
||||
/** Data and links to legal streaming episodes on external sites */
|
||||
streamingEpisodes: MediaStreamingEpisode[] | null
|
||||
/** The ranking of the media in a particular time span and format compared to other media */
|
||||
rankings: MediaRank[] | null
|
||||
/** The authenticated user's media list entry for the media */
|
||||
mediaListEntry: MediaList | null
|
||||
/** User reviews of the media */
|
||||
reviews: null
|
||||
/** User recommendations for similar media */
|
||||
recommendations: null
|
||||
stats: MediaStats | null
|
||||
/** The url for the media page on the AniList website */
|
||||
siteUrl: string | null
|
||||
/** If the media should have forum thread automatically created for it on airing episode release */
|
||||
autoCreateForumThread: boolean | null
|
||||
/** If the media is blocked from being recommended to/from */
|
||||
isRecommendationBlocked: boolean | null
|
||||
/** If the media is blocked from being reviewed */
|
||||
isReviewBlocked: boolean | null
|
||||
/** Notes for site moderators */
|
||||
modNotes: string | null
|
||||
}
|
||||
type Thread = {
|
||||
/** The id of the thread */
|
||||
id: number
|
||||
/** The title of the thread */
|
||||
title: string | null
|
||||
/** The text body of the thread (Markdown) */
|
||||
body: string | null
|
||||
/** The id of the thread owner user */
|
||||
userId: number
|
||||
/** The id of the user who most recently commented on the thread */
|
||||
replyUserId: number | null
|
||||
/** The id of the most recent comment on the thread */
|
||||
replyCommentId: number | null
|
||||
/** The number of comments on the thread */
|
||||
replyCount: number | null
|
||||
/** The number of times users have viewed the thread */
|
||||
viewCount: number | null
|
||||
/** If the thread is locked and can receive comments */
|
||||
isLocked: boolean | null
|
||||
/** If the thread is stickied and should be displayed at the top of the page */
|
||||
isSticky: boolean | null
|
||||
/** If the currently authenticated user is subscribed to the thread */
|
||||
isSubscribed: boolean | null
|
||||
/** The amount of likes the thread has */
|
||||
likeCount: number
|
||||
/** If the currently authenticated user liked the thread */
|
||||
isLiked: boolean | null
|
||||
/** The time of the last reply */
|
||||
repliedAt: number | null
|
||||
/** The time of the thread creation */
|
||||
createdAt: number
|
||||
/** The time of the thread last update */
|
||||
updatedAt: number
|
||||
/** The owner of the thread */
|
||||
user: User | null
|
||||
/** The user to last reply to the thread */
|
||||
replyUser: User | null
|
||||
/** The users who liked the thread */
|
||||
likes: User[] | null
|
||||
/** The url for the thread page on the AniList website */
|
||||
siteUrl: string | null
|
||||
/** The categories of the thread */
|
||||
categories: ThreadCategory[] | null
|
||||
/** The media categories of the thread */
|
||||
mediaCategories: Media[] | null
|
||||
}
|
||||
type ThreadComment = {
|
||||
/** The id of the comment */
|
||||
id: number
|
||||
/** The user id of the comment's owner */
|
||||
userId: number | null
|
||||
/** The id of thread the comment belongs to */
|
||||
threadId: number | null
|
||||
/** The text content of the comment (Markdown) */
|
||||
comment: string | null
|
||||
/** The amount of likes the comment has */
|
||||
likeCount: number
|
||||
/** If the currently authenticated user liked the comment */
|
||||
isLiked: boolean | null
|
||||
/** The url for the comment page on the AniList website */
|
||||
siteUrl: string | null
|
||||
/** The time of the comments creation */
|
||||
createdAt: number
|
||||
/** The time of the comments last update */
|
||||
updatedAt: number
|
||||
/** The thread the comment belongs to */
|
||||
thread: Thread | null
|
||||
/** The user who created the comment */
|
||||
user: User | null
|
||||
/** The users who liked the comment */
|
||||
likes: User[] | null
|
||||
/** The comment's child reply comments */
|
||||
childComments: Record<string, unknown> | null
|
||||
/** If the comment tree is locked and may not receive replies or edits */
|
||||
isLocked: boolean | null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue