"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class List extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "fancy";
    }
    async run() {
        const cards = await this.client.lists.getListCards({
            id: this.lookups.list,
        });
        this.output(cards);
    }
    toData(data) {
        return data.map((d) => {
            return {
                id: d.id,
                name: d.name,
                description: d.desc,
                due: d.due,
                closed: d.closed,
                url: d.url,
                labels: d.labels,
            };
        });
    }
    format(data) {
        return data
            .map((b) => {
            return `${b.name} (ID: ${b.id})`;
        })
            .join("\n");
    }
}
List.description = "Show all cards in a list";
List.flags = {
    board: core_1.Flags.string({ required: true }),
    list: core_1.Flags.string({ required: true }),
};
exports.default = List;
