@octokit/webhooks 10.6.2 → 10.7.1
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 +1 -0
- package/dist-node/index.js +440 -106
- package/dist-node/index.js.map +6 -1
- package/dist-src/createLogger.js +11 -6
- package/dist-src/event-handler/index.js +23 -16
- package/dist-src/event-handler/on.js +31 -22
- package/dist-src/event-handler/receive.js +51 -49
- package/dist-src/event-handler/remove-listener.js +18 -15
- package/dist-src/event-handler/wrap-error-handler.js +17 -18
- package/dist-src/generated/webhook-names.js +260 -257
- package/dist-src/index.js +40 -32
- package/dist-src/middleware/node/get-missing-headers.js +8 -6
- package/dist-src/middleware/node/get-payload.js +26 -27
- package/dist-src/middleware/node/index.js +19 -10
- package/dist-src/middleware/node/middleware.js +86 -86
- package/dist-src/middleware/node/on-unhandled-request-default.js +12 -7
- package/dist-src/sign.js +8 -2
- package/dist-src/to-normalized-json-string.js +8 -8
- package/dist-src/verify-and-receive.js +22 -16
- package/dist-src/verify.js +9 -2
- package/dist-types/event-handler/on.d.ts +1 -1
- package/dist-types/event-handler/remove-listener.d.ts +1 -1
- package/dist-types/generated/webhook-names.d.ts +1 -1
- package/dist-types/index.d.ts +2 -2
- package/dist-types/middleware/node/get-payload.d.ts +1 -1
- package/dist-types/middleware/node/index.d.ts +2 -2
- package/dist-types/middleware/node/middleware.d.ts +2 -2
- package/dist-types/middleware/node/types.d.ts +1 -1
- package/dist-types/types.d.ts +2 -2
- package/dist-types/verify-and-receive.d.ts +1 -1
- package/dist-web/index.js +606 -569
- package/dist-web/index.js.map +6 -1
- package/package.json +19 -21
- package/dist-src/middleware/node/types.js +0 -1
- package/dist-src/types.js +0 -1
|
@@ -1,258 +1,261 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
1
|
+
const emitterEventNames = [
|
|
2
|
+
"branch_protection_rule",
|
|
3
|
+
"branch_protection_rule.created",
|
|
4
|
+
"branch_protection_rule.deleted",
|
|
5
|
+
"branch_protection_rule.edited",
|
|
6
|
+
"check_run",
|
|
7
|
+
"check_run.completed",
|
|
8
|
+
"check_run.created",
|
|
9
|
+
"check_run.requested_action",
|
|
10
|
+
"check_run.rerequested",
|
|
11
|
+
"check_suite",
|
|
12
|
+
"check_suite.completed",
|
|
13
|
+
"check_suite.requested",
|
|
14
|
+
"check_suite.rerequested",
|
|
15
|
+
"code_scanning_alert",
|
|
16
|
+
"code_scanning_alert.appeared_in_branch",
|
|
17
|
+
"code_scanning_alert.closed_by_user",
|
|
18
|
+
"code_scanning_alert.created",
|
|
19
|
+
"code_scanning_alert.fixed",
|
|
20
|
+
"code_scanning_alert.reopened",
|
|
21
|
+
"code_scanning_alert.reopened_by_user",
|
|
22
|
+
"commit_comment",
|
|
23
|
+
"commit_comment.created",
|
|
24
|
+
"create",
|
|
25
|
+
"delete",
|
|
26
|
+
"dependabot_alert",
|
|
27
|
+
"dependabot_alert.created",
|
|
28
|
+
"dependabot_alert.dismissed",
|
|
29
|
+
"dependabot_alert.fixed",
|
|
30
|
+
"dependabot_alert.reintroduced",
|
|
31
|
+
"dependabot_alert.reopened",
|
|
32
|
+
"deploy_key",
|
|
33
|
+
"deploy_key.created",
|
|
34
|
+
"deploy_key.deleted",
|
|
35
|
+
"deployment",
|
|
36
|
+
"deployment.created",
|
|
37
|
+
"deployment_status",
|
|
38
|
+
"deployment_status.created",
|
|
39
|
+
"discussion",
|
|
40
|
+
"discussion.answered",
|
|
41
|
+
"discussion.category_changed",
|
|
42
|
+
"discussion.created",
|
|
43
|
+
"discussion.deleted",
|
|
44
|
+
"discussion.edited",
|
|
45
|
+
"discussion.labeled",
|
|
46
|
+
"discussion.locked",
|
|
47
|
+
"discussion.pinned",
|
|
48
|
+
"discussion.transferred",
|
|
49
|
+
"discussion.unanswered",
|
|
50
|
+
"discussion.unlabeled",
|
|
51
|
+
"discussion.unlocked",
|
|
52
|
+
"discussion.unpinned",
|
|
53
|
+
"discussion_comment",
|
|
54
|
+
"discussion_comment.created",
|
|
55
|
+
"discussion_comment.deleted",
|
|
56
|
+
"discussion_comment.edited",
|
|
57
|
+
"fork",
|
|
58
|
+
"github_app_authorization",
|
|
59
|
+
"github_app_authorization.revoked",
|
|
60
|
+
"gollum",
|
|
61
|
+
"installation",
|
|
62
|
+
"installation.created",
|
|
63
|
+
"installation.deleted",
|
|
64
|
+
"installation.new_permissions_accepted",
|
|
65
|
+
"installation.suspend",
|
|
66
|
+
"installation.unsuspend",
|
|
67
|
+
"installation_repositories",
|
|
68
|
+
"installation_repositories.added",
|
|
69
|
+
"installation_repositories.removed",
|
|
70
|
+
"installation_target",
|
|
71
|
+
"installation_target.renamed",
|
|
72
|
+
"issue_comment",
|
|
73
|
+
"issue_comment.created",
|
|
74
|
+
"issue_comment.deleted",
|
|
75
|
+
"issue_comment.edited",
|
|
76
|
+
"issues",
|
|
77
|
+
"issues.assigned",
|
|
78
|
+
"issues.closed",
|
|
79
|
+
"issues.deleted",
|
|
80
|
+
"issues.demilestoned",
|
|
81
|
+
"issues.edited",
|
|
82
|
+
"issues.labeled",
|
|
83
|
+
"issues.locked",
|
|
84
|
+
"issues.milestoned",
|
|
85
|
+
"issues.opened",
|
|
86
|
+
"issues.pinned",
|
|
87
|
+
"issues.reopened",
|
|
88
|
+
"issues.transferred",
|
|
89
|
+
"issues.unassigned",
|
|
90
|
+
"issues.unlabeled",
|
|
91
|
+
"issues.unlocked",
|
|
92
|
+
"issues.unpinned",
|
|
93
|
+
"label",
|
|
94
|
+
"label.created",
|
|
95
|
+
"label.deleted",
|
|
96
|
+
"label.edited",
|
|
97
|
+
"marketplace_purchase",
|
|
98
|
+
"marketplace_purchase.cancelled",
|
|
99
|
+
"marketplace_purchase.changed",
|
|
100
|
+
"marketplace_purchase.pending_change",
|
|
101
|
+
"marketplace_purchase.pending_change_cancelled",
|
|
102
|
+
"marketplace_purchase.purchased",
|
|
103
|
+
"member",
|
|
104
|
+
"member.added",
|
|
105
|
+
"member.edited",
|
|
106
|
+
"member.removed",
|
|
107
|
+
"membership",
|
|
108
|
+
"membership.added",
|
|
109
|
+
"membership.removed",
|
|
110
|
+
"merge_group",
|
|
111
|
+
"merge_group.checks_requested",
|
|
112
|
+
"meta",
|
|
113
|
+
"meta.deleted",
|
|
114
|
+
"milestone",
|
|
115
|
+
"milestone.closed",
|
|
116
|
+
"milestone.created",
|
|
117
|
+
"milestone.deleted",
|
|
118
|
+
"milestone.edited",
|
|
119
|
+
"milestone.opened",
|
|
120
|
+
"org_block",
|
|
121
|
+
"org_block.blocked",
|
|
122
|
+
"org_block.unblocked",
|
|
123
|
+
"organization",
|
|
124
|
+
"organization.deleted",
|
|
125
|
+
"organization.member_added",
|
|
126
|
+
"organization.member_invited",
|
|
127
|
+
"organization.member_removed",
|
|
128
|
+
"organization.renamed",
|
|
129
|
+
"package",
|
|
130
|
+
"package.published",
|
|
131
|
+
"package.updated",
|
|
132
|
+
"page_build",
|
|
133
|
+
"ping",
|
|
134
|
+
"project",
|
|
135
|
+
"project.closed",
|
|
136
|
+
"project.created",
|
|
137
|
+
"project.deleted",
|
|
138
|
+
"project.edited",
|
|
139
|
+
"project.reopened",
|
|
140
|
+
"project_card",
|
|
141
|
+
"project_card.converted",
|
|
142
|
+
"project_card.created",
|
|
143
|
+
"project_card.deleted",
|
|
144
|
+
"project_card.edited",
|
|
145
|
+
"project_card.moved",
|
|
146
|
+
"project_column",
|
|
147
|
+
"project_column.created",
|
|
148
|
+
"project_column.deleted",
|
|
149
|
+
"project_column.edited",
|
|
150
|
+
"project_column.moved",
|
|
151
|
+
"projects_v2_item",
|
|
152
|
+
"projects_v2_item.archived",
|
|
153
|
+
"projects_v2_item.converted",
|
|
154
|
+
"projects_v2_item.created",
|
|
155
|
+
"projects_v2_item.deleted",
|
|
156
|
+
"projects_v2_item.edited",
|
|
157
|
+
"projects_v2_item.reordered",
|
|
158
|
+
"projects_v2_item.restored",
|
|
159
|
+
"public",
|
|
160
|
+
"pull_request",
|
|
161
|
+
"pull_request.assigned",
|
|
162
|
+
"pull_request.auto_merge_disabled",
|
|
163
|
+
"pull_request.auto_merge_enabled",
|
|
164
|
+
"pull_request.closed",
|
|
165
|
+
"pull_request.converted_to_draft",
|
|
166
|
+
"pull_request.dequeued",
|
|
167
|
+
"pull_request.edited",
|
|
168
|
+
"pull_request.labeled",
|
|
169
|
+
"pull_request.locked",
|
|
170
|
+
"pull_request.opened",
|
|
171
|
+
"pull_request.queued",
|
|
172
|
+
"pull_request.ready_for_review",
|
|
173
|
+
"pull_request.reopened",
|
|
174
|
+
"pull_request.review_request_removed",
|
|
175
|
+
"pull_request.review_requested",
|
|
176
|
+
"pull_request.synchronize",
|
|
177
|
+
"pull_request.unassigned",
|
|
178
|
+
"pull_request.unlabeled",
|
|
179
|
+
"pull_request.unlocked",
|
|
180
|
+
"pull_request_review",
|
|
181
|
+
"pull_request_review.dismissed",
|
|
182
|
+
"pull_request_review.edited",
|
|
183
|
+
"pull_request_review.submitted",
|
|
184
|
+
"pull_request_review_comment",
|
|
185
|
+
"pull_request_review_comment.created",
|
|
186
|
+
"pull_request_review_comment.deleted",
|
|
187
|
+
"pull_request_review_comment.edited",
|
|
188
|
+
"pull_request_review_thread",
|
|
189
|
+
"pull_request_review_thread.resolved",
|
|
190
|
+
"pull_request_review_thread.unresolved",
|
|
191
|
+
"push",
|
|
192
|
+
"registry_package",
|
|
193
|
+
"registry_package.published",
|
|
194
|
+
"registry_package.updated",
|
|
195
|
+
"release",
|
|
196
|
+
"release.created",
|
|
197
|
+
"release.deleted",
|
|
198
|
+
"release.edited",
|
|
199
|
+
"release.prereleased",
|
|
200
|
+
"release.published",
|
|
201
|
+
"release.released",
|
|
202
|
+
"release.unpublished",
|
|
203
|
+
"repository",
|
|
204
|
+
"repository.archived",
|
|
205
|
+
"repository.created",
|
|
206
|
+
"repository.deleted",
|
|
207
|
+
"repository.edited",
|
|
208
|
+
"repository.privatized",
|
|
209
|
+
"repository.publicized",
|
|
210
|
+
"repository.renamed",
|
|
211
|
+
"repository.transferred",
|
|
212
|
+
"repository.unarchived",
|
|
213
|
+
"repository_dispatch",
|
|
214
|
+
"repository_import",
|
|
215
|
+
"repository_vulnerability_alert",
|
|
216
|
+
"repository_vulnerability_alert.create",
|
|
217
|
+
"repository_vulnerability_alert.dismiss",
|
|
218
|
+
"repository_vulnerability_alert.reopen",
|
|
219
|
+
"repository_vulnerability_alert.resolve",
|
|
220
|
+
"secret_scanning_alert",
|
|
221
|
+
"secret_scanning_alert.created",
|
|
222
|
+
"secret_scanning_alert.reopened",
|
|
223
|
+
"secret_scanning_alert.resolved",
|
|
224
|
+
"security_advisory",
|
|
225
|
+
"security_advisory.performed",
|
|
226
|
+
"security_advisory.published",
|
|
227
|
+
"security_advisory.updated",
|
|
228
|
+
"security_advisory.withdrawn",
|
|
229
|
+
"sponsorship",
|
|
230
|
+
"sponsorship.cancelled",
|
|
231
|
+
"sponsorship.created",
|
|
232
|
+
"sponsorship.edited",
|
|
233
|
+
"sponsorship.pending_cancellation",
|
|
234
|
+
"sponsorship.pending_tier_change",
|
|
235
|
+
"sponsorship.tier_changed",
|
|
236
|
+
"star",
|
|
237
|
+
"star.created",
|
|
238
|
+
"star.deleted",
|
|
239
|
+
"status",
|
|
240
|
+
"team",
|
|
241
|
+
"team.added_to_repository",
|
|
242
|
+
"team.created",
|
|
243
|
+
"team.deleted",
|
|
244
|
+
"team.edited",
|
|
245
|
+
"team.removed_from_repository",
|
|
246
|
+
"team_add",
|
|
247
|
+
"watch",
|
|
248
|
+
"watch.started",
|
|
249
|
+
"workflow_dispatch",
|
|
250
|
+
"workflow_job",
|
|
251
|
+
"workflow_job.completed",
|
|
252
|
+
"workflow_job.in_progress",
|
|
253
|
+
"workflow_job.queued",
|
|
254
|
+
"workflow_run",
|
|
255
|
+
"workflow_run.completed",
|
|
256
|
+
"workflow_run.in_progress",
|
|
257
|
+
"workflow_run.requested"
|
|
258
258
|
];
|
|
259
|
+
export {
|
|
260
|
+
emitterEventNames
|
|
261
|
+
};
|
package/dist-src/index.js
CHANGED
|
@@ -3,38 +3,46 @@ import { createEventHandler } from "./event-handler/index";
|
|
|
3
3
|
import { sign } from "./sign";
|
|
4
4
|
import { verify } from "./verify";
|
|
5
5
|
import { verifyAndReceive } from "./verify-and-receive";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// U holds the return value of `transform` function in Options
|
|
6
|
+
import { createNodeMiddleware } from "./middleware/node/index";
|
|
7
|
+
import { emitterEventNames } from "./generated/webhook-names";
|
|
9
8
|
class Webhooks {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
const state = {
|
|
15
|
-
eventHandler: createEventHandler(options),
|
|
16
|
-
secret: options.secret,
|
|
17
|
-
hooks: {},
|
|
18
|
-
log: createLogger(options.log),
|
|
19
|
-
};
|
|
20
|
-
this.sign = sign.bind(null, options.secret);
|
|
21
|
-
this.verify = (eventPayload, signature) => {
|
|
22
|
-
if (typeof eventPayload === "object") {
|
|
23
|
-
console.warn("[@octokit/webhooks] Passing a JSON payload object to `verify()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`");
|
|
24
|
-
}
|
|
25
|
-
return verify(options.secret, eventPayload, signature);
|
|
26
|
-
};
|
|
27
|
-
this.on = state.eventHandler.on;
|
|
28
|
-
this.onAny = state.eventHandler.onAny;
|
|
29
|
-
this.onError = state.eventHandler.onError;
|
|
30
|
-
this.removeListener = state.eventHandler.removeListener;
|
|
31
|
-
this.receive = state.eventHandler.receive;
|
|
32
|
-
this.verifyAndReceive = (options) => {
|
|
33
|
-
if (typeof options.payload === "object") {
|
|
34
|
-
console.warn("[@octokit/webhooks] Passing a JSON payload object to `verifyAndReceive()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`");
|
|
35
|
-
}
|
|
36
|
-
return verifyAndReceive(state, options);
|
|
37
|
-
};
|
|
9
|
+
constructor(options) {
|
|
10
|
+
if (!options || !options.secret) {
|
|
11
|
+
throw new Error("[@octokit/webhooks] options.secret required");
|
|
38
12
|
}
|
|
13
|
+
const state = {
|
|
14
|
+
eventHandler: createEventHandler(options),
|
|
15
|
+
secret: options.secret,
|
|
16
|
+
hooks: {},
|
|
17
|
+
log: createLogger(options.log)
|
|
18
|
+
};
|
|
19
|
+
this.sign = sign.bind(null, options.secret);
|
|
20
|
+
this.verify = (eventPayload, signature) => {
|
|
21
|
+
if (typeof eventPayload === "object") {
|
|
22
|
+
console.warn(
|
|
23
|
+
"[@octokit/webhooks] Passing a JSON payload object to `verify()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`"
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return verify(options.secret, eventPayload, signature);
|
|
27
|
+
};
|
|
28
|
+
this.on = state.eventHandler.on;
|
|
29
|
+
this.onAny = state.eventHandler.onAny;
|
|
30
|
+
this.onError = state.eventHandler.onError;
|
|
31
|
+
this.removeListener = state.eventHandler.removeListener;
|
|
32
|
+
this.receive = state.eventHandler.receive;
|
|
33
|
+
this.verifyAndReceive = (options2) => {
|
|
34
|
+
if (typeof options2.payload === "object") {
|
|
35
|
+
console.warn(
|
|
36
|
+
"[@octokit/webhooks] Passing a JSON payload object to `verifyAndReceive()` is deprecated and the functionality will be removed in a future release of `@octokit/webhooks`"
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return verifyAndReceive(state, options2);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
|
-
export {
|
|
43
|
+
export {
|
|
44
|
+
Webhooks,
|
|
45
|
+
createEventHandler,
|
|
46
|
+
createNodeMiddleware,
|
|
47
|
+
emitterEventNames
|
|
48
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const WEBHOOK_HEADERS = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
"x-github-event",
|
|
3
|
+
"x-hub-signature-256",
|
|
4
|
+
"x-github-delivery"
|
|
5
5
|
];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return WEBHOOK_HEADERS.filter((header) => !(header in request.headers));
|
|
6
|
+
function getMissingHeaders(request) {
|
|
7
|
+
return WEBHOOK_HEADERS.filter((header) => !(header in request.headers));
|
|
9
8
|
}
|
|
9
|
+
export {
|
|
10
|
+
getMissingHeaders
|
|
11
|
+
};
|