// 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 KeysCommandDefinition_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 { NodeCommand } from '../node/index.js';
import * as NodeFlags from '../node/flags.js';
let KeysCommandDefinition = class KeysCommandDefinition extends BaseCommandDefinition {
    static { KeysCommandDefinition_1 = this; }
    logger;
    nodeCommand;
    constructor(logger, nodeCommand) {
        super();
        this.logger = logger;
        this.nodeCommand = nodeCommand;
        this.nodeCommand = patchInject(nodeCommand, InjectTokens.NodeCommand, this.constructor.name);
        this.logger = patchInject(logger, InjectTokens.SoloLogger, this.constructor.name);
    }
    static COMMAND_NAME = 'keys';
    static DESCRIPTION = 'Consensus key generation operations';
    static CONSENSUS_SUBCOMMAND_NAME = 'consensus';
    static CONSENSUS_SUBCOMMAND_DESCRIPTION = 'Generate unique cryptographic keys (gossip or grpc TLS keys) for the Consensus Node instances.';
    static CONSENSUS_GENERATE = 'generate';
    static KEYS_COMMAND = `${KeysCommandDefinition_1.COMMAND_NAME} ${KeysCommandDefinition_1.CONSENSUS_SUBCOMMAND_NAME} ${KeysCommandDefinition_1.CONSENSUS_GENERATE}`;
    getCommandDefinition() {
        return new CommandBuilder(KeysCommandDefinition_1.COMMAND_NAME, KeysCommandDefinition_1.DESCRIPTION, this.logger)
            .addCommandGroup(new CommandGroup(KeysCommandDefinition_1.CONSENSUS_SUBCOMMAND_NAME, KeysCommandDefinition_1.CONSENSUS_SUBCOMMAND_DESCRIPTION).addSubcommand(new Subcommand(KeysCommandDefinition_1.CONSENSUS_GENERATE, 'Generates TLS keys required for consensus node communication.', this.nodeCommand.handlers, this.nodeCommand.handlers.keys, NodeFlags.KEYS_FLAGS, [])))
            .build();
    }
};
KeysCommandDefinition = KeysCommandDefinition_1 = __decorate([
    injectable(),
    __param(0, inject(InjectTokens.SoloLogger)),
    __param(1, inject(InjectTokens.NodeCommand)),
    __metadata("design:paramtypes", [Object, NodeCommand])
], KeysCommandDefinition);
export { KeysCommandDefinition };
//# sourceMappingURL=keys-command-definition.js.map