@fubar-it-co/tmdb-client 0.0.6 → 0.0.8

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