import path from 'path';
import { readFileSync } from 'fs';
import JDLObject from '../core/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 = JSON.parse(readFileSync(path.join(pdManFile), 'utf-8').toString());
    return convertEntitiesToJDL(pdManFileContent);
}
