Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
index 4689303..e9f6ba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x114e=['UpdateWhatsappInteraction','update','options','raw','attributes','limit','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','body','ids','omit','spread','AddTags','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x114e,0x1d3));var _0xe114=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x114e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe114('0x0'));var moment=require(_0xe114('0x1'));var BPromise=require(_0xe114('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe114('0x3'));var db=require(_0xe114('0x4'))['db'];var utils=require(_0xe114('0x5'));var logger=require(_0xe114('0x6'))(_0xe114('0x7'));var config=require(_0xe114('0x8'));var jayson=require(_0xe114('0x9'));var client=jayson[_0xe114('0xa')][_0xe114('0xb')]({'port':0x232a});config[_0xe114('0xc')]=_[_0xe114('0xd')](config['redis'],{'host':_0xe114('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe114('0xc')]));require(_0xe114('0xf'))[_0xe114('0x10')](socket);function respondWithRpcPromise(_0x5da164,_0x1fee59,_0x3b3a68){return new BPromise(function(_0xb727e0,_0x451816){return client[_0xe114('0x11')](_0x5da164,_0x3b3a68)[_0xe114('0x12')](function(_0x1461d5){logger[_0xe114('0x13')](_0xe114('0x14'),_0x1fee59,_0xe114('0x15'));logger['debug'](_0xe114('0x16'),_0x1fee59,_0xe114('0x15'),JSON[_0xe114('0x17')](_0x1461d5));if(_0x1461d5[_0xe114('0x18')]){if(_0x1461d5[_0xe114('0x18')][_0xe114('0x19')]===0x1f4){logger[_0xe114('0x18')](_0xe114('0x14'),_0x1fee59,_0x1461d5[_0xe114('0x18')]['message']);return _0x451816(_0x1461d5[_0xe114('0x18')][_0xe114('0x1a')]);}logger[_0xe114('0x18')](_0xe114('0x14'),_0x1fee59,_0x1461d5[_0xe114('0x18')]['message']);return _0xb727e0(_0x1461d5['error']['message']);}else{logger['info'](_0xe114('0x14'),_0x1fee59,_0xe114('0x15'));_0xb727e0(_0x1461d5[_0xe114('0x1b')][_0xe114('0x1a')]);}})['catch'](function(_0x2ccb1a){logger[_0xe114('0x18')](_0xe114('0x14'),_0x1fee59,_0x2ccb1a);_0x451816(_0x2ccb1a);});});}exports[_0xe114('0x1c')]=function(_0x8ea9bf){var _0x6dcfb9=this;return new Promise(function(_0x22a0b0,_0x21e4c7){return db['WhatsappInteraction'][_0xe114('0x1d')](_0x8ea9bf['body'],{'raw':_0x8ea9bf[_0xe114('0x1e')]?_0x8ea9bf[_0xe114('0x1e')][_0xe114('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ea9bf[_0xe114('0x1e')]?_0x8ea9bf[_0xe114('0x1e')]['where']||null:null,'attributes':_0x8ea9bf[_0xe114('0x1e')]?_0x8ea9bf[_0xe114('0x1e')][_0xe114('0x20')]||null:null,'limit':_0x8ea9bf[_0xe114('0x1e')]?_0x8ea9bf[_0xe114('0x1e')][_0xe114('0x21')]||null:null})['then'](function(_0x2d547a){logger[_0xe114('0x13')](_0xe114('0x1c'),_0x8ea9bf);logger['debug'](_0xe114('0x1c'),_0x8ea9bf,JSON[_0xe114('0x17')](_0x2d547a));_0x22a0b0(_0x2d547a);})[_0xe114('0x22')](function(_0x2de61a){logger[_0xe114('0x18')](_0xe114('0x1c'),_0x2de61a[_0xe114('0x1a')],_0x8ea9bf);_0x21e4c7(_0x6dcfb9['error'](0x1f4,_0x2de61a[_0xe114('0x1a')]));});});};exports[_0xe114('0x23')]=function(_0x43f7f9){return new Promise(function(_0x202609,_0x3c7708){return db[_0xe114('0x24')][_0xe114('0x25')]({'where':_0x43f7f9[_0xe114('0x1e')]?_0x43f7f9[_0xe114('0x1e')][_0xe114('0x26')]||null:null})[_0xe114('0x12')](function(_0x52e58e){if(_0x52e58e){return _0x52e58e['addTags'](_0x43f7f9[_0xe114('0x27')][_0xe114('0x28')],_[_0xe114('0x29')](_0x43f7f9['body'],[_0xe114('0x28'),'id'])||{});}})[_0xe114('0x2a')](function(_0x1d214b){logger[_0xe114('0x13')](_0xe114('0x2b'),_0x43f7f9);logger[_0xe114('0x2c')](_0xe114('0x2b'),_0x43f7f9,JSON['stringify'](_0x1d214b));_0x202609(_0x1d214b);})[_0xe114('0x22')](function(_0x2c1661){logger['error']('AddTags',_0x2c1661['message'],_0x43f7f9);_0x3c7708(_this['error'](0x1f4,_0x2c1661[_0xe114('0x1a')]));});});};
\ No newline at end of file
+var _0xbc88=['UpdateWhatsappInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','WhatsappInteraction','update','body','options','raw','limit'];(function(_0x5bac6b,_0xa74138){var _0xcb3a86=function(_0x37706){while(--_0x37706){_0x5bac6b['push'](_0x5bac6b['shift']());}};_0xcb3a86(++_0xa74138);}(_0xbc88,0x104));var _0x8bc8=function(_0x18cfcf,_0x283dad){_0x18cfcf=_0x18cfcf-0x0;var _0x7f37f9=_0xbc88[_0x18cfcf];return _0x7f37f9;};'use strict';var _=require('lodash');var util=require(_0x8bc8('0x0'));var moment=require(_0x8bc8('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bc8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bc8('0x3'))['db'];var utils=require(_0x8bc8('0x4'));var logger=require(_0x8bc8('0x5'))(_0x8bc8('0x6'));var config=require(_0x8bc8('0x7'));var jayson=require(_0x8bc8('0x8'));var client=jayson[_0x8bc8('0x9')][_0x8bc8('0xa')]({'port':0x232a});config['redis']=_[_0x8bc8('0xb')](config[_0x8bc8('0xc')],{'host':_0x8bc8('0xd'),'port':0x18eb});var socket=require(_0x8bc8('0xe'))(new Redis(config[_0x8bc8('0xc')]));require(_0x8bc8('0xf'))[_0x8bc8('0x10')](socket);function respondWithRpcPromise(_0xe5851c,_0xb16796,_0x47d258){return new BPromise(function(_0x228e40,_0x53beb1){return client[_0x8bc8('0x11')](_0xe5851c,_0x47d258)[_0x8bc8('0x12')](function(_0x1ca44b){logger[_0x8bc8('0x13')](_0x8bc8('0x14'),_0xb16796,_0x8bc8('0x15'));logger[_0x8bc8('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xb16796,'request\x20sent',JSON[_0x8bc8('0x17')](_0x1ca44b));if(_0x1ca44b[_0x8bc8('0x18')]){if(_0x1ca44b['error']['code']===0x1f4){logger[_0x8bc8('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0xb16796,_0x1ca44b[_0x8bc8('0x18')]['message']);return _0x53beb1(_0x1ca44b[_0x8bc8('0x18')]['message']);}logger['error'](_0x8bc8('0x14'),_0xb16796,_0x1ca44b[_0x8bc8('0x18')][_0x8bc8('0x19')]);return _0x228e40(_0x1ca44b[_0x8bc8('0x18')][_0x8bc8('0x19')]);}else{logger[_0x8bc8('0x13')](_0x8bc8('0x14'),_0xb16796,_0x8bc8('0x15'));_0x228e40(_0x1ca44b[_0x8bc8('0x1a')][_0x8bc8('0x19')]);}})[_0x8bc8('0x1b')](function(_0x3e9a72){logger['error'](_0x8bc8('0x14'),_0xb16796,_0x3e9a72);_0x53beb1(_0x3e9a72);});});}exports['UpdateWhatsappInteraction']=function(_0x1b5f1a){var _0x955581=this;return new Promise(function(_0x4857d8,_0x17947d){return db[_0x8bc8('0x1c')][_0x8bc8('0x1d')](_0x1b5f1a[_0x8bc8('0x1e')],{'raw':_0x1b5f1a[_0x8bc8('0x1f')]?_0x1b5f1a[_0x8bc8('0x1f')][_0x8bc8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5f1a[_0x8bc8('0x1f')]?_0x1b5f1a[_0x8bc8('0x1f')]['where']||null:null,'attributes':_0x1b5f1a[_0x8bc8('0x1f')]?_0x1b5f1a['options']['attributes']||null:null,'limit':_0x1b5f1a[_0x8bc8('0x1f')]?_0x1b5f1a['options'][_0x8bc8('0x21')]||null:null})[_0x8bc8('0x12')](function(_0x425524){logger[_0x8bc8('0x13')](_0x8bc8('0x22'),_0x1b5f1a);logger['debug'](_0x8bc8('0x22'),_0x1b5f1a,JSON[_0x8bc8('0x17')](_0x425524));_0x4857d8(_0x425524);})[_0x8bc8('0x1b')](function(_0x26546f){logger[_0x8bc8('0x18')](_0x8bc8('0x22'),_0x26546f['message'],_0x1b5f1a);_0x17947d(_0x955581['error'](0x1f4,_0x26546f[_0x8bc8('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1d6cb3){return new Promise(function(_0x483acc,_0xadb4f8){return db[_0x8bc8('0x1c')][_0x8bc8('0x23')]({'where':_0x1d6cb3[_0x8bc8('0x1f')]?_0x1d6cb3[_0x8bc8('0x1f')][_0x8bc8('0x24')]||null:null})[_0x8bc8('0x12')](function(_0x42565b){if(_0x42565b){return _0x42565b[_0x8bc8('0x25')](_0x1d6cb3[_0x8bc8('0x1e')][_0x8bc8('0x26')],_[_0x8bc8('0x27')](_0x1d6cb3[_0x8bc8('0x1e')],['ids','id'])||{});}})[_0x8bc8('0x28')](function(_0x4c9cc2){logger[_0x8bc8('0x13')](_0x8bc8('0x29'),_0x1d6cb3);logger[_0x8bc8('0x16')]('AddTags',_0x1d6cb3,JSON[_0x8bc8('0x17')](_0x4c9cc2));_0x483acc(_0x4c9cc2);})[_0x8bc8('0x1b')](function(_0x201326){logger[_0x8bc8('0x18')]('AddTags',_0x201326[_0x8bc8('0x19')],_0x1d6cb3);_0xadb4f8(_this[_0x8bc8('0x18')](0x1f4,_0x201326[_0x8bc8('0x19')]));});});};
\ No newline at end of file