Massive update

This commit is contained in:
Logan
2026-04-11 13:44:08 -04:00
parent fd6c2fd8bf
commit 3b3a136d04
31 changed files with 1919 additions and 94 deletions
+34
View File
@@ -55,4 +55,38 @@ export const c2api = {
const qs = params ? "?" + new URLSearchParams(params).toString() : "";
return request<unknown[]>(`/calls${qs}`);
},
// Incidents
getIncidents: (params?: { status?: string; type?: string }) => {
const qs = params ? "?" + new URLSearchParams(params as Record<string, string>).toString() : "";
return request<unknown[]>(`/incidents${qs}`);
},
getIncident: (id: string) => request<unknown>(`/incidents/${id}`),
createIncident: (body: object) =>
request("/incidents", { method: "POST", body: JSON.stringify(body) }),
updateIncident: (id: string, body: object) =>
request(`/incidents/${id}`, { method: "PUT", body: JSON.stringify(body) }),
deleteIncident: (id: string) =>
request(`/incidents/${id}`, { method: "DELETE" }),
linkCallToIncident: (incidentId: string, callId: string) =>
request(`/incidents/${incidentId}/calls/${callId}`, { method: "POST" }),
// Alerts
getAlerts: (acknowledged?: boolean) => {
const qs = acknowledged !== undefined ? `?acknowledged=${acknowledged}` : "";
return request<unknown[]>(`/alerts${qs}`);
},
acknowledgeAlert: (id: string) =>
request(`/alerts/${id}/acknowledge`, { method: "POST" }),
getAlertRules: () => request<unknown[]>("/alert-rules"),
createAlertRule: (body: object) =>
request("/alert-rules", { method: "POST", body: JSON.stringify(body) }),
updateAlertRule: (id: string, body: object) =>
request(`/alert-rules/${id}`, { method: "PUT", body: JSON.stringify(body) }),
deleteAlertRule: (id: string) =>
request(`/alert-rules/${id}`, { method: "DELETE" }),
// Node key management
reissueNodeKey: (nodeId: string) =>
request(`/nodes/${nodeId}/reissue-key`, { method: "POST" }),
};