Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index b5c2e02..4b14d29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a43=['attributes','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FaxInteraction','update','options','raw','where'];(function(_0x31ed09,_0x417745){var _0x1c1ef4=function(_0xa0c91e){while(--_0xa0c91e){_0x31ed09['push'](_0x31ed09['shift']());}};_0x1c1ef4(++_0x417745);}(_0x5a43,0x12a));var _0x35a4=function(_0x35873a,_0x3ed5f4){_0x35873a=_0x35873a-0x0;var _0x85075d=_0x5a43[_0x35873a];return _0x85075d;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require('moment');var BPromise=require(_0x35a4('0x2'));var rs=require(_0x35a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35a4('0x4'))['db'];var utils=require(_0x35a4('0x5'));var logger=require('../../config/logger')(_0x35a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config['redis']=_[_0x35a4('0xa')](config[_0x35a4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config['redis']));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0xaf708a,_0x1631fa,_0x5431e5){return new BPromise(function(_0x4194dc,_0x4f44e5){return client['request'](_0xaf708a,_0x5431e5)['then'](function(_0x5c3f13){logger[_0x35a4('0xf')](_0x35a4('0x10'),_0x1631fa,'request\x20sent');logger[_0x35a4('0x11')](_0x35a4('0x12'),_0x1631fa,_0x35a4('0x13'),JSON[_0x35a4('0x14')](_0x5c3f13));if(_0x5c3f13['error']){if(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x16')]===0x1f4){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);return _0x4f44e5(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}logger[_0x35a4('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x1631fa,_0x5c3f13[_0x35a4('0x15')]['message']);return _0x4194dc(_0x5c3f13[_0x35a4('0x15')][_0x35a4('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x1631fa,_0x35a4('0x13'));_0x4194dc(_0x5c3f13['result'][_0x35a4('0x17')]);}})[_0x35a4('0x18')](function(_0x5a6ab1){logger[_0x35a4('0x15')](_0x35a4('0x10'),_0x1631fa,_0x5a6ab1);_0x4f44e5(_0x5a6ab1);});});}exports['UpdateFaxInteraction']=function(_0x323446){var _0x2e29ee=this;return new Promise(function(_0x1c5a0a,_0x49d5ce){return db[_0x35a4('0x19')][_0x35a4('0x1a')](_0x323446['body'],{'raw':_0x323446['options']?_0x323446[_0x35a4('0x1b')][_0x35a4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323446[_0x35a4('0x1b')]?_0x323446[_0x35a4('0x1b')][_0x35a4('0x1d')]||null:null,'attributes':_0x323446[_0x35a4('0x1b')]?_0x323446['options'][_0x35a4('0x1e')]||null:null,'limit':_0x323446[_0x35a4('0x1b')]?_0x323446['options'][_0x35a4('0x1f')]||null:null})[_0x35a4('0x20')](function(_0x5081ad){logger[_0x35a4('0xf')](_0x35a4('0x21'),_0x323446);logger[_0x35a4('0x11')](_0x35a4('0x21'),_0x323446,JSON[_0x35a4('0x14')](_0x5081ad));_0x1c5a0a(_0x5081ad);})[_0x35a4('0x18')](function(_0x150131){logger[_0x35a4('0x15')](_0x35a4('0x21'),_0x150131[_0x35a4('0x17')],_0x323446);_0x49d5ce(_0x2e29ee[_0x35a4('0x15')](0x1f4,_0x150131['message']));});});};exports[_0x35a4('0x22')]=function(_0x17ba66){return new Promise(function(_0x42b7fe,_0x58e21d){return db['FaxInteraction']['find']({'where':_0x17ba66['options']?_0x17ba66[_0x35a4('0x1b')][_0x35a4('0x1d')]||null:null})[_0x35a4('0x20')](function(_0x47a528){if(_0x47a528){return _0x47a528[_0x35a4('0x23')](_0x17ba66[_0x35a4('0x24')][_0x35a4('0x25')],_[_0x35a4('0x26')](_0x17ba66[_0x35a4('0x24')],['ids','id'])||{});}})[_0x35a4('0x27')](function(_0x545119){logger[_0x35a4('0xf')]('AddTags',_0x17ba66);logger[_0x35a4('0x11')]('AddTags',_0x17ba66,JSON[_0x35a4('0x14')](_0x545119));_0x42b7fe(_0x545119);})[_0x35a4('0x18')](function(_0x43a6eb){logger[_0x35a4('0x15')](_0x35a4('0x28'),_0x43a6eb[_0x35a4('0x17')],_0x17ba66);_0x58e21d(_this[_0x35a4('0x15')](0x1f4,_0x43a6eb[_0x35a4('0x17')]));});});};
\ No newline at end of file
+var _0x4475=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash'];(function(_0x2281e8,_0x32ece1){var _0x61ffec=function(_0x488daf){while(--_0x488daf){_0x2281e8['push'](_0x2281e8['shift']());}};_0x61ffec(++_0x32ece1);}(_0x4475,0x14f));var _0x5447=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4475[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5447('0x0'));var util=require(_0x5447('0x1'));var moment=require(_0x5447('0x2'));var BPromise=require(_0x5447('0x3'));var rs=require(_0x5447('0x4'));var fs=require('fs');var Redis=require(_0x5447('0x5'));var db=require(_0x5447('0x6'))['db'];var utils=require(_0x5447('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5447('0x8'));var client=jayson[_0x5447('0x9')][_0x5447('0xa')]({'port':0x232a});config[_0x5447('0xb')]=_[_0x5447('0xc')](config[_0x5447('0xb')],{'host':_0x5447('0xd'),'port':0x18eb});var socket=require(_0x5447('0xe'))(new Redis(config[_0x5447('0xb')]));require('./faxInteraction.socket')[_0x5447('0xf')](socket);function respondWithRpcPromise(_0x3844af,_0x24b9fc,_0x4ad369){return new BPromise(function(_0x36a0c5,_0x2282d6){return client[_0x5447('0x10')](_0x3844af,_0x4ad369)[_0x5447('0x11')](function(_0x46e58d){logger[_0x5447('0x12')](_0x5447('0x13'),_0x24b9fc,_0x5447('0x14'));logger[_0x5447('0x15')](_0x5447('0x16'),_0x24b9fc,_0x5447('0x14'),JSON[_0x5447('0x17')](_0x46e58d));if(_0x46e58d[_0x5447('0x18')]){if(_0x46e58d[_0x5447('0x18')][_0x5447('0x19')]===0x1f4){logger[_0x5447('0x18')](_0x5447('0x13'),_0x24b9fc,_0x46e58d['error']['message']);return _0x2282d6(_0x46e58d[_0x5447('0x18')][_0x5447('0x1a')]);}logger[_0x5447('0x18')](_0x5447('0x13'),_0x24b9fc,_0x46e58d['error'][_0x5447('0x1a')]);return _0x36a0c5(_0x46e58d[_0x5447('0x18')][_0x5447('0x1a')]);}else{logger[_0x5447('0x12')](_0x5447('0x13'),_0x24b9fc,_0x5447('0x14'));_0x36a0c5(_0x46e58d[_0x5447('0x1b')][_0x5447('0x1a')]);}})[_0x5447('0x1c')](function(_0x51edeb){logger[_0x5447('0x18')](_0x5447('0x13'),_0x24b9fc,_0x51edeb);_0x2282d6(_0x51edeb);});});}exports[_0x5447('0x1d')]=function(_0x5df29b){var _0x94c508=this;return new Promise(function(_0x213f77,_0x10f3c6){return db[_0x5447('0x1e')]['update'](_0x5df29b[_0x5447('0x1f')],{'raw':_0x5df29b['options']?_0x5df29b[_0x5447('0x20')][_0x5447('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5df29b['options']?_0x5df29b[_0x5447('0x20')][_0x5447('0x22')]||null:null,'attributes':_0x5df29b[_0x5447('0x20')]?_0x5df29b[_0x5447('0x20')][_0x5447('0x23')]||null:null,'limit':_0x5df29b[_0x5447('0x20')]?_0x5df29b[_0x5447('0x20')]['limit']||null:null})[_0x5447('0x11')](function(_0x557dbb){logger[_0x5447('0x12')](_0x5447('0x1d'),_0x5df29b);logger['debug'](_0x5447('0x1d'),_0x5df29b,JSON[_0x5447('0x17')](_0x557dbb));_0x213f77(_0x557dbb);})[_0x5447('0x1c')](function(_0x45fe5e){logger[_0x5447('0x18')]('UpdateFaxInteraction',_0x45fe5e[_0x5447('0x1a')],_0x5df29b);_0x10f3c6(_0x94c508[_0x5447('0x18')](0x1f4,_0x45fe5e[_0x5447('0x1a')]));});});};exports[_0x5447('0x24')]=function(_0xa935a4){return new Promise(function(_0x265dc4,_0x5f3d05){return db['FaxInteraction'][_0x5447('0x25')]({'where':_0xa935a4['options']?_0xa935a4['options']['where']||null:null})[_0x5447('0x11')](function(_0x5a2f73){if(_0x5a2f73){return _0x5a2f73[_0x5447('0x26')](_0xa935a4['body'][_0x5447('0x27')],_[_0x5447('0x28')](_0xa935a4[_0x5447('0x1f')],[_0x5447('0x27'),'id'])||{});}})['spread'](function(_0x5cded2){logger[_0x5447('0x12')](_0x5447('0x29'),_0xa935a4);logger['debug'](_0x5447('0x29'),_0xa935a4,JSON[_0x5447('0x17')](_0x5cded2));_0x265dc4(_0x5cded2);})[_0x5447('0x1c')](function(_0x27ef49){logger[_0x5447('0x18')](_0x5447('0x29'),_0x27ef49[_0x5447('0x1a')],_0xa935a4);_0x5f3d05(_this[_0x5447('0x18')](0x1f4,_0x27ef49[_0x5447('0x1a')]));});});};
\ No newline at end of file