Skip to content

Commit 42c68ac

Browse files
committed
sdk fix for non mcp services
1 parent 0dfb892 commit 42c68ac

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

packages/backend/src/user-router.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,28 @@ export const createUserRouter = () => {
2929
ctx.body = mcpServices.data;
3030
});
3131

32+
router.get('/all-services', async (ctx) => {
33+
const keyData = await validateApiKey(ctx);
34+
if (!keyData) {
35+
ctx.status = 401;
36+
ctx.body = { error: 'Unauthorized' };
37+
return;
38+
}
39+
40+
const services = await supabase
41+
.from('services')
42+
.select('*, endpoints(*)')
43+
.eq('user_id', keyData.user_id);
44+
45+
if (services.error) {
46+
ctx.status = 500;
47+
ctx.body = { error: 'Failed to fetch services' };
48+
return;
49+
}
50+
51+
ctx.status = 200;
52+
ctx.body = services.data;
53+
});
54+
3255
return router;
33-
}
56+
}

packages/js-sdk/src/generators/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export async function generateSDK(userKey: string, baseApiUrl: string, outputDir
1111

1212
const baseUrl = baseApiUrl.replace(/\/api$/, "/");
1313

14-
const response = await fetch(`${baseUrl}/user/mcp-services`, {
14+
const response = await fetch(`${baseUrl}/user/all-services`, {
1515
headers: {
1616
"x-api-key": userKey
1717
}

0 commit comments

Comments
 (0)