Built motion from commit (unavailable).|2.4.9
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index aa3f04f..e399576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8725=['CreateVoiceQueueReport','UpdateVoiceQueueReport','where','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','limit','include','map','model','attributes','then','create','body'];(function(_0xedb41a,_0x27de87){var _0x171b0d=function(_0x7bb56f){while(--_0x7bb56f){_0xedb41a['push'](_0xedb41a['shift']());}};_0x171b0d(++_0x27de87);}(_0x8725,0xd0));var _0x5872=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x8725[_0x18f152];return _0xa10b34;};'use strict';var _=require('lodash');var util=require(_0x5872('0x0'));var moment=require('moment');var BPromise=require(_0x5872('0x1'));var rs=require(_0x5872('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5872('0x3'));var logger=require(_0x5872('0x4'))(_0x5872('0x5'));var config=require('../../config/environment');var jayson=require(_0x5872('0x6'));var client=jayson[_0x5872('0x7')][_0x5872('0x8')]({'port':0x232a});config[_0x5872('0x9')]=_[_0x5872('0xa')](config['redis'],{'host':_0x5872('0xb'),'port':0x18eb});var socket=require(_0x5872('0xc'))(new Redis(config[_0x5872('0x9')]));require(_0x5872('0xd'))[_0x5872('0xe')](socket);function respondWithRpcPromise(_0x5aaa74,_0x1d8461,_0xcdfa94){return new BPromise(function(_0x219823,_0x1b58ac){return client[_0x5872('0xf')](_0x5aaa74,_0xcdfa94)['then'](function(_0x382af3){logger[_0x5872('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d8461,_0x5872('0x11'));logger[_0x5872('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1d8461,_0x5872('0x11'),JSON[_0x5872('0x13')](_0x382af3));if(_0x382af3['error']){if(_0x382af3[_0x5872('0x14')][_0x5872('0x15')]===0x1f4){logger[_0x5872('0x14')](_0x5872('0x16'),_0x1d8461,_0x382af3[_0x5872('0x14')][_0x5872('0x17')]);return _0x1b58ac(_0x382af3[_0x5872('0x14')][_0x5872('0x17')]);}logger[_0x5872('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d8461,_0x382af3[_0x5872('0x14')][_0x5872('0x17')]);return _0x219823(_0x382af3['error'][_0x5872('0x17')]);}else{logger[_0x5872('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x1d8461,_0x5872('0x11'));_0x219823(_0x382af3[_0x5872('0x18')][_0x5872('0x17')]);}})[_0x5872('0x19')](function(_0x3d8c78){logger[_0x5872('0x14')](_0x5872('0x16'),_0x1d8461,_0x3d8c78);_0x1b58ac(_0x3d8c78);});});}exports[_0x5872('0x1a')]=function(_0x213d9d){var _0x389b21=this;return new Promise(function(_0x9f4dff,_0x53bdf8){return db['VoiceQueueReport'][_0x5872('0x1b')]({'raw':_0x213d9d[_0x5872('0x1c')]?_0x213d9d[_0x5872('0x1c')][_0x5872('0x1d')]===undefined?!![]:![]:!![],'where':_0x213d9d[_0x5872('0x1c')]?_0x213d9d['options']['where']||null:null,'attributes':_0x213d9d[_0x5872('0x1c')]?_0x213d9d['options']['attributes']||null:null,'limit':_0x213d9d[_0x5872('0x1c')]?_0x213d9d[_0x5872('0x1c')][_0x5872('0x1e')]||null:null,'include':_0x213d9d['options']?_0x213d9d[_0x5872('0x1c')][_0x5872('0x1f')]?_[_0x5872('0x20')](_0x213d9d['options'][_0x5872('0x1f')],function(_0x118587){return{'model':db[_0x118587[_0x5872('0x21')]],'as':_0x118587['as'],'attributes':_0x118587[_0x5872('0x22')],'include':_0x118587['include']?_[_0x5872('0x20')](_0x118587[_0x5872('0x1f')],function(_0x5a4b4b){return{'model':db[_0x5a4b4b[_0x5872('0x21')]],'as':_0x5a4b4b['as'],'attributes':_0x5a4b4b[_0x5872('0x22')],'include':_0x5a4b4b['include']?_[_0x5872('0x20')](_0x5a4b4b[_0x5872('0x1f')],function(_0xff7a48){return{'model':db[_0xff7a48['model']],'as':_0xff7a48['as'],'attributes':_0xff7a48[_0x5872('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5872('0x23')](function(_0x449cf6){logger[_0x5872('0x10')](_0x5872('0x1a'),_0x213d9d);logger[_0x5872('0x12')](_0x5872('0x1a'),_0x213d9d,JSON[_0x5872('0x13')](_0x449cf6));_0x9f4dff(_0x449cf6);})['catch'](function(_0x2c0f54){logger[_0x5872('0x14')]('GetVoiceQueueReport',_0x2c0f54[_0x5872('0x17')],_0x213d9d);_0x53bdf8(_0x389b21['error'](0x1f4,_0x2c0f54[_0x5872('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x2f11a8){var _0x2c0ad4=this;return new Promise(function(_0x346971,_0x36ca51){return db['VoiceQueueReport'][_0x5872('0x24')](_0x2f11a8[_0x5872('0x25')],{'raw':_0x2f11a8[_0x5872('0x1c')]?_0x2f11a8[_0x5872('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5872('0x23')](function(_0x5632fc){logger['info'](_0x5872('0x26'),_0x2f11a8);logger[_0x5872('0x12')](_0x5872('0x26'),_0x2f11a8,JSON[_0x5872('0x13')](_0x5632fc));_0x346971(_0x5632fc);})['catch'](function(_0x5e0bc8){logger[_0x5872('0x14')]('CreateVoiceQueueReport',_0x5e0bc8['message'],_0x2f11a8);_0x36ca51(_0x2c0ad4[_0x5872('0x14')](0x1f4,_0x5e0bc8[_0x5872('0x17')]));});});};exports[_0x5872('0x27')]=function(_0x5ccce2){var _0x516ba1=this;return new Promise(function(_0x38eafd,_0x24c482){return db['VoiceQueueReport']['update'](_0x5ccce2['body'],{'raw':_0x5ccce2[_0x5872('0x1c')]?_0x5ccce2['options'][_0x5872('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ccce2[_0x5872('0x1c')]?_0x5ccce2[_0x5872('0x1c')][_0x5872('0x28')]||null:null,'attributes':_0x5ccce2[_0x5872('0x1c')]?_0x5ccce2[_0x5872('0x1c')][_0x5872('0x22')]||null:null,'limit':_0x5ccce2[_0x5872('0x1c')]?_0x5ccce2[_0x5872('0x1c')][_0x5872('0x1e')]||null:null})[_0x5872('0x23')](function(_0x4db218){logger[_0x5872('0x10')]('UpdateVoiceQueueReport',_0x5ccce2);logger[_0x5872('0x12')]('UpdateVoiceQueueReport',_0x5ccce2,JSON[_0x5872('0x13')](_0x4db218));_0x38eafd(_0x4db218);})[_0x5872('0x19')](function(_0x5d3a26){logger[_0x5872('0x14')](_0x5872('0x27'),_0x5d3a26[_0x5872('0x17')],_0x5ccce2);_0x24c482(_0x516ba1['error'](0x1f4,_0x5d3a26['message']));});});};
\ No newline at end of file
+var _0xf281=['create','body','debug','UpdateVoiceQueueReport','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','model','map','info','CreateVoiceQueueReport'];(function(_0x57a1ca,_0x155fca){var _0x33023b=function(_0x2534f9){while(--_0x2534f9){_0x57a1ca['push'](_0x57a1ca['shift']());}};_0x33023b(++_0x155fca);}(_0xf281,0x14d));var _0x1f28=function(_0x4696a1,_0x41010e){_0x4696a1=_0x4696a1-0x0;var _0x1861e2=_0xf281[_0x4696a1];return _0x1861e2;};'use strict';var _=require(_0x1f28('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1f28('0x1'));var rs=require(_0x1f28('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f28('0x3'))['db'];var utils=require(_0x1f28('0x4'));var logger=require(_0x1f28('0x5'))(_0x1f28('0x6'));var config=require(_0x1f28('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f28('0x8')]({'port':0x232a});config[_0x1f28('0x9')]=_[_0x1f28('0xa')](config['redis'],{'host':_0x1f28('0xb'),'port':0x18eb});var socket=require(_0x1f28('0xc'))(new Redis(config[_0x1f28('0x9')]));require(_0x1f28('0xd'))[_0x1f28('0xe')](socket);function respondWithRpcPromise(_0x51bcc0,_0x8933ac,_0x385fcf){return new BPromise(function(_0x31dd88,_0x35b0ce){return client['request'](_0x51bcc0,_0x385fcf)[_0x1f28('0xf')](function(_0x67c5a1){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x8933ac,_0x1f28('0x10'));logger['debug'](_0x1f28('0x11'),_0x8933ac,'request\x20sent',JSON[_0x1f28('0x12')](_0x67c5a1));if(_0x67c5a1[_0x1f28('0x13')]){if(_0x67c5a1[_0x1f28('0x13')][_0x1f28('0x14')]===0x1f4){logger[_0x1f28('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x8933ac,_0x67c5a1[_0x1f28('0x13')]['message']);return _0x35b0ce(_0x67c5a1[_0x1f28('0x13')][_0x1f28('0x15')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x8933ac,_0x67c5a1[_0x1f28('0x13')][_0x1f28('0x15')]);return _0x31dd88(_0x67c5a1['error'][_0x1f28('0x15')]);}else{logger['info'](_0x1f28('0x16'),_0x8933ac,_0x1f28('0x10'));_0x31dd88(_0x67c5a1[_0x1f28('0x17')][_0x1f28('0x15')]);}})[_0x1f28('0x18')](function(_0x53b1b7){logger[_0x1f28('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x8933ac,_0x53b1b7);_0x35b0ce(_0x53b1b7);});});}exports[_0x1f28('0x19')]=function(_0x110ad1){var _0x5dd039=this;return new Promise(function(_0x5358e2,_0x531bc1){return db[_0x1f28('0x1a')][_0x1f28('0x1b')]({'raw':_0x110ad1[_0x1f28('0x1c')]?_0x110ad1[_0x1f28('0x1c')][_0x1f28('0x1d')]===undefined?!![]:![]:!![],'where':_0x110ad1[_0x1f28('0x1c')]?_0x110ad1['options']['where']||null:null,'attributes':_0x110ad1[_0x1f28('0x1c')]?_0x110ad1[_0x1f28('0x1c')][_0x1f28('0x1e')]||null:null,'limit':_0x110ad1[_0x1f28('0x1c')]?_0x110ad1[_0x1f28('0x1c')]['limit']||null:null,'include':_0x110ad1[_0x1f28('0x1c')]?_0x110ad1[_0x1f28('0x1c')]['include']?_['map'](_0x110ad1[_0x1f28('0x1c')][_0x1f28('0x1f')],function(_0x256e93){return{'model':db[_0x256e93[_0x1f28('0x20')]],'as':_0x256e93['as'],'attributes':_0x256e93[_0x1f28('0x1e')],'include':_0x256e93['include']?_['map'](_0x256e93[_0x1f28('0x1f')],function(_0x579b76){return{'model':db[_0x579b76['model']],'as':_0x579b76['as'],'attributes':_0x579b76[_0x1f28('0x1e')],'include':_0x579b76[_0x1f28('0x1f')]?_[_0x1f28('0x21')](_0x579b76['include'],function(_0x1ebdfe){return{'model':db[_0x1ebdfe[_0x1f28('0x20')]],'as':_0x1ebdfe['as'],'attributes':_0x1ebdfe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bff91){logger[_0x1f28('0x22')](_0x1f28('0x19'),_0x110ad1);logger['debug'](_0x1f28('0x19'),_0x110ad1,JSON[_0x1f28('0x12')](_0x5bff91));_0x5358e2(_0x5bff91);})['catch'](function(_0x1c630d){logger[_0x1f28('0x13')](_0x1f28('0x19'),_0x1c630d[_0x1f28('0x15')],_0x110ad1);_0x531bc1(_0x5dd039[_0x1f28('0x13')](0x1f4,_0x1c630d[_0x1f28('0x15')]));});});};exports[_0x1f28('0x23')]=function(_0x2078c4){var _0x53b556=this;return new Promise(function(_0x4c579b,_0x59cf50){return db[_0x1f28('0x1a')][_0x1f28('0x24')](_0x2078c4[_0x1f28('0x25')],{'raw':_0x2078c4['options']?_0x2078c4[_0x1f28('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x1f28('0xf')](function(_0x201db8){logger[_0x1f28('0x22')]('CreateVoiceQueueReport',_0x2078c4);logger[_0x1f28('0x26')](_0x1f28('0x23'),_0x2078c4,JSON['stringify'](_0x201db8));_0x4c579b(_0x201db8);})[_0x1f28('0x18')](function(_0x18c4a4){logger[_0x1f28('0x13')]('CreateVoiceQueueReport',_0x18c4a4[_0x1f28('0x15')],_0x2078c4);_0x59cf50(_0x53b556[_0x1f28('0x13')](0x1f4,_0x18c4a4[_0x1f28('0x15')]));});});};exports[_0x1f28('0x27')]=function(_0xd740cd){var _0x51c09f=this;return new Promise(function(_0xe7df63,_0x2afb91){return db[_0x1f28('0x1a')]['update'](_0xd740cd[_0x1f28('0x25')],{'raw':_0xd740cd['options']?_0xd740cd[_0x1f28('0x1c')][_0x1f28('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd740cd['options']?_0xd740cd[_0x1f28('0x1c')][_0x1f28('0x28')]||null:null,'attributes':_0xd740cd[_0x1f28('0x1c')]?_0xd740cd[_0x1f28('0x1c')][_0x1f28('0x1e')]||null:null,'limit':_0xd740cd['options']?_0xd740cd[_0x1f28('0x1c')]['limit']||null:null})['then'](function(_0xc02484){logger[_0x1f28('0x22')](_0x1f28('0x27'),_0xd740cd);logger[_0x1f28('0x26')](_0x1f28('0x27'),_0xd740cd,JSON[_0x1f28('0x12')](_0xc02484));_0xe7df63(_0xc02484);})['catch'](function(_0x370da5){logger[_0x1f28('0x13')](_0x1f28('0x27'),_0x370da5[_0x1f28('0x15')],_0xd740cd);_0x2afb91(_0x51c09f[_0x1f28('0x13')](0x1f4,_0x370da5[_0x1f28('0x15')]));});});};
\ No newline at end of file