import { createApiClient } from "../../common/api/client.js";
import { printTableToConsoleAndExitGracefully } from "../../common/output.js";
export async function rotateToken(argv) {
    const { account } = argv;
    const client = createApiClient({ authToken: argv.authToken });
    const tunnel = await client.post(`/v1/accounts/${account}/tunnels/${argv["tunnel-id"]}/$rotate-token`, {
        operation: "Failed to rotate token for tunnel",
        errorMessage: "Error: Failed to rotate token for tunnel. Check the arguments.",
    });
    await printTableToConsoleAndExitGracefully(tunnel);
}
//# sourceMappingURL=handler.js.map