mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
node-gitlab-api
GitLab API Nodejs library. It wraps the HTTP v4 api library described here.
Table of Contents
Install
# Install from npm
npm install gitlab
Usage
URL to your GitLab instance should not include /api/v4 path.
// Connection with basic token
const GitlabAPI = require('gitlab-api')({
url: 'http://example.com', // Defaults to http://gitlab.com
token: 'abcdefghij123456'
})
// Connection with oauth token
const GitlabAPI = require('gitlab-api')({
url: 'http://example.com', // Defaults to http://gitlab.com
oauthToken: 'abcdefghij123456'
})
// Listing users
let users = await gitlab.users.all();
console.log(users);
// Listing projects
let projects = await gitlab.projects.all();
console.log(projects);
General rule about all the function parameters:
- If its a required parameter, it is a named argument in the functions
- If its an optional parameter, it is defined in a options object following the named arguments
ie.
GitlabAPI.projects.create(projectId, {
//options defined in the gitlab api documentation
})
Docs
Although there are the offical docs for the API, i realised i should still explain the function calls in this library, so i wrote some up!
Contributors
This started off as a fork from node-gitlab but I ended up rewriting 90% of the code. Here are the original work's contributers.
License
MIT
Changelog
1.0.8 (2017-06-30)
- Adding more to the Project Issue Notes API
- Updating Readme to show examples of connecting with oauth tokens
- Begun adding documentation for projects
1.0.7 (2017-06-23)
- Fixing bug within the Issues API; reference to an old function.
1.0.6 (2017-06-23)
- Fixing bug within the Labels API; Missing required argument.
1.0.5 (2017-06-23)
- Fixing bug within the delete API calls. It was missing query parameters
1.0.4 (2017-06-23)
- Adding more to the Labels API
- Cleaned up the Issues class
1.0.3 (2017-06-23)
- Updating problems within the Milestone API
- Removed the old 'list' calls for projects and issues which displayed a deprecated message. Only all is available now.
1.0.2 (2017-06-22)
- Updating examples in readme
- Adding dependancy badges
- Removing unused test files
1.0.1 (2017-06-21)
- Initial release
- TODO: Tests, Examples
Description
Languages
TypeScript
98.7%
JavaScript
1.1%
Shell
0.1%
