Built motion from commit 08fb8613.|2.6.31
[motion2.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
index 716c59b..6d455f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7af=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','moment'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0xf7af,0xe9));var _0xff7a=function(_0x2d4a37,_0xb2d2e5){_0x2d4a37=_0x2d4a37-0x0;var _0x4d575d=_0xf7af[_0x2d4a37];return _0x4d575d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff7a('0x0'));var BPromise=require(_0xff7a('0x1'));var rs=require(_0xff7a('0x2'));var fs=require('fs');var Redis=require(_0xff7a('0x3'));var db=require(_0xff7a('0x4'))['db'];var utils=require(_0xff7a('0x5'));var logger=require('../../config/logger')(_0xff7a('0x6'));var config=require(_0xff7a('0x7'));var jayson=require(_0xff7a('0x8'));var client=jayson[_0xff7a('0x9')][_0xff7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472f43,_0x3a76ff,_0x49ef45){return new BPromise(function(_0x3485fb,_0x3facd7){return client[_0xff7a('0xb')](_0x472f43,_0x49ef45)[_0xff7a('0xc')](function(_0x4fff12){logger[_0xff7a('0xd')](_0xff7a('0xe'),_0x3a76ff,_0xff7a('0xf'));logger[_0xff7a('0x10')](_0xff7a('0x11'),_0x3a76ff,_0xff7a('0xf'),JSON[_0xff7a('0x12')](_0x4fff12));if(_0x4fff12[_0xff7a('0x13')]){if(_0x4fff12[_0xff7a('0x13')][_0xff7a('0x14')]===0x1f4){logger[_0xff7a('0x13')](_0xff7a('0xe'),_0x3a76ff,_0x4fff12[_0xff7a('0x13')][_0xff7a('0x15')]);return _0x3facd7(_0x4fff12['error']['message']);}logger[_0xff7a('0x13')](_0xff7a('0xe'),_0x3a76ff,_0x4fff12[_0xff7a('0x13')][_0xff7a('0x15')]);return _0x3485fb(_0x4fff12[_0xff7a('0x13')][_0xff7a('0x15')]);}else{logger['info'](_0xff7a('0xe'),_0x3a76ff,_0xff7a('0xf'));_0x3485fb(_0x4fff12['result'][_0xff7a('0x15')]);}})['catch'](function(_0xabb9bd){logger[_0xff7a('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x3a76ff,_0xabb9bd);_0x3facd7(_0xabb9bd);});});}exports[_0xff7a('0x16')]=function(_0x8f4191){var _0x12f6ba=this;return new Promise(function(_0x5f6b77,_0x2a1710){return db[_0xff7a('0x17')][_0xff7a('0x18')]({'raw':_0x8f4191[_0xff7a('0x19')]?_0x8f4191[_0xff7a('0x19')][_0xff7a('0x1a')]===undefined?!![]:![]:!![],'where':_0x8f4191['options']?_0x8f4191[_0xff7a('0x19')][_0xff7a('0x1b')]||null:null,'attributes':_0x8f4191[_0xff7a('0x19')]?_0x8f4191[_0xff7a('0x19')][_0xff7a('0x1c')]||null:null,'limit':_0x8f4191[_0xff7a('0x19')]?_0x8f4191['options'][_0xff7a('0x1d')]||null:null,'include':_0x8f4191[_0xff7a('0x19')]?_0x8f4191[_0xff7a('0x19')][_0xff7a('0x1e')]?_[_0xff7a('0x1f')](_0x8f4191['options'][_0xff7a('0x1e')],function(_0x4ec17c){return{'model':db[_0x4ec17c[_0xff7a('0x20')]],'as':_0x4ec17c['as'],'attributes':_0x4ec17c['attributes'],'include':_0x4ec17c[_0xff7a('0x1e')]?_[_0xff7a('0x1f')](_0x4ec17c[_0xff7a('0x1e')],function(_0x1f0ff5){return{'model':db[_0x1f0ff5[_0xff7a('0x20')]],'as':_0x1f0ff5['as'],'attributes':_0x1f0ff5[_0xff7a('0x1c')],'include':_0x1f0ff5[_0xff7a('0x1e')]?_[_0xff7a('0x1f')](_0x1f0ff5['include'],function(_0x53eb1d){return{'model':db[_0x53eb1d[_0xff7a('0x20')]],'as':_0x53eb1d['as'],'attributes':_0x53eb1d[_0xff7a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d4d66){logger[_0xff7a('0xd')](_0xff7a('0x16'),_0x8f4191);logger[_0xff7a('0x10')](_0xff7a('0x16'),_0x8f4191,JSON[_0xff7a('0x12')](_0x3d4d66));_0x5f6b77(_0x3d4d66);})[_0xff7a('0x21')](function(_0x24f70b){logger['error'](_0xff7a('0x16'),_0x24f70b['message'],_0x8f4191);_0x2a1710(_0x12f6ba[_0xff7a('0x13')](0x1f4,_0x24f70b[_0xff7a('0x15')]));});});};exports[_0xff7a('0x22')]=function(_0x364957){var _0x1c2271=this;return new Promise(function(_0x45be28,_0x16d670){return db[_0xff7a('0x17')][_0xff7a('0x23')](_0x364957[_0xff7a('0x24')],{'raw':_0x364957['options']?_0x364957[_0xff7a('0x19')][_0xff7a('0x1a')]===undefined?!![]:![]:!![]})[_0xff7a('0xc')](function(_0x1da071){logger[_0xff7a('0xd')](_0xff7a('0x22'),_0x364957);logger[_0xff7a('0x10')](_0xff7a('0x22'),_0x364957,JSON[_0xff7a('0x12')](_0x1da071));_0x45be28(_0x1da071);})[_0xff7a('0x21')](function(_0x3e349d){logger['error'](_0xff7a('0x22'),_0x3e349d[_0xff7a('0x15')],_0x364957);_0x16d670(_0x1c2271[_0xff7a('0x13')](0x1f4,_0x3e349d['message']));});});};exports[_0xff7a('0x25')]=function(_0x695f46){var _0x1199a1=this;return new Promise(function(_0x2ab37b,_0x4d6309){return db[_0xff7a('0x17')][_0xff7a('0x26')](_0x695f46['body'],{'raw':_0x695f46['options']?_0x695f46[_0xff7a('0x19')][_0xff7a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x695f46[_0xff7a('0x19')]?_0x695f46[_0xff7a('0x19')][_0xff7a('0x1b')]||null:null,'attributes':_0x695f46['options']?_0x695f46['options'][_0xff7a('0x1c')]||null:null,'limit':_0x695f46['options']?_0x695f46[_0xff7a('0x19')][_0xff7a('0x1d')]||null:null})[_0xff7a('0xc')](function(_0x293dd5){logger[_0xff7a('0xd')](_0xff7a('0x25'),_0x695f46);logger[_0xff7a('0x10')](_0xff7a('0x25'),_0x695f46,JSON['stringify'](_0x293dd5));_0x2ab37b(_0x293dd5);})['catch'](function(_0x1a3782){logger[_0xff7a('0x13')](_0xff7a('0x25'),_0x1a3782[_0xff7a('0x15')],_0x695f46);_0x4d6309(_0x1199a1[_0xff7a('0x13')](0x1f4,_0x1a3782['message']));});});};
\ No newline at end of file
+var _0xba54=['code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','create','then','UpdateVoiceCallReport','update','where','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0xba54,0x12c));var _0x4ba5=function(_0x6e5e38,_0x58cfec){_0x6e5e38=_0x6e5e38-0x0;var _0x1e95c2=_0xba54[_0x6e5e38];return _0x1e95c2;};'use strict';var _=require('lodash');var util=require(_0x4ba5('0x0'));var moment=require('moment');var BPromise=require(_0x4ba5('0x1'));var rs=require(_0x4ba5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ba5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ba5('0x4'))(_0x4ba5('0x5'));var config=require('../../config/environment');var jayson=require(_0x4ba5('0x6'));var client=jayson['client'][_0x4ba5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b8298,_0x2e6cc3,_0x58e586){return new BPromise(function(_0x22965c,_0xd0781f){return client['request'](_0x1b8298,_0x58e586)['then'](function(_0x2707bf){logger[_0x4ba5('0x8')](_0x4ba5('0x9'),_0x2e6cc3,_0x4ba5('0xa'));logger[_0x4ba5('0xb')](_0x4ba5('0xc'),_0x2e6cc3,_0x4ba5('0xa'),JSON[_0x4ba5('0xd')](_0x2707bf));if(_0x2707bf['error']){if(_0x2707bf[_0x4ba5('0xe')][_0x4ba5('0xf')]===0x1f4){logger[_0x4ba5('0xe')](_0x4ba5('0x9'),_0x2e6cc3,_0x2707bf[_0x4ba5('0xe')][_0x4ba5('0x10')]);return _0xd0781f(_0x2707bf['error'][_0x4ba5('0x10')]);}logger[_0x4ba5('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x2e6cc3,_0x2707bf[_0x4ba5('0xe')][_0x4ba5('0x10')]);return _0x22965c(_0x2707bf[_0x4ba5('0xe')][_0x4ba5('0x10')]);}else{logger[_0x4ba5('0x8')](_0x4ba5('0x9'),_0x2e6cc3,_0x4ba5('0xa'));_0x22965c(_0x2707bf[_0x4ba5('0x11')][_0x4ba5('0x10')]);}})[_0x4ba5('0x12')](function(_0x2ed011){logger['error'](_0x4ba5('0x9'),_0x2e6cc3,_0x2ed011);_0xd0781f(_0x2ed011);});});}exports[_0x4ba5('0x13')]=function(_0x19f973){var _0x39a462=this;return new Promise(function(_0x43342f,_0x52382e){return db[_0x4ba5('0x14')][_0x4ba5('0x15')]({'raw':_0x19f973[_0x4ba5('0x16')]?_0x19f973[_0x4ba5('0x16')][_0x4ba5('0x17')]===undefined?!![]:![]:!![],'where':_0x19f973[_0x4ba5('0x16')]?_0x19f973[_0x4ba5('0x16')]['where']||null:null,'attributes':_0x19f973[_0x4ba5('0x16')]?_0x19f973['options'][_0x4ba5('0x18')]||null:null,'limit':_0x19f973[_0x4ba5('0x16')]?_0x19f973['options'][_0x4ba5('0x19')]||null:null,'include':_0x19f973[_0x4ba5('0x16')]?_0x19f973['options'][_0x4ba5('0x1a')]?_[_0x4ba5('0x1b')](_0x19f973['options'][_0x4ba5('0x1a')],function(_0x36d8f0){return{'model':db[_0x36d8f0['model']],'as':_0x36d8f0['as'],'attributes':_0x36d8f0['attributes'],'include':_0x36d8f0[_0x4ba5('0x1a')]?_[_0x4ba5('0x1b')](_0x36d8f0[_0x4ba5('0x1a')],function(_0x1ebe8e){return{'model':db[_0x1ebe8e[_0x4ba5('0x1c')]],'as':_0x1ebe8e['as'],'attributes':_0x1ebe8e[_0x4ba5('0x18')],'include':_0x1ebe8e['include']?_['map'](_0x1ebe8e[_0x4ba5('0x1a')],function(_0x4f81b9){return{'model':db[_0x4f81b9['model']],'as':_0x4f81b9['as'],'attributes':_0x4f81b9[_0x4ba5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7af5fb){logger[_0x4ba5('0x8')]('GetVoiceCallReport',_0x19f973);logger[_0x4ba5('0xb')]('GetVoiceCallReport',_0x19f973,JSON['stringify'](_0x7af5fb));_0x43342f(_0x7af5fb);})[_0x4ba5('0x12')](function(_0x2adcfa){logger[_0x4ba5('0xe')](_0x4ba5('0x13'),_0x2adcfa[_0x4ba5('0x10')],_0x19f973);_0x52382e(_0x39a462[_0x4ba5('0xe')](0x1f4,_0x2adcfa[_0x4ba5('0x10')]));});});};exports[_0x4ba5('0x1d')]=function(_0x36d4cb){var _0x4500f0=this;return new Promise(function(_0x185a04,_0x3681f1){return db[_0x4ba5('0x14')][_0x4ba5('0x1e')](_0x36d4cb['body'],{'raw':_0x36d4cb[_0x4ba5('0x16')]?_0x36d4cb[_0x4ba5('0x16')][_0x4ba5('0x17')]===undefined?!![]:![]:!![]})[_0x4ba5('0x1f')](function(_0x366494){logger[_0x4ba5('0x8')]('CreateVoiceCallReport',_0x36d4cb);logger[_0x4ba5('0xb')](_0x4ba5('0x1d'),_0x36d4cb,JSON[_0x4ba5('0xd')](_0x366494));_0x185a04(_0x366494);})[_0x4ba5('0x12')](function(_0x340c69){logger[_0x4ba5('0xe')]('CreateVoiceCallReport',_0x340c69[_0x4ba5('0x10')],_0x36d4cb);_0x3681f1(_0x4500f0[_0x4ba5('0xe')](0x1f4,_0x340c69[_0x4ba5('0x10')]));});});};exports[_0x4ba5('0x20')]=function(_0x58f178){var _0xd051e4=this;return new Promise(function(_0x24c997,_0x7eb22c){return db[_0x4ba5('0x14')][_0x4ba5('0x21')](_0x58f178['body'],{'raw':_0x58f178[_0x4ba5('0x16')]?_0x58f178[_0x4ba5('0x16')][_0x4ba5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f178[_0x4ba5('0x16')]?_0x58f178['options'][_0x4ba5('0x22')]||null:null,'attributes':_0x58f178['options']?_0x58f178[_0x4ba5('0x16')]['attributes']||null:null,'limit':_0x58f178[_0x4ba5('0x16')]?_0x58f178[_0x4ba5('0x16')][_0x4ba5('0x19')]||null:null})[_0x4ba5('0x1f')](function(_0x48c9b2){logger['info'](_0x4ba5('0x20'),_0x58f178);logger['debug'](_0x4ba5('0x20'),_0x58f178,JSON[_0x4ba5('0xd')](_0x48c9b2));_0x24c997(_0x48c9b2);})['catch'](function(_0x4ecfc2){logger[_0x4ba5('0xe')]('UpdateVoiceCallReport',_0x4ecfc2[_0x4ba5('0x10')],_0x58f178);_0x7eb22c(_0xd051e4['error'](0x1f4,_0x4ecfc2[_0x4ba5('0x10')]));});});};
\ No newline at end of file