UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

103 lines (102 loc) 4.23 kB
import { type Duration } from '../../../core/time/duration.js'; import { type SoloLogger } from '../../../core/logging/solo-logger.js'; /** * Represents the execution of a helm command and is responsible for parsing the response. */ export declare class HelmExecution { /** * The logger for this class which should be used for all logging. */ private static readonly MSG_TIMEOUT_ERROR; /** * The message for a timeout error. */ private static readonly MSG_DESERIALIZATION_ERROR; /** * The message for a deserialization error. */ private static readonly MSG_LIST_DESERIALIZATION_ERROR; private readonly process; private readonly commandLine; private readonly logger?; private output; private errOutput; private exitCodeValue; /** * Redacts sensitive arguments from a command array. * Delegates to the shared {@link SensitiveDataRedactor} utility. * @param command The command array to redact * @returns A new redacted command array */ static redactCommand(command: string[]): string[]; /** * Creates a new HelmExecution instance. * @param command The command array to execute * @param environmentVariables The environment variables to set * @param logger Optional logger for command output */ constructor(command: string[], environmentVariables: Record<string, string>, logger?: SoloLogger); /** * Waits for the process to complete. * @returns A promise that resolves when the process completes */ waitFor(): Promise<void>; /** * Waits for the process to complete with a timeout. * @param timeout The maximum time to wait, or null to wait indefinitely * @returns A promise that resolves with true if the process completed, or false if it timed out */ private waitForTimeout; /** * Gets the exit code of the process. * @returns The exit code or null if the process hasn't completed */ private exitCode; /** * Gets the standard output of the process. * @returns concatenated standard output as a string */ private standardOutput; /** * Gets the standard error of the process. * @returns concatenated standard error as a string */ private standardError; /** * Gets the response as a parsed object. * @param responseClass The class to parse the response into * @returns A promise that resolves with the parsed response */ responseAs<T>(responseClass: new (...arguments_: any[]) => T): Promise<T>; /** * Gets the response as a parsed object with a timeout. * @param responseClass The class to parse the response into * @param timeout The maximum time to wait, or null to wait indefinitely * @returns A promise that resolves with the parsed response or rejects on timeout */ responseAsTimeout<T>(responseClass: new (...arguments_: any[]) => T, timeout: Duration | null): Promise<T>; /** * Gets the response as a list of parsed objects. * @param responseClass The class to parse each item in the response into * @returns A promise that resolves with the parsed response list */ responseAsList<T>(responseClass: new (...arguments_: any[]) => T): Promise<T[]>; /** * Gets the response as a list of parsed objects with a timeout. * @param responseClass The class to parse each item in the response into * @param timeout The maximum time to wait, or null to wait indefinitely * @returns A promise that resolves with the parsed response list or rejects on timeout */ responseAsListTimeout<T>(responseClass: new (...arguments_: any[]) => T, timeout: Duration | null): Promise<T[]>; /** * Executes the command and waits for completion. * @returns A promise that resolves when the command completes */ call(): Promise<void>; /** * Executes the command and waits for completion with a timeout. * @param timeout The maximum time to wait, or null to wait indefinitely * @returns A promise that resolves when the command completes or rejects on timeout */ callTimeout(timeout: Duration | null): Promise<void>; }