From e439225cbeb1c0dbd731e6b2490c47084ab4cb3a Mon Sep 17 00:00:00 2001 From: Justin Nemeth Date: Tue, 4 Aug 2026 14:40:09 -0700 Subject: [PATCH] docs(api): fix smart list available options --- .../api/src/contracts/smart_lists/index.ts | 19 ++++++++----------- .../contracts/users/subroutes/smartLists.ts | 4 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/projects/api/src/contracts/smart_lists/index.ts b/projects/api/src/contracts/smart_lists/index.ts index 05ddea2..743e29d 100644 --- a/projects/api/src/contracts/smart_lists/index.ts +++ b/projects/api/src/contracts/smart_lists/index.ts @@ -9,12 +9,6 @@ import { smartListItemResponseSchema } from '../_internal/response/smartListItem import { z } from '../_internal/z.ts'; import { listParamsSchema } from '../users/schema/request/listParamsSchema.ts'; -const listItemsPathParamsSchema = listParamsSchema.extend({ - type: z.string().describe('Smart list item type filter.'), - sort_by: z.string().describe('Sort by a specific property.'), - sort_how: z.string().describe('Sort direction.'), -}); - /** ts-rest contract for the `smartLists` endpoints. */ export const smartLists = builder.router({ summary: { @@ -36,13 +30,16 @@ Returns a single smart list definition by its globally-unique slug. Use the [**/ summary: 'Get smart list items', description: `#### 🔓 OAuth Optional 📄 Pagination ✨ Extended Info 🎚 Filters 😁 Emojis -Returns the dynamic items a smart list resolves to. Use \`type\`, \`sort_by\`, and \`sort_how\` to control the returned item set and order, plus query filters and pagination to refine the result set.`, - path: '/:list_id/items/:type/:sort_by/:sort_how', +Returns the dynamic items a smart list resolves to. Items always match the list's \`media_type\`, so a movie list only ever resolves to movies and a show list to shows. Use query filters and pagination to refine the result set.`, + path: '/:list_id/items', method: 'GET', - pathParams: listItemsPathParamsSchema, + pathParams: listParamsSchema, query: extendedMediaQuerySchema - .merge(mediaFilterParamsSchema) - .merge(ignoreQuerySchema) + .merge(mediaFilterParamsSchema.omit({ + start_date: true, + end_date: true, + })) + .merge(ignoreQuerySchema.omit({ ignore_collected: true })) .merge(pageQuerySchema) .merge(limitlessQuerySchema), responses: { diff --git a/projects/api/src/contracts/users/subroutes/smartLists.ts b/projects/api/src/contracts/users/subroutes/smartLists.ts index c3203dc..07e04af 100644 --- a/projects/api/src/contracts/users/subroutes/smartLists.ts +++ b/projects/api/src/contracts/users/subroutes/smartLists.ts @@ -10,7 +10,7 @@ const smartList = builder.router({ summary: { summary: 'Get smart list', description: `#### 🔓 OAuth Optional -Returns a single smart list definition. Use the [**/users/:id/smart-lists/:list_id/items**](#reference/users) method to get the dynamic items this smart list resolves to.`, +Returns a single smart list definition. Use the [**/smart-lists/:list_id/items**](#reference/smart-lists) method to get the dynamic items this smart list resolves to.`, path: '/', method: 'GET', pathParams: profileParamsSchema.merge(listParamsSchema), @@ -53,7 +53,7 @@ export const smartLists = builder.router({ personal: { summary: "Get a user's smart lists", description: `#### 🔓 OAuth Optional -Returns all smart list definitions for a user. Use the [**/users/:id/smart-lists/:list_id/items**](#reference/users) method to get the dynamic items a specific smart list resolves to.`, +Returns all smart list definitions for a user. Use the [**/smart-lists/:list_id/items**](#reference/smart-lists) method to get the dynamic items a specific smart list resolves to.`, path: '', method: 'GET', pathParams: profileParamsSchema,