import { request } from '../utils/apiUtils' ; import { EmailTemplate } from '@commun/emails' ; import { AuthProvider } from '@commun/users' ; export const PluginService = { async getPlugins ( ) { return request ( 'GET' , '/admin/plugins' ) ; } , async getPlugin < T > ( pluginName ) { return request ( 'GET' , `/admin/plugins/${ pluginName }` ) ; } , async updatePlugin < T > ( pluginName , data ) { return request ( 'PUT' , `/admin/plugins/${ pluginName }` , data ) ; } , async createEmailTemplate ( templateName , template ) { return request ( 'POST' , `/admin/plugins/emails/templates` , { ... template , templateName , } ) ; } , async updateEmailTemplate ( templateName , template ) { return request ( 'PUT' , `/admin/plugins/emails/templates/${ templateName }` , template ) ; } , async deleteEmailTemplate ( templateName ) { return request ( 'DELETE' , `/admin/plugins/emails/templates/${ templateName }` ) ; } , async updateSocialLoginCredentials ( provider , data ) { return request ( 'PUT' , `/admin/plugins/users/credentials/${ provider }` , data ) ; } , } ;