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.
- package/.github/workflows/release_pr.yml +3 -1
- package/CHANGELOG.md +4 -0
- package/dist/node/pusher.js +49 -2
- package/dist/node/pusher.js.map +1 -1
- package/dist/react-native/pusher.js +5 -5
- package/dist/react-native/pusher.js.map +1 -1
- package/dist/web/pusher-with-encryption.js +49 -2
- package/dist/web/pusher-with-encryption.js.map +1 -1
- package/dist/web/pusher-with-encryption.min.js +2 -2
- package/dist/web/pusher-with-encryption.min.js.map +1 -1
- package/dist/web/pusher.js +49 -2
- package/dist/web/pusher.js.map +1 -1
- package/dist/web/pusher.min.js +2 -2
- package/dist/web/pusher.min.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.js +49 -2
- package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
- package/dist/worker/pusher-with-encryption.worker.min.js +2 -2
- package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
- package/dist/worker/pusher.worker.js +49 -2
- package/dist/worker/pusher.worker.js.map +1 -1
- package/dist/worker/pusher.worker.min.js +2 -2
- package/dist/worker/pusher.worker.min.js.map +1 -1
- package/package.json +1 -1
- package/spec/javascripts/unit/core/watchlist_spec.js +48 -0
- package/src/core/pusher.ts +0 -1
- package/src/core/user.ts +5 -0
- package/src/core/watchlist.ts +31 -0
- package/types/src/core/user.d.ts +2 -0
- package/types/src/core/watchlist.d.ts +8 -0
package/CHANGELOG.md
CHANGED
package/dist/node/pusher.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Pusher JavaScript Library v7.
|
|
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.
|
|
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') {
|