@nicollasfrazao/liguelead-log-service 1.2.0 → 1.2.1

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/README.md CHANGED
@@ -484,7 +484,7 @@ LOG_MAX_BODY_SIZE=1000
484
484
  "content-type": "application/json",
485
485
  "authorization": "[REDACTED]"
486
486
  },
487
- "requestBody": {
487
+ "payload": {
488
488
  "title": "Test Voice Message",
489
489
  "voice_upload_id": 123,
490
490
  "phones": ["[REDACTED]", "[REDACTED]"]
@@ -195,7 +195,7 @@ class LogService {
195
195
  || 'response_time' in data
196
196
  || 'ip' in data
197
197
  || 'user_agent' in data
198
- || 'request' in data
198
+ || 'payload' in data
199
199
  || 'response' in data
200
200
  || 'error' in data
201
201
  || 'stack' in data
@@ -491,7 +491,7 @@ class LogService {
491
491
  const additionalData = {
492
492
  method: requestMethod,
493
493
  url: requestUrl,
494
- request: this.sanitizeBody(requestBody),
494
+ payload: this.sanitizeBody(requestBody),
495
495
  response: this.sanitizeBody(responseBody),
496
496
  response_time: duration
497
497
  };
@@ -551,14 +551,14 @@ class LogService {
551
551
  if (this.config.includeRequestBody) {
552
552
  context.content_type = request.get('Content-Type') || '';
553
553
  if (context.content_type.includes('multipart/form-data')) {
554
- context.request = {
554
+ context.payload = {
555
555
  type: 'multipart/form-data',
556
556
  note: 'Details will be logged after processing'
557
557
  };
558
558
  }
559
559
  else if (request.body
560
560
  && Object.keys(request.body).length > 0) {
561
- context.request = this.sanitizeBody(request.body);
561
+ context.payload = this.sanitizeBody(request.body);
562
562
  }
563
563
  }
564
564
  return {
@@ -613,7 +613,7 @@ class LogService {
613
613
  size: file.size
614
614
  }));
615
615
  }
616
- context.request = multipartData;
616
+ context.payload = multipartData;
617
617
  }
618
618
  return {
619
619
  ...context,
@@ -9,7 +9,7 @@
9
9
  * @property {string} url
10
10
  * @property {string} user_agent
11
11
  * @property {string} ip
12
- * @property {any} request
12
+ * @property {any} payload
13
13
  * @property {any} response
14
14
  * @property {number} status_code
15
15
  * @property {number} response_time
@@ -46,7 +46,7 @@ export type LogContextType = {
46
46
  /**
47
47
  * @var {any}
48
48
  */
49
- request?: any;
49
+ payload?: any;
50
50
  /**
51
51
  * @var {any}
52
52
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicollasfrazao/liguelead-log-service",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A standalone logging service for Express applications with multi-destination storage (local files + S3 via Kinesis Firehose) and comprehensive request tracking using strategy pattern.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",