@@ -167,7 +167,9 @@ var _default = {
167
167
PNAccessManagerGrant : 'PNAccessManagerGrant' ,
168
168
PNAccessManagerGrantToken : 'PNAccessManagerGrantToken' ,
169
169
PNAccessManagerAudit : 'PNAccessManagerAudit' ,
170
- PNAccessManagerRevokeToken : 'PNAccessManagerRevokeToken'
170
+ PNAccessManagerRevokeToken : 'PNAccessManagerRevokeToken' ,
171
+ PNHandshakeOperation : 'PNHandshakeOperation' ,
172
+ PNReceiveMessagesOperation : 'PNReceiveMessagesOperation'
171
173
} ;
172
174
exports [ "default" ] = _default ;
173
175
module . exports = exports . default ;
@@ -377,7 +379,7 @@ var makeDefaultOrigins = function makeDefaultOrigins() {
377
379
378
380
var _default = function ( ) {
379
381
function _default ( _ref ) {
380
- var _setup$fileUploadPubl , _setup$useRandomIVs ;
382
+ var _setup$fileUploadPubl , _setup$useRandomIVs , _setup$enableSubscrib ;
381
383
382
384
var setup = _ref . setup ;
383
385
( 0 , _classCallCheck2 [ "default" ] ) ( this , _default ) ;
@@ -418,6 +420,7 @@ var _default = function () {
418
420
( 0 , _defineProperty2 [ "default" ] ) ( this , "customDecrypt" , void 0 ) ;
419
421
( 0 , _defineProperty2 [ "default" ] ) ( this , "fileUploadPublishRetryLimit" , void 0 ) ;
420
422
( 0 , _defineProperty2 [ "default" ] ) ( this , "useRandomIVs" , void 0 ) ;
423
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "enableSubscribeBeta" , void 0 ) ;
421
424
this . _PNSDKSuffix = { } ;
422
425
this . instanceId = "pn-" . concat ( _uuid [ "default" ] . createUUID ( ) ) ;
423
426
this . secretKey = setup . secretKey || setup . secret_key ;
@@ -447,6 +450,11 @@ var _default = function () {
447
450
this . customDecrypt = setup . customDecrypt ;
448
451
this . fileUploadPublishRetryLimit = ( _setup$fileUploadPubl = setup . fileUploadPublishRetryLimit ) !== null && _setup$fileUploadPubl !== void 0 ? _setup$fileUploadPubl : 5 ;
449
452
this . useRandomIVs = ( _setup$useRandomIVs = setup . useRandomIVs ) !== null && _setup$useRandomIVs !== void 0 ? _setup$useRandomIVs : true ;
453
+ this . enableSubscribeBeta = ( _setup$enableSubscrib = setup . enableSubscribeBeta ) !== null && _setup$enableSubscrib !== void 0 ? _setup$enableSubscrib : false ;
454
+
455
+ if ( setup . enableSubscribeBeta && setup . enableSubscribeBeta === true ) {
456
+ throw new Error ( 'not implemented' ) ;
457
+ }
450
458
451
459
if ( typeof location !== 'undefined' && location . protocol === 'https:' ) {
452
460
this . secure = true ;
@@ -979,7 +987,8 @@ function _default(modules, endpoint) {
979
987
timeout : endpoint . getRequestTimeout ( modules ) ,
980
988
headers : endpoint . getRequestHeaders ? endpoint . getRequestHeaders ( ) : { } ,
981
989
ignoreBody : typeof endpoint . ignoreBody === 'function' ? endpoint . ignoreBody ( modules ) : false ,
982
- forceBuffered : typeof endpoint . forceBuffered === 'function' ? endpoint . forceBuffered ( modules , incomingParams ) : null
990
+ forceBuffered : typeof endpoint . forceBuffered === 'function' ? endpoint . forceBuffered ( modules , incomingParams ) : null ,
991
+ abortSignal : typeof endpoint . getAbortSignal === 'function' ? endpoint . getAbortSignal ( modules , incomingParams ) : null
983
992
} ;
984
993
outgoingParams . uuid = config . UUID ;
985
994
outgoingParams . pnsdk = generatePNSDK ( config ) ;
@@ -1612,13 +1621,13 @@ var _cborSync = _interopRequireDefault(__webpack_require__(24));
1612
1621
1613
1622
var _pubnubCommon = _interopRequireDefault ( __webpack_require__ ( 25 ) ) ;
1614
1623
1615
- var _networking = _interopRequireDefault ( __webpack_require__ ( 114 ) ) ;
1624
+ var _networking = _interopRequireDefault ( __webpack_require__ ( 117 ) ) ;
1616
1625
1617
- var _common = _interopRequireDefault ( __webpack_require__ ( 115 ) ) ;
1626
+ var _common = _interopRequireDefault ( __webpack_require__ ( 118 ) ) ;
1618
1627
1619
- var _common2 = _interopRequireDefault ( __webpack_require__ ( 116 ) ) ;
1628
+ var _common2 = _interopRequireDefault ( __webpack_require__ ( 119 ) ) ;
1620
1629
1621
- var _titanium = __webpack_require__ ( 117 ) ;
1630
+ var _titanium = __webpack_require__ ( 120 ) ;
1622
1631
1623
1632
var _flow_interfaces = __webpack_require__ ( 2 ) ;
1624
1633
@@ -2465,6 +2474,12 @@ var timeEndpointConfig = _interopRequireWildcard(__webpack_require__(20));
2465
2474
2466
2475
var subscribeEndpointConfig = _interopRequireWildcard ( __webpack_require__ ( 113 ) ) ;
2467
2476
2477
+ var _handshake = _interopRequireDefault ( __webpack_require__ ( 114 ) ) ;
2478
+
2479
+ var _receiveMessages = _interopRequireDefault ( __webpack_require__ ( 115 ) ) ;
2480
+
2481
+ var subscriptionTypes = _interopRequireWildcard ( __webpack_require__ ( 116 ) ) ;
2482
+
2468
2483
var _operations = _interopRequireDefault ( __webpack_require__ ( 1 ) ) ;
2469
2484
2470
2485
var _categories = _interopRequireDefault ( __webpack_require__ ( 10 ) ) ;
@@ -2503,6 +2518,11 @@ var _default = function () {
2503
2518
( 0 , _defineProperty2 [ "default" ] ) ( this , "whereNow" , void 0 ) ;
2504
2519
( 0 , _defineProperty2 [ "default" ] ) ( this , "getState" , void 0 ) ;
2505
2520
( 0 , _defineProperty2 [ "default" ] ) ( this , "setState" , void 0 ) ;
2521
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "iAmHere" , void 0 ) ;
2522
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "iAmAway" , void 0 ) ;
2523
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "setPresenceState" , void 0 ) ;
2524
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "handshake" , void 0 ) ;
2525
+ ( 0 , _defineProperty2 [ "default" ] ) ( this , "receiveMessages" , void 0 ) ;
2506
2526
( 0 , _defineProperty2 [ "default" ] ) ( this , "grant" , void 0 ) ;
2507
2527
( 0 , _defineProperty2 [ "default" ] ) ( this , "grantToken" , void 0 ) ;
2508
2528
( 0 , _defineProperty2 [ "default" ] ) ( this , "audit" , void 0 ) ;
@@ -2646,6 +2666,9 @@ var _default = function () {
2646
2666
this . whereNow = _endpoint [ "default" ] . bind ( this , modules , presenceWhereNowEndpointConfig ) ;
2647
2667
this . getState = _endpoint [ "default" ] . bind ( this , modules , presenceGetStateConfig ) ;
2648
2668
this . setState = subscriptionManager . adaptStateChange . bind ( subscriptionManager ) ;
2669
+ this . iAmHere = _endpoint [ "default" ] . bind ( this , modules , presenceHeartbeatEndpointConfig ) ;
2670
+ this . iAmAway = _endpoint [ "default" ] . bind ( this , modules , presenceLeaveEndpointConfig ) ;
2671
+ this . setPresenceState = _endpoint [ "default" ] . bind ( this , modules , presenceSetStateConfig ) ;
2649
2672
this . grant = _endpoint [ "default" ] . bind ( this , modules , grantEndpointConfig ) ;
2650
2673
this . grantToken = _endpoint [ "default" ] . bind ( this , modules , grantTokenEndpointConfig ) ;
2651
2674
this . audit = _endpoint [ "default" ] . bind ( this , modules , auditEndpointConfig ) ;
@@ -2683,6 +2706,8 @@ var _default = function () {
2683
2706
2684
2707
this . downloadFile = _endpoint [ "default" ] . bind ( this , modules , _download_file [ "default" ] ) ;
2685
2708
this . deleteFile = _endpoint [ "default" ] . bind ( this , modules , _delete_file [ "default" ] ) ;
2709
+ this . handshake = _endpoint [ "default" ] . bind ( this , modules , _handshake [ "default" ] ) ;
2710
+ this . receiveMessages = _endpoint [ "default" ] . bind ( this , modules , _receiveMessages [ "default" ] ) ;
2686
2711
this . objects = {
2687
2712
getAllUUIDMetadata : _endpoint [ "default" ] . bind ( this , modules , _get_all [ "default" ] ) ,
2688
2713
getUUIDMetadata : _endpoint [ "default" ] . bind ( this , modules , _get [ "default" ] ) ,
@@ -13308,6 +13333,167 @@ function handleResponse(modules, serverResponse) {
13308
13333
"use strict" ;
13309
13334
13310
13335
13336
+ var _interopRequireDefault = __webpack_require__ ( 0 ) ;
13337
+
13338
+ Object . defineProperty ( exports , "__esModule" , {
13339
+ value : true
13340
+ } ) ;
13341
+ exports [ "default" ] = void 0 ;
13342
+
13343
+ var _operations = _interopRequireDefault ( __webpack_require__ ( 1 ) ) ;
13344
+
13345
+ var _utils = _interopRequireDefault ( __webpack_require__ ( 3 ) ) ;
13346
+
13347
+ var endpoint = {
13348
+ getOperation : function getOperation ( ) {
13349
+ return _operations [ "default" ] . PNHandshakeOperation ;
13350
+ } ,
13351
+ validateParams : function validateParams ( _ , params ) {
13352
+ if ( ! ( params !== null && params !== void 0 && params . channels ) && ! ( params !== null && params !== void 0 && params . channelGroups ) ) {
13353
+ return 'channels and channleGroups both should not be empty' ;
13354
+ }
13355
+ } ,
13356
+ getURL : function getURL ( _ref , params ) {
13357
+ var config = _ref . config ;
13358
+ var channelsString = params . channels ? params . channels . join ( ',' ) : ',' ;
13359
+ return "/v2/subscribe/" . concat ( config . subscribeKey , "/" ) . concat ( _utils [ "default" ] . encodeString ( channelsString ) , "/0" ) ;
13360
+ } ,
13361
+ getRequestTimeout : function getRequestTimeout ( _ref2 ) {
13362
+ var config = _ref2 . config ;
13363
+ return config . getSubscribeTimeout ( ) ;
13364
+ } ,
13365
+ isAuthSupported : function isAuthSupported ( ) {
13366
+ return true ;
13367
+ } ,
13368
+ prepareParams : function prepareParams ( _ , params ) {
13369
+ var outParams = { } ;
13370
+
13371
+ if ( params . channelGroups ) {
13372
+ outParams [ 'channel-group' ] = params . channelGroups . join ( ',' ) ;
13373
+ }
13374
+
13375
+ outParams . tt = 0 ;
13376
+ return outParams ;
13377
+ } ,
13378
+ handleResponse : function handleResponse ( _ , response ) {
13379
+ return {
13380
+ region : response . t . r ,
13381
+ timetoken : response . t . t
13382
+ } ;
13383
+ }
13384
+ } ;
13385
+ var _default = endpoint ;
13386
+ exports [ "default" ] = _default ;
13387
+ module . exports = exports . default ;
13388
+
13389
+ /***/ } ) ,
13390
+ /* 115 */
13391
+ /***/ ( function ( module , exports , __webpack_require__ ) {
13392
+
13393
+ "use strict" ;
13394
+
13395
+
13396
+ var _interopRequireDefault = __webpack_require__ ( 0 ) ;
13397
+
13398
+ Object . defineProperty ( exports , "__esModule" , {
13399
+ value : true
13400
+ } ) ;
13401
+ exports [ "default" ] = void 0 ;
13402
+
13403
+ var _operations = _interopRequireDefault ( __webpack_require__ ( 1 ) ) ;
13404
+
13405
+ var _utils = _interopRequireDefault ( __webpack_require__ ( 3 ) ) ;
13406
+
13407
+ var endpoint = {
13408
+ getOperation : function getOperation ( ) {
13409
+ return _operations [ "default" ] . PNReceiveMessagesOperation ;
13410
+ } ,
13411
+ validateParams : function validateParams ( _ , params ) {
13412
+ if ( ! ( params !== null && params !== void 0 && params . channels ) && ! ( params !== null && params !== void 0 && params . channelGroups ) ) {
13413
+ return 'channels and channleGroups both should not be empty' ;
13414
+ }
13415
+
13416
+ if ( ! ( params !== null && params !== void 0 && params . timetoken ) ) {
13417
+ return 'timetoken can not be empty' ;
13418
+ }
13419
+
13420
+ if ( ! ( params !== null && params !== void 0 && params . region ) ) {
13421
+ return 'region can not be empty' ;
13422
+ }
13423
+ } ,
13424
+ getURL : function getURL ( _ref , params ) {
13425
+ var config = _ref . config ;
13426
+ var channelsString = params . channels ? params . channels . join ( ',' ) : ',' ;
13427
+ return "/v2/subscribe/" . concat ( config . subscribeKey , "/" ) . concat ( _utils [ "default" ] . encodeString ( channelsString ) , "/0" ) ;
13428
+ } ,
13429
+ getRequestTimeout : function getRequestTimeout ( _ref2 ) {
13430
+ var config = _ref2 . config ;
13431
+ return config . getSubscribeTimeout ( ) ;
13432
+ } ,
13433
+ isAuthSupported : function isAuthSupported ( ) {
13434
+ return true ;
13435
+ } ,
13436
+ getAbortSignal : function getAbortSignal ( _ , params ) {
13437
+ return params . abortSignal ;
13438
+ } ,
13439
+ prepareParams : function prepareParams ( _ , params ) {
13440
+ var outParams = { } ;
13441
+
13442
+ if ( params . channelGroups ) {
13443
+ outParams [ 'channel-group' ] = params . channelGroups . join ( ',' ) ;
13444
+ }
13445
+
13446
+ outParams . tt = params . timetoken ;
13447
+ outParams . tr = params . region ;
13448
+ return outParams ;
13449
+ } ,
13450
+ handleResponse : function handleResponse ( _ , response ) {
13451
+ var parsedMessages = [ ] ;
13452
+ response . m . forEach ( function ( envelope ) {
13453
+ var parsedMessage = {
13454
+ shard : parseInt ( envelope . a , 10 ) ,
13455
+ subscriptionMatch : envelope . b ,
13456
+ channel : envelope . c ,
13457
+ messageType : envelope . e ,
13458
+ payload : envelope . d ,
13459
+ flags : envelope . f ,
13460
+ issuingClientId : envelope . i ,
13461
+ subscribeKey : envelope . k ,
13462
+ originationTimetoken : envelope . o ,
13463
+ publishMetaData : {
13464
+ timetoken : envelope . p . t ,
13465
+ region : envelope . p . r
13466
+ }
13467
+ } ;
13468
+ parsedMessages . push ( parsedMessage ) ;
13469
+ } ) ;
13470
+ return {
13471
+ messages : parsedMessages ,
13472
+ metadata : {
13473
+ region : response . t . r ,
13474
+ timetoken : response . t . t
13475
+ }
13476
+ } ;
13477
+ }
13478
+ } ;
13479
+ var _default = endpoint ;
13480
+ exports [ "default" ] = _default ;
13481
+ module . exports = exports . default ;
13482
+
13483
+ /***/ } ) ,
13484
+ /* 116 */
13485
+ /***/ ( function ( module , exports , __webpack_require__ ) {
13486
+
13487
+ "use strict" ;
13488
+
13489
+
13490
+ /***/ } ) ,
13491
+ /* 117 */
13492
+ /***/ ( function ( module , exports , __webpack_require__ ) {
13493
+
13494
+ "use strict" ;
13495
+
13496
+
13311
13497
var _interopRequireDefault = __webpack_require__ ( 0 ) ;
13312
13498
13313
13499
Object . defineProperty ( exports , "__esModule" , {
@@ -13472,7 +13658,7 @@ exports["default"] = _default;
13472
13658
module . exports = exports . default ;
13473
13659
13474
13660
/***/ } ) ,
13475
- /* 115 */
13661
+ /* 118 */
13476
13662
/***/ ( function ( module , exports , __webpack_require__ ) {
13477
13663
13478
13664
"use strict" ;
@@ -13516,7 +13702,7 @@ exports["default"] = _default;
13516
13702
module . exports = exports . default ;
13517
13703
13518
13704
/***/ } ) ,
13519
- /* 116 */
13705
+ /* 119 */
13520
13706
/***/ ( function ( module , exports , __webpack_require__ ) {
13521
13707
13522
13708
"use strict" ;
@@ -13575,7 +13761,7 @@ exports["default"] = _default;
13575
13761
module . exports = exports . default ;
13576
13762
13577
13763
/***/ } ) ,
13578
- /* 117 */
13764
+ /* 120 */
13579
13765
/***/ ( function ( module , exports , __webpack_require__ ) {
13580
13766
13581
13767
"use strict" ;
@@ -13591,7 +13777,7 @@ exports.post = post;
13591
13777
13592
13778
var _flow_interfaces = __webpack_require__ ( 2 ) ;
13593
13779
13594
- var _utils = __webpack_require__ ( 118 ) ;
13780
+ var _utils = __webpack_require__ ( 121 ) ;
13595
13781
13596
13782
function log ( url , qs , res ) {
13597
13783
var _pickLogger = function _pickLogger ( ) {
@@ -13689,7 +13875,7 @@ function del(params, endpoint, callback) {
13689
13875
}
13690
13876
13691
13877
/***/ } ) ,
13692
- /* 118 */
13878
+ /* 121 */
13693
13879
/***/ ( function ( module , exports , __webpack_require__ ) {
13694
13880
13695
13881
"use strict" ;
0 commit comments