Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
index e77e3dd..e3a54b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d9d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','update','options','raw','attributes','limit','UpdateWhatsappInteraction','WhatsappInteraction','where','addTags','omit','body','ids','spread','AddTags','lodash','util','moment','randomstring'];(function(_0xa5cff3,_0x16fed7){var _0x50319e=function(_0x5dbc99){while(--_0x5dbc99){_0xa5cff3['push'](_0xa5cff3['shift']());}};_0x50319e(++_0x16fed7);}(_0x0d9d,0xd3));var _0xd0d9=function(_0x16ce60,_0x29737e){_0x16ce60=_0x16ce60-0x0;var _0xe0d487=_0x0d9d[_0x16ce60];return _0xe0d487;};'use strict';var _=require(_0xd0d9('0x0'));var util=require(_0xd0d9('0x1'));var moment=require(_0xd0d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0d9('0x4'))['db'];var utils=require(_0xd0d9('0x5'));var logger=require(_0xd0d9('0x6'))(_0xd0d9('0x7'));var config=require(_0xd0d9('0x8'));var jayson=require(_0xd0d9('0x9'));var client=jayson['client'][_0xd0d9('0xa')]({'port':0x232a});config['redis']=_[_0xd0d9('0xb')](config['redis'],{'host':_0xd0d9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd0d9('0xd')]));require(_0xd0d9('0xe'))[_0xd0d9('0xf')](socket);function respondWithRpcPromise(_0x15ecb2,_0xdc0b87,_0x445b84){return new BPromise(function(_0x1baa11,_0x1c5b42){return client[_0xd0d9('0x10')](_0x15ecb2,_0x445b84)[_0xd0d9('0x11')](function(_0x457963){logger[_0xd0d9('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0xdc0b87,_0xd0d9('0x13'));logger[_0xd0d9('0x14')](_0xd0d9('0x15'),_0xdc0b87,_0xd0d9('0x13'),JSON[_0xd0d9('0x16')](_0x457963));if(_0x457963[_0xd0d9('0x17')]){if(_0x457963['error'][_0xd0d9('0x18')]===0x1f4){logger['error'](_0xd0d9('0x19'),_0xdc0b87,_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);return _0x1c5b42(_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);}logger[_0xd0d9('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0xdc0b87,_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);return _0x1baa11(_0x457963[_0xd0d9('0x17')]['message']);}else{logger['info'](_0xd0d9('0x19'),_0xdc0b87,'request\x20sent');_0x1baa11(_0x457963[_0xd0d9('0x1b')][_0xd0d9('0x1a')]);}})[_0xd0d9('0x1c')](function(_0x37d360){logger['error'](_0xd0d9('0x19'),_0xdc0b87,_0x37d360);_0x1c5b42(_0x37d360);});});}exports['UpdateWhatsappInteraction']=function(_0x8b6ac2){var _0x49f925=this;return new Promise(function(_0x1c04b0,_0x53b5de){return db['WhatsappInteraction'][_0xd0d9('0x1d')](_0x8b6ac2['body'],{'raw':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2['options'][_0xd0d9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')]['where']||null:null,'attributes':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')][_0xd0d9('0x20')]||null:null,'limit':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')][_0xd0d9('0x21')]||null:null})['then'](function(_0x5cdd30){logger[_0xd0d9('0x12')](_0xd0d9('0x22'),_0x8b6ac2);logger[_0xd0d9('0x14')](_0xd0d9('0x22'),_0x8b6ac2,JSON[_0xd0d9('0x16')](_0x5cdd30));_0x1c04b0(_0x5cdd30);})['catch'](function(_0x1962b7){logger[_0xd0d9('0x17')](_0xd0d9('0x22'),_0x1962b7[_0xd0d9('0x1a')],_0x8b6ac2);_0x53b5de(_0x49f925[_0xd0d9('0x17')](0x1f4,_0x1962b7[_0xd0d9('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x267653){return new Promise(function(_0x52c2a6,_0x162e76){return db[_0xd0d9('0x23')]['find']({'where':_0x267653['options']?_0x267653['options'][_0xd0d9('0x24')]||null:null})[_0xd0d9('0x11')](function(_0x31a160){if(_0x31a160){return _0x31a160[_0xd0d9('0x25')](_0x267653['body']['ids'],_[_0xd0d9('0x26')](_0x267653[_0xd0d9('0x27')],[_0xd0d9('0x28'),'id'])||{});}})[_0xd0d9('0x29')](function(_0x3d1e70){logger[_0xd0d9('0x12')](_0xd0d9('0x2a'),_0x267653);logger[_0xd0d9('0x14')]('AddTags',_0x267653,JSON['stringify'](_0x3d1e70));_0x52c2a6(_0x3d1e70);})[_0xd0d9('0x1c')](function(_0x5a5eff){logger[_0xd0d9('0x17')](_0xd0d9('0x2a'),_0x5a5eff[_0xd0d9('0x1a')],_0x267653);_0x162e76(_this[_0xd0d9('0x17')](0x1f4,_0x5a5eff[_0xd0d9('0x1a')]));});});};
\ No newline at end of file
+var _0x6dc5=['catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','addTags','ids','omit','spread','AddTags'];(function(_0x2ce033,_0x43fc42){var _0x5410c1=function(_0x4c4bb9){while(--_0x4c4bb9){_0x2ce033['push'](_0x2ce033['shift']());}};_0x5410c1(++_0x43fc42);}(_0x6dc5,0x1a3));var _0x56dc=function(_0x385e05,_0x5d25ca){_0x385e05=_0x385e05-0x0;var _0x10660d=_0x6dc5[_0x385e05];return _0x10660d;};'use strict';var _=require('lodash');var util=require(_0x56dc('0x0'));var moment=require(_0x56dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x56dc('0x2'));var fs=require('fs');var Redis=require(_0x56dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56dc('0x4'))(_0x56dc('0x5'));var config=require(_0x56dc('0x6'));var jayson=require(_0x56dc('0x7'));var client=jayson['client'][_0x56dc('0x8')]({'port':0x232a});config[_0x56dc('0x9')]=_[_0x56dc('0xa')](config[_0x56dc('0x9')],{'host':_0x56dc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56dc('0x9')]));require(_0x56dc('0xc'))[_0x56dc('0xd')](socket);function respondWithRpcPromise(_0x1a7bd8,_0x1d93e9,_0x56d57d){return new BPromise(function(_0x1e6739,_0x5b802f){return client['request'](_0x1a7bd8,_0x56d57d)[_0x56dc('0xe')](function(_0x7015e8){logger[_0x56dc('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,_0x56dc('0x10'));logger[_0x56dc('0x11')](_0x56dc('0x12'),_0x1d93e9,_0x56dc('0x10'),JSON[_0x56dc('0x13')](_0x7015e8));if(_0x7015e8[_0x56dc('0x14')]){if(_0x7015e8[_0x56dc('0x14')][_0x56dc('0x15')]===0x1f4){logger[_0x56dc('0x14')](_0x56dc('0x16'),_0x1d93e9,_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);return _0x5b802f(_0x7015e8[_0x56dc('0x14')]['message']);}logger[_0x56dc('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);return _0x1e6739(_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);}else{logger[_0x56dc('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,'request\x20sent');_0x1e6739(_0x7015e8[_0x56dc('0x18')]['message']);}})['catch'](function(_0x2a11cb){logger[_0x56dc('0x14')](_0x56dc('0x16'),_0x1d93e9,_0x2a11cb);_0x5b802f(_0x2a11cb);});});}exports[_0x56dc('0x19')]=function(_0x5ec0ae){var _0x25ee11=this;return new Promise(function(_0x315c25,_0x35fa98){return db[_0x56dc('0x1a')]['update'](_0x5ec0ae[_0x56dc('0x1b')],{'raw':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1e')]||null:null,'attributes':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae['options']['attributes']||null:null,'limit':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1f')]||null:null})['then'](function(_0x577d6c){logger[_0x56dc('0xf')](_0x56dc('0x19'),_0x5ec0ae);logger[_0x56dc('0x11')](_0x56dc('0x19'),_0x5ec0ae,JSON[_0x56dc('0x13')](_0x577d6c));_0x315c25(_0x577d6c);})['catch'](function(_0x447e13){logger[_0x56dc('0x14')](_0x56dc('0x19'),_0x447e13['message'],_0x5ec0ae);_0x35fa98(_0x25ee11['error'](0x1f4,_0x447e13[_0x56dc('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x10465f){return new Promise(function(_0xafa366,_0x299a95){return db[_0x56dc('0x1a')]['find']({'where':_0x10465f[_0x56dc('0x1c')]?_0x10465f['options']['where']||null:null})[_0x56dc('0xe')](function(_0x26a0cd){if(_0x26a0cd){return _0x26a0cd[_0x56dc('0x20')](_0x10465f[_0x56dc('0x1b')][_0x56dc('0x21')],_[_0x56dc('0x22')](_0x10465f[_0x56dc('0x1b')],[_0x56dc('0x21'),'id'])||{});}})[_0x56dc('0x23')](function(_0x43b173){logger[_0x56dc('0xf')](_0x56dc('0x24'),_0x10465f);logger[_0x56dc('0x11')](_0x56dc('0x24'),_0x10465f,JSON[_0x56dc('0x13')](_0x43b173));_0xafa366(_0x43b173);})[_0x56dc('0x25')](function(_0x2b8dfa){logger[_0x56dc('0x14')](_0x56dc('0x24'),_0x2b8dfa[_0x56dc('0x17')],_0x10465f);_0x299a95(_this['error'](0x1f4,_0x2b8dfa['message']));});});};
\ No newline at end of file