Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index 92d2bd7..a0bdb42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','map','include','model','debug','CreateVoiceQueueReport','stringify','update','body','UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./voiceQueueReport.socket'];(function(_0x2ed8fe,_0x237497){var _0x1ca92d=function(_0xf2f15c){while(--_0xf2f15c){_0x2ed8fe['push'](_0x2ed8fe['shift']());}};_0x1ca92d(++_0x237497);}(_0x873a,0x154));var _0xa873=function(_0xee0966,_0x2d49d2){_0xee0966=_0xee0966-0x0;var _0x39ef54=_0x873a[_0xee0966];return _0x39ef54;};'use strict';var _=require(_0xa873('0x0'));var util=require(_0xa873('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa873('0x2'));var fs=require('fs');var Redis=require(_0xa873('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa873('0x4'));var logger=require(_0xa873('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa873('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xa873('0x7')]=_[_0xa873('0x8')](config[_0xa873('0x7')],{'host':_0xa873('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa873('0xa'))[_0xa873('0xb')](socket);function respondWithRpcPromise(_0x1ca8f0,_0x2960d1,_0x578858){return new BPromise(function(_0x25d30d,_0xb7f917){return client[_0xa873('0xc')](_0x1ca8f0,_0x578858)[_0xa873('0xd')](function(_0x382390){logger[_0xa873('0xe')](_0xa873('0xf'),_0x2960d1,_0xa873('0x10'));logger['debug'](_0xa873('0x11'),_0x2960d1,_0xa873('0x10'),JSON['stringify'](_0x382390));if(_0x382390[_0xa873('0x12')]){if(_0x382390[_0xa873('0x12')][_0xa873('0x13')]===0x1f4){logger[_0xa873('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x2960d1,_0x382390[_0xa873('0x12')][_0xa873('0x14')]);return _0xb7f917(_0x382390[_0xa873('0x12')][_0xa873('0x14')]);}logger[_0xa873('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x2960d1,_0x382390[_0xa873('0x12')][_0xa873('0x14')]);return _0x25d30d(_0x382390['error'][_0xa873('0x14')]);}else{logger[_0xa873('0xe')](_0xa873('0xf'),_0x2960d1,_0xa873('0x10'));_0x25d30d(_0x382390[_0xa873('0x15')]['message']);}})[_0xa873('0x16')](function(_0x426ffd){logger['error'](_0xa873('0xf'),_0x2960d1,_0x426ffd);_0xb7f917(_0x426ffd);});});}exports[_0xa873('0x17')]=function(_0x5155ba){var _0x149433=this;return new Promise(function(_0x391466,_0x444a35){return db[_0xa873('0x18')]['findAll']({'raw':_0x5155ba[_0xa873('0x19')]?_0x5155ba[_0xa873('0x19')][_0xa873('0x1a')]===undefined?!![]:![]:!![],'where':_0x5155ba['options']?_0x5155ba[_0xa873('0x19')][_0xa873('0x1b')]||null:null,'attributes':_0x5155ba[_0xa873('0x19')]?_0x5155ba[_0xa873('0x19')][_0xa873('0x1c')]||null:null,'limit':_0x5155ba['options']?_0x5155ba[_0xa873('0x19')][_0xa873('0x1d')]||null:null,'include':_0x5155ba[_0xa873('0x19')]?_0x5155ba[_0xa873('0x19')]['include']?_[_0xa873('0x1e')](_0x5155ba[_0xa873('0x19')][_0xa873('0x1f')],function(_0x3d0b0a){return{'model':db[_0x3d0b0a[_0xa873('0x20')]],'as':_0x3d0b0a['as'],'attributes':_0x3d0b0a[_0xa873('0x1c')],'include':_0x3d0b0a[_0xa873('0x1f')]?_['map'](_0x3d0b0a[_0xa873('0x1f')],function(_0x33cbd7){return{'model':db[_0x33cbd7[_0xa873('0x20')]],'as':_0x33cbd7['as'],'attributes':_0x33cbd7[_0xa873('0x1c')],'include':_0x33cbd7[_0xa873('0x1f')]?_[_0xa873('0x1e')](_0x33cbd7[_0xa873('0x1f')],function(_0x9ea420){return{'model':db[_0x9ea420[_0xa873('0x20')]],'as':_0x9ea420['as'],'attributes':_0x9ea420[_0xa873('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa873('0xd')](function(_0x3a47a1){logger[_0xa873('0xe')]('GetVoiceQueueReport',_0x5155ba);logger[_0xa873('0x21')]('GetVoiceQueueReport',_0x5155ba,JSON['stringify'](_0x3a47a1));_0x391466(_0x3a47a1);})[_0xa873('0x16')](function(_0x274b2d){logger['error']('GetVoiceQueueReport',_0x274b2d['message'],_0x5155ba);_0x444a35(_0x149433[_0xa873('0x12')](0x1f4,_0x274b2d['message']));});});};exports[_0xa873('0x22')]=function(_0x570d76){var _0x1227b7=this;return new Promise(function(_0x2ae6ba,_0x5a61d3){return db['VoiceQueueReport']['create'](_0x570d76['body'],{'raw':_0x570d76[_0xa873('0x19')]?_0x570d76[_0xa873('0x19')][_0xa873('0x1a')]===undefined?!![]:![]:!![]})[_0xa873('0xd')](function(_0x41ea58){logger['info'](_0xa873('0x22'),_0x570d76);logger[_0xa873('0x21')](_0xa873('0x22'),_0x570d76,JSON[_0xa873('0x23')](_0x41ea58));_0x2ae6ba(_0x41ea58);})[_0xa873('0x16')](function(_0x18fd30){logger['error'](_0xa873('0x22'),_0x18fd30[_0xa873('0x14')],_0x570d76);_0x5a61d3(_0x1227b7[_0xa873('0x12')](0x1f4,_0x18fd30['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x314c5a){var _0x360db0=this;return new Promise(function(_0xbaebb4,_0x119415){return db[_0xa873('0x18')][_0xa873('0x24')](_0x314c5a[_0xa873('0x25')],{'raw':_0x314c5a[_0xa873('0x19')]?_0x314c5a[_0xa873('0x19')][_0xa873('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x314c5a['options']?_0x314c5a['options']['where']||null:null,'attributes':_0x314c5a['options']?_0x314c5a[_0xa873('0x19')][_0xa873('0x1c')]||null:null,'limit':_0x314c5a[_0xa873('0x19')]?_0x314c5a['options']['limit']||null:null})['then'](function(_0x428ef2){logger['info']('UpdateVoiceQueueReport',_0x314c5a);logger[_0xa873('0x21')](_0xa873('0x26'),_0x314c5a,JSON[_0xa873('0x23')](_0x428ef2));_0xbaebb4(_0x428ef2);})[_0xa873('0x16')](function(_0x130dcc){logger['error'](_0xa873('0x26'),_0x130dcc[_0xa873('0x14')],_0x314c5a);_0x119415(_0x360db0['error'](0x1f4,_0x130dcc[_0xa873('0x14')]));});});};
\ No newline at end of file
+var _0xfa47=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','map','model','stringify','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x11610f,_0x3e32de){var _0xdc16fc=function(_0x3f23a6){while(--_0x3f23a6){_0x11610f['push'](_0x11610f['shift']());}};_0xdc16fc(++_0x3e32de);}(_0xfa47,0x13f));var _0x7fa4=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0xfa47[_0x2e0ffa];return _0x24d627;};'use strict';var _=require(_0x7fa4('0x0'));var util=require('util');var moment=require(_0x7fa4('0x1'));var BPromise=require(_0x7fa4('0x2'));var rs=require(_0x7fa4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fa4('0x4'))['db'];var utils=require(_0x7fa4('0x5'));var logger=require('../../config/logger')(_0x7fa4('0x6'));var config=require('../../config/environment');var jayson=require(_0x7fa4('0x7'));var client=jayson[_0x7fa4('0x8')][_0x7fa4('0x9')]({'port':0x232a});config[_0x7fa4('0xa')]=_[_0x7fa4('0xb')](config[_0x7fa4('0xa')],{'host':_0x7fa4('0xc'),'port':0x18eb});var socket=require(_0x7fa4('0xd'))(new Redis(config[_0x7fa4('0xa')]));require(_0x7fa4('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a915a,_0x5be8e9,_0x40023e){return new BPromise(function(_0x366db6,_0x184a0b){return client['request'](_0x4a915a,_0x40023e)[_0x7fa4('0xf')](function(_0x5ae1c4){logger[_0x7fa4('0x10')](_0x7fa4('0x11'),_0x5be8e9,_0x7fa4('0x12'));logger[_0x7fa4('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x5be8e9,_0x7fa4('0x12'),JSON['stringify'](_0x5ae1c4));if(_0x5ae1c4[_0x7fa4('0x14')]){if(_0x5ae1c4['error']['code']===0x1f4){logger[_0x7fa4('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x5be8e9,_0x5ae1c4[_0x7fa4('0x14')][_0x7fa4('0x15')]);return _0x184a0b(_0x5ae1c4[_0x7fa4('0x14')]['message']);}logger['error'](_0x7fa4('0x11'),_0x5be8e9,_0x5ae1c4[_0x7fa4('0x14')][_0x7fa4('0x15')]);return _0x366db6(_0x5ae1c4[_0x7fa4('0x14')][_0x7fa4('0x15')]);}else{logger[_0x7fa4('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x5be8e9,_0x7fa4('0x12'));_0x366db6(_0x5ae1c4[_0x7fa4('0x16')][_0x7fa4('0x15')]);}})['catch'](function(_0x2f9526){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5be8e9,_0x2f9526);_0x184a0b(_0x2f9526);});});}exports[_0x7fa4('0x17')]=function(_0x389350){var _0x2fa657=this;return new Promise(function(_0x2b5ac0,_0x2ab447){return db[_0x7fa4('0x18')][_0x7fa4('0x19')]({'raw':_0x389350['options']?_0x389350[_0x7fa4('0x1a')][_0x7fa4('0x1b')]===undefined?!![]:![]:!![],'where':_0x389350['options']?_0x389350[_0x7fa4('0x1a')]['where']||null:null,'attributes':_0x389350[_0x7fa4('0x1a')]?_0x389350[_0x7fa4('0x1a')][_0x7fa4('0x1c')]||null:null,'limit':_0x389350[_0x7fa4('0x1a')]?_0x389350['options']['limit']||null:null,'include':_0x389350['options']?_0x389350[_0x7fa4('0x1a')][_0x7fa4('0x1d')]?_[_0x7fa4('0x1e')](_0x389350[_0x7fa4('0x1a')][_0x7fa4('0x1d')],function(_0x1118d3){return{'model':db[_0x1118d3[_0x7fa4('0x1f')]],'as':_0x1118d3['as'],'attributes':_0x1118d3[_0x7fa4('0x1c')],'include':_0x1118d3[_0x7fa4('0x1d')]?_[_0x7fa4('0x1e')](_0x1118d3[_0x7fa4('0x1d')],function(_0xd6cc8){return{'model':db[_0xd6cc8[_0x7fa4('0x1f')]],'as':_0xd6cc8['as'],'attributes':_0xd6cc8['attributes'],'include':_0xd6cc8['include']?_[_0x7fa4('0x1e')](_0xd6cc8[_0x7fa4('0x1d')],function(_0x42f974){return{'model':db[_0x42f974[_0x7fa4('0x1f')]],'as':_0x42f974['as'],'attributes':_0x42f974[_0x7fa4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7fa4('0xf')](function(_0x5d2486){logger[_0x7fa4('0x10')](_0x7fa4('0x17'),_0x389350);logger[_0x7fa4('0x13')](_0x7fa4('0x17'),_0x389350,JSON[_0x7fa4('0x20')](_0x5d2486));_0x2b5ac0(_0x5d2486);})[_0x7fa4('0x21')](function(_0x440c50){logger[_0x7fa4('0x14')](_0x7fa4('0x17'),_0x440c50[_0x7fa4('0x15')],_0x389350);_0x2ab447(_0x2fa657['error'](0x1f4,_0x440c50[_0x7fa4('0x15')]));});});};exports[_0x7fa4('0x22')]=function(_0x127b8a){var _0xa028a=this;return new Promise(function(_0x4279c2,_0x5f4f2a){return db[_0x7fa4('0x18')][_0x7fa4('0x23')](_0x127b8a[_0x7fa4('0x24')],{'raw':_0x127b8a['options']?_0x127b8a[_0x7fa4('0x1a')][_0x7fa4('0x1b')]===undefined?!![]:![]:!![]})[_0x7fa4('0xf')](function(_0x33858f){logger[_0x7fa4('0x10')]('CreateVoiceQueueReport',_0x127b8a);logger[_0x7fa4('0x13')](_0x7fa4('0x22'),_0x127b8a,JSON[_0x7fa4('0x20')](_0x33858f));_0x4279c2(_0x33858f);})[_0x7fa4('0x21')](function(_0x22e738){logger[_0x7fa4('0x14')]('CreateVoiceQueueReport',_0x22e738['message'],_0x127b8a);_0x5f4f2a(_0xa028a[_0x7fa4('0x14')](0x1f4,_0x22e738[_0x7fa4('0x15')]));});});};exports[_0x7fa4('0x25')]=function(_0x2df81f){var _0x3fb373=this;return new Promise(function(_0x350eb1,_0x26249a){return db[_0x7fa4('0x18')][_0x7fa4('0x26')](_0x2df81f[_0x7fa4('0x24')],{'raw':_0x2df81f['options']?_0x2df81f[_0x7fa4('0x1a')][_0x7fa4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2df81f['options']?_0x2df81f[_0x7fa4('0x1a')][_0x7fa4('0x27')]||null:null,'attributes':_0x2df81f[_0x7fa4('0x1a')]?_0x2df81f['options'][_0x7fa4('0x1c')]||null:null,'limit':_0x2df81f['options']?_0x2df81f[_0x7fa4('0x1a')][_0x7fa4('0x28')]||null:null})[_0x7fa4('0xf')](function(_0x2653e6){logger['info'](_0x7fa4('0x25'),_0x2df81f);logger[_0x7fa4('0x13')](_0x7fa4('0x25'),_0x2df81f,JSON[_0x7fa4('0x20')](_0x2653e6));_0x350eb1(_0x2653e6);})['catch'](function(_0x34283a){logger[_0x7fa4('0x14')](_0x7fa4('0x25'),_0x34283a[_0x7fa4('0x15')],_0x2df81f);_0x26249a(_0x3fb373['error'](0x1f4,_0x34283a['message']));});});};
\ No newline at end of file