@fubar-it-co/tmdb-client 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/CHANGELOG.md +256 -0
- package/LICENSE +21 -0
- package/README.md +122 -0
- package/eslint.config.js +15 -0
- package/openapi-ts.config.ts +43 -0
- package/package.json +46 -0
- package/publish-local.sh +86 -0
- package/publish.sh +114 -0
- package/scripts/add-ts-nocheck.js +85 -0
- package/src/client/@tanstack/react-query.gen.ts +4398 -0
- package/src/client/client/client.gen.ts +289 -0
- package/src/client/client/index.ts +26 -0
- package/src/client/client/types.gen.ts +214 -0
- package/src/client/client/utils.gen.ts +317 -0
- package/src/client/client.gen.ts +19 -0
- package/src/client/core/auth.gen.ts +42 -0
- package/src/client/core/bodySerializer.gen.ts +85 -0
- package/src/client/core/params.gen.ts +170 -0
- package/src/client/core/pathSerializer.gen.ts +172 -0
- package/src/client/core/queryKeySerializer.gen.ts +118 -0
- package/src/client/core/serverSentEvents.gen.ts +244 -0
- package/src/client/core/types.gen.ts +105 -0
- package/src/client/core/utils.gen.ts +141 -0
- package/src/client/index.ts +6 -0
- package/src/client/sdk.gen.ts +1682 -0
- package/src/client/types.gen.ts +9574 -0
- package/src/index.ts +28 -0
- package/src/tmdb-config.ts +47 -0
- package/src/types/errors.ts +32 -0
- package/src/vite-env.d.ts +9 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,4398 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
|
|
5
|
+
|
|
6
|
+
import { client } from '../client.gen';
|
|
7
|
+
import { accountAddFavorite, accountAddToWatchlist, accountDetails, accountFavoriteTv, accountGetFavorites, accountLists, accountRatedMovies, accountRatedTv, accountRatedTvEpisodes, accountWatchlistMovies, accountWatchlistTv, alternativeNamesCopy, authenticationCreateGuestSession, authenticationCreateRequestToken, authenticationCreateSession, authenticationCreateSessionFromLogin, authenticationCreateSessionFromV4Token, authenticationDeleteSession, authenticationValidateKey, certificationMovieList, certificationsTvList, changesMovieList, changesPeopleList, changesTvList, collectionDetails, collectionImages, collectionTranslations, companyAlternativeNames, companyDetails, companyImages, configurationCountries, configurationDetails, configurationJobs, configurationLanguages, configurationPrimaryTranslations, configurationTimezones, creditDetails, detailsCopy, discoverMovie, discoverTv, findById, genreMovieList, genreTvList, guestSessionRatedMovies, guestSessionRatedTv, guestSessionRatedTvEpisodes, keywordDetails, keywordMovies, listAddMovie, listCheckItemStatus, listClear, listCreate, listDelete, listDetails, listRemoveMovie, listsCopy, movieAccountStates, movieAddRating, movieAlternativeTitles, movieChanges, movieCredits, movieDeleteRating, movieDetails, movieExternalIds, movieImages, movieKeywords, movieLatestId, movieLists, movieNowPlayingList, moviePopularList, movieRecommendations, movieReleaseDates, movieReviews, movieSimilar, movieTopRatedList, movieTranslations, movieUpcomingList, movieVideos, movieWatchProviders, networkDetails, type Options, personChanges, personCombinedCredits, personDetails, personExternalIds, personImages, personLatestId, personMovieCredits, personPopularList, personTaggedImages, personTvCredits, reviewDetails, searchCollection, searchCompany, searchKeyword, searchMovie, searchMulti, searchPerson, searchTv, translations, trendingAll, trendingMovies, trendingPeople, trendingTv, tvEpisodeAccountStates, tvEpisodeAddRating, tvEpisodeChangesById, tvEpisodeCredits, tvEpisodeDeleteRating, tvEpisodeDetails, tvEpisodeExternalIds, tvEpisodeGroupDetails, tvEpisodeImages, tvEpisodeTranslations, tvEpisodeVideos, tvSeasonAccountStates, tvSeasonAggregateCredits, tvSeasonChangesById, tvSeasonCredits, tvSeasonDetails, tvSeasonExternalIds, tvSeasonImages, tvSeasonTranslations, tvSeasonVideos, tvSeasonWatchProviders, tvSeriesAccountStates, tvSeriesAddRating, tvSeriesAggregateCredits, tvSeriesAiringTodayList, tvSeriesAlternativeTitles, tvSeriesChanges, tvSeriesContentRatings, tvSeriesCredits, tvSeriesDeleteRating, tvSeriesDetails, tvSeriesEpisodeGroups, tvSeriesExternalIds, tvSeriesImages, tvSeriesKeywords, tvSeriesLatestId, tvSeriesOnTheAirList, tvSeriesPopularList, tvSeriesRecommendations, tvSeriesReviews, tvSeriesScreenedTheatrically, tvSeriesSimilar, tvSeriesTopRatedList, tvSeriesTranslations, tvSeriesVideos, tvSeriesWatchProviders, watchProvidersAvailableRegions, watchProvidersMovieList, watchProviderTvList } from '../sdk.gen';
|
|
8
|
+
import type { AccountAddFavoriteData, AccountAddFavoriteResponse, AccountAddToWatchlistData, AccountAddToWatchlistResponse, AccountDetailsData, AccountDetailsResponse, AccountFavoriteTvData, AccountFavoriteTvResponse, AccountGetFavoritesData, AccountGetFavoritesResponse, AccountListsData, AccountListsResponse, AccountRatedMoviesData, AccountRatedMoviesResponse, AccountRatedTvData, AccountRatedTvEpisodesData, AccountRatedTvEpisodesResponse, AccountRatedTvResponse, AccountWatchlistMoviesData, AccountWatchlistMoviesResponse, AccountWatchlistTvData, AccountWatchlistTvResponse, AlternativeNamesCopyData, AlternativeNamesCopyResponse, AuthenticationCreateGuestSessionData, AuthenticationCreateGuestSessionResponse, AuthenticationCreateRequestTokenData, AuthenticationCreateRequestTokenResponse, AuthenticationCreateSessionData, AuthenticationCreateSessionFromLoginData, AuthenticationCreateSessionFromLoginResponse, AuthenticationCreateSessionFromV4TokenData, AuthenticationCreateSessionFromV4TokenResponse, AuthenticationCreateSessionResponse, AuthenticationDeleteSessionData, AuthenticationDeleteSessionResponse, AuthenticationValidateKeyData, AuthenticationValidateKeyError, AuthenticationValidateKeyResponse, CertificationMovieListData, CertificationMovieListResponse, CertificationsTvListData, CertificationsTvListResponse, ChangesMovieListData, ChangesMovieListResponse, ChangesPeopleListData, ChangesPeopleListResponse, ChangesTvListData, ChangesTvListResponse, CollectionDetailsData, CollectionDetailsResponse, CollectionImagesData, CollectionImagesResponse, CollectionTranslationsData, CollectionTranslationsResponse, CompanyAlternativeNamesData, CompanyAlternativeNamesResponse, CompanyDetailsData, CompanyDetailsResponse, CompanyImagesData, CompanyImagesResponse, ConfigurationCountriesData, ConfigurationCountriesResponse, ConfigurationDetailsData, ConfigurationDetailsResponse, ConfigurationJobsData, ConfigurationJobsResponse, ConfigurationLanguagesData, ConfigurationLanguagesResponse, ConfigurationPrimaryTranslationsData, ConfigurationPrimaryTranslationsResponse, ConfigurationTimezonesData, ConfigurationTimezonesResponse, CreditDetailsData, CreditDetailsResponse, DetailsCopyData, DetailsCopyResponse, DiscoverMovieData, DiscoverMovieResponse, DiscoverTvData, DiscoverTvResponse, FindByIdData, FindByIdResponse, GenreMovieListData, GenreMovieListResponse, GenreTvListData, GenreTvListResponse, GuestSessionRatedMoviesData, GuestSessionRatedMoviesResponse, GuestSessionRatedTvData, GuestSessionRatedTvEpisodesData, GuestSessionRatedTvEpisodesResponse, GuestSessionRatedTvResponse, KeywordDetailsData, KeywordDetailsResponse, KeywordMoviesData, KeywordMoviesResponse, ListAddMovieData, ListAddMovieResponse, ListCheckItemStatusData, ListCheckItemStatusResponse, ListClearData, ListClearResponse, ListCreateData, ListCreateResponse, ListDeleteData, ListDeleteResponse, ListDetailsData, ListDetailsResponse, ListRemoveMovieData, ListRemoveMovieResponse, ListsCopyData, ListsCopyResponse, MovieAccountStatesData, MovieAccountStatesResponse, MovieAddRatingData, MovieAddRatingResponse, MovieAlternativeTitlesData, MovieAlternativeTitlesResponse, MovieChangesData, MovieChangesResponse, MovieCreditsData, MovieCreditsResponse, MovieDeleteRatingData, MovieDeleteRatingResponse, MovieDetailsData, MovieDetailsResponse, MovieExternalIdsData, MovieExternalIdsResponse, MovieImagesData, MovieImagesResponse, MovieKeywordsData, MovieKeywordsResponse, MovieLatestIdData, MovieLatestIdResponse, MovieListsData, MovieListsResponse, MovieNowPlayingListData, MovieNowPlayingListResponse, MoviePopularListData, MoviePopularListResponse, MovieRecommendationsData, MovieRecommendationsResponse, MovieReleaseDatesData, MovieReleaseDatesResponse, MovieReviewsData, MovieReviewsResponse, MovieSimilarData, MovieSimilarResponse, MovieTopRatedListData, MovieTopRatedListResponse, MovieTranslationsData, MovieTranslationsResponse, MovieUpcomingListData, MovieUpcomingListResponse, MovieVideosData, MovieVideosResponse, MovieWatchProvidersData, MovieWatchProvidersResponse, NetworkDetailsData, NetworkDetailsResponse, PersonChangesData, PersonChangesResponse, PersonCombinedCreditsData, PersonCombinedCreditsResponse, PersonDetailsData, PersonDetailsResponse, PersonExternalIdsData, PersonExternalIdsResponse, PersonImagesData, PersonImagesResponse, PersonLatestIdData, PersonLatestIdResponse, PersonMovieCreditsData, PersonMovieCreditsResponse, PersonPopularListData, PersonPopularListResponse, PersonTaggedImagesData, PersonTaggedImagesResponse, PersonTvCreditsData, PersonTvCreditsResponse, ReviewDetailsData, ReviewDetailsResponse, SearchCollectionData, SearchCollectionResponse, SearchCompanyData, SearchCompanyResponse, SearchKeywordData, SearchKeywordResponse, SearchMovieData, SearchMovieResponse, SearchMultiData, SearchMultiResponse, SearchPersonData, SearchPersonResponse, SearchTvData, SearchTvResponse, TranslationsData, TranslationsResponse, TrendingAllData, TrendingAllResponse, TrendingMoviesData, TrendingMoviesResponse, TrendingPeopleData, TrendingPeopleResponse, TrendingTvData, TrendingTvResponse, TvEpisodeAccountStatesData, TvEpisodeAccountStatesResponse, TvEpisodeAddRatingData, TvEpisodeAddRatingResponse, TvEpisodeChangesByIdData, TvEpisodeChangesByIdResponse, TvEpisodeCreditsData, TvEpisodeCreditsResponse, TvEpisodeDeleteRatingData, TvEpisodeDeleteRatingResponse, TvEpisodeDetailsData, TvEpisodeDetailsResponse, TvEpisodeExternalIdsData, TvEpisodeExternalIdsResponse, TvEpisodeGroupDetailsData, TvEpisodeGroupDetailsResponse, TvEpisodeImagesData, TvEpisodeImagesResponse, TvEpisodeTranslationsData, TvEpisodeTranslationsResponse, TvEpisodeVideosData, TvEpisodeVideosResponse, TvSeasonAccountStatesData, TvSeasonAccountStatesResponse, TvSeasonAggregateCreditsData, TvSeasonAggregateCreditsResponse, TvSeasonChangesByIdData, TvSeasonChangesByIdResponse, TvSeasonCreditsData, TvSeasonCreditsResponse, TvSeasonDetailsData, TvSeasonDetailsResponse, TvSeasonExternalIdsData, TvSeasonExternalIdsResponse, TvSeasonImagesData, TvSeasonImagesResponse, TvSeasonTranslationsData, TvSeasonTranslationsResponse, TvSeasonVideosData, TvSeasonVideosResponse, TvSeasonWatchProvidersData, TvSeasonWatchProvidersResponse, TvSeriesAccountStatesData, TvSeriesAccountStatesResponse, TvSeriesAddRatingData, TvSeriesAddRatingResponse, TvSeriesAggregateCreditsData, TvSeriesAggregateCreditsResponse, TvSeriesAiringTodayListData, TvSeriesAiringTodayListResponse, TvSeriesAlternativeTitlesData, TvSeriesAlternativeTitlesResponse, TvSeriesChangesData, TvSeriesChangesResponse, TvSeriesContentRatingsData, TvSeriesContentRatingsResponse, TvSeriesCreditsData, TvSeriesCreditsResponse, TvSeriesDeleteRatingData, TvSeriesDeleteRatingResponse, TvSeriesDetailsData, TvSeriesDetailsResponse, TvSeriesEpisodeGroupsData, TvSeriesEpisodeGroupsResponse, TvSeriesExternalIdsData, TvSeriesExternalIdsResponse, TvSeriesImagesData, TvSeriesImagesResponse, TvSeriesKeywordsData, TvSeriesKeywordsResponse, TvSeriesLatestIdData, TvSeriesLatestIdResponse, TvSeriesOnTheAirListData, TvSeriesOnTheAirListResponse, TvSeriesPopularListData, TvSeriesPopularListResponse, TvSeriesRecommendationsData, TvSeriesRecommendationsResponse, TvSeriesReviewsData, TvSeriesReviewsResponse, TvSeriesScreenedTheatricallyData, TvSeriesScreenedTheatricallyResponse, TvSeriesSimilarData, TvSeriesSimilarResponse, TvSeriesTopRatedListData, TvSeriesTopRatedListResponse, TvSeriesTranslationsData, TvSeriesTranslationsResponse, TvSeriesVideosData, TvSeriesVideosResponse, TvSeriesWatchProvidersData, TvSeriesWatchProvidersResponse, WatchProvidersAvailableRegionsData, WatchProvidersAvailableRegionsResponse, WatchProvidersMovieListData, WatchProvidersMovieListResponse, WatchProviderTvListData, WatchProviderTvListResponse } from '../types.gen';
|
|
9
|
+
|
|
10
|
+
export type QueryKey<TOptions extends Options> = [
|
|
11
|
+
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
|
12
|
+
_id: string;
|
|
13
|
+
_infinite?: boolean;
|
|
14
|
+
tags?: ReadonlyArray<string>;
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray<string>): [
|
|
19
|
+
QueryKey<TOptions>[0]
|
|
20
|
+
] => {
|
|
21
|
+
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0];
|
|
22
|
+
if (infinite) {
|
|
23
|
+
params._infinite = infinite;
|
|
24
|
+
}
|
|
25
|
+
if (tags) {
|
|
26
|
+
params.tags = tags;
|
|
27
|
+
}
|
|
28
|
+
if (options?.body) {
|
|
29
|
+
params.body = options.body;
|
|
30
|
+
}
|
|
31
|
+
if (options?.headers) {
|
|
32
|
+
params.headers = options.headers;
|
|
33
|
+
}
|
|
34
|
+
if (options?.path) {
|
|
35
|
+
params.path = options.path;
|
|
36
|
+
}
|
|
37
|
+
if (options?.query) {
|
|
38
|
+
params.query = options.query;
|
|
39
|
+
}
|
|
40
|
+
return [params];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const authenticationValidateKeyQueryKey = (options?: Options<AuthenticationValidateKeyData>) => createQueryKey('authenticationValidateKey', options);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Validate Key
|
|
47
|
+
*
|
|
48
|
+
* Test your API Key to see if it's valid.
|
|
49
|
+
*/
|
|
50
|
+
export const authenticationValidateKeyOptions = (options?: Options<AuthenticationValidateKeyData>) => queryOptions<AuthenticationValidateKeyResponse, AuthenticationValidateKeyError, AuthenticationValidateKeyResponse, ReturnType<typeof authenticationValidateKeyQueryKey>>({
|
|
51
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
52
|
+
const { data } = await authenticationValidateKey({
|
|
53
|
+
...options,
|
|
54
|
+
...queryKey[0],
|
|
55
|
+
signal,
|
|
56
|
+
throwOnError: true
|
|
57
|
+
});
|
|
58
|
+
return data;
|
|
59
|
+
},
|
|
60
|
+
queryKey: authenticationValidateKeyQueryKey(options)
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const accountDetailsQueryKey = (options: Options<AccountDetailsData>) => createQueryKey('accountDetails', options);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Details
|
|
67
|
+
*
|
|
68
|
+
* Get the public details of an account on TMDB.
|
|
69
|
+
*/
|
|
70
|
+
export const accountDetailsOptions = (options: Options<AccountDetailsData>) => queryOptions<AccountDetailsResponse, DefaultError, AccountDetailsResponse, ReturnType<typeof accountDetailsQueryKey>>({
|
|
71
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
72
|
+
const { data } = await accountDetails({
|
|
73
|
+
...options,
|
|
74
|
+
...queryKey[0],
|
|
75
|
+
signal,
|
|
76
|
+
throwOnError: true
|
|
77
|
+
});
|
|
78
|
+
return data;
|
|
79
|
+
},
|
|
80
|
+
queryKey: accountDetailsQueryKey(options)
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Add Favorite
|
|
85
|
+
*
|
|
86
|
+
* Mark a movie or TV show as a favourite.
|
|
87
|
+
*/
|
|
88
|
+
export const accountAddFavoriteMutation = (options?: Partial<Options<AccountAddFavoriteData>>): UseMutationOptions<AccountAddFavoriteResponse, DefaultError, Options<AccountAddFavoriteData>> => {
|
|
89
|
+
const mutationOptions: UseMutationOptions<AccountAddFavoriteResponse, DefaultError, Options<AccountAddFavoriteData>> = {
|
|
90
|
+
mutationFn: async (fnOptions) => {
|
|
91
|
+
const { data } = await accountAddFavorite({
|
|
92
|
+
...options,
|
|
93
|
+
...fnOptions,
|
|
94
|
+
throwOnError: true
|
|
95
|
+
});
|
|
96
|
+
return data;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return mutationOptions;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Add To Watchlist
|
|
104
|
+
*
|
|
105
|
+
* Add a movie or TV show to your watchlist.
|
|
106
|
+
*/
|
|
107
|
+
export const accountAddToWatchlistMutation = (options?: Partial<Options<AccountAddToWatchlistData>>): UseMutationOptions<AccountAddToWatchlistResponse, DefaultError, Options<AccountAddToWatchlistData>> => {
|
|
108
|
+
const mutationOptions: UseMutationOptions<AccountAddToWatchlistResponse, DefaultError, Options<AccountAddToWatchlistData>> = {
|
|
109
|
+
mutationFn: async (fnOptions) => {
|
|
110
|
+
const { data } = await accountAddToWatchlist({
|
|
111
|
+
...options,
|
|
112
|
+
...fnOptions,
|
|
113
|
+
throwOnError: true
|
|
114
|
+
});
|
|
115
|
+
return data;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return mutationOptions;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const accountGetFavoritesQueryKey = (options: Options<AccountGetFavoritesData>) => createQueryKey('accountGetFavorites', options);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Favorite Movies
|
|
125
|
+
*
|
|
126
|
+
* Get a users list of favourite movies.
|
|
127
|
+
*/
|
|
128
|
+
export const accountGetFavoritesOptions = (options: Options<AccountGetFavoritesData>) => queryOptions<AccountGetFavoritesResponse, DefaultError, AccountGetFavoritesResponse, ReturnType<typeof accountGetFavoritesQueryKey>>({
|
|
129
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
130
|
+
const { data } = await accountGetFavorites({
|
|
131
|
+
...options,
|
|
132
|
+
...queryKey[0],
|
|
133
|
+
signal,
|
|
134
|
+
throwOnError: true
|
|
135
|
+
});
|
|
136
|
+
return data;
|
|
137
|
+
},
|
|
138
|
+
queryKey: accountGetFavoritesQueryKey(options)
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const createInfiniteParams = <K extends Pick<QueryKey<Options>[0], 'body' | 'headers' | 'path' | 'query'>>(queryKey: QueryKey<Options>, page: K) => {
|
|
142
|
+
const params = { ...queryKey[0] };
|
|
143
|
+
if (page.body) {
|
|
144
|
+
params.body = {
|
|
145
|
+
...queryKey[0].body as any,
|
|
146
|
+
...page.body as any
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (page.headers) {
|
|
150
|
+
params.headers = {
|
|
151
|
+
...queryKey[0].headers,
|
|
152
|
+
...page.headers
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (page.path) {
|
|
156
|
+
params.path = {
|
|
157
|
+
...queryKey[0].path as any,
|
|
158
|
+
...page.path as any
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (page.query) {
|
|
162
|
+
params.query = {
|
|
163
|
+
...queryKey[0].query as any,
|
|
164
|
+
...page.query as any
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return params as unknown as typeof page;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const accountGetFavoritesInfiniteQueryKey = (options: Options<AccountGetFavoritesData>): QueryKey<Options<AccountGetFavoritesData>> => createQueryKey('accountGetFavorites', options, true);
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Favorite Movies
|
|
174
|
+
*
|
|
175
|
+
* Get a users list of favourite movies.
|
|
176
|
+
*/
|
|
177
|
+
export const accountGetFavoritesInfiniteOptions = (options: Options<AccountGetFavoritesData>) => infiniteQueryOptions<AccountGetFavoritesResponse, DefaultError, InfiniteData<AccountGetFavoritesResponse>, QueryKey<Options<AccountGetFavoritesData>>, number | Pick<QueryKey<Options<AccountGetFavoritesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
{
|
|
180
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
const page: Pick<QueryKey<Options<AccountGetFavoritesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
183
|
+
query: {
|
|
184
|
+
page: pageParam
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const params = createInfiniteParams(queryKey, page);
|
|
188
|
+
const { data } = await accountGetFavorites({
|
|
189
|
+
...options,
|
|
190
|
+
...params,
|
|
191
|
+
signal,
|
|
192
|
+
throwOnError: true
|
|
193
|
+
});
|
|
194
|
+
return data;
|
|
195
|
+
},
|
|
196
|
+
queryKey: accountGetFavoritesInfiniteQueryKey(options)
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
export const accountFavoriteTvQueryKey = (options: Options<AccountFavoriteTvData>) => createQueryKey('accountFavoriteTv', options);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Favorite TV
|
|
203
|
+
*
|
|
204
|
+
* Get a users list of favourite TV shows.
|
|
205
|
+
*/
|
|
206
|
+
export const accountFavoriteTvOptions = (options: Options<AccountFavoriteTvData>) => queryOptions<AccountFavoriteTvResponse, DefaultError, AccountFavoriteTvResponse, ReturnType<typeof accountFavoriteTvQueryKey>>({
|
|
207
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
208
|
+
const { data } = await accountFavoriteTv({
|
|
209
|
+
...options,
|
|
210
|
+
...queryKey[0],
|
|
211
|
+
signal,
|
|
212
|
+
throwOnError: true
|
|
213
|
+
});
|
|
214
|
+
return data;
|
|
215
|
+
},
|
|
216
|
+
queryKey: accountFavoriteTvQueryKey(options)
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export const accountFavoriteTvInfiniteQueryKey = (options: Options<AccountFavoriteTvData>): QueryKey<Options<AccountFavoriteTvData>> => createQueryKey('accountFavoriteTv', options, true);
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Favorite TV
|
|
223
|
+
*
|
|
224
|
+
* Get a users list of favourite TV shows.
|
|
225
|
+
*/
|
|
226
|
+
export const accountFavoriteTvInfiniteOptions = (options: Options<AccountFavoriteTvData>) => infiniteQueryOptions<AccountFavoriteTvResponse, DefaultError, InfiniteData<AccountFavoriteTvResponse>, QueryKey<Options<AccountFavoriteTvData>>, number | Pick<QueryKey<Options<AccountFavoriteTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
{
|
|
229
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
230
|
+
// @ts-ignore
|
|
231
|
+
const page: Pick<QueryKey<Options<AccountFavoriteTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
232
|
+
query: {
|
|
233
|
+
page: pageParam
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const params = createInfiniteParams(queryKey, page);
|
|
237
|
+
const { data } = await accountFavoriteTv({
|
|
238
|
+
...options,
|
|
239
|
+
...params,
|
|
240
|
+
signal,
|
|
241
|
+
throwOnError: true
|
|
242
|
+
});
|
|
243
|
+
return data;
|
|
244
|
+
},
|
|
245
|
+
queryKey: accountFavoriteTvInfiniteQueryKey(options)
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export const accountListsQueryKey = (options: Options<AccountListsData>) => createQueryKey('accountLists', options);
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Lists
|
|
252
|
+
*
|
|
253
|
+
* Get a users list of custom lists.
|
|
254
|
+
*/
|
|
255
|
+
export const accountListsOptions = (options: Options<AccountListsData>) => queryOptions<AccountListsResponse, DefaultError, AccountListsResponse, ReturnType<typeof accountListsQueryKey>>({
|
|
256
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
257
|
+
const { data } = await accountLists({
|
|
258
|
+
...options,
|
|
259
|
+
...queryKey[0],
|
|
260
|
+
signal,
|
|
261
|
+
throwOnError: true
|
|
262
|
+
});
|
|
263
|
+
return data;
|
|
264
|
+
},
|
|
265
|
+
queryKey: accountListsQueryKey(options)
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
export const accountListsInfiniteQueryKey = (options: Options<AccountListsData>): QueryKey<Options<AccountListsData>> => createQueryKey('accountLists', options, true);
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Lists
|
|
272
|
+
*
|
|
273
|
+
* Get a users list of custom lists.
|
|
274
|
+
*/
|
|
275
|
+
export const accountListsInfiniteOptions = (options: Options<AccountListsData>) => infiniteQueryOptions<AccountListsResponse, DefaultError, InfiniteData<AccountListsResponse>, QueryKey<Options<AccountListsData>>, number | Pick<QueryKey<Options<AccountListsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
{
|
|
278
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
279
|
+
// @ts-ignore
|
|
280
|
+
const page: Pick<QueryKey<Options<AccountListsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
281
|
+
query: {
|
|
282
|
+
page: pageParam
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const params = createInfiniteParams(queryKey, page);
|
|
286
|
+
const { data } = await accountLists({
|
|
287
|
+
...options,
|
|
288
|
+
...params,
|
|
289
|
+
signal,
|
|
290
|
+
throwOnError: true
|
|
291
|
+
});
|
|
292
|
+
return data;
|
|
293
|
+
},
|
|
294
|
+
queryKey: accountListsInfiniteQueryKey(options)
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
export const accountRatedMoviesQueryKey = (options: Options<AccountRatedMoviesData>) => createQueryKey('accountRatedMovies', options);
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Rated Movies
|
|
301
|
+
*
|
|
302
|
+
* Get a users list of rated movies.
|
|
303
|
+
*/
|
|
304
|
+
export const accountRatedMoviesOptions = (options: Options<AccountRatedMoviesData>) => queryOptions<AccountRatedMoviesResponse, DefaultError, AccountRatedMoviesResponse, ReturnType<typeof accountRatedMoviesQueryKey>>({
|
|
305
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
306
|
+
const { data } = await accountRatedMovies({
|
|
307
|
+
...options,
|
|
308
|
+
...queryKey[0],
|
|
309
|
+
signal,
|
|
310
|
+
throwOnError: true
|
|
311
|
+
});
|
|
312
|
+
return data;
|
|
313
|
+
},
|
|
314
|
+
queryKey: accountRatedMoviesQueryKey(options)
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
export const accountRatedMoviesInfiniteQueryKey = (options: Options<AccountRatedMoviesData>): QueryKey<Options<AccountRatedMoviesData>> => createQueryKey('accountRatedMovies', options, true);
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Rated Movies
|
|
321
|
+
*
|
|
322
|
+
* Get a users list of rated movies.
|
|
323
|
+
*/
|
|
324
|
+
export const accountRatedMoviesInfiniteOptions = (options: Options<AccountRatedMoviesData>) => infiniteQueryOptions<AccountRatedMoviesResponse, DefaultError, InfiniteData<AccountRatedMoviesResponse>, QueryKey<Options<AccountRatedMoviesData>>, number | Pick<QueryKey<Options<AccountRatedMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
325
|
+
// @ts-ignore
|
|
326
|
+
{
|
|
327
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
328
|
+
// @ts-ignore
|
|
329
|
+
const page: Pick<QueryKey<Options<AccountRatedMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
330
|
+
query: {
|
|
331
|
+
page: pageParam
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
const params = createInfiniteParams(queryKey, page);
|
|
335
|
+
const { data } = await accountRatedMovies({
|
|
336
|
+
...options,
|
|
337
|
+
...params,
|
|
338
|
+
signal,
|
|
339
|
+
throwOnError: true
|
|
340
|
+
});
|
|
341
|
+
return data;
|
|
342
|
+
},
|
|
343
|
+
queryKey: accountRatedMoviesInfiniteQueryKey(options)
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export const accountRatedTvQueryKey = (options: Options<AccountRatedTvData>) => createQueryKey('accountRatedTv', options);
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Rated TV
|
|
350
|
+
*
|
|
351
|
+
* Get a users list of rated TV shows.
|
|
352
|
+
*/
|
|
353
|
+
export const accountRatedTvOptions = (options: Options<AccountRatedTvData>) => queryOptions<AccountRatedTvResponse, DefaultError, AccountRatedTvResponse, ReturnType<typeof accountRatedTvQueryKey>>({
|
|
354
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
355
|
+
const { data } = await accountRatedTv({
|
|
356
|
+
...options,
|
|
357
|
+
...queryKey[0],
|
|
358
|
+
signal,
|
|
359
|
+
throwOnError: true
|
|
360
|
+
});
|
|
361
|
+
return data;
|
|
362
|
+
},
|
|
363
|
+
queryKey: accountRatedTvQueryKey(options)
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
export const accountRatedTvInfiniteQueryKey = (options: Options<AccountRatedTvData>): QueryKey<Options<AccountRatedTvData>> => createQueryKey('accountRatedTv', options, true);
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Rated TV
|
|
370
|
+
*
|
|
371
|
+
* Get a users list of rated TV shows.
|
|
372
|
+
*/
|
|
373
|
+
export const accountRatedTvInfiniteOptions = (options: Options<AccountRatedTvData>) => infiniteQueryOptions<AccountRatedTvResponse, DefaultError, InfiniteData<AccountRatedTvResponse>, QueryKey<Options<AccountRatedTvData>>, number | Pick<QueryKey<Options<AccountRatedTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
374
|
+
// @ts-ignore
|
|
375
|
+
{
|
|
376
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
377
|
+
// @ts-ignore
|
|
378
|
+
const page: Pick<QueryKey<Options<AccountRatedTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
379
|
+
query: {
|
|
380
|
+
page: pageParam
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const params = createInfiniteParams(queryKey, page);
|
|
384
|
+
const { data } = await accountRatedTv({
|
|
385
|
+
...options,
|
|
386
|
+
...params,
|
|
387
|
+
signal,
|
|
388
|
+
throwOnError: true
|
|
389
|
+
});
|
|
390
|
+
return data;
|
|
391
|
+
},
|
|
392
|
+
queryKey: accountRatedTvInfiniteQueryKey(options)
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
export const accountRatedTvEpisodesQueryKey = (options: Options<AccountRatedTvEpisodesData>) => createQueryKey('accountRatedTvEpisodes', options);
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Rated TV Episodes
|
|
399
|
+
*
|
|
400
|
+
* Get a users list of rated TV episodes.
|
|
401
|
+
*/
|
|
402
|
+
export const accountRatedTvEpisodesOptions = (options: Options<AccountRatedTvEpisodesData>) => queryOptions<AccountRatedTvEpisodesResponse, DefaultError, AccountRatedTvEpisodesResponse, ReturnType<typeof accountRatedTvEpisodesQueryKey>>({
|
|
403
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
404
|
+
const { data } = await accountRatedTvEpisodes({
|
|
405
|
+
...options,
|
|
406
|
+
...queryKey[0],
|
|
407
|
+
signal,
|
|
408
|
+
throwOnError: true
|
|
409
|
+
});
|
|
410
|
+
return data;
|
|
411
|
+
},
|
|
412
|
+
queryKey: accountRatedTvEpisodesQueryKey(options)
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
export const accountRatedTvEpisodesInfiniteQueryKey = (options: Options<AccountRatedTvEpisodesData>): QueryKey<Options<AccountRatedTvEpisodesData>> => createQueryKey('accountRatedTvEpisodes', options, true);
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Rated TV Episodes
|
|
419
|
+
*
|
|
420
|
+
* Get a users list of rated TV episodes.
|
|
421
|
+
*/
|
|
422
|
+
export const accountRatedTvEpisodesInfiniteOptions = (options: Options<AccountRatedTvEpisodesData>) => infiniteQueryOptions<AccountRatedTvEpisodesResponse, DefaultError, InfiniteData<AccountRatedTvEpisodesResponse>, QueryKey<Options<AccountRatedTvEpisodesData>>, number | Pick<QueryKey<Options<AccountRatedTvEpisodesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
423
|
+
// @ts-ignore
|
|
424
|
+
{
|
|
425
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
426
|
+
// @ts-ignore
|
|
427
|
+
const page: Pick<QueryKey<Options<AccountRatedTvEpisodesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
428
|
+
query: {
|
|
429
|
+
page: pageParam
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
const params = createInfiniteParams(queryKey, page);
|
|
433
|
+
const { data } = await accountRatedTvEpisodes({
|
|
434
|
+
...options,
|
|
435
|
+
...params,
|
|
436
|
+
signal,
|
|
437
|
+
throwOnError: true
|
|
438
|
+
});
|
|
439
|
+
return data;
|
|
440
|
+
},
|
|
441
|
+
queryKey: accountRatedTvEpisodesInfiniteQueryKey(options)
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
export const accountWatchlistMoviesQueryKey = (options: Options<AccountWatchlistMoviesData>) => createQueryKey('accountWatchlistMovies', options);
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Watchlist Movies
|
|
448
|
+
*
|
|
449
|
+
* Get a list of movies added to a users watchlist.
|
|
450
|
+
*/
|
|
451
|
+
export const accountWatchlistMoviesOptions = (options: Options<AccountWatchlistMoviesData>) => queryOptions<AccountWatchlistMoviesResponse, DefaultError, AccountWatchlistMoviesResponse, ReturnType<typeof accountWatchlistMoviesQueryKey>>({
|
|
452
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
453
|
+
const { data } = await accountWatchlistMovies({
|
|
454
|
+
...options,
|
|
455
|
+
...queryKey[0],
|
|
456
|
+
signal,
|
|
457
|
+
throwOnError: true
|
|
458
|
+
});
|
|
459
|
+
return data;
|
|
460
|
+
},
|
|
461
|
+
queryKey: accountWatchlistMoviesQueryKey(options)
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
export const accountWatchlistMoviesInfiniteQueryKey = (options: Options<AccountWatchlistMoviesData>): QueryKey<Options<AccountWatchlistMoviesData>> => createQueryKey('accountWatchlistMovies', options, true);
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Watchlist Movies
|
|
468
|
+
*
|
|
469
|
+
* Get a list of movies added to a users watchlist.
|
|
470
|
+
*/
|
|
471
|
+
export const accountWatchlistMoviesInfiniteOptions = (options: Options<AccountWatchlistMoviesData>) => infiniteQueryOptions<AccountWatchlistMoviesResponse, DefaultError, InfiniteData<AccountWatchlistMoviesResponse>, QueryKey<Options<AccountWatchlistMoviesData>>, number | Pick<QueryKey<Options<AccountWatchlistMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
472
|
+
// @ts-ignore
|
|
473
|
+
{
|
|
474
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
475
|
+
// @ts-ignore
|
|
476
|
+
const page: Pick<QueryKey<Options<AccountWatchlistMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
477
|
+
query: {
|
|
478
|
+
page: pageParam
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
const params = createInfiniteParams(queryKey, page);
|
|
482
|
+
const { data } = await accountWatchlistMovies({
|
|
483
|
+
...options,
|
|
484
|
+
...params,
|
|
485
|
+
signal,
|
|
486
|
+
throwOnError: true
|
|
487
|
+
});
|
|
488
|
+
return data;
|
|
489
|
+
},
|
|
490
|
+
queryKey: accountWatchlistMoviesInfiniteQueryKey(options)
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
export const accountWatchlistTvQueryKey = (options: Options<AccountWatchlistTvData>) => createQueryKey('accountWatchlistTv', options);
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Watchlist TV
|
|
497
|
+
*
|
|
498
|
+
* Get a list of TV shows added to a users watchlist.
|
|
499
|
+
*/
|
|
500
|
+
export const accountWatchlistTvOptions = (options: Options<AccountWatchlistTvData>) => queryOptions<AccountWatchlistTvResponse, DefaultError, AccountWatchlistTvResponse, ReturnType<typeof accountWatchlistTvQueryKey>>({
|
|
501
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
502
|
+
const { data } = await accountWatchlistTv({
|
|
503
|
+
...options,
|
|
504
|
+
...queryKey[0],
|
|
505
|
+
signal,
|
|
506
|
+
throwOnError: true
|
|
507
|
+
});
|
|
508
|
+
return data;
|
|
509
|
+
},
|
|
510
|
+
queryKey: accountWatchlistTvQueryKey(options)
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
export const accountWatchlistTvInfiniteQueryKey = (options: Options<AccountWatchlistTvData>): QueryKey<Options<AccountWatchlistTvData>> => createQueryKey('accountWatchlistTv', options, true);
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Watchlist TV
|
|
517
|
+
*
|
|
518
|
+
* Get a list of TV shows added to a users watchlist.
|
|
519
|
+
*/
|
|
520
|
+
export const accountWatchlistTvInfiniteOptions = (options: Options<AccountWatchlistTvData>) => infiniteQueryOptions<AccountWatchlistTvResponse, DefaultError, InfiniteData<AccountWatchlistTvResponse>, QueryKey<Options<AccountWatchlistTvData>>, number | Pick<QueryKey<Options<AccountWatchlistTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
521
|
+
// @ts-ignore
|
|
522
|
+
{
|
|
523
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
524
|
+
// @ts-ignore
|
|
525
|
+
const page: Pick<QueryKey<Options<AccountWatchlistTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
526
|
+
query: {
|
|
527
|
+
page: pageParam
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
const params = createInfiniteParams(queryKey, page);
|
|
531
|
+
const { data } = await accountWatchlistTv({
|
|
532
|
+
...options,
|
|
533
|
+
...params,
|
|
534
|
+
signal,
|
|
535
|
+
throwOnError: true
|
|
536
|
+
});
|
|
537
|
+
return data;
|
|
538
|
+
},
|
|
539
|
+
queryKey: accountWatchlistTvInfiniteQueryKey(options)
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
export const authenticationCreateGuestSessionQueryKey = (options?: Options<AuthenticationCreateGuestSessionData>) => createQueryKey('authenticationCreateGuestSession', options);
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Create Guest Session
|
|
546
|
+
*/
|
|
547
|
+
export const authenticationCreateGuestSessionOptions = (options?: Options<AuthenticationCreateGuestSessionData>) => queryOptions<AuthenticationCreateGuestSessionResponse, DefaultError, AuthenticationCreateGuestSessionResponse, ReturnType<typeof authenticationCreateGuestSessionQueryKey>>({
|
|
548
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
549
|
+
const { data } = await authenticationCreateGuestSession({
|
|
550
|
+
...options,
|
|
551
|
+
...queryKey[0],
|
|
552
|
+
signal,
|
|
553
|
+
throwOnError: true
|
|
554
|
+
});
|
|
555
|
+
return data;
|
|
556
|
+
},
|
|
557
|
+
queryKey: authenticationCreateGuestSessionQueryKey(options)
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
export const authenticationCreateRequestTokenQueryKey = (options?: Options<AuthenticationCreateRequestTokenData>) => createQueryKey('authenticationCreateRequestToken', options);
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Create Request Token
|
|
564
|
+
*/
|
|
565
|
+
export const authenticationCreateRequestTokenOptions = (options?: Options<AuthenticationCreateRequestTokenData>) => queryOptions<AuthenticationCreateRequestTokenResponse, DefaultError, AuthenticationCreateRequestTokenResponse, ReturnType<typeof authenticationCreateRequestTokenQueryKey>>({
|
|
566
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
567
|
+
const { data } = await authenticationCreateRequestToken({
|
|
568
|
+
...options,
|
|
569
|
+
...queryKey[0],
|
|
570
|
+
signal,
|
|
571
|
+
throwOnError: true
|
|
572
|
+
});
|
|
573
|
+
return data;
|
|
574
|
+
},
|
|
575
|
+
queryKey: authenticationCreateRequestTokenQueryKey(options)
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Create Session
|
|
580
|
+
*/
|
|
581
|
+
export const authenticationCreateSessionMutation = (options?: Partial<Options<AuthenticationCreateSessionData>>): UseMutationOptions<AuthenticationCreateSessionResponse, DefaultError, Options<AuthenticationCreateSessionData>> => {
|
|
582
|
+
const mutationOptions: UseMutationOptions<AuthenticationCreateSessionResponse, DefaultError, Options<AuthenticationCreateSessionData>> = {
|
|
583
|
+
mutationFn: async (fnOptions) => {
|
|
584
|
+
const { data } = await authenticationCreateSession({
|
|
585
|
+
...options,
|
|
586
|
+
...fnOptions,
|
|
587
|
+
throwOnError: true
|
|
588
|
+
});
|
|
589
|
+
return data;
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
return mutationOptions;
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Create Session (from v4 token)
|
|
597
|
+
*/
|
|
598
|
+
export const authenticationCreateSessionFromV4TokenMutation = (options?: Partial<Options<AuthenticationCreateSessionFromV4TokenData>>): UseMutationOptions<AuthenticationCreateSessionFromV4TokenResponse, DefaultError, Options<AuthenticationCreateSessionFromV4TokenData>> => {
|
|
599
|
+
const mutationOptions: UseMutationOptions<AuthenticationCreateSessionFromV4TokenResponse, DefaultError, Options<AuthenticationCreateSessionFromV4TokenData>> = {
|
|
600
|
+
mutationFn: async (fnOptions) => {
|
|
601
|
+
const { data } = await authenticationCreateSessionFromV4Token({
|
|
602
|
+
...options,
|
|
603
|
+
...fnOptions,
|
|
604
|
+
throwOnError: true
|
|
605
|
+
});
|
|
606
|
+
return data;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
return mutationOptions;
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Create Session (with login)
|
|
614
|
+
*
|
|
615
|
+
* This method allows an application to validate a request token by entering a username and password.
|
|
616
|
+
*/
|
|
617
|
+
export const authenticationCreateSessionFromLoginMutation = (options?: Partial<Options<AuthenticationCreateSessionFromLoginData>>): UseMutationOptions<AuthenticationCreateSessionFromLoginResponse, DefaultError, Options<AuthenticationCreateSessionFromLoginData>> => {
|
|
618
|
+
const mutationOptions: UseMutationOptions<AuthenticationCreateSessionFromLoginResponse, DefaultError, Options<AuthenticationCreateSessionFromLoginData>> = {
|
|
619
|
+
mutationFn: async (fnOptions) => {
|
|
620
|
+
const { data } = await authenticationCreateSessionFromLogin({
|
|
621
|
+
...options,
|
|
622
|
+
...fnOptions,
|
|
623
|
+
throwOnError: true
|
|
624
|
+
});
|
|
625
|
+
return data;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
return mutationOptions;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Delete Session
|
|
633
|
+
*/
|
|
634
|
+
export const authenticationDeleteSessionMutation = (options?: Partial<Options<AuthenticationDeleteSessionData>>): UseMutationOptions<AuthenticationDeleteSessionResponse, DefaultError, Options<AuthenticationDeleteSessionData>> => {
|
|
635
|
+
const mutationOptions: UseMutationOptions<AuthenticationDeleteSessionResponse, DefaultError, Options<AuthenticationDeleteSessionData>> = {
|
|
636
|
+
mutationFn: async (fnOptions) => {
|
|
637
|
+
const { data } = await authenticationDeleteSession({
|
|
638
|
+
...options,
|
|
639
|
+
...fnOptions,
|
|
640
|
+
throwOnError: true
|
|
641
|
+
});
|
|
642
|
+
return data;
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
return mutationOptions;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
export const certificationMovieListQueryKey = (options?: Options<CertificationMovieListData>) => createQueryKey('certificationMovieList', options);
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Movie Certifications
|
|
652
|
+
*
|
|
653
|
+
* Get an up to date list of the officially supported movie certifications on TMDB.
|
|
654
|
+
*/
|
|
655
|
+
export const certificationMovieListOptions = (options?: Options<CertificationMovieListData>) => queryOptions<CertificationMovieListResponse, DefaultError, CertificationMovieListResponse, ReturnType<typeof certificationMovieListQueryKey>>({
|
|
656
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
657
|
+
const { data } = await certificationMovieList({
|
|
658
|
+
...options,
|
|
659
|
+
...queryKey[0],
|
|
660
|
+
signal,
|
|
661
|
+
throwOnError: true
|
|
662
|
+
});
|
|
663
|
+
return data;
|
|
664
|
+
},
|
|
665
|
+
queryKey: certificationMovieListQueryKey(options)
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
export const certificationsTvListQueryKey = (options?: Options<CertificationsTvListData>) => createQueryKey('certificationsTvList', options);
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* TV Certifications
|
|
672
|
+
*/
|
|
673
|
+
export const certificationsTvListOptions = (options?: Options<CertificationsTvListData>) => queryOptions<CertificationsTvListResponse, DefaultError, CertificationsTvListResponse, ReturnType<typeof certificationsTvListQueryKey>>({
|
|
674
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
675
|
+
const { data } = await certificationsTvList({
|
|
676
|
+
...options,
|
|
677
|
+
...queryKey[0],
|
|
678
|
+
signal,
|
|
679
|
+
throwOnError: true
|
|
680
|
+
});
|
|
681
|
+
return data;
|
|
682
|
+
},
|
|
683
|
+
queryKey: certificationsTvListQueryKey(options)
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
export const changesMovieListQueryKey = (options?: Options<ChangesMovieListData>) => createQueryKey('changesMovieList', options);
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Movie List
|
|
690
|
+
*
|
|
691
|
+
* Get a list of all of the movie ids that have been changed in the past 24 hours.
|
|
692
|
+
*/
|
|
693
|
+
export const changesMovieListOptions = (options?: Options<ChangesMovieListData>) => queryOptions<ChangesMovieListResponse, DefaultError, ChangesMovieListResponse, ReturnType<typeof changesMovieListQueryKey>>({
|
|
694
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
695
|
+
const { data } = await changesMovieList({
|
|
696
|
+
...options,
|
|
697
|
+
...queryKey[0],
|
|
698
|
+
signal,
|
|
699
|
+
throwOnError: true
|
|
700
|
+
});
|
|
701
|
+
return data;
|
|
702
|
+
},
|
|
703
|
+
queryKey: changesMovieListQueryKey(options)
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
export const changesMovieListInfiniteQueryKey = (options?: Options<ChangesMovieListData>): QueryKey<Options<ChangesMovieListData>> => createQueryKey('changesMovieList', options, true);
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Movie List
|
|
710
|
+
*
|
|
711
|
+
* Get a list of all of the movie ids that have been changed in the past 24 hours.
|
|
712
|
+
*/
|
|
713
|
+
export const changesMovieListInfiniteOptions = (options?: Options<ChangesMovieListData>) => infiniteQueryOptions<ChangesMovieListResponse, DefaultError, InfiniteData<ChangesMovieListResponse>, QueryKey<Options<ChangesMovieListData>>, number | Pick<QueryKey<Options<ChangesMovieListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
714
|
+
// @ts-ignore
|
|
715
|
+
{
|
|
716
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
717
|
+
// @ts-ignore
|
|
718
|
+
const page: Pick<QueryKey<Options<ChangesMovieListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
719
|
+
query: {
|
|
720
|
+
page: pageParam
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
const params = createInfiniteParams(queryKey, page);
|
|
724
|
+
const { data } = await changesMovieList({
|
|
725
|
+
...options,
|
|
726
|
+
...params,
|
|
727
|
+
signal,
|
|
728
|
+
throwOnError: true
|
|
729
|
+
});
|
|
730
|
+
return data;
|
|
731
|
+
},
|
|
732
|
+
queryKey: changesMovieListInfiniteQueryKey(options)
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
export const changesPeopleListQueryKey = (options?: Options<ChangesPeopleListData>) => createQueryKey('changesPeopleList', options);
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* People List
|
|
739
|
+
*/
|
|
740
|
+
export const changesPeopleListOptions = (options?: Options<ChangesPeopleListData>) => queryOptions<ChangesPeopleListResponse, DefaultError, ChangesPeopleListResponse, ReturnType<typeof changesPeopleListQueryKey>>({
|
|
741
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
742
|
+
const { data } = await changesPeopleList({
|
|
743
|
+
...options,
|
|
744
|
+
...queryKey[0],
|
|
745
|
+
signal,
|
|
746
|
+
throwOnError: true
|
|
747
|
+
});
|
|
748
|
+
return data;
|
|
749
|
+
},
|
|
750
|
+
queryKey: changesPeopleListQueryKey(options)
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
export const changesPeopleListInfiniteQueryKey = (options?: Options<ChangesPeopleListData>): QueryKey<Options<ChangesPeopleListData>> => createQueryKey('changesPeopleList', options, true);
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* People List
|
|
757
|
+
*/
|
|
758
|
+
export const changesPeopleListInfiniteOptions = (options?: Options<ChangesPeopleListData>) => infiniteQueryOptions<ChangesPeopleListResponse, DefaultError, InfiniteData<ChangesPeopleListResponse>, QueryKey<Options<ChangesPeopleListData>>, number | Pick<QueryKey<Options<ChangesPeopleListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
759
|
+
// @ts-ignore
|
|
760
|
+
{
|
|
761
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
762
|
+
// @ts-ignore
|
|
763
|
+
const page: Pick<QueryKey<Options<ChangesPeopleListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
764
|
+
query: {
|
|
765
|
+
page: pageParam
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
const params = createInfiniteParams(queryKey, page);
|
|
769
|
+
const { data } = await changesPeopleList({
|
|
770
|
+
...options,
|
|
771
|
+
...params,
|
|
772
|
+
signal,
|
|
773
|
+
throwOnError: true
|
|
774
|
+
});
|
|
775
|
+
return data;
|
|
776
|
+
},
|
|
777
|
+
queryKey: changesPeopleListInfiniteQueryKey(options)
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
export const changesTvListQueryKey = (options?: Options<ChangesTvListData>) => createQueryKey('changesTvList', options);
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* TV List
|
|
784
|
+
*/
|
|
785
|
+
export const changesTvListOptions = (options?: Options<ChangesTvListData>) => queryOptions<ChangesTvListResponse, DefaultError, ChangesTvListResponse, ReturnType<typeof changesTvListQueryKey>>({
|
|
786
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
787
|
+
const { data } = await changesTvList({
|
|
788
|
+
...options,
|
|
789
|
+
...queryKey[0],
|
|
790
|
+
signal,
|
|
791
|
+
throwOnError: true
|
|
792
|
+
});
|
|
793
|
+
return data;
|
|
794
|
+
},
|
|
795
|
+
queryKey: changesTvListQueryKey(options)
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
export const changesTvListInfiniteQueryKey = (options?: Options<ChangesTvListData>): QueryKey<Options<ChangesTvListData>> => createQueryKey('changesTvList', options, true);
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* TV List
|
|
802
|
+
*/
|
|
803
|
+
export const changesTvListInfiniteOptions = (options?: Options<ChangesTvListData>) => infiniteQueryOptions<ChangesTvListResponse, DefaultError, InfiniteData<ChangesTvListResponse>, QueryKey<Options<ChangesTvListData>>, number | Pick<QueryKey<Options<ChangesTvListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
804
|
+
// @ts-ignore
|
|
805
|
+
{
|
|
806
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
807
|
+
// @ts-ignore
|
|
808
|
+
const page: Pick<QueryKey<Options<ChangesTvListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
809
|
+
query: {
|
|
810
|
+
page: pageParam
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
const params = createInfiniteParams(queryKey, page);
|
|
814
|
+
const { data } = await changesTvList({
|
|
815
|
+
...options,
|
|
816
|
+
...params,
|
|
817
|
+
signal,
|
|
818
|
+
throwOnError: true
|
|
819
|
+
});
|
|
820
|
+
return data;
|
|
821
|
+
},
|
|
822
|
+
queryKey: changesTvListInfiniteQueryKey(options)
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
export const collectionDetailsQueryKey = (options: Options<CollectionDetailsData>) => createQueryKey('collectionDetails', options);
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Details
|
|
829
|
+
*
|
|
830
|
+
* Get collection details by ID.
|
|
831
|
+
*/
|
|
832
|
+
export const collectionDetailsOptions = (options: Options<CollectionDetailsData>) => queryOptions<CollectionDetailsResponse, DefaultError, CollectionDetailsResponse, ReturnType<typeof collectionDetailsQueryKey>>({
|
|
833
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
834
|
+
const { data } = await collectionDetails({
|
|
835
|
+
...options,
|
|
836
|
+
...queryKey[0],
|
|
837
|
+
signal,
|
|
838
|
+
throwOnError: true
|
|
839
|
+
});
|
|
840
|
+
return data;
|
|
841
|
+
},
|
|
842
|
+
queryKey: collectionDetailsQueryKey(options)
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
export const collectionImagesQueryKey = (options: Options<CollectionImagesData>) => createQueryKey('collectionImages', options);
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Images
|
|
849
|
+
*
|
|
850
|
+
* Get the images that belong to a collection.
|
|
851
|
+
*/
|
|
852
|
+
export const collectionImagesOptions = (options: Options<CollectionImagesData>) => queryOptions<CollectionImagesResponse, DefaultError, CollectionImagesResponse, ReturnType<typeof collectionImagesQueryKey>>({
|
|
853
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
854
|
+
const { data } = await collectionImages({
|
|
855
|
+
...options,
|
|
856
|
+
...queryKey[0],
|
|
857
|
+
signal,
|
|
858
|
+
throwOnError: true
|
|
859
|
+
});
|
|
860
|
+
return data;
|
|
861
|
+
},
|
|
862
|
+
queryKey: collectionImagesQueryKey(options)
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
export const collectionTranslationsQueryKey = (options: Options<CollectionTranslationsData>) => createQueryKey('collectionTranslations', options);
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Translations
|
|
869
|
+
*/
|
|
870
|
+
export const collectionTranslationsOptions = (options: Options<CollectionTranslationsData>) => queryOptions<CollectionTranslationsResponse, DefaultError, CollectionTranslationsResponse, ReturnType<typeof collectionTranslationsQueryKey>>({
|
|
871
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
872
|
+
const { data } = await collectionTranslations({
|
|
873
|
+
...options,
|
|
874
|
+
...queryKey[0],
|
|
875
|
+
signal,
|
|
876
|
+
throwOnError: true
|
|
877
|
+
});
|
|
878
|
+
return data;
|
|
879
|
+
},
|
|
880
|
+
queryKey: collectionTranslationsQueryKey(options)
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
export const companyDetailsQueryKey = (options: Options<CompanyDetailsData>) => createQueryKey('companyDetails', options);
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Details
|
|
887
|
+
*
|
|
888
|
+
* Get the company details by ID.
|
|
889
|
+
*/
|
|
890
|
+
export const companyDetailsOptions = (options: Options<CompanyDetailsData>) => queryOptions<CompanyDetailsResponse, DefaultError, CompanyDetailsResponse, ReturnType<typeof companyDetailsQueryKey>>({
|
|
891
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
892
|
+
const { data } = await companyDetails({
|
|
893
|
+
...options,
|
|
894
|
+
...queryKey[0],
|
|
895
|
+
signal,
|
|
896
|
+
throwOnError: true
|
|
897
|
+
});
|
|
898
|
+
return data;
|
|
899
|
+
},
|
|
900
|
+
queryKey: companyDetailsQueryKey(options)
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
export const companyAlternativeNamesQueryKey = (options: Options<CompanyAlternativeNamesData>) => createQueryKey('companyAlternativeNames', options);
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Alternative Names
|
|
907
|
+
*
|
|
908
|
+
* Get the company details by ID.
|
|
909
|
+
*/
|
|
910
|
+
export const companyAlternativeNamesOptions = (options: Options<CompanyAlternativeNamesData>) => queryOptions<CompanyAlternativeNamesResponse, DefaultError, CompanyAlternativeNamesResponse, ReturnType<typeof companyAlternativeNamesQueryKey>>({
|
|
911
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
912
|
+
const { data } = await companyAlternativeNames({
|
|
913
|
+
...options,
|
|
914
|
+
...queryKey[0],
|
|
915
|
+
signal,
|
|
916
|
+
throwOnError: true
|
|
917
|
+
});
|
|
918
|
+
return data;
|
|
919
|
+
},
|
|
920
|
+
queryKey: companyAlternativeNamesQueryKey(options)
|
|
921
|
+
});
|
|
922
|
+
|
|
923
|
+
export const companyImagesQueryKey = (options: Options<CompanyImagesData>) => createQueryKey('companyImages', options);
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Images
|
|
927
|
+
*
|
|
928
|
+
* Get the company logos by id.
|
|
929
|
+
*/
|
|
930
|
+
export const companyImagesOptions = (options: Options<CompanyImagesData>) => queryOptions<CompanyImagesResponse, DefaultError, CompanyImagesResponse, ReturnType<typeof companyImagesQueryKey>>({
|
|
931
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
932
|
+
const { data } = await companyImages({
|
|
933
|
+
...options,
|
|
934
|
+
...queryKey[0],
|
|
935
|
+
signal,
|
|
936
|
+
throwOnError: true
|
|
937
|
+
});
|
|
938
|
+
return data;
|
|
939
|
+
},
|
|
940
|
+
queryKey: companyImagesQueryKey(options)
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
export const configurationDetailsQueryKey = (options?: Options<ConfigurationDetailsData>) => createQueryKey('configurationDetails', options);
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Details
|
|
947
|
+
*
|
|
948
|
+
* Query the API configuration details.
|
|
949
|
+
*/
|
|
950
|
+
export const configurationDetailsOptions = (options?: Options<ConfigurationDetailsData>) => queryOptions<ConfigurationDetailsResponse, DefaultError, ConfigurationDetailsResponse, ReturnType<typeof configurationDetailsQueryKey>>({
|
|
951
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
952
|
+
const { data } = await configurationDetails({
|
|
953
|
+
...options,
|
|
954
|
+
...queryKey[0],
|
|
955
|
+
signal,
|
|
956
|
+
throwOnError: true
|
|
957
|
+
});
|
|
958
|
+
return data;
|
|
959
|
+
},
|
|
960
|
+
queryKey: configurationDetailsQueryKey(options)
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
export const configurationCountriesQueryKey = (options?: Options<ConfigurationCountriesData>) => createQueryKey('configurationCountries', options);
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Countries
|
|
967
|
+
*
|
|
968
|
+
* Get the list of countries (ISO 3166-1 tags) used throughout TMDB.
|
|
969
|
+
*/
|
|
970
|
+
export const configurationCountriesOptions = (options?: Options<ConfigurationCountriesData>) => queryOptions<ConfigurationCountriesResponse, DefaultError, ConfigurationCountriesResponse, ReturnType<typeof configurationCountriesQueryKey>>({
|
|
971
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
972
|
+
const { data } = await configurationCountries({
|
|
973
|
+
...options,
|
|
974
|
+
...queryKey[0],
|
|
975
|
+
signal,
|
|
976
|
+
throwOnError: true
|
|
977
|
+
});
|
|
978
|
+
return data;
|
|
979
|
+
},
|
|
980
|
+
queryKey: configurationCountriesQueryKey(options)
|
|
981
|
+
});
|
|
982
|
+
|
|
983
|
+
export const configurationJobsQueryKey = (options?: Options<ConfigurationJobsData>) => createQueryKey('configurationJobs', options);
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Jobs
|
|
987
|
+
*
|
|
988
|
+
* Get the list of the jobs and departments we use on TMDB.
|
|
989
|
+
*/
|
|
990
|
+
export const configurationJobsOptions = (options?: Options<ConfigurationJobsData>) => queryOptions<ConfigurationJobsResponse, DefaultError, ConfigurationJobsResponse, ReturnType<typeof configurationJobsQueryKey>>({
|
|
991
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
992
|
+
const { data } = await configurationJobs({
|
|
993
|
+
...options,
|
|
994
|
+
...queryKey[0],
|
|
995
|
+
signal,
|
|
996
|
+
throwOnError: true
|
|
997
|
+
});
|
|
998
|
+
return data;
|
|
999
|
+
},
|
|
1000
|
+
queryKey: configurationJobsQueryKey(options)
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
export const configurationLanguagesQueryKey = (options?: Options<ConfigurationLanguagesData>) => createQueryKey('configurationLanguages', options);
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Languages
|
|
1007
|
+
*
|
|
1008
|
+
* Get the list of languages (ISO 639-1 tags) used throughout TMDB.
|
|
1009
|
+
*/
|
|
1010
|
+
export const configurationLanguagesOptions = (options?: Options<ConfigurationLanguagesData>) => queryOptions<ConfigurationLanguagesResponse, DefaultError, ConfigurationLanguagesResponse, ReturnType<typeof configurationLanguagesQueryKey>>({
|
|
1011
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1012
|
+
const { data } = await configurationLanguages({
|
|
1013
|
+
...options,
|
|
1014
|
+
...queryKey[0],
|
|
1015
|
+
signal,
|
|
1016
|
+
throwOnError: true
|
|
1017
|
+
});
|
|
1018
|
+
return data;
|
|
1019
|
+
},
|
|
1020
|
+
queryKey: configurationLanguagesQueryKey(options)
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
export const configurationPrimaryTranslationsQueryKey = (options?: Options<ConfigurationPrimaryTranslationsData>) => createQueryKey('configurationPrimaryTranslations', options);
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Primary Translations
|
|
1027
|
+
*
|
|
1028
|
+
* Get a list of the officially supported translations on TMDB.
|
|
1029
|
+
*/
|
|
1030
|
+
export const configurationPrimaryTranslationsOptions = (options?: Options<ConfigurationPrimaryTranslationsData>) => queryOptions<ConfigurationPrimaryTranslationsResponse, DefaultError, ConfigurationPrimaryTranslationsResponse, ReturnType<typeof configurationPrimaryTranslationsQueryKey>>({
|
|
1031
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1032
|
+
const { data } = await configurationPrimaryTranslations({
|
|
1033
|
+
...options,
|
|
1034
|
+
...queryKey[0],
|
|
1035
|
+
signal,
|
|
1036
|
+
throwOnError: true
|
|
1037
|
+
});
|
|
1038
|
+
return data;
|
|
1039
|
+
},
|
|
1040
|
+
queryKey: configurationPrimaryTranslationsQueryKey(options)
|
|
1041
|
+
});
|
|
1042
|
+
|
|
1043
|
+
export const configurationTimezonesQueryKey = (options?: Options<ConfigurationTimezonesData>) => createQueryKey('configurationTimezones', options);
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Timezones
|
|
1047
|
+
*
|
|
1048
|
+
* Get the list of timezones used throughout TMDB.
|
|
1049
|
+
*/
|
|
1050
|
+
export const configurationTimezonesOptions = (options?: Options<ConfigurationTimezonesData>) => queryOptions<ConfigurationTimezonesResponse, DefaultError, ConfigurationTimezonesResponse, ReturnType<typeof configurationTimezonesQueryKey>>({
|
|
1051
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1052
|
+
const { data } = await configurationTimezones({
|
|
1053
|
+
...options,
|
|
1054
|
+
...queryKey[0],
|
|
1055
|
+
signal,
|
|
1056
|
+
throwOnError: true
|
|
1057
|
+
});
|
|
1058
|
+
return data;
|
|
1059
|
+
},
|
|
1060
|
+
queryKey: configurationTimezonesQueryKey(options)
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
export const creditDetailsQueryKey = (options: Options<CreditDetailsData>) => createQueryKey('creditDetails', options);
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Details
|
|
1067
|
+
*
|
|
1068
|
+
* Get a movie or TV credit details by ID.
|
|
1069
|
+
*/
|
|
1070
|
+
export const creditDetailsOptions = (options: Options<CreditDetailsData>) => queryOptions<CreditDetailsResponse, DefaultError, CreditDetailsResponse, ReturnType<typeof creditDetailsQueryKey>>({
|
|
1071
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1072
|
+
const { data } = await creditDetails({
|
|
1073
|
+
...options,
|
|
1074
|
+
...queryKey[0],
|
|
1075
|
+
signal,
|
|
1076
|
+
throwOnError: true
|
|
1077
|
+
});
|
|
1078
|
+
return data;
|
|
1079
|
+
},
|
|
1080
|
+
queryKey: creditDetailsQueryKey(options)
|
|
1081
|
+
});
|
|
1082
|
+
|
|
1083
|
+
export const discoverMovieQueryKey = (options?: Options<DiscoverMovieData>) => createQueryKey('discoverMovie', options);
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* Movie
|
|
1087
|
+
*
|
|
1088
|
+
* Find movies using over 30 filters and sort options.
|
|
1089
|
+
*/
|
|
1090
|
+
export const discoverMovieOptions = (options?: Options<DiscoverMovieData>) => queryOptions<DiscoverMovieResponse, DefaultError, DiscoverMovieResponse, ReturnType<typeof discoverMovieQueryKey>>({
|
|
1091
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1092
|
+
const { data } = await discoverMovie({
|
|
1093
|
+
...options,
|
|
1094
|
+
...queryKey[0],
|
|
1095
|
+
signal,
|
|
1096
|
+
throwOnError: true
|
|
1097
|
+
});
|
|
1098
|
+
return data;
|
|
1099
|
+
},
|
|
1100
|
+
queryKey: discoverMovieQueryKey(options)
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
export const discoverMovieInfiniteQueryKey = (options?: Options<DiscoverMovieData>): QueryKey<Options<DiscoverMovieData>> => createQueryKey('discoverMovie', options, true);
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Movie
|
|
1107
|
+
*
|
|
1108
|
+
* Find movies using over 30 filters and sort options.
|
|
1109
|
+
*/
|
|
1110
|
+
export const discoverMovieInfiniteOptions = (options?: Options<DiscoverMovieData>) => infiniteQueryOptions<DiscoverMovieResponse, DefaultError, InfiniteData<DiscoverMovieResponse>, QueryKey<Options<DiscoverMovieData>>, number | Pick<QueryKey<Options<DiscoverMovieData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1111
|
+
// @ts-ignore
|
|
1112
|
+
{
|
|
1113
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1114
|
+
// @ts-ignore
|
|
1115
|
+
const page: Pick<QueryKey<Options<DiscoverMovieData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1116
|
+
query: {
|
|
1117
|
+
page: pageParam
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1121
|
+
const { data } = await discoverMovie({
|
|
1122
|
+
...options,
|
|
1123
|
+
...params,
|
|
1124
|
+
signal,
|
|
1125
|
+
throwOnError: true
|
|
1126
|
+
});
|
|
1127
|
+
return data;
|
|
1128
|
+
},
|
|
1129
|
+
queryKey: discoverMovieInfiniteQueryKey(options)
|
|
1130
|
+
});
|
|
1131
|
+
|
|
1132
|
+
export const discoverTvQueryKey = (options?: Options<DiscoverTvData>) => createQueryKey('discoverTv', options);
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* TV
|
|
1136
|
+
*
|
|
1137
|
+
* Find TV shows using over 30 filters and sort options.
|
|
1138
|
+
*/
|
|
1139
|
+
export const discoverTvOptions = (options?: Options<DiscoverTvData>) => queryOptions<DiscoverTvResponse, DefaultError, DiscoverTvResponse, ReturnType<typeof discoverTvQueryKey>>({
|
|
1140
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1141
|
+
const { data } = await discoverTv({
|
|
1142
|
+
...options,
|
|
1143
|
+
...queryKey[0],
|
|
1144
|
+
signal,
|
|
1145
|
+
throwOnError: true
|
|
1146
|
+
});
|
|
1147
|
+
return data;
|
|
1148
|
+
},
|
|
1149
|
+
queryKey: discoverTvQueryKey(options)
|
|
1150
|
+
});
|
|
1151
|
+
|
|
1152
|
+
export const discoverTvInfiniteQueryKey = (options?: Options<DiscoverTvData>): QueryKey<Options<DiscoverTvData>> => createQueryKey('discoverTv', options, true);
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* TV
|
|
1156
|
+
*
|
|
1157
|
+
* Find TV shows using over 30 filters and sort options.
|
|
1158
|
+
*/
|
|
1159
|
+
export const discoverTvInfiniteOptions = (options?: Options<DiscoverTvData>) => infiniteQueryOptions<DiscoverTvResponse, DefaultError, InfiniteData<DiscoverTvResponse>, QueryKey<Options<DiscoverTvData>>, number | Pick<QueryKey<Options<DiscoverTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1160
|
+
// @ts-ignore
|
|
1161
|
+
{
|
|
1162
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1163
|
+
// @ts-ignore
|
|
1164
|
+
const page: Pick<QueryKey<Options<DiscoverTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1165
|
+
query: {
|
|
1166
|
+
page: pageParam
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1170
|
+
const { data } = await discoverTv({
|
|
1171
|
+
...options,
|
|
1172
|
+
...params,
|
|
1173
|
+
signal,
|
|
1174
|
+
throwOnError: true
|
|
1175
|
+
});
|
|
1176
|
+
return data;
|
|
1177
|
+
},
|
|
1178
|
+
queryKey: discoverTvInfiniteQueryKey(options)
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
export const findByIdQueryKey = (options: Options<FindByIdData>) => createQueryKey('findById', options);
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Find By ID
|
|
1185
|
+
*
|
|
1186
|
+
* Find data by external ID's.
|
|
1187
|
+
*/
|
|
1188
|
+
export const findByIdOptions = (options: Options<FindByIdData>) => queryOptions<FindByIdResponse, DefaultError, FindByIdResponse, ReturnType<typeof findByIdQueryKey>>({
|
|
1189
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1190
|
+
const { data } = await findById({
|
|
1191
|
+
...options,
|
|
1192
|
+
...queryKey[0],
|
|
1193
|
+
signal,
|
|
1194
|
+
throwOnError: true
|
|
1195
|
+
});
|
|
1196
|
+
return data;
|
|
1197
|
+
},
|
|
1198
|
+
queryKey: findByIdQueryKey(options)
|
|
1199
|
+
});
|
|
1200
|
+
|
|
1201
|
+
export const genreMovieListQueryKey = (options?: Options<GenreMovieListData>) => createQueryKey('genreMovieList', options);
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Movie List
|
|
1205
|
+
*
|
|
1206
|
+
* Get the list of official genres for movies.
|
|
1207
|
+
*/
|
|
1208
|
+
export const genreMovieListOptions = (options?: Options<GenreMovieListData>) => queryOptions<GenreMovieListResponse, DefaultError, GenreMovieListResponse, ReturnType<typeof genreMovieListQueryKey>>({
|
|
1209
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1210
|
+
const { data } = await genreMovieList({
|
|
1211
|
+
...options,
|
|
1212
|
+
...queryKey[0],
|
|
1213
|
+
signal,
|
|
1214
|
+
throwOnError: true
|
|
1215
|
+
});
|
|
1216
|
+
return data;
|
|
1217
|
+
},
|
|
1218
|
+
queryKey: genreMovieListQueryKey(options)
|
|
1219
|
+
});
|
|
1220
|
+
|
|
1221
|
+
export const genreTvListQueryKey = (options?: Options<GenreTvListData>) => createQueryKey('genreTvList', options);
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* TV List
|
|
1225
|
+
*
|
|
1226
|
+
* Get the list of official genres for TV shows.
|
|
1227
|
+
*/
|
|
1228
|
+
export const genreTvListOptions = (options?: Options<GenreTvListData>) => queryOptions<GenreTvListResponse, DefaultError, GenreTvListResponse, ReturnType<typeof genreTvListQueryKey>>({
|
|
1229
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1230
|
+
const { data } = await genreTvList({
|
|
1231
|
+
...options,
|
|
1232
|
+
...queryKey[0],
|
|
1233
|
+
signal,
|
|
1234
|
+
throwOnError: true
|
|
1235
|
+
});
|
|
1236
|
+
return data;
|
|
1237
|
+
},
|
|
1238
|
+
queryKey: genreTvListQueryKey(options)
|
|
1239
|
+
});
|
|
1240
|
+
|
|
1241
|
+
export const guestSessionRatedMoviesQueryKey = (options: Options<GuestSessionRatedMoviesData>) => createQueryKey('guestSessionRatedMovies', options);
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Rated Movies
|
|
1245
|
+
*
|
|
1246
|
+
* Get the rated movies for a guest session.
|
|
1247
|
+
*/
|
|
1248
|
+
export const guestSessionRatedMoviesOptions = (options: Options<GuestSessionRatedMoviesData>) => queryOptions<GuestSessionRatedMoviesResponse, DefaultError, GuestSessionRatedMoviesResponse, ReturnType<typeof guestSessionRatedMoviesQueryKey>>({
|
|
1249
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1250
|
+
const { data } = await guestSessionRatedMovies({
|
|
1251
|
+
...options,
|
|
1252
|
+
...queryKey[0],
|
|
1253
|
+
signal,
|
|
1254
|
+
throwOnError: true
|
|
1255
|
+
});
|
|
1256
|
+
return data;
|
|
1257
|
+
},
|
|
1258
|
+
queryKey: guestSessionRatedMoviesQueryKey(options)
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
export const guestSessionRatedMoviesInfiniteQueryKey = (options: Options<GuestSessionRatedMoviesData>): QueryKey<Options<GuestSessionRatedMoviesData>> => createQueryKey('guestSessionRatedMovies', options, true);
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Rated Movies
|
|
1265
|
+
*
|
|
1266
|
+
* Get the rated movies for a guest session.
|
|
1267
|
+
*/
|
|
1268
|
+
export const guestSessionRatedMoviesInfiniteOptions = (options: Options<GuestSessionRatedMoviesData>) => infiniteQueryOptions<GuestSessionRatedMoviesResponse, DefaultError, InfiniteData<GuestSessionRatedMoviesResponse>, QueryKey<Options<GuestSessionRatedMoviesData>>, number | Pick<QueryKey<Options<GuestSessionRatedMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1269
|
+
// @ts-ignore
|
|
1270
|
+
{
|
|
1271
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1272
|
+
// @ts-ignore
|
|
1273
|
+
const page: Pick<QueryKey<Options<GuestSessionRatedMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1274
|
+
query: {
|
|
1275
|
+
page: pageParam
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1279
|
+
const { data } = await guestSessionRatedMovies({
|
|
1280
|
+
...options,
|
|
1281
|
+
...params,
|
|
1282
|
+
signal,
|
|
1283
|
+
throwOnError: true
|
|
1284
|
+
});
|
|
1285
|
+
return data;
|
|
1286
|
+
},
|
|
1287
|
+
queryKey: guestSessionRatedMoviesInfiniteQueryKey(options)
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
export const guestSessionRatedTvQueryKey = (options: Options<GuestSessionRatedTvData>) => createQueryKey('guestSessionRatedTv', options);
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Rated TV
|
|
1294
|
+
*
|
|
1295
|
+
* Get the rated TV shows for a guest session.
|
|
1296
|
+
*/
|
|
1297
|
+
export const guestSessionRatedTvOptions = (options: Options<GuestSessionRatedTvData>) => queryOptions<GuestSessionRatedTvResponse, DefaultError, GuestSessionRatedTvResponse, ReturnType<typeof guestSessionRatedTvQueryKey>>({
|
|
1298
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1299
|
+
const { data } = await guestSessionRatedTv({
|
|
1300
|
+
...options,
|
|
1301
|
+
...queryKey[0],
|
|
1302
|
+
signal,
|
|
1303
|
+
throwOnError: true
|
|
1304
|
+
});
|
|
1305
|
+
return data;
|
|
1306
|
+
},
|
|
1307
|
+
queryKey: guestSessionRatedTvQueryKey(options)
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
export const guestSessionRatedTvInfiniteQueryKey = (options: Options<GuestSessionRatedTvData>): QueryKey<Options<GuestSessionRatedTvData>> => createQueryKey('guestSessionRatedTv', options, true);
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Rated TV
|
|
1314
|
+
*
|
|
1315
|
+
* Get the rated TV shows for a guest session.
|
|
1316
|
+
*/
|
|
1317
|
+
export const guestSessionRatedTvInfiniteOptions = (options: Options<GuestSessionRatedTvData>) => infiniteQueryOptions<GuestSessionRatedTvResponse, DefaultError, InfiniteData<GuestSessionRatedTvResponse>, QueryKey<Options<GuestSessionRatedTvData>>, number | Pick<QueryKey<Options<GuestSessionRatedTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1318
|
+
// @ts-ignore
|
|
1319
|
+
{
|
|
1320
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1321
|
+
// @ts-ignore
|
|
1322
|
+
const page: Pick<QueryKey<Options<GuestSessionRatedTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1323
|
+
query: {
|
|
1324
|
+
page: pageParam
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1328
|
+
const { data } = await guestSessionRatedTv({
|
|
1329
|
+
...options,
|
|
1330
|
+
...params,
|
|
1331
|
+
signal,
|
|
1332
|
+
throwOnError: true
|
|
1333
|
+
});
|
|
1334
|
+
return data;
|
|
1335
|
+
},
|
|
1336
|
+
queryKey: guestSessionRatedTvInfiniteQueryKey(options)
|
|
1337
|
+
});
|
|
1338
|
+
|
|
1339
|
+
export const guestSessionRatedTvEpisodesQueryKey = (options: Options<GuestSessionRatedTvEpisodesData>) => createQueryKey('guestSessionRatedTvEpisodes', options);
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Rated TV Episodes
|
|
1343
|
+
*
|
|
1344
|
+
* Get the rated TV episodes for a guest session.
|
|
1345
|
+
*/
|
|
1346
|
+
export const guestSessionRatedTvEpisodesOptions = (options: Options<GuestSessionRatedTvEpisodesData>) => queryOptions<GuestSessionRatedTvEpisodesResponse, DefaultError, GuestSessionRatedTvEpisodesResponse, ReturnType<typeof guestSessionRatedTvEpisodesQueryKey>>({
|
|
1347
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1348
|
+
const { data } = await guestSessionRatedTvEpisodes({
|
|
1349
|
+
...options,
|
|
1350
|
+
...queryKey[0],
|
|
1351
|
+
signal,
|
|
1352
|
+
throwOnError: true
|
|
1353
|
+
});
|
|
1354
|
+
return data;
|
|
1355
|
+
},
|
|
1356
|
+
queryKey: guestSessionRatedTvEpisodesQueryKey(options)
|
|
1357
|
+
});
|
|
1358
|
+
|
|
1359
|
+
export const guestSessionRatedTvEpisodesInfiniteQueryKey = (options: Options<GuestSessionRatedTvEpisodesData>): QueryKey<Options<GuestSessionRatedTvEpisodesData>> => createQueryKey('guestSessionRatedTvEpisodes', options, true);
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* Rated TV Episodes
|
|
1363
|
+
*
|
|
1364
|
+
* Get the rated TV episodes for a guest session.
|
|
1365
|
+
*/
|
|
1366
|
+
export const guestSessionRatedTvEpisodesInfiniteOptions = (options: Options<GuestSessionRatedTvEpisodesData>) => infiniteQueryOptions<GuestSessionRatedTvEpisodesResponse, DefaultError, InfiniteData<GuestSessionRatedTvEpisodesResponse>, QueryKey<Options<GuestSessionRatedTvEpisodesData>>, number | Pick<QueryKey<Options<GuestSessionRatedTvEpisodesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1367
|
+
// @ts-ignore
|
|
1368
|
+
{
|
|
1369
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1370
|
+
// @ts-ignore
|
|
1371
|
+
const page: Pick<QueryKey<Options<GuestSessionRatedTvEpisodesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1372
|
+
query: {
|
|
1373
|
+
page: pageParam
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1377
|
+
const { data } = await guestSessionRatedTvEpisodes({
|
|
1378
|
+
...options,
|
|
1379
|
+
...params,
|
|
1380
|
+
signal,
|
|
1381
|
+
throwOnError: true
|
|
1382
|
+
});
|
|
1383
|
+
return data;
|
|
1384
|
+
},
|
|
1385
|
+
queryKey: guestSessionRatedTvEpisodesInfiniteQueryKey(options)
|
|
1386
|
+
});
|
|
1387
|
+
|
|
1388
|
+
export const keywordDetailsQueryKey = (options: Options<KeywordDetailsData>) => createQueryKey('keywordDetails', options);
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* Details
|
|
1392
|
+
*/
|
|
1393
|
+
export const keywordDetailsOptions = (options: Options<KeywordDetailsData>) => queryOptions<KeywordDetailsResponse, DefaultError, KeywordDetailsResponse, ReturnType<typeof keywordDetailsQueryKey>>({
|
|
1394
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1395
|
+
const { data } = await keywordDetails({
|
|
1396
|
+
...options,
|
|
1397
|
+
...queryKey[0],
|
|
1398
|
+
signal,
|
|
1399
|
+
throwOnError: true
|
|
1400
|
+
});
|
|
1401
|
+
return data;
|
|
1402
|
+
},
|
|
1403
|
+
queryKey: keywordDetailsQueryKey(options)
|
|
1404
|
+
});
|
|
1405
|
+
|
|
1406
|
+
export const keywordMoviesQueryKey = (options: Options<KeywordMoviesData>) => createQueryKey('keywordMovies', options);
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Movies
|
|
1410
|
+
*/
|
|
1411
|
+
export const keywordMoviesOptions = (options: Options<KeywordMoviesData>) => queryOptions<KeywordMoviesResponse, DefaultError, KeywordMoviesResponse, ReturnType<typeof keywordMoviesQueryKey>>({
|
|
1412
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1413
|
+
const { data } = await keywordMovies({
|
|
1414
|
+
...options,
|
|
1415
|
+
...queryKey[0],
|
|
1416
|
+
signal,
|
|
1417
|
+
throwOnError: true
|
|
1418
|
+
});
|
|
1419
|
+
return data;
|
|
1420
|
+
},
|
|
1421
|
+
queryKey: keywordMoviesQueryKey(options)
|
|
1422
|
+
});
|
|
1423
|
+
|
|
1424
|
+
export const keywordMoviesInfiniteQueryKey = (options: Options<KeywordMoviesData>): QueryKey<Options<KeywordMoviesData>> => createQueryKey('keywordMovies', options, true);
|
|
1425
|
+
|
|
1426
|
+
/**
|
|
1427
|
+
* Movies
|
|
1428
|
+
*/
|
|
1429
|
+
export const keywordMoviesInfiniteOptions = (options: Options<KeywordMoviesData>) => infiniteQueryOptions<KeywordMoviesResponse, DefaultError, InfiniteData<KeywordMoviesResponse>, QueryKey<Options<KeywordMoviesData>>, number | Pick<QueryKey<Options<KeywordMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1430
|
+
// @ts-ignore
|
|
1431
|
+
{
|
|
1432
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1433
|
+
// @ts-ignore
|
|
1434
|
+
const page: Pick<QueryKey<Options<KeywordMoviesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1435
|
+
query: {
|
|
1436
|
+
page: pageParam
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1440
|
+
const { data } = await keywordMovies({
|
|
1441
|
+
...options,
|
|
1442
|
+
...params,
|
|
1443
|
+
signal,
|
|
1444
|
+
throwOnError: true
|
|
1445
|
+
});
|
|
1446
|
+
return data;
|
|
1447
|
+
},
|
|
1448
|
+
queryKey: keywordMoviesInfiniteQueryKey(options)
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Add Movie
|
|
1453
|
+
*
|
|
1454
|
+
* Add a movie to a list.
|
|
1455
|
+
*/
|
|
1456
|
+
export const listAddMovieMutation = (options?: Partial<Options<ListAddMovieData>>): UseMutationOptions<ListAddMovieResponse, DefaultError, Options<ListAddMovieData>> => {
|
|
1457
|
+
const mutationOptions: UseMutationOptions<ListAddMovieResponse, DefaultError, Options<ListAddMovieData>> = {
|
|
1458
|
+
mutationFn: async (fnOptions) => {
|
|
1459
|
+
const { data } = await listAddMovie({
|
|
1460
|
+
...options,
|
|
1461
|
+
...fnOptions,
|
|
1462
|
+
throwOnError: true
|
|
1463
|
+
});
|
|
1464
|
+
return data;
|
|
1465
|
+
}
|
|
1466
|
+
};
|
|
1467
|
+
return mutationOptions;
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
export const listCheckItemStatusQueryKey = (options: Options<ListCheckItemStatusData>) => createQueryKey('listCheckItemStatus', options);
|
|
1471
|
+
|
|
1472
|
+
/**
|
|
1473
|
+
* Check Item Status
|
|
1474
|
+
*
|
|
1475
|
+
* Use this method to check if an item has already been added to the list.
|
|
1476
|
+
*/
|
|
1477
|
+
export const listCheckItemStatusOptions = (options: Options<ListCheckItemStatusData>) => queryOptions<ListCheckItemStatusResponse, DefaultError, ListCheckItemStatusResponse, ReturnType<typeof listCheckItemStatusQueryKey>>({
|
|
1478
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1479
|
+
const { data } = await listCheckItemStatus({
|
|
1480
|
+
...options,
|
|
1481
|
+
...queryKey[0],
|
|
1482
|
+
signal,
|
|
1483
|
+
throwOnError: true
|
|
1484
|
+
});
|
|
1485
|
+
return data;
|
|
1486
|
+
},
|
|
1487
|
+
queryKey: listCheckItemStatusQueryKey(options)
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* Clear
|
|
1492
|
+
*
|
|
1493
|
+
* Clear all items from a list.
|
|
1494
|
+
*/
|
|
1495
|
+
export const listClearMutation = (options?: Partial<Options<ListClearData>>): UseMutationOptions<ListClearResponse, DefaultError, Options<ListClearData>> => {
|
|
1496
|
+
const mutationOptions: UseMutationOptions<ListClearResponse, DefaultError, Options<ListClearData>> = {
|
|
1497
|
+
mutationFn: async (fnOptions) => {
|
|
1498
|
+
const { data } = await listClear({
|
|
1499
|
+
...options,
|
|
1500
|
+
...fnOptions,
|
|
1501
|
+
throwOnError: true
|
|
1502
|
+
});
|
|
1503
|
+
return data;
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
return mutationOptions;
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* Create
|
|
1511
|
+
*/
|
|
1512
|
+
export const listCreateMutation = (options?: Partial<Options<ListCreateData>>): UseMutationOptions<ListCreateResponse, DefaultError, Options<ListCreateData>> => {
|
|
1513
|
+
const mutationOptions: UseMutationOptions<ListCreateResponse, DefaultError, Options<ListCreateData>> = {
|
|
1514
|
+
mutationFn: async (fnOptions) => {
|
|
1515
|
+
const { data } = await listCreate({
|
|
1516
|
+
...options,
|
|
1517
|
+
...fnOptions,
|
|
1518
|
+
throwOnError: true
|
|
1519
|
+
});
|
|
1520
|
+
return data;
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
return mutationOptions;
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Delete
|
|
1528
|
+
*
|
|
1529
|
+
* Delete a list.
|
|
1530
|
+
*/
|
|
1531
|
+
export const listDeleteMutation = (options?: Partial<Options<ListDeleteData>>): UseMutationOptions<ListDeleteResponse, DefaultError, Options<ListDeleteData>> => {
|
|
1532
|
+
const mutationOptions: UseMutationOptions<ListDeleteResponse, DefaultError, Options<ListDeleteData>> = {
|
|
1533
|
+
mutationFn: async (fnOptions) => {
|
|
1534
|
+
const { data } = await listDelete({
|
|
1535
|
+
...options,
|
|
1536
|
+
...fnOptions,
|
|
1537
|
+
throwOnError: true
|
|
1538
|
+
});
|
|
1539
|
+
return data;
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
return mutationOptions;
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
export const listDetailsQueryKey = (options: Options<ListDetailsData>) => createQueryKey('listDetails', options);
|
|
1546
|
+
|
|
1547
|
+
/**
|
|
1548
|
+
* Details
|
|
1549
|
+
*/
|
|
1550
|
+
export const listDetailsOptions = (options: Options<ListDetailsData>) => queryOptions<ListDetailsResponse, DefaultError, ListDetailsResponse, ReturnType<typeof listDetailsQueryKey>>({
|
|
1551
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1552
|
+
const { data } = await listDetails({
|
|
1553
|
+
...options,
|
|
1554
|
+
...queryKey[0],
|
|
1555
|
+
signal,
|
|
1556
|
+
throwOnError: true
|
|
1557
|
+
});
|
|
1558
|
+
return data;
|
|
1559
|
+
},
|
|
1560
|
+
queryKey: listDetailsQueryKey(options)
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
export const listDetailsInfiniteQueryKey = (options: Options<ListDetailsData>): QueryKey<Options<ListDetailsData>> => createQueryKey('listDetails', options, true);
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* Details
|
|
1567
|
+
*/
|
|
1568
|
+
export const listDetailsInfiniteOptions = (options: Options<ListDetailsData>) => infiniteQueryOptions<ListDetailsResponse, DefaultError, InfiniteData<ListDetailsResponse>, QueryKey<Options<ListDetailsData>>, number | Pick<QueryKey<Options<ListDetailsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1569
|
+
// @ts-ignore
|
|
1570
|
+
{
|
|
1571
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1572
|
+
// @ts-ignore
|
|
1573
|
+
const page: Pick<QueryKey<Options<ListDetailsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1574
|
+
query: {
|
|
1575
|
+
page: pageParam
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1579
|
+
const { data } = await listDetails({
|
|
1580
|
+
...options,
|
|
1581
|
+
...params,
|
|
1582
|
+
signal,
|
|
1583
|
+
throwOnError: true
|
|
1584
|
+
});
|
|
1585
|
+
return data;
|
|
1586
|
+
},
|
|
1587
|
+
queryKey: listDetailsInfiniteQueryKey(options)
|
|
1588
|
+
});
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Remove Movie
|
|
1592
|
+
*
|
|
1593
|
+
* Remove a movie from a list.
|
|
1594
|
+
*/
|
|
1595
|
+
export const listRemoveMovieMutation = (options?: Partial<Options<ListRemoveMovieData>>): UseMutationOptions<ListRemoveMovieResponse, DefaultError, Options<ListRemoveMovieData>> => {
|
|
1596
|
+
const mutationOptions: UseMutationOptions<ListRemoveMovieResponse, DefaultError, Options<ListRemoveMovieData>> = {
|
|
1597
|
+
mutationFn: async (fnOptions) => {
|
|
1598
|
+
const { data } = await listRemoveMovie({
|
|
1599
|
+
...options,
|
|
1600
|
+
...fnOptions,
|
|
1601
|
+
throwOnError: true
|
|
1602
|
+
});
|
|
1603
|
+
return data;
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
return mutationOptions;
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
export const movieNowPlayingListQueryKey = (options?: Options<MovieNowPlayingListData>) => createQueryKey('movieNowPlayingList', options);
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Now Playing
|
|
1613
|
+
*
|
|
1614
|
+
* Get a list of movies that are currently in theatres.
|
|
1615
|
+
*/
|
|
1616
|
+
export const movieNowPlayingListOptions = (options?: Options<MovieNowPlayingListData>) => queryOptions<MovieNowPlayingListResponse, DefaultError, MovieNowPlayingListResponse, ReturnType<typeof movieNowPlayingListQueryKey>>({
|
|
1617
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1618
|
+
const { data } = await movieNowPlayingList({
|
|
1619
|
+
...options,
|
|
1620
|
+
...queryKey[0],
|
|
1621
|
+
signal,
|
|
1622
|
+
throwOnError: true
|
|
1623
|
+
});
|
|
1624
|
+
return data;
|
|
1625
|
+
},
|
|
1626
|
+
queryKey: movieNowPlayingListQueryKey(options)
|
|
1627
|
+
});
|
|
1628
|
+
|
|
1629
|
+
export const movieNowPlayingListInfiniteQueryKey = (options?: Options<MovieNowPlayingListData>): QueryKey<Options<MovieNowPlayingListData>> => createQueryKey('movieNowPlayingList', options, true);
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Now Playing
|
|
1633
|
+
*
|
|
1634
|
+
* Get a list of movies that are currently in theatres.
|
|
1635
|
+
*/
|
|
1636
|
+
export const movieNowPlayingListInfiniteOptions = (options?: Options<MovieNowPlayingListData>) => infiniteQueryOptions<MovieNowPlayingListResponse, DefaultError, InfiniteData<MovieNowPlayingListResponse>, QueryKey<Options<MovieNowPlayingListData>>, number | Pick<QueryKey<Options<MovieNowPlayingListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1637
|
+
// @ts-ignore
|
|
1638
|
+
{
|
|
1639
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1640
|
+
// @ts-ignore
|
|
1641
|
+
const page: Pick<QueryKey<Options<MovieNowPlayingListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1642
|
+
query: {
|
|
1643
|
+
page: pageParam
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1647
|
+
const { data } = await movieNowPlayingList({
|
|
1648
|
+
...options,
|
|
1649
|
+
...params,
|
|
1650
|
+
signal,
|
|
1651
|
+
throwOnError: true
|
|
1652
|
+
});
|
|
1653
|
+
return data;
|
|
1654
|
+
},
|
|
1655
|
+
queryKey: movieNowPlayingListInfiniteQueryKey(options)
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
|
+
export const moviePopularListQueryKey = (options?: Options<MoviePopularListData>) => createQueryKey('moviePopularList', options);
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* Popular
|
|
1662
|
+
*
|
|
1663
|
+
* Get a list of movies ordered by popularity.
|
|
1664
|
+
*/
|
|
1665
|
+
export const moviePopularListOptions = (options?: Options<MoviePopularListData>) => queryOptions<MoviePopularListResponse, DefaultError, MoviePopularListResponse, ReturnType<typeof moviePopularListQueryKey>>({
|
|
1666
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1667
|
+
const { data } = await moviePopularList({
|
|
1668
|
+
...options,
|
|
1669
|
+
...queryKey[0],
|
|
1670
|
+
signal,
|
|
1671
|
+
throwOnError: true
|
|
1672
|
+
});
|
|
1673
|
+
return data;
|
|
1674
|
+
},
|
|
1675
|
+
queryKey: moviePopularListQueryKey(options)
|
|
1676
|
+
});
|
|
1677
|
+
|
|
1678
|
+
export const moviePopularListInfiniteQueryKey = (options?: Options<MoviePopularListData>): QueryKey<Options<MoviePopularListData>> => createQueryKey('moviePopularList', options, true);
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Popular
|
|
1682
|
+
*
|
|
1683
|
+
* Get a list of movies ordered by popularity.
|
|
1684
|
+
*/
|
|
1685
|
+
export const moviePopularListInfiniteOptions = (options?: Options<MoviePopularListData>) => infiniteQueryOptions<MoviePopularListResponse, DefaultError, InfiniteData<MoviePopularListResponse>, QueryKey<Options<MoviePopularListData>>, number | Pick<QueryKey<Options<MoviePopularListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1686
|
+
// @ts-ignore
|
|
1687
|
+
{
|
|
1688
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1689
|
+
// @ts-ignore
|
|
1690
|
+
const page: Pick<QueryKey<Options<MoviePopularListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1691
|
+
query: {
|
|
1692
|
+
page: pageParam
|
|
1693
|
+
}
|
|
1694
|
+
};
|
|
1695
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1696
|
+
const { data } = await moviePopularList({
|
|
1697
|
+
...options,
|
|
1698
|
+
...params,
|
|
1699
|
+
signal,
|
|
1700
|
+
throwOnError: true
|
|
1701
|
+
});
|
|
1702
|
+
return data;
|
|
1703
|
+
},
|
|
1704
|
+
queryKey: moviePopularListInfiniteQueryKey(options)
|
|
1705
|
+
});
|
|
1706
|
+
|
|
1707
|
+
export const movieTopRatedListQueryKey = (options?: Options<MovieTopRatedListData>) => createQueryKey('movieTopRatedList', options);
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* Top Rated
|
|
1711
|
+
*
|
|
1712
|
+
* Get a list of movies ordered by rating.
|
|
1713
|
+
*/
|
|
1714
|
+
export const movieTopRatedListOptions = (options?: Options<MovieTopRatedListData>) => queryOptions<MovieTopRatedListResponse, DefaultError, MovieTopRatedListResponse, ReturnType<typeof movieTopRatedListQueryKey>>({
|
|
1715
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1716
|
+
const { data } = await movieTopRatedList({
|
|
1717
|
+
...options,
|
|
1718
|
+
...queryKey[0],
|
|
1719
|
+
signal,
|
|
1720
|
+
throwOnError: true
|
|
1721
|
+
});
|
|
1722
|
+
return data;
|
|
1723
|
+
},
|
|
1724
|
+
queryKey: movieTopRatedListQueryKey(options)
|
|
1725
|
+
});
|
|
1726
|
+
|
|
1727
|
+
export const movieTopRatedListInfiniteQueryKey = (options?: Options<MovieTopRatedListData>): QueryKey<Options<MovieTopRatedListData>> => createQueryKey('movieTopRatedList', options, true);
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Top Rated
|
|
1731
|
+
*
|
|
1732
|
+
* Get a list of movies ordered by rating.
|
|
1733
|
+
*/
|
|
1734
|
+
export const movieTopRatedListInfiniteOptions = (options?: Options<MovieTopRatedListData>) => infiniteQueryOptions<MovieTopRatedListResponse, DefaultError, InfiniteData<MovieTopRatedListResponse>, QueryKey<Options<MovieTopRatedListData>>, number | Pick<QueryKey<Options<MovieTopRatedListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1735
|
+
// @ts-ignore
|
|
1736
|
+
{
|
|
1737
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1738
|
+
// @ts-ignore
|
|
1739
|
+
const page: Pick<QueryKey<Options<MovieTopRatedListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1740
|
+
query: {
|
|
1741
|
+
page: pageParam
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1745
|
+
const { data } = await movieTopRatedList({
|
|
1746
|
+
...options,
|
|
1747
|
+
...params,
|
|
1748
|
+
signal,
|
|
1749
|
+
throwOnError: true
|
|
1750
|
+
});
|
|
1751
|
+
return data;
|
|
1752
|
+
},
|
|
1753
|
+
queryKey: movieTopRatedListInfiniteQueryKey(options)
|
|
1754
|
+
});
|
|
1755
|
+
|
|
1756
|
+
export const movieUpcomingListQueryKey = (options?: Options<MovieUpcomingListData>) => createQueryKey('movieUpcomingList', options);
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* Upcoming
|
|
1760
|
+
*
|
|
1761
|
+
* Get a list of movies that are being released soon.
|
|
1762
|
+
*/
|
|
1763
|
+
export const movieUpcomingListOptions = (options?: Options<MovieUpcomingListData>) => queryOptions<MovieUpcomingListResponse, DefaultError, MovieUpcomingListResponse, ReturnType<typeof movieUpcomingListQueryKey>>({
|
|
1764
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1765
|
+
const { data } = await movieUpcomingList({
|
|
1766
|
+
...options,
|
|
1767
|
+
...queryKey[0],
|
|
1768
|
+
signal,
|
|
1769
|
+
throwOnError: true
|
|
1770
|
+
});
|
|
1771
|
+
return data;
|
|
1772
|
+
},
|
|
1773
|
+
queryKey: movieUpcomingListQueryKey(options)
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1776
|
+
export const movieUpcomingListInfiniteQueryKey = (options?: Options<MovieUpcomingListData>): QueryKey<Options<MovieUpcomingListData>> => createQueryKey('movieUpcomingList', options, true);
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Upcoming
|
|
1780
|
+
*
|
|
1781
|
+
* Get a list of movies that are being released soon.
|
|
1782
|
+
*/
|
|
1783
|
+
export const movieUpcomingListInfiniteOptions = (options?: Options<MovieUpcomingListData>) => infiniteQueryOptions<MovieUpcomingListResponse, DefaultError, InfiniteData<MovieUpcomingListResponse>, QueryKey<Options<MovieUpcomingListData>>, number | Pick<QueryKey<Options<MovieUpcomingListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1784
|
+
// @ts-ignore
|
|
1785
|
+
{
|
|
1786
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1787
|
+
// @ts-ignore
|
|
1788
|
+
const page: Pick<QueryKey<Options<MovieUpcomingListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1789
|
+
query: {
|
|
1790
|
+
page: pageParam
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1794
|
+
const { data } = await movieUpcomingList({
|
|
1795
|
+
...options,
|
|
1796
|
+
...params,
|
|
1797
|
+
signal,
|
|
1798
|
+
throwOnError: true
|
|
1799
|
+
});
|
|
1800
|
+
return data;
|
|
1801
|
+
},
|
|
1802
|
+
queryKey: movieUpcomingListInfiniteQueryKey(options)
|
|
1803
|
+
});
|
|
1804
|
+
|
|
1805
|
+
export const movieDetailsQueryKey = (options: Options<MovieDetailsData>) => createQueryKey('movieDetails', options);
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* Details
|
|
1809
|
+
*
|
|
1810
|
+
* Get the top level details of a movie by ID.
|
|
1811
|
+
*/
|
|
1812
|
+
export const movieDetailsOptions = (options: Options<MovieDetailsData>) => queryOptions<MovieDetailsResponse, DefaultError, MovieDetailsResponse, ReturnType<typeof movieDetailsQueryKey>>({
|
|
1813
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1814
|
+
const { data } = await movieDetails({
|
|
1815
|
+
...options,
|
|
1816
|
+
...queryKey[0],
|
|
1817
|
+
signal,
|
|
1818
|
+
throwOnError: true
|
|
1819
|
+
});
|
|
1820
|
+
return data;
|
|
1821
|
+
},
|
|
1822
|
+
queryKey: movieDetailsQueryKey(options)
|
|
1823
|
+
});
|
|
1824
|
+
|
|
1825
|
+
export const movieAccountStatesQueryKey = (options: Options<MovieAccountStatesData>) => createQueryKey('movieAccountStates', options);
|
|
1826
|
+
|
|
1827
|
+
/**
|
|
1828
|
+
* Account States
|
|
1829
|
+
*
|
|
1830
|
+
* Get the rating, watchlist and favourite status of an account.
|
|
1831
|
+
*/
|
|
1832
|
+
export const movieAccountStatesOptions = (options: Options<MovieAccountStatesData>) => queryOptions<MovieAccountStatesResponse, DefaultError, MovieAccountStatesResponse, ReturnType<typeof movieAccountStatesQueryKey>>({
|
|
1833
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1834
|
+
const { data } = await movieAccountStates({
|
|
1835
|
+
...options,
|
|
1836
|
+
...queryKey[0],
|
|
1837
|
+
signal,
|
|
1838
|
+
throwOnError: true
|
|
1839
|
+
});
|
|
1840
|
+
return data;
|
|
1841
|
+
},
|
|
1842
|
+
queryKey: movieAccountStatesQueryKey(options)
|
|
1843
|
+
});
|
|
1844
|
+
|
|
1845
|
+
export const movieAlternativeTitlesQueryKey = (options: Options<MovieAlternativeTitlesData>) => createQueryKey('movieAlternativeTitles', options);
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* Alternative Titles
|
|
1849
|
+
*
|
|
1850
|
+
* Get the alternative titles for a movie.
|
|
1851
|
+
*/
|
|
1852
|
+
export const movieAlternativeTitlesOptions = (options: Options<MovieAlternativeTitlesData>) => queryOptions<MovieAlternativeTitlesResponse, DefaultError, MovieAlternativeTitlesResponse, ReturnType<typeof movieAlternativeTitlesQueryKey>>({
|
|
1853
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1854
|
+
const { data } = await movieAlternativeTitles({
|
|
1855
|
+
...options,
|
|
1856
|
+
...queryKey[0],
|
|
1857
|
+
signal,
|
|
1858
|
+
throwOnError: true
|
|
1859
|
+
});
|
|
1860
|
+
return data;
|
|
1861
|
+
},
|
|
1862
|
+
queryKey: movieAlternativeTitlesQueryKey(options)
|
|
1863
|
+
});
|
|
1864
|
+
|
|
1865
|
+
export const movieChangesQueryKey = (options: Options<MovieChangesData>) => createQueryKey('movieChanges', options);
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* Changes
|
|
1869
|
+
*
|
|
1870
|
+
* Get the recent changes for a movie.
|
|
1871
|
+
*/
|
|
1872
|
+
export const movieChangesOptions = (options: Options<MovieChangesData>) => queryOptions<MovieChangesResponse, DefaultError, MovieChangesResponse, ReturnType<typeof movieChangesQueryKey>>({
|
|
1873
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1874
|
+
const { data } = await movieChanges({
|
|
1875
|
+
...options,
|
|
1876
|
+
...queryKey[0],
|
|
1877
|
+
signal,
|
|
1878
|
+
throwOnError: true
|
|
1879
|
+
});
|
|
1880
|
+
return data;
|
|
1881
|
+
},
|
|
1882
|
+
queryKey: movieChangesQueryKey(options)
|
|
1883
|
+
});
|
|
1884
|
+
|
|
1885
|
+
export const movieChangesInfiniteQueryKey = (options: Options<MovieChangesData>): QueryKey<Options<MovieChangesData>> => createQueryKey('movieChanges', options, true);
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Changes
|
|
1889
|
+
*
|
|
1890
|
+
* Get the recent changes for a movie.
|
|
1891
|
+
*/
|
|
1892
|
+
export const movieChangesInfiniteOptions = (options: Options<MovieChangesData>) => infiniteQueryOptions<MovieChangesResponse, DefaultError, InfiniteData<MovieChangesResponse>, QueryKey<Options<MovieChangesData>>, number | Pick<QueryKey<Options<MovieChangesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
1893
|
+
// @ts-ignore
|
|
1894
|
+
{
|
|
1895
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1896
|
+
// @ts-ignore
|
|
1897
|
+
const page: Pick<QueryKey<Options<MovieChangesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
1898
|
+
query: {
|
|
1899
|
+
page: pageParam
|
|
1900
|
+
}
|
|
1901
|
+
};
|
|
1902
|
+
const params = createInfiniteParams(queryKey, page);
|
|
1903
|
+
const { data } = await movieChanges({
|
|
1904
|
+
...options,
|
|
1905
|
+
...params,
|
|
1906
|
+
signal,
|
|
1907
|
+
throwOnError: true
|
|
1908
|
+
});
|
|
1909
|
+
return data;
|
|
1910
|
+
},
|
|
1911
|
+
queryKey: movieChangesInfiniteQueryKey(options)
|
|
1912
|
+
});
|
|
1913
|
+
|
|
1914
|
+
export const movieCreditsQueryKey = (options: Options<MovieCreditsData>) => createQueryKey('movieCredits', options);
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* Credits
|
|
1918
|
+
*/
|
|
1919
|
+
export const movieCreditsOptions = (options: Options<MovieCreditsData>) => queryOptions<MovieCreditsResponse, DefaultError, MovieCreditsResponse, ReturnType<typeof movieCreditsQueryKey>>({
|
|
1920
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1921
|
+
const { data } = await movieCredits({
|
|
1922
|
+
...options,
|
|
1923
|
+
...queryKey[0],
|
|
1924
|
+
signal,
|
|
1925
|
+
throwOnError: true
|
|
1926
|
+
});
|
|
1927
|
+
return data;
|
|
1928
|
+
},
|
|
1929
|
+
queryKey: movieCreditsQueryKey(options)
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
export const movieExternalIdsQueryKey = (options: Options<MovieExternalIdsData>) => createQueryKey('movieExternalIds', options);
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* External IDs
|
|
1936
|
+
*/
|
|
1937
|
+
export const movieExternalIdsOptions = (options: Options<MovieExternalIdsData>) => queryOptions<MovieExternalIdsResponse, DefaultError, MovieExternalIdsResponse, ReturnType<typeof movieExternalIdsQueryKey>>({
|
|
1938
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1939
|
+
const { data } = await movieExternalIds({
|
|
1940
|
+
...options,
|
|
1941
|
+
...queryKey[0],
|
|
1942
|
+
signal,
|
|
1943
|
+
throwOnError: true
|
|
1944
|
+
});
|
|
1945
|
+
return data;
|
|
1946
|
+
},
|
|
1947
|
+
queryKey: movieExternalIdsQueryKey(options)
|
|
1948
|
+
});
|
|
1949
|
+
|
|
1950
|
+
export const movieImagesQueryKey = (options: Options<MovieImagesData>) => createQueryKey('movieImages', options);
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* Images
|
|
1954
|
+
*
|
|
1955
|
+
* Get the images that belong to a movie.
|
|
1956
|
+
*/
|
|
1957
|
+
export const movieImagesOptions = (options: Options<MovieImagesData>) => queryOptions<MovieImagesResponse, DefaultError, MovieImagesResponse, ReturnType<typeof movieImagesQueryKey>>({
|
|
1958
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1959
|
+
const { data } = await movieImages({
|
|
1960
|
+
...options,
|
|
1961
|
+
...queryKey[0],
|
|
1962
|
+
signal,
|
|
1963
|
+
throwOnError: true
|
|
1964
|
+
});
|
|
1965
|
+
return data;
|
|
1966
|
+
},
|
|
1967
|
+
queryKey: movieImagesQueryKey(options)
|
|
1968
|
+
});
|
|
1969
|
+
|
|
1970
|
+
export const movieKeywordsQueryKey = (options: Options<MovieKeywordsData>) => createQueryKey('movieKeywords', options);
|
|
1971
|
+
|
|
1972
|
+
/**
|
|
1973
|
+
* Keywords
|
|
1974
|
+
*/
|
|
1975
|
+
export const movieKeywordsOptions = (options: Options<MovieKeywordsData>) => queryOptions<MovieKeywordsResponse, DefaultError, MovieKeywordsResponse, ReturnType<typeof movieKeywordsQueryKey>>({
|
|
1976
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1977
|
+
const { data } = await movieKeywords({
|
|
1978
|
+
...options,
|
|
1979
|
+
...queryKey[0],
|
|
1980
|
+
signal,
|
|
1981
|
+
throwOnError: true
|
|
1982
|
+
});
|
|
1983
|
+
return data;
|
|
1984
|
+
},
|
|
1985
|
+
queryKey: movieKeywordsQueryKey(options)
|
|
1986
|
+
});
|
|
1987
|
+
|
|
1988
|
+
export const movieLatestIdQueryKey = (options?: Options<MovieLatestIdData>) => createQueryKey('movieLatestId', options);
|
|
1989
|
+
|
|
1990
|
+
/**
|
|
1991
|
+
* Latest
|
|
1992
|
+
*
|
|
1993
|
+
* Get the newest movie ID.
|
|
1994
|
+
*/
|
|
1995
|
+
export const movieLatestIdOptions = (options?: Options<MovieLatestIdData>) => queryOptions<MovieLatestIdResponse, DefaultError, MovieLatestIdResponse, ReturnType<typeof movieLatestIdQueryKey>>({
|
|
1996
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1997
|
+
const { data } = await movieLatestId({
|
|
1998
|
+
...options,
|
|
1999
|
+
...queryKey[0],
|
|
2000
|
+
signal,
|
|
2001
|
+
throwOnError: true
|
|
2002
|
+
});
|
|
2003
|
+
return data;
|
|
2004
|
+
},
|
|
2005
|
+
queryKey: movieLatestIdQueryKey(options)
|
|
2006
|
+
});
|
|
2007
|
+
|
|
2008
|
+
export const movieListsQueryKey = (options: Options<MovieListsData>) => createQueryKey('movieLists', options);
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* Lists
|
|
2012
|
+
*
|
|
2013
|
+
* Get the lists that a movie has been added to.
|
|
2014
|
+
*/
|
|
2015
|
+
export const movieListsOptions = (options: Options<MovieListsData>) => queryOptions<MovieListsResponse, DefaultError, MovieListsResponse, ReturnType<typeof movieListsQueryKey>>({
|
|
2016
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2017
|
+
const { data } = await movieLists({
|
|
2018
|
+
...options,
|
|
2019
|
+
...queryKey[0],
|
|
2020
|
+
signal,
|
|
2021
|
+
throwOnError: true
|
|
2022
|
+
});
|
|
2023
|
+
return data;
|
|
2024
|
+
},
|
|
2025
|
+
queryKey: movieListsQueryKey(options)
|
|
2026
|
+
});
|
|
2027
|
+
|
|
2028
|
+
export const movieListsInfiniteQueryKey = (options: Options<MovieListsData>): QueryKey<Options<MovieListsData>> => createQueryKey('movieLists', options, true);
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* Lists
|
|
2032
|
+
*
|
|
2033
|
+
* Get the lists that a movie has been added to.
|
|
2034
|
+
*/
|
|
2035
|
+
export const movieListsInfiniteOptions = (options: Options<MovieListsData>) => infiniteQueryOptions<MovieListsResponse, DefaultError, InfiniteData<MovieListsResponse>, QueryKey<Options<MovieListsData>>, number | Pick<QueryKey<Options<MovieListsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2036
|
+
// @ts-ignore
|
|
2037
|
+
{
|
|
2038
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2039
|
+
// @ts-ignore
|
|
2040
|
+
const page: Pick<QueryKey<Options<MovieListsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2041
|
+
query: {
|
|
2042
|
+
page: pageParam
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2046
|
+
const { data } = await movieLists({
|
|
2047
|
+
...options,
|
|
2048
|
+
...params,
|
|
2049
|
+
signal,
|
|
2050
|
+
throwOnError: true
|
|
2051
|
+
});
|
|
2052
|
+
return data;
|
|
2053
|
+
},
|
|
2054
|
+
queryKey: movieListsInfiniteQueryKey(options)
|
|
2055
|
+
});
|
|
2056
|
+
|
|
2057
|
+
export const movieRecommendationsQueryKey = (options: Options<MovieRecommendationsData>) => createQueryKey('movieRecommendations', options);
|
|
2058
|
+
|
|
2059
|
+
/**
|
|
2060
|
+
* Recommendations
|
|
2061
|
+
*/
|
|
2062
|
+
export const movieRecommendationsOptions = (options: Options<MovieRecommendationsData>) => queryOptions<MovieRecommendationsResponse, DefaultError, MovieRecommendationsResponse, ReturnType<typeof movieRecommendationsQueryKey>>({
|
|
2063
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2064
|
+
const { data } = await movieRecommendations({
|
|
2065
|
+
...options,
|
|
2066
|
+
...queryKey[0],
|
|
2067
|
+
signal,
|
|
2068
|
+
throwOnError: true
|
|
2069
|
+
});
|
|
2070
|
+
return data;
|
|
2071
|
+
},
|
|
2072
|
+
queryKey: movieRecommendationsQueryKey(options)
|
|
2073
|
+
});
|
|
2074
|
+
|
|
2075
|
+
export const movieRecommendationsInfiniteQueryKey = (options: Options<MovieRecommendationsData>): QueryKey<Options<MovieRecommendationsData>> => createQueryKey('movieRecommendations', options, true);
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* Recommendations
|
|
2079
|
+
*/
|
|
2080
|
+
export const movieRecommendationsInfiniteOptions = (options: Options<MovieRecommendationsData>) => infiniteQueryOptions<MovieRecommendationsResponse, DefaultError, InfiniteData<MovieRecommendationsResponse>, QueryKey<Options<MovieRecommendationsData>>, number | Pick<QueryKey<Options<MovieRecommendationsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2081
|
+
// @ts-ignore
|
|
2082
|
+
{
|
|
2083
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2084
|
+
// @ts-ignore
|
|
2085
|
+
const page: Pick<QueryKey<Options<MovieRecommendationsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2086
|
+
query: {
|
|
2087
|
+
page: pageParam
|
|
2088
|
+
}
|
|
2089
|
+
};
|
|
2090
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2091
|
+
const { data } = await movieRecommendations({
|
|
2092
|
+
...options,
|
|
2093
|
+
...params,
|
|
2094
|
+
signal,
|
|
2095
|
+
throwOnError: true
|
|
2096
|
+
});
|
|
2097
|
+
return data;
|
|
2098
|
+
},
|
|
2099
|
+
queryKey: movieRecommendationsInfiniteQueryKey(options)
|
|
2100
|
+
});
|
|
2101
|
+
|
|
2102
|
+
export const movieReleaseDatesQueryKey = (options: Options<MovieReleaseDatesData>) => createQueryKey('movieReleaseDates', options);
|
|
2103
|
+
|
|
2104
|
+
/**
|
|
2105
|
+
* Release Dates
|
|
2106
|
+
*
|
|
2107
|
+
* Get the release dates and certifications for a movie.
|
|
2108
|
+
*/
|
|
2109
|
+
export const movieReleaseDatesOptions = (options: Options<MovieReleaseDatesData>) => queryOptions<MovieReleaseDatesResponse, DefaultError, MovieReleaseDatesResponse, ReturnType<typeof movieReleaseDatesQueryKey>>({
|
|
2110
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2111
|
+
const { data } = await movieReleaseDates({
|
|
2112
|
+
...options,
|
|
2113
|
+
...queryKey[0],
|
|
2114
|
+
signal,
|
|
2115
|
+
throwOnError: true
|
|
2116
|
+
});
|
|
2117
|
+
return data;
|
|
2118
|
+
},
|
|
2119
|
+
queryKey: movieReleaseDatesQueryKey(options)
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
export const movieReviewsQueryKey = (options: Options<MovieReviewsData>) => createQueryKey('movieReviews', options);
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* Reviews
|
|
2126
|
+
*
|
|
2127
|
+
* Get the user reviews for a movie.
|
|
2128
|
+
*/
|
|
2129
|
+
export const movieReviewsOptions = (options: Options<MovieReviewsData>) => queryOptions<MovieReviewsResponse, DefaultError, MovieReviewsResponse, ReturnType<typeof movieReviewsQueryKey>>({
|
|
2130
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2131
|
+
const { data } = await movieReviews({
|
|
2132
|
+
...options,
|
|
2133
|
+
...queryKey[0],
|
|
2134
|
+
signal,
|
|
2135
|
+
throwOnError: true
|
|
2136
|
+
});
|
|
2137
|
+
return data;
|
|
2138
|
+
},
|
|
2139
|
+
queryKey: movieReviewsQueryKey(options)
|
|
2140
|
+
});
|
|
2141
|
+
|
|
2142
|
+
export const movieReviewsInfiniteQueryKey = (options: Options<MovieReviewsData>): QueryKey<Options<MovieReviewsData>> => createQueryKey('movieReviews', options, true);
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* Reviews
|
|
2146
|
+
*
|
|
2147
|
+
* Get the user reviews for a movie.
|
|
2148
|
+
*/
|
|
2149
|
+
export const movieReviewsInfiniteOptions = (options: Options<MovieReviewsData>) => infiniteQueryOptions<MovieReviewsResponse, DefaultError, InfiniteData<MovieReviewsResponse>, QueryKey<Options<MovieReviewsData>>, number | Pick<QueryKey<Options<MovieReviewsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2150
|
+
// @ts-ignore
|
|
2151
|
+
{
|
|
2152
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2153
|
+
// @ts-ignore
|
|
2154
|
+
const page: Pick<QueryKey<Options<MovieReviewsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2155
|
+
query: {
|
|
2156
|
+
page: pageParam
|
|
2157
|
+
}
|
|
2158
|
+
};
|
|
2159
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2160
|
+
const { data } = await movieReviews({
|
|
2161
|
+
...options,
|
|
2162
|
+
...params,
|
|
2163
|
+
signal,
|
|
2164
|
+
throwOnError: true
|
|
2165
|
+
});
|
|
2166
|
+
return data;
|
|
2167
|
+
},
|
|
2168
|
+
queryKey: movieReviewsInfiniteQueryKey(options)
|
|
2169
|
+
});
|
|
2170
|
+
|
|
2171
|
+
export const movieSimilarQueryKey = (options: Options<MovieSimilarData>) => createQueryKey('movieSimilar', options);
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Similar
|
|
2175
|
+
*
|
|
2176
|
+
* Get the similar movies based on genres and keywords.
|
|
2177
|
+
*/
|
|
2178
|
+
export const movieSimilarOptions = (options: Options<MovieSimilarData>) => queryOptions<MovieSimilarResponse, DefaultError, MovieSimilarResponse, ReturnType<typeof movieSimilarQueryKey>>({
|
|
2179
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2180
|
+
const { data } = await movieSimilar({
|
|
2181
|
+
...options,
|
|
2182
|
+
...queryKey[0],
|
|
2183
|
+
signal,
|
|
2184
|
+
throwOnError: true
|
|
2185
|
+
});
|
|
2186
|
+
return data;
|
|
2187
|
+
},
|
|
2188
|
+
queryKey: movieSimilarQueryKey(options)
|
|
2189
|
+
});
|
|
2190
|
+
|
|
2191
|
+
export const movieSimilarInfiniteQueryKey = (options: Options<MovieSimilarData>): QueryKey<Options<MovieSimilarData>> => createQueryKey('movieSimilar', options, true);
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* Similar
|
|
2195
|
+
*
|
|
2196
|
+
* Get the similar movies based on genres and keywords.
|
|
2197
|
+
*/
|
|
2198
|
+
export const movieSimilarInfiniteOptions = (options: Options<MovieSimilarData>) => infiniteQueryOptions<MovieSimilarResponse, DefaultError, InfiniteData<MovieSimilarResponse>, QueryKey<Options<MovieSimilarData>>, number | Pick<QueryKey<Options<MovieSimilarData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2199
|
+
// @ts-ignore
|
|
2200
|
+
{
|
|
2201
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2202
|
+
// @ts-ignore
|
|
2203
|
+
const page: Pick<QueryKey<Options<MovieSimilarData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2204
|
+
query: {
|
|
2205
|
+
page: pageParam
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2209
|
+
const { data } = await movieSimilar({
|
|
2210
|
+
...options,
|
|
2211
|
+
...params,
|
|
2212
|
+
signal,
|
|
2213
|
+
throwOnError: true
|
|
2214
|
+
});
|
|
2215
|
+
return data;
|
|
2216
|
+
},
|
|
2217
|
+
queryKey: movieSimilarInfiniteQueryKey(options)
|
|
2218
|
+
});
|
|
2219
|
+
|
|
2220
|
+
export const movieTranslationsQueryKey = (options: Options<MovieTranslationsData>) => createQueryKey('movieTranslations', options);
|
|
2221
|
+
|
|
2222
|
+
/**
|
|
2223
|
+
* Translations
|
|
2224
|
+
*
|
|
2225
|
+
* Get the translations for a movie.
|
|
2226
|
+
*/
|
|
2227
|
+
export const movieTranslationsOptions = (options: Options<MovieTranslationsData>) => queryOptions<MovieTranslationsResponse, DefaultError, MovieTranslationsResponse, ReturnType<typeof movieTranslationsQueryKey>>({
|
|
2228
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2229
|
+
const { data } = await movieTranslations({
|
|
2230
|
+
...options,
|
|
2231
|
+
...queryKey[0],
|
|
2232
|
+
signal,
|
|
2233
|
+
throwOnError: true
|
|
2234
|
+
});
|
|
2235
|
+
return data;
|
|
2236
|
+
},
|
|
2237
|
+
queryKey: movieTranslationsQueryKey(options)
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
export const movieVideosQueryKey = (options: Options<MovieVideosData>) => createQueryKey('movieVideos', options);
|
|
2241
|
+
|
|
2242
|
+
/**
|
|
2243
|
+
* Videos
|
|
2244
|
+
*/
|
|
2245
|
+
export const movieVideosOptions = (options: Options<MovieVideosData>) => queryOptions<MovieVideosResponse, DefaultError, MovieVideosResponse, ReturnType<typeof movieVideosQueryKey>>({
|
|
2246
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2247
|
+
const { data } = await movieVideos({
|
|
2248
|
+
...options,
|
|
2249
|
+
...queryKey[0],
|
|
2250
|
+
signal,
|
|
2251
|
+
throwOnError: true
|
|
2252
|
+
});
|
|
2253
|
+
return data;
|
|
2254
|
+
},
|
|
2255
|
+
queryKey: movieVideosQueryKey(options)
|
|
2256
|
+
});
|
|
2257
|
+
|
|
2258
|
+
export const movieWatchProvidersQueryKey = (options: Options<MovieWatchProvidersData>) => createQueryKey('movieWatchProviders', options);
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* Watch Providers
|
|
2262
|
+
*
|
|
2263
|
+
* Get the list of streaming providers we have for a movie.
|
|
2264
|
+
*/
|
|
2265
|
+
export const movieWatchProvidersOptions = (options: Options<MovieWatchProvidersData>) => queryOptions<MovieWatchProvidersResponse, DefaultError, MovieWatchProvidersResponse, ReturnType<typeof movieWatchProvidersQueryKey>>({
|
|
2266
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2267
|
+
const { data } = await movieWatchProviders({
|
|
2268
|
+
...options,
|
|
2269
|
+
...queryKey[0],
|
|
2270
|
+
signal,
|
|
2271
|
+
throwOnError: true
|
|
2272
|
+
});
|
|
2273
|
+
return data;
|
|
2274
|
+
},
|
|
2275
|
+
queryKey: movieWatchProvidersQueryKey(options)
|
|
2276
|
+
});
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* Delete Rating
|
|
2280
|
+
*
|
|
2281
|
+
* Delete a user rating.
|
|
2282
|
+
*/
|
|
2283
|
+
export const movieDeleteRatingMutation = (options?: Partial<Options<MovieDeleteRatingData>>): UseMutationOptions<MovieDeleteRatingResponse, DefaultError, Options<MovieDeleteRatingData>> => {
|
|
2284
|
+
const mutationOptions: UseMutationOptions<MovieDeleteRatingResponse, DefaultError, Options<MovieDeleteRatingData>> = {
|
|
2285
|
+
mutationFn: async (fnOptions) => {
|
|
2286
|
+
const { data } = await movieDeleteRating({
|
|
2287
|
+
...options,
|
|
2288
|
+
...fnOptions,
|
|
2289
|
+
throwOnError: true
|
|
2290
|
+
});
|
|
2291
|
+
return data;
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
return mutationOptions;
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
/**
|
|
2298
|
+
* Add Rating
|
|
2299
|
+
*
|
|
2300
|
+
* Rate a movie and save it to your rated list.
|
|
2301
|
+
*/
|
|
2302
|
+
export const movieAddRatingMutation = (options?: Partial<Options<MovieAddRatingData>>): UseMutationOptions<MovieAddRatingResponse, DefaultError, Options<MovieAddRatingData>> => {
|
|
2303
|
+
const mutationOptions: UseMutationOptions<MovieAddRatingResponse, DefaultError, Options<MovieAddRatingData>> = {
|
|
2304
|
+
mutationFn: async (fnOptions) => {
|
|
2305
|
+
const { data } = await movieAddRating({
|
|
2306
|
+
...options,
|
|
2307
|
+
...fnOptions,
|
|
2308
|
+
throwOnError: true
|
|
2309
|
+
});
|
|
2310
|
+
return data;
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
return mutationOptions;
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
export const networkDetailsQueryKey = (options: Options<NetworkDetailsData>) => createQueryKey('networkDetails', options);
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Details
|
|
2320
|
+
*/
|
|
2321
|
+
export const networkDetailsOptions = (options: Options<NetworkDetailsData>) => queryOptions<NetworkDetailsResponse, DefaultError, NetworkDetailsResponse, ReturnType<typeof networkDetailsQueryKey>>({
|
|
2322
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2323
|
+
const { data } = await networkDetails({
|
|
2324
|
+
...options,
|
|
2325
|
+
...queryKey[0],
|
|
2326
|
+
signal,
|
|
2327
|
+
throwOnError: true
|
|
2328
|
+
});
|
|
2329
|
+
return data;
|
|
2330
|
+
},
|
|
2331
|
+
queryKey: networkDetailsQueryKey(options)
|
|
2332
|
+
});
|
|
2333
|
+
|
|
2334
|
+
export const detailsCopyQueryKey = (options: Options<DetailsCopyData>) => createQueryKey('detailsCopy', options);
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* Alternative Names
|
|
2338
|
+
*
|
|
2339
|
+
* Get the alternative names of a network.
|
|
2340
|
+
*/
|
|
2341
|
+
export const detailsCopyOptions = (options: Options<DetailsCopyData>) => queryOptions<DetailsCopyResponse, DefaultError, DetailsCopyResponse, ReturnType<typeof detailsCopyQueryKey>>({
|
|
2342
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2343
|
+
const { data } = await detailsCopy({
|
|
2344
|
+
...options,
|
|
2345
|
+
...queryKey[0],
|
|
2346
|
+
signal,
|
|
2347
|
+
throwOnError: true
|
|
2348
|
+
});
|
|
2349
|
+
return data;
|
|
2350
|
+
},
|
|
2351
|
+
queryKey: detailsCopyQueryKey(options)
|
|
2352
|
+
});
|
|
2353
|
+
|
|
2354
|
+
export const alternativeNamesCopyQueryKey = (options: Options<AlternativeNamesCopyData>) => createQueryKey('alternativeNamesCopy', options);
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* Images
|
|
2358
|
+
*
|
|
2359
|
+
* Get the TV network logos by id.
|
|
2360
|
+
*/
|
|
2361
|
+
export const alternativeNamesCopyOptions = (options: Options<AlternativeNamesCopyData>) => queryOptions<AlternativeNamesCopyResponse, DefaultError, AlternativeNamesCopyResponse, ReturnType<typeof alternativeNamesCopyQueryKey>>({
|
|
2362
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2363
|
+
const { data } = await alternativeNamesCopy({
|
|
2364
|
+
...options,
|
|
2365
|
+
...queryKey[0],
|
|
2366
|
+
signal,
|
|
2367
|
+
throwOnError: true
|
|
2368
|
+
});
|
|
2369
|
+
return data;
|
|
2370
|
+
},
|
|
2371
|
+
queryKey: alternativeNamesCopyQueryKey(options)
|
|
2372
|
+
});
|
|
2373
|
+
|
|
2374
|
+
export const personPopularListQueryKey = (options?: Options<PersonPopularListData>) => createQueryKey('personPopularList', options);
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* Popular
|
|
2378
|
+
*
|
|
2379
|
+
* Get a list of people ordered by popularity.
|
|
2380
|
+
*/
|
|
2381
|
+
export const personPopularListOptions = (options?: Options<PersonPopularListData>) => queryOptions<PersonPopularListResponse, DefaultError, PersonPopularListResponse, ReturnType<typeof personPopularListQueryKey>>({
|
|
2382
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2383
|
+
const { data } = await personPopularList({
|
|
2384
|
+
...options,
|
|
2385
|
+
...queryKey[0],
|
|
2386
|
+
signal,
|
|
2387
|
+
throwOnError: true
|
|
2388
|
+
});
|
|
2389
|
+
return data;
|
|
2390
|
+
},
|
|
2391
|
+
queryKey: personPopularListQueryKey(options)
|
|
2392
|
+
});
|
|
2393
|
+
|
|
2394
|
+
export const personPopularListInfiniteQueryKey = (options?: Options<PersonPopularListData>): QueryKey<Options<PersonPopularListData>> => createQueryKey('personPopularList', options, true);
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* Popular
|
|
2398
|
+
*
|
|
2399
|
+
* Get a list of people ordered by popularity.
|
|
2400
|
+
*/
|
|
2401
|
+
export const personPopularListInfiniteOptions = (options?: Options<PersonPopularListData>) => infiniteQueryOptions<PersonPopularListResponse, DefaultError, InfiniteData<PersonPopularListResponse>, QueryKey<Options<PersonPopularListData>>, number | Pick<QueryKey<Options<PersonPopularListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2402
|
+
// @ts-ignore
|
|
2403
|
+
{
|
|
2404
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2405
|
+
// @ts-ignore
|
|
2406
|
+
const page: Pick<QueryKey<Options<PersonPopularListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2407
|
+
query: {
|
|
2408
|
+
page: pageParam
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2412
|
+
const { data } = await personPopularList({
|
|
2413
|
+
...options,
|
|
2414
|
+
...params,
|
|
2415
|
+
signal,
|
|
2416
|
+
throwOnError: true
|
|
2417
|
+
});
|
|
2418
|
+
return data;
|
|
2419
|
+
},
|
|
2420
|
+
queryKey: personPopularListInfiniteQueryKey(options)
|
|
2421
|
+
});
|
|
2422
|
+
|
|
2423
|
+
export const personDetailsQueryKey = (options: Options<PersonDetailsData>) => createQueryKey('personDetails', options);
|
|
2424
|
+
|
|
2425
|
+
/**
|
|
2426
|
+
* Details
|
|
2427
|
+
*
|
|
2428
|
+
* Query the top level details of a person.
|
|
2429
|
+
*/
|
|
2430
|
+
export const personDetailsOptions = (options: Options<PersonDetailsData>) => queryOptions<PersonDetailsResponse, DefaultError, PersonDetailsResponse, ReturnType<typeof personDetailsQueryKey>>({
|
|
2431
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2432
|
+
const { data } = await personDetails({
|
|
2433
|
+
...options,
|
|
2434
|
+
...queryKey[0],
|
|
2435
|
+
signal,
|
|
2436
|
+
throwOnError: true
|
|
2437
|
+
});
|
|
2438
|
+
return data;
|
|
2439
|
+
},
|
|
2440
|
+
queryKey: personDetailsQueryKey(options)
|
|
2441
|
+
});
|
|
2442
|
+
|
|
2443
|
+
export const personChangesQueryKey = (options: Options<PersonChangesData>) => createQueryKey('personChanges', options);
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Changes
|
|
2447
|
+
*
|
|
2448
|
+
* Get the recent changes for a person.
|
|
2449
|
+
*/
|
|
2450
|
+
export const personChangesOptions = (options: Options<PersonChangesData>) => queryOptions<PersonChangesResponse, DefaultError, PersonChangesResponse, ReturnType<typeof personChangesQueryKey>>({
|
|
2451
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2452
|
+
const { data } = await personChanges({
|
|
2453
|
+
...options,
|
|
2454
|
+
...queryKey[0],
|
|
2455
|
+
signal,
|
|
2456
|
+
throwOnError: true
|
|
2457
|
+
});
|
|
2458
|
+
return data;
|
|
2459
|
+
},
|
|
2460
|
+
queryKey: personChangesQueryKey(options)
|
|
2461
|
+
});
|
|
2462
|
+
|
|
2463
|
+
export const personChangesInfiniteQueryKey = (options: Options<PersonChangesData>): QueryKey<Options<PersonChangesData>> => createQueryKey('personChanges', options, true);
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Changes
|
|
2467
|
+
*
|
|
2468
|
+
* Get the recent changes for a person.
|
|
2469
|
+
*/
|
|
2470
|
+
export const personChangesInfiniteOptions = (options: Options<PersonChangesData>) => infiniteQueryOptions<PersonChangesResponse, DefaultError, InfiniteData<PersonChangesResponse>, QueryKey<Options<PersonChangesData>>, number | Pick<QueryKey<Options<PersonChangesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2471
|
+
// @ts-ignore
|
|
2472
|
+
{
|
|
2473
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2474
|
+
// @ts-ignore
|
|
2475
|
+
const page: Pick<QueryKey<Options<PersonChangesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2476
|
+
query: {
|
|
2477
|
+
page: pageParam
|
|
2478
|
+
}
|
|
2479
|
+
};
|
|
2480
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2481
|
+
const { data } = await personChanges({
|
|
2482
|
+
...options,
|
|
2483
|
+
...params,
|
|
2484
|
+
signal,
|
|
2485
|
+
throwOnError: true
|
|
2486
|
+
});
|
|
2487
|
+
return data;
|
|
2488
|
+
},
|
|
2489
|
+
queryKey: personChangesInfiniteQueryKey(options)
|
|
2490
|
+
});
|
|
2491
|
+
|
|
2492
|
+
export const personCombinedCreditsQueryKey = (options: Options<PersonCombinedCreditsData>) => createQueryKey('personCombinedCredits', options);
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* Combined Credits
|
|
2496
|
+
*
|
|
2497
|
+
* Get the combined movie and TV credits that belong to a person.
|
|
2498
|
+
*/
|
|
2499
|
+
export const personCombinedCreditsOptions = (options: Options<PersonCombinedCreditsData>) => queryOptions<PersonCombinedCreditsResponse, DefaultError, PersonCombinedCreditsResponse, ReturnType<typeof personCombinedCreditsQueryKey>>({
|
|
2500
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2501
|
+
const { data } = await personCombinedCredits({
|
|
2502
|
+
...options,
|
|
2503
|
+
...queryKey[0],
|
|
2504
|
+
signal,
|
|
2505
|
+
throwOnError: true
|
|
2506
|
+
});
|
|
2507
|
+
return data;
|
|
2508
|
+
},
|
|
2509
|
+
queryKey: personCombinedCreditsQueryKey(options)
|
|
2510
|
+
});
|
|
2511
|
+
|
|
2512
|
+
export const personExternalIdsQueryKey = (options: Options<PersonExternalIdsData>) => createQueryKey('personExternalIds', options);
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* External IDs
|
|
2516
|
+
*
|
|
2517
|
+
* Get the external ID's that belong to a person.
|
|
2518
|
+
*/
|
|
2519
|
+
export const personExternalIdsOptions = (options: Options<PersonExternalIdsData>) => queryOptions<PersonExternalIdsResponse, DefaultError, PersonExternalIdsResponse, ReturnType<typeof personExternalIdsQueryKey>>({
|
|
2520
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2521
|
+
const { data } = await personExternalIds({
|
|
2522
|
+
...options,
|
|
2523
|
+
...queryKey[0],
|
|
2524
|
+
signal,
|
|
2525
|
+
throwOnError: true
|
|
2526
|
+
});
|
|
2527
|
+
return data;
|
|
2528
|
+
},
|
|
2529
|
+
queryKey: personExternalIdsQueryKey(options)
|
|
2530
|
+
});
|
|
2531
|
+
|
|
2532
|
+
export const personImagesQueryKey = (options: Options<PersonImagesData>) => createQueryKey('personImages', options);
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
* Images
|
|
2536
|
+
*
|
|
2537
|
+
* Get the profile images that belong to a person.
|
|
2538
|
+
*/
|
|
2539
|
+
export const personImagesOptions = (options: Options<PersonImagesData>) => queryOptions<PersonImagesResponse, DefaultError, PersonImagesResponse, ReturnType<typeof personImagesQueryKey>>({
|
|
2540
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2541
|
+
const { data } = await personImages({
|
|
2542
|
+
...options,
|
|
2543
|
+
...queryKey[0],
|
|
2544
|
+
signal,
|
|
2545
|
+
throwOnError: true
|
|
2546
|
+
});
|
|
2547
|
+
return data;
|
|
2548
|
+
},
|
|
2549
|
+
queryKey: personImagesQueryKey(options)
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2552
|
+
export const personLatestIdQueryKey = (options?: Options<PersonLatestIdData>) => createQueryKey('personLatestId', options);
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* Latest
|
|
2556
|
+
*
|
|
2557
|
+
* Get the newest created person. This is a live response and will continuously change.
|
|
2558
|
+
*/
|
|
2559
|
+
export const personLatestIdOptions = (options?: Options<PersonLatestIdData>) => queryOptions<PersonLatestIdResponse, DefaultError, PersonLatestIdResponse, ReturnType<typeof personLatestIdQueryKey>>({
|
|
2560
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2561
|
+
const { data } = await personLatestId({
|
|
2562
|
+
...options,
|
|
2563
|
+
...queryKey[0],
|
|
2564
|
+
signal,
|
|
2565
|
+
throwOnError: true
|
|
2566
|
+
});
|
|
2567
|
+
return data;
|
|
2568
|
+
},
|
|
2569
|
+
queryKey: personLatestIdQueryKey(options)
|
|
2570
|
+
});
|
|
2571
|
+
|
|
2572
|
+
export const personMovieCreditsQueryKey = (options: Options<PersonMovieCreditsData>) => createQueryKey('personMovieCredits', options);
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* Movie Credits
|
|
2576
|
+
*
|
|
2577
|
+
* Get the movie credits for a person.
|
|
2578
|
+
*/
|
|
2579
|
+
export const personMovieCreditsOptions = (options: Options<PersonMovieCreditsData>) => queryOptions<PersonMovieCreditsResponse, DefaultError, PersonMovieCreditsResponse, ReturnType<typeof personMovieCreditsQueryKey>>({
|
|
2580
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2581
|
+
const { data } = await personMovieCredits({
|
|
2582
|
+
...options,
|
|
2583
|
+
...queryKey[0],
|
|
2584
|
+
signal,
|
|
2585
|
+
throwOnError: true
|
|
2586
|
+
});
|
|
2587
|
+
return data;
|
|
2588
|
+
},
|
|
2589
|
+
queryKey: personMovieCreditsQueryKey(options)
|
|
2590
|
+
});
|
|
2591
|
+
|
|
2592
|
+
export const personTvCreditsQueryKey = (options: Options<PersonTvCreditsData>) => createQueryKey('personTvCredits', options);
|
|
2593
|
+
|
|
2594
|
+
/**
|
|
2595
|
+
* TV Credits
|
|
2596
|
+
*
|
|
2597
|
+
* Get the TV credits that belong to a person.
|
|
2598
|
+
*/
|
|
2599
|
+
export const personTvCreditsOptions = (options: Options<PersonTvCreditsData>) => queryOptions<PersonTvCreditsResponse, DefaultError, PersonTvCreditsResponse, ReturnType<typeof personTvCreditsQueryKey>>({
|
|
2600
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2601
|
+
const { data } = await personTvCredits({
|
|
2602
|
+
...options,
|
|
2603
|
+
...queryKey[0],
|
|
2604
|
+
signal,
|
|
2605
|
+
throwOnError: true
|
|
2606
|
+
});
|
|
2607
|
+
return data;
|
|
2608
|
+
},
|
|
2609
|
+
queryKey: personTvCreditsQueryKey(options)
|
|
2610
|
+
});
|
|
2611
|
+
|
|
2612
|
+
export const personTaggedImagesQueryKey = (options: Options<PersonTaggedImagesData>) => createQueryKey('personTaggedImages', options);
|
|
2613
|
+
|
|
2614
|
+
/**
|
|
2615
|
+
* Tagged Images
|
|
2616
|
+
*
|
|
2617
|
+
* Get the tagged images for a person.
|
|
2618
|
+
*/
|
|
2619
|
+
export const personTaggedImagesOptions = (options: Options<PersonTaggedImagesData>) => queryOptions<PersonTaggedImagesResponse, DefaultError, PersonTaggedImagesResponse, ReturnType<typeof personTaggedImagesQueryKey>>({
|
|
2620
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2621
|
+
const { data } = await personTaggedImages({
|
|
2622
|
+
...options,
|
|
2623
|
+
...queryKey[0],
|
|
2624
|
+
signal,
|
|
2625
|
+
throwOnError: true
|
|
2626
|
+
});
|
|
2627
|
+
return data;
|
|
2628
|
+
},
|
|
2629
|
+
queryKey: personTaggedImagesQueryKey(options)
|
|
2630
|
+
});
|
|
2631
|
+
|
|
2632
|
+
export const personTaggedImagesInfiniteQueryKey = (options: Options<PersonTaggedImagesData>): QueryKey<Options<PersonTaggedImagesData>> => createQueryKey('personTaggedImages', options, true);
|
|
2633
|
+
|
|
2634
|
+
/**
|
|
2635
|
+
* Tagged Images
|
|
2636
|
+
*
|
|
2637
|
+
* Get the tagged images for a person.
|
|
2638
|
+
*/
|
|
2639
|
+
export const personTaggedImagesInfiniteOptions = (options: Options<PersonTaggedImagesData>) => infiniteQueryOptions<PersonTaggedImagesResponse, DefaultError, InfiniteData<PersonTaggedImagesResponse>, QueryKey<Options<PersonTaggedImagesData>>, number | Pick<QueryKey<Options<PersonTaggedImagesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2640
|
+
// @ts-ignore
|
|
2641
|
+
{
|
|
2642
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2643
|
+
// @ts-ignore
|
|
2644
|
+
const page: Pick<QueryKey<Options<PersonTaggedImagesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2645
|
+
query: {
|
|
2646
|
+
page: pageParam
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2650
|
+
const { data } = await personTaggedImages({
|
|
2651
|
+
...options,
|
|
2652
|
+
...params,
|
|
2653
|
+
signal,
|
|
2654
|
+
throwOnError: true
|
|
2655
|
+
});
|
|
2656
|
+
return data;
|
|
2657
|
+
},
|
|
2658
|
+
queryKey: personTaggedImagesInfiniteQueryKey(options)
|
|
2659
|
+
});
|
|
2660
|
+
|
|
2661
|
+
export const translationsQueryKey = (options: Options<TranslationsData>) => createQueryKey('translations', options);
|
|
2662
|
+
|
|
2663
|
+
/**
|
|
2664
|
+
* Translations
|
|
2665
|
+
*
|
|
2666
|
+
* Get the translations that belong to a person.
|
|
2667
|
+
*/
|
|
2668
|
+
export const translationsOptions = (options: Options<TranslationsData>) => queryOptions<TranslationsResponse, DefaultError, TranslationsResponse, ReturnType<typeof translationsQueryKey>>({
|
|
2669
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2670
|
+
const { data } = await translations({
|
|
2671
|
+
...options,
|
|
2672
|
+
...queryKey[0],
|
|
2673
|
+
signal,
|
|
2674
|
+
throwOnError: true
|
|
2675
|
+
});
|
|
2676
|
+
return data;
|
|
2677
|
+
},
|
|
2678
|
+
queryKey: translationsQueryKey(options)
|
|
2679
|
+
});
|
|
2680
|
+
|
|
2681
|
+
export const reviewDetailsQueryKey = (options: Options<ReviewDetailsData>) => createQueryKey('reviewDetails', options);
|
|
2682
|
+
|
|
2683
|
+
/**
|
|
2684
|
+
* Details
|
|
2685
|
+
*
|
|
2686
|
+
* Retrieve the details of a movie or TV show review.
|
|
2687
|
+
*/
|
|
2688
|
+
export const reviewDetailsOptions = (options: Options<ReviewDetailsData>) => queryOptions<ReviewDetailsResponse, DefaultError, ReviewDetailsResponse, ReturnType<typeof reviewDetailsQueryKey>>({
|
|
2689
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2690
|
+
const { data } = await reviewDetails({
|
|
2691
|
+
...options,
|
|
2692
|
+
...queryKey[0],
|
|
2693
|
+
signal,
|
|
2694
|
+
throwOnError: true
|
|
2695
|
+
});
|
|
2696
|
+
return data;
|
|
2697
|
+
},
|
|
2698
|
+
queryKey: reviewDetailsQueryKey(options)
|
|
2699
|
+
});
|
|
2700
|
+
|
|
2701
|
+
export const searchCollectionQueryKey = (options: Options<SearchCollectionData>) => createQueryKey('searchCollection', options);
|
|
2702
|
+
|
|
2703
|
+
/**
|
|
2704
|
+
* Collection
|
|
2705
|
+
*
|
|
2706
|
+
* Search for collections by their original, translated and alternative names.
|
|
2707
|
+
*/
|
|
2708
|
+
export const searchCollectionOptions = (options: Options<SearchCollectionData>) => queryOptions<SearchCollectionResponse, DefaultError, SearchCollectionResponse, ReturnType<typeof searchCollectionQueryKey>>({
|
|
2709
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2710
|
+
const { data } = await searchCollection({
|
|
2711
|
+
...options,
|
|
2712
|
+
...queryKey[0],
|
|
2713
|
+
signal,
|
|
2714
|
+
throwOnError: true
|
|
2715
|
+
});
|
|
2716
|
+
return data;
|
|
2717
|
+
},
|
|
2718
|
+
queryKey: searchCollectionQueryKey(options)
|
|
2719
|
+
});
|
|
2720
|
+
|
|
2721
|
+
export const searchCollectionInfiniteQueryKey = (options: Options<SearchCollectionData>): QueryKey<Options<SearchCollectionData>> => createQueryKey('searchCollection', options, true);
|
|
2722
|
+
|
|
2723
|
+
/**
|
|
2724
|
+
* Collection
|
|
2725
|
+
*
|
|
2726
|
+
* Search for collections by their original, translated and alternative names.
|
|
2727
|
+
*/
|
|
2728
|
+
export const searchCollectionInfiniteOptions = (options: Options<SearchCollectionData>) => infiniteQueryOptions<SearchCollectionResponse, DefaultError, InfiniteData<SearchCollectionResponse>, QueryKey<Options<SearchCollectionData>>, number | Pick<QueryKey<Options<SearchCollectionData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2729
|
+
// @ts-ignore
|
|
2730
|
+
{
|
|
2731
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2732
|
+
// @ts-ignore
|
|
2733
|
+
const page: Pick<QueryKey<Options<SearchCollectionData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2734
|
+
query: {
|
|
2735
|
+
page: pageParam
|
|
2736
|
+
}
|
|
2737
|
+
};
|
|
2738
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2739
|
+
const { data } = await searchCollection({
|
|
2740
|
+
...options,
|
|
2741
|
+
...params,
|
|
2742
|
+
signal,
|
|
2743
|
+
throwOnError: true
|
|
2744
|
+
});
|
|
2745
|
+
return data;
|
|
2746
|
+
},
|
|
2747
|
+
queryKey: searchCollectionInfiniteQueryKey(options)
|
|
2748
|
+
});
|
|
2749
|
+
|
|
2750
|
+
export const searchCompanyQueryKey = (options: Options<SearchCompanyData>) => createQueryKey('searchCompany', options);
|
|
2751
|
+
|
|
2752
|
+
/**
|
|
2753
|
+
* Company
|
|
2754
|
+
*
|
|
2755
|
+
* Search for companies by their original and alternative names.
|
|
2756
|
+
*/
|
|
2757
|
+
export const searchCompanyOptions = (options: Options<SearchCompanyData>) => queryOptions<SearchCompanyResponse, DefaultError, SearchCompanyResponse, ReturnType<typeof searchCompanyQueryKey>>({
|
|
2758
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2759
|
+
const { data } = await searchCompany({
|
|
2760
|
+
...options,
|
|
2761
|
+
...queryKey[0],
|
|
2762
|
+
signal,
|
|
2763
|
+
throwOnError: true
|
|
2764
|
+
});
|
|
2765
|
+
return data;
|
|
2766
|
+
},
|
|
2767
|
+
queryKey: searchCompanyQueryKey(options)
|
|
2768
|
+
});
|
|
2769
|
+
|
|
2770
|
+
export const searchCompanyInfiniteQueryKey = (options: Options<SearchCompanyData>): QueryKey<Options<SearchCompanyData>> => createQueryKey('searchCompany', options, true);
|
|
2771
|
+
|
|
2772
|
+
/**
|
|
2773
|
+
* Company
|
|
2774
|
+
*
|
|
2775
|
+
* Search for companies by their original and alternative names.
|
|
2776
|
+
*/
|
|
2777
|
+
export const searchCompanyInfiniteOptions = (options: Options<SearchCompanyData>) => infiniteQueryOptions<SearchCompanyResponse, DefaultError, InfiniteData<SearchCompanyResponse>, QueryKey<Options<SearchCompanyData>>, number | Pick<QueryKey<Options<SearchCompanyData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2778
|
+
// @ts-ignore
|
|
2779
|
+
{
|
|
2780
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2781
|
+
// @ts-ignore
|
|
2782
|
+
const page: Pick<QueryKey<Options<SearchCompanyData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2783
|
+
query: {
|
|
2784
|
+
page: pageParam
|
|
2785
|
+
}
|
|
2786
|
+
};
|
|
2787
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2788
|
+
const { data } = await searchCompany({
|
|
2789
|
+
...options,
|
|
2790
|
+
...params,
|
|
2791
|
+
signal,
|
|
2792
|
+
throwOnError: true
|
|
2793
|
+
});
|
|
2794
|
+
return data;
|
|
2795
|
+
},
|
|
2796
|
+
queryKey: searchCompanyInfiniteQueryKey(options)
|
|
2797
|
+
});
|
|
2798
|
+
|
|
2799
|
+
export const searchKeywordQueryKey = (options: Options<SearchKeywordData>) => createQueryKey('searchKeyword', options);
|
|
2800
|
+
|
|
2801
|
+
/**
|
|
2802
|
+
* Keyword
|
|
2803
|
+
*
|
|
2804
|
+
* Search for keywords by their name.
|
|
2805
|
+
*/
|
|
2806
|
+
export const searchKeywordOptions = (options: Options<SearchKeywordData>) => queryOptions<SearchKeywordResponse, DefaultError, SearchKeywordResponse, ReturnType<typeof searchKeywordQueryKey>>({
|
|
2807
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2808
|
+
const { data } = await searchKeyword({
|
|
2809
|
+
...options,
|
|
2810
|
+
...queryKey[0],
|
|
2811
|
+
signal,
|
|
2812
|
+
throwOnError: true
|
|
2813
|
+
});
|
|
2814
|
+
return data;
|
|
2815
|
+
},
|
|
2816
|
+
queryKey: searchKeywordQueryKey(options)
|
|
2817
|
+
});
|
|
2818
|
+
|
|
2819
|
+
export const searchKeywordInfiniteQueryKey = (options: Options<SearchKeywordData>): QueryKey<Options<SearchKeywordData>> => createQueryKey('searchKeyword', options, true);
|
|
2820
|
+
|
|
2821
|
+
/**
|
|
2822
|
+
* Keyword
|
|
2823
|
+
*
|
|
2824
|
+
* Search for keywords by their name.
|
|
2825
|
+
*/
|
|
2826
|
+
export const searchKeywordInfiniteOptions = (options: Options<SearchKeywordData>) => infiniteQueryOptions<SearchKeywordResponse, DefaultError, InfiniteData<SearchKeywordResponse>, QueryKey<Options<SearchKeywordData>>, number | Pick<QueryKey<Options<SearchKeywordData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2827
|
+
// @ts-ignore
|
|
2828
|
+
{
|
|
2829
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2830
|
+
// @ts-ignore
|
|
2831
|
+
const page: Pick<QueryKey<Options<SearchKeywordData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2832
|
+
query: {
|
|
2833
|
+
page: pageParam
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2836
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2837
|
+
const { data } = await searchKeyword({
|
|
2838
|
+
...options,
|
|
2839
|
+
...params,
|
|
2840
|
+
signal,
|
|
2841
|
+
throwOnError: true
|
|
2842
|
+
});
|
|
2843
|
+
return data;
|
|
2844
|
+
},
|
|
2845
|
+
queryKey: searchKeywordInfiniteQueryKey(options)
|
|
2846
|
+
});
|
|
2847
|
+
|
|
2848
|
+
export const searchMovieQueryKey = (options: Options<SearchMovieData>) => createQueryKey('searchMovie', options);
|
|
2849
|
+
|
|
2850
|
+
/**
|
|
2851
|
+
* Movie
|
|
2852
|
+
*
|
|
2853
|
+
* Search for movies by their original, translated and alternative titles.
|
|
2854
|
+
*/
|
|
2855
|
+
export const searchMovieOptions = (options: Options<SearchMovieData>) => queryOptions<SearchMovieResponse, DefaultError, SearchMovieResponse, ReturnType<typeof searchMovieQueryKey>>({
|
|
2856
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2857
|
+
const { data } = await searchMovie({
|
|
2858
|
+
...options,
|
|
2859
|
+
...queryKey[0],
|
|
2860
|
+
signal,
|
|
2861
|
+
throwOnError: true
|
|
2862
|
+
});
|
|
2863
|
+
return data;
|
|
2864
|
+
},
|
|
2865
|
+
queryKey: searchMovieQueryKey(options)
|
|
2866
|
+
});
|
|
2867
|
+
|
|
2868
|
+
export const searchMovieInfiniteQueryKey = (options: Options<SearchMovieData>): QueryKey<Options<SearchMovieData>> => createQueryKey('searchMovie', options, true);
|
|
2869
|
+
|
|
2870
|
+
/**
|
|
2871
|
+
* Movie
|
|
2872
|
+
*
|
|
2873
|
+
* Search for movies by their original, translated and alternative titles.
|
|
2874
|
+
*/
|
|
2875
|
+
export const searchMovieInfiniteOptions = (options: Options<SearchMovieData>) => infiniteQueryOptions<SearchMovieResponse, DefaultError, InfiniteData<SearchMovieResponse>, QueryKey<Options<SearchMovieData>>, number | Pick<QueryKey<Options<SearchMovieData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2876
|
+
// @ts-ignore
|
|
2877
|
+
{
|
|
2878
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2879
|
+
// @ts-ignore
|
|
2880
|
+
const page: Pick<QueryKey<Options<SearchMovieData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2881
|
+
query: {
|
|
2882
|
+
page: pageParam
|
|
2883
|
+
}
|
|
2884
|
+
};
|
|
2885
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2886
|
+
const { data } = await searchMovie({
|
|
2887
|
+
...options,
|
|
2888
|
+
...params,
|
|
2889
|
+
signal,
|
|
2890
|
+
throwOnError: true
|
|
2891
|
+
});
|
|
2892
|
+
return data;
|
|
2893
|
+
},
|
|
2894
|
+
queryKey: searchMovieInfiniteQueryKey(options)
|
|
2895
|
+
});
|
|
2896
|
+
|
|
2897
|
+
export const searchMultiQueryKey = (options: Options<SearchMultiData>) => createQueryKey('searchMulti', options);
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* Multi
|
|
2901
|
+
*
|
|
2902
|
+
* Use multi search when you want to search for movies, TV shows and people in a single request.
|
|
2903
|
+
*/
|
|
2904
|
+
export const searchMultiOptions = (options: Options<SearchMultiData>) => queryOptions<SearchMultiResponse, DefaultError, SearchMultiResponse, ReturnType<typeof searchMultiQueryKey>>({
|
|
2905
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2906
|
+
const { data } = await searchMulti({
|
|
2907
|
+
...options,
|
|
2908
|
+
...queryKey[0],
|
|
2909
|
+
signal,
|
|
2910
|
+
throwOnError: true
|
|
2911
|
+
});
|
|
2912
|
+
return data;
|
|
2913
|
+
},
|
|
2914
|
+
queryKey: searchMultiQueryKey(options)
|
|
2915
|
+
});
|
|
2916
|
+
|
|
2917
|
+
export const searchMultiInfiniteQueryKey = (options: Options<SearchMultiData>): QueryKey<Options<SearchMultiData>> => createQueryKey('searchMulti', options, true);
|
|
2918
|
+
|
|
2919
|
+
/**
|
|
2920
|
+
* Multi
|
|
2921
|
+
*
|
|
2922
|
+
* Use multi search when you want to search for movies, TV shows and people in a single request.
|
|
2923
|
+
*/
|
|
2924
|
+
export const searchMultiInfiniteOptions = (options: Options<SearchMultiData>) => infiniteQueryOptions<SearchMultiResponse, DefaultError, InfiniteData<SearchMultiResponse>, QueryKey<Options<SearchMultiData>>, number | Pick<QueryKey<Options<SearchMultiData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2925
|
+
// @ts-ignore
|
|
2926
|
+
{
|
|
2927
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2928
|
+
// @ts-ignore
|
|
2929
|
+
const page: Pick<QueryKey<Options<SearchMultiData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2930
|
+
query: {
|
|
2931
|
+
page: pageParam
|
|
2932
|
+
}
|
|
2933
|
+
};
|
|
2934
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2935
|
+
const { data } = await searchMulti({
|
|
2936
|
+
...options,
|
|
2937
|
+
...params,
|
|
2938
|
+
signal,
|
|
2939
|
+
throwOnError: true
|
|
2940
|
+
});
|
|
2941
|
+
return data;
|
|
2942
|
+
},
|
|
2943
|
+
queryKey: searchMultiInfiniteQueryKey(options)
|
|
2944
|
+
});
|
|
2945
|
+
|
|
2946
|
+
export const searchPersonQueryKey = (options: Options<SearchPersonData>) => createQueryKey('searchPerson', options);
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Person
|
|
2950
|
+
*
|
|
2951
|
+
* Search for people by their name and also known as names.
|
|
2952
|
+
*/
|
|
2953
|
+
export const searchPersonOptions = (options: Options<SearchPersonData>) => queryOptions<SearchPersonResponse, DefaultError, SearchPersonResponse, ReturnType<typeof searchPersonQueryKey>>({
|
|
2954
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2955
|
+
const { data } = await searchPerson({
|
|
2956
|
+
...options,
|
|
2957
|
+
...queryKey[0],
|
|
2958
|
+
signal,
|
|
2959
|
+
throwOnError: true
|
|
2960
|
+
});
|
|
2961
|
+
return data;
|
|
2962
|
+
},
|
|
2963
|
+
queryKey: searchPersonQueryKey(options)
|
|
2964
|
+
});
|
|
2965
|
+
|
|
2966
|
+
export const searchPersonInfiniteQueryKey = (options: Options<SearchPersonData>): QueryKey<Options<SearchPersonData>> => createQueryKey('searchPerson', options, true);
|
|
2967
|
+
|
|
2968
|
+
/**
|
|
2969
|
+
* Person
|
|
2970
|
+
*
|
|
2971
|
+
* Search for people by their name and also known as names.
|
|
2972
|
+
*/
|
|
2973
|
+
export const searchPersonInfiniteOptions = (options: Options<SearchPersonData>) => infiniteQueryOptions<SearchPersonResponse, DefaultError, InfiniteData<SearchPersonResponse>, QueryKey<Options<SearchPersonData>>, number | Pick<QueryKey<Options<SearchPersonData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
2974
|
+
// @ts-ignore
|
|
2975
|
+
{
|
|
2976
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2977
|
+
// @ts-ignore
|
|
2978
|
+
const page: Pick<QueryKey<Options<SearchPersonData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
2979
|
+
query: {
|
|
2980
|
+
page: pageParam
|
|
2981
|
+
}
|
|
2982
|
+
};
|
|
2983
|
+
const params = createInfiniteParams(queryKey, page);
|
|
2984
|
+
const { data } = await searchPerson({
|
|
2985
|
+
...options,
|
|
2986
|
+
...params,
|
|
2987
|
+
signal,
|
|
2988
|
+
throwOnError: true
|
|
2989
|
+
});
|
|
2990
|
+
return data;
|
|
2991
|
+
},
|
|
2992
|
+
queryKey: searchPersonInfiniteQueryKey(options)
|
|
2993
|
+
});
|
|
2994
|
+
|
|
2995
|
+
export const searchTvQueryKey = (options: Options<SearchTvData>) => createQueryKey('searchTv', options);
|
|
2996
|
+
|
|
2997
|
+
/**
|
|
2998
|
+
* TV
|
|
2999
|
+
*
|
|
3000
|
+
* Search for TV shows by their original, translated and also known as names.
|
|
3001
|
+
*/
|
|
3002
|
+
export const searchTvOptions = (options: Options<SearchTvData>) => queryOptions<SearchTvResponse, DefaultError, SearchTvResponse, ReturnType<typeof searchTvQueryKey>>({
|
|
3003
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3004
|
+
const { data } = await searchTv({
|
|
3005
|
+
...options,
|
|
3006
|
+
...queryKey[0],
|
|
3007
|
+
signal,
|
|
3008
|
+
throwOnError: true
|
|
3009
|
+
});
|
|
3010
|
+
return data;
|
|
3011
|
+
},
|
|
3012
|
+
queryKey: searchTvQueryKey(options)
|
|
3013
|
+
});
|
|
3014
|
+
|
|
3015
|
+
export const searchTvInfiniteQueryKey = (options: Options<SearchTvData>): QueryKey<Options<SearchTvData>> => createQueryKey('searchTv', options, true);
|
|
3016
|
+
|
|
3017
|
+
/**
|
|
3018
|
+
* TV
|
|
3019
|
+
*
|
|
3020
|
+
* Search for TV shows by their original, translated and also known as names.
|
|
3021
|
+
*/
|
|
3022
|
+
export const searchTvInfiniteOptions = (options: Options<SearchTvData>) => infiniteQueryOptions<SearchTvResponse, DefaultError, InfiniteData<SearchTvResponse>, QueryKey<Options<SearchTvData>>, number | Pick<QueryKey<Options<SearchTvData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3023
|
+
// @ts-ignore
|
|
3024
|
+
{
|
|
3025
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3026
|
+
// @ts-ignore
|
|
3027
|
+
const page: Pick<QueryKey<Options<SearchTvData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3028
|
+
query: {
|
|
3029
|
+
page: pageParam
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
3032
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3033
|
+
const { data } = await searchTv({
|
|
3034
|
+
...options,
|
|
3035
|
+
...params,
|
|
3036
|
+
signal,
|
|
3037
|
+
throwOnError: true
|
|
3038
|
+
});
|
|
3039
|
+
return data;
|
|
3040
|
+
},
|
|
3041
|
+
queryKey: searchTvInfiniteQueryKey(options)
|
|
3042
|
+
});
|
|
3043
|
+
|
|
3044
|
+
export const trendingAllQueryKey = (options: Options<TrendingAllData>) => createQueryKey('trendingAll', options);
|
|
3045
|
+
|
|
3046
|
+
/**
|
|
3047
|
+
* All
|
|
3048
|
+
*
|
|
3049
|
+
* Get the trending movies, TV shows and people.
|
|
3050
|
+
*/
|
|
3051
|
+
export const trendingAllOptions = (options: Options<TrendingAllData>) => queryOptions<TrendingAllResponse, DefaultError, TrendingAllResponse, ReturnType<typeof trendingAllQueryKey>>({
|
|
3052
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3053
|
+
const { data } = await trendingAll({
|
|
3054
|
+
...options,
|
|
3055
|
+
...queryKey[0],
|
|
3056
|
+
signal,
|
|
3057
|
+
throwOnError: true
|
|
3058
|
+
});
|
|
3059
|
+
return data;
|
|
3060
|
+
},
|
|
3061
|
+
queryKey: trendingAllQueryKey(options)
|
|
3062
|
+
});
|
|
3063
|
+
|
|
3064
|
+
export const trendingMoviesQueryKey = (options: Options<TrendingMoviesData>) => createQueryKey('trendingMovies', options);
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* Movies
|
|
3068
|
+
*
|
|
3069
|
+
* Get the trending movies on TMDB.
|
|
3070
|
+
*/
|
|
3071
|
+
export const trendingMoviesOptions = (options: Options<TrendingMoviesData>) => queryOptions<TrendingMoviesResponse, DefaultError, TrendingMoviesResponse, ReturnType<typeof trendingMoviesQueryKey>>({
|
|
3072
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3073
|
+
const { data } = await trendingMovies({
|
|
3074
|
+
...options,
|
|
3075
|
+
...queryKey[0],
|
|
3076
|
+
signal,
|
|
3077
|
+
throwOnError: true
|
|
3078
|
+
});
|
|
3079
|
+
return data;
|
|
3080
|
+
},
|
|
3081
|
+
queryKey: trendingMoviesQueryKey(options)
|
|
3082
|
+
});
|
|
3083
|
+
|
|
3084
|
+
export const trendingPeopleQueryKey = (options: Options<TrendingPeopleData>) => createQueryKey('trendingPeople', options);
|
|
3085
|
+
|
|
3086
|
+
/**
|
|
3087
|
+
* People
|
|
3088
|
+
*
|
|
3089
|
+
* Get the trending people on TMDB.
|
|
3090
|
+
*/
|
|
3091
|
+
export const trendingPeopleOptions = (options: Options<TrendingPeopleData>) => queryOptions<TrendingPeopleResponse, DefaultError, TrendingPeopleResponse, ReturnType<typeof trendingPeopleQueryKey>>({
|
|
3092
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3093
|
+
const { data } = await trendingPeople({
|
|
3094
|
+
...options,
|
|
3095
|
+
...queryKey[0],
|
|
3096
|
+
signal,
|
|
3097
|
+
throwOnError: true
|
|
3098
|
+
});
|
|
3099
|
+
return data;
|
|
3100
|
+
},
|
|
3101
|
+
queryKey: trendingPeopleQueryKey(options)
|
|
3102
|
+
});
|
|
3103
|
+
|
|
3104
|
+
export const trendingTvQueryKey = (options: Options<TrendingTvData>) => createQueryKey('trendingTv', options);
|
|
3105
|
+
|
|
3106
|
+
/**
|
|
3107
|
+
* TV
|
|
3108
|
+
*
|
|
3109
|
+
* Get the trending TV shows on TMDB.
|
|
3110
|
+
*/
|
|
3111
|
+
export const trendingTvOptions = (options: Options<TrendingTvData>) => queryOptions<TrendingTvResponse, DefaultError, TrendingTvResponse, ReturnType<typeof trendingTvQueryKey>>({
|
|
3112
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3113
|
+
const { data } = await trendingTv({
|
|
3114
|
+
...options,
|
|
3115
|
+
...queryKey[0],
|
|
3116
|
+
signal,
|
|
3117
|
+
throwOnError: true
|
|
3118
|
+
});
|
|
3119
|
+
return data;
|
|
3120
|
+
},
|
|
3121
|
+
queryKey: trendingTvQueryKey(options)
|
|
3122
|
+
});
|
|
3123
|
+
|
|
3124
|
+
export const tvSeriesAiringTodayListQueryKey = (options?: Options<TvSeriesAiringTodayListData>) => createQueryKey('tvSeriesAiringTodayList', options);
|
|
3125
|
+
|
|
3126
|
+
/**
|
|
3127
|
+
* Airing Today
|
|
3128
|
+
*
|
|
3129
|
+
* Get a list of TV shows airing today.
|
|
3130
|
+
*/
|
|
3131
|
+
export const tvSeriesAiringTodayListOptions = (options?: Options<TvSeriesAiringTodayListData>) => queryOptions<TvSeriesAiringTodayListResponse, DefaultError, TvSeriesAiringTodayListResponse, ReturnType<typeof tvSeriesAiringTodayListQueryKey>>({
|
|
3132
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3133
|
+
const { data } = await tvSeriesAiringTodayList({
|
|
3134
|
+
...options,
|
|
3135
|
+
...queryKey[0],
|
|
3136
|
+
signal,
|
|
3137
|
+
throwOnError: true
|
|
3138
|
+
});
|
|
3139
|
+
return data;
|
|
3140
|
+
},
|
|
3141
|
+
queryKey: tvSeriesAiringTodayListQueryKey(options)
|
|
3142
|
+
});
|
|
3143
|
+
|
|
3144
|
+
export const tvSeriesAiringTodayListInfiniteQueryKey = (options?: Options<TvSeriesAiringTodayListData>): QueryKey<Options<TvSeriesAiringTodayListData>> => createQueryKey('tvSeriesAiringTodayList', options, true);
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* Airing Today
|
|
3148
|
+
*
|
|
3149
|
+
* Get a list of TV shows airing today.
|
|
3150
|
+
*/
|
|
3151
|
+
export const tvSeriesAiringTodayListInfiniteOptions = (options?: Options<TvSeriesAiringTodayListData>) => infiniteQueryOptions<TvSeriesAiringTodayListResponse, DefaultError, InfiniteData<TvSeriesAiringTodayListResponse>, QueryKey<Options<TvSeriesAiringTodayListData>>, number | Pick<QueryKey<Options<TvSeriesAiringTodayListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3152
|
+
// @ts-ignore
|
|
3153
|
+
{
|
|
3154
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3155
|
+
// @ts-ignore
|
|
3156
|
+
const page: Pick<QueryKey<Options<TvSeriesAiringTodayListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3157
|
+
query: {
|
|
3158
|
+
page: pageParam
|
|
3159
|
+
}
|
|
3160
|
+
};
|
|
3161
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3162
|
+
const { data } = await tvSeriesAiringTodayList({
|
|
3163
|
+
...options,
|
|
3164
|
+
...params,
|
|
3165
|
+
signal,
|
|
3166
|
+
throwOnError: true
|
|
3167
|
+
});
|
|
3168
|
+
return data;
|
|
3169
|
+
},
|
|
3170
|
+
queryKey: tvSeriesAiringTodayListInfiniteQueryKey(options)
|
|
3171
|
+
});
|
|
3172
|
+
|
|
3173
|
+
export const tvSeriesOnTheAirListQueryKey = (options?: Options<TvSeriesOnTheAirListData>) => createQueryKey('tvSeriesOnTheAirList', options);
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* On The Air
|
|
3177
|
+
*
|
|
3178
|
+
* Get a list of TV shows that air in the next 7 days.
|
|
3179
|
+
*/
|
|
3180
|
+
export const tvSeriesOnTheAirListOptions = (options?: Options<TvSeriesOnTheAirListData>) => queryOptions<TvSeriesOnTheAirListResponse, DefaultError, TvSeriesOnTheAirListResponse, ReturnType<typeof tvSeriesOnTheAirListQueryKey>>({
|
|
3181
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3182
|
+
const { data } = await tvSeriesOnTheAirList({
|
|
3183
|
+
...options,
|
|
3184
|
+
...queryKey[0],
|
|
3185
|
+
signal,
|
|
3186
|
+
throwOnError: true
|
|
3187
|
+
});
|
|
3188
|
+
return data;
|
|
3189
|
+
},
|
|
3190
|
+
queryKey: tvSeriesOnTheAirListQueryKey(options)
|
|
3191
|
+
});
|
|
3192
|
+
|
|
3193
|
+
export const tvSeriesOnTheAirListInfiniteQueryKey = (options?: Options<TvSeriesOnTheAirListData>): QueryKey<Options<TvSeriesOnTheAirListData>> => createQueryKey('tvSeriesOnTheAirList', options, true);
|
|
3194
|
+
|
|
3195
|
+
/**
|
|
3196
|
+
* On The Air
|
|
3197
|
+
*
|
|
3198
|
+
* Get a list of TV shows that air in the next 7 days.
|
|
3199
|
+
*/
|
|
3200
|
+
export const tvSeriesOnTheAirListInfiniteOptions = (options?: Options<TvSeriesOnTheAirListData>) => infiniteQueryOptions<TvSeriesOnTheAirListResponse, DefaultError, InfiniteData<TvSeriesOnTheAirListResponse>, QueryKey<Options<TvSeriesOnTheAirListData>>, number | Pick<QueryKey<Options<TvSeriesOnTheAirListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3201
|
+
// @ts-ignore
|
|
3202
|
+
{
|
|
3203
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3204
|
+
// @ts-ignore
|
|
3205
|
+
const page: Pick<QueryKey<Options<TvSeriesOnTheAirListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3206
|
+
query: {
|
|
3207
|
+
page: pageParam
|
|
3208
|
+
}
|
|
3209
|
+
};
|
|
3210
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3211
|
+
const { data } = await tvSeriesOnTheAirList({
|
|
3212
|
+
...options,
|
|
3213
|
+
...params,
|
|
3214
|
+
signal,
|
|
3215
|
+
throwOnError: true
|
|
3216
|
+
});
|
|
3217
|
+
return data;
|
|
3218
|
+
},
|
|
3219
|
+
queryKey: tvSeriesOnTheAirListInfiniteQueryKey(options)
|
|
3220
|
+
});
|
|
3221
|
+
|
|
3222
|
+
export const tvSeriesPopularListQueryKey = (options?: Options<TvSeriesPopularListData>) => createQueryKey('tvSeriesPopularList', options);
|
|
3223
|
+
|
|
3224
|
+
/**
|
|
3225
|
+
* Popular
|
|
3226
|
+
*
|
|
3227
|
+
* Get a list of TV shows ordered by popularity.
|
|
3228
|
+
*/
|
|
3229
|
+
export const tvSeriesPopularListOptions = (options?: Options<TvSeriesPopularListData>) => queryOptions<TvSeriesPopularListResponse, DefaultError, TvSeriesPopularListResponse, ReturnType<typeof tvSeriesPopularListQueryKey>>({
|
|
3230
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3231
|
+
const { data } = await tvSeriesPopularList({
|
|
3232
|
+
...options,
|
|
3233
|
+
...queryKey[0],
|
|
3234
|
+
signal,
|
|
3235
|
+
throwOnError: true
|
|
3236
|
+
});
|
|
3237
|
+
return data;
|
|
3238
|
+
},
|
|
3239
|
+
queryKey: tvSeriesPopularListQueryKey(options)
|
|
3240
|
+
});
|
|
3241
|
+
|
|
3242
|
+
export const tvSeriesPopularListInfiniteQueryKey = (options?: Options<TvSeriesPopularListData>): QueryKey<Options<TvSeriesPopularListData>> => createQueryKey('tvSeriesPopularList', options, true);
|
|
3243
|
+
|
|
3244
|
+
/**
|
|
3245
|
+
* Popular
|
|
3246
|
+
*
|
|
3247
|
+
* Get a list of TV shows ordered by popularity.
|
|
3248
|
+
*/
|
|
3249
|
+
export const tvSeriesPopularListInfiniteOptions = (options?: Options<TvSeriesPopularListData>) => infiniteQueryOptions<TvSeriesPopularListResponse, DefaultError, InfiniteData<TvSeriesPopularListResponse>, QueryKey<Options<TvSeriesPopularListData>>, number | Pick<QueryKey<Options<TvSeriesPopularListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3250
|
+
// @ts-ignore
|
|
3251
|
+
{
|
|
3252
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3253
|
+
// @ts-ignore
|
|
3254
|
+
const page: Pick<QueryKey<Options<TvSeriesPopularListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3255
|
+
query: {
|
|
3256
|
+
page: pageParam
|
|
3257
|
+
}
|
|
3258
|
+
};
|
|
3259
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3260
|
+
const { data } = await tvSeriesPopularList({
|
|
3261
|
+
...options,
|
|
3262
|
+
...params,
|
|
3263
|
+
signal,
|
|
3264
|
+
throwOnError: true
|
|
3265
|
+
});
|
|
3266
|
+
return data;
|
|
3267
|
+
},
|
|
3268
|
+
queryKey: tvSeriesPopularListInfiniteQueryKey(options)
|
|
3269
|
+
});
|
|
3270
|
+
|
|
3271
|
+
export const tvSeriesTopRatedListQueryKey = (options?: Options<TvSeriesTopRatedListData>) => createQueryKey('tvSeriesTopRatedList', options);
|
|
3272
|
+
|
|
3273
|
+
/**
|
|
3274
|
+
* Top Rated
|
|
3275
|
+
*
|
|
3276
|
+
* Get a list of TV shows ordered by rating.
|
|
3277
|
+
*/
|
|
3278
|
+
export const tvSeriesTopRatedListOptions = (options?: Options<TvSeriesTopRatedListData>) => queryOptions<TvSeriesTopRatedListResponse, DefaultError, TvSeriesTopRatedListResponse, ReturnType<typeof tvSeriesTopRatedListQueryKey>>({
|
|
3279
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3280
|
+
const { data } = await tvSeriesTopRatedList({
|
|
3281
|
+
...options,
|
|
3282
|
+
...queryKey[0],
|
|
3283
|
+
signal,
|
|
3284
|
+
throwOnError: true
|
|
3285
|
+
});
|
|
3286
|
+
return data;
|
|
3287
|
+
},
|
|
3288
|
+
queryKey: tvSeriesTopRatedListQueryKey(options)
|
|
3289
|
+
});
|
|
3290
|
+
|
|
3291
|
+
export const tvSeriesTopRatedListInfiniteQueryKey = (options?: Options<TvSeriesTopRatedListData>): QueryKey<Options<TvSeriesTopRatedListData>> => createQueryKey('tvSeriesTopRatedList', options, true);
|
|
3292
|
+
|
|
3293
|
+
/**
|
|
3294
|
+
* Top Rated
|
|
3295
|
+
*
|
|
3296
|
+
* Get a list of TV shows ordered by rating.
|
|
3297
|
+
*/
|
|
3298
|
+
export const tvSeriesTopRatedListInfiniteOptions = (options?: Options<TvSeriesTopRatedListData>) => infiniteQueryOptions<TvSeriesTopRatedListResponse, DefaultError, InfiniteData<TvSeriesTopRatedListResponse>, QueryKey<Options<TvSeriesTopRatedListData>>, number | Pick<QueryKey<Options<TvSeriesTopRatedListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3299
|
+
// @ts-ignore
|
|
3300
|
+
{
|
|
3301
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3302
|
+
// @ts-ignore
|
|
3303
|
+
const page: Pick<QueryKey<Options<TvSeriesTopRatedListData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3304
|
+
query: {
|
|
3305
|
+
page: pageParam
|
|
3306
|
+
}
|
|
3307
|
+
};
|
|
3308
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3309
|
+
const { data } = await tvSeriesTopRatedList({
|
|
3310
|
+
...options,
|
|
3311
|
+
...params,
|
|
3312
|
+
signal,
|
|
3313
|
+
throwOnError: true
|
|
3314
|
+
});
|
|
3315
|
+
return data;
|
|
3316
|
+
},
|
|
3317
|
+
queryKey: tvSeriesTopRatedListInfiniteQueryKey(options)
|
|
3318
|
+
});
|
|
3319
|
+
|
|
3320
|
+
export const tvSeriesDetailsQueryKey = (options: Options<TvSeriesDetailsData>) => createQueryKey('tvSeriesDetails', options);
|
|
3321
|
+
|
|
3322
|
+
/**
|
|
3323
|
+
* Details
|
|
3324
|
+
*
|
|
3325
|
+
* Get the details of a TV show.
|
|
3326
|
+
*/
|
|
3327
|
+
export const tvSeriesDetailsOptions = (options: Options<TvSeriesDetailsData>) => queryOptions<TvSeriesDetailsResponse, DefaultError, TvSeriesDetailsResponse, ReturnType<typeof tvSeriesDetailsQueryKey>>({
|
|
3328
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3329
|
+
const { data } = await tvSeriesDetails({
|
|
3330
|
+
...options,
|
|
3331
|
+
...queryKey[0],
|
|
3332
|
+
signal,
|
|
3333
|
+
throwOnError: true
|
|
3334
|
+
});
|
|
3335
|
+
return data;
|
|
3336
|
+
},
|
|
3337
|
+
queryKey: tvSeriesDetailsQueryKey(options)
|
|
3338
|
+
});
|
|
3339
|
+
|
|
3340
|
+
export const tvSeriesAccountStatesQueryKey = (options: Options<TvSeriesAccountStatesData>) => createQueryKey('tvSeriesAccountStates', options);
|
|
3341
|
+
|
|
3342
|
+
/**
|
|
3343
|
+
* Account States
|
|
3344
|
+
*
|
|
3345
|
+
* Get the rating, watchlist and favourite status.
|
|
3346
|
+
*/
|
|
3347
|
+
export const tvSeriesAccountStatesOptions = (options: Options<TvSeriesAccountStatesData>) => queryOptions<TvSeriesAccountStatesResponse, DefaultError, TvSeriesAccountStatesResponse, ReturnType<typeof tvSeriesAccountStatesQueryKey>>({
|
|
3348
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3349
|
+
const { data } = await tvSeriesAccountStates({
|
|
3350
|
+
...options,
|
|
3351
|
+
...queryKey[0],
|
|
3352
|
+
signal,
|
|
3353
|
+
throwOnError: true
|
|
3354
|
+
});
|
|
3355
|
+
return data;
|
|
3356
|
+
},
|
|
3357
|
+
queryKey: tvSeriesAccountStatesQueryKey(options)
|
|
3358
|
+
});
|
|
3359
|
+
|
|
3360
|
+
export const tvSeriesAggregateCreditsQueryKey = (options: Options<TvSeriesAggregateCreditsData>) => createQueryKey('tvSeriesAggregateCredits', options);
|
|
3361
|
+
|
|
3362
|
+
/**
|
|
3363
|
+
* Aggregate Credits
|
|
3364
|
+
*
|
|
3365
|
+
* Get the aggregate credits (cast and crew) that have been added to a TV show.
|
|
3366
|
+
*/
|
|
3367
|
+
export const tvSeriesAggregateCreditsOptions = (options: Options<TvSeriesAggregateCreditsData>) => queryOptions<TvSeriesAggregateCreditsResponse, DefaultError, TvSeriesAggregateCreditsResponse, ReturnType<typeof tvSeriesAggregateCreditsQueryKey>>({
|
|
3368
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3369
|
+
const { data } = await tvSeriesAggregateCredits({
|
|
3370
|
+
...options,
|
|
3371
|
+
...queryKey[0],
|
|
3372
|
+
signal,
|
|
3373
|
+
throwOnError: true
|
|
3374
|
+
});
|
|
3375
|
+
return data;
|
|
3376
|
+
},
|
|
3377
|
+
queryKey: tvSeriesAggregateCreditsQueryKey(options)
|
|
3378
|
+
});
|
|
3379
|
+
|
|
3380
|
+
export const tvSeriesAlternativeTitlesQueryKey = (options: Options<TvSeriesAlternativeTitlesData>) => createQueryKey('tvSeriesAlternativeTitles', options);
|
|
3381
|
+
|
|
3382
|
+
/**
|
|
3383
|
+
* Alternative Titles
|
|
3384
|
+
*
|
|
3385
|
+
* Get the alternative titles that have been added to a TV show.
|
|
3386
|
+
*/
|
|
3387
|
+
export const tvSeriesAlternativeTitlesOptions = (options: Options<TvSeriesAlternativeTitlesData>) => queryOptions<TvSeriesAlternativeTitlesResponse, DefaultError, TvSeriesAlternativeTitlesResponse, ReturnType<typeof tvSeriesAlternativeTitlesQueryKey>>({
|
|
3388
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3389
|
+
const { data } = await tvSeriesAlternativeTitles({
|
|
3390
|
+
...options,
|
|
3391
|
+
...queryKey[0],
|
|
3392
|
+
signal,
|
|
3393
|
+
throwOnError: true
|
|
3394
|
+
});
|
|
3395
|
+
return data;
|
|
3396
|
+
},
|
|
3397
|
+
queryKey: tvSeriesAlternativeTitlesQueryKey(options)
|
|
3398
|
+
});
|
|
3399
|
+
|
|
3400
|
+
export const tvSeriesChangesQueryKey = (options: Options<TvSeriesChangesData>) => createQueryKey('tvSeriesChanges', options);
|
|
3401
|
+
|
|
3402
|
+
/**
|
|
3403
|
+
* Changes
|
|
3404
|
+
*
|
|
3405
|
+
* Get the recent changes for a TV show.
|
|
3406
|
+
*/
|
|
3407
|
+
export const tvSeriesChangesOptions = (options: Options<TvSeriesChangesData>) => queryOptions<TvSeriesChangesResponse, DefaultError, TvSeriesChangesResponse, ReturnType<typeof tvSeriesChangesQueryKey>>({
|
|
3408
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3409
|
+
const { data } = await tvSeriesChanges({
|
|
3410
|
+
...options,
|
|
3411
|
+
...queryKey[0],
|
|
3412
|
+
signal,
|
|
3413
|
+
throwOnError: true
|
|
3414
|
+
});
|
|
3415
|
+
return data;
|
|
3416
|
+
},
|
|
3417
|
+
queryKey: tvSeriesChangesQueryKey(options)
|
|
3418
|
+
});
|
|
3419
|
+
|
|
3420
|
+
export const tvSeriesChangesInfiniteQueryKey = (options: Options<TvSeriesChangesData>): QueryKey<Options<TvSeriesChangesData>> => createQueryKey('tvSeriesChanges', options, true);
|
|
3421
|
+
|
|
3422
|
+
/**
|
|
3423
|
+
* Changes
|
|
3424
|
+
*
|
|
3425
|
+
* Get the recent changes for a TV show.
|
|
3426
|
+
*/
|
|
3427
|
+
export const tvSeriesChangesInfiniteOptions = (options: Options<TvSeriesChangesData>) => infiniteQueryOptions<TvSeriesChangesResponse, DefaultError, InfiniteData<TvSeriesChangesResponse>, QueryKey<Options<TvSeriesChangesData>>, number | Pick<QueryKey<Options<TvSeriesChangesData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3428
|
+
// @ts-ignore
|
|
3429
|
+
{
|
|
3430
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3431
|
+
// @ts-ignore
|
|
3432
|
+
const page: Pick<QueryKey<Options<TvSeriesChangesData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3433
|
+
query: {
|
|
3434
|
+
page: pageParam
|
|
3435
|
+
}
|
|
3436
|
+
};
|
|
3437
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3438
|
+
const { data } = await tvSeriesChanges({
|
|
3439
|
+
...options,
|
|
3440
|
+
...params,
|
|
3441
|
+
signal,
|
|
3442
|
+
throwOnError: true
|
|
3443
|
+
});
|
|
3444
|
+
return data;
|
|
3445
|
+
},
|
|
3446
|
+
queryKey: tvSeriesChangesInfiniteQueryKey(options)
|
|
3447
|
+
});
|
|
3448
|
+
|
|
3449
|
+
export const tvSeriesContentRatingsQueryKey = (options: Options<TvSeriesContentRatingsData>) => createQueryKey('tvSeriesContentRatings', options);
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* Content Ratings
|
|
3453
|
+
*
|
|
3454
|
+
* Get the content ratings that have been added to a TV show.
|
|
3455
|
+
*/
|
|
3456
|
+
export const tvSeriesContentRatingsOptions = (options: Options<TvSeriesContentRatingsData>) => queryOptions<TvSeriesContentRatingsResponse, DefaultError, TvSeriesContentRatingsResponse, ReturnType<typeof tvSeriesContentRatingsQueryKey>>({
|
|
3457
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3458
|
+
const { data } = await tvSeriesContentRatings({
|
|
3459
|
+
...options,
|
|
3460
|
+
...queryKey[0],
|
|
3461
|
+
signal,
|
|
3462
|
+
throwOnError: true
|
|
3463
|
+
});
|
|
3464
|
+
return data;
|
|
3465
|
+
},
|
|
3466
|
+
queryKey: tvSeriesContentRatingsQueryKey(options)
|
|
3467
|
+
});
|
|
3468
|
+
|
|
3469
|
+
export const tvSeriesCreditsQueryKey = (options: Options<TvSeriesCreditsData>) => createQueryKey('tvSeriesCredits', options);
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* Credits
|
|
3473
|
+
*
|
|
3474
|
+
* Get the latest season credits of a TV show.
|
|
3475
|
+
*/
|
|
3476
|
+
export const tvSeriesCreditsOptions = (options: Options<TvSeriesCreditsData>) => queryOptions<TvSeriesCreditsResponse, DefaultError, TvSeriesCreditsResponse, ReturnType<typeof tvSeriesCreditsQueryKey>>({
|
|
3477
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3478
|
+
const { data } = await tvSeriesCredits({
|
|
3479
|
+
...options,
|
|
3480
|
+
...queryKey[0],
|
|
3481
|
+
signal,
|
|
3482
|
+
throwOnError: true
|
|
3483
|
+
});
|
|
3484
|
+
return data;
|
|
3485
|
+
},
|
|
3486
|
+
queryKey: tvSeriesCreditsQueryKey(options)
|
|
3487
|
+
});
|
|
3488
|
+
|
|
3489
|
+
export const tvSeriesEpisodeGroupsQueryKey = (options: Options<TvSeriesEpisodeGroupsData>) => createQueryKey('tvSeriesEpisodeGroups', options);
|
|
3490
|
+
|
|
3491
|
+
/**
|
|
3492
|
+
* Episode Groups
|
|
3493
|
+
*
|
|
3494
|
+
* Get the episode groups that have been added to a TV show.
|
|
3495
|
+
*/
|
|
3496
|
+
export const tvSeriesEpisodeGroupsOptions = (options: Options<TvSeriesEpisodeGroupsData>) => queryOptions<TvSeriesEpisodeGroupsResponse, DefaultError, TvSeriesEpisodeGroupsResponse, ReturnType<typeof tvSeriesEpisodeGroupsQueryKey>>({
|
|
3497
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3498
|
+
const { data } = await tvSeriesEpisodeGroups({
|
|
3499
|
+
...options,
|
|
3500
|
+
...queryKey[0],
|
|
3501
|
+
signal,
|
|
3502
|
+
throwOnError: true
|
|
3503
|
+
});
|
|
3504
|
+
return data;
|
|
3505
|
+
},
|
|
3506
|
+
queryKey: tvSeriesEpisodeGroupsQueryKey(options)
|
|
3507
|
+
});
|
|
3508
|
+
|
|
3509
|
+
export const tvSeriesExternalIdsQueryKey = (options: Options<TvSeriesExternalIdsData>) => createQueryKey('tvSeriesExternalIds', options);
|
|
3510
|
+
|
|
3511
|
+
/**
|
|
3512
|
+
* External IDs
|
|
3513
|
+
*
|
|
3514
|
+
* Get a list of external IDs that have been added to a TV show.
|
|
3515
|
+
*/
|
|
3516
|
+
export const tvSeriesExternalIdsOptions = (options: Options<TvSeriesExternalIdsData>) => queryOptions<TvSeriesExternalIdsResponse, DefaultError, TvSeriesExternalIdsResponse, ReturnType<typeof tvSeriesExternalIdsQueryKey>>({
|
|
3517
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3518
|
+
const { data } = await tvSeriesExternalIds({
|
|
3519
|
+
...options,
|
|
3520
|
+
...queryKey[0],
|
|
3521
|
+
signal,
|
|
3522
|
+
throwOnError: true
|
|
3523
|
+
});
|
|
3524
|
+
return data;
|
|
3525
|
+
},
|
|
3526
|
+
queryKey: tvSeriesExternalIdsQueryKey(options)
|
|
3527
|
+
});
|
|
3528
|
+
|
|
3529
|
+
export const tvSeriesImagesQueryKey = (options: Options<TvSeriesImagesData>) => createQueryKey('tvSeriesImages', options);
|
|
3530
|
+
|
|
3531
|
+
/**
|
|
3532
|
+
* Images
|
|
3533
|
+
*
|
|
3534
|
+
* Get the images that belong to a TV series.
|
|
3535
|
+
*/
|
|
3536
|
+
export const tvSeriesImagesOptions = (options: Options<TvSeriesImagesData>) => queryOptions<TvSeriesImagesResponse, DefaultError, TvSeriesImagesResponse, ReturnType<typeof tvSeriesImagesQueryKey>>({
|
|
3537
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3538
|
+
const { data } = await tvSeriesImages({
|
|
3539
|
+
...options,
|
|
3540
|
+
...queryKey[0],
|
|
3541
|
+
signal,
|
|
3542
|
+
throwOnError: true
|
|
3543
|
+
});
|
|
3544
|
+
return data;
|
|
3545
|
+
},
|
|
3546
|
+
queryKey: tvSeriesImagesQueryKey(options)
|
|
3547
|
+
});
|
|
3548
|
+
|
|
3549
|
+
export const tvSeriesKeywordsQueryKey = (options: Options<TvSeriesKeywordsData>) => createQueryKey('tvSeriesKeywords', options);
|
|
3550
|
+
|
|
3551
|
+
/**
|
|
3552
|
+
* Keywords
|
|
3553
|
+
*
|
|
3554
|
+
* Get a list of keywords that have been added to a TV show.
|
|
3555
|
+
*/
|
|
3556
|
+
export const tvSeriesKeywordsOptions = (options: Options<TvSeriesKeywordsData>) => queryOptions<TvSeriesKeywordsResponse, DefaultError, TvSeriesKeywordsResponse, ReturnType<typeof tvSeriesKeywordsQueryKey>>({
|
|
3557
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3558
|
+
const { data } = await tvSeriesKeywords({
|
|
3559
|
+
...options,
|
|
3560
|
+
...queryKey[0],
|
|
3561
|
+
signal,
|
|
3562
|
+
throwOnError: true
|
|
3563
|
+
});
|
|
3564
|
+
return data;
|
|
3565
|
+
},
|
|
3566
|
+
queryKey: tvSeriesKeywordsQueryKey(options)
|
|
3567
|
+
});
|
|
3568
|
+
|
|
3569
|
+
export const tvSeriesLatestIdQueryKey = (options?: Options<TvSeriesLatestIdData>) => createQueryKey('tvSeriesLatestId', options);
|
|
3570
|
+
|
|
3571
|
+
/**
|
|
3572
|
+
* Latest
|
|
3573
|
+
*
|
|
3574
|
+
* Get the newest TV show ID.
|
|
3575
|
+
*/
|
|
3576
|
+
export const tvSeriesLatestIdOptions = (options?: Options<TvSeriesLatestIdData>) => queryOptions<TvSeriesLatestIdResponse, DefaultError, TvSeriesLatestIdResponse, ReturnType<typeof tvSeriesLatestIdQueryKey>>({
|
|
3577
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3578
|
+
const { data } = await tvSeriesLatestId({
|
|
3579
|
+
...options,
|
|
3580
|
+
...queryKey[0],
|
|
3581
|
+
signal,
|
|
3582
|
+
throwOnError: true
|
|
3583
|
+
});
|
|
3584
|
+
return data;
|
|
3585
|
+
},
|
|
3586
|
+
queryKey: tvSeriesLatestIdQueryKey(options)
|
|
3587
|
+
});
|
|
3588
|
+
|
|
3589
|
+
export const listsCopyQueryKey = (options: Options<ListsCopyData>) => createQueryKey('listsCopy', options);
|
|
3590
|
+
|
|
3591
|
+
/**
|
|
3592
|
+
* Lists
|
|
3593
|
+
*
|
|
3594
|
+
* Get the lists that a TV series has been added to.
|
|
3595
|
+
*/
|
|
3596
|
+
export const listsCopyOptions = (options: Options<ListsCopyData>) => queryOptions<ListsCopyResponse, DefaultError, ListsCopyResponse, ReturnType<typeof listsCopyQueryKey>>({
|
|
3597
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3598
|
+
const { data } = await listsCopy({
|
|
3599
|
+
...options,
|
|
3600
|
+
...queryKey[0],
|
|
3601
|
+
signal,
|
|
3602
|
+
throwOnError: true
|
|
3603
|
+
});
|
|
3604
|
+
return data;
|
|
3605
|
+
},
|
|
3606
|
+
queryKey: listsCopyQueryKey(options)
|
|
3607
|
+
});
|
|
3608
|
+
|
|
3609
|
+
export const listsCopyInfiniteQueryKey = (options: Options<ListsCopyData>): QueryKey<Options<ListsCopyData>> => createQueryKey('listsCopy', options, true);
|
|
3610
|
+
|
|
3611
|
+
/**
|
|
3612
|
+
* Lists
|
|
3613
|
+
*
|
|
3614
|
+
* Get the lists that a TV series has been added to.
|
|
3615
|
+
*/
|
|
3616
|
+
export const listsCopyInfiniteOptions = (options: Options<ListsCopyData>) => infiniteQueryOptions<ListsCopyResponse, DefaultError, InfiniteData<ListsCopyResponse>, QueryKey<Options<ListsCopyData>>, number | Pick<QueryKey<Options<ListsCopyData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3617
|
+
// @ts-ignore
|
|
3618
|
+
{
|
|
3619
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3620
|
+
// @ts-ignore
|
|
3621
|
+
const page: Pick<QueryKey<Options<ListsCopyData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3622
|
+
query: {
|
|
3623
|
+
page: pageParam
|
|
3624
|
+
}
|
|
3625
|
+
};
|
|
3626
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3627
|
+
const { data } = await listsCopy({
|
|
3628
|
+
...options,
|
|
3629
|
+
...params,
|
|
3630
|
+
signal,
|
|
3631
|
+
throwOnError: true
|
|
3632
|
+
});
|
|
3633
|
+
return data;
|
|
3634
|
+
},
|
|
3635
|
+
queryKey: listsCopyInfiniteQueryKey(options)
|
|
3636
|
+
});
|
|
3637
|
+
|
|
3638
|
+
export const tvSeriesRecommendationsQueryKey = (options: Options<TvSeriesRecommendationsData>) => createQueryKey('tvSeriesRecommendations', options);
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Recommendations
|
|
3642
|
+
*/
|
|
3643
|
+
export const tvSeriesRecommendationsOptions = (options: Options<TvSeriesRecommendationsData>) => queryOptions<TvSeriesRecommendationsResponse, DefaultError, TvSeriesRecommendationsResponse, ReturnType<typeof tvSeriesRecommendationsQueryKey>>({
|
|
3644
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3645
|
+
const { data } = await tvSeriesRecommendations({
|
|
3646
|
+
...options,
|
|
3647
|
+
...queryKey[0],
|
|
3648
|
+
signal,
|
|
3649
|
+
throwOnError: true
|
|
3650
|
+
});
|
|
3651
|
+
return data;
|
|
3652
|
+
},
|
|
3653
|
+
queryKey: tvSeriesRecommendationsQueryKey(options)
|
|
3654
|
+
});
|
|
3655
|
+
|
|
3656
|
+
export const tvSeriesRecommendationsInfiniteQueryKey = (options: Options<TvSeriesRecommendationsData>): QueryKey<Options<TvSeriesRecommendationsData>> => createQueryKey('tvSeriesRecommendations', options, true);
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* Recommendations
|
|
3660
|
+
*/
|
|
3661
|
+
export const tvSeriesRecommendationsInfiniteOptions = (options: Options<TvSeriesRecommendationsData>) => infiniteQueryOptions<TvSeriesRecommendationsResponse, DefaultError, InfiniteData<TvSeriesRecommendationsResponse>, QueryKey<Options<TvSeriesRecommendationsData>>, number | Pick<QueryKey<Options<TvSeriesRecommendationsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3662
|
+
// @ts-ignore
|
|
3663
|
+
{
|
|
3664
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3665
|
+
// @ts-ignore
|
|
3666
|
+
const page: Pick<QueryKey<Options<TvSeriesRecommendationsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3667
|
+
query: {
|
|
3668
|
+
page: pageParam
|
|
3669
|
+
}
|
|
3670
|
+
};
|
|
3671
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3672
|
+
const { data } = await tvSeriesRecommendations({
|
|
3673
|
+
...options,
|
|
3674
|
+
...params,
|
|
3675
|
+
signal,
|
|
3676
|
+
throwOnError: true
|
|
3677
|
+
});
|
|
3678
|
+
return data;
|
|
3679
|
+
},
|
|
3680
|
+
queryKey: tvSeriesRecommendationsInfiniteQueryKey(options)
|
|
3681
|
+
});
|
|
3682
|
+
|
|
3683
|
+
export const tvSeriesReviewsQueryKey = (options: Options<TvSeriesReviewsData>) => createQueryKey('tvSeriesReviews', options);
|
|
3684
|
+
|
|
3685
|
+
/**
|
|
3686
|
+
* Reviews
|
|
3687
|
+
*
|
|
3688
|
+
* Get the reviews that have been added to a TV show.
|
|
3689
|
+
*/
|
|
3690
|
+
export const tvSeriesReviewsOptions = (options: Options<TvSeriesReviewsData>) => queryOptions<TvSeriesReviewsResponse, DefaultError, TvSeriesReviewsResponse, ReturnType<typeof tvSeriesReviewsQueryKey>>({
|
|
3691
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3692
|
+
const { data } = await tvSeriesReviews({
|
|
3693
|
+
...options,
|
|
3694
|
+
...queryKey[0],
|
|
3695
|
+
signal,
|
|
3696
|
+
throwOnError: true
|
|
3697
|
+
});
|
|
3698
|
+
return data;
|
|
3699
|
+
},
|
|
3700
|
+
queryKey: tvSeriesReviewsQueryKey(options)
|
|
3701
|
+
});
|
|
3702
|
+
|
|
3703
|
+
export const tvSeriesReviewsInfiniteQueryKey = (options: Options<TvSeriesReviewsData>): QueryKey<Options<TvSeriesReviewsData>> => createQueryKey('tvSeriesReviews', options, true);
|
|
3704
|
+
|
|
3705
|
+
/**
|
|
3706
|
+
* Reviews
|
|
3707
|
+
*
|
|
3708
|
+
* Get the reviews that have been added to a TV show.
|
|
3709
|
+
*/
|
|
3710
|
+
export const tvSeriesReviewsInfiniteOptions = (options: Options<TvSeriesReviewsData>) => infiniteQueryOptions<TvSeriesReviewsResponse, DefaultError, InfiniteData<TvSeriesReviewsResponse>, QueryKey<Options<TvSeriesReviewsData>>, number | Pick<QueryKey<Options<TvSeriesReviewsData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3711
|
+
// @ts-ignore
|
|
3712
|
+
{
|
|
3713
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3714
|
+
// @ts-ignore
|
|
3715
|
+
const page: Pick<QueryKey<Options<TvSeriesReviewsData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3716
|
+
query: {
|
|
3717
|
+
page: pageParam
|
|
3718
|
+
}
|
|
3719
|
+
};
|
|
3720
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3721
|
+
const { data } = await tvSeriesReviews({
|
|
3722
|
+
...options,
|
|
3723
|
+
...params,
|
|
3724
|
+
signal,
|
|
3725
|
+
throwOnError: true
|
|
3726
|
+
});
|
|
3727
|
+
return data;
|
|
3728
|
+
},
|
|
3729
|
+
queryKey: tvSeriesReviewsInfiniteQueryKey(options)
|
|
3730
|
+
});
|
|
3731
|
+
|
|
3732
|
+
export const tvSeriesScreenedTheatricallyQueryKey = (options: Options<TvSeriesScreenedTheatricallyData>) => createQueryKey('tvSeriesScreenedTheatrically', options);
|
|
3733
|
+
|
|
3734
|
+
/**
|
|
3735
|
+
* Screened Theatrically
|
|
3736
|
+
*
|
|
3737
|
+
* Get the seasons and episodes that have screened theatrically.
|
|
3738
|
+
*/
|
|
3739
|
+
export const tvSeriesScreenedTheatricallyOptions = (options: Options<TvSeriesScreenedTheatricallyData>) => queryOptions<TvSeriesScreenedTheatricallyResponse, DefaultError, TvSeriesScreenedTheatricallyResponse, ReturnType<typeof tvSeriesScreenedTheatricallyQueryKey>>({
|
|
3740
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3741
|
+
const { data } = await tvSeriesScreenedTheatrically({
|
|
3742
|
+
...options,
|
|
3743
|
+
...queryKey[0],
|
|
3744
|
+
signal,
|
|
3745
|
+
throwOnError: true
|
|
3746
|
+
});
|
|
3747
|
+
return data;
|
|
3748
|
+
},
|
|
3749
|
+
queryKey: tvSeriesScreenedTheatricallyQueryKey(options)
|
|
3750
|
+
});
|
|
3751
|
+
|
|
3752
|
+
export const tvSeriesSimilarQueryKey = (options: Options<TvSeriesSimilarData>) => createQueryKey('tvSeriesSimilar', options);
|
|
3753
|
+
|
|
3754
|
+
/**
|
|
3755
|
+
* Similar
|
|
3756
|
+
*
|
|
3757
|
+
* Get the similar TV shows.
|
|
3758
|
+
*/
|
|
3759
|
+
export const tvSeriesSimilarOptions = (options: Options<TvSeriesSimilarData>) => queryOptions<TvSeriesSimilarResponse, DefaultError, TvSeriesSimilarResponse, ReturnType<typeof tvSeriesSimilarQueryKey>>({
|
|
3760
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3761
|
+
const { data } = await tvSeriesSimilar({
|
|
3762
|
+
...options,
|
|
3763
|
+
...queryKey[0],
|
|
3764
|
+
signal,
|
|
3765
|
+
throwOnError: true
|
|
3766
|
+
});
|
|
3767
|
+
return data;
|
|
3768
|
+
},
|
|
3769
|
+
queryKey: tvSeriesSimilarQueryKey(options)
|
|
3770
|
+
});
|
|
3771
|
+
|
|
3772
|
+
export const tvSeriesSimilarInfiniteQueryKey = (options: Options<TvSeriesSimilarData>): QueryKey<Options<TvSeriesSimilarData>> => createQueryKey('tvSeriesSimilar', options, true);
|
|
3773
|
+
|
|
3774
|
+
/**
|
|
3775
|
+
* Similar
|
|
3776
|
+
*
|
|
3777
|
+
* Get the similar TV shows.
|
|
3778
|
+
*/
|
|
3779
|
+
export const tvSeriesSimilarInfiniteOptions = (options: Options<TvSeriesSimilarData>) => infiniteQueryOptions<TvSeriesSimilarResponse, DefaultError, InfiniteData<TvSeriesSimilarResponse>, QueryKey<Options<TvSeriesSimilarData>>, number | Pick<QueryKey<Options<TvSeriesSimilarData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3780
|
+
// @ts-ignore
|
|
3781
|
+
{
|
|
3782
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3783
|
+
// @ts-ignore
|
|
3784
|
+
const page: Pick<QueryKey<Options<TvSeriesSimilarData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3785
|
+
query: {
|
|
3786
|
+
page: pageParam
|
|
3787
|
+
}
|
|
3788
|
+
};
|
|
3789
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3790
|
+
const { data } = await tvSeriesSimilar({
|
|
3791
|
+
...options,
|
|
3792
|
+
...params,
|
|
3793
|
+
signal,
|
|
3794
|
+
throwOnError: true
|
|
3795
|
+
});
|
|
3796
|
+
return data;
|
|
3797
|
+
},
|
|
3798
|
+
queryKey: tvSeriesSimilarInfiniteQueryKey(options)
|
|
3799
|
+
});
|
|
3800
|
+
|
|
3801
|
+
export const tvSeriesTranslationsQueryKey = (options: Options<TvSeriesTranslationsData>) => createQueryKey('tvSeriesTranslations', options);
|
|
3802
|
+
|
|
3803
|
+
/**
|
|
3804
|
+
* Translations
|
|
3805
|
+
*
|
|
3806
|
+
* Get the translations that have been added to a TV show.
|
|
3807
|
+
*/
|
|
3808
|
+
export const tvSeriesTranslationsOptions = (options: Options<TvSeriesTranslationsData>) => queryOptions<TvSeriesTranslationsResponse, DefaultError, TvSeriesTranslationsResponse, ReturnType<typeof tvSeriesTranslationsQueryKey>>({
|
|
3809
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3810
|
+
const { data } = await tvSeriesTranslations({
|
|
3811
|
+
...options,
|
|
3812
|
+
...queryKey[0],
|
|
3813
|
+
signal,
|
|
3814
|
+
throwOnError: true
|
|
3815
|
+
});
|
|
3816
|
+
return data;
|
|
3817
|
+
},
|
|
3818
|
+
queryKey: tvSeriesTranslationsQueryKey(options)
|
|
3819
|
+
});
|
|
3820
|
+
|
|
3821
|
+
export const tvSeriesVideosQueryKey = (options: Options<TvSeriesVideosData>) => createQueryKey('tvSeriesVideos', options);
|
|
3822
|
+
|
|
3823
|
+
/**
|
|
3824
|
+
* Videos
|
|
3825
|
+
*
|
|
3826
|
+
* Get the videos that belong to a TV show.
|
|
3827
|
+
*/
|
|
3828
|
+
export const tvSeriesVideosOptions = (options: Options<TvSeriesVideosData>) => queryOptions<TvSeriesVideosResponse, DefaultError, TvSeriesVideosResponse, ReturnType<typeof tvSeriesVideosQueryKey>>({
|
|
3829
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3830
|
+
const { data } = await tvSeriesVideos({
|
|
3831
|
+
...options,
|
|
3832
|
+
...queryKey[0],
|
|
3833
|
+
signal,
|
|
3834
|
+
throwOnError: true
|
|
3835
|
+
});
|
|
3836
|
+
return data;
|
|
3837
|
+
},
|
|
3838
|
+
queryKey: tvSeriesVideosQueryKey(options)
|
|
3839
|
+
});
|
|
3840
|
+
|
|
3841
|
+
export const tvSeriesWatchProvidersQueryKey = (options: Options<TvSeriesWatchProvidersData>) => createQueryKey('tvSeriesWatchProviders', options);
|
|
3842
|
+
|
|
3843
|
+
/**
|
|
3844
|
+
* Watch Providers
|
|
3845
|
+
*
|
|
3846
|
+
* Get the list of streaming providers we have for a TV show.
|
|
3847
|
+
*/
|
|
3848
|
+
export const tvSeriesWatchProvidersOptions = (options: Options<TvSeriesWatchProvidersData>) => queryOptions<TvSeriesWatchProvidersResponse, DefaultError, TvSeriesWatchProvidersResponse, ReturnType<typeof tvSeriesWatchProvidersQueryKey>>({
|
|
3849
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3850
|
+
const { data } = await tvSeriesWatchProviders({
|
|
3851
|
+
...options,
|
|
3852
|
+
...queryKey[0],
|
|
3853
|
+
signal,
|
|
3854
|
+
throwOnError: true
|
|
3855
|
+
});
|
|
3856
|
+
return data;
|
|
3857
|
+
},
|
|
3858
|
+
queryKey: tvSeriesWatchProvidersQueryKey(options)
|
|
3859
|
+
});
|
|
3860
|
+
|
|
3861
|
+
/**
|
|
3862
|
+
* Delete Rating
|
|
3863
|
+
*/
|
|
3864
|
+
export const tvSeriesDeleteRatingMutation = (options?: Partial<Options<TvSeriesDeleteRatingData>>): UseMutationOptions<TvSeriesDeleteRatingResponse, DefaultError, Options<TvSeriesDeleteRatingData>> => {
|
|
3865
|
+
const mutationOptions: UseMutationOptions<TvSeriesDeleteRatingResponse, DefaultError, Options<TvSeriesDeleteRatingData>> = {
|
|
3866
|
+
mutationFn: async (fnOptions) => {
|
|
3867
|
+
const { data } = await tvSeriesDeleteRating({
|
|
3868
|
+
...options,
|
|
3869
|
+
...fnOptions,
|
|
3870
|
+
throwOnError: true
|
|
3871
|
+
});
|
|
3872
|
+
return data;
|
|
3873
|
+
}
|
|
3874
|
+
};
|
|
3875
|
+
return mutationOptions;
|
|
3876
|
+
};
|
|
3877
|
+
|
|
3878
|
+
/**
|
|
3879
|
+
* Add Rating
|
|
3880
|
+
*
|
|
3881
|
+
* Rate a TV show and save it to your rated list.
|
|
3882
|
+
*/
|
|
3883
|
+
export const tvSeriesAddRatingMutation = (options?: Partial<Options<TvSeriesAddRatingData>>): UseMutationOptions<TvSeriesAddRatingResponse, DefaultError, Options<TvSeriesAddRatingData>> => {
|
|
3884
|
+
const mutationOptions: UseMutationOptions<TvSeriesAddRatingResponse, DefaultError, Options<TvSeriesAddRatingData>> = {
|
|
3885
|
+
mutationFn: async (fnOptions) => {
|
|
3886
|
+
const { data } = await tvSeriesAddRating({
|
|
3887
|
+
...options,
|
|
3888
|
+
...fnOptions,
|
|
3889
|
+
throwOnError: true
|
|
3890
|
+
});
|
|
3891
|
+
return data;
|
|
3892
|
+
}
|
|
3893
|
+
};
|
|
3894
|
+
return mutationOptions;
|
|
3895
|
+
};
|
|
3896
|
+
|
|
3897
|
+
export const tvSeasonDetailsQueryKey = (options: Options<TvSeasonDetailsData>) => createQueryKey('tvSeasonDetails', options);
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* Details
|
|
3901
|
+
*
|
|
3902
|
+
* Query the details of a TV season.
|
|
3903
|
+
*/
|
|
3904
|
+
export const tvSeasonDetailsOptions = (options: Options<TvSeasonDetailsData>) => queryOptions<TvSeasonDetailsResponse, DefaultError, TvSeasonDetailsResponse, ReturnType<typeof tvSeasonDetailsQueryKey>>({
|
|
3905
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3906
|
+
const { data } = await tvSeasonDetails({
|
|
3907
|
+
...options,
|
|
3908
|
+
...queryKey[0],
|
|
3909
|
+
signal,
|
|
3910
|
+
throwOnError: true
|
|
3911
|
+
});
|
|
3912
|
+
return data;
|
|
3913
|
+
},
|
|
3914
|
+
queryKey: tvSeasonDetailsQueryKey(options)
|
|
3915
|
+
});
|
|
3916
|
+
|
|
3917
|
+
export const tvSeasonAccountStatesQueryKey = (options: Options<TvSeasonAccountStatesData>) => createQueryKey('tvSeasonAccountStates', options);
|
|
3918
|
+
|
|
3919
|
+
/**
|
|
3920
|
+
* Account States
|
|
3921
|
+
*
|
|
3922
|
+
* Get the rating, watchlist and favourite status.
|
|
3923
|
+
*/
|
|
3924
|
+
export const tvSeasonAccountStatesOptions = (options: Options<TvSeasonAccountStatesData>) => queryOptions<TvSeasonAccountStatesResponse, DefaultError, TvSeasonAccountStatesResponse, ReturnType<typeof tvSeasonAccountStatesQueryKey>>({
|
|
3925
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3926
|
+
const { data } = await tvSeasonAccountStates({
|
|
3927
|
+
...options,
|
|
3928
|
+
...queryKey[0],
|
|
3929
|
+
signal,
|
|
3930
|
+
throwOnError: true
|
|
3931
|
+
});
|
|
3932
|
+
return data;
|
|
3933
|
+
},
|
|
3934
|
+
queryKey: tvSeasonAccountStatesQueryKey(options)
|
|
3935
|
+
});
|
|
3936
|
+
|
|
3937
|
+
export const tvSeasonAggregateCreditsQueryKey = (options: Options<TvSeasonAggregateCreditsData>) => createQueryKey('tvSeasonAggregateCredits', options);
|
|
3938
|
+
|
|
3939
|
+
/**
|
|
3940
|
+
* Aggregate Credits
|
|
3941
|
+
*
|
|
3942
|
+
* Get the aggregate credits (cast and crew) that have been added to a TV season.
|
|
3943
|
+
*/
|
|
3944
|
+
export const tvSeasonAggregateCreditsOptions = (options: Options<TvSeasonAggregateCreditsData>) => queryOptions<TvSeasonAggregateCreditsResponse, DefaultError, TvSeasonAggregateCreditsResponse, ReturnType<typeof tvSeasonAggregateCreditsQueryKey>>({
|
|
3945
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3946
|
+
const { data } = await tvSeasonAggregateCredits({
|
|
3947
|
+
...options,
|
|
3948
|
+
...queryKey[0],
|
|
3949
|
+
signal,
|
|
3950
|
+
throwOnError: true
|
|
3951
|
+
});
|
|
3952
|
+
return data;
|
|
3953
|
+
},
|
|
3954
|
+
queryKey: tvSeasonAggregateCreditsQueryKey(options)
|
|
3955
|
+
});
|
|
3956
|
+
|
|
3957
|
+
export const tvSeasonChangesByIdQueryKey = (options: Options<TvSeasonChangesByIdData>) => createQueryKey('tvSeasonChangesById', options);
|
|
3958
|
+
|
|
3959
|
+
/**
|
|
3960
|
+
* Changes
|
|
3961
|
+
*
|
|
3962
|
+
* Get the recent changes for a TV season.
|
|
3963
|
+
*/
|
|
3964
|
+
export const tvSeasonChangesByIdOptions = (options: Options<TvSeasonChangesByIdData>) => queryOptions<TvSeasonChangesByIdResponse, DefaultError, TvSeasonChangesByIdResponse, ReturnType<typeof tvSeasonChangesByIdQueryKey>>({
|
|
3965
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3966
|
+
const { data } = await tvSeasonChangesById({
|
|
3967
|
+
...options,
|
|
3968
|
+
...queryKey[0],
|
|
3969
|
+
signal,
|
|
3970
|
+
throwOnError: true
|
|
3971
|
+
});
|
|
3972
|
+
return data;
|
|
3973
|
+
},
|
|
3974
|
+
queryKey: tvSeasonChangesByIdQueryKey(options)
|
|
3975
|
+
});
|
|
3976
|
+
|
|
3977
|
+
export const tvSeasonChangesByIdInfiniteQueryKey = (options: Options<TvSeasonChangesByIdData>): QueryKey<Options<TvSeasonChangesByIdData>> => createQueryKey('tvSeasonChangesById', options, true);
|
|
3978
|
+
|
|
3979
|
+
/**
|
|
3980
|
+
* Changes
|
|
3981
|
+
*
|
|
3982
|
+
* Get the recent changes for a TV season.
|
|
3983
|
+
*/
|
|
3984
|
+
export const tvSeasonChangesByIdInfiniteOptions = (options: Options<TvSeasonChangesByIdData>) => infiniteQueryOptions<TvSeasonChangesByIdResponse, DefaultError, InfiniteData<TvSeasonChangesByIdResponse>, QueryKey<Options<TvSeasonChangesByIdData>>, number | Pick<QueryKey<Options<TvSeasonChangesByIdData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
|
3985
|
+
// @ts-ignore
|
|
3986
|
+
{
|
|
3987
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3988
|
+
// @ts-ignore
|
|
3989
|
+
const page: Pick<QueryKey<Options<TvSeasonChangesByIdData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
|
3990
|
+
query: {
|
|
3991
|
+
page: pageParam
|
|
3992
|
+
}
|
|
3993
|
+
};
|
|
3994
|
+
const params = createInfiniteParams(queryKey, page);
|
|
3995
|
+
const { data } = await tvSeasonChangesById({
|
|
3996
|
+
...options,
|
|
3997
|
+
...params,
|
|
3998
|
+
signal,
|
|
3999
|
+
throwOnError: true
|
|
4000
|
+
});
|
|
4001
|
+
return data;
|
|
4002
|
+
},
|
|
4003
|
+
queryKey: tvSeasonChangesByIdInfiniteQueryKey(options)
|
|
4004
|
+
});
|
|
4005
|
+
|
|
4006
|
+
export const tvSeasonCreditsQueryKey = (options: Options<TvSeasonCreditsData>) => createQueryKey('tvSeasonCredits', options);
|
|
4007
|
+
|
|
4008
|
+
/**
|
|
4009
|
+
* Credits
|
|
4010
|
+
*/
|
|
4011
|
+
export const tvSeasonCreditsOptions = (options: Options<TvSeasonCreditsData>) => queryOptions<TvSeasonCreditsResponse, DefaultError, TvSeasonCreditsResponse, ReturnType<typeof tvSeasonCreditsQueryKey>>({
|
|
4012
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4013
|
+
const { data } = await tvSeasonCredits({
|
|
4014
|
+
...options,
|
|
4015
|
+
...queryKey[0],
|
|
4016
|
+
signal,
|
|
4017
|
+
throwOnError: true
|
|
4018
|
+
});
|
|
4019
|
+
return data;
|
|
4020
|
+
},
|
|
4021
|
+
queryKey: tvSeasonCreditsQueryKey(options)
|
|
4022
|
+
});
|
|
4023
|
+
|
|
4024
|
+
export const tvSeasonExternalIdsQueryKey = (options: Options<TvSeasonExternalIdsData>) => createQueryKey('tvSeasonExternalIds', options);
|
|
4025
|
+
|
|
4026
|
+
/**
|
|
4027
|
+
* External IDs
|
|
4028
|
+
*
|
|
4029
|
+
* Get a list of external IDs that have been added to a TV season.
|
|
4030
|
+
*/
|
|
4031
|
+
export const tvSeasonExternalIdsOptions = (options: Options<TvSeasonExternalIdsData>) => queryOptions<TvSeasonExternalIdsResponse, DefaultError, TvSeasonExternalIdsResponse, ReturnType<typeof tvSeasonExternalIdsQueryKey>>({
|
|
4032
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4033
|
+
const { data } = await tvSeasonExternalIds({
|
|
4034
|
+
...options,
|
|
4035
|
+
...queryKey[0],
|
|
4036
|
+
signal,
|
|
4037
|
+
throwOnError: true
|
|
4038
|
+
});
|
|
4039
|
+
return data;
|
|
4040
|
+
},
|
|
4041
|
+
queryKey: tvSeasonExternalIdsQueryKey(options)
|
|
4042
|
+
});
|
|
4043
|
+
|
|
4044
|
+
export const tvSeasonImagesQueryKey = (options: Options<TvSeasonImagesData>) => createQueryKey('tvSeasonImages', options);
|
|
4045
|
+
|
|
4046
|
+
/**
|
|
4047
|
+
* Images
|
|
4048
|
+
*
|
|
4049
|
+
* Get the images that belong to a TV season.
|
|
4050
|
+
*/
|
|
4051
|
+
export const tvSeasonImagesOptions = (options: Options<TvSeasonImagesData>) => queryOptions<TvSeasonImagesResponse, DefaultError, TvSeasonImagesResponse, ReturnType<typeof tvSeasonImagesQueryKey>>({
|
|
4052
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4053
|
+
const { data } = await tvSeasonImages({
|
|
4054
|
+
...options,
|
|
4055
|
+
...queryKey[0],
|
|
4056
|
+
signal,
|
|
4057
|
+
throwOnError: true
|
|
4058
|
+
});
|
|
4059
|
+
return data;
|
|
4060
|
+
},
|
|
4061
|
+
queryKey: tvSeasonImagesQueryKey(options)
|
|
4062
|
+
});
|
|
4063
|
+
|
|
4064
|
+
export const tvSeasonTranslationsQueryKey = (options: Options<TvSeasonTranslationsData>) => createQueryKey('tvSeasonTranslations', options);
|
|
4065
|
+
|
|
4066
|
+
/**
|
|
4067
|
+
* Translations
|
|
4068
|
+
*
|
|
4069
|
+
* Get the translations for a TV season.
|
|
4070
|
+
*/
|
|
4071
|
+
export const tvSeasonTranslationsOptions = (options: Options<TvSeasonTranslationsData>) => queryOptions<TvSeasonTranslationsResponse, DefaultError, TvSeasonTranslationsResponse, ReturnType<typeof tvSeasonTranslationsQueryKey>>({
|
|
4072
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4073
|
+
const { data } = await tvSeasonTranslations({
|
|
4074
|
+
...options,
|
|
4075
|
+
...queryKey[0],
|
|
4076
|
+
signal,
|
|
4077
|
+
throwOnError: true
|
|
4078
|
+
});
|
|
4079
|
+
return data;
|
|
4080
|
+
},
|
|
4081
|
+
queryKey: tvSeasonTranslationsQueryKey(options)
|
|
4082
|
+
});
|
|
4083
|
+
|
|
4084
|
+
export const tvSeasonVideosQueryKey = (options: Options<TvSeasonVideosData>) => createQueryKey('tvSeasonVideos', options);
|
|
4085
|
+
|
|
4086
|
+
/**
|
|
4087
|
+
* Videos
|
|
4088
|
+
*
|
|
4089
|
+
* Get the videos that belong to a TV season.
|
|
4090
|
+
*/
|
|
4091
|
+
export const tvSeasonVideosOptions = (options: Options<TvSeasonVideosData>) => queryOptions<TvSeasonVideosResponse, DefaultError, TvSeasonVideosResponse, ReturnType<typeof tvSeasonVideosQueryKey>>({
|
|
4092
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4093
|
+
const { data } = await tvSeasonVideos({
|
|
4094
|
+
...options,
|
|
4095
|
+
...queryKey[0],
|
|
4096
|
+
signal,
|
|
4097
|
+
throwOnError: true
|
|
4098
|
+
});
|
|
4099
|
+
return data;
|
|
4100
|
+
},
|
|
4101
|
+
queryKey: tvSeasonVideosQueryKey(options)
|
|
4102
|
+
});
|
|
4103
|
+
|
|
4104
|
+
export const tvSeasonWatchProvidersQueryKey = (options: Options<TvSeasonWatchProvidersData>) => createQueryKey('tvSeasonWatchProviders', options);
|
|
4105
|
+
|
|
4106
|
+
/**
|
|
4107
|
+
* Watch Providers
|
|
4108
|
+
*
|
|
4109
|
+
* Get the list of streaming providers we have for a TV season.
|
|
4110
|
+
*/
|
|
4111
|
+
export const tvSeasonWatchProvidersOptions = (options: Options<TvSeasonWatchProvidersData>) => queryOptions<TvSeasonWatchProvidersResponse, DefaultError, TvSeasonWatchProvidersResponse, ReturnType<typeof tvSeasonWatchProvidersQueryKey>>({
|
|
4112
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4113
|
+
const { data } = await tvSeasonWatchProviders({
|
|
4114
|
+
...options,
|
|
4115
|
+
...queryKey[0],
|
|
4116
|
+
signal,
|
|
4117
|
+
throwOnError: true
|
|
4118
|
+
});
|
|
4119
|
+
return data;
|
|
4120
|
+
},
|
|
4121
|
+
queryKey: tvSeasonWatchProvidersQueryKey(options)
|
|
4122
|
+
});
|
|
4123
|
+
|
|
4124
|
+
export const tvEpisodeDetailsQueryKey = (options: Options<TvEpisodeDetailsData>) => createQueryKey('tvEpisodeDetails', options);
|
|
4125
|
+
|
|
4126
|
+
/**
|
|
4127
|
+
* Details
|
|
4128
|
+
*
|
|
4129
|
+
* Query the details of a TV episode.
|
|
4130
|
+
*/
|
|
4131
|
+
export const tvEpisodeDetailsOptions = (options: Options<TvEpisodeDetailsData>) => queryOptions<TvEpisodeDetailsResponse, DefaultError, TvEpisodeDetailsResponse, ReturnType<typeof tvEpisodeDetailsQueryKey>>({
|
|
4132
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4133
|
+
const { data } = await tvEpisodeDetails({
|
|
4134
|
+
...options,
|
|
4135
|
+
...queryKey[0],
|
|
4136
|
+
signal,
|
|
4137
|
+
throwOnError: true
|
|
4138
|
+
});
|
|
4139
|
+
return data;
|
|
4140
|
+
},
|
|
4141
|
+
queryKey: tvEpisodeDetailsQueryKey(options)
|
|
4142
|
+
});
|
|
4143
|
+
|
|
4144
|
+
export const tvEpisodeAccountStatesQueryKey = (options: Options<TvEpisodeAccountStatesData>) => createQueryKey('tvEpisodeAccountStates', options);
|
|
4145
|
+
|
|
4146
|
+
/**
|
|
4147
|
+
* Account States
|
|
4148
|
+
*
|
|
4149
|
+
* Get the rating, watchlist and favourite status.
|
|
4150
|
+
*/
|
|
4151
|
+
export const tvEpisodeAccountStatesOptions = (options: Options<TvEpisodeAccountStatesData>) => queryOptions<TvEpisodeAccountStatesResponse, DefaultError, TvEpisodeAccountStatesResponse, ReturnType<typeof tvEpisodeAccountStatesQueryKey>>({
|
|
4152
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4153
|
+
const { data } = await tvEpisodeAccountStates({
|
|
4154
|
+
...options,
|
|
4155
|
+
...queryKey[0],
|
|
4156
|
+
signal,
|
|
4157
|
+
throwOnError: true
|
|
4158
|
+
});
|
|
4159
|
+
return data;
|
|
4160
|
+
},
|
|
4161
|
+
queryKey: tvEpisodeAccountStatesQueryKey(options)
|
|
4162
|
+
});
|
|
4163
|
+
|
|
4164
|
+
export const tvEpisodeChangesByIdQueryKey = (options: Options<TvEpisodeChangesByIdData>) => createQueryKey('tvEpisodeChangesById', options);
|
|
4165
|
+
|
|
4166
|
+
/**
|
|
4167
|
+
* Changes
|
|
4168
|
+
*
|
|
4169
|
+
* Get the recent changes for a TV episode.
|
|
4170
|
+
*/
|
|
4171
|
+
export const tvEpisodeChangesByIdOptions = (options: Options<TvEpisodeChangesByIdData>) => queryOptions<TvEpisodeChangesByIdResponse, DefaultError, TvEpisodeChangesByIdResponse, ReturnType<typeof tvEpisodeChangesByIdQueryKey>>({
|
|
4172
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4173
|
+
const { data } = await tvEpisodeChangesById({
|
|
4174
|
+
...options,
|
|
4175
|
+
...queryKey[0],
|
|
4176
|
+
signal,
|
|
4177
|
+
throwOnError: true
|
|
4178
|
+
});
|
|
4179
|
+
return data;
|
|
4180
|
+
},
|
|
4181
|
+
queryKey: tvEpisodeChangesByIdQueryKey(options)
|
|
4182
|
+
});
|
|
4183
|
+
|
|
4184
|
+
export const tvEpisodeCreditsQueryKey = (options: Options<TvEpisodeCreditsData>) => createQueryKey('tvEpisodeCredits', options);
|
|
4185
|
+
|
|
4186
|
+
/**
|
|
4187
|
+
* Credits
|
|
4188
|
+
*/
|
|
4189
|
+
export const tvEpisodeCreditsOptions = (options: Options<TvEpisodeCreditsData>) => queryOptions<TvEpisodeCreditsResponse, DefaultError, TvEpisodeCreditsResponse, ReturnType<typeof tvEpisodeCreditsQueryKey>>({
|
|
4190
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4191
|
+
const { data } = await tvEpisodeCredits({
|
|
4192
|
+
...options,
|
|
4193
|
+
...queryKey[0],
|
|
4194
|
+
signal,
|
|
4195
|
+
throwOnError: true
|
|
4196
|
+
});
|
|
4197
|
+
return data;
|
|
4198
|
+
},
|
|
4199
|
+
queryKey: tvEpisodeCreditsQueryKey(options)
|
|
4200
|
+
});
|
|
4201
|
+
|
|
4202
|
+
export const tvEpisodeExternalIdsQueryKey = (options: Options<TvEpisodeExternalIdsData>) => createQueryKey('tvEpisodeExternalIds', options);
|
|
4203
|
+
|
|
4204
|
+
/**
|
|
4205
|
+
* External IDs
|
|
4206
|
+
*
|
|
4207
|
+
* Get a list of external IDs that have been added to a TV episode.
|
|
4208
|
+
*/
|
|
4209
|
+
export const tvEpisodeExternalIdsOptions = (options: Options<TvEpisodeExternalIdsData>) => queryOptions<TvEpisodeExternalIdsResponse, DefaultError, TvEpisodeExternalIdsResponse, ReturnType<typeof tvEpisodeExternalIdsQueryKey>>({
|
|
4210
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4211
|
+
const { data } = await tvEpisodeExternalIds({
|
|
4212
|
+
...options,
|
|
4213
|
+
...queryKey[0],
|
|
4214
|
+
signal,
|
|
4215
|
+
throwOnError: true
|
|
4216
|
+
});
|
|
4217
|
+
return data;
|
|
4218
|
+
},
|
|
4219
|
+
queryKey: tvEpisodeExternalIdsQueryKey(options)
|
|
4220
|
+
});
|
|
4221
|
+
|
|
4222
|
+
export const tvEpisodeImagesQueryKey = (options: Options<TvEpisodeImagesData>) => createQueryKey('tvEpisodeImages', options);
|
|
4223
|
+
|
|
4224
|
+
/**
|
|
4225
|
+
* Images
|
|
4226
|
+
*
|
|
4227
|
+
* Get the images that belong to a TV episode.
|
|
4228
|
+
*/
|
|
4229
|
+
export const tvEpisodeImagesOptions = (options: Options<TvEpisodeImagesData>) => queryOptions<TvEpisodeImagesResponse, DefaultError, TvEpisodeImagesResponse, ReturnType<typeof tvEpisodeImagesQueryKey>>({
|
|
4230
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4231
|
+
const { data } = await tvEpisodeImages({
|
|
4232
|
+
...options,
|
|
4233
|
+
...queryKey[0],
|
|
4234
|
+
signal,
|
|
4235
|
+
throwOnError: true
|
|
4236
|
+
});
|
|
4237
|
+
return data;
|
|
4238
|
+
},
|
|
4239
|
+
queryKey: tvEpisodeImagesQueryKey(options)
|
|
4240
|
+
});
|
|
4241
|
+
|
|
4242
|
+
export const tvEpisodeTranslationsQueryKey = (options: Options<TvEpisodeTranslationsData>) => createQueryKey('tvEpisodeTranslations', options);
|
|
4243
|
+
|
|
4244
|
+
/**
|
|
4245
|
+
* Translations
|
|
4246
|
+
*
|
|
4247
|
+
* Get the translations that have been added to a TV episode.
|
|
4248
|
+
*/
|
|
4249
|
+
export const tvEpisodeTranslationsOptions = (options: Options<TvEpisodeTranslationsData>) => queryOptions<TvEpisodeTranslationsResponse, DefaultError, TvEpisodeTranslationsResponse, ReturnType<typeof tvEpisodeTranslationsQueryKey>>({
|
|
4250
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4251
|
+
const { data } = await tvEpisodeTranslations({
|
|
4252
|
+
...options,
|
|
4253
|
+
...queryKey[0],
|
|
4254
|
+
signal,
|
|
4255
|
+
throwOnError: true
|
|
4256
|
+
});
|
|
4257
|
+
return data;
|
|
4258
|
+
},
|
|
4259
|
+
queryKey: tvEpisodeTranslationsQueryKey(options)
|
|
4260
|
+
});
|
|
4261
|
+
|
|
4262
|
+
export const tvEpisodeVideosQueryKey = (options: Options<TvEpisodeVideosData>) => createQueryKey('tvEpisodeVideos', options);
|
|
4263
|
+
|
|
4264
|
+
/**
|
|
4265
|
+
* Videos
|
|
4266
|
+
*
|
|
4267
|
+
* Get the videos that belong to a TV episode.
|
|
4268
|
+
*/
|
|
4269
|
+
export const tvEpisodeVideosOptions = (options: Options<TvEpisodeVideosData>) => queryOptions<TvEpisodeVideosResponse, DefaultError, TvEpisodeVideosResponse, ReturnType<typeof tvEpisodeVideosQueryKey>>({
|
|
4270
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4271
|
+
const { data } = await tvEpisodeVideos({
|
|
4272
|
+
...options,
|
|
4273
|
+
...queryKey[0],
|
|
4274
|
+
signal,
|
|
4275
|
+
throwOnError: true
|
|
4276
|
+
});
|
|
4277
|
+
return data;
|
|
4278
|
+
},
|
|
4279
|
+
queryKey: tvEpisodeVideosQueryKey(options)
|
|
4280
|
+
});
|
|
4281
|
+
|
|
4282
|
+
/**
|
|
4283
|
+
* Delete Rating
|
|
4284
|
+
*
|
|
4285
|
+
* Delete your rating on a TV episode.
|
|
4286
|
+
*/
|
|
4287
|
+
export const tvEpisodeDeleteRatingMutation = (options?: Partial<Options<TvEpisodeDeleteRatingData>>): UseMutationOptions<TvEpisodeDeleteRatingResponse, DefaultError, Options<TvEpisodeDeleteRatingData>> => {
|
|
4288
|
+
const mutationOptions: UseMutationOptions<TvEpisodeDeleteRatingResponse, DefaultError, Options<TvEpisodeDeleteRatingData>> = {
|
|
4289
|
+
mutationFn: async (fnOptions) => {
|
|
4290
|
+
const { data } = await tvEpisodeDeleteRating({
|
|
4291
|
+
...options,
|
|
4292
|
+
...fnOptions,
|
|
4293
|
+
throwOnError: true
|
|
4294
|
+
});
|
|
4295
|
+
return data;
|
|
4296
|
+
}
|
|
4297
|
+
};
|
|
4298
|
+
return mutationOptions;
|
|
4299
|
+
};
|
|
4300
|
+
|
|
4301
|
+
/**
|
|
4302
|
+
* Add Rating
|
|
4303
|
+
*
|
|
4304
|
+
* Rate a TV episode and save it to your rated list.
|
|
4305
|
+
*/
|
|
4306
|
+
export const tvEpisodeAddRatingMutation = (options?: Partial<Options<TvEpisodeAddRatingData>>): UseMutationOptions<TvEpisodeAddRatingResponse, DefaultError, Options<TvEpisodeAddRatingData>> => {
|
|
4307
|
+
const mutationOptions: UseMutationOptions<TvEpisodeAddRatingResponse, DefaultError, Options<TvEpisodeAddRatingData>> = {
|
|
4308
|
+
mutationFn: async (fnOptions) => {
|
|
4309
|
+
const { data } = await tvEpisodeAddRating({
|
|
4310
|
+
...options,
|
|
4311
|
+
...fnOptions,
|
|
4312
|
+
throwOnError: true
|
|
4313
|
+
});
|
|
4314
|
+
return data;
|
|
4315
|
+
}
|
|
4316
|
+
};
|
|
4317
|
+
return mutationOptions;
|
|
4318
|
+
};
|
|
4319
|
+
|
|
4320
|
+
export const tvEpisodeGroupDetailsQueryKey = (options: Options<TvEpisodeGroupDetailsData>) => createQueryKey('tvEpisodeGroupDetails', options);
|
|
4321
|
+
|
|
4322
|
+
/**
|
|
4323
|
+
* Details
|
|
4324
|
+
*
|
|
4325
|
+
* Get the details of a TV episode group.
|
|
4326
|
+
*/
|
|
4327
|
+
export const tvEpisodeGroupDetailsOptions = (options: Options<TvEpisodeGroupDetailsData>) => queryOptions<TvEpisodeGroupDetailsResponse, DefaultError, TvEpisodeGroupDetailsResponse, ReturnType<typeof tvEpisodeGroupDetailsQueryKey>>({
|
|
4328
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4329
|
+
const { data } = await tvEpisodeGroupDetails({
|
|
4330
|
+
...options,
|
|
4331
|
+
...queryKey[0],
|
|
4332
|
+
signal,
|
|
4333
|
+
throwOnError: true
|
|
4334
|
+
});
|
|
4335
|
+
return data;
|
|
4336
|
+
},
|
|
4337
|
+
queryKey: tvEpisodeGroupDetailsQueryKey(options)
|
|
4338
|
+
});
|
|
4339
|
+
|
|
4340
|
+
export const watchProvidersAvailableRegionsQueryKey = (options?: Options<WatchProvidersAvailableRegionsData>) => createQueryKey('watchProvidersAvailableRegions', options);
|
|
4341
|
+
|
|
4342
|
+
/**
|
|
4343
|
+
* Available Regions
|
|
4344
|
+
*
|
|
4345
|
+
* Get the list of the countries we have watch provider (OTT/streaming) data for.
|
|
4346
|
+
*/
|
|
4347
|
+
export const watchProvidersAvailableRegionsOptions = (options?: Options<WatchProvidersAvailableRegionsData>) => queryOptions<WatchProvidersAvailableRegionsResponse, DefaultError, WatchProvidersAvailableRegionsResponse, ReturnType<typeof watchProvidersAvailableRegionsQueryKey>>({
|
|
4348
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4349
|
+
const { data } = await watchProvidersAvailableRegions({
|
|
4350
|
+
...options,
|
|
4351
|
+
...queryKey[0],
|
|
4352
|
+
signal,
|
|
4353
|
+
throwOnError: true
|
|
4354
|
+
});
|
|
4355
|
+
return data;
|
|
4356
|
+
},
|
|
4357
|
+
queryKey: watchProvidersAvailableRegionsQueryKey(options)
|
|
4358
|
+
});
|
|
4359
|
+
|
|
4360
|
+
export const watchProvidersMovieListQueryKey = (options?: Options<WatchProvidersMovieListData>) => createQueryKey('watchProvidersMovieList', options);
|
|
4361
|
+
|
|
4362
|
+
/**
|
|
4363
|
+
* Movie Providers
|
|
4364
|
+
*
|
|
4365
|
+
* Get the list of streaming providers we have for movies.
|
|
4366
|
+
*/
|
|
4367
|
+
export const watchProvidersMovieListOptions = (options?: Options<WatchProvidersMovieListData>) => queryOptions<WatchProvidersMovieListResponse, DefaultError, WatchProvidersMovieListResponse, ReturnType<typeof watchProvidersMovieListQueryKey>>({
|
|
4368
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4369
|
+
const { data } = await watchProvidersMovieList({
|
|
4370
|
+
...options,
|
|
4371
|
+
...queryKey[0],
|
|
4372
|
+
signal,
|
|
4373
|
+
throwOnError: true
|
|
4374
|
+
});
|
|
4375
|
+
return data;
|
|
4376
|
+
},
|
|
4377
|
+
queryKey: watchProvidersMovieListQueryKey(options)
|
|
4378
|
+
});
|
|
4379
|
+
|
|
4380
|
+
export const watchProviderTvListQueryKey = (options?: Options<WatchProviderTvListData>) => createQueryKey('watchProviderTvList', options);
|
|
4381
|
+
|
|
4382
|
+
/**
|
|
4383
|
+
* TV Providers
|
|
4384
|
+
*
|
|
4385
|
+
* Get the list of streaming providers we have for TV shows.
|
|
4386
|
+
*/
|
|
4387
|
+
export const watchProviderTvListOptions = (options?: Options<WatchProviderTvListData>) => queryOptions<WatchProviderTvListResponse, DefaultError, WatchProviderTvListResponse, ReturnType<typeof watchProviderTvListQueryKey>>({
|
|
4388
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
4389
|
+
const { data } = await watchProviderTvList({
|
|
4390
|
+
...options,
|
|
4391
|
+
...queryKey[0],
|
|
4392
|
+
signal,
|
|
4393
|
+
throwOnError: true
|
|
4394
|
+
});
|
|
4395
|
+
return data;
|
|
4396
|
+
},
|
|
4397
|
+
queryKey: watchProviderTvListQueryKey(options)
|
|
4398
|
+
});
|