From 7361a02ef33c8e5831b72bde8d958e654f57ab96 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 13 Jul 2025 23:59:25 +0800 Subject: wip: github actions --- sdks/github/src/types.ts | 103 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sdks/github/src/types.ts (limited to 'sdks/github/src/types.ts') diff --git a/sdks/github/src/types.ts b/sdks/github/src/types.ts new file mode 100644 index 000000000..fe0058fbd --- /dev/null +++ b/sdks/github/src/types.ts @@ -0,0 +1,103 @@ +// Types for GitHub GraphQL query responses +export type GitHubAuthor = { + login: string; + name?: string; +}; + +export type GitHubComment = { + id: string; + databaseId: string; + body: string; + author: GitHubAuthor; + createdAt: string; +}; + +export type GitHubReviewComment = GitHubComment & { + path: string; + line: number | null; +}; + +export type GitHubCommit = { + oid: string; + message: string; + author: { + name: string; + email: string; + }; +}; + +export type GitHubFile = { + path: string; + additions: number; + deletions: number; + changeType: string; +}; + +export type GitHubReview = { + id: string; + databaseId: string; + author: GitHubAuthor; + body: string; + state: string; + submittedAt: string; + comments: { + nodes: GitHubReviewComment[]; + }; +}; + +export type GitHubPullRequest = { + title: string; + body: string; + author: GitHubAuthor; + baseRefName: string; + headRefName: string; + headRefOid: string; + createdAt: string; + additions: number; + deletions: number; + state: string; + baseRepository: { + nameWithOwner: string; + }; + headRepository: { + nameWithOwner: string; + }; + commits: { + totalCount: number; + nodes: Array<{ + commit: GitHubCommit; + }>; + }; + files: { + nodes: GitHubFile[]; + }; + comments: { + nodes: GitHubComment[]; + }; + reviews: { + nodes: GitHubReview[]; + }; +}; + +export type GitHubIssue = { + title: string; + body: string; + author: GitHubAuthor; + createdAt: string; + state: string; + comments: { + nodes: GitHubComment[]; + }; +}; + +export type PullRequestQueryResponse = { + repository: { + pullRequest: GitHubPullRequest; + }; +}; + +export type IssueQueryResponse = { + repository: { + issue: GitHubIssue; + }; +}; -- cgit v1.2.3