2014-03-23 21:52:16 +00:00
{
"eps" : {
2014-04-02 13:54:20 +00:00
"epOne" : {
"id" : "epOne" ,
2014-04-03 15:41:51 +00:00
"lang" : "CoffeeScript" ,
2014-04-02 13:54:20 +00:00
"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\"]" ,
2014-04-15 12:25:26 +00:00
"functions" : "[\"newMail\"]" ,
"functionArgs" : "{\"newMail\":[\"pushEvent\"]}"
2014-03-23 21:52:16 +00:00
} ,
2014-04-02 13:54:20 +00:00
"epTwo" : {
"id" : "epTwo" ,
2014-04-03 15:41:51 +00:00
"lang" : "CoffeeScript" ,
2014-04-02 13:54:20 +00:00
"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\"]" ,
2014-04-15 12:25:26 +00:00
"functions" : "[\"newEvent\",\"randomNess\"]" ,
"functionArgs" : "{\"newEvent\":[\"pushEvent\"],\"randomNess\":[\"pushEvent\"]}"
2014-03-23 21:52:16 +00:00
}
} ,
2014-04-03 15:41:51 +00:00
"ais" : {
"aiOne" : {
"id" : "aiOne" ,
"lang" : "CoffeeScript" ,
2014-04-04 17:53:42 +00:00
"data" : "exports.printToLog = ( evt ) ->\n\tlog evt.property" ,
2014-04-03 15:41:51 +00:00
"public" : "false" ,
"params" : "[\"apikey\"]" ,
2014-04-15 12:25:26 +00:00
"functions" : "[\"printToLog\"]" ,
"functionArgs" : "{\"printToLog\":[\"evt\"]}"
2014-04-03 15:41:51 +00:00
} ,
"aiTwo" : {
"id" : "aiTwo" ,
"lang" : "CoffeeScript" ,
2014-04-04 17:53:42 +00:00
"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" ,
2014-04-03 15:41:51 +00:00
"public" : "false" ,
"params" : "[\"apikey\",\"andmore\"]" ,
2014-04-16 15:42:56 +00:00
"functions" : "[\"otherEvent\"]" ,
"functionArgs" : "{\"otherEvent\":[\"evt\"]}"
2014-04-04 17:53:42 +00:00
} ,
"aiThree" : {
"id" : "aiThree" ,
"lang" : "CoffeeScript" ,
2014-04-16 21:38:41 +00:00
"data" : "exports.printUserParamToLog = () ->\n\tlog params.password" ,
2014-04-04 17:53:42 +00:00
"public" : "false" ,
"params" : "[\"password\"]" ,
2014-04-16 15:42:56 +00:00
"functions" : "[\"printUserParamToLog\"]" ,
2014-04-16 21:38:41 +00:00
"functionArgs" : "{\"printUserParamToLog\":[]}"
2014-04-03 15:41:51 +00:00
}
} ,
2014-04-02 21:08:05 +00:00
"userparams" : {
"epUpOne" : {
"apikey" : "testkey"
}
} ,
2014-04-04 17:53:42 +00:00
"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"
}
}
}
} ,
2014-03-23 21:52:16 +00:00
"rules" : {
"ruleOne" : {
2014-04-03 15:41:51 +00:00
"id" : "ruleReal" ,
2014-04-16 15:42:56 +00:00
"event" : "test_1" ,
2014-04-19 20:35:05 +00:00
"event_interval" : 1 ,
2014-04-03 21:35:02 +00:00
"conditions" : [ ".more:val(\"really nested\")" ] ,
2014-04-19 20:35:05 +00:00
"actions" : [ "aiOne -> printToLog" ] ,
"action_functions" : {
"aiOne -> printToLog" : [
{
"argument" : "evt" ,
"value" : "*" ,
"jsselector" : true
}
]
}
2014-04-03 21:35:02 +00:00
} ,
2014-04-16 15:42:56 +00:00
"ruleTwo" : {
2014-04-03 21:35:02 +00:00
"id" : "ruleRealTwo" ,
2014-04-16 15:42:56 +00:00
"event" : "test_2" ,
2014-04-19 20:35:05 +00:00
"event_interval" : 1 ,
2014-04-03 21:35:02 +00:00
"conditions" : [ ] ,
"actions" : [ "aiTwo -> otherEvent" ]
2014-04-04 17:53:42 +00:00
} ,
2014-04-16 15:42:56 +00:00
"ruleThree" : {
2014-04-04 17:53:42 +00:00
"id" : "ruleRealThree" ,
"event" : "epOne -> newMail" ,
2014-04-19 20:35:05 +00:00
"event_interval" : 1 ,
2014-04-04 17:53:42 +00:00
"conditions" : [ ] ,
"actions" : [ "aiThree -> printUserParamToLog" ]
2014-03-23 21:52:16 +00:00
}
} ,
"users" : {
"userOne" : {
"username" : "tester-1" ,
2014-04-21 12:42:26 +00:00
"password" : "password-1" ,
"roles" : [ ]
2014-03-23 21:52:16 +00:00
} ,
"userTwo" : {
"username" : "tester-2" ,
2014-04-21 12:42:26 +00:00
"password" : "password-2" ,
"roles" : [ ]
2014-03-23 21:52:16 +00:00
} ,
"userAdmin" : {
"username" : "tester-admin" ,
"password" : "password-admin" ,
2014-04-21 12:42:26 +00:00
"roles" : [ "admin" ]
2014-03-23 21:52:16 +00:00
}
}
}