@pxp-nd/core 1.2.83 → 1.2.85
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.
|
@@ -165,6 +165,7 @@ class Controller {
|
|
|
165
165
|
// const params = { ...req.query, ...req.body, ...req.params };
|
|
166
166
|
const params = Object.assign(Object.assign({}, req.files), req.paramasMerge);
|
|
167
167
|
this.pxpParams = req.pxpParams;
|
|
168
|
+
this.headers = req.headers;
|
|
168
169
|
this.transactionCode = (this.module + this.path + route.path)
|
|
169
170
|
.split('/')
|
|
170
171
|
.join('.')
|
|
@@ -195,6 +196,7 @@ class Controller {
|
|
|
195
196
|
// Execute our method for this path and pass our express request and response object.
|
|
196
197
|
const params = Object.assign(Object.assign({}, req.files), req.paramasMerge);
|
|
197
198
|
this.pxpParams = req.pxpParams;
|
|
199
|
+
this.headers = req.headers;
|
|
198
200
|
if (req.user) {
|
|
199
201
|
// this.user = req.user as User;
|
|
200
202
|
this.user = req.user;
|
|
@@ -219,7 +221,7 @@ class Controller {
|
|
|
219
221
|
}
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
|
-
async genericMethodWrapper(params, req, next, res, methodName, dbsettings, readonly, permission =
|
|
224
|
+
async genericMethodWrapper(params, req, next, res, methodName, dbsettings, readonly, permission = true, log = true, logConfig = {}, isHtml, isFile) {
|
|
223
225
|
if (dbsettings === 'Orm') {
|
|
224
226
|
await index_1.__(this.ormMethodWrapper(params, req, next, res, methodName, readonly, permission, log, logConfig, isHtml, isFile));
|
|
225
227
|
}
|
|
@@ -230,7 +232,7 @@ class Controller {
|
|
|
230
232
|
await this.sqlMethodWrapper(params, next, res, methodName, readonly, permission, log, logConfig);
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
|
-
async ormMethodWrapper(params, req, next, res, methodName, readonly, permission =
|
|
235
|
+
async ormMethodWrapper(params, req, next, res, methodName, readonly, permission = true, log = true, logConfig = {}, isHtml = false, isFile = false) {
|
|
234
236
|
let metResponse;
|
|
235
237
|
if (permission) {
|
|
236
238
|
if (this.user) {
|
|
@@ -250,7 +252,7 @@ class Controller {
|
|
|
250
252
|
await index_1.__(queryRunner.connect());
|
|
251
253
|
await index_1.__(queryRunner.startTransaction());
|
|
252
254
|
try {
|
|
253
|
-
metResponse = (await eval(`this.${methodName}(params, queryRunner.manager, res)`));
|
|
255
|
+
metResponse = (await eval(`this.${methodName}(params, queryRunner.manager, res, req)`));
|
|
254
256
|
await queryRunner.commitTransaction();
|
|
255
257
|
}
|
|
256
258
|
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) => {
|