Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 8f119e5..86ca895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f5=['code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','update','raw','where','attributes','limit','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2f36bc,_0x3c2cec){var _0x1af327=function(_0x718cf4){while(--_0x718cf4){_0x2f36bc['push'](_0x2f36bc['shift']());}};_0x1af327(++_0x3c2cec);}(_0x94f5,0xcf));var _0x594f=function(_0x396524,_0x144fd0){_0x396524=_0x396524-0x0;var _0x2244d2=_0x94f5[_0x396524];return _0x2244d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x594f('0x0'));var BPromise=require(_0x594f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x594f('0x2'));var db=require(_0x594f('0x3'))['db'];var utils=require(_0x594f('0x4'));var logger=require(_0x594f('0x5'))('rpc');var config=require(_0x594f('0x6'));var jayson=require(_0x594f('0x7'));var client=jayson[_0x594f('0x8')][_0x594f('0x9')]({'port':0x232a});config[_0x594f('0xa')]=_[_0x594f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x594f('0xc'))(new Redis(config[_0x594f('0xa')]));require(_0x594f('0xd'))['register'](socket);function respondWithRpcPromise(_0xc2e13a,_0x2e7d6a,_0x2095e1){return new BPromise(function(_0x210cbf,_0x211417){return client[_0x594f('0xe')](_0xc2e13a,_0x2095e1)['then'](function(_0x511548){logger[_0x594f('0xf')]('FaxMessage,\x20%s,\x20%s',_0x2e7d6a,_0x594f('0x10'));logger[_0x594f('0x11')](_0x594f('0x12'),_0x2e7d6a,_0x594f('0x10'),JSON[_0x594f('0x13')](_0x511548));if(_0x511548[_0x594f('0x14')]){if(_0x511548['error'][_0x594f('0x15')]===0x1f4){logger[_0x594f('0x14')](_0x594f('0x16'),_0x2e7d6a,_0x511548[_0x594f('0x14')]['message']);return _0x211417(_0x511548[_0x594f('0x14')][_0x594f('0x17')]);}logger[_0x594f('0x14')](_0x594f('0x16'),_0x2e7d6a,_0x511548['error'][_0x594f('0x17')]);return _0x210cbf(_0x511548[_0x594f('0x14')][_0x594f('0x17')]);}else{logger['info'](_0x594f('0x16'),_0x2e7d6a,_0x594f('0x10'));_0x210cbf(_0x511548[_0x594f('0x18')][_0x594f('0x17')]);}})[_0x594f('0x19')](function(_0x469cd9){logger[_0x594f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x2e7d6a,_0x469cd9);_0x211417(_0x469cd9);});});}exports['CreateFaxMessage']=function(_0x2d19a5){var _0x4329a5=this;return new Promise(function(_0x5c8aa8,_0x1483c3){return db[_0x594f('0x1a')][_0x594f('0x1b')](_0x2d19a5[_0x594f('0x1c')],{'raw':_0x2d19a5[_0x594f('0x1d')]?_0x2d19a5[_0x594f('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x594f('0x1e')](function(_0x13e49e){logger['info'](_0x594f('0x1f'),_0x2d19a5);logger[_0x594f('0x11')](_0x594f('0x1f'),_0x2d19a5,JSON[_0x594f('0x13')](_0x13e49e));_0x5c8aa8(_0x13e49e);})[_0x594f('0x19')](function(_0x2bc172){logger['error'](_0x594f('0x1f'),_0x2bc172['message'],_0x2d19a5);_0x1483c3(_0x4329a5['error'](0x1f4,_0x2bc172[_0x594f('0x17')]));});});};exports[_0x594f('0x20')]=function(_0x14b936){var _0xd86f5c=this;return new Promise(function(_0x120ca4,_0x13207e){return db[_0x594f('0x1a')][_0x594f('0x21')](_0x14b936['body'],{'raw':_0x14b936[_0x594f('0x1d')]?_0x14b936[_0x594f('0x1d')][_0x594f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14b936[_0x594f('0x1d')]?_0x14b936[_0x594f('0x1d')][_0x594f('0x23')]||null:null,'attributes':_0x14b936[_0x594f('0x1d')]?_0x14b936['options'][_0x594f('0x24')]||null:null,'limit':_0x14b936[_0x594f('0x1d')]?_0x14b936['options'][_0x594f('0x25')]||null:null})[_0x594f('0x1e')](function(_0x586422){logger[_0x594f('0xf')](_0x594f('0x20'),_0x14b936);logger[_0x594f('0x11')](_0x594f('0x20'),_0x14b936,JSON[_0x594f('0x13')](_0x586422));_0x120ca4(_0x586422);})[_0x594f('0x19')](function(_0x227ad2){logger[_0x594f('0x14')]('UpdateFaxMessage',_0x227ad2[_0x594f('0x17')],_0x14b936);_0x13207e(_0xd86f5c[_0x594f('0x14')](0x1f4,_0x227ad2[_0x594f('0x17')]));});});};
\ No newline at end of file
+var _0xa8a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2f976b,_0x3d9d91){_0x2f976b=_0x2f976b-0x0;var _0x55b3e7=_0xa8a8[_0x2f976b];return _0x55b3e7;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});config[_0x8a8a('0xd')]=_[_0x8a8a('0xe')](config[_0x8a8a('0xd')],{'host':_0x8a8a('0xf'),'port':0x18eb});var socket=require(_0x8a8a('0x10'))(new Redis(config[_0x8a8a('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3c01cd,_0x497b8a,_0x11788d){return new BPromise(function(_0x3d3a00,_0x532621){return client[_0x8a8a('0x11')](_0x3c01cd,_0x11788d)[_0x8a8a('0x12')](function(_0xb13fca){logger['info'](_0x8a8a('0x13'),_0x497b8a,_0x8a8a('0x14'));logger[_0x8a8a('0x15')](_0x8a8a('0x16'),_0x497b8a,'request\x20sent',JSON[_0x8a8a('0x17')](_0xb13fca));if(_0xb13fca['error']){if(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x19')]===0x1f4){logger[_0x8a8a('0x18')](_0x8a8a('0x13'),_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x532621(_0xb13fca[_0x8a8a('0x18')]['message']);}logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x3d3a00(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);}else{logger[_0x8a8a('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x8a8a('0x14'));_0x3d3a00(_0xb13fca[_0x8a8a('0x1c')][_0x8a8a('0x1a')]);}})[_0x8a8a('0x1d')](function(_0x299827){logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x299827);_0x532621(_0x299827);});});}exports['CreateFaxMessage']=function(_0x5181b2){var _0x4e3d0a=this;return new Promise(function(_0x4a6601,_0x3a9b2f){return db[_0x8a8a('0x1e')][_0x8a8a('0x1f')](_0x5181b2[_0x8a8a('0x20')],{'raw':_0x5181b2[_0x8a8a('0x21')]?_0x5181b2[_0x8a8a('0x21')][_0x8a8a('0x22')]===undefined?!![]:![]:!![]})[_0x8a8a('0x12')](function(_0x25d5d4){logger[_0x8a8a('0x1b')](_0x8a8a('0x23'),_0x5181b2);logger[_0x8a8a('0x15')](_0x8a8a('0x23'),_0x5181b2,JSON[_0x8a8a('0x17')](_0x25d5d4));_0x4a6601(_0x25d5d4);})[_0x8a8a('0x1d')](function(_0x545a38){logger[_0x8a8a('0x18')](_0x8a8a('0x23'),_0x545a38[_0x8a8a('0x1a')],_0x5181b2);_0x3a9b2f(_0x4e3d0a[_0x8a8a('0x18')](0x1f4,_0x545a38[_0x8a8a('0x1a')]));});});};exports[_0x8a8a('0x24')]=function(_0x3aa46d){var _0x5f4dcc=this;return new Promise(function(_0x31d21a,_0x38c1e0){return db[_0x8a8a('0x1e')]['update'](_0x3aa46d['body'],{'raw':_0x3aa46d[_0x8a8a('0x21')]?_0x3aa46d[_0x8a8a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa46d['options']?_0x3aa46d['options'][_0x8a8a('0x25')]||null:null,'attributes':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x26')]||null:null,'limit':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x27')]||null:null})[_0x8a8a('0x12')](function(_0x8df0cb){logger[_0x8a8a('0x1b')](_0x8a8a('0x24'),_0x3aa46d);logger[_0x8a8a('0x15')](_0x8a8a('0x24'),_0x3aa46d,JSON['stringify'](_0x8df0cb));_0x31d21a(_0x8df0cb);})['catch'](function(_0x56e79e){logger[_0x8a8a('0x18')](_0x8a8a('0x24'),_0x56e79e['message'],_0x3aa46d);_0x38c1e0(_0x5f4dcc[_0x8a8a('0x18')](0x1f4,_0x56e79e[_0x8a8a('0x1a')]));});});};
\ No newline at end of file