mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-21 06:13:48 +00:00
feat(api): expose app version in /api/v1/stats
Add version to StatsResponse and getStats so the canonical public monitoring endpoint reports the running build alongside the footer and /health. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -295,10 +295,12 @@ describe("REST API (/api/v1)", () => {
|
||||
feeds_created: number;
|
||||
active_feeds: number;
|
||||
attachments_enabled: boolean;
|
||||
version: string;
|
||||
};
|
||||
expect(stats.feeds_created).toBeGreaterThanOrEqual(1);
|
||||
expect(stats.active_feeds).toBeGreaterThanOrEqual(1);
|
||||
expect(typeof stats.attachments_enabled).toBe("boolean");
|
||||
expect(stats.version).toMatch(/^\d+\.\d+\.\d+/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -154,6 +154,9 @@ export const StatsSchema = z
|
||||
active_feeds: z.number(),
|
||||
websub_subscriptions_active: z.number(),
|
||||
attachments_enabled: z.boolean(),
|
||||
version: z.string().openapi({
|
||||
description: "Running app version (package.json), inlined at build time.",
|
||||
}),
|
||||
last_email_at: z.string().optional(),
|
||||
last_feed_created_at: z.string().optional(),
|
||||
first_seen: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user