Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 1c253cc..6a5e05d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbd3=['limit','include','map','model','then','GetVoiceQueue','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','findAll','options','raw','attributes'];(function(_0x51f900,_0x5d309f){var _0x24d395=function(_0x44b664){while(--_0x44b664){_0x51f900['push'](_0x51f900['shift']());}};_0x24d395(++_0x5d309f);}(_0xcbd3,0x1ab));var _0x3cbd=function(_0x12fb3e,_0x3e3645){_0x12fb3e=_0x12fb3e-0x0;var _0x425ec5=_0xcbd3[_0x12fb3e];return _0x425ec5;};'use strict';var _=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var moment=require(_0x3cbd('0x2'));var BPromise=require(_0x3cbd('0x3'));var rs=require(_0x3cbd('0x4'));var fs=require('fs');var Redis=require(_0x3cbd('0x5'));var db=require(_0x3cbd('0x6'))['db'];var utils=require(_0x3cbd('0x7'));var logger=require(_0x3cbd('0x8'))('rpc');var config=require(_0x3cbd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3cbd('0xa')][_0x3cbd('0xb')]({'port':0x232a});config[_0x3cbd('0xc')]=_[_0x3cbd('0xd')](config[_0x3cbd('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3cbd('0xe'))[_0x3cbd('0xf')](socket);function respondWithRpcPromise(_0x12174f,_0x19b7d8,_0x43e536){return new BPromise(function(_0x45676f,_0x3b104b){return client[_0x3cbd('0x10')](_0x12174f,_0x43e536)['then'](function(_0x155558){logger[_0x3cbd('0x11')](_0x3cbd('0x12'),_0x19b7d8,_0x3cbd('0x13'));logger[_0x3cbd('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x19b7d8,_0x3cbd('0x13'),JSON[_0x3cbd('0x15')](_0x155558));if(_0x155558['error']){if(_0x155558[_0x3cbd('0x16')]['code']===0x1f4){logger[_0x3cbd('0x16')](_0x3cbd('0x12'),_0x19b7d8,_0x155558['error'][_0x3cbd('0x17')]);return _0x3b104b(_0x155558[_0x3cbd('0x16')][_0x3cbd('0x17')]);}logger['error'](_0x3cbd('0x12'),_0x19b7d8,_0x155558['error']['message']);return _0x45676f(_0x155558[_0x3cbd('0x16')]['message']);}else{logger[_0x3cbd('0x11')](_0x3cbd('0x12'),_0x19b7d8,_0x3cbd('0x13'));_0x45676f(_0x155558[_0x3cbd('0x18')][_0x3cbd('0x17')]);}})['catch'](function(_0x2427a3){logger[_0x3cbd('0x16')](_0x3cbd('0x12'),_0x19b7d8,_0x2427a3);_0x3b104b(_0x2427a3);});});}exports['GetVoiceQueue']=function(_0x3bb353){var _0x111913=this;return new Promise(function(_0x2ce346,_0x3440dd){return db['VoiceQueue'][_0x3cbd('0x19')]({'raw':_0x3bb353[_0x3cbd('0x1a')]?_0x3bb353[_0x3cbd('0x1a')][_0x3cbd('0x1b')]===undefined?!![]:![]:!![],'where':_0x3bb353[_0x3cbd('0x1a')]?_0x3bb353['options']['where']||null:null,'attributes':_0x3bb353['options']?_0x3bb353[_0x3cbd('0x1a')][_0x3cbd('0x1c')]||null:null,'limit':_0x3bb353[_0x3cbd('0x1a')]?_0x3bb353[_0x3cbd('0x1a')][_0x3cbd('0x1d')]||null:null,'include':_0x3bb353[_0x3cbd('0x1a')]?_0x3bb353['options'][_0x3cbd('0x1e')]?_['map'](_0x3bb353[_0x3cbd('0x1a')]['include'],function(_0x338b98){return{'model':db[_0x338b98['model']],'as':_0x338b98['as'],'attributes':_0x338b98[_0x3cbd('0x1c')],'include':_0x338b98['include']?_[_0x3cbd('0x1f')](_0x338b98[_0x3cbd('0x1e')],function(_0x56a876){return{'model':db[_0x56a876['model']],'as':_0x56a876['as'],'attributes':_0x56a876[_0x3cbd('0x1c')],'include':_0x56a876[_0x3cbd('0x1e')]?_[_0x3cbd('0x1f')](_0x56a876[_0x3cbd('0x1e')],function(_0x2e44e5){return{'model':db[_0x2e44e5[_0x3cbd('0x20')]],'as':_0x2e44e5['as'],'attributes':_0x2e44e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x3cbd('0x21')](function(_0x47ab23){logger[_0x3cbd('0x11')](_0x3cbd('0x22'),_0x3bb353);logger[_0x3cbd('0x14')](_0x3cbd('0x22'),_0x3bb353,JSON[_0x3cbd('0x15')](_0x47ab23));_0x2ce346(_0x47ab23);})[_0x3cbd('0x23')](function(_0x484379){logger[_0x3cbd('0x16')](_0x3cbd('0x22'),_0x484379[_0x3cbd('0x17')],_0x3bb353);_0x3440dd(_0x111913[_0x3cbd('0x16')](0x1f4,_0x484379[_0x3cbd('0x17')]));});});};exports[_0x3cbd('0x24')]=function(_0x3fbc76){var _0x340eeb=this;return new Promise(function(_0x25dc3b,_0x178079){return db['VoiceQueue'][_0x3cbd('0x25')]({'raw':_0x3fbc76['options']?_0x3fbc76[_0x3cbd('0x1a')][_0x3cbd('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fbc76[_0x3cbd('0x1a')]?_0x3fbc76[_0x3cbd('0x1a')]['where']||null:null,'attributes':_0x3fbc76[_0x3cbd('0x1a')]?_0x3fbc76[_0x3cbd('0x1a')]['attributes']||null:null,'include':_0x3fbc76[_0x3cbd('0x1a')]?_0x3fbc76['options'][_0x3cbd('0x1e')]?_['map'](_0x3fbc76['options'][_0x3cbd('0x1e')],function(_0x44a25b){return{'model':db[_0x44a25b[_0x3cbd('0x20')]],'as':_0x44a25b['as'],'attributes':_0x44a25b[_0x3cbd('0x1c')],'include':_0x44a25b[_0x3cbd('0x1e')]?_[_0x3cbd('0x1f')](_0x44a25b[_0x3cbd('0x1e')],function(_0x39334d){return{'model':db[_0x39334d[_0x3cbd('0x20')]],'as':_0x39334d['as'],'attributes':_0x39334d[_0x3cbd('0x1c')],'include':_0x39334d['include']?_[_0x3cbd('0x1f')](_0x39334d[_0x3cbd('0x1e')],function(_0x1c2c8d){return{'model':db[_0x1c2c8d['model']],'as':_0x1c2c8d['as'],'attributes':_0x1c2c8d[_0x3cbd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3cbd('0x21')](function(_0x5039e3){logger[_0x3cbd('0x11')]('ShowVoiceQueue',_0x3fbc76);logger[_0x3cbd('0x14')]('ShowVoiceQueue',_0x3fbc76,JSON[_0x3cbd('0x15')](_0x5039e3));_0x25dc3b(_0x5039e3);})[_0x3cbd('0x23')](function(_0x5273bf){logger[_0x3cbd('0x16')]('ShowVoiceQueue',_0x5273bf[_0x3cbd('0x17')],_0x3fbc76);_0x178079(_0x340eeb[_0x3cbd('0x16')](0x1f4,_0x5273bf['message']));});});};
\ No newline at end of file
+var _0x1323=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueue','VoiceQueue','options','where','attributes','limit','include','model','map','find','ShowVoiceQueue','debug','stringify','lodash','util','moment'];(function(_0x290680,_0x146aaf){var _0x3e796a=function(_0xd5cecd){while(--_0xd5cecd){_0x290680['push'](_0x290680['shift']());}};_0x3e796a(++_0x146aaf);}(_0x1323,0x189));var _0x3132=function(_0x264ba4,_0x3dce73){_0x264ba4=_0x264ba4-0x0;var _0x351bf0=_0x1323[_0x264ba4];return _0x351bf0;};'use strict';var _=require(_0x3132('0x0'));var util=require(_0x3132('0x1'));var moment=require(_0x3132('0x2'));var BPromise=require(_0x3132('0x3'));var rs=require(_0x3132('0x4'));var fs=require('fs');var Redis=require(_0x3132('0x5'));var db=require(_0x3132('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3132('0x7'))(_0x3132('0x8'));var config=require(_0x3132('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x3132('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3132('0xb'))(new Redis(config[_0x3132('0xa')]));require(_0x3132('0xc'))['register'](socket);function respondWithRpcPromise(_0x3a7575,_0x1c8853,_0x742840){return new BPromise(function(_0x1f6a98,_0x358d91){return client[_0x3132('0xd')](_0x3a7575,_0x742840)[_0x3132('0xe')](function(_0x3dd3f7){logger[_0x3132('0xf')](_0x3132('0x10'),_0x1c8853,_0x3132('0x11'));logger['debug'](_0x3132('0x12'),_0x1c8853,_0x3132('0x11'),JSON['stringify'](_0x3dd3f7));if(_0x3dd3f7['error']){if(_0x3dd3f7[_0x3132('0x13')][_0x3132('0x14')]===0x1f4){logger[_0x3132('0x13')](_0x3132('0x10'),_0x1c8853,_0x3dd3f7['error']['message']);return _0x358d91(_0x3dd3f7['error'][_0x3132('0x15')]);}logger[_0x3132('0x13')](_0x3132('0x10'),_0x1c8853,_0x3dd3f7[_0x3132('0x13')]['message']);return _0x1f6a98(_0x3dd3f7[_0x3132('0x13')][_0x3132('0x15')]);}else{logger[_0x3132('0xf')](_0x3132('0x10'),_0x1c8853,_0x3132('0x11'));_0x1f6a98(_0x3dd3f7['result']['message']);}})[_0x3132('0x16')](function(_0xc2bf76){logger[_0x3132('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x1c8853,_0xc2bf76);_0x358d91(_0xc2bf76);});});}exports[_0x3132('0x17')]=function(_0x366023){var _0x514c77=this;return new Promise(function(_0x1a22bf,_0x807aad){return db[_0x3132('0x18')]['findAll']({'raw':_0x366023[_0x3132('0x19')]?_0x366023['options']['raw']===undefined?!![]:![]:!![],'where':_0x366023[_0x3132('0x19')]?_0x366023[_0x3132('0x19')][_0x3132('0x1a')]||null:null,'attributes':_0x366023[_0x3132('0x19')]?_0x366023['options'][_0x3132('0x1b')]||null:null,'limit':_0x366023[_0x3132('0x19')]?_0x366023[_0x3132('0x19')][_0x3132('0x1c')]||null:null,'include':_0x366023[_0x3132('0x19')]?_0x366023['options'][_0x3132('0x1d')]?_['map'](_0x366023[_0x3132('0x19')][_0x3132('0x1d')],function(_0x33a1b8){return{'model':db[_0x33a1b8[_0x3132('0x1e')]],'as':_0x33a1b8['as'],'attributes':_0x33a1b8[_0x3132('0x1b')],'include':_0x33a1b8[_0x3132('0x1d')]?_[_0x3132('0x1f')](_0x33a1b8[_0x3132('0x1d')],function(_0x184628){return{'model':db[_0x184628[_0x3132('0x1e')]],'as':_0x184628['as'],'attributes':_0x184628[_0x3132('0x1b')],'include':_0x184628[_0x3132('0x1d')]?_[_0x3132('0x1f')](_0x184628[_0x3132('0x1d')],function(_0x282f22){return{'model':db[_0x282f22[_0x3132('0x1e')]],'as':_0x282f22['as'],'attributes':_0x282f22[_0x3132('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3132('0xe')](function(_0x30b8d7){logger[_0x3132('0xf')]('GetVoiceQueue',_0x366023);logger['debug'](_0x3132('0x17'),_0x366023,JSON['stringify'](_0x30b8d7));_0x1a22bf(_0x30b8d7);})[_0x3132('0x16')](function(_0x3853f1){logger[_0x3132('0x13')](_0x3132('0x17'),_0x3853f1[_0x3132('0x15')],_0x366023);_0x807aad(_0x514c77[_0x3132('0x13')](0x1f4,_0x3853f1['message']));});});};exports['ShowVoiceQueue']=function(_0x4a5dae){var _0x510461=this;return new Promise(function(_0x47bf79,_0x8e5e02){return db[_0x3132('0x18')][_0x3132('0x20')]({'raw':_0x4a5dae[_0x3132('0x19')]?_0x4a5dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a5dae['options']?_0x4a5dae[_0x3132('0x19')][_0x3132('0x1a')]||null:null,'attributes':_0x4a5dae[_0x3132('0x19')]?_0x4a5dae[_0x3132('0x19')][_0x3132('0x1b')]||null:null,'include':_0x4a5dae['options']?_0x4a5dae['options'][_0x3132('0x1d')]?_[_0x3132('0x1f')](_0x4a5dae['options']['include'],function(_0x1c15cd){return{'model':db[_0x1c15cd[_0x3132('0x1e')]],'as':_0x1c15cd['as'],'attributes':_0x1c15cd[_0x3132('0x1b')],'include':_0x1c15cd[_0x3132('0x1d')]?_[_0x3132('0x1f')](_0x1c15cd['include'],function(_0x1e1892){return{'model':db[_0x1e1892['model']],'as':_0x1e1892['as'],'attributes':_0x1e1892[_0x3132('0x1b')],'include':_0x1e1892[_0x3132('0x1d')]?_['map'](_0x1e1892[_0x3132('0x1d')],function(_0x45b459){return{'model':db[_0x45b459[_0x3132('0x1e')]],'as':_0x45b459['as'],'attributes':_0x45b459[_0x3132('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3132('0xe')](function(_0xfd19df){logger[_0x3132('0xf')](_0x3132('0x21'),_0x4a5dae);logger[_0x3132('0x22')]('ShowVoiceQueue',_0x4a5dae,JSON[_0x3132('0x23')](_0xfd19df));_0x47bf79(_0xfd19df);})[_0x3132('0x16')](function(_0x362386){logger['error'](_0x3132('0x21'),_0x362386[_0x3132('0x15')],_0x4a5dae);_0x8e5e02(_0x510461['error'](0x1f4,_0x362386[_0x3132('0x15')]));});});};
\ No newline at end of file