From 9286dd9a443e3aa12e4e07bcbc2d4c092a5106fe Mon Sep 17 00:00:00 2001 From: seferturan Date: Fri, 13 Feb 2026 09:50:34 +0100 Subject: [PATCH 1/3] feat(search): add lists support to adding and removing recent searches --- projects/api/src/contracts/search/index.ts | 2 +- .../search/schema/request/recentSearchRequestSchema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/api/src/contracts/search/index.ts b/projects/api/src/contracts/search/index.ts index ff3997ef..c5a436e0 100644 --- a/projects/api/src/contracts/search/index.ts +++ b/projects/api/src/contracts/search/index.ts @@ -16,7 +16,7 @@ import type { trendingSearchPersonResponseSchema } from './schema/response/trend import { trendingSearchResponseSchema } from './schema/response/trendingSearchResponseSchema.ts'; import type { trendingSearchShowResponseSchema } from './schema/response/trendingSearchShowResponseSchema.ts'; /** - * TODO: add support for 'episode', 'list' + * TODO: add support for 'episode' */ const recent = builder.router({ diff --git a/projects/api/src/contracts/search/schema/request/recentSearchRequestSchema.ts b/projects/api/src/contracts/search/schema/request/recentSearchRequestSchema.ts index f181e4ff..7c008847 100644 --- a/projects/api/src/contracts/search/schema/request/recentSearchRequestSchema.ts +++ b/projects/api/src/contracts/search/schema/request/recentSearchRequestSchema.ts @@ -3,5 +3,5 @@ import { z } from '../../../_internal/z.ts'; export const recentSearchRequestSchema = z.object({ query: z.string(), id: z.number().int(), - type: z.enum(['movies', 'shows', 'people']), + type: z.enum(['movies', 'shows', 'people', 'lists']), }); From 176f26ca93fa1ae4a4f3ac5129d1fd549aabedf3 Mon Sep 17 00:00:00 2001 From: seferturan Date: Fri, 13 Feb 2026 09:54:43 +0100 Subject: [PATCH 2/3] feat(search): adds support for list searches Fixes https://github.com/trakt/trakt-api/issues/714 --- projects/api/src/contracts/search/index.ts | 2 +- .../search/schema/response/searchListResponseSchema.ts | 8 ++++++++ .../search/schema/response/searchResultResponseSchema.ts | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 projects/api/src/contracts/search/schema/response/searchListResponseSchema.ts diff --git a/projects/api/src/contracts/search/index.ts b/projects/api/src/contracts/search/index.ts index c5a436e0..284e45ed 100644 --- a/projects/api/src/contracts/search/index.ts +++ b/projects/api/src/contracts/search/index.ts @@ -43,7 +43,7 @@ export const search = builder.router({ path: '/:type', method: 'GET', pathParams: searchTypeParamFactory< - ['movie', 'show', 'person'] + ['movie', 'show', 'person', 'list'] >(), query: searchQuerySchema .merge(searchEngineSchema) diff --git a/projects/api/src/contracts/search/schema/response/searchListResponseSchema.ts b/projects/api/src/contracts/search/schema/response/searchListResponseSchema.ts new file mode 100644 index 00000000..f641a395 --- /dev/null +++ b/projects/api/src/contracts/search/schema/response/searchListResponseSchema.ts @@ -0,0 +1,8 @@ +import { int64, z } from '../../../_internal/z.ts'; +import { listResponseSchema } from '../../../models/index.ts'; + +export const searchListResponseSchema = z.object({ + score: int64(z.number().int()), + type: z.literal('list'), + list: listResponseSchema.nullish(), +}); diff --git a/projects/api/src/contracts/search/schema/response/searchResultResponseSchema.ts b/projects/api/src/contracts/search/schema/response/searchResultResponseSchema.ts index ab264af4..d1e7d033 100644 --- a/projects/api/src/contracts/search/schema/response/searchResultResponseSchema.ts +++ b/projects/api/src/contracts/search/schema/response/searchResultResponseSchema.ts @@ -1,4 +1,5 @@ import { z } from '../../../_internal/z.ts'; +import { searchListResponseSchema } from './searchListResponseSchema.ts'; import { searchMovieResponseSchema } from './searchMovieResponseSchema.ts'; import { searchPersonResponseSchema } from './searchPersonResponseSchema.ts'; import { searchShowResponseSchema } from './searchShowResponseSchema.ts'; @@ -7,4 +8,5 @@ export const searchResultResponseSchema = z.union([ searchMovieResponseSchema, searchShowResponseSchema, searchPersonResponseSchema, + searchListResponseSchema, ]); From 2031a265d1ca9a971d19925d31f7d430a51253ef Mon Sep 17 00:00:00 2001 From: seferturan Date: Fri, 13 Feb 2026 09:55:02 +0100 Subject: [PATCH 3/3] chore: bump version to 0.3.8 --- 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 15231fe7..8d7eafe1 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.7", + "version": "0.3.8", "imports": { "@anatine/zod-openapi": "npm:@anatine/zod-openapi@^2.2.6", "@std/testing": "jsr:@std/testing@^1.0.5",