incidents repo and data reversal

This commit is contained in:
Alex Holliday committed 2026-01-06 20:49:06 +00:00
1 parent 605b4713af
commit 51081a6a0e
32 files changed
+537 -241

No files matched your search

+28 -20
View File
@@ -1,4 +1,4 @@
import type { MonitorType } from "./monitor";
import type { MonitorType, MonitorStatus } from "./monitor";
export interface CheckTimingPhases {
wait: number;
@@ -11,7 +11,7 @@ export interface CheckTimingPhases {
total: number;
}
export interface CheckTimings {
export interface GotTimings {
start: string;
socket: string;
lookup: string;
@@ -103,6 +103,12 @@ export interface INetInfo {
fifo_in: number;
fifo_out: number;
}
export interface ICaptureInfo {
version?: string;
mode?: string;
}
export interface ICheck {
_id: string;
metadata: {
@@ -119,33 +125,35 @@ export interface ICheck {
expiry: string;
createdAt: string;
updatedAt: string;
timings: CheckTimings;
timings: GotTimings;
lighthouse?: ICheckLighthouseFields;
system?: ISystemInfo;
// Present for docker monitor checks
dockerContainers?: IDockerContainerSummary[];
}
export interface CheckWithMonitor {
_id: string;
metadata: {
monitorId: {
_id: string;
name: string;
};
type: string;
teamId: string;
};
status: string;
export interface Check {
id: string;
monitorId: string;
teamId: string;
type: MonitorType;
status: MonitorStatus;
httpStatusCode?: number;
message: string;
responseTime: number;
normalResponseTime?: number;
httpStatusCode: number;
ack: boolean;
expiry: string;
responseTime?: number;
timings?: GotTimings;
errorMessage?: string;
ackAt?: string;
ackBy?: string;
system?: ISystemInfo;
capture?: ICaptureInfo;
lighthouse?: ICheckLighthouseFields;
dockerContainers?: IDockerContainerSummary[];
createdAt: string;
updatedAt: string;
timings: CheckTimings;
expiry: string;
}
export interface AggregateCheck {
bucketDate: string;
+21 -9
View File
@@ -1,16 +1,28 @@
import type { IMongoUser } from "@/types/user";
import type { IMonitor } from "@/types/monitor";
export interface IIncident {
_id: string;
monitorId: IMonitor;
export const ResolutionTypes = ["auto", "manual"] as const;
export type ResolutionType = (typeof ResolutionTypes)[number];
import type { MonitorType, MonitorStatus } from "@/types/monitor";
export interface Incident {
id: string;
monitorId: string;
teamId: string;
startedAt: string;
startCheck: string;
resolved: boolean;
endedAt?: string;
endCheck?: string;
resolvedBy?: IMongoUser;
resolutionType?: string;
resolved: boolean;
resolvedBy?: string;
resolutionType?: ResolutionType;
resolutionNote?: string;
}
export interface IncidentWithDetails extends Incident {
monitor: {
id: string;
name: string;
type: MonitorType;
status: MonitorStatus;
};
resolvedByUser?: {
email: string;
};
}