webapi-eca/testing/files/testObjects.json

129 lines
No EOL
4.2 KiB
JSON

{
"eps": {
"epOne": {
"id":"epOne",
"lang":"CoffeeScript",
"data":"\n#\n# EmailYak EVENT POLLER\n#\n# Requires user params:\n# - apikey: The user's EmailYak API key\n#\n\nurl = 'https://api.emailyak.com/v1/' + params.apikey + '/json/get/new/email/'\n\nexports.newMail = ( pushEvent ) ->\n needle.get url, ( err, resp, body ) ->\n if not err and resp.statusCode is 200\n mails = JSON.parse( body ).Emails\n pushEvent mail for mail in mails\n else\n log.error 'Error in EmailYak EM newMail: ' + err.message\n\n",
"public":"false",
"params":"[\"apikey\"]",
"functions":"[\"newMail\"]"
},
"epTwo": {
"id":"epTwo",
"lang":"CoffeeScript",
"data":"\nurl = 'https://api.emailyak.com/v1/' + params.firstparam + '/json/get/new/email/'\n\nexports.newEvent = ( pushEvent ) ->\n needle.get url, ( err, resp, body ) ->\n if not err and resp.statusCode is 200\n mails = JSON.parse( body ).Emails\n pushEvent mail for mail in mails\n else\n log.error 'Error in EmailYak EM newMail: ' + err.message\n\nexports.randomNess = ( pushEvent ) ->\n console.log 'test runs: ' + params.secondparam\n",
"public":"true",
"params":"[\"firstparam\",\"secondparam\"]",
"functions":"[\"newEvent\",\"randomNess\"]"
}
},
"ais": {
"aiOne": {
"id":"aiOne",
"lang":"CoffeeScript",
"data":"exports.printToLog = ( evt ) ->\n\tlog evt.property",
"public":"false",
"params":"[\"apikey\"]",
"functions":"[\"printToLog\"]"
},
"aiTwo": {
"id":"aiTwo",
"lang":"CoffeeScript",
"data":"# Send a mail through emailyak\nexports.otherEvent = ( evt ) ->\n\turl = 'https://api.emailyak.com/v1/' + params.apikey + '/json/send/email/'\n\tpayload =\n\t FromAddress : \"testsender@mscliveweb.simpleyak.com\",\n\t ToAddress: \"dominic.bosch@gmail.com\",\n\t Subject: \"TestMAIL\",\n\t TextBody: \"Hello\"\n\t\n\tneedle.post url, payload, ( err, resp, body ) ->\n\t\tif err\n\t\t\tlog err\n\t\tif resp.statusCode isnt 200\n\t\t\tlog 'Request not successful:'\n\t\t\tlog body\n",
"public":"false",
"params":"[\"apikey\",\"andmore\"]",
"functions":"[\"otherEvent\"]"
},
"aiThree": {
"id":"aiThree",
"lang":"CoffeeScript",
"data":"exports.printUserParamToLog = ( evt ) ->\n\tlog params.password",
"public":"false",
"params":"[\"password\"]",
"functions":"[\"printUserParamToLog\"]"
}
},
"userparams": {
"epUpOne": {
"apikey": "testkey"
}
},
"events": {
"eventOne":{
"event": "test_1",
"payload": {
"property": "test_1",
"nestedProperty": {
"more": "really nested"
}
}
},
"eventTwo":{
"event": "test_2"
},
"eventReal":{
"event": "epOne -> newMail",
"payload": {
"property": "test_1",
"nestedProperty": {
"more": "really nested"
}
}
}
},
"rules": {
"ruleOne": {
"id": "ruleOne_id",
"event": "custom-test-1",
"conditions": [],
"actions": []
},
"ruleTwo": {
"id": "ruleTwo_id",
"event": "custom-test-2",
"conditions": [],
"actions": []
},
"ruleThree": {
"id": "ruleThree_id",
"event": "custom-test-3",
"conditions": [],
"actions": []
},
"ruleReal": {
"id": "ruleReal",
"event": "epOne -> newMail",
"conditions": [".more:val(\"really nested\")"],
"actions": ["aiOne -> printToLog"]
},
"ruleRealTwo": {
"id": "ruleRealTwo",
"event": "epOne -> newMail",
"conditions": [],
"actions": ["aiTwo -> otherEvent"]
},
"ruleRealThree": {
"id": "ruleRealThree",
"event": "epOne -> newMail",
"conditions": [],
"actions": ["aiThree -> printUserParamToLog"]
}
},
"users": {
"userOne": {
"username": "tester-1",
"password": "password-1"
},
"userTwo": {
"username": "tester-2",
"password": "password-2"
},
"userAdmin": {
"username": "tester-admin",
"password": "password-admin",
"roles": [ "admin" ],
"isAdmin": true
}
}
}