Comparing version 1.8.0 to 3.0.0
@@ -5,4 +5,3 @@ The MIT License | ||
Copyright (c) | ||
**2012-2015 Manfred Touron** <m@42.am> ([@moul](https://twitter.com/moul)), | ||
**2013-2015 Dave Irvine** ([@dave_irvine](https://twitter.com/dave_irvine)) | ||
**2017 Justin Dalrymple** | ||
@@ -9,0 +8,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
116
package.json
{ | ||
"name": "gitlab", | ||
"version": "1.8.0", | ||
"description": "GitLab API Nodejs library.", | ||
"main": "lib/index.js", | ||
"directories": { | ||
"example": "examples", | ||
"test": "test" | ||
"version": "3.0.0", | ||
"description": "Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.", | ||
"main": "dist/latest/index.js", | ||
"engines": { | ||
"node": ">=8.9.0" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha tests", | ||
"build": "./node_modules/.bin/cake build" | ||
"build:clean": "rimraf -rf dist && mkdirp -p dist", | ||
"build:es6": "babel src -d dist/latest --config-file=./.babelrc", | ||
"build:es5": "babel src -d dist/es5 --config-file=./.babelrc-es5", | ||
"build": "npm run build:clean && npm run build:es6 && npm run build:es5", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/node-gitlab/node-gitlab" | ||
"url": "https://github.com/jdalrymple/node-gitlab-api" | ||
}, | ||
"dependencies": { | ||
"debug": "*", | ||
"slumber": "0.9.0" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": ">=1.9.1", | ||
"mocha": "", | ||
"proxyquire": "~1.0.1", | ||
"chai": "~1.9.2", | ||
"sinon": "~1.10.3", | ||
"sinon-chai": "~2.6.0" | ||
}, | ||
"keywords": [ | ||
"gitlab", | ||
"git", | ||
"api", | ||
"es6", | ||
"es5", | ||
"request" | ||
], | ||
"author": "Manfred Touron <m@42.am>", | ||
"contributors": [ | ||
{ | ||
"name": "Dave Irvine", | ||
"url": "https://github.com/dave-irvine" | ||
}, | ||
{ | ||
"name": "Glavin Wiechert", | ||
"url": "https://github.com/Glavin001" | ||
}, | ||
{ | ||
"name": "Florian Quiblier", | ||
"url": "https://github.com/fofoy" | ||
}, | ||
{ | ||
"name": "Anthony Heber", | ||
"url": "https://github.com/aheber" | ||
}, | ||
{ | ||
"name": "Evan Heidtmann", | ||
"url": "https://github.com/ezheidtmann" | ||
}, | ||
{ | ||
"name": "luoqpolyvi", | ||
"url": "https://github.com/luoqpolyvi" | ||
}, | ||
{ | ||
"name": "Brian Vanderbusch", | ||
"url": "https://github.com/LongLiveCHIEF" | ||
}, | ||
{ | ||
"name": "daprahamian", | ||
"url": "https://github.com/daprahamian" | ||
}, | ||
{ | ||
"name": "pgorecki", | ||
"url": "https://github.com/pgorecki" | ||
}, | ||
{ | ||
"name": "CaoJun", | ||
"url": "https://github.com/mdsb100" | ||
}, | ||
{ | ||
"name": "nalabjp", | ||
"url": "https://github.com/nalabjp" | ||
}, | ||
{ | ||
"name": "shaoshuai0102", | ||
"url": "https://github.com/shaoshuai0102" | ||
}, | ||
{ | ||
"name": "Sakesan Panjamawat", | ||
"url": "https://github.com/sakp" | ||
} | ||
], | ||
"author": "Justin Dalrymple <justin.s.dalrymple@gmail.com>", | ||
"license": "MIT", | ||
"readmeFilename": "README.md" | ||
"readmeFilename": "README.md", | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.42", | ||
"@babel/core": "^7.0.0-beta.42", | ||
"@babel/plugin-proposal-export-default-from": "^7.0.0-beta.42", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0-beta.42", | ||
"@babel/plugin-transform-runtime": "^7.0.0-beta.42", | ||
"@babel/preset-env": "^7.0.0-beta.42", | ||
"babel-eslint": "^8.2.2", | ||
"eslint": "^4.18.1", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-plugin-import": "^2.9.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.3", | ||
"eslint-plugin-react": "^7.7.0" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0-beta.42", | ||
"humps": "^2.0.1", | ||
"lodash.pick": "^4.4.0", | ||
"parse-link-header": "^1.0.1", | ||
"request": "^2.85.0", | ||
"request-promise": "^4.2.2", | ||
"url-join": "^4.0.0" | ||
} | ||
} |
746
README.md
@@ -1,242 +0,666 @@ | ||
node-gitlab | ||
=========== | ||
[![dependencies Status](https://david-dm.org/jdalrymple/node-gitlab-api/status.svg)](https://david-dm.org/jdalrymple/node-gitlab-api)[![devDependencies Status](https://david-dm.org/jdalrymple/node-gitlab-api/dev-status.svg)](https://david-dm.org/jdalrymple/node-gitlab-api?type=dev)[![Code Climate](https://codeclimate.com/github/jdalrymple/node-gitlab-api/badges/gpa.svg)](https://codeclimate.com/github/jdalrymple/node-gitlab-api)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
[![Build Status (Travis)](https://travis-ci.org/node-gitlab/node-gitlab.png?branch=master)](https://travis-ci.org/node-gitlab/node-gitlab) | ||
[![Dependency Status](https://david-dm.org/node-gitlab/node-gitlab.png?theme=shields.io)](https://david-dm.org/node-gitlab/node-gitlab) | ||
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/node-gitlab/node-gitlab/trend.png)](https://bitdeli.com/free "Bitdeli Badge") | ||
[![Code Climate](https://codeclimate.com/github/node-gitlab/node-gitlab/badges/gpa.svg)](https://codeclimate.com/github/node-gitlab/node-gitlab) | ||
[![NPM Badge](https://nodei.co/npm/gitlab.png?downloads=true&stars=true)](https://npmjs.org/package/gitlab) | ||
-- | ||
[GitLab](https://github.com/gitlabhq/gitlabhq) API Nodejs library. | ||
It wraps the HTTP api library described [here](https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/doc/api/README.md). | ||
[![NPM](https://nodei.co/npm/node-gitlab-api.png?downloads=true&stars=true)](https://nodei.co/npm/node-gitlab-api/) | ||
Maintained by [Manfred Touron](https://github.com/moul) and [Dave Irvine](https://github.com/dave-irvine) | ||
# node-gitlab-api | ||
[GitLab](https://github.com/gitlabhq/gitlabhq) API NodeJS library with full support of all the Gitlab API services. | ||
It wraps the HTTP v4 API library described [here](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api). | ||
Install | ||
======= | ||
## Table of Contents | ||
* [Install](#install) | ||
* [Usage](#usage) | ||
* [Supported APIs](#supported-apis) | ||
* [Import](#import) | ||
* [Specific Imports](#specific-imports) | ||
* [Bundle Imports](#bundle-imports) | ||
* [Examples](#examples) | ||
* [Pagination](#pagination) | ||
* [Docs](#docs) | ||
* [Projects](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/projects.md) | ||
* [Groups](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/groups.md) | ||
* [Contributors](#contributors) | ||
* [Tests](#tests) | ||
* [License](#licence) | ||
* [Changelog](#changelog) | ||
## Install | ||
```bash | ||
# Install from npm | ||
npm install gitlab | ||
npm install node-gitlab-api | ||
``` | ||
Usage | ||
===== | ||
## Usage | ||
### Supported APIs | ||
The API's that are currently supported are: | ||
``` | ||
// General | ||
ApplicationSettings | ||
BroadcastMessages | ||
Events | ||
FeatureFlags | ||
GeoNodes | ||
GitignoreTemplates | ||
GitLabCIYMLTemplates | ||
Keys | ||
Licence | ||
LicenceTemplates | ||
Lint | ||
Namespaces | ||
NotificationSettings | ||
PagesDomains | ||
Search | ||
SidekiqMetrics | ||
SystemHooks | ||
Wikis | ||
URL to your GitLab instance should not include `/api/v3` path. | ||
// Groups | ||
Groups | ||
GroupAccessRequests | ||
GroupBadges | ||
GroupCustomAttributes | ||
GroupIssueBoards | ||
GroupMembers | ||
GroupMilestones | ||
GroupProjects | ||
GroupVariables | ||
Epics | ||
EpicIssues | ||
EpicNotes | ||
EpicDiscussions | ||
Coffee-Script | ||
------------- | ||
```coffee | ||
# Connection | ||
gitlab = (require 'gitlab') | ||
url: 'http://example.com' | ||
token: 'abcdefghij123456' | ||
// Projects | ||
Branches | ||
Commits | ||
Deployments | ||
DeployKeys | ||
Environments | ||
Issues | ||
IssueNotes | ||
IssueDiscussions | ||
IssueAwardEmojis | ||
Jobs | ||
Labels | ||
MergeRequests | ||
MergeRequestAwardEmojis | ||
MergeRequestNotes | ||
Pipelines | ||
PipelineSchedules | ||
PipelineScheduleVariables | ||
Projects | ||
ProjectAccessRequests | ||
ProjectCustomAttributes | ||
ProjectImportExport | ||
ProjectIssueBoards | ||
ProjectHooks | ||
ProjectMembers | ||
ProjectMilestones | ||
ProjectSnippets | ||
ProjectSnippetNotes | ||
ProjectSnippetDiscussions | ||
ProjectSnippetAwardEmojis | ||
ProtectedBranches | ||
ProjectVariables | ||
Repositories | ||
RepositoryFiles | ||
Runners | ||
Services | ||
Tags | ||
Todos | ||
Triggers | ||
# Listing users | ||
gitlab.users.all (users) -> | ||
console.log "##{user.id}: #{user.email}, #{user.name}, #{user.created_at}" for user in users | ||
// Users | ||
Users | ||
UserEmails | ||
UserImpersonationTokens | ||
UserKeys | ||
UserGPGKeys | ||
# Listing projects | ||
gitlab.projects.all (projects) -> | ||
for project in projects | ||
console.log "##{project.id}: #{project.name}, path: #{project.path}, default_branch: #{project.default_branch}, private: #{project.private}, owner: #{project.owner.name} (#{project.owner.email}), date: #{project.created_at}" | ||
``` | ||
### Import | ||
Javascript | ||
---------- | ||
URL to your GitLab instance should not include `/api/v4` path. | ||
Instantiate the library using a basic token created in your [Gitlab Profile](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html) | ||
```javascript | ||
// Connection | ||
var gitlab = require('gitlab')({ | ||
url: 'http://example.com', | ||
token: 'abcdefghij123456' | ||
// ES6 (>=node 8.0.0) | ||
import Gitlab from 'node-gitlab-api'; | ||
// ES5 | ||
const Gitlab = require('node-gitlab-api/dist/es5').default | ||
// Instantiating | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}) | ||
// Or, use a OAuth token instead! | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
oauthToken: 'abcdefghij123456' | ||
}) | ||
``` | ||
#### Specific Imports | ||
Sometimes you dont want to import and instantiate the whole gitlab api, perhaps you only want access to the Projects API. To do this, one only needs to import and instantiate this specific API: | ||
```javascript | ||
import { Projects } from 'node-gitlab-api'; | ||
const service = new Projects({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}) | ||
``` | ||
#### Bundle Imports | ||
It can be annoying to have to import all the API's pertaining to a specific resource. For example, the Projects resource is composed of many API's, Projects, Issues, Labels, MergeRequests, etc. For convience, there is a Bundle export for importing and instantiating all these related API's at once. | ||
```javascript | ||
import { ProjectsBundle } from 'node-gitlab-api'; | ||
const services = new ProjectsBundle({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}) | ||
services.Projects.all() | ||
services.MergeRequests.all() | ||
etc.. | ||
``` | ||
Currently there are three Bundles: | ||
1. ProjectsBundle which includes: | ||
``` | ||
Branches | ||
Commits | ||
Deployments | ||
DeployKeys | ||
Environments | ||
Issues | ||
IssueNotes | ||
IssueDiscussions | ||
IssueAwardEmojis | ||
Jobs | ||
Labels | ||
MergeRequests | ||
MergeRequestAwardEmojis | ||
MergeRequestNotes | ||
Pipelines | ||
PipelineSchedules | ||
PipelineScheduleVariables | ||
Projects | ||
ProjectAccessRequests | ||
ProjectCustomAttributes | ||
ProjectImportExport | ||
ProjectIssueBoards | ||
ProjectHooks | ||
ProjectMembers | ||
ProjectMilestones | ||
ProjectSnippets | ||
ProjectSnippetNotes | ||
ProjectSnippetDiscussions | ||
ProjectSnippetAwardEmojis | ||
ProtectedBranches | ||
ProjectVariables | ||
Repositories | ||
RepositoryFiles | ||
Runners | ||
Services | ||
Tags | ||
Todos | ||
Triggers | ||
``` | ||
2. UsersBundle which includes: | ||
``` | ||
Users, | ||
UserEmails, | ||
UserImpersonationTokens, | ||
UserKeys, | ||
UserGPGKeys | ||
``` | ||
3. GroupsBundle which includes: | ||
``` | ||
Groups | ||
GroupAccessRequests | ||
GroupBadges | ||
GroupCustomAttributes | ||
GroupIssueBoards | ||
GroupMembers | ||
GroupMilestones | ||
GroupProjects | ||
GroupVariables | ||
Epics | ||
EpicIssues | ||
EpicNotes | ||
EpicDiscussions | ||
``` | ||
### Examples | ||
Once you have your library instantiated, you can utilize many of the API's functionality: | ||
Using the await/async method | ||
```javascript | ||
import Gitlab from 'node-gitlab-api'; | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}); | ||
// Listing users | ||
gitlab.users.all(function(users) { | ||
for (var i = 0; i < users.length; i++) { | ||
console.log("#" + users[i].id + ": " + users[i].email + ", " + users[i].name + ", " + users[i].created_at); | ||
} | ||
let users = await api.Users.all(); | ||
// Or using Promise-Then notation | ||
api.Projects.all() | ||
.then((projects) => { | ||
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 | ||
import Gitlab from 'node-gitlab-api'; | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}); | ||
// Listing projects | ||
gitlab.projects.all(function(projects) { | ||
for (var i = 0; i < projects.length; i++) { | ||
console.log("#" + projects[i].id + ": " + projects[i].name + ", path: " + projects[i].path + ", default_branch: " + projects[i].default_branch + ", private: " + projects[i]["private"] + ", owner: " + projects[i].owner.name + " (" + projects[i].owner.email + "), date: " + projects[i].created_at); | ||
} | ||
api.Projects.create(projectId, { | ||
//options defined in the Gitlab API documentation | ||
}) | ||
``` | ||
### Pagination | ||
For any .all() function on a resource, it will return all the items from Gitlab. This can be troublesome if there are many items, as the request it self can take a while to be fulfilled. As such, a maxPages option can be passed to limit the scope of the all function. | ||
```javascript | ||
import Gitlab from 'node-gitlab-api'; | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}); | ||
let projects = await api.Projects.all({maxPages:2}); | ||
``` | ||
See [Examples directory](https://github.com/node-gitlab/node-gitlab/tree/master/examples) for more examples | ||
You can also use this in conjunction to the perPage argument which would override the default of 30 per page set by Gitlab: | ||
Develop | ||
======= | ||
```javascript | ||
import Gitlab from 'node-gitlab-api'; | ||
[![Gitter chat](https://badges.gitter.im/node-gitlab/node-gitlab.png)](https://gitter.im/node-gitlab/node-gitlab) | ||
const api = new Gitlab({ | ||
url: 'http://example.com', // Defaults to http://gitlab.com | ||
token: 'abcdefghij123456' //Can be created in your profile. | ||
}); | ||
Edit the Coffee-Script files in `src`, then build them using `cake build`. | ||
Use `cake watch` to build files continuously while developing. | ||
let projects = await api.Projects.all({maxPages:2, perPage:40}); | ||
CLI | ||
--- | ||
``` | ||
Check out [cli-gitlab](https://github.com/mdsb100/cli-gitlab) | ||
## Docs | ||
Although there are the official docs for the API, there are some extra goodies offered by this package! After the 3.0.0 release, the next large project will be putting together proper documention for these goodies [#39]! Stay tuned!! | ||
Contributors | ||
------------ | ||
## Tests | ||
- [Glavin Wiechert](https://github.com/Glavin001) | ||
- [Florian Quiblier](https://github.com/fofoy) | ||
- [Anthony Heber](https://github.com/aheber) | ||
- [Evan Heidtmann](https://github.com/ezheidtmann) | ||
- [luoqpolyvi](https://github.com/luoqpolyvi) | ||
- [Brian Vanderbusch](https://github.com/LongLiveCHIEF) | ||
- [daprahamian](https://github.com/daprahamian) | ||
- [pgorecki](https://github.com/pgorecki) | ||
- [CaoJun](https://github.com/mdsb100) | ||
- [nalabjp](https://github.com/nalabjp) | ||
- [shaoshuai0102](https://github.com/shaoshuai0102) | ||
- [Sakesan Panjamawat](https://github.com/sakp) | ||
- [Jose Jiménez](https://github.com/jjimenezlopez) | ||
- [huhgawz](https://github.com/huhgawz) | ||
- [Connor Weng](https://github.com/ConnorWeng) | ||
- [Felix Fichte](https://github.com/spruce) | ||
- [Steve Norman](https://github.com/stevenorman) | ||
- [Pete Ward](https://github.com/peteward44) | ||
- [Pieter Soudan](https://github.com/Sewdn) | ||
- [Ryan Southern](https://github.com/ryansouthern) | ||
- [Zhongyi Tong](https://github.com/geeeeeeeeek) | ||
- [mrawdon](https://github.com/mrawdon) | ||
- [Marcus M. Darden](https://github.com/marcus-darden) | ||
Nothing yet, but its on the TODO list :P | ||
License | ||
------- | ||
## Contributors | ||
MIT | ||
This started off as a fork from [node-gitlab](https://github.com/node-gitlab/node-gitlab) but I ended up rewriting much of the code. Here are the original work's [contributors](https://github.com/node-gitlab/node-gitlab#contributors). | ||
- [Dylan DesRosier](https://github.com/ddesrosier) | ||
- [Mike Wyatt](https://github.com/mikew) | ||
- [Cory Zibeill](https://github.com/coryzibell) | ||
- [Martin Bour](https://github.com/shadygrove) | ||
- [Christoph Lehmann](https://github.com/christophlehmann) | ||
- [Frank V](https://github.com/FrankV01) | ||
- [Salim Benabbou](https://github.com/Salimlou) | ||
- [Tamás Török-Vistai](https://github.com/tvtamas) | ||
- [Martin Benninger](https://github.com/MartinBenninger) | ||
- [Adam Dehnel](https://github.com/arsdehnel) | ||
- [fewieden](https://github.com/fewieden) | ||
- [Jeff Pelton](https://github.com/comster) | ||
- [Claude Abounegm](https://github.com/claude-abounegm) | ||
- [Stefan Hall](https://github.com/Marethyu1) | ||
- [Jordan Wallet](https://github.com/Mr-Wallet) | ||
Changelog | ||
========= | ||
master (unreleased) | ||
------------------- | ||
## License | ||
* No entry. | ||
[MIT](https://github.com/jdalrymple/node-gitlab-api/blob/master/LICENSE.md) | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.7.1...master) | ||
## Changelog | ||
[1.7.1](https://github.com/node-gitlab/node-gitlab/tree/v1.7.1) (2016-08-04) | ||
------------------- | ||
[3.0.0](https://github.com/jdalrymple/node-gitlab-api/tags/3.0.0) (2018-4-2) | ||
------------------ | ||
- Exporting all services seperatly ie. const { Projects } from 'node-gitlab-api'; as well as the usual default export: const Gitlab from 'node-gitlab-api' | ||
- Exporting bunbles which are groups of related API's. These include: ProjectsBundle, UsersBundle and GroupsBundle | ||
- Added events support to the Projects, and Users | ||
- Added full support for ProjectVariables and GroupVariables | ||
- Added support for Events. This is also exposed in Projects and Users under the events function | ||
- Fixed the missing options parameter for the ProjectMembers and GroupMemebers APIs in PR [#45] thanks to [Stefan Hall](https://github.com/Marethyu1) | ||
- Supporting both camelCase and snake_case option properties: `projects.all({perPage:5}) === projects.all({per_page: 5})` | ||
- Fixed problem with .all() functions where only the some of the results were being returned | ||
- Completed support for all Gitlab APIs, #49, #53 | ||
- Bug: fix create MR ([@zhangqingyv](https://github.com/zhangqingyv)) | ||
### Breaking Changes between 2.2.6 and 3.0.0 | ||
- Instantiation of the API must use the new operator consistently. See usage above. | ||
- All services being exported are not capitalized for clarity that they are themselves api's and not properties. ie. Gitlab.Projects vs Gitlab.projects | ||
- All subservices (services exposed as properties of other services) have been moved out into their own service | ||
``` | ||
ProjectRepository -> Repositories, Tags, Commits, Branches and RepositoryFiles | ||
Users -> Users, UserKeys, UserGPGKeys, UserCustomAttributes, UserVariables | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.7.0...v1.7.1) | ||
``` | ||
- Moved createTodo function from MergeRequests API to Todos API | ||
- Many services have been renamed: | ||
``` | ||
ProjectProtectedBranches -> ProtectedBranches | ||
ProjectDeployKeys -> DeployKeys | ||
ProjectEnvironments -> Enviroments | ||
ProjectJobs -> Jobs | ||
ProjectLabels -> Labels | ||
ProjectPipelines -> Pipelines | ||
ProjectRepository -> Repositories | ||
ProjectServices -> Services | ||
ProjectTriggers -> Triggers | ||
``` | ||
[1.7.0](https://github.com/node-gitlab/node-gitlab/tree/v1.7.0) (2016-07-11) | ||
---------------------- | ||
- Some services were merged: | ||
``` | ||
Issues = ProjectIssues + Issues. ProjectId is optional for all() | ||
MergeRequests = ProjectMergeRequests + MergeRequests + MergeRequestsChanges + MergeRequestsCommits + MergeRequestVersions. ProjectId is optional for all() | ||
Runners = ProjectRunners + Runners. ProjectId is optional for all() | ||
- Add support for adding a tag to a project | ||
- Add gitlab.projects.repository.compare() | ||
- Add support for portion builds API | ||
- Set slumber version to non-breaking | ||
``` | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.6.0...v1.7.0) | ||
[2.2.8](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.7) (2018-4-1) | ||
------------------ | ||
- Updating babel | ||
[2.2.7](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.7) (2018-3-15) | ||
------------------ | ||
- Fixing babel runtime | ||
[1.6.0](https://github.com/node-gitlab/node-gitlab/tree/v1.6.0) (2016-05-10) | ||
---------------------- | ||
[2.2.6](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.6) (2018-3-15) | ||
------------------ | ||
- Fixed more issues within the url concatenation | ||
- Add function to query all projects as admin | ||
- Add oauth_token option to authenticate connection | ||
- Add possibility to showFile by sha id | ||
- Add support for the GitLab services API | ||
- Fix undefined assigneeId in merge request (#111) | ||
[2.2.5](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.5) (2018-3-15) | ||
------------------ | ||
- Fixed #48 - Problem with trailing `\` in url | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.5.0...v1.6.0) | ||
[2.2.4](https://github.com/jdalrymple/node-gitlab-api/5d7c031ca2b833b28633647195560379d88ba5b3) (2018-2-12) | ||
------------------ | ||
- Fixing babel runtime | ||
[1.5.0](https://github.com/node-gitlab/node-gitlab/tree/v1.5.0) (2015-11-26) | ||
---------------------- | ||
[2.2.6](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.6) (2018-3-15) | ||
------------------ | ||
- Fixed more issues within the url concatenation | ||
- Add `Project.edit` | ||
- Add `Projects.create_for_user` | ||
- Add ssh key to user | ||
- Add Projects forks | ||
[2.2.5](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.5) (2018-3-15) | ||
------------------ | ||
- Fixed #48 - Problem with trailing `\` in url | ||
Thanks to [@peteward44](https://github.com/peteward44), | ||
[@Sewdn](https://github.com/Sewdn), [@ryansouthern](https://github.com/ryansouthern) | ||
and [@geeeeeeeeek](https://github.com/geeeeeeeeek) | ||
[2.2.4](https://github.com/jdalrymple/node-gitlab-api/ce7f17693168b5dec3b36eb1d5ab796c9374613f) (2018-2-3) | ||
------------------ | ||
- Fixed #33 - Bug within the es5 transpilling configuration | ||
- Fixed the missing options for tags.all #40 | ||
- Added delete key method to UserKeys.js #41 thanks to [Claude Abounegm](https://github.com/claude-abounegm) | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.4.1...v1.5.0) | ||
[2.2.3](https://github.com/jdalrymple/node-gitlab-api/ce7f17693168b5dec3b36eb1d5ab796c9374613f) (2018-2-3) | ||
------------------ | ||
- Fixed #37 - Bug within the customAttributes logic | ||
1.4.1 (2015-08-11) | ||
[2.2.2](https://github.com/jdalrymple/node-gitlab-api/ca1906879d869bf5b9aca0b2f64e46c89f3b5f4f) (2018-1-24) | ||
------------------ | ||
- Fixing bug with the version support | ||
- Coffee rebuild | ||
[2.2.1](https://github.com/jdalrymple/node-gitlab-api/e864064c98feda59d594d77b67f7d0657db78700) (2018-1-23) | ||
------------------ | ||
- Added support for the Version API through version.show() | ||
[1.4.0](https://github.com/node-gitlab/node-gitlab/tree/v1.4.0) (2015-08-11) | ||
[2.2.0](https://github.com/jdalrymple/node-gitlab-api/96e414a75ad97e88ecaaff15a6c1409a9e27b963) (2018-1-18) | ||
------------------ | ||
- Fixed the missing options parameter for the ProjectRepositoryCommitComment's model thanks to [Martin Benninger](https://github.com/MartinBenninger) in PR [#21](https://github.com/jdalrymple/node-gitlab-api/pull/21) | ||
- Removal of the left over debug console.logs's within project issues again by [Martin Benninger](https://github.com/MartinBenninger) in PR [#21](https://github.com/jdalrymple/node-gitlab-api/pull/22) | ||
- Added proper docs for ProjectRepositoryFiles, enabled default urlEncoding for the passed in file paths and also documented | ||
how to run locally via npm linking for Development testing thanks to [Adam Dehnel](https://github.com/arsdehnel) in [PR #23](https://github.com/jdalrymple/node-gitlab-api/pull/23) | ||
- Exposed the Merge Requests resource which was missing from the exports list thanks to [fewieden](https://github.com/fewieden) in [PR #26](https://github.com/jdalrymple/node-gitlab-api/pull/26) | ||
- Added support for the Project Enviroments API and the Project Jobs API thanks to [Jeff Pelton](https://github.com/comster) in [PR #28](https://github.com/jdalrymple/node-gitlab-api/pull/28) | ||
- Fixing parse function to handle encoded urls that don't include '/' such as in groups #24 | ||
- Now using headers for PRIVATE-TOKEN | ||
- Add `Groups.create`, `Groups.addProject` and `Groups.search` methods | ||
- Add `Projects.remove` and `Projects.search` methods | ||
- Add `UserKeys` resource | ||
- Add `Users.search` method | ||
- Rename `ProjectMielstones.get` to `ProjectMilestones.all` | ||
- Handling pagination on multiple new `.all()` methods | ||
- Various stability and performance fixes | ||
### Breaking Changes between 2.1.0 and 2.2.0 | ||
- Fixed a problem with the get responses where the response contained the full request response and not just the body | ||
Thanks to [@huhgawz](https://github.com/huhgawz), | ||
[@ConnorWeng](https://github.com/ConnorWeng), [@langma](https://github.com/langma), | ||
[@spruce](https://github.com/spruce), [@stevenorman](https://github.com/stevenorman) | ||
and [@nogs](https://github.com/nogs) | ||
[2.1.0](https://github.com/jdalrymple/node-gitlab-api/0ea73235e0b465a0d4717a7e1f33251b58777b60) (2017-12-15) | ||
------------------ | ||
- Added es5 support and clarified the default supported versions of node (>=8.0.0 for default) | ||
- Updating project docs for consistency | ||
- Adding project unsharing to API. It was in the docs, but missing from the API | ||
- Updating deprecated protected branches endpoint. Previously this was `projects.branches.protect` now its `projects.protectedBranches.protect` | ||
- Added Owned Runners and Runner Jobs API | ||
### Breaking Changes between 1.3.3 and 2.1.0 | ||
- The `list` functions are no longer supported and have all been renamed to `all` | ||
- The `update` functions are no longer supported and have all been renamed to `edit` | ||
- The `addKey` function has been renamed to `add` in UserKeys class | ||
- The deploy_keys and merge_requests properties have been renamed to deployKeys and mergeRequests | ||
- Removed old group member functions from the groups class as they have been moved to the GroupMembers class. This includes the addMember, listMembers, editMember, and removeMember. These functions can now be access via group.members.add, group.members.all, group.members.edit and group.members.remove respectively. | ||
- Removed the old group project functions from the Group class. These are now located in the GroupProject class. The functions that have been removed are listProjects, addProjects. These functions can be access by group.projects.all, and group.projects.add respectively. | ||
- Updated the structure of the ProjectRepository class such that its commits, branches, tags and files are properties and can be accessed like `repository.commits.all()` etc. | ||
- Removed unused labels endpoint since it already exists under projects.labels | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.3.0...v1.4.0) | ||
[1.3.0](https://github.com/node-gitlab/node-gitlab/tree/v1.3.0) (2015-02-09) | ||
[2.0.1-rc.1](https://github.com/jdalrymple/node-gitlab-api/62a4d360f0ca2cd584caf852d96ced3761992072) (2017-11-29) | ||
------------------ | ||
- Updating pagination changes into v2.0.1 | ||
- Removed unused labels endpoint since it already exists under projects.labels | ||
- Added a mergeRequests class for the merge_requests endpoints | ||
- Extended the ProjectMergeRequests class for additional functionality that was missing for project merge requests such as | ||
accepting merge requests, cancelling merges when the pipeline succeeds, listing issues that will close on merge, subscribing/unsubscribing to merges, creating todos, time spent and time estimates as well as time stats. | ||
- Fixed the notes endpoints for ProjectMergeRequests. This can now be access via projects.mergeRequests.notes.[command here] | ||
- Added comments endpoints to the ProjectRepositoryCommits class | ||
- Added the ability to post a status to a specific commit to the Project class | ||
- Now handling notes | ||
- Now handling lables | ||
- Added Groups.addMember() and Groups.access_levels | ||
- Checking for permissions | ||
- Added tests | ||
- Code cleanup and various small improvements | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.2.0...v1.3.0) | ||
[1.3.3](https://github.com/jdalrymple/node-gitlab-api/b8a3db4a4aaf9482fb3905883d92d940babfb461) (2017-11-29) | ||
------------------ | ||
- Adding pagination to project pipelines thanks to [Tamás Török-Vistai](https://github.com/tvtamas) | ||
[2.0.0-rc.2](https://github.com/jdalrymple/node-gitlab-api/62a4d360f0ca2cd584caf852d96ced3761992072) (2017-11-28) | ||
------------------ | ||
- Updating all recent core changes into v2.0.0 | ||
[1.2.0](https://github.com/node-gitlab/node-gitlab/tree/v1.2.0) (2014-12-24) | ||
[1.3.2](https://github.com/jdalrymple/node-gitlab-api/87e3d4b0a9616c19d69e3d6213c196948240d93e) (2017-11-28) | ||
------------------ | ||
- Adding default values for the BaseModel options parameter. | ||
- Switched to new organization, some urls changed | ||
- Improve development tools | ||
- Cleaned code | ||
- Changed AddHook parameters | ||
- Happy Christmas | ||
[1.3.1](https://github.com/jdalrymple/node-gitlab-api/ba80ac10e1e08176da7a3a9848758a989a7199dd) (2017-11-27) | ||
------------------ | ||
- Fixed broken argument reference in the showFile and showFileRaw functions. | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.1.0...v1.2.0) | ||
[2.0.0-rc.1](https://github.com/jdalrymple/node-gitlab-api/7246896c7bad7b238179109d1d6a391b0c2ef302) (2017-11-25) | ||
------------------ | ||
- Updated project docs for clarity | ||
- Cleaned up many linting problems within the class models | ||
- Removed mutator operations on the options arguments | ||
- Renamed ProjectKeys to ProjectDeployKeys | ||
- Renamed `list` functions to `all` for consistency | ||
- Renamed `update` functions to `edit` for consistency | ||
- Renaming addKey just to add in UserKeys class | ||
- Renaming deploy_keys and merge_requests to deployKeys and mergeRequests for consistency | ||
- Adding Project Access Requests | ||
- Removing old group member functions from the groups class as they have been moved to the GroupMembers class. This includes the addMember, listMembers, editMember, and removeMember. These functions can now be access via group.members.add, group.members.all, group.members.edit and group.members.remove respectively. | ||
- Removed the old group project functions from the Group class. These are now located in the GroupProject class. The functions that have been removed are listProjects, addProjects. These functions can be access by group.projects.all, and group.projects.add respectively. | ||
- Methods in the ProjectDeployKeys class updated for consistency | ||
- Methods in the ProjectHooks updated for consistency | ||
- Updated the structure of the ProjectRepository class with commits, branches, tags and files properties. | ||
- Added contributors, showBlob and showBlobRaw functions to the ProjectRepository class | ||
[1.1.0](https://github.com/node-gitlab/node-gitlab/tree/v1.1.0) (2014-11-04) | ||
[1.3.0](https://github.com/jdalrymple/node-gitlab-api/3048a3989fabe3992044baccdab1e53257f0f379) (2017-11-25) | ||
------------------ | ||
- Extending the Groups API, see docs for a full overview. | ||
- Added project branch support | ||
- Improved compatibility with API | ||
- Improved global error handling | ||
- Rebuilt javascript using latest Coffee-Script | ||
[Full commits list](https://github.com/node-gitlab/node-gitlab/compare/v1.0.0...v1.1.0) | ||
[1.2.0](https://github.com/jdalrymple/node-gitlab-api/b08779a321fb25668df1e0f7e001394679cc47ba) (2017-11-25) | ||
------------------ | ||
- Adding fix to the API constructor to include the [missing oauthToken](https://github.com/jdalrymple/node-gitlab-api/pulls?q=is%3Apr+is%3Aclosed) thanks to [Salim Benabbou](https://github.com/Salimlou). | ||
- Updated some of the outdated gitlab repository file endpoints outlined in [Issue #11](https://github.com/jdalrymple/node-gitlab-api/issues/11): [showFile](https://docs.gitlab.com/ee/api/repository_files.html#get-file-from-repository), [updateFile](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository), and [createFile](https://docs.gitlab.com/ee/api/repository_files.html#create-new-file-in-repository). Also added [deleteFile](https://docs.gitlab.com/ee/api/repository_files.html#delete-existing-file-in-repository) and [showRawFile](https://docs.gitlab.com/ee/api/repository_files.html#get-raw-file-from-repository). | ||
- Fixing bug where many pages where attempted to be loaded on every GET request. | ||
[1.0.0](https://github.com/node-gitlab/node-gitlab/tree/v1.0.0) (2014-08-19) | ||
[1.1.4](https://github.com/jdalrymple/node-gitlab-api/328bc29fe48d1bf18c83779a214cce34e80dda09) (2017-11-17) | ||
------------------ | ||
- Library maintenance, cleaning up spelling errors, updating dependencies, adding to contributors lists etc. | ||
- Not fully stable, need more tests | ||
- Now we have a CHANGELOG | ||
[1.1.3](https://github.com/jdalrymple/node-gitlab-api/6f28ce1726ce371d4b0272d5f8305080d51e3e25) (2017-11-17) | ||
------------------ | ||
- Fixing typos in the project sharing (group_access) thanks to [Christoph Lehmann](https://github.com/christophlehmann) | ||
- Updated the ReadMe to be more clear based on suggestions from [Frank V](https://github.com/FrankV01) | ||
[POC](https://github.com/node-gitlab/node-gitlab/tree/e7a5eedea4c27aed8bd567a3c455ec311b915d60) (2012-12-11) | ||
---------------- | ||
[1.1.2](https://github.com/jdalrymple/node-gitlab-api/36570c32be7cd564bda9c7c7dc07059987969bd4) (2017-10-29) | ||
------------------ | ||
- Updated the protected branch functionality by adding an options parameter originally proposed by [Martin Bour](https://github.com/shadygrove) | ||
- Removed old paging logic from groups | ||
- Updating library dependencies | ||
- POC | ||
[1.1.1](https://github.com/jdalrymple/node-gitlab-api/67df1c8772614b3856f2995eaa7d260d0f697e49) (2017-09-24) | ||
------------------ | ||
- Patch, fixed a broken pagination property | ||
- Adding in missing options parameter in the groups API thanks to a pull request from [Cory Zibell](https://github.com/coryzibell) | ||
[1.1.0](https://github.com/jdalrymple/node-gitlab-api/385ef9f351981f26180e1381525ade458bcde1cd) (2017-09-24) | ||
------------------ | ||
- Adding proper pagination support thanks to a problem noticed by [Mike Wyatt](https://github.com/mikew) | ||
[1.0.14](https://github.com/jdalrymple/node-gitlab-api/b8fb74828503f0a6432376ad156b7f9e33f6228e) (2017-08-1) | ||
------------------ | ||
- Adding default file name for file uploads. If none is supplied, the file name is | ||
inferred from the file path | ||
[1.0.13](https://github.com/jdalrymple/node-gitlab-api/3eb244a5b487f487859f750e46c8fa287b4455c4) (2017-07-31) | ||
------------------ | ||
- Fixed another bug in the project file upload functionality | ||
[1.0.12](https://github.com/jdalrymple/node-gitlab-api/commit/6f77ee0a462a19ae65bd6206eb94c72e271ba673) (2017-07-30) | ||
------------------ | ||
- Added issue links (for related issues) | ||
- Fixed project file upload | ||
[1.0.11](https://github.com/jdalrymple/node-gitlab-api/commit/af4eb6955f583b5be4a4032d2d532d81bb2cf54d) (2017-07-20) | ||
------------------ | ||
- Fixing the problem where Id was used instead of IId's for Project issues | ||
- Fixing the naming convention for Project Issues | ||
- Standardized the use of parseInt in the code base | ||
- Removed instances of duplicate code found by code climate | ||
[1.0.10](https://github.com/jdalrymple/node-gitlab-api/commit/c4a55aba89d83fda1552b3d5688b090b0c2b60aa) (2017-07-13) | ||
------------------ | ||
- Fixing Issues #1, #2, and #3 | ||
[1.0.9](https://github.com/jdalrymple/node-gitlab-api/commit/7a90dbb6354fe956fff37c56f938a833e3fc5ea1) (2017-07-06) | ||
------------------ | ||
- Fixing broken Notes API reference | ||
- Added Project triggers, members and hooks docs | ||
- Moved Project Runners into its own scope and separated out general Runners API logic | ||
[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 dependency 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 | ||
## Development | ||
To get this running locally rather than from your `node_modules` folder: | ||
```bash | ||
$ git clone https://github.com/jdalrymple/node-gitlab-api.git | ||
$ cd node-gitlab-api | ||
$ npm install | ||
$ npm build | ||
``` | ||
And then inside whatever project you are using `node-gitlab-api` in you change your references to use that repo. In your package.json of that upstream project change: | ||
```json | ||
"dependencies": { | ||
... | ||
"node-gitlab-api": "2.1.0" | ||
... | ||
} | ||
``` | ||
to this | ||
```json | ||
"dependencies": { | ||
... | ||
"node-gitlab-api": "<path-to-your-clone>" | ||
... | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
474103
293
10652
0
666
7
12
3
2
+ Addedhumps@^2.0.1
+ Addedlodash.pick@^4.4.0
+ Addedparse-link-header@^1.0.1
+ Addedrequest@^2.85.0
+ Addedrequest-promise@^4.2.2
+ Addedurl-join@^4.0.0
+ Added@babel/runtime@7.26.0(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedhumps@2.0.1(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.pick@4.4.0(transitive)
+ Addedparse-link-header@1.0.1(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedrequest-promise@4.2.6(transitive)
+ Addedrequest-promise-core@1.1.4(transitive)
+ Addedstealthy-require@1.1.1(transitive)
+ Addedurl-join@4.0.1(transitive)
+ Addedxtend@4.0.2(transitive)
- Removeddebug@*
- Removedslumber@0.9.0
- Removedargparse@0.1.16(transitive)
- Removeddebug@2.6.94.3.7(transitive)
- Removedglob@3.1.21(transitive)
- Removedgraceful-fs@1.2.3(transitive)
- Removedinherits@1.0.2(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.2.14(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removedquerystring@0.2.0(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedslumber@0.9.0(transitive)
- Removedunderscore@1.7.0(transitive)
- Removedunderscore.string@2.4.0(transitive)
- Removedyamljs@0.1.6(transitive)