File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,7 @@ const isConversationChatEventParams = (
4747 typeof event === 'object' &&
4848 event !== null &&
4949 'subtype' in event &&
50- event . subtype === 'chat' &&
51- 'user_name' in event &&
52- 'text' in event
50+ event . subtype === 'chat'
5351 )
5452}
5553
@@ -103,7 +101,7 @@ export class Conversation {
103101 if ( chatCallbacks ?. size ) {
104102 // the backend includes the user_name if is chat event
105103 chatCallbacks . forEach ( ( cb ) =>
106- cb ( event as unknown as ConversationChatEventParams )
104+ cb ( event )
107105 )
108106 }
109107 }
@@ -180,8 +178,7 @@ export class Conversation {
180178 await this . httpClient . fetch < GetConversationMessagesResponse > (
181179 makeQueryParamsUrls ( path , queryParams )
182180 )
183-
184-
181+
185182 return buildPaginatedResult < ConversationMessage > (
186183 body ,
187184 this . httpClient . fetch
Original file line number Diff line number Diff line change @@ -9,19 +9,21 @@ export interface ConversationMessageEventParams {
99 id : string
1010 kind ?: string
1111 metadata : Record < string , unknown >
12- subtype : string
13- text ? : string
12+ subtype : 'chat' | 'update'
13+ text : string | null
1414 ts : number
1515 type : string
1616 from_address_id : string
17+ user_name : string
1718}
1819
1920export type ConversationChatMessageEventParams = Omit <
2021 ConversationMessageEventParams ,
21- 'kind' | 'hidden' | 'metadata'
22+ 'kind'
2223> & {
2324 text : string
2425 user_name : string
26+ subtype : 'chat'
2527}
2628
2729export interface ConversationMessageEvent extends SwEvent {
You can’t perform that action at this time.
0 commit comments