@autofleet/rabbit 3.6.1-beta-e33c35c7.0 → 4.0.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 +15 -22
- package/dist/index.js +162 -281
- package/dist/lib/celery.js +0 -1
- package/dist/lib/consts.d.ts +2 -0
- package/dist/lib/consts.js +3 -2
- 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.js +0 -1
- 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 -22
- package/src/index.ts +187 -329
- package/src/lib/consts.ts +2 -0
- package/src/lib/types.ts +0 -10
- package/src/{mock/index.ts → mock.ts} +2 -2
- package/tsconfig.json +2 -2
- package/.claude/settings.local.json +0 -3
- 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 -16
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;
|
|
@@ -32,17 +32,16 @@ export interface AfRabbitOptions {
|
|
|
32
32
|
*/
|
|
33
33
|
dontRetryAssert?: boolean;
|
|
34
34
|
rabbitHost?: string;
|
|
35
|
+
vhost?: string;
|
|
35
36
|
}
|
|
36
37
|
type newChannelOpts = {
|
|
37
38
|
name?: string;
|
|
38
39
|
onClose?: null | ((args: any | null) => void);
|
|
39
40
|
options?: CreateChannelOpts | undefined;
|
|
40
|
-
connection: ConnectionData;
|
|
41
41
|
};
|
|
42
42
|
type assertChannelOpts = {
|
|
43
43
|
channelName?: string;
|
|
44
44
|
force?: boolean;
|
|
45
|
-
connection: ConnectionData;
|
|
46
45
|
};
|
|
47
46
|
declare class RabbitMq implements IAfRabbitMq {
|
|
48
47
|
static parseMsg(msg: any): any;
|
|
@@ -59,11 +58,10 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
59
58
|
};
|
|
60
59
|
DISCONNECT_MSG: string;
|
|
61
60
|
RECONNECT_MSG: string;
|
|
62
|
-
|
|
61
|
+
channel: ChannelWrapper | null;
|
|
63
62
|
publishChannelSetupPromise: Promise<ChannelWrapper> | null;
|
|
64
63
|
blockReconnect: boolean | null | undefined;
|
|
65
|
-
|
|
66
|
-
consumeConnection: ConnectionData;
|
|
64
|
+
connection: AmqpConnectionManager | null | undefined;
|
|
67
65
|
em: EventEmitter;
|
|
68
66
|
creatingConnection: boolean;
|
|
69
67
|
exchanges: ExchangesCache;
|
|
@@ -76,14 +74,11 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
76
74
|
/** Array of consumers tags used for canceling consumption */
|
|
77
75
|
consumersTags: Array<[ConfirmChannel, string]>;
|
|
78
76
|
private consumers;
|
|
79
|
-
private
|
|
80
|
-
|
|
81
|
-
private needsConsumerReestablishment;
|
|
82
|
-
oldPublishChannel: ChannelWrapper | null;
|
|
77
|
+
private isVHostExist;
|
|
78
|
+
oldChannel: ChannelWrapper | null;
|
|
83
79
|
oldPublishChannelSetupPromise: Promise<ChannelWrapper> | null;
|
|
84
80
|
oldBlockReconnect: boolean | null | undefined;
|
|
85
|
-
|
|
86
|
-
oldConsumeConnection: ConnectionData;
|
|
81
|
+
oldConnection: AmqpConnectionManager | null | undefined;
|
|
87
82
|
oldEm: EventEmitter;
|
|
88
83
|
oldCreatingConnection: boolean;
|
|
89
84
|
oldExchanges: ExchangesCache;
|
|
@@ -92,16 +87,15 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
92
87
|
oldAssertExchangePromises: AssertExchangePromisesDictionary;
|
|
93
88
|
oldConsumersTags: Array<[ConfirmChannel, string]>;
|
|
94
89
|
private oldConsumers;
|
|
95
|
-
private oldNeedsConsumerReestablishment;
|
|
96
90
|
constructor(options?: AfRabbitOptions, redisConfig?: RedisConfig);
|
|
97
91
|
private assertVHost;
|
|
98
92
|
private shouldConsumeMessageByTimestamp;
|
|
99
93
|
ack: (channel: ConfirmChannel, msg: ConsumeMessageOrNull, shouldUpdateRedisTimestamp?: boolean, releaseLock?: null) => (userMsg: ConsumeMessage) => Promise<any>;
|
|
100
94
|
nack: (channel: ConfirmChannel, queue: string, options: any, deadQueueOptions: Options.AssertQueue, msg: ConsumeMessageOrNull, releaseLock: any) => (userMsg: ConsumeMessageOrNull, { skipRetry, }?: NackOptions) => Promise<any>;
|
|
101
|
-
getConnection(
|
|
102
|
-
getNewChannel({ name, onClose, options
|
|
103
|
-
assertChannel({ force
|
|
104
|
-
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>;
|
|
105
99
|
getQueueLength(queue: string): Promise<Replies.AssertQueue>;
|
|
106
100
|
private deleteQueue;
|
|
107
101
|
bindQueue(queue: string, exchange: string): Promise<void>;
|
|
@@ -121,15 +115,14 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
121
115
|
isConnected(): Promise<boolean>;
|
|
122
116
|
gracefulShutdown(signal: string): Promise<void>;
|
|
123
117
|
private consumeFromRabbitOld;
|
|
124
|
-
getNewChannelOld({ name, onClose, options
|
|
125
|
-
getConnectionOld(
|
|
118
|
+
getNewChannelOld({ name, onClose, options }?: newChannelOpts): Promise<ChannelWrapper>;
|
|
119
|
+
getConnectionOld(): Promise<AmqpConnectionManager>;
|
|
126
120
|
private saveConsumerOld;
|
|
127
121
|
assertQueueOld(queueName: string, options?: Options.AssertQueue): Promise<any>;
|
|
128
122
|
setupQueueOld(queueName: string, options?: Options.AssertQueue): Promise<Replies.AssertQueue>;
|
|
129
|
-
assertChannelOld({ force
|
|
123
|
+
assertChannelOld({ force }?: assertChannelOpts): Promise<ChannelWrapper>;
|
|
130
124
|
private deleteQueueOld;
|
|
131
|
-
assertExchangeOld(exchangeName: string,
|
|
132
|
-
private maskURL;
|
|
125
|
+
assertExchangeOld(exchangeName: string, options?: any): Promise<any>;
|
|
133
126
|
}
|
|
134
127
|
export default RabbitMq;
|
|
135
128
|
export { sendCeleryTaskViaHttp, } from './lib/celery';
|