/**
* Aria Automation handler emulation for Node.js
*
* @author Stefan Schnell <mail@stefan-schnell.de>
* @license MIT
* @version 0.1.0
*/
// Begin ---------------------------------------------------------------
exports.handler = (context, inputs, callback) => {
console.log('Inputs were ' + JSON.stringify(inputs));
console.log(inputs.name);
callback(undefined, {status: "done", result: "Result"});
}
// End -----------------------------------------------------------------
function template(context, inputs, callback) {
return exports.handler(context, inputs, callback);
}
var context = {
executionId: '07c137b0-1a96-43f8-9ac1-e1e3c1d3415d',
returnType: 'Properties',
vcoUrl: 'http://localhost:8280/vco',
getToken: function() {}
}
var inputs = {
name: "Stefan Schnell",
city: "Oberirsen"
}
callback = (parameter1, outputs) => {
// Output is from type JSON object.
//console.log(JSON.stringify(outputs));
console.log(outputs.status);
console.log(outputs.result);
}
template(context, inputs, callback);
console.log('\nPress any key to continue...');
process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', process.exit.bind(process, 0));
|