import path from 'path';
import { readJSONFile } from '../readers/json-file-reader.js';
import JDLObject from '../models/jdl-object.js';
import { convertEntitiesToJDL } from './pdman-to-jdl-entity-converter.js';
export default {
    convertPdManToJDL,
};
export function convertPdManToJDL(directory = '.', pdManFile = 'pdman.json', output = 'pdman.jdl') {
    return getJDLObjectFromSingleApplication(path.join(directory, pdManFile));
}
function getJDLObjectFromSingleApplication(pdManFile, existingJDLObject = new JDLObject()) {
    const pdManFileContent = readJSONFile(path.join(pdManFile));
    return convertEntitiesToJDL(pdManFileContent);
}
