@pxp-nd/core 1.2.85 → 1.2.87
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/dist/PxpApp.d.ts +1 -1
- package/dist/lib/pxp/Controller.js +15 -15
- package/package.json +1 -1
- package/yalc.lock +4 -0
package/dist/PxpApp.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare class PxpApp {
|
|
|
43
43
|
initializeAuthentication(configAuth: any): Promise<void>;
|
|
44
44
|
initializeErrorHandling(): void;
|
|
45
45
|
private initializePassport;
|
|
46
|
-
|
|
46
|
+
protected configCors(): void;
|
|
47
47
|
private initializeSession;
|
|
48
48
|
private initializeRoutes;
|
|
49
49
|
private showRoutes;
|
|
@@ -164,15 +164,17 @@ class Controller {
|
|
|
164
164
|
// Execute our method for this path and pass our express request and response object.
|
|
165
165
|
// const params = { ...req.query, ...req.body, ...req.params };
|
|
166
166
|
const params = Object.assign(Object.assign({}, req.files), req.paramasMerge);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
const controllerForRequest = Object.assign({}, this);
|
|
168
|
+
controllerForRequest.user = req.user || null;
|
|
169
|
+
controllerForRequest.headers = req.headers;
|
|
170
|
+
controllerForRequest.pxpParams = req.pxpParams;
|
|
171
|
+
controllerForRequest.transactionCode = (this.module + this.path + route.path)
|
|
170
172
|
.split('/')
|
|
171
173
|
.join('.')
|
|
172
174
|
.toLowerCase();
|
|
173
|
-
|
|
175
|
+
controllerForRequest.validated = false;
|
|
174
176
|
try {
|
|
175
|
-
await index_1.__(
|
|
177
|
+
await index_1.__(controllerForRequest.genericMethodWrapper(params, req, next, res, route.methodName, methodDbSettings, readOnlyMethod, false, logKey, logValue, isHtmlMethod, isFileMethod));
|
|
176
178
|
}
|
|
177
179
|
catch (ex) {
|
|
178
180
|
const now = new Date();
|
|
@@ -195,25 +197,23 @@ class Controller {
|
|
|
195
197
|
], async (req, res, next) => {
|
|
196
198
|
// Execute our method for this path and pass our express request and response object.
|
|
197
199
|
const params = Object.assign(Object.assign({}, req.files), req.paramasMerge);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
this.transactionCode = (this.module + this.path + route.path)
|
|
200
|
+
const controllerForRequest = Object.assign({}, this);
|
|
201
|
+
controllerForRequest.user = req.user || null;
|
|
202
|
+
controllerForRequest.headers = req.headers;
|
|
203
|
+
controllerForRequest.pxpParams = req.pxpParams;
|
|
204
|
+
controllerForRequest.transactionCode = (this.module + this.path + route.path)
|
|
205
205
|
.split('/')
|
|
206
206
|
.join('.')
|
|
207
207
|
.toLowerCase();
|
|
208
|
-
|
|
208
|
+
controllerForRequest.validated = false;
|
|
209
209
|
try {
|
|
210
|
-
await index_1.__(
|
|
210
|
+
await index_1.__(controllerForRequest.genericMethodWrapper(params, req, next, res, route.methodName, methodDbSettings, readOnlyMethod, permission[route.methodName], logKey, logValue, isHtmlMethod, isFileMethod));
|
|
211
211
|
}
|
|
212
212
|
catch (ex) {
|
|
213
213
|
const now = new Date();
|
|
214
214
|
const iniAt = req.start;
|
|
215
215
|
const endsAt = now.valueOf() - iniAt.valueOf();
|
|
216
|
-
res.logId = (await index_1.__(index_1.insertLog(
|
|
216
|
+
res.logId = (await index_1.__(index_1.insertLog(controllerForRequest.user && controllerForRequest.user.username ? controllerForRequest.user.username : 'nouser', 'mac', req.ip, 'error', ex.tecMessage, this.module, this.transactionCode, '', // query
|
|
217
217
|
params, ex.stack, ex.statusCode, endsAt, logValue)));
|
|
218
218
|
index_1.errorMiddleware(ex, req, res);
|
|
219
219
|
}
|
package/package.json
CHANGED