"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runWorkflowCreateCommand = runWorkflowCreateCommand;
const workflow_template_authoring_1 = require("./workflow-template-authoring");
const workflow_template_mutation_1 = require("./workflow-template-mutation");
async function runWorkflowCreateCommand(cwd, args, locale, deps = {}) {
    return (0, workflow_template_mutation_1.runWorkflowTemplateMutationCommand)({
        cwd,
        locale,
        command: "create",
        args,
        validateInitialCatalog: true,
        ...(deps.homeDirectory !== undefined
            ? { homeDirectory: deps.homeDirectory }
            : {}),
        resolveDraft: async ({ config, catalog }, mutationArgs) => {
            return (0, workflow_template_authoring_1.resolveWorkflowTemplateCreateDraft)({
                cwd,
                catalog,
                config,
                args: mutationArgs,
                locale,
            });
        },
    });
}
