mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-14 14:46:30 +00:00
Add types for GitHub plugin. (#35)
This commit is contained in:
parent
2c083425fb
commit
9878313ef3
43
backend/githubPlugin.js
Normal file
43
backend/githubPlugin.js
Normal file
@ -0,0 +1,43 @@
|
||||
// @flow
|
||||
|
||||
export const GITHUB_PLUGIN_NAME = "sourcecred/github-beta";
|
||||
|
||||
export type NodeType = "PULL_REQUEST" | "ISSUE" | "COMMENT" | "USER";
|
||||
|
||||
export type PullRequestPayload = {
|
||||
title: string,
|
||||
isClosed: boolean,
|
||||
isMerged: boolean,
|
||||
dateCreated: number,
|
||||
dateMerged: ?number,
|
||||
};
|
||||
|
||||
export type IssuePayload = {
|
||||
title: string,
|
||||
isClosed: boolean,
|
||||
dateCreated: number,
|
||||
};
|
||||
|
||||
export type ReviewState = "APPROVED" | "COMMENTED" | "CHANGES_REQUESTED";
|
||||
export type CommentPayload = {
|
||||
body: string,
|
||||
date: number,
|
||||
state: ?ReviewState,
|
||||
};
|
||||
|
||||
export type UserPayload = {
|
||||
githubUserId: number,
|
||||
};
|
||||
|
||||
export type GithubNodePayload = {
|
||||
type: NodeType,
|
||||
subpayload: PullRequestPayload | IssuePayload | CommentPayload | UserPayload,
|
||||
};
|
||||
|
||||
export type EdgeType = "AUTHOR" | "REFERENCE";
|
||||
|
||||
export type AuthorPayload = {
|
||||
// Issue/PR/Comment -> User
|
||||
};
|
||||
|
||||
export type ReferencePayload = {};
|
Loading…
x
Reference in New Issue
Block a user