@estgbue/mezgeb 0.0.41 → 0.0.42

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.
@@ -61,7 +61,7 @@ let ClientLoggerInterceptor = class ClientLoggerInterceptor {
61
61
  }));
62
62
  }
63
63
  handleRequestAuditInitiation(context, next, requestId) {
64
- var _a, _b;
64
+ var _a, _b, _c, _d, _e;
65
65
  const req = context.switchToHttp().getRequest();
66
66
  const { ip, ips, method, originalUrl, headers, body, params, user } = req;
67
67
  const ds = this.connection;
@@ -69,8 +69,8 @@ let ClientLoggerInterceptor = class ClientLoggerInterceptor {
69
69
  const log = {
70
70
  id: requestId,
71
71
  requestMethod: method,
72
- application: process.env.APPLICATION_NAME,
73
- module: originalUrl.split('/')[2],
72
+ application: (_d = (_c = process.env.APPLICATION_NAME) !== null && _c !== void 0 ? _c : process.env.APP_NAME) !== null && _d !== void 0 ? _d : 'DEFAULT',
73
+ module: (_e = originalUrl.split('/')[2]) !== null && _e !== void 0 ? _e : 'DEFAULT',
74
74
  requestBody: originalUrl.includes('/auth') ? {} : body,
75
75
  requestHeader: this.mapHeaders(headers),
76
76
  statusCode: 201,
@@ -81,6 +81,7 @@ let ClientLoggerInterceptor = class ClientLoggerInterceptor {
81
81
  this.rmsRMQClient.emit(mezgeb_enum_1.RegisterRequestAudit, log);
82
82
  }
83
83
  handleEventAuditInitiation(context, next, requestId) {
84
+ var _a, _b;
84
85
  const eventPayload = context.getArgs()[0];
85
86
  const eventPattern = context.getArgs()[1].args[2];
86
87
  const ds = this.connection;
@@ -88,8 +89,8 @@ let ClientLoggerInterceptor = class ClientLoggerInterceptor {
88
89
  const log = {
89
90
  id: requestId,
90
91
  requestMethod: mezgeb_enum_1.EAuditLogRequestMethod.EVENT,
91
- application: process.env.APPLICATION_NAME,
92
- module: eventPattern,
92
+ application: (_b = (_a = process.env.APPLICATION_NAME) !== null && _a !== void 0 ? _a : process.env.APP_NAME) !== null && _b !== void 0 ? _b : 'DEFAULT',
93
+ module: eventPattern !== null && eventPattern !== void 0 ? eventPattern : 'DEFAULT',
93
94
  requestBody: eventPayload,
94
95
  requestHeader: {},
95
96
  statusCode: 201,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estgbue/mezgeb",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "main": "./src/index",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"