huskies: merge 771
This commit is contained in:
@@ -134,9 +134,22 @@ export const gatewayApi = {
|
||||
});
|
||||
},
|
||||
|
||||
/// Fetch pipeline status from all registered projects.
|
||||
getAllProjectsPipeline(): Promise<AllProjectsPipeline> {
|
||||
return gatewayRequest<AllProjectsPipeline>("/api/gateway/pipeline");
|
||||
/// Fetch pipeline status from all registered projects via the pipeline.get read-RPC.
|
||||
async getAllProjectsPipeline(): Promise<AllProjectsPipeline> {
|
||||
const res = await fetch("/mcp", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "pipeline.get", params: {} }),
|
||||
});
|
||||
if (!res.ok) {
|
||||
const text = await res.text();
|
||||
throw new Error(text || `Request failed (${res.status})`);
|
||||
}
|
||||
const rpc = await res.json() as { result?: AllProjectsPipeline; error?: { message: string } };
|
||||
if (rpc.error) {
|
||||
throw new Error(rpc.error.message);
|
||||
}
|
||||
return rpc.result!;
|
||||
},
|
||||
|
||||
/// Switch the active project.
|
||||
|
||||
Reference in New Issue
Block a user