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/hoarder-openapi-spec.json | 93 +++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) (limited to 'packages/open-api/hoarder-openapi-spec.json') diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index a984fcc7..26f0a4b7 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -292,6 +292,57 @@ "Cursor": { "type": "string" }, + "Highlight": { + "type": "object", + "properties": { + "bookmarkId": { + "type": "string" + }, + "startOffset": { + "type": "number" + }, + "endOffset": { + "type": "number" + }, + "color": { + "type": "string", + "enum": [ + "yellow", + "red", + "green", + "blue" + ], + "default": "yellow" + }, + "text": { + "type": "string", + "nullable": true + }, + "note": { + "type": "string", + "nullable": true + }, + "id": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "required": [ + "bookmarkId", + "startOffset", + "endOffset", + "text", + "note", + "id", + "userId", + "createdAt" + ] + }, "List": { "type": "object", "properties": { @@ -870,6 +921,48 @@ } } }, + "/bookmarks/{bookmarkId}/highlights": { + "get": { + "description": "Get highlights of a bookmark", + "summary": "Get highlights of a bookmark", + "tags": [ + "Bookmarks" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "$ref": "#/components/parameters/BookmarkId" + } + ], + "responses": { + "200": { + "description": "The list of highlights", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "highlights": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Highlight" + } + } + }, + "required": [ + "highlights" + ] + } + } + } + } + } + } + }, "/lists": { "get": { "description": "Get all lists", -- cgit v1.2.3-70-g09d2