Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / whatsappMessage / whatsappMessage.rpc.js
index dafbb0c..f873717 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83b1=['error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4af626,_0x3d49de){var _0x231f5f=function(_0x1803ae){while(--_0x1803ae){_0x4af626['push'](_0x4af626['shift']());}};_0x231f5f(++_0x3d49de);}(_0x83b1,0xd7));var _0x183b=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x83b1[_0x28d18d];return _0x470640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x183b('0x0'));var BPromise=require(_0x183b('0x1'));var rs=require(_0x183b('0x2'));var fs=require('fs');var Redis=require(_0x183b('0x3'));var db=require(_0x183b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x183b('0x5'))(_0x183b('0x6'));var config=require(_0x183b('0x7'));var jayson=require(_0x183b('0x8'));var client=jayson[_0x183b('0x9')]['http']({'port':0x232a});config[_0x183b('0xa')]=_[_0x183b('0xb')](config[_0x183b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x183b('0xc'))(new Redis(config[_0x183b('0xa')]));require(_0x183b('0xd'))[_0x183b('0xe')](socket);function respondWithRpcPromise(_0x405f7f,_0x54171e,_0xc7b969){return new BPromise(function(_0x9d0b8d,_0x2e6764){return client[_0x183b('0xf')](_0x405f7f,_0xc7b969)[_0x183b('0x10')](function(_0x51d577){logger[_0x183b('0x11')](_0x183b('0x12'),_0x54171e,_0x183b('0x13'));logger[_0x183b('0x14')](_0x183b('0x15'),_0x54171e,_0x183b('0x13'),JSON[_0x183b('0x16')](_0x51d577));if(_0x51d577[_0x183b('0x17')]){if(_0x51d577[_0x183b('0x17')][_0x183b('0x18')]===0x1f4){logger[_0x183b('0x17')](_0x183b('0x12'),_0x54171e,_0x51d577['error'][_0x183b('0x19')]);return _0x2e6764(_0x51d577[_0x183b('0x17')][_0x183b('0x19')]);}logger[_0x183b('0x17')](_0x183b('0x12'),_0x54171e,_0x51d577[_0x183b('0x17')][_0x183b('0x19')]);return _0x9d0b8d(_0x51d577['error'][_0x183b('0x19')]);}else{logger[_0x183b('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x54171e,_0x183b('0x13'));_0x9d0b8d(_0x51d577[_0x183b('0x1a')]['message']);}})[_0x183b('0x1b')](function(_0x4f61da){logger[_0x183b('0x17')](_0x183b('0x12'),_0x54171e,_0x4f61da);_0x2e6764(_0x4f61da);});});}exports[_0x183b('0x1c')]=function(_0xf3f8d9){var _0x129ffe=this;return new Promise(function(_0x56a08b,_0x4c66e8){return db[_0x183b('0x1d')][_0x183b('0x1e')](_0xf3f8d9[_0x183b('0x1f')],{'raw':_0xf3f8d9[_0x183b('0x20')]?_0xf3f8d9[_0x183b('0x20')][_0x183b('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x446f66){logger[_0x183b('0x11')](_0x183b('0x1c'),_0xf3f8d9);logger[_0x183b('0x14')](_0x183b('0x1c'),_0xf3f8d9,JSON[_0x183b('0x16')](_0x446f66));_0x56a08b(_0x446f66);})[_0x183b('0x1b')](function(_0x13cfd5){logger[_0x183b('0x17')](_0x183b('0x1c'),_0x13cfd5['message'],_0xf3f8d9);_0x4c66e8(_0x129ffe[_0x183b('0x17')](0x1f4,_0x13cfd5[_0x183b('0x19')]));});});};
\ No newline at end of file
+var _0x08fb=['client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','options','raw','CreateWhatsappMessage','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5bd9b8,_0x554022){var _0x5ab4ca=function(_0x18dbc5){while(--_0x18dbc5){_0x5bd9b8['push'](_0x5bd9b8['shift']());}};_0x5ab4ca(++_0x554022);}(_0x08fb,0xcb));var _0xb08f=function(_0x44cbbc,_0x2a72a3){_0x44cbbc=_0x44cbbc-0x0;var _0x33de38=_0x08fb[_0x44cbbc];return _0x33de38;};'use strict';var _=require('lodash');var util=require(_0xb08f('0x0'));var moment=require(_0xb08f('0x1'));var BPromise=require(_0xb08f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb08f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb08f('0x4'))('rpc');var config=require(_0xb08f('0x5'));var jayson=require(_0xb08f('0x6'));var client=jayson[_0xb08f('0x7')][_0xb08f('0x8')]({'port':0x232a});config[_0xb08f('0x9')]=_['defaults'](config[_0xb08f('0x9')],{'host':_0xb08f('0xa'),'port':0x18eb});var socket=require(_0xb08f('0xb'))(new Redis(config[_0xb08f('0x9')]));require(_0xb08f('0xc'))[_0xb08f('0xd')](socket);function respondWithRpcPromise(_0x5c8c0d,_0x5034bd,_0x529504){return new BPromise(function(_0x2a3807,_0x195168){return client['request'](_0x5c8c0d,_0x529504)[_0xb08f('0xe')](function(_0x5bfed3){logger[_0xb08f('0xf')](_0xb08f('0x10'),_0x5034bd,_0xb08f('0x11'));logger[_0xb08f('0x12')](_0xb08f('0x13'),_0x5034bd,_0xb08f('0x11'),JSON[_0xb08f('0x14')](_0x5bfed3));if(_0x5bfed3['error']){if(_0x5bfed3[_0xb08f('0x15')][_0xb08f('0x16')]===0x1f4){logger['error'](_0xb08f('0x10'),_0x5034bd,_0x5bfed3['error'][_0xb08f('0x17')]);return _0x195168(_0x5bfed3['error'][_0xb08f('0x17')]);}logger['error'](_0xb08f('0x10'),_0x5034bd,_0x5bfed3['error'][_0xb08f('0x17')]);return _0x2a3807(_0x5bfed3[_0xb08f('0x15')][_0xb08f('0x17')]);}else{logger[_0xb08f('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x5034bd,'request\x20sent');_0x2a3807(_0x5bfed3[_0xb08f('0x18')][_0xb08f('0x17')]);}})[_0xb08f('0x19')](function(_0x2c4bf3){logger[_0xb08f('0x15')](_0xb08f('0x10'),_0x5034bd,_0x2c4bf3);_0x195168(_0x2c4bf3);});});}exports['CreateWhatsappMessage']=function(_0x487703){var _0x1ee0aa=this;return new Promise(function(_0x4e8932,_0x988072){return db[_0xb08f('0x1a')]['create'](_0x487703['body'],{'raw':_0x487703[_0xb08f('0x1b')]?_0x487703[_0xb08f('0x1b')][_0xb08f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a89cb){logger[_0xb08f('0xf')](_0xb08f('0x1d'),_0x487703);logger[_0xb08f('0x12')](_0xb08f('0x1d'),_0x487703,JSON[_0xb08f('0x14')](_0x4a89cb));_0x4e8932(_0x4a89cb);})[_0xb08f('0x19')](function(_0x3299e7){logger[_0xb08f('0x15')](_0xb08f('0x1d'),_0x3299e7[_0xb08f('0x17')],_0x487703);_0x988072(_0x1ee0aa['error'](0x1f4,_0x3299e7[_0xb08f('0x17')]));});});};
\ No newline at end of file