mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-12 17:08:44 +08:00
Update node-github => octokit/rest.js in docs (#445)
This commit is contained in:
@@ -6,7 +6,7 @@ next: docs/http.md
|
||||
|
||||
Probot uses [GitHub Apps](https://developer.github.com/apps/). An app is a first-class actor on GitHub, like a user (e.g. [@defunkt](https://github.com/defunkt)) or an organization (e.g. [@github](https://github.com/github)). The app is given access to a repository or repositories by being "installed" on a user or organization account and can perform actions through the API like [commenting on an issue](https://developer.github.com/v3/issues/comments/#create-a-comment) or [creating a status](https://developer.github.com/v3/repos/statuses/#create-a-status).
|
||||
|
||||
`context.github` is an authenticated GitHub client that can be used to make API calls. It is an instance of the [github Node.js module](https://github.com/octokit/node-github), which wraps the [GitHub REST API](https://developer.github.com/v3/) and allows you to do almost anything programmatically that you can do through a web browser.
|
||||
`context.github` is an authenticated GitHub client that can be used to make API calls. It is an instance of the [`@octokit/rest` Node.js module](https://github.com/octokit/rest.js), which wraps the [GitHub REST API](https://developer.github.com/v3/) and allows you to do almost anything programmatically that you can do through a web browser.
|
||||
|
||||
Here is an example of an autoresponder app that comments on opened issues:
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = robot => {
|
||||
}
|
||||
```
|
||||
|
||||
See the [full API docs](https://octokit.github.io/node-github/) to see all the ways you can interact with GitHub. Some API endpoints are not available on GitHub Apps yet, so check [which ones are available](https://developer.github.com/v3/apps/available-endpoints/) first.
|
||||
See the [full API docs](https://octokit.github.io/rest.js/) to see all the ways you can interact with GitHub. Some API endpoints are not available on GitHub Apps yet, so check [which ones are available](https://developer.github.com/v3/apps/available-endpoints/) first.
|
||||
|
||||
## GitHub Enterprise
|
||||
|
||||
@@ -35,4 +35,3 @@ GHE_HOST=fake.github-enterprise.com
|
||||
```
|
||||
|
||||
> GitHub Apps are enabled in GitHub Enterprise 2.12 as an [early access technical preview](https://developer.github.com/enterprise/2.12/apps/).
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Probot includes a wrapper for the GitHub API which can enable you to store and m
|
||||
|
||||
If your Probot App needs to store more data than Issues and Pull Requests store normally, you can use the [`probot-metadata` extension](https://probot.github.io/docs/extensions/#metadata) to hide data in comments. It isn't meant to be super secure or scalable, but it's an easy way to manage some data without a full database.
|
||||
|
||||
There are even more APIs that you can use to increase the functionality of your Probot App. You can read about all of the ones available in Probot on the [`node-github` documentation](http://mikedeboer.github.io/node-github/).
|
||||
There are even more APIs that you can use to increase the functionality of your Probot App. You can read about all of the ones available in Probot on the [`@octokit/rest` documentation](http://octokit.github.io/rest.js/).
|
||||
|
||||
## Using a Database
|
||||
|
||||
@@ -175,4 +175,3 @@ module.exports = robot => {
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ const Bottleneck = require('bottleneck')
|
||||
const Octokit = require('@octokit/rest')
|
||||
|
||||
/**
|
||||
* the [github Node.js module](https://github.com/octokit/node-github),
|
||||
* the [@octokit/rest Node.js module](https://github.com/octokit/rest.js),
|
||||
* which wraps the [GitHub API](https://developer.github.com/v3/) and allows
|
||||
* you to do almost anything programmatically that you can do through a web
|
||||
* browser.
|
||||
* @typedef github
|
||||
* @see {@link https://github.com/octokit/node-github}
|
||||
* @see {@link https://github.com/octokit/rest.js}
|
||||
*/
|
||||
|
||||
const defaultCallback = response => response
|
||||
|
||||
Reference in New Issue
Block a user