Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@twurple/eventsub-ws

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twurple/eventsub-ws - npm Package Compare versions

Comparing version 7.0.0-pre.2 to 7.0.0-pre.3

5

lib/EventSubWsListener.js

@@ -122,3 +122,6 @@ "use strict";

}
if (!this._sockets.has(authUserId)) {
if (this._sockets.has(authUserId)) {
this._sockets.get(authUserId).start();
}
else {
this._createSocketForUser(authUserId);

@@ -125,0 +128,0 @@ }

27

lib/EventSubWsSocket.d.ts

@@ -1,27 +0,2 @@

import { type LoggerOptions } from '@d-fischer/logger';
import { type EventSubWsListener } from './EventSubWsListener';
/** @private */
export declare class EventSubWsSocket {
private readonly _listener;
private readonly _userId;
private readonly _connection;
private _sessionId?;
private readonly _initialUrl;
private _reconnectInProgress;
private _reconnectUrl?;
private _keepaliveTimeout;
private _keepaliveTimer;
private readonly _logger;
private _readyToSubscribe;
constructor(_listener: EventSubWsListener, _userId: string, initialUrl: string, loggerOptions?: Partial<LoggerOptions>);
start(): void;
stop(): void;
get readyToSubscribe(): boolean;
get sessionId(): string | undefined;
get userId(): string;
private _initializeKeepaliveTimeout;
private _clearKeepaliveTimer;
private _restartKeepaliveTimer;
private _handleKeepaliveTimeout;
}
export {};
//# sourceMappingURL=EventSubWsSocket.d.ts.map

@@ -8,3 +8,3 @@ "use strict";

const shared_utils_1 = require("@d-fischer/shared-utils");
/** @private */
/** @internal */
class EventSubWsSocket {

@@ -39,2 +39,5 @@ constructor(_listener, _userId, initialUrl, loggerOptions) {

this._keepaliveTimeout = null;
for (const sub of this._listener._getSubscriptionsForUser(this._userId)) {
sub._droppedByTwitch();
}
});

@@ -50,3 +53,9 @@ this._connection.onReceive(data => {

if (!this._reconnectInProgress) {
for (const sub of this._listener._getSubscriptionsForUser(this._userId)) {
const subs = this._listener._getSubscriptionsForUser(this._userId);
if (!subs.length) {
this._logger.debug(`Stopping socket for user ${this._userId} because no subscriptions are active`);
this.stop();
break;
}
for (const sub of subs) {
sub.start();

@@ -110,6 +119,10 @@ }

start() {
this._connection.connect();
if (!this._connection.isConnected && !this._connection.isConnecting) {
this._connection.connect();
}
}
stop() {
this._connection.disconnect();
if (this._connection.isConnected || this._connection.isConnecting) {
this._connection.disconnect();
}
}

@@ -116,0 +129,0 @@ get readyToSubscribe() {

{
"name": "@twurple/eventsub-ws",
"version": "7.0.0-pre.2",
"version": "7.0.0-pre.3",
"publishConfig": {

@@ -40,12 +40,12 @@ "access": "public"

"@d-fischer/typed-event-emitter": "^3.3.0",
"@twurple/auth": "7.0.0-pre.2",
"@twurple/common": "7.0.0-pre.2",
"@twurple/eventsub-base": "7.0.0-pre.2",
"@twurple/auth": "7.0.0-pre.3",
"@twurple/common": "7.0.0-pre.3",
"@twurple/eventsub-base": "7.0.0-pre.3",
"tslib": "^2.0.3"
},
"devDependencies": {
"@twurple/api": "7.0.0-pre.2"
"@twurple/api": "7.0.0-pre.3"
},
"peerDependencies": {
"@twurple/api": "7.0.0-pre.2"
"@twurple/api": "7.0.0-pre.3"
},

@@ -52,0 +52,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc