TypeScript Zod schemas for validating metrics API query parameters.
// Source: https://github.com/BradGroux/veritas-kanban | License: MIT | Copyright 2026 Digital Meld
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';
import { MetricsPeriodSchema } from './common.js';
/**
* GET /api/metrics/* query params
*/
export const MetricsQuerySchema = z.object({
period: MetricsPeriodSchema.default('7d'),
project: z.string().optional(),
from: z.string().optional(), // ISO date string for custom period start
to: z.string().optional(), // ISO date string for custom period end
tz: z.coerce.number().min(-12).max(14).optional(), // UTC offset in hours (e.g. -6 for CST, 9 for JST). Defaults to server time.
});
/**
* GET /api/metrics/tasks - query params
*/
export const TaskMetricsQuerySchema = z.object({
project: z.
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key