fix(types): resolve typecheck errors in queries service and tool registration
This commit is contained in:
1 parent
51c92ea927
commit
82138fff61
3 files changed
+4
-4
No files matched your search
@@ -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<HalResource>(`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<HalCollection<HalResource>>(resultsHref, query);
|
||||
return unpackCollection(response, normalizeWorkPackageSummary);
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user