Skip to content

Commit a4f4c18

Browse files
Merge pull request #142 from pubnub/develop
Develop
2 parents a4f8764 + 03b947c commit a4f4c18

27 files changed

+478
-72
lines changed

.pubnub.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: javascript
2-
version: 4.21.7
2+
version: 4.22.0
33
schema: 1
44
scm: github.com/pubnub/javascript
55
files:
66
- dist/web/pubnub.js
77
- dist/web/pubnub.min.js
88
changelog:
9+
- version: v4.22.0
10+
date: 2019-03-04
11+
changes:
12+
- type: feature
13+
text: message counts
14+
- type: improvement
15+
text: use null instead of '' for NativeScript networking module
916
- version: v4.21.7
1017
date: 2018-12-20
1118
changes:
@@ -420,6 +427,7 @@ features:
420427
- STORAGE-COUNT
421428
- STORAGE-DELETE-MESSAGES
422429
- STORAGE-FETCH-MESSAGES
430+
- STORAGE-MESSAGE-COUNT
423431
time:
424432
- TIME-TIME
425433
subscribe:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [v4.22.0](https://github.com/pubnub/javascript/tree/v4.22.0)
2+
March-04-2019
3+
4+
5+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.21.7...v4.22.0)
6+
7+
8+
9+
- ⭐message counts
10+
11+
- ⭐use null instead of '' for NativeScript networking module
12+
13+
14+
115
## [v4.21.7](https://github.com/pubnub/javascript/tree/v4.21.7)
216
December-20-2018
317

README.md

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

2323

24-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.21.7.min.js
25-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.21.7.js
24+
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

dist/titanium/pubnub.js

