forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

postInsightsRefresh.ts26 lines, 934 bytesHistoryRawDownload
1import { client } from "../client";
2
3/** The receipt for an accepted recompute. Nothing is computed yet. */
4export type AcceptedInsightRun = {
5 message_id: string;
6 status: "pending";
7};
8
9export type PostInsightsRefreshBody = {
10 /**
11 * Student user ids to recompute; omit for the service's own configured list
12 * — the backend does not enumerate a school roster for it.
13 */
14 user_ids?: string[];
15 /** Recompute even where the service considers its cached result valid. */
16 force?: boolean;
17};
18
19/**
20 * 202 — a school-wide batch, queued. The sweep's own record is the run ledger,
21 * so poll `getInsightRuns` to watch a run move from `running` to its verdict.
22 * Manager+ only, and 503 when no service offers `insight.refresh`.
23 */
24export function postInsightsRefresh(body: PostInsightsRefreshBody = {}): Promise<AcceptedInsightRun> {
25 return client<AcceptedInsightRun>("/insights/refresh", { method: "POST", body });
26}