@automate.ax/integration-contracts 0.88.2 → 0.88.3

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.
Files changed (35) hide show
  1. package/dist/github/additional-events.d.ts +219 -16710
  2. package/dist/github/additional-events.js +67 -98
  3. package/dist/github/index.d.ts +97 -2
  4. package/dist/github/index.js +382 -5
  5. package/dist/github/openapi-types.d.ts +21 -0
  6. package/dist/github/openapi-types.generated.d.ts +52350 -0
  7. package/dist/github/openapi-types.generated.js +1 -0
  8. package/dist/github/openapi-types.js +1 -0
  9. package/dist/github/resources.d.ts +7435 -17936
  10. package/dist/github/resources.js +40 -135
  11. package/dist/github/rest-schemas.d.ts +11 -0
  12. package/dist/github/rest-schemas.generated.json +1 -0
  13. package/dist/github/rest-schemas.js +24 -0
  14. package/dist/github/schemas.d.ts +4554 -7321
  15. package/dist/github/schemas.js +68 -77
  16. package/dist/github/webhook-operations.d.ts +52 -0
  17. package/dist/github/webhook-operations.js +134 -0
  18. package/dist/github/webhook-schemas.d.ts +12 -0
  19. package/dist/github/webhook-schemas.generated.json +1 -0
  20. package/dist/github/webhook-schemas.js +28 -0
  21. package/dist/linear/schemas.d.ts +1 -1
  22. package/dist/vercel/index.d.ts +12 -12
  23. package/dist/vercel/schemas.d.ts +18 -18
  24. package/package.json +6 -3
  25. package/src/github/additional-events.ts +631 -273
  26. package/src/github/index.ts +761 -8
  27. package/src/github/openapi-types.generated.ts +52352 -0
  28. package/src/github/openapi-types.ts +59 -0
  29. package/src/github/resources.ts +106 -303
  30. package/src/github/rest-schemas.generated.json +1 -0
  31. package/src/github/rest-schemas.ts +35 -0
  32. package/src/github/schemas.ts +593 -195
  33. package/src/github/webhook-operations.ts +171 -0
  34. package/src/github/webhook-schemas.generated.json +1 -0
  35. package/src/github/webhook-schemas.ts +43 -0
@@ -1,19 +1,122 @@
1
- import type { Encodable } from "@automate.ax/codec"
2
- import type { webhooks } from "@octokit/openapi-webhooks-types"
3
1
  import * as z from "zod"
2
+ import type {
3
+ GitHubWebhookOperation,
4
+ GitHubWebhookPayload,
5
+ } from "./openapi-types"
6
+ import {
7
+ githubWebhookEventSchema,
8
+ type GitHubWebhookSchema,
9
+ } from "./webhook-schemas"
4
10
 
5
- type GitHubWebhookPayload<TKey extends keyof webhooks> =
6
- webhooks[TKey]["post"] extends {
7
- requestBody: {
8
- content: { "application/json": infer TPayload }
9
- }
10
- }
11
- ? TPayload & Record<string, Encodable>
12
- : never
11
+ /** Official GitHub commit-comment webhook payload union. */
12
+ export type GitHubCommitCommentEvent =
13
+ GitHubWebhookPayload<"commit-comment-created">
14
+ export type GitHubCommitCommentCreatedEvent = GitHubCommitCommentEvent
15
+
16
+ /** Official GitHub issue-dependencies webhook payload union. */
17
+ export type GitHubIssueDependenciesEvent = GitHubWebhookPayload<
18
+ | "issue-dependencies-blocked-by-added"
19
+ | "issue-dependencies-blocked-by-removed"
20
+ | "issue-dependencies-blocking-added"
21
+ | "issue-dependencies-blocking-removed"
22
+ >
23
+ export type GitHubIssueDependencyBlockedByAddedEvent =
24
+ GitHubWebhookPayload<"issue-dependencies-blocked-by-added">
25
+ export type GitHubIssueDependencyBlockedByRemovedEvent =
26
+ GitHubWebhookPayload<"issue-dependencies-blocked-by-removed">
27
+ export type GitHubIssueDependencyBlockingAddedEvent =
28
+ GitHubWebhookPayload<"issue-dependencies-blocking-added">
29
+ export type GitHubIssueDependencyBlockingRemovedEvent =
30
+ GitHubWebhookPayload<"issue-dependencies-blocking-removed">
31
+
32
+ /** Official GitHub sub-issues webhook payload union. */
33
+ export type GitHubSubIssuesEvent = GitHubWebhookPayload<
34
+ | "sub-issues-parent-issue-added"
35
+ | "sub-issues-parent-issue-removed"
36
+ | "sub-issues-sub-issue-added"
37
+ | "sub-issues-sub-issue-removed"
38
+ >
39
+ export type GitHubParentIssueAddedEvent =
40
+ GitHubWebhookPayload<"sub-issues-parent-issue-added">
41
+ export type GitHubParentIssueRemovedEvent =
42
+ GitHubWebhookPayload<"sub-issues-parent-issue-removed">
43
+ export type GitHubSubIssueAddedEvent =
44
+ GitHubWebhookPayload<"sub-issues-sub-issue-added">
45
+ export type GitHubSubIssueRemovedEvent =
46
+ GitHubWebhookPayload<"sub-issues-sub-issue-removed">
47
+
48
+ /** Official GitHub pull-request review-thread webhook payload union. */
49
+ export type GitHubPullRequestReviewThreadEvent = GitHubWebhookPayload<
50
+ | "pull-request-review-thread-resolved"
51
+ | "pull-request-review-thread-unresolved"
52
+ >
53
+ export type GitHubPullRequestReviewThreadResolvedEvent =
54
+ GitHubWebhookPayload<"pull-request-review-thread-resolved">
55
+ export type GitHubPullRequestReviewThreadUnresolvedEvent =
56
+ GitHubWebhookPayload<"pull-request-review-thread-unresolved">
57
+
58
+ /** Official GitHub deployment-review webhook payload union. */
59
+ export type GitHubDeploymentReviewEvent = GitHubWebhookPayload<
60
+ | "deployment-review-approved"
61
+ | "deployment-review-rejected"
62
+ | "deployment-review-requested"
63
+ >
64
+ export type GitHubDeploymentReviewApprovedEvent =
65
+ GitHubWebhookPayload<"deployment-review-approved">
66
+ export type GitHubDeploymentReviewRejectedEvent =
67
+ GitHubWebhookPayload<"deployment-review-rejected">
68
+ export type GitHubDeploymentReviewRequestedEvent =
69
+ GitHubWebhookPayload<"deployment-review-requested">
70
+
71
+ /** Official GitHub deployment-protection-rule webhook payload union. */
72
+ export type GitHubDeploymentProtectionRuleEvent =
73
+ GitHubWebhookPayload<"deployment-protection-rule-requested">
74
+ export type GitHubDeploymentProtectionRuleRequestedEvent =
75
+ GitHubDeploymentProtectionRuleEvent
76
+
77
+ /** Official GitHub merge-group webhook payload union. */
78
+ export type GitHubMergeGroupEvent = GitHubWebhookPayload<
79
+ "merge-group-checks-requested" | "merge-group-destroyed"
80
+ >
81
+ export type GitHubMergeGroupChecksRequestedEvent =
82
+ GitHubWebhookPayload<"merge-group-checks-requested">
83
+ export type GitHubMergeGroupDestroyedEvent =
84
+ GitHubWebhookPayload<"merge-group-destroyed">
85
+
86
+ /** Official GitHub repository webhook payload union. */
87
+ export type GitHubRepositoryEvent = GitHubWebhookPayload<
88
+ | "repository-archived"
89
+ | "repository-created"
90
+ | "repository-deleted"
91
+ | "repository-edited"
92
+ | "repository-privatized"
93
+ | "repository-publicized"
94
+ | "repository-renamed"
95
+ | "repository-transferred"
96
+ | "repository-unarchived"
97
+ >
98
+ export type GitHubRepositoryArchivedEvent =
99
+ GitHubWebhookPayload<"repository-archived">
100
+ export type GitHubRepositoryCreatedEvent =
101
+ GitHubWebhookPayload<"repository-created">
102
+ export type GitHubRepositoryDeletedEvent =
103
+ GitHubWebhookPayload<"repository-deleted">
104
+ export type GitHubRepositoryEditedEvent =
105
+ GitHubWebhookPayload<"repository-edited">
106
+ export type GitHubRepositoryPrivatizedEvent =
107
+ GitHubWebhookPayload<"repository-privatized">
108
+ export type GitHubRepositoryPublicizedEvent =
109
+ GitHubWebhookPayload<"repository-publicized">
110
+ export type GitHubRepositoryRenamedEvent =
111
+ GitHubWebhookPayload<"repository-renamed">
112
+ export type GitHubRepositoryTransferredEvent =
113
+ GitHubWebhookPayload<"repository-transferred">
114
+ export type GitHubRepositoryUnarchivedEvent =
115
+ GitHubWebhookPayload<"repository-unarchived">
13
116
 
