Built motion from commit 37e1ed56.|2.6.29
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
index e9dffb8..eacae44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a3=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','body','options','raw','where','limit','UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction','WhatsappInteraction','find','omit','ids','spread','AddTags','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0xa1e9cc,_0x21d997){var _0x3cbf6c=function(_0x4dd22d){while(--_0x4dd22d){_0xa1e9cc['push'](_0xa1e9cc['shift']());}};_0x3cbf6c(++_0x21d997);}(_0x79a3,0x174));var _0x379a=function(_0x15e927,_0x346938){_0x15e927=_0x15e927-0x0;var _0x331a0d=_0x79a3[_0x15e927];return _0x331a0d;};'use strict';var _=require('lodash');var util=require(_0x379a('0x0'));var moment=require(_0x379a('0x1'));var BPromise=require(_0x379a('0x2'));var rs=require(_0x379a('0x3'));var fs=require('fs');var Redis=require(_0x379a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x379a('0x5'));var logger=require(_0x379a('0x6'))(_0x379a('0x7'));var config=require('../../config/environment');var jayson=require(_0x379a('0x8'));var client=jayson[_0x379a('0x9')][_0x379a('0xa')]({'port':0x232a});config[_0x379a('0xb')]=_[_0x379a('0xc')](config[_0x379a('0xb')],{'host':_0x379a('0xd'),'port':0x18eb});var socket=require(_0x379a('0xe'))(new Redis(config[_0x379a('0xb')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x12934d,_0x5357bc,_0x15dc9a){return new BPromise(function(_0x218f34,_0x464711){return client[_0x379a('0xf')](_0x12934d,_0x15dc9a)[_0x379a('0x10')](function(_0x49f3f5){logger[_0x379a('0x11')](_0x379a('0x12'),_0x5357bc,_0x379a('0x13'));logger[_0x379a('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5357bc,_0x379a('0x13'),JSON['stringify'](_0x49f3f5));if(_0x49f3f5[_0x379a('0x15')]){if(_0x49f3f5[_0x379a('0x15')]['code']===0x1f4){logger[_0x379a('0x15')](_0x379a('0x12'),_0x5357bc,_0x49f3f5[_0x379a('0x15')]['message']);return _0x464711(_0x49f3f5[_0x379a('0x15')][_0x379a('0x16')]);}logger['error'](_0x379a('0x12'),_0x5357bc,_0x49f3f5[_0x379a('0x15')][_0x379a('0x16')]);return _0x218f34(_0x49f3f5['error'][_0x379a('0x16')]);}else{logger[_0x379a('0x11')](_0x379a('0x12'),_0x5357bc,_0x379a('0x13'));_0x218f34(_0x49f3f5[_0x379a('0x17')][_0x379a('0x16')]);}})['catch'](function(_0x5785b){logger[_0x379a('0x15')](_0x379a('0x12'),_0x5357bc,_0x5785b);_0x464711(_0x5785b);});});}exports['UpdateWhatsappInteraction']=function(_0x3f0053){var _0x20b1ae=this;return new Promise(function(_0x449437,_0x532ea2){return db['WhatsappInteraction']['update'](_0x3f0053[_0x379a('0x18')],{'raw':_0x3f0053[_0x379a('0x19')]?_0x3f0053[_0x379a('0x19')][_0x379a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f0053['options']?_0x3f0053[_0x379a('0x19')][_0x379a('0x1b')]||null:null,'attributes':_0x3f0053[_0x379a('0x19')]?_0x3f0053['options']['attributes']||null:null,'limit':_0x3f0053[_0x379a('0x19')]?_0x3f0053['options'][_0x379a('0x1c')]||null:null})['then'](function(_0x58210a){logger[_0x379a('0x11')]('UpdateWhatsappInteraction',_0x3f0053);logger['debug'](_0x379a('0x1d'),_0x3f0053,JSON[_0x379a('0x1e')](_0x58210a));_0x449437(_0x58210a);})['catch'](function(_0x47afea){logger[_0x379a('0x15')](_0x379a('0x1d'),_0x47afea['message'],_0x3f0053);_0x532ea2(_0x20b1ae[_0x379a('0x15')](0x1f4,_0x47afea['message']));});});};exports[_0x379a('0x1f')]=function(_0x5bb103){return new Promise(function(_0x22f125,_0x3e6118){return db[_0x379a('0x20')][_0x379a('0x21')]({'where':_0x5bb103['options']?_0x5bb103[_0x379a('0x19')][_0x379a('0x1b')]||null:null})[_0x379a('0x10')](function(_0x5afe4c){if(_0x5afe4c){return _0x5afe4c['addTags'](_0x5bb103[_0x379a('0x18')]['ids'],_[_0x379a('0x22')](_0x5bb103[_0x379a('0x18')],[_0x379a('0x23'),'id'])||{});}})[_0x379a('0x24')](function(_0x4a705f){logger[_0x379a('0x11')](_0x379a('0x25'),_0x5bb103);logger[_0x379a('0x14')](_0x379a('0x25'),_0x5bb103,JSON['stringify'](_0x4a705f));_0x22f125(_0x4a705f);})[_0x379a('0x26')](function(_0x3c9434){logger['error']('AddTags',_0x3c9434['message'],_0x5bb103);_0x3e6118(_this[_0x379a('0x15')](0x1f4,_0x3c9434[_0x379a('0x16')]));});});};
\ No newline at end of file
+var _0x866e=['body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','then','addTags'];(function(_0x2780c8,_0x26bc97){var _0x42a269=function(_0x4463d0){while(--_0x4463d0){_0x2780c8['push'](_0x2780c8['shift']());}};_0x42a269(++_0x26bc97);}(_0x866e,0x19a));var _0xe866=function(_0x2834f6,_0x51408c){_0x2834f6=_0x2834f6-0x0;var _0x230b80=_0x866e[_0x2834f6];return _0x230b80;};'use strict';var _=require(_0xe866('0x0'));var util=require(_0xe866('0x1'));var moment=require(_0xe866('0x2'));var BPromise=require(_0xe866('0x3'));var rs=require(_0xe866('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe866('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe866('0x6'))(_0xe866('0x7'));var config=require(_0xe866('0x8'));var jayson=require(_0xe866('0x9'));var client=jayson[_0xe866('0xa')][_0xe866('0xb')]({'port':0x232a});config['redis']=_[_0xe866('0xc')](config[_0xe866('0xd')],{'host':_0xe866('0xe'),'port':0x18eb});var socket=require(_0xe866('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4c1b3f,_0x462d67,_0xf8766b){return new BPromise(function(_0x2b7e78,_0x4f8c77){return client[_0xe866('0x10')](_0x4c1b3f,_0xf8766b)['then'](function(_0x3377dd){logger[_0xe866('0x11')](_0xe866('0x12'),_0x462d67,'request\x20sent');logger[_0xe866('0x13')](_0xe866('0x14'),_0x462d67,_0xe866('0x15'),JSON[_0xe866('0x16')](_0x3377dd));if(_0x3377dd[_0xe866('0x17')]){if(_0x3377dd['error'][_0xe866('0x18')]===0x1f4){logger[_0xe866('0x17')](_0xe866('0x12'),_0x462d67,_0x3377dd[_0xe866('0x17')][_0xe866('0x19')]);return _0x4f8c77(_0x3377dd['error'][_0xe866('0x19')]);}logger[_0xe866('0x17')](_0xe866('0x12'),_0x462d67,_0x3377dd['error'][_0xe866('0x19')]);return _0x2b7e78(_0x3377dd['error'][_0xe866('0x19')]);}else{logger[_0xe866('0x11')](_0xe866('0x12'),_0x462d67,_0xe866('0x15'));_0x2b7e78(_0x3377dd[_0xe866('0x1a')][_0xe866('0x19')]);}})[_0xe866('0x1b')](function(_0x3ad74d){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x462d67,_0x3ad74d);_0x4f8c77(_0x3ad74d);});});}exports[_0xe866('0x1c')]=function(_0xe0e4f1){var _0x18729f=this;return new Promise(function(_0x2b49c7,_0x50aa87){return db[_0xe866('0x1d')][_0xe866('0x1e')](_0xe0e4f1['body'],{'raw':_0xe0e4f1[_0xe866('0x1f')]?_0xe0e4f1[_0xe866('0x1f')][_0xe866('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe0e4f1['options']?_0xe0e4f1[_0xe866('0x1f')][_0xe866('0x21')]||null:null,'attributes':_0xe0e4f1[_0xe866('0x1f')]?_0xe0e4f1[_0xe866('0x1f')][_0xe866('0x22')]||null:null,'limit':_0xe0e4f1[_0xe866('0x1f')]?_0xe0e4f1[_0xe866('0x1f')][_0xe866('0x23')]||null:null})['then'](function(_0x5abffc){logger[_0xe866('0x11')](_0xe866('0x1c'),_0xe0e4f1);logger[_0xe866('0x13')](_0xe866('0x1c'),_0xe0e4f1,JSON[_0xe866('0x16')](_0x5abffc));_0x2b49c7(_0x5abffc);})[_0xe866('0x1b')](function(_0x1b1f69){logger[_0xe866('0x17')](_0xe866('0x1c'),_0x1b1f69[_0xe866('0x19')],_0xe0e4f1);_0x50aa87(_0x18729f[_0xe866('0x17')](0x1f4,_0x1b1f69[_0xe866('0x19')]));});});};exports[_0xe866('0x24')]=function(_0x278f9e){return new Promise(function(_0x36d065,_0x392546){return db['WhatsappInteraction'][_0xe866('0x25')]({'where':_0x278f9e[_0xe866('0x1f')]?_0x278f9e[_0xe866('0x1f')]['where']||null:null})[_0xe866('0x26')](function(_0x5a3ecb){if(_0x5a3ecb){return _0x5a3ecb[_0xe866('0x27')](_0x278f9e[_0xe866('0x28')][_0xe866('0x29')],_[_0xe866('0x2a')](_0x278f9e[_0xe866('0x28')],[_0xe866('0x29'),'id'])||{});}})[_0xe866('0x2b')](function(_0x3a4a96){logger[_0xe866('0x11')]('AddTags',_0x278f9e);logger[_0xe866('0x13')](_0xe866('0x2c'),_0x278f9e,JSON[_0xe866('0x16')](_0x3a4a96));_0x36d065(_0x3a4a96);})[_0xe866('0x1b')](function(_0xb4be01){logger[_0xe866('0x17')](_0xe866('0x2c'),_0xb4be01[_0xe866('0x19')],_0x278f9e);_0x392546(_this[_0xe866('0x17')](0x1f4,_0xb4be01['message']));});});};
\ No newline at end of file