managarten/services/matrix-calendar-bot/src/bot/bot.module.ts
Till-JS 2777f604fd feat(bots): enable Redis SSO for todo-bot and calendar-bot
- Activate Redis session storage in both bots for cross-bot SSO
- Update SessionHelper to async methods for Redis-backed SessionService
- Fix async/await issues in todo-bot and calendar-bot matrix.service.ts
- Remove unused imports from calendar-api and todo-api services
- Add CALENDAR_BACKEND_URL and MANA_CORE_SERVICE_KEY to .env.development

Note: SessionService methods are now async (Redis-backed). Other bots
need their matrix.service.ts updated to await these async calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 14:51:23 +01:00

35 lines
1,009 B
TypeScript

import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { MatrixService } from './matrix.service';
import { CalendarModule } from '../calendar/calendar.module';
import {
TranscriptionModule,
SessionModule,
CreditModule,
CalendarApiService,
} from '@manacore/bot-services';
// Factory provider for CalendarApiService
const calendarApiServiceProvider = {
provide: CalendarApiService,
useFactory: (configService: ConfigService) => {
const baseUrl = configService.get<string>('CALENDAR_BACKEND_URL', 'http://localhost:3014');
return new CalendarApiService(baseUrl);
},
inject: [ConfigService],
};
@Module({
imports: [
ConfigModule,
CalendarModule,
TranscriptionModule.register({
sttUrl: process.env.STT_URL || 'http://localhost:3020',
}),
SessionModule.forRoot({ storageMode: 'redis' }),
CreditModule.forRoot(),
],
providers: [MatrixService, calendarApiServiceProvider],
exports: [MatrixService],
})
export class BotModule {}