diff options
| author | Frank <[email protected]> | 2025-07-13 23:59:25 +0800 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-07-13 23:59:25 +0800 |
| commit | 7361a02ef33c8e5831b72bde8d958e654f57ab96 (patch) | |
| tree | 1d975835aed9202d0cb7151ad7c2fe9c84d69cf9 /sdks/github/src/types.ts | |
| parent | d465f150fc418ca47b2e63558a31274ea14621b5 (diff) | |
| download | opencode-7361a02ef33c8e5831b72bde8d958e654f57ab96.tar.gz opencode-7361a02ef33c8e5831b72bde8d958e654f57ab96.zip | |
wip: github actions
Diffstat (limited to 'sdks/github/src/types.ts')
| -rw-r--r-- | sdks/github/src/types.ts | 103 |
1 files changed, 103 insertions, 0 deletions
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; + }; +}; |
