-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing Events API payload types #2155
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ import { MessageEvent as AllMessageEvents, MessageMetadataEvent as AllMessageMet | |
*/ | ||
export type SlackEvent = | ||
| AppRequestedEvent | ||
| AppInstalledEvent | ||
| AppDeletedEvent | ||
| AppUninstalledTeamEvent | ||
| AppHomeOpenedEvent | ||
| AppMentionEvent | ||
| AppRateLimitedEvent | ||
|
@@ -59,14 +62,15 @@ export type SlackEvent = | |
| PinRemovedEvent | ||
| ReactionAddedEvent | ||
| ReactionRemovedEvent | ||
| SharedChannelInviteReceived | ||
| SharedChannelInviteAccepted | ||
| SharedChannelInviteApproved | ||
| SharedChannelInviteDeclined | ||
| SharedChannelInviteReceivedEvent | ||
| SharedChannelInviteAcceptedEvent | ||
| SharedChannelInviteApprovedEvent | ||
| SharedChannelInviteDeclinedEvent | ||
| SharedChannelInviteRequestedEvent | ||
| StarAddedEvent | ||
| StarRemovedEvent | ||
| SubteamCreated | ||
| SubteamMembersChanged | ||
| SubteamCreatedEvent | ||
| SubteamMembersChangedEvent | ||
| SubteamSelfAddedEvent | ||
| SubteamSelfRemovedEvent | ||
| SubteamUpdatedEvent | ||
|
@@ -182,6 +186,38 @@ export interface AppHomeOpenedEvent { | |
event_ts: string; | ||
} | ||
|
||
export interface AppInstalledEvent { | ||
type: 'app_installed'; | ||
app_id: string; | ||
app_name: string; | ||
app_owner_id: string; | ||
user_id: string; | ||
team_id: string; | ||
team_domain: string; | ||
event_ts: string; | ||
} | ||
|
||
export interface AppDeletedEvent { | ||
type: 'app_deleted'; | ||
app_id: string; | ||
app_name: string; | ||
app_owner_id: string; | ||
team_id: string; | ||
team_domain: string; | ||
event_ts: string; | ||
} | ||
|
||
export interface AppUninstalledTeamEvent { | ||
type: 'app_uninstalled_team'; | ||
app_id: string; | ||
app_name: string; | ||
app_owner_id: string; | ||
team_id: string; | ||
team_domain: string; | ||
user_id: string; | ||
event_ts: string; | ||
} | ||
|
||
// NOTE: this is essentially the same as the `message` event, except for the type and that this uses `event_ts` instead | ||
// of `ts` | ||
export interface AppMentionEvent { | ||
|
@@ -740,7 +776,7 @@ export interface SharedChannelItem { | |
is_im: boolean; | ||
name: string; | ||
} | ||
export interface SharedChannelInviteAccepted { | ||
export interface SharedChannelInviteAcceptedEvent { | ||
type: 'shared_channel_invite_accepted'; | ||
approval_required: boolean; | ||
invite: SharedChannelInviteItem; | ||
|
@@ -749,8 +785,13 @@ export interface SharedChannelInviteAccepted { | |
accepting_user: SharedChannelUserItem; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SharedChannelInviteAcceptedEvent` interface instead. | ||
*/ | ||
export type SharedChannelInviteAccepted = SharedChannelInviteAcceptedEvent; | ||
|
||
export interface SharedChannelInviteApproved { | ||
export interface SharedChannelInviteApprovedEvent { | ||
type: 'shared_channel_invite_approved'; | ||
invite: SharedChannelInviteItem; | ||
channel: SharedChannelItem; | ||
|
@@ -759,8 +800,13 @@ export interface SharedChannelInviteApproved { | |
approving_user: SharedChannelUserItem; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SharedChannelInviteApprovedEvent` interface instead. | ||
*/ | ||
export type SharedChannelInviteApproved = SharedChannelInviteApprovedEvent; | ||
|
||
export interface SharedChannelInviteDeclined { | ||
export interface SharedChannelInviteDeclinedEvent { | ||
type: 'shared_channel_invite_declined'; | ||
invite: SharedChannelInviteItem; | ||
channel: SharedChannelItem; | ||
|
@@ -769,13 +815,57 @@ export interface SharedChannelInviteDeclined { | |
declining_user: SharedChannelUserItem; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SharedChannelInviteDeclinedEvent` interface instead. | ||
*/ | ||
export type SharedChannelInviteDeclined = SharedChannelInviteDeclinedEvent; | ||
|
||
export interface SharedChannelInviteReceived { | ||
export interface SharedChannelInviteReceivedEvent { | ||
type: 'shared_channel_invite_received'; | ||
invite: SharedChannelInviteItem; | ||
channel: SharedChannelItem; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SharedChannelInviteReceivedEvent` interface instead. | ||
*/ | ||
export type SharedChannelInviteReceived = SharedChannelInviteReceivedEvent; | ||
|
||
export interface SharedChannelInviteRequestedEvent { | ||
type: 'shared_channel_invite_requested'; | ||
actor: { | ||
id: string; | ||
name: string; | ||
is_bot: boolean; | ||
team_id: string; | ||
timezone: string; | ||
real_name: string; | ||
display_name: string; | ||
}; | ||
channel_id: string; | ||
event_type: 'slack#/events/shared_channel_invite_requested'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tested all aboev app_ events but I haven't checked how this goes not on automation platform. This may be nullable or optional. |
||
channel_name: string; | ||
channel_type: 'public' | 'private'; | ||
target_users: [{ email: string; invite_id: string }]; | ||
teams_in_channel: [ | ||
{ | ||
id: string; | ||
icon: { image_34: string; image_default: boolean }; | ||
name: string; | ||
domain: string; | ||
is_verified: boolean; | ||
date_created: number; | ||
avatar_base_url: string; | ||
requires_sponsorship: boolean; | ||
}, | ||
]; | ||
is_external_limited: boolean; | ||
channel_date_created: number; | ||
channel_message_latest_counted_timestamp: number; | ||
event_ts: string; | ||
} | ||
|
||
export interface StarAddedEvent { | ||
type: 'star_added'; | ||
|
@@ -820,13 +910,18 @@ interface Subteam { | |
channel_count?: number; | ||
} | ||
|
||
export interface SubteamCreated { | ||
export interface SubteamCreatedEvent { | ||
type: 'subteam_created'; | ||
subteam: Subteam; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SubteamCreatedEvent` interface instead. | ||
*/ | ||
export type SubteamCreated = SubteamCreatedEvent; | ||
|
||
export interface SubteamMembersChanged { | ||
export interface SubteamMembersChangedEvent { | ||
type: 'subteam_members_changed'; | ||
subteam_id: string; | ||
team_id: string; | ||
|
@@ -838,6 +933,11 @@ export interface SubteamMembersChanged { | |
removed_users_count?: number; | ||
event_ts: string; | ||
} | ||
// TODO: (breaking change) for backward-compatibility; remove non-Event-suffix type in next major version. | ||
/** | ||
* @deprecated Will be removed in next major version. Use the `SubteamMembersChangedEvent` interface instead. | ||
*/ | ||
export type SubteamMembersChanged = SubteamMembersChangedEvent; | ||
|
||
export interface SubteamSelfAddedEvent { | ||
type: 'subteam_self_added'; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consisteny, renaming all the ones that do not have "Event" suffix