Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / whatsappMessage / whatsappMessage.rpc.js
index c82d048..312c929 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf05=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','moment','bluebird'];(function(_0x22ed9c,_0x2465c0){var _0x119a28=function(_0x1a9d18){while(--_0x1a9d18){_0x22ed9c['push'](_0x22ed9c['shift']());}};_0x119a28(++_0x2465c0);}(_0xdf05,0xc9));var _0x5df0=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xdf05[_0x3e6d5d];return _0x238923;};'use strict';var _=require(_0x5df0('0x0'));var util=require('util');var moment=require(_0x5df0('0x1'));var BPromise=require(_0x5df0('0x2'));var rs=require(_0x5df0('0x3'));var fs=require('fs');var Redis=require(_0x5df0('0x4'));var db=require(_0x5df0('0x5'))['db'];var utils=require(_0x5df0('0x6'));var logger=require(_0x5df0('0x7'))(_0x5df0('0x8'));var config=require(_0x5df0('0x9'));var jayson=require(_0x5df0('0xa'));var client=jayson[_0x5df0('0xb')][_0x5df0('0xc')]({'port':0x232a});config[_0x5df0('0xd')]=_[_0x5df0('0xe')](config['redis'],{'host':_0x5df0('0xf'),'port':0x18eb});var socket=require(_0x5df0('0x10'))(new Redis(config[_0x5df0('0xd')]));require(_0x5df0('0x11'))[_0x5df0('0x12')](socket);function respondWithRpcPromise(_0x54dfd2,_0x1dd78f,_0x3ea3f8){return new BPromise(function(_0x3c1de5,_0xe6e436){return client['request'](_0x54dfd2,_0x3ea3f8)[_0x5df0('0x13')](function(_0xb840e2){logger[_0x5df0('0x14')](_0x5df0('0x15'),_0x1dd78f,_0x5df0('0x16'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1dd78f,_0x5df0('0x16'),JSON[_0x5df0('0x17')](_0xb840e2));if(_0xb840e2[_0x5df0('0x18')]){if(_0xb840e2['error'][_0x5df0('0x19')]===0x1f4){logger['error'](_0x5df0('0x15'),_0x1dd78f,_0xb840e2['error'][_0x5df0('0x1a')]);return _0xe6e436(_0xb840e2[_0x5df0('0x18')][_0x5df0('0x1a')]);}logger[_0x5df0('0x18')](_0x5df0('0x15'),_0x1dd78f,_0xb840e2[_0x5df0('0x18')][_0x5df0('0x1a')]);return _0x3c1de5(_0xb840e2[_0x5df0('0x18')][_0x5df0('0x1a')]);}else{logger[_0x5df0('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x1dd78f,'request\x20sent');_0x3c1de5(_0xb840e2['result'][_0x5df0('0x1a')]);}})[_0x5df0('0x1b')](function(_0x243076){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1dd78f,_0x243076);_0xe6e436(_0x243076);});});}exports[_0x5df0('0x1c')]=function(_0x20a409){var _0x2cf120=this;return new Promise(function(_0x38b3c6,_0x46d349){return db[_0x5df0('0x1d')][_0x5df0('0x1e')](_0x20a409[_0x5df0('0x1f')],{'raw':_0x20a409['options']?_0x20a409[_0x5df0('0x20')][_0x5df0('0x21')]===undefined?!![]:![]:!![]})[_0x5df0('0x13')](function(_0x1f2ab0){logger['info'](_0x5df0('0x1c'),_0x20a409);logger['debug'](_0x5df0('0x1c'),_0x20a409,JSON[_0x5df0('0x17')](_0x1f2ab0));_0x38b3c6(_0x1f2ab0);})[_0x5df0('0x1b')](function(_0x4eb691){logger['error'](_0x5df0('0x1c'),_0x4eb691[_0x5df0('0x1a')],_0x20a409);_0x46d349(_0x2cf120['error'](0x1f4,_0x4eb691[_0x5df0('0x1a')]));});});};
\ No newline at end of file
+var _0xa38b=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','debug'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa38b,0x1e1));var _0xba38=function(_0x40429f,_0x10e210){_0x40429f=_0x40429f-0x0;var _0x3ba51d=_0xa38b[_0x40429f];return _0x3ba51d;};'use strict';var _=require('lodash');var util=require(_0xba38('0x0'));var moment=require(_0xba38('0x1'));var BPromise=require(_0xba38('0x2'));var rs=require(_0xba38('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba38('0x4'))['db'];var utils=require(_0xba38('0x5'));var logger=require(_0xba38('0x6'))(_0xba38('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xba38('0x8')]({'port':0x232a});config[_0xba38('0x9')]=_[_0xba38('0xa')](config[_0xba38('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba38('0x9')]));require(_0xba38('0xb'))[_0xba38('0xc')](socket);function respondWithRpcPromise(_0x4d26a7,_0x505986,_0xe1f244){return new BPromise(function(_0x4b9955,_0x879d44){return client[_0xba38('0xd')](_0x4d26a7,_0xe1f244)[_0xba38('0xe')](function(_0x277cf5){logger['info'](_0xba38('0xf'),_0x505986,_0xba38('0x10'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x505986,_0xba38('0x10'),JSON[_0xba38('0x11')](_0x277cf5));if(_0x277cf5[_0xba38('0x12')]){if(_0x277cf5[_0xba38('0x12')]['code']===0x1f4){logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);return _0x879d44(_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);}logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x277cf5[_0xba38('0x12')][_0xba38('0x13')]);return _0x4b9955(_0x277cf5[_0xba38('0x12')]['message']);}else{logger[_0xba38('0x14')](_0xba38('0xf'),_0x505986,_0xba38('0x10'));_0x4b9955(_0x277cf5[_0xba38('0x15')][_0xba38('0x13')]);}})['catch'](function(_0x348e87){logger[_0xba38('0x12')](_0xba38('0xf'),_0x505986,_0x348e87);_0x879d44(_0x348e87);});});}exports[_0xba38('0x16')]=function(_0x231a17){var _0x1c459e=this;return new Promise(function(_0x986b24,_0x48ce26){return db[_0xba38('0x17')][_0xba38('0x18')](_0x231a17[_0xba38('0x19')],{'raw':_0x231a17[_0xba38('0x1a')]?_0x231a17['options'][_0xba38('0x1b')]===undefined?!![]:![]:!![]})[_0xba38('0xe')](function(_0x388a54){logger[_0xba38('0x14')](_0xba38('0x16'),_0x231a17);logger[_0xba38('0x1c')](_0xba38('0x16'),_0x231a17,JSON[_0xba38('0x11')](_0x388a54));_0x986b24(_0x388a54);})[_0xba38('0x1d')](function(_0x5386c6){logger['error']('CreateWhatsappMessage',_0x5386c6['message'],_0x231a17);_0x48ce26(_0x1c459e[_0xba38('0x12')](0x1f4,_0x5386c6[_0xba38('0x13')]));});});};
\ No newline at end of file