feat: guard de schemas de tablas en las file tools (redirige a las table tools)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import { z } from "zod";
|
||||
import { handleToolError, validateRequired } from "../helpers/errorHandler.js";
|
||||
import { getCurrentProjectInfo, callLocalFileEndpoint, buildLocalFileErrorResponse } from "./helpers.js";
|
||||
import { isProtectedLayoutPath, buildProtectedLayoutPathError } from "./protectedPaths.js";
|
||||
import {
|
||||
isProtectedLayoutPath,
|
||||
buildProtectedLayoutPathError,
|
||||
isProtectedSchemaPath,
|
||||
buildProtectedSchemaPathError,
|
||||
} from "./protectedPaths.js";
|
||||
|
||||
export function registerAcaiDeleteTool(server) {
|
||||
server.tool(
|
||||
@@ -21,6 +26,10 @@ export function registerAcaiDeleteTool(server) {
|
||||
return buildProtectedLayoutPathError(file_path);
|
||||
}
|
||||
|
||||
if (isProtectedSchemaPath(file_path)) {
|
||||
return buildProtectedSchemaPathError(file_path);
|
||||
}
|
||||
|
||||
const { projectSlug, projectDir } = getCurrentProjectInfo();
|
||||
const result = await callLocalFileEndpoint("POST", "/api/files/delete", {
|
||||
project: projectSlug,
|
||||
|
||||
Reference in New Issue
Block a user