Skip to content

Commit 520a2d6

Browse files
authored
fix(web-api): update thread_ts arg to be required for chat.startStream method (#2382)
1 parent 898becc commit 520a2d6

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

packages/web-api/src/types/request/chat.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,7 @@ export type ChatScheduledMessagesListArguments = OptionalArgument<
218218
Partial<Channel>
219219
>;
220220

221-
export interface ChatStartStreamArguments
222-
extends TokenOverridable,
223-
Channel,
224-
Partial<ThreadTS>,
225-
Partial<MarkdownText>,
226-
Unfurls {
221+
export interface ChatStartStreamArguments extends TokenOverridable, Channel, Partial<MarkdownText>, ThreadTS, Unfurls {
227222
/**
228223
* @description The ID of the team that is associated with `recipient_user_id`.
229224
* This is required when starting a streaming conversation outside of a DM.

packages/web-api/test/types/methods/chat.test-d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,21 +588,34 @@ expectAssignable<Parameters<typeof web.chat.scheduledMessages.list>>([]); // no
588588
// -- sad path
589589
expectError(web.chat.startStream()); // lacking argument
590590
expectError(web.chat.startStream({})); // empty argument
591+
expectError(
592+
web.chat.startStream({
593+
channel: 'C1234', // missing thread_ts
594+
}),
595+
);
596+
expectError(
597+
web.chat.startStream({
598+
thread_ts: '1234.56', // missing channel
599+
}),
600+
);
591601
// -- happy path
592602
expectAssignable<Parameters<typeof web.chat.startStream>>([
593603
{
594604
channel: 'C1234',
605+
thread_ts: '1234.56',
595606
},
596607
]);
597608
expectAssignable<Parameters<typeof web.chat.startStream>>([
598609
{
599610
channel: 'C1234',
611+
thread_ts: '1234.56',
600612
markdown_text: 'hello',
601613
},
602614
]);
603615
expectAssignable<Parameters<typeof web.chat.startStream>>([
604616
{
605617
channel: 'C1234',
618+
thread_ts: '1234.56',
606619
markdown_text: 'hello',
607620
unfurl_links: true,
608621
unfurl_media: false,
@@ -611,6 +624,7 @@ expectAssignable<Parameters<typeof web.chat.startStream>>([
611624
expectAssignable<Parameters<typeof web.chat.startStream>>([
612625
{
613626
channel: 'C1234',
627+
thread_ts: '1234.56',
614628
markdown_text: 'hello',
615629
unfurl_links: true,
616630
unfurl_media: false,

0 commit comments

Comments
 (0)