This library will enable you to access Zetcom's RIA API with Node.JS.
Clone this repository and install the libraries with :
npm install
The following libraries will be installed :
- request
- xml2js
This is a simple usage example :
// call the lib
var ria = require('mpRiaApi');
// set the user, pass and url
ria.setCreditentials("username", "password");
ria.setInstanceUrl("https://mp-ria-X.zetcom.com/instanceName");
// authenticate
ria.login(function(err, res, body) {
// get the all the available module in an array
ria.getModuleList(function(err, data) {
console.dir('\nError: ' + err);
console.log("\nData: %j", data);
}, 'array');
});
Have a look at the tests to see some more examples on how to use the library.
To be completed.
args : Object with the following properties :
- offset : default 0
- limit : The max number of object to retrieve
- sorting : Array of Object containing following properties :
- fieldPath: RIA valid fieldPath
- direction: RIA valid direction : 'Ascending' or 'Descending'.
The test are done using mocha and chai. You can check the subfolder /test
to check all the fino.
The test configuration file is located in /test/config.json
. The following options are required :
- url : the URL of the RIA application
- username : the username
- password : the password
- keyfile : the keyfile where the session key will be stored (optional)
- encoding : the character encoding to use. Default is utf8 (optional)
You can execute the test with npm run test
or npm run test:watch
for live reload.
- Add API documentation (add description and example for each function).
- Cleanup the old tests in
./test/test.js
.
ZetCom RIA WebServices : http://www.zetcom.com/ria/ws/
test Web Services : http://www.getpostman.com/link/legacy_jetpacks_blog
Format XML output : http://www.freeformatter.com/xml-formatter.html