"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDescribeBuilderOptions = getDescribeBuilderOptions;
exports.outputEntity = outputEntity;
const js_yaml_1 = require("js-yaml");
const loggingProvider_1 = require("@mablhq-internal/runtime/providers/logging/loggingProvider");
const constants_1 = require("../constants");
const constants_2 = require("@mablhq-internal/runtime/core/constants");
function getDescribeBuilderOptions() {
    return {
        [constants_1.CommandArgOutput]: {
            describe: `Specify output format`,
            alias: constants_1.CommandArgAliases.OutputType,
            choices: [constants_2.OutputFormats.Json, constants_2.OutputFormats.Yaml],
        },
    };
}
function outputEntity(entity, outputMode) {
    loggingProvider_1.logger.logNewLine();
    let content;
    switch (outputMode) {
        case constants_2.OutputFormats.Json:
            content = JSON.stringify(entity, null, 2);
            break;
        case constants_2.OutputFormats.Yaml:
        default:
            content = (0, js_yaml_1.dump)(entity);
            break;
    }
    process.stdout.write(content + '\n');
    return content;
}
