Gitlab API nodejs client.
$ npm install node-gitlab
var gitlab = require('node-gitlab');
var client = gitlab.create({
api: 'https://gitlab.com/api/v3',
privateToken: 'your private token'
});
client.milestone.list({id: 1}, function (err, milestones) {
console.log(milestones);
});
@see Gitlab API document.
/**
* 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);
/**
* 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);
/**
* Create a milestone.
*
* @param {Object} params
* - {Number} id The ID of a project
* - {String} title The title of an milestone
* - {String} [description] The description of the milestone
* - {String} [due_date] The due date of the milestone
* @param {Function(err, row)} callback
*/
Milestone.prototype.create = function (params, callback);
/**
* Update a milestone.
* @param {Object} params
* - {Number} id The ID of a project
* - {Number} milestone_id The ID of a project milestone
* - {String} title The title of an milestone
* - {String} [description] The description of the milestone
* - {String} [due_date] The due date of the milestone
* - {String} [closed] The status of the milestone
* @param {Function(err, row)} callback
*/
Milestone.prototype.update = function (params, callback);
/**
* Get a list of repository branches from a project, sorted by name alphabetically.
*
* @param {Object} params
* - {String} id The ID of a project
* @param {Function} callback
*/
Repository.prototype.getBranches = function (params, callback);
/**
* Protects a single project repository branch.
* This is an idempotent function, protecting an already protected repository branch
* still returns a 200 Ok status code.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} branch The name of the branch
* @param {Function} callback
*/
Repository.prototype.protectBranch = function (params, callback);
/**
* Unprotects a single project repository branch.
* This is an idempotent function, unprotecting an already unprotected repository branch
* still returns a 200 Ok status code.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} branch The name of the branch
* @param {Function} callback
*/
Repository.prototype.unprotectBranch = function (params, callback);
/**
* Get a single project repository branch.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} branch The name of the branch
* @param {Function} callback
*/
Repository.prototype.getBranch = function (params, callback);
/**
* Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
*
* @param {Object} params
* - {String} id The ID of a project
* @param {Function} callback
*/
Repository.prototype.getTags = function (params, callback);
/**
* Get a list of repository commits in a project.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} [ref_name] The name of a repository branch or tag or if not given the default branch
* @param {Function} callback
*/
Repository.prototype.getCommits = function (params, callback);
/**
* Get a list of repository files and directories in a project.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} [path] The path inside repository, default is '/'. Used to get contend of subdirectories. e.g.: `test`
* - {String} [ref_name] The name of a repository branch or tag or if not given the default branch
* @param {Function} callback
*/
Repository.prototype.getTree = function (params, callback);
/**
* Get the raw file contents for a file.
*
* @param {Object} params
* - {String} id The ID of a project
* - {String} sha The commit or branch name
* - {String} filepath The path the file
* @param {Function} callback
*/
Repository.prototype.getBlob = function (params, callback);
$ git summary
project : gitlab
repo age : 5 months
active : 11 days
commits : 22
files : 26
authors :
20 fengmk2 90.9%
2 Ondrej 9.1%
(The MIT License)
Copyright (c) 2013 fengmk2 <fengmk2@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。