Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index 49d968f..46c8258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe599=['request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','update','options','raw','attributes','AddTagsToFaxInteraction','find','where','addTags','ids','body','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','debug'];(function(_0x295e76,_0x2807d8){var _0x355278=function(_0x31268e){while(--_0x31268e){_0x295e76['push'](_0x295e76['shift']());}};_0x355278(++_0x2807d8);}(_0xe599,0x154));var _0x9e59=function(_0x1ef630,_0x700320){_0x1ef630=_0x1ef630-0x0;var _0x5a3410=_0xe599[_0x1ef630];return _0x5a3410;};'use strict';var _=require(_0x9e59('0x0'));var util=require(_0x9e59('0x1'));var moment=require('moment');var BPromise=require(_0x9e59('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e59('0x3'));var db=require(_0x9e59('0x4'))['db'];var utils=require(_0x9e59('0x5'));var logger=require(_0x9e59('0x6'))(_0x9e59('0x7'));var config=require('../../config/environment');var jayson=require(_0x9e59('0x8'));var client=jayson[_0x9e59('0x9')][_0x9e59('0xa')]({'port':0x232a});config[_0x9e59('0xb')]=_[_0x9e59('0xc')](config['redis'],{'host':_0x9e59('0xd'),'port':0x18eb});var socket=require(_0x9e59('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x9e59('0xf')](socket);function respondWithRpcPromise(_0x36d3b0,_0xaf0901,_0x1022b2){return new BPromise(function(_0x5b5073,_0x223718){return client[_0x9e59('0x10')](_0x36d3b0,_0x1022b2)[_0x9e59('0x11')](function(_0x84a337){logger['info'](_0x9e59('0x12'),_0xaf0901,'request\x20sent');logger[_0x9e59('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xaf0901,_0x9e59('0x14'),JSON[_0x9e59('0x15')](_0x84a337));if(_0x84a337['error']){if(_0x84a337[_0x9e59('0x16')][_0x9e59('0x17')]===0x1f4){logger['error'](_0x9e59('0x12'),_0xaf0901,_0x84a337['error']['message']);return _0x223718(_0x84a337[_0x9e59('0x16')][_0x9e59('0x18')]);}logger[_0x9e59('0x16')](_0x9e59('0x12'),_0xaf0901,_0x84a337[_0x9e59('0x16')][_0x9e59('0x18')]);return _0x5b5073(_0x84a337[_0x9e59('0x16')][_0x9e59('0x18')]);}else{logger[_0x9e59('0x19')](_0x9e59('0x12'),_0xaf0901,_0x9e59('0x14'));_0x5b5073(_0x84a337[_0x9e59('0x1a')][_0x9e59('0x18')]);}})[_0x9e59('0x1b')](function(_0x14a8c9){logger['error'](_0x9e59('0x12'),_0xaf0901,_0x14a8c9);_0x223718(_0x14a8c9);});});}exports[_0x9e59('0x1c')]=function(_0x3717bb){var _0x2d33f9=this;return new Promise(function(_0x1c3dde,_0x345507){return db['FaxInteraction'][_0x9e59('0x1d')](_0x3717bb['body'],{'raw':_0x3717bb[_0x9e59('0x1e')]?_0x3717bb[_0x9e59('0x1e')][_0x9e59('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3717bb[_0x9e59('0x1e')]?_0x3717bb['options']['where']||null:null,'attributes':_0x3717bb[_0x9e59('0x1e')]?_0x3717bb[_0x9e59('0x1e')][_0x9e59('0x20')]||null:null,'limit':_0x3717bb['options']?_0x3717bb['options']['limit']||null:null})['then'](function(_0x27ecbf){logger[_0x9e59('0x19')](_0x9e59('0x1c'),_0x3717bb);logger[_0x9e59('0x13')](_0x9e59('0x1c'),_0x3717bb,JSON[_0x9e59('0x15')](_0x27ecbf));_0x1c3dde(_0x27ecbf);})['catch'](function(_0x5bfc00){logger[_0x9e59('0x16')](_0x9e59('0x1c'),_0x5bfc00[_0x9e59('0x18')],_0x3717bb);_0x345507(_0x2d33f9[_0x9e59('0x16')](0x1f4,_0x5bfc00[_0x9e59('0x18')]));});});};exports[_0x9e59('0x21')]=function(_0x1d5412){return new Promise(function(_0x122e8e,_0x5a50c6){return db['FaxInteraction'][_0x9e59('0x22')]({'where':_0x1d5412[_0x9e59('0x1e')]?_0x1d5412[_0x9e59('0x1e')][_0x9e59('0x23')]||null:null})[_0x9e59('0x11')](function(_0x3df461){if(_0x3df461){return _0x3df461[_0x9e59('0x24')](_0x1d5412['body'][_0x9e59('0x25')],_['omit'](_0x1d5412[_0x9e59('0x26')],[_0x9e59('0x25'),'id'])||{});}})['spread'](function(_0x47e4a8){logger[_0x9e59('0x19')]('AddTags',_0x1d5412);logger[_0x9e59('0x13')](_0x9e59('0x27'),_0x1d5412,JSON[_0x9e59('0x15')](_0x47e4a8));_0x122e8e(_0x47e4a8);})['catch'](function(_0x233f4d){logger[_0x9e59('0x16')](_0x9e59('0x27'),_0x233f4d[_0x9e59('0x18')],_0x1d5412);_0x5a50c6(_this[_0x9e59('0x16')](0x1f4,_0x233f4d[_0x9e59('0x18')]));});});};
\ No newline at end of file
+var _0x1cd7=['addTags','body','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','limit','debug','AddTagsToFaxInteraction','find'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x1cd7,0x165));var _0x71cd=function(_0x1bba53,_0x498b0a){_0x1bba53=_0x1bba53-0x0;var _0x10ad9f=_0x1cd7[_0x1bba53];return _0x10ad9f;};'use strict';var _=require(_0x71cd('0x0'));var util=require('util');var moment=require(_0x71cd('0x1'));var BPromise=require('bluebird');var rs=require(_0x71cd('0x2'));var fs=require('fs');var Redis=require(_0x71cd('0x3'));var db=require(_0x71cd('0x4'))['db'];var utils=require(_0x71cd('0x5'));var logger=require(_0x71cd('0x6'))(_0x71cd('0x7'));var config=require(_0x71cd('0x8'));var jayson=require(_0x71cd('0x9'));var client=jayson[_0x71cd('0xa')][_0x71cd('0xb')]({'port':0x232a});config[_0x71cd('0xc')]=_[_0x71cd('0xd')](config[_0x71cd('0xc')],{'host':_0x71cd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71cd('0xc')]));require(_0x71cd('0xf'))[_0x71cd('0x10')](socket);function respondWithRpcPromise(_0x3b184b,_0x417e6d,_0x1f1159){return new BPromise(function(_0x5dddf8,_0xd38ecd){return client[_0x71cd('0x11')](_0x3b184b,_0x1f1159)[_0x71cd('0x12')](function(_0x46cff7){logger['info'](_0x71cd('0x13'),_0x417e6d,_0x71cd('0x14'));logger['debug'](_0x71cd('0x15'),_0x417e6d,'request\x20sent',JSON[_0x71cd('0x16')](_0x46cff7));if(_0x46cff7[_0x71cd('0x17')]){if(_0x46cff7[_0x71cd('0x17')][_0x71cd('0x18')]===0x1f4){logger[_0x71cd('0x17')](_0x71cd('0x13'),_0x417e6d,_0x46cff7[_0x71cd('0x17')][_0x71cd('0x19')]);return _0xd38ecd(_0x46cff7['error']['message']);}logger['error'](_0x71cd('0x13'),_0x417e6d,_0x46cff7[_0x71cd('0x17')][_0x71cd('0x19')]);return _0x5dddf8(_0x46cff7['error']['message']);}else{logger[_0x71cd('0x1a')]('FaxInteraction,\x20%s,\x20%s',_0x417e6d,_0x71cd('0x14'));_0x5dddf8(_0x46cff7[_0x71cd('0x1b')]['message']);}})[_0x71cd('0x1c')](function(_0x2d61eb){logger[_0x71cd('0x17')](_0x71cd('0x13'),_0x417e6d,_0x2d61eb);_0xd38ecd(_0x2d61eb);});});}exports[_0x71cd('0x1d')]=function(_0xb4a059){var _0x3ebf23=this;return new Promise(function(_0x41d8a7,_0x196589){return db[_0x71cd('0x1e')][_0x71cd('0x1f')](_0xb4a059['body'],{'raw':_0xb4a059[_0x71cd('0x20')]?_0xb4a059[_0x71cd('0x20')][_0x71cd('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4a059['options']?_0xb4a059[_0x71cd('0x20')][_0x71cd('0x22')]||null:null,'attributes':_0xb4a059['options']?_0xb4a059[_0x71cd('0x20')]['attributes']||null:null,'limit':_0xb4a059[_0x71cd('0x20')]?_0xb4a059['options'][_0x71cd('0x23')]||null:null})[_0x71cd('0x12')](function(_0x840d52){logger[_0x71cd('0x1a')](_0x71cd('0x1d'),_0xb4a059);logger[_0x71cd('0x24')](_0x71cd('0x1d'),_0xb4a059,JSON[_0x71cd('0x16')](_0x840d52));_0x41d8a7(_0x840d52);})[_0x71cd('0x1c')](function(_0x4fcd18){logger['error']('UpdateFaxInteraction',_0x4fcd18[_0x71cd('0x19')],_0xb4a059);_0x196589(_0x3ebf23[_0x71cd('0x17')](0x1f4,_0x4fcd18['message']));});});};exports[_0x71cd('0x25')]=function(_0x140e55){return new Promise(function(_0x2a3f30,_0x5e70b8){return db[_0x71cd('0x1e')][_0x71cd('0x26')]({'where':_0x140e55['options']?_0x140e55[_0x71cd('0x20')][_0x71cd('0x22')]||null:null})['then'](function(_0x139dde){if(_0x139dde){return _0x139dde[_0x71cd('0x27')](_0x140e55[_0x71cd('0x28')][_0x71cd('0x29')],_[_0x71cd('0x2a')](_0x140e55[_0x71cd('0x28')],[_0x71cd('0x29'),'id'])||{});}})['spread'](function(_0x2a640b){logger[_0x71cd('0x1a')](_0x71cd('0x2b'),_0x140e55);logger[_0x71cd('0x24')](_0x71cd('0x2b'),_0x140e55,JSON[_0x71cd('0x16')](_0x2a640b));_0x2a3f30(_0x2a640b);})[_0x71cd('0x1c')](function(_0x240eb9){logger[_0x71cd('0x17')]('AddTags',_0x240eb9[_0x71cd('0x19')],_0x140e55);_0x5e70b8(_this[_0x71cd('0x17')](0x1f4,_0x240eb9[_0x71cd('0x19')]));});});};
\ No newline at end of file