Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
index 4c4ac62..8e39f67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d9=['jayson/promise','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappInteraction','update','body','options','where','attributes','limit','UpdateWhatsappInteraction','catch','find','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x10ed52,_0x4dcad2){var _0x2f4623=function(_0x4fc455){while(--_0x4fc455){_0x10ed52['push'](_0x10ed52['shift']());}};_0x2f4623(++_0x4dcad2);}(_0xa8d9,0x9e));var _0x9a8d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa8d9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var moment=require(_0x9a8d('0x2'));var BPromise=require(_0x9a8d('0x3'));var rs=require(_0x9a8d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a8d('0x5'))['db'];var utils=require(_0x9a8d('0x6'));var logger=require(_0x9a8d('0x7'))(_0x9a8d('0x8'));var config=require(_0x9a8d('0x9'));var jayson=require(_0x9a8d('0xa'));var client=jayson[_0x9a8d('0xb')][_0x9a8d('0xc')]({'port':0x232a});config[_0x9a8d('0xd')]=_['defaults'](config[_0x9a8d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a8d('0xe'))(new Redis(config[_0x9a8d('0xd')]));require(_0x9a8d('0xf'))[_0x9a8d('0x10')](socket);function respondWithRpcPromise(_0x20ee36,_0x33901f,_0x57b17c){return new BPromise(function(_0x184af4,_0x27e72e){return client[_0x9a8d('0x11')](_0x20ee36,_0x57b17c)[_0x9a8d('0x12')](function(_0x46ea35){logger[_0x9a8d('0x13')](_0x9a8d('0x14'),_0x33901f,_0x9a8d('0x15'));logger[_0x9a8d('0x16')](_0x9a8d('0x17'),_0x33901f,'request\x20sent',JSON[_0x9a8d('0x18')](_0x46ea35));if(_0x46ea35[_0x9a8d('0x19')]){if(_0x46ea35['error'][_0x9a8d('0x1a')]===0x1f4){logger['error'](_0x9a8d('0x14'),_0x33901f,_0x46ea35[_0x9a8d('0x19')][_0x9a8d('0x1b')]);return _0x27e72e(_0x46ea35[_0x9a8d('0x19')][_0x9a8d('0x1b')]);}logger['error'](_0x9a8d('0x14'),_0x33901f,_0x46ea35[_0x9a8d('0x19')][_0x9a8d('0x1b')]);return _0x184af4(_0x46ea35[_0x9a8d('0x19')][_0x9a8d('0x1b')]);}else{logger[_0x9a8d('0x13')](_0x9a8d('0x14'),_0x33901f,_0x9a8d('0x15'));_0x184af4(_0x46ea35[_0x9a8d('0x1c')]['message']);}})['catch'](function(_0x16c4e7){logger['error'](_0x9a8d('0x14'),_0x33901f,_0x16c4e7);_0x27e72e(_0x16c4e7);});});}exports['UpdateWhatsappInteraction']=function(_0xb72d58){var _0x34d191=this;return new Promise(function(_0x334c77,_0x5e3cdb){return db[_0x9a8d('0x1d')][_0x9a8d('0x1e')](_0xb72d58[_0x9a8d('0x1f')],{'raw':_0xb72d58[_0x9a8d('0x20')]?_0xb72d58[_0x9a8d('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb72d58[_0x9a8d('0x20')]?_0xb72d58[_0x9a8d('0x20')][_0x9a8d('0x21')]||null:null,'attributes':_0xb72d58[_0x9a8d('0x20')]?_0xb72d58[_0x9a8d('0x20')][_0x9a8d('0x22')]||null:null,'limit':_0xb72d58[_0x9a8d('0x20')]?_0xb72d58[_0x9a8d('0x20')][_0x9a8d('0x23')]||null:null})[_0x9a8d('0x12')](function(_0x518908){logger['info'](_0x9a8d('0x24'),_0xb72d58);logger[_0x9a8d('0x16')](_0x9a8d('0x24'),_0xb72d58,JSON[_0x9a8d('0x18')](_0x518908));_0x334c77(_0x518908);})[_0x9a8d('0x25')](function(_0x858b8c){logger[_0x9a8d('0x19')](_0x9a8d('0x24'),_0x858b8c['message'],_0xb72d58);_0x5e3cdb(_0x34d191[_0x9a8d('0x19')](0x1f4,_0x858b8c[_0x9a8d('0x1b')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5e67c6){return new Promise(function(_0x5e698a,_0x3f2b31){return db[_0x9a8d('0x1d')][_0x9a8d('0x26')]({'where':_0x5e67c6[_0x9a8d('0x20')]?_0x5e67c6['options'][_0x9a8d('0x21')]||null:null})[_0x9a8d('0x12')](function(_0x41afd3){if(_0x41afd3){return _0x41afd3['addTags'](_0x5e67c6[_0x9a8d('0x1f')]['ids'],_[_0x9a8d('0x27')](_0x5e67c6[_0x9a8d('0x1f')],['ids','id'])||{});}})[_0x9a8d('0x28')](function(_0x569e67){logger[_0x9a8d('0x13')](_0x9a8d('0x29'),_0x5e67c6);logger[_0x9a8d('0x16')]('AddTags',_0x5e67c6,JSON['stringify'](_0x569e67));_0x5e698a(_0x569e67);})[_0x9a8d('0x25')](function(_0x28f4f5){logger['error'](_0x9a8d('0x29'),_0x28f4f5[_0x9a8d('0x1b')],_0x5e67c6);_0x3f2b31(_this[_0x9a8d('0x19')](0x1f4,_0x28f4f5[_0x9a8d('0x1b')]));});});};
\ No newline at end of file
+var _0x0139=['code','message','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a2164,_0x3c6203){var _0x41e116=function(_0x3fd2e7){while(--_0x3fd2e7){_0x4a2164['push'](_0x4a2164['shift']());}};_0x41e116(++_0x3c6203);}(_0x0139,0x117));var _0x9013=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0139[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9013('0x0'));var util=require(_0x9013('0x1'));var moment=require(_0x9013('0x2'));var BPromise=require('bluebird');var rs=require(_0x9013('0x3'));var fs=require('fs');var Redis=require(_0x9013('0x4'));var db=require(_0x9013('0x5'))['db'];var utils=require(_0x9013('0x6'));var logger=require(_0x9013('0x7'))(_0x9013('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9013('0x9')][_0x9013('0xa')]({'port':0x232a});config[_0x9013('0xb')]=_['defaults'](config[_0x9013('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9013('0xc'))(new Redis(config[_0x9013('0xb')]));require(_0x9013('0xd'))[_0x9013('0xe')](socket);function respondWithRpcPromise(_0x1ccb85,_0x567b11,_0x24bb65){return new BPromise(function(_0x519a8e,_0x2d9527){return client['request'](_0x1ccb85,_0x24bb65)[_0x9013('0xf')](function(_0x45fd44){logger[_0x9013('0x10')](_0x9013('0x11'),_0x567b11,_0x9013('0x12'));logger['debug'](_0x9013('0x13'),_0x567b11,_0x9013('0x12'),JSON[_0x9013('0x14')](_0x45fd44));if(_0x45fd44[_0x9013('0x15')]){if(_0x45fd44['error'][_0x9013('0x16')]===0x1f4){logger['error'](_0x9013('0x11'),_0x567b11,_0x45fd44[_0x9013('0x15')][_0x9013('0x17')]);return _0x2d9527(_0x45fd44[_0x9013('0x15')]['message']);}logger[_0x9013('0x15')](_0x9013('0x11'),_0x567b11,_0x45fd44[_0x9013('0x15')][_0x9013('0x17')]);return _0x519a8e(_0x45fd44[_0x9013('0x15')][_0x9013('0x17')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x567b11,_0x9013('0x12'));_0x519a8e(_0x45fd44[_0x9013('0x18')][_0x9013('0x17')]);}})[_0x9013('0x19')](function(_0x1cd8fd){logger[_0x9013('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x567b11,_0x1cd8fd);_0x2d9527(_0x1cd8fd);});});}exports[_0x9013('0x1a')]=function(_0x15e8c5){var _0x1dd2c4=this;return new Promise(function(_0xcada7f,_0x455281){return db['WhatsappInteraction'][_0x9013('0x1b')](_0x15e8c5[_0x9013('0x1c')],{'raw':_0x15e8c5[_0x9013('0x1d')]?_0x15e8c5[_0x9013('0x1d')][_0x9013('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15e8c5['options']?_0x15e8c5[_0x9013('0x1d')][_0x9013('0x1f')]||null:null,'attributes':_0x15e8c5['options']?_0x15e8c5['options'][_0x9013('0x20')]||null:null,'limit':_0x15e8c5['options']?_0x15e8c5[_0x9013('0x1d')][_0x9013('0x21')]||null:null})[_0x9013('0xf')](function(_0x5a7d97){logger[_0x9013('0x10')](_0x9013('0x1a'),_0x15e8c5);logger[_0x9013('0x22')](_0x9013('0x1a'),_0x15e8c5,JSON[_0x9013('0x14')](_0x5a7d97));_0xcada7f(_0x5a7d97);})[_0x9013('0x19')](function(_0x2a389c){logger['error'](_0x9013('0x1a'),_0x2a389c[_0x9013('0x17')],_0x15e8c5);_0x455281(_0x1dd2c4[_0x9013('0x15')](0x1f4,_0x2a389c[_0x9013('0x17')]));});});};exports[_0x9013('0x23')]=function(_0x41611d){return new Promise(function(_0x1adee1,_0x386d3e){return db[_0x9013('0x24')][_0x9013('0x25')]({'where':_0x41611d[_0x9013('0x1d')]?_0x41611d[_0x9013('0x1d')]['where']||null:null})['then'](function(_0x1f1707){if(_0x1f1707){return _0x1f1707[_0x9013('0x26')](_0x41611d['body'][_0x9013('0x27')],_[_0x9013('0x28')](_0x41611d[_0x9013('0x1c')],['ids','id'])||{});}})[_0x9013('0x29')](function(_0x1f68d9){logger[_0x9013('0x10')](_0x9013('0x2a'),_0x41611d);logger['debug'](_0x9013('0x2a'),_0x41611d,JSON[_0x9013('0x14')](_0x1f68d9));_0x1adee1(_0x1f68d9);})['catch'](function(_0x4bfc6f){logger[_0x9013('0x15')](_0x9013('0x2a'),_0x4bfc6f['message'],_0x41611d);_0x386d3e(_this['error'](0x1f4,_0x4bfc6f['message']));});});};
\ No newline at end of file