Lines changed: 99 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.21.7 / Consumer */
1+
/*! 4.22.0 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -66,15 +66,15 @@ return /******/ (function(modules) { // webpackBootstrap
6666

6767
var _pubnubCommon2 = _interopRequireDefault(_pubnubCommon);
6868

69-
var _networking = __webpack_require__(39);
69+
var _networking = __webpack_require__(40);
7070

7171
var _networking2 = _interopRequireDefault(_networking);
7272

73-
var _common = __webpack_require__(40);
73+
var _common = __webpack_require__(41);
7474

7575
var _common2 = _interopRequireDefault(_common);
7676

77-
var _titanium = __webpack_require__(41);
77+
var _titanium = __webpack_require__(42);
7878

7979
var _flow_interfaces = __webpack_require__(5);
8080

@@ -217,15 +217,19 @@ return /******/ (function(modules) { // webpackBootstrap
217217

218218
var deleteMessagesEndpointConfig = _interopRequireWildcard(_delete_messages);
219219

220-
var _fetch_messages = __webpack_require__(37);
220+
var _message_counts = __webpack_require__(37);
221+
222+
var messageCountsEndpointConfig = _interopRequireWildcard(_message_counts);
223+
224+
var _fetch_messages = __webpack_require__(38);
221225

222226
var fetchMessagesEndpointConfig = _interopRequireWildcard(_fetch_messages);
223227

224228
var _time = __webpack_require__(12);
225229

226230
var timeEndpointConfig = _interopRequireWildcard(_time);
227231

228-
var _subscribe = __webpack_require__(38);
232+
var _subscribe = __webpack_require__(39);
229233

230234
var subscribeEndpointConfig = _interopRequireWildcard(_subscribe);
231235

@@ -322,6 +326,7 @@ return /******/ (function(modules) { // webpackBootstrap
322326

323327
this.history = _endpoint2.default.bind(this, modules, historyEndpointConfig);
324328
this.deleteMessages = _endpoint2.default.bind(this, modules, deleteMessagesEndpointConfig);
329+
this.messageCounts = _endpoint2.default.bind(this, modules, messageCountsEndpointConfig);
325330
this.fetchMessages = _endpoint2.default.bind(this, modules, fetchMessagesEndpointConfig);
326331

327332
this.time = timeEndpoint;
@@ -586,7 +591,7 @@ return /******/ (function(modules) { // webpackBootstrap
586591
}, {
587592
key: 'getVersion',
588593
value: function getVersion() {
589-
return '4.21.7';
594+
return '4.22.0';
590595
}
591596
}, {
592597
key: '_decideUUID',
@@ -2187,6 +2192,7 @@ return /******/ (function(modules) { // webpackBootstrap
21872192
PNHistoryOperation: 'PNHistoryOperation',
21882193
PNDeleteMessagesOperation: 'PNDeleteMessagesOperation',
21892194
PNFetchMessagesOperation: 'PNFetchMessagesOperation',
2195+
PNMessageCounts: 'PNMessageCountsOperation',
21902196

21912197
PNSubscribeOperation: 'PNSubscribeOperation',
21922198
PNUnsubscribeOperation: 'PNUnsubscribeOperation',
@@ -4252,6 +4258,86 @@ return /******/ (function(modules) { // webpackBootstrap
42524258
exports.prepareParams = prepareParams;
42534259
exports.handleResponse = handleResponse;
42544260

4261+
var _operations = __webpack_require__(13);
4262+
4263+
var _operations2 = _interopRequireDefault(_operations);
4264+
4265+
var _utils = __webpack_require__(15);
4266+
4267+
var _utils2 = _interopRequireDefault(_utils);
4268+
4269+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4270+
4271+
function getOperation() {
4272+
return _operations2.default.PNMessageCounts;
4273+
}
4274+
4275+
function validateParams(modules, incomingParams) {
4276+
var channels = incomingParams.channels,
4277+
timetoken = incomingParams.timetoken,
4278+
channelTimetokens = incomingParams.channelTimetokens;
4279+
var config = modules.config;
4280+
4281+
4282+
if (!channels) return 'Missing channel';
4283+
if (timetoken && channelTimetokens) return 'timetoken and channelTimetokens are incompatible together';
4284+
if (!config.subscribeKey) return 'Missing Subscribe Key';
4285+
}
4286+
4287+
function getURL(modules, incomingParams) {
4288+
var channels = incomingParams.channels;
4289+
var config = modules.config;
4290+
4291+
4292+
var stringifiedChannels = channels.join(',');
4293+
4294+
return '/v3/history/sub-key/' + config.subscribeKey + '/message-counts/' + _utils2.default.encodeString(stringifiedChannels);
4295+
}
4296+
4297+
function getRequestTimeout(_ref) {
4298+
var config = _ref.config;
4299+
4300+
return config.getTransactionTimeout();
4301+
}
4302+
4303+
function isAuthSupported() {
4304+
return true;
4305+
}
4306+
4307+
function prepareParams(modules, incomingParams) {
4308+
var timetoken = incomingParams.timetoken,
4309+
channelTimetokens = incomingParams.channelTimetokens;
4310+
4311+
var outgoingParams = {};
4312+
4313+
if (timetoken) outgoingParams.timetoken = timetoken;
4314+
if (channelTimetokens) outgoingParams.channelTimetokens = _utils2.default.encodeString(channelTimetokens.join(','));
4315+
4316+
return outgoingParams;
4317+
}
4318+
4319+
function handleResponse(modules, serverResponse) {
4320+
4321+
return { channels: serverResponse.channels };
4322+
}
4323+
4324+
/***/ }),
4325+
/* 38 */
4326+
/***/ (function(module, exports, __webpack_require__) {
4327+
4328+
'use strict';
4329+
4330+
Object.defineProperty(exports, "__esModule", {
4331+
value: true
4332+
});
4333+
exports.getOperation = getOperation;
4334+
exports.validateParams = validateParams;
4335+
exports.getURL = getURL;
4336+
exports.getRequestTimeout = getRequestTimeout;
4337+
exports.isAuthSupported = isAuthSupported;
4338+
exports.prepareParams = prepareParams;
4339+
exports.handleResponse = handleResponse;
4340+
42554341
var _flow_interfaces = __webpack_require__(5);
42564342

42574343
var _operations = __webpack_require__(13);
@@ -4349,7 +4435,7 @@ return /******/ (function(modules) { // webpackBootstrap
43494435
}
43504436

43514437
/***/ }),
4352-
/* 38 */
4438+
/* 39 */
43534439
/***/ (function(module, exports, __webpack_require__) {
43544440

43554441
'use strict';
@@ -4470,7 +4556,7 @@ return /******/ (function(modules) { // webpackBootstrap
44704556
}
44714557

44724558
/***/ }),
4473-
/* 39 */
4559+
/* 40 */
44744560
/***/ (function(module, exports, __webpack_require__) {
44754561

44764562
'use strict';
@@ -4602,7 +4688,7 @@ return /******/ (function(modules) { // webpackBootstrap
46024688
module.exports = exports['default'];
46034689

46044690
/***/ }),
4605-
/* 40 */
4691+
/* 41 */
46064692
/***/ (function(module, exports) {
46074693

46084694
"use strict";
@@ -4641,7 +4727,7 @@ return /******/ (function(modules) { // webpackBootstrap
46414727
module.exports = exports["default"];
46424728

46434729
/***/ }),
4644-
/* 41 */
4730+
/* 42 */
46454731
/***/ (function(module, exports, __webpack_require__) {
46464732

46474733
'use strict';
@@ -4655,7 +4741,7 @@ return /******/ (function(modules) { // webpackBootstrap
46554741

46564742
var _flow_interfaces = __webpack_require__(5);
46574743

4658-
var _utils = __webpack_require__(42);
4744+
var _utils = __webpack_require__(43);
46594745

46604746
function log(url, qs, res) {
46614747
var _pickLogger = function _pickLogger() {
@@ -4757,7 +4843,7 @@ return /******/ (function(modules) { // webpackBootstrap
47574843
}
47584844

47594845
/***/ }),
4760-
/* 42 */
4846+
/* 43 */
47614847
/***/ (function(module, exports) {
47624848

47634849
'use strict';

dist/titanium/pubnub.min.js

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

0 commit comments

Comments
 (0)