0.3.6 • Published 10 years ago
stasher v0.3.6
A JavaScript client for Atlassian Stash's REST API, utilizing Promises.
Installation
From npm:
npm install stasherThe library and its dependencies are compatible with browserify.
Usage
All API methods return Promises/A+ compatible promises via Bluebird.
let stasher = require('stasher')
let client = new stasher.Client({
base_url: 'http://dockerhost:32833/stash',
auth: {
type: stash.AuthType.BASIC,
username: 'user',
password: 'pass'
}
})
function log(data) {
console.log('----------')
console.log(data)
}
client.projects.get()
.then(log)
client.projects.get('PROJ')
.then((project) => {
return project.repositories()
})
.then(log)
client.repositories.get('PROJ', 'awesome-service')
.then((repo) -> {
return repo.pull_requests()
})
.then(log)Current Status
Work in progress.
- Error handling
- OAuth
- Core API
- Projects
GET /rest/api/1.0/reposGET /rest/api/1.0/projectsGET /rest/api/1.0/projects/{key}GET /rest/api/1.0/projects/{key}/reposGET /rest/api/1.0/projects/{key}/repos/{repo}GET /rest/api/1.0/projects/{key}/repos/{repo}/tagsGET /rest/api/1.0/projects/{key}/repos/{repo}/forksGET /rest/api/1.0/projects/{key}/repos/{repo}/relatedGET /rest/api/1.0/projects/{key}/repos/{repo}/branchesGET /rest/api/1.0/projects/{key}/repos/{repo}/branches/defaultGET /rest/api/1.0/projects/{key}/repos/{repo}/browseGET /rest/api/1.0/projects/{key}/repos/{repo}/browse/{path}GET /rest/api/1.0/projects/{key}/repos/{repo}/changesGET /rest/api/1.0/projects/{key}/repos/{repo}/commitsGET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}GET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}/changesGET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}/commentsGET /rest/api/1.0/projects/{key}/repos/{repo}/filesGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requestsGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/activitiesGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/changesGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/commentsGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/commitsGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/diffGET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/participants
- Profile
GET /rest/api/1.0/profile/recent/repos
- Users
GET /rest/api/1.0/usersGET /rest/api/1.0/users/{slug}
- Projects
- Build Integration API