Skip to content

Commit 3159979

Browse files
authored
🏷️ Manually update types for pr:comment:edited (#7)
1 parent 4cdda29 commit 3159979

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

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

+45-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1+
import type {
2+
SchemaApplicationUser,
3+
SchemaProject,
4+
SchemaPullRequestParticipant,
5+
SchemaRepository,
6+
SchemaRestMinimalRef,
7+
} from "../../../openapi/openapi-typescript.js"
8+
19
export interface Actor {
210
readonly active: boolean
311
readonly displayName: string
412
readonly emailAddress: string
513
readonly id: number
14+
readonly links: ActorLinks
615
readonly name: string
716
readonly slug: string
8-
readonly type: string
17+
readonly type: SchemaApplicationUser["type"]
18+
}
19+
20+
export interface ActorLinks {
21+
readonly self: Self[]
922
}
1023

1124
export interface Author {
1225
readonly approved: boolean
13-
readonly role: string
14-
readonly status: string
26+
readonly role: SchemaPullRequestParticipant["role"]
27+
readonly status: SchemaPullRequestParticipant["status"]
1528
readonly user: Actor
1629
}
1730

31+
export interface Clone {
32+
readonly href: string
33+
readonly name: string
34+
}
35+
1836
export interface Comment {
1937
readonly author: Actor
2038
readonly comments: unknown[]
2139
readonly createdDate: number
2240
readonly id: number
2341
readonly properties: Properties
24-
readonly tasks: unknown[]
42+
readonly severity: string
43+
readonly state: string
2544
readonly text: string
45+
readonly threadResolved: boolean
46+
readonly threadResolvedDate: number
47+
readonly threadResolver: Actor
2648
readonly updatedDate: number
2749
readonly version: number
2850
}
@@ -34,7 +56,7 @@ export interface PRCommentEdited {
3456
/** The comment edited. */
3557
readonly comment: Comment
3658
/** Id of the parent comment if one exists. */
37-
readonly commentParentId: number
59+
readonly commentParentId?: number
3860
readonly date: string
3961
readonly eventKey: "pr:comment:edited"
4062
/** Text of the previous comment. */
@@ -46,9 +68,10 @@ export interface PRCommentEdited {
4668
export interface Project {
4769
readonly id: number
4870
readonly key: string
71+
readonly links: ActorLinks
4972
readonly name: string
5073
readonly public: boolean
51-
readonly type: string
74+
readonly type: SchemaProject["type"]
5275
}
5376

5477
export interface Properties {
@@ -59,9 +82,11 @@ export interface PullRequest {
5982
readonly author: Author
6083
readonly closed: boolean
6184
readonly createdDate: number
85+
readonly description: string
6286
readonly draft: boolean
6387
readonly fromRef: Ref
6488
readonly id: number
89+
readonly links: ActorLinks
6590
readonly locked: boolean
6691
readonly open: boolean
6792
readonly participants: unknown[]
@@ -78,16 +103,29 @@ export interface Ref {
78103
readonly id: string
79104
readonly latestCommit: string
80105
readonly repository: Repository
106+
readonly type: SchemaRestMinimalRef["type"]
81107
}
82108

83109
export interface Repository {
110+
readonly archived: boolean
84111
readonly forkable: boolean
112+
readonly hierarchyId: string
85113
readonly id: number
114+
readonly links: RepositoryLinks
86115
readonly name: string
87116
readonly project: Project
88117
readonly public: boolean
89118
readonly scmId: string
90119
readonly slug: string
91-
readonly state: string
120+
readonly state: SchemaRepository["state"]
92121
readonly statusMessage: string
93122
}
123+
124+
export interface RepositoryLinks {
125+
readonly clone: Clone[]
126+
readonly self: Self[]
127+
}
128+
129+
export interface Self {
130+
readonly href: string
131+
}

0 commit comments

Comments
 (0)