14
117
  /** Official GitHub check-run webhook payload union. */
15
118
  export type GitHubCheckRunEvent = GitHubWebhookPayload<
16
- Extract<keyof webhooks, `check-run-${string}`>
119
+ Extract<GitHubWebhookOperation, `check-run-${string}`>
17
120
  >
18
121
  export type GitHubCheckRunCreatedEvent =
19
122
  GitHubWebhookPayload<"check-run-created">
@@ -53,10 +156,35 @@ export type GitHubCheckRunActionRequiredEvent = GitHubCheckRunCompletedEvent & {
53
156
  conclusion: "action_required"
54
157
  }
55
158
  }
159
+ export type GitHubCheckRunNeutralEvent = GitHubCheckRunCompletedEvent & {
160
+ check_run: GitHubCheckRunCompletedEvent["check_run"] & {
161
+ conclusion: "neutral"
162
+ }
163
+ }
164
+ export type GitHubCheckRunPendingEvent = GitHubCheckRunCompletedEvent & {
165
+ check_run: GitHubCheckRunCompletedEvent["check_run"] & {
166
+ conclusion: "pending"
167
+ }
168
+ }
169
+ export type GitHubCheckRunSkippedEvent = GitHubCheckRunCompletedEvent & {
170
+ check_run: GitHubCheckRunCompletedEvent["check_run"] & {
171
+ conclusion: "skipped"
172
+ }
173
+ }
174
+ export type GitHubCheckRunStaleEvent = GitHubCheckRunCompletedEvent & {
175
+ check_run: GitHubCheckRunCompletedEvent["check_run"] & {
176
+ conclusion: "stale"
177
+ }
178
+ }
179
+ export type GitHubCheckRunWaitingEvent = GitHubCheckRunCompletedEvent & {
180
+ check_run: GitHubCheckRunCompletedEvent["check_run"] & {
181
+ conclusion: "waiting"
182
+ }
183
+ }
56
184
 
57
185
  /** Official GitHub check-suite webhook payload union. */
58
186
  export type GitHubCheckSuiteEvent = GitHubWebhookPayload<
59
- Extract<keyof webhooks, `check-suite-${string}`>
187
+ Extract<GitHubWebhookOperation, `check-suite-${string}`>
60
188
  >
61
189
  export type GitHubCheckSuiteCompletedEvent =
62
190
  GitHubWebhookPayload<"check-suite-completed">
@@ -96,6 +224,21 @@ export type GitHubCheckSuiteActionRequiredEvent =
96
224
  conclusion: "action_required"
97
225
  }
98
226
  }
227
+ export type GitHubCheckSuiteNeutralEvent = GitHubCheckSuiteCompletedEvent & {
228
+ check_suite: GitHubCheckSuiteCompletedEvent["check_suite"] & {
229
+ conclusion: "neutral"
230
+ }
231
+ }
232
+ export type GitHubCheckSuiteSkippedEvent = GitHubCheckSuiteCompletedEvent & {
233
+ check_suite: GitHubCheckSuiteCompletedEvent["check_suite"] & {
234
+ conclusion: "skipped"
235
+ }
236
+ }
237
+ export type GitHubCheckSuiteStaleEvent = GitHubCheckSuiteCompletedEvent & {
238
+ check_suite: GitHubCheckSuiteCompletedEvent["check_suite"] & {
239
+ conclusion: "stale"
240
+ }
241
+ }
99
242
 
100
243
  /** GitHub branch-or-tag creation webhook payload. */
101
244
  export type GitHubRefCreatedEvent = GitHubWebhookPayload<"create">
@@ -111,10 +254,21 @@ export type GitHubBranchDeletedEvent = GitHubRefDeletedEvent & {
111
254
  }
112
255
  export type GitHubTagDeletedEvent = GitHubRefDeletedEvent & { ref_type: "tag" }
113
256
 
257
+ /** GitHub issue-comment-pinned webhook payload. */
258
+ export type GitHubIssueCommentPinnedEvent =
259
+ GitHubWebhookPayload<"issue-comment-pinned">
260
+
261
+ /** GitHub issue-comment-unpinned webhook payload. */
262
+ export type GitHubIssueCommentUnpinnedEvent =
263
+ GitHubWebhookPayload<"issue-comment-unpinned">
264
+
114
265
  /** Official GitHub issue-comment webhook payload union. */
115
- export type GitHubIssueCommentEvent = GitHubWebhookPayload<
116
- Extract<keyof webhooks, `issue-comment-${string}`>
117
- >
266
+ export type GitHubIssueCommentEvent =
267
+ | GitHubWebhookPayload<"issue-comment-created">
268
+ | GitHubWebhookPayload<"issue-comment-edited">
269
+ | GitHubWebhookPayload<"issue-comment-deleted">
270
+ | GitHubWebhookPayload<"issue-comment-pinned">
271
+ | GitHubWebhookPayload<"issue-comment-unpinned">
118
272
  export type GitHubIssueCommentCreatedEvent =
119
273
  GitHubWebhookPayload<"issue-comment-created">
120
274
  export type GitHubIssueCommentEditedEvent =
@@ -124,7 +278,7 @@ export type GitHubIssueCommentDeletedEvent =
124
278
 
125
279
  /** Official GitHub pull-request review-comment webhook payload union. */
126
280
  export type GitHubPullRequestReviewCommentEvent = GitHubWebhookPayload<
127
- Extract<keyof webhooks, `pull-request-review-comment-${string}`>
281
+ Extract<GitHubWebhookOperation, `pull-request-review-comment-${string}`>
128
282
  >
129
283
  export type GitHubPullRequestReviewCommentCreatedEvent =
130
284
  GitHubWebhookPayload<"pull-request-review-comment-created">
@@ -135,7 +289,7 @@ export type GitHubPullRequestReviewCommentDeletedEvent =
135
289
 
136
290
  /** Official GitHub workflow-job webhook payload union. */
137
291
  export type GitHubWorkflowJobEvent = GitHubWebhookPayload<
138
- Extract<keyof webhooks, `workflow-job-${string}`>
292
+ Extract<GitHubWebhookOperation, `workflow-job-${string}`>
139
293
  >
140
294
  export type GitHubWorkflowJobQueuedEvent =
141
295
  GitHubWebhookPayload<"workflow-job-queued">
@@ -167,6 +321,22 @@ export type GitHubWorkflowJobTimedOutEvent = GitHubWorkflowJobCompletedEvent & {
167
321
  conclusion: "timed_out"
168
322
  }
169
323
  }
324
+ export type GitHubWorkflowJobActionRequiredEvent =
325
+ GitHubWorkflowJobCompletedEvent & {
326
+ workflow_job: GitHubWorkflowJobCompletedEvent["workflow_job"] & {
327
+ conclusion: "action_required"
328
+ }
329
+ }
330
+ export type GitHubWorkflowJobNeutralEvent = GitHubWorkflowJobCompletedEvent & {
331
+ workflow_job: GitHubWorkflowJobCompletedEvent["workflow_job"] & {
332
+ conclusion: "neutral"
333
+ }
334
+ }
335
+ export type GitHubWorkflowJobSkippedEvent = GitHubWorkflowJobCompletedEvent & {
336
+ workflow_job: GitHubWorkflowJobCompletedEvent["workflow_job"] & {
337
+ conclusion: "skipped"
338
+ }
339
+ }
170
340
 
171
341
  /** GitHub repository-dispatch webhook payload. */
172
342
  export type GitHubRepositoryDispatchEvent =
@@ -181,7 +351,17 @@ export type GitHubDeploymentEvent = GitHubWebhookPayload<"deployment-created">
181
351
 
182
352
  /** GitHub deployment-status webhook payload. */
183
353
  export type GitHubDeploymentStatusEvent =
