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 === 'shopify'
                ? {
                    ...serviceConfig,
                    options: { ...serviceConfig.options, legacyApp: true }
                }
                : serviceConfig)
        };
    }
    return projectSchema;
}
const migrate = async (_, projectSchema) => {
    return {
        ...updateGenericServices(projectSchema),
        schemaVersion: '3.20.0'
    };
};
export default migrate;
