From e1c87eaacfde537290db061a56a58de6510996dc Mon Sep 17 00:00:00 2001 From: seferturan Date: Mon, 9 Feb 2026 08:27:21 +0100 Subject: [PATCH 1/2] feat(sync): add support for media endpoint for collection items Fixes https://github.com/trakt/trakt-api/issues/708 --- projects/api/src/contracts/sync/index.ts | 10 ++++++++++ .../sync/schema/response/collectionResponseSchema.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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, From e07296d90bbb7bca792b7242e8aa47dde1eb6175 Mon Sep 17 00:00:00 2001 From: seferturan Date: Mon, 9 Feb 2026 08:27:40 +0100 Subject: [PATCH 2/2] chore: bump version to 0.3.5 --- projects/api/deno.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",