Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 5c5fc47..48b3eb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd82b=['redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','then','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x15b20b,_0x3acc56){var _0x5b222f=function(_0x56b945){while(--_0x56b945){_0x15b20b['push'](_0x15b20b['shift']());}};_0x5b222f(++_0x3acc56);}(_0xd82b,0x1a3));var _0xbd82=function(_0x1d80a0,_0x7da8b0){_0x1d80a0=_0x1d80a0-0x0;var _0x15ef20=_0xd82b[_0x1d80a0];return _0x15ef20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbd82('0x0'));var BPromise=require(_0xbd82('0x1'));var rs=require(_0xbd82('0x2'));var fs=require('fs');var Redis=require(_0xbd82('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd82('0x4'));var logger=require(_0xbd82('0x5'))(_0xbd82('0x6'));var config=require(_0xbd82('0x7'));var jayson=require(_0xbd82('0x8'));var client=jayson[_0xbd82('0x9')][_0xbd82('0xa')]({'port':0x232a});config[_0xbd82('0xb')]=_[_0xbd82('0xc')](config[_0xbd82('0xb')],{'host':_0xbd82('0xd'),'port':0x18eb});var socket=require(_0xbd82('0xe'))(new Redis(config[_0xbd82('0xb')]));require(_0xbd82('0xf'))['register'](socket);function respondWithRpcPromise(_0x195a2c,_0x4d3405,_0x5ce5d0){return new BPromise(function(_0x3019f7,_0x1b3cfe){return client[_0xbd82('0x10')](_0x195a2c,_0x5ce5d0)['then'](function(_0x1107f5){logger[_0xbd82('0x11')](_0xbd82('0x12'),_0x4d3405,_0xbd82('0x13'));logger[_0xbd82('0x14')](_0xbd82('0x15'),_0x4d3405,_0xbd82('0x13'),JSON['stringify'](_0x1107f5));if(_0x1107f5[_0xbd82('0x16')]){if(_0x1107f5['error'][_0xbd82('0x17')]===0x1f4){logger[_0xbd82('0x16')](_0xbd82('0x12'),_0x4d3405,_0x1107f5[_0xbd82('0x16')]['message']);return _0x1b3cfe(_0x1107f5['error'][_0xbd82('0x18')]);}logger[_0xbd82('0x16')](_0xbd82('0x12'),_0x4d3405,_0x1107f5['error'][_0xbd82('0x18')]);return _0x3019f7(_0x1107f5[_0xbd82('0x16')][_0xbd82('0x18')]);}else{logger[_0xbd82('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x4d3405,'request\x20sent');_0x3019f7(_0x1107f5['result'][_0xbd82('0x18')]);}})[_0xbd82('0x19')](function(_0x276fc8){logger['error'](_0xbd82('0x12'),_0x4d3405,_0x276fc8);_0x1b3cfe(_0x276fc8);});});}exports['UpdateFaxInteraction']=function(_0x5eda7e){var _0x55c9d0=this;return new Promise(function(_0x235e3c,_0x1ea7ff){return db[_0xbd82('0x1a')][_0xbd82('0x1b')](_0x5eda7e[_0xbd82('0x1c')],{'raw':_0x5eda7e['options']?_0x5eda7e[_0xbd82('0x1d')][_0xbd82('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eda7e['options']?_0x5eda7e['options'][_0xbd82('0x1f')]||null:null,'attributes':_0x5eda7e[_0xbd82('0x1d')]?_0x5eda7e['options'][_0xbd82('0x20')]||null:null,'limit':_0x5eda7e[_0xbd82('0x1d')]?_0x5eda7e['options'][_0xbd82('0x21')]||null:null})[_0xbd82('0x22')](function(_0x211498){logger['info']('UpdateFaxInteraction',_0x5eda7e);logger[_0xbd82('0x14')](_0xbd82('0x23'),_0x5eda7e,JSON[_0xbd82('0x24')](_0x211498));_0x235e3c(_0x211498);})[_0xbd82('0x19')](function(_0x327b5f){logger[_0xbd82('0x16')](_0xbd82('0x23'),_0x327b5f[_0xbd82('0x18')],_0x5eda7e);_0x1ea7ff(_0x55c9d0['error'](0x1f4,_0x327b5f['message']));});});};exports[_0xbd82('0x25')]=function(_0x2aa301){return new Promise(function(_0x3a5060,_0x4eff29){return db[_0xbd82('0x1a')][_0xbd82('0x26')]({'where':_0x2aa301['options']?_0x2aa301[_0xbd82('0x1d')][_0xbd82('0x1f')]||null:null})['then'](function(_0x14232e){if(_0x14232e){return _0x14232e['addTags'](_0x2aa301[_0xbd82('0x1c')][_0xbd82('0x27')],_[_0xbd82('0x28')](_0x2aa301[_0xbd82('0x1c')],['ids','id'])||{});}})[_0xbd82('0x29')](function(_0x396c9e){logger[_0xbd82('0x11')](_0xbd82('0x2a'),_0x2aa301);logger[_0xbd82('0x14')](_0xbd82('0x2a'),_0x2aa301,JSON[_0xbd82('0x24')](_0x396c9e));_0x3a5060(_0x396c9e);})['catch'](function(_0x410272){logger[_0xbd82('0x16')](_0xbd82('0x2a'),_0x410272[_0xbd82('0x18')],_0x2aa301);_0x4eff29(_this[_0xbd82('0x16')](0x1f4,_0x410272[_0xbd82('0x18')]));});});};
\ No newline at end of file
+var _0x169f=['redis','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','debug','AddTagsToFaxInteraction','find','omit','spread','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter'];(function(_0x516fa6,_0x4ebdd5){var _0x2d4aa5=function(_0x566903){while(--_0x566903){_0x516fa6['push'](_0x516fa6['shift']());}};_0x2d4aa5(++_0x4ebdd5);}(_0x169f,0x152));var _0xf169=function(_0x46a529,_0x11018a){_0x46a529=_0x46a529-0x0;var _0x1b169e=_0x169f[_0x46a529];return _0x1b169e;};'use strict';var _=require(_0xf169('0x0'));var util=require('util');var moment=require(_0xf169('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf169('0x2'));var db=require(_0xf169('0x3'))['db'];var utils=require(_0xf169('0x4'));var logger=require(_0xf169('0x5'))(_0xf169('0x6'));var config=require(_0xf169('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf169('0x8')][_0xf169('0x9')]({'port':0x232a});config['redis']=_[_0xf169('0xa')](config['redis'],{'host':_0xf169('0xb'),'port':0x18eb});var socket=require(_0xf169('0xc'))(new Redis(config[_0xf169('0xd')]));require(_0xf169('0xe'))[_0xf169('0xf')](socket);function respondWithRpcPromise(_0x52f7bc,_0x3c8c10,_0x1036f9){return new BPromise(function(_0x2087b1,_0x1e7d04){return client['request'](_0x52f7bc,_0x1036f9)[_0xf169('0x10')](function(_0x1a0596){logger[_0xf169('0x11')](_0xf169('0x12'),_0x3c8c10,_0xf169('0x13'));logger['debug'](_0xf169('0x14'),_0x3c8c10,'request\x20sent',JSON[_0xf169('0x15')](_0x1a0596));if(_0x1a0596['error']){if(_0x1a0596[_0xf169('0x16')][_0xf169('0x17')]===0x1f4){logger[_0xf169('0x16')](_0xf169('0x12'),_0x3c8c10,_0x1a0596[_0xf169('0x16')][_0xf169('0x18')]);return _0x1e7d04(_0x1a0596[_0xf169('0x16')]['message']);}logger[_0xf169('0x16')](_0xf169('0x12'),_0x3c8c10,_0x1a0596[_0xf169('0x16')]['message']);return _0x2087b1(_0x1a0596[_0xf169('0x16')][_0xf169('0x18')]);}else{logger[_0xf169('0x11')](_0xf169('0x12'),_0x3c8c10,_0xf169('0x13'));_0x2087b1(_0x1a0596[_0xf169('0x19')][_0xf169('0x18')]);}})[_0xf169('0x1a')](function(_0x22acc7){logger[_0xf169('0x16')](_0xf169('0x12'),_0x3c8c10,_0x22acc7);_0x1e7d04(_0x22acc7);});});}exports[_0xf169('0x1b')]=function(_0x3bade3){var _0x56bb2f=this;return new Promise(function(_0x2e10a1,_0x5f4dfb){return db[_0xf169('0x1c')]['update'](_0x3bade3[_0xf169('0x1d')],{'raw':_0x3bade3[_0xf169('0x1e')]?_0x3bade3['options'][_0xf169('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bade3['options']?_0x3bade3[_0xf169('0x1e')][_0xf169('0x20')]||null:null,'attributes':_0x3bade3[_0xf169('0x1e')]?_0x3bade3['options']['attributes']||null:null,'limit':_0x3bade3[_0xf169('0x1e')]?_0x3bade3[_0xf169('0x1e')]['limit']||null:null})[_0xf169('0x10')](function(_0x4b35df){logger[_0xf169('0x11')](_0xf169('0x1b'),_0x3bade3);logger[_0xf169('0x21')](_0xf169('0x1b'),_0x3bade3,JSON[_0xf169('0x15')](_0x4b35df));_0x2e10a1(_0x4b35df);})[_0xf169('0x1a')](function(_0x1867d7){logger[_0xf169('0x16')](_0xf169('0x1b'),_0x1867d7[_0xf169('0x18')],_0x3bade3);_0x5f4dfb(_0x56bb2f[_0xf169('0x16')](0x1f4,_0x1867d7[_0xf169('0x18')]));});});};exports[_0xf169('0x22')]=function(_0x6809f9){return new Promise(function(_0x38069b,_0x2124a7){return db['FaxInteraction'][_0xf169('0x23')]({'where':_0x6809f9[_0xf169('0x1e')]?_0x6809f9[_0xf169('0x1e')][_0xf169('0x20')]||null:null})['then'](function(_0x2f2669){if(_0x2f2669){return _0x2f2669['addTags'](_0x6809f9['body']['ids'],_[_0xf169('0x24')](_0x6809f9['body'],['ids','id'])||{});}})[_0xf169('0x25')](function(_0x28278a){logger['info'](_0xf169('0x26'),_0x6809f9);logger[_0xf169('0x21')](_0xf169('0x26'),_0x6809f9,JSON['stringify'](_0x28278a));_0x38069b(_0x28278a);})[_0xf169('0x1a')](function(_0x38864b){logger[_0xf169('0x16')](_0xf169('0x26'),_0x38864b[_0xf169('0x18')],_0x6809f9);_0x2124a7(_this[_0xf169('0x16')](0x1f4,_0x38864b[_0xf169('0x18')]));});});};
\ No newline at end of file