Update client and server convenience methods

This commit is contained in:
Justin Spahr-Summers 2024-11-06 11:46:55 +00:00
commit 099c2e2be3
No known key found for this signature in database

View file

@ -23,6 +23,8 @@ import {
EmptyResultSchema,
LoggingMessageNotification,
ResourceUpdatedNotification,
ListRootsRequest,
ListRootsResultSchema,
} from "../types.js";
/**
@ -154,6 +156,17 @@ export class Server<
);
}
async listRoots(
params?: ListRootsRequest["params"],
onprogress?: ProgressCallback,
) {
return this.request(
{ method: "roots/list", params },
ListRootsResultSchema,
onprogress,
);
}
async sendLoggingMessage(params: LoggingMessageNotification["params"]) {
return this.notification({ method: "notifications/message", params });
}