Skip to content

Commit 6c3dd71

Browse files
committed
fix(gateway): align access type with SDK typings
Introduce a typed alias for the HTTP access type to satisfy current CloudBase SDK type constraints while still passing the correct runtime value. Made-with: Cursor
1 parent cadacf9 commit 6c3dd71

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mcp/src/tools/gateway.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ export function registerGatewayTools(server: ExtendedMcpServer) {
5151

5252
const accessType = type === "HTTP" ? 6 : 1;
5353

54+
const typedAccessType = accessType as unknown as 1 | 2 | undefined;
55+
5456
const result = await cloudbase.access.createAccess({
55-
type: accessType as 1 | 6,
57+
// Backend accepts HTTP function type 6, but current SDK typing only exposes 1 | 2.
58+
// We keep the runtime value in accessType and satisfy TypeScript with a narrowed alias.
59+
type: typedAccessType,
5660
name,
5761
path: normalizedPath,
5862
});

0 commit comments

Comments
 (0)