A NodeJS API client to Redmine REST API
- node >=10
yarn add @smartinsf/redmine-client
Create an instance of RedmineClient
to access the resources. E.g.:
import { RedmineClient } from '@smartinsf/redmine-client';
// Create an instance passing your Redmine host and the username and password credentials
// Only Basic authentication is supported for now
const client = new RedmineClient('http://redmine.yourhost.com', {
username: 'test',
password: 'secret',
});
All resources accepts the params from Redmine docs in camelCase.
// Updating an issue
const issue = 123;
const params = {
statusId: 1,
};
client.issues().update(issue, params);
// Listing time entries
const listParams = {
offset: 1,
limit: 100,
projectId: 10,
from: new Date(2020, 1, 1),
to: new Date(2020, 1, 1),
userId: 'me',
};
const timeEntries = client.timeEntries().list(listParams);
// Time entry creation
const params = {
spentOn: new Date(2020, 2, 2),
hours: 1,
activityId: 2,
comments: 'Testing redmine client',
issueId: 10,
};
client.timeEntries().create(params);
Redmine wiki page: http://www.redmine.org/projects/redmine/wiki/Rest_api
👤 Samuel Martins
- Github: @sfelix-martins
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator