Comparing version 0.7.2 to 0.7.3
@@ -5,5 +5,9 @@ // Generated by CoffeeScript 1.6.3 | ||
url: 'https://ocshq.com/', | ||
token: 'txoNBSR29ZG6KRVQidsv' | ||
host: 'ocshq.com', | ||
port: 443, | ||
hostname: 'ocshq.com', | ||
token: 'txoNBSR29ZG6KRVQidsv', | ||
service_hook_base: 'https://service-hook.ocshq.com/project/' | ||
}; | ||
}).call(this); |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -10,0 +10,0 @@ credentials = require('./credentials'); |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -10,0 +10,0 @@ credentials = require('./credentials'); |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -10,0 +10,0 @@ credentials = require('./credentials'); |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -10,0 +10,0 @@ credentials = require('./credentials'); |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.6.3 | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -10,0 +10,0 @@ credentials = require('./credentials'); |
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
module.exports = { | ||
ApiV2: require('./ApiV2').ApiV2, | ||
ApiV3: require('./ApiV3').ApiV3 | ||
}; | ||
var ApiV2, ApiV3; | ||
ApiV2 = require('./ApiV2').ApiV2; | ||
ApiV3 = require('./ApiV3').ApiV3; | ||
module.exports = ApiV3; | ||
module.exports.ApiV2 = ApiV2; | ||
module.exports.ApiV3 = ApiV3; | ||
}).call(this); |
@@ -44,7 +44,7 @@ // Generated by CoffeeScript 1.6.3 | ||
cb = function(retData) { | ||
if (retData.length === 100) { | ||
if (retData.length === params.per_page) { | ||
_this.debug("Recurse Issues::all()"); | ||
data = data.concat(retData); | ||
params.page++; | ||
return _this.all(params, cb); | ||
return _this.get("issues", params, cb); | ||
} else { | ||
@@ -51,0 +51,0 @@ data = data.concat(retData); |
@@ -41,8 +41,13 @@ // Generated by CoffeeScript 1.6.3 | ||
data = []; | ||
cb = function(retData) { | ||
if (retData.length === 100) { | ||
cb = function(err, retData) { | ||
if (err) { | ||
if (fn) { | ||
return fn(data); | ||
} | ||
} | ||
if (retData.length === params.per_page) { | ||
_this.debug("Recurse ProjectIssues::list()"); | ||
data = data.concat(retData); | ||
params.page++; | ||
return _this.list(params, cb); | ||
return _this.get("projects/" + (parseInt(projectId)) + "/issues", params, cb); | ||
} else { | ||
@@ -49,0 +54,0 @@ data = data.concat(retData); |
@@ -61,7 +61,7 @@ // Generated by CoffeeScript 1.6.3 | ||
} | ||
} else if (retData.length === 100) { | ||
} else if (retData.length === params.per_page) { | ||
_this.debug("Recurse Projects::all()"); | ||
data = data.concat(retData); | ||
params.page++; | ||
return _this.all(params, cb); | ||
return _this.get("projects", params, cb); | ||
} else { | ||
@@ -68,0 +68,0 @@ data = data.concat(retData); |
{ | ||
"name": "gitlab", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "GitLab API Nodejs library.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,2 +5,3 @@ node-gitlab | ||
[![Build Status](https://travis-ci.org/moul/node-gitlab.png?branch=master)](https://travis-ci.org/moul/node-gitlab) | ||
[![Dependency Status](https://david-dm.org/moul/node-gitlab.png?theme=shields.io)](https://david-dm.org/moul/node-gitlab) | ||
[![authors](https://sourcegraph.com/api/repos/github.com/moul/node-gitlab/badges/authors.png)](https://sourcegraph.com/github.com/moul/node-gitlab) | ||
@@ -7,0 +8,0 @@ [![library users](https://sourcegraph.com/api/repos/github.com/moul/node-gitlab/badges/library-users.png)](https://sourcegraph.com/github.com/moul/node-gitlab) |
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var Gitlab, assert, credentials, gitlab, projectId, userId; | ||
var Gitlab, assert, credentials, gitlab, mock, projectId, userId, validate_project; | ||
assert = require('assert'); | ||
Gitlab = require('..').ApiV3; | ||
Gitlab = require('..'); | ||
@@ -25,2 +25,10 @@ credentials = { | ||
validate_project = require('./validators').validate_project; | ||
mock = require('./mock'); | ||
if (process.env.TEST_NO_MOCK == null) { | ||
mock.setup(gitlab); | ||
} | ||
describe('User', function() { | ||
@@ -30,4 +38,3 @@ describe('#all()', function() { | ||
return gitlab.users.all(function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -39,4 +46,3 @@ }); | ||
return gitlab.users.show(userId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -48,4 +54,3 @@ }); | ||
return gitlab.users.session(credentials.login, credentials.password, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -58,8 +63,16 @@ }); | ||
describe('#all()', function() { | ||
beforeEach(function() { | ||
return mock.get = function(opts, cb) { | ||
return cb(null, {}, mock.projects); | ||
}; | ||
}); | ||
return it('should retrieve array of projects without error', function(done) { | ||
return gitlab.projects.all(function(result) { | ||
assert(result.length > 0); | ||
assert(result[0].id > 0); | ||
done(); | ||
return result; | ||
return gitlab.projects.all(function(projects) { | ||
var project, _i, _len; | ||
assert(projects.length > 0); | ||
for (_i = 0, _len = projects.length; _i < _len; _i++) { | ||
project = projects[_i]; | ||
validate_project(project); | ||
} | ||
return done(); | ||
}); | ||
@@ -69,7 +82,15 @@ }); | ||
describe('#show()', function() { | ||
beforeEach(function() { | ||
return mock.get = function(opts, cb) { | ||
var project; | ||
project = mock.projects[0]; | ||
project.id = parseInt(mock.path.split('/').slice(-1)[0]); | ||
return cb(null, {}, project); | ||
}; | ||
}); | ||
return it('should retrieve single project', function(done) { | ||
return gitlab.projects.show(projectId, function(result) { | ||
assert(result.id > 0); | ||
done(); | ||
return result; | ||
return gitlab.projects.show(projectId, function(project) { | ||
assert.equal(project.id, projectId); | ||
validate_project(project); | ||
return done(); | ||
}); | ||
@@ -83,4 +104,3 @@ }); | ||
return gitlab.projects.members.list(projectId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -95,4 +115,3 @@ }); | ||
return gitlab.projects.repository.listBranches(projectId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -104,4 +123,3 @@ }); | ||
return gitlab.projects.repository.listCommits(projectId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -113,4 +131,3 @@ }); | ||
return gitlab.projects.repository.listTags(projectId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -122,4 +139,3 @@ }); | ||
return gitlab.projects.repository.listTree(projectId, function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -135,4 +151,3 @@ }); | ||
return gitlab.issues.all(function(result) { | ||
done(); | ||
return result; | ||
return done(); | ||
}); | ||
@@ -139,0 +154,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
78173
56
1595
50
3