forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

postInsightRunReport.ts26 lines, 1018 bytesHistoryRawDownload
1import { client } from "../client";
2import { insightRunReportPath } from "./insightRunReportUrl";
3
4/**
5 * The receipt for the school report the service just wrote: the day it covers,
6 * its size in bytes, whether the service had to truncate it, the service's own
7 * notes, and when it was stored (ms epoch, the same clock as the run ledger).
8 */
9export type GeneratedInsightRunReport = {
10 run_day: string;
11 byte_size: number;
12 truncated: boolean;
13 notes: string[];
14 generated_at: number;
15};
16
17/**
18 * Generate the school-level report document for one run day. Manager+ only,
19 * and synchronous: the service writes it before this answers. `503` when no AI
20 * service offers the report right now; `409` (`report_refused`) when the
21 * service refused — nothing is stored then, so `getInsightRunReport` would
22 * find nothing.
23 */
24export function postInsightRunReport(runDay: string): Promise<GeneratedInsightRunReport> {
25 return client<GeneratedInsightRunReport>(insightRunReportPath(runDay), { method: "POST" });
26}