1
- /*! 4.21.7 / Consumer */
1
+ /*! 4.22.0 / Consumer */
2
2
( function webpackUniversalModuleDefinition ( root , factory ) {
3
3
if ( typeof exports === 'object' && typeof module === 'object' )
4
4
module . exports = factory ( ) ;
@@ -66,15 +66,15 @@ return /******/ (function(modules) { // webpackBootstrap
66
66
67
67
var _pubnubCommon2 = _interopRequireDefault ( _pubnubCommon ) ;
68
68
69
- var _networking = __webpack_require__ ( 39 ) ;
69
+ var _networking = __webpack_require__ ( 40 ) ;
70
70
71
71
var _networking2 = _interopRequireDefault ( _networking ) ;
72
72
73
- var _common = __webpack_require__ ( 40 ) ;
73
+ var _common = __webpack_require__ ( 41 ) ;
74
74
75
75
var _common2 = _interopRequireDefault ( _common ) ;
76
76
77
- var _titanium = __webpack_require__ ( 41 ) ;
77
+ var _titanium = __webpack_require__ ( 42 ) ;
78
78
79
79
var _flow_interfaces = __webpack_require__ ( 5 ) ;
80
80
@@ -217,15 +217,19 @@ return /******/ (function(modules) { // webpackBootstrap
217
217
218
218
var deleteMessagesEndpointConfig = _interopRequireWildcard ( _delete_messages ) ;
219
219
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 ) ;
221
225
222
226
var fetchMessagesEndpointConfig = _interopRequireWildcard ( _fetch_messages ) ;
223
227
224
228
var _time = __webpack_require__ ( 12 ) ;
225
229
226
230
var timeEndpointConfig = _interopRequireWildcard ( _time ) ;
227
231
228
- var _subscribe = __webpack_require__ ( 38 ) ;
232
+ var _subscribe = __webpack_require__ ( 39 ) ;
229
233
230
234
var subscribeEndpointConfig = _interopRequireWildcard ( _subscribe ) ;
231
235
@@ -322,6 +326,7 @@ return /******/ (function(modules) { // webpackBootstrap
322
326
323
327
this . history = _endpoint2 . default . bind ( this , modules , historyEndpointConfig ) ;
324
328
this . deleteMessages = _endpoint2 . default . bind ( this , modules , deleteMessagesEndpointConfig ) ;
329
+ this . messageCounts = _endpoint2 . default . bind ( this , modules , messageCountsEndpointConfig ) ;
325
330
this . fetchMessages = _endpoint2 . default . bind ( this , modules , fetchMessagesEndpointConfig ) ;
326
331
327
332
this . time = timeEndpoint ;
@@ -586,7 +591,7 @@ return /******/ (function(modules) { // webpackBootstrap
586
591
} , {
587
592
key : 'getVersion' ,
588
593
value : function getVersion ( ) {
589
- return '4.21.7 ' ;
594
+ return '4.22.0 ' ;
590
595
}
591
596
} , {
592
597
key : '_decideUUID' ,
@@ -2187,6 +2192,7 @@ return /******/ (function(modules) { // webpackBootstrap
2187
2192
PNHistoryOperation : 'PNHistoryOperation' ,
2188
2193
PNDeleteMessagesOperation : 'PNDeleteMessagesOperation' ,
2189
2194
PNFetchMessagesOperation : 'PNFetchMessagesOperation' ,
2195
+ PNMessageCounts : 'PNMessageCountsOperation' ,
2190
2196
2191
2197
PNSubscribeOperation : 'PNSubscribeOperation' ,
2192
2198
PNUnsubscribeOperation : 'PNUnsubscribeOperation' ,
@@ -4252,6 +4258,86 @@ return /******/ (function(modules) { // webpackBootstrap
4252
4258
exports . prepareParams = prepareParams ;
4253
4259
exports . handleResponse = handleResponse ;
4254
4260
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
+
4255
4341
var _flow_interfaces = __webpack_require__ ( 5 ) ;
4256
4342
4257
4343
var _operations = __webpack_require__ ( 13 ) ;
@@ -4349,7 +4435,7 @@ return /******/ (function(modules) { // webpackBootstrap
4349
4435
}
4350
4436
4351
4437
/***/ } ) ,
4352
- /* 38 */
4438
+ /* 39 */
4353
4439
/***/ ( function ( module , exports , __webpack_require__ ) {
4354
4440
4355
4441
'use strict' ;
@@ -4470,7 +4556,7 @@ return /******/ (function(modules) { // webpackBootstrap
4470
4556
}
4471
4557
4472
4558
/***/ } ) ,
4473
- /* 39 */
4559
+ /* 40 */
4474
4560
/***/ ( function ( module , exports , __webpack_require__ ) {
4475
4561
4476
4562
'use strict' ;
@@ -4602,7 +4688,7 @@ return /******/ (function(modules) { // webpackBootstrap
4602
4688
module . exports = exports [ 'default' ] ;
4603
4689
4604
4690
/***/ } ) ,
4605
- /* 40 */
4691
+ /* 41 */
4606
4692
/***/ ( function ( module , exports ) {
4607
4693
4608
4694
"use strict" ;
@@ -4641,7 +4727,7 @@ return /******/ (function(modules) { // webpackBootstrap
4641
4727
module . exports = exports [ "default" ] ;
4642
4728
4643
4729
/***/ } ) ,
4644
- /* 41 */
4730
+ /* 42 */
4645
4731
/***/ ( function ( module , exports , __webpack_require__ ) {
4646
4732
4647
4733
'use strict' ;
@@ -4655,7 +4741,7 @@ return /******/ (function(modules) { // webpackBootstrap
4655
4741
4656
4742
var _flow_interfaces = __webpack_require__ ( 5 ) ;
4657
4743
4658
- var _utils = __webpack_require__ ( 42 ) ;
4744
+ var _utils = __webpack_require__ ( 43 ) ;
4659
4745
4660
4746
function log ( url , qs , res ) {
4661
4747
var _pickLogger = function _pickLogger ( ) {
@@ -4757,7 +4843,7 @@ return /******/ (function(modules) { // webpackBootstrap
4757
4843
}
4758
4844
4759
4845
/***/ } ) ,
4760
- /* 42 */
4846
+ /* 43 */
4761
4847
/***/ ( function ( module , exports ) {
4762
4848
4763
4849
'use strict' ;
0 commit comments