Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 72c4fe7..be1c1fe 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22fb,0x192));var _0xb22f=function(_0x28e1d8,_0x54ef19){_0x28e1d8=_0x28e1d8-0x0;var _0x39105d=_0x22fb[_0x28e1d8];return _0x39105d;};'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 _0x0a9a=['error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1bc933,_0x46c2de){var _0x238bba=function(_0x5399ef){while(--_0x5399ef){_0x1bc933['push'](_0x1bc933['shift']());}};_0x238bba(++_0x46c2de);}(_0x0a9a,0x183));var _0xa0a9=function(_0x983fb4,_0x4e1eb0){_0x983fb4=_0x983fb4-0x0;var _0x46ca85=_0x0a9a[_0x983fb4];return _0x46ca85;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});config[_0xa0a9('0xa')]=_['defaults'](config[_0xa0a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xb'))(new Redis(config[_0xa0a9('0xa')]));require(_0xa0a9('0xc'))[_0xa0a9('0xd')](socket);function respondWithRpcPromise(_0x4b9b93,_0x2ba0ac,_0x1b5bfb){return new BPromise(function(_0x5ce7e9,_0x5909cf){return client[_0xa0a9('0xe')](_0x4b9b93,_0x1b5bfb)[_0xa0a9('0xf')](function(_0x51d5a5){logger[_0xa0a9('0x10')]('FaxMessage,\x20%s,\x20%s',_0x2ba0ac,_0xa0a9('0x11'));logger['debug'](_0xa0a9('0x12'),_0x2ba0ac,_0xa0a9('0x11'),JSON[_0xa0a9('0x13')](_0x51d5a5));if(_0x51d5a5[_0xa0a9('0x14')]){if(_0x51d5a5[_0xa0a9('0x14')]['code']===0x1f4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);return _0x5909cf(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}logger['error'](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5['error']['message']);return _0x5ce7e9(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}else{logger[_0xa0a9('0x10')](_0xa0a9('0x15'),_0x2ba0ac,'request\x20sent');_0x5ce7e9(_0x51d5a5[_0xa0a9('0x17')][_0xa0a9('0x16')]);}})[_0xa0a9('0x18')](function(_0x27f8d4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x27f8d4);_0x5909cf(_0x27f8d4);});});}exports['CreateFaxMessage']=function(_0x3cdd8c){var _0x3107ce=this;return new Promise(function(_0x4a8e80,_0x53b99d){return db[_0xa0a9('0x19')][_0xa0a9('0x1a')](_0x3cdd8c[_0xa0a9('0x1b')],{'raw':_0x3cdd8c['options']?_0x3cdd8c[_0xa0a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa0a9('0xf')](function(_0x5e6148){logger[_0xa0a9('0x10')](_0xa0a9('0x1d'),_0x3cdd8c);logger[_0xa0a9('0x1e')](_0xa0a9('0x1d'),_0x3cdd8c,JSON['stringify'](_0x5e6148));_0x4a8e80(_0x5e6148);})[_0xa0a9('0x18')](function(_0x4fb909){logger[_0xa0a9('0x14')](_0xa0a9('0x1d'),_0x4fb909[_0xa0a9('0x16')],_0x3cdd8c);_0x53b99d(_0x3107ce[_0xa0a9('0x14')](0x1f4,_0x4fb909['message']));});});};exports[_0xa0a9('0x1f')]=function(_0xe49d3b){var _0x384cd5=this;return new Promise(function(_0x3f4bea,_0x526dd1){return db[_0xa0a9('0x19')][_0xa0a9('0x20')](_0xe49d3b[_0xa0a9('0x1b')],{'raw':_0xe49d3b['options']?_0xe49d3b['options'][_0xa0a9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x22')]||null:null,'attributes':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x23')]||null:null,'limit':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x24')]||null:null})[_0xa0a9('0xf')](function(_0x554191){logger[_0xa0a9('0x10')](_0xa0a9('0x1f'),_0xe49d3b);logger['debug'](_0xa0a9('0x1f'),_0xe49d3b,JSON[_0xa0a9('0x13')](_0x554191));_0x3f4bea(_0x554191);})['catch'](function(_0x47c19b){logger[_0xa0a9('0x14')]('UpdateFaxMessage',_0x47c19b['message'],_0xe49d3b);_0x526dd1(_0x384cd5[_0xa0a9('0x14')](0x1f4,_0x47c19b[_0xa0a9('0x16')]));});});};
\ No newline at end of file