diff --git a/projects/api/deno.json b/projects/api/deno.json index c21400c..e06f6fa 100644 --- a/projects/api/deno.json +++ b/projects/api/deno.json @@ -1,7 +1,7 @@ { "name": "@trakt/api", "exports": "./src/index.ts", - "version": "0.3.4", + "version": "0.3.5", "imports": { "@anatine/zod-openapi": "npm:@anatine/zod-openapi@^2.2.6", "@std/testing": "jsr:@std/testing@^1.0.5", diff --git a/projects/api/src/contracts/sync/index.ts b/projects/api/src/contracts/sync/index.ts index b7575c2..0992f85 100644 --- a/projects/api/src/contracts/sync/index.ts +++ b/projects/api/src/contracts/sync/index.ts @@ -195,6 +195,16 @@ const collection = builder.router({ 200: collectedEpisodeSchema.array(), }, }, + media: { + method: 'GET', + path: '/media', + query: extendedQuerySchemaFactory<['full', 'images', 'available_on']>() + .merge(collectionParamSchema) + .merge(pageQuerySchema), + responses: { + 200: collectionResponseSchema, + }, + }, minimal: builder.router({ movies: { method: 'GET', diff --git a/projects/api/src/contracts/sync/schema/response/collectionResponseSchema.ts b/projects/api/src/contracts/sync/schema/response/collectionResponseSchema.ts index 90662a0..1b420b1 100644 --- a/projects/api/src/contracts/sync/schema/response/collectionResponseSchema.ts +++ b/projects/api/src/contracts/sync/schema/response/collectionResponseSchema.ts @@ -43,7 +43,7 @@ export const collectedShowSchema = z.object({ }) .merge(typedShowResponseSchema); -export const collectionResponseSchema = z.discriminatedUnion('type', [ +export const collectionResponseSchema = z.union([ collectedMovieSchema, collectedShowSchema, collectedEpisodeSchema,