connectwise-action-api
A thin high performance JavaScript layer for the ConnectWise XML Action API designed for Node.js.
Last updated 4 years ago by rjanicek .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install connectwise-action-api 
SYNC missed versions from official npm registry.

connectwise-action-api

A thin high performance JavaScript layer for the ConnectWise XML Action API designed for Node.js.

buffered usage

Buffer results and return with callback api. Optimized for smaller result sets. Entire response is buffered, then parsed into a JavaScript object.

var cw = require('connectwise-action-api').configure(
	'SERVER HOST NAME',
	'COMPANY NAME',
	'INTEGRATOR LOGIN ID',
	'INTEGRATOR PASSWORD'
);

cw.action('GetTicketAction', {
	SrServiceRecid: 12345
}, function (error, result) {
	error && console.error(error);
	if (result) {
		var ticket = result.GetTicketAction.Ticket;
	    console.dir(ticket);
	}
});

streaming usage

Stream results using event emitter api. Optimized for large result sets. Uses less memory. Matches can be processed immediately and asynchronously. No need to depend on server paging. Fewer server round trips. Each xPath match is parsed into a JavaScript object and emitted as an event.

var cw = require('connectwise-action-api').configure(
	'SERVER HOST NAME',
	'COMPANY NAME',
	'INTEGRATOR LOGIN ID',
	'INTEGRATOR PASSWORD'
);

cw.actionStream('RunReportQueryAction', '//Result', {
		ReportName: 'Schedule',
		Limit: 100000
	})
	.on('match', function (match) {
		console.dir(match);
	})
	.on('error', function (error) {
		console.error(error);
	})
	.on('end', function () {
		// all done
	});

tests

See tests directory for documentation and examples of API actions. Tests clean up after themselves.

  • Configure tests in test-config.js
  • Run all tests: node test
  • Run specific tests using file name pattern: node test version
d:\connectwise-action-api>node test version

get-connectwise-version.js
{ Version: 'v2014.4.23325', IsCloud: 'false' }
✔ get_connectwise_version

OK: 2 assertions (729ms)
  • Clean up after tests: npm run clean

install

npm install --save connectwise-action-api

docs

available reports and fields

ideas

  • make it work with Node.js and Browser

Current Tags

  • 1.1.1                                ...           latest (a year ago)

13 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           2 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (9)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |