"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class ListCreate extends BaseCommand_1.BaseCommand {
    async run() {
        const board = await this.client.lists.createList({
            idBoard: this.lookups.board,
            name: this.flags.name,
            pos: this.flags.position,
        });
        // Sync after adding a new list
        await this.cache.sync();
        this.output(board);
    }
    toData(data) {
        return {
            id: data.id,
            name: data.name,
            desc: data.desc,
            url: data.url,
        };
    }
}
ListCreate.description = "Create a new list";
ListCreate.flags = {
    name: core_1.Flags.string({ char: "n", required: true }),
    position: core_1.Flags.option({ options: ["top", "bottom"], default: "top" })(),
    board: core_1.Flags.string({ required: true }),
};
exports.default = ListCreate;
