mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-02-01 16:47:23 +00:00
135 lines
4.3 KiB
Markdown
135 lines
4.3 KiB
Markdown
[](https://david-dm.org/jdalrymple/node-test#info=dependencies) [](https://david-dm.org/jdalrymple/node-test#info=devDependencies)
|
|
|
|
[](https://nodei.co/npm/node-gitlab-api/)
|
|
|
|
node-gitlab-api
|
|
===============
|
|
|
|
[GitLab](https://github.com/gitlabhq/gitlabhq) API Nodejs library.
|
|
It wraps the HTTP v4 api library described [here](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api).
|
|
|
|
Table of Contents
|
|
==================
|
|
* [Install](#install)
|
|
* [Usage](#usage)
|
|
* [Docs](#docs)
|
|
* [Projects](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/projects.md)
|
|
* [Contributors](#contributors)
|
|
* [License](#licence)
|
|
* [Changelog](#changelog)
|
|
|
|
Install
|
|
=======
|
|
|
|
```bash
|
|
# Install from npm
|
|
npm install gitlab
|
|
```
|
|
|
|
Usage
|
|
=====
|
|
|
|
URL to your GitLab instance should not include `/api/v4` path.
|
|
|
|
```javascript
|
|
// 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.
|
|
|
|
```javascript
|
|
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!
|
|
|
|
* [Projects](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/projects.md)
|
|
|
|
Contributors
|
|
============
|
|
This started off as a fork from [node-gitlab](https://github.com/node-gitlab/node-gitlab) but I ended up rewriting 90% of the code. Here are the original work's [contributers](https://github.com/node-gitlab/node-gitlab#contributors).
|
|
|
|
- [Dylan DesRosier](https://github.com/ddesrosier)
|
|
|
|
|
|
License
|
|
=======
|
|
|
|
MIT
|
|
|
|
Changelog
|
|
=========
|
|
|
|
[1.0.9]() (2017-07-06)
|
|
------------------
|
|
- Fixing broken Notes API reference
|
|
- Finished the Projects documentation
|
|
|
|
[1.0.8](https://github.com/jdalrymple/node-gitlab-api/commit/491a707624ba9f58818014eacfeb7182b8ecf800) (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](https://github.com/jdalrymple/node-gitlab-api/commit/50642ad764ecd20d2a9e279cf2a47e7b5efe8f07) (2017-06-23)
|
|
------------------
|
|
- Fixing bug within the Issues API; reference to an old function.
|
|
|
|
[1.0.6](https://github.com/jdalrymple/node-gitlab-api/commit/2b02d1e354c1c267683d10b893ad055fe856a214) (2017-06-23)
|
|
------------------
|
|
- Fixing bug within the Labels API; Missing required argument.
|
|
|
|
[1.0.5](https://github.com/jdalrymple/node-gitlab-api/commit/03a22b46a62d7b68937575b0b74b6fd3496f7cbf) (2017-06-23)
|
|
------------------
|
|
- Fixing bug within the delete API calls. It was missing query parameters
|
|
|
|
[1.0.4](https://github.com/jdalrymple/node-gitlab-api/commit/9d9ef2615c6dd778a3fb1c6140d5ce009c421bb1) (2017-06-23)
|
|
------------------
|
|
- Adding more to the Labels API
|
|
- Cleaned up the Issues class
|
|
|
|
[1.0.3](https://github.com/jdalrymple/node-gitlab-api/commit/fe5a5fbb8d01fb670b7c7b14ce2c5b7f30d71fe5) (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](https://github.com/jdalrymple/node-gitlab-api/commit/a295d5a613efa13be79fec5fa2835076047cdcc5) (2017-06-22)
|
|
------------------
|
|
- Updating examples in readme
|
|
- Adding dependancy badges
|
|
- Removing unused test files
|
|
|
|
[1.0.1](https://github.com/jdalrymple/node-gitlab-api/commit/64a8f8c7720f5df9a67d3f26cc8712fc21eb3ac0) (2017-06-21)
|
|
------------------
|
|
- Initial release
|
|
- TODO: Tests, Examples
|
|
|