Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index e9fea15..b4794f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41f3=['raw','where','attributes','limit','map','include','model','then','ShowVoiceQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x4d61ca,_0x2153c9){var _0xa1e14a=function(_0x4b2ca0){while(--_0x4b2ca0){_0x4d61ca['push'](_0x4d61ca['shift']());}};_0xa1e14a(++_0x2153c9);}(_0x41f3,0x11b));var _0x341f=function(_0x4f4c51,_0x3b2bc9){_0x4f4c51=_0x4f4c51-0x0;var _0x145dc3=_0x41f3[_0x4f4c51];return _0x145dc3;};'use strict';var _=require('lodash');var util=require(_0x341f('0x0'));var moment=require(_0x341f('0x1'));var BPromise=require('bluebird');var rs=require(_0x341f('0x2'));var fs=require('fs');var Redis=require(_0x341f('0x3'));var db=require(_0x341f('0x4'))['db'];var utils=require(_0x341f('0x5'));var logger=require(_0x341f('0x6'))(_0x341f('0x7'));var config=require('../../config/environment');var jayson=require(_0x341f('0x8'));var client=jayson[_0x341f('0x9')][_0x341f('0xa')]({'port':0x232a});config['redis']=_[_0x341f('0xb')](config[_0x341f('0xc')],{'host':_0x341f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x341f('0xc')]));require(_0x341f('0xe'))[_0x341f('0xf')](socket);function respondWithRpcPromise(_0x58d306,_0x473e87,_0x51a8b8){return new BPromise(function(_0x3b6115,_0x39e28b){return client['request'](_0x58d306,_0x51a8b8)['then'](function(_0x2fd1ae){logger[_0x341f('0x10')](_0x341f('0x11'),_0x473e87,'request\x20sent');logger[_0x341f('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x473e87,_0x341f('0x13'),JSON[_0x341f('0x14')](_0x2fd1ae));if(_0x2fd1ae[_0x341f('0x15')]){if(_0x2fd1ae[_0x341f('0x15')][_0x341f('0x16')]===0x1f4){logger[_0x341f('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x473e87,_0x2fd1ae[_0x341f('0x15')]['message']);return _0x39e28b(_0x2fd1ae['error'][_0x341f('0x17')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x473e87,_0x2fd1ae[_0x341f('0x15')][_0x341f('0x17')]);return _0x3b6115(_0x2fd1ae['error']['message']);}else{logger[_0x341f('0x10')](_0x341f('0x11'),_0x473e87,_0x341f('0x13'));_0x3b6115(_0x2fd1ae['result']['message']);}})[_0x341f('0x18')](function(_0x2e9b13){logger[_0x341f('0x15')](_0x341f('0x11'),_0x473e87,_0x2e9b13);_0x39e28b(_0x2e9b13);});});}exports[_0x341f('0x19')]=function(_0x2074d1){var _0x7f0e46=this;return new Promise(function(_0x145492,_0x4ddc0b){return db[_0x341f('0x1a')][_0x341f('0x1b')]({'raw':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1e')]||null:null,'attributes':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x1f')]||null:null,'limit':_0x2074d1[_0x341f('0x1c')]?_0x2074d1[_0x341f('0x1c')][_0x341f('0x20')]||null:null,'include':_0x2074d1['options']?_0x2074d1[_0x341f('0x1c')]['include']?_[_0x341f('0x21')](_0x2074d1[_0x341f('0x1c')][_0x341f('0x22')],function(_0x429858){return{'model':db[_0x429858['model']],'as':_0x429858['as'],'attributes':_0x429858[_0x341f('0x1f')],'include':_0x429858['include']?_[_0x341f('0x21')](_0x429858[_0x341f('0x22')],function(_0x27b86f){return{'model':db[_0x27b86f[_0x341f('0x23')]],'as':_0x27b86f['as'],'attributes':_0x27b86f[_0x341f('0x1f')],'include':_0x27b86f[_0x341f('0x22')]?_[_0x341f('0x21')](_0x27b86f[_0x341f('0x22')],function(_0xecabf5){return{'model':db[_0xecabf5[_0x341f('0x23')]],'as':_0xecabf5['as'],'attributes':_0xecabf5[_0x341f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x341f('0x24')](function(_0x5a882e){logger[_0x341f('0x10')](_0x341f('0x19'),_0x2074d1);logger['debug']('GetVoiceQueue',_0x2074d1,JSON[_0x341f('0x14')](_0x5a882e));_0x145492(_0x5a882e);})[_0x341f('0x18')](function(_0x4cbcad){logger[_0x341f('0x15')](_0x341f('0x19'),_0x4cbcad[_0x341f('0x17')],_0x2074d1);_0x4ddc0b(_0x7f0e46[_0x341f('0x15')](0x1f4,_0x4cbcad[_0x341f('0x17')]));});});};exports[_0x341f('0x25')]=function(_0x4dba19){var _0x55e0ea=this;return new Promise(function(_0x559de2,_0x5c4340){return db[_0x341f('0x1a')][_0x341f('0x26')]({'raw':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x1e')]||null:null,'attributes':_0x4dba19['options']?_0x4dba19['options'][_0x341f('0x1f')]||null:null,'include':_0x4dba19[_0x341f('0x1c')]?_0x4dba19[_0x341f('0x1c')][_0x341f('0x22')]?_[_0x341f('0x21')](_0x4dba19[_0x341f('0x1c')][_0x341f('0x22')],function(_0x1a0976){return{'model':db[_0x1a0976[_0x341f('0x23')]],'as':_0x1a0976['as'],'attributes':_0x1a0976[_0x341f('0x1f')],'include':_0x1a0976[_0x341f('0x22')]?_['map'](_0x1a0976[_0x341f('0x22')],function(_0x3072dc){return{'model':db[_0x3072dc[_0x341f('0x23')]],'as':_0x3072dc['as'],'attributes':_0x3072dc[_0x341f('0x1f')],'include':_0x3072dc[_0x341f('0x22')]?_[_0x341f('0x21')](_0x3072dc['include'],function(_0x59be82){return{'model':db[_0x59be82['model']],'as':_0x59be82['as'],'attributes':_0x59be82[_0x341f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c2291){logger[_0x341f('0x10')]('ShowVoiceQueue',_0x4dba19);logger[_0x341f('0x12')](_0x341f('0x25'),_0x4dba19,JSON[_0x341f('0x14')](_0x4c2291));_0x559de2(_0x4c2291);})[_0x341f('0x18')](function(_0x203182){logger[_0x341f('0x15')](_0x341f('0x25'),_0x203182[_0x341f('0x17')],_0x4dba19);_0x5c4340(_0x55e0ea[_0x341f('0x15')](0x1f4,_0x203182[_0x341f('0x17')]));});});};
\ No newline at end of file
+var _0x5c5b=['ShowVoiceQueue','find','where','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceQueue','options','raw','attributes','include','map','model','GetVoiceQueue'];(function(_0x5d4e83,_0x23c49e){var _0x503b36=function(_0xaabb32){while(--_0xaabb32){_0x5d4e83['push'](_0x5d4e83['shift']());}};_0x503b36(++_0x23c49e);}(_0x5c5b,0x93));var _0xb5c5=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x5c5b[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0xb5c5('0x0'));var util=require('util');var moment=require(_0xb5c5('0x1'));var BPromise=require(_0xb5c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5c5('0x4'))(_0xb5c5('0x5'));var config=require(_0xb5c5('0x6'));var jayson=require(_0xb5c5('0x7'));var client=jayson[_0xb5c5('0x8')][_0xb5c5('0x9')]({'port':0x232a});config[_0xb5c5('0xa')]=_[_0xb5c5('0xb')](config[_0xb5c5('0xa')],{'host':_0xb5c5('0xc'),'port':0x18eb});var socket=require(_0xb5c5('0xd'))(new Redis(config[_0xb5c5('0xa')]));require(_0xb5c5('0xe'))['register'](socket);function respondWithRpcPromise(_0x4c03b3,_0x442a72,_0xe6a2c7){return new BPromise(function(_0x4c5c93,_0x585d56){return client['request'](_0x4c03b3,_0xe6a2c7)[_0xb5c5('0xf')](function(_0x5daae8){logger[_0xb5c5('0x10')](_0xb5c5('0x11'),_0x442a72,_0xb5c5('0x12'));logger[_0xb5c5('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x442a72,_0xb5c5('0x12'),JSON[_0xb5c5('0x14')](_0x5daae8));if(_0x5daae8[_0xb5c5('0x15')]){if(_0x5daae8[_0xb5c5('0x15')]['code']===0x1f4){logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);return _0x585d56(_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);}logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x5daae8[_0xb5c5('0x15')][_0xb5c5('0x16')]);return _0x4c5c93(_0x5daae8[_0xb5c5('0x15')]['message']);}else{logger[_0xb5c5('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x442a72,'request\x20sent');_0x4c5c93(_0x5daae8[_0xb5c5('0x17')][_0xb5c5('0x16')]);}})[_0xb5c5('0x18')](function(_0x1322c2){logger[_0xb5c5('0x15')](_0xb5c5('0x11'),_0x442a72,_0x1322c2);_0x585d56(_0x1322c2);});});}exports['GetVoiceQueue']=function(_0x1ab5b0){var _0x41fb4b=this;return new Promise(function(_0x56cf9d,_0x3e6ead){return db[_0xb5c5('0x19')]['findAll']({'raw':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')]['where']||null:null,'attributes':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1c')]||null:null,'limit':_0x1ab5b0[_0xb5c5('0x1a')]?_0x1ab5b0[_0xb5c5('0x1a')]['limit']||null:null,'include':_0x1ab5b0['options']?_0x1ab5b0['options'][_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x1ab5b0[_0xb5c5('0x1a')][_0xb5c5('0x1d')],function(_0x165c8e){return{'model':db[_0x165c8e['model']],'as':_0x165c8e['as'],'attributes':_0x165c8e[_0xb5c5('0x1c')],'include':_0x165c8e[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x165c8e[_0xb5c5('0x1d')],function(_0x24e3d1){return{'model':db[_0x24e3d1[_0xb5c5('0x1f')]],'as':_0x24e3d1['as'],'attributes':_0x24e3d1['attributes'],'include':_0x24e3d1[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x24e3d1[_0xb5c5('0x1d')],function(_0x17ff1b){return{'model':db[_0x17ff1b['model']],'as':_0x17ff1b['as'],'attributes':_0x17ff1b[_0xb5c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb5c5('0xf')](function(_0x262712){logger[_0xb5c5('0x10')]('GetVoiceQueue',_0x1ab5b0);logger[_0xb5c5('0x13')](_0xb5c5('0x20'),_0x1ab5b0,JSON['stringify'](_0x262712));_0x56cf9d(_0x262712);})[_0xb5c5('0x18')](function(_0xb553c9){logger[_0xb5c5('0x15')](_0xb5c5('0x20'),_0xb553c9['message'],_0x1ab5b0);_0x3e6ead(_0x41fb4b[_0xb5c5('0x15')](0x1f4,_0xb553c9[_0xb5c5('0x16')]));});});};exports[_0xb5c5('0x21')]=function(_0x49a149){var _0x55c5cb=this;return new Promise(function(_0x5b627d,_0x182279){return db['VoiceQueue'][_0xb5c5('0x22')]({'raw':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')][_0xb5c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')][_0xb5c5('0x23')]||null:null,'attributes':_0x49a149[_0xb5c5('0x1a')]?_0x49a149[_0xb5c5('0x1a')]['attributes']||null:null,'include':_0x49a149[_0xb5c5('0x1a')]?_0x49a149['options']['include']?_[_0xb5c5('0x1e')](_0x49a149['options'][_0xb5c5('0x1d')],function(_0x2fd9f1){return{'model':db[_0x2fd9f1[_0xb5c5('0x1f')]],'as':_0x2fd9f1['as'],'attributes':_0x2fd9f1[_0xb5c5('0x1c')],'include':_0x2fd9f1[_0xb5c5('0x1d')]?_[_0xb5c5('0x1e')](_0x2fd9f1['include'],function(_0x373f3d){return{'model':db[_0x373f3d[_0xb5c5('0x1f')]],'as':_0x373f3d['as'],'attributes':_0x373f3d[_0xb5c5('0x1c')],'include':_0x373f3d['include']?_['map'](_0x373f3d[_0xb5c5('0x1d')],function(_0x5e9b8d){return{'model':db[_0x5e9b8d[_0xb5c5('0x1f')]],'as':_0x5e9b8d['as'],'attributes':_0x5e9b8d[_0xb5c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb5c5('0xf')](function(_0x7c64b9){logger[_0xb5c5('0x10')](_0xb5c5('0x21'),_0x49a149);logger[_0xb5c5('0x13')](_0xb5c5('0x21'),_0x49a149,JSON[_0xb5c5('0x14')](_0x7c64b9));_0x5b627d(_0x7c64b9);})[_0xb5c5('0x18')](function(_0xfb5780){logger[_0xb5c5('0x15')]('ShowVoiceQueue',_0xfb5780[_0xb5c5('0x16')],_0x49a149);_0x182279(_0x55c5cb['error'](0x1f4,_0xfb5780[_0xb5c5('0x16')]));});});};
\ No newline at end of file