woonplan-packages-redishelper 2.1.51 → 2.1.52
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.
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const BrokerClient_1 = tslib_1.__importDefault(require("./BrokerClient"));
|
|
5
|
+
const class_validator_1 = require("class-validator");
|
|
5
6
|
class Listener extends BrokerClient_1.default {
|
|
6
7
|
constructor(broker, client, stream, callback, group, deleteOnCompletion = false) {
|
|
7
8
|
super(broker, client, callback, stream, group, deleteOnCompletion);
|
|
8
9
|
}
|
|
9
10
|
streamCallback(message) {
|
|
10
11
|
let producer, updatecontactid = undefined;
|
|
11
|
-
if (message.parameters.redishelper_producer !== undefined) {
|
|
12
|
+
if (message.parameters.redishelper_producer !== undefined && (0, class_validator_1.isString)(message.parameters.redishelper_producer)) {
|
|
12
13
|
producer = message.parameters.redishelper_producer;
|
|
13
14
|
delete message.parameters.redishelper_producer;
|
|
14
15
|
}
|
|
15
|
-
if (message.parameters.updatecontactid !== undefined) {
|
|
16
|
-
|
|
16
|
+
if (message.parameters.updatecontactid !== undefined && (0, class_validator_1.isString)(message.parameters.updatecontactid)) {
|
|
17
|
+
updatecontactid = message.parameters.updatecontactid;
|
|
17
18
|
delete message.parameters.updatecontactid;
|
|
19
|
+
if (updatecontactid.length === 0)
|
|
20
|
+
updatecontactid = undefined;
|
|
18
21
|
}
|
|
19
22
|
return this.callback(message.id, message.parameters, producer, updatecontactid);
|
|
20
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Listener.js","sourceRoot":"","sources":["../../../src/classes/Listener.ts"],"names":[],"mappings":";;;AAGA,0EAAyC;
|
|
1
|
+
{"version":3,"file":"Listener.js","sourceRoot":"","sources":["../../../src/classes/Listener.ts"],"names":[],"mappings":";;;AAGA,0EAAyC;AACzC,qDAA0C;AAE1C,MAAqB,QAAS,SAAQ,sBAAY;IAChD,YAAa,MAAa,EAAE,MAAY,EAAE,MAAa,EAAE,QAAiB,EAAE,KAAe,EAAE,qBAA6B,KAAK;QAC7H,KAAK,CAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAE,CAAA;IACtE,CAAC;IAED,cAAc,CAAC,OAA0B;QAEvC,IAAI,QAA6B,EAC7B,eAAe,GAAwB,SAAS,CAAA;QAEpD,IAAI,OAAO,CAAC,UAAU,CAAC,oBAAoB,KAAK,SAAS,IAAI,IAAA,0BAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAE,EAAE;YAChH,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,oBAA8B,CAAA;YAC5D,OAAO,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAA;SAC/C;QAED,IAAI,OAAO,CAAC,UAAU,CAAC,eAAe,KAAK,SAAS,IAAI,IAAA,0BAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,eAAe,CAAE,EAAE;YACtG,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,eAAyB,CAAA;YAC9D,OAAO,OAAO,CAAC,UAAU,CAAC,eAAe,CAAA;YACzC,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;gBAAG,eAAe,GAAG,SAAS,CAAA;SAC/D;QAED,OAAO,IAAI,CAAC,QAAQ,CAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,CAAE,CAAA;IACnF,CAAC;CACF;AAvBD,2BAuBC"}
|