Skip to content

Commit 549e813

Browse files
authored
✨ Use a real event to update PRReviewerUpdated (#8)
* ✨ Use a real event to update PRReviewerUpdated * 🏷️ Import some enums
1 parent eeb854b commit 549e813

21 files changed

+160
-56
lines changed

src/server/webhooks/events/pr/comment_added.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type {
22
SchemaApplicationUser,
3+
SchemaComment,
34
SchemaProject,
5+
SchemaPullRequest,
46
SchemaPullRequestParticipant,
57
SchemaRepository,
68
SchemaRestMinimalRef,
@@ -40,7 +42,7 @@ export interface Comment {
4042
readonly id: number
4143
readonly properties: Properties
4244
readonly severity: string
43-
readonly state: string
45+
readonly state: SchemaComment["state"]
4446
readonly tasks?: unknown[]
4547
readonly text: string
4648
readonly threadResolved: boolean
@@ -87,9 +89,9 @@ export interface PullRequest {
8789
readonly links: ActorLinks
8890
readonly locked: boolean
8991
readonly open: boolean
90-
readonly participants: unknown[]
91-
readonly reviewers: unknown[]
92-
readonly state: string
92+
readonly participants: Author[]
93+
readonly reviewers: Author[]
94+
readonly state: SchemaPullRequest["state"]
9395
readonly title: string
9496
readonly toRef: Ref
9597
readonly updatedDate: number

src/server/webhooks/events/pr/comment_deleted.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -58,9 +63,9 @@ export interface PullRequest {
5863
readonly id: number
5964
readonly locked: boolean
6065
readonly open: boolean
61-
readonly participants: unknown[]
62-
readonly reviewers: unknown[]
63-
readonly state: string
66+
readonly participants: Author[]
67+
readonly reviewers: Author[]
68+
readonly state: SchemaPullRequest["state"]
6469
readonly title: string
6570
readonly toRef: Ref
6671
readonly updatedDate: number
@@ -82,6 +87,6 @@ export interface Repository {
8287
readonly public: boolean
8388
readonly scmId: string
8489
readonly slug: string
85-
readonly state: string
90+
readonly state: SchemaRepository["state"]
8691
readonly statusMessage: string
8792
}

src/server/webhooks/events/pr/comment_edited.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type {
22
SchemaApplicationUser,
3+
SchemaComment,
34
SchemaProject,
5+
SchemaPullRequest,
46
SchemaPullRequestParticipant,
57
SchemaRepository,
68
SchemaRestMinimalRef,
@@ -40,7 +42,7 @@ export interface Comment {
4042
readonly id: number
4143
readonly properties: Properties
4244
readonly severity: string
43-
readonly state: string
45+
readonly state: SchemaComment["state"]
4446
readonly text: string
4547
readonly threadResolved: boolean
4648
readonly threadResolvedDate: number
@@ -89,9 +91,9 @@ export interface PullRequest {
8991
readonly links: ActorLinks
9092
readonly locked: boolean
9193
readonly open: boolean
92-
readonly participants: unknown[]
93-
readonly reviewers: unknown[]
94-
readonly state: string
94+
readonly participants: Author[]
95+
readonly reviewers: Author[]
96+
readonly state: SchemaPullRequest["state"]
9597
readonly title: string
9698
readonly toRef: Ref
9799
readonly updatedDate: number

src/server/webhooks/events/pr/declined.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -44,9 +49,9 @@ export interface PullRequest {
4449
readonly id: number
4550
readonly locked: boolean
4651
readonly open: boolean
47-
readonly participants: unknown[]
52+
readonly participants: Author[]
4853
readonly reviewers: Author[]
49-
readonly state: string
54+
readonly state: SchemaPullRequest["state"]
5055
readonly title: string
5156
readonly toRef: Ref
5257
readonly updatedDate: number
@@ -68,6 +73,6 @@ export interface Repository {
6873
readonly public: boolean
6974
readonly scmId: string
7075
readonly slug: string
71-
readonly state: string
76+
readonly state: SchemaRepository["state"]
7277
readonly statusMessage: string
7378
}

src/server/webhooks/events/pr/deleted.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -43,9 +48,9 @@ export interface PullRequest {
4348
readonly id: number
4449
readonly locked: boolean
4550
readonly open: boolean
46-
readonly participants: unknown[]
51+
readonly participants: Author[]
4752
readonly reviewers: Author[]
48-
readonly state: string
53+
readonly state: SchemaPullRequest["state"]
4954
readonly title: string
5055
readonly toRef: Ref
5156
readonly updatedDate: number
@@ -67,6 +72,6 @@ export interface Repository {
6772
readonly public: boolean
6873
readonly scmId: string
6974
readonly slug: string
70-
readonly state: string
75+
readonly state: SchemaRepository["state"]
7176
readonly statusMessage: string
7277
}

src/server/webhooks/events/pr/from_ref_updated.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -55,9 +60,9 @@ export interface PullRequest {
5560
readonly links: ActorLinks
5661
readonly locked: boolean
5762
readonly open: boolean
58-
readonly participants: unknown[]
59-
readonly reviewers: unknown[]
60-
readonly state: string
63+
readonly participants: Author[]
64+
readonly reviewers: Author[]
65+
readonly state: SchemaPullRequest["state"]
6166
readonly title: string
6267
readonly toRef: Ref
6368
readonly updatedDate: number
@@ -81,7 +86,7 @@ export interface Repository {
8186
readonly public: boolean
8287
readonly scmId: string
8388
readonly slug: string
84-
readonly state: string
89+
readonly state: SchemaRepository["state"]
8590
readonly statusMessage: string
8691
}
8792

src/server/webhooks/events/pr/merged.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -55,8 +60,8 @@ export interface PullRequest {
5560
readonly open: boolean
5661
readonly participants: Author[]
5762
readonly properties: Properties
58-
readonly reviewers: unknown[]
59-
readonly state: string
63+
readonly reviewers: Author[]
64+
readonly state: SchemaPullRequest["state"]
6065
readonly title: string
6166
readonly toRef: Ref
6267
readonly updatedDate: number
@@ -78,6 +83,6 @@ export interface Repository {
7883
readonly public: boolean
7984
readonly scmId: string
8085
readonly slug: string
81-
readonly state: string
86+
readonly state: SchemaRepository["state"]
8287
readonly statusMessage: string
8388
}

src/server/webhooks/events/pr/modified.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -57,9 +62,9 @@ export interface PullRequest {
5762
readonly id: number
5863
readonly locked: boolean
5964
readonly open: boolean
60-
readonly participants: unknown[]
65+
readonly participants: Author[]
6166
readonly reviewers: Author[]
62-
readonly state: string
67+
readonly state: SchemaPullRequest["state"]
6368
readonly title: string
6469
readonly toRef: Ref
6570
readonly updatedDate: number
@@ -81,6 +86,6 @@ export interface Repository {
8186
readonly public: boolean
8287
readonly scmId: string
8388
readonly slug: string
84-
readonly state: string
89+
readonly state: SchemaRepository["state"]
8590
readonly statusMessage: string
8691
}

src/server/webhooks/events/pr/opened.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -46,9 +51,9 @@ export interface PullRequest {
4651
readonly links: Links
4752
readonly locked: boolean
4853
readonly open: boolean
49-
readonly participants: unknown[]
50-
readonly reviewers: unknown[]
51-
readonly state: string
54+
readonly participants: Author[]
55+
readonly reviewers: Author[]
56+
readonly state: SchemaPullRequest["state"]
5257
readonly title: string
5358
readonly toRef: Ref
5459
readonly updatedDate: number
@@ -70,6 +75,6 @@ export interface Repository {
7075
readonly public: boolean
7176
readonly scmId: string
7277
readonly slug: string
73-
readonly state: string
78+
readonly state: SchemaRepository["state"]
7479
readonly statusMessage: string
7580
}

src/server/webhooks/events/pr/reviewer_approved.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -54,9 +59,9 @@ export interface PullRequest {
5459
readonly links: Links
5560
readonly locked: boolean
5661
readonly open: boolean
57-
readonly participants: unknown[]
62+
readonly participants: Participant[]
5863
readonly reviewers: Participant[]
59-
readonly state: string
64+
readonly state: SchemaPullRequest["state"]
6065
readonly title: string
6166
readonly toRef: Ref
6267
readonly updatedDate: number
@@ -78,6 +83,6 @@ export interface Repository {
7883
readonly public: boolean
7984
readonly scmId: string
8085
readonly slug: string
81-
readonly state: string
86+
readonly state: SchemaRepository["state"]
8287
readonly statusMessage: string
8388
}

src/server/webhooks/events/pr/reviewer_changes_requested.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -49,9 +54,9 @@ export interface PullRequest {
4954
readonly id: number
5055
readonly locked: boolean
5156
readonly open: boolean
52-
readonly participants: unknown[]
57+
readonly participants: Participant[]
5358
readonly reviewers: Participant[]
54-
readonly state: string
59+
readonly state: SchemaPullRequest["state"]
5560
readonly title: string
5661
readonly toRef: Ref
5762
readonly updatedDate: number
@@ -73,6 +78,6 @@ export interface Repository {
7378
readonly public: boolean
7479
readonly scmId: string
7580
readonly slug: string
76-
readonly state: string
81+
readonly state: SchemaRepository["state"]
7782
readonly statusMessage: string
7883
}

src/server/webhooks/events/pr/reviewer_unapproved.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
import type {
2+
SchemaPullRequest,
3+
SchemaRepository,
4+
} from "../../../openapi/openapi-typescript.js"
5+
16
export interface Actor {
27
readonly active: boolean
38
readonly displayName: string
@@ -49,9 +54,9 @@ export interface PullRequest {
4954
readonly id: number
5055
readonly locked: boolean
5156
readonly open: boolean
52-
readonly participants: unknown[]
57+
readonly participants: Participant[]
5358
readonly reviewers: Participant[]
54-
readonly state: string
59+
readonly state: SchemaPullRequest["state"]
5560
readonly title: string
5661
readonly toRef: Ref
5762
readonly updatedDate: number
@@ -73,6 +78,6 @@ export interface Repository {
7378
readonly public: boolean
7479
readonly scmId: string
7580
readonly slug: string
76-
readonly state: string
81+
readonly state: SchemaRepository["state"]
7782
readonly statusMessage: string
7883
}

0 commit comments

Comments
 (0)