full upgrade to dev

This commit is contained in:
2026-01-08 11:31:57 +01:00
parent 4bf94007cc
commit 7320a0562d
17 changed files with 629 additions and 442 deletions

View File

@@ -7,9 +7,9 @@ async function getFetch() {
try {
const mod = await import("node-fetch");
// support both CJS and ESM interop
return (mod as any).default ?? mod;
} catch (err) {
return (globalThis as any).fetch;
return (mod as { default: unknown }).default ?? mod;
} catch (_err) {
return (globalThis as unknown as { fetch: unknown }).fetch;
}
}
@@ -49,9 +49,10 @@ export async function GET() {
const fetchFn = await getFetch();
const response = await fetchFn(
`${GHOST_API_URL}/ghost/api/content/posts/?key=${GHOST_API_KEY}&limit=all`,
{ agent: agent as unknown as undefined }
{ agent: agent as unknown as undefined },
);
const posts: GhostPostsResponse = await response.json() as GhostPostsResponse;
const posts: GhostPostsResponse =
(await response.json()) as GhostPostsResponse;
if (!posts || !posts.posts) {
console.error("Invalid posts data");