Built motion from commit f74363e9.|2.6.34
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index cb5a4c2..e4e35a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf86=['code','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','model','map','stringify','CreateVoiceQueueReport','raw','UpdateVoiceQueueReport','update','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaf86,0x12c));var _0x6af8=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xaf86[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x6af8('0x0'));var util=require('util');var moment=require(_0x6af8('0x1'));var BPromise=require(_0x6af8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6af8('0x3'));var logger=require(_0x6af8('0x4'))(_0x6af8('0x5'));var config=require(_0x6af8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6af8('0x7')]({'port':0x232a});config[_0x6af8('0x8')]=_[_0x6af8('0x9')](config['redis'],{'host':_0x6af8('0xa'),'port':0x18eb});var socket=require(_0x6af8('0xb'))(new Redis(config[_0x6af8('0x8')]));require(_0x6af8('0xc'))[_0x6af8('0xd')](socket);function respondWithRpcPromise(_0x4f4205,_0xa49443,_0x44a36a){return new BPromise(function(_0x244028,_0x2fb923){return client['request'](_0x4f4205,_0x44a36a)[_0x6af8('0xe')](function(_0x3a9d9d){logger[_0x6af8('0xf')](_0x6af8('0x10'),_0xa49443,'request\x20sent');logger[_0x6af8('0x11')](_0x6af8('0x12'),_0xa49443,_0x6af8('0x13'),JSON['stringify'](_0x3a9d9d));if(_0x3a9d9d['error']){if(_0x3a9d9d['error'][_0x6af8('0x14')]===0x1f4){logger[_0x6af8('0x15')](_0x6af8('0x10'),_0xa49443,_0x3a9d9d[_0x6af8('0x15')][_0x6af8('0x16')]);return _0x2fb923(_0x3a9d9d[_0x6af8('0x15')][_0x6af8('0x16')]);}logger[_0x6af8('0x15')](_0x6af8('0x10'),_0xa49443,_0x3a9d9d[_0x6af8('0x15')][_0x6af8('0x16')]);return _0x244028(_0x3a9d9d['error']['message']);}else{logger[_0x6af8('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0xa49443,'request\x20sent');_0x244028(_0x3a9d9d[_0x6af8('0x17')][_0x6af8('0x16')]);}})[_0x6af8('0x18')](function(_0x12ef58){logger[_0x6af8('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0xa49443,_0x12ef58);_0x2fb923(_0x12ef58);});});}exports[_0x6af8('0x19')]=function(_0x33b39b){var _0x322551=this;return new Promise(function(_0x490203,_0x15ae36){return db[_0x6af8('0x1a')][_0x6af8('0x1b')]({'raw':_0x33b39b['options']?_0x33b39b[_0x6af8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x33b39b[_0x6af8('0x1c')]?_0x33b39b[_0x6af8('0x1c')][_0x6af8('0x1d')]||null:null,'attributes':_0x33b39b['options']?_0x33b39b[_0x6af8('0x1c')][_0x6af8('0x1e')]||null:null,'limit':_0x33b39b['options']?_0x33b39b[_0x6af8('0x1c')][_0x6af8('0x1f')]||null:null,'include':_0x33b39b[_0x6af8('0x1c')]?_0x33b39b[_0x6af8('0x1c')]['include']?_['map'](_0x33b39b[_0x6af8('0x1c')][_0x6af8('0x20')],function(_0x104a15){return{'model':db[_0x104a15[_0x6af8('0x21')]],'as':_0x104a15['as'],'attributes':_0x104a15[_0x6af8('0x1e')],'include':_0x104a15[_0x6af8('0x20')]?_[_0x6af8('0x22')](_0x104a15[_0x6af8('0x20')],function(_0x4c8af2){return{'model':db[_0x4c8af2[_0x6af8('0x21')]],'as':_0x4c8af2['as'],'attributes':_0x4c8af2[_0x6af8('0x1e')],'include':_0x4c8af2[_0x6af8('0x20')]?_['map'](_0x4c8af2[_0x6af8('0x20')],function(_0x13235d){return{'model':db[_0x13235d[_0x6af8('0x21')]],'as':_0x13235d['as'],'attributes':_0x13235d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6af8('0xe')](function(_0x4abdc3){logger['info'](_0x6af8('0x19'),_0x33b39b);logger[_0x6af8('0x11')]('GetVoiceQueueReport',_0x33b39b,JSON[_0x6af8('0x23')](_0x4abdc3));_0x490203(_0x4abdc3);})[_0x6af8('0x18')](function(_0x2b148b){logger[_0x6af8('0x15')](_0x6af8('0x19'),_0x2b148b[_0x6af8('0x16')],_0x33b39b);_0x15ae36(_0x322551[_0x6af8('0x15')](0x1f4,_0x2b148b[_0x6af8('0x16')]));});});};exports[_0x6af8('0x24')]=function(_0x3d8857){var _0x56987f=this;return new Promise(function(_0x23be1b,_0x371878){return db[_0x6af8('0x1a')]['create'](_0x3d8857['body'],{'raw':_0x3d8857[_0x6af8('0x1c')]?_0x3d8857[_0x6af8('0x1c')][_0x6af8('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x51efdf){logger[_0x6af8('0xf')](_0x6af8('0x24'),_0x3d8857);logger[_0x6af8('0x11')](_0x6af8('0x24'),_0x3d8857,JSON[_0x6af8('0x23')](_0x51efdf));_0x23be1b(_0x51efdf);})[_0x6af8('0x18')](function(_0x3f2a52){logger[_0x6af8('0x15')](_0x6af8('0x24'),_0x3f2a52[_0x6af8('0x16')],_0x3d8857);_0x371878(_0x56987f['error'](0x1f4,_0x3f2a52[_0x6af8('0x16')]));});});};exports[_0x6af8('0x26')]=function(_0x1bb825){var _0x614dbd=this;return new Promise(function(_0x33c802,_0x4f0faa){return db[_0x6af8('0x1a')][_0x6af8('0x27')](_0x1bb825['body'],{'raw':_0x1bb825[_0x6af8('0x1c')]?_0x1bb825[_0x6af8('0x1c')][_0x6af8('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bb825['options']?_0x1bb825[_0x6af8('0x1c')][_0x6af8('0x1d')]||null:null,'attributes':_0x1bb825[_0x6af8('0x1c')]?_0x1bb825['options'][_0x6af8('0x1e')]||null:null,'limit':_0x1bb825[_0x6af8('0x1c')]?_0x1bb825[_0x6af8('0x1c')][_0x6af8('0x1f')]||null:null})['then'](function(_0x3a4db8){logger[_0x6af8('0xf')](_0x6af8('0x26'),_0x1bb825);logger['debug'](_0x6af8('0x26'),_0x1bb825,JSON[_0x6af8('0x23')](_0x3a4db8));_0x33c802(_0x3a4db8);})[_0x6af8('0x18')](function(_0x26ff4b){logger[_0x6af8('0x15')](_0x6af8('0x26'),_0x26ff4b[_0x6af8('0x16')],_0x1bb825);_0x4f0faa(_0x614dbd[_0x6af8('0x15')](0x1f4,_0x26ff4b[_0x6af8('0x16')]));});});};
\ No newline at end of file
+var _0x9a68=['result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','map','model','attributes','catch','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x9a68,0x1dc));var _0x89a6=function(_0x15f789,_0x5909ea){_0x15f789=_0x15f789-0x0;var _0x2e28d5=_0x9a68[_0x15f789];return _0x2e28d5;};'use strict';var _=require(_0x89a6('0x0'));var util=require(_0x89a6('0x1'));var moment=require(_0x89a6('0x2'));var BPromise=require(_0x89a6('0x3'));var rs=require(_0x89a6('0x4'));var fs=require('fs');var Redis=require(_0x89a6('0x5'));var db=require(_0x89a6('0x6'))['db'];var utils=require(_0x89a6('0x7'));var logger=require(_0x89a6('0x8'))('rpc');var config=require(_0x89a6('0x9'));var jayson=require(_0x89a6('0xa'));var client=jayson[_0x89a6('0xb')][_0x89a6('0xc')]({'port':0x232a});config[_0x89a6('0xd')]=_[_0x89a6('0xe')](config['redis'],{'host':_0x89a6('0xf'),'port':0x18eb});var socket=require(_0x89a6('0x10'))(new Redis(config['redis']));require(_0x89a6('0x11'))[_0x89a6('0x12')](socket);function respondWithRpcPromise(_0x1a7c00,_0x560370,_0x113e3c){return new BPromise(function(_0x339bef,_0xb888f){return client[_0x89a6('0x13')](_0x1a7c00,_0x113e3c)[_0x89a6('0x14')](function(_0x4c4dbd){logger['info'](_0x89a6('0x15'),_0x560370,_0x89a6('0x16'));logger[_0x89a6('0x17')](_0x89a6('0x18'),_0x560370,_0x89a6('0x16'),JSON[_0x89a6('0x19')](_0x4c4dbd));if(_0x4c4dbd[_0x89a6('0x1a')]){if(_0x4c4dbd['error'][_0x89a6('0x1b')]===0x1f4){logger[_0x89a6('0x1a')](_0x89a6('0x15'),_0x560370,_0x4c4dbd[_0x89a6('0x1a')][_0x89a6('0x1c')]);return _0xb888f(_0x4c4dbd[_0x89a6('0x1a')]['message']);}logger[_0x89a6('0x1a')](_0x89a6('0x15'),_0x560370,_0x4c4dbd[_0x89a6('0x1a')][_0x89a6('0x1c')]);return _0x339bef(_0x4c4dbd['error'][_0x89a6('0x1c')]);}else{logger[_0x89a6('0x1d')](_0x89a6('0x15'),_0x560370,_0x89a6('0x16'));_0x339bef(_0x4c4dbd[_0x89a6('0x1e')]['message']);}})['catch'](function(_0x2f48b8){logger[_0x89a6('0x1a')](_0x89a6('0x15'),_0x560370,_0x2f48b8);_0xb888f(_0x2f48b8);});});}exports[_0x89a6('0x1f')]=function(_0x3bebdc){var _0x25b310=this;return new Promise(function(_0x5a6adc,_0x502dbc){return db[_0x89a6('0x20')]['findAll']({'raw':_0x3bebdc[_0x89a6('0x21')]?_0x3bebdc[_0x89a6('0x21')][_0x89a6('0x22')]===undefined?!![]:![]:!![],'where':_0x3bebdc[_0x89a6('0x21')]?_0x3bebdc['options'][_0x89a6('0x23')]||null:null,'attributes':_0x3bebdc[_0x89a6('0x21')]?_0x3bebdc[_0x89a6('0x21')]['attributes']||null:null,'limit':_0x3bebdc[_0x89a6('0x21')]?_0x3bebdc[_0x89a6('0x21')][_0x89a6('0x24')]||null:null,'include':_0x3bebdc[_0x89a6('0x21')]?_0x3bebdc[_0x89a6('0x21')][_0x89a6('0x25')]?_[_0x89a6('0x26')](_0x3bebdc[_0x89a6('0x21')]['include'],function(_0x53c5c5){return{'model':db[_0x53c5c5[_0x89a6('0x27')]],'as':_0x53c5c5['as'],'attributes':_0x53c5c5[_0x89a6('0x28')],'include':_0x53c5c5['include']?_[_0x89a6('0x26')](_0x53c5c5[_0x89a6('0x25')],function(_0xdd67b4){return{'model':db[_0xdd67b4['model']],'as':_0xdd67b4['as'],'attributes':_0xdd67b4[_0x89a6('0x28')],'include':_0xdd67b4['include']?_['map'](_0xdd67b4[_0x89a6('0x25')],function(_0x1d7544){return{'model':db[_0x1d7544[_0x89a6('0x27')]],'as':_0x1d7544['as'],'attributes':_0x1d7544[_0x89a6('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x463584){logger[_0x89a6('0x1d')](_0x89a6('0x1f'),_0x3bebdc);logger[_0x89a6('0x17')]('GetVoiceQueueReport',_0x3bebdc,JSON[_0x89a6('0x19')](_0x463584));_0x5a6adc(_0x463584);})[_0x89a6('0x29')](function(_0xbdca8){logger[_0x89a6('0x1a')](_0x89a6('0x1f'),_0xbdca8[_0x89a6('0x1c')],_0x3bebdc);_0x502dbc(_0x25b310[_0x89a6('0x1a')](0x1f4,_0xbdca8['message']));});});};exports['CreateVoiceQueueReport']=function(_0x48616f){var _0x9fefae=this;return new Promise(function(_0x5f41eb,_0x1b850e){return db['VoiceQueueReport']['create'](_0x48616f[_0x89a6('0x2a')],{'raw':_0x48616f['options']?_0x48616f['options'][_0x89a6('0x22')]===undefined?!![]:![]:!![]})[_0x89a6('0x14')](function(_0x2fa684){logger['info'](_0x89a6('0x2b'),_0x48616f);logger[_0x89a6('0x17')](_0x89a6('0x2b'),_0x48616f,JSON[_0x89a6('0x19')](_0x2fa684));_0x5f41eb(_0x2fa684);})[_0x89a6('0x29')](function(_0x579193){logger[_0x89a6('0x1a')](_0x89a6('0x2b'),_0x579193[_0x89a6('0x1c')],_0x48616f);_0x1b850e(_0x9fefae[_0x89a6('0x1a')](0x1f4,_0x579193[_0x89a6('0x1c')]));});});};exports[_0x89a6('0x2c')]=function(_0x59a312){var _0x283723=this;return new Promise(function(_0x1cdb95,_0x58ada4){return db['VoiceQueueReport'][_0x89a6('0x2d')](_0x59a312[_0x89a6('0x2a')],{'raw':_0x59a312[_0x89a6('0x21')]?_0x59a312[_0x89a6('0x21')][_0x89a6('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59a312[_0x89a6('0x21')]?_0x59a312['options'][_0x89a6('0x23')]||null:null,'attributes':_0x59a312[_0x89a6('0x21')]?_0x59a312['options'][_0x89a6('0x28')]||null:null,'limit':_0x59a312['options']?_0x59a312[_0x89a6('0x21')][_0x89a6('0x24')]||null:null})['then'](function(_0x2c3925){logger[_0x89a6('0x1d')](_0x89a6('0x2c'),_0x59a312);logger['debug'](_0x89a6('0x2c'),_0x59a312,JSON[_0x89a6('0x19')](_0x2c3925));_0x1cdb95(_0x2c3925);})[_0x89a6('0x29')](function(_0x54d561){logger[_0x89a6('0x1a')](_0x89a6('0x2c'),_0x54d561['message'],_0x59a312);_0x58ada4(_0x283723['error'](0x1f4,_0x54d561['message']));});});};
\ No newline at end of file