Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 8018347..810e420 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 _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x5b2eef,_0x3aab32){var _0x44a109=function(_0x2fbbd9){while(--_0x2fbbd9){_0x5b2eef['push'](_0x5b2eef['shift']());}};_0x44a109(++_0x3aab32);}(_0x6aa7,0x178));var _0x76aa=function(_0x312c66,_0x4ddaeb){_0x312c66=_0x312c66-0x0;var _0x106387=_0x6aa7[_0x312c66];return _0x106387;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});};
\ No newline at end of file