0.2.12 • Published 2 years ago

gitlab-ce v0.2.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

GitLab Community Edition (CE) version Gitter

A GitLab Community Edition API client enabling Node.js programs to interact with GitLab in a simple and uniform way.

Installation

Install with the node package manager npm:

$ npm install gitlab-ce --save

Usage

import Gitlab from 'gitlab-ce'

const gitlab = new Gitlab({
  baseURL: 'https://gitlab.com',
  accessToken: 'afmC64nMx76WDtqyCj_G'
})

// Retrieve version information for this GitLab instance.
gitlab
  .version()
  .then((version) => {
    console.log(error)
  })
  .catch(function (error) {
    console.log(error)
  })

// Want to use async/await? Add the `async` keyword to your outer function/method.
async function getCurrent() {
  try {
    // Gets currently authenticated user.
    const current = await gitlab.user.current()
    console.log(current)
  } catch (error) {
    console.error(error)
  }
}

API

gitlab.version()

Retrieve version information for this GitLab instance.

gitlab.user.current()

Gets currently authenticated user.

gitlab.user.status(status)

Get/Set the status of the currently signed in user.

gitlab.user.counts()

Get the counts (same as in top right menu) of the currently signed in user.

gitlab.user.emails()

Get a list of currently authenticated user's emails.

gitlab.groups.search(params)

Get a list of visible groups for the authenticated user.

gitlab.groups.get(groupId,params)

Get all details of a group.

gitlab.groups.projects(groupId,params)

Get a list of projects in this group.

gitlab.users.list()

Get a list of users.

gitlab.users.search(params)

Search for users by name, username or public email. In addition, you can search for external users or exclude external users from the users' list.

gitlab.users.filter(filters)

Filter users based on the states blocked and active.

gitlab.users.get(userId)

Get a single user.

gitlab.users.create(user)

Creates a new user. Available only for administrators.

gitlab.users.update(userId, patch)

Modifies an existing user. Available only for administrators.

gitlab.users.delete(userId,options)

Deletes a user. Available only for administrators.

gitlab.users.disassociate(userId, provider)

Deletes a user's authentication identity using the provider name associated with that identity. Available only for administrators.

gitlab.users.status(userIdOrUsername)

Get the status of a user.

gitlab.users.emails(userId)

Get a list of a specified user's emails. Available only for administrators.

gitlab.users.block(userId)

Blocks the specified user. Available only for administrators.

gitlab.users.unblock(userId)

Unblocks the specified user. Available only for administrators.

gitlab.users.activate(userId)

Activates the specified user. Available only for administrators.

gitlab.users.deactivate(userId)

Deactivates the specified user. Available only for administrators.

gitlab.users.activities()

Get the last activity date for all users, sorted from oldest to newest. Available only for administrators.

gitlab.users.projects(userId,filters)

Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned.

gitlab.users.starred(userId,filters)

Get a list of visible projects starred by the given user. When accessed without authentication, only public projects are returned.

gitlab.projects.search(filters)

Search for projects by name which are accessible to the authenticated user.

gitlab.projects.create(project)

Creates a new project owned by the authenticated user.

gitlab.projects.update(projectId, patch)

Updates an existing project.

gitlab.projects.get(projectId,options)

Get a specific project. This endpoint can be accessed without authentication if the project is publicly accessible.

gitlab.projects.archive(projectId)

Archives the project if the user is either an administrator or the owner of this project. This action is idempotent, thus archiving an already archived project does not change the project.

gitlab.projects.delete(projectId)

Deletes a project including all associated resources (including issues and merge requests).

gitlab.projects.share(projectId, group)

Allow to share project with group.

gitlab.projects.transfer(projectId, namespace)

Transfer a project to a new namespace.

gitlab.projects.fork(projectId,options)

Forks a project into the user namespace of the authenticated user or the one provided.

gitlab.projects.star(projectId)

Stars a given project.

gitlab.projects.unstar(projectId)

Unstars a given project.

gitlab.projects.languages(projectId)

Get languages used in a project with percentage value.

gitlab.projects.users(projectId,options)

Get the users list of a project.

gitlab.projects.groups(projectId,options)

Get a list of ancestor groups for this project.

gitlab.repositories.tree(projectId)

Get a list of repository files and directories in a project.

gitlab.repositories.branches(projectId,options)

Get a list of repository branches from a project, sorted by name alphabetically.

gitlab.repositories.commits(projectId,options)

Get a list of repository commits in a project.

gitlab.branches.search(projectId,options)

Get a list of repository branches from a project, sorted by name alphabetically.

gitlab.branches.get(projectId, branch)

Get a single project repository branch.

gitlab.branches.create(projectId,options)

Create a new branch in the repository.

gitlab.branches.delete(projectId, branch)

Delete a branch from the repository.

gitlab.branches.prune(projectId)

Deletes all branches that are merged into the project's default branch.

gitlab.commits.search(projectId)

Get a list of repository commits in a project.

gitlab.commits.get(projectId, sha,options)

Get a specific commit identified by the commit hash or name of a branch or tag.

gitlab.commits.refs(projectId, sha,options)

Get all references (from branches or tags) a commit is pushed to. The pagination parameters page and per_page can be used to restrict the list of references.

gitlab.commits.cheeryPick(projectId, sha, branch)

Cherry-picks a commit to a given branch.

gitlab.commits.revert(projectId, sha, branch)

Reverts a commit in a given branch.

gitlab.commits.diff(projectId, sha)

Get the diff of a commit in a project.

gitlab.commits.comments(projectId, sha)

Get the comments of a commit in a project.

gitlab.commits.statuses(projectId, sha,options)

List the statuses of a commit in a project.

gitlab.commits.mergeRequests(projectId, sha)

Get a list of merge requests related to the specified commit.

gitlab.comments.get(projectId, sha)

Get the comments of a commit in a project.

gitlab.comments.create(projectId, sha, data)

Adds a comment to a commit.

Resources

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago