Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / whatsappMessage / whatsappMessage.rpc.js
index c5ab9f3..f22fcfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa66f=['create','body','options','raw','CreateWhatsappMessage','debug','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','WhatsappMessage'];(function(_0x252699,_0x134b4e){var _0x56d0c6=function(_0x5551a8){while(--_0x5551a8){_0x252699['push'](_0x252699['shift']());}};_0x56d0c6(++_0x134b4e);}(_0xa66f,0xd4));var _0xfa66=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0xa66f[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0xfa66('0x0'));var util=require(_0xfa66('0x1'));var moment=require('moment');var BPromise=require(_0xfa66('0x2'));var rs=require(_0xfa66('0x3'));var fs=require('fs');var Redis=require(_0xfa66('0x4'));var db=require(_0xfa66('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa66('0x6'))(_0xfa66('0x7'));var config=require(_0xfa66('0x8'));var jayson=require(_0xfa66('0x9'));var client=jayson[_0xfa66('0xa')][_0xfa66('0xb')]({'port':0x232a});config[_0xfa66('0xc')]=_[_0xfa66('0xd')](config[_0xfa66('0xc')],{'host':_0xfa66('0xe'),'port':0x18eb});var socket=require(_0xfa66('0xf'))(new Redis(config[_0xfa66('0xc')]));require('./whatsappMessage.socket')[_0xfa66('0x10')](socket);function respondWithRpcPromise(_0x2c3d4e,_0x24098c,_0x3cc3bd){return new BPromise(function(_0x3c424a,_0x3263bc){return client['request'](_0x2c3d4e,_0x3cc3bd)[_0xfa66('0x11')](function(_0x59e288){logger[_0xfa66('0x12')](_0xfa66('0x13'),_0x24098c,'request\x20sent');logger['debug'](_0xfa66('0x14'),_0x24098c,_0xfa66('0x15'),JSON['stringify'](_0x59e288));if(_0x59e288[_0xfa66('0x16')]){if(_0x59e288[_0xfa66('0x16')]['code']===0x1f4){logger[_0xfa66('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x24098c,_0x59e288['error'][_0xfa66('0x17')]);return _0x3263bc(_0x59e288['error'][_0xfa66('0x17')]);}logger[_0xfa66('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x24098c,_0x59e288[_0xfa66('0x16')]['message']);return _0x3c424a(_0x59e288[_0xfa66('0x16')][_0xfa66('0x17')]);}else{logger[_0xfa66('0x12')](_0xfa66('0x13'),_0x24098c,'request\x20sent');_0x3c424a(_0x59e288[_0xfa66('0x18')]['message']);}})['catch'](function(_0x5c8edf){logger[_0xfa66('0x16')](_0xfa66('0x13'),_0x24098c,_0x5c8edf);_0x3263bc(_0x5c8edf);});});}exports['CreateWhatsappMessage']=function(_0x57a066){var _0x53e495=this;return new Promise(function(_0x15c449,_0xdc5c01){return db[_0xfa66('0x19')][_0xfa66('0x1a')](_0x57a066[_0xfa66('0x1b')],{'raw':_0x57a066[_0xfa66('0x1c')]?_0x57a066[_0xfa66('0x1c')][_0xfa66('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4293c9){logger[_0xfa66('0x12')](_0xfa66('0x1e'),_0x57a066);logger[_0xfa66('0x1f')](_0xfa66('0x1e'),_0x57a066,JSON[_0xfa66('0x20')](_0x4293c9));_0x15c449(_0x4293c9);})[_0xfa66('0x21')](function(_0x22d718){logger[_0xfa66('0x16')](_0xfa66('0x1e'),_0x22d718[_0xfa66('0x17')],_0x57a066);_0xdc5c01(_0x53e495[_0xfa66('0x16')](0x1f4,_0x22d718[_0xfa66('0x17')]));});});};
\ No newline at end of file
+var _0x6684=['options','raw','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','WhatsappMessage','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6684,0x190));var _0x4668=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x6684[_0x270a54];return _0x4d07d0;};'use strict';var _=require(_0x4668('0x0'));var util=require(_0x4668('0x1'));var moment=require(_0x4668('0x2'));var BPromise=require(_0x4668('0x3'));var rs=require(_0x4668('0x4'));var fs=require('fs');var Redis=require(_0x4668('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4668('0x6'));var logger=require(_0x4668('0x7'))(_0x4668('0x8'));var config=require(_0x4668('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4668('0xa')][_0x4668('0xb')]({'port':0x232a});config[_0x4668('0xc')]=_['defaults'](config['redis'],{'host':_0x4668('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4668('0xe'))[_0x4668('0xf')](socket);function respondWithRpcPromise(_0x41272e,_0x1c6f3b,_0x568ae5){return new BPromise(function(_0x2284e0,_0x585740){return client[_0x4668('0x10')](_0x41272e,_0x568ae5)[_0x4668('0x11')](function(_0x552656){logger[_0x4668('0x12')](_0x4668('0x13'),_0x1c6f3b,_0x4668('0x14'));logger[_0x4668('0x15')](_0x4668('0x16'),_0x1c6f3b,_0x4668('0x14'),JSON[_0x4668('0x17')](_0x552656));if(_0x552656[_0x4668('0x18')]){if(_0x552656['error']['code']===0x1f4){logger[_0x4668('0x18')](_0x4668('0x13'),_0x1c6f3b,_0x552656[_0x4668('0x18')][_0x4668('0x19')]);return _0x585740(_0x552656['error'][_0x4668('0x19')]);}logger[_0x4668('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x1c6f3b,_0x552656[_0x4668('0x18')]['message']);return _0x2284e0(_0x552656[_0x4668('0x18')][_0x4668('0x19')]);}else{logger[_0x4668('0x12')](_0x4668('0x13'),_0x1c6f3b,_0x4668('0x14'));_0x2284e0(_0x552656[_0x4668('0x1a')][_0x4668('0x19')]);}})['catch'](function(_0x455a0f){logger[_0x4668('0x18')](_0x4668('0x13'),_0x1c6f3b,_0x455a0f);_0x585740(_0x455a0f);});});}exports['CreateWhatsappMessage']=function(_0x27b705){var _0x27c859=this;return new Promise(function(_0x45f249,_0x346658){return db[_0x4668('0x1b')][_0x4668('0x1c')](_0x27b705['body'],{'raw':_0x27b705[_0x4668('0x1d')]?_0x27b705[_0x4668('0x1d')][_0x4668('0x1e')]===undefined?!![]:![]:!![]})[_0x4668('0x11')](function(_0x5d4bd2){logger['info'](_0x4668('0x1f'),_0x27b705);logger[_0x4668('0x15')](_0x4668('0x1f'),_0x27b705,JSON[_0x4668('0x17')](_0x5d4bd2));_0x45f249(_0x5d4bd2);})[_0x4668('0x20')](function(_0x4bad50){logger[_0x4668('0x18')](_0x4668('0x1f'),_0x4bad50[_0x4668('0x19')],_0x27b705);_0x346658(_0x27c859[_0x4668('0x18')](0x1f4,_0x4bad50[_0x4668('0x19')]));});});};
\ No newline at end of file