a8a85604f56f9516d30f0b412a4ee8769b7f8f36
[motion-next.git] / server / api / voiceQueue / voiceQueue.rpc.js
1 const a756_0xa787=['include','lodash','../../mysqldb','debug','rpc','then','../../rediscache','../../config/logger','map','where','ShowVoiceQueue','catch','message','model','./voiceQueue.socket','raw','error','register','GetVoiceQueue','findAll','attributes','VoiceQueue','findOne','options','info','stringify'];(function(_0x1fdb90,_0xa78775){const _0xf401f9=function(_0x47675f){while(--_0x47675f){_0x1fdb90['push'](_0x1fdb90['shift']());}};_0xf401f9(++_0xa78775);}(a756_0xa787,0xf8));const a756_0xf401=function(_0x1fdb90,_0xa78775){_0x1fdb90=_0x1fdb90-0x0;let _0xf401f9=a756_0xa787[_0x1fdb90];return _0xf401f9;};const _0xd9e4c2=a756_0xf401;'use strict';const _=require(_0xd9e4c2('0xd')),db=require(_0xd9e4c2('0xe'))['db'],logger=require(_0xd9e4c2('0x13'))(_0xd9e4c2('0x10')),{getSocket}=require(_0xd9e4c2('0x12')),socket=getSocket();require(_0xd9e4c2('0x0'))[_0xd9e4c2('0x3')](socket),exports[_0xd9e4c2('0x4')]=function(_0x47675f){const _0x1b9d5a=this;return new Promise(function(_0x5aaaf3,_0x5ab8be){const _0x1294f3=a756_0xf401;return db[_0x1294f3('0x7')][_0x1294f3('0x5')]({'raw':_0x47675f[_0x1294f3('0x9')]?_0x47675f[_0x1294f3('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x47675f[_0x1294f3('0x9')]?_0x47675f[_0x1294f3('0x9')][_0x1294f3('0x15')]||null:null,'attributes':_0x47675f[_0x1294f3('0x9')]?_0x47675f[_0x1294f3('0x9')]['attributes']||null:null,'limit':_0x47675f[_0x1294f3('0x9')]?_0x47675f['options']['limit']||null:null,'include':_0x47675f['options']?_0x47675f['options'][_0x1294f3('0xc')]?_[_0x1294f3('0x14')](_0x47675f[_0x1294f3('0x9')][_0x1294f3('0xc')],function(_0x10afe7){const _0x428614=_0x1294f3;return{'model':db[_0x10afe7[_0x428614('0x19')]],'as':_0x10afe7['as'],'attributes':_0x10afe7['attributes'],'include':_0x10afe7[_0x428614('0xc')]?_['map'](_0x10afe7[_0x428614('0xc')],function(_0x5e2386){const _0x2080af=_0x428614;return{'model':db[_0x5e2386['model']],'as':_0x5e2386['as'],'attributes':_0x5e2386[_0x2080af('0x6')],'include':_0x5e2386[_0x2080af('0xc')]?_[_0x2080af('0x14')](_0x5e2386[_0x2080af('0xc')],function(_0x1d9aaf){const _0x2f9644=_0x2080af;return{'model':db[_0x1d9aaf[_0x2f9644('0x19')]],'as':_0x1d9aaf['as'],'attributes':_0x1d9aaf[_0x2f9644('0x6')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x433920){const _0x1430f6=_0x1294f3;logger[_0x1430f6('0xa')](_0x1430f6('0x4'),_0x47675f),logger[_0x1430f6('0xf')](_0x1430f6('0x4'),_0x47675f,JSON[_0x1430f6('0xb')](_0x433920)),_0x5aaaf3(_0x433920);})[_0x1294f3('0x17')](function(_0x523ef5){const _0x20b498=_0x1294f3;logger['error'](_0x20b498('0x4'),_0x523ef5['message'],_0x47675f),_0x5ab8be(_0x1b9d5a[_0x20b498('0x2')](0x1f4,_0x523ef5['message']));});});},exports[_0xd9e4c2('0x16')]=function(_0x11375e){const _0x31737c=this;return new Promise(function(_0x1b2ce9,_0xbc86b1){const _0x29c2ea=a756_0xf401;return db['VoiceQueue'][_0x29c2ea('0x8')]({'raw':_0x11375e[_0x29c2ea('0x9')]?_0x11375e[_0x29c2ea('0x9')][_0x29c2ea('0x1')]===undefined?!![]:![]:!![],'where':_0x11375e[_0x29c2ea('0x9')]?_0x11375e[_0x29c2ea('0x9')]['where']||null:null,'attributes':_0x11375e[_0x29c2ea('0x9')]?_0x11375e[_0x29c2ea('0x9')]['attributes']||null:null,'include':_0x11375e[_0x29c2ea('0x9')]?_0x11375e['options'][_0x29c2ea('0xc')]?_[_0x29c2ea('0x14')](_0x11375e['options'][_0x29c2ea('0xc')],function(_0x12f9ea){const _0x32cf05=_0x29c2ea;return{'model':db[_0x12f9ea[_0x32cf05('0x19')]],'as':_0x12f9ea['as'],'attributes':_0x12f9ea[_0x32cf05('0x6')],'include':_0x12f9ea[_0x32cf05('0xc')]?_[_0x32cf05('0x14')](_0x12f9ea[_0x32cf05('0xc')],function(_0x3b2c6c){const _0xfe1a1e=_0x32cf05;return{'model':db[_0x3b2c6c[_0xfe1a1e('0x19')]],'as':_0x3b2c6c['as'],'attributes':_0x3b2c6c[_0xfe1a1e('0x6')],'include':_0x3b2c6c[_0xfe1a1e('0xc')]?_['map'](_0x3b2c6c[_0xfe1a1e('0xc')],function(_0x2c0a72){const _0x4a1577=_0xfe1a1e;return{'model':db[_0x2c0a72[_0x4a1577('0x19')]],'as':_0x2c0a72['as'],'attributes':_0x2c0a72[_0x4a1577('0x6')]};}):[]};}):[]};}):[]:[]})[_0x29c2ea('0x11')](function(_0x755692){const _0x2db6a4=_0x29c2ea;logger[_0x2db6a4('0xa')](_0x2db6a4('0x16'),_0x11375e),logger[_0x2db6a4('0xf')](_0x2db6a4('0x16'),_0x11375e,JSON[_0x2db6a4('0xb')](_0x755692)),_0x1b2ce9(_0x755692);})[_0x29c2ea('0x17')](function(_0x2d3ad8){const _0x1033cf=_0x29c2ea;logger[_0x1033cf('0x2')](_0x1033cf('0x16'),_0x2d3ad8[_0x1033cf('0x18')],_0x11375e),_0xbc86b1(_0x31737c[_0x1033cf('0x2')](0x1f4,_0x2d3ad8[_0x1033cf('0x18')]));});});};