"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class BoardMembers extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const members = await this.client.boards.getBoardMembers({
            id: this.lookups.board,
        });
        this.output(members);
    }
    toData(data) {
        return data.map((m) => ({
            id: m.id,
            username: m.username,
            fullName: m.fullName,
        }));
    }
    async format(data) {
        return data
            .map((m) => `${m.username} (${m.fullName})`)
            .join("\n");
    }
}
BoardMembers.description = "List board members";
BoardMembers.flags = {
    board: core_1.Flags.string({ required: true }),
};
exports.default = BoardMembers;
