fix aliases not being optional

This commit is contained in:
DrakeTDL 2023-10-21 13:31:57 -07:00
parent f7627a1caa
commit f59e4d86f6
No known key found for this signature in database
23 changed files with 480 additions and 480 deletions

View File

@ -4,37 +4,37 @@ import { User } from "./User.ts"
export const ActivityReply = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the reply */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the replies creator */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The id of the parent activity */
withActivityId(op?: { alias: string }) {
withActivityId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "activityId", level })
return this
},
/** The reply text */
withText(op?: { alias: string; args?: ActivityReplyTextArgs }) {
withText(op?: { alias?: string; args?: ActivityReplyTextArgs }) {
operation.set({ alias: op?.alias, subField: "text", level, variables: op?.args })
return this
},
/** The amount of likes the reply has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the reply */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** The time the reply was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},

View File

@ -6,62 +6,62 @@ import { User } from "./User.ts"
export const TextActivity = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the activity */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The user id of the activity's creator */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of activity */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The number of activity replies */
withReplyCount(op?: { alias: string }) {
withReplyCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyCount", level })
return this
},
/** The status text (Markdown) */
withText(op?: { alias: string; args?: TextActivityTextArgs }) {
withText(op?: { alias?: string; args?: TextActivityTextArgs }) {
operation.set({ alias: op?.alias, subField: "text", level, variables: op?.args })
return this
},
/** The url for the activity page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** If the activity is locked and can receive replies */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},
/** If the currently authenticated user is subscribed to the activity */
withIsSubscribed(op?: { alias: string }) {
withIsSubscribed(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSubscribed", level })
return this
},
/** The amount of likes the activity has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the activity */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** If the activity is pinned to the top of the users activity feed */
withIsPinned(op?: { alias: string }) {
withIsPinned(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isPinned", level })
return this
},
/** The time the activity was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -90,67 +90,67 @@ export const TextActivity = ({ operation, level }: Fields<OperationParser>) => (
export const ListActivity = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the activity */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The user id of the activity's creator */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of activity */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The number of activity replies */
withReplyCount(op?: { alias: string }) {
withReplyCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyCount", level })
return this
},
/** The list item's textual status */
withStatus(op?: { alias: string }) {
withStatus(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "status", level })
return this
},
/** The list progress made */
withProgress(op?: { alias: string }) {
withProgress(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "progress", level })
return this
},
/** If the activity is locked and can receive replies */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},
/** If the currently authenticated user is subscribed to the activity */
withIsSubscribed(op?: { alias: string }) {
withIsSubscribed(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSubscribed", level })
return this
},
/** The amount of likes the activity has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the activity */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** If the activity is pinned to the top of the users activity feed */
withIsPinned(op?: { alias: string }) {
withIsPinned(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isPinned", level })
return this
},
/** The url for the activity page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** The time the activity was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -186,67 +186,67 @@ export const ListActivity = ({ operation, level }: Fields<OperationParser>) => (
export const MessageActivity = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the activity */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The user id of the activity's recipient */
withRecipientId(op?: { alias: string }) {
withRecipientId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "recipientId", level })
return this
},
/** The user id of the activity's sender */
withMessengerId(op?: { alias: string }) {
withMessengerId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "messengerId", level })
return this
},
/** The type of the activity */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The number of activity replies */
withReplyCount(op?: { alias: string }) {
withReplyCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyCount", level })
return this
},
/** The message text (Markdown) */
withMessage(op?: { alias: string; args?: MessageActivityMessageArgs }) {
withMessage(op?: { alias?: string; args?: MessageActivityMessageArgs }) {
operation.set({ alias: op?.alias, subField: "message", level, variables: op?.args })
return this
},
/** If the activity is locked and can receive replies */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},
/** If the currently authenticated user is subscribed to the activity */
withIsSubscribed(op?: { alias: string }) {
withIsSubscribed(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSubscribed", level })
return this
},
/** The amount of likes the activity has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the activity */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** If the message is private and only viewable to the sender and recipients */
withIsPrivate(op?: { alias: string }) {
withIsPrivate(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isPrivate", level })
return this
},
/** The url for the activity page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** The time the activity was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},

View File

@ -9,7 +9,7 @@ const AiringScheduleEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The id of the connection */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
@ -36,27 +36,27 @@ export const AiringScheduleConnection = ({ operation, level }: Fields<OperationP
export const AiringSchedule = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the airing schedule item */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The time the episode airs at */
withAiringAt(op?: { alias: string }) {
withAiringAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "airingAt", level })
return this
},
/** Seconds until episode starts airing */
withTimeUntilAiring(op?: { alias: string }) {
withTimeUntilAiring(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "timeUntilAiring", level })
return this
},
/** The airing episode number */
withEpisode(op?: { alias: string }) {
withEpisode(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "episode", level })
return this
},
/** The associate media id of the airing episode */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},

View File

@ -8,11 +8,11 @@ export const AniChartUser = ({ operation, level }: Fields<OperationParser>) => (
else User({ operation, level: level + 1 }).withId()
return this
},
withSettings(op?: { alias: string }) {
withSettings(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "settings", level })
return this
},
withHighlights(op?: { alias: string }) {
withHighlights(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "highlights", level })
return this
},

View File

@ -13,37 +13,37 @@ import { AtLeastOne } from "../types/AtLeastOne.ts"
const CharacterName = ({ operation, level }: Fields<OperationParser>) => ({
/** The person's given name */
withFirst(op?: { alias: string }) {
withFirst(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "first", level })
return this
},
/** The person's middle name */
withMiddle(op?: { alias: string }) {
withMiddle(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "middle", level })
return this
},
/** The person's surname */
withLast(op?: { alias: string }) {
withLast(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "last", level })
return this
},
/** The person's first and last name */
withFull(op?: { alias: string }) {
withFull(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "full", level })
return this
},
/** The person's full name in their native language */
withNative(op?: { alias: string }) {
withNative(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "native", level })
return this
},
/** Other names the staff member might be referred to as (pen names) */
withAlternative(op?: { alias: string }) {
withAlternative(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "alternative", level })
return this
},
/** The currently authenticated users preferred name language. Default romaji for non-authenticated */
withUserPreferred(op?: { alias: string }) {
withUserPreferred(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userPreferred", level })
return this
},
@ -51,12 +51,12 @@ const CharacterName = ({ operation, level }: Fields<OperationParser>) => ({
const CharacterImage = ({ operation, level }: Fields<OperationParser>) => ({
/** The person's image of media at its largest size */
withLarge(op?: { alias: string }) {
withLarge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "large", level })
return this
},
/** The person's image of media at medium size */
withMedium(op?: { alias: string }) {
withMedium(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "medium", level })
return this
},
@ -70,17 +70,17 @@ const CharacterEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The id of the connection */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The characters role in the media */
withRole(op?: { alias: string }) {
withRole(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "role", level })
return this
},
/** Media specific character name */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
@ -125,7 +125,7 @@ const CharacterEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The order the character should be displayed from the users favourites */
withFavouriteOrder(op?: { alias: string }) {
withFavouriteOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favouriteOrder", level })
return this
},
@ -154,7 +154,7 @@ export const CharacterConnection = ({ operation, level }: Fields<OperationParser
export const Character = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the character */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
@ -173,12 +173,12 @@ export const Character = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** A general description of the character */
withDescription(op?: { alias: string; args?: CharacterDescriptionArgs }) {
withDescription(op?: { alias?: string; args?: CharacterDescriptionArgs }) {
operation.set({ alias: op?.alias, subField: "description", level, variables: op?.args })
return this
},
/** The character's gender. Usually Male, Female, or Non-binary but can be any string. */
withGender(op?: { alias: string }) {
withGender(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "gender", level })
return this
},
@ -190,27 +190,27 @@ export const Character = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The character's age. Note this is a string, not an int, it may contain further text and additional ages. */
withAge(op?: { alias: string }) {
withAge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "age", level })
return this
},
/** The characters blood type */
withBloodType(op?: { alias: string }) {
withBloodType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "bloodType", level })
return this
},
/** If the character is marked as favourite by the currently authenticated user */
withIsFavourite(op?: { alias: string }) {
withIsFavourite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavourite", level })
return this
},
/** If the character is blocked from being added to favourites */
withIsFavouriteBlocked(op?: { alias: string }) {
withIsFavouriteBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavouriteBlocked", level })
return this
},
/** The url for the character page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
@ -229,12 +229,12 @@ export const Character = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The amount of user's who have favourited the character */
withFavourites(op?: { alias: string }) {
withFavourites(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favourites", level })
return this
},
/** Notes for site moderators */
withModNotes(op?: { alias: string }) {
withModNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "modNotes", level })
return this
},

