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
|
@@ -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
|
|
@@ -897,7 +897,7 @@ function safeJSONStringify(source) {
|
|
|
897
897
|
|
|
898
898
|
// CONCATENATED MODULE: ./src/core/defaults.ts
|
|
899
899
|
var Defaults = {
|
|
900
|
-
VERSION: "7.
|
|
900
|
+
VERSION: "7.5.0",
|
|
901
901
|
PROTOCOL: 7,
|
|
902
902
|
wsPort: 80,
|
|
903
903
|
wssPort: 443,
|
|
@@ -4151,6 +4151,51 @@ function buildChannelAuthorizer(opts, pusher) {
|
|
|
4151
4151
|
return channel_authorizer(channelAuthorization);
|
|
4152
4152
|
}
|
|
4153
4153
|
|
|
4154
|
+
// CONCATENATED MODULE: ./src/core/watchlist.ts
|
|
4155
|
+
var watchlist_extends = (undefined && undefined.__extends) || (function () {
|
|
4156
|
+
var extendStatics = function (d, b) {
|
|
4157
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4158
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
4159
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
4160
|
+
return extendStatics(d, b);
|
|
4161
|
+
};
|
|
4162
|
+
return function (d, b) {
|
|
4163
|
+
extendStatics(d, b);
|
|
4164
|
+
function __() { this.constructor = d; }
|
|
4165
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4166
|
+
};
|
|
4167
|
+
})();
|
|
4168
|
+
|
|
4169
|
+
|
|
4170
|
+
var watchlist_WatchlistFacade = (function (_super) {
|
|
4171
|
+
watchlist_extends(WatchlistFacade, _super);
|
|
4172
|
+
function WatchlistFacade(pusher) {
|
|
4173
|
+
var _this = _super.call(this, function (eventName, data) {
|
|
4174
|
+
logger.debug("No callbacks on watchlist events for " + eventName);
|
|
4175
|
+
}) || this;
|
|
4176
|
+
_this.pusher = pusher;
|
|
4177
|
+
_this.bindWatchlistInternalEvent();
|
|
4178
|
+
return _this;
|
|
4179
|
+
}
|
|
4180
|
+
WatchlistFacade.prototype.handleEvent = function (pusherEvent) {
|
|
4181
|
+
var _this = this;
|
|
4182
|
+
pusherEvent.data.events.forEach(function (watchlistEvent) {
|
|
4183
|
+
_this.emit(watchlistEvent.name, watchlistEvent);
|
|
4184
|
+
});
|
|
4185
|
+
};
|
|
4186
|
+
WatchlistFacade.prototype.bindWatchlistInternalEvent = function () {
|
|
4187
|
+
var _this = this;
|
|
4188
|
+
this.pusher.connection.bind('message', function (pusherEvent) {
|
|
4189
|
+
var eventName = pusherEvent.event;
|
|
4190
|
+
if (eventName === 'pusher_internal:watchlist_events') {
|
|
4191
|
+
_this.handleEvent(pusherEvent);
|
|
4192
|
+
}
|
|
4193
|
+
});
|
|
4194
|
+
};
|
|
4195
|
+
return WatchlistFacade;
|
|
4196
|
+
}(dispatcher));
|
|
4197
|
+
/* harmony default export */ var watchlist = (watchlist_WatchlistFacade);
|
|
4198
|
+
|
|
4154
4199
|
// CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
|
|
4155
4200
|
function flatPromise() {
|
|
4156
4201
|
var resolve, reject;
|
|
@@ -4180,6 +4225,7 @@ var user_extends = (undefined && undefined.__extends) || (function () {
|
|
|
4180
4225
|
|
|
4181
4226
|
|
|
4182
4227
|
|
|
4228
|
+
|
|
4183
4229
|
var user_UserFacade = (function (_super) {
|
|
4184
4230
|
user_extends(UserFacade, _super);
|
|
4185
4231
|
function UserFacade(pusher) {
|
|
@@ -4213,6 +4259,7 @@ var user_UserFacade = (function (_super) {
|
|
|
4213
4259
|
_this._newSigninPromiseIfNeeded();
|
|
4214
4260
|
}
|
|
4215
4261
|
});
|
|
4262
|
+
_this.watchlist = new watchlist(pusher);
|
|
4216
4263
|
_this.pusher.connection.bind('message', function (event) {
|
|
4217
4264
|
var eventName = event.event;
|
|
4218
4265
|
if (eventName === 'pusher:signin_success') {
|