import { RequireAtLeastOne, ExclusiveUnion } from '@dvcol/common-utils/common/models'; import { TraktApiParamsExtended, TraktApiExtended, TraktApiParamsPagination } from './models/trakt-client.model.cjs'; import { Any, TraktSharing, Extended, EntityTypes, Short } from './models/trakt-entity.model.cjs'; import { TraktEpisode } from './models/trakt-episode.model.cjs'; import { TraktApiIds } from './models/trakt-id.model.cjs'; import { TraktMovie } from './models/trakt-movie.model.cjs'; import { TraktPerson } from './models/trakt-people.model.cjs'; import { TraktSeason } from './models/trakt-season.model.cjs'; import { TraktShow } from './models/trakt-show.model.cjs'; type TraktComment = { id: number; parent_id: number; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ created_at: string; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; comment: string; spoiler: boolean; review: boolean; replies: number; likes: number; user_stats: { rating: number; play_count: number; completed_count: number; }; user: TraktUser; }; type BaseTraktCommentMedia = { type: 'movie' | 'show' | 'season' | 'episode' | 'list'; movie: TraktMovie; show: TraktShow; season: TraktSeason; episode: TraktEpisode; list: TraktList; }; type TraktCommentMedia = { type: T extends Any ? BaseTraktCommentMedia['type'] : T; } & (T extends 'movie' ? Pick : T extends 'show' ? Pick : T extends 'season' ? Pick : T extends 'episode' ? Pick : T extends 'list' ? Pick : RequireAtLeastOne); type TraktCommentItem = TraktCommentMedia & { comment: TraktComment; }; type BaseTraktCommentRequest = { /** Movie to comment */ movie: TraktMovie; /** Show to comment */ show: TraktShow; /** Season to comment */ season: TraktSeason; /** Episode to comment */ episode: TraktEpisode; /** List to comment */ list: Pick; }; type TraktCommentRequest = { /** Text for the comment. */ comment: string; /** Is this a spoiler? Defaults to false */ spoiler?: boolean; /** * Control sharing to any connected social networks. * * The sharing object is optional and will apply the user's settings if not sent. * If sharing is sent, each key will override the user's setting for that social network. * Send true to post or false to not post on the indicated social network. You can see which social networks a user has connected with the /users/settings method. */ sharing?: TraktSharing; } & (T extends 'movie' ? Pick : T extends 'show' ? Pick : T extends 'season' ? Pick : T extends 'episode' ? Pick : T extends 'list' ? Pick : ExclusiveUnion); type TraktPrivateUser = { username: string; private: boolean; ids: Pick; }; type TraktPublicUser = TraktPrivateUser & { name: string; vip: boolean; vip_ep: boolean; }; type TraktUserExtended = TraktPublicUser & { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ joined_at: string; /** 2 character location code. */ location: string; about: string; gender: string; age: number; images: { avatar: { full: string; }; }; }; type TraktUserVip = TraktPublicUser & { vi_og: boolean; vip_years: number; vip_cover_image: string; }; type TraktUser = T extends Extended ? TraktUserExtended : T extends 'vip' ? TraktUserVip : T extends 'private' ? TraktPrivateUser : T extends 'public' ? TraktPublicUser : TraktPublicUser & Partial; type TraktUserAccount = { timezone: string; date_format: string; time_24hr: boolean; cover_image: string; }; type TraktUserConnections = { facebook: boolean; twitter: boolean; google: boolean; tumblr: boolean; medium: boolean; slack: boolean; apple: boolean; dropbox: boolean; microsoft: boolean; }; type TraktUserLimits = { list: { count: number; item_count: number; }; watchlist: { item_count: number; }; favorites: { item_count: number; }; recommendations: { item_count: number; }; }; type TraktUserSettings = { user: TraktUserExtended; account: TraktUserAccount; connections: TraktUserConnections; sharing_text: { watching: string; watched: string; rated: string; }; limits: TraktUserLimits; }; type TraktUserFollowRequest = { id: number; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ requested_at: string; user: T extends Extended ? TraktUser : TraktUser<'public'>; }; type TraktUserFollower = { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ followed_at: string; user: T extends Extended ? TraktUser : TraktUser<'public'>; }; type TraktUserFollowing = TraktUserFollower; type TraktUserFriend = { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ friends_at: string; user: T extends Extended ? TraktUser : TraktUser<'public'>; }; type TraktUserFollow = { /** * If the user has a private profile, the follow request will require approval (approved_at will be null). * If a user is public, they will be followed immediately (approved_at will have a date). * * If this user is already being followed, a 409 HTTP status code will returned. * * Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ approved_at?: string; user: T extends Extended ? TraktUser : TraktUser<'public'>; }; type TraktUserFilter = { rank: number; id: number; section: 'movies' | 'shows' | 'calendars' | 'search'; name: string; path: string; query: string; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; }; type TraktUserHiddenItem = { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ hidden_at: string; } & { type: T extends Any ? 'movie' | 'show' : T; } & (T extends 'movie' ? { movie: TraktMovie; } : T extends 'show' ? { show: TraktShow; } : { movie: TraktMovie; } | { show: TraktShow; }); type BaseTraktUserHiddenRequestItem = { movies: (Partial & Pick)[]; shows: (Partial & Pick & { seasons?: { number: number; }[]; })[]; seasons: (Partial & Pick)[]; users: (Partial & Pick)[]; }; type TraktUserHiddenRequest = { section: T extends Any ? 'calendar' | 'progress_watched' | 'progress_collected' | 'recommendations' | 'comments' : T; } & (T extends 'calendar' ? RequireAtLeastOne> : T extends 'progress_watched' ? RequireAtLeastOne> : T extends 'progress_collected' ? RequireAtLeastOne> : T extends 'recommendations' ? RequireAtLeastOne> : T extends 'comments' ? Pick : RequireAtLeastOne); type TraktUserHiddenAdded = { added: { movies: number; shows: number; seasons: number; users: number; }; not_found: { movies: Pick[]; shows: Pick[]; seasons: Pick[]; users: Pick[]; }; }; type TraktUserHiddenDeleted = { deleted: { movies: number; shows: number; seasons: number; users: number; }; not_found: { movies: Pick[]; shows: Pick[]; seasons: Pick[]; users: Pick[]; }; }; type TraktUserLike = T extends 'comment' ? TraktUserLikeComment : T extends 'list' ? TraktUserLikeList : TraktUserLikeComment | TraktUserLikeList; type TraktUserLikeList = { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ liked_at: string; type: 'list'; list: TraktList; }; type BaseTraktUserLikeComment = { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ liked_at: string; type: 'comment'; comment: TraktComment; }; type TraktUserLikeCommentExtended = BaseTraktUserLikeComment & { comment_type: T extends Any ? 'movie' | 'show' | 'season' | 'episode' | 'list' : T; } & Omit, 'type'>; type TraktUserLikeComment = E extends Extended ? TraktUserLikeCommentExtended : E extends Short ? BaseTraktUserLikeComment : TraktUserLikeCommentExtended | BaseTraktUserLikeComment; type TraktList = { name: string; description: string; privacy: 'private' | 'friends' | 'public' | 'link'; share_link: string; display_numbers: boolean; allow_comments: boolean; sort_by: 'rank' | 'added' | 'title' | 'released' | 'runtime' | 'popularity' | 'percentage' | 'votes' | 'my_rating' | 'random' | 'watched' | 'collected'; sort_how: 'asc' | 'desc'; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ created_at: string; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; item_count: number; comment_count: number; likes: number; ids: Pick; user: TraktUser; } & (T extends 'watchlist' ? { type: 'watchlist'; } : T extends 'favorites' ? { type: 'favorites'; } : T extends 'personal' ? { type: 'personal'; } : { type: T; }); type TraktListList = { like_count: number; comment_count: number; list: TraktList; }; type BaseTraktListItem = { rank: number; id: number; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ listed_at: string; notes: string; type: 'movie' | 'show' | 'season' | 'episode' | 'person'; }; type BaseTraktListMedia = { movie: TraktMovie; show: TraktShow; season: TraktSeason; episode: TraktEpisode; person: TraktPerson; }; type TraktListItem = BaseTraktListItem & (T extends 'movie' ? Pick & { type: 'movie'; } : T extends 'show' ? Pick & { type: 'show'; } : T extends 'season' ? Pick & { type: 'season'; } : T extends 'episode' ? Pick & { type: 'episode'; } : T extends 'list' ? Pick & { type: 'person'; } : Partial); type BaseTraktUserListItemMedia = { movie: Partial & Pick; show: Partial & Pick & { seasons?: Pick & { episodes?: Pick[]; }; }; season: Partial & Pick; episode: Partial & Pick; person: Partial & Pick; }; type TraktUserListItem = T extends 'movie' ? Pick : T extends 'show' ? Pick : T extends 'season' ? Pick : T extends 'episode' ? Pick : T extends 'person' ? Pick : RequireAtLeastOne; type TraktUserListItemRequest = { movies: { notes?: string; } & TraktUserListItem<'movie'>[]; shows: { notes?: string; } & TraktUserListItem<'show'>[]; seasons: { notes?: string; } & TraktUserListItem<'season'>[]; episodes: { notes?: string; } & TraktUserListItem<'episode'>[]; people: { notes?: string; } & TraktUserListItem<'person'>[]; }; type TraktUserListItemAddedRequest = { /** User slug */ id: string; /** List Trakt ID or Trakt slug */ list_id: string; } & Partial; type TraktUserListItemAdded = { added: { movies: number; shows: number; seasons: number; episodes: number; people: number; }; existing: { movies: number; shows: number; seasons: number; episodes: number; people: number; }; not_found: { movies: Pick[]; shows: Pick[]; seasons: Pick[]; episodes: Pick[]; people: Pick[]; }; list: { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; item_count: number; }; }; type TraktUserListItemRemoveRequest = { /** User slug */ id: string; /** List Trakt ID or Trakt slug */ list_id: string; } & { movies?: TraktUserListItem<'movie'>[]; shows?: TraktUserListItem<'show'>[]; seasons?: TraktUserListItem<'season'>[]; episodes?: TraktUserListItem<'episode'>[]; people?: TraktUserListItem<'person'>[]; }; type TraktUserListItemRemoved = { deleted: { movies: number; shows: number; seasons: number; episodes: number; people: number; }; not_found: { movies: Pick[]; shows: Pick[]; seasons: Pick[]; episodes: Pick[]; people: Pick[]; }; list: { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; item_count: number; }; }; type TraktListReordered = { updated: number; skipped_ids: number[]; list: { /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ updated_at: string; item_count: number; }; }; type TraktListItemsGetQuery = { /** User slug */ id: string; /** List Trakt ID or Trakt slug */ list_id: string; /** Type of list items */ type?: ('movies' | 'shows' | 'seasons' | 'episodes' | 'person') | ('movies' | 'shows' | 'seasons' | 'episodes' | 'person')[]; } & TraktApiParamsExtended & TraktApiParamsPagination; export type { TraktUserFollower as A, BaseTraktListItem as B, TraktUserFollowing as C, TraktUserFriend as D, TraktUserFollow as E, TraktUserFilter as F, TraktUserHiddenItem as G, TraktUserHiddenRequest as H, TraktUserHiddenAdded as I, TraktUserHiddenDeleted as J, TraktUserLike as K, TraktUserLikeList as L, TraktUserLikeComment as M, TraktComment as T, TraktCommentMedia as a, TraktCommentItem as b, TraktCommentRequest as c, TraktList as d, TraktListList as e, BaseTraktListMedia as f, TraktListItem as g, BaseTraktUserListItemMedia as h, TraktUserListItem as i, TraktUserListItemRequest as j, TraktUserListItemAddedRequest as k, TraktUserListItemAdded as l, TraktUserListItemRemoveRequest as m, TraktUserListItemRemoved as n, TraktListReordered as o, TraktListItemsGetQuery as p, TraktPrivateUser as q, TraktPublicUser as r, TraktUserExtended as s, TraktUserVip as t, TraktUser as u, TraktUserAccount as v, TraktUserConnections as w, TraktUserLimits as x, TraktUserSettings as y, TraktUserFollowRequest as z };