View File

@ -2,48 +2,48 @@ import { Fields, OperationParser } from "../types/Anilist.ts"
export const ExternalLinkSourceCollection = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the external link */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The url of the external link or base url of link source */
withUrl(op?: { alias: string }) {
withUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "url", level })
return this
},
/** The links website site name */
withSite(op?: { alias: string }) {
withSite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "site", level })
return this
},
/** The links website site id */
withSiteId(op?: { alias: string }) {
withSiteId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteId", level })
return this
},
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** Language the site content is in. See Staff language field for values. */
withLanguage(op?: { alias: string }) {
withLanguage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "language", level })
return this
},
withColor(op?: { alias: string }) {
withColor(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "color", level })
return this
},
/** The icon image url of the site. Not available for all links. Transparent PNG 64x64 */
withIcon(op?: { alias: string }) {
withIcon(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "icon", level })
return this
},
withNotes(op?: { alias: string }) {
withNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "notes", level })
return this
},
withIsDisabled(op?: { alias: string }) {
withIsDisabled(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isDisabled", level })
return this
},

View File

@ -2,7 +2,7 @@ import { Fields, OperationParser } from "../types/Anilist.ts"
export const Markdown = ({ operation, level }: Fields<OperationParser>) => ({
/** The parsed markdown as html */
withHtml(op?: { alias: string }) {
withHtml(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "html", level })
return this
},

View File

@ -37,19 +37,19 @@ export const MediaListGroup = ({ operation, level }: Fields<OperationParser>) =>
op.fn(MediaList({ operation, level: level + 1 }))
return this
},
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
withIsCustomList(op?: { alias: string }) {
withIsCustomList(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isCustomList", level })
return this
},
withIsSplitCompletedList(op?: { alias: string }) {
withIsSplitCompletedList(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSplitCompletedList", level })
return this
},
withStatus(op?: { alias: string }) {
withStatus(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "status", level })
return this
},
@ -57,22 +57,22 @@ export const MediaListGroup = ({ operation, level }: Fields<OperationParser>) =>
const MediaTitle = ({ operation, level }: Fields<OperationParser>) => ({
/** The romanization of the native language title */
romaji(op?: { alias: string; args?: MediaTitleRomajiArgs }) {
romaji(op?: { alias?: string; args?: MediaTitleRomajiArgs }) {
operation.set({ alias: op?.alias, subField: "romaji", level, variables: op?.args })
return this
},
/** The official english title */
english(op?: { alias: string; args?: MediaTitleEnglishArgs }) {
english(op?: { alias?: string; args?: MediaTitleEnglishArgs }) {
operation.set({ alias: op?.alias, subField: "english", level, variables: op?.args })
return this
},
/** Official title in it's native language */
native(op?: { alias: string; args?: MediaTitleNativeArgs }) {
native(op?: { alias?: string; args?: MediaTitleNativeArgs }) {
operation.set({ alias: op?.alias, subField: "native", level, variables: op?.args })
return this
},
/** The currently authenticated users preferred title language. Default romaji for non-authenticated */
userPreferred(op?: { alias: string }) {
userPreferred(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userPreferred", level })
return this
},
@ -80,17 +80,17 @@ const MediaTitle = ({ operation, level }: Fields<OperationParser>) => ({
const MediaTrailer = ({ operation, level }: Fields<OperationParser>) => ({
/** The trailer video id */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The site the video is hosted by (Currently either youtube or dailymotion) */
withSite(op?: { alias: string }) {
withSite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "site", level })
return this
},
/** The url for the thumbnail image of the video */
withThumbnail(op?: { alias: string }) {
withThumbnail(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "thumbnail", level })
return this
},
@ -98,22 +98,22 @@ const MediaTrailer = ({ operation, level }: Fields<OperationParser>) => ({
const MediaCoverImage = ({ operation, level }: Fields<OperationParser>) => ({
/** The cover image url of the media at its largest size. If this size isn't available, large will be provided instead. */
withExtraLarge(op?: { alias: string }) {
withExtraLarge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "extraLarge", level })
return this
},
/** The cover image url of the media at a large size */
withLarge(op?: { alias: string }) {
withLarge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "large", level })
return this
},
/** The cover image url of the media at medium size */
withMedium(op?: { alias: string }) {
withMedium(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "medium", level })
return this
},
/** Average #hex color of cover image */
withColor(op?: { alias: string }) {
withColor(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "color", level })
return this
},
@ -121,48 +121,48 @@ const MediaCoverImage = ({ operation, level }: Fields<OperationParser>) => ({
const MediaExternalLink = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the external link */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The url of the external link or base url of link source */
withUrl(op?: { alias: string }) {
withUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "url", level })
return this
},
/** The links website site name */
withSite(op?: { alias: string }) {
withSite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "site", level })
return this
},
/** The links website site id */
withSiteId(op?: { alias: string }) {
withSiteId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteId", level })
return this
},
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** Language the site content is in. See Staff language field for values. */
withLanguage(op?: { alias: string }) {
withLanguage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "language", level })
return this
},
withColor(op?: { alias: string }) {
withColor(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "color", level })
return this
},
/** The icon image url of the site. Not available for all links. Transparent PNG 64x64 */
withIcon(op?: { alias: string }) {
withIcon(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "icon", level })
return this
},
withNotes(op?: { alias: string }) {
withNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "notes", level })
return this
},
withIsDisabled(op?: { alias: string }) {
withIsDisabled(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isDisabled", level })
return this
},
@ -170,22 +170,22 @@ const MediaExternalLink = ({ operation, level }: Fields<OperationParser>) => ({
const MediaStreamingEpisode = ({ operation, level }: Fields<OperationParser>) => ({
/** Title of the episode */
withTitle(op?: { alias: string }) {
withTitle(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "title", level })
return this
},
/** Url of episode image thumbnail */
withThumbnail(op?: { alias: string }) {
withThumbnail(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "thumbnail", level })
return this
},
/** The url of the episode */
withUrl(op?: { alias: string }) {
withUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "url", level })
return this
},
/** The site location of the streaming episodes */
withSite(op?: { alias: string }) {
withSite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "site", level })
return this
},
@ -193,42 +193,42 @@ const MediaStreamingEpisode = ({ operation, level }: Fields<OperationParser>) =>
const MediaRank = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the rank */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The numerical rank of the media */
withRank(op?: { alias: string }) {
withRank(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "rank", level })
return this
},
/** The type of ranking */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The format the media is ranked within */
withFormat(op?: { alias: string }) {
withFormat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "format", level })
return this
},
/** The year the media is ranked within */
withYear(op?: { alias: string }) {
withYear(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "year", level })
return this
},
/** The season the media is ranked within */
withSeason(op?: { alias: string }) {
withSeason(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "season", level })
return this
},
/** If the ranking is based on all time instead of a season/year */
withAllTime(op?: { alias: string }) {
withAllTime(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "allTime", level })
return this
},
/** String that gives context to the ranking type and time span */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
@ -248,22 +248,22 @@ const MediaStats = ({ operation, level }: Fields<OperationParser>) => ({
})
const StatusDistribution = ({ operation, level }: Fields<OperationParser>) => ({
withStatus(op?: { alias: string }) {
withStatus(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "status", level })
return this
},
withAmount(op?: { alias: string }) {
withAmount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "amount", level })
return this
},
})
const ScoreDistribution = ({ operation, level }: Fields<OperationParser>) => ({
withScore(op?: { alias: string }) {
withScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "score", level })
return this
},
withAmount(op?: { alias: string }) {
withAmount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "amount", level })
return this
},
@ -277,17 +277,17 @@ const MediaEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The id of the connection */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of relation to the parent model */
withRelationType(op?: { alias: string; args?: AtLeastOne<MediaEdgeRelationTypeArgs> }) {
withRelationType(op?: { alias?: string; args?: AtLeastOne<MediaEdgeRelationTypeArgs> }) {
operation.set({ alias: op?.alias, subField: "relationType", level, variables: op?.args })
return this
},
/** If the studio is the main animation studio of the media (For Studio->MediaConnection field only) */
withIsMainStudio(op?: { alias: string }) {
withIsMainStudio(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isMainStudio", level })
return this
},
@ -298,27 +298,27 @@ const MediaEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The characters role in the media */
withCharacterRole(op?: { alias: string }) {
withCharacterRole(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "characterRole", level })
return this
},
/** Media specific character name */
withCharacterName(op?: { alias: string }) {
withCharacterName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "characterName", level })
return this
},
/** Notes regarding the VA's role for the character */
withRoleNotes(op?: { alias: string }) {
withRoleNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "roleNotes", level })
return this
},
/** Used for grouping roles where multiple dubs exist for the same language. Either dubbing company name or language variant. */
withDubGroup(op?: { alias: string }) {
withDubGroup(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "dubGroup", level })
return this
},
/** The role of the staff member in the production of the media */
withStaffRole(op?: { alias: string }) {
withStaffRole(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "staffRole", level })
return this
},
@ -352,7 +352,7 @@ const MediaEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The order the media should be displayed from the users favourites */
withFavouriteOrder(op?: { alias: string }) {
withFavouriteOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favouriteOrder", level })
return this
},
@ -381,137 +381,137 @@ export const MediaConnection = ({ operation, level }: Fields<OperationParser>) =
export const Media = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the media */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: getFieldName(this.withId.name), level })
return this
},
/** The mal id of the media */
withIdMal(op?: { alias: string }) {
withIdMal(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "idMal", level })
return this
},
/** The type of the media; anime or manga */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The format the media was released in */
withFormat(op?: { alias: string }) {
withFormat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "format", level })
return this
},
/** The season the media was initially released in */
withSeason(op?: { alias: string }) {
withSeason(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "season", level })
return this
},
/** The season year the media was initially released in */
withSeasonYear(op?: { alias: string }) {
withSeasonYear(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "seasonYear", level })
return this
},
/** The year & season the media was initially released in */
withSeasonInt(op?: { alias: string }) {
withSeasonInt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "seasonInt", level })
return this
},
/** The amount of episodes the anime has when complete */
withEpisodes(op?: { alias: string }) {
withEpisodes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "episodes", level })
return this
},
/** The general length of each anime episode in minutes */
withDuration(op?: { alias: string }) {
withDuration(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "duration", level })
return this
},
/** The amount of chapters the manga has when complete */
withChapters(op?: { alias: string }) {
withChapters(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chapters", level })
return this
},
/** The amount of volumes the manga has when complete */
withVolumes(op?: { alias: string }) {
withVolumes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "volumes", level })
return this
},
/** Where the media was created. (ISO 3166-1 alpha-2) */
withCountryOfOrigin(op?: { alias: string }) {
withCountryOfOrigin(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "countryOfOrigin", level })
return this
},
/** If the media is officially licensed or a self-published doujin release */
withIsLicensed(op?: { alias: string }) {
withIsLicensed(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLicensed", level })
return this
},
/** Official Twitter hashtags for the media */
withHashtag(op?: { alias: string }) {
withHashtag(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "hashtag", level })
return this
},
/** When the media's data was last updated */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},
/** The banner image of the media */
withBannerImage(op?: { alias: string }) {
withBannerImage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "bannerImage", level })
return this
},
/** The genres of the media */
withGenres(op?: { alias: string }) {
withGenres(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "genres", level })
return this
},
/** Alternative titles of the media */
withSynonyms(op?: { alias: string }) {
withSynonyms(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "synonyms", level })
return this
},
/** A weighted average score of all the user's scores of the media */
withAverageScore(op?: { alias: string }) {
withAverageScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "averageScore", level })
return this
},
/** Mean score of all the user's scores of the media */
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
/** The number of users with the media on their list */
withPopularity(op?: { alias: string }) {
withPopularity(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "popularity", level })
return this
},
/** Locked media may not be added to lists our favorited. This may be due to the entry pending for deletion or other reasons. */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},
/** The amount of related activity in the past hour */
withTrending(op?: { alias: string }) {
withTrending(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "trending", level })
return this
},
/** The amount of user's who have favourited the media */
withFavourites(op?: { alias: string }) {
withFavourites(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favourites", level })
return this
},
/** If the media is marked as favourite by the current authenticated user */
withIsFavourite(op?: { alias: string }) {
withIsFavourite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavourite", level })
return this
},
/** If the media is blocked from being added to favourites */
withIsFavouriteBlocked(op?: { alias: string }) {
withIsFavouriteBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavouriteBlocked", level })
return this
},
/** If the media is intended only for 18+ adult audiences */
withIsAdult(op?: { alias: string }) {
withIsAdult(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isAdult", level })
return this
},
@ -523,42 +523,42 @@ export const Media = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The url for the media page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** If the media should have forum thread automatically created for it on airing episode release */
withAutoCreateForumThread(op?: { alias: string }) {
withAutoCreateForumThread(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "autoCreateForumThread", level })
return this
},
/** If the media is blocked from being recommended to/from */
withIsRecommendationBlocked(op?: { alias: string }) {
withIsRecommendationBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isRecommendationBlocked", level })
return this
},
/** If the media is blocked from being reviewed */
withIsReviewBlocked(op?: { alias: string }) {
withIsReviewBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isReviewBlocked", level })
return this
},
/** Notes for site moderators */
withModNotes(op?: { alias: string }) {
withModNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "modNotes", level })
return this
},
/** The current releasing status of the media */
withStatus(op?: { alias: string; args?: AtLeastOne<MediaStatusArgs> }) {
withStatus(op?: { alias?: string; args?: AtLeastOne<MediaStatusArgs> }) {
operation.set({ alias: op?.alias, subField: "status", level, variables: op?.args })
return this
},
/** Short description of the media's story and characters */
withDescription(op?: { alias: string; args?: AtLeastOne<MediaDescriptionArgs> }) {
withDescription(op?: { alias?: string; args?: AtLeastOne<MediaDescriptionArgs> }) {
operation.set({ alias: op?.alias, subField: "description", level, variables: op?.args })
return this
},
/** Source type the media was adapted from. */
withSource(op?: { alias: string; args?: AtLeastOne<MediaSourceArgs> }) {
withSource(op?: { alias?: string; args?: AtLeastOne<MediaSourceArgs> }) {
operation.set({ alias: op?.alias, subField: "source", level, variables: op?.args })
return this
},

View File

@ -5,27 +5,27 @@ import { User } from "./User.ts"
export const MediaListTypeOptions = ({ operation, level }: Fields<OperationParser>) => ({
/** The order each list should be displayed in */
withSectionOrder(op?: { alias: string }) {
withSectionOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "sectionOrder", level })
return this
},
/** If the completed sections of the list should be separated by format */
withSplitCompletedSectionByFormat(op?: { alias: string }) {
withSplitCompletedSectionByFormat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "splitCompletedSectionByFormat", level })
return this
},
/** The names of the user's custom lists */
withCustomLists(op?: { alias: string }) {
withCustomLists(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "customLists", level })
return this
},
/** The names of the user's advanced scoring sections */
withAdvancedScoring(op?: { alias: string }) {
withAdvancedScoring(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "advancedScoring", level })
return this
},
/** If advanced scoring is enabled */
withAdvancedScoringEnabled(op?: { alias: string }) {
withAdvancedScoringEnabled(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "advancedScoringEnabled", level })
return this
},
@ -33,12 +33,12 @@ export const MediaListTypeOptions = ({ operation, level }: Fields<OperationParse
export const MediaListOptions = ({ operation, level }: Fields<OperationParser>) => ({
/** The score format the user is using for media lists */
withScoreFormat(op?: { alias: string }) {
withScoreFormat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "scoreFormat", level })
return this
},
/** The default order list rows should be displayed in */
withRowOrder(op?: { alias: string }) {
withRowOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "rowOrder", level })
return this
},
@ -67,59 +67,59 @@ export const MediaList = ({ operation, level }: Fields<OperationParser>) => ({
op.fn(FuzzyDate({ operation, level: level + 1 }))
return this
},
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},
withStatus(op?: { alias: string }) {
withStatus(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "status", level })
return this
},
withProgress(op?: { alias: string }) {
withProgress(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "progress", level })
return this
},
withProgressVolumes(op?: { alias: string }) {
withProgressVolumes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "progressVolumes", level })
return this
},
withRepeat(op?: { alias: string }) {
withRepeat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "repeat", level })
return this
},
withPriority(op?: { alias: string }) {
withPriority(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "priority", level })
return this
},
withPrivate(op?: { alias: string }) {
withPrivate(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "private", level })
return this
},
withNotes(op?: { alias: string }) {
withNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "notes", level })
return this
},
withAdvancedScores(op?: { alias: string }) {
withAdvancedScores(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "advancedScores", level })
return this
},
withHiddenFromStatusLists(op?: { alias: string }) {
withHiddenFromStatusLists(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "hiddenFromStatusLists", level })
return this
},
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},

