Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / trigger / trigger.rpc.js
index 982ea1e..7a6c9d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['findAll','options','attributes','include','map','model','then','catch','ShowTrigger','find','raw','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger'];(function(_0xcf6e17,_0x2be7ac){var _0x59265e=function(_0x358bfd){while(--_0x358bfd){_0xcf6e17['push'](_0xcf6e17['shift']());}};_0x59265e(++_0x2be7ac);}(_0x351d,0x90));var _0xd351=function(_0x43a13d,_0x30fe7e){_0x43a13d=_0x43a13d-0x0;var _0x421fb8=_0x351d[_0x43a13d];return _0x421fb8;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('Trigger,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')]({'raw':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['where']||null:null,'attributes':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x17')]||null:null,'limit':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')]['limit']||null:null,'include':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x4e0164[_0xd351('0x16')][_0xd351('0x18')],function(_0x365bbc){return{'model':db[_0x365bbc['model']],'as':_0x365bbc['as'],'attributes':_0x365bbc[_0xd351('0x17')],'include':_0x365bbc[_0xd351('0x18')]?_[_0xd351('0x19')](_0x365bbc[_0xd351('0x18')],function(_0x489c9a){return{'model':db[_0x489c9a[_0xd351('0x1a')]],'as':_0x489c9a['as'],'attributes':_0x489c9a['attributes'],'include':_0x489c9a[_0xd351('0x18')]?_[_0xd351('0x19')](_0x489c9a['include'],function(_0x2648d0){return{'model':db[_0x2648d0['model']],'as':_0x2648d0['as'],'attributes':_0x2648d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd351('0x1b')](function(_0x560be9){logger['info'](_0xd351('0x13'),_0x4e0164);logger['debug'](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x560be9));_0x1e1a3c(_0x560be9);})[_0xd351('0x1c')](function(_0x4d3f48){logger[_0xd351('0xf')]('GetTrigger',_0x4d3f48[_0xd351('0x11')],_0x4e0164);_0x2bfc53(_0x4c6693['error'](0x1f4,_0x4d3f48['message']));});});};exports[_0xd351('0x1d')]=function(_0x38c82f){var _0x3f9ef3=this;return new Promise(function(_0x33b43d,_0x48aa96){return db[_0xd351('0x14')][_0xd351('0x1e')]({'raw':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x1f')]===undefined?!![]:![]:!![],'where':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x20')]||null:null,'attributes':_0x38c82f[_0xd351('0x16')]?_0x38c82f['options'][_0xd351('0x17')]||null:null,'include':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x38c82f[_0xd351('0x16')][_0xd351('0x18')],function(_0x3d5b7f){return{'model':db[_0x3d5b7f[_0xd351('0x1a')]],'as':_0x3d5b7f['as'],'attributes':_0x3d5b7f[_0xd351('0x17')],'include':_0x3d5b7f[_0xd351('0x18')]?_[_0xd351('0x19')](_0x3d5b7f[_0xd351('0x18')],function(_0x238663){return{'model':db[_0x238663['model']],'as':_0x238663['as'],'attributes':_0x238663['attributes'],'include':_0x238663[_0xd351('0x18')]?_[_0xd351('0x19')](_0x238663[_0xd351('0x18')],function(_0x2907b7){return{'model':db[_0x2907b7[_0xd351('0x1a')]],'as':_0x2907b7['as'],'attributes':_0x2907b7[_0xd351('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e2fa){logger[_0xd351('0xb')]('ShowTrigger',_0x38c82f);logger[_0xd351('0xd')](_0xd351('0x1d'),_0x38c82f,JSON[_0xd351('0xe')](_0x47e2fa));_0x33b43d(_0x47e2fa);})[_0xd351('0x1c')](function(_0x33307){logger[_0xd351('0xf')](_0xd351('0x1d'),_0x33307[_0xd351('0x11')],_0x38c82f);_0x48aa96(_0x3f9ef3[_0xd351('0xf')](0x1f4,_0x33307[_0xd351('0x11')]));});});};
\ No newline at end of file
+var _0x8f59=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','catch','ShowTrigger','stringify','lodash','util','moment'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x8f59,0x11d));var _0x98f5=function(_0x18fd0b,_0xe0f9ed){_0x18fd0b=_0x18fd0b-0x0;var _0x3b19a3=_0x8f59[_0x18fd0b];return _0x3b19a3;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('Trigger,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('Trigger,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')]({'raw':_0x51a567[_0x98f5('0x17')]?_0x51a567['options'][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x19')]||null:null,'attributes':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'limit':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1b')]||null:null,'include':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')]['include']?_[_0x98f5('0x1c')](_0x51a567['options'][_0x98f5('0x1d')],function(_0x495889){return{'model':db[_0x495889[_0x98f5('0x1e')]],'as':_0x495889['as'],'attributes':_0x495889[_0x98f5('0x1a')],'include':_0x495889[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x495889[_0x98f5('0x1d')],function(_0x18052d){return{'model':db[_0x18052d[_0x98f5('0x1e')]],'as':_0x18052d['as'],'attributes':_0x18052d['attributes'],'include':_0x18052d[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x18052d['include'],function(_0x1a1c55){return{'model':db[_0x1a1c55[_0x98f5('0x1e')]],'as':_0x1a1c55['as'],'attributes':_0x1a1c55[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x230d1b){logger[_0x98f5('0xd')](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x20')]('GetTrigger',_0x51a567,JSON['stringify'](_0x230d1b));_0x9e42dd(_0x230d1b);})[_0x98f5('0x21')](function(_0x71661e){logger[_0x98f5('0x11')](_0x98f5('0x14'),_0x71661e[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c[_0x98f5('0x11')](0x1f4,_0x71661e['message']));});});};exports[_0x98f5('0x22')]=function(_0x6d7418){var _0x7a922b=this;return new Promise(function(_0xd20823,_0x1e7138){return db[_0x98f5('0x15')]['find']({'raw':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x6d7418[_0x98f5('0x17')]?_0x6d7418['options'][_0x98f5('0x19')]||null:null,'attributes':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'include':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')],function(_0x12d874){return{'model':db[_0x12d874[_0x98f5('0x1e')]],'as':_0x12d874['as'],'attributes':_0x12d874[_0x98f5('0x1a')],'include':_0x12d874[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x12d874[_0x98f5('0x1d')],function(_0x2227f1){return{'model':db[_0x2227f1[_0x98f5('0x1e')]],'as':_0x2227f1['as'],'attributes':_0x2227f1[_0x98f5('0x1a')],'include':_0x2227f1[_0x98f5('0x1d')]?_['map'](_0x2227f1[_0x98f5('0x1d')],function(_0x4aba7a){return{'model':db[_0x4aba7a['model']],'as':_0x4aba7a['as'],'attributes':_0x4aba7a[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x65c03b){logger[_0x98f5('0xd')]('ShowTrigger',_0x6d7418);logger[_0x98f5('0x20')](_0x98f5('0x22'),_0x6d7418,JSON[_0x98f5('0x23')](_0x65c03b));_0xd20823(_0x65c03b);})['catch'](function(_0x17bfe2){logger[_0x98f5('0x11')]('ShowTrigger',_0x17bfe2[_0x98f5('0x12')],_0x6d7418);_0x1e7138(_0x7a922b[_0x98f5('0x11')](0x1f4,_0x17bfe2[_0x98f5('0x12')]));});});};
\ No newline at end of file