"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UninstallExtensionCommand = void 0;
const yok_1 = require("../../common/yok");
class UninstallExtensionCommand {
    constructor($extensibilityService, $stringParameterBuilder, $logger) {
        this.$extensibilityService = $extensibilityService;
        this.$stringParameterBuilder = $stringParameterBuilder;
        this.$logger = $logger;
        this.allowedParameters = [
            this.$stringParameterBuilder.createMandatoryParameter("You have to provide a valid name for extension that you want to uninstall."),
        ];
    }
    async execute(args) {
        const extensionName = args[0];
        await this.$extensibilityService.uninstallExtension(extensionName);
        this.$logger.info(`Successfully uninstalled extension ${extensionName}`);
    }
}
exports.UninstallExtensionCommand = UninstallExtensionCommand;
yok_1.injector.registerCommand("extension|uninstall", UninstallExtensionCommand);
