mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
commit
9ff4959729
@ -7,6 +7,11 @@ engines:
|
||||
languages:
|
||||
javascript:
|
||||
mass_threshold: 65
|
||||
shellcheck:
|
||||
enabled: true
|
||||
checks:
|
||||
method-count:
|
||||
enabled: false
|
||||
ratings:
|
||||
paths:
|
||||
- "**.js"
|
||||
17
.eslintrc
17
.eslintrc
@ -1,17 +0,0 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"env":
|
||||
{
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "airbnb",
|
||||
"rules": {
|
||||
"arrow-body-style": [2, "as-needed"],
|
||||
"no-param-reassign": [
|
||||
"error", {
|
||||
"props": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
12
.eslintrc.yaml
Normal file
12
.eslintrc.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
env:
|
||||
node: true
|
||||
browser: true
|
||||
parser: babel-eslint
|
||||
extends:
|
||||
- airbnb
|
||||
rules:
|
||||
arrow-body-style: [2, "as-needed"]
|
||||
no-param-reassign: ["error", {"props":false}]
|
||||
import/prefer-default-export: 1
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
node_modules
|
||||
logs
|
||||
npm-debug.log
|
||||
dist
|
||||
323
README.md
323
README.md
@ -13,7 +13,10 @@ It wraps the HTTP v4 API library described [here](https://github.com/gitlabhq/gi
|
||||
|
||||
* [Install](#install)
|
||||
* [Usage](#usage)
|
||||
* [Supported APIs](#supported-apis)
|
||||
* [Import](#import)
|
||||
* [Specific Imports](#specific-imports)
|
||||
* [Bundle Imports](#bundle-imports)
|
||||
* [Examples](#examples)
|
||||
* [Pagination](#pagination)
|
||||
* [Docs](#docs)
|
||||
@ -24,6 +27,7 @@ It wraps the HTTP v4 API library described [here](https://github.com/gitlabhq/gi
|
||||
* [License](#licence)
|
||||
* [Changelog](#changelog)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
@ -32,33 +36,221 @@ npm install node-gitlab-api
|
||||
```
|
||||
|
||||
## 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
|
||||
|
||||
// Groups
|
||||
Groups
|
||||
GroupAccessRequests
|
||||
GroupBadges
|
||||
GroupCustomAttributes
|
||||
GroupIssueBoards
|
||||
GroupMembers
|
||||
GroupMilestones
|
||||
GroupProjects
|
||||
GroupVariables
|
||||
Epics
|
||||
EpicIssues
|
||||
EpicNotes
|
||||
EpicDiscussions
|
||||
|
||||
// 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
|
||||
|
||||
// Users
|
||||
Users
|
||||
UserEmails
|
||||
UserImpersonationTokens
|
||||
UserKeys
|
||||
UserGPGKeys
|
||||
|
||||
```
|
||||
### Import
|
||||
#### ES6 (>=node 8.0.0)
|
||||
|
||||
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
|
||||
const GitlabAPI = require('node-gitlab-api')({
|
||||
// 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!
|
||||
// Or, use a OAuth token instead!
|
||||
|
||||
```javascript
|
||||
const GitlabAPI = require('node-gitlab-api')({
|
||||
const api = new Gitlab({
|
||||
url: 'http://example.com', // Defaults to http://gitlab.com
|
||||
oauthToken: 'abcdefghij123456'
|
||||
})
|
||||
|
||||
```
|
||||
#### ES5
|
||||
The same parameters as above, but the require url inclues a `/dist/es5`:
|
||||
|
||||
#### 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
|
||||
const GitlabAPI = require('node-gitlab-api/dist/es5')({
|
||||
...
|
||||
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
|
||||
@ -67,14 +259,18 @@ Once you have your library instantiated, you can utilize many of the API's funct
|
||||
Using the await/async method
|
||||
|
||||
```javascript
|
||||
// Listing users
|
||||
let users = await GitlabAPI.users.all();
|
||||
```
|
||||
import Gitlab from 'node-gitlab-api';
|
||||
|
||||
Or using Promise-Then notation
|
||||
```javascript
|
||||
// Listing projects
|
||||
GitlabAPI.projects.all()
|
||||
const api = new Gitlab({
|
||||
url: 'http://example.com', // Defaults to http://gitlab.com
|
||||
token: 'abcdefghij123456' //Can be created in your profile.
|
||||
});
|
||||
|
||||
// Listing users
|
||||
let users = await api.Users.all();
|
||||
|
||||
// Or using Promise-Then notation
|
||||
api.Projects.all()
|
||||
.then((projects) => {
|
||||
console.log(projects)
|
||||
})
|
||||
@ -87,7 +283,14 @@ General rule about all the function parameters:
|
||||
ie.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.create(projectId, {
|
||||
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.
|
||||
});
|
||||
|
||||
api.Projects.create(projectId, {
|
||||
//options defined in the Gitlab API documentation
|
||||
})
|
||||
```
|
||||
@ -98,25 +301,34 @@ For any .all() function on a resource, it will return all the items from Gitlab.
|
||||
|
||||
|
||||
```javascript
|
||||
// Listing projects
|
||||
let projects = await GitlabAPI.projects.all({max_pages:2});
|
||||
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});
|
||||
|
||||
```
|
||||
|
||||
You can also use this in conjunction to the perPage argument which would override the default of 30 per page set by Gitlab:
|
||||
|
||||
```javascript
|
||||
// Listing projects
|
||||
let projects = await GitlabAPI.projects.all({max_pages:2, per_page:40});
|
||||
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, perPage:40});
|
||||
|
||||
```
|
||||
|
||||
## Docs
|
||||
|
||||
Although there are the official docs for the API, below are some additional docs for this node package! Would eventually like to document everything, but there is quite a bit to document. PR's are welcome! 😎
|
||||
|
||||
* [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)
|
||||
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!!
|
||||
|
||||
## Tests
|
||||
|
||||
@ -139,12 +351,59 @@ This started off as a fork from [node-gitlab](https://github.com/node-gitlab/nod
|
||||
- [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)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/jdalrymple/node-gitlab-api/blob/master/LICENSE.md)
|
||||
|
||||
## Changelog
|
||||
|
||||
[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
|
||||
|
||||
### 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
|
||||
|
||||
```
|
||||
- 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
|
||||
```
|
||||
|
||||
- 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()
|
||||
|
||||
```
|
||||
|
||||
[2.2.8](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.7) (2018-4-1)
|
||||
------------------
|
||||
- Updating babel
|
||||
@ -153,6 +412,18 @@ This started off as a fork from [node-gitlab](https://github.com/node-gitlab/nod
|
||||
------------------
|
||||
- Fixing babel runtime
|
||||
|
||||
[2.2.6](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.6) (2018-3-15)
|
||||
------------------
|
||||
- Fixed more issues within the url concatenation
|
||||
|
||||
[2.2.5](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.5) (2018-3-15)
|
||||
------------------
|
||||
- Fixed #48 - Problem with trailing `\` in url
|
||||
|
||||
[2.2.4](https://github.com/jdalrymple/node-gitlab-api/5d7c031ca2b833b28633647195560379d88ba5b3) (2018-2-12)
|
||||
------------------
|
||||
- Fixing babel runtime
|
||||
|
||||
[2.2.6](https://github.com/jdalrymple/node-gitlab-api/tags/2.2.6) (2018-3-15)
|
||||
------------------
|
||||
- Fixed more issues within the url concatenation
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
## Group Milestones
|
||||
|
||||
* [List all group access-requests](#list-all-group-access-requests)
|
||||
* [Request access to a group](#request-access-to-a-group)
|
||||
* [Approve a group access request](#approve-a-group-access-request)
|
||||
* [Deny a group access request](#deny-a-group-access-request)
|
||||
|
||||
### List all group access requests
|
||||
|
||||
Gets a list of access requests viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let milestones = GitlabAPI.group.accessRequests.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all access requests](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/access_requests.md#list-access-requests-for-a-group-or-project)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Request access to a group
|
||||
|
||||
Requests access for the authenticated user to a group or project.
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.accessRequest.request(groupId);
|
||||
```
|
||||
**Parameters**: [Get a milestone](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/access_requests.md#request-access-to-a-group-or-project)
|
||||
|
||||
|
||||
### Approve a group access request
|
||||
|
||||
Approves an access request for the given user.
|
||||
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.accessRequest.approve(groupId, userId);
|
||||
```
|
||||
**Parameters**: [Approve an access request](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/access_requests.md#approve-an-access-request)
|
||||
|
||||
|
||||
### Deny a group access request
|
||||
|
||||
Deny an access request for the given user.
|
||||
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.accessRequest.deny(groupId, userId);
|
||||
```
|
||||
**Parameters**: [Deny an access request](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/access_requests.md#deny-an-access-request)
|
||||
@ -1,66 +0,0 @@
|
||||
## Group Members
|
||||
|
||||
* [List all members](#list-all-members)
|
||||
* [Get a member](#get-a-member)
|
||||
* [Add a member](#add-a-member)
|
||||
* [Edit a member](#edit-a-member)
|
||||
* [Remove a member](#remove-a-member)
|
||||
|
||||
### List all members
|
||||
|
||||
Gets a list of group members viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let members = GitlabAPI.group.members.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all members](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#list-all-members-of-a-group-or-project)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Get a member
|
||||
|
||||
Gets a member of a group.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.groups.members.show(groupId, memberId);
|
||||
```
|
||||
**Parameters**: [Get a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#get-a-member-of-a-group-or-project)
|
||||
|
||||
|
||||
### Add a member
|
||||
|
||||
Gets a member of a group.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.groups.members.add(groupId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Add a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#add-a-member-to-a-group-or-project)
|
||||
|
||||
|
||||
### Edit a member
|
||||
|
||||
Edits a member of a group.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.groups.members.edit(groupId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Add a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#add-a-member-to-a-group-or-project)
|
||||
|
||||
|
||||
### Remove a member
|
||||
|
||||
Removes a member of a group.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.groups.members.remove(groupId, memberId);
|
||||
```
|
||||
**Parameters**: [Remove a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#remove-a-member-to-a-group-or-project)
|
||||
@ -1,18 +0,0 @@
|
||||
## Group Milestones Issues
|
||||
|
||||
* [List all group milestone issues](#list-all-group-milestone-issues)
|
||||
|
||||
### List all group milestone issues
|
||||
|
||||
Gets a list of all of issues associated with a specific group milestone viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let milestones = GitlabAPI.group.milestones.issues.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all group milestone issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#get-all-issues-assigned-to-a-single-milestone)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
@ -1,18 +0,0 @@
|
||||
## Group Milestones Merge Requests
|
||||
|
||||
* [List all group milestone merge requests](#list-all-group-milestone-merge-requests)
|
||||
|
||||
### List all group milestone merge requests
|
||||
|
||||
Gets a list of all of issues associated with a specific group milestone viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let milestones = GitlabAPI.group.milestones.mergeRequests.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all group milestone issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#get-all-merge-requests-assigned-to-a-single-milestone)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
@ -1,55 +0,0 @@
|
||||
## Group Milestones
|
||||
|
||||
* [List all group milestones](#list-all-group-milestones)
|
||||
* [Get a group milestone](#get-a-group-milestone)
|
||||
* [Create a group milestone](#create-a-group-milestone)
|
||||
* [Edit a group milestone](#edit-a-group-milestone)
|
||||
|
||||
### List all group milestones
|
||||
|
||||
Gets a list of group milestones viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let milestones = GitlabAPI.group.milestones.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all milestones](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#list-group-milestones)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Get a group milestone
|
||||
|
||||
Gets a group milestone.
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.milestones.show(groupId, milestoneId);
|
||||
```
|
||||
**Parameters**: [Get a milestone](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#get-single-milestone)
|
||||
|
||||
|
||||
### Create a group milestone
|
||||
|
||||
Creates a group milestone.
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.milestones.create(groupId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Create a milestone](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#create-new-milestone)
|
||||
|
||||
|
||||
### Edit a group milestone
|
||||
|
||||
Edits a group milestone.
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.milestones.edit(groupId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Edit a milestone](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/group_milestones.md#edit-milestone)
|
||||
@ -1,29 +0,0 @@
|
||||
## Group Projects
|
||||
|
||||
* [List all group projects](#list-all-group-projects)
|
||||
* [Add a project to a group](#add-a-project-to-a-group)
|
||||
|
||||
### List all group projects
|
||||
|
||||
Gets a list of group projects viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let milestones = GitlabAPI.groups.projects.all(groupId);
|
||||
```
|
||||
**Parameters**: [List all a group projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#list-a-groups-projects)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Add a project to a group
|
||||
|
||||
Adds a project to a group.
|
||||
|
||||
```javascript
|
||||
let milestone = GitlabAPI.groups.projects.add(groupId, projectId);
|
||||
```
|
||||
**Parameters**: [Transfer project to group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#transfer-project-to-group)
|
||||
110
docs/groups.md
110
docs/groups.md
@ -1,110 +0,0 @@
|
||||
# Groups API
|
||||
|
||||
* [Groups](#Groups)
|
||||
* [List all groups](#list-all-groups)
|
||||
* [List all group's subgroups](#list-all-groups-subgroups)
|
||||
* [Get a single group](#get-a-single-group)
|
||||
* [Create a group](#create-a-group)
|
||||
* [Edit a group](#edit-a-group)
|
||||
* [Search for a group](#edit-a-group)
|
||||
* [Group Members](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-members.md)
|
||||
* [Group Milestones](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-milestones.md)
|
||||
* [Group Milestones Issues](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-milestone-issues.md)
|
||||
* [Group Milestones Merge Requests](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-milestone-merge-requests.md)
|
||||
* [Group Projects](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-projects.md)
|
||||
* [Group Access Requests](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/group-access-requests.md)
|
||||
|
||||
## Groups
|
||||
|
||||
### List all groups
|
||||
|
||||
Get a list of visible Groups for authenticated user. When accessed without authentication, only public Groups are returned.
|
||||
|
||||
```javascript
|
||||
let groups = GitlabAPI.groups.all();
|
||||
```
|
||||
|
||||
**Parameters**: [List all Groups](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#list-groups)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### List all groups subgroups
|
||||
|
||||
Get a list of visible Groups for authenticated user. When accessed without authentication, only public Groups are returned.
|
||||
|
||||
```javascript
|
||||
let groups = GitlabAPI.groups.allSubgroups(groupId, { //params });
|
||||
```
|
||||
|
||||
**Parameters**: [List all Groups](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#list-a-groupss-subgroups)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Get a single group
|
||||
|
||||
Get a specific group. This endpoint can be accessed without authentication if
|
||||
the group is publicly accessible.
|
||||
|
||||
```javascript
|
||||
// From a group ID
|
||||
let groupA = GitlabAPI.groups.show(21);
|
||||
|
||||
// From a Groups url
|
||||
let groupB = GitlabAPI.groups.show('diaspora/diaspora');
|
||||
```
|
||||
|
||||
**Parameters**: [Get a single group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#details-of-a-group)
|
||||
|
||||
|
||||
### Create a group
|
||||
|
||||
Creates a new group owned by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let groupA = GitlabAPI.groups.create({
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Create a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#new-group)
|
||||
|
||||
|
||||
### Edit a group
|
||||
|
||||
Creates a new group owned by the specified user. Available only for admins.
|
||||
|
||||
```javascript
|
||||
let groupA = GitlabAPI.groups.edit(groupId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Edit a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#update-group)
|
||||
|
||||
|
||||
### Remove a group
|
||||
|
||||
Removes a group including all associated resources (issues, merge requests etc.)
|
||||
|
||||
```javascript
|
||||
GitlabAPI.groups.remove(groupId);
|
||||
```
|
||||
**Parameters**: [Remove a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#remove-group)
|
||||
|
||||
|
||||
### Search for a group
|
||||
|
||||
Searches for a group and returns a group including all associated resources (issues, merge requests etc.)
|
||||
|
||||
```javascript
|
||||
GitlabAPI.groups.search(query);
|
||||
```
|
||||
**Parameters**: [Search for a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md#search-for-group)
|
||||
@ -1,63 +0,0 @@
|
||||
## Project Hooks
|
||||
|
||||
* [Get all hooks](#get-all-hooks)
|
||||
* [Get a hook](#get-a-hook)
|
||||
* [Add a hook](#add-a-hook-to-a-project)
|
||||
* [Edit a hook](#edit-a-hook)
|
||||
* [Remove a hook](#remove-a-hook)
|
||||
|
||||
### Get all hooks
|
||||
|
||||
Get a list of project hooks.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let hooks = GitlabAPI.projects.hooks.all(projectId);
|
||||
```
|
||||
Parameters: [Get all project hooks](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#list-project-hooks)
|
||||
|
||||
### Get a hook
|
||||
|
||||
Get a specific hook for a project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let hook = GitlabAPI.projects.hooks.show(projectId, hookId);
|
||||
```
|
||||
Parameters: [Get project hook](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#get-project-hook)
|
||||
|
||||
### Add a hook to a project
|
||||
|
||||
Adds a hook to a specified project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let hook = GitlabAPI.projects.hooks.add(projectId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
Parameters: [Add a hook](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#add-project-hook)
|
||||
|
||||
### Edit a hook
|
||||
|
||||
Edits a hook for a specified project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let hook = GitlabAPI.projects.hooks.edit(projectId, hookId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
Parameters: [Edit a hook](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#edit-project-hook)
|
||||
|
||||
### Remove a hook
|
||||
|
||||
Remove a hook from a project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
GitlabAPI.projects.hooks.remove(projectId, hookId);
|
||||
```
|
||||
Parameters: [Remove a hook](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#delete-project-hook)
|
||||
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
## Project Members
|
||||
|
||||
* [Get all members](#get-all-members)
|
||||
* [Get a member](#get-a-member)
|
||||
* [Add a member](#add-a-member)
|
||||
* [Edit a member](#edit-a-member)
|
||||
* [Remove a member](#remove-a-member)
|
||||
|
||||
|
||||
### Get all members
|
||||
|
||||
Gets a list of all project members viewable by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let members = GitlabAPI.projects.members.all(projectId);
|
||||
```
|
||||
**Parameters**: [Get all members](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#list-all-members-of-a-group-or-project)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Get a member
|
||||
|
||||
Gets a member of a project.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.projects.members.show(projectId, memberId);
|
||||
```
|
||||
**Parameters**: [Get a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#get-a-member-of-a-group-or-project)
|
||||
|
||||
|
||||
### Add a member
|
||||
|
||||
Adds a member to a project.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.projects.members.add(projectId, userId, accessLevel);
|
||||
```
|
||||
**Parameters**: [Add a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#add-a-member-to-a-group-or-project)
|
||||
|
||||
|
||||
### Edit a member
|
||||
|
||||
Edits a member of a project.
|
||||
|
||||
```javascript
|
||||
let member = GitlabAPI.projects.members.edit(projectId, userId, accessLevel);
|
||||
```
|
||||
**Parameters**: [Edit a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#add-a-member-to-a-group-or-project)
|
||||
|
||||
|
||||
### Remove a member
|
||||
|
||||
Removes a member of a project.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.members.remove(projectId, memberId);
|
||||
```
|
||||
**Parameters**: [Remove a member](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/members.md#remove-a-member-to-a-group-or-project)
|
||||
@ -1,14 +0,0 @@
|
||||
## Project Repository Files
|
||||
|
||||
* [Get a file](#get-a-file)
|
||||
|
||||
### Get a file
|
||||
|
||||
Get file from repository
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let file = GitlabAPI.projects.repository.files.show(projectId, filePath, branch );
|
||||
```
|
||||
Parameters: [Get file from repository](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repository_files.md#get-file-from-repository)
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
## Project Triggers
|
||||
|
||||
* [Get all triggers](#get-all-triggers)
|
||||
* [Get a trigger](#get-a-trigger)
|
||||
* [Add a trigger](#add-a-trigger)
|
||||
* [Edit a trigger](#edit-a-trigger)
|
||||
* [Remove a trigger](#edit-a-trigger)
|
||||
|
||||
### Get all project triggers
|
||||
|
||||
Allow to share project with group.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let triggers = GitlabAPI.projects.triggers.all(projectId);
|
||||
```
|
||||
**Parameters**: [Get all project triggers](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/pipeline_triggers.md#list-project-triggers)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
### Get a trigger
|
||||
|
||||
Get details of project's build trigger.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let trigger = GitlabAPI.projects.triggers.show(projectId, triggerId);
|
||||
```
|
||||
**Parameters**: [Get trigger details](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/pipeline_triggers.md#get-trigger-details)
|
||||
|
||||
### Add a trigger
|
||||
|
||||
Create a trigger for a project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let trigger = GitlabAPI.projects.triggers.add(projectId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Create a trigger](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/pipeline_triggers.md#create-a-project-trigger)
|
||||
|
||||
### Edit a trigger
|
||||
|
||||
Edit a trigger on a project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let trigger = GitlabAPI.projects.triggers.edit(projectId, triggerId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Edit a trigger](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/pipeline_triggers.md#update-a-project-trigger)
|
||||
|
||||
### Remove a trigger
|
||||
|
||||
Remove a trigger from a project.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let trigger = GitlabAPI.projects.triggers.remove(projectId, triggerId);
|
||||
```
|
||||
**Parameters**: [Remove a trigger](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/pipeline_triggers.md#remove-a-project-trigger)
|
||||
172
docs/projects.md
172
docs/projects.md
@ -1,172 +0,0 @@
|
||||
# Projects API
|
||||
|
||||
* [Projects](#projects)
|
||||
* [Get all projects](#get-all-projects)
|
||||
* [Get a single project](#get-a-single-project)
|
||||
* [Create a project](#create-a-project)
|
||||
* [Create a project for user](#create-a-project-for-user)
|
||||
* [Edit a project](#edit-a-project)
|
||||
* [Fork a project](#fork-a-project)
|
||||
* [Star a project](#star-a-project)
|
||||
* [Unstar a project](#unstar-a-project)
|
||||
* [Remove a project](#remove-a-project)
|
||||
* [Search for a project](#search-for-a-project)
|
||||
* [Post the build status to a commit](#post-the-build-startus-to-a-commit)
|
||||
* [Share project with group](#share-project-with-group)
|
||||
* [Unshare a project with a group](#unshare-a-project-with-a-group)
|
||||
* [Project Members](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/project-members.md)
|
||||
* [Project Triggers](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/project-triggers.md)
|
||||
* [Project Hooks](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/project-hooks.md)
|
||||
* [Project Repository Files](https://github.com/jdalrymple/node-gitlab-api/blob/master/docs/project-repository-files.md)
|
||||
|
||||
## Projects
|
||||
|
||||
### Get all projects
|
||||
|
||||
Get a list of visible projects for authenticated user. When accessed without authentication, only public projects are returned.
|
||||
|
||||
```javascript
|
||||
let projects = GitlabAPI.projects.all();
|
||||
```
|
||||
|
||||
**Parameters**: [Get all projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#list-projects)
|
||||
|
||||
**Extra Parameters**
|
||||
|
||||
| Argument | Description | Type | Required | Default |
|
||||
|---------------|--------------------------|----------|----------|-------------------|
|
||||
| max_pages |Limits the amount of pages returned | Number | No | All pages |
|
||||
|
||||
|
||||
### Get a single project
|
||||
|
||||
Get a specific project. This endpoint can be accessed without authentication if
|
||||
the project is publicly accessible.
|
||||
|
||||
```javascript
|
||||
// From a project ID
|
||||
let projectA = GitlabAPI.projects.show(21);
|
||||
|
||||
// From a projects url
|
||||
let projectB = GitlabAPI.projects.show('diaspora/diaspora');
|
||||
```
|
||||
|
||||
**Parameters**: [Get a single project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#get-single-project)
|
||||
|
||||
|
||||
### Create a project
|
||||
|
||||
Creates a new project owned by the authenticated user.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.create({
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Create a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#create-project)
|
||||
|
||||
|
||||
### Create a project for user
|
||||
|
||||
Creates a new project owned by the specified user. Available only for admins.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.create({
|
||||
userId: 5,
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Create a project for user](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#create-project-for-user)
|
||||
|
||||
|
||||
### Edit a project
|
||||
|
||||
Creates a new project owned by the specified user. Available only for admins.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.edit(projectId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Edit a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#edit-project)
|
||||
|
||||
|
||||
### Fork a project
|
||||
|
||||
Forks a project into the user namespace of the authenticated user or the one provided.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.fork(projectId, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Fork a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#fork-project)
|
||||
|
||||
|
||||
### Star a project
|
||||
|
||||
Stars a given project. Returns status code `304` if the project is already starred.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.star(projectId);
|
||||
```
|
||||
**Parameters**: [Star a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#star-a-project)
|
||||
|
||||
|
||||
### Unstar a project
|
||||
|
||||
Unstars a given project. Returns status code `304` if the project is not starred.
|
||||
|
||||
```javascript
|
||||
let projectA = GitlabAPI.projects.unstar(projectId);
|
||||
```
|
||||
**Parameters**: [Unstar a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#unstar-a-project)
|
||||
|
||||
|
||||
### Remove a project
|
||||
|
||||
Removes a project including all associated resources (issues, merge requests etc.)
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.remove(projectId);
|
||||
```
|
||||
**Parameters**: [Remove a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#remove-project)
|
||||
|
||||
### Search for a project
|
||||
|
||||
Search for projects by name which are accessible to the authenticated user. This endpoint can be accessed without authentication if the project is publicly accessible.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.search(query);
|
||||
```
|
||||
**Parameters**: [Search for a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#search-for-projects-by-name)
|
||||
|
||||
### Post the build status to a commit
|
||||
|
||||
Search for projects by name which are accessible to the authenticated user. This endpoint can be accessed without authentication if the project is publicly accessible.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.search(query);
|
||||
```
|
||||
**Parameters**: [Search for a project](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#search-for-projects-by-name)
|
||||
|
||||
|
||||
### Share a project with a group
|
||||
|
||||
Allow to share project with group.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.share(projectId, groupId, groupAccess, {
|
||||
// params
|
||||
});
|
||||
```
|
||||
**Parameters**: [Share a project with a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#share-project-with-group)
|
||||
|
||||
### Unshare a project with a group
|
||||
|
||||
Unshare the project from the group.
|
||||
|
||||
```javascript
|
||||
GitlabAPI.projects.unshare(projectId, groupId);
|
||||
```
|
||||
**Parameters**: [Unshare a project with a group](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md#delete-a-shared-project-within-group)
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-gitlab-api",
|
||||
"version": "2.2.7",
|
||||
"version": "3.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -1911,7 +1911,7 @@
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"nan": "2.8.0",
|
||||
"nan": "2.10.0",
|
||||
"node-pre-gyp": "0.6.39"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -3461,9 +3461,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz",
|
||||
"integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=",
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
|
||||
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
|
||||
11
package.json
11
package.json
@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "node-gitlab-api",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "Full NodeJS implementation of the GitLab API. Supports Promises, Async/Await.",
|
||||
"main": "dist/latest/index.js",
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
"node": ">=8.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build:es6": "babel src --out-dir dist/latest --config-file=./.babelrc",
|
||||
"build:es5": "babel src --out-dir dist/es5 --config-file=./.babelrc-es5",
|
||||
"build": "npm run build:es6 && npm run build:es5",
|
||||
"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": {
|
||||
|
||||
86
src/API.js
86
src/API.js
@ -1,86 +0,0 @@
|
||||
import Request from 'request-promise';
|
||||
import URLJoin from 'url-join';
|
||||
import { Groups, Projects, Issues, Runners, Users, MergeRequests, Version } from './Models';
|
||||
|
||||
function defaultRequest(url, endpoint, {
|
||||
headers,
|
||||
body,
|
||||
qs,
|
||||
formData,
|
||||
resolveWithFullResponse = false,
|
||||
}) {
|
||||
const params = {
|
||||
url: URLJoin(url, endpoint),
|
||||
headers,
|
||||
json: true,
|
||||
};
|
||||
|
||||
if (body) params.body = body;
|
||||
if (qs) params.qs = qs;
|
||||
if (formData) params.formData = formData;
|
||||
|
||||
params.resolveWithFullResponse = resolveWithFullResponse;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
class API {
|
||||
constructor({ url = 'https://gitlab.com', token, oauthToken }) {
|
||||
this.url = URLJoin(url, 'api', 'v4');
|
||||
this.headers = {};
|
||||
|
||||
if (oauthToken) {
|
||||
this.headers.Authorization = `Bearer ${oauthToken}`;
|
||||
} else if (token) {
|
||||
this.headers['private-token'] = token;
|
||||
} else {
|
||||
throw new Error('`token` (private-token) or `oauth_token` is mandatory');
|
||||
}
|
||||
|
||||
this.groups = new Groups(this);
|
||||
this.projects = new Projects(this);
|
||||
this.issues = new Issues(this);
|
||||
this.users = new Users(this);
|
||||
this.runners = new Runners(this);
|
||||
this.mergeRequests = new MergeRequests(this);
|
||||
this.version = new Version(this);
|
||||
}
|
||||
|
||||
get(endpoint, options, fullResponse = false) {
|
||||
return Request.get(defaultRequest(this.url, endpoint, {
|
||||
headers: this.headers,
|
||||
qs: options,
|
||||
resolveWithFullResponse: fullResponse,
|
||||
}));
|
||||
}
|
||||
|
||||
post(endpoint, options) {
|
||||
return Request.post(defaultRequest(this.url, endpoint, {
|
||||
headers: this.headers,
|
||||
body: options,
|
||||
}));
|
||||
}
|
||||
|
||||
postForm(endpoint, options) {
|
||||
return Request.post(defaultRequest(this.url, endpoint, {
|
||||
headers: this.headers,
|
||||
formData: options,
|
||||
}));
|
||||
}
|
||||
|
||||
put(endpoint, options) {
|
||||
return Request.put(defaultRequest(this.url, endpoint, {
|
||||
headers: this.headers,
|
||||
body: options,
|
||||
}));
|
||||
}
|
||||
|
||||
delete(endpoint, options) {
|
||||
return Request.delete(defaultRequest(this.url, endpoint, {
|
||||
headers: this.headers,
|
||||
qs: options,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export default API;
|
||||
@ -1,51 +0,0 @@
|
||||
import LinkParser from 'parse-link-header';
|
||||
|
||||
async function getAllPages(client, endpoint, options, results = []) {
|
||||
const response = await client.get(endpoint, options, true);
|
||||
|
||||
if (!response.headers['x-page']) {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
const links = LinkParser(response.headers.link);
|
||||
const limit = options.max_pages ? response.headers['x-page'] < options.max_pages : true;
|
||||
const moreResults = results.concat(response.body);
|
||||
|
||||
if (links.next && limit) {
|
||||
return getAllPages(client, links.next.url.replace(client.url, ''), options, moreResults);
|
||||
}
|
||||
|
||||
return moreResults;
|
||||
}
|
||||
|
||||
class BaseModel {
|
||||
constructor(APIClient) {
|
||||
this.client = APIClient;
|
||||
}
|
||||
|
||||
get(endpoint, options = {}) {
|
||||
if (!options.page) {
|
||||
return getAllPages(this.client, endpoint, options);
|
||||
}
|
||||
|
||||
return this.client.get(endpoint, options);
|
||||
}
|
||||
|
||||
post(endpoint, options = {}) {
|
||||
return this.client.post(endpoint, options);
|
||||
}
|
||||
|
||||
postForm(endpoint, options = {}) {
|
||||
return this.client.postForm(endpoint, options);
|
||||
}
|
||||
|
||||
put(endpoint, options = {}) {
|
||||
return this.client.put(endpoint, options);
|
||||
}
|
||||
|
||||
delete(endpoint, options = {}) {
|
||||
return this.client.delete(endpoint, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default BaseModel;
|
||||
@ -1,18 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class GroupProjects extends BaseModel {
|
||||
all(groupId, options = {}) {
|
||||
const gId = parse(groupId);
|
||||
|
||||
return this.get(`groups/${gId}/projects`, options);
|
||||
}
|
||||
|
||||
add(groupId, projectId) {
|
||||
const [gId, pId] = [groupId, projectId].map(parse);
|
||||
|
||||
return this.post(`groups/${gId}/projects/${pId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupProjects;
|
||||
@ -1,53 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import GroupProjects from './GroupProjects';
|
||||
import ResourceAccessRequests from './ResourceAccessRequests';
|
||||
import ResourceCustomAttributes from './ResourceCustomAttributes';
|
||||
import ResourceMembers from './ResourceMembers';
|
||||
import ResourceMilestones from './ResourceMilestones';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class Groups extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.projects = new GroupProjects(...args);
|
||||
this.accessRequests = new ResourceAccessRequests('groups', ...args);
|
||||
this.customAttributes = new ResourceCustomAttributes('groups', ...args);
|
||||
this.members = new ResourceMembers('groups', ...args);
|
||||
this.milestones = new ResourceMilestones('groups', ...args);
|
||||
}
|
||||
|
||||
all(options = {}) {
|
||||
return this.get('groups', options);
|
||||
}
|
||||
|
||||
allSubgroups(groupId, options = {}) {
|
||||
const gId = parse(groupId);
|
||||
|
||||
return this.get(`groups/${gId}/subgroups`, options);
|
||||
}
|
||||
|
||||
show(groupId) {
|
||||
const gId = parse(groupId);
|
||||
|
||||
return this.get(`groups/${gId}`);
|
||||
}
|
||||
|
||||
create(options = {}) {
|
||||
return this.post('groups', options);
|
||||
}
|
||||
|
||||
remove(groupId) {
|
||||
const gId = parse(groupId);
|
||||
|
||||
return this.delete(`groups/${gId}`);
|
||||
}
|
||||
|
||||
search(nameOrPath) {
|
||||
return this.get('groups', {
|
||||
search: nameOrPath,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default Groups;
|
||||
@ -1,9 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
|
||||
class Issues extends BaseModel {
|
||||
all(options = {}) {
|
||||
return this.get('issues', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Issues;
|
||||
@ -1,9 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
|
||||
class MergeRequests extends BaseModel {
|
||||
all(options = {}) {
|
||||
return this.get('merge_requests', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default MergeRequests;
|
||||
@ -1,24 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectDeployKeys extends BaseModel {
|
||||
add(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/deploy_keys`, options);
|
||||
}
|
||||
|
||||
all(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/deploy_keys`);
|
||||
}
|
||||
|
||||
show(projectId, keyId) {
|
||||
const [pId, kId] = [projectId, keyId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/deploy_keys/${kId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectDeployKeys;
|
||||
@ -1,12 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class Environments extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/environments`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Environments;
|
||||
@ -1,36 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectHooks extends BaseModel {
|
||||
all(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/hooks`);
|
||||
}
|
||||
|
||||
show(projectId, hookId) {
|
||||
const [pId, hId] = [projectId, hookId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/hooks/${hId}`);
|
||||
}
|
||||
|
||||
add(projectId, url, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/hooks`, Object.assign({ url }, options));
|
||||
}
|
||||
|
||||
edit(projectId, hookId, url, options = {}) {
|
||||
const [pId, hId] = [projectId, hookId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/hooks/${hId}`, Object.assign({ url }, options));
|
||||
}
|
||||
|
||||
remove(projectId, hookId) {
|
||||
const [pId, hId] = [projectId, hookId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/hooks/${hId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectHooks;
|
||||
@ -1,62 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ResourceNotes from './ResourceNotes';
|
||||
|
||||
class ProjectIssues extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.notes = new ResourceNotes('projects', 'issues', ...args);
|
||||
}
|
||||
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/issues`, options);
|
||||
}
|
||||
|
||||
create(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/issues`, options);
|
||||
}
|
||||
|
||||
edit(projectId, issueId, options = {}) {
|
||||
const [pId, iId] = [projectId, issueId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/issues/${iId}`, options);
|
||||
}
|
||||
|
||||
link(projectId, issueIId, targetProjectId, targetIssueId, options = {}) {
|
||||
const [pId, iId] = [projectId, issueIId].map(parse);
|
||||
const [targetpId, targetIId] = [targetProjectId, targetIssueId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/issues/${iId}/links`, Object.assign({ target_project_id: targetpId, target_issue_id: targetIId }, options));
|
||||
}
|
||||
|
||||
remove(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/issues/${iId}`);
|
||||
}
|
||||
|
||||
show(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/issues/${iId}`);
|
||||
}
|
||||
|
||||
subscribe(projectId, issueId, options = {}) {
|
||||
const [pId, iId] = [projectId, issueId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/issues/${iId}/subscribe`, options);
|
||||
}
|
||||
|
||||
unsubscribe(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/issues/${iId}/unsubscribe`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectIssues;
|
||||
@ -1,12 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class Jobs extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/jobs`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Jobs;
|
||||
@ -1,42 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectLabels extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/labels`, options);
|
||||
}
|
||||
|
||||
create(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/labels`, options);
|
||||
}
|
||||
|
||||
edit(projectId, labelName, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.put(`projects/${pId}/labels`, Object.assign({ name: labelName }, options));
|
||||
}
|
||||
|
||||
remove(projectId, labelName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}/labels`, { name: labelName });
|
||||
}
|
||||
|
||||
subscribe(projectId, labelId, options = {}) {
|
||||
const [pId, lId] = [projectId, labelId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/issues/${lId}/subscribe`, options);
|
||||
}
|
||||
|
||||
unsubscribe(projectId, labelId) {
|
||||
const [pId, lId] = [projectId, labelId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/issues/${lId}/unsubscribe`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectLabels;
|
||||
@ -1,12 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectMergeRequestChanges extends BaseModel {
|
||||
show(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/changes`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectMergeRequestChanges;
|
||||
@ -1,12 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectMergeRequestCommits extends BaseModel {
|
||||
show(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/commits`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectMergeRequestCommits;
|
||||
@ -1,18 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectMergeRequestVersions extends BaseModel {
|
||||
all(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/versions`);
|
||||
}
|
||||
|
||||
show(projectId, mergerequestId, versionId) {
|
||||
const [pId, mId, vId] = [projectId, mergerequestId, versionId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/versions/${vId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectMergeRequestVersions;
|
||||
@ -1,120 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ProjectMergeRequestVersions from './ProjectMergeRequestVersions';
|
||||
import ProjectMergeRequestChanges from './ProjectMergeRequestChanges';
|
||||
import ProjectMergeRequestCommits from './ProjectMergeRequestCommits';
|
||||
import ResourceNotes from './ResourceNotes';
|
||||
|
||||
class ProjectMergeRequests extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.commits = new ProjectMergeRequestCommits(...args);
|
||||
this.changes = new ProjectMergeRequestChanges(...args);
|
||||
this.versions = new ProjectMergeRequestVersions(...args);
|
||||
this.notes = new ResourceNotes('projects', 'merge_requests', ...args);
|
||||
}
|
||||
|
||||
accept(projectId, mergerequestId, options = {}) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/merge_requests/${mId}/merge`, options);
|
||||
}
|
||||
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests`, options);
|
||||
}
|
||||
|
||||
cancelOnPipelineSucess(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/merge_requests/${mId}/cancel_merge_when_pipeline_succeeds`);
|
||||
}
|
||||
|
||||
closesIssues(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/closes_issues`);
|
||||
}
|
||||
|
||||
create(projectId, sourceBranch, targetBranch, title, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests`, Object.assign({
|
||||
id: pId,
|
||||
source_branch: sourceBranch,
|
||||
target_branch: targetBranch,
|
||||
title,
|
||||
}, options));
|
||||
}
|
||||
|
||||
createTodo(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/todo`);
|
||||
}
|
||||
|
||||
edit(projectId, mergerequestId, options = {}) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/merge_requests/${mId}`, options);
|
||||
}
|
||||
|
||||
remove(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/merge_requests/${mId}`);
|
||||
}
|
||||
|
||||
show(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}`);
|
||||
}
|
||||
|
||||
subscribe(projectId, mergerequestId, options = {}) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/subscribe`, options);
|
||||
}
|
||||
|
||||
resetSpentTime(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/reset_spent_time`);
|
||||
}
|
||||
|
||||
resetTimeEstimate(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/reset_time_estimate`);
|
||||
}
|
||||
|
||||
spentTime(projectId, mergerequestId, duration) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/add_spent_time`, { duration });
|
||||
}
|
||||
|
||||
timeEstimate(projectId, mergerequestId, duration) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/merge_requests/${mId}/time_estimate`, { duration });
|
||||
}
|
||||
|
||||
timeStats(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/merge_requests/${mId}/time_stats`);
|
||||
}
|
||||
|
||||
unsubscribe(projectId, mergerequestId) {
|
||||
const [pId, mId] = [projectId, mergerequestId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/merge_requests/${mId}/unsubscribe`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectMergeRequests;
|
||||
@ -1,12 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class Pipelines extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/pipelines`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Pipelines;
|
||||
@ -1,30 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectProtectedBranches extends BaseModel {
|
||||
all(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/protected_branches`);
|
||||
}
|
||||
|
||||
protect(projectId, branchName, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/protected_branches`, Object.assign(options, { name: branchName }));
|
||||
}
|
||||
|
||||
show(projectId, branchName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/protected_branches/${branchName}`);
|
||||
}
|
||||
|
||||
unprotect(projectId, branchName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}/protected_branches/${branchName}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectProtectedBranches;
|
||||
@ -1,55 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ProjectRepositoryBranches from './ProjectRepositoryBranches';
|
||||
import ProjectRepositoryTags from './ProjectRepositoryTags';
|
||||
import ProjectRepositoryCommits from './ProjectRepositoryCommits';
|
||||
import ProjectRepositoryFiles from './ProjectRepositoryFiles';
|
||||
|
||||
class ProjectRepository extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.branches = new ProjectRepositoryBranches(...args);
|
||||
this.tags = new ProjectRepositoryTags(...args);
|
||||
this.commits = new ProjectRepositoryCommits(...args);
|
||||
this.files = new ProjectRepositoryFiles(...args);
|
||||
}
|
||||
|
||||
compare(projectId, from, to) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/compare`, { from, to });
|
||||
}
|
||||
|
||||
contributors(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/contributors`);
|
||||
}
|
||||
|
||||
showArchive(projectId, { sha }) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/archive`, { sha });
|
||||
}
|
||||
|
||||
showBlob(projectId, sha) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/blobs/${sha}`);
|
||||
}
|
||||
|
||||
showBlobRaw(projectId, sha) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/blobs/${sha}/raw`);
|
||||
}
|
||||
|
||||
tree(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/tree`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepository;
|
||||
@ -1,42 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectRepositoryBranches extends BaseModel {
|
||||
all(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/branches`);
|
||||
}
|
||||
|
||||
create(projectId, branchName, ref) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/repository/branches`, { branch: branchName, ref });
|
||||
}
|
||||
|
||||
protect(projectId, branchName, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.put(`projects/${pId}/repository/branches/${branchName}/protect`, options);
|
||||
}
|
||||
|
||||
remove(projectId, branchName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}/repository/branches/${branchName}`);
|
||||
}
|
||||
|
||||
show(projectId, branchName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/branches/${branchName}`);
|
||||
}
|
||||
|
||||
unprotect(projectId, branchName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.put(`projects/${pId}/repository/branches/${branchName}/unprotect`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepositoryBranches;
|
||||
@ -1,18 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectRepositoryCommitComments extends BaseModel {
|
||||
all(projectId, sha, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/commits/${sha}/comments`, options);
|
||||
}
|
||||
|
||||
create(projectId, sha, note, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/repository/commits/${sha}/comments`, Object.assign({ note }, options));
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepositoryCommitComments;
|
||||
@ -1,37 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ProjectRepositoryCommitComments from './ProjectRepositoryCommitComments';
|
||||
|
||||
class ProjectRepositoryCommits extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.comments = new ProjectRepositoryCommitComments(...args);
|
||||
}
|
||||
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/commits`, options);
|
||||
}
|
||||
|
||||
diff(projectId, sha) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/commits/${sha}/diff`);
|
||||
}
|
||||
|
||||
show(projectId, sha) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/commits/${sha}`);
|
||||
}
|
||||
|
||||
statuses(projectId, sha, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/commits/${sha}/statuses`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepositoryCommits;
|
||||
@ -1,44 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectRepositoryFiles extends BaseModel {
|
||||
create(projectId, filePath, branch, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
const path = parse(filePath);
|
||||
const extendedOptions = Object.assign({ branch }, options);
|
||||
|
||||
return this.post(`projects/${pId}/repository/files/${path}`, extendedOptions);
|
||||
}
|
||||
|
||||
edit(projectId, filePath, branch, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
const path = parse(filePath);
|
||||
const extendedOptions = Object.assign({ branch }, options);
|
||||
|
||||
return this.put(`projects/${pId}/repository/files/${path}`, extendedOptions);
|
||||
}
|
||||
|
||||
remove(projectId, filePath, branch, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
const path = parse(filePath);
|
||||
const extendedOptions = Object.assign({ branch }, options);
|
||||
|
||||
return this.delete(`projects/${pId}/repository/files/${path}`, extendedOptions);
|
||||
}
|
||||
|
||||
show(projectId, filePath, ref) {
|
||||
const pId = parse(projectId);
|
||||
const path = parse(filePath);
|
||||
|
||||
return this.get(`projects/${pId}/repository/files/${path}`, { ref });
|
||||
}
|
||||
|
||||
showRaw(projectId, filePath, ref) {
|
||||
const pId = parse(projectId);
|
||||
const path = parse(filePath);
|
||||
|
||||
return this.get(`projects/${pId}/repository/files/${path}/raw`, { ref });
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepositoryFiles;
|
||||
@ -1,30 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectRepositoryTags extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/tags`, options);
|
||||
}
|
||||
|
||||
create(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/repository/tags`, options);
|
||||
}
|
||||
|
||||
remove(projectId, tagName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}/repository/tags/${encodeURI(tagName)}`);
|
||||
}
|
||||
|
||||
show(projectId, tagName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/repository/tags/${encodeURI(tagName)}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRepositoryTags;
|
||||
@ -1,26 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectRunners extends BaseModel {
|
||||
all(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/runners`, options);
|
||||
}
|
||||
|
||||
enable(projectId, runnerId) {
|
||||
const [pId, rId] = [projectId, runnerId].map(parse);
|
||||
|
||||
return this.post(`projects/${pId}/runners`, {
|
||||
runner_id: rId,
|
||||
});
|
||||
}
|
||||
|
||||
disable(projectId, runnerId) {
|
||||
const [pId, rId] = [projectId, runnerId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/runners/${rId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectRunners;
|
||||
@ -1,24 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectServices extends BaseModel {
|
||||
edit(projectId, serviceName, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.put(`projects/${pId}/services/${serviceName}`, options);
|
||||
}
|
||||
|
||||
remove(projectId, serviceName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}/services/${serviceName}`);
|
||||
}
|
||||
|
||||
show(projectId, serviceName) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/services/${serviceName}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectServices;
|
||||
@ -1,36 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ProjectTriggers extends BaseModel {
|
||||
add(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/triggers`, options);
|
||||
}
|
||||
|
||||
all(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}/triggers`);
|
||||
}
|
||||
|
||||
edit(projectId, triggerId, options = {}) {
|
||||
const [pId, tId] = [projectId, triggerId].map(parse);
|
||||
|
||||
return this.put(`projects/${pId}/triggers/${tId}`, options);
|
||||
}
|
||||
|
||||
remove(projectId, triggerId) {
|
||||
const [pId, tId] = [projectId, triggerId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/triggers/${tId}`);
|
||||
}
|
||||
|
||||
show(projectId, triggerId) {
|
||||
const [pId, tId] = [projectId, triggerId].map(parse);
|
||||
|
||||
return this.get(`projects/${pId}/triggers/${tId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ProjectTriggers;
|
||||
@ -1,142 +0,0 @@
|
||||
import Fs from 'fs';
|
||||
import Path from 'path';
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ProjectHooks from './ProjectHooks';
|
||||
import ProjectIssues from './ProjectIssues';
|
||||
import ProjectLabels from './ProjectLabels';
|
||||
import ProjectRepository from './ProjectRepository';
|
||||
import ProjectProtectedBranches from './ProjectProtectedBranches';
|
||||
import ProjectDeployKeys from './ProjectDeployKeys';
|
||||
import ProjectMergeRequests from './ProjectMergeRequests';
|
||||
import ProjectServices from './ProjectServices';
|
||||
import ProjectTriggers from './ProjectTriggers';
|
||||
import ProjectRunners from './ProjectRunners';
|
||||
import ProjectPipelines from './ProjectPipelines';
|
||||
import ProjectJobs from './ProjectJobs';
|
||||
import ProjectEnvironments from './ProjectEnvironments';
|
||||
import ResourceCustomAttributes from './ResourceCustomAttributes';
|
||||
import ResourceMembers from './ResourceMembers';
|
||||
import ResourceAccessRequests from './ResourceAccessRequests';
|
||||
import ResourceMilestones from './ResourceMilestones';
|
||||
import ResourceNotes from './ResourceNotes';
|
||||
|
||||
|
||||
class Projects extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.hooks = new ProjectHooks(...args);
|
||||
this.issues = new ProjectIssues(...args);
|
||||
this.labels = new ProjectLabels(...args);
|
||||
this.repository = new ProjectRepository(...args);
|
||||
this.protectedBranches = new ProjectProtectedBranches(...args);
|
||||
this.deployKeys = new ProjectDeployKeys(...args);
|
||||
this.mergeRequests = new ProjectMergeRequests(...args);
|
||||
this.services = new ProjectServices(...args);
|
||||
this.triggers = new ProjectTriggers(...args);
|
||||
this.pipelines = new ProjectPipelines(...args);
|
||||
this.jobs = new ProjectJobs(...args);
|
||||
this.environments = new ProjectEnvironments(...args);
|
||||
this.runners = new ProjectRunners(...args);
|
||||
this.customAttributes = new ResourceCustomAttributes('projects', ...args);
|
||||
this.members = new ResourceMembers('projects', ...args);
|
||||
this.accessRequests = new ResourceAccessRequests('projects', ...args);
|
||||
this.milestones = new ResourceMilestones('projects', ...args);
|
||||
this.snippets = new ResourceNotes('projects', 'snippets', ...args);
|
||||
}
|
||||
|
||||
all(options = {}) {
|
||||
return this.get('projects', options);
|
||||
}
|
||||
|
||||
create(options = {}) {
|
||||
if (options.userId) {
|
||||
const uId = parse(options.userId);
|
||||
|
||||
return this.post(`projects/user/${uId}`, options);
|
||||
}
|
||||
|
||||
return this.post('projects', options);
|
||||
}
|
||||
|
||||
edit(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.put(`projects/${pId}`, options);
|
||||
}
|
||||
|
||||
fork(projectId, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/fork`, options);
|
||||
}
|
||||
|
||||
remove(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.delete(`projects/${pId}`);
|
||||
}
|
||||
|
||||
search(projectName) {
|
||||
return this.get('projects', { search: projectName });
|
||||
}
|
||||
|
||||
share(projectId, groupId, groupAccess, options) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
if (!groupId || !groupAccess) throw new Error('Missing required arguments');
|
||||
|
||||
options.group_id = groupId;
|
||||
options.group_access = groupAccess;
|
||||
|
||||
return this.post(`projects/${pId}/share`, options);
|
||||
}
|
||||
|
||||
show(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.get(`projects/${pId}`);
|
||||
}
|
||||
|
||||
star(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/star`);
|
||||
}
|
||||
|
||||
statuses(projectId, sha, state, options = {}) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/statuses/${sha}`, Object.assign({ state }, options));
|
||||
}
|
||||
|
||||
unshare(projectId, groupId) {
|
||||
const [pId, gId] = [projectId, groupId].map(parse);
|
||||
|
||||
return this.delete(`projects/${pId}/share${gId}`);
|
||||
}
|
||||
|
||||
unstar(projectId) {
|
||||
const pId = parse(projectId);
|
||||
|
||||
return this.post(`projects/${pId}/unstar`);
|
||||
}
|
||||
|
||||
upload(projectId, filePath, { fileName = Path.basename(filePath) } = {}) {
|
||||
const pId = parse(projectId);
|
||||
const file = Fs.readFileSync(filePath);
|
||||
|
||||
return this.postForm(`projects/${pId}/uploads`, {
|
||||
file: {
|
||||
value: file,
|
||||
options: {
|
||||
filename: fileName,
|
||||
contentType: 'application/octet-stream',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Projects;
|
||||
@ -1,45 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
const ACCESS_LEVELS = {
|
||||
GUEST: 10,
|
||||
REPORTER: 20,
|
||||
DEVELOPER: 30,
|
||||
MASTER: 40,
|
||||
OWNER: 50,
|
||||
};
|
||||
|
||||
class ResourceAccessRequests extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
this.ACCESS_LEVELS = ACCESS_LEVELS;
|
||||
}
|
||||
|
||||
all(resourceId) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/access_requests`);
|
||||
}
|
||||
|
||||
request(resourceId) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.post(`${this.resourceType}/${rId}/access_requests`);
|
||||
}
|
||||
|
||||
approve(resourceId, userId, { access_level = 30 }) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.post(`${this.resourceType}/${rId}/access_requests/${uId}/approve`, { access_level });
|
||||
}
|
||||
|
||||
deny(resourceId, userId) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.delete(`${this.resourceType}/${rId}/access_requests/${uId}/approve`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceAccessRequests;
|
||||
@ -1,36 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ResourceCustomAttributes extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
all(resourceId) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/custom_attributes`);
|
||||
}
|
||||
|
||||
set(resourceId, customAttributeId, value) {
|
||||
const [rId, cId] = [resourceId, customAttributeId].map(parse);
|
||||
|
||||
return this.put(`${this.resourceType}/${rId}/custom_attributes/${cId}`, { value });
|
||||
}
|
||||
|
||||
remove(resourceId, customAttributeId) {
|
||||
const [rId, cId] = [resourceId, customAttributeId].map(parse);
|
||||
|
||||
return this.delete(`${this.resourceType}/${rId}/custom_attributes/${cId}`);
|
||||
}
|
||||
|
||||
show(resourceId, customAttributeId) {
|
||||
const [rId, cId] = [resourceId, customAttributeId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/custom_attributes/${cId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceCustomAttributes;
|
||||
@ -1,47 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ResourceMembers extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
all(resourceId) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/members`);
|
||||
}
|
||||
|
||||
add(resourceId, userId, accessLevel) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.post(`${this.resourceType}/${rId}/members`, {
|
||||
user_id: uId,
|
||||
access_level: parseInt(accessLevel, 10),
|
||||
});
|
||||
}
|
||||
|
||||
edit(resourceId, userId, accessLevel) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.put(`${this.resourceType}/${rId}/members/${uId}`, {
|
||||
access_level: parseInt(accessLevel, 10),
|
||||
});
|
||||
}
|
||||
|
||||
show(resourceId, userId) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/members/${uId}`);
|
||||
}
|
||||
|
||||
remove(resourceId, userId) {
|
||||
const [rId, uId] = [resourceId, userId].map(parse);
|
||||
|
||||
return this.delete(`${this.resourceType}/${rId}/members/${uId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceMembers;
|
||||
@ -1,18 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class GroupMilestoneIssues extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
all(resourceId, milestoneId) {
|
||||
const [rId, mId] = [resourceId, milestoneId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/milestones/${mId}/issues`);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupMilestoneIssues;
|
||||
@ -1,18 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ResourceMilestoneMergeRequests extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
all(resourceId, milestoneId) {
|
||||
const [rId, mId] = [resourceId, milestoneId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/milestones/${mId}/merge_requests`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceMilestoneMergeRequests;
|
||||
@ -1,40 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import ResourceMilestoneIssues from './ResourceMilestoneIssues';
|
||||
import ResourceMilestoneMergeRequests from './ResourceMilestoneMergeRequests';
|
||||
|
||||
class ResourceMilestones extends BaseModel {
|
||||
constructor(resourceType, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
this.issues = new ResourceMilestoneIssues(resourceType, ...args);
|
||||
this.mergeRequests = new ResourceMilestoneMergeRequests(resourceType, ...args);
|
||||
}
|
||||
|
||||
all(resourceId, options = {}) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/milestones`, options);
|
||||
}
|
||||
|
||||
create(resourceId, title, options) {
|
||||
const rId = parse(resourceId);
|
||||
|
||||
return this.post(`${this.resourceType}/${rId}/milestones`, options);
|
||||
}
|
||||
|
||||
edit(resourceId, milestoneId, options) {
|
||||
const [rId, mId] = [resourceId, milestoneId].map(parse);
|
||||
|
||||
return this.put(`${this.resourceType}/${rId}/milestones/${mId}`, options);
|
||||
}
|
||||
|
||||
show(resourceId, milestoneId) {
|
||||
const [rId, mId] = [resourceId, milestoneId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/milestones/${mId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceMilestones;
|
||||
@ -1,47 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class ResourceNotes extends BaseModel {
|
||||
constructor(resourceType, resource2Type, ...args) {
|
||||
super(...args);
|
||||
|
||||
this.resourceType = resourceType;
|
||||
this.resource2Type = resource2Type;
|
||||
}
|
||||
|
||||
all(resourceId, resource2Id, options = {}) {
|
||||
const [rId, r2Id] = [resourceId, resource2Id].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/${this.resource2Type}/${r2Id}/notes`, options);
|
||||
}
|
||||
|
||||
create(resourceId, resource2Id, options = {}) {
|
||||
if (!options.body) throw new Error('Missing required property: body');
|
||||
|
||||
const [rId, r2Id] = [resourceId, resource2Id].map(parse);
|
||||
|
||||
return this.post(`${this.resourceType}/${rId}/${this.resource2Type}/${r2Id}/notes`, options);
|
||||
}
|
||||
|
||||
edit(resourceId, resource2Id, noteId, options = {}) {
|
||||
if (!options.body) throw new Error('Missing required property: body');
|
||||
|
||||
const [rId, r2Id, nId] = [resourceId, resource2Id, noteId].map(parse);
|
||||
|
||||
return this.put(`${this.resourceType}/${rId}/${this.resource2Type}/${r2Id}/notes/${nId}`, options);
|
||||
}
|
||||
|
||||
remove(resourceId, resource2Id, noteId) {
|
||||
const [rId, r2Id, nId] = [resourceId, resource2Id, noteId].map(parse);
|
||||
|
||||
return this.delete(`${this.resourceType}/${rId}/${this.resource2Type}/${r2Id}/notes/${nId}`);
|
||||
}
|
||||
|
||||
show(resourceId, resource2Id, noteId) {
|
||||
const [rId, r2Id, nId] = [resourceId, resource2Id, noteId].map(parse);
|
||||
|
||||
return this.get(`${this.resourceType}/${rId}/${this.resource2Type}/${r2Id}/notes/${nId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResourceNotes;
|
||||
@ -1,38 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class Runners extends BaseModel {
|
||||
all(options = {}) {
|
||||
return this.get('runners/all', options);
|
||||
}
|
||||
|
||||
allOwned(options = {}) {
|
||||
return this.get('runners', options);
|
||||
}
|
||||
|
||||
edit(runnerId, attributes) {
|
||||
const rId = parse(runnerId);
|
||||
|
||||
return this.put(`runners/${rId}`, attributes);
|
||||
}
|
||||
|
||||
remove(runnerId) {
|
||||
const rId = parse(runnerId);
|
||||
|
||||
return this.delete(`runners/${rId}`);
|
||||
}
|
||||
|
||||
show(runnerId) {
|
||||
const rId = parse(runnerId);
|
||||
|
||||
return this.get(`runners/${rId}`);
|
||||
}
|
||||
|
||||
showJobs(runnerId) {
|
||||
const rId = parse(runnerId);
|
||||
|
||||
return this.get(`runners/${rId}/jobs`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Runners;
|
||||
@ -1,28 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
|
||||
class UserKeys extends BaseModel {
|
||||
add(userId, title, key) {
|
||||
const uId = parse(userId);
|
||||
|
||||
return this.post(`users/${uId}/keys`, {
|
||||
title,
|
||||
key,
|
||||
});
|
||||
}
|
||||
|
||||
remove(userId, keyId) {
|
||||
const uId = parse(userId);
|
||||
const kId = parse(keyId);
|
||||
|
||||
return this.delete(`users/${uId}/keys/${kId}`);
|
||||
}
|
||||
|
||||
all(userId) {
|
||||
const uId = parse(userId);
|
||||
|
||||
return this.get(`users/${uId}/keys`);
|
||||
}
|
||||
}
|
||||
|
||||
export default UserKeys;
|
||||
@ -1,46 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { parse } from '../Utils';
|
||||
import UserKeys from './UserKeys';
|
||||
import ResourceCustomAttributes from './ResourceCustomAttributes';
|
||||
|
||||
class Users extends BaseModel {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.customAttributes = new ResourceCustomAttributes('users', ...args);
|
||||
this.keys = new UserKeys(...args);
|
||||
}
|
||||
|
||||
all(options = {}) {
|
||||
return this.get('users', options);
|
||||
}
|
||||
|
||||
create(options = {}) {
|
||||
return this.post('users', options);
|
||||
}
|
||||
|
||||
current() {
|
||||
return this.get('user');
|
||||
}
|
||||
|
||||
session(email, password) {
|
||||
return this.post('session', {
|
||||
email,
|
||||
password,
|
||||
});
|
||||
}
|
||||
|
||||
search(emailOrUsername) {
|
||||
return this.get('users', {
|
||||
search: emailOrUsername,
|
||||
});
|
||||
}
|
||||
|
||||
show(userId) {
|
||||
const uId = parse(userId);
|
||||
|
||||
return this.get(`users/${uId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Users;
|
||||
@ -1,9 +0,0 @@
|
||||
import BaseModel from './BaseModel';
|
||||
|
||||
class Version extends BaseModel {
|
||||
show() {
|
||||
return this.get('version');
|
||||
}
|
||||
}
|
||||
|
||||
export default Version;
|
||||
@ -1,17 +0,0 @@
|
||||
import Groups from './Groups';
|
||||
import Projects from './Projects';
|
||||
import Issues from './Issues';
|
||||
import Users from './Users';
|
||||
import Runners from './Runners';
|
||||
import MergeRequests from './MergeRequests';
|
||||
import Version from './Version';
|
||||
|
||||
export {
|
||||
Groups,
|
||||
Projects,
|
||||
Runners,
|
||||
Issues,
|
||||
Users,
|
||||
MergeRequests,
|
||||
Version,
|
||||
};
|
||||
@ -1,9 +0,0 @@
|
||||
function parse(value) {
|
||||
if (Number.isInteger(value)) return value;
|
||||
|
||||
return encodeURIComponent(value);
|
||||
}
|
||||
|
||||
export {
|
||||
parse,
|
||||
};
|
||||
78
src/index.js
78
src/index.js
@ -1,3 +1,77 @@
|
||||
import API from './API';
|
||||
import Pick from 'lodash.pick';
|
||||
import * as APIServices from './services';
|
||||
import { Bundler } from './infrastructure';
|
||||
|
||||
module.exports = ({ url, token, oauthToken }) => new API({ url, token, oauthToken });
|
||||
// All seperatly
|
||||
export * from './services';
|
||||
|
||||
// Groups
|
||||
export const GroupsBundler = Bundler(Pick(APIServices, [
|
||||
'Groups',
|
||||
'GroupAccessRequests',
|
||||
'GroupBadges',
|
||||
'GroupCustomAttributes',
|
||||
'GroupIssueBoards',
|
||||
'GroupMembers',
|
||||
'GroupMilestones',
|
||||
'GroupProjects',
|
||||
'GroupVariables',
|
||||
'Epics',
|
||||
'EpicIssues',
|
||||
'EpicNotes',
|
||||
'EpicDiscussions',
|
||||
]));
|
||||
|
||||
// Users
|
||||
export const UsersBundler = Bundler(Pick(APIServices, [
|
||||
'Users',
|
||||
'UserEmails',
|
||||
'UserImpersonationTokens',
|
||||
'UserKeys',
|
||||
'UserGPGKeys',
|
||||
]));
|
||||
|
||||
// Projects
|
||||
export const ProjectsBundler = Bundler(Pick(APIServices, [
|
||||
'Branches',
|
||||
'Commits',
|
||||
'DeployKeys',
|
||||
'Deployments',
|
||||
'Environments',
|
||||
'Issues',
|
||||
'IssueAwardEmojis',
|
||||
'IssueNotes',
|
||||
'IssueDiscussions',
|
||||
'Jobs',
|
||||
'Labels',
|
||||
'MergeRequests',
|
||||
'MergeRequestAwardEmojis',
|
||||
'MergeRequestNotes',
|
||||
'Pipelines',
|
||||
'PipelineSchedules',
|
||||
'PipelineScheduleVariables',
|
||||
'Projects',
|
||||
'ProjectAccessRequests',
|
||||
'ProjectBadges',
|
||||
'ProjectCustomAttributes',
|
||||
'ProjectImportExport',
|
||||
'ProjectIssueBoards',
|
||||
'ProjectHooks',
|
||||
'ProjectMembers',
|
||||
'ProjectMilestones',
|
||||
'ProjectSnippet',
|
||||
'ProjectSnippetNotes',
|
||||
'ProjectSnippetDiscussions',
|
||||
'ProjectSnippetAwardEmojis',
|
||||
'ProtectedBranches',
|
||||
'ProjectVariables',
|
||||
'Repositories',
|
||||
'RepositoryFiles',
|
||||
'Runners',
|
||||
'Services',
|
||||
'Tags',
|
||||
'Triggers',
|
||||
]));
|
||||
|
||||
// All initialized
|
||||
export default Bundler(APIServices);
|
||||
|
||||
18
src/infrastructure/BaseService.js
Normal file
18
src/infrastructure/BaseService.js
Normal file
@ -0,0 +1,18 @@
|
||||
import URLJoin from 'url-join';
|
||||
|
||||
class BaseModel {
|
||||
constructor({ url = 'https://gitlab.com', token, oauthToken }) {
|
||||
this.url = URLJoin(url, 'api', 'v4');
|
||||
this.headers = {};
|
||||
|
||||
if (oauthToken) {
|
||||
this.headers.Authorization = `Bearer ${oauthToken}`;
|
||||
} else if (token) {
|
||||
this.headers['private-token'] = token;
|
||||
} else {
|
||||
throw new Error('`token` (private-token) or `oauth_token` is mandatory');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default BaseModel;
|
||||
13
src/infrastructure/Bundler.js
Normal file
13
src/infrastructure/Bundler.js
Normal file
@ -0,0 +1,13 @@
|
||||
function Bundler(...services) {
|
||||
const combined = Object.assign({}, ...services);
|
||||
|
||||
return class Bundle {
|
||||
constructor(options) {
|
||||
Object.entries(combined).forEach(([name, Service]) => {
|
||||
this[name] = new Service(options);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default Bundler;
|
||||
72
src/infrastructure/RequestHelper.js
Normal file
72
src/infrastructure/RequestHelper.js
Normal file
@ -0,0 +1,72 @@
|
||||
import Request from 'request-promise';
|
||||
import Humps from 'humps';
|
||||
import LinkParser from 'parse-link-header';
|
||||
import URLJoin from 'url-join';
|
||||
|
||||
function defaultRequest(
|
||||
url,
|
||||
endpoint,
|
||||
{ headers, body, qs, formData, resolveWithFullResponse = false },
|
||||
) {
|
||||
const params = {
|
||||
url: URLJoin(url, endpoint),
|
||||
headers,
|
||||
json: true,
|
||||
};
|
||||
|
||||
if (body) params.body = Humps.decamelizeKeys(body);
|
||||
if (qs) params.qs = Humps.decamelizeKeys(qs);
|
||||
if (formData) params.formData = formData;
|
||||
|
||||
params.resolveWithFullResponse = resolveWithFullResponse;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
class RequestHelper {
|
||||
static async get(service, endpoint, options = {}) {
|
||||
const response = await Request.get(defaultRequest(service.url, endpoint, {
|
||||
headers: service.headers,
|
||||
qs: options,
|
||||
resolveWithFullResponse: true,
|
||||
}));
|
||||
|
||||
const links = LinkParser(response.headers.link);
|
||||
const page = response.headers['x-page'];
|
||||
const limit = options.maxPages ? page < options.maxPages : true;
|
||||
let more = [];
|
||||
|
||||
if (page && limit && links.next) {
|
||||
more = await RequestHelper.get(service, links.next.url.replace(service.url, ''), options);
|
||||
|
||||
return [...response.body, ...more];
|
||||
}
|
||||
|
||||
return response.body;
|
||||
}
|
||||
|
||||
static post(service, endpoint, options = {}, form = false) {
|
||||
const body = form ? 'fromData' : 'body';
|
||||
|
||||
return Request.post(defaultRequest(service.url, endpoint, {
|
||||
headers: service.headers,
|
||||
[body]: options,
|
||||
}));
|
||||
}
|
||||
|
||||
static put(service, endpoint, options = {}) {
|
||||
return Request.put(defaultRequest(service.url, endpoint, {
|
||||
headers: service.headers,
|
||||
body: options,
|
||||
}));
|
||||
}
|
||||
|
||||
static delete(service, endpoint, options = {}) {
|
||||
return Request.delete(defaultRequest(service.url, endpoint, {
|
||||
headers: service.headers,
|
||||
qs: options,
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
export default RequestHelper;
|
||||
3
src/infrastructure/index.js
Normal file
3
src/infrastructure/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
export BaseService from './BaseService';
|
||||
export RequestHelper from './RequestHelper';
|
||||
export Bundler from './Bundler';
|
||||
13
src/services/ApplicationSettings.js
Normal file
13
src/services/ApplicationSettings.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class ApplicationSettings extends BaseService {
|
||||
all() {
|
||||
return RequestHelper.get(this, 'application/settings');
|
||||
}
|
||||
|
||||
edit(options) {
|
||||
return RequestHelper.post(this, 'application/settings', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default ApplicationSettings;
|
||||
48
src/services/Branches.js
Normal file
48
src/services/Branches.js
Normal file
@ -0,0 +1,48 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Branches extends BaseService {
|
||||
all(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/branches`, options);
|
||||
}
|
||||
|
||||
create(projectId, branchName, ref) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/repository/branches`, {
|
||||
branch: branchName,
|
||||
ref,
|
||||
});
|
||||
}
|
||||
|
||||
protect(projectId, branchName, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.put(
|
||||
this,
|
||||
`projects/${pId}/repository/branches/${branchName}/protect`,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
remove(projectId, branchName) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/repository/branches/${branchName}`);
|
||||
}
|
||||
|
||||
show(projectId, branchName) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/branches/${branchName}`);
|
||||
}
|
||||
|
||||
unprotect(projectId, branchName) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}/repository/branches/${branchName}/unprotect`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Branches;
|
||||
31
src/services/BroadcastMessages.js
Normal file
31
src/services/BroadcastMessages.js
Normal file
@ -0,0 +1,31 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class BroadcastMessages extends BaseService {
|
||||
all(options) {
|
||||
return RequestHelper.get(this, 'broadcast_messages', options);
|
||||
}
|
||||
|
||||
create(options) {
|
||||
return RequestHelper.post(this, 'broadcast_messages', options);
|
||||
}
|
||||
|
||||
edit(broadcastMessageId, options) {
|
||||
const bId = encodeURIComponent(broadcastMessageId);
|
||||
|
||||
return RequestHelper.put(this, `broadcast_messages/${bId}`, options);
|
||||
}
|
||||
|
||||
remove(broadcastMessageId) {
|
||||
const bId = encodeURIComponent(broadcastMessageId);
|
||||
|
||||
return RequestHelper.delete(this, `broadcast_messages/${bId}`);
|
||||
}
|
||||
|
||||
show(broadcastMessageId, options) {
|
||||
const bId = encodeURIComponent(broadcastMessageId);
|
||||
|
||||
return RequestHelper.get(this, `broadcast_messages/${bId}`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default BroadcastMessages;
|
||||
73
src/services/Commits.js
Normal file
73
src/services/Commits.js
Normal file
@ -0,0 +1,73 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Commits extends BaseService {
|
||||
all(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits`, options);
|
||||
}
|
||||
|
||||
cherryPick(projectId, sha, branch) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/repository/commits/${sha}/cherry_pick`, { branch });
|
||||
}
|
||||
|
||||
comments(projectId, sha) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}/comments`);
|
||||
}
|
||||
|
||||
create(projectId, branch, message, actions = [], options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/repository/commits`, {
|
||||
branch,
|
||||
commitMessage: message,
|
||||
actions,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
createComment(projectId, sha, note, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/repository/commits/${sha}/comments`, {
|
||||
note,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
diff(projectId, sha) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}/diff`);
|
||||
}
|
||||
|
||||
editStatus(projectId, sha, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}/statuses`, options);
|
||||
}
|
||||
|
||||
references(projectId, sha) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}/refs`);
|
||||
}
|
||||
|
||||
show(projectId, sha) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}`);
|
||||
}
|
||||
|
||||
status(projectId, sha, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/repository/commits/${sha}/statuses`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Commits;
|
||||
23
src/services/DeployKeys.js
Normal file
23
src/services/DeployKeys.js
Normal file
@ -0,0 +1,23 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class DeployKeys extends BaseService {
|
||||
add(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/deploy_keys`, options);
|
||||
}
|
||||
|
||||
all(projectId) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/deploy_keys`);
|
||||
}
|
||||
|
||||
show(projectId, keyId) {
|
||||
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/deploy_keys/${kId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default DeployKeys;
|
||||
17
src/services/Deployments.js
Normal file
17
src/services/Deployments.js
Normal file
@ -0,0 +1,17 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Deployments extends BaseService {
|
||||
all(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/deployments`, options);
|
||||
}
|
||||
|
||||
show(projectId, deploymentId) {
|
||||
const [pId, dId] = [projectId, deploymentId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/deployments/${dId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Deployments;
|
||||
35
src/services/Environments.js
Normal file
35
src/services/Environments.js
Normal file
@ -0,0 +1,35 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Environments extends BaseService {
|
||||
all(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/environments`, options);
|
||||
}
|
||||
|
||||
create(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/environments`, options);
|
||||
}
|
||||
|
||||
edit(projectId, environmentId, options) {
|
||||
const [pId, eId] = [projectId, environmentId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}/environments/${eId}`, options);
|
||||
}
|
||||
|
||||
remove(projectId, environmentId) {
|
||||
const [pId, eId] = [projectId, environmentId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/environments/${eId}`);
|
||||
}
|
||||
|
||||
stop(projectId, environmentId) {
|
||||
const [pId, eId] = [projectId, environmentId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/environments/${eId}/stop`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Environments;
|
||||
9
src/services/EpicDiscussions.js
Normal file
9
src/services/EpicDiscussions.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceDiscussions } from '../templates';
|
||||
|
||||
class EpicDiscussions extends ResourceDiscussions {
|
||||
constructor(options) {
|
||||
super('groups', 'epics', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default EpicDiscussions;
|
||||
29
src/services/EpicIssues.js
Normal file
29
src/services/EpicIssues.js
Normal file
@ -0,0 +1,29 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class EpicIssues extends BaseService {
|
||||
all(groupId, epicId) {
|
||||
const [gId, eId] = [groupId, epicId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/epics/${eId}/issues`);
|
||||
}
|
||||
|
||||
assign(groupId, epicId, issueId) {
|
||||
const [gId, eId, iId] = [groupId, epicId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `groups/${gId}/epics/${eId}/issues/${iId}`);
|
||||
}
|
||||
|
||||
edit(groupId, epicId, issueId, options) {
|
||||
const [gId, eId, iId] = [groupId, epicId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `groups/${gId}/epics/${eId}/issues/${iId}`, options);
|
||||
}
|
||||
|
||||
remove(groupId, epicId, issueId) {
|
||||
const [gId, eId, iId] = [groupId, epicId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `groups/${gId}/epics/${eId}/issues/${iId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default EpicIssues;
|
||||
9
src/services/EpicNotes.js
Normal file
9
src/services/EpicNotes.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceNotes } from '../templates';
|
||||
|
||||
class EpicNotes extends ResourceNotes {
|
||||
constructor(options) {
|
||||
super('groups', 'epics', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default EpicNotes;
|
||||
35
src/services/Epics.js
Normal file
35
src/services/Epics.js
Normal file
@ -0,0 +1,35 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Epics extends BaseService {
|
||||
all(groupId) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/epics`);
|
||||
}
|
||||
|
||||
create(groupId, title, options) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.post(this, `groups/${gId}/epics`, { title, ...options });
|
||||
}
|
||||
|
||||
edit(groupId, epicId, options) {
|
||||
const [gId, eId] = [groupId, epicId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `groups/${gId}/epics/${eId}`, options);
|
||||
}
|
||||
|
||||
remove(groupId, epicId) {
|
||||
const [gId, eId] = [groupId, epicId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `groups/${gId}/epics/${eId}`);
|
||||
}
|
||||
|
||||
show(groupId, epicId) {
|
||||
const [gId, eId] = [groupId, epicId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/epics/${eId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Epics;
|
||||
46
src/services/Events.js
Normal file
46
src/services/Events.js
Normal file
@ -0,0 +1,46 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
const ACTION_TYPES = [
|
||||
'created',
|
||||
'updated',
|
||||
'closed',
|
||||
'reopened',
|
||||
'pushed',
|
||||
'commented',
|
||||
'merged',
|
||||
'joined',
|
||||
'left',
|
||||
'destroyed',
|
||||
'expired',
|
||||
];
|
||||
|
||||
const TARGET_TYPES = [
|
||||
'issue',
|
||||
'milestone',
|
||||
'merge_request',
|
||||
'note',
|
||||
'project',
|
||||
'snippet',
|
||||
'user',
|
||||
];
|
||||
|
||||
function validateEventOptions(action, target) {
|
||||
if (!ACTION_TYPES.includes(action)) {
|
||||
throw new Error(`This action is not supported. Pleased use one of following options: ${ACTION_TYPES}`);
|
||||
}
|
||||
|
||||
if (!TARGET_TYPES.includes(target)) {
|
||||
throw new Error(`This target is not supported. Pleased use one of following options: ${TARGET_TYPES}`);
|
||||
}
|
||||
}
|
||||
|
||||
class Events extends BaseService {
|
||||
all(options) {
|
||||
validateEventOptions(options.action, options.targetType);
|
||||
|
||||
return RequestHelper.get(this, 'events', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Events;
|
||||
export { validateEventOptions };
|
||||
15
src/services/FeatureFlags.js
Normal file
15
src/services/FeatureFlags.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class FeatureFlags extends BaseService {
|
||||
all(options) {
|
||||
return RequestHelper.get(this, 'features', options);
|
||||
}
|
||||
|
||||
set(name, options) {
|
||||
const encodedName = encodeURIComponent(name);
|
||||
|
||||
return RequestHelper.post(this, `features/${encodedName}`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default FeatureFlags;
|
||||
47
src/services/GeoNodes.js
Normal file
47
src/services/GeoNodes.js
Normal file
@ -0,0 +1,47 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class GeoNodes extends BaseService {
|
||||
all(options) {
|
||||
return RequestHelper.get(this, 'geo_nodes', options);
|
||||
}
|
||||
|
||||
create(geonodeId, options) {
|
||||
const gId = encodeURIComponent(geonodeId);
|
||||
|
||||
return RequestHelper.post(this, `geo_nodes/${gId}`, options);
|
||||
}
|
||||
|
||||
edit(geonodeId, options) {
|
||||
const gId = encodeURIComponent(geonodeId);
|
||||
|
||||
return RequestHelper.put(this, `geo_nodes/${gId}`, options);
|
||||
}
|
||||
|
||||
failures(options) {
|
||||
return RequestHelper.post(this, 'geo_nodes/current/failures', options);
|
||||
}
|
||||
|
||||
repair(geonodeId, options) {
|
||||
const gId = encodeURIComponent(geonodeId);
|
||||
|
||||
return RequestHelper.delete(this, `geo_nodes/${gId}`, options);
|
||||
}
|
||||
|
||||
show(geonodeId, options) {
|
||||
const gId = encodeURIComponent(geonodeId);
|
||||
|
||||
return RequestHelper.get(this, `geo_nodes/${gId}`, options);
|
||||
}
|
||||
|
||||
status(geonodeId, options) {
|
||||
const gId = encodeURIComponent(geonodeId);
|
||||
|
||||
return RequestHelper.get(this, `geo_nodes/${gId}/status`, options);
|
||||
}
|
||||
|
||||
statuses(options) {
|
||||
return RequestHelper.get(this, 'geo_nodes/statuses', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GeoNodes;
|
||||
9
src/services/GitLabCIYMLTemplates.js
Normal file
9
src/services/GitLabCIYMLTemplates.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceTemplates } from '../templates';
|
||||
|
||||
class GitLabCIYMLTemplates extends ResourceTemplates {
|
||||
constructor(options) {
|
||||
super('gitlab_ci_ymls', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GitLabCIYMLTemplates;
|
||||
9
src/services/GitignoreTemplates.js
Normal file
9
src/services/GitignoreTemplates.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceTemplates } from '../templates';
|
||||
|
||||
class GitignoreTemplates extends ResourceTemplates {
|
||||
constructor(options) {
|
||||
super('gitignores', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GitignoreTemplates;
|
||||
9
src/services/GroupAccessRequests.js
Normal file
9
src/services/GroupAccessRequests.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceAccessRequests } from '../templates';
|
||||
|
||||
class GroupAccessRequests extends ResourceAccessRequests {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupAccessRequests;
|
||||
9
src/services/GroupBadges.js
Normal file
9
src/services/GroupBadges.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceBadges } from '../templates';
|
||||
|
||||
class GroupBadges extends ResourceBadges {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupBadges;
|
||||
9
src/services/GroupCustomAttributes.js
Normal file
9
src/services/GroupCustomAttributes.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceCustomAttributes } from '../templates';
|
||||
|
||||
class GroupCustomAttributes extends ResourceCustomAttributes {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupCustomAttributes;
|
||||
9
src/services/GroupIssueBoards.js
Normal file
9
src/services/GroupIssueBoards.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceIssueBoards } from '../templates';
|
||||
|
||||
class GroupIssueBoards extends ResourceIssueBoards {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupIssueBoards;
|
||||
9
src/services/GroupMembers.js
Normal file
9
src/services/GroupMembers.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceMembers } from '../templates';
|
||||
|
||||
class GroupMembers extends ResourceMembers {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupMembers;
|
||||
9
src/services/GroupMilestones.js
Normal file
9
src/services/GroupMilestones.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceMilestones } from '../templates';
|
||||
|
||||
class GroupMilestones extends ResourceMilestones {
|
||||
constructor(options) {
|
||||
super('groups', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupMilestones;
|
||||
17
src/services/GroupProjects.js
Normal file
17
src/services/GroupProjects.js
Normal file
@ -0,0 +1,17 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class GroupProjects extends BaseService {
|
||||
all(groupId, options) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/projects`, options);
|
||||
}
|
||||
|
||||
add(groupId, projectId) {
|
||||
const [gId, pId] = [groupId, projectId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `groups/${gId}/projects/${pId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupProjects;
|
||||
9
src/services/GroupVariables.js
Normal file
9
src/services/GroupVariables.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceVariables } from '../templates';
|
||||
|
||||
class GroupVariables extends ResourceVariables {
|
||||
constructor(options) {
|
||||
super('groups', null, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default GroupVariables;
|
||||
37
src/services/Groups.js
Normal file
37
src/services/Groups.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Groups extends BaseService {
|
||||
all(options) {
|
||||
return RequestHelper.get(this, 'groups', options);
|
||||
}
|
||||
|
||||
create(options) {
|
||||
return RequestHelper.post(this, 'groups', options);
|
||||
}
|
||||
|
||||
remove(groupId) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.delete(this, `groups/${gId}`);
|
||||
}
|
||||
|
||||
search(nameOrPath) {
|
||||
return RequestHelper.get(this, 'groups', {
|
||||
search: nameOrPath,
|
||||
});
|
||||
}
|
||||
|
||||
show(groupId) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}`);
|
||||
}
|
||||
|
||||
subgroups(groupId, options) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/subgroups`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Groups;
|
||||
9
src/services/IssueAwardEmojis.js
Normal file
9
src/services/IssueAwardEmojis.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceAwardEmojis } from '../templates';
|
||||
|
||||
class IssueAwardEmojis extends ResourceAwardEmojis {
|
||||
constructor(options) {
|
||||
super('issues', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default IssueAwardEmojis;
|
||||
9
src/services/IssueDiscussions.js
Normal file
9
src/services/IssueDiscussions.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceDiscussions } from '../templates';
|
||||
|
||||
class IssueDiscussions extends ResourceDiscussions {
|
||||
constructor(options) {
|
||||
super('projects', 'issues', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default IssueDiscussions;
|
||||
9
src/services/IssueNotes.js
Normal file
9
src/services/IssueNotes.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceNotes } from '../templates';
|
||||
|
||||
class IssueNotes extends ResourceNotes {
|
||||
constructor(options) {
|
||||
super('projects', 'issues', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default IssueNotes;
|
||||
58
src/services/Issues.js
Normal file
58
src/services/Issues.js
Normal file
@ -0,0 +1,58 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Issues extends BaseService {
|
||||
all({ projectId, ...options }) {
|
||||
const url = projectId ? `projects/${encodeURIComponent(projectId)}/issues` : 'issues';
|
||||
|
||||
return RequestHelper.get(this, url, options);
|
||||
}
|
||||
|
||||
create(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/issues`, options);
|
||||
}
|
||||
|
||||
edit(projectId, issueId, options) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}/issues/${iId}`, options);
|
||||
}
|
||||
|
||||
link(projectId, issueIId, targetProjectId, targetIssueId, options = {}) {
|
||||
const [pId, iId] = [projectId, issueIId].map(encodeURIComponent);
|
||||
const [targetpId, targetIId] = [targetProjectId, targetIssueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/issues/${iId}/links`, {
|
||||
targetProjectId: targetpId,
|
||||
targetIssueId: targetIId,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
remove(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/issues/${iId}`);
|
||||
}
|
||||
|
||||
show(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/issues/${iId}`);
|
||||
}
|
||||
|
||||
subscribe(projectId, issueId, options) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/issues/${iId}/subscribe`, options);
|
||||
}
|
||||
|
||||
unsubscribe(projectId, issueId) {
|
||||
const [pId, iId] = [projectId, issueId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/issues/${iId}/unsubscribe`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Issues;
|
||||
11
src/services/Jobs.js
Normal file
11
src/services/Jobs.js
Normal file
@ -0,0 +1,11 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Jobs extends BaseService {
|
||||
all(projectId, options = {}) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/jobs`, options);
|
||||
}
|
||||
}
|
||||
|
||||
export default Jobs;
|
||||
11
src/services/Keys.js
Normal file
11
src/services/Keys.js
Normal file
@ -0,0 +1,11 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Keys extends BaseService {
|
||||
show(keyId) {
|
||||
const kId = encodeURIComponent(keyId);
|
||||
|
||||
return RequestHelper.get(this, `keys/${kId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Keys;
|
||||
41
src/services/Labels.js
Normal file
41
src/services/Labels.js
Normal file
@ -0,0 +1,41 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Labels extends BaseService {
|
||||
all(projectId, options = {}) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/labels`, options);
|
||||
}
|
||||
|
||||
create(projectId, options = {}) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/labels`, options);
|
||||
}
|
||||
|
||||
edit(projectId, labelName, options = {}) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}/labels`, { name: labelName, ...options });
|
||||
}
|
||||
|
||||
remove(projectId, labelName) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/labels`, { name: labelName });
|
||||
}
|
||||
|
||||
subscribe(projectId, labelId, options = {}) {
|
||||
const [pId, lId] = [projectId, labelId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/issues/${lId}/subscribe`, options);
|
||||
}
|
||||
|
||||
unsubscribe(projectId, labelId) {
|
||||
const [pId, lId] = [projectId, labelId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/issues/${lId}/unsubscribe`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Labels;
|
||||
13
src/services/Licence.js
Normal file
13
src/services/Licence.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Licence extends BaseService {
|
||||
all() {
|
||||
return RequestHelper.get(this, 'licence');
|
||||
}
|
||||
|
||||
create() {
|
||||
return RequestHelper.post(this, 'licence');
|
||||
}
|
||||
}
|
||||
|
||||
export default Licence;
|
||||
9
src/services/LicenceTemplates.js
Normal file
9
src/services/LicenceTemplates.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { ResourceTemplates } from '../templates';
|
||||
|
||||
class LicenceTemplates extends ResourceTemplates {
|
||||
constructor(options) {
|
||||
super('licences', options);
|
||||
}
|
||||
}
|
||||
|
||||
export default LicenceTemplates;
|
||||
9
src/services/Lint.js
Normal file
9
src/services/Lint.js
Normal file
@ -0,0 +1,9 @@
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
class Lint extends BaseService {
|
||||
lint(content) {
|
||||
return RequestHelper.post(this, 'lint', { content });
|
||||
}
|
||||
}
|
||||
|
||||
export default Lint;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user