@tsed/platform-fastify 8.18.0 → 8.18.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.
@@ -14,6 +14,11 @@ import Fastify from "fastify";
14
14
  import { PlatformFastifyRequest } from "../services/PlatformFastifyRequest.js";
15
15
  import { PlatformFastifyResponse } from "../services/PlatformFastifyResponse.js";
16
16
  import { convertPath } from "../utils/convertPath.js";
17
+ function callNext(next, metadata, $ctx) {
18
+ if (metadata.type !== PlatformHandlerType.RESPONSE_FN) {
19
+ return next && $ctx.error && !$ctx.isDone() ? next($ctx.error) : next();
20
+ }
21
+ }
17
22
  export class PlatformFastify extends PlatformAdapter {
18
23
  constructor() {
19
24
  super(...arguments);
@@ -56,7 +61,6 @@ export class PlatformFastify extends PlatformAdapter {
56
61
  return;
57
62
  case "statics":
58
63
  this.statics(path, layer.opts);
59
- // rawApp.register();
60
64
  return;
61
65
  }
62
66
  try {
@@ -83,10 +87,12 @@ export class PlatformFastify extends PlatformAdapter {
83
87
  }
84
88
  switch (metadata.type) {
85
89
  case PlatformHandlerType.MIDDLEWARE:
86
- return (request, _, done) => {
90
+ return async (request, _, done) => {
87
91
  const { $ctx } = request;
88
92
  $ctx.next = done;
89
- return runInContext($ctx, () => handler($ctx));
93
+ const result = await runInContext($ctx, () => handler($ctx));
94
+ callNext(done, metadata, $ctx);
95
+ return result;
90
96
  };
91
97
  default:
92
98
  return async (request, _, done) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/platform-fastify",
3
3
  "type": "module",
4
- "version": "8.18.0",
4
+ "version": "8.18.2",
5
5
  "description": "Fastify package for Ts.ED framework",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/esm/index.js",
@@ -61,11 +61,11 @@
61
61
  "@fastify/cookie": "11.0.1",
62
62
  "@fastify/formbody": "8.0.1",
63
63
  "@fastify/session": "11.0.1",
64
- "@tsed/barrels": "8.18.0",
65
- "@tsed/core": "8.18.0",
66
- "@tsed/di": "8.18.0",
67
- "@tsed/platform-http": "8.18.0",
68
- "@tsed/platform-test-sdk": "8.18.0",
64
+ "@tsed/barrels": "8.18.2",
65
+ "@tsed/core": "8.18.2",
66
+ "@tsed/di": "8.18.2",
67
+ "@tsed/platform-http": "8.18.2",
68
+ "@tsed/platform-test-sdk": "8.18.2",
69
69
  "@types/content-disposition": "^0.5.4",
70
70
  "cross-env": "7.0.3",
71
71
  "fastify": "5.3.2",
package/readme.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p style="text-align: center" align="center">
2
- <a href="https://tsed.io" target="_blank"><img src="https://tsed.io/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
2
+ <a href="https://tsed.dev" target="_blank"><img src="https://tsed.dev/tsed-og.png" width="200" alt="Ts.ED logo"/></a>
3
3
  </p>
4
4
 
5
5
  <div align="center">
@@ -17,18 +17,18 @@
17
17
  </div>
18
18
 
19
19
  <div align="center">
20
- <a href="https://tsed.io/">Website</a>
20
+ <a href="https://tsed.dev/">Website</a>
21
21
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
22
- <a href="https://tsed.io/getting-started/">Getting started</a>
22
+ <a href="https://tsed.dev/getting-started/">Getting started</a>
23
23
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
24
- <a href="https://api.tsed.io/rest/slack/tsedio/tsed">Slack</a>
24
+ <a href="https://api.tsed.dev/rest/slack/tsedio/tsed">Slack</a>
25
25
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
26
26
  <a href="https://twitter.com/TsED_io">Twitter</a>
27
27
  </div>
28
28
 
29
29
  <hr />
30
30
 
31
- A package of the Ts.ED framework. See the [Getting Started Guide](https://tsed.io/getting-started/).
31
+ A package of the Ts.ED framework. See the [Getting Started Guide](https://tsed.dev/getting-started/).
32
32
 
33
33
  ## Installation
34
34
 
@@ -40,7 +40,7 @@ npm install --save @tsed/platform-fastify fastify
40
40
 
41
41
  ## Contributors
42
42
 
43
- Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html)
43
+ Please read [contributing guidelines here](https://tsed.dev/CONTRIBUTING.html)
44
44
 
45
45
  <a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
46
46
 
@@ -52,7 +52,8 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
52
52
 
53
53
  ## Sponsors
54
54
 
55
- Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
55
+ Support this project by becoming a sponsor. Your logo will show up here with a link to your
56
+ website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
56
57
 
57
58
  ## License
58
59
 
@@ -60,8 +61,15 @@ The MIT License (MIT)
60
61
 
61
62
  Copyright (c) 2016 - today Romain Lenzotti
62
63
 
63
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
64
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
65
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
66
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
67
+ persons to whom the Software is furnished to do so, subject to the following conditions:
64
68
 
65
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
69
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
70
+ Software.
66
71
 
67
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
73
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
74
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
75
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.