View File

@ -17,7 +17,7 @@ export const MediaListCollection = ({ operation, level }: Fields<OperationParser
return this
},
/** If there is another chunk */
withHasNextChunk(op?: { alias: string }) {
withHasNextChunk(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "hasNextChunk", level })
return this
},

View File

@ -2,47 +2,47 @@ import { Fields, OperationParser } from "../types/Anilist.ts"
export const MediaTag = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the tag */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The name of the tag */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
/** A general description of the tag */
withDescription(op?: { alias: string }) {
withDescription(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "description", level })
return this
},
/** The categories of tags this tag belongs to */
withCategory(op?: { alias: string }) {
withCategory(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "category", level })
return this
},
/** The relevance ranking of the tag out of the 100 for this media */
withRank(op?: { alias: string }) {
withRank(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "rank", level })
return this
},
/** If the tag could be a spoiler for any media */
withIsGeneralSpoiler(op?: { alias: string }) {
withIsGeneralSpoiler(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isGeneralSpoiler", level })
return this
},
/** If the tag is a spoiler for this media */
withIsMediaSpoiler(op?: { alias: string }) {
withIsMediaSpoiler(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isMediaSpoiler", level })
return this
},
/** If the tag is only for adult 18+ media */
withIsAdult(op?: { alias: string }) {
withIsAdult(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isAdult", level })
return this
},
/** The user who submitted the tag */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},

View File

@ -34,42 +34,42 @@ export const MediaTrendConnection = ({ operation, level }: Fields<OperationParse
export const MediaTrend = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the tag */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},
/** The day the data was recorded (timestamp) */
withDate(op?: { alias: string }) {
withDate(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "date", level })
return this
},
/** The amount of media activity on the day */
withTrending(op?: { alias: string }) {
withTrending(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "trending", level })
return this
},
/** A weighted average score of all the user's scores of the media */
withAverageScore(op?: { alias: string }) {
withAverageScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "averageScore", level })
return this
},
/** The number of users with the media on their list */
withPopularity(op?: { alias: string }) {
withPopularity(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "popularity", level })
return this
},
/** The number of users with watching/reading the media */
withInProgress(op?: { alias: string }) {
withInProgress(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "inProgress", level })
return this
},
/** If the media was being released at this time */
withReleasing(op?: { alias: string }) {
withReleasing(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "releasing", level })
return this
},
/** The episode number of the anime released on this day */
withEpisode(op?: { alias: string }) {
withEpisode(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "episode", level })
return this
},

