Merge branch 'main' into ihrpr/http-streamable-server
This commit is contained in:
commit
873f51f4ac
1 changed files with 420 additions and 41 deletions
|
|
@ -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 }),
|
||||
|
|
|
|||
Loading…
Reference in a new issue