Built motion from commit 5293bb2a.|2.6.30
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index 1a47739..f987824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b5=['map','model','GetVoiceQueue','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','VoiceQueue','findAll','options','raw','where','attributes','include'];(function(_0x30b315,_0x198dd8){var _0x3e95f6=function(_0x3e01e6){while(--_0x3e01e6){_0x30b315['push'](_0x30b315['shift']());}};_0x3e95f6(++_0x198dd8);}(_0x86b5,0x180));var _0x586b=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x86b5[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x586b('0x0'));var util=require(_0x586b('0x1'));var moment=require(_0x586b('0x2'));var BPromise=require(_0x586b('0x3'));var rs=require(_0x586b('0x4'));var fs=require('fs');var Redis=require(_0x586b('0x5'));var db=require(_0x586b('0x6'))['db'];var utils=require(_0x586b('0x7'));var logger=require(_0x586b('0x8'))(_0x586b('0x9'));var config=require(_0x586b('0xa'));var jayson=require(_0x586b('0xb'));var client=jayson[_0x586b('0xc')][_0x586b('0xd')]({'port':0x232a});config['redis']=_[_0x586b('0xe')](config[_0x586b('0xf')],{'host':_0x586b('0x10'),'port':0x18eb});var socket=require(_0x586b('0x11'))(new Redis(config[_0x586b('0xf')]));require(_0x586b('0x12'))['register'](socket);function respondWithRpcPromise(_0x4cc61b,_0x288595,_0x5f34c0){return new BPromise(function(_0x2a16b2,_0x5d617b){return client[_0x586b('0x13')](_0x4cc61b,_0x5f34c0)[_0x586b('0x14')](function(_0x57adde){logger['info'](_0x586b('0x15'),_0x288595,_0x586b('0x16'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x288595,'request\x20sent',JSON[_0x586b('0x17')](_0x57adde));if(_0x57adde[_0x586b('0x18')]){if(_0x57adde[_0x586b('0x18')]['code']===0x1f4){logger['error'](_0x586b('0x15'),_0x288595,_0x57adde[_0x586b('0x18')][_0x586b('0x19')]);return _0x5d617b(_0x57adde[_0x586b('0x18')][_0x586b('0x19')]);}logger[_0x586b('0x18')](_0x586b('0x15'),_0x288595,_0x57adde[_0x586b('0x18')][_0x586b('0x19')]);return _0x2a16b2(_0x57adde[_0x586b('0x18')][_0x586b('0x19')]);}else{logger[_0x586b('0x1a')](_0x586b('0x15'),_0x288595,'request\x20sent');_0x2a16b2(_0x57adde[_0x586b('0x1b')][_0x586b('0x19')]);}})[_0x586b('0x1c')](function(_0x178656){logger['error'](_0x586b('0x15'),_0x288595,_0x178656);_0x5d617b(_0x178656);});});}exports['GetVoiceQueue']=function(_0x8458fa){var _0x5f6941=this;return new Promise(function(_0x5afb56,_0x23d789){return db[_0x586b('0x1d')][_0x586b('0x1e')]({'raw':_0x8458fa['options']?_0x8458fa[_0x586b('0x1f')][_0x586b('0x20')]===undefined?!![]:![]:!![],'where':_0x8458fa['options']?_0x8458fa[_0x586b('0x1f')][_0x586b('0x21')]||null:null,'attributes':_0x8458fa[_0x586b('0x1f')]?_0x8458fa['options'][_0x586b('0x22')]||null:null,'limit':_0x8458fa[_0x586b('0x1f')]?_0x8458fa[_0x586b('0x1f')]['limit']||null:null,'include':_0x8458fa[_0x586b('0x1f')]?_0x8458fa[_0x586b('0x1f')][_0x586b('0x23')]?_[_0x586b('0x24')](_0x8458fa[_0x586b('0x1f')]['include'],function(_0x5c820b){return{'model':db[_0x5c820b['model']],'as':_0x5c820b['as'],'attributes':_0x5c820b[_0x586b('0x22')],'include':_0x5c820b[_0x586b('0x23')]?_[_0x586b('0x24')](_0x5c820b[_0x586b('0x23')],function(_0x23d173){return{'model':db[_0x23d173[_0x586b('0x25')]],'as':_0x23d173['as'],'attributes':_0x23d173['attributes'],'include':_0x23d173['include']?_[_0x586b('0x24')](_0x23d173['include'],function(_0x18988e){return{'model':db[_0x18988e[_0x586b('0x25')]],'as':_0x18988e['as'],'attributes':_0x18988e[_0x586b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x586b('0x14')](function(_0x130bcb){logger['info'](_0x586b('0x26'),_0x8458fa);logger[_0x586b('0x27')](_0x586b('0x26'),_0x8458fa,JSON[_0x586b('0x17')](_0x130bcb));_0x5afb56(_0x130bcb);})[_0x586b('0x1c')](function(_0x49a41d){logger[_0x586b('0x18')](_0x586b('0x26'),_0x49a41d['message'],_0x8458fa);_0x23d789(_0x5f6941[_0x586b('0x18')](0x1f4,_0x49a41d[_0x586b('0x19')]));});});};exports[_0x586b('0x28')]=function(_0x429894){var _0x57fe8b=this;return new Promise(function(_0xbed42a,_0x5741be){return db[_0x586b('0x1d')][_0x586b('0x29')]({'raw':_0x429894[_0x586b('0x1f')]?_0x429894[_0x586b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x429894['options']?_0x429894[_0x586b('0x1f')][_0x586b('0x21')]||null:null,'attributes':_0x429894[_0x586b('0x1f')]?_0x429894['options'][_0x586b('0x22')]||null:null,'include':_0x429894[_0x586b('0x1f')]?_0x429894[_0x586b('0x1f')]['include']?_[_0x586b('0x24')](_0x429894[_0x586b('0x1f')]['include'],function(_0x200810){return{'model':db[_0x200810['model']],'as':_0x200810['as'],'attributes':_0x200810[_0x586b('0x22')],'include':_0x200810[_0x586b('0x23')]?_[_0x586b('0x24')](_0x200810['include'],function(_0x48ed33){return{'model':db[_0x48ed33[_0x586b('0x25')]],'as':_0x48ed33['as'],'attributes':_0x48ed33[_0x586b('0x22')],'include':_0x48ed33['include']?_[_0x586b('0x24')](_0x48ed33[_0x586b('0x23')],function(_0x10cf42){return{'model':db[_0x10cf42[_0x586b('0x25')]],'as':_0x10cf42['as'],'attributes':_0x10cf42[_0x586b('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d5ecd){logger['info'](_0x586b('0x28'),_0x429894);logger[_0x586b('0x27')]('ShowVoiceQueue',_0x429894,JSON[_0x586b('0x17')](_0x5d5ecd));_0xbed42a(_0x5d5ecd);})[_0x586b('0x1c')](function(_0x247e82){logger['error']('ShowVoiceQueue',_0x247e82[_0x586b('0x19')],_0x429894);_0x5741be(_0x57fe8b[_0x586b('0x18')](0x1f4,_0x247e82[_0x586b('0x19')]));});});};
\ No newline at end of file
+var _0x367a=['then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','findAll','options','raw','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./voiceQueue.socket','register','request'];(function(_0xbc1c93,_0x30351e){var _0x49204e=function(_0x36f8a7){while(--_0x36f8a7){_0xbc1c93['push'](_0xbc1c93['shift']());}};_0x49204e(++_0x30351e);}(_0x367a,0xf5));var _0xa367=function(_0x56a38e,_0x42856d){_0x56a38e=_0x56a38e-0x0;var _0x51faa2=_0x367a[_0x56a38e];return _0x51faa2;};'use strict';var _=require(_0xa367('0x0'));var util=require(_0xa367('0x1'));var moment=require(_0xa367('0x2'));var BPromise=require(_0xa367('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa367('0x4'))['db'];var utils=require(_0xa367('0x5'));var logger=require(_0xa367('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa367('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa367('0x8')]=_[_0xa367('0x9')](config[_0xa367('0x8')],{'host':_0xa367('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa367('0x8')]));require(_0xa367('0xb'))[_0xa367('0xc')](socket);function respondWithRpcPromise(_0x2207e9,_0xf42c76,_0x4a2fff){return new BPromise(function(_0x53c8b0,_0x2bd446){return client[_0xa367('0xd')](_0x2207e9,_0x4a2fff)[_0xa367('0xe')](function(_0x41cca0){logger[_0xa367('0xf')]('VoiceQueue,\x20%s,\x20%s',_0xf42c76,'request\x20sent');logger[_0xa367('0x10')](_0xa367('0x11'),_0xf42c76,_0xa367('0x12'),JSON[_0xa367('0x13')](_0x41cca0));if(_0x41cca0['error']){if(_0x41cca0[_0xa367('0x14')][_0xa367('0x15')]===0x1f4){logger[_0xa367('0x14')](_0xa367('0x16'),_0xf42c76,_0x41cca0[_0xa367('0x14')]['message']);return _0x2bd446(_0x41cca0[_0xa367('0x14')][_0xa367('0x17')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0xf42c76,_0x41cca0[_0xa367('0x14')]['message']);return _0x53c8b0(_0x41cca0[_0xa367('0x14')][_0xa367('0x17')]);}else{logger[_0xa367('0xf')](_0xa367('0x16'),_0xf42c76,_0xa367('0x12'));_0x53c8b0(_0x41cca0['result'][_0xa367('0x17')]);}})[_0xa367('0x18')](function(_0x1781a7){logger[_0xa367('0x14')](_0xa367('0x16'),_0xf42c76,_0x1781a7);_0x2bd446(_0x1781a7);});});}exports[_0xa367('0x19')]=function(_0x5984f3){var _0x4534d6=this;return new Promise(function(_0x538532,_0x3afe8c){return db['VoiceQueue'][_0xa367('0x1a')]({'raw':_0x5984f3[_0xa367('0x1b')]?_0x5984f3[_0xa367('0x1b')][_0xa367('0x1c')]===undefined?!![]:![]:!![],'where':_0x5984f3[_0xa367('0x1b')]?_0x5984f3[_0xa367('0x1b')]['where']||null:null,'attributes':_0x5984f3['options']?_0x5984f3[_0xa367('0x1b')][_0xa367('0x1d')]||null:null,'limit':_0x5984f3[_0xa367('0x1b')]?_0x5984f3['options'][_0xa367('0x1e')]||null:null,'include':_0x5984f3[_0xa367('0x1b')]?_0x5984f3['options'][_0xa367('0x1f')]?_[_0xa367('0x20')](_0x5984f3[_0xa367('0x1b')][_0xa367('0x1f')],function(_0x490c94){return{'model':db[_0x490c94[_0xa367('0x21')]],'as':_0x490c94['as'],'attributes':_0x490c94['attributes'],'include':_0x490c94[_0xa367('0x1f')]?_[_0xa367('0x20')](_0x490c94[_0xa367('0x1f')],function(_0x774a3f){return{'model':db[_0x774a3f[_0xa367('0x21')]],'as':_0x774a3f['as'],'attributes':_0x774a3f[_0xa367('0x1d')],'include':_0x774a3f['include']?_[_0xa367('0x20')](_0x774a3f[_0xa367('0x1f')],function(_0x33219f){return{'model':db[_0x33219f['model']],'as':_0x33219f['as'],'attributes':_0x33219f[_0xa367('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa367('0xe')](function(_0xa93489){logger[_0xa367('0xf')](_0xa367('0x19'),_0x5984f3);logger[_0xa367('0x10')](_0xa367('0x19'),_0x5984f3,JSON['stringify'](_0xa93489));_0x538532(_0xa93489);})[_0xa367('0x18')](function(_0x47c538){logger[_0xa367('0x14')](_0xa367('0x19'),_0x47c538[_0xa367('0x17')],_0x5984f3);_0x3afe8c(_0x4534d6[_0xa367('0x14')](0x1f4,_0x47c538[_0xa367('0x17')]));});});};exports[_0xa367('0x22')]=function(_0x1957af){var _0x512935=this;return new Promise(function(_0x5b0699,_0x69c030){return db[_0xa367('0x23')]['find']({'raw':_0x1957af[_0xa367('0x1b')]?_0x1957af[_0xa367('0x1b')][_0xa367('0x1c')]===undefined?!![]:![]:!![],'where':_0x1957af[_0xa367('0x1b')]?_0x1957af[_0xa367('0x1b')][_0xa367('0x24')]||null:null,'attributes':_0x1957af[_0xa367('0x1b')]?_0x1957af[_0xa367('0x1b')][_0xa367('0x1d')]||null:null,'include':_0x1957af[_0xa367('0x1b')]?_0x1957af['options'][_0xa367('0x1f')]?_[_0xa367('0x20')](_0x1957af[_0xa367('0x1b')][_0xa367('0x1f')],function(_0x4acfe2){return{'model':db[_0x4acfe2[_0xa367('0x21')]],'as':_0x4acfe2['as'],'attributes':_0x4acfe2[_0xa367('0x1d')],'include':_0x4acfe2[_0xa367('0x1f')]?_[_0xa367('0x20')](_0x4acfe2[_0xa367('0x1f')],function(_0x4794cf){return{'model':db[_0x4794cf['model']],'as':_0x4794cf['as'],'attributes':_0x4794cf['attributes'],'include':_0x4794cf[_0xa367('0x1f')]?_[_0xa367('0x20')](_0x4794cf['include'],function(_0x138fb6){return{'model':db[_0x138fb6[_0xa367('0x21')]],'as':_0x138fb6['as'],'attributes':_0x138fb6[_0xa367('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477cd8){logger[_0xa367('0xf')](_0xa367('0x22'),_0x1957af);logger['debug'](_0xa367('0x22'),_0x1957af,JSON[_0xa367('0x13')](_0x477cd8));_0x5b0699(_0x477cd8);})[_0xa367('0x18')](function(_0x2529c0){logger[_0xa367('0x14')](_0xa367('0x22'),_0x2529c0[_0xa367('0x17')],_0x1957af);_0x69c030(_0x512935['error'](0x1f4,_0x2529c0[_0xa367('0x17')]));});});};
\ No newline at end of file