View File

@ -7,32 +7,32 @@ import { User } from "./User.ts"
const AiringNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the aired anime */
withAnimeId(op?: { alias: string }) {
withAnimeId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "animeId", level })
return this
},
/** The episode number that just aired */
withEpisode(op?: { alias: string }) {
withEpisode(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "episode", level })
return this
},
/** The notification context text */
withContexts(op?: { alias: string }) {
withContexts(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "contexts", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -46,27 +46,27 @@ const AiringNotification = ({ operation, level }: Fields<OperationParser>) => ({
const FollowingNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the user who followed the authenticated user */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -81,32 +81,32 @@ const FollowingNotification = ({ operation, level }: Fields<OperationParser>) =>
const ActivityMessageNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The if of the user who send the message */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the activity message */
withActivityId(op?: { alias: string }) {
withActivityId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "activityId", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -128,32 +128,32 @@ const ActivityMessageNotification = ({ operation, level }: Fields<OperationParse
const ActivityNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the user who mentioned the authenticated user */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the activity where mentioned */
withActivityId(op?: { alias: string }) {
withActivityId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "activityId", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -180,32 +180,32 @@ const ActivityNotification = ({ operation, level }: Fields<OperationParser>) =>
const ThreadCommentNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the user who mentioned the authenticated user */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the comment where mentioned */
withCommentId(op?: { alias: string }) {
withCommentId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "commentId", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -234,32 +234,32 @@ const ThreadCommentNotification = ({ operation, level }: Fields<OperationParser>
const ThreadLikeNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the user who liked to the activity */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the thread which was liked */
withThreadId(op?: { alias: string }) {
withThreadId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "threadId", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -288,27 +288,27 @@ const ThreadLikeNotification = ({ operation, level }: Fields<OperationParser>) =
const RelatedMediaAdditionNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the new media */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},
/** The notification context text */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -323,32 +323,32 @@ const RelatedMediaAdditionNotification = ({ operation, level }: Fields<Operation
const MediaDataChangeNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the media that received data changes */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},
/** The reason for the media data change */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The reason for the media data change */
withReason(op?: { alias: string }) {
withReason(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "reason", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -363,37 +363,37 @@ const MediaDataChangeNotification = ({ operation, level }: Fields<OperationParse
const MediaMergeNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The id of the media that was merged into */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaId", level })
return this
},
/** The title of the deleted media */
withDeletedMediaTitles(op?: { alias: string }) {
withDeletedMediaTitles(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "deletedMediaTitles", level })
return this
},
/** The reason for the media data change */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The reason for the media merge */
withReason(op?: { alias: string }) {
withReason(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "reason", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
@ -408,32 +408,32 @@ const MediaMergeNotification = ({ operation, level }: Fields<OperationParser>) =
const MediaDeletionNotification = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the Notification */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The type of notification */
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
/** The title of the deleted media */
withDeletedMediaTitle(op?: { alias: string }) {
withDeletedMediaTitle(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "deletedMediaTitle", level })
return this
},
/** The reason for the media deletion */
withContext(op?: { alias: string }) {
withContext(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "context", level })
return this
},
/** The reason for the media deletion */
withReason(op?: { alias: string }) {
withReason(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "reason", level })
return this
},
/** The time the notification was created at */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},

View File

@ -39,27 +39,27 @@ import { User } from "./User.ts"
export const PageInfo = ({ operation, level }: Fields<OperationParser>) => ({
/** The total number of items. Note: This value is not guaranteed to be accurate, do not rely on this for logic */
withTotal(op?: { alias: string }) {
withTotal(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "total", level })
return this
},
/** The count on a page */
withPerPage(op?: { alias: string }) {
withPerPage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "perPage", level })
return this
},
/** The current page */
withCurrentPage(op?: { alias: string }) {
withCurrentPage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "currentPage", level })
return this
},
/** The last page */
withLastPage(op?: { alias: string }) {
withLastPage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "lastPage", level })
return this
},
/** If there is another page */
withHasNextPage(op?: { alias: string }) {
withHasNextPage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "hasNextPage", level })
return this
},
@ -72,7 +72,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
op.fn(PageInfo({ operation, level: level + 1 }))
return this
},
withUsers(op?: { alias: string; args?: AtLeastOne<PageUsersArgs>; fn?: Fn<typeof User> }) {
withUsers(op?: { alias?: string; args?: AtLeastOne<PageUsersArgs>; fn?: Fn<typeof User> }) {
operation.set({
alias: op?.alias,
subField: "users",
@ -84,7 +84,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else User({ operation, level: level + 1 }).withId()
return this
},
withMedia(op?: { alias: string; args?: AtLeastOne<PageMediaArgs>; fn?: Fn<typeof Media> }) {
withMedia(op?: { alias?: string; args?: AtLeastOne<PageMediaArgs>; fn?: Fn<typeof Media> }) {
operation.set({
alias: op?.alias,
subField: "media",
@ -110,7 +110,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else Character({ operation, level: level + 1 }).withId()
return this
},
withStaff(op?: { alias: string; args?: AtLeastOne<PageStaffArgs>; fn?: Fn<typeof Staff> }) {
withStaff(op?: { alias?: string; args?: AtLeastOne<PageStaffArgs>; fn?: Fn<typeof Staff> }) {
operation.set({
alias: op?.alias,
subField: "staff",
@ -122,7 +122,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else Staff({ operation, level: level + 1 }).withId()
return this
},
withStudios(op?: { alias: string; args?: AtLeastOne<PageStudiosArgs>; fn?: Fn<typeof Studio> }) {
withStudios(op?: { alias?: string; args?: AtLeastOne<PageStudiosArgs>; fn?: Fn<typeof Studio> }) {
operation.set({
alias: op?.alias,
subField: "studios",
@ -262,7 +262,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else ActivityReply({ operation, level: level + 1 }).withId()
return this
},
withThreads(op?: { alias: string; args?: AtLeastOne<PageThreadsArgs>; fn?: Fn<typeof Thread> }) {
withThreads(op?: { alias?: string; args?: AtLeastOne<PageThreadsArgs>; fn?: Fn<typeof Thread> }) {
operation.set({
alias: op?.alias,
subField: "threads",
@ -292,7 +292,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else ThreadComment({ operation, level: level + 1 }).withId()
return this
},
withReviews(op?: { alias: string; args?: AtLeastOne<PageReviewsArgs>; fn?: Fn<typeof Review> }) {
withReviews(op?: { alias?: string; args?: AtLeastOne<PageReviewsArgs>; fn?: Fn<typeof Review> }) {
operation.set({
alias: op?.alias,
subField: "reviews",
@ -322,7 +322,7 @@ export const Page = ({ operation, level }: Fields<OperationParser>) => ({
else Recommendation({ operation, level: level + 1 }).withId()
return this
},
withLikes(op?: { alias: string; args?: AtLeastOne<PageLikesArgs>; fn?: Fn<typeof User> }) {
withLikes(op?: { alias?: string; args?: AtLeastOne<PageLikesArgs>; fn?: Fn<typeof User> }) {
operation.set({
alias: op?.alias,
subField: "likes",

View File

@ -34,17 +34,17 @@ export const RecommendationConnection = ({ operation, level }: Fields<OperationP
export const Recommendation = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the recommendation */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** Users rating of the recommendation */
withRating(op?: { alias: string }) {
withRating(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "rating", level })
return this
},
/** The rating of the recommendation by currently authenticated user */
withUserRating(op?: { alias: string }) {
withUserRating(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userRating", level })
return this
},

View File

@ -35,72 +35,72 @@ export const ReviewConnection = ({ operation, level }: Fields<OperationParser>)
export const Review = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the review */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The id of the review's creator */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userid", level })
return this
},
/** The id of the review's media */
withMediaId(op?: { alias: string }) {
withMediaId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaid", level })
return this
},
/** For which type of media the review is for */
withMediaType(op?: { alias: string }) {
withMediaType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediatype", level })
return this
},
/** A short summary of the review */
withSummary(op?: { alias: string }) {
withSummary(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "summary", level })
return this
},
/** The main review body text */
withBody(op?: { alias: string; args?: { asHtml: boolean } }) {
withBody(op?: { alias?: string; args?: { asHtml: boolean } }) {
operation.set({ alias: op?.alias, subField: "body", level, variables: op?.args })
return this
},
/** The total user rating of the review */
withRating(op?: { alias: string }) {
withRating(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "rating", level })
return this
},
/** The amount of user ratings of the review */
withRatingAmount(op?: { alias: string }) {
withRatingAmount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "ratingamount", level })
return this
},
/** The rating of the review by currently authenticated user */
withUserRating(op?: { alias: string }) {
withUserRating(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userrating", level })
return this
},
/** The review score of the media */
withScore(op?: { alias: string }) {
withScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "score", level })
return this
},
/** If the review is not yet publicly published and is only viewable by creator */
withPrivate(op?: { alias: string }) {
withPrivate(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "private", level })
return this
},
/** The url for the review page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteurl", level })
return this
},
/** The time of the thread creation */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdat", level })
return this
},
/** The time of the thread last update */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedat", level })
return this
},

View File

@ -3,17 +3,17 @@ import { PageInfo } from "./Page.ts"
const SiteTrend = ({ operation, level }: Fields<OperationParser>) => ({
/** The day the data was recorded (timestamp) */
withDate(op?: { alias: string }) {
withDate(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "date", level })
return this
},
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
/** The change from yesterday */
withChange(op?: { alias: string }) {
withChange(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "change", level })
return this
},

View File

@ -19,12 +19,12 @@ export const StaffRoleType = ({ operation, level }: Fields<OperationParser>) =>
return this
},
/** Notes regarding the VA's role for the character */
withRoleNotes(op?: { alias: string }) {
withRoleNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "roleNotes", level })
return this
},
/** Used for grouping roles where multiple dubs exist for the same language. Either dubbing company name or language variant. */
withDubGroup(op?: { alias: string }) {
withDubGroup(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "dubGroup", level })
return this
},
@ -38,17 +38,17 @@ const StaffEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The id of the connection */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The role of the staff member in the production of the media */
withRole(op?: { alias: string }) {
withRole(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "role", level })
return this
},
/** The order the staff should be displayed from the users favourites */
withFavouriteOrder(op?: { alias: string }) {
withFavouriteOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favouriteOrder", level })
return this
},
@ -77,37 +77,37 @@ export const StaffConnection = ({ operation, level }: Fields<OperationParser>) =
const StaffName = ({ operation, level }: Fields<OperationParser>) => ({
/** The person's given name */
withFirst(op?: { alias: string }) {
withFirst(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "first", level })
return this
},
/** The person's middle name */
withMiddle(op?: { alias: string }) {
withMiddle(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "middle", level })
return this
},
/** The person's surname */
withLast(op?: { alias: string }) {
withLast(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "last", level })
return this
},
/** The person's first and last name */
withFull(op?: { alias: string }) {
withFull(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "full", level })
return this
},
/** The person's full name in their native language */
withNative(op?: { alias: string }) {
withNative(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "native", level })
return this
},
/** Other names the staff member might be referred to as (pen names) */
withAlternative(op?: { alias: string }) {
withAlternative(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "alternative", level })
return this
},
/** The currently authenticated users preferred name language. Default romaji for non-authenticated */
withUserPreferred(op?: { alias: string }) {
withUserPreferred(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userPreferred", level })
return this
},
@ -115,12 +115,12 @@ const StaffName = ({ operation, level }: Fields<OperationParser>) => ({
const StaffImage = ({ operation, level }: Fields<OperationParser>) => ({
/** The person's image of media at its largest size */
withLarge(op?: { alias: string }) {
withLarge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "large", level })
return this
},
/** The person's image of media at medium size */
withMedium(op?: { alias: string }) {
withMedium(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "medium", level })
return this
},
@ -128,7 +128,7 @@ const StaffImage = ({ operation, level }: Fields<OperationParser>) => ({
export const Staff = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the staff member */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
@ -140,7 +140,7 @@ export const Staff = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The primary language of the staff member. Current values: Japanese, English, Korean, Italian, Spanish, Portuguese, French, German, Hebrew, Hungarian, Chinese, Arabic, Filipino, Catalan, Finnish, Turkish, Dutch, Swedish, Thai, Tagalog, Malaysian, Indonesian, Vietnamese, Nepali, Hindi, Urdu */
withLanguageV2(op?: { alias: string }) {
withLanguageV2(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "languageV2", level })
return this
},
@ -152,17 +152,17 @@ export const Staff = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** A general description of the staff member */
withDescription(op?: { alias: string; args?: { asHtml: boolean } }) {
withDescription(op?: { alias?: string; args?: { asHtml: boolean } }) {
operation.set({ alias: op?.alias, subField: "description", level, variables: op?.args })
return this
},
/** The person's primary occupations */
withPrimaryOccupations(op?: { alias: string }) {
withPrimaryOccupations(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "primaryOccupations", level })
return this
},
/** The staff's gender. Usually Male, Female, or Non-binary but can be any string. */
withGender(op?: { alias: string }) {
withGender(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "gender", level })
return this
},
@ -189,37 +189,37 @@ export const Staff = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The person's age in years */
withAge(op?: { alias: string }) {
withAge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "age", level })
return this
},
/** [startYear, endYear] (If the 2nd value is not present staff is still active) */
withYearsActive(op?: { alias: string }) {
withYearsActive(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "yearsActive", level })
return this
},
/** The persons birthplace or hometown */
withHomeTown(op?: { alias: string }) {
withHomeTown(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "homeTown", level })
return this
},
/** The persons blood type */
withBloodType(op?: { alias: string }) {
withBloodType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "bloodType", level })
return this
},
/** If the staff member is marked as favourite by the currently authenticated user */
withIsFavourite(op?: { alias: string }) {
withIsFavourite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavourite", level })
return this
},
/** If the staff member is blocked from being added to favourites */
withIsFavouriteBlocked(op?: { alias: string }) {
withIsFavouriteBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavouriteBlocked", level })
return this
},
/** The url for the staff page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
@ -292,22 +292,22 @@ export const Staff = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** Status of the submission */
withSubmissionStatus(op?: { alias: string }) {
withSubmissionStatus(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "submissionStatus", level })
return this
},
/** Inner details of submission status */
withSubmissionNotes(op?: { alias: string }) {
withSubmissionNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "submissionNotes", level })
return this
},
/** The amount of user's who have favourited the staff member */
withFavourites(op?: { alias: string }) {
withFavourites(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favourites", level })
return this
},
/** Notes for site moderators */
withModNotes(op?: { alias: string }) {
withModNotes(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "modNotes", level })
return this
},

View File

@ -12,17 +12,17 @@ const StudioEdge = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The id of the connection */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** If the studio is the main animation studio of the anime */
withIsMain(op?: { alias: string }) {
withIsMain(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isMain", level })
return this
},
/** The order the character should be displayed from the users favourites */
withFavouriteOrder(op?: { alias: string }) {
withFavouriteOrder(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favouriteOrder", level })
return this
},
@ -51,17 +51,17 @@ export const StudioConnection = ({ operation, level }: Fields<OperationParser>)
export const Studio = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the studio */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The name of the studio */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
/** If the studio is an animation studio or a different kind of company */
withIsAnimationStudio(op?: { alias: string }) {
withIsAnimationStudio(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isAnimationStudio", level })
return this
},
@ -80,17 +80,17 @@ export const Studio = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The url for the studio page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** If the studio is marked as favourite by the currently authenticated user */
withIsFavourite(op?: { alias: string }) {
withIsFavourite(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFavourite", level })
return this
},
/** The amount of user's who have favourited the studio */
withFavourites(op?: { alias: string }) {
withFavourites(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "favourites", level })
return this
},

View File

@ -4,12 +4,12 @@ import { User } from "./User.ts"
const ThreadCategory = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the category */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The name of the category */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
@ -17,82 +17,82 @@ const ThreadCategory = ({ operation, level }: Fields<OperationParser>) => ({
export const Thread = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the thread */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The title of the thread */
withTitle(op?: { alias: string }) {
withTitle(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "title", level })
return this
},
/** The text body of the thread (Markdown) */
withBody(op?: { alias: string; args?: { asHtml: boolean } }) {
withBody(op?: { alias?: string; args?: { asHtml: boolean } }) {
operation.set({ alias: op?.alias, subField: "body", level, variables: op?.args })
return this
},
/** The id of the thread owner user */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The id of the user who most recently commented on the thread */
withReplyUserId(op?: { alias: string }) {
withReplyUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyUserId", level })
return this
},
/** The id of the most recent comment on the thread */
withReplyCommentId(op?: { alias: string }) {
withReplyCommentId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyCommentId", level })
return this
},
/** The number of comments on the thread */
withReplyCount(op?: { alias: string }) {
withReplyCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "replyCount", level })
return this
},
/** The number of times users have viewed the thread */
withViewCount(op?: { alias: string }) {
withViewCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "viewCount", level })
return this
},
/** If the thread is locked and can receive comments */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},
/** If the thread is stickied and should be displayed at the top of the page */
withIsSticky(op?: { alias: string }) {
withIsSticky(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSticky", level })
return this
},
/** If the currently authenticated user is subscribed to the thread */
withIsSubscribed(op?: { alias: string }) {
withIsSubscribed(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isSubscribed", level })
return this
},
/** The amount of likes the thread has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the thread */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** The time of the last reply */
withRepliedAt(op?: { alias: string }) {
withRepliedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "repliedAt", level })
return this
},
/** The time of the thread creation */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
/** The time of the thread last update */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},
@ -118,7 +118,7 @@ export const Thread = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The url for the thread page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},

