Built motion from commit 85f716e9.|2.6.8
[motion2.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
index ee4fc9e..76a86bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9433=['raw','where','limit','map','include','model','attributes','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./voiceQueueReport.socket','request','then','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options'];(function(_0x3fb765,_0x89ffef){var _0xb33b4d=function(_0x30de52){while(--_0x30de52){_0x3fb765['push'](_0x3fb765['shift']());}};_0xb33b4d(++_0x89ffef);}(_0x9433,0x175));var _0x3943=function(_0x585a6f,_0x5657cf){_0x585a6f=_0x585a6f-0x0;var _0x38f511=_0x9433[_0x585a6f];return _0x38f511;};'use strict';var _=require(_0x3943('0x0'));var util=require(_0x3943('0x1'));var moment=require(_0x3943('0x2'));var BPromise=require(_0x3943('0x3'));var rs=require(_0x3943('0x4'));var fs=require('fs');var Redis=require(_0x3943('0x5'));var db=require(_0x3943('0x6'))['db'];var utils=require(_0x3943('0x7'));var logger=require(_0x3943('0x8'))(_0x3943('0x9'));var config=require(_0x3943('0xa'));var jayson=require(_0x3943('0xb'));var client=jayson[_0x3943('0xc')]['http']({'port':0x232a});config[_0x3943('0xd')]=_[_0x3943('0xe')](config['redis'],{'host':_0x3943('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3943('0x10'))['register'](socket);function respondWithRpcPromise(_0x439f93,_0x44bbc0,_0x2cd0bc){return new BPromise(function(_0x351286,_0x2f7e75){return client[_0x3943('0x11')](_0x439f93,_0x2cd0bc)[_0x3943('0x12')](function(_0x4954a8){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x44bbc0,_0x3943('0x13'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x44bbc0,_0x3943('0x13'),JSON[_0x3943('0x14')](_0x4954a8));if(_0x4954a8[_0x3943('0x15')]){if(_0x4954a8['error'][_0x3943('0x16')]===0x1f4){logger['error'](_0x3943('0x17'),_0x44bbc0,_0x4954a8[_0x3943('0x15')][_0x3943('0x18')]);return _0x2f7e75(_0x4954a8[_0x3943('0x15')][_0x3943('0x18')]);}logger[_0x3943('0x15')](_0x3943('0x17'),_0x44bbc0,_0x4954a8[_0x3943('0x15')]['message']);return _0x351286(_0x4954a8[_0x3943('0x15')][_0x3943('0x18')]);}else{logger[_0x3943('0x19')](_0x3943('0x17'),_0x44bbc0,_0x3943('0x13'));_0x351286(_0x4954a8[_0x3943('0x1a')][_0x3943('0x18')]);}})[_0x3943('0x1b')](function(_0x6c6399){logger[_0x3943('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x44bbc0,_0x6c6399);_0x2f7e75(_0x6c6399);});});}exports[_0x3943('0x1c')]=function(_0x3948b8){var _0x592bd5=this;return new Promise(function(_0x2b0dc0,_0x3f4a40){return db[_0x3943('0x1d')][_0x3943('0x1e')]({'raw':_0x3948b8[_0x3943('0x1f')]?_0x3948b8[_0x3943('0x1f')][_0x3943('0x20')]===undefined?!![]:![]:!![],'where':_0x3948b8[_0x3943('0x1f')]?_0x3948b8[_0x3943('0x1f')][_0x3943('0x21')]||null:null,'attributes':_0x3948b8[_0x3943('0x1f')]?_0x3948b8[_0x3943('0x1f')]['attributes']||null:null,'limit':_0x3948b8[_0x3943('0x1f')]?_0x3948b8[_0x3943('0x1f')][_0x3943('0x22')]||null:null,'include':_0x3948b8[_0x3943('0x1f')]?_0x3948b8[_0x3943('0x1f')]['include']?_[_0x3943('0x23')](_0x3948b8['options'][_0x3943('0x24')],function(_0x17026c){return{'model':db[_0x17026c[_0x3943('0x25')]],'as':_0x17026c['as'],'attributes':_0x17026c[_0x3943('0x26')],'include':_0x17026c[_0x3943('0x24')]?_['map'](_0x17026c[_0x3943('0x24')],function(_0x140d54){return{'model':db[_0x140d54[_0x3943('0x25')]],'as':_0x140d54['as'],'attributes':_0x140d54['attributes'],'include':_0x140d54[_0x3943('0x24')]?_[_0x3943('0x23')](_0x140d54[_0x3943('0x24')],function(_0x3e53b5){return{'model':db[_0x3e53b5['model']],'as':_0x3e53b5['as'],'attributes':_0x3e53b5[_0x3943('0x26')]};}):[]};}):[]};}):[]:[]})[_0x3943('0x12')](function(_0x21a7fd){logger[_0x3943('0x19')](_0x3943('0x1c'),_0x3948b8);logger[_0x3943('0x27')](_0x3943('0x1c'),_0x3948b8,JSON[_0x3943('0x14')](_0x21a7fd));_0x2b0dc0(_0x21a7fd);})[_0x3943('0x1b')](function(_0x5a5776){logger[_0x3943('0x15')](_0x3943('0x1c'),_0x5a5776[_0x3943('0x18')],_0x3948b8);_0x3f4a40(_0x592bd5['error'](0x1f4,_0x5a5776[_0x3943('0x18')]));});});};exports[_0x3943('0x28')]=function(_0x45401a){var _0x4c583e=this;return new Promise(function(_0x518816,_0x4534b9){return db[_0x3943('0x1d')][_0x3943('0x29')](_0x45401a[_0x3943('0x2a')],{'raw':_0x45401a[_0x3943('0x1f')]?_0x45401a[_0x3943('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x3943('0x12')](function(_0x40a5ba){logger[_0x3943('0x19')]('CreateVoiceQueueReport',_0x45401a);logger['debug'](_0x3943('0x28'),_0x45401a,JSON[_0x3943('0x14')](_0x40a5ba));_0x518816(_0x40a5ba);})[_0x3943('0x1b')](function(_0xb1ca05){logger['error']('CreateVoiceQueueReport',_0xb1ca05[_0x3943('0x18')],_0x45401a);_0x4534b9(_0x4c583e[_0x3943('0x15')](0x1f4,_0xb1ca05[_0x3943('0x18')]));});});};exports[_0x3943('0x2b')]=function(_0x3cdeaa){var _0x1261ce=this;return new Promise(function(_0x4b6314,_0x2bbb8c){return db[_0x3943('0x1d')][_0x3943('0x2c')](_0x3cdeaa[_0x3943('0x2a')],{'raw':_0x3cdeaa[_0x3943('0x1f')]?_0x3cdeaa[_0x3943('0x1f')][_0x3943('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cdeaa['options']?_0x3cdeaa['options'][_0x3943('0x21')]||null:null,'attributes':_0x3cdeaa[_0x3943('0x1f')]?_0x3cdeaa['options'][_0x3943('0x26')]||null:null,'limit':_0x3cdeaa[_0x3943('0x1f')]?_0x3cdeaa[_0x3943('0x1f')][_0x3943('0x22')]||null:null})[_0x3943('0x12')](function(_0xb9dcec){logger[_0x3943('0x19')]('UpdateVoiceQueueReport',_0x3cdeaa);logger['debug'](_0x3943('0x2b'),_0x3cdeaa,JSON['stringify'](_0xb9dcec));_0x4b6314(_0xb9dcec);})[_0x3943('0x1b')](function(_0x4c57a0){logger[_0x3943('0x15')](_0x3943('0x2b'),_0x4c57a0['message'],_0x3cdeaa);_0x2bbb8c(_0x1261ce['error'](0x1f4,_0x4c57a0['message']));});});};
\ No newline at end of file
+var _0xc4da=['update','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceQueueReport','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport'];(function(_0x3b6668,_0x3b3c41){var _0x4e47e6=function(_0x4120d3){while(--_0x4120d3){_0x3b6668['push'](_0x3b6668['shift']());}};_0x4e47e6(++_0x3b3c41);}(_0xc4da,0x1a5));var _0xac4d=function(_0x16fefe,_0x5ea1b0){_0x16fefe=_0x16fefe-0x0;var _0x439998=_0xc4da[_0x16fefe];return _0x439998;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac4d('0x0'));var BPromise=require(_0xac4d('0x1'));var rs=require(_0xac4d('0x2'));var fs=require('fs');var Redis=require(_0xac4d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac4d('0x4'))(_0xac4d('0x5'));var config=require(_0xac4d('0x6'));var jayson=require(_0xac4d('0x7'));var client=jayson[_0xac4d('0x8')][_0xac4d('0x9')]({'port':0x232a});config[_0xac4d('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xac4d('0xb'))(new Redis(config[_0xac4d('0xa')]));require(_0xac4d('0xc'))[_0xac4d('0xd')](socket);function respondWithRpcPromise(_0x1b4132,_0x3b668d,_0xd0589){return new BPromise(function(_0x578519,_0x11a10c){return client[_0xac4d('0xe')](_0x1b4132,_0xd0589)['then'](function(_0x4b68cd){logger[_0xac4d('0xf')](_0xac4d('0x10'),_0x3b668d,'request\x20sent');logger['debug'](_0xac4d('0x11'),_0x3b668d,_0xac4d('0x12'),JSON[_0xac4d('0x13')](_0x4b68cd));if(_0x4b68cd['error']){if(_0x4b68cd[_0xac4d('0x14')]['code']===0x1f4){logger[_0xac4d('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x3b668d,_0x4b68cd[_0xac4d('0x14')][_0xac4d('0x15')]);return _0x11a10c(_0x4b68cd['error']['message']);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3b668d,_0x4b68cd[_0xac4d('0x14')]['message']);return _0x578519(_0x4b68cd[_0xac4d('0x14')][_0xac4d('0x15')]);}else{logger[_0xac4d('0xf')](_0xac4d('0x10'),_0x3b668d,_0xac4d('0x12'));_0x578519(_0x4b68cd[_0xac4d('0x16')][_0xac4d('0x15')]);}})[_0xac4d('0x17')](function(_0x12fcae){logger[_0xac4d('0x14')](_0xac4d('0x10'),_0x3b668d,_0x12fcae);_0x11a10c(_0x12fcae);});});}exports['GetVoiceQueueReport']=function(_0x18a822){var _0x9ce141=this;return new Promise(function(_0x52aec4,_0x5226ee){return db[_0xac4d('0x18')][_0xac4d('0x19')]({'raw':_0x18a822[_0xac4d('0x1a')]?_0x18a822[_0xac4d('0x1a')][_0xac4d('0x1b')]===undefined?!![]:![]:!![],'where':_0x18a822[_0xac4d('0x1a')]?_0x18a822['options'][_0xac4d('0x1c')]||null:null,'attributes':_0x18a822['options']?_0x18a822[_0xac4d('0x1a')][_0xac4d('0x1d')]||null:null,'limit':_0x18a822[_0xac4d('0x1a')]?_0x18a822['options'][_0xac4d('0x1e')]||null:null,'include':_0x18a822[_0xac4d('0x1a')]?_0x18a822[_0xac4d('0x1a')][_0xac4d('0x1f')]?_[_0xac4d('0x20')](_0x18a822['options'][_0xac4d('0x1f')],function(_0x3814d5){return{'model':db[_0x3814d5[_0xac4d('0x21')]],'as':_0x3814d5['as'],'attributes':_0x3814d5['attributes'],'include':_0x3814d5[_0xac4d('0x1f')]?_['map'](_0x3814d5['include'],function(_0x277802){return{'model':db[_0x277802[_0xac4d('0x21')]],'as':_0x277802['as'],'attributes':_0x277802['attributes'],'include':_0x277802[_0xac4d('0x1f')]?_[_0xac4d('0x20')](_0x277802[_0xac4d('0x1f')],function(_0x23e15b){return{'model':db[_0x23e15b[_0xac4d('0x21')]],'as':_0x23e15b['as'],'attributes':_0x23e15b[_0xac4d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xac4d('0x22')](function(_0x3df266){logger[_0xac4d('0xf')](_0xac4d('0x23'),_0x18a822);logger[_0xac4d('0x24')](_0xac4d('0x23'),_0x18a822,JSON[_0xac4d('0x13')](_0x3df266));_0x52aec4(_0x3df266);})[_0xac4d('0x17')](function(_0x4c82e0){logger['error'](_0xac4d('0x23'),_0x4c82e0['message'],_0x18a822);_0x5226ee(_0x9ce141[_0xac4d('0x14')](0x1f4,_0x4c82e0['message']));});});};exports[_0xac4d('0x25')]=function(_0x41e784){var _0x1d5cf9=this;return new Promise(function(_0x251d25,_0x29eb3c){return db['VoiceQueueReport'][_0xac4d('0x26')](_0x41e784[_0xac4d('0x27')],{'raw':_0x41e784[_0xac4d('0x1a')]?_0x41e784[_0xac4d('0x1a')][_0xac4d('0x1b')]===undefined?!![]:![]:!![]})[_0xac4d('0x22')](function(_0x19a1e0){logger['info']('CreateVoiceQueueReport',_0x41e784);logger['debug'](_0xac4d('0x25'),_0x41e784,JSON[_0xac4d('0x13')](_0x19a1e0));_0x251d25(_0x19a1e0);})[_0xac4d('0x17')](function(_0xdba6a4){logger[_0xac4d('0x14')](_0xac4d('0x25'),_0xdba6a4[_0xac4d('0x15')],_0x41e784);_0x29eb3c(_0x1d5cf9[_0xac4d('0x14')](0x1f4,_0xdba6a4[_0xac4d('0x15')]));});});};exports[_0xac4d('0x28')]=function(_0x45e57c){var _0x674f97=this;return new Promise(function(_0x1ee5c6,_0x5d4b9d){return db[_0xac4d('0x18')][_0xac4d('0x29')](_0x45e57c['body'],{'raw':_0x45e57c[_0xac4d('0x1a')]?_0x45e57c[_0xac4d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45e57c['options']?_0x45e57c[_0xac4d('0x1a')][_0xac4d('0x1c')]||null:null,'attributes':_0x45e57c[_0xac4d('0x1a')]?_0x45e57c[_0xac4d('0x1a')][_0xac4d('0x1d')]||null:null,'limit':_0x45e57c[_0xac4d('0x1a')]?_0x45e57c['options'][_0xac4d('0x1e')]||null:null})[_0xac4d('0x22')](function(_0x32841b){logger[_0xac4d('0xf')]('UpdateVoiceQueueReport',_0x45e57c);logger[_0xac4d('0x24')]('UpdateVoiceQueueReport',_0x45e57c,JSON[_0xac4d('0x13')](_0x32841b));_0x1ee5c6(_0x32841b);})['catch'](function(_0x81e1fa){logger[_0xac4d('0x14')](_0xac4d('0x28'),_0x81e1fa[_0xac4d('0x15')],_0x45e57c);_0x5d4b9d(_0x674f97[_0xac4d('0x14')](0x1f4,_0x81e1fa[_0xac4d('0x15')]));});});};
\ No newline at end of file