@autofleet/rabbit 3.3.0-beta.0 → 3.3.0-beta.1
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 +18 -12
- package/dist/index.js +185 -107
- package/dist/lib/celery.d.ts +9 -0
- package/dist/lib/celery.js +54 -0
- package/dist/lib/consts.d.ts +5 -2
- package/dist/lib/consts.js +7 -3
- package/dist/lib/types.d.ts +10 -0
- package/dist/lib/utils.d.ts +2 -2
- package/package.json +5 -2
- package/src/index.ts +230 -132
- package/src/lib/celery.ts +89 -0
- package/src/lib/consts.ts +6 -2
- package/src/lib/types.ts +12 -0
- package/src/lib/utils.ts +6 -2
- package/coverage/clover.xml +0 -7
- package/coverage/coverage-final.json +0 -1
- package/coverage/lcov-report/base.css +0 -212
- package/coverage/lcov-report/index.html +0 -60
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -1
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -158
- package/coverage/lcov.info +0 -0
package/dist/lib/consts.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ConnectionPurpose = exports.DEFAULT_OPTIONS = exports.DEFAULT_USE_CONSUME_WITH_LOCK = exports.USER_OBJECT = exports.AUTOMATION_ID_HEADER = exports.USER_TRACING_HEADER = exports.TRACING_HEADER = exports.RETRY_HEADER = exports.DEFAULT_LOCK_TIMEOUT = exports.DEFAULT_DEAD_TTL_TWO_DAYS = void 0;
|
|
4
4
|
exports.DEFAULT_DEAD_TTL_TWO_DAYS = 60000 * 60 * 12;
|
|
5
5
|
exports.DEFAULT_LOCK_TIMEOUT = 1000 * 5;
|
|
6
6
|
exports.RETRY_HEADER = 'x-retry-count';
|
|
7
7
|
exports.TRACING_HEADER = 'x-trace-id';
|
|
8
8
|
exports.USER_TRACING_HEADER = 'x-af-user-id';
|
|
9
|
+
exports.AUTOMATION_ID_HEADER = 'x-af-automation-id';
|
|
9
10
|
exports.USER_OBJECT = 'userObject';
|
|
10
11
|
exports.DEFAULT_USE_CONSUME_WITH_LOCK = false;
|
|
11
|
-
exports.CONNECTION_CREATED_CONST = 'connectionCreated';
|
|
12
|
-
exports.CONNECTION_FAILED_CONST = 'connectionFailed';
|
|
13
12
|
exports.DEFAULT_OPTIONS = {
|
|
14
13
|
limit: 1,
|
|
15
14
|
retries: 1,
|
|
@@ -19,3 +18,8 @@ exports.DEFAULT_OPTIONS = {
|
|
|
19
18
|
auditContext: null,
|
|
20
19
|
enableRabbitTrace: false,
|
|
21
20
|
};
|
|
21
|
+
var ConnectionPurpose;
|
|
22
|
+
(function (ConnectionPurpose) {
|
|
23
|
+
ConnectionPurpose["Consume"] = "consume";
|
|
24
|
+
ConnectionPurpose["Publish"] = "publish";
|
|
25
|
+
})(ConnectionPurpose = exports.ConnectionPurpose || (exports.ConnectionPurpose = {}));
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AmqpConnectionManager } from 'amqp-connection-manager';
|
|
1
2
|
import { ConsumeMessage, Options, Replies } from 'amqplib';
|
|
2
3
|
export interface ExchangesCache {
|
|
3
4
|
[key: string]: any;
|
|
@@ -8,6 +9,9 @@ export interface QueuesCache {
|
|
|
8
9
|
export interface QueueSetupPromisesDictionary {
|
|
9
10
|
[key: string]: Promise<Replies.AssertQueue> | undefined;
|
|
10
11
|
}
|
|
12
|
+
export interface AssertExchangePromisesDictionary {
|
|
13
|
+
[key: string]: Promise<Replies.AssertExchange> | undefined;
|
|
14
|
+
}
|
|
11
15
|
export type CustomMessageHeaders = {
|
|
12
16
|
redisTimestampValidationKey?: string;
|
|
13
17
|
};
|
|
@@ -38,3 +42,9 @@ export type AfConsumer = {
|
|
|
38
42
|
options: ConsumeOptions | undefined;
|
|
39
43
|
};
|
|
40
44
|
export declare const CONSUMER_DEFAULT_OPTIONS: Options.Consume;
|
|
45
|
+
export type ConnectionData = {
|
|
46
|
+
connection: AmqpConnectionManager | null;
|
|
47
|
+
creatingConnection: boolean;
|
|
48
|
+
connectionCreatedEventName: string;
|
|
49
|
+
connectionFailedEventName: string;
|
|
50
|
+
};
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChannelWrapper } from 'amqp-connection-manager';
|
|
2
|
-
import { ConfirmChannel } from 'amqplib';
|
|
3
|
-
export declare const assertExchangeFanout: (c: ChannelWrapper | ConfirmChannel, exchangeName: string) => Promise<
|
|
2
|
+
import { ConfirmChannel, Replies } from 'amqplib';
|
|
3
|
+
export declare const assertExchangeFanout: (c: ChannelWrapper | ConfirmChannel, exchangeName: string) => Promise<Replies.AssertExchange>;
|
|
4
4
|
export declare const wrapSetImmediate: (callback: () => any) => Promise<any>;
|
|
5
5
|
export declare const rand: () => number;
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/rabbit",
|
|
3
|
-
"version": "3.3.0-beta.
|
|
3
|
+
"version": "3.3.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=16.7.0"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"postinstall": "echo '\\033[0;31m\nWARNING: in case of migrating to new version of @autofleet/rabbit \nyou might have to delete existing queues or the deployment will fail.\\033[0m\n'",
|
|
8
11
|
"start": "ts-node src/index.ts",
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
"dev": "nodemon"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@autofleet/zehut": "3.
|
|
21
|
+
"@autofleet/zehut": "^3.1.2",
|
|
19
22
|
"amqp-connection-manager": "4.1.9",
|
|
20
23
|
"amqplib": "0.10.3",
|
|
21
24
|
"bluebird": "^3.7.2",
|