Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index b5c2e02..421f266 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 _0x2616=['then','info','request\x20sent','debug','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','limit','FaxInteraction','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','register','request'];(function(_0x3b86ab,_0x2bbb75){var _0x575d84=function(_0x324cef){while(--_0x324cef){_0x3b86ab['push'](_0x3b86ab['shift']());}};_0x575d84(++_0x2bbb75);}(_0x2616,0xb3));var _0x6261=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x2616[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x6261('0x0'));var util=require(_0x6261('0x1'));var moment=require(_0x6261('0x2'));var BPromise=require(_0x6261('0x3'));var rs=require(_0x6261('0x4'));var fs=require('fs');var Redis=require(_0x6261('0x5'));var db=require(_0x6261('0x6'))['db'];var utils=require(_0x6261('0x7'));var logger=require(_0x6261('0x8'))(_0x6261('0x9'));var config=require('../../config/environment');var jayson=require(_0x6261('0xa'));var client=jayson['client'][_0x6261('0xb')]({'port':0x232a});config[_0x6261('0xc')]=_[_0x6261('0xd')](config[_0x6261('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6261('0xc')]));require('./faxInteraction.socket')[_0x6261('0xe')](socket);function respondWithRpcPromise(_0x4583db,_0x2c352c,_0x5e5272){return new BPromise(function(_0x247efc,_0x1ba22a){return client[_0x6261('0xf')](_0x4583db,_0x5e5272)[_0x6261('0x10')](function(_0x8c1612){logger[_0x6261('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2c352c,_0x6261('0x12'));logger[_0x6261('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2c352c,_0x6261('0x12'),JSON[_0x6261('0x14')](_0x8c1612));if(_0x8c1612[_0x6261('0x15')]){if(_0x8c1612[_0x6261('0x15')][_0x6261('0x16')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x2c352c,_0x8c1612[_0x6261('0x15')]['message']);return _0x1ba22a(_0x8c1612['error'][_0x6261('0x17')]);}logger[_0x6261('0x15')](_0x6261('0x18'),_0x2c352c,_0x8c1612['error']['message']);return _0x247efc(_0x8c1612['error'][_0x6261('0x17')]);}else{logger['info'](_0x6261('0x18'),_0x2c352c,_0x6261('0x12'));_0x247efc(_0x8c1612[_0x6261('0x19')][_0x6261('0x17')]);}})[_0x6261('0x1a')](function(_0x43e413){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x2c352c,_0x43e413);_0x1ba22a(_0x43e413);});});}exports[_0x6261('0x1b')]=function(_0x2af4d6){var _0x3f88df=this;return new Promise(function(_0x2c94e8,_0x3ea94c){return db['FaxInteraction'][_0x6261('0x1c')](_0x2af4d6[_0x6261('0x1d')],{'raw':_0x2af4d6[_0x6261('0x1e')]?_0x2af4d6[_0x6261('0x1e')][_0x6261('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af4d6['options']?_0x2af4d6[_0x6261('0x1e')][_0x6261('0x20')]||null:null,'attributes':_0x2af4d6[_0x6261('0x1e')]?_0x2af4d6[_0x6261('0x1e')][_0x6261('0x21')]||null:null,'limit':_0x2af4d6[_0x6261('0x1e')]?_0x2af4d6[_0x6261('0x1e')][_0x6261('0x22')]||null:null})['then'](function(_0x9bfdba){logger[_0x6261('0x11')](_0x6261('0x1b'),_0x2af4d6);logger[_0x6261('0x13')](_0x6261('0x1b'),_0x2af4d6,JSON['stringify'](_0x9bfdba));_0x2c94e8(_0x9bfdba);})['catch'](function(_0x4a7d6a){logger[_0x6261('0x15')](_0x6261('0x1b'),_0x4a7d6a['message'],_0x2af4d6);_0x3ea94c(_0x3f88df[_0x6261('0x15')](0x1f4,_0x4a7d6a['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x238548){return new Promise(function(_0x10796d,_0x51b7be){return db[_0x6261('0x23')]['find']({'where':_0x238548[_0x6261('0x1e')]?_0x238548['options'][_0x6261('0x20')]||null:null})[_0x6261('0x10')](function(_0x3807a2){if(_0x3807a2){return _0x3807a2[_0x6261('0x24')](_0x238548[_0x6261('0x1d')]['ids'],_['omit'](_0x238548['body'],[_0x6261('0x25'),'id'])||{});}})['spread'](function(_0x131021){logger[_0x6261('0x11')](_0x6261('0x26'),_0x238548);logger[_0x6261('0x13')](_0x6261('0x26'),_0x238548,JSON[_0x6261('0x14')](_0x131021));_0x10796d(_0x131021);})[_0x6261('0x1a')](function(_0x2261bf){logger['error'](_0x6261('0x26'),_0x2261bf[_0x6261('0x17')],_0x238548);_0x51b7be(_this[_0x6261('0x15')](0x1f4,_0x2261bf[_0x6261('0x17')]));});});};
\ No newline at end of file