Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index b23a142..ebc46da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb464=['raw','where','attributes','limit','UpdateFaxInteraction','debug','AddTagsToFaxInteraction','FaxInteraction','addTags','ids','omit','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxInteraction,\x20%s,\x20%s','catch','update','body','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb464,0x154));var _0x4b46=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xb464[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x4b46('0x0'));var util=require(_0x4b46('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4b46('0x2'));var fs=require('fs');var Redis=require(_0x4b46('0x3'));var db=require(_0x4b46('0x4'))['db'];var utils=require(_0x4b46('0x5'));var logger=require(_0x4b46('0x6'))(_0x4b46('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b46('0x8'));var client=jayson[_0x4b46('0x9')][_0x4b46('0xa')]({'port':0x232a});config[_0x4b46('0xb')]=_[_0x4b46('0xc')](config[_0x4b46('0xb')],{'host':_0x4b46('0xd'),'port':0x18eb});var socket=require(_0x4b46('0xe'))(new Redis(config[_0x4b46('0xb')]));require('./faxInteraction.socket')[_0x4b46('0xf')](socket);function respondWithRpcPromise(_0x38ee77,_0x1b89b8,_0x2ddacc){return new BPromise(function(_0x5a05ee,_0x298914){return client[_0x4b46('0x10')](_0x38ee77,_0x2ddacc)[_0x4b46('0x11')](function(_0x1f7bf0){logger[_0x4b46('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x1b89b8,_0x4b46('0x13'));logger['debug'](_0x4b46('0x14'),_0x1b89b8,_0x4b46('0x13'),JSON[_0x4b46('0x15')](_0x1f7bf0));if(_0x1f7bf0['error']){if(_0x1f7bf0['error']['code']===0x1f4){logger[_0x4b46('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x1b89b8,_0x1f7bf0[_0x4b46('0x16')][_0x4b46('0x17')]);return _0x298914(_0x1f7bf0[_0x4b46('0x16')][_0x4b46('0x17')]);}logger['error'](_0x4b46('0x18'),_0x1b89b8,_0x1f7bf0[_0x4b46('0x16')][_0x4b46('0x17')]);return _0x5a05ee(_0x1f7bf0[_0x4b46('0x16')][_0x4b46('0x17')]);}else{logger[_0x4b46('0x12')](_0x4b46('0x18'),_0x1b89b8,_0x4b46('0x13'));_0x5a05ee(_0x1f7bf0['result'][_0x4b46('0x17')]);}})[_0x4b46('0x19')](function(_0xc15c29){logger[_0x4b46('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x1b89b8,_0xc15c29);_0x298914(_0xc15c29);});});}exports['UpdateFaxInteraction']=function(_0x2c18b6){var _0x40c5be=this;return new Promise(function(_0x5c3ae9,_0x11aa9f){return db['FaxInteraction'][_0x4b46('0x1a')](_0x2c18b6[_0x4b46('0x1b')],{'raw':_0x2c18b6[_0x4b46('0x1c')]?_0x2c18b6['options'][_0x4b46('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c18b6[_0x4b46('0x1c')]?_0x2c18b6[_0x4b46('0x1c')][_0x4b46('0x1e')]||null:null,'attributes':_0x2c18b6[_0x4b46('0x1c')]?_0x2c18b6[_0x4b46('0x1c')][_0x4b46('0x1f')]||null:null,'limit':_0x2c18b6[_0x4b46('0x1c')]?_0x2c18b6[_0x4b46('0x1c')][_0x4b46('0x20')]||null:null})['then'](function(_0x3de775){logger['info'](_0x4b46('0x21'),_0x2c18b6);logger[_0x4b46('0x22')](_0x4b46('0x21'),_0x2c18b6,JSON['stringify'](_0x3de775));_0x5c3ae9(_0x3de775);})[_0x4b46('0x19')](function(_0x211ee1){logger[_0x4b46('0x16')]('UpdateFaxInteraction',_0x211ee1['message'],_0x2c18b6);_0x11aa9f(_0x40c5be[_0x4b46('0x16')](0x1f4,_0x211ee1[_0x4b46('0x17')]));});});};exports[_0x4b46('0x23')]=function(_0x124bc8){return new Promise(function(_0x2925ed,_0x220874){return db[_0x4b46('0x24')]['find']({'where':_0x124bc8[_0x4b46('0x1c')]?_0x124bc8[_0x4b46('0x1c')][_0x4b46('0x1e')]||null:null})[_0x4b46('0x11')](function(_0x209da3){if(_0x209da3){return _0x209da3[_0x4b46('0x25')](_0x124bc8[_0x4b46('0x1b')][_0x4b46('0x26')],_[_0x4b46('0x27')](_0x124bc8['body'],['ids','id'])||{});}})['spread'](function(_0x539f74){logger[_0x4b46('0x12')](_0x4b46('0x28'),_0x124bc8);logger[_0x4b46('0x22')](_0x4b46('0x28'),_0x124bc8,JSON[_0x4b46('0x15')](_0x539f74));_0x2925ed(_0x539f74);})[_0x4b46('0x19')](function(_0x4f957f){logger[_0x4b46('0x16')](_0x4b46('0x28'),_0x4f957f[_0x4b46('0x17')],_0x124bc8);_0x220874(_this[_0x4b46('0x16')](0x1f4,_0x4f957f['message']));});});};
\ No newline at end of file
+var _0x4ae8=['then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','UpdateFaxInteraction','options','raw','where','limit','catch','FaxInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','redis','defaults','localhost','register','request'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x4ae8,0x198));var _0x84ae=function(_0x3fed7f,_0x34274d){_0x3fed7f=_0x3fed7f-0x0;var _0x8ae2ba=_0x4ae8[_0x3fed7f];return _0x8ae2ba;};'use strict';var _=require(_0x84ae('0x0'));var util=require(_0x84ae('0x1'));var moment=require('moment');var BPromise=require(_0x84ae('0x2'));var rs=require(_0x84ae('0x3'));var fs=require('fs');var Redis=require(_0x84ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84ae('0x5'));var config=require('../../config/environment');var jayson=require(_0x84ae('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x84ae('0x7')]=_[_0x84ae('0x8')](config[_0x84ae('0x7')],{'host':_0x84ae('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84ae('0x7')]));require('./faxInteraction.socket')[_0x84ae('0xa')](socket);function respondWithRpcPromise(_0x3a2c11,_0x11b781,_0x321251){return new BPromise(function(_0x2fec74,_0x5028b4){return client[_0x84ae('0xb')](_0x3a2c11,_0x321251)[_0x84ae('0xc')](function(_0x86f7c0){logger['info'](_0x84ae('0xd'),_0x11b781,_0x84ae('0xe'));logger[_0x84ae('0xf')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x11b781,_0x84ae('0xe'),JSON[_0x84ae('0x10')](_0x86f7c0));if(_0x86f7c0[_0x84ae('0x11')]){if(_0x86f7c0['error'][_0x84ae('0x12')]===0x1f4){logger[_0x84ae('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x11b781,_0x86f7c0[_0x84ae('0x11')][_0x84ae('0x13')]);return _0x5028b4(_0x86f7c0[_0x84ae('0x11')][_0x84ae('0x13')]);}logger['error'](_0x84ae('0xd'),_0x11b781,_0x86f7c0[_0x84ae('0x11')][_0x84ae('0x13')]);return _0x2fec74(_0x86f7c0[_0x84ae('0x11')]['message']);}else{logger[_0x84ae('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x11b781,_0x84ae('0xe'));_0x2fec74(_0x86f7c0['result'][_0x84ae('0x13')]);}})['catch'](function(_0x17650a){logger['error'](_0x84ae('0xd'),_0x11b781,_0x17650a);_0x5028b4(_0x17650a);});});}exports[_0x84ae('0x15')]=function(_0x9104ee){var _0x1be062=this;return new Promise(function(_0x33e50e,_0x18523f){return db['FaxInteraction']['update'](_0x9104ee['body'],{'raw':_0x9104ee[_0x84ae('0x16')]?_0x9104ee['options'][_0x84ae('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9104ee['options']?_0x9104ee[_0x84ae('0x16')][_0x84ae('0x18')]||null:null,'attributes':_0x9104ee[_0x84ae('0x16')]?_0x9104ee[_0x84ae('0x16')]['attributes']||null:null,'limit':_0x9104ee[_0x84ae('0x16')]?_0x9104ee[_0x84ae('0x16')][_0x84ae('0x19')]||null:null})['then'](function(_0x30fee9){logger[_0x84ae('0x14')](_0x84ae('0x15'),_0x9104ee);logger[_0x84ae('0xf')](_0x84ae('0x15'),_0x9104ee,JSON[_0x84ae('0x10')](_0x30fee9));_0x33e50e(_0x30fee9);})[_0x84ae('0x1a')](function(_0x61e0f2){logger[_0x84ae('0x11')](_0x84ae('0x15'),_0x61e0f2['message'],_0x9104ee);_0x18523f(_0x1be062['error'](0x1f4,_0x61e0f2['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x39acc9){return new Promise(function(_0x5ede83,_0x468125){return db[_0x84ae('0x1b')][_0x84ae('0x1c')]({'where':_0x39acc9[_0x84ae('0x16')]?_0x39acc9[_0x84ae('0x16')][_0x84ae('0x18')]||null:null})[_0x84ae('0xc')](function(_0x58ade2){if(_0x58ade2){return _0x58ade2[_0x84ae('0x1d')](_0x39acc9[_0x84ae('0x1e')][_0x84ae('0x1f')],_[_0x84ae('0x20')](_0x39acc9['body'],[_0x84ae('0x1f'),'id'])||{});}})[_0x84ae('0x21')](function(_0x1a90fa){logger['info'](_0x84ae('0x22'),_0x39acc9);logger['debug'](_0x84ae('0x22'),_0x39acc9,JSON[_0x84ae('0x10')](_0x1a90fa));_0x5ede83(_0x1a90fa);})[_0x84ae('0x1a')](function(_0x52c838){logger[_0x84ae('0x11')](_0x84ae('0x22'),_0x52c838[_0x84ae('0x13')],_0x39acc9);_0x468125(_this[_0x84ae('0x11')](0x1f4,_0x52c838[_0x84ae('0x13')]));});});};
\ No newline at end of file