Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 1ef1695..b74ed0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d7f=['body','options','info','debug','update','raw','where','attributes','limit','UpdateFaxMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create'];(function(_0x20c4fe,_0x308afc){var _0x585c12=function(_0x1f7895){while(--_0x1f7895){_0x20c4fe['push'](_0x20c4fe['shift']());}};_0x585c12(++_0x308afc);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x3d7f[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xf3d7('0x0'));var util=require('util');var moment=require(_0xf3d7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3d7('0x2'));var fs=require('fs');var Redis=require(_0xf3d7('0x3'));var db=require(_0xf3d7('0x4'))['db'];var utils=require(_0xf3d7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf3d7('0x6'));var jayson=require(_0xf3d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xf3d7('0x8')]=_[_0xf3d7('0x9')](config[_0xf3d7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3d7('0xa'))(new Redis(config[_0xf3d7('0x8')]));require(_0xf3d7('0xb'))[_0xf3d7('0xc')](socket);function respondWithRpcPromise(_0x167637,_0x175766,_0x3e5a00){return new BPromise(function(_0x117cc4,_0x2b6ba2){return client[_0xf3d7('0xd')](_0x167637,_0x3e5a00)[_0xf3d7('0xe')](function(_0x56675f){logger['info'](_0xf3d7('0xf'),_0x175766,_0xf3d7('0x10'));logger['debug'](_0xf3d7('0x11'),_0x175766,_0xf3d7('0x10'),JSON[_0xf3d7('0x12')](_0x56675f));if(_0x56675f['error']){if(_0x56675f[_0xf3d7('0x13')][_0xf3d7('0x14')]===0x1f4){logger[_0xf3d7('0x13')](_0xf3d7('0xf'),_0x175766,_0x56675f[_0xf3d7('0x13')][_0xf3d7('0x15')]);return _0x2b6ba2(_0x56675f['error'][_0xf3d7('0x15')]);}logger[_0xf3d7('0x13')](_0xf3d7('0xf'),_0x175766,_0x56675f[_0xf3d7('0x13')][_0xf3d7('0x15')]);return _0x117cc4(_0x56675f[_0xf3d7('0x13')][_0xf3d7('0x15')]);}else{logger['info'](_0xf3d7('0xf'),_0x175766,_0xf3d7('0x10'));_0x117cc4(_0x56675f[_0xf3d7('0x16')][_0xf3d7('0x15')]);}})[_0xf3d7('0x17')](function(_0x1472d9){logger['error'](_0xf3d7('0xf'),_0x175766,_0x1472d9);_0x2b6ba2(_0x1472d9);});});}exports[_0xf3d7('0x18')]=function(_0x3b3eb9){var _0x88bf35=this;return new Promise(function(_0x1566f7,_0x43df6a){return db[_0xf3d7('0x19')][_0xf3d7('0x1a')](_0x3b3eb9[_0xf3d7('0x1b')],{'raw':_0x3b3eb9[_0xf3d7('0x1c')]?_0x3b3eb9[_0xf3d7('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf3d7('0xe')](function(_0x1c2a31){logger[_0xf3d7('0x1d')](_0xf3d7('0x18'),_0x3b3eb9);logger[_0xf3d7('0x1e')](_0xf3d7('0x18'),_0x3b3eb9,JSON['stringify'](_0x1c2a31));_0x1566f7(_0x1c2a31);})[_0xf3d7('0x17')](function(_0x6043a4){logger[_0xf3d7('0x13')](_0xf3d7('0x18'),_0x6043a4[_0xf3d7('0x15')],_0x3b3eb9);_0x43df6a(_0x88bf35[_0xf3d7('0x13')](0x1f4,_0x6043a4[_0xf3d7('0x15')]));});});};exports['UpdateFaxMessage']=function(_0x3ca4d9){var _0x2a39d6=this;return new Promise(function(_0x968040,_0x4db9d4){return db['FaxMessage'][_0xf3d7('0x1f')](_0x3ca4d9['body'],{'raw':_0x3ca4d9[_0xf3d7('0x1c')]?_0x3ca4d9['options'][_0xf3d7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ca4d9[_0xf3d7('0x1c')]?_0x3ca4d9['options'][_0xf3d7('0x21')]||null:null,'attributes':_0x3ca4d9[_0xf3d7('0x1c')]?_0x3ca4d9[_0xf3d7('0x1c')][_0xf3d7('0x22')]||null:null,'limit':_0x3ca4d9[_0xf3d7('0x1c')]?_0x3ca4d9[_0xf3d7('0x1c')][_0xf3d7('0x23')]||null:null})[_0xf3d7('0xe')](function(_0x2b2ed2){logger[_0xf3d7('0x1d')](_0xf3d7('0x24'),_0x3ca4d9);logger[_0xf3d7('0x1e')](_0xf3d7('0x24'),_0x3ca4d9,JSON[_0xf3d7('0x12')](_0x2b2ed2));_0x968040(_0x2b2ed2);})[_0xf3d7('0x17')](function(_0x34ba58){logger[_0xf3d7('0x13')](_0xf3d7('0x24'),_0x34ba58[_0xf3d7('0x15')],_0x3ca4d9);_0x4db9d4(_0x2a39d6[_0xf3d7('0x13')](0x1f4,_0x34ba58['message']));});});};
\ No newline at end of file
+var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1e141b,_0x2f99bd){var _0x45be52=function(_0x4ffcd5){while(--_0x4ffcd5){_0x1e141b['push'](_0x1e141b['shift']());}};_0x45be52(++_0x2f99bd);}(_0xd2ea,0x15f));var _0xad2e=function(_0x19dc78,_0x1e4ecb){_0x19dc78=_0x19dc78-0x0;var _0xb3f1cf=_0xd2ea[_0x19dc78];return _0xb3f1cf;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});};
\ No newline at end of file