@ecom-micro/common 2.0.36 → 2.0.38

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/build/index.d.ts CHANGED
@@ -14,7 +14,6 @@ export * from './queues/baseListener';
14
14
  export * from './queues/basePublisher';
15
15
  export * from './logger/logger';
16
16
  export * from './types/product.types';
17
- export * from './types/product.types';
18
17
  export * from './types/routingKey.types';
19
18
  export * from './types/exchange.types';
20
19
  export * from './types/subjects';
package/build/index.js CHANGED
@@ -35,7 +35,6 @@ __exportStar(require("./queues/basePublisher"), exports);
35
35
  __exportStar(require("./logger/logger"), exports);
36
36
  // Interface
37
37
  __exportStar(require("./types/product.types"), exports);
38
- __exportStar(require("./types/product.types"), exports);
39
38
  __exportStar(require("./types/routingKey.types"), exports);
40
39
  __exportStar(require("./types/exchange.types"), exports);
41
40
  __exportStar(require("./types/subjects"), exports);
@@ -2,12 +2,12 @@ import { Channel, ConsumeMessage } from 'amqplib';
2
2
  import { ExchangeTypes } from '../types/exchange.types';
3
3
  import { RoutingKeyTypes } from '../types/routingKey.types';
4
4
  interface Event {
5
- exchange: ExchangeTypes;
5
+ exchangeName: ExchangeTypes;
6
6
  data: any;
7
7
  }
8
8
  export declare abstract class BaseListener<T extends Event> {
9
9
  protected channel: Channel;
10
- abstract exchangeName: T['exchange'];
10
+ abstract exchangeName: T['exchangeName'];
11
11
  abstract routingKey: RoutingKeyTypes;
12
12
  abstract onMessage(data: T['data'], msg: ConsumeMessage): void;
13
13
  constructor(channel: Channel);
@@ -2,12 +2,12 @@ import { Channel } from 'amqplib';
2
2
  import { ExchangeTypes } from '../types/exchange.types';
3
3
  import { RoutingKeyTypes } from '../types/routingKey.types';
4
4
  interface Event {
5
- exchange: ExchangeTypes;
5
+ exchangeName: ExchangeTypes;
6
6
  data: any;
7
7
  }
8
8
  export declare abstract class BasePublisher<T extends Event> {
9
9
  protected channel: Channel;
10
- abstract exchangeName: T['exchange'];
10
+ abstract exchangeName: T['exchangeName'];
11
11
  abstract routingKey: RoutingKeyTypes;
12
12
  constructor(channel: Channel);
13
13
  publish(data: T['data']): Promise<void>;
@@ -17,7 +17,7 @@ class BasePublisher {
17
17
  publish(data) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  yield this.channel.assertExchange(this.exchangeName, 'direct');
20
- this.channel.publish(this.exchangeName, this.routingKey, Buffer.from(data));
20
+ this.channel.publish(this.exchangeName, this.routingKey, Buffer.from(JSON.stringify(data)));
21
21
  console.log(`Message published Exchange:${this.exchangeName} / RoutingKey: ${this.routingKey}`);
22
22
  });
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecom-micro/common",
3
- "version": "2.0.36",
3
+ "version": "2.0.38",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",