Skip to content

Commit

Permalink
Merge pull request #65 from PabloRNC/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
PabloRNC committed Mar 22, 2024
2 parents 0b8b0ad + 1d51b81 commit e35cb7b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/eventsub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@twitchapi/eventsub",
"version": "1.0.0-beta.19",
"version": "1.0.0-beta.20",
"description": "A powerful node module to interact with the EventSub on Twitch.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 7 additions & 7 deletions packages/eventsub/src/structures/BaseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ export class EventSubEventEmitter<U extends WebhookEvents | WebSocketEvents> ext

export abstract class BaseConnection<K extends ConnectionTypes, U extends WebhookEvents | WebSocketEvents> extends EventSubEventEmitter<U>{

public clientID: string;
public readonly clientID: string;

public clientSecret: string;
public readonly clientSecret: string;

public helixClient: HelixClient;
public readonly helixClient: HelixClient;

public subscriptions: SubscriptionCollection<K>;
public readonly subscriptions: SubscriptionCollection<K>;

public storage: StorageAdapter<K>;
public readonly storage: StorageAdapter<K>;

public maintainSubscriptions: boolean;
public readonly maintainSubscriptions: boolean;

public logger: Logger;
public readonly logger: Logger;

public debug: boolean;

Expand Down
6 changes: 3 additions & 3 deletions packages/eventsub/src/ws/structures/WebSocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { WebSocketSubscription } from './WebSocketSubscription';

export class WebSocketConnection extends BaseConnection<WebSocketConnection, WebSocketEvents>{

public userToken: UserTokenAdapter<boolean>;
protected userToken: UserTokenAdapter<boolean>;

public proxy?: string;
public readonly proxy?: string;

public ws: WebSocket;
public readonly ws: WebSocket;

public sessionID: string | null;

Expand Down
5 changes: 0 additions & 5 deletions packages/eventsub/src/ws/structures/WebSocketSubscription.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { UserTokenAdapter } from '@twitchapi/helix';
import type { PostEventSubSubscription } from '@twitchapi/api-types';
import type { WebSocketConnection } from './WebSocketConnection';
import { WebSocketSubscriptionCallbackManager } from './WebSocketSubscriptionCallbackManager';
Expand All @@ -13,8 +12,6 @@ export class WebSocketSubscription<T extends SubscriptionTypes = SubscriptionTyp

public readonly connection: WebSocketConnection;

public readonly userToken: UserTokenAdapter<boolean>;

public callbacks: WebSocketSubscriptionCallbackManager<T>;

public constructor(connection: WebSocketConnection, options: SubscriptionOptions<T>, data: PostEventSubSubscription){
Expand All @@ -23,8 +20,6 @@ export class WebSocketSubscription<T extends SubscriptionTypes = SubscriptionTyp

this.connection = connection;

this.userToken = connection.userToken;

this.callbacks = new WebSocketSubscriptionCallbackManager<T>(connection);

this.callbacks.add((message) => this.connection.emit(Events.SubscriptionMessage, message, this));
Expand Down

0 comments on commit e35cb7b

Please sign in to comment.