@athenna/http 1.6.9 → 1.7.1
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 +6 -5
- package/src/Commands/Make/Controller.js +1 -1
- package/src/Commands/Make/Middleware.js +1 -1
- package/src/Commands/Route/List.js +1 -1
- package/src/Context/Request.js +2 -1
- package/src/Exceptions/HttpException.js +1 -1
- package/src/Exceptions/UndefinedMethodException.js +1 -1
- package/src/Handlers/FastifyHandler.js +1 -1
- package/src/Handlers/HttpExceptionHandler.js +2 -1
- package/src/Helpers/HttpLoader.js +1 -1
- package/src/Kernels/HttpKernel.js +2 -1
- package/src/Providers/ControllerProvider.js +1 -1
- package/src/Providers/MiddlewareProvider.js +1 -1
- package/src/Router/Route.js +1 -1
- package/src/Router/RouteResource.js +1 -1
- package/src/Router/Router.js +1 -1
- package/src/Utils/removeSlashes.js +1 -1
- package/src/index.d.ts +20 -4
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athenna/http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
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>",
|
|
@@ -54,10 +54,11 @@
|
|
|
54
54
|
"#tests/*": "./tests/*.js"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@athenna/artisan": "1.5.
|
|
58
|
-
"@athenna/
|
|
59
|
-
"@athenna/
|
|
60
|
-
"@
|
|
57
|
+
"@athenna/artisan": "1.5.3",
|
|
58
|
+
"@athenna/config": "^1.1.8",
|
|
59
|
+
"@athenna/ioc": "1.2.7",
|
|
60
|
+
"@athenna/logger": "1.3.4",
|
|
61
|
+
"@secjs/utils": "1.0.0",
|
|
61
62
|
"fastify": "3.27.4",
|
|
62
63
|
"fastify-cors": "6.0.3",
|
|
63
64
|
"fastify-rate-limit": "5.8.0"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Path, String } from '@
|
|
10
|
+
import { Path, String } from '@athenna/common'
|
|
11
11
|
import { Artisan, Command, FilePropertiesHelper } from '@athenna/artisan'
|
|
12
12
|
|
|
13
13
|
export class MakeMiddleware extends Command {
|
package/src/Context/Request.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Module, Path } from '@
|
|
10
|
+
import { Module, Path } from '@athenna/common'
|
|
11
11
|
import { ServiceProvider } from '@athenna/ioc'
|
|
12
12
|
|
|
13
13
|
export class ControllerProvider extends ServiceProvider {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Module, Path } from '@
|
|
10
|
+
import { Module, Path } from '@athenna/common'
|
|
11
11
|
import { ServiceProvider } from '@athenna/ioc'
|
|
12
12
|
|
|
13
13
|
export class MiddlewareProvider extends ServiceProvider {
|
package/src/Router/Route.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Is } from '@
|
|
10
|
+
import { Is } from '@athenna/common'
|
|
11
11
|
import { removeSlashes } from '#src/Utils/removeSlashes'
|
|
12
12
|
import { isMiddlewareContract } from '#src/Utils/isMiddlewareContract'
|
|
13
13
|
import { UndefinedMethodException } from '#src/Exceptions/UndefinedMethodException'
|
package/src/Router/Router.js
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { Facade } from '@athenna/ioc'
|
|
11
11
|
import { FastifyReply, FastifyRequest } from 'fastify'
|
|
12
|
-
import { Exception } from '@
|
|
12
|
+
import { Exception } from '@athenna/common'
|
|
13
13
|
|
|
14
14
|
export const Server: Facade & Http
|
|
15
15
|
export const Route: Facade & Router.Router
|
|
@@ -23,6 +23,7 @@ export class HttpKernel {
|
|
|
23
23
|
* @type {any | Promise<any>}
|
|
24
24
|
*/
|
|
25
25
|
get globalMiddlewares(): any | Promise<any>
|
|
26
|
+
|
|
26
27
|
/**
|
|
27
28
|
* The application's named HTTP middlewares.
|
|
28
29
|
*
|
|
@@ -82,6 +83,7 @@ export class HttpExceptionHandler {
|
|
|
82
83
|
* @type {string[]}
|
|
83
84
|
*/
|
|
84
85
|
get ignoreCodes(): string[]
|
|
86
|
+
|
|
85
87
|
/**
|
|
86
88
|
* Error statuses that should be ignored by Log.
|
|
87
89
|
*
|
|
@@ -199,7 +201,12 @@ export class Http {
|
|
|
199
201
|
* @param {any} [middlewares]
|
|
200
202
|
* @return {void}
|
|
201
203
|
*/
|
|
202
|
-
route(
|
|
204
|
+
route(
|
|
205
|
+
url: string,
|
|
206
|
+
methods: string[],
|
|
207
|
+
handler: HandlerContract,
|
|
208
|
+
middlewares?: any,
|
|
209
|
+
): void
|
|
203
210
|
|
|
204
211
|
/**
|
|
205
212
|
* Add a new GET route to the http server.
|
|
@@ -420,7 +427,11 @@ declare module Router {
|
|
|
420
427
|
* @param {string|any} handler
|
|
421
428
|
* @return {Route}
|
|
422
429
|
*/
|
|
423
|
-
route(
|
|
430
|
+
route(
|
|
431
|
+
url: string,
|
|
432
|
+
methods: string[],
|
|
433
|
+
handler: string | HandlerContract,
|
|
434
|
+
): Route
|
|
424
435
|
|
|
425
436
|
/**
|
|
426
437
|
* Creates a new route group.
|
|
@@ -687,7 +698,12 @@ export class HttpException extends Exception {
|
|
|
687
698
|
* @param {string} [code]
|
|
688
699
|
* @param {string|null} [help]
|
|
689
700
|
*/
|
|
690
|
-
constructor(
|
|
701
|
+
constructor(
|
|
702
|
+
content?: string,
|
|
703
|
+
status?: number,
|
|
704
|
+
code?: string,
|
|
705
|
+
help?: string | null,
|
|
706
|
+
)
|
|
691
707
|
}
|
|
692
708
|
|
|
693
709
|
export class BadGatewayException extends Exception {
|