import JDLObject from '../core/models/jdl-object.js';
import { createJDLApplication } from '../core/models/jdl-application-factory.js';
const GENERATOR_NAME = 'generator-begcode';
export function convertApplicationsToJDL({ applications, jdl }, runtime) {
    const jsonApplications = applications || [];
    const jdlObject = jdl || new JDLObject();
    jsonApplications.forEach((application) => {
        const convertedApplication = convertApplicationToJDL({ application }, runtime);
        jdlObject.addApplication(convertedApplication);
    });
    return jdlObject;
}
export function convertApplicationToJDL({ application } = {}, runtime) {
    return createJDLApplication(application[GENERATOR_NAME], undefined, runtime);
}
