Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / interval / interval.rpc.js
index d41043a..b87fefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f59=['code','message','result','catch','GetInterval','Interval','findAll','options','where','attributes','include','map','model','debug','stringify','ShowInterval','find','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error'];(function(_0x3397fb,_0x2feb60){var _0x3ebdc2=function(_0x2a97fd){while(--_0x2a97fd){_0x3397fb['push'](_0x3397fb['shift']());}};_0x3ebdc2(++_0x2feb60);}(_0x4f59,0x17a));var _0x94f5=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x4f59[_0x5806c3];return _0x48ac77;};'use strict';var _=require('lodash');var util=require(_0x94f5('0x0'));var moment=require(_0x94f5('0x1'));var BPromise=require(_0x94f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94f5('0x3'));var db=require(_0x94f5('0x4'))['db'];var utils=require(_0x94f5('0x5'));var logger=require(_0x94f5('0x6'))(_0x94f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x94f5('0x8'));var client=jayson[_0x94f5('0x9')][_0x94f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f45b9,_0x38ffe8,_0x130403){return new BPromise(function(_0x3ab7de,_0x99edad){return client[_0x94f5('0xb')](_0x4f45b9,_0x130403)[_0x94f5('0xc')](function(_0x5b0485){logger[_0x94f5('0xd')](_0x94f5('0xe'),_0x38ffe8,_0x94f5('0xf'));logger['debug'](_0x94f5('0x10'),_0x38ffe8,_0x94f5('0xf'),JSON['stringify'](_0x5b0485));if(_0x5b0485[_0x94f5('0x11')]){if(_0x5b0485[_0x94f5('0x11')][_0x94f5('0x12')]===0x1f4){logger[_0x94f5('0x11')](_0x94f5('0xe'),_0x38ffe8,_0x5b0485[_0x94f5('0x11')][_0x94f5('0x13')]);return _0x99edad(_0x5b0485[_0x94f5('0x11')]['message']);}logger[_0x94f5('0x11')](_0x94f5('0xe'),_0x38ffe8,_0x5b0485[_0x94f5('0x11')][_0x94f5('0x13')]);return _0x3ab7de(_0x5b0485['error'][_0x94f5('0x13')]);}else{logger['info']('Interval,\x20%s,\x20%s',_0x38ffe8,_0x94f5('0xf'));_0x3ab7de(_0x5b0485[_0x94f5('0x14')][_0x94f5('0x13')]);}})[_0x94f5('0x15')](function(_0x16a48a){logger['error'](_0x94f5('0xe'),_0x38ffe8,_0x16a48a);_0x99edad(_0x16a48a);});});}exports[_0x94f5('0x16')]=function(_0x5e95be){var _0x5e7435=this;return new Promise(function(_0x4ab664,_0x30cb7c){return db[_0x94f5('0x17')][_0x94f5('0x18')]({'raw':_0x5e95be['options']?_0x5e95be[_0x94f5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5e95be[_0x94f5('0x19')]?_0x5e95be[_0x94f5('0x19')][_0x94f5('0x1a')]||null:null,'attributes':_0x5e95be[_0x94f5('0x19')]?_0x5e95be['options'][_0x94f5('0x1b')]||null:null,'limit':_0x5e95be[_0x94f5('0x19')]?_0x5e95be[_0x94f5('0x19')]['limit']||null:null,'include':_0x5e95be['options']?_0x5e95be[_0x94f5('0x19')][_0x94f5('0x1c')]?_[_0x94f5('0x1d')](_0x5e95be[_0x94f5('0x19')][_0x94f5('0x1c')],function(_0x56731c){return{'model':db[_0x56731c['model']],'as':_0x56731c['as'],'attributes':_0x56731c[_0x94f5('0x1b')],'include':_0x56731c[_0x94f5('0x1c')]?_[_0x94f5('0x1d')](_0x56731c[_0x94f5('0x1c')],function(_0x4d7be9){return{'model':db[_0x4d7be9['model']],'as':_0x4d7be9['as'],'attributes':_0x4d7be9[_0x94f5('0x1b')],'include':_0x4d7be9['include']?_['map'](_0x4d7be9[_0x94f5('0x1c')],function(_0x3c8306){return{'model':db[_0x3c8306[_0x94f5('0x1e')]],'as':_0x3c8306['as'],'attributes':_0x3c8306[_0x94f5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x94f5('0xc')](function(_0x567f06){logger[_0x94f5('0xd')](_0x94f5('0x16'),_0x5e95be);logger[_0x94f5('0x1f')](_0x94f5('0x16'),_0x5e95be,JSON[_0x94f5('0x20')](_0x567f06));_0x4ab664(_0x567f06);})[_0x94f5('0x15')](function(_0x4a923b){logger[_0x94f5('0x11')](_0x94f5('0x16'),_0x4a923b['message'],_0x5e95be);_0x30cb7c(_0x5e7435[_0x94f5('0x11')](0x1f4,_0x4a923b['message']));});});};exports[_0x94f5('0x21')]=function(_0x2fdda0){var _0x39211d=this;return new Promise(function(_0x59115f,_0x5f0437){return db[_0x94f5('0x17')][_0x94f5('0x22')]({'raw':_0x2fdda0[_0x94f5('0x19')]?_0x2fdda0[_0x94f5('0x19')][_0x94f5('0x23')]===undefined?!![]:![]:!![],'where':_0x2fdda0[_0x94f5('0x19')]?_0x2fdda0[_0x94f5('0x19')][_0x94f5('0x1a')]||null:null,'attributes':_0x2fdda0[_0x94f5('0x19')]?_0x2fdda0['options']['attributes']||null:null,'include':_0x2fdda0[_0x94f5('0x19')]?_0x2fdda0[_0x94f5('0x19')][_0x94f5('0x1c')]?_['map'](_0x2fdda0[_0x94f5('0x19')][_0x94f5('0x1c')],function(_0x410855){return{'model':db[_0x410855['model']],'as':_0x410855['as'],'attributes':_0x410855[_0x94f5('0x1b')],'include':_0x410855[_0x94f5('0x1c')]?_[_0x94f5('0x1d')](_0x410855[_0x94f5('0x1c')],function(_0x2ab625){return{'model':db[_0x2ab625[_0x94f5('0x1e')]],'as':_0x2ab625['as'],'attributes':_0x2ab625[_0x94f5('0x1b')],'include':_0x2ab625[_0x94f5('0x1c')]?_['map'](_0x2ab625['include'],function(_0x3ce478){return{'model':db[_0x3ce478[_0x94f5('0x1e')]],'as':_0x3ce478['as'],'attributes':_0x3ce478['attributes']};}):[]};}):[]};}):[]:[]})[_0x94f5('0xc')](function(_0x16109a){logger['info']('ShowInterval',_0x2fdda0);logger[_0x94f5('0x1f')](_0x94f5('0x21'),_0x2fdda0,JSON[_0x94f5('0x20')](_0x16109a));_0x59115f(_0x16109a);})[_0x94f5('0x15')](function(_0x138f61){logger[_0x94f5('0x11')](_0x94f5('0x21'),_0x138f61[_0x94f5('0x13')],_0x2fdda0);_0x5f0437(_0x39211d[_0x94f5('0x11')](0x1f4,_0x138f61[_0x94f5('0x13')]));});});};
\ No newline at end of file
+var _0x2751=['find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetInterval','Interval','findAll','raw','options','where','attributes','limit','map','include','model','then','ShowInterval'];(function(_0x306583,_0x26b8ee){var _0x7edb07=function(_0x3afa9e){while(--_0x3afa9e){_0x306583['push'](_0x306583['shift']());}};_0x7edb07(++_0x26b8ee);}(_0x2751,0x13c));var _0x1275=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2751[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1275('0x0'));var BPromise=require(_0x1275('0x1'));var rs=require(_0x1275('0x2'));var fs=require('fs');var Redis=require(_0x1275('0x3'));var db=require(_0x1275('0x4'))['db'];var utils=require(_0x1275('0x5'));var logger=require(_0x1275('0x6'))('rpc');var config=require(_0x1275('0x7'));var jayson=require(_0x1275('0x8'));var client=jayson[_0x1275('0x9')][_0x1275('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d243,_0x6df73b,_0x38da47){return new BPromise(function(_0x524bb5,_0xbfb6c3){return client['request'](_0x28d243,_0x38da47)['then'](function(_0x367e05){logger['info'](_0x1275('0xb'),_0x6df73b,_0x1275('0xc'));logger[_0x1275('0xd')](_0x1275('0xe'),_0x6df73b,_0x1275('0xc'),JSON[_0x1275('0xf')](_0x367e05));if(_0x367e05[_0x1275('0x10')]){if(_0x367e05['error'][_0x1275('0x11')]===0x1f4){logger[_0x1275('0x10')](_0x1275('0xb'),_0x6df73b,_0x367e05[_0x1275('0x10')][_0x1275('0x12')]);return _0xbfb6c3(_0x367e05[_0x1275('0x10')][_0x1275('0x12')]);}logger[_0x1275('0x10')](_0x1275('0xb'),_0x6df73b,_0x367e05[_0x1275('0x10')]['message']);return _0x524bb5(_0x367e05['error']['message']);}else{logger[_0x1275('0x13')](_0x1275('0xb'),_0x6df73b,_0x1275('0xc'));_0x524bb5(_0x367e05['result']['message']);}})[_0x1275('0x14')](function(_0x26a1ba){logger[_0x1275('0x10')](_0x1275('0xb'),_0x6df73b,_0x26a1ba);_0xbfb6c3(_0x26a1ba);});});}exports[_0x1275('0x15')]=function(_0x2460d9){var _0x4b1ac2=this;return new Promise(function(_0x18aaec,_0x5cd8ce){return db[_0x1275('0x16')][_0x1275('0x17')]({'raw':_0x2460d9['options']?_0x2460d9['options'][_0x1275('0x18')]===undefined?!![]:![]:!![],'where':_0x2460d9[_0x1275('0x19')]?_0x2460d9[_0x1275('0x19')][_0x1275('0x1a')]||null:null,'attributes':_0x2460d9[_0x1275('0x19')]?_0x2460d9[_0x1275('0x19')][_0x1275('0x1b')]||null:null,'limit':_0x2460d9[_0x1275('0x19')]?_0x2460d9[_0x1275('0x19')][_0x1275('0x1c')]||null:null,'include':_0x2460d9[_0x1275('0x19')]?_0x2460d9[_0x1275('0x19')]['include']?_[_0x1275('0x1d')](_0x2460d9[_0x1275('0x19')][_0x1275('0x1e')],function(_0x38a927){return{'model':db[_0x38a927[_0x1275('0x1f')]],'as':_0x38a927['as'],'attributes':_0x38a927[_0x1275('0x1b')],'include':_0x38a927[_0x1275('0x1e')]?_[_0x1275('0x1d')](_0x38a927[_0x1275('0x1e')],function(_0x4e4453){return{'model':db[_0x4e4453[_0x1275('0x1f')]],'as':_0x4e4453['as'],'attributes':_0x4e4453[_0x1275('0x1b')],'include':_0x4e4453['include']?_[_0x1275('0x1d')](_0x4e4453[_0x1275('0x1e')],function(_0x12b973){return{'model':db[_0x12b973[_0x1275('0x1f')]],'as':_0x12b973['as'],'attributes':_0x12b973['attributes']};}):[]};}):[]};}):[]:[]})[_0x1275('0x20')](function(_0x5b4dea){logger['info'](_0x1275('0x15'),_0x2460d9);logger[_0x1275('0xd')](_0x1275('0x15'),_0x2460d9,JSON[_0x1275('0xf')](_0x5b4dea));_0x18aaec(_0x5b4dea);})['catch'](function(_0x56b671){logger[_0x1275('0x10')](_0x1275('0x15'),_0x56b671[_0x1275('0x12')],_0x2460d9);_0x5cd8ce(_0x4b1ac2[_0x1275('0x10')](0x1f4,_0x56b671[_0x1275('0x12')]));});});};exports[_0x1275('0x21')]=function(_0x214941){var _0x5d9269=this;return new Promise(function(_0x551a03,_0x57886a){return db[_0x1275('0x16')][_0x1275('0x22')]({'raw':_0x214941['options']?_0x214941[_0x1275('0x19')][_0x1275('0x18')]===undefined?!![]:![]:!![],'where':_0x214941[_0x1275('0x19')]?_0x214941[_0x1275('0x19')]['where']||null:null,'attributes':_0x214941[_0x1275('0x19')]?_0x214941[_0x1275('0x19')][_0x1275('0x1b')]||null:null,'include':_0x214941[_0x1275('0x19')]?_0x214941['options'][_0x1275('0x1e')]?_[_0x1275('0x1d')](_0x214941['options'][_0x1275('0x1e')],function(_0x46badd){return{'model':db[_0x46badd[_0x1275('0x1f')]],'as':_0x46badd['as'],'attributes':_0x46badd[_0x1275('0x1b')],'include':_0x46badd[_0x1275('0x1e')]?_[_0x1275('0x1d')](_0x46badd[_0x1275('0x1e')],function(_0x25f82b){return{'model':db[_0x25f82b[_0x1275('0x1f')]],'as':_0x25f82b['as'],'attributes':_0x25f82b['attributes'],'include':_0x25f82b[_0x1275('0x1e')]?_['map'](_0x25f82b[_0x1275('0x1e')],function(_0x154d64){return{'model':db[_0x154d64[_0x1275('0x1f')]],'as':_0x154d64['as'],'attributes':_0x154d64[_0x1275('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1275('0x20')](function(_0x26147e){logger[_0x1275('0x13')](_0x1275('0x21'),_0x214941);logger['debug'](_0x1275('0x21'),_0x214941,JSON[_0x1275('0xf')](_0x26147e));_0x551a03(_0x26147e);})[_0x1275('0x14')](function(_0x46bbcd){logger[_0x1275('0x10')](_0x1275('0x21'),_0x46bbcd[_0x1275('0x12')],_0x214941);_0x57886a(_0x5d9269[_0x1275('0x10')](0x1f4,_0x46bbcd[_0x1275('0x12')]));});});};
\ No newline at end of file