diff --git a/server/src/__tests__/openapi-routes.test.ts b/server/src/__tests__/openapi-routes.test.ts index 729b5f4af40..9263c0ba753 100644 --- a/server/src/__tests__/openapi-routes.test.ts +++ b/server/src/__tests__/openapi-routes.test.ts @@ -227,6 +227,22 @@ function loadSpecRoutes() { } describe("openapi routes", () => { + it("documents board-only pool management with revision-checked deletion", () => { + const { spec } = loadSpecRoutes(); + const pools = spec.paths["/api/companies/{companyId}/ai-connection-pools"]; + const remove = spec.paths["/api/companies/{companyId}/ai-connection-pools/{poolId}"].delete; + const inspection = spec.paths["/api/companies/{companyId}/ai-connection-pools/{poolId}/inspection"].get; + for (const operation of [pools.get, pools.post, remove, inspection]) { + expect(operation.security).toEqual([{ BoardSessionAuth: [] }, { BoardApiKeyAuth: [] }]); + } + expect(remove.requestBody.required).toBe(true); + expect(remove.requestBody.content["application/json"].schema).toMatchObject({ + required: ["expectedRevision"], additionalProperties: false, + properties: { expectedRevision: { type: "integer", minimum: 0, exclusiveMinimum: true } }, + }); + expect(Object.keys(remove.responses)).toEqual(expect.arrayContaining(["200", "400", "401", "403", "404", "409"])); + }); + it("documents personal board-only announcements and private responses", () => { const { spec } = loadSpecRoutes(); const current = spec.paths["/api/announcements/current"].get; diff --git a/server/src/routes/openapi.ts b/server/src/routes/openapi.ts index 77ab6b96431..9036df170b2 100644 --- a/server/src/routes/openapi.ts +++ b/server/src/routes/openapi.ts @@ -1352,6 +1352,10 @@ const BOARD_ONLY_OPERATIONS = new Set([ "GET /api/companies/{companyId}/ai-connections/{connectionId}/active-runs", "GET /api/companies/{companyId}/ai-connections/{connectionId}/usage", "GET /api/companies/{companyId}/ai-connections/login/{sessionId}", + "GET /api/companies/{companyId}/ai-connection-pools", + "POST /api/companies/{companyId}/ai-connection-pools", + "DELETE /api/companies/{companyId}/ai-connection-pools/{poolId}", + "GET /api/companies/{companyId}/ai-connection-pools/{poolId}/inspection", "GET /api/companies/{companyId}/project-repositories", "PUT /api/projects/{id}/repositories",