-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
101 lines (92 loc) · 2.38 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { Endpoints } from "@octokit/types";
import { Octokit } from "octokit";
export default function main(octokit: Octokit): Promise<void>;
export type SourceFilesColumnKeys = [
"owner_id",
"owner_login",
"repo_id",
"repo_name",
"path",
"last_commit_sha",
"last_updated_at",
"last_file_sha"
];
export type SourceFile = {
owner: string;
ownerId: number;
repo: string;
repoId: number;
path: string;
lastCommitSha?: string;
lastUpdatedAt?: string;
lastFileSha?: string;
};
export type DatabaseColumnKeys = [
"seq",
"owner_id",
"owner_login",
"repo_id",
"repo_name",
"creator_user_id",
"creator_user_login",
"recipient_user_id",
"recipient_user_login",
"type",
"created_at",
"source_context_url"
];
export type DatabaseColumns = {
/* GitHub repository owner ID */
owner_id: number;
/* GitHub repository owner ID */
owner_login: string;
/* GitHub repository ID */
repo_id: number;
/* GitHub string name */
repo_name: string;
/* GitHub user ID of the endorsing user */
creator_user_id: number;
/* GitHub user login of the endorsing user */
creator_user_login: string;
/* GitHub user ID of the endorsed user */
recipient_user_id: number;
/* GitHub user login of the endorsed user */
recipient_user_login: string;
/* Timestamp of when the endorsement was created */
created_at: string;
/* emoji key, see https://allcontributors.org/docs/en/emoji-key */
type: string;
/* URL to the context of the comment that initiated the endorsement. E.g. a comment URL or a commit URL */
source_context_url: string;
};
export type Commit = {
createdAt: string;
sha: string;
url: string;
pullRequestUrl?: string;
creatorId: number;
creatorLogin: string;
repoId: number;
};
export type CommitMapFn = (
response: Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]
) => Commit[];
export type CommitWithContributors = Commit & {
contributors: Contributors;
};
export type CommitWithEndorsements = Commit & {
/** array of endorsement types by user login */
endorsements: Endorsements;
};
export type Contributors = Record<string, string[]>;
export type Endorsements = Record<string, string[]>;
export type User = {
id: number;
login: string;
};
export type State = {
userIdByLogin: Record<string, number>;
numEndorsements: number;
knownSourceFiles: Record<string, SourceFile>;
knownEndorsements: Set<string>;
};