Git Product home page Git Product logo

stash-rest-client's Introduction

Rest client for Atlassian Stash

Provides access to some of Stash's APIs.

Coverage Status

Initialising Client

var auth = {
    "user": "username",
    "password": "password"
};

var Client = require('stash-rest-api').Client;

var stash = new Client(
    'http://localhost:7990/rest/api/1.0/',
    auth.user,
    auth.password
);

APIS

projects

Get all projects.

stash.projects.get(); // Promise

repos

Get all repos for a project.

stash.repos.get(projectKey); // Promise

Get all repos for all projects.

stash.repos.getCombined(); // Promise

pull requests

Get all pull requests for a repo.

stash.prs.get(projectKey, repoSlug); // Promise

Get all pull requests for a project.

stash.prs.getCombined(projectKey); // Promise

Get all pull requests on all projects.

stash.prs.getCombined(); // Promise

Get all pull requests by a specific author.

stash.prs.getCombined(null, null, { author: "ben" }); // Promise

Get all pull requests in a specific state (defaults OPEN).

stash.prs.getCombined(null, null, { state: "MERGED" }); // Promise

Possible states: ALL, OPEN, DECLINED or MERGED.

hooks

Get all hooks for a repo.

stash.hooks.get(projectKey, repoSlug); // Promise

Get all pre-recieve hooks.

stash.hooks.getPreReceive(projectKey, repoSlug); // Promise

Get all post-recieve hooks.

stash.hooks.getPostReceive(projectKey, repoSlug); // Promise

Get details for a single hook.

stash.hooks.getHook(projectKey, repoSlug, hookKey); // Promise

API Coverage

  • /rest/api/1.0/projects [GET]
  • /rest/api/1.0/projects/{projectKey}/repos [GET]
  • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug} [GET]
  • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests [GET]
  • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks [GET]
  • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled [PUT]

stash-rest-client's People

Watchers

James Cloos avatar Vignesh Sattanathan avatar

Forkers

spkarthick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.