UNPKG

cdk-insights

Version:

AWS CDK security and cost analysis tool with AI-powered insights

30 lines (29 loc) 1.02 kB
import type { AxiosInstance } from 'axios'; import type { Issue, SingleResourceAnalysis } from '../../types/analysis.types'; export interface PollJobStatusResponseCompleted { status: 'completed'; /** Raw JSON string or already-parsed analysis result */ result: string | SingleResourceAnalysis; error?: never; } export interface PollJobStatusResponseFailed { status: 'failed'; error: string; result?: never; } export interface PollJobStatusResponseProcessing { status: 'processing'; result?: never; error?: never; } /** Discriminated union of all job-status responses */ export type PollJobStatusResponse = PollJobStatusResponseCompleted | PollJobStatusResponseFailed | PollJobStatusResponseProcessing; export type AxiosClient = Pick<AxiosInstance, 'get'>; export interface ParsedAnalysisResult { resourceId: string; issues: Issue[]; } export interface JsonParserParams { jsonString: string; } export type JsonParser = (params: JsonParserParams) => ParsedAnalysisResult;