UNPKG

@re-shell/cli

Version:

Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja

94 lines (93 loc) 2.99 kB
export type DiffOperation = 'add' | 'remove' | 'change' | 'move' | 'no-change'; export interface DiffEntry { operation: DiffOperation; path: string; oldValue?: any; newValue?: any; type?: string; description?: string; severity?: 'low' | 'medium' | 'high' | 'critical'; category?: 'structure' | 'value' | 'type' | 'metadata'; } export interface ConfigDiff { summary: { total: number; added: number; removed: number; changed: number; moved: number; unchanged: number; }; changes: DiffEntry[]; metadata: { comparedAt: string; leftSource: string; rightSource: string; algorithm: string; }; } export interface MergeStrategy { arrayMerge: 'replace' | 'concat' | 'union' | 'intersect' | 'custom'; conflictResolution: 'left' | 'right' | 'interactive' | 'custom'; preserveComments: boolean; preserveOrder: boolean; customResolver?: (left: any, right: any, path: string) => any; } export interface MergeResult { merged: any; conflicts: ConflictEntry[]; warnings: string[]; metadata: { mergedAt: string; strategy: MergeStrategy; leftSource: string; rightSource: string; }; } export interface ConflictEntry { path: string; leftValue: any; rightValue: any; resolution: 'left' | 'right' | 'custom' | 'unresolved'; resolvedValue?: any; reason: string; } export declare class ConfigDiffer { private readonly options; constructor(options?: { ignoreOrder?: boolean; ignorePaths?: string[]; includeMetadata?: boolean; deepComparison?: boolean; }); diff(left: any, right: any, leftSource?: string, rightSource?: string): Promise<ConfigDiff>; diffFiles(leftPath: string, rightPath: string): Promise<ConfigDiff>; merge(left: any, right: any, strategy: MergeStrategy, leftSource?: string, rightSource?: string): Promise<MergeResult>; mergeFiles(leftPath: string, rightPath: string, outputPath: string, strategy: MergeStrategy): Promise<MergeResult>; applyDiff(base: any, diff: ConfigDiff): Promise<any>; generateDiffReport(diff: ConfigDiff, format?: 'text' | 'html' | 'json'): string; private deepDiff; private diffObjects; private diffArrays; private diffArraysIgnoreOrder; private diffArraysWithOrder; private deepMerge; private mergeObjects; private mergeArrays; private getValueType; private formatValue; private getSeverityForPath; private calculateSummary; private setValueAtPath; private removeValueAtPath; private generateTextReport; private generateHtmlReport; } export declare const MergeStrategies: { leftWins: () => MergeStrategy; rightWins: () => MergeStrategy; smartMerge: () => MergeStrategy; conservative: () => MergeStrategy; interactive: () => MergeStrategy; }; export declare const configDiffer: ConfigDiffer;