Built motion from commit b18b7a808.|1.0.23
[motion.git] / server / api / report_chat_session / report_chat_session.controller.js
index 0d2d6ea..832e26c 100644 (file)
@@ -1 +1 @@
-var _0xfe96=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x62\x6C\x75\x65\x62\x69\x72\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\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\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x77\x61\x69\x74\x69\x6E\x67\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x6C\x6C","\x6F\x70\x65\x6E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6C\x6F\x73\x65\x64","\x74\x69\x6D\x65\x6F\x75\x74","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xfe96[0];var _=require(_0xfe96[1]);var ReportChatSession=require(_0xfe96[3])[_0xfe96[2]];var User=require(_0xfe96[3])[_0xfe96[4]];var ReportChatSessionHistory=require(_0xfe96[3])[_0xfe96[6]][_0xfe96[5]];var Promise=require(_0xfe96[7]);var Util=require(_0xfe96[8]);var moment=require(_0xfe96[9]);var logger=require(_0xfe96[11])(_0xfe96[10]);exports[_0xfe96[12]]= function(_0xe0c3x9,_0xe0c3xa,_0xe0c3xb){return ReportChatSession[_0xfe96[19]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]]))[_0xfe96[16]](function(_0xe0c3xd){_0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]](_0xe0c3xd)})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[20]]= function(_0xe0c3x9,_0xe0c3xa){return ReportChatSessionHistory[_0xfe96[20]]()[_0xfe96[16]](function(_0xe0c3xe){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]](_0xe0c3xe)})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};function getChatQueues(_0xe0c3x10){return function(){switch(_0xe0c3x10[_0xfe96[31]]){case _0xfe96[28]:return User[_0xfe96[27]](_0xe0c3x10[_0xfe96[21]],{attributes:[_0xfe96[21]]})[_0xfe96[16]](Util[_0xfe96[26]]({},{attributes:[_0xfe96[21]],include:[{raw:true,model:User,attributes:[_0xfe96[21]]}]}))[_0xfe96[16]](function(_0xe0c3x11){var _0xe0c3x12=[];_0xe0c3x11[_0xfe96[25]][_0xfe96[24]](function(_0xe0c3x13){_0xe0c3x12= _[_0xfe96[23]](_0xe0c3x12,_[_0xfe96[22]](_0xe0c3x13.Users,_0xfe96[21]))});return {$or:{queue:_[_0xfe96[22]](_0xe0c3x11[_0xfe96[25]],_0xfe96[21]),memberid:_0xe0c3x12}}});case _0xfe96[30]:return User[_0xfe96[27]](_0xe0c3x10[_0xfe96[21]],{attributes:[_0xfe96[21]]})[_0xfe96[16]](function(_0xe0c3x14){return _0xe0c3x14[_0xfe96[29]]({attributes:[_0xfe96[21]]})})[_0xfe96[16]](function(_0xe0c3x11){return {$or:{queue:_[_0xfe96[22]](_0xe0c3x11,_0xfe96[21]),memberid:_0xe0c3x10[_0xfe96[21]]}}});default:return {}}}}exports[_0xfe96[32]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[34]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({leaveAt:null},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({rows:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[36]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[39]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({leaveAt:{$ne:null},complete:null,abandon:null,timeout:null,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({value:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[40]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[39]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({leaveAt:null,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({value:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[41]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[39]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({complete:true,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({value:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[42]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[39]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({timeout:true,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({value:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[43]]= function(_0xe0c3x9,_0xe0c3xa){return Promise[_0xfe96[35]]([])[_0xfe96[16]](getChatQueues(_0xe0c3x9[_0xfe96[28]]))[_0xfe96[16]](function(_0xe0c3x16){return ReportChatSession[_0xfe96[39]](Util[_0xfe96[18]](_0xe0c3x9[_0xfe96[17]],_[_0xfe96[33]]({abandon:true,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}},_0xe0c3x16)))})[_0xfe96[16]](function(_0xe0c3x15){return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]]({value:_0xe0c3x15})})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};exports[_0xfe96[44]]= function(_0xe0c3x9,_0xe0c3xa){var _0xe0c3x17={timeout:0,waiting:0};return ReportChatSession[_0xfe96[39]]({where:{leaveAt:null,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}}})[_0xfe96[16]](function(_0xe0c3xd){if(_0xe0c3xd){_0xe0c3x17[_0xfe96[40]]= _0xe0c3xd};return ReportChatSession[_0xfe96[39]]({where:{timeout:true,createdAt:{$gte:moment()[_0xfe96[38]](_0xfe96[37])}}})})[_0xfe96[16]](function(_0xe0c3xd){if(_0xe0c3xd){_0xe0c3x17[_0xfe96[42]]= _0xe0c3xd};return _0xe0c3xa[_0xfe96[15]](200)[_0xfe96[14]](_0xe0c3x17)})[_0xfe96[13]](function(_0xe0c3xc){return handleError(_0xe0c3xa,_0xe0c3xc)})};function handleError(_0xe0c3xa,_0xe0c3xc){logger[_0xfe96[46]](_0xe0c3xc[_0xfe96[45]]);return _0xe0c3xa[_0xfe96[15]](500)[_0xfe96[14]](_0xe0c3xc)}
\ No newline at end of file
+var _0x7e25=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x62\x6C\x75\x65\x62\x69\x72\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\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\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x77\x61\x69\x74\x69\x6E\x67\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x6C\x6C","\x6F\x70\x65\x6E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6C\x6F\x73\x65\x64","\x74\x69\x6D\x65\x6F\x75\x74","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x7e25[0];var _=require(_0x7e25[1]);var ReportChatSession=require(_0x7e25[3])[_0x7e25[2]];var User=require(_0x7e25[3])[_0x7e25[4]];var ReportChatSessionHistory=require(_0x7e25[3])[_0x7e25[6]][_0x7e25[5]];var Promise=require(_0x7e25[7]);var Util=require(_0x7e25[8]);var moment=require(_0x7e25[9]);var logger=require(_0x7e25[11])(_0x7e25[10]);exports[_0x7e25[12]]= function(_0x186ax9,_0x186axa,_0x186axb){return ReportChatSession[_0x7e25[19]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]]))[_0x7e25[16]](function(_0x186axd){_0x186axa[_0x7e25[15]](200)[_0x7e25[14]](_0x186axd)})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[20]]= function(_0x186ax9,_0x186axa){return ReportChatSessionHistory[_0x7e25[20]]()[_0x7e25[16]](function(_0x186axe){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]](_0x186axe)})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};function getChatQueues(_0x186ax10){return function(){switch(_0x186ax10[_0x7e25[31]]){case _0x7e25[28]:return User[_0x7e25[27]](_0x186ax10[_0x7e25[21]],{attributes:[_0x7e25[21]]})[_0x7e25[16]](Util[_0x7e25[26]]({},{attributes:[_0x7e25[21]],include:[{raw:true,model:User,attributes:[_0x7e25[21]]}]}))[_0x7e25[16]](function(_0x186ax11){var _0x186ax12=[];_0x186ax11[_0x7e25[25]][_0x7e25[24]](function(_0x186ax13){_0x186ax12= _[_0x7e25[23]](_0x186ax12,_[_0x7e25[22]](_0x186ax13.Users,_0x7e25[21]))});return {$or:{queue:_[_0x7e25[22]](_0x186ax11[_0x7e25[25]],_0x7e25[21]),memberid:_0x186ax12}}});case _0x7e25[30]:return User[_0x7e25[27]](_0x186ax10[_0x7e25[21]],{attributes:[_0x7e25[21]]})[_0x7e25[16]](function(_0x186ax14){return _0x186ax14[_0x7e25[29]]({attributes:[_0x7e25[21]]})})[_0x7e25[16]](function(_0x186ax11){return {$or:{queue:_[_0x7e25[22]](_0x186ax11,_0x7e25[21]),memberid:_0x186ax10[_0x7e25[21]]}}});default:return {}}}}exports[_0x7e25[32]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[34]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({leaveAt:null},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({rows:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[36]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[39]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({leaveAt:{$ne:null},complete:null,abandon:null,timeout:null,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({value:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[40]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[39]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({leaveAt:null,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({value:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[41]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[39]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({complete:true,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({value:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[42]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[39]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({timeout:true,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({value:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[43]]= function(_0x186ax9,_0x186axa){return Promise[_0x7e25[35]]([])[_0x7e25[16]](getChatQueues(_0x186ax9[_0x7e25[28]]))[_0x7e25[16]](function(_0x186ax16){return ReportChatSession[_0x7e25[39]](Util[_0x7e25[18]](_0x186ax9[_0x7e25[17]],_[_0x7e25[33]]({abandon:true,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}},_0x186ax16)))})[_0x7e25[16]](function(_0x186ax15){return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]]({value:_0x186ax15})})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};exports[_0x7e25[44]]= function(_0x186ax9,_0x186axa){var _0x186ax17={timeout:0,waiting:0};return ReportChatSession[_0x7e25[39]]({where:{leaveAt:null,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}}})[_0x7e25[16]](function(_0x186axd){if(_0x186axd){_0x186ax17[_0x7e25[40]]= _0x186axd};return ReportChatSession[_0x7e25[39]]({where:{timeout:true,createdAt:{$gte:moment()[_0x7e25[38]](_0x7e25[37])}}})})[_0x7e25[16]](function(_0x186axd){if(_0x186axd){_0x186ax17[_0x7e25[42]]= _0x186axd};return _0x186axa[_0x7e25[15]](200)[_0x7e25[14]](_0x186ax17)})[_0x7e25[13]](function(_0x186axc){return handleError(_0x186axa,_0x186axc)})};function handleError(_0x186axa,_0x186axc){logger[_0x7e25[46]](_0x186axc[_0x7e25[45]]);return _0x186axa[_0x7e25[15]](500)[_0x7e25[14]](_0x186axc)}
\ No newline at end of file