Skip to content

🏷️ Manually update types for pr:comment:edited #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 45 additions & 7 deletions src/server/webhooks/events/pr/comment_edited.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
import type {
SchemaApplicationUser,
SchemaProject,
SchemaPullRequestParticipant,
SchemaRepository,
SchemaRestMinimalRef,
} from "../../../openapi/openapi-typescript.js"

export interface Actor {
readonly active: boolean
readonly displayName: string
readonly emailAddress: string
readonly id: number
readonly links: ActorLinks
readonly name: string
readonly slug: string
readonly type: string
readonly type: SchemaApplicationUser["type"]
}

export interface ActorLinks {
readonly self: Self[]
}

export interface Author {
readonly approved: boolean
readonly role: string
readonly status: string
readonly role: SchemaPullRequestParticipant["role"]
readonly status: SchemaPullRequestParticipant["status"]
readonly user: Actor
}

export interface Clone {
readonly href: string
readonly name: string
}

export interface Comment {
readonly author: Actor
readonly comments: unknown[]
readonly createdDate: number
readonly id: number
readonly properties: Properties
readonly tasks: unknown[]
readonly severity: string
readonly state: string
readonly text: string
readonly threadResolved: boolean
readonly threadResolvedDate: number
readonly threadResolver: Actor
readonly updatedDate: number
readonly version: number
}
Expand All @@ -34,7 +56,7 @@ export interface PRCommentEdited {
/** The comment edited. */
readonly comment: Comment
/** Id of the parent comment if one exists. */
readonly commentParentId: number
readonly commentParentId?: number
readonly date: string
readonly eventKey: "pr:comment:edited"
/** Text of the previous comment. */
Expand All @@ -46,9 +68,10 @@ export interface PRCommentEdited {
export interface Project {
readonly id: number
readonly key: string
readonly links: ActorLinks
readonly name: string
readonly public: boolean
readonly type: string
readonly type: SchemaProject["type"]
}

export interface Properties {
Expand All @@ -59,9 +82,11 @@ export interface PullRequest {
readonly author: Author
readonly closed: boolean
readonly createdDate: number
readonly description: string
readonly draft: boolean
readonly fromRef: Ref
readonly id: number
readonly links: ActorLinks
readonly locked: boolean
readonly open: boolean
readonly participants: unknown[]
Expand All @@ -78,16 +103,29 @@ export interface Ref {
readonly id: string
readonly latestCommit: string
readonly repository: Repository
readonly type: SchemaRestMinimalRef["type"]
}

export interface Repository {
readonly archived: boolean
readonly forkable: boolean
readonly hierarchyId: string
readonly id: number
readonly links: RepositoryLinks
readonly name: string
readonly project: Project
readonly public: boolean
readonly scmId: string
readonly slug: string
readonly state: string
readonly state: SchemaRepository["state"]
readonly statusMessage: string
}

export interface RepositoryLinks {
readonly clone: Clone[]
readonly self: Self[]
}

export interface Self {
readonly href: string
}