import mapValues from 'lodash/mapValues.js';
function updateGenericServices(projectSchema) {
    if (projectSchema.services) {
        return {
            ...projectSchema,
            services: mapValues(projectSchema.services, (serviceConfig) => 
            // generic provider has been renamed to match service type
            serviceConfig.provider === 'generic' ? { ...serviceConfig, provider: serviceConfig.serviceType } : serviceConfig)
        };
    }
    return projectSchema;
}
const migrate = async (_, projectSchema) => {
    return {
        ...updateGenericServices(projectSchema),
        schemaVersion: '3.18.2'
    };
};
export default migrate;
