@athenna/http 5.42.0 → 5.43.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 +15 -15
- package/src/debug/index.d.ts +1 -1
- package/src/handlers/HttpExceptionHandler.d.ts +2 -1
- package/src/handlers/HttpExceptionHandler.js +2 -2
- package/src/router/Route.js +1 -1
- package/templates/controller.edge +15 -15
- package/templates/interceptor.edge +3 -3
- package/templates/middleware.edge +1 -1
- package/templates/terminator.edge +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athenna/http",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.43.0",
|
|
4
4
|
"description": "The Athenna Http server. Built on top of fastify.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "João Lenon <lenon@athenna.io>",
|
|
@@ -75,25 +75,25 @@
|
|
|
75
75
|
"#tests": "./tests/index.js"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@athenna/artisan": "^5.
|
|
79
|
-
"@athenna/common": "^5.
|
|
80
|
-
"@athenna/config": "^5.
|
|
78
|
+
"@athenna/artisan": "^5.11.0",
|
|
79
|
+
"@athenna/common": "^5.30.0",
|
|
80
|
+
"@athenna/config": "^5.6.0",
|
|
81
81
|
"@athenna/ioc": "^5.2.0",
|
|
82
|
-
"@athenna/logger": "^5.
|
|
83
|
-
"@athenna/test": "^5.
|
|
82
|
+
"@athenna/logger": "^5.14.0",
|
|
83
|
+
"@athenna/test": "^5.6.0",
|
|
84
84
|
"@athenna/tsconfig": "^5.0.0",
|
|
85
85
|
"@athenna/view": "^5.4.0",
|
|
86
86
|
"@athenna/vite": "^5.15.0",
|
|
87
|
-
"@fastify/aws-lambda": "^6.
|
|
87
|
+
"@fastify/aws-lambda": "^6.4.0",
|
|
88
88
|
"@fastify/cors": "^10.1.0",
|
|
89
|
-
"@fastify/helmet": "^13.0.
|
|
90
|
-
"@fastify/multipart": "^9.0
|
|
89
|
+
"@fastify/helmet": "^13.0.2",
|
|
90
|
+
"@fastify/multipart": "^9.4.0",
|
|
91
91
|
"@fastify/rate-limit": "^10.3.0",
|
|
92
|
-
"@fastify/static": "^8.
|
|
93
|
-
"@fastify/swagger": "^9.
|
|
94
|
-
"@fastify/swagger-ui": "^5.2.
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
96
|
-
"@typescript-eslint/parser": "^8.
|
|
92
|
+
"@fastify/static": "^8.3.0",
|
|
93
|
+
"@fastify/swagger": "^9.7.0",
|
|
94
|
+
"@fastify/swagger-ui": "^5.2.5",
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
96
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
97
97
|
"autocannon": "^7.15.0",
|
|
98
98
|
"commitizen": "^4.3.1",
|
|
99
99
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"lint-staged": "^12.5.0",
|
|
110
110
|
"ora": "^8.2.0",
|
|
111
111
|
"prettier": "^2.8.8",
|
|
112
|
-
"vite": "^6.
|
|
112
|
+
"vite": "^6.4.1",
|
|
113
113
|
"vite-plugin-restart": "^0.4.2"
|
|
114
114
|
},
|
|
115
115
|
"c8": {
|
package/src/debug/index.d.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
+
import { ExceptionHandler } from '@athenna/common';
|
|
9
10
|
import type { ErrorContext } from '#src/types';
|
|
10
|
-
export declare class HttpExceptionHandler {
|
|
11
|
+
export declare class HttpExceptionHandler extends ExceptionHandler {
|
|
11
12
|
/**
|
|
12
13
|
* Error codes that should be ignored from logging.
|
|
13
14
|
*/
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
|
+
import { Is, Json, String, ExceptionHandler } from '@athenna/common';
|
|
9
10
|
import { Log } from '@athenna/logger';
|
|
10
|
-
|
|
11
|
-
export class HttpExceptionHandler {
|
|
11
|
+
export class HttpExceptionHandler extends ExceptionHandler {
|
|
12
12
|
/**
|
|
13
13
|
* Error codes that should be ignored from logging.
|
|
14
14
|
*/
|
package/src/router/Route.js
CHANGED
|
@@ -2,23 +2,23 @@ import { Controller, type Context } from '@athenna/http'
|
|
|
2
2
|
|
|
3
3
|
@Controller()
|
|
4
4
|
export class {{ namePascal }} {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
public async index({ response }: Context) {
|
|
6
|
+
return response.status(200).send([{}])
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
public async store({ response }: Context) {
|
|
10
|
+
return response.status(201).send({})
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
public async show({ response }: Context) {
|
|
14
|
+
return response.status(200).send({})
|
|
15
|
+
}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
public async update({ request, response }: Context) {
|
|
18
|
+
return response.status(200).send({ id: request.param('id') })
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
public async delete({ response }: Context) {
|
|
22
|
+
return response.status(204)
|
|
23
|
+
}
|
|
24
24
|
}
|
|
@@ -3,7 +3,7 @@ import type { InterceptorContract, InterceptContext } from '@athenna/http'
|
|
|
3
3
|
|
|
4
4
|
@Interceptor()
|
|
5
5
|
export class {{ namePascal }} implements InterceptorContract {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
public async intercept(ctx: InterceptContext): Promise<unknown> {
|
|
7
|
+
return ctx.response.body
|
|
8
|
+
}
|
|
9
9
|
}
|
|
@@ -3,5 +3,5 @@ import type { TerminateContext, TerminatorContract } from '@athenna/http'
|
|
|
3
3
|
|
|
4
4
|
@Terminator()
|
|
5
5
|
export class {{ namePascal }} implements TerminatorContract {
|
|
6
|
-
|
|
6
|
+
public async terminate(ctx: TerminateContext): Promise<void> {}
|
|
7
7
|
}
|