import { BaseCommand } from './base.js';
import * as constants from '../core/constants.js';
import { type KeyManager } from '../core/key-manager.js';
import { type PlatformInstaller } from '../core/platform-installer.js';
import { type ProfileManager } from '../core/profile-manager.js';
import { type CertificateManager } from '../core/certificate-manager.js';
import { type ArgvStruct, type IP, type NodeAlias, type NodeAliases } from '../types/aliases.js';
import { type ClusterReferenceName, type ClusterReferences, type SoloListrTask } from '../types/index.js';
import { type CommandFlags } from '../types/flag-types.js';
import { NamespaceName } from '../types/namespace/namespace-name.js';
import { ConsensusNode } from '../core/model/consensus-node.js';
import { BlockNodeStateSchema } from '../data/schema/model/remote/state/block-node-state-schema.js';
import { PackageDownloader } from '../core/package-downloader.js';
import { Zippy } from '../core/zippy.js';
import { type SoloEventBus } from '../core/events/solo-event-bus.js';
export interface NetworkDeployConfigClass {
    isUpgrade: boolean;
    applicationEnv: string;
    chainId: string;
    cacheDir: string;
    chartDirectory: string;
    loadBalancerEnabled: boolean;
    soloChartVersion: string;
    namespace: NamespaceName;
    deployment: string;
    nodeAliasesUnparsed: string;
    persistentVolumeClaims: string;
    releaseTag: string;
    keysDir: string;
    nodeAliases: NodeAliases;
    stagingDir: string;
    stagingKeysDir: string;
    valuesFile: string;
    valuesArgMap: Record<ClusterReferenceName, string>;
    grpcTlsCertificatePath: string;
    grpcWebTlsCertificatePath: string;
    grpcTlsKeyPath: string;
    grpcWebTlsKeyPath: string;
    genesisThrottlesFile: string;
    resolvedThrottlesFile: string;
    haproxyIps: string;
    envoyIps: string;
    haproxyIpsParsed?: Record<NodeAlias, IP>;
    envoyIpsParsed?: Record<NodeAlias, IP>;
    storageType: constants.StorageType;
    gcsWriteAccessKey: string;
    gcsWriteSecrets: string;
    gcsEndpoint: string;
    gcsBucket: string;
    gcsBucketPrefix: string;
    awsWriteAccessKey: string;
    awsWriteSecrets: string;
    awsEndpoint: string;
    awsBucket: string;
    awsBucketPrefix: string;
    awsBucketRegion: string;
    backupBucket: string;
    backupWriteSecrets: string;
    backupWriteAccessKey: string;
    backupEndpoint: string;
    backupRegion: string;
    backupProvider: string;
    consensusNodes: ConsensusNode[];
    contexts: string[];
    clusterRefs: ClusterReferences;
    domainNames?: string;
    domainNamesMapping?: Record<NodeAlias, string>;
    blockNodeComponents: BlockNodeStateSchema[];
    debugNodeAlias: NodeAlias;
    app: string;
    serviceMonitor: string;
    podLog: string;
    singleUseServiceMonitor: string;
    singleUsePodLog: string;
    enableMonitoringSupport: boolean;
    javaFlightRecorderConfiguration: string;
    wrapsEnabled: boolean;
    wrapsKeyPath: string;
    tssEnabled: boolean;
}
interface NetworkDeployContext {
    config: NetworkDeployConfigClass;
}
export interface NetworkDestroyContext {
    config: {
        deletePvcs: boolean;
        deleteSecrets: boolean;
        namespace: NamespaceName;
        enableTimeout: boolean;
        force: boolean;
        contexts: string[];
        deployment: string;
    };
    checkTimeout: boolean;
}
export declare class NetworkCommand extends BaseCommand {
    private readonly certificateManager;
    private readonly keyManager;
    private readonly platformInstaller;
    private readonly profileManager;
    private readonly zippy;
    private readonly downloader;
    private readonly eventBus;
    private profileValuesFile?;
    constructor(certificateManager: CertificateManager, keyManager: KeyManager, platformInstaller: PlatformInstaller, profileManager: ProfileManager, zippy: Zippy, downloader: PackageDownloader, eventBus: SoloEventBus);
    private static readonly DEPLOY_CONFIGS_NAME;
    static readonly DESTROY_FLAGS_LIST: CommandFlags;
    static readonly DEPLOY_FLAGS_LIST: CommandFlags;
    private waitForNetworkPods;
    private prepareMinioSecrets;
    private prepareStreamUploaderSecrets;
    private prepareBackupUploaderSecrets;
    private prepareStorageSecrets;
    /**
     * Prepare values args string for each cluster-ref
     * @param config
     */
    private prepareValuesArgMap;
    /**
     * Prepare the values argument for the helm chart for a given config
     * @param config
     */
    private prepareValuesArg;
    /**
     * Adds the template string to the argument for each record
     * @param records - the records to iterate over
     * @param consensusNodes - the consensus nodes to iterate over
     * @param valuesArguments - the values arguments to add to
     * @param templateString - the template string to add
     */
    private addArgForEachRecord;
    private prepareNamespaces;
    private prepareConfig;
    private destroyTask;
    private logDestroyResults;
    private deleteSecrets;
    private deletePvcs;
    private crdExists;
    /**
     * Ensure the PodLogs CRD from Grafana Alloy is installed
     */
    private ensurePodLogsCrd;
    /**
     * Ensure all Prometheus Operator CRDs exist; install chart only if needed.
     * If all CRDs are already present or monitoring support is disabled, skip installation.
     */
    /** Ensure Prometheus Operator CRDs are present; install missing ones via the chart */
    private ensurePrometheusOperatorCrds;
    /**
     * Patch the ServiceMonitor created by the solo-deployment helm chart so that it is discovered
     * by the kube-prometheus-stack Prometheus operator and targets the correct consensus node services.
     *
     * Two fixes are applied via a merge patch:
     * 1. Adds the `release: <PROMETHEUS_RELEASE_NAME>` label so the Prometheus instance from
     *    kube-prometheus-stack (which selects ServiceMonitors by `release` label) can discover it.
     * 2. Corrects `spec.selector.matchLabels` to `solo.hedera.com/type: network-node-svc` so the
     *    ServiceMonitor targets the non-headless consensus-node services (which expose the prometheus
     *    metrics port) rather than the hard-coded `network-node` value in the helm chart template.
     */
    private patchServiceMonitorForPrometheus;
    /** Run helm install and deploy network components */
    deploy(argv: ArgvStruct): Promise<boolean>;
    destroy(argv: ArgvStruct): Promise<boolean>;
    /** Adds the consensus node, envoy and haproxy components to remote config.  */
    addNodesAndProxies(): SoloListrTask<NetworkDeployContext>;
    private getBlockNodes;
    close(): Promise<void>;
}
export {};
