Comparing version 4.0.2 to 4.0.3
{ | ||
"name": "pubnub", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"main": "dist/web/pubnub.min.js", | ||
@@ -5,0 +5,0 @@ "license": "https://github.com/pubnub/javascript/blob/master/LICENSE", |
@@ -142,3 +142,3 @@ 'use strict'; | ||
var response = void 0; | ||
if (channels.length > 1 || channelGroups.length > 0) { | ||
if (channels.length > 1 || channelGroups.length > 0 || channelGroups.length === 0 && channels.length === 0) { | ||
response = prepareMultipleChannel(); | ||
@@ -145,0 +145,0 @@ } else { |
{ | ||
"name": "pubnub", | ||
"preferGlobal": false, | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"author": "PubNub <support@pubnub.com>", | ||
@@ -6,0 +6,0 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub", |
@@ -22,7 +22,7 @@ # PubNub JavaScript SDK (V4) | ||
#### HTTP | ||
* http://cdn.pubnub.com/sdk/javascript/pubnub.4.0.2.min.js | ||
* http://cdn.pubnub.com/sdk/javascript/pubnub.4.0.2.js | ||
* http://cdn.pubnub.com/sdk/javascript/pubnub.4.0.3.min.js | ||
* http://cdn.pubnub.com/sdk/javascript/pubnub.4.0.3.js | ||
#### HTTPS | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.2.min.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.2.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.3.min.js | ||
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.3.js |
@@ -110,3 +110,3 @@ /* @flow */ | ||
let response; | ||
if (channels.length > 1 || channelGroups.length > 0) { | ||
if (channels.length > 1 || channelGroups.length > 0 || (channelGroups.length === 0 && channels.length === 0)) { | ||
response = prepareMultipleChannel(); | ||
@@ -113,0 +113,0 @@ } else { |
@@ -242,3 +242,3 @@ /* global describe, beforeEach, it, before, afterEach, after */ | ||
it('returns response for channel group ', (done) => { | ||
it('returns response for channel group', (done) => { | ||
const scope = utils.createNock().get('/v2/presence/sub-key/mySubscribeKey/channel/%2C') | ||
@@ -266,3 +266,61 @@ .query({ pnsdk: 'PubNub-JS-Nodejs/' + pubnub.getVersion(), uuid: 'myUUID', 'channel-group': 'cg1' }) | ||
}); | ||
it('returns response for global here-now', (done) => { | ||
const scope = utils.createNock().get('/v2/presence/sub-key/mySubscribeKey') | ||
.query({ pnsdk: 'PubNub-JS-Nodejs/' + pubnub.getVersion(), uuid: 'myUUID' }) | ||
.reply(200, '{"status": 200, "message": "OK", "payload": {"channels": {"ch10": {"uuids": ["2c3b136e-dc9e-4e97-939c-752dbb47acbd"], "occupancy": 1}, "bot_object": {"uuids": ["fb49e109-756f-483e-92dc-d966d73a119d"], "occupancy": 1}}, "total_channels": 2, "total_occupancy": 2}, "service": "Presence"}'); | ||
pubnub.hereNow({}, (status, response) => { | ||
assert.equal(status.error, false); | ||
assert.deepEqual(response.channels, { | ||
bot_object: { | ||
name: 'bot_object', | ||
occupancy: 1, | ||
occupants: [ | ||
{ | ||
state: null, | ||
uuid: 'fb49e109-756f-483e-92dc-d966d73a119d' | ||
} | ||
] | ||
}, | ||
ch10: { | ||
name: 'ch10', | ||
occupancy: 1, | ||
occupants: [ | ||
{ | ||
state: null, | ||
uuid: '2c3b136e-dc9e-4e97-939c-752dbb47acbd' | ||
} | ||
] | ||
} | ||
}); | ||
assert.equal(scope.isDone(), true); | ||
done(); | ||
}); | ||
}); | ||
it('returns response for global here-now with uuids disabled', (done) => { | ||
const scope = utils.createNock().get('/v2/presence/sub-key/mySubscribeKey') | ||
.query({ pnsdk: 'PubNub-JS-Nodejs/' + pubnub.getVersion(), uuid: 'myUUID', disable_uuids: 1 }) | ||
.reply(200, '{"status": 200, "message": "OK", "payload": {"channels": {"ch10": {"occupancy": 1}, "bot_object": {"occupancy": 1}}, "total_channels": 2, "total_occupancy": 2}, "service": "Presence"}'); | ||
pubnub.hereNow({ includeUUIDs: false }, (status, response) => { | ||
assert.equal(status.error, false); | ||
assert.deepEqual(response.channels, { | ||
bot_object: { | ||
name: 'bot_object', | ||
occupancy: 1, | ||
occupants: [] | ||
}, | ||
ch10: { | ||
name: 'ch10', | ||
occupancy: 1, | ||
occupants: [] | ||
} | ||
}); | ||
assert.equal(scope.isDone(), true); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1109863
11205