@octokit/webhooks 6.2.2 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/event-handler/receive.js +1 -1
- package/event-handler/wrap-error-handler.js +2 -2
- package/index.d.ts +56 -2
- package/lib/webhook-names.json +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -351,7 +351,7 @@ webhooks.on(eventNames, handler)
|
|
|
351
351
|
</td>
|
|
352
352
|
<td>
|
|
353
353
|
<strong>Required.</strong>
|
|
354
|
-
Name of the event. One of <a href="
|
|
354
|
+
Name of the event. One of <a href="https://developer.github.com/webhooks/#events">GitHub's supported event names</a>.
|
|
355
355
|
</td>
|
|
356
356
|
</tr>
|
|
357
357
|
<tr>
|
|
@@ -407,7 +407,7 @@ webhooks.removeListener(eventNames, handler)
|
|
|
407
407
|
</td>
|
|
408
408
|
<td>
|
|
409
409
|
<strong>Required.</strong>
|
|
410
|
-
Name of the event. One of <a href="
|
|
410
|
+
Name of the event. One of <a href="https://developer.github.com/webhooks/#events">GitHub’s supported event names</a>.
|
|
411
411
|
</td>
|
|
412
412
|
</tr>
|
|
413
413
|
<tr>
|
|
@@ -537,6 +537,7 @@ If there are actions for a webhook, events are emitted for both, the webhook nam
|
|
|
537
537
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#pushevent"><code>push</code></a></td><td class="actions-td td_num"></td></tr>
|
|
538
538
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#registrypackageevent"><code>registry_package</code></a></td><td class="actions-td td_text"><code>published</code><br><code>updated</code></td></tr>
|
|
539
539
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#releaseevent"><code>release</code></a></td><td class="actions-td td_text"><code>created</code><br><code>deleted</code><br><code>edited</code><br><code>prereleased</code><br><code>published</code><br><code>unpublished</code></td></tr>
|
|
540
|
+
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#repositorydispatchevent"><code>repository_dispatch</code></a></td><td class="actions-td td_num"></td></tr>
|
|
540
541
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#repositoryevent"><code>repository</code></a></td><td class="actions-td td_text"><code>archived</code><br><code>created</code><br><code>deleted</code><br><code>edited</code><br><code>privatized</code><br><code>publicized</code><br><code>renamed</code><br><code>transferred</code><br><code>unarchived</code></td></tr>
|
|
541
542
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#repositoryimportevent"><code>repository_import</code></a></td><td class="actions-td td_num"></td></tr>
|
|
542
543
|
<tr ><td class="name-td td_text"><a href="https://developer.github.com/v3/activity/events/types/#repositoryvulnerabilityalertevent"><code>repository_vulnerability_alert</code></a></td><td class="actions-td td_text"><code>create</code><br><code>dismiss</code><br><code>resolve</code></td></tr>
|
package/event-handler/receive.js
CHANGED
|
@@ -23,7 +23,7 @@ function receiverHandle (state, event) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// flatten arrays of event listeners and remove undefined values
|
|
26
|
-
|
|
26
|
+
const hooks = [].concat(
|
|
27
27
|
state.hooks[`${event.name}.${event.payload.action}`],
|
|
28
28
|
state.hooks[event.name],
|
|
29
29
|
state.hooks['*']
|
|
@@ -11,13 +11,13 @@ function wrapErrorHandler (handler, error) {
|
|
|
11
11
|
try {
|
|
12
12
|
returnValue = handler(error)
|
|
13
13
|
} catch (error) {
|
|
14
|
-
console.log(
|
|
14
|
+
console.log('FATAL: Error occured in "error" event handler')
|
|
15
15
|
console.log(error)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (returnValue && returnValue.catch) {
|
|
19
19
|
returnValue.catch(error => {
|
|
20
|
-
console.log(
|
|
20
|
+
console.log('FATAL: Error occured in "error" event handler')
|
|
21
21
|
console.log(error)
|
|
22
22
|
})
|
|
23
23
|
}
|
package/index.d.ts
CHANGED
|
@@ -434,6 +434,53 @@ declare namespace Webhooks {
|
|
|
434
434
|
repository: PayloadRepository;
|
|
435
435
|
sender: WebhookPayloadRepositorySender;
|
|
436
436
|
};
|
|
437
|
+
type WebhookPayloadRepositoryDispatchInstallation = {
|
|
438
|
+
id: number;
|
|
439
|
+
node_id: string;
|
|
440
|
+
};
|
|
441
|
+
type WebhookPayloadRepositoryDispatchSender = {
|
|
442
|
+
login: string;
|
|
443
|
+
id: number;
|
|
444
|
+
node_id: string;
|
|
445
|
+
avatar_url: string;
|
|
446
|
+
gravatar_id: string;
|
|
447
|
+
url: string;
|
|
448
|
+
html_url: string;
|
|
449
|
+
followers_url: string;
|
|
450
|
+
following_url: string;
|
|
451
|
+
gists_url: string;
|
|
452
|
+
starred_url: string;
|
|
453
|
+
subscriptions_url: string;
|
|
454
|
+
organizations_url: string;
|
|
455
|
+
repos_url: string;
|
|
456
|
+
events_url: string;
|
|
457
|
+
received_events_url: string;
|
|
458
|
+
type: string;
|
|
459
|
+
site_admin: boolean;
|
|
460
|
+
};
|
|
461
|
+
type WebhookPayloadRepositoryDispatchOrganization = {
|
|
462
|
+
login: string;
|
|
463
|
+
id: number;
|
|
464
|
+
node_id: string;
|
|
465
|
+
url: string;
|
|
466
|
+
repos_url: string;
|
|
467
|
+
events_url: string;
|
|
468
|
+
hooks_url: string;
|
|
469
|
+
issues_url: string;
|
|
470
|
+
members_url: string;
|
|
471
|
+
public_members_url: string;
|
|
472
|
+
avatar_url: string;
|
|
473
|
+
description: string;
|
|
474
|
+
};
|
|
475
|
+
type WebhookPayloadRepositoryDispatch = {
|
|
476
|
+
action: string;
|
|
477
|
+
branch: string;
|
|
478
|
+
ref: string;
|
|
479
|
+
repository: PayloadRepository;
|
|
480
|
+
organization: WebhookPayloadRepositoryDispatchOrganization;
|
|
481
|
+
sender: WebhookPayloadRepositoryDispatchSender;
|
|
482
|
+
installation: WebhookPayloadRepositoryDispatchInstallation;
|
|
483
|
+
};
|
|
437
484
|
type WebhookPayloadReleaseSender = {
|
|
438
485
|
login: string;
|
|
439
486
|
id: number;
|
|
@@ -3761,7 +3808,7 @@ declare namespace Webhooks {
|
|
|
3761
3808
|
private: boolean;
|
|
3762
3809
|
owner: PayloadRepositoryOwner;
|
|
3763
3810
|
html_url: string;
|
|
3764
|
-
description: null;
|
|
3811
|
+
description: null | string;
|
|
3765
3812
|
fork: boolean;
|
|
3766
3813
|
url: string;
|
|
3767
3814
|
forks_url: string;
|
|
@@ -3807,7 +3854,7 @@ declare namespace Webhooks {
|
|
|
3807
3854
|
ssh_url: string;
|
|
3808
3855
|
clone_url: string;
|
|
3809
3856
|
svn_url: string;
|
|
3810
|
-
homepage: null;
|
|
3857
|
+
homepage: null | string;
|
|
3811
3858
|
size: number;
|
|
3812
3859
|
stargazers_count: number;
|
|
3813
3860
|
watchers_count: number;
|
|
@@ -4417,6 +4464,13 @@ declare class Webhooks {
|
|
|
4417
4464
|
) => Promise<void> | void
|
|
4418
4465
|
): void;
|
|
4419
4466
|
|
|
4467
|
+
public on(
|
|
4468
|
+
event: "repository_dispatch",
|
|
4469
|
+
callback: (
|
|
4470
|
+
event: Webhooks.WebhookEvent<Webhooks.WebhookPayloadRepositoryDispatch>
|
|
4471
|
+
) => Promise<void> | void
|
|
4472
|
+
): void;
|
|
4473
|
+
|
|
4420
4474
|
public on(
|
|
4421
4475
|
event:
|
|
4422
4476
|
| "repository"
|
package/lib/webhook-names.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octokit/webhooks",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@gimenete/type-writer": "^0.1.3",
|
|
18
|
-
"@octokit/webhooks-definitions": "1.
|
|
19
|
-
"axios": "^0.
|
|
18
|
+
"@octokit/webhooks-definitions": "1.5.1",
|
|
19
|
+
"axios": "^0.19.0",
|
|
20
20
|
"cheerio": "^1.0.0-rc.2",
|
|
21
21
|
"coveralls": "^3.0.3",
|
|
22
22
|
"get-port": "^5.0.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"pify": "^4.0.0",
|
|
25
25
|
"prettier": "^1.16.1",
|
|
26
26
|
"proxyquire": "^2.0.0",
|
|
27
|
-
"semantic-release": "^15.13.
|
|
27
|
+
"semantic-release": "^15.13.24",
|
|
28
28
|
"simple-mock": "^0.8.0",
|
|
29
|
-
"standard": "^
|
|
29
|
+
"standard": "^14.0.2",
|
|
30
30
|
"table-builder": "^2.1.1",
|
|
31
31
|
"tap": "^14.0.0"
|
|
32
32
|
},
|