Massive update
This commit is contained in:
@@ -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" }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user