Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / interval / interval.rpc.js
index 4f44021..0ab192f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaae6=['model','then','ShowInterval','Interval','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetInterval','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x47f7cf,_0x53179e){var _0x448df6=function(_0x4a947c){while(--_0x4a947c){_0x47f7cf['push'](_0x47f7cf['shift']());}};_0x448df6(++_0x53179e);}(_0xaae6,0x1a8));var _0x6aae=function(_0xdac242,_0x405bff){_0xdac242=_0xdac242-0x0;var _0x4637c4=_0xaae6[_0xdac242];return _0x4637c4;};'use strict';var _=require(_0x6aae('0x0'));var util=require('util');var moment=require(_0x6aae('0x1'));var BPromise=require(_0x6aae('0x2'));var rs=require(_0x6aae('0x3'));var fs=require('fs');var Redis=require(_0x6aae('0x4'));var db=require(_0x6aae('0x5'))['db'];var utils=require(_0x6aae('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6aae('0x7'));var jayson=require(_0x6aae('0x8'));var client=jayson[_0x6aae('0x9')][_0x6aae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x524875,_0x586782,_0xf5916f){return new BPromise(function(_0x32e50d,_0x3b6faa){return client[_0x6aae('0xb')](_0x524875,_0xf5916f)['then'](function(_0x2e0538){logger[_0x6aae('0xc')](_0x6aae('0xd'),_0x586782,_0x6aae('0xe'));logger[_0x6aae('0xf')](_0x6aae('0x10'),_0x586782,_0x6aae('0xe'),JSON[_0x6aae('0x11')](_0x2e0538));if(_0x2e0538[_0x6aae('0x12')]){if(_0x2e0538['error']['code']===0x1f4){logger['error'](_0x6aae('0xd'),_0x586782,_0x2e0538[_0x6aae('0x12')][_0x6aae('0x13')]);return _0x3b6faa(_0x2e0538[_0x6aae('0x12')][_0x6aae('0x13')]);}logger['error'](_0x6aae('0xd'),_0x586782,_0x2e0538[_0x6aae('0x12')][_0x6aae('0x13')]);return _0x32e50d(_0x2e0538[_0x6aae('0x12')][_0x6aae('0x13')]);}else{logger[_0x6aae('0xc')](_0x6aae('0xd'),_0x586782,_0x6aae('0xe'));_0x32e50d(_0x2e0538[_0x6aae('0x14')][_0x6aae('0x13')]);}})[_0x6aae('0x15')](function(_0x2d3c9b){logger[_0x6aae('0x12')](_0x6aae('0xd'),_0x586782,_0x2d3c9b);_0x3b6faa(_0x2d3c9b);});});}exports[_0x6aae('0x16')]=function(_0x33284c){var _0x120d37=this;return new Promise(function(_0x2ef33c,_0xf684cc){return db['Interval'][_0x6aae('0x17')]({'raw':_0x33284c[_0x6aae('0x18')]?_0x33284c[_0x6aae('0x18')][_0x6aae('0x19')]===undefined?!![]:![]:!![],'where':_0x33284c['options']?_0x33284c[_0x6aae('0x18')][_0x6aae('0x1a')]||null:null,'attributes':_0x33284c[_0x6aae('0x18')]?_0x33284c[_0x6aae('0x18')][_0x6aae('0x1b')]||null:null,'limit':_0x33284c['options']?_0x33284c[_0x6aae('0x18')][_0x6aae('0x1c')]||null:null,'include':_0x33284c[_0x6aae('0x18')]?_0x33284c['options']['include']?_[_0x6aae('0x1d')](_0x33284c[_0x6aae('0x18')][_0x6aae('0x1e')],function(_0x1e45ad){return{'model':db[_0x1e45ad[_0x6aae('0x1f')]],'as':_0x1e45ad['as'],'attributes':_0x1e45ad[_0x6aae('0x1b')],'include':_0x1e45ad[_0x6aae('0x1e')]?_['map'](_0x1e45ad[_0x6aae('0x1e')],function(_0x3b94d7){return{'model':db[_0x3b94d7['model']],'as':_0x3b94d7['as'],'attributes':_0x3b94d7['attributes'],'include':_0x3b94d7[_0x6aae('0x1e')]?_[_0x6aae('0x1d')](_0x3b94d7[_0x6aae('0x1e')],function(_0x14508b){return{'model':db[_0x14508b[_0x6aae('0x1f')]],'as':_0x14508b['as'],'attributes':_0x14508b[_0x6aae('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6aae('0x20')](function(_0x38be1f){logger[_0x6aae('0xc')](_0x6aae('0x16'),_0x33284c);logger[_0x6aae('0xf')]('GetInterval',_0x33284c,JSON[_0x6aae('0x11')](_0x38be1f));_0x2ef33c(_0x38be1f);})[_0x6aae('0x15')](function(_0x283b54){logger[_0x6aae('0x12')](_0x6aae('0x16'),_0x283b54[_0x6aae('0x13')],_0x33284c);_0xf684cc(_0x120d37[_0x6aae('0x12')](0x1f4,_0x283b54[_0x6aae('0x13')]));});});};exports[_0x6aae('0x21')]=function(_0x57444c){var _0x44cb8c=this;return new Promise(function(_0x578305,_0x5c938a){return db[_0x6aae('0x22')]['find']({'raw':_0x57444c[_0x6aae('0x18')]?_0x57444c['options'][_0x6aae('0x19')]===undefined?!![]:![]:!![],'where':_0x57444c[_0x6aae('0x18')]?_0x57444c[_0x6aae('0x18')][_0x6aae('0x1a')]||null:null,'attributes':_0x57444c[_0x6aae('0x18')]?_0x57444c[_0x6aae('0x18')][_0x6aae('0x1b')]||null:null,'include':_0x57444c['options']?_0x57444c[_0x6aae('0x18')][_0x6aae('0x1e')]?_[_0x6aae('0x1d')](_0x57444c[_0x6aae('0x18')][_0x6aae('0x1e')],function(_0x48566c){return{'model':db[_0x48566c[_0x6aae('0x1f')]],'as':_0x48566c['as'],'attributes':_0x48566c[_0x6aae('0x1b')],'include':_0x48566c['include']?_[_0x6aae('0x1d')](_0x48566c[_0x6aae('0x1e')],function(_0x17a531){return{'model':db[_0x17a531[_0x6aae('0x1f')]],'as':_0x17a531['as'],'attributes':_0x17a531[_0x6aae('0x1b')],'include':_0x17a531[_0x6aae('0x1e')]?_[_0x6aae('0x1d')](_0x17a531[_0x6aae('0x1e')],function(_0x247647){return{'model':db[_0x247647['model']],'as':_0x247647['as'],'attributes':_0x247647[_0x6aae('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6aae('0x20')](function(_0xff74ab){logger[_0x6aae('0xc')](_0x6aae('0x21'),_0x57444c);logger[_0x6aae('0xf')]('ShowInterval',_0x57444c,JSON[_0x6aae('0x11')](_0xff74ab));_0x578305(_0xff74ab);})[_0x6aae('0x15')](function(_0xaa95c7){logger[_0x6aae('0x12')]('ShowInterval',_0xaa95c7[_0x6aae('0x13')],_0x57444c);_0x5c938a(_0x44cb8c[_0x6aae('0x12')](0x1f4,_0xaa95c7[_0x6aae('0x13')]));});});};
\ No newline at end of file
+var _0x8bf2=['http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetInterval','findAll','raw','options','where','attributes','include','map','model','ShowInterval','Interval','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x42cf5e,_0x1f3730){var _0x188675=function(_0x1a82e9){while(--_0x1a82e9){_0x42cf5e['push'](_0x42cf5e['shift']());}};_0x188675(++_0x1f3730);}(_0x8bf2,0xbc));var _0x28bf=function(_0x5661bb,_0x380f59){_0x5661bb=_0x5661bb-0x0;var _0x3eaf5b=_0x8bf2[_0x5661bb];return _0x3eaf5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x28bf('0x0'));var BPromise=require(_0x28bf('0x1'));var rs=require(_0x28bf('0x2'));var fs=require('fs');var Redis=require(_0x28bf('0x3'));var db=require(_0x28bf('0x4'))['db'];var utils=require(_0x28bf('0x5'));var logger=require(_0x28bf('0x6'))(_0x28bf('0x7'));var config=require(_0x28bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x28bf('0x9')][_0x28bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420da7,_0x440445,_0x3429b8){return new BPromise(function(_0x214eb3,_0x37e67a){return client['request'](_0x420da7,_0x3429b8)['then'](function(_0x286465){logger[_0x28bf('0xb')](_0x28bf('0xc'),_0x440445,_0x28bf('0xd'));logger[_0x28bf('0xe')](_0x28bf('0xf'),_0x440445,'request\x20sent',JSON[_0x28bf('0x10')](_0x286465));if(_0x286465[_0x28bf('0x11')]){if(_0x286465[_0x28bf('0x11')][_0x28bf('0x12')]===0x1f4){logger[_0x28bf('0x11')](_0x28bf('0xc'),_0x440445,_0x286465[_0x28bf('0x11')][_0x28bf('0x13')]);return _0x37e67a(_0x286465[_0x28bf('0x11')]['message']);}logger[_0x28bf('0x11')]('Interval,\x20%s,\x20%s',_0x440445,_0x286465[_0x28bf('0x11')][_0x28bf('0x13')]);return _0x214eb3(_0x286465[_0x28bf('0x11')][_0x28bf('0x13')]);}else{logger[_0x28bf('0xb')](_0x28bf('0xc'),_0x440445,_0x28bf('0xd'));_0x214eb3(_0x286465['result']['message']);}})[_0x28bf('0x14')](function(_0x3a67c3){logger[_0x28bf('0x11')](_0x28bf('0xc'),_0x440445,_0x3a67c3);_0x37e67a(_0x3a67c3);});});}exports[_0x28bf('0x15')]=function(_0x1dddb3){var _0x40b857=this;return new Promise(function(_0x44193c,_0x2e9b2c){return db['Interval'][_0x28bf('0x16')]({'raw':_0x1dddb3['options']?_0x1dddb3['options'][_0x28bf('0x17')]===undefined?!![]:![]:!![],'where':_0x1dddb3[_0x28bf('0x18')]?_0x1dddb3[_0x28bf('0x18')][_0x28bf('0x19')]||null:null,'attributes':_0x1dddb3[_0x28bf('0x18')]?_0x1dddb3[_0x28bf('0x18')][_0x28bf('0x1a')]||null:null,'limit':_0x1dddb3[_0x28bf('0x18')]?_0x1dddb3[_0x28bf('0x18')]['limit']||null:null,'include':_0x1dddb3[_0x28bf('0x18')]?_0x1dddb3[_0x28bf('0x18')][_0x28bf('0x1b')]?_[_0x28bf('0x1c')](_0x1dddb3[_0x28bf('0x18')][_0x28bf('0x1b')],function(_0x299ea0){return{'model':db[_0x299ea0[_0x28bf('0x1d')]],'as':_0x299ea0['as'],'attributes':_0x299ea0[_0x28bf('0x1a')],'include':_0x299ea0['include']?_[_0x28bf('0x1c')](_0x299ea0['include'],function(_0x3ef9e6){return{'model':db[_0x3ef9e6[_0x28bf('0x1d')]],'as':_0x3ef9e6['as'],'attributes':_0x3ef9e6[_0x28bf('0x1a')],'include':_0x3ef9e6[_0x28bf('0x1b')]?_[_0x28bf('0x1c')](_0x3ef9e6[_0x28bf('0x1b')],function(_0x5ef03b){return{'model':db[_0x5ef03b['model']],'as':_0x5ef03b['as'],'attributes':_0x5ef03b[_0x28bf('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d17e0){logger[_0x28bf('0xb')](_0x28bf('0x15'),_0x1dddb3);logger['debug'](_0x28bf('0x15'),_0x1dddb3,JSON[_0x28bf('0x10')](_0x4d17e0));_0x44193c(_0x4d17e0);})[_0x28bf('0x14')](function(_0x5b9f18){logger['error'](_0x28bf('0x15'),_0x5b9f18[_0x28bf('0x13')],_0x1dddb3);_0x2e9b2c(_0x40b857[_0x28bf('0x11')](0x1f4,_0x5b9f18[_0x28bf('0x13')]));});});};exports[_0x28bf('0x1e')]=function(_0x22b693){var _0x3fe831=this;return new Promise(function(_0x59add0,_0x3b1bc3){return db[_0x28bf('0x1f')][_0x28bf('0x20')]({'raw':_0x22b693[_0x28bf('0x18')]?_0x22b693[_0x28bf('0x18')][_0x28bf('0x17')]===undefined?!![]:![]:!![],'where':_0x22b693[_0x28bf('0x18')]?_0x22b693[_0x28bf('0x18')][_0x28bf('0x19')]||null:null,'attributes':_0x22b693['options']?_0x22b693[_0x28bf('0x18')][_0x28bf('0x1a')]||null:null,'include':_0x22b693[_0x28bf('0x18')]?_0x22b693[_0x28bf('0x18')][_0x28bf('0x1b')]?_[_0x28bf('0x1c')](_0x22b693[_0x28bf('0x18')][_0x28bf('0x1b')],function(_0x74db83){return{'model':db[_0x74db83[_0x28bf('0x1d')]],'as':_0x74db83['as'],'attributes':_0x74db83[_0x28bf('0x1a')],'include':_0x74db83[_0x28bf('0x1b')]?_[_0x28bf('0x1c')](_0x74db83['include'],function(_0x18e383){return{'model':db[_0x18e383[_0x28bf('0x1d')]],'as':_0x18e383['as'],'attributes':_0x18e383['attributes'],'include':_0x18e383[_0x28bf('0x1b')]?_['map'](_0x18e383[_0x28bf('0x1b')],function(_0x5ed6b4){return{'model':db[_0x5ed6b4[_0x28bf('0x1d')]],'as':_0x5ed6b4['as'],'attributes':_0x5ed6b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46be8e){logger[_0x28bf('0xb')](_0x28bf('0x1e'),_0x22b693);logger[_0x28bf('0xe')]('ShowInterval',_0x22b693,JSON[_0x28bf('0x10')](_0x46be8e));_0x59add0(_0x46be8e);})[_0x28bf('0x14')](function(_0x513d9c){logger[_0x28bf('0x11')](_0x28bf('0x1e'),_0x513d9c['message'],_0x22b693);_0x3b1bc3(_0x3fe831[_0x28bf('0x11')](0x1f4,_0x513d9c[_0x28bf('0x13')]));});});};
\ No newline at end of file