| 37 | |
| 38 | @OpenAPIController |
| 39 | export class HTTPAPIService implements IWebhookNotifier { |
| 40 | private server?: HTTPServerLike; |
| 41 | private plugin: TaskNotesPlugin; |
| 42 | private router: APIRouter; |
| 43 | private tasksController: TasksController; |
| 44 | private timeTrackingController: TimeTrackingController; |
| 45 | private pomodoroController: PomodoroController; |
| 46 | private systemController: SystemController; |
| 47 | private webhookController: WebhookController; |
| 48 | private calendarsController: CalendarsController; |
| 49 | private basesController: BasesController; |
| 50 | private mcpService?: MCPService; |
| 51 | |
| 52 | constructor( |
| 53 | plugin: TaskNotesPlugin, |
| 54 | taskService: TaskService, |
| 55 | filterService: FilterService, |
| 56 | cacheManager: TaskManager |
| 57 | ) { |
| 58 | this.plugin = plugin; |
| 59 | |
| 60 | // Initialize dependencies |
| 61 | const nlParser = NaturalLanguageParser.fromPlugin(plugin); |
| 62 | const statusManager = new StatusManager( |
| 63 | plugin.settings.customStatuses, |
| 64 | plugin.settings.defaultTaskStatus |
| 65 | ); |
| 66 | const taskStatsService = new TaskStatsService(cacheManager, statusManager); |
| 67 | |
| 68 | // Initialize controllers |
| 69 | this.webhookController = new WebhookController(plugin); |
| 70 | this.tasksController = new TasksController( |
| 71 | plugin, |
| 72 | taskService, |
| 73 | filterService, |
| 74 | cacheManager, |
| 75 | taskStatsService |
| 76 | ); |
| 77 | this.timeTrackingController = new TimeTrackingController( |
| 78 | plugin, |
| 79 | taskService, |
| 80 | cacheManager, |
| 81 | statusManager |
| 82 | ); |
| 83 | this.pomodoroController = new PomodoroController(plugin, cacheManager); |
| 84 | this.systemController = new SystemController(plugin, taskService, nlParser, this); |
| 85 | this.calendarsController = new CalendarsController( |
| 86 | plugin, |
| 87 | plugin.oauthService, |
| 88 | plugin.icsSubscriptionService, |
| 89 | plugin.calendarProviderRegistry |
| 90 | ); |
| 91 | this.basesController = new BasesController(plugin); |
| 92 | |
| 93 | // Initialize MCP service if enabled |
| 94 | if (plugin.settings.enableMCP) { |
| 95 | this.mcpService = new MCPService( |
| 96 | plugin, |
nothing calls this directly
no outgoing calls
no test coverage detected