"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class BoardList extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const boards = await this.client.members.getMemberBoards({
            id: "me",
            filter: this.flags.filter,
        });
        this.output(boards);
    }
    toData(data) {
        return data.map((d) => {
            return {
                id: d.id,
                name: d.name,
                desc: d.desc,
                url: d.url,
            };
        });
    }
    format(data) {
        return data
            .map((b) => {
            return `${b.name} (ID: ${b.id})`;
        })
            .join("\n");
    }
}
BoardList.description = "List all boards that you have access to";
BoardList.flags = {
    filter: core_1.Flags.option({
        options: [
            "all",
            "closed",
            "members",
            "open",
            "organization",
            "public",
            "starred",
        ],
        default: "open",
    })(),
};
exports.default = BoardList;