View File

@ -4,47 +4,47 @@ import { Fields, Fn, OperationParser } from "../types/Anilist.ts"
export const ThreadComment = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the comment */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The user id of the comment's owner */
withUserId(op?: { alias: string }) {
withUserId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "userId", level })
return this
},
/** The id of thread the comment belongs to */
withThreadId(op?: { alias: string }) {
withThreadId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "threadId", level })
return this
},
/** The text content of the comment (Markdown) */
withComment(op?: { alias: string; args?: { asHtml: boolean } }) {
withComment(op?: { alias?: string; args?: { asHtml: boolean } }) {
operation.set({ alias: op?.alias, subField: "comment", level, variables: op?.args })
return this
},
/** The amount of likes the comment has */
withLikeCount(op?: { alias: string }) {
withLikeCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "likeCount", level })
return this
},
/** If the currently authenticated user liked the comment */
withIsLiked(op?: { alias: string }) {
withIsLiked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLiked", level })
return this
},
/** The url for the comment page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/** The time of the comments creation */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
/** The time of the comments last update */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},
@ -70,12 +70,12 @@ export const ThreadComment = ({ operation, level }: Fields<OperationParser>) =>
return this
},
/** The comment's child reply comments */
withChildComments(op?: { alias: string }) {
withChildComments(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "childComments", level })
return this
},
/** If the comment tree is locked and may not receive replies or edits */
withIsLocked(op?: { alias: string }) {
withIsLocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isLocked", level })
return this
},

