-
Notifications
You must be signed in to change notification settings - Fork 81
Description
The types will need to be adapted to make use of the OpenAPI spec.
We can make use of my package @wolfy1339/openapi-webhooks-types to help with the transition.
Some points which I see as potential issues:
The types format is not the same, the webhooks are not on their own interface like they are currently in @octokit/webhooks-types.
In the OpanAPI spec types, the way to get a webhook resembles like so:
import { webhooks } from `@wolfy1339/openapi-webhooks-types`;
type TEventIdentifier = "check-suite-completed";
type CheckSuiteCompletedEvent = webhooks[TEventIdentifier]["post"]["requestBody"]["content"]["application/json"];Each webhook definition's name is made like so in reference to the names we accept in the event handlers
const webhookIdentifier = "check_suite.completed".replaceAll(/_|\./g, "-");
// webhookIdentifier: check-suite-completedThe name is seperated by - and dots are replaced by -
There are currently no types for events and all their possible actions, eg: check_suite.
I'm not sure how we can get around this easily without having to resort to a lookup table. If you have any ideas, please comment
Metadata
Metadata
Assignees
Labels
Type
Projects
Status