aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-08 15:22:14 +0000
committerGitHub <noreply@github.com>2025-11-08 15:22:14 +0000
commit31960fcd11daa2dfaf8ae409c80b572c9b22940f (patch)
tree17bd227dac336ccabd2b6ffc6558920c68e053d0 /packages/shared
parent99413db0e79a156a1b87eacd3c6a7b83e9df946e (diff)
downloadkarakeep-31960fcd11daa2dfaf8ae409c80b572c9b22940f.tar.zst
feat: Add support for user uploaded files (#2100)
* feat: add user file upload support for bookmarks Add a new "user-uploaded" asset type that allows users to upload and attach their own files to bookmarks from the attachment box in the bookmark preview page. Changes: - Add USER_UPLOADED asset type to database schema - Add userUploaded to zAssetTypesSchema for type safety - Update attachment permissions to allow attaching/detaching user files - Add fileName field to asset schema for displaying custom filenames - Add "Upload File" button in AttachmentBox component - Display actual filename for user-uploaded files - Allow any file type for user uploads (respects existing upload limits) - Add Upload icon for user-uploaded files Fixes #1863 related asset attachment improvements * fix: ensure fileName is returned and remove edit button for user uploads - Fix attachAsset mutation to fetch and return complete asset with fileName instead of just returning the input (which lacks fileName) - Remove replace/edit button for user-uploaded files - users can only delete and re-upload instead - This ensures the filename displays correctly in the UI immediately after upload Fixes fileName propagation issue for user-uploaded assets * fix asset file name * remove filename from attach asset api --------- Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/types/bookmarks.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/shared/types/bookmarks.ts b/packages/shared/types/bookmarks.ts
index f108d006..d72525d1 100644
--- a/packages/shared/types/bookmarks.ts
+++ b/packages/shared/types/bookmarks.ts
@@ -24,6 +24,7 @@ export const zAssetTypesSchema = z.enum([
"video",
"bookmarkAsset",
"precrawledArchive",
+ "userUploaded",
"unknown",
]);
export type ZAssetType = z.infer<typeof zAssetTypesSchema>;
@@ -31,6 +32,7 @@ export type ZAssetType = z.infer<typeof zAssetTypesSchema>;
export const zAssetSchema = z.object({
id: z.string(),
assetType: zAssetTypesSchema,
+ fileName: z.string().nullish(),
});
export const zBookmarkedLinkSchema = z.object({