184
- GitHubWebhookPayload<"deployment-status-created">
354
+ GitHubWebhookPayload<"deployment-status-created"> & {
355
+ deployment_status: GitHubWebhookPayload<"deployment-status-created">["deployment_status"] & {
356
+ state:
357
+ | "error"
358
+ | "failure"
359
+ | "in_progress"
360
+ | "pending"
361
+ | "queued"
362
+ | "success"
363
+ }
364
+ }
185
365
  export type GitHubDeploymentQueuedEvent = GitHubDeploymentStatusEvent & {
186
366
  deployment_status: GitHubDeploymentStatusEvent["deployment_status"] & {
187
367
  state: "queued"
@@ -197,11 +377,6 @@ export type GitHubDeploymentPendingEvent = GitHubDeploymentStatusEvent & {
197
377
  state: "pending"
198
378
  }
199
379
  }
200
- export type GitHubDeploymentInactiveEvent = GitHubDeploymentStatusEvent & {
201
- deployment_status: GitHubDeploymentStatusEvent["deployment_status"] & {
202
- state: "inactive"
203
- }
204
- }
205
380
  export type GitHubDeploymentSucceededEvent = GitHubDeploymentStatusEvent & {
206
381
  deployment_status: GitHubDeploymentStatusEvent["deployment_status"] & {
207
382
  state: "success"
@@ -227,104 +402,209 @@ export type GitHubStatusSucceededEvent = GitHubStatusEvent & {
227
402
  export type GitHubStatusFailedEvent = GitHubStatusEvent & { state: "failure" }
228
403
  export type GitHubStatusErroredEvent = GitHubStatusEvent & { state: "error" }
229
404
 
230
- const GITHUB_EVENT_BASE_SCHEMA = z.looseObject({
231
- installation: z.looseObject({ id: z.number().int().positive() }),
232
- repository: z.looseObject({
233
- full_name: z.string(),
234
- id: z.number().int().positive(),
235
- }),
236
- sender: z.looseObject({ id: z.number().int().positive(), login: z.string() }),
237
- })
238
- const GITHUB_CHECK_RUN_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
239
- action: z.string(),
240
- check_run: z.looseObject({
241
- conclusion: z.string().nullable(),
242
- id: z.number().int().positive(),
243
- status: z.string(),
244
- }),
245
- })
246
- const GITHUB_CHECK_SUITE_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
247
- action: z.string(),
248
- check_suite: z.looseObject({
249
- conclusion: z.string().nullable(),
250
- id: z.number().int().positive(),
251
- status: z.string(),
252
- }),
253
- })
254
- const GITHUB_REF_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
255
- ref: z.string(),
256
- ref_type: z.enum(["branch", "tag"]),
257
- })
258
- const GITHUB_ISSUE_COMMENT_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
259
- action: z.string(),
260
- comment: z.looseObject({ id: z.number().int().positive() }),
261
- issue: z.looseObject({ id: z.number(), number: z.number().int() }),
262
- })
263
- const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_BASE_SCHEMA =
264
- GITHUB_EVENT_BASE_SCHEMA.extend({
265
- action: z.string(),
266
- comment: z.looseObject({ id: z.number().int().positive() }),
267
- pull_request: z.looseObject({
268
- id: z.number(),
269
- number: z.number().int(),
270
- }),
271
- })
272
- const GITHUB_WORKFLOW_JOB_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
273
- action: z.string(),
274
- workflow_job: z.looseObject({
275
- conclusion: z.string().nullable(),
276
- id: z.number().int().positive(),
277
- status: z.string(),
278
- }),
279
- })
280
- const GITHUB_REPOSITORY_DISPATCH_EVENT_BASE_SCHEMA =
281
- GITHUB_EVENT_BASE_SCHEMA.extend({
282
- action: z.string(),
283
- branch: z.string(),
284
- client_payload: z.record(z.string(), z.json()).nullable(),
285
- })
286
- const GITHUB_WORKFLOW_DISPATCH_EVENT_BASE_SCHEMA =
287
- GITHUB_EVENT_BASE_SCHEMA.extend({
288
- inputs: z.record(z.string(), z.json()).nullable(),
289
- ref: z.string(),
290
- workflow: z.string(),
291
- })
292
- const GITHUB_DEPLOYMENT_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
293
- action: z.literal("created"),
294
- deployment: z.looseObject({ id: z.number().int().positive() }),
295
- })
296
- const GITHUB_DEPLOYMENT_STATUS_EVENT_BASE_SCHEMA =
297
- GITHUB_EVENT_BASE_SCHEMA.extend({
298
- action: z.literal("created"),
299
- deployment: z.looseObject({ id: z.number().int().positive() }),
300
- deployment_status: z.looseObject({
301
- id: z.number().int().positive(),
302
- state: z.string(),
303
- }),
304
- })
305
- const GITHUB_STATUS_EVENT_BASE_SCHEMA = GITHUB_EVENT_BASE_SCHEMA.extend({
306
- context: z.string(),
307
- sha: z.string(),
308
- state: z.string(),
309
- })
310
-
311
- export const GITHUB_CHECK_RUN_EVENT_SCHEMA =
312
- githubEventSchema<GitHubCheckRunEvent>(GITHUB_CHECK_RUN_EVENT_BASE_SCHEMA)
313
- export const GITHUB_CHECK_RUN_CREATED_EVENT_SCHEMA = githubSemanticEventSchema<
314
- GitHubCheckRunEvent,
315
- GitHubCheckRunCreatedEvent
316
- >(GITHUB_CHECK_RUN_EVENT_SCHEMA, (event) => event.action === "created")
317
- export const GITHUB_CHECK_RUN_COMPLETED_EVENT_SCHEMA =
405
+ export const GITHUB_COMMIT_COMMENT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCommitCommentEvent> =
406
+ githubWebhookEventSchema<GitHubCommitCommentEvent>("commit_comment")
407
+ export const GITHUB_COMMIT_COMMENT_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCommitCommentCreatedEvent> =
408
+ GITHUB_COMMIT_COMMENT_EVENT_SCHEMA
409
+
410
+ export const GITHUB_ISSUE_DEPENDENCIES_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueDependenciesEvent> =
411
+ githubWebhookEventSchema<GitHubIssueDependenciesEvent>("issue_dependencies")
412
+ export const GITHUB_ISSUE_DEPENDENCY_BLOCKED_BY_ADDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueDependencyBlockedByAddedEvent> =
413
+ githubSemanticEventSchema<
414
+ GitHubIssueDependenciesEvent,
415
+ GitHubIssueDependencyBlockedByAddedEvent
416
+ >(
417
+ GITHUB_ISSUE_DEPENDENCIES_EVENT_SCHEMA,
418
+ (event) => event.action === "blocked_by_added",
419
+ )
420
+ export const GITHUB_ISSUE_DEPENDENCY_BLOCKED_BY_REMOVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueDependencyBlockedByRemovedEvent> =
421
+ githubSemanticEventSchema<
422
+ GitHubIssueDependenciesEvent,
423
+ GitHubIssueDependencyBlockedByRemovedEvent
424
+ >(
425
+ GITHUB_ISSUE_DEPENDENCIES_EVENT_SCHEMA,
426
+ (event) => event.action === "blocked_by_removed",
427
+ )
428
+ export const GITHUB_ISSUE_DEPENDENCY_BLOCKING_ADDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueDependencyBlockingAddedEvent> =
429
+ githubSemanticEventSchema<
430
+ GitHubIssueDependenciesEvent,
431
+ GitHubIssueDependencyBlockingAddedEvent
432
+ >(
433
+ GITHUB_ISSUE_DEPENDENCIES_EVENT_SCHEMA,
434
+ (event) => event.action === "blocking_added",
435
+ )
436
+ export const GITHUB_ISSUE_DEPENDENCY_BLOCKING_REMOVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueDependencyBlockingRemovedEvent> =
437
+ githubSemanticEventSchema<
438
+ GitHubIssueDependenciesEvent,
439
+ GitHubIssueDependencyBlockingRemovedEvent
440
+ >(
441
+ GITHUB_ISSUE_DEPENDENCIES_EVENT_SCHEMA,
442
+ (event) => event.action === "blocking_removed",
443
+ )
444
+
445
+ export const GITHUB_SUB_ISSUES_EVENT_SCHEMA: GitHubWebhookSchema<GitHubSubIssuesEvent> =
446
+ githubWebhookEventSchema<GitHubSubIssuesEvent>("sub_issues")
447
+ export const GITHUB_PARENT_ISSUE_ADDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubParentIssueAddedEvent> =
448
+ githubSemanticEventSchema<GitHubSubIssuesEvent, GitHubParentIssueAddedEvent>(
449
+ GITHUB_SUB_ISSUES_EVENT_SCHEMA,
450
+ (event) => event.action === "parent_issue_added",
451
+ )
452
+ export const GITHUB_PARENT_ISSUE_REMOVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubParentIssueRemovedEvent> =
453
+ githubSemanticEventSchema<
454
+ GitHubSubIssuesEvent,
455
+ GitHubParentIssueRemovedEvent
456
+ >(
457
+ GITHUB_SUB_ISSUES_EVENT_SCHEMA,
458
+ (event) => event.action === "parent_issue_removed",
459
+ )
460
+ export const GITHUB_SUB_ISSUE_ADDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubSubIssueAddedEvent> =
461
+ githubSemanticEventSchema<GitHubSubIssuesEvent, GitHubSubIssueAddedEvent>(
462
+ GITHUB_SUB_ISSUES_EVENT_SCHEMA,
463
+ (event) => event.action === "sub_issue_added",
464
+ )
465
+ export const GITHUB_SUB_ISSUE_REMOVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubSubIssueRemovedEvent> =
466
+ githubSemanticEventSchema<GitHubSubIssuesEvent, GitHubSubIssueRemovedEvent>(
467
+ GITHUB_SUB_ISSUES_EVENT_SCHEMA,
468
+ (event) => event.action === "sub_issue_removed",
469
+ )
470
+
471
+ export const GITHUB_PULL_REQUEST_REVIEW_THREAD_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewThreadEvent> =
472
+ githubWebhookEventSchema<GitHubPullRequestReviewThreadEvent>(
473
+ "pull_request_review_thread",
474
+ )
475
+ export const GITHUB_PULL_REQUEST_REVIEW_THREAD_RESOLVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewThreadResolvedEvent> =
476
+ githubSemanticEventSchema<
477
+ GitHubPullRequestReviewThreadEvent,
478
+ GitHubPullRequestReviewThreadResolvedEvent
479
+ >(
480
+ GITHUB_PULL_REQUEST_REVIEW_THREAD_EVENT_SCHEMA,
481
+ (event) => event.action === "resolved",
482
+ )
483
+ export const GITHUB_PULL_REQUEST_REVIEW_THREAD_UNRESOLVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewThreadUnresolvedEvent> =
484
+ githubSemanticEventSchema<
485
+ GitHubPullRequestReviewThreadEvent,
486
+ GitHubPullRequestReviewThreadUnresolvedEvent
487
+ >(
488
+ GITHUB_PULL_REQUEST_REVIEW_THREAD_EVENT_SCHEMA,
489
+ (event) => event.action === "unresolved",
490
+ )
491
+
492
+ export const GITHUB_DEPLOYMENT_REVIEW_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentReviewEvent> =
493
+ githubWebhookEventSchema<GitHubDeploymentReviewEvent>("deployment_review")
494
+ export const GITHUB_DEPLOYMENT_REVIEW_APPROVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentReviewApprovedEvent> =
495
+ githubSemanticEventSchema<
496
+ GitHubDeploymentReviewEvent,
497
+ GitHubDeploymentReviewApprovedEvent
498
+ >(
499
+ GITHUB_DEPLOYMENT_REVIEW_EVENT_SCHEMA,
500
+ (event) => event.action === "approved",
501
+ )
502
+ export const GITHUB_DEPLOYMENT_REVIEW_REJECTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentReviewRejectedEvent> =
503
+ githubSemanticEventSchema<
504
+ GitHubDeploymentReviewEvent,
505
+ GitHubDeploymentReviewRejectedEvent
506
+ >(
507
+ GITHUB_DEPLOYMENT_REVIEW_EVENT_SCHEMA,
508
+ (event) => event.action === "rejected",
509
+ )
510
+ export const GITHUB_DEPLOYMENT_REVIEW_REQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentReviewRequestedEvent> =
511
+ githubSemanticEventSchema<
512
+ GitHubDeploymentReviewEvent,
513
+ GitHubDeploymentReviewRequestedEvent
514
+ >(
515
+ GITHUB_DEPLOYMENT_REVIEW_EVENT_SCHEMA,
516
+ (event) => event.action === "requested",
517
+ )
518
+
519
+ export const GITHUB_DEPLOYMENT_PROTECTION_RULE_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentProtectionRuleEvent> =
520
+ githubWebhookEventSchema<GitHubDeploymentProtectionRuleEvent>(
521
+ "deployment_protection_rule",
522
+ )
523
+ export const GITHUB_DEPLOYMENT_PROTECTION_RULE_REQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentProtectionRuleRequestedEvent> =
524
+ GITHUB_DEPLOYMENT_PROTECTION_RULE_EVENT_SCHEMA
525
+
526
+ export const GITHUB_MERGE_GROUP_EVENT_SCHEMA: GitHubWebhookSchema<GitHubMergeGroupEvent> =
527
+ githubWebhookEventSchema<GitHubMergeGroupEvent>("merge_group")
528
+ export const GITHUB_MERGE_GROUP_CHECKS_REQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubMergeGroupChecksRequestedEvent> =
529
+ githubSemanticEventSchema<
530
+ GitHubMergeGroupEvent,
531
+ GitHubMergeGroupChecksRequestedEvent
532
+ >(
533
+ GITHUB_MERGE_GROUP_EVENT_SCHEMA,
534
+ (event) => event.action === "checks_requested",
535
+ )
536
+ export const GITHUB_MERGE_GROUP_DESTROYED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubMergeGroupDestroyedEvent> =
537
+ githubSemanticEventSchema<
538
+ GitHubMergeGroupEvent,
539
+ GitHubMergeGroupDestroyedEvent
540
+ >(GITHUB_MERGE_GROUP_EVENT_SCHEMA, (event) => event.action === "destroyed")
541
+
542
+ export const GITHUB_REPOSITORY_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryEvent> =
543
+ githubWebhookEventSchema<GitHubRepositoryEvent>("repository")
544
+ export const GITHUB_REPOSITORY_ARCHIVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryArchivedEvent> =
545
+ githubSemanticEventSchema<
546
+ GitHubRepositoryEvent,
547
+ GitHubRepositoryArchivedEvent
548
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "archived")
549
+ export const GITHUB_REPOSITORY_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryCreatedEvent> =
550
+ githubSemanticEventSchema<
551
+ GitHubRepositoryEvent,
552
+ GitHubRepositoryCreatedEvent
553
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "created")
554
+ export const GITHUB_REPOSITORY_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryDeletedEvent> =
555
+ githubSemanticEventSchema<
556
+ GitHubRepositoryEvent,
557
+ GitHubRepositoryDeletedEvent
558
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "deleted")
559
+ export const GITHUB_REPOSITORY_EDITED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryEditedEvent> =
560
+ githubSemanticEventSchema<GitHubRepositoryEvent, GitHubRepositoryEditedEvent>(
561
+ GITHUB_REPOSITORY_EVENT_SCHEMA,
562
+ (event) => event.action === "edited",
563
+ )
564
+ export const GITHUB_REPOSITORY_PRIVATIZED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryPrivatizedEvent> =
565
+ githubSemanticEventSchema<
566
+ GitHubRepositoryEvent,
567
+ GitHubRepositoryPrivatizedEvent
568
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "privatized")
569
+ export const GITHUB_REPOSITORY_PUBLICIZED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryPublicizedEvent> =
570
+ githubSemanticEventSchema<
571
+ GitHubRepositoryEvent,
572
+ GitHubRepositoryPublicizedEvent
573
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "publicized")
574
+ export const GITHUB_REPOSITORY_RENAMED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryRenamedEvent> =
575
+ githubSemanticEventSchema<
576
+ GitHubRepositoryEvent,
577
+ GitHubRepositoryRenamedEvent
578
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "renamed")
579
+ export const GITHUB_REPOSITORY_TRANSFERRED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryTransferredEvent> =
580
+ githubSemanticEventSchema<
581
+ GitHubRepositoryEvent,
582
+ GitHubRepositoryTransferredEvent
583
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "transferred")
584
+ export const GITHUB_REPOSITORY_UNARCHIVED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryUnarchivedEvent> =
585
+ githubSemanticEventSchema<
586
+ GitHubRepositoryEvent,
587
+ GitHubRepositoryUnarchivedEvent
588
+ >(GITHUB_REPOSITORY_EVENT_SCHEMA, (event) => event.action === "unarchived")
589
+
590
+ export const GITHUB_CHECK_RUN_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunEvent> =
591
+ githubWebhookEventSchema<GitHubCheckRunEvent>("check_run")
592
+ export const GITHUB_CHECK_RUN_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunCreatedEvent> =
593
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunCreatedEvent>(
594
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
595
+ (event) => event.action === "created",
596
+ )
597
+ export const GITHUB_CHECK_RUN_COMPLETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunCompletedEvent> =
318
598
  githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunCompletedEvent>(
319
599
  GITHUB_CHECK_RUN_EVENT_SCHEMA,
320
600
  (event) => event.action === "completed",
321
601
  )
