///
import { Readable, Writable } from "stream";
//#region ../../node_modules/typanion/lib/types.d.ts
declare type BoundCoercionFn = () => BoundCoercionFn;
declare type CoercionFn = (v: any) => BoundCoercionFn;
declare type Coercion = [string, BoundCoercionFn];
declare type LooseTest = (value: U, test?: ValidationState) => boolean;
declare type ValidationState = {
p?: string;
errors?: string[];
coercions?: Coercion[];
coercion?: CoercionFn;
};
//#endregion
//#region ../../node_modules/clipanion/lib/format.d.ts
interface ColorFormat {
header(str: string): string;
bold(str: string): string;
error(str: string): string;
code(str: string): string;
}
//#endregion
//#region ../../node_modules/clipanion/lib/advanced/options/utils.d.ts
declare const isOptionSymbol: unique symbol;
//#endregion
//#region ../../node_modules/clipanion/lib/advanced/Cli.d.ts
/**
* The base context of the CLI.
*
* All Contexts have to extend it.
*/
declare type BaseContext = {
/**
* Environment variables.
*
* @default
* process.env
*/
env: Record;
/**
* The input stream of the CLI.
*
* @default
* process.stdin
*/
stdin: Readable;
/**
* The output stream of the CLI.
*
* @default
* process.stdout
*/
stdout: Writable;
/**
* The error stream of the CLI.
*
* @default
* process.stderr
*/
stderr: Writable;
/**
* Whether colors should be enabled.
*/
colorDepth: number;
};
declare type CliOptions = Readonly<{
/**
* The label of the binary.
*
* Shown at the top of the usage information.
*/
binaryLabel?: string;
/**
* The name of the binary.
*
* Included in the path and the examples of the definitions.
*/
binaryName: string;
/**
* The version of the binary.
*
* Shown at the top of the usage information.
*/
binaryVersion?: string;
/**
* If `true`, the Cli will hook into the process standard streams to catch
* the output produced by console.log and redirect them into the context
* streams. Note: stdin isn't captured at the moment.
*
* @default
* false
*/
enableCapture: boolean;
/**
* If `true`, the Cli will use colors in the output. If `false`, it won't.
* If `undefined`, Clipanion will infer the correct value from the env.
*/
enableColors?: boolean;
}>;
declare type MiniCli = CliOptions & {
/**
* Returns an Array representing the definitions of all registered commands.
*/
definitions(): Array;
/**
* Formats errors using colors.
*
* @param error The error to format. If `error.name` is `'Error'`, it is replaced with `'Internal Error'`.
* @param opts.command The command whose usage will be included in the formatted error.
*/
error(error: Error, opts?: {
command?: Command | null;
}): string;
/**
* Returns a rich color format if colors are enabled, or a plain text format otherwise.
*
* @param colored Forcefully enable or disable colors.
*/
format(colored?: boolean): ColorFormat;
/**
* Compiles a command and its arguments using the `CommandBuilder`.
*
* @param input An array containing the name of the command and its arguments
*
* @returns The compiled `Command`, with its properties populated with the arguments.
*/
process(input: Array, context?: Partial): Command;
/**
* Runs a command.
*
* @param input An array containing the name of the command and its arguments
* @param context Overrides the Context of the main `Cli` instance
*
* @returns The exit code of the command
*/
run(input: Array, context?: Partial): Promise;
/**
* Returns the usage of a command.
*
* @param command The `Command` whose usage will be returned or `null` to return the usage of all commands.
* @param opts.detailed If `true`, the usage of a command will also include its description, details, and examples. Doesn't have any effect if `command` is `null` or doesn't have a `usage` property.
* @param opts.prefix The prefix displayed before each command. Defaults to `$`.
*/
usage(command?: CommandClass | Command | null, opts?: {
detailed?: boolean;
prefix?: string;
}): string;
};
//#endregion
//#region ../../node_modules/clipanion/lib/advanced/Command.d.ts
/**
* The usage of a Command.
*/
declare type Usage = {
/**
* The category of the command.
*
* Included in the detailed usage.
*/
category?: string;
/**
* The short description of the command, formatted as Markdown.
*
* Included in the detailed usage.
*/
description?: string;
/**
* The extended details of the command, formatted as Markdown.
*
* Included in the detailed usage.
*/
details?: string;
/**
* Examples of the command represented as an Array of tuples.
*
* The first element of the tuple represents the description of the example.
*
* The second element of the tuple represents the command of the example.
* If present, the leading `$0` is replaced with `cli.binaryName`.
*/
examples?: Array<[string, string]>;
};
/**
* The definition of a Command.
*/
declare type Definition = Usage & {
/**
* The path of the command, starting with `cli.binaryName`.
*/
path: string;
/**
* The detailed usage of the command.
*/
usage: string;
/**
* The various options registered on the command.
*/
options: Array<{
definition: string;
description?: string;
required: boolean;
}>;
};
declare type CommandClass = {
new (): Command;
paths?: Array>;
schema?: Array>;
usage?: Usage;
};
/**
* Base abstract class for CLI commands. The main thing to remember is to
* declare an async `execute` member function that will be called when the
* command is invoked from the CLI, and optionally a `paths` property to
* declare the set of paths under which the command should be exposed.
*/
declare abstract class Command {
/**
* @deprecated Do not use this; prefer the static `paths` property instead.
*/
paths?: undefined;
/**
* Defined to prevent a common typo.
*/
static path: never;
/**
* Paths under which the command should be exposed.
*/
static paths?: Array>;
/**
* Defines the usage information for the given command.
*/
static Usage(usage: Usage): Usage;
/**
* Contains the usage information for the command. If undefined, the
* command will be hidden from the general listing.
*/
static usage?: Usage;
/**
* Defines a schema to apply before running the `execute` method. The
* schema is expected to be generated by Typanion.
*
* @see https://github.com/arcanis/typanion
*/
static schema?: Array>;
/**
* Standard function that'll get executed by `Cli#run` and `Cli#runExit`.
*
* Expected to return an exit code or nothing (which Clipanion will treat
* as if 0 had been returned).
*/
abstract execute(): Promise;
/**
* Standard error handler which will simply rethrow the error. Can be used
* to add custom logic to handle errors from the command or simply return
* the parent class error handling.
*/
catch(error: any): Promise;
/**
* Predefined that will be set to true if `-h,--help` has been used, in
* which case `Command#execute` won't be called.
*/
help: boolean;
/**
* Predefined variable that will be populated with a miniature API that can
* be used to query Clipanion and forward commands.
*/
cli: MiniCli;
/**
* Predefined variable that will be populated with the context of the
* application.
*/
context: Context;
/**
* Predefined variable that will be populated with the path that got used
* to access the command currently being executed.
*/
path: Array;
validateAndExecute(): Promise;
/**
* Used to detect option definitions.
*/
static isOption: typeof isOptionSymbol;
/**
* Just an helper to use along with the `paths` fields, to make it
* clearer that a command is the default one.
*
* @example
* class MyCommand extends Command {
* static paths = [Command.Default];
* }
*/
static Default: never[];
}
//#endregion
//#region ../base/dist/index.d.ts
type CommandContext = BaseContext & {
builtinPlugins: string[];
};
/**
* This command should be extended by **every** command in the monorepo.
*/
declare abstract class BaseCommand extends Command {}
//#endregion
//#region ../base/dist/commands/dora/deployment.d.ts
declare class DoraDeploymentCommand extends BaseCommand {
static paths: string[][];
static usage: Usage;
protected serviceParam: string | undefined;
protected env: string | undefined;
protected startedAt: Date;
protected finishedAt: Date | undefined;
protected version: string | undefined;
protected gitRepoURL: string | undefined;
protected gitCommitSHA: string | undefined;
protected skipGit: boolean;
protected team: string | undefined;
protected customTags: string[] | undefined;
protected fips: boolean;
protected fipsIgnoreError: boolean;
protected verbose: boolean;
protected dryRun: boolean;
execute(): Promise;
}
//#endregion
//#region src/commands/deployment.d.ts
declare class PluginCommand extends DoraDeploymentCommand {
private config;
private logger;
private service;
private gitInfo?;
execute(): Promise<1 | undefined>;
private getGitInfo;
private getApiHelper;
private buildDeploymentEvent;
private sendDeploymentEvent;
}
//#endregion
//#region dist/.bundle-entry.d.ts
declare const commands: {
deployment: {
PluginCommand: typeof PluginCommand;
};
};
//#endregion
export { commands };
//# sourceMappingURL=bundle.d.ts.map