From dedc5fb24536832eae2c18d84efa2a92272c955c Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 26 May 2024 00:06:32 +0000 Subject: feature: Full page archival with monolith. Fixes #132 --- apps/web/app/api/assets/route.ts | 4 +- .../dashboard/preview/LinkContentSection.tsx | 18 + apps/workers/crawlerWorker.ts | 66 +- apps/workers/package.json | 1 + docker/Dockerfile | 1 + packages/db/drizzle/0022_tough_nextwave.sql | 1 + packages/db/drizzle/meta/0022_snapshot.json | 1015 ++++++++++++++++++++ packages/db/drizzle/meta/_journal.json | 7 + packages/db/schema.ts | 1 + packages/shared/assetdb.ts | 35 +- packages/shared/config.ts | 2 + packages/shared/types/bookmarks.ts | 1 + packages/trpc/routers/bookmarks.ts | 3 + pnpm-lock.yaml | 111 ++- 14 files changed, 1259 insertions(+), 7 deletions(-) create mode 100644 packages/db/drizzle/0022_tough_nextwave.sql create mode 100644 packages/db/drizzle/meta/0022_snapshot.json diff --git a/apps/web/app/api/assets/route.ts b/apps/web/app/api/assets/route.ts index f1a17fc9..9028f556 100644 --- a/apps/web/app/api/assets/route.ts +++ b/apps/web/app/api/assets/route.ts @@ -5,7 +5,7 @@ import type { ZUploadResponse } from "@hoarder/shared/types/uploads"; import { newAssetId, saveAsset, - SUPPORTED_ASSET_TYPES, + SUPPORTED_UPLOAD_ASSET_TYPES, } from "@hoarder/shared/assetdb"; import serverConfig from "@hoarder/shared/config"; @@ -29,7 +29,7 @@ export async function POST(request: Request) { let contentType; if (data instanceof File) { contentType = data.type; - if (!SUPPORTED_ASSET_TYPES.has(contentType)) { + if (!SUPPORTED_UPLOAD_ASSET_TYPES.has(contentType)) { return Response.json( { error: "Unsupported asset type" }, { status: 400 }, diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx index 29001c7f..3aeacdcd 100644 --- a/apps/web/components/dashboard/preview/LinkContentSection.tsx +++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx @@ -12,6 +12,16 @@ import { ScrollArea } from "@radix-ui/react-scroll-area"; import { ZBookmark, ZBookmarkedLink } from "@hoarder/shared/types/bookmarks"; +function FullPageArchiveSection({ link }: { link: ZBookmarkedLink }) { + return ( +