backend implementation

This commit is contained in:
Alex Holliday committed 2025-12-29 19:52:22 +00:00
1 parent a250bf38aa
commit 378a40ce84
16 files changed
+777 -728

No files matched your search

@@ -15,6 +15,8 @@ import ApiError from "@/utils/ApiError.js";
import { config } from "@/config/index.js";
import CacheableLookup from "cacheable-lookup";
import { getChildLogger } from "@/logger/Logger.js";
import type { IDockerContainerSummary } from "@/db/models/index.js";
const SERVICE_NAME = "NetworkService";
const logger = getChildLogger(SERVICE_NAME);
export interface INetworkService {
@@ -35,6 +37,11 @@ export interface ILighthousePayload {
lighthouseResult: ILighthouseResult;
}
export interface IDockerPayload {
data: IDockerContainerSummary[];
capture: ICaptureInfo;
}
export interface StatusResponse<TPayload = unknown> {
monitorId: string;
teamId: string;
@@ -359,6 +366,11 @@ class NetworkService implements INetworkService {
return await this.requestHttp(monitor); // uses GOT
case "infrastructure":
return await this.requestInfrastructure(monitor); // uses GOT
case "docker":
// For now, docker monitors reuse the infrastructure capture protocol
// (same capture agent and auth flow). This lets us ship server support
// quickly; specialized parsing will be added in CheckService.
return await this.requestInfrastructure(monitor);
case "pagespeed":
return await this.requestPagespeed(monitor); // uses GOT
case "ping":