Socket
Socket
Sign inDemoInstall

@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 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

48

index.js

@@ -5,29 +5,31 @@ module.exports = octokitEnterpriseCompatibility

// see https://github.com/octokit/rest.js/blob/15.x/lib/routes.json#L3046-L3068
const addOrReplaceLabelsOptions = {
params: {
labels: {
required: true,
type: 'string[]',
mapTo: 'data'
},
number: {
required: true,
type: 'integer'
},
owner: {
required: true,
type: 'string'
},
repo: {
required: true,
type: 'string'
}
},
url: '/repos/:owner/:repo/issues/:number/labels'
}
octokit.registerEndpoints({
issues: {
addLabels: {
method: 'POST',
params: {
labels: {
required: true,
type: 'string[]',
mapTo: 'data'
},
number: {
required: true,
type: 'integer'
},
owner: {
required: true,
type: 'string'
},
repo: {
required: true,
type: 'string'
}
},
url: '/repos/:owner/:repo/issues/:number/labels'
}
addLabels: Object.assign({ method: 'POST' }, addOrReplaceLabelsOptions),
replaceLabels: Object.assign({ method: 'PUT' }, addOrReplaceLabelsOptions)
}
})
}
{
"name": "@octokit/plugin-enterprise-compatibility",
"version": "1.0.0",
"version": "1.1.0",
"publishConfig": {

@@ -38,11 +38,11 @@ "access": "public",

"devDependencies": {
"@octokit/rest": "^16.7.0",
"@octokit/rest": "^16.13.3",
"coveralls": "^3.0.2",
"nock": "^10.0.6",
"semantic-release": "^15.10.7",
"semantic-release": "^15.13.3",
"standard": "^12.0.1",
"standard-markdown": "^5.0.1",
"tap": "^12.0.1"
"tap": "^12.4.0"
},
"dependencies": {}
}

@@ -19,3 +19,3 @@ # plugin-enterprise-compatibility.js

const Octokit = require('@octokit/rest')
.plugin(require('@octokit/enterprise-compatibility'))
.plugin(require('@octokit/plugin-enterprise-compatibility'))
const octokit = new Octokit()

@@ -22,0 +22,0 @@

@@ -6,2 +6,8 @@ const nock = require('nock')

test('does leave other endpoints in tact', t => {
const octokit = Octokit.plugin(require('.'))({ baseUrl: 'https://patched.test' })
t.ok(octokit.issues.get.endpoint)
t.end()
})
test('octokit.issues.addLabels() sends labels in request body', t => {

@@ -30,1 +36,25 @@ const octokitOriginal = Octokit({ baseUrl: 'https://original.test' })

})
test('octokit.issues.replaceLabels() sends labels in request body', t => {
const octokitOriginal = Octokit({ baseUrl: 'https://original.test' })
const octokitPatched = Octokit.plugin(require('.'))({ baseUrl: 'https://patched.test' })
nock('https://original.test')
.put('/repos/octokit/rest.js/issues/1/labels', { labels: [ 'foo', 'bar' ] })
.reply(200, {})
nock('https://patched.test')
.put('/repos/octokit/rest.js/issues/1/labels', [ 'foo', 'bar' ])
.reply(200, {})
const options = {
owner: 'octokit',
repo: 'rest.js',
number: 1,
labels: ['foo', 'bar']
}
return Promise.all([
octokitOriginal.issues.replaceLabels(options),
octokitPatched.issues.replaceLabels(options)
])
})
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