@athenna/http 4.2.0 → 4.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/package.json +8 -8
- package/src/annotations/Controller.js +1 -1
- package/src/annotations/Interceptor.js +1 -1
- package/src/annotations/Middleware.js +1 -1
- package/src/annotations/Terminator.js +1 -1
- package/src/facades/Route.d.ts +1 -1
- package/src/facades/Server.d.ts +1 -1
- package/src/index.d.ts +1 -3
- package/src/index.js +1 -3
- package/src/kernels/HttpKernel.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athenna/http",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.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>",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"fastify": "^4.21.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@athenna/artisan": "^4.
|
|
74
|
-
"@athenna/common": "^4.
|
|
75
|
-
"@athenna/config": "^4.
|
|
76
|
-
"@athenna/ioc": "^4.
|
|
77
|
-
"@athenna/logger": "^4.
|
|
78
|
-
"@athenna/test": "^4.
|
|
79
|
-
"@athenna/view": "^4.
|
|
73
|
+
"@athenna/artisan": "^4.2.0",
|
|
74
|
+
"@athenna/common": "^4.4.0",
|
|
75
|
+
"@athenna/config": "^4.3.0",
|
|
76
|
+
"@athenna/ioc": "^4.1.0",
|
|
77
|
+
"@athenna/logger": "^4.2.0",
|
|
78
|
+
"@athenna/test": "^4.4.0",
|
|
79
|
+
"@athenna/view": "^4.1.0",
|
|
80
80
|
"@fastify/cors": "^8.1.1",
|
|
81
81
|
"@fastify/helmet": "^10.0.2",
|
|
82
82
|
"@fastify/rate-limit": "^7.5.0",
|
|
@@ -28,7 +28,7 @@ export function Interceptor(options) {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
ioc[options.type](alias, target, createCamelAlias);
|
|
31
|
-
Reflect.defineMetadata('
|
|
31
|
+
Reflect.defineMetadata('ioc:registered', true, target);
|
|
32
32
|
if (!options.isGlobal) {
|
|
33
33
|
ioc.alias(`App/Http/Interceptors/Names/${options.name}`, alias);
|
|
34
34
|
return;
|
|
@@ -28,7 +28,7 @@ export function Middleware(options) {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
ioc[options.type](alias, target, createCamelAlias);
|
|
31
|
-
Reflect.defineMetadata('
|
|
31
|
+
Reflect.defineMetadata('ioc:registered', true, target);
|
|
32
32
|
if (!options.isGlobal) {
|
|
33
33
|
ioc.alias(`App/Http/Middlewares/Names/${options.name}`, alias);
|
|
34
34
|
return;
|
|
@@ -28,7 +28,7 @@ export function Terminator(options) {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
ioc[options.type](alias, target, createCamelAlias);
|
|
31
|
-
Reflect.defineMetadata('
|
|
31
|
+
Reflect.defineMetadata('ioc:registered', true, target);
|
|
32
32
|
if (!options.isGlobal) {
|
|
33
33
|
ioc.alias(`App/Http/Terminators/Names/${options.name}`, alias);
|
|
34
34
|
return;
|
package/src/facades/Route.d.ts
CHANGED
package/src/facades/Server.d.ts
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
import type { ServerImpl } from '#src/server/ServerImpl';
|
|
10
|
-
export declare const Server: import("@athenna/ioc
|
|
10
|
+
export declare const Server: import("@athenna/ioc").FacadeType<ServerImpl>;
|
package/src/index.d.ts
CHANGED
|
@@ -31,11 +31,9 @@ declare module 'fastify' {
|
|
|
31
31
|
operationId?: string;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
export * from './types/index.js';
|
|
34
35
|
export * from '#src/context/Request';
|
|
35
36
|
export * from '#src/context/Response';
|
|
36
|
-
export * from '#src/types/contracts/MiddlewareContract';
|
|
37
|
-
export * from '#src/types/contracts/TerminatorContract';
|
|
38
|
-
export * from '#src/types/contracts/InterceptorContract';
|
|
39
37
|
export * from '#src/annotations/Controller';
|
|
40
38
|
export * from '#src/annotations/Middleware';
|
|
41
39
|
export * from '#src/annotations/Interceptor';
|
package/src/index.js
CHANGED
|
@@ -6,11 +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
|
+
export * from './types/index.js';
|
|
9
10
|
export * from '#src/context/Request';
|
|
10
11
|
export * from '#src/context/Response';
|
|
11
|
-
export * from '#src/types/contracts/MiddlewareContract';
|
|
12
|
-
export * from '#src/types/contracts/TerminatorContract';
|
|
13
|
-
export * from '#src/types/contracts/InterceptorContract';
|
|
14
12
|
export * from '#src/annotations/Controller';
|
|
15
13
|
export * from '#src/annotations/Middleware';
|
|
16
14
|
export * from '#src/annotations/Interceptor';
|
|
@@ -97,7 +97,7 @@ export class HttpKernel {
|
|
|
97
97
|
const controllers = Config.get('rc.controllers', []);
|
|
98
98
|
await Exec.concurrently(controllers, async (path) => {
|
|
99
99
|
const Controller = await this.resolvePath(path);
|
|
100
|
-
if (Reflect.hasMetadata('
|
|
100
|
+
if (Reflect.hasMetadata('ioc:registered', Controller)) {
|
|
101
101
|
debug('Controller %s already registered by Controller annotation. Skipping registration via HttpKernel.', Controller.name);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
@@ -129,7 +129,7 @@ export class HttpKernel {
|
|
|
129
129
|
}
|
|
130
130
|
await Exec.concurrently(Object.keys(namedMiddlewares), async (key) => {
|
|
131
131
|
const Middleware = await this.resolvePath(namedMiddlewares[key]);
|
|
132
|
-
if (Reflect.hasMetadata('
|
|
132
|
+
if (Reflect.hasMetadata('ioc:registered', Middleware)) {
|
|
133
133
|
debug('Named middleware %s already registered by Middleware annotation. Skipping registration via HttpKernel.', Middleware.name);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
@@ -149,7 +149,7 @@ export class HttpKernel {
|
|
|
149
149
|
}
|
|
150
150
|
await Exec.concurrently(globalMiddlewares, async (path) => {
|
|
151
151
|
const Middleware = await this.resolvePath(path);
|
|
152
|
-
if (Reflect.hasMetadata('
|
|
152
|
+
if (Reflect.hasMetadata('ioc:registered', Middleware)) {
|
|
153
153
|
debug('Global middleware %s already registered by Middleware annotation. Skipping registration via HttpKernel.', Middleware.name);
|
|
154
154
|
return;
|
|
155
155
|
}
|