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.
@@ -36,6 +36,8 @@ jobs:
36
36
 
37
37
  make build_all
38
38
 
39
- git add package.json CHANGELOG.md dist/
39
+ git status
40
+
41
+ git add package.json package-lock.json CHANGELOG.md dist/ types/
40
42
  git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}"
41
43
  git push
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.5.0
4
+
5
+ - [ADDED] Watchlist Online Status
6
+
3
7
  ## 7.4.1
4
8
 
5
9
  - [CHANGED] Authorization error message.
@@ -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
@@ -7487,7 +7487,7 @@ function safeJSONStringify(source) {
7487
7487
 
7488
7488
  // CONCATENATED MODULE: ./src/core/defaults.ts
7489
7489
  var Defaults = {
7490
- VERSION: "7.4.1",
7490
+ VERSION: "7.5.0",
7491
7491
  PROTOCOL: 7,
7492
7492
  wsPort: 80,
7493
7493
  wssPort: 443,
@@ -10765,6 +10765,51 @@ function buildChannelAuthorizer(opts, pusher) {
10765
10765
  return channel_authorizer(channelAuthorization);
10766
10766
  }
10767
10767
 
10768
+ // CONCATENATED MODULE: ./src/core/watchlist.ts
10769
+ var watchlist_extends = (undefined && undefined.__extends) || (function () {
10770
+ var extendStatics = function (d, b) {
10771
+ extendStatics = Object.setPrototypeOf ||
10772
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10773
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
10774
+ return extendStatics(d, b);
10775
+ };
10776
+ return function (d, b) {
10777
+ extendStatics(d, b);
10778
+ function __() { this.constructor = d; }
10779
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10780
+ };
10781
+ })();
10782
+
10783
+
10784
+ var watchlist_WatchlistFacade = (function (_super) {
10785
+ watchlist_extends(WatchlistFacade, _super);
10786
+ function WatchlistFacade(pusher) {
10787
+ var _this = _super.call(this, function (eventName, data) {
10788
+ logger.debug("No callbacks on watchlist events for " + eventName);
10789
+ }) || this;
10790
+ _this.pusher = pusher;
10791
+ _this.bindWatchlistInternalEvent();
10792
+ return _this;
10793
+ }
10794
+ WatchlistFacade.prototype.handleEvent = function (pusherEvent) {
10795
+ var _this = this;
10796
+ pusherEvent.data.events.forEach(function (watchlistEvent) {
10797
+ _this.emit(watchlistEvent.name, watchlistEvent);
10798
+ });
10799
+ };
10800
+ WatchlistFacade.prototype.bindWatchlistInternalEvent = function () {
10801
+ var _this = this;
10802
+ this.pusher.connection.bind('message', function (pusherEvent) {
10803
+ var eventName = pusherEvent.event;
10804
+ if (eventName === 'pusher_internal:watchlist_events') {
10805
+ _this.handleEvent(pusherEvent);
10806
+ }
10807
+ });
10808
+ };
10809
+ return WatchlistFacade;
10810
+ }(dispatcher));
10811
+ /* harmony default export */ var watchlist = (watchlist_WatchlistFacade);
10812
+
10768
10813
  // CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
10769
10814
  function flatPromise() {
10770
10815
  var resolve, reject;
@@ -10794,6 +10839,7 @@ var user_extends = (undefined && undefined.__extends) || (function () {
10794
10839
 
10795
10840
 
10796
10841
 
10842
+
10797
10843
  var user_UserFacade = (function (_super) {
10798
10844
  user_extends(UserFacade, _super);
10799
10845
  function UserFacade(pusher) {
@@ -10827,6 +10873,7 @@ var user_UserFacade = (function (_super) {
10827
10873
  _this._newSigninPromiseIfNeeded();
10828
10874
  }
10829
10875
  });
10876
+ _this.watchlist = new watchlist(pusher);
10830
10877
  _this.pusher.connection.bind('message', function (event) {
10831
10878
  var eventName = event.event;
10832
10879
  if (eventName === 'pusher:signin_success') {