322
- export const GITHUB_CHECK_RUN_REREQUESTED_EVENT_SCHEMA =
602
+ export const GITHUB_CHECK_RUN_REREQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunRerequestedEvent> =
323
603
  githubSemanticEventSchema<
324
604
  GitHubCheckRunEvent,
325
605
  GitHubCheckRunRerequestedEvent
326
606
  >(GITHUB_CHECK_RUN_EVENT_SCHEMA, (event) => event.action === "rerequested")
327
- export const GITHUB_CHECK_RUN_REQUESTED_ACTION_EVENT_SCHEMA =
607
+ export const GITHUB_CHECK_RUN_REQUESTED_ACTION_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunRequestedActionEvent> =
328
608
  githubSemanticEventSchema<
329
609
  GitHubCheckRunEvent,
330
610
  GitHubCheckRunRequestedActionEvent
@@ -332,35 +612,33 @@ export const GITHUB_CHECK_RUN_REQUESTED_ACTION_EVENT_SCHEMA =
332
612
  GITHUB_CHECK_RUN_EVENT_SCHEMA,
333
613
  (event) => event.action === "requested_action",
334
614
  )
335
- export const GITHUB_CHECK_RUN_SUCCEEDED_EVENT_SCHEMA =
615
+ export const GITHUB_CHECK_RUN_SUCCEEDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunSucceededEvent> =
336
616
  githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunSucceededEvent>(
337
617
  GITHUB_CHECK_RUN_EVENT_SCHEMA,
338
618
  (event) =>
339
619
  event.action === "completed" && event.check_run.conclusion === "success",
340
620
  )
