Built motion from commit dff3aec7b.|1.0.31
[motion.git] / server / api / openchannel_room / openchannel_room.controller.js
index 4050ab4..ec4a98b 100644 (file)
@@ -1 +1 @@
-var _0xea48=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x55\x73\x65\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x61\x67\x65\x6E\x74","\x69\x64","\x75\x73\x65\x72","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x2C","\x73\x70\x6C\x69\x74"];_0xea48[0];var _=require(_0xea48[1]);var Util=require(_0xea48[2]);var sequelize=require(_0xea48[4])[_0xea48[3]];var moment=require(_0xea48[5]);var logger=require(_0xea48[7])(_0xea48[6]);var OpenchannelRoom=require(_0xea48[4])[_0xea48[8]];var OpenchannelMessage=require(_0xea48[4])[_0xea48[9]];var OpenchannelAccount=require(_0xea48[4])[_0xea48[10]];var OpenchannelQueue=require(_0xea48[4])[_0xea48[11]];var OpenchannelApplication=require(_0xea48[4])[_0xea48[12]];var User=require(_0xea48[4])[_0xea48[13]];function handleError(_0xf57axd,_0xf57axe){logger[_0xea48[15]](_0xf57axe[_0xea48[14]]);return _0xf57axd[_0xea48[17]](500)[_0xea48[16]](_0xf57axe)}exports[_0xea48[18]]= function(_0xf57axf,_0xf57axd){switch(_0xf57axf[_0xea48[27]][_0xea48[29]]){case _0xea48[25]:return OpenchannelRoom[_0xea48[28]](_0xea48[24],{method:[_0xea48[25],_0xf57axf[_0xea48[27]][_0xea48[26]]]})[_0xea48[23]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]]))[_0xea48[20]](function(_0xf57ax10){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]](_0xf57ax10)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)});default:return OpenchannelRoom[_0xea48[28]](_0xea48[24])[_0xea48[23]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]]))[_0xea48[20]](function(_0xf57ax10){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]](_0xf57ax10)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})}};exports[_0xea48[30]]= function(_0xf57axf,_0xf57axd){return OpenchannelRoom[_0xea48[30]]()[_0xea48[20]](function(_0xf57ax11){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]](_0xf57ax11)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};function getOpenchannelQueues(_0xf57ax13){return function(){switch(_0xf57ax13[_0xea48[29]]){case _0xea48[27]:return User[_0xea48[33]](_0xf57ax13[_0xea48[26]],{attributes:[_0xea48[26]]})[_0xea48[20]](Util[_0xea48[32]]({},{attributes:[_0xea48[26]],include:[{raw:true,model:User,attributes:[_0xea48[26]]}]}))[_0xea48[20]](function(_0xf57ax14){return {include:{model:OpenchannelAccount,include:{model:OpenchannelApplication,include:{model:OpenchannelQueue,where:{id:_[_0xea48[31]](_0xf57ax14,_0xea48[26])}}}}}});default:return {}}}}exports[_0xea48[34]]= function(_0xf57axf,_0xf57axd){return Promise[_0xea48[40]]([])[_0xea48[20]](getOpenchannelQueues(_0xf57axf[_0xea48[27]]))[_0xea48[20]](function(_0xf57ax16){return OpenchannelRoom[_0xea48[39]](_[_0xea48[38]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]],{status:_0xea48[35],updatedAt:{$gte:moment()[_0xea48[37]](_0xea48[36])}}),_0xf57ax16))})[_0xea48[20]](function(_0xf57ax15){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]]({value:_0xf57ax15})})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[41]]= function(_0xf57axf,_0xf57axd){return Promise[_0xea48[40]]([])[_0xea48[20]](getOpenchannelQueues(_0xf57axf[_0xea48[27]]))[_0xea48[20]](function(_0xf57ax16){return OpenchannelRoom[_0xea48[39]](_[_0xea48[38]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]],{status:_0xea48[42],updatedAt:{$gte:moment()[_0xea48[37]](_0xea48[36])}}),_0xf57ax16))})[_0xea48[20]](function(_0xf57ax15){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]]({value:_0xf57ax15})})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[43]]= function(_0xf57axf,_0xf57axd){return Promise[_0xea48[40]]([])[_0xea48[20]](getOpenchannelQueues(_0xf57axf[_0xea48[27]]))[_0xea48[20]](function(_0xf57ax16){return OpenchannelRoom[_0xea48[39]](_[_0xea48[38]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]],{status:_0xea48[44],updatedAt:{$gte:moment()[_0xea48[37]](_0xea48[36])}}),_0xf57ax16))})[_0xea48[20]](function(_0xf57ax15){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]]({value:_0xf57ax15})})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[45]]= function(_0xf57axf,_0xf57axd){return Promise[_0xea48[40]]([])[_0xea48[20]](getOpenchannelQueues(_0xf57axf[_0xea48[27]]))[_0xea48[20]](function(_0xf57ax16){return OpenchannelRoom[_0xea48[39]](_[_0xea48[38]](Util[_0xea48[22]](_0xf57axf[_0xea48[21]],{status:_0xea48[46],updatedAt:{$gte:moment()[_0xea48[37]](_0xea48[36])}}),_0xf57ax16))})[_0xea48[20]](function(_0xf57ax15){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]]({value:_0xf57ax15})})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[47]]= function(_0xf57axf,_0xf57axd){return OpenchannelRoom[_0xea48[28]](_0xea48[24])[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax17){if(!_0xf57ax17){return _0xf57axd[_0xea48[48]](404)};return _0xf57axd[_0xea48[16]](_0xf57ax17)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[50]]= function(_0xf57axf,_0xf57axd,_0xf57ax18){return OpenchannelRoom[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax17){if(!_0xf57ax17){return _0xf57axd[_0xea48[48]](404)};return _0xf57ax17[_0xea48[55]]({attributes:[_0xea48[26],_0xea48[51],_0xea48[52],_0xea48[53],_0xea48[29],_0xea48[54]]})})[_0xea48[20]](function(_0xf57ax19){return _0xf57axd[_0xea48[16]](_0xf57ax19)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[56]]= function(_0xf57axf,_0xf57axd,_0xf57ax18){return OpenchannelMessage[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax1a){return _0xf57ax1a[_0xea48[57]]({include:[{model:OpenchannelAccount},{model:OpenchannelMessage,include:[{model:User,attributes:[_0xea48[26],_0xea48[51],_0xea48[52],_0xea48[53]]}]},{model:User,attributes:[_0xea48[26],_0xea48[51],_0xea48[52],_0xea48[53]]}]})})[_0xea48[20]](function(_0xf57ax17){return _0xf57axd[_0xea48[16]](_0xf57ax17)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[58]]= function(_0xf57axf,_0xf57axd){return OpenchannelRoom[_0xea48[58]](_0xf57axf[_0xea48[59]])[_0xea48[20]](function(_0xf57ax1a){return _0xf57axd[_0xea48[17]](201)[_0xea48[16]](_0xf57ax1a)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[60]]= function(_0xf57axf,_0xf57axd,_0xf57ax18){_0xf57axf[_0xea48[59]][_0xea48[61]]= _0xf57axf[_0xea48[27]][_0xea48[26]];_0xf57axf[_0xea48[59]][_0xea48[62]]= _0xf57axf[_0xea48[49]][_0xea48[26]];return OpenchannelMessage[_0xea48[58]](_0xf57axf[_0xea48[59]])[_0xea48[20]](function(_0xf57ax1a){return _0xf57axd[_0xea48[17]](201)[_0xea48[16]](_0xf57ax1a)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[63]]= function(_0xf57axf,_0xf57axd){if(_0xf57axf[_0xea48[59]][_0xea48[26]]){delete _0xf57axf[_0xea48[59]][_0xea48[26]]};return OpenchannelRoom[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax17){if(!_0xf57ax17){return _0xf57axd[_0xea48[48]](404)};var _0xf57ax1b=_[_0xea48[38]](_0xf57ax17,_0xf57axf[_0xea48[59]]);return _0xf57ax1b[_0xea48[64]]()})[_0xea48[20]](function(_0xf57ax17){return _0xf57axd[_0xea48[17]](200)[_0xea48[16]](_0xf57ax17)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[65]]= function(_0xf57axf,_0xf57axd,_0xf57ax18){return OpenchannelRoom[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax17){if(!_0xf57ax17){return _0xf57axd[_0xea48[48]](404)};return _0xf57ax17[_0xea48[67]](_0xf57axf[_0xea48[59]][_0xea48[66]],{individualHooks:true})})[_0xea48[20]](function(){return _0xf57axd[_0xea48[48]](200)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[68]]= function(_0xf57axf,_0xf57axd){return OpenchannelRoom[_0xea48[33]](_0xf57axf[_0xea48[49]][_0xea48[26]])[_0xea48[20]](function(_0xf57ax17){if(!_0xf57ax17){return _0xf57axd[_0xea48[48]](404)};return _0xf57ax17[_0xea48[68]]()})[_0xea48[20]](function(){return _0xf57axd[_0xea48[48]](204)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[69]]= function(_0xf57axf,_0xf57axd){return OpenchannelRoom[_0xea48[68]]({where:{id:_0xf57axf[_0xea48[21]][_0xea48[70]]},individualHooks:true})[_0xea48[20]](function(){return _0xf57axd[_0xea48[48]](200)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[71]]= function(_0xf57axf,_0xf57axd){return sequelize[_0xea48[21]](_0xea48[74],{type:sequelize[_0xea48[76]][_0xea48[75]]})[_0xea48[20]](function(_0xf57ax1c){var _0xf57ax1d=_[_0xea48[38]]({new:0,open:0,pending:0,closed:0},_[_0xea48[73]](_[_0xea48[72]](_0xf57ax1c,_0xea48[17]),_0xea48[39]));return _0xf57axd[_0xea48[17]](200)[_0xea48[16]](_0xf57ax1d)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})};exports[_0xea48[77]]= function(_0xf57axf,_0xf57axd,_0xf57ax18){var _0xf57ax1e={where:{id:_0xf57axf[_0xea48[49]][_0xea48[26]][_0xea48[79]](_0xea48[78])},user:_0xf57axf[_0xea48[27]],individualHooks:true};return OpenchannelRoom[_0xea48[63]](_0xf57axf[_0xea48[59]],_0xf57ax1e)[_0xea48[20]](function(_0xf57ax1f){if(!_0xf57ax1f){return _0xf57axd[_0xea48[48]](404)};return _0xf57ax1f})[_0xea48[20]](function(_0xf57ax1f){return _0xf57axd[_0xea48[48]](200)})[_0xea48[19]](function(_0xf57axe){return handleError(_0xf57axd,_0xf57axe)})}
\ No newline at end of file
+var _0x2b77=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x55\x73\x65\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x61\x67\x65\x6E\x74","\x69\x64","\x75\x73\x65\x72","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x2C","\x73\x70\x6C\x69\x74"];_0x2b77[0];var _=require(_0x2b77[1]);var Util=require(_0x2b77[2]);var sequelize=require(_0x2b77[4])[_0x2b77[3]];var moment=require(_0x2b77[5]);var logger=require(_0x2b77[7])(_0x2b77[6]);var OpenchannelRoom=require(_0x2b77[4])[_0x2b77[8]];var OpenchannelMessage=require(_0x2b77[4])[_0x2b77[9]];var OpenchannelAccount=require(_0x2b77[4])[_0x2b77[10]];var OpenchannelQueue=require(_0x2b77[4])[_0x2b77[11]];var OpenchannelApplication=require(_0x2b77[4])[_0x2b77[12]];var User=require(_0x2b77[4])[_0x2b77[13]];function handleError(_0x8cf3xd,_0x8cf3xe){logger[_0x2b77[15]](_0x8cf3xe[_0x2b77[14]]);return _0x8cf3xd[_0x2b77[17]](500)[_0x2b77[16]](_0x8cf3xe)}exports[_0x2b77[18]]= function(_0x8cf3xf,_0x8cf3xd){switch(_0x8cf3xf[_0x2b77[27]][_0x2b77[29]]){case _0x2b77[25]:return OpenchannelRoom[_0x2b77[28]](_0x2b77[24],{method:[_0x2b77[25],_0x8cf3xf[_0x2b77[27]][_0x2b77[26]]]})[_0x2b77[23]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]]))[_0x2b77[20]](function(_0x8cf3x10){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]](_0x8cf3x10)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)});default:return OpenchannelRoom[_0x2b77[28]](_0x2b77[24])[_0x2b77[23]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]]))[_0x2b77[20]](function(_0x8cf3x10){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]](_0x8cf3x10)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})}};exports[_0x2b77[30]]= function(_0x8cf3xf,_0x8cf3xd){return OpenchannelRoom[_0x2b77[30]]()[_0x2b77[20]](function(_0x8cf3x11){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]](_0x8cf3x11)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};function getOpenchannelQueues(_0x8cf3x13){return function(){switch(_0x8cf3x13[_0x2b77[29]]){case _0x2b77[27]:return User[_0x2b77[33]](_0x8cf3x13[_0x2b77[26]],{attributes:[_0x2b77[26]]})[_0x2b77[20]](Util[_0x2b77[32]]({},{attributes:[_0x2b77[26]],include:[{raw:true,model:User,attributes:[_0x2b77[26]]}]}))[_0x2b77[20]](function(_0x8cf3x14){return {include:{model:OpenchannelAccount,include:{model:OpenchannelApplication,include:{model:OpenchannelQueue,where:{id:_[_0x2b77[31]](_0x8cf3x14,_0x2b77[26])}}}}}});default:return {}}}}exports[_0x2b77[34]]= function(_0x8cf3xf,_0x8cf3xd){return Promise[_0x2b77[40]]([])[_0x2b77[20]](getOpenchannelQueues(_0x8cf3xf[_0x2b77[27]]))[_0x2b77[20]](function(_0x8cf3x16){return OpenchannelRoom[_0x2b77[39]](_[_0x2b77[38]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]],{status:_0x2b77[35],updatedAt:{$gte:moment()[_0x2b77[37]](_0x2b77[36])}}),_0x8cf3x16))})[_0x2b77[20]](function(_0x8cf3x15){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]]({value:_0x8cf3x15})})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[41]]= function(_0x8cf3xf,_0x8cf3xd){return Promise[_0x2b77[40]]([])[_0x2b77[20]](getOpenchannelQueues(_0x8cf3xf[_0x2b77[27]]))[_0x2b77[20]](function(_0x8cf3x16){return OpenchannelRoom[_0x2b77[39]](_[_0x2b77[38]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]],{status:_0x2b77[42],updatedAt:{$gte:moment()[_0x2b77[37]](_0x2b77[36])}}),_0x8cf3x16))})[_0x2b77[20]](function(_0x8cf3x15){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]]({value:_0x8cf3x15})})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[43]]= function(_0x8cf3xf,_0x8cf3xd){return Promise[_0x2b77[40]]([])[_0x2b77[20]](getOpenchannelQueues(_0x8cf3xf[_0x2b77[27]]))[_0x2b77[20]](function(_0x8cf3x16){return OpenchannelRoom[_0x2b77[39]](_[_0x2b77[38]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]],{status:_0x2b77[44],updatedAt:{$gte:moment()[_0x2b77[37]](_0x2b77[36])}}),_0x8cf3x16))})[_0x2b77[20]](function(_0x8cf3x15){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]]({value:_0x8cf3x15})})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[45]]= function(_0x8cf3xf,_0x8cf3xd){return Promise[_0x2b77[40]]([])[_0x2b77[20]](getOpenchannelQueues(_0x8cf3xf[_0x2b77[27]]))[_0x2b77[20]](function(_0x8cf3x16){return OpenchannelRoom[_0x2b77[39]](_[_0x2b77[38]](Util[_0x2b77[22]](_0x8cf3xf[_0x2b77[21]],{status:_0x2b77[46],updatedAt:{$gte:moment()[_0x2b77[37]](_0x2b77[36])}}),_0x8cf3x16))})[_0x2b77[20]](function(_0x8cf3x15){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]]({value:_0x8cf3x15})})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[47]]= function(_0x8cf3xf,_0x8cf3xd){return OpenchannelRoom[_0x2b77[28]](_0x2b77[24])[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x17){if(!_0x8cf3x17){return _0x8cf3xd[_0x2b77[48]](404)};return _0x8cf3xd[_0x2b77[16]](_0x8cf3x17)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[50]]= function(_0x8cf3xf,_0x8cf3xd,_0x8cf3x18){return OpenchannelRoom[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x17){if(!_0x8cf3x17){return _0x8cf3xd[_0x2b77[48]](404)};return _0x8cf3x17[_0x2b77[55]]({attributes:[_0x2b77[26],_0x2b77[51],_0x2b77[52],_0x2b77[53],_0x2b77[29],_0x2b77[54]]})})[_0x2b77[20]](function(_0x8cf3x19){return _0x8cf3xd[_0x2b77[16]](_0x8cf3x19)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[56]]= function(_0x8cf3xf,_0x8cf3xd,_0x8cf3x18){return OpenchannelMessage[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x1a){return _0x8cf3x1a[_0x2b77[57]]({include:[{model:OpenchannelAccount},{model:OpenchannelMessage,include:[{model:User,attributes:[_0x2b77[26],_0x2b77[51],_0x2b77[52],_0x2b77[53]]}]},{model:User,attributes:[_0x2b77[26],_0x2b77[51],_0x2b77[52],_0x2b77[53]]}]})})[_0x2b77[20]](function(_0x8cf3x17){return _0x8cf3xd[_0x2b77[16]](_0x8cf3x17)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[58]]= function(_0x8cf3xf,_0x8cf3xd){return OpenchannelRoom[_0x2b77[58]](_0x8cf3xf[_0x2b77[59]])[_0x2b77[20]](function(_0x8cf3x1a){return _0x8cf3xd[_0x2b77[17]](201)[_0x2b77[16]](_0x8cf3x1a)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[60]]= function(_0x8cf3xf,_0x8cf3xd,_0x8cf3x18){_0x8cf3xf[_0x2b77[59]][_0x2b77[61]]= _0x8cf3xf[_0x2b77[27]][_0x2b77[26]];_0x8cf3xf[_0x2b77[59]][_0x2b77[62]]= _0x8cf3xf[_0x2b77[49]][_0x2b77[26]];return OpenchannelMessage[_0x2b77[58]](_0x8cf3xf[_0x2b77[59]])[_0x2b77[20]](function(_0x8cf3x1a){return _0x8cf3xd[_0x2b77[17]](201)[_0x2b77[16]](_0x8cf3x1a)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[63]]= function(_0x8cf3xf,_0x8cf3xd){if(_0x8cf3xf[_0x2b77[59]][_0x2b77[26]]){delete _0x8cf3xf[_0x2b77[59]][_0x2b77[26]]};return OpenchannelRoom[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x17){if(!_0x8cf3x17){return _0x8cf3xd[_0x2b77[48]](404)};var _0x8cf3x1b=_[_0x2b77[38]](_0x8cf3x17,_0x8cf3xf[_0x2b77[59]]);return _0x8cf3x1b[_0x2b77[64]]()})[_0x2b77[20]](function(_0x8cf3x17){return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]](_0x8cf3x17)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[65]]= function(_0x8cf3xf,_0x8cf3xd,_0x8cf3x18){return OpenchannelRoom[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x17){if(!_0x8cf3x17){return _0x8cf3xd[_0x2b77[48]](404)};return _0x8cf3x17[_0x2b77[67]](_0x8cf3xf[_0x2b77[59]][_0x2b77[66]],{individualHooks:true})})[_0x2b77[20]](function(){return _0x8cf3xd[_0x2b77[48]](200)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[68]]= function(_0x8cf3xf,_0x8cf3xd){return OpenchannelRoom[_0x2b77[33]](_0x8cf3xf[_0x2b77[49]][_0x2b77[26]])[_0x2b77[20]](function(_0x8cf3x17){if(!_0x8cf3x17){return _0x8cf3xd[_0x2b77[48]](404)};return _0x8cf3x17[_0x2b77[68]]()})[_0x2b77[20]](function(){return _0x8cf3xd[_0x2b77[48]](204)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[69]]= function(_0x8cf3xf,_0x8cf3xd){return OpenchannelRoom[_0x2b77[68]]({where:{id:_0x8cf3xf[_0x2b77[21]][_0x2b77[70]]},individualHooks:true})[_0x2b77[20]](function(){return _0x8cf3xd[_0x2b77[48]](200)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[71]]= function(_0x8cf3xf,_0x8cf3xd){return sequelize[_0x2b77[21]](_0x2b77[74],{type:sequelize[_0x2b77[76]][_0x2b77[75]]})[_0x2b77[20]](function(_0x8cf3x1c){var _0x8cf3x1d=_[_0x2b77[38]]({new:0,open:0,pending:0,closed:0},_[_0x2b77[73]](_[_0x2b77[72]](_0x8cf3x1c,_0x2b77[17]),_0x2b77[39]));return _0x8cf3xd[_0x2b77[17]](200)[_0x2b77[16]](_0x8cf3x1d)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})};exports[_0x2b77[77]]= function(_0x8cf3xf,_0x8cf3xd,_0x8cf3x18){var _0x8cf3x1e={where:{id:_0x8cf3xf[_0x2b77[49]][_0x2b77[26]][_0x2b77[79]](_0x2b77[78])},user:_0x8cf3xf[_0x2b77[27]],individualHooks:true};return OpenchannelRoom[_0x2b77[63]](_0x8cf3xf[_0x2b77[59]],_0x8cf3x1e)[_0x2b77[20]](function(_0x8cf3x1f){if(!_0x8cf3x1f){return _0x8cf3xd[_0x2b77[48]](404)};return _0x8cf3x1f})[_0x2b77[20]](function(_0x8cf3x1f){return _0x8cf3xd[_0x2b77[48]](200)})[_0x2b77[19]](function(_0x8cf3xe){return handleError(_0x8cf3xd,_0x8cf3xe)})}
\ No newline at end of file