import type { MavenRepository } from "../maven/repository.js"; import type { UpgradeType } from "../version/types.js"; import type { ScanResult, DepSource, DepUsage } from "../dependencies/scan.js"; export interface AuditInput { projectPath?: string; includeVulnerabilities?: boolean; productionOnly?: boolean; } export interface AuditDependency { groupId: string; artifactId: string; currentVersion?: string; latestVersion?: string; upgradeType?: UpgradeType; vulnerabilities?: { id: string; severity?: string; fixedVersion?: string; }[]; /** * Discriminated union identifying where this dependency originates. * Consumers should use this instead of inferring source from module/configuration. */ source: DepSource; /** * All module:configuration pairs that use this dependency. * For catalog entries, may be empty (unused catalog entry — still audited for version/CVE). * For non-catalog entries, always has exactly one element. * When productionOnly is true and the entry has mixed prod+test usages, all usages are * retained in this array — filtering only controls inclusion, not which usages are shown. */ usages: DepUsage[]; /** * @deprecated Legacy field. Use usages[0]?.module instead. * Submodule label from the first usage: ":foo" / ":foo:bar" for Gradle, * "foo" / "foo/sub" for Maven, undefined for root. Two formats differ by design * (Gradle paths are colon-separated); consumers must handle both shapes. */ module?: string; /** * @deprecated Legacy field. Use usages[0]?.configuration instead. * Configuration name from the first usage. */ configuration?: string; } export interface AuditResult { buildSystem: ScanResult["buildSystem"]; dependencies: AuditDependency[]; summary: { total: number; upgradeable: number; vulnerable: number; major: number; minor: number; patch: number; }; } export declare function auditProjectDependenciesHandler(repos: MavenRepository[], input: AuditInput): Promise;