@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/lib/celery.js
CHANGED
package/dist/lib/consts.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare const USER_TRACING_HEADER = "x-af-user-id";
|
|
|
6
6
|
export declare const AUTOMATION_ID_HEADER = "x-af-automation-id";
|
|
7
7
|
export declare const USER_OBJECT = "userObject";
|
|
8
8
|
export declare const DEFAULT_USE_CONSUME_WITH_LOCK = false;
|
|
9
|
+
export declare const CONNECTION_CREATED_CONST = "connectionCreated";
|
|
10
|
+
export declare const CONNECTION_FAILED_CONST = "connectionFailed";
|
|
9
11
|
export declare const DEFAULT_OPTIONS: {
|
|
10
12
|
limit: number;
|
|
11
13
|
retries: number;
|
|
@@ -15,13 +17,3 @@ export declare const DEFAULT_OPTIONS: {
|
|
|
15
17
|
auditContext: null;
|
|
16
18
|
enableRabbitTrace: boolean;
|
|
17
19
|
};
|
|
18
|
-
export declare const ASSERT_VHOST_EXPONENTIAL_BACKOFF_DEV_ENV_CONFIG: {
|
|
19
|
-
startingDelay: number;
|
|
20
|
-
timeMultiple: number;
|
|
21
|
-
numOfAttempts: number;
|
|
22
|
-
};
|
|
23
|
-
export declare const ASSERT_VHOST_EXPONENTIAL_BACKOFF_PROD_CONFIG: {
|
|
24
|
-
startingDelay: number;
|
|
25
|
-
timeMultiple: number;
|
|
26
|
-
numOfAttempts: number;
|
|
27
|
-
};
|
package/dist/lib/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_OPTIONS = exports.CONNECTION_FAILED_CONST = exports.CONNECTION_CREATED_CONST = 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';
|
|
@@ -9,6 +9,8 @@ exports.USER_TRACING_HEADER = 'x-af-user-id';
|
|
|
9
9
|
exports.AUTOMATION_ID_HEADER = 'x-af-automation-id';
|
|
10
10
|
exports.USER_OBJECT = 'userObject';
|
|
11
11
|
exports.DEFAULT_USE_CONSUME_WITH_LOCK = false;
|
|
12
|
+
exports.CONNECTION_CREATED_CONST = 'connectionCreated';
|
|
13
|
+
exports.CONNECTION_FAILED_CONST = 'connectionFailed';
|
|
12
14
|
exports.DEFAULT_OPTIONS = {
|
|
13
15
|
limit: 1,
|
|
14
16
|
retries: 1,
|
|
@@ -18,14 +20,3 @@ exports.DEFAULT_OPTIONS = {
|
|
|
18
20
|
auditContext: null,
|
|
19
21
|
enableRabbitTrace: false,
|
|
20
22
|
};
|
|
21
|
-
exports.ASSERT_VHOST_EXPONENTIAL_BACKOFF_DEV_ENV_CONFIG = {
|
|
22
|
-
startingDelay: 500,
|
|
23
|
-
timeMultiple: 4,
|
|
24
|
-
numOfAttempts: 5,
|
|
25
|
-
};
|
|
26
|
-
exports.ASSERT_VHOST_EXPONENTIAL_BACKOFF_PROD_CONFIG = {
|
|
27
|
-
startingDelay: 1,
|
|
28
|
-
timeMultiple: 1,
|
|
29
|
-
numOfAttempts: 5,
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=consts.js.map
|
package/dist/lib/rabbitError.js
CHANGED
package/dist/lib/redis.js
CHANGED
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AmqpConnectionManager } from 'amqp-connection-manager';
|
|
2
1
|
import { ConsumeMessage, Options, Replies } from 'amqplib';
|
|
3
2
|
export interface ExchangesCache {
|
|
4
3
|
[key: string]: any;
|
|
@@ -43,10 +42,3 @@ export type AfConsumer = {
|
|
|
43
42
|
options: ConsumeOptions | undefined;
|
|
44
43
|
};
|
|
45
44
|
export declare const CONSUMER_DEFAULT_OPTIONS: Options.Consume;
|
|
46
|
-
export type ConnectionData = {
|
|
47
|
-
amqpConnection: AmqpConnectionManager | null;
|
|
48
|
-
creatingConnection: boolean;
|
|
49
|
-
connectionCreatedEventName: string;
|
|
50
|
-
connectionFailedEventName: string;
|
|
51
|
-
blockReconnect: boolean;
|
|
52
|
-
};
|
package/dist/lib/types.js
CHANGED
package/dist/lib/utils.d.ts
CHANGED
|
@@ -3,8 +3,3 @@ import { ConfirmChannel, Replies } from 'amqplib';
|
|
|
3
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;
|
|
6
|
-
export declare const getAssertVhostExponentialBackoffConfig: () => {
|
|
7
|
-
startingDelay: number;
|
|
8
|
-
timeMultiple: number;
|
|
9
|
-
numOfAttempts: number;
|
|
10
|
-
};
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const consts_1 = require("./consts");
|
|
5
|
-
const { PROJECT_ID } = process.env;
|
|
3
|
+
exports.rand = exports.wrapSetImmediate = exports.assertExchangeFanout = void 0;
|
|
6
4
|
const assertExchangeFanout = async (c, exchangeName) => c.assertExchange(exchangeName, 'fanout');
|
|
7
5
|
exports.assertExchangeFanout = assertExchangeFanout;
|
|
8
6
|
const wrapSetImmediate = (callback) => new Promise((resolve, reject) => {
|
|
@@ -19,9 +17,3 @@ const wrapSetImmediate = (callback) => new Promise((resolve, reject) => {
|
|
|
19
17
|
exports.wrapSetImmediate = wrapSetImmediate;
|
|
20
18
|
const rand = () => Math.floor(Math.random() * 100000);
|
|
21
19
|
exports.rand = rand;
|
|
22
|
-
const isDevEnv = () => ['af-experiment-manager', 'dev1-experiment-manager'].includes(PROJECT_ID || '');
|
|
23
|
-
const getAssertVhostExponentialBackoffConfig = () => (isDevEnv()
|
|
24
|
-
? consts_1.ASSERT_VHOST_EXPONENTIAL_BACKOFF_DEV_ENV_CONFIG
|
|
25
|
-
: consts_1.ASSERT_VHOST_EXPONENTIAL_BACKOFF_PROD_CONFIG);
|
|
26
|
-
exports.getAssertVhostExponentialBackoffConfig = getAssertVhostExponentialBackoffConfig;
|
|
27
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// eslint-disable-next-line import/no-
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
4
|
require("jest");
|
|
5
5
|
class RabbitMq {
|
|
6
6
|
constructor() {
|
|
@@ -16,4 +16,3 @@ class RabbitMq {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.default = RabbitMq;
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/rabbit",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -10,48 +10,41 @@
|
|
|
10
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'",
|
|
11
11
|
"start": "ts-node src/index.ts",
|
|
12
12
|
"example": "ts-node src/example.ts",
|
|
13
|
-
"build": "rm -rf dist && tsc
|
|
14
|
-
"linter": "eslint .",
|
|
15
|
-
"test": "
|
|
16
|
-
"test-local": "RABBITMQ_SERVICE_HOST=localhost:5672
|
|
17
|
-
"coverage": "
|
|
13
|
+
"build": "rm -rf dist && tsc",
|
|
14
|
+
"linter": "./node_modules/.bin/eslint .",
|
|
15
|
+
"test": "jest --runInBand --forceExit",
|
|
16
|
+
"test-local": "RABBITMQ_SERVICE_HOST=localhost:5672 jest --forceExit",
|
|
17
|
+
"coverage": "jest --coverage --forceExit && rm -rf ./coverage",
|
|
18
18
|
"dev": "nodemon"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@autofleet/zehut": "^3.1.2",
|
|
22
|
-
"amqp-connection-manager": "4.1.
|
|
23
|
-
"amqplib": "0.10.
|
|
22
|
+
"amqp-connection-manager": "4.1.9",
|
|
23
|
+
"amqplib": "0.10.3",
|
|
24
|
+
"axios": "^1.7.9",
|
|
24
25
|
"bluebird": "^3.7.2",
|
|
25
|
-
"
|
|
26
|
-
"moment": "^2.30.1",
|
|
26
|
+
"moment": "^2.29.1",
|
|
27
27
|
"redis": "^3.1.2",
|
|
28
28
|
"redis-lock": "^0.1.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@autofleet/logger": "*"
|
|
32
|
-
"jest": "*"
|
|
33
|
-
},
|
|
34
|
-
"peerDependenciesMeta": {
|
|
35
|
-
"jest": {
|
|
36
|
-
"optional": true
|
|
37
|
-
}
|
|
31
|
+
"@autofleet/logger": "*"
|
|
38
32
|
},
|
|
39
33
|
"devDependencies": {
|
|
40
34
|
"@autofleet/logger": "4.0.6",
|
|
41
|
-
"@types/amqplib": "0.
|
|
42
|
-
"@types/bluebird": "^3.5.42",
|
|
35
|
+
"@types/amqplib": "0.8.2",
|
|
43
36
|
"@types/jest": "^29.5.12",
|
|
44
37
|
"@types/node": "^20.14.11",
|
|
45
38
|
"@typescript-eslint/eslint-plugin": "^4.8.1",
|
|
46
|
-
"@vitest/coverage-v8": "^3.1.3",
|
|
47
39
|
"eslint": "^7.13.0",
|
|
48
40
|
"eslint-config-airbnb-typescript": "^12.0.0",
|
|
49
41
|
"eslint-plugin-import": "^2.22.1",
|
|
42
|
+
"jest": "^29.7.0",
|
|
50
43
|
"node-tcp-proxy": "^0.0.28",
|
|
44
|
+
"ts-jest": "^29.2.3",
|
|
51
45
|
"ts-node": "^8.6.2",
|
|
52
|
-
"typescript": "^4.9.5"
|
|
53
|
-
"vitest": "^3.1.3"
|
|
46
|
+
"typescript": "^4.9.5"
|
|
54
47
|
},
|
|
55
48
|
"author": "",
|
|
56
|
-
"license": "
|
|
49
|
+
"license": "ISC"
|
|
57
50
|
}
|