UNPKG

34.4 kBJavaScriptView Raw
1module.exports = [
2 /**
3 * .repos.getCommitRefSha() is a separate endpoint. It has meanwhile been
4 * removed from https://developer.github.com/v3/repos/commits/. The workaround
5 * can be removed with the next breaking version of @octokit/rest
6 */
7 {
8 name: "Get a commit sha",
9 isDeprecated: true,
10 scope: "repos",
11 id: "getCommitRefSha",
12 deprecated:
13 '"Get the SHA-1 of a commit reference" will be removed. Use "Get a single commit" with media type format set to "sha" instead.',
14 method: "GET",
15 url: "/repos/{owner}/{repo}/commits/{ref}",
16 previews: [],
17 description:
18 "**Note:** To access this endpoint, you must provide a custom [media type](https://developer.github.com/v3/media) in the `Accept` header:\n```\napplication/vnd.github.VERSION.sha\n```\nReturns the SHA-1 of the commit reference. You must have `read` access for the repository to get the SHA-1 of a commit reference. You can use this endpoint to check if a remote reference's SHA-1 is the same as your local reference's SHA-1 by providing the local SHA-1 reference as the ETag.",
19 documentationUrl:
20 "https://developer.github.com/v3/repos/commits/#get-a-single-commit",
21 headers: [
22 {
23 name: "accept",
24 value: "application/vnd.github.v3.sha"
25 }
26 ],
27 parameters: [
28 {
29 name: "owner",
30 description: "owner parameter",
31 in: "PATH",
32 type: "string",
33 required: true
34 },
35 {
36 name: "ref",
37 description: "ref parameter",
38 in: "PATH",
39 type: "string",
40 required: true
41 },
42 {
43 name: "repo",
44 description: "repo parameter",
45 in: "PATH",
46 type: "string",
47 required: true
48 }
49 ],
50 responses: []
51 },
52
53 /**
54 * `.git.listRefs` is currently not included in the OpenAPI Spec at https://github.com/octokit/routes
55 * because the path `/repos/{owner}/{repo}/git/refs/{namespace}` is conflicting with
56 * `/repos/{owner}/{repo}/git/refs/{ref}` from `.git.getRef`.
57 *
58 * Two new endpoints are being created to remove the path conflict (2019-10-01)
59 */
60 {
61 name: "Get all references",
62 scope: "git",
63 id: "listRefs",
64 method: "GET",
65 url: "/repos/{owner}/{repo}/git/refs/{namespace}",
66 previews: [],
67 description:
68 "Returns an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. If there are no references to list, a `404` is returned.",
69 documentationUrl:
70 "https://developer.github.com/v3/git/refs/#get-all-references",
71 headers: [],
72 parameters: [
73 {
74 name: "owner",
75 description: "owner parameter",
76 in: "PATH",
77 type: "string",
78 required: true
79 },
80 {
81 name: "repo",
82 description: "repo parameter",
83 in: "PATH",
84 type: "string",
85 required: true
86 },
87 {
88 name: "namespace",
89 description: "namespace parameter",
90 in: "PATH",
91 type: "string"
92 },
93 {
94 name: "per_page",
95 description: "Results per page (max 100)",
96 in: "QUERY",
97 type: "integer"
98 },
99 {
100 name: "page",
101 description: "Page number of the results to fetch.",
102 in: "QUERY",
103 type: "integer"
104 }
105 ],
106 responses: []
107 },
108
109 /**
110 * This overrides the specification from https://github.com/octokit/routes.
111 * The path has recently been changed from
112 *
113 * /repos/{owner}/{repo}/labels/{current_name}
114 *
115 * to
116 *
117 * /repos/{owner}/{repo}/labels/{name}
118 *
119 * In order to remove a conflict with `/repos/{owner}/{repo}/labels/{name}` from `issues.getLabel`.
120 *
121 * This cannot be easily addressed with a migration, because the parameter renames are conflicting
122 *
123 * current_name -> name (in path)
124 * name -> new_name (in body)
125 *
126 * This workaround should be removed with the next breaking version of `@octokit/rest`
127 */
128 {
129 name: "Update a label",
130 scope: "issues",
131 id: "updateLabel",
132 method: "PATCH",
133 url: "/repos/{owner}/{repo}/labels/{current_name}",
134 previews: [],
135 description: "",
136 documentationUrl:
137 "https://developer.github.com/v3/issues/labels/#update-a-label",
138 headers: [],
139 parameters: [
140 {
141 name: "owner",
142 description: "owner parameter",
143 in: "PATH",
144 type: "string",
145 required: true
146 },
147 {
148 name: "repo",
149 description: "repo parameter",
150 in: "PATH",
151 type: "string",
152 required: true
153 },
154 {
155 name: "current_name",
156 description: "current_name parameter",
157 in: "PATH",
158 type: "string",
159 required: true
160 },
161 {
162 name: "color",
163 description:
164 "The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`.",
165 in: "BODY",
166 type: "string"
167 },
168 {
169 name: "name",
170 description: "",
171 type: "string",
172 in: "BODY"
173 },
174 {
175 name: "description",
176 description: "A short description of the label.",
177 type: "string",
178 in: "BODY"
179 }
180 ],
181 responses: [
182 {
183 code: 201,
184 description: "response",
185 examples: [
186 {
187 data: JSON.stringify({
188 id: 208045946,
189 node_id: "MDU6TGFiZWwyMDgwNDU5NDY=",
190 url:
191 "https://api.github.com/repos/octocat/Hello-World/labels/bug%20:bug:",
192 name: "bug :bug:",
193 description: "Small bug fix required",
194 color: "b01f26",
195 default: true
196 })
197 }
198 ]
199 }
200 ]
201 },
202
203 /**
204 * The `.pulls.createFromIssue()` method is deprecated altogether and should no longer be used.
205 * It will be removed with the next breaking verion of `@octokit/rest`
206 */
207 {
208 name: "Create from issue",
209 isDeprecated: true,
210 scope: "pulls",
211 id: "createFromIssue",
212 method: "POST",
213 url: "/repos/:owner/:repo/pulls",
214 previews: [],
215 description: "",
216 documentationUrl:
217 "https://developer.github.com/v3/pulls/#create-a-pull-request",
218 headers: [],
219 parameters: [
220 {
221 name: "owner",
222 description: "owner parameter",
223 in: "PATH",
224 type: "string",
225 required: true
226 },
227 {
228 name: "repo",
229 description: "repo parameter",
230 in: "PATH",
231 type: "string",
232 required: true
233 },
234 {
235 name: "base",
236 descripion: "",
237 in: "BODY",
238 required: true,
239 type: "string"
240 },
241 {
242 name: "head",
243 descripion: "",
244 in: "BODY",
245 required: true,
246 type: "string"
247 },
248 {
249 name: "issue",
250 descripion: "",
251 in: "BODY",
252 required: true,
253 type: "integer"
254 },
255 {
256 name: "maintainer_can_modify",
257 descripion: "",
258 in: "BODY",
259 type: "boolean"
260 },
261 {
262 name: "owner",
263 descripion: "",
264 in: "BODY",
265 required: true,
266 type: "string"
267 },
268 {
269 name: "repo",
270 descripion: "",
271 in: "BODY",
272 required: true,
273 type: "string"
274 }
275 ],
276 responses: [
277 {
278 code: 201,
279 description: "response",
280 examples: [
281 {
282 data:
283 '{"url":"https://api.github.com/repos/octocat/Hello-World/pulls/1347","id":1,"node_id":"MDExOlB1bGxSZXF1ZXN0MQ==","html_url":"https://github.com/octocat/Hello-World/pull/1347","diff_url":"https://github.com/octocat/Hello-World/pull/1347.diff","patch_url":"https://github.com/octocat/Hello-World/pull/1347.patch","issue_url":"https://api.github.com/repos/octocat/Hello-World/issues/1347","commits_url":"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits","review_comments_url":"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments","review_comment_url":"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}","comments_url":"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments","statuses_url":"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e","number":1347,"state":"open","locked":true,"title":"Amazing new feature","user":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"body":"Please pull these awesome changes in!","labels":[{"id":208045946,"node_id":"MDU6TGFiZWwyMDgwNDU5NDY=","url":"https://api.github.com/repos/octocat/Hello-World/labels/bug","name":"bug","description":"Something isn\'t working","color":"f29513","default":true}],"milestone":{"url":"https://api.github.com/repos/octocat/Hello-World/milestones/1","html_url":"https://github.com/octocat/Hello-World/milestones/v1.0","labels_url":"https://api.github.com/repos/octocat/Hello-World/milestones/1/labels","id":1002604,"node_id":"MDk6TWlsZXN0b25lMTAwMjYwNA==","number":1,"state":"open","title":"v1.0","description":"Tracking milestone for version 1.0","creator":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":8,"created_at":"2011-04-10T20:09:31Z","updated_at":"2014-03-03T18:58:10Z","closed_at":"2013-02-12T13:22:01Z","due_on":"2012-10-09T23:39:01Z"},"active_lock_reason":"too heated","created_at":"2011-01-26T19:01:12Z","updated_at":"2011-01-26T19:01:12Z","closed_at":"2011-01-26T19:01:12Z","merged_at":"2011-01-26T19:01:12Z","merge_commit_sha":"e5bd3914e2e596debea16f433f57875b5b90bcd6","assignee":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"assignees":[{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},{"login":"hubot","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/hubot_happy.gif","gravatar_id":"","url":"https://api.github.com/users/hubot","html_url":"https://github.com/hubot","followers_url":"https://api.github.com/users/hubot/followers","following_url":"https://api.github.com/users/hubot/following{/other_user}","gists_url":"https://api.github.com/users/hubot/gists{/gist_id}","starred_url":"https://api.github.com/users/hubot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubot/subscriptions","organizations_url":"https://api.github.com/users/hubot/orgs","repos_url":"https://api.github.com/users/hubot/repos","events_url":"https://api.github.com/users/hubot/events{/privacy}","received_events_url":"https://api.github.com/users/hubot/received_events","type":"User","site_admin":true}],"requested_reviewers":[{"login":"other_user","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/other_user_happy.gif","gravatar_id":"","url":"https://api.github.com/users/other_user","html_url":"https://github.com/other_user","followers_url":"https://api.github.com/users/other_user/followers","following_url":"https://api.github.com/users/other_user/following{/other_user}","gists_url":"https://api.github.com/users/other_user/gists{/gist_id}","starred_url":"https://api.github.com/users/other_user/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/other_user/subscriptions","organizations_url":"https://api.github.com/users/other_user/orgs","repos_url":"https://api.github.com/users/other_user/repos","events_url":"https://api.github.com/users/other_user/events{/privacy}","received_events_url":"https://api.github.com/users/other_user/received_events","type":"User","site_admin":false}],"requested_teams":[{"id":1,"node_id":"MDQ6VGVhbTE=","url":"https://api.github.com/teams/1","html_url":"https://api.github.com/teams/justice-league","name":"Justice League","slug":"justice-league","description":"A great team.","privacy":"closed","permission":"admin","members_url":"https://api.github.com/teams/1/members{/member}","repositories_url":"https://api.github.com/teams/1/repos","parent":null}],"head":{"label":"octocat:new-topic","ref":"new-topic","sha":"6dcb09b5b57875f334f61aebed695e2e4193db5e","user":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"repo":{"id":1296269,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk2MjY5","name":"Hello-World","full_name":"octocat/Hello-World","owner":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/octocat/Hello-World","description":"This your first repo!","fork":false,"url":"https://api.github.com/repos/octocat/Hello-World","archive_url":"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}","assignees_url":"http://api.github.com/repos/octocat/Hello-World/assignees{/user}","blobs_url":"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}","branches_url":"http://api.github.com/repos/octocat/Hello-World/branches{/branch}","collaborators_url":"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}","comments_url":"http://api.github.com/repos/octocat/Hello-World/comments{/number}","commits_url":"http://api.github.com/repos/octocat/Hello-World/commits{/sha}","compare_url":"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}","contents_url":"http://api.github.com/repos/octocat/Hello-World/contents/{+path}","contributors_url":"http://api.github.com/repos/octocat/Hello-World/contributors","deployments_url":"http://api.github.com/repos/octocat/Hello-World/deployments","downloads_url":"http://api.github.com/repos/octocat/Hello-World/downloads","events_url":"http://api.github.com/repos/octocat/Hello-World/events","forks_url":"http://api.github.com/repos/octocat/Hello-World/forks","git_commits_url":"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}","git_refs_url":"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}","git_tags_url":"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}","git_url":"git:github.com/octocat/Hello-World.git","issue_comment_url":"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}","issue_events_url":"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}","issues_url":"http://api.github.com/repos/octocat/Hello-World/issues{/number}","keys_url":"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}","labels_url":"http://api.github.com/repos/octocat/Hello-World/labels{/name}","languages_url":"http://api.github.com/repos/octocat/Hello-World/languages","merges_url":"http://api.github.com/repos/octocat/Hello-World/merges","milestones_url":"http://api.github.com/repos/octocat/Hello-World/milestones{/number}","notifications_url":"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}","pulls_url":"http://api.github.com/repos/octocat/Hello-World/pulls{/number}","releases_url":"http://api.github.com/repos/octocat/Hello-World/releases{/id}","ssh_url":"git@github.com:octocat/Hello-World.git","stargazers_url":"http://api.github.com/repos/octocat/Hello-World/stargazers","statuses_url":"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}","subscribers_url":"http://api.github.com/repos/octocat/Hello-World/subscribers","subscription_url":"http://api.github.com/repos/octocat/Hello-World/subscription","tags_url":"http://api.github.com/repos/octocat/Hello-World/tags","teams_url":"http://api.github.com/repos/octocat/Hello-World/teams","trees_url":"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}","clone_url":"https://github.com/octocat/Hello-World.git","mirror_url":"git:git.example.com/octocat/Hello-World","hooks_url":"http://api.github.com/repos/octocat/Hello-World/hooks","svn_url":"https://svn.github.com/octocat/Hello-World","homepage":"https://github.com","language":null,"forks_count":9,"stargazers_count":80,"watchers_count":80,"size":108,"default_branch":"master","open_issues_count":0,"is_template":true,"topics":["octocat","atom","electron","api"],"has_issues":true,"has_projects":true,"has_wiki":true,"has_pages":false,"has_downloads":true,"archived":false,"disabled":false,"pushed_at":"2011-01-26T19:06:43Z","created_at":"2011-01-26T19:01:12Z","updated_at":"2011-01-26T19:14:43Z","permissions":{"admin":false,"push":false,"pull":true},"allow_rebase_merge":true,"template_repository":null,"allow_squash_merge":true,"allow_merge_commit":true,"subscribers_count":42,"network_count":0}},"base":{"label":"octocat:master","ref":"master","sha":"6dcb09b5b57875f334f61aebed695e2e4193db5e","user":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"repo":{"id":1296269,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk2MjY5","name":"Hello-World","full_name":"octocat/Hello-World","owner":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/octocat/Hello-World","description":"This your first repo!","fork":false,"url":"https://api.github.com/repos/octocat/Hello-World","archive_url":"http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}","assignees_url":"http://api.github.com/repos/octocat/Hello-World/assignees{/user}","blobs_url":"http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}","branches_url":"http://api.github.com/repos/octocat/Hello-World/branches{/branch}","collaborators_url":"http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}","comments_url":"http://api.github.com/repos/octocat/Hello-World/comments{/number}","commits_url":"http://api.github.com/repos/octocat/Hello-World/commits{/sha}","compare_url":"http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}","contents_url":"http://api.github.com/repos/octocat/Hello-World/contents/{+path}","contributors_url":"http://api.github.com/repos/octocat/Hello-World/contributors","deployments_url":"http://api.github.com/repos/octocat/Hello-World/deployments","downloads_url":"http://api.github.com/repos/octocat/Hello-World/downloads","events_url":"http://api.github.com/repos/octocat/Hello-World/events","forks_url":"http://api.github.com/repos/octocat/Hello-World/forks","git_commits_url":"http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}","git_refs_url":"http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}","git_tags_url":"http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}","git_url":"git:github.com/octocat/Hello-World.git","issue_comment_url":"http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}","issue_events_url":"http://api.github.com/repos/octocat/Hello-World/issues/events{/number}","issues_url":"http://api.github.com/repos/octocat/Hello-World/issues{/number}","keys_url":"http://api.github.com/repos/octocat/Hello-World/keys{/key_id}","labels_url":"http://api.github.com/repos/octocat/Hello-World/labels{/name}","languages_url":"http://api.github.com/repos/octocat/Hello-World/languages","merges_url":"http://api.github.com/repos/octocat/Hello-World/merges","milestones_url":"http://api.github.com/repos/octocat/Hello-World/milestones{/number}","notifications_url":"http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}","pulls_url":"http://api.github.com/repos/octocat/Hello-World/pulls{/number}","releases_url":"http://api.github.com/repos/octocat/Hello-World/releases{/id}","ssh_url":"git@github.com:octocat/Hello-World.git","stargazers_url":"http://api.github.com/repos/octocat/Hello-World/stargazers","statuses_url":"http://api.github.com/repos/octocat/Hello-World/statuses/{sha}","subscribers_url":"http://api.github.com/repos/octocat/Hello-World/subscribers","subscription_url":"http://api.github.com/repos/octocat/Hello-World/subscription","tags_url":"http://api.github.com/repos/octocat/Hello-World/tags","teams_url":"http://api.github.com/repos/octocat/Hello-World/teams","trees_url":"http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}","clone_url":"https://github.com/octocat/Hello-World.git","mirror_url":"git:git.example.com/octocat/Hello-World","hooks_url":"http://api.github.com/repos/octocat/Hello-World/hooks","svn_url":"https://svn.github.com/octocat/Hello-World","homepage":"https://github.com","language":null,"forks_count":9,"stargazers_count":80,"watchers_count":80,"size":108,"default_branch":"master","open_issues_count":0,"is_template":true,"topics":["octocat","atom","electron","api"],"has_issues":true,"has_projects":true,"has_wiki":true,"has_pages":false,"has_downloads":true,"archived":false,"disabled":false,"pushed_at":"2011-01-26T19:06:43Z","created_at":"2011-01-26T19:01:12Z","updated_at":"2011-01-26T19:14:43Z","permissions":{"admin":false,"push":false,"pull":true},"allow_rebase_merge":true,"template_repository":null,"allow_squash_merge":true,"allow_merge_commit":true,"subscribers_count":42,"network_count":0}},"_links":{"self":{"href":"https://api.github.com/repos/octocat/Hello-World/pulls/1347"},"html":{"href":"https://github.com/octocat/Hello-World/pull/1347"},"issue":{"href":"https://api.github.com/repos/octocat/Hello-World/issues/1347"},"comments":{"href":"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments"},"review_comments":{"href":"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments"},"review_comment":{"href":"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits"},"statuses":{"href":"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e"}},"author_association":"OWNER","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":{"login":"octocat","id":1,"node_id":"MDQ6VXNlcjE=","avatar_url":"https://github.com/images/error/octocat_happy.gif","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","site_admin":false},"comments":10,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":100,"deletions":3,"changed_files":5}'
284 }
285 ]
286 }
287 ]
288 },
289
290 /**
291 * The path of "Upload a release asset" has recently changed to
292 *
293 * :server/repos/:owner/:repo/releases/:release_id/assets{?name,label}
294 *
295 * We do not currently handle the `:server` parameter. It should be `baseUrl` in our case.
296 * We might keep this workaround permanently, but might simplify it. As we really just want
297 * edit `url` and `parameters`, but leaving the remaining fields intact.
298 */
299 {
300 name: "Upload a release asset",
301 scope: "repos",
302 id: "uploadReleaseAsset",
303 method: "POST",
304 url: "{url}",
305 previews: [],
306 description: `This endpoint makes use of [a Hypermedia relation](https://developer.github.com/v3/#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the \`upload_url\` returned in the response of the [Create a release endpoint](https://developer.github.com/v3/repos/releases/#create-a-release) to upload a release asset.
307
308 You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.
309
310 Most libraries will set the required \`Content-Length\` header automatically. Use the required \`Content-Type\` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example:
311
312 \`application/zip\`
313
314 GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset.`,
315 documentationUrl:
316 "https://developer.github.com/v3/repos/releases/#upload-a-release-asset",
317 headers: [],
318 parameters: [
319 {
320 name: "file",
321 in: "BODY",
322 mapToData: true,
323 required: true,
324 type: "string | object"
325 },
326 {
327 name: "headers",
328 in: "BODY",
329 required: true,
330 type: "object"
331 },
332 {
333 name: "headers.content-length",
334 in: "HEADER",
335 required: true,
336 type: "integer"
337 },
338 {
339 name: "headers.content-type",
340 in: "HEADER",
341 required: true,
342 type: "string"
343 },
344 {
345 name: "label",
346 in: "QUERY",
347 type: "string",
348 description: `An alternate short description of the asset. Used in place of the filename. This should be set in a URI query parameter.`
349 },
350 {
351 name: "name",
352 in: "QUERY",
353 required: true,
354 type: "string",
355 description: `The file name of the asset. This should be set in a URI query parameter.`
356 },
357 {
358 name: "url",
359 in: "PATH",
360 required: true,
361 type: "string",
362 description:
363 "The `upload_url` key returned from creating or getting a release"
364 }
365 ],
366 responses: [
367 {
368 code: 201,
369 description: "",
370 examples: [
371 {
372 data: JSON.stringify({
373 url:
374 "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
375 browser_download_url:
376 "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
377 id: 1,
378 node_id: "MDEyOlJlbGVhc2VBc3NldDE=",
379 name: "example.zip",
380 label: "short description",
381 state: "uploaded",
382 content_type: "application/zip",
383 size: 1024,
384 download_count: 42,
385 created_at: "2013-02-27T19:35:32Z",
386 updated_at: "2013-02-27T19:35:32Z",
387 uploader: {
388 login: "octocat",
389 id: 1,
390 node_id: "MDQ6VXNlcjE=",
391 avatar_url: "https://github.com/images/error/octocat_happy.gif",
392 gravatar_id: "",
393 url: "https://api.github.com/users/octocat",
394 html_url: "https://github.com/octocat",
395 followers_url: "https://api.github.com/users/octocat/followers",
396 following_url:
397 "https://api.github.com/users/octocat/following{/other_user}",
398 gists_url:
399 "https://api.github.com/users/octocat/gists{/gist_id}",
400 starred_url:
401 "https://api.github.com/users/octocat/starred{/owner}{/repo}",
402 subscriptions_url:
403 "https://api.github.com/users/octocat/subscriptions",
404 organizations_url: "https://api.github.com/users/octocat/orgs",
405 repos_url: "https://api.github.com/users/octocat/repos",
406 events_url:
407 "https://api.github.com/users/octocat/events{/privacy}",
408 received_events_url:
409 "https://api.github.com/users/octocat/received_events",
410 type: "User",
411 site_admin: false
412 }
413 })
414 }
415 ]
416 }
417 ]
418 }
419];