diff options
| author | Mohamed Bassem <me@mbassem.com> | 2026-01-18 21:38:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-18 21:38:21 +0000 |
| commit | e09061bd37c6496685ea0fdabe1d4d01f1b659ad (patch) | |
| tree | 2896ccceb54e7af8dc006d4bdc89b18af42ca078 /packages/shared | |
| parent | edf3f681a77ce6739ca0773af6e5a645e2c91ee9 (diff) | |
| download | karakeep-e09061bd37c6496685ea0fdabe1d4d01f1b659ad.tar.zst | |
feat: Add attachedBy field to update tags endpoint (#2281)
* feat: Add attachedBy field to updateTags endpoint
This change allows callers to specify the attachedBy field when updating
tags on a bookmark. The field defaults to "human" if not provided,
maintaining backward compatibility with existing code.
Changes:
- Added attachedBy field to zManipulatedTagSchema with default "human"
- Updated updateTags endpoint to use the specified attachedBy value
- Created mapping logic to correctly assign attachedBy to each tag
* fix(cli): migrate bookmark source in migration command
* fix
* reduce queries
---------
Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'packages/shared')
| -rw-r--r-- | packages/shared/types/bookmarks.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/shared/types/bookmarks.ts b/packages/shared/types/bookmarks.ts index 1e4f855e..ec27c393 100644 --- a/packages/shared/types/bookmarks.ts +++ b/packages/shared/types/bookmarks.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { zCursorV2 } from "./pagination"; -import { zBookmarkTagSchema } from "./tags"; +import { zAttachedByEnumSchema, zBookmarkTagSchema } from "./tags"; export const MAX_BOOKMARK_TITLE_LENGTH = 1000; @@ -252,6 +252,7 @@ export const zManipulatedTagSchema = z // At least one of the two must be set tagId: z.string().optional(), // If the tag already exists and we know its id we should pass it tagName: z.string().optional(), + attachedBy: zAttachedByEnumSchema.optional().default("human"), }) .refine((val) => !!val.tagId || !!val.tagName, { message: "You must provide either a tagId or a tagName", |
