plugin-enterprise-server.js
Octokit plugin for GitHub Enterprise Server REST APIs
@octokit/rest and the @octokit/plugin-rest-endpoint-methods plugin it's using internally do not include methods for Enterprise Administration as they do not exist on https://api.github.com. This plugin adds endpoint methods for very GitHub Enterprise Server version that is currently supported.
Besides the admin-specific endpoints, there are differences between api.github.com and each GitHub Enterprise Server version. Instead of loading @octokit/plugin-rest-endpoint-methods you can optionally add all endpoint methods for each GitHub Enterprise Server version, including the admin endpoints.
Usage
| Browsers |
Load <script type="module">
import { Octokit } from "https://cdn.pika.dev/@octokit/core";
import { enterpriseServer220Admin } from "https://cdn.pika.dev/@octokit/plugin-enterprise-server";
</script> |
|---|---|
| Node |
Install with const { Octokit } = require("@octokit/core");
const {
enterpriseServer220Admin,
} = require("@octokit/plugin-enterprise-server"); |
const OctokitEnterprise220 = Octokit.plugin(enterpriseServer220Admin);
const octokit = new OctokitEnterprise220({
auth: "secret123",
baseUrl: "https://github.acme-inc.com/api/v3",
});
octokit.enterpriseAdmin.createUser({
username: "octocat",
email: "octocat@acme-inc.com",
});The list of currently exported plugins are
enterpriseServer220AdminenterpriseServer220enterpriseServer219AdminenterpriseServer219enterpriseServer218AdminenterpriseServer218enterpriseServer217AdminenterpriseServer217
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, the .github/workflows/routes-update.yml workflow is triggered. If an update to routes.json is found, a pull request is created.