Merge branch 'main' into ihrpr/http-streamable-server

This commit is contained in:
ihrpr 2025-04-06 17:39:40 +01:00
commit 873f51f4ac
No known key found for this signature in database

View file

@ -111,10 +111,15 @@ export type RequestHandlerExtra<SendRequestT extends Request,
sessionId?: string;
/**
* Sends a notification that relates to the current request being handled.
*
* This is used by certain transports to correctly associate related messages.
* The authenticated user, if available.
*/
user?: unknown;
/**
* Sends a notification that relates to the current request being handled.
*
* This is used by certain transports to correctly associate related messages.
*/
sendNotification: (notification: SendNotificationT) => Promise<void>;
/**
@ -349,6 +354,7 @@ export abstract class Protocol<
const extra: RequestHandlerExtra<SendRequestT, SendNotificationT> = {
signal: abortController.signal,
sessionId: this._transport?.sessionId,
user: this._transport?.user,
sendNotification:
(notification) =>
this.notification(notification, { relatedRequestId: request.id }),