Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index da75b63..71785ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb90=['request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','raw','where','include','map','model','attributes','GetVoiceQueueReport','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x4f2d40,_0x2b76f8){var _0x227027=function(_0x57d2a4){while(--_0x57d2a4){_0x4f2d40['push'](_0x4f2d40['shift']());}};_0x227027(++_0x2b76f8);}(_0xbb90,0xec));var _0x0bb9=function(_0xef1e97,_0x5e35b8){_0xef1e97=_0xef1e97-0x0;var _0x2f7a5d=_0xbb90[_0xef1e97];return _0x2f7a5d;};'use strict';var _=require('lodash');var util=require(_0x0bb9('0x0'));var moment=require(_0x0bb9('0x1'));var BPromise=require(_0x0bb9('0x2'));var rs=require(_0x0bb9('0x3'));var fs=require('fs');var Redis=require(_0x0bb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bb9('0x5'));var logger=require('../../config/logger')(_0x0bb9('0x6'));var config=require(_0x0bb9('0x7'));var jayson=require(_0x0bb9('0x8'));var client=jayson[_0x0bb9('0x9')]['http']({'port':0x232a});config[_0x0bb9('0xa')]=_[_0x0bb9('0xb')](config[_0x0bb9('0xa')],{'host':_0x0bb9('0xc'),'port':0x18eb});var socket=require(_0x0bb9('0xd'))(new Redis(config[_0x0bb9('0xa')]));require(_0x0bb9('0xe'))[_0x0bb9('0xf')](socket);function respondWithRpcPromise(_0x13249e,_0xfe18d0,_0x2e0a8f){return new BPromise(function(_0x2243ba,_0x5f0666){return client[_0x0bb9('0x10')](_0x13249e,_0x2e0a8f)[_0x0bb9('0x11')](function(_0x40b1a7){logger[_0x0bb9('0x12')](_0x0bb9('0x13'),_0xfe18d0,_0x0bb9('0x14'));logger[_0x0bb9('0x15')](_0x0bb9('0x16'),_0xfe18d0,'request\x20sent',JSON[_0x0bb9('0x17')](_0x40b1a7));if(_0x40b1a7[_0x0bb9('0x18')]){if(_0x40b1a7['error']['code']===0x1f4){logger[_0x0bb9('0x18')](_0x0bb9('0x13'),_0xfe18d0,_0x40b1a7[_0x0bb9('0x18')][_0x0bb9('0x19')]);return _0x5f0666(_0x40b1a7[_0x0bb9('0x18')]['message']);}logger[_0x0bb9('0x18')](_0x0bb9('0x13'),_0xfe18d0,_0x40b1a7[_0x0bb9('0x18')][_0x0bb9('0x19')]);return _0x2243ba(_0x40b1a7[_0x0bb9('0x18')][_0x0bb9('0x19')]);}else{logger['info'](_0x0bb9('0x13'),_0xfe18d0,_0x0bb9('0x14'));_0x2243ba(_0x40b1a7[_0x0bb9('0x1a')][_0x0bb9('0x19')]);}})['catch'](function(_0x32bd0c){logger[_0x0bb9('0x18')](_0x0bb9('0x13'),_0xfe18d0,_0x32bd0c);_0x5f0666(_0x32bd0c);});});}exports['GetVoiceQueueReport']=function(_0x3f77f1){var _0x286355=this;return new Promise(function(_0x20ccb5,_0x10df4b){return db['VoiceQueueReport'][_0x0bb9('0x1b')]({'raw':_0x3f77f1[_0x0bb9('0x1c')]?_0x3f77f1[_0x0bb9('0x1c')][_0x0bb9('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f77f1[_0x0bb9('0x1c')]?_0x3f77f1[_0x0bb9('0x1c')][_0x0bb9('0x1e')]||null:null,'attributes':_0x3f77f1['options']?_0x3f77f1[_0x0bb9('0x1c')]['attributes']||null:null,'limit':_0x3f77f1[_0x0bb9('0x1c')]?_0x3f77f1[_0x0bb9('0x1c')]['limit']||null:null,'include':_0x3f77f1[_0x0bb9('0x1c')]?_0x3f77f1['options'][_0x0bb9('0x1f')]?_[_0x0bb9('0x20')](_0x3f77f1[_0x0bb9('0x1c')][_0x0bb9('0x1f')],function(_0x56b547){return{'model':db[_0x56b547[_0x0bb9('0x21')]],'as':_0x56b547['as'],'attributes':_0x56b547[_0x0bb9('0x22')],'include':_0x56b547['include']?_[_0x0bb9('0x20')](_0x56b547['include'],function(_0x329fbc){return{'model':db[_0x329fbc[_0x0bb9('0x21')]],'as':_0x329fbc['as'],'attributes':_0x329fbc[_0x0bb9('0x22')],'include':_0x329fbc['include']?_[_0x0bb9('0x20')](_0x329fbc[_0x0bb9('0x1f')],function(_0xb7aa28){return{'model':db[_0xb7aa28[_0x0bb9('0x21')]],'as':_0xb7aa28['as'],'attributes':_0xb7aa28[_0x0bb9('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0bb9('0x11')](function(_0x5598f7){logger['info'](_0x0bb9('0x23'),_0x3f77f1);logger[_0x0bb9('0x15')](_0x0bb9('0x23'),_0x3f77f1,JSON[_0x0bb9('0x17')](_0x5598f7));_0x20ccb5(_0x5598f7);})[_0x0bb9('0x24')](function(_0x3a5d87){logger[_0x0bb9('0x18')]('GetVoiceQueueReport',_0x3a5d87[_0x0bb9('0x19')],_0x3f77f1);_0x10df4b(_0x286355[_0x0bb9('0x18')](0x1f4,_0x3a5d87[_0x0bb9('0x19')]));});});};exports[_0x0bb9('0x25')]=function(_0x3b13b0){var _0x219ec0=this;return new Promise(function(_0x13f27e,_0x556f87){return db['VoiceQueueReport']['create'](_0x3b13b0[_0x0bb9('0x26')],{'raw':_0x3b13b0[_0x0bb9('0x1c')]?_0x3b13b0[_0x0bb9('0x1c')][_0x0bb9('0x1d')]===undefined?!![]:![]:!![]})[_0x0bb9('0x11')](function(_0x4f2e2f){logger[_0x0bb9('0x12')](_0x0bb9('0x25'),_0x3b13b0);logger['debug'](_0x0bb9('0x25'),_0x3b13b0,JSON[_0x0bb9('0x17')](_0x4f2e2f));_0x13f27e(_0x4f2e2f);})[_0x0bb9('0x24')](function(_0x2da4d5){logger['error'](_0x0bb9('0x25'),_0x2da4d5[_0x0bb9('0x19')],_0x3b13b0);_0x556f87(_0x219ec0[_0x0bb9('0x18')](0x1f4,_0x2da4d5[_0x0bb9('0x19')]));});});};exports[_0x0bb9('0x27')]=function(_0x3db2b1){var _0x455918=this;return new Promise(function(_0x3a2b69,_0x2889eb){return db['VoiceQueueReport'][_0x0bb9('0x28')](_0x3db2b1[_0x0bb9('0x26')],{'raw':_0x3db2b1[_0x0bb9('0x1c')]?_0x3db2b1[_0x0bb9('0x1c')][_0x0bb9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3db2b1[_0x0bb9('0x1c')]?_0x3db2b1[_0x0bb9('0x1c')][_0x0bb9('0x1e')]||null:null,'attributes':_0x3db2b1[_0x0bb9('0x1c')]?_0x3db2b1[_0x0bb9('0x1c')][_0x0bb9('0x22')]||null:null,'limit':_0x3db2b1[_0x0bb9('0x1c')]?_0x3db2b1[_0x0bb9('0x1c')][_0x0bb9('0x29')]||null:null})[_0x0bb9('0x11')](function(_0x715d58){logger[_0x0bb9('0x12')](_0x0bb9('0x27'),_0x3db2b1);logger[_0x0bb9('0x15')](_0x0bb9('0x27'),_0x3db2b1,JSON[_0x0bb9('0x17')](_0x715d58));_0x3a2b69(_0x715d58);})['catch'](function(_0x476908){logger['error'](_0x0bb9('0x27'),_0x476908[_0x0bb9('0x19')],_0x3db2b1);_0x2889eb(_0x455918[_0x0bb9('0x18')](0x1f4,_0x476908[_0x0bb9('0x19')]));});});};
\ No newline at end of file
+var _0xf263=['request','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf263,0x149));var _0x3f26=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xf263[_0x158a58];return _0x4935d9;};'use strict';var _=require(_0x3f26('0x0'));var util=require(_0x3f26('0x1'));var moment=require(_0x3f26('0x2'));var BPromise=require(_0x3f26('0x3'));var rs=require(_0x3f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f26('0x6'))(_0x3f26('0x7'));var config=require(_0x3f26('0x8'));var jayson=require(_0x3f26('0x9'));var client=jayson['client'][_0x3f26('0xa')]({'port':0x232a});config[_0x3f26('0xb')]=_['defaults'](config['redis'],{'host':_0x3f26('0xc'),'port':0x18eb});var socket=require(_0x3f26('0xd'))(new Redis(config[_0x3f26('0xb')]));require('./voiceQueueReport.socket')[_0x3f26('0xe')](socket);function respondWithRpcPromise(_0x3407b9,_0x15b19c,_0x27ae32){return new BPromise(function(_0x33fff0,_0x4770f5){return client[_0x3f26('0xf')](_0x3407b9,_0x27ae32)[_0x3f26('0x10')](function(_0x19aed9){logger[_0x3f26('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,'request\x20sent');logger[_0x3f26('0x12')](_0x3f26('0x13'),_0x15b19c,_0x3f26('0x14'),JSON[_0x3f26('0x15')](_0x19aed9));if(_0x19aed9['error']){if(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x17')]===0x1f4){logger[_0x3f26('0x16')](_0x3f26('0x18'),_0x15b19c,_0x19aed9['error'][_0x3f26('0x19')]);return _0x4770f5(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);}logger[_0x3f26('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);return _0x33fff0(_0x19aed9[_0x3f26('0x16')][_0x3f26('0x19')]);}else{logger[_0x3f26('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x15b19c,'request\x20sent');_0x33fff0(_0x19aed9['result'][_0x3f26('0x19')]);}})[_0x3f26('0x1a')](function(_0x54e79b){logger[_0x3f26('0x16')](_0x3f26('0x18'),_0x15b19c,_0x54e79b);_0x4770f5(_0x54e79b);});});}exports['GetVoiceQueueReport']=function(_0x4e9077){var _0x47c4b9=this;return new Promise(function(_0x3080f2,_0x20fe9c){return db['VoiceQueueReport'][_0x3f26('0x1b')]({'raw':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077['options'][_0x3f26('0x1e')]||null:null,'attributes':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x1f')]||null:null,'limit':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x20')]||null:null,'include':_0x4e9077[_0x3f26('0x1c')]?_0x4e9077[_0x3f26('0x1c')][_0x3f26('0x21')]?_[_0x3f26('0x22')](_0x4e9077[_0x3f26('0x1c')]['include'],function(_0x42c589){return{'model':db[_0x42c589[_0x3f26('0x23')]],'as':_0x42c589['as'],'attributes':_0x42c589[_0x3f26('0x1f')],'include':_0x42c589['include']?_['map'](_0x42c589[_0x3f26('0x21')],function(_0x1eab9c){return{'model':db[_0x1eab9c[_0x3f26('0x23')]],'as':_0x1eab9c['as'],'attributes':_0x1eab9c[_0x3f26('0x1f')],'include':_0x1eab9c[_0x3f26('0x21')]?_[_0x3f26('0x22')](_0x1eab9c[_0x3f26('0x21')],function(_0x2d2c2d){return{'model':db[_0x2d2c2d[_0x3f26('0x23')]],'as':_0x2d2c2d['as'],'attributes':_0x2d2c2d[_0x3f26('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f35e9){logger[_0x3f26('0x11')](_0x3f26('0x24'),_0x4e9077);logger['debug']('GetVoiceQueueReport',_0x4e9077,JSON['stringify'](_0x1f35e9));_0x3080f2(_0x1f35e9);})[_0x3f26('0x1a')](function(_0x460927){logger[_0x3f26('0x16')]('GetVoiceQueueReport',_0x460927[_0x3f26('0x19')],_0x4e9077);_0x20fe9c(_0x47c4b9['error'](0x1f4,_0x460927[_0x3f26('0x19')]));});});};exports[_0x3f26('0x25')]=function(_0x447f62){var _0x5a3cfe=this;return new Promise(function(_0xbdfa3d,_0x4b4b16){return db[_0x3f26('0x26')][_0x3f26('0x27')](_0x447f62['body'],{'raw':_0x447f62[_0x3f26('0x1c')]?_0x447f62[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![]})[_0x3f26('0x10')](function(_0x4d042d){logger[_0x3f26('0x11')](_0x3f26('0x25'),_0x447f62);logger[_0x3f26('0x12')](_0x3f26('0x25'),_0x447f62,JSON[_0x3f26('0x15')](_0x4d042d));_0xbdfa3d(_0x4d042d);})[_0x3f26('0x1a')](function(_0x34ccee){logger['error'](_0x3f26('0x25'),_0x34ccee[_0x3f26('0x19')],_0x447f62);_0x4b4b16(_0x5a3cfe['error'](0x1f4,_0x34ccee['message']));});});};exports[_0x3f26('0x28')]=function(_0x5c448c){var _0x38d371=this;return new Promise(function(_0x861a5f,_0x1e1db0){return db['VoiceQueueReport'][_0x3f26('0x29')](_0x5c448c[_0x3f26('0x2a')],{'raw':_0x5c448c['options']?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1e')]||null:null,'attributes':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x1f')]||null:null,'limit':_0x5c448c[_0x3f26('0x1c')]?_0x5c448c[_0x3f26('0x1c')][_0x3f26('0x20')]||null:null})[_0x3f26('0x10')](function(_0x2e9d31){logger[_0x3f26('0x11')](_0x3f26('0x28'),_0x5c448c);logger['debug']('UpdateVoiceQueueReport',_0x5c448c,JSON[_0x3f26('0x15')](_0x2e9d31));_0x861a5f(_0x2e9d31);})[_0x3f26('0x1a')](function(_0x232a7e){logger[_0x3f26('0x16')](_0x3f26('0x28'),_0x232a7e[_0x3f26('0x19')],_0x5c448c);_0x1e1db0(_0x38d371[_0x3f26('0x16')](0x1f4,_0x232a7e[_0x3f26('0x19')]));});});};
\ No newline at end of file