import { captureEvent } from "../../common/analytics/lib.js";
import { authenticate } from "../../common/middleware/authentication.js";
import { confirmLinkedConfig } from "../../common/middleware/confirm-linked-config.js";
import { fetchAccount } from "../../common/middleware/get-account-param.js";
import { fetchProject } from "../../common/middleware/get-project-param.js";
import { configure } from "../../common/middleware/user-configuration.js";
import { identify } from "../../common/middleware/user-identification.js";
import { deleteCommand } from "../../mtls-certificates/delete/handler.js";
export default {
    desc: "Deletes an mTLS certificate by ID",
    command: "delete",
    builder: (yargs) => {
        return yargs
            .usage("$0 mtls-certificates delete --cert-id <id> [options]")
            .option("cert-id", {
            type: "string",
            describe: "The ID of the certificate to delete",
        })
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
            alias: "apikey",
        })
            .option("account", {
            type: "string",
            describe: "The account name",
        })
            .option("project", {
            type: "string",
            describe: "The project name",
        })
            .demandOption(["cert-id"])
            .example([
            [
                "$0 mtls-certificates delete --cert-id cert_abc123",
                "Delete an mTLS certificate",
            ],
            [
                "$0 mtls-certificates delete --cert-id cert_abc123 --account my-account --project my-project",
                "Explicitly specify the account and project",
            ],
        ])
            .middleware([
            authenticate,
            configure,
            confirmLinkedConfig,
            fetchAccount,
            fetchProject,
            identify,
        ]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo mtls-certificate delete" });
        await deleteCommand(argv);
    },
};
//# sourceMappingURL=delete.js.map