diff --git a/projects/api/src/contracts/_internal/request/mediaFilterParamsSchema.ts b/projects/api/src/contracts/_internal/request/mediaFilterParamsSchema.ts index 1c2607f7..c11617db 100644 --- a/projects/api/src/contracts/_internal/request/mediaFilterParamsSchema.ts +++ b/projects/api/src/contracts/_internal/request/mediaFilterParamsSchema.ts @@ -26,4 +26,6 @@ export const mediaFilterParamsSchema = z.object({ start_date: z.string().nullish(), end_date: z.string().nullish(), runtimes: z.string().nullish(), + countries: z.string().nullish(), + certifications: z.string().nullish(), }); diff --git a/projects/api/src/contracts/_internal/response/sentimentsResponseSchema.ts b/projects/api/src/contracts/_internal/response/sentimentsResponseSchema.ts index ad218142..4b7c981d 100644 --- a/projects/api/src/contracts/_internal/response/sentimentsResponseSchema.ts +++ b/projects/api/src/contracts/_internal/response/sentimentsResponseSchema.ts @@ -2,7 +2,7 @@ import { z } from '../z.ts'; const sentimentResponseSchema = z.object({ sentiment: z.string(), - comment_ids: z.array(z.number().int()), + comment_ids: z.array(z.number().int()).nullish(), }); export const sentimentsResponseSchema = z.object({ diff --git a/projects/api/src/contracts/_internal/response/translationResponseSchema.ts b/projects/api/src/contracts/_internal/response/translationResponseSchema.ts index 40d2c8cb..ba234262 100644 --- a/projects/api/src/contracts/_internal/response/translationResponseSchema.ts +++ b/projects/api/src/contracts/_internal/response/translationResponseSchema.ts @@ -6,6 +6,6 @@ export const translationResponseSchema = z.array( overview: z.string().nullish(), tagline: z.string().nullish(), language: z.string(), - country: z.string(), + country: z.string().nullish(), }), ); diff --git a/projects/api/src/contracts/calendars/index.ts b/projects/api/src/contracts/calendars/index.ts index e62be86e..fc4cd22b 100644 --- a/projects/api/src/contracts/calendars/index.ts +++ b/projects/api/src/contracts/calendars/index.ts @@ -5,13 +5,15 @@ import type { z } from '../_internal/z.ts'; import { calendarRequestParamsSchema } from './schema/request/calendarParamsSchema.ts'; import { calendarMovieResponseSchema } from './schema/response/calendarMovieResponseSchema.ts'; import { calendarShowResponseSchema } from './schema/response/calendarShowListResponseSchema.ts'; +import { ignoreQuerySchema } from "../_internal/request/ignoreQuerySchema.ts"; export const calendars = builder.router({ shows: { method: 'GET', path: '/:target/shows/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowResponseSchema.array(), @@ -21,7 +23,8 @@ export const calendars = builder.router({ method: 'GET', path: '/:target/shows/new/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowResponseSchema.array(), @@ -31,7 +34,8 @@ export const calendars = builder.router({ method: 'GET', path: '/:target/shows/premieres/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowResponseSchema.array(), @@ -41,7 +45,8 @@ export const calendars = builder.router({ method: 'GET', path: '/:target/shows/finales/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarShowResponseSchema.array(), @@ -51,7 +56,8 @@ export const calendars = builder.router({ method: 'GET', path: '/:target/movies/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarMovieResponseSchema.array(), @@ -61,13 +67,14 @@ export const calendars = builder.router({ method: 'GET', path: '/:target/dvd/:start_date/:days', query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), pathParams: calendarRequestParamsSchema, responses: { 200: calendarMovieResponseSchema.array(), }, }, -}, { pathPrefix: '/calendars' }); +}, {pathPrefix: '/calendars'}); export { calendarRequestParamsSchema }; export type CalendarParams = z.infer; diff --git a/projects/api/src/contracts/lists/index.ts b/projects/api/src/contracts/lists/index.ts index ec1e55af..50315598 100644 --- a/projects/api/src/contracts/lists/index.ts +++ b/projects/api/src/contracts/lists/index.ts @@ -18,6 +18,7 @@ import { listResponseSchema } from '../_internal/response/listResponseSchema.ts' import { z } from '../_internal/z.ts'; import { listReportRequestSchema } from './schema/listReportRequestSchema.ts'; import { prominentListResponseSchema } from './schema/prominentListResponseSchema.ts'; +import { ignoreQuerySchema } from "../_internal/request/ignoreQuerySchema.ts"; const ENTITY_LEVEL = builder.router({ summary: { @@ -25,7 +26,8 @@ const ENTITY_LEVEL = builder.router({ method: 'GET', pathParams: idParamsSchema, query: extendedProfileQuerySchema - .merge(mediaFilterParamsSchema), + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema), responses: { 200: listResponseSchema, }, @@ -38,6 +40,7 @@ const ENTITY_LEVEL = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -51,6 +54,7 @@ const ENTITY_LEVEL = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -64,6 +68,7 @@ const ENTITY_LEVEL = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -77,6 +82,7 @@ const ENTITY_LEVEL = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { diff --git a/projects/api/src/contracts/people/schema/response/peopleShowCreditsResponseSchema.ts b/projects/api/src/contracts/people/schema/response/peopleShowCreditsResponseSchema.ts index a6185579..f07d3249 100644 --- a/projects/api/src/contracts/people/schema/response/peopleShowCreditsResponseSchema.ts +++ b/projects/api/src/contracts/people/schema/response/peopleShowCreditsResponseSchema.ts @@ -8,7 +8,7 @@ export const peopleShowCreditsResponseSchema = z.object({ cast: z.array( z.object({ show: showResponseSchema, - episode_count: z.number().int(), + episode_count: z.number().int().nullish(), series_regular: z.boolean(), }).merge(characterResponseSchema), ).nullish(), @@ -17,7 +17,7 @@ export const peopleShowCreditsResponseSchema = z.object({ z.array( z.object({ show: showResponseSchema, - episode_count: z.number().int(), + episode_count: z.number().int().nullish(), }).merge(jobsResponseSchema), ), ).nullish(), diff --git a/projects/api/src/contracts/sync/index.ts b/projects/api/src/contracts/sync/index.ts index 1f56c335..5e1d0780 100644 --- a/projects/api/src/contracts/sync/index.ts +++ b/projects/api/src/contracts/sync/index.ts @@ -35,6 +35,7 @@ import { movieProgressResponseSchema } from './schema/response/movieProgressResp import { ratingsSyncResponseSchema } from './schema/response/ratingsResponseSchema.ts'; import { removeRatingsResponseSchema } from './schema/response/removeRatingsResponseSchema.ts'; import { upNextResponseSchema } from './schema/response/upNextResponseSchema.ts'; +import { mediaFilterParamsSchema } from "../_internal/request/mediaFilterParamsSchema.ts"; const progress = builder.router({ upNext: { @@ -53,6 +54,7 @@ const progress = builder.router({ method: 'GET', path: '/progress/up_next_nitro', query: pageQuerySchema + .merge(mediaFilterParamsSchema) .merge(sortQuerySchema) .merge(upNextIntentQuerySchema), responses: { @@ -64,6 +66,7 @@ const progress = builder.router({ method: 'GET', path: '/playback/movies', query: extendedQuerySchemaFactory<['full', 'images', 'available_on']>() + .merge(mediaFilterParamsSchema) .merge(pageQuerySchema) .merge(progressParamsSchema), responses: { diff --git a/projects/api/src/contracts/users/index.ts b/projects/api/src/contracts/users/index.ts index 6fd21559..959f3302 100644 --- a/projects/api/src/contracts/users/index.ts +++ b/projects/api/src/contracts/users/index.ts @@ -45,6 +45,8 @@ import { requests } from './subroutes/requests.ts'; import { userLists } from './subroutes/userLists.ts'; import { watched } from './subroutes/watched.ts'; import { watchlist } from './subroutes/watchlist.ts'; +import { mediaFilterParamsSchema } from "../_internal/request/mediaFilterParamsSchema.ts"; +import { ignoreQuerySchema } from "../_internal/request/ignoreQuerySchema.ts"; const GLOBAL_LEVEL = builder.router({ settings: { @@ -139,6 +141,8 @@ const ENTITY_LEVEL = builder.router({ method: 'GET', pathParams: profileParamsSchema.merge(socialActivityParamsSchema), query: extendedMediaQuerySchema + .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema), responses: { 200: socialActivityResponseSchema.array(), diff --git a/projects/api/src/contracts/users/schema/response/hiddenShowResponseSchema.ts b/projects/api/src/contracts/users/schema/response/hiddenShowResponseSchema.ts index eec90d85..c0e78816 100644 --- a/projects/api/src/contracts/users/schema/response/hiddenShowResponseSchema.ts +++ b/projects/api/src/contracts/users/schema/response/hiddenShowResponseSchema.ts @@ -2,5 +2,5 @@ import { typedShowResponseSchema } from '../../../_internal/response/showRespons import { z } from '../../../_internal/z.ts'; export const hiddenShowResponseSchema = z.object({ - hidden_at: z.string().datetime(), + hidden_at: z.string().datetime().nullish(), }).merge(typedShowResponseSchema); diff --git a/projects/api/src/contracts/users/schema/response/socialActivityResponseSchema.ts b/projects/api/src/contracts/users/schema/response/socialActivityResponseSchema.ts index 6c5d30d3..d4d86042 100644 --- a/projects/api/src/contracts/users/schema/response/socialActivityResponseSchema.ts +++ b/projects/api/src/contracts/users/schema/response/socialActivityResponseSchema.ts @@ -9,6 +9,7 @@ const activitySchema = z.object({ activity_at: z.string().datetime(), action: asString(z.enum(['scrobble', 'watch', 'checkin'])), user: profileResponseSchema, + user_rating: z.number().int().nullish(), }); const socialEpisodeResponseSchema = z.object({ diff --git a/projects/api/src/contracts/users/subroutes/history.ts b/projects/api/src/contracts/users/subroutes/history.ts index 8b79c69e..77e52504 100644 --- a/projects/api/src/contracts/users/subroutes/history.ts +++ b/projects/api/src/contracts/users/subroutes/history.ts @@ -9,6 +9,7 @@ import { activityHistoryResponseSchema } from '../schema/response/activityHistor import { episodeActivityHistoryResponseSchema } from '../schema/response/episodeActivityHistoryResponseSchema.ts'; import { movieActivityHistoryResponseSchema } from '../schema/response/movieActivityHistoryResponseSchema.ts'; import { showActivityHistoryResponseSchema } from '../schema/response/showActivityHistoryResponseSchema.ts'; +import { mediaFilterParamsSchema } from "../../_internal/request/mediaFilterParamsSchema.ts"; export const history = builder.router({ all: { @@ -27,6 +28,7 @@ export const history = builder.router({ method: 'GET', pathParams: profileParamsSchema, query: extendedMediaQuerySchema + .merge(mediaFilterParamsSchema) .merge(dateRangeParamsSchema) .merge(pageQuerySchema), responses: { @@ -38,6 +40,7 @@ export const history = builder.router({ method: 'GET', pathParams: profileParamsSchema, query: extendedMediaQuerySchema + .merge(mediaFilterParamsSchema) .merge(dateRangeParamsSchema) .merge(pageQuerySchema), responses: { @@ -49,6 +52,7 @@ export const history = builder.router({ method: 'GET', pathParams: profileParamsSchema, query: extendedMediaQuerySchema + .merge(mediaFilterParamsSchema) .merge(dateRangeParamsSchema) .merge(pageQuerySchema), responses: { diff --git a/projects/api/src/contracts/users/subroutes/userLists.ts b/projects/api/src/contracts/users/subroutes/userLists.ts index e3e2620d..cb6e19e7 100644 --- a/projects/api/src/contracts/users/subroutes/userLists.ts +++ b/projects/api/src/contracts/users/subroutes/userLists.ts @@ -26,6 +26,7 @@ import { profileParamsSchema } from '../schema/request/profileParamsSchema.ts'; import { reorderRequestSchema } from '../schema/request/reorderRequestSchema.ts'; import { reorderListResponseSchema } from '../schema/response/reorderListResponseSchema.ts'; import { reorderListsResponseSchema } from '../schema/response/reorderListsResponseSchema.ts'; +import { ignoreQuerySchema } from "../../_internal/request/ignoreQuerySchema.ts"; const list = builder.router({ summary: { @@ -63,6 +64,7 @@ const list = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -76,6 +78,7 @@ const list = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -90,6 +93,7 @@ const list = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { @@ -104,6 +108,7 @@ const list = builder.router({ query: extendedMediaQuerySchema .merge(sortQuerySchema) .merge(mediaFilterParamsSchema) + .merge(ignoreQuerySchema) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: {