import { Logger } from '@n8n/backend-common';
import { CredentialsRepository, TagRepository } from '@n8n/db';
import { DataSource, EntityManager } from '@n8n/typeorm';
import { type IWorkflowBase } from 'n8n-workflow';
import { Cipher } from 'n8n-core';
import { ActiveWorkflowManager } from '../active-workflow-manager';
import type { IWorkflowWithVersionMetadata } from '../interfaces';
import { WorkflowIndexService } from '../modules/workflow-index/workflow-index.service';
export declare class ImportService {
    private readonly logger;
    private readonly credentialsRepository;
    private readonly tagRepository;
    private readonly dataSource;
    private readonly cipher;
    private readonly activeWorkflowManager;
    private readonly workflowIndexService;
    private dbCredentials;
    private dbTags;
    private foreignKeyCommands;
    constructor(logger: Logger, credentialsRepository: CredentialsRepository, tagRepository: TagRepository, dataSource: DataSource, cipher: Cipher, activeWorkflowManager: ActiveWorkflowManager, workflowIndexService: WorkflowIndexService);
    initRecords(): Promise<void>;
    importWorkflows(workflows: IWorkflowWithVersionMetadata[], projectId: string): Promise<void>;
    replaceInvalidCreds(workflow: IWorkflowBase, projectId: string): Promise<void>;
    isTableEmpty(tableName: string): Promise<boolean>;
    areAllEntityTablesEmpty(tableNames: string[]): Promise<boolean>;
    truncateEntityTable(tableName: string, transactionManager: EntityManager): Promise<void>;
    getImportMetadata(inputDir: string): Promise<{
        tableNames: string[];
        entityFiles: Record<string, string[]>;
    }>;
    readEntityFile(filePath: string, customEncryptionKey?: string): Promise<Array<Record<string, unknown>>>;
    private decompressEntitiesZip;
    importEntities(inputDir: string, truncateTables: boolean, keyFilePath?: string, skipMigrationChecks?: boolean, skipTogglingForeignKeyConstraints?: boolean): Promise<void>;
    importEntitiesFromFiles(inputDir: string, transactionManager: EntityManager, entityNames: string[], entityFiles: Record<string, string[]>, customEncryptionKey?: string): Promise<void>;
    private toNewCredentialFormat;
    private normalizeEntityJsonColumns;
    disableForeignKeyConstraints(transactionManager: EntityManager): Promise<void>;
    enableForeignKeyConstraints(transactionManager: EntityManager): Promise<void>;
    validateMigrations(inputDir: string, customEncryptionKey?: string): Promise<void>;
}
