Built motion from commit (unavailable).|2.5.18
[motion2.git] / server / api / trigger / trigger.rpc.js
index 7b77857..5c4c87d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['model','then','ShowTrigger','Trigger','find','map','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','options','raw','where','attributes','limit','include'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x7072,0x138));var _0x2707=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7072[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['Trigger']['findAll']({'raw':_0x4a8b7f['options']?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x19')]||null:null,'limit':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1a')]||null:null,'include':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')]?_['map'](_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')],function(_0x46259e){return{'model':db[_0x46259e[_0x2707('0x1c')]],'as':_0x46259e['as'],'attributes':_0x46259e[_0x2707('0x19')],'include':_0x46259e[_0x2707('0x1b')]?_['map'](_0x46259e[_0x2707('0x1b')],function(_0x3f6976){return{'model':db[_0x3f6976[_0x2707('0x1c')]],'as':_0x3f6976['as'],'attributes':_0x3f6976[_0x2707('0x19')],'include':_0x3f6976[_0x2707('0x1b')]?_['map'](_0x3f6976[_0x2707('0x1b')],function(_0x4ca05d){return{'model':db[_0x4ca05d[_0x2707('0x1c')]],'as':_0x4ca05d['as'],'attributes':_0x4ca05d[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x57da26){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')]('GetTrigger',_0x4a8b7f,JSON[_0x2707('0x10')](_0x57da26));_0x449a61(_0x57da26);})[_0x2707('0x14')](function(_0x4a99ce){logger[_0x2707('0x11')]('GetTrigger',_0x4a99ce['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x4a99ce['message']));});});};exports[_0x2707('0x1e')]=function(_0x3f153d){var _0x417a97=this;return new Promise(function(_0x36b2e9,_0x48832b){return db[_0x2707('0x1f')][_0x2707('0x20')]({'raw':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options'][_0x2707('0x19')]||null:null,'include':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options']['include']?_['map'](_0x3f153d['options']['include'],function(_0x137e04){return{'model':db[_0x137e04['model']],'as':_0x137e04['as'],'attributes':_0x137e04['attributes'],'include':_0x137e04[_0x2707('0x1b')]?_[_0x2707('0x21')](_0x137e04['include'],function(_0x473954){return{'model':db[_0x473954[_0x2707('0x1c')]],'as':_0x473954['as'],'attributes':_0x473954['attributes'],'include':_0x473954['include']?_[_0x2707('0x21')](_0x473954[_0x2707('0x1b')],function(_0x521edb){return{'model':db[_0x521edb['model']],'as':_0x521edb['as'],'attributes':_0x521edb[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x5a18b0){logger[_0x2707('0xb')](_0x2707('0x1e'),_0x3f153d);logger[_0x2707('0xe')](_0x2707('0x1e'),_0x3f153d,JSON[_0x2707('0x10')](_0x5a18b0));_0x36b2e9(_0x5a18b0);})[_0x2707('0x14')](function(_0x5bd2e5){logger[_0x2707('0x11')](_0x2707('0x1e'),_0x5bd2e5[_0x2707('0x13')],_0x3f153d);_0x48832b(_0x417a97[_0x2707('0x11')](0x1f4,_0x5bd2e5[_0x2707('0x13')]));});});};
\ No newline at end of file
+var _0x93e9=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','map','include','model','attributes','stringify','ShowTrigger','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4bab2f,_0x348327){var _0x15971e=function(_0x1db965){while(--_0x1db965){_0x4bab2f['push'](_0x4bab2f['shift']());}};_0x15971e(++_0x348327);}(_0x93e9,0xcc));var _0x993e=function(_0x4b90b3,_0x164fb2){_0x4b90b3=_0x4b90b3-0x0;var _0x45472e=_0x93e9[_0x4b90b3];return _0x45472e;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('Trigger,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('Trigger,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['findAll']({'raw':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')][_0x993e('0x19')]===undefined?!![]:![]:!![],'where':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')][_0x993e('0x1a')]||null:null,'attributes':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')]['attributes']||null:null,'limit':_0x1acd21[_0x993e('0x18')]?_0x1acd21['options'][_0x993e('0x1b')]||null:null,'include':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')]['include']?_[_0x993e('0x1c')](_0x1acd21[_0x993e('0x18')][_0x993e('0x1d')],function(_0x1c52fd){return{'model':db[_0x1c52fd[_0x993e('0x1e')]],'as':_0x1c52fd['as'],'attributes':_0x1c52fd[_0x993e('0x1f')],'include':_0x1c52fd[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x1c52fd[_0x993e('0x1d')],function(_0x18f6ac){return{'model':db[_0x18f6ac[_0x993e('0x1e')]],'as':_0x18f6ac['as'],'attributes':_0x18f6ac[_0x993e('0x1f')],'include':_0x18f6ac['include']?_[_0x993e('0x1c')](_0x18f6ac[_0x993e('0x1d')],function(_0x52b727){return{'model':db[_0x52b727[_0x993e('0x1e')]],'as':_0x52b727['as'],'attributes':_0x52b727['attributes']};}):[]};}):[]};}):[]:[]})[_0x993e('0xd')](function(_0xa03fbd){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger['debug']('GetTrigger',_0x1acd21,JSON[_0x993e('0x20')](_0xa03fbd));_0x3d6109(_0xa03fbd);})[_0x993e('0x15')](function(_0x4a4f00){logger[_0x993e('0x12')](_0x993e('0x16'),_0x4a4f00[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9['error'](0x1f4,_0x4a4f00[_0x993e('0x13')]));});});};exports[_0x993e('0x21')]=function(_0x1f5d51){var _0x1fa8a5=this;return new Promise(function(_0x2599ec,_0x54da4e){return db[_0x993e('0x17')]['find']({'raw':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51['options'][_0x993e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f5d51['options']?_0x1f5d51[_0x993e('0x18')][_0x993e('0x1a')]||null:null,'attributes':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51[_0x993e('0x18')][_0x993e('0x1f')]||null:null,'include':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51['options'][_0x993e('0x1d')]?_['map'](_0x1f5d51['options'][_0x993e('0x1d')],function(_0x497d29){return{'model':db[_0x497d29[_0x993e('0x1e')]],'as':_0x497d29['as'],'attributes':_0x497d29[_0x993e('0x1f')],'include':_0x497d29[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x497d29[_0x993e('0x1d')],function(_0x339fb6){return{'model':db[_0x339fb6[_0x993e('0x1e')]],'as':_0x339fb6['as'],'attributes':_0x339fb6[_0x993e('0x1f')],'include':_0x339fb6[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x339fb6[_0x993e('0x1d')],function(_0x110504){return{'model':db[_0x110504[_0x993e('0x1e')]],'as':_0x110504['as'],'attributes':_0x110504[_0x993e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x993e('0xd')](function(_0x5818c5){logger[_0x993e('0xe')](_0x993e('0x21'),_0x1f5d51);logger[_0x993e('0x22')](_0x993e('0x21'),_0x1f5d51,JSON[_0x993e('0x20')](_0x5818c5));_0x2599ec(_0x5818c5);})[_0x993e('0x15')](function(_0x1913c0){logger[_0x993e('0x12')](_0x993e('0x21'),_0x1913c0['message'],_0x1f5d51);_0x54da4e(_0x1fa8a5[_0x993e('0x12')](0x1f4,_0x1913c0['message']));});});};
\ No newline at end of file