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

[question/proposal] use of enums for event names? #112

Closed
oscard0m opened this issue Feb 15, 2020 · 3 comments · Fixed by #113
Closed

[question/proposal] use of enums for event names? #112

oscard0m opened this issue Feb 15, 2020 · 3 comments · Fixed by #113
Labels
Type: Feature New feature or request typescript Relevant to TypeScript users only
Projects

Comments

@oscard0m
Copy link
Member

[❓question] Would have sense to use enums for event names?

webhooks.js/index.d.ts

Lines 4402 to 4417 in 5ca6c8a

event:
| "pull_request"
| "pull_request.assigned"
| "pull_request.closed"
| "pull_request.edited"
| "pull_request.labeled"
| "pull_request.locked"
| "pull_request.opened"
| "pull_request.ready_for_review"
| "pull_request.reopened"
| "pull_request.review_request_removed"
| "pull_request.review_requested"
| "pull_request.unassigned"
| "pull_request.unlabeled"
| "pull_request.unlocked"
| "pull_request.synchronize",

A use case where it would be valuable is to make sure the events to be listened webhooks.on([<eventName>]) are the right ones on compile time.

If you think is a valid proposal I would be more than happy to propose a pull-request for it! :)

@wolfy1339 wolfy1339 added the typescript Relevant to TypeScript users only label Feb 15, 2020
@gr2m
Copy link
Contributor

gr2m commented Feb 16, 2020

Yes, I think that'd be great!

@oscard0m
Copy link
Member Author

I drafted a Pull Request to agree on the approach to follow to generate the enums, could someone take a look? Should I draft the PR over octokit?

Let me know which should be the approach

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 7.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request typescript Relevant to TypeScript users only
Projects
No open projects
JS
  
Done
3 participants