node-gitlab
Advanced tools
Comparing version 0.0.1 to 0.0.2
0.0.2 / 2013-03-25 | ||
================== | ||
* add hook, issue, member, milestone, project | ||
* remove client config | ||
0.0.1 / 2013-03-22 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -15,2 +15,6 @@ /*! | ||
var Milestone = require('./milestone'); | ||
var Project = require('./project'); | ||
var Member = require('./member'); | ||
var Hook = require('./hook'); | ||
var Issue = require('./issue'); | ||
@@ -29,2 +33,6 @@ /** | ||
this.milestones = new Milestone(this); | ||
this.projects = new Project(this); | ||
this.members = new Member(this); | ||
this.hooks = new Hook(this); | ||
this.issues = new Issue(this); | ||
} | ||
@@ -64,2 +72,5 @@ | ||
err.statusCode = res && res.statusCode; | ||
err.method = method; | ||
err.url = url; | ||
err.requestData = data; | ||
return callback(err); | ||
@@ -71,3 +82,7 @@ } | ||
err.data = result; | ||
err.headers = res.headers; | ||
err.statusCode = res.statusCode; | ||
err.method = method; | ||
err.url = url; | ||
err.requestData = data; | ||
return callback(err); | ||
@@ -74,0 +89,0 @@ } |
@@ -13,62 +13,10 @@ /*! | ||
var util = require('util'); | ||
var Resource = require('./resource'); | ||
function Milestone(client) { | ||
this.client = client; | ||
this.path = '/projects/:id/milestones'; | ||
this.onePath = this.path + '/:milestone_id'; | ||
Resource.call(this, client, '/projects/:id/milestones', 'milestone_id'); | ||
} | ||
util.inherits(Milestone, Resource); | ||
/** | ||
* Get a project's milestone. | ||
* | ||
* @param {Object} params | ||
* - {Number} id, project's id | ||
* - {Number} milestone_id, milestone's id. | ||
* @param {Function(err, row)} callback | ||
*/ | ||
Milestone.prototype.get = function (params, callback) { | ||
this.client.request('get', this.onePath, params, callback); | ||
}; | ||
/** | ||
* List a project's all milestones. | ||
* | ||
* @param {Object} params | ||
* - {Number} id, project's id. | ||
* - {Number} [page=1], page number, default is `1`. | ||
* - {Number} [perPage=20], number of items to list per page, max is `100`. | ||
* @param {Function(err, rows)} callback | ||
*/ | ||
Milestone.prototype.list = function (params, callback) { | ||
this.client.request('get', this.path, params, callback); | ||
}; | ||
/** | ||
* Create a milestone. | ||
* | ||
* @param {Object} params | ||
* - {Number} id (required) - The ID of a project | ||
* - {String} title (required) - The title of an milestone | ||
* - {String} [description] (optional) - The description of the milestone | ||
* - {String} [due_date] (optional) - The due date of the milestone | ||
* @param {Function(err, row)} callback | ||
*/ | ||
Milestone.prototype.create = function (params, callback) { | ||
this.client.request('post', this.path, params, callback); | ||
}; | ||
/** | ||
* Update a milestone. | ||
* @param {Object} params | ||
* - {Number} id (required) - The ID of a project | ||
* - {Number} milestone_id (required) - The ID of a project milestone | ||
* - {String} title (required) - The title of an milestone | ||
* - {String} [description] (optional) - The description of the milestone | ||
* - {String} [due_date] (optional) - The due date of the milestone | ||
* - {String} [closed] (optional) - The status of the milestone | ||
* @param {Function(err, row)} callback | ||
*/ | ||
Milestone.prototype.update = function (params, callback) { | ||
this.client.request('put', this.onePath, params, callback); | ||
}; | ||
module.exports = Milestone; | ||
module.exports = Milestone; |
{ | ||
"name": "node-gitlab", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "gitlab", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,3 @@ gitlab [![Build Status](https://secure.travis-ci.org/fengmk2/gitlab.png)](http://travis-ci.org/fengmk2/gitlab) [![Dependencies](http://david-dm.org/fengmk2/gitlab.png)](http://david-dm.org/fengmk2/gitlab) | ||
var client = gitlab.create({ | ||
api: 'http://gitlab.com/api/v3', | ||
api: 'https://gitlab.com/api/v3', | ||
privateToken: 'your private token' | ||
@@ -26,0 +26,0 @@ }); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11745
13
236
1