Add type for getGeoChecksByMonitorId
This commit is contained in:
1 parent
1285a641e8
commit
bfbb4c390a
2 files changed
+13
-3
No files matched your search
@@ -7,6 +7,7 @@ import type {
|
|||||||
HardwareDetailsResult,
|
HardwareDetailsResult,
|
||||||
PageSpeedDetailsResult,
|
PageSpeedDetailsResult,
|
||||||
GamesMap,
|
GamesMap,
|
||||||
|
GroupedGeoCheckResult,
|
||||||
} from "@/types/monitor.js";
|
} from "@/types/monitor.js";
|
||||||
import { supportsGeoCheck } from "@/types/monitor.js";
|
import { supportsGeoCheck } from "@/types/monitor.js";
|
||||||
import type { GeoContinent } from "@/types/geoCheck.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<UptimeDetailsResult>;
|
getUptimeDetailsById(args: { teamId: string; monitorId: string; dateRange: string; normalize?: boolean }): Promise<UptimeDetailsResult>;
|
||||||
getHardwareDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise<HardwareDetailsResult>;
|
getHardwareDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise<HardwareDetailsResult>;
|
||||||
getPageSpeedDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise<PageSpeedDetailsResult>;
|
getPageSpeedDetailsById(args: { teamId: string; monitorId: string; dateRange: string }): Promise<PageSpeedDetailsResult>;
|
||||||
getGeoChecksByMonitorId(args: { teamId: string; monitorId: string; dateRange: string; continents?: GeoContinent[] }): Promise<any>;
|
getGeoChecksByMonitorId(args: {
|
||||||
|
teamId: string;
|
||||||
|
monitorId: string;
|
||||||
|
dateRange: string;
|
||||||
|
continents?: GeoContinent[];
|
||||||
|
}): Promise<GroupedGeoCheckResult>;
|
||||||
getMonitorById(args: { teamId: string; monitorId: string }): Promise<Monitor>;
|
getMonitorById(args: { teamId: string; monitorId: string }): Promise<Monitor>;
|
||||||
getMonitorsByTeamId(args: {
|
getMonitorsByTeamId(args: {
|
||||||
teamId: string;
|
teamId: string;
|
||||||
@@ -327,7 +333,7 @@ export class MonitorService implements IMonitorService {
|
|||||||
monitorId: string;
|
monitorId: string;
|
||||||
dateRange: string;
|
dateRange: string;
|
||||||
continents?: GeoContinent[];
|
continents?: GeoContinent[];
|
||||||
}): Promise<any> => {
|
}): Promise<GroupedGeoCheckResult> => {
|
||||||
const monitor = await this.monitorsRepository.findById(monitorId, teamId);
|
const monitor = await this.monitorsRepository.findById(monitorId, teamId);
|
||||||
if (!monitor) {
|
if (!monitor) {
|
||||||
throw new AppError({ message: `Monitor with ID ${monitorId} not found.`, status: 404 });
|
throw new AppError({ message: `Monitor with ID ${monitorId} not found.`, status: 404 });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { CheckSnapshot } from "@/types/check.js";
|
import type { CheckSnapshot } from "@/types/check.js";
|
||||||
export 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 type { GeoContinent } from "@/types/geoCheck.js";
|
||||||
|
|
||||||
export const MonitorTypes = ["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "unknown"] as const;
|
export const MonitorTypes = ["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "unknown"] as const;
|
||||||
@@ -74,6 +74,10 @@ export interface MonitorsWithChecksByTeamIdResult {
|
|||||||
monitors: Monitor[];
|
monitors: Monitor[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GroupedGeoCheckResult {
|
||||||
|
groupedGeoChecks: GroupedGeoCheck[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface UptimeDetailsResult {
|
export interface UptimeDetailsResult {
|
||||||
monitorData: {
|
monitorData: {
|
||||||
monitor: Monitor;
|
monitor: Monitor;
|
||||||
|
|||||||
Reference in new issue
Block a user