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
@@ -2995,7 +2995,7 @@ var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.Scrip
2995
2995
 
2996
2996
  // CONCATENATED MODULE: ./src/core/defaults.ts
2997
2997
  var Defaults = {
2998
- VERSION: "7.4.1",
2998
+ VERSION: "7.5.0",
2999
2999
  PROTOCOL: 7,
3000
3000
  wsPort: 80,
3001
3001
  wssPort: 443,
@@ -6948,6 +6948,51 @@ function buildChannelAuthorizer(opts, pusher) {
6948
6948
  return channel_authorizer(channelAuthorization);
6949
6949
  }
6950
6950
 
6951
+ // CONCATENATED MODULE: ./src/core/watchlist.ts
6952
+ var watchlist_extends = (undefined && undefined.__extends) || (function () {
6953
+ var extendStatics = function (d, b) {
6954
+ extendStatics = Object.setPrototypeOf ||
6955
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6956
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6957
+ return extendStatics(d, b);
6958
+ };
6959
+ return function (d, b) {
6960
+ extendStatics(d, b);
6961
+ function __() { this.constructor = d; }
6962
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6963
+ };
6964
+ })();
6965
+
6966
+
6967
+ var watchlist_WatchlistFacade = (function (_super) {
6968
+ watchlist_extends(WatchlistFacade, _super);
6969
+ function WatchlistFacade(pusher) {
6970
+ var _this = _super.call(this, function (eventName, data) {
6971
+ logger.debug("No callbacks on watchlist events for " + eventName);
6972
+ }) || this;
6973
+ _this.pusher = pusher;
6974
+ _this.bindWatchlistInternalEvent();
6975
+ return _this;
6976
+ }
6977
+ WatchlistFacade.prototype.handleEvent = function (pusherEvent) {
6978
+ var _this = this;
6979
+ pusherEvent.data.events.forEach(function (watchlistEvent) {
6980
+ _this.emit(watchlistEvent.name, watchlistEvent);
6981
+ });
6982
+ };
6983
+ WatchlistFacade.prototype.bindWatchlistInternalEvent = function () {
6984
+ var _this = this;
6985
+ this.pusher.connection.bind('message', function (pusherEvent) {
6986
+ var eventName = pusherEvent.event;
6987
+ if (eventName === 'pusher_internal:watchlist_events') {
6988
+ _this.handleEvent(pusherEvent);
6989
+ }
6990
+ });
6991
+ };
6992
+ return WatchlistFacade;
6993
+ }(dispatcher));
6994
+ /* harmony default export */ var watchlist = (watchlist_WatchlistFacade);
6995
+
6951
6996
  // CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
6952
6997
  function flatPromise() {
6953
6998
  var resolve, reject;
@@ -6977,6 +7022,7 @@ var user_extends = (undefined && undefined.__extends) || (function () {
6977
7022
 
6978
7023
 
6979
7024
 
7025
+
6980
7026
  var user_UserFacade = (function (_super) {
6981
7027
  user_extends(UserFacade, _super);
6982
7028
  function UserFacade(pusher) {
@@ -7010,6 +7056,7 @@ var user_UserFacade = (function (_super) {
7010
7056
  _this._newSigninPromiseIfNeeded();
7011
7057
  }
7012
7058
  });
7059
+ _this.watchlist = new watchlist(pusher);
7013
7060
  _this.pusher.connection.bind('message', function (event) {
7014
7061
  var eventName = event.event;
7015
7062
  if (eventName === 'pusher:signin_success') {