00a181d9308eb9283e2eb9036945dfe5dc9fe886
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
1 const a483_0x6d3f=['error','debug','addTags','catch','message','options','register','AddTagsToOpenchannelInteraction','ids','raw','omit','limit','AddTags','UpdateOpenchannelInteraction','../../mysqldb','../../rediscache','then','../../config/logger','info','rpc','stringify','lodash','OpenchannelInteraction','update','where','body','findOne','./openchannelInteraction.socket'];(function(_0x4f09cd,_0x6d3f26){const _0x28c491=function(_0x15a684){while(--_0x15a684){_0x4f09cd['push'](_0x4f09cd['shift']());}};_0x28c491(++_0x6d3f26);}(a483_0x6d3f,0x122));const a483_0x28c4=function(_0x4f09cd,_0x6d3f26){_0x4f09cd=_0x4f09cd-0x0;let _0x28c491=a483_0x6d3f[_0x4f09cd];return _0x28c491;};const _0x1e60d8=a483_0x28c4;'use strict';const _=require(_0x1e60d8('0xb')),db=require(_0x1e60d8('0x4'))['db'],logger=require(_0x1e60d8('0x7'))(_0x1e60d8('0x9')),{getSocket}=require(_0x1e60d8('0x5')),socket=getSocket();require(_0x1e60d8('0x11'))[_0x1e60d8('0x18')](socket),exports[_0x1e60d8('0x3')]=function(_0x15a684){const _0x27417c=this;return new Promise(function(_0x43e02a,_0x100352){const _0x5f4d22=a483_0x28c4;return db[_0x5f4d22('0xc')][_0x5f4d22('0xd')](_0x15a684[_0x5f4d22('0xf')],{'raw':_0x15a684[_0x5f4d22('0x17')]?_0x15a684['options'][_0x5f4d22('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15a684[_0x5f4d22('0x17')]?_0x15a684[_0x5f4d22('0x17')]['where']||null:null,'attributes':_0x15a684[_0x5f4d22('0x17')]?_0x15a684[_0x5f4d22('0x17')]['attributes']||null:null,'limit':_0x15a684[_0x5f4d22('0x17')]?_0x15a684[_0x5f4d22('0x17')][_0x5f4d22('0x1')]||null:null})[_0x5f4d22('0x6')](function(_0x32e737){const _0xa672c3=_0x5f4d22;logger[_0xa672c3('0x8')](_0xa672c3('0x3'),_0x15a684),logger[_0xa672c3('0x13')](_0xa672c3('0x3'),_0x15a684,JSON[_0xa672c3('0xa')](_0x32e737)),_0x43e02a(_0x32e737);})[_0x5f4d22('0x15')](function(_0x2c421e){const _0x39ca6d=_0x5f4d22;logger[_0x39ca6d('0x12')](_0x39ca6d('0x3'),_0x2c421e[_0x39ca6d('0x16')],_0x15a684),_0x100352(_0x27417c[_0x39ca6d('0x12')](0x1f4,_0x2c421e['message']));});});},exports[_0x1e60d8('0x19')]=function(_0x413e52){const _0x27182a=this;return new Promise(function(_0x127c0d,_0x4b8bf4){const _0x3fc4f8=a483_0x28c4;return db[_0x3fc4f8('0xc')][_0x3fc4f8('0x10')]({'where':_0x413e52[_0x3fc4f8('0x17')]?_0x413e52[_0x3fc4f8('0x17')][_0x3fc4f8('0xe')]||null:null})[_0x3fc4f8('0x6')](function(_0x517247){const _0x4a1e37=_0x3fc4f8;if(_0x517247)return _0x517247[_0x4a1e37('0x14')](_0x413e52[_0x4a1e37('0xf')][_0x4a1e37('0x1a')],{'through':_[_0x4a1e37('0x0')](_0x413e52[_0x4a1e37('0xf')],[_0x4a1e37('0x1a'),'id'])});})['then'](function([_0x4c7d1a]){const _0xe29119=_0x3fc4f8;logger['info'](_0xe29119('0x2'),_0x413e52),logger[_0xe29119('0x13')]('AddTags',_0x413e52,JSON[_0xe29119('0xa')](_0x4c7d1a)),_0x127c0d(_0x4c7d1a);})[_0x3fc4f8('0x15')](function(_0xeb9f3a){const _0x24cd93=_0x3fc4f8;logger[_0x24cd93('0x12')]('AddTags',_0xeb9f3a['message'],_0x413e52),_0x4b8bf4(_0x27182a[_0x24cd93('0x12')](0x1f4,_0xeb9f3a[_0x24cd93('0x16')]));});});};