Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions projects/api/src/contracts/smart_lists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions projects/api/src/contracts/users/subroutes/smartLists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
Loading