From 56e945f591137e81530c302ff8c88990612f8158 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 16 Jan 2025 20:19:59 +0000 Subject: [PATCH] feat(): include flag for parsed WS API responses --- src/util/BaseWSClient.ts | 1 + src/websocket-client.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/util/BaseWSClient.ts b/src/util/BaseWSClient.ts index dd923f24..2c23bd22 100644 --- a/src/util/BaseWSClient.ts +++ b/src/util/BaseWSClient.ts @@ -57,6 +57,7 @@ interface WSClientEventMap { export interface EmittableEvent { eventType: 'response' | 'update' | 'exception' | 'authenticated'; event: TEvent; + isWSAPIResponse?: boolean; } // Type safety for on and emit handlers: https://stackoverflow.com/a/61609010/880837 diff --git a/src/websocket-client.ts b/src/websocket-client.ts index 025d53be..827d267c 100644 --- a/src/websocket-client.ts +++ b/src/websocket-client.ts @@ -717,6 +717,7 @@ export class WebsocketClient extends BaseWebsocketClient { results.push({ eventType: 'exception', event: parsed, + isWSAPIResponse: true, }); return results; } @@ -743,6 +744,7 @@ export class WebsocketClient extends BaseWebsocketClient { results.push({ eventType: 'response', event: parsed, + isWSAPIResponse: true, }); return results;