Skip to content

Releases: octokit/rest.js

v14.0.1

18 Apr 18:13
Compare
Choose a tag to compare

14.0.1 (2018-01-18)

Bug Fixes

  • package: publish with TypeScript / Flow definitions (4bc8b65)

v14.0.0

18 Apr 18:13
Compare
Choose a tag to compare

14.0.0 (2018-01-17)

Breaking changes

The package has been renamed from github to @octokit/rest.

To upgrade

  1. npm install @octokit/rest
  2. npm uninstall github
  3. replace require('github') with require('@octokit/rest')

That’s it, there are no functional changes in the public APIs compared to github@13.

Debug logs

DEBUG=node-github* is now DEBUG=octokit*.

In case you enabled debug logs, make sure to adapt the DEBUG environment variable accordingly.

v13.1.1

18 Apr 18:13
Compare
Choose a tag to compare

13.1.1 (2018-01-15)

Bug Fixes

  • typescript: improve default response type (#683) (ac39fb5)

v13.1.0

18 Apr 18:13
Compare
Choose a tag to compare

13.1.0 (2017-12-31)

Features

v13.0.2

18 Apr 18:13
Compare
Choose a tag to compare

13.0.2 (2017-12-25)

Bug Fixes

  • uploadAsset with file: fs.createReadStream() (85255a1)

v13.0.1

18 Apr 18:13
Compare
Choose a tag to compare

13.0.1 (2017-12-02)

Bug Fixes

  • respect NO_PROXY environment variable (#667) (9c68105)

v13.0.0

18 Apr 18:13
Compare
Choose a tag to compare

BREAKING CHANGES

  • .get{Scope name}Api() methods have been removed.

    Before you could do this

    const reposApi = github.getReposApi()

    Which is the same as doing

    const reposApi = github.repos

    So we removed it :)

  • Before a link header could be passed directly to pagination methods like github.hasPreviousPage(linkHeaderValue). This was never documented and is not being used internally, so we decided to remove the functionality to simplify the code

  • The debug option for the GitHub Client constructor
    has been removed. Set DEBUG=node-github:* environment variable instead

  • The current implementation has the upload URL hard coded, while the specification says that it has to be received from the Release API endpoint:
    https://developer.github.com/v3/repos/releases/#upload-a-release-asset

    The new implementation also requires contentType as well as contentLength. The latter is not documented, but is required. The filePath option has been replaced with a file option which can be either a read stream, a buffer or a string.

    Altogether, uploading an asset before worked like this:

    github.repos.getReleaseByTag({
      owner: "octokit-fixture-org",
      repo: "release-assets",
      tag: "v1.0.0"
    })
    
    .then(result => {
      return github.repos.uploadAsset({
        owner: "octokit-fixture-org",
        repo: "release-assets",
        id: result.data.id,
        filePath: pathResolve(__dirname, "test-upload.txt"),
        name: "test-upload.txt",
        label: "test"
      })
    })

    Now it looks like this

    github.repos.getReleaseByTag({
      owner: "octokit-fixture-org",
      repo: "release-assets",
      tag: "v1.0.0"
    })
    
    .then(result => {
      return github.repos.uploadAsset({
        url: result.data.upload_url,
        file: "Hello, world!\n",
        contentType: "text/plain",
        contentLength: 14,
        name: "test-upload.txt",
        label: "test"
      })
    })

    If you prefer a higher-level release asset upload library, have a look at https://github.com/gr2m/octokit-release-asset-upload

  • the followRedirects option has been removed. Previous problems with non-GET redirects should be handled correctly now, the method is always forwarded as all redirects remain within the same host

  • Authentication with "netrc" is no longer supported:

    github.authenticate({
      type: "netrc"
    })

    Instead, use the netrc package directly and pass username/password to "basic" authentication

    const netrc = require('netrc')
    const myNetrc = netrc()
    
    github.authenticate({
      type: 'basic',
      username: myNetrc['api.github.com'].login,
      password: myNetrc['api.github.com'].password
    })
  • passing a custom Promise option to the constructor is no longer supported

    All suppertod Node versions (4, 6 and 8) have Promise support built in now. So migrating should be as simple as removing the Promise option altogether.

Features

  • always follow redirects (61e7a81)

Bug Fixes

  • no headers are sent if there are no headers (51eeb0d)

v12.1.0

18 Apr 18:13
Compare
Choose a tag to compare

12.1.0 (2017-11-29)

Features

v12.0.7

18 Apr 18:13
Compare
Choose a tag to compare

12.0.7 (2017-11-28)

Bug Fixes

  • whitelist X-GitHub-SSO header in response (#663) (1e07daf)

v12.0.6

18 Apr 18:13
Compare
Choose a tag to compare

12.0.6 (2017-11-26)

Bug Fixes

  • calculate content-length correctly for raw markdown request (4f819ad)