diff options
Diffstat (limited to 'packages/open-api')
| -rw-r--r-- | packages/open-api/hoarder-openapi-spec.json | 55 | ||||
| -rw-r--r-- | packages/open-api/lib/bookmarks.ts | 8 | ||||
| -rw-r--r-- | packages/open-api/lib/lists.ts | 8 | ||||
| -rw-r--r-- | packages/open-api/lib/pagination.ts | 9 | ||||
| -rw-r--r-- | packages/open-api/lib/tags.ts | 8 |
5 files changed, 82 insertions, 6 deletions
diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index dfe7c761..9a1d8634 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -564,6 +564,17 @@ "required": false, "name": "cursor", "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" } ], "responses": { @@ -778,6 +789,17 @@ "required": false, "name": "cursor", "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" } ], "responses": { @@ -809,6 +831,17 @@ "parameters": [ { "$ref": "#/components/parameters/BookmarkId" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" } ], "responses": { @@ -1965,6 +1998,17 @@ "required": false, "name": "cursor", "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" } ], "responses": { @@ -2374,6 +2418,17 @@ "required": false, "name": "cursor", "in": "query" + }, + { + "schema": { + "type": "boolean", + "default": true, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks." + }, + "required": false, + "description": "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + "name": "includeContent", + "in": "query" } ], "responses": { diff --git a/packages/open-api/lib/bookmarks.ts b/packages/open-api/lib/bookmarks.ts index 51c67369..e344d656 100644 --- a/packages/open-api/lib/bookmarks.ts +++ b/packages/open-api/lib/bookmarks.ts @@ -17,6 +17,7 @@ import { ErrorSchema } from "./errors"; import { HighlightSchema } from "./highlights"; import { BookmarkSchema, + IncludeContentSearchParamSchema, PaginatedBookmarksSchema, PaginationSchema, } from "./pagination"; @@ -60,7 +61,8 @@ registry.registerPath({ archived: z.boolean().optional(), favourited: z.boolean().optional(), }) - .merge(PaginationSchema), + .merge(PaginationSchema) + .merge(IncludeContentSearchParamSchema), }, responses: { 200: { @@ -86,7 +88,8 @@ registry.registerPath({ .object({ q: z.string(), }) - .merge(PaginationSchema), + .merge(PaginationSchema) + .merge(IncludeContentSearchParamSchema), }, responses: { 200: { @@ -145,6 +148,7 @@ registry.registerPath({ security: [{ [BearerAuth.name]: [] }], request: { params: z.object({ bookmarkId: BookmarkIdSchema }), + query: IncludeContentSearchParamSchema, }, responses: { 200: { diff --git a/packages/open-api/lib/lists.ts b/packages/open-api/lib/lists.ts index f2c0d954..2273d33b 100644 --- a/packages/open-api/lib/lists.ts +++ b/packages/open-api/lib/lists.ts @@ -13,7 +13,11 @@ import { import { BookmarkIdSchema } from "./bookmarks"; import { BearerAuth } from "./common"; import { ErrorSchema } from "./errors"; -import { PaginatedBookmarksSchema, PaginationSchema } from "./pagination"; +import { + IncludeContentSearchParamSchema, + PaginatedBookmarksSchema, + PaginationSchema, +} from "./pagination"; export const registry = new OpenAPIRegistry(); extendZodWithOpenApi(z); @@ -192,7 +196,7 @@ registry.registerPath({ security: [{ [BearerAuth.name]: [] }], request: { params: z.object({ listId: ListIdSchema }), - query: PaginationSchema, + query: PaginationSchema.merge(IncludeContentSearchParamSchema), }, responses: { 200: { diff --git a/packages/open-api/lib/pagination.ts b/packages/open-api/lib/pagination.ts index dfe835e2..382f00ef 100644 --- a/packages/open-api/lib/pagination.ts +++ b/packages/open-api/lib/pagination.ts @@ -22,3 +22,12 @@ export const PaginationSchema = z cursor: CursorSchema.optional(), }) .openapi("Pagination"); + +export const IncludeContentSearchParamSchema = z.object({ + includeContent: z + .boolean() + .default(true) + .describe( + "If set to true, bookmark's content will be included in the response. Note, this content can be large for some bookmarks.", + ), +}); diff --git a/packages/open-api/lib/tags.ts b/packages/open-api/lib/tags.ts index 86353924..c51e3b84 100644 --- a/packages/open-api/lib/tags.ts +++ b/packages/open-api/lib/tags.ts @@ -11,7 +11,11 @@ import { import { BearerAuth } from "./common"; import { ErrorSchema } from "./errors"; -import { PaginatedBookmarksSchema, PaginationSchema } from "./pagination"; +import { + IncludeContentSearchParamSchema, + PaginatedBookmarksSchema, + PaginationSchema, +} from "./pagination"; export const registry = new OpenAPIRegistry(); extendZodWithOpenApi(z); @@ -154,7 +158,7 @@ registry.registerPath({ security: [{ [BearerAuth.name]: [] }], request: { params: z.object({ tagId: TagIdSchema }), - query: PaginationSchema, + query: PaginationSchema.merge(IncludeContentSearchParamSchema), }, responses: { 200: { |
