import { RestResource } from './rest-resource.js'; export interface CheckResult { id: string; checkId: string; name: string; hasFailures: boolean; hasErrors: boolean; isDegraded: boolean | null; overMaxResponseTime: boolean | null; runLocation: string; startedAt: string; stoppedAt: string; created_at: string; responseTime: number; checkRunId: number; attempts: number; resultType: 'FINAL' | 'ATTEMPT'; sequenceId?: string | null; errorGroupIds?: string[] | null; apiCheckResult?: ApiCheckResult | null; browserCheckResult?: BrowserCheckResult | null; multiStepCheckResult?: MultiStepCheckResult | null; tracerouteCheckResult?: TracerouteCheckResult | null; grpcCheckResult?: GrpcCheckResult | null; sslCheckResult?: SslCheckResult | null; } export interface ApiCheckAssertion { source: string; comparison: string; target: string | number; property?: string; } export interface ApiCheckResult { assertions: ApiCheckAssertion[] | null; request: { method: string; url: string; data: string; headers: Record; params: Record; }; response: { status: number; statusText: string; body: string; headers: Record | null; timings: { socket: number; lookup: number; connect: number; response: number; end: number; } | null; timingPhases: { wait: number; dns: number; tcp: number; firstByte: number; download: number; total: number; } | null; }; requestError: string | null; jobLog: unknown | null; jobAssets: string[] | null; pcapDataUrl: string | null; } export interface WebVitalEntry { score: 'GOOD' | 'NEEDS_IMPROVEMENT' | 'POOR'; value: number; } export interface BrowserCheckResult { type: string; traceSummary: { consoleErrors: number; networkErrors: number; documentErrors: number; userScriptErrors: number; }; errors: string[]; pages: Array<{ url: string; webVitals: { CLS?: WebVitalEntry; FCP?: WebVitalEntry; LCP?: WebVitalEntry; TBT?: WebVitalEntry; TTFB?: WebVitalEntry; }; }>; startTime: number; endTime: number; runtimeVersion: string; jobLog: Array<{ time: number; msg: string; level: string; }> | null; jobAssets: string[] | null; playwrightTestVideos?: string[]; playwrightTestTraces?: string[]; playwrightTestJsonReportFile?: string; } export interface MultiStepCheckResult { errors: string[]; startTime: number; endTime: number; runtimeVersion: string; jobLog: Array<{ time: number; msg: string; level: string; }> | null; jobAssets: string[] | null; playwrightTestTraces?: string[]; playwrightTestJsonReportFile?: string; } export interface TracerouteCheckResult { totalHops?: number | null; destinationReached?: boolean | null; finalHopLatency?: Record | null; timingPhases?: Record | null; requestError?: string | null; request?: Record | null; assertions?: Array> | null; response?: { hostname?: string | null; resolvedIp?: string | null; totalHops?: number | null; destinationReached?: boolean | null; truncationReason?: string | null; finalHopLatency?: Record | null; hops?: Array> | null; protocol?: string | null; probeProtocol?: string | null; } | null; } export interface GrpcCheckResult { grpcStatusCode?: number | null; healthStatus?: number | null; timingPhases?: Record | null; requestError?: string | null; request?: Record | null; assertions?: Array> | null; response?: { grpcMode?: string | null; host?: string | null; resolvedIp?: string | null; port?: number | null; grpcMethod?: string | null; responseMessage?: string | null; grpcStatusCode?: number | null; grpcStatusMessage?: string | null; healthStatus?: number | null; healthStatusLabel?: string | null; metadata?: Array> | null; discoveredMethods?: string[] | null; requestError?: string | null; timingPhases?: Record | null; } | null; } export interface SslCheckResult { tlsVersion?: string | null; cipherSuite?: string | null; daysUntilExpiry?: number | null; handshakeTimeMs?: number | null; chainTrusted?: boolean | null; hostnameVerified?: boolean | null; baselineVerdict?: string | null; baselineGrade?: string | null; failureCategory?: string | null; requestError?: string | null; request?: Record | null; assertions?: Array> | null; response?: { resolvedIp?: string | null; protocol?: string | null; cipherSuite?: string | null; handshakeTimeMs?: number | null; hostnameVerified?: boolean | null; chainTrusted?: boolean | null; daysUntilExpiry?: number | null; ocspStapled?: boolean | null; securityBaseline?: Record | null; certificate?: Record | null; chain?: Array> | null; } | null; } export interface CheckResultsPage { length: number; entries: CheckResult[]; nextId: string | null; } export type CheckResultField = 'id' | 'name' | 'checkId' | 'hasFailures' | 'hasErrors' | 'isDegraded' | 'isCancelled' | 'overMaxResponseTime' | 'runLocation' | 'startedAt' | 'stoppedAt' | 'created_at' | 'createdAt' | 'responseTime' | 'apiCheckResult' | 'browserCheckResult' | 'multiStepCheckResult' | 'tracerouteCheckResult' | 'grpcCheckResult' | 'sslCheckResult' | 'playwrightCheckResult' | 'checkRunId' | 'attempts' | 'resultType' | 'sequenceId' | 'traceId' | 'errorGroupIds'; export interface ListCheckResultsParams { limit?: number; nextId?: string; from?: number; to?: number; hasFailures?: boolean; resultType?: 'FINAL' | 'ATTEMPT' | 'ALL'; fields?: CheckResultField[]; } declare class CheckResults extends RestResource { getAll(checkId: string, params?: ListCheckResultsParams): Promise>; get(checkId: string, checkResultId: string): Promise>; } export default CheckResults;