clean up tests - remove mockRequestInfo
This commit is contained in:
parent
166da76b00
commit
606c278668
1 changed files with 47 additions and 73 deletions
31
src/types.ts
31
src/types.ts
|
|
@ -1,4 +1,5 @@
|
|||
import { z, ZodTypeAny } from "zod";
|
||||
import { AuthInfo } from "./server/auth/types.js";
|
||||
|
||||
export const LATEST_PROTOCOL_VERSION = "2025-06-18";
|
||||
export const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
||||
|
|
@ -1463,6 +1464,36 @@ type Flatten<T> = T extends Primitive
|
|||
|
||||
type Infer<Schema extends ZodTypeAny> = Flatten<z.infer<Schema>>;
|
||||
|
||||
/**
|
||||
* Headers that are compatible with both Node.js and the browser.
|
||||
*/
|
||||
export type IsomorphicHeaders = Record<string, string | string[] | undefined>;
|
||||
|
||||
/**
|
||||
* Information about the incoming request.
|
||||
*/
|
||||
export interface RequestInfo {
|
||||
/**
|
||||
* The headers of the request.
|
||||
*/
|
||||
headers: IsomorphicHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra information about a message.
|
||||
*/
|
||||
export interface MessageExtraInfo {
|
||||
/**
|
||||
* The request information.
|
||||
*/
|
||||
requestInfo?: RequestInfo;
|
||||
|
||||
/**
|
||||
* The authentication information.
|
||||
*/
|
||||
authInfo?: AuthInfo;
|
||||
}
|
||||
|
||||
/* JSON-RPC types */
|
||||
export type ProgressToken = Infer<typeof ProgressTokenSchema>;
|
||||
export type Cursor = Infer<typeof CursorSchema>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue