-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4692c0
commit 0ff1140
Showing
6 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
// @ts-nocheck | ||
/// <reference types="node" /> | ||
export type { SessionRequest } from "./framework"; | ||
export declare const plugin: import("fastify").FastifyPluginCallback< | ||
Record<never, never>, | ||
import("fastify").RawServerDefault | ||
>; | ||
export declare const plugin: import("./types").FastifyPluginCallback; | ||
export declare const errorHandler: () => ( | ||
err: any, | ||
req: import("fastify").FastifyRequest< | ||
import("fastify/types/route").RouteGenericInterface, | ||
import("fastify").RawServerDefault, | ||
import("http").IncomingMessage | ||
>, | ||
res: import("fastify").FastifyReply< | ||
import("fastify").RawServerDefault, | ||
import("http").IncomingMessage, | ||
import("http").ServerResponse<import("http").IncomingMessage>, | ||
import("fastify/types/route").RouteGenericInterface, | ||
unknown | ||
> | ||
req: import("./types").FastifyRequest, | ||
res: import("./types").FastifyReply | ||
) => Promise<void>; | ||
export declare const wrapRequest: (unwrapped: any) => import("..").BaseRequest; | ||
export declare const wrapResponse: (unwrapped: any) => import("..").BaseResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// @ts-nocheck | ||
/** | ||
* Define fastify types based on the parts that are used in the codebase. | ||
*/ | ||
export interface FastifyRequest { | ||
body: any; | ||
query: Record<string, string | string[] | undefined>; | ||
headers: Record<string, string | string[] | undefined>; | ||
method: string; | ||
url: string; | ||
} | ||
export interface FastifyReply { | ||
sent: boolean; | ||
statusCode: number; | ||
getHeaders(): Record<string, number | string | string[] | undefined>; | ||
send(payload?: any): FastifyReply; | ||
header(key: any, value: any): FastifyReply; | ||
removeHeader(key: any): FastifyReply; | ||
getHeader(key: any): number | string | string[] | undefined; | ||
type(contentType: string): FastifyReply; | ||
} | ||
export interface FastifyInstance { | ||
addHook(name: string, hook: (req: FastifyRequest, reply: FastifyReply) => void): FastifyInstance; | ||
} | ||
export declare type FastifyPluginCallback = (instance: FastifyInstance, opts: any, done: (err?: Error) => void) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"use strict"; | ||
/** | ||
* Define fastify types based on the parts that are used in the codebase. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// @ts-nocheck | ||
import { VerifySessionOptions } from ".."; | ||
import { SessionRequest } from "../../../framework/fastify/framework"; | ||
import { FastifyReply, FastifyRequest as OriginalFastifyRequest } from "fastify"; | ||
import { FastifyReply, FastifyRequest as OriginalFastifyRequest } from "../../../framework/fastify/types"; | ||
export declare function verifySession<TRequest extends OriginalFastifyRequest = OriginalFastifyRequest>( | ||
options?: VerifySessionOptions | ||
): (req: SessionRequest<TRequest>, res: FastifyReply) => Promise<void>; |