Skip to content

Commit

Permalink
feat(TypeScript): "ping" event payload definitions (#121)
Browse files Browse the repository at this point in the history
Co-authored-by: Octokit Bot <[email protected]>
  • Loading branch information
greenkeeper[bot] and Octokit Bot authored Apr 12, 2020
1 parent dc62e27 commit b9c82a5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
32 changes: 32 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ type Options = {
};

declare namespace Webhooks {
type WebhookPayloadPingPayloadHookConfig = {
content_type: string;
insecure_ssl: string;
url: string;
};
type WebhookPayloadPingPayloadHook = {
type: string;
id: number;
name: string;
active: boolean;
events: Array<string>;
config: WebhookPayloadPingPayloadHookConfig;
updated_at: string;
created_at: string;
app_id: number;
};
type WebhookPayloadPingPayload = {
zen: string;
hook_id: number;
hook: WebhookPayloadPingPayloadHook;
};
type WebhookPayloadPing = {
event: string;
payload: WebhookPayloadPingPayload;
};
type WebhookPayloadWatchSender = {
login: string;
id: number;
Expand Down Expand Up @@ -4668,6 +4693,13 @@ declare class Webhooks {
) => Promise<void> | void
): void;

public on(
event: "ping",
callback: (
event: Webhooks.WebhookEvent<Webhooks.WebhookPayloadPing>
) => Promise<void> | void
): void;

public sign(data: any): string;
public verify(eventPayload: any, signature: string): boolean;
public verifyAndReceive(options: {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@gimenete/type-writer": "^0.1.5",
"@octokit/webhooks-definitions": "3.4.2",
"@octokit/webhooks-definitions": "3.5.0",
"axios": "^0.19.0",
"cheerio": "^1.0.0-rc.2",
"get-port": "^5.0.0",
Expand Down

0 comments on commit b9c82a5

Please sign in to comment.