trojanhorse-js
Version:
A comprehensive JavaScript library for fetching, managing, and analyzing global threat intelligence from multiple open-source feeds and security news sources. Unlike its mythological namesake, this Trojan protects your digital fortress.
46 lines • 1.33 kB
TypeScript
import { ThreatFeedResult } from '../types';
interface VirusTotalConfig {
apiKey: string;
tier?: 'free' | 'premium';
baseUrl?: string;
timeout?: number;
retries?: number;
}
export declare class VirusTotalFeed {
private config;
private vtConfig;
private requestCount;
private lastRequest;
private errorCount;
private cache;
constructor(vtConfig: VirusTotalConfig);
private validateApiKey;
private makeRequest;
private enforceRateLimit;
private wait;
private getCachedResult;
private setCachedResult;
fetchThreatData(): Promise<ThreatFeedResult>;
analyzeHash(hash: string): Promise<ThreatFeedResult>;
analyzeUrl(url: string): Promise<ThreatFeedResult>;
analyzeDomain(domain: string): Promise<ThreatFeedResult>;
private submitUrl;
private parseFileResponse;
private parseUrlResponse;
private parseDomainResponse;
private extractTags;
private extractUrlTags;
private extractDomainTags;
getStats(): {
requestCount: number;
errorCount: number;
lastRequest: Date | null;
cacheSize: number;
cacheHitRatio: number;
rateLimit: any;
};
updateConfig(updates: Partial<VirusTotalConfig>): void;
clearCache(): void;
}
export {};
//# sourceMappingURL=VirusTotal.d.ts.map