Built motion from commit 1efd3d96.|2.6.31
[motion2.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
index 124495b..b1d4fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd416=['jayson/promise','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceCallReport','catch','body','CreateVoiceCallReport','update','UpdateVoiceCallReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1bdd2d,_0x308db2){var _0x3f723a=function(_0xff0e6b){while(--_0xff0e6b){_0x1bdd2d['push'](_0x1bdd2d['shift']());}};_0x3f723a(++_0x308db2);}(_0xd416,0x1e2));var _0x6d41=function(_0x4bfbd5,_0x196676){_0x4bfbd5=_0x4bfbd5-0x0;var _0x332bc2=_0xd416[_0x4bfbd5];return _0x332bc2;};'use strict';var _=require(_0x6d41('0x0'));var util=require(_0x6d41('0x1'));var moment=require(_0x6d41('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d41('0x3'));var db=require(_0x6d41('0x4'))['db'];var utils=require(_0x6d41('0x5'));var logger=require('../../config/logger')(_0x6d41('0x6'));var config=require(_0x6d41('0x7'));var jayson=require(_0x6d41('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3811ca,_0x4a2bfe,_0x5de7e7){return new BPromise(function(_0x2702cb,_0x56a197){return client[_0x6d41('0x9')](_0x3811ca,_0x5de7e7)[_0x6d41('0xa')](function(_0x32b9c1){logger[_0x6d41('0xb')](_0x6d41('0xc'),_0x4a2bfe,_0x6d41('0xd'));logger[_0x6d41('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4a2bfe,'request\x20sent',JSON[_0x6d41('0xf')](_0x32b9c1));if(_0x32b9c1[_0x6d41('0x10')]){if(_0x32b9c1[_0x6d41('0x10')]['code']===0x1f4){logger[_0x6d41('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x4a2bfe,_0x32b9c1['error'][_0x6d41('0x11')]);return _0x56a197(_0x32b9c1['error'][_0x6d41('0x11')]);}logger[_0x6d41('0x10')](_0x6d41('0xc'),_0x4a2bfe,_0x32b9c1[_0x6d41('0x10')]['message']);return _0x2702cb(_0x32b9c1['error'][_0x6d41('0x11')]);}else{logger[_0x6d41('0xb')](_0x6d41('0xc'),_0x4a2bfe,_0x6d41('0xd'));_0x2702cb(_0x32b9c1[_0x6d41('0x12')]['message']);}})['catch'](function(_0x3b7720){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x4a2bfe,_0x3b7720);_0x56a197(_0x3b7720);});});}exports['GetVoiceCallReport']=function(_0x2b0569){var _0x547d4b=this;return new Promise(function(_0x52eec9,_0x45426b){return db[_0x6d41('0x13')][_0x6d41('0x14')]({'raw':_0x2b0569[_0x6d41('0x15')]?_0x2b0569[_0x6d41('0x15')][_0x6d41('0x16')]===undefined?!![]:![]:!![],'where':_0x2b0569[_0x6d41('0x15')]?_0x2b0569[_0x6d41('0x15')][_0x6d41('0x17')]||null:null,'attributes':_0x2b0569[_0x6d41('0x15')]?_0x2b0569[_0x6d41('0x15')][_0x6d41('0x18')]||null:null,'limit':_0x2b0569[_0x6d41('0x15')]?_0x2b0569[_0x6d41('0x15')][_0x6d41('0x19')]||null:null,'include':_0x2b0569[_0x6d41('0x15')]?_0x2b0569['options']['include']?_[_0x6d41('0x1a')](_0x2b0569[_0x6d41('0x15')][_0x6d41('0x1b')],function(_0x1ea1cb){return{'model':db[_0x1ea1cb[_0x6d41('0x1c')]],'as':_0x1ea1cb['as'],'attributes':_0x1ea1cb[_0x6d41('0x18')],'include':_0x1ea1cb[_0x6d41('0x1b')]?_['map'](_0x1ea1cb['include'],function(_0x4eb186){return{'model':db[_0x4eb186['model']],'as':_0x4eb186['as'],'attributes':_0x4eb186[_0x6d41('0x18')],'include':_0x4eb186[_0x6d41('0x1b')]?_['map'](_0x4eb186['include'],function(_0x47b2aa){return{'model':db[_0x47b2aa[_0x6d41('0x1c')]],'as':_0x47b2aa['as'],'attributes':_0x47b2aa[_0x6d41('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5eced4){logger[_0x6d41('0xb')](_0x6d41('0x1d'),_0x2b0569);logger[_0x6d41('0xe')](_0x6d41('0x1d'),_0x2b0569,JSON['stringify'](_0x5eced4));_0x52eec9(_0x5eced4);})[_0x6d41('0x1e')](function(_0x2c3a51){logger['error']('GetVoiceCallReport',_0x2c3a51[_0x6d41('0x11')],_0x2b0569);_0x45426b(_0x547d4b[_0x6d41('0x10')](0x1f4,_0x2c3a51[_0x6d41('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x145bf2){var _0x3fd914=this;return new Promise(function(_0x43b11f,_0xce4723){return db['VoiceCallReport']['create'](_0x145bf2[_0x6d41('0x1f')],{'raw':_0x145bf2[_0x6d41('0x15')]?_0x145bf2[_0x6d41('0x15')][_0x6d41('0x16')]===undefined?!![]:![]:!![]})[_0x6d41('0xa')](function(_0x46f036){logger['info'](_0x6d41('0x20'),_0x145bf2);logger['debug']('CreateVoiceCallReport',_0x145bf2,JSON[_0x6d41('0xf')](_0x46f036));_0x43b11f(_0x46f036);})[_0x6d41('0x1e')](function(_0x516bb6){logger[_0x6d41('0x10')](_0x6d41('0x20'),_0x516bb6[_0x6d41('0x11')],_0x145bf2);_0xce4723(_0x3fd914[_0x6d41('0x10')](0x1f4,_0x516bb6[_0x6d41('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0xa8e4c0){var _0x28e871=this;return new Promise(function(_0x33b7e4,_0x501b1e){return db['VoiceCallReport'][_0x6d41('0x21')](_0xa8e4c0['body'],{'raw':_0xa8e4c0[_0x6d41('0x15')]?_0xa8e4c0[_0x6d41('0x15')][_0x6d41('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa8e4c0[_0x6d41('0x15')]?_0xa8e4c0['options'][_0x6d41('0x17')]||null:null,'attributes':_0xa8e4c0[_0x6d41('0x15')]?_0xa8e4c0[_0x6d41('0x15')][_0x6d41('0x18')]||null:null,'limit':_0xa8e4c0['options']?_0xa8e4c0['options'][_0x6d41('0x19')]||null:null})[_0x6d41('0xa')](function(_0x41d1d1){logger[_0x6d41('0xb')](_0x6d41('0x22'),_0xa8e4c0);logger['debug'](_0x6d41('0x22'),_0xa8e4c0,JSON[_0x6d41('0xf')](_0x41d1d1));_0x33b7e4(_0x41d1d1);})[_0x6d41('0x1e')](function(_0x1496f2){logger[_0x6d41('0x10')](_0x6d41('0x22'),_0x1496f2[_0x6d41('0x11')],_0xa8e4c0);_0x501b1e(_0x28e871[_0x6d41('0x10')](0x1f4,_0x1496f2[_0x6d41('0x11')]));});});};
\ No newline at end of file
+var _0xf7fb=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','util','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf7fb,0xe2));var _0xbf7f=function(_0x530dda,_0x3ec0c5){_0x530dda=_0x530dda-0x0;var _0x177e3c=_0xf7fb[_0x530dda];return _0x177e3c;};'use strict';var _=require('lodash');var util=require(_0xbf7f('0x0'));var moment=require(_0xbf7f('0x1'));var BPromise=require(_0xbf7f('0x2'));var rs=require(_0xbf7f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf7f('0x4'))['db'];var utils=require(_0xbf7f('0x5'));var logger=require('../../config/logger')(_0xbf7f('0x6'));var config=require(_0xbf7f('0x7'));var jayson=require(_0xbf7f('0x8'));var client=jayson[_0xbf7f('0x9')][_0xbf7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b65c,_0x6c8f6b,_0x3f5f16){return new BPromise(function(_0x19e786,_0x40b770){return client['request'](_0x50b65c,_0x3f5f16)[_0xbf7f('0xb')](function(_0x7703e6){logger['info'](_0xbf7f('0xc'),_0x6c8f6b,_0xbf7f('0xd'));logger['debug'](_0xbf7f('0xe'),_0x6c8f6b,_0xbf7f('0xd'),JSON['stringify'](_0x7703e6));if(_0x7703e6[_0xbf7f('0xf')]){if(_0x7703e6[_0xbf7f('0xf')][_0xbf7f('0x10')]===0x1f4){logger[_0xbf7f('0xf')](_0xbf7f('0xc'),_0x6c8f6b,_0x7703e6[_0xbf7f('0xf')][_0xbf7f('0x11')]);return _0x40b770(_0x7703e6['error']['message']);}logger[_0xbf7f('0xf')](_0xbf7f('0xc'),_0x6c8f6b,_0x7703e6[_0xbf7f('0xf')][_0xbf7f('0x11')]);return _0x19e786(_0x7703e6[_0xbf7f('0xf')][_0xbf7f('0x11')]);}else{logger[_0xbf7f('0x12')](_0xbf7f('0xc'),_0x6c8f6b,_0xbf7f('0xd'));_0x19e786(_0x7703e6[_0xbf7f('0x13')]['message']);}})[_0xbf7f('0x14')](function(_0x1c66da){logger[_0xbf7f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x6c8f6b,_0x1c66da);_0x40b770(_0x1c66da);});});}exports[_0xbf7f('0x15')]=function(_0x3fe15d){var _0x40519d=this;return new Promise(function(_0x17337a,_0x2faf3f){return db[_0xbf7f('0x16')][_0xbf7f('0x17')]({'raw':_0x3fe15d[_0xbf7f('0x18')]?_0x3fe15d['options'][_0xbf7f('0x19')]===undefined?!![]:![]:!![],'where':_0x3fe15d['options']?_0x3fe15d[_0xbf7f('0x18')][_0xbf7f('0x1a')]||null:null,'attributes':_0x3fe15d[_0xbf7f('0x18')]?_0x3fe15d[_0xbf7f('0x18')][_0xbf7f('0x1b')]||null:null,'limit':_0x3fe15d[_0xbf7f('0x18')]?_0x3fe15d['options'][_0xbf7f('0x1c')]||null:null,'include':_0x3fe15d['options']?_0x3fe15d[_0xbf7f('0x18')][_0xbf7f('0x1d')]?_[_0xbf7f('0x1e')](_0x3fe15d[_0xbf7f('0x18')]['include'],function(_0x204743){return{'model':db[_0x204743['model']],'as':_0x204743['as'],'attributes':_0x204743[_0xbf7f('0x1b')],'include':_0x204743[_0xbf7f('0x1d')]?_['map'](_0x204743[_0xbf7f('0x1d')],function(_0x5ba270){return{'model':db[_0x5ba270[_0xbf7f('0x1f')]],'as':_0x5ba270['as'],'attributes':_0x5ba270[_0xbf7f('0x1b')],'include':_0x5ba270[_0xbf7f('0x1d')]?_['map'](_0x5ba270['include'],function(_0x3e1bd1){return{'model':db[_0x3e1bd1['model']],'as':_0x3e1bd1['as'],'attributes':_0x3e1bd1[_0xbf7f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbf7f('0xb')](function(_0x3b3a2f){logger[_0xbf7f('0x12')](_0xbf7f('0x15'),_0x3fe15d);logger[_0xbf7f('0x20')](_0xbf7f('0x15'),_0x3fe15d,JSON[_0xbf7f('0x21')](_0x3b3a2f));_0x17337a(_0x3b3a2f);})[_0xbf7f('0x14')](function(_0x44e396){logger[_0xbf7f('0xf')](_0xbf7f('0x15'),_0x44e396['message'],_0x3fe15d);_0x2faf3f(_0x40519d[_0xbf7f('0xf')](0x1f4,_0x44e396[_0xbf7f('0x11')]));});});};exports[_0xbf7f('0x22')]=function(_0x181b68){var _0xbdd4a9=this;return new Promise(function(_0x5aa1de,_0x19959f){return db[_0xbf7f('0x16')][_0xbf7f('0x23')](_0x181b68[_0xbf7f('0x24')],{'raw':_0x181b68[_0xbf7f('0x18')]?_0x181b68['options']['raw']===undefined?!![]:![]:!![]})[_0xbf7f('0xb')](function(_0x2a2a63){logger[_0xbf7f('0x12')](_0xbf7f('0x22'),_0x181b68);logger[_0xbf7f('0x20')](_0xbf7f('0x22'),_0x181b68,JSON[_0xbf7f('0x21')](_0x2a2a63));_0x5aa1de(_0x2a2a63);})[_0xbf7f('0x14')](function(_0x2897d5){logger[_0xbf7f('0xf')](_0xbf7f('0x22'),_0x2897d5[_0xbf7f('0x11')],_0x181b68);_0x19959f(_0xbdd4a9['error'](0x1f4,_0x2897d5[_0xbf7f('0x11')]));});});};exports[_0xbf7f('0x25')]=function(_0x549b3a){var _0x59310b=this;return new Promise(function(_0x15d9e3,_0x3f0e89){return db[_0xbf7f('0x16')]['update'](_0x549b3a[_0xbf7f('0x24')],{'raw':_0x549b3a['options']?_0x549b3a[_0xbf7f('0x18')][_0xbf7f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x549b3a['options']?_0x549b3a[_0xbf7f('0x18')][_0xbf7f('0x1a')]||null:null,'attributes':_0x549b3a['options']?_0x549b3a[_0xbf7f('0x18')][_0xbf7f('0x1b')]||null:null,'limit':_0x549b3a[_0xbf7f('0x18')]?_0x549b3a[_0xbf7f('0x18')][_0xbf7f('0x1c')]||null:null})[_0xbf7f('0xb')](function(_0x45c263){logger[_0xbf7f('0x12')](_0xbf7f('0x25'),_0x549b3a);logger['debug'](_0xbf7f('0x25'),_0x549b3a,JSON[_0xbf7f('0x21')](_0x45c263));_0x15d9e3(_0x45c263);})[_0xbf7f('0x14')](function(_0x203084){logger['error'](_0xbf7f('0x25'),_0x203084['message'],_0x549b3a);_0x3f0e89(_0x59310b['error'](0x1f4,_0x203084[_0xbf7f('0x11')]));});});};
\ No newline at end of file