From bfbb4c390ad6f27a590effad1309fc6d1b3f4b83 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Mar 2026 09:47:02 -0700 Subject: [PATCH] Add type for getGeoChecksByMonitorId --- server/src/service/business/monitorService.ts | 10 ++++++++-- server/src/types/monitor.ts | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/server/src/service/business/monitorService.ts b/server/src/service/business/monitorService.ts index 936044908..678e5de37 100644 --- a/server/src/service/business/monitorService.ts +++ b/server/src/service/business/monitorService.ts @@ -7,6 +7,7 @@ import type { HardwareDetailsResult, PageSpeedDetailsResult, GamesMap, + GroupedGeoCheckResult, } from "@/types/monitor.js"; import { supportsGeoCheck } from "@/types/monitor.js"; import type { GeoContinent } from "@/types/geoCheck.js"; @@ -37,7 +38,12 @@ export interface IMonitorService { getUptimeDetailsById(args: { teamId: string; monitorId: string; dateRange: string; normalize?: boolean }): Promise; getHardwareDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise; getPageSpeedDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise; - getGeoChecksByMonitorId(args: { teamId: string; monitorId: string; dateRange: string; continents?: GeoContinent[] }): Promise; + getGeoChecksByMonitorId(args: { + teamId: string; + monitorId: string; + dateRange: string; + continents?: GeoContinent[]; + }): Promise; getMonitorById(args: { teamId: string; monitorId: string }): Promise; getMonitorsByTeamId(args: { teamId: string; @@ -327,7 +333,7 @@ export class MonitorService implements IMonitorService { monitorId: string; dateRange: string; continents?: GeoContinent[]; - }): Promise => { + }): Promise => { const monitor = await this.monitorsRepository.findById(monitorId, teamId); if (!monitor) { throw new AppError({ message: `Monitor with ID ${monitorId} not found.`, status: 404 }); diff --git a/server/src/types/monitor.ts b/server/src/types/monitor.ts index bac2313f5..f29ce75d7 100644 --- a/server/src/types/monitor.ts +++ b/server/src/types/monitor.ts @@ -1,6 +1,6 @@ import type { CheckSnapshot } from "@/types/check.js"; export type { CheckSnapshot } from "@/types/check.js"; -import type { GeoContinent } from "@/types/geoCheck.js"; +import type { GeoContinent, GroupedGeoCheck } from "@/types/geoCheck.js"; export type { GeoContinent } from "@/types/geoCheck.js"; export const MonitorTypes = ["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "unknown"] as const; @@ -74,6 +74,10 @@ export interface MonitorsWithChecksByTeamIdResult { monitors: Monitor[]; } +export interface GroupedGeoCheckResult { + groupedGeoChecks: GroupedGeoCheck[]; +} + export interface UptimeDetailsResult { monitorData: { monitor: Monitor;