import { DeleteDTO } from '@hed-hog/api';
import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
import { PrismaService } from '@hed-hog/api-prisma';
import { CreateDTO } from './dto/create.dto';
import { ConflictResolutionDTO, ImportProfileItemDTO } from './dto/import-confirm.dto';
import { UpdateDTO } from './dto/update.dto';
type ValidatedImportItem = {
    index: number;
    slug: string;
    name: string;
    type_slug: string;
    provider_slug: string;
    config: Record<string, unknown> | null;
    is_active: boolean;
    has_conflict: boolean;
};
type InvalidImportItem = {
    index: number;
    slug?: string;
    errors: string[];
};
export declare class IntegrationProfileService {
    private readonly prismaService;
    private readonly paginationService;
    constructor(prismaService: PrismaService, paginationService: PaginationService);
    listTypes(): Promise<{
        id: number;
        icon: string;
        slug: string;
        integration_type_locale: {
            name: string;
            locale: {
                code: string;
            };
        }[];
    }[]>;
    listProviders(typeId?: number, typeSlug?: string): Promise<{
        id: number;
        slug: string;
        type_id: number;
        integration_provider_locale: {
            name: string;
            locale: {
                code: string;
            };
        }[];
    }[]>;
    list(paginationParams: PaginationDTO, typeId?: number, typeSlug?: string, providerSlug?: string): Promise<{
        total: any;
        lastPage: number;
        page: number;
        pageSize: number;
        prev: number;
        next: number;
        data: any[];
    }>;
    get(id: number): Promise<{
        integration_provider: {
            slug: string;
            integration_provider_locale: {
                name: string;
                locale: {
                    code: string;
                };
            }[];
        };
        integration_type: {
            icon: string;
            slug: string;
            integration_type_locale: {
                name: string;
                locale: {
                    code: string;
                };
            }[];
        };
    } & {
        name: string;
        id: number;
        created_at: Date;
        updated_at: Date;
        slug: string;
        is_active: boolean;
        provider_id: number;
        type_id: number;
        config: import("@prisma/client/runtime/library").JsonValue | null;
    }>;
    create(data: CreateDTO): Promise<{
        name: string;
        id: number;
        created_at: Date;
        updated_at: Date;
        slug: string;
        is_active: boolean;
        provider_id: number;
        type_id: number;
        config: import("@prisma/client/runtime/library").JsonValue | null;
    }>;
    update({ id, data }: {
        id: number;
        data: UpdateDTO;
    }): Promise<{
        name: string;
        id: number;
        created_at: Date;
        updated_at: Date;
        slug: string;
        is_active: boolean;
        provider_id: number;
        type_id: number;
        config: import("@prisma/client/runtime/library").JsonValue | null;
    }>;
    delete({ ids }: DeleteDTO): Promise<{
        count: number;
    }>;
    test(data: CreateDTO): Promise<{
        success: boolean;
        destination: string;
    }>;
    exportProfiles({ ids, includeSecrets, }: {
        ids?: number[];
        includeSecrets?: boolean;
    }): Promise<Buffer>;
    validateImportFile(file: MulterFile): Promise<{
        format: {
            type: "integration-profile";
            version: 1;
            generated_at: string;
            include_secrets: boolean;
        };
        total_profiles: number;
        valid_profiles: number;
        invalid_profiles: number;
        conflict_profiles: number;
        importable_profiles: number;
        conflict_slugs: string[];
        profiles: ValidatedImportItem[];
        invalid_items: InvalidImportItem[];
    }>;
    confirmImport({ profiles, conflictResolutions, }: {
        profiles: ImportProfileItemDTO[];
        conflictResolutions?: ConflictResolutionDTO[];
    }): Promise<{
        success: boolean;
        total_received: number;
        created: number;
        replaced: number;
        renamed: number;
        ignored: number;
        imported: number;
    }>;
    private ensureSlugIsAvailable;
    private validateTypeAndProvider;
    private parseImportEnvelope;
    private sanitizeConfigForExport;
    private getSensitiveConfigKeys;
    private generateUniqueSlug;
}
export {};
//# sourceMappingURL=integration-profile.service.d.ts.map