diff --git a/src/pages/api/cve/[page].ts b/src/pages/api/cve/[page].ts index f7c2bc0e..d4d53dde 100644 --- a/src/pages/api/cve/[page].ts +++ b/src/pages/api/cve/[page].ts @@ -22,7 +22,7 @@ export const getServerSideCVEs = async ( } try { const res = await fetch( - `https://api.main.devguard.org/api/v1/vulndb/list-ids-by-creation-date/?offset=${encodeURIComponent(String(offset))}&limit=${encodeURIComponent(String(CVES_PER_SITEMAP))}`, + `${API_BASE_URL}/vulndb/list-ids-by-creation-date/?offset=${encodeURIComponent(String(offset))}&limit=${encodeURIComponent(String(CVES_PER_SITEMAP))}`, ) if (!res.ok) { console.error(`Upstream API error: ${res.status} ${res.statusText}`) diff --git a/src/pages/api/sitemap.xml.ts b/src/pages/api/sitemap.xml.ts index 084aa9da..309e3693 100644 --- a/src/pages/api/sitemap.xml.ts +++ b/src/pages/api/sitemap.xml.ts @@ -13,7 +13,7 @@ export const getServerSideCVEs = async (): Promise => { return { total: cachedTotal.value } } const res = await fetch( - `https://api.main.devguard.org/api/v1/vulndb/list-ids-by-creation-date/`, + `${API_BASE_URL}/vulndb/list-ids-by-creation-date/`, ) if (!res.ok) { throw new Error(`Upstream API error: ${res.status} ${res.statusText}`) diff --git a/src/types/api.ts b/src/types/api.ts index 65fa4293..54bea669 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -1,19 +1,18 @@ export type AffectedComponent = { - id: string - Source: string + id: number purl: string ecosystem: string - scheme: string - type: string - name: string - namespace: string + version: string | null + semverStart?: string | null + semverEnd?: string | null + versionIntroduced?: string | null + versionFixed?: string | null + Source?: string + scheme?: string + type?: string + name?: string + namespace?: string subpath?: string - version: string - semverStart?: string - semverEnd?: string - versionIntroduced?: string - versionFixed?: string - cves?: string } export type AffectedComponents = AffectedComponent[]