import { asWritingTask } from '../base-application/support/task-type-inference.js';
import { SERVER_MAIN_SRC_DIR, SERVER_TEST_SRC_DIR } from '../generator-constants.js';
import { moveToJavaPackageSrcDir, moveToJavaPackageTestDir } from '../server/support/index.js';
export const files = {
    serverResource: [
        {
            path: `${SERVER_MAIN_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageSrcDir,
            templates: [
                'config/ElasticsearchConfiguration.java',
                'web/rest/errors/ElasticsearchExceptionMapper.java',
                'web/rest/errors/QuerySyntaxException.java',
            ],
        },
        {
            path: `${SERVER_TEST_SRC_DIR}_package_/`,
            renameTo: moveToJavaPackageTestDir,
            templates: [
                'config/ElasticsearchTestConfiguration.java',
                'config/ElasticsearchTestContainer.java',
                'config/EmbeddedElasticsearch.java',
                'web/rest/errors/ElasticsearchExceptionMapperTest.java',
            ],
        },
    ],
};
export default asWritingTask(async function writeElasticsearchFilesTask({ application }) {
    await this.writeFiles({
        sections: files,
        context: application,
    });
});
