Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / api / whatsappInteraction / whatsappInteraction.rpc.js
1 const a955_0x5111=['error','addTags','UpdateWhatsappInteraction','../../mysqldb','limit','then','stringify','omit','update','./whatsappInteraction.socket','register','raw','options','AddTags','lodash','catch','info','body','ids','debug','where','message','WhatsappInteraction','attributes'];(function(_0x4f4694,_0x31ac7e){const _0x511140=function(_0xbf618c){while(--_0xbf618c){_0x4f4694['push'](_0x4f4694['shift']());}};_0x511140(++_0x31ac7e);}(a955_0x5111,0x172));const a955_0xbf61=function(_0x4f4694,_0x31ac7e){_0x4f4694=_0x4f4694-0xaa;let _0x511140=a955_0x5111[_0x4f4694];return _0x511140;};const a955_0x4d87f5=a955_0xbf61;'use strict';const _=require(a955_0x4d87f5(0xae)),db=require(a955_0x4d87f5(0xbb))['db'],logger=require('../../config/logger')('rpc'),{getSocket}=require('../../rediscache'),socket=getSocket();require(a955_0x4d87f5(0xc1))[a955_0x4d87f5(0xaa)](socket),exports['UpdateWhatsappInteraction']=function(_0x55aa3d){const _0x4c7def=this;return new Promise(function(_0x301119,_0x3e4e20){const _0x17eac3=a955_0xbf61;return db['WhatsappInteraction'][_0x17eac3(0xc0)](_0x55aa3d['body'],{'raw':_0x55aa3d[_0x17eac3(0xac)]?_0x55aa3d[_0x17eac3(0xac)][_0x17eac3(0xab)]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55aa3d[_0x17eac3(0xac)]?_0x55aa3d[_0x17eac3(0xac)][_0x17eac3(0xb4)]||null:null,'attributes':_0x55aa3d[_0x17eac3(0xac)]?_0x55aa3d['options'][_0x17eac3(0xb7)]||null:null,'limit':_0x55aa3d['options']?_0x55aa3d[_0x17eac3(0xac)][_0x17eac3(0xbc)]||null:null})[_0x17eac3(0xbd)](function(_0x2b7cf4){const _0x480ee0=_0x17eac3;logger[_0x480ee0(0xb0)](_0x480ee0(0xba),_0x55aa3d),logger['debug']('UpdateWhatsappInteraction',_0x55aa3d,JSON[_0x480ee0(0xbe)](_0x2b7cf4)),_0x301119(_0x2b7cf4);})[_0x17eac3(0xaf)](function(_0xeaa392){const _0x2ef089=_0x17eac3;logger['error'](_0x2ef089(0xba),_0xeaa392[_0x2ef089(0xb5)],_0x55aa3d),_0x3e4e20(_0x4c7def[_0x2ef089(0xb8)](0x1f4,_0xeaa392[_0x2ef089(0xb5)]));});});},exports['AddTagsToWhatsappInteraction']=function(_0x358b81){const _0x493e17=this;return new Promise(function(_0x324685,_0x3e390f){const _0x200df0=a955_0xbf61;return db[_0x200df0(0xb6)]['findOne']({'where':_0x358b81[_0x200df0(0xac)]?_0x358b81['options'][_0x200df0(0xb4)]||null:null})[_0x200df0(0xbd)](function(_0x1570b6){const _0x44ca23=_0x200df0;if(_0x1570b6)return _0x1570b6[_0x44ca23(0xb9)](_0x358b81[_0x44ca23(0xb1)][_0x44ca23(0xb2)],{'through':_[_0x44ca23(0xbf)](_0x358b81[_0x44ca23(0xb1)],[_0x44ca23(0xb2),'id'])});})[_0x200df0(0xbd)](function([_0x4b1f2e]){const _0x3cd169=_0x200df0;logger['info'](_0x3cd169(0xad),_0x358b81),logger[_0x3cd169(0xb3)](_0x3cd169(0xad),_0x358b81,JSON['stringify'](_0x4b1f2e)),_0x324685(_0x4b1f2e);})['catch'](function(_0x42ca78){const _0x2995e4=_0x200df0;logger[_0x2995e4(0xb8)](_0x2995e4(0xad),_0x42ca78[_0x2995e4(0xb5)],_0x358b81),_0x3e390f(_0x493e17['error'](0x1f4,_0x42ca78[_0x2995e4(0xb5)]));});});};