forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
97 lines (89 loc) · 1.84 KB
/
types.ts
File metadata and controls
97 lines (89 loc) · 1.84 KB
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
export interface Operation {
verb: string
title: string
descriptionHTML: string
previews: Array<string>
requestPath: string
serverUrl: string
statusCodes: Array<StatusCode>
parameters: Array<Parameter>
bodyParameters: Array<BodyParameter>
category: string
subcategory: string
enabledForGitHubApps: boolean
codeExamples: Array<CodeSample>
}
export interface Parameter {
exampleName?: string
in: string
name: string
description: string
required: boolean
schema: {
type: string
default?: string
enum?: Array<string>
}
}
export interface StatusCode {
description: string
httpStatusCode: string
httpStatusMessage: string
}
export interface CodeSample {
key: string
response: {
contentType: string
description: string
example: Record<string, string>
statusCode: string
}
request: {
contentType: string
acceptHeader: string
bodyParameters: Record<string, string>
parameters: Record<string, string>
description: string
}
}
export interface BodyParameter {
in: string
name: string
description: string
type: string
isRequired?: boolean
default?: string
enum?: Array<string>
childParamsGroups?: Array<ChildParameter>
}
export interface ChildParameter {
name: string
description: string
type: string
isRequired?: boolean
enum?: Array<string>
default?: string
childParamsGroups?: ChildParameter[]
}
export type ExampleT = {
description: string
[CodeSampleKeys.curl]?: string
[CodeSampleKeys.javascript]?: string
[CodeSampleKeys.ghcli]?: string
response: {
statusCode: string
contentType?: string
description: string
example?: Object
schema?: Object
}
}
export enum ResponseKeys {
example = 'example',
schema = 'schema',
}
export enum CodeSampleKeys {
curl = 'curl',
javascript = 'javascript',
ghcli = 'ghcli',
}