Socket
Socket
Sign inDemoInstall

@octokit/plugin-enterprise-rest

Package Overview
Dependencies
0
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-enterprise-rest

Octokit plugin for GitHub Enterprise REST APIs


Version published
Maintainers
3
Weekly downloads
1,102,464
increased by0.54%
Install size
8.57 MB

Weekly downloads

Readme

Source

plugin-enterprise-rest.js

Octokit plugin for GitHub Enterprise REST APIs

@latest Build Status Greenkeeper badge

@octokit/rest does not include methods for Enterprise Administration as they are not usable against https://api.github.com. This plugin adds these endpoints based on the GitHub Enterprise version you need.

Usage

const Octokit = require("@octokit/rest").plugin(
  require("@octokit/plugin-enterprise-rest/ghe-2.18")
);
const octokit = new Octokit({
  baseUrl: "https://github.acme-inc.com/api/v3"
});

octokit.enterpriseAdmin.promoteOrdinaryUserToSiteAdministrator({
  username: "octocat"
});

There can be differences in REST API between api.github.com and the different GitHub Enterprise versions. Some of the endpoint methods from @octokit/rest might not work. For these cases you can load the endpoint methods for all scopes for a certain GitHub Enterprise version, not only the .enterprise scope. This will override existing endpoint methods.

const Octokit = require("@octokit/rest").plugin(
  require("@octokit/plugin-enterprise-rest/ghe-2.18/all")
);
const octokit = new Octokit({
  baseUrl: "https://github.acme-inc.com/api/v3"
});

octokit.issues.addLabels({
  owner,
  repo,
  number,
  labels: ["foo", "bar"]
});
// now sends `["foo", "bar"]` in the request body, instead of `{"labels": ["foo", "bar"]}`

API docs

See the README.md files in the ghe-* folders for a list of available endpoint methods for the respective GitHub Enterprise version.

How it works

The route definitions for the currently supported GitHub Enterprise versions are build automatically from @octokit/routes. Each time there is a new @octokit/routes release, Greenkeeper will send a pull request which updates the dependency in package.json and package-lock.json. That kicks of a build on Travis CI where the greenkeeper-routes-update script is run. If there is a change, the script updates the *.json definition files in the pull request.

LICENSE

MIT

Keywords

FAQs

Last updated on 14 Jan 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc