"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class LabelList extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const labels = await this.client.boards.getBoardLabels({
            id: this.lookups.board,
        });
        this.output(labels);
    }
    toData(data) {
        return data
            .filter((l) => l.name)
            .map((l) => ({
            id: l.id,
            name: l.name,
            color: l.color,
        }));
    }
    async format(data) {
        return data
            .map((l) => `[${l.color}] ${l.name} (ID: ${l.id})`)
            .join("\n");
    }
}
LabelList.description = "List all labels on a board";
LabelList.flags = {
    board: core_1.Flags.string({ required: true }),
};
exports.default = LabelList;
