import { captureEvent } from "../../common/analytics/lib.js";
import { printWarningToConsole } from "../../common/output.js";
import { importOpenApi, } from "../../project/import-openapi/handler.js";
export default {
    desc: "Import an OpenAPI file into your Zuplo project",
    command: "import-openapi",
    builder: (yargs) => {
        return yargs
            .option("dir", {
            type: "string",
            describe: "The directory containing your project",
            default: ".",
            normalize: true,
            hidden: true,
        })
            .option("source", {
            type: "string",
            describe: "The OpenAPI file to import",
            conflicts: ["source-url"],
        })
            .option("destination", {
            type: "string",
            describe: "The destination file name. Defaults to the inferred path from the source name",
        })
            .demandOption(["source", "destination"])
            .option("merge-mode", {
            type: "string",
            describe: "The merge mode to use when importing the OpenAPI file",
            choices: ["path-method", "operation-id"],
            default: "path-method",
        });
    },
    handler: async (argv) => {
        printWarningToConsole("⚠️  'zuplo project import-openapi' is deprecated. Use 'zuplo source import-openapi' instead.");
        await captureEvent({
            argv,
            event: "zuplo project import-openapi (deprecated)",
        });
        await importOpenApi(argv);
    },
};
//# sourceMappingURL=import-openapi.js.map