From 3f56389f55ef116f8cea17c15c684798fb942290 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Fri, 27 Dec 2024 19:21:43 +0000 Subject: feat: Add REST APIs for manipulating highlights. Fixes #620 --- packages/open-api/lib/bookmarks.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'packages/open-api/lib/bookmarks.ts') diff --git a/packages/open-api/lib/bookmarks.ts b/packages/open-api/lib/bookmarks.ts index 0ddf921e..12a122fa 100644 --- a/packages/open-api/lib/bookmarks.ts +++ b/packages/open-api/lib/bookmarks.ts @@ -12,6 +12,7 @@ import { } from "@hoarder/shared/types/bookmarks"; import { BearerAuth } from "./common"; +import { HighlightSchema } from "./highlights"; import { BookmarkSchema, PaginatedBookmarksSchema, @@ -217,3 +218,25 @@ registry.registerPath({ }, }, }); + +registry.registerPath({ + method: "get", + path: "/bookmarks/{bookmarkId}/highlights", + description: "Get highlights of a bookmark", + summary: "Get highlights of a bookmark", + tags: ["Bookmarks"], + security: [{ [BearerAuth.name]: [] }], + request: { + params: z.object({ bookmarkId: BookmarkIdSchema }), + }, + responses: { + 200: { + description: "The list of highlights", + content: { + "application/json": { + schema: z.object({ highlights: z.array(HighlightSchema) }), + }, + }, + }, + }, +}); -- cgit v1.2.3-70-g09d2