cdk-insights
Version:
AWS CDK security and cost analysis tool with AI-powered insights
76 lines (75 loc) • 2.81 kB
TypeScript
export interface AnalysisStep {
title: string;
task: () => Promise<any> | any;
skip?: () => boolean | string;
enabled?: boolean;
}
export interface AnalysisProgress {
title: string;
steps: AnalysisStep[];
showSummary?: boolean;
concurrent?: boolean;
}
export declare class AnalysisProgressHandler {
private static instance;
static getInstance(): AnalysisProgressHandler;
runAnalysis(progress: AnalysisProgress): Promise<any[]>;
createResourceProgressBar(total: number, title?: string): {
update: (increment?: number) => void;
complete: () => void;
};
createSingleLineProgressTracker(totalResources: number, title?: string): {
startJob: (jobId: string, resourceId: string) => void;
clearCurrentLine: () => void;
cleanup: () => void;
updateJobStatus: (jobId: string, resourceId: string, status: string, attempt: number) => void;
completeJob: (jobId: string, resourceId: string) => void;
failJob: (jobId: string, resourceId: string, error: string) => void;
timeoutJob: (jobId: string, resourceId: string) => void;
getStats: () => {
completed: number;
active: number;
failed: number;
timedOut: number;
total: number;
percentage: string;
elapsed: number;
eta: string;
};
getResourceStatus: (resourceId: string) => {
startTime: number;
completionTime?: number;
resourceType: string;
status: "active" | "completed" | "failed" | "timedOut";
} | undefined;
getAllResourceStatuses: () => Map<string, {
startTime: number;
completionTime?: number;
resourceType: string;
status: "active" | "completed" | "failed" | "timedOut";
}>;
showSummary: () => void;
};
createSpinner(message: string): {
stop: (finalMessage?: string) => void;
fail: (errorMessage?: string) => void;
warn: (warningMessage?: string) => void;
info: (infoMessage?: string) => void;
};
private showSummary;
header(message: string): void;
section(title: string, emoji?: string): void;
success(message: string, emoji?: string): void;
info(message: string, emoji?: string): void;
warning(message: string, emoji?: string): void;
error(message: string, emoji?: string): void;
comment(message: string, emoji?: string): void;
phase1(message: string): void;
phase2(message: string): void;
phase3(message: string): void;
severityBadge(severity: string): string;
divider(): void;
newline(): void;
clearLine(): void;
}
export declare const analysisProgress: AnalysisProgressHandler;