@pxp-nd/core 1.2.83 → 1.2.84
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.
|
@@ -195,6 +195,7 @@ class Controller {
|
|
|
195
195
|
// Execute our method for this path and pass our express request and response object.
|
|
196
196
|
const params = Object.assign(Object.assign({}, req.files), req.paramasMerge);
|
|
197
197
|
this.pxpParams = req.pxpParams;
|
|
198
|
+
this.headers = req.headers;
|
|
198
199
|
if (req.user) {
|
|
199
200
|
// this.user = req.user as User;
|
|
200
201
|
this.user = req.user;
|
|
@@ -219,7 +220,7 @@ class Controller {
|
|
|
219
220
|
}
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
|
-
async genericMethodWrapper(params, req, next, res, methodName, dbsettings, readonly, permission =
|
|
223
|
+
async genericMethodWrapper(params, req, next, res, methodName, dbsettings, readonly, permission = true, log = true, logConfig = {}, isHtml, isFile) {
|
|
223
224
|
if (dbsettings === 'Orm') {
|
|
224
225
|
await index_1.__(this.ormMethodWrapper(params, req, next, res, methodName, readonly, permission, log, logConfig, isHtml, isFile));
|
|
225
226
|
}
|
|
@@ -230,7 +231,7 @@ class Controller {
|
|
|
230
231
|
await this.sqlMethodWrapper(params, next, res, methodName, readonly, permission, log, logConfig);
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
|
-
async ormMethodWrapper(params, req, next, res, methodName, readonly, permission =
|
|
234
|
+
async ormMethodWrapper(params, req, next, res, methodName, readonly, permission = true, log = true, logConfig = {}, isHtml = false, isFile = false) {
|
|
234
235
|
let metResponse;
|
|
235
236
|
if (permission) {
|
|
236
237
|
if (this.user) {
|
|
@@ -250,7 +251,7 @@ class Controller {
|
|
|
250
251
|
await index_1.__(queryRunner.connect());
|
|
251
252
|
await index_1.__(queryRunner.startTransaction());
|
|
252
253
|
try {
|
|
253
|
-
metResponse = (await eval(`this.${methodName}(params, queryRunner.manager, res)`));
|
|
254
|
+
metResponse = (await eval(`this.${methodName}(params, queryRunner.manager, res, req)`));
|
|
254
255
|
await queryRunner.commitTransaction();
|
|
255
256
|
}
|
|
256
257
|
catch (err) {
|
|
@@ -108,7 +108,7 @@ const IsFile = (isFile = false) => (target, propertyKey) => setProperty(target,
|
|
|
108
108
|
exports.IsFile = IsFile;
|
|
109
109
|
const DbSettings = (modelType) => (target, propertyKey) => setProperty(target, propertyKey)(modelType, 'dbsettings');
|
|
110
110
|
exports.DbSettings = DbSettings;
|
|
111
|
-
const Permission = (permission =
|
|
111
|
+
const Permission = (permission = true) => (target, propertyKey) => setProperty(target, propertyKey)(permission, 'permission');
|
|
112
112
|
exports.Permission = Permission;
|
|
113
113
|
const Log = (log = true, config = {}) => {
|
|
114
114
|
return (target, propertyKey) => {
|