1 Star 0 Fork 1

fengmk2 / gitlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

gitlab Build Status Coverage Status

logo

Gitlab API nodejs client.

Install

$ npm install node-gitlab

Usage

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);
});

Document

@see Gitlab API document.

Milestones

/**
 * 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);

Repository

/**
 * 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);

Authors

$ git summary 

 project  : gitlab
 repo age : 5 months
 active   : 11 days
 commits  : 22
 files    : 26
 authors  : 
    20  fengmk2                 90.9%
     2  Ondrej                  9.1%

License

(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.

空文件

简介

Gitlab API nodejs client. 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/fengmk2/gitlab.git
git@gitee.com:fengmk2/gitlab.git
fengmk2
gitlab
gitlab
master

搜索帮助