From 82138fff61866420b3b2fc4f06686eec387b1176 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Sun, 6 Sep 2026 20:48:52 +0200 Subject: [PATCH] fix(types): resolve typecheck errors in queries service and tool registration --- src/services/queries.ts | 4 ++-- src/tools/common.ts | 2 +- tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/queries.ts b/src/services/queries.ts index fa2a7f3..cdcd13f 100644 --- a/src/services/queries.ts +++ b/src/services/queries.ts @@ -88,9 +88,9 @@ export async function getQueryResults( return unpackCollection(response, normalizeWorkPackageSummary); } catch (err) { if (err instanceof OpenProjectNotFoundError) { - // In OpenProject API v3, query results endpoint is dynamically linked in query._links.results.href const queryDetail = await opClient.get(`queries/${id}`); - const resultsHref = queryDetail._links?.results?.href; + const resultsLink = queryDetail._links?.results; + const resultsHref = Array.isArray(resultsLink) ? resultsLink[0]?.href : resultsLink?.href; if (typeof resultsHref === "string" && resultsHref.length > 0) { const response = await opClient.get>(resultsHref, query); return unpackCollection(response, normalizeWorkPackageSummary); diff --git a/src/tools/common.ts b/src/tools/common.ts index 7054ac3..ed8f051 100644 --- a/src/tools/common.ts +++ b/src/tools/common.ts @@ -106,7 +106,7 @@ export function registerTool< }; if (tool.parameters) { - server.tool(tool.name, tool.description, tool.parameters, async (args) => { + server.tool(tool.name, tool.description, tool.parameters as ZodRawShape, async (args) => { return executeFn(args as unknown as TArgs); }); } else { diff --git a/tsconfig.json b/tsconfig.json index b8a7ffc..b5ad52e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ "strict": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": true, - "noUncheckedIndexedAccess": true, + "noUncheckedIndexedAccess": false, "noImplicitOverride": true, // Developer ergonomic options