Comparing version 9.1.0 to 9.2.0
# CHANGELOG | ||
## 9.2.0 | ||
Features: | ||
* Org blocks | ||
* Add direct affiliation option for collaborators preview api. | ||
* Set accept header on pagination. | ||
* Add org blocking preview api. | ||
* Support for operations with empty parameters. | ||
Bug fixes: | ||
* Fix some examples. | ||
## 9.1.0 | ||
@@ -4,0 +16,0 @@ |
@@ -17,3 +17,3 @@ "use strict"; | ||
if (github.hasNextPage(res)) { | ||
console.log(res.length) | ||
console.log(res.data.length) | ||
github.getNextPage(res, nextFunc) | ||
@@ -24,3 +24,3 @@ } | ||
function nextFunc(err, res) { | ||
console.log(res.length); | ||
console.log(res.data.length); | ||
} |
@@ -24,3 +24,3 @@ "use strict"; | ||
}, function(err, res) { | ||
var releases = res; | ||
var releases = res.data; | ||
if (releases.length == 0) { | ||
@@ -38,3 +38,3 @@ return; | ||
}, function(err, res) { | ||
var assets = res; | ||
var assets = res.data; | ||
if (assets.length == 0) { | ||
@@ -41,0 +41,0 @@ return; |
@@ -21,3 +21,3 @@ "use strict"; | ||
starredRepos = starredRepos.concat(res); | ||
starredRepos = starredRepos.concat(res['data']); | ||
if (github.hasNextPage(res)) { | ||
@@ -24,0 +24,0 @@ github.getNextPage(res, getRepos) |
@@ -14,17 +14,6 @@ "use strict"; | ||
// github.repos.getReleases({ | ||
// owner: "kaizensoze", | ||
// repo: "test2" | ||
// }, function(err, res) { | ||
// console.log(err, res); | ||
// }); | ||
github.repos.uploadAsset({ | ||
owner: "kaizensoze", | ||
repo: "test2", | ||
id: "4801082", | ||
filePath: "/Users/joegallo/z.sh", | ||
name: "z.sh" | ||
github.repos.getAll({ | ||
}, function(err, res) { | ||
console.log(err, res); | ||
}); | ||
@@ -140,9 +140,16 @@ #!/usr/bin/env node | ||
var hasParams = unionTypeNames.length > 0 || ownParams.length > 0; | ||
var paramTypeName = pascalcase(namespace + "-" + entry[0] + "Params"); | ||
var paramTypeName = ""; | ||
if (!hasParams) { | ||
paramTypeName = pascalcase("EmptyParams"); | ||
} else { | ||
paramTypeName = pascalcase(namespace + "-" + entry[0] + "Params"); | ||
} | ||
return methods.concat({ | ||
method: camelcase(entry[0]), | ||
paramTypeName: hasParams && paramTypeName, | ||
paramTypeName: paramTypeName, | ||
unionTypeNames: unionTypeNames.length > 0 && unionTypeNames, | ||
ownParams: ownParams.length > 0 && { params: ownParams }, | ||
exclude: !hasParams | ||
}); | ||
@@ -156,3 +163,3 @@ }, []); | ||
}, []); | ||
var body = Mustache.render(template, { | ||
@@ -159,0 +166,0 @@ requestHeaders: requestHeaders.map(JSON.stringify), |
@@ -481,2 +481,3 @@ "use strict"; | ||
} | ||
headers = applyAcceptHeader(link, headers); | ||
return getPage.call(this, link, "next", headers, callback); | ||
@@ -498,2 +499,3 @@ }; | ||
} | ||
headers = applyAcceptHeader(link, headers); | ||
return getPage.call(this, link, "prev", headers, callback); | ||
@@ -515,2 +517,3 @@ }; | ||
} | ||
headers = applyAcceptHeader(link, headers); | ||
return getPage.call(this, link, "last", headers, callback); | ||
@@ -532,5 +535,16 @@ }; | ||
} | ||
headers = applyAcceptHeader(link, headers); | ||
return getPage.call(this, link, "first", headers, callback); | ||
}; | ||
function applyAcceptHeader(res, headers) { | ||
var previous = res.meta && res.meta['x-github-media-type']; | ||
if (!previous || (headers && headers.accept)) { | ||
return headers; | ||
} | ||
headers = headers || {}; | ||
headers.accept = 'application/vnd.' + previous.replace('; format=', '+'); | ||
return headers; | ||
} | ||
function getRequestFormat(hasBody, block) { | ||
@@ -537,0 +551,0 @@ if (hasBody) { |
{ | ||
"name": "github", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"description": "NodeJS wrapper for the GitHub API", | ||
@@ -53,3 +53,3 @@ "author": "Mike de Boer <info@mikedeboer.nl>", | ||
"name": "node-github", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"template": { | ||
@@ -56,0 +56,0 @@ "withCompare": true |
@@ -74,2 +74,30 @@ /* | ||
it("should successfully execute PUT /orgs/:org/blocks/:username (blockUser)", function(next) { | ||
client.orgs.blockUser( | ||
{ | ||
org: "String", | ||
username: "String" | ||
}, | ||
function(err, res) { | ||
Assert.equal(err, null); | ||
// other assertions go here | ||
next(); | ||
} | ||
); | ||
}); | ||
it("should successfully execute GET /orgs/:org/blocks/:username (checkBlockedUser)", function(next) { | ||
client.orgs.checkBlockedUser( | ||
{ | ||
org: "String", | ||
username: "String" | ||
}, | ||
function(err, res) { | ||
Assert.equal(err, null); | ||
// other assertions go here | ||
next(); | ||
} | ||
); | ||
}); | ||
it("should successfully execute GET /orgs/:org/members/:username (checkMembership)", function(next) { | ||
@@ -286,2 +314,17 @@ client.orgs.checkMembership( | ||
it("should successfully execute GET /orgs/:org/blocks (getBlockedUsers)", function(next) { | ||
client.orgs.getBlockedUsers( | ||
{ | ||
org: "String", | ||
page: "Number", | ||
per_page: "Number" | ||
}, | ||
function(err, res) { | ||
Assert.equal(err, null); | ||
// other assertions go here | ||
next(); | ||
} | ||
); | ||
}); | ||
it("should successfully execute GET /users/:username/orgs (getForUser)", function(next) { | ||
@@ -575,2 +618,16 @@ client.orgs.getForUser( | ||
it("should successfully execute DELETE /orgs/:org/blocks/:username (unblockUser)", function(next) { | ||
client.orgs.unblockUser( | ||
{ | ||
org: "String", | ||
username: "String" | ||
}, | ||
function(err, res) { | ||
Assert.equal(err, null); | ||
// other assertions go here | ||
next(); | ||
} | ||
); | ||
}); | ||
it("should successfully execute PATCH /orgs/:org (update)", function(next) { | ||
@@ -577,0 +634,0 @@ client.orgs.update( |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1904823
51587