Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 72c4fe7..bef2bf4 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0xb54d45,_0x2c91e4){var _0x278c87=function(_0x5bd168){while(--_0x5bd168){_0xb54d45['push'](_0xb54d45['shift']());}};_0x278c87(++_0x2c91e4);}(_0xac31,0xca));var _0x1ac3=function(_0x435614,_0x4eb186){_0x435614=_0x435614-0x0;var _0x1908fd=_0xac31[_0x435614];return _0x1908fd;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});};
\ No newline at end of file