Icontem

Node.js Promise Redmine: Access Redmine API using Node.js and promises

Recommend this page to a friend!

  Author Author  
Name: Jonathan Gotti <contact>
Classes: 8 packages by
Country: France France
Age: 40
All time rank: 262 in France France
Week rank: 34 Down3 in France France Down
Innovation award
Innovation award
Nominee: 5x

Winner: 3x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package can access Redmine API using Node.js and promises.

It can send HTTP requests to a Redmine API Web server to execute several operations. This is a modified version of the original Node.js Redmine API client written by sotarok.

This version uses promises to handle API responses or errors.

Details

node-promised-redmine

Redmine REST API Client for node.js implemented with promises/A+ Codacy Badge Build Status

This was a modified version of the original redmine module by sotarok using D.js to implement it as a promises/A+ compatible api. But it has been largely rewrote since and is a totally different project now.

Features

  • support both http / https protocols
  • support basicAuth authentication
  • compatible with promises/A+ through D.js
  • simple api
  • recursively retrieve issues until given date
  • exponential backoff retries

Main methods

  • Settings getter/setter - _all setters return the Redmine instance and are chainable_ - (get|set)ApiKey(key) api key given by your redmine server - (get|set)Host(host) ip or hostname of the redmine api endpoint - (get|set)Port(port) set remote server port default to 80 - (get|set)BasicAuth(auth) string used as auth option of the http request - (get|set)Protocol(protocol) http or https - (get|set)PathPrefix(prefix) path prefix to prepend to each request paths - (get|set)SslCaCert(certFilePath) path or array of path to authority certificates files to check the remote host against - (get|set)SslClientCert(certFilePath) path to public x509 certificate file to use - setSslClientKey(keyFilePath, passPhrase)* path to client private key file to use for SSL and associated passphrase - (get|set)MaxTry(maxTry) max number of retry on request error default to 1 (get|set)MaxDelay(maxDelay) max time in ms to wait between two retry on request error default to 2000 (get|set)Verbose(verbose) boolean value that turn on/off console.log on errors and retries. (default setting to false)
  • Generics - _all generic methods path doesn't require leading slash nor the .json extension e.g. for issues it can be "issues" or "issues/{id}"_ - get(path, params) get a single resource or a list or resources - getAllSince(what, since, params) helper to get all items of a collection since the given date (isoString or Date instance) - post(path, params) create a new resource on corresponding path - put(path, params) update a given resource with params - del(path, params) remove given resource
  • Issues - getIssues(params) return list of issues (max 100) - getIssue(id, params) return an issue details by its id - getAllIssuesSince(since, params) return all issues since given date (isoString or Date instance) - postIssue(issue, params) create a new issue - updateIssue(id, issue, params) update issue with given id - deleteIssue(id, params) delete an issue by its id
  • Users - getUsers(params) return list of users (max 100) - getUser(id, params) retrieve user details by its id - getUserCurrent(params) return current user (the one corresponding to the apiKey)
  • Projects - getProjects(params) get a list of projects (max 100) - getProject(id, params) return details about a single project by its id - getAllProjectsSince(since, params) return all projects updated since given date (isoString or Date instance)
  • Time Entries - getTimeEntries(params) returns a list of time entries - getTimeEntry(id, params) returns time entry of given id - postTimeEntry(timeEntry, params) returns time entry of given id - updateTimeEntry(id, timeEntry, params) update time entry corresponding to the given id - deleteTimeEntry(id, params) delete time entry of given id

Generic Parameters

All request made can use following additional parameters in the params argument: - retry: a retry settings based on an exponential backoff algorithm. You can set thoose settings for all request using setMaxRetry and setMaxDelay methods, or on a request basis by passing a retry property to the params parameter. This retry property should be an object with one or two property of maxTry and maxDelay e.g. `var params = {retry: {maxTry:3}}` - impersonate: allow you to add a _X-Redmine-Switch-User_ header on a request basis. This will only work when you are authenticated as an admin user in the first place. `var params = {impersonate: 'username'};`

Basic Usage example

var Redmine = require('promised-redmine');
var config = {
  host: "localhost", // required
  apiKey: "XXXXXX", // required
  pathPrefix: "/myRedminePath",
  protocol: "http",
  // if using SSL settings, change protocol and port accordingly
  sslCaCert: '/path/to/root/ca.pem', // defaults to null
  sslClientCert: '/path/to/client/cert.pem', // defaults to null
  sslClientKey: '/path/to/client/cert.key', // defaults to null
  sslClientPassphrase: 'clientKeyPassphrase' // defaults to null
}
var redmineApi = new Redmine(config);
redmineApi.getIssues()
  .success(function(issues){ // success is an alias of then without the promise rejection management in D.js the underlying promise library
    // do something with that
  })

Install

Install from npm:

$ npm install promised-redmine

Link

How to help

Contributions are always welcome. I have no more redmine installation available for testing. So if you have one you can share for testing purpose, it will be of great help to this project.


  Classes of Jonathan Gotti  >  Node.js Promise Redmine  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Node.js Promise Redmine
Base name: node-promise-redmine
Description: Access Redmine API using Node.js and promises
Version: 0.1.6
JavaScript version: 1.5
License: MIT/X Consortium License
All time users: 67 users
All time rank: 454
Week users: 0 users
Week rank: 45 Equal
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image Node.js Components that extend the Node.js framework View top rated classes
Group folder image Web services Web data clipping, REST, SOAP or XML-RPC clients and servers View top rated classes


  User ratings  
Not enough user ratings

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagelib (1 file)
Files folder imagetest (1 file)
Accessible without login Plain text file .jscsrc Data Auxiliary data
Accessible without login Plain text file LICENSE Doc. Documentation
Accessible without login Plain text file package.json Data Documentation
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file example.js Example Example script

  Files folder image Files  /  lib  
File Role Description
  Plain text file redmine.js Class Class source

  Files folder image Files  /  test  
File Role Description
  Accessible without login Plain text file redmine.test.js Test Unit test script

Install with Composer Install with Composer - Download Download all files: node-promise-redmine.tar.gz node-promise-redmine.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.