Built motion from commit fa4c4286.|2.6.29
[motion2.git] / server / api / voiceCallReport / voiceCallReport.rpc.js
index 7bb84ea..56d4134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa90f=['where','attributes','include','map','model','CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options'];(function(_0x7c0674,_0x1e846b){var _0x4a5358=function(_0x4e9902){while(--_0x4e9902){_0x7c0674['push'](_0x7c0674['shift']());}};_0x4a5358(++_0x1e846b);}(_0xa90f,0x175));var _0xfa90=function(_0x3335f6,_0x4a6989){_0x3335f6=_0x3335f6-0x0;var _0x2405e9=_0xa90f[_0x3335f6];return _0x2405e9;};'use strict';var _=require(_0xfa90('0x0'));var util=require(_0xfa90('0x1'));var moment=require(_0xfa90('0x2'));var BPromise=require(_0xfa90('0x3'));var rs=require(_0xfa90('0x4'));var fs=require('fs');var Redis=require(_0xfa90('0x5'));var db=require(_0xfa90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa90('0x7'))('rpc');var config=require(_0xfa90('0x8'));var jayson=require(_0xfa90('0x9'));var client=jayson['client'][_0xfa90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a0c10,_0x1424d7,_0x58d74b){return new BPromise(function(_0x1721e0,_0x2174c7){return client[_0xfa90('0xb')](_0x2a0c10,_0x58d74b)['then'](function(_0x2f140b){logger[_0xfa90('0xc')](_0xfa90('0xd'),_0x1424d7,_0xfa90('0xe'));logger[_0xfa90('0xf')](_0xfa90('0x10'),_0x1424d7,_0xfa90('0xe'),JSON[_0xfa90('0x11')](_0x2f140b));if(_0x2f140b['error']){if(_0x2f140b[_0xfa90('0x12')][_0xfa90('0x13')]===0x1f4){logger[_0xfa90('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1424d7,_0x2f140b[_0xfa90('0x12')][_0xfa90('0x14')]);return _0x2174c7(_0x2f140b['error'][_0xfa90('0x14')]);}logger[_0xfa90('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1424d7,_0x2f140b[_0xfa90('0x12')]['message']);return _0x1721e0(_0x2f140b[_0xfa90('0x12')][_0xfa90('0x14')]);}else{logger['info'](_0xfa90('0xd'),_0x1424d7,_0xfa90('0xe'));_0x1721e0(_0x2f140b[_0xfa90('0x15')][_0xfa90('0x14')]);}})[_0xfa90('0x16')](function(_0x5c2d3e){logger[_0xfa90('0x12')](_0xfa90('0xd'),_0x1424d7,_0x5c2d3e);_0x2174c7(_0x5c2d3e);});});}exports[_0xfa90('0x17')]=function(_0x3277af){var _0x3e0204=this;return new Promise(function(_0x5638d3,_0x18e663){return db[_0xfa90('0x18')][_0xfa90('0x19')]({'raw':_0x3277af[_0xfa90('0x1a')]?_0x3277af['options']['raw']===undefined?!![]:![]:!![],'where':_0x3277af[_0xfa90('0x1a')]?_0x3277af[_0xfa90('0x1a')][_0xfa90('0x1b')]||null:null,'attributes':_0x3277af[_0xfa90('0x1a')]?_0x3277af[_0xfa90('0x1a')][_0xfa90('0x1c')]||null:null,'limit':_0x3277af[_0xfa90('0x1a')]?_0x3277af['options']['limit']||null:null,'include':_0x3277af['options']?_0x3277af[_0xfa90('0x1a')][_0xfa90('0x1d')]?_[_0xfa90('0x1e')](_0x3277af[_0xfa90('0x1a')]['include'],function(_0x22986a){return{'model':db[_0x22986a[_0xfa90('0x1f')]],'as':_0x22986a['as'],'attributes':_0x22986a['attributes'],'include':_0x22986a[_0xfa90('0x1d')]?_['map'](_0x22986a[_0xfa90('0x1d')],function(_0x2fa581){return{'model':db[_0x2fa581['model']],'as':_0x2fa581['as'],'attributes':_0x2fa581[_0xfa90('0x1c')],'include':_0x2fa581[_0xfa90('0x1d')]?_['map'](_0x2fa581[_0xfa90('0x1d')],function(_0xe614b9){return{'model':db[_0xe614b9[_0xfa90('0x1f')]],'as':_0xe614b9['as'],'attributes':_0xe614b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11b6fa){logger[_0xfa90('0xc')](_0xfa90('0x17'),_0x3277af);logger[_0xfa90('0xf')](_0xfa90('0x17'),_0x3277af,JSON[_0xfa90('0x11')](_0x11b6fa));_0x5638d3(_0x11b6fa);})[_0xfa90('0x16')](function(_0x3322cc){logger[_0xfa90('0x12')](_0xfa90('0x17'),_0x3322cc['message'],_0x3277af);_0x18e663(_0x3e0204[_0xfa90('0x12')](0x1f4,_0x3322cc[_0xfa90('0x14')]));});});};exports[_0xfa90('0x20')]=function(_0x2029f2){var _0x27dbdb=this;return new Promise(function(_0x30188d,_0x1c7477){return db['VoiceCallReport'][_0xfa90('0x21')](_0x2029f2[_0xfa90('0x22')],{'raw':_0x2029f2[_0xfa90('0x1a')]?_0x2029f2[_0xfa90('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xfa90('0x23')](function(_0x1c5242){logger[_0xfa90('0xc')](_0xfa90('0x20'),_0x2029f2);logger[_0xfa90('0xf')]('CreateVoiceCallReport',_0x2029f2,JSON['stringify'](_0x1c5242));_0x30188d(_0x1c5242);})[_0xfa90('0x16')](function(_0x3410ce){logger[_0xfa90('0x12')](_0xfa90('0x20'),_0x3410ce[_0xfa90('0x14')],_0x2029f2);_0x1c7477(_0x27dbdb[_0xfa90('0x12')](0x1f4,_0x3410ce[_0xfa90('0x14')]));});});};exports[_0xfa90('0x24')]=function(_0x1d6847){var _0x52063a=this;return new Promise(function(_0x18db72,_0x262518){return db['VoiceCallReport'][_0xfa90('0x25')](_0x1d6847[_0xfa90('0x22')],{'raw':_0x1d6847[_0xfa90('0x1a')]?_0x1d6847[_0xfa90('0x1a')][_0xfa90('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d6847['options']?_0x1d6847[_0xfa90('0x1a')]['where']||null:null,'attributes':_0x1d6847[_0xfa90('0x1a')]?_0x1d6847[_0xfa90('0x1a')][_0xfa90('0x1c')]||null:null,'limit':_0x1d6847[_0xfa90('0x1a')]?_0x1d6847[_0xfa90('0x1a')][_0xfa90('0x27')]||null:null})[_0xfa90('0x23')](function(_0x1d6b81){logger[_0xfa90('0xc')](_0xfa90('0x24'),_0x1d6847);logger[_0xfa90('0xf')](_0xfa90('0x24'),_0x1d6847,JSON[_0xfa90('0x11')](_0x1d6b81));_0x18db72(_0x1d6b81);})['catch'](function(_0x52e89c){logger[_0xfa90('0x12')](_0xfa90('0x24'),_0x52e89c[_0xfa90('0x14')],_0x1d6847);_0x262518(_0x52063a[_0xfa90('0x12')](0x1f4,_0x52e89c[_0xfa90('0x14')]));});});};
\ No newline at end of file
+var _0x7406=['GetVoiceCallReport','options','raw','where','limit','include','map','attributes','model','stringify','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x7406,0x10c));var _0x6740=function(_0x580c7f,_0x2ecf18){_0x580c7f=_0x580c7f-0x0;var _0x3b90e1=_0x7406[_0x580c7f];return _0x3b90e1;};'use strict';var _=require('lodash');var util=require(_0x6740('0x0'));var moment=require(_0x6740('0x1'));var BPromise=require('bluebird');var rs=require(_0x6740('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6740('0x3'))['db'];var utils=require(_0x6740('0x4'));var logger=require(_0x6740('0x5'))(_0x6740('0x6'));var config=require('../../config/environment');var jayson=require(_0x6740('0x7'));var client=jayson[_0x6740('0x8')][_0x6740('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a683f,_0x3cb60b,_0x2a6a8e){return new BPromise(function(_0x5cb2be,_0x1b44c4){return client['request'](_0x4a683f,_0x2a6a8e)[_0x6740('0xa')](function(_0x25de9f){logger[_0x6740('0xb')](_0x6740('0xc'),_0x3cb60b,_0x6740('0xd'));logger[_0x6740('0xe')](_0x6740('0xf'),_0x3cb60b,_0x6740('0xd'),JSON['stringify'](_0x25de9f));if(_0x25de9f[_0x6740('0x10')]){if(_0x25de9f['error'][_0x6740('0x11')]===0x1f4){logger[_0x6740('0x10')](_0x6740('0xc'),_0x3cb60b,_0x25de9f[_0x6740('0x10')][_0x6740('0x12')]);return _0x1b44c4(_0x25de9f[_0x6740('0x10')][_0x6740('0x12')]);}logger['error'](_0x6740('0xc'),_0x3cb60b,_0x25de9f[_0x6740('0x10')]['message']);return _0x5cb2be(_0x25de9f['error']['message']);}else{logger[_0x6740('0xb')](_0x6740('0xc'),_0x3cb60b,_0x6740('0xd'));_0x5cb2be(_0x25de9f['result'][_0x6740('0x12')]);}})[_0x6740('0x13')](function(_0x4229b2){logger[_0x6740('0x10')](_0x6740('0xc'),_0x3cb60b,_0x4229b2);_0x1b44c4(_0x4229b2);});});}exports[_0x6740('0x14')]=function(_0x1eea69){var _0x30ffe0=this;return new Promise(function(_0x4b5326,_0x20738c){return db['VoiceCallReport']['findAll']({'raw':_0x1eea69[_0x6740('0x15')]?_0x1eea69['options'][_0x6740('0x16')]===undefined?!![]:![]:!![],'where':_0x1eea69[_0x6740('0x15')]?_0x1eea69[_0x6740('0x15')][_0x6740('0x17')]||null:null,'attributes':_0x1eea69[_0x6740('0x15')]?_0x1eea69['options']['attributes']||null:null,'limit':_0x1eea69['options']?_0x1eea69[_0x6740('0x15')][_0x6740('0x18')]||null:null,'include':_0x1eea69[_0x6740('0x15')]?_0x1eea69[_0x6740('0x15')][_0x6740('0x19')]?_[_0x6740('0x1a')](_0x1eea69[_0x6740('0x15')]['include'],function(_0x46881a){return{'model':db[_0x46881a['model']],'as':_0x46881a['as'],'attributes':_0x46881a[_0x6740('0x1b')],'include':_0x46881a['include']?_[_0x6740('0x1a')](_0x46881a[_0x6740('0x19')],function(_0x51c8c0){return{'model':db[_0x51c8c0[_0x6740('0x1c')]],'as':_0x51c8c0['as'],'attributes':_0x51c8c0[_0x6740('0x1b')],'include':_0x51c8c0[_0x6740('0x19')]?_[_0x6740('0x1a')](_0x51c8c0[_0x6740('0x19')],function(_0x18eb17){return{'model':db[_0x18eb17[_0x6740('0x1c')]],'as':_0x18eb17['as'],'attributes':_0x18eb17[_0x6740('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe4d6fe){logger[_0x6740('0xb')]('GetVoiceCallReport',_0x1eea69);logger[_0x6740('0xe')]('GetVoiceCallReport',_0x1eea69,JSON[_0x6740('0x1d')](_0xe4d6fe));_0x4b5326(_0xe4d6fe);})[_0x6740('0x13')](function(_0x242ecf){logger['error'](_0x6740('0x14'),_0x242ecf[_0x6740('0x12')],_0x1eea69);_0x20738c(_0x30ffe0[_0x6740('0x10')](0x1f4,_0x242ecf[_0x6740('0x12')]));});});};exports[_0x6740('0x1e')]=function(_0x410a5d){var _0x2f99be=this;return new Promise(function(_0x398d78,_0x4cb513){return db[_0x6740('0x1f')][_0x6740('0x20')](_0x410a5d[_0x6740('0x21')],{'raw':_0x410a5d[_0x6740('0x15')]?_0x410a5d[_0x6740('0x15')][_0x6740('0x16')]===undefined?!![]:![]:!![]})[_0x6740('0xa')](function(_0x269d7a){logger['info'](_0x6740('0x1e'),_0x410a5d);logger['debug'](_0x6740('0x1e'),_0x410a5d,JSON['stringify'](_0x269d7a));_0x398d78(_0x269d7a);})[_0x6740('0x13')](function(_0x310fe7){logger[_0x6740('0x10')]('CreateVoiceCallReport',_0x310fe7[_0x6740('0x12')],_0x410a5d);_0x4cb513(_0x2f99be[_0x6740('0x10')](0x1f4,_0x310fe7[_0x6740('0x12')]));});});};exports[_0x6740('0x22')]=function(_0x272c24){var _0x1abdf2=this;return new Promise(function(_0x331731,_0x25e2ca){return db[_0x6740('0x1f')][_0x6740('0x23')](_0x272c24[_0x6740('0x21')],{'raw':_0x272c24['options']?_0x272c24['options'][_0x6740('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272c24[_0x6740('0x15')]?_0x272c24[_0x6740('0x15')]['where']||null:null,'attributes':_0x272c24[_0x6740('0x15')]?_0x272c24[_0x6740('0x15')]['attributes']||null:null,'limit':_0x272c24[_0x6740('0x15')]?_0x272c24[_0x6740('0x15')][_0x6740('0x18')]||null:null})['then'](function(_0x14fd86){logger[_0x6740('0xb')]('UpdateVoiceCallReport',_0x272c24);logger[_0x6740('0xe')](_0x6740('0x22'),_0x272c24,JSON['stringify'](_0x14fd86));_0x331731(_0x14fd86);})[_0x6740('0x13')](function(_0x431e1c){logger['error']('UpdateVoiceCallReport',_0x431e1c['message'],_0x272c24);_0x25e2ca(_0x1abdf2[_0x6740('0x10')](0x1f4,_0x431e1c[_0x6740('0x12')]));});});};
\ No newline at end of file