cdk-insights
Version:
AWS CDK security and cost analysis tool with AI-powered insights
44 lines (43 loc) • 1.63 kB
TypeScript
import type { Issue } from '../../types/analysis.types';
export interface SourceLocationAnalysis {
filePath: string;
line: number;
column: number;
confidence: 'high' | 'medium' | 'low';
context?: {
surroundingCode?: string[];
property?: string;
value?: string;
expected?: string;
constructName?: string;
stackName?: string;
};
stackTrace?: string[];
}
export interface EnhancedIssue extends Issue {
sourceLocation?: SourceLocationAnalysis;
}
/**
* Analyzes source location for a CDK resource and provides context
*/
export declare const analyzeSourceLocation: (logicalId: string, issue: Issue) => SourceLocationAnalysis | null;
/**
* Enhances an issue with source location information
*/
export declare const enhanceIssueWithSourceLocation: (logicalId: string, issue: Issue) => EnhancedIssue;
/**
* Batch enhances multiple issues with source location information
*/
export declare const enhanceIssuesWithSourceLocation: (logicalId: string, issues: Issue[]) => EnhancedIssue[];
/**
* Creates a clickable link for the source location (for terminals that support it)
*/
export declare const createSourceLocationLink: (sourceLocation: SourceLocationAnalysis) => string;
/**
* Formats source location for display
*/
export declare const formatSourceLocation: (sourceLocation: SourceLocationAnalysis, includeContext?: boolean) => string;
/**
* Creates a GitHub-compatible link for the source location
*/
export declare const createGitHubLink: (sourceLocation: SourceLocationAnalysis, repositoryUrl?: string, branch?: string) => string | null;