comprodls-sdk 2.75.2 → 2.75.3
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/comprodls-sdk.js
CHANGED
|
@@ -12868,19 +12868,16 @@ function _connect(pubnubCW, options) {
|
|
|
12868
12868
|
|
|
12869
12869
|
function _cleanup(pubnubCW) { pubnubCW.cleanup(); }
|
|
12870
12870
|
|
|
12871
|
-
/*options = {
|
|
12872
|
-
orgId: <orgId>, userId: <userId>
|
|
12873
|
-
}*/
|
|
12871
|
+
/*options = {}*/
|
|
12874
12872
|
function grantByUserOrgId(options) {
|
|
12875
12873
|
var dfd = q.defer(); // Initializing promise
|
|
12876
12874
|
var allowedChannels = ['jobs', 'systemevents'];
|
|
12877
|
-
var baseChannelName = "o-" +
|
|
12875
|
+
var baseChannelName = "o-" + this.orgId + "\\$u-" + this.token + "\\$";
|
|
12878
12876
|
var patterns = [];
|
|
12879
12877
|
for(var i in allowedChannels) {
|
|
12880
12878
|
var channelName = baseChannelName + allowedChannels[i] + "\\..*";
|
|
12881
12879
|
patterns.push(channelName);
|
|
12882
12880
|
}
|
|
12883
|
-
console.log("0a781d69 TAKING GRANT FOR CHANNEL PATTERNS: ", patterns);
|
|
12884
12881
|
options.channels = {};
|
|
12885
12882
|
options.channels.patterns = patterns;
|
|
12886
12883
|
grantV2.call(this, options)
|
|
@@ -13074,7 +13071,6 @@ module.exports = function () {
|
|
|
13074
13071
|
//Returning the adaptor (Plain Javascript object)
|
|
13075
13072
|
return {
|
|
13076
13073
|
"on": function (channelObj, handler) {
|
|
13077
|
-
console.log("0a781d69 PARAMS OF .on FUNCTION: ", JSON.stringify(channelObj, null, 2));
|
|
13078
13074
|
var pubNubChannel;
|
|
13079
13075
|
var channelContext = [];
|
|
13080
13076
|
|
|
@@ -13096,7 +13092,6 @@ module.exports = function () {
|
|
|
13096
13092
|
status: 'pending'
|
|
13097
13093
|
};
|
|
13098
13094
|
_eventEmitter.on(pubNubChannel, handler);
|
|
13099
|
-
console.log("0a781d69 GOING TO SUBSCRIBE ON PUBNUB CHANNEL: ", pubNubChannel);
|
|
13100
13095
|
_subscribeToPubNubChannels(pubNubChannel);
|
|
13101
13096
|
}
|
|
13102
13097
|
}
|
|
@@ -13117,7 +13112,6 @@ module.exports = function () {
|
|
|
13117
13112
|
|
|
13118
13113
|
var _translatePubnubStatus = function(status, options) {
|
|
13119
13114
|
var channels = [], error, successObj;
|
|
13120
|
-
console.log('0a781d69 PUBNUB STATUS: ', JSON.stringify(status, null, 4));
|
|
13121
13115
|
switch (status.category) {
|
|
13122
13116
|
case "PNConnectedCategory":
|
|
13123
13117
|
if(status.operation === "PNSubscribeOperation") {
|
|
@@ -13254,14 +13248,9 @@ module.exports = function () {
|
|
|
13254
13248
|
var token = userOptions.token;
|
|
13255
13249
|
|
|
13256
13250
|
if (!_pubnubClient && pubnubConfig) {
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
setTimeout(processSetup, 1000);
|
|
13261
|
-
processSetup();
|
|
13262
|
-
} catch(err) {
|
|
13263
|
-
console.error('0a781d69 ERROR WHILE CONFIGURING PUBNUB: ', JSON.stringify(err, null, 2));
|
|
13264
|
-
}
|
|
13251
|
+
_pubnubClient = new pubNub(pubnubConfig); //Connect with PubNub SDK
|
|
13252
|
+
_pubnubClient.setToken(token);
|
|
13253
|
+
processSetup();
|
|
13265
13254
|
} else {
|
|
13266
13255
|
return new Error('Already Initialized');
|
|
13267
13256
|
}
|