From 3995e6f716604860d6d782003001201eb87e4a02 Mon Sep 17 00:00:00 2001 From: Vlad Jerca Date: Mon, 13 Jul 2026 22:36:00 +0200 Subject: [PATCH] feat(calendar): add merged media endpoint contract Adds the `/calendars/:target/media/:start_date/:days` contract: the merged feed of movies and episodes for the window, ordered by availability date, per target (`my` / `all`). Optional `type` narrows to a single media type; the response reuses the movie/episode union schema. Bumps the package to 0.4.23. --- projects/api/deno.json | 2 +- projects/api/src/contracts/calendars/index.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/projects/api/deno.json b/projects/api/deno.json index 7aaf572..d76a0c1 100644 --- a/projects/api/deno.json +++ b/projects/api/deno.json @@ -1,7 +1,7 @@ { "name": "@trakt/api", "exports": "./src/index.ts", - "version": "0.4.22", + "version": "0.4.23", "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/calendars/index.ts b/projects/api/src/contracts/calendars/index.ts index b2f5121..f14f37c 100644 --- a/projects/api/src/contracts/calendars/index.ts +++ b/projects/api/src/contracts/calendars/index.ts @@ -107,6 +107,25 @@ Returns DVD and physical media releases during the requested UTC date range. Use 200: calendarMovieResponseSchema.array(), }, }, + media: { + summary: 'Get media', + description: `#### ✨ Extended Info 🎚 Filters +Returns the merged feed of movies and episodes during the requested UTC date range, ordered by availability date. Use \`target\` to choose the authenticated user calendar (\`my\`) or the global calendar (\`all\`), and \`type\` to narrow to a single media type.`, + method: 'GET', + path: '/:target/media/:start_date/:days', + query: extendedMediaQuerySchema + .merge(mediaFilterParamsSchema) + .merge(z.object({ + type: z.enum(['movie', 'show']).optional().openapi({ + description: + 'Narrow the feed to a single media type. Omit to return both.', + }), + })), + pathParams: calendarRequestParamsSchema, + responses: { + 200: hotReleaseResponseSchema.array(), + }, + }, releasesHot: { summary: 'Get hot releases', description: `#### ✨ Extended Info 🎚 Filters