Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / api / trigger / trigger.rpc.js
index bdf9e5f..4b8c0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac1a=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trigger','findAll','options','raw','attributes','limit','include','map','model','GetTrigger','stringify','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x179b6,_0x3dd063){var _0x58ef03=function(_0x4f8c78){while(--_0x4f8c78){_0x179b6['push'](_0x179b6['shift']());}};_0x58ef03(++_0x3dd063);}(_0xac1a,0xb2));var _0xaac1=function(_0x441a42,_0x75d50d){_0x441a42=_0x441a42-0x0;var _0x3d992d=_0xac1a[_0x441a42];return _0x3d992d;};'use strict';var _=require(_0xaac1('0x0'));var util=require(_0xaac1('0x1'));var moment=require(_0xaac1('0x2'));var BPromise=require(_0xaac1('0x3'));var rs=require(_0xaac1('0x4'));var fs=require('fs');var Redis=require(_0xaac1('0x5'));var db=require(_0xaac1('0x6'))['db'];var utils=require(_0xaac1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xaac1('0x8'));var jayson=require(_0xaac1('0x9'));var client=jayson[_0xaac1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x295b7f,_0x2b6096,_0x1afaf1){return new BPromise(function(_0x402037,_0x4ee5e6){return client[_0xaac1('0xb')](_0x295b7f,_0x1afaf1)[_0xaac1('0xc')](function(_0x52f720){logger[_0xaac1('0xd')](_0xaac1('0xe'),_0x2b6096,_0xaac1('0xf'));logger[_0xaac1('0x10')](_0xaac1('0x11'),_0x2b6096,'request\x20sent',JSON['stringify'](_0x52f720));if(_0x52f720[_0xaac1('0x12')]){if(_0x52f720[_0xaac1('0x12')][_0xaac1('0x13')]===0x1f4){logger[_0xaac1('0x12')](_0xaac1('0xe'),_0x2b6096,_0x52f720[_0xaac1('0x12')][_0xaac1('0x14')]);return _0x4ee5e6(_0x52f720[_0xaac1('0x12')][_0xaac1('0x14')]);}logger[_0xaac1('0x12')](_0xaac1('0xe'),_0x2b6096,_0x52f720[_0xaac1('0x12')]['message']);return _0x402037(_0x52f720['error'][_0xaac1('0x14')]);}else{logger['info'](_0xaac1('0xe'),_0x2b6096,_0xaac1('0xf'));_0x402037(_0x52f720[_0xaac1('0x15')]['message']);}})[_0xaac1('0x16')](function(_0x44458c){logger[_0xaac1('0x12')](_0xaac1('0xe'),_0x2b6096,_0x44458c);_0x4ee5e6(_0x44458c);});});}exports['GetTrigger']=function(_0x99c1c3){var _0x5e2508=this;return new Promise(function(_0xa7b0a,_0x3b040b){return db[_0xaac1('0x17')][_0xaac1('0x18')]({'raw':_0x99c1c3['options']?_0x99c1c3[_0xaac1('0x19')][_0xaac1('0x1a')]===undefined?!![]:![]:!![],'where':_0x99c1c3['options']?_0x99c1c3[_0xaac1('0x19')]['where']||null:null,'attributes':_0x99c1c3[_0xaac1('0x19')]?_0x99c1c3['options'][_0xaac1('0x1b')]||null:null,'limit':_0x99c1c3['options']?_0x99c1c3[_0xaac1('0x19')][_0xaac1('0x1c')]||null:null,'include':_0x99c1c3[_0xaac1('0x19')]?_0x99c1c3[_0xaac1('0x19')][_0xaac1('0x1d')]?_[_0xaac1('0x1e')](_0x99c1c3['options'][_0xaac1('0x1d')],function(_0x21fc67){return{'model':db[_0x21fc67[_0xaac1('0x1f')]],'as':_0x21fc67['as'],'attributes':_0x21fc67[_0xaac1('0x1b')],'include':_0x21fc67[_0xaac1('0x1d')]?_[_0xaac1('0x1e')](_0x21fc67[_0xaac1('0x1d')],function(_0x509d0a){return{'model':db[_0x509d0a[_0xaac1('0x1f')]],'as':_0x509d0a['as'],'attributes':_0x509d0a[_0xaac1('0x1b')],'include':_0x509d0a['include']?_['map'](_0x509d0a[_0xaac1('0x1d')],function(_0x3dd100){return{'model':db[_0x3dd100['model']],'as':_0x3dd100['as'],'attributes':_0x3dd100[_0xaac1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaac1('0xc')](function(_0x41caa2){logger[_0xaac1('0xd')](_0xaac1('0x20'),_0x99c1c3);logger[_0xaac1('0x10')](_0xaac1('0x20'),_0x99c1c3,JSON[_0xaac1('0x21')](_0x41caa2));_0xa7b0a(_0x41caa2);})[_0xaac1('0x16')](function(_0x2335af){logger[_0xaac1('0x12')](_0xaac1('0x20'),_0x2335af[_0xaac1('0x14')],_0x99c1c3);_0x3b040b(_0x5e2508[_0xaac1('0x12')](0x1f4,_0x2335af[_0xaac1('0x14')]));});});};exports[_0xaac1('0x22')]=function(_0x41d0f0){var _0x4b859e=this;return new Promise(function(_0x25ee2b,_0x442b1f){return db[_0xaac1('0x17')][_0xaac1('0x23')]({'raw':_0x41d0f0[_0xaac1('0x19')]?_0x41d0f0[_0xaac1('0x19')][_0xaac1('0x1a')]===undefined?!![]:![]:!![],'where':_0x41d0f0[_0xaac1('0x19')]?_0x41d0f0[_0xaac1('0x19')][_0xaac1('0x24')]||null:null,'attributes':_0x41d0f0[_0xaac1('0x19')]?_0x41d0f0[_0xaac1('0x19')][_0xaac1('0x1b')]||null:null,'include':_0x41d0f0['options']?_0x41d0f0[_0xaac1('0x19')][_0xaac1('0x1d')]?_[_0xaac1('0x1e')](_0x41d0f0[_0xaac1('0x19')][_0xaac1('0x1d')],function(_0x3900d4){return{'model':db[_0x3900d4['model']],'as':_0x3900d4['as'],'attributes':_0x3900d4[_0xaac1('0x1b')],'include':_0x3900d4[_0xaac1('0x1d')]?_['map'](_0x3900d4[_0xaac1('0x1d')],function(_0x182c2b){return{'model':db[_0x182c2b[_0xaac1('0x1f')]],'as':_0x182c2b['as'],'attributes':_0x182c2b[_0xaac1('0x1b')],'include':_0x182c2b[_0xaac1('0x1d')]?_[_0xaac1('0x1e')](_0x182c2b[_0xaac1('0x1d')],function(_0xf1121d){return{'model':db[_0xf1121d[_0xaac1('0x1f')]],'as':_0xf1121d['as'],'attributes':_0xf1121d[_0xaac1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37be30){logger[_0xaac1('0xd')]('ShowTrigger',_0x41d0f0);logger[_0xaac1('0x10')](_0xaac1('0x22'),_0x41d0f0,JSON[_0xaac1('0x21')](_0x37be30));_0x25ee2b(_0x37be30);})[_0xaac1('0x16')](function(_0x273df2){logger['error']('ShowTrigger',_0x273df2[_0xaac1('0x14')],_0x41d0f0);_0x442b1f(_0x4b859e['error'](0x1f4,_0x273df2[_0xaac1('0x14')]));});});};
\ No newline at end of file
+var _0x101f=['debug','ShowTrigger','find','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','where','limit','include','map','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x101f,0x10f));var _0xf101=function(_0x463d67,_0xa8a836){_0x463d67=_0x463d67-0x0;var _0x6b6a37=_0x101f[_0x463d67];return _0x6b6a37;};'use strict';var _=require(_0xf101('0x0'));var util=require(_0xf101('0x1'));var moment=require(_0xf101('0x2'));var BPromise=require(_0xf101('0x3'));var rs=require(_0xf101('0x4'));var fs=require('fs');var Redis=require(_0xf101('0x5'));var db=require(_0xf101('0x6'))['db'];var utils=require(_0xf101('0x7'));var logger=require(_0xf101('0x8'))(_0xf101('0x9'));var config=require('../../config/environment');var jayson=require(_0xf101('0xa'));var client=jayson[_0xf101('0xb')][_0xf101('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x357e29,_0x5afb60,_0x4ac640){return new BPromise(function(_0x439821,_0x13ac4d){return client['request'](_0x357e29,_0x4ac640)['then'](function(_0x566621){logger['info']('Trigger,\x20%s,\x20%s',_0x5afb60,_0xf101('0xd'));logger['debug'](_0xf101('0xe'),_0x5afb60,'request\x20sent',JSON[_0xf101('0xf')](_0x566621));if(_0x566621['error']){if(_0x566621[_0xf101('0x10')][_0xf101('0x11')]===0x1f4){logger[_0xf101('0x10')](_0xf101('0x12'),_0x5afb60,_0x566621['error']['message']);return _0x13ac4d(_0x566621[_0xf101('0x10')][_0xf101('0x13')]);}logger[_0xf101('0x10')](_0xf101('0x12'),_0x5afb60,_0x566621[_0xf101('0x10')][_0xf101('0x13')]);return _0x439821(_0x566621[_0xf101('0x10')][_0xf101('0x13')]);}else{logger[_0xf101('0x14')]('Trigger,\x20%s,\x20%s',_0x5afb60,_0xf101('0xd'));_0x439821(_0x566621[_0xf101('0x15')][_0xf101('0x13')]);}})[_0xf101('0x16')](function(_0x4c5650){logger[_0xf101('0x10')](_0xf101('0x12'),_0x5afb60,_0x4c5650);_0x13ac4d(_0x4c5650);});});}exports[_0xf101('0x17')]=function(_0x1b5e4a){var _0x5e3490=this;return new Promise(function(_0x35aee7,_0x20aaf8){return db[_0xf101('0x18')][_0xf101('0x19')]({'raw':_0x1b5e4a[_0xf101('0x1a')]?_0x1b5e4a['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b5e4a['options']?_0x1b5e4a['options'][_0xf101('0x1b')]||null:null,'attributes':_0x1b5e4a['options']?_0x1b5e4a['options']['attributes']||null:null,'limit':_0x1b5e4a[_0xf101('0x1a')]?_0x1b5e4a[_0xf101('0x1a')][_0xf101('0x1c')]||null:null,'include':_0x1b5e4a[_0xf101('0x1a')]?_0x1b5e4a[_0xf101('0x1a')][_0xf101('0x1d')]?_[_0xf101('0x1e')](_0x1b5e4a['options'][_0xf101('0x1d')],function(_0x4c504e){return{'model':db[_0x4c504e[_0xf101('0x1f')]],'as':_0x4c504e['as'],'attributes':_0x4c504e['attributes'],'include':_0x4c504e[_0xf101('0x1d')]?_[_0xf101('0x1e')](_0x4c504e['include'],function(_0x1d44b7){return{'model':db[_0x1d44b7[_0xf101('0x1f')]],'as':_0x1d44b7['as'],'attributes':_0x1d44b7[_0xf101('0x20')],'include':_0x1d44b7[_0xf101('0x1d')]?_['map'](_0x1d44b7['include'],function(_0x4112d7){return{'model':db[_0x4112d7[_0xf101('0x1f')]],'as':_0x4112d7['as'],'attributes':_0x4112d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1100d3){logger['info']('GetTrigger',_0x1b5e4a);logger[_0xf101('0x21')](_0xf101('0x17'),_0x1b5e4a,JSON[_0xf101('0xf')](_0x1100d3));_0x35aee7(_0x1100d3);})['catch'](function(_0x5b3906){logger[_0xf101('0x10')](_0xf101('0x17'),_0x5b3906[_0xf101('0x13')],_0x1b5e4a);_0x20aaf8(_0x5e3490[_0xf101('0x10')](0x1f4,_0x5b3906[_0xf101('0x13')]));});});};exports[_0xf101('0x22')]=function(_0xd48861){var _0x3d034c=this;return new Promise(function(_0x56c487,_0x245bd1){return db[_0xf101('0x18')][_0xf101('0x23')]({'raw':_0xd48861[_0xf101('0x1a')]?_0xd48861[_0xf101('0x1a')][_0xf101('0x24')]===undefined?!![]:![]:!![],'where':_0xd48861[_0xf101('0x1a')]?_0xd48861['options'][_0xf101('0x1b')]||null:null,'attributes':_0xd48861[_0xf101('0x1a')]?_0xd48861[_0xf101('0x1a')]['attributes']||null:null,'include':_0xd48861[_0xf101('0x1a')]?_0xd48861[_0xf101('0x1a')][_0xf101('0x1d')]?_['map'](_0xd48861[_0xf101('0x1a')][_0xf101('0x1d')],function(_0x1cb75e){return{'model':db[_0x1cb75e[_0xf101('0x1f')]],'as':_0x1cb75e['as'],'attributes':_0x1cb75e['attributes'],'include':_0x1cb75e[_0xf101('0x1d')]?_[_0xf101('0x1e')](_0x1cb75e[_0xf101('0x1d')],function(_0x35dea1){return{'model':db[_0x35dea1[_0xf101('0x1f')]],'as':_0x35dea1['as'],'attributes':_0x35dea1['attributes'],'include':_0x35dea1[_0xf101('0x1d')]?_[_0xf101('0x1e')](_0x35dea1['include'],function(_0x526f24){return{'model':db[_0x526f24[_0xf101('0x1f')]],'as':_0x526f24['as'],'attributes':_0x526f24[_0xf101('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf101('0x25')](function(_0x229878){logger[_0xf101('0x14')](_0xf101('0x22'),_0xd48861);logger[_0xf101('0x21')]('ShowTrigger',_0xd48861,JSON[_0xf101('0xf')](_0x229878));_0x56c487(_0x229878);})[_0xf101('0x16')](function(_0x280201){logger['error'](_0xf101('0x22'),_0x280201[_0xf101('0x13')],_0xd48861);_0x245bd1(_0x3d034c[_0xf101('0x10')](0x1f4,_0x280201[_0xf101('0x13')]));});});};
\ No newline at end of file