Skip to content

Commit 53d363b

Browse files
authored
Merge pull request #143 from pubnub/CE-3355-Message-Counts-API
message-counts API changes
2 parents a4f4c18 + 4954e2c commit 53d363b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+10614
-9619
lines changed

.pubnub.yml

Lines changed: 533 additions & 365 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [v4.23.0](https://github.com/pubnub/javascript/tree/v4.23.0)
2+
March-14-2019
3+
4+
5+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.22.0...v4.23.0)
6+
7+
8+
9+
-`timetoken` is deprecated in message-counts API. Use `channelTimetokens` instead, pass one value in `channelTimetokens` to achieve the same results
10+
11+
12+
113
## [v4.22.0](https://github.com/pubnub/javascript/tree/v4.22.0)
214
March-04-2019
315

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ please use the [master_3x](https://github.com/pubnub/javascript/tree/master_3x)
2222

2323

2424

25-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.22.0.min.js
26-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.22.0.js
25+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.23.0.min.js
26+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.23.0.js

dist/titanium/pubnub.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.22.0 / Consumer */
1+
/*! 4.23.0 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -591,7 +591,7 @@ return /******/ (function(modules) { // webpackBootstrap
591591
}, {
592592
key: 'getVersion',
593593
value: function getVersion() {
594-
return '4.22.0';
594+
return '4.23.0';
595595
}
596596
}, {
597597
key: '_decideUUID',
@@ -4250,6 +4250,9 @@ return /******/ (function(modules) { // webpackBootstrap
42504250
Object.defineProperty(exports, "__esModule", {
42514251
value: true
42524252
});
4253+
4254+
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
4255+
42534256
exports.getOperation = getOperation;
42544257
exports.validateParams = validateParams;
42554258
exports.getURL = getURL;
@@ -4281,6 +4284,7 @@ return /******/ (function(modules) { // webpackBootstrap
42814284

42824285
if (!channels) return 'Missing channel';
42834286
if (timetoken && channelTimetokens) return 'timetoken and channelTimetokens are incompatible together';
4287+
if (timetoken && channelTimetokens && channelTimetokens.length > 1 && channels.length !== channelTimetokens.length) return 'Length of channelTimetokens and channels do not match';
42844288
if (!config.subscribeKey) return 'Missing Subscribe Key';
42854289
}
42864290

@@ -4310,14 +4314,21 @@ return /******/ (function(modules) { // webpackBootstrap
43104314

43114315
var outgoingParams = {};
43124316

4313-
if (timetoken) outgoingParams.timetoken = timetoken;
4314-
if (channelTimetokens) outgoingParams.channelTimetokens = _utils2.default.encodeString(channelTimetokens.join(','));
4317+
if (channelTimetokens && channelTimetokens.length === 1) {
4318+
var _channelTimetokens = _slicedToArray(channelTimetokens, 1),
4319+
tt = _channelTimetokens[0];
4320+
4321+
outgoingParams.timetoken = tt;
4322+
} else if (channelTimetokens) {
4323+
outgoingParams.channelsTimetoken = channelTimetokens.join(',');
4324+
} else if (timetoken) {
4325+
outgoingParams.timetoken = timetoken;
4326+
}
43154327

43164328
return outgoingParams;
43174329
}
43184330

43194331
function handleResponse(modules, serverResponse) {
4320-
43214332
return { channels: serverResponse.channels };
43224333
}
43234334

dist/titanium/pubnub.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)