@autofleet/rabbit 3.2.20-beta-1 → 3.2.20-beta-2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "3.2.20-beta-1",
3
+ "version": "3.2.20-beta-2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -19,6 +19,7 @@ import RabbitError from './lib/rabbitError';
19
19
  import getRedisInstance, { RedisConfig } from './lib/redis';
20
20
  import { assertExchangeFanout, rand, wrapSetImmediate } from './lib/utils';
21
21
  import {
22
+ AUTOMATION_ID_HEADER,
22
23
  CONNECTION_CREATED_CONST,
23
24
  CONNECTION_FAILED_CONST,
24
25
  DEFAULT_LOCK_TIMEOUT,
@@ -555,7 +556,7 @@ class RabbitMq implements IAfRabbitMq {
555
556
 
556
557
  const traceId = msg.properties.headers[TRACING_HEADER];
557
558
  const userId = msg.properties.headers[USER_TRACING_HEADER];
558
- const automationId = msg.properties.headers['x-af-automation-id'];
559
+ const automationId = msg.properties.headers[AUTOMATION_ID_HEADER];
559
560
  const parsedMessage = RabbitMq.parseMsg(msg);
560
561
  const releaseLock = await this.lockRedisIfNeeded(parsedMessage, optionsWithDefaults);
561
562
  const trace = newTrace(traceTypes.RABBIT);
@@ -581,6 +582,12 @@ class RabbitMq implements IAfRabbitMq {
581
582
  }
582
583
 
583
584
  if (auditContext) {
585
+ logger.info('audit context payload',
586
+ {
587
+ queue,
588
+ userId,
589
+ automationId,
590
+ });
584
591
  await auditContext(queue, {
585
592
  userId,
586
593
  automationId,
package/src/lib/consts.ts CHANGED
@@ -3,6 +3,7 @@ export const DEFAULT_LOCK_TIMEOUT = 1000 * 5;
3
3
  export const RETRY_HEADER = 'x-retry-count';
4
4
  export const TRACING_HEADER = 'x-trace-id';
5
5
  export const USER_TRACING_HEADER = 'x-af-user-id';
6
+ export const AUTOMATION_ID_HEADER = 'x-af-automation-id';
6
7
  export const USER_OBJECT = 'userObject';
7
8
  export const DEFAULT_USE_CONSUME_WITH_LOCK = false;
8
9
  export const CONNECTION_CREATED_CONST = 'connectionCreated';