fastify 4.23.1 → 4.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fastify.js +1 -1
- package/package.json +1 -1
- package/test/types/request.test-d.ts +1 -0
- package/types/request.d.ts +12 -11
package/fastify.js
CHANGED
package/package.json
CHANGED
|
@@ -81,6 +81,7 @@ const getHandler: RouteHandler = function (request, _reply) {
|
|
|
81
81
|
expectType<FastifyContext<ContextConfigDefault>['config']>(request.routeOptions.config)
|
|
82
82
|
expectType<ContextConfigDefault & FastifyRouteConfig & FastifyContextConfig>(request.routeOptions.config)
|
|
83
83
|
expectType<FastifySchema>(request.routeSchema)
|
|
84
|
+
expectType<FastifySchema>(request.routeOptions.schema)
|
|
84
85
|
|
|
85
86
|
expectType<RequestHeadersDefault & RawRequestDefaultExpression['headers']>(request.headers)
|
|
86
87
|
request.headers = {}
|
package/types/request.d.ts
CHANGED
|
@@ -20,16 +20,17 @@ export interface ValidationFunction {
|
|
|
20
20
|
errors?: null | ErrorObject[];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export interface RequestRouteOptions<ContextConfig = ContextConfigDefault> {
|
|
24
|
-
method: string
|
|
25
|
-
url: string
|
|
26
|
-
bodyLimit:number
|
|
27
|
-
attachValidation:boolean
|
|
28
|
-
logLevel:string
|
|
29
|
-
version: string | undefined
|
|
30
|
-
exposeHeadRoute: boolean
|
|
31
|
-
prefixTrailingSlash: string
|
|
32
|
-
config: FastifyContextConfig & FastifyRouteConfig & ContextConfig
|
|
23
|
+
export interface RequestRouteOptions<ContextConfig = ContextConfigDefault, SchemaCompiler = FastifySchema> {
|
|
24
|
+
method: string;
|
|
25
|
+
url: string;
|
|
26
|
+
bodyLimit:number;
|
|
27
|
+
attachValidation:boolean;
|
|
28
|
+
logLevel:string;
|
|
29
|
+
version: string | undefined;
|
|
30
|
+
exposeHeadRoute: boolean;
|
|
31
|
+
prefixTrailingSlash: string;
|
|
32
|
+
config: FastifyContextConfig & FastifyRouteConfig & ContextConfig;
|
|
33
|
+
schema: SchemaCompiler;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -79,7 +80,7 @@ export interface FastifyRequest<RouteGeneric extends RouteGenericInterface = Rou
|
|
|
79
80
|
readonly method: string;
|
|
80
81
|
readonly routerPath: string;
|
|
81
82
|
readonly routerMethod: string;
|
|
82
|
-
readonly routeOptions: Readonly<RequestRouteOptions<ContextConfig>>
|
|
83
|
+
readonly routeOptions: Readonly<RequestRouteOptions<ContextConfig, SchemaCompiler>>
|
|
83
84
|
readonly is404: boolean;
|
|
84
85
|
readonly socket: RawRequest['socket'];
|
|
85
86
|
|