@szegedsw/lib-node
Advanced tools
Comparing version 2.0.50 to 2.0.51
@@ -22,8 +22,19 @@ import { Request, Response } from "express"; | ||
export declare abstract class Controller extends Routed { | ||
abstract get(req: Request, res: Response, data?: any): Promise<void>; | ||
abstract post(req: Request, res: Response, data?: any): Promise<void>; | ||
abstract patch(req: Request, res: Response, data?: any): Promise<void>; | ||
abstract put(req: Request, res: Response, data?: any): Promise<void>; | ||
abstract delete(req: Request, res: Response, data?: any): Promise<void>; | ||
abstract get(req: Request, res: Response, data?: { | ||
[key: string]: string; | ||
}): Promise<void>; | ||
abstract post(req: Request, res: Response, data?: { | ||
[key: string]: string; | ||
}): Promise<void>; | ||
abstract patch(req: Request, res: Response, data?: { | ||
[key: string]: string; | ||
}): Promise<void>; | ||
abstract put(req: Request, res: Response, data?: { | ||
[key: string]: string; | ||
}): Promise<void>; | ||
abstract delete(req: Request, res: Response, data?: { | ||
[key: string]: string; | ||
}): Promise<void>; | ||
errors?: IErrors; | ||
splitter?: string; | ||
onError?: OnError; | ||
@@ -30,0 +41,0 @@ validator(req: Request, res: Response): Promise<boolean>; |
@@ -25,2 +25,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(this, "splitter", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: "#" | ||
}); | ||
Object.defineProperty(this, "onError", { | ||
@@ -27,0 +33,0 @@ enumerable: true, |
@@ -11,2 +11,3 @@ import { Request, Response, Router } from "express"; | ||
errors?: IErrors; | ||
splitter?: string; | ||
onError?: OnError; | ||
@@ -13,0 +14,0 @@ toRouter(): Router; |
@@ -20,2 +20,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(this, "splitter", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: "#" | ||
}); | ||
Object.defineProperty(this, "onError", { | ||
@@ -30,3 +36,3 @@ enumerable: true, | ||
const router = express_1.Router(); | ||
const tryIt = (req, res, func) => try_1._try(res, async () => func(req, res, request_1.requestParams(req)), this.errors, this.onError); | ||
const tryIt = (req, res, func) => try_1._try(res, async () => func(req, res, request_1.requestParams(req)), this.errors, this.onError, this.splitter); | ||
router.get("/", async (req, res) => tryIt(req, res, (req, res, data) => this.get(req, res, data))); | ||
@@ -33,0 +39,0 @@ router.get("/:_id", async (req, res) => tryIt(req, res, (req, res, data) => this.get(req, res, data))); |
{ | ||
"name": "@szegedsw/lib-node", | ||
"version": "2.0.50", | ||
"version": "2.0.51", | ||
"description": "A little framework published by Szeged Software Zrt. in order to enhance api endpoint security and create reuseable code. Email module, Logging system, and much more. Further improvements are expected.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
528293
9533