Skip to content
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 2 commits into from
Jul 3, 2024
Merged

Conversation

seratch
Copy link
Member

@seratch seratch commented Jul 2, 2024

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 [ ])

@seratch seratch added enhancement M-T: A feature request for new functionality TypeScript-specific labels Jul 2, 2024
@seratch seratch added this to the 3.20.0 milestone Jul 2, 2024
@seratch seratch requested review from filmaj and zimeg July 2, 2024 06:52
@seratch seratch self-assigned this Jul 2, 2024
@@ -740,7 +776,7 @@ export interface SharedChannelItem {
is_im: boolean;
name: string;
}
export interface SharedChannelInviteAccepted {
export interface SharedChannelInviteAcceptedEvent {
Copy link
Member Author

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';
Copy link
Member Author

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.

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.00%. Comparing base (8e49f7b) to head (8319003).

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@filmaj filmaj left a 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.

@@ -749,8 +785,10 @@ export interface SharedChannelInviteAccepted {
accepting_user: SharedChannelUserItem;
event_ts: string;
}
// for backward-compatibility
Copy link
Contributor

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.

Suggested change
// 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?

Copy link
Member Author

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!

Copy link
Member Author

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?

@filmaj filmaj merged commit 044e3c5 into slackapi:main Jul 3, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality TypeScript-specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants