ts errors

This commit is contained in:
Alex Holliday committed 2026-01-05 23:50:34 +00:00
1 parent 81d6c4651f
commit 605b4713af
6 files changed
+39 -154

No files matched your search

+6 -123
View File
@@ -4,120 +4,14 @@ import {
MonitorTypes,
MonitorStatus,
MonitorStatuses,
ISystemInfo,
ICaptureInfo,
ICheckLighthouseFields,
IDockerContainerHealth,
IDockerExposedPort,
} from "@/types/domain/index.js";
import type { Response } from "got";
export type GotTimings = Response["timings"];
export interface ITimingPhases {
wait: number;
dns: number;
tcp: number;
tls: number;
request: number;
firstByte: number;
download: number;
total: number;
}
export interface ICpuInfo {
physical_core: number;
logical_core: number;
frequency: number;
current_frequency: number;
temperature: number[]; // per-core temps
free_percent: number;
usage_percent: number;
}
export interface IMemoryInfo {
total_bytes: number;
available_bytes: number;
used_bytes: number;
usage_percent: number;
}
export interface IHostInfo {
os?: string;
platform?: string;
kernel_version?: string;
pretty_name?: string;
}
export interface IDiskInfo {
device: string;
total_bytes: number;
free_bytes: number;
used_bytes: number;
usage_percent: number;
total_inodes?: number;
free_inodes?: number;
used_inodes?: number;
inodes_usage_percent?: number;
read_bytes?: number;
write_bytes?: number;
read_time?: number;
write_time?: number;
}
export interface INetInfo {
name: string;
bytes_sent: number;
bytes_recv: number;
packets_sent: number;
packets_recv: number;
err_in: number;
err_out: number;
drop_in: number;
drop_out: number;
fifo_in: number;
fifo_out: number;
}
export interface ICaptureInfo {
version?: string;
mode?: string;
}
export interface ISystemInfo {
cpu: ICpuInfo;
memory: IMemoryInfo;
disk: IDiskInfo[];
host: IHostInfo;
net: INetInfo[];
}
export interface ILighthouseAudit {
id?: string;
title?: string;
score?: number | null;
displayValue?: string;
numericValue?: number;
numericUnit?: string;
}
export interface ILighthouseCategories {
accessibility?: { score?: number | null };
"best-practices"?: { score?: number | null };
seo?: { score?: number | null };
performance?: { score?: number | null };
}
export interface ILighthouseResult {
categories?: ILighthouseCategories;
audits?: Record<string, ILighthouseAudit>;
}
export interface ICheckLighthouseFields {
accessibility: number;
bestPractices: number;
seo: number;
performance: number;
audits: {
cls: ILighthouseAudit;
si: ILighthouseAudit;
fcp: ILighthouseAudit;
lcp: ILighthouseAudit;
tbt: ILighthouseAudit;
};
}
export interface ICheck extends Document {
_id: Types.ObjectId;
@@ -143,18 +37,7 @@ export interface ICheck extends Document {
expiry: Date;
}
export interface IDockerContainerHealth {
healthy: boolean;
source?: string;
message?: string;
}
export interface IDockerExposedPort {
port: string;
protocol: string;
}
export interface IDockerContainerSummary {
interface IDockerContainerSummary {
container_id: string;
container_name: string;
status: string;
+1 -8
View File
@@ -1,12 +1,5 @@
export { Check } from "./checks/Check.js";
export type {
ICheck,
ISystemInfo,
ICaptureInfo,
ILighthouseResult,
IDockerContainerSummary,
} from "./checks/Check.js";
export type { ICheck } from "./checks/Check.js";
export { Monitor } from "./monitors/Monitor.js";
export type { IMonitor } from "./monitors/Monitor.js";
+1 -1
View File
@@ -1,5 +1,5 @@
import mongoose, { Schema, Document, Types } from "mongoose";
import type { IDockerContainerSummary } from "@/db/models/checks/Check.js";
import type { IDockerContainerSummary } from "@/types/domain/index.js";
import {
Check,
Incident,