Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 8018347..81ef8ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fb=['request','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','then','debug','UpdateFaxMessage','update','body','attributes','limit','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x22fb,0x192));var _0xb22f=function(_0x2dbd86,_0x573069){_0x2dbd86=_0x2dbd86-0x0;var _0x508f71=_0x22fb[_0x2dbd86];return _0x508f71;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});config[_0xb22f('0xa')]=_[_0xb22f('0xb')](config['redis'],{'host':_0xb22f('0xc'),'port':0x18eb});var socket=require(_0xb22f('0xd'))(new Redis(config[_0xb22f('0xa')]));require(_0xb22f('0xe'))[_0xb22f('0xf')](socket);function respondWithRpcPromise(_0x3593fb,_0x188cea,_0x2ca6dd){return new BPromise(function(_0x26cf79,_0x2676f3){return client[_0xb22f('0x10')](_0x3593fb,_0x2ca6dd)['then'](function(_0x4b9e56){logger['info'](_0xb22f('0x11'),_0x188cea,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'),JSON[_0xb22f('0x13')](_0x4b9e56));if(_0x4b9e56[_0xb22f('0x14')]){if(_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x15')]===0x1f4){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x4b9e56[_0xb22f('0x14')]['message']);return _0x2676f3(_0x4b9e56[_0xb22f('0x14')]['message']);}logger[_0xb22f('0x14')](_0xb22f('0x11'),_0x188cea,_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x16')]);return _0x26cf79(_0x4b9e56[_0xb22f('0x14')]['message']);}else{logger[_0xb22f('0x17')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'));_0x26cf79(_0x4b9e56[_0xb22f('0x18')][_0xb22f('0x16')]);}})[_0xb22f('0x19')](function(_0x139bb6){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x139bb6);_0x2676f3(_0x139bb6);});});}exports[_0xb22f('0x1a')]=function(_0x4b4510){var _0x3e05ce=this;return new Promise(function(_0x3878d8,_0x316f11){return db[_0xb22f('0x1b')][_0xb22f('0x1c')](_0x4b4510['body'],{'raw':_0x4b4510['options']?_0x4b4510[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![]})[_0xb22f('0x1f')](function(_0x16e465){logger[_0xb22f('0x17')](_0xb22f('0x1a'),_0x4b4510);logger[_0xb22f('0x20')](_0xb22f('0x1a'),_0x4b4510,JSON['stringify'](_0x16e465));_0x3878d8(_0x16e465);})['catch'](function(_0x3ab1d8){logger[_0xb22f('0x14')]('CreateFaxMessage',_0x3ab1d8[_0xb22f('0x16')],_0x4b4510);_0x316f11(_0x3e05ce[_0xb22f('0x14')](0x1f4,_0x3ab1d8['message']));});});};exports[_0xb22f('0x21')]=function(_0x2918be){var _0x4dfb62=this;return new Promise(function(_0x3e471f,_0x2c4a9e){return db[_0xb22f('0x1b')][_0xb22f('0x22')](_0x2918be[_0xb22f('0x23')],{'raw':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2918be['options']?_0x2918be['options']['where']||null:null,'attributes':_0x2918be[_0xb22f('0x1d')]?_0x2918be['options'][_0xb22f('0x24')]||null:null,'limit':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x25')]||null:null})[_0xb22f('0x1f')](function(_0x5b2a42){logger['info'](_0xb22f('0x21'),_0x2918be);logger[_0xb22f('0x20')](_0xb22f('0x21'),_0x2918be,JSON[_0xb22f('0x13')](_0x5b2a42));_0x3e471f(_0x5b2a42);})['catch'](function(_0x176133){logger[_0xb22f('0x14')]('UpdateFaxMessage',_0x176133[_0xb22f('0x16')],_0x2918be);_0x2c4a9e(_0x4dfb62[_0xb22f('0x14')](0x1f4,_0x176133[_0xb22f('0x16')]));});});};
\ No newline at end of file
+var _0xa41a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','info','debug','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','body','options','raw','then','FaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','bluebird','randomstring'];(function(_0xc4ed0c,_0x2e63f6){var _0x365f54=function(_0x8de275){while(--_0x8de275){_0xc4ed0c['push'](_0xc4ed0c['shift']());}};_0x365f54(++_0x2e63f6);}(_0xa41a,0x6b));var _0xaa41=function(_0x5cdd20,_0x5cb231){_0x5cdd20=_0x5cdd20-0x0;var _0x53246a=_0xa41a[_0x5cdd20];return _0x53246a;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xc')]));require(_0xaa41('0xe'))[_0xaa41('0xf')](socket);function respondWithRpcPromise(_0x1cc344,_0x4263d6,_0x38d930){return new BPromise(function(_0x806f08,_0x423a19){return client[_0xaa41('0x10')](_0x1cc344,_0x38d930)['then'](function(_0x1d3aac){logger[_0xaa41('0x11')]('FaxMessage,\x20%s,\x20%s',_0x4263d6,'request\x20sent');logger[_0xaa41('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4263d6,_0xaa41('0x13'),JSON[_0xaa41('0x14')](_0x1d3aac));if(_0x1d3aac[_0xaa41('0x15')]){if(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x16')]===0x1f4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);return _0x423a19(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}logger[_0xaa41('0x15')](_0xaa41('0x17'),_0x4263d6,_0x1d3aac['error'][_0xaa41('0x18')]);return _0x806f08(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}else{logger[_0xaa41('0x11')](_0xaa41('0x17'),_0x4263d6,_0xaa41('0x13'));_0x806f08(_0x1d3aac[_0xaa41('0x19')][_0xaa41('0x18')]);}})[_0xaa41('0x1a')](function(_0x4fe1a4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x4fe1a4);_0x423a19(_0x4fe1a4);});});}exports[_0xaa41('0x1b')]=function(_0x35c753){var _0x54c488=this;return new Promise(function(_0x2bf794,_0x1f692b){return db['FaxMessage']['create'](_0x35c753[_0xaa41('0x1c')],{'raw':_0x35c753['options']?_0x35c753[_0xaa41('0x1d')][_0xaa41('0x1e')]===undefined?!![]:![]:!![]})[_0xaa41('0x1f')](function(_0x1f27f3){logger[_0xaa41('0x11')]('CreateFaxMessage',_0x35c753);logger[_0xaa41('0x12')](_0xaa41('0x1b'),_0x35c753,JSON[_0xaa41('0x14')](_0x1f27f3));_0x2bf794(_0x1f27f3);})[_0xaa41('0x1a')](function(_0x274630){logger[_0xaa41('0x15')]('CreateFaxMessage',_0x274630['message'],_0x35c753);_0x1f692b(_0x54c488[_0xaa41('0x15')](0x1f4,_0x274630['message']));});});};exports['UpdateFaxMessage']=function(_0x12e362){var _0x59707f=this;return new Promise(function(_0x536bed,_0x2d0ac0){return db[_0xaa41('0x20')][_0xaa41('0x21')](_0x12e362[_0xaa41('0x1c')],{'raw':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x22')]||null:null,'attributes':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x23')]||null:null,'limit':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['limit']||null:null})[_0xaa41('0x1f')](function(_0x48b48b){logger['info'](_0xaa41('0x24'),_0x12e362);logger[_0xaa41('0x12')]('UpdateFaxMessage',_0x12e362,JSON[_0xaa41('0x14')](_0x48b48b));_0x536bed(_0x48b48b);})[_0xaa41('0x1a')](function(_0x4e3b44){logger['error']('UpdateFaxMessage',_0x4e3b44[_0xaa41('0x18')],_0x12e362);_0x2d0ac0(_0x59707f[_0xaa41('0x15')](0x1f4,_0x4e3b44[_0xaa41('0x18')]));});});};
\ No newline at end of file