import { ConfigService } from '@nestjs/config';
import { DataSource } from 'typeorm';
import { EngineFactory } from '../../engine/engine.factory';
import { DockerService } from '../docker';
import { CacheService } from '../../common/cache/cache.service';
import { StorageService } from '../../common/storage/storage.service';
import { ShutdownService } from '../../common/services/shutdown.service';
interface InfraStatus {
    database: {
        connected: boolean;
        type: string;
        host: string;
    };
    redis: {
        enabled: boolean;
        connected: boolean;
        host: string;
        port: number;
    };
    queue: {
        enabled: boolean;
        messages: {
            pending: number;
            completed: number;
            failed: number;
        };
        webhooks: {
            pending: number;
            completed: number;
            failed: number;
        };
    };
    storage: {
        type: 'local' | 's3';
        path?: string;
        bucket?: string;
    };
    engine: {
        type: string;
        headless: boolean;
        sessionDataPath: string;
        browserArgs: string;
    };
}
interface SaveConfigDto {
    database?: {
        type: 'sqlite' | 'postgres';
        builtIn?: boolean;
        host?: string;
        port?: string;
        username?: string;
        password?: string;
        database?: string;
        poolSize?: number;
        sslEnabled?: boolean;
    };
    redis?: {
        enabled?: boolean;
        builtIn?: boolean;
        host?: string;
        port?: string;
        password?: string;
    };
    queue?: {
        enabled?: boolean;
    };
    storage?: {
        type: 'local' | 's3';
        builtIn?: boolean;
        localPath?: string;
        s3Bucket?: string;
        s3Region?: string;
        s3AccessKey?: string;
        s3SecretKey?: string;
        s3Endpoint?: string;
    };
    engine?: {
        headless?: boolean;
        sessionDataPath?: string;
        browserArgs?: string;
    };
}
interface SessionRow {
    id: string;
    name: string;
    status: string;
    phone: string | null;
    pushName: string | null;
    config: string | Record<string, unknown>;
    proxyUrl: string | null;
    proxyType: string | null;
    connectedAt: string | null;
    lastActiveAt: string | null;
    createdAt: string;
    updatedAt: string;
}
interface WebhookRow {
    id: string;
    sessionId: string;
    url: string;
    events: string | string[];
    secret: string | null;
    headers: string | Record<string, string>;
    active: boolean;
    retryCount: number;
    lastTriggeredAt: string | null;
    createdAt: string;
    updatedAt: string;
}
interface MessageRow {
    id: string;
    sessionId: string;
    messageId: string;
    chatId: string;
    direction: string;
    type: string;
    content: string | Record<string, unknown>;
    status: string;
    metadata: string | Record<string, unknown>;
    createdAt: string;
    updatedAt: string;
}
interface MessageBatchRow {
    id: string;
    batchId: string;
    sessionId: string;
    status: string;
    messages: string | unknown[];
    options: string | Record<string, unknown>;
    progress: string | Record<string, unknown>;
    results: string | unknown[];
    currentIndex: number;
    createdAt: string;
    updatedAt: string;
    startedAt: string | null;
    completedAt: string | null;
}
interface MigrationTables {
    sessions: SessionRow[];
    webhooks: WebhookRow[];
    messages: MessageRow[];
    messageBatches: MessageBatchRow[];
}
export declare class InfraController {
    private readonly configService;
    private readonly mainDataSource;
    private readonly dataDataSource;
    private readonly engineFactory;
    private readonly dockerService;
    private readonly cacheService;
    private readonly storageService;
    private readonly shutdownService;
    private readonly logger;
    constructor(configService: ConfigService, mainDataSource: DataSource, dataDataSource: DataSource, engineFactory: EngineFactory, dockerService: DockerService, cacheService: CacheService, storageService: StorageService, shutdownService: ShutdownService);
    getStatus(): Promise<InfraStatus>;
    getEngines(): Array<{
        id: string;
        name: string;
        enabled: boolean;
        features: string[];
    }>;
    getCurrentEngine(): {
        engineType: string;
    };
    saveConfig(config: SaveConfigDto): {
        message: string;
        saved: boolean;
        envPath: string;
        profiles: string[];
    };
    requestRestart(body?: {
        profiles?: string[];
        profilesToRemove?: string[];
    }): Promise<{
        message: string;
        restarting: boolean;
        profiles: string[];
        profilesToRemove: string[];
        estimatedTime: number;
        orchestration?: object;
        removal?: object;
    }>;
    healthCheck(): {
        status: string;
        timestamp: string;
    };
    exportData(): Promise<{
        exportedAt: string;
        dataDbType: string;
        tables: MigrationTables;
        counts: {
            sessions: number;
            webhooks: number;
            messages: number;
            messageBatches: number;
        };
    }>;
    importData(data: {
        tables: Partial<MigrationTables>;
    }): Promise<{
        imported: boolean;
        counts: {
            sessions: number;
            webhooks: number;
            messages: number;
            messageBatches: number;
        };
        warnings: string[];
    }>;
    getStorageFileCount(): Promise<{
        storageType: string;
        count: number;
        sizeBytes: number;
        sizeMB: string;
    }>;
    exportStorage(): Promise<{
        message: string;
        download: string;
    }>;
    importStorage(body: {
        filePath: string;
    }): Promise<{
        imported: boolean;
        count: number;
        storageType: string;
    }>;
}
export {};
