import { DecoratorDriver } from '../../engine/code-writer/drivers/decorator.driver.js';
import { ImportDriver } from '../../engine/code-writer/drivers/import.driver.js';
import { runGraphqlTypes } from '../package-helpers.js';
export default async function install(ctx) {
    await ctx.install(['@microsoft/microsoft-graph-client']);
    // Swap MailerTransportService adapter to MsGraphMailerTransportService
    const mailerModule = ctx.sourceFile('app', 'mailer-transport.module.ts');
    ImportDriver.createImportItems(mailerModule, '@app/modules/ms-email/application/ms-graph-mailer-transport.service', ['MsGraphMailerTransportService']);
    DecoratorDriver.changeModuleDecoratorPropertyAdapter(mailerModule, 'MailerTransportModule', 'Module', 'providers', 'MailerTransportService', 'MsGraphMailerTransportService');
    mailerModule.saveSync();
    await runGraphqlTypes(ctx);
}
