Built motion from commit 21186556.|2.6.19
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index 6ca5d0b..245ab63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe58f=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x47302c,_0x5ce3cf){var _0x483028=function(_0x5ab314){while(--_0x5ab314){_0x47302c['push'](_0x47302c['shift']());}};_0x483028(++_0x5ce3cf);}(_0xe58f,0x1aa));var _0xfe58=function(_0x1cbd26,_0x422a57){_0x1cbd26=_0x1cbd26-0x0;var _0xa0e185=_0xe58f[_0x1cbd26];return _0xa0e185;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe58('0x0'));var BPromise=require('bluebird');var rs=require(_0xfe58('0x1'));var fs=require('fs');var Redis=require(_0xfe58('0x2'));var db=require(_0xfe58('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe58('0x4'));var config=require(_0xfe58('0x5'));var jayson=require(_0xfe58('0x6'));var client=jayson['client'][_0xfe58('0x7')]({'port':0x232a});config[_0xfe58('0x8')]=_[_0xfe58('0x9')](config['redis'],{'host':_0xfe58('0xa'),'port':0x18eb});var socket=require(_0xfe58('0xb'))(new Redis(config[_0xfe58('0x8')]));require(_0xfe58('0xc'))[_0xfe58('0xd')](socket);function respondWithRpcPromise(_0x1fe079,_0x5e5b98,_0x1c3669){return new BPromise(function(_0x388b87,_0x141b5d){return client[_0xfe58('0xe')](_0x1fe079,_0x1c3669)[_0xfe58('0xf')](function(_0x56a1ff){logger[_0xfe58('0x10')](_0xfe58('0x11'),_0x5e5b98,_0xfe58('0x12'));logger['debug'](_0xfe58('0x13'),_0x5e5b98,_0xfe58('0x12'),JSON[_0xfe58('0x14')](_0x56a1ff));if(_0x56a1ff['error']){if(_0x56a1ff[_0xfe58('0x15')][_0xfe58('0x16')]===0x1f4){logger[_0xfe58('0x15')](_0xfe58('0x11'),_0x5e5b98,_0x56a1ff[_0xfe58('0x15')][_0xfe58('0x17')]);return _0x141b5d(_0x56a1ff[_0xfe58('0x15')][_0xfe58('0x17')]);}logger['error'](_0xfe58('0x11'),_0x5e5b98,_0x56a1ff['error'][_0xfe58('0x17')]);return _0x388b87(_0x56a1ff[_0xfe58('0x15')][_0xfe58('0x17')]);}else{logger[_0xfe58('0x10')](_0xfe58('0x11'),_0x5e5b98,_0xfe58('0x12'));_0x388b87(_0x56a1ff[_0xfe58('0x18')][_0xfe58('0x17')]);}})[_0xfe58('0x19')](function(_0xac285e){logger[_0xfe58('0x15')](_0xfe58('0x11'),_0x5e5b98,_0xac285e);_0x141b5d(_0xac285e);});});}exports[_0xfe58('0x1a')]=function(_0x38b994){var _0x304693=this;return new Promise(function(_0x396a0f,_0x12668b){return db[_0xfe58('0x1b')][_0xfe58('0x1c')]({'raw':_0x38b994[_0xfe58('0x1d')]?_0x38b994[_0xfe58('0x1d')][_0xfe58('0x1e')]===undefined?!![]:![]:!![],'where':_0x38b994[_0xfe58('0x1d')]?_0x38b994[_0xfe58('0x1d')][_0xfe58('0x1f')]||null:null,'attributes':_0x38b994[_0xfe58('0x1d')]?_0x38b994[_0xfe58('0x1d')][_0xfe58('0x20')]||null:null,'limit':_0x38b994[_0xfe58('0x1d')]?_0x38b994[_0xfe58('0x1d')][_0xfe58('0x21')]||null:null,'include':_0x38b994[_0xfe58('0x1d')]?_0x38b994[_0xfe58('0x1d')][_0xfe58('0x22')]?_[_0xfe58('0x23')](_0x38b994[_0xfe58('0x1d')][_0xfe58('0x22')],function(_0x3f0007){return{'model':db[_0x3f0007['model']],'as':_0x3f0007['as'],'attributes':_0x3f0007[_0xfe58('0x20')],'include':_0x3f0007['include']?_[_0xfe58('0x23')](_0x3f0007[_0xfe58('0x22')],function(_0x180daf){return{'model':db[_0x180daf['model']],'as':_0x180daf['as'],'attributes':_0x180daf[_0xfe58('0x20')],'include':_0x180daf['include']?_[_0xfe58('0x23')](_0x180daf[_0xfe58('0x22')],function(_0x3e543e){return{'model':db[_0x3e543e[_0xfe58('0x24')]],'as':_0x3e543e['as'],'attributes':_0x3e543e['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe58('0xf')](function(_0x1dd9d6){logger['info'](_0xfe58('0x1a'),_0x38b994);logger[_0xfe58('0x25')](_0xfe58('0x1a'),_0x38b994,JSON['stringify'](_0x1dd9d6));_0x396a0f(_0x1dd9d6);})[_0xfe58('0x19')](function(_0x12b6d4){logger[_0xfe58('0x15')](_0xfe58('0x1a'),_0x12b6d4[_0xfe58('0x17')],_0x38b994);_0x12668b(_0x304693[_0xfe58('0x15')](0x1f4,_0x12b6d4[_0xfe58('0x17')]));});});};exports[_0xfe58('0x26')]=function(_0x1c17bc){var _0x506e6e=this;return new Promise(function(_0x575ae4,_0x2cc652){return db['VoiceQueueReport']['create'](_0x1c17bc[_0xfe58('0x27')],{'raw':_0x1c17bc[_0xfe58('0x1d')]?_0x1c17bc[_0xfe58('0x1d')][_0xfe58('0x1e')]===undefined?!![]:![]:!![]})[_0xfe58('0xf')](function(_0x209bbb){logger['info'](_0xfe58('0x26'),_0x1c17bc);logger[_0xfe58('0x25')](_0xfe58('0x26'),_0x1c17bc,JSON[_0xfe58('0x14')](_0x209bbb));_0x575ae4(_0x209bbb);})[_0xfe58('0x19')](function(_0x6e6024){logger[_0xfe58('0x15')]('CreateVoiceQueueReport',_0x6e6024[_0xfe58('0x17')],_0x1c17bc);_0x2cc652(_0x506e6e[_0xfe58('0x15')](0x1f4,_0x6e6024[_0xfe58('0x17')]));});});};exports[_0xfe58('0x28')]=function(_0x410250){var _0x148ec2=this;return new Promise(function(_0x1cbe17,_0x5b2e60){return db[_0xfe58('0x1b')]['update'](_0x410250[_0xfe58('0x27')],{'raw':_0x410250['options']?_0x410250[_0xfe58('0x1d')][_0xfe58('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x410250[_0xfe58('0x1d')]?_0x410250[_0xfe58('0x1d')][_0xfe58('0x1f')]||null:null,'attributes':_0x410250['options']?_0x410250[_0xfe58('0x1d')][_0xfe58('0x20')]||null:null,'limit':_0x410250['options']?_0x410250[_0xfe58('0x1d')][_0xfe58('0x21')]||null:null})[_0xfe58('0xf')](function(_0x465be5){logger[_0xfe58('0x10')](_0xfe58('0x28'),_0x410250);logger[_0xfe58('0x25')](_0xfe58('0x28'),_0x410250,JSON[_0xfe58('0x14')](_0x465be5));_0x1cbe17(_0x465be5);})['catch'](function(_0x11d861){logger[_0xfe58('0x15')](_0xfe58('0x28'),_0x11d861[_0xfe58('0x17')],_0x410250);_0x5b2e60(_0x148ec2['error'](0x1f4,_0x11d861['message']));});});};
\ No newline at end of file
+var _0x121f=['UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','then','body','debug','CreateVoiceQueueReport'];(function(_0x37bcec,_0x4aaf70){var _0x56c135=function(_0x3e442d){while(--_0x3e442d){_0x37bcec['push'](_0x37bcec['shift']());}};_0x56c135(++_0x4aaf70);}(_0x121f,0x1ee));var _0xf121=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x121f[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0xf121('0x0'));var util=require(_0xf121('0x1'));var moment=require(_0xf121('0x2'));var BPromise=require(_0xf121('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf121('0x4'));var db=require(_0xf121('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf121('0x6'));var jayson=require(_0xf121('0x7'));var client=jayson['client'][_0xf121('0x8')]({'port':0x232a});config[_0xf121('0x9')]=_[_0xf121('0xa')](config[_0xf121('0x9')],{'host':_0xf121('0xb'),'port':0x18eb});var socket=require(_0xf121('0xc'))(new Redis(config[_0xf121('0x9')]));require(_0xf121('0xd'))[_0xf121('0xe')](socket);function respondWithRpcPromise(_0x3abfe6,_0x132489,_0x3fba11){return new BPromise(function(_0x56663b,_0x1e6e03){return client['request'](_0x3abfe6,_0x3fba11)['then'](function(_0xcdaafd){logger[_0xf121('0xf')](_0xf121('0x10'),_0x132489,_0xf121('0x11'));logger['debug'](_0xf121('0x12'),_0x132489,_0xf121('0x11'),JSON[_0xf121('0x13')](_0xcdaafd));if(_0xcdaafd[_0xf121('0x14')]){if(_0xcdaafd[_0xf121('0x14')][_0xf121('0x15')]===0x1f4){logger['error'](_0xf121('0x10'),_0x132489,_0xcdaafd['error']['message']);return _0x1e6e03(_0xcdaafd[_0xf121('0x14')][_0xf121('0x16')]);}logger[_0xf121('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x132489,_0xcdaafd[_0xf121('0x14')][_0xf121('0x16')]);return _0x56663b(_0xcdaafd['error'][_0xf121('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x132489,_0xf121('0x11'));_0x56663b(_0xcdaafd[_0xf121('0x17')][_0xf121('0x16')]);}})[_0xf121('0x18')](function(_0x22d00a){logger[_0xf121('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x132489,_0x22d00a);_0x1e6e03(_0x22d00a);});});}exports[_0xf121('0x19')]=function(_0x3e9a54){var _0x581f11=this;return new Promise(function(_0x13b755,_0x28b160){return db[_0xf121('0x1a')][_0xf121('0x1b')]({'raw':_0x3e9a54['options']?_0x3e9a54[_0xf121('0x1c')][_0xf121('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e9a54[_0xf121('0x1c')]?_0x3e9a54[_0xf121('0x1c')][_0xf121('0x1e')]||null:null,'attributes':_0x3e9a54[_0xf121('0x1c')]?_0x3e9a54['options'][_0xf121('0x1f')]||null:null,'limit':_0x3e9a54['options']?_0x3e9a54[_0xf121('0x1c')]['limit']||null:null,'include':_0x3e9a54['options']?_0x3e9a54['options'][_0xf121('0x20')]?_[_0xf121('0x21')](_0x3e9a54[_0xf121('0x1c')]['include'],function(_0x4bec5c){return{'model':db[_0x4bec5c[_0xf121('0x22')]],'as':_0x4bec5c['as'],'attributes':_0x4bec5c[_0xf121('0x1f')],'include':_0x4bec5c[_0xf121('0x20')]?_['map'](_0x4bec5c[_0xf121('0x20')],function(_0x43a3bd){return{'model':db[_0x43a3bd[_0xf121('0x22')]],'as':_0x43a3bd['as'],'attributes':_0x43a3bd[_0xf121('0x1f')],'include':_0x43a3bd[_0xf121('0x20')]?_[_0xf121('0x21')](_0x43a3bd[_0xf121('0x20')],function(_0x15b9b4){return{'model':db[_0x15b9b4[_0xf121('0x22')]],'as':_0x15b9b4['as'],'attributes':_0x15b9b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xf121('0x23')](function(_0x285010){logger[_0xf121('0xf')](_0xf121('0x19'),_0x3e9a54);logger['debug'](_0xf121('0x19'),_0x3e9a54,JSON[_0xf121('0x13')](_0x285010));_0x13b755(_0x285010);})[_0xf121('0x18')](function(_0x5705e2){logger[_0xf121('0x14')](_0xf121('0x19'),_0x5705e2['message'],_0x3e9a54);_0x28b160(_0x581f11['error'](0x1f4,_0x5705e2['message']));});});};exports['CreateVoiceQueueReport']=function(_0x50c9da){var _0x25dd57=this;return new Promise(function(_0x54c52d,_0xb2e1a7){return db['VoiceQueueReport']['create'](_0x50c9da[_0xf121('0x24')],{'raw':_0x50c9da['options']?_0x50c9da[_0xf121('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2a7d75){logger[_0xf121('0xf')]('CreateVoiceQueueReport',_0x50c9da);logger[_0xf121('0x25')](_0xf121('0x26'),_0x50c9da,JSON[_0xf121('0x13')](_0x2a7d75));_0x54c52d(_0x2a7d75);})['catch'](function(_0x4bf187){logger[_0xf121('0x14')](_0xf121('0x26'),_0x4bf187[_0xf121('0x16')],_0x50c9da);_0xb2e1a7(_0x25dd57[_0xf121('0x14')](0x1f4,_0x4bf187[_0xf121('0x16')]));});});};exports[_0xf121('0x27')]=function(_0x389252){var _0x444858=this;return new Promise(function(_0x127dec,_0x3c07a6){return db[_0xf121('0x1a')][_0xf121('0x28')](_0x389252[_0xf121('0x24')],{'raw':_0x389252[_0xf121('0x1c')]?_0x389252[_0xf121('0x1c')][_0xf121('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x389252[_0xf121('0x1c')]?_0x389252[_0xf121('0x1c')][_0xf121('0x1e')]||null:null,'attributes':_0x389252['options']?_0x389252[_0xf121('0x1c')][_0xf121('0x1f')]||null:null,'limit':_0x389252[_0xf121('0x1c')]?_0x389252[_0xf121('0x1c')]['limit']||null:null})[_0xf121('0x23')](function(_0x2fb581){logger[_0xf121('0xf')](_0xf121('0x27'),_0x389252);logger['debug'](_0xf121('0x27'),_0x389252,JSON[_0xf121('0x13')](_0x2fb581));_0x127dec(_0x2fb581);})[_0xf121('0x18')](function(_0x1eabe4){logger['error'](_0xf121('0x27'),_0x1eabe4[_0xf121('0x16')],_0x389252);_0x3c07a6(_0x444858[_0xf121('0x14')](0x1f4,_0x1eabe4[_0xf121('0x16')]));});});};
\ No newline at end of file