// SPDX-License-Identifier: Apache-2.0
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var MirrorCommandDefinition_1;
import { inject, injectable } from 'tsyringe-neo';
import { InjectTokens } from '../../core/dependency-injection/inject-tokens.js';
import { patchInject } from '../../core/dependency-injection/container-helper.js';
import { BaseCommandDefinition } from './base-command-definition.js';
import { CommandBuilder, CommandGroup, Subcommand } from '../../core/command-path-builders/command-builder.js';
import { MirrorNodeCommand } from '../mirror-node.js';
import * as constants from '../../core/constants.js';
let MirrorCommandDefinition = class MirrorCommandDefinition extends BaseCommandDefinition {
    static { MirrorCommandDefinition_1 = this; }
    logger;
    mirrorNodeCommand;
    constructor(logger, mirrorNodeCommand) {
        super();
        this.logger = logger;
        this.mirrorNodeCommand = mirrorNodeCommand;
        this.mirrorNodeCommand = patchInject(mirrorNodeCommand, InjectTokens.MirrorNodeCommand, this.constructor.name);
        this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
    }
    static COMMAND_NAME = 'mirror';
    static DESCRIPTION = 'Mirror Node operations for creating, modifying, and destroying resources. ' +
        'These commands require the presence of an existing deployment.';
    static NODE_SUBCOMMAND_NAME = 'node';
    static NODE_SUBCOMMAND_DESCRIPTION = 'List, create, manage, or destroy mirror node instances. Operates on a single mirror node instance at a time.';
    static NODE_ADD = 'add';
    static NODE_DESTROY = 'destroy';
    static NODE_UPGRADE = 'upgrade';
    static ADD_COMMAND = `${MirrorCommandDefinition_1.COMMAND_NAME} ${MirrorCommandDefinition_1.NODE_SUBCOMMAND_NAME} ${MirrorCommandDefinition_1.NODE_ADD}`;
    static DESTROY_COMMAND = `${MirrorCommandDefinition_1.COMMAND_NAME} ${MirrorCommandDefinition_1.NODE_SUBCOMMAND_NAME} ${MirrorCommandDefinition_1.NODE_DESTROY}`;
    static UPGRADE_COMMAND = `${MirrorCommandDefinition_1.COMMAND_NAME} ${MirrorCommandDefinition_1.NODE_SUBCOMMAND_NAME} ${MirrorCommandDefinition_1.NODE_UPGRADE}`;
    getCommandDefinition() {
        return new CommandBuilder(MirrorCommandDefinition_1.COMMAND_NAME, MirrorCommandDefinition_1.DESCRIPTION, this.logger)
            .addCommandGroup(new CommandGroup(MirrorCommandDefinition_1.NODE_SUBCOMMAND_NAME, MirrorCommandDefinition_1.NODE_SUBCOMMAND_DESCRIPTION)
            .addSubcommand(new Subcommand(MirrorCommandDefinition_1.NODE_ADD, 'Adds and configures a new node instance.', this.mirrorNodeCommand, this.mirrorNodeCommand.add, MirrorNodeCommand.DEPLOY_FLAGS_LIST, [constants.HELM, constants.KUBECTL]))
            .addSubcommand(new Subcommand(MirrorCommandDefinition_1.NODE_DESTROY, 'Deletes the specified node from the deployment.', this.mirrorNodeCommand, this.mirrorNodeCommand.destroy, MirrorNodeCommand.DESTROY_FLAGS_LIST, [constants.HELM]))
            .addSubcommand(new Subcommand(MirrorCommandDefinition_1.NODE_UPGRADE, 'Upgrades the specified node from the deployment.', this.mirrorNodeCommand, this.mirrorNodeCommand.upgrade, MirrorNodeCommand.UPGRADE_FLAGS_LIST, [constants.HELM])))
            .build();
    }
};
MirrorCommandDefinition = MirrorCommandDefinition_1 = __decorate([
    injectable(),
    __param(0, inject(InjectTokens.SoloLogger)),
    __param(1, inject(InjectTokens.MirrorNodeCommand)),
    __metadata("design:paramtypes", [Object, MirrorNodeCommand])
], MirrorCommandDefinition);
export { MirrorCommandDefinition };
//# sourceMappingURL=mirror-command-definition.js.map