Skip to content
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

Update PR event types #14

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ package-lock.json
.env.*.local
.env.local


### JetBrains ###
.idea

NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,node
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,node

Expand Down
11 changes: 11 additions & 0 deletions src/server/webhooks/events/pr/declined.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ export interface Actor {
readonly name: string
readonly slug: string
readonly type: string
readonly links: ActorLinks
}
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved

export interface ActorLinks {
readonly self: Self[]
}

export interface Self {
readonly href: string
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
}

export interface Author {
Expand Down Expand Up @@ -56,6 +65,8 @@ export interface PullRequest {
readonly toRef: Ref
readonly updatedDate: number
readonly version: number
readonly links: ActorLinks
readonly description: string
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
}

export interface Ref {
Expand Down
2 changes: 1 addition & 1 deletion src/server/webhooks/events/pr/merged.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
SchemaPullRequest,
SchemaRepository,
} from "../../../openapi/openapi-typescript.js"
} from "../../../openapi/index.js"
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved

export interface Actor {
readonly active: boolean
Expand Down
43 changes: 31 additions & 12 deletions src/server/webhooks/events/pr/modified.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
SchemaPullRequest,
SchemaRepository,
} from "../../../openapi/openapi-typescript.js"
} from "../../../openapi/index.js"

export interface Actor {
readonly active: boolean
Expand All @@ -11,6 +11,15 @@ export interface Actor {
readonly name: string
readonly slug: string
readonly type: string
readonly links: ActorLinks
}

export interface ActorLinks {
readonly self: Self[]
}

export interface Self {
readonly href: string
}

export interface Author {
Expand All @@ -29,27 +38,30 @@ export interface PRModified {
readonly previousDescription: string
readonly previousDraft: boolean
/** Previous target of the pull request, may not have changed */
readonly previousTarget: PreviousTarget
readonly previousTarget: Ref
/** Previous title of the pull request, may not have changed */
readonly previousTitle: string
/** Details of the pull request created. */
readonly pullRequest: PullRequest
}

export interface PreviousTarget {
export interface Ref {
readonly displayId: string
readonly id: string
readonly latestChangeset: string
readonly latestChangeset?: string
readonly latestCommit: string
readonly type: string
readonly repository?: Repository
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
}

export interface Project {
readonly id: number
readonly key: string
readonly name: string
readonly owner: Actor
readonly owner?: Actor
readonly type: string
readonly public: boolean
readonly links: ActorLinks
}

export interface PullRequest {
Expand All @@ -69,13 +81,7 @@ export interface PullRequest {
readonly toRef: Ref
readonly updatedDate: number
readonly version: number
}

export interface Ref {
readonly displayId: string
readonly id: string
readonly latestCommit: string
readonly repository: Repository
readonly links: ActorLinks
}

export interface Repository {
Expand All @@ -88,4 +94,17 @@ export interface Repository {
readonly slug: string
readonly state: SchemaRepository["state"]
readonly statusMessage: string
readonly hierarchyId: string
readonly archived: boolean
readonly links: RepositoryLinks
}

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

export interface Clone {
readonly href: string
readonly name: string
}
27 changes: 26 additions & 1 deletion src/server/webhooks/events/pr/opened.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
SchemaPullRequest,
SchemaRepository,
} from "../../../openapi/openapi-typescript.js"
} from "../../../openapi/index.js"

export interface Actor {
readonly active: boolean
Expand All @@ -11,6 +11,15 @@ export interface Actor {
readonly name: string
readonly slug: string
readonly type: string
readonly links: SelfLinks
}

export interface SelfLinks {
readonly self: Self[]
}

export interface Self {
readonly href: string
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
}

export interface Author {
Expand Down Expand Up @@ -39,6 +48,7 @@ export interface Project {
readonly name: string
readonly public: boolean
readonly type: string
readonly links: SelfLinks
}

export interface PullRequest {
Expand All @@ -58,12 +68,14 @@ export interface PullRequest {
readonly toRef: Ref
readonly updatedDate: number
readonly version: number
readonly description: string
}

export interface Ref {
readonly displayId: string
readonly id: string
readonly latestCommit: string
readonly type: string
readonly repository: Repository
}

Expand All @@ -77,4 +89,17 @@ export interface Repository {
readonly slug: string
readonly state: SchemaRepository["state"]
readonly statusMessage: string
readonly hierarchyId: string
readonly archived: boolean
readonly links: RepositoryLinks
}

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

export interface Clone {
readonly href: string
readonly name: string
NatoBoram marked this conversation as resolved.
Show resolved Hide resolved
}