@fastify/reply-from 8.2.1 → 8.3.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/.github/workflows/ci.yml +1 -0
- package/.taprc +3 -0
- package/README.md +2 -2
- package/{example.js → examples/example.js} +1 -1
- package/index.js +1 -1
- package/lib/request.js +0 -4
- package/package.json +12 -12
- package/{index.d.ts → types/index.d.ts} +1 -4
- package/{test → types}/index.test-d.ts +1 -1
package/.github/workflows/ci.yml
CHANGED
package/.taprc
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @fastify/reply-from
|
|
2
2
|
|
|
3
|
-
](https://github.com/fastify/reply-fro/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@fastify/reply-from)
|
|
5
5
|
[](https://standardjs.com/)
|
|
6
6
|
|
|
@@ -115,7 +115,7 @@ proxy.register(require('@fastify/reply-from'), {
|
|
|
115
115
|
|
|
116
116
|
#### `http`
|
|
117
117
|
|
|
118
|
-
Set the `http` option to
|
|
118
|
+
Set the `http` option to an Object to use
|
|
119
119
|
Node's [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback)
|
|
120
120
|
will be used if you do not enable [`http2`](#http2). To customize the `request`,
|
|
121
121
|
you can pass in [`agentOptions`](https://nodejs.org/api/http.html#http_new_agent_options) and
|
package/index.js
CHANGED
package/lib/request.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
const semver = require('semver')
|
|
3
2
|
const http = require('http')
|
|
4
3
|
const https = require('https')
|
|
5
4
|
const querystring = require('querystring')
|
|
@@ -48,9 +47,6 @@ function buildRequest (opts) {
|
|
|
48
47
|
let agents
|
|
49
48
|
|
|
50
49
|
if (isHttp2) {
|
|
51
|
-
if (semver.lt(process.version, '9.0.0')) {
|
|
52
|
-
throw new Error('Http2 support requires Node version >= 9.0.0')
|
|
53
|
-
}
|
|
54
50
|
if (!opts.base) throw new Error('Option base is required when http2 is true')
|
|
55
51
|
if (opts.base.startsWith('unix+')) {
|
|
56
52
|
throw new Error('Unix socket destination is not supported when http2 is true')
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastify/reply-from",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "forward your HTTP request to another server, for fastify",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"lint": "standard | snazzy",
|
|
9
9
|
"lint:fix": "standard --fix",
|
|
10
|
-
"test": "
|
|
11
|
-
"test:
|
|
12
|
-
"typescript": "tsd"
|
|
10
|
+
"test": "npm run test:unit && npm run test:typescript",
|
|
11
|
+
"test:unit": "tap",
|
|
12
|
+
"test:typescript": "tsd"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
"split2": "^4.1.0",
|
|
47
47
|
"standard": "^17.0.0",
|
|
48
48
|
"tap": "^16.2.0",
|
|
49
|
-
"tsd": "^0.
|
|
50
|
-
"typescript": "^4.7.3"
|
|
49
|
+
"tsd": "^0.23.0"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
52
|
"@fastify/error": "^3.0.0",
|
|
54
53
|
"end-of-stream": "^1.4.4",
|
|
54
|
+
"fast-querystring": "^1.0.0",
|
|
55
55
|
"fastify-plugin": "^4.0.0",
|
|
56
56
|
"pump": "^3.0.0",
|
|
57
|
-
"semver": "^7.3.7",
|
|
58
57
|
"tiny-lru": "^8.0.2",
|
|
59
58
|
"undici": "^5.5.1"
|
|
60
59
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
60
|
+
"pre-commit": [
|
|
61
|
+
"lint",
|
|
62
|
+
"test"
|
|
63
|
+
],
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
RawServerBase,
|
|
8
8
|
RequestGenericInterface,
|
|
9
9
|
HTTPMethods,
|
|
10
|
-
FastifyPluginAsync,
|
|
11
10
|
FastifyPluginCallback,
|
|
12
11
|
} from 'fastify';
|
|
13
12
|
|
|
@@ -94,7 +93,5 @@ export interface FastifyReplyFromOptions {
|
|
|
94
93
|
disableRequestLogging?: boolean;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
|
-
declare const fastifyReplyFrom:
|
|
98
|
-
| FastifyPluginCallback<FastifyReplyFromOptions>
|
|
99
|
-
| FastifyPluginAsync<FastifyReplyFromOptions>;
|
|
96
|
+
declare const fastifyReplyFrom: FastifyPluginCallback<FastifyReplyFromOptions>;
|
|
100
97
|
export default fastifyReplyFrom;
|