Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 3675063..7b99acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10a5=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','options','raw','attributes','limit','include','map','model','debug','ShowVoiceQueue','find','where','util','bluebird'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0x10a5,0x101));var _0x510a=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x10a5[_0x2cfb48];return _0xc4594f;};'use strict';var _=require('lodash');var util=require(_0x510a('0x0'));var moment=require('moment');var BPromise=require(_0x510a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x510a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x510a('0x3'));var logger=require(_0x510a('0x4'))(_0x510a('0x5'));var config=require(_0x510a('0x6'));var jayson=require(_0x510a('0x7'));var client=jayson['client'][_0x510a('0x8')]({'port':0x232a});config[_0x510a('0x9')]=_[_0x510a('0xa')](config['redis'],{'host':_0x510a('0xb'),'port':0x18eb});var socket=require(_0x510a('0xc'))(new Redis(config[_0x510a('0x9')]));require(_0x510a('0xd'))['register'](socket);function respondWithRpcPromise(_0x489267,_0x501f64,_0x5d9c61){return new BPromise(function(_0x46b19d,_0x41a14e){return client[_0x510a('0xe')](_0x489267,_0x5d9c61)[_0x510a('0xf')](function(_0xda63d4){logger[_0x510a('0x10')](_0x510a('0x11'),_0x501f64,_0x510a('0x12'));logger['debug'](_0x510a('0x13'),_0x501f64,_0x510a('0x12'),JSON[_0x510a('0x14')](_0xda63d4));if(_0xda63d4['error']){if(_0xda63d4[_0x510a('0x15')]['code']===0x1f4){logger['error'](_0x510a('0x11'),_0x501f64,_0xda63d4[_0x510a('0x15')][_0x510a('0x16')]);return _0x41a14e(_0xda63d4[_0x510a('0x15')][_0x510a('0x16')]);}logger[_0x510a('0x15')](_0x510a('0x11'),_0x501f64,_0xda63d4[_0x510a('0x15')][_0x510a('0x16')]);return _0x46b19d(_0xda63d4[_0x510a('0x15')]['message']);}else{logger['info'](_0x510a('0x11'),_0x501f64,_0x510a('0x12'));_0x46b19d(_0xda63d4[_0x510a('0x17')][_0x510a('0x16')]);}})[_0x510a('0x18')](function(_0x47fa8e){logger[_0x510a('0x15')](_0x510a('0x11'),_0x501f64,_0x47fa8e);_0x41a14e(_0x47fa8e);});});}exports[_0x510a('0x19')]=function(_0x2a0f7b){var _0x34ee25=this;return new Promise(function(_0x59fb58,_0x52b105){return db['VoiceQueue']['findAll']({'raw':_0x2a0f7b['options']?_0x2a0f7b[_0x510a('0x1a')][_0x510a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a0f7b[_0x510a('0x1a')]?_0x2a0f7b[_0x510a('0x1a')]['where']||null:null,'attributes':_0x2a0f7b[_0x510a('0x1a')]?_0x2a0f7b[_0x510a('0x1a')][_0x510a('0x1c')]||null:null,'limit':_0x2a0f7b['options']?_0x2a0f7b['options'][_0x510a('0x1d')]||null:null,'include':_0x2a0f7b[_0x510a('0x1a')]?_0x2a0f7b[_0x510a('0x1a')][_0x510a('0x1e')]?_[_0x510a('0x1f')](_0x2a0f7b[_0x510a('0x1a')]['include'],function(_0x40a08f){return{'model':db[_0x40a08f[_0x510a('0x20')]],'as':_0x40a08f['as'],'attributes':_0x40a08f[_0x510a('0x1c')],'include':_0x40a08f[_0x510a('0x1e')]?_['map'](_0x40a08f[_0x510a('0x1e')],function(_0x20d04b){return{'model':db[_0x20d04b['model']],'as':_0x20d04b['as'],'attributes':_0x20d04b[_0x510a('0x1c')],'include':_0x20d04b[_0x510a('0x1e')]?_['map'](_0x20d04b[_0x510a('0x1e')],function(_0x5ba54e){return{'model':db[_0x5ba54e[_0x510a('0x20')]],'as':_0x5ba54e['as'],'attributes':_0x5ba54e[_0x510a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x510a('0xf')](function(_0x4af3be){logger[_0x510a('0x10')](_0x510a('0x19'),_0x2a0f7b);logger[_0x510a('0x21')]('GetVoiceQueue',_0x2a0f7b,JSON['stringify'](_0x4af3be));_0x59fb58(_0x4af3be);})[_0x510a('0x18')](function(_0x3e121c){logger['error'](_0x510a('0x19'),_0x3e121c[_0x510a('0x16')],_0x2a0f7b);_0x52b105(_0x34ee25[_0x510a('0x15')](0x1f4,_0x3e121c[_0x510a('0x16')]));});});};exports[_0x510a('0x22')]=function(_0x5d7392){var _0x5e0bde=this;return new Promise(function(_0x4c2920,_0x1bf602){return db['VoiceQueue'][_0x510a('0x23')]({'raw':_0x5d7392['options']?_0x5d7392['options'][_0x510a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d7392[_0x510a('0x1a')]?_0x5d7392[_0x510a('0x1a')][_0x510a('0x24')]||null:null,'attributes':_0x5d7392[_0x510a('0x1a')]?_0x5d7392[_0x510a('0x1a')]['attributes']||null:null,'include':_0x5d7392[_0x510a('0x1a')]?_0x5d7392['options']['include']?_[_0x510a('0x1f')](_0x5d7392['options'][_0x510a('0x1e')],function(_0x45057a){return{'model':db[_0x45057a[_0x510a('0x20')]],'as':_0x45057a['as'],'attributes':_0x45057a[_0x510a('0x1c')],'include':_0x45057a[_0x510a('0x1e')]?_['map'](_0x45057a[_0x510a('0x1e')],function(_0x3a51ab){return{'model':db[_0x3a51ab[_0x510a('0x20')]],'as':_0x3a51ab['as'],'attributes':_0x3a51ab[_0x510a('0x1c')],'include':_0x3a51ab['include']?_[_0x510a('0x1f')](_0x3a51ab['include'],function(_0x19ba50){return{'model':db[_0x19ba50[_0x510a('0x20')]],'as':_0x19ba50['as'],'attributes':_0x19ba50[_0x510a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x510a('0xf')](function(_0x255e1d){logger[_0x510a('0x10')](_0x510a('0x22'),_0x5d7392);logger[_0x510a('0x21')](_0x510a('0x22'),_0x5d7392,JSON[_0x510a('0x14')](_0x255e1d));_0x4c2920(_0x255e1d);})['catch'](function(_0x1652d7){logger['error'](_0x510a('0x22'),_0x1652d7[_0x510a('0x16')],_0x5d7392);_0x1bf602(_0x5e0bde['error'](0x1f4,_0x1652d7[_0x510a('0x16')]));});});};
\ No newline at end of file
+var _0x7009=['attributes','limit','map','include','model','stringify','find','ShowVoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where'];(function(_0x16da4c,_0x3e97d2){var _0x190266=function(_0x225f93){while(--_0x225f93){_0x16da4c['push'](_0x16da4c['shift']());}};_0x190266(++_0x3e97d2);}(_0x7009,0x18e));var _0x9700=function(_0x2a912b,_0x1f4b9b){_0x2a912b=_0x2a912b-0x0;var _0x1d631c=_0x7009[_0x2a912b];return _0x1d631c;};'use strict';var _=require(_0x9700('0x0'));var util=require(_0x9700('0x1'));var moment=require('moment');var BPromise=require(_0x9700('0x2'));var rs=require(_0x9700('0x3'));var fs=require('fs');var Redis=require(_0x9700('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9700('0x5'));var logger=require(_0x9700('0x6'))(_0x9700('0x7'));var config=require(_0x9700('0x8'));var jayson=require(_0x9700('0x9'));var client=jayson['client'][_0x9700('0xa')]({'port':0x232a});config[_0x9700('0xb')]=_[_0x9700('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9700('0xd'))(new Redis(config[_0x9700('0xb')]));require('./voiceQueue.socket')[_0x9700('0xe')](socket);function respondWithRpcPromise(_0x542dc7,_0x5afc88,_0x1e6c8e){return new BPromise(function(_0x3d9ca6,_0x15f52e){return client['request'](_0x542dc7,_0x1e6c8e)[_0x9700('0xf')](function(_0x219409){logger[_0x9700('0x10')](_0x9700('0x11'),_0x5afc88,_0x9700('0x12'));logger[_0x9700('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5afc88,_0x9700('0x12'),JSON['stringify'](_0x219409));if(_0x219409[_0x9700('0x14')]){if(_0x219409[_0x9700('0x14')][_0x9700('0x15')]===0x1f4){logger[_0x9700('0x14')](_0x9700('0x11'),_0x5afc88,_0x219409[_0x9700('0x14')][_0x9700('0x16')]);return _0x15f52e(_0x219409[_0x9700('0x14')]['message']);}logger[_0x9700('0x14')](_0x9700('0x11'),_0x5afc88,_0x219409[_0x9700('0x14')][_0x9700('0x16')]);return _0x3d9ca6(_0x219409[_0x9700('0x14')][_0x9700('0x16')]);}else{logger['info'](_0x9700('0x11'),_0x5afc88,_0x9700('0x12'));_0x3d9ca6(_0x219409[_0x9700('0x17')][_0x9700('0x16')]);}})[_0x9700('0x18')](function(_0x3a54ab){logger[_0x9700('0x14')](_0x9700('0x11'),_0x5afc88,_0x3a54ab);_0x15f52e(_0x3a54ab);});});}exports[_0x9700('0x19')]=function(_0x3e019f){var _0x25a4e5=this;return new Promise(function(_0x5291ac,_0x3c829a){return db[_0x9700('0x1a')][_0x9700('0x1b')]({'raw':_0x3e019f[_0x9700('0x1c')]?_0x3e019f[_0x9700('0x1c')][_0x9700('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e019f[_0x9700('0x1c')]?_0x3e019f[_0x9700('0x1c')][_0x9700('0x1e')]||null:null,'attributes':_0x3e019f[_0x9700('0x1c')]?_0x3e019f['options'][_0x9700('0x1f')]||null:null,'limit':_0x3e019f['options']?_0x3e019f[_0x9700('0x1c')][_0x9700('0x20')]||null:null,'include':_0x3e019f[_0x9700('0x1c')]?_0x3e019f[_0x9700('0x1c')]['include']?_[_0x9700('0x21')](_0x3e019f['options'][_0x9700('0x22')],function(_0x59e09d){return{'model':db[_0x59e09d[_0x9700('0x23')]],'as':_0x59e09d['as'],'attributes':_0x59e09d[_0x9700('0x1f')],'include':_0x59e09d[_0x9700('0x22')]?_['map'](_0x59e09d[_0x9700('0x22')],function(_0x140aed){return{'model':db[_0x140aed['model']],'as':_0x140aed['as'],'attributes':_0x140aed[_0x9700('0x1f')],'include':_0x140aed[_0x9700('0x22')]?_[_0x9700('0x21')](_0x140aed[_0x9700('0x22')],function(_0x2dc67e){return{'model':db[_0x2dc67e[_0x9700('0x23')]],'as':_0x2dc67e['as'],'attributes':_0x2dc67e[_0x9700('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2331ea){logger['info']('GetVoiceQueue',_0x3e019f);logger[_0x9700('0x13')]('GetVoiceQueue',_0x3e019f,JSON[_0x9700('0x24')](_0x2331ea));_0x5291ac(_0x2331ea);})['catch'](function(_0x2de4dd){logger[_0x9700('0x14')](_0x9700('0x19'),_0x2de4dd['message'],_0x3e019f);_0x3c829a(_0x25a4e5[_0x9700('0x14')](0x1f4,_0x2de4dd[_0x9700('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x971c9f){var _0xd17339=this;return new Promise(function(_0x9a6c6f,_0x24297c){return db[_0x9700('0x1a')][_0x9700('0x25')]({'raw':_0x971c9f[_0x9700('0x1c')]?_0x971c9f[_0x9700('0x1c')][_0x9700('0x1d')]===undefined?!![]:![]:!![],'where':_0x971c9f[_0x9700('0x1c')]?_0x971c9f[_0x9700('0x1c')]['where']||null:null,'attributes':_0x971c9f[_0x9700('0x1c')]?_0x971c9f[_0x9700('0x1c')][_0x9700('0x1f')]||null:null,'include':_0x971c9f['options']?_0x971c9f[_0x9700('0x1c')]['include']?_[_0x9700('0x21')](_0x971c9f[_0x9700('0x1c')]['include'],function(_0x381683){return{'model':db[_0x381683['model']],'as':_0x381683['as'],'attributes':_0x381683[_0x9700('0x1f')],'include':_0x381683['include']?_['map'](_0x381683[_0x9700('0x22')],function(_0x2ae793){return{'model':db[_0x2ae793[_0x9700('0x23')]],'as':_0x2ae793['as'],'attributes':_0x2ae793['attributes'],'include':_0x2ae793[_0x9700('0x22')]?_[_0x9700('0x21')](_0x2ae793['include'],function(_0xfc61b6){return{'model':db[_0xfc61b6[_0x9700('0x23')]],'as':_0xfc61b6['as'],'attributes':_0xfc61b6[_0x9700('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9700('0xf')](function(_0x5712bd){logger[_0x9700('0x10')](_0x9700('0x26'),_0x971c9f);logger[_0x9700('0x13')](_0x9700('0x26'),_0x971c9f,JSON[_0x9700('0x24')](_0x5712bd));_0x9a6c6f(_0x5712bd);})[_0x9700('0x18')](function(_0x1848f2){logger[_0x9700('0x14')](_0x9700('0x26'),_0x1848f2[_0x9700('0x16')],_0x971c9f);_0x24297c(_0xd17339[_0x9700('0x14')](0x1f4,_0x1848f2[_0x9700('0x16')]));});});};
\ No newline at end of file