-
Notifications
You must be signed in to change notification settings - Fork 394
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
Conversation
@@ -740,7 +776,7 @@ export interface SharedChannelItem { | |||
is_im: boolean; | |||
name: string; | |||
} | |||
export interface SharedChannelInviteAccepted { | |||
export interface SharedChannelInviteAcceptedEvent { |
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
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 comment
The 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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2155 +/- ##
=======================================
Coverage 82.00% 82.00%
=======================================
Files 18 18
Lines 1539 1539
Branches 442 442
=======================================
Hits 1262 1262
Misses 179 179
Partials 98 98 ☔ View full report in Codecov by Sentry. |
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.
LGTM but I left one request re: comment and deprecation for the backwards compatible types, as we inch towards bolt v4.
src/types/events/base-events.ts
Outdated
@@ -749,8 +785,10 @@ export interface SharedChannelInviteAccepted { | |||
accepting_user: SharedChannelUserItem; | |||
event_ts: string; | |||
} | |||
// for backward-compatibility |
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.
Thank you for doing this!
For my own future hints, esp since I would like to release bolt v4 this year, I add a "TODO (breaking change)" comment in areas for deprecation. Also might be useful to add a JSdoc to signify deprecation and what to move to; this would be raised up to the developer in their IDE at author-time.
// for backward-compatibility | |
// 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. | |
*/ |
Could we add a similar comment next to each inconsistently-named backwards-compatible type in this PR?
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.
Thanks! I will update the comments tomorrow in my timezone!
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.
@filmaj Updated the comments. Can you check again and mege this PR if it's fine tomorrow?
Summary
This pull request adds a few Events API payloads to the types. See also: slackapi/java-slack-sdk#1332
Requirements (place an
x
in each[ ]
)