@autofleet/rabbit 4.0.2-beta.8 → 4.1.0-beta.0
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/coverage/clover.xml +669 -0
- package/coverage/coverage-final.json +9 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/index.html +131 -0
- package/coverage/lcov-report/src/index.ts.html +3826 -0
- package/coverage/lcov-report/src/lib/celery.ts.html +352 -0
- package/coverage/lcov-report/src/lib/consts.ts.html +142 -0
- package/coverage/lcov-report/src/lib/index.html +191 -0
- package/coverage/lcov-report/src/lib/rabbitError.ts.html +103 -0
- package/coverage/lcov-report/src/lib/redis.ts.html +133 -0
- package/coverage/lcov-report/src/lib/types.ts.html +268 -0
- package/coverage/lcov-report/src/lib/utils.ts.html +142 -0
- package/coverage/lcov-report/src/logger.ts.html +100 -0
- package/coverage/lcov.info +1076 -0
- package/dist/index.d.ts +19 -33
- package/dist/index.js +217 -341
- package/dist/lib/celery.js +0 -1
- package/dist/lib/consts.d.ts +2 -10
- package/dist/lib/consts.js +3 -12
- package/dist/lib/rabbitError.js +0 -1
- package/dist/lib/redis.js +0 -1
- package/dist/lib/types.d.ts +0 -8
- package/dist/lib/types.js +0 -1
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +1 -9
- package/dist/logger.js +0 -1
- package/dist/{mock/index.d.ts → mock.d.ts} +1 -1
- package/dist/{mock/index.js → mock.js} +1 -2
- package/package.json +16 -23
- package/src/index.ts +243 -417
- package/src/lib/consts.ts +2 -11
- package/src/lib/types.ts +0 -10
- package/src/lib/utils.ts +0 -10
- package/src/{mock/index.ts → mock.ts} +2 -2
- package/tsconfig.json +2 -2
- package/dist/index.js.map +0 -1
- package/dist/lib/celery.js.map +0 -1
- package/dist/lib/consts.js.map +0 -1
- package/dist/lib/rabbitError.js.map +0 -1
- package/dist/lib/redis.js.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/mock/index.js.map +0 -1
- package/dist/mock/vitest.d.ts +0 -13
- package/dist/mock/vitest.js +0 -18
- package/dist/mock/vitest.js.map +0 -1
- package/src/mock/vitest.ts +0 -24
- package/tsconfig.build.json +0 -5
- package/vitest.config.ts +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { AmqpConnectionManager, ChannelWrapper, CreateChannelOpts } from 'amqp-connection-manager';
|
|
4
4
|
import { ConfirmChannel, ConsumeMessage, Options, Replies } from 'amqplib';
|
|
5
5
|
import { RedisConfig } from './lib/redis';
|
|
6
|
-
import { CallbackFunction, ConsumeMessageOrNull, ConsumeOptions, CustomMessageHeaders, QueuesCache, RedisLockType, ExchangesCache, QueueSetupPromisesDictionary, AssertExchangePromisesDictionary
|
|
6
|
+
import { CallbackFunction, ConsumeMessageOrNull, ConsumeOptions, CustomMessageHeaders, QueuesCache, RedisLockType, ExchangesCache, QueueSetupPromisesDictionary, AssertExchangePromisesDictionary } from './lib/types';
|
|
7
7
|
export interface IAfRabbitMq {
|
|
8
8
|
ack: any;
|
|
9
9
|
nack: any;
|
|
@@ -38,12 +38,10 @@ type newChannelOpts = {
|
|
|
38
38
|
name?: string;
|
|
39
39
|
onClose?: null | ((args: any | null) => void);
|
|
40
40
|
options?: CreateChannelOpts | undefined;
|
|
41
|
-
connection: ConnectionData;
|
|
42
41
|
};
|
|
43
42
|
type assertChannelOpts = {
|
|
44
43
|
channelName?: string;
|
|
45
44
|
force?: boolean;
|
|
46
|
-
connection: ConnectionData;
|
|
47
45
|
};
|
|
48
46
|
declare class RabbitMq implements IAfRabbitMq {
|
|
49
47
|
static parseMsg(msg: any): any;
|
|
@@ -60,54 +58,44 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
60
58
|
};
|
|
61
59
|
DISCONNECT_MSG: string;
|
|
62
60
|
RECONNECT_MSG: string;
|
|
63
|
-
|
|
61
|
+
channel: ChannelWrapper | null;
|
|
64
62
|
publishChannelSetupPromise: Promise<ChannelWrapper> | null;
|
|
65
63
|
blockReconnect: boolean | null | undefined;
|
|
66
|
-
|
|
67
|
-
consumeConnection: ConnectionData;
|
|
64
|
+
connection: AmqpConnectionManager | null | undefined;
|
|
68
65
|
em: EventEmitter;
|
|
69
66
|
creatingConnection: boolean;
|
|
70
67
|
exchanges: ExchangesCache;
|
|
71
68
|
queues: QueuesCache;
|
|
72
69
|
queueSetupPromises: QueueSetupPromisesDictionary;
|
|
73
70
|
assertExchangePromises: AssertExchangePromisesDictionary;
|
|
74
|
-
options: AfRabbitOptions;
|
|
71
|
+
options: AfRabbitOptions | undefined;
|
|
75
72
|
redisClient: any;
|
|
76
73
|
redisLock?: RedisLockType;
|
|
77
74
|
/** Array of consumers tags used for canceling consumption */
|
|
78
|
-
consumersTags:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
private consumersToRegister;
|
|
83
|
-
private doesVHostExist;
|
|
84
|
-
private vhost;
|
|
85
|
-
private gracefulShutdownStarted;
|
|
86
|
-
oldPublishChannel: ChannelWrapper | null;
|
|
75
|
+
consumersTags: Array<[ConfirmChannel, string]>;
|
|
76
|
+
private consumers;
|
|
77
|
+
private isVHostExist;
|
|
78
|
+
oldChannel: ChannelWrapper | null;
|
|
87
79
|
oldPublishChannelSetupPromise: Promise<ChannelWrapper> | null;
|
|
88
80
|
oldBlockReconnect: boolean | null | undefined;
|
|
89
|
-
|
|
90
|
-
oldConsumeConnection: ConnectionData;
|
|
81
|
+
oldConnection: AmqpConnectionManager | null | undefined;
|
|
91
82
|
oldEm: EventEmitter;
|
|
92
83
|
oldCreatingConnection: boolean;
|
|
93
84
|
oldExchanges: ExchangesCache;
|
|
94
85
|
oldQueues: QueuesCache;
|
|
95
86
|
oldQueueSetupPromises: QueueSetupPromisesDictionary;
|
|
96
87
|
oldAssertExchangePromises: AssertExchangePromisesDictionary;
|
|
97
|
-
oldConsumersTags:
|
|
98
|
-
|
|
99
|
-
consumerTag: string;
|
|
100
|
-
}>;
|
|
101
|
-
private oldConsumersToRegister;
|
|
88
|
+
oldConsumersTags: Array<[ConfirmChannel, string]>;
|
|
89
|
+
private oldConsumers;
|
|
102
90
|
constructor(options?: AfRabbitOptions, redisConfig?: RedisConfig);
|
|
103
91
|
private assertVHost;
|
|
104
92
|
private shouldConsumeMessageByTimestamp;
|
|
105
93
|
ack: (channel: ConfirmChannel, msg: ConsumeMessageOrNull, shouldUpdateRedisTimestamp?: boolean, releaseLock?: null) => (userMsg: ConsumeMessage) => Promise<any>;
|
|
106
94
|
nack: (channel: ConfirmChannel, queue: string, options: any, deadQueueOptions: Options.AssertQueue, msg: ConsumeMessageOrNull, releaseLock: any) => (userMsg: ConsumeMessageOrNull, { skipRetry, }?: NackOptions) => Promise<any>;
|
|
107
|
-
getConnection(
|
|
108
|
-
getNewChannel({ name, onClose, options
|
|
109
|
-
assertChannel({ force
|
|
110
|
-
assertExchange(exchangeName: string,
|
|
95
|
+
getConnection(): Promise<AmqpConnectionManager>;
|
|
96
|
+
getNewChannel({ name, onClose, options }?: newChannelOpts): Promise<ChannelWrapper>;
|
|
97
|
+
assertChannel({ force }?: assertChannelOpts): Promise<ChannelWrapper>;
|
|
98
|
+
assertExchange(exchangeName: string, options?: any): Promise<any>;
|
|
111
99
|
getQueueLength(queue: string): Promise<Replies.AssertQueue>;
|
|
112
100
|
private deleteQueue;
|
|
113
101
|
bindQueue(queue: string, exchange: string): Promise<void>;
|
|
@@ -127,16 +115,14 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
127
115
|
isConnected(): Promise<boolean>;
|
|
128
116
|
gracefulShutdown(signal: string): Promise<void>;
|
|
129
117
|
private consumeFromRabbitOld;
|
|
130
|
-
getNewChannelOld({ name, onClose, options
|
|
131
|
-
getConnectionOld(
|
|
118
|
+
getNewChannelOld({ name, onClose, options }?: newChannelOpts): Promise<ChannelWrapper>;
|
|
119
|
+
getConnectionOld(): Promise<AmqpConnectionManager>;
|
|
132
120
|
private saveConsumerOld;
|
|
133
121
|
assertQueueOld(queueName: string, options?: Options.AssertQueue): Promise<any>;
|
|
134
122
|
setupQueueOld(queueName: string, options?: Options.AssertQueue): Promise<Replies.AssertQueue>;
|
|
135
|
-
assertChannelOld({ force
|
|
123
|
+
assertChannelOld({ force }?: assertChannelOpts): Promise<ChannelWrapper>;
|
|
136
124
|
private deleteQueueOld;
|
|
137
|
-
assertExchangeOld(exchangeName: string,
|
|
138
|
-
isConnectedOld(): Promise<boolean>;
|
|
139
|
-
private maskURL;
|
|
125
|
+
assertExchangeOld(exchangeName: string, options?: any): Promise<any>;
|
|
140
126
|
}
|
|
141
127
|
export default RabbitMq;
|
|
142
128
|
export { sendCeleryTaskViaHttp, } from './lib/celery';
|