axe-api 1.0.7 → 1.0.9
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import connect, { NextHandleFunction, ErrorHandleFunction } from "connect";
|
|
1
|
+
import connect, { HandleFunction, NextHandleFunction, ErrorHandleFunction } from "connect";
|
|
2
2
|
import { GeneralFunction } from "../Types";
|
|
3
3
|
declare class App {
|
|
4
4
|
private connect;
|
|
@@ -20,7 +20,9 @@ declare class App {
|
|
|
20
20
|
* next()
|
|
21
21
|
* })
|
|
22
22
|
*/
|
|
23
|
-
use(middleware: NextHandleFunction
|
|
23
|
+
use(middleware: NextHandleFunction): void;
|
|
24
|
+
use(middleware: HandleFunction): void;
|
|
25
|
+
use(middleware: ErrorHandleFunction): void;
|
|
24
26
|
/**
|
|
25
27
|
* Add a GET request handler with middleware support
|
|
26
28
|
*
|
|
@@ -33,15 +33,6 @@ class App {
|
|
|
33
33
|
get instance() {
|
|
34
34
|
return this.connect;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Add a global connect middleware
|
|
38
|
-
*
|
|
39
|
-
* @param middleware
|
|
40
|
-
* @example
|
|
41
|
-
* app.use((req: IncomingMessage, res: ServerResponse, next: any) => {
|
|
42
|
-
* next()
|
|
43
|
-
* })
|
|
44
|
-
*/
|
|
45
36
|
use(middleware) {
|
|
46
37
|
this.connect.use(middleware);
|
|
47
38
|
LogService_1.default.debug(`New middleware: ${middleware.name || "anonymous"}()`);
|
package/build/src/Types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type ModelMiddleware = Array<AxeFunction | IHandlerBaseMiddleware>;
|
|
|
13
13
|
export type AdaptorType = "redis" | "memory";
|
|
14
14
|
export type DefaultResponse = Promise<void> | void | undefined;
|
|
15
15
|
export type NextFunction = (error?: any) => void;
|
|
16
|
-
export type
|
|
16
|
+
export type SchemaInspectorFunction = (database: Knex) => SchemaInspector;
|
|
17
17
|
export type SerializationFunction = (item: any, request: AxeRequest) => any;
|
|
18
18
|
export type MiddlewareFunction = (req: IncomingMessage, res: ServerResponse, next: NextFunction) => DefaultResponse;
|
|
19
19
|
export type HandlerFunction = (request: AxeRequest, response: AxeResponse) => DefaultResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axe-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "AXE API is a simple tool to create Rest APIs quickly.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"dev-kit": "ts-node-dev --respawn --clear dev-kit.ts",
|
|
34
34
|
"dev-kit:install": "node ./scripts/dev-kit-install.js",
|
|
35
35
|
"dev-kit:remove": "node ./scripts/dev-kit-remove.js",
|
|
36
|
-
"dev-kit:docs": "open-swagger-ui http://localhost:3000/swagger",
|
|
37
36
|
"test": "jest --runInBand",
|
|
38
37
|
"test:all": "npm run lint && npm run prettier:check && npm run test && npm run test:sqlite",
|
|
39
38
|
"test:dev": "jest --watch",
|
|
@@ -105,10 +104,10 @@
|
|
|
105
104
|
"node-cache": "^5.1.2",
|
|
106
105
|
"node-color-log": "^11.0.0",
|
|
107
106
|
"nodemon": "^3.0.2",
|
|
108
|
-
"open-swagger-ui": "^1.2.0",
|
|
109
107
|
"pg": "^8.11.3",
|
|
110
108
|
"prettier": "^3.1.1",
|
|
111
109
|
"redis": "^4.6.11",
|
|
110
|
+
"serve-static": "^1.15.0",
|
|
112
111
|
"set-value": ">=4.1.0",
|
|
113
112
|
"sqlite3": "^5.1.6",
|
|
114
113
|
"ts-node": "^10.9.2",
|