stash-rest-api
v2.6.0
Published
Provides access to *some* of Stash's APIs.
Downloads
8
Readme
Rest client for Atlassian Stash
Provides access to some of Stash's APIs.
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(); // Promiserepos
Get all repos for a project.
stash.repos.get(projectKey); // PromiseGet all repos for all projects.
stash.repos.getCombined(); // Promisepull requests
Get all pull requests for a repo.
stash.prs.get(projectKey, repoSlug); // PromiseGet all pull requests for a project.
stash.prs.getCombined(projectKey); // PromiseGet all pull requests on all projects.
stash.prs.getCombined(); // PromiseGet all pull requests by a specific author.
stash.prs.getCombined(null, null, { author: "ben" }); // PromiseGet all pull requests in a specific state (defaults OPEN).
stash.prs.getCombined(null, null, { state: "MERGED" }); // PromisePossible states: ALL, OPEN, DECLINED or MERGED.
hooks
Get all hooks for a repo.
stash.hooks.get(projectKey, repoSlug); // PromiseGet all pre-recieve hooks.
stash.hooks.getPreReceive(projectKey, repoSlug); // PromiseGet all post-recieve hooks.
stash.hooks.getPostReceive(projectKey, repoSlug); // PromiseGet details for a single hook.
stash.hooks.getHook(projectKey, repoSlug, hookKey); // PromiseAPI 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]
