Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index b8488e0..3675063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf0b=['attributes','limit','map','include','model','GetVoiceQueue','stringify','ShowVoiceQueue','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','VoiceQueue','findAll','options','where'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xcf0b,0x128));var _0xbcf0=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0xcf0b[_0x448ae2];return _0x4fdd34;};'use strict';var _=require(_0xbcf0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcf0('0x1'));var fs=require('fs');var Redis=require(_0xbcf0('0x2'));var db=require(_0xbcf0('0x3'))['db'];var utils=require(_0xbcf0('0x4'));var logger=require(_0xbcf0('0x5'))(_0xbcf0('0x6'));var config=require(_0xbcf0('0x7'));var jayson=require(_0xbcf0('0x8'));var client=jayson[_0xbcf0('0x9')][_0xbcf0('0xa')]({'port':0x232a});config[_0xbcf0('0xb')]=_[_0xbcf0('0xc')](config['redis'],{'host':_0xbcf0('0xd'),'port':0x18eb});var socket=require(_0xbcf0('0xe'))(new Redis(config['redis']));require(_0xbcf0('0xf'))[_0xbcf0('0x10')](socket);function respondWithRpcPromise(_0x5af75f,_0x58ca8a,_0x563be5){return new BPromise(function(_0x3cc6f0,_0x2cbf11){return client[_0xbcf0('0x11')](_0x5af75f,_0x563be5)[_0xbcf0('0x12')](function(_0x507551){logger[_0xbcf0('0x13')](_0xbcf0('0x14'),_0x58ca8a,_0xbcf0('0x15'));logger[_0xbcf0('0x16')](_0xbcf0('0x17'),_0x58ca8a,_0xbcf0('0x15'),JSON['stringify'](_0x507551));if(_0x507551[_0xbcf0('0x18')]){if(_0x507551[_0xbcf0('0x18')][_0xbcf0('0x19')]===0x1f4){logger[_0xbcf0('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x58ca8a,_0x507551[_0xbcf0('0x18')][_0xbcf0('0x1a')]);return _0x2cbf11(_0x507551[_0xbcf0('0x18')][_0xbcf0('0x1a')]);}logger[_0xbcf0('0x18')](_0xbcf0('0x14'),_0x58ca8a,_0x507551['error'][_0xbcf0('0x1a')]);return _0x3cc6f0(_0x507551[_0xbcf0('0x18')][_0xbcf0('0x1a')]);}else{logger[_0xbcf0('0x13')](_0xbcf0('0x14'),_0x58ca8a,'request\x20sent');_0x3cc6f0(_0x507551['result'][_0xbcf0('0x1a')]);}})[_0xbcf0('0x1b')](function(_0x565e21){logger['error'](_0xbcf0('0x14'),_0x58ca8a,_0x565e21);_0x2cbf11(_0x565e21);});});}exports['GetVoiceQueue']=function(_0x19f4e3){var _0x642214=this;return new Promise(function(_0x487bd7,_0x5905e8){return db[_0xbcf0('0x1c')][_0xbcf0('0x1d')]({'raw':_0x19f4e3['options']?_0x19f4e3[_0xbcf0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x19f4e3[_0xbcf0('0x1e')]?_0x19f4e3[_0xbcf0('0x1e')][_0xbcf0('0x1f')]||null:null,'attributes':_0x19f4e3[_0xbcf0('0x1e')]?_0x19f4e3[_0xbcf0('0x1e')][_0xbcf0('0x20')]||null:null,'limit':_0x19f4e3['options']?_0x19f4e3[_0xbcf0('0x1e')][_0xbcf0('0x21')]||null:null,'include':_0x19f4e3['options']?_0x19f4e3[_0xbcf0('0x1e')]['include']?_[_0xbcf0('0x22')](_0x19f4e3[_0xbcf0('0x1e')][_0xbcf0('0x23')],function(_0x305382){return{'model':db[_0x305382[_0xbcf0('0x24')]],'as':_0x305382['as'],'attributes':_0x305382[_0xbcf0('0x20')],'include':_0x305382[_0xbcf0('0x23')]?_[_0xbcf0('0x22')](_0x305382[_0xbcf0('0x23')],function(_0x35653c){return{'model':db[_0x35653c[_0xbcf0('0x24')]],'as':_0x35653c['as'],'attributes':_0x35653c[_0xbcf0('0x20')],'include':_0x35653c[_0xbcf0('0x23')]?_[_0xbcf0('0x22')](_0x35653c[_0xbcf0('0x23')],function(_0x2192db){return{'model':db[_0x2192db['model']],'as':_0x2192db['as'],'attributes':_0x2192db[_0xbcf0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbcf0('0x12')](function(_0xd698c7){logger[_0xbcf0('0x13')](_0xbcf0('0x25'),_0x19f4e3);logger[_0xbcf0('0x16')]('GetVoiceQueue',_0x19f4e3,JSON[_0xbcf0('0x26')](_0xd698c7));_0x487bd7(_0xd698c7);})['catch'](function(_0x563e6c){logger[_0xbcf0('0x18')]('GetVoiceQueue',_0x563e6c[_0xbcf0('0x1a')],_0x19f4e3);_0x5905e8(_0x642214[_0xbcf0('0x18')](0x1f4,_0x563e6c[_0xbcf0('0x1a')]));});});};exports[_0xbcf0('0x27')]=function(_0x5499b6){var _0x33713f=this;return new Promise(function(_0x489f14,_0x2fdfa7){return db[_0xbcf0('0x1c')][_0xbcf0('0x28')]({'raw':_0x5499b6[_0xbcf0('0x1e')]?_0x5499b6[_0xbcf0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5499b6[_0xbcf0('0x1e')]?_0x5499b6[_0xbcf0('0x1e')][_0xbcf0('0x1f')]||null:null,'attributes':_0x5499b6[_0xbcf0('0x1e')]?_0x5499b6[_0xbcf0('0x1e')][_0xbcf0('0x20')]||null:null,'include':_0x5499b6[_0xbcf0('0x1e')]?_0x5499b6['options'][_0xbcf0('0x23')]?_['map'](_0x5499b6[_0xbcf0('0x1e')][_0xbcf0('0x23')],function(_0x185ed5){return{'model':db[_0x185ed5['model']],'as':_0x185ed5['as'],'attributes':_0x185ed5[_0xbcf0('0x20')],'include':_0x185ed5[_0xbcf0('0x23')]?_[_0xbcf0('0x22')](_0x185ed5[_0xbcf0('0x23')],function(_0x2a7ed8){return{'model':db[_0x2a7ed8[_0xbcf0('0x24')]],'as':_0x2a7ed8['as'],'attributes':_0x2a7ed8['attributes'],'include':_0x2a7ed8[_0xbcf0('0x23')]?_[_0xbcf0('0x22')](_0x2a7ed8[_0xbcf0('0x23')],function(_0x2a11c3){return{'model':db[_0x2a11c3[_0xbcf0('0x24')]],'as':_0x2a11c3['as'],'attributes':_0x2a11c3[_0xbcf0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbcf0('0x12')](function(_0x5e7ee4){logger[_0xbcf0('0x13')]('ShowVoiceQueue',_0x5499b6);logger[_0xbcf0('0x16')](_0xbcf0('0x27'),_0x5499b6,JSON[_0xbcf0('0x26')](_0x5e7ee4));_0x489f14(_0x5e7ee4);})[_0xbcf0('0x1b')](function(_0x192e30){logger[_0xbcf0('0x18')](_0xbcf0('0x27'),_0x192e30['message'],_0x5499b6);_0x2fdfa7(_0x33713f[_0xbcf0('0x18')](0x1f4,_0x192e30['message']));});});};
\ No newline at end of file
+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