From 7d50d8ca16a8873719089f6102a16e0b258a38a8 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Sat, 16 Nov 2024 15:59:03 +0000 Subject: [PATCH] Add missing `options` to request methods --- src/client/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/index.ts b/src/client/index.ts index 2c08bcc0..1ad51616 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -278,8 +278,8 @@ export class Client< } } - async ping() { - return this.request({ method: "ping" }, EmptyResultSchema); + async ping(options?: RequestOptions) { + return this.request({ method: "ping" }, EmptyResultSchema, options); } async complete(params: CompleteRequest["params"], options?: RequestOptions) { @@ -290,10 +290,11 @@ export class Client< ); } - async setLoggingLevel(level: LoggingLevel) { + async setLoggingLevel(level: LoggingLevel, options?: RequestOptions) { return this.request( { method: "logging/setLevel", params: { level } }, EmptyResultSchema, + options, ); } @@ -352,17 +353,25 @@ export class Client< ); } - async subscribeResource(params: SubscribeRequest["params"]) { + async subscribeResource( + params: SubscribeRequest["params"], + options?: RequestOptions, + ) { return this.request( { method: "resources/subscribe", params }, EmptyResultSchema, + options, ); } - async unsubscribeResource(params: UnsubscribeRequest["params"]) { + async unsubscribeResource( + params: UnsubscribeRequest["params"], + options?: RequestOptions, + ) { return this.request( { method: "resources/unsubscribe", params }, EmptyResultSchema, + options, ); }