@autofleet/rabbit 2.1.12-beta1 → 2.1.12
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 +1 -1
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/src/index.ts +4 -7
- package/.env +0 -0
- package/dump.rdb +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
52
52
|
assertExchange(exchangeName: string, options?: any): Promise<any>;
|
|
53
53
|
getQueueLength(queue: string): Promise<import("amqplib").Replies.AssertQueue>;
|
|
54
54
|
bindQueue(queue: string, exchange: string): Promise<void>;
|
|
55
|
-
assertQueue(queue: string, options?: Options.AssertQueue): Promise<
|
|
55
|
+
assertQueue(queue: string, options?: Options.AssertQueue): Promise<import("amqplib").Replies.AssertQueue>;
|
|
56
56
|
consume(queue: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any): Promise<void>;
|
|
57
57
|
consumeFromExchange(queue: string, exchange: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any): Promise<void>;
|
|
58
58
|
publish(exchange: string, content: any, customHeaders?: any): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment,@typescript-eslint/ban-types,@typescript-eslint/no-unused-vars,consistent-return,no-async-promise-executor,no-param-reassign,no-empty */
|
|
16
|
+
// eslint-disable-next-line max-classes-per-file
|
|
15
17
|
const moment_1 = __importDefault(require("moment"));
|
|
16
18
|
const amqp_connection_manager_1 = require("amqp-connection-manager");
|
|
17
19
|
const events_1 = require("events");
|
|
@@ -160,11 +162,9 @@ class RabbitMq {
|
|
|
160
162
|
if (this.exchanges[exchangeName]) {
|
|
161
163
|
return this.exchanges[exchangeName];
|
|
162
164
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return exchange;
|
|
167
|
-
}));
|
|
165
|
+
const exchange = yield assertExchangeFanout(channel, exchangeName);
|
|
166
|
+
this.exchanges[exchangeName] = exchange;
|
|
167
|
+
return exchange;
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
getQueueLength(queue) {
|
|
@@ -186,7 +186,7 @@ class RabbitMq {
|
|
|
186
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
187
187
|
RabbitMq.validateName('queue', queue);
|
|
188
188
|
const channel = yield this.assertChannel();
|
|
189
|
-
return channel.
|
|
189
|
+
return channel.assertQueue(queue, options);
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
consume(queue, callback, options) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment,@typescript-eslint/ban-types,@typescript-eslint/no-unused-vars,consistent-return,no-async-promise-executor,no-param-reassign,no-empty */
|
|
2
2
|
// eslint-disable-next-line max-classes-per-file
|
|
3
|
-
import * as bluebird from 'bluebird';
|
|
4
3
|
import moment from 'moment';
|
|
5
4
|
import { ConfirmChannel, Options } from 'amqplib';
|
|
6
5
|
import { AmqpConnectionManager, ChannelWrapper, connect } from 'amqp-connection-manager';
|
|
@@ -214,11 +213,9 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
214
213
|
if (this.exchanges[exchangeName]) {
|
|
215
214
|
return this.exchanges[exchangeName];
|
|
216
215
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return exchange;
|
|
221
|
-
});
|
|
216
|
+
const exchange = await assertExchangeFanout(channel, exchangeName);
|
|
217
|
+
this.exchanges[exchangeName] = exchange;
|
|
218
|
+
return exchange;
|
|
222
219
|
}
|
|
223
220
|
|
|
224
221
|
async getQueueLength(queue: string) {
|
|
@@ -237,7 +234,7 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
237
234
|
async assertQueue(queue: string, options?: Options.AssertQueue) {
|
|
238
235
|
RabbitMq.validateName('queue', queue);
|
|
239
236
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
240
|
-
return channel.
|
|
237
|
+
return channel.assertQueue(queue, options);
|
|
241
238
|
}
|
|
242
239
|
|
|
243
240
|
async consume(queue: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any) {
|
package/.env
DELETED
|
File without changes
|
package/dump.rdb
DELETED
|
Binary file
|