MCPcopy Create free account
hub / github.com/bytebase/dbhub / listSources

Function listSources

src/api/sources.ts:80–97  ·  view source on GitHub ↗
(req: Request, res: Response)

Source from the content-addressed store, hash-verified

78 * List all data sources
79 */
80export 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

Callers

nothing calls this directly

Calls 2

transformSourceConfigFunction · 0.85
getAllSourceConfigsMethod · 0.80

Tested by

no test coverage detected