"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class Move extends BaseCommand_1.BaseCommand {
    async run() {
        const to = await this.cache.getListIdByBoardAndName(this.lookups.board, this.flags.to);
        const card = await this.client.cards.updateCard({
            id: this.lookups.card,
            idList: to,
            pos: this.flags.position,
        });
        this.output(card);
    }
    toData(data) {
        return {
            id: data.id,
            name: data.name,
            due: data.due,
            description: data.desc,
            labels: data.labels,
            url: data.url,
        };
    }
}
Move.description = "Move a card";
Move.flags = {
    card: core_1.Flags.string({ required: true }),
    board: core_1.Flags.string({ required: true }),
    list: core_1.Flags.string({ required: true }),
    to: core_1.Flags.string({ required: true }),
    position: core_1.Flags.option({ options: ["top", "bottom"], default: "bottom" })(),
};
exports.default = Move;
