A simple Node client for the teamseer.com API.
Only getActiveUsers
and getRecordsByUser
are implemented.
var teamseer = require('teamseer-node-client');
var client = new teamseer.Client({
companyId: '12345',
companyKey: 'abc123fghi456',
apiVersion: '1_0_1'
}, new teamseer.adapters.Soap('https://www.teamseer.com/services/soap/coreapi/1_0_1/teamseer_core_api.wsdl'));
/**
* Return all recorded days for a user within a given range
* @param {string} userIdentifier Typically the users email
* @param {string} fromDate The start date as YYYY-MM-DD
* @param {string} toDate The end date as YYYY-MM-DD
* @returns {Promise}
*/
client.getRecordsByUser('[email protected]', '2015-12-01', '2015-12-31').then(function(records) {
console.log(records);
});
// Example output:
//
// [ '2015-12-21',
// '2015-12-22',
// '2015-12-23',
// '2015-12-24',
// '2015-12-25',
// '2015-12-26',
// '2015-12-28',
// '2015-12-29',
// '2015-12-30',
// '2015-12-31' ]
/**
* Returns active users as an array
* @returns {Promise}
*/
client.getActiveUsers().then(function(records) {
console.log(records);
});
// Example output:
//
// [ '[email protected]',
// '[email protected]',
// '[email protected]',
// '[email protected]',
// '[email protected]',
// '[email protected]' ]
var teamseer = require('teamseer-node-client');
var client = new teamseer.Client({
companyId: '12345',
companyKey: 'abc123fghi456',
apiVersion: '1_0_1'
}, new teamseer.adapters.Soap('https://www.teamseer.com/services/soap/coreapi/1_0_1/teamseer_core_api.wsdl'));
client.getRecordsByUser('[email protected]', '2015-12-01', '2015-12-31').then(function(records) {
console.log("success", records);
}, function(err) {
console.log("error", err);
});
This project has been developed for personal needs and therefore has no demand to be feature-complete. I used RxJs because I wanted to play with - it´ my first project with this library, so if I´m doing something stupid, please let me know.