Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / trigger / trigger.rpc.js
index c6d8bff..6fedf0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1775=['stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','map','include','model','ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2076f3,_0x37cb83){var _0x53b015=function(_0x12bf31){while(--_0x12bf31){_0x2076f3['push'](_0x2076f3['shift']());}};_0x53b015(++_0x37cb83);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('Trigger,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['findAll']({'raw':_0x1b4102[_0x5177('0x1c')]?_0x1b4102['options'][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1e')]||null:null,'attributes':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'limit':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x20')]||null:null,'include':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')]['include']?_[_0x5177('0x21')](_0x1b4102['options'][_0x5177('0x22')],function(_0x2c68d8){return{'model':db[_0x2c68d8[_0x5177('0x23')]],'as':_0x2c68d8['as'],'attributes':_0x2c68d8[_0x5177('0x1f')],'include':_0x2c68d8['include']?_[_0x5177('0x21')](_0x2c68d8['include'],function(_0x564139){return{'model':db[_0x564139[_0x5177('0x23')]],'as':_0x564139['as'],'attributes':_0x564139[_0x5177('0x1f')],'include':_0x564139['include']?_[_0x5177('0x21')](_0x564139['include'],function(_0x231d35){return{'model':db[_0x231d35[_0x5177('0x23')]],'as':_0x231d35['as'],'attributes':_0x231d35['attributes']};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x2554ec){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON['stringify'](_0x2554ec));_0x3e6944(_0x2554ec);})['catch'](function(_0x45cf20){logger[_0x5177('0x14')](_0x5177('0x1a'),_0x45cf20[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4[_0x5177('0x14')](0x1f4,_0x45cf20[_0x5177('0x17')]));});});};exports[_0x5177('0x24')]=function(_0x72dced){var _0x49f6f1=this;return new Promise(function(_0x42e1db,_0x2233a2){return db['Trigger'][_0x5177('0x25')]({'raw':_0x72dced['options']?_0x72dced[_0x5177('0x1c')][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x72dced[_0x5177('0x1c')]?_0x72dced['options']['where']||null:null,'attributes':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'include':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x22')]?_[_0x5177('0x21')](_0x72dced[_0x5177('0x1c')]['include'],function(_0x459ac6){return{'model':db[_0x459ac6[_0x5177('0x23')]],'as':_0x459ac6['as'],'attributes':_0x459ac6['attributes'],'include':_0x459ac6[_0x5177('0x22')]?_[_0x5177('0x21')](_0x459ac6[_0x5177('0x22')],function(_0x8727c6){return{'model':db[_0x8727c6[_0x5177('0x23')]],'as':_0x8727c6['as'],'attributes':_0x8727c6[_0x5177('0x1f')],'include':_0x8727c6['include']?_[_0x5177('0x21')](_0x8727c6[_0x5177('0x22')],function(_0x28b1d5){return{'model':db[_0x28b1d5[_0x5177('0x23')]],'as':_0x28b1d5['as'],'attributes':_0x28b1d5[_0x5177('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x1bb1e3){logger['info'](_0x5177('0x24'),_0x72dced);logger[_0x5177('0x10')]('ShowTrigger',_0x72dced,JSON['stringify'](_0x1bb1e3));_0x42e1db(_0x1bb1e3);})[_0x5177('0x19')](function(_0x188cec){logger[_0x5177('0x14')](_0x5177('0x24'),_0x188cec[_0x5177('0x17')],_0x72dced);_0x2233a2(_0x49f6f1[_0x5177('0x14')](0x1f4,_0x188cec[_0x5177('0x17')]));});});};
\ No newline at end of file
+var _0xc172=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','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','code','message','result','options','raw','where','attributes','limit','map','include','model','GetTrigger','debug','stringify','catch','ShowTrigger','Trigger','find'];(function(_0x276888,_0x588d38){var _0x28fa5b=function(_0x5543cc){while(--_0x5543cc){_0x276888['push'](_0x276888['shift']());}};_0x28fa5b(++_0x588d38);}(_0xc172,0x1d4));var _0x2c17=function(_0x1b2daa,_0x461568){_0x1b2daa=_0x1b2daa-0x0;var _0x4726e9=_0xc172[_0x1b2daa];return _0x4726e9;};'use strict';var _=require(_0x2c17('0x0'));var util=require(_0x2c17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c17('0x2'));var db=require(_0x2c17('0x3'))['db'];var utils=require(_0x2c17('0x4'));var logger=require(_0x2c17('0x5'))(_0x2c17('0x6'));var config=require(_0x2c17('0x7'));var jayson=require(_0x2c17('0x8'));var client=jayson[_0x2c17('0x9')][_0x2c17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4daa71,_0x42a781,_0x3911d0){return new BPromise(function(_0x3739a8,_0x1a9203){return client[_0x2c17('0xb')](_0x4daa71,_0x3911d0)[_0x2c17('0xc')](function(_0x3c6246){logger[_0x2c17('0xd')](_0x2c17('0xe'),_0x42a781,_0x2c17('0xf'));logger['debug'](_0x2c17('0x10'),_0x42a781,_0x2c17('0xf'),JSON['stringify'](_0x3c6246));if(_0x3c6246[_0x2c17('0x11')]){if(_0x3c6246['error'][_0x2c17('0x12')]===0x1f4){logger['error'](_0x2c17('0xe'),_0x42a781,_0x3c6246['error'][_0x2c17('0x13')]);return _0x1a9203(_0x3c6246[_0x2c17('0x11')][_0x2c17('0x13')]);}logger[_0x2c17('0x11')]('Trigger,\x20%s,\x20%s',_0x42a781,_0x3c6246[_0x2c17('0x11')][_0x2c17('0x13')]);return _0x3739a8(_0x3c6246[_0x2c17('0x11')]['message']);}else{logger[_0x2c17('0xd')](_0x2c17('0xe'),_0x42a781,_0x2c17('0xf'));_0x3739a8(_0x3c6246[_0x2c17('0x14')][_0x2c17('0x13')]);}})['catch'](function(_0x49a5b5){logger['error'](_0x2c17('0xe'),_0x42a781,_0x49a5b5);_0x1a9203(_0x49a5b5);});});}exports['GetTrigger']=function(_0xe5a3cc){var _0x2c522e=this;return new Promise(function(_0x35ca60,_0x45ae89){return db['Trigger']['findAll']({'raw':_0xe5a3cc[_0x2c17('0x15')]?_0xe5a3cc['options'][_0x2c17('0x16')]===undefined?!![]:![]:!![],'where':_0xe5a3cc[_0x2c17('0x15')]?_0xe5a3cc['options'][_0x2c17('0x17')]||null:null,'attributes':_0xe5a3cc[_0x2c17('0x15')]?_0xe5a3cc[_0x2c17('0x15')][_0x2c17('0x18')]||null:null,'limit':_0xe5a3cc[_0x2c17('0x15')]?_0xe5a3cc['options'][_0x2c17('0x19')]||null:null,'include':_0xe5a3cc[_0x2c17('0x15')]?_0xe5a3cc[_0x2c17('0x15')]['include']?_[_0x2c17('0x1a')](_0xe5a3cc['options'][_0x2c17('0x1b')],function(_0x55e62d){return{'model':db[_0x55e62d[_0x2c17('0x1c')]],'as':_0x55e62d['as'],'attributes':_0x55e62d[_0x2c17('0x18')],'include':_0x55e62d[_0x2c17('0x1b')]?_['map'](_0x55e62d['include'],function(_0x14c066){return{'model':db[_0x14c066[_0x2c17('0x1c')]],'as':_0x14c066['as'],'attributes':_0x14c066[_0x2c17('0x18')],'include':_0x14c066[_0x2c17('0x1b')]?_[_0x2c17('0x1a')](_0x14c066['include'],function(_0x841574){return{'model':db[_0x841574[_0x2c17('0x1c')]],'as':_0x841574['as'],'attributes':_0x841574[_0x2c17('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2c17('0xc')](function(_0x634c7e){logger[_0x2c17('0xd')](_0x2c17('0x1d'),_0xe5a3cc);logger[_0x2c17('0x1e')](_0x2c17('0x1d'),_0xe5a3cc,JSON[_0x2c17('0x1f')](_0x634c7e));_0x35ca60(_0x634c7e);})[_0x2c17('0x20')](function(_0x31f27a){logger[_0x2c17('0x11')]('GetTrigger',_0x31f27a['message'],_0xe5a3cc);_0x45ae89(_0x2c522e['error'](0x1f4,_0x31f27a[_0x2c17('0x13')]));});});};exports[_0x2c17('0x21')]=function(_0x4076d2){var _0x3302bf=this;return new Promise(function(_0x1d03df,_0x3dd2e5){return db[_0x2c17('0x22')][_0x2c17('0x23')]({'raw':_0x4076d2[_0x2c17('0x15')]?_0x4076d2['options'][_0x2c17('0x16')]===undefined?!![]:![]:!![],'where':_0x4076d2[_0x2c17('0x15')]?_0x4076d2[_0x2c17('0x15')][_0x2c17('0x17')]||null:null,'attributes':_0x4076d2[_0x2c17('0x15')]?_0x4076d2[_0x2c17('0x15')][_0x2c17('0x18')]||null:null,'include':_0x4076d2['options']?_0x4076d2[_0x2c17('0x15')][_0x2c17('0x1b')]?_['map'](_0x4076d2['options'][_0x2c17('0x1b')],function(_0x125085){return{'model':db[_0x125085[_0x2c17('0x1c')]],'as':_0x125085['as'],'attributes':_0x125085[_0x2c17('0x18')],'include':_0x125085[_0x2c17('0x1b')]?_[_0x2c17('0x1a')](_0x125085['include'],function(_0x23503a){return{'model':db[_0x23503a['model']],'as':_0x23503a['as'],'attributes':_0x23503a[_0x2c17('0x18')],'include':_0x23503a[_0x2c17('0x1b')]?_['map'](_0x23503a['include'],function(_0x52b032){return{'model':db[_0x52b032[_0x2c17('0x1c')]],'as':_0x52b032['as'],'attributes':_0x52b032[_0x2c17('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x240331){logger[_0x2c17('0xd')](_0x2c17('0x21'),_0x4076d2);logger[_0x2c17('0x1e')](_0x2c17('0x21'),_0x4076d2,JSON[_0x2c17('0x1f')](_0x240331));_0x1d03df(_0x240331);})[_0x2c17('0x20')](function(_0x5e9167){logger[_0x2c17('0x11')](_0x2c17('0x21'),_0x5e9167['message'],_0x4076d2);_0x3dd2e5(_0x3302bf[_0x2c17('0x11')](0x1f4,_0x5e9167['message']));});});};
\ No newline at end of file