Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/plugin-enterprise-compatibility

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/plugin-enterprise-compatibility

Octokit plugin for improving GHE compatibility

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103K
increased by11.66%
Maintainers
3
Weekly downloads
 
Created
Source

plugin-enterprise-compatibility.js

Octokit plugin for improving GHE compatibility

@latest Build Status

The GitHub API teams is continuously improving existing APIs to make the overall platform more consistent. For example, the Add labels to an issue expected the label names array to be sent directly in the request body root, as you can still see in the documentation for GHE 2.15.

While consistency is great, changing like the above makes the current octokit.issues.addLabels() incompatible with GHE v2.15 and older. If you require compatibility with GHE versions, you can use the Enterprise rest plugin, but that will remove new endpoint methods that are not available on Enterprise yet.

As a compromise, this plugin is reverting changes such as the one above to remain compatible with currently supported GitHub enterprise versions.

Usage

Browsers

Load @octokit/plugin-enterprise-compatibility and @octokit/core (or core-compatible module) directly from cdn.skypack.dev

<script type="module">
  import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
  import { enterpriseCompatibility } from "https://cdn.skypack.dev/@octokit/plugin-enterprise-compatibility";
</script>
Node

Install with npm install @octokit/core @octokit/plugin-enterprise-compatibility. Optionally replace @octokit/core with a core-compatible module

const { Octokit } = require("@octokit/core");
const {
  enterpriseCompatibility,
} = require("@octokit/plugin-enterprise-compatibility");
const MyOctokit = Octokit.plugin(enterpriseCompatibility);
const octokit = new MyOctokit({
  auth: "token123",
});

octokit.request("POST /repos/{owner}/{repo}/issues/{issue_number}/labels", {
  owner,
  repo,
  number,
  labels: ["foo", "bar"],
});
// sends ["foo", "bar"] instead of {"labels":["foo", "bar"]} as request body

LICENSE

MIT

Keywords

FAQs

Package last updated on 15 Aug 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc