Built motion from commit a679711e.|2.6.15
[motion2.git] / server / api / faxInteraction / faxInteraction.rpc.js
index b522116..5deed50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41b2=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','find','spread','AddTags','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./faxInteraction.socket'];(function(_0x4fadaf,_0x179d85){var _0x4738a8=function(_0x34ce7b){while(--_0x34ce7b){_0x4fadaf['push'](_0x4fadaf['shift']());}};_0x4738a8(++_0x179d85);}(_0x41b2,0xa7));var _0x241b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x241b('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241b('0x1'));var db=require(_0x241b('0x2'))['db'];var utils=require(_0x241b('0x3'));var logger=require(_0x241b('0x4'))(_0x241b('0x5'));var config=require(_0x241b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x241b('0x7')][_0x241b('0x8')]({'port':0x232a});config['redis']=_[_0x241b('0x9')](config[_0x241b('0xa')],{'host':_0x241b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x241b('0xa')]));require(_0x241b('0xc'))[_0x241b('0xd')](socket);function respondWithRpcPromise(_0x36f0d1,_0x4d99fe,_0x283f79){return new BPromise(function(_0x46f921,_0x5372b0){return client[_0x241b('0xe')](_0x36f0d1,_0x283f79)[_0x241b('0xf')](function(_0x3ceb41){logger[_0x241b('0x10')](_0x241b('0x11'),_0x4d99fe,'request\x20sent');logger[_0x241b('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4d99fe,_0x241b('0x13'),JSON[_0x241b('0x14')](_0x3ceb41));if(_0x3ceb41[_0x241b('0x15')]){if(_0x3ceb41[_0x241b('0x15')][_0x241b('0x16')]===0x1f4){logger['error'](_0x241b('0x11'),_0x4d99fe,_0x3ceb41['error'][_0x241b('0x17')]);return _0x5372b0(_0x3ceb41[_0x241b('0x15')][_0x241b('0x17')]);}logger['error'](_0x241b('0x11'),_0x4d99fe,_0x3ceb41[_0x241b('0x15')][_0x241b('0x17')]);return _0x46f921(_0x3ceb41['error'][_0x241b('0x17')]);}else{logger[_0x241b('0x10')](_0x241b('0x11'),_0x4d99fe,_0x241b('0x13'));_0x46f921(_0x3ceb41[_0x241b('0x18')][_0x241b('0x17')]);}})[_0x241b('0x19')](function(_0x5f4e5e){logger['error'](_0x241b('0x11'),_0x4d99fe,_0x5f4e5e);_0x5372b0(_0x5f4e5e);});});}exports[_0x241b('0x1a')]=function(_0x57b4e4){var _0x1e2ac1=this;return new Promise(function(_0x5ceb8a,_0x6be10){return db[_0x241b('0x1b')]['update'](_0x57b4e4[_0x241b('0x1c')],{'raw':_0x57b4e4[_0x241b('0x1d')]?_0x57b4e4[_0x241b('0x1d')][_0x241b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b4e4[_0x241b('0x1d')]?_0x57b4e4[_0x241b('0x1d')][_0x241b('0x1f')]||null:null,'attributes':_0x57b4e4[_0x241b('0x1d')]?_0x57b4e4[_0x241b('0x1d')][_0x241b('0x20')]||null:null,'limit':_0x57b4e4['options']?_0x57b4e4['options']['limit']||null:null})[_0x241b('0xf')](function(_0x28d874){logger['info'](_0x241b('0x1a'),_0x57b4e4);logger[_0x241b('0x12')](_0x241b('0x1a'),_0x57b4e4,JSON[_0x241b('0x14')](_0x28d874));_0x5ceb8a(_0x28d874);})[_0x241b('0x19')](function(_0x47e824){logger[_0x241b('0x15')](_0x241b('0x1a'),_0x47e824[_0x241b('0x17')],_0x57b4e4);_0x6be10(_0x1e2ac1['error'](0x1f4,_0x47e824[_0x241b('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x5b65bd){return new Promise(function(_0x3c6820,_0x2a3fdb){return db[_0x241b('0x1b')][_0x241b('0x21')]({'where':_0x5b65bd[_0x241b('0x1d')]?_0x5b65bd[_0x241b('0x1d')][_0x241b('0x1f')]||null:null})[_0x241b('0xf')](function(_0x430740){if(_0x430740){return _0x430740['addTags'](_0x5b65bd[_0x241b('0x1c')]['ids'],_['omit'](_0x5b65bd['body'],['ids','id'])||{});}})[_0x241b('0x22')](function(_0x405b6c){logger[_0x241b('0x10')]('AddTags',_0x5b65bd);logger['debug']('AddTags',_0x5b65bd,JSON['stringify'](_0x405b6c));_0x3c6820(_0x405b6c);})['catch'](function(_0x55d767){logger['error'](_0x241b('0x23'),_0x55d767[_0x241b('0x17')],_0x5b65bd);_0x2a3fdb(_this[_0x241b('0x15')](0x1f4,_0x55d767[_0x241b('0x17')]));});});};
\ No newline at end of file
+var _0xb043=['stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','update','options','raw','where','attributes','then','AddTagsToFaxInteraction','find','addTags','body','ids','omit','spread','AddTags'];(function(_0x113400,_0x41e19b){var _0x1fa1e4=function(_0x51e8ae){while(--_0x51e8ae){_0x113400['push'](_0x113400['shift']());}};_0x1fa1e4(++_0x41e19b);}(_0xb043,0x159));var _0x3b04=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xb043[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x3b04('0x0'));var moment=require(_0x3b04('0x1'));var BPromise=require(_0x3b04('0x2'));var rs=require(_0x3b04('0x3'));var fs=require('fs');var Redis=require(_0x3b04('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b04('0x5'));var logger=require(_0x3b04('0x6'))(_0x3b04('0x7'));var config=require(_0x3b04('0x8'));var jayson=require(_0x3b04('0x9'));var client=jayson[_0x3b04('0xa')][_0x3b04('0xb')]({'port':0x232a});config[_0x3b04('0xc')]=_['defaults'](config[_0x3b04('0xc')],{'host':_0x3b04('0xd'),'port':0x18eb});var socket=require(_0x3b04('0xe'))(new Redis(config['redis']));require(_0x3b04('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ed95e,_0xcc32c3,_0x2e9dd2){return new BPromise(function(_0x2f4003,_0x1c3706){return client[_0x3b04('0x10')](_0x2ed95e,_0x2e9dd2)['then'](function(_0x1f5ed9){logger[_0x3b04('0x11')]('FaxInteraction,\x20%s,\x20%s',_0xcc32c3,_0x3b04('0x12'));logger[_0x3b04('0x13')](_0x3b04('0x14'),_0xcc32c3,_0x3b04('0x12'),JSON['stringify'](_0x1f5ed9));if(_0x1f5ed9[_0x3b04('0x15')]){if(_0x1f5ed9[_0x3b04('0x15')][_0x3b04('0x16')]===0x1f4){logger['error'](_0x3b04('0x17'),_0xcc32c3,_0x1f5ed9[_0x3b04('0x15')][_0x3b04('0x18')]);return _0x1c3706(_0x1f5ed9[_0x3b04('0x15')][_0x3b04('0x18')]);}logger[_0x3b04('0x15')]('FaxInteraction,\x20%s,\x20%s',_0xcc32c3,_0x1f5ed9[_0x3b04('0x15')][_0x3b04('0x18')]);return _0x2f4003(_0x1f5ed9['error'][_0x3b04('0x18')]);}else{logger[_0x3b04('0x11')](_0x3b04('0x17'),_0xcc32c3,'request\x20sent');_0x2f4003(_0x1f5ed9[_0x3b04('0x19')]['message']);}})[_0x3b04('0x1a')](function(_0x581b8d){logger[_0x3b04('0x15')]('FaxInteraction,\x20%s,\x20%s',_0xcc32c3,_0x581b8d);_0x1c3706(_0x581b8d);});});}exports[_0x3b04('0x1b')]=function(_0x1b8ae4){var _0x469a06=this;return new Promise(function(_0x405d2a,_0x5f044e){return db['FaxInteraction'][_0x3b04('0x1c')](_0x1b8ae4['body'],{'raw':_0x1b8ae4[_0x3b04('0x1d')]?_0x1b8ae4[_0x3b04('0x1d')][_0x3b04('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b8ae4[_0x3b04('0x1d')]?_0x1b8ae4['options'][_0x3b04('0x1f')]||null:null,'attributes':_0x1b8ae4[_0x3b04('0x1d')]?_0x1b8ae4[_0x3b04('0x1d')][_0x3b04('0x20')]||null:null,'limit':_0x1b8ae4[_0x3b04('0x1d')]?_0x1b8ae4[_0x3b04('0x1d')]['limit']||null:null})[_0x3b04('0x21')](function(_0x2ffc0f){logger[_0x3b04('0x11')](_0x3b04('0x1b'),_0x1b8ae4);logger[_0x3b04('0x13')](_0x3b04('0x1b'),_0x1b8ae4,JSON['stringify'](_0x2ffc0f));_0x405d2a(_0x2ffc0f);})[_0x3b04('0x1a')](function(_0x457b0b){logger['error'](_0x3b04('0x1b'),_0x457b0b[_0x3b04('0x18')],_0x1b8ae4);_0x5f044e(_0x469a06[_0x3b04('0x15')](0x1f4,_0x457b0b[_0x3b04('0x18')]));});});};exports[_0x3b04('0x22')]=function(_0x1c1d74){return new Promise(function(_0x398ea8,_0x1b7c08){return db['FaxInteraction'][_0x3b04('0x23')]({'where':_0x1c1d74['options']?_0x1c1d74[_0x3b04('0x1d')][_0x3b04('0x1f')]||null:null})['then'](function(_0x3e8c1a){if(_0x3e8c1a){return _0x3e8c1a[_0x3b04('0x24')](_0x1c1d74[_0x3b04('0x25')][_0x3b04('0x26')],_[_0x3b04('0x27')](_0x1c1d74[_0x3b04('0x25')],[_0x3b04('0x26'),'id'])||{});}})[_0x3b04('0x28')](function(_0xf76fb8){logger['info'](_0x3b04('0x29'),_0x1c1d74);logger[_0x3b04('0x13')](_0x3b04('0x29'),_0x1c1d74,JSON[_0x3b04('0x2a')](_0xf76fb8));_0x398ea8(_0xf76fb8);})[_0x3b04('0x1a')](function(_0x1e7b4b){logger[_0x3b04('0x15')]('AddTags',_0x1e7b4b[_0x3b04('0x18')],_0x1c1d74);_0x1b7c08(_this[_0x3b04('0x15')](0x1f4,_0x1e7b4b[_0x3b04('0x18')]));});});};
\ No newline at end of file