Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index 3d7360c..8202216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x630e=['../../config/environment','client','localhost','redis','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','VoiceQueueReport,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','update','body','then','UpdateVoiceQueueReport','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54ce4a,_0x502cba){var _0x279dce=function(_0x217ed8){while(--_0x217ed8){_0x54ce4a['push'](_0x54ce4a['shift']());}};_0x279dce(++_0x502cba);}(_0x630e,0x1e5));var _0xe630=function(_0x18480c,_0x2a940c){_0x18480c=_0x18480c-0x0;var _0x43b4b0=_0x630e[_0x18480c];return _0x43b4b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe630('0x0'));var BPromise=require(_0xe630('0x1'));var rs=require(_0xe630('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require(_0xe630('0x5'))(_0xe630('0x6'));var config=require(_0xe630('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe630('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xe630('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe630('0xa')]));require(_0xe630('0xb'))[_0xe630('0xc')](socket);function respondWithRpcPromise(_0x4353d9,_0x5c98c9,_0x5d6d55){return new BPromise(function(_0x1ddab7,_0x299c30){return client[_0xe630('0xd')](_0x4353d9,_0x5d6d55)['then'](function(_0x220df9){logger[_0xe630('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x5c98c9,_0xe630('0xf'));logger[_0xe630('0x10')](_0xe630('0x11'),_0x5c98c9,_0xe630('0xf'),JSON[_0xe630('0x12')](_0x220df9));if(_0x220df9['error']){if(_0x220df9['error']['code']===0x1f4){logger['error'](_0xe630('0x13'),_0x5c98c9,_0x220df9[_0xe630('0x14')][_0xe630('0x15')]);return _0x299c30(_0x220df9[_0xe630('0x14')]['message']);}logger['error'](_0xe630('0x13'),_0x5c98c9,_0x220df9[_0xe630('0x14')]['message']);return _0x1ddab7(_0x220df9[_0xe630('0x14')][_0xe630('0x15')]);}else{logger[_0xe630('0xe')](_0xe630('0x13'),_0x5c98c9,_0xe630('0xf'));_0x1ddab7(_0x220df9[_0xe630('0x16')][_0xe630('0x15')]);}})[_0xe630('0x17')](function(_0x4c88a4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5c98c9,_0x4c88a4);_0x299c30(_0x4c88a4);});});}exports[_0xe630('0x18')]=function(_0x130b6f){var _0x381d69=this;return new Promise(function(_0x2b72d7,_0x11879b){return db['VoiceQueueReport'][_0xe630('0x19')]({'raw':_0x130b6f[_0xe630('0x1a')]?_0x130b6f[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![],'where':_0x130b6f[_0xe630('0x1a')]?_0x130b6f[_0xe630('0x1a')][_0xe630('0x1c')]||null:null,'attributes':_0x130b6f[_0xe630('0x1a')]?_0x130b6f['options'][_0xe630('0x1d')]||null:null,'limit':_0x130b6f[_0xe630('0x1a')]?_0x130b6f[_0xe630('0x1a')][_0xe630('0x1e')]||null:null,'include':_0x130b6f[_0xe630('0x1a')]?_0x130b6f[_0xe630('0x1a')][_0xe630('0x1f')]?_[_0xe630('0x20')](_0x130b6f[_0xe630('0x1a')][_0xe630('0x1f')],function(_0x182dcc){return{'model':db[_0x182dcc['model']],'as':_0x182dcc['as'],'attributes':_0x182dcc[_0xe630('0x1d')],'include':_0x182dcc[_0xe630('0x1f')]?_[_0xe630('0x20')](_0x182dcc['include'],function(_0x94ecf8){return{'model':db[_0x94ecf8[_0xe630('0x21')]],'as':_0x94ecf8['as'],'attributes':_0x94ecf8[_0xe630('0x1d')],'include':_0x94ecf8[_0xe630('0x1f')]?_['map'](_0x94ecf8[_0xe630('0x1f')],function(_0x305eeb){return{'model':db[_0x305eeb['model']],'as':_0x305eeb['as'],'attributes':_0x305eeb[_0xe630('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x585987){logger[_0xe630('0xe')](_0xe630('0x18'),_0x130b6f);logger[_0xe630('0x10')](_0xe630('0x18'),_0x130b6f,JSON[_0xe630('0x12')](_0x585987));_0x2b72d7(_0x585987);})[_0xe630('0x17')](function(_0x226882){logger[_0xe630('0x14')](_0xe630('0x18'),_0x226882[_0xe630('0x15')],_0x130b6f);_0x11879b(_0x381d69[_0xe630('0x14')](0x1f4,_0x226882[_0xe630('0x15')]));});});};exports[_0xe630('0x22')]=function(_0x5a6942){var _0x12868a=this;return new Promise(function(_0x2dbccd,_0x31129d){return db[_0xe630('0x23')][_0xe630('0x24')](_0x5a6942['body'],{'raw':_0x5a6942[_0xe630('0x1a')]?_0x5a6942[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x15e351){logger[_0xe630('0xe')]('CreateVoiceQueueReport',_0x5a6942);logger['debug'](_0xe630('0x22'),_0x5a6942,JSON[_0xe630('0x12')](_0x15e351));_0x2dbccd(_0x15e351);})[_0xe630('0x17')](function(_0x5acaf2){logger[_0xe630('0x14')](_0xe630('0x22'),_0x5acaf2[_0xe630('0x15')],_0x5a6942);_0x31129d(_0x12868a['error'](0x1f4,_0x5acaf2[_0xe630('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4ca199){var _0x6690f2=this;return new Promise(function(_0x2b79d0,_0x5461b7){return db[_0xe630('0x23')][_0xe630('0x25')](_0x4ca199[_0xe630('0x26')],{'raw':_0x4ca199['options']?_0x4ca199[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca199[_0xe630('0x1a')]?_0x4ca199[_0xe630('0x1a')][_0xe630('0x1c')]||null:null,'attributes':_0x4ca199[_0xe630('0x1a')]?_0x4ca199['options'][_0xe630('0x1d')]||null:null,'limit':_0x4ca199[_0xe630('0x1a')]?_0x4ca199[_0xe630('0x1a')]['limit']||null:null})[_0xe630('0x27')](function(_0x154199){logger['info'](_0xe630('0x28'),_0x4ca199);logger[_0xe630('0x10')]('UpdateVoiceQueueReport',_0x4ca199,JSON['stringify'](_0x154199));_0x2b79d0(_0x154199);})[_0xe630('0x17')](function(_0x4e191a){logger[_0xe630('0x14')](_0xe630('0x28'),_0x4e191a[_0xe630('0x15')],_0x4ca199);_0x5461b7(_0x6690f2[_0xe630('0x14')](0x1f4,_0x4e191a['message']));});});};
\ No newline at end of file
+var _0xb235=['../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','options','raw','where','attributes','include','map','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb235,0x1e6));var _0x5b23=function(_0x338c8c,_0x19df14){_0x338c8c=_0x338c8c-0x0;var _0x371a9a=_0xb235[_0x338c8c];return _0x371a9a;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require(_0x5b23('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require(_0x5b23('0x4'));var db=require(_0x5b23('0x5'))['db'];var utils=require(_0x5b23('0x6'));var logger=require('../../config/logger')(_0x5b23('0x7'));var config=require(_0x5b23('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b23('0x9')]['http']({'port':0x232a});config[_0x5b23('0xa')]=_[_0x5b23('0xb')](config[_0x5b23('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b23('0xc'))(new Redis(config[_0x5b23('0xa')]));require(_0x5b23('0xd'))[_0x5b23('0xe')](socket);function respondWithRpcPromise(_0x372d7a,_0x1bd0e5,_0x350cef){return new BPromise(function(_0x23ef86,_0x395f96){return client['request'](_0x372d7a,_0x350cef)[_0x5b23('0xf')](function(_0x1fc8a8){logger[_0x5b23('0x10')](_0x5b23('0x11'),_0x1bd0e5,_0x5b23('0x12'));logger[_0x5b23('0x13')](_0x5b23('0x14'),_0x1bd0e5,_0x5b23('0x12'),JSON[_0x5b23('0x15')](_0x1fc8a8));if(_0x1fc8a8[_0x5b23('0x16')]){if(_0x1fc8a8[_0x5b23('0x16')][_0x5b23('0x17')]===0x1f4){logger[_0x5b23('0x16')](_0x5b23('0x11'),_0x1bd0e5,_0x1fc8a8[_0x5b23('0x16')][_0x5b23('0x18')]);return _0x395f96(_0x1fc8a8[_0x5b23('0x16')][_0x5b23('0x18')]);}logger['error'](_0x5b23('0x11'),_0x1bd0e5,_0x1fc8a8[_0x5b23('0x16')][_0x5b23('0x18')]);return _0x23ef86(_0x1fc8a8[_0x5b23('0x16')][_0x5b23('0x18')]);}else{logger[_0x5b23('0x10')](_0x5b23('0x11'),_0x1bd0e5,_0x5b23('0x12'));_0x23ef86(_0x1fc8a8[_0x5b23('0x19')][_0x5b23('0x18')]);}})[_0x5b23('0x1a')](function(_0x516a5a){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1bd0e5,_0x516a5a);_0x395f96(_0x516a5a);});});}exports['GetVoiceQueueReport']=function(_0x37e893){var _0x4b5e80=this;return new Promise(function(_0x2d8361,_0x271ca3){return db[_0x5b23('0x1b')]['findAll']({'raw':_0x37e893[_0x5b23('0x1c')]?_0x37e893['options'][_0x5b23('0x1d')]===undefined?!![]:![]:!![],'where':_0x37e893[_0x5b23('0x1c')]?_0x37e893['options'][_0x5b23('0x1e')]||null:null,'attributes':_0x37e893['options']?_0x37e893[_0x5b23('0x1c')][_0x5b23('0x1f')]||null:null,'limit':_0x37e893[_0x5b23('0x1c')]?_0x37e893['options']['limit']||null:null,'include':_0x37e893[_0x5b23('0x1c')]?_0x37e893[_0x5b23('0x1c')][_0x5b23('0x20')]?_[_0x5b23('0x21')](_0x37e893[_0x5b23('0x1c')]['include'],function(_0x47cfff){return{'model':db[_0x47cfff[_0x5b23('0x22')]],'as':_0x47cfff['as'],'attributes':_0x47cfff[_0x5b23('0x1f')],'include':_0x47cfff['include']?_[_0x5b23('0x21')](_0x47cfff[_0x5b23('0x20')],function(_0x5ecdea){return{'model':db[_0x5ecdea[_0x5b23('0x22')]],'as':_0x5ecdea['as'],'attributes':_0x5ecdea[_0x5b23('0x1f')],'include':_0x5ecdea[_0x5b23('0x20')]?_[_0x5b23('0x21')](_0x5ecdea[_0x5b23('0x20')],function(_0x46d6a1){return{'model':db[_0x46d6a1['model']],'as':_0x46d6a1['as'],'attributes':_0x46d6a1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xff2a47){logger[_0x5b23('0x10')](_0x5b23('0x23'),_0x37e893);logger[_0x5b23('0x13')]('GetVoiceQueueReport',_0x37e893,JSON[_0x5b23('0x15')](_0xff2a47));_0x2d8361(_0xff2a47);})[_0x5b23('0x1a')](function(_0x515395){logger[_0x5b23('0x16')](_0x5b23('0x23'),_0x515395[_0x5b23('0x18')],_0x37e893);_0x271ca3(_0x4b5e80[_0x5b23('0x16')](0x1f4,_0x515395[_0x5b23('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x20c0a9){var _0xbc38dd=this;return new Promise(function(_0x5154cf,_0x43aa7b){return db[_0x5b23('0x1b')][_0x5b23('0x24')](_0x20c0a9[_0x5b23('0x25')],{'raw':_0x20c0a9[_0x5b23('0x1c')]?_0x20c0a9[_0x5b23('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5b23('0xf')](function(_0x203549){logger['info'](_0x5b23('0x26'),_0x20c0a9);logger[_0x5b23('0x13')](_0x5b23('0x26'),_0x20c0a9,JSON[_0x5b23('0x15')](_0x203549));_0x5154cf(_0x203549);})[_0x5b23('0x1a')](function(_0x5bcdf2){logger[_0x5b23('0x16')](_0x5b23('0x26'),_0x5bcdf2[_0x5b23('0x18')],_0x20c0a9);_0x43aa7b(_0xbc38dd['error'](0x1f4,_0x5bcdf2[_0x5b23('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x27e40e){var _0x1eb37d=this;return new Promise(function(_0x45b71a,_0x470d90){return db[_0x5b23('0x1b')][_0x5b23('0x27')](_0x27e40e[_0x5b23('0x25')],{'raw':_0x27e40e['options']?_0x27e40e[_0x5b23('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27e40e[_0x5b23('0x1c')]?_0x27e40e[_0x5b23('0x1c')][_0x5b23('0x1e')]||null:null,'attributes':_0x27e40e[_0x5b23('0x1c')]?_0x27e40e[_0x5b23('0x1c')][_0x5b23('0x1f')]||null:null,'limit':_0x27e40e[_0x5b23('0x1c')]?_0x27e40e[_0x5b23('0x1c')]['limit']||null:null})[_0x5b23('0xf')](function(_0x8a3f50){logger[_0x5b23('0x10')]('UpdateVoiceQueueReport',_0x27e40e);logger[_0x5b23('0x13')]('UpdateVoiceQueueReport',_0x27e40e,JSON[_0x5b23('0x15')](_0x8a3f50));_0x45b71a(_0x8a3f50);})[_0x5b23('0x1a')](function(_0x5edb82){logger['error'](_0x5b23('0x28'),_0x5edb82[_0x5b23('0x18')],_0x27e40e);_0x470d90(_0x1eb37d['error'](0x1f4,_0x5edb82['message']));});});};
\ No newline at end of file