Built motion from commit 76eb00b9e.|1.0.24
[motion.git] / server / api / tag / tag.controller.js
1 var _0x1a02=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x54\x61\x67","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x43\x68\x61\x74\x42\x79\x54\x61\x67","\x25","\x74\x61\x67","\x3B\x25","\x6D\x65\x72\x67\x65","\x67\x65\x74\x4D\x61\x69\x6C\x42\x79\x54\x61\x67","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x67\x65\x74\x46\x61\x78\x42\x79\x54\x61\x67","\x67\x65\x74\x53\x6D\x73\x42\x79\x54\x61\x67","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73\x42\x79\x54\x61\x67","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x6D\x65\x73\x73\x61\x67\x65","\x54\x61\x67\x20\x69\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x61\x6E\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x27\x73\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x5A\x65\x6E\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x73","\x6C\x65\x6E\x67\x74\x68","\x46\x72\x65\x73\x68\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x73"];_0x1a02[0];var _=require(_0x1a02[1]);var Tag=require(_0x1a02[3])[_0x1a02[2]];var ChatRoom=require(_0x1a02[3])[_0x1a02[4]];var ChatWebsite=require(_0x1a02[3])[_0x1a02[5]];var ChatVisitor=require(_0x1a02[3])[_0x1a02[6]];var MailRoom=require(_0x1a02[3])[_0x1a02[7]];var FaxRoom=require(_0x1a02[3])[_0x1a02[8]];var SmsRoom=require(_0x1a02[3])[_0x1a02[9]];var Contact=require(_0x1a02[3])[_0x1a02[10]];var Util=require(_0x1a02[11]);var logger=require(_0x1a02[13])(_0x1a02[12]);exports[_0x1a02[14]]= function(_0xb1ccxc,_0xb1ccxd,_0xb1ccxe){return Tag[_0x1a02[21]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]]))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[22]]= function(_0xb1ccxc,_0xb1ccxd){return Tag[_0x1a02[26]](_0xb1ccxc[_0x1a02[25]][_0x1a02[24]])[_0x1a02[18]](function(_0xb1ccx11){if(!_0xb1ccx11){return _0xb1ccxd[_0x1a02[23]](404)};return _0xb1ccxd[_0x1a02[16]](_0xb1ccx11)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[27]]= function(_0xb1ccxc,_0xb1ccxd){return ChatRoom[_0x1a02[21]](_[_0x1a02[31]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]],{tags:{$like:_0x1a02[28]+ _0xb1ccxc[_0x1a02[25]][_0x1a02[29]]+ _0x1a02[30]}}),{include:[ChatWebsite,ChatVisitor]}))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[32]]= function(_0xb1ccxc,_0xb1ccxd){return MailRoom[_0x1a02[34]](_0x1a02[33])[_0x1a02[21]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]],{tags:{$like:_0x1a02[28]+ _0xb1ccxc[_0x1a02[25]][_0x1a02[29]]+ _0x1a02[30]}}))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[35]]= function(_0xb1ccxc,_0xb1ccxd){return FaxRoom[_0x1a02[34]](_0x1a02[33])[_0x1a02[21]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]],{tags:{$like:_0x1a02[28]+ _0xb1ccxc[_0x1a02[25]][_0x1a02[29]]+ _0x1a02[30]}}))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[36]]= function(_0xb1ccxc,_0xb1ccxd){return SmsRoom[_0x1a02[34]](_0x1a02[33])[_0x1a02[21]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]],{tags:{$like:_0x1a02[28]+ _0xb1ccxc[_0x1a02[25]][_0x1a02[29]]+ _0x1a02[30]}}))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[37]]= function(_0xb1ccxc,_0xb1ccxd){return Contact[_0x1a02[34]](_0x1a02[38],_0x1a02[39],{method:[_0x1a02[40],_0xb1ccxc[_0x1a02[19]]]})[_0x1a02[21]](Util[_0x1a02[20]](_0xb1ccxc[_0x1a02[19]],{tags:{$like:_0x1a02[28]+ _0xb1ccxc[_0x1a02[25]][_0x1a02[29]]+ _0x1a02[30]}}))[_0x1a02[18]](function(_0xb1ccx10){_0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx10)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[41]]= function(_0xb1ccxc,_0xb1ccxd){return Tag[_0x1a02[41]](_0xb1ccxc[_0x1a02[42]])[_0x1a02[18]](function(_0xb1ccx11){return _0xb1ccxd[_0x1a02[17]](201)[_0x1a02[16]](_0xb1ccx11)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[43]]= function(_0xb1ccxc,_0xb1ccxd){if(_0xb1ccxc[_0x1a02[42]][_0x1a02[24]]){delete _0xb1ccxc[_0x1a02[42]][_0x1a02[24]]};return Tag[_0x1a02[26]](_0xb1ccxc[_0x1a02[25]][_0x1a02[24]])[_0x1a02[18]](function(_0xb1ccx11){if(!_0xb1ccx11){return _0xb1ccxd[_0x1a02[23]](404)};var _0xb1ccx12=_[_0x1a02[31]](_0xb1ccx11,_0xb1ccxc[_0x1a02[42]]);return _0xb1ccx12[_0x1a02[44]]()})[_0x1a02[18]](function(_0xb1ccx11){return _0xb1ccxd[_0x1a02[17]](200)[_0x1a02[16]](_0xb1ccx11)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[45]]= function(_0xb1ccxc,_0xb1ccxd){return Tag[_0x1a02[34]](_0x1a02[48])[_0x1a02[26]](_0xb1ccxc[_0x1a02[25]][_0x1a02[24]])[_0x1a02[18]](function(_0xb1ccx11){if(!_0xb1ccx11){return _0xb1ccxd[_0x1a02[23]](404)};if(tagHasAssociation(_0xb1ccx11)){var _0xb1ccxf= new Error();_0xb1ccxf[_0x1a02[46]]= _0x1a02[47];throw _0xb1ccxf};return _0xb1ccx11[_0x1a02[45]]()})[_0x1a02[18]](function(){return _0xb1ccxd[_0x1a02[23]](204)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};exports[_0x1a02[49]]= function(_0xb1ccxc,_0xb1ccxd){return Tag[_0x1a02[45]]({where:{id:_0xb1ccxc[_0x1a02[19]][_0x1a02[50]]},individualHooks:true})[_0x1a02[18]](function(){return _0xb1ccxd[_0x1a02[23]](204)})[_0x1a02[15]](function(_0xb1ccxf){return handleError(_0xb1ccxd,_0xb1ccxf)})};function handleError(_0xb1ccxd,_0xb1ccxf){logger[_0x1a02[52]](_0xb1ccxf[_0x1a02[51]]);return _0xb1ccxd[_0x1a02[17]](500)[_0x1a02[16]](_0xb1ccxf)}function tagHasAssociation(_0xb1ccx11){return ((_0xb1ccx11[_0x1a02[53]]&& _0xb1ccx11[_0x1a02[53]][_0x1a02[54]]> 0)|| (_0xb1ccx11[_0x1a02[55]]&& _0xb1ccx11[_0x1a02[55]][_0x1a02[54]]> 0))}