diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-09-28 11:03:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-28 11:03:48 +0100 |
| commit | 62f7d900c52784ff05d933b52379e5455ea6bd00 (patch) | |
| tree | 2702d74c96576447974af84850f3ba6b66beeeb4 /packages/open-api | |
| parent | 9fe09bfa9021c8d85d2d9aef591936101cab19f6 (diff) | |
| download | karakeep-62f7d900c52784ff05d933b52379e5455ea6bd00.tar.zst | |
feat: Add tag search and pagination (#1987)
* feat: Add tag search and use in the homepage
* use paginated query in the all tags view
* wire the load more buttons
* add skeleton to all tags page
* fix attachedby aggregation
* fix loading states
* fix hasNextPage
* use action buttons for load more buttons
* migrate the tags auto complete to the search api
* Migrate the tags editor to the new search API
* Replace tag merging dialog with tag auto completion
* Merge both search and list APIs
* fix tags.list
* add some tests for the endpoint
* add relevance based sorting
* change cursor
* update the REST API
* fix review comments
* more fixes
* fix lockfile
* i18n
* fix visible tags
Diffstat (limited to 'packages/open-api')
| -rw-r--r-- | packages/open-api/karakeep-openapi-spec.json | 61 | ||||
| -rw-r--r-- | packages/open-api/lib/tags.ts | 6 |
2 files changed, 65 insertions, 2 deletions
diff --git a/packages/open-api/karakeep-openapi-spec.json b/packages/open-api/karakeep-openapi-spec.json index 83a5b811..ffa9c357 100644 --- a/packages/open-api/karakeep-openapi-spec.json +++ b/packages/open-api/karakeep-openapi-spec.json @@ -2292,6 +2292,60 @@ "bearerAuth": [] } ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": false, + "name": "nameContains", + "in": "query" + }, + { + "schema": { + "type": "string", + "enum": [ + "name", + "usage", + "relevance" + ], + "default": "usage" + }, + "required": false, + "name": "sort", + "in": "query" + }, + { + "schema": { + "type": "string", + "enum": [ + "ai", + "human", + "none" + ] + }, + "required": false, + "name": "attachedBy", + "in": "query" + }, + { + "schema": { + "type": "string" + }, + "required": false, + "name": "cursor", + "in": "query" + }, + { + "schema": { + "type": "number", + "nullable": true + }, + "required": false, + "name": "limit", + "in": "query" + } + ], "responses": { "200": { "description": "Object with all tags data.", @@ -2305,10 +2359,15 @@ "items": { "$ref": "#/components/schemas/Tag" } + }, + "nextCursor": { + "type": "string", + "nullable": true } }, "required": [ - "tags" + "tags", + "nextCursor" ] } } diff --git a/packages/open-api/lib/tags.ts b/packages/open-api/lib/tags.ts index 0a4f62cb..84af39b1 100644 --- a/packages/open-api/lib/tags.ts +++ b/packages/open-api/lib/tags.ts @@ -9,6 +9,7 @@ import { zCreateTagRequestSchema, zGetTagResponseSchema, zTagBasicSchema, + zTagListQueryParamsSchema, zUpdateTagRequestSchema, } from "@karakeep/shared/types/tags"; @@ -43,7 +44,9 @@ registry.registerPath({ summary: "Get all tags", tags: ["Tags"], security: [{ [BearerAuth.name]: [] }], - request: {}, + request: { + query: zTagListQueryParamsSchema, + }, responses: { 200: { description: "Object with all tags data.", @@ -51,6 +54,7 @@ registry.registerPath({ "application/json": { schema: z.object({ tags: z.array(TagSchema), + nextCursor: z.string().nullable(), }), }, }, |
