05ee52a9fb7c80b7ea84953146cb6c0569e4cd34
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
1 const a483_0x520b=['OpenchannelInteraction','stringify','then','info','UpdateOpenchannelInteraction','limit','catch','rpc','message','addTags','lodash','options','body','error','omit','AddTagsToOpenchannelInteraction','register','debug','../../mysqldb','where','AddTags','../../rediscache','ids','findOne'];(function(_0x67f39b,_0x520b70){const _0x56c75c=function(_0x4785e5){while(--_0x4785e5){_0x67f39b['push'](_0x67f39b['shift']());}};_0x56c75c(++_0x520b70);}(a483_0x520b,0x99));const a483_0x56c7=function(_0x67f39b,_0x520b70){_0x67f39b=_0x67f39b-0x0;let _0x56c75c=a483_0x520b[_0x67f39b];return _0x56c75c;};const _0x5d9944=a483_0x56c7;'use strict';const _=require(_0x5d9944('0x1')),db=require(_0x5d9944('0x9'))['db'],logger=require('../../config/logger')(_0x5d9944('0x16')),{getSocket}=require(_0x5d9944('0xc')),socket=getSocket();require('./openchannelInteraction.socket')[_0x5d9944('0x7')](socket),exports['UpdateOpenchannelInteraction']=function(_0x4785e5){const _0x7369e8=this;return new Promise(function(_0x3b93f0,_0x17ccc9){const _0x53d46c=a483_0x56c7;return db[_0x53d46c('0xf')]['update'](_0x4785e5[_0x53d46c('0x3')],{'raw':_0x4785e5[_0x53d46c('0x2')]?_0x4785e5[_0x53d46c('0x2')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4785e5[_0x53d46c('0x2')]?_0x4785e5[_0x53d46c('0x2')]['where']||null:null,'attributes':_0x4785e5[_0x53d46c('0x2')]?_0x4785e5[_0x53d46c('0x2')]['attributes']||null:null,'limit':_0x4785e5[_0x53d46c('0x2')]?_0x4785e5[_0x53d46c('0x2')][_0x53d46c('0x14')]||null:null})[_0x53d46c('0x11')](function(_0x4092c7){const _0x468a17=_0x53d46c;logger['info'](_0x468a17('0x13'),_0x4785e5),logger[_0x468a17('0x8')](_0x468a17('0x13'),_0x4785e5,JSON[_0x468a17('0x10')](_0x4092c7)),_0x3b93f0(_0x4092c7);})[_0x53d46c('0x15')](function(_0x10e7fe){const _0x6125b0=_0x53d46c;logger[_0x6125b0('0x4')](_0x6125b0('0x13'),_0x10e7fe[_0x6125b0('0x17')],_0x4785e5),_0x17ccc9(_0x7369e8[_0x6125b0('0x4')](0x1f4,_0x10e7fe[_0x6125b0('0x17')]));});});},exports[_0x5d9944('0x6')]=function(_0x56a592){const _0x3b9c16=this;return new Promise(function(_0x2c3aa1,_0x423840){const _0x1efd14=a483_0x56c7;return db[_0x1efd14('0xf')][_0x1efd14('0xe')]({'where':_0x56a592[_0x1efd14('0x2')]?_0x56a592['options'][_0x1efd14('0xa')]||null:null})[_0x1efd14('0x11')](function(_0x10817f){const _0x57775d=_0x1efd14;if(_0x10817f)return _0x10817f[_0x57775d('0x0')](_0x56a592[_0x57775d('0x3')][_0x57775d('0xd')],{'through':_[_0x57775d('0x5')](_0x56a592[_0x57775d('0x3')],[_0x57775d('0xd'),'id'])});})[_0x1efd14('0x11')](function([_0x422b90]){const _0x42e84e=_0x1efd14;logger[_0x42e84e('0x12')]('AddTags',_0x56a592),logger[_0x42e84e('0x8')](_0x42e84e('0xb'),_0x56a592,JSON[_0x42e84e('0x10')](_0x422b90)),_0x2c3aa1(_0x422b90);})[_0x1efd14('0x15')](function(_0x53262f){const _0x33a5c2=_0x1efd14;logger[_0x33a5c2('0x4')]('AddTags',_0x53262f[_0x33a5c2('0x17')],_0x56a592),_0x423840(_0x3b9c16[_0x33a5c2('0x4')](0x1f4,_0x53262f['message']));});});};