aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/lib/attachments.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-07-06 21:50:23 +0000
committerMohamed Bassem <me@mbassem.com>2025-07-06 22:04:56 +0000
commitdee3a4d44ddb1999e7dec383889246e87f202d92 (patch)
tree1984234f17eed886bc834543e1505ddbfb43228f /packages/trpc/lib/attachments.ts
parent362be3008aa8b036c4c448a86e459044af8784c2 (diff)
downloadkarakeep-dee3a4d44ddb1999e7dec383889246e87f202d92.tar.zst
feat: Store large html content in the asset db
Diffstat (limited to 'packages/trpc/lib/attachments.ts')
-rw-r--r--packages/trpc/lib/attachments.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/trpc/lib/attachments.ts b/packages/trpc/lib/attachments.ts
index 739aa8f5..e886b821 100644
--- a/packages/trpc/lib/attachments.ts
+++ b/packages/trpc/lib/attachments.ts
@@ -14,6 +14,7 @@ export function mapDBAssetTypeToUserType(assetType: AssetTypes): ZAssetType {
[AssetTypes.LINK_PRECRAWLED_ARCHIVE]: "precrawledArchive",
[AssetTypes.LINK_BANNER_IMAGE]: "bannerImage",
[AssetTypes.LINK_VIDEO]: "video",
+ [AssetTypes.LINK_HTML_CONTENT]: "linkHtmlContent",
[AssetTypes.BOOKMARK_ASSET]: "bookmarkAsset",
[AssetTypes.UNKNOWN]: "bannerImage",
};
@@ -31,6 +32,7 @@ export function mapSchemaAssetTypeToDB(
bannerImage: AssetTypes.LINK_BANNER_IMAGE,
video: AssetTypes.LINK_VIDEO,
bookmarkAsset: AssetTypes.BOOKMARK_ASSET,
+ linkHtmlContent: AssetTypes.LINK_HTML_CONTENT,
unknown: AssetTypes.UNKNOWN,
};
return map[assetType];
@@ -45,6 +47,7 @@ export function humanFriendlyNameForAssertType(type: ZAssetType) {
bannerImage: "Banner Image",
video: "Video",
bookmarkAsset: "Bookmark Asset",
+ linkHtmlContent: "HTML Content",
unknown: "Unknown",
};
return map[type];
@@ -59,6 +62,7 @@ export function isAllowedToAttachAsset(type: ZAssetType) {
bannerImage: true,
video: false,
bookmarkAsset: false,
+ linkHtmlContent: false,
unknown: false,
};
return map[type];
@@ -73,6 +77,7 @@ export function isAllowedToDetachAsset(type: ZAssetType) {
bannerImage: true,
video: true,
bookmarkAsset: false,
+ linkHtmlContent: false,
unknown: false,
};
return map[type];