@athenna/http 1.0.0 → 1.0.3
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/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +3 -2
- package/src/Contracts/Context/HandlerContract.d.ts +1 -1
- package/src/Contracts/Context/Middlewares/Handle/HandleHandlerContract.d.ts +1 -1
- package/src/Contracts/Context/Middlewares/Intercept/InterceptHandlerContract.d.ts +1 -1
- package/src/Contracts/Context/Middlewares/Terminate/TerminateHandlerContract.d.ts +1 -1
- package/src/Providers/HttpRouteProvider.d.ts +13 -0
- package/src/Providers/HttpRouteProvider.js +21 -0
- package/src/Providers/HttpServerProvider.d.ts +13 -0
- package/src/Providers/HttpServerProvider.js +20 -0
- package/src/Router/Router.d.ts +3 -1
- package/src/Router/Router.js +3 -4
package/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export * from './src/Http';
|
|
10
10
|
export * from './src/Router/Router';
|
|
11
|
+
export * from './src/Providers/HttpRouteProvider';
|
|
12
|
+
export * from './src/Providers/HttpServerProvider';
|
|
11
13
|
export * from './src/Contracts/MiddlewareContract';
|
|
12
14
|
export * from './src/Contracts/Context/ContextContract';
|
|
13
15
|
export * from './src/Contracts/Context/HandlerContract';
|
package/index.js
CHANGED
|
@@ -20,6 +20,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
__exportStar(require("./src/Http"), exports);
|
|
22
22
|
__exportStar(require("./src/Router/Router"), exports);
|
|
23
|
+
__exportStar(require("./src/Providers/HttpRouteProvider"), exports);
|
|
24
|
+
__exportStar(require("./src/Providers/HttpServerProvider"), exports);
|
|
23
25
|
__exportStar(require("./src/Contracts/MiddlewareContract"), exports);
|
|
24
26
|
__exportStar(require("./src/Contracts/Context/ContextContract"), exports);
|
|
25
27
|
__exportStar(require("./src/Contracts/Context/HandlerContract"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athenna/http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
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>",
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"dot-notation": "off",
|
|
128
128
|
"camelcase": "off",
|
|
129
129
|
"no-undef": "off",
|
|
130
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
130
131
|
"@typescript-eslint/no-var-requires": "off",
|
|
131
132
|
"no-useless-constructor": "off",
|
|
132
133
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
@@ -158,7 +159,7 @@
|
|
|
158
159
|
},
|
|
159
160
|
"dependencies": {
|
|
160
161
|
"@athenna/config": "1.0.1",
|
|
161
|
-
"@athenna/ioc": "1.0.
|
|
162
|
+
"@athenna/ioc": "1.0.6",
|
|
162
163
|
"@secjs/utils": "1.8.0",
|
|
163
164
|
"fastify": "3.27.4",
|
|
164
165
|
"reflect-metadata": "0.1.13",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @athenna/http
|
|
3
|
+
*
|
|
4
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
import { ServiceProvider } from '@athenna/ioc';
|
|
10
|
+
export declare class HttpRouteProvider extends ServiceProvider {
|
|
11
|
+
boot(): void;
|
|
12
|
+
register(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @athenna/http
|
|
4
|
+
*
|
|
5
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
6
|
+
*
|
|
7
|
+
* For the full copyright and license information, please view the LICENSE
|
|
8
|
+
* file that was distributed with this source code.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.HttpRouteProvider = void 0;
|
|
12
|
+
const Router_1 = require("../Router/Router");
|
|
13
|
+
const ioc_1 = require("@athenna/ioc");
|
|
14
|
+
class HttpRouteProvider extends ioc_1.ServiceProvider {
|
|
15
|
+
boot() {
|
|
16
|
+
const http = this.container.safeUse('Athenna/Core/HttpServer');
|
|
17
|
+
this.container.bind('Athenna/Core/HttpRoute', new Router_1.Router(http));
|
|
18
|
+
}
|
|
19
|
+
register() { }
|
|
20
|
+
}
|
|
21
|
+
exports.HttpRouteProvider = HttpRouteProvider;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @athenna/http
|
|
3
|
+
*
|
|
4
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
5
|
+
*
|
|
6
|
+
* For the full copyright and license information, please view the LICENSE
|
|
7
|
+
* file that was distributed with this source code.
|
|
8
|
+
*/
|
|
9
|
+
import { ServiceProvider } from '@athenna/ioc';
|
|
10
|
+
export declare class HttpServerProvider extends ServiceProvider {
|
|
11
|
+
boot(): void;
|
|
12
|
+
register(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @athenna/http
|
|
4
|
+
*
|
|
5
|
+
* (c) João Lenon <lenon@athenna.io>
|
|
6
|
+
*
|
|
7
|
+
* For the full copyright and license information, please view the LICENSE
|
|
8
|
+
* file that was distributed with this source code.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.HttpServerProvider = void 0;
|
|
12
|
+
const Http_1 = require("../Http");
|
|
13
|
+
const ioc_1 = require("@athenna/ioc");
|
|
14
|
+
class HttpServerProvider extends ioc_1.ServiceProvider {
|
|
15
|
+
boot() { }
|
|
16
|
+
register() {
|
|
17
|
+
this.container.singleton('Athenna/Core/HttpServer', new Http_1.Http());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.HttpServerProvider = HttpServerProvider;
|
package/src/Router/Router.d.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
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 '@athenna/ioc';
|
|
10
|
+
import { Http } from '../Http';
|
|
9
11
|
import { Route } from './Route';
|
|
10
12
|
import { RouteGroup } from './RouteGroup';
|
|
11
13
|
import { RouteResource } from './RouteResource';
|
|
@@ -17,7 +19,7 @@ export declare class Router {
|
|
|
17
19
|
private getRecentGroup;
|
|
18
20
|
private readonly http;
|
|
19
21
|
private controllerInstance;
|
|
20
|
-
constructor();
|
|
22
|
+
constructor(http: Http);
|
|
21
23
|
listRoutes(): any;
|
|
22
24
|
controller(controller: any): this;
|
|
23
25
|
route(url: string, methods: HttpMethodTypes[], handler: HandlerContract | string): Route;
|
package/src/Router/Router.js
CHANGED
|
@@ -9,15 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.Router = void 0;
|
|
12
|
-
|
|
12
|
+
require("@athenna/ioc");
|
|
13
13
|
const Route_1 = require("./Route");
|
|
14
14
|
const utils_1 = require("@secjs/utils");
|
|
15
|
-
const ioc_1 = require("@athenna/ioc");
|
|
16
15
|
const RouteGroup_1 = require("./RouteGroup");
|
|
17
16
|
const RouteResource_1 = require("./RouteResource");
|
|
18
17
|
class Router {
|
|
19
|
-
constructor() {
|
|
20
|
-
this.http =
|
|
18
|
+
constructor(http) {
|
|
19
|
+
this.http = http;
|
|
21
20
|
this.routes = [];
|
|
22
21
|
this.openedGroups = [];
|
|
23
22
|
}
|