@nestjs/platform-fastify 8.2.6 → 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/Readme.md +6 -1
- package/adapters/fastify-adapter.js +9 -7
- package/adapters/index.js +1 -1
- package/index.js +2 -2
- package/interfaces/external/index.js +2 -2
- package/interfaces/index.js +1 -1
- package/package.json +4 -4
package/Readme.md
CHANGED
|
@@ -84,7 +84,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
84
84
|
<a href="https://www.myleodsc.com/" target="_blank"><img src="https://nestjs.com/img/myleo-logo.png" width="180" valign="middle" /></td><td>
|
|
85
85
|
<a href="https://careers.meetdandy.com/?gh_src=063ba61e3us" target="_blank"><img src="https://nestjs.com/img/dandy-roles-logo.svg" width="150" valign="middle" /></td><td>
|
|
86
86
|
<a href="https://www.castlecraft.in" target="_blank"><img src="https://nestjs.com/img/castlecraft-logo.png" width="150" valign="middle" /></td>
|
|
87
|
-
<td><a href="https://www.tinystacks.com" target="_blank"><img src="https://nestjs.com/img/tinystacks-logo.png#1" width="140" valign="middle" /></td
|
|
87
|
+
<td><a href="https://www.tinystacks.com" target="_blank"><img src="https://nestjs.com/img/tinystacks-logo.png#1" width="140" valign="middle" /></td>
|
|
88
|
+
<td><a href="https://n.inc" target="_blank"><img src="https://nestjs.com/img/n-inc-logo.svg" width="120" valign="middle" /></td></tr></table>
|
|
88
89
|
|
|
89
90
|
#### Sponsors
|
|
90
91
|
|
|
@@ -118,6 +119,10 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
118
119
|
<td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/naologic-logo.svg" width="125" valign="middle" /></a></td>
|
|
119
120
|
<td align="center" valign="middle"><a href="https://messaged.com/" target="_blank"><img src="https://nestjs.com/img/messaged-logo.png" width="50" valign="middle" /></a></td>
|
|
120
121
|
<td align="center" valign="middle"><a href="https://triplecore.io" target="_blank"><img src="https://nestjs.com/img/triplecore-logo.svg" width="50" valign="middle" /></a></td>
|
|
122
|
+
<td align="center" valign="middle"><a href="https://klqc.de" target="_blank"><img src="https://nestjs.com/img/klcqcl-logo.png" width="120" valign="middle" /></a></td>
|
|
123
|
+
<td align="center" valign="middle"><a href="https://thecasinowizard.com/bonuses/no-deposit-bonuses/" target="_blank"><img src="https://nestjs.com/img/casinowizard-logo.png" width="120" valign="middle" /></a></td></tr><tr>
|
|
124
|
+
<td align="center" valign="middle"><a href="https://polygon-software.ch/" target="_blank"><img src="https://nestjs.com/img/polygon-logo.svg" width="120" valign="middle" /></a></td>
|
|
125
|
+
<td align="center" valign="middle"><a href="https://mobilereality.pl/" target="_blank"><img src="https://nestjs.com/img/mobile-reality-logo.png" width="45" valign="middle" /></a></td>
|
|
121
126
|
</tr></table>
|
|
122
127
|
|
|
123
128
|
## Backers
|
|
@@ -14,7 +14,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
14
14
|
this.versionConstraint = {
|
|
15
15
|
name: 'version',
|
|
16
16
|
validate(value) {
|
|
17
|
-
if (!shared_utils_1.isString(value) && !Array.isArray(value)) {
|
|
17
|
+
if (!(0, shared_utils_1.isString)(value) && !Array.isArray(value)) {
|
|
18
18
|
throw new Error('Version constraint should be a string or an array of strings.');
|
|
19
19
|
}
|
|
20
20
|
},
|
|
@@ -67,7 +67,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
67
67
|
};
|
|
68
68
|
const instance = instanceOrOptions && instanceOrOptions.server
|
|
69
69
|
? instanceOrOptions
|
|
70
|
-
: fastify_1.fastify(Object.assign({ constraints: {
|
|
70
|
+
: (0, fastify_1.fastify)(Object.assign({ constraints: {
|
|
71
71
|
version: this.versionConstraint,
|
|
72
72
|
} }, instanceOrOptions));
|
|
73
73
|
this.setInstance(instance);
|
|
@@ -188,14 +188,14 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
188
188
|
this.httpServer = this.instance.server;
|
|
189
189
|
}
|
|
190
190
|
useStaticAssets(options) {
|
|
191
|
-
return this.register(load_package_util_1.loadPackage('fastify-static', 'FastifyAdapter.useStaticAssets()', () => require('fastify-static')), options);
|
|
191
|
+
return this.register((0, load_package_util_1.loadPackage)('fastify-static', 'FastifyAdapter.useStaticAssets()', () => require('fastify-static')), options);
|
|
192
192
|
}
|
|
193
193
|
setViewEngine(options) {
|
|
194
|
-
if (shared_utils_1.isString(options)) {
|
|
194
|
+
if ((0, shared_utils_1.isString)(options)) {
|
|
195
195
|
new common_1.Logger('FastifyAdapter').error("setViewEngine() doesn't support a string argument.");
|
|
196
196
|
process.exit(1);
|
|
197
197
|
}
|
|
198
|
-
return this.register(load_package_util_1.loadPackage('point-of-view', 'FastifyAdapter.setViewEngine()', () => require('point-of-view')), options);
|
|
198
|
+
return this.register((0, load_package_util_1.loadPackage)('point-of-view', 'FastifyAdapter.setViewEngine()', () => require('point-of-view')), options);
|
|
199
199
|
}
|
|
200
200
|
setHeader(response, name, value) {
|
|
201
201
|
return response.header(name, value);
|
|
@@ -224,9 +224,11 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
224
224
|
await this.registerMiddie();
|
|
225
225
|
}
|
|
226
226
|
return (path, callback) => {
|
|
227
|
-
|
|
227
|
+
let normalizedPath = path.endsWith('/*')
|
|
228
228
|
? `${path.slice(0, -1)}(.*)`
|
|
229
229
|
: path;
|
|
230
|
+
// Fallback to "(.*)" to support plugins like GraphQL
|
|
231
|
+
normalizedPath = normalizedPath === '/(.*)' ? '(.*)' : normalizedPath;
|
|
230
232
|
// The following type assertion is valid as we use import('middie') rather than require('middie')
|
|
231
233
|
// ref https://github.com/fastify/middie/pull/55
|
|
232
234
|
this.instance.use(normalizedPath, callback);
|
|
@@ -250,7 +252,7 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
|
|
|
250
252
|
}
|
|
251
253
|
injectConstraintsIfVersioned(routerMethodKey, ...args) {
|
|
252
254
|
const handlerRef = args[args.length - 1];
|
|
253
|
-
const isVersioned = !shared_utils_1.isUndefined(handlerRef.version) &&
|
|
255
|
+
const isVersioned = !(0, shared_utils_1.isUndefined)(handlerRef.version) &&
|
|
254
256
|
handlerRef.version !== interfaces_1.VERSION_NEUTRAL;
|
|
255
257
|
if (isVersioned) {
|
|
256
258
|
const isPathAndRouteTuple = args.length === 2;
|
package/adapters/index.js
CHANGED
package/index.js
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
|
-
tslib_1.__exportStar(require("./adapters"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./interfaces"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./adapters"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./interfaces"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./fastify-static-options.interface"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./point-of-view-options.interface"), exports);
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./fastify-static-options.interface"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./point-of-view-options.interface"), exports);
|
package/interfaces/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./nest-fastify-application.interface"), exports);
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./nest-fastify-application.interface"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/platform-fastify",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"fastify": "3.27.
|
|
20
|
+
"fastify": "3.27.1",
|
|
21
21
|
"fastify-cors": "6.0.2",
|
|
22
22
|
"fastify-formbody": "5.2.0",
|
|
23
|
-
"light-my-request": "4.7.
|
|
24
|
-
"middie": "
|
|
23
|
+
"light-my-request": "4.7.1",
|
|
24
|
+
"middie": "6.0.0",
|
|
25
25
|
"path-to-regexp": "3.2.0",
|
|
26
26
|
"tslib": "2.3.1"
|
|
27
27
|
},
|