View File

@ -5,22 +5,22 @@ import { MediaListOptions } from "./MediaList.ts"
import { UserStatisticTypes } from "./UserStatistics.ts"
const NotificationOption = ({ operation, level }: Fields<OperationParser>) => ({
withEnabled(op?: { alias: string }) {
withEnabled(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "enabled", level })
return this
},
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
})
const ListActivityOption = ({ operation, level }: Fields<OperationParser>) => ({
withDisabled(op?: { alias: string }) {
withDisabled(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "disabled", level })
return this
},
withType(op?: { alias: string }) {
withType(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "type", level })
return this
},
@ -28,17 +28,17 @@ const ListActivityOption = ({ operation, level }: Fields<OperationParser>) => ({
export const UserPreviousName = ({ operation, level }: Fields<OperationParser>) => ({
/** A previous name of the user. */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
/** When the user first changed from this name. */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
/** When the user most recently changed from this name. */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},
@ -46,25 +46,25 @@ export const UserPreviousName = ({ operation, level }: Fields<OperationParser>)
export const UserOptions = ({ operation, level }: Fields<OperationParser>) => ({
/** The language the user wants to see media titles in */
withTitleLanguage(op?: { alias: string }) {
withTitleLanguage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "titleLanguage", level })
return this
},
/** Whether the user has enabled viewing of 18+ content */
withDisplayAdultContent(op?: { alias: string }) {
withDisplayAdultContent(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "displayAdultContent", level })
return this
},
/** Whether the user receives notifications when a show they are watching aires */
withAiringNotifications(op?: { alias: string }) {
withAiringNotifications(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "airingNotifications", level })
return this
},
/** Profile highlight color (blue, purple, pink, orange, red, green, gray) */
withProfileColor(op?: { alias: string }) {
withProfileColor(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "profileColor", level })
return this
},
@ -77,25 +77,25 @@ export const UserOptions = ({ operation, level }: Fields<OperationParser>) => ({
},
/** The user's timezone offset (Auth user only) */
withTimezone(op?: { alias: string }) {
withTimezone(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "timezone", level })
return this
},
/** Minutes between activity for them to be merged together. 0 is Never, Above 2 weeks (20160 mins) is Always. */
withActivityMergeTime(op?: { alias: string }) {
withActivityMergeTime(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "activityMergeTime", level })
return this
},
/** The language the user wants to see staff and character names in */
withStaffNameLanguage(op?: { alias: string }) {
withStaffNameLanguage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "staffNameLanguage", level })
return this
},
/** Whether the user only allow messages from users they follow */
withRestrictMessagesToFollowing(op?: { alias: string }) {
withRestrictMessagesToFollowing(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "restrictMessagesToFollowing", level })
return this
},
@ -110,12 +110,12 @@ export const UserOptions = ({ operation, level }: Fields<OperationParser>) => ({
export const UserAvatar = ({ operation, level }: Fields<OperationParser>) => ({
/** The avatar of user at its largest size */
withLarge(op?: { alias: string }) {
withLarge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "large", level })
return this
},
/** The avatar of user at medium size */
withMedium(op?: { alias: string }) {
withMedium(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "medium", level })
return this
},
@ -123,17 +123,17 @@ export const UserAvatar = ({ operation, level }: Fields<OperationParser>) => ({
export const User = ({ operation, level }: Fields<OperationParser>) => ({
/** The id of the user */
withId(op?: { alias: string }) {
withId(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "id", level })
return this
},
/** The name of the user */
withName(op?: { alias: string }) {
withName(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "name", level })
return this
},
/** The bio written by user (Markdown) */
withAbout(op?: { alias: string; args?: { asHtml: boolean } }) {
withAbout(op?: { alias?: string; args?: { asHtml: boolean } }) {
operation.set({ alias: op?.alias, subField: "about", level, variables: op?.args })
return this
},
@ -145,26 +145,26 @@ export const User = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/** The user's banner images */
withBannerImage(op?: { alias: string }) {
withBannerImage(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "bannerImage", level })
return this
},
/** If the authenticated user if following this user */
withIsFollowing(op?: { alias: string }) {
withIsFollowing(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFollowing", level })
return this
},
/** If this user if following the authenticated user */
withIsFollower(op?: { alias: string }) {
withIsFollower(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isFollower", level })
return this
},
/** If the user is blocked by the authenticated user */
withIsBlocked(op?: { alias: string }) {
withIsBlocked(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "isBlocked", level })
return this
},
withBans(op?: { alias: string }) {
withBans(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "bans", level })
return this
},
@ -193,37 +193,37 @@ export const User = ({ operation, level }: Fields<OperationParser>) => ({
return this
},
/* The number of unread notifications the user has */
withUnreadNotificationCount(op?: { alias: string }) {
withUnreadNotificationCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "unreadNotificationCount", level })
return this
},
/* The url for the user page on the AniList website */
withSiteUrl(op?: { alias: string }) {
withSiteUrl(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "siteUrl", level })
return this
},
/* The donation tier of the user */
withDonatorTier(op?: { alias: string }) {
withDonatorTier(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "donatorTier", level })
return this
},
/* Custom donation badge text */
withDonatorBadge(op?: { alias: string }) {
withDonatorBadge(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "donatorBadge", level })
return this
},
/* The user's moderator roles if they are a site moderator */
withModeratorRoles(op?: { alias: string }) {
withModeratorRoles(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "moderatorRoles", level })
return this
},
/* When the user's account was created. (Does not exist for accounts created before 2020) */
withCreatedAt(op?: { alias: string }) {
withCreatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "createdAt", level })
return this
},
/* When the user's data was last updated */
withUpdatedAt(op?: { alias: string }) {
withUpdatedAt(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "updatedAt", level })
return this
},