341
- export const GITHUB_CHECK_RUN_FAILED_EVENT_SCHEMA = githubSemanticEventSchema<
342
- GitHubCheckRunEvent,
343
- GitHubCheckRunFailedEvent
344
- >(
345
- GITHUB_CHECK_RUN_EVENT_SCHEMA,
346
- (event) =>
347
- event.action === "completed" && event.check_run.conclusion === "failure",
348
- )
349
- export const GITHUB_CHECK_RUN_CANCELLED_EVENT_SCHEMA =
621
+ export const GITHUB_CHECK_RUN_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunFailedEvent> =
622
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunFailedEvent>(
623
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
624
+ (event) =>
625
+ event.action === "completed" && event.check_run.conclusion === "failure",
626
+ )
627
+ export const GITHUB_CHECK_RUN_CANCELLED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunCancelledEvent> =
350
628
  githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunCancelledEvent>(
351
629
  GITHUB_CHECK_RUN_EVENT_SCHEMA,
352
630
  (event) =>
353
631
  event.action === "completed" &&
354
632
  event.check_run.conclusion === "cancelled",
355
633
  )
356
- export const GITHUB_CHECK_RUN_TIMED_OUT_EVENT_SCHEMA =
634
+ export const GITHUB_CHECK_RUN_TIMED_OUT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunTimedOutEvent> =
357
635
  githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunTimedOutEvent>(
358
636
  GITHUB_CHECK_RUN_EVENT_SCHEMA,
359
637
  (event) =>
360
638
  event.action === "completed" &&
361
639
  event.check_run.conclusion === "timed_out",
362
640
  )
363
- export const GITHUB_CHECK_RUN_STARTUP_FAILED_EVENT_SCHEMA =
641
+ export const GITHUB_CHECK_RUN_STARTUP_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunStartupFailedEvent> =
364
642
  githubSemanticEventSchema<
365
643
  GitHubCheckRunEvent,
366
644
  GitHubCheckRunStartupFailedEvent
@@ -370,7 +648,7 @@ export const GITHUB_CHECK_RUN_STARTUP_FAILED_EVENT_SCHEMA =
370
648
  event.action === "completed" &&
371
649
  event.check_run.conclusion === "startup_failure",
372
650
  )
373
- export const GITHUB_CHECK_RUN_ACTION_REQUIRED_EVENT_SCHEMA =
651
+ export const GITHUB_CHECK_RUN_ACTION_REQUIRED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunActionRequiredEvent> =
374
652
  githubSemanticEventSchema<
375
653
  GitHubCheckRunEvent,
376
654
  GitHubCheckRunActionRequiredEvent
@@ -380,25 +658,55 @@ export const GITHUB_CHECK_RUN_ACTION_REQUIRED_EVENT_SCHEMA =
380
658
  event.action === "completed" &&
381
659
  event.check_run.conclusion === "action_required",
382
660
  )
661
+ export const GITHUB_CHECK_RUN_NEUTRAL_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunNeutralEvent> =
662
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunNeutralEvent>(
663
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
664
+ (event) =>
665
+ event.action === "completed" && event.check_run.conclusion === "neutral",
666
+ )
667
+ export const GITHUB_CHECK_RUN_PENDING_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunPendingEvent> =
668
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunPendingEvent>(
669
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
670
+ (event) =>
671
+ event.action === "completed" && event.check_run.conclusion === "pending",
672
+ )
673
+ export const GITHUB_CHECK_RUN_SKIPPED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunSkippedEvent> =
674
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunSkippedEvent>(
675
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
676
+ (event) =>
677
+ event.action === "completed" && event.check_run.conclusion === "skipped",
678
+ )
679
+ export const GITHUB_CHECK_RUN_STALE_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunStaleEvent> =
680
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunStaleEvent>(
681
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
682
+ (event) =>
683
+ event.action === "completed" && event.check_run.conclusion === "stale",
684
+ )
685
+ export const GITHUB_CHECK_RUN_WAITING_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckRunWaitingEvent> =
686
+ githubSemanticEventSchema<GitHubCheckRunEvent, GitHubCheckRunWaitingEvent>(
687
+ GITHUB_CHECK_RUN_EVENT_SCHEMA,
688
+ (event) =>
689
+ event.action === "completed" && event.check_run.conclusion === "waiting",
690
+ )
383
691
 
384
- export const GITHUB_CHECK_SUITE_EVENT_SCHEMA =
385
- githubEventSchema<GitHubCheckSuiteEvent>(GITHUB_CHECK_SUITE_EVENT_BASE_SCHEMA)
386
- export const GITHUB_CHECK_SUITE_COMPLETED_EVENT_SCHEMA =
692
+ export const GITHUB_CHECK_SUITE_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteEvent> =
693
+ githubWebhookEventSchema<GitHubCheckSuiteEvent>("check_suite")
694
+ export const GITHUB_CHECK_SUITE_COMPLETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteCompletedEvent> =
387
695
  githubSemanticEventSchema<
388
696
  GitHubCheckSuiteEvent,
389
697
  GitHubCheckSuiteCompletedEvent
390
698
  >(GITHUB_CHECK_SUITE_EVENT_SCHEMA, (event) => event.action === "completed")
391
- export const GITHUB_CHECK_SUITE_REQUESTED_EVENT_SCHEMA =
699
+ export const GITHUB_CHECK_SUITE_REQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteRequestedEvent> =
392
700
  githubSemanticEventSchema<
393
701
  GitHubCheckSuiteEvent,
394
702
  GitHubCheckSuiteRequestedEvent
395
703
  >(GITHUB_CHECK_SUITE_EVENT_SCHEMA, (event) => event.action === "requested")
396
- export const GITHUB_CHECK_SUITE_REREQUESTED_EVENT_SCHEMA =
704
+ export const GITHUB_CHECK_SUITE_REREQUESTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteRerequestedEvent> =
397
705
  githubSemanticEventSchema<
398
706
  GitHubCheckSuiteEvent,
399
707
  GitHubCheckSuiteRerequestedEvent
400
708
  >(GITHUB_CHECK_SUITE_EVENT_SCHEMA, (event) => event.action === "rerequested")
401
- export const GITHUB_CHECK_SUITE_SUCCEEDED_EVENT_SCHEMA =
709
+ export const GITHUB_CHECK_SUITE_SUCCEEDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteSucceededEvent> =
402
710
  githubSemanticEventSchema<
403
711
  GitHubCheckSuiteEvent,
404
712
  GitHubCheckSuiteSucceededEvent
@@ -408,15 +716,14 @@ export const GITHUB_CHECK_SUITE_SUCCEEDED_EVENT_SCHEMA =
408
716
  event.action === "completed" &&
409
717
  event.check_suite.conclusion === "success",
410
718
  )
411
- export const GITHUB_CHECK_SUITE_FAILED_EVENT_SCHEMA = githubSemanticEventSchema<
412
- GitHubCheckSuiteEvent,
413
- GitHubCheckSuiteFailedEvent
414
- >(
415
- GITHUB_CHECK_SUITE_EVENT_SCHEMA,
416
- (event) =>
417
- event.action === "completed" && event.check_suite.conclusion === "failure",
418
- )
419
- export const GITHUB_CHECK_SUITE_CANCELLED_EVENT_SCHEMA =
719
+ export const GITHUB_CHECK_SUITE_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteFailedEvent> =
720
+ githubSemanticEventSchema<GitHubCheckSuiteEvent, GitHubCheckSuiteFailedEvent>(
721
+ GITHUB_CHECK_SUITE_EVENT_SCHEMA,
722
+ (event) =>
723
+ event.action === "completed" &&
724
+ event.check_suite.conclusion === "failure",
725
+ )
726
+ export const GITHUB_CHECK_SUITE_CANCELLED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteCancelledEvent> =
420
727
  githubSemanticEventSchema<
421
728
  GitHubCheckSuiteEvent,
422
729
  GitHubCheckSuiteCancelledEvent
@@ -426,7 +733,7 @@ export const GITHUB_CHECK_SUITE_CANCELLED_EVENT_SCHEMA =
426
733
  event.action === "completed" &&
427
734
  event.check_suite.conclusion === "cancelled",
428
735
  )
429
- export const GITHUB_CHECK_SUITE_TIMED_OUT_EVENT_SCHEMA =
736
+ export const GITHUB_CHECK_SUITE_TIMED_OUT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteTimedOutEvent> =
430
737
  githubSemanticEventSchema<
431
738
  GitHubCheckSuiteEvent,
432
739
  GitHubCheckSuiteTimedOutEvent
@@ -436,7 +743,7 @@ export const GITHUB_CHECK_SUITE_TIMED_OUT_EVENT_SCHEMA =
436
743
  event.action === "completed" &&
437
744
  event.check_suite.conclusion === "timed_out",
438
745
  )
439
- export const GITHUB_CHECK_SUITE_STARTUP_FAILED_EVENT_SCHEMA =
746
+ export const GITHUB_CHECK_SUITE_STARTUP_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteStartupFailedEvent> =
440
747
  githubSemanticEventSchema<
441
748
  GitHubCheckSuiteEvent,
442
749
  GitHubCheckSuiteStartupFailedEvent
