{ "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\"]", "functionArgs":"{\"newMail\":[\"pushEvent\"]}" }, "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\"]", "functionArgs":"{\"newEvent\":[\"pushEvent\"],\"randomNess\":[\"pushEvent\"]}" } }, "ais": { "aiOne": { "id":"aiOne", "lang":"CoffeeScript", "data":"exports.printToLog = ( evt ) ->\n\tlog evt.property", "public":"false", "params":"[\"apikey\"]", "functions":"[\"printToLog\"]", "functionArgs":"{\"printToLog\":[\"evt\"]}" }, "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\tbody =\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, body, ( 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\"]", "functionArgs":"{\"otherEvent\":[\"evt\"]}" }, "aiThree": { "id":"aiThree", "lang":"CoffeeScript", "data":"exports.printUserParamToLog = () ->\n\tlog params.password", "public":"false", "params":"[\"password\"]", "functions":"[\"printUserParamToLog\"]", "functionArgs":"{\"printUserParamToLog\":[]}" } }, "userparams": { "epUpOne": { "apikey": "testkey" } }, "events": { "eventOne":{ "event": "test_1", "body": { "property": "test_1", "nestedProperty": { "more": "really nested" } } }, "eventTwo":{ "event": "test_2" }, "eventReal":{ "event": "epOne -> newMail", "body": { "property": "test_1", "nestedProperty": { "more": "really nested" } } } }, "rules": { "ruleOne": { "id": "ruleReal", "event": "test_1", "event_interval": 1, "conditions": [ { "selector": ".more", "type": "string", "operator": "instr", "compare": "really nested" } ], "actions": ["aiOne -> printToLog"], "action_functions": { "aiOne -> printToLog": [ { "argument": "evt", "value": "#{*}", "jsselector": true } ] } }, "ruleTwo": { "id": "ruleRealTwo", "event": "test_2", "event_interval": 1, "conditions": [], "actions": ["aiTwo -> otherEvent"] }, "ruleThree": { "id": "ruleRealThree", "event": "epOne -> newMail", "event_interval": 1, "conditions": [], "actions": ["aiThree -> printUserParamToLog"] } }, "users": { "userOne": { "username": "tester-1", "password": "password-1", "roles": [] }, "userTwo": { "username": "tester-2", "password": "password-2", "roles": [] }, "userAdmin": { "username": "tester-admin", "password": "password-admin", "roles": [ "admin" ] } } }