aboutsummaryrefslogtreecommitdiffstats
path: root/packages/open-api/lib/bookmarks.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2024-12-27 19:21:43 +0000
committerMohamed Bassem <me@mbassem.com>2024-12-27 19:34:04 +0000
commit3f56389f55ef116f8cea17c15c684798fb942290 (patch)
tree1a398accbcfc75674c5cc4970bc85fd27c637911 /packages/open-api/lib/bookmarks.ts
parent86d74e3f32dd5bccc8df195b55391e206df9a1c4 (diff)
downloadkarakeep-3f56389f55ef116f8cea17c15c684798fb942290.tar.zst
feat: Add REST APIs for manipulating highlights. Fixes #620
Diffstat (limited to 'packages/open-api/lib/bookmarks.ts')
-rw-r--r--packages/open-api/lib/bookmarks.ts23
1 files changed, 23 insertions, 0 deletions
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) }),
+ },
+ },
+ },
+ },
+});