@@ -446,7 +753,7 @@ export const GITHUB_CHECK_SUITE_STARTUP_FAILED_EVENT_SCHEMA =
446
753
  event.action === "completed" &&
447
754
  event.check_suite.conclusion === "startup_failure",
448
755
  )
449
- export const GITHUB_CHECK_SUITE_ACTION_REQUIRED_EVENT_SCHEMA =
756
+ export const GITHUB_CHECK_SUITE_ACTION_REQUIRED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteActionRequiredEvent> =
450
757
  githubSemanticEventSchema<
451
758
  GitHubCheckSuiteEvent,
452
759
  GitHubCheckSuiteActionRequiredEvent
@@ -456,53 +763,91 @@ export const GITHUB_CHECK_SUITE_ACTION_REQUIRED_EVENT_SCHEMA =
456
763
  event.action === "completed" &&
457
764
  event.check_suite.conclusion === "action_required",
458
765
  )
766
+ export const GITHUB_CHECK_SUITE_NEUTRAL_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteNeutralEvent> =
767
+ githubSemanticEventSchema<
768
+ GitHubCheckSuiteEvent,
769
+ GitHubCheckSuiteNeutralEvent
770
+ >(
771
+ GITHUB_CHECK_SUITE_EVENT_SCHEMA,
772
+ (event) =>
773
+ event.action === "completed" &&
774
+ event.check_suite.conclusion === "neutral",
775
+ )
776
+ export const GITHUB_CHECK_SUITE_SKIPPED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteSkippedEvent> =
777
+ githubSemanticEventSchema<
778
+ GitHubCheckSuiteEvent,
779
+ GitHubCheckSuiteSkippedEvent
780
+ >(
781
+ GITHUB_CHECK_SUITE_EVENT_SCHEMA,
782
+ (event) =>
783
+ event.action === "completed" &&
784
+ event.check_suite.conclusion === "skipped",
785
+ )
786
+ export const GITHUB_CHECK_SUITE_STALE_EVENT_SCHEMA: GitHubWebhookSchema<GitHubCheckSuiteStaleEvent> =
787
+ githubSemanticEventSchema<GitHubCheckSuiteEvent, GitHubCheckSuiteStaleEvent>(
788
+ GITHUB_CHECK_SUITE_EVENT_SCHEMA,
789
+ (event) =>
790
+ event.action === "completed" && event.check_suite.conclusion === "stale",
791
+ )
792
+
793
+ export const GITHUB_REF_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRefCreatedEvent> =
794
+ githubWebhookEventSchema<GitHubRefCreatedEvent>("create")
795
+ export const GITHUB_BRANCH_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubBranchCreatedEvent> =
796
+ githubSemanticEventSchema<GitHubRefCreatedEvent, GitHubBranchCreatedEvent>(
797
+ GITHUB_REF_CREATED_EVENT_SCHEMA,
798
+ (event) => event.ref_type === "branch",
799
+ )
800
+ export const GITHUB_TAG_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubTagCreatedEvent> =
801
+ githubSemanticEventSchema<GitHubRefCreatedEvent, GitHubTagCreatedEvent>(
802
+ GITHUB_REF_CREATED_EVENT_SCHEMA,
803
+ (event) => event.ref_type === "tag",
804
+ )
805
+ export const GITHUB_REF_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRefDeletedEvent> =
806
+ githubWebhookEventSchema<GitHubRefDeletedEvent>("delete")
807
+ export const GITHUB_BRANCH_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubBranchDeletedEvent> =
808
+ githubSemanticEventSchema<GitHubRefDeletedEvent, GitHubBranchDeletedEvent>(
809
+ GITHUB_REF_DELETED_EVENT_SCHEMA,
810
+ (event) => event.ref_type === "branch",
811
+ )
812
+ export const GITHUB_TAG_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubTagDeletedEvent> =
813
+ githubSemanticEventSchema<GitHubRefDeletedEvent, GitHubTagDeletedEvent>(
814
+ GITHUB_REF_DELETED_EVENT_SCHEMA,
815
+ (event) => event.ref_type === "tag",
816
+ )
459
817
 
460
- export const GITHUB_REF_CREATED_EVENT_SCHEMA =
461
- githubEventSchema<GitHubRefCreatedEvent>(GITHUB_REF_EVENT_BASE_SCHEMA)
462
- export const GITHUB_BRANCH_CREATED_EVENT_SCHEMA = githubSemanticEventSchema<
463
- GitHubRefCreatedEvent,
464
- GitHubBranchCreatedEvent
465
- >(GITHUB_REF_CREATED_EVENT_SCHEMA, (event) => event.ref_type === "branch")
466
- export const GITHUB_TAG_CREATED_EVENT_SCHEMA = githubSemanticEventSchema<
467
- GitHubRefCreatedEvent,
468
- GitHubTagCreatedEvent
469
- >(GITHUB_REF_CREATED_EVENT_SCHEMA, (event) => event.ref_type === "tag")
470
- export const GITHUB_REF_DELETED_EVENT_SCHEMA =
471
- githubEventSchema<GitHubRefDeletedEvent>(GITHUB_REF_EVENT_BASE_SCHEMA)
472
- export const GITHUB_BRANCH_DELETED_EVENT_SCHEMA = githubSemanticEventSchema<
473
- GitHubRefDeletedEvent,
474
- GitHubBranchDeletedEvent
475
- >(GITHUB_REF_DELETED_EVENT_SCHEMA, (event) => event.ref_type === "branch")
476
- export const GITHUB_TAG_DELETED_EVENT_SCHEMA = githubSemanticEventSchema<
477
- GitHubRefDeletedEvent,
478
- GitHubTagDeletedEvent
479
- >(GITHUB_REF_DELETED_EVENT_SCHEMA, (event) => event.ref_type === "tag")
480
-
481
- export const GITHUB_ISSUE_COMMENT_EVENT_SCHEMA =
482
- githubEventSchema<GitHubIssueCommentEvent>(
483
- GITHUB_ISSUE_COMMENT_EVENT_BASE_SCHEMA,
484
- )
485
- export const GITHUB_ISSUE_COMMENT_CREATED_EVENT_SCHEMA =
818
+ export const GITHUB_ISSUE_COMMENT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentEvent> =
819
+ githubWebhookEventSchema<GitHubIssueCommentEvent>("issue_comment")
820
+ export const GITHUB_ISSUE_COMMENT_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentCreatedEvent> =
486
821
  githubSemanticEventSchema<
487
822
  GitHubIssueCommentEvent,
488
823
  GitHubIssueCommentCreatedEvent
489
824
  >(GITHUB_ISSUE_COMMENT_EVENT_SCHEMA, (event) => event.action === "created")
490
- export const GITHUB_ISSUE_COMMENT_EDITED_EVENT_SCHEMA =
825
+ export const GITHUB_ISSUE_COMMENT_EDITED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentEditedEvent> =
491
826
  githubSemanticEventSchema<
492
827
  GitHubIssueCommentEvent,
493
828
  GitHubIssueCommentEditedEvent
494
829
  >(GITHUB_ISSUE_COMMENT_EVENT_SCHEMA, (event) => event.action === "edited")
495
- export const GITHUB_ISSUE_COMMENT_DELETED_EVENT_SCHEMA =
830
+ export const GITHUB_ISSUE_COMMENT_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentDeletedEvent> =
496
831
  githubSemanticEventSchema<
497
832
  GitHubIssueCommentEvent,
498
833
  GitHubIssueCommentDeletedEvent
499
834
  >(GITHUB_ISSUE_COMMENT_EVENT_SCHEMA, (event) => event.action === "deleted")
835
+ export const GITHUB_ISSUE_COMMENT_PINNED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentPinnedEvent> =
836
+ githubSemanticEventSchema<
837
+ GitHubIssueCommentEvent,
838
+ GitHubIssueCommentPinnedEvent
839
+ >(GITHUB_ISSUE_COMMENT_EVENT_SCHEMA, (event) => event.action === "pinned")
840
+ export const GITHUB_ISSUE_COMMENT_UNPINNED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubIssueCommentUnpinnedEvent> =
841
+ githubSemanticEventSchema<
842
+ GitHubIssueCommentEvent,
843
+ GitHubIssueCommentUnpinnedEvent
844
+ >(GITHUB_ISSUE_COMMENT_EVENT_SCHEMA, (event) => event.action === "unpinned")
500
845
 
501
- export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_SCHEMA =
502
- githubEventSchema<GitHubPullRequestReviewCommentEvent>(
503
- GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_BASE_SCHEMA,
846
+ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewCommentEvent> =
847
+ githubWebhookEventSchema<GitHubPullRequestReviewCommentEvent>(
848
+ "pull_request_review_comment",
504
849
  )
505
- export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_CREATED_EVENT_SCHEMA =
850
+ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_CREATED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewCommentCreatedEvent> =
506
851
  githubSemanticEventSchema<
507
852
  GitHubPullRequestReviewCommentEvent,
508
853
  GitHubPullRequestReviewCommentCreatedEvent
@@ -510,7 +855,7 @@ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_CREATED_EVENT_SCHEMA =
510
855
  GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_SCHEMA,
511
856
  (event) => event.action === "created",
512
857
  )
