pusher-js 7.4.1 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Pusher JavaScript Library v7.4.1
2
+ * Pusher JavaScript Library v7.5.0
3
3
  * https://pusher.com/
4
4
  *
5
5
  * Copyright 2020, Pusher
@@ -3299,7 +3299,7 @@ function safeJSONStringify(source) {
3299
3299
 
3300
3300
  // CONCATENATED MODULE: ./src/core/defaults.ts
3301
3301
  var Defaults = {
3302
- VERSION: "7.4.1",
3302
+ VERSION: "7.5.0",
3303
3303
  PROTOCOL: 7,
3304
3304
  wsPort: 80,
3305
3305
  wssPort: 443,
@@ -6553,6 +6553,51 @@ function buildChannelAuthorizer(opts, pusher) {
6553
6553
  return channel_authorizer(channelAuthorization);
6554
6554
  }
6555
6555
 
6556
+ // CONCATENATED MODULE: ./src/core/watchlist.ts
6557
+ var watchlist_extends = (undefined && undefined.__extends) || (function () {
6558
+ var extendStatics = function (d, b) {
6559
+ extendStatics = Object.setPrototypeOf ||
6560
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6561
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6562
+ return extendStatics(d, b);
6563
+ };
6564
+ return function (d, b) {
6565
+ extendStatics(d, b);
6566
+ function __() { this.constructor = d; }
6567
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6568
+ };
6569
+ })();
6570
+
6571
+
6572
+ var watchlist_WatchlistFacade = (function (_super) {
6573
+ watchlist_extends(WatchlistFacade, _super);
6574
+ function WatchlistFacade(pusher) {
6575
+ var _this = _super.call(this, function (eventName, data) {
6576
+ logger.debug("No callbacks on watchlist events for " + eventName);
6577
+ }) || this;
6578
+ _this.pusher = pusher;
6579
+ _this.bindWatchlistInternalEvent();
6580
+ return _this;
6581
+ }
6582
+ WatchlistFacade.prototype.handleEvent = function (pusherEvent) {
6583
+ var _this = this;
6584
+ pusherEvent.data.events.forEach(function (watchlistEvent) {
6585
+ _this.emit(watchlistEvent.name, watchlistEvent);
6586
+ });
6587
+ };
6588
+ WatchlistFacade.prototype.bindWatchlistInternalEvent = function () {
6589
+ var _this = this;
6590
+ this.pusher.connection.bind('message', function (pusherEvent) {
6591
+ var eventName = pusherEvent.event;
6592
+ if (eventName === 'pusher_internal:watchlist_events') {
6593
+ _this.handleEvent(pusherEvent);
6594
+ }
6595
+ });
6596
+ };
6597
+ return WatchlistFacade;
6598
+ }(dispatcher));
6599
+ /* harmony default export */ var watchlist = (watchlist_WatchlistFacade);
6600
+
6556
6601
  // CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
6557
6602
  function flatPromise() {
6558
6603
  var resolve, reject;
@@ -6582,6 +6627,7 @@ var user_extends = (undefined && undefined.__extends) || (function () {
6582
6627
 
6583
6628
 
6584
6629
 
6630
+
6585
6631
  var user_UserFacade = (function (_super) {
6586
6632
  user_extends(UserFacade, _super);
6587
6633
  function UserFacade(pusher) {
@@ -6615,6 +6661,7 @@ var user_UserFacade = (function (_super) {
6615
6661
  _this._newSigninPromiseIfNeeded();
6616
6662
  }
6617
6663
  });
6664
+ _this.watchlist = new watchlist(pusher);
6618
6665
  _this.pusher.connection.bind('message', function (event) {
6619
6666
  var eventName = event.event;
6620
6667
  if (eventName === 'pusher:signin_success') {