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
@@ -593,7 +593,7 @@ var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.Scrip
593
593
 
594
594
  // CONCATENATED MODULE: ./src/core/defaults.ts
595
595
  var Defaults = {
596
- VERSION: "7.4.1",
596
+ VERSION: "7.5.0",
597
597
  PROTOCOL: 7,
598
598
  wsPort: 80,
599
599
  wssPort: 443,
@@ -4546,6 +4546,51 @@ function buildChannelAuthorizer(opts, pusher) {
4546
4546
  return channel_authorizer(channelAuthorization);
4547
4547
  }
4548
4548
 
4549
+ // CONCATENATED MODULE: ./src/core/watchlist.ts
4550
+ var watchlist_extends = (undefined && undefined.__extends) || (function () {
4551
+ var extendStatics = function (d, b) {
4552
+ extendStatics = Object.setPrototypeOf ||
4553
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
4554
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
4555
+ return extendStatics(d, b);
4556
+ };
4557
+ return function (d, b) {
4558
+ extendStatics(d, b);
4559
+ function __() { this.constructor = d; }
4560
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4561
+ };
4562
+ })();
4563
+
4564
+
4565
+ var watchlist_WatchlistFacade = (function (_super) {
4566
+ watchlist_extends(WatchlistFacade, _super);
4567
+ function WatchlistFacade(pusher) {
4568
+ var _this = _super.call(this, function (eventName, data) {
4569
+ logger.debug("No callbacks on watchlist events for " + eventName);
4570
+ }) || this;
4571
+ _this.pusher = pusher;
4572
+ _this.bindWatchlistInternalEvent();
4573
+ return _this;
4574
+ }
4575
+ WatchlistFacade.prototype.handleEvent = function (pusherEvent) {
4576
+ var _this = this;
4577
+ pusherEvent.data.events.forEach(function (watchlistEvent) {
4578
+ _this.emit(watchlistEvent.name, watchlistEvent);
4579
+ });
4580
+ };
4581
+ WatchlistFacade.prototype.bindWatchlistInternalEvent = function () {
4582
+ var _this = this;
4583
+ this.pusher.connection.bind('message', function (pusherEvent) {
4584
+ var eventName = pusherEvent.event;
4585
+ if (eventName === 'pusher_internal:watchlist_events') {
4586
+ _this.handleEvent(pusherEvent);
4587
+ }
4588
+ });
4589
+ };
4590
+ return WatchlistFacade;
4591
+ }(dispatcher));
4592
+ /* harmony default export */ var watchlist = (watchlist_WatchlistFacade);
4593
+
4549
4594
  // CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
4550
4595
  function flatPromise() {
4551
4596
  var resolve, reject;
@@ -4575,6 +4620,7 @@ var user_extends = (undefined && undefined.__extends) || (function () {
4575
4620
 
4576
4621
 
4577
4622
 
4623
+
4578
4624
  var user_UserFacade = (function (_super) {
4579
4625
  user_extends(UserFacade, _super);
4580
4626
  function UserFacade(pusher) {
@@ -4608,6 +4654,7 @@ var user_UserFacade = (function (_super) {
4608
4654
  _this._newSigninPromiseIfNeeded();
4609
4655
  }
4610
4656
  });
4657
+ _this.watchlist = new watchlist(pusher);
4611
4658
  _this.pusher.connection.bind('message', function (event) {
4612
4659
  var eventName = event.event;
4613
4660
  if (eventName === 'pusher:signin_success') {