Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index eab6ca0..107be4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd0f=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','stringify','catch','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfd0f,0xd6));var _0xffd0=function(_0x3fc001,_0xe660a3){_0x3fc001=_0x3fc001-0x0;var _0x42d0b3=_0xfd0f[_0x3fc001];return _0x42d0b3;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var moment=require(_0xffd0('0x2'));var BPromise=require(_0xffd0('0x3'));var rs=require(_0xffd0('0x4'));var fs=require('fs');var Redis=require(_0xffd0('0x5'));var db=require(_0xffd0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xffd0('0x7'))(_0xffd0('0x8'));var config=require(_0xffd0('0x9'));var jayson=require(_0xffd0('0xa'));var client=jayson['client'][_0xffd0('0xb')]({'port':0x232a});config['redis']=_[_0xffd0('0xc')](config[_0xffd0('0xd')],{'host':_0xffd0('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffd0('0xd')]));require(_0xffd0('0xf'))['register'](socket);function respondWithRpcPromise(_0xbf129a,_0x4e8692,_0x3c794b){return new BPromise(function(_0xab7d0a,_0x52a19e){return client[_0xffd0('0x10')](_0xbf129a,_0x3c794b)[_0xffd0('0x11')](function(_0x3ac4e4){logger[_0xffd0('0x12')](_0xffd0('0x13'),_0x4e8692,_0xffd0('0x14'));logger[_0xffd0('0x15')](_0xffd0('0x16'),_0x4e8692,_0xffd0('0x14'),JSON['stringify'](_0x3ac4e4));if(_0x3ac4e4['error']){if(_0x3ac4e4[_0xffd0('0x17')][_0xffd0('0x18')]===0x1f4){logger[_0xffd0('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x4e8692,_0x3ac4e4[_0xffd0('0x17')]['message']);return _0x52a19e(_0x3ac4e4['error'][_0xffd0('0x19')]);}logger[_0xffd0('0x17')](_0xffd0('0x13'),_0x4e8692,_0x3ac4e4[_0xffd0('0x17')][_0xffd0('0x19')]);return _0xab7d0a(_0x3ac4e4[_0xffd0('0x17')][_0xffd0('0x19')]);}else{logger[_0xffd0('0x12')](_0xffd0('0x13'),_0x4e8692,_0xffd0('0x14'));_0xab7d0a(_0x3ac4e4[_0xffd0('0x1a')]['message']);}})['catch'](function(_0x1bce2f){logger[_0xffd0('0x17')](_0xffd0('0x13'),_0x4e8692,_0x1bce2f);_0x52a19e(_0x1bce2f);});});}exports[_0xffd0('0x1b')]=function(_0x2f64ca){var _0x212362=this;return new Promise(function(_0x7dbdd9,_0x144ed2){return db[_0xffd0('0x1c')][_0xffd0('0x1d')](_0x2f64ca[_0xffd0('0x1e')],{'raw':_0x2f64ca[_0xffd0('0x1f')]?_0x2f64ca['options'][_0xffd0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f64ca[_0xffd0('0x1f')]?_0x2f64ca['options']['where']||null:null,'attributes':_0x2f64ca[_0xffd0('0x1f')]?_0x2f64ca[_0xffd0('0x1f')]['attributes']||null:null,'limit':_0x2f64ca[_0xffd0('0x1f')]?_0x2f64ca[_0xffd0('0x1f')][_0xffd0('0x21')]||null:null})[_0xffd0('0x11')](function(_0x2b9a7b){logger[_0xffd0('0x12')]('UpdateFaxInteraction',_0x2f64ca);logger[_0xffd0('0x15')](_0xffd0('0x1b'),_0x2f64ca,JSON[_0xffd0('0x22')](_0x2b9a7b));_0x7dbdd9(_0x2b9a7b);})[_0xffd0('0x23')](function(_0x31ada5){logger['error'](_0xffd0('0x1b'),_0x31ada5['message'],_0x2f64ca);_0x144ed2(_0x212362[_0xffd0('0x17')](0x1f4,_0x31ada5['message']));});});};exports[_0xffd0('0x24')]=function(_0x1e28ff){return new Promise(function(_0x439966,_0x2f4800){return db[_0xffd0('0x1c')][_0xffd0('0x25')]({'where':_0x1e28ff['options']?_0x1e28ff[_0xffd0('0x1f')][_0xffd0('0x26')]||null:null})['then'](function(_0x4ad00c){if(_0x4ad00c){return _0x4ad00c[_0xffd0('0x27')](_0x1e28ff[_0xffd0('0x1e')][_0xffd0('0x28')],_[_0xffd0('0x29')](_0x1e28ff[_0xffd0('0x1e')],[_0xffd0('0x28'),'id'])||{});}})[_0xffd0('0x2a')](function(_0x47d3ab){logger[_0xffd0('0x12')]('AddTags',_0x1e28ff);logger[_0xffd0('0x15')](_0xffd0('0x2b'),_0x1e28ff,JSON[_0xffd0('0x22')](_0x47d3ab));_0x439966(_0x47d3ab);})[_0xffd0('0x23')](function(_0x353250){logger[_0xffd0('0x17')](_0xffd0('0x2b'),_0x353250[_0xffd0('0x19')],_0x1e28ff);_0x2f4800(_this[_0xffd0('0x17')](0x1f4,_0x353250[_0xffd0('0x19')]));});});};
\ No newline at end of file
+var _0xf2d3=['body','options','raw','attributes','limit','then','debug','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update'];(function(_0x410422,_0x4b6eb9){var _0x1b329c=function(_0x19f5aa){while(--_0x19f5aa){_0x410422['push'](_0x410422['shift']());}};_0x1b329c(++_0x4b6eb9);}(_0xf2d3,0x1b5));var _0x3f2d=function(_0x272e6c,_0x51046b){_0x272e6c=_0x272e6c-0x0;var _0x3007c9=_0xf2d3[_0x272e6c];return _0x3007c9;};'use strict';var _=require(_0x3f2d('0x0'));var util=require(_0x3f2d('0x1'));var moment=require(_0x3f2d('0x2'));var BPromise=require(_0x3f2d('0x3'));var rs=require(_0x3f2d('0x4'));var fs=require('fs');var Redis=require(_0x3f2d('0x5'));var db=require(_0x3f2d('0x6'))['db'];var utils=require(_0x3f2d('0x7'));var logger=require(_0x3f2d('0x8'))(_0x3f2d('0x9'));var config=require(_0x3f2d('0xa'));var jayson=require(_0x3f2d('0xb'));var client=jayson['client'][_0x3f2d('0xc')]({'port':0x232a});config[_0x3f2d('0xd')]=_[_0x3f2d('0xe')](config[_0x3f2d('0xd')],{'host':_0x3f2d('0xf'),'port':0x18eb});var socket=require(_0x3f2d('0x10'))(new Redis(config[_0x3f2d('0xd')]));require(_0x3f2d('0x11'))[_0x3f2d('0x12')](socket);function respondWithRpcPromise(_0x1e8e45,_0x25c7b5,_0x288347){return new BPromise(function(_0x30807d,_0x533fc8){return client[_0x3f2d('0x13')](_0x1e8e45,_0x288347)['then'](function(_0x36bcee){logger[_0x3f2d('0x14')](_0x3f2d('0x15'),_0x25c7b5,'request\x20sent');logger['debug'](_0x3f2d('0x16'),_0x25c7b5,_0x3f2d('0x17'),JSON[_0x3f2d('0x18')](_0x36bcee));if(_0x36bcee[_0x3f2d('0x19')]){if(_0x36bcee[_0x3f2d('0x19')][_0x3f2d('0x1a')]===0x1f4){logger['error'](_0x3f2d('0x15'),_0x25c7b5,_0x36bcee[_0x3f2d('0x19')][_0x3f2d('0x1b')]);return _0x533fc8(_0x36bcee[_0x3f2d('0x19')][_0x3f2d('0x1b')]);}logger['error'](_0x3f2d('0x15'),_0x25c7b5,_0x36bcee[_0x3f2d('0x19')][_0x3f2d('0x1b')]);return _0x30807d(_0x36bcee['error']['message']);}else{logger[_0x3f2d('0x14')](_0x3f2d('0x15'),_0x25c7b5,_0x3f2d('0x17'));_0x30807d(_0x36bcee[_0x3f2d('0x1c')]['message']);}})[_0x3f2d('0x1d')](function(_0x440c84){logger['error'](_0x3f2d('0x15'),_0x25c7b5,_0x440c84);_0x533fc8(_0x440c84);});});}exports[_0x3f2d('0x1e')]=function(_0x2d40a9){var _0x44f536=this;return new Promise(function(_0x13d143,_0x18b156){return db[_0x3f2d('0x1f')][_0x3f2d('0x20')](_0x2d40a9[_0x3f2d('0x21')],{'raw':_0x2d40a9[_0x3f2d('0x22')]?_0x2d40a9[_0x3f2d('0x22')][_0x3f2d('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d40a9['options']?_0x2d40a9[_0x3f2d('0x22')]['where']||null:null,'attributes':_0x2d40a9[_0x3f2d('0x22')]?_0x2d40a9['options'][_0x3f2d('0x24')]||null:null,'limit':_0x2d40a9['options']?_0x2d40a9[_0x3f2d('0x22')][_0x3f2d('0x25')]||null:null})[_0x3f2d('0x26')](function(_0x5b19fb){logger['info'](_0x3f2d('0x1e'),_0x2d40a9);logger[_0x3f2d('0x27')](_0x3f2d('0x1e'),_0x2d40a9,JSON['stringify'](_0x5b19fb));_0x13d143(_0x5b19fb);})['catch'](function(_0x290b20){logger[_0x3f2d('0x19')]('UpdateFaxInteraction',_0x290b20[_0x3f2d('0x1b')],_0x2d40a9);_0x18b156(_0x44f536['error'](0x1f4,_0x290b20[_0x3f2d('0x1b')]));});});};exports[_0x3f2d('0x28')]=function(_0x215b6b){return new Promise(function(_0x13fab0,_0x56cc70){return db[_0x3f2d('0x1f')][_0x3f2d('0x29')]({'where':_0x215b6b['options']?_0x215b6b[_0x3f2d('0x22')][_0x3f2d('0x2a')]||null:null})[_0x3f2d('0x26')](function(_0x1bae07){if(_0x1bae07){return _0x1bae07[_0x3f2d('0x2b')](_0x215b6b[_0x3f2d('0x21')]['ids'],_['omit'](_0x215b6b[_0x3f2d('0x21')],[_0x3f2d('0x2c'),'id'])||{});}})[_0x3f2d('0x2d')](function(_0x11356c){logger[_0x3f2d('0x14')]('AddTags',_0x215b6b);logger['debug'](_0x3f2d('0x2e'),_0x215b6b,JSON[_0x3f2d('0x18')](_0x11356c));_0x13fab0(_0x11356c);})[_0x3f2d('0x1d')](function(_0x5e4295){logger[_0x3f2d('0x19')](_0x3f2d('0x2e'),_0x5e4295[_0x3f2d('0x1b')],_0x215b6b);_0x56cc70(_this[_0x3f2d('0x19')](0x1f4,_0x5e4295[_0x3f2d('0x1b')]));});});};
\ No newline at end of file