From 8b69cddfb92b3b7548d3f90dbec1038c728ea5d9 Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Mon, 30 Sep 2024 02:02:48 +0200 Subject: feature(web): Add ability to manually trigger full page archives. Fixes #398 (#418) * [Feature Request] Ability to select what to "crawl full page archive" #398 Added the ability to start a full page crawl for links and also in bulk operations added the ability to refresh links as a bulk operation as well * minor icon and wording changes --------- Co-authored-by: MohamedBassem --- packages/shared/queues.ts | 3 ++- packages/trpc/routers/bookmarks.ts | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts index 756f095d..cadeefd0 100644 --- a/packages/shared/queues.ts +++ b/packages/shared/queues.ts @@ -17,8 +17,9 @@ export function runQueueDBMigrations() { export const zCrawlLinkRequestSchema = z.object({ bookmarkId: z.string(), runInference: z.boolean().optional(), + archiveFullPage: z.boolean().optional().default(false), }); -export type ZCrawlLinkRequest = z.infer; +export type ZCrawlLinkRequest = z.input; export const LinkCrawlerQueue = new SqliteQueue( "link_crawler_queue", diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 9990c6ed..9b23c88e 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -426,11 +426,17 @@ export const bookmarksAppRouter = router({ } }), recrawlBookmark: authedProcedure - .input(z.object({ bookmarkId: z.string() })) + .input( + z.object({ + bookmarkId: z.string(), + archiveFullPage: z.boolean().optional().default(false), + }), + ) .use(ensureBookmarkOwnership) .mutation(async ({ input }) => { await LinkCrawlerQueue.enqueue({ bookmarkId: input.bookmarkId, + archiveFullPage: input.archiveFullPage, }); }), getBookmark: authedProcedure -- cgit v1.2.3-70-g09d2