513
- export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EDITED_EVENT_SCHEMA =
858
+ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EDITED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewCommentEditedEvent> =
514
859
  githubSemanticEventSchema<
515
860
  GitHubPullRequestReviewCommentEvent,
516
861
  GitHubPullRequestReviewCommentEditedEvent
@@ -518,7 +863,7 @@ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_EDITED_EVENT_SCHEMA =
518
863
  GITHUB_PULL_REQUEST_REVIEW_COMMENT_EVENT_SCHEMA,
519
864
  (event) => event.action === "edited",
520
865
  )
521
- export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_DELETED_EVENT_SCHEMA =
866
+ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_DELETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubPullRequestReviewCommentDeletedEvent> =
522
867
  githubSemanticEventSchema<
523
868
  GitHubPullRequestReviewCommentEvent,
524
869
  GitHubPullRequestReviewCommentDeletedEvent
@@ -527,31 +872,29 @@ export const GITHUB_PULL_REQUEST_REVIEW_COMMENT_DELETED_EVENT_SCHEMA =
527
872
  (event) => event.action === "deleted",
528
873
  )
529
874
 
530
- export const GITHUB_WORKFLOW_JOB_EVENT_SCHEMA =
531
- githubEventSchema<GitHubWorkflowJobEvent>(
532
- GITHUB_WORKFLOW_JOB_EVENT_BASE_SCHEMA,
533
- )
534
- export const GITHUB_WORKFLOW_JOB_QUEUED_EVENT_SCHEMA =
875
+ export const GITHUB_WORKFLOW_JOB_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobEvent> =
876
+ githubWebhookEventSchema<GitHubWorkflowJobEvent>("workflow_job")
877
+ export const GITHUB_WORKFLOW_JOB_QUEUED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobQueuedEvent> =
535
878
  githubSemanticEventSchema<
536
879
  GitHubWorkflowJobEvent,
537
880
  GitHubWorkflowJobQueuedEvent
538
881
  >(GITHUB_WORKFLOW_JOB_EVENT_SCHEMA, (event) => event.action === "queued")
539
- export const GITHUB_WORKFLOW_JOB_STARTED_EVENT_SCHEMA =
882
+ export const GITHUB_WORKFLOW_JOB_STARTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobStartedEvent> =
540
883
  githubSemanticEventSchema<
541
884
  GitHubWorkflowJobEvent,
542
885
  GitHubWorkflowJobStartedEvent
543
886
  >(GITHUB_WORKFLOW_JOB_EVENT_SCHEMA, (event) => event.action === "in_progress")
544
- export const GITHUB_WORKFLOW_JOB_WAITING_EVENT_SCHEMA =
887
+ export const GITHUB_WORKFLOW_JOB_WAITING_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobWaitingEvent> =
545
888
  githubSemanticEventSchema<
546
889
  GitHubWorkflowJobEvent,
547
890
  GitHubWorkflowJobWaitingEvent
548
891
  >(GITHUB_WORKFLOW_JOB_EVENT_SCHEMA, (event) => event.action === "waiting")
549
- export const GITHUB_WORKFLOW_JOB_COMPLETED_EVENT_SCHEMA =
892
+ export const GITHUB_WORKFLOW_JOB_COMPLETED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobCompletedEvent> =
550
893
  githubSemanticEventSchema<
551
894
  GitHubWorkflowJobEvent,
552
895
  GitHubWorkflowJobCompletedEvent
553
896
  >(GITHUB_WORKFLOW_JOB_EVENT_SCHEMA, (event) => event.action === "completed")
554
- export const GITHUB_WORKFLOW_JOB_SUCCEEDED_EVENT_SCHEMA =
897
+ export const GITHUB_WORKFLOW_JOB_SUCCEEDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobSucceededEvent> =
555
898
  githubSemanticEventSchema<
556
899
  GitHubWorkflowJobEvent,
557
900
  GitHubWorkflowJobSucceededEvent
@@ -561,7 +904,7 @@ export const GITHUB_WORKFLOW_JOB_SUCCEEDED_EVENT_SCHEMA =
561
904
  event.action === "completed" &&
562
905
  event.workflow_job.conclusion === "success",
563
906
  )
564
- export const GITHUB_WORKFLOW_JOB_FAILED_EVENT_SCHEMA =
907
+ export const GITHUB_WORKFLOW_JOB_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobFailedEvent> =
565
908
  githubSemanticEventSchema<
566
909
  GitHubWorkflowJobEvent,
567
910
  GitHubWorkflowJobFailedEvent
@@ -571,7 +914,7 @@ export const GITHUB_WORKFLOW_JOB_FAILED_EVENT_SCHEMA =
571
914
  event.action === "completed" &&
572
915
  event.workflow_job.conclusion === "failure",
573
916
  )
574
- export const GITHUB_WORKFLOW_JOB_CANCELLED_EVENT_SCHEMA =
917
+ export const GITHUB_WORKFLOW_JOB_CANCELLED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobCancelledEvent> =
575
918
  githubSemanticEventSchema<
576
919
  GitHubWorkflowJobEvent,
577
920
  GitHubWorkflowJobCancelledEvent
@@ -581,7 +924,7 @@ export const GITHUB_WORKFLOW_JOB_CANCELLED_EVENT_SCHEMA =
581
924
  event.action === "completed" &&
582
925
  event.workflow_job.conclusion === "cancelled",
583
926
  )
584
- export const GITHUB_WORKFLOW_JOB_TIMED_OUT_EVENT_SCHEMA =
927
+ export const GITHUB_WORKFLOW_JOB_TIMED_OUT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobTimedOutEvent> =
585
928
  githubSemanticEventSchema<
586
929
  GitHubWorkflowJobEvent,
587
930
  GitHubWorkflowJobTimedOutEvent
@@ -591,51 +934,70 @@ export const GITHUB_WORKFLOW_JOB_TIMED_OUT_EVENT_SCHEMA =
591
934
  event.action === "completed" &&
592
935
  event.workflow_job.conclusion === "timed_out",
593
936
  )
937
+ export const GITHUB_WORKFLOW_JOB_ACTION_REQUIRED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobActionRequiredEvent> =
938
+ githubSemanticEventSchema<
939
+ GitHubWorkflowJobEvent,
940
+ GitHubWorkflowJobActionRequiredEvent
941
+ >(
942
+ GITHUB_WORKFLOW_JOB_EVENT_SCHEMA,
943
+ (event) =>
944
+ event.action === "completed" &&
945
+ event.workflow_job.conclusion === "action_required",
946
+ )
947
+ export const GITHUB_WORKFLOW_JOB_NEUTRAL_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobNeutralEvent> =
948
+ githubSemanticEventSchema<
949
+ GitHubWorkflowJobEvent,
950
+ GitHubWorkflowJobNeutralEvent
951
+ >(
952
+ GITHUB_WORKFLOW_JOB_EVENT_SCHEMA,
953
+ (event) =>
954
+ event.action === "completed" &&
955
+ event.workflow_job.conclusion === "neutral",
956
+ )
957
+ export const GITHUB_WORKFLOW_JOB_SKIPPED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowJobSkippedEvent> =
958
+ githubSemanticEventSchema<
959
+ GitHubWorkflowJobEvent,
960
+ GitHubWorkflowJobSkippedEvent
961
+ >(
962
+ GITHUB_WORKFLOW_JOB_EVENT_SCHEMA,
963
+ (event) =>
964
+ event.action === "completed" &&
965
+ event.workflow_job.conclusion === "skipped",
966
+ )
594
967
 
