aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/lib/attachments.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-01-11 18:09:51 +0000
committerMohamed Bassem <me@mbassem.com>2025-01-11 18:09:51 +0000
commit10506173cd5309e7c63d83055243abc67cecad4f (patch)
treef37f7dd704c63e34a1e5b0bffdda442b03179d9c /packages/trpc/lib/attachments.ts
parent107d923b3abd60329463957ca4604107b3427b2c (diff)
downloadkarakeep-10506173cd5309e7c63d83055243abc67cecad4f.tar.zst
feat: Add support for singlefile extension uploads. #172
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 0fd41d1b..f4fda9cd 100644
--- a/packages/trpc/lib/attachments.ts
+++ b/packages/trpc/lib/attachments.ts
@@ -7,6 +7,7 @@ export function mapDBAssetTypeToUserType(assetType: AssetTypes): ZAssetType {
const map: Record<AssetTypes, z.infer<typeof zAssetTypesSchema>> = {
[AssetTypes.LINK_SCREENSHOT]: "screenshot",
[AssetTypes.LINK_FULL_PAGE_ARCHIVE]: "fullPageArchive",
+ [AssetTypes.LINK_PRECRAWLED_ARCHIVE]: "precrawledArchive",
[AssetTypes.LINK_BANNER_IMAGE]: "bannerImage",
[AssetTypes.LINK_VIDEO]: "video",
[AssetTypes.BOOKMARK_ASSET]: "bookmarkAsset",
@@ -21,6 +22,7 @@ export function mapSchemaAssetTypeToDB(
const map: Record<ZAssetType, AssetTypes> = {
screenshot: AssetTypes.LINK_SCREENSHOT,
fullPageArchive: AssetTypes.LINK_FULL_PAGE_ARCHIVE,
+ precrawledArchive: AssetTypes.LINK_PRECRAWLED_ARCHIVE,
bannerImage: AssetTypes.LINK_BANNER_IMAGE,
video: AssetTypes.LINK_VIDEO,
bookmarkAsset: AssetTypes.BOOKMARK_ASSET,
@@ -33,6 +35,7 @@ export function humanFriendlyNameForAssertType(type: ZAssetType) {
const map: Record<ZAssetType, string> = {
screenshot: "Screenshot",
fullPageArchive: "Full Page Archive",
+ precrawledArchive: "Precrawled Archive",
bannerImage: "Banner Image",
video: "Video",
bookmarkAsset: "Bookmark Asset",
@@ -45,6 +48,7 @@ export function isAllowedToAttachAsset(type: ZAssetType) {
const map: Record<ZAssetType, boolean> = {
screenshot: true,
fullPageArchive: false,
+ precrawledArchive: false,
bannerImage: true,
video: false,
bookmarkAsset: false,
@@ -57,6 +61,7 @@ export function isAllowedToDetachAsset(type: ZAssetType) {
const map: Record<ZAssetType, boolean> = {
screenshot: true,
fullPageArchive: true,
+ precrawledArchive: false,
bannerImage: true,
video: true,
bookmarkAsset: false,