Built motion from commit cf5ff673.|2.5.41
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index bae24ae..dafb91e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44d7=['where','limit','include','model','map','attributes','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','localhost','redis','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x3d54f8,_0x566adf){var _0x562786=function(_0x24c0a3){while(--_0x24c0a3){_0x3d54f8['push'](_0x3d54f8['shift']());}};_0x562786(++_0x566adf);}(_0x44d7,0x170));var _0x744d=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x44d7[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x744d('0x0'));var util=require(_0x744d('0x1'));var moment=require(_0x744d('0x2'));var BPromise=require(_0x744d('0x3'));var rs=require(_0x744d('0x4'));var fs=require('fs');var Redis=require(_0x744d('0x5'));var db=require(_0x744d('0x6'))['db'];var utils=require(_0x744d('0x7'));var logger=require(_0x744d('0x8'))(_0x744d('0x9'));var config=require('../../config/environment');var jayson=require(_0x744d('0xa'));var client=jayson['client'][_0x744d('0xb')]({'port':0x232a});config['redis']=_[_0x744d('0xc')](config['redis'],{'host':_0x744d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x744d('0xe')]));require('./voiceQueue.socket')[_0x744d('0xf')](socket);function respondWithRpcPromise(_0x2170d2,_0x3af2a9,_0x57dfae){return new BPromise(function(_0x5f4f17,_0x46e2fd){return client[_0x744d('0x10')](_0x2170d2,_0x57dfae)[_0x744d('0x11')](function(_0x277e50){logger['info'](_0x744d('0x12'),_0x3af2a9,_0x744d('0x13'));logger[_0x744d('0x14')](_0x744d('0x15'),_0x3af2a9,_0x744d('0x13'),JSON[_0x744d('0x16')](_0x277e50));if(_0x277e50[_0x744d('0x17')]){if(_0x277e50['error']['code']===0x1f4){logger[_0x744d('0x17')](_0x744d('0x12'),_0x3af2a9,_0x277e50['error']['message']);return _0x46e2fd(_0x277e50[_0x744d('0x17')][_0x744d('0x18')]);}logger[_0x744d('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x3af2a9,_0x277e50['error'][_0x744d('0x18')]);return _0x5f4f17(_0x277e50[_0x744d('0x17')][_0x744d('0x18')]);}else{logger[_0x744d('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3af2a9,_0x744d('0x13'));_0x5f4f17(_0x277e50['result'][_0x744d('0x18')]);}})[_0x744d('0x1a')](function(_0x57c6b4){logger[_0x744d('0x17')](_0x744d('0x12'),_0x3af2a9,_0x57c6b4);_0x46e2fd(_0x57c6b4);});});}exports[_0x744d('0x1b')]=function(_0x2263b2){var _0x48fba2=this;return new Promise(function(_0x5782d8,_0x53629c){return db[_0x744d('0x1c')][_0x744d('0x1d')]({'raw':_0x2263b2[_0x744d('0x1e')]?_0x2263b2[_0x744d('0x1e')][_0x744d('0x1f')]===undefined?!![]:![]:!![],'where':_0x2263b2[_0x744d('0x1e')]?_0x2263b2[_0x744d('0x1e')][_0x744d('0x20')]||null:null,'attributes':_0x2263b2['options']?_0x2263b2[_0x744d('0x1e')]['attributes']||null:null,'limit':_0x2263b2[_0x744d('0x1e')]?_0x2263b2['options'][_0x744d('0x21')]||null:null,'include':_0x2263b2['options']?_0x2263b2[_0x744d('0x1e')][_0x744d('0x22')]?_['map'](_0x2263b2[_0x744d('0x1e')]['include'],function(_0x297e2b){return{'model':db[_0x297e2b[_0x744d('0x23')]],'as':_0x297e2b['as'],'attributes':_0x297e2b['attributes'],'include':_0x297e2b['include']?_[_0x744d('0x24')](_0x297e2b[_0x744d('0x22')],function(_0x18bdde){return{'model':db[_0x18bdde[_0x744d('0x23')]],'as':_0x18bdde['as'],'attributes':_0x18bdde['attributes'],'include':_0x18bdde[_0x744d('0x22')]?_[_0x744d('0x24')](_0x18bdde[_0x744d('0x22')],function(_0x4bb8fe){return{'model':db[_0x4bb8fe['model']],'as':_0x4bb8fe['as'],'attributes':_0x4bb8fe[_0x744d('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a9cc5){logger[_0x744d('0x19')](_0x744d('0x1b'),_0x2263b2);logger[_0x744d('0x14')](_0x744d('0x1b'),_0x2263b2,JSON[_0x744d('0x16')](_0x5a9cc5));_0x5782d8(_0x5a9cc5);})[_0x744d('0x1a')](function(_0x2cc4f3){logger[_0x744d('0x17')](_0x744d('0x1b'),_0x2cc4f3[_0x744d('0x18')],_0x2263b2);_0x53629c(_0x48fba2[_0x744d('0x17')](0x1f4,_0x2cc4f3['message']));});});};exports[_0x744d('0x26')]=function(_0x459cec){var _0x19b80c=this;return new Promise(function(_0x4893c5,_0x38892f){return db[_0x744d('0x1c')][_0x744d('0x27')]({'raw':_0x459cec[_0x744d('0x1e')]?_0x459cec['options'][_0x744d('0x1f')]===undefined?!![]:![]:!![],'where':_0x459cec[_0x744d('0x1e')]?_0x459cec[_0x744d('0x1e')][_0x744d('0x20')]||null:null,'attributes':_0x459cec['options']?_0x459cec['options'][_0x744d('0x25')]||null:null,'include':_0x459cec[_0x744d('0x1e')]?_0x459cec[_0x744d('0x1e')]['include']?_[_0x744d('0x24')](_0x459cec['options'][_0x744d('0x22')],function(_0x4b1202){return{'model':db[_0x4b1202['model']],'as':_0x4b1202['as'],'attributes':_0x4b1202[_0x744d('0x25')],'include':_0x4b1202[_0x744d('0x22')]?_[_0x744d('0x24')](_0x4b1202[_0x744d('0x22')],function(_0x6ded79){return{'model':db[_0x6ded79[_0x744d('0x23')]],'as':_0x6ded79['as'],'attributes':_0x6ded79[_0x744d('0x25')],'include':_0x6ded79['include']?_[_0x744d('0x24')](_0x6ded79[_0x744d('0x22')],function(_0x2291da){return{'model':db[_0x2291da[_0x744d('0x23')]],'as':_0x2291da['as'],'attributes':_0x2291da['attributes']};}):[]};}):[]};}):[]:[]})[_0x744d('0x11')](function(_0x4da5d1){logger[_0x744d('0x19')](_0x744d('0x26'),_0x459cec);logger[_0x744d('0x14')](_0x744d('0x26'),_0x459cec,JSON[_0x744d('0x16')](_0x4da5d1));_0x4893c5(_0x4da5d1);})['catch'](function(_0x2d0583){logger['error'](_0x744d('0x26'),_0x2d0583['message'],_0x459cec);_0x38892f(_0x19b80c[_0x744d('0x17')](0x1f4,_0x2d0583[_0x744d('0x18')]));});});};
\ No newline at end of file
+var _0x9340=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','map','include','model','attributes','info','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37e50a,_0x1a5087){var _0x28312f=function(_0x5c8c4f){while(--_0x5c8c4f){_0x37e50a['push'](_0x37e50a['shift']());}};_0x28312f(++_0x1a5087);}(_0x9340,0xf6));var _0x0934=function(_0x107a96,_0x18f680){_0x107a96=_0x107a96-0x0;var _0x3b6459=_0x9340[_0x107a96];return _0x3b6459;};'use strict';var _=require('lodash');var util=require(_0x0934('0x0'));var moment=require(_0x0934('0x1'));var BPromise=require(_0x0934('0x2'));var rs=require(_0x0934('0x3'));var fs=require('fs');var Redis=require(_0x0934('0x4'));var db=require(_0x0934('0x5'))['db'];var utils=require(_0x0934('0x6'));var logger=require(_0x0934('0x7'))(_0x0934('0x8'));var config=require(_0x0934('0x9'));var jayson=require(_0x0934('0xa'));var client=jayson[_0x0934('0xb')][_0x0934('0xc')]({'port':0x232a});config['redis']=_[_0x0934('0xd')](config[_0x0934('0xe')],{'host':_0x0934('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0934('0x10'))[_0x0934('0x11')](socket);function respondWithRpcPromise(_0xc10d72,_0x31e36e,_0x303a00){return new BPromise(function(_0x3458ef,_0x32253a){return client[_0x0934('0x12')](_0xc10d72,_0x303a00)[_0x0934('0x13')](function(_0x1b2032){logger['info'](_0x0934('0x14'),_0x31e36e,_0x0934('0x15'));logger[_0x0934('0x16')](_0x0934('0x17'),_0x31e36e,_0x0934('0x15'),JSON[_0x0934('0x18')](_0x1b2032));if(_0x1b2032[_0x0934('0x19')]){if(_0x1b2032[_0x0934('0x19')][_0x0934('0x1a')]===0x1f4){logger[_0x0934('0x19')](_0x0934('0x14'),_0x31e36e,_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);return _0x32253a(_0x1b2032['error'][_0x0934('0x1b')]);}logger[_0x0934('0x19')](_0x0934('0x14'),_0x31e36e,_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);return _0x3458ef(_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x31e36e,_0x0934('0x15'));_0x3458ef(_0x1b2032['result'][_0x0934('0x1b')]);}})[_0x0934('0x1c')](function(_0x4a534b){logger['error'](_0x0934('0x14'),_0x31e36e,_0x4a534b);_0x32253a(_0x4a534b);});});}exports[_0x0934('0x1d')]=function(_0x1b20f2){var _0x3cd7e7=this;return new Promise(function(_0x3106a8,_0x410a5f){return db[_0x0934('0x1e')][_0x0934('0x1f')]({'raw':_0x1b20f2['options']?_0x1b20f2[_0x0934('0x20')][_0x0934('0x21')]===undefined?!![]:![]:!![],'where':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')][_0x0934('0x22')]||null:null,'attributes':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')]['attributes']||null:null,'limit':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')]['limit']||null:null,'include':_0x1b20f2['options']?_0x1b20f2['options']['include']?_[_0x0934('0x23')](_0x1b20f2[_0x0934('0x20')][_0x0934('0x24')],function(_0x202f47){return{'model':db[_0x202f47[_0x0934('0x25')]],'as':_0x202f47['as'],'attributes':_0x202f47[_0x0934('0x26')],'include':_0x202f47['include']?_[_0x0934('0x23')](_0x202f47[_0x0934('0x24')],function(_0xdb7baa){return{'model':db[_0xdb7baa[_0x0934('0x25')]],'as':_0xdb7baa['as'],'attributes':_0xdb7baa[_0x0934('0x26')],'include':_0xdb7baa[_0x0934('0x24')]?_[_0x0934('0x23')](_0xdb7baa[_0x0934('0x24')],function(_0x474419){return{'model':db[_0x474419[_0x0934('0x25')]],'as':_0x474419['as'],'attributes':_0x474419[_0x0934('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46863d){logger[_0x0934('0x27')](_0x0934('0x1d'),_0x1b20f2);logger[_0x0934('0x16')]('GetVoiceQueue',_0x1b20f2,JSON['stringify'](_0x46863d));_0x3106a8(_0x46863d);})[_0x0934('0x1c')](function(_0x350107){logger[_0x0934('0x19')]('GetVoiceQueue',_0x350107[_0x0934('0x1b')],_0x1b20f2);_0x410a5f(_0x3cd7e7[_0x0934('0x19')](0x1f4,_0x350107['message']));});});};exports[_0x0934('0x28')]=function(_0x38edd2){var _0x45abbc=this;return new Promise(function(_0x574fb1,_0x5c8ec8){return db[_0x0934('0x1e')][_0x0934('0x29')]({'raw':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x21')]===undefined?!![]:![]:!![],'where':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x22')]||null:null,'attributes':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x26')]||null:null,'include':_0x38edd2[_0x0934('0x20')]?_0x38edd2['options'][_0x0934('0x24')]?_[_0x0934('0x23')](_0x38edd2[_0x0934('0x20')]['include'],function(_0x663bca){return{'model':db[_0x663bca[_0x0934('0x25')]],'as':_0x663bca['as'],'attributes':_0x663bca['attributes'],'include':_0x663bca[_0x0934('0x24')]?_[_0x0934('0x23')](_0x663bca[_0x0934('0x24')],function(_0x2713ab){return{'model':db[_0x2713ab[_0x0934('0x25')]],'as':_0x2713ab['as'],'attributes':_0x2713ab['attributes'],'include':_0x2713ab[_0x0934('0x24')]?_[_0x0934('0x23')](_0x2713ab['include'],function(_0x295762){return{'model':db[_0x295762['model']],'as':_0x295762['as'],'attributes':_0x295762[_0x0934('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x392ce2){logger[_0x0934('0x27')]('ShowVoiceQueue',_0x38edd2);logger['debug'](_0x0934('0x28'),_0x38edd2,JSON[_0x0934('0x18')](_0x392ce2));_0x574fb1(_0x392ce2);})[_0x0934('0x1c')](function(_0x421925){logger['error'](_0x0934('0x28'),_0x421925[_0x0934('0x1b')],_0x38edd2);_0x5c8ec8(_0x45abbc[_0x0934('0x19')](0x1f4,_0x421925[_0x0934('0x1b')]));});});};
\ No newline at end of file