Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 012646e..6144fb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a11=['rpc','jayson/promise','client','http','localhost','redis','./faxInteraction.socket','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','FaxInteraction','options','raw','where','limit','then','catch','UpdateFaxInteraction','AddTagsToFaxInteraction','find','body','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3588ce,_0x5c5238){var _0x8cda3f=function(_0xe29311){while(--_0xe29311){_0x3588ce['push'](_0x3588ce['shift']());}};_0x8cda3f(++_0x5c5238);}(_0x7a11,0x175));var _0x17a1=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x7a11[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x17a1('0x0'));var util=require(_0x17a1('0x1'));var moment=require(_0x17a1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17a1('0x3'));var db=require(_0x17a1('0x4'))['db'];var utils=require(_0x17a1('0x5'));var logger=require(_0x17a1('0x6'))(_0x17a1('0x7'));var config=require('../../config/environment');var jayson=require(_0x17a1('0x8'));var client=jayson[_0x17a1('0x9')][_0x17a1('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x17a1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17a1('0xc')]));require(_0x17a1('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ce60c,_0x9460dc,_0x3a2bd8){return new BPromise(function(_0x3f3774,_0x596155){return client['request'](_0x3ce60c,_0x3a2bd8)['then'](function(_0x1cc3b3){logger[_0x17a1('0xe')](_0x17a1('0xf'),_0x9460dc,'request\x20sent');logger[_0x17a1('0x10')](_0x17a1('0x11'),_0x9460dc,_0x17a1('0x12'),JSON[_0x17a1('0x13')](_0x1cc3b3));if(_0x1cc3b3[_0x17a1('0x14')]){if(_0x1cc3b3['error'][_0x17a1('0x15')]===0x1f4){logger[_0x17a1('0x14')](_0x17a1('0xf'),_0x9460dc,_0x1cc3b3[_0x17a1('0x14')][_0x17a1('0x16')]);return _0x596155(_0x1cc3b3['error'][_0x17a1('0x16')]);}logger['error'](_0x17a1('0xf'),_0x9460dc,_0x1cc3b3[_0x17a1('0x14')][_0x17a1('0x16')]);return _0x3f3774(_0x1cc3b3['error'][_0x17a1('0x16')]);}else{logger['info'](_0x17a1('0xf'),_0x9460dc,_0x17a1('0x12'));_0x3f3774(_0x1cc3b3[_0x17a1('0x17')]['message']);}})['catch'](function(_0x2297f9){logger[_0x17a1('0x14')](_0x17a1('0xf'),_0x9460dc,_0x2297f9);_0x596155(_0x2297f9);});});}exports['UpdateFaxInteraction']=function(_0x19c6cb){var _0x5890b8=this;return new Promise(function(_0x5cfa72,_0x388b38){return db[_0x17a1('0x18')]['update'](_0x19c6cb['body'],{'raw':_0x19c6cb[_0x17a1('0x19')]?_0x19c6cb[_0x17a1('0x19')][_0x17a1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c6cb[_0x17a1('0x19')]?_0x19c6cb[_0x17a1('0x19')][_0x17a1('0x1b')]||null:null,'attributes':_0x19c6cb[_0x17a1('0x19')]?_0x19c6cb[_0x17a1('0x19')]['attributes']||null:null,'limit':_0x19c6cb[_0x17a1('0x19')]?_0x19c6cb[_0x17a1('0x19')][_0x17a1('0x1c')]||null:null})[_0x17a1('0x1d')](function(_0x17b6c6){logger[_0x17a1('0xe')]('UpdateFaxInteraction',_0x19c6cb);logger[_0x17a1('0x10')]('UpdateFaxInteraction',_0x19c6cb,JSON[_0x17a1('0x13')](_0x17b6c6));_0x5cfa72(_0x17b6c6);})[_0x17a1('0x1e')](function(_0x3ba258){logger['error'](_0x17a1('0x1f'),_0x3ba258['message'],_0x19c6cb);_0x388b38(_0x5890b8[_0x17a1('0x14')](0x1f4,_0x3ba258['message']));});});};exports[_0x17a1('0x20')]=function(_0x1b24ac){return new Promise(function(_0x2c0be4,_0x81f1c0){return db[_0x17a1('0x18')][_0x17a1('0x21')]({'where':_0x1b24ac[_0x17a1('0x19')]?_0x1b24ac[_0x17a1('0x19')][_0x17a1('0x1b')]||null:null})[_0x17a1('0x1d')](function(_0x4ec755){if(_0x4ec755){return _0x4ec755['addTags'](_0x1b24ac[_0x17a1('0x22')][_0x17a1('0x23')],_['omit'](_0x1b24ac[_0x17a1('0x22')],['ids','id'])||{});}})[_0x17a1('0x24')](function(_0x3d994d){logger[_0x17a1('0xe')](_0x17a1('0x25'),_0x1b24ac);logger[_0x17a1('0x10')](_0x17a1('0x25'),_0x1b24ac,JSON[_0x17a1('0x13')](_0x3d994d));_0x2c0be4(_0x3d994d);})[_0x17a1('0x1e')](function(_0x1a5789){logger[_0x17a1('0x14')]('AddTags',_0x1a5789[_0x17a1('0x16')],_0x1b24ac);_0x81f1c0(_this[_0x17a1('0x14')](0x1f4,_0x1a5789['message']));});});};
\ No newline at end of file
+var _0x0b25=['stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x0b25,0x1bb));var _0x50b2=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x0b25[_0x305c31];return _0x17f39f;};'use strict';var _=require(_0x50b2('0x0'));var util=require(_0x50b2('0x1'));var moment=require(_0x50b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x50b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x50b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x50b2('0x6'));var client=jayson[_0x50b2('0x7')][_0x50b2('0x8')]({'port':0x232a});config[_0x50b2('0x9')]=_[_0x50b2('0xa')](config[_0x50b2('0x9')],{'host':_0x50b2('0xb'),'port':0x18eb});var socket=require(_0x50b2('0xc'))(new Redis(config[_0x50b2('0x9')]));require(_0x50b2('0xd'))[_0x50b2('0xe')](socket);function respondWithRpcPromise(_0x26499e,_0x1a03f8,_0x36f15d){return new BPromise(function(_0x364fd1,_0x42279f){return client['request'](_0x26499e,_0x36f15d)[_0x50b2('0xf')](function(_0x398192){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x1a03f8,'request\x20sent');logger[_0x50b2('0x10')](_0x50b2('0x11'),_0x1a03f8,_0x50b2('0x12'),JSON[_0x50b2('0x13')](_0x398192));if(_0x398192[_0x50b2('0x14')]){if(_0x398192['error'][_0x50b2('0x15')]===0x1f4){logger[_0x50b2('0x14')](_0x50b2('0x16'),_0x1a03f8,_0x398192[_0x50b2('0x14')][_0x50b2('0x17')]);return _0x42279f(_0x398192[_0x50b2('0x14')][_0x50b2('0x17')]);}logger[_0x50b2('0x14')](_0x50b2('0x16'),_0x1a03f8,_0x398192[_0x50b2('0x14')]['message']);return _0x364fd1(_0x398192[_0x50b2('0x14')][_0x50b2('0x17')]);}else{logger[_0x50b2('0x18')](_0x50b2('0x16'),_0x1a03f8,_0x50b2('0x12'));_0x364fd1(_0x398192[_0x50b2('0x19')]['message']);}})[_0x50b2('0x1a')](function(_0x465528){logger[_0x50b2('0x14')](_0x50b2('0x16'),_0x1a03f8,_0x465528);_0x42279f(_0x465528);});});}exports[_0x50b2('0x1b')]=function(_0xbd3474){var _0x28b9eb=this;return new Promise(function(_0x57b0a0,_0x273993){return db[_0x50b2('0x1c')][_0x50b2('0x1d')](_0xbd3474[_0x50b2('0x1e')],{'raw':_0xbd3474[_0x50b2('0x1f')]?_0xbd3474[_0x50b2('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd3474[_0x50b2('0x1f')]?_0xbd3474[_0x50b2('0x1f')][_0x50b2('0x20')]||null:null,'attributes':_0xbd3474['options']?_0xbd3474[_0x50b2('0x1f')][_0x50b2('0x21')]||null:null,'limit':_0xbd3474[_0x50b2('0x1f')]?_0xbd3474[_0x50b2('0x1f')][_0x50b2('0x22')]||null:null})[_0x50b2('0xf')](function(_0x33adc7){logger[_0x50b2('0x18')](_0x50b2('0x1b'),_0xbd3474);logger['debug'](_0x50b2('0x1b'),_0xbd3474,JSON[_0x50b2('0x13')](_0x33adc7));_0x57b0a0(_0x33adc7);})[_0x50b2('0x1a')](function(_0x461187){logger[_0x50b2('0x14')]('UpdateFaxInteraction',_0x461187['message'],_0xbd3474);_0x273993(_0x28b9eb[_0x50b2('0x14')](0x1f4,_0x461187[_0x50b2('0x17')]));});});};exports[_0x50b2('0x23')]=function(_0x1b52ee){return new Promise(function(_0x322b00,_0x1f4a76){return db[_0x50b2('0x1c')][_0x50b2('0x24')]({'where':_0x1b52ee['options']?_0x1b52ee[_0x50b2('0x1f')][_0x50b2('0x20')]||null:null})[_0x50b2('0xf')](function(_0xcc9304){if(_0xcc9304){return _0xcc9304[_0x50b2('0x25')](_0x1b52ee[_0x50b2('0x1e')]['ids'],_[_0x50b2('0x26')](_0x1b52ee[_0x50b2('0x1e')],[_0x50b2('0x27'),'id'])||{});}})[_0x50b2('0x28')](function(_0xab4b3c){logger['info'](_0x50b2('0x29'),_0x1b52ee);logger['debug'](_0x50b2('0x29'),_0x1b52ee,JSON[_0x50b2('0x13')](_0xab4b3c));_0x322b00(_0xab4b3c);})[_0x50b2('0x1a')](function(_0x5ad188){logger[_0x50b2('0x14')]('AddTags',_0x5ad188['message'],_0x1b52ee);_0x1f4a76(_this['error'](0x1f4,_0x5ad188[_0x50b2('0x17')]));});});};
\ No newline at end of file