{"size": 2924, "ext": "js", "max_stars_repo_path": "node_modules/@aws-amplify/cli/lib/commands/plugin/list.js", "max_stars_repo_name": "joo-yongjae/frontend16", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "node_modules/@aws-amplify/cli/lib/commands/plugin/list.js", "max_issues_repo_name": "joo-yongjae/frontend16", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/@aws-amplify/cli/lib/commands/plugin/list.js", "max_forks_repo_name": "joo-yongjae/frontend16", "max_forks_repo_forks_event_min_datetime": "2021-10-13T16:29:53.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-15T08:13:02.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 4, "avg_line_length": 37.0126582278, "max_line_length": 141, "alphanum_fraction": 0.6053351573}
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0;
const inquirer = __importStar(require("inquirer"));
const display_plugin_platform_1 = require("../../plugin-helpers/display-plugin-platform");
const run = async (context) => {
    const { pluginPlatform } = context;
    const plugins = 'active plugins';
    const excluded = 'excluded plugins';
    const generalInfo = 'general information';
    const options = [plugins, excluded, generalInfo];
    const answer = await inquirer.prompt({
        type: 'list',
        name: 'selection',
        message: 'Select the section to list',
        choices: options,
    });
    switch (answer.selection) {
        case plugins:
            listPluginCollection(context, pluginPlatform.plugins);
            break;
        case excluded:
            listPluginCollection(context, pluginPlatform.excluded);
            break;
        case generalInfo:
            display_plugin_platform_1.displayGeneralInfo(context, pluginPlatform);
            break;
        default:
            listPluginCollection(context, pluginPlatform.plugins);
            break;
    }
};
exports.run = run;
async function listPluginCollection(context, collection) {
    const all = 'all';
    const options = Object.keys(collection);
    if (options.length > 0) {
        let toList = options[0];
        if (options.length > 1) {
            options.push(all);
            const answer = await inquirer.prompt({
                type: 'list',
                name: 'selection',
                message: 'Select the name of the plugin to list',
                choices: options,
            });
            toList = answer.selection;
        }
        if (toList === all) {
            display_plugin_platform_1.displayPluginCollection(context, collection);
        }
        else {
            display_plugin_platform_1.displayPluginInfoArray(context, collection[toList]);
        }
    }
    else {
        context.print.info('The collection is empty');
    }
}
//# sourceMappingURL=list.js.map