595
- export const GITHUB_REPOSITORY_DISPATCH_EVENT_SCHEMA =
596
- githubEventSchema<GitHubRepositoryDispatchEvent>(
597
- GITHUB_REPOSITORY_DISPATCH_EVENT_BASE_SCHEMA,
598
- )
599
- export const GITHUB_WORKFLOW_DISPATCH_EVENT_SCHEMA =
600
- githubEventSchema<GitHubWorkflowDispatchEvent>(
601
- GITHUB_WORKFLOW_DISPATCH_EVENT_BASE_SCHEMA,
602
- )
603
- export const GITHUB_DEPLOYMENT_EVENT_SCHEMA =
604
- githubEventSchema<GitHubDeploymentEvent>(GITHUB_DEPLOYMENT_EVENT_BASE_SCHEMA)
605
- export const GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA =
606
- githubEventSchema<GitHubDeploymentStatusEvent>(
607
- GITHUB_DEPLOYMENT_STATUS_EVENT_BASE_SCHEMA,
608
- )
609
- export const GITHUB_DEPLOYMENT_QUEUED_EVENT_SCHEMA = githubSemanticEventSchema<
610
- GitHubDeploymentStatusEvent,
611
- GitHubDeploymentQueuedEvent
612
- >(
613
- GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
614
- (event) => event.deployment_status.state === "queued",
615
- )
616
- export const GITHUB_DEPLOYMENT_STARTED_EVENT_SCHEMA = githubSemanticEventSchema<
617
- GitHubDeploymentStatusEvent,
618
- GitHubDeploymentStartedEvent
619
- >(
620
- GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
621
- (event) => event.deployment_status.state === "in_progress",
622
- )
623
- export const GITHUB_DEPLOYMENT_PENDING_EVENT_SCHEMA = githubSemanticEventSchema<
624
- GitHubDeploymentStatusEvent,
625
- GitHubDeploymentPendingEvent
626
- >(
627
- GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
628
- (event) => event.deployment_status.state === "pending",
629
- )
630
- export const GITHUB_DEPLOYMENT_INACTIVE_EVENT_SCHEMA =
968
+ export const GITHUB_REPOSITORY_DISPATCH_EVENT_SCHEMA: GitHubWebhookSchema<GitHubRepositoryDispatchEvent> =
969
+ githubWebhookEventSchema<GitHubRepositoryDispatchEvent>("repository_dispatch")
970
+ export const GITHUB_WORKFLOW_DISPATCH_EVENT_SCHEMA: GitHubWebhookSchema<GitHubWorkflowDispatchEvent> =
971
+ githubWebhookEventSchema<GitHubWorkflowDispatchEvent>("workflow_dispatch")
972
+ export const GITHUB_DEPLOYMENT_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentEvent> =
973
+ githubWebhookEventSchema<GitHubDeploymentEvent>("deployment")
974
+ export const GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentStatusEvent> =
975
+ githubWebhookEventSchema<GitHubDeploymentStatusEvent>("deployment_status")
976
+ export const GITHUB_DEPLOYMENT_QUEUED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentQueuedEvent> =
631
977
  githubSemanticEventSchema<
632
978
  GitHubDeploymentStatusEvent,
633
- GitHubDeploymentInactiveEvent
979
+ GitHubDeploymentQueuedEvent
634
980
  >(
635
981
  GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
636
- (event) => event.deployment_status.state === "inactive",
982
+ (event) => event.deployment_status.state === "queued",
637
983
  )
638
- export const GITHUB_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA =
984
+ export const GITHUB_DEPLOYMENT_STARTED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentStartedEvent> =
985
+ githubSemanticEventSchema<
986
+ GitHubDeploymentStatusEvent,
987
+ GitHubDeploymentStartedEvent
988
+ >(
989
+ GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
990
+ (event) => event.deployment_status.state === "in_progress",
991
+ )
992
+ export const GITHUB_DEPLOYMENT_PENDING_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentPendingEvent> =
993
+ githubSemanticEventSchema<
994
+ GitHubDeploymentStatusEvent,
995
+ GitHubDeploymentPendingEvent
996
+ >(
997
+ GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
998
+ (event) => event.deployment_status.state === "pending",
999
+ )
1000
+ export const GITHUB_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentSucceededEvent> =
639
1001
  githubSemanticEventSchema<
640
1002
  GitHubDeploymentStatusEvent,
641
1003
  GitHubDeploymentSucceededEvent
@@ -643,49 +1005,45 @@ export const GITHUB_DEPLOYMENT_SUCCEEDED_EVENT_SCHEMA =
643
1005
  GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
644
1006
  (event) => event.deployment_status.state === "success",
645
1007
  )
646
- export const GITHUB_DEPLOYMENT_FAILED_EVENT_SCHEMA = githubSemanticEventSchema<
647
- GitHubDeploymentStatusEvent,
648
- GitHubDeploymentFailedEvent
649
- >(
650
- GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
651
- (event) => event.deployment_status.state === "failure",
652
- )
653
- export const GITHUB_DEPLOYMENT_ERRORED_EVENT_SCHEMA = githubSemanticEventSchema<
654
- GitHubDeploymentStatusEvent,
655
- GitHubDeploymentErroredEvent
656
- >(
657
- GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
658
- (event) => event.deployment_status.state === "error",
659
- )
660
-
661
- export const GITHUB_STATUS_EVENT_SCHEMA = githubEventSchema<GitHubStatusEvent>(
662
- GITHUB_STATUS_EVENT_BASE_SCHEMA,
663
- )
664
- export const GITHUB_STATUS_PENDING_EVENT_SCHEMA = githubSemanticEventSchema<
665
- GitHubStatusEvent,
666
- GitHubStatusPendingEvent
667
- >(GITHUB_STATUS_EVENT_SCHEMA, (event) => event.state === "pending")
668
- export const GITHUB_STATUS_SUCCEEDED_EVENT_SCHEMA = githubSemanticEventSchema<
669
- GitHubStatusEvent,
670
- GitHubStatusSucceededEvent
671
- >(GITHUB_STATUS_EVENT_SCHEMA, (event) => event.state === "success")
672
- export const GITHUB_STATUS_FAILED_EVENT_SCHEMA = githubSemanticEventSchema<
673
- GitHubStatusEvent,
674
- GitHubStatusFailedEvent
675
- >(GITHUB_STATUS_EVENT_SCHEMA, (event) => event.state === "failure")
676
- export const GITHUB_STATUS_ERRORED_EVENT_SCHEMA = githubSemanticEventSchema<
677
- GitHubStatusEvent,
678
- GitHubStatusErroredEvent
679
- >(GITHUB_STATUS_EVENT_SCHEMA, (event) => event.state === "error")
1008
+ export const GITHUB_DEPLOYMENT_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentFailedEvent> =
1009
+ githubSemanticEventSchema<
1010
+ GitHubDeploymentStatusEvent,
1011
+ GitHubDeploymentFailedEvent
1012
+ >(
1013
+ GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
1014
+ (event) => event.deployment_status.state === "failure",
1015
+ )
1016
+ export const GITHUB_DEPLOYMENT_ERRORED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubDeploymentErroredEvent> =
1017
+ githubSemanticEventSchema<
1018
+ GitHubDeploymentStatusEvent,
1019
+ GitHubDeploymentErroredEvent
1020
+ >(
1021
+ GITHUB_DEPLOYMENT_STATUS_EVENT_SCHEMA,
1022
+ (event) => event.deployment_status.state === "error",
1023
+ )
680
1024
 
681
- /**
682
- * Validates a typed GitHub webhook family.
683
- *
684
- * @param schema - Runtime schema for the webhook family.
685
- */
686
- function githubEventSchema<TEvent>(schema: z.ZodType): z.ZodType<TEvent> {
687
- return z.custom<TEvent>((value) => schema.safeParse(value).success)
688
- }
1025
+ export const GITHUB_STATUS_EVENT_SCHEMA: GitHubWebhookSchema<GitHubStatusEvent> =
1026
+ githubWebhookEventSchema<GitHubStatusEvent>("status")
1027
+ export const GITHUB_STATUS_PENDING_EVENT_SCHEMA: GitHubWebhookSchema<GitHubStatusPendingEvent> =
1028
+ githubSemanticEventSchema<GitHubStatusEvent, GitHubStatusPendingEvent>(
1029
+ GITHUB_STATUS_EVENT_SCHEMA,
1030
+ (event) => event.state === "pending",
1031
+ )
1032
+ export const GITHUB_STATUS_SUCCEEDED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubStatusSucceededEvent> =
1033
+ githubSemanticEventSchema<GitHubStatusEvent, GitHubStatusSucceededEvent>(
1034
+ GITHUB_STATUS_EVENT_SCHEMA,
1035
+ (event) => event.state === "success",
1036
+ )
1037
+ export const GITHUB_STATUS_FAILED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubStatusFailedEvent> =
1038
+ githubSemanticEventSchema<GitHubStatusEvent, GitHubStatusFailedEvent>(
1039
+ GITHUB_STATUS_EVENT_SCHEMA,
1040
+ (event) => event.state === "failure",
1041
+ )
1042
+ export const GITHUB_STATUS_ERRORED_EVENT_SCHEMA: GitHubWebhookSchema<GitHubStatusErroredEvent> =
1043
+ githubSemanticEventSchema<GitHubStatusEvent, GitHubStatusErroredEvent>(
1044
+ GITHUB_STATUS_EVENT_SCHEMA,
1045
+ (event) => event.state === "error",
1046
+ )
689
1047
 
690
1048
  /**
691
1049
  * Narrows a broad GitHub webhook family to one semantic event.
@@ -694,9 +1052,9 @@ function githubEventSchema<TEvent>(schema: z.ZodType): z.ZodType<TEvent> {
694
1052
  * @param matches - Whether the payload belongs to the semantic event.
695
1053
  */
696
1054
  function githubSemanticEventSchema<TEvent, TSemanticEvent extends TEvent>(
697
- schema: z.ZodType<TEvent>,
1055
+ schema: GitHubWebhookSchema<TEvent>,
698
1056
  matches: (event: TEvent) => boolean,
699
- ): z.ZodType<TSemanticEvent> {
1057
+ ): GitHubWebhookSchema<TSemanticEvent> {
700
1058
  return z.custom<TSemanticEvent>((value) => {
701
1059
  const event = schema.safeParse(value)
702
1060
  return event.success && matches(event.data)