node-gitlab
Advanced tools
Comparing version 1.0.0 to 1.1.0
1.1.0 / 2015-06-11 | ||
================== | ||
* docs: improve document | ||
* feat(issues): add getNote(), updateNote() | ||
1.0.0 / 2014-10-12 | ||
@@ -3,0 +9,0 @@ ================== |
/**! | ||
* gitlab - lib/properties.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <m@fengmk2.com> (http://fengmk2.com) | ||
*/ | ||
@@ -20,3 +20,5 @@ | ||
var properties = { | ||
milestones: [], | ||
milestones: [ | ||
'listIssues', | ||
], | ||
members: [], | ||
@@ -28,2 +30,6 @@ hooks: [], | ||
repositoryFiles: [], | ||
repositoryBranches: [ | ||
'protect', | ||
'unprotect', | ||
], | ||
repository: [ | ||
@@ -41,9 +47,16 @@ 'getBranches', | ||
'listNotes', | ||
'createNote' | ||
'createNote', | ||
'getNote', | ||
'updateNote', | ||
], | ||
projects: [ | ||
'getByPath' | ||
'getByPath', | ||
'listEvents', | ||
'fork', | ||
'search', | ||
], | ||
projectMembers: [], | ||
groups: [], | ||
groups: [ | ||
'transferProject' | ||
], | ||
groupMembers: [], | ||
@@ -50,0 +63,0 @@ }; |
/**! | ||
* gitlab - lib/resources/group.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.com) | ||
*/ | ||
@@ -10,0 +10,0 @@ |
/**! | ||
* gitlab - lib/resources/index.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.com) | ||
*/ | ||
@@ -19,2 +19,3 @@ | ||
projects: require('./project'), | ||
projectMembers: { | ||
@@ -26,2 +27,5 @@ resourcePath: '/projects/:id/members', | ||
repository: require('./repository'), | ||
repositoryBranches: require('./repository_branch'), | ||
repositoryFiles: { | ||
@@ -42,2 +46,3 @@ resourcePath: '/projects/:id/repository/files' | ||
issues: require('./issue'), | ||
globalHooks: { | ||
@@ -48,7 +53,4 @@ resourcePath: '/hooks', | ||
milestones: require('./milestone'), | ||
milestones: { | ||
resourcePath: '/projects/:id/milestones', | ||
idName: 'milestone_id' | ||
}, | ||
hooks: { | ||
@@ -60,2 +62,3 @@ resourcePath: '/projects/:id/hooks', | ||
groups: require('./group'), | ||
groupMembers: { | ||
@@ -62,0 +65,0 @@ resourcePath: '/groups/:id/members', |
/**! | ||
* gitlab - lib/resources/issue.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <m@fengmk2.com> (http://fengmk2.com) | ||
*/ | ||
@@ -20,2 +20,4 @@ | ||
module.exports = Issue; | ||
function Issue(client) { | ||
@@ -26,4 +28,2 @@ this.constructor.super_.call(this, client, '/projects/:id/issues', 'issue_id'); | ||
module.exports = Issue; | ||
Issue.prototype.listNotes = function (params, callback) { | ||
@@ -36,1 +36,9 @@ this.client.request('get', this.onePath + '/notes', params, callback); | ||
}; | ||
Issue.prototype.getNote = function (params, callback) { | ||
this.client.request('get', this.onePath + '/notes/:note_id', params, callback); | ||
}; | ||
Issue.prototype.updateNote = function (params, callback) { | ||
this.client.request('put', this.onePath + '/notes/:note_id', params, callback); | ||
}; |
/**! | ||
* gitlab - lib/resources/project.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.com) | ||
*/ | ||
@@ -39,1 +39,13 @@ | ||
}; | ||
Project.prototype.search = function (params, callback) { | ||
this.client.request('get', '/projects/search/:query', params, callback); | ||
}; | ||
Project.prototype.fork = function (params, callback) { | ||
this.client.request('post', '/projects/fork/:id', params, callback); | ||
}; | ||
Project.prototype.listEvents = function (params, callback) { | ||
this.client.request('get', this.onePath + '/events', params, callback); | ||
}; |
/**! | ||
* gitlab - lib/resources/repository.js | ||
* | ||
* Copyright(c) fengmk2 and other contributors. | ||
* Copyright(c) repo-utils and other contributors. | ||
* MIT Licensed | ||
* | ||
* Authors: | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
* fengmk2 <fengmk2@gmail.com> (http://fengmk2.com) | ||
*/ | ||
@@ -10,0 +10,0 @@ |
{ | ||
"name": "node-gitlab", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Gitlab API nodejs client.", | ||
@@ -16,15 +16,15 @@ "main": "index.js", | ||
"dependencies": { | ||
"debug": "~2.0.0", | ||
"native-or-bluebird": "~1.1.1", | ||
"debug": "~2.2.0", | ||
"native-or-bluebird": "~1.2.0", | ||
"restful-client": "~1.0.0", | ||
"thunkify-wrap": "~1.0.2" | ||
"thunkify-wrap": "~1.0.4" | ||
}, | ||
"devDependencies": { | ||
"autod": "*", | ||
"co-mocha": "*", | ||
"contributors": "*", | ||
"istanbul-harmony": "*", | ||
"mocha": "*", | ||
"co-mocha": "*", | ||
"pedding": "~1.0.0", | ||
"should": "~4.0.4" | ||
"should": "~6.0.3" | ||
}, | ||
@@ -31,0 +31,0 @@ "homepage": "https://github.com/repo-utils/gitlab", |
848
README.md
@@ -95,144 +95,745 @@ gitlab | ||
### Milestones | ||
### Project | ||
```js | ||
/** | ||
* 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); | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md | ||
/** | ||
* 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); | ||
#### client.projects.list({archived, order_by, sort, search, ci_enabled_first}) | ||
/** | ||
* 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); | ||
Get a list of projects accessible by the authenticated user. | ||
/** | ||
* Update a milestone. | ||
Parameters: | ||
* @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); | ||
- archived (optional) - if passed, limit by archived status | ||
- order_by (optional) - Return requests ordered by `id`, `name`, `path`, `created_at`, `updated_at` or `last_activity_at` fields. Default is `created_at` | ||
- sort (optional) - Return requests sorted in `asc` or `desc` order. Default is `desc` | ||
- search (optional) - Return list of authorized projects according to a search criteria | ||
- ci_enabled_first - Return projects ordered by ci_enabled flag. Projects with enabled GitLab CI go first | ||
```json | ||
[ | ||
{ | ||
"id": 4, | ||
"description": null, | ||
"default_branch": "master", | ||
"public": false, | ||
"visibility_level": 0, | ||
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", | ||
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", | ||
"web_url": "http://example.com/diaspora/diaspora-client", | ||
"tag_list": [ | ||
"example", | ||
"disapora client" | ||
], | ||
"owner": { | ||
"id": 3, | ||
"name": "Diaspora", | ||
"created_at": "2013-09-30T13: 46: 02Z" | ||
}, | ||
"name": "Diaspora Client", | ||
"name_with_namespace": "Diaspora / Diaspora Client", | ||
"path": "diaspora-client", | ||
"path_with_namespace": "diaspora/diaspora-client", | ||
"issues_enabled": true, | ||
"merge_requests_enabled": true, | ||
"wiki_enabled": true, | ||
"snippets_enabled": false, | ||
"created_at": "2013-09-30T13: 46: 02Z", | ||
"last_activity_at": "2013-09-30T13: 46: 02Z", | ||
"creator_id": 3, | ||
"namespace": { | ||
"created_at": "2013-09-30T13: 46: 02Z", | ||
"description": "", | ||
"id": 3, | ||
"name": "Diaspora", | ||
"owner_id": 1, | ||
"path": "diaspora", | ||
"updated_at": "2013-09-30T13: 46: 02Z" | ||
}, | ||
"archived": false, | ||
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png" | ||
}, | ||
// ... | ||
] | ||
``` | ||
### Repository | ||
#### client.projects.get({id}) | ||
```js | ||
/** | ||
* 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); | ||
Get a specific project | ||
/** | ||
* 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); | ||
Parameters: | ||
/** | ||
* 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); | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
/** | ||
* 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); | ||
```json | ||
{ | ||
"id": 3, | ||
"description": null, | ||
"default_branch": "master", | ||
"public": false, | ||
"visibility_level": 0, | ||
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", | ||
"http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", | ||
"web_url": "http://example.com/diaspora/diaspora-project-site", | ||
"tag_list": [ | ||
"example", | ||
"disapora project" | ||
], | ||
"owner": { | ||
"id": 3, | ||
"name": "Diaspora", | ||
"created_at": "2013-09-30T13: 46: 02Z" | ||
}, | ||
"name": "Diaspora Project Site", | ||
"name_with_namespace": "Diaspora / Diaspora Project Site", | ||
"path": "diaspora-project-site", | ||
"path_with_namespace": "diaspora/diaspora-project-site", | ||
"issues_enabled": true, | ||
"merge_requests_enabled": true, | ||
"wiki_enabled": true, | ||
"snippets_enabled": false, | ||
"created_at": "2013-09-30T13: 46: 02Z", | ||
"last_activity_at": "2013-09-30T13: 46: 02Z", | ||
"creator_id": 3, | ||
"namespace": { | ||
"created_at": "2013-09-30T13: 46: 02Z", | ||
"description": "", | ||
"id": 3, | ||
"name": "Diaspora", | ||
"owner_id": 1, | ||
"path": "diaspora", | ||
"updated_at": "2013-09-30T13: 46: 02Z" | ||
}, | ||
"permissions": { | ||
"project_access": { | ||
"access_level": 10, | ||
"notification_level": 3 | ||
}, | ||
"group_access": { | ||
"access_level": 50, | ||
"notification_level": 3 | ||
} | ||
}, | ||
"archived": false, | ||
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png" | ||
} | ||
``` | ||
/** | ||
* 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); | ||
#### client.projects.create({name, path, namespace_id, description, issues_enabled, merge_requests_enabled, | ||
wiki_enabled, snippets_enabled, public, visibility_level, import_url}) | ||
/** | ||
* 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); | ||
Creates a new project owned by the authenticated user. | ||
/** | ||
* 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); | ||
Parameters: | ||
/** | ||
* 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); | ||
- name (required) - new project name | ||
- path (optional) - custom repository name for new project. By default generated based on name | ||
- namespace_id (optional) - namespace for the new project (defaults to user) | ||
- description (optional) - short project description | ||
- issues_enabled (optional) | ||
- merge_requests_enabled (optional) | ||
- wiki_enabled (optional) | ||
- snippets_enabled (optional) | ||
- public (optional) - if true same as setting visibility_level = 20 | ||
- visibility_level (optional) | ||
- import_url (optional) | ||
#### client.projects.update({id, path, namespace_id, description, default_branch, issues_enabled, merge_requests_enabled, | ||
wiki_enabled, snippets_enabled, public, visibility_level}) | ||
Updates an existing project | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- name (optional) - project name | ||
- path (optional) - repository name for project | ||
- description (optional) - short project description | ||
- default_branch (optional) | ||
- issues_enabled (optional) | ||
- merge_requests_enabled (optional) | ||
- wiki_enabled (optional) | ||
- snippets_enabled (optional) | ||
- public (optional) - if true same as setting visibility_level = 20 | ||
- visibility_level (optional) | ||
On success, method returns 200 with the updated project. If parameters are invalid, 400 is returned. | ||
#### client.projects.remove({id}) | ||
Removes a project including all associated resources (issues, merge requests etc.) | ||
Parameters: | ||
- id (required) - The ID of a project | ||
#### client.projects.search({query, per_page, page, order_by, sort}) | ||
Search for projects by name which are accessible to the authenticated user. | ||
Parameters: | ||
- query (required) - A string contained in the project name | ||
- per_page (optional) - number of projects to return per page | ||
- page (optional) - the page to retrieve | ||
- order_by (optional) - Return requests ordered by `id`, `name`, `created_at` or `last_activity_at` fields | ||
- sort (optional) - Return requests sorted in `asc` or `desc` order | ||
#### client.projects.fork({id}) | ||
Forks a project into the user namespace of the authenticated user. | ||
Parameters: | ||
- id (required) - The ID of the project to be forked | ||
#### client.projects.listEvents({id}) | ||
Get the events for the specified project. Sorted from newest to latest | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
```json | ||
[ | ||
{ | ||
"title": null, | ||
"project_id": 15, | ||
"action_name": "closed", | ||
"target_id": 830, | ||
"target_type": "Issue", | ||
"author_id": 1, | ||
"author_username": "john", | ||
"data": null, | ||
"target_title": "Public project search field" | ||
}, | ||
{ | ||
"title": null, | ||
"project_id": 15, | ||
"action_name": "opened", | ||
"target_id": null, | ||
"target_type": null, | ||
"author_id": 1, | ||
"author_username": "john", | ||
"data": { | ||
"before": "50d4420237a9de7be1304607147aec22e4a14af7", | ||
"after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", | ||
"ref": "refs/heads/master", | ||
"user_id": 1, | ||
"user_name": "Dmitriy Zaporozhets", | ||
"repository": { | ||
"name": "gitlabhq", | ||
"url": "git@dev.gitlab.org:gitlab/gitlabhq.git", | ||
"description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.", | ||
"homepage": "https://dev.gitlab.org/gitlab/gitlabhq" | ||
}, | ||
"commits": [ | ||
{ | ||
"id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", | ||
"message": "Add simple search to projects in public area", | ||
"timestamp": "2013-05-13T18:18:08+00:00", | ||
"url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428", | ||
"author": { | ||
"name": "Dmitriy Zaporozhets", | ||
"email": "dmitriy.zaporozhets@gmail.com" | ||
} | ||
} | ||
], | ||
"total_commits_count": 1 | ||
}, | ||
"target_title": null | ||
}, | ||
{ | ||
"title": null, | ||
"project_id": 15, | ||
"action_name": "closed", | ||
"target_id": 840, | ||
"target_type": "Issue", | ||
"author_id": 1, | ||
"author_username": "john", | ||
"data": null, | ||
"target_title": "Finish & merge Code search PR" | ||
} | ||
] | ||
``` | ||
--- | ||
### Project Members | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#team-members | ||
#### client.projectMembers.list({id}) | ||
Get a list of a project's team members. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- query (optional) - Query string to search for members | ||
#### client.projectMembers.get({id, user_id}) | ||
Gets a project team member. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- user_id (required) - The ID of a user | ||
```json | ||
{ | ||
"id": 1, | ||
"username": "john_smith", | ||
"email": "john@example.com", | ||
"name": "John Smith", | ||
"state": "active", | ||
"created_at": "2012-05-23T08:00:58Z", | ||
"access_level": 40 | ||
} | ||
``` | ||
#### client.projectMembers.create({id, user_id, access_level}) | ||
Adds a user to a project team. This is an idempotent method and can be called multiple times with the same parameters. Adding team membership to a user that is already a member does not affect the existing membership. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- user_id (required) - The ID of a user to add | ||
- access_level (required) - Project access level | ||
#### client.projectMembers.update({id, user_id, access_level}) | ||
Updates a project team member to a specified access level. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- user_id (required) - The ID of a team member | ||
- access_level (required) - Project access level | ||
#### client.projectMembers.remove({id, user_id}) | ||
Removes a user from a project team. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- user_id (required) - The ID of a team member | ||
This method is idempotent and can be called multiple times with the same parameters. Revoking team membership for a user who is not currently a team member is considered success. Please note that the returned JSON currently differs slightly. Thus you should not rely on the returned JSON structure. | ||
--- | ||
### Repository Branches | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#branches | ||
#### client.repositoryBranches.list({id}) | ||
Lists all branches of a project. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
```json | ||
[ | ||
{ | ||
"name": "async", | ||
"commit": { | ||
"id": "a2b702edecdf41f07b42653eb1abe30ce98b9fca", | ||
"parents": [ | ||
{ | ||
"id": "3f94fc7c85061973edc9906ae170cc269b07ca55" | ||
} | ||
], | ||
"tree": "c68537c6534a02cc2b176ca1549f4ffa190b58ee", | ||
"message": "give Caolan credit where it's due (up top)", | ||
"author": { | ||
"name": "Jeremy Ashkenas", | ||
"email": "jashkenas@example.com" | ||
}, | ||
"committer": { | ||
"name": "Jeremy Ashkenas", | ||
"email": "jashkenas@example.com" | ||
}, | ||
"authored_date": "2010-12-08T21:28:50+00:00", | ||
"committed_date": "2010-12-08T21:28:50+00:00" | ||
}, | ||
"protected": false | ||
}, | ||
{ | ||
"name": "gh-pages", | ||
"commit": { | ||
"id": "101c10a60019fe870d21868835f65c25d64968fc", | ||
"parents": [ | ||
{ | ||
"id": "9c15d2e26945a665131af5d7b6d30a06ba338aaa" | ||
} | ||
], | ||
"tree": "fb5cc9d45da3014b17a876ad539976a0fb9b352a", | ||
"message": "Underscore.js 1.5.2", | ||
"author": { | ||
"name": "Jeremy Ashkenas", | ||
"email": "jashkenas@example.com" | ||
}, | ||
"committer": { | ||
"name": "Jeremy Ashkenas", | ||
"email": "jashkenas@example.com" | ||
}, | ||
"authored_date": "2013-09-07T12: 58: 21+00: 00", | ||
"committed_date": "2013-09-07T12: 58: 21+00: 00" | ||
}, | ||
"protected": false | ||
} | ||
] | ||
``` | ||
#### client.repositoryBranches.get({id, branch}) | ||
Lists a specific branch of a project. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- branch (required) - The name of the branch. | ||
#### client.repositoryBranches.protect({id, branch}) | ||
Protects a single branch of a project. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- branch (required) - The name of the branch. | ||
#### client.repositoryBranches.unprotect({id, branch}) | ||
Unprotects a single branch of a project. | ||
Parameters: | ||
- id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
- branch (required) - The name of the branch. | ||
--- | ||
### Issues | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md | ||
#### client.issues.list({id}) | ||
Get a list of project issues. This function accepts pagination parameters page and per_page to return the list of project issues. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- iid (optional) - Return the issue having the given `iid` | ||
- state (optional) - Return `all` issues or just those that are `opened` or `closed` | ||
- labels (optional) - Comma-separated list of label names | ||
- milestone (optional) - Milestone title | ||
- order_by (optional) - Return requests ordered by `created_at` or `updated_at` fields. Default is `created_at` | ||
- sort (optional) - Return requests sorted in `asc` or `desc` order. Default is `desc` | ||
#### client.issues.get({id, issue_id}) | ||
Gets a single project issue. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of a project issue | ||
```json | ||
{ | ||
"id": 42, | ||
"iid": 3, | ||
"project_id": 8, | ||
"title": "Add user settings", | ||
"description": "", | ||
"labels": [ | ||
"feature" | ||
], | ||
"milestone": { | ||
"id": 1, | ||
"title": "v1.0", | ||
"description": "", | ||
"due_date": "2012-07-20", | ||
"state": "closed", | ||
"updated_at": "2012-07-04T13:42:48Z", | ||
"created_at": "2012-07-04T13:42:48Z" | ||
}, | ||
"assignee": { | ||
"id": 2, | ||
"username": "jack_smith", | ||
"email": "jack@example.com", | ||
"name": "Jack Smith", | ||
"state": "active", | ||
"created_at": "2012-05-23T08:01:01Z" | ||
}, | ||
"author": { | ||
"id": 1, | ||
"username": "john_smith", | ||
"email": "john@example.com", | ||
"name": "John Smith", | ||
"state": "active", | ||
"created_at": "2012-05-23T08:00:58Z" | ||
}, | ||
"state": "opened", | ||
"updated_at": "2012-07-12T13:43:19Z", | ||
"created_at": "2012-06-28T12:58:06Z" | ||
} | ||
``` | ||
#### client.issues.create({id, title, description, assignee_id, milestone_id, labels}) | ||
Creates a new project issue. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- title (required) - The title of an issue | ||
- description (optional) - The description of an issue | ||
- assignee_id (optional) - The ID of a user to assign issue | ||
- milestone_id (optional) - The ID of a milestone to assign issue | ||
- labels (optional) - Comma-separated label names for an issue | ||
If the operation is successful, 200 and the newly created issue is returned. If an error occurs, an error number and a message explaining the reason is returned. | ||
#### client.issues.update({id, issue_id, title, description, assignee_id, milestone_id, labels}) | ||
Updates an existing project issue. This function is also used to mark an issue as closed. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of a project's issue | ||
- title (optional) - The title of an issue | ||
- description (optional) - The description of an issue | ||
- assignee_id (optional) - The ID of a user to assign issue | ||
- milestone_id (optional) - The ID of a milestone to assign issue | ||
- labels (optional) - Comma-separated label names for an issue | ||
- state_event (optional) - The state event of an issue ('close' to close issue and 'reopen' to reopen it) | ||
If the operation is successful, 200 and the updated issue is returned. If an error occurs, an error number and a message explaining the reason is returned. | ||
#### client.issues.listNotes({id, issue_id}) | ||
Gets a list of all notes for a single issue. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of an issue | ||
```json | ||
[ | ||
{ | ||
"id": 302, | ||
"body": "Status changed to closed", | ||
"attachment": null, | ||
"author": { | ||
"id": 1, | ||
"username": "pipin", | ||
"email": "admin@example.com", | ||
"name": "Pip", | ||
"state": "active", | ||
"created_at": "2013-09-30T13:46:01Z" | ||
}, | ||
"created_at": "2013-10-02T09:22:45Z" | ||
}, | ||
{ | ||
"id": 305, | ||
"body": "Text of the comment\r\n", | ||
"attachment": null, | ||
"author": { | ||
"id": 1, | ||
"username": "pipin", | ||
"email": "admin@example.com", | ||
"name": "Pip", | ||
"state": "active", | ||
"created_at": "2013-09-30T13:46:01Z" | ||
}, | ||
"created_at": "2013-10-02T09:56:03Z" | ||
} | ||
] | ||
``` | ||
#### client.issues.getNote({id, issue_id, note_id}) | ||
Returns a single note for a specific project issue | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of a project issue | ||
- note_id (required) - The ID of an issue note | ||
#### client.issues.createNote({id, issue_id}) | ||
Creates a new note to a single project issue. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of an issue | ||
- body (required) - The content of a note | ||
#### client.issues.updateNote({id, issue_id, note_id}) | ||
Modify existing note of an issue. | ||
Parameters: | ||
- id (required) - The ID of a project | ||
- issue_id (required) - The ID of an issue | ||
- note_id (required) - The ID of a note | ||
- body (required) - The content of a note | ||
### Milestones | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/milestones.md | ||
#### client.milestones.list({id}) | ||
Returns a list of project milestones. | ||
```json | ||
[ | ||
{ | ||
"id": 12, | ||
"iid": 3, | ||
"project_id": 16, | ||
"title": "10.0", | ||
"description": "Version", | ||
"due_date": "2013-11-29", | ||
"state": "active", | ||
"updated_at": "2013-10-02T09:24:18Z", | ||
"created_at": "2013-10-02T09:24:18Z" | ||
} | ||
] | ||
``` | ||
Parameters: | ||
- {String} id (required) - The ID of a project | ||
- {String} iid (optional) - Return the milestone having the given iid | ||
#### client.milestones.get({id, milestone_id}) | ||
Gets a single project milestone. | ||
Parameters: | ||
- {String} id (required) - The ID of a project | ||
- {String} milestone_id (required) - The ID of a project milestone | ||
#### client.milestones.create({id, title, description, due_date}) | ||
Creates a new project milestone. | ||
Parameters: | ||
- {String} 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 | ||
#### client.milestones.update({id, milestone_id, title, description, due_date}) | ||
Updates an existing project milestone. | ||
Parameters: | ||
- {String} id (required) - The ID of a project | ||
- {String} milestone_id (required) - The ID of a project milestone | ||
- {String} title (optional) - The title of a milestone | ||
- {String} description (optional) - The description of a milestone | ||
- {String} due_date (optional) - The due date of the milestone | ||
- {String} state_event (optional) - The state event of the milestone (`close`|`activate`) | ||
#### client.milestones.listIssues({id, milestone_id}) | ||
Gets all issues assigned to a single project milestone. | ||
Parameters: | ||
- {String} id (required) - The ID of a project | ||
- {String} milestone_id (required) - The ID of a project milestone | ||
### Hooks | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#hooks | ||
#### client.hooks.list({id}) | ||
Get a list of project hooks. | ||
Parameters: | ||
- {String} id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
#### client.hooks.get({id, hook_id}) | ||
Get a specific hook for a project. | ||
```json | ||
{ | ||
"id": 1, | ||
"url": "http://example.com/hook", | ||
"project_id": 3, | ||
"push_events": "true", | ||
"issues_events": "true", | ||
"merge_requests_events": "true", | ||
"created_at": "2012-10-12T17:04:47Z" | ||
} | ||
``` | ||
Parameters: | ||
* {String} id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
* {String} hook_id (required) - The ID of a project hook | ||
#### client.hooks.create({id, url, push_events, issues_events, merge_requests_events, tag_push_events}) | ||
Adds a hook to a specified project. | ||
Parameters: | ||
* {String} id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
* {String} url (required) - The hook URL | ||
* {Boolean} push_events - Trigger hook on push events, default is `true` | ||
* {Boolean} issues_events - Trigger hook on issues events | ||
* {Boolean} merge_requests_events - Trigger hook on merge_requests events | ||
* {Boolean} tag_push_events - Trigger hook on push_tag events | ||
#### client.hooks.update({id, hook_id, url, push_events, issues_events, merge_requests_events, tag_push_events}) | ||
Edits a hook for a specified project. | ||
Parameters: | ||
* {String} id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
* {String} hook_id (required) - The ID of a project hook | ||
* {String} url (required) - The hook URL | ||
* {Boolean} push_events - Trigger hook on push events, default is `true` | ||
* {Boolean} issues_events - Trigger hook on issues events | ||
* {Boolean} merge_requests_events - Trigger hook on merge_requests events | ||
* {Boolean} tag_push_events - Trigger hook on push_tag events | ||
#### client.hooks.remove({id, hook_id}) | ||
Removes a hook from a project. This is an idempotent method and can be called multiple times. Either the hook is available or not. | ||
Parameters: | ||
* {String} id (required) - The ID or NAMESPACE/PROJECT_NAME of a project | ||
* {String} hook_id (required) - The ID of a project hook | ||
### RepositoryFiles | ||
https://gitlab.com/help/api/repository_files | ||
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repository_files.md | ||
@@ -301,2 +902,3 @@ #### client.repositoryFiles.get({id, file_path, ref}) | ||
Copyright (c) 2015 repo-utils | ||
Copyright (c) 2013 - 2014 fengmk2 <fengmk2@gmail.com> | ||
@@ -303,0 +905,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
44462
17
530
922
1
+ Addeddebug@2.2.0(transitive)
+ Addedms@0.7.1(transitive)
+ Addednative-or-bluebird@1.2.0(transitive)
- Removeddebug@2.0.0(transitive)
- Removedms@0.6.2(transitive)
- Removednative-or-bluebird@1.1.2(transitive)
Updateddebug@~2.2.0
Updatednative-or-bluebird@~1.2.0
Updatedthunkify-wrap@~1.0.4