stasher
TypeScript icon, indicating that this package has built-in type declarations

0.3.6 • Public • Published

A JavaScript client for Atlassian Stash's REST API, utilizing Promises.

Installation

From npm:

npm install stasher

The 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/repos
      • GET /rest/api/1.0/projects
      • GET /rest/api/1.0/projects/{key}
      • GET /rest/api/1.0/projects/{key}/repos
      • GET /rest/api/1.0/projects/{key}/repos/{repo}
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/tags
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/forks
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/related
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/branches
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/branches/default
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/browse
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/browse/{path}
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/changes
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/commits
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}/changes
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/commits/{id}/comments
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/files
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/activities
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/changes
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/comments
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/commits
      • GET /rest/api/1.0/projects/{key}/repos/{repo}/pull-requests/{id}/diff
      • GET /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/users
      • GET /rest/api/1.0/users/{slug}
  • Build Integration API

Package Sidebar

Install

npm i stasher

Weekly Downloads

2

Version

0.3.6

License

ISC

Last publish

Collaborators

  • aalpern