From d1f3b963885761e0a04cafebd93eff90ef2613d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Thu, 9 Jan 2025 20:52:12 +0100 Subject: [PATCH] feat: add scrapeId in document.metadata --- apps/api/src/controllers/v1/types.ts | 1 + apps/api/src/scraper/scrapeURL/lib/extractMetadata.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 1c9112c5..86f2f3c0 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -443,6 +443,7 @@ export type Document = { url?: string; sourceURL?: string; statusCode: number; + scrapeId?: string; error?: string; [key: string]: string | string[] | number | undefined; }; diff --git a/apps/api/src/scraper/scrapeURL/lib/extractMetadata.ts b/apps/api/src/scraper/scrapeURL/lib/extractMetadata.ts index 1f494893..5c489a70 100644 --- a/apps/api/src/scraper/scrapeURL/lib/extractMetadata.ts +++ b/apps/api/src/scraper/scrapeURL/lib/extractMetadata.ts @@ -156,6 +156,7 @@ export function extractMetadata( publishedTime, articleTag, articleSection, + scrapeId: meta.id, ...customMetadata, }; }