@bobmatnyc/ai-code-review
Version:
A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter
40 lines (39 loc) • 1.42 kB
TypeScript
/**
* @fileoverview Mock implementation of SerpAPI helper for testing
*
* This module provides mock responses for known vulnerable packages
* to test the tool calling functionality without real API calls.
*/
import { PackageInfo } from './packageAnalyzer';
export interface DependencySecurityInfo {
packageName: string;
packageVersion?: string;
vulnerabilities: {
description: string;
severity: 'critical' | 'high' | 'medium' | 'low' | 'unknown';
affectedVersions?: string;
fixedVersions?: string;
url?: string;
}[];
recommendedVersion?: string;
deprecationInfo?: string;
packageHealth?: {
lastUpdated?: string;
status?: 'active' | 'maintained' | 'deprecated' | 'abandoned' | 'unknown';
stars?: number;
popularity?: string;
};
sources: string[];
}
/**
* Always returns true for testing
*/
export declare function hasSerpApiConfig(): boolean;
/**
* Mock implementation that returns predefined data for known packages
*/
export declare function searchPackageSecurity(packageInfo: PackageInfo, _ecosystem: 'npm' | 'composer' | 'pip' | 'gem'): Promise<DependencySecurityInfo | null>;
/**
* Mock implementation of batch search
*/
export declare function batchSearchPackageSecurity(packages: PackageInfo[], ecosystem: 'npm' | 'composer' | 'pip' | 'gem', limit?: number): Promise<DependencySecurityInfo[]>;