/** * Version History Service * * Tracks plugin version history for rollback support. * Records installed versions with metadata for restoration. * * @since v1.22.0 */ import type { PluginSourceType } from '../types/index.js'; /** * A single version entry in the history */ export interface PluginVersionEntry { /** The version string */ version: string; /** When this version was installed */ installedAt: string; /** Original JAR filename */ jarFilename: string; /** JAR file size in bytes */ jarSize: number; /** SHA256 hash for verification */ sha256: string; /** Source that provided this version */ source: PluginSourceType; /** Path to backup file containing this version (if available) */ backupPath?: string; } /** * History for a single plugin */ export interface PluginHistory { /** Plugin name (normalized) */ pluginName: string; /** Version entries (newest first) */ entries: PluginVersionEntry[]; } /** * Full version history store */ export interface VersionHistoryStore { /** Schema version for migrations */ version: string; /** Last modification timestamp */ lastUpdated: string; /** Plugin histories by normalized name */ plugins: Record; } /** * Rollback configuration */ export interface RollbackConfig { /** Maximum versions to keep per plugin */ maxVersionsPerPlugin: number; /** Maximum days to keep backup files */ maxBackupAgeDays: number; /** Maximum total backup storage in bytes */ maxBackupSizeBytes: number; } /** * Default rollback configuration */ export declare const DEFAULT_ROLLBACK_CONFIG: RollbackConfig; /** * Version History Service * * Manages plugin version history for rollback support. */ export declare class VersionHistoryService { private store; private storagePath; private loaded; private config; constructor(storagePath?: string, config?: Partial); private createEmptyStore; load(): Promise; save(): Promise; recordInstall(pluginName: string, entry: Omit): Promise; getHistory(pluginName: string): PluginVersionEntry[]; getVersion(pluginName: string, version: string): PluginVersionEntry | null; getPreviousVersion(pluginName: string, currentVersion: string): PluginVersionEntry | null; getPluginsWithHistory(): string[]; getRollbackOptions(pluginName: string, currentVersion?: string): PluginVersionEntry[]; hasRollbackAvailable(pluginName: string, currentVersion?: string): boolean; removePlugin(pluginName: string): Promise; removeVersion(pluginName: string, version: string): Promise; updateBackupPath(pluginName: string, version: string, backupPath: string): Promise; clear(): Promise; getPluginCount(): number; getTotalVersionCount(): number; getLastUpdated(): Date | null; } export declare function getVersionHistoryService(): VersionHistoryService; export declare function resetVersionHistoryService(): void; //# sourceMappingURL=version-history.d.ts.map