(req: Request, res: Response)
| 78 | * List all data sources |
| 79 | */ |
| 80 | export function listSources(req: Request, res: Response): void { |
| 81 | try { |
| 82 | const sourceConfigs = ConnectorManager.getAllSourceConfigs(); |
| 83 | |
| 84 | // Transform configs to API response format |
| 85 | const sources: DataSource[] = sourceConfigs.map((config) => { |
| 86 | return transformSourceConfig(config); |
| 87 | }); |
| 88 | |
| 89 | res.json(sources); |
| 90 | } catch (error) { |
| 91 | console.error("Error listing sources:", error); |
| 92 | const errorResponse: ErrorResponse = { |
| 93 | error: error instanceof Error ? error.message : "Internal server error", |
| 94 | }; |
| 95 | res.status(500).json(errorResponse); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * GET /api/sources/:sourceId |
nothing calls this directly
no test coverage detected