Built motion from commit (unavailable).|2.5.28
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 41dfe83..b56dd02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ba5=['../../config/utils','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','create','body','options','raw','update','where','attributes','limit','UpdateFaxMessage','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8ba5,0x8f));var _0x58ba=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0x8ba5[_0x1aae33];return _0x2e91e9;};'use strict';var _=require('lodash');var util=require(_0x58ba('0x0'));var moment=require(_0x58ba('0x1'));var BPromise=require(_0x58ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58ba('0x3'));var db=require(_0x58ba('0x4'))['db'];var utils=require(_0x58ba('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x58ba('0x6'));var jayson=require(_0x58ba('0x7'));var client=jayson[_0x58ba('0x8')]['http']({'port':0x232a});config['redis']=_[_0x58ba('0x9')](config['redis'],{'host':_0x58ba('0xa'),'port':0x18eb});var socket=require(_0x58ba('0xb'))(new Redis(config[_0x58ba('0xc')]));require(_0x58ba('0xd'))['register'](socket);function respondWithRpcPromise(_0xe1c094,_0x589234,_0x54ab72){return new BPromise(function(_0x4894b5,_0x331f2d){return client[_0x58ba('0xe')](_0xe1c094,_0x54ab72)[_0x58ba('0xf')](function(_0x496445){logger[_0x58ba('0x10')](_0x58ba('0x11'),_0x589234,_0x58ba('0x12'));logger[_0x58ba('0x13')](_0x58ba('0x14'),_0x589234,_0x58ba('0x12'),JSON[_0x58ba('0x15')](_0x496445));if(_0x496445[_0x58ba('0x16')]){if(_0x496445['error'][_0x58ba('0x17')]===0x1f4){logger[_0x58ba('0x16')](_0x58ba('0x11'),_0x589234,_0x496445['error'][_0x58ba('0x18')]);return _0x331f2d(_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);}logger[_0x58ba('0x16')](_0x58ba('0x11'),_0x589234,_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);return _0x4894b5(_0x496445[_0x58ba('0x16')][_0x58ba('0x18')]);}else{logger[_0x58ba('0x10')]('FaxMessage,\x20%s,\x20%s',_0x589234,_0x58ba('0x12'));_0x4894b5(_0x496445[_0x58ba('0x19')][_0x58ba('0x18')]);}})[_0x58ba('0x1a')](function(_0x1ed83e){logger[_0x58ba('0x16')]('FaxMessage,\x20%s,\x20%s',_0x589234,_0x1ed83e);_0x331f2d(_0x1ed83e);});});}exports[_0x58ba('0x1b')]=function(_0x215685){var _0x4f1058=this;return new Promise(function(_0x392633,_0x3af74d){return db['FaxMessage'][_0x58ba('0x1c')](_0x215685[_0x58ba('0x1d')],{'raw':_0x215685[_0x58ba('0x1e')]?_0x215685[_0x58ba('0x1e')][_0x58ba('0x1f')]===undefined?!![]:![]:!![]})[_0x58ba('0xf')](function(_0xb07407){logger['info'](_0x58ba('0x1b'),_0x215685);logger[_0x58ba('0x13')](_0x58ba('0x1b'),_0x215685,JSON[_0x58ba('0x15')](_0xb07407));_0x392633(_0xb07407);})['catch'](function(_0x5e951e){logger[_0x58ba('0x16')](_0x58ba('0x1b'),_0x5e951e['message'],_0x215685);_0x3af74d(_0x4f1058[_0x58ba('0x16')](0x1f4,_0x5e951e[_0x58ba('0x18')]));});});};exports['UpdateFaxMessage']=function(_0xa7419b){var _0x1460e6=this;return new Promise(function(_0x5c2377,_0x29517b){return db['FaxMessage'][_0x58ba('0x20')](_0xa7419b[_0x58ba('0x1d')],{'raw':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b['options'][_0x58ba('0x21')]||null:null,'attributes':_0xa7419b[_0x58ba('0x1e')]?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x22')]||null:null,'limit':_0xa7419b['options']?_0xa7419b[_0x58ba('0x1e')][_0x58ba('0x23')]||null:null})[_0x58ba('0xf')](function(_0x6e175f){logger['info']('UpdateFaxMessage',_0xa7419b);logger[_0x58ba('0x13')](_0x58ba('0x24'),_0xa7419b,JSON[_0x58ba('0x15')](_0x6e175f));_0x5c2377(_0x6e175f);})[_0x58ba('0x1a')](function(_0x57f444){logger[_0x58ba('0x16')](_0x58ba('0x24'),_0x57f444['message'],_0xa7419b);_0x29517b(_0x1460e6[_0x58ba('0x16')](0x1f4,_0x57f444['message']));});});};
\ No newline at end of file
+var _0x6801=['FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','stringify','error'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x6801,0x1c8));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1680('0x0'));var util=require(_0x1680('0x1'));var moment=require(_0x1680('0x2'));var BPromise=require(_0x1680('0x3'));var rs=require(_0x1680('0x4'));var fs=require('fs');var Redis=require(_0x1680('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1680('0x6'));var logger=require(_0x1680('0x7'))(_0x1680('0x8'));var config=require(_0x1680('0x9'));var jayson=require(_0x1680('0xa'));var client=jayson[_0x1680('0xb')][_0x1680('0xc')]({'port':0x232a});config[_0x1680('0xd')]=_[_0x1680('0xe')](config[_0x1680('0xd')],{'host':_0x1680('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1680('0xd')]));require(_0x1680('0x10'))[_0x1680('0x11')](socket);function respondWithRpcPromise(_0xcda55f,_0x4a11bc,_0x386027){return new BPromise(function(_0x5eec2c,_0x26c42d){return client[_0x1680('0x12')](_0xcda55f,_0x386027)[_0x1680('0x13')](function(_0x5ac4e8){logger[_0x1680('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4a11bc,_0x1680('0x15'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4a11bc,_0x1680('0x15'),JSON[_0x1680('0x16')](_0x5ac4e8));if(_0x5ac4e8[_0x1680('0x17')]){if(_0x5ac4e8[_0x1680('0x17')]['code']===0x1f4){logger['error'](_0x1680('0x18'),_0x4a11bc,_0x5ac4e8['error'][_0x1680('0x19')]);return _0x26c42d(_0x5ac4e8[_0x1680('0x17')][_0x1680('0x19')]);}logger[_0x1680('0x17')](_0x1680('0x18'),_0x4a11bc,_0x5ac4e8[_0x1680('0x17')][_0x1680('0x19')]);return _0x5eec2c(_0x5ac4e8[_0x1680('0x17')][_0x1680('0x19')]);}else{logger[_0x1680('0x14')](_0x1680('0x18'),_0x4a11bc,_0x1680('0x15'));_0x5eec2c(_0x5ac4e8[_0x1680('0x1a')]['message']);}})[_0x1680('0x1b')](function(_0x27d241){logger[_0x1680('0x17')](_0x1680('0x18'),_0x4a11bc,_0x27d241);_0x26c42d(_0x27d241);});});}exports[_0x1680('0x1c')]=function(_0x4ed816){var _0x27587b=this;return new Promise(function(_0x514e3a,_0x3adc26){return db[_0x1680('0x1d')][_0x1680('0x1e')](_0x4ed816[_0x1680('0x1f')],{'raw':_0x4ed816[_0x1680('0x20')]?_0x4ed816['options'][_0x1680('0x21')]===undefined?!![]:![]:!![]})[_0x1680('0x13')](function(_0x235b78){logger[_0x1680('0x14')](_0x1680('0x1c'),_0x4ed816);logger[_0x1680('0x22')](_0x1680('0x1c'),_0x4ed816,JSON[_0x1680('0x16')](_0x235b78));_0x514e3a(_0x235b78);})[_0x1680('0x1b')](function(_0x299e15){logger[_0x1680('0x17')](_0x1680('0x1c'),_0x299e15[_0x1680('0x19')],_0x4ed816);_0x3adc26(_0x27587b[_0x1680('0x17')](0x1f4,_0x299e15[_0x1680('0x19')]));});});};exports[_0x1680('0x23')]=function(_0x39688a){var _0x502166=this;return new Promise(function(_0x135739,_0x420bf1){return db['FaxMessage'][_0x1680('0x24')](_0x39688a[_0x1680('0x1f')],{'raw':_0x39688a[_0x1680('0x20')]?_0x39688a[_0x1680('0x20')][_0x1680('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39688a[_0x1680('0x20')]?_0x39688a[_0x1680('0x20')][_0x1680('0x25')]||null:null,'attributes':_0x39688a[_0x1680('0x20')]?_0x39688a['options'][_0x1680('0x26')]||null:null,'limit':_0x39688a[_0x1680('0x20')]?_0x39688a[_0x1680('0x20')][_0x1680('0x27')]||null:null})[_0x1680('0x13')](function(_0x36e9ce){logger[_0x1680('0x14')]('UpdateFaxMessage',_0x39688a);logger['debug'](_0x1680('0x23'),_0x39688a,JSON[_0x1680('0x16')](_0x36e9ce));_0x135739(_0x36e9ce);})['catch'](function(_0x49b4c3){logger[_0x1680('0x17')]('UpdateFaxMessage',_0x49b4c3[_0x1680('0x19')],_0x39688a);_0x420bf1(_0x502166['error'](0x1f4,_0x49b4c3[_0x1680('0x19')]));});});};
\ No newline at end of file