Skip to content
← Public packages

@kentcdodds/friction-log

Qualify and file friction papercuts to GitHub (any owner/repo) or wake Patch for Kody packages; daily sweep of kody-hq/kody friction issues.

FollowFork

src/status.ts

20 lines · 463 B · TypeScript
Raw
import { denverDayKey } from './shared.ts'
import {
	getSweep,
	isEnabled,
	listRecentOutcomes,
	listRecentSweeps,
} from './storage.ts'

/** Operator snapshot: kill switch, today's sweep, recent outcomes. */
export default async function status() {
	const day = denverDayKey()
	return {
		ok: true,
		day,
		enabled: await isEnabled(),
		today: await getSweep(day),
		recentSweeps: await listRecentSweeps(7),
		recentOutcomes: await listRecentOutcomes(10),
	}
}