@orion-js/echoes 2.2.4 → 2.3.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/lib/publish/index.js
CHANGED
|
@@ -17,6 +17,10 @@ var _serialize = _interopRequireDefault(require("./serialize"));
|
|
|
17
17
|
* @param {Object} params
|
|
18
18
|
*/
|
|
19
19
|
async function _default(options) {
|
|
20
|
+
if (!_config.default.producer) {
|
|
21
|
+
throw new Error('You must initialize echoes configruation to use publish');
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
const payload = {
|
|
21
25
|
params: options.params
|
|
22
26
|
};
|
package/lib/publish/serialize.js
CHANGED
|
@@ -9,8 +9,11 @@ exports.default = _default;
|
|
|
9
9
|
|
|
10
10
|
var _serializeJavascript = _interopRequireDefault(require("serialize-javascript"));
|
|
11
11
|
|
|
12
|
+
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
13
|
+
|
|
12
14
|
function _default(data) {
|
|
13
|
-
const
|
|
15
|
+
const cloned = (0, _cloneDeep.default)(data);
|
|
16
|
+
const serialized = (0, _serializeJavascript.default)(cloned, {
|
|
14
17
|
ignoreFunction: true
|
|
15
18
|
});
|
|
16
19
|
return serialized;
|
|
@@ -25,6 +25,9 @@ function _default(options) {
|
|
|
25
25
|
_config.default.consumer.connect();
|
|
26
26
|
|
|
27
27
|
for (const topic in options.echoes) {
|
|
28
|
+
const echo = options.echoes[topic];
|
|
29
|
+
if (echo.type !== _types.default.event) continue;
|
|
30
|
+
|
|
28
31
|
_config.default.consumer.subscribe({
|
|
29
32
|
topic
|
|
30
33
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/echoes",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test:watch": "jest src --coverage --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@orion-js/helpers": "^2.
|
|
15
|
+
"@orion-js/helpers": "^2.3.0",
|
|
16
16
|
"axios": "^0.23.0",
|
|
17
17
|
"jssha": "^3.2.0",
|
|
18
18
|
"kafkajs": "^1.15.0",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "e6285fbf1d7445fcda1c8c8eb887742df474c655"
|
|
32
32
|
}
|