"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
class DebugIndex extends BaseCommand_1.BaseCommand {
    constructor() {
        super(...arguments);
        this.defaultOutput = "json";
    }
    async run() {
        let validCredentials = false;
        try {
            await this.client.members.getMember({
                id: "me",
            });
            validCredentials = true;
        }
        catch {
            // Credentials are invalid or API call failed
        }
        const config = {
            configDirectory: this.configDir,
            profile: this.profile,
            authType: process.env.TRELLO_TOKEN ? "environment" : "config",
            validCredentials,
        };
        this.output(config);
    }
}
DebugIndex.description = "Debug your installation";
exports.default = DebugIndex;
