Built motion from commit be44e1e4d16f8b29d243415b03d27262d8601e0e. Version 3.0.0...
[motion-next.git] / server / api / smsInteraction / smsInteraction.rpc.js
1 const a556_0x5ea6=['AddTags','debug','update','message','../../config/logger','../../rediscache','where','info','ids','limit','rpc','UpdateSmsInteraction','error','body','raw','stringify','../../mysqldb','lodash','options','catch','SmsInteraction','findOne','omit'];(function(_0x2db192,_0x5ea6ee){const _0x274388=function(_0x2a767d){while(--_0x2a767d){_0x2db192['push'](_0x2db192['shift']());}};_0x274388(++_0x5ea6ee);}(a556_0x5ea6,0x7c));const a556_0x2743=function(_0x2db192,_0x5ea6ee){_0x2db192=_0x2db192-0x0;let _0x274388=a556_0x5ea6[_0x2db192];return _0x274388;};const _0x4754f5=a556_0x2743;'use strict';const _=require(_0x4754f5('0x8')),db=require(_0x4754f5('0x7'))['db'],logger=require(_0x4754f5('0x12'))(_0x4754f5('0x1')),{getSocket}=require(_0x4754f5('0x13')),socket=getSocket();require('./smsInteraction.socket')['register'](socket),exports['UpdateSmsInteraction']=function(_0x2a767d){const _0x471f42=this;return new Promise(function(_0x4fe2f6,_0x50305b){const _0x2fdc2e=a556_0x2743;return db[_0x2fdc2e('0xb')][_0x2fdc2e('0x10')](_0x2a767d[_0x2fdc2e('0x4')],{'raw':_0x2a767d[_0x2fdc2e('0x9')]?_0x2a767d[_0x2fdc2e('0x9')][_0x2fdc2e('0x5')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a767d[_0x2fdc2e('0x9')]?_0x2a767d['options'][_0x2fdc2e('0x14')]||null:null,'attributes':_0x2a767d[_0x2fdc2e('0x9')]?_0x2a767d[_0x2fdc2e('0x9')]['attributes']||null:null,'limit':_0x2a767d[_0x2fdc2e('0x9')]?_0x2a767d[_0x2fdc2e('0x9')][_0x2fdc2e('0x0')]||null:null})['then'](function(_0x44486e){const _0x49e92a=_0x2fdc2e;logger[_0x49e92a('0x15')](_0x49e92a('0x2'),_0x2a767d),logger[_0x49e92a('0xf')](_0x49e92a('0x2'),_0x2a767d,JSON[_0x49e92a('0x6')](_0x44486e)),_0x4fe2f6(_0x44486e);})[_0x2fdc2e('0xa')](function(_0x121df3){const _0x3e24cd=_0x2fdc2e;logger['error'](_0x3e24cd('0x2'),_0x121df3[_0x3e24cd('0x11')],_0x2a767d),_0x50305b(_0x471f42[_0x3e24cd('0x3')](0x1f4,_0x121df3[_0x3e24cd('0x11')]));});});},exports['AddTagsToSmsInteraction']=function(_0x398115){const _0x401bb1=this;return new Promise(function(_0x58bcbd,_0x32b655){const _0x35c589=a556_0x2743;return db[_0x35c589('0xb')][_0x35c589('0xc')]({'where':_0x398115['options']?_0x398115[_0x35c589('0x9')]['where']||null:null})['then'](function(_0x2134aa){const _0x362f47=_0x35c589;if(_0x2134aa)return _0x2134aa['addTags'](_0x398115['body'][_0x362f47('0x16')],{'through':_[_0x362f47('0xd')](_0x398115[_0x362f47('0x4')],[_0x362f47('0x16'),'id'])});})['then'](function([_0xae7297]){const _0x769aee=_0x35c589;logger['info'](_0x769aee('0xe'),_0x398115),logger['debug'](_0x769aee('0xe'),_0x398115,JSON[_0x769aee('0x6')](_0xae7297)),_0x58bcbd(_0xae7297);})['catch'](function(_0x2843b4){const _0x6855bf=_0x35c589;logger[_0x6855bf('0x3')](_0x6855bf('0xe'),_0x2843b4[_0x6855bf('0x11')],_0x398115),_0x32b655(_0x401bb1[_0x6855bf('0x3')](0x1f4,_0x2843b4['message']));});});};