import _ from 'lodash';
import databaseMigrationOption from '../options/database-migration.mjs';
import messageBrokerOption from '../options/message-broker.mjs';
const { upperCase, snakeCase } = _;
const jdlOptions = [databaseMigrationOption, messageBrokerOption];
const applicationConfig = {
    tokenConfigs: jdlOptions.map(option => ({
        name: upperCase(snakeCase(option.name)),
        pattern: option.name,
    })),
    validatorConfig: Object.fromEntries(jdlOptions.map(option => [
        upperCase(snakeCase(option.name)),
        {
            type: option.tokenType,
            pattern: option.tokenValuePattern,
            msg: `${option.name} property`,
        },
    ])),
    optionsValues: Object.fromEntries(jdlOptions.map(option => [option.name, Object.fromEntries(option.knownChoices.map(choice => [choice, choice]))])),
    optionsTypes: Object.fromEntries(jdlOptions.map(option => [
        option.name,
        {
            type: messageBrokerOption.type,
        },
    ])),
};
export default applicationConfig;
