Built motion from commit e0fa946e.|2.6.5
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index 0311881..6f302a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a98=['request\x20sent','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug'];(function(_0x319df2,_0x4085fb){var _0x41f9df=function(_0x8b9a53){while(--_0x8b9a53){_0x319df2['push'](_0x319df2['shift']());}};_0x41f9df(++_0x4085fb);}(_0x7a98,0x199));var _0x87a9=function(_0x2f923d,_0x7f560){_0x2f923d=_0x2f923d-0x0;var _0x441d0a=_0x7a98[_0x2f923d];return _0x441d0a;};'use strict';var _=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var moment=require(_0x87a9('0x2'));var BPromise=require(_0x87a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87a9('0x4'));var db=require(_0x87a9('0x5'))['db'];var utils=require(_0x87a9('0x6'));var logger=require(_0x87a9('0x7'))(_0x87a9('0x8'));var config=require(_0x87a9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x87a9('0xa')][_0x87a9('0xb')]({'port':0x232a});config[_0x87a9('0xc')]=_['defaults'](config['redis'],{'host':_0x87a9('0xd'),'port':0x18eb});var socket=require(_0x87a9('0xe'))(new Redis(config['redis']));require(_0x87a9('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d84e5,_0x16850b,_0x571831){return new BPromise(function(_0x186f45,_0x53ebda){return client[_0x87a9('0x10')](_0x5d84e5,_0x571831)[_0x87a9('0x11')](function(_0x3e4a96){logger[_0x87a9('0x12')](_0x87a9('0x13'),_0x16850b,'request\x20sent');logger[_0x87a9('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x16850b,_0x87a9('0x15'),JSON[_0x87a9('0x16')](_0x3e4a96));if(_0x3e4a96[_0x87a9('0x17')]){if(_0x3e4a96[_0x87a9('0x17')][_0x87a9('0x18')]===0x1f4){logger[_0x87a9('0x17')](_0x87a9('0x13'),_0x16850b,_0x3e4a96[_0x87a9('0x17')]['message']);return _0x53ebda(_0x3e4a96[_0x87a9('0x17')][_0x87a9('0x19')]);}logger[_0x87a9('0x17')](_0x87a9('0x13'),_0x16850b,_0x3e4a96[_0x87a9('0x17')][_0x87a9('0x19')]);return _0x186f45(_0x3e4a96['error'][_0x87a9('0x19')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x16850b,_0x87a9('0x15'));_0x186f45(_0x3e4a96[_0x87a9('0x1a')][_0x87a9('0x19')]);}})['catch'](function(_0x51014c){logger[_0x87a9('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x16850b,_0x51014c);_0x53ebda(_0x51014c);});});}exports[_0x87a9('0x1b')]=function(_0x24945a){var _0x50a92a=this;return new Promise(function(_0x1c3a26,_0x3d5097){return db[_0x87a9('0x1c')][_0x87a9('0x1d')]({'raw':_0x24945a['options']?_0x24945a[_0x87a9('0x1e')][_0x87a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x24945a[_0x87a9('0x1e')]?_0x24945a['options']['where']||null:null,'attributes':_0x24945a[_0x87a9('0x1e')]?_0x24945a[_0x87a9('0x1e')][_0x87a9('0x20')]||null:null,'limit':_0x24945a[_0x87a9('0x1e')]?_0x24945a['options'][_0x87a9('0x21')]||null:null,'include':_0x24945a[_0x87a9('0x1e')]?_0x24945a[_0x87a9('0x1e')][_0x87a9('0x22')]?_[_0x87a9('0x23')](_0x24945a[_0x87a9('0x1e')][_0x87a9('0x22')],function(_0x35bf1b){return{'model':db[_0x35bf1b[_0x87a9('0x24')]],'as':_0x35bf1b['as'],'attributes':_0x35bf1b[_0x87a9('0x20')],'include':_0x35bf1b['include']?_[_0x87a9('0x23')](_0x35bf1b[_0x87a9('0x22')],function(_0x323c8d){return{'model':db[_0x323c8d[_0x87a9('0x24')]],'as':_0x323c8d['as'],'attributes':_0x323c8d[_0x87a9('0x20')],'include':_0x323c8d[_0x87a9('0x22')]?_[_0x87a9('0x23')](_0x323c8d['include'],function(_0x4cd65d){return{'model':db[_0x4cd65d[_0x87a9('0x24')]],'as':_0x4cd65d['as'],'attributes':_0x4cd65d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3002){logger[_0x87a9('0x12')](_0x87a9('0x1b'),_0x24945a);logger[_0x87a9('0x14')]('GetVoiceQueueReport',_0x24945a,JSON['stringify'](_0x2d3002));_0x1c3a26(_0x2d3002);})['catch'](function(_0x3d23f4){logger[_0x87a9('0x17')](_0x87a9('0x1b'),_0x3d23f4[_0x87a9('0x19')],_0x24945a);_0x3d5097(_0x50a92a[_0x87a9('0x17')](0x1f4,_0x3d23f4[_0x87a9('0x19')]));});});};exports[_0x87a9('0x25')]=function(_0x21dbd3){var _0x138327=this;return new Promise(function(_0x25d33e,_0x2c4ac2){return db[_0x87a9('0x1c')][_0x87a9('0x26')](_0x21dbd3[_0x87a9('0x27')],{'raw':_0x21dbd3[_0x87a9('0x1e')]?_0x21dbd3[_0x87a9('0x1e')][_0x87a9('0x1f')]===undefined?!![]:![]:!![]})[_0x87a9('0x11')](function(_0x239012){logger[_0x87a9('0x12')](_0x87a9('0x25'),_0x21dbd3);logger[_0x87a9('0x14')](_0x87a9('0x25'),_0x21dbd3,JSON['stringify'](_0x239012));_0x25d33e(_0x239012);})['catch'](function(_0x45814d){logger['error'](_0x87a9('0x25'),_0x45814d['message'],_0x21dbd3);_0x2c4ac2(_0x138327[_0x87a9('0x17')](0x1f4,_0x45814d[_0x87a9('0x19')]));});});};exports[_0x87a9('0x28')]=function(_0x44ff25){var _0x13142c=this;return new Promise(function(_0x5d688f,_0x511e15){return db[_0x87a9('0x1c')][_0x87a9('0x29')](_0x44ff25[_0x87a9('0x27')],{'raw':_0x44ff25['options']?_0x44ff25[_0x87a9('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44ff25[_0x87a9('0x1e')]?_0x44ff25[_0x87a9('0x1e')][_0x87a9('0x2a')]||null:null,'attributes':_0x44ff25[_0x87a9('0x1e')]?_0x44ff25[_0x87a9('0x1e')][_0x87a9('0x20')]||null:null,'limit':_0x44ff25[_0x87a9('0x1e')]?_0x44ff25[_0x87a9('0x1e')]['limit']||null:null})[_0x87a9('0x11')](function(_0x4d0de9){logger[_0x87a9('0x12')](_0x87a9('0x28'),_0x44ff25);logger[_0x87a9('0x14')](_0x87a9('0x28'),_0x44ff25,JSON[_0x87a9('0x16')](_0x4d0de9));_0x5d688f(_0x4d0de9);})['catch'](function(_0x129db2){logger['error']('UpdateVoiceQueueReport',_0x129db2['message'],_0x44ff25);_0x511e15(_0x13142c[_0x87a9('0x17')](0x1f4,_0x129db2[_0x87a9('0x19')]));});});};
\ No newline at end of file
+var _0x5ca9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueReport','options','where','attributes','limit','include','map','model','debug','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','VoiceQueueReport','raw','lodash','util','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ca9,0xf8));var _0x95ca=function(_0x3abde2,_0x1463f9){_0x3abde2=_0x3abde2-0x0;var _0x436926=_0x5ca9[_0x3abde2];return _0x436926;};'use strict';var _=require(_0x95ca('0x0'));var util=require(_0x95ca('0x1'));var moment=require('moment');var BPromise=require(_0x95ca('0x2'));var rs=require(_0x95ca('0x3'));var fs=require('fs');var Redis=require(_0x95ca('0x4'));var db=require(_0x95ca('0x5'))['db'];var utils=require(_0x95ca('0x6'));var logger=require(_0x95ca('0x7'))(_0x95ca('0x8'));var config=require('../../config/environment');var jayson=require(_0x95ca('0x9'));var client=jayson[_0x95ca('0xa')][_0x95ca('0xb')]({'port':0x232a});config[_0x95ca('0xc')]=_[_0x95ca('0xd')](config[_0x95ca('0xc')],{'host':_0x95ca('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95ca('0xc')]));require(_0x95ca('0xf'))['register'](socket);function respondWithRpcPromise(_0x776a20,_0x5d74a9,_0x343bd5){return new BPromise(function(_0x24bb8a,_0x8502e1){return client[_0x95ca('0x10')](_0x776a20,_0x343bd5)[_0x95ca('0x11')](function(_0x24d0db){logger[_0x95ca('0x12')](_0x95ca('0x13'),_0x5d74a9,'request\x20sent');logger['debug'](_0x95ca('0x14'),_0x5d74a9,_0x95ca('0x15'),JSON[_0x95ca('0x16')](_0x24d0db));if(_0x24d0db[_0x95ca('0x17')]){if(_0x24d0db['error'][_0x95ca('0x18')]===0x1f4){logger[_0x95ca('0x17')](_0x95ca('0x13'),_0x5d74a9,_0x24d0db[_0x95ca('0x17')][_0x95ca('0x19')]);return _0x8502e1(_0x24d0db[_0x95ca('0x17')][_0x95ca('0x19')]);}logger[_0x95ca('0x17')](_0x95ca('0x13'),_0x5d74a9,_0x24d0db[_0x95ca('0x17')][_0x95ca('0x19')]);return _0x24bb8a(_0x24d0db['error'][_0x95ca('0x19')]);}else{logger['info'](_0x95ca('0x13'),_0x5d74a9,_0x95ca('0x15'));_0x24bb8a(_0x24d0db[_0x95ca('0x1a')][_0x95ca('0x19')]);}})['catch'](function(_0x535f9b){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5d74a9,_0x535f9b);_0x8502e1(_0x535f9b);});});}exports[_0x95ca('0x1b')]=function(_0x2c3c31){var _0x5ac474=this;return new Promise(function(_0x10aad9,_0x1e2d9f){return db['VoiceQueueReport']['findAll']({'raw':_0x2c3c31[_0x95ca('0x1c')]?_0x2c3c31['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c3c31[_0x95ca('0x1c')]?_0x2c3c31['options'][_0x95ca('0x1d')]||null:null,'attributes':_0x2c3c31[_0x95ca('0x1c')]?_0x2c3c31[_0x95ca('0x1c')][_0x95ca('0x1e')]||null:null,'limit':_0x2c3c31[_0x95ca('0x1c')]?_0x2c3c31[_0x95ca('0x1c')][_0x95ca('0x1f')]||null:null,'include':_0x2c3c31['options']?_0x2c3c31['options'][_0x95ca('0x20')]?_[_0x95ca('0x21')](_0x2c3c31[_0x95ca('0x1c')][_0x95ca('0x20')],function(_0x39ff81){return{'model':db[_0x39ff81[_0x95ca('0x22')]],'as':_0x39ff81['as'],'attributes':_0x39ff81[_0x95ca('0x1e')],'include':_0x39ff81[_0x95ca('0x20')]?_['map'](_0x39ff81[_0x95ca('0x20')],function(_0x2ae804){return{'model':db[_0x2ae804[_0x95ca('0x22')]],'as':_0x2ae804['as'],'attributes':_0x2ae804[_0x95ca('0x1e')],'include':_0x2ae804[_0x95ca('0x20')]?_[_0x95ca('0x21')](_0x2ae804[_0x95ca('0x20')],function(_0x29eca1){return{'model':db[_0x29eca1[_0x95ca('0x22')]],'as':_0x29eca1['as'],'attributes':_0x29eca1[_0x95ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x95ca('0x11')](function(_0x5c2dd3){logger[_0x95ca('0x12')](_0x95ca('0x1b'),_0x2c3c31);logger[_0x95ca('0x23')](_0x95ca('0x1b'),_0x2c3c31,JSON['stringify'](_0x5c2dd3));_0x10aad9(_0x5c2dd3);})[_0x95ca('0x24')](function(_0x2879ef){logger[_0x95ca('0x17')](_0x95ca('0x1b'),_0x2879ef[_0x95ca('0x19')],_0x2c3c31);_0x1e2d9f(_0x5ac474[_0x95ca('0x17')](0x1f4,_0x2879ef['message']));});});};exports[_0x95ca('0x25')]=function(_0x180c43){var _0x4c5fbe=this;return new Promise(function(_0x4a210,_0x2a6a53){return db['VoiceQueueReport']['create'](_0x180c43[_0x95ca('0x26')],{'raw':_0x180c43['options']?_0x180c43[_0x95ca('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x95ca('0x11')](function(_0x259877){logger[_0x95ca('0x12')](_0x95ca('0x25'),_0x180c43);logger[_0x95ca('0x23')](_0x95ca('0x25'),_0x180c43,JSON[_0x95ca('0x16')](_0x259877));_0x4a210(_0x259877);})[_0x95ca('0x24')](function(_0x8e2180){logger[_0x95ca('0x17')](_0x95ca('0x25'),_0x8e2180[_0x95ca('0x19')],_0x180c43);_0x2a6a53(_0x4c5fbe[_0x95ca('0x17')](0x1f4,_0x8e2180[_0x95ca('0x19')]));});});};exports[_0x95ca('0x27')]=function(_0x3f733c){var _0x26940b=this;return new Promise(function(_0x1ab678,_0x3edc90){return db[_0x95ca('0x28')]['update'](_0x3f733c[_0x95ca('0x26')],{'raw':_0x3f733c[_0x95ca('0x1c')]?_0x3f733c[_0x95ca('0x1c')][_0x95ca('0x29')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f733c[_0x95ca('0x1c')]?_0x3f733c['options'][_0x95ca('0x1d')]||null:null,'attributes':_0x3f733c[_0x95ca('0x1c')]?_0x3f733c['options']['attributes']||null:null,'limit':_0x3f733c[_0x95ca('0x1c')]?_0x3f733c[_0x95ca('0x1c')][_0x95ca('0x1f')]||null:null})[_0x95ca('0x11')](function(_0x2069da){logger['info'](_0x95ca('0x27'),_0x3f733c);logger['debug'](_0x95ca('0x27'),_0x3f733c,JSON[_0x95ca('0x16')](_0x2069da));_0x1ab678(_0x2069da);})[_0x95ca('0x24')](function(_0x22e063){logger[_0x95ca('0x17')](_0x95ca('0x27'),_0x22e063[_0x95ca('0x19')],_0x3f733c);_0x3edc90(_0x26940b['error'](0x1f4,_0x22e063[_0x95ca('0x19')]));});});};
\ No newline at end of file