View File

@ -17,266 +17,266 @@ import { Staff } from "./Staff.ts"
import { Studio } from "./Studio.ts"
const UserFormatStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
withFormat(op?: { alias: string }) {
withFormat(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "format", level })
return this
},
})
const UserStatusStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
status(op?: { alias: string }) {
status(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "status", level })
return this
},
})
const UserScoreStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
score(op?: { alias: string }) {
score(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "score", level })
return this
},
})
const UserLengthStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
length(op?: { alias: string }) {
length(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "length", level })
return this
},
})
const UserReleaseYearStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
releaseYear(op?: { alias: string }) {
releaseYear(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "releaseYear", level })
return this
},
})
const UserStartYearStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
startYear(op?: { alias: string }) {
startYear(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "startYear", level })
return this
},
})
const UserGenreStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
genre(op?: { alias: string }) {
genre(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "genre", level })
return this
},
})
const UserTagStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
tag(op?: { alias: string }) {
tag(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "tag", level })
return this
},
})
const UserCountryStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
country(op?: { alias: string }) {
country(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "country", level })
return this
},
})
const UserVoiceActorStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
@ -286,30 +286,30 @@ const UserVoiceActorStatistics = ({ operation, level }: Fields<OperationParser>)
else Staff({ operation, level: level + 1 }).withId()
return this
},
withCharacterIds(op?: { alias: string }) {
withCharacterIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "characterIds", level })
return this
},
})
const UserStaffStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
@ -322,23 +322,23 @@ const UserStaffStatistics = ({ operation, level }: Fields<OperationParser>) => (
})
const UserStudioStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withMediaIds(op?: { alias: string }) {
withMediaIds(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "mediaIds", level })
return this
},
@ -351,31 +351,31 @@ const UserStudioStatistics = ({ operation, level }: Fields<OperationParser>) =>
})
export const UserStatistics = ({ operation, level }: Fields<OperationParser>) => ({
withCount(op?: { alias: string }) {
withCount(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "count", level })
return this
},
withMeanScore(op?: { alias: string }) {
withMeanScore(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "meanScore", level })
return this
},
withStandardDeviation(op?: { alias: string }) {
withStandardDeviation(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "standardDeviation", level })
return this
},
withMinutesWatched(op?: { alias: string }) {
withMinutesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "minutesWatched", level })
return this
},
withEpisodesWatched(op?: { alias: string }) {
withEpisodesWatched(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "episodesWatched", level })
return this
},
withChaptersRead(op?: { alias: string }) {
withChaptersRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "chaptersRead", level })
return this
},
withVolumesRead(op?: { alias: string }) {
withVolumesRead(op?: { alias?: string }) {
operation.set({ alias: op?.alias, subField: "volumesRead", level })
return this
},