@fastify/reply-from 10.0.0-pre.fv5.2 → 11.0.0
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/package.json +5 -5
- package/types/index.d.ts +4 -3
- package/types/index.test-d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastify/reply-from",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "forward your HTTP request to another server, for fastify",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/fastify/fastify-reply-from#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@fastify/formbody": "^8.0.0
|
|
33
|
-
"@fastify/multipart": "^9.0.0
|
|
32
|
+
"@fastify/formbody": "^8.0.0",
|
|
33
|
+
"@fastify/multipart": "^9.0.0",
|
|
34
34
|
"@fastify/pre-commit": "^2.1.0",
|
|
35
|
-
"@sinonjs/fake-timers": "^
|
|
35
|
+
"@sinonjs/fake-timers": "^13.0.1",
|
|
36
36
|
"@types/node": "^22.0.0",
|
|
37
37
|
"@types/tap": "^15.0.11",
|
|
38
|
-
"fastify": "^5.0.0-alpha.
|
|
38
|
+
"fastify": "^5.0.0-alpha.4",
|
|
39
39
|
"form-data": "^4.0.0",
|
|
40
40
|
"got": "^11.8.6",
|
|
41
41
|
"h2url": "^0.2.0",
|
package/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
RawReplyDefaultExpression,
|
|
9
9
|
RawServerBase,
|
|
10
10
|
RequestGenericInterface,
|
|
11
|
+
RouteGenericInterface
|
|
11
12
|
} from 'fastify';
|
|
12
13
|
|
|
13
14
|
import {
|
|
@@ -50,7 +51,7 @@ declare namespace fastifyReplyFrom {
|
|
|
50
51
|
export type RetryDetails = {
|
|
51
52
|
err: Error;
|
|
52
53
|
req: FastifyRequest<RequestGenericInterface, RawServerBase>;
|
|
53
|
-
res: FastifyReply<RawServerBase>;
|
|
54
|
+
res: FastifyReply<RouteGenericInterface, RawServerBase>;
|
|
54
55
|
attempt: number;
|
|
55
56
|
retriesCount: number;
|
|
56
57
|
getDefaultDelay: () => number | null;
|
|
@@ -62,11 +63,11 @@ declare namespace fastifyReplyFrom {
|
|
|
62
63
|
retriesCount?: number;
|
|
63
64
|
onResponse?: (
|
|
64
65
|
request: FastifyRequest<RequestGenericInterface, RawServerBase>,
|
|
65
|
-
reply: FastifyReply<RawServerBase>,
|
|
66
|
+
reply: FastifyReply<RouteGenericInterface, RawServerBase>,
|
|
66
67
|
res: RawReplyDefaultExpression<RawServerBase>
|
|
67
68
|
) => void;
|
|
68
69
|
onError?: (
|
|
69
|
-
reply: FastifyReply<RawServerBase>,
|
|
70
|
+
reply: FastifyReply<RouteGenericInterface, RawServerBase>,
|
|
70
71
|
error: { error: Error }
|
|
71
72
|
) => void;
|
|
72
73
|
body?: unknown;
|
package/types/index.test-d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fastify, { FastifyReply, FastifyRequest, RawReplyDefaultExpression, RawServerBase, RequestGenericInterface } from "fastify";
|
|
1
|
+
import fastify, { FastifyReply, FastifyRequest, RawReplyDefaultExpression, RawServerBase, RequestGenericInterface, RouteGenericInterface } from "fastify";
|
|
2
2
|
import * as http from 'http';
|
|
3
3
|
import { IncomingHttpHeaders } from "http2";
|
|
4
4
|
import * as https from 'https';
|
|
@@ -80,7 +80,7 @@ async function main() {
|
|
|
80
80
|
},
|
|
81
81
|
onResponse(request, reply, res) {
|
|
82
82
|
expectType<FastifyRequest<RequestGenericInterface, RawServerBase>>(request);
|
|
83
|
-
expectType<FastifyReply<RawServerBase>>(reply);
|
|
83
|
+
expectType<FastifyReply<RouteGenericInterface, RawServerBase>>(reply);
|
|
84
84
|
expectType<RawReplyDefaultExpression<RawServerBase>>(res);
|
|
85
85
|
expectType<number>(res.statusCode);
|
|
86
86
|
}
|
|
@@ -119,7 +119,7 @@ async function main() {
|
|
|
119
119
|
getUpstream(req, base) {
|
|
120
120
|
return base;
|
|
121
121
|
},
|
|
122
|
-
onError(reply: FastifyReply<RawServerBase>, error) {
|
|
122
|
+
onError(reply: FastifyReply<RouteGenericInterface, RawServerBase>, error) {
|
|
123
123
|
return reply.send(error.error);
|
|
124
124
|
},
|
|
125
125
|
queryString(search, reqUrl, request) {
|