fix(api): document folder routes in OpenAPI

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-07-15 17:13:24 +00:00
1 parent ec1ff2df01
commit db41261452
2 files changed
+59

No files matched your search

@@ -30,6 +30,7 @@ const apiPrefixes: Record<string, string> = {
"environments.ts": "/api",
"execution-workspaces.ts": "/api",
"file-resources.ts": "/api",
"folders.ts": "/api",
"goals.ts": "/api",
"health.ts": "/api/health",
"inbox-dismissals.ts": "/api",
@@ -171,6 +172,10 @@ describe("openapi routes", () => {
name: { type: "string" },
},
});
expect(res.body.paths["/api/companies/{companyId}/folders"].post.responses["201"]).toBeDefined();
expect(res.body.paths["/api/companies/{companyId}/folders/items/move"].post.summary).toBe(
"Move an item into or out of a folder",
);
expect(JSON.stringify(res.body.paths["/api/tool-gateway/tools"].get)).not.toContain("sessionToken");
expect(JSON.stringify(res.body.paths["/api/tool-gateway/tools/call"].post)).not.toContain("sessionToken");
});
+54
View File
@@ -47,6 +47,12 @@ import {
updateRoutineTriggerSchema,
rotateRoutineTriggerSecretSchema,
runRoutineSchema,
// Folders
createFolderSchema,
folderKindSchema,
moveFolderItemSchema,
moveFolderSchema,
updateFolderSchema,
// Goal
createGoalSchema,
updateGoalSchema,
@@ -861,6 +867,7 @@ const CREATED_OPERATIONS = new Set([
"POST /api/companies/{companyId}/projects",
"POST /api/projects/{id}/workspaces",
"POST /api/companies/{companyId}/routines",
"POST /api/companies/{companyId}/folders",
"POST /api/routines/{id}/triggers",
"POST /api/companies/{companyId}/secrets",
"POST /api/companies/{companyId}/user-secret-definitions",
@@ -5151,6 +5158,53 @@ for (const route of [
});
}
registerCurrentRoute({
method: "get",
path: "/api/companies/{companyId}/folders",
tags: ["folders"],
summary: "List folders for a company item kind",
query: z.object({ kind: folderKindSchema }),
});
registerCurrentRoute({
method: "post",
path: "/api/companies/{companyId}/folders",
tags: ["folders"],
summary: "Create a folder",
body: createFolderSchema,
});
registerCurrentRoute({
method: "patch",
path: "/api/companies/{companyId}/folders/{folderId}",
tags: ["folders"],
summary: "Update a folder",
body: updateFolderSchema,
});
registerCurrentRoute({
method: "post",
path: "/api/companies/{companyId}/folders/items/move",
tags: ["folders"],
summary: "Move an item into or out of a folder",
body: moveFolderItemSchema,
});
registerCurrentRoute({
method: "post",
path: "/api/companies/{companyId}/folders/{folderId}/move",
tags: ["folders"],
summary: "Reorder a folder",
body: moveFolderSchema,
});
registerCurrentRoute({
method: "delete",
path: "/api/companies/{companyId}/folders/{folderId}",
tags: ["folders"],
summary: "Delete a folder",
});
registerCurrentRoute({
method: "get",
path: "/api/issues/{id}/cost-summary",