"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAdditionalApiFiles = void 0;
const path = require("node:path");
const config_1 = require("../../config");
const utils_1 = require("../../utils");
const types_1 = require("../../types");
const generateAdditionalApiFiles = async (generateCommandState) => {
    for (const additionalApi of generateCommandState.schema.additionalApis) {
        // create module files
        utils_1.TemplateGenerator.generateStaticContents(generateCommandState.command, types_1.TemplateElement.BACK_ADDITIONAL_API, path.join('src', config_1.cliterConfig.apiContainer), // relativeTargetBasePath,
        generateCommandState.schema.boundedContextName.toLowerCase().toKebabCase(), // relativeTargetPath,
        {
            boundedContextName: generateCommandState.schema.boundedContextName,
            moduleName: generateCommandState.schema.moduleName,
            moduleNames: generateCommandState.schema.moduleNames,
            force: generateCommandState.flags.force,
            verbose: generateCommandState.flags.verbose,
            excludeFiles: generateCommandState.schema.excluded,
            lockFiles: generateCommandState.lockFiles,
            additionalApi,
            templateData: {
                ...generateCommandState,
                resolverType: types_1.ResolverType,
                currentAdditionalApi: additionalApi,
            },
        });
    }
};
exports.generateAdditionalApiFiles = generateAdditionalApiFiles;
