Built motion from commit aab208717af8d15f4fa224cdb6a202877019af9b. Version 3.0.0...
[motion-next.git] / server / api / voiceQueue / voiceQueue.rpc.js
1 const a756_0x525f=['then','catch','ShowVoiceQueue','raw','where','options','../../config/logger','../../rediscache','debug','message','stringify','include','model','attributes','map','findOne','limit','GetVoiceQueue','rpc','../../mysqldb','info','./voiceQueue.socket','error'];(function(_0x4030a1,_0x525f22){const _0x39f50b=function(_0x12b843){while(--_0x12b843){_0x4030a1['push'](_0x4030a1['shift']());}};_0x39f50b(++_0x525f22);}(a756_0x525f,0x1a9));const a756_0x39f5=function(_0x4030a1,_0x525f22){_0x4030a1=_0x4030a1-0x0;let _0x39f50b=a756_0x525f[_0x4030a1];return _0x39f50b;};const _0x16ebff=a756_0x39f5;'use strict';const _=require('lodash'),db=require(_0x16ebff('0x8'))['db'],logger=require(_0x16ebff('0x12'))(_0x16ebff('0x7')),{getSocket}=require(_0x16ebff('0x13')),socket=getSocket();require(_0x16ebff('0xa'))['register'](socket),exports[_0x16ebff('0x6')]=function(_0x12b843){const _0x10fef5=this;return new Promise(function(_0x17f470,_0x5acac4){const _0xedd7ce=a756_0x39f5;return db['VoiceQueue']['findAll']({'raw':_0x12b843[_0xedd7ce('0x11')]?_0x12b843[_0xedd7ce('0x11')][_0xedd7ce('0xf')]===undefined?!![]:![]:!![],'where':_0x12b843[_0xedd7ce('0x11')]?_0x12b843[_0xedd7ce('0x11')][_0xedd7ce('0x10')]||null:null,'attributes':_0x12b843[_0xedd7ce('0x11')]?_0x12b843[_0xedd7ce('0x11')][_0xedd7ce('0x2')]||null:null,'limit':_0x12b843['options']?_0x12b843[_0xedd7ce('0x11')][_0xedd7ce('0x5')]||null:null,'include':_0x12b843[_0xedd7ce('0x11')]?_0x12b843[_0xedd7ce('0x11')]['include']?_[_0xedd7ce('0x3')](_0x12b843[_0xedd7ce('0x11')][_0xedd7ce('0x0')],function(_0x356c60){const _0x2ebed0=_0xedd7ce;return{'model':db[_0x356c60[_0x2ebed0('0x1')]],'as':_0x356c60['as'],'attributes':_0x356c60[_0x2ebed0('0x2')],'include':_0x356c60[_0x2ebed0('0x0')]?_['map'](_0x356c60[_0x2ebed0('0x0')],function(_0x52d454){const _0x3deeca=_0x2ebed0;return{'model':db[_0x52d454['model']],'as':_0x52d454['as'],'attributes':_0x52d454['attributes'],'include':_0x52d454[_0x3deeca('0x0')]?_[_0x3deeca('0x3')](_0x52d454[_0x3deeca('0x0')],function(_0x8b2471){const _0x1766b8=_0x3deeca;return{'model':db[_0x8b2471['model']],'as':_0x8b2471['as'],'attributes':_0x8b2471[_0x1766b8('0x2')]};}):[]};}):[]};}):[]:[]})[_0xedd7ce('0xc')](function(_0x1d435f){const _0x3decbf=_0xedd7ce;logger[_0x3decbf('0x9')](_0x3decbf('0x6'),_0x12b843),logger[_0x3decbf('0x14')](_0x3decbf('0x6'),_0x12b843,JSON[_0x3decbf('0x16')](_0x1d435f)),_0x17f470(_0x1d435f);})[_0xedd7ce('0xd')](function(_0x108780){const _0x28d6b2=_0xedd7ce;logger[_0x28d6b2('0xb')](_0x28d6b2('0x6'),_0x108780[_0x28d6b2('0x15')],_0x12b843),_0x5acac4(_0x10fef5['error'](0x1f4,_0x108780['message']));});});},exports[_0x16ebff('0xe')]=function(_0x3a88b9){const _0x307be5=this;return new Promise(function(_0x55e000,_0x3f8053){const _0x2ddc1a=a756_0x39f5;return db['VoiceQueue'][_0x2ddc1a('0x4')]({'raw':_0x3a88b9[_0x2ddc1a('0x11')]?_0x3a88b9[_0x2ddc1a('0x11')][_0x2ddc1a('0xf')]===undefined?!![]:![]:!![],'where':_0x3a88b9[_0x2ddc1a('0x11')]?_0x3a88b9['options'][_0x2ddc1a('0x10')]||null:null,'attributes':_0x3a88b9[_0x2ddc1a('0x11')]?_0x3a88b9['options'][_0x2ddc1a('0x2')]||null:null,'include':_0x3a88b9[_0x2ddc1a('0x11')]?_0x3a88b9[_0x2ddc1a('0x11')][_0x2ddc1a('0x0')]?_[_0x2ddc1a('0x3')](_0x3a88b9[_0x2ddc1a('0x11')][_0x2ddc1a('0x0')],function(_0x4c1c20){const _0x65cc48=_0x2ddc1a;return{'model':db[_0x4c1c20[_0x65cc48('0x1')]],'as':_0x4c1c20['as'],'attributes':_0x4c1c20[_0x65cc48('0x2')],'include':_0x4c1c20[_0x65cc48('0x0')]?_[_0x65cc48('0x3')](_0x4c1c20[_0x65cc48('0x0')],function(_0x2de2e3){const _0x57662c=_0x65cc48;return{'model':db[_0x2de2e3['model']],'as':_0x2de2e3['as'],'attributes':_0x2de2e3[_0x57662c('0x2')],'include':_0x2de2e3[_0x57662c('0x0')]?_[_0x57662c('0x3')](_0x2de2e3['include'],function(_0x5db0f3){const _0x358a07=_0x57662c;return{'model':db[_0x5db0f3[_0x358a07('0x1')]],'as':_0x5db0f3['as'],'attributes':_0x5db0f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ddc1a('0xc')](function(_0x504d76){const _0x11654f=_0x2ddc1a;logger[_0x11654f('0x9')](_0x11654f('0xe'),_0x3a88b9),logger[_0x11654f('0x14')](_0x11654f('0xe'),_0x3a88b9,JSON[_0x11654f('0x16')](_0x504d76)),_0x55e000(_0x504d76);})['catch'](function(_0x34f453){const _0x508bae=_0x2ddc1a;logger[_0x508bae('0xb')](_0x508bae('0xe'),_0x34f453[_0x508bae('0x15')],_0x3a88b9),_0x3f8053(_0x307be5[_0x508bae('0xb')](0x1f4,_0x34f453['message']));});});};