-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Drop support for NodeJS v14, v16 BREAKING CHANGE: Remove previews support for the REST API BREAKING CHANGE: remove `agent` option from `octokit.request()` BREAKING CHANGE: Replace support for Node.js http(s) Agents with documentation on using fetch dispatchers instead (via `@octokit/request`) BREAKING CHANGE: Remove ability to pass custom request options, except for `method`, `headers`, `body`, `signal` (via @octokit/request) --------- Co-authored-by: Nick Floyd <[email protected]>
- Loading branch information
Showing
5 changed files
with
543 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ The `octokit` package integrates the three main Octokit libraries | |
- [`octokit.rest` endpoint methods](#octokitrest-endpoint-methods) | ||
- [`octokit.request()`](#octokitrequest) | ||
- [Pagination](#pagination) | ||
- [Media Type previews and formats](#media-type-previews-and-formats) | ||
- [Media Type formats](#media-type-formats) | ||
- [Request error handling](#request-error-handling) | ||
- [GraphQL API queries](#graphql-api-queries) | ||
- [Schema previews](#schema-previews) | ||
|
@@ -515,11 +515,9 @@ const issues = await octokit.paginate(octokit.rest.issues.listForRepo, { | |
}); | ||
``` | ||
|
||
#### Media Type previews and formats | ||
#### Media Type formats | ||
|
||
**Note**: The concept of _preview headers_ has been deprecated from REST API endpoints hosted via `api.github.com` but it still exists in GHES (GitHub Enterprise Server) version 3.2 and below. Instead of using _preview headers_ going forward, new features are now being tested using beta previews that users will have to opt-in to. | ||
|
||
Media type previews and formats can be set using `mediaType: { format, previews }` on every request. Required API previews are set automatically on the respective REST API endpoint methods. | ||
Media type formats can be set using `mediaType: { format }` on every request. | ||
|
||
Example: retrieve the raw content of a `package.json` file | ||
|
||
|
@@ -535,20 +533,7 @@ const { data } = await octokit.rest.repos.getContent({ | |
console.log("package name: %s", JSON.parse(data).name); | ||
``` | ||
|
||
Example: retrieve a repository with topics | ||
|
||
```js | ||
const { data } = await octokit.rest.repos.getContent({ | ||
mediaType: { | ||
previews: ["mercy"], | ||
}, | ||
owner: "octocat", | ||
repo: "hello-world", | ||
}); | ||
console.log("topics on octocat/hello-world: %j", data.topics); | ||
``` | ||
|
||
Learn more about [Media type formats](https://docs.github.com/en/rest/overview/media-types) and [previews](https://docs.github.com/en/[email protected]/rest/overview/api-previews) used on GitHub Enterprise Server. | ||
Learn more about [Media type formats](https://docs.github.com/en/rest/overview/media-types). | ||
|
||
#### Request error handling | ||
|
||
|
Oops, something went wrong.