sb-rabbitmq-provider 1.0.19 → 1.0.21

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/index.d.ts CHANGED
@@ -15,7 +15,6 @@ interface rabbitMQConfig {
15
15
  vhost?: string | undefined;
16
16
  exchangeName?: string;
17
17
  exchangeType: string;
18
- publishOptions?: Record<string, string> | undefined;
19
18
  }
20
19
  type MyCallback = (data: any) => any;
21
20
  declare class RabbitMqConnection {
@@ -23,7 +22,6 @@ declare class RabbitMqConnection {
23
22
  exchange: string;
24
23
  exchangeType: string;
25
24
  connection: any;
26
- publishOptions: Options.Publish | undefined;
27
25
  /**
28
26
  * constructor for initialising url, exchange name, exchange type
29
27
  * @param url rabbitmq url
@@ -49,7 +47,7 @@ declare class RabbitMqConnection {
49
47
  * @param message object
50
48
  * @returns
51
49
  */
52
- publish(channel: RabbitMQChannel, queueName: string, message: object): Promise<{
50
+ publish(channel: RabbitMQChannel, queueName: string, message: object, publishOptions?: undefined): Promise<{
53
51
  status: boolean;
54
52
  message: string;
55
53
  }>;
package/dist/index.js CHANGED
@@ -33,7 +33,6 @@ class RabbitMqConnection {
33
33
  if (config.exchangeType && typeof config.exchangeType === 'string') {
34
34
  this.exchangeType = config.exchangeType;
35
35
  }
36
- this.publishOptions = config.publishOptions || undefined;
37
36
  this.config = config;
38
37
  }
39
38
  /**
@@ -77,11 +76,11 @@ class RabbitMqConnection {
77
76
  * @param message object
78
77
  * @returns
79
78
  */
80
- publish(channel, queueName, message) {
79
+ publish(channel, queueName, message, publishOptions = undefined) {
81
80
  return __awaiter(this, void 0, void 0, function* () {
82
81
  try {
83
82
  const bufferMessage = Buffer.from(JSON.stringify(message));
84
- channel.publish(this.exchange, queueName, bufferMessage, this.publishOptions);
83
+ channel.publish(this.exchange, queueName, bufferMessage, publishOptions);
85
84
  return { status: true, message: 'Data sent to Queue' };
86
85
  }
87
86
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sb-rabbitmq-provider",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Pub/Sub model for RabbitMq",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",