@autofleet/rabbit 5.0.2 → 5.0.4

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.
@@ -1,35 +1,27 @@
1
1
  import { EventEmitter } from "node:events";
2
2
  import RedisLock from "redis-lock";
3
3
  import { AmqpConnectionManager, ChannelWrapper, CreateChannelOpts } from "amqp-connection-manager";
4
- import { LoggerInstanceManager } from "@autofleet/logger";
5
- import { createClient } from "redis";
6
4
  import { PublishOptions } from "amqp-connection-manager/dist/types/ChannelWrapper";
7
5
  import { ConfirmChannel, ConsumeMessage, Options, Replies } from "amqplib";
6
+ import { LoggerInstanceManager } from "@autofleet/logger";
7
+ import { createClient } from "redis";
8
8
 
9
9
  //#region src/lib/redis.d.ts
10
- type RedisConfig = {
10
+ interface RedisConfig {
11
11
  host: string;
12
12
  port: number | undefined;
13
13
  prefix?: string;
14
- };
14
+ }
15
15
  declare const getRedisInstance: (config: RedisConfig) => ReturnType<typeof createClient>;
16
16
  //#endregion
17
17
  //#region src/lib/types.d.ts
18
- interface ExchangesCache {
19
- [key: string]: Replies.AssertExchange | undefined;
20
- }
21
- interface QueuesCache {
22
- [key: string]: Replies.AssertQueue | undefined;
23
- }
24
- interface QueueSetupPromisesDictionary {
25
- [key: string]: Promise<Replies.AssertQueue> | undefined;
26
- }
27
- interface AssertExchangePromisesDictionary {
28
- [key: string]: Promise<Replies.AssertExchange> | undefined;
29
- }
30
- type CustomMessageHeaders = {
18
+ type ExchangesCache = Record<string, Replies.AssertExchange | undefined>;
19
+ type QueuesCache = Record<string, Replies.AssertQueue | undefined>;
20
+ type QueueSetupPromisesDictionary = Record<string, Promise<Replies.AssertQueue> | undefined>;
21
+ type AssertExchangePromisesDictionary = Record<string, Promise<Replies.AssertExchange> | undefined>;
22
+ interface CustomMessageHeaders {
31
23
  redisTimestampValidationKey?: string;
32
- };
24
+ }
33
25
  type ConsumeMessageOrNull = ConsumeMessage | null;
