Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / whatsappMessage / whatsappMessage.rpc.js
index f3dd93b..02259a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40c4=['error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x16e8e3,_0x1064d5){var _0x48f8b3=function(_0x267159){while(--_0x267159){_0x16e8e3['push'](_0x16e8e3['shift']());}};_0x48f8b3(++_0x1064d5);}(_0x40c4,0x18b));var _0x440c=function(_0x4f617f,_0x28248f){_0x4f617f=_0x4f617f-0x0;var _0xe56a5a=_0x40c4[_0x4f617f];return _0xe56a5a;};'use strict';var _=require(_0x440c('0x0'));var util=require(_0x440c('0x1'));var moment=require('moment');var BPromise=require(_0x440c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x440c('0x3'));var db=require(_0x440c('0x4'))['db'];var utils=require(_0x440c('0x5'));var logger=require(_0x440c('0x6'))('rpc');var config=require(_0x440c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x440c('0x8')][_0x440c('0x9')]({'port':0x232a});config[_0x440c('0xa')]=_[_0x440c('0xb')](config[_0x440c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x440c('0xc'))(new Redis(config[_0x440c('0xa')]));require('./whatsappMessage.socket')[_0x440c('0xd')](socket);function respondWithRpcPromise(_0x2b87ac,_0x3f22d9,_0x41b286){return new BPromise(function(_0x3966a9,_0xaaee10){return client[_0x440c('0xe')](_0x2b87ac,_0x41b286)[_0x440c('0xf')](function(_0x81785){logger[_0x440c('0x10')](_0x440c('0x11'),_0x3f22d9,_0x440c('0x12'));logger[_0x440c('0x13')](_0x440c('0x14'),_0x3f22d9,_0x440c('0x12'),JSON['stringify'](_0x81785));if(_0x81785[_0x440c('0x15')]){if(_0x81785[_0x440c('0x15')][_0x440c('0x16')]===0x1f4){logger[_0x440c('0x15')](_0x440c('0x11'),_0x3f22d9,_0x81785[_0x440c('0x15')][_0x440c('0x17')]);return _0xaaee10(_0x81785[_0x440c('0x15')][_0x440c('0x17')]);}logger[_0x440c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3f22d9,_0x81785[_0x440c('0x15')][_0x440c('0x17')]);return _0x3966a9(_0x81785['error']['message']);}else{logger[_0x440c('0x10')](_0x440c('0x11'),_0x3f22d9,_0x440c('0x12'));_0x3966a9(_0x81785['result'][_0x440c('0x17')]);}})[_0x440c('0x18')](function(_0x4a50a2){logger['error'](_0x440c('0x11'),_0x3f22d9,_0x4a50a2);_0xaaee10(_0x4a50a2);});});}exports[_0x440c('0x19')]=function(_0x50e905){var _0x9978f0=this;return new Promise(function(_0x20959d,_0xc8a9c5){return db[_0x440c('0x1a')][_0x440c('0x1b')](_0x50e905[_0x440c('0x1c')],{'raw':_0x50e905[_0x440c('0x1d')]?_0x50e905[_0x440c('0x1d')][_0x440c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x240d18){logger['info'](_0x440c('0x19'),_0x50e905);logger[_0x440c('0x13')](_0x440c('0x19'),_0x50e905,JSON[_0x440c('0x1f')](_0x240d18));_0x20959d(_0x240d18);})[_0x440c('0x18')](function(_0x437cef){logger[_0x440c('0x15')](_0x440c('0x19'),_0x437cef[_0x440c('0x17')],_0x50e905);_0xc8a9c5(_0x9978f0[_0x440c('0x15')](0x1f4,_0x437cef[_0x440c('0x17')]));});});};
\ No newline at end of file
+var _0x4550=['request\x20sent','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x4550,0x16e));var _0x0455=function(_0x2657f4,_0x2e5594){_0x2657f4=_0x2657f4-0x0;var _0x370086=_0x4550[_0x2657f4];return _0x370086;};'use strict';var _=require(_0x0455('0x0'));var util=require(_0x0455('0x1'));var moment=require('moment');var BPromise=require(_0x0455('0x2'));var rs=require(_0x0455('0x3'));var fs=require('fs');var Redis=require(_0x0455('0x4'));var db=require(_0x0455('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0455('0x6'));var config=require(_0x0455('0x7'));var jayson=require(_0x0455('0x8'));var client=jayson[_0x0455('0x9')][_0x0455('0xa')]({'port':0x232a});config['redis']=_[_0x0455('0xb')](config[_0x0455('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0455('0xd'))(new Redis(config[_0x0455('0xc')]));require(_0x0455('0xe'))[_0x0455('0xf')](socket);function respondWithRpcPromise(_0x1af384,_0x4e1516,_0x1dd679){return new BPromise(function(_0x48079b,_0x53ee5c){return client[_0x0455('0x10')](_0x1af384,_0x1dd679)[_0x0455('0x11')](function(_0x4f2117){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4e1516,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4e1516,_0x0455('0x12'),JSON['stringify'](_0x4f2117));if(_0x4f2117[_0x0455('0x13')]){if(_0x4f2117[_0x0455('0x13')][_0x0455('0x14')]===0x1f4){logger[_0x0455('0x13')](_0x0455('0x15'),_0x4e1516,_0x4f2117[_0x0455('0x13')]['message']);return _0x53ee5c(_0x4f2117['error']['message']);}logger[_0x0455('0x13')](_0x0455('0x15'),_0x4e1516,_0x4f2117['error'][_0x0455('0x16')]);return _0x48079b(_0x4f2117[_0x0455('0x13')][_0x0455('0x16')]);}else{logger[_0x0455('0x17')](_0x0455('0x15'),_0x4e1516,_0x0455('0x12'));_0x48079b(_0x4f2117[_0x0455('0x18')][_0x0455('0x16')]);}})[_0x0455('0x19')](function(_0xb1444d){logger[_0x0455('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x4e1516,_0xb1444d);_0x53ee5c(_0xb1444d);});});}exports[_0x0455('0x1a')]=function(_0x2ec7e9){var _0x17dd52=this;return new Promise(function(_0x2d254b,_0x26bdaf){return db[_0x0455('0x1b')][_0x0455('0x1c')](_0x2ec7e9['body'],{'raw':_0x2ec7e9['options']?_0x2ec7e9[_0x0455('0x1d')][_0x0455('0x1e')]===undefined?!![]:![]:!![]})[_0x0455('0x11')](function(_0x26f515){logger[_0x0455('0x17')](_0x0455('0x1a'),_0x2ec7e9);logger['debug'](_0x0455('0x1a'),_0x2ec7e9,JSON[_0x0455('0x1f')](_0x26f515));_0x2d254b(_0x26f515);})[_0x0455('0x19')](function(_0x2face7){logger[_0x0455('0x13')](_0x0455('0x1a'),_0x2face7[_0x0455('0x16')],_0x2ec7e9);_0x26bdaf(_0x17dd52[_0x0455('0x13')](0x1f4,_0x2face7['message']));});});};
\ No newline at end of file