Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions packages/types/src/events/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,41 @@ export interface AppRateLimitedEvent {
// export interface AppRateLimitedEvent {
// }

export interface AppContextChangedEvent {
type: 'app_context_changed';
channel: string;
user: string;
context: {
entities: ((
| {
type: 'slack#/types/channel_id';
value: string;
}
| {
type: 'slack#/types/canvas_id';
value: string;
}
| {
type: 'slack#/types/list_id';
value: string;
}
| {
type: 'slack#/types/message_context';
value: {
message_ts: string;
channel_id?: string;
user_id?: string;
};
}
) & {
score?: number;
team_id?: string;
enterprise_id?: string;
})[];
};
event_ts: string;
}

export interface AppUninstalledEvent {
type: 'app_uninstalled';
}
2 changes: 2 additions & 0 deletions packages/types/src/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
AppContextChangedEvent,
AppDeletedEvent,
AppHomeOpenedEvent,
AppInstalledEvent,
Expand Down Expand Up @@ -120,6 +121,7 @@ export * from './user';
* This is a discriminated union. The discriminant is the `type` property.
*/
export type SlackEvent =
| AppContextChangedEvent
| AppDeletedEvent
| AppHomeOpenedEvent
| AppInstalledEvent
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/events/message.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Block, KnownBlock } from '../block-kit/blocks';
import type { BotProfile } from '../common/bot-profile';
import type { MessageAttachment } from '../message-attachments';
import type { AppContextChangedEvent } from './app';

type ChannelTypes = 'channel' | 'group' | 'im' | 'mpim' | 'app_home';

Expand Down Expand Up @@ -60,6 +61,8 @@ export interface GenericMessageEvent {

// TODO: add properties to this field once it's publicly released
assistant_thread?: Record<string, unknown>;

app_context?: AppContextChangedEvent['context'];
}

export interface BotMessageEvent {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-api/src/types/request/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface AssistantThreadsSetSuggestedPromptsArguments extends TokenOverr
/** @description Prompt suggestions that appear when opening assistant thread. */
prompts: AssistantPrompt[];
/** @description Message timestamp of the thread. */
thread_ts: string;
thread_ts?: string;
/** @description Title for the prompts. */
title?: string;
}
Expand Down