Built motion from commit d9028345.|2.5.43
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index b12b5d1..4cb1d90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f73=['lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','attributes','map','model','then','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','body'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x5f73,0xf0));var _0x35f7=function(_0x1438d9,_0x1e5380){_0x1438d9=_0x1438d9-0x0;var _0x3ae3eb=_0x5f73[_0x1438d9];return _0x3ae3eb;};'use strict';var _=require(_0x35f7('0x0'));var util=require('util');var moment=require(_0x35f7('0x1'));var BPromise=require(_0x35f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35f7('0x3'))['db'];var utils=require(_0x35f7('0x4'));var logger=require(_0x35f7('0x5'))(_0x35f7('0x6'));var config=require(_0x35f7('0x7'));var jayson=require(_0x35f7('0x8'));var client=jayson[_0x35f7('0x9')][_0x35f7('0xa')]({'port':0x232a});config[_0x35f7('0xb')]=_['defaults'](config[_0x35f7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x35f7('0xc'))(new Redis(config[_0x35f7('0xb')]));require(_0x35f7('0xd'))[_0x35f7('0xe')](socket);function respondWithRpcPromise(_0x2d9daa,_0x2fa967,_0x24f081){return new BPromise(function(_0x231ce1,_0x58edac){return client[_0x35f7('0xf')](_0x2d9daa,_0x24f081)['then'](function(_0x41d292){logger[_0x35f7('0x10')](_0x35f7('0x11'),_0x2fa967,_0x35f7('0x12'));logger[_0x35f7('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2fa967,'request\x20sent',JSON[_0x35f7('0x14')](_0x41d292));if(_0x41d292[_0x35f7('0x15')]){if(_0x41d292[_0x35f7('0x15')]['code']===0x1f4){logger[_0x35f7('0x15')](_0x35f7('0x11'),_0x2fa967,_0x41d292[_0x35f7('0x15')][_0x35f7('0x16')]);return _0x58edac(_0x41d292[_0x35f7('0x15')][_0x35f7('0x16')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2fa967,_0x41d292[_0x35f7('0x15')]['message']);return _0x231ce1(_0x41d292['error'][_0x35f7('0x16')]);}else{logger[_0x35f7('0x10')](_0x35f7('0x11'),_0x2fa967,_0x35f7('0x12'));_0x231ce1(_0x41d292[_0x35f7('0x17')][_0x35f7('0x16')]);}})[_0x35f7('0x18')](function(_0x74b01d){logger[_0x35f7('0x15')](_0x35f7('0x11'),_0x2fa967,_0x74b01d);_0x58edac(_0x74b01d);});});}exports[_0x35f7('0x19')]=function(_0x105909){var _0x4fff76=this;return new Promise(function(_0xd78df1,_0x18d7b9){return db[_0x35f7('0x1a')]['findAll']({'raw':_0x105909[_0x35f7('0x1b')]?_0x105909['options'][_0x35f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x105909[_0x35f7('0x1b')]?_0x105909[_0x35f7('0x1b')][_0x35f7('0x1d')]||null:null,'attributes':_0x105909[_0x35f7('0x1b')]?_0x105909['options']['attributes']||null:null,'limit':_0x105909[_0x35f7('0x1b')]?_0x105909[_0x35f7('0x1b')][_0x35f7('0x1e')]||null:null,'include':_0x105909[_0x35f7('0x1b')]?_0x105909[_0x35f7('0x1b')][_0x35f7('0x1f')]?_['map'](_0x105909['options'][_0x35f7('0x1f')],function(_0x4fb4c4){return{'model':db[_0x4fb4c4['model']],'as':_0x4fb4c4['as'],'attributes':_0x4fb4c4[_0x35f7('0x20')],'include':_0x4fb4c4[_0x35f7('0x1f')]?_[_0x35f7('0x21')](_0x4fb4c4['include'],function(_0x404894){return{'model':db[_0x404894[_0x35f7('0x22')]],'as':_0x404894['as'],'attributes':_0x404894[_0x35f7('0x20')],'include':_0x404894[_0x35f7('0x1f')]?_[_0x35f7('0x21')](_0x404894[_0x35f7('0x1f')],function(_0x1bba3d){return{'model':db[_0x1bba3d[_0x35f7('0x22')]],'as':_0x1bba3d['as'],'attributes':_0x1bba3d[_0x35f7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x35f7('0x23')](function(_0xb61ed9){logger[_0x35f7('0x10')](_0x35f7('0x19'),_0x105909);logger[_0x35f7('0x13')](_0x35f7('0x19'),_0x105909,JSON[_0x35f7('0x14')](_0xb61ed9));_0xd78df1(_0xb61ed9);})[_0x35f7('0x18')](function(_0x20bc7e){logger['error'](_0x35f7('0x19'),_0x20bc7e[_0x35f7('0x16')],_0x105909);_0x18d7b9(_0x4fff76[_0x35f7('0x15')](0x1f4,_0x20bc7e[_0x35f7('0x16')]));});});};exports[_0x35f7('0x24')]=function(_0x48e749){var _0x2d1a5e=this;return new Promise(function(_0x2d36fd,_0x341506){return db[_0x35f7('0x1a')][_0x35f7('0x25')](_0x48e749['body'],{'raw':_0x48e749[_0x35f7('0x1b')]?_0x48e749[_0x35f7('0x1b')][_0x35f7('0x1c')]===undefined?!![]:![]:!![]})[_0x35f7('0x23')](function(_0x1cd1de){logger['info']('CreateVoiceQueueReport',_0x48e749);logger['debug'](_0x35f7('0x24'),_0x48e749,JSON[_0x35f7('0x14')](_0x1cd1de));_0x2d36fd(_0x1cd1de);})['catch'](function(_0x277975){logger[_0x35f7('0x15')]('CreateVoiceQueueReport',_0x277975[_0x35f7('0x16')],_0x48e749);_0x341506(_0x2d1a5e[_0x35f7('0x15')](0x1f4,_0x277975[_0x35f7('0x16')]));});});};exports[_0x35f7('0x26')]=function(_0x12355d){var _0x5d5997=this;return new Promise(function(_0x23b48e,_0x4ad339){return db[_0x35f7('0x1a')]['update'](_0x12355d[_0x35f7('0x27')],{'raw':_0x12355d['options']?_0x12355d[_0x35f7('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12355d[_0x35f7('0x1b')]?_0x12355d[_0x35f7('0x1b')]['where']||null:null,'attributes':_0x12355d[_0x35f7('0x1b')]?_0x12355d[_0x35f7('0x1b')][_0x35f7('0x20')]||null:null,'limit':_0x12355d[_0x35f7('0x1b')]?_0x12355d['options'][_0x35f7('0x1e')]||null:null})[_0x35f7('0x23')](function(_0x2fa5c9){logger[_0x35f7('0x10')](_0x35f7('0x26'),_0x12355d);logger[_0x35f7('0x13')](_0x35f7('0x26'),_0x12355d,JSON[_0x35f7('0x14')](_0x2fa5c9));_0x23b48e(_0x2fa5c9);})[_0x35f7('0x18')](function(_0x209648){logger['error'](_0x35f7('0x26'),_0x209648[_0x35f7('0x16')],_0x12355d);_0x4ad339(_0x5d5997[_0x35f7('0x15')](0x1f4,_0x209648['message']));});});};
\ No newline at end of file
+var _0x314a=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','error','code','message','result','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','GetVoiceQueueReport','catch','create','body','raw','CreateVoiceQueueReport','stringify','update','where','UpdateVoiceQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x314a,0x1d3));var _0xa314=function(_0x230bb8,_0xa1718){_0x230bb8=_0x230bb8-0x0;var _0x16cb9a=_0x314a[_0x230bb8];return _0x16cb9a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa314('0x0'));var BPromise=require(_0xa314('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa314('0x2'));var db=require(_0xa314('0x3'))['db'];var utils=require(_0xa314('0x4'));var logger=require(_0xa314('0x5'))(_0xa314('0x6'));var config=require(_0xa314('0x7'));var jayson=require(_0xa314('0x8'));var client=jayson[_0xa314('0x9')][_0xa314('0xa')]({'port':0x232a});config[_0xa314('0xb')]=_[_0xa314('0xc')](config[_0xa314('0xb')],{'host':_0xa314('0xd'),'port':0x18eb});var socket=require(_0xa314('0xe'))(new Redis(config[_0xa314('0xb')]));require('./voiceQueueReport.socket')[_0xa314('0xf')](socket);function respondWithRpcPromise(_0x1f46f2,_0x4bc1d9,_0x13ac61){return new BPromise(function(_0x2fd95d,_0x125413){return client[_0xa314('0x10')](_0x1f46f2,_0x13ac61)[_0xa314('0x11')](function(_0x34f35b){logger[_0xa314('0x12')](_0xa314('0x13'),_0x4bc1d9,'request\x20sent');logger[_0xa314('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4bc1d9,'request\x20sent',JSON['stringify'](_0x34f35b));if(_0x34f35b[_0xa314('0x15')]){if(_0x34f35b[_0xa314('0x15')][_0xa314('0x16')]===0x1f4){logger[_0xa314('0x15')](_0xa314('0x13'),_0x4bc1d9,_0x34f35b[_0xa314('0x15')][_0xa314('0x17')]);return _0x125413(_0x34f35b[_0xa314('0x15')]['message']);}logger[_0xa314('0x15')](_0xa314('0x13'),_0x4bc1d9,_0x34f35b['error'][_0xa314('0x17')]);return _0x2fd95d(_0x34f35b[_0xa314('0x15')][_0xa314('0x17')]);}else{logger[_0xa314('0x12')](_0xa314('0x13'),_0x4bc1d9,'request\x20sent');_0x2fd95d(_0x34f35b[_0xa314('0x18')][_0xa314('0x17')]);}})['catch'](function(_0x34cecc){logger[_0xa314('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x4bc1d9,_0x34cecc);_0x125413(_0x34cecc);});});}exports['GetVoiceQueueReport']=function(_0x401ea2){var _0x4c1dc6=this;return new Promise(function(_0x3c368c,_0x50c7d4){return db[_0xa314('0x19')][_0xa314('0x1a')]({'raw':_0x401ea2['options']?_0x401ea2[_0xa314('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x401ea2[_0xa314('0x1b')]?_0x401ea2[_0xa314('0x1b')]['where']||null:null,'attributes':_0x401ea2[_0xa314('0x1b')]?_0x401ea2['options'][_0xa314('0x1c')]||null:null,'limit':_0x401ea2[_0xa314('0x1b')]?_0x401ea2[_0xa314('0x1b')][_0xa314('0x1d')]||null:null,'include':_0x401ea2['options']?_0x401ea2[_0xa314('0x1b')]['include']?_[_0xa314('0x1e')](_0x401ea2[_0xa314('0x1b')][_0xa314('0x1f')],function(_0x1d7e16){return{'model':db[_0x1d7e16[_0xa314('0x20')]],'as':_0x1d7e16['as'],'attributes':_0x1d7e16[_0xa314('0x1c')],'include':_0x1d7e16[_0xa314('0x1f')]?_['map'](_0x1d7e16[_0xa314('0x1f')],function(_0x4f4a1c){return{'model':db[_0x4f4a1c[_0xa314('0x20')]],'as':_0x4f4a1c['as'],'attributes':_0x4f4a1c[_0xa314('0x1c')],'include':_0x4f4a1c[_0xa314('0x1f')]?_[_0xa314('0x1e')](_0x4f4a1c[_0xa314('0x1f')],function(_0x3e348e){return{'model':db[_0x3e348e[_0xa314('0x20')]],'as':_0x3e348e['as'],'attributes':_0x3e348e[_0xa314('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa314('0x11')](function(_0x2f2274){logger['info'](_0xa314('0x21'),_0x401ea2);logger['debug'](_0xa314('0x21'),_0x401ea2,JSON['stringify'](_0x2f2274));_0x3c368c(_0x2f2274);})[_0xa314('0x22')](function(_0x40e8bf){logger[_0xa314('0x15')](_0xa314('0x21'),_0x40e8bf[_0xa314('0x17')],_0x401ea2);_0x50c7d4(_0x4c1dc6[_0xa314('0x15')](0x1f4,_0x40e8bf[_0xa314('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x46bc57){var _0x3b54bd=this;return new Promise(function(_0x6fba98,_0x386425){return db[_0xa314('0x19')][_0xa314('0x23')](_0x46bc57[_0xa314('0x24')],{'raw':_0x46bc57['options']?_0x46bc57['options'][_0xa314('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x56c88d){logger['info'](_0xa314('0x26'),_0x46bc57);logger[_0xa314('0x14')](_0xa314('0x26'),_0x46bc57,JSON[_0xa314('0x27')](_0x56c88d));_0x6fba98(_0x56c88d);})[_0xa314('0x22')](function(_0x377adc){logger['error']('CreateVoiceQueueReport',_0x377adc[_0xa314('0x17')],_0x46bc57);_0x386425(_0x3b54bd[_0xa314('0x15')](0x1f4,_0x377adc[_0xa314('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2f6ced){var _0x256c15=this;return new Promise(function(_0x520b33,_0x216ca3){return db[_0xa314('0x19')][_0xa314('0x28')](_0x2f6ced['body'],{'raw':_0x2f6ced['options']?_0x2f6ced[_0xa314('0x1b')][_0xa314('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f6ced['options']?_0x2f6ced['options'][_0xa314('0x29')]||null:null,'attributes':_0x2f6ced[_0xa314('0x1b')]?_0x2f6ced[_0xa314('0x1b')][_0xa314('0x1c')]||null:null,'limit':_0x2f6ced[_0xa314('0x1b')]?_0x2f6ced[_0xa314('0x1b')][_0xa314('0x1d')]||null:null})[_0xa314('0x11')](function(_0x52d907){logger[_0xa314('0x12')](_0xa314('0x2a'),_0x2f6ced);logger[_0xa314('0x14')]('UpdateVoiceQueueReport',_0x2f6ced,JSON[_0xa314('0x27')](_0x52d907));_0x520b33(_0x52d907);})[_0xa314('0x22')](function(_0x49c804){logger[_0xa314('0x15')]('UpdateVoiceQueueReport',_0x49c804[_0xa314('0x17')],_0x2f6ced);_0x216ca3(_0x256c15[_0xa314('0x15')](0x1f4,_0x49c804[_0xa314('0x17')]));});});};
\ No newline at end of file