import { captureEvent } from "../common/analytics/lib.js";
import { authenticate } from "../common/middleware/authentication.js";
import { configure } from "../common/middleware/user-configuration.js";
import { identify } from "../common/middleware/user-identification.js";
import setBlocking from "../common/output.js";
import { YargsChecker } from "../common/validators/lib.js";
import { ProjectIsSetValidator } from "../common/validators/project-name-validator.js";
import { list } from "../list/handler.js";
export default {
    desc: "Lists all deployed zups",
    command: "list",
    builder: (yargs) => {
        return yargs
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
        })
            .option("project", {
            type: "string",
            describe: "The project name",
        })
            .option("self-hosted-endpoint", {
            type: "string",
            describe: "The endpoint of your self-hosted service to deploy to",
        })
            .middleware([setBlocking, authenticate, configure, identify])
            .check(async (argv) => {
            return await new YargsChecker(new ProjectIsSetValidator()).check(argv);
        });
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo list" });
        await list(argv);
    },
};
//# sourceMappingURL=list.js.map