mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 09:09:39 +02:00
- 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>
35 lines
1,009 B
TypeScript
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 {}
|