34
26
  interface ConsumeOptions {
35
27
  retries?: number;
@@ -49,18 +41,16 @@ type Message = Omit<ConsumeMessage, "content"> & {
49
41
  content: any;
50
42
  };
51
43
  type CallbackFunction = (msg: Message, ack: () => Promise<void>, nack: (ignored: ConsumeMessageOrNull, nackOptions?: NackOptions) => Promise<void>) => Promise<void>;
52
- type ConnectionData = {
44
+ interface ConnectionData {
53
45
  amqpConnection: AmqpConnectionManager | null;
54
46
  creatingConnection: boolean;
55
47
  connectionCreatedEventName: string;
56
48
  connectionFailedEventName: string;
57
49
  blockReconnect: boolean;
58
- };
50
+ }
59
51
  //#endregion
60
52
  //#region src/lib/celery.d.ts
61
- interface TaskData {
62
- [key: string]: any;
63
- }
53
+ type TaskData = Record<string, any>;
64
54
  interface SendTaskOptions {
65
55
  taskName: string;
66
56
  queueName: string;
@@ -99,17 +89,17 @@ interface AfRabbitOptions {
99
89
  vhost?: string;
100
90
  logger?: LoggerInstanceManager;
101
91
  }
102
- type newChannelOpts = {
92
+ interface newChannelOpts {
103
93
  name?: string;
104
94
  onClose?: null | ((args: any | null) => void);
105
95
  options?: CreateChannelOpts | undefined;
106
96
  connection: ConnectionData;
107
- };
108
- type assertChannelOpts = {
97
+ }
98
+ interface assertChannelOpts {
109
99
  channelName?: string;
110
100
  force?: boolean;
111
101
  connection: ConnectionData;
112
- };
102
+ }
113
103
  declare class RabbitMq implements IAfRabbitMq {
114
104
  #private;
115
105
  readonly options: AfRabbitOptions;
@@ -212,5 +202,5 @@ declare class RabbitMq implements IAfRabbitMq {
212
202
  private maskURL;
213
203
  }
214
204
  //#endregion
215
- export { AfRabbitOptions, IAfRabbitMq, RabbitMq, sendCeleryTaskViaHttp };
216
- //# sourceMappingURL=index-K1ijaudV.d.ts.map
205
+ export { sendCeleryTaskViaHttp as i, IAfRabbitMq as n, RabbitMq as r, AfRabbitOptions as t };
206
+ //# sourceMappingURL=index-BSNGP44W.d.cts.map
@@ -1,35 +1,27 @@
1
1
  import { EventEmitter } from "node:events";
2
2
  import RedisLock from "redis-lock";
3
3
  import { AmqpConnectionManager, ChannelWrapper, CreateChannelOpts } from "amqp-connection-manager";
4
- import { PublishOptions } from "amqp-connection-manager/dist/types/ChannelWrapper";
5
- import { ConfirmChannel, ConsumeMessage, Options, Replies } from "amqplib";
6
4
  import { LoggerInstanceManager } from "@autofleet/logger";
7
5
  import { createClient } from "redis";
6
+ import { PublishOptions } from "amqp-connection-manager/dist/types/ChannelWrapper";
7
+ import { ConfirmChannel, ConsumeMessage, Options, Replies } from "amqplib";
8
8
 
9
9
  //#region src/lib/redis.d.ts
10
- type RedisConfig = {
10
+ interface RedisConfig {
11
11
  host: string;
12
12
  port: number | undefined;
13
13
  prefix?: string;
14
- };
14
+ }
15
15
  declare const getRedisInstance: (config: RedisConfig) => ReturnType<typeof createClient>;
16
16
  //#endregion
17
17
  //#region src/lib/types.d.ts
18
- interface ExchangesCache {
19
- [key: string]: Replies.AssertExchange | undefined;
20
- }
21
- interface QueuesCache {
22
- [key: string]: Replies.AssertQueue | undefined;
23
- }
24
- interface QueueSetupPromisesDictionary {
25
- [key: string]: Promise<Replies.AssertQueue> | undefined;
26
- }
27
- interface AssertExchangePromisesDictionary {
28
- [key: string]: Promise<Replies.AssertExchange> | undefined;
29
- }
30
- type CustomMessageHeaders = {
18
+ type ExchangesCache = Record<string, Replies.AssertExchange | undefined>;
19
+ type QueuesCache = Record<string, Replies.AssertQueue | undefined>;
20
+ type QueueSetupPromisesDictionary = Record<string, Promise<Replies.AssertQueue> | undefined>;
21
+ type AssertExchangePromisesDictionary = Record<string, Promise<Replies.AssertExchange> | undefined>;
22
+ interface CustomMessageHeaders {
31
23
  redisTimestampValidationKey?: string;
32
- };
24
+ }
33
25
  type ConsumeMessageOrNull = ConsumeMessage | null;
34
26
  interface ConsumeOptions {
35
27
  retries?: number;
@@ -49,18 +41,16 @@ type Message = Omit<ConsumeMessage, "content"> & {
49
41
  content: any;
50
42
  };
51
43
  type CallbackFunction = (msg: Message, ack: () => Promise<void>, nack: (ignored: ConsumeMessageOrNull, nackOptions?: NackOptions) => Promise<void>) => Promise<void>;
52
- type ConnectionData = {
44
+ interface ConnectionData {
53
45
  amqpConnection: AmqpConnectionManager | null;
54
46
  creatingConnection: boolean;
55
47
  connectionCreatedEventName: string;
56
48
  connectionFailedEventName: string;
57
49
  blockReconnect: boolean;
58
- };
50
+ }
59
51
  //#endregion
60
52
  //#region src/lib/celery.d.ts
61
- interface TaskData {
62
- [key: string]: any;
63
- }
53
+ type TaskData = Record<string, any>;
64
54
  interface SendTaskOptions {
65
55
  taskName: string;
66
56
  queueName: string;
@@ -99,17 +89,17 @@ interface AfRabbitOptions {
99
89
  vhost?: string;
100
90
  logger?: LoggerInstanceManager;
101
91
  }
102
- type newChannelOpts = {
92
+ interface newChannelOpts {
103
93
  name?: string;
104
94
  onClose?: null | ((args: any | null) => void);
105
95
  options?: CreateChannelOpts | undefined;
106
96
  connection: ConnectionData;
107
- };
108
- type assertChannelOpts = {
97
+ }
98
+ interface assertChannelOpts {
109
99
  channelName?: string;
110
100
  force?: boolean;
111
101
  connection: ConnectionData;
112
- };
102
+ }
113
103
  declare class RabbitMq implements IAfRabbitMq {
114
104
  #private;
115
105
  readonly options: AfRabbitOptions;
@@ -212,5 +202,5 @@ declare class RabbitMq implements IAfRabbitMq {
212
202
  private maskURL;
213
203
  }
214
204
  //#endregion
215
- export { AfRabbitOptions, IAfRabbitMq, RabbitMq, sendCeleryTaskViaHttp };
216
- //# sourceMappingURL=index-B6pk4Ot8.d.cts.map
205
+ export { sendCeleryTaskViaHttp as i, IAfRabbitMq as n, RabbitMq as r, AfRabbitOptions as t };
206
+ //# sourceMappingURL=index-Di_b_UEl.d.ts.map