Built motion from commit fade34fd.|2.5.41
[motion2.git] / server / api / voiceQueue / voiceQueue.rpc.js
index dafb91e..d9ee481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9340=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','map','include','model','attributes','info','ShowVoiceQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37e50a,_0x1a5087){var _0x28312f=function(_0x5c8c4f){while(--_0x5c8c4f){_0x37e50a['push'](_0x37e50a['shift']());}};_0x28312f(++_0x1a5087);}(_0x9340,0xf6));var _0x0934=function(_0x107a96,_0x18f680){_0x107a96=_0x107a96-0x0;var _0x3b6459=_0x9340[_0x107a96];return _0x3b6459;};'use strict';var _=require('lodash');var util=require(_0x0934('0x0'));var moment=require(_0x0934('0x1'));var BPromise=require(_0x0934('0x2'));var rs=require(_0x0934('0x3'));var fs=require('fs');var Redis=require(_0x0934('0x4'));var db=require(_0x0934('0x5'))['db'];var utils=require(_0x0934('0x6'));var logger=require(_0x0934('0x7'))(_0x0934('0x8'));var config=require(_0x0934('0x9'));var jayson=require(_0x0934('0xa'));var client=jayson[_0x0934('0xb')][_0x0934('0xc')]({'port':0x232a});config['redis']=_[_0x0934('0xd')](config[_0x0934('0xe')],{'host':_0x0934('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0934('0x10'))[_0x0934('0x11')](socket);function respondWithRpcPromise(_0xc10d72,_0x31e36e,_0x303a00){return new BPromise(function(_0x3458ef,_0x32253a){return client[_0x0934('0x12')](_0xc10d72,_0x303a00)[_0x0934('0x13')](function(_0x1b2032){logger['info'](_0x0934('0x14'),_0x31e36e,_0x0934('0x15'));logger[_0x0934('0x16')](_0x0934('0x17'),_0x31e36e,_0x0934('0x15'),JSON[_0x0934('0x18')](_0x1b2032));if(_0x1b2032[_0x0934('0x19')]){if(_0x1b2032[_0x0934('0x19')][_0x0934('0x1a')]===0x1f4){logger[_0x0934('0x19')](_0x0934('0x14'),_0x31e36e,_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);return _0x32253a(_0x1b2032['error'][_0x0934('0x1b')]);}logger[_0x0934('0x19')](_0x0934('0x14'),_0x31e36e,_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);return _0x3458ef(_0x1b2032[_0x0934('0x19')][_0x0934('0x1b')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x31e36e,_0x0934('0x15'));_0x3458ef(_0x1b2032['result'][_0x0934('0x1b')]);}})[_0x0934('0x1c')](function(_0x4a534b){logger['error'](_0x0934('0x14'),_0x31e36e,_0x4a534b);_0x32253a(_0x4a534b);});});}exports[_0x0934('0x1d')]=function(_0x1b20f2){var _0x3cd7e7=this;return new Promise(function(_0x3106a8,_0x410a5f){return db[_0x0934('0x1e')][_0x0934('0x1f')]({'raw':_0x1b20f2['options']?_0x1b20f2[_0x0934('0x20')][_0x0934('0x21')]===undefined?!![]:![]:!![],'where':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')][_0x0934('0x22')]||null:null,'attributes':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')]['attributes']||null:null,'limit':_0x1b20f2[_0x0934('0x20')]?_0x1b20f2[_0x0934('0x20')]['limit']||null:null,'include':_0x1b20f2['options']?_0x1b20f2['options']['include']?_[_0x0934('0x23')](_0x1b20f2[_0x0934('0x20')][_0x0934('0x24')],function(_0x202f47){return{'model':db[_0x202f47[_0x0934('0x25')]],'as':_0x202f47['as'],'attributes':_0x202f47[_0x0934('0x26')],'include':_0x202f47['include']?_[_0x0934('0x23')](_0x202f47[_0x0934('0x24')],function(_0xdb7baa){return{'model':db[_0xdb7baa[_0x0934('0x25')]],'as':_0xdb7baa['as'],'attributes':_0xdb7baa[_0x0934('0x26')],'include':_0xdb7baa[_0x0934('0x24')]?_[_0x0934('0x23')](_0xdb7baa[_0x0934('0x24')],function(_0x474419){return{'model':db[_0x474419[_0x0934('0x25')]],'as':_0x474419['as'],'attributes':_0x474419[_0x0934('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46863d){logger[_0x0934('0x27')](_0x0934('0x1d'),_0x1b20f2);logger[_0x0934('0x16')]('GetVoiceQueue',_0x1b20f2,JSON['stringify'](_0x46863d));_0x3106a8(_0x46863d);})[_0x0934('0x1c')](function(_0x350107){logger[_0x0934('0x19')]('GetVoiceQueue',_0x350107[_0x0934('0x1b')],_0x1b20f2);_0x410a5f(_0x3cd7e7[_0x0934('0x19')](0x1f4,_0x350107['message']));});});};exports[_0x0934('0x28')]=function(_0x38edd2){var _0x45abbc=this;return new Promise(function(_0x574fb1,_0x5c8ec8){return db[_0x0934('0x1e')][_0x0934('0x29')]({'raw':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x21')]===undefined?!![]:![]:!![],'where':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x22')]||null:null,'attributes':_0x38edd2[_0x0934('0x20')]?_0x38edd2[_0x0934('0x20')][_0x0934('0x26')]||null:null,'include':_0x38edd2[_0x0934('0x20')]?_0x38edd2['options'][_0x0934('0x24')]?_[_0x0934('0x23')](_0x38edd2[_0x0934('0x20')]['include'],function(_0x663bca){return{'model':db[_0x663bca[_0x0934('0x25')]],'as':_0x663bca['as'],'attributes':_0x663bca['attributes'],'include':_0x663bca[_0x0934('0x24')]?_[_0x0934('0x23')](_0x663bca[_0x0934('0x24')],function(_0x2713ab){return{'model':db[_0x2713ab[_0x0934('0x25')]],'as':_0x2713ab['as'],'attributes':_0x2713ab['attributes'],'include':_0x2713ab[_0x0934('0x24')]?_[_0x0934('0x23')](_0x2713ab['include'],function(_0x295762){return{'model':db[_0x295762['model']],'as':_0x295762['as'],'attributes':_0x295762[_0x0934('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x392ce2){logger[_0x0934('0x27')]('ShowVoiceQueue',_0x38edd2);logger['debug'](_0x0934('0x28'),_0x38edd2,JSON[_0x0934('0x18')](_0x392ce2));_0x574fb1(_0x392ce2);})[_0x0934('0x1c')](function(_0x421925){logger['error'](_0x0934('0x28'),_0x421925[_0x0934('0x1b')],_0x38edd2);_0x5c8ec8(_0x45abbc[_0x0934('0x19')](0x1f4,_0x421925[_0x0934('0x1b')]));});});};
\ No newline at end of file
+var _0x1a84=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','info','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','catch','ShowVoiceQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4a6fa9,_0x22299c){var _0x3809c0=function(_0x44e112){while(--_0x44e112){_0x4a6fa9['push'](_0x4a6fa9['shift']());}};_0x3809c0(++_0x22299c);}(_0x1a84,0x122));var _0x41a8=function(_0x19d172,_0x21bf9b){_0x19d172=_0x19d172-0x0;var _0x4e1ccd=_0x1a84[_0x19d172];return _0x4e1ccd;};'use strict';var _=require(_0x41a8('0x0'));var util=require('util');var moment=require(_0x41a8('0x1'));var BPromise=require('bluebird');var rs=require(_0x41a8('0x2'));var fs=require('fs');var Redis=require(_0x41a8('0x3'));var db=require(_0x41a8('0x4'))['db'];var utils=require(_0x41a8('0x5'));var logger=require(_0x41a8('0x6'))(_0x41a8('0x7'));var config=require(_0x41a8('0x8'));var jayson=require(_0x41a8('0x9'));var client=jayson[_0x41a8('0xa')][_0x41a8('0xb')]({'port':0x232a});config[_0x41a8('0xc')]=_[_0x41a8('0xd')](config['redis'],{'host':_0x41a8('0xe'),'port':0x18eb});var socket=require(_0x41a8('0xf'))(new Redis(config[_0x41a8('0xc')]));require(_0x41a8('0x10'))[_0x41a8('0x11')](socket);function respondWithRpcPromise(_0x212918,_0x46e616,_0x28fd18){return new BPromise(function(_0x2836ce,_0x339014){return client[_0x41a8('0x12')](_0x212918,_0x28fd18)[_0x41a8('0x13')](function(_0x33ea4d){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x46e616,_0x41a8('0x14'));logger['debug'](_0x41a8('0x15'),_0x46e616,_0x41a8('0x14'),JSON[_0x41a8('0x16')](_0x33ea4d));if(_0x33ea4d['error']){if(_0x33ea4d['error']['code']===0x1f4){logger[_0x41a8('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x46e616,_0x33ea4d[_0x41a8('0x17')][_0x41a8('0x18')]);return _0x339014(_0x33ea4d[_0x41a8('0x17')][_0x41a8('0x18')]);}logger[_0x41a8('0x17')](_0x41a8('0x19'),_0x46e616,_0x33ea4d['error'][_0x41a8('0x18')]);return _0x2836ce(_0x33ea4d[_0x41a8('0x17')][_0x41a8('0x18')]);}else{logger[_0x41a8('0x1a')](_0x41a8('0x19'),_0x46e616,_0x41a8('0x14'));_0x2836ce(_0x33ea4d[_0x41a8('0x1b')][_0x41a8('0x18')]);}})['catch'](function(_0xcee6e1){logger[_0x41a8('0x17')](_0x41a8('0x19'),_0x46e616,_0xcee6e1);_0x339014(_0xcee6e1);});});}exports[_0x41a8('0x1c')]=function(_0x1913a9){var _0x5df85a=this;return new Promise(function(_0x2c144a,_0x4b97df){return db[_0x41a8('0x1d')][_0x41a8('0x1e')]({'raw':_0x1913a9[_0x41a8('0x1f')]?_0x1913a9[_0x41a8('0x1f')][_0x41a8('0x20')]===undefined?!![]:![]:!![],'where':_0x1913a9[_0x41a8('0x1f')]?_0x1913a9[_0x41a8('0x1f')][_0x41a8('0x21')]||null:null,'attributes':_0x1913a9[_0x41a8('0x1f')]?_0x1913a9[_0x41a8('0x1f')]['attributes']||null:null,'limit':_0x1913a9['options']?_0x1913a9[_0x41a8('0x1f')][_0x41a8('0x22')]||null:null,'include':_0x1913a9[_0x41a8('0x1f')]?_0x1913a9[_0x41a8('0x1f')][_0x41a8('0x23')]?_[_0x41a8('0x24')](_0x1913a9[_0x41a8('0x1f')][_0x41a8('0x23')],function(_0x43d4a6){return{'model':db[_0x43d4a6[_0x41a8('0x25')]],'as':_0x43d4a6['as'],'attributes':_0x43d4a6[_0x41a8('0x26')],'include':_0x43d4a6[_0x41a8('0x23')]?_['map'](_0x43d4a6[_0x41a8('0x23')],function(_0x3a9370){return{'model':db[_0x3a9370[_0x41a8('0x25')]],'as':_0x3a9370['as'],'attributes':_0x3a9370[_0x41a8('0x26')],'include':_0x3a9370[_0x41a8('0x23')]?_[_0x41a8('0x24')](_0x3a9370['include'],function(_0x2b206c){return{'model':db[_0x2b206c['model']],'as':_0x2b206c['as'],'attributes':_0x2b206c[_0x41a8('0x26')]};}):[]};}):[]};}):[]:[]})[_0x41a8('0x13')](function(_0x3fd592){logger[_0x41a8('0x1a')](_0x41a8('0x1c'),_0x1913a9);logger[_0x41a8('0x27')](_0x41a8('0x1c'),_0x1913a9,JSON['stringify'](_0x3fd592));_0x2c144a(_0x3fd592);})[_0x41a8('0x28')](function(_0x2e9499){logger['error'](_0x41a8('0x1c'),_0x2e9499[_0x41a8('0x18')],_0x1913a9);_0x4b97df(_0x5df85a[_0x41a8('0x17')](0x1f4,_0x2e9499['message']));});});};exports[_0x41a8('0x29')]=function(_0xf3dd59){var _0x467723=this;return new Promise(function(_0x104577,_0x329080){return db[_0x41a8('0x1d')][_0x41a8('0x2a')]({'raw':_0xf3dd59[_0x41a8('0x1f')]?_0xf3dd59['options'][_0x41a8('0x20')]===undefined?!![]:![]:!![],'where':_0xf3dd59[_0x41a8('0x1f')]?_0xf3dd59[_0x41a8('0x1f')][_0x41a8('0x21')]||null:null,'attributes':_0xf3dd59[_0x41a8('0x1f')]?_0xf3dd59[_0x41a8('0x1f')][_0x41a8('0x26')]||null:null,'include':_0xf3dd59[_0x41a8('0x1f')]?_0xf3dd59['options'][_0x41a8('0x23')]?_[_0x41a8('0x24')](_0xf3dd59[_0x41a8('0x1f')][_0x41a8('0x23')],function(_0x575611){return{'model':db[_0x575611['model']],'as':_0x575611['as'],'attributes':_0x575611[_0x41a8('0x26')],'include':_0x575611[_0x41a8('0x23')]?_[_0x41a8('0x24')](_0x575611[_0x41a8('0x23')],function(_0x41465f){return{'model':db[_0x41465f['model']],'as':_0x41465f['as'],'attributes':_0x41465f['attributes'],'include':_0x41465f[_0x41a8('0x23')]?_[_0x41a8('0x24')](_0x41465f['include'],function(_0x292bfd){return{'model':db[_0x292bfd[_0x41a8('0x25')]],'as':_0x292bfd['as'],'attributes':_0x292bfd[_0x41a8('0x26')]};}):[]};}):[]};}):[]:[]})[_0x41a8('0x13')](function(_0x24de3f){logger[_0x41a8('0x1a')]('ShowVoiceQueue',_0xf3dd59);logger[_0x41a8('0x27')](_0x41a8('0x29'),_0xf3dd59,JSON['stringify'](_0x24de3f));_0x104577(_0x24de3f);})['catch'](function(_0x3e4b7c){logger[_0x41a8('0x17')]('ShowVoiceQueue',_0x3e4b7c['message'],_0xf3dd59);_0x329080(_0x467723[_0x41a8('0x17')](0x1f4,_0x3e4b7c[_0x41a8('0x18')]));});});};
\ No newline at end of file