88ffc50f5824a3b8f6611888dfcb800addaf0a5f
[motion-next.git] / server / api / voiceQueueReport / voiceQueueReport.rpc.js
1 const a763_0x4e0b=['then','GetVoiceQueueReport','message','model','rpc','./voiceQueueReport.socket','limit','stringify','debug','findAll','UpdateVoiceQueueReport','where','VoiceQueueReport','attributes','lodash','options','body','map','../../config/logger','info','CreateVoiceQueueReport','include','error','../../mysqldb','register','catch','raw'];(function(_0x112a69,_0x4e0b49){const _0x24d8ce=function(_0x59b352){while(--_0x59b352){_0x112a69['push'](_0x112a69['shift']());}};_0x24d8ce(++_0x4e0b49);}(a763_0x4e0b,0x13d));const a763_0x24d8=function(_0x112a69,_0x4e0b49){_0x112a69=_0x112a69-0x0;let _0x24d8ce=a763_0x4e0b[_0x112a69];return _0x24d8ce;};const _0x78b9b5=a763_0x24d8;'use strict';const _=require(_0x78b9b5('0x15')),db=require(_0x78b9b5('0x3'))['db'],logger=require(_0x78b9b5('0x19'))(_0x78b9b5('0xb')),{getSocket}=require('../../rediscache'),socket=getSocket();require(_0x78b9b5('0xc'))[_0x78b9b5('0x4')](socket),exports['GetVoiceQueueReport']=function(_0x59b352){const _0x2af610=this;return new Promise(function(_0x4b3dc8,_0x338281){const _0x247892=a763_0x24d8;return db[_0x247892('0x13')][_0x247892('0x10')]({'raw':_0x59b352[_0x247892('0x16')]?_0x59b352[_0x247892('0x16')][_0x247892('0x6')]===undefined?!![]:![]:!![],'where':_0x59b352[_0x247892('0x16')]?_0x59b352[_0x247892('0x16')][_0x247892('0x12')]||null:null,'attributes':_0x59b352['options']?_0x59b352[_0x247892('0x16')][_0x247892('0x14')]||null:null,'limit':_0x59b352[_0x247892('0x16')]?_0x59b352[_0x247892('0x16')][_0x247892('0xd')]||null:null,'include':_0x59b352['options']?_0x59b352[_0x247892('0x16')][_0x247892('0x1')]?_[_0x247892('0x18')](_0x59b352['options']['include'],function(_0x10cbfe){const _0x490eef=_0x247892;return{'model':db[_0x10cbfe[_0x490eef('0xa')]],'as':_0x10cbfe['as'],'attributes':_0x10cbfe[_0x490eef('0x14')],'include':_0x10cbfe[_0x490eef('0x1')]?_[_0x490eef('0x18')](_0x10cbfe[_0x490eef('0x1')],function(_0x4ef975){const _0x285319=_0x490eef;return{'model':db[_0x4ef975['model']],'as':_0x4ef975['as'],'attributes':_0x4ef975[_0x285319('0x14')],'include':_0x4ef975[_0x285319('0x1')]?_[_0x285319('0x18')](_0x4ef975[_0x285319('0x1')],function(_0x49854a){return{'model':db[_0x49854a['model']],'as':_0x49854a['as'],'attributes':_0x49854a['attributes']};}):[]};}):[]};}):[]:[]})[_0x247892('0x7')](function(_0x487d9e){const _0x335209=_0x247892;logger[_0x335209('0x1a')](_0x335209('0x8'),_0x59b352),logger[_0x335209('0xf')](_0x335209('0x8'),_0x59b352,JSON[_0x335209('0xe')](_0x487d9e)),_0x4b3dc8(_0x487d9e);})[_0x247892('0x5')](function(_0x4e9804){const _0x2c12b8=_0x247892;logger['error'](_0x2c12b8('0x8'),_0x4e9804[_0x2c12b8('0x9')],_0x59b352),_0x338281(_0x2af610['error'](0x1f4,_0x4e9804[_0x2c12b8('0x9')]));});});},exports[_0x78b9b5('0x0')]=function(_0x24674e){const _0x1a085d=this;return new Promise(function(_0x2ec03f,_0x9bb1b3){const _0x1f773f=a763_0x24d8;return db[_0x1f773f('0x13')]['create'](_0x24674e[_0x1f773f('0x17')],{'raw':_0x24674e[_0x1f773f('0x16')]?_0x24674e[_0x1f773f('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x1f773f('0x7')](function(_0x522a01){const _0x14a5c3=_0x1f773f;logger['info'](_0x14a5c3('0x0'),_0x24674e),logger[_0x14a5c3('0xf')]('CreateVoiceQueueReport',_0x24674e,JSON[_0x14a5c3('0xe')](_0x522a01)),_0x2ec03f(_0x522a01);})[_0x1f773f('0x5')](function(_0x4019d2){const _0x2c34a2=_0x1f773f;logger['error'](_0x2c34a2('0x0'),_0x4019d2[_0x2c34a2('0x9')],_0x24674e),_0x9bb1b3(_0x1a085d['error'](0x1f4,_0x4019d2[_0x2c34a2('0x9')]));});});},exports[_0x78b9b5('0x11')]=function(_0x82bf){const _0x5413f0=this;return new Promise(function(_0x170dfe,_0x2828ac){const _0x1bd3d9=a763_0x24d8;return db['VoiceQueueReport']['update'](_0x82bf['body'],{'raw':_0x82bf[_0x1bd3d9('0x16')]?_0x82bf[_0x1bd3d9('0x16')][_0x1bd3d9('0x6')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x82bf[_0x1bd3d9('0x16')]?_0x82bf[_0x1bd3d9('0x16')][_0x1bd3d9('0x12')]||null:null,'attributes':_0x82bf[_0x1bd3d9('0x16')]?_0x82bf[_0x1bd3d9('0x16')]['attributes']||null:null,'limit':_0x82bf[_0x1bd3d9('0x16')]?_0x82bf[_0x1bd3d9('0x16')][_0x1bd3d9('0xd')]||null:null})[_0x1bd3d9('0x7')](function(_0x134707){const _0x49e9d7=_0x1bd3d9;logger[_0x49e9d7('0x1a')](_0x49e9d7('0x11'),_0x82bf),logger['debug'](_0x49e9d7('0x11'),_0x82bf,JSON[_0x49e9d7('0xe')](_0x134707)),_0x170dfe(_0x134707);})['catch'](function(_0x3b1d1c){const _0x161f84=_0x1bd3d9;logger[_0x161f84('0x2')]('UpdateVoiceQueueReport',_0x3b1d1c['message'],_0x82bf),_0x2828ac(_0x5413f0['error'](0x1f4,_0x3b1d1c['message']));});});};