@octokit/request
Advanced tools
Comparing version 5.4.11 to 5.4.12
@@ -13,3 +13,3 @@ 'use strict'; | ||
const VERSION = "5.4.11"; | ||
const VERSION = "5.4.12"; | ||
@@ -16,0 +16,0 @@ function getBufferResponse(response) { |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "5.4.11"; | ||
export const VERSION = "5.4.12"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "5.4.11"; | ||
export declare const VERSION = "5.4.12"; |
@@ -7,3 +7,3 @@ import { endpoint } from '@octokit/endpoint'; | ||
const VERSION = "5.4.11"; | ||
const VERSION = "5.4.12"; | ||
@@ -10,0 +10,0 @@ function getBufferResponse(response) { |
{ | ||
"name": "@octokit/request", | ||
"description": "Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node", | ||
"version": "5.4.11", | ||
"version": "5.4.12", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "files": [ | ||
"@octokit/request-error": "^2.0.0", | ||
"@octokit/types": "^6.0.0", | ||
"@octokit/types": "^6.0.3", | ||
"deprecation": "^2.0.0", | ||
@@ -32,0 +32,0 @@ "is-plain-object": "^5.0.0", |
@@ -41,3 +41,3 @@ # request.js | ||
```js | ||
request("POST /repos/:owner/:repo/issues/:number/labels", { | ||
request("POST /repos/{owner}/{repo}/issues/{number}/labels", { | ||
mediaType: { | ||
@@ -103,3 +103,3 @@ previews: ["symmetra"], | ||
// https://developer.github.com/v3/repos/#list-organization-repositories | ||
const result = await request("GET /orgs/:org/repos", { | ||
const result = await request("GET /orgs/{org}/repos", { | ||
headers: { | ||
@@ -144,3 +144,3 @@ authorization: "token 0000000000000000000000000000000000000001", | ||
method: "GET", | ||
url: "/orgs/:org/repos", | ||
url: "/orgs/{org}/repos", | ||
headers: { | ||
@@ -186,7 +186,10 @@ authorization: "token 0000000000000000000000000000000000000001", | ||
const { data: app } = await requestWithAuth("GET /app"); | ||
const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { | ||
owner: "octocat", | ||
repo: "hello-world", | ||
title: "Hello from the engine room", | ||
}); | ||
const { data: app } = await requestWithAuth( | ||
"POST /repos/{owner}/{repo}/issues", | ||
{ | ||
owner: "octocat", | ||
repo: "hello-world", | ||
title: "Hello from the engine room", | ||
} | ||
); | ||
``` | ||
@@ -222,3 +225,3 @@ | ||
<td> | ||
If <code>route</code> is set it has to be a string consisting of the request method and URL, e.g. <code>GET /orgs/:org</code> | ||
If <code>route</code> is set it has to be a string consisting of the request method and URL, e.g. <code>GET /orgs/{org}</code> | ||
</td> | ||
@@ -291,3 +294,3 @@ </tr> | ||
<strong>Required.</strong> A path or full URL which may contain <code>:variable</code> or <code>{variable}</code> placeholders, | ||
e.g. <code>/orgs/:org/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>. | ||
e.g. <code>/orgs/{org}/repos</code>. The <code>url</code> is parsed using <a href="https://github.com/bramstein/url-template">url-template</a>. | ||
</td> | ||
@@ -365,3 +368,3 @@ </tr> | ||
1. If the option key is a placeholder in the `url`, it will be used as replacement. For example, if the passed options are `{url: '/orgs/:org/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos` | ||
1. If the option key is a placeholder in the `url`, it will be used as replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos` | ||
2. If the `method` is `GET` or `HEAD`, the option is passed as query parameter | ||
@@ -431,3 +434,3 @@ 3. Otherwise the parameter is passed in the request body as JSON key. | ||
myrequest(`GET /orgs/:org/repos`); | ||
myrequest(`GET /orgs/{org}/repos`); | ||
``` | ||
@@ -461,3 +464,3 @@ | ||
```js | ||
const options = request.endpoint("GET /orgs/:org/repos", { | ||
const options = request.endpoint("GET /orgs/{org}/repos", { | ||
org: "my-project", | ||
@@ -464,0 +467,0 @@ type: "private", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50509
542
Updated@octokit/types@^6.0.3