Skip to content

Commit baf1b70

Browse files
authored
Add GitHub API requests that will be mocked (#1626)
1 parent 986749b commit baf1b70

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { Repository } from '../remote-queries/gh-api/repository';
2+
import { VariantAnalysis, VariantAnalysisRepoTask } from '../remote-queries/gh-api/variant-analysis';
3+
4+
// Types that represent requests/responses from the GitHub API
5+
// that we need to mock.
6+
7+
export enum RequestKind {
8+
GetRepo = 'getRepo',
9+
SubmitVariantAnalysis = 'submitVariantAnalysis',
10+
GetVariantAnalysis = 'getVariantAnalysis',
11+
GetVariantAnalysisRepo = 'getVariantAnalysisRepo',
12+
GetVariantAnalysisRepoResult = 'getVariantAnalysisRepoResult',
13+
}
14+
15+
export interface GetRepoRequest {
16+
request: {
17+
kind: RequestKind.GetRepo
18+
},
19+
response: {
20+
status: number,
21+
body: Repository
22+
}
23+
}
24+
25+
export interface GetVariantAnalysisRequest {
26+
request: {
27+
kind: RequestKind.GetVariantAnalysis
28+
},
29+
response: {
30+
status: number,
31+
body: VariantAnalysis
32+
}
33+
}
34+
35+
export interface GetVariantAnalysisRepoRequest {
36+
request: {
37+
kind: RequestKind.GetVariantAnalysisRepo,
38+
repositoryId: number
39+
},
40+
response: {
41+
status: number,
42+
body: VariantAnalysisRepoTask
43+
}
44+
}
45+
46+
export interface GetVariantAnalysisRepoResultRequest {
47+
request: {
48+
kind: RequestKind.GetVariantAnalysisRepoResult,
49+
repositoryId: number
50+
},
51+
response: {
52+
status: number,
53+
body: ArrayBuffer
54+
}
55+
}

0 commit comments

Comments
 (0)