Skip to content

Commit 3995e6f

Browse files
committed
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.
1 parent b8d9c80 commit 3995e6f

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

projects/api/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@trakt/api",
33
"exports": "./src/index.ts",
4-
"version": "0.4.22",
4+
"version": "0.4.23",
55
"imports": {
66
"@anatine/zod-openapi": "npm:@anatine/zod-openapi@^2.2.6",
77
"@std/testing": "jsr:@std/testing@^1.0.5",

projects/api/src/contracts/calendars/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ Returns DVD and physical media releases during the requested UTC date range. Use
107107
200: calendarMovieResponseSchema.array(),
108108
},
109109
},
110+
media: {
111+
summary: 'Get media',
112+
description: `#### ✨ Extended Info 🎚 Filters
113+
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.`,
114+
method: 'GET',
115+
path: '/:target/media/:start_date/:days',
116+
query: extendedMediaQuerySchema
117+
.merge(mediaFilterParamsSchema)
118+
.merge(z.object({
119+
type: z.enum(['movie', 'show']).optional().openapi({
120+
description:
121+
'Narrow the feed to a single media type. Omit to return both.',
122+
}),
123+
})),
124+
pathParams: calendarRequestParamsSchema,
125+
responses: {
126+
200: hotReleaseResponseSchema.array(),
127+
},
128+
},
110129
releasesHot: {
111130
summary: 'Get hot releases',
112131
description: `#### ✨ Extended Info 🎚 Filters

0 commit comments

Comments
 (0)