diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f94630c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +.env \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f40d45e --- /dev/null +++ b/README.md @@ -0,0 +1,93 @@ +![](https://nodei.co/npm/anilist.js.png?downloads=true)\ +NPM module for communicating with Anilist.\ +Find any bugs or have any suggestions?\ +Create an issue on the repo or contact me on Discord @MrScopes#5548 + +## Table of Contents +- [Documentation](#documentation) +- [Notes](#notes) + +## Example +```js +const Client = require('anilist-js'); +const AniList = new Client('API TOKEN'); // token is only required for some features + +(async () => { + + // list the 3 most popular MHA seasons + const search = await AniList.searchMedia({ search: 'My Hero Academia', format: 'TV', perPage: 3, sort: 'POPULARITY_DESC' }); + console.log(search.Results.map(result => result.info.title)); + + // toggle favourite status for naruto (character) + const characters = await AniList.searchCharacters({ search: 'Naruto Uzumaki' }); + const naruto = characters.Results[0]; + await naruto.favourite(); // this requires an api token + +})(); +``` + +## Documentation +Note: `variables` parameters are 100% auto completion compatible.\ +These docs are most likely temporary.\ +View the [example usage](#example).\ +_Italics_ represents authorization required. +- Methods: + - `.getMedia(id)` + - `.searchMedia(variables)` +

+ - `.getCharacter(id)` + - `.searchCharacters(variables)` +

+ - _`.me()`_ -> Currently authorized user + - `.getUser(id)` + - `.searchUsers(variables)` +

+ - `.getStaff(id)` + - `.searchStaff(variables)` +

+ - `.getStudio(id)` + - `.searchStudios(variables)` + +- Structures: + - Search Results: + - .Results[\] + - .pageInfo +

+ - `Media >` + - .info + - _.update(variables)_ + - _.favourite()_ +

+ - `Character >` + - .info + - _.favourite()_ +

+ - _`Viewer >`_ represents the current authorized user + - _.info_ + - _.update(variables)_ + - `User >` + - .info + - _.follow()_ +

+ - `Staff >` + - .info + - _.favourite()_ +

+ - `Studio >` + - .info + - .favourite() + +## Notes: +- This is my first large npm module. So some things might not work 100% as intended. + +- The JSON output is massive, so keep the following in mind: + - A lot of data is taken out, for example, in user info: statistics is taken out + - nodes are taken out. use `edges[] > node` + - for `edges[] > node`, only important info is left in like `id`, `title (or name)` + +- API Key: + - API Keys are needed for user-specific methods, but you can still get media, characters, etc. + - Get yours @ [https://anilist-token.glitch.me/](https://anilist-token.glitch.me/). This is secure, created by me, and open source. + +- Types: + - Types are mainly auto generated, but not every property is 100% supported (this is mainly so the json isn't more massive than it is). \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..5391eaa --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "anilist.js", + "version": "1.0.0", + "description": "Communicate with the AniList API.", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "test": "tsc && node dist/test.js" + }, + "keywords": [ + "anime", + "anilist", + "typescript" + ], + "repository": "https://github.com/MrScopes/anilist.js", + "author": "MrScopes", + "license": "ISC", + "dependencies": { + "node-fetch": "^2.6.1" + }, + "devDependencies": { + "@types/node-fetch": "^2.5.7", + "dotenv": "^8.2.0" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..f57b34d --- /dev/null +++ b/src/index.ts @@ -0,0 +1,148 @@ +import Utilities from './utilities'; +import { CharacterQuery } from './queries/queries/character/CharacterQuery'; +import { CharacterSearchQuery } from './queries/queries/character/CharacterSearchQuery'; +import { CharacterSearchResults } from './structures/character/CharacterSearchResults'; +import { CharacterStructure } from './structures/character/CharacterStructure'; +import { MediaQuery } from './queries/queries/media/MediaQuery'; +import { MediaSearchQuery } from './queries/queries/media/MediaSearchQuery'; +import { MediaSearchResults } from './structures/media/MediaSearchResults'; +import { MediaStructure } from './structures/media/MediaStructure'; +import { PageCharactersArgs, PageMediaArgs, PageStaffArgs, PageStudiosArgs, PageUsersArgs } from './types/types'; +import { UserStructure } from './structures/user/UserStructure'; +import { UserSearchResults } from './structures/user/UserSearchResults'; +import { UserSearchQuery } from './queries/queries/user/UserSearchQuery'; +import { UserQuery } from './queries/queries/user/UserQuery'; +import { ViewerQuery } from './queries/queries/user/ViewerQuery'; +import { ViewerStructure } from './structures/user/ViewerStructure'; +import { StaffStructure } from './structures/staff/StaffStructure'; +import { StaffSearchResults } from './structures/staff/StaffSearchResults'; +import { StudioStructure } from './structures/studio/StudioStructure'; +import { StudioSearchResults } from './structures/studio/StudioSearchResults'; +import { StaffQuery } from './queries/queries/staff/StaffQuery'; +import { StaffSearchQuery } from './queries/queries/staff/StaffSearchQuery'; +import { StudioQuery } from './queries/queries/studio/StudioQuery'; +import { StudioSearchQuery } from './queries/queries/studio/StudioSearchQuery'; + +/** The main anilist.js class. */ +class Client { + token?: string; + utilities: Utilities; + + /** + * "Logs in" to AniList. Required for some features. + * @param token API token + */ + constructor(token?: string) { + this.utilities = new Utilities(); + this.token = token; + } + + /** + * Gets the media with the matching ID. + * @param id media id + */ + async getMedia(id: number) { + const json = await this.utilities.APIRequest(MediaQuery, { id }, this); + return new MediaStructure(json, this); + } + + /** + * Gets the media with the maching variables. + * @param variables filter variables + * @example + * .searchMedia({ format: 'OVA', includedTags: ['Body Horror'] }) + */ + async searchMedia(variables: PageMediaArgs) { + const json = await this.utilities.APIRequest(MediaSearchQuery, variables, this); + return new MediaSearchResults(json, this); + } + + /** + * Gets the character with the matching ID. + * @param id character id + */ + async getCharacter(id: number) { + const json = await this.utilities.APIRequest(CharacterQuery, { id }, this); + return new CharacterStructure(json, this); + } + + /** + * Gets the characters with the maching variables. + * @param variables filter variables + * @example + * .searchCharacters({ name: 'Naruto' }) + */ + async searchCharacters(variables: PageCharactersArgs) { + const json = await this.utilities.APIRequest(CharacterSearchQuery, variables, this); + return new CharacterSearchResults(json, this); + } + + /** + * Gets the currently authorized user.\ + * This requires you to be logged in. + * @example + * .me().info.id + */ + async me() { + const json = await this.utilities.APIRequest(ViewerQuery, {}, this); + return new ViewerStructure(json, this); + } + + /** + * Gets the character with the matching ID. + * @param id character id + */ + async getUser(id: number) { + const json = await this.utilities.APIRequest(UserQuery, { id }, this); + return new UserStructure(json, this); + } + + /** + * Gets the characters with the maching variables. + * @param variables filter variables + * @example + * .searchCharacters({ name: 'Naruto' }) + */ + async searchUsers(variables: PageUsersArgs) { + const json = await this.utilities.APIRequest(UserSearchQuery, variables, this); + return new UserSearchResults(json, this); + } + + /** + * Gets the staff with the matching ID. + * @param id staff id + */ + async getStaff(id: number) { + const json = await this.utilities.APIRequest(StaffQuery, { id }, this); + return new StaffStructure(json, this); + } + + /** + * Gets the staff with the matching variables. + * @param variables filter variables + */ + async searchStaff(variables: PageStaffArgs) { + const json = await this.utilities.APIRequest(StaffSearchQuery, variables, this); + return new StaffSearchResults(json, this); + } + + /** + * Gets the studio with the matching ID. + * @param id studio id + */ + async getStudio(id: number) { + const json = await this.utilities.APIRequest(StudioQuery, { id }, this); + return new StudioStructure(json, this); + } + + /** + * Gets the studios with the matching variables. + * @param variables filter variables + */ + async searchStudios(variables: PageStudiosArgs) { + const json = await this.utilities.APIRequest(StudioSearchQuery, variables, this); + return new StudioSearchResults(json, this); + } +} + +export = Client; \ No newline at end of file diff --git a/src/queries/mutations/character/CharacterFavorite.ts b/src/queries/mutations/character/CharacterFavorite.ts new file mode 100644 index 0000000..f100077 --- /dev/null +++ b/src/queries/mutations/character/CharacterFavorite.ts @@ -0,0 +1,15 @@ +const CharacterFavorite = ` +mutation ($id: Int) { + ToggleFavourite(characterId: $id) { + characters { + edges { + node { + id + } + } + } + } +} +` + +export { CharacterFavorite }; \ No newline at end of file diff --git a/src/queries/mutations/media/AnimeFavourite.ts b/src/queries/mutations/media/AnimeFavourite.ts new file mode 100644 index 0000000..11bfd1e --- /dev/null +++ b/src/queries/mutations/media/AnimeFavourite.ts @@ -0,0 +1,15 @@ +const AnimeFavorite = ` +mutation ($id: Int) { + ToggleFavourite(animeId: $id) { + anime { + edges { + node { + id + } + } + } + } +} +` + +export { AnimeFavorite }; \ No newline at end of file diff --git a/src/queries/mutations/media/MangaFavourite.ts b/src/queries/mutations/media/MangaFavourite.ts new file mode 100644 index 0000000..19c8928 --- /dev/null +++ b/src/queries/mutations/media/MangaFavourite.ts @@ -0,0 +1,15 @@ +const MangaFavorite = ` +mutation ($id: Int) { + ToggleFavourite(mangaId: $id) { + manga { + edges { + node { + id + } + } + } + } +} +` + +export { MangaFavorite }; \ No newline at end of file diff --git a/src/queries/mutations/media/MediaUpdate.ts b/src/queries/mutations/media/MediaUpdate.ts new file mode 100644 index 0000000..4c8cf07 --- /dev/null +++ b/src/queries/mutations/media/MediaUpdate.ts @@ -0,0 +1,32 @@ +const MediaUpdate = ` +mutation ($id: Int, $mediaId: Int, $status: MediaListStatus, $score: Float, $scoreRaw: Int, $progress: Int, $progressVolumes: Int, $repeat: Int, $priority: Int, $private: Boolean, $notes: String, $hiddenFromStatusLists: Boolean, $customLists: [String], $advancedScores: [Float], $startedAt: FuzzyDateInput, $completedAt: FuzzyDateInput) { + SaveMediaListEntry(id: $id, mediaId: $mediaId, status: $status, score: $score, scoreRaw: $scoreRaw, progress: $progress, progressVolumes: $progressVolumes, repeat: $repeat, priority: $priority, private: $private, notes: $notes, hiddenFromStatusLists: $hiddenFromStatusLists, customLists: $customLists, advancedScores: $advancedScores, startedAt: $startedAt, completedAt: $completedAt) { + id + userId + mediaId + status + score + progress + progressVolumes + repeat + priority + private + notes + hiddenFromStatusLists + customLists + advancedScores + startedAt { + year + month + day + } + completedAt { + year + month + day + } + } +} +` + +export { MediaUpdate }; \ No newline at end of file diff --git a/src/queries/mutations/staff/StaffFavourite.ts b/src/queries/mutations/staff/StaffFavourite.ts new file mode 100644 index 0000000..2d9db1e --- /dev/null +++ b/src/queries/mutations/staff/StaffFavourite.ts @@ -0,0 +1,15 @@ +const StaffFavorite = ` +mutation ($id: Int) { + ToggleFavourite(staffId: $id) { + staff { + edges { + node { + id + } + } + } + } +} +` + +export { StaffFavorite }; \ No newline at end of file diff --git a/src/queries/mutations/studio/StudioFavourite.ts b/src/queries/mutations/studio/StudioFavourite.ts new file mode 100644 index 0000000..afadf33 --- /dev/null +++ b/src/queries/mutations/studio/StudioFavourite.ts @@ -0,0 +1,15 @@ +const StudioFavorite = ` +mutation ($id: Int) { + ToggleFavourite(studioId: $id) { + studios { + edges { + node { + id + } + } + } + } +} +` + +export { StudioFavorite }; \ No newline at end of file diff --git a/src/queries/mutations/user/UserFollow.ts b/src/queries/mutations/user/UserFollow.ts new file mode 100644 index 0000000..fd5135a --- /dev/null +++ b/src/queries/mutations/user/UserFollow.ts @@ -0,0 +1,10 @@ +const UserFollow = ` +mutation($userId: Int) { + ToggleFollow(userId: $userId) { + id + name + } + } +` + +export { UserFollow }; \ No newline at end of file diff --git a/src/queries/mutations/user/viewer/ViewerUpdate.ts b/src/queries/mutations/user/viewer/ViewerUpdate.ts new file mode 100644 index 0000000..61c6fe8 --- /dev/null +++ b/src/queries/mutations/user/viewer/ViewerUpdate.ts @@ -0,0 +1,11 @@ +const ViewerUpdate = ` +mutation ($about: String, $titleLanguage: UserTitleLanguage, $displayAdultContent: Boolean, $airingNotifications: Boolean, $scoreFormat: ScoreFormat, $rowOrder: String, $profileColor: String, $donatorBadge: String, $notificationOptions: [NotificationOptionInput], $animeListOptions: MediaListOptionsInput, $mangaListOptions: MediaListOptionsInput) { + UpdateUser(about: $about, titleLanguage: $titleLanguage, displayAdultContent: $displayAdultContent, airingNotifications: $airingNotifications, scoreFormat: $scoreFormat, rowOrder: $rowOrder, profileColor: $profileColor, donatorBadge: $donatorBadge, notificationOptions: $notificationOptions, animeListOptions: $animeListOptions, mangaListOptions: $mangaListOptions) { + id + name + about + } + } +` + +export { ViewerUpdate }; \ No newline at end of file diff --git a/src/queries/queries/character/CharacterQuery.ts b/src/queries/queries/character/CharacterQuery.ts new file mode 100644 index 0000000..a7a7aea --- /dev/null +++ b/src/queries/queries/character/CharacterQuery.ts @@ -0,0 +1,45 @@ +const CharacterQuery = ` +query ($id: Int) { + Character(id: $id) { + id + name { + first + last + full + native + alternative + } + image { + large + medium + } + description + isFavourite + siteUrl + media { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + } + favourites + modNotes + } +} +` + +export { CharacterQuery }; \ No newline at end of file diff --git a/src/queries/queries/character/CharacterSearchQuery.ts b/src/queries/queries/character/CharacterSearchQuery.ts new file mode 100644 index 0000000..2405624 --- /dev/null +++ b/src/queries/queries/character/CharacterSearchQuery.ts @@ -0,0 +1,54 @@ +const CharacterSearchQuery = ` +query ($search: String, $sort: [CharacterSort], $page: Int, $perPage: Int) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + Results: characters(search: $search, sort: $sort) { + id + name { + first + last + full + native + alternative + } + image { + large + medium + } + description + isFavourite + siteUrl + media { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + } + favourites + modNotes + } + } +} +` + +export { CharacterSearchQuery }; \ No newline at end of file diff --git a/src/queries/queries/media/MediaQuery.ts b/src/queries/queries/media/MediaQuery.ts new file mode 100644 index 0000000..c4b6876 --- /dev/null +++ b/src/queries/queries/media/MediaQuery.ts @@ -0,0 +1,233 @@ +const MediaQuery = ` +query ($id: Int) { + Media(id: $id) { + id + title { + romaji + english + native + } + startDate { + year + month + day + } + endDate { + year + month + day + } + favourites + coverImage { + extraLarge + large + color + } + characters { + edges { + node { + id + name { + first + last + full + native + } + } + role + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + staff { + edges { + node { + id + name { + first + last + full + native + } + } + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + relations { + edges { + node { + id + isAdult + title { + romaji + english + native + } + format + type + coverImage { + large + } + } + relationType + } + } + studios { + edges { + node { + id + name + } + isMain + } + } + recommendations { + edges { + node { + id + rating + userRating + user { + id + name + } + } + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + bannerImage + duration + format + type + status + episodes + chapters + volumes + season + description + averageScore + meanScore + popularity + genres + siteUrl + isFavourite + countryOfOrigin + isLicensed + synonyms + trending + rankings { + id + rank + type + format + year + season + allTime + context + } + stats { + scoreDistribution { + score + amount + } + statusDistribution { + status + amount + } + airingProgression { + episode + score + watching + } + } + tags { + id + name + description + isGeneralSpoiler + isMediaSpoiler + rank + } + nextAiringEpisode { + airingAt + timeUntilAiring + episode + } + streamingEpisodes { + title + thumbnail + url + site + } + reviews { + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + mediaListEntry { + user { + mediaListOptions { + scoreFormat + animeList { + advancedScoring + advancedScoringEnabled + customLists + } + mangaList { + advancedScoring + advancedScoringEnabled + customLists + } + } + } + id + status + score + progress + progressVolumes + repeat + priority + private + notes + hiddenFromStatusLists + customLists(asArray: true) + advancedScores + startedAt { + year + month + day + } + completedAt { + year + month + day + } + updatedAt + createdAt + } + } + } +` + +export { MediaQuery }; \ No newline at end of file diff --git a/src/queries/queries/media/MediaSearchQuery.ts b/src/queries/queries/media/MediaSearchQuery.ts new file mode 100644 index 0000000..e66b43f --- /dev/null +++ b/src/queries/queries/media/MediaSearchQuery.ts @@ -0,0 +1,242 @@ +const MediaSearchQuery = ` +query ($search: String, $page: Int, $perPage: Int, $sort: [MediaSort], $type: MediaType, $season: MediaSeason, $seasonYear: Int, $format: MediaFormat, $status: MediaStatus, $isAdult: Boolean, $includedGenres: [String], $excludedGenres: [String], $includedTags: [String], $excludedTags: [String], $yearLike: String, $popularityGreaterThan: Int, $averageGreaterThan: Int, $episodesGreaterThan: Int, $episodesLessThan: Int, $country: CountryCode, $source: MediaSource, $licensedBy: [String]) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + Results: media(search: $search, sort: $sort, type: $type, season: $season, seasonYear: $seasonYear, format: $format, status: $status, isAdult: $isAdult, genre_in: $includedGenres, genre_not_in: $excludedGenres, tag_in: $includedTags, tag_not_in: $excludedTags, startDate_like: $yearLike, popularity_greater: $popularityGreaterThan, averageScore_greater: $averageGreaterThan, episodes_greater: $episodesGreaterThan, episodes_lesser: $episodesLessThan, countryOfOrigin: $country, source: $source, licensedBy_in: $licensedBy) { + id + title { + romaji + english + native + } + startDate { + year + month + day + } + endDate { + year + month + day + } + favourites + coverImage { + extraLarge + large + color + } + characters { + edges { + node { + id + name { + first + last + full + native + } + } + role + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + staff { + edges { + node { + id + name { + first + last + full + native + } + } + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + relations { + edges { + node { + id + isAdult + title { + romaji + english + native + } + format + type + coverImage { + large + } + } + relationType + } + } + studios { + edges { + node { + id + name + } + isMain + } + } + recommendations { + edges { + node { + id + rating + userRating + user { + id + name + } + } + } + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + bannerImage + duration + format + type + status + episodes + chapters + volumes + season + description + averageScore + meanScore + popularity + genres + siteUrl + isFavourite + countryOfOrigin + isLicensed + synonyms + trending + rankings { + id + rank + type + format + year + season + allTime + context + } + stats { + scoreDistribution { + score + amount + } + statusDistribution { + status + amount + } + airingProgression { + episode + score + watching + } + } + tags { + id + name + description + isGeneralSpoiler + isMediaSpoiler + rank + } + nextAiringEpisode { + airingAt + timeUntilAiring + episode + } + streamingEpisodes { + title + thumbnail + url + site + } + reviews { + pageInfo { + total + perPage + hasNextPage + currentPage + lastPage + } + } + mediaListEntry { + user { + mediaListOptions { + scoreFormat + animeList { + advancedScoring + advancedScoringEnabled + customLists + } + mangaList { + advancedScoring + advancedScoringEnabled + customLists + } + } + } + id + status + score + progress + progressVolumes + repeat + priority + private + notes + hiddenFromStatusLists + customLists(asArray: true) + advancedScores + startedAt { + year + month + day + } + completedAt { + year + month + day + } + updatedAt + createdAt + } + } + } +} +` + +export { MediaSearchQuery }; \ No newline at end of file diff --git a/src/queries/queries/staff/StaffQuery.ts b/src/queries/queries/staff/StaffQuery.ts new file mode 100644 index 0000000..0b28748 --- /dev/null +++ b/src/queries/queries/staff/StaffQuery.ts @@ -0,0 +1,72 @@ +const StaffQuery = ` +query ($id: Int) { + Staff(id: $id) { + id + name { + first + last + full + native + } + language + image { + large + medium + } + description + isFavourite + siteUrl + staffMedia { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + characters { + edges { + node { + id + name { + first + last + full + native + } + } + role + } + } + characterMedia { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + submitter { + id + name + } + submissionStatus + submissionNotes + favourites + modNotes + } + } + +` + +export { StaffQuery }; \ No newline at end of file diff --git a/src/queries/queries/staff/StaffSearchQuery.ts b/src/queries/queries/staff/StaffSearchQuery.ts new file mode 100644 index 0000000..2cb3f14 --- /dev/null +++ b/src/queries/queries/staff/StaffSearchQuery.ts @@ -0,0 +1,81 @@ +const StaffSearchQuery = ` +query ($id: Int, $page: Int, $perPage: Int, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [StaffSort]) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + Results: staff(id: $id, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) { + id + name { + first + last + full + native + } + language + image { + large + medium + } + description + isFavourite + siteUrl + staffMedia { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + relationType + } + } + characters { + edges { + node { + id + name { + first + last + full + native + } + } + role + } + } + characterMedia { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + submitter { + id + name + } + submissionStatus + submissionNotes + favourites + modNotes + } + } + } +` + +export { StaffSearchQuery }; \ No newline at end of file diff --git a/src/queries/queries/studio/StudioQuery.ts b/src/queries/queries/studio/StudioQuery.ts new file mode 100644 index 0000000..0a866b4 --- /dev/null +++ b/src/queries/queries/studio/StudioQuery.ts @@ -0,0 +1,28 @@ +const StudioQuery = ` +query ($id: Int) { + Studio(id: $id) { + id + name + isAnimationStudio + media { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + isMainStudio + } + } + siteUrl + isFavourite + favourites + } + } +` + +export { StudioQuery }; \ No newline at end of file diff --git a/src/queries/queries/studio/StudioSearchQuery.ts b/src/queries/queries/studio/StudioSearchQuery.ts new file mode 100644 index 0000000..8c306a6 --- /dev/null +++ b/src/queries/queries/studio/StudioSearchQuery.ts @@ -0,0 +1,38 @@ +const StudioSearchQuery = ` +query ($id: Int, $page: Int, $perPage: Int, $search: String, $id_not: Int, $id_in: [Int], $id_not_in: [Int], $sort: [StudioSort]) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + Results: studios(id: $id, search: $search, id_not: $id_not, id_in: $id_in, id_not_in: $id_not_in, sort: $sort) { + id + name + isAnimationStudio + media { + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + isMainStudio + } + } + siteUrl + isFavourite + favourites + } + } + } + +` + +export { StudioSearchQuery }; \ No newline at end of file diff --git a/src/queries/queries/user/UserQuery.ts b/src/queries/queries/user/UserQuery.ts new file mode 100644 index 0000000..661780a --- /dev/null +++ b/src/queries/queries/user/UserQuery.ts @@ -0,0 +1,134 @@ +const UserQuery = ` +query ($id: Int) { + User(id: $id) { + id + name + about + avatar { + large + medium + } + bannerImage + isFollowing + isFollower + isBlocked + bans + options { + titleLanguage + displayAdultContent + airingNotifications + profileColor + } + mediaListOptions { + scoreFormat + rowOrder + useLegacyLists + sharedTheme + sharedThemeEnabled + } + favourites { + anime { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + manga { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + + } + } + characters { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + staff { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + studios { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + id + } + } + } + unreadNotificationCount + siteUrl + donatorTier + donatorBadge + moderatorStatus + updatedAt + } + } +` + +export { UserQuery }; \ No newline at end of file diff --git a/src/queries/queries/user/UserSearchQuery.ts b/src/queries/queries/user/UserSearchQuery.ts new file mode 100644 index 0000000..827ce76 --- /dev/null +++ b/src/queries/queries/user/UserSearchQuery.ts @@ -0,0 +1,142 @@ +const UserSearchQuery = ` +query ($id: Int, $name: String, $search: String, $sort: [UserSort], $page: Int, $perPage: Int) { + Page(page: $page, perPage: $perPage) { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + Results: users(id: $id, name: $name, search: $search, sort: $sort) { + id + name + about + avatar { + large + medium + } + bannerImage + isFollowing + isFollower + isBlocked + bans + options { + titleLanguage + displayAdultContent + airingNotifications + profileColor + } + mediaListOptions { + scoreFormat + rowOrder + useLegacyLists + sharedTheme + sharedThemeEnabled + } + favourites { + anime { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + manga { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + characters { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + staff { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + studios { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + id + } + } + } + unreadNotificationCount + siteUrl + donatorTier + donatorBadge + moderatorStatus + updatedAt + } + } + } +` + +export { UserSearchQuery }; \ No newline at end of file diff --git a/src/queries/queries/user/ViewerQuery.ts b/src/queries/queries/user/ViewerQuery.ts new file mode 100644 index 0000000..8605670 --- /dev/null +++ b/src/queries/queries/user/ViewerQuery.ts @@ -0,0 +1,134 @@ +const ViewerQuery = ` +query { + Viewer { + id + name + about + avatar { + large + medium + } + bannerImage + isFollowing + isFollower + isBlocked + bans + options { + titleLanguage + displayAdultContent + airingNotifications + profileColor + } + mediaListOptions { + scoreFormat + rowOrder + useLegacyLists + sharedTheme + sharedThemeEnabled + } + favourites { + anime { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + } + } + manga { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + title { + romaji + english + native + userPreferred + } + } + + } + } + characters { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + staff { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + node { + id + name { + first + last + full + native + } + } + } + } + studios { + pageInfo { + total + perPage + currentPage + lastPage + hasNextPage + } + edges { + id + } + } + } + unreadNotificationCount + siteUrl + donatorTier + donatorBadge + moderatorStatus + updatedAt + } +} +` + +export { ViewerQuery }; \ No newline at end of file diff --git a/src/structures/character/CharacterSearchResults.ts b/src/structures/character/CharacterSearchResults.ts new file mode 100644 index 0000000..b6f3a00 --- /dev/null +++ b/src/structures/character/CharacterSearchResults.ts @@ -0,0 +1,15 @@ +import Client from '../..'; +import { PageInfo } from '../../types/types'; +import { CharacterStructure } from './CharacterStructure'; + +/** Search results for an Anime or Manga Character. */ +export class CharacterSearchResults { + pageInfo: PageInfo; + Results: CharacterStructure[]; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.pageInfo = json.pageInfo; + this.Results = json.Results.map((result: any) => new CharacterStructure(result, client)); + } +} \ No newline at end of file diff --git a/src/structures/character/CharacterStructure.ts b/src/structures/character/CharacterStructure.ts new file mode 100644 index 0000000..f790e9e --- /dev/null +++ b/src/structures/character/CharacterStructure.ts @@ -0,0 +1,28 @@ +import Client from '../..'; +import { Character } from '../../types/types'; +import { CharacterFavorite } from '../../queries/mutations/character/CharacterFavorite'; + +/** Represents an Anime or Manga Character. */ +export class CharacterStructure { + info: Character; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Toggle this character's favourited status.\ + * Requires you to be logged in. + */ + async favourite() { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + const json = await this.client.utilities.APIRequest(CharacterFavorite, { id: this.info.id }, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/structures/media/MediaSearchResults.ts b/src/structures/media/MediaSearchResults.ts new file mode 100644 index 0000000..8c53413 --- /dev/null +++ b/src/structures/media/MediaSearchResults.ts @@ -0,0 +1,16 @@ +import Client from '../..'; +import { PageInfo } from '../../types/types'; +import { MediaStructure } from './MediaStructure'; + +/** Search results for an Anime or Manga. */ +export class MediaSearchResults { + pageInfo: PageInfo; + Results: MediaStructure[]; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + this.pageInfo = json.pageInfo; + this.Results = json.Results.map((result: any) => new MediaStructure(result, client)); + } +} \ No newline at end of file diff --git a/src/structures/media/MediaStructure.ts b/src/structures/media/MediaStructure.ts new file mode 100644 index 0000000..724948e --- /dev/null +++ b/src/structures/media/MediaStructure.ts @@ -0,0 +1,50 @@ +import Client from '../..'; +import { Media, MutationSaveMediaListEntryArgs } from '../../types/types'; +import { MediaUpdate } from '../../queries/mutations/media/MediaUpdate'; +import { AnimeFavorite } from '../../queries/mutations/media/AnimeFavourite'; +import { MangaFavorite } from '../../queries/mutations/media/MangaFavourite'; + +/** Represents an Anime or Manga. */ +export class MediaStructure { + info: Media; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Update an entry.\ + * **REQUIRES YOU TO BE LOGGED IN!** + * @param entry what to update + * @example + * .update({ score: 80, completedAt: Date.now() }); + */ + async update(entry: MutationSaveMediaListEntryArgs) { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + Object.assign(entry, { mediaId: this.info.id }); + const json = await this.client.utilities.APIRequest(MediaUpdate, entry, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } + + /** + * Toggle this media's favourited status.\ + * Requires you to be logged in. + */ + async favourite() { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + let mutation = AnimeFavorite; + if (this.info.format === 'MANGA') mutation = MangaFavorite; + + const json = await this.client.utilities.APIRequest(mutation, { id: this.info.id }, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/structures/staff/StaffSearchResults.ts b/src/structures/staff/StaffSearchResults.ts new file mode 100644 index 0000000..89b9186 --- /dev/null +++ b/src/structures/staff/StaffSearchResults.ts @@ -0,0 +1,16 @@ +import Client from '../..'; +import { PageInfo } from '../../types/types'; +import { StaffStructure } from './StaffStructure'; + +/** Search results for a Voice actor or production staff. */ +export class StaffSearchResults { + pageInfo: PageInfo; + Results: StaffStructure[]; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + this.pageInfo = json.pageInfo; + this.Results = json.Results.map((result: any) => new StaffStructure(result, client)); + } +} \ No newline at end of file diff --git a/src/structures/staff/StaffStructure.ts b/src/structures/staff/StaffStructure.ts new file mode 100644 index 0000000..ded0d7d --- /dev/null +++ b/src/structures/staff/StaffStructure.ts @@ -0,0 +1,28 @@ +import Client from '../..'; +import { StaffFavorite } from '../../queries/mutations/staff/StaffFavourite'; +import { Staff } from '../../types/types'; + +/** Represents a Voice actor or production staff. */ +export class StaffStructure { + info: Staff; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Toggle this staff's favourited status.\ + * Requires you to be logged in. + */ + async favourite() { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + const json = await this.client.utilities.APIRequest(StaffFavorite, { id: this.info.id }, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/structures/studio/StudioSearchResults.ts b/src/structures/studio/StudioSearchResults.ts new file mode 100644 index 0000000..08cea17 --- /dev/null +++ b/src/structures/studio/StudioSearchResults.ts @@ -0,0 +1,16 @@ +import Client from '../..'; +import { PageInfo } from '../../types/types'; +import { StudioStructure } from './StudioStructure'; + +/** Search results for an Animation or production company. */ +export class StudioSearchResults { + pageInfo: PageInfo; + Results: StudioStructure[]; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + this.pageInfo = json.pageInfo; + this.Results = json.Results.map((result: any) => new StudioStructure(result, client)); + } +} \ No newline at end of file diff --git a/src/structures/studio/StudioStructure.ts b/src/structures/studio/StudioStructure.ts new file mode 100644 index 0000000..33f8103 --- /dev/null +++ b/src/structures/studio/StudioStructure.ts @@ -0,0 +1,28 @@ +import Client from '../..'; +import { StudioFavorite } from '../../queries/mutations/studio/StudioFavourite'; +import { Studio } from '../../types/types'; + +/** Represents an Animation or production company. */ +export class StudioStructure { + info: Studio; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Toggle this studio's favourited status.\ + * Requires you to be logged in. + */ + async favourite() { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + const json = await this.client.utilities.APIRequest(StudioFavorite, { id: this.info.id }, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/structures/user/UserSearchResults.ts b/src/structures/user/UserSearchResults.ts new file mode 100644 index 0000000..0f6c694 --- /dev/null +++ b/src/structures/user/UserSearchResults.ts @@ -0,0 +1,16 @@ +import Client from '../..'; +import { PageInfo } from '../../types/types'; +import { UserStructure } from './UserStructure'; + +/** Represents search results for an AniList User. */ +export class UserSearchResults { + pageInfo: PageInfo; + Results: UserStructure[]; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + this.pageInfo = json.pageInfo; + this.Results = json.Results.map((result: any) => new UserStructure(result, client)); + } +} \ No newline at end of file diff --git a/src/structures/user/UserStructure.ts b/src/structures/user/UserStructure.ts new file mode 100644 index 0000000..771f0a4 --- /dev/null +++ b/src/structures/user/UserStructure.ts @@ -0,0 +1,28 @@ +import Client from '../..'; +import { UserFollow } from '../../queries/mutations/user/UserFollow'; +import { User } from '../../types/types'; + +/** Represents an AniList User. */ +export class UserStructure { + info: User; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Follow this user.\ + * Requires you to be logged in. + */ + async follow() { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + const json = await this.client.utilities.APIRequest(UserFollow, { userId: this.info.id }, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/structures/user/ViewerStructure.ts b/src/structures/user/ViewerStructure.ts new file mode 100644 index 0000000..a9a09a8 --- /dev/null +++ b/src/structures/user/ViewerStructure.ts @@ -0,0 +1,31 @@ +import Client from '../..'; +import { ViewerUpdate } from '../../queries/mutations/user/viewer/ViewerUpdate'; +import { MutationUpdateUserArgs, User } from '../../types/types'; + +/** Represents the client user. */ +export class ViewerStructure { + info: User; + client?: Client; + + constructor(json: any, client: Client) { + if (json.errors) throw new Error(JSON.stringify(json.errors)); + this.info = json; + if (client.token) this.client = client; + } + + /** + * Update the authorized user.\ + * Requires you to be logged in. + * @param entry what to update + * @example + * .update({ about: 'Hi' }); + */ + async update(entry: MutationUpdateUserArgs) { + if (!this.client?.token) throw new Error('This feature requires you to be logged in.'); + + const json = await this.client.utilities.APIRequest(ViewerUpdate, entry, this.client); + if (json.errors) throw new Error(JSON.stringify(json.errors)); + + return json; + } +} \ No newline at end of file diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..3e32ec8 --- /dev/null +++ b/src/test.ts @@ -0,0 +1,9 @@ +require('dotenv').config(); + +import Client from './index'; +const AniList = new Client(process.env.token); + +(async function () { + const me = await AniList.getMedia(1); + me.update({ score: 10 }); +})(); \ No newline at end of file diff --git a/src/types/custom/Genres.ts b/src/types/custom/Genres.ts new file mode 100644 index 0000000..cdeb2af --- /dev/null +++ b/src/types/custom/Genres.ts @@ -0,0 +1,21 @@ +export type Genres = +| 'ACTION' +| 'ADVENTURE' +| 'COMEDY' +| 'DRAMA' +| 'ECCHI' +| 'FANTASY' +| 'HORROR' +| 'HENTAI' +| 'MAHOU SHOUJO' +| 'MECHA' +| 'MECHA' +| 'MUSIC' +| 'MYSTERY' +| 'PSYCHOLOGICAL' +| 'ROMANCE' +| 'SCI-FI' +| 'SLICE OF LIFE' +| 'SPORTS' +| 'SUPERNATURAL' +| 'THRILLER'; \ No newline at end of file diff --git a/src/types/custom/Tags.ts b/src/types/custom/Tags.ts new file mode 100644 index 0000000..f37865b --- /dev/null +++ b/src/types/custom/Tags.ts @@ -0,0 +1,289 @@ +export type Tags = +| '4-koma' +| 'Achromatic' +| 'Achronological Order' +| 'Acting' +| 'Advertisement' +| 'Afterlife' +| 'Age Gap' +| 'Age Regression' +| 'Agender' +| 'Ahegao' +| 'Airsoft' +| 'Aliens' +| 'Alternate Universe' +| 'American Football' +| 'Amnesia' +| 'Amputation' +| 'Anachronism' +| 'Anal Sex' +| 'Animals' +| 'Anthology' +| 'Anti-Hero' +| 'Archery' +| 'Armpits' +| 'Artificial Intelligence' +| 'Asexual' +| 'Ashikoki' +| 'Asphyxiation' +| 'Assassins' +| 'Astronomy' +| 'Athletics' +| 'Augmented Reality' +| 'Autobiographical' +| 'Aviation' +| 'Badminton' +| 'Band' +| 'Bar' +| 'Baseball' +| 'Basketball' +| 'Battle Royale' +| 'Biographical' +| 'Bisexual' +| 'Blackmail' +| 'Body Horror' +| 'Body Swapping' +| 'Bondage' +| 'Boobjob' +| 'Boxing' +| 'Boys Love' +| 'Bullying' +| 'Calligraphy' +| 'Card Battle' +| 'Cars' +| 'Centaur' +| 'CGI' +| 'Cheerleading' +| 'Chibi' +| 'Chimera' +| 'Chuunibyou' +| 'Circus' +| 'Classic Literature' +| 'College' +| 'Coming of Age' +| 'Conspiracy' +| 'Cosmic Horror' +| 'Cosplay' +| 'Crime' +| 'Crossdressing' +| 'Crossover' +| 'Cult' +| 'Cultivation' +| 'Cunnilingus' +| 'Cute Girls Doing Cute Things' +| 'Cyberpunk' +| 'Cycling' +| 'Dancing' +| 'Dark Skin' +| 'Death Game' +| 'Defloration' +| 'Delinquents' +| 'Demons' +| 'Denpa' +| 'Detective' +| 'Dinosaurs' +| 'Dissociative Identities' +| 'Dragons' +| 'Drawing' +| 'Drugs' +| 'Dullahan' +| 'Dungeon' +| 'Dystopian' +| 'Economics' +| 'Educational' +| 'Elf' +| 'Ensemble Cast' +| 'Environmental' +| 'Episodic' +| 'Ero Guro' +| 'Espionage' +| 'Facial' +| 'Fairy Tale' +| 'Family Life' +| 'Fashion' +| 'Feet' +| 'Fellatio' +| 'Female Protagonist' +| 'Firefighters' +| 'Fishing' +| 'Fitness' +| 'Flash' +| 'Flat Chest' +| 'Food' +| 'Football' +| 'Foreign' +| 'Fugitive' +| 'Full CGI' +| 'Full Color' +| 'Futanari' +| 'Gambling' +| 'Gangs' +| 'Gender Bending' +| 'Ghost' +| 'Go' +| 'Goblin' +| 'Gods' +| 'Golf' +| 'Gore' +| 'Guns' +| 'Gyaru' +| 'Handjob' +| 'Harem' +| 'Henshin' +| 'Hikikomori' +| 'Historical' +| 'Human Pet' +| 'Ice Skating' +| 'Idol' +| 'Incest' +| 'Irrumatio' +| 'Isekai' +| 'Iyashikei' +| 'Josei' +| 'Kaiju' +| 'Karuta' +| 'Kemonomimi' +| 'Kids' +| 'Kuudere' +| 'Lacrosse' +| 'Lactation' +| 'Language Barrier' +| 'Large Breasts' +| 'LGBTQ Issues' +| 'Lost Civilization' +| 'Love Triangle' +| 'Mafia' +| 'Magic' +| 'Mahjong' +| 'Maids' +| 'Male Protagonist' +| 'Martial Arts' +| 'Masturbation' +| 'Medicine' +| 'Memory Manipulation' +| 'Mermaid' +| 'Meta' +| 'MILF' +| 'Military' +| 'Monster Girl' +| 'Mopeds' +| 'Motorcycles' +| 'Musical' +| 'Mythology' +| 'Nakadashi' +| 'Nekomimi' +| 'Netorare' +| 'Netorase' +| 'Netori' +| 'Ninja' +| 'No Dialogue' +| 'Noir' +| 'Nudity' +| 'Nun' +| 'Office Lady' +| 'Oiran' +| 'Ojou-sama' +| 'Omegaverse' +| 'Otaku Culture' +| 'Outdoor' +| 'Parody' +| 'Philosophy' +| 'Photography' +| 'Pirates' +| 'Poker' +| 'Police' +| 'Politics' +| 'Post-Apocalyptic' +| 'POV' +| 'Pregnant' +| 'Primarily Adult Cast' +| 'Primarily Child Cast' +| 'Primarily Female Cast' +| 'Primarily Male Cast' +| 'Prostitution' +| 'Public Sex' +| 'Puppetry' +| 'Rakugo' +| 'Rape' +| 'Real Robot' +| 'Rehabilitation' +| 'Reincarnation' +| 'Revenge' +| 'Reverse Harem' +| 'Rimjob' +| 'Robots' +| 'Rotoscoping' +| 'Rugby' +| 'Rural' +| 'Sadism' +| 'Samurai' +| 'Satire' +| 'Scat' +| 'School' +| 'School Club' +| 'Seinen' +| 'Sex Toys' +| 'Shapeshifting' +| 'Ships' +| 'Shogi' +| 'Shoujo' +| 'Shounen' +| 'Shrine Maiden' +| 'Skeleton' +| 'Slapstick' +| 'Slavery' +| 'Software Development' +| 'Space' +| 'Space Opera' +| 'Steampunk' +| 'Stop Motion' +| 'Succubus' +| 'Sumata' +| 'Super Power' +| 'Super Robot' +| 'Superhero' +| 'Surfing' +| 'Surreal Comedy' +| 'Survival' +| 'Sweat' +| 'Swimming' +| 'Swordplay' +| 'Table Tennis' +| 'Tanks' +| 'Teacher' +| 'Teens Love' +| 'Tennis' +| 'Tentacles' +| 'Terrorism' +| 'Threesome' +| 'Time Manipulation' +| 'Time Skip' +| 'Tokusatsu' +| 'Tragedy' +| 'Trains' +| 'Triads' +| 'Tsundere' +| 'Twins' +| 'Urban' +| 'Urban Fantasy' +| 'Urination' +| 'Vampire' +| 'Video Games' +| 'Vikings' +| 'Virginity' +| 'Virtual World' +| 'Volleyball' +| 'Vore' +| 'Voyeur' +| 'War' +| 'Werewolf' +| 'Witch' +| 'Work' +| 'Wrestling' +| 'Writing' +| 'Wuxia' +| 'Yakuza' +| 'Yandere' +| 'Youkai' +| 'Yuri' +| 'Zombie'; \ No newline at end of file diff --git a/src/types/types.ts b/src/types/types.ts new file mode 100644 index 0000000..4830d0c --- /dev/null +++ b/src/types/types.ts @@ -0,0 +1,4147 @@ +import { Genres } from './custom/Genres'; +import { Tags } from './custom/Tags'; + +export type Maybe = T | null; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + Json: any; + /** ISO 3166-1 alpha-2 country code */ + CountryCode: any; + /** 8 digit long date integer (YYYYMMDD). Unknown dates represented by 0. E.g. 2016: 20160000, May 1976: 19760500 */ + FuzzyDateInt: any; + Genre: Genres; + Tag: Tags; +}; + +export type Query = { + Page?: Maybe; + /** Media query */ + Media?: Maybe; + /** Media Trend query */ + MediaTrend?: Maybe; + /** Airing schedule query */ + AiringSchedule?: Maybe; + /** Character query */ + Character?: Maybe; + /** Staff query */ + Staff?: Maybe; + /** Media list query */ + MediaList?: Maybe; + /** Media list collection query, provides list pre-grouped by status & custom lists. User ID and Media Type arguments required. */ + MediaListCollection?: Maybe; + /** Collection of all the possible media genres */ + GenreCollection?: Maybe>>; + /** Collection of all the possible media tags */ + MediaTagCollection?: Maybe>>; + /** User query */ + User?: Maybe; + /** Get the currently authenticated user */ + Viewer?: Maybe; + /** Notification query */ + Notification?: Maybe; + /** Studio query */ + Studio?: Maybe; + /** Review query */ + Review?: Maybe; + /** Activity query */ + Activity?: Maybe; + /** Activity reply query */ + ActivityReply?: Maybe; + /** Follow query */ + Following?: Maybe; + /** Follow query */ + Follower?: Maybe; + /** Thread query */ + Thread?: Maybe; + /** Comment query */ + ThreadComment?: Maybe>>; + /** Recommendation query */ + Recommendation?: Maybe; + /** Like query */ + Like?: Maybe; + /** Provide AniList markdown to be converted to html (Requires auth) */ + Markdown?: Maybe; + AniChartUser?: Maybe; + /** Site statistics query */ + SiteStatistics?: Maybe; +}; + + +export type QueryPageArgs = { + page?: Maybe; + perPage?: Maybe; +}; + + +export type QueryMediaArgs = { + id?: Maybe; + idMal?: Maybe; + startDate?: Maybe; + endDate?: Maybe; + season?: Maybe; + seasonYear?: Maybe; + type?: Maybe; + format?: Maybe; + status?: Maybe; + episodes?: Maybe; + duration?: Maybe; + chapters?: Maybe; + volumes?: Maybe; + isAdult?: Maybe; + genre?: Maybe; + tag?: Maybe; + minimumTagRank?: Maybe; + tagCategory?: Maybe; + onList?: Maybe; + licensedBy?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + source?: Maybe; + countryOfOrigin?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + idMal_not?: Maybe; + idMal_in?: Maybe>>; + idMal_not_in?: Maybe>>; + startDate_greater?: Maybe; + startDate_lesser?: Maybe; + startDate_like?: Maybe; + endDate_greater?: Maybe; + endDate_lesser?: Maybe; + endDate_like?: Maybe; + format_in?: Maybe>>; + format_not?: Maybe; + format_not_in?: Maybe>>; + status_in?: Maybe>>; + status_not?: Maybe; + status_not_in?: Maybe>>; + episodes_greater?: Maybe; + episodes_lesser?: Maybe; + duration_greater?: Maybe; + duration_lesser?: Maybe; + chapters_greater?: Maybe; + chapters_lesser?: Maybe; + volumes_greater?: Maybe; + volumes_lesser?: Maybe; + genre_in?: Maybe>>; + genre_not_in?: Maybe>>; + tag_in?: Maybe>>; + tag_not_in?: Maybe>>; + tagCategory_in?: Maybe>>; + tagCategory_not_in?: Maybe>>; + licensedBy_in?: Maybe>>; + averageScore_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + popularity_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + source_in?: Maybe>>; + sort?: Maybe>>; +}; + + +export type QueryMediaTrendArgs = { + mediaId?: Maybe; + date?: Maybe; + trending?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + episode?: Maybe; + releasing?: Maybe; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + date_greater?: Maybe; + date_lesser?: Maybe; + trending_greater?: Maybe; + trending_lesser?: Maybe; + trending_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + averageScore_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + popularity_not?: Maybe; + episode_greater?: Maybe; + episode_lesser?: Maybe; + episode_not?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryAiringScheduleArgs = { + id?: Maybe; + mediaId?: Maybe; + episode?: Maybe; + airingAt?: Maybe; + notYetAired?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + episode_not?: Maybe; + episode_in?: Maybe>>; + episode_not_in?: Maybe>>; + episode_greater?: Maybe; + episode_lesser?: Maybe; + airingAt_greater?: Maybe; + airingAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryCharacterArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +export type QueryStaffArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +export type QueryMediaListArgs = { + id?: Maybe; + userId?: Maybe; + userName?: Maybe; + type?: Maybe; + status?: Maybe; + mediaId?: Maybe; + isFollowing?: Maybe; + notes?: Maybe; + startedAt?: Maybe; + completedAt?: Maybe; + compareWithAuthList?: Maybe; + userId_in?: Maybe>>; + status_in?: Maybe>>; + status_not_in?: Maybe>>; + status_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + notes_like?: Maybe; + startedAt_greater?: Maybe; + startedAt_lesser?: Maybe; + startedAt_like?: Maybe; + completedAt_greater?: Maybe; + completedAt_lesser?: Maybe; + completedAt_like?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryMediaListCollectionArgs = { + userId?: Maybe; + userName?: Maybe; + type?: Maybe; + status?: Maybe; + notes?: Maybe; + startedAt?: Maybe; + completedAt?: Maybe; + forceSingleCompletedList?: Maybe; + chunk?: Maybe; + perChunk?: Maybe; + status_in?: Maybe>>; + status_not_in?: Maybe>>; + status_not?: Maybe; + notes_like?: Maybe; + startedAt_greater?: Maybe; + startedAt_lesser?: Maybe; + startedAt_like?: Maybe; + completedAt_greater?: Maybe; + completedAt_lesser?: Maybe; + completedAt_like?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryMediaTagCollectionArgs = { + status?: Maybe; +}; + + +export type QueryUserArgs = { + id?: Maybe; + name?: Maybe; + search?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryNotificationArgs = { + type?: Maybe; + resetNotificationCount?: Maybe; + type_in?: Maybe>>; +}; + + +export type QueryStudioArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +export type QueryReviewArgs = { + id?: Maybe; + mediaId?: Maybe; + userId?: Maybe; + mediaType?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryActivityArgs = { + id?: Maybe; + userId?: Maybe; + messengerId?: Maybe; + mediaId?: Maybe; + type?: Maybe; + isFollowing?: Maybe; + hasReplies?: Maybe; + hasRepliesOrTypeText?: Maybe; + createdAt?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + userId_not?: Maybe; + userId_in?: Maybe>>; + userId_not_in?: Maybe>>; + messengerId_not?: Maybe; + messengerId_in?: Maybe>>; + messengerId_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + type_not?: Maybe; + type_in?: Maybe>>; + type_not_in?: Maybe>>; + createdAt_greater?: Maybe; + createdAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryActivityReplyArgs = { + id?: Maybe; + activityId?: Maybe; +}; + + +export type QueryFollowingArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +export type QueryFollowerArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +export type QueryThreadArgs = { + id?: Maybe; + userId?: Maybe; + replyUserId?: Maybe; + subscribed?: Maybe; + categoryId?: Maybe; + mediaCategoryId?: Maybe; + search?: Maybe; + id_in?: Maybe>>; + sort?: Maybe>>; +}; + + +export type QueryThreadCommentArgs = { + id?: Maybe; + threadId?: Maybe; + userId?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryRecommendationArgs = { + id?: Maybe; + mediaId?: Maybe; + mediaRecommendationId?: Maybe; + userId?: Maybe; + rating?: Maybe; + onList?: Maybe; + rating_greater?: Maybe; + rating_lesser?: Maybe; + sort?: Maybe>>; +}; + + +export type QueryLikeArgs = { + likeableId?: Maybe; + type?: Maybe; +}; + + +export type QueryMarkdownArgs = { + markdown: Scalars['String']; +}; + +/** Page of data */ +export type Page = { + /** The pagination information */ + pageInfo?: Maybe; + users?: Maybe>>; + media?: Maybe>>; + characters?: Maybe>>; + staff?: Maybe>>; + studios?: Maybe>>; + mediaList?: Maybe>>; + airingSchedules?: Maybe>>; + mediaTrends?: Maybe>>; + notifications?: Maybe>>; + followers?: Maybe>>; + following?: Maybe>>; + activities?: Maybe>>; + activityReplies?: Maybe>>; + threads?: Maybe>>; + threadComments?: Maybe>>; + reviews?: Maybe>>; + recommendations?: Maybe>>; + likes?: Maybe>>; +}; + + +/** Page of data */ +export type PageUsersArgs = { + id?: Maybe; + name?: Maybe; + search?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageMediaArgs = { + id?: Maybe; + idMal?: Maybe; + startDate?: Maybe; + endDate?: Maybe; + season?: Maybe; + seasonYear?: Maybe; + type?: Maybe; + format?: Maybe; + status?: Maybe; + episodes?: Maybe; + duration?: Maybe; + chapters?: Maybe; + volumes?: Maybe; + isAdult?: Maybe; + genre?: Maybe; + tag?: Maybe; + minimumTagRank?: Maybe; + tagCategory?: Maybe; + onList?: Maybe; + licensedBy?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + source?: Maybe; + countryOfOrigin?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + idMal_not?: Maybe; + idMal_in?: Maybe>>; + idMal_not_in?: Maybe>>; + startDate_greater?: Maybe; + startDate_lesser?: Maybe; + startDate_like?: Maybe; + endDate_greater?: Maybe; + endDate_lesser?: Maybe; + endDate_like?: Maybe; + format_in?: Maybe>>; + format_not?: Maybe; + format_not_in?: Maybe>>; + status_in?: Maybe>>; + status_not?: Maybe; + status_not_in?: Maybe>>; + episodes_greater?: Maybe; + episodes_lesser?: Maybe; + duration_greater?: Maybe; + duration_lesser?: Maybe; + chapters_greater?: Maybe; + chapters_lesser?: Maybe; + volumes_greater?: Maybe; + volumes_lesser?: Maybe; + genre_in?: Maybe>>; + genre_not_in?: Maybe>>; + tag_in?: Maybe>>; + tag_not_in?: Maybe>>; + tagCategory_in?: Maybe>>; + tagCategory_not_in?: Maybe>>; + licensedBy_in?: Maybe>>; + averageScore_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + popularity_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + source_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageCharactersArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageStaffArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageStudiosArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageMediaListArgs = { + id?: Maybe; + userId?: Maybe; + userName?: Maybe; + type?: Maybe; + status?: Maybe; + mediaId?: Maybe; + isFollowing?: Maybe; + notes?: Maybe; + startedAt?: Maybe; + completedAt?: Maybe; + compareWithAuthList?: Maybe; + userId_in?: Maybe>>; + status_in?: Maybe>>; + status_not_in?: Maybe>>; + status_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + notes_like?: Maybe; + startedAt_greater?: Maybe; + startedAt_lesser?: Maybe; + startedAt_like?: Maybe; + completedAt_greater?: Maybe; + completedAt_lesser?: Maybe; + completedAt_like?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageAiringSchedulesArgs = { + id?: Maybe; + mediaId?: Maybe; + episode?: Maybe; + airingAt?: Maybe; + notYetAired?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + episode_not?: Maybe; + episode_in?: Maybe>>; + episode_not_in?: Maybe>>; + episode_greater?: Maybe; + episode_lesser?: Maybe; + airingAt_greater?: Maybe; + airingAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageMediaTrendsArgs = { + mediaId?: Maybe; + date?: Maybe; + trending?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + episode?: Maybe; + releasing?: Maybe; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + date_greater?: Maybe; + date_lesser?: Maybe; + trending_greater?: Maybe; + trending_lesser?: Maybe; + trending_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + averageScore_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + popularity_not?: Maybe; + episode_greater?: Maybe; + episode_lesser?: Maybe; + episode_not?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageNotificationsArgs = { + type?: Maybe; + resetNotificationCount?: Maybe; + type_in?: Maybe>>; +}; + + +/** Page of data */ +export type PageFollowersArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageFollowingArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageActivitiesArgs = { + id?: Maybe; + userId?: Maybe; + messengerId?: Maybe; + mediaId?: Maybe; + type?: Maybe; + isFollowing?: Maybe; + hasReplies?: Maybe; + hasRepliesOrTypeText?: Maybe; + createdAt?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + userId_not?: Maybe; + userId_in?: Maybe>>; + userId_not_in?: Maybe>>; + messengerId_not?: Maybe; + messengerId_in?: Maybe>>; + messengerId_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + type_not?: Maybe; + type_in?: Maybe>>; + type_not_in?: Maybe>>; + createdAt_greater?: Maybe; + createdAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageActivityRepliesArgs = { + id?: Maybe; + activityId?: Maybe; +}; + + +/** Page of data */ +export type PageThreadsArgs = { + id?: Maybe; + userId?: Maybe; + replyUserId?: Maybe; + subscribed?: Maybe; + categoryId?: Maybe; + mediaCategoryId?: Maybe; + search?: Maybe; + id_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageThreadCommentsArgs = { + id?: Maybe; + threadId?: Maybe; + userId?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageReviewsArgs = { + id?: Maybe; + mediaId?: Maybe; + userId?: Maybe; + mediaType?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageRecommendationsArgs = { + id?: Maybe; + mediaId?: Maybe; + mediaRecommendationId?: Maybe; + userId?: Maybe; + rating?: Maybe; + onList?: Maybe; + rating_greater?: Maybe; + rating_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data */ +export type PageLikesArgs = { + likeableId?: Maybe; + type?: Maybe; +}; + +export type PageInfo = { + /** The total number of items */ + total?: Maybe; + /** The count on a page */ + perPage?: Maybe; + /** The current page */ + currentPage?: Maybe; + /** The last page */ + lastPage?: Maybe; + /** If there is another page */ + hasNextPage?: Maybe; +}; + +/** User sort enums */ +export type UserSort = + | 'ID' + | 'ID_DESC' + | 'USERNAME' + | 'USERNAME_DESC' + | 'WATCHED_TIME' + | 'WATCHED_TIME_DESC' + | 'CHAPTERS_READ' + | 'CHAPTERS_READ_DESC' + | 'SEARCH_MATCH'; + +/** A user */ +export type User = { + /** The id of the user */ + id: Scalars['Int']; + /** The name of the user */ + name: Scalars['String']; + /** The bio written by user (Markdown) */ + about?: Maybe; + /** The user's avatar images */ + avatar?: Maybe; + /** The user's banner images */ + bannerImage?: Maybe; + /** If the authenticated user if following this user */ + isFollowing?: Maybe; + /** If this user if following the authenticated user */ + isFollower?: Maybe; + /** If the user is blocked by the authenticated user */ + isBlocked?: Maybe; + bans?: Maybe; + /** The user's general options */ + options?: Maybe; + /** The user's media list options */ + mediaListOptions?: Maybe; + /** The users favourites */ + favourites?: Maybe; + /** The users anime & manga list statistics */ + statistics?: Maybe; + /** The number of unread notifications the user has */ + unreadNotificationCount?: Maybe; + /** The url for the user page on the AniList website */ + siteUrl?: Maybe; + /** The donation tier of the user */ + donatorTier?: Maybe; + /** Custom donation badge text */ + donatorBadge?: Maybe; + /** If the user is a moderator or data moderator */ + moderatorStatus?: Maybe; + /** When the user's data was last updated */ + updatedAt?: Maybe; + /** + * The user's statistics + * @deprecated Deprecated. Replaced with statistics field. + */ + stats?: Maybe; +}; + + +/** A user */ +export type UserAboutArgs = { + asHtml?: Maybe; +}; + + +/** A user */ +export type UserFavouritesArgs = { + page?: Maybe; +}; + +/** A user's avatars */ +export type UserAvatar = { + /** The avatar of user at its largest size */ + large?: Maybe; + /** The avatar of user at medium size */ + medium?: Maybe; +}; + + +/** A user's general options */ +export type UserOptions = { + /** The language the user wants to see media titles in */ + titleLanguage?: Maybe; + /** Whether the user has enabled viewing of 18+ content */ + displayAdultContent?: Maybe; + /** Whether the user receives notifications when a show they are watching aires */ + airingNotifications?: Maybe; + /** Profile highlight color (blue, purple, pink, orange, red, green, gray) */ + profileColor?: Maybe; + /** Notification options */ + notificationOptions?: Maybe>>; +}; + +/** The language the user wants to see media titles in */ +export type UserTitleLanguage = + /** The romanization of the native language title */ + | 'ROMAJI' + /** The official english title */ + | 'ENGLISH' + /** Official title in it's native language */ + | 'NATIVE' + /** The romanization of the native language title, stylised by media creator */ + | 'ROMAJI_STYLISED' + /** The official english title, stylised by media creator */ + | 'ENGLISH_STYLISED' + /** Official title in it's native language, stylised by media creator */ + | 'NATIVE_STYLISED'; + +/** Notification option */ +export type NotificationOption = { + /** The type of notification */ + type?: Maybe; + /** Whether this type of notification is enabled */ + enabled?: Maybe; +}; + +/** Notification type enum */ +export type NotificationType = + /** A user has sent you message */ + | 'ACTIVITY_MESSAGE' + /** A user has replied to your activity */ + | 'ACTIVITY_REPLY' + /** A user has followed you */ + | 'FOLLOWING' + /** A user has mentioned you in their activity */ + | 'ACTIVITY_MENTION' + /** A user has mentioned you in a forum comment */ + | 'THREAD_COMMENT_MENTION' + /** A user has commented in one of your subscribed forum threads */ + | 'THREAD_SUBSCRIBED' + /** A user has replied to your forum comment */ + | 'THREAD_COMMENT_REPLY' + /** An anime you are currently watching has aired */ + | 'AIRING' + /** A user has liked your activity */ + | 'ACTIVITY_LIKE' + /** A user has liked your activity reply */ + | 'ACTIVITY_REPLY_LIKE' + /** A user has liked your forum thread */ + | 'THREAD_LIKE' + /** A user has liked your forum comment */ + | 'THREAD_COMMENT_LIKE' + /** A user has replied to activity you have also replied to */ + | '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'; + +/** A user's list options */ +export type MediaListOptions = { + /** The score format the user is using for media lists */ + scoreFormat?: Maybe; + /** The default order list rows should be displayed in */ + rowOrder?: Maybe; + /** @deprecated No longer used */ + useLegacyLists?: Maybe; + /** The user's anime list options */ + animeList?: Maybe; + /** The user's manga list options */ + mangaList?: Maybe; + /** + * The list theme options for both lists + * @deprecated No longer used + */ + sharedTheme?: Maybe; + /** + * If the shared theme should be used instead of the individual list themes + * @deprecated No longer used + */ + sharedThemeEnabled?: Maybe; +}; + +/** Media list scoring type */ +export type ScoreFormat = + /** An integer from 0-100 */ + | 'POINT_100' + /** A float from 0-10 with 1 decimal place */ + | 'POINT_10_DECIMAL' + /** An integer from 0-10 */ + | 'POINT_10' + /** An integer from 0-5. Should be represented in Stars */ + | 'POINT_5' + /** An integer from 0-3. Should be represented in Smileys. 0 => No Score, 1 => :(, 2 => :|, 3 => :) */ + | 'POINT_3'; + +/** A user's list options for anime or manga lists */ +export type MediaListTypeOptions = { + /** The order each list should be displayed in */ + sectionOrder?: Maybe>>; + /** If the completed sections of the list should be separated by format */ + splitCompletedSectionByFormat?: Maybe; + /** + * The list theme options + * @deprecated This field has not yet been fully implemented and may change without warning + */ + theme?: Maybe; + /** The names of the user's custom lists */ + customLists?: Maybe>>; + /** The names of the user's advanced scoring sections */ + advancedScoring?: Maybe>>; + /** If advanced scoring is enabled */ + advancedScoringEnabled?: Maybe; +}; + +/** User's favourite anime, manga, characters, staff & studios */ +export type Favourites = { + /** Favourite anime */ + anime?: Maybe; + /** Favourite manga */ + manga?: Maybe; + /** Favourite characters */ + characters?: Maybe; + /** Favourite staff */ + staff?: Maybe; + /** Favourite studios */ + studios?: Maybe; +}; + + +/** User's favourite anime, manga, characters, staff & studios */ +export type FavouritesAnimeArgs = { + page?: Maybe; + perPage?: Maybe; +}; + + +/** User's favourite anime, manga, characters, staff & studios */ +export type FavouritesMangaArgs = { + page?: Maybe; + perPage?: Maybe; +}; + + +/** User's favourite anime, manga, characters, staff & studios */ +export type FavouritesCharactersArgs = { + page?: Maybe; + perPage?: Maybe; +}; + + +/** User's favourite anime, manga, characters, staff & studios */ +export type FavouritesStaffArgs = { + page?: Maybe; + perPage?: Maybe; +}; + + +/** User's favourite anime, manga, characters, staff & studios */ +export type FavouritesStudiosArgs = { + page?: Maybe; + perPage?: Maybe; +}; + +export type MediaConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Media connection edge */ +export type MediaEdge = { + node?: Maybe; + /** The id of the connection */ + id?: Maybe; + /** The type of relation to the parent model */ + relationType?: Maybe; + /** If the studio is the main animation studio of the media (For Studio->MediaConnection field only) */ + isMainStudio: Scalars['Boolean']; + /** The characters in the media voiced by the parent actor */ + characters?: Maybe>>; + /** The characters role in the media */ + characterRole?: Maybe; + /** The role of the staff member in the production of the media */ + staffRole?: Maybe; + /** The voice actors of the character */ + voiceActors?: Maybe>>; + /** The order the media should be displayed from the users favourites */ + favouriteOrder?: Maybe; +}; + + +/** Media connection edge */ +export type MediaEdgeRelationTypeArgs = { + version?: Maybe; +}; + + +/** Media connection edge */ +export type MediaEdgeVoiceActorsArgs = { + language?: Maybe; + sort?: Maybe>>; +}; + +/** Anime or Manga */ +export type Media = { + /** The id of the media */ + id: Scalars['Int']; + /** The mal id of the media */ + idMal: Maybe; + /** The official titles of the media in various languages */ + title: Maybe; + /** The type of the media; anime or manga */ + type: Maybe; + /** The format the media was released in */ + format?: Maybe; + /** The current releasing status of the media */ + status?: Maybe; + /** Short description of the media's story and characters */ + description?: Maybe; + /** The first official release date of the media */ + startDate?: Maybe; + /** The last official release date of the media */ + endDate?: Maybe; + /** The season the media was initially released in */ + season?: Maybe; + /** The season year the media was initially released in */ + seasonYear?: Maybe; + /** + * The year & season the media was initially released in + * @deprecated + */ + seasonInt?: Maybe; + /** The amount of episodes the anime has when complete */ + episodes?: Maybe; + /** The general length of each anime episode in minutes */ + duration?: Maybe; + /** The amount of chapters the manga has when complete */ + chapters?: Maybe; + /** The amount of volumes the manga has when complete */ + volumes?: Maybe; + /** Where the media was created. (ISO 3166-1 alpha-2) */ + countryOfOrigin?: Maybe; + /** If the media is officially licensed or a self-published doujin release */ + isLicensed?: Maybe; + /** Source type the media was adapted from. */ + source?: Maybe; + /** Official Twitter hashtags for the media */ + hashtag?: Maybe; + /** Media trailer or advertisement */ + trailer?: Maybe; + /** When the media's data was last updated */ + updatedAt?: Maybe; + /** The cover images of the media */ + coverImage?: Maybe; + /** The banner image of the media */ + bannerImage?: Maybe; + /** The genres of the media */ + genres?: Maybe>>; + /** Alternative titles of the media */ + synonyms?: Maybe>>; + /** A weighted average score of all the user's scores of the media */ + averageScore?: Maybe; + /** Mean score of all the user's scores of the media */ + meanScore?: Maybe; + /** The number of users with the media on their list */ + popularity?: Maybe; + /** Locked media may not be added to lists our favorited. This may be due to the entry pending for deletion or other reasons. */ + isLocked?: Maybe; + /** The amount of related activity in the past hour */ + trending?: Maybe; + /** The amount of user's who have favourited the media */ + favourites?: Maybe; + /** List of tags that describes elements and themes of the media */ + tags?: Maybe>>; + /** Other media in the same or connecting franchise */ + relations?: Maybe; + /** The characters in the media */ + characters?: Maybe; + /** The staff who produced the media */ + staff?: Maybe; + /** The companies who produced the media */ + studios?: Maybe; + /** If the media is marked as favourite by the current authenticated user */ + isFavourite: Scalars['Boolean']; + /** If the media is intended only for 18+ adult audiences */ + isAdult?: Maybe; + /** The media's next episode airing schedule */ + nextAiringEpisode?: Maybe; + /** The media's entire airing schedule */ + airingSchedule?: Maybe; + /** The media's daily trend stats */ + trends?: Maybe; + /** External links to another site related to the media */ + externalLinks?: Maybe>>; + /** Data and links to legal streaming episodes on external sites */ + streamingEpisodes?: Maybe>>; + /** The ranking of the media in a particular time span and format compared to other media */ + rankings?: Maybe>>; + /** The authenticated user's media list entry for the media */ + mediaListEntry?: Maybe; + /** User reviews of the media */ + reviews?: Maybe; + /** User recommendations for similar media */ + recommendations?: Maybe; + stats?: Maybe; + /** The url for the media page on the AniList website */ + siteUrl?: Maybe; + /** If the media should have forum thread automatically created for it on airing episode release */ + autoCreateForumThread?: Maybe; + /** If the media is blocked from being recommended to/from */ + isRecommendationBlocked?: Maybe; + /** Notes for site moderators */ + modNotes?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaStatusArgs = { + version?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaDescriptionArgs = { + asHtml?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaSourceArgs = { + version?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaCharactersArgs = { + sort?: Maybe>>; + role?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaStaffArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaStudiosArgs = { + sort?: Maybe>>; + isMain?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaAiringScheduleArgs = { + notYetAired?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaTrendsArgs = { + sort?: Maybe>>; + releasing?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaReviewsArgs = { + limit?: Maybe; + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Anime or Manga */ +export type MediaRecommendationsArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + +/** The official titles of the media in various languages */ +export type MediaTitle = { + /** The romanization of the native language title */ + romaji?: Maybe; + /** The official english title */ + english?: Maybe; + /** Official title in it's native language */ + native?: Maybe; + /** The currently authenticated users preferred title language. Default romaji for non-authenticated */ + userPreferred?: Maybe; +}; + + +/** The official titles of the media in various languages */ +export type MediaTitleRomajiArgs = { + stylised?: Maybe; +}; + + +/** The official titles of the media in various languages */ +export type MediaTitleEnglishArgs = { + stylised?: Maybe; +}; + + +/** The official titles of the media in various languages */ +export type MediaTitleNativeArgs = { + stylised?: Maybe; +}; + +/** Media type enum, anime or manga. */ +export type MediaType = + /** Japanese Anime */ + | 'ANIME' + /** Asian comic */ + | 'MANGA'; + +/** The format the media was released in */ +export type MediaFormat = + /** Anime broadcast on television */ + | 'TV' + /** Anime which are under 15 minutes in length and broadcast on television */ + | 'TV_SHORT' + /** Anime movies with a theatrical release */ + | 'MOVIE' + /** Special episodes that have been included in DVD/Blu-ray releases, picture dramas, pilots, etc */ + | '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' + /** (Original Net Animation) Anime that have been originally released online or are only available through streaming services. */ + | 'ONA' + /** Short anime released as a music video */ + | 'MUSIC' + /** Professionally published manga with more than one chapter */ + | 'MANGA' + /** Written books released as a series of light novels */ + | 'NOVEL' + /** Manga with just one chapter */ + | 'ONE_SHOT'; + +/** The current releasing status of the media */ +export type MediaStatus = + /** Has completed and is no longer being released */ + | 'FINISHED' + /** Currently releasing */ + | 'RELEASING' + /** To be released at a later date */ + | 'NOT_YET_RELEASED' + /** Ended before the work could be finished */ + | 'CANCELLED' + /** Version 2 only. Is currently paused from releasing and will resume at a later date */ + | 'HIATUS'; + +/** Date object that allows for incomplete date values (fuzzy) */ +export type FuzzyDate = { + /** Numeric Year (2017) */ + year?: Maybe; + /** Numeric Month (3) */ + month?: Maybe; + /** Numeric Day (24) */ + day?: Maybe; +}; + +export type MediaSeason = + /** Months December to February */ + | 'WINTER' + /** Months March to May */ + | 'SPRING' + /** Months June to August */ + | 'SUMMER' + /** Months September to November */ + | 'FALL'; + + +/** Source type the media was adapted from */ +export type MediaSource = + /** An original production not based of another work */ + | 'ORIGINAL' + /** Asian comic book */ + | 'MANGA' + /** Written work published in volumes */ + | 'LIGHT_NOVEL' + /** Video game driven primary by text and narrative */ + | 'VISUAL_NOVEL' + /** Video game */ + | 'VIDEO_GAME' + /** Other */ + | 'OTHER' + /** Version 2 only. Written works not published in volumes */ + | 'NOVEL' + /** Version 2 only. Self-published works */ + | 'DOUJINSHI' + /** Version 2 only. Japanese Anime */ + | 'ANIME'; + +/** Media trailer or advertisement */ +export type MediaTrailer = { + /** The trailer video id */ + id?: Maybe; + /** The site the video is hosted by (Currently either youtube or dailymotion) */ + site?: Maybe; + /** The url for the thumbnail image of the video */ + thumbnail?: Maybe; +}; + +export 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?: Maybe; + /** The cover image url of the media at a large size */ + large?: Maybe; + /** The cover image url of the media at medium size */ + medium?: Maybe; + /** Average #hex color of cover image */ + color?: Maybe; +}; + +/** A tag that describes a theme or element of the media */ +export type MediaTag = { + /** The id of the tag */ + id: Scalars['Int']; + /** The name of the tag */ + name: Scalars['String']; + /** A general description of the tag */ + description?: Maybe; + /** The categories of tags this tag belongs to */ + category?: Maybe; + /** The relevance ranking of the tag out of the 100 for this media */ + rank?: Maybe; + /** If the tag could be a spoiler for any media */ + isGeneralSpoiler?: Maybe; + /** If the tag is a spoiler for this media */ + isMediaSpoiler?: Maybe; + /** If the tag is only for adult 18+ media */ + isAdult?: Maybe; +}; + +/** Character sort enums */ +export type CharacterSort = + | 'ID' + | 'ID_DESC' + | 'ROLE' + | 'ROLE_DESC' + | 'SEARCH_MATCH' + | 'FAVOURITES' + | 'FAVOURITES_DESC'; + +/** The role the character plays in the media */ +export type CharacterRole = + /** A primary character role in the media */ + | 'MAIN' + /** A supporting character role in the media */ + | 'SUPPORTING' + /** A background character in the media */ + | 'BACKGROUND'; + +export type CharacterConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Character connection edge */ +export type CharacterEdge = { + node?: Maybe; + /** The id of the connection */ + id?: Maybe; + /** The characters role in the media */ + role?: Maybe; + /** The voice actors of the character */ + voiceActors?: Maybe>>; + /** The media the character is in */ + media?: Maybe>>; + /** The order the character should be displayed from the users favourites */ + favouriteOrder?: Maybe; +}; + + +/** Character connection edge */ +export type CharacterEdgeVoiceActorsArgs = { + language?: Maybe; + sort?: Maybe>>; +}; + +/** A character that features in an anime or manga */ +export type Character = { + /** The id of the character */ + id: Scalars['Int']; + /** The names of the character */ + name?: Maybe; + /** Character images */ + image?: Maybe; + /** A general description of the character */ + description?: Maybe; + /** If the character is marked as favourite by the currently authenticated user */ + isFavourite: Scalars['Boolean']; + /** The url for the character page on the AniList website */ + siteUrl?: Maybe; + /** Media that includes the character */ + media?: Maybe; + /** @deprecated No data available */ + updatedAt?: Maybe; + /** The amount of user's who have favourited the character */ + favourites?: Maybe; + /** Notes for site moderators */ + modNotes?: Maybe; +}; + + +/** A character that features in an anime or manga */ +export type CharacterDescriptionArgs = { + asHtml?: Maybe; +}; + + +/** A character that features in an anime or manga */ +export type CharacterMediaArgs = { + sort?: Maybe>>; + type?: Maybe; + onList?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + +/** The names of the character */ +export type CharacterName = { + /** The character's given name */ + first?: Maybe; + /** The character's surname */ + last?: Maybe; + /** The character's full name */ + full?: Maybe; + /** The character's full name in their native language */ + native?: Maybe; + /** Other names the character might be referred to as */ + alternative?: Maybe>>; +}; + +export type CharacterImage = { + /** The character's image of media at its largest size */ + large?: Maybe; + /** The character's image of media at medium size */ + medium?: Maybe; +}; + +/** Media sort enums */ +export type MediaSort = + | 'ID' + | 'ID_DESC' + | 'TITLE_ROMAJI' + | 'TITLE_ROMAJI_DESC' + | 'TITLE_ENGLISH' + | 'TITLE_ENGLISH_DESC' + | 'TITLE_NATIVE' + | 'TITLE_NATIVE_DESC' + | 'TYPE' + | 'TYPE_DESC' + | 'FORMAT' + | 'FORMAT_DESC' + | 'START_DATE' + | 'START_DATE_DESC' + | 'END_DATE' + | 'END_DATE_DESC' + | 'SCORE' + | 'SCORE_DESC' + | 'POPULARITY' + | 'POPULARITY_DESC' + | 'TRENDING' + | 'TRENDING_DESC' + | 'EPISODES' + | 'EPISODES_DESC' + | 'DURATION' + | 'DURATION_DESC' + | 'STATUS' + | 'STATUS_DESC' + | 'CHAPTERS' + | 'CHAPTERS_DESC' + | 'VOLUMES' + | 'VOLUMES_DESC' + | 'UPDATED_AT' + | 'UPDATED_AT_DESC' + | 'SEARCH_MATCH' + | 'FAVOURITES' + | 'FAVOURITES_DESC'; + +/** The primary language of the voice actor */ +export type StaffLanguage = + /** Japanese */ + | 'JAPANESE' + /** English */ + | 'ENGLISH' + /** Korean */ + | 'KOREAN' + /** Italian */ + | 'ITALIAN' + /** Spanish */ + | 'SPANISH' + /** Portuguese */ + | 'PORTUGUESE' + /** French */ + | 'FRENCH' + /** German */ + | 'GERMAN' + /** Hebrew */ + | 'HEBREW' + /** Hungarian */ + | 'HUNGARIAN'; + +/** Staff sort enums */ +export type StaffSort = + | 'ID' + | 'ID_DESC' + | 'ROLE' + | 'ROLE_DESC' + | 'LANGUAGE' + | 'LANGUAGE_DESC' + | 'SEARCH_MATCH' + | 'FAVOURITES' + | 'FAVOURITES_DESC'; + +/** Voice actors or production staff */ +export type Staff = { + /** The id of the staff member */ + id: Scalars['Int']; + /** The names of the staff member */ + name?: Maybe; + /** The primary language of the staff member */ + language?: Maybe; + /** The staff images */ + image?: Maybe; + /** A general description of the staff member */ + description?: Maybe; + /** If the staff member is marked as favourite by the currently authenticated user */ + isFavourite: Scalars['Boolean']; + /** The url for the staff page on the AniList website */ + siteUrl?: Maybe; + /** Media where the staff member has a production role */ + staffMedia?: Maybe; + /** Characters voiced by the actor */ + characters?: Maybe; + /** Media the actor voiced characters in. (Same data as characters with media as node instead of characters) */ + characterMedia?: Maybe; + /** @deprecated No data available */ + updatedAt?: Maybe; + /** Staff member that the submission is referencing */ + staff?: Maybe; + /** Submitter for the submission */ + submitter?: Maybe; + /** Status of the submission */ + submissionStatus?: Maybe; + /** Inner details of submission status */ + submissionNotes?: Maybe; + /** The amount of user's who have favourited the staff member */ + favourites?: Maybe; + /** Notes for site moderators */ + modNotes?: Maybe; +}; + + +/** Voice actors or production staff */ +export type StaffDescriptionArgs = { + asHtml?: Maybe; +}; + + +/** Voice actors or production staff */ +export type StaffStaffMediaArgs = { + sort?: Maybe>>; + type?: Maybe; + onList?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Voice actors or production staff */ +export type StaffCharactersArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +/** Voice actors or production staff */ +export type StaffCharacterMediaArgs = { + sort?: Maybe>>; + onList?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + +/** The names of the staff member */ +export type StaffName = { + /** The person's given name */ + first?: Maybe; + /** The person's surname */ + last?: Maybe; + /** The person's full name */ + full?: Maybe; + /** The person's full name in their native language */ + native?: Maybe; + /** Other names the staff member might be referred to as (pen names) */ + alternative?: Maybe>>; +}; + +export type StaffImage = { + /** The person's image of media at its largest size */ + large?: Maybe; + /** The person's image of media at medium size */ + medium?: Maybe; +}; + +export type StaffConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Staff connection edge */ +export type StaffEdge = { + node?: Maybe; + /** The id of the connection */ + id?: Maybe; + /** The role of the staff member in the production of the media */ + role?: Maybe; + /** The order the staff should be displayed from the users favourites */ + favouriteOrder?: Maybe; +}; + +/** Studio sort enums */ +export type StudioSort = + | 'ID' + | 'ID_DESC' + | 'NAME' + | 'NAME_DESC' + | 'SEARCH_MATCH' + | 'FAVOURITES' + | 'FAVOURITES_DESC'; + +export type StudioConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Studio connection edge */ +export type StudioEdge = { + node?: Maybe; + /** The id of the connection */ + id?: Maybe; + /** If the studio is the main animation studio of the anime */ + isMain: Scalars['Boolean']; + /** The order the character should be displayed from the users favourites */ + favouriteOrder?: Maybe; +}; + +/** Animation or production company */ +export type Studio = { + /** The id of the studio */ + id: Scalars['Int']; + /** The name of the studio */ + name: Scalars['String']; + /** If the studio is an animation studio or a different kind of company */ + isAnimationStudio: Scalars['Boolean']; + /** The media the studio has worked on */ + media?: Maybe; + /** The url for the studio page on the AniList website */ + siteUrl?: Maybe; + /** If the studio is marked as favourite by the currently authenticated user */ + isFavourite: Scalars['Boolean']; + /** The amount of user's who have favourited the studio */ + favourites?: Maybe; +}; + + +/** Animation or production company */ +export type StudioMediaArgs = { + sort?: Maybe>>; + isMain?: Maybe; + onList?: Maybe; + page?: Maybe; + perPage?: Maybe; +}; + +/** Media Airing Schedule */ +export type AiringSchedule = { + /** The id of the airing schedule item */ + id: Scalars['Int']; + /** The time the episode airs at */ + airingAt: Scalars['Int']; + /** Seconds until episode starts airing */ + timeUntilAiring: Scalars['Int']; + /** The airing episode number */ + episode: Scalars['Int']; + /** The associate media id of the airing episode */ + mediaId: Scalars['Int']; + /** The associate media of the airing episode */ + media?: Maybe; +}; + +export type AiringScheduleConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** AiringSchedule connection edge */ +export type AiringScheduleEdge = { + node?: Maybe; + /** The id of the connection */ + id?: Maybe; +}; + +/** Media trend sort enums */ +export type MediaTrendSort = + | 'ID' + | 'ID_DESC' + | 'MEDIA_ID' + | 'MEDIA_ID_DESC' + | 'DATE' + | 'DATE_DESC' + | 'SCORE' + | 'SCORE_DESC' + | 'POPULARITY' + | 'POPULARITY_DESC' + | 'TRENDING' + | 'TRENDING_DESC' + | 'EPISODE' + | 'EPISODE_DESC'; + +export type MediaTrendConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Media trend connection edge */ +export type MediaTrendEdge = { + node?: Maybe; +}; + +/** Daily media statistics */ +export type MediaTrend = { + /** The id of the tag */ + mediaId: Scalars['Int']; + /** The day the data was recorded (timestamp) */ + date: Scalars['Int']; + /** The amount of media activity on the day */ + trending: Scalars['Int']; + /** A weighted average score of all the user's scores of the media */ + averageScore?: Maybe; + /** The number of users with the media on their list */ + popularity?: Maybe; + /** The number of users with watching/reading the media */ + inProgress?: Maybe; + /** If the media was being released at this time */ + releasing: Scalars['Boolean']; + /** The episode number of the anime released on this day */ + episode?: Maybe; + /** The related media */ + media?: Maybe; +}; + +/** An external link to another site related to the media */ +export type MediaExternalLink = { + /** The id of the external link */ + id: Scalars['Int']; + /** The url of the external link */ + url: Scalars['String']; + /** The site location of the external link */ + site: Scalars['String']; +}; + +/** Data and links to legal streaming episodes on external sites */ +export type MediaStreamingEpisode = { + /** Title of the episode */ + title?: Maybe; + /** Url of episode image thumbnail */ + thumbnail?: Maybe; + /** The url of the episode */ + url?: Maybe; + /** The site location of the streaming episodes */ + site?: Maybe; +}; + +/** The ranking of a media in a particular time span and format compared to other media */ +export type MediaRank = { + /** The id of the rank */ + id: Scalars['Int']; + /** The numerical rank of the media */ + rank: Scalars['Int']; + /** The type of ranking */ + type: MediaRankType; + /** The format the media is ranked within */ + format: MediaFormat; + /** The year the media is ranked within */ + year?: Maybe; + /** The season the media is ranked within */ + season?: Maybe; + /** If the ranking is based on all time instead of a season/year */ + allTime?: Maybe; + /** String that gives context to the ranking type and time span */ + context: Scalars['String']; +}; + +/** The type of ranking */ +export type MediaRankType = + /** Ranking is based on the media's ratings/score */ + | 'RATED' + /** Ranking is based on the media's popularity */ + | 'POPULAR'; + +/** List of anime or manga */ +export type MediaList = { + /** The id of the list entry */ + id: Scalars['Int']; + /** The id of the user owner of the list entry */ + userId: Scalars['Int']; + /** The id of the media */ + mediaId: Scalars['Int']; + /** The watching/reading status */ + status?: Maybe; + /** The score of the entry */ + score?: Maybe; + /** The amount of episodes/chapters consumed by the user */ + progress?: Maybe; + /** The amount of volumes read by the user */ + progressVolumes?: Maybe; + /** The amount of times the user has rewatched/read the media */ + repeat?: Maybe; + /** Priority of planning */ + priority?: Maybe; + /** If the entry should only be visible to authenticated user */ + private?: Maybe; + /** Text notes */ + notes?: Maybe; + /** If the entry shown be hidden from non-custom lists */ + hiddenFromStatusLists?: Maybe; + /** Map of booleans for which custom lists the entry are in */ + customLists?: Maybe; + /** Map of advanced scores with name keys */ + advancedScores?: Maybe; + /** When the entry was started by the user */ + startedAt?: Maybe; + /** When the entry was completed by the user */ + completedAt?: Maybe; + /** When the entry data was last updated */ + updatedAt?: Maybe; + /** When the entry data was created */ + createdAt?: Maybe; + media?: Maybe; + user?: Maybe; +}; + + +/** List of anime or manga */ +export type MediaListScoreArgs = { + format?: Maybe; +}; + + +/** List of anime or manga */ +export type MediaListCustomListsArgs = { + asArray?: Maybe; +}; + +/** Media list watching/reading status enum. */ +export type MediaListStatus = + /** Currently watching/reading */ + | 'CURRENT' + /** Planning to watch/read */ + | 'PLANNING' + /** Finished watching/reading */ + | 'COMPLETED' + /** Stopped watching/reading before completing */ + | 'DROPPED' + /** Paused watching/reading */ + | 'PAUSED' + /** Re-watching/reading */ + | 'REPEATING'; + +/** Review sort enums */ +export type ReviewSort = + | 'ID' + | 'ID_DESC' + | 'SCORE' + | 'SCORE_DESC' + | 'RATING' + | 'RATING_DESC' + | 'CREATED_AT' + | 'CREATED_AT_DESC' + | 'UPDATED_AT' + | 'UPDATED_AT_DESC'; + +export type ReviewConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Review connection edge */ +export type ReviewEdge = { + node?: Maybe; +}; + +/** A Review that features in an anime or manga */ +export type Review = { + /** The id of the review */ + id: Scalars['Int']; + /** The id of the review's creator */ + userId: Scalars['Int']; + /** The id of the review's media */ + mediaId: Scalars['Int']; + /** For which type of media the review is for */ + mediaType?: Maybe; + /** A short summary of the review */ + summary?: Maybe; + /** The main review body text */ + body?: Maybe; + /** The total user rating of the review */ + rating?: Maybe; + /** The amount of user ratings of the review */ + ratingAmount?: Maybe; + /** The rating of the review by currently authenticated user */ + userRating?: Maybe; + /** The review score of the media */ + score?: Maybe; + /** If the review is not yet publicly published and is only viewable by creator */ + private?: Maybe; + /** The url for the review page on the AniList website */ + siteUrl?: Maybe; + /** The time of the thread creation */ + createdAt: Scalars['Int']; + /** The time of the thread last update */ + updatedAt: Scalars['Int']; + /** The creator of the review */ + user?: Maybe; + /** The media the review is of */ + media?: Maybe; +}; + + +/** A Review that features in an anime or manga */ +export type ReviewBodyArgs = { + asHtml?: Maybe; +}; + +/** Review rating enums */ +export type ReviewRating = + | 'NO_VOTE' + | 'UP_VOTE' + | 'DOWN_VOTE'; + +/** Recommendation sort enums */ +export type RecommendationSort = + | 'ID' + | 'ID_DESC' + | 'RATING' + | 'RATING_DESC'; + +export type RecommendationConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Recommendation connection edge */ +export type RecommendationEdge = { + node?: Maybe; +}; + +/** Media recommendation */ +export type Recommendation = { + /** The id of the recommendation */ + id: Scalars['Int']; + /** Users rating of the recommendation */ + rating?: Maybe; + /** The rating of the recommendation by currently authenticated user */ + userRating?: Maybe; + /** The media the recommendation is from */ + media?: Maybe; + /** The recommended media */ + mediaRecommendation?: Maybe; + /** The user that first created the recommendation */ + user?: Maybe; +}; + +/** Recommendation rating enums */ +export type RecommendationRating = + | 'NO_RATING' + | 'RATE_UP' + | 'RATE_DOWN'; + +/** A media's statistics */ +export type MediaStats = { + scoreDistribution?: Maybe>>; + statusDistribution?: Maybe>>; + /** @deprecated Replaced by MediaTrends */ + airingProgression?: Maybe>>; +}; + +/** A user's list score distribution. */ +export type ScoreDistribution = { + score?: Maybe; + /** The amount of list entries with this score */ + amount?: Maybe; +}; + +/** The distribution of the watching/reading status of media or a user's list */ +export type StatusDistribution = { + /** The day the activity took place (Unix timestamp) */ + status?: Maybe; + /** The amount of entries with this status */ + amount?: Maybe; +}; + +/** Score & Watcher stats for airing anime by episode and mid-week */ +export type AiringProgression = { + /** The episode the stats were recorded at. .5 is the mid point between 2 episodes airing dates. */ + episode?: Maybe; + /** The average score for the media */ + score?: Maybe; + /** The amount of users watching the anime */ + watching?: Maybe; +}; + +/** Type of relation media has to its parent. */ +export type MediaRelation = + /** An adaption of this media into a different format */ + | 'ADAPTATION' + /** Released before the relation */ + | 'PREQUEL' + /** Released after the relation */ + | 'SEQUEL' + /** The media a side story is from */ + | 'PARENT' + /** A side story of the parent media */ + | 'SIDE_STORY' + /** Shares at least 1 character */ + | 'CHARACTER' + /** A shortened and summarized version */ + | 'SUMMARY' + /** An alternative version of the same media */ + | 'ALTERNATIVE' + /** An alternative version of the media with a different primary focus */ + | 'SPIN_OFF' + /** Other */ + | 'OTHER' + /** Version 2 only. The source material the media was adapted from */ + | 'SOURCE' + /** Version 2 only. */ + | 'COMPILATION' + /** Version 2 only. */ + | 'CONTAINS'; + +export type UserStatisticTypes = { + anime?: Maybe; + manga?: Maybe; +}; + +export type UserStatistics = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + standardDeviation: Scalars['Float']; + minutesWatched: Scalars['Int']; + episodesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + volumesRead: Scalars['Int']; + formats?: Maybe>>; + statuses?: Maybe>>; + scores?: Maybe>>; + lengths?: Maybe>>; + releaseYears?: Maybe>>; + startYears?: Maybe>>; + genres?: Maybe>>; + tags?: Maybe>>; + countries?: Maybe>>; + voiceActors?: Maybe>>; + staff?: Maybe>>; + studios?: Maybe>>; +}; + + +export type UserStatisticsFormatsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsStatusesArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsScoresArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsLengthsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsReleaseYearsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsStartYearsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsGenresArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsTagsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsCountriesArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsVoiceActorsArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsStaffArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + + +export type UserStatisticsStudiosArgs = { + limit?: Maybe; + sort?: Maybe>>; +}; + +/** User statistics sort enum */ +export type UserStatisticsSort = + | 'ID' + | 'ID_DESC' + | 'COUNT' + | 'COUNT_DESC' + | 'PROGRESS' + | 'PROGRESS_DESC' + | 'MEAN_SCORE' + | 'MEAN_SCORE_DESC'; + +export type UserFormatStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + format?: Maybe; +}; + +export type UserStatusStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + status?: Maybe; +}; + +export type UserScoreStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + score?: Maybe; +}; + +export type UserLengthStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + length?: Maybe; +}; + +export type UserReleaseYearStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + releaseYear?: Maybe; +}; + +export type UserStartYearStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + startYear?: Maybe; +}; + +export type UserGenreStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + genre?: Maybe; +}; + +export type UserTagStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + tag?: Maybe; +}; + +export type UserCountryStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + country?: Maybe; +}; + +export type UserVoiceActorStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + voiceActor?: Maybe; + characterIds: Array>; +}; + +export type UserStaffStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + staff?: Maybe; +}; + +export type UserStudioStatistic = { + count: Scalars['Int']; + meanScore: Scalars['Float']; + minutesWatched: Scalars['Int']; + chaptersRead: Scalars['Int']; + mediaIds: Array>; + studio?: Maybe; +}; + +/** A user's statistics */ +export type UserStats = { + /** The amount of anime the user has watched in minutes */ + watchedTime?: Maybe; + /** The amount of manga chapters the user has read */ + chaptersRead?: Maybe; + activityHistory?: Maybe>>; + animeStatusDistribution?: Maybe>>; + mangaStatusDistribution?: Maybe>>; + animeScoreDistribution?: Maybe>>; + mangaScoreDistribution?: Maybe>>; + animeListScores?: Maybe; + mangaListScores?: Maybe; + favouredGenresOverview?: Maybe>>; + favouredGenres?: Maybe>>; + favouredTags?: Maybe>>; + favouredActors?: Maybe>>; + favouredStaff?: Maybe>>; + favouredStudios?: Maybe>>; + favouredYears?: Maybe>>; + favouredFormats?: Maybe>>; +}; + +/** A user's activity history stats. */ +export type UserActivityHistory = { + /** The day the activity took place (Unix timestamp) */ + date?: Maybe; + /** The amount of activity on the day */ + amount?: Maybe; + /** The level of activity represented on a 1-10 scale */ + level?: Maybe; +}; + +/** User's list score statistics */ +export type ListScoreStats = { + meanScore?: Maybe; + standardDeviation?: Maybe; +}; + +/** User's genre statistics */ +export type GenreStats = { + genre?: Maybe; + amount?: Maybe; + meanScore?: Maybe; + /** The amount of time in minutes the genre has been watched by the user */ + timeWatched?: Maybe; +}; + +/** User's tag statistics */ +export type TagStats = { + tag?: Maybe; + amount?: Maybe; + meanScore?: Maybe; + /** The amount of time in minutes the tag has been watched by the user */ + timeWatched?: Maybe; +}; + +/** User's staff statistics */ +export type StaffStats = { + staff?: Maybe; + amount?: Maybe; + meanScore?: Maybe; + /** The amount of time in minutes the staff member has been watched by the user */ + timeWatched?: Maybe; +}; + +/** User's studio statistics */ +export type StudioStats = { + studio?: Maybe; + amount?: Maybe; + meanScore?: Maybe; + /** The amount of time in minutes the studio's works have been watched by the user */ + timeWatched?: Maybe; +}; + +/** User's year statistics */ +export type YearStats = { + year?: Maybe; + amount?: Maybe; + meanScore?: Maybe; +}; + +/** User's format statistics */ +export type FormatStats = { + format?: Maybe; + amount?: Maybe; +}; + + +/** Media list sort enums */ +export type MediaListSort = + | 'MEDIA_ID' + | 'MEDIA_ID_DESC' + | 'SCORE' + | 'SCORE_DESC' + | 'STATUS' + | 'STATUS_DESC' + | 'PROGRESS' + | 'PROGRESS_DESC' + | 'PROGRESS_VOLUMES' + | 'PROGRESS_VOLUMES_DESC' + | 'REPEAT' + | 'REPEAT_DESC' + | 'PRIORITY' + | 'PRIORITY_DESC' + | 'STARTED_ON' + | 'STARTED_ON_DESC' + | 'FINISHED_ON' + | 'FINISHED_ON_DESC' + | 'ADDED_TIME' + | 'ADDED_TIME_DESC' + | 'UPDATED_TIME' + | 'UPDATED_TIME_DESC' + | 'MEDIA_TITLE_ROMAJI' + | 'MEDIA_TITLE_ROMAJI_DESC' + | 'MEDIA_TITLE_ENGLISH' + | 'MEDIA_TITLE_ENGLISH_DESC' + | 'MEDIA_TITLE_NATIVE' + | 'MEDIA_TITLE_NATIVE_DESC' + | 'MEDIA_POPULARITY' + | 'MEDIA_POPULARITY_DESC'; + +/** Airing schedule sort enums */ +export type AiringSort = + | 'ID' + | 'ID_DESC' + | 'MEDIA_ID' + | 'MEDIA_ID_DESC' + | 'TIME' + | 'TIME_DESC' + | 'EPISODE' + | 'EPISODE_DESC'; + +/** Notification union type */ +export type NotificationUnion = AiringNotification | FollowingNotification | ActivityMessageNotification | ActivityMentionNotification | ActivityReplyNotification | ActivityReplySubscribedNotification | ActivityLikeNotification | ActivityReplyLikeNotification | ThreadCommentMentionNotification | ThreadCommentReplyNotification | ThreadCommentSubscribedNotification | ThreadCommentLikeNotification | ThreadLikeNotification | RelatedMediaAdditionNotification; + +/** Notification for when an episode of anime airs */ +export type AiringNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the aired anime */ + animeId: Scalars['Int']; + /** The episode number that just aired */ + episode: Scalars['Int']; + /** The notification context text */ + contexts?: Maybe>>; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The associated media of the airing schedule */ + media?: Maybe; +}; + +/** Notification for when the authenticated user is followed by another user */ +export type FollowingNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who followed the authenticated user */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + user?: Maybe; +}; + +/** Notification for when a user is send an activity message */ +export type ActivityMessageNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The if of the user who send the message */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity message */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The message activity */ + message?: Maybe; + /** The user who sent the message */ + user?: Maybe; +}; + +/** User message activity */ +export type MessageActivity = { + /** The id of the activity */ + id: Scalars['Int']; + /** The user id of the activity's recipient */ + recipientId?: Maybe; + /** The user id of the activity's sender */ + messengerId?: Maybe; + /** The type of the activity */ + type?: Maybe; + /** The number of activity replies */ + replyCount: Scalars['Int']; + /** The message text (Markdown) */ + message?: Maybe; + /** If the activity is locked and can receive replies */ + isLocked?: Maybe; + /** If the currently authenticated user is subscribed to the activity */ + isSubscribed?: Maybe; + /** The amount of likes the activity has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the activity */ + isLiked?: Maybe; + /** If the message is private and only viewable to the sender and recipients */ + isPrivate?: Maybe; + /** The url for the activity page on the AniList website */ + siteUrl?: Maybe; + /** The time the activity was created at */ + createdAt: Scalars['Int']; + /** The user who the activity message was sent to */ + recipient?: Maybe; + /** The user who sent the activity message */ + messenger?: Maybe; + /** The written replies to the activity */ + replies?: Maybe>>; + /** The users who liked the activity */ + likes?: Maybe>>; +}; + + +/** User message activity */ +export type MessageActivityMessageArgs = { + asHtml?: Maybe; +}; + +/** Activity type enum. */ +export type ActivityType = + /** A text activity */ + | 'TEXT' + /** A anime list update activity */ + | 'ANIME_LIST' + /** A manga list update activity */ + | 'MANGA_LIST' + /** A text message activity sent to another user */ + | 'MESSAGE' + /** Anime & Manga list update, only used in query arguments */ + | 'MEDIA_LIST'; + +/** Replay to an activity item */ +export type ActivityReply = { + /** The id of the reply */ + id: Scalars['Int']; + /** The id of the replies creator */ + userId?: Maybe; + /** The id of the parent activity */ + activityId?: Maybe; + /** The reply text */ + text?: Maybe; + /** The amount of likes the reply has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the reply */ + isLiked?: Maybe; + /** The time the reply was created at */ + createdAt: Scalars['Int']; + /** The user who created reply */ + user?: Maybe; + /** The users who liked the reply */ + likes?: Maybe>>; +}; + + +/** Replay to an activity item */ +export type ActivityReplyTextArgs = { + asHtml?: Maybe; +}; + +/** Notification for when authenticated user is @ mentioned in activity or reply */ +export type ActivityMentionNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who mentioned the authenticated user */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity where mentioned */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + activity?: Maybe; + /** The user who mentioned the authenticated user */ + user?: Maybe; +}; + +/** Activity union type */ +export type ActivityUnion = TextActivity | ListActivity | MessageActivity; + +/** User text activity */ +export type TextActivity = { + /** The id of the activity */ + id: Scalars['Int']; + /** The user id of the activity's creator */ + userId?: Maybe; + /** The type of activity */ + type?: Maybe; + /** The number of activity replies */ + replyCount: Scalars['Int']; + /** The status text (Markdown) */ + text?: Maybe; + /** The url for the activity page on the AniList website */ + siteUrl?: Maybe; + /** If the activity is locked and can receive replies */ + isLocked?: Maybe; + /** If the currently authenticated user is subscribed to the activity */ + isSubscribed?: Maybe; + /** The amount of likes the activity has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the activity */ + isLiked?: Maybe; + /** The time the activity was created at */ + createdAt: Scalars['Int']; + /** The user who created the activity */ + user?: Maybe; + /** The written replies to the activity */ + replies?: Maybe>>; + /** The users who liked the activity */ + likes?: Maybe>>; +}; + + +/** User text activity */ +export type TextActivityTextArgs = { + asHtml?: Maybe; +}; + +/** User list activity (anime & manga updates) */ +export type ListActivity = { + /** The id of the activity */ + id: Scalars['Int']; + /** The user id of the activity's creator */ + userId?: Maybe; + /** The type of activity */ + type?: Maybe; + /** The number of activity replies */ + replyCount: Scalars['Int']; + /** The list item's textual status */ + status?: Maybe; + /** The list progress made */ + progress?: Maybe; + /** If the activity is locked and can receive replies */ + isLocked?: Maybe; + /** If the currently authenticated user is subscribed to the activity */ + isSubscribed?: Maybe; + /** The amount of likes the activity has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the activity */ + isLiked?: Maybe; + /** The url for the activity page on the AniList website */ + siteUrl?: Maybe; + /** The time the activity was created at */ + createdAt: Scalars['Int']; + /** The owner of the activity */ + user?: Maybe; + /** The associated media to the activity update */ + media?: Maybe; + /** The written replies to the activity */ + replies?: Maybe>>; + /** The users who liked the activity */ + likes?: Maybe>>; +}; + +/** Notification for when a user replies to the authenticated users activity */ +export type ActivityReplyNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who replied to the activity */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity which was replied too */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + activity?: Maybe; + /** The user who replied to the activity */ + user?: Maybe; +}; + +/** Notification for when a user replies to activity the authenticated user has replied to */ +export type ActivityReplySubscribedNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who replied to the activity */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity which was replied too */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + activity?: Maybe; + /** The user who replied to the activity */ + user?: Maybe; +}; + +/** Notification for when a activity is liked */ +export type ActivityLikeNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who liked to the activity */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity which was liked */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + activity?: Maybe; + /** The user who liked the activity */ + user?: Maybe; +}; + +/** Notification for when a activity reply is liked */ +export type ActivityReplyLikeNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who liked to the activity reply */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity where the reply which was liked */ + activityId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The liked activity */ + activity?: Maybe; + /** The user who liked the activity reply */ + user?: Maybe; +}; + +/** Notification for when authenticated user is @ mentioned in a forum thread comment */ +export type ThreadCommentMentionNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who mentioned the authenticated user */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the comment where mentioned */ + commentId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The thread that the relevant comment belongs to */ + thread?: Maybe; + /** The thread comment that included the @ mention */ + comment?: Maybe; + /** The user who mentioned the authenticated user */ + user?: Maybe; +}; + +/** Forum Thread */ +export type Thread = { + /** The id of the thread */ + id: Scalars['Int']; + /** The title of the thread */ + title?: Maybe; + /** The text body of the thread (Markdown) */ + body?: Maybe; + /** The id of the thread owner user */ + userId: Scalars['Int']; + /** The id of the user who most recently commented on the thread */ + replyUserId?: Maybe; + /** The id of the most recent comment on the thread */ + replyCommentId?: Maybe; + /** The number of comments on the thread */ + replyCount?: Maybe; + /** The number of times users have viewed the thread */ + viewCount?: Maybe; + /** If the thread is locked and can receive comments */ + isLocked?: Maybe; + /** If the thread is stickied and should be displayed at the top of the page */ + isSticky?: Maybe; + /** If the currently authenticated user is subscribed to the thread */ + isSubscribed?: Maybe; + /** The amount of likes the thread has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the thread */ + isLiked?: Maybe; + /** The time of the last reply */ + repliedAt?: Maybe; + /** The time of the thread creation */ + createdAt: Scalars['Int']; + /** The time of the thread last update */ + updatedAt: Scalars['Int']; + /** The owner of the thread */ + user?: Maybe; + /** The user to last reply to the thread */ + replyUser?: Maybe; + /** The users who liked the thread */ + likes?: Maybe>>; + /** The url for the thread page on the AniList website */ + siteUrl?: Maybe; + /** The categories of the thread */ + categories?: Maybe>>; + /** The media categories of the thread */ + mediaCategories?: Maybe>>; +}; + + +/** Forum Thread */ +export type ThreadBodyArgs = { + asHtml?: Maybe; +}; + +/** A forum thread category */ +export type ThreadCategory = { + /** The id of the category */ + id: Scalars['Int']; + /** The name of the category */ + name: Scalars['String']; +}; + +/** Forum Thread Comment */ +export type ThreadComment = { + /** The id of the comment */ + id: Scalars['Int']; + /** The user id of the comment's owner */ + userId?: Maybe; + /** The id of thread the comment belongs to */ + threadId?: Maybe; + /** The text content of the comment (Markdown) */ + comment?: Maybe; + /** The amount of likes the comment has */ + likeCount: Scalars['Int']; + /** If the currently authenticated user liked the comment */ + isLiked?: Maybe; + /** The url for the comment page on the AniList website */ + siteUrl?: Maybe; + /** The time of the comments creation */ + createdAt: Scalars['Int']; + /** The time of the comments last update */ + updatedAt: Scalars['Int']; + /** The thread the comment belongs to */ + thread?: Maybe; + /** The user who created the comment */ + user?: Maybe; + /** The users who liked the comment */ + likes?: Maybe>>; + /** The comment's child reply comments */ + childComments?: Maybe; +}; + + +/** Forum Thread Comment */ +export type ThreadCommentCommentArgs = { + asHtml?: Maybe; +}; + +/** Notification for when a user replies to your forum thread comment */ +export type ThreadCommentReplyNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who create the comment reply */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the reply comment */ + commentId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The thread that the relevant comment belongs to */ + thread?: Maybe; + /** The reply thread comment */ + comment?: Maybe; + /** The user who replied to the activity */ + user?: Maybe; +}; + +/** Notification for when a user replies to a subscribed forum thread */ +export type ThreadCommentSubscribedNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who commented on the thread */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the new comment in the subscribed thread */ + commentId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The thread that the relevant comment belongs to */ + thread?: Maybe; + /** The reply thread comment */ + comment?: Maybe; + /** The user who replied to the subscribed thread */ + user?: Maybe; +}; + +/** Notification for when a thread comment is liked */ +export type ThreadCommentLikeNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who liked to the activity */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the activity which was liked */ + commentId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The thread that the relevant comment belongs to */ + thread?: Maybe; + /** The thread comment that was liked */ + comment?: Maybe; + /** The user who liked the activity */ + user?: Maybe; +}; + +/** Notification for when a thread is liked */ +export type ThreadLikeNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The id of the user who liked to the activity */ + userId: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the thread which was liked */ + threadId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The thread that the relevant comment belongs to */ + thread?: Maybe; + /** The liked thread comment */ + comment?: Maybe; + /** The user who liked the activity */ + user?: Maybe; +}; + +/** Notification for when new media is added to the site */ +export type RelatedMediaAdditionNotification = { + /** The id of the Notification */ + id: Scalars['Int']; + /** The type of notification */ + type?: Maybe; + /** The id of the new media */ + mediaId: Scalars['Int']; + /** The notification context text */ + context?: Maybe; + /** The time the notification was created at */ + createdAt?: Maybe; + /** The associated media of the airing schedule */ + media?: Maybe; +}; + +/** Activity sort enums */ +export type ActivitySort = + | 'ID' + | 'ID_DESC'; + +/** Thread sort enums */ +export type ThreadSort = + | 'ID' + | 'ID_DESC' + | 'TITLE' + | 'TITLE_DESC' + | 'CREATED_AT' + | 'CREATED_AT_DESC' + | 'UPDATED_AT' + | 'UPDATED_AT_DESC' + | 'REPLIED_AT' + | 'REPLIED_AT_DESC' + | 'REPLY_COUNT' + | 'REPLY_COUNT_DESC' + | 'VIEW_COUNT' + | 'VIEW_COUNT_DESC' + | 'IS_STICKY' + | 'SEARCH_MATCH'; + +/** Thread comments sort enums */ +export type ThreadCommentSort = + | 'ID' + | 'ID_DESC'; + +/** Types that can be liked */ +export type LikeableType = + | 'THREAD' + | 'THREAD_COMMENT' + | 'ACTIVITY' + | 'ACTIVITY_REPLY'; + +/** List of anime or manga */ +export type MediaListCollection = { + /** Grouped media list entries */ + lists?: Maybe>>; + /** The owner of the list */ + user?: Maybe; + /** If there is another chunk */ + hasNextChunk?: Maybe; + /** + * A map of media list entry arrays grouped by status + * @deprecated Not GraphQL spec compliant, use lists field instead. + */ + statusLists?: Maybe>>>>; + /** + * A map of media list entry arrays grouped by custom lists + * @deprecated Not GraphQL spec compliant, use lists field instead. + */ + customLists?: Maybe>>>>; +}; + + +/** List of anime or manga */ +export type MediaListCollectionStatusListsArgs = { + asArray?: Maybe; +}; + + +/** List of anime or manga */ +export type MediaListCollectionCustomListsArgs = { + asArray?: Maybe; +}; + +/** List group of anime or manga entries */ +export type MediaListGroup = { + /** Media list entries */ + entries?: Maybe>>; + name?: Maybe; + isCustomList?: Maybe; + isSplitCompletedList?: Maybe; + status?: Maybe; +}; + +/** Provides the parsed markdown as html */ +export type ParsedMarkdown = { + /** The parsed markdown as html */ + html?: Maybe; +}; + +export type AniChartUser = { + user?: Maybe; + settings?: Maybe; + highlights?: Maybe; +}; + +export type SiteStatistics = { + users?: Maybe; + anime?: Maybe; + manga?: Maybe; + characters?: Maybe; + staff?: Maybe; + studios?: Maybe; + reviews?: Maybe; +}; + + +export type SiteStatisticsUsersArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsAnimeArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsMangaArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsCharactersArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsStaffArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsStudiosArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + + +export type SiteStatisticsReviewsArgs = { + sort?: Maybe>>; + page?: Maybe; + perPage?: Maybe; +}; + +/** Site trend sort enums */ +export type SiteTrendSort = + | 'DATE' + | 'DATE_DESC' + | 'COUNT' + | 'COUNT_DESC' + | 'CHANGE' + | 'CHANGE_DESC'; + +export type SiteTrendConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** Site trend connection edge */ +export type SiteTrendEdge = { + node?: Maybe; +}; + +/** Daily site statistics */ +export type SiteTrend = { + /** The day the data was recorded (timestamp) */ + date: Scalars['Int']; + count: Scalars['Int']; + /** The change from yesterday */ + change: Scalars['Int']; +}; + +export type Mutation = { + UpdateUser?: Maybe; + /** Create or update a media list entry */ + SaveMediaListEntry?: Maybe; + /** Update multiple media list entries to the same values */ + UpdateMediaListEntries?: Maybe>>; + /** Delete a media list entry */ + DeleteMediaListEntry?: Maybe; + /** Delete a custom list and remove the list entries from it */ + DeleteCustomList?: Maybe; + /** Create or update text activity for the currently authenticated user */ + SaveTextActivity?: Maybe; + /** Create or update message activity for the currently authenticated user */ + SaveMessageActivity?: Maybe; + /** Update list activity (Mod Only) */ + SaveListActivity?: Maybe; + /** Delete an activity item of the authenticated users */ + DeleteActivity?: Maybe; + /** Toggle the subscription of an activity item */ + ToggleActivitySubscription?: Maybe; + /** Create or update an activity reply */ + SaveActivityReply?: Maybe; + /** Delete an activity reply of the authenticated users */ + DeleteActivityReply?: Maybe; + /** + * Add or remove a like from a likeable type. + * Returns all the users who liked the same model + */ + ToggleLike?: Maybe>>; + /** Add or remove a like from a likeable type. */ + ToggleLikeV2?: Maybe; + /** Toggle the un/following of a user */ + ToggleFollow?: Maybe; + /** Favourite or unfavourite an anime, manga, character, staff member, or studio */ + ToggleFavourite?: Maybe; + /** Update the order favourites are displayed in */ + UpdateFavouriteOrder?: Maybe; + /** Create or update a review */ + SaveReview?: Maybe; + /** Delete a review */ + DeleteReview?: Maybe; + /** Rate a review */ + RateReview?: Maybe; + /** Recommendation a media */ + SaveRecommendation?: Maybe; + /** Create or update a forum thread */ + SaveThread?: Maybe; + /** Delete a thread */ + DeleteThread?: Maybe; + /** Toggle the subscription of a forum thread */ + ToggleThreadSubscription?: Maybe; + /** Create or update a thread comment */ + SaveThreadComment?: Maybe; + /** Delete a thread comment */ + DeleteThreadComment?: Maybe; + UpdateAniChartSettings?: Maybe; + UpdateAniChartHighlights?: Maybe; +}; + + +export type MutationUpdateUserArgs = { + about?: Maybe; + titleLanguage?: Maybe; + displayAdultContent?: Maybe; + airingNotifications?: Maybe; + scoreFormat?: Maybe; + rowOrder?: Maybe; + profileColor?: Maybe; + donatorBadge?: Maybe; + notificationOptions?: Maybe>>; + animeListOptions?: Maybe; + mangaListOptions?: Maybe; +}; + + +export type MutationSaveMediaListEntryArgs = { + id?: Maybe; + mediaId?: Maybe; + status?: Maybe; + score?: Maybe; + scoreRaw?: Maybe; + progress?: Maybe; + progressVolumes?: Maybe; + repeat?: Maybe; + priority?: Maybe; + private?: Maybe; + notes?: Maybe; + hiddenFromStatusLists?: Maybe; + customLists?: Maybe>>; + advancedScores?: Maybe>>; + startedAt?: Maybe; + completedAt?: Maybe; +}; + + +export type MutationUpdateMediaListEntriesArgs = { + status?: Maybe; + score?: Maybe; + scoreRaw?: Maybe; + progress?: Maybe; + progressVolumes?: Maybe; + repeat?: Maybe; + priority?: Maybe; + private?: Maybe; + notes?: Maybe; + hiddenFromStatusLists?: Maybe; + advancedScores?: Maybe>>; + startedAt?: Maybe; + completedAt?: Maybe; + ids?: Maybe>>; +}; + + +export type MutationDeleteMediaListEntryArgs = { + id?: Maybe; +}; + + +export type MutationDeleteCustomListArgs = { + customList?: Maybe; + type?: Maybe; +}; + + +export type MutationSaveTextActivityArgs = { + id?: Maybe; + text?: Maybe; + locked?: Maybe; +}; + + +export type MutationSaveMessageActivityArgs = { + id?: Maybe; + message?: Maybe; + recipientId?: Maybe; + private?: Maybe; + locked?: Maybe; + asMod?: Maybe; +}; + + +export type MutationSaveListActivityArgs = { + id?: Maybe; + locked?: Maybe; +}; + + +export type MutationDeleteActivityArgs = { + id?: Maybe; +}; + + +export type MutationToggleActivitySubscriptionArgs = { + activityId?: Maybe; + subscribe?: Maybe; +}; + + +export type MutationSaveActivityReplyArgs = { + id?: Maybe; + activityId?: Maybe; + text?: Maybe; + asMod?: Maybe; +}; + + +export type MutationDeleteActivityReplyArgs = { + id?: Maybe; +}; + + +export type MutationToggleLikeArgs = { + id?: Maybe; + type?: Maybe; +}; + + +export type MutationToggleLikeV2Args = { + id?: Maybe; + type?: Maybe; +}; + + +export type MutationToggleFollowArgs = { + userId?: Maybe; +}; + + +export type MutationToggleFavouriteArgs = { + animeId?: Maybe; + mangaId?: Maybe; + characterId?: Maybe; + staffId?: Maybe; + studioId?: Maybe; +}; + + +export type MutationUpdateFavouriteOrderArgs = { + animeIds?: Maybe>>; + mangaIds?: Maybe>>; + characterIds?: Maybe>>; + staffIds?: Maybe>>; + studioIds?: Maybe>>; + animeOrder?: Maybe>>; + mangaOrder?: Maybe>>; + characterOrder?: Maybe>>; + staffOrder?: Maybe>>; + studioOrder?: Maybe>>; +}; + + +export type MutationSaveReviewArgs = { + id?: Maybe; + mediaId?: Maybe; + body?: Maybe; + summary?: Maybe; + score?: Maybe; + private?: Maybe; +}; + + +export type MutationDeleteReviewArgs = { + id?: Maybe; +}; + + +export type MutationRateReviewArgs = { + reviewId?: Maybe; + rating?: Maybe; +}; + + +export type MutationSaveRecommendationArgs = { + mediaId?: Maybe; + mediaRecommendationId?: Maybe; + rating?: Maybe; +}; + + +export type MutationSaveThreadArgs = { + id?: Maybe; + title?: Maybe; + body?: Maybe; + categories?: Maybe>>; + mediaCategories?: Maybe>>; + sticky?: Maybe; + locked?: Maybe; +}; + + +export type MutationDeleteThreadArgs = { + id?: Maybe; +}; + + +export type MutationToggleThreadSubscriptionArgs = { + threadId?: Maybe; + subscribe?: Maybe; +}; + + +export type MutationSaveThreadCommentArgs = { + id?: Maybe; + threadId?: Maybe; + parentCommentId?: Maybe; + comment?: Maybe; +}; + + +export type MutationDeleteThreadCommentArgs = { + id?: Maybe; +}; + + +export type MutationUpdateAniChartSettingsArgs = { + titleLanguage?: Maybe; + outgoingLinkProvider?: Maybe; + theme?: Maybe; + sort?: Maybe; +}; + + +export type MutationUpdateAniChartHighlightsArgs = { + highlights?: Maybe>>; +}; + +/** Notification option input */ +export type NotificationOptionInput = { + /** The type of notification */ + type?: Maybe; + /** Whether this type of notification is enabled */ + enabled?: Maybe; +}; + +/** A user's list options for anime or manga lists */ +export type MediaListOptionsInput = { + /** The order each list should be displayed in */ + sectionOrder?: Maybe>>; + /** If the completed sections of the list should be separated by format */ + splitCompletedSectionByFormat?: Maybe; + /** The names of the user's custom lists */ + customLists?: Maybe>>; + /** The names of the user's advanced scoring sections */ + advancedScoring?: Maybe>>; + /** If advanced scoring is enabled */ + advancedScoringEnabled?: Maybe; + /** list theme */ + theme?: Maybe; +}; + +/** Date object that allows for incomplete date values (fuzzy) */ +export type FuzzyDateInput = { + /** Numeric Year (2017) */ + year?: Maybe; + /** Numeric Month (3) */ + month?: Maybe; + /** Numeric Day (24) */ + day?: Maybe; +}; + +/** Deleted data type */ +export type Deleted = { + /** If an item has been successfully deleted */ + deleted?: Maybe; +}; + +/** Likeable union type */ +export type LikeableUnion = ListActivity | TextActivity | MessageActivity | ActivityReply | Thread | ThreadComment; + +export type AniChartHighlightInput = { + mediaId?: Maybe; + highlight?: Maybe; +}; + +/** Page of data (Used for internal use only) */ +export type InternalPage = { + mediaSubmissions?: Maybe>>; + characterSubmissions?: Maybe>>; + staffSubmissions?: Maybe>>; + revisionHistory?: Maybe>>; + reports?: Maybe>>; + modActions?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; + users?: Maybe>>; + media?: Maybe>>; + characters?: Maybe>>; + staff?: Maybe>>; + studios?: Maybe>>; + mediaList?: Maybe>>; + airingSchedules?: Maybe>>; + mediaTrends?: Maybe>>; + notifications?: Maybe>>; + followers?: Maybe>>; + following?: Maybe>>; + activities?: Maybe>>; + activityReplies?: Maybe>>; + threads?: Maybe>>; + threadComments?: Maybe>>; + reviews?: Maybe>>; + recommendations?: Maybe>>; + likes?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageMediaSubmissionsArgs = { + mediaId?: Maybe; + submissionId?: Maybe; + userId?: Maybe; + status?: Maybe; + type?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageCharacterSubmissionsArgs = { + characterId?: Maybe; + userId?: Maybe; + status?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageStaffSubmissionsArgs = { + staffId?: Maybe; + userId?: Maybe; + status?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageRevisionHistoryArgs = { + userId?: Maybe; + mediaId?: Maybe; + characterId?: Maybe; + staffId?: Maybe; + studioId?: Maybe; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageModActionsArgs = { + userId?: Maybe; + modId?: Maybe; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageUsersArgs = { + id?: Maybe; + name?: Maybe; + search?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageMediaArgs = { + id?: Maybe; + idMal?: Maybe; + startDate?: Maybe; + endDate?: Maybe; + season?: Maybe; + seasonYear?: Maybe; + type?: Maybe; + format?: Maybe; + status?: Maybe; + episodes?: Maybe; + duration?: Maybe; + chapters?: Maybe; + volumes?: Maybe; + isAdult?: Maybe; + genre?: Maybe; + tag?: Maybe; + minimumTagRank?: Maybe; + tagCategory?: Maybe; + onList?: Maybe; + licensedBy?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + source?: Maybe; + countryOfOrigin?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + idMal_not?: Maybe; + idMal_in?: Maybe>>; + idMal_not_in?: Maybe>>; + startDate_greater?: Maybe; + startDate_lesser?: Maybe; + startDate_like?: Maybe; + endDate_greater?: Maybe; + endDate_lesser?: Maybe; + endDate_like?: Maybe; + format_in?: Maybe>>; + format_not?: Maybe; + format_not_in?: Maybe>>; + status_in?: Maybe>>; + status_not?: Maybe; + status_not_in?: Maybe>>; + episodes_greater?: Maybe; + episodes_lesser?: Maybe; + duration_greater?: Maybe; + duration_lesser?: Maybe; + chapters_greater?: Maybe; + chapters_lesser?: Maybe; + volumes_greater?: Maybe; + volumes_lesser?: Maybe; + genre_in?: Maybe>>; + genre_not_in?: Maybe>>; + tag_in?: Maybe>>; + tag_not_in?: Maybe>>; + tagCategory_in?: Maybe>>; + tagCategory_not_in?: Maybe>>; + licensedBy_in?: Maybe>>; + averageScore_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + popularity_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + source_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageCharactersArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageStaffArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageStudiosArgs = { + id?: Maybe; + search?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageMediaListArgs = { + id?: Maybe; + userId?: Maybe; + userName?: Maybe; + type?: Maybe; + status?: Maybe; + mediaId?: Maybe; + isFollowing?: Maybe; + notes?: Maybe; + startedAt?: Maybe; + completedAt?: Maybe; + compareWithAuthList?: Maybe; + userId_in?: Maybe>>; + status_in?: Maybe>>; + status_not_in?: Maybe>>; + status_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + notes_like?: Maybe; + startedAt_greater?: Maybe; + startedAt_lesser?: Maybe; + startedAt_like?: Maybe; + completedAt_greater?: Maybe; + completedAt_lesser?: Maybe; + completedAt_like?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageAiringSchedulesArgs = { + id?: Maybe; + mediaId?: Maybe; + episode?: Maybe; + airingAt?: Maybe; + notYetAired?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + episode_not?: Maybe; + episode_in?: Maybe>>; + episode_not_in?: Maybe>>; + episode_greater?: Maybe; + episode_lesser?: Maybe; + airingAt_greater?: Maybe; + airingAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageMediaTrendsArgs = { + mediaId?: Maybe; + date?: Maybe; + trending?: Maybe; + averageScore?: Maybe; + popularity?: Maybe; + episode?: Maybe; + releasing?: Maybe; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + date_greater?: Maybe; + date_lesser?: Maybe; + trending_greater?: Maybe; + trending_lesser?: Maybe; + trending_not?: Maybe; + averageScore_greater?: Maybe; + averageScore_lesser?: Maybe; + averageScore_not?: Maybe; + popularity_greater?: Maybe; + popularity_lesser?: Maybe; + popularity_not?: Maybe; + episode_greater?: Maybe; + episode_lesser?: Maybe; + episode_not?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageNotificationsArgs = { + type?: Maybe; + resetNotificationCount?: Maybe; + type_in?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageFollowersArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageFollowingArgs = { + userId: Scalars['Int']; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageActivitiesArgs = { + id?: Maybe; + userId?: Maybe; + messengerId?: Maybe; + mediaId?: Maybe; + type?: Maybe; + isFollowing?: Maybe; + hasReplies?: Maybe; + hasRepliesOrTypeText?: Maybe; + createdAt?: Maybe; + id_not?: Maybe; + id_in?: Maybe>>; + id_not_in?: Maybe>>; + userId_not?: Maybe; + userId_in?: Maybe>>; + userId_not_in?: Maybe>>; + messengerId_not?: Maybe; + messengerId_in?: Maybe>>; + messengerId_not_in?: Maybe>>; + mediaId_not?: Maybe; + mediaId_in?: Maybe>>; + mediaId_not_in?: Maybe>>; + type_not?: Maybe; + type_in?: Maybe>>; + type_not_in?: Maybe>>; + createdAt_greater?: Maybe; + createdAt_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageActivityRepliesArgs = { + id?: Maybe; + activityId?: Maybe; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageThreadsArgs = { + id?: Maybe; + userId?: Maybe; + replyUserId?: Maybe; + subscribed?: Maybe; + categoryId?: Maybe; + mediaCategoryId?: Maybe; + search?: Maybe; + id_in?: Maybe>>; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageThreadCommentsArgs = { + id?: Maybe; + threadId?: Maybe; + userId?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageReviewsArgs = { + id?: Maybe; + mediaId?: Maybe; + userId?: Maybe; + mediaType?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageRecommendationsArgs = { + id?: Maybe; + mediaId?: Maybe; + mediaRecommendationId?: Maybe; + userId?: Maybe; + rating?: Maybe; + onList?: Maybe; + rating_greater?: Maybe; + rating_lesser?: Maybe; + sort?: Maybe>>; +}; + + +/** Page of data (Used for internal use only) */ +export type InternalPageLikesArgs = { + likeableId?: Maybe; + type?: Maybe; +}; + +/** Submission status */ +export type SubmissionStatus = + | 'PENDING' + | 'REJECTED' + | 'PARTIALLY_ACCEPTED' + | 'ACCEPTED'; + +/** Submission sort enums */ +export type SubmissionSort = + | 'ID' + | 'ID_DESC'; + +/** Media submission */ +export type MediaSubmission = { + /** The id of the submission */ + id: Scalars['Int']; + /** User submitter of the submission */ + submitter?: Maybe; + /** Status of the submission */ + status?: Maybe; + submitterStats?: Maybe; + notes?: Maybe; + source?: Maybe; + changes?: Maybe>>; + media?: Maybe; + submission?: Maybe; + characters?: Maybe>>; + staff?: Maybe>>; + studios?: Maybe>>; + relations?: Maybe>>; + externalLinks?: Maybe>>; + createdAt?: Maybe; +}; + +/** Media submission with comparison to current data */ +export type MediaSubmissionComparison = { + submission?: Maybe; + character?: Maybe; + staff?: Maybe; + studio?: Maybe; +}; + +export type MediaSubmissionEdge = { + /** The id of the direct submission */ + id?: Maybe; + characterRole?: Maybe; + staffRole?: Maybe; + isMain?: Maybe; + character?: Maybe; + characterSubmission?: Maybe; + voiceActor?: Maybe; + voiceActorSubmission?: Maybe; + staff?: Maybe; + staffSubmission?: Maybe; + studio?: Maybe; + media?: Maybe; +}; + +/** Internal - Media characters separated */ +export type MediaCharacter = { + /** The id of the connection */ + id?: Maybe; + /** The characters role in the media */ + role?: Maybe; + /** The characters in the media voiced by the parent actor */ + character?: Maybe; + /** The voice actor of the character */ + voiceActor?: Maybe; +}; + +/** A submission for a character that features in an anime or manga */ +export type CharacterSubmission = { + /** The id of the submission */ + id: Scalars['Int']; + /** Character that the submission is referencing */ + character?: Maybe; + /** The character submission changes */ + submission?: Maybe; + /** Submitter for the submission */ + submitter?: Maybe; + /** Status of the submission */ + status?: Maybe; + /** Inner details of submission status */ + notes?: Maybe; + source?: Maybe; + createdAt?: Maybe; +}; + +/** A submission for a staff that features in an anime or manga */ +export type StaffSubmission = { + /** The id of the submission */ + id: Scalars['Int']; + /** Staff that the submission is referencing */ + staff?: Maybe; + /** The staff submission changes */ + submission?: Maybe; + /** Submitter for the submission */ + submitter?: Maybe; + /** Status of the submission */ + status?: Maybe; + /** Inner details of submission status */ + notes?: Maybe; + source?: Maybe; + createdAt?: Maybe; +}; + +/** Feed of mod edit activity */ +export type RevisionHistory = { + /** The id of the media */ + id: Scalars['Int']; + /** The action taken on the objects */ + action?: Maybe; + /** A JSON object of the fields that changed */ + changes?: Maybe; + /** The user who made the edit to the object */ + user?: Maybe; + /** The media the mod feed entry references */ + media?: Maybe; + /** The character the mod feed entry references */ + character?: Maybe; + /** The staff member the mod feed entry references */ + staff?: Maybe; + /** The studio the mod feed entry references */ + studio?: Maybe; + /** When the mod feed entry was created */ + createdAt?: Maybe; +}; + +/** Revision history actions */ +export type RevisionHistoryAction = + | 'CREATE' + | 'EDIT'; + +export type Report = { + id: Scalars['Int']; + reporter?: Maybe; + reported?: Maybe; + reason?: Maybe; + /** When the entry data was created */ + createdAt?: Maybe; +}; + +export type ModAction = { + /** The id of the action */ + id: Scalars['Int']; + user?: Maybe; + mod?: Maybe; + type?: Maybe; + objectId?: Maybe; + objectType?: Maybe; + data?: Maybe; + createdAt: Scalars['Int']; +}; + +export type ModActionType = + | 'NOTE' + | 'BAN' + | 'DELETE' + | 'EDIT' + | 'EXPIRE' + | 'REPORT' + | 'RESET' + | 'ANON'; + +/** The official titles of the media in various languages */ +export type MediaTitleInput = { + /** The romanization of the native language title */ + romaji?: Maybe; + /** The official english title */ + english?: Maybe; + /** Official title in it's native language */ + native?: Maybe; +}; + +/** An external link to another site related to the media */ +export type MediaExternalLinkInput = { + /** The id of the external link */ + id: Scalars['Int']; + /** The url of the external link */ + url: Scalars['String']; + /** The site location of the external link */ + site: Scalars['String']; +}; + +export type AiringScheduleInput = { + airingAt?: Maybe; + episode?: Maybe; + timeUntilAiring?: Maybe; +}; + +/** The names of the character */ +export type CharacterNameInput = { + /** The character's given name */ + first?: Maybe; + /** The character's surname */ + last?: Maybe; + /** The character's full name in their native language */ + native?: Maybe; + /** Other names the character might be referred by */ + alternative?: Maybe>>; +}; + +export type CharacterSubmissionConnection = { + edges?: Maybe>>; + /** The pagination information */ + pageInfo?: Maybe; +}; + +/** CharacterSubmission connection edge */ +export type CharacterSubmissionEdge = { + node?: Maybe; + /** The characters role in the media */ + role?: Maybe; + /** The voice actors of the character */ + voiceActors?: Maybe>>; + /** The submitted voice actors of the character */ + submittedVoiceActors?: Maybe>>; +}; + +/** The names of the staff member */ +export type StaffNameInput = { + /** The person's given name */ + first?: Maybe; + /** The person's surname */ + last?: Maybe; + /** The person's full name in their native language */ + native?: Maybe; + /** Other names the character might be referred by */ + alternative?: Maybe>>; +}; + +/** User data for moderators */ +export type UserModData = { + alts?: Maybe>>; + bans?: Maybe; + ip?: Maybe; + counts?: Maybe; +}; diff --git a/src/utilities.ts b/src/utilities.ts new file mode 100644 index 0000000..d505055 --- /dev/null +++ b/src/utilities.ts @@ -0,0 +1,22 @@ +import fetch from 'node-fetch'; +import Client from '.'; + +export default class Utilities { + async APIRequest(query: string, variables: object, client: Client) { + const url = 'https://graphql.anilist.co', options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + body: JSON.stringify({ query, variables }), + }; + + if (client.token) Object.assign(options.headers, { Authorization: 'Bearer ' + client.token }); + + const req = await fetch(url, options); + + const json = await req.json(); + return !json.errors ? (json.data.Character || json.data.Media || json.data.Page || json.data.User || json.data.Studio || json.data.Staff || json.data.Viewer) || json : json; + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..096b70a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "resolveJsonModule": true, + "experimentalDecorators": true, + "target": "es2016", + "module": "commonjs", + "lib": [ + "es2016", + "dom" + ], + "declaration": true, + "outDir": "./dist", + "rootDir": "./src", + "strict": true, + "esModuleInterop": true, + "emitDecoratorMetadata": true, + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..51d5078 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,64 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/node-fetch@^2.5.7": + version "2.5.7" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" + integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + +"@types/node@*": + version "14.14.20" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.20.tgz#f7974863edd21d1f8a494a73e8e2b3658615c340" + integrity sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +dotenv@^8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" + integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw== + +form-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" + integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +mime-db@1.45.0: + version "1.45.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" + integrity sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w== + +mime-types@^2.1.12: + version "2.1.28" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.28.tgz#1160c4757eab2c5363888e005273ecf79d2a0ecd" + integrity sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ== + dependencies: + mime-db "1.45.0" + +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==