From e09061bd37c6496685ea0fdabe1d4d01f1b659ad Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 18 Jan 2026 21:38:21 +0000 Subject: 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 --- packages/shared/types/bookmarks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/shared') 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", -- cgit v1.2.3-70-g09d2