mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
32 lines
951 B
TypeScript
32 lines
951 B
TypeScript
import api from "./client";
|
|||
|
|
|
||
|
|
// ---------------------------------------------------------------------------
|
||
|
|
// Board Programs — the generic registry (roadmap, x_feature today) the CEO
|
||
|
|
// monitors and can run off-schedule. See roboco/api/routes/board_programs.py.
|
||
|
|
// ---------------------------------------------------------------------------
|
||
|
|
|
||
|
|
export interface BoardProgram {
|
||
|
|
key: string;
|
||
|
|
role: string;
|
||
|
|
trigger: string;
|
||
|
|
scope: string;
|
||
|
|
enabled: boolean;
|
||
|
|
opted_in_project_slugs: string[];
|
||
|
|
last_opened_at: string | null;
|
||
|
|
open_cycle: boolean;
|
||
|
|
last_cycle_summary: string | null;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const boardProgramsApi = {
|
||
|
|
list: async (): Promise<BoardProgram[]> => {
|
||
|
|
const { data } = await api.get<BoardProgram[]>("/board-programs");
|
||
|
|
return data;
|
||
|
|
},
|
||
|
|
runNow: async (key: string): Promise<BoardProgram> => {
|
||
|
|
const { data } = await api.post<BoardProgram>(
|
||
|
|
`/board-programs/${key}/run-now`,
|
||
|
|
);
|
||
|
|
return data;
|
||
|
|
